B2.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /*
  2. * (C) Copyright 2004
  3. * DAVE Srl
  4. * http://www.dave-tech.it
  5. * http://www.wawnet.biz
  6. * mailto:info@wawnet.biz
  7. *
  8. * See file CREDITS for list of people who contributed to this
  9. * project.
  10. *
  11. * This program is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Public License as
  13. * published by the Free Software Foundation; either version 2 of
  14. * the License, or (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  24. * MA 02111-1307 USA
  25. */
  26. #include <common.h>
  27. #include <netdev.h>
  28. #include <asm/hardware.h>
  29. DECLARE_GLOBAL_DATA_PTR;
  30. /*
  31. * Miscelaneous platform dependent initialization
  32. */
  33. int board_init (void)
  34. {
  35. u32 temp;
  36. /* Configuration Port Control Register*/
  37. /* Port A */
  38. PCONA = 0x3ff;
  39. /* Port B */
  40. PCONB = 0xff;
  41. PDATB = 0xFFFF;
  42. /* Port C */
  43. /*
  44. PCONC = 0xff55ff15;
  45. PDATC = 0x0;
  46. PUPC = 0xffff;
  47. */
  48. /* Port D */
  49. /*
  50. PCOND = 0xaaaa;
  51. PUPD = 0xff;
  52. */
  53. /* Port E */
  54. PCONE = 0x0001aaa9;
  55. PDATE = 0x0;
  56. PUPE = 0xff;
  57. /* Port F */
  58. PCONF = 0x124955;
  59. PDATF = 0xff; /* B2-eth_reset tied high level */
  60. /*
  61. PUPF = 0x1e3;
  62. */
  63. /* Port G */
  64. PUPG = 0x1;
  65. PCONG = 0x3; /*PG0= EINT0= ETH_INT prepared for linux kernel*/
  66. INTMSK = 0x03fffeff;
  67. INTCON = 0x05;
  68. /*
  69. Configure chip ethernet interrupt as High level
  70. Port G EINT 0-7 EINT0 -> CHIP ETHERNET
  71. */
  72. temp = EXTINT;
  73. temp &= ~0x7;
  74. temp |= 0x1; /*LEVEL_HIGH*/
  75. EXTINT = temp;
  76. /*
  77. Reset SMSC LAN91C96 chip
  78. */
  79. temp= PCONF;
  80. temp |= 0x00000040;
  81. PCONF = temp;
  82. /* Reset high */
  83. temp = PDATF;
  84. temp |= (1 << 3);
  85. PDATF = temp;
  86. /* Short delay */
  87. for (temp=0;temp<10;temp++)
  88. {
  89. /* NOP */
  90. }
  91. /* Reset low */
  92. temp = PDATF;
  93. temp &= ~(1 << 3);
  94. PDATF = temp;
  95. /* arch number MACH_TYPE_MBA44B0 */
  96. gd->bd->bi_arch_number = MACH_TYPE_S3C44B0;
  97. /* location of boot parameters */
  98. gd->bd->bi_boot_params = 0x0c000100;
  99. return 0;
  100. }
  101. int dram_init (void)
  102. {
  103. gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
  104. gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
  105. return (0);
  106. }
  107. #ifdef CONFIG_CMD_NET
  108. int board_eth_init(bd_t *bis)
  109. {
  110. int rc = 0;
  111. #ifdef CONFIG_LAN91C96
  112. rc = lan91c96_initialize(0, CONFIG_LAN91C96_BASE);
  113. #endif
  114. return rc;
  115. }
  116. #endif