Hi all,
After troubleshooting about 6h I found out this option is make the Kernel unbootable.
Compiling Kernel 6.1.73 from BPI-SINOVOIP GitHub - BPI-SINOVOIP/BPI-R4-bsp-6.1 was able to boot my board. But trying the same procedure with 6.9.0 frank-w or jcdutton kernels, Linux is stuck even to printout early messages.
Taking the config from 6.1.73 and applied to 6.9.0 I was able to boot 6.9.0 Kernel.
Then I created under Kernel 6.9.0 a new configuration file using mt7988a_bpi-r4_defconfig
with command make ARCH=arm64 O=build-mt7988-6.9.0 mt7988a_bpi-r4_defconfig
.
Then, under 6.9.0 directory, I used in parallel in 2 consoles:
make ARCH=arm64 O=build-mt7988-6.1.73
make ARCH=arm64 O=build-mt7988-6.9.0
Then, going each page in each configuration, I’ve tried to match options in build-mt7988-6.1.73
with the ones from build-mt7988-6.9.0
.
Compiling the build-mt7988-6.1.73
multiple times until I set CONFIG_RELOCATABLE
in build-mt7988-6.1.73
.
Soon as this option was activated, the kernel fails to boot anymore.
When I deactivate the option, kernel boots.
I disabled also in build-mt7988-6.9.0
and after I build it the default config mt7988a_bpi-r4_defconfig
booted the kernel.
This is the option which is by default enabled in ARM64:
CONFIG_RELOCATABLE=y
From arch/arm64/Kconfig
config RELOCATABLE
bool "Build a relocatable kernel image" if EXPERT
select ARCH_HAS_RELR
default y
help
This builds the kernel as a Position Independent Executable (PIE),
which retains all relocation metadata required to relocate the
kernel binary at runtime to a different virtual address than the
address it was linked at.
Since AArch64 uses the RELA relocation format, this requires a
relocation pass at runtime even if the kernel is loaded at the
same address it was linked at.
For example config file attached config-6.9.0-bpi-r4-nok
was created with ./bash.sh importconfig
from frank-w kernel, then compiled and tried to run:
MT7988> setenv consoleargs "earlycon=uart8250,mmio32,0x11000000 console=ttyS0,115200n1 earlyprintk debug=7 loglevel=8 pci=pcie_bus_perf consolebl
ank=0"
MT7988> setenv rootfs "root=/dev/mmcblk0p6 rootfstype=ext4 rootwait"
MT7988> setenv bootargs $consoleargs $rootfs
MT7988>
MT7988> # Keep 32MB space between Kernel and FTD.
MT7988> setenv dtaddr 0x47000000
MT7988> setenv kaddr 0x48000000
MT7988>
MT7988> bootp ${kaddr} 10.42.0.1:Linux-6.9.0-frank-w.itb; bootm ${kaddr}
BOOTP broadcast 1
DHCP client bound to address 10.42.0.145 (3 ms)
Using ethernet@15100000 device
TFTP from server 10.42.0.1; our IP address is 10.42.0.145
Filename 'Linux-6.9.0-frank-w.itb'.
Load address: 0x48000000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
######
17.8 MiB/s
done
Bytes transferred = 8669140 (8447d4 hex)
## Loading kernel from FIT Image at 48000000 ...
Using 'conf-sd' configuration
Trying 'kernel-1' kernel subimage
Description: EasyOS Linux Kernel 6.9.0 BPi-R4 (2024-07-15 11:15:14)
Type: Kernel Image
Compression: gzip compressed
Data Start: 0x48000100
Data Size: 8623954 Bytes = 8.2 MiB
Architecture: AArch64
OS: Linux
Load Address: 0x44000000
Entry Point: 0x44000000
Hash algo: sha1
Hash value: d9c96f2db39af94f8e55a920c74a2bb5838638b1
Verifying Hash Integrity ... sha1+ OK
## Loading fdt from FIT Image at 48000000 ...
Using 'conf-sd' configuration
Trying 'fdt-base' fdt subimage
Description: BPi-R4 base FDT blob
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x4883994c
Data Size: 36871 Bytes = 36 KiB
Architecture: AArch64
Load Address: 0x47000000
Hash algo: sha1
Hash value: 691df0eaac37a425055fbdddc6dbd7f40e683040
Verifying Hash Integrity ... sha1+ OK
Loading fdt from 0x4883994c to 0x47000000
## Loading fdt from FIT Image at 48000000 ...
Trying 'fdt-ov-sd' fdt subimage
Description: BPi-R4 SD MMC FDT overlay blob
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x48842a30
Data Size: 1482 Bytes = 1.4 KiB
Architecture: Unknown Architecture
Hash algo: sha1
Hash value: 4ddb0442509f1e0e66f70270ad0aad5b57894599
Verifying Hash Integrity ... sha1+ OK
Booting using the fdt blob at 0x47000000
Working FDT set to 47000000
Uncompressing Kernel Image to 44000000
Loading Device Tree to 00000000ff7eb000, end 00000000ff7f72b3 ... OK
Working FDT set to ff7eb000
Starting kernel ...
Fails to boot. It gets stuck at Starting kernel ...
.
In second file config-6.9.0-bpi-r4-ok
I disabled CONFIG_RELOCATABLE
in the same config, nothing else I changed, and is booting:
MT7988> setenv consoleargs "earlycon=uart8250,mmio32,0x11000000 console=ttyS0,115200n1 earlyprintk debug=7 loglevel=8 pci=pcie_bus_perf consolebl
ank=0"
MT7988> setenv rootfs "root=/dev/mmcblk0p6 rootfstype=ext4 rootwait"
MT7988> setenv bootargs $consoleargs $rootfs
MT7988>
MT7988> # Keep 32MB space between Kernel and FTD.
MT7988> setenv dtaddr 0x47000000
MT7988> setenv kaddr 0x48000000
MT7988>
MT7988> bootp ${kaddr} 10.42.0.1:Linux-6.9.0-frank-w.itb; bootm ${kaddr}
BOOTP broadcast 1
DHCP client bound to address 10.42.0.145 (3 ms)
Using ethernet@15100000 device
TFTP from server 10.42.0.1; our IP address is 10.42.0.145
Filename 'Linux-6.9.0-frank-w.itb'.
Load address: 0x48000000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#######################
18.3 MiB/s
done
Bytes transferred = 8918780 (8816fc hex)
## Loading kernel from FIT Image at 48000000 ...
Using 'conf-sd' configuration
Trying 'kernel-1' kernel subimage
Description: EasyOS Linux Kernel 6.9.0 BPi-R4 (2024-07-15 11:15:14)
Type: Kernel Image
Compression: gzip compressed
Data Start: 0x48000100
Data Size: 8873593 Bytes = 8.5 MiB
Architecture: AArch64
OS: Linux
Load Address: 0x44000000
Entry Point: 0x44000000
Hash algo: sha1
Hash value: ef4d4e0a895ae66371eb528a2f13aea2e0591592
Verifying Hash Integrity ... sha1+ OK
## Loading fdt from FIT Image at 48000000 ...
Using 'conf-sd' configuration
Trying 'fdt-base' fdt subimage
Description: BPi-R4 base FDT blob
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x48876874
Data Size: 36871 Bytes = 36 KiB
Architecture: AArch64
Load Address: 0x47000000
Hash algo: sha1
Hash value: 691df0eaac37a425055fbdddc6dbd7f40e683040
Verifying Hash Integrity ... sha1+ OK
Loading fdt from 0x48876874 to 0x47000000
## Loading fdt from FIT Image at 48000000 ...
Trying 'fdt-ov-sd' fdt subimage
Description: BPi-R4 SD MMC FDT overlay blob
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x4887f958
Data Size: 1482 Bytes = 1.4 KiB
Architecture: Unknown Architecture
Hash algo: sha1
Hash value: 4ddb0442509f1e0e66f70270ad0aad5b57894599
Verifying Hash Integrity ... sha1+ OK
Booting using the fdt blob at 0x47000000
Working FDT set to 47000000
Uncompressing Kernel Image to 44000000
Loading Device Tree to 00000000ff7eb000, end 00000000ff7f72b3 ... OK
Working FDT set to ff7eb000
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x411fd090]
[ 0.000000] Linux version 6.9.0-bpi-r4+ (adrian@Rzyen5900X) (aarch64-linux-gnu-gcc (Debian 13.2.0-12) 13.2.0, GNU ld (GNU Binutils for Debian)
2.42.50.20240710) #3 SMP Mon Jul 15 11:42:04 CEST 2024
[ 0.000000] Machine model: Banana Pi BPI-R4
[ 0.000000] earlycon: uart8250 at MMIO32 0x0000000011000000 (options '')
[ 0.000000] printk: legacy bootconsole [uart8250] enabled
[ 0.000000] efi: UEFI not found.
[ 0.000000] OF: reserved mem: 0x0000000042ff0000..0x0000000042ffffff (64 KiB) map non-reusable ramoops@42ff0000
[ 0.000000] OF: reserved mem: 0x0000000043000000..0x000000004304ffff (320 KiB) nomap non-reusable secmon@43000000
[ 0.000000] Zone ranges:
[ 0.000000] DMA [mem 0x0000000040000000-0x00000000ffffffff]
[ 0.000000] DMA32 empty
[ 0.000000] Normal [mem 0x0000000100000000-0x000000013fffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000040000000-0x0000000042ffffff]
[ 0.000000] node 0: [mem 0x0000000043000000-0x000000004304ffff]
[ 0.000000] node 0: [mem 0x0000000043050000-0x000000013fffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x000000013fffffff]
Any thoughts why this option is breaking the kernel to boot?
config-6.9.0-bpi-r4-nok (169.6 KB) config-6.9.0-bpi-r4-ok (169.6 KB)