1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-25 07:23:07 +02:00
openwrt-xburst/target/linux/xburst/patches-2.6.31/220-add-2gb-nand-support.patch
2009-10-28 03:13:27 +08:00

118 lines
3.0 KiB
Diff

diff --git a/arch/mips/jz4740/platform.c b/arch/mips/jz4740/platform.c
index 5cf3c38..04024d2 100644
--- a/arch/mips/jz4740/platform.c
+++ b/arch/mips/jz4740/platform.c
@@ -170,6 +170,8 @@ static struct resource jz_nand_resources[] = {
},
};
+
+#ifdef QI_LB60_1GB_NAND
static struct nand_ecclayout qi_lb60_ecclayout = {
.eccbytes = 36,
.eccpos = {
@@ -186,23 +188,62 @@ static struct nand_ecclayout qi_lb60_ecclayout = {
};
static struct mtd_partition qi_lb60_partitions[] = {
- { .name = "NAND BOOT partition",
- .offset = 0 * 0x100000,
- .size = 4 * 0x100000,
- },
- { .name = "NAND KERNEL partition",
- .offset = 4 * 0x100000,
- .size = 4 * 0x100000,
- },
- { .name = "NAND ROOTFS partition",
- .offset = 8 * 0x100000,
- .size = 20 * 0x100000,
- },
- { .name = "NAND DATA partition",
- .offset = 100 * 0x100000,
- .size = 20 * 0x100000,
- },
-};
+ { .name = "NAND BOOT partition",
+ .offset = 0 * 0x100000,
+ .size = 4 * 0x100000,
+ },
+ { .name = "NAND KERNEL partition",
+ .offset = 4 * 0x100000,
+ .size = 4 * 0x100000,
+ },
+ { .name = "NAND ROOTFS partition",
+ .offset = 8 * 0x100000,
+ .size = 504 * 0x100000,
+ },
+ { .name = "NAND DATA partition",
+ .offset = 512 * 0x100000,
+ .size = 512 * 0x100000,
+ },
+};
+#else
+static struct nand_ecclayout qi_lb60_ecclayout = {
+ .eccbytes = 72,
+ .eccpos = {
+ 12, 13, 14, 15, 16, 17, 18, 19,
+ 20, 21, 22, 23, 24, 25, 26, 27,
+ 28, 29, 30, 31, 32, 33, 34, 35,
+ 36, 37, 38, 39, 40, 41, 42, 43,
+ 44, 45, 46, 47, 48, 49, 50, 51,
+ 52, 53, 54, 55, 56, 57, 58, 59,
+ 60, 61, 62, 63, 64, 65, 66, 67,
+ 68, 69, 70, 71, 72, 73, 74, 75,
+ 76, 77, 78, 79, 80, 81, 82, 83},
+ .oobfree = {
+ {.offset = 2,
+ .length = 10},
+ {.offset = 84,
+ .length = 44}}
+};
+
+static struct mtd_partition qi_lb60_partitions[] = {
+ { .name = "NAND BOOT partition",
+ .offset = 0 * 0x100000,
+ .size = 4 * 0x100000,
+ },
+ { .name = "NAND KERNEL partition",
+ .offset = 4 * 0x100000,
+ .size = 4 * 0x100000,
+ },
+ { .name = "NAND ROOTFS partition",
+ .offset = 8 * 0x100000,
+ .size = 504 * 0x100000,
+ },
+ { .name = "NAND DATA partition",
+ .offset = 512 * 0x100000,
+ .size = (512 + 1024) * 0x100000,
+ },
+};
+#endif /* QI_LB60_1GB_NAND */
static struct jz_nand_platform_data jz_nand_platform_data = {
.num_partitions = ARRAY_SIZE(qi_lb60_partitions),
@@ -219,7 +260,9 @@ static struct platform_device jz_nand_device = {
.platform_data = &jz_nand_platform_data,
}
};
-#define KEEP_UART_ALIVE
+/* #define KEEP_UART_ALIVE
+ * don't define this. the keyboard and keyboard both work
+ */
#define KEY_QI_QI KEY_F13
#define KEY_QI_UPRED KEY_F14
diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h
index f86db5a..b19fffa 100644
--- a/include/mtd/mtd-abi.h
+++ b/include/mtd/mtd-abi.h
@@ -135,7 +135,7 @@ struct nand_oobfree {
*/
struct nand_ecclayout {
__u32 eccbytes;
- __u32 eccpos[64];
+ __u32 eccpos[72];
__u32 oobavail;
struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES];
};