3 * eInfochips Ltd. <www.einfochips.com>
4 * Written-by: Ajay Bhargav <contact@8051projects.net>
8 * Marvell Semiconductor <www.marvell.com>
9 * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
10 * Contributor: Mahavir Jain <mjain@marvell.com>
12 * SPDX-License-Identifier: GPL-2.0+
17 #include <asm/arch/cpu.h>
18 #include <asm/arch/mfp.h>
19 #include <asm/arch/armada100.h>
22 #include <asm/mach-types.h>
24 #ifdef CONFIG_ARMADA100_FEC
27 #endif /* CONFIG_ARMADA100_FEC */
29 DECLARE_GLOBAL_DATA_PTR;
31 int board_early_init_f(void)
38 /* Enable Console on UART3 */
42 /* Ethernet PHY Interface */
67 MFP_EOC /*End of configuration*/
76 struct armd1apb2_registers *apb2_regs =
77 (struct armd1apb2_registers *)ARMD1_APBC2_BASE;
79 /* arch number of Board */
80 gd->bd->bi_arch_number = MACH_TYPE_GPLUGD;
81 /* adress of boot parameters */
82 gd->bd->bi_boot_params = armd1_sdram_base(0) + 0x100;
84 gpio_direction_output(CONFIG_SYS_GPIO_PHY_RST, GPIO_LOW);
86 /* Deassert PHY_RST# */
87 gpio_set_value(CONFIG_SYS_GPIO_PHY_RST, GPIO_HIGH);
89 /* Enable SSP2 clock */
90 writel(SSP2_APBCLK | SSP2_FNCLK, &apb2_regs->ssp2_clkrst);
94 #ifdef CONFIG_ARMADA100_FEC
95 int board_eth_init(bd_t *bis)
97 struct armd1apmu_registers *apmu_regs =
98 (struct armd1apmu_registers *)ARMD1_APMU_BASE;
100 /* Enable clock of ethernet controller */
101 writel(FE_CLK_RST | FE_CLK_ENA, &apmu_regs->fecrc);
103 return armada100_fec_register(ARMD1_FEC_BASE);
106 #ifdef CONFIG_RESET_PHY_R
107 /* Configure and initialize PHY chip 88E3015 */
111 const char *name = "armd-fec0";
113 if (miiphy_set_current_dev(name))
116 /* command to read PHY dev address */
117 if (miiphy_read(name, 0xff, 0xff, &phy_adr)) {
118 printf("Err..%s could not read PHY dev address\n", __func__);
122 /* Set Ethernet LED in TX blink mode */
123 miiphy_write(name, phy_adr, PHY_LED_MAN_REG, 0x00);
124 miiphy_write(name, phy_adr, PHY_LED_PAR_SEL_REG, PHY_LED_VAL);
127 miiphy_reset(name, phy_adr);
128 debug("88E3015 Initialized on %s\n", name);
130 #endif /* CONFIG_RESET_PHY_R */
131 #endif /* CONFIG_ARMADA100_FEC */