patching cvs mtd to linux 2.4.27-vsr1
Dear all
Thanks for helping
I have some problem when patching cvs mtd to linux 2.4.27-vsr1.
after i use the patches/patchin.sh -c -j /usr/src/linux. I compile kernel as usual practise. But i found that error below.
arm-linux-gcc -D__KERNEL__ -I/usr/src/linux-2.4.27-vrs1/include -Wall -Wstrict-prototypes -Wno-trigraphs -Os -fno-strict-aliasing -fno-common -Uarm -fno-common -pipe -mapcs-32 -D__LINUX_ARM_ARCH__=4 -march=armv4 -mshort-load-bytes -msoft-float -Uarm -nostdinc -iwithprefix include -DKBUILD_BASENAME=chipreg -c -o chipreg.o chipreg.c
In file included from chipreg.c:14:*/usr/src/linux-2.4.27-vrs1/include/linux/mtd/map.h:127:2: #error "No bus width supported. What's the point?"
*I check that there is not define of the map_bankwidth on anywhere of the kernel source. Am i patch wrong kernel version?
Best regard
Mike,Lee
Quoted 2 lines · mike
*I check that there is not define of the
map_bankwidthon anywhere of the kernel source. Am i patch wrong kernel version?
Yes. Use 2.6.9.
Signature · 1 line
dwmw2
Quoted 6 lines · mike
Dear all
Thanks for helping
I have some problem when patching cvs mtd to linux 2.4.27-vsr1. after
i use thepatches/patchin.sh-c -j/usr/src/linux. I compile kernel as*/usr/src/linux-2.4.27-vrs1/include/linux/mtd/map.h:127:2: #error "No bus width supported. What's the point?"*I check that there is not define of the
map_bankwidthon anywhere of the kernel source. Am i patch wrong kernel version?
Hi Mike,
I'm in the middle of doing exactly the same thing because I need to get the YAFFS CVS version to work reliably. I currently have a 2.4.27-vrs1 system that compiles but YAFFS doesn't work. The 2.6 version for AT91 is coming along, so hopefully we won't have to do this 2.4 backporting for much longer, but I've got a March deadline for this project so I can't wait.
There are a few things that you have to change for the MTD CVS to work on 2.4.27-vrs1. Note that I was doing what I could to get the kernel to compile, so there may well be some major problems with what I've done.
* after patching with the MTD code you will have to restore the configuration entries for AT91 in drivers/mtd/devices/Config.in and drivers/mtd/nand/Config.in. otherwise you won't have Dataflash and NAND/Smartmedia available anymore. Copy over the AT91 specific entries from an original patched 2.4.27-vrs1
Don't forget to reselect these entries in "make menuconfig"
* set in kernel config: MTD->RAM/ROM/FLASH chip drivers -> specific CFI Flash Geometry Selection -> 8 or 16 or 32 ... etc This should solve your problem of the "No bus width"
* you need to use an older version of mtdchar.c because this file uses newer devfs functions. Unless you know how to make the current version of mtdchar.c work with 2.4 kernels, I can email you this file. If you make it work with 2.4, can you send it to me too?
* /drivers/mtd/cmdlinepart.c, I removed the static keyword so it compiles but my cmdline partitions no longer any more, but at least it compiles!
- static int parse_cmdline_partitions(struct mtd_info *master,
+ int parse_cmdline_partitions(struct mtd_info *master,
* Now for the fiddly bits. Let's begin with at91_nand.c
root@gentoo linux-2.4.27-vrs1-yaffs # diff -U 0 ../linux-2.4.27-vrs1-OLD/drivers/at91/mtd/at91_nand.c drivers/at91/mtd/at91_nand.c
-static void at91_hwcontrol(int cmd)
+static void at91_hwcontrol(struct mtd_info *mtd, int cmd)
- while (!my_nand->dev_ready())
+ while (!my_nand->dev_ready(at91_mtd))
-static int at91_device_ready(void)
+static int at91_device_ready(struct mtd_info *mtd)
- if (nand_scan (at91_mtd)) {
+#define CHIPS_TO_SCAN 1
+ if (nand_scan (at91_mtd, CHIPS_TO_SCAN)) {
I wasn't sure what to do with the data_cache problem, so I just commented it out for now:
- my_nand->data_cache = kmalloc (sizeof(u_char) * (at91_mtd->oobblock + at91_mtd->oobsize), GFP_KERNEL);
- if (!my_nand->data_cache) {
- printk ("Unable to allocate AT91 NAND data cache.\n");
- err = -ENOMEM;
- goto out_buf;
- }
- my_nand->cache_page = -1;
+// my_nand->data_cache = kmalloc (sizeof(u_char) * (at91_mtd->oobblock + at91_mtd->oobsize), GFP_KERNEL);
+// if (!my_nand->data_cache) {
+// printk ("Unable to allocate AT91 NAND data cache.\n");
+// err = -ENOMEM;
+// goto out_buf;+// }
+// my_nand->cache_page = -1;
- kfree (my_nand->data_cache);
+// kfree (my_nand->data_cache);
- kfree (my_nand->data_cache);
+// kfree (my_nand->data_cache);
* and at91_dataflash.c
root@gentoo linux-2.4.27-vrs1-yaffs # diff -U 0 ../linux-2.4.27-vrs1-OLD/drivers/at91/mtd/at91_dataflash.c drivers/at91/mtd/at91_dataflash.c
- struct mtd_partition **pparts, const char *mtd_id); + struct mtd_partition **pparts, + unsigned long origin);
- device->module = THIS_MODULE;
+ device->owner = THIS_MODULE;
- mtd_parts_nr = parse_cmdline_partitions(device, &mtd_parts, mtdID);
+ mtd_parts_nr = parse_cmdline_partitions(device, &mtd_parts, 0);
I think that's pretty well it. Please tell me if I have missed anything! Hopefully you should be a lot closer to compiling now.
regards,
Aras Vaichas