Rebuild Kernel for Rock Pi S0

I am running rock-s0_debian_bookworm_cli_b6.img from the eMMC.

I have rebuilt the kernel as per instructions for the s0 with the addition that I have modified the kennel config to enable USB HIDRAW.

So I now have the two files:

linux-headers-6.1.68-20-stable_6.1.68-20_arm64.deb
linux-image-6.1.68-20-stable_6.1.68-20_arm64.deb

But after following the install instructions using dpkg the S0 fails to boot.

Is there any aditional instructions that would help me sucessfully install the new kernel?

Thanks

If you build these two kernel deb successfully by bsp tool, then you the step is right. Can you please send the boot log here? And

boot log follows.

I built the kernel with bsp using wsl2 + Ubuntu 22.

There is no further output on the console after ‘Starting Kernel …’

Boot Log Follows:
[ 452.186648] reboot: Restarting system
INFO: PSCI Power Domain Map:
INFO: Domain Node : Level 2, parent_node -1, State ON (0x0)
INFO: Domain Node : Level 1, parent_node 0, State ON (0x0)
INFO: Domain Node : Level 0, parent_node 0, State ON (0x0)
INFO: Domain Node : Level 0, parent_node 0, State ON (0x0)
INFO: CPU Node : MPID 0x0, parent_node 1, State ON (0x0)
INFO: CPU Node : MPID 0x1, parent_node 1, State ON (0x0)
INFO: CPU Node : MPID 0x2, parent_node 1, State ON (0x0)
INFO: CPU Node : MPID 0x3, parent_node 1, State ON (0x0)
DDR V2.07 6ede97a868 wesley.yao 22/11/29-19:27:02
08
REG2C: 0x00000034, 0x00000034
In
589MHz
DDR3
Col=10 Bank=3 Row=15 Size=512MB
OUT: sdram_init finish.
Boot1 Release Time: Mar 24 2022 08:28:57, version: 1.36
ROM VER:0x56323030, 19
chip_id:330800,0
ChipType = 0x13, 514
DPLL = 1300 MHz
…nandc_flash_init enter…
No.1 FLASH ID:ff ff ff ff ff ff
DPLL = 1300 MHz
sfc nor id: ff ff ff
DPLL = 1300 MHz
sfc_nand id: ff ff ff
NeedKHz=200KHz,clock=12000KHz
NeedKHz=200KHz,clock=12000KHz
NeedKHz=200KHz,clock=12000KHz
mmc2:cmd8,20
mmc2:cmd5,20
mmc2:cmd55,20
DPLL = 1300 MHz
NeedKHz=18000KHz,clock=650000KHz
DPLL = 1300 MHz
NeedKHz=48000KHz,clock=650000KHz
mmc2:cmd19,100
SdmmcInit=2 0
BootCapSize=2000
UserCapSize=7456MB
FwPartOffset=2000 , 2000
SdmmcInit=0 NOT PRESENT
StorageInit ok = 13634
SecureMode = 0
Secure read PBA: 0x4
Secure read PBA: 0x404
Secure read PBA: 0x804
Secure read PBA: 0xc04
Secure read PBA: 0x1004
SecureInit ret = 0, SecureMode = 0
atags_set_bootdev: ret:(0)
GPT part: 0, name: config, start:0x8000, size:0x8000
GPT part: 1, name: boot, start:0x10000, size:0x96000
GPT part: 2, name: rootfs, start:0xa6000, size:0xde9fdf
no find partition:uboot.
LoadTrust Addr:0x4000
No find bl30.bin
No find bl32.bin
Load uboot, ReadLba = 2000
Load OK, addr=0x600000, size=0xa54f8
RunBL31 0x40000 @ 49342 us
INFO: Preloader serial: 0
NOTICE: BL31: v1.3(release):0252d5c8f
NOTICE: BL31: Built : 07:51:11, Sep 28 2022
INFO: Lastlog: last=0x100000, realtime=0x102000, size=0x2000
INFO: ARM GICv2 driver initialized
INFO: Using opteed sec cpu_context!
INFO: boot cpu mask: 1
INFO: plat_rockchip_pmu_init: pd status 0xe b
INFO: BL31: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initialization. SMC`s destined for OPTEE will return SMC_UNK
ERROR: Error initializing runtime service opteed_fast
INFO: BL31: Preparing for EL3 exit to normal world
INFO: Entry point address = 0x600000
INFO: SPSR = 0x3c9

U-Boot latest-2023.10-8-eed05a18-geed05a18 (Jan 10 2024 - 03:39:03 +0000)

Model: Radxa ROCK S0
DRAM: 512 MiB (effective 510 MiB)
Core: 279 devices, 24 uclasses, devicetree: separate
MMC: mmc@ff480000: 1, mmc@ff490000: 0
Loading Environment from nowhere… OK
rockchip_dnl_key_pressed read board id failed
Net: eth0: ethernet@ff4e0000
starting USB…
No working controllers found
Unknown command ‘pci’ - try ‘help’
Hit Ctrl+C key in 0 seconds to stop autoboot…
Card did not respond to voltage select! : -110
** Booting bootflow ‘mmc@ff490000.bootdev.part_3’ with extlinux
U-Boot menu
1: Debian GNU/Linux 12 (bookworm) 6.1.68-20-stable
2: Debian GNU/Linux 12 (bookworm) 6.1.68-20-stable (rescue target)
3: Debian GNU/Linux 12 (bookworm) 6.1.68-1-stable
4: Debian GNU/Linux 12 (bookworm) 6.1.68-1-stable (rescue target)
Enter choice: 1: Debian GNU/Linux 12 (bookworm) 6.1.68-20-stable
Retrieving file: /boot/vmlinuz-6.1.68-20-stable
Retrieving file: /boot/initrd.img-6.1.68-20-stable
append: root=UUID=07e09376-a70a-4161-8ba0-0b5dc372a857 console=ttyS0,1500000n8 quiet splash loglevel=4 rw earlycon consoleblank=0 console=tty1 coherent_pool=2M irqchip.gicv3_pseudo_nmi=0 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1
Moving Image from 0x2080000 to 0x2200000, end=3790000

Flattened Device Tree blob at 1df211f0

Booting using the fdt blob at 0x1df211f0
Working FDT set to 1df211f0
Loading Ramdisk to 1d33e000, end 1df1b277 … OK
Loading Device Tree to 000000001d32f000, end 000000001d33db97 … OK
Working FDT set to 1d32f000

Starting kernel …

Is there any other output from the serial port after “Starting kernel ”?

and after then, what’s the behavior of the led on the board?

LED stays steady ON

I’ll try to reproduced it.

I think the bsp build process might be producing bad output for me.

If I build with this command: …/bsp linux stable -r 20

The linux-image-6.1.68-20-stable_6.1.68-20_arm64.deb package increases in size by 10Mbyte (compared to my original package produced with HIDRAW kernel option enabled)

Also the larger linux-image package will not install on the S0.

dpkg fails with lots of Out of Memory errors after “Updating overlays for 6.1.68-20-stable …”

Is there a known-good linux-image-6.1.68-20-stable_6.1.68-20_arm64.deb package that I can download and try?