1*83d290c5STom Rini // SPDX-License-Identifier: GPL-2.0+
29b914727SLuka Perkov /*
39b914727SLuka Perkov * Copyright (C) 2009-2012
49b914727SLuka Perkov * Wojciech Dubowik <wojciech.dubowik@neratec.com>
53fdf7596SLuka Perkov * Luka Perkov <luka@openwrt.org>
69b914727SLuka Perkov */
79b914727SLuka Perkov
89b914727SLuka Perkov #include <common.h>
99b914727SLuka Perkov #include <miiphy.h>
109b914727SLuka Perkov #include <asm/arch/cpu.h>
113dc23f78SStefan Roese #include <asm/arch/soc.h>
129b914727SLuka Perkov #include <asm/arch/mpp.h>
139b914727SLuka Perkov #include "iconnect.h"
149b914727SLuka Perkov
159b914727SLuka Perkov DECLARE_GLOBAL_DATA_PTR;
169b914727SLuka Perkov
board_early_init_f(void)179b914727SLuka Perkov int board_early_init_f(void)
189b914727SLuka Perkov {
199b914727SLuka Perkov /*
209b914727SLuka Perkov * default gpio configuration
219b914727SLuka Perkov * There are maximum 64 gpios controlled through 2 sets of registers
229b914727SLuka Perkov * the below configuration configures mainly initial LED status
239b914727SLuka Perkov */
24d5c5132fSStefan Roese mvebu_config_gpio(ICONNECT_OE_VAL_LOW,
259b914727SLuka Perkov ICONNECT_OE_VAL_HIGH,
269b914727SLuka Perkov ICONNECT_OE_LOW, ICONNECT_OE_HIGH);
279b914727SLuka Perkov
289b914727SLuka Perkov /* Multi-Purpose Pins Functionality configuration */
299d86f0c3SAlbert ARIBAUD static const u32 kwmpp_config[] = {
309b914727SLuka Perkov MPP0_NF_IO2,
319b914727SLuka Perkov MPP1_NF_IO3,
329b914727SLuka Perkov MPP2_NF_IO4,
339b914727SLuka Perkov MPP3_NF_IO5,
349b914727SLuka Perkov MPP4_NF_IO6,
359b914727SLuka Perkov MPP5_NF_IO7,
369b914727SLuka Perkov MPP6_SYSRST_OUTn, /* Reset signal */
379b914727SLuka Perkov MPP7_GPO,
389b914727SLuka Perkov MPP8_TW_SDA, /* I2C */
399b914727SLuka Perkov MPP9_TW_SCK, /* I2C */
409b914727SLuka Perkov MPP10_UART0_TXD,
419b914727SLuka Perkov MPP11_UART0_RXD,
429b914727SLuka Perkov MPP12_GPO, /* Reset button */
439b914727SLuka Perkov MPP13_SD_CMD,
449b914727SLuka Perkov MPP14_SD_D0,
459b914727SLuka Perkov MPP15_SD_D1,
469b914727SLuka Perkov MPP16_SD_D2,
479b914727SLuka Perkov MPP17_SD_D3,
489b914727SLuka Perkov MPP18_NF_IO0,
499b914727SLuka Perkov MPP19_NF_IO1,
509b914727SLuka Perkov MPP20_GE1_0,
519b914727SLuka Perkov MPP21_GE1_1,
529b914727SLuka Perkov MPP22_GE1_2,
539b914727SLuka Perkov MPP23_GE1_3,
549b914727SLuka Perkov MPP24_GE1_4,
559b914727SLuka Perkov MPP25_GE1_5,
569b914727SLuka Perkov MPP26_GE1_6,
579b914727SLuka Perkov MPP27_GE1_7,
589b914727SLuka Perkov MPP28_GPIO,
599b914727SLuka Perkov MPP29_GPIO,
609b914727SLuka Perkov MPP30_GE1_10,
619b914727SLuka Perkov MPP31_GE1_11,
629b914727SLuka Perkov MPP32_GE1_12,
639b914727SLuka Perkov MPP33_GE1_13,
649b914727SLuka Perkov MPP34_GE1_14,
659b914727SLuka Perkov MPP35_GPIO, /* OTB button */
669b914727SLuka Perkov MPP36_AUDIO_SPDIFI,
679b914727SLuka Perkov MPP37_AUDIO_SPDIFO,
689b914727SLuka Perkov MPP38_GPIO,
699b914727SLuka Perkov MPP39_TDM_SPI_CS0,
709b914727SLuka Perkov MPP40_TDM_SPI_SCK,
719b914727SLuka Perkov MPP41_GPIO, /* LED brightness */
729b914727SLuka Perkov MPP42_GPIO, /* LED power (blue) */
739b914727SLuka Perkov MPP43_GPIO, /* LED power (red) */
749b914727SLuka Perkov MPP44_GPIO, /* LED USB 1 */
759b914727SLuka Perkov MPP45_GPIO, /* LED USB 2 */
769b914727SLuka Perkov MPP46_GPIO, /* LED USB 3 */
779b914727SLuka Perkov MPP47_GPIO, /* LED USB 4 */
789b914727SLuka Perkov MPP48_GPIO, /* LED OTB */
799b914727SLuka Perkov MPP49_GPIO,
809b914727SLuka Perkov 0
819b914727SLuka Perkov };
829b914727SLuka Perkov kirkwood_mpp_conf(kwmpp_config, NULL);
839b914727SLuka Perkov return 0;
849b914727SLuka Perkov }
859b914727SLuka Perkov
board_init(void)869b914727SLuka Perkov int board_init(void)
879b914727SLuka Perkov {
889b914727SLuka Perkov /* adress of boot parameters */
8996c5f081SStefan Roese gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100;
909b914727SLuka Perkov
919b914727SLuka Perkov return 0;
929b914727SLuka Perkov }
93