Bring the build to libreelec community

Hi, Vrabac:
Here can boot into LE ROM from kszaq, but it seems that the ROM not works fine on VIM yet.

1) Upgrade to Vim_Marshmallow_Root_170303

2) Steps on Host for your reference:

gouwa@Wesion:~/Downloads$ gunzip -d LibreELEC-S905.arm-8.0-8.0.2b.img.gz 
gouwa@Wesion:~/Downloads$ sudo parted -l
[sudo] password for gouwa: 
Model: ATA ST1000LM014-1EJ1 (scsi)
Disk /dev/sda: 1000GB

...

Model: Mass Storage Device (scsi)
Disk /dev/sdb: 7948MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      16.5MB  7946MB  7929MB  primary  fat32        boot


gouwa@Wesion:~/Downloads$ sudo umount /dev/sdb1 
gouwa@Wesion:~/Downloads$ sudo dd if=LibreELEC-S905.arm-8.0-8.0.2b.img of=/dev/sdb bs=4M
137+0 records in
137+0 records out
574619648 bytes (575 MB, 548 MiB) copied, 69.3089 s, 8.3 MB/s
gouwa@Wesion:~/Downloads$ sync
gouwa@Wesion:~/Downloads$ cp -r gxl_p212_2g_kvim.dtb /media/gouwa/LIBREELEC/dtb.img 
gouwa@Wesion:~/Downloads$ sudo eject /media/gouwa/LIBREELEC/
gouwa@Wesion:~/Downloads$ 

3) Steps on VIM: Boot into U-Boot, and run below to boot into SD card:

kvim#run update
InUsbBurn
noSof
card in
[mmc_init] mmc init success
Device: SDIO Port B
Manufacturer ID: 3
OEM: 5344
Name: SU08G 
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 7.4 GiB
mmc clock: 40000000
Bus Width: 4-bit
Device: SDIO Port B
Manufacturer ID: 3
OEM: 5344
Name: SU08G 
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 7.4 GiB
mmc clock: 40000000
Bus Width: 4-bit
reading aml_autoscript
1033 bytes read in 8 ms (126 KiB/s)
## Executing script at 01080000
Saving Environment to aml-storage...
mmc env offset: 0x27400000 
Writing to MMC(1)... done
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
Device: SDIO Port B
Manufacturer ID: 3
OEM: 5344
Name: SU08G 
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 7.4 GiB
mmc clock: 40000000
Bus Width: 4-bit
reading kernel.img
6885376 bytes read in 385 ms (17.1 MiB/s)
reading dtb.img
38228 bytes read in 6 ms (6.1 MiB/s)
sd dtb.img loaded
ee_gate_off ...
## Booting Android Image at 0x01080000 ...
reloc_addr =73f51440
copy done
load dtb from 0x1000000 ......
   Uncompressing Kernel Image ... OK
   kernel loaded at 0x01080000, end = 0x01aeb908
   Loading Ramdisk to 73d33000, end 73eb9411 ... OK
   Loading Device Tree to 000000001fff3000, end 000000001ffff553 ... OK
signature: 
fdt_instaboot: no instaboot image

Starting kernel ...

uboot time: 57687625 us
[    0.000000@0] Initializing cgroup subsys cpuset
[    0.000000@0] Initializing cgroup subsys cpu
[    0.000000@0] Initializing cgroup subsys cpuacct
[    0.000000@0] Linux version 3.14.29 (kszaq@FPGAWorker) (gcc version 6.3.1 20170109 (Linaro GCC 6.3-2017.02) ) #1 SMP Mon Jun 12 23:09:21 CEST 2017
[    0.000000@0] CPU: AArch64 Processor [410fd034] revision 4
[    0.000000@0] no prop version_code
[    0.000000@0] bootconsole [earlycon0] enabled
[    0.000000@0] fdt Reserved memory table:
[    0.000000@0]            linux,meson-fb: 0x000000007e000000 - 0x0000000080000000  (32 MiB)
[    0.000000@0]                  linux,di: 0x000000007c200000 - 0x000000007e000000  (30 MiB)
[    0.000000@0] DI: DI reserved memory: created CMA memory pool at 0x000000007c200000, size 30 MiB
[    0.000000@0]             linux,ion-dev: 0x0000000079200000 - 0x000000007c200000  (48 MiB)
[    0.000000@0]               linux,ppmgr: 0x0000000079200000 - 0x0000000079200000  (0 MiB)
[    0.000000@0]        linux,codec_mm_cma: 0x0000000067c00000 - 0x0000000073c00000  (192 MiB)
[    0.000000@0]              linux,picdec: 0x0000000079200000 - 0x0000000079200000  (0 MiB)
[    0.000000@0] Reserved memory: incorrect alignment of CMA region
[    0.000000@0]   linux,codec_mm_reserved: 0x0000000075100000 - 0x0000000079200000  (65 MiB)
[    0.000000@0] fdt Reserved memory total:  370 MiB
[    0.000000@0] cma: Reserved 8 MiB at 74800000
[    0.000000@0] psci: probing function IDs from device-tree
[    0.000000@0] PERCPU: Embedded 12 pages/cpu @ffffffc0750a1000 s17152 r8192 d23808 u49152
[    0.000000@0] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 506004
[    0.000000@0] Kernel command line: rootfstype=ramfs init=/init console=ttyS0,115200 no_console_suspend earlyprintk=aml-uart,0xc81004c0 ramoops.pstore_en=1 ramoops.record_size=0x8000 ramoops.console_size=0x4000 androidboot.selinux=disabled logo=osd1,loaded,0x3d800000,2160p60hz420 maxcpus=4 vout=2160p60hz420,enable hdmimode=2160p60hz420 cvbsmode= hdmitx= cvbsdrv= androidboot.firstboot=0 jtag=apao androidboot.hardware=amlogic bootfromsd console=tty0 systemd.show_status=auto noswap
[    0.000000@0] logo: osd1
[    0.000000@0] logo: loaded
[    0.000000@0] logo: 0x3d800000
[    0.000000@0] logo: 2160p60hz420
[    0.000000@0] vout_serve: 2160p60hz420
[    0.000000@0] vout_serve: en: 1
[    0.000000@0] logo: get hdmimode: 2160p60hz420
[    0.000000@0] logo: get cvbsmode: 
[    0.000000@0] tv_vout: cvbs performance line = 
[    0.000000@0] PID hash table entries: 4096 (order: 3, 32768 bytes)
[    0.000000@0] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes)
[    0.000000@0] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes)
[    0.000000@0] Memory: 1649160K/2060288K available (6672K kernel code, 694K rwdata, 2448K rodata, 844K init, 5194K bss, 411128K reserved)
[    0.000000@0] Virtual kernel memory layout:
[    0.000000@0]     vmalloc : 0xffffff8000000000 - 0xffffff8040000000   (  1024 MB)
[    0.000000@0]     vmemmap : 0xffffff8040010000 - 0xffffff8042380000   (    35 MB)
[    0.000000@0]     modules : 0xffffffbffc000000 - 0xffffffc000000000   (    64 MB)
[    0.000000@0]     memory  : 0xffffffc000000000 - 0xffffffc07e000000   (  2016 MB)
[    0.000000@0]       .init : 0xffffffc00196a000 - 0xffffffc001a3d300   (   845 kB)
[    0.000000@0]       .text : 0xffffffc001080000 - 0xffffffc0019691b4   (  9125 kB)
[    0.000000@0]       .data : 0xffffffc001a3e000 - 0xffffffc001aeb908   (   695 kB)
[    0.000000@0] PM: Registered nosave memory: [mem 0x01080000-0x01968fff]
[    0.000000@0] SLUB: HWalign=64, Order=0-1, MinObjects=0, CPUs=4, Nodes=1
[    0.000000@0] arch_multi_cluster:0
[    0.000000@0] Hierarchical RCU implementation.
[    0.000000@0] 	RCU debugfs-based tracing is enabled.
[    0.000000@0] 	CONFIG_RCU_FANOUT set to non-default value of 32
[    0.000000@0] NR_IRQS:64 nr_irqs:64 0
[    0.000000@0] Architected cp15 timer(s) running at 24.00MHz (phys).
[    0.000005@0] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 2863311519744ns
[    0.008242@0] meson_bc_timer: mclk->mux_reg =ffffff800000c990,mclk->reg =ffffff800000e994
[    0.016738@0] Console: colour dummy device 80x25
[    0.021087@0] console [tty0] enabled
[    0.024673@0] bootconsole [earlycon0] disabled
domain-0 init dvfs: 4

@kszaq as the printing log is disabled, so I can’t figure out the detailed issue at the moment, and follow are some information:

  • Stuck, see log above.
  • The monitor/display didn’t show anything, just black screen.
  • U-Boot ENV as following:
kvim# print
EnableSelinux=disabled
baudrate=115200
bootargs=rootfstype=ramfs init=/init console=ttyS0,115200 no_console_suspend earlyprintk=aml-uart,0xc81004c0 ramoops.pstore_en=1 ramoops.record_size=0x8000 ramoops.console_size=0x4000 androidboot.selinux=disabled logo=osd1,loaded,0x3d800000,2160p60hz420 maxcpus=4 vout=2160p60hz420,enable hdmimode=2160p60hz420 cvbsmode= hdmitx= cvbsdrv= androidboot.firstboot=0 jtag=apao androidboot.hardware=amlogic
bootcmd=if test ${bootfromnand} = 1; then setenv bootfromnand 0; saveenv; else run librefromsd; run librefromusb; fi; run storeboot
bootdelay=1
bootfromnand=0
bootup_offset=0x10d82a0
bootup_size=0x3f4b8
cmdline_keys=if keyman init 0x1234; then if keyman read usid ${loadaddr} str; then setenv bootargs ${bootargs} androidboot.serialno=${usid};fi;if keyman read mac ${loadaddr} str; then setenv bootargs ${bootargs} mac=${mac} androidboot.mac=${mac};fi;if keyman read deviceid ${loadaddr} str; then setenv bootargs ${bootargs} androidboot.deviceid=${deviceid};fi;fi;
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 combine keys;store init 3; fi;fi;
display_bpp=16
display_color_bg=0
display_color_fg=0xffff
display_color_index=16
display_height=2160
display_layer=osd1
display_width=3840
dtb_mem_addr=0x1000000
ethact=dwmac.c9410000
ethaddr=00:15:18:01:81:31
factory_reset_poweroff_protect=echo wipe_data=${wipe_data}; echo wipe_cache=${wipe_cache};if test ${wipe_data} = failed; then run init_display; run storeargs;if mmcinfo; then run recovery_from_sdcard;fi;if usb start 0; then run recovery_from_udisk;fi;run recovery_from_flash;fi; if test ${wipe_cache} = failed; then run init_display; run storeargs;if mmcinfo; then run recovery_from_sdcard;fi;if usb start 0; then run recovery_from_udisk;fi;run recovery_from_flash;fi; 
fb_addr=0x3d800000
fb_height=1080
fb_width=1920
fdt_high=0x20000000
filesize=409
firstboot=0
gatewayip=10.18.9.1
hdmimode=2160p60hz420
hostname=KVim
init_display=osd open;osd clear;imgread pic logo bootup $loadaddr;bmp display $bootup_offset;bmp scale
initargs=rootfstype=ramfs init=/init console=ttyS0,115200 no_console_suspend earlyprintk=aml-uart,0xc81004c0 ramoops.pstore_en=1 ramoops.record_size=0x8000 ramoops.console_size=0x4000 
ipaddr=10.18.9.97
jtag=apao
librefromsd=if mmcinfo; then if fatload mmc 0 ${loadaddr} kernel.img; then run sddtb; setenv bootargs ${bootargs} bootfromsd; bootm; fi; fi
librefromusb=if usb start 0; then if fatload usb 0 ${loadaddr} kernel.img; then run usbdtb; setenv bootargs ${bootargs} bootfromusb; bootm; fi; fi
loadaddr=1080000
maxcpus=4
netmask=255.255.255.0
outputmode=2160p60hz420
preboot=run factory_reset_poweroff_protect;run upgrade_check;run init_display;run storeargs;run combine_key;run upgrade_key;run vim_check;run switch_bootmode;
reboot_mode=cold_boot
recovery_from_flash=setenv bootargs ${bootargs} aml_dt=${aml_dt} recovery_part={recovery_part} recovery_offset={recovery_offset};if imgread kernel ${recovery_part} ${loadaddr} ${recovery_offset}; then wipeisb; bootm ${loadaddr}; fi
recovery_from_sdcard=setenv bootargs ${bootargs} aml_dt=${aml_dt} recovery_part={recovery_part} recovery_offset={recovery_offset};if fatload mmc 0 ${loadaddr} aml_autoscript; then autoscr ${loadaddr}; fi;if fatload mmc 0 ${loadaddr} recovery.img; then if fatload mmc 0 ${dtb_mem_addr} dtb.img; then echo sd dtb.img loaded; fi;wipeisb; bootm ${loadaddr};fi;
recovery_from_udisk=setenv bootargs ${bootargs} aml_dt=${aml_dt} recovery_part={recovery_part} recovery_offset={recovery_offset};if fatload usb 0 ${loadaddr} aml_autoscript; then autoscr ${loadaddr}; fi;if fatload usb 0 ${loadaddr} recovery.img; then if fatload usb 0 ${dtb_mem_addr} dtb.img; then echo udisk dtb.img loaded; fi;wipeisb; bootm ${loadaddr};fi;
recovery_offset=0
recovery_part=recovery
saradc_val=0x1f7
sdc_burning=sdc_burn ${sdcburncfg}
sdcburncfg=aml_sdc_burn.ini
sddtb=if fatload mmc 0 ${dtb_mem_addr} dtb.img; then echo sd dtb.img loaded; else store dtb read $dtb_mem_addr; fi
serverip=10.18.9.113
stderr=serial
stdin=serial
stdout=serial
storeargs=setenv bootargs ${initargs} androidboot.selinux=${EnableSelinux} logo=${display_layer},loaded,${fb_addr},${outputmode} maxcpus=${maxcpus} vout=${outputmode},enable hdmimode=${hdmimode} cvbsmode=${cvbsmode} hdmitx=${cecconfig} cvbsdrv=${cvbs_drv} androidboot.firstboot=${firstboot} jtag=${jtag}; setenv bootargs ${bootargs} androidboot.hardware=amlogic;run cmdline_keys;
storeboot=if imgread kernel boot ${loadaddr}; then bootm ${loadaddr}; fi;run update;
switch_bootmode=get_rebootmode;if test ${reboot_mode} = factory_reset; then run recovery_from_flash;else if test ${reboot_mode} = update; then run update;else if test ${reboot_mode} = cold_boot; then fi;fi;fi;
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;fi;run recovery_from_flash;
upgrade_check=echo upgrade_step=${upgrade_step}; if itest ${upgrade_step} == 3; then run init_display; run storeargs; run update;else fi;
upgrade_key=if gpio input GPIOAO_2; then echo detect upgrade key; sleep 1;if gpio input GPIOAO_2; then run update; fi;fi;
upgrade_step=2
usb_burning=update 1000
usbdtb=if fatload usb 0 ${dtb_mem_addr} dtb.img; then echo usb dtb.img loaded; else store dtb read $dtb_mem_addr; fi
vim_check=saradc open 1;if saradc get_in_range 0x1d0 0x220; then echo Product checking: pass!;else if saradc get_in_range 0x0 0x1cf; then echo Product checking: fail!; sleep 5; reboot;fi;fi;
wipe_cache=successful
wipe_data=successful

Environment size: 5753/65532 bytes
kvim#

Anything you need me to assistant just let me know.

Thanks.