Odroid M1S

This is for ARMv8 based devices

Odroid M1S

Postby pohl7452 » Wed Jan 03, 2024 2:10 pm

Recently Hardkernel released the Odroid M1S for their 15th anniversary and it seems to be a great little board for a very attractive price. I got mine for approx. 100 € including case and power supply. It is built around the Rockchip RK3566 SOC with 8GB RAM and it includes already 64 GB onboard emmc with an additional M.2 nvme slot for future expansion (only PCIe 2.1 though). Compared to a Raspberry 5, which doesn't come with case, power supply, SD card and M.2 slot (at least not without a separate hat), this is a great value board. But getting alarm installed seems to be a bit tricky as there is no official support yet.

Specs: [url]https://www.hardkernel.com/shop/odroid-m1s-with-8gbyte-ram/[/url]
Wiki: [url]https://wiki.odroid.com/odroid-m1s/odroid-m1s[/url]

Officially supported by Hardkernel are Ubuntu 20.04.6 LTS and Android 11. So I copied the official Ubuntu to an external SD card and booted the board:

Ubuntu 20.04.6 LTS boot log:
[code]
DDR V1.18 f366f69a7d typ 23/07/17-15:48:58
ln
LP4/4x derate en, other dram:1x trefi
SRX
ddrconfig:7
LPDDR4X, 324MHz
BW=32 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=8 Size=8192MB
tdqss: cs0 dqs0: 72ps, dqs1: -48ps, dqs2: -24ps, dqs3: -96ps,
tdqss: cs1 dqs0: 72ps, dqs1: -48ps, dqs2: -24ps, dqs3: -96ps,

change to: 324MHz
clk skew:0x60

change to: 528MHz
clk skew:0x58

change to: 780MHz
clk skew:0x58

change to: 1056MHz(final freq)
PHY drv:clk:36,ca:36,DQ:29,odt:60
vrefinner:16%, vrefout:22%
dram drv:40,odt:80
vref_ca:00000071
clk skew:0x2f
cs 0:
the read training result:
DQS0:0x3f, DQS1:0x3d, DQS2:0x42, DQS3:0x3b,
min : 0xd 0xd 0x10 0xd 0x1 0x3 0x7 0x5 , 0x5 0x4 0x1 0x1 0x9 0x9 0xb 0x7 ,
0x11 0x10 0xe 0xb 0x5 0x1 0x4 0x6 , 0xa 0x5 0x5 0x1 0xd 0xd 0xa 0xd ,
mid :0x2b 0x2b 0x2e 0x2b 0x1f 0x22 0x25 0x23 ,0x23 0x23 0x20 0x1f 0x28 0x28 0x29 0x26 ,
0x2e 0x2d 0x2b 0x29 0x21 0x1e 0x20 0x23 ,0x28 0x23 0x22 0x1f 0x2b 0x2b 0x29 0x2a ,
max :0x49 0x49 0x4d 0x49 0x3d 0x41 0x44 0x41 ,0x42 0x43 0x40 0x3d 0x47 0x47 0x48 0x45 ,
0x4c 0x4a 0x48 0x47 0x3e 0x3c 0x3d 0x41 ,0x47 0x42 0x40 0x3d 0x4a 0x4a 0x48 0x48 ,
range:0x3c 0x3c 0x3d 0x3c 0x3c 0x3e 0x3d 0x3c ,0x3d 0x3f 0x3f 0x3c 0x3e 0x3e 0x3d 0x3e ,
0x3b 0x3a 0x3a 0x3c 0x39 0x3b 0x39 0x3b ,0x3d 0x3d 0x3b 0x3c 0x3d 0x3d 0x3e 0x3b ,
the write training result:
DQS0:0x38, DQS1:0x29, DQS2:0x2c, DQS3:0x23,
min :0x5f 0x62 0x63 0x62 0x55 0x58 0x5b 0x5c 0x5b ,0x4f 0x4d 0x49 0x48 0x51 0x53 0x51 0x51 0x4f ,
0x53 0x53 0x50 0x4e 0x48 0x47 0x48 0x4c 0x4c ,0x4d 0x4a 0x49 0x46 0x4f 0x4f 0x4d 0x51 0x4a ,
mid :0x79 0x7c 0x7d 0x7b 0x6f 0x71 0x75 0x75 0x74 ,0x68 0x67 0x61 0x61 0x6a 0x6a 0x6a 0x6a 0x67 ,
0x6c 0x6c 0x69 0x67 0x60 0x5d 0x60 0x64 0x65 ,0x66 0x62 0x60 0x5e 0x69 0x69 0x66 0x6b 0x63 ,
max :0x93 0x96 0x97 0x94 0x89 0x8b 0x8f 0x8e 0x8e ,0x81 0x81 0x7a 0x7b 0x83 0x82 0x83 0x83 0x80 ,
0x86 0x86 0x82 0x81 0x79 0x74 0x78 0x7d 0x7f ,0x80 0x7b 0x78 0x77 0x83 0x84 0x7f 0x85 0x7d ,
range:0x34 0x34 0x34 0x32 0x34 0x33 0x34 0x32 0x33 ,0x32 0x34 0x31 0x33 0x32 0x2f 0x32 0x32 0x31 ,
0x33 0x33 0x32 0x33 0x31 0x2d 0x30 0x31 0x33 ,0x33 0x31 0x2f 0x31 0x34 0x35 0x32 0x34 0x33 ,
cs 1:
the read training result:
DQS0:0x3f, DQS1:0x3e, DQS2:0x42, DQS3:0x3b,
min : 0xc 0xd 0xf 0xd 0x1 0x4 0x7 0x5 , 0x5 0x4 0x1 0x0 0x9 0x9 0xb 0x7 ,
0x10 0x10 0xd 0xb 0x4 0x1 0x3 0x5 , 0xa 0x6 0x6 0x1 0xf 0xd 0xa 0xe ,
mid :0x2a 0x2b 0x2e 0x2b 0x1f 0x22 0x25 0x23 ,0x23 0x22 0x1f 0x1e 0x27 0x28 0x29 0x26 ,
0x2d 0x2d 0x2a 0x29 0x21 0x1f 0x20 0x23 ,0x28 0x23 0x23 0x1e 0x2c 0x2b 0x29 0x2b ,
max :0x48 0x49 0x4d 0x49 0x3e 0x41 0x44 0x41 ,0x41 0x41 0x3e 0x3d 0x46 0x47 0x47 0x45 ,
0x4b 0x4b 0x48 0x47 0x3f 0x3d 0x3e 0x41 ,0x46 0x41 0x40 0x3c 0x4a 0x49 0x48 0x48 ,
range:0x3c 0x3c 0x3e 0x3c 0x3d 0x3d 0x3d 0x3c ,0x3c 0x3d 0x3d 0x3d 0x3d 0x3e 0x3c 0x3e ,
0x3b 0x3b 0x3b 0x3c 0x3b 0x3c 0x3b 0x3c ,0x3c 0x3b 0x3a 0x3b 0x3b 0x3c 0x3e 0x3a ,
the write training result:
DQS0:0x38, DQS1:0x29, DQS2:0x2c, DQS3:0x23,
min :0x5e 0x62 0x64 0x61 0x55 0x58 0x5b 0x5c 0x5b ,0x4c 0x4a 0x47 0x46 0x4e 0x4e 0x4f 0x4f 0x4a ,
0x51 0x51 0x4d 0x4c 0x47 0x45 0x46 0x4b 0x4a ,0x4a 0x48 0x47 0x43 0x4d 0x4d 0x4b 0x4e 0x48 ,
mid :0x78 0x7c 0x7e 0x7a 0x6f 0x71 0x75 0x75 0x74 ,0x65 0x63 0x5f 0x5f 0x68 0x66 0x67 0x67 0x62 ,
0x6b 0x6b 0x67 0x66 0x5f 0x5c 0x5e 0x63 0x64 ,0x62 0x5f 0x5e 0x5b 0x66 0x67 0x63 0x68 0x61 ,
max :0x93 0x96 0x98 0x94 0x89 0x8b 0x8f 0x8e 0x8e ,0x7e 0x7c 0x78 0x79 0x82 0x7f 0x80 0x80 0x7b ,
0x86 0x86 0x81 0x81 0x78 0x74 0x77 0x7b 0x7f ,0x7b 0x77 0x76 0x74 0x80 0x82 0x7c 0x82 0x7a ,
range:0x35 0x34 0x34 0x33 0x34 0x33 0x34 0x32 0x33 ,0x32 0x32 0x31 0x33 0x34 0x31 0x31 0x31 0x31 ,
0x35 0x35 0x34 0x35 0x31 0x2f 0x31 0x30 0x35 ,0x31 0x2f 0x2f 0x31 0x33 0x35 0x31 0x34 0x32 ,
CA Training result:
cs:0 min :0x57 0x34 0x4f 0x28 0x4e 0x1f 0x4d ,0x54 0x26 0x4d 0x1f 0x4d 0x1f 0x4d ,
cs:0 mid :0x82 0x85 0x79 0x79 0x78 0x75 0x78 ,0x7d 0x7c 0x77 0x74 0x77 0x74 0x77 ,
cs:0 max :0xae 0xd6 0xa3 0xcb 0xa3 0xcb 0xa3 ,0xa6 0xd2 0xa1 0xca 0xa1 0xc9 0xa2 ,
cs:0 range:0x57 0xa2 0x54 0xa3 0x55 0xac 0x56 ,0x52 0xac 0x54 0xab 0x54 0xaa 0x55 ,
cs:1 min :0x50 0x45 0x49 0x39 0x4a 0x37 0x49 ,0x4d 0x3e 0x48 0x38 0x49 0x36 0x49 ,
cs:1 mid :0x88 0x8a 0x82 0x7f 0x81 0x7e 0x78 ,0x86 0x84 0x7e 0x7e 0x80 0x7d 0x77 ,
cs:1 max :0xc0 0xd0 0xbb 0xc5 0xb8 0xc6 0xa7 ,0xbf 0xcb 0xb5 0xc5 0xb8 0xc5 0xa6 ,
cs:1 range:0x70 0x8b 0x72 0x8c 0x6e 0x8f 0x5e ,0x72 0x8d 0x6d 0x8d 0x6f 0x8f 0x5d ,
out
U-Boot SPL board init
U-Boot SPL 2017.09-g97ab962d1ed-230719 #tobetter (Oct 27 2023 - 14:54:41)
Trying to boot from MMC2
spl: partition error
Trying to boot from MMC1
spl: partition error
Trying fit image at 0x800 sector
## Verified-boot: 0
## Checking atf-1 0x00040000 ... sha256(0d5225a4ab...) + OK
## Checking uboot 0x00a00000 ... sha256(222747d079...) + OK
## Checking fdt 0x00b32360 ... sha256(11938f6df3...) + OK
## Checking atf-2 0xfdcc1000 ... sha256(3e94d16e6a...) + OK
## Checking atf-3 0x0006b000 ... sha256(fde0ef262b...) + OK
## Checking atf-4 0xfdcce000 ... sha256(c9eb312bf2...) + OK
## Checking atf-5 0xfdcd0000 ... sha256(befba422b8...) + OK
## Checking atf-6 0x00069000 ... sha256(6ede7a3b44...) + OK
## Checking optee 0x08400000 ... sha256(4fcbcd3870...) + OK
Jumping to U-Boot(0x00a00000) via ARM Trusted Firmware(0x00040000)
Total: 139.385/211.365 ms

INFO: Preloader serial: 2
NOTICE: BL31: v2.3():v2.3-607-gbf602aff1:cl
NOTICE: BL31: Built : 10:16:03, Jun 5 2023
INFO: GICv3 without legacy support detected.
INFO: ARM GICv3 driver initialized in EL3
INFO: pmu v1 is valid 220114
INFO: dfs DDR fsp_param[0].freq_mhz= 1056MHz
INFO: dfs DDR fsp_param[1].freq_mhz= 324MHz
INFO: dfs DDR fsp_param[2].freq_mhz= 528MHz
INFO: dfs DDR fsp_param[3].freq_mhz= 780MHz
INFO: Using opteed sec cpu_context!
INFO: boot cpu mask: 0
INFO: BL31: Initializing runtime services
INFO: BL31: Initializing BL32
I/TC:
I/TC: OP-TEE version: 3.13.0-723-gdcfdd61d0 #hisping.lin (gcc version 10.2.1 20201103 (GNU Toolchain for the A-profile Architecture 10.2-2020.11 (arm-10.16))) #2 Wed Jun 7 09:43:57 CST 2023 aarch64
I/TC: Primary CPU initializing
I/TC: Primary CPU switching to normal world boot
INFO: BL31: Preparing for EL3 exit to normal world
INFO: Entry point address = 0xa00000
INFO: SPSR = 0x3c9


U-Boot 2017.09-g97ab962d1ed-230719 #tobetter (Oct 27 2023 - 14:54:41 +0900)

Model: Hardkernel ODROID-M1S
MPIDR: 0x81000000
PreSerial: 2, raw, 0xfe660000
DRAM: 7.7 GiB
Sysmem: init
Relocation Offset: ecb2f000
Relocation fdt: eb1f9048 - eb1fece8
CR: M/C/I
dwmmc@fe2b0000: 1, dwmmc@fe2c0000: 2, sdhci@fe310000: 0
Bootdev(assign): mmc 1
MMC1: Legacy, 52Mhz
PartType: DOS
** File not found ODROIDBIOS.BIN **
** Invalid partition 2 **
** Invalid partition 3 **
DM: v1
** File not found dtb **
** File not found rockchip/rk3566-odroid-m1s.dtb **
Error binding driver 'gpio_led': -22
Some drivers failed to bind
I2c3 speed: 100000Hz
PMIC: RK8090 (on=0x80, off=0x80)
vdd_logic init 900000 uV
vdd_gpu init 900000 uV
vdd_npu init 900000 uV
io-domain: OK
MMC: Could not find baseparameter partition
Rockchip UBOOT DRM driver version: v1.0.1
VOP have 1 active VP
vp0 have layer nr:6[0 2 4 1 3 5 ], primary plane: 4
vp1 have layer nr:0[], primary plane: 0
vp2 have layer nr:0[], primary plane: 0
xfer: num: 2, addr: 0x50
xfer: num: 2, addr: 0x50
Monitor has basic audio support
Could not find baseparameter partition
hdmi@fe0a0000: detailed mode clock 148500 kHz, flags[5]
H: 1920 2008 2052 2200
V: 1080 1084 1089 1125
bus_format: 2025
VOP update mode to: 1920x1080p60, type: HDMI0 for VP0
VP0 set crtc_clock to 148000KHz
VOP VP0 enable Smart0[1920x1080->1920x1080@0x0] fmt[0] addr[0xed800000]
CEA mode used vic=16
final pixclk = 148000000 tmdsclk = 148000000
PHY powered down in 0 iterations
PHY PLL locked 1 iterations
PHY powered down in 0 iterations
PHY PLL locked 1 iterations
sink has audio support
Rate 148000000 missing; compute N dynamically
hdmi_set_clk_regenerator: fs=48000Hz ftdms=148.000MHz N=6144 cts=148000
Model: Hardkernel ODROID-M1S
MPIDR: 0x81000000
** File not found boot-logo.bmp.gz **
No misc partition
boot mode: normal
FIT: No boot partition
uImage: No boot partition
No resource file: logo.bmp
failed to display uboot logo
CLK: (sync kernel. arm: enter 816000 KHz, init 816000 KHz, kernel 0N/A)
apll 816000 KHz
dpll 528000 KHz
gpll 1188000 KHz
cpll 1000000 KHz
npll 1200000 KHz
vpll 24000 KHz
hpll 148000 KHz
ppll 200000 KHz
armclk 816000 KHz
aclk_bus 150000 KHz
pclk_bus 100000 KHz
aclk_top_high 500000 KHz
aclk_top_low 400000 KHz
hclk_top 150000 KHz
pclk_top 100000 KHz
aclk_perimid 300000 KHz
hclk_perimid 150000 KHz
pclk_pmu 100000 KHz
No misc partition
Net: No ethernet found.
Hit key to stop autoboot('CTRL+C'): 0
### CRAMFS LOAD ERROR<0> for boot.scr!
## Executing script at 00c00000
Wrong image format for "source" command
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1...
switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
3013 bytes read in 2 ms (1.4 MiB/s)
## Executing script at 00c00000
184 bytes read in 2 ms (89.8 KiB/s)
ini: Imported overlay_resize as 16384
ini: Imported overlay_profile as
ini: Imported overlays as i2c0 i2c1 spi0
161092 bytes read in 32 ms (4.8 MiB/s)
223 bytes read in 10 ms (21.5 KiB/s)
223 bytes read in 10 ms (21.5 KiB/s)
514 bytes read in 12 ms (41 KiB/s)
8021193 bytes read in 50 ms (153 MiB/s)
Uncompressed size: 24051720 = 0x16F0008
17145891 bytes read in 100 ms (163.5 MiB/s)
Booting Debian 5.10.0-odroid-arm64 from mmc 0:1...
Fdt Ramdisk skip relocation
No misc partition
Sysmem Warn: kernel 'reserved-memory' "fdt-memory-reserved0"(0x08300000 - 0x08328000) is overlap with "FDT" (0x08300000 - 0x0832b204)

sysmem_dump_all:
--------------------------------------------------------------------
memory.rgn[0].addr = 0x00200000 - 0x08400000 (size: 0x08200000)
memory.rgn[1].addr = 0x09400000 - 0xf0000000 (size: 0xe6c00000)

memory.total = 0xeee00000 (3822 MiB. 0 KiB)
--------------------------------------------------------------------
allocated.rgn[0].name = "UBOOT"
.addr = 0xeb1f9030 - 0xf0000000 (size: 0x04e06fd0)
allocated.rgn[1].name = "STACK"
.addr = 0xeaff9030 - 0xeb1f9030 (size: 0x00200000)
allocated.rgn[2].name = "FDT"
.addr = 0x08300000 - 0x0832b204 (size: 0x0002b204)

kmem-resv.rgn[0].name = "fdt-memory-reserved0"
.addr = 0x08300000 - 0x08328000 (size: 0x00028000)
kmem-resv.rgn[1].name = "fdt-memory-reserved1"
.addr = 0x0a200000 - 0x0b25a023 (size: 0x0105a023)
kmem-resv.rgn[2].name = "ramoops@110000"
.addr = 0x00110000 - 0x00200000 (size: 0x000f0000)

framework malloc_r = 32 MiB
framework malloc_f = 512 KiB

allocated.total = 0x061a41f7 (97 MiB. 656 KiB)
--------------------------------------------------------------------
LMB.allocated[0].addr = 0x08300000 - 0x0832b204 (size: 0x0002b204)
LMB.allocated[1].addr = 0xeaff9030 - 0xf0000000 (size: 0x05006fd0)

reserved.core.total = 0x050321d4 (80 MiB. 200 KiB)
--------------------------------------------------------------------

## Flattened Device Tree blob at 0x08300000
Booting using the fdt blob at 0x08300000
reserving fdt memory region: addr=8300000 size=3e000
Using Device Tree in place at 0000000008300000, end 0000000008340fff
FIT: No boot partition
uImage: No boot partition
No resource file: logo_kernel.bmp
VP0 fail to load kernel logo
## reserved-memory:
ramoops@110000: addr=110000 size=f0000
Adding bank: 0x00200000 - 0x08400000 (size: 0x08200000)
Adding bank: 0x09400000 - 0xf0000000 (size: 0xe6c00000)
Adding bank: 0x100000000 - 0x200000000 (size: 0x100000000)
Total: 1474.578/1521.123 ms

Starting kernel ...

I/TC: Secondary CPU 1 initializing
I/TC: Secondary CPU 1 switching to normal world boot
I/TC: Secondary CPU 2 initializing
I/TC: Secondary CPU 2 switching to normal world boot
I/TC: Secondary CPU 3 initializing
I/TC: Secondary CPU 3 switching to normal world boot
[ 0.193593] fiq_debugger fiq_debugger.0: IRQ fiq not found
[ 0.193639] fiq_debugger fiq_debugger.0: IRQ wakeup not found
[ 0.193669] fiq_debugger_probe: could not install nmi irq handler
[ 2.353571] rk-pcie 3c0000000.pcie: IRQ msi not found
[ 2.353650] rk-pcie 3c0000000.pcie: Missing *config* reg space
[ 2.353898] rk-pcie 3c0000000.pcie: Missing *config* reg space
[ 2.353968] rk-pcie 3c0000000.pcie: invalid resource
[ 2.361655] mpp-iep2 fdef0000.iep: allocate roi buffer failed
[ 2.380322] arm-scmi firmware:scmi: Failed. SCMI protocol 22 not active.
[ 2.402262] dwhdmi-rockchip fe0a0000.hdmi: IRQ index 1 not found
[ 2.634827] rk_gmac-dwmac fe010000.ethernet: no regulator found
[ 3.001828] arm-scmi firmware:scmi: Failed. SCMI protocol 17 not active.
[ 3.005775] rksfc_base v1.1 2016-01-08
[ 3.109983] rk817-battery rk817-battery: Failed to find matching dt id
[ 3.110674] rk817-charger rk817-charger: Failed to find matching dt id
[ 3.146476] mpp_rkvenc fdf40000.rkvenc: Failed to get leakage
[ 3.147540] mpp_rkvenc fdf40000.rkvenc: failed to find power_model node
[ 3.147770] mpp_rkvenc fdf40000.rkvenc: failed to initialize power model
[ 3.147999] mpp_rkvenc fdf40000.rkvenc: failed to get dynamic-coefficient
[ 3.150749] mpp_rkvdec2 fdf80200.rkvdec: shared_niu_a is not found!
[ 3.150976] rkvdec2_init:1022: No niu aclk reset resource define
[ 3.151214] mpp_rkvdec2 fdf80200.rkvdec: shared_niu_h is not found!
[ 3.151397] rkvdec2_init:1025: No niu hclk reset resource define
[ 3.152858] mpp_rkvdec2 fdf80200.rkvdec: failed to find power_model node
[ 3.153061] mpp_rkvdec2 fdf80200.rkvdec: failed to initialize power model
[ 3.153256] mpp_rkvdec2 fdf80200.rkvdec: failed to get dynamic-coefficient
[ 5.231179] rk-pcie 3c0000000.pcie: PCIe Link Fail
[ 5.231273] rk-pcie 3c0000000.pcie: failed to initialize host


Ubuntu 20.04.6 LTS odroidm1s ttyFIQ0

odroidm1s login:
[/code]

Then I followed the generic aarch64 installation instructions make_clickable_callback(MAGIC_URL_FULL, '(', 'https://archlinuxarm.org/platforms/armv8/generic', '', ' class="postlink"')) and copied the rootfs to the internal emmc storage (part 2).

[code]
Partition layout of /dev/mmcblk0 (emmc):
1. 256 GB /boot ext2
2. 64 GB / ext4
[/code]

After installing the arch-install-scripts ubuntu package (apt install arch-install-scripts), I chrooted into arch to adjust locale, hostname etc.
Back to Ubuntu I flashed the u-boot booloader from the official image to emmc:

[code]
cd /usr/lib/u-boot/odroidm1s
./sd-fusing /dev/mmcblk0
[/code]

What I am missing is a functional u-boot script and a script to add the missing u-boot headers to the initramfs and the aarch64 kernel 6.2. And maybe a flattened device tree file for u-boot. A dtb for the Odroid M1S board is provided in the official Ubuntu image, although I have not investigated what is the difference between the Odroid M1S and M1 (included in the mainline kernel).

Could anyone provide a PKGBUILD for u-boot built for the M1S specifically with a working boot.scr and scripts to add missing u-boot headers? Is the M1S board and especially the M.2 slot actually supported by the generic aarch64 kernel 6.2? Unfortunately Archdroid has not been updated for a while, which has a u-boot package built for the Odroid C4 and could be used as a starting point for this one.

Please let me know if anyone has had more success in installing alarm on this device.
pohl7452
 
Posts: 7
Joined: Wed Apr 22, 2020 5:47 am

Re: Odroid M1S

Postby pohl7452 » Wed Jan 03, 2024 4:31 pm

Successful boot using the kernel provided by Hardkernel (copied from Ubuntu image). Steps to reproduce:

1. copy boot files from Ubuntu image into /boot

[code]
boot-logo.bmp.gz
overlays
vmlinuz
config.ini
rk3566-odroid-m1s.dtb
[/code]

2. copy kernel modules into arch rootfs (cp -r /usr/lib/modules/5.10.0-odroid-arm64 root/usr/lib/modules)
3. create boot.txt

[code]
# Bootscript using the new unified bootcmd handling
#
# Expects to be called with the following environment variables set:
#
# devtype e.g. mmc/scsi etc
# devnum The device number of the given type
# bootpart The partition containing the boot files
# (introduced in u-boot mainline 2016.01)
# prefix Prefix within the boot partiion to the boot files
# kernel_addr_r Address to load the kernel to
# fdt_addr_r Address to load the FDT to
# ramdisk_addr_r Address to load the initrd to.
#
# The uboot must support the booti and generic filesystem load commands.

if test -z "${variant}"; then
setenv variant m1
fi
setenv board odroid${variant}

setenv bootargs " ${bootargs} root=UUID=05d4c0a4-bacd-4821-bd86-726fa87978fc rootwait rw quiet"
setenv overlay_resize 8192

setenv bootlabel "Arch Linux Arm"

# Default TTY console
setenv bootargs "${bootargs} console=tty1 console=ttyS2,1500000"

# MISC
#
setenv bootargs "${bootargs} pci=nomsi"
setenv bootargs "${bootargs} fsck.mode=force fsck.repair=yes"

load ${devtype} ${devnum}:${partition} ${loadaddr} ${prefix}config.ini \
&& ini generic ${loadaddr}
if test -n "${overlay_profile}"; then
ini overlay_${overlay_profile} ${loadaddr}
fi

if test -n "${console}"; then
setenv bootargs "${bootargs} console=${console}"
fi

if test -n "${default_console}"; then
setenv bootargs "${bootargs} console=${default_console}"
fi

if test -z "${fdtfile}"; then
setenv fdtfile "rk3566-odroid-${variant}.dtb"
fi

if test -z "${distro_bootpart}"; then
setenv partition ${bootpart}
else
setenv partition ${distro_bootpart}
fi

load ${devtype} ${devnum}:${partition} ${fdt_addr_r} ${prefix}${fdtfile}
fdt addr ${fdt_addr_r}

if test "x{overlays}" != "x"; then
for overlay in ${overlays}; do
fdt resize ${overlay_resize}
load ${devtype} ${devnum}:${partition} ${loadaddr} ${prefix}overlays/${board}/${overlay}.dtbo \
&& fdt apply ${loadaddr}
done
fi

load ${devtype} ${devnum}:${partition} ${ramdisk_addr_r} ${prefix}vmlinuz \
&& unzip ${ramdisk_addr_r} ${kernel_addr_r} \
&& load ${devtype} ${devnum}:${partition} ${ramdisk_addr_r} ${prefix}initramfs-linux.img \
&& echo "Booting Arch Linux from ${devtype} ${devnum}:${partition}..." \
&& booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}
[/code]

4. create mkscr script and compile uboot script (./mkscr)

[code]
#!/bin/bash

if [[ ! -x /usr/bin/mkimage ]]; then
echo "mkimage not found. Please install uboot-tools:"
echo " pacman -S uboot-tools"
exit 1
fi

mkimage -A arm64 -O linux -T script -C none -n "U-Boot boot script" -d boot.txt boot.scr
[/code]

5. optional: enable additional dtb overlays in config.ini
6. boot into alarm

[code]
DDR V1.18 f366f69a7d typ 23/07/17-15:48:58
ln
LP4/4x derate en, other dram:1x trefi
ddrconfig:7
LPDDR4X, 324MHz
BW=32 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=8 Size=8192MB
tdqss: cs0 dqs0: 72ps, dqs1: -48ps, dqs2: -24ps, dqs3: -96ps,
tdqss: cs1 dqs0: 72ps, dqs1: -48ps, dqs2: -24ps, dqs3: -96ps,

change to: 324MHz
clk skew:0x60

change to: 528MHz
clk skew:0x58

change to: 780MHz
clk skew:0x58

change to: 1056MHz(final freq)
PHY drv:clk:36,ca:36,DQ:29,odt:60
vrefinner:16%, vrefout:22%
dram drv:40,odt:80
vref_ca:00000071
clk skew:0x2f
cs 0:
the read training result:
DQS0:0x3f, DQS1:0x3d, DQS2:0x42, DQS3:0x3b,
min : 0xd 0xd 0x10 0xd 0x1 0x4 0x7 0x5 , 0x5 0x4 0x1 0x1 0x9 0x9 0xb 0x7 ,
0x11 0x10 0xe 0xb 0x5 0x1 0x4 0x6 , 0xa 0x6 0x5 0x1 0xe 0xd 0xa 0xd ,
mid :0x2b 0x2b 0x2e 0x2b 0x1f 0x22 0x25 0x23 ,0x23 0x23 0x20 0x1f 0x27 0x28 0x29 0x26 ,
0x2e 0x2d 0x2b 0x29 0x21 0x1e 0x20 0x23 ,0x28 0x24 0x22 0x1e 0x2c 0x2b 0x29 0x2a ,
max :0x49 0x49 0x4d 0x49 0x3d 0x41 0x44 0x41 ,0x42 0x42 0x40 0x3d 0x46 0x47 0x48 0x45 ,
0x4c 0x4a 0x48 0x47 0x3e 0x3c 0x3d 0x41 ,0x47 0x42 0x40 0x3c 0x4a 0x49 0x48 0x48 ,
range:0x3c 0x3c 0x3d 0x3c 0x3c 0x3d 0x3d 0x3c ,0x3d 0x3e 0x3f 0x3c 0x3d 0x3e 0x3d 0x3e ,
0x3b 0x3a 0x3a 0x3c 0x39 0x3b 0x39 0x3b ,0x3d 0x3c 0x3b 0x3b 0x3c 0x3c 0x3e 0x3b ,
the write training result:
DQS0:0x38, DQS1:0x29, DQS2:0x2c, DQS3:0x23,
min :0x5e 0x63 0x64 0x62 0x56 0x57 0x5a 0x5c 0x5b ,0x4e 0x4d 0x4a 0x49 0x50 0x52 0x51 0x51 0x4e ,
0x53 0x53 0x4f 0x4e 0x48 0x47 0x47 0x4c 0x4c ,0x4d 0x4a 0x49 0x46 0x4e 0x4e 0x4d 0x50 0x4a ,
mid :0x78 0x7c 0x7d 0x7b 0x6f 0x71 0x74 0x74 0x74 ,0x68 0x67 0x61 0x61 0x69 0x6a 0x6a 0x6a 0x67 ,
0x6c 0x6c 0x68 0x67 0x60 0x5d 0x5f 0x64 0x65 ,0x66 0x62 0x60 0x5e 0x68 0x69 0x65 0x6a 0x63 ,
max :0x93 0x96 0x97 0x94 0x89 0x8b 0x8f 0x8d 0x8d ,0x82 0x81 0x79 0x7a 0x83 0x82 0x83 0x83 0x80 ,
0x86 0x86 0x82 0x81 0x79 0x74 0x78 0x7c 0x7e ,0x80 0x7a 0x78 0x77 0x83 0x84 0x7e 0x85 0x7c ,
range:0x35 0x33 0x33 0x32 0x33 0x34 0x35 0x31 0x32 ,0x34 0x34 0x2f 0x31 0x33 0x30 0x32 0x32 0x32 ,
0x33 0x33 0x33 0x33 0x31 0x2d 0x31 0x30 0x32 ,0x33 0x30 0x2f 0x31 0x35 0x36 0x31 0x35 0x32 ,
cs 1:
the read training result:
DQS0:0x3f, DQS1:0x3e, DQS2:0x42, DQS3:0x3b,
min : 0xc 0xd 0xf 0xd 0x1 0x4 0x7 0x5 , 0x5 0x4 0x2 0x0 0x9 0x9 0xb 0x7 ,
0x10 0x10 0xd 0xb 0x4 0x1 0x4 0x5 , 0x9 0x6 0x5 0x1 0xf 0xd 0xa 0xd ,
mid :0x29 0x2b 0x2e 0x2b 0x1f 0x22 0x25 0x23 ,0x23 0x22 0x20 0x1e 0x27 0x28 0x29 0x26 ,
0x2e 0x2d 0x2a 0x29 0x21 0x1f 0x21 0x23 ,0x27 0x23 0x22 0x1e 0x2c 0x2b 0x29 0x2a ,
max :0x47 0x49 0x4d 0x49 0x3e 0x41 0x44 0x41 ,0x42 0x41 0x3e 0x3d 0x46 0x47 0x48 0x45 ,
0x4c 0x4b 0x48 0x47 0x3f 0x3d 0x3e 0x41 ,0x46 0x41 0x40 0x3c 0x4a 0x49 0x48 0x48 ,
range:0x3b 0x3c 0x3e 0x3c 0x3d 0x3d 0x3d 0x3c ,0x3d 0x3d 0x3c 0x3d 0x3d 0x3e 0x3d 0x3e ,
0x3c 0x3b 0x3b 0x3c 0x3b 0x3c 0x3a 0x3c ,0x3d 0x3b 0x3b 0x3b 0x3b 0x3c 0x3e 0x3b ,
the write training result:
DQS0:0x38, DQS1:0x29, DQS2:0x2c, DQS3:0x23,
min :0x5e 0x62 0x64 0x61 0x55 0x57 0x5a 0x5b 0x5b ,0x4c 0x4a 0x47 0x46 0x4e 0x4e 0x4e 0x4f 0x4a ,
0x51 0x51 0x4d 0x4d 0x47 0x45 0x46 0x4b 0x4a ,0x4a 0x48 0x47 0x43 0x4d 0x4d 0x4b 0x4e 0x48 ,
mid :0x78 0x7c 0x7e 0x7a 0x6f 0x71 0x74 0x74 0x74 ,0x64 0x63 0x5f 0x5f 0x68 0x66 0x67 0x67 0x62 ,
0x6b 0x6b 0x67 0x67 0x5f 0x5c 0x5e 0x63 0x64 ,0x62 0x5f 0x5e 0x5b 0x66 0x67 0x63 0x68 0x60 ,
max :0x93 0x96 0x98 0x94 0x8a 0x8b 0x8f 0x8e 0x8e ,0x7c 0x7c 0x78 0x78 0x82 0x7e 0x80 0x80 0x7b ,
0x86 0x86 0x81 0x81 0x78 0x74 0x77 0x7b 0x7e ,0x7b 0x76 0x75 0x73 0x80 0x82 0x7b 0x82 0x79 ,
range:0x35 0x34 0x34 0x33 0x35 0x34 0x35 0x33 0x33 ,0x30 0x32 0x31 0x32 0x34 0x30 0x32 0x31 0x31 ,
0x35 0x35 0x34 0x34 0x31 0x2f 0x31 0x30 0x34 ,0x31 0x2e 0x2e 0x30 0x33 0x35 0x30 0x34 0x31 ,
CA Training result:
cs:0 min :0x58 0x35 0x50 0x28 0x4e 0x1f 0x4d ,0x54 0x26 0x4d 0x21 0x4d 0x1f 0x4e ,
cs:0 mid :0x83 0x86 0x79 0x79 0x78 0x75 0x78 ,0x7d 0x7c 0x77 0x76 0x76 0x74 0x78 ,
cs:0 max :0xae 0xd7 0xa3 0xcb 0xa2 0xcb 0xa3 ,0xa6 0xd3 0xa1 0xcb 0xa0 0xca 0xa2 ,
cs:0 range:0x56 0xa2 0x53 0xa3 0x54 0xac 0x56 ,0x52 0xad 0x54 0xaa 0x53 0xab 0x54 ,
cs:1 min :0x50 0x45 0x48 0x39 0x4a 0x37 0x49 ,0x4d 0x3f 0x48 0x38 0x49 0x37 0x49 ,
cs:1 mid :0x88 0x8a 0x81 0x7f 0x81 0x7e 0x78 ,0x86 0x85 0x7f 0x7e 0x80 0x7e 0x77 ,
cs:1 max :0xc0 0xd0 0xbb 0xc5 0xb8 0xc6 0xa7 ,0xbf 0xcb 0xb6 0xc5 0xb8 0xc5 0xa6 ,
cs:1 range:0x70 0x8b 0x73 0x8c 0x6e 0x8f 0x5e ,0x72 0x8c 0x6e 0x8d 0x6f 0x8e 0x5d ,
out
U-Boot SPL board init
U-Boot SPL 2017.09-g97ab962d1ed-230719 #tobetter (Oct 27 2023 - 14:54:41)
Trying to boot from MMC2
Card did not respond to voltage select!
mmc_init: -95, time 10
spl: mmc init failed with error: -95
Trying to boot from MMC1
spl: partition error
Trying fit image at 0x800 sector
## Verified-boot: 0
## Checking atf-1 0x00040000 ... sha256(0d5225a4ab...) + OK
## Checking uboot 0x00a00000 ... sha256(222747d079...) + OK
## Checking fdt 0x00b32360 ... sha256(11938f6df3...) + OK
## Checking atf-2 0xfdcc1000 ... sha256(3e94d16e6a...) + OK
## Checking atf-3 0x0006b000 ... sha256(fde0ef262b...) + OK
## Checking atf-4 0xfdcce000 ... sha256(c9eb312bf2...) + OK
## Checking atf-5 0xfdcd0000 ... sha256(befba422b8...) + OK
## Checking atf-6 0x00069000 ... sha256(6ede7a3b44...) + OK
## Checking optee 0x08400000 ... sha256(4fcbcd3870...) + OK
Jumping to U-Boot(0x00a00000) via ARM Trusted Firmware(0x00040000)
Total: 116.476/200.214 ms

INFO: Preloader serial: 2
NOTICE: BL31: v2.3():v2.3-607-gbf602aff1:cl
NOTICE: BL31: Built : 10:16:03, Jun 5 2023
INFO: GICv3 without legacy support detected.
INFO: ARM GICv3 driver initialized in EL3
INFO: pmu v1 is valid 220114
INFO: dfs DDR fsp_param[0].freq_mhz= 1056MHz
INFO: dfs DDR fsp_param[1].freq_mhz= 324MHz
INFO: dfs DDR fsp_param[2].freq_mhz= 528MHz
INFO: dfs DDR fsp_param[3].freq_mhz= 780MHz
INFO: Using opteed sec cpu_context!
INFO: boot cpu mask: 0
INFO: BL31: Initializing runtime services
INFO: BL31: Initializing BL32
I/TC:
I/TC: OP-TEE version: 3.13.0-723-gdcfdd61d0 #hisping.lin (gcc version 10.2.1 20201103 (GNU Toolchain for the A-profile Architecture 10.2-2020.11 (arm-10.16))) #2 Wed Jun 7 09:43:57 CST 2023 aarch64
I/TC: Primary CPU initializing
I/TC: Primary CPU switching to normal world boot
INFO: BL31: Preparing for EL3 exit to normal world
INFO: Entry point address = 0xa00000
INFO: SPSR = 0x3c9


U-Boot 2017.09-g97ab962d1ed-230719 #tobetter (Oct 27 2023 - 14:54:41 +0900)

Model: Hardkernel ODROID-M1S
MPIDR: 0x81000000
PreSerial: 2, raw, 0xfe660000
DRAM: 7.7 GiB
Sysmem: init
Relocation Offset: ecb2f000
Relocation fdt: eb1f9048 - eb1fece8
CR: M/C/I
dwmmc@fe2b0000: 1, dwmmc@fe2c0000: 2, sdhci@fe310000: 0
Card did not respond to voltage select!
mmc_init: -95, time 9
Bootdev(atags): mmc 0
MMC0: HS200, 200Mhz
PartType: DOS
** File not found ODROIDBIOS.BIN **
** File not found ODROIDBIOS.BIN **
** Invalid partition 3 **
DM: v1
** File not found dtb **
** File not found rockchip/rk3566-odroid-m1s.dtb **
161092 bytes read in 3 ms (51.2 MiB/s)
DTB(Distro): rk3566-odroid-m1s.dtb
No misc partition
boot mode: None
Error binding driver 'gpio_led': -22
Some drivers failed to bind
I2c3 speed: 100000Hz
PMIC: RK8090 (on=0x80, off=0x80)
vdd_logic init 900000 uV
vdd_gpu init 900000 uV
vdd_npu init 900000 uV
io-domain: OK
MMC: Could not find baseparameter partition
Rockchip UBOOT DRM driver version: v1.0.1
VOP have 1 active VP
vp0 have layer nr:6[0 2 4 1 3 5 ], primary plane: 4
vp1 have layer nr:0[], primary plane: 0
vp2 have layer nr:0[], primary plane: 0
hdmi@fe0a0000 disconnected
Model: Hardkernel ODROID-M1S
MPIDR: 0x81000000
41831 bytes read
hdmi@fe0a0000 disconnected
CLK: (sync kernel. arm: enter 816000 KHz, init 816000 KHz, kernel 0N/A)
apll 816000 KHz
dpll 528000 KHz
gpll 1188000 KHz
cpll 1000000 KHz
npll 1200000 KHz
vpll 24000 KHz
hpll 24000 KHz
ppll 200000 KHz
armclk 816000 KHz
aclk_bus 150000 KHz
pclk_bus 100000 KHz
aclk_top_high 500000 KHz
aclk_top_low 400000 KHz
hclk_top 150000 KHz
pclk_top 100000 KHz
aclk_perimid 300000 KHz
hclk_perimid 150000 KHz
pclk_pmu 100000 KHz
Net: No ethernet found.
Hit key to stop autoboot('CTRL+C'): 0
### CRAMFS LOAD ERROR<0> for boot.scr!
## Executing script at 00c00000
Wrong image format for "source" command
Card did not respond to voltage select!
mmc_init: -95, time 9
switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
2479 bytes read in 3 ms (806.6 KiB/s)
## Executing script at 00c00000
184 bytes read in 3 ms (59.6 KiB/s)
ini: Imported overlay_resize as 16384
ini: Imported overlay_profile as
ini: Imported overlays as i2c0 i2c1 spi0
161092 bytes read in 3 ms (51.2 MiB/s)
223 bytes read in 8 ms (26.4 KiB/s)
223 bytes read in 8 ms (26.4 KiB/s)
514 bytes read in 11 ms (44.9 KiB/s)
8027426 bytes read in 52 ms (147.2 MiB/s)
Uncompressed size: 24051720 = 0x16F0008
7902203 bytes read in 49 ms (153.8 MiB/s)
Booting Arch Linux from mmc 0:1...
Fdt Ramdisk skip relocation
No misc partition
## Flattened Device Tree blob at 0x08300000
Booting using the fdt blob at 0x08300000
reserving fdt memory region: addr=8300000 size=3e000
Using Device Tree in place at 0000000008300000, end 0000000008340fff
vp0, plane_mask:0x3f, primary-id:4, curser-id:-1
vp1, plane_mask:0x0, primary-id:0, curser-id:-1
vp2, plane_mask:0x0, primary-id:0, curser-id:-1
## reserved-memory:
drm-logo@00000000: addr=edfe9000 size=548000
ramoops@110000: addr=110000 size=f0000
Adding bank: 0x00200000 - 0x08400000 (size: 0x08200000)
Adding bank: 0x09400000 - 0xf0000000 (size: 0xe6c00000)
Adding bank: 0x100000000 - 0x200000000 (size: 0x100000000)
Total: 1137.869/1184.411 ms

Starting kernel ...

I/TC: Secondary CPU 1 initializing
I/TC: Secondary CPU 1 switching to normal world boot
I/TC: Secondary CPU 2 initializing
I/TC: Secondary CPU 2 switching to normal world boot
I/TC: Secondary CPU 3 initializing
I/TC: Secondary CPU 3 switching to normal world boot
[ 0.195374] fiq_debugger fiq_debugger.0: IRQ fiq not found
[ 0.195421] fiq_debugger fiq_debugger.0: IRQ wakeup not found
[ 0.195451] fiq_debugger_probe: could not install nmi irq handler
[ 1.790494] rk-pcie 3c0000000.pcie: IRQ msi not found
[ 1.790570] rk-pcie 3c0000000.pcie: Missing *config* reg space
[ 1.790816] rk-pcie 3c0000000.pcie: Missing *config* reg space
[ 1.790891] rk-pcie 3c0000000.pcie: invalid resource
[ 1.798502] mpp-iep2 fdef0000.iep: allocate roi buffer failed
[ 1.817107] arm-scmi firmware:scmi: Failed. SCMI protocol 22 not active.
[ 1.838283] dwhdmi-rockchip fe0a0000.hdmi: IRQ index 1 not found
[ 1.874894] rk_gmac-dwmac fe010000.ethernet: no regulator found
[ 2.242638] arm-scmi firmware:scmi: Failed. SCMI protocol 17 not active.
[ 2.246371] rksfc_base v1.1 2016-01-08
[ 2.357792] rk817-battery rk817-battery: Failed to find matching dt id
[ 2.358470] rk817-charger rk817-charger: Failed to find matching dt id
[ 2.401488] mpp_rkvenc fdf40000.rkvenc: Failed to get leakage
[ 2.402570] mpp_rkvenc fdf40000.rkvenc: failed to find power_model node
[ 2.402641] mpp_rkvenc fdf40000.rkvenc: failed to initialize power model
[ 2.402677] mpp_rkvenc fdf40000.rkvenc: failed to get dynamic-coefficient
[ 2.405856] mpp_rkvdec2 fdf80200.rkvdec: shared_niu_a is not found!
[ 2.405934] rkvdec2_init:1022: No niu aclk reset resource define
[ 2.405976] mpp_rkvdec2 fdf80200.rkvdec: shared_niu_h is not found!
[ 2.406007] rkvdec2_init:1025: No niu hclk reset resource define
[ 2.407763] mpp_rkvdec2 fdf80200.rkvdec: failed to find power_model node
[ 2.407809] mpp_rkvdec2 fdf80200.rkvdec: failed to initialize power model
[ 2.407850] mpp_rkvdec2 fdf80200.rkvdec: failed to get dynamic-coefficient
[ 4.676220] rk-pcie 3c0000000.pcie: PCIe Link Fail
[ 4.676278] rk-pcie 3c0000000.pcie: failed to initialize host

Arch Linux 5.10.0-odroid-arm64 (ttyFIQ0)

odroidm1s login:
[/code]

TODO: create aur packages with official kernel from Hardkernel and u-boot package with all scripts. It would be nice to be able to boot the mainline kernel from alarm, but this didn't work for some reason.

boot log using kernel linux-aarch64 (6.2.10-1):

[code]
....
vp0, plane_mask:0x3f, primary-id:4, curser-id:-1
vp1, plane_mask:0x0, primary-id:0, curser-id:-1
vp2, plane_mask:0x0, primary-id:0, curser-id:-1
## reserved-memory:
drm-logo@00000000: addr=edfe9000 size=548000
ramoops@110000: addr=110000 size=f0000
Adding bank: 0x00200000 - 0x08400000 (size: 0x08200000)
Adding bank: 0x09400000 - 0xf0000000 (size: 0xe6c00000)
Adding bank: 0x100000000 - 0x200000000 (size: 0x100000000)
Total: 996.187/1042.749 ms

Starting kernel ...

I/TC: Secondary CPU 1 initializing
I/TC: Secondary CPU 1 switching to normal world boot
I/TC: Secondary CPU 2 initializing
I/TC: Secondary CPU 2 switching to normal world boot
I/TC: Secondary CPU 3 initializing
I/TC: Secondary CPU 3 switching to normal world boot
[/code]
pohl7452
 
Posts: 7
Joined: Wed Apr 22, 2020 5:47 am


Return to ARMv8 Devices

Who is online

Users browsing this forum: No registered users and 7 guests