Yocto with Jethro 2.0 and meta-altera

1

All, I am working on modifying the Yocto Jethro 2.0 branch with meta-altera layer for a custom Cyclone V SOC board, but having trouble to understand how to modify the devicetree and set the filesystem location. I believe the dts is located at ./tmp/work-shared/cyclone5/kernel-source/arch/arm/boot/dts/socfpga_cyclone5_sockit.dts

But, my changes to the dts have little impact to the boot result. Below is the modified dts and console printout. Another interesting fact about the bootargs baudrate 57600 on the console print out even thou I updated it to 115200 to match my putty setting. Have anyone experience this issue before? Any help is greatly appreciated.

#include "socfpga_cyclone5.dtsi"

{
model = "Custom Project test1";
compatible = "altr,socfpga-cyclone5", "altr,socfpga";

chosen {
    bootargs = "console=ttyS0,115200 root=/dev/mtdblock1 rw rootfstype=jffs2";
};

memory {
    name = "memory";
    device_type = "memory";
    reg = <0x0 0x40000000>; /* 1GB */
};

aliases {
    /* this allow the ethaddr uboot environmnet variable contents
     * to be added to the gmac1 device tree blob.
     */
    ethernet0 = &gmac1;
};

regulator_3_3v: vcc3p3-regulator {
    compatible = "regulator-fixed";
    regulator-name = "VCC3P3";
    regulator-min-microvolt = <3300000>;
    regulator-max-microvolt = <3300000>;
};

&gmac1 {
status = "okay";
phy-mode = "rgmii";
rxd0-skew-ps = <0>;
rxd1-skew-ps = <0>;
rxd2-skew-ps = <0>;
rxd3-skew-ps = <0>;
txen-skew-ps = <0>;
txc-skew-ps = <2600>;
rxdv-skew-ps = <0>;
rxc-skew-ps = <2000>;
 };

&gpio2 {
status = "okay";
};

&i2c1 {
status = "okay";
accel1: accelerometer@53 {
    compatible = "adi,adxl345";
    reg = <0x53>;

    interrupt-parent = <&portc>;
    interrupts = <3 2>;
};
};

&mmc0 {
vmmc-supply = <&regulator_3_3v>;
vqmmc-supply = <&regulator_3_3v>;
};

&usb1 {
status = "okay";
};

&qspi {
flash0: n25q00@0 {
    #address-cells = < 1 >; /* appended from boardinfo */
    #size-cells = < 1 >;    /* appended from boardinfo */
    compatible = "n25q00";  /* appended from boardinfo */
    reg = < 0 >;    /* appended from boardinfo */
    spi-max-frequency = < 100000000 >;  /* appended from boardinfo */

    cdns,page-size = <256>;
    cdns,block-size = <16>;
    cdns,read-delay = <4>;
    cdns,tshsl-ns = <50>;
    cdns,tsd2d-ns = <50>;
    cdns,tchsh-ns = <4>;
    cdns,tslch-ns = <4>;

    partition@qspi-boot {
        label = "Flash 0 Raw Data"; /* appended from boardinfo */
        reg = < 0x00000000 0x00800000 >;    /* appended from boardinfo */
    }; //end partition@0 (part0)

    partition@qspi-rootfs {
        label = "Flash 1 jffs2 Filesystem"; /* appended from boardinfo */
        reg = < 0x00800000 0x02000000 >;    /* appended from boardinfo */
    }; //end partition@800000 (part1)

    partition@qspi-FPGA {
        label = "FPGA Image";   /* appended from boardinfo */
        reg = < 0x02800000 0x00800000 >;    /* appended from boardinfo */
    }; //end partition@1800000 (part2)
}; //end n25q00@0 (flash0)
};

Console print out:

U-Boot SPL 2013.01.01 (Jan 09 2018 - 10:53:00)
BOARD : Altera SOCFPGA Cyclone V Board
CLOCK: EOSC1 clock 50000 KHz
CLOCK: EOSC2 clock 25000 KHz
CLOCK: F2S_SDR_REF clock 0 KHz
CLOCK: F2S_PER_REF clock 0 KHz
CLOCK: MPU clock 800 MHz
CLOCK: DDR clock 120 MHz
CLOCK: UART clock 100000 KHz
CLOCK: MMC clock 488 KHz
CLOCK: QSPI clock 400000 KHz
RESET: COLD
SDRAM: Initializing MMR registers
SDRAM: Calibrating PHY
SEQ.C: Preparing to start memory calibration
SEQ.C: CALIBRATION PASSED
SDRAM: 256 MiB
FPGA : Programming FPGA
SF: Read data capture delay calibrated to 3 (0 - 7)
SF: Detected N25Q00 with page size 65536, total: 134217728
FPGA : Programming FPGA passed
SF: Detected N25Q00 with page size 65536, total: 134217728


U-Boot 2013.01.01-00132-gd141e21-dirty (Jan 30 2018 - 22:11:47)

CPU   : Altera SOCFPGA Platform
BOARD : Altera SOCFPGA Cyclone V Board
I2C:   ready
DRAM:  256 MiB
MMC:   ALTERA DWMMC: 0
SF: Read data capture delay calibrated to 3 (2 - 5)
SF: Detected N25Q00 with page size 65536, total: 134217728
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Skipped ethaddr assignment due to invalid EMAC address in EEPROM
Net:   mii0
Warning: failed to set MAC address

Hit any key to stop autoboot:  0
SF: Detected N25Q00 with page size 65536, total: 134217728
## Flattened Device Tree blob at 00000100
Booting using the fdt blob at 0x00000100
reserving fdt memory region: addr=0 size=1000
Loading Device Tree to 03ff8000, end 03fffc82 ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Linux version 4.2.0-altera (yocto@yocto-VirtualBox) (gcc version 5.2.1 20151005 (Linaro GCC 5.2-2015.11-2) ) #3 SMP Mon Feb 5 00:00:28 EST 2018
[    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: Custom Project test1
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] PERCPU: Embedded 12 pages/cpu @cfdd1000 s17472 r8192 d23488 u49152
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 65024
[    0.000000] Kernel command line: console=ttyS0,57600 root=/dev/mtdblock1 rw rootfstype=jffs2
[    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Memory: 251080K/262144K available (6073K kernel code, 397K rwdata, 1560K rodata, 412K init, 136K bss, 11064K 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 : 0xd0800000 - 0xff000000   ( 744 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)
[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 - 0xc077c8a0   (7635 kB)
[    0.000000]       .init : 0xc077d000 - 0xc07e4000   ( 412 kB)
[    0.000000]       .data : 0xc07e4000 - 0xc0847698   ( 398 kB)
[    0.000000]        .bss : 0xc0847698 - 0xc0869950   ( 137 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]  Build-time adjustment of leaf fanout to 32.
[    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 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 0x46460001
[    0.000000] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 38225208935 ns
[    0.000020] sched_clock: 32 bits at 50MHz, resolution 20ns, wraps every 42949672950ns
[    0.000529] Console: colour dummy device 80x30
[    0.000614] Calibrating delay loop... 795.44 BogoMIPS (lpj=3977216)
[    0.089356] pid_max: default: 32768 minimum: 301
[    0.089753] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.089779] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.091645] CPU: Testing write buffer coherency: ok
[    0.091764] ftrace: allocating 20134 entries in 60 pages
[    0.180031] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.181784] Setting up static identity map for 0x8280 - 0x82d8
[    0.269438] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.269832] Brought up 2 CPUs
[    0.269903] SMP: Total of 2 processors activated (1590.88 BogoMIPS).
[    0.269927] CPU: All CPU(s) started in SVC mode.
[    0.272542] devtmpfs: initialized
[    0.286937] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
[    0.288114] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.294492] NET: Registered protocol family 16
[    0.294798] fpga bridge driver
[    0.300623] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.320507] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
[    0.320605] hw-breakpoint: maximum watchpoint size is 4 bytes.
[    0.323286] altera_hps2fpga_bridge soc:fpgabridge@0: fpga bridge [hps2fpga] registered as device hps2fpga
[    0.323363] altera_hps2fpga_bridge soc:fpgabridge@0: init-val not specified
[    0.324051] altera_hps2fpga_bridge soc:fpgabridge@1: fpga bridge [lwhps2fpga] registered as device lwhps2fpga
[    0.324097] altera_hps2fpga_bridge soc:fpgabridge@1: init-val not specified
[    0.324668] altera_hps2fpga_bridge soc:fpgabridge@2: fpga bridge [fpga2hps] registered as device fpga2hps
[    0.324705] altera_hps2fpga_bridge soc:fpgabridge@2: init-val not specified
[    0.387198] FPGA Mangager framework driver
[    0.388702] SCSI subsystem initialized
[    0.390250] usbcore: registered new interface driver usbfs
[    0.390483] usbcore: registered new interface driver hub
[    0.390741] usbcore: registered new device driver usb
[    0.391508] soc:usbphy@0 supply vcc not found, using dummy regulator
[    0.395259] pps_core: LinuxPPS API ver. 1 registered
[    0.395334] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.395458] PTP clock support registered
[    0.403399] clocksource: Switched to clocksource timer1
[    0.523673] NET: Registered protocol family 2
[    0.526153] TCP established hash table entries: 2048 (order: 1, 8192 bytes)
[    0.526266] TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
[    0.526435] TCP: Hash tables configured (established 2048 bind 2048)
[    0.526992] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.527193] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.528072] NET: Registered protocol family 1
[    0.529822] RPC: Registered named UNIX socket transport module.
[    0.529868] RPC: Registered udp transport module.
[    0.529885] RPC: Registered tcp transport module.
[    0.529903] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.532124] hw perfevents: Failed to parse /soc/pmu/interrupt-affinity[0]
[    0.532326] hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
[    0.532696] armv7-pmu arm-pmu: PMU:CTI successfully enabled for 2 cores
[    0.536708] futex hash table entries: 512 (order: 3, 32768 bytes)
[    0.571669] NFS: Registering the id_resolver key type
[    0.572004] Key type id_resolver registered
[    0.572030] Key type id_legacy registered
[    0.572252] ntfs: driver 2.1.32 [Flags: R/W].
[    0.573182] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[    0.575934] io scheduler noop registered (default)
[    0.596987] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.602276] console [ttyS0] disabled
[    0.602591] ffc02000.serial0: ttyS0 at MMIO 0xffc02000 (irq = 41, base_baud = 3125000) is a 16550A
[    1.845377] console [ttyS0] enabled
[    1.855038] ffc03000.serial1: ttyS1 at MMIO 0xffc03000 (irq = 42, base_baud = 3125000) is a 16550A
[    1.875914] altera_fpga_manager ff706000.fpgamgr: fpga manager [Altera FPGA Manager] registered as minor 0
[    1.902228] brd: module loaded
[    1.914601] CAN device driver interface
[    1.925629] stmmac - user ID: 0x10, Synopsys ID: 0x37
[    1.935943]  Ring mode enabled
[    1.942079]  DMA HW capability register supported
[    1.951153]  Enhanced/Alternate descriptors
[    1.959850]  Enabled extended descriptors
[    1.967892]  RX Checksum Offload Engine supported (type 2)
[    1.978840]  TX Checksum insertion supported
[    1.987369]  Enable RX Mitigation via HW Watchdog Timer
[    2.002094] libphy: stmmac: probed
[    2.008917] eth0: No PHY found
[    2.042941] stmmac - user ID: 0x10, Synopsys ID: 0x37
[    2.053143]  Ring mode enabled
[    2.059241]  DMA HW capability register supported
[    2.068295]  Enhanced/Alternate descriptors
[    2.077060]  Enabled extended descriptors
[    2.085080]  RX Checksum Offload Engine supported (type 2)
[    2.096020]  TX Checksum insertion supported
[    2.104540]  Enable RX Mitigation via HW Watchdog Timer
[    2.118454] libphy: stmmac: probed
[    2.125299] eth0: No PHY found
[    2.162610] dwc2 ffb40000.usb: Bad value for GSNPSID: 0x00000000
[    2.177122] mousedev: PS/2 mouse device common for all mice
[    2.189833] i2c /dev entries driver
[    2.200166] Synopsys Designware Multimedia Card Interface Driver
[    2.213581] dw_mmc ff704000.dwmmc0: IDMAC supports 32-bit address mode.
[    2.227064] dw_mmc ff704000.dwmmc0: Using internal DMA controller.
[    2.239475] dw_mmc ff704000.dwmmc0: Version ID is 240a
[    2.249920] dw_mmc ff704000.dwmmc0: DW MMC controller at irq 31, 32 bit host data width, 1024 deep fifo
[    2.280984] mmc_host mmc0: Bus speed (slot 0) = 244140Hz (slot req 400000Hz, actual 244140HZ div = 0)
[    2.311046] dw_mmc ff704000.dwmmc0: 1 slots initialized
[    2.322577] ledtrig-cpu: registered to indicate activity on CPUs
[    2.335292] usbcore: registered new interface driver usbhid
[    2.346497] usbhid: USB HID core driver
[    2.355131] oprofile: using arm/armv7-ca9
[    2.366826] NET: Registered protocol family 10
[    2.378848] sit: IPv6 over IPv4 tunneling driver
[    2.390352] NET: Registered protocol family 17
[    2.399434] NET: Registered protocol family 15
[    2.408341] can: controller area network core (rev 20120528 abi 9)
[    2.420967] NET: Registered protocol family 29
[    2.429860] can: raw protocol (rev 20120528)
[    2.438436] can: broadcast manager protocol (rev 20120528 t)
[    2.449765] can: netlink gateway (rev 20130117) max_hops=1
[    2.461493] 8021q: 802.1Q VLAN Support v1.8
[    2.470123] Key type dns_resolver registered
[    2.479141] ThumbEE CPU extension supported.
[    2.487754] Registering SWP/SWPB emulation handler
[    2.511539] ttyS0 - failed to request DMA
[    2.520589] List of all partitions:
[    2.527712] 0100            8192 ram0  (driver?)
[    2.536990] 0101            8192 ram1  (driver?)
[    2.546235] No filesystem could mount root, tried:  jffs2
[    2.557086] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    2.573571] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.2.0-altera #3
[    2.586397] Hardware name: Altera SOCFPGA
[    2.594605] [<c0017db4>] (unwind_backtrace) from [<c0013ae8>] (show_stack+0x20/0x24)
[    2.610115] [<c0013ae8>] (show_stack) from [<c0579348>] (dump_stack+0x80/0x90)
[    2.624525] [<c0579348>] (dump_stack) from [<c05770e8>] (panic+0xac/0x1fc)
[    2.638290] [<c05770e8>] (panic) from [<c077e440>] (mount_block_root+0x254/0x268)
[    2.653216] [<c077e440>] (mount_block_root) from [<c077e66c>] (mount_root+0x12c/0x134)
[    2.668998] [<c077e66c>] (mount_root) from [<c077e7ec>] (prepare_namespace+0x178/0x1c0)
[    2.684953] [<c077e7ec>] (prepare_namespace) from [<c077df58>] (kernel_init_freeable+0x274/0x284)
[    2.702638] [<c077df58>] (kernel_init_freeable) from [<c0575e38>] (kernel_init+0x1c/0xf8)
[    2.718936] [<c0575e38>] (kernel_init) from [<c000fb28>] (ret_from_fork+0x14/0x2c)
[    2.734035] CPU1: stopping
[    2.739449] CPU: 1 PID: 17 Comm: kworker/u4:1 Not tainted 4.2.0-altera #3
[    2.752965] Hardware name: Altera SOCFPGA
[    2.761017] Workqueue: kmmcd mmc_rescan
[    2.768713] [<c0017db4>] (unwind_backtrace) from [<c0013ae8>] (show_stack+0x20/0x24)
[    2.784151] [<c0013ae8>] (show_stack) from [<c0579348>] (dump_stack+0x80/0x90)
[    2.798549] [<c0579348>] (dump_stack) from [<c0016454>] (handle_IPI+0x214/0x230)
[    2.813290] [<c0016454>] (handle_IPI) from [<c00094b4>] (gic_handle_irq+0x68/0x6c)
[    2.828376] [<c00094b4>] (gic_handle_irq) from [<c0014700>] (__irq_svc+0x40/0x54)
[    2.843280] Exception stack(0xcf969d88 to 0xcf969dd0)
[    2.853358] 9d80:                   000000d5 ffffffff 00000f2c c02dbcc8 c07e6100 ffff8beb
[    2.869645] 9da0: 0010624c cfaaf704 cfaaf618 c081ec38 cf00d405 cf969df4 cf969df8 cf969dd0
[    2.885928] 9dc0: c0424ec0 c02dbcf8 20000113 ffffffff
[    2.896067] [<c0014700>] (__irq_svc) from [<c02dbcf8>] (__loop_delay+0x0/0x10)
[    2.910506] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
linux
embedded-linux
yocto
intel-fpga
jethro
asked on Stack Overflow Feb 7, 2018 by Paddler • edited Mar 13, 2018 by Gyanendra Dwivedi

1 Answer

0

modifying sources in the ./tmp/ directory doesn't have any effect, as those changes will be overwritten by the next do_fetch from bitbake.

AFAIK the best way to modify an in-tree dts file is to add a patch using a .bbappend file for the kernel. Something like the following:

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://0001-my-dts-changes.patch"

For more details on that please take a look at the Yoctoproject Kernel Manual:: https://www.yoctoproject.org/docs/current/kernel-manual/kernel-manual.html

answered on Stack Overflow Feb 20, 2018 by g0hl1n

User contributions licensed under CC BY-SA 3.0