Discussion:
Bootstrapping an Olimex A64-OLinuXino
Martin Lucina
2018-03-13 13:09:19 UTC
Permalink
Hi,

I'm trying to bootstrap an Olimex A64-OLinuXino board from scratch, using
Debian stretch on x86_64 as the build host. So far, I've:

- cross-built mainline U-boot 2018.01 including the SPL and BL31 from latest
https://github.com/apritzel/arm-trusted-firmware.git#allwinner and
a64-olinuxino_defconfig:

(arm-trusted-firmware) $ make PLAT=sun50iw1p1 DEBUG=1 bl31 CROSS_COMPILE=aarch64- linux-gnu-
(u-boot) $ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- a64-olinuxino_defconfig
(u-boot) $ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- BL31=$(pwd)/../arm-trusted-firmware/build/sun50iw1p1/debug/bl31.bin

- cross-built mainline kernel 4.15.7

(kernel) $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
(kernel) $ make -j4 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-

- partitioned and installed to SD card following the instructions in
board/sunxi/README.sunxi64

SD card has a 128MB FAT partition (p1) and the remainder as ext4 (p2)

- ran the debootstrap 1st stage:

sudo debootstrap --arch=arm64 --variant=minbase --foreign stretch /mnt

- sucessfully booted into /bin/sh using the following boot.scr:

setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait panic=10
load mmc 0:1 0x43000000 dtb
load mmc 0:1 0x41000000 Image
booti 0x41000000 - 0x43000000

(no initrd for now since I'm lazy...)

However, while running the debootstrap 2nd stage on the board, it seems that
the kernel is not stable:

# mount -n -o remount,rw /
[ 93.035277] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
# /debootstrap/debootstrap --second-stage
I: Keyring file not available at /usr/share/keyrings/debian-archive-keyring.gpg; switching to https mirror https://deb.debian.org/debian
I: Installing core packages...
[ 109.616360] random: crng init done
[ 138.840328] BUG: Bad page state in process dpkg pfn:7bf40
[ 138.845825] page:ffff7e0000efd000 count:64 mapcount:0 mapping: (null) index:0x1
[ 138.853908] flags: 0xfffc00000000000()
[ 138.857657] raw: 0fffc00000000000 0000000000000000 0000000000000001 00000040ffffffff
[ 138.865390] raw: dead000000000100 dead000000000200 0000000000000000 0000000000000000
[ 138.873119] page dumped because: nonzero _count
[ 138.877641] Modules linked in:
[ 138.880698] CPU: 3 PID: 1472 Comm: dpkg Tainted: G B 4.15.7 #1
[ 138.887734] Hardware name: Olimex A64-Olinuxino (DT)
[ 138.892689] Call trace:
[ 138.895144] dump_backtrace+0x0/0x168
[ 138.898805] show_stack+0x14/0x20
[ 138.902117] dump_stack+0x98/0xb8
[ 138.905430] bad_page+0xe4/0x148
[ 138.908653] check_new_page_bad+0x64/0xa0
[ 138.912659] get_page_from_freelist+0xbac/0x1048
[ 138.917269] __alloc_pages_nodemask+0xdc/0xbd8
[ 138.921711] alloc_pages_current+0x80/0xe8
[ 138.925805] __page_cache_alloc+0xa0/0xb0
[ 138.929809] pagecache_get_page+0xf8/0x280
[ 138.933902] grab_cache_page_write_begin+0x24/0x40
[ 138.938690] ext4_da_write_begin+0xa4/0x398
[ 138.942868] generic_perform_write+0x98/0x180
[ 138.947221] __generic_file_write_iter+0x130/0x1a0
[ 138.952005] ext4_file_write_iter+0xe0/0x358
[ 138.956271] __vfs_write+0xb0/0x118
[ 138.959754] vfs_write+0xa4/0x1b0
[ 138.963064] SyS_write+0x44/0xa0
[ 138.966288] el0_svc_naked+0x30/0x34
[ 146.827756] BUG: Bad page state in process frontend pfn:7a940
[ 146.833600] page:ffff7e0000ea5000 count:64 mapcount:0 mapping: (null) index:0x1
[ 146.841682] flags: 0xfffc00000000000()
[ 146.845431] raw: 0fffc00000000000 0000000000000000 0000000000000001 00000040ffffffff
[ 146.853162] raw: dead000000000100 dead000000000200 0000000000000000 0000000000000000
[ 146.860891] page dumped because: nonzero _count
[ 146.865413] Modules linked in:
[ 146.868471] CPU: 2 PID: 1499 Comm: frontend Tainted: G B 4.15.7 #1
[ 146.875854] Hardware name: Olimex A64-Olinuxino (DT)
[ 146.880810] Call trace:
[ 146.883265] dump_backtrace+0x0/0x168
[ 146.886926] show_stack+0x14/0x20
[ 146.890239] dump_stack+0x98/0xb8
[ 146.893551] bad_page+0xe4/0x148
[ 146.896775] check_new_page_bad+0x64/0xa0
[ 146.900780] get_page_from_freelist+0xbac/0x1048
[ 146.905390] __alloc_pages_nodemask+0xdc/0xbd8
[ 146.909832] alloc_pages_vma+0x88/0x1f8
[ 146.913666] __handle_mm_fault+0xa84/0x1098
[ 146.917844] handle_mm_fault+0x124/0x1d0
[ 146.921763] do_page_fault+0x178/0x360
[ 146.925508] do_translation_fault+0x3c/0x48
[ 146.929685] do_mem_abort+0x40/0xb0
[ 146.933160] el0_da+0x20/0x24
I: Unpacking required packages...
I: Unpacking libacl1:arm64...
I: Unpacking libattr1:arm64...
I: Unpacking libaudit-common...
I: Unpacking libaudit1:arm64...
I: Unpacking base-files...
I: Unpacking base-passwd...
I: Unpacking bash...
I: Unpacking libbz2-1.0:arm64...
I: Unpacking libdebconfclient0:arm64...
I: Unpacking coreutils...
[ 226.850339] Unable to handle kernel NULL pointer dereference at virtual address 0000042e
[ 226.854130] BUG: Bad page state in process dpkg pfn:7c969
[ 226.854142] page:ffff7e0000f25a40 count:64 mapcount:0 mapping: (null) index:0x0
[ 226.854150] flags: 0xfffc00000000000()
[ 226.854159] raw: 0fffc00000000000 0000000000000000 0000000000000000 00000040ffffffff
[ 226.854165] raw: dead000000000100 dead000000000200 0000000000000000 0000000000000000
[ 226.854167] page dumped because: nonzero _refcount
[ 226.854169] Modules linked in:
[ 226.854180] CPU: 1 PID: 1596 Comm: dpkg Tainted: G B 4.15.7 #1
[ 226.854182] Hardware name: Olimex A64-Olinuxino (DT)
[ 226.854185] Call trace:
[ 226.854200] dump_backtrace+0x0/0x168
[ 226.854207] show_stack+0x14/0x20
[ 226.854213] dump_stack+0x98/0xb8
[ 226.854219] bad_page+0xe4/0x148
[ 226.854224] free_pages_check_bad+0x6c/0xa8
[ 226.854228] free_pcppages_bulk+0x450/0x4d0
[ 226.854233] free_unref_page_commit+0xc4/0x110
[ 226.854238] free_unref_page+0x68/0x80
[ 226.854243] __put_page+0x44/0x50
[ 226.854250] anon_pipe_buf_release+0x68/0x80
[ 226.854254] pipe_read+0x18c/0x2e8
[ 226.854261] __vfs_read+0xb0/0x110
[ 226.854264] vfs_read+0x8c/0x148
[ 226.854269] SyS_read+0x44/0xa0
[ 226.854274] el0_svc_naked+0x30/0x34
[ 226.967682] Mem abort info:
[ 226.970471] ESR = 0x96000004
[ 226.973521] Exception class = DABT (current EL), IL = 32 bits
[ 226.979430] SET = 0, FnV = 0
[ 226.982479] EA = 0, S1PTW = 0
[ 226.985614] Data abort info:
[ 226.988489] ISV = 0, ISS = 0x00000004
[ 226.992317] CM = 0, WnR = 0
[ 226.995284] user pgtable: 4k pages, 48-bit VAs, pgd = 00000000f0b3b73c
[ 227.001800] [000000000000042e] *pgd=0000000000000000
[ 227.006761] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[ 227.012325] Modules linked in:
[ 227.015382] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G B 4.15.7 #1
[ 227.022592] Hardware name: Olimex A64-Olinuxino (DT)
[ 227.027550] pstate: 80000085 (Nzcv daIf -PAN -UAO)
[ 227.032344] pc : sched_ttwu_pending+0x5c/0xb0
[ 227.036695] lr : sched_ttwu_pending+0xa8/0xb0
[ 227.041044] sp : ffff000008f53ef0
[ 227.044353] x29: ffff000008f53ef0 x28: 0000000041e40018
[ 227.049661] x27: 0000000000000400 x26: ffff000008f62a80
[ 227.054967] x25: 0000000000000000 x24: ffff000008f59e90
[ 227.060273] x23: 0000000000000000 x22: ffff000008f4b0a8
[ 227.065580] x21: 0000000000000000 x20: ffff80003ef8f180
[ 227.070885] x19: 0000000000000002 x18: 0000000000000000
[ 227.076192] x17: 0000ffffa3cb5d80 x16: ffff0000082161c0
[ 227.081498] x15: 0000000000000000 x14: 0000000000000400
[ 227.086803] x13: 0000000000000400 x12: 0000000000000001
[ 227.092109] x11: 000000000000018f x10: 0000000000000a00
[ 227.097414] x9 : ffff000008f53e80 x8 : ffff000008f634e0
[ 227.102720] x7 : 0000000000000000 x6 : 0000000008c57f78
[ 227.108026] x5 : 00000034d154ea7f x4 : 000000345c74b395
[ 227.113332] x3 : 000000001dcd6500 x2 : 0000000014e1317f
[ 227.118637] x1 : ffffffffffffff6a x0 : ffff80003ef8f180
[ 227.123945] Process swapper/0 (pid: 0, stack limit = 0x000000001ebc162c)
[ 227.130634] Call trace:
[ 227.133080] sched_ttwu_pending+0x5c/0xb0
[ 227.137087] do_idle+0xb8/0x1e0
[ 227.140226] cpu_startup_entry+0x24/0x28
[ 227.144146] rest_init+0xd0/0xe0
[ 227.147375] start_kernel+0x39c/0x3b0
[ 227.151035] Code: b949da80 36080280 d1026261 b4000173 (39531022)
[ 227.157128] ---[ end trace 51d0109622e659fa ]---
[ 227.161740] Kernel panic - not syncing: Attempted to kill the idle task!
[ 227.168432] SMP: stopping secondary CPUs
[ 227.172351] Kernel Offset: disabled
[ 227.175835] CPU features: 0x0802004
[ 227.179316] Memory Limit: none
[ 227.182369] Rebooting in 10 seconds..
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

I will try with a 4.16-rcX kernel, but on the off chance that someone on
the list has already been through this and can see anything wrong in the
steps I did above or can suggest a known-good recent kernel (including
its configuration), let me know.

-mato
Joonas Kylmälä
2018-03-13 13:45:00 UTC
Permalink
Post by Martin Lucina
(arm-trusted-firmware) $ make PLAT=sun50iw1p1 DEBUG=1 bl31 CROSS_COMPILE=aarch64- linux-gnu-
(u-boot) $ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- a64-olinuxino_defconfig
(u-boot) $ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- BL31=$(pwd)/../arm-trusted-firmware/build/sun50iw1p1/debug/bl31.bin
Try ARCH=arm64. No idea if it helps.

Joonas
Martin Lucina
2018-03-13 13:57:23 UTC
Permalink
Post by Joonas Kylmälä
Post by Martin Lucina
(arm-trusted-firmware) $ make PLAT=sun50iw1p1 DEBUG=1 bl31 CROSS_COMPILE=aarch64- linux-gnu-
(u-boot) $ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- a64-olinuxino_defconfig
(u-boot) $ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- BL31=$(pwd)/../arm-trusted-firmware/build/sun50iw1p1/debug/bl31.bin
Try ARCH=arm64. No idea if it helps.
U-boot seems fine -- it's once I start the kernel that things start to go
wrong. Just tried a mainline 4.16-rc5, and I get the same kernel BUG fairly
early during boot (though no immediate panic).

Once thing I'm not clear on -- should I be using the dtb that came with the
kernel (arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dtb) or just use
the one provided by U-boot via $fdtcontroladdr?

Full boot log of 4.16-rc5 using the U-boot provided dtb follows.

-mato

=== cut here ===
U-Boot SPL 2018.01 (Mar 12 2018 - 17:31:02)
DRAM: 1024 MiB
Trying to boot from MMC1
NOTICE: BL3-1: Running on A64/H64 (1689) in SRAM A2 (@0x44000)
NOTICE: Configuring SPC Controller
NOTICE: BL3-1: v1.0(debug):ae787242
NOTICE: BL3-1: Built : 17:30:05, Mar 12 2018
NOTICE: DT: sun50i-a64-olinuxino
NOTICE: Configuring AXP PMIC
NOTICE: PMIC: setup successful
NOTICE: SCPI: dummy stub handler, implementation level: 000000
INFO: BL3-1: Initializing runtime services
INFO: BL3-1: Preparing for EL3 exit to normal world
INFO: BL3-1: Next image address: 0x4a000000, SPSR: 0x3c9


U-Boot 2018.01 (Mar 12 2018 - 17:31:02 +0100) Allwinner Technology

CPU: Allwinner A64 (SUN50I)
Model: Olimex A64-Olinuxino
DRAM: 1 GiB
MMC: SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

In: serial
Out: serial
Err: serial
Net: No ethernet found.
starting USB...
No controllers found
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
reading /boot.scr
220 bytes read in 15 ms (13.7 KiB/s)
## Executing script at 4fc00000
reading Image
17601024 bytes read in 901 ms (18.6 MiB/s)
## Flattened Device Tree blob at 79f2bed8
Booting using the fdt blob at 0x79f2bed8
Loading Device Tree to 0000000049ffb000, end 0000000049ffff15 ... OK

Starting kernel ...

[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[ 0.000000] Linux version 4.16.0-rc5 (***@nodbug) (gcc version 6.3.0 20170516 (Debian 6.3.0-18)) #2 SMP PREEMPT Tue Mar 13 14:33:15 CET 2018
[ 0.000000] Machine model: Olimex A64-Olinuxino
[ 0.000000] efi: Getting EFI parameters from FDT:
[ 0.000000] efi: UEFI not found.
[ 0.000000] cma: Reserved 16 MiB at 0x000000007f000000
[ 0.000000] NUMA: No NUMA configuration found
[ 0.000000] NUMA: Faking a node at [mem 0x0000000000000000-0x000000007fffffff]
[ 0.000000] NUMA: NODE_DATA [mem 0x7efe9e80-0x7efeb97f]
[ 0.000000] Zone ranges:
[ 0.000000] DMA32 [mem 0x0000000040000000-0x000000007fffffff]
[ 0.000000] Normal empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000040000000-0x000000007fffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x000000007fffffff]
[ 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] random: get_random_bytes called from start_kernel+0xac/0x40c with crng_init=0
[ 0.000000] percpu: Embedded 24 pages/cpu @ (ptrval) s57880 r8192 d32232 u98304
[ 0.000000] Detected VIPT I-cache on CPU0
[ 0.000000] CPU features: enabling workaround for ARM erratum 845719
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 258048
[ 0.000000] Policy zone: DMA32
[ 0.000000] Kernel command line: console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait panic=10
[ 0.000000] Memory: 997684K/1048576K available (10108K kernel code, 1252K rwdata, 4620K rodata, 1152K init, 404K bss, 34508K reserved, 16384K
cma-reserved)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=4.
[ 0.000000] Tasks RCU enabled.
[ 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] 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.000005] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[ 0.000231] Console: colour dummy device 80x25
[ 0.000292] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=96000)
[ 0.000305] pid_max: default: 32768 minimum: 301
[ 0.000386] Security Framework initialized
[ 0.001045] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes)
[ 0.001374] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
[ 0.001407] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes)
[ 0.001426] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes)
[ 0.016058] ASID allocator initialised with 32768 entries
[ 0.024049] Hierarchical SRCU implementation.
[ 0.032665] EFI services will not be available.
[ 0.040088] smp: Bringing up secondary CPUs ...
[ 0.069049] Detected VIPT I-cache on CPU1
[ 0.069107] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[ 0.096692] Detected VIPT I-cache on CPU2
[ 0.096726] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[ 0.124732] Detected VIPT I-cache on CPU3
[ 0.124762] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[ 0.124835] smp: Brought up 1 node, 4 CPUs
[ 0.124859] SMP: Total of 4 processors activated.
[ 0.124868] CPU features: detected feature: 32-bit EL0 Support
[ 0.124875] CPU features: detected feature: Kernel page table isolation (KPTI)
[ 0.128906] CPU: All CPU(s) started at EL2
[ 0.128926] alternatives: patching kernel code
[ 0.129962] devtmpfs: initialized
[ 0.132334] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[ 0.132342] random: fast init done
[ 0.132394] futex hash table entries: 1024 (order: 5, 131072 bytes)
[ 0.133109] pinctrl core: initialized pinctrl subsystem
[ 0.134312] DMI not present or invalid.
[ 0.134737] NET: Registered protocol family 16
[ 0.135117] audit: initializing netlink subsys (disabled)
[ 0.135268] audit: type=2000 audit(0.132:1): state=initialized audit_enabled=0 res=1
[ 0.136901] cpuidle: using governor menu
[ 0.137147] vdso: 2 pages (1 code @ (ptrval), 1 data @ (ptrval))
[ 0.137166] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[ 0.141408] DMA: preallocated 256 KiB pool for atomic allocations
[ 0.142169] Serial: AMBA PL011 UART driver
[ 0.156626] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[ 0.157065] cryptd: max_cpu_qlen set to 1000
[ 0.157711] ACPI: Interpreter disabled.
[ 0.158660] vgaarb: loaded
[ 0.158964] SCSI subsystem initialized
[ 0.159510] usbcore: registered new interface driver usbfs
[ 0.159565] usbcore: registered new interface driver hub
[ 0.159650] usbcore: registered new device driver usb
[ 0.160202] pps_core: LinuxPPS API ver. 1 registered
[ 0.160211] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <***@linux.it>
[ 0.160240] PTP clock support registered
[ 0.160359] EDAC MC: Ver: 3.0.0
[ 0.161092] Advanced Linux Sound Architecture Driver Initialized.
[ 0.161921] clocksource: Switched to clocksource arch_sys_counter
[ 0.162109] VFS: Disk quotas dquot_6.6.0
[ 0.162176] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[ 0.162333] pnp: PnP ACPI: disabled
[ 0.169407] NET: Registered protocol family 2
[ 0.169878] tcp_listen_portaddr_hash hash table entries: 512 (order: 1, 8192 bytes)
[ 0.170059] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
[ 0.170171] TCP bind hash table entries: 8192 (order: 5, 131072 bytes)
[ 0.170344] TCP: Hash tables configured (established 8192 bind 8192)
[ 0.170507] UDP hash table entries: 512 (order: 2, 16384 bytes)
[ 0.170611] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[ 0.170794] NET: Registered protocol family 1
[ 0.171215] RPC: Registered named UNIX socket transport module.
[ 0.171224] RPC: Registered udp transport module.
[ 0.171230] RPC: Registered tcp transport module.
[ 0.171235] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.171864] kvm [1]: 8-bit VMID
[ 0.171873] kvm [1]: IDMAP page: 40a48000
[ 0.171880] kvm [1]: HYP VA range: 800000000000:ffffffffffff
[ 0.172861] kvm [1]: vgic-***@1c84000
[ 0.172945] kvm [1]: vgic interrupt IRQ1
[ 0.172989] kvm [1]: virtual timer IRQ4
[ 0.173074] kvm [1]: Hyp mode initialized successfully
[ 0.176291] Initialise system trusted keyrings
[ 0.176430] workingset: timestamp_bits=44 max_order=18 bucket_order=0
[ 0.185478] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.186255] NFS: Registering the id_resolver key type
[ 0.186290] Key type id_resolver registered
[ 0.186297] Key type id_legacy registered
[ 0.186312] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[ 0.186542] 9p: Installing v9fs 9p2000 file system support
[ 0.189310] Key type asymmetric registered
[ 0.189322] Asymmetric key parser 'x509' registered
[ 0.189524] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245)
[ 0.189535] io scheduler noop registered
[ 0.189759] io scheduler cfq registered (default)
[ 0.189769] io scheduler mq-deadline registered
[ 0.189776] io scheduler kyber registered
[ 0.195756] sun50i-a64-r-pinctrl 1f02c00.pinctrl: initialized sunXi PIO driver
[ 0.198058] EINJ: ACPI disabled.
[ 0.205744] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[ 0.207692] dw-apb-uart 1c28000.serial: could not find pctldev for node /soc/***@1c20800/***@0, deferring probe
[ 0.208021] SuperH (H)SCI(F) driver initialized
[ 0.208247] msm_serial: driver initialized
[ 0.208771] cacheinfo: Unable to detect cache hierarchy for CPU 0
[ 0.215800] loop: module loaded
[ 0.219117] libphy: Fixed MDIO Bus: probed
[ 0.219587] tun: Universal TUN/TAP device driver, 1.6
[ 0.220293] thunder_xcv, ver 1.0
[ 0.220346] thunder_bgx, ver 1.0
[ 0.220400] nicpf, ver 1.0
[ 0.220631] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
[ 0.220638] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[ 0.220699] igb: Intel(R) Gigabit Ethernet Network Driver - version 5.4.0-k
[ 0.220706] igb: Copyright (c) 2007-2014 Intel Corporation.
[ 0.220760] igbvf: Intel(R) Gigabit Virtual Function Network Driver - version 2.4.0-k
[ 0.220767] igbvf: Copyright (c) 2009 - 2012 Intel Corporation.
[ 0.220999] sky2: driver version 1.30
[ 0.221422] VFIO - User Level meta-driver version: 0.3
[ 0.222429] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 0.222441] ehci-pci: EHCI PCI platform driver
[ 0.222495] ehci-platform: EHCI generic platform driver
[ 0.222573] ehci-orion: EHCI orion driver
[ 0.222638] ehci-exynos: EHCI EXYNOS driver
[ 0.222702] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 0.222731] ohci-pci: OHCI PCI platform driver
[ 0.222786] ohci-platform: OHCI generic platform driver
[ 0.222856] ohci-exynos: OHCI EXYNOS driver
[ 0.223182] usbcore: registered new interface driver usb-storage
[ 0.225316] sun6i-rtc 1f00000.rtc: rtc core: registered rtc-sun6i as rtc0
[ 0.225332] sun6i-rtc 1f00000.rtc: RTC enabled
[ 0.225551] i2c /dev entries driver
[ 0.227905] sdhci: Secure Digital Host Controller Interface driver
[ 0.227919] sdhci: Copyright(c) Pierre Ossman
[ 0.228090] Synopsys Designware Multimedia Card Interface Driver
[ 0.228508] sunxi-mmc 1c0f000.mmc: could not find pctldev for node /soc/***@1c20800/mmc0-pins, deferring probe
[ 0.228636] sdhci-pltfm: SDHCI platform and OF driver helper
[ 0.229438] ledtrig-cpu: registered to indicate activity on CPUs
[ 0.230416] usbcore: registered new interface driver usbhid
[ 0.230428] usbhid: USB HID core driver
[ 0.232589] NET: Registered protocol family 17
[ 0.232687] 9pnet: Installing 9P2000 support
[ 0.232763] Key type dns_resolver registered
[ 0.233455] registered taskstats version 1
[ 0.233464] Loading compiled-in X.509 certificates
[ 0.234158] BUG: Bad page state in process swapper/0 pfn:7d541
[ 0.234172] page:ffff7e0000f55040 count:72 mapcount:0 mapping:0000000000000000 index:0x0
[ 0.234183] flags: 0xfffc00000000000()
[ 0.234197] raw: 0fffc00000000000 0000000000000000 0000000000000000 00000048ffffffff
[ 0.234207] raw: ffff7e0000f55060 ffff7e0000f55060 0000000000000000 0000000000000000
[ 0.234213] page dumped because: nonzero _count
[ 0.234218] Modules linked in:
[ 0.234232] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.16.0-rc5 #2
[ 0.234238] Hardware name: Olimex A64-Olinuxino (DT)
[ 0.234244] Call trace:
[ 0.234264] dump_backtrace+0x0/0x198
[ 0.234274] show_stack+0x14/0x20
[ 0.234286] dump_stack+0x98/0xbc
[ 0.234297] bad_page+0xe4/0x148
[ 0.234305] check_new_page_bad+0x68/0x90
[ 0.234315] get_page_from_freelist+0x600/0x1090
[ 0.234324] __alloc_pages_nodemask+0xfc/0xc00
[ 0.234337] alloc_page_interleave+0x18/0xa8
[ 0.234344] alloc_pages_current+0xd4/0xe8
[ 0.234354] new_slab+0x41c/0x610
[ 0.234363] ___slab_alloc+0x4ac/0x560
[ 0.234372] __slab_alloc.isra.23+0x24/0x38
[ 0.234381] kmem_cache_alloc+0x1ac/0x1e0
[ 0.234392] alloc_inode+0x5c/0xa0
[ 0.234401] new_inode_pseudo+0x10/0x50
[ 0.234410] new_inode+0x18/0x38
[ 0.234419] debugfs_get_inode+0x10/0x58
[ 0.234426] __debugfs_create_file+0x4c/0x110
[ 0.234434] debugfs_create_file_unsafe+0x28/0x30
[ 0.234443] debugfs_create_mode_unsafe+0x48/0x50
[ 0.234450] debugfs_create_ulong+0x20/0x28
[ 0.234461] clk_debug_create_one+0x48/0x1a8
[ 0.234473] clk_debug_init+0x10c/0x14c
[ 0.234482] do_one_initcall+0x50/0x160
[ 0.234492] kernel_init_freeable+0x184/0x224
[ 0.234501] kernel_init+0x10/0x108
[ 0.234509] ret_from_fork+0x10/0x18
[ 0.234516] Disabling lock debugging due to kernel taint
[ 0.243399] sun50i-a64-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.244630] console [ttyS0] disabled
[ 0.266350] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 10, base_baud = 1500000) is a U6_16550A
[ 1.393515] console [ttyS0] enabled
[ 1.399569] sunxi-mmc 1c0f000.mmc: Got CD GPIO
[ 1.429285] sunxi-mmc 1c0f000.mmc: base:0x (ptrval) irq:6
[ 1.435580] sun6i-rtc 1f00000.rtc: setting system clock to 1970-01-01 00:00:06 UTC (6)
[ 1.443771] ALSA device list:
[ 1.446755] No soundcards found.
[ 1.450577] Waiting for root device /dev/mmcblk0p2...
[ 1.471160] mmc0: new high speed SDHC card at address 1234
[ 1.478032] mmcblk0: mmc0:1234 SA04G 3.64 GiB
[ 1.484452] mmcblk0: p1 p2
[ 1.503600] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
[ 1.525088] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 1.533257] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[ 1.541747] devtmpfs: mounted
[ 1.545547] Freeing unused kernel memory: 1152K
/bin/sh: 0: can't access tty; job control turned off
# [ 210.369977] random: crng init done
Joonas Kylmälä
2018-03-13 14:19:00 UTC
Permalink
Post by Martin Lucina
U-boot seems fine -- it's once I start the kernel that things start to go
wrong. Just tried a mainline 4.16-rc5, and I get the same kernel BUG fairly
early during boot (though no immediate panic).
Sometimes the bootloader can put the hardware in a state in which the
Linux kernel panics.
Post by Martin Lucina
Once thing I'm not clear on -- should I be using the dtb that came with the
kernel (arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dtb) or just use
the one provided by U-boot via $fdtcontroladdr?
For u-boot use the u-boot dtb (it is included in
u-boot-sunxi-with-spl.bin so don't worry about this), and for kernel use
the kernel dtb.

Joonas
Martin Lucina
2018-03-13 16:44:32 UTC
Permalink
Post by Joonas Kylmälä
Post by Martin Lucina
U-boot seems fine -- it's once I start the kernel that things start to go
wrong. Just tried a mainline 4.16-rc5, and I get the same kernel BUG fairly
early during boot (though no immediate panic).
Sometimes the bootloader can put the hardware in a state in which the
Linux kernel panics.
And indeed, this looks like it was the culprit. I noticed that U-boot
2018.03 had been released as of a few hours ago, built that version and
with (at least) mainline 4.16-rc5 the board appears to be stable (has
sucessfully run a debootstrap --second-stage with no more BUG or panics).

Thanks!

-mato
Vagrant Cascadian
2018-03-13 20:18:29 UTC
Permalink
Post by Martin Lucina
I'm trying to bootstrap an Olimex A64-OLinuXino board from scratch, using
- cross-built mainline U-boot 2018.01 including the SPL and BL31 from latest
https://github.com/apritzel/arm-trusted-firmware.git#allwinner and
atf-allwinner is now in Debian (buster/testing and sid/unstable):

https://tracker.debian.org/atf-allwinner

Also, there is a bug report about enabling the a64-olinuxino in Debian's
u-boot package, it just lacks someone committing to test it:

https://bugs.debian.org/881564

https://wiki.debian.org/U-boot/


Presuming the linux kernel support is ok enough, that *might* be enough
to then enable debian-installer builds for this board.


live well,
vagrant
Martin Lucina
2018-03-13 21:46:29 UTC
Permalink
Post by Vagrant Cascadian
Post by Martin Lucina
I'm trying to bootstrap an Olimex A64-OLinuXino board from scratch, using
- cross-built mainline U-boot 2018.01 including the SPL and BL31 from latest
https://github.com/apritzel/arm-trusted-firmware.git#allwinner and
https://tracker.debian.org/atf-allwinner
Also, there is a bug report about enabling the a64-olinuxino in Debian's
https://bugs.debian.org/881564
Subscribed.
Post by Vagrant Cascadian
https://wiki.debian.org/U-boot/
Presuming the linux kernel support is ok enough, that *might* be enough
to then enable debian-installer builds for this board.
Unfortunately not --- the instability came back from me. I'm continuing the
discussion in a thread on linux-sunxi; will report back here once I have a
working kernel.

-mato

Loading...