public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* patching cvs mtd to linux 2.4.27-vsr1
@ 2004-12-01  7:58 mike
  2004-12-01  9:46 ` David Woodhouse
  2004-12-01 23:32 ` Aras Vaichas
  0 siblings, 2 replies; 3+ messages in thread
From: mike @ 2004-12-01  7:58 UTC (permalink / raw)
  To: linux-mtd

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: patching cvs mtd to linux 2.4.27-vsr1
  2004-12-01  7:58 patching cvs mtd to linux 2.4.27-vsr1 mike
@ 2004-12-01  9:46 ` David Woodhouse
  2004-12-01 23:32 ` Aras Vaichas
  1 sibling, 0 replies; 3+ messages in thread
From: David Woodhouse @ 2004-12-01  9:46 UTC (permalink / raw)
  To: mike; +Cc: linux-mtd

On Wed, 2004-12-01 at 15:58 +0800, mike wrote:
> *I check that there is not define of the map_bankwidth on anywhere of 
> the kernel source. Am i patch wrong kernel version?

Yes. Use 2.6.9.

-- 
dwmw2

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: patching cvs mtd to linux 2.4.27-vsr1
  2004-12-01  7:58 patching cvs mtd to linux 2.4.27-vsr1 mike
  2004-12-01  9:46 ` David Woodhouse
@ 2004-12-01 23:32 ` Aras Vaichas
  1 sibling, 0 replies; 3+ messages in thread
From: Aras Vaichas @ 2004-12-01 23:32 UTC (permalink / raw)
  To: linux-mtd

mike wrote:
> 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 
> */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?

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-12-01 23:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-01  7:58 patching cvs mtd to linux 2.4.27-vsr1 mike
2004-12-01  9:46 ` David Woodhouse
2004-12-01 23:32 ` Aras Vaichas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox