diff options
author | Tom Rini <trini@konsulko.com> | 2019-01-17 19:12:55 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-01-17 19:12:55 -0500 |
commit | f83ef0dac83110d20389eb71f09285f009f3d198 (patch) | |
tree | e653de97fa1b8873704bd3d8afa557464c67e73c /board/mscc/luton/luton.c | |
parent | e964df1e2ae7b2c041a9d767f03ad2b72a3f2ac7 (diff) | |
parent | 49f0b6bab919e6a9a509af841b43bbb49728dc45 (diff) |
Merge tag 'mips-pull-2019-11-16' of git://git.denx.de/u-boot-mips
- MIPS: mscc: various enhancements for Luton and Ocelot platforms
- MIPS: mscc: added support for Jaguar2 platform
- MIPS: optimised SPL linker script
- MIPS: bcm6368: fix restart flow issues
- MIPS: fixed CONFIG_OF_EMBED warnings for all MIPS boards
- MIPS: mt7688: small fixes and enhancements
- mmc: compile-out write support if disabled
Diffstat (limited to 'board/mscc/luton/luton.c')
-rw-r--r-- | board/mscc/luton/luton.c | 52 |
1 files changed, 48 insertions, 4 deletions
diff --git a/board/mscc/luton/luton.c b/board/mscc/luton/luton.c index 41fc6d56a7..807c717e33 100644 --- a/board/mscc/luton/luton.c +++ b/board/mscc/luton/luton.c @@ -5,16 +5,20 @@ #include <common.h> #include <asm/io.h> - -#define MSCC_GPIO_ALT0 0x88 -#define MSCC_GPIO_ALT1 0x8C +#include <led.h> DECLARE_GLOBAL_DATA_PTR; +enum { + BOARD_TYPE_PCB090 = 0xAABBCD00, + BOARD_TYPE_PCB091, +}; + void board_debug_uart_init(void) { /* too early for the pinctrl driver, so configure the UART pins here */ - setbits_le32(BASE_DEVCPU_GCB + MSCC_GPIO_ALT0, BIT(30) | BIT(31)); + mscc_gpio_set_alternate(30, 1); + mscc_gpio_set_alternate(31, 1); } int board_early_init_r(void) @@ -24,5 +28,45 @@ int board_early_init_r(void) /* Address of boot parameters */ gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE; + + /* LED setup */ + if (IS_ENABLED(CONFIG_LED)) + led_default_state(); + + return 0; +} + +static void do_board_detect(void) +{ + u32 chipid = (readl(BASE_DEVCPU_GCB + CHIP_ID) >> 12) & 0xFFFF; + + if (chipid == 0x7428 || chipid == 0x7424) + gd->board_type = BOARD_TYPE_PCB091; // Lu10 + else + gd->board_type = BOARD_TYPE_PCB090; // Lu26 +} + +#if defined(CONFIG_MULTI_DTB_FIT) +int board_fit_config_name_match(const char *name) +{ + if (gd->board_type == BOARD_TYPE_PCB090 && + strcmp(name, "luton_pcb090") == 0) + return 0; + + if (gd->board_type == BOARD_TYPE_PCB091 && + strcmp(name, "luton_pcb091") == 0) + return 0; + + return -1; +} +#endif + +#if defined(CONFIG_DTB_RESELECT) +int embedded_dtb_select(void) +{ + do_board_detect(); + fdtdec_setup(); + return 0; } +#endif |