[brcm63xx] add support for 2.6.37, patches from KanjiMonster
[openwrt.git] / target / linux / ep93xx / patches-2.6.37 / 001-ep93xx_cpuinfo.patch
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:
4
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`
7
8 It uses the chip revision reading code in the ep93xx-chip-revision patch.
9
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.
14
15 -martinwguy 14 May 2010
16
17 --- a/arch/arm/kernel/setup.c
18 +++ b/arch/arm/kernel/setup.c
19 @@ -48,6 +48,12 @@
20 #include <asm/traps.h>
21 #include <asm/unwind.h>
22
23 +#if defined(CONFIG_ARCH_EP93XX)
24 +#include <mach/io.h>
25 +#include <mach/ep93xx-regs.h>
26 +#include <mach/platform.h>
27 +#endif
28 +
29 #if defined(CONFIG_DEPRECATED_PARAM_STRUCT)
30 #include "compat.h"
31 #endif
32 @@ -989,9 +995,16 @@ static int c_show(struct seq_file *m, vo
33 seq_puts(m, "\n");
34
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));
41 +#else
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);
45 +#endif
46
47 return 0;
48 }
49 --- a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
50 +++ b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
51 @@ -97,6 +97,8 @@
52 #define EP93XX_I2S_BASE EP93XX_APB_IOMEM(0x00020000)
53
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)
57
58 #define EP93XX_GPIO_BASE EP93XX_APB_IOMEM(0x00040000)
59 #define EP93XX_GPIO_REG(x) (EP93XX_GPIO_BASE + (x))
This page took 0.044902 seconds and 5 git commands to generate.