blob: fe4be28b13ce23eb852930f2f12a5cb15cf71313 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Luka Perkov9b914722012-09-05 08:01:25 +00002/*
3 * Copyright (C) 2009-2012
4 * Wojciech Dubowik <wojciech.dubowik@neratec.com>
Luka Perkov3fdf7592012-12-03 03:24:15 +00005 * Luka Perkov <luka@openwrt.org>
Luka Perkov9b914722012-09-05 08:01:25 +00006 */
7
8#include <common.h>
Simon Glass691d7192020-05-10 11:40:02 -06009#include <init.h>
Luka Perkov9b914722012-09-05 08:01:25 +000010#include <miiphy.h>
11#include <asm/arch/cpu.h>
Stefan Roese3dc23f72014-10-22 12:13:06 +020012#include <asm/arch/soc.h>
Luka Perkov9b914722012-09-05 08:01:25 +000013#include <asm/arch/mpp.h>
Simon Glass401d1c42020-10-30 21:38:53 -060014#include <asm/global_data.h>
Luka Perkov9b914722012-09-05 08:01:25 +000015#include "iconnect.h"
16
17DECLARE_GLOBAL_DATA_PTR;
18
19int board_early_init_f(void)
20{
21 /*
22 * default gpio configuration
23 * There are maximum 64 gpios controlled through 2 sets of registers
24 * the below configuration configures mainly initial LED status
25 */
Stefan Roesed5c51322014-10-22 12:13:11 +020026 mvebu_config_gpio(ICONNECT_OE_VAL_LOW,
27 ICONNECT_OE_VAL_HIGH,
28 ICONNECT_OE_LOW, ICONNECT_OE_HIGH);
Luka Perkov9b914722012-09-05 08:01:25 +000029
30 /* Multi-Purpose Pins Functionality configuration */
Albert ARIBAUD9d86f0c2012-11-26 11:27:36 +000031 static const u32 kwmpp_config[] = {
Luka Perkov9b914722012-09-05 08:01:25 +000032 MPP0_NF_IO2,
33 MPP1_NF_IO3,
34 MPP2_NF_IO4,
35 MPP3_NF_IO5,
36 MPP4_NF_IO6,
37 MPP5_NF_IO7,
38 MPP6_SYSRST_OUTn, /* Reset signal */
39 MPP7_GPO,
Wolfgang Denk3765b3e2013-10-07 13:07:26 +020040 MPP8_TW_SDA, /* I2C */
Luka Perkov9b914722012-09-05 08:01:25 +000041 MPP9_TW_SCK, /* I2C */
42 MPP10_UART0_TXD,
43 MPP11_UART0_RXD,
44 MPP12_GPO, /* Reset button */
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_GE1_0,
53 MPP21_GE1_1,
54 MPP22_GE1_2,
55 MPP23_GE1_3,
56 MPP24_GE1_4,
57 MPP25_GE1_5,
58 MPP26_GE1_6,
59 MPP27_GE1_7,
60 MPP28_GPIO,
61 MPP29_GPIO,
62 MPP30_GE1_10,
63 MPP31_GE1_11,
64 MPP32_GE1_12,
65 MPP33_GE1_13,
66 MPP34_GE1_14,
67 MPP35_GPIO, /* OTB button */
68 MPP36_AUDIO_SPDIFI,
69 MPP37_AUDIO_SPDIFO,
70 MPP38_GPIO,
71 MPP39_TDM_SPI_CS0,
72 MPP40_TDM_SPI_SCK,
73 MPP41_GPIO, /* LED brightness */
74 MPP42_GPIO, /* LED power (blue) */
75 MPP43_GPIO, /* LED power (red) */
76 MPP44_GPIO, /* LED USB 1 */
77 MPP45_GPIO, /* LED USB 2 */
78 MPP46_GPIO, /* LED USB 3 */
79 MPP47_GPIO, /* LED USB 4 */
80 MPP48_GPIO, /* LED OTB */
81 MPP49_GPIO,
82 0
83 };
84 kirkwood_mpp_conf(kwmpp_config, NULL);
85 return 0;
86}
87
88int board_init(void)
89{
90 /* adress of boot parameters */
Stefan Roese96c5f082014-10-22 12:13:13 +020091 gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100;
Luka Perkov9b914722012-09-05 08:01:25 +000092
93 return 0;
94}