wdenk | e537b3b | 2004-02-23 23:54:43 +0000 | [diff] [blame] | 1 | /* |
| 2 | * ml300.c: U-Boot platform support for Xilinx ML300 board |
| 3 | * |
| 4 | * Author: Xilinx, Inc. |
| 5 | * |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify it |
| 8 | * under the terms of the GNU General Public License as published by the |
| 9 | * Free Software Foundation; either version 2 of the License, or (at your |
| 10 | * option) any later version. |
| 11 | * |
| 12 | * |
| 13 | * XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A |
| 14 | * COURTESY TO YOU. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS |
| 15 | * ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION OR STANDARD, |
| 16 | * XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION IS FREE |
| 17 | * FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE FOR OBTAINING |
| 18 | * ANY THIRD PARTY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION. |
| 19 | * XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO |
| 20 | * THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO ANY |
| 21 | * WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE FROM |
| 22 | * CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND |
| 23 | * FITNESS FOR A PARTICULAR PURPOSE. |
| 24 | * |
| 25 | * |
| 26 | * Xilinx hardware products are not intended for use in life support |
| 27 | * appliances, devices, or systems. Use in such applications is |
| 28 | * expressly prohibited. |
| 29 | * |
| 30 | * |
| 31 | * (c) Copyright 2002-2004 Xilinx Inc. |
| 32 | * All rights reserved. |
| 33 | * |
| 34 | * |
| 35 | * You should have received a copy of the GNU General Public License along |
| 36 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 37 | * 675 Mass Ave, Cambridge, MA 02139, USA. |
| 38 | * |
| 39 | */ |
| 40 | |
Grant Likely | 63675bd | 2007-02-20 09:04:52 +0100 | [diff] [blame] | 41 | #include <config.h> |
wdenk | e537b3b | 2004-02-23 23:54:43 +0000 | [diff] [blame] | 42 | #include <common.h> |
| 43 | #include <asm/processor.h> |
wdenk | e537b3b | 2004-02-23 23:54:43 +0000 | [diff] [blame] | 44 | |
Jean-Christophe PLAGNIOL-VILLARD | e46af64 | 2008-09-05 09:19:30 +0200 | [diff] [blame] | 45 | #ifdef CONFIG_ENV_IS_IN_EEPROM |
wdenk | 97e8bda | 2004-09-29 22:43:59 +0000 | [diff] [blame] | 46 | extern void convert_env(void); |
| 47 | #endif |
| 48 | |
wdenk | e537b3b | 2004-02-23 23:54:43 +0000 | [diff] [blame] | 49 | int |
| 50 | board_pre_init(void) |
| 51 | { |
| 52 | return 0; |
| 53 | } |
| 54 | |
| 55 | int |
| 56 | checkboard(void) |
| 57 | { |
Wolfgang Denk | 7fb5266 | 2005-10-13 16:45:02 +0200 | [diff] [blame] | 58 | char tmp[64]; /* long enough for environment variables */ |
| 59 | char *s, *e; |
wdenk | 97e8bda | 2004-09-29 22:43:59 +0000 | [diff] [blame] | 60 | int i = getenv_r("L", tmp, sizeof (tmp)); |
wdenk | e537b3b | 2004-02-23 23:54:43 +0000 | [diff] [blame] | 61 | |
wdenk | 97e8bda | 2004-09-29 22:43:59 +0000 | [diff] [blame] | 62 | if (i < 0) { |
wdenk | e537b3b | 2004-02-23 23:54:43 +0000 | [diff] [blame] | 63 | printf("### No HW ID - assuming ML300"); |
| 64 | } else { |
wdenk | 97e8bda | 2004-09-29 22:43:59 +0000 | [diff] [blame] | 65 | for (e = tmp; *e; ++e) { |
wdenk | e537b3b | 2004-02-23 23:54:43 +0000 | [diff] [blame] | 66 | if (*e == ' ') |
| 67 | break; |
| 68 | } |
| 69 | |
wdenk | 97e8bda | 2004-09-29 22:43:59 +0000 | [diff] [blame] | 70 | printf("### Board Serial# is "); |
| 71 | |
| 72 | for (s = tmp; s < e; ++s) { |
wdenk | e537b3b | 2004-02-23 23:54:43 +0000 | [diff] [blame] | 73 | putc(*s); |
| 74 | } |
wdenk | e537b3b | 2004-02-23 23:54:43 +0000 | [diff] [blame] | 75 | |
wdenk | 97e8bda | 2004-09-29 22:43:59 +0000 | [diff] [blame] | 76 | } |
wdenk | e537b3b | 2004-02-23 23:54:43 +0000 | [diff] [blame] | 77 | putc('\n'); |
| 78 | |
| 79 | return (0); |
| 80 | } |
| 81 | |
Becky Bruce | bd99ae7 | 2008-06-09 16:03:40 -0500 | [diff] [blame] | 82 | phys_size_t |
wdenk | e537b3b | 2004-02-23 23:54:43 +0000 | [diff] [blame] | 83 | initdram(int board_type) |
| 84 | { |
| 85 | return 128 * 1024 * 1024; |
| 86 | } |
| 87 | |
| 88 | int |
| 89 | testdram(void) |
| 90 | { |
| 91 | printf("test: xxx MB - ok\n"); |
| 92 | |
| 93 | return (0); |
| 94 | } |
| 95 | |
| 96 | /* implement functions originally in cpu/ppc4xx/speed.c */ |
| 97 | void |
| 98 | get_sys_info(sys_info_t * sysInfo) |
| 99 | { |
| 100 | sysInfo->freqProcessor = XPAR_CORE_CLOCK_FREQ_HZ; |
| 101 | |
| 102 | /* only correct if the PLB and OPB run at the same frequency */ |
| 103 | sysInfo->freqPLB = XPAR_UARTNS550_0_CLOCK_FREQ_HZ; |
| 104 | sysInfo->freqPCI = XPAR_UARTNS550_0_CLOCK_FREQ_HZ / 3; |
| 105 | } |
| 106 | |
| 107 | ulong |
| 108 | get_PCI_freq(void) |
| 109 | { |
| 110 | ulong val; |
Stefan Roese | edd73f2 | 2007-10-21 08:12:41 +0200 | [diff] [blame] | 111 | PPC4xx_SYS_INFO sys_info; |
wdenk | e537b3b | 2004-02-23 23:54:43 +0000 | [diff] [blame] | 112 | |
| 113 | get_sys_info(&sys_info); |
| 114 | val = sys_info.freqPCI; |
| 115 | return val; |
| 116 | } |
wdenk | 97e8bda | 2004-09-29 22:43:59 +0000 | [diff] [blame] | 117 | |
| 118 | #ifdef CONFIG_MISC_INIT_R |
| 119 | |
| 120 | int |
| 121 | misc_init_r() |
| 122 | { |
| 123 | /* convert env name and value to u-boot standard */ |
| 124 | convert_env(); |
| 125 | return 0; |
| 126 | } |
| 127 | |
| 128 | #endif |