1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
3 * Copyright (c) 2018 Microsemi Corporation
13 BOARD_TYPE_PCB106 = 0xAABBCD00,
17 int board_early_init_r(void)
19 /* Prepare SPI controller to be used in master mode */
20 writel(0, BASE_CFG + ICPU_SW_MODE);
22 /* Address of boot parameters */
23 gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE;
26 if (IS_ENABLED(CONFIG_LED))
32 int board_phy_config(struct phy_device *phydev)
34 phy_write(phydev, 0, 31, 0x10);
35 phy_write(phydev, 0, 18, 0x80F0);
36 while (phy_read(phydev, 0, 18) & 0x8000)
38 phy_write(phydev, 0, 14, 0x800);
39 phy_write(phydev, 0, 31, 0);
43 static void do_board_detect(void)
47 /* Set MDIO and MDC */
48 mscc_gpio_set_alternate(9, 2);
49 mscc_gpio_set_alternate(10, 2);
52 mscc_phy_wr(1, 16, 31, 0x10);
53 if (!mscc_phy_rd(1, 16, 15, &gpio_in_reg)) {
54 if (gpio_in_reg & 0x200)
55 gd->board_type = BOARD_TYPE_PCB106;
57 gd->board_type = BOARD_TYPE_PCB105;
59 gd->board_type = BOARD_TYPE_PCB105;
61 mscc_phy_wr(1, 16, 31, 0x0);
64 #if defined(CONFIG_MULTI_DTB_FIT)
65 int board_fit_config_name_match(const char *name)
67 if (gd->board_type == BOARD_TYPE_PCB106 &&
68 strcmp(name, "serval_pcb106") == 0)
71 if (gd->board_type == BOARD_TYPE_PCB105 &&
72 strcmp(name, "serval_pcb105") == 0)
79 #if defined(CONFIG_DTB_RESELECT)
80 int embedded_dtb_select(void)