Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Luka Perkov | e5841e1 | 2012-04-17 09:22:17 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2011-2012 |
| 4 | * Gerald Kerma <dreagle@doukki.net> |
Luka Perkov | 3fdf759 | 2012-12-03 03:24:15 +0000 | [diff] [blame] | 5 | * Luka Perkov <luka@openwrt.org> |
Luka Perkov | e5841e1 | 2012-04-17 09:22:17 +0000 | [diff] [blame] | 6 | * Simon Baatz <gmbnomis@gmail.com> |
Luka Perkov | e5841e1 | 2012-04-17 09:22:17 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #include <common.h> |
| 10 | #include <miiphy.h> |
Simon Baatz | a045234 | 2012-07-20 09:59:14 +0000 | [diff] [blame] | 11 | #include <asm/io.h> |
Luka Perkov | e5841e1 | 2012-04-17 09:22:17 +0000 | [diff] [blame] | 12 | #include <asm/arch/cpu.h> |
Stefan Roese | 3dc23f7 | 2014-10-22 12:13:06 +0200 | [diff] [blame] | 13 | #include <asm/arch/soc.h> |
Luka Perkov | e5841e1 | 2012-04-17 09:22:17 +0000 | [diff] [blame] | 14 | #include <asm/arch/mpp.h> |
| 15 | #include "ib62x0.h" |
| 16 | |
| 17 | DECLARE_GLOBAL_DATA_PTR; |
| 18 | |
| 19 | int board_early_init_f(void) |
| 20 | { |
| 21 | /* |
| 22 | * default gpio configuration |
| 23 | * There are maximum 64 gpios controlled through 2 sets of registers |
| 24 | * the below configuration configures mainly initial LED status |
| 25 | */ |
Stefan Roese | d5c5132 | 2014-10-22 12:13:11 +0200 | [diff] [blame] | 26 | mvebu_config_gpio(IB62x0_OE_VAL_LOW, |
| 27 | IB62x0_OE_VAL_HIGH, |
| 28 | IB62x0_OE_LOW, IB62x0_OE_HIGH); |
Luka Perkov | e5841e1 | 2012-04-17 09:22:17 +0000 | [diff] [blame] | 29 | |
Simon Baatz | a045234 | 2012-07-20 09:59:14 +0000 | [diff] [blame] | 30 | /* Set SATA activity LEDs to default off */ |
| 31 | writel(MVSATAHC_LED_POLARITY_CTRL, MVSATAHC_LED_CONF_REG); |
Luka Perkov | e5841e1 | 2012-04-17 09:22:17 +0000 | [diff] [blame] | 32 | /* Multi-Purpose Pins Functionality configuration */ |
Albert ARIBAUD | 9d86f0c | 2012-11-26 11:27:36 +0000 | [diff] [blame] | 33 | static const u32 kwmpp_config[] = { |
Luka Perkov | e5841e1 | 2012-04-17 09:22:17 +0000 | [diff] [blame] | 34 | MPP0_NF_IO2, |
| 35 | MPP1_NF_IO3, |
| 36 | MPP2_NF_IO4, |
| 37 | MPP3_NF_IO5, |
| 38 | MPP4_NF_IO6, |
| 39 | MPP5_NF_IO7, |
| 40 | MPP6_SYSRST_OUTn, |
| 41 | MPP8_TW_SDA, |
| 42 | MPP9_TW_SCK, |
| 43 | MPP10_UART0_TXD, |
| 44 | MPP11_UART0_RXD, |
| 45 | MPP18_NF_IO0, |
| 46 | MPP19_NF_IO1, |
| 47 | MPP20_SATA1_ACTn, |
| 48 | MPP21_SATA0_ACTn, |
| 49 | MPP22_GPIO, /* Power LED red */ |
| 50 | MPP24_GPIO, /* Power off device */ |
| 51 | MPP25_GPIO, /* Power LED green */ |
| 52 | MPP27_GPIO, /* USB transfer LED */ |
| 53 | MPP28_GPIO, /* Reset button */ |
| 54 | MPP29_GPIO, /* USB Copy button */ |
| 55 | 0 |
| 56 | }; |
Valentin Longchamp | 8468363 | 2012-06-01 01:31:00 +0000 | [diff] [blame] | 57 | kirkwood_mpp_conf(kwmpp_config, NULL); |
Luka Perkov | e5841e1 | 2012-04-17 09:22:17 +0000 | [diff] [blame] | 58 | return 0; |
| 59 | } |
| 60 | |
| 61 | int board_init(void) |
| 62 | { |
| 63 | /* adress of boot parameters */ |
Stefan Roese | 96c5f08 | 2014-10-22 12:13:13 +0200 | [diff] [blame] | 64 | gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100; |
Luka Perkov | e5841e1 | 2012-04-17 09:22:17 +0000 | [diff] [blame] | 65 | |
| 66 | return 0; |
| 67 | } |