2008-03-05 03:11:50 How to port My Flash driver from uClinux2007R1 to uClinux2008R1 quickly
new kernel (CHINA)
Message: 52066 My board is BF536+ FLASH(ST M29W128F) and run on uClinux2007 as well. I try to port the flash driver on uClinux2008 ,there are some errors in compiling progress:
In my flash.c :
static struct map_info bf5xx_map = {
name: "BF5xx flash",
CONFIG_BFIN_FLASH_SIZE,
CONFIG_EBIU_FLASH_BASE,
(void __iomem *)CONFIG_EBIU_FLASH_BASE,
(void *)NULL,
read: bf5xx_read,
copy_from: bf5xx_copy_from,
write: bf5xx_write,
copy_to: bf5xx_copy_to
};
error: unknown field ‘copy_from’ specified in initializer
error: unknown field ‘write’ specified in initializer
....
(1) I wonder that why the struct map_info doesn't have the field?
(2) As the document of "enable jffs2", the initial flash partitions is set up at /bf537/board/stamp.c.
<pre class="code c">static struct mtd_partition stamp_partitions[] = {
{
.name = "Bootloader",
.size = 0x40000,
.offset = 0,
}, {
.name = "Kernel",
.size = 0xE0000,
.offset = MTDPART_OFS_APPEND,
}, {
.name = "RootFS",
.size = 0x400000 - 0x40000 - 0xE0000 - 0x10000,
.offset = MTDPART_OFS_APPEND,
}, {
.name = "MAC Address",
.size = MTDPART_SIZ_FULL,
.offset = 0x3F0000,
.mask_flags = MTD_WRITEABLE,
}
}; So Can I re-define the flash partition on my flash driver as before?
Because I don't want to re-write my flash driver again.
Thanks!
QuoteReplyEditDelete
2008-03-05 03:21:30 Re: How to port My Flash driver from uClinux2007R1 to uClinux2008R1 quickly
Mike Frysinger (UNITED STATES)
Message: 52068 M29W128F is a CFI flash, so there's no need for you to write your own driver ... just use the physmap flash mapping driver like we're doing on the BF537-STAMP
as for why the mtd changed fields, you will need to have to review the kernel changelog at kernel.org and figure it out
QuoteReplyEditDelete
2008-03-05 03:36:01 Re: How to port My Flash driver from uClinux2007R1 to uClinux2008R1 quickly
new kernel (CHINA)
Message: 52072 Hi Mike,
Because my flash is non-contiguous for our requirement, so I have to re-write the read/write functions when accessing to the flash.
I don't find the M29W128F flash info at CFI/JEDEC, so should I add the mtd info?
Thanks
QuoteReplyEditDelete
2008-03-05 03:56:13 Re: How to port My Flash driver from uClinux2007R1 to uClinux2008R1 quickly
Mike Frysinger (UNITED STATES)
Message: 52075 what do you mean by "non-contiguous" ?
you dont need to add anything ... CFI being a standard, any CFI-compliant flash can be probed and used without any explicit id declaration
QuoteReplyEditDelete
2008-03-05 04:20:21 Re: How to port My Flash driver from uClinux2007R1 to uClinux2008R1 quickly
new kernel (CHINA)
Message: 52083 The "non-contiguous" means that I can't access to some addresses of the flash,sush as in my board, I can't access to 0x203f0000-0x203fffff ,which are assigned for FPGA. So I have to translate the flash address when I access to.
QuoteReplyEditDelete
2008-03-05 05:08:13 Re: How to port My Flash driver from uClinux2007R1 to uClinux2008R1 quickly
Mike Frysinger (UNITED STATES)
Message: 52087 then you should only have a flash mapping driver, not a chip driver ... and you will need to update your board resources accordingly
look at how the BF533-STAMP uses the bf5xx-flash mapping driver
QuoteReplyEditDelete
2008-03-05 05:38:24 Re: How to port My Flash driver from uClinux2007R1 to uClinux2008R1 quickly
new kernel (CHINA)
Message: 52091 Yes, I refered to bf5xx-flash.c and wrote my flash driver in /maps, but there are the same errors ,when I compile it.
So I wonder that will the BF533-STAMP enable some options if select it for my target board?
QuoteReplyEditDelete
2008-03-05 05:53:49 Re: How to port My Flash driver from uClinux2007R1 to uClinux2008R1 quickly
Mike Frysinger (UNITED STATES)
Message: 52092 if by "same errors" you mean "missing struct members in newer version", you will need to refer to the upstream changelog to see how things changed and why
the bf5xx-flash.c works fine in 2008R1/trunk