r3714 - branches/src/target/kernel/2.6.24.x/patches

laforge at sita.openmoko.org laforge at sita.openmoko.org
Thu Dec 20 19:38:25 CET 2007


Author: laforge
Date: 2007-12-20 19:38:23 +0100 (Thu, 20 Dec 2007)
New Revision: 3714

Modified:
   branches/src/target/kernel/2.6.24.x/patches/gta02-core.patch
Log:
Add support for NEO1973 NOR flash to MTD
From: warmcat <andy at warmcat.com>

You will need the default config from svn

http://svn.openmoko.org/trunk/src/target/kernel/config/

in the top level of your kernel dir to apply this patch -- and
you need to use the patched config to build the kernel

Whether the NOR flash is present at 0x18000000 or not (it
varies according to GTA revision... -02 A3 and A4 should work
fine and A2 if booted from NOR only) the whole 2MByte NOR
region appears as /dev/mtdblock0 and the NAND partitions start
from /dev/mtdblock1 up.

/dev/mtdblock0  2MB NOR
/dev/mtdblock1  U-Boot
/dev/mtdblock2  U-Boot env
/dev/mtdblock3  Kernel
/dev/mtdblock4  Splash
/dev/mtdblock5  rootfs

After applying this patch, you need to adjust the kernel cmdline
to identify root=/dev/mtdblock5 in order to boot into the rootfs

Once booted, you can do, eg

# mount -t jffs2 /dev/mtdblock0 /mnt

to mount the NOR 2MB partition on /mnt

Signed-off-by: Andy Green <andy at openmoko.org>
Signed-off-by: Harald Welte <laforge at openmoko.org>


Modified: branches/src/target/kernel/2.6.24.x/patches/gta02-core.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/gta02-core.patch	2007-12-20 18:12:04 UTC (rev 3713)
+++ branches/src/target/kernel/2.6.24.x/patches/gta02-core.patch	2007-12-20 18:38:23 UTC (rev 3714)
@@ -2,7 +2,7 @@
 ===================================================================
 --- /dev/null
 +++ linux-2.6/arch/arm/mach-s3c2440/mach-gta02.c
-@@ -0,0 +1,679 @@
+@@ -0,0 +1,709 @@
 +/*
 + * linux/arch/arm/mach-s3c2440/mach-gta02.c
 + *
@@ -48,6 +48,7 @@
 +#include <linux/mtd/nand.h>
 +#include <linux/mtd/nand_ecc.h>
 +#include <linux/mtd/partitions.h>
++#include <linux/mtd/physmap.h>
 +
 +#include <linux/pcf50633.h>
 +
@@ -309,6 +310,34 @@
 +	},
 +};
 +
++
++/* NOR Flash */
++
++#define GTA02_FLASH_BASE	0x18000000 /* GCS3 */
++#define GTA02_FLASH_SIZE	0x200000 /* 2MBytes */
++
++static struct physmap_flash_data gta02_nor_flash_data = {
++	.width		= 2,
++};
++
++static struct resource gta02_nor_flash_resource = {
++	.start		= GTA02_FLASH_BASE,
++	.end		= GTA02_FLASH_BASE + GTA02_FLASH_SIZE - 1,
++	.flags		= IORESOURCE_MEM,
++};
++
++static struct platform_device gta02_nor_flash = {
++	.name		= "physmap-flash",
++	.id		= 0,
++	.dev		= {
++				.platform_data	= &gta02_nor_flash_data,
++			},
++	.resource	= &gta02_nor_flash_resource,
++	.num_resources	= 1,
++};
++
++
++
 +static struct platform_device *gta02_devices[] __initdata = {
 +	&s3c_device_usb,
 +	&s3c_device_wdt,
@@ -320,6 +349,7 @@
 +	&s3c_device_ts,
 +	&s3c_device_spi0,
 +	&s3c_device_spi1,
++	&gta02_nor_flash,
 +};
 +
 +static struct s3c2410_nand_set gta02_nand_sets[] = {





More information about the commitlog mailing list