I would suggest to first reproduce the kernel that boots. Then you can
add to it selectively. Most likely you will need the following settings:

CONFIG_MTD=y
CONFIG_MTD_BLKDEVS=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_M25P80=y
CONFIG_MTD_SPI_NOR=y
CONFIG_SPI_CADENCE_QUADSPI=y
CONFIG_OF_MTD=y

For the root filesystem, you are correct, this is largely independent of
the kernel. You can copy the existing root filesystem into QSPI, or you
can use buildroot/yocto/others to construct one.

-Ralph

On Sun, Oct 15, 2017 at 07:58:51PM -0400, Janet Estabridis wrote:
> Thanks Ralph,
> Your 2 cents were worth more than 2 cents.  
> I am feeling "less stupid" and will look at the kernel settings again.  I 
> sure thought I had what I needed for flash and MTD blocks.
> 
> For the minimal root filesystem - I should be able to get a root filesystem 
> that works and just update to newer kernels, correct?
> 
> Janet
> 
> 
> ----- Original Message -----
> From: "Ralph Siemsen" <ral...@netwinder.org>
> To: "Janet Estabridis" <jpe1...@mchsi.com>
> Cc: "Charles Manning" <cdhmann...@gmail.com>, "rfi" 
> <rfi@lists.rocketboards.org>
> Sent: Sunday, October 15, 2017 4:38:53 PM
> Subject: Re: [Rfi] QSPI Boot - No filesystem could mount root, tried: jffs2 - 
> FAILURE
> 
> Hi Janet,
> 
> My $0.02 here: the *.dts entries look semi reasonable, you have a flash
> device and two partitions defined therein. The second one is labelled as
> jffs2 which matches with your root=/dev/mtdblock1 on the kernel command
> line. So far, so good.
> 
> Therefore you are likely missing some drivers from the kernel, the flash
> controller and/or the MTD subsystem. I'm not sure offhand why your
> second kernel is failing to boot. I'd suggest comparing the boot
> messages versus the working boot - what is the next line that normally
> would appear? That is where to go looking.
> 
> You could also try to ensure you are using the same kernel version and
> the same configuration. Often you can obtain the kernel config at
> runtime from /proc/config or /proc/config.gz, this makes it easier to
> reproduce the exact same kernel.
> 
> Regarding using Altera tools, versus something like buildroot, or just
> building the kernel manually: these are all viable approaches. Like
> Charles I also use buildroot for all my work, mostly because I find it a
> lot simpler than the Yocto system. However as you indicated that you are
> comfortable doing a direct "make ARCH=..." in the kernel, I would
> suggest you just do that. Buildroot and yocto just add complexity on top
> of that basic step.
> 
> Regarding using jffs2 versus squashfs: both have their uses. But keep in
> mind with a squashfs, the entire contents has to be read in by uboot
> (similar to how it loads the zImage) and placed into RAM. If your
> rootfilesystem is say 100MB in size, you are permanently tying up that
> much of your RAM. Versus an in-flash filesystem such as jffs2 or ubifs
> will only use RAM as you load each individual program into memory.
> A squashfs is also by necessity read-only, while jffs2/ubitfs can be
> mounted read-write. Lastly, all three choices do data compression, so
> you'll be able to fit about the same total amount into your
> /dev/mtdblock1 partition.
> 
> Regards,
> -Ralph
> 
> 
> On Sun, Oct 15, 2017 at 12:55:03PM -0400, Janet Estabridis wrote:
> > Ralph / Charles / Anyone else, 
> > 
> > ***************************************************** 
> > Here is a section of *.dts file with the flash: 
> > 
> > flash0: n25q512a@0 { 
> > compatible = "n25q512a"; /* appended from boardinfo */ 
> > #address-cells = <1>; /* appended from boardinfo */ 
> > #size-cells = <1>; /* appended from boardinfo */ 
> > reg = <0>; /* appended from boardinfo */ 
> > spi-max-frequency = <100000000>; /* appended from boardinfo */ 
> > m25p,fast-read; /* appended from boardinfo */ 
> > page-size = <256>; /* appended from boardinfo */ 
> > block-size = <16>; /* appended from boardinfo */ 
> > tshsl-ns = <50>; /* appended from boardinfo */ 
> > tsd2d-ns = <50>; /* appended from boardinfo */ 
> > tchsh-ns = <4>; /* appended from boardinfo */ 
> > tslch-ns = <4>; /* appended from boardinfo */ 
> > cdns,page-size = <256>; /* appended from boardinfo */ 
> > cdns,block-size = <16>; /* appended from boardinfo */ 
> > cdns,tshsl-ns = <50>; /* appended from boardinfo */ 
> > cdns,tsd2d-ns = <50>; /* appended from boardinfo */ 
> > cdns,tchsh-ns = <4>; /* appended from boardinfo */ 
> > cdns,tslch-ns = <4>; /* appended from boardinfo */ 
> > 
> > part0: partition@0 { 
> > label = "Flash 0 Raw Data"; /* appended from boardinfo */ 
> > reg = <0x00000000 0x00800000>; /* appended from boardinfo */ 
> > }; //end partition@0 (part0) 
> > 
> > part1: partition@800000 { 
> > label = "Flash 1 jffs2 Filesystem"; /* appended from boardinfo */ 
> > reg = <0x00800000 0x03800000>; /* appended from boardinfo */ 
> > }; //end partition@800000 (part1) 
> > }; //end n25q512a@0 (flash0) 
> > 
> > ***************************************************** 
> > 
> > Also, I was not sure what the zImage had in it since it was the one 
> > provided with the 
> > "intelFPGA/17.0/embedded/embeddedsw/spcfpga/prebuilt_images" 
> > so I had a zImage created that I knew had the mtd enabled because I had 
> > used it previously to try and embed when I use that zImage hangs SOONER and 
> > never gets to look for the root filesystem. 
> > 
> > 
> > ************************************************************* 
> > U-Boot 2013.01.01 ( Oct 11 2017 - 16:31:52) 
> > 
> > CPU : Altera SOCFPGA Platform 
> > BOARD : Altera SOCFPGA Cyclone V Board 
> > I2C: ready 
> > DRAM: 1 GiB 
> > MMC: ALTERA DWMMC: 0 
> > SF: Read data capture delay calibrated to 3 (0 - 7) 
> > SF: Detected N25Q512 with page size 65536, total: 67108864 
> > In: serial 
> > Out: serial 
> > Err: serial 
> > Net: mii0 
> > Hit any key to stop autoboot: 0 
> > SF: Detected N25Q512 with page size 65536, total: 67108864 
> > altera_load: Failed with error code -4 
> > ## Starting application at 0x3FF795A4 ... 
> > ## Application terminated, rc = 0x0 
> > SF: Detected N25Q512 with page size 65536, total: 67108864 
> > ## Flattened Device Tree blob at 00000100 
> > Booting using the fdt blob at 0x00000100 
> > Loading Device Tree to 03ff6000, end 03fff4cd ... OK 
> > 
> > Starting kernel ... 
> > 
> > [ 0.000000] Booting Linux on physical CPU 0x0 
> > [ 0.000000] Initializing cgroup subsys cpuset 
> > [ 0.000000] Linux version 4.1.22-ltsi-02999-g9689ce4 
> > (q16@nxp-System-Product-Name) (gcc version 4.8.3 20140401 (prerelease) 
> > (crosstool-NG linaro- 1.13.1-4.8-2014.04 - Linaro GCC 4.8-2014.04) ) #1 SMP 
> > Tue Jun 20 11:16:48 PDT 2017 
> > [ 0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c5387d 
> > [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing 
> > instruction cache 
> > [ 0.000000] Machine model: Altera SOCFPGA Cyclone V 
> > [ 0.000000] Truncating RAM at 0x00000000-0x40000000 to -0x2f800000 
> > [ 0.000000] Memory policy: Data cache writealloc 
> > [ 0.000000] PERCPU: Embedded 12 pages/cpu @ef1da000 s19648 r8192 d21312 
> > u49152 
> > [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total 
> > pages: 193040 
> > [ 0.000000] Kernel command line: console=ttyS0,115200 root=/dev/mtdblock1 
> > rw rootfstype=jffs2 
> > [ 0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes) 
> > [ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 
> > bytes) 
> > [ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes) 
> > [ 0.000000] Memory: 762372K/778240K available (6179K kernel code, 427K 
> > rwdata, 1564K rodata, 428K init, 134K bss, 15868K reserved, 0K 
> > cma-reserved) 
> > [ 0.000000] Virtual kernel memory layout: 
> > [ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB) 
> > [ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB) 
> > [ 0.000000] vmalloc : 0xf0000000 - 0xff000000 ( 240 MB) 
> > [ 0.000000] lowmem : 0xc0000000 - 0xef800000 ( 760 MB) 
> > [ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB) 
> > [ 0.000000] .text : 0xc0008000 - 0xc0798078 (7745 kB) 
> > [ 0.000000] .init : 0xc0799000 - 0xc0804000 ( 428 kB) 
> > [ 0.000000] .data : 0xc0804000 - 0xc086ee38 ( 428 kB) 
> > [ 0.000000] .bss : 0xc086ee38 - 0xc08906ac ( 135 kB) 
> > [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1 
> > [ 0.000000] Hierarchical RCU implementation. 
> > [ 0.000000] Additional per-CPU info printed with stalls. 
> > [ 0.000000] NR_IRQS:16 nr_irqs:16 16 
> > [ 0.000000] L2C: platform modifies aux control register: 0x02060000 -> 
> > 0x32460000 
> > [ 0.000000] L2C: platform provided aux values permit register corruption. 
> > [ 0.000000] L2C: DT/platform modifies aux control register: 0x02060000 -> 
> > 0x32460000 
> > [ 0.000000] L2C-310 erratum 769419 enabled 
> > [ 0.000000] L2C-310 enabling early BRESP for Cortex-A9 
> > [ 0.000000] L2C-310 full line of zeros enabled for Cortex-A9 
> > [ 0.000000] L2C-310 ID prefetch enabled, offset 1 lines 
> > [ 0.000000] L2C-310 dynamic clock gating enabled, standby mode enabled 
> > [ 0.000000] L2C-310 cache controller enabled, 8 ways, 512 kB 
> > [ 0.000000] L2C-310: CACHE_ID 0x410030c9, AUX_CTRL 0x76460001 
> > [ 0.000000] clocksource timer: mask: 0xffffffff max_cycles: 0xffffffff, 
> > max_idle_ns: 19112604467 ns 
> > [ 0.000006] sched_clock: 32 bits at 100MHz, resolution 10ns, wraps every 
> > 21474836475ns 
> > [ 0.000446] Console: colour dummy device 80x30 
> > [ 0.000468] Calibrating delay loop... 1594.16 BogoMIPS (lpj=7970816) 
> > [ 0.090299] pid_max: default: 32768 minimum: 301 
> > [ 0.090402] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes) 
> > [ 0.090415] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 
> > bytes) 
> > [ 0.090986] CPU: Testing write buffer coherency: ok 
> > [ 0.091027] ftrace: allocating 20822 entries in 62 pages 
> > [ 0.122924] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000 
> > [ 0.123176] Setting up static identity map for 0x8280 - 0x82d8 
> > [ 0.160286] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001 
> > [ 0.160356] Brought up 2 CPUs 
> > [ 0.160372] SMP: Total of 2 processors activated (3188.32 BogoMIPS). 
> > [ 0.160379] CPU: All CPU(s) started in SVC mode. 
> > [ 0.160840] devtmpfs: initialized 
> > [ 0.166771] VFP support v0.3: implementor 41 architecture 3 part 30 variant 
> > 9 rev 4 
> > [ 0.167076] clocksource jiffies: mask: 0xffffffff max_cycles: 0xffffffff, 
> > max_idle_ns: 19112604462750000 ns 
> > [ 0.168499] NET: Registered protocol family 16 
> > [ 0.169297] DMA: preallocated 256 KiB pool for atomic coherent allocations 
> > [ 0.177523] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 
> > watchpoint registers. 
> > [ 0.177539] hw-breakpoint: maximum watchpoint size is 4 bytes. 
> > [ 0.213191] vgaarb: loaded 
> > [ 0.213471] SCSI subsystem initialized 
> > [ 0.213808] usbcore: registered new interface driver usbfs 
> > [ 0.213877] usbcore: registered new interface driver hub 
> > [ 0.213942] usbcore: registered new device driver usb 
> > [ 0.214127] sopc@0:usbphy@0 supply vcc not found, using dummy regulator 
> > [ 0.215332] pps_core: LinuxPPS API ver. 1 registered 
> > [ 0.215344] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo 
> > Giometti < giome...@linux.it > 
> > [ 0.215379] PTP clock support registered 
> > [ 0.215572] FPGA manager framework 
> > [ 0.216682] Switched to clocksource timer 
> > [ 0.247290] NET: Registered protocol family 2 
> > [ 0.247903] TCP established hash table entries: 8192 (order: 3, 32768 
> > bytes) 
> > [ 0.247982] TCP bind hash table entries: 8192 (order: 4, 65536 bytes) 
> > [ 0.248104] TCP: Hash tables configured (established 8192 bind 8192) 
> > [ 0.248184] UDP hash table entries: 512 (order: 2, 16384 bytes) 
> > [ 0.248229] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes) 
> > [ 0.248422] NET: Registered protocol family 1 
> > [ 0.248737] RPC: Registered named UNIX socket transport module. 
> > [ 0.248749] RPC: Registered udp transport module. 
> > [ 0.248756] RPC: Registered tcp transport module. 
> > [ 0.248762] RPC: Registered tcp NFSv4.1 backchannel transport module. 
> > [ 0.249337] CPU PMU: Failed to parse /sopc@0/pmu0/interrupt-affinity[0] 
> > [ 0.249377] hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 
> > counters available 
> > [ 0.250323] futex hash table entries: 512 (order: 3, 32768 bytes) 
> > [ 0.261140] NFS: Registering the id_resolver key type 
> > [ 0.261179] Key type id_resolver registered 
> > [ 0.261188] Key type id_legacy registered 
> > [ 0.261247] ntfs: driver 2.1.32 [Flags: R/W]. 
> > [ 0.261603] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc. 
> > [ 0.262566] io scheduler noop registered (default) 
> > [ 0.266856] dma-pl330 ffe01000.dma: Loaded driver for PL330 DMAC-341330 
> > [ 0.266875] dma-pl330 ffe01000.dma: DBUFF-512x8bytes Num_Chans-8 
> > Num_Peri-32 Num_Events-8 
> > [ 0.270828] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled 
> > [ 0.272023] console [ttyS0] disabled 
> > [ 0.272062] ffc02000.serial: ttyS0 at MMIO 0xffc02000 (irq = 27, base_baud 
> > = 6250000) is a 16550A 
> > [ 0.854533] console [ttyS0] enabled 
> > [ 0.859650] brd: module loaded 
> > [ 0.862782] at24 0-0051: 4096 byte 24c32 EEPROM, writable, 32 bytes/write 
> > [ 0.870364] cadence-qspi ff705000.flash: couldn't determine chip select 
> > [ 0.878126] CAN device driver interface 
> > [ 0.882589] stmmaceth ff702000.ethernet: snps,phy-addr property is 
> > deprecated 
> > [ 0.889885] stmmac - user ID: 0x10, Synopsys ID: 0x37 
> > [ 0.894916] Ring mode enabled 
> > [ 0.897969] DMA HW capability register supported 
> > [ 0.902479] Enhanced/Alternate descriptors 
> > [ 0.906835] Enabled extended descriptors 
> > [ 0.910828] RX Checksum Offload Engine supported (type 2) 
> > [ 0.916286] TX Checksum insertion supported 
> > [ 0.920544] Enable RX Mitigation via HW Watchdog Timer 
> > [ 0.931858] libphy: stmmac: probed 
> > [ 0.935255] eth0: PHY ID 00221611 at 4 IRQ POLL (stmmac-0:04) active 
> > [ 0.942015] ffb40000.usb supply vusb_d not found, using dummy regulator 
> > [ 0.948673] ffb40000.usb supply vusb_a not found, using dummy regulator 
> > [ 0.986664] dwc2 ffb40000.usb: EPs: 16, dedicated fifos, 8064 entries in 
> > SPRAM 
> > [ 1.846747] dwc2 ffb40000.usb: DWC OTG Controller 
> > [ 1.851461] dwc2 ffb40000.usb: new USB bus registered, assigned bus number 
> > 1 
> > [ 1.858521] dwc2 ffb40000.usb: irq 39, io mem 0x00000000 
> > [ 1.864053] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002 
> > [ 1.870831] usb usb1: New USB device strings: Mfr=3, Product=2, 
> > SerialNumber=1 
> > [ 1.878033] usb usb1: Product: DWC OTG Controller 
> > [ 1.882719] usb usb1: Manufacturer: Linux 4.1.22-ltsi-02999-g9689ce4 
> > dwc2_hsotg 
> > [ 1.890005] usb usb1: SerialNumber: ffb40000.usb 
> > [ 1.895192] hub 1-0:1.0: USB hub found 
> > [ 1.898977] hub 1-0:1.0: 1 port detected 
> > [ 1.903420] usbcore: registered new interface driver usb-storage 
> > [ 1.909764] mousedev: PS/2 mouse device common for all mice 
> > [ 1.921084] rtc-ds1307 0-0068: rtc core: registered ds1339 as rtc0 
> > [ 1.927335] i2c /dev entries driver 
> > [ 1.931578] watchdog: Invalid min and max timeout values, resetting to 0! 
> > [ 1.938801] Synopsys Designware Multimedia Card Interface Driver 
> > [ 1.945043] dw_mmc ff704000.flash: IDMAC supports 32-bit address mode. 
> > [ 1.951599] dw_mmc ff704000.flash: Using internal DMA controller. 
> > [ 1.957688] dw_mmc ff704000.flash: Version ID is 240a 
> > [ 1.962760] dw_mmc ff704000.flash: DW MMC controller at irq 38, 32 bit host 
> > data width, 1024 deep fifo 
> > [ 1.972198] dw_mmc ff704000.flash: Got CD GPIO 
> > [ 2.016692] dw_mmc ff704000.flash: 1 slots initialized 
> > 
> > ******************************************************************* 
> > 
> > Charles - I have never heard of squashfs but am not opposed to trying 
> > anything. What are the advantages and do you think changing to squashfs 
> > will work with all the Altera tools. 
> > 
> > THANKS. 
> > 
> > ----- Original Message -----
> > 
> > From: "Charles Manning" <cdhmann...@gmail.com> 
> > To: "Ralph Siemsen" <ral...@netwinder.org> 
> > Cc: "Janet Estabridis" <jpe1...@mchsi.com>, "rfi" 
> > <rfi@lists.rocketboards.org> 
> > Sent: Saturday, October 14, 2017 5:30:29 PM 
> > Subject: Re: [Rfi] QSPI Boot - No filesystem could mount root, tried: jffs2 
> > - FAILURE 
> > 
> > If you are booting from QSPI have you considered rather using squashfs for 
> > rootfs? 
> > 
> > That's what I tend to use for QSPI-based products. 
> > 
> > 
> > On Sat, Oct 14, 2017 at 2:01 PM, Ralph Siemsen < ral...@netwinder.org > 
> > wrote: 
> > 
> > 
> > On Fri, Oct 13, 2017 at 07:58:48PM -0400, Janet Estabridis wrote: 
> > > Thanks in advance. 
> > > 
> > > I'm working on embedding to the QSPI on the Sodia Cyclone V Eval board. 
> > > 
> > > Starting kernel ... 
> > > 
> > > [ 0.000000] Kernel command line: console=ttyS0,115200 root=/dev/mtdblock1 
> > > rw rootfstype=jffs2 
> > 
> > This looks reasonable, and is telling the kernel to boot from the 2nd 
> > partition in your QSPI. And it is specifying the filesystem type 
> > which is also required for JFFS2, as it cannot be auto-detected. 
> > 
> > However looking through the remaining kernel boot messages, I do not see 
> > any indication of the kernel having detected the QSPI device. And 
> > therefore it also does not know about partitions on this device. 
> > 
> > This could be caused either by missing some kernel configuration 
> > settings (eg. QSPI driver, MTD subsystem, etc) or by missing entries in 
> > the device tree (DTS) files. 
> > 
> > The offset in the QSPI is specified in the partition table, which 
> > usually goes into the device tree. 
> > 
> > Regards, 
> > -Ralph 
> > _______________________________________________ 
> > Rfi mailing list 
> > Rfi@lists.rocketboards.org 
> > http://lists.rocketboards.org/cgi-bin/mailman/listinfo/rfi 
> > 
> > 
> > 
> > 
> > 
_______________________________________________
Rfi mailing list
Rfi@lists.rocketboards.org
http://lists.rocketboards.org/cgi-bin/mailman/listinfo/rfi

Reply via email to