address lines
I took a closer look at the bank-switching problem. The situation is:
- I have an 4Mb Flash chip MT28F320J3FS-11
- A0-A19 are connected to the data-bus
- A20 is connected to GPIO PF4
So the hardware probe detects 4MB flash in 1 chip and tries to access it in a normal manner. How should I solve this? I got a patch from the manufacturer of the hardware for the file cfi_cmdset_0001.c, but I do wonder if that is the correct way to do it?
regards
Servaes
Signature · 13 lines
Servaes Joordens ------------------------------------------- M8 Tappersweg 29 2031ET Haarlem The Netherlands Tel: +31 23 5311122 Mob: +31 6 51183379 Fax: +31 23 5322388 VAT-ID: nl-813029090B01 kvk: 34131430 Haarlem
Quoted 11 lines · On Sat, 2007-11-03 at 11:54 +0100, M8 (Servaes Joordens) wrote:
I took a closer look at the bank-switching problem. The situation is:
- I have an 4Mb Flash chip MT28F320J3FS-11
- A0-A19 are connected to the data-bus
- A20 is connected to GPIO PF4So the hardware probe detects 4MB flash in 1 chip and tries to access it
in a normal manner. How should I solve this? I got a patch from the manufacturer of the hardware for the filecfi_cmdset_0001.c, but I do wonder if that is the correct way to do it?
No, it isn't. The correct way to do it is a fairly trivial 'complex mapping' driver, which ensures that the GPIO is set appropriately for the high bit of the address, before each access. Didn't I already point you to examples?
Signature · 1 line
dwmw2
David,
Yes you did. I did the following:
- I changed the call to simple_map_init(xxx) in physmap.c to my_simple_map_init(xxx)
- I add the bank-switching routines in physmap.c and link them via my_simple_map_init(xxx)
I put an printk in every bank-switching routine. I does work properly in the begining, but then I get the following prints: (I added a printk in every function to check the caling order of things)
cfi_cmdset_001.c: cfi_intelext_pointcfi_cmdset_001.c: do_point_onechipcfi_cmdset_001.c: get_chipjffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000: 0x890a in stead
I expected that prior to error-report a read or write action to the flash is done. In that case I should have seen an printk saying physmap.c:bank_switching_map_read or physmap.c:bank_switching_map_write.
Servaes
Quoted 18 lines · David Woodhouse
Quoted 9 lines · On Sat, 2007-11-03 at 11:54 +0100, M8 (Servaes Joordens) wrote:
I took a closer look at the bank-switching problem. The situation is:
- I have an 4Mb Flash chip MT28F320J3FS-11
- A0-A19 are connected to the data-bus
- A20 is connected to GPIO PF4So the hardware probe detects 4MB flash in 1 chip and tries to access
it in a normal manner. How should I solve this? I got a patch from the manufacturer of the hardware for the filecfi_cmdset_0001.c, but I do wonder if that is the correct way to do it?No, it isn't. The correct way to do it is a fairly trivial 'complex mapping' driver, which ensures that the GPIO is set appropriately for the high bit of the address, before each access. Didn't I already point you to examples?
Signature · 13 lines
Servaes Joordens ------------------------------------------- M8 Tappersweg 29 2031ET Haarlem The Netherlands Tel: +31 23 5311122 Mob: +31 6 51183379 Fax: +31 23 5322388 VAT-ID: nl-813029090B01 kvk: 34131430 Haarlem
Quoted 9 lines · On Sat, 2007-11-03 at 13:07 +0100, M8 (Servaes Joordens) wrote:
cfi_cmdset_001.c:cfi_intelext_pointcfi_cmdset_001.c:do_point_onechipcfi_cmdset_001.c:get_chipjffs2_scan_eraseblock(): Magic bitmask0x1985not found at 0x00000000:0x890a insteadI expected that prior to error-report a read or write action to the flash is done. In that case I should have seen an printk saying physmap.c:bank_switching_map_read or physmap.c:bank_switching_map_write.
Hm, yes. The 'point' method bypasses the normal access functions, on the assumption that the entire device is actually directly mappable.
The sbc_gxx driver to which I referred you sets map->phys = NO_XIP;
Did you?
I don't understand why you're messing with physmap.c when that isn't the one I told you to use as a template.
Signature · 1 line
dwmw2
Quoted 16 lines · David Woodhouse
Quoted 10 lines · On Sat, 2007-11-03 at 13:07 +0100, M8 (Servaes Joordens) wrote:
cfi_cmdset_001.c:cfi_intelext_pointcfi_cmdset_001.c:do_point_onechipcfi_cmdset_001.c:get_chipjffs2_scan_eraseblock(): Magic bitmask0x1985not found at 0x00000000:0x890a insteadI expected that prior to error-report a read or write action to the flash is done. In that case I should have seen an printk saying physmap.c:bank_switching_map_read or physmap.c:bank_switching_map_write.
Hm, yes. The 'point' method bypasses the normal access functions, on the assumption that the entire device is actually directly mappable.
Quoted 7 lines
The
sbc_gxxdriver to which I referred you setsmap->phys=NO_XIP;Did you?
I don't understand why you're messing with
physmap.cwhen that isn't the one I told you to use as a template.
How do I enable my own driver file based on sbc_gxx.c? I cannot find an configuration option in the kernel by menuconfig.
Signature · 13 lines
Servaes Joordens ------------------------------------------- M8 Tappersweg 29 2031ET Haarlem The Netherlands Tel: +31 23 5311122 Mob: +31 6 51183379 Fax: +31 23 5322388 VAT-ID: nl-813029090B01 kvk: 34131430 Haarlem
Quoted 2 lines · On Sat, 2007-11-03 at 13:27 +0100, M8 (Servaes Joordens) wrote:
How do I enable my own driver file based on
sbc_gxx.c? I cannot find an configuration option in the kernel by menuconfig.
Copy sbc_gxx.c to create your own driver. Copy the configuration option in drivers/mtd/maps/Kconfig too, renaming it appropriately and giving it appropriate dependencies. Add an appropriate line in drivers/mtd/maps/Makefile, using your new config option and your new filename.
Signature · 1 line
dwmw2
Quoted 6 lines · David Woodhouse
Quoted 3 lines · On Sat, 2007-11-03 at 13:27 +0100, M8 (Servaes Joordens) wrote:
How do I enable my own driver file based on
sbc_gxx.c? I cannot find an configuration option in the kernel by menuconfig.
Quoted 7 lines
Copy
sbc_gxx.cto create your own driver. Copy the configuration option indrivers/mtd/maps/Kconfigtoo, renaming it appropriately and giving it appropriate dependencies. Add an appropriate line indrivers/mtd/maps/Makefile, using your new config option and your new filename.
Ok, I did it. Can you tell me the meaning of the calls to ioremap and request_region?
I used the following defines:
#define WINDOW_START 0x20000000
#define WINDOW_SHIFT 20
I do not know what to do with:
#define PAGE_IO 258
#define DEVICE_ENABLE 0x8000
Signature · 13 lines
Servaes Joordens ------------------------------------------- M8 Tappersweg 29 2031ET Haarlem The Netherlands Tel: +31 23 5311122 Mob: +31 6 51183379 Fax: +31 23 5322388 VAT-ID: nl-813029090B01 kvk: 34131430 Haarlem
Quoted 6 lines · David Woodhouse
Quoted 3 lines · On Sat, 2007-11-03 at 13:27 +0100, M8 (Servaes Joordens) wrote:
How do I enable my own driver file based on
sbc_gxx.c? I cannot find an configuration option in the kernel by menuconfig.
Quoted 7 lines
Copy
sbc_gxx.cto create your own driver. Copy the configuration option indrivers/mtd/maps/Kconfigtoo, renaming it appropriately and giving it appropriate dependencies. Add an appropriate line indrivers/mtd/maps/Makefile, using your new config option and your new filename.
physmap is still active next to my new driver with complex mappings. Is this correct, or should I disable the configuration option for physmap?
Signature · 13 lines
Servaes Joordens ------------------------------------------- M8 Tappersweg 29 2031ET Haarlem The Netherlands Tel: +31 23 5311122 Mob: +31 6 51183379 Fax: +31 23 5322388 VAT-ID: nl-813029090B01 kvk: 34131430 Haarlem
Quoted 6 lines · David Woodhouse
Quoted 3 lines · On Sat, 2007-11-03 at 13:27 +0100, M8 (Servaes Joordens) wrote:
How do I enable my own driver file based on
sbc_gxx.c? I cannot find an configuration option in the kernel by menuconfig.
Quoted 7 lines
Copy
sbc_gxx.cto create your own driver. Copy the configuration option indrivers/mtd/maps/Kconfigtoo, renaming it appropriately and giving it appropriate dependencies. Add an appropriate line indrivers/mtd/maps/Makefile, using your new config option and your new filename.
David,
I got everything working now, except for the fact that when I write anything to my jffs2 partition, it fails. The error report states that the disk is full. Do you have any idea's?
In the configuration, I disabled the map_funcs file and replace it with my own version.I had to write some code to distiguish between flash memory and ram. This works fine now.
regards,
Servaes
Signature · 13 lines
Servaes Joordens ------------------------------------------- M8 Tappersweg 29 2031ET Haarlem The Netherlands Tel: +31 23 5311122 Mob: +31 6 51183379 Fax: +31 23 5322388 VAT-ID: nl-813029090B01 kvk: 34131430 Haarlem
Quoted 3 lines · On Sun, 2007-11-04 at 10:30 +0100, M8 (Servaes Joordens) wrote:
I got everything working now, except for the fact that when I write anything to my jffs2 partition, it fails. The error report states that the disk is full. Do you have any idea's?
How big is your JFFS2 partition? How big is the image you put on it to start with? Do writes to the flash work at all from Linux? What _precisely_ is the error yo uget?
Quoted 3 lines
In the configuration, I disabled the
map_funcsfile and replace it with my own version.I had to write some code to distiguish between flash memory and ram.
This seems a little strange. Can you show your code?
Signature · 1 line
dwmw2