blob: db1b0adc38262616acbfd4506f2eb256e8f68163 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Luka Perkove5841e12012-04-17 09:22:17 +00002/*
3 * Copyright (C) 2011-2012
4 * Gerald Kerma <dreagle@doukki.net>
Luka Perkov3fdf7592012-12-03 03:24:15 +00005 * Luka Perkov <luka@openwrt.org>
Luka Perkove5841e12012-04-17 09:22:17 +00006 * Simon Baatz <gmbnomis@gmail.com>
Luka Perkove5841e12012-04-17 09:22:17 +00007 */
8
9#include <common.h>
Simon Glass691d7192020-05-10 11:40:02 -060010#include <init.h>
Luka Perkove5841e12012-04-17 09:22:17 +000011#include <miiphy.h>
Simon Baatza0452342012-07-20 09:59:14 +000012#include <asm/io.h>
Luka Perkove5841e12012-04-17 09:22:17 +000013#include <asm/arch/cpu.h>
Stefan Roese3dc23f72014-10-22 12:13:06 +020014#include <asm/arch/soc.h>
Luka Perkove5841e12012-04-17 09:22:17 +000015#include <asm/arch/mpp.h>
16#include "ib62x0.h"
17
18DECLARE_GLOBAL_DATA_PTR;
19
20int board_early_init_f(void)
21{
22 /*
23 * default gpio configuration
24 * There are maximum 64 gpios controlled through 2 sets of registers
25 * the below configuration configures mainly initial LED status
26 */
Stefan Roesed5c51322014-10-22 12:13:11 +020027 mvebu_config_gpio(IB62x0_OE_VAL_LOW,
28 IB62x0_OE_VAL_HIGH,
29 IB62x0_OE_LOW, IB62x0_OE_HIGH);
Luka Perkove5841e12012-04-17 09:22:17 +000030
Simon Baatza0452342012-07-20 09:59:14 +000031 /* Set SATA activity LEDs to default off */
32 writel(MVSATAHC_LED_POLARITY_CTRL, MVSATAHC_LED_CONF_REG);
Luka Perkove5841e12012-04-17 09:22:17 +000033 /* Multi-Purpose Pins Functionality configuration */
Albert ARIBAUD9d86f0c2012-11-26 11:27:36 +000034 static const u32 kwmpp_config[] = {
Luka Perkove5841e12012-04-17 09:22:17 +000035 MPP0_NF_IO2,
36 MPP1_NF_IO3,
37 MPP2_NF_IO4,
38 MPP3_NF_IO5,
39 MPP4_NF_IO6,
40 MPP5_NF_IO7,
41 MPP6_SYSRST_OUTn,
42 MPP8_TW_SDA,
43 MPP9_TW_SCK,
44 MPP10_UART0_TXD,
45 MPP11_UART0_RXD,
46 MPP18_NF_IO0,
47 MPP19_NF_IO1,
48 MPP20_SATA1_ACTn,
49 MPP21_SATA0_ACTn,
50 MPP22_GPIO, /* Power LED red */
51 MPP24_GPIO, /* Power off device */
52 MPP25_GPIO, /* Power LED green */
53 MPP27_GPIO, /* USB transfer LED */
54 MPP28_GPIO, /* Reset button */
55 MPP29_GPIO, /* USB Copy button */
56 0
57 };
Valentin Longchamp84683632012-06-01 01:31:00 +000058 kirkwood_mpp_conf(kwmpp_config, NULL);
Luka Perkove5841e12012-04-17 09:22:17 +000059 return 0;
60}
61
62int board_init(void)
63{
64 /* adress of boot parameters */
Stefan Roese96c5f082014-10-22 12:13:13 +020065 gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100;
Luka Perkove5841e12012-04-17 09:22:17 +000066
67 return 0;
68}