1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
3 * Copyright (c) 2018 Microsemi Corporation
11 BOARD_TYPE_PCB106 = 0xAABBCD00,
15 int board_early_init_r(void)
17 /* Prepare SPI controller to be used in master mode */
18 writel(0, BASE_CFG + ICPU_SW_MODE);
20 /* Address of boot parameters */
21 gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE;
24 if (IS_ENABLED(CONFIG_LED))
30 static void do_board_detect(void)
34 /* Set MDIO and MDC */
35 mscc_gpio_set_alternate(9, 2);
36 mscc_gpio_set_alternate(10, 2);
39 mscc_phy_wr(1, 16, 31, 0x10);
40 if (!mscc_phy_rd(1, 16, 15, &gpio_in_reg)) {
41 if (gpio_in_reg & 0x200)
42 gd->board_type = BOARD_TYPE_PCB106;
44 gd->board_type = BOARD_TYPE_PCB105;
46 gd->board_type = BOARD_TYPE_PCB105;
48 mscc_phy_wr(1, 16, 31, 0x0);
51 #if defined(CONFIG_MULTI_DTB_FIT)
52 int board_fit_config_name_match(const char *name)
54 if (gd->board_type == BOARD_TYPE_PCB106 &&
55 strcmp(name, "serval_pcb106") == 0)
58 if (gd->board_type == BOARD_TYPE_PCB105 &&
59 strcmp(name, "serval_pcb105") == 0)
66 #if defined(CONFIG_DTB_RESELECT)
67 int embedded_dtb_select(void)