Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Valued Contributor III
800 Views

CFI Flash - "NOR chip too large" error on uCLinux

Hello, 

 

I'm trying to use the CFI Flash on Arria II GX Development Kit 6G Edition on uCLinux. 

 

The flash is correctly probed but I get a warning about the flash size being truncated (below). 

 

I don't think I understand the difference between the device size (which is correctly detected) and the mapping size.  

 

How can I fix this? 

 

Thanks. 

 

0.flash: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0x000089 Chip ID 0x008961 NOR chip too large to fit in mapping. Attempting to cope... Intel/Sharp Extended Query Table at 0x010A Intel/Sharp Extended Query Table at 0x010A Intel/Sharp Extended Query Table at 0x010A Intel/Sharp Extended Query Table at 0x010A Intel/Sharp Extended Query Table at 0x010A Using buffer write method Using auto-unlock on power-up/resume cfi_cmdset_0001: Erase suspend on write enabled erase region 0: offset=0x0,size=0x8000,blocks=4 erase region 1: offset=0x20000,size=0x20000,blocks=511 Reducing visibility of 65536KiB chip to 32768KiB
0 Kudos
5 Replies
Highlighted
Valued Contributor III
23 Views

A week has passed so I've got to bring up my post... 

 

Anyone has already seen this message? Any clue about that?
0 Kudos
Highlighted
Valued Contributor III
23 Views

Hi, 

 

The message "NOR chip too large to fit in mapping. Attempting to cope..." is produced in the function 'genprobe_ident_chips' like 

 

static struct cfi_private *genprobe_ident_chips(struct map_info *map, struct chip_probe *cp) { struct cfi_private cfi; struct cfi_private *retcfi; unsigned long *chip_map; int i, j, mapsize; int max_chips; <skip>... /* * Allocate memory for bitmap of valid chips. * Align bitmap storage size to full byte. */ max_chips = map->size >> cfi.chipshift; if (!max_chips) { printk(KERN_WARNING "NOR chip too large to fit in mapping. Attempting to cope...\n"); max_chips = 1; } mapsize = sizeof(long) * DIV_ROUND_UP(max_chips, BITS_PER_LONG); chip_map = kzalloc(mapsize, GFP_KERNEL);  

 

So you must enlarge the 'map->size', but I don't know where this value is set. 

 

Kazu
0 Kudos
Highlighted
Valued Contributor III
23 Views

Thanks for your reply Kazu! 

 

I've got to this piece of code but couldn't find where it's set as well. There are several modules which call this function and as 'map' is a parameter I can't be sure where it's coming from. 

 

Also, i don't get the point. What the mapping is? Is it the memory address space allocated to the device or is it probed or derived from hardware? 

 

It's strange I couldn't find anything about it in the whole internet, is it that unusual to have a 64Mb flash on a board running uCLinux?
0 Kudos
Highlighted
Valued Contributor III
23 Views

Hi, 

 

 

--- Quote Start ---  

 

 

I've got to this piece of code but couldn't find where it's set as well. There are several modules which call this function and as 'map' is a parameter I can't be sure where it's coming from. 

 

Also, i don't get the point. What the mapping is? Is it the memory address space allocated to the device or is it probed or derived from hardware? 

 

It's strange I couldn't find anything about it in the whole internet, is it that unusual to have a 64Mb flash on a board running uCLinux? 

--- Quote End ---  

 

 

I'm using Ver.2.6.30. So maybe my suggestion is beside the point, but if device's configurations are done in the file 'arch/nios2/kernel/config.c', then please search the text with a keyword 'cfi'. For example  

 

static struct resource nios2_flash_resource = { # if defined(CFI_FLASH_0_BASE) .start = CFI_FLASH_0_BASE, .end = CFI_FLASH_0_BASE + CFI_FLASH_0_SPAN - 1, # else .start = EXT_FLASH_BASE, .end = EXT_FLASH_BASE + EXT_FLASH_SPAN - 1, # endif .flags = IORESOURCE_MEM, };  

 

determines the CFI flash memory size by 'CFI_FLASH_0_SPAN' or 'EXT_FLASH_SPAN'. Linux kernel will call a function 'platform_add_devices' with these data and register the devices. Inside this function, a special address space for the device is mapped for its use. Of course the space is different from the main memory one.  

 

Kazu
0 Kudos
Highlighted
Valued Contributor III
23 Views

Actually I'm using device-tree, so the config.c approach doesn't apply. But your post gave me some insight into the mapping thing, I'll try to mess with that when I get the time to get back to this issue. 

 

Thanks again Kazu!
0 Kudos