hey guys,
how about this ? a mainline 4.12.0 kernel, patched on the fly with a shell script (and using only sed, ed and cp), which successfully boots on a kvim pro and says…
Starting kernel ...
uboot time: 1787695 us
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.12.0 (raxy@bodhi-giada) (gcc version 4.8.4 (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.1) ) #1 SMP PREEMPT Mon Aug 14 01:00:45 CEST 2017
[ 0.000000] Boot CPU: AArch64 Processor [410fd034]
[ 0.000000] Machine model: Khadas VIM
[ 0.000000] efi: Getting EFI parameters from FDT:
[ 0.000000] efi: UEFI not found.
[ 0.000000] Reserved memory: created CMA memory pool at 0x0000000067400000, size 188 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 0x0000000000000000-0x0000000077ffffff]
[ 0.000000] NUMA: Adding memblock [0x1000000 - 0xfffffff] on node 0
[ 0.000000] NUMA: Adding memblock [0x10200000 - 0x77ffffff] on node 0
[ 0.000000] NUMA: Initmem setup node 0 [mem 0x01000000-0x77ffffff]
[ 0.000000] NUMA: NODE_DATA [mem 0x77fd1f80-0x77fd3a7f]
[ 0.000000] Zone ranges:
[ 0.000000] DMA [mem 0x0000000001000000-0x0000000077ffffff]
[ 0.000000] Normal empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000001000000-0x000000000fffffff]
[ 0.000000] node 0: [mem 0x0000000010200000-0x0000000077ffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000001000000-0x0000000077ffffff]
[ 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 24 pages/cpu @ffff800077f6e000 s59264 r8192 d30848 u98304
[ 0.000000] Detected VIPT I-cache on CPU0
[ 0.000000] CPU features: enabling workaround for ARM erratum 845719
[ 0.000000] Built 1 zonelists in Node order, mobility grouping on. Total pages: 479296
[ 0.000000] Policy zone: DMA
[ 0.000000] Kernel command line: root=LABEL=ROOTFS rootflags=data=writeback rw rootwait console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 logo=osd1,loaded,0x3d800000,1080p60hz,full hdmimode=1080p60hz m_bpp=32 dmfc=3 vout=hdmi cvbsmode=576cvbs fsck.repair=yes net.ifnames=0
[ 0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.000000] Memory: 1694060K/1947648K available (8572K kernel code, 980K rwdata, 3720K rodata, 896K init, 404K bss, 61076K reserved, 192512K cma-reserved)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] modules : 0xffff000000000000 - 0xffff000008000000 ( 128 MB)
[ 0.000000] vmalloc : 0xffff000008000000 - 0xffff7dffbfff0000 (129022 GB)
[ 0.000000] .text : 0xffff000008080000 - 0xffff0000088e0000 ( 8576 KB)
[ 0.000000] .rodata : 0xffff0000088e0000 - 0xffff000008c90000 ( 3776 KB)
[ 0.000000] .init : 0xffff000008c90000 - 0xffff000008d70000 ( 896 KB)
[ 0.000000] .data : 0xffff000008d70000 - 0xffff000008e65200 ( 981 KB)
[ 0.000000] .bss : 0xffff000008e65200 - 0xffff000008eca200 ( 404 KB)
[ 0.000000] fixed : 0xffff7dfffe7fd000 - 0xffff7dfffec00000 ( 4108 KB)
[ 0.000000] PCI I/O : 0xffff7dfffee00000 - 0xffff7dffffe00000 ( 16 MB)
[ 0.000000] vmemmap : 0xffff7e0000000000 - 0xffff800000000000 ( 2048 GB maximum)
[ 0.000000] 0xffff7e0000040000 - 0xffff7e0001e00000 ( 29 MB actual)
[ 0.000000] memory : 0xffff800001000000 - 0xffff800078000000 ( 1904 MB)
[ 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] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[ 0.000000] NR_IRQS:64 nr_irqs:64 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.000004] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[ 0.000295] Console: colour dummy device 80x25
[ 0.001042] console [tty0] enabled
[ 0.001098] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=96000)
[ 0.001127] pid_max: default: 32768 minimum: 301
[ 0.001198] Security Framework initialized
[ 0.001630] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes)
[ 0.003171] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes)
[ 0.004125] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.004149] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.020041] ASID allocator initialised with 65536 entries
[ 0.036755] EFI services will not be available.
[ 0.052079] smp: Bringing up secondary CPUs ...
[ 0.084293] Detected VIPT I-cache on CPU1
[ 0.084342] CPU1: Booted secondary processor [410fd034]
[ 0.116326] Detected VIPT I-cache on CPU2
[ 0.116362] CPU2: Booted secondary processor [410fd034]
[ 0.148372] Detected VIPT I-cache on CPU3
[ 0.148406] CPU3: Booted secondary processor [410fd034]
[ 0.148456] smp: Brought up 1 node, 4 CPUs
[ 0.148547] SMP: Total of 4 processors activated.
[ 0.148564] CPU features: detected feature: 32-bit EL0 Support
[ 0.148583] CPU: All CPU(s) started at EL2
[ 0.148609] alternatives: patching kernel code
[ 0.149262] devtmpfs: initialized
[ 0.152645] DMI not present or invalid.
[ 0.152846] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[ 0.152913] futex hash table entries: 1024 (order: 5, 131072 bytes)
[ 0.156897] pinctrl core: initialized pinctrl subsystem
[ 0.158015] NET: Registered protocol family 16
[ 0.159557] cpuidle: using governor menu
[ 0.160251] vdso: 2 pages (1 code @ ffff0000088e7000, 1 data @ ffff000008d75000)
[ 0.160291] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[ 0.161205] DMA: preallocated 256 KiB pool for atomic allocations
[ 0.161501] Serial: AMBA PL011 UART driver
[ 0.174602] HugeTLB registered 2 MB page size, pre-allocated 0 pages
[ 0.175497] ACPI: Interpreter disabled.
[ 0.176802] vgaarb: loaded
[ 0.177042] SCSI subsystem initialized
[ 0.177422] usbcore: registered new interface driver usbfs
[ 0.177488] usbcore: registered new interface driver hub
[ 0.177572] usbcore: registered new device driver usb
[ 0.178227] pps_core: LinuxPPS API ver. 1 registered
[ 0.178249] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.178287] PTP clock support registered
[ 0.178410] dmi: Firmware registration failed.
[ 0.178902] Advanced Linux Sound Architecture Driver Initialized.
[ 0.179793] clocksource: Switched to clocksource arch_sys_counter
[ 0.179942] VFS: Disk quotas dquot_6.6.0
[ 0.179998] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[ 0.180200] pnp: PnP ACPI: disabled
[ 0.185612] NET: Registered protocol family 2
[ 0.186056] TCP established hash table entries: 16384 (order: 5, 131072 bytes)
[ 0.186254] TCP bind hash table entries: 16384 (order: 6, 262144 bytes)
[ 0.186518] TCP: Hash tables configured (established 16384 bind 16384)
[ 0.186637] UDP hash table entries: 1024 (order: 3, 32768 bytes)
[ 0.186703] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes)
[ 0.186862] NET: Registered protocol family 1
[ 0.187161] RPC: Registered named UNIX socket transport module.
[ 0.187181] RPC: Registered udp transport module.
[ 0.187195] RPC: Registered tcp transport module.
[ 0.187208] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.187367] Unpacking initramfs...
[ 0.793219] Freeing initrd memory: 13008K
[ 0.793939] hw perfevents: enabled with armv8_cortex_a53 PMU driver, 7 counters available
[ 0.794182] kvm [1]: 8-bit VMID
[ 0.794198] kvm [1]: IDMAP page: 18ca000
[ 0.794212] kvm [1]: HYP VA range: 800000000000:ffffffffffff
[ 0.794827] kvm [1]: Hyp mode initialized successfully
[ 0.794872] kvm [1]: vgic-v2@c4304000
[ 0.794945] kvm [1]: vgic interrupt IRQ1
[ 0.794968] kvm [1]: virtual timer IRQ4
[ 0.796882] audit: initializing netlink subsys (disabled)
[ 0.797003] audit: type=2000 audit(0.793:1): state=initialized audit_enabled=0 res=1
[ 0.797306] workingset: timestamp_bits=44 max_order=19 bucket_order=0
[ 0.803042] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.803596] NFS: Registering the id_resolver key type
[ 0.803637] Key type id_resolver registered
[ 0.803651] Key type id_legacy registered
[ 0.803672] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[ 0.803892] 9p: Installing v9fs 9p2000 file system support
[ 0.805713] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
[ 0.805749] io scheduler noop registered
[ 0.805948] io scheduler cfq registered (default)
[ 0.805968] io scheduler mq-deadline registered
[ 0.805982] io scheduler kyber registered
[ 0.811130] of_pwm_get(): PWM chip not found
[ 0.814432] xenfs: not registering filesystem on non-xen platform
[ 0.817556] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[ 0.818903] SuperH (H)SCI(F) driver initialized
[ 0.819372] c11084c0.serial: ttyAML1 at MMIO 0xc11084c0 (irq = 10, base_baud = 1500000) is a meson_uart
[ 0.819727] c81004c0.serial: ttyAML0 at MMIO 0xc81004c0 (irq = 14, base_baud = 1500000) is a meson_uart
[ 1.663592] console [ttyAML0] enabled
[ 1.667581] c81004e0.serial: ttyAML2 at MMIO 0xc81004e0 (irq = 15, base_baud = 1500000) is a meson_uart
[ 1.676947] msm_serial: driver initialized
[ 1.687716] loop: module loaded
[ 1.688207] hisi_sas: driver version v1.6
[ 1.691177] mdio-mux-mmioreg c883455c.eth-phy-mux: failed to register mdio-mux bus /soc/periphs@c8834000/eth-phy-mux
[ 1.700179] libphy: Fixed MDIO Bus: probed
[ 1.704085] tun: Universal TUN/TAP device driver, 1.6
[ 1.709836] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
[ 1.714504] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[ 1.720425] igb: Intel(R) Gigabit Ethernet Network Driver - version 5.4.0-k
[ 1.727262] igb: Copyright (c) 2007-2014 Intel Corporation.
[ 1.732837] igbvf: Intel(R) Gigabit Virtual Function Network Driver - version 2.4.0-k
[ 1.740542] igbvf: Copyright (c) 2009 - 2012 Intel Corporation.
[ 1.746816] sky2: driver version 1.30
[ 1.750580] VFIO - User Level meta-driver version: 0.3
[ 1.756448] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.761594] ehci-pci: EHCI PCI platform driver
[ 1.766039] ehci-platform: EHCI generic platform driver
[ 1.771358] ehci-orion: EHCI orion driver
[ 1.775277] ehci-msm: Qualcomm On-Chip EHCI Host Controller
[ 1.780766] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 1.786792] ohci-pci: OHCI PCI platform driver
[ 1.791229] ohci-platform: OHCI generic platform driver
[ 1.796840] usbcore: registered new interface driver usb-storage
[ 1.804151] i2c /dev entries driver
[ 1.809245] sdhci: Secure Digital Host Controller Interface driver
[ 1.811884] sdhci: Copyright(c) Pierre Ossman
[ 1.816618] Synopsys Designware Multimedia Card Interface Driver
[ 1.823511] meson-gx-mmc d0072000.mmc: Got CD GPIO
[ 1.869256] meson-gx-mmc d0074000.mmc: allocated mmc-pwrseq
[ 1.907993] sdhci-pltfm: SDHCI platform and OF driver helper
[ 1.909164] of_pwm_get(): PWM chip not found
[ 1.913383] leds_pwm pwmleds: unable to request PWM for vim:red:power: -517
[ 1.921282] ledtrig-cpu: registered to indicate activity on CPUs
[ 1.925572] meson-sm: secure-monitor enabled
[ 1.929930] usbcore: registered new interface driver usbhid
[ 1.934878] usbhid: USB HID core driver
[ 1.938946] platform-mhu c883c404.mailbox: Platform MHU Mailbox registered
[ 1.947083] amlogic rfkill init
[ 1.948797] enter bt_probe of_node
[ 1.951974] not get gpio_en
[ 1.954690] power on valid level is high
[ 1.954693] bt: power_on_pin_OD = 0;
[ 1.962222] BT_RADIO going: on
[ 1.965138] BCM_BT: going ON
[ 2.096273] meson-gx-mmc d0074000.mmc: (re)tuning...
[ 2.096396] mmc1: new HS200 MMC card at address 0001
[ 2.100932] mmcblk1: mmc1:0001 AWPD3R 14.6 GiB
[ 2.105169] mmcblk1boot0: mmc1:0001 AWPD3R partition 1 4.00 MiB
[ 2.115027] mmcblk1boot1: mmc1:0001 AWPD3R partition 2 4.00 MiB
[ 2.116869] mmcblk1rpmb: mmc1:0001 AWPD3R partition 3 4.00 MiB
[ 2.123413] Enter aml_emmc_partition_ops
[ 2.126818] [mmc_read_partition_tbl] mmc read partition OK!
[ 2.131928] add_emmc_partition
[ 2.135088] [mmcblk1p01] bootloader offset 0x000000000000, size 0x000000400000
[ 2.143256] [mmcblk1p02] reserved offset 0x000002400000, size 0x000004000000
[ 2.151452] [mmcblk1p03] env offset 0x000006c00000, size 0x000000800000
[ 2.159648] [mmcblk1p04] logo offset 0x000007c00000, size 0x000002000000
[ 2.167839] [mmcblk1p05] ramdisk offset 0x00000a400000, size 0x000002000000
[ 2.176040] [mmcblk1p06] rootfs offset 0x00000cc00000, size 0x000397200000
[ 2.184127] card key: card_blk_probe.
[ 2.187723] emmc_key_init:184 emmc key lba_start:0x12020,lba_end:0x12220
[ 2.194374] emmc key: emmc_key_init:206 ok.
[ 2.198510] amlmmc_dtb_init: register dtb chardev
[ 2.198632] amlmmc_dtb_init: register dtb chardev OK
[ 2.203199] Exit aml_emmc_partition_ops OK.
[ 2.385034] NET: Registered protocol family 17
[ 2.385136] 9pnet: Installing 9P2000 support
[ 2.388174] Key type dns_resolver registered
[ 2.392989] registered taskstats version 1
[ 2.401460] mdio-mux-mmioreg c883455c.eth-phy-mux: failed to register mdio-mux bus /soc/periphs@c8834000/eth-phy-mux
[ 2.408452] meson-gx-mmc d0070000.mmc: allocated mmc-pwrseq
[ 2.453411] scpi_protocol scpi: SCP Protocol 0.0 Firmware 0.0.0 version
[ 2.456757] mdio-mux-mmioreg c883455c.eth-phy-mux: failed to register mdio-mux bus /soc/periphs@c8834000/eth-phy-mux
[ 2.468654] hctosys: unable to open rtc device (rtc0)
[ 2.470088] ALSA device list:
[ 2.472842] No soundcards found.
[ 2.476662] Freeing unused kernel memory: 896K
[ 2.481633] mmc2: queuing unknown CIS tuple 0x80 (2 bytes)
[ 2.488067] mmc2: queuing unknown CIS tuple 0x80 (3 bytes)
[ 2.493478] mmc2: queuing unknown CIS tuple 0x80 (3 bytes)
[ 2.500584] mmc2: queuing unknown CIS tuple 0x80 (7 bytes)
[ 2.537051] random: systemd-udevd: uninitialized urandom read (16 bytes read)
[ 2.539188] random: systemd-udevd: uninitialized urandom read (16 bytes read)
[ 2.541763] random: udevadm: uninitialized urandom read (16 bytes read)
[ 2.541904] random: udevadm: uninitialized urandom read (16 bytes read)
[ 2.543527] random: udevadm: uninitialized urandom read (16 bytes read)
[ 2.543900] random: udevadm: uninitialized urandom read (16 bytes read)
[ 2.544282] random: udevadm: uninitialized urandom read (16 bytes read)
[ 2.544633] random: udevadm: uninitialized urandom read (16 bytes read)
[ 2.545091] random: udevadm: uninitialized urandom read (16 bytes read)
[ 2.545428] random: udevadm: uninitialized urandom read (16 bytes read)
[ 2.576479] random: fast init done
[ 2.576650] mmc2: new high speed SDIO card at address 0001
[ 12.855971] EXT4-fs (mmcblk1p6): mounted filesystem with writeback data mode. Opts: data=writeback
[ 12.994097] systemd[1]: System time before build time, advancing clock.
[ 13.014137] systemd[1]: systemd 229 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN)
[ 13.026946] systemd[1]: Detected architecture arm64.
[ 13.034383] systemd[1]: Set hostname to <ivnVimPro>.
[ 13.168291] systemd[1]: Created slice System Slice.
[ 13.169061] systemd[1]: Created slice system-serial\x2dgetty.slice.
[ 13.174288] systemd[1]: Listening on Journal Audit Socket.
[ 13.179656] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[ 13.187389] systemd[1]: Listening on udev Kernel Socket.
[ 13.192671] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
[ 13.199441] systemd[1]: Reached target Swap.
Ubuntu 16.04.3 LTS ivnVimPro ttyAML0
ivnVimPro login: raxy
Password:
Last login: Thu Feb 11 16:28:19 UTC 2016 on ttyAML0
Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.12.0 aarch64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
raxy@ivnVimPro:~$
I admit not everything works right away ,
but at least we have a working process to produce, test, fix, iterate on mainline (4.12)
and some hope that the process can also be applied (with caution) to any 4.13 release candidate as well.
I consider to publish my toolset soon, if someone is interested enough to test and upgrade it