smdk2400.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. * (C) Copyright 2002
  3. * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  4. * Marius Groeger <mgroeger@sysgo.de>
  5. *
  6. * (C) Copyright 2002
  7. * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
  8. *
  9. * See file CREDITS for list of people who contributed to this
  10. * project.
  11. *
  12. * This program is free software; you can redistribute it and/or
  13. * modify it under the terms of the GNU General Public License as
  14. * published by the Free Software Foundation; either version 2 of
  15. * the License, or (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU General Public License
  23. * along with this program; if not, write to the Free Software
  24. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  25. * MA 02111-1307 USA
  26. */
  27. #include <common.h>
  28. #include <netdev.h>
  29. #include <asm/arch/s3c24x0_cpu.h>
  30. DECLARE_GLOBAL_DATA_PTR;
  31. #ifdef CONFIG_MODEM_SUPPORT
  32. static int key_pressed(void);
  33. int mdm_init (bd_t *);
  34. extern void disable_putc(void);
  35. extern void enable_putc(void);
  36. extern int hwflow_onoff(int);
  37. extern int do_mdm_init; /* defined in common/main.c */
  38. #endif /* CONFIG_MODEM_SUPPORT */
  39. /*
  40. * Miscellaneous platform dependent initialisations
  41. */
  42. int board_init (void)
  43. {
  44. struct s3c24x0_clock_power * const clk_power =
  45. s3c24x0_get_base_clock_power();
  46. struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
  47. /* memory and cpu-speed are setup before relocation */
  48. /* change the clock to be 50 MHz 1:1:1 */
  49. clk_power->mpllcon = 0x5c042;
  50. clk_power->clkdivn = 0;
  51. /* set up the I/O ports */
  52. gpio->pacon = 0x3ffff;
  53. gpio->pbcon = 0xaaaaaaaa;
  54. gpio->pbup = 0xffff;
  55. gpio->pecon = 0x0;
  56. gpio->peup = 0x0;
  57. #ifdef CONFIG_HWFLOW
  58. /*CTS[0] RTS[0] INPUT INPUT TXD[0] INPUT RXD[0] */
  59. /* 10, 10, 00, 00, 10, 00, 10 */
  60. gpio->pfcon = 0xa22;
  61. /* Disable pull-up on Rx, Tx, CTS and RTS pins */
  62. gpio->pfup = 0x35;
  63. #else
  64. /*INPUT INPUT INPUT INPUT TXD[0] INPUT RXD[0] */
  65. /* 00, 00, 00, 00, 10, 00, 10 */
  66. gpio->pfcon = 0x22;
  67. /* Disable pull-up on Rx and Tx pins */
  68. gpio->pfup = 0x5;
  69. #endif /* CONFIG_HWFLOW */
  70. gpio->pgcon = 0x0;
  71. gpio->pgup = 0x0;
  72. gpio->opencr = 0x0;
  73. /* arch number of SAMSUNG-Board to MACH_TYPE_SMDK2400 */
  74. gd->bd->bi_arch_number = MACH_TYPE_SMDK2400;
  75. /* adress of boot parameters */
  76. gd->bd->bi_boot_params = 0x0C000100;
  77. #ifdef CONFIG_MODEM_SUPPORT
  78. if (key_pressed()) {
  79. disable_putc(); /* modem doesn't understand banner etc */
  80. do_mdm_init = 1;
  81. }
  82. #endif /* CONFIG_MODEM_SUPPORT */
  83. return 0;
  84. }
  85. int dram_init (void)
  86. {
  87. gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
  88. gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
  89. return 0;
  90. }
  91. #ifdef CONFIG_MODEM_SUPPORT
  92. static int key_pressed(void)
  93. {
  94. int rc;
  95. if (1) { /* check for button push here, now just return 1 */
  96. rc = 1;
  97. }
  98. return rc;
  99. }
  100. #endif /* CONFIG_MODEM_SUPPORT */
  101. #ifdef CONFIG_CMD_NET
  102. int board_eth_init(bd_t *bis)
  103. {
  104. int rc = 0;
  105. #ifdef CONFIG_CS8900
  106. rc = cs8900_initialize(0, CONFIG_CS8900_BASE);
  107. #endif
  108. return rc;
  109. }
  110. #endif