3 * eInfochips Ltd. <www.einfochips.com>
4 * Written-by: Ajay Bhargav <ajay.bhargav@einfochips.com>
8 * Marvell Semiconductor <www.marvell.com>
9 * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
10 * Contributor: Mahavir Jain <mjain@marvell.com>
12 * See file CREDITS for list of people who contributed to this
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License as
17 * published by the Free Software Foundation; either version 2 of
18 * the License, or (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
33 #include <asm/arch/mfp.h>
34 #include <asm/arch/armada100.h>
38 #ifdef CONFIG_ARMADA100_FEC
41 #endif /* CONFIG_ARMADA100_FEC */
43 DECLARE_GLOBAL_DATA_PTR;
45 int board_early_init_f(void)
52 /* Enable Console on UART3 */
56 /* Ethernet PHY Interface */
75 MFP_EOC /*End of configuration*/
84 /* arch number of Board */
85 gd->bd->bi_arch_number = MACH_TYPE_SHEEVAD;
86 /* adress of boot parameters */
87 gd->bd->bi_boot_params = armd1_sdram_base(0) + 0x100;
89 gpio_direction_output(CONFIG_SYS_GPIO_PHY_RST, GPIO_LOW);
91 /* Deassert PHY_RST# */
92 gpio_set_value(CONFIG_SYS_GPIO_PHY_RST, GPIO_HIGH);
96 #ifdef CONFIG_ARMADA100_FEC
97 int board_eth_init(bd_t *bis)
99 struct armd1apmu_registers *apmu_regs =
100 (struct armd1apmu_registers *)ARMD1_APMU_BASE;
102 /* Enable clock of ethernet controller */
103 writel(FE_CLK_RST | FE_CLK_ENA, &apmu_regs->fecrc);
105 return armada100_fec_register(ARMD1_FEC_BASE);
108 #ifdef CONFIG_RESET_PHY_R
109 /* Configure and initialize PHY chip 88E3015 */
113 const char *name = "armd-fec0";
115 if (miiphy_set_current_dev(name))
118 /* command to read PHY dev address */
119 if (miiphy_read(name, 0xff, 0xff, &phy_adr)) {
120 printf("Err..%s could not read PHY dev address\n", __func__);
124 /* Set Ethernet LED in TX blink mode */
125 miiphy_write(name, phy_adr, PHY_LED_MAN_REG, 0x00);
126 miiphy_write(name, phy_adr, PHY_LED_PAR_SEL_REG, PHY_LED_VAL);
129 miiphy_reset(name, phy_adr);
130 debug("88E3015 Initialized on %s\n", name);
132 #endif /* CONFIG_RESET_PHY_R */
133 #endif /* CONFIG_ARMADA100_FEC */