diff options
Diffstat (limited to 'meta/packages/linux/linux-nokia800-2.6.18-osso40/nokia770_nand_fix.patch')
-rw-r--r-- | meta/packages/linux/linux-nokia800-2.6.18-osso40/nokia770_nand_fix.patch | 160 |
1 files changed, 160 insertions, 0 deletions
diff --git a/meta/packages/linux/linux-nokia800-2.6.18-osso40/nokia770_nand_fix.patch b/meta/packages/linux/linux-nokia800-2.6.18-osso40/nokia770_nand_fix.patch new file mode 100644 index 0000000000..cf3013f48e --- /dev/null +++ b/meta/packages/linux/linux-nokia800-2.6.18-osso40/nokia770_nand_fix.patch | |||
@@ -0,0 +1,160 @@ | |||
1 | --- | ||
2 | arch/arm/mach-omap1/mmu.c | 1 + | ||
3 | drivers/cbus/tahvo-usb.c | 4 ++-- | ||
4 | drivers/i2c/chips/isp1301_omap.c | 1 + | ||
5 | drivers/mtd/nand/omap-hw.c | 37 +++++++++++++++---------------------- | ||
6 | 4 files changed, 19 insertions(+), 24 deletions(-) | ||
7 | |||
8 | Index: linux-g/arch/arm/mach-omap1/mmu.c | ||
9 | =================================================================== | ||
10 | --- linux-g.orig/arch/arm/mach-omap1/mmu.c 2007-05-23 16:39:20.000000000 +0100 | ||
11 | +++ linux-g/arch/arm/mach-omap1/mmu.c 2007-05-23 17:42:06.000000000 +0100 | ||
12 | @@ -29,6 +29,7 @@ | ||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/mm.h> | ||
15 | #include <linux/err.h> | ||
16 | +#include <linux/delay.h> | ||
17 | #include "mmu.h" | ||
18 | #include <asm/tlbflush.h> | ||
19 | |||
20 | Index: linux-g/drivers/cbus/tahvo-usb.c | ||
21 | =================================================================== | ||
22 | --- linux-g.orig/drivers/cbus/tahvo-usb.c 2006-11-08 12:18:51.000000000 +0000 | ||
23 | +++ linux-g/drivers/cbus/tahvo-usb.c 2007-05-23 17:58:06.000000000 +0100 | ||
24 | @@ -135,8 +135,8 @@ static irqreturn_t omap_otg_irq(int irq, | ||
25 | if ((!(OTG_CTRL_REG & OTG_DRIVER_SEL)) && | ||
26 | tu->otg.host && tu->otg.state == OTG_STATE_A_HOST) { | ||
27 | /* role is host */ | ||
28 | - usb_bus_start_enum(tu->otg.host, | ||
29 | - tu->otg.host->otg_port); | ||
30 | + //usb_bus_start_enum(tu->otg.host, | ||
31 | + // tu->otg.host->otg_port); | ||
32 | } | ||
33 | OTG_IRQ_SRC_REG = DRIVER_SWITCH; | ||
34 | } else | ||
35 | Index: linux-g/drivers/i2c/chips/isp1301_omap.c | ||
36 | =================================================================== | ||
37 | --- linux-g.orig/drivers/i2c/chips/isp1301_omap.c 2006-11-08 12:18:51.000000000 +0000 | ||
38 | +++ linux-g/drivers/i2c/chips/isp1301_omap.c 2007-05-23 17:55:01.000000000 +0100 | ||
39 | @@ -32,6 +32,7 @@ | ||
40 | #include <linux/usb_gadget.h> | ||
41 | #include <linux/usb.h> | ||
42 | #include <linux/usb_otg.h> | ||
43 | +#include <linux/usb/otg.h> | ||
44 | #include <linux/i2c.h> | ||
45 | #include <linux/workqueue.h> | ||
46 | |||
47 | Index: linux-g/drivers/mtd/nand/omap-hw.c | ||
48 | =================================================================== | ||
49 | --- linux-g.orig/drivers/mtd/nand/omap-hw.c 2006-11-08 12:18:55.000000000 +0000 | ||
50 | +++ linux-g/drivers/mtd/nand/omap-hw.c 2007-05-23 17:27:43.000000000 +0100 | ||
51 | @@ -386,11 +386,6 @@ static u_char omap_nand_read_byte(struct | ||
52 | return nand_read_reg8(NND_ACCESS); | ||
53 | } | ||
54 | |||
55 | -static void omap_nand_write_byte(struct mtd_info *mtd, u_char byte) | ||
56 | -{ | ||
57 | - nand_write_reg8(NND_ACCESS, byte); | ||
58 | -} | ||
59 | - | ||
60 | static int omap_nand_dev_ready(struct mtd_info *mtd) | ||
61 | { | ||
62 | u32 l; | ||
63 | @@ -425,9 +420,9 @@ static void omap_nand_command(struct mtd | ||
64 | if (command == NAND_CMD_SEQIN) { | ||
65 | int readcmd; | ||
66 | |||
67 | - if (column >= mtd->oobblock) { | ||
68 | + if (column >= mtd->writesize) { | ||
69 | /* OOB area */ | ||
70 | - column -= mtd->oobblock; | ||
71 | + column -= mtd->writesize; | ||
72 | readcmd = NAND_CMD_READOOB; | ||
73 | } else if (column < 256) { | ||
74 | /* First 256 bytes --> READ0 */ | ||
75 | @@ -458,7 +453,7 @@ static void omap_nand_command_lp(struct | ||
76 | struct nand_chip *this = mtd->priv; | ||
77 | |||
78 | if (command == NAND_CMD_READOOB) { | ||
79 | - column += mtd->oobblock; | ||
80 | + column += mtd->writesize; | ||
81 | command = NAND_CMD_READ0; | ||
82 | } | ||
83 | switch (command) { | ||
84 | @@ -495,7 +490,7 @@ static int omap_nand_calculate_ecc(struc | ||
85 | int n; | ||
86 | struct nand_chip *this = mtd->priv; | ||
87 | |||
88 | - if (this->eccmode == NAND_ECC_HW12_2048) | ||
89 | + if (this->ecc.size == 2048) | ||
90 | n = 4; | ||
91 | else | ||
92 | n = 1; | ||
93 | @@ -642,7 +637,7 @@ static int omap_nand_correct_data(struct | ||
94 | int block_count = 0, i, r; | ||
95 | |||
96 | this = mtd->priv; | ||
97 | - if (this->eccmode == NAND_ECC_HW12_2048) | ||
98 | + if (this->ecc.size == 2048) | ||
99 | block_count = 4; | ||
100 | else | ||
101 | block_count = 1; | ||
102 | @@ -672,17 +667,17 @@ static int __init add_dynamic_parts(stru | ||
103 | { | ||
104 | static const char *part_parsers[] = { "cmdlinepart", NULL }; | ||
105 | struct mtd_partition *parts; | ||
106 | - const struct omap_flash_part_config *cfg; | ||
107 | + void *cfg; | ||
108 | char *part_str = NULL; | ||
109 | size_t part_str_len; | ||
110 | int c; | ||
111 | |||
112 | - cfg = omap_get_var_config(OMAP_TAG_FLASH_PART, &part_str_len); | ||
113 | + cfg = omap_get_var_config(OMAP_TAG_FLASH_PART_STR, &part_str_len); | ||
114 | if (cfg != NULL) { | ||
115 | part_str = kmalloc(part_str_len + 1, GFP_KERNEL); | ||
116 | if (part_str == NULL) | ||
117 | return -ENOMEM; | ||
118 | - memcpy(part_str, cfg->part_table, part_str_len); | ||
119 | + memcpy(part_str, cfg, part_str_len); | ||
120 | part_str[part_str_len] = '\0'; | ||
121 | mtdpart_setup(part_str); | ||
122 | } | ||
123 | @@ -794,19 +789,19 @@ static int __init omap_nand_init(void) | ||
124 | |||
125 | /* Used from chip select and nand_command() */ | ||
126 | this->read_byte = omap_nand_read_byte; | ||
127 | - this->write_byte = omap_nand_write_byte; | ||
128 | |||
129 | this->select_chip = omap_nand_select_chip; | ||
130 | this->dev_ready = omap_nand_dev_ready; | ||
131 | this->chip_delay = 0; | ||
132 | - this->eccmode = NAND_ECC_HW3_512; | ||
133 | + this->ecc.size = 512; | ||
134 | + this->ecc.bytes = 3; | ||
135 | this->cmdfunc = omap_nand_command; | ||
136 | this->write_buf = omap_nand_write_buf; | ||
137 | this->read_buf = omap_nand_read_buf; | ||
138 | this->verify_buf = omap_nand_verify_buf; | ||
139 | - this->calculate_ecc = omap_nand_calculate_ecc; | ||
140 | - this->correct_data = omap_nand_correct_data; | ||
141 | - this->enable_hwecc = omap_nand_enable_hwecc; | ||
142 | + this->ecc.calculate = omap_nand_calculate_ecc; | ||
143 | + this->ecc.correct = omap_nand_correct_data; | ||
144 | + this->ecc.hwctl = omap_nand_enable_hwecc; | ||
145 | |||
146 | nand_write_reg(NND_SYSCFG, 0x1); /* Enable auto idle */ | ||
147 | nand_write_reg(NND_PSC_CLK, 10); | ||
148 | @@ -822,10 +817,8 @@ static int __init omap_nand_init(void) | ||
149 | l = nand_read_reg(NND_CTRL); | ||
150 | l |= 1 << 4; /* Set the A8 bit in CTRL reg */ | ||
151 | nand_write_reg(NND_CTRL, l); | ||
152 | - this->eccmode = NAND_ECC_HW12_2048; | ||
153 | - this->eccsteps = 1; | ||
154 | - this->eccsize = 2048; | ||
155 | - this->eccbytes = 12; | ||
156 | + this->ecc.size = 2048; | ||
157 | + this->ecc.bytes = 12; | ||
158 | omap_mtd->eccsize = 2048; | ||
159 | nand_write_reg(NND_ECC_SELECT, 6); | ||
160 | } | ||