diff options
author | 2023-10-10 14:33:42 +0000 | |
---|---|---|
committer | 2023-10-10 14:33:42 +0000 | |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/u-boot/board/mscc | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/u-boot/board/mscc')
-rw-r--r-- | roms/u-boot/board/mscc/common/Makefile | 4 | ||||
-rw-r--r-- | roms/u-boot/board/mscc/common/spi.c | 32 | ||||
-rw-r--r-- | roms/u-boot/board/mscc/jr2/Kconfig | 15 | ||||
-rw-r--r-- | roms/u-boot/board/mscc/jr2/Makefile | 4 | ||||
-rw-r--r-- | roms/u-boot/board/mscc/jr2/jr2.c | 153 | ||||
-rw-r--r-- | roms/u-boot/board/mscc/luton/Kconfig | 14 | ||||
-rw-r--r-- | roms/u-boot/board/mscc/luton/Makefile | 3 | ||||
-rw-r--r-- | roms/u-boot/board/mscc/luton/luton.c | 84 | ||||
-rw-r--r-- | roms/u-boot/board/mscc/ocelot/Kconfig | 14 | ||||
-rw-r--r-- | roms/u-boot/board/mscc/ocelot/Makefile | 4 | ||||
-rw-r--r-- | roms/u-boot/board/mscc/ocelot/ocelot.c | 125 | ||||
-rw-r--r-- | roms/u-boot/board/mscc/serval/Kconfig | 14 | ||||
-rw-r--r-- | roms/u-boot/board/mscc/serval/Makefile | 3 | ||||
-rw-r--r-- | roms/u-boot/board/mscc/serval/serval.c | 89 | ||||
-rw-r--r-- | roms/u-boot/board/mscc/servalt/Kconfig | 14 | ||||
-rw-r--r-- | roms/u-boot/board/mscc/servalt/Makefile | 3 | ||||
-rw-r--r-- | roms/u-boot/board/mscc/servalt/servalt.c | 57 |
17 files changed, 632 insertions, 0 deletions
diff --git a/roms/u-boot/board/mscc/common/Makefile b/roms/u-boot/board/mscc/common/Makefile new file mode 100644 index 000000000..4f0eded85 --- /dev/null +++ b/roms/u-boot/board/mscc/common/Makefile @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +obj-$(CONFIG_SOC_JR2) := spi.o +obj-$(CONFIG_SOC_OCELOT) := spi.o diff --git a/roms/u-boot/board/mscc/common/spi.c b/roms/u-boot/board/mscc/common/spi.c new file mode 100644 index 000000000..45b964933 --- /dev/null +++ b/roms/u-boot/board/mscc/common/spi.c @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2018 Microsemi Coprporation + */ + +#include <common.h> +#include <asm/io.h> +#include <spi.h> +#include <linux/bitops.h> + +void external_cs_manage(struct udevice *dev, bool enable) +{ + u32 cs = spi_chip_select(dev); + /* IF_SI0_OWNER, select the owner of the SI interface + * Encoding: 0: SI Slave + * 1: SI Boot Master + * 2: SI Master Controller + */ + if (!enable) { + writel(ICPU_SW_MODE_SW_PIN_CTRL_MODE | + ICPU_SW_MODE_SW_SPI_CS(BIT(cs)), + BASE_CFG + ICPU_SW_MODE); + clrsetbits_le32(BASE_CFG + ICPU_GENERAL_CTRL, + ICPU_GENERAL_CTRL_IF_SI_OWNER_M, + ICPU_GENERAL_CTRL_IF_SI_OWNER(2)); + } else { + writel(0, BASE_CFG + ICPU_SW_MODE); + clrsetbits_le32(BASE_CFG + ICPU_GENERAL_CTRL, + ICPU_GENERAL_CTRL_IF_SI_OWNER_M, + ICPU_GENERAL_CTRL_IF_SI_OWNER(1)); + } +} diff --git a/roms/u-boot/board/mscc/jr2/Kconfig b/roms/u-boot/board/mscc/jr2/Kconfig new file mode 100644 index 000000000..68a2de8ca --- /dev/null +++ b/roms/u-boot/board/mscc/jr2/Kconfig @@ -0,0 +1,15 @@ +# SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +config SYS_VENDOR + default "mscc" + +if SOC_JR2 + +config SYS_BOARD + default "jr2" + +config SYS_CONFIG_NAME + default "jr2" + +endif + diff --git a/roms/u-boot/board/mscc/jr2/Makefile b/roms/u-boot/board/mscc/jr2/Makefile new file mode 100644 index 000000000..c1db2a904 --- /dev/null +++ b/roms/u-boot/board/mscc/jr2/Makefile @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +obj-$(CONFIG_SOC_JR2) := jr2.o + diff --git a/roms/u-boot/board/mscc/jr2/jr2.c b/roms/u-boot/board/mscc/jr2/jr2.c new file mode 100644 index 000000000..1c516aacd --- /dev/null +++ b/roms/u-boot/board/mscc/jr2/jr2.c @@ -0,0 +1,153 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2018 Microsemi Corporation + */ + +#include <common.h> +#include <image.h> +#include <init.h> +#include <asm/io.h> +#include <led.h> +#include <miiphy.h> +#include <linux/bitops.h> +#include <linux/delay.h> +#include <asm/global_data.h> + +enum { + BOARD_TYPE_PCB110 = 0xAABBCE00, + BOARD_TYPE_PCB111, + BOARD_TYPE_PCB112, +}; + +int board_early_init_r(void) +{ + /* Prepare SPI controller to be used in master mode */ + writel(0, BASE_CFG + ICPU_SW_MODE); + clrsetbits_le32(BASE_CFG + ICPU_GENERAL_CTRL, + ICPU_GENERAL_CTRL_IF_SI_OWNER_M, + ICPU_GENERAL_CTRL_IF_SI_OWNER(2)); + + /* 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 vcoreiii_gpio_set_alternate(int gpio, int mode) +{ + u32 mask; + u32 val0, val1; + void __iomem *reg0, *reg1; + + if (gpio < 32) { + mask = BIT(gpio); + reg0 = BASE_DEVCPU_GCB + GPIO_GPIO_ALT(0); + reg1 = BASE_DEVCPU_GCB + GPIO_GPIO_ALT(1); + } else { + gpio -= 32; + mask = BIT(gpio); + reg0 = BASE_DEVCPU_GCB + GPIO_GPIO_ALT1(0); + reg1 = BASE_DEVCPU_GCB + GPIO_GPIO_ALT1(1); + } + val0 = readl(reg0); + val1 = readl(reg1); + if (mode == 1) { + writel(val0 | mask, reg0); + writel(val1 & ~mask, reg1); + } else if (mode == 2) { + writel(val0 & ~mask, reg0); + writel(val1 | mask, reg1); + } else if (mode == 3) { + writel(val0 | mask, reg0); + writel(val1 | mask, reg1); + } else { + writel(val0 & ~mask, reg0); + writel(val1 & ~mask, reg1); + } +} + +int board_phy_config(struct phy_device *phydev) +{ + if (gd->board_type == BOARD_TYPE_PCB110 || + gd->board_type == BOARD_TYPE_PCB112) { + phy_write(phydev, 0, 31, 0x10); + phy_write(phydev, 0, 18, 0x80F0); + while (phy_read(phydev, 0, 18) & 0x8000) + ; + phy_write(phydev, 0, 31, 0); + } + if (gd->board_type == BOARD_TYPE_PCB111) { + phy_write(phydev, 0, 31, 0x10); + phy_write(phydev, 0, 18, 0x80A0); + while (phy_read(phydev, 0, 18) & 0x8000) + ; + phy_write(phydev, 0, 14, 0x800); + phy_write(phydev, 0, 31, 0); + } + + return 0; +} + +void board_debug_uart_init(void) +{ + /* too early for the pinctrl driver, so configure the UART pins here */ + vcoreiii_gpio_set_alternate(10, 1); + vcoreiii_gpio_set_alternate(11, 1); +} + +static void do_board_detect(void) +{ + int i; + u16 pval; + + /* MIIM 1 + 2 MDC/MDIO */ + for (i = 56; i < 60; i++) + vcoreiii_gpio_set_alternate(i, 1); + + /* small delay for settling the pins */ + mdelay(30); + + if (mscc_phy_rd(0, 0x10, 0x3, &pval) == 0 && + ((pval >> 4) & 0x3F) == 0x3c) { + gd->board_type = BOARD_TYPE_PCB112; /* Serval2-NID */ + } else if (mscc_phy_rd(1, 0x0, 0x3, &pval) == 0 && + ((pval >> 4) & 0x3F) == 0x3c) { + gd->board_type = BOARD_TYPE_PCB110; /* Jr2-24 */ + } else { + /* Fall-back */ + gd->board_type = BOARD_TYPE_PCB111; /* Jr2-48 */ + } +} + +#if defined(CONFIG_MULTI_DTB_FIT) +int board_fit_config_name_match(const char *name) +{ + if (gd->board_type == BOARD_TYPE_PCB110 && + strcmp(name, "jr2_pcb110") == 0) + return 0; + + if (gd->board_type == BOARD_TYPE_PCB111 && + strcmp(name, "jr2_pcb111") == 0) + return 0; + + if (gd->board_type == BOARD_TYPE_PCB112 && + strcmp(name, "serval2_pcb112") == 0) + return 0; + + return -1; +} +#endif + +#if defined(CONFIG_DTB_RESELECT) +int embedded_dtb_select(void) +{ + do_board_detect(); + fdtdec_setup(); + + return 0; +} +#endif diff --git a/roms/u-boot/board/mscc/luton/Kconfig b/roms/u-boot/board/mscc/luton/Kconfig new file mode 100644 index 000000000..e1199808d --- /dev/null +++ b/roms/u-boot/board/mscc/luton/Kconfig @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +if SOC_LUTON + +config SYS_VENDOR + default "mscc" + +config SYS_BOARD + default "luton" + +config SYS_CONFIG_NAME + default "luton" + +endif diff --git a/roms/u-boot/board/mscc/luton/Makefile b/roms/u-boot/board/mscc/luton/Makefile new file mode 100644 index 000000000..b27f7c773 --- /dev/null +++ b/roms/u-boot/board/mscc/luton/Makefile @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +obj-$(CONFIG_SOC_LUTON) := luton.o diff --git a/roms/u-boot/board/mscc/luton/luton.c b/roms/u-boot/board/mscc/luton/luton.c new file mode 100644 index 000000000..038902d08 --- /dev/null +++ b/roms/u-boot/board/mscc/luton/luton.c @@ -0,0 +1,84 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2018 Microsemi Corporation + */ + +#include <common.h> +#include <image.h> +#include <init.h> +#include <asm/global_data.h> +#include <asm/io.h> +#include <led.h> +#include <miiphy.h> + +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 */ + mscc_gpio_set_alternate(30, 1); + mscc_gpio_set_alternate(31, 1); +} + +int board_early_init_r(void) +{ + /* Prepare SPI controller to be used in master mode */ + writel(0, BASE_CFG + ICPU_SW_MODE); + + /* 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; +} + +int board_phy_config(struct phy_device *phydev) +{ + phy_write(phydev, 0, 31, 0x10); + phy_write(phydev, 0, 18, 0x80A0); + while (phy_read(phydev, 0, 18) & 0x8000) + ; + phy_write(phydev, 0, 31, 0); + 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 diff --git a/roms/u-boot/board/mscc/ocelot/Kconfig b/roms/u-boot/board/mscc/ocelot/Kconfig new file mode 100644 index 000000000..9ddc0880b --- /dev/null +++ b/roms/u-boot/board/mscc/ocelot/Kconfig @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +config SYS_VENDOR + default "mscc" + +if SOC_OCELOT + +config SYS_BOARD + default "ocelot" + +config SYS_CONFIG_NAME + default "ocelot" + +endif diff --git a/roms/u-boot/board/mscc/ocelot/Makefile b/roms/u-boot/board/mscc/ocelot/Makefile new file mode 100644 index 000000000..9f28c8126 --- /dev/null +++ b/roms/u-boot/board/mscc/ocelot/Makefile @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +obj-$(CONFIG_SOC_OCELOT) := ocelot.o + diff --git a/roms/u-boot/board/mscc/ocelot/ocelot.c b/roms/u-boot/board/mscc/ocelot/ocelot.c new file mode 100644 index 000000000..c462890bb --- /dev/null +++ b/roms/u-boot/board/mscc/ocelot/ocelot.c @@ -0,0 +1,125 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2018 Microsemi Corporation + */ + +#include <common.h> +#include <image.h> +#include <init.h> +#include <log.h> +#include <asm/global_data.h> +#include <asm/io.h> +#include <asm/addrspace.h> +#include <asm/types.h> +#include <spi.h> +#include <led.h> +#include <wait_bit.h> +#include <miiphy.h> +#include <linux/bitops.h> + +DECLARE_GLOBAL_DATA_PTR; + +enum { + BOARD_TYPE_PCB120 = 0xAABBCC00, + BOARD_TYPE_PCB123, +}; + +void mscc_switch_reset(bool enter) +{ + /* Nasty workaround to avoid GPIO19 (DDR!) being reset */ + mscc_gpio_set_alternate(19, 2); + + debug("applying SwC reset\n"); + + writel(ICPU_RESET_CORE_RST_PROTECT, BASE_CFG + ICPU_RESET); + writel(PERF_SOFT_RST_SOFT_CHIP_RST, BASE_DEVCPU_GCB + PERF_SOFT_RST); + + if (wait_for_bit_le32(BASE_DEVCPU_GCB + PERF_SOFT_RST, + PERF_SOFT_RST_SOFT_CHIP_RST, false, 5000, false)) + pr_err("Tiemout while waiting for switch reset\n"); + + /* + * Reset GPIO19 mode back as regular GPIO, output, high (DDR + * not reset) (Order is important) + */ + setbits_le32(BASE_DEVCPU_GCB + PERF_GPIO_OE, BIT(19)); + writel(BIT(19), BASE_DEVCPU_GCB + PERF_GPIO_OUT_SET); + mscc_gpio_set_alternate(19, 0); +} + +int board_phy_config(struct phy_device *phydev) +{ + if (gd->board_type == BOARD_TYPE_PCB123) + return 0; + + phy_write(phydev, 0, 31, 0x10); + phy_write(phydev, 0, 18, 0x80F0); + while (phy_read(phydev, 0, 18) & 0x8000) + ; + phy_write(phydev, 0, 31, 0); + + return 0; +} + +void board_debug_uart_init(void) +{ + /* too early for the pinctrl driver, so configure the UART pins here */ + mscc_gpio_set_alternate(6, 1); + mscc_gpio_set_alternate(7, 1); +} + +int board_early_init_r(void) +{ + /* Prepare SPI controller to be used in master mode */ + writel(0, BASE_CFG + ICPU_SW_MODE); + clrsetbits_le32(BASE_CFG + ICPU_GENERAL_CTRL, + ICPU_GENERAL_CTRL_IF_SI_OWNER_M, + ICPU_GENERAL_CTRL_IF_SI_OWNER(2)); + + /* 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) +{ + u16 dummy = 0; + + /* Enable MIIM */ + mscc_gpio_set_alternate(14, 1); + mscc_gpio_set_alternate(15, 1); + if (mscc_phy_rd(1, 0, 0, &dummy) == 0) + gd->board_type = BOARD_TYPE_PCB120; + else + gd->board_type = BOARD_TYPE_PCB123; +} + +#if defined(CONFIG_MULTI_DTB_FIT) +int board_fit_config_name_match(const char *name) +{ + if (gd->board_type == BOARD_TYPE_PCB120 && + strcmp(name, "ocelot_pcb120") == 0) + return 0; + + if (gd->board_type == BOARD_TYPE_PCB123 && + strcmp(name, "ocelot_pcb123") == 0) + return 0; + + return -1; +} +#endif + +#if defined(CONFIG_DTB_RESELECT) +int embedded_dtb_select(void) +{ + do_board_detect(); + fdtdec_setup(); + + return 0; +} +#endif diff --git a/roms/u-boot/board/mscc/serval/Kconfig b/roms/u-boot/board/mscc/serval/Kconfig new file mode 100644 index 000000000..64f1c683e --- /dev/null +++ b/roms/u-boot/board/mscc/serval/Kconfig @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +config SYS_VENDOR + default "mscc" + +if SOC_SERVAL + +config SYS_BOARD + default "serval" + +config SYS_CONFIG_NAME + default "serval" + +endif diff --git a/roms/u-boot/board/mscc/serval/Makefile b/roms/u-boot/board/mscc/serval/Makefile new file mode 100644 index 000000000..c7ba56e95 --- /dev/null +++ b/roms/u-boot/board/mscc/serval/Makefile @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +obj-$(CONFIG_SOC_SERVAL) := serval.o diff --git a/roms/u-boot/board/mscc/serval/serval.c b/roms/u-boot/board/mscc/serval/serval.c new file mode 100644 index 000000000..94c1c42b7 --- /dev/null +++ b/roms/u-boot/board/mscc/serval/serval.c @@ -0,0 +1,89 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2018 Microsemi Corporation + */ + +#include <common.h> +#include <image.h> +#include <init.h> +#include <asm/global_data.h> +#include <asm/io.h> +#include <led.h> +#include <miiphy.h> + +enum { + BOARD_TYPE_PCB106 = 0xAABBCD00, + BOARD_TYPE_PCB105, +}; + +int board_early_init_r(void) +{ + /* Prepare SPI controller to be used in master mode */ + writel(0, BASE_CFG + ICPU_SW_MODE); + + /* 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; +} + +int board_phy_config(struct phy_device *phydev) +{ + phy_write(phydev, 0, 31, 0x10); + phy_write(phydev, 0, 18, 0x80F0); + while (phy_read(phydev, 0, 18) & 0x8000) + ; + phy_write(phydev, 0, 14, 0x800); + phy_write(phydev, 0, 31, 0); + return 0; +} + +static void do_board_detect(void) +{ + u16 gpio_in_reg; + + /* Set MDIO and MDC */ + mscc_gpio_set_alternate(9, 2); + mscc_gpio_set_alternate(10, 2); + + /* Set GPIO page */ + mscc_phy_wr(1, 16, 31, 0x10); + if (!mscc_phy_rd(1, 16, 15, &gpio_in_reg)) { + if (gpio_in_reg & 0x200) + gd->board_type = BOARD_TYPE_PCB106; + else + gd->board_type = BOARD_TYPE_PCB105; + } else { + gd->board_type = BOARD_TYPE_PCB105; + } + mscc_phy_wr(1, 16, 31, 0x0); +} + +#if defined(CONFIG_MULTI_DTB_FIT) +int board_fit_config_name_match(const char *name) +{ + if (gd->board_type == BOARD_TYPE_PCB106 && + strcmp(name, "serval_pcb106") == 0) + return 0; + + if (gd->board_type == BOARD_TYPE_PCB105 && + strcmp(name, "serval_pcb105") == 0) + return 0; + + return -1; +} +#endif + +#if defined(CONFIG_DTB_RESELECT) +int embedded_dtb_select(void) +{ + do_board_detect(); + fdtdec_setup(); + + return 0; +} +#endif diff --git a/roms/u-boot/board/mscc/servalt/Kconfig b/roms/u-boot/board/mscc/servalt/Kconfig new file mode 100644 index 000000000..61140f89b --- /dev/null +++ b/roms/u-boot/board/mscc/servalt/Kconfig @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +config SYS_VENDOR + default "mscc" + +if SOC_SERVALT + +config SYS_BOARD + default "servalt" + +config SYS_CONFIG_NAME + default "servalt" + +endif diff --git a/roms/u-boot/board/mscc/servalt/Makefile b/roms/u-boot/board/mscc/servalt/Makefile new file mode 100644 index 000000000..9a37eeaba --- /dev/null +++ b/roms/u-boot/board/mscc/servalt/Makefile @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +obj-$(CONFIG_SOC_SERVALT) := servalt.o diff --git a/roms/u-boot/board/mscc/servalt/servalt.c b/roms/u-boot/board/mscc/servalt/servalt.c new file mode 100644 index 000000000..252d8e315 --- /dev/null +++ b/roms/u-boot/board/mscc/servalt/servalt.c @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2018 Microsemi Corporation + */ + +#include <common.h> +#include <image.h> +#include <init.h> +#include <asm/global_data.h> +#include <asm/io.h> +#include <led.h> + +DECLARE_GLOBAL_DATA_PTR; + +enum { + BOARD_TYPE_PCB116 = 0xAABBCE00, +}; + +int board_early_init_r(void) +{ + /* Prepare SPI controller to be used in master mode */ + writel(0, BASE_CFG + ICPU_SW_MODE); + + /* 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) +{ + gd->board_type = BOARD_TYPE_PCB116; /* ServalT */ +} + +#if defined(CONFIG_MULTI_DTB_FIT) +int board_fit_config_name_match(const char *name) +{ + if (gd->board_type == BOARD_TYPE_PCB116 && + strcmp(name, "servalt_pcb116") == 0) + return 0; + return -1; +} +#endif + +#if defined(CONFIG_DTB_RESELECT) +int embedded_dtb_select(void) +{ + do_board_detect(); + fdtdec_setup(); + + return 0; +} +#endif |