ml300.c 2.9 KB

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