]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | // SPDX-License-Identifier: GPL-2.0+ |
e5841e12 LP |
2 | /* |
3 | * Copyright (C) 2011-2012 | |
4 | * Gerald Kerma <dreagle@doukki.net> | |
3fdf7596 | 5 | * Luka Perkov <luka@openwrt.org> |
e5841e12 | 6 | * Simon Baatz <gmbnomis@gmail.com> |
e5841e12 LP |
7 | */ |
8 | ||
d678a59d | 9 | #include <common.h> |
691d719d | 10 | #include <init.h> |
e5841e12 | 11 | #include <miiphy.h> |
401d1c4f | 12 | #include <asm/global_data.h> |
a0452346 | 13 | #include <asm/io.h> |
e5841e12 | 14 | #include <asm/arch/cpu.h> |
3dc23f78 | 15 | #include <asm/arch/soc.h> |
e5841e12 LP |
16 | #include <asm/arch/mpp.h> |
17 | #include "ib62x0.h" | |
18 | ||
19 | DECLARE_GLOBAL_DATA_PTR; | |
20 | ||
21 | int board_early_init_f(void) | |
22 | { | |
23 | /* | |
24 | * default gpio configuration | |
25 | * There are maximum 64 gpios controlled through 2 sets of registers | |
26 | * the below configuration configures mainly initial LED status | |
27 | */ | |
d5c5132f SR |
28 | mvebu_config_gpio(IB62x0_OE_VAL_LOW, |
29 | IB62x0_OE_VAL_HIGH, | |
30 | IB62x0_OE_LOW, IB62x0_OE_HIGH); | |
e5841e12 | 31 | |
a0452346 SB |
32 | /* Set SATA activity LEDs to default off */ |
33 | writel(MVSATAHC_LED_POLARITY_CTRL, MVSATAHC_LED_CONF_REG); | |
e5841e12 | 34 | /* Multi-Purpose Pins Functionality configuration */ |
9d86f0c3 | 35 | static const u32 kwmpp_config[] = { |
e5841e12 LP |
36 | MPP0_NF_IO2, |
37 | MPP1_NF_IO3, | |
38 | MPP2_NF_IO4, | |
39 | MPP3_NF_IO5, | |
40 | MPP4_NF_IO6, | |
41 | MPP5_NF_IO7, | |
42 | MPP6_SYSRST_OUTn, | |
43 | MPP8_TW_SDA, | |
44 | MPP9_TW_SCK, | |
45 | MPP10_UART0_TXD, | |
46 | MPP11_UART0_RXD, | |
47 | MPP18_NF_IO0, | |
48 | MPP19_NF_IO1, | |
49 | MPP20_SATA1_ACTn, | |
50 | MPP21_SATA0_ACTn, | |
51 | MPP22_GPIO, /* Power LED red */ | |
52 | MPP24_GPIO, /* Power off device */ | |
53 | MPP25_GPIO, /* Power LED green */ | |
54 | MPP27_GPIO, /* USB transfer LED */ | |
55 | MPP28_GPIO, /* Reset button */ | |
56 | MPP29_GPIO, /* USB Copy button */ | |
57 | 0 | |
58 | }; | |
84683638 | 59 | kirkwood_mpp_conf(kwmpp_config, NULL); |
e5841e12 LP |
60 | return 0; |
61 | } | |
62 | ||
63 | int board_init(void) | |
64 | { | |
65 | /* adress of boot parameters */ | |
96c5f081 | 66 | gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100; |
e5841e12 LP |
67 | |
68 | return 0; | |
69 | } |