vct.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /*
  2. * (C) Copyright 2008 Stefan Roese <sr@denx.de>, DENX Software Engineering
  3. *
  4. * Copyright (C) 2006 Micronas GmbH
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation; either version 2 of
  9. * the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  19. * MA 02111-1307 USA
  20. */
  21. #include <common.h>
  22. #include <command.h>
  23. #include <netdev.h>
  24. #include <asm/mipsregs.h>
  25. #include "vct.h"
  26. #if defined(CONFIG_VCT_PREMIUM)
  27. #define BOARD_NAME "PremiumD"
  28. #elif defined(CONFIG_VCT_PLATINUM)
  29. #define BOARD_NAME "PlatinumD"
  30. #elif defined(CONFIG_VCT_PLATINUMAVC)
  31. #define BOARD_NAME "PlatinumAVC"
  32. #else
  33. #error "vct: No board variant defined!"
  34. #endif
  35. #if defined(CONFIG_VCT_ONENAND)
  36. #define BOARD_NAME_ADD " OneNAND"
  37. #else
  38. #define BOARD_NAME_ADD " NOR"
  39. #endif
  40. int board_early_init_f(void)
  41. {
  42. /*
  43. * First initialize the PIN mulitplexing
  44. */
  45. vct_pin_mux_initialize();
  46. /*
  47. * Init the EBI very early so that FLASH can be accessed
  48. */
  49. ebi_initialize();
  50. return 0;
  51. }
  52. void _machine_restart(void)
  53. {
  54. reg_write(DCGU_EN_WDT_RESET(DCGU_BASE), DCGU_MAGIC_WDT);
  55. reg_write(WDT_TORR(WDT_BASE), 0x00);
  56. reg_write(WDT_CR(WDT_BASE), 0x1D);
  57. /*
  58. * Now wait for the watchdog to trigger the reset
  59. */
  60. udelay(1000000);
  61. }
  62. /*
  63. * SDRAM is already configured by the bootstrap code, only return the
  64. * auto-detected size here
  65. */
  66. phys_size_t initdram(int board_type)
  67. {
  68. return get_ram_size((long *)CONFIG_SYS_SDRAM_BASE,
  69. CONFIG_SYS_MBYTES_SDRAM << 20);
  70. }
  71. int checkboard(void)
  72. {
  73. char buf[64];
  74. int i = getenv_f("serial#", buf, sizeof(buf));
  75. u32 config0 = read_c0_prid();
  76. if ((config0 & 0xff0000) == PRID_COMP_LEGACY
  77. && (config0 & 0xff00) == PRID_IMP_LX4280) {
  78. puts("Board: MDED \n");
  79. printf("CPU: LX4280 id: 0x%02x, rev: 0x%02x\n",
  80. (config0 >> 8) & 0xFF, config0 & 0xFF);
  81. } else if ((config0 & 0xff0000) == PRID_COMP_MIPS
  82. && (config0 & 0xff00) == PRID_IMP_VGC) {
  83. u32 jedec_id = *((u32 *) 0xBEBC71A0);
  84. if ((((jedec_id) >> 12) & 0xFF) == 0x40) {
  85. puts("Board: VGCA \n");
  86. } else if ((((jedec_id) >> 12) & 0xFF) == 0x48
  87. || (((jedec_id) >> 12) & 0xFF) == 0x49) {
  88. puts("Board: VGCB \n");
  89. }
  90. printf("CPU: MIPS 4K id: 0x%02x, rev: 0x%02x\n",
  91. (config0 >> 8) & 0xFF, config0 & 0xFF);
  92. } else if (config0 == 0x19378) {
  93. printf("CPU: MIPS 24K id: 0x%02x, rev: 0x%02x\n",
  94. (config0 >> 8) & 0xFF, config0 & 0xFF);
  95. } else {
  96. printf("Unsupported cpu %d, proc_id=0x%x\n", config0 >> 24,
  97. config0);
  98. }
  99. printf("Board: Micronas VCT " BOARD_NAME BOARD_NAME_ADD);
  100. if (i > 0) {
  101. puts(", serial# ");
  102. puts(buf);
  103. }
  104. putc('\n');
  105. return 0;
  106. }
  107. int board_eth_init(bd_t *bis)
  108. {
  109. int rc = 0;
  110. #ifdef CONFIG_SMC911X
  111. rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
  112. #endif
  113. return rc;
  114. }