Jump to content

S905 failed to boot from emmc


pista

Recommended Posts

Hello Armbian team. 1st I would like to thank everyone for your great work.
I've been using a Minix TV box with Armbian 5.41 (kernel 3.14) for many years. Recently I have decide to try Mr. balbes150 build. The system works perfectly from SD, but after installing to emmc the boot process fails to load OS. I would be thankful if someone could point to the right direction.

 

[1] Hardware:

Minix Neo U1 ... S905, 2GB RAM / 16GB Flash. Emmc is Toshiba THGBMFG7C1LBAIL (AFAIK same as Samsung KLMAG2GEND-B031).

 

[2] Software:
Armbian_20.10_Arm-64_bullseye_current_5.9.0.img.xz
Using DTB  meson-gxbb-vega-s95-meta.dtb

Here is my extlinux.conf:
 

LABEL Armbian
LINUX /zImage
INITRD /uInitrd

FDT /dtb/amlogic/meson-gxbb-vega-s95-meta.dtb
APPEND root=LABEL=ROOTFS rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0


To install I run the install-aml-s905-emmc.sh. The only change I made is to replace u-boot.ext in /boot on SD, and the one installed in emmc (/dev/mmcblk1p1) with the one from Mr. hexdump which has serial support enabled, so I could capture the u-boot process info. Both versions - the one in distro from Mr. balbes150, and the one from Mr. hexdump are the same but the later has the serial enabled. Both version produce the same error.

[3] The problem:

Booting from SD has no problems. The process uses the original Amlogic U-Boot "2015".
During booting from EMMC the Amlogic U-BOOT correctly transitions to the new U-BOOT "2020", but that one fails to load the rest of the system,. This where I need some help.

Here is the serial log og a good boot from SD:
 

Boot from SD:
--------------

exit_reason:0x06
set vddee to 0x03e8mv
Enter ddr resume
pub training time: 2630
ddr resume done
store restore gp0 pll
cfg15 3b0d000 
cfg15 63b0d000 
GXBB:BL1:08dafd:0a8993;FEAT:EDFC318C;POC:3;RCY:0;EMMC:0;READ:0;CHK:0;
no sdio debug board detected 
TE: 71706

BL2 Built : 12:06:06, Jun 13 2016. 
gxb g176ecdb - laiyin.mo@droid12-sz

set vcck to 1100 mv
set vddee to 1000 mv
Board ID = 1
CPU clk: 1536MHz
DDR chl: Rank0+1 same @ 792MHz
DDR0: 1024MB(auto)-2T-11
DataBus test pass!
AddrBus test pass!
-s
Load fip header from eMMC, src: 0x0000c000, des: 0x01400000, size: 0x00004000
New fip structure!
Load bl30 from eMMC, src: 0x00010000, des: 0x01000000, size: 0x0000d460
Sending bl30......................................................OK. 
Run bl30...
Load bl31 from eMMC, src: 0x00020000, des: 0x1010[0000, size: 0x00013140
Image: gxb_v1.1.3134-b387442 2016-06-16 14:48:44 yun.cai@droid06]
OPS=0x13
d4 13 d6 d1 28 0 66 3 d 34 7f 3b [0.15Load bl33 from eMMC, src: 0x00034000, des: 0x01000000, size: 0x0006af00
8213 Inits done]
secure task start!
high task start!
low task start!
NOTICE:  BL3-1: v1.0(debug):c813a61
NOTICE:  BL3-1: Built : 14:47:05, Jun 16 2016
INFO:    BL3-1: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader
ERROR:   Error initializing runtime service opteed_fast
INFO:    BL3-1: Preparing for EL3 exit to normal world
INFO:    BL3-1: Next image address = 0x1000000
INFO:    BL3-1: Next image spsr = 0x3c9


U-Boot 2015.01-00018-g6c5824b-dirty (Oct 12 2017 - 18:36:33)

DRAM:  1 GiB
Relocation Offset is: 36f3b000
register usb cfg[1][0] = 0000000037f96ac0
register usb cfg[0][1] = 0000000037f96ae0
register usb cfg[2][0] = 0000000037f96b00
vpu: error: vpu: check dts: FDT_ERR_BADMAGIC, load default parameters
vpu: clk_level = 7
vpu: set clk: 666667000Hz, readback: 666660000Hz(0x300)
MMC:   SDIO Port C: 0, SDIO Port B: 1
emmc/sd response timeout, cmd8, status=0x3ff2800
emmc/sd response timeout, cmd55, status=0x3ff2800
[mmc_startup] mmc refix success
[mmc_init] mmc init success
In:    serial
Out:   serial
Err:   serial
reboot_mode=watchdog_reboot
hpd_state=1
[1080p60hz] is invalid for cvbs.
set hdmitx VIC = 16
config HPLL = 2970
HPLL: 0xc800023d
config HPLL done
j = 4  vid_clk_div = 1
hdmitx phy setting done
hdmitx: set enc for VIC: 16
enc_vpu_bridge_reset[1162]
rx version is 1.4 or below  div=10
Net:   Meson_Ethernet
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
[OSD]check dts: FDT_ERR_BADMAGIC, load default fb_addr parameters
[OSD]fb_addr for logo: 0x3d800000
[OSD]check dts: FDT_ERR_BADMAGIC, load default fb_addr parameters
[OSD]fb_addr for logo: 0x3d800000
[CANVAS]addr=0x3d800000 width=5760, height=2160

Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
There is no valid bmp file at the given address
Hit Enter or space or Ctrl+C key to stop autoboot -- :  0 
Device: SDIO Port C
Manufacturer ID: 11
OEM: 100
Name: 016G7 
Tran Speed: 52000000
Rd Block Len: 512
MMC version 5.0
High Capacity: Yes
Capacity: 14.7 GiB
mmc clock: 40000000
Bus Width: 8-bit DDR
reading s905_autoscript
537 bytes read in 2 ms (261.7 KiB/s)
## Executing script at 01020000
start amlogic old u-boot
## Error: "bootfromsd" not defined
reading boot_android
** Unable to read file boot_android **
** Bad device usb 0 **
reading u-boot.ext
609247 bytes read in 11 ms (52.8 MiB/s)
## Starting application at 0x01000000 ...
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 5.9.0-arm-64 (root@vbox) (aarch64-none-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10)) 9.2.1 20191025, GNU ld (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10)) 2.33.1.20191209) #20.10 SMP PREEMPT Wed Oct 14 12:04:42 MSK 2020
[    0.000000] Machine model: Tronsmart Vega S95 Pro
[    0.000000] efi: UEFI not found.
[    0.000000] [Firmware Bug]: Kernel image misaligned at boot, please fix your bootloader!
[    0.000000] Reserved memory: created CMA memory pool at 0x000000002b400000, size 256 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] NUMA: No NUMA configuration found
[    0.000000] NUMA: Faking a node at [mem 0x0000000001000000-0x000000003f934fff]
[    0.000000] NUMA: NODE_DATA [mem 0x3f72b100-0x3f72cfff]
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000001000000-0x000000003f934fff]
[    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 0x0000000001000000-0x0000000004ffffff]
[    0.000000]   node   0: [mem 0x0000000007300000-0x000000000fffffff]
[    0.000000]   node   0: [mem 0x0000000010200000-0x000000003f934fff]
[    0.000000] Zeroed struct page in unavailable ranges: 203 pages
[    0.000000] Initmem setup node 0 [mem 0x0000000001000000-0x000000003f934fff]
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv0.2 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: Trusted OS migration not required
[    0.000000] percpu: Embedded 22 pages/cpu s51480 r8192 d30440 u90112
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: detected: ARM erratum 845719
[    0.000000] CPU features: detected: ARM erratum 843419
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 242832
[    0.000000] Policy zone: DMA
[    0.000000] Kernel command line: root=LABEL=ROOTFS rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0
[    0.000000] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    0.000000] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 666780K/987348K available (16188K kernel code, 1308K rwdata, 6464K rodata, 3392K init, 927K bss, 58424K reserved, 262144K cma-reserved)
[    0.000000] random: get_random_u64 called from cache_random_seq_create+0x80/0x150 with crng_init=0
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
[    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=4
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] GIC: Using split EOI/Deactivate mode
[    0.000000] irq_meson_gpio: 133 to 8 gpio interrupt mux initialized
[    0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[    0.000003] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[    0.000243] Console: colour dummy device 80x25
[    0.000570] printk: console [tty0] enabled
[    0.000640] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=96000)
[    0.000656] pid_max: default: 32768 minimum: 301
[    0.000739] LSM: Security Framework initializing
[    0.000817] AppArmor: AppArmor initialized
[    0.000863] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.000881] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.002078] rcu: Hierarchical SRCU implementation.
[    0.002795] EFI services will not be available.
[    0.002955] smp: Bringing up secondary CPUs ...
[    0.003365] Detected VIPT I-cache on CPU1
[    0.003417] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.003812] Detected VIPT I-cache on CPU2
[    0.003839] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[    0.004277] Detected VIPT I-cache on CPU3
[    0.004296] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[    0.004340] smp: Brought up 1 node, 4 CPUs
[    0.004361] SMP: Total of 4 processors activated.
[    0.004369] CPU features: detected: 32-bit EL0 Support
[    0.004378] CPU features: detected: CRC32 instructions
[    0.012620] CPU: All CPU(s) started at EL2
[    0.012669] alternatives: patching kernel code
[    0.013518] devtmpfs: initialized
[    0.017907] Registered cp15_barrier emulation handler
[    0.017933] Registered setend emulation handler
[    0.017944] KASLR disabled due to lack of seed
[    0.018167] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.018189] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.024086] xor: measuring software checksum speed
[    0.064108]    8regs     :  3037.000 MB/sec
[    0.104134]    32regs    :  3486.000 MB/sec
[    0.144166]    arm64_neon:  2957.000 MB/sec
[    0.144174] xor: using function: 32regs (3486.000 MB/sec)
[    0.144223] pinctrl core: initialized pinctrl subsystem
[    0.144681] DMI not present or invalid.
[    0.145064] NET: Registered protocol family 16
[    0.146296] DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations
[    0.146369] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    0.146450] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.146526] audit: initializing netlink subsys (disabled)
[    0.146655] audit: type=2000 audit(0.144:1): state=initialized audit_enabled=0 res=1
[    0.147474] thermal_sys: Registered thermal governor 'step_wise'
[    0.147670] cpuidle: using governor ladder
[    0.147697] cpuidle: using governor menu
[    0.147958] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.148029] ASID allocator initialised with 65536 entries
[    0.148587] Serial: AMBA PL011 UART driver
[    0.168526] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
[    0.168549] HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages
[    0.168559] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    0.168568] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
[    0.169999] cryptd: max_cpu_qlen set to 1000
[    0.240277] raid6: neonx8   gen()  2746 MB/s
[    0.308318] raid6: neonx8   xor()  2058 MB/s
[    0.376360] raid6: neonx4   gen()  2812 MB/s
[    0.444408] raid6: neonx4   xor()  2035 MB/s
[    0.512450] raid6: neonx2   gen()  2666 MB/s
[    0.580495] raid6: neonx2   xor()  1894 MB/s
[    0.648543] raid6: neonx1   gen()  2330 MB/s
[    0.716586] raid6: neonx1   xor()  1599 MB/s
[    0.784631] raid6: int64x8  gen()  1908 MB/s
[    0.852694] raid6: int64x8  xor()  1004 MB/s
[    0.920722] raid6: int64x4  gen()  2126 MB/s
[    0.988772] raid6: int64x4  xor()  1073 MB/s
[    1.056819] raid6: int64x2  gen()  1811 MB/s
[    1.124853] raid6: int64x2  xor()   935 MB/s
[    1.192903] raid6: int64x1  gen()  1354 MB/s
[    1.260941] raid6: int64x1  xor()   716 MB/s
[    1.260949] raid6: using algorithm neonx4 gen() 2812 MB/s
[    1.260956] raid6: .... xor() 2035 MB/s, rmw enabled
[    1.260964] raid6: using neon recovery algorithm
[    1.261389] ACPI: Interpreter disabled.
[    1.261809] HDMI_P5V0: supplied by P5V0
[    1.262590] iommu: Default domain type: Translated 
[    1.262775] vgaarb: loaded
[    1.263237] SCSI subsystem initialized
[    1.263544] usbcore: registered new interface driver usbfs
[    1.263577] usbcore: registered new interface driver hub
[    1.263628] usbcore: registered new device driver usb
[    1.263885] pps_core: LinuxPPS API ver. 1 registered
[    1.263894] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    1.263913] PTP clock support registered
[    1.263943] EDAC MC: Ver: 3.0.0
[    1.264443] FPGA manager framework
[    1.264509] Advanced Linux Sound Architecture Driver Initialized.
[    1.264937] NetLabel: Initializing
[    1.264946] NetLabel:  domain hash size = 128
[    1.264952] NetLabel:  protocols = UNLABELED CIPSOv4 CALIPSO
[    1.264997] NetLabel:  unlabeled traffic allowed by default
[    1.265367] clocksource: Switched to clocksource arch_sys_counter
[    1.265556] VFS: Disk quotas dquot_6.6.0
[    1.265600] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    1.265680] FS-Cache: Loaded
[    1.266087] AppArmor: AppArmor Filesystem Enabled
[    1.266637] pnp: PnP ACPI: disabled
[    1.270756] NET: Registered protocol family 2
[    1.271179] tcp_listen_portaddr_hash hash table entries: 512 (order: 1, 8192 bytes, linear)
[    1.271209] TCP established hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    1.271263] TCP bind hash table entries: 8192 (order: 5, 131072 bytes, linear)
[    1.271362] TCP: Hash tables configured (established 8192 bind 8192)
[    1.271475] UDP hash table entries: 512 (order: 2, 16384 bytes, linear)
[    1.271504] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes, linear)
[    1.271635] NET: Registered protocol family 1
[    1.271946] RPC: Registered named UNIX socket transport module.
[    1.271956] RPC: Registered udp transport module.
[    1.271964] RPC: Registered tcp transport module.
[    1.271971] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.271983] NET: Registered protocol family 44
[    1.271996] PCI: CLS 0 bytes, default 64
[    1.272152] Trying to unpack rootfs image as initramfs...
[    1.591979] Freeing initrd memory: 9608K
[    1.592768] hw perfevents: enabled with armv8_cortex_a53 PMU driver, 7 counters available
[    1.594415] Initialise system trusted keyrings
[    1.594547] workingset: timestamp_bits=44 max_order=18 bucket_order=0
[    1.598396] zbud: loaded
[    1.599443] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    1.599673] FS-Cache: Netfs 'nfs' registered for caching
[    1.600094] NFS: Registering the id_resolver key type
[    1.600122] Key type id_resolver registered
[    1.600130] Key type id_legacy registered
[    1.600200] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.600211] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[    1.600959] FS-Cache: Netfs 'cifs' registered for caching
[    1.601154] Key type cifs.spnego registered
[    1.601168] Key type cifs.idmap registered
[    1.601180] ntfs: driver 2.1.32 [Flags: R/W].
[    1.601644] JFS: nTxBlock = 7332, nTxLock = 58658
[    1.606689] SGI XFS with ACLs, security attributes, realtime, quota, no debug enabled
[    1.607912] ocfs2: Registered cluster interface o2cb
[    1.608036] OCFS2 User DLM kernel interface loaded
[    1.609294] gfs2: GFS2 installed
[    1.638756] NET: Registered protocol family 38
[    1.638779] Key type asymmetric registered
[    1.638788] Asymmetric key parser 'x509' registered
[    1.638796] Asymmetric key parser 'pkcs8' registered
[    1.638832] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245)
[    1.638943] io scheduler mq-deadline registered
[    1.638952] io scheduler kyber registered
[    1.639041] io scheduler bfq registered
[    1.649796] soc soc0: Amlogic Meson GXBB (S905) Revision 1f:c (13:1) Detected
[    1.652917] Serial: 8250/16550 driver, 5 ports, IRQ sharing enabled
[    1.654366] Serial: AMBA driver
[    1.654679] c11084c0.serial: ttyAML6 at MMIO 0xc11084c0 (irq = 12, base_baud = 1500000) is a meson_uart
[    1.654794] serial serial0: tty port ttyAML6 registered
[    1.655077] c81004c0.serial: ttyAML0 at MMIO 0xc81004c0 (irq = 15, base_baud = 1500000) is a meson_uart
[    2.723248] printk: console [ttyAML0] enabled
[    2.737247] brd: module loaded
[    2.743064] loop: module loaded
[    2.743720] Loading iSCSI transport class v2.0-870.
[    2.745936] iscsi: registered transport (tcp)
[    2.752547] libphy: Fixed MDIO Bus: probed
[    2.755832] VFIO - User Level meta-driver version: 0.3
[    2.759842] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    2.765383] ehci-pci: EHCI PCI platform driver
[    2.769780] ehci-platform: EHCI generic platform driver
[    2.775022] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    2.781064] ohci-pci: OHCI PCI platform driver
[    2.785472] ohci-platform: OHCI generic platform driver
[    2.790966] usbcore: registered new interface driver usb-storage
[    2.796716] mousedev: PS/2 mouse device common for all mice
[    2.802705] i2c /dev entries driver
[    2.808475] sdhci: Secure Digital Host Controller Interface driver
[    2.811677] sdhci: Copyright(c) Pierre Ossman
[    2.816097] Synopsys Designware Multimedia Card Interface Driver
[    2.826042] meson-gx-mmc d0072000.mmc: Got CD GPIO
[    2.853688] meson-gx-mmc d0074000.mmc: allocated mmc-pwrseq
[    2.881014] sdhci-pltfm: SDHCI platform and OF driver helper
[    2.881911] ledtrig-cpu: registered to indicate activity on CPUs
[    2.887410] meson-sm: secure-monitor enabled
[    2.891706] hid: raw HID events driver (C) Jiri Kosina
[    2.894108] mmc0: new high speed SDHC card at address aaaa
[    2.896689] usbcore: registered new interface driver usbhid
[    2.902546] mmcblk0: mmc0:aaaa SC16G 14.8 GiB 
[    2.907285] usbhid: USB HID core driver
[    2.916300] platform-mhu c883c404.mailbox: Platform MHU Mailbox registered
[    2.916837]  mmcblk0: p1 p2
[    2.927740] no UART detected at 0x1
[    2.931337] NET: Registered protocol family 17
[    2.933081] Key type dns_resolver registered
[    2.937569] registered taskstats version 1
[    2.941164] Loading compiled-in X.509 certificates
[    2.946021] zswap: loaded using pool lzo/zbud
[    2.950428] Key type ._fscrypt registered
[    2.954192] Key type .fscrypt registered
[    2.958068] Key type fscrypt-provisioning registered
[    2.963580] Btrfs loaded, crc32c=crc32c-generic
[    2.980342] Key type encrypted registered
[    2.980388] AppArmor: AppArmor sha1 policy hashing enabled
[    2.998283] meson-drm d0100000.vpu: Queued 2 outputs on vpu
[    2.998779] meson-drm d0100000.vpu: CVBS Output connector not available
[    3.028822] mmc1: new HS200 MMC card at address 0001
[    3.029424] meson-dw-hdmi c883a000.hdmi-tx: Detected HDMI TX controller v2.01a with HDCP (meson_dw_hdmi_phy)
[    3.029516] mmcblk1: mmc1:0001 016G70 14.7 GiB 
[    3.038358] meson-dw-hdmi c883a000.hdmi-tx: registered DesignWare HDMI I2C bus driver
[    3.042757] mmcblk1boot0: mmc1:0001 016G70 partition 1 4.00 MiB
[    3.050951] meson-drm d0100000.vpu: bound c883a000.hdmi-tx (ops meson_dw_hdmi_ops)
[    3.056395] mmcblk1boot1: mmc1:0001 016G70 partition 2 4.00 MiB
[    3.063966] [drm] Initialized meson 1.0.0 20161109 for d0100000.vpu on minor 0
[    3.069502] mmcblk1rpmb: mmc1:0001 016G70 partition 3 4.00 MiB, chardev (241:0)
[    3.085792]  mmcblk1: p1 p2
[    3.150936] random: fast init done
[    3.386060] Console: switching to colour frame buffer device 210x65
[    3.402543] meson-drm d0100000.vpu: [drm] fb0: mesondrmfb frame buffer device
[    3.410712] meson8b-dwmac c9410000.ethernet: IRQ eth_wake_irq not found
[    3.416180] meson8b-dwmac c9410000.ethernet: IRQ eth_lpi not found
[    3.422427] meson8b-dwmac c9410000.ethernet: PTP uses main clock
[    3.428250] meson8b-dwmac c9410000.ethernet: no reset control found
[    3.435138] meson8b-dwmac c9410000.ethernet: User ID: 0x11, Synopsys ID: 0x37
[    3.441548] meson8b-dwmac c9410000.ethernet:         DWMAC1000
[    3.446705] meson8b-dwmac c9410000.ethernet: DMA HW capability register supported
[    3.454120] meson8b-dwmac c9410000.ethernet: RX Checksum Offload Engine supported
[    3.461541] meson8b-dwmac c9410000.ethernet: COE Type 2
[    3.466712] meson8b-dwmac c9410000.ethernet: TX Checksum insertion supported
[    3.473704] meson8b-dwmac c9410000.ethernet: Wake-Up On Lan supported
[    3.480136] meson8b-dwmac c9410000.ethernet: Normal descriptors
[    3.485947] meson8b-dwmac c9410000.ethernet: Ring mode enabled
[    3.491728] meson8b-dwmac c9410000.ethernet: Enable RX Mitigation via HW Watchdog Timer
[    3.499662] meson8b-dwmac c9410000.ethernet: device MAC address 32:b2:a9:c7:f4:e6
[    3.507470] libphy: stmmac: probed
[    3.614802] dwc2 c9000000.usb: supply vusb_d not found, using dummy regulator
[    3.616495] dwc2 c9000000.usb: supply vusb_a not found, using dummy regulator
[    3.624723] phy phy-c0000000.phy.0: USB ID detect failed!
[    3.628827] phy phy-c0000000.phy.0: phy poweron failed --> -22
[    3.634670] ------------[ cut here ]------------
[    3.639175] WARNING: CPU: 0 PID: 34 at drivers/regulator/core.c:2089 _regulator_put.part.0+0x154/0x160
[    3.648391] Modules linked in:
[    3.651413] CPU: 0 PID: 34 Comm: kworker/0:1 Not tainted 5.9.0-arm-64 #20.10
[    3.658396] Hardware name: Tronsmart Vega S95 Pro (DT)
[    3.663494] Workqueue: events deferred_probe_work_func
[    3.668576] pstate: 80000005 (Nzcv daif -PAN -UAO BTYPE=--)
[    3.674095] pc : _regulator_put.part.0+0x154/0x160
[    3.678838] lr : regulator_put+0x38/0x50
[    3.682718] sp : ffff80001014bae0
[    3.685995] x29: ffff80001014bae0 x28: ffff800012a07000 
[    3.691257] x27: ffff80001004bcd8 x26: ffff00003dd528c8 
[    3.696518] x25: ffff800012aeb700 x24: ffff00003ddf2c00 
[    3.701779] x23: 0000000000000008 x22: ffff80001014bbb8 
[    3.707041] x21: ffff00003dd15400 x20: ffff800012ad7150 
[    3.712302] x19: ffff000029e75f00 x18: 0000000000000010 
[    3.717563] x17: 0000000000000001 x16: 0000000000000000 
[    3.722824] x15: 0000000000aaaaaa x14: 0000000000000020 
[    3.728086] x13: 00000000ffffffff x12: ffffffffffffffff 
[    3.733347] x11: 0000000000000040 x10: 0000000000000007 
[    3.738608] x9 : 00000000ffffffff x8 : ffffffffffffffe0 
[    3.743869] x7 : ffffffffffffffff x6 : ffffffffffffffff 
[    3.749131] x5 : 0000000000000000 x4 : 0000000000000000 
[    3.754392] x3 : ffff800012ad7520 x2 : ffff00003dd15400 
[    3.759653] x1 : 0000000000000000 x0 : 0000000000000001 
[    3.764915] Call trace:
[    3.768099]  _regulator_put.part.0+0x154/0x160
[    3.771730]  regulator_put+0x38/0x50
[    3.775267]  regulator_bulk_free+0x38/0x58
[    3.779321]  devm_regulator_bulk_release+0x1c/0x28
[    3.784065]  release_nodes+0x1b0/0x228
[    3.787773]  devres_release_all+0x38/0x60
[    3.791740]  really_probe+0x1d8/0x3b0
[    3.795363]  driver_probe_device+0x58/0xb8
[    3.799416]  __device_attach_driver+0x84/0xc8
[    3.803730]  bus_for_each_drv+0x78/0xc8
[    3.807524]  __device_attach+0xf0/0x150
[    3.811319]  device_initial_probe+0x14/0x20
[    3.815459]  bus_probe_device+0x9c/0xa8
[    3.819255]  deferred_probe_work_func+0x74/0xb0
[    3.823742]  process_one_work+0x1a0/0x328
[    3.827706]  worker_thread+0x1f8/0x420
[    3.831416]  kthread+0x140/0x160
[    3.834608]  ret_from_fork+0x10/0x34
[    3.838142] ---[ end trace 53dcfd993148bc4f ]---
[    3.842869] ------------[ cut here ]------------
[    3.847287] WARNING: CPU: 0 PID: 34 at drivers/regulator/core.c:2089 _regulator_put.part.0+0x154/0x160
[    3.856511] Modules linked in:
[    3.859534] CPU: 0 PID: 34 Comm: kworker/0:1 Tainted: G        W         5.9.0-arm-64 #20.10
[    3.867897] Hardware name: Tronsmart Vega S95 Pro (DT)
[    3.872990] Workqueue: events deferred_probe_work_func
[    3.878076] pstate: 80000005 (Nzcv daif -PAN -UAO BTYPE=--)
[    3.883597] pc : _regulator_put.part.0+0x154/0x160
[    3.888340] lr : regulator_put+0x38/0x50
[    3.892219] sp : ffff80001014bae0
[    3.895497] x29: ffff80001014bae0 x28: ffff800012a07000 
[    3.900758] x27: ffff80001004bcd8 x26: ffff00003dd528c8 
[    3.906019] x25: ffff800012aeb700 x24: ffff00003ddf2c00 
[    3.911281] x23: 0000000000000008 x22: ffff80001014bbb8 
[    3.916542] x21: ffff00003dd15400 x20: ffff800012ad7150 
[    3.921803] x19: ffff000029e75000 x18: 0000000000000010 
[    3.927064] x17: 0000000000000001 x16: 0000000000000000 
[    3.932325] x15: 0000000000000004 x14: 0000000000000020 
[    3.937587] x13: 0000000000000000 x12: ffff00003f0ada38 
[    3.942848] x11: ffff00003f0ad918 x10: ffff00000733b698 
[    3.948109] x9 : ffff00000733b690 x8 : 0000000000000001 
[    3.953370] x7 : 0000000000000001 x6 : ffff00003f058900 
[    3.958632] x5 : ffff00000732c8f8 x4 : 0000000000000000 
[    3.963893] x3 : ffff800012ad7520 x2 : ffff00003dd15400 
[    3.969154] x1 : 0000000000000000 x0 : 0000000000000001 
[    3.974415] Call trace:
[    3.976971]  _regulator_put.part.0+0x154/0x160
[    3.981231]  regulator_put+0x38/0x50
[    3.984768]  regulator_bulk_free+0x38/0x58
[    3.988822]  devm_regulator_bulk_release+0x1c/0x28
[    3.993565]  release_nodes+0x1b0/0x228
[    3.997274]  devres_release_all+0x38/0x60
[    4.001241]  really_probe+0x1d8/0x3b0
[    4.004863]  driver_probe_device+0x58/0xb8
[    4.008917]  __device_attach_driver+0x84/0xc8
[    4.013231]  bus_for_each_drv+0x78/0xc8
[    4.017025]  __device_attach+0xf0/0x150
[    4.020820]  device_initial_probe+0x14/0x20
[    4.024961]  bus_probe_device+0x9c/0xa8
[    4.028756]  deferred_probe_work_func+0x74/0xb0
[    4.033241]  process_one_work+0x1a0/0x328
[    4.037207]  worker_thread+0x1f8/0x420
[    4.040917]  kthread+0x140/0x160
[    4.044109]  ret_from_fork+0x10/0x34
[    4.047642] ---[ end trace 53dcfd993148bc50 ]---
[    4.052391] dwc2: probe of c9000000.usb failed with error -22
[    4.058865] dwc2 c9100000.usb: supply vusb_d not found, using dummy regulator
[    4.065085] dwc2 c9100000.usb: supply vusb_a not found, using dummy regulator
[    4.129604] dwc2 c9100000.usb: DWC OTG Controller
[    4.132332] dwc2 c9100000.usb: new USB bus registered, assigned bus number 1
[    4.138380] dwc2 c9100000.usb: irq 39, io mem 0xc9100000
[    4.143740] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.09
[    4.151807] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    4.158969] usb usb1: Product: DWC OTG Controller
[    4.163622] usb usb1: Manufacturer: Linux 5.9.0-arm-64 dwc2_hsotg
[    4.169662] usb usb1: SerialNumber: c9100000.usb
[    4.174641] hub 1-0:1.0: USB hub found
[    4.177959] hub 1-0:1.0: 1 port detected
[    4.183835] meson-gx-mmc d0070000.mmc: allocated mmc-pwrseq
[    4.214759] scpi_protocol scpi: SCP Protocol legacy pre-1.0 firmware
[    4.225686] simple-framebuffer 3f935000.framebuffer: framebuffer at 0x3f935000, 0x6baa80 bytes, mapped to 0x(____ptrval____)
[    4.234465] simple-framebuffer 3f935000.framebuffer: format=x8r8g8b8, mode=1680x1050x32, linelength=6720
[    4.244038] simple-framebuffer 3f935000.framebuffer: fb1: simplefb registered!
[    4.253465] printk: console [netcon0] enabled
[    4.257599] netconsole: network logging started
[    4.261865] ALSA device list:
[    4.262870] mmc2: queuing unknown CIS tuple 0x80 (2 bytes)
[    4.264975]   No soundcards found.
[    4.271289] mmc2: queuing unknown CIS tuple 0x80 (3 bytes)
[    4.280134] mmc2: queuing unknown CIS tuple 0x80 (3 bytes)
[    4.280212] Freeing unused kernel memory: 3392K
[    4.287238] mmc2: queuing unknown CIS tuple 0x80 (7 bytes)
[    4.287943] Run /init as init process
[    4.371901] mmc2: new high speed SDIO card at address 0001
[    4.577431] usb 1-1: new high-speed USB device number 2 using dwc2
[    4.790899] usb 1-1: New USB device found, idVendor=05e3, idProduct=0610, bcdDevice=32.98
[    4.800919] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    4.807792] usb 1-1: Product: USB2.0 Hub
[    4.812757] hub 1-1:1.0: USB hub found
[    4.816332] hub 1-1:1.0: 4 ports detected
[    5.248354] EXT4-fs (mmcblk0p2): mounted filesystem with writeback data mode. Opts: data=writeback
[    6.128347] systemd[1]: System time before build time, advancing clock.
[    6.233703] NET: Registered protocol family 10
[    6.265211] Segment Routing with IPv6
[    6.311618] systemd[1]: systemd 246.2-1 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +ZSTD +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid)
[    6.338737] systemd[1]: Detected architecture arm64.
[    6.411481] systemd[1]: Set hostname to <arm-64>.
[    6.952530] systemd[1]: Queued start job for default target Graphical Interface.
[    6.959474] random: systemd: uninitialized urandom read (16 bytes read)
[    6.967577] systemd[1]: Created slice system-getty.slice.
[    6.976499] random: systemd: uninitialized urandom read (16 bytes read)
[    6.982608] systemd[1]: Created slice system-modprobe.slice.
[    6.991717] random: systemd: uninitialized urandom read (16 bytes read)
[    6.997905] systemd[1]: Created slice system-serial\x2dgetty.slice.
[    7.008755] systemd[1]: Created slice system-systemd\x2dfsck.slice.
[    7.019089] systemd[1]: Created slice User and Session Slice.
[    7.028025] systemd[1]: Condition check resulted in Dispatch Password Requests to Console Directory Watch when bootsplash is active being skipped.
[    7.040173] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[    7.052107] systemd[1]: Condition check resulted in Arbitrary Executable File Formats File System Automount Point being skipped.
[    7.062732] systemd[1]: Reached target Local Encrypted Volumes.
[    7.073296] systemd[1]: Reached target Paths.
[    7.082598] systemd[1]: Reached target Remote File Systems.
[    7.092033] systemd[1]: Reached target Slices.
[    7.101479] systemd[1]: Reached target Swap.
[    7.110943] systemd[1]: Reached target System Time Set.
[    7.120943] systemd[1]: Listening on Syslog Socket.
[    7.130926] systemd[1]: Listening on fsck to fsckd communication Socket.
[    7.141888] systemd[1]: Listening on initctl Compatibility Named Pipe.
[    7.153227] systemd[1]: Listening on Journal Audit Socket.
[    7.163596] systemd[1]: Listening on Journal Socket (/dev/log).
[    7.174266] systemd[1]: Listening on Journal Socket.
[    7.184690] systemd[1]: Listening on udev Control Socket.
[    7.194873] systemd[1]: Listening on udev Kernel Socket.
[    7.208111] systemd[1]: Mounting Huge Pages File System...
[    7.221735] systemd[1]: Mounting POSIX Message Queue File System...
[    7.235892] systemd[1]: Mounting Kernel Debug File System...
[    7.246474] systemd[1]: Condition check resulted in Kernel Trace File System being skipped.
[    7.258577] systemd[1]: Starting Restore / save the current clock...
[    7.273114] systemd[1]: Starting Set the console keyboard layout...
[    7.287363] systemd[1]: Starting Create list of static device nodes for the current kernel...
[    7.300527] systemd[1]: Condition check resulted in Load Kernel Module drm being skipped.
[    7.312037] systemd[1]: Started Nameserver information manager.
[    7.323459] systemd[1]: Reached target Network (Pre).
[    7.338640] systemd[1]: Condition check resulted in Set Up Additional Binary Formats being skipped.
[    7.350066] systemd[1]: Condition check resulted in File System Check on Root Device being skipped.
[    7.364266] systemd[1]: Starting Load Kernel Modules...
[    7.378189] systemd[1]: Starting Remount Root and Kernel File Systems...
[    7.393197] systemd[1]: Starting Coldplug All udev Devices...
[    7.408859] systemd[1]: Mounted Huge Pages File System.
[    7.413986] EXT4-fs (mmcblk0p2): re-mounted. Opts: commit=600,errors=remount-ro
[    7.428475] systemd[1]: Mounted POSIX Message Queue File System.
[    7.439127] systemd[1]: Mounted Kernel Debug File System.
[    7.450342] systemd[1]: Finished Restore / save the current clock.
[    7.462559] systemd[1]: Finished Create list of static device nodes for the current kernel.
[    7.479294] systemd[1]: Finished Load Kernel Modules.
[    7.491408] systemd[1]: Finished Remount Root and Kernel File Systems.
[    7.504192] systemd[1]: Condition check resulted in FUSE Control File System being skipped.
[    7.515752] systemd[1]: Mounting Kernel Configuration File System...
[    7.530618] systemd[1]: Condition check resulted in Rebuild Hardware Database being skipped.
[    7.538817] systemd[1]: Condition check resulted in Platform Persistent Storage Archival being skipped.
[    7.551243] systemd[1]: Starting Load/Save Random Seed...
[    7.565096] systemd[1]: Starting Apply Kernel Variables...
[    7.579180] systemd[1]: Starting Create System Users...
[    7.594236] systemd[1]: Finished Set the console keyboard layout.
[    7.608111] systemd[1]: Mounted Kernel Configuration File System.

Armbian 20.10 Bullseye ttyAML0


arm-64 login: root
Password: 
    _    ____  __  __        __   _  _   
   / \  |  _ \|  \/  |      / /_ | || |  
  / _ \ | |_) | |\/| |_____| '_ \| || |_ 
 / ___ \|  _ <| |  | |_____| (_) |__   _|
/_/   \_\_| \_\_|  |_|      \___/   |_|  
                                         
Welcome to Armbian 20.10 Bullseye with Linux 5.9.0-arm-64

No end-user support: built from trunk & unsupported (bullseye) userspace!

System load:   2%               Up time:       22 min
Memory usage:  11% of 919M      IP:            192.168.2.121
192.168.2.251 192.168.2.240
CPU temp:      44°C            Usage of /:    11% of 14G    

[ General system configuration (beta): armbian-config ]

root@arm-64:~# shutdown now
[ 1384.266963] reboot: Power down
INFO:    PSCI Affinity Map:
INFO:      AffInst: Level 0, MPID 0x0, State ON
INFO:      AffInst: Level 0, MPID 0x1, State ON
INFO:      AffInst: Level 0, MPID 0x2, State ON
INFO:      AffInst: Level 0, MPID 0x3, State ON
bl31 reboot reason: 0xd
bl31 reboot reason: 0xd
system cmd  0.
bl30 get wakeup sources!
process command 00000006
bl30 enter suspend!
store restore gp0 pll
cpu clk suspend rate 1536000000
suspend_counter: 1
Enter ddr suspend
first time suspend
process command 00000001
CEC cfg:0x0000
set vddee to 0x0352mv
0891

 

Here is the log of the failed boot from EMMC:
 

Boot from eMMC:
---------------

GXBB:BL1:08dafd:0a8993;FEAT:EDFC318C;POC:3;RCY:0;EMMC:0;READ:0;CHK:0;
no sdio debug board detected 
TE: 83807

BL2 Built : 12:06:06, Jun 13 2016. 
gxb g176ecdb - laiyin.mo@droid12-sz

set vcck to 1100 mv
set vddee to 1000 mv
Board ID = 1
CPU clk: 1536MHz
DDR chl: Rank0+1 same @ 792MHz
DDR0: 1024MB(auto)-2T-11
DataBus test pass!
AddrBus test pass!
-s
Load fip header from eMMC, src: 0x0000c000, des: 0x01400000, size: 0x00004000
New fip structure!
Load bl30 from eMMC, src: 0x00010000, des: 0x01000000, size: 0x0000d460
Sending bl30......................................................OK. 
Run bl30...
Load bl31 from eMMC, src: 0x00020000, des: 0x1010[000, size: 0x00013140
Image: gxb_v1.1.3134-b387442 2016-06-16 14:48:44 yun.cai@droid06]
OPS=0x13
d4 13 d6 d1 28 0 66 3 d 34 7f 3b [0.17Load bl33 from eMMC, src: 0x00034000, des: 0x01000000, size: 0x0006af00
0236 Inits done]
secure task start!
high task start!
low task start!
NOTICE:  BL3-1: v1.0(debug):c813a61
NOTICE:  BL3-1: Built : 14:47:05, Jun 16 2016
INFO:    BL3-1: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader
ERROR:   Error initializing runtime service opteed_fast
INFO:    BL3-1: Preparing for EL3 exit to normal world
INFO:    BL3-1: Next image address = 0x1000000
INFO:    BL3-1: Next image spsr = 0x3c9


U-Boot 2015.01-00018-g6c5824b-dirty (Oct 12 2017 - 18:36:33)

DRAM:  1 GiB
Relocation Offset is: 36f3b000
register usb cfg[1][0] = 0000000037f96ac0
register usb cfg[0][1] = 0000000037f96ae0
register usb cfg[2][0] = 0000000037f96b00
vpu: error: vpu: check dts: FDT_ERR_BADMAGIC, load default parameters
vpu: clk_level = 7
vpu: set clk: 666667000Hz, readback: 666660000Hz(0x300)
MMC:   SDIO Port C: 0, SDIO Port B: 1
emmc/sd response timeout, cmd8, status=0x3ff2800
emmc/sd response timeout, cmd55, status=0x3ff2800
[mmc_startup] mmc refix success
[mmc_init] mmc init success
In:    serial
Out:   serial
Err:   serial
reboot_mode=cold_boot
hpd_state=1
[1080p60hz] is invalid for cvbs.
set hdmitx VIC = 16
config HPLL = 2970
HPLL: 0xc800023d
config HPLL done
j = 4  vid_clk_div = 1
hdmitx phy setting done
hdmitx: set enc for VIC: 16
enc_vpu_bridge_reset[1162]
rx version is 1.4 or below  div=10
Net:   Meson_Ethernet
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
[OSD]check dts: FDT_ERR_BADMAGIC, load default fb_addr parameters
[OSD]fb_addr for logo: 0x3d800000
[OSD]check dts: FDT_ERR_BADMAGIC, load default fb_addr parameters
[OSD]fb_addr for logo: 0x3d800000
[CANVAS]addr=0x3d800000 width=5760, height=2160

Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
There is no valid bmp file at the given address
Hit Enter or space or Ctrl+C key to stop autoboot -- :  0 
Device: SDIO Port C
Manufacturer ID: 11
OEM: 100
Name: 016G7 
Tran Speed: 52000000
Rd Block Len: 512
MMC version 5.0
High Capacity: Yes
Capacity: 14.7 GiB
mmc clock: 40000000
Bus Width: 8-bit DDR
reading s905_autoscript
537 bytes read in 3 ms (174.8 KiB/s)
## Executing script at 01020000
start amlogic old u-boot
## Error: "bootfromsd" not defined
reading boot_android
** Unable to read file boot_android **
** Bad device usb 0 **
reading u-boot.ext
521171 bytes read in 10 ms (49.7 MiB/s)
## Starting application at 0x01000000 ...


U-Boot 2020.07-dirty (Oct 24 2020 - 21:14:30 +0200) hexdump-gxbb

Model: hexdump serial u-boot gxbb
SoC:   Amlogic Meson GXBB (S905) Revision 1f:c (13:1)
DRAM:  1 GiB
MMC:   mmc@70000: 0, mmc@72000: 1, mmc@74000: 2
In:    serial@4c0
Out:   serial@4c0
Err:   serial@4c0
Net:   
Warning: ethernet@c9410000 (eth0) using random MAC address - 1a:69:e8:d0:6c:88
eth0: ethernet@c9410000
Hit any key to stop autoboot:  0 
Card did not respond to voltage select!
switch to partitions #0, OK
mmc2 is current device
** No partition table - mmc 2 **
Speed: 1000, full duplex
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5
BOOTP broadcast 6
BOOTP broadcast 7
BOOTP broadcast 8
BOOTP broadcast 9
BOOTP broadcast 10

 

Here is some info about /dev/mmcblk1:
 

root@arm-64:~# fdisk -l /dev/mmcblk1
Disk /dev/mmcblk1: 14.68 GiB, 15758000128 bytes, 30777344 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x8509a0e7

Device         Boot   Start      End  Sectors  Size Id Type
/dev/mmcblk1p1        16384  1196031  1179648  576M  b W95 FAT32
/dev/mmcblk1p2      1196032 15235071 14039040  6.7G 83 Linux


root@arm-64:~# e2label /dev/mmcblk1p2
ROOT_EMMC


root@arm-64:~# ls -1 /dev/mmcblk1*
/dev/mmcblk1
/dev/mmcblk1boot0
/dev/mmcblk1boot1
/dev/mmcblk1p1
/dev/mmcblk1p2
/dev/mmcblk1rpmb


root@arm-64:~# lsblk 
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
mmcblk0      179:0    0  14.8G  0 disk 
├─mmcblk0p1  179:1    0   512M  0 part /boot
└─mmcblk0p2  179:2    0  14.2G  0 part /
mmcblk1      179:32   0  14.7G  0 disk 
├─mmcblk1p1  179:33   0   576M  0 part 
└─mmcblk1p2  179:34   0   6.7G  0 part 
mmcblk1boot0 179:64   0     4M  1 disk 
mmcblk1boot1 179:96   0     4M  1 disk 
zram0        254:0    0    50M  0 disk /var/log
zram1        254:1    0 459.9M  0 disk [SWAP]


root@arm-64:~# mount /dev/mmcblk1p1 /mnt/p1
root@arm-64:~# ls -l /mnt/p1
total 55808
-rwxr-xr-x 1 root root     1536 Sep  4 20:16 armbian_first_run.txt.template
-rwxr-xr-x 1 root root    38518 Sep  4 20:16 boot.bmp
-rwxr-xr-x 1 root root   216810 Sep  4 20:16 config-5.9.0-arm-64
drwxr-xr-x 5 root root     4096 Sep  4 20:16 dtb
-rwxr-xr-x 1 root root      174 Sep  4 20:16 emmc_autoscript
drwxr-xr-x 2 root root     4096 Sep  4 20:16 extlinux
-rwxr-xr-x 1 root root  9882610 Sep  4 20:16 initrd.img-5.9.0-arm-64
-rwxr-xr-x 1 root root      537 Sep  4 20:16 s905_autoscript
-rwxr-xr-x 1 root root  5794743 Sep  4 20:16 System.map-5.9.0-arm-64
-rwxr-xr-x 1 root root   609247 Sep  4 20:16 u-boot.emmc
-rwxr-xr-x 1 root root   609247 Sep  4 20:16 u-boot.ext
-rwxr-xr-x 1 root root   609247 Sep  4 20:16 u-boot-s905
-rwxr-xr-x 1 root root   740080 Sep  4 20:16 u-boot-s905x2-s922
-rwxr-xr-x 1 root root   650183 Sep  4 20:16 u-boot-s905x-s912
-rwxr-xr-x 1 root root  9882674 Sep  4 20:16 uInitrd
-rwxr-xr-x 1 root root 28078592 Sep  4 20:16 zImage


root@arm-64:~# mount /dev/mmcblk1p2 /mnt/p2 
root@arm-64:~# ls -l /mnt/p2
total 80
lrwxrwxrwx  1 root root     7 Aug 30  2020 bin -> usr/bin
drwxr-xr-x  2 root root  4096 Sep  4 20:17 dev
drwxr-xr-x 86 root root  4096 Sep  4 20:18 etc
drwxr-xr-x  3 root root  4096 Sep  3 13:24 home
lrwxrwxrwx  1 root root     7 Aug 30  2020 lib -> usr/lib
drwxr-xr-x  2 root root  4096 Oct 14  2020 lib64
drwx------  2 root root 16384 Sep  4 20:16 lost+found
drwxr-xr-x  2 root root  4096 Sep  4 20:17 media
drwxr-xr-x  2 root root  4096 Sep  4 20:17 mnt
drwxr-xr-x  2 root root  4096 Aug 30  2020 opt
drwxr-xr-x  2 root root  4096 Sep  4 20:17 proc
drwx------  6 root root  4096 Sep  4 20:18 root
drwxr-xr-x  2 root root  4096 Sep  4 20:17 run
lrwxrwxrwx  1 root root     8 Aug 30  2020 sbin -> usr/sbin
drwxrwxr-x  2 root root  4096 Oct 14  2020 selinux
drwxr-xr-x  2 root root  4096 Aug 30  2020 srv
drwxr-xr-x  2 root root  4096 Sep  4 20:17 sys
drwxr-xr-x  2 root root  4096 Sep  4 20:17 tmp
drwxr-xr-x 11 root root  4096 Aug 30  2020 usr
drwxr-xr-x 12 root root  4096 Oct 14  2020 var

 

I apologize if this is not the correct forum for this. Pls let me know and will move it.

Thank you,

Pista

Edited by pista
Link to comment
Share on other sites

hi @pista - you'll have to be very careful trying to boot s905 from emmc as the boot block structure for this soc does not cooperate very well with the partition table on the disk (both live mostly in the same area) - i'm actually surprised that you can still boot, as your partitions on the emmc most probably already have overwritten regions which are required for the legacy u-boot to work (the dtb for the legacy u-boot is usually somewhere in the middle of the emc - see the "libfdt fdt_check_header(): FDT_ERR_BADMAGIC" message and that it cannot find its logo bmp) - i would recommend you to use a hybrid mode to boot from sd card and maybe have the rootfs on emmc and better keep the first 700mb (this is the size balbes used successfully on older s905x boards) on the emmc unused to maybe not overwrite more essential parts required for booting ... the error you get seems to result from the u-boot.ext having a different device numbering of mmc, emmc etc. than the legacy boot (they all can have a different numbering: legacy u-boot, different maninline u-boot's and the kernel), but as said - better do not try to do the first stages of the boot from emmc on s905 as there is a very high risk to brick the box hard this way ...

 

good luck and best wishes - hexdump

Link to comment
Share on other sites

Hello @hexdump Thank you for the reply. Indeed, looks like it couldn't even find dtb: "vpu: error: vpu: check dts: FDT_ERR_BADMAGIC, load default parameters"; it is interesting I'm even able to boot. As for bricking the box, I already did it a few times and had to short the chip + reinstall Android. This is partly a learning exercise for me, so not a huge deal even if I kill her for good :) 

I tested booting from SD, having root FS in emmc, and it works fine. I'll keep experimenting a little more, and then decide whether I go back to kernel 3.14 (which works OK for booting with legacy U-BOOT from emmc), or I use SD with new kernel for booting.
Pista


 

Link to comment
Share on other sites

Hello @hexdump Just a quick question. Your gxb-u-boot.bin.gz ( from https://github.com/hexdump0815/u-boot-misc/releases/tag/200718-01 ) it should have USB support, right? Does it also have USB storage support? I'm asking because the legacy u-boot recognized the USB storage device and loaded u-boot.ext (your u-boot with USB), but this one reported that no USB storage device found. (I'm trying to boot from a USB drive and have root also on the drive, instead booting from SD and having root in emmc.)

Link to comment
Share on other sites

@pista - i do not remember exactly, but usb storage in u-boot is often not really working (for instance due to confusion regarding initialization of hardware between legacy and chainloaded u-boot but maybe even due to other reasons too), so it might be the case here even in case it would have been enabled (not sure about that) - what you can do is to have some small sd card (or even later regions on emmc) for the kernel etc., load it from there and then use usb as root fs (for this only the kernel needs to know it) ... alternative option is to hack on u-boot and find out - all the steps which lead to my u-boot binary are noted down in the file readme.gxb in that repo ... please let me know either via github issue or here in case you get anything working

 

best wishes and good luck - hexdump

Link to comment
Share on other sites

Hello @hexdump It took some time but I've managed to install into emmc. Currently I can run manually from the chainloaded u-boot's prompt. I will post a summary, but basically I'm using 'mmc read' instead of 'load/fatload' to load kernel, ramdisk, and dtb. The issue I run into is that in the mainline u-boot I don't have the 'saveenv' command. I've checked the u-boot config, and CONFIG_CMD_SAVEENV=y is defined. Do you by chance know why the command is not available? I've built u-boot using your instructions from https://github.com/hexdump0815/u-boot-misc/blob/master/readme.gxb

Link to comment
Share on other sites

OK, never mind :) I found these:
 

CONFIG_ENV_IS_NOWHERE=y
# CONFIG_ENV_IS_IN_EEPROM is not set
# CONFIG_ENV_IS_IN_FAT is not set
# CONFIG_ENV_IS_IN_EXT4 is not set
# CONFIG_ENV_IS_IN_FLASH is not set
# CONFIG_ENV_IS_IN_MMC is not set
# CONFIG_ENV_IS_IN_NAND is not set
# CONFIG_ENV_IS_IN_NVRAM is not set
# CONFIG_ENV_IS_IN_ONENAND is not set
# CONFIG_ENV_IS_IN_REMOTE is not set
+	"bootenv_addr_r=0x01080000\0" \
+	"preboot=usb start; " \
+		"mmc dev 1; " \
+		"setenv stdin usbkbd; " \
+		"for target in 1 2;do " \
+		"for prefix in / /boot/;do " \
+			"if test -e mmc ${target}:1 ${prefix}uEnv.txt;then " \
+				"load mmc ${target}:1 ${bootenv_addr_r} ${prefix}uEnv.txt; " \
+				"env import -t ${bootenv_addr_r} ${filesize}; " \
+			"fi; " \
+		"done; " \
+	"done\0" \

 

Link to comment
Share on other sites

@pista - i must admit that i have lost the overview a bit about what your current setup and your goal is :) ... what did you manage to install to emmc and why do you use "mmc read" instead of "load/fatlload"? yes, the initial env is hardcoded into u-boot.

Link to comment
Share on other sites

@hexdump sorry, I didn't realize how much time has passed since we talked, lol. It is about Amologix S905. As you know the ROM in this SOC looks for bootloader at the 1st sector of the eMMC, so it is not possible to create regular partitions since the part. table would overwrite the bootloader. The result is that u-boot commands like 'fatload' won't work. Which prevented me from installing Armbian into eMMC.

E.g.: the chainloaded u-boot will report:
 

U-Boot 2020.07-dirty (Oct 24 2020 - 21:14:30 +0200) hexdump-gxbb
...
switch to partitions #0, OK
mmc2 is current device
** No partition table - mmc 2 **

 

I resolved this by dedicating 2 areas at the end of eMMC: 200MB 'boot', and the rest (~6GB) as 'root'. I exposed these to Linux using kernel command line parameter: 'blkdevparts=mmcblk1:209715200@1463812096(boot),-@1673528320(root)'.

 

In Linux I copied the root directory tree to /dev/mmcblk1p2. I left /dev/mmcblk1p1 (the boot "partition") without file system, and copied (dd) uboot (the mailine uboot), kernel, ramdisk, and dtb there at the predefined block positions, e.g: 'dd if=zImage of=/dev/mmcblk1p2 bs=512 seek=2859008 count=54841'.

 

In Amlogic u-boot instead of fatload I used 'mmc read' to load all files, e.g.: to load the kernel: 'mmc read 0x08080000 0x2BA3FC 0xD639'.

 

In the chainloaded Mainline u-boot I used 'booti 0x08080000 0x13000000 0x08008000' as 'bootcmd' to start the system.

 

With this setup I can now boot from eMMC. Thanks for you assistance; your comments on the subject in various threads on the forum were very helpful.

 

 

 

Link to comment
Share on other sites

@pista - congratulations - this is a very clever approach :) ... i had "blkdevparts" still on my list of things to check out one day, but i think i would have never gotten to the idea of the mmc read to read all the stuff in one row into memory - really really clever

 

one other thing i once noticed (not 100% sure anymore, so it might also be just wrong memory) was, that it looked like the boot block for the first sector for the s905 seemed to have an empty area where the actual fat partition table lives in the first sector (i think i saw it when doing a hexdump -C of a self built s905 boot block) ... in case my memory is right and there is no checksumming involved it would even be possible to get a boot block together which has a proper fat partition table in it and still works ... but maybe i just dreamed it once and its not really true :)

 

best wishes - hexdump

 

ps: i just did some recheck of my theory - if you hexdump -C this one: https://github.com/hexdump0815/u-boot-misc/releases/download/200718-01/boot-amlogic_gxb_atf-aarch64-serial.dd.gz which is a boot block for sd card, i.e. starting at block 1 then it looks like only the area from 0x0 to 0x70 (after dropping the first 512 bytes) is really used and the partition entries are usually living between 0x1be and 0x1fe (see https://www.easeus.com/resource/fat32-disk-structure.htm) - so maybe there is a chance to get it working? but so far i never tried it

Link to comment
Share on other sites

@hexdump I'm now intrigued... :) I was about to put the PCB back to the box, but I think I will do some experiments over the weekend. I do see that eMMC has BL2 (or is it BL3) at the beginning of the 1st block - total 111 bytes. Then nothing until 4096:

 

root@arm-64:~# hexdump -C -n $((4096+64)) /dev/mmcblk1
00000000  1a e6 31 39 74 02 1f 27  93 be e3 cd 29 12 1b 71  |..19t..'....)..q|
00000010  40 41 4d 4c f0 bf 00 00  40 00 01 00 00 00 00 00  |@AML....@.......|
00000020  00 00 00 00 40 00 00 00  00 02 00 00 60 00 00 00  |....@.......`...|
00000030  00 00 00 00 40 02 00 00  b0 0d 00 00 90 bf 00 00  |....@...........|
00000040  00 00 00 00 f0 0f 00 00  00 b0 00 00 00 00 00 00  |................|
00000050  fe 26 6e ba 84 e6 69 fc  6b 79 97 2c 0c 8a b3 15  |.&n...i.ky.,....|
00000060  13 70 39 86 a3 e4 b1 78  22 b4 9b b3 cf 65 88 9c  |.p9....x"....e..|
00000070  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00001000  02 00 00 14 08 b2 00 d9  f4 03 00 aa f5 03 01 aa  |................|
00001010  a0 00 38 d5 11 22 00 94  a0 02 00 b4 20 bf 04 10  |..8.."...... ...|
00001020  00 c0 18 d5 00 10 38 d5  00 00 74 b2 00 10 18 d5  |......8...t.....|
00001030  df 3f 03 d5 e0 01 00 58  01 02 00 58 6c 22 00 94  |.?.....X...Xl"..|
00001040

 

So...

[updated based on info from Mr. usual user]

0    100   200   300   400   500   600
|-----|-----|-----|-----|-----|-----|
|      |                  |    |
      112 (BL2)          440  512 (72 bytes)
     0x70              0x1B8  0x1FF

 

It looks like the problem with S905 is not that the part. table overwrites the bootloader, but that the partitioning software (fdisk) wipes the space before the part. table (446 bytes). In theory it should be possible to just create the partitions and then restore the 1st 400 bytes. I think I'll try on mounted disk-image first.

Link to comment
Share on other sites

The first 440 bytes of the MBR are used for bootstrap executable code.

The partition management relevant data starts at 0x01B8 and lasts till 0x01FF.

Spoiler

mbr.thumb.png.7a32e51db1211368fcaeffc21bafd177.png

Tools that create MSDOS master boot records usually insert code into the bootstap code area that is suitable for PC BIOS use, i.e. useless for Arm systems. Regardless of what you put in the first 440 bytes of the MBR, you still have a valid MBR with partition table entries. Only the last 72 bytes of the first sector have to be maintained therefor.

Link to comment
Share on other sites

@hexdump @usual user OK, it doesn't work. I bricked the box twice :) It is strange, because it should work, but doesn't.

 

I've created a file with 2 partitions (boot, root):
 

fallocate -l 200M tst.img
fdisk ...

// file systems not really needed for this...
kpartx -a -v tst.img
mkfs.vfat -n BOOT /dev/mapper/loop0p1
mkfs.ext4 /dev/mapper/loop0p2
e2label /dev/mapper/loop0p2 ROOT
kpartx -d disk.image

xxd -a -g 1 -l 512 tst.img
00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
*
000001b0: 00 00 00 00 00 00 00 00 2d bd 6b 1f 00 00 80 8a  ........-.k.....
000001c0: 09 82 0b 88 13 b5 00 00 20 00 00 80 0c 00 00 88  ........ .......
000001d0: 14 b5 83 27 e9 be 00 80 2c 00 00 60 be 00 00 00  ...'....,..`....
000001e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
000001f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa  ..............U.

// extract last 72 bytes of the 1 sector
dd if=tst.img of=tbl.img bs=1 skip=440 count=72

xxd -a -g 1 tbl.img 
00000000: 2d bd 6b 1f 00 00 80 8a 09 82 0b 88 13 b5 00 00  -.k.............
00000010: 20 00 00 80 0c 00 00 88 14 b5 83 27 e9 be 00 80   ..........'....
00000020: 2c 00 00 60 be 00 00 00 00 00 00 00 00 00 00 00  ,..`............
00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000040: 00 00 00 00 00 00 55 aa                          ......U.

// write to the end of the 1st sector on eMMC
dd if=tbl.img of=/dev/mmcblk1 bs=1 seek=440 count=72 conv=notrunc

xxd -a -g 1 -l 512  /dev/mmcblk1
00000000: 1a e6 31 39 74 02 1f 27 93 be e3 cd 29 12 1b 71  ..19t..'....)..q
00000010: 40 41 4d 4c f0 bf 00 00 40 00 01 00 00 00 00 00  @AML....@.......
00000020: 00 00 00 00 40 00 00 00 00 02 00 00 60 00 00 00  ....@.......`...
00000030: 00 00 00 00 40 02 00 00 b0 0d 00 00 90 bf 00 00  ....@...........
00000040: 00 00 00 00 f0 0f 00 00 00 b0 00 00 00 00 00 00  ................
00000050: fe 26 6e ba 84 e6 69 fc 6b 79 97 2c 0c 8a b3 15  .&n...i.ky.,....
00000060: 13 70 39 86 a3 e4 b1 78 22 b4 9b b3 cf 65 88 9c  .p9....x"....e..
00000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
*
000001b0: 00 00 00 00 00 00 00 00 2d bd 6b 1f 00 00 80 8a  ........-.k.....
000001c0: 09 82 0b 88 13 b5 00 00 20 00 00 80 0c 00 00 88  ........ .......
000001d0: 14 b5 83 27 e9 be 00 80 2c 00 00 60 be 00 00 00  ...'....,..`....
000001e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
000001f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa  ..............U.

Hex dump shows BL2 is still intact, and tbl.img has been written to a place which was originally empty.

 

So, unless I'm missing something it looks like ROM is doing some extra checking that the 1st sector has not been tampered with, or something.

Well, it was a nice idea. I guess I use my method, it is more complex, but it works.

Link to comment
Share on other sites

@hexdump I didn't touch the bootloader, it is the original from the TV box. I only inserted the 72 bytes at the end of the 1st block (which was originally empty). It seems it is not possible to change the 1st block at all, even if you just modify the empty space. My guess is that when ROM is checking whether emmc has a valid BL it reads the whole 512 bytes (instead of just the length of BL) and does some CRC, or other validation, so even changing a single 00 byte will cause ROM to reject the bootloader. I even tried twice just to make sure I didn't make a mistake, I bricked both times. (Thankfully the Linux version of the AML USB burning tool is working very well).

P.S.: yes it didn't start, I got that string from ROM (starting with "BL1" repeating in a loop.

Link to comment
Share on other sites

@pista - just to mention it here: i'm aware of one other type of system with a strange boot setup: the rk3288 based chromebooks (veyron) are using gpt partitoning, which consists of the primary gpt partition table at the beginning of the disk (and spanning even more space then the traditional mbr partition table) and a backup gpt partition table at the end of the disk (a normal redunadancy measure of gpt partioning) ... the strange thing on those chromebooks is that you can create a gpt partition table successflly, but if you try to read it back it tells you that the primary gpt table is corrupted (not sure where this gets lost, but its consistent) ... the way i got it working was to write the gpt table and then boot the kernel with the "gpt" option, which tells it to use the backup gpt table if the primary one is corrupted - u-boot is complaining a lot about the broken primary gpt, but works in this case (i just commented out those warning from u.boot for it) ... i think there are patches for those chromebooks, which put the primare gpt table to another place, but my approach works without those patches

 

maybe an approach like this might work for the s905 too - not sure, but your approach is fine too i guess (maybe the gpt one would be a bit more standard - if it works at all in this case :) )

 

https://github.com/hexdump0815/u-boot-chainloading-for-arm-chromebooks/blob/master/misc.cbr/supress-efi-errors-v2021.01.patch

https://github.com/hexdump0815/imagebuilder/blob/main/systems/chromebook_veyron/extra-files/boot/extlinux/extlinux.conf#L13

Link to comment
Share on other sites

@pista - i guess your theory about the checksum is correct then ... which linux version of the usb burning tool for amlogic did you use btw.? do you have to ground the emmc clock pin to get it recognized there or is it recognized if bricked even without that?

Link to comment
Share on other sites

@hexdump Yes, I've learned about this option from your post in an other thread. Also people from the NXP processor forum mentioned this. It was the one option I didn't try. I guess it would be worth... shouldn't be much work and there is no chance to brick again. @TonyMac32 has git of the old Amlogic u-boot, and I see the gpt command does exist in this version, but it is not available on my TV box, so the question is whether GPT support is enabled. I probably try it later today...

Link to comment
Share on other sites

1 hour ago, pista said:

I only inserted the 72 bytes at the end of the 1st block

AFAIS you have inserted a populated partition table. Maybe the boot firmware now changes the boot flow according these values. To confirm that the presence of an MSDOS MBR already triggers it, just add the boot signature "55AA" to the last two bytes of the sector.
If booting still does not work with an otherwise empty partition table, no MSDOS MBR can be used unless the existing boot firmware is also adapted.

Link to comment
Share on other sites

@hexdump I'm using this one: https://github.com/natinusala/linux-amlogic-toolkit
I've tried two others, but only this one worked. (Has the script updated). Yes, I have to ground the emmc clock pin while powering up. You will need to add a line to /etc/udev/rules.d: SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="1b8e", ATTR{idProduct}=="c003", MODE:="0666", SYMLINK+="worldcup". Plugin OTG USB, Short the pin, power-up, remove the short, and lsusb will show a new Amlogic device. 1st time you need to let the tool unpack your firmware, after this just exec the 'flash' script. Here is the last part of the dbg log I still have on my screen:
 

Writing system partition 
Command -> /home/pista/amlburn/linux-amlogic-toolkit-master/bin/aml-linux-usb-burn/tools/update 2>/dev/null partition system /home/pista/amlburn/linux-amlogic-toolkit-master/output/image/system.PARTITION 
- Results ---------------------------------------------------
 [update]sparse format detected
file size is 0x3e01502c
AmlUsbTplCmd = download store system sparse 0x3e01502c rettemp = 1 buffer = download store system sparse 0x3e01502c
AmlUsbReadStatus retusb = 1
Downloading....
[update]Cost time 80Sec            
[update]Transfer size 0x3e01502cB(992MB)
AmlUsbBulkCmd[download get_status]
[update]mwrite success 
-------------------------------------------------------------

[OK]
Done

 

Link to comment
Share on other sites

@usual user
> AFAIS you have inserted a populated partition table.

Yes, that was my intention.


> Maybe the boot firmware now changes the boot flow
I doubt it does. AFAIK: the ROM uses secure-boot using 3 pieces BL1 (is in ROM), BL2 (in 1st sector on emmc), and BL3 is the u-boot. BL2 is also signed. With s905 Amlogic doesn't use regular partitions (e.g: 'mmc part' will give you "no partitions found", and 'fatload' etc. commands won't work either). Amlogic does maintain some kind of partition table. Based on the u-boot messages:


 

mmc read lba=0x12000, blocks=0x2
mmc read lba=0x12002, blocks=0x2
mmc_read_partition_tbl: mmc read partition OK!
eMMC/TSD partition table have been checked OK!


 

gxb_p200_v1#mmc read 0x1200000 0x12000 0x400 
gxb_p200_v1#md.b 0x1200000 0x400

01200000: 4d 50 54 00 30 31 2e 30 30 2e 30 30 00 00 00 00    MPT.01.00.00....
01200010: 0e 00 00 00 ca 70 f2 de 62 6f 6f 74 6c 6f 61 64    .....p..bootload
01200020: 65 72 00 00 00 00 00 00 00 00 40 00 00 00 00 00    er........@.....
01200030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01200040: 72 65 73 65 72 76 65 64 00 00 00 00 00 00 00 00    reserved........
01200050: 00 00 00 04 00 00 00 00 00 00 40 02 00 00 00 00    ..........@.....
01200060: 00 00 00 00 00 00 00 00 63 61 63 68 65 00 00 00    ........cache...
01200070: 00 00 00 00 00 00 00 00 00 00 00 20 00 00 00 00    ........... ....
01200080: 00 00 c0 06 00 00 00 00 02 00 00 00 00 00 00 00    ................
01200090: 65 6e 76 00 00 00 00 00 00 00 00 00 00 00 00 00    env.............
012000a0: 00 00 80 00 00 00 00 00 00 00 40 27 00 00 00 00    ..........@'....
012000b0: 00 00 00 00 00 00 00 00 6c 6f 67 6f 00 00 00 00    ........logo....
012000c0: 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00 00    ................
012000d0: 00 00 40 28 00 00 00 00 01 00 00 00 00 00 00 00    ..@(............
012000e0: 72 65 63 6f 76 65 72 79 00 00 00 00 00 00 00 00    recovery........
012000f0: 00 00 00 02 00 00 00 00 00 00 c0 2a 00 00 00 00    ...........*....
...

 

Amlogic made modifications to u-boot (they even have their own commands 'amlmmc' to read/write the emmc. So, I don't think they would or could modify the boot flow.

> just add the boot signature "55AA" to the last two bytes of the sector
OK, I will try.

 

Link to comment
Share on other sites

@usual user I run the test:
 

[1] eMMC before change:
# xxd -a -g 1 -l 512  /dev/mmcblk1
00000000: 1a e6 31 39 74 02 1f 27 93 be e3 cd 29 12 1b 71  ..19t..'....)..q
00000010: 40 41 4d 4c f0 bf 00 00 40 00 01 00 00 00 00 00  @AML....@.......
00000020: 00 00 00 00 40 00 00 00 00 02 00 00 60 00 00 00  ....@.......`...
00000030: 00 00 00 00 40 02 00 00 b0 0d 00 00 90 bf 00 00  ....@...........
00000040: 00 00 00 00 f0 0f 00 00 00 b0 00 00 00 00 00 00  ................
00000050: fe 26 6e ba 84 e6 69 fc 6b 79 97 2c 0c 8a b3 15  .&n...i.ky.,....
00000060: 13 70 39 86 a3 e4 b1 78 22 b4 9b b3 cf 65 88 9c  .p9....x"....e..
00000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
*
000001f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................

[2] write 0x55 0xaa to the last 2 bytes of 1st sector:
echo -n -e '\x55\xaa' | dd if=/dev/stdin of=/dev/mmcblk1 bs=1 seek=$((512-2)) count=2 conv=notrunc

[3] eMMC after change:
# xxd -a -g 1 -l 512  /dev/mmcblk1
00000000: 1a e6 31 39 74 02 1f 27 93 be e3 cd 29 12 1b 71  ..19t..'....)..q
00000010: 40 41 4d 4c f0 bf 00 00 40 00 01 00 00 00 00 00  @AML....@.......
00000020: 00 00 00 00 40 00 00 00 00 02 00 00 60 00 00 00  ....@.......`...
00000030: 00 00 00 00 40 02 00 00 b0 0d 00 00 90 bf 00 00  ....@...........
00000040: 00 00 00 00 f0 0f 00 00 00 b0 00 00 00 00 00 00  ................
00000050: fe 26 6e ba 84 e6 69 fc 6b 79 97 2c 0c 8a b3 15  .&n...i.ky.,....
00000060: 13 70 39 86 a3 e4 b1 78 22 b4 9b b3 cf 65 88 9c  .p9....x"....e..
00000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
*
000001f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa  ..............U.

[4] serial terminal:
~$ sudo -i
root@buffy:~# stty -F /dev/ttyUSB0 cs8 -parenb cstopb crtscts
root@buffy:~# picocom -b 115200 -d 8 -y n -p 1 -f n /dev/ttyUSB0

[5] reboot, and the serial shows:
GXBB:BL1:08dafd:0a8993;FEAT:EDFC318C;POC:3;RCY:0;
EMMC:0;READ:0;CHK:17A;SD:0;READ:0;CHK:F3;USB:8;LOOP:1;
EMMC:0;READ:0;CHK:17A;SD:0;READ:0;CHK:F3;USB:8;LOOP:2;
EMMC:0;READ:0;CHK:17A;SD:0;READ:0;CHK:F3;USB:8;LOOP:3;
EMMC:0;READ:0;CHK:17A;SD:0;READ:0;CHK:F3;USB:8;LOOP:4;
EMMC:0;READ:0;CHK:17A;SD:0;READ:0;CHK:F3;USB:8;...

 

Link to comment
Share on other sites

Looks like the existing boot firmware on the emmc, for whatever reason, does not tolerate a valid MSDOS MBR on the emmc. If this  is still valid, you can certainly replace the existing firmware with a suitable one, but since a functioning solution has already been worked out, it is certainly easier to use it.

Link to comment
Share on other sites

@hexdump I've tested today the GPT scenario. I created a file, partitioned with 'gdisk', then I extracted the backup GPT records (last 33 LBA) and inserted at the end of the eMMC. After I rebooted linux recognized the 2 new partitions (/dev/mmcblk1p1 and p2). I created FAT on p1 and put a file there.

Neither the AML uboot, nor the mainline uboot recognized the partition table. E.g.: on mailnine uboot:
 

// EMMC:
=> mmc list
mmc@70000: 0
mmc@72000: 1 (SD)
mmc@74000: 2 (eMMC)

=> fatls mmc 2:1
** No partition table - mmc 2 **

// SD works...
=> fatls mmc 1:1
            dtb/
            extlinux/
      709   aml_autoscript 
        0   aml_autoscript.zip 
     1536   armbian_first_run.txt.template 
    38518   boot.bmp 
      158   boot.ini 
   216810   config-5.9.0-arm-64 
      174   emmc_autoscript 
  9842151   initrd.img-5.9.0-arm-64 
      537   s905_autoscript 
  5794743   system.map-5.9.0-arm-64 
   609247   u-boot-s905 
   740080   u-boot-s905x2-s922 
   650183   u-boot-s905x-s912 
  9842215   uinitrd 
 28078592   zimage 
            lost.dir/
            android/
   521171   u-boot.ext 
            .android_secure/
        0   .wipe_record 

17 file(s), 5 dir(s)

 

For you chromebook, did you compile uboot with some extra options enabled to get GPT backup working?

Link to comment
Share on other sites

@pista - it looks like this should have some good information in it: https://source.denx.de/u-boot/u-boot/-/blob/master/doc/README.gpt

 

it looks like the gpt stuff is not defined in my s905 u-boot build - the chromebook config ( https://source.denx.de/u-boot/u-boot/-/blob/master/configs/chromebook_speedy_defconfig ) has CONFIG_CMD_GPT=y set (and i guess this one then pulls in CONFIG_EFI_PARTITION) and the s905 config i used ( https://source.denx.de/u-boot/u-boot/-/blob/master/configs/p201_defconfig ) not

 

looks like a new u-boot is required for this to be able to work: https://github.com/hexdump0815/u-boot-misc/blob/master/readme.gxb

 

best wishes - hexdump

Link to comment
Share on other sites

@hexdump thanks for the resources. Rebuilding the mainline uboot is not a problem, I already did it once using your instructions in the readme. But I'm not sure I will be able to rebuild the original AML uboot - which would need to have GPT support too.

Link to comment
Share on other sites

@hexdump i've enabled GPT in mailine u-boot,and I got 'gpt' command now, but it still doesn't see the partition:

 

U-Boot 2020.07-dirty (Oct 18 2021 - 02:27:09 +0200) hexdump-gxbb
...
=> mmc dev 2
switch to partitions #0, OK
mmc2(part 0) is current device
=> mmc part
## Unknown partition table type 0

 

The 'gpt verify' fails too:
 

=> gpt verify mmc 2
No partition list provided - only basic check
GUID Partition Table Header signature is wrong: 0x0 != 0x5452415020494645
gpt_verify_headers: *** ERROR: Invalid GPT ***
Verify GPT: error!

 

I've checked the source code, and as far as I can tell, u-boot is only checking the primary GPT:
 

int gpt_verify_headers(struct blk_desc *dev_desc, gpt_header *gpt_head,
		       gpt_entry **gpt_pte)
{
	/*
	 * This function validates AND
	 * fills in the GPT header and PTE
	 */
	if (is_gpt_valid(dev_desc,
			 GPT_PRIMARY_PARTITION_TABLE_LBA,
			 gpt_head, gpt_pte) != 1) {
		printf("%s: *** ERROR: Invalid GPT ***\n",
		       __func__);
		return -1;
	}
    ...

 

I couldn't even find definition for the backup GPT. Strange that it is working for you.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines