db-88f6281-bp.c 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. // SPDX-License-Identifier: GPL-2.0+
  2. #include <common.h>
  3. #include <init.h>
  4. #include <net.h>
  5. #include <linux/bitops.h>
  6. #include <linux/io.h>
  7. #include <miiphy.h>
  8. #include <netdev.h>
  9. #include <asm/arch/cpu.h>
  10. #include <asm/arch/soc.h>
  11. #include <asm/arch/mpp.h>
  12. #include <asm/arch/gpio.h>
  13. #define DB_88F6281_OE_LOW ~(BIT(7))
  14. #define DB_88F6281_OE_HIGH ~(BIT(15) | BIT(14) | BIT(13) | BIT(4))
  15. #define DB_88F6281_OE_VAL_LOW BIT(7)
  16. #define DB_88F6281_OE_VAL_HIGH 0
  17. DECLARE_GLOBAL_DATA_PTR;
  18. int board_early_init_f(void)
  19. {
  20. mvebu_config_gpio(DB_88F6281_OE_VAL_LOW,
  21. DB_88F6281_OE_VAL_HIGH,
  22. DB_88F6281_OE_LOW, DB_88F6281_OE_HIGH);
  23. /* Multi-Purpose Pins Functionality configuration */
  24. static const u32 kwmpp_config[] = {
  25. #ifdef CONFIG_CMD_NAND
  26. MPP0_NF_IO2,
  27. MPP1_NF_IO3,
  28. MPP2_NF_IO4,
  29. MPP3_NF_IO5,
  30. #else
  31. MPP0_SPI_SCn,
  32. MPP1_SPI_MOSI,
  33. MPP2_SPI_SCK,
  34. MPP3_SPI_MISO,
  35. #endif
  36. MPP4_NF_IO6,
  37. MPP5_NF_IO7,
  38. MPP6_SYSRST_OUTn,
  39. MPP7_GPO,
  40. MPP8_TW_SDA,
  41. MPP9_TW_SCK,
  42. MPP10_UART0_TXD,
  43. MPP11_UART0_RXD,
  44. MPP12_SD_CLK,
  45. MPP13_SD_CMD,
  46. MPP14_SD_D0,
  47. MPP15_SD_D1,
  48. MPP16_SD_D2,
  49. MPP17_SD_D3,
  50. MPP18_NF_IO0,
  51. MPP19_NF_IO1,
  52. MPP20_SATA1_ACTn,
  53. MPP21_SATA0_ACTn,
  54. MPP22_GPIO,
  55. MPP23_GPIO,
  56. MPP24_GPIO,
  57. MPP25_GPIO,
  58. MPP26_GPIO,
  59. MPP27_GPIO,
  60. MPP28_GPIO,
  61. MPP29_GPIO,
  62. MPP30_GPIO,
  63. MPP31_GPIO,
  64. MPP32_GPIO,
  65. MPP33_GPIO,
  66. MPP34_GPIO,
  67. MPP35_GPIO,
  68. MPP36_GPIO,
  69. MPP37_GPIO,
  70. MPP38_GPIO,
  71. MPP39_GPIO,
  72. MPP40_GPIO,
  73. MPP41_GPIO,
  74. MPP42_GPIO,
  75. MPP43_GPIO,
  76. MPP44_GPIO,
  77. MPP45_GPIO,
  78. MPP46_GPIO,
  79. MPP47_GPIO,
  80. MPP48_GPIO,
  81. MPP49_GPIO,
  82. 0
  83. };
  84. kirkwood_mpp_conf(kwmpp_config, NULL);
  85. return 0;
  86. }
  87. int board_init(void)
  88. {
  89. gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100;
  90. return 0;
  91. }
  92. #ifdef CONFIG_RESET_PHY_R
  93. /* automatically defined by kirkwood config.h */
  94. void reset_phy(void)
  95. {
  96. }
  97. #endif