public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* address lines
@ 2007-11-03 10:54 M8 (Servaes Joordens)
  2007-11-03 11:46 ` David Woodhouse
  0 siblings, 1 reply; 10+ messages in thread
From: M8 (Servaes Joordens) @ 2007-11-03 10:54 UTC (permalink / raw)
  To: mtd-forum

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



-- 

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

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

* Re: address lines
  2007-11-03 10:54 address lines M8 (Servaes Joordens)
@ 2007-11-03 11:46 ` David Woodhouse
  2007-11-03 12:07   ` M8 (Servaes Joordens)
  0 siblings, 1 reply; 10+ messages in thread
From: David Woodhouse @ 2007-11-03 11:46 UTC (permalink / raw)
  To: M8 (Servaes Joordens); +Cc: mtd-forum


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 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?

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?

-- 
dwmw2

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

* Re: address lines
  2007-11-03 11:46 ` David Woodhouse
@ 2007-11-03 12:07   ` M8 (Servaes Joordens)
  2007-11-03 12:13     ` David Woodhouse
  0 siblings, 1 reply; 10+ messages in thread
From: M8 (Servaes Joordens) @ 2007-11-03 12:07 UTC (permalink / raw)
  To: David Woodhouse, mtd-forum

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_point
cfi_cmdset_001.c: do_point_onechip
cfi_cmdset_001.c: get_chip
jffs2_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




David Woodhouse wrote:
> 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 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?
>>     
>
> 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?
>
>   


-- 

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

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

* Re: address lines
  2007-11-03 12:07   ` M8 (Servaes Joordens)
@ 2007-11-03 12:13     ` David Woodhouse
  2007-11-03 12:27       ` M8 (Servaes Joordens)
  0 siblings, 1 reply; 10+ messages in thread
From: David Woodhouse @ 2007-11-03 12:13 UTC (permalink / raw)
  To: M8 (Servaes Joordens); +Cc: mtd-forum


On Sat, 2007-11-03 at 13:07 +0100, M8 (Servaes Joordens) wrote:
> cfi_cmdset_001.c: cfi_intelext_point
> cfi_cmdset_001.c: do_point_onechip
> cfi_cmdset_001.c: get_chip
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000:0x890a instead
> 
> 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.

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.

-- 
dwmw2

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

* Re: address lines
  2007-11-03 12:13     ` David Woodhouse
@ 2007-11-03 12:27       ` M8 (Servaes Joordens)
  2007-11-03 12:29         ` David Woodhouse
  0 siblings, 1 reply; 10+ messages in thread
From: M8 (Servaes Joordens) @ 2007-11-03 12:27 UTC (permalink / raw)
  To: David Woodhouse, mtd-forum

David Woodhouse wrote:
> On Sat, 2007-11-03 at 13:07 +0100, M8 (Servaes Joordens) wrote:
>   
>> cfi_cmdset_001.c: cfi_intelext_point
>> cfi_cmdset_001.c: do_point_onechip
>> cfi_cmdset_001.c: get_chip
>> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000:0x890a instead
>>
>> 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.
>>     
>
> 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.
>   
How do I enable my own driver file based on sbc_gxx.c? I cannot find an 
configuration option in the kernel by menuconfig.



-- 

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

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

* Re: address lines
  2007-11-03 12:27       ` M8 (Servaes Joordens)
@ 2007-11-03 12:29         ` David Woodhouse
  2007-11-03 13:30           ` M8 (Servaes Joordens)
                             ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: David Woodhouse @ 2007-11-03 12:29 UTC (permalink / raw)
  To: M8 (Servaes Joordens); +Cc: mtd-forum

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.

-- 
dwmw2

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

* Re: address lines
  2007-11-03 12:29         ` David Woodhouse
@ 2007-11-03 13:30           ` M8 (Servaes Joordens)
  2007-11-03 14:35           ` M8 (Servaes Joordens)
  2007-11-04  9:30           ` M8 (Servaes Joordens)
  2 siblings, 0 replies; 10+ messages in thread
From: M8 (Servaes Joordens) @ 2007-11-03 13:30 UTC (permalink / raw)
  To: David Woodhouse; +Cc: mtd-forum

David Woodhouse wrote:
> 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.
>
>   
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



-- 

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

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

* Re: address lines
  2007-11-03 12:29         ` David Woodhouse
  2007-11-03 13:30           ` M8 (Servaes Joordens)
@ 2007-11-03 14:35           ` M8 (Servaes Joordens)
  2007-11-04  9:30           ` M8 (Servaes Joordens)
  2 siblings, 0 replies; 10+ messages in thread
From: M8 (Servaes Joordens) @ 2007-11-03 14:35 UTC (permalink / raw)
  To: David Woodhouse; +Cc: mtd-forum

David Woodhouse wrote:
> 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.
>
>   
physmap is still active next to my new driver with complex mappings. Is 
this correct, or should I disable the configuration option for physmap?



-- 

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

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

* Re: address lines
  2007-11-03 12:29         ` David Woodhouse
  2007-11-03 13:30           ` M8 (Servaes Joordens)
  2007-11-03 14:35           ` M8 (Servaes Joordens)
@ 2007-11-04  9:30           ` M8 (Servaes Joordens)
  2007-11-04 11:23             ` David Woodhouse
  2 siblings, 1 reply; 10+ messages in thread
From: M8 (Servaes Joordens) @ 2007-11-04  9:30 UTC (permalink / raw)
  To: David Woodhouse; +Cc: mtd-forum

David Woodhouse wrote:
> 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.
>
>   
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





-- 

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

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

* Re: address lines
  2007-11-04  9:30           ` M8 (Servaes Joordens)
@ 2007-11-04 11:23             ` David Woodhouse
  0 siblings, 0 replies; 10+ messages in thread
From: David Woodhouse @ 2007-11-04 11:23 UTC (permalink / raw)
  To: M8 (Servaes Joordens); +Cc: mtd-forum

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?

> 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 seems a little strange. Can you show your code? 

-- 
dwmw2

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

end of thread, other threads:[~2007-11-04 11:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-03 10:54 address lines M8 (Servaes Joordens)
2007-11-03 11:46 ` David Woodhouse
2007-11-03 12:07   ` M8 (Servaes Joordens)
2007-11-03 12:13     ` David Woodhouse
2007-11-03 12:27       ` M8 (Servaes Joordens)
2007-11-03 12:29         ` David Woodhouse
2007-11-03 13:30           ` M8 (Servaes Joordens)
2007-11-03 14:35           ` M8 (Servaes Joordens)
2007-11-04  9:30           ` M8 (Servaes Joordens)
2007-11-04 11:23             ` David Woodhouse

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