blob: 62027bd6385e957a6d07a1ec6221febd5b342a1d [file] [log] [blame]
Chris Packham90b4a002019-04-13 20:21:18 +12001// SPDX-License-Identifier: GPL-2.0+
2
3#include <common.h>
Simon Glass97589732020-05-10 11:40:02 -06004#include <init.h>
Simon Glass0c364412019-12-28 10:44:48 -07005#include <net.h>
Simon Glass4dcacfc2020-05-10 11:40:13 -06006#include <linux/bitops.h>
Chris Packham90b4a002019-04-13 20:21:18 +12007#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
20DECLARE_GLOBAL_DATA_PTR;
21
22int 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
94int 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 */
103void reset_phy(void)
104{
105}
106#endif