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