mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 4/4] at91sam9x5ek: use w1 serial number to generate local mac address
Date: Wed, 31 Oct 2012 19:22:04 +0100	[thread overview]
Message-ID: <1351707724-28704-4-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1351707724-28704-1-git-send-email-plagnioj@jcrosoft.com>

The OUI will be 'tml' => 76:6D:6C

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 arch/arm/boards/at91sam9x5ek/init.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boards/at91sam9x5ek/init.c b/arch/arm/boards/at91sam9x5ek/init.c
index b3d7ab2..78f7349 100644
--- a/arch/arm/boards/at91sam9x5ek/init.c
+++ b/arch/arm/boards/at91sam9x5ek/init.c
@@ -40,6 +40,7 @@
 #include <gpio_keys.h>
 #include <readkey.h>
 #include <linux/w1-gpio.h>
+#include <w1_mac_address.h>
 
 #include "hw_version.h"
 
@@ -105,6 +106,14 @@ static struct at91_ether_platform_data macb_pdata = {
 	.phy_addr = 0,
 };
 
+static void ek_add_device_eth(void)
+{
+	if (w1_local_mac_address_register(0, "tml", "w1-2d-0"))
+		w1_local_mac_address_register(0, "tml", "w1-23-0");
+
+	at91_add_device_eth(0, &macb_pdata);
+}
+
 /*
  * USB Host port
  */
@@ -160,7 +169,7 @@ static int at91sam9x5ek_devices_init(void)
 {
 	ek_add_device_w1();
 	ek_add_device_nand();
-	at91_add_device_eth(0, &macb_pdata);
+	ek_add_device_eth();
 	at91_add_device_usbh_ohci(&ek_usbh_data);
 	ek_add_led();
 
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2012-10-31 18:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-31 16:52 [PATCH 0/4] at91sam9x5ek: add 1-wire support and hardware detection support Jean-Christophe PLAGNIOL-VILLARD
2012-10-31 18:22 ` [PATCH 1/4] at91sam9x5ek: add 1-wire support Jean-Christophe PLAGNIOL-VILLARD
2012-10-31 18:22   ` [PATCH 2/4] at91sam9x5ek: add hw detection support Jean-Christophe PLAGNIOL-VILLARD
2012-10-31 18:22   ` [PATCH 3/4] at91sam9x5ek: add fixup for cogent cpu module Jean-Christophe PLAGNIOL-VILLARD
2012-10-31 18:22   ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2012-11-01 15:30 ` [PATCH 0/4] at91sam9x5ek: add 1-wire support and hardware detection support Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1351707724-28704-4-git-send-email-plagnioj@jcrosoft.com \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox