1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
3 * Copyright (c) 2018 Microsemi Corporation
14 BOARD_TYPE_PCB106 = 0xAABBCD00,
18 int board_early_init_r(void)
20 /* Prepare SPI controller to be used in master mode */
21 writel(0, BASE_CFG + ICPU_SW_MODE);
23 /* Address of boot parameters */
24 gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE;
27 if (IS_ENABLED(CONFIG_LED))
33 int board_phy_config(struct phy_device *phydev)
35 phy_write(phydev, 0, 31, 0x10);
36 phy_write(phydev, 0, 18, 0x80F0);
37 while (phy_read(phydev, 0, 18) & 0x8000)
39 phy_write(phydev, 0, 14, 0x800);
40 phy_write(phydev, 0, 31, 0);
44 static void do_board_detect(void)
48 /* Set MDIO and MDC */
49 mscc_gpio_set_alternate(9, 2);
50 mscc_gpio_set_alternate(10, 2);
53 mscc_phy_wr(1, 16, 31, 0x10);
54 if (!mscc_phy_rd(1, 16, 15, &gpio_in_reg)) {
55 if (gpio_in_reg & 0x200)
56 gd->board_type = BOARD_TYPE_PCB106;
58 gd->board_type = BOARD_TYPE_PCB105;
60 gd->board_type = BOARD_TYPE_PCB105;
62 mscc_phy_wr(1, 16, 31, 0x0);
65 #if defined(CONFIG_MULTI_DTB_FIT)
66 int board_fit_config_name_match(const char *name)
68 if (gd->board_type == BOARD_TYPE_PCB106 &&
69 strcmp(name, "serval_pcb106") == 0)
72 if (gd->board_type == BOARD_TYPE_PCB105 &&
73 strcmp(name, "serval_pcb105") == 0)
80 #if defined(CONFIG_DTB_RESELECT)
81 int embedded_dtb_select(void)