Luka Perkov | 2a3ce88 | 2012-04-17 09:22:17 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011-2012 |
| 3 | * Gerald Kerma <dreagle@doukki.net> |
| 4 | * Luka Perkov <uboot@lukaperkov.net> |
| 5 | * Simon Baatz <gmbnomis@gmail.com> |
| 6 | * |
| 7 | * See file CREDITS for list of people who contributed to this |
| 8 | * project. |
| 9 | * |
| 10 | * This program is free software; you can redistribute it and/or |
| 11 | * modify it under the terms of the GNU General Public License as |
| 12 | * published by the Free Software Foundation; either version 2 of |
| 13 | * the License, or (at your option) any later version. |
| 14 | * |
| 15 | * This program is distributed in the hope that it will be useful, |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | * GNU General Public License for more details. |
| 19 | * |
| 20 | * You should have received a copy of the GNU General Public License |
| 21 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 22 | */ |
| 23 | |
| 24 | #include <common.h> |
| 25 | #include <miiphy.h> |
| 26 | #include <asm/arch/cpu.h> |
| 27 | #include <asm/arch/kirkwood.h> |
| 28 | #include <asm/arch/mpp.h> |
| 29 | #include "ib62x0.h" |
| 30 | |
| 31 | DECLARE_GLOBAL_DATA_PTR; |
| 32 | |
| 33 | int board_early_init_f(void) |
| 34 | { |
| 35 | /* |
| 36 | * default gpio configuration |
| 37 | * There are maximum 64 gpios controlled through 2 sets of registers |
| 38 | * the below configuration configures mainly initial LED status |
| 39 | */ |
| 40 | kw_config_gpio(IB62x0_OE_VAL_LOW, |
| 41 | IB62x0_OE_VAL_HIGH, |
| 42 | IB62x0_OE_LOW, IB62x0_OE_HIGH); |
| 43 | |
| 44 | /* Multi-Purpose Pins Functionality configuration */ |
| 45 | u32 kwmpp_config[] = { |
| 46 | MPP0_NF_IO2, |
| 47 | MPP1_NF_IO3, |
| 48 | MPP2_NF_IO4, |
| 49 | MPP3_NF_IO5, |
| 50 | MPP4_NF_IO6, |
| 51 | MPP5_NF_IO7, |
| 52 | MPP6_SYSRST_OUTn, |
| 53 | MPP8_TW_SDA, |
| 54 | MPP9_TW_SCK, |
| 55 | MPP10_UART0_TXD, |
| 56 | MPP11_UART0_RXD, |
| 57 | MPP18_NF_IO0, |
| 58 | MPP19_NF_IO1, |
| 59 | MPP20_SATA1_ACTn, |
| 60 | MPP21_SATA0_ACTn, |
| 61 | MPP22_GPIO, /* Power LED red */ |
| 62 | MPP24_GPIO, /* Power off device */ |
| 63 | MPP25_GPIO, /* Power LED green */ |
| 64 | MPP27_GPIO, /* USB transfer LED */ |
| 65 | MPP28_GPIO, /* Reset button */ |
| 66 | MPP29_GPIO, /* USB Copy button */ |
| 67 | 0 |
| 68 | }; |
Valentin Longchamp | 7d0d502 | 2012-06-01 01:31:00 +0000 | [diff] [blame^] | 69 | kirkwood_mpp_conf(kwmpp_config, NULL); |
Luka Perkov | 2a3ce88 | 2012-04-17 09:22:17 +0000 | [diff] [blame] | 70 | return 0; |
| 71 | } |
| 72 | |
| 73 | int board_init(void) |
| 74 | { |
| 75 | /* adress of boot parameters */ |
| 76 | gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100; |
| 77 | |
| 78 | return 0; |
| 79 | } |