2 * Copyright (C) 2011-2012
3 * Gerald Kerma <dreagle@doukki.net>
4 * Luka Perkov <luka@openwrt.org>
5 * Simon Baatz <gmbnomis@gmail.com>
7 * SPDX-License-Identifier: GPL-2.0+
13 #include <asm/arch/cpu.h>
14 #include <asm/arch/kirkwood.h>
15 #include <asm/arch/mpp.h>
18 DECLARE_GLOBAL_DATA_PTR;
20 int board_early_init_f(void)
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
27 kw_config_gpio(IB62x0_OE_VAL_LOW,
29 IB62x0_OE_LOW, IB62x0_OE_HIGH);
31 /* Set SATA activity LEDs to default off */
32 writel(MVSATAHC_LED_POLARITY_CTRL, MVSATAHC_LED_CONF_REG);
33 /* Multi-Purpose Pins Functionality configuration */
34 static const u32 kwmpp_config[] = {
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 */
58 kirkwood_mpp_conf(kwmpp_config, NULL);
64 /* adress of boot parameters */
65 gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;