FlorentRevest / linux

My development branches for Linux kernel stuff
Other
25 stars 12 forks source link

.config #1

Open streamnsight opened 8 years ago

streamnsight commented 8 years ago

Any chance you could share the .config you used to compile this Kernel for CHIP?

I'm trying to reproduce your MP2/MP4 demo on CHIP, but so far I was not able to get the kernel to boot starting from a working 4.4 kernel .config file

Thanks

FlorentRevest commented 8 years ago

Hi, I just used multi_v7_defconfig and enabled CONFIG_VIDEO_SUNXI_CEDRUS from menuconfig.

streamnsight commented 8 years ago

Merci de la reponse rapide, I will try asap.

Did you need to update uboot on the board or anything else?

FlorentRevest commented 8 years ago

In case you need HDMI or PocketCHIP's LCD capabilities, you will most likely need to have a newer UBoot with device tree overlay capabilities and so on, but otherwise that should be fine with whatever version you already have.

streamnsight commented 8 years ago

I must have another issue. I tried the multi_v7_defconfig config and built the kernel but it still won't boot.

I have built 4.3 and 4.4 kernels before for this board and had issues when DTB wasn't right, but got these to work eventually.

I transfer boot/zImage, boot/System.map, boot/sun5i-r8-chip.dtb and then the lib folder with the modules over to the board. The bootcmd loads boot/zImage and boot/sun5i-r8-chip.dtb and that works fine with a 4.4 kernel.

Anything else obvious I am missing?

I noticed there is no lib/firmware folder, but i'm guessing it's because the config is bare minimal without onboard features...

I have used the master branch. Should I be using dev?

Thanks for your help.

FlorentRevest commented 8 years ago

The master branch is fine and you don't need /lib/firmware for sunxi-cedrus.

Do you have a serial cable to grab the boot logs on UART and get a better idea of what's going wrong ?

streamnsight commented 8 years ago

I do all this with the TTY serial to edit bootcmd and revert to a working kernel when it fails .

I can see the kernel and dtb get loaded and then it hangs at starting kernel. no log from there.

I was just reading through the http://linux-sunxi.org/Mainline_Kernel_Howto again and wonder if i need to adjust the memory addresses the kernel and dtb get loaded at.

FlorentRevest commented 8 years ago

I don't think that changing the memory addresses will help...

I will see if I can find some time to try it again on my CHIP tomorow afternoon but I can't promise I will have the time.

streamnsight commented 8 years ago

no luck... i'm stuck here:

U-Boot SPL 2015.10-00003-gaf62f4a-dirty (Feb 19 2016 - 16:54:25)
DRAM: 512 MiB
CPU: 1008000000Hz, AXI/AHB/APB: 3/2/2

U-Boot 2015.10-00003-gaf62f4a-dirty (Feb 19 2016 - 16:54:25 -0800) Allwinner Technology

CPU:   Allwinner A13 (SUN5I)
I2C:   ready
DRAM:  512 MiB
NAND:  8192 MiB
Setting up a 720x480i composite-ntsc console (overscan 40x20)
In:    serial
Out:   serial
Err:   serial
Net:   usb_ether
starting USB...
No controllers found
Hit any key to stop autoboot:  0
(FEL boot)
## Executing script at 43100000
Wrong image format for "source" command

device nand0 <sunxi-nand.0>, # parts = 5
 #: name                size            offset          mask_flags
 0: spl                 0x00400000      0x00000000      0
 1: spl-backup          0x00400000      0x00400000      0
 2: uboot               0x00400000      0x00800000      0
 3: env                 0x00400000      0x00c00000      0
 4: UBI                 0x1ff000000     0x01000000      0

active partition: nand0,0 - (spl) 0x00400000 @ 0x00000000

defaults:
mtdids  : none
mtdparts: none
UBI: attaching mtd1 to ubi0
UBI: scanning is finished
UBI: attached mtd1 (name "mtd=4", size 8176 MiB) to ubi0
UBI: PEB size: 2097152 bytes (4096 KiB), LEB size: 2064384 bytes
UBI: min./max. I/O unit sizes: 16384/16384, sub-page size 16384
UBI: VID header offset: 16384 (aligned 16384), data offset: 32768
UBI: good PEBs: 2041, bad PEBs: 3, corrupted PEBs: 0
UBI: user volume: 1, internal volumes: 1, max. volumes count: 128
UBI: max/mean erase counter: 16/4, WL threshold: 4096, image sequence number: 1098611298
UBI: available PEBs: 0, total reserved PEBs: 2041, PEBs reserved for bad PEB handling: 37
Loading file '/boot/sun5i-r8-chip.dtb' to addr 0x43000000 with size 23298 (0x00005b02)...
Done
Loading file '/boot/zImage' to addr 0x42000000 with size 7289400 (0x006f3a38)...
Done
Kernel image @ 0x42000000 [ 0x000000 - 0x6f3a38 ]
## Flattened Device Tree blob at 43000000
   Booting using the fdt blob at 0x43000000
   Loading Device Tree to 49ff7000, end 49fffb01 ... OK

Starting kernel ...
FlorentRevest commented 8 years ago

I don't have the correct UART adapter with me so I can't try it now but maybe you could try to enable earlyprintk to get more info about what's going on with your kernel?

streamnsight commented 8 years ago

I have tried to enable earlyprintk without luck so far... I'll work on this more.

streamnsight commented 8 years ago

Took me a little trial and error, but figured I needed the SunXi UART1 port.

here is the output:

Uncompressing Linux... done, booting the kernel.
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.8.0-rc3el007-g35f61b5 (mre@home) (gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.1) ) #26 SMP Tue Oct 18 22:18:17 PDT 2016
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt:Machine model: NextThing C.H.I.P.
[    0.000000] bootconsole [earlycon0] enabled
[    0.000000] Reserved memory: created DMA memory pool at 0x43d00000, size 144 MiB
[    0.000000] OF: reserved mem: initialized node cma, compatible id shared-dma-pool
[    0.000000] cma: Reserved 64 MiB at 0x5b800000
[    0.000000] Memory policy: Data cache writeback
[    0.000000] Unable to handle kernel paging request at virtual address c9ff7000
[    0.000000] pgd = c0204000
[    0.000000] [c9ff7000] *pgd=00000000
[    0.000000] Internal error: Oops: 5 [#1] SMP ARM
[    0.000000] Modules linked in:
[    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 4.8.0-rc3el007-g35f61b5 #26
[    0.000000] Hardware name: Allwinner sun4i/sun5i Families
[    0.000000] task: c1406440 task.stack: c1400000
[    0.000000] PC is at fdt_check_header+0x0/0x74
[    0.000000] LR is at __unflatten_device_tree+0x6c/0x29c
[    0.000000] pc : [<c0c0f6fc>]    lr : [<c0a9fc94>]    psr: 600000d3
[    0.000000] sp : c1401f28  ip : 5feacfff  fp : dfeacec0
[    0.000000] r10: c124cb74  r9 : 00000000  r8 : c1573388
[    0.000000] r7 : 00000000  r6 : c9ff7000  r5 : c1298bf0  r4 : c1529ff8
[    0.000000] r3 : 00000000  r2 : c1573388  r1 : 00000000  r0 : c9ff7000
[    0.000000] Flags: nZCv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment none
[    0.000000] Control: 10c5387d  Table: 40204019  DAC: 00000051
[    0.000000] Process swapper (pid: 0, stack limit = 0xc1400220)
[    0.000000] Stack: (0xc1401f28 to 0xc1402000)
[    0.000000] 1f20:                   c124cb74 c1298bf0 c1406100 c152e180 c14074b8 4cd00000
[    0.000000] 1f40: c155e61c c124d958 00000000 c034ad60 c1402408 c1204308 ffffffff 10c5387d
[    0.000000] 1f60: 00000000 c15540bc 00000000 c152e898 c0f681e4 80000200 ffffffff 40204059
[    0.000000] 1f80: 413fc082 00000000 00000000 c03898cc c0f6636c c1401fb4 c1557f10 00000000
[    0.000000] 1fa0: c152e000 c1402400 ffffffff c152e000 413fc082 00000000 00000000 c120096c
[    0.000000] 1fc0: 00000000 00000000 00000000 00000000 00000000 c12a8a30 c152e5d4 c1402480
[    0.000000] 1fe0: c12a8a2c c1407630 40204059 413fc082 00000000 4020807c 00000000 00000000
[    0.000000] [<c0c0f6fc>] (fdt_check_header) from [<c0a9fc94>] (__unflatten_device_tree+0x6c/0x29c)
[    0.000000] [<c0a9fc94>] (__unflatten_device_tree) from [<c124d958>] (unflatten_device_tree+0x34/0x44)
[    0.000000] [<c124d958>] (unflatten_device_tree) from [<c1204308>] (setup_arch+0x830/0xc38)
[    0.000000] [<c1204308>] (setup_arch) from [<c120096c>] (start_kernel+0x68/0x378)
[    0.000000] [<c120096c>] (start_kernel) from [<4020807c>] (0x4020807c)
[    0.000000] Code: e2833001 e5823030 e28dd06c e8bd8ff0 (e5903000)
[    0.000000] ---[ end trace 0000000000000000 ]---
[    0.000000] Kernel panic - not syncing: Attempted to kill the idle task!
[    0.000000] ---[ end Kernel panic - not syncing: Attempted to kill the idle task!

Now, that's a little beyond me.. Do you have any idea what could be wrong?

jemk commented 8 years ago

Thats that same error as my first test failed at, the devicetree is placed inside the reserved memory area by u-boot, so the kernel can't access it anymore. My workaround was to reduce the reserved memory size to 64MiB, you won't need the 144MiB anyway. In devicetree, ve_reserved: reg = <0x43d00000 0x4000000>; instead of the existing reg = ...

streamnsight commented 8 years ago

@jemk ah... Awesome, makes sense. I will try this. Thanks a lot!

streamnsight commented 8 years ago

ok.. making a little progress. I got to pass the loading error, but now it can't mount rootfs

device nand0 <sunxi-nand.0>, # parts = 5
 #: name                size            offset          mask_flags
 0: spl                 0x00400000      0x00000000      0
 1: spl-backup          0x00400000      0x00400000      0
 2: uboot               0x00400000      0x00800000      0
 3: env                 0x00400000      0x00c00000      0
 4: UBI                 0x1ff000000     0x01000000      0

active partition: nand0,0 - (spl) 0x00400000 @ 0x00000000

defaults:
mtdids  : none
mtdparts: none
UBI: attaching mtd1 to ubi0
UBI: scanning is finished
UBI: attached mtd1 (name "mtd=4", size 8176 MiB) to ubi0
UBI: PEB size: 2097152 bytes (4096 KiB), LEB size: 2064384 bytes
UBI: min./max. I/O unit sizes: 16384/16384, sub-page size 16384
UBI: VID header offset: 16384 (aligned 16384), data offset: 32768
UBI: good PEBs: 2041, bad PEBs: 3, corrupted PEBs: 0
UBI: user volume: 1, internal volumes: 1, max. volumes count: 128
UBI: max/mean erase counter: 17/4, WL threshold: 4096, image sequence number: 1098611298
UBI: available PEBs: 0, total reserved PEBs: 2041, PEBs reserved for bad PEB handling: 37
Loading file '/boot/sun5i-r8-chip.dtb' to addr 0x43000000 with size 26438 (0x00006746)...
Done
Loading file '/boot/zImage' to addr 0x42000000 with size 7007056 (0x006aeb50)...
Done
Kernel image @ 0x42000000 [ 0x000000 - 0x6aeb50 ]
## Flattened Device Tree blob at 43000000
   Booting using the fdt blob at 0x43000000
   Loading Device Tree to 49ff6000, end 49fff745 ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.8.0-rc3el007-ga7eed5a-dirty (mre@home) (gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.1) ) #35 SMP Wed Oct 19 22:36:27 PDT 2016
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt:Machine model: NextThing C.H.I.P.
[    0.000000] bootconsole [earlycon0] enabled
[    0.000000] Reserved memory: created DMA memory pool at 0x43d00000, size 64 MiB
[    0.000000] OF: reserved mem: initialized node cma, compatible id shared-dma-pool
[    0.000000] cma: Reserved 64 MiB at 0x5b800000
[    0.000000] Memory policy: Data cache writeback
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] percpu: Embedded 14 pages/cpu @dfe5f000 s25868 r8192 d23284 u57344
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 113327
[    0.000000] Kernel command line: root=ubi0:rootfs rootfstype=ubifs rw earlyprintk ubi.mtd=4
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] allocated 531124 bytes of page_ext
[    0.000000] Memory: 370084K/457396K available (9216K kernel code, 1090K rwdata, 3832K rodata, 2048K init, 405K bss, 21776K reserved, 65536K cma-reserved, 0K highmem)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xe0000000 - 0xff800000   ( 504 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xdfead000   ( 510 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0xc0208000 - 0xc0c00000   (10208 kB)
[    0.000000]       .init : 0xc1000000 - 0xc1200000   (2048 kB)
[    0.000000]       .data : 0xc1200000 - 0xc1310840   (1091 kB)
[    0.000000]        .bss : 0xc1312000 - 0xc13777b8   ( 406 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  Build-time adjustment of leaf fanout to 32.
[    0.000000]  RCU restricting CPUs from NR_CPUS=16 to nr_cpu_ids=1.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=1
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000024] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.007967] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.017664] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6370868154 ns
[    0.027697] Console: colour dummy device 80x30
[    0.032256] console [tty0] enabled
[    0.035747] bootconsole [earlycon0] disabled
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.8.0-rc3el007-ga7eed5a-dirty (mre@home) (gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.1) ) #35 SMP Wed Oct 19 22:36:27 PDT 2016
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt:Machine model: NextThing C.H.I.P.
[    0.000000] bootconsole [earlycon0] enabled
[    0.000000] Reserved memory: created DMA memory pool at 0x43d00000, size 64 MiB
[    0.000000] OF: reserved mem: initialized node cma, compatible id shared-dma-pool
[    0.000000] cma: Reserved 64 MiB at 0x5b800000
[    0.000000] Memory policy: Data cache writeback
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] percpu: Embedded 14 pages/cpu @dfe5f000 s25868 r8192 d23284 u57344
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 113327
[    0.000000] Kernel command line: root=ubi0:rootfs rootfstype=ubifs rw earlyprintk ubi.mtd=4
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] allocated 531124 bytes of page_ext
[    0.000000] Memory: 370084K/457396K available (9216K kernel code, 1090K rwdata, 3832K rodata, 2048K init, 405K bss, 21776K reserved, 65536K cma-reserved, 0K highmem)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xe0000000 - 0xff800000   ( 504 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xdfead000   ( 510 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0xc0208000 - 0xc0c00000   (10208 kB)
[    0.000000]       .init : 0xc1000000 - 0xc1200000   (2048 kB)
[    0.000000]       .data : 0xc1200000 - 0xc1310840   (1091 kB)
[    0.000000]        .bss : 0xc1312000 - 0xc13777b8   ( 406 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  Build-time adjustment of leaf fanout to 32.
[    0.000000]  RCU restricting CPUs from NR_CPUS=16 to nr_cpu_ids=1.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=1
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000024] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.007967] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.017664] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6370868154 ns
[    0.027697] Console: colour dummy device 80x30
[    0.032256] console [tty0] enabled
[    0.035747] bootconsole [earlycon0] disabled
[    0.040135] Calibrating delay loop... 1002.70 BogoMIPS (lpj=2506752)
[    0.067216] pid_max: default: 32768 minimum: 301
[    0.067492] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.067526] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.068672] CPU: Testing write buffer coherency: ok
[    0.069328] CPU0: thread -1, cpu 0, socket -1, mpidr 0
[    0.069452] Setting up static identity map for 0x40300000 - 0x40300098
[    0.072960] Brought up 1 CPUs
[    0.072992] SMP: Total of 1 processors activated (1002.70 BogoMIPS).
[    0.073004] CPU: All CPU(s) started in SVC mode.
[    0.074616] devtmpfs: initialized
[    0.084512] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[    0.085022] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302231375000 ns
[    0.144697] pinctrl core: initialized pinctrl subsystem
[    0.147008] NET: Registered protocol family 16
[    0.186248] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.188255] cpuidle: using governor menu
[    0.188588] No ATAGs?
[    0.188603] hw-breakpoint: debug architecture 0x4 unsupported.
[    0.190619] Serial: AMBA PL011 UART driver
[    0.216248] reg-fixed-voltage usb0-vbus: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/chip_vbus_pin@0, deferring probe
[    0.219454] vgaarb: loaded
[    0.220461] SCSI subsystem initialized
[    0.221152] usbcore: registered new interface driver usbfs
[    0.221237] usbcore: registered new interface driver hub
[    0.221333] usbcore: registered new device driver usb
[    0.222485] media: Linux media interface: v0.10
[    0.222567] Linux video capture interface: v2.00
[    0.222623] pps_core: LinuxPPS API ver. 1 registered
[    0.222642] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.222689] PTP clock support registered
[    0.222855] EDAC MC: Ver: 3.0.0
[    0.229749] DMA-API: preallocated 4096 debug entries
[    0.229814] DMA-API: debugging enabled by kernel config
[    0.229988] clocksource: Switched to clocksource timer
[    0.231656] simple-framebuffer 5febc000.framebuffer: framebuffer at 0x5febc000, 0x135600 bytes, mapped to 0xe0080000
[    0.231720] simple-framebuffer 5febc000.framebuffer: format=x8r8g8b8, mode=640x440x32, linelength=2880
[    0.236950] Console: switching to colour frame buffer device 80x27
[    0.243779] simple-framebuffer 5febc000.framebuffer: fb0: simplefb registered!
[    0.260491] NET: Registered protocol family 2
[    0.264217] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[    0.267349] TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
[    0.270259] TCP: Hash tables configured (established 4096 bind 4096)
[    0.273233] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.276090] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.279139] NET: Registered protocol family 1
[    0.282988] RPC: Registered named UNIX socket transport module.
[    0.286029] RPC: Registered udp transport module.
[    0.288910] RPC: Registered tcp transport module.
[    0.291723] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.297498] futex hash table entries: 256 (order: 2, 16384 bytes)
[    0.301416] workingset: timestamp_bits=30 max_order=17 bucket_order=0
[    0.317365] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.321660] NFS: Registering the id_resolver key type
[    0.324606] Key type id_resolver registered
[    0.327553] Key type id_legacy registered
[    0.330456] ntfs: driver 2.1.32 [Flags: R/O].
[    0.335681] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
[    0.341566] io scheduler noop registered
[    0.344370] io scheduler deadline registered
[    0.347313] io scheduler cfq registered (default)
[    0.352507] sun4i-usb-phy 1c13400.phy: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/chip_id_det_pin@0, deferring probe
[    0.359024] libphy: mdio_driver_register: phy-bcm-ns2-pci
[    0.365994] sun5i-a13-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.453481] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.478635] 1c28400.serial: ttyS0 at MMIO 0x1c28400 (irq = 27, base_baud = 1500000) is a U6_16550A
[    1.131363] console [ttyS0] enabled
[    1.160005] 1c28800.serial: ttyS2 at MMIO 0x1c28800 (irq = 28, base_baud = 1500000) is a U6_16550A
[    1.194810] 1c28c00.serial: ttyS1 at MMIO 0x1c28c00 (irq = 29, base_baud = 1500000) is a U6_16550A
[    1.210876] SuperH (H)SCI(F) driver initialized
[    1.219324] msm_serial: driver initialized
[    1.226579] STMicroelectronics ASC driver initialized
[    1.237294] [drm] Initialized drm 1.1.0 20060810
[    1.264179] brd: module loaded
[    1.281373] loop: module loaded
[    1.295277] libphy: Fixed MDIO Bus: probed
[    1.303304] CAN device driver interface
[    1.311490] igb: Intel(R) Gigabit Ethernet Network Driver - version 5.3.0-k
[    1.321395] igb: Copyright (c) 2007-2014 Intel Corporation.
[    1.332211] pegasus: v0.9.3 (2013/04/25), Pegasus/Pegasus II USB Ethernet driver
[    1.345409] usbcore: registered new interface driver pegasus
[    1.354114] usbcore: registered new interface driver asix
[    1.362496] usbcore: registered new interface driver ax88179_178a
[    1.371502] usbcore: registered new interface driver cdc_ether
[    1.380141] usbcore: registered new interface driver smsc75xx
[    1.388642] usbcore: registered new interface driver smsc95xx
[    1.396991] usbcore: registered new interface driver net1080
[    1.405144] usbcore: registered new interface driver cdc_subset
[    1.413449] usbcore: registered new interface driver zaurus
[    1.421329] usbcore: registered new interface driver cdc_ncm
[    1.430800] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.439618] ehci-pci: EHCI PCI platform driver
[    1.446254] ehci-platform: EHCI generic platform driver
[    1.453929] ehci-orion: EHCI orion driver
[    1.460189] SPEAr-ehci: EHCI SPEAr driver
[    1.466329] ehci-st: EHCI STMicroelectronics driver
[    1.473330] ehci-exynos: EHCI EXYNOS driver
[    1.479616] ehci-atmel: EHCI Atmel driver
[    1.485672] tegra-ehci: Tegra EHCI driver
[    1.491703] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.499910] ohci-pci: OHCI PCI platform driver
[    1.506419] ohci-platform: OHCI generic platform driver
[    1.513952] ohci-omap3: OHCI OMAP3 driver
[    1.520117] SPEAr-ohci: OHCI SPEAr driver
[    1.526151] ohci-st: OHCI STMicroelectronics driver
[    1.532998] ohci-atmel: OHCI Atmel driver
[    1.539419] usbcore: registered new interface driver usb-storage
[    1.548795] mousedev: PS/2 mouse device common for all mice
[    1.560494] i2c /dev entries driver
[    1.570354] pcf857x 2-0038: probed
[    1.578048] clk: couldn't get clock 0 for /soc@01c00000/video-engine
[    1.591372] sunxi-wdt 1c20c90.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    1.607997] sdhci: Secure Digital Host Controller Interface driver
[    1.616716] sdhci: Copyright(c) Pierre Ossman
[    1.624684] Synopsys Designware Multimedia Card Interface Driver
[    1.654993] random: fast init done
[    1.680014] sunxi-mmc 1c0f000.mmc: base:0xe0240000 irq:20
[    1.688137] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.698547] ledtrig-cpu: registered to indicate activity on CPUs
[    1.707720] usbcore: registered new interface driver usbhid
[    1.715946] usbhid: USB HID core driver
[    1.728333] NET: Registered protocol family 10
[    1.737062] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    1.746618] NET: Registered protocol family 17
[    1.753797] can: controller area network core (rev 20120528 abi 9)
[    1.762769] NET: Registered protocol family 29
[    1.769863] can: raw protocol (rev 20120528)
[    1.776752] can: broadcast manager protocol (rev 20160617 t)
[    1.785078] can: netlink gateway (rev 20130117) max_hops=1
[    1.794049] Key type dns_resolver registered
[    1.801270] ThumbEE CPU extension supported.
[    1.808290] Registering SWP/SWPB emulation handler
[    1.820322] sunxi-mmc 1c0f000.mmc: smc 0 err, cmd 8, RTO !!
[    1.830983] usb0-vbus: supplied by vcc5v0
[    1.846518] clk: couldn't get clock 0 for /soc@01c00000/video-engine
[    1.859239] UBI error: cannot open mtd 4, error -19
[    1.864590] hctosys: unable to open rtc device (rtc0)
[    1.880485] vcc3v0: disabling
[    1.886211] vcc5v0: disabling
[    1.891669] usb0-vbus: disabling
[    1.898628] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    1.911914] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.8.0-rc3el007-ga7eed5a-dirty #35
[    1.925019] Hardware name: Allwinner sun4i/sun5i Families
[    1.933055] [<c0310a00>] (unwind_backtrace) from [<c030bda0>] (show_stack+0x10/0x14)
[    1.946065] [<c030bda0>] (show_stack) from [<c05a02b0>] (dump_stack+0x88/0x9c)
[    1.958779] [<c05a02b0>] (dump_stack) from [<c03d3a50>] (panic+0xdc/0x260)
[    1.968526] [<c03d3a50>] (panic) from [<c1001208>] (mount_block_root+0x198/0x270)
[    1.981662] [<c1001208>] (mount_block_root) from [<c1001594>] (prepare_namespace+0x9c/0x1c4)
[    1.996030] [<c1001594>] (prepare_namespace) from [<c1000e40>] (kernel_init_freeable+0x1d8/0x1e8)
[    2.011039] [<c1000e40>] (kernel_init_freeable) from [<c0bda9c8>] (kernel_init+0x8/0x114)
[    2.025596] [<c0bda9c8>] (kernel_init) from [<c0307eb8>] (ret_from_fork+0x14/0x3c)
[    2.039781] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

Someone on the CHIP forum mentioned the "Nextthing's kernel includes patches to use Chip's MLC NAND in SLC mode."

When I boot a 4.3 kernel I see stuff like:

[    1.110000] nand: device found, Manufacturer ID: 0xad, Chip ID: 0xde
[    1.120000] nand: Hynix H27QCG8T2E5R‐BCF 64G 3.3V 8-bit
[    1.130000] nand: 8192 MiB, MLC, erase size: 4096 KiB, page size: 16384, OOB size: 1664
[    1.140000] Scanning device for bad blocks
[    1.260000] random: nonblocking pool is initialized
[    1.340000] Bad eraseblock 740 at 0x0000b93fc000
[    1.340000] Bad eraseblock 741 at 0x0000b97fc000
[    1.660000] Bad eraseblock 1999 at 0x0001f3ffc000
[    1.680000] 5 ofpart partitions found on MTD device H27QCG8T2E5R‐BCF 64G 3.3V 8-bit
[    1.690000] Creating 5 MTD partitions on "H27QCG8T2E5R‐BCF 64G 3.3V 8-bit":
[    1.700000] 0x000000000000-0x000000400000 : "SPL"
[    1.710000] 0x000000400000-0x000000800000 : "SPL.backup"
[    1.720000] 0x000000800000-0x000000c00000 : "U-Boot"
[    1.730000] 0x000000c00000-0x000001000000 : "env"
[    1.730000] 0x000001000000-0x000200000000 : "rootfs"

which does not appear here.

So @FlorentRevest , I'm confused about this kernel and repo: is it supposed to work 'as-is' on CHIP, or is this a generic kernel that needs to be patched to work on CHIP?

Thanks for your feedback.

FlorentRevest commented 8 years ago

This kernel is a mainline kernel so it doesn't include the NAND support needed on the CHIP. You should boot your rootfs on NFS or patch it.

Colecf commented 7 years ago

@FlorentRevest I'm also trying to get this kernel on the chip. I'm trying to set up NFS booting over usb via the usb_ether gadget, but this repository doesn't appear to have the sunxi usb drivers normally in drivers/usb/sunxi_usb (or device drivers > usb support > SUNXI USB2.0 Dual role controller support in menuconfig).

Would those need to be patched in as well, or is there another way to do it?

FlorentRevest commented 7 years ago

Hi @Colecf. I'm 100% sure I used this kernel with a NFS rootfs. I don't remember the exact config but I remember I didn't have to patch the kernel.

Colecf commented 7 years ago

Did you use some other method of networking than the usb_ether gadget then? When I try to boot the kernel, I get udc-core: couldn't find an available UDC - added [g_ether] to list of pending drivers, presumably because the SUNXI USB2.0 Dual Role Controller Support isn't enabled, and doesn't exist in drivers/usb. My full earlyprintk output is here if you want to take a look.

Were you using wifi to mount the rootfs?

dTatham commented 7 years ago

I managed to boot a mainline 4.12 on the CHIP to the stage where I had a working shell; I suspect there's a problem with the USB configuration in the DTS (hence the "deferring probe" bit)

NAND support is tricky - from what I can tell at this stage: the CHIP-u-boot expects the UBIFS image and UBI container to have certain attributes / settings to recognize it, which in turn don't play well with a vanilla kernel (hence the UBI error: cannot open mtd 4, error -19 or u-boot trowing a error 22 when trying to mount the ubi partition) I had some minor success with a vanilla tool set (mainline uboot, kernel and mtd-utils), however I had to "flash" the rootfs byway of creating a initrd which I could boot from via USB (which works in mainline uboot 2017.x)