Modify

Opened 6 years ago

Closed 6 years ago

Last modified 2 years ago

#6552 closed defect (fixed)

Samsung K8D6316UBM-PI07 (8MByte) Flash not correctly detected, seen as 1 physmap block.

Reported by: Michael J Evans <mjevans1983@…> Owned by: florian
Priority: high Milestone: Barrier Breaker 14.07
Component: kernel Version: Trunk
Keywords: flash detect samsung mtd Cc:

Description

Problem: The Samsung Electronics chip is not correctly detected, a HACKED detection routine that over-rides 'insanely large' erase block sizes with 64k block sizes allows ar7part.c to correctly detect and subsiquently boot.

16MB ram: hy57v281620ftp 128Mb Synchronous DRAM based on 2M x 4Bank x16 I/O Document Title ...

8MB flash: K8D6316UBM-PI07 Samsung Electronics 64M Bit (8M x8/4M x16) Dual Bank NOR Flash Memory

�������� === IMPORTANT ============================

Use 'passwd' to set your login password
this will disable telnet and enable SSH

------------------------------------------

BusyBox v1.15.3 (2010-01-21 19:29:56 PST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

_

| |.-----.-----.-----.| | | |.----.| |_

| - |_
_ | -| | | _ _|
|_||| ||

|| W I R E L E S S F R E E D O M

KAMIKAZE (bleeding edge, r19265) ------------------

  • 10 oz Vodka Shake well with ice and strain
  • 10 oz Triple sec mixture into 10 shot glasses.
  • 10 oz lime juice Salute!

---------------------------------------------------

root@OpenWrt:/# dmesg | tail
dmesg | tail
tn7dsl_set_modulation : Setting mode to 0x1
Creating new root folder avalanche in the proc for the driver stats
Texas Instruments ATM driver: version:[7.03.01.00]
NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
NFSD: unable to find recovery directory /var/lib/nfs/v4recovery
NFSD: starting 90-second grace period
MTDSB: lookup_bdev() returned 0
MTDSB: New superblock for device 4 ("rootfs_data")
ar7_wdt: enabling watchdog timer
ar7_wdt: timer margin 59 seconds (prescale 65535, change 48480, freq 52992000)
root@OpenWrt:/# dmesg
dmesg
Linux version 2.6.30.10 (aeon@mainline) (gcc version 4.3.3 (GCC) ) #12 Fri Jan 22 21:40:40 PST 2010
console [early0] enabled
CPU revision is: 00018448 (MIPS 4KEc)
Clocks: Sync 2:1 mode
Clocks: Setting CPU clock
Adjusted requested frequency 211000000 to 211968000
Clocks: prediv: 1, postdiv: 1, mul: 6
Clocks: base = 35328000, frequency = 211968000, prediv = 1, postdiv = 1, postdiv2 = -1, mul = 6
Clocks: Setting DSP clock
Clocks: prediv: 1, postdiv: 1, mul: 5
Clocks: base = 25000000, frequency = 105984000, prediv = 1, postdiv = 2, postdiv2 = 1, mul = 10
Clocks: Setting USB clock
Adjusted requested frequency 48000000 to 47863741
Clocks: prediv: 1, postdiv: 31, mul: 14
Clocks: base = 105984000, frequency = 48000000, prediv = 1, postdiv = 31, postdiv2 = -1, mul = 14
TI AR7 (TNETD7200), ID: 0x002b, Revision: 0x11
Determined physical RAM map:

memory: 01000000 @ 14000000 (usable)

Initrd not found or empty - disabling initrd
Zone PFN ranges:

Normal 0x00014000 -> 0x00015000

Movable zone start PFN for each node
early_node_map[1] active PFN ranges

0: 0x00014000 -> 0x00015000

On node 0 totalpages: 4096
free_area_init_node: node 0, pgdat 943a8900, node_mem_map 943e3000

Normal zone: 32 pages used for memmap
Normal zone: 0 pages reserved
Normal zone: 4064 pages, LIFO batch:0

Built 1 zonelists in Zone order, mobility grouping off. Total pages: 4064
Kernel command line: rootfstype=squashfs,jffs2 console=ttyS0,115200n8
Primary instruction cache 16kB, VIPT, 4-way, linesize 16 bytes.
Primary data cache 8kB, 4-way, VIPT, no aliases, linesize 16 bytes
NR_IRQS:256
PID hash table entries: 64 (order: 6, 256 bytes)
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
Memory: 12260k/16384k available (2292k kernel code, 4124k reserved, 432k data, 136k init, 0k highmem)
Calibrating delay loop... 211.35 BogoMIPS (lpj=1056768)
Mount-cache hash table entries: 512
net_namespace: 1008 bytes
NET: Registered protocol family 16
bio: create slab <bio-0> at 0
Switched to high resolution mode on CPU 0
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 512 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 512 bind 512)
TCP reno registered
NET: Registered protocol family 1
squashfs: version 4.0 (2009/01/31) Phillip Lougher
Registering mini_fo version $Id$
JFFS2 version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
msgmni has been set to 23
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
serial8250: ttyS0 at MMIO 0x8610e00 (irq = 15) is a XScale
console handover: boot [early0] -> real [ttyS0]
loop: module loaded
Fixed MDIO Bus: probed
cpmac-mii: probed
eth0 (): not using net_device_ops yet
cpmac: device eth0 (regs: 08610000, irq: 27, phy: 1:1f, mac: 00:15:05:a2:24:34)
SSFDC read-only Flash Translation layer
physmap platform flash device: 00800000 at 10000000
physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank

Amd/Fujitsu Extended Query Table at 0x0040

Unknown Amd/Fujitsu Extended Query version 0.0.

gen_probe: No supported Vendor Command Set found
Searching for RedBoot partition table in physmap-flash.0 at offset 0x0
No RedBoot partition table detected in physmap-flash.0
mtd: running ar7_parser on blocks 0..127(size == 0x10000 master erase size = 0x800000).
ar7part.c: probe 127 at 0x10000 found magic len 12, 3c062540:34c6be40:240900aa
ar7part.c: probe 125 at 0x30000 found magic len 12, feedfa42:000dfd39:94600000
ar7part: kernel 30000 at root_offset at 120000
4 ar7part partitions found on MTD device physmap-flash.0
Creating 4 MTD partitions on "physmap-flash.0":
0x000000000000-0x000000020000 : "loader"
mtd: Giving out device 0 to loader
ftl_cs: FTL header corrupt!
0x000000020000-0x000000030000 : "config"
mtd: Giving out device 1 to config
ftl_cs: FTL header corrupt!
0x000000030000-0x000000800000 : "linux"
mtd: Giving out device 2 to linux
ftl_cs: FTL header corrupt!
0x000000120000-0x000000800000 : "rootfs"
mtd: Giving out device 3 to rootfs
ftl_cs: FTL header corrupt!
mtd: partition "rootfs" set to be root filesystem
mtd: partition "rootfs_data" created automatically, ofs=900000, len=FFFFFFFFFFF00000
0x000000900000-0x000000800000 : "rootfs_data"
mtd: partition "rootfs_data" is out of reach -- disabled
mtd: Giving out device 4 to rootfs_data
ftl_cs: FTL header not found.
ar7_wdt: disabling watchdog timer
ar7_wdt: timer margin 59 seconds (prescale 65535, change 48480, freq 52992000)
Registered led device: status
vlynq0: regs 0x08611800, irq 29, mem 0x04000000
TCP westwood registered
NET: Registered protocol family 17
Bridge firewalling registered
802.1Q VLAN Support v1.8 Ben Greear <greearb@…>
All bugs added by David S. Miller <davem@…>
mtdblock_open
ok
VFS: Mounted root (squashfs filesystem) readonly on device 31:3.
Freeing unused kernel memory: 136k freed
Please be patient, while OpenWrt loads ...
MTD_open
mtdblock_open
ok
mtdblock_release
ok
MTDSB: lookup_bdev() returned 0
MTDSB: New superblock for device 4 ("rootfs_data")
mini_fo: using base directory: /
mini_fo: using storage directory: /tmp/root
mtdblock_open
ok
mtdblock_release
ok
device eth0 entered promiscuous mode
br-lan: port 1(eth0) entering forwarding state
PHY: 1:1f - Link is Up - 100/Full
NET: Registered protocol family 8
NET: Registered protocol family 20
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
PPP generic driver version 2.4.2
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <maxk@…>
Installing knfsd (copyright (C) 1996 okir@…).
ip_tables: (C) 2000-2006 Netfilter Core Team
NET: Registered protocol family 24
nf_conntrack version 0.5.0 (256 buckets, 1024 max)
CONFIG_NF_CT_ACCT is deprecated and will be removed soon. Please use
nf_conntrack.acct=1 kernel paramater, acct=1 nf_conntrack module option or
sysctl net.netfilter.nf_conntrack_acct=1 to enable it.
IMQ driver loaded successfully.

Hooking IMQ before NAT on PREROUTING.
Hooking IMQ after NAT on POSTROUTING.

xt_time: kernel timezone is -0000
registered device TI Avalanche SAR
Ohio250(7200/7100A2) detected
requesting firmware image "ar0700xx.bin"

avsar: firmware: requesting ar0700xx.bin

avsar firmware released
tn7dsl_set_modulation : Setting mode to 0x1
Creating new root folder avalanche in the proc for the driver stats
Texas Instruments ATM driver: version:[7.03.01.00]
NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
NFSD: unable to find recovery directory /var/lib/nfs/v4recovery
NFSD: starting 90-second grace period
MTDSB: lookup_bdev() returned 0
MTDSB: New superblock for device 4 ("rootfs_data")
ar7_wdt: enabling watchdog timer
ar7_wdt: timer margin 59 seconds (prescale 65535, change 48480, freq 52992000)

Attachments (11)

boot3.txt (8.6 KB) - added by Michael J Evans <mjevans1983@…> 6 years ago.
Text version of the login/dmesg - much cleaner, sorry about the earlier mess.
m1000-1.jpg (327.7 KB) - added by Michael J Evans <mjevans1983@…> 6 years ago.
m1000-2.jpg (94.5 KB) - added by Michael J Evans <mjevans1983@…> 6 years ago.
Internal overview
m1000-3.jpg (56.2 KB) - added by Michael J Evans <mjevans1983@…> 6 years ago.
Closeup of primary chips
m1000-closed.jpg (78.4 KB) - added by Michael J Evans <mjevans1983@…> 6 years ago.
What it looks like now
patch.jedec_probe.c.patch (1.5 KB) - added by Michael J Evans <mjevans1983@…> 6 years ago.
THIS IS NOT YET TESTED - Add what I /think/ the device info is based on the data-sheet.
patch.cfi_samsung_ar7.patch (1.3 KB) - added by Michael J Evans <mjevans1983@…> 6 years ago.
CFI patch: Promiscuously (optimistically) accept /any/ CFI chip. Also enable debug output.
boot5.txt (19.7 KB) - added by Michael J Evans <mjevans1983@…> 6 years ago.
Boot with the CFI patch applied (and now what looks like a working squashfs+JFFS2 filesystem)
patch.cfi_samsung_ar7-rev2.patch (1.7 KB) - added by Michael J Evans <mjevans1983@…> 6 years ago.
Same idea, but better information in the logs.
patch.cfi_samsung_ar7-rev3_2.6.32.12.patch (1.7 KB) - added by Michael J Evans <mjevans1983@…> 6 years ago.
Don't ignore CFI chips that lack an extended section.
980-CFI-generic-tolerance.patch (3.0 KB) - added by Michael J Evans <mjevans1983@…> 6 years ago.
target/linux/ar7/patches-2.6.32/980-CFI-generic-tolerance.patch

Download all attachments as: .zip

Change History (21)

Changed 6 years ago by Michael J Evans <mjevans1983@…>

Text version of the login/dmesg - much cleaner, sorry about the earlier mess.

Changed 6 years ago by Michael J Evans <mjevans1983@…>

Changed 6 years ago by Michael J Evans <mjevans1983@…>

Internal overview

Changed 6 years ago by Michael J Evans <mjevans1983@…>

Closeup of primary chips

Changed 6 years ago by Michael J Evans <mjevans1983@…>

What it looks like now

Changed 6 years ago by Michael J Evans <mjevans1983@…>

THIS IS NOT YET TESTED - Add what I /think/ the device info is based on the data-sheet.

comment:1 Changed 6 years ago by Michael J Evans <mjevans1983@…>

My patch failed; either it was never seen or I don't have the right data set in the structure.

Changed 6 years ago by Michael J Evans <mjevans1983@…>

CFI patch: Promiscuously (optimistically) accept /any/ CFI chip. Also enable debug output.

Changed 6 years ago by Michael J Evans <mjevans1983@…>

Boot with the CFI patch applied (and now what looks like a working squashfs+JFFS2 filesystem)

comment:2 Changed 6 years ago by Michael J Evans <mjevans1983@…>

It looks like I -may- have a working patch. I'll start following standard usage and configuration procedures and see if it works out.

Changed 6 years ago by Michael J Evans <mjevans1983@…>

Same idea, but better information in the logs.

comment:3 follow-up: Changed 6 years ago by florian

  • Owner changed from developers to florian
  • Status changed from new to assigned

Michael, do you have a patch for this? You mention one but I can only see one which enables debug by default in the CFI code.

comment:4 Changed 6 years ago by Michael Evans <mjevans1983@…>

Actually that's the surprising part; look at the code that attachment patch.cfi_samsung_ar7-rev2.patch DROPS. That's the required part of the patch. The debug statements are just enabled so that end users have some idea of what went wrong if that fails to do the right thing.

Changed 6 years ago by Michael J Evans <mjevans1983@…>

Don't ignore CFI chips that lack an extended section.

comment:5 Changed 6 years ago by Michael J Evans <mjevans1983@…>

The above patch is what code need to be changed at compile time for my device's flash chip to be properly detected. I'm not sure where the patches need to go to get applied automatically though...

This is what gets added (for me) with the patch enabled.

physmap platform flash device: 00800000 at 10000000
Number of erase regions: 2
Primary Vendor Command Set: 0002 (AMD/Fujitsu Standard)
Primary Algorithm Table at 0040
Alternative Vendor Command Set: 0000 (None)
No Alternate Algorithm Table
Vcc Minimum:  2.7 V
Vcc Maximum:  3.6 V
No Vpp line
Typical byte/word write timeout: 16 µs
Maximum byte/word write timeout: 512 µs
Full buffer write not supported
Typical block erase timeout: 1024 ms
Maximum block erase timeout: 16384 ms
Chip erase not supported
Device size: 0x800000 bytes (8 MiB)
Flash Device Interface description: 0x0002
  - supports x8 and x16 via BYTE# with asynchronous interface
Max. bytes in buffer write: 0x1
Number of Erase Block Regions: 2
  Erase Region #0: BlockSize 0x2000 bytes, 8 blocks
  Erase Region #1: BlockSize 0x10000 bytes, 127 blocks
physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
 Amd/Fujitsu Extended Query Table at 0x0040
  WARNING: Unknown Amd/Fujitsu Extended Query vendor:   ec version 0.0. If defaults fail look up the chip.
  Silicon revision: 0
  Address sensitive unlock: Required
  Erase Suspend: Read/write
  Block protection: 1 sectors per group
  Temporary block unprotect: Supported
  Block protect/unprotect scheme: 4
  Number of simultaneous operations: 96
  Burst mode: Not supported
  Page mode: Not supported
  Vpp Supply Minimum Program/Erase Voltage: 8.5 V
  Vpp Supply Maximum Program/Erase Voltage: 12.5 V
  Top/Bottom Boot Block: Bottom boot
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.

Changed 6 years ago by Michael J Evans <mjevans1983@…>

target/linux/ar7/patches-2.6.32/980-CFI-generic-tolerance.patch

comment:6 in reply to: ↑ 3 Changed 6 years ago by Michael J Evans <mjevans1983@…>

Replying to florian:

Michael, do you have a patch for this? You mention one but I can only see one which enables debug by default in the CFI code.

Yes, there is a now a better format of the patch. If there is good documentation on the structure of the development tree and how things are worked I have no idea where it is. I only happened to find what I needed when I thought to search for any .patch files.

comment:7 Changed 6 years ago by Michael J Evans <mjevans1983@…>

As suggested by John in the openwrt-devel list

trunk/target/linux/etrax/patches-2.6.32/200-samsung_flash.patch

also addresses this defect. However it seems to be stuck under the 'etrax' platform. Why isn't this a generic (all platforms) patch? CFI chips are not platform specific.

comment:8 Changed 6 years ago by florian

  • Resolution set to fixed
  • Status changed from accepted to closed

Fixed with r21408, there was no reason why this patch would not have to be generic, just the lack of need I suppose.

comment:9 Changed 6 years ago by maddes

This change causes a patch collision on Orion platform, see #7348

comment:10 Changed 2 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.