[PATCH v3 2/4] pm9g45: fix Ethernet

Asen Chavdarov Dimov dimov at ronetix.at
Wed Mar 21 12:27:24 EDT 2012


Enable PHY clock.

Signed-off-by: Asen Chavdarov Dimov <dimov at ronetix.at>
---
since v1:
	- phy_init changed to pm9g45_phy_init
	- pm9g45_phy_init becamos void and "return 0" is removed
	- removed manual clock enabling

since v2:
	- dropped an empty line
---
 arch/arm/boards/pm9g45/init.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boards/pm9g45/init.c b/arch/arm/boards/pm9g45/init.c
index 480c751..567bad4 100644
--- a/arch/arm/boards/pm9g45/init.c
+++ b/arch/arm/boards/pm9g45/init.c
@@ -82,6 +82,17 @@ static struct at91_ether_platform_data macb_pdata = {
 	.phy_addr = 0,
 };
 
+static void pm9g45_phy_init(void)
+{
+	/*
+	 * PD2 enables the 50MHz oscillator for Ethernet PHY
+	 * 1 - enable
+	 * 0 - disable
+	 */
+	at91_set_gpio_output(AT91_PIN_PD2, 1);
+	at91_set_gpio_value(AT91_PIN_PD2, 1);
+}
+
 static int pm9g45_mem_init(void)
 {
 	at91_add_device_sdram(128 * 1024 * 1024);
@@ -93,6 +104,7 @@ mem_initcall(pm9g45_mem_init);
 static int pm9g45_devices_init(void)
 {
 	pm_add_device_nand();
+	pm9g45_phy_init();
 	at91_add_device_eth(&macb_pdata);
 
 	devfs_add_partition("nand0", 0x00000, 0x80000, PARTITION_FIXED, "self_raw");
-- 
1.7.4.4




More information about the barebox mailing list