DIY mainline kernel (4.12)+ ubuntu base 17.04 (zesty) for vim pro and EMMC install


#1

I am trying to build this new beast,
combining instructions from [How to] Debian Stretch + Linux 4.9 from scratch (w/download, EMMC only) and from https://github.com/khadas/fenix/blob/master/scripts/server.sh

Wish me luck guys !

I will keep track here of how it goes,
I’m not done yet…


Ubuntu server ROM linux mainline V170624 pre-alpha version[EMMC INSTALLATION]
#2

now I have my 1st hand made update.img file !
:tropical_drink::strawberry:
need to flash it in a few hours and report results here, before I share the revised procedure and image


#3

All you need to do is follow my directions, minus one change, which is debootstrapping zesty instead of stretch.


#4

Ok,
for now, my custom build does not display anything on screen when it boots, and as no serial console seems set up, I cannot know what is happening, the led flashes ( heartbeat). I guess I failed and need to do it better, probably need to follow only your tuto and use deboostrap this time


#5

ok, redoing it partially, and this time , applying @mmeyer tuto here where I just replace stretch w/ zesty…


#6

hi all,
results so far : i have my very first rom that is able to boot ok;
as i had many errors during second stage of debootsrap, i suppose these made my rom a bit imperfect.
1st serious issue is screen resolution which is not was i told it to be;
impossible to distinguish someletters from the other,a dn as my keyboard mapping is also wrong, usability is very poor, I will try to get console session over serial as a workaround…


#7

i was able to use a console serial cable to get the boot messages below (but not able to type anything in that session)
https://pastebin.com/embed_js/FLxwEVEx
@mmeyer, please help me to understand went wrong; tks!


#8

I also tried to replace stretch (does not exist anymore today) w/ yakkety

I just get these error in secondstage of debootstrap
https://pastebin.com/geCPFuN2

I: Unpacking xz-utils…
W: Failure while installing base packages. This will be re-attempted up to five times.
W: See //debootstrap/debootstrap.log for details (possibly the package archive is at fault)
W: Failure while installing base packages. This will be re-attempted up to five times.
W: See //debootstrap/debootstrap.log for details (possibly the package archive is at fault)
W: Failure while installing base packages. This will be re-attempted up to five times.
W: See //debootstrap/debootstrap.log for details (possibly the package archive is at fault)
W: Failure while installing base packages. This will be re-attempted up to five times.
W: See //debootstrap/debootstrap.log for details (possibly the package archive is at fault)
W: Failure while installing base packages. This will be re-attempted up to five times.
W: See //debootstrap/debootstrap.log for details (possibly the package archive is at fault)

and…

I: Configuring resolvconf…
W: Failure while configuring base packages. This will be re-attempted up to five times.
W: See //debootstrap/debootstrap.log for details (possibly the package archive is at fault)
W: Failure while configuring base packages. This will be re-attempted up to five times.
W: See //debootstrap/debootstrap.log for details (possibly the package archive is at fault)
W: Failure while configuring base packages. This will be re-attempted up to five times.
W: See //debootstrap/debootstrap.log for details (possibly the package archive is at fault)
W: Failure while configuring base packages. This will be re-attempted up to five times.
W: See //debootstrap/debootstrap.log for details (possibly the package archive is at fault)
W: Failure while configuring base packages. This will be re-attempted up to five times.
W: See //debootstrap/debootstrap.log for details (possibly the package archive is at fault)
I: Base system installed successfully.


#9

I tried to overcome the errors before by doing…
sudo chroot /mnt/kvimrootfs apt-get -f install
which apparently succeeded

then I failed when trying

raxy@bodhi-giada:~/khadasVim$ sudo chroot /mnt/kvimrootfs apt install --yes --no-install-recommends sudo fbset htop network-manager initramfs-tools openssh-server
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package network-manager is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Unable to locate package fbset
E: Unable to locate package htop
E: Package ‘network-manager’ has no installation candidate
E: Unable to locate package openssh-server

it seems that these packages are missing and cannot be found ! what the hell !

to install fbset any way:
cd /home/raxy/khadasVim
wget http://ftp.us.debian.org/debian/pool/main/f/fbset/fbset_2.1-29_arm64.deb
sudo cp /home/raxy/khadasVim/*deb /mnt/kvimrootfs/home/khadas
sudo chroot /mnt/kvimrootfs dpkg -i /home/khadas/fbset_2.1-29_arm64.deb

and voilà !!


#10

now about setting screen resolution

raxy@bodhi-giada:~/khadasVim$ sudo tee /mnt/kvimrootfs/etc/initramfs-tools/scripts/local-top/khadas_init.sh <<EOF >/dev/null

fbset -fb /dev/fb0 -xres 1366 -yres 768
echo hdready > /sys/class/display/mode
echo 0 > /sys/class/graphics/fb0/free_scale
echo 1 > /sys/class/graphics/fb0/freescale_mode
echo 0 0 1365 767 > /sys/class/graphics/fb0/free_scale_axis
echo 0 0 1365 767 > /sys/class/graphics/fb0/window_axis
echo 0 > /sys/class/graphics/fb1/free_scale
echo 1 > /sys/class/graphics/fb1/freescale_mode

echo 0 > /sys/class/graphics/fb0/blank
echo heartbeat > /sys/class/leds/red/trigger
exit 0
EOF


#11

sudo chmod +x /mnt/kvimrootfs/etc/initramfs-tools/scripts/local-top/khadas_init.sh
cd ~/khadasVim/linux
sudo make -j4 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- INSTALL_MOD_PATH=/mnt/kvimrootfs modules_install
sudo chroot /mnt/kvimrootfs mkinitramfs -o /boot/initrd.img 4.9.26-g8bc293d
sudo mv /mnt/kvimrootfs/boot/initrd.img ~/khadasVim


#12

doing like before, the kernel seem to boot (heartbeat seen on led) but no display on hdmi nor in serial console !! too bad


#13

Ok,
here is the latest list of all the steps I followed to build an intermediate target : khadas UBOOT + linux 4.12 mainline + xenial on VIM pro

###Prepare project tree

cd ~ install -d ~/project/khadas/ubuntu/{linux,rootfs,archives/{ubuntu-base,debs,hwpacks},images,scripts} cd ~/project/khadas/ubuntu/

###Clone the utils repository to fetch the tools for development:
git clone https://github.com/khadas/utils.git

###Download the U-Boot source tree, take a notice of the branch ubuntu as the option when you run git clone:

git clone https://github.com/khadas/u-boot -b ubuntu

###Edit and change bootargs in
~/project/khadas/ubuntu/u-boot/board/khadas/configs/kvim.h

replace
"root=LABEL=ROOTFS rootflags=data=writeback rw logo=osd1,loaded,0x3d800000,1080p60hz vout=1080p60hz,enable hdmimode=1080p60hz console=ttyS0,115200n8 console=tty0 no_consol
with
"root=/dev/mmcblk0p1 rootflags=data=writeback rw rootwait console=ttyAML0,115200 console=tty0 earlyprintk=aml-uart,0xc81004c0 fsck.repair=yes governor=ondemand no_console_suspend elevator=noop\0" \

###Build UBOOT for Khadas VIM:

cd ~/project/khadas/ubuntu/u-boot/
make kvim_defconfig
make -j4 CROSS_COMPILE=aarch64-linux-gnu-

Generated files:
fip/u-boot.bin: bootloader blob for eMMC

###Build linux kernel mainline:

Fetch the linux mainline repository from Linus Torvalds’s GitHub repository:

cd ~/project/khadas/ubuntu/linux
git init
git remote add torvalds https://github.com/torvalds/linux.git
git fetch torvalds master
git checkout remotes/torvalds/master

###Patch a few files
Retrieve this patchset

Do a tar xzf on it, this will create a patches/ folder containing 7 .patch files

In that folder, replace 0004*patch with this newer version

Assuming that the patches are in ~/Downloads/patches/
apply these 4 ones…

cd ~/project/khadas/ubuntu/linux
git am ~/Downloads/patches/0001-CONFIG-add-kvim_defconfig-from-defconfig-for-VIM.patch
git am ~/Downloads/patches/0002-CONFIG-config-wifi-ethmac.patch
git am ~/Downloads/patches/0003-DTS-disable-scpi_clocks.patch
git am ~/Downloads/patches/0004-EMMC-add-EMMC-partitions-porting-from-amlogic-linux-.patch
git am ~/Downloads/patches/0006-CONFIG-remove-some-unused-modules.patch

###Patch ~/project/khadas/ubuntu/linux/drivers/Makefile manually

diff --git a/drivers/Makefile b/drivers/Makefile
index dfdcda0…ec2731d 100644
— a/drivers/Makefile
+++ b/drivers/Makefile
@@ -182,3 +182,4 @@ obj-$(CONFIG_FPGA) += fpga/
obj-$(CONFIG_FSI) += fsi/
obj-$(CONFIG_TEE) += tee/
obj-$(CONFIG_MULTIPLEXER) += mux/
+obj-$(CONFIG_AMLOGIC_DRIVER) += amlogic/

###Building kernel, dtb & modules

cd ~/project/khadas/ubuntu/linux
touch .scmversion
make -j4 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image amlogic/meson-gxl-s905x-khadas-vim.dtb modules

NB=> Answer ‘y’ for any question asked related to amlogic config option !

###Get ubuntu xenial base tarball…

cd ~/project
sudo wget  http://cdimage.ubuntu.com/ubuntu-base/releases/16.04.2/release/ubuntu-base-16.04.2-base-arm64.tar.gz

Now get inspired from [How to] Debian Stretch + Linux 4.9 from scratch (w/download, EMMC only)
and
###Build rootfs
cd ~/project
truncate --size 1300M rootfs.img
mkfs.ext4 -F -L ROOTFS rootfs.img
sudo mkdir /mnt/kvimrootfs
sudo mount -o loop rootfs.img /mnt/kvimrootfs
cd /mnt/kvimrootfs
sudo rm -rf * lost+found/

###expand xenial in this new rootfs
cd /mnt/kvimrootfs
sudo tar -xzf ~/project/ubuntu-base-16.04.2-base-arm64.tar.gz

###install kernel modules…
cd ~/project/khadas/ubuntu/linux
sudo make -j4 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- modules_install INSTALL_MOD_PATH=/mnt/kvimrootfs

last output line will show
DEPMOD 4.12.0
(or 4.13.0-rc1 as of 22july17)

###prepare for chroot and apt installs…
sudo apt-get install qemu qemu-user-static binfmt-support debootstrap

###Setup the Chroot environment:
sudo cp -a /usr/bin/qemu-aarch64-static /mnt/kvimrootfs/usr/bin/
sudo mount -o bind /proc /mnt/kvimrootfs/proc
sudo mount -o bind /sys /mnt/kvimrootfs/sys
sudo mount -o bind /dev /mnt/kvimrootfs/dev
sudo mount -o bind /dev/pts /mnt/kvimrootfs/dev/pts

User account

USERNAME=khadas
PASSWORD=khadas
sudo chroot /mnt/kvimrootfs adduser --disabled-password --gecos "" $USERNAME
sudo chroot /mnt/kvimrootfs usermod -aG sudo $USERNAME
echo "$USERNAME:$PASSWORD" | sudo chroot /mnt/kvimrootfs chpasswd

Serial console

sudo chroot /mnt/kvimrootfs ln -s /lib/systemd/system/serial-getty\@.service /etc/systemd/system/getty.target.wants/serial-getty@ttyS0.service

misc Packages

sudo chroot /mnt/kvimrootfs bash -c "echo 'nameserver 8.8.8.8' > /etc/resolv.conf"
sudo chroot /mnt/kvimrootfs apt update
sudo chroot /mnt/kvimrootfs apt install --yes --no-install-recommends sudo fbset network-manager initramfs-tools openssh-server
sudo chroot /mnt/kvimrootfs apt install --yes --no-install-recommends ifupdown net-tools udev vim ssh ping

Hostname

sudo chroot /mnt/kvimrootfs bash -c "echo ivnKhadasVIM > /etc/hostname"

Ramdisk build…

sudo chroot /mnt/kvimrootfs mkinitramfs -o /boot/initrd.img 4.13.0-rc1

will output lots of nvida warnings and one ERROR…
W: Possible missing firmware /lib/firmware/nvidia/gk20a/fecs_data.bin for module nouveau
Unsupported ioctl: cmd=0x5331

###Handle new initrd.img
sudo mv /mnt/kvimrootfs/boot/initrd.img ~/project

###Clean rootfs…
sudo chroot /mnt/kvimrootfs apt clean
sudo rm -f /mnt/kvimrootfs/usr/bin/qemu-aarch64-static
cd ~/project/khadas/ubuntu
sudo cp linux/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dtb /mnt/kvimrootfs
sudo sync
sudo umount /mnt/kvimrootfs/dev/pts
sudo umount /mnt/kvimrootfs/dev
sudo umount /mnt/kvimrootfs/sys
sudo umount /mnt/kvimrootfs/proc
sudo umount /mnt/kvimrootfs

###produce ramdisk.img
cd ~/project
khadas/ubuntu/utils/mkbootimg --kernel khadas/ubuntu/linux/arch/arm64/boot/Image --ramdisk initrd.img -o ramdisk.img
rm -f initrd.img

###Pack a logo
cd ~/project
wget https://meyer.io/dl/khadasvim/debian-bootup.bmp
khadas/ubuntu/utils/logo_img_packer debian-bootup.bmp logo.img
rm -f debian-bootup.bmp

###Fix the symlinks in image_upgrade/
cd ~/project/images_upgrade
ln -f -s ~/project/khadas/ubuntu/u-boot/fip/u-boot.bin u-boot.bin
ln -f -s ~/project/khadas/ubuntu/u-boot/fip/u-boot.bin.sd.bin u-boot.bin.sd.bin
ln -f -s ~/project/khadas/ubuntu/u-boot/fip/u-boot.bin.usb.bl2 u-boot.bin.usb.bl2
ln -f -s ~/project/khadas/ubuntu/u-boot/fip/u-boot.bin.usb.tpl u-boot.bin.usb.tpl
ln -f -s …/rootfs.img rootfs.img
ln -f -s …/ramdisk.img ramdisk.img
ln -f -s …/logo.img logo.img
ln -f -s ~/project/khadas/ubuntu/linux/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dtb kvim.dtb

###Pack the system update image…
cd ~/project
khadas/ubuntu/utils/aml_image_v2_packer -r images_upgrade/package.conf images_upgrade update.img

OUTPUTS…

raxy@bodhi-giada:~/project$ khadas/ubuntu/utils/aml_image_v2_packer -r images_upgrade/package.conf images_upgrade update.img
[Msg]Pack Item[USB         ,              DDR] from (images_upgrade/u-boot.bin.usb.bl2),sz[0xc000]B,
[Msg]Pack Item[USB         ,            UBOOT] from (images_upgrade/u-boot.bin.usb.tpl),sz[0xd4000]B,ft[normal]
[Msg]Pack Item[UBOOT       ,     aml_sdc_burn] from (images_upgrade/u-boot.bin.sd.bin),sz[0xe0200]B,ft[normal]
[Msg]Pack Item[ini         ,     aml_sdc_burn] from (images_upgrade/aml_sdc_burn.ini),sz[0x24d]B,
[Msg]Pack Item[PARTITION   ,       bootloader] from (images_upgrade/u-boot.bin),sz[0xe0000]B,ft[normal]
[Msg]Pack Item[VERIFY      ,       bootloader] from (images_upgrade/u-boot.bin),vry[sha1sum bf01c06d1c6796cbf06f385038bfef2835fab42a]
[Msg]Pack Item[PARTITION   ,             logo] from (images_upgrade/logo.img),sz[0x3f4910]B,ft[normal]
[Msg]Pack Item[VERIFY      ,             logo] from (images_upgrade/logo.img),vry[sha1sum 16b3cc7f3ef4dc8480ffa75d73d7429eda975164]
[Msg]Pack Item[dtb         ,           meson1] from (images_upgrade/kvim.dtb),sz[0x52c7]B,
[Msg]Pack Item[conf        ,         platform] from (images_upgrade/platform.conf),sz[0xca]B,
[Msg]Pack Item[PARTITION   ,          ramdisk] from (images_upgrade/ramdisk.img),sz[0x4c01000]B,ft[normal]
[Msg]Pack Item[VERIFY      ,          ramdisk] from (images_upgrade/ramdisk.img),vry[sha1sum f59412522599c7f38fe58bdb6e4d1f835bde9db5]
[Msg]Pack Item[PARTITION   ,           rootfs] from (images_upgrade/rootfs.img),sz[0x44c00000]B,ft[normal]
[Msg]Pack Item[VERIFY      ,           rootfs] from (images_upgrade/rootfs.img),vry[sha1sum e65688a8c809600c3421001bba1fb77dbf37bc43]
[Msg]version:0x2 crc:0x9d8a56c5 size:1240060276 bytes[1182MB]
Pack image[update.img] OK

###nb: DOES THIS EVEN SEEM CORRECT FOR emmc ?

Then, flash the resulting update.img

Alas,
during burning of update.img, I get blocking errors


#14

Hi:
Have this error been fixed? or any update???


#15

HI, not fixed yet, but I have been told a few hints on how to solve the issue… stay tuned


#16

another hint: Add INSTALL_MOD_STRIP=1 to your make modules line.
It will strip the modules size down to about 1/10th the size!


#17

here are my (positive) results sofar


#18

Ok, almost done !
I finally managed to build from scratch u-boot + 4.12rc6 + zesty :hugs::star_struck::checkered_flag:
here are traces for the very 1st booting of my system on the vim pro …
Here are the few errors I noticed:
[ 0.000000] efi: Getting EFI parameters from FDT:
[ 0.000000] efi: UEFI not found.
and
[ 0.183345] dmi: Firmware registration failed.
and
[ 1.744168] mdio-mux-mmioreg c883455c.eth-phy-mux: failed to register mdio-mux bus /soc/periphs@c8834000/eth-phy-mux
and
[ 2.146702] of_pwm_get(): PWM chip not found
[ 2.152360] leds_pwm pwmleds: unable to request PWM for vim:red:power: -517
and
[ 36.649310] brcmfmac: brcmf_p2p_create_p2pdev: set p2p_disc error
[ 36.654450] brcmfmac: brcmf_cfg80211_add_iface: add iface p2p-dev-wlan0 type 10 failed: err=-16

I hope I can cope with them; full trace below…

U-Boot 2015.01 (Aug 02 2017 - 00:52:04)

DRAM:  2 GiB
Relocation Offset is: 76ecf000
register usb cfg[0][1] = 0000000077f61918
vpu: error: vpu: check dts: FDT_ERR_BADMAGIC, load default parameters
vpu: clk_level = 7
vpu: set clk: 666667000Hz, readback: 666660000Hz(0x300)
vpp: vpp_init
boot_device_flag : 1
Nand PHY Ver:1.01.001.0006 (c) 2013 Amlogic Inc.
init bus_cycle=6, bus_timing=7, system=5.0ns
reset failed
get_chip_type and ret:fffffffe
get_chip_type and ret:fffffffe
chip detect failed and ret:fffffffe
nandphy_init failed and ret=0xfffffff1
MMC:   aml_priv->desc_buf = 0x0000000073ecf6b0
aml_priv->desc_buf = 0x0000000073ed19d0
SDIO Port B: 0, SDIO Port C: 1
emmc/sd response timeout, cmd8, status=0x1ff2800
emmc/sd response timeout, cmd55, status=0x1ff2800
[mmc_startup] mmc refix success
[mmc_init] mmc init success
mmc read lba=0x14000, blocks=0x400
start dts,buffer=0000000073ed4270,dt_addr=0000000073ed4270
parts: 3
00:      logo   0000000002000000 1
01:   ramdisk   0000000002000000 1
02:    rootfs   ffffffffffffffff 4
get_dtb_struct: Get emmc dtb OK!
Partition table get from SPL is :
        name                        offset              size              flag
===================================================================================
   0: bootloader                         0            400000                  0
   1: reserved                     2400000           4000000                  0
   2: env                          6c00000            800000                  0
   3: logo                         7c00000           2000000                  1
   4: ramdisk                      a400000           2000000                  1
   5: rootfs                       cc00000         397200000                  4
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!
mmc env offset: 0x6c00000
In:    serial
Out:   serial
Err:   serial
reboot_mode=normal
hpd_state=1
set hdmitx VIC = 16
config HPLL = 2970
HPLL: 0xc000027b
config HPLL done
j = 4  vid_clk_div = 1
hdmitx phy setting done
hdmitx: set enc for VIC: 16
rx version is 1.4 or below  div=10
hdmtix: set audio
[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]canvas init
[CANVAS]addr=0x3d800000 width=3840, height=2160
[store]To run cmd[emmc dtb_read 0x1000000 0x40000]
read emmc dtb
gpio: pin GPIOAO_2 (gpio 102) value is 1
get_cpu_id flag_12bit=1
Product checking: Khadas VIM.
Net:   dwmac.c9410000
Hit Enter or space or Ctrl+C key to stop autoboot -- :  0
ee_gate_off ...
## Booting Android Image at 0x01080000 ...
load dtb from 0x1000000 ......
   Loading Kernel Image(COMP_NONE) ... OK
   kernel loaded at 0x01080000, end = 0x01f1ba00
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
[rsvmem] bl31 reserved memory set addr error.
   Loading Ramdisk to 73a78000, end 73ebc934 ... OK
   Loading Device Tree to 000000001fff7000, end 000000001ffff077 ... OK

Starting kernel ...

uboot time: 1670436 us
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.12.0-rc6 (raxy@bodhi-giada) (gcc version 4.8.4 (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.1) ) #1 SMP PREEMPT Tue Aug 1 14:44:52 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 0x0000000067c00000, 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 s59520 r8192 d30592 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: 1701928K/1947648K available (9916K kernel code, 750K rwdata, 3600K rodata, 640K init, 445K bss, 53208K 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 - 0xffff000008a30000   (  9920 KB)
[    0.000000]     .rodata : 0xffff000008a30000 - 0xffff000008dc0000   (  3648 KB)
[    0.000000]       .init : 0xffff000008dc0000 - 0xffff000008e60000   (   640 KB)
[    0.000000]       .data : 0xffff000008e60000 - 0xffff000008f1ba00   (   751 KB)
[    0.000000]        .bss : 0xffff000008f1ba00 - 0xffff000008f8b0c8   (   446 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.000003] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[    0.000292] Console: colour dummy device 80x25
[    0.001048] console [tty0] enabled
[    0.001103] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=96000)
[    0.001133] pid_max: default: 32768 minimum: 301
[    0.001202] Security Framework initialized
[    0.001643] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes)
[    0.003186] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes)
[    0.004140] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes)
[    0.004165] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes)
[    0.020043] ASID allocator initialised with 65536 entries
[    0.036357] EFI services will not be available.
[    0.052078] smp: Bringing up secondary CPUs ...
[    0.084285] Detected VIPT I-cache on CPU1
[    0.084333] CPU1: Booted secondary processor [410fd034]
[    0.116321] Detected VIPT I-cache on CPU2
[    0.116354] CPU2: Booted secondary processor [410fd034]
[    0.148372] Detected VIPT I-cache on CPU3
[    0.148404] CPU3: Booted secondary processor [410fd034]
[    0.148453] smp: Brought up 1 node, 4 CPUs
[    0.148543] SMP: Total of 4 processors activated.
[    0.148559] CPU features: detected feature: 32-bit EL0 Support
[    0.148579] CPU: All CPU(s) started at EL2
[    0.148606] alternatives: patching kernel code
[    0.149275] devtmpfs: initialized
[    0.152822] DMI not present or invalid.
[    0.153025] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.153092] futex hash table entries: 1024 (order: 5, 131072 bytes)
[    0.157085] pinctrl core: initialized pinctrl subsystem
[    0.158055] NET: Registered protocol family 16
[    0.159297] cpuidle: using governor menu
[    0.160009] vdso: 2 pages (1 code @ ffff000008a37000, 1 data @ ffff000008e65000)
[    0.160047] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.160973] DMA: preallocated 256 KiB pool for atomic allocations
[    0.161116] Serial: AMBA PL011 UART driver
[    0.175657] HugeTLB registered 2 MB page size, pre-allocated 0 pages
[    0.176609] ACPI: Interpreter disabled.
[    0.177675] vgaarb: loaded
[    0.177920] SCSI subsystem initialized
[    0.178322] usbcore: registered new interface driver usbfs
[    0.178386] usbcore: registered new interface driver hub
[    0.178471] usbcore: registered new device driver usb
[    0.178723] media: Linux media interface: v0.10
[    0.178768] Linux video capture interface: v2.00
[    0.178828] pps_core: LinuxPPS API ver. 1 registered
[    0.178844] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.178881] PTP clock support registered
[    0.178990] dmi: Firmware registration failed.
[    0.179108] Advanced Linux Sound Architecture Driver Initialized.
[    0.179457] Bluetooth: Core ver 2.22
[    0.179532] NET: Registered protocol family 31
[    0.179547] Bluetooth: HCI device and connection manager initialized
[    0.179569] Bluetooth: HCI socket layer initialized
[    0.179589] Bluetooth: L2CAP socket layer initialized
[    0.179618] Bluetooth: SCO socket layer initialized
[    0.180641] clocksource: Switched to clocksource arch_sys_counter
[    0.180813] VFS: Disk quotas dquot_6.6.0
[    0.180867] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    0.181080] pnp: PnP ACPI: disabled
[    0.186503] NET: Registered protocol family 2
[    0.186943] TCP established hash table entries: 16384 (order: 5, 131072 bytes)
[    0.187148] TCP bind hash table entries: 16384 (order: 6, 262144 bytes)
[    0.187412] TCP: Hash tables configured (established 16384 bind 16384)
[    0.187536] UDP hash table entries: 1024 (order: 3, 32768 bytes)
[    0.187598] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes)
[    0.187761] NET: Registered protocol family 1
[    0.188057] RPC: Registered named UNIX socket transport module.
[    0.188075] RPC: Registered udp transport module.
[    0.188088] RPC: Registered tcp transport module.
[    0.188102] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.188283] Unpacking initramfs...
[    0.365888] Freeing initrd memory: 4368K
[    0.366681] hw perfevents: enabled with armv8_cortex_a53 PMU driver, 7 counters available
[    0.366926] kvm [1]: 8-bit VMID
[    0.366943] kvm [1]: IDMAP page: 1a20000
[    0.366957] kvm [1]: HYP VA range: 800000000000:ffffffffffff
[    0.367557] kvm [1]: Hyp mode initialized successfully
[    0.367603] kvm [1]: vgic-v2@c4304000
[    0.367681] kvm [1]: vgic interrupt IRQ1
[    0.367703] kvm [1]: virtual timer IRQ4
[    0.369599] audit: initializing netlink subsys (disabled)
[    0.369731] audit: type=2000 audit(0.369:1): state=initialized audit_enabled=0 res=1
[    0.370044] workingset: timestamp_bits=44 max_order=19 bucket_order=0
[    0.375709] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.376268] NFS: Registering the id_resolver key type
[    0.376311] Key type id_resolver registered
[    0.376325] Key type id_legacy registered
[    0.376346] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.376528] 9p: Installing v9fs 9p2000 file system support
[    0.378602] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
[    0.378638] io scheduler noop registered
[    0.378851] io scheduler cfq registered (default)
[    0.378873] io scheduler mq-deadline registered
[    0.378887] io scheduler kyber registered
[    0.382752] of_pwm_get(): PWM chip not found
[    0.384562] xenfs: not registering filesystem on non-xen platform
[    0.387463] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    0.389318] c11084c0.serial: ttyAML1 at MMIO 0xc11084c0 (irq = 10, base_baud = 1500000) is a meson_uart
[    0.389673] c81004c0.serial: ttyAML0 at MMIO 0xc81004c0 (irq = 14, base_baud = 1500000) is a meson_uart
[    1.267164] console [ttyAML0] enabled
[    1.271146] c81004e0.serial: ttyAML2 at MMIO 0xc81004e0 (irq = 15, base_baud = 1500000) is a meson_uart
[    1.281228] meson-drm d0100000.vpu: Queued 2 outputs on vpu
[    1.286121] meson-drm d0100000.vpu: Failed to create debugfs directory
[    1.292106] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    1.298629] [drm] No driver support for vblank timestamp query.
[    1.304574] meson-drm d0100000.vpu: CVBS Output connector not available
[    1.336701] meson-dw-hdmi c883a000.hdmi-tx: Detected HDMI TX controller v2.01a with HDCP (meson_dw_hdmi_phy)
[    1.341113] meson-dw-hdmi c883a000.hdmi-tx: registered DesignWare HDMI I2C bus driver
[    1.348830] meson-drm d0100000.vpu: bound c883a000.hdmi-tx (ops meson_dw_hdmi_ops)
[    1.462664] random: fast init done
[    1.677462] Console: switching to colour frame buffer device 240x67
[    1.716708] meson-drm d0100000.vpu: fb0:  frame buffer device
[    1.722748] [drm] Initialized meson 1.0.0 20161109 for d0100000.vpu on minor 0
[    1.736368] loop: module loaded
[    1.736941] hisi_sas: driver version v1.6
[    1.739731] mdio-mux-mmioreg c883455c.eth-phy-mux: failed to register mdio-mux bus /soc/periphs@c8834000/eth-phy-mux
[    1.748746] libphy: Fixed MDIO Bus: probed
[    1.752977] tun: Universal TUN/TAP device driver, 1.6
[    1.758428] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
[    1.763221] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[    1.769142] igb: Intel(R) Gigabit Ethernet Network Driver - version 5.4.0-k
[    1.775992] igb: Copyright (c) 2007-2014 Intel Corporation.
[    1.781559] igbvf: Intel(R) Gigabit Virtual Function Network Driver - version 2.4.0-k
[    1.789260] igbvf: Copyright (c) 2009 - 2012 Intel Corporation.
[    1.795334] sky2: driver version 1.30
[    1.799365] meson8b-dwmac c9410000.ethernet: PTP uses main clock
[    1.804708] meson8b-dwmac c9410000.ethernet: no reset control found
[    1.811092] stmmac - user ID: 0x11, Synopsys ID: 0x37
[    1.815924] meson8b-dwmac c9410000.ethernet: Ring mode enabled
[    1.821690] meson8b-dwmac c9410000.ethernet: DMA HW capability register supported
[    1.829131] meson8b-dwmac c9410000.ethernet: Normal descriptors
[    1.834975] meson8b-dwmac c9410000.ethernet: RX Checksum Offload Engine supported
[    1.842385] meson8b-dwmac c9410000.ethernet: COE Type 2
[    1.847562] meson8b-dwmac c9410000.ethernet: TX Checksum insertion supported
[    1.854549] meson8b-dwmac c9410000.ethernet: Wake-Up On Lan supported
[    1.860971] meson8b-dwmac c9410000.ethernet: Enable RX Mitigation via HW Watchdog Timer
[    1.868955] libphy: stmmac: probed
[    1.872922] pegasus: v0.9.3 (2013/04/25), Pegasus/Pegasus II USB Ethernet driver
[    1.879654] usbcore: registered new interface driver pegasus
[    1.885223] usbcore: registered new interface driver rtl8150
[    1.890819] usbcore: registered new interface driver r8152
[    1.896259] usbcore: registered new interface driver asix
[    1.901616] usbcore: registered new interface driver ax88179_178a
[    1.907641] usbcore: registered new interface driver cdc_ether
[    1.913430] usbcore: registered new interface driver dm9601
[    1.918940] usbcore: registered new interface driver CoreChips
[    1.924723] usbcore: registered new interface driver smsc75xx
[    1.930424] usbcore: registered new interface driver smsc95xx
[    1.936138] usbcore: registered new interface driver net1080
[    1.941733] usbcore: registered new interface driver plusb
[    1.947162] usbcore: registered new interface driver cdc_subset
[    1.953040] usbcore: registered new interface driver zaurus
[    1.958561] usbcore: registered new interface driver MOSCHIP usb-ethernet driver
[    1.965887] usbcore: registered new interface driver cdc_ncm
[    1.971619] VFIO - User Level meta-driver version: 0.3
[    1.977761] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.983515] ehci-pci: EHCI PCI platform driver
[    1.988424] ehci-platform: EHCI generic platform driver
[    1.993479] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.999228] ohci-pci: OHCI PCI platform driver
[    2.004052] ohci-platform: OHCI generic platform driver
[    2.009385] usbcore: registered new interface driver usb-storage
[    2.016204] i2c /dev entries driver
[    2.023100] Bluetooth: HCI UART driver ver 2.3
[    2.027878] Bluetooth: HCI UART protocol H4 registered
[    2.033354] sdhci: Secure Digital Host Controller Interface driver
[    2.038585] sdhci: Copyright(c) Pierre Ossman
[    2.043340] Synopsys Designware Multimedia Card Interface Driver
[    2.050151] meson-gx-mmc d0072000.mmc: Got CD GPIO
[    2.094133] meson-gx-mmc d0074000.mmc: allocated mmc-pwrseq
[    2.136864] sdhci-pltfm: SDHCI platform and OF driver helper
[    2.142289] of_pwm_get(): PWM chip not found
[    2.147989] leds_pwm pwmleds: unable to request PWM for vim:red:power: -517
[    2.156238] ledtrig-cpu: registered to indicate activity on CPUs
[    2.161746] meson-sm: secure-monitor enabled
[    2.166901] usbcore: registered new interface driver usbhid
[    2.171613] usbhid: USB HID core driver
[    2.176414] platform-mhu c883c404.mailbox: Platform MHU Mailbox registered
[    2.184202] amlogic rfkill init
[    2.189196] enter bt_probe of_node
[    2.193680] not get gpio_en
[    2.197923] power on valid level is high
[    2.197926] bt: power_on_pin_OD = 0;
[    2.206394] BT_RADIO going: on
[    2.210480] BCM_BT: going ON
[    2.353129] meson-gx-mmc d0074000.mmc: (re)tuning...
[    2.357316] mmc1: new HS200 MMC card at address 0001
[    2.361810] mmcblk1: mmc1:0001 AWPD3R 14.6 GiB
[    2.366079] mmcblk1boot0: mmc1:0001 AWPD3R partition 1 4.00 MiB
[    2.375906] mmcblk1boot1: mmc1:0001 AWPD3R partition 2 4.00 MiB
[    2.380321] mmcblk1rpmb: mmc1:0001 AWPD3R partition 3 4.00 MiB
[    2.386839] Enter aml_emmc_partition_ops
[    2.391296] [mmc_read_partition_tbl] mmc read partition OK!
[    2.395348] add_emmc_partition
[    2.399499] [mmcblk1p01]           bootloader  offset 0x000000000000, size 0x000000400000
[    2.406718] [mmcblk1p02]             reserved  offset 0x000002400000, size 0x000004000000
[    2.414907] [mmcblk1p03]                  env  offset 0x000006c00000, size 0x000000800000
[    2.423116] [mmcblk1p04]                 logo  offset 0x000007c00000, size 0x000002000000
[    2.431291] [mmcblk1p05]              ramdisk  offset 0x00000a400000, size 0x000002000000
[    2.439486] [mmcblk1p06]               rootfs  offset 0x00000cc00000, size 0x000397200000
[    2.447538] card key: card_blk_probe.
[    2.451383] emmc_key_init:184 emmc key lba_start:0x12020,lba_end:0x12220
[    2.457791] emmc key: emmc_key_init:206 ok.
[    2.461923] amlmmc_dtb_init: register dtb chardev
[    2.462083] amlmmc_dtb_init: register dtb chardev OK
[    2.466628] Exit aml_emmc_partition_ops OK.
[    2.629750] nf_conntrack version 0.5.0 (16384 buckets, 65536 max)
[    2.634791] ip_tables: (C) 2000-2006 Netfilter Core Team
[    2.640089] NET: Registered protocol family 10
[    2.645232] Segment Routing with IPv6
[    2.649673] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    2.654274] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    2.660137] NET: Registered protocol family 17
[    2.664776] Bridge firewalling registered
[    2.669364] Bluetooth: RFCOMM TTY layer initialized
[    2.673900] Bluetooth: RFCOMM socket layer initialized
[    2.678398] Bluetooth: RFCOMM ver 1.11
[    2.682804] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    2.687202] Bluetooth: BNEP filters: protocol multicast
[    2.692343] Bluetooth: BNEP socket layer initialized
[    2.697275] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[    2.703125] Bluetooth: HIDP socket layer initialized
[    2.708080] 8021q: 802.1Q VLAN Support v1.8
[    2.712410] 9pnet: Installing 9P2000 support
[    2.716745] Key type dns_resolver registered
[    2.721848] registered taskstats version 1
[    2.731027] libphy: mdio_mux: probed
[    2.738378] libphy: mdio_mux: probed
[    2.742621] mdio-mux-mmioreg c883455c.eth-phy-mux: Version 1.0
[    2.748065] meson-gx-mmc d0070000.mmc: allocated mmc-pwrseq
[    2.793794] scpi_protocol scpi: SCP Protocol 0.0 Firmware 0.0.0 version
[    2.800039] hctosys: unable to open rtc device (rtc0)
[    2.804677] ALSA device list:
[    2.808994]   No soundcards found.
[    2.813589] Freeing unused kernel memory: 640K
[    2.830425] mmc2: queuing unknown CIS tuple 0x80 (2 bytes)
[    2.836697] mmc2: queuing unknown CIS tuple 0x80 (3 bytes)
[    2.838702] mmc2: queuing unknown CIS tuple 0x80 (3 bytes)
[    2.842307] mmc2: queuing unknown CIS tuple 0x80 (7 bytes)
[    2.915665] mmc2: new high speed SDIO card at address 0001
[   33.271890] EXT4-fs (mmcblk1p6): mounted filesystem with writeback data mode. Opts: data=writeback
[   33.419453] systemd[1]: System time before build time, advancing clock.
[   33.434467] systemd[1]: systemd 232 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
[   33.452576] systemd[1]: Detected architecture arm64.
[   33.475109] systemd[1]: Set hostname to <ivnVimPro>.
[   33.616953] systemd[1]: Listening on udev Control Socket.
[   33.628483] systemd[1]: Listening on Journal Socket.
[   33.639624] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
[   33.652146] systemd[1]: Listening on udev Kernel Socket.
[   33.663527] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[   33.677210] systemd[1]: Reached target Swap.
[   33.689229] systemd[1]: Created slice System Slice.
[   34.888949] brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Aug 25 2015 18:58:57 version 7.45.69 (r581703) FWID 01-24037f6e
[   36.296735] brcmfmac: brcmf_p2p_create_p2pdev: set p2p_disc error
[   36.297326] brcmfmac: brcmf_cfg80211_add_iface: add iface p2p-dev-wlan0 type 10 failed: err=-16

Ubuntu 17.04 ivnVimPro ttyAML0

ivnVimPro login:

#19

thanks all for your likes,
I now would like to go one step ahead:
port the customization done by numbqq on 4.12-rc6 to 4.13-rc*

the task seems huge,
what I have at hand is a patchset, source repos from @numbqq, khadas, @umiddelb, @narmstrong, torvalds…

I cloned torvalds 4.12-rc6 sources…

GIT_OPT="–depth 1 --single-branch"
git clone $GIT_OPT -b 4.12-rc6 https://github.com/torvalds/linux.git linux-kernel-linus412-rc6

I cloned numbqq’s repo…

git clone $GIT_OPT -b 4.12-rc6 https://github.com/numbqq/linux.git linux-kernel-numbqq

and I meld compared the 2 trees…

meld linux-kernel-linus412-rc6/ linux-kernel-numbqq/

…enjoy the number of differences !

In meld GUI, I did notice most of the patchset content, but also things unfortunately not present in the patchset!

I will implement all the needed changes related to emmc as a shell script using only cp and sed commands,
but for now, I did just manually synced them by clicking here and there in meld and only for things I consider directly as related to EMMC

to be continued…


#20

done sofar:

  • include in a shell script all the supposed patches needed on 412rc6 pure mainline source tree ;
  • build a kernel from that,
  • use this kernel image, dtb and modules to rebuild a system that boots properly

tbc…