linux-2.6.25: add cm-x270 support
[openembedded.git] / packages / linux / linux-2.6.25 / cm-x270 / 0002-ramdisk_load.patch
blob1aa12be97da12d9f0a67d9778fecec19dc11bfd4
1 From 66975ae3184aabc3080e23bf7f0195ed5862cb13 Mon Sep 17 00:00:00 2001
2 From: Cliff Brake <cbrake@happy.dev.bec-systems.com>
3 Date: Fri, 20 Jul 2007 19:01:50 -0400
4 Subject: [PATCH] ramdisk_load
6 ---
7 arch/arm/mach-pxa/cm-x270.c | 6 ++++++
8 include/asm-arm/arch-pxa/cm-x270.h | 4 ++++
9 init/initramfs.c | 16 ++++++++++++++++
10 3 files changed, 26 insertions(+), 0 deletions(-)
12 diff --git a/arch/arm/mach-pxa/cm-x270.c b/arch/arm/mach-pxa/cm-x270.c
13 index ecdbc96..0487aee 100644
14 --- a/arch/arm/mach-pxa/cm-x270.c
15 +++ b/arch/arm/mach-pxa/cm-x270.c
16 @@ -240,6 +240,12 @@ static struct map_desc cmx270_io_desc[] __initdata = {
17 .length = SZ_64M,
18 .type = MT_DEVICE
20 + [2] = { /* NOR flash */
21 + .virtual = CMX270_FLASH_VIRT,
22 + .pfn = __phys_to_pfn(PXA_CS0_PHYS),
23 + .length = (8<<20), /* up to 8 MByte flash */
24 + .type = MT_DEVICE
25 + },
29 diff --git a/include/asm-arm/arch-pxa/cm-x270.h b/include/asm-arm/arch-pxa/cm-x270.h
30 index f8fac9e..70e0dce 100644
31 --- a/include/asm-arm/arch-pxa/cm-x270.h
32 +++ b/include/asm-arm/arch-pxa/cm-x270.h
33 @@ -20,6 +20,10 @@
34 #define CMX270_VIRT_BASE (0xe8000000)
35 #define CMX270_IT8152_VIRT (CMX270_VIRT_BASE)
36 #define CMX270_IDE104_VIRT (CMX270_IT8152_VIRT + SZ_64M)
37 +#define CMX270_FLASH_VIRT (CMX270_IDE104_VIRT + SZ_64M)
39 +#define CMX270_FLASH_RAMDISK_VIRT (CMX270_FLASH_VIRT + 0x1c0000)
42 /* GPIO related definitions */
43 #define GPIO_IT8152_IRQ (22)
44 diff --git a/init/initramfs.c b/init/initramfs.c
45 index d53fee8..bfcf0ea 100644
46 --- a/init/initramfs.c
47 +++ b/init/initramfs.c
48 @@ -7,6 +7,9 @@
49 #include <linux/string.h>
50 #include <linux/syscalls.h>
52 +// HACK for compulab cm-x270
53 +#include <asm/arch/cm-x270.h>
55 static __initdata char *message;
56 static void __init error(char *x)
58 @@ -546,7 +549,20 @@ static int __init populate_rootfs(void)
59 panic(err);
60 if (initrd_start) {
61 #ifdef CONFIG_BLK_DEV_RAM
63 + /* hack to make initramfs work because the
64 + * compulab BL does not zero out the
65 + * initrd memory. This only seems to affect loading
66 + * initramfs (cpio.gz) archives. Does not seem to
67 + * affect ramdisks.
68 + */
69 + int initrd_size = *(int *)(CMX270_FLASH_RAMDISK_VIRT);
70 int fd;
72 + initrd_end = initrd_start + initrd_size;
73 + //printk("CLIFF: initrd_start = 0x%x\n", initrd_start);
74 + //printk("CLIFF: initrd_end = 0x%x\n", initrd_end);
76 printk(KERN_INFO "checking if image is initramfs...");
77 err = unpack_to_rootfs((char *)initrd_start,
78 initrd_end - initrd_start, 1);
79 --
80 1.5.4.rc4