B2.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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 <asm/hardware.h>
  28. DECLARE_GLOBAL_DATA_PTR;
  29. /*
  30. * Miscelaneous platform dependent initialization
  31. */
  32. int board_init (void)
  33. {
  34. u32 temp;
  35. /* Configuration Port Control Register*/
  36. /* Port A */
  37. PCONA = 0x3ff;
  38. /* Port B */
  39. PCONB = 0xff;
  40. PDATB = 0xFFFF;
  41. /* Port C */
  42. /*
  43. PCONC = 0xff55ff15;
  44. PDATC = 0x0;
  45. PUPC = 0xffff;
  46. */
  47. /* Port D */
  48. /*
  49. PCOND = 0xaaaa;
  50. PUPD = 0xff;
  51. */
  52. /* Port E */
  53. PCONE = 0x0001aaa9;
  54. PDATE = 0x0;
  55. PUPE = 0xff;
  56. /* Port F */
  57. PCONF = 0x124955;
  58. PDATF = 0xff; /* B2-eth_reset tied high level */
  59. /*
  60. PUPF = 0x1e3;
  61. */
  62. /* Port G */
  63. PUPG = 0x1;
  64. PCONG = 0x3; /*PG0= EINT0= ETH_INT prepared for linux kernel*/
  65. INTMSK = 0x03fffeff;
  66. INTCON = 0x05;
  67. /*
  68. Configure chip ethernet interrupt as High level
  69. Port G EINT 0-7 EINT0 -> CHIP ETHERNET
  70. */
  71. temp = EXTINT;
  72. temp &= ~0x7;
  73. temp |= 0x1; /*LEVEL_HIGH*/
  74. EXTINT = temp;
  75. /*
  76. Reset SMSC LAN91C96 chip
  77. */
  78. temp= PCONF;
  79. temp |= 0x00000040;
  80. PCONF = temp;
  81. /* Reset high */
  82. temp = PDATF;
  83. temp |= (1 << 3);
  84. PDATF = temp;
  85. /* Short delay */
  86. for (temp=0;temp<10;temp++)
  87. {
  88. /* NOP */
  89. }
  90. /* Reset low */
  91. temp = PDATF;
  92. temp &= ~(1 << 3);
  93. PDATF = temp;
  94. /* arch number MACH_TYPE_MBA44B0 */
  95. gd->bd->bi_arch_number = MACH_TYPE_S3C44B0;
  96. /* location of boot parameters */
  97. gd->bd->bi_boot_params = 0x0c000100;
  98. return 0;
  99. }
  100. int dram_init (void)
  101. {
  102. gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
  103. gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
  104. return (0);
  105. }