Scroll down for README.md file with more information
C Assembly C++ Objective-C Makefile Perl Other
Switch branches/tags
Clone or download
Pull request Compare This branch is 1300 commits ahead, 24769 commits behind torvalds:master.
Ondrej Jirman
Ondrej Jirman Merge remote-tracking branch 'stable/linux-4.17.y' into orange-pi-4.17
* stable/linux-4.17.y:
  Linux 4.17.14
  jfs: Fix inconsistency between memory allocation and ea_buf->max_size
  xfs: validate cached inodes are free when allocated
  xfs: don't call xfs_da_shrink_inode with NULL bp
  Partially revert "block: fail op_is_write() requests to read-only partitions"
  Btrfs: fix file data corruption after cloning a range and fsync
  i2c: imx: Fix reinit_completion() use
  ring_buffer: tracing: Inherit the tracing setting to next ring buffer
  netlink: Don't shift on 64 for ngroups
  nohz: Fix missing tick reprogram when interrupting an inline softirq
  nohz: Fix local_timer_softirq_pending()
  perf/x86/intel/uncore: Fix hardcoded index of Broadwell extra PCI devices
  genirq: Make force irq threading setup more robust
  jfs: Fix usercopy whitelist for inline inode data
  scsi: qla2xxx: Return error when TMF returns
  scsi: qla2xxx: Fix ISP recovery on unload
  scsi: qla2xxx: Fix driver unload by shutting down chip
  scsi: qla2xxx: Fix NPIV deletion by calling wait_for_sess_deletion
  scsi: qla2xxx: Fix unintialized List head crash
Latest commit 0272f8a Aug 9, 2018
Permalink
Failed to load latest commit information.
Documentation Merge remote-tracking branch 'stable/linux-4.17.y' into orange-pi-4.17 Aug 4, 2018
LICENSES LICENSES: Add MPL-1.1 license Jan 6, 2018
arch Merge remote-tracking branch 'stable/linux-4.17.y' into orange-pi-4.17 Aug 9, 2018
block Partially revert "block: fail op_is_write() requests to read-only par… Aug 9, 2018
certs certs/blacklist_nohashes.c: fix const confusion in certs blacklist Feb 21, 2018
crypto crypto: authenc - don't leak pointers to authenc keys Aug 3, 2018
drivers Merge remote-tracking branch 'stable/linux-4.17.y' into orange-pi-4.17 Aug 9, 2018
firmware kbuild: remove all dummy assignments to obj- Nov 18, 2017
fs jfs: Fix inconsistency between memory allocation and ea_buf->max_size Aug 9, 2018
include Merge remote-tracking branch 'stable/linux-4.17.y' into orange-pi-4.17 Aug 9, 2018
init init/main.c: include <linux/mem_encrypt.h> May 26, 2018
ipc ipc/shm.c add ->pagesize function to shm_vm_ops Aug 6, 2018
kernel ring_buffer: tracing: Inherit the tracing setting to next ring buffer Aug 9, 2018
lib dma-direct: try reallocation with GFP_DMA32 if possible Aug 3, 2018
mm ipc/shm.c add ->pagesize function to shm_vm_ops Aug 6, 2018
net Merge remote-tracking branch 'stable/linux-4.17.y' into orange-pi-4.17 Aug 9, 2018
samples x86/cpufeature: Guard asm_volatile_goto usage for BPF compilation May 13, 2018
scripts checkpatch: fix macro argument precedence test May 26, 2018
security ima: based on policy verify firmware signatures (pre-allocated buffer) Aug 3, 2018
sound Merge remote-tracking branch 'stable/linux-4.17.y' into orange-pi-4.17 Aug 4, 2018
tools selftests/filesystems: devpts_pts included wrong header Aug 3, 2018
usr kbuild: rename built-in.o to built-in.a Mar 25, 2018
virt KVM: irqfd: fix race between EPOLLHUP and irq_bypass_register_consumer Jul 25, 2018
.clang-format clang-format: add configuration file Apr 11, 2018
.cocciconfig scripts: add Linux .cocciconfig for coccinelle Jul 22, 2016
.get_maintainer.ignore Add hch to .get_maintainer.ignore Aug 21, 2015
.gitattributes .gitattributes: set git diff driver for C source code files Oct 8, 2016
.gitignore Merge tag 'kbuild-v4.17-2' of git://git.kernel.org/pub/scm/linux/kern… Apr 16, 2018
.mailmap Merge tag 'for-linus-unmerged' of git://git.kernel.org/pub/scm/linux/… Apr 7, 2018
0001-sunxi-h3-Fix-PLL1-setup-to-never-use-dividers.patch Add README.md with information, sample config nad u-boot patches May 14, 2018
COPYING COPYING: use the new text with points to the license files Mar 23, 2018
CREDITS MAINTAINERS/CREDITS: Drop METAG ARCHITECTURE Mar 5, 2018
Kbuild Merge tag 'kbuild-v4.15' of git://git.kernel.org/pub/scm/linux/kernel… Nov 18, 2017
Kconfig License cleanup: add SPDX GPL-2.0 license identifier to files with no… Nov 2, 2017
MAINTAINERS Merge remote-tracking branch 'origin/master' into orange-pi-4.17 Jun 3, 2018
Makefile Linux 4.17.14 Aug 9, 2018
README Docs: Added a pointer to the formatted docs to README Mar 21, 2018
README.md Add README.md with information, sample config nad u-boot patches May 14, 2018
linux-4.17-32 Add README.md with information, sample config nad u-boot patches May 14, 2018
linux-4.17-64 Add README.md with information, sample config nad u-boot patches May 14, 2018

README.md

Mainline linux kernel for Orange Pi PC/PC2/One

This kernel tree is meant for:

  • Orange Pi PC
  • Orange Pi PC 2
  • Orange Pi One
  • TBS A711 Tablet

You can easily port it to other similar H3/H5 based SBCs by modifying the appropriate board DTS files. Usually these boards are either like Orange Pi One, or like Orange Pi PC, or they don't have CPUX voltage regulation at all, so it should be simple.

Features in addition to mainline:

  • CPU frequency and voltage scaling (cpufreq)
  • Thermal regulation (if CPU heats above certain temperature, it will try to cool itself down by reducing CPU frequency)
  • HDMI audio support (from Jernej Skrabec)
  • Configure on-board micro-switches to perform system power off function
  • Wireguard (https://www.wireguard.com/)

You can use this kernel to run a desktop environment on Orange Pi SBCs.

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:

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/apritzel/arm-trusted-firmware/tree/allwinner: (allwinner branch)

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

Build u-boot from https://github.com/megous/u-boot/commits/orange-pi with appropriate defconfig (orangepi_one_defconfig, orangepi_pc2_defconfig, orangepi_pc_defconfig). This 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-4.17 branch.

Configure kernel by using the prepared configuration for H5 based Orange Pi boards:

cp linux-4.17-64 .config

Build the kernel:

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 -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

Configure kernel by using the prepared configuration for H3 based Orange Pi boards:

cp linux-4.17-32 .config

Build the kernel:

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

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

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.

Sample configuration

  • linux-4.17-32 file contains working configuration of the kernel for Orange Pi PC/One
  • linux-4.17-64 file contains working configuration of the kernel for Orange Pi PC 2