From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from 20.mo4.mail-out.ovh.net ([46.105.33.73] helo=mo4.mail-out.ovh.net) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TSpiT-0000bq-7x for barebox@lists.infradead.org; Mon, 29 Oct 2012 13:49:24 +0000 Received: from mail172.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo4.mail-out.ovh.net (Postfix) with SMTP id 61074104EB0D for ; Mon, 29 Oct 2012 14:56:22 +0100 (CET) From: Jean-Christophe PLAGNIOL-VILLARD Date: Mon, 29 Oct 2012 14:47:02 +0100 Message-Id: <1351518424-29523-6-git-send-email-plagnioj@jcrosoft.com> In-Reply-To: <1351518424-29523-1-git-send-email-plagnioj@jcrosoft.com> References: <20121029134033.GH28904@game.jcrosoft.org> <1351518424-29523-1-git-send-email-plagnioj@jcrosoft.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 6/8] pm9263: use w1 serial number to generate local mac address To: barebox@lists.infradead.org The OUI will be 'ron' => 72:6F:6E Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- arch/arm/boards/pm9263/init.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/arch/arm/boards/pm9263/init.c b/arch/arm/boards/pm9263/init.c index 1d13e03..7ba804a 100644 --- a/arch/arm/boards/pm9263/init.c +++ b/arch/arm/boards/pm9263/init.c @@ -37,6 +37,7 @@ #include #include #include +#include struct w1_gpio_platform_data w1_pdata = { .pin = AT91_PIN_PB31, @@ -93,6 +94,24 @@ static struct at91_ether_platform_data macb_pdata = { .phy_addr = 0, }; +static void pm9263_phy_init(void) +{ + /* + * PB27 enables the 50MHz oscillator for Ethernet PHY + * 1 - enable + * 0 - disable + */ + at91_set_gpio_output(AT91_PIN_PB27, 1); + at91_set_gpio_value(AT91_PIN_PB27, 1); /* 1- enable, 0 - disable */ +} + +static void pm9263_add_device_eth(void) +{ + w1_mac_address_register(0, true, "ron", "w1-1-0"); + pm9263_phy_init(); + at91_add_device_eth(0, &macb_pdata); +} + static int pm9263_mem_init(void) { at91_add_device_sdram(64 * 1024 * 1024); @@ -106,16 +125,8 @@ static int pm9263_devices_init(void) at91_set_gpio_input(w1_pdata.pin, 0); add_generic_device_res("w1-gpio", DEVICE_ID_SINGLE, NULL, 0, &w1_pdata); - /* - * PB27 enables the 50MHz oscillator for Ethernet PHY - * 1 - enable - * 0 - disable - */ - at91_set_gpio_output(AT91_PIN_PB27, 1); - at91_set_gpio_value(AT91_PIN_PB27, 1); /* 1- enable, 0 - disable */ - pm_add_device_nand(); - at91_add_device_eth(0, &macb_pdata); + pm9263_add_device_eth(); add_cfi_flash_device(0, AT91_CHIPSELECT_0, 4 * 1024 * 1024, 0); devfs_add_partition("nor0", 0x00000, 0x40000, DEVFS_PARTITION_FIXED, "self0"); -- 1.7.10.4 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox