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.

AM6442: HOW to CREATE A RAMDISK

Part Number: AM6442

Hello TI expert,

I wanna to create a RAMDISK filesystem for AM6442 because the custom HW using tight NOR flash.

I have already rebuild the tiny rootfs from TI's yocto but I didn't know to create ramdisk from it.

Please help me.

Thanks.

  • Hello,

    I follow the following command to create a RAMDISK as below:

    dd if=/dev/zero of=initrd.img bs=1M count=40
    mke2fs -F -v -m0 initrd.img
    sudo mkdir -p /media/ramdisk
    sudo mount -o loop initrd.img /media/ramdisk
    cd /media/ramdisk
    sudo tar xvf /ti-processor-sdk-linux-am64xx-evm-08.00.00.21/filesystem/tisdk-tiny-image-am64xx-evm-20220302045330.rootfs.tar.xz
    sudo chown -R root:root *
    sudo umount /media/ramdisk
    gzip -9 initrd.img
    mv initrd.img.gz ramdisk.image.gz

    and rebuild kernel with CONFIG_BLK_DEV_RAM_SIZE=8192

    and setup uboot env as

    setenv bootargs console=${console} ${optargs} mem=512M root=/dev/ram0 rw initrd=0x84000000,50MB;
    tftp 0x84000000 ramdisk.image.gz;
    run run_kern;

    System cannot mout ramdisk as log:

    => run run_kern;
    ## Flattened Device Tree blob at 88000000
       Booting using the fdt blob at 0x88000000
    ERROR: reserving fdt memory region failed (addr=9e800000 size=1800000)
       Loading Device Tree to 000000008fff0000, end 000000008ffffc09 ... OK
    
    Starting kernel ...
    
    [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
    [    0.000000] Linux version 5.10.41-g4c2eade9f7 (brian@brian) (aarch64-none-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture 9.2-2
    [    0.000000] Machine model: Texas Instruments AM642 EVM
    [    0.000000] earlycon: ns16550a0 at MMIO32 0x0000000002800000 (options '')
    [    0.000000] printk: bootconsole [ns16550a0] enabled
    [    0.000000] Memory limited to 512MB
    [    0.000000] efi: UEFI not found.
    [    0.000000] Zone ranges:
    [    0.000000]   DMA      [mem 0x0000000080000000-0x000000009fffffff]
    [    0.000000]   DMA32    empty
    [    0.000000]   Normal   empty
    [    0.000000] Movable zone start for each node
    [    0.000000] Early memory node ranges
    [    0.000000]   node   0: [mem 0x0000000080000000-0x000000009e7fffff]
    [    0.000000]   node   0: [mem 0x000000009e800000-0x000000009fffffff]
    [    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x000000009fffffff]
    [    0.000000] cma: Failed to reserve 512 MiB
    [    0.000000] psci: probing for conduit method from DT.
    [    0.000000] psci: PSCIv1.1 detected in firmware.
    [    0.000000] psci: Using standard PSCI v0.2 function IDs
    [    0.000000] psci: Trusted OS migration not required
    [    0.000000] psci: SMC Calling Convention v1.2
    [    0.000000] percpu: Embedded 2 pages/cpu s49880 r8192 d73000 u131072
    [    0.000000] Detected VIPT I-cache on CPU0
    [    0.000000] CPU features: detected: ARM erratum 845719
    [    0.000000] CPU features: detected: GIC system register CPU interface
    [    0.000000] Built 1 zonelists, mobility grouping off.  Total pages: 8184
    [    0.000000] Kernel command line: console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000 mtdparts=fc40000.spi.0:512k(ospi.tiboot3),2560B
    [    0.000000] Dentry cache hash table entries: 65536 (order: 3, 524288 bytes, linear)
    [    0.000000] Inode-cache hash table entries: 32768 (order: 2, 262144 bytes, linear)
    [    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
    [    0.000000] Memory: 427392K/524288K available (10240K kernel code, 1276K rwdata, 4096K rodata, 1728K init, 689K bss, 96896K reserved, 0K c)
    [    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
    [    0.000000] rcu: Preemptible hierarchical RCU implementation.
    [    0.000000] rcu:     RCU event tracing is enabled.
    [    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=2.
    [    0.000000]  Trampoline variant of Tasks RCU enabled.
    [    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
    [    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
    [    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
    [    0.000000] GICv3: GIC: Using split EOI/Deactivate mode
    [    0.000000] GICv3: 256 SPIs implemented
    [    0.000000] GICv3: 0 Extended SPIs implemented
    [    0.000000] GICv3: Distributor has no Range Selector support
    [    0.000000] GICv3: 16 PPIs implemented
    [    0.000000] GICv3: CPU0: found redistributor 0 region 0:0x0000000001840000
    [    0.000000] ITS [mem 0x01820000-0x0182ffff]
    [    0.000000] GIC: enabling workaround for ITS: Socionext Synquacer pre-ITS
    [    0.000000] ITS@0x0000000001820000: allocated 1048576 Devices @83800000 (flat, esz 8, psz 64K, shr 0)
    [    0.000000] ITS: using cache flushing for cmd queue
    [    0.000000] GICv3: using LPI property table @0x000000009e520000
    [    0.000000] GIC: using cache flushing for LPI property table
    [    0.000000] GICv3: CPU0: using allocated LPI pending table @0x000000009e530000
    [    0.000000] random: get_random_bytes called from start_kernel+0x32c/0x4d4 with crng_init=0
    [    0.000000] arch_timer: cp15 timer(s) running at 225.00MHz (phys).
    [    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x33e45310bc, max_idle_ns: 440795207391 ns
    [    0.000006] sched_clock: 56 bits at 225MHz, resolution 4ns, wraps every 4398046511101ns
    [    0.008631] Console: colour dummy device 80x25
    [    0.013246] Calibrating delay loop (skipped), value calculated using timer frequency.. 450.00 BogoMIPS (lpj=900000)
    [    0.023930] pid_max: default: 32768 minimum: 301
    [    0.028765] LSM: Security Framework initializing
    [    0.033604] Mount-cache hash table entries: 8192 (order: 0, 65536 bytes, linear)
    [    0.041220] Mountpoint-cache hash table entries: 8192 (order: 0, 65536 bytes, linear)
    [    0.052437] rcu: Hierarchical SRCU implementation.
    [    0.057838] Platform MSI: msi-controller@1820000 domain created
    [    0.064242] EFI services will not be available.
    [    0.069302] smp: Bringing up secondary CPUs ...
    [    0.074908] Detected VIPT I-cache on CPU1
    [    0.074957] GICv3: CPU1: found redistributor 1 region 0:0x0000000001860000
    [    0.074977] GICv3: CPU1: using allocated LPI pending table @0x000000008ff00000
    [    0.075062] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
    [    0.075241] smp: Brought up 1 node, 2 CPUs
    [    0.104673] SMP: Total of 2 processors activated.
    [    0.109493] CPU features: detected: 32-bit EL0 Support
    [    0.114781] CPU features: detected: CRC32 instructions
    [    0.130196] CPU: All CPU(s) started at EL2
    [    0.134412] alternatives: patching kernel code
    [    0.140629] devtmpfs: initialized
    [    0.154201] KASLR disabled due to lack of seed
    [    0.159154] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
    [    0.169142] futex hash table entries: 512 (order: -1, 32768 bytes, linear)
    [    0.176517] pinctrl core: initialized pinctrl subsystem
    [    0.182542] DMI not present or invalid.
    [    0.187377] NET: Registered protocol family 16
    [    0.192701] DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations
    [    0.200008] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
    [    0.208005] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
    [    0.216759] thermal_sys: Registered thermal governor 'step_wise'
    [    0.216767] thermal_sys: Registered thermal governor 'power_allocator'
    [    0.223538] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
    [    0.237265] ASID allocator initialised with 65536 entries
    [    0.277174] HugeTLB registered 16.0 GiB page size, pre-allocated 0 pages
    [    0.284067] HugeTLB registered 512 MiB page size, pre-allocated 0 pages
    [    0.290837] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
    [    0.300300] cryptd: max_cpu_qlen set to 1000
    [    0.309798] k3-chipinfo 43000014.chipid: Family:AM64X rev:SR1.0 JTAGID[0x0bb3802f] Detected
    [    0.319284] vsys_5v0: supplied by evm_12v0
    [    0.323932] vsys_3v3: supplied by vsys_5v0
    [    0.329403] iommu: Default domain type: Translated 
    [    0.334931] SCSI subsystem initialized
    [    0.339565] mc: Linux media interface: v0.10
    [    0.343987] videodev: Linux video capture interface: v2.00
    [    0.349726] pps_core: LinuxPPS API ver. 1 registered
    [    0.354806] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
    [    0.364161] PTP clock support registered
    [    0.368217] EDAC MC: Ver: 3.0.0
    [    0.372584] omap-mailbox 29020000.mailbox: omap mailbox rev 0x66fc9100
    [    0.379776] omap-mailbox 29040000.mailbox: omap mailbox rev 0x66fc9100
    [    0.386638] omap-mailbox 29060000.mailbox: omap mailbox rev 0x66fc9100
    [    0.394374] FPGA manager framework
    [    0.398020] Advanced Linux Sound Architecture Driver Initialized.
    [    0.405910] clocksource: Switched to clocksource arch_sys_counter
    [    0.412881] VFS: Disk quotas dquot_6.6.0
    [    0.417076] VFS: Dquot-cache hash table entries: 8192 (order 0, 65536 bytes)
    [    0.432356] NET: Registered protocol family 2
    [    0.437066] IP idents hash table entries: 8192 (order: 0, 65536 bytes, linear)
    [    0.445679] tcp_listen_portaddr_hash hash table entries: 4096 (order: 0, 65536 bytes, linear)
    [    0.454655] TCP established hash table entries: 8192 (order: 0, 65536 bytes, linear)
    [    0.462669] TCP bind hash table entries: 8192 (order: 1, 131072 bytes, linear)
    [    0.470245] TCP: Hash tables configured (established 8192 bind 8192)
    [    0.477009] UDP hash table entries: 2048 (order: 0, 65536 bytes, linear)
    [    0.483979] UDP-Lite hash table entries: 2048 (order: 0, 65536 bytes, linear)
    [    0.491602] NET: Registered protocol family 1
    [    0.496911] RPC: Registered named UNIX socket transport module.
    [    0.503026] RPC: Registered udp transport module.
    [    0.507879] RPC: Registered tcp transport module.
    [    0.512693] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [    0.519552] Trying to unpack rootfs image as initramfs...
    [    0.525473] rootfs image is not initramfs (no cpio magic); looks like an initrd
    [    0.663188] Freeing initrd memory: 51200K
    [    0.668179] hw perfevents: enabled with armv8_cortex_a53 PMU driver, 7 counters available
    [    0.683164] Initialise system trusted keyrings
    [    0.688113] workingset: timestamp_bits=46 max_order=13 bucket_order=0
    [    0.700941] squashfs: version 4.0 (2009/01/31) Phillip Lougher
    [    0.708066] NFS: Registering the id_resolver key type
    [    0.713331] Key type id_resolver registered
    [    0.717630] Key type id_legacy registered
    [    0.721831] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
    [    0.728692] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
    [    0.736566] 9p: Installing v9fs 9p2000 file system support
    [    0.797148] Key type asymmetric registered
    [    0.801368] Asymmetric key parser 'x509' registered
    [    0.806447] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 243)
    [    0.814018] io scheduler mq-deadline registered
    [    0.818651] io scheduler kyber registered
    [    0.825559] pinctrl-single 4084000.pinctrl: 32 pins, size 128
    [    0.832195] pinctrl-single f4000.pinctrl: 180 pins, size 720
    [    0.839410] pinctrl-single a40000.timesync-router: 512 pins, size 2048
    [    0.855745] Serial: 8250/16550 driver, 10 ports, IRQ sharing enabled
    [    0.884556] brd: module loaded
    [    0.898469] loop: module loaded
    [    0.905974] libphy: Fixed MDIO Bus: probed
    [    0.910718] tun: Universal TUN/TAP device driver, 1.6
    [    0.918276] VFIO - User Level meta-driver version: 0.3
    [    0.924481] i2c /dev entries driver
    [    0.929453] sdhci: Secure Digital Host Controller Interface driver
    [    0.935798] sdhci: Copyright(c) Pierre Ossman
    [    0.940812] sdhci-pltfm: SDHCI platform and OF driver helper
    [    0.948068] ledtrig-cpu: registered to indicate activity on CPUs
    [    0.954826] SMCCC: SOC_ID: ARCH_SOC_ID not implemented, skipping ....
    [    0.963389] optee: probing for conduit method.
    [    0.968004] optee: revision 3.12 (3d47a131)
    [    0.968827] optee: initialized driver
    [    0.980010] NET: Registered protocol family 17
    [    0.984802] 9pnet: Installing 9P2000 support
    [    0.989261] Key type dns_resolver registered
    [    0.993955] Loading compiled-in X.509 certificates
    [    1.015304] ti-sci 44043000.dmsc: ABI: 3.1 (firmware rev 0x0015 '21.5.0--v2021.05 (Terrific Llam')
    [    1.066075] random: fast init done
    [    1.076357] omap_i2c 4900000.i2c: bus 0 rev0.12 at 400 kHz
    [    1.083682] omap_i2c 20020000.i2c: bus 1 rev0.12 at 100 kHz
    [    1.091016] omap_i2c 20030000.i2c: bus 2 rev0.12 at 100 kHz
    [    1.097299] ti-sci-intr bus@f4000:bus@4000000:interrupt-controller1: Interrupt Router 5 domain created
    [    1.107038] ti-sci-intr bus@f4000:interrupt-controller0: Interrupt Router 3 domain created
    [    1.115847] ti-sci-inta 48000000.interrupt-controller: Interrupt Aggregator domain 28 created
    [    1.128024] cdns-torrent-phy f000000.serdes: No available link subnodes found
    [    1.135429] cdns-torrent-phy: probe of f000000.serdes failed with error -22
    [    1.150387] ti-bcdma 485c0100.dma-controller: Number of rings: 68
    [    1.158363] ti-bcdma 485c0100.dma-controller: Channels: 24 (bchan: 12, tchan: 6, rchan: 6)
    [    1.169248] ti-pktdma 485c0000.dma-controller: Number of rings: 288
    [    1.185050] ti-pktdma 485c0000.dma-controller: Channels: 44 (tchan: 29, rchan: 15)
    [    1.197131] printk: console [ttyS2] disabled
    [    1.201633] 2800000.serial: ttyS2 at MMIO 0x2800000 (irq = 17, base_baud = 3000000) is a 8250
    [    1.210416] printk: console [ttyS2] enabled
    [    1.210416] printk: console [ttyS2] enabled
    [    1.218868] printk: bootconsole [ns16550a0] disabled
    [    1.218868] printk: bootconsole [ns16550a0] disabled
    [    1.232781] spi-nor spi0.0: s28hl01gt (131072 Kbytes)
    [    1.237979] 11 cmdlinepart partitions found on MTD device fc40000.spi.0
    [    1.244593] Creating 11 MTD partitions on "fc40000.spi.0":
    [    1.250084] 0x000000000000-0x000000080000 : "ospi.tiboot3"
    [    1.257308] 0x000000080000-0x000000300000 : "ospi.multicore"
    [    1.264664] 0x000000300000-0x000000500000 : "ospi.tispl"
    [    1.271642] 0x000000500000-0x000000900000 : "ospi.u-boot"
    [    1.278669] 0x000000900000-0x000000940000 : "ospi.env"
    [    1.285543] 0x000000940000-0x000000980000 : "ospi.env.backup"
    [    1.292860] 0x000000980000-0x0000009c0000 : "ospi.dtb"
    [    1.299657] 0x000000a80000-0x000001e80000 : "ospi.kernel"
    [    1.306730] 0x000001e80000-0x000003fc0000 : "ospi.rootfs"
    [    1.313831] 0x000003fc0000-0x000004000000 : "ospi.phypattern"
    [    1.321322] 0x000004000000-0x000008000000 : "ospi.other"
    [    1.385921] davinci_mdio 8000f00.mdio: davinci mdio revision 9.7, bus freq 1000000
    [    1.393536] libphy: 8000f00.mdio: probed
    [    1.400100] mdio_bus 8000f00.mdio: MDIO device at address 2 is missing.
    [    1.406784] davinci_mdio 8000f00.mdio: phy[0]: device 8000f00.mdio:00, driver NXP TJA1101
    [    1.415134] am65-cpsw-nuss 8000000.ethernet: initializing am65 cpsw nuss version 0x6BA00903, cpsw version 0x6BA80903 Ports: 3 quirks:000002
    [    1.428530] am65-cpsw-nuss 8000000.ethernet: set new flow-id-base 16
    [    1.435406] am65-cpsw-nuss 8000000.ethernet: Use random MAC address
    [    1.441713] am65-cpsw-nuss 8000000.ethernet: initialized cpsw ale version 1.4
    [    1.448889] am65-cpsw-nuss 8000000.ethernet: ALE Table size 512
    [    1.455625] pps pps0: new PPS source ptp0
    [    1.460236] am65-cpsw-nuss 8000000.ethernet: CPTS ver 0x4e8a010c, freq:500000000, add_val:1 pps:1
    [    1.474070] am65-cpts 39000000.cpts: CPTS ver 0x4e8a010c, freq:500000000, add_val:1 pps:0
    [    1.485017] sdhci-am654: probe of fa10000.mmc failed with error -22
    [    1.486200] mmc0: CQHCI version 5.10
    [    1.505148] inv-mpu-iio-spi spi2.0: supply inven,vdd_ana not found, using dummy regulator
    [    1.513650] inv-mpu-iio-spi spi2.0: supply inven,vcc_i2c not found, using dummy regulator
    [    1.521919] inv_mpu: inv_mpu_probe: power on here.
    [    1.526716] inv_mpu: inv_mpu_probe: power on.
    [    1.637978] inv_mpu: whoami= fa
    [    1.746167] inv_mpu: inv_mpu_initialize: initialize result is 0....
    [    1.753222] inv_mpu: wakeup_source is created successfully
    [    1.758744] inv-mpu-iio-spi spi2.0: iam20680 ma-kernel-9.1.5-test1 is ready to go!
    [    1.766308] inv_mpu: Data read from FIFO
    [    1.770230] inv_mpu: Timer based batching
    [    1.775475] debugfs: Directory 'pd:114' with parent 'pm_genpd' already present!
    [    1.791803] ALSA device list:
    [    1.794809]   No soundcards found.
    [    3.010647] sdhci-am654 fa00000.mmc: Power on failed
    [    3.046294] mmc0: SDHCI controller on fa00000.mmc [fa00000.mmc] using ADMA 64-bit
    [    3.054412] RAMDISK: gzip image found at block 0
    [    3.155614] RAMDISK: incomplete write (6213 != 32768)
    [    3.160766] write error
    [    3.189294] EXT4-fs (ram0): bad geometry: block count 40960 exceeds size of device (8192 blocks)
    [    3.198668] VFS: Mounted root (ext2 filesystem) on device 1:0.
    [    3.204721] EXT2-fs (ram0): error: ext2_get_inode: unable to read inode block - inode=4097, block=16387
    [    3.214150] devtmpfs: error mounting -5
    [    3.219283] Freeing unused kernel memory: 1728K
    [    3.238006] Run /sbin/init as init process
    [    3.243233] attempt to access beyond end of device
    [    3.243233] ram0: rw=0, want=68206, limit=16384
    [    3.252591] Buffer I/O error on dev ram0, logical block 34102, async page read
    [    3.259816] attempt to access beyond end of device
    [    3.259816] ram0: rw=0, want=68208, limit=16384
    [    3.269115] Buffer I/O error on dev ram0, logical block 34103, async page read
    [    3.276335] attempt to access beyond end of device
    [    3.276335] ram0: rw=0, want=68210, limit=16384
    [    3.285641] Buffer I/O error on dev ram0, logical block 34104, async page read
    [    3.292864] attempt to access beyond end of device
    [    3.292864] ram0: rw=0, want=68212, limit=16384
    [    3.302172] Buffer I/O error on dev ram0, logical block 34105, async page read
    [    3.309393] attempt to access beyond end of device
    [    3.309393] ram0: rw=0, want=68214, limit=16384
    [    3.318694] Buffer I/O error on dev ram0, logical block 34106, async page read
    [    3.325914] attempt to access beyond end of device
    [    3.325914] ram0: rw=0, want=68216, limit=16384
    [    3.335212] Buffer I/O error on dev ram0, logical block 34107, async page read
    [    3.342432] attempt to access beyond end of device
    [    3.342432] ram0: rw=0, want=68218, limit=16384
    [    3.351729] Buffer I/O error on dev ram0, logical block 34108, async page read
    [    3.358951] attempt to access beyond end of device
    [    3.358951] ram0: rw=0, want=68220, limit=16384
    [    3.368254] Buffer I/O error on dev ram0, logical block 34109, async page read
    [    3.375502] attempt to access beyond end of device
    [    3.375502] ram0: rw=0, want=68222, limit=16384
    [    3.384801] Buffer I/O error on dev ram0, logical block 34110, async page read
    [    3.392022] attempt to access beyond end of device
    [    3.392022] ram0: rw=0, want=68224, limit=16384
    [    3.401322] Buffer I/O error on dev ram0, logical block 34111, async page read
    [    3.408880] Starting init: /sbin/init exists but couldn't execute it (error -5)
    [    3.416259] Run /etc/init as init process
    [    3.420647] EXT2-fs (ram0): error: ext2_get_inode: unable to read inode block - inode=6145, block=24740
    [    3.430281] Starting init: /etc/init exists but couldn't execute it (error -5)
    [    3.437513] Run /bin/init as init process
    [    3.441969] EXT2-fs (ram0): error: ext2_get_inode: unable to read inode block - inode=8193, block=32771
    [    3.451457] Starting init: /bin/init exists but couldn't execute it (error -5)
    [    3.458700] Run /bin/sh as init process
    [    3.462829] EXT2-fs (ram0): error: ext2_get_inode: unable to read inode block - inode=8193, block=32771
    [    3.472289] Starting init: /bin/sh exists but couldn't execute it (error -5)
    [    3.479359] Kernel panic - not syncing: No working init found.  Try passing init= option to kernel. See Linux Documentation/admin-guide/in.
    [    3.493508] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.10.41-g4c2eade9f7 #4
    [    3.500541] Hardware name: Texas Instruments AM642 EVM (DT)
    [    3.506101] Call trace:
    [    3.508555]  dump_backtrace+0x0/0x1a0
    [    3.512212]  show_stack+0x18/0x68
    [    3.515524]  dump_stack+0xd0/0x12c
    [    3.518922]  panic+0x16c/0x334
    [    3.521974]  kernel_init+0xf8/0x114
    [    3.525456]  ret_from_fork+0x10/0x34
    [    3.529029] SMP: stopping secondary CPUs
    [    3.532954] Kernel Offset: disabled
    [    3.536434] CPU features: 0x0040002,2000200c
    [    3.540693] Memory Limit: 512 MB
    [    3.543923] ---[ end Kernel panic - not syncing: No working init found.

    Please help me to fix this bug. thanks

  • Hi Thinh,

    The default ramfs load address is "ramdisk_addr_r=0x88080000" in U-Boot, I didn't check the memory layout in Uboot and am wondering if move it 0x84000000 would cause any issue.

    I haven't done standalone initramfs for years, but have you tried to build the initrd into kernel image using config option CONFIG_INITRAMFS_SOURCE?

  • Hello Bin,

    I corrected the ramfs load address is "ramdisk_addr_r=0x88080000" in U-Boot, but meet the same error as ablove.

    about CONFIG_INITRAMFS_SOURCE? in the defconfig of AM6442 is CONFIG_INITRAMFS_SOURCE="".

    Now how can I make initramfs and how to append to kernel image. I am stuck at here

    Can you re-produce on EVM board for me?

    Many thank you

  • Hi Thinh,

    about CONFIG_INITRAMFS_SOURCE? in the defconfig of AM6442 is CONFIG_INITRAMFS_SOURCE="".

    Untar the tiny rootfs .xz file to a folder, then specify the folder path to CONFIG_INITRAMFS_SOURCE. The initramfs will be built into the kernel Image.

  • Hello Bin,

    I followed this guide and append the tiny-rootfs to the kernel image.

    I mean that the new kernel image (Image = kernel image + ininramfs).

    When copy this kernel image to DDR, how to put the ininramfs at ramdisk_addr_r=0x88080000.

    And how to setup the U-boot args/command to run the ramfs on DDR.

    ========================

    current, I setup as the following text, It can not mout ramdisk

    setenv mtdparts mtdparts=fc40000.spi.0:512k(ospi.tiboot3),2560k(ospi.multicore),2m(ospi.tispl),4m(ospi.u-boot),256k(ospi.env),256k(ospi.env.backup),256k(ospi.dtb),20m@10752k(ospi.kernel),34048k(ospi.rootfs),256k(ospi.phypattern),64m@64m(ospi.other); run args_all; setenv bootargs console=${console} ${optargs} mem=512M root=/dev/ram rw initrd=${ramdisk_addr_r},50MB;
    sf probe; sf read 0x83000000 0xa80000 0x1400000; sf read ${fdtaddr} 0x980000 0x100000;
    run run_kern;

  • Hi Thinh,

    Kernel knows where the appended initrd is loaded.

    You will use command 'bootz ${loadaddr} - ${fdtaddr}' to run zImage. The '-' in the middle tells bootz command to skip the initrd load address.

  • Hello Bin,

    I am doing on AM6442, the ARM64 does not support zImage.

    Compile the kernel generate only Image or Image.gz

    AM64xx has already command run_kern, that means

    => printenv run_kern
    run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}

    => printenv rd_spec
    rd_spec=-

    Can you show me step by step to boot a ramdisk sample on AM64xx

    My config in kernel

    CONFIG_BLK_DEV_INITRD=y
    CONFIG_INITRAMFS_SOURCE="/home/brian/ti/ti-processor-sdk-linux-am64xx-evm-08.00.00.21/filesystem/tisdk-tiny-image-am64xx-evm-20220302045330.rootfs"
    CONFIG_INITRAMFS_ROOT_UID=0
    CONFIG_INITRAMFS_ROOT_GID=0
    CONFIG_RD_GZIP=y
    CONFIG_RD_BZIP2=y
    CONFIG_RD_LZMA=y
    CONFIG_RD_XZ=y
    CONFIG_RD_LZO=y
    CONFIG_RD_LZ4=y
    CONFIG_RD_ZSTD=y
    CONFIG_INITRAMFS_COMPRESSION_GZIP=y

    Log:

    [    1.045783] Trying to unpack rootfs image as initramfs...
    [    1.588936] rootfs image is not initramfs (invalid magic at start of compressed archive); looks like an initrd
    [    1.729290] Freeing initrd memory: 51200K
    
    
    
    [    4.126272] RAMDISK: Couldn't find valid RAM disk image starting at 0.
    [    4.132983] VFS: Cannot open root device "ram" or unknown-block(1,0): error -2
    [    4.141784] Please append a correct "root=" boot option; here are the available partitions:
    [    4.150196] 0100            4096 ram0 
    [    4.150200]  (driver?)
    

    Many thank you in advance

  • Hi Bin,

    Do you have any update for me.

    I am still waiting for your support.

    Many thanks,

  • Hi Thinh,

    I am doing on AM6442, the ARM64 does not support zImage.

    Compile the kernel generate only Image or Image.gz

    Sorry, my bad. I was referring to AM335x...

    => printenv run_kern
    run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}

    => printenv rd_spec
    rd_spec=-

    Yes, this "run_kern" command is basically what I said: "booti ${loadaddr} - ${fdtaddr}"

    Is this boot log generated in booting with the "run_kern" command?

  • Hi Bin,

    Yes, the boot log is generated by "run_kern" command

  • CONFIG_INITRAMFS_SOURCE="/home/brian/ti/ti-processor-sdk-linux-am64xx-evm-08.00.00.21/filesystem/tisdk-tiny-image-am64xx-evm-20220302045330.rootfs"

    The missing step before compile the kernel image is

    $ cd /home/brian/ti/ti-processor-sdk-linux-am64xx-evm-08.00.00.21/filesystem/tisdk-tiny-image-am64xx-evm-20220302045330.rootfs
    $ ln -s /sbin/init init

  • Hi Bin,

    Look at the log out:

    |  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_
    |     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
    |__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|  
                  |___|                    |___|            

    Arago Project http://arago-project.org am64xx-evm /dev/ttyS2

    Arago 2020.09 am64xx-evm /dev/ttyS2

    am64xx-evm login: root
    root@am64xx-evm:~# ls
    root@am64xx-evm:~# df -h
    Filesystem                Size      Used Available Use% Mounted on
    devtmpfs                193.0M         0    193.0M   0% /dev
    tmpfs                   222.5M    512.0K    222.0M   0% /run
    tmpfs                    50.0M    320.0K     49.7M   1% /var/volatile

    It is done, Slight smile

    Many thank you.

    Brian

  • Hello Andreas,

    Thank you so much. It is very useful for us.

    Brian