How to use linux kernel I compiled?

@Frank
Oh, I don’t have to re-compile the kernel, I found somthing in uboot output and boot.ini
the kernel is detected as legacy kernel.

 echo "Booting mainline kernel...";setenv condev "console=ttyAML0,1152....
 echo "Booting legacy kernel...";setenv condev "console=ttyS0,1152....

mainline kernel use ‘/dev/AML0’ to instead of ‘/dev/ttyS0’
Just replace ‘ttyS0’ to ‘ttyAML0’

1 Like

.tar.xz now downloaded…
==> -rw-rw-r-- 1 raxy raxy 3565159936 juil. 18 19:50 ArchLinuxArm_Server_VIM1_20190718.tar
fighting for free disk space…
you could have just uploaded a .img.7z file…

sudo tar xvf ~/Downloads/ArchLinuxArm_Server_VIM1_20190718.tar
ArchLinuxArm_Khadas_VIM1_20190718.img
tar: ArchLinuxArm_Khadas_VIM1_20190718.img: Cannot change ownership to uid 0, gid 0: Operation not permitted
tar: Exiting with failure status due to previous errors

anyway, I get this:
-rw-r–r-- 1 raxy raxy 3565158400 juil. 18 13:02 ArchLinuxArm_Khadas_VIM1_20190718.img
I hope this img is correct !
Now flashing it… sudo dd if=ArchLinuxArm_Khadas_VIM1_20190718.img bs=8M of=/dev/sdb status=progress
425+0 records in
425+0 records out
3565158400 bytes (3,6 GB, 3,3 GiB) copied, 430,833 s, 8,3 MB/s
Let the fun really begin now…

Latest changes are here

Yes, that’s correct.

I’ll try 7z with next image.

do I have to put


in uboot on my emmc ? how to do that ?

as I’ve deployed the image on an USB stick,
according to

I would need to use an extra SD card having an appropriate boot.ini to make the VIM1 use the kernel and system that are on my USB stick

1 Like

now finally flashing your img on an SD card…

something is visibly wrong; when booting w/ sd card inserted : system bootloops while saying…

Resetting CPU ...

resetting ...
GXL:BL1:9ac50e:a1974b;FEAT:ADFC318C;POC:3;RCY:0;EMMC:0;READ:0;0.0;CHK:0;
TE: 96585

BL2 Built : 20:32:17, Sep  8 2017. 
gxl g6296b83 - xiaobo.gu@droid12

set vcck to 1120 mv
set vddee to 1000 mv
Board ID = 6
CPU clk: 1200MHz
DQS-corr enabled
DDR scramble enabled
DDR3 chl: Rank0+1 @ 768MHz - PASS
Rank0: 1024MB(auto)-2T-11
Rank1: 1024MB(auto)-2T-11
DataBus test pass!
AddrBus test pass!
-s
Load fip header from eMMC, src: 0x0000c200, des: 0x01400000, size: 0x00004000
New fip structure!
Load bl30 from eMMC, src: 0x00010200, des: 0x01100000, size: 0x0000d600
Load bl31 from eMMC, src: 0x00020200, des: 0x05100000, size: 0x0002c600
Load bl33 from eMMC, src: 0x00050200, des: 0x01000000, size: 0x00066a00
NOTICE:  BL3-1: v1.0(release):a625749
NOTICE:  BL3-1: Built : 11:25:15, Aug 25 2017
[BL31]: GXL CPU setup!
NOTICE:  BL31: BL33 decompress pass
mpu_config_enable:ok
[Image: gxl_v1.1.3243-377db0f 2017-09-07 11:28:58 qiufang.dai@droid07]
OPS=0x82
9d 42 bd c7 a1 12 ec 2f 5f 6 30 b8 [0.323331 Inits done]
secure task start!
high task start!
low task start!
ERROR:   Error initializing runtime service opteed_fast


U-Boot 2015.01 (Oct 30 2018 - 15:53:59)

DRAM:  2 GiB
Relocation Offset is: 76eae000
register usb cfg[0][1] = 0000000077f56a18
[CANVAS]canvas 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 = 0x0000000073eae6b0
aml_priv->desc_buf = 0x0000000073eb09d0
SDIO Port B: 0, SDIO Port C: 1
emmc/sd response timeout, cmd8, status=0x1ff2800
emmc/sd response timeout, cmd55, status=0x1ff2800
init_part() 293: PART_TYPE_AML
[mmc_init] mmc init success
dtb magic edfe0dd0
start dts,buffer=0000000073eb3200,dt_addr=0000000073eb3200
parts: 3
00:      logo   0000000002000000 1
01:   ramdisk   0000000002000000 1
02:    rootfs   ffffffffffffffff 4
init_part() 293: PART_TYPE_AML
eMMC/TSD partition table have been checked OK!
check pattern success
mmc env offset: 0x6c00000 
In:    serial
Out:   serial
Err:   serial
reboot_mode=watchdog_reboot
[store]To run cmd[emmc dtb_read 0x1000000 0x40000]
_verify_dtb_checksum()-909: calc e2c54ed8, store e2c54ed8
_verify_dtb_checksum()-909: calc e2c54ed8, store e2c54ed8
dtb_read()-1031: total valid 2
dtb_read()-1098: do nothing
vpu: clk_level in dts: 7
vpu: set clk: 666667000Hz, readback: 666660000Hz(0x300)
vpu: vpu_clk_gate_init_off
vpp: vpp_init
hpd_state=0
cvbs performance type = 6, table = 0
Net:   dwmac.c9410000amlkey_init() enter!
[EFUSE_MSG]keynum is 4
[BL31]: tee size: 0

upgrade_step=2
[OSD]load fb addr from dts
[OSD]fb_addr for logo: 0x7e000000
[OSD]load fb addr from dts
[OSD]fb_addr for logo: 0x7e000000
[CANVAS]addr=0x7e000000 width=3840, height=2160
amlkey_init() enter!
amlkey_init() 71: already init!
[EFUSE_MSG]keynum is 4
[BL31]: tee size: 0
[KM]Error:f[key_manage_query_size]L507:key[usid] not programed yet
[KM]Error:f[key_manage_query_size]L507:key[mac] not programed yet
[KM]Error:f[key_manage_query_size]L507:key[deviceid] not programed yet
saradc - saradc sub-system

Usage:
saradc saradc open <channel>            - open a SARADC channel
saradc close    - close the SARADC
saradc getval   - get the value in current channel
saradc get_in_range <min> <max> - return 0 if current value in the range of current channel

gpio: pin GPIOAO_2 (gpio 102) value is 1
Product checking: pass!
Hit Enter or space or Ctrl+C key to stop autoboot -- :  0 
card in
init_part() 278: PART_TYPE_DOS
[mmc_init] mmc init success
reading boot.ini
4830 bytes read in 4 ms (1.2 MiB/s)
cfgload: applying boot.ini...
cfgload: echo "Starting boot.ini..."
Starting boot.ini...
cfgload: setenv kernel_loadaddr "0x11000000"
cfgload: setenv dtb_loadaddr "0x1000000"
cfgload: setenv initrd_loadaddr "0x13000000"
cfgload: setenv env_loadaddr "0x20000000"
cfgload: setenv hdmiargs "logo=${display_layer},loaded,${fb_addr},${outputmode} vout=${outputmode},enable hdmimode=${hdmimode}"
cfgload: if test "X$lcd_exist" = "X1"; then setenv panelargs "panel_exist=${lcd_exist} panel_type=${panel_type}";fi;
cfgload: setenv boot_start booti ${kernel_loadaddr} ${initrd_loadaddr} ${dtb_loadaddr}
cfgload: setenv mmc_devplist "1 5"
cfgload: setenv mmc_devnums "0 1"
cfgload: setenv usb_devplist "1"
cfgload: setenv usb_devnums "0 1 2 3"
cfgload: setenv mark_prefix ""
cfgload: if test "$hostname" = "KVIM1"; then setenv ml_dtb "/dts/amlogic/meson-gxl-s905x-khadas-vim.dtb"; else if test "$hostname" =
 "KVIM2"; then setenv ml_dtb "/dts/amlogic/meson-gxm-khadas-vim2.dtb";fi;fi;
cfgload: for dev_num in ${mmc_devnums}; do for distro_bootpart in ${mmc_devplist}; do echo "Scanning mmc ${dev_num}:${distro_bootpar
t}..."; if load mmc ${dev_num}:${distro_bootpart} ${initrd_loadaddr} uInitrd; then if load mmc ${dev_num}:${distro_bootpart} ${kerne
l_loadaddr} zImage; then if load mmc ${dev_num}:${distro_bootpart} ${dtb_loadaddr} dtb.img || load mmc ${dev_num}:${distro_bootpart}
 ${dtb_loadaddr} ${ml_dtb}; then if load mmc ${dev_num}:${distro_bootpart} ${env_loadaddr} /boot/env.txt || load mmc ${dev_num}:${di
stro_bootpart} ${env_loadaddr} env.txt; then echo "Import env.txt"; env import -t ${env_loadaddr} ${filesize};fi;if test "X${rootdev
}" = "X"; then echo "rootdev is missing! use default: root=LABEL=ROOTFS!";setenv rootdev "LABEL=ROOTFS";fi;if test "X${custom_ethmac
}" != "X"; then echo "Found custom ethmac: ${custom_ethmac}, overwrite eth_mac!"; setenv eth_mac ${custom_ethmac};fi;if test "X${eth
_mac}" = "X"; then echo "Set default mac address to ethaddr: ${ethaddr}!";setenv eth_mac ${ethaddr};setenv save_ethmac "yes";fi;if t
est -e mmc ${dev_num}:${boot_env_part} ${mark_prefix}.next; then echo "Booting mainline kernel...";setenv condev "console=ttyAML0,11
5200n8 console=tty0 no_console_suspend consoleblank=0";else echo "Booting legacy kernel...";setenv condev "console=ttyS0,115200n8 co
nsole=tty0 no_console_suspend consoleblank=0";fi;if test "X${hwver}" = "XVIM2.V14"; then fdt addr ${dtb_loadaddr};fdt resize 65536;f
dt set /fan hwver "VIM2.V14";fdt set /i2c@c11087c0/khadas-mcu hwver "VIM2.V14";fdt set /soc/cbus@c1100000/i2c@87c0/khadas-mcu hwver 
"VIM2.V14";fi;setenv bootargs "root=${rootdev} rootflags=data=writeback rw ${condev} ${hdmiargs} ${panelargs} fsck.repair=yes net.if
names=0 ddr_size=${ddr_size} wol_enable=${wol_enable}  jtag=disable mac=${eth_mac} androidboot.mac=${eth_mac} save_ethmac=${save_eth
mac} fan=${fan_mode} hwver=${hwver} coherent_pool=${dma_size}";run boot_start;fi;fi;fi;done;done;
"Synchronous Abort" handler, esr 0x96000004
ELR:     77f2c42c
LR:      77f2c480
x0 : 222163616d5f6874 x1 : 0000000077f3a230
x2 : 0000000000000001 x3 : 0000000077f597e8
x4 : 0000000077f591d8 x5 : 0000000077f597e8
x6 : 0000000077f591d8 x7 : 0000000077f591e8
x8 : 0000000000000001 x9 : 0000000000000000
x10: 000000000000000f x11: 0000000077f34b30
x12: 0000000000000000 x13: 0000000000000000
x14: 0000000000000000 x15: 0000000000000000
x16: 0000000000000000 x17: 0000000000000000
x18: 0000000073e9de28 x19: 222163616d5f6874
x20: 0000000073e9d840 x21: 0000000077f44085
x22: 0000000077f44029 x23: 0000000001080000
x24: 0000000000000000 x25: 0000000000000000
x26: 0000000000000000 x27: 0000000073eca340
x28: 0000000000000000 x29: 0000000073e9d7e0

Resetting CPU ...

resetting ...

I thought the github boot.ini was more recent that the one in the img, so I updated the file on the SD and rebooted, but kernel still cannot start !

so, I give up for today :dizzy_face:

I think you haven’t load zImage and uInitrd,

What’s the cfgload?
Which image in your emmc?

in my emmc is the latest official khadas ubuntu 18.04 kernel 4.9.40

Are you sure, my emmc’s kernel version is 4.9.179


Got some gpu drivers from developer.arm.com and github, can’t wait starting X!

1 Like

where exatly did your emmc’s 4.9.179 kernel and distro come from ?
did you home build it with fenix or download it prebuilt from an url ?

I download it from offical site,
VIM1_Ubuntu-xfce-bionic_Linux-4.9_arm64_EMMC_V20190604.7z

here is what’s in my emmc:

kvim#printenv
EnableSelinux=permissive
active_slot=_a
baudrate=115200
boot_part=boot
bootargs=root=LABEL=ROOTFS rootflags=data=writeback rw console=ttyS0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.re
bootcmd=run storeboot
bootdelay=1
bootup_offset=0x10d9a70
bootup_size=0x17bb48
cmdline_keys=if keyman init 0x1234; then if keyman read usid ${loadaddr} str; then setenv bootargs ${bootargs} androidboot.serialno;
combine_key=saradc open 0;if saradc get_in_range 0x0 0x1f; then echo Detect function key;if gpio input GPIOAO_2; then echo Detect c;
cvbs_drv=0
cvbsmode=576cvbs
display_bpp=16
display_color_bg=0
display_color_fg=0xffff
display_color_index=16
display_height=576
display_layer=osd1
display_width=720
dtb_mem_addr=0x1000000
ethact=dwmac.c9410000
ethaddr=8a:ac:40:ca:0a:9c
fb_addr=0x3d800000
fb_height=1080
fb_width=1920
fdt_high=0x20000000
firstboot=0
gatewayip=10.18.9.1
hdmimode=1080p60hz
hostname=KVim
init_display=osd open;osd clear;imgread pic logo bootup $loadaddr;bmp display $bootup_offset;bmp scale
initargs=root=LABEL=ROOTFS rootflags=data=writeback rw console=ttyS0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.r 
ipaddr=10.18.9.97
jtag=disable
loadaddr=1080000
maxcpus=4
netmask=255.255.255.0
outputmode=576cvbs
preboot=run upgrade_check;run init_display;run storeargs;run combine_key;run upgrade_key;run vim_check;run switch_bootmode;
reboot_mode=watchdog_reboot
recovery_from_flash=setenv bootargs ${bootargs} aml_dt=${aml_dt} recovery_part={recovery_part} recovery_offset={recovery_offset};if;
recovery_from_sdcard=setenv bootargs ${bootargs} aml_dt=${aml_dt} recovery_part={recovery_part} recovery_offset={recovery_offset};i;
recovery_from_udisk=setenv bootargs ${bootargs} aml_dt=${aml_dt} recovery_part={recovery_part} recovery_offset={recovery_offset};if;
recovery_offset=0
recovery_part=recovery
saradc_val=0x1cf
sdc_burning=sdc_burn ${sdcburncfg}
sdcburncfg=aml_sdc_burn.ini
serverip=10.18.9.113
stderr=serial
stdin=serial
stdout=serial
storeargs=setenv bootargs ${initargs} logo=${display_layer},loaded,${fb_addr},${outputmode} maxcpus=${maxcpus} vout=${outputmode},e;
storeboot=cfgload;ext4load mmc 1:5 1080000 zImage;ext4load mmc 1:5 10000000 uInitrd;ext4load mmc 1:5 20000000 dtb.img;booti 1080000;
switch_bootmode=get_rebootmode;if test ${reboot_mode} = factory_reset; then run recovery_from_flash;else if test ${reboot_mode} = u;
try_auto_burn=update 700 750;
update=run usb_burning; run sdc_burning; if mmcinfo; then run recovery_from_sdcard;fi;if usb start 0; then run recovery_from_udisk;;
upgrade_check=echo upgrade_step=${upgrade_step}; if itest ${upgrade_step} == 3; then run init_display; run storeargs; run update;el;
upgrade_key=if gpio input GPIOAO_2; then echo detect upgrade key; sleep 3;if gpio input GPIOAO_2; then run update; fi;fi;
upgrade_step=2
usb_burning=update 1000
vim_check=saradc open 1;if saradc get_in_range 0x1a0 0x220; then echo Product checking: pass!;else if saradc get_in_range 0x0 0x1cf;
wipe_cache=successful
wipe_data=successful

Environment size: 4789/65532 bytes

…and I think it came from the same .7z img you mentionned before

Can you provide command help output ? Your uboot version is different, you should replace some command to your uboot’s.

kvim#load mmc 0:1 1080000 zImage
Unknown command 'load' - try 'help'
kvim#load mmc 0:1 1000000 uInitrd
Unknown command 'load' - try 'help'
kvim#load mmc 0:1 2000000 dtb.img
Unknown command 'load' - try 'help'

will those make the vim boot from SD or from emmc ?

I think you should try to replace ‘load’ to ‘fatload’ in the boot.ini

kvim#fatload mmc 0:1 2000000 dtb.img                                                                                       
reading dtb.img
26209 bytes read in 5 ms (5 MiB/s)
kvim#

It works!
I’ll update the boot.ini next version.

kvim#fatload mmc 0:1 1080000 zImage     
card in
init_part() 278: PART_TYPE_DOS
[mmc_init] mmc init success
reading zImage
16814592 bytes read in 1042 ms (15.4 MiB/s)

kvim#fatload mmc 0:1 1000000 uInitrd
reading uInitrd
7429145 bytes read in 462 ms (15.3 MiB/s)

kvim#fatload mmc 0:1 2000000 dtb.img
reading dtb.img
26209 bytes read in 5 ms (5 MiB/s)

kvim#setenv kernel_loadaddr "0x11000000"
kvim#setenv dtb_loadaddr "0x1000000"
kvim#setenv initrd_loadaddr "0x13000000"
kvim#booti ${kernel_loadaddr} ${initrd_loadaddr} ${dtb_loadaddr}
[rsvmem] get fdtaddr NULL!
rsvmem - reserve memory

Usage:
rsvmem check                   - check reserved memory
rsvmem dump                    - dump reserved memory

rsvmem check failed
Bad Linux ARM64 Image magic!

by the way, my VIM1 is he 2GB ram version, if that could make any difference with your…

So you’re ready to boot on sd crad

not yet, you can see booti command failing