3
10
Fork 0
Megi's Linux kernel fork
Find a file
Ondrej Jirman 8f85d6fcf3 Merge remote-tracking branch 'stable/linux-6.11.y' into orange-pi-6.11
* stable/linux-6.11.y: (171 commits)
  Linux 6.11.10
  media: dvbdev: fix the logic when DVB_DYNAMIC_MINORS is not set
  net: sched: u32: Add test case for systematic hnode IDR leaks
  lib/buildid: Fix build ID parsing logic
  drm/xe: improve hibernation on igpu
  drm/xe: Restore system memory GGTT mappings
  mm: refactor arch_calc_vm_flag_bits() and arm64 MTE handling
  drm/amd/display: Fix failure to read vram info due to static BP_RESULT
  drm/amd/display: Handle dml allocation failure to avoid crash
  drm/amd/display: Require minimum VBlank size for stutter optimization
  drm/amd/display: Adjust VSDB parser for replay feature
  drm/amdgpu/mes12: correct kiq unmap latency
  drm/amdgpu: enable GTT fallback handling for dGPUs only
  drm/amd/pm: print pp_dpm_mclk in ascending order on SMU v14.0.0
  drm/amdgpu: Fix video caps for H264 and HEVC encode maximum size
  drm/amdgpu: fix check in gmc_v9_0_get_vm_pte()
  drm/amd: Fix initialization mistake for NBIO 7.7.0
  nouveau/dp: handle retries for AUX CH transfers with GSP.
  nouveau: handle EBUSY and EAGAIN for GSP aux errors.
  nouveau: fw: sync dma after setup is called.
  ...
2024-11-23 00:43:28 +01:00
arch Merge remote-tracking branch 'stable/linux-6.11.y' into orange-pi-6.11 2024-11-23 00:43:28 +01:00
block block: Fix elevator_get_default() checking for NULL q->tag_set 2024-11-17 15:09:51 +01:00
certs kbuild: use $(src) instead of $(srctree)/$(src) for source directory 2024-05-10 04:34:52 +09:00
crypto crypto: api - Fix liveliness check in crypto_alg_tested 2024-11-17 15:09:51 +01:00
Documentation Merge remote-tracking branch 'stable/linux-6.11.y' into orange-pi-6.11 2024-11-14 14:12:34 +01:00
drivers Merge remote-tracking branch 'stable/linux-6.11.y' into orange-pi-6.11 2024-11-23 00:43:28 +01:00
fs btrfs: fix incorrect comparison for delayed refs 2024-11-22 15:39:53 +01:00
include Merge remote-tracking branch 'stable/linux-6.11.y' into orange-pi-6.11 2024-11-23 00:43:28 +01:00
init Rust fixes for v6.11 2024-08-16 11:24:06 -07:00
io_uring io_uring/rw: fix missing NOWAIT check for O_DIRECT start write 2024-11-08 16:31:00 +01:00
ipc sysctl: treewide: constify the ctl_table argument of proc_handlers 2024-07-24 20:59:29 +02:00
kernel crash, powerpc: default to CRASH_DUMP=n on PPC_BOOK3S_32 2024-11-22 15:39:51 +01:00
lib lib/buildid: Fix build ID parsing logic 2024-11-22 15:39:56 +01:00
LICENSES LICENSES: Add the copyleft-next-0.3.1 license 2022-11-08 15:44:01 +01:00
mm mm: refactor arch_calc_vm_flag_bits() and arm64 MTE handling 2024-11-22 15:39:55 +01:00
net mptcp: pm: use _rcu variant under rcu_read_lock 2024-11-22 15:39:53 +01:00
rust rust: device: change the from_raw() function 2024-11-08 16:30:51 +01:00
samples samples: pktgen: correct dev to DEV 2024-11-22 15:39:49 +01:00
scripts kconfig: qconf: fix buffer overflow in debug links 2024-10-10 12:04:13 +02:00
security evm: stop avoidably reading i_writecount in evm_file_release 2024-11-22 15:39:51 +01:00
sound Merge remote-tracking branch 'stable/linux-6.11.y' into orange-pi-6.11 2024-11-23 00:43:28 +01:00
tools net: sched: u32: Add test case for systematic hnode IDR leaks 2024-11-22 15:39:56 +01:00
usr initramfs: shorten cmd_initfs in usr/Makefile 2024-07-16 01:07:52 +09:00
virt KVM: Use dedicated mutex to protect kvm_usage_count to avoid deadlock 2024-10-04 16:38:33 +02:00
.clang-format Docs: Move clang-format from process/ to dev-tools/ 2024-06-26 16:36:00 -06:00
.cocciconfig scripts: add Linux .cocciconfig for coccinelle 2016-07-22 12:13:39 +02:00
.editorconfig .editorconfig: remove trim_trailing_whitespace option 2024-06-13 16:47:52 +02:00
.get_maintainer.ignore Add Jeff Kirsher to .get_maintainer.ignore 2024-03-08 11:36:54 +00:00
.gitattributes .gitattributes: set diff driver for Rust source code files 2023-05-31 17:48:25 +02:00
.gitignore Remove *.orig pattern from .gitignore 2024-10-04 16:38:29 +02:00
.mailmap sound fixes for 6.11 2024-09-14 11:54:24 +02:00
.rustfmt.toml rust: add .rustfmt.toml 2022-09-28 09:02:20 +02:00
0001-sunxi-h3-Fix-PLL1-setup-to-never-use-dividers.patch Add README.md with information and u-boot patches 2024-09-15 17:36:12 +02:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS tracing: Update of MAINTAINERS and CREDITS file 2024-07-18 14:08:42 -07:00
Kbuild Kbuild updates for v6.1 2022-10-10 12:00:45 -07:00
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS MAINTAINERS: Add entry for Himax HM5065 2024-09-15 17:35:46 +02:00
Makefile Linux 6.11.10 2024-11-22 15:39:56 +01:00
README README: Fix spelling 2024-03-18 03:36:32 -06:00
README.md Add README.md with information and u-boot patches 2024-09-15 17:36:12 +02:00

Mainline linux kernel for Orange Pi PC/PC2/PC3/One, TBS A711, PinePhone (Pro), PocketBook Touch Lux 3

This kernel tree is meant for:

  • Orange Pi One
  • Orange Pi PC
  • Orange Pi PC 2
  • Orange Pi 3
  • PinePhone 1.0, 1.1 and 1.2(a/b)
  • TBS A711 Tablet
  • PocketBook Touch Lux 3
  • Pinebook Pro
  • Pinephone Pro

Features in addition to mainline:

  • [Orange Pi One/PC/PC2] More aggressive OPPs for CPU
  • [All] Mark one of DRM planes as a cursor plane, speeding up Xorg based desktop with modesetting driver
  • [Orange Pi One/PC/PC2] Configure on-board micro-switches to perform system power off function
  • [Orange Pi One/PC/PC2/3] HDMI audio
  • [Orange Pi 3] Ethernet
  • [TBS A711] HM5065 (back camera) / GC2145 (front camera)
  • [PinePhone] WiFi, Bluetooth, Audio, Modem power, HDMI out over USB-C, USB-C support, cameras, PMIC improvements, power management, fixes here and there
  • [PocketBook Touch Lux 3] Display and Touchscreen support
  • [Pinephone Pro] Everything

Pre-built u-boot and kernels are available at https://xff.cz/kernels/

You may need some firmware files for some part of the functionality. Those are available at: https://megous.com/git/linux-firmware

If you want to reproduce my pre-built kernels exactly, you'll need to uncomment CONFIG_EXTRA_FIRMWARE_DIR and CONFIG_EXTRA_FIRMWARE in the defconfigs, and point CONFIG_EXTRA_FIRMWARE_DIR to a directory on your computer where the clone of https://megous.com/git/linux-firmware resides.

You can also leave those two config options commented out, and copy the contents of https://megous.com/git/linux-firmware to /lib/firmware/ on the target device.

You can use this kernel to run a desktop environment on Orange Pi SBCs, Arch Linux on your Pinephone, or to have a completely opensource OS on a Pocketbook e-ink book reader.

Have fun!

Build instructions

These are rudimentary instructions and you need to understand what you're doing. These are just core steps required to build the ATF/u-boot/kernel. Downloading, verifying, renaming to correct directories is not described or mentioned. You should be able to infer missing necessary steps yourself for your particular needs.

Get necessary toolchains from:

Extract toolchains and prepare the environment:

CWD=`pwd`
OUT=$CWD/builds
SRC=$CWD/u-boot
export PATH="$PATH:$CWD/Toolchains/arm/bin:$CWD/Toolchains/aarch64/bin"

For Orange Pi PC2, Orange Pi 3 or PinePhone:

export CROSS_COMPILE=aarch64-linux-gnu-
export KBUILD_OUTPUT=$OUT/.tmp/uboot-pc2
rm -rf "$KBUILD_OUTPUT"
mkdir -p $KBUILD_OUTPUT $OUT/pc2

Get and build ATF from https://github.com/ARM-software/arm-trusted-firmware:

make -C "$CWD/arm-trusted-firmware" PLAT=sun50i_a64 DEBUG=1 bl31
cp "$CWD/arm-trusted-firmware/build/sun50i_a64/debug/bl31.bin" "$KBUILD_OUTPUT"

Use sun50i_a64 for Orange Pi PC2 or PinePhone and sun50i_h6 for Orange Pi 3.

Build u-boot from https://megous.com/git/u-boot/ (opi-v2020.04 branch) with appropriate defconfig (orangepi_one_defconfig, orangepi_pc2_defconfig, orangepi_pc_defconfig, orangepi_3_defconfig, tbs_a711_defconfig, pinephone_defconfig).

My u-boot branch already has all the necessary patches integrated and is configured for quick u-boot/kernel startup.

make -C u-boot orangepi_pc2_defconfig
make -C u-boot -j5

cp $KBUILD_OUTPUT/.config $OUT/pc2/uboot.config
cat $KBUILD_OUTPUT/{spl/sunxi-spl.bin,u-boot.itb} > $OUT/pc2/uboot.bin

Get kernel from this repository and checkout the latest orange-pi-5.18 branch.

Build the kernel for 64-bit boards:

export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-
export KBUILD_OUTPUT=$OUT/.tmp/linux-arm64
mkdir -p $KBUILD_OUTPUT $OUT/pc2

make -C linux orangepi_defconfig
# or make -C linux pocketbook_touch_lux_3_defconfig
# or make -C linux tbs_a711_defconfig
make -C linux -j5 clean
make -C linux -j5 Image dtbs

cp -f $KBUILD_OUTPUT/arch/arm64/boot/Image $OUT/pc2/
cp -f $KBUILD_OUTPUT/.config $OUT/pc2/linux.config
cp -f $KBUILD_OUTPUT/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dtb $OUT/pc2/board.dtb

Build the kernel for 32-bit boards:

export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-
export KBUILD_OUTPUT=$OUT/.tmp/linux-arm
mkdir -p $KBUILD_OUTPUT $OUT/pc

make orangepi_defconfig
# or make pinephone_defconfig
make -C linux orangepi_defconfig
make -C linux -j5 clean
make -C linux -j5 zImage dtbs

cp -f $KBUILD_OUTPUT/arch/arm/boot/zImage $OUT/pc/
cp -f $KBUILD_OUTPUT/.config $OUT/pc/linux.config
cp -f $KBUILD_OUTPUT/arch/arm/boot/dts/sun8i-h3-orangepi-pc.dtb $OUT/pc/board.dtb
# Or use sun8i-h3-orangepi-one.dtb for Orange Pi One

PinePhone

I don't run u-boot on PinePhone, so my pre-built kernel packages don't come with u-boot built for PinePhone.

Kernel lockup issues

If you're getting lockups on boot or later during thermal regulation, you're missing an u-boot patch.

This patch is necessary to run this kernel!

These lockups are caused by improper NKMP clock factors selection in u-boot for PLL_CPUX. (M divider should not be used. P divider should be used only for frequencies below 240MHz.)

This patch for u-boot fixes it:

0001-sunxi-h3-Fix-PLL1-setup-to-never-use-dividers.patch

Kernel side is already fixed in this kernel tree.