All of lore.kernel.org
 help / color / mirror / Atom feed
* Version 3 of BB xM consistent MAC address patch
@ 2010-10-28  4:57 Matt Johnson
  2010-10-28  4:57 ` [PATCH v3] linux-omap-2.6.36rc -- Consistent MAC address for BeagleBoard xM Adding a patch to linux-omap-2.6.36rc for beagleboard. Patch is adapted from one submitted by Mark Crichton to the Beagleboard Google Group (see http://groups.google.com/group/beagleboard/browse_thread/thread/92d41bb344f8939b?fwc=1). BeagleBoard xM now uses the OMAP's die ID as a MAC instead of generating a random one (since it doesn't have an EEPROM to store it), so you have a consistent MAC across boots. Signed-off-by: Matt Johnson <johnso87@crhc.illinois.edu> Matt Johnson
  0 siblings, 1 reply; 3+ messages in thread
From: Matt Johnson @ 2010-10-28  4:57 UTC (permalink / raw)
  To: openembedded-devel


Bumped PR for linux-omap.  Thanks Khem!



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v3] linux-omap-2.6.36rc -- Consistent MAC address for BeagleBoard xM Adding a patch to linux-omap-2.6.36rc for beagleboard. Patch is adapted from one submitted by Mark Crichton to the Beagleboard Google Group (see http://groups.google.com/group/beagleboard/browse_thread/thread/92d41bb344f8939b?fwc=1). BeagleBoard xM now uses the OMAP's die ID as a MAC instead of generating a random one (since it doesn't have an EEPROM to store it), so you have a consistent MAC across boots. Signed-off-by: Matt Johnson <johnso87@crhc.illinois.edu>
  2010-10-28  4:57 Version 3 of BB xM consistent MAC address patch Matt Johnson
@ 2010-10-28  4:57 ` Matt Johnson
  2010-10-28  5:10   ` Khem Raj
  0 siblings, 1 reply; 3+ messages in thread
From: Matt Johnson @ 2010-10-28  4:57 UTC (permalink / raw)
  To: openembedded-devel

---
 conf/machine/include/omap3.inc                     |    2 +-
 ...e-beagleboard-xm-a-consistent-MAC-address.patch |   83 ++++++++++++++++++++
 recipes/linux/linux-omap_2.6.36rc.bb               |    1 +
 3 files changed, 85 insertions(+), 1 deletions(-)
 create mode 100644 recipes/linux/linux-omap-2.6.36rc/0008-give-the-beagleboard-xm-a-consistent-MAC-address.patch

diff --git a/conf/machine/include/omap3.inc b/conf/machine/include/omap3.inc
index 76e997d..8b7a391 100644
--- a/conf/machine/include/omap3.inc
+++ b/conf/machine/include/omap3.inc
@@ -4,7 +4,7 @@ TARGET_ARCH = "arm"
 require conf/machine/include/tune-cortexa8.inc
 PREFERRED_PROVIDER_virtual/kernel = "linux-omap"
 # Increase this everytime you change something in the kernel
-MACHINE_KERNEL_PR = "r90"
+MACHINE_KERNEL_PR = "r91"
 
 KERNEL_IMAGETYPE = "uImage"
 
diff --git a/recipes/linux/linux-omap-2.6.36rc/0008-give-the-beagleboard-xm-a-consistent-MAC-address.patch b/recipes/linux/linux-omap-2.6.36rc/0008-give-the-beagleboard-xm-a-consistent-MAC-address.patch
new file mode 100644
index 0000000..9fb5ad7
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.36rc/0008-give-the-beagleboard-xm-a-consistent-MAC-address.patch
@@ -0,0 +1,83 @@
+From 60ec781c775e8413ef8ca521b63a07ba9ed2f4aa Mon Sep 17 00:00:00 2001
+From: Matt Johnson <johnso87@crhc.illinois.edu>
+Date: Wed, 27 Oct 2010 22:17:36 -0500
+Subject: [PATCH] Give BeagleBoard xM a consistent MAC address
+
+ Adapting the patch submitted by Mark Crichton to the Beagleboard Google Group
+ (see http://groups.google.com/group/beagleboard/browse_thread/thread/92d41bb344f8939b?fwc=1)
+ The Beagleboard xM includes an smsc95xx ethernet interface attached to the DM3730 via USB.
+ The Beagleboard lacks an EEPROM to store the MAC address, so the driver generates a random
+ MAC address on every boot.  This patch instead uses the OMAP's die ID as the MAC address
+ (modifying a couple bits to make it a valid MAC), so that the MAC is consistent across boots.
+ A consistent MAC is important if the Beagleboard is to be used on a network with MAC filtering
+ and/or static IP addresses.
+ Signed-off-by: Matt Johnson <johnso87@crhc.illinois.edu>
+
+---
+ drivers/net/usb/smsc95xx.c |   36 +++++++++++++++++++++++++++++++++++-
+ 1 files changed, 35 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
+index 12a3c88..1219bb6 100644
+--- a/drivers/net/usb/smsc95xx.c
++++ b/drivers/net/usb/smsc95xx.c
+@@ -29,6 +29,9 @@
+ #include <linux/crc32.h>
+ #include <linux/usb/usbnet.h>
+ #include <linux/slab.h>
++#if defined (CONFIG_MACH_OMAP3_BEAGLE)
++#include <mach/id.h>
++#endif
+ #include "smsc95xx.h"
+ 
+ #define SMSC_CHIPNAME			"smsc95xx"
+@@ -639,6 +642,14 @@ static int smsc95xx_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd)
+ 
+ static void smsc95xx_init_mac_address(struct usbnet *dev)
+ {
++#if defined (CONFIG_MACH_OMAP3_BEAGLE)
++	u32 i;
++	struct omap_die_id odi;
++	union {
++		u32 idi[2];
++		u8 id[8];
++	} cpu;
++#endif
+ 	/* try reading mac address from EEPROM */
+ 	if (smsc95xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN,
+ 			dev->net->dev_addr) == 0) {
+@@ -648,7 +659,30 @@ static void smsc95xx_init_mac_address(struct usbnet *dev)
+ 			return;
+ 		}
+ 	}
+-
++#if defined (CONFIG_MACH_OMAP3_BEAGLE)
++	/* The BeagleBoard xM has a smsm95xx, but no EEPROM. */
++	/* Rather than just come up with a random MAC address, we'll */
++	/* Use a hash of our DM3730's die ID, so at least it's consistent */
++	/* between boots. */
++	
++	/* Look at section 1.5.2 of DM3730 documentation */
++	omap_get_die_id(&odi);
++	cpu.idi[0] = odi.id_0;
++	cpu.idi[1] = odi.id_1;
++	/* Now interpret the die id as a MAC address */
++	/* We need to clear the multicast bit */
++	cpu.id[0] &= 0xfe;
++	/* Set local assignment bit (IEEE802) */
++	cpu.id[1] |= 0x02;
++	
++	for(i = 0; i < ETH_ALEN; i++) {
++		dev->net->dev_addr[i] = cpu.id[i];
++	}
++	//TODO: Do error checking, etc. on die_id.
++	//TODO: Allow the user to set MAC after boot.
++	//TODO: Allow user to select whether they want this behavior or not */
++	return;
++#endif
+ 	/* no eeprom, or eeprom values are invalid. generate random MAC */
+ 	random_ether_addr(dev->net->dev_addr);
+ 	netif_dbg(dev, ifup, dev->net, "MAC address set to random_ether_addr\n");
+-- 
+1.6.3.3
+
diff --git a/recipes/linux/linux-omap_2.6.36rc.bb b/recipes/linux/linux-omap_2.6.36rc.bb
index 64200e1..c79ffa9 100644
--- a/recipes/linux/linux-omap_2.6.36rc.bb
+++ b/recipes/linux/linux-omap_2.6.36rc.bb
@@ -25,6 +25,7 @@ SRC_URI_append = " \
                   file://0005-mmc-don-t-display-single-block-read-console-messages.patch \
                   file://0006-MTD-silence-ecc-errors-on-mtdblock0.patch \
                   file://0007-OMAP-DSS2-OMAPFB-use-phys_to_virt-for-RAM-mappings.patch \
+		  file://0008-give-the-beagleboard-xm-a-consistent-MAC-address.patch \
 "
 
 SRC_URI_append_beagleboard = " file://logo_linux_clut224.ppm \
-- 
1.6.3.3




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] linux-omap-2.6.36rc -- Consistent MAC address for BeagleBoard xM Adding a patch to linux-omap-2.6.36rc for beagleboard. Patch is adapted from one submitted by Mark Crichton to the Beagleboard Google Group (see http://groups.google.com/group/beagleboard/browse_thread/thread/92d41bb344f8939b?fwc=1). BeagleBoard xM now uses the OMAP's die ID as a MAC instead of generating a random one (since it doesn't have an EEPROM to store it), so you have a consistent MAC across boots. Signed-off-by: Matt Johnson <johnso87@crhc.illinois.edu>
  2010-10-28  4:57 ` [PATCH v3] linux-omap-2.6.36rc -- Consistent MAC address for BeagleBoard xM Adding a patch to linux-omap-2.6.36rc for beagleboard. Patch is adapted from one submitted by Mark Crichton to the Beagleboard Google Group (see http://groups.google.com/group/beagleboard/browse_thread/thread/92d41bb344f8939b?fwc=1). BeagleBoard xM now uses the OMAP's die ID as a MAC instead of generating a random one (since it doesn't have an EEPROM to store it), so you have a consistent MAC across boots. Signed-off-by: Matt Johnson <johnso87@crhc.illinois.edu> Matt Johnson
@ 2010-10-28  5:10   ` Khem Raj
  0 siblings, 0 replies; 3+ messages in thread
From: Khem Raj @ 2010-10-28  5:10 UTC (permalink / raw)
  To: openembedded-devel

On (27/10/10 23:57), Matt Johnson wrote:
> ---
>  conf/machine/include/omap3.inc                     |    2 +-
>  ...e-beagleboard-xm-a-consistent-MAC-address.patch |   83 ++++++++++++++++++++
>  recipes/linux/linux-omap_2.6.36rc.bb               |    1 +
>  3 files changed, 85 insertions(+), 1 deletions(-)
>  create mode 100644 recipes/linux/linux-omap-2.6.36rc/0008-give-the-beagleboard-xm-a-consistent-MAC-address.patch
> 
> diff --git a/conf/machine/include/omap3.inc b/conf/machine/include/omap3.inc
> index 76e997d..8b7a391 100644
> --- a/conf/machine/include/omap3.inc
> +++ b/conf/machine/include/omap3.inc
> @@ -4,7 +4,7 @@ TARGET_ARCH = "arm"
>  require conf/machine/include/tune-cortexa8.inc
>  PREFERRED_PROVIDER_virtual/kernel = "linux-omap"
>  # Increase this everytime you change something in the kernel
> -MACHINE_KERNEL_PR = "r90"
> +MACHINE_KERNEL_PR = "r91"

I guess you need to change MACHINE_KERNEL_PR_append to "e+..."
-Khem



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-10-28  5:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-28  4:57 Version 3 of BB xM consistent MAC address patch Matt Johnson
2010-10-28  4:57 ` [PATCH v3] linux-omap-2.6.36rc -- Consistent MAC address for BeagleBoard xM Adding a patch to linux-omap-2.6.36rc for beagleboard. Patch is adapted from one submitted by Mark Crichton to the Beagleboard Google Group (see http://groups.google.com/group/beagleboard/browse_thread/thread/92d41bb344f8939b?fwc=1). BeagleBoard xM now uses the OMAP's die ID as a MAC instead of generating a random one (since it doesn't have an EEPROM to store it), so you have a consistent MAC across boots. Signed-off-by: Matt Johnson <johnso87@crhc.illinois.edu> Matt Johnson
2010-10-28  5:10   ` Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.