logodl.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /*
  2. * (C) 2002 Kyle Harris <kharris@nexus-tech.net>, Nexus Technologies, Inc.
  3. * (C) 2002 Marius Groeger <mgroeger@sysgo.de>, Sysgo GmbH
  4. * (C) 2003 Robert Schwebel <r.schwebel@pengutronix.de>, Pengutronix
  5. *
  6. * See file CREDITS for list of people who contributed to this
  7. * project.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License as
  11. * published by the Free Software Foundation; either version 2 of
  12. * the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  22. * MA 02111-1307 USA
  23. */
  24. #include <common.h>
  25. #include <netdev.h>
  26. #include <asm/arch/pxa-regs.h>
  27. DECLARE_GLOBAL_DATA_PTR;
  28. /**
  29. * board_init: - setup some data structures
  30. *
  31. * @return: 0 in case of success
  32. */
  33. int board_init (void)
  34. {
  35. /* memory and cpu-speed are setup before relocation */
  36. /* so we do _nothing_ here */
  37. gd->bd->bi_arch_number = MACH_TYPE_LOGODL;
  38. gd->bd->bi_boot_params = 0x08000100;
  39. gd->bd->bi_baudrate = CONFIG_BAUDRATE;
  40. (*((volatile short*)0x14800000)) = 0xff; /* power on eth0 */
  41. (*((volatile short*)0x14000000)) = 0xff; /* power on uart */
  42. return 0;
  43. }
  44. /**
  45. * dram_init: - setup dynamic RAM
  46. *
  47. * @return: 0 in case of success
  48. */
  49. int dram_init (void)
  50. {
  51. gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
  52. gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
  53. return 0;
  54. }
  55. /**
  56. * logodl_set_led: - switch LEDs on or off
  57. *
  58. * @param led: LED to switch (0,1)
  59. * @param state: switch on (1) or off (0)
  60. */
  61. void logodl_set_led(int led, int state)
  62. {
  63. switch(led) {
  64. case 0:
  65. if (state==1) {
  66. CONFIG_SYS_LED_A_CR = CONFIG_SYS_LED_A_BIT;
  67. } else if (state==0) {
  68. CONFIG_SYS_LED_A_SR = CONFIG_SYS_LED_A_BIT;
  69. }
  70. break;
  71. case 1:
  72. if (state==1) {
  73. CONFIG_SYS_LED_B_CR = CONFIG_SYS_LED_B_BIT;
  74. } else if (state==0) {
  75. CONFIG_SYS_LED_B_SR = CONFIG_SYS_LED_B_BIT;
  76. }
  77. break;
  78. }
  79. return;
  80. }
  81. /**
  82. * show_boot_progress: - indicate state of the boot process
  83. *
  84. * @param status: Status number - see README for details.
  85. *
  86. * The LOGOTRONIC does only have 2 LEDs, so we switch them on at the most
  87. * important states (1, 5, 15).
  88. */
  89. void show_boot_progress (int status)
  90. {
  91. if (status < -32) status = -1; /* let things compatible */
  92. /*
  93. switch(status) {
  94. case 1: logodl_set_led(0,1); break;
  95. case 5: logodl_set_led(1,1); break;
  96. case 15: logodl_set_led(2,1); break;
  97. }
  98. */
  99. logodl_set_led(0, (status & 1)==1);
  100. logodl_set_led(1, (status & 2)==2);
  101. return;
  102. }
  103. #ifdef CONFIG_CMD_NET
  104. int board_eth_init(bd_t *bis)
  105. {
  106. int rc = 0;
  107. #ifdef CONFIG_SMC91111
  108. rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
  109. #endif
  110. return rc;
  111. }
  112. #endif