aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ep93xx/patches-3.8/001-ep93xx_cpuinfo.patch
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2013-03-17 19:46:25 +0000
committerFlorian Fainelli <florian@openwrt.org>2013-03-17 19:46:25 +0000
commit472bb8d51a1279d22d50002d3d930be53c3d15c5 (patch)
tree21e737ce20e5a2ed3f89a89e7abeaf5b370df831 /target/linux/ep93xx/patches-3.8/001-ep93xx_cpuinfo.patch
parentb48e5f2111cb1e21180443421285007f3f024db1 (diff)
downloadupstream-472bb8d51a1279d22d50002d3d930be53c3d15c5.tar.gz
upstream-472bb8d51a1279d22d50002d3d930be53c3d15c5.tar.bz2
upstream-472bb8d51a1279d22d50002d3d930be53c3d15c5.zip
ep93xx: add support for 3.8 kernel
Signed-off-by: Florian Fainelli <florian@openwrt.org> SVN-Revision: 36073
Diffstat (limited to 'target/linux/ep93xx/patches-3.8/001-ep93xx_cpuinfo.patch')
-rw-r--r--target/linux/ep93xx/patches-3.8/001-ep93xx_cpuinfo.patch70
1 files changed, 70 insertions, 0 deletions
diff --git a/target/linux/ep93xx/patches-3.8/001-ep93xx_cpuinfo.patch b/target/linux/ep93xx/patches-3.8/001-ep93xx_cpuinfo.patch
new file mode 100644
index 0000000000..2260641c24
--- /dev/null
+++ b/target/linux/ep93xx/patches-3.8/001-ep93xx_cpuinfo.patch
@@ -0,0 +1,70 @@
+This patch puts the EP93xx chip revision and unique ID into /proc/cpuinfo.
+This is necessary to be able to set a unique MAC address for DHCP purposes
+by adding a line to /etc/network/interfaces:
+
+# Generate a unique locally-assigned MAC address from the CPU serial number
+pre-up ifconfig eth0 hw ether `sed -n 's/^Serial.* 000000/02/p' /proc/cpuinfo`
+
+It uses the chip revision reading code in the ep93xx-chip-revision patch.
+
+Really, this is wrong, since /proc/cpuinfo should report the revision and
+serial number of the ARM920T processor, while these are the rev and serial
+of the EP93xx SoC. In a future kernel (>2.6.34) there may be a new file
+/proc/socinfo for this information.
+
+ -martinwguy 14 May 2010
+
+--- a/arch/arm/kernel/setup.c
++++ b/arch/arm/kernel/setup.c
+@@ -55,6 +55,12 @@
+ #include <asm/memblock.h>
+ #include <asm/virt.h>
+
++#if defined(CONFIG_ARCH_EP93XX)
++#include <asm/io.h>
++#include <mach/platform.h>
++#include <mach/ep93xx-regs.h>
++#endif
++
+ #include "atags.h"
+ #include "tcm.h"
+
+@@ -903,9 +909,16 @@ static int c_show(struct seq_file *m, vo
+ }
+
+ seq_printf(m, "Hardware\t: %s\n", machine_name);
++#if defined(CONFIG_ARCH_EP93XX)
++ seq_printf(m, "Revision\t: %04x\n",
++ ep93xx_chip_revision());
++ seq_printf(m, "Serial\t\t: %016x\n",
++ *((unsigned int *)EP93XX_SECURITY_UNIQID));
++#else
+ seq_printf(m, "Revision\t: %04x\n", system_rev);
+ seq_printf(m, "Serial\t\t: %08x%08x\n",
+ system_serial_high, system_serial_low);
++#endif
+
+ return 0;
+ }
+--- a/arch/arm/mach-ep93xx/soc.h
++++ b/arch/arm/mach-ep93xx/soc.h
+@@ -82,8 +82,6 @@
+ #define EP93XX_I2S_PHYS_BASE EP93XX_APB_PHYS(0x00020000)
+ #define EP93XX_I2S_BASE EP93XX_APB_IOMEM(0x00020000)
+
+-#define EP93XX_SECURITY_BASE EP93XX_APB_IOMEM(0x00030000)
+-
+ #define EP93XX_AAC_PHYS_BASE EP93XX_APB_PHYS(0x00080000)
+ #define EP93XX_AAC_BASE EP93XX_APB_IOMEM(0x00080000)
+
+--- a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
++++ b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
+@@ -38,4 +38,8 @@
+ #define EP93XX_UART3_PHYS_BASE EP93XX_APB_PHYS(0x000e0000)
+ #define EP93XX_UART3_BASE EP93XX_APB_IOMEM(0x000e0000)
+
++#define EP93XX_SECURITY_BASE EP93XX_APB_IOMEM(0x00030000)
++#define EP93XX_SECURITY_REG(x) (EP93XX_SECURITY_BASE + (x))
++#define EP93XX_SECURITY_UNIQID EP93XX_SECURITY_REG(0x2440)
++
+ #endif