Message ID | 1341086991.2252.0@antares |
---|---|
State | New, archived |
Headers | show |
Hi Albrecht, > I don't recall who proposed this patch, but exactly this solution is > around for a longer time (mayby you search archives...). On my board, I > have a flash chip attached to the LocalBus in 16-bit mode. Based on > 3.2.16, the patch is: Thanks for your answer and yes, this patch will definitely work. But I want to have a solution in the mainline kernel, that's why I'm asking how to deal best with this problem. Regards, Stephan
Hi Stephan, On Sun, 01 Jul 2012 08:47:01 +0200 Stephan Gatzka <stephan@gatzka.org> wrote: > Hi Albrecht, > > > I don't recall who proposed this patch, but exactly this solution is > > around for a longer time (mayby you search archives...). On my board, I > > have a flash chip attached to the LocalBus in 16-bit mode. Based on > > 3.2.16, the patch is: > > Thanks for your answer and yes, this patch will definitely work. But I > want to have a solution in the mainline kernel, that's why I'm asking > how to deal best with this problem. This problem has been discussed several times [1], [2], but wasn't resolved yet. The clean solution suggested was to implement a custom mapping driver [3]. Thanks, Anatolij [1] http://thread.gmane.org/gmane.linux.drivers.mtd/21521 [2] http://thread.gmane.org/gmane.linux.ports.ppc.embedded/36324 [3] http://thread.gmane.org/gmane.linux.ports.ppc.embedded/36324/focus=36608
Hi! > This problem has been discussed several times [1], [2], but wasn't > resolved yet. The clean solution suggested was to implement a custom > mapping driver [3]. Then I'll do that. It doesn't look terribly complicated. It would be helpful if someone can test the first version if it's available. Regards, Stephan
--- linux-3.2.16-orig/fs/jffs2/scan.c 2012-04-23 00:31:32.000000000 +0200 +++ linux-3.2.16/fs/jffs2/scan.c 2012-04-27 13:23:06.000000000 +0200 @@ -509,7 +509,11 @@ sumptr = kmalloc(sumlen, GFP_KERNEL); if (!sumptr) return -ENOMEM; +#ifdef CONFIG_PPC_MPC52xx + memcpy_fromio(sumptr + sumlen - buf_len, buf + buf_size - buf_len, buf_len); +#else memcpy(sumptr + sumlen - buf_len, buf + buf_size - buf_len, buf_len); +#endif } if (buf_len < sumlen) { /* Need to read more so that the entire summary node is present */ @@ -1039,7 +1043,11 @@ if (!fd) { return -ENOMEM; } +#ifdef CONFIG_PPC_MPC52xx + memcpy_fromio(&fd->name, rd->name, checkedlen); +#else memcpy(&fd->name, rd->name, checkedlen); +#endif fd->name[checkedlen] = 0; crc = crc32(0, fd->name, rd->nsize);