summaryrefslogtreecommitdiff
path: root/recipes/linux/linux-davinci/davinci-sffsdr/0004-Davinci-Enable-MAC-address-to-be-specified-on-kerne.patch
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/linux/linux-davinci/davinci-sffsdr/0004-Davinci-Enable-MAC-address-to-be-specified-on-kerne.patch
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/linux/linux-davinci/davinci-sffsdr/0004-Davinci-Enable-MAC-address-to-be-specified-on-kerne.patch')
-rw-r--r--recipes/linux/linux-davinci/davinci-sffsdr/0004-Davinci-Enable-MAC-address-to-be-specified-on-kerne.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/recipes/linux/linux-davinci/davinci-sffsdr/0004-Davinci-Enable-MAC-address-to-be-specified-on-kerne.patch b/recipes/linux/linux-davinci/davinci-sffsdr/0004-Davinci-Enable-MAC-address-to-be-specified-on-kerne.patch
new file mode 100644
index 0000000000..d1721914c6
--- /dev/null
+++ b/recipes/linux/linux-davinci/davinci-sffsdr/0004-Davinci-Enable-MAC-address-to-be-specified-on-kerne.patch
@@ -0,0 +1,54 @@
+From 2e852db8367da3d3f60230419bd36bab2535c0ff Mon Sep 17 00:00:00 2001
+From: Hugo Villeneuve <hugo@hugovil.com>
+Date: Thu, 5 Mar 2009 17:11:05 -0500
+Subject: [PATCH 04/12] Davinci: Enable MAC address to be specified on kernel cmd line
+
+Signed-off-by: Hugo Villeneuve <hugo@hugovil.com>
+---
+ arch/arm/mach-davinci/devices.c | 23 +++++++++++++++++++++++
+ 1 files changed, 23 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c
+index a0f5a60..db433be 100644
+--- a/arch/arm/mach-davinci/devices.c
++++ b/arch/arm/mach-davinci/devices.c
+@@ -353,6 +353,27 @@ static struct platform_device dm646x_emac_device = {
+ }
+ };
+
++/* Get Ethernet address from kernel boot params */
++static u8 davinci_bootloader_mac_addr[6] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
++
++static int /*__init */ davinci_bootloader_mac_setup(char *str)
++{
++ int i;
++
++ if (str == NULL)
++ return 0;
++
++ /* Conversion of a MAC address from a string (AA:BB:CC:DD:EE:FF)
++ * to a 6 bytes array. */
++ for (i = 0; i < 6; i++)
++ davinci_bootloader_mac_addr[i] =
++ simple_strtol(&str[i*3], (char **)NULL, 16);
++
++ return 1;
++}
++/* Get MAC address from kernel boot parameter eth=AA:BB:CC:DD:EE:FF */
++__setup("eth=", davinci_bootloader_mac_setup);
++
+ void davinci_init_emac(char *mac_addr)
+ {
+ DECLARE_MAC_BUF(buf);
+@@ -366,6 +387,8 @@ void davinci_init_emac(char *mac_addr)
+
+ if (mac_addr && is_valid_ether_addr(mac_addr))
+ memcpy(emac_pdata.mac_addr, mac_addr, 6);
++ else if (is_valid_ether_addr(davinci_bootloader_mac_addr))
++ memcpy(emac_pdata.mac_addr, davinci_bootloader_mac_addr, 6);
+ else {
+ /* Use random MAC if none passed */
+ random_ether_addr(emac_pdata.mac_addr);
+--
+1.5.4.5
+