This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

66AK2H14: Issue to use 2 NOR flashes with chip select

Part Number: 66AK2H14
Other Parts Discussed in Thread: TEST2, DA8XX

Hi,

We are currently developping our custom board using a 66AK2H14 SoC.

I am working on embedded linux and I am trying to use the 2 flashes available on SPI bus 0. The 2 flashes must be used using the chip select 0 and 1.

Basically, all my boot components (kernel, fs...) are located on flash with cs0. I added on my device tree source new partitions located on the second flash with cs1 as following:

    nor_flash2: mt25qu02g@1 {
        #address-cells = <1>;
        #size-cells = <1>;
        compatible = "Micron,mt25qu02g2", "jedec,spi-nor";
        spi-max-frequency = <1000000>;
        reg = <1>;

        partition@0 {
            label = "test1";
            reg = <0x0 0x2600000>;
        };

        partition@1 {
            label = "test2";
            reg = <0x2600000 0xDA00000>;
        };
    };

I detect the second flash during Linux boot phase:

[    1.462955] m25p80 spi0.1: JEDEC id bytes: 20, bb, 22                                                                                                                                 
[    1.469025] random: fast init done                                                                                                                                                    
[    1.472819] m25p80 spi0.1: mt25qu02g (262144 Kbytes)                                                                                                                                  
[    1.477832] 2 ofpart partitions found on MTD device spi0.1                                                                                                                            
[    1.483335] Creating 2 MTD partitions on "spi0.1":                                                                                                                                    
[    1.488159] 0x000000000000-0x000002600000 : "test1"                                                                                                                                    
[    1.493467] 0x000002600000-0x000010000000 : "test2" 

However, I must to put the second flash spi frequency  lower to get this result. My spi max frequency on flash0 is 54 000 000.

We can assume our custom hardware design force the second flash to work with lower spi frequency.

Doing this, Linux can read the ID of the flash and detect it well.

My problem now is to mount the partitions of second flash.

Indeed, I have no problem to mount partition of the first flash. However, when I try to mount partition on this flash, i got this:

command: mount -t jffs2 /dev/mtdblock16 /tmp/test

result:

mount: mounting /dev/mtdblock16 on /tmp/test/ failed: Input/output error

 

If I look in /var/log/messages, i can see many messages as following:

Jan  1 00:09:57 EVM_KEPLER kern.notice kernel: [  597.603443] jffs2: Further such events for this erase block will not be printed
Jan  1 00:09:58 EVM_KEPLER kern.notice kernel: [  598.317269] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x024b0004: 0x4001 instead
Jan  1 00:09:58 EVM_KEPLER kern.notice kernel: [  598.317275] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x024b002c: 0x2000 instead
Jan  1 00:09:58 EVM_KEPLER kern.notice kernel: [  598.317280] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x024b0030: 0x3500 instead
Jan  1 00:09:58 EVM_KEPLER kern.notice kernel: [  598.317286] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x024b003c: 0x4001 instead
Jan  1 00:09:58 EVM_KEPLER kern.notice kernel: [  598.317290] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x024b0064: 0x2000 instead
Jan  1 00:09:58 EVM_KEPLER kern.notice kernel: [  598.317295] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x024b0068: 0x3500 instead
Jan  1 00:09:58 EVM_KEPLER kern.notice kernel: [  598.317299] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x024b0074: 0x4001 instead
Jan  1 00:09:58 EVM_KEPLER kern.notice kernel: [  598.317304] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x024b009c: 0x2000 instead
Jan  1 00:09:58 EVM_KEPLER kern.notice kernel: [  598.317308] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x024b00a0: 0x3500 instead
Jan  1 00:09:58 EVM_KEPLER kern.notice kernel: [  598.317312] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x024b00ac: 0x4001 instead

I did a flash_erase of the partition with the valid options before mount it, but it doesn't change anything.

Do you have any idea what happens? Is there anything to add more in device tree sources?

Thank you in advance for your help.

Best regards.

K.Luong

 

 

  • Hi,

    However, I must to put the second flash spi frequency  lower to get this result. My spi max frequency on flash0 is 54 000 000.

    We can assume our custom hardware design force the second flash to work with lower spi frequency.

    Did you add the m25p,fast-read; property in your dts node, when you used higher frequency?

    As for the nor flash error, the EIO error "Input/output error" usually points that the filesystem is damaged or you are running on a faulty storage. But it is hard to tell the root cause from the log you've shared.

    Can you try running dmesg -E, dmesg -n debug to see if you will get some more info on the error? Can you share the full bootlog & dts files of your board?
    Also please share which Processor SDK Linux version are you using?

    Best Regards,

    Yordan

  • s when I use 54 MHz frequency.

    My SDK Linux version is: ti-processor-sdk-linux-k2hk-evm-05.00.00.15-Linux

    My bootlogs are:

    Starting kernel ...

    [    0.000000] Booting Linux on physical CPU 0x0
    [    0.000000] Linux version 4.14.40-g4796173fc5 (t0193143@w560526) (gcc version 7.2.1 20171011 (Linaro GCC 7.2-2017.11)) #15 SMP PREEMPT Wed Nov 20 10:05:55 CET 2019
    [    0.000000] CPU: ARMv7 Processor [412fc0f4] revision 4 (ARMv7), cr=30c5387d
    [    0.000000] CPU: div instructions available: patching division code
    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
    [    0.000000] OF: fdt: Machine model: Texas Instruments Keystone 2 Kepler/Hawking EVM
    [    0.000000] Memory policy: Data cache writealloc
    [    0.000000] Switching physical address space to 0x820000000
    [    0.000000] efi: Getting EFI parameters from FDT:
    [    0.000000] efi: UEFI not found.
    [    0.000000] OF: reserved mem: OVERLAP DETECTED!
    [    0.000000] cmem_block_mem@860000000 (0x0000000860000000--0x0000000878000000) overlaps with dsp-common-mpm-memory@870000000 (0x0000000870000000--0x0000000880000000)
    [    0.000000] Reserved memory: created CMA memory pool at 0x000000083f800000, size 8 MiB
    [    0.000000] OF: reserved mem: initialized node dsp-common-memory@83f800000, compatible id shared-dma-pool
    [    0.000000] cma: Reserved 24 MiB at 0x000000083e000000
    [    0.000000] psci: probing for conduit method from DT.
    [    0.000000] psci: Using PSCI v0.1 Function IDs from DT
    [    0.000000] percpu: Embedded 15 pages/cpu @ddb0e000 s31308 r8192 d21940 u61440
    [    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 129920
    [    0.000000] Kernel command line: console=ttyS0,115200n8 rootwait=1 printk.time=y root=/dev/mtdblock10 rw rootfstype=squashfs
    [    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
    [    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
    [    0.000000] Memory: 471132K/524288K available (8192K kernel code, 244K rwdata, 2244K rodata, 2048K init, 291K bss, 20388K reserved, 32768K cma-reserved, 0K highmem)
    [    0.000000] Virtual kernel memory layout:
    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    [    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    [    0.000000]     vmalloc : 0xe0800000 - 0xff800000   ( 496 MB)
    [    0.000000]     lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
    [    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    [    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
    [    0.000000]       .text : 0xc0008000 - 0xc0a00000   (10208 kB)
    [    0.000000]       .init : 0xc0e00000 - 0xc1000000   (2048 kB)
    [    0.000000]       .data : 0xc1000000 - 0xc103d240   ( 245 kB)
    [    0.000000]        .bss : 0xc103f000 - 0xc1087ecc   ( 292 kB)
    [    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
    [    0.000000] Preemptible hierarchical RCU implementation.
    [    0.000000]  RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
    [    0.000000]  Tasks RCU enabled.
    [    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
    [    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
    [    0.000000] GIC: Using split EOI/Deactivate mode
    [    0.000000] arch_timer: cp15 timer(s) running at 200.00MHz (phys).
    [    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x2e2049d3e8, max_idle_ns: 440795210634 ns
    [    0.000003] sched_clock: 56 bits at 200MHz, resolution 5ns, wraps every 4398046511102ns
    [    0.000012] Switching to timer-based delay loop, resolution 5ns
    [    0.000178] keystone timer clock @200000000 Hz
    [    0.000356] Console: colour dummy device 80x30
    [    0.000382] Calibrating delay loop (skipped), value calculated using timer frequency.. 400.00 BogoMIPS (lpj=2000000)
    [    0.000394] pid_max: default: 32768 minimum: 301
    [    0.000475] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
    [    0.000485] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
    [    0.000942] CPU: Testing write buffer coherency: ok
    [    0.001168] /cpus/cpu@0 missing clock-frequency property
    [    0.001191] /cpus/cpu@1 missing clock-frequency property
    [    0.001214] /cpus/cpu@2 missing clock-frequency property
    [    0.001237] /cpus/cpu@3 missing clock-frequency property
    [    0.001245] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
    [    0.039999] Setting up static identity map for 0xa0200000 - 0xa0200138
    [    0.059998] Hierarchical SRCU implementation.
    [    0.080140] EFI services will not be available.
    [    0.100039] smp: Bringing up secondary CPUs ...
    [    0.174615] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
    [    0.244704] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
    [    0.314783] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
    [    0.314916] smp: Brought up 1 node, 4 CPUs
    [    0.314934] SMP: Total of 4 processors activated (1600.00 BogoMIPS).
    [    0.314940] CPU: All CPU(s) started in HYP mode.
    [    0.314947] CPU: Virtualization extensions available.
    [    0.315389] devtmpfs: initialized
    [    0.320584] random: get_random_u32 called from bucket_table_alloc+0x104/0x22c with crng_init=0
    [    0.320753] VFP support v0.3: implementor 41 architecture 4 part 30 variant f rev 0
    [    0.320906] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
    [    0.320919] futex hash table entries: 1024 (order: 4, 65536 bytes)
    [    0.321521] pinctrl core: initialized pinctrl subsystem
    [    0.321832] DMI not present or invalid.
    [    0.322022] NET: Registered protocol family 16
    [    0.335358] DMA: preallocated 256 KiB pool for atomic coherent allocations
    [    0.335909] cpuidle: using governor ladder
    [    0.335936] cpuidle: using governor menu
    [    0.336015] No ATAGs?
    [    0.336102] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
    [    0.336111] hw-breakpoint: maximum watchpoint size is 8 bytes.
    [    0.340430] sram c000000.msmram: block at 0x100000 starts after current offset 0x5f0000
    [    0.340468] sram: probe of c000000.msmram failed with error -22
    [    0.354340] pps_core: LinuxPPS API ver. 1 registered
    [    0.354347] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
    [    0.354362] PTP clock support registered
    [    0.354385] EDAC MC: Ver: 3.0.0
    [    0.354519] dmi: Firmware registration failed.
    [    0.355192] clocksource: Switched to clocksource arch_sys_counter
    [    0.360347] NET: Registered protocol family 2
    [    0.360691] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
    [    0.360720] TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
    [    0.360768] TCP: Hash tables configured (established 4096 bind 4096)
    [    0.360822] UDP hash table entries: 256 (order: 1, 8192 bytes)
    [    0.360839] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
    [    0.360929] NET: Registered protocol family 1
    [    0.361140] RPC: Registered named UNIX socket transport module.
    [    0.361147] RPC: Registered udp transport module.
    [    0.361153] RPC: Registered tcp transport module.
    [    0.361158] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [    0.361454] hw perfevents: no interrupt-affinity property for /pmu, guessing.
    [    0.361661] hw perfevents: enabled with armv7_cortex_a15 PMU driver, 7 counters available
    [    0.362114] platform alarmtimer: set dma_pfn_offset00780000
    [    0.362626] workingset: timestamp_bits=14 max_order=17 bucket_order=3
    [    0.365735] squashfs: version 4.0 (2009/01/31) Phillip Lougher
    [    0.366116] NFS: Registering the id_resolver key type
    [    0.366134] Key type id_resolver registered
    [    0.366140] Key type id_legacy registered
    [    0.366170] ntfs: driver 2.1.32 [Flags: R/O].
    [    0.366283] jffs2: version 2.2. (NAND) (SUMMARY)  �© 2001-2006 Red Hat, Inc.
    [    0.367430] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 246)
    [    0.367438] io scheduler noop registered
    [    0.367445] io scheduler deadline registered
    [    0.367559] io scheduler cfq registered (default)
    [    0.367566] io scheduler mq-deadline registered
    [    0.367573] io scheduler kyber registered
    [    0.367794] keystone_irq soc:keystone_irq@26202a0: irqchip registered, nr_irqs 28
    [    0.368310] ti,keystone-serdes 232a000.phy: Direct firmware load for ks2_gbe_serdes.bin failed with error -2
    [    0.368321] ti,keystone-serdes 232a000.phy: can't get any serdes init fw
    [    0.368329] ti,keystone-serdes 232a000.phy: serdes procider init failed -19
    [    0.372130] registered dspmem misc device
    [    0.372239] keystone-navigator-qmss soc:qmss@2a40000: qmgr start queue 0, number of queues 8192
    [    0.372360] keystone-navigator-qmss soc:qmss@2a40000: added qmgr start queue 0, num of queues 8192, reg_peek e0fa0000, reg_status e097b000, reg_config e097d000, reg_region e0f81000, reg_push e0fe0000, re0
    [    0.372371] keystone-navigator-qmss soc:qmss@2a40000: qmgr start queue 8192, number of queues 8192
    [    0.372472] keystone-navigator-qmss soc:qmss@2a40000: added qmgr start queue 8192, num of queues 8192, reg_peek e1060000, reg_status e0f83400, reg_config e0f85000, reg_region e0f87000, reg_push e10a0000,0
    [    0.372589] keystone-navigator-qmss soc:qmss@2a40000: failed to get firmware for pdsp
    [    0.373910] keystone-navigator-qmss soc:qmss@2a40000: pdsp id 0 not started for range acc-low-0
    [    0.374613] keystone-navigator-dma soc:knav_dmas@0: DMA dma_gbe registered 41 logical channels, flows 32, tx chans: 9, rx chans: 24
    [    0.406340] Serial: 8250/16550 driver, 10 ports, IRQ sharing disabled
    [    0.406391] platform serial8250: set dma_pfn_offset00780000
    [    0.408155] console [ttyS0] disabled
    [    0.408202] 2530c00.serial: ttyS0 at MMIO 0x2530c00 (irq = 26, base_baud = 12500000) is a TI DA8xx/66AK2x
    [    1.264642] console [ttyS0] enabled
    [    1.268713] 2531000.serial: ttyS1 at MMIO 0x2531000 (irq = 27, base_baud = 12500000) is a TI DA8xx/66AK2x
    [    1.297381] brd: module loaded
    [    1.305793] loop: module loaded
    [    1.338156] spi_davinci 21000400.spi: DMA is not supported (-19)
    [    1.344670] m25p80 spi0.0: JEDEC id bytes: 20, bb, 22
    [    1.350130] m25p80 spi0.0: mt25qu02g (262144 Kbytes)
    [    1.355213] 16 ofpart partitions found on MTD device spi0.0
    [    1.360803] Creating 16 MTD partitions on "spi0.0":
    [    1.365714  "part0"
    [    1.371656]  "part1"
    [    1.377493]  "part2"
    [    1.383737]  "part3"
    [    1.389492]  "part4"
    [    1.395415]  "part5"
    [    1.401227]  "part6"
    [    1.407048]  "part7"
    [    1.412525]  "part8"
    [    1.418453]  "part9"
    [    1.423821]  "part10"
    [    1.429303]  "part11"
    [    1.435102]  "part12"
    [    1.440758]  "part13"
    [    1.446414]  "part14"
    [    1.451984]  "part15"
    [    1.457972] m25p80 spi0.1: JEDEC id bytes: 20, bb, 22
    [    1.463109] m25p80 spi0.1: JEDEC id bytes: 20, bb, 22
    [    1.468560] random: fast init done
    [    1.472153] m25p80 spi0.1: mt25qu02g (262144 Kbytes)
    [    1.477165] 2 ofpart partitions found on MTD device spi0.1
    [    1.482668] Creating 2 MTD partitions on "spi0.1":
    [    1.487492] 0x000000000000-0x000001200000 : "part16"
    [    1.492798] 0x000001200000-0x000010000000 : "part17"
    [    1.498037] spi_davinci 21000400.spi: Controller at 0xe0fdd400
    [    1.504232] platform Fixed MDIO bus.0: set dma_pfn_offset00780000
    [    1.510494] libphy: Fixed MDIO Bus: probed
    [    1.575213] davinci_mdio 2090300.mdio: davinci mdio revision 1.5, bus freq 2500000
    [    1.582810] libphy: 2090300.mdio: probed
    [    1.588167] davinci_mdio 2090300.mdio: phy[2]: device 2090300.mdio:02, driver unknown
    [    1.596041] davinci_mdio 2090300.mdio: phy[3]: device 2090300.mdio:03, driver unknown
    [    2.105195] ti,keystone-serdes 232a000.phy: init_lane_rx wait sd valid FAILED -110
    [    2.112802] netcp-1.0 2620110.netcp: initialized cpsw ale version 1.3
    [    2.119277] netcp-1.0 2620110.netcp: ALE Table size 1024
    [    2.124627] netcp-1.0 2620110.netcp: cpts: overflow check period 350 (jiffies)
    [    2.131890] netcp-1.0 2620110.netcp: CPTS: ref_clk_freq:600000000 calc_mult:3579139413 calc_shift:31 error:-1 nsec/sec
    [    2.143290] netcp-1.0 2620110.netcp: module(netcp-xgbe) not used for device
    [    2.150675] i2c /dev entries driver
    [    2.157721] keystone-rproc 10800000.dsp: assigned reserved memory node dsp-common-memory@83f800000
    [    2.166782] remoteproc remoteproc0: 10800000.dsp is available
    [    2.174218] keystone-rproc 11800000.dsp: assigned reserved memory node dsp-common-memory@83f800000
    [    2.183266] remoteproc remoteproc1: 11800000.dsp is available
    [    2.190723] keystone-rproc 12800000.dsp: assigned reserved memory node dsp-common-memory@83f800000
    [    2.199772] remoteproc remoteproc2: 12800000.dsp is available
    [    2.207232] keystone-rproc 13800000.dsp: assigned reserved memory node dsp-common-memory@83f800000
    [    2.216285] remoteproc remoteproc3: 13800000.dsp is available
    [    2.223712] keystone-rproc 14800000.dsp: assigned reserved memory node dsp-common-memory@83f800000
    [    2.232765] remoteproc remoteproc4: 14800000.dsp is available
    [    2.240198] keystone-rproc 15800000.dsp: assigned reserved memory node dsp-common-memory@83f800000
    [    2.249247] remoteproc remoteproc5: 15800000.dsp is available
    [    2.256700] keystone-rproc 16800000.dsp: assigned reserved memory node dsp-common-memory@83f800000
    [    2.265753] remoteproc remoteproc6: 16800000.dsp is available
    [    2.273200] keystone-rproc 17800000.dsp: assigned reserved memory node dsp-common-memory@83f800000
    [    2.282247] remoteproc remoteproc7: 17800000.dsp is available
    [    2.289450] uio_module_drv soc:mpax: registered misc device mpax
    [    2.295647] uio_module_drv soc:edma3: registered misc device edma3
    [    2.301998] uio_module_drv soc:secmgr: registered misc device secmgr
    [    2.308535] uio_module_drv soc:qmss: registered misc device qmss
    [    2.319498] uio_module_drv soc:hyperlink0: registered misc device hyperlink0
    [    2.326878] uio_module_drv soc:hyperlink1: registered misc device hyperlink1
    [    2.334245] uio_module_drv soc:srio: registered misc device srio
    [    2.340366] CMEMK module: reference Linux version 4.14.40
    [    2.346036] allocated heap buffer 0xc100000 of size 0x4e0000
    [    2.351724] cmemk initialized
    [    2.355133] NET: Registered protocol family 10
    [    2.360356] Segment Routing with IPv6
    [    2.364068] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
    [    2.370360] NET: Registered protocol family 17
    [    2.374936] Key type dns_resolver registered
    [    2.379271] NET: Registered protocol family 44
    [    2.383807] Registering SWP/SWPB emulation handler
    [    2.392373] hctosys: unable to open rtc device (rtc0)
    [    2.460087] VFS: Mounted root (squashfs filesystem) readonly on device 31:10.
    [    2.478150] devtmpfs: mounted
    [    2.482198] Freeing unused kernel memory: 2048K
    [    2.491667] random: crng init done

    Starting system...

     Mounting /proc : done.
     Mounting /sys  : done.
     Mounting /dev  : done.
     Mounting /dev/pts      : done.
    Starting mdev
     Enabling hot-plug      : [SUCCESS]
     Populating /dev        : [SUCCESS]
    Mounting /tmp: done.
    Mounting /var: Filesystem label=
    OS type: Linux
    Block size=1024 (log=0)
    Fragment size=1024 (log=0)
    1024 inodes, 4096 blocks
    204 blocks (5%) reserved for t[    6.255400] EXT4-fs (ram0): couldn't mount as ext3 due to feature incompatibilities
    he super user
    F[    6.263272] EXT4-fs (ram0): mounting ext2 file system using the ext4 subsystem
    irst data block=[    6.272384] EXT4-fs (ram0): mounted filesystem without journal. Opts: (null)
    1
    Maximum filesystem blocks=262144
    1 block groups
    8192 blocks per group, 8192 fragments per group
    1024 inodes per group
    done.
    Mounting other filesystems: done.
    parameter size expected  196
    wrong or no parameters : begin ffffffff @ 0x9c8d0000 , end ffffffff @ 0x9c8d00c0  , using default
    Setting default hostname EVM_KEPLER: done.
    net.ipv4.ip_local_port_range = 32768 49151
    Bringing up loopback interface: done.
    Starting syslogd: done.
    Starting klogd: done.
    Starting inetd: done.
    starting host processes ...
    Starting DHCP: done.
    Mounting MTD 14 to /mnt/pm
    Mounting MTD 15 to /mnt/pm2
    Starting MPM daemon
    done.

    Please press Enter to activate this console.

    I can't get more info with dmesg.

    My dts file part for flash is:

    &spi0 {
        status = "okay";
        nor_flash: mt25qu02g@0 {
            #address-cells = <1>;
            #size-cells = <1>;
            compatible = "Micron,mt25qu02g", "spi-flash";
            spi-max-frequency = <54000000>;
            m25p,fast-read;
            reg = <0>;
            
            partition@0 {
                label = "part0";
                reg = <0x0 0x70000>;
            };

            partition@1 {
                label = "part1";
                reg = <0x70000 0xB00000>;
            };

            partition@2 {
                label = "part2";
                reg = <0xB70000 0x10000>;
            };

            partition@3 {
                label = "part3";
                reg = <0xB80000 0x10000>;
            };

            partition@4 {
                label = "part4";
                reg = <0xB90000 0x1000000>;
            };

            partition@5 {
                label = "part5";
                reg = <0x1B90000 0x100000>;
            };

            partition@6 {
                label = "part6";
                reg = <0x1C90000 0x10000>;
            };

            partition@7 {
                label = "part7";
                reg = <0x1CA0000 0x100000>;
            };

            partition@8 {
                label = "part8";
                reg = <0x1DA0000 0x10000>;
            };

            partition@9 {
                label = "part9";
                reg = <0x1DB0000 0x10000>;
            };

            partition@10 {
                label = "part10";
                reg = <0x1DC0000 0x100000>;
            };

            partition@11 {
                label = "part11";
                reg = <0x1EC0000 0x10000>;
            };

            partition@12 {
                label = "part12";
                reg = <0x1ED0000 0x100000>;
            };

            partition@13 {
                label = "part13";
                reg = <0x1FD0000 0x100000>;
            };

            partition@14 {
                label = "part14";
                reg = <0x20D0000 0x4000000>;
            };

            partition@15 {
                label = "part15";
                reg = <0x60D0000 0x4500000>;
            };
        };

        nor_flash2: mt25qu02g@1 {
            #address-cells = <1>;
            #size-cells = <1>;
            compatible = "Micron,mt25qu02g2", "spi-flash";
            spi-max-frequency = <10000000>;
            reg = <1>;

            partition@0 {
                label = "part16";
                reg = <0x0 0x1200000>;
            };

            partition@1 {
                label = "part17";
                reg = <0x1200000 0xC000000>;
            };
        };
    };

    The read operations are done properly on both flashes. The problem is still to write on second flash.

    We did some analyze with an oscilloscope. We saw our writing commands on input of the second flash. However, when we read it after, we can see that nothing has been written.

    We compared same operations on both flashes. The only difference we saw is that on first flash, when doing probing the flash, we have the command of "write enable" and "4 Byte address enable" that are sent with S# driven high between each command and going driven low just before the commands are done. However, on flash 1, the chip select  S# is kept to 0 between the commands during spi probe. We don't really understand why it is acting differently since it is the same driver.

    Looking on the flash datasheet, there is the following description for Write/disable operations :

    "To initiate a command, S# is driven LOW and held LOW until the eighth bit of the command
    code has been latched in, after which it must be driven HIGH. For extended, dual,
    and quad SPI protocols respectively, the command code is input on DQ0, DQ[1:0], and
    DQ[3:0]. If S# is not driven HIGH after the command code has been latched in, the command
    is not executed, flag status register error bits are not set, and the write enable
    latch remains cleared to its default setting of 0, providing protection against errant data
    modification."

    It looks like our command is not executed. However, same driver is used... so why is it different between the 2 flashes

    Best regards,

    K.Luong

  • Hi,

    We compared same operations on both flashes. The only difference we saw is that on first flash, when doing probing the flash, we have the command of "write enable" and "4 Byte address enable" that are sent with S# driven high between each command and going driven low just before the commands are done. However, on flash 1, the chip select  S# is kept to 0 between the commands during spi probe. We don't really understand why it is acting differently since it is the same driver.

    Can you please share what you get on the scope? Also is it possible to share the parts of the schematic with SPI connection to the NOR flash chips?

    From linux perspective it seems everything is fine. Both flash devices are detected, partitions are detected as described in the dts and so on.

    Best Regards,
    Yordan

  • Hi,


    Thanks for your answer. We found that there is something on our hardware that caused some problems. To fix that, we changed the phase and polarity and we were then able to get the flash writing from DSP side working.

    Now, we will do the modifications on hardware to be able to use the flash without changing the phase and polarity and then, we will test it on ARM u-boot/Linux.


    Best Regards,


    K.Luong