2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2009-07-16 15:28:00 +00:00
|
|
|
/*
|
2022-04-17 23:42:32 +00:00
|
|
|
* Copyright (C) 2021-2022 Tony Dinh <mibodhi@gmail.com>
|
2009-07-16 15:28:00 +00:00
|
|
|
* (C) Copyright 2009
|
|
|
|
* Marvell Semiconductor <www.marvell.com>
|
|
|
|
* Written-by: Prafulla Wadaskar <prafulla@marvell.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
2020-05-10 17:40:02 +00:00
|
|
|
#include <init.h>
|
2022-04-17 23:42:32 +00:00
|
|
|
#include <netdev.h>
|
2020-10-31 03:38:53 +00:00
|
|
|
#include <asm/global_data.h>
|
2017-06-01 01:47:48 +00:00
|
|
|
#include <asm/mach-types.h>
|
2011-10-18 14:41:42 +00:00
|
|
|
#include <asm/arch/cpu.h>
|
2014-10-22 10:13:06 +00:00
|
|
|
#include <asm/arch/soc.h>
|
2009-07-16 15:28:00 +00:00
|
|
|
#include <asm/arch/mpp.h>
|
2022-04-17 23:42:32 +00:00
|
|
|
#include <linux/bitops.h>
|
2009-07-16 15:28:00 +00:00
|
|
|
|
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
|
2022-04-17 23:42:32 +00:00
|
|
|
#define SHEEVAPLUG_OE_LOW (~(0))
|
|
|
|
#define SHEEVAPLUG_OE_HIGH (~(0))
|
|
|
|
#define SHEEVAPLUG_OE_VAL_LOW BIT(29) /* USB_PWEN low */
|
|
|
|
#define SHEEVAPLUG_OE_VAL_HIGH BIT(17) /* LED pin high */
|
|
|
|
|
2010-10-20 14:42:27 +00:00
|
|
|
int board_early_init_f(void)
|
2009-07-16 15:28:00 +00:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
* default gpio configuration
|
|
|
|
* There are maximum 64 gpios controlled through 2 sets of registers
|
|
|
|
* the below configuration configures mainly initial LED status
|
|
|
|
*/
|
2014-10-22 10:13:11 +00:00
|
|
|
mvebu_config_gpio(SHEEVAPLUG_OE_VAL_LOW,
|
|
|
|
SHEEVAPLUG_OE_VAL_HIGH,
|
|
|
|
SHEEVAPLUG_OE_LOW, SHEEVAPLUG_OE_HIGH);
|
2009-07-16 15:28:00 +00:00
|
|
|
|
|
|
|
/* Multi-Purpose Pins Functionality configuration */
|
2012-11-26 11:27:36 +00:00
|
|
|
static const u32 kwmpp_config[] = {
|
2009-07-16 15:28:00 +00:00
|
|
|
MPP0_NF_IO2,
|
|
|
|
MPP1_NF_IO3,
|
|
|
|
MPP2_NF_IO4,
|
|
|
|
MPP3_NF_IO5,
|
|
|
|
MPP4_NF_IO6,
|
|
|
|
MPP5_NF_IO7,
|
|
|
|
MPP6_SYSRST_OUTn,
|
|
|
|
MPP7_GPO,
|
|
|
|
MPP8_UART0_RTS,
|
|
|
|
MPP9_UART0_CTS,
|
|
|
|
MPP10_UART0_TXD,
|
|
|
|
MPP11_UART0_RXD,
|
|
|
|
MPP12_SD_CLK,
|
|
|
|
MPP13_SD_CMD,
|
|
|
|
MPP14_SD_D0,
|
|
|
|
MPP15_SD_D1,
|
|
|
|
MPP16_SD_D2,
|
|
|
|
MPP17_SD_D3,
|
|
|
|
MPP18_NF_IO0,
|
|
|
|
MPP19_NF_IO1,
|
|
|
|
MPP20_GPIO,
|
|
|
|
MPP21_GPIO,
|
|
|
|
MPP22_GPIO,
|
|
|
|
MPP23_GPIO,
|
|
|
|
MPP24_GPIO,
|
|
|
|
MPP25_GPIO,
|
|
|
|
MPP26_GPIO,
|
|
|
|
MPP27_GPIO,
|
|
|
|
MPP28_GPIO,
|
|
|
|
MPP29_TSMP9,
|
|
|
|
MPP30_GPIO,
|
|
|
|
MPP31_GPIO,
|
|
|
|
MPP32_GPIO,
|
|
|
|
MPP33_GPIO,
|
|
|
|
MPP34_GPIO,
|
|
|
|
MPP35_GPIO,
|
|
|
|
MPP36_GPIO,
|
|
|
|
MPP37_GPIO,
|
|
|
|
MPP38_GPIO,
|
|
|
|
MPP39_GPIO,
|
|
|
|
MPP40_GPIO,
|
|
|
|
MPP41_GPIO,
|
|
|
|
MPP42_GPIO,
|
|
|
|
MPP43_GPIO,
|
|
|
|
MPP44_GPIO,
|
|
|
|
MPP45_GPIO,
|
|
|
|
MPP46_GPIO,
|
|
|
|
MPP47_GPIO,
|
|
|
|
MPP48_GPIO,
|
|
|
|
MPP49_GPIO,
|
|
|
|
0
|
|
|
|
};
|
2012-06-01 01:31:00 +00:00
|
|
|
kirkwood_mpp_conf(kwmpp_config, NULL);
|
2010-10-20 14:42:27 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2009-07-16 15:28:00 +00:00
|
|
|
|
2022-04-17 23:42:32 +00:00
|
|
|
int board_eth_init(struct bd_info *bis)
|
|
|
|
{
|
|
|
|
return cpu_eth_init(bis);
|
|
|
|
}
|
|
|
|
|
2010-10-20 14:42:27 +00:00
|
|
|
int board_init(void)
|
|
|
|
{
|
2009-07-16 15:28:00 +00:00
|
|
|
/*
|
|
|
|
* arch number of board
|
|
|
|
*/
|
|
|
|
gd->bd->bi_arch_number = MACH_TYPE_SHEEVAPLUG;
|
|
|
|
|
2022-04-17 23:42:32 +00:00
|
|
|
/* address of boot parameters */
|
2014-10-22 10:13:13 +00:00
|
|
|
gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100;
|
2009-07-16 15:28:00 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|