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 | |
| 41 | #include <common.h> |
| 42 | #include <asm/processor.h> |
| 43 | #include "xparameters.h" |
| 44 | |
| 45 | int |
| 46 | board_pre_init(void) |
| 47 | { |
| 48 | return 0; |
| 49 | } |
| 50 | |
| 51 | int |
| 52 | checkboard(void) |
| 53 | { |
| 54 | unsigned char *s = getenv("serial#"); |
| 55 | unsigned char *e; |
| 56 | |
| 57 | if (!s || strncmp(s, "ML300", 9)) { |
| 58 | printf("### No HW ID - assuming ML300"); |
| 59 | } else { |
| 60 | for (e = s; *e; ++e) { |
| 61 | if (*e == ' ') |
| 62 | break; |
| 63 | } |
| 64 | |
| 65 | for (; s < e; ++s) { |
| 66 | putc(*s); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | putc('\n'); |
| 71 | |
| 72 | return (0); |
| 73 | } |
| 74 | |
| 75 | long int |
| 76 | initdram(int board_type) |
| 77 | { |
| 78 | return 128 * 1024 * 1024; |
| 79 | } |
| 80 | |
| 81 | int |
| 82 | testdram(void) |
| 83 | { |
| 84 | printf("test: xxx MB - ok\n"); |
| 85 | |
| 86 | return (0); |
| 87 | } |
| 88 | |
| 89 | /* implement functions originally in cpu/ppc4xx/speed.c */ |
| 90 | void |
| 91 | get_sys_info(sys_info_t * sysInfo) |
| 92 | { |
| 93 | sysInfo->freqProcessor = XPAR_CORE_CLOCK_FREQ_HZ; |
| 94 | |
| 95 | /* only correct if the PLB and OPB run at the same frequency */ |
| 96 | sysInfo->freqPLB = XPAR_UARTNS550_0_CLOCK_FREQ_HZ; |
| 97 | sysInfo->freqPCI = XPAR_UARTNS550_0_CLOCK_FREQ_HZ / 3; |
| 98 | } |
| 99 | |
| 100 | ulong |
| 101 | get_PCI_freq(void) |
| 102 | { |
| 103 | ulong val; |
| 104 | PPC405_SYS_INFO sys_info; |
| 105 | |
| 106 | get_sys_info(&sys_info); |
| 107 | val = sys_info.freqPCI; |
| 108 | return val; |
| 109 | } |