mv88f6281gtw_ge.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /*
  2. * Maintainer : Prafulla Wadaskar <prafulla@marvell.com>
  3. *
  4. * (C) Copyright 2009
  5. * Marvell Semiconductor <www.marvell.com>
  6. * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
  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., 51 Franklin Street, Fifth Floor, Boston,
  24. * MA 02110-1301 USA
  25. */
  26. #include <common.h>
  27. #include <netdev.h>
  28. #include <asm/arch/kirkwood.h>
  29. #include <asm/arch/mpp.h>
  30. #include "mv88f6281gtw_ge.h"
  31. DECLARE_GLOBAL_DATA_PTR;
  32. int board_early_init_f(void)
  33. {
  34. /*
  35. * default gpio configuration
  36. * There are maximum 64 gpios controlled through 2 sets of registers
  37. * the below configuration configures mainly initial LED status
  38. */
  39. kw_config_gpio(MV88F6281GTW_GE_OE_VAL_LOW,
  40. MV88F6281GTW_GE_OE_VAL_HIGH,
  41. MV88F6281GTW_GE_OE_LOW, MV88F6281GTW_GE_OE_HIGH);
  42. /* Multi-Purpose Pins Functionality configuration */
  43. u32 kwmpp_config[] = {
  44. MPP0_SPI_SCn,
  45. MPP1_SPI_MOSI,
  46. MPP2_SPI_SCK,
  47. MPP3_SPI_MISO,
  48. MPP4_GPIO,
  49. MPP5_GPO,
  50. MPP6_SYSRST_OUTn,
  51. MPP7_SPI_SCn,
  52. MPP8_TW_SDA,
  53. MPP9_TW_SCK,
  54. MPP10_UART0_TXD,
  55. MPP11_UART0_RXD,
  56. MPP12_GPO,
  57. MPP13_GPIO,
  58. MPP14_GPIO,
  59. MPP15_GPIO,
  60. MPP16_GPIO,
  61. MPP17_GPIO,
  62. MPP18_GPO,
  63. MPP19_GPO,
  64. MPP20_GPIO,
  65. MPP21_GPIO,
  66. MPP22_GPIO,
  67. MPP23_GPIO,
  68. MPP24_GPIO,
  69. MPP25_GPIO,
  70. MPP26_GPIO,
  71. MPP27_GPIO,
  72. MPP28_GPIO,
  73. MPP29_GPIO,
  74. MPP30_GPIO,
  75. MPP31_GPIO,
  76. MPP32_GPIO,
  77. MPP33_GPIO,
  78. MPP34_GPIO,
  79. MPP35_GPIO,
  80. MPP36_GPIO,
  81. MPP37_GPIO,
  82. MPP38_GPIO,
  83. MPP39_GPIO,
  84. MPP40_GPIO,
  85. MPP41_GPIO,
  86. MPP42_GPIO,
  87. MPP43_GPIO,
  88. MPP44_GPIO,
  89. MPP45_GPIO,
  90. MPP46_GPIO,
  91. MPP47_GPIO,
  92. MPP48_GPIO,
  93. MPP49_GPIO,
  94. 0
  95. };
  96. kirkwood_mpp_conf(kwmpp_config);
  97. return 0;
  98. }
  99. int board_init(void)
  100. {
  101. /*
  102. * arch number of board
  103. */
  104. gd->bd->bi_arch_number = MACH_TYPE_MV88F6281GTW_GE;
  105. /* adress of boot parameters */
  106. gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;
  107. return 0;
  108. }
  109. #ifdef CONFIG_MV88E61XX_SWITCH
  110. void reset_phy(void)
  111. {
  112. /* configure and initialize switch */
  113. struct mv88e61xx_config swcfg = {
  114. .name = "egiga0",
  115. .vlancfg = MV88E61XX_VLANCFG_ROUTER,
  116. .rgmii_delay = MV88E61XX_RGMII_DELAY_EN,
  117. .led_init = MV88E61XX_LED_INIT_EN,
  118. .mdip = MV88E61XX_MDIP_REVERSE,
  119. .portstate = MV88E61XX_PORTSTT_FORWARDING,
  120. .cpuport = (1 << 5),
  121. .ports_enabled = 0x3f
  122. };
  123. mv88e61xx_switch_initialize(&swcfg);
  124. }
  125. #endif /* CONFIG_MV88E61XX_SWITCH */