roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 1 | /* |
2 | * (C) Copyright 2005 Freescale Semiconductor, Inc. | ||||
3 | * | ||||
4 | * Roy Zang <tie-fei.zang@freescale.com> | ||||
5 | * | ||||
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 6 | * SPDX-License-Identifier: GPL-2.0+ |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 7 | * |
8 | * modifications for the Tsi108 Emul Board by avb@Tundra | ||||
9 | */ | ||||
10 | |||||
11 | /* | ||||
roy zang | 92dda87 | 2006-12-01 11:47:36 +0800 | [diff] [blame] | 12 | * board support/init functions for the |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 13 | * Freescale MPC7448 HPC2 (High-Performance Computing 2 Platform). |
14 | */ | ||||
15 | |||||
16 | #include <common.h> | ||||
17 | #include <74xx_7xx.h> | ||||
Gerald Van Baren | fcd91bb | 2008-06-03 20:34:45 -0400 | [diff] [blame] | 18 | #include <fdt_support.h> |
Ben Warren | 04e97e0 | 2008-08-31 09:59:33 -0700 | [diff] [blame] | 19 | #include <netdev.h> |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 20 | |
21 | #undef DEBUG | ||||
22 | |||||
Wolfgang Denk | d112a2c | 2007-09-15 20:48:41 +0200 | [diff] [blame] | 23 | DECLARE_GLOBAL_DATA_PTR; |
24 | |||||
roy zang | 92dda87 | 2006-12-01 11:47:36 +0800 | [diff] [blame] | 25 | extern void tsi108_init_f (void); |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 26 | |
roy zang | 92dda87 | 2006-12-01 11:47:36 +0800 | [diff] [blame] | 27 | int display_mem_map (void); |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 28 | |
roy zang | 92dda87 | 2006-12-01 11:47:36 +0800 | [diff] [blame] | 29 | void after_reloc (ulong dest_addr) |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 30 | { |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 31 | /* |
32 | * Jump to the main U-Boot board init code | ||||
33 | */ | ||||
roy zang | 92dda87 | 2006-12-01 11:47:36 +0800 | [diff] [blame] | 34 | board_init_r ((gd_t *) gd, dest_addr); |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 35 | /* NOTREACHED */ |
36 | } | ||||
37 | |||||
38 | /* | ||||
39 | * Check Board Identity: | ||||
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 40 | * report board type |
41 | */ | ||||
42 | |||||
roy zang | 92dda87 | 2006-12-01 11:47:36 +0800 | [diff] [blame] | 43 | int checkboard (void) |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 44 | { |
45 | int l_type = 0; | ||||
46 | |||||
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 47 | printf ("BOARD: %s\n", CONFIG_SYS_BOARD_NAME); |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 48 | return (l_type); |
49 | } | ||||
50 | |||||
51 | /* | ||||
52 | * Read Processor ID: | ||||
53 | * | ||||
54 | * report calling processor number | ||||
55 | */ | ||||
56 | |||||
roy zang | 92dda87 | 2006-12-01 11:47:36 +0800 | [diff] [blame] | 57 | int read_pid (void) |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 58 | { |
59 | return 0; /* we are on single CPU platform for a while */ | ||||
60 | } | ||||
61 | |||||
roy zang | 92dda87 | 2006-12-01 11:47:36 +0800 | [diff] [blame] | 62 | long int dram_size (int board_type) |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 63 | { |
64 | return 0x20000000; /* 256M bytes */ | ||||
65 | } | ||||
66 | |||||
Becky Bruce | bd99ae7 | 2008-06-09 16:03:40 -0500 | [diff] [blame] | 67 | phys_size_t initdram (int board_type) |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 68 | { |
roy zang | 92dda87 | 2006-12-01 11:47:36 +0800 | [diff] [blame] | 69 | return dram_size (board_type); |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 70 | } |
71 | |||||
Gerald Van Baren | 84714ba | 2008-06-03 20:24:58 -0400 | [diff] [blame] | 72 | #if defined(CONFIG_OF_BOARD_SETUP) |
Simon Glass | 2aec3cc | 2014-10-23 18:58:47 -0600 | [diff] [blame] | 73 | int ft_board_setup(void *blob, bd_t *bd) |
Gerald Van Baren | 84714ba | 2008-06-03 20:24:58 -0400 | [diff] [blame] | 74 | { |
75 | ft_cpu_setup(blob, bd); | ||||
76 | fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize); | ||||
Simon Glass | 2aec3cc | 2014-10-23 18:58:47 -0600 | [diff] [blame] | 77 | |
78 | return 0; | ||||
Gerald Van Baren | 84714ba | 2008-06-03 20:24:58 -0400 | [diff] [blame] | 79 | } |
80 | #endif | ||||
Ben Warren | 04e97e0 | 2008-08-31 09:59:33 -0700 | [diff] [blame] | 81 | |
82 | int board_eth_init(bd_t *bis) | ||||
83 | { | ||||
84 | int rc = 0; | ||||
85 | #if defined(CONFIG_TSI108_ETH) | ||||
86 | rc = tsi108_eth_initialize(bis); | ||||
87 | #endif | ||||
88 | return rc; | ||||
89 | } |