Hi,

On 13/03/18 14:18, Martin Lucina wrote:
> Hi,
> 
> I'm trying to bootstrap Debian on an Olimex A64-OLinuXino board from
> scratch with mainline U-boot and kernel, using Debian stretch on x86_64 as
> the build host. For reference, here is the procedure I'm 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
>   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

Please don't use those old values from the 32-bit Allwinner port. There
is $kernel_addr_r and $fdt_addr_r for those purposes, which have been
set up correctly for your platform. On ARM64 the preferred load
addresses are different (0x40080000 for kernel, much higher for the DT).

Does that solve the issue for you?

>   (dtb is arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dtb)
> 
> However, while running the debootstrap 2nd stage on the board, it seems that
> the kernel is not stable:

Another thing to check if you are seeing stability issues is the power
supply (including cabling) and the SD card quality. Sounds stupid, I
know, but is really responsible for many crashes. I happened to see
crashes where the actual power supply had a loose contact and the board
actually booted via the current leaked in from serial, though it crashed
very soon.

> 
>     # 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've now also tried with a 4.16-rc5 kernel and get the same "bad page
> state" early in the boot process.
> 
> Are current mainline kernels stable on this board, or do I need some extra
> patches? Headless operation is enough for me. 
> 
> Also, another thing which is not clear to me -- should I use the dtb that
> came with the kernel, or the one that comes with U-boot via
> $fdtcontroladdr? Either option does not change the BUG for me.

For now I would take the one from the kernel, if you care about
Ethernet. However I will soon resend a DT update series which would
allow you to use $fdtcontroladdr.

Cheers,
Andre.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to