* 2.6.10, Intel chip, incorrect numparts detection
@ 2005-01-06 11:18 Olav Kongas
2005-01-06 18:00 ` Dan Post
0 siblings, 1 reply; 4+ messages in thread
From: Olav Kongas @ 2005-01-06 11:18 UTC (permalink / raw)
To: linux-mtd
Hi,
On 2.6.10, the detected hw partition number seems to be
insane. All is ok on 2.6.9. I added few printk's to the
cfi_intelext_partition_fixup() in 2.6.10 hoping that this
will provide some more useful info (probably not). Below I
give the code fragment sprinkled with my printk's and both
unsuccessful 2.6.10 and successful 2.6.9 boot dumps.
Olav
PS Please use CC, I am not subscribed to the list.
------Code fragment from cfi_intelext_partition_fixup(), with my prink's added-------
printk("%s %d: enter\n",__FUNCTION__,__LINE__); /* __LINE__ == 455 */
/* Protection Register info */
offs = (extp->NumProtectionFields - 1) * (4 + 6);
printk("%s %d: offs %d\n",__FUNCTION__,__LINE__,offs);
/* Burst Read info */
offs += 6;
/* Number of partition regions */
numregions = extp->extra[offs];
offs += 1;
printk("%s %d: offs %d, numregions %d\n",__FUNCTION__,__LINE__,offs, numregions);
/* Number of hardware partitions */
numparts = 0;
for (i = 0; i < numregions; i++) {
struct cfi_intelext_regioninfo *rinfo;
rinfo = (struct cfi_intelext_regioninfo *)&extp->extra[offs];
numparts += rinfo->NumIdentPartitions;
offs += sizeof(*rinfo)
+ (rinfo->NumBlockTypes - 1) *
sizeof(struct cfi_intelext_blockinfo);
printk("%s %d: offs %d, numregions %d, numparts %d\n",__FUNCTION__,__LINE__,offs, numregions, numparts);
}
/*
* All functions below currently rely on all chips having
* the same geometry so we'll just assume that all hardware
* partitions are of the same size too.
*/
partshift = cfi->chipshift - __ffs(numparts);
printk("%s %d: cfi->chipshift %ld, __ffs(numparts) %ld, partshift %d\n",
__FUNCTION__,__LINE__,cfi->chipshift, __ffs(numparts), partshift);
if ((1 << partshift) < mtd->erasesize) {
printk( KERN_ERR
"%s: bad number of hw partitions (%d)\n",
__FUNCTION__, numparts);
return -EINVAL;
}
------------------Dump of failure on 2.6.10------------
Linux version 2.6.10 (ok@pcx) (gcc version 3.3.2) #7 Thu Jan 6 12:47:28 EET 2005
CPU: ARM922Tid(wb) [41029220] revision 0 (ARMv4T)
CPU: D VIVT write-back cache
CPU: I cache: 8192 bytes, associativity 64, 32 byte lines, 4 sets
CPU: D cache: 8192 bytes, associativity 64, 32 byte lines, 4 sets
Machine: Logic Product Development LPD7A400-10
Memory policy: ECC disabled, Data cache writeback
Built 7 zonelists
Kernel command line: console=ttyAM1 mtdparts=phys_mapped_flash:4m@2m(root)ro,2m@
6m(usrlocal)ro,384k@1664k(conf),64k@1344k(font)ro root=/dev/mtdblock0
PID hash table entries: 64 (order: 6, 1024 bytes)
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
Memory: 4MB 4MB 4MB 3MB = 15MB total
Memory: 13628KB available (1093K code, 269K data, 60K init)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
Linux NoNET1.0 for Linux 2.6
SCSI subsystem initialized
usbcore: registered new driver usbfs
usbcore: registered new driver hub
NetWinder Floating Point Emulator V0.97 (double precision)
Real Time Clock Driver v1.12
serial: LH7A40X serial driver
ttyAM0 at MMIO 0x80000600 (irq = 12) is a LH7A40X
ttyAM1 at MMIO 0x80000700 (irq = 13) is a LH7A40X
ttyAM2 at MMIO 0x80000800 (irq = 16) is a LH7A40X
io scheduler noop registered
io scheduler cfq registered
loop: loaded (max 8 devices)
elevator: using cfq as default io scheduler
physmap flash device: 800000 at 0
phys_mapped_flash: Found 1 x16 devices at 0x0 in 16-bit bank
Intel/Sharp Extended Query Table at 0x0039
Intel/Sharp Extended Query Table at 0x0039
Intel/Sharp Extended Query Table at 0x0039
Intel/Sharp Extended Query Table at 0x0039
Using buffer write method
cfi_cmdset_0001: Erase suspend on write enabled
cfi_intelext_partition_fixup 455: enter
cfi_intelext_partition_fixup 459: offs 0
cfi_intelext_partition_fixup 466: offs 7, numregions 1
cfi_intelext_partition_fixup 477: offs 69, numregions 1, numparts 4352
cfi_intelext_partition_fixup 487: cfi->chipshift 23, __ffs(numparts) 8, partshif
t 15
cfi_intelext_partition_fixup: bad number of hw partitions (4352)
gen_probe: No supported Vendor Command Set found
Initializing USB Mass Storage driver...
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
usbcore: registered new driver usbhid
drivers/usb/input/hid-core.c: v2.0:USB HID core driver
VFS: Cannot open root device "mtdblock0" or unknown-block(0,0)
Please append a correct "root=" boot option
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
--------Dump of successful boot on 2.6.9-------------
Linux version 2.6.9 (ok@pcx) (gcc version 3.3.2) #29 Mon Jan 3 17:07:49 EET 2005
CPU: ARM922Tid(wb) [41029220] revision 0 (ARMv4T)
CPU: D VIVT write-back cache
CPU: I cache: 8192 bytes, associativity 64, 32 byte lines, 4 sets
CPU: D cache: 8192 bytes, associativity 64, 32 byte lines, 4 sets
Machine: Logic Product Development LPD7A400-10
Memory policy: ECC disabled, Data cache writeback
Built 7 zonelists
Kernel command line: console=ttyAM1 mtdparts=phys_mapped_flash:4m@2m(root)ro,2m@
6m(usrlocal)ro,384k@1664k(conf),64k@1344k(font)ro root=/dev/mtdblock0
PID hash table entries: 64 (order: 6, 1024 bytes)
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
Memory: 4MB 4MB 4MB 3MB = 15MB total
Memory: 13552KB available (1128K code, 319K data, 56K init)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
Linux NoNET1.0 for Linux 2.6
SCSI subsystem initialized
usbcore: registered new driver usbfs
usbcore: registered new driver hub
NetWinder Floating Point Emulator V0.97 (double precision)
Real Time Clock Driver v1.12
serial: LH7A40X serial driver
ttyAM0 at MMIO 0x80000600 (irq = 12) is a LH7A40X
ttyAM1 at MMIO 0x80000700 (irq = 13) is a LH7A40X
ttyAM2 at MMIO 0x80000800 (irq = 16) is a LH7A40X
loop: loaded (max 8 devices)
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
Using cfq io scheduler
physmap flash device: 800000 at 0
phys_mapped_flash: Found 1 x16 devices at 0x0 in 16-bit bank
Intel/Sharp Extended Query Table at 0x0039
cfi_cmdset_0001: Erase suspend on write enabled
Using buffer write method
4 cmdlinepart partitions found on MTD device phys_mapped_flash
Creating 4 MTD partitions on "phys_mapped_flash":
0x00200000-0x00600000 : "root"
0x00600000-0x00800000 : "usrlocal"
0x001a0000-0x00200000 : "conf"
0x00150000-0x00160000 : "font"
Initializing USB Mass Storage driver...
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
usbcore: registered new driver usbhid
drivers/usb/input/hid-core.c: v2.0:USB HID core driver
VFS: Mounted root (cramfs filesystem) readonly.
Freeing init memory: 56K
init started: BusyBox v1.00-pre2 (2004.02.13-19:56+0000) multi-call binary
board (Tue Aug 3 19:53:25 EEST 2004)
board login:
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: 2.6.10, Intel chip, incorrect numparts detection
2005-01-06 11:18 2.6.10, Intel chip, incorrect numparts detection Olav Kongas
@ 2005-01-06 18:00 ` Dan Post
2005-01-07 8:22 ` 2.6.10, Sharp chip, incorrect numparts (was: Intel chip) Olav Kongas
0 siblings, 1 reply; 4+ messages in thread
From: Dan Post @ 2005-01-06 18:00 UTC (permalink / raw)
To: Olav Kongas; +Cc: linux-mtd
On Thu, 6 Jan 2005 13:18:17 +0200 (EET), Olav Kongas <ok@artecdesign.ee> wrote:
> On 2.6.10, the detected hw partition number seems to be
> insane. All is ok on 2.6.9. I added few printk's to the
> cfi_intelext_partition_fixup() in 2.6.10 hoping that this
> will provide some more useful info (probably not). Below I
> give the code fragment sprinkled with my printk's and both
> unsuccessful 2.6.10 and successful 2.6.9 boot dumps.
Olav,
What flash chip are you using, e.g. model, density, etc?
I see you're using a x16 buswidth, not a x32 pair. That could be
related to the problem--e.g. one small piece of code not taking into
account the interleave--but I'm just making a wild stab in the dark,
which could be utterly wrong. Latest MTD code works for me on L18,
32MiB (28F256L18), albeit on a 2.4 kernel (I have yet to try 2.6.10).
As you can tell, 2.6.9 uses a constant number for the partshift, which
was wrong. On 8 and 16MiB L18, the partshift should be 20 (1MiB); on
32MiB L18, it should be 21, and it gets more complicated from there.
K3 and J3 don't have hardware partitions, so the partition fixup code
shouldn't be activated.
Later MTD code, including that in 2.6.10, actually looks at the CFI,
and in a rather nice manner (thanks Nicolas), but sounds like it has
some missing cases...
Also, on L18, numregions should be 2. You're getting 1.
Are you, by chance, using W18? I've never tested it there, and there
may be subtle CFI differences.
Dan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: 2.6.10, Sharp chip, incorrect numparts (was: Intel chip)
2005-01-06 18:00 ` Dan Post
@ 2005-01-07 8:22 ` Olav Kongas
2005-01-26 11:34 ` Olav Kongas
0 siblings, 1 reply; 4+ messages in thread
From: Olav Kongas @ 2005-01-07 8:22 UTC (permalink / raw)
To: Dan Post; +Cc: linux-mtd
Hi Dan,
Thank you for your reply.
First, please excuse me about the incorrect information - it
is Sharp chip and not Intel one.
On Thu, 6 Jan 2005, Dan Post wrote:
> What flash chip are you using, e.g. model, density, etc?
> I see you're using a x16 buswidth, not a x32 pair. That could be
> related to the problem--e.g. one small piece of code not taking into
> account the interleave--but I'm just making a wild stab in the dark,
> which could be utterly wrong. Latest MTD code works for me on L18,
> 32MiB (28F256L18), albeit on a 2.4 kernel (I have yet to try 2.6.10).
My flash chip is lh28f640bfhe-pbtl90, 64M (4Mbit x 16), and
as Sharp docs say, its model no. is LHF64F12. It has 8
4Kword blocks at the beginning of the flash and then 127
32Kword blocks. There is just a single flash chip on the
board.
> Later MTD code, including that in 2.6.10, actually looks at the CFI,
> and in a rather nice manner (thanks Nicolas), but sounds like it has
> some missing cases...
Yeah, months ago I noticed that the kernel understood only
the 64kiB blocks but not the 8KiB ones at the beginning of
the flash.
I have to admit I know almost nothing about the CFI and
flashes. But I can print out more flash info and do testing,
if needed.
Sorry again for misinformation,
Olav
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: 2.6.10, Sharp chip, incorrect numparts (was: Intel chip)
2005-01-07 8:22 ` 2.6.10, Sharp chip, incorrect numparts (was: Intel chip) Olav Kongas
@ 2005-01-26 11:34 ` Olav Kongas
0 siblings, 0 replies; 4+ messages in thread
From: Olav Kongas @ 2005-01-26 11:34 UTC (permalink / raw)
To: Dan Post; +Cc: linux-mtd
Hi,
> My flash chip is lh28f640bfhe-pbtl90, 64M (4Mbit x 16), and
> as Sharp docs say, its model no. is LHF64F12. It has 8
> 4Kword blocks at the beginning of the flash and then 127
> 32Kword blocks. There is just a single flash chip on the
> board.
I took another look at the misconfiguration of Sharp flash
chip in >=2.6.10 kernel. Briefly, the situation is the
following.
The failure to correctly detect the chip occurs in
cfi_intelext_partition_fixup(). In the PRI table of the
chip, the major and minor version numbers are '1' and '3',
and the 32-bit Optional Feature & Command Support field has
bit 9 set. Therefore, the probing for multiple partitions is
tried, and it fails.
The documentation about the abovementioned chip doesn't
contain any information about the chip's PRI table layout.
Also, I haven't been able to find any other documentation
showing Sharp's extensions to the PRI table nor have I found
their interpretation of the bit 9 in Optional Feature field.
Therefore, pointers to such information would be
appreciated.
The "fix" that I use for now is just to avoid partition
probing for sharp chips.
Olav
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-01-26 11:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-06 11:18 2.6.10, Intel chip, incorrect numparts detection Olav Kongas
2005-01-06 18:00 ` Dan Post
2005-01-07 8:22 ` 2.6.10, Sharp chip, incorrect numparts (was: Intel chip) Olav Kongas
2005-01-26 11:34 ` Olav Kongas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox