actux4.c 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /*
  2. * (C) Copyright 2007
  3. * Michael Schwingen, michael@schwingen.org
  4. *
  5. * (C) Copyright 2006
  6. * Stefan Roese, DENX Software Engineering, sr@denx.de.
  7. *
  8. * (C) Copyright 2002
  9. * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
  10. *
  11. * (C) Copyright 2002
  12. * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  13. * Marius Groeger <mgroeger@sysgo.de>
  14. *
  15. * See file CREDITS for list of people who contributed to this
  16. * project.
  17. *
  18. * This program is free software; you can redistribute it and/or
  19. * modify it under the terms of the GNU General Public License as
  20. * published by the Free Software Foundation; either version 2 of
  21. * the License, or (at your option) any later version.
  22. *
  23. * This program is distributed in the hope that it will be useful,
  24. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  25. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  26. * GNU General Public License for more details.
  27. *
  28. * You should have received a copy of the GNU General Public License
  29. * along with this program; if not, write to the Free Software
  30. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  31. * MA 02111-1307 USA
  32. */
  33. #include <common.h>
  34. #include <command.h>
  35. #include <malloc.h>
  36. #include <asm/arch/ixp425.h>
  37. #include <asm/io.h>
  38. #include <miiphy.h>
  39. #ifdef CONFIG_PCI
  40. #include <pci.h>
  41. #include <asm/arch/ixp425pci.h>
  42. #endif
  43. #include "actux4_hw.h"
  44. DECLARE_GLOBAL_DATA_PTR;
  45. int board_early_init_f(void)
  46. {
  47. writel(0xbd113c42, IXP425_EXP_CS1);
  48. return 0;
  49. }
  50. int board_init(void)
  51. {
  52. gd->bd->bi_arch_number = MACH_TYPE_ACTUX4;
  53. /* adress of boot parameters */
  54. gd->bd->bi_boot_params = 0x00000100;
  55. GPIO_OUTPUT_CLEAR(CONFIG_SYS_GPIO_nPWRON);
  56. GPIO_OUTPUT_ENABLE(CONFIG_SYS_GPIO_nPWRON);
  57. GPIO_OUTPUT_CLEAR(CONFIG_SYS_GPIO_IORST);
  58. GPIO_OUTPUT_ENABLE(CONFIG_SYS_GPIO_IORST);
  59. /* led not populated on board*/
  60. GPIO_OUTPUT_ENABLE(CONFIG_SYS_GPIO_LED3);
  61. GPIO_OUTPUT_SET(CONFIG_SYS_GPIO_LED3);
  62. /* middle LED */
  63. GPIO_OUTPUT_ENABLE(CONFIG_SYS_GPIO_LED2);
  64. GPIO_OUTPUT_SET(CONFIG_SYS_GPIO_LED2);
  65. /* right LED */
  66. /* weak pulldown = LED weak on */
  67. GPIO_OUTPUT_DISABLE(CONFIG_SYS_GPIO_LED1);
  68. GPIO_OUTPUT_SET(CONFIG_SYS_GPIO_LED1);
  69. /* Setup GPIO's for Interrupt inputs */
  70. GPIO_OUTPUT_DISABLE(CONFIG_SYS_GPIO_USBINTA);
  71. GPIO_OUTPUT_DISABLE(CONFIG_SYS_GPIO_USBINTB);
  72. GPIO_OUTPUT_DISABLE(CONFIG_SYS_GPIO_USBINTC);
  73. GPIO_OUTPUT_DISABLE(CONFIG_SYS_GPIO_RTCINT);
  74. GPIO_OUTPUT_DISABLE(CONFIG_SYS_GPIO_PCI_INTA);
  75. GPIO_OUTPUT_DISABLE(CONFIG_SYS_GPIO_PCI_INTB);
  76. GPIO_INT_ACT_LOW_SET(CONFIG_SYS_GPIO_USBINTA);
  77. GPIO_INT_ACT_LOW_SET(CONFIG_SYS_GPIO_USBINTB);
  78. GPIO_INT_ACT_LOW_SET(CONFIG_SYS_GPIO_USBINTC);
  79. GPIO_INT_ACT_LOW_SET(CONFIG_SYS_GPIO_RTCINT);
  80. GPIO_INT_ACT_LOW_SET(CONFIG_SYS_GPIO_PCI_INTA);
  81. GPIO_INT_ACT_LOW_SET(CONFIG_SYS_GPIO_PCI_INTB);
  82. /* Setup GPIO's for 33MHz clock output */
  83. writel(0x011001FF, IXP425_GPIO_GPCLKR);
  84. GPIO_OUTPUT_ENABLE(CONFIG_SYS_GPIO_EXTBUS_CLK);
  85. GPIO_OUTPUT_ENABLE(CONFIG_SYS_GPIO_PCI_CLK);
  86. udelay(10000);
  87. GPIO_OUTPUT_SET(CONFIG_SYS_GPIO_IORST);
  88. udelay(10000);
  89. GPIO_OUTPUT_CLEAR(CONFIG_SYS_GPIO_IORST);
  90. udelay(10000);
  91. GPIO_OUTPUT_SET(CONFIG_SYS_GPIO_IORST);
  92. return 0;
  93. }
  94. /* Check Board Identity */
  95. int checkboard(void)
  96. {
  97. puts("Board: AcTux-4\n");
  98. return 0;
  99. }
  100. int dram_init(void)
  101. {
  102. gd->ram_size = get_ram_size(CONFIG_SYS_SDRAM_BASE, 128<<20);
  103. return 0;
  104. }
  105. #ifdef CONFIG_PCI
  106. struct pci_controller hose;
  107. void pci_init_board(void)
  108. {
  109. pci_ixp_init(&hose);
  110. }
  111. #endif
  112. /*
  113. * Hardcoded flash setup:
  114. * Flash 0 is a non-CFI SST 39VF020 flash, 8 bit flash / 8 bit bus.
  115. * Flash 1 is an Intel *16 flash using the CFI driver.
  116. */
  117. ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t *info)
  118. {
  119. if (banknum == 0) { /* non-CFI boot flash */
  120. info->portwidth = 1;
  121. info->chipwidth = 1;
  122. info->interface = FLASH_CFI_X8;
  123. return 1;
  124. } else
  125. return 0;
  126. }