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 | * |
| 6 | * See file CREDITS for list of people who contributed to this |
| 7 | * project. |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or |
| 10 | * modify it under the terms of the GNU General Public License as |
| 11 | * published by the Free Software Foundation; either version 2 of |
| 12 | * the License, or (at your option) any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License |
| 20 | * along with this program; if not, write to the Free Software |
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 22 | * MA 02111-1307 USA |
| 23 | * |
| 24 | * modifications for the Tsi108 Emul Board by avb@Tundra |
| 25 | */ |
| 26 | |
| 27 | /* |
roy zang | 92dda87 | 2006-12-01 11:47:36 +0800 | [diff] [blame] | 28 | * board support/init functions for the |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 29 | * Freescale MPC7448 HPC2 (High-Performance Computing 2 Platform). |
| 30 | */ |
| 31 | |
| 32 | #include <common.h> |
| 33 | #include <74xx_7xx.h> |
| 34 | #if defined(CONFIG_OF_FLAT_TREE) |
| 35 | #include <ft_build.h> |
roy zang | 92dda87 | 2006-12-01 11:47:36 +0800 | [diff] [blame] | 36 | extern void ft_cpu_setup (void *blob, bd_t *bd); |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 37 | #endif |
| 38 | |
| 39 | #undef DEBUG |
| 40 | |
Wolfgang Denk | d112a2c | 2007-09-15 20:48:41 +0200 | [diff] [blame] | 41 | DECLARE_GLOBAL_DATA_PTR; |
| 42 | |
roy zang | 92dda87 | 2006-12-01 11:47:36 +0800 | [diff] [blame] | 43 | extern void flush_data_cache (void); |
| 44 | extern void invalidate_l1_instruction_cache (void); |
| 45 | extern void tsi108_init_f (void); |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 46 | |
roy zang | 92dda87 | 2006-12-01 11:47:36 +0800 | [diff] [blame] | 47 | int display_mem_map (void); |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 48 | |
roy zang | 92dda87 | 2006-12-01 11:47:36 +0800 | [diff] [blame] | 49 | void after_reloc (ulong dest_addr) |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 50 | { |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 51 | /* |
| 52 | * Jump to the main U-Boot board init code |
| 53 | */ |
roy zang | 92dda87 | 2006-12-01 11:47:36 +0800 | [diff] [blame] | 54 | board_init_r ((gd_t *) gd, dest_addr); |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 55 | /* NOTREACHED */ |
| 56 | } |
| 57 | |
| 58 | /* |
| 59 | * Check Board Identity: |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 60 | * report board type |
| 61 | */ |
| 62 | |
roy zang | 92dda87 | 2006-12-01 11:47:36 +0800 | [diff] [blame] | 63 | int checkboard (void) |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 64 | { |
| 65 | int l_type = 0; |
| 66 | |
roy zang | 92dda87 | 2006-12-01 11:47:36 +0800 | [diff] [blame] | 67 | printf ("BOARD: %s\n", CFG_BOARD_NAME); |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 68 | return (l_type); |
| 69 | } |
| 70 | |
| 71 | /* |
| 72 | * Read Processor ID: |
| 73 | * |
| 74 | * report calling processor number |
| 75 | */ |
| 76 | |
roy zang | 92dda87 | 2006-12-01 11:47:36 +0800 | [diff] [blame] | 77 | int read_pid (void) |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 78 | { |
| 79 | return 0; /* we are on single CPU platform for a while */ |
| 80 | } |
| 81 | |
roy zang | 92dda87 | 2006-12-01 11:47:36 +0800 | [diff] [blame] | 82 | long int dram_size (int board_type) |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 83 | { |
| 84 | return 0x20000000; /* 256M bytes */ |
| 85 | } |
| 86 | |
roy zang | 92dda87 | 2006-12-01 11:47:36 +0800 | [diff] [blame] | 87 | long int initdram (int board_type) |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 88 | { |
roy zang | 92dda87 | 2006-12-01 11:47:36 +0800 | [diff] [blame] | 89 | return dram_size (board_type); |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 90 | } |
| 91 | |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 92 | #if defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP) |
| 93 | void |
roy zang | 92dda87 | 2006-12-01 11:47:36 +0800 | [diff] [blame] | 94 | ft_board_setup (void *blob, bd_t *bd) |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 95 | { |
| 96 | u32 *p; |
| 97 | int len; |
| 98 | |
roy zang | 92dda87 | 2006-12-01 11:47:36 +0800 | [diff] [blame] | 99 | ft_cpu_setup (blob, bd); |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 100 | |
roy zang | 92dda87 | 2006-12-01 11:47:36 +0800 | [diff] [blame] | 101 | p = ft_get_prop (blob, "/memory/reg", &len); |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 102 | if (p != NULL) { |
roy zang | 92dda87 | 2006-12-01 11:47:36 +0800 | [diff] [blame] | 103 | *p++ = cpu_to_be32 (bd->bi_memstart); |
| 104 | *p = cpu_to_be32 (bd->bi_memsize); |
roy zang | 4978adf | 2006-11-02 18:59:15 +0800 | [diff] [blame] | 105 | } |
| 106 | } |
| 107 | #endif |