Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump rockchip (32 bit) edge kernel to 6.9 #6690

Merged
merged 3 commits into from
Jun 5, 2024

Conversation

paolosabatino
Copy link
Contributor

@paolosabatino paolosabatino commented Jun 2, 2024

Description

As per subject, bump rockchip 32 bit edge kernel to 6.9.
Patches have been left as is because all of them applied fine, except for the device tree overlay compilation and installation. The device tree things have changed in 6.9 and the patch does not apply anymore.

After some headeaches with the terrible makefiles, the second commit of this PR contains some hints on how I did the job and can serve as a icebreaker for other families perhaps.

In particular:

  • Some little accomodations in the overlay Makefile.
  • the kernel makefile already supports dtbo files, but it wants the sources with .dtso extension, so all the device trees in overlay directory must be renamed with .dtso extension. This also greatly simplifies the existing general-add-overlay-support-compilation patch
  • the kernel lacks support for .scr, but it is simple to add into scripts/Makefile.lib (see general-add-overlay-compilation-support.patch patch)
  • architectures that have the flattening device tree directory kernel config option enabled (like rockchip), really flattens everything. Changing a line in scripts/Makefile.dtbinst strips away the base vendor name (rockchip/ in this case) and keeps the subdirectories (perhaps this can be generalized to work with all families, but makefile are awkward and I could not find a simple way to strip just the first directory entry in the path)

With such changes, the dtb deb package contains this in the boot directory:

paolo@armbian-build:~/armbian-build/output/debs/dtbs$ find boot/ | sort
boot/
boot/dtb-6.9.3-edge-rockchip
boot/dtb-6.9.3-edge-rockchip/overlay
boot/dtb-6.9.3-edge-rockchip/overlay/README.rk322x-overlays
boot/dtb-6.9.3-edge-rockchip/overlay/README.rockchip-overlays
boot/dtb-6.9.3-edge-rockchip/overlay/rk322x-bt-8723cs.dtbo
boot/dtb-6.9.3-edge-rockchip/overlay/rk322x-cpu-hs-lv.dtbo
boot/dtb-6.9.3-edge-rockchip/overlay/rk322x-cpu-hs.dtbo
boot/dtb-6.9.3-edge-rockchip/overlay/rk322x-cpu-stability.dtbo

...cut...

boot/dtb-6.9.3-edge-rockchip/overlay/rk322x-fixup.scr

...cut...

boot/dtb-6.9.3-edge-rockchip/overlay/rockchip-ds1307.dtbo
boot/dtb-6.9.3-edge-rockchip/overlay/rockchip-fixup.scr
boot/dtb-6.9.3-edge-rockchip/overlay/rockchip-i2c1.dtbo
boot/dtb-6.9.3-edge-rockchip/overlay/rockchip-i2c4.dtbo

...cut...

boot/dtb-6.9.3-edge-rockchip/rk3188-radxarock.dtb
boot/dtb-6.9.3-edge-rockchip/rk3228-evb.dtb
boot/dtb-6.9.3-edge-rockchip/rk3229-evb.dtb
boot/dtb-6.9.3-edge-rockchip/rk3229-xms6.dtb
boot/dtb-6.9.3-edge-rockchip/rk322x-box.dtb
boot/dtb-6.9.3-edge-rockchip/rk3288-evb-act8846.dtb

...cut..

boot/dtb-6.9.3-edge-rockchip/rk3288-rock-pi-n8.dtb
boot/dtb-6.9.3-edge-rockchip/rk3288-rock2-square.dtb
boot/dtb-6.9.3-edge-rockchip/rk3288-tinker-s.dtb
boot/dtb-6.9.3-edge-rockchip/rk3288-tinker.dtb
boot/dtb-6.9.3-edge-rockchip/rk3288-veyron-brain.dtb
boot/dtb-6.9.3-edge-rockchip/rk3288-veyron-fievel.dtb

...cut...

which seems quite ok (.dtbo, .src and readme files are all in overlay directory, .dtb files are outside) compared to a live installation I have around.

Jira reference number AR-2347

How Has This Been Tested?

  • Compilation works without errors
  • Manually checked dtb file
  • Upgrade of a living system - this is crucial, since the previous overlay compilation involved other steps that have been removed and I don't know if they are still necessary (perhaps they aren't, since dtc matured in the years).

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings

@paolosabatino paolosabatino added the Work in progress Unfinished / work in progress label Jun 2, 2024
@paolosabatino paolosabatino requested a review from a team June 2, 2024 16:39
@github-actions github-actions bot added size/medium PR with more then 50 and less then 250 lines Hardware Hardware related like kernel, U-Boot, ... labels Jun 2, 2024
 * rename .dts sources in overlay directory as *.dtso
 * change "target +=" line in "dts-y +=" in overlay Makefile
 * remove "always +=" line in overlay Makefile
 * add .scr compilation support in kernel scripts/Makefile.lib
 * patch kernel scripts/Makefile.dtbinst to avoid flattening overlay
   directory

for the last two points, see
general-add-overlay-compilation-support.patch
@paolosabatino
Copy link
Contributor Author

Force pushed to include -@ flag to dtc, so all device trees (both base .dtb and overlay .dtbo) include symbols now. U-boot does not complain and is happy now.

@paolosabatino paolosabatino removed the Work in progress Unfinished / work in progress label Jun 2, 2024
@igorpecovnik igorpecovnik merged commit d3ff611 into armbian:main Jun 5, 2024
7 checks passed
@paolosabatino paolosabatino deleted the rockchip-kernel-6.9 branch June 7, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hardware Hardware related like kernel, U-Boot, ... size/medium PR with more then 50 and less then 250 lines
Development

Successfully merging this pull request may close these issues.

2 participants