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