1 This patch puts the EP93xx chip revision and unique ID into /proc/cpuinfo.
2 This is necessary to be able to set a unique MAC address for DHCP purposes
3 by adding a line to /etc/network/interfaces:
5 # Generate a unique locally-assigned MAC address from the CPU serial number
6 pre-up ifconfig eth0 hw ether `sed -n 's/^Serial.* 000000/02/p' /proc/cpuinfo`
8 It uses the chip revision reading code in the ep93xx-chip-revision patch.
10 Really, this is wrong, since /proc/cpuinfo should report the revision and
11 serial number of the ARM920T processor, while these are the rev and serial
12 of the EP93xx SoC. In a future kernel (>2.6.34) there may be a new file
13 /proc/socinfo for this information.
15 -martinwguy 14 May 2010
17 --- a/arch/arm/kernel/setup.c
18 +++ b/arch/arm/kernel/setup.c
20 #include <asm/traps.h>
21 #include <asm/unwind.h>
23 +#if defined(CONFIG_ARCH_EP93XX)
25 +#include <mach/ep93xx-regs.h>
26 +#include <mach/platform.h>
29 #if defined(CONFIG_DEPRECATED_PARAM_STRUCT)
32 @@ -1062,9 +1068,16 @@ static int c_show(struct seq_file *m, vo
35 seq_printf(m, "Hardware\t: %s\n", machine_name);
36 +#if defined(CONFIG_ARCH_EP93XX)
37 + seq_printf(m, "Revision\t: %04x\n",
38 + ep93xx_chip_revision());
39 + seq_printf(m, "Serial\t\t: %016x\n",
40 + *((unsigned int *)EP93XX_SECURITY_UNIQID));
42 seq_printf(m, "Revision\t: %04x\n", system_rev);
43 seq_printf(m, "Serial\t\t: %08x%08x\n",
44 system_serial_high, system_serial_low);
49 --- a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
50 +++ b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
52 #define EP93XX_I2S_BASE EP93XX_APB_IOMEM(0x00020000)
54 #define EP93XX_SECURITY_BASE EP93XX_APB_IOMEM(0x00030000)
55 +#define EP93XX_SECURITY_REG(x) (EP93XX_SECURITY_BASE + (x))
56 +#define EP93XX_SECURITY_UNIQID EP93XX_SECURITY_REG(0x2440)
58 #define EP93XX_GPIO_PHYS_BASE EP93XX_APB_PHYS(0x00040000)
59 #define EP93XX_GPIO_BASE EP93XX_APB_IOMEM(0x00040000)