What´s the best Practice to Build own Kernel

Let system to know where’s your rootfs (e.g. ramfs)

i have not changed uEnv.txt…

kernel=uImage                                                                                                                                                                                                                                                                                                      
kaddr=0x84000000                                                                                                                                                               
rdaddr=0x86000000                                                                                                                          #root=/dev/ram                                                                                                                                                                 
root=/dev/mmcblk0p2 rootfstype=ext4 rootwait                                                                                                                                   
console=earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200                                                                                                              
bootopts=vmalloc=496M debug=7 initcall_debug=0

What differences are on the setup between rc1 and rc5 you tested? They should not have so much distinct result.

ryderlee has got successful booted rc1 and my first try with rc5 failed…so i first tried to get same results as ryderlee

Ryder’s defconfig would use ramdisk as root filesystem. If you want to produce the same image as he has, you have to create a tiny ramdisk allowing kernel to have default shell. Otherwise, you need making some changes defconfig about conceling ramdisk as the boot device. So, I suggest you can go back to your rc5 experiments to check why pinctrl doesn’t work. You can add some printk to prove the pinctcrl driver is really probed correctly.

I can bring up r2 board successfully with 4.14 rc4 kernel on ramdisk and thus I guessed the kernel version is not the major problem.

1 Like

Can you try with default uEnv.txt?

this is my config (imported from github and changed some modules to y because of warnings on make mt7623n_evb_bpi_defconfig): mt7623n_evb_bpi_defconfig (132,7 KB)

How do you build (defconfig,dtb appending)

if you use 4.14 rc5, please use CONFIG_PINCTRL_MT2701 instead. here I found your defconfig seems a little incorrect on pinctrl selection. you can see below for more details.

https://patchwork.kernel.org/patch/9700745/

your used defconfig :sunny:

CONFIG_PINCTRL_MT2701 is not set

CONFIG_PINCTRL_MT7623=y

[    4.845331] VFS: Cannot open root device "mmcblk0p2" or unknown-block(179,2): error -6
[    4.853213] Please append a correct "root=" boot option; here are the available partitions:
[    4.861535] 0100            4096 ram0 
[    4.861538]  (driver?)
[    4.867612] 0101            4096 ram1 
[    4.867615]  (driver?)
[    4.873673] 0102            4096 ram2 
[    4.873676]  (driver?)
[    4.879750] 0103            4096 ram3 
[    4.879753]  (driver?)
[    4.885823] 0104            4096 ram4 
[    4.885826]  (driver?)
[    4.891885] 0105            4096 ram5 
[    4.891888]  (driver?)
[    4.897958] 0106            4096 ram6 
[    4.897961]  (driver?)
[    4.904020] 0107            4096 ram7 
[    4.904022]  (driver?)
[    4.910093] 0108            4096 ram8 
[    4.910096]  (driver?)
[    4.916165] 0109            4096 ram9 
[    4.916168]  (driver?)
[    4.922225] 010a            4096 ram10 
[    4.922228]  (driver?)
[    4.928384] 010b            4096 ram11 
[    4.928387]  (driver?)
[    4.934531] 010c            4096 ram12 
[    4.934534]  (driver?)
[    4.940690] 010d            4096 ram13 
[    4.940693]  (driver?)
[    4.946855] 010e            4096 ram14 
[    4.946858]  (driver?)
[    4.953003] 010f            4096 ram15 
[    4.953005]  (driver?)
[    4.959171] b300         7634944 mmcblk0 
[    4.959174]  driver: mmcblk
[    4.965935] b318             512 mmcblk0rpmb 
[    4.965938]  (driver?)
[    4.972600] b310            4096 mmcblk0boot1 
[    4.972603]  (driver?)
[    4.979363] b308            4096 mmcblk0boot0 
[    4.979366]  (driver?)
[    4.986123] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,2)

seems that only emmc is found…how is the SD-Card-slot connected (spi/i2c/…)? maybe this driver is missing…in schematics connection seems 4bit parallel…

searched in ryders config about SD/MMC and compared with mine…but found no hint, also bootlog from 4.4.70 says nothing about Cardreader is connected

4.14-rc5.log (21,0 KB)

Nice! You are already so close to shell able being seen on the console. I guessed the problem you had by looking into the log you gave should be you may take mmc0 as the SD device and mmc1 as the EMMC device in your environment.

But, this is not appropriate for the default bpi-r2 device tree set in 4.14 rc5. On the contrary, the upstream kernel will expect SD is used at mmc1 and MMC is used as mmc0 respectively and then kernel can’t find right mmcblk0p2 by looking through all partitions available on mmcblk0 and finally kernel panic is pop out for complaining you have incorrect VFS setup.

Instead, You can try out making the changes for your uEnv.txt with turning root=/dev/mmcblk0p2 into root=/dev/mmcblk1p2, and test again.

right, i did also not found mmcblk0p2, because mmcblk0 is emmc (from partition layout)…but i see no mmcblk1, but tried your modification in uEnv.txt:

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.14.0-rc5-BPI-R2-Kernel (frank@Frank-Laptop) (gcc version 4.8.4 (Ubuntu/Linaro 4.8.4-2ubun7
[    0.000000] CPU: ARMv7 Processor [410fc073] revision 3 (ARMv7), cr=10c5387d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Bananapi BPI-R2
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] cma: Reserved 64 MiB at 0xfb800000
[    0.000000] On node 0 totalpages: 524287
[    0.000000] free_area_init_node: node 0, pgdat c12cccc0, node_mem_map df5f9000
[    0.000000]   Normal zone: 1170 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 133120 pages, LIFO batch:31
[    0.000000]   HighMem zone: 391167 pages, LIFO batch:31
[    0.000000] random: fast init done
[    0.000000] percpu: Embedded 17 pages/cpu @df5a1000 s38912 r8192 d22528 u69632
[    0.000000] pcpu-alloc: s38912 r8192 d22528 u69632 alloc=17*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 523117
[    0.000000] Kernel command line: board=bpi-r2 console=earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200 root=0
[    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: 1993696K/2097148K available (11264K kernel code, 872K rwdata, 3640K rodata, 1024K init, 347K bss,)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xe1000000 - 0xff800000   ( 488 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xe0800000   ( 520 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0xc0008000 - 0xc0c00000   (12256 kB)
[    0.000000]       .init : 0xc1100000 - 0xc1200000   (1024 kB)
[    0.000000]       .data : 0xc1200000 - 0xc12da274   ( 873 kB)
[    0.000000]        .bss : 0xc12e5e64 - 0xc133cc3c   ( 348 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] ftrace: allocating 37621 entries in 111 pages
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  RCU restricting CPUs from NR_CPUS=16 to nr_cpu_ids=4.
[    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] arch_timer: cp15 timer(s) running at 13.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x2ff89eacb, max_idle_ns: 440795202429 s
[    0.000006] sched_clock: 56 bits at 13MHz, resolution 76ns, wraps every 4398046511101ns
[    0.000016] Switching to timer-based delay loop, resolution 76ns
[    0.000175] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 147020034397 ns
[    0.000190] sched_clock: 32 bits at 13MHz, resolution 76ns, wraps every 165191050201ns
[    0.000523] Console: colour dummy device 80x30
[    0.001008] console [tty1] enabled
[    0.001043] Calibrating delay loop (skipped), value calculated using timer frequency.. 26.00 BogoMIPS (lpj=130000)
[    0.001070] pid_max: default: 32768 minimum: 301
[    0.001228] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.001250] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.001952] CPU: Testing write buffer coherency: ok
[    0.002301] CPU0: update cpu_capacity 1024
[    0.002324] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.002701] Setting up static identity map for 0x80100000 - 0x80100060
[    0.002825] Hierarchical SRCU implementation.
[    0.003519] smp: Bringing up secondary CPUs ...
[    0.003960] CPU1: update cpu_capacity 1024
[    0.003966] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.004464] CPU2: update cpu_capacity 1024
[    0.004469] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.004941] CPU3: update cpu_capacity 1024
[    0.004947] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.005030] smp: Brought up 1 node, 4 CPUs
[    0.005108] SMP: Total of 4 processors activated (104.00 BogoMIPS).
[    0.005122] CPU: All CPU(s) started in SVC mode.
[    0.006047] devtmpfs: initialized
[    0.011739] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 3
[    0.011980] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.012016] futex hash table entries: 1024 (order: 4, 65536 bytes)
[    0.014477] xor: measuring software checksum speed
[    0.110027]    arm4regs  :  1399.600 MB/sec
[    0.210092]    8regs     :   810.000 MB/sec
[    0.310156]    32regs    :   827.600 MB/sec
[    0.410226]    neon      :  1299.200 MB/sec
[    0.410242] xor: using function: arm4regs (1399.600 MB/sec)
[    0.410341] pinctrl core: initialized pinctrl subsystem
[    0.411186] NET: Registered protocol family 16
[    0.412928] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.414090] No ATAGs?
[    0.414250] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.414283] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.650801] raid6: int32x1  gen()   162 MB/s
[    0.820607] raid6: int32x1  xor()   126 MB/s
[    0.990917] raid6: int32x2  gen()   216 MB/s
[    1.160914] raid6: int32x2  xor()   147 MB/s
[    1.330922] raid6: int32x4  gen()   205 MB/s
[    1.501194] raid6: int32x4  xor()   141 MB/s
[    1.671308] raid6: int32x8  gen()   208 MB/s
[    1.841314] raid6: int32x8  xor()   126 MB/s
[    2.011414] raid6: neonx1   gen()   483 MB/s
[    2.181502] raid6: neonx1   xor()   475 MB/s
[    2.351650] raid6: neonx2   gen()   659 MB/s
[    2.521727] raid6: neonx2   xor()   600 MB/s
[    2.691841] raid6: neonx4   gen()   806 MB/s
[    2.861953] raid6: neonx4   xor()   683 MB/s
[    3.032112] raid6: neonx8   gen()   760 MB/s
[    3.202193] raid6: neonx8   xor()   613 MB/s
[    3.202208] raid6: using algorithm neonx4 gen() 806 MB/s
[    3.202222] raid6: .... xor() 683 MB/s, rmw enabled
[    3.202235] raid6: using neon recovery algorithm
[    3.202827] vgaarb: loaded
[    3.203222] SCSI subsystem initialized
[    3.203427] usbcore: registered new interface driver usbfs
[    3.203488] usbcore: registered new interface driver hub
[    3.203574] usbcore: registered new device driver usb
[    3.204146] Advanced Linux Sound Architecture Driver Initialized.
[    3.205542] clocksource: Switched to clocksource arch_sys_counter
[    3.293070] VFS: Disk quotas dquot_6.6.0
[    3.293169] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    3.293358] FS-Cache: Loaded
[    3.293570] CacheFiles: Loaded
[    3.301540] NET: Registered protocol family 2
[    3.302126] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[    3.302188] TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
[    3.302258] TCP: Hash tables configured (established 4096 bind 4096)
[    3.302371] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    3.302414] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    3.302607] NET: Registered protocol family 1
[    3.303037] RPC: Registered named UNIX socket transport module.
[    3.303062] RPC: Registered udp transport module.
[    3.303075] RPC: Registered tcp transport module.
[    3.303088] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    3.303109] PCI: CLS 0 bytes, default 64
[    3.305691] audit: initializing netlink subsys (disabled)
[    3.305868] audit: type=2000 audit(3.300:1): state=initialized audit_enabled=0 res=1
[    3.306209] workingset: timestamp_bits=14 max_order=19 bucket_order=5
[    3.312649] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    3.313939] NFS: Registering the id_resolver key type
[    3.313989] Key type id_resolver registered
[    3.314003] Key type id_legacy registered
[    3.314024] Installing knfsd (copyright (C) 1996 [email protected]).
[    3.314655] ntfs: driver 2.1.32 [Flags: R/W].
[    3.315051] fuse init (API version 7.26)
[    3.315727] JFS: nTxBlock = 8192, nTxLock = 65536
[    3.323120] SGI XFS with ACLs, security attributes, no debug enabled
[    3.329005] bounce: pool size: 64 pages
[    3.329102] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
[    3.329254] io scheduler noop registered
[    3.329272] io scheduler deadline registered
[    3.329535] io scheduler cfq registered (default)
[    3.329553] io scheduler mq-deadline registered
[    3.329567] io scheduler kyber registered
[    3.376099] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    3.377659] console [ttyS0] disabled
[    3.397882] 11004000.serial: ttyS0 at MMIO 0x11004000 (irq = 194, base_baud = 1625000) is a ST16650V2
[    4.216423] console [ttyS0] enabled
[    4.231928] brd: module loaded
[    4.242184] loop: module loaded
[    4.260026] mt6323-regulator mt6323-regulator: Chip ID = 0x2023
[    4.273372] SCSI Media Changer driver v0.25 
[    4.278857] Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
[    4.286954] libphy: Fixed MDIO Bus: probed
[    4.291560] PPP generic driver version 2.4.2
[    4.296053] PPP BSD Compression module registered
[    4.300731] PPP Deflate Compression module registered
[    4.305793] PPP MPPE Compression module registered
[    4.310551] NET: Registered protocol family 24
[    4.315031] usbcore: registered new interface driver asix
[    4.320456] usbcore: registered new interface driver ax88179_178a
[    4.326554] usbcore: registered new interface driver cdc_ether
[    4.332387] usbcore: registered new interface driver smsc95xx
[    4.338152] usbcore: registered new interface driver net1080
[    4.343801] usbcore: registered new interface driver cdc_subset
[    4.349724] usbcore: registered new interface driver zaurus
[    4.355305] usbcore: registered new interface driver cdc_ncm
[    4.361419] xhci-mtk 1a1c0000.usb: 1a1c0000.usb supply vbus not found, using dummy regulator
[    4.369945] xhci-mtk 1a1c0000.usb: fail to get sys_ck
[    4.375312] xhci-mtk 1a240000.usb: 1a240000.usb supply vbus not found, using dummy regulator
[    4.383857] xhci-mtk 1a240000.usb: fail to get sys_ck
[    4.389177] usbcore: registered new interface driver usb-storage
[    4.395173] usbcore: registered new interface driver ums-alauda
[    4.401102] usbcore: registered new interface driver ums-cypress
[    4.407127] usbcore: registered new interface driver ums-datafab
[    4.413127] usbcore: registered new interface driver ums_eneub6250
[    4.419311] usbcore: registered new interface driver ums-freecom
[    4.425302] usbcore: registered new interface driver ums-isd200
[    4.431226] usbcore: registered new interface driver ums-jumpshot
[    4.437316] usbcore: registered new interface driver ums-karma
[    4.443133] usbcore: registered new interface driver ums-onetouch
[    4.449234] usbcore: registered new interface driver ums-realtek
[    4.455226] usbcore: registered new interface driver ums-sddr09
[    4.461142] usbcore: registered new interface driver ums-sddr55
[    4.467060] usbcore: registered new interface driver ums-usbat
[    4.473141] mousedev: PS/2 mouse device common for all mice
[    4.479933] IR NEC protocol handler initialized
[    4.484441] IR RC5(x/sz) protocol handler initialized
[    4.489499] IR RC6 protocol handler initialized
[    4.493998] IR JVC protocol handler initialized
[    4.498507] IR Sony protocol handler initialized
[    4.503090] IR SANYO protocol handler initialized
[    4.507771] IR Sharp protocol handler initialized
[    4.512443] IR MCE Keyboard/mouse protocol handler initialized
[    4.518244] IR XMP protocol handler initialized
[    4.523444] mtk-wdt 10007000.watchdog: Watchdog enabled (timeout=31 sec, nowayout=0)
[    4.531464] device-mapper: uevent: version 1.0.3
[    4.536365] device-mapper: ioctl: 4.37.0-ioctl (2017-09-20) initialised: [email protected]
[    4.606138] mtk-msdc 11240000.mmc: Got CD GPIO
[    4.660908] mmc0: new high speed MMC card at address 0001   <<<<<<<<<< only mmc0 is found
[    4.666991] mmcblk0: mmc0:0001 8WPD3R 7.28 GiB   <<<<<< mmc0 is emmc ~8GB not 32gB
[    4.667372] hidraw: raw HID events driver (C) Jiri Kosina
[    4.667836] usbcore: registered new interface driver usbhid
[    4.667839] usbhid: USB HID core driver
[    4.686688] mmcblk0boot0: mmc0:0001 8WPD3R partition 1 4.00 MiB
[    4.687329] ipip: IPv4 and MPLS over IPv4 tunneling driver
[    4.687846] Initializing XFRM netlink socket
[    4.688324] NET: Registered protocol family 10
[    4.689377] Segment Routing with IPv6
[    4.689432] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    4.690484] NET: Registered protocol family 17
[    4.690567] Key type dns_resolver registered
[    4.690850] ThumbEE CPU extension supported.
[    4.690860] Registering SWP/SWPB emulation handler
[    4.697045] Btrfs loaded, crc32c=crc32c-generic
[    4.697850] Key type encrypted registered
[    4.707383] xhci-mtk 1a1c0000.usb: 1a1c0000.usb supply vbus not found, using dummy regulator
[    4.707530] xhci-mtk 1a1c0000.usb: fail to get sys_ck
[    4.708163] xhci-mtk 1a240000.usb: 1a240000.usb supply vbus not found, using dummy regulator
[    4.708271] xhci-mtk 1a240000.usb: fail to get sys_ck
[    4.709319] vpa: disabling
[    4.709350] vusb: disabling
[    4.709362] vmc: disabling
[    4.709377] vgp1: disabling
[    4.709406] vcamaf: disabling
[    4.709429] ALSA device list:
[    4.709432]   No soundcards found.
[    4.790028] mmcblk0boot1: mmc0:0001 8WPD3R partition 2 4.00 MiB
[    4.796332] mmcblk0rpmb: mmc0:0001 8WPD3R partition 3 512 KiB
[    4.804913] md: Waiting for all devices to be available before autodetect
[    4.805505] xhci-mtk 1a1c0000.usb: 1a1c0000.usb supply vbus not found, using dummy regulator
[    4.805682] xhci-mtk 1a1c0000.usb: fail to get sys_ck
[    4.806097] xhci-mtk 1a240000.usb: 1a240000.usb supply vbus not found, using dummy regulator
[    4.806186] xhci-mtk 1a240000.usb: fail to get sys_ck
[    4.838515] md: If you don't use raid, use raid=noautodetect
[    4.844767] md: Autodetecting RAID arrays.
[    4.848906] md: autorun ...
[    4.851680] md: ... autorun DONE.
[    4.855145] Waiting for root device /dev/mmcblk1p2...

above no mmc1 is found, so waiting for mmcblk1p2 will be forever

i compared mt7623.dtsi from 4.14 with 4.4.70 (github for bpi-r2)…

4.14:

        mmc0: mmc@11230000 {
                compatible = "mediatek,mt7623-mmc",
                             "mediatek,mt8135-mmc";
                reg = <0 0x11230000 0 0x1000>;
                interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_LOW>;
                clocks = <&pericfg CLK_PERI_MSDC30_0>,
                         <&topckgen CLK_TOP_MSDC30_0_SEL>;
                clock-names = "source", "hclk";
                status = "disabled";
        };

        mmc1: mmc@11240000 {
                compatible = "mediatek,mt7623-mmc",
                             "mediatek,mt8135-mmc";
                reg = <0 0x11240000 0 0x1000>;
                interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_LOW>;
                clocks = <&pericfg CLK_PERI_MSDC30_1>,
                         <&topckgen CLK_TOP_MSDC30_1_SEL>;
                clock-names = "source", "hclk";
                status = "disabled";
        };

4.4.70:

    mmc1: mmc@11240000 {
        compatible = "mediatek,mt2701-mmc";
        reg = <0 0x11240000 0 0x1000>;
        interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_LOW>;
        clocks = <&pericfg CLK_PERI_MSDC30_1>,
             <&clk_null>;
        clock-names = "source", "hclk";
        status = "disabled";
    };

    mmc0: mmc@11230000 {
        compatible = "mediatek,mt2701-mmc";
        reg = <0 0x11230000 0 0x1000>;
        interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_LOW>;
        clocks = <&pericfg CLK_PERI_MSDC30_0>,
             <&topckgen CLK_PERI_MSDC50_3>;
        clock-names = "source", "hclk";
        status = "disabled";
    };

target-adress is the same, so mmc0 and mmc1 should not be swapped

same for bpi*.dts (named mt7623n-bpi-r2.dts in 4.4.70)

&mmc1 {
    pinctrl-names = "default", "state_uhs";
    pinctrl-0 = <&mmc1_pins_default>;
    pinctrl-1 = <&mmc1_pins_uhs>;
    status = "okay";
    bus-width = <4>;
    max-frequency = <50000000>;
    cap-sd-highspeed;
    cd-gpios = <&pio 261 0>;
/*
    wp-gpios = <&pio 29 0>;
*/
    vmmc-supply = <&mt6323_vmch_reg>;
    vqmmc-supply = <&mt6323_vmc_reg>;
};

&mmc0 {
    pinctrl-names = "default", "state_uhs";
    pinctrl-0 = <&mmc0_pins_default>;
    pinctrl-1 = <&mmc0_pins_uhs>;
    status = "okay";
    bus-width = <8>;
    max-frequency = <50000000>;
    cap-mmc-highspeed;
    vmmc-supply = <&mt6323_vemc3v3_reg>;
    vqmmc-supply = <&mt6323_vio18_reg>;
    non-removable;
};

and mt7623n-bananapi-bpi-r2.dts for 4.14-rc5

&mmc0 {
        pinctrl-names = "default", "state_uhs";
        pinctrl-0 = <&mmc0_pins_default>;
        pinctrl-1 = <&mmc0_pins_uhs>;
        status = "okay";
        bus-width = <8>;
        max-frequency = <50000000>;
        cap-mmc-highspeed;
        vmmc-supply = <&mt6323_vemc3v3_reg>;
        vqmmc-supply = <&mt6323_vio18_reg>;
        non-removable;
};

&mmc1 {
        pinctrl-names = "default", "state_uhs";
        pinctrl-0 = <&mmc1_pins_default>;
        pinctrl-1 = <&mmc1_pins_uhs>;
        status = "okay";
        bus-width = <4>;
        max-frequency = <50000000>;
        cap-sd-highspeed;
        cd-gpios = <&pio 261 0>;
        vmmc-supply = <&mt6323_vmch_reg>;
        vqmmc-supply = <&mt6323_vio18_reg>;  <<<<<< that differs, changed "vqmmc-supply = <&mt6323_vmc_reg>;" from 4.4.70...but same result...waiting for root device
};

@Ryder.Lee can you give me your uEnv.txt or where and how did you created the root-ramdisk? Where in defconfig is root-on-ramdisk defined (to replace by my value in your defconfig)? Or look if both mmc are detected after booting (looked in your bootlog, but maybe you have not a sd-card inserted).

ramfs seems to build in kernel using that line (that one give the problems because i have not that file):

CONFIG_INITRAMFS_SOURCE="../prebuilt/bootable/7623_loader/rootfs_ttys0_rng.cpio.gz"

https://drive.google.com/open?id=0B_sRwHnvOE9MYWdaZC1IQVZJdHl6RVd4UzQxOEFCenJkaVNJ

thank you, but it seems not enough to build this into kernel and changing uEnv.txt root=/dev/ram

i’ve nothing in bootlog where the build-in gz-file is unpacked to

what must also be done? create ramdisk? unpacking to ramdisk?

googled around, but find nothing useful information about initializing and using the ramdisk with uEnv.txt

uEnv.txt (818 Bytes)

I didn’t use so called “uEnv.txt”, and I guess that is something like “CONFIG_CMDLINE” in config. Actually, all you need to do is create a correct config and put your rootfs into right place.

BTW, I booted my R2 from emmc.

(e.g. CONFIG_INITRAMFS_SOURCE="…/prebuilt/bootable/7623_loader/rootfs_ttys0_rng.cpio.gz").

uEnv.txt is config for uboot-bootloader. Here you can define location of rootfs,bootargs etc. do you use uboot? Kernel is located at emmc?

Have you access to sd-card with your 14.4-kernel?

Does your defconfig create the ramdisk?

CONFIG_CMDLINE="earlyprintk console=ttyS0,115200 vmalloc=496M debug=7 no_console_suspend"

Maybe defconfig overwrites anything…

Do you enter something in bootloader-shell or config?

Well… there are so many ways to do the same thing. Yes, I use uboot and locate kernel at emmc…

I’ve only tested SD card with v4.13, but I think v4.14 should be OK.

Does your defconfig create the ramdisk? => What is your mean “create”? The rootfs I gave you is a simple initramfs, so just edit its relative path in your defconfig. Or, you can take my defconfig as a reference.

I’ve used your defconfig with your ramfs-gz (path changed).

i don’t know how it works exactly…does kernel create the ramdisk,unpack the gz and use it wotout any directive in bootloader?

i thought,i must say the bootloader: “create ramdisk at /dev/ram0 with size xx mb,unpack the ramfs and use it as rootfs”

  1. Ramfs should be included in your uImage
  2. Uboot unpack entire image.
  3. Kernel extract the rootfs.

Please refer to the below links:

https://www.kernel.org/doc/Documentation/filesystems/ramfs-rootfs-initramfs.txt

https://wiki.gentoo.org/wiki/Custom_Initramfs

As Ryder said in another reply: you should assign the location where the prebuilt ramdisk is. And note the following the config are being picked up. The kernel will unpack the archive and use the compression you have added the support in your config file. CONFIG_BLK_DEV_INITRD=y CONFIG_INITRAMFS_SOURCE=“your path directed to rootfs.cpio.gz/rootfs.cpio.gz” CONFIG_INITRAMFS_ROOT_UID=0 CONFIG_INITRAMFS_ROOT_GID=0 CONFIG_RD_GZIP=y

as i said, i’m used ryderless defconfig+initramfs gz

tried to boot without uEnv.txt (renamed)

seems root-partition is fixed in uBoot (using uboot from github) [ 4.845122] VFS: Cannot open root device “mmcblk0p2” or unknown-block(179,2): error -6

boot from sd without uenv.txt (22,5 KB)

can’t see anything where uboot/kernel unpacking the initramfs

[    0.000000] Kernel command line: board=bpi-r2 earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200 vmalloc=496M debug=7 initcall_debug=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait

kernelcommand line is also not that from the kernel-Config, maybe i have to tell uboot to use the kernel-CMDLine

in menuconfig i found 2 options seem contradicting:

  │ │   Kernel command line type (Use bootloader kernel arguments if available)  --->    │ │  
  │ │      (earlyprintk console=ttyS0,115200 vmalloc=496M debug=7 no_console_suspend) Default kernel command string     │ │  
  │ │    Kernel command line type (Always use the default kernel command string)  --->  |  |   

first option can also have this option: “( ) Extend with bootloader kernel arguments”, only second Kernel command line have the “always use kernel command line”

first kernel command line belongs to “[X] Supplement the appended DTB with traditional ATAG information” (have now disabled that, kernel before has this enabled)

Can this be an option (to prevent bootloader setting rootfs-option):

 Symbol: INITRAMFS_FORCE [=n]                                                                                                                                                                  │  
  │ Type  : boolean                                                                                                                                                                               │  
  │ Prompt: Ignore the initramfs passed by the bootloader                                                                                                                                         │  
  │   Location:                                                                                                                                                                                   │  
  │     -> General setup                                                                                                                                                                          │  
  │ (8)   -> Initial RAM filesystem and RAM disk (initramfs/initrd) support (BLK_DEV_INITRD [=y])                                                                                                 │  
  │   Defined at usr/Kconfig:24                                                                                                                                                                   │  
  │   Depends on: BLK_DEV_INITRD [=y] && (CMDLINE_EXTEND [=n] || CMDLINE_FORCE [=y])

with that option (or without the other) the kernel boots full in ramdisk:

goodman48 login:

full bootlog: bootlog_with_forced_ramfs.txt (11,9 KB)

so here can you see, that no mmc1 is found

@ryder, can you give me the login-Data so i can work in ramdisk (look wha mmc1 is not found, ls /dev, ,etc)