Go to file
sakaki 5749c12eea
Merge pull request #1 from clinew/master
Update for GCC 8
2019-05-02 23:29:28 +01:00
0002-drm-panel-simple-Add-Innolux-N133HSE-panel-support.patch Import base v4.4 patchset from novena-linux 2016-09-19 02:10:37 +01:00
0003-novena-drm-imx-HACK-Manually-specify-CRTCs.patch Fix context 2016-09-19 02:39:49 +01:00
0004-pwm-imx-Support-very-long-period-lengths.patch Import base v4.4 patchset from novena-linux 2016-09-19 02:10:37 +01:00
0005-drivers-mfd-senoko-Add-Senoko-device.patch Import base v4.4 patchset from novena-linux 2016-09-19 02:10:37 +01:00
0006-drivers-power-Add-senoko-power-supply.patch Import base v4.4 patchset from novena-linux 2016-09-19 02:10:37 +01:00
0007-drivers-input-keyboard-Add-Senoko-power-button.patch Import base v4.4 patchset from novena-linux 2016-09-19 02:10:37 +01:00
0008-arm-dts-imx6qdl-Add-cell-count-to-thermal-node.patch Import base v4.4 patchset from novena-linux 2016-09-19 02:10:37 +01:00
0009-arm-dts-Add-cpufreq-cooling-support-to-imx6q.patch Remove hunk already in 4.7.2 2016-09-19 02:54:17 +01:00
0010-drm-bridge-it6251-add-new-lvds-to-dp-converter.patch Fix context 2016-09-19 02:55:42 +01:00
0011-fs-pstore-add-eeprom-based-pstore-backend.patch Import base v4.4 patchset from novena-linux 2016-09-19 02:10:37 +01:00
0012-drm-imx-imx-ldb-add-support-for-drm-bridges.patch Fix eDP adaptor boot problem 2016-10-13 00:59:03 +01:00
0013-i2c-imx-Work-better-with-a-bus-under-contention.patch Fix context, minor fix to replaced content 2016-09-19 10:00:42 +01:00
0014-cpufreq-imx-register-cpufreq-cooling-device.patch Import base v4.4 patchset from novena-linux 2016-09-19 02:10:37 +01:00
0015-imx-thermal-remove-cooling-device.patch Import base v4.4 patchset from novena-linux 2016-09-19 02:10:37 +01:00
0016-ARM-dts-imx6q-add-novena-devicetree-file.patch File imx6q-novena.dts in 4.7.2; just update it 2016-09-19 10:06:58 +01:00
0017-pci-fix-suspend-on-i.MX6.patch Import base v4.4 patchset from novena-linux 2016-09-19 02:10:37 +01:00
0019-ARM-novena_defconfig-add-default-config-for-novena.patch Patchlevel 1 -> 0, for Gentoo's unipatch 2016-09-19 10:14:42 +01:00
0020-package-kernel-Add-our-own-package-script.patch Patchlevel 1 -> 0, for Gentoo's unipatch 2016-09-19 10:24:57 +01:00
0021-deb-pkg-Add-support-for-KBUILD_DTB.patch Import base v4.4 patchset from novena-linux 2016-09-19 02:10:37 +01:00
0022-scripts-Add-custom-destdir-parameter.patch Import base v4.4 patchset from novena-linux 2016-09-19 02:10:37 +01:00
0025-ASoC-es8328-Set-clock-rates-when-setting-DAI-format.patch Upstream changed a lot; simplify clock setup code 2016-09-19 10:34:50 +01:00
0027-PCI-imx6-add-power-regulator-support.patch Fix context 2016-09-19 10:44:40 +01:00
0028-spi-spidev-add-novena-to-compatible-list.patch Import base v4.4 patchset from novena-linux 2016-09-19 02:10:37 +01:00
0033-scripts-builddeb-Allow-specifying-a-package-name.patch Import base v4.4 patchset from novena-linux 2016-09-19 02:10:37 +01:00
0034-scripts-Add-custom-destdir-parameter.patch Import base v4.4 patchset from novena-linux 2016-09-19 02:10:37 +01:00
0035-deb-pkg-Add-support-for-KBUILD_DTB.patch Import base v4.4 patchset from novena-linux 2016-09-19 02:10:37 +01:00
0036-package-kernel-update-to-v4.4-novena-r2.patch Migrate version to 4.7.2 2016-09-19 11:03:30 +01:00
0037-package-kernel-don-t-allow-building-when-tree-is-dir.patch Migrate version to 4.7.2 2016-09-19 11:04:13 +01:00
0041-gpu-imx-attempt-to-fix-ldb-stability.patch Import base v4.4 patchset from novena-linux 2016-09-19 02:10:37 +01:00
0042-of-thermal-support-adding-a-hwmon-device.patch Import base v4.4 patchset from novena-linux 2016-09-19 02:10:37 +01:00
0043-soc-jack-register-the-jack-as-a-kctl-device.patch Import base v4.4 patchset from novena-linux 2016-09-19 02:10:37 +01:00
0047-DRM-imx-HACK-enable-debug-mode.patch Import base v4.4 patchset from novena-linux 2016-09-19 02:10:37 +01:00
0049-package-kernel-make-defconfig-on-build.patch Fix context 2016-09-19 11:22:42 +01:00
0052-DRM-bridge-it6251-always-recalibrate-on-boot.patch Import base v4.4 patchset from novena-linux 2016-09-19 02:10:37 +01:00
0053-DRM-imx-ldb-always-restart-ldb-device.patch Fix context 2016-09-19 11:30:12 +01:00
0054-package-kernel-don-t-die-when-branch-doesn-t-exist.patch Import base v4.4 patchset from novena-linux 2016-09-19 02:10:37 +01:00
0057-senoko-repeatedly-try-to-powerdown.patch Import base v4.4 patchset from novena-linux 2016-09-19 02:10:37 +01:00
0058-ARM-imx6-Mask-mmdc_ch1-handshake-for-periph2_sel-and.patch Import base v4.4 patchset from novena-linux 2016-09-19 02:10:37 +01:00
0059-serial-imx-hack-to-fix-suspend-resume.patch Import base v4.4 patchset from novena-linux 2016-09-19 02:10:37 +01:00
0060-ARM-imx6-Fix-procedure-to-switch-the-parent-of-LDB_D.patch Import base v4.4 patchset from novena-linux 2016-09-19 02:10:37 +01:00
0063-rtc-Add-an-option-to-invalidate-dates-in-2038.patch Import base v4.4 patchset from novena-linux 2016-09-19 02:10:37 +01:00
0064-novena_defconfig-enable-CONFIG_RTC_INVALID_2038.patch Import base v4.4 patchset from novena-linux 2016-09-19 02:10:37 +01:00
1001-novena_defconfig-enable-DRM_DW_HDMI_AHB_AUDIO.patch Turn on CONFIG_DRM_DW_HDMI_AHB_AUDIO 2016-09-19 11:39:18 +01:00
1002-arm-uaccess-remove-put_user_code-duplication.patch Update for GCC 8 2019-04-29 21:39:58 -07:00
1003-Disable-PIC-when-compiling-kernel-modules.patch Update for GCC 8 2019-04-29 21:39:58 -07:00
1101-novena_defconfig-enable-minimal-GRKERNSEC.patch Fix for Mozilla software with hardened kernel 2016-09-19 11:40:48 +01:00
LICENSE Initial commit 2016-09-19 02:02:21 +01:00
README.md Fix formatting 2017-09-08 19:29:51 +01:00
apply-patches.sh Add helper script 2016-09-20 14:02:57 +01:00

README.md

novena-kernel-patches

Patchset for the Linux kernel (v4.7.2) on the Novena SBC, adapted from xobs' novena-linux.

Description

Kousagi Novena

This project contains a set of patches for the 4.7.2 Linux kernel, enabling it to be used with the Novena single-board computer. The patches were derived from xobs' novena-linux project, which (at the time of writing, commit 49d5f10) contains a patchset rebased against Linux 4.4 (commit 400e186).

The git commit list of Novena-specific edits in xobs' novena-linux since the 4.4 rebase may be seen here. I began by exporting the (non-merge) commits as a set of patch files, thus:

~ $ git clone https://www.github.com/xobs/novena-linux
~ $ cd novena-linux
novena-linux $ mkdir /tmp/patches
novena-linux $ git format-patch -o /tmp/patches 400e186...49d5f10

I then reworked the patches to get them to apply against a Linux 4.7.2 baseline (rather than 4.4). Most of the patches needed no modification, or only small context changes. Patches that cancelled each other out (such as these) were jointly dropped.

A few edits were less trivial / obvious:

  • The etnaviv DRM driver code has been upstreamed (from 4.5), so I have removed (see here and here) its corresponding driver patch entirely.
  • The file arch/arm/boot/dts/imx6q-novena.dts has been upstreamed in 4.7.2, but patch 0016 was modified to bring the content in line with that in 4.4-novena-r9 (as that was larger). This also obviated some of the other dts-related patches (since all changes are now made via a single patch).
  • Where patches created new files (and modified no pre-existing files), they were shifted from patchlevel 1 to 0 (for example, here); Gentoo's unipatch fails with them otherwise.
  • The es8328 (audio codec) code has changed significantly from 4.4 to 4.7.2; I have tried to finesse the 'no MCLK set up' issue with a simple intercept of the es8328_hw_params function (edit here). Seems to work...
  • I have left the various Debian-related changes in place. Not needed for Gentoo, but they don't hurt either.
  • I have added two additional small patches, to address significant issues:
    • Patch 1001 turns on CONFIG_DRM_DW_HDMI_AHB_AUDIO by default in novena_defconfig. Without it, it is not possible to play audio on HDMI monitors, on 4.7.2.
    • Patch 1101 turns on CONFIG_GRKERNSEC_OLD_ARM_USERLAND; this is necessary (for hardened kernels with the Grsecurity patchset only) to avoid segfaults when running Mozilla software like Firefox.

A full list of my patch modifications may be viewed here.

Please note that this patchset is provided without warranty. Use at your own risk.

Incidentally, I have chosen to use a patchlist format (rather than another rebase) because:
* the set of Novena-specific edits to the kernel codebase seems quite stable now; and
* I wanted a format that could easily be used by Gentoo kernel-2 ebuilds, and also by non-Gentoo users.

Installation

You can apply these patches to a vanilla 4.7.2 kernel (and quite possibly, to later kernels, with no or only slight modification); it is not necessary to be running Gentoo. However, if you are using Gentoo on your Novena, I have provided two utility ebuilds to fetch and patch the kernel sources (one mirroring sys-kernel/gentoo-sources, and the other sys-kernel/hardened-sources).

Please choose the appropriate set of installation instructions from the below.

Option 1: Non-Gentoo Users

Fetch the patches and 4.7.2 kernel source, then patch your kernel and build as usual. The only slight trickiness comes from the fact that some of the patches are at patchlevel 0, and some at patchlevel 1 (due to quirks in Gentoo's unipatch, as described above), but I have supplied a small script to handle that.

Here's a simple example workflow (you can of course download the kernel via git and other tools, but we'll just use a tarball here):

~ $ git clone https://github.com/sakaki-/novena-kernel-patches
~ $ wget -c https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.7.2.tar.xz
( you can also download and check the signature file; search online for details )
~ $ tar -xjf linux-4.7.2.tar.xz
~ $ cd linux-4.7.2
linux-4.7.2 $ ../novena-kernel-patches/apply-patches.sh
( assuming that went OK, then proceed )
linux-4.7.2 $ make novena_defconfig
linux-4.7.2 $ make -j4 zImage modules dtbs
( this will take some time! )
linux-4.7.2 $ sudo make modules_install
( assuming your /boot is mounted, do: )
linux-4.7.2 $ cd /boot
boot $ sudo mv zImage{,.bak}
boot $ sudo mv novena.dtb{,.bak}
boot $ sudo cp "${HOME}/linux-4.7.2/arch/arm/boot/zImage" .
boot $ sudo cp "${HOME}/linux-4.7.2/arch/arm/boot/dts/imx6q-novena.dtb" novena.dtb
boot $ sync

Then simply reboot to start using your new kernel!

Option 2: Gentoo Users

This patchset is most easily installed via one of the Gentoo ebuilds that use it, for which please see my novena-overlay project.

I have provided two ebuilds. The first, sys-kernel/novena-sources mirrors sys-kernel/gentoo-sources; the second, sys-kernel/novena_hardened-sources mirrors sys-kernel/hardened-sources (and supports the deblob USE flag, allowing you to build a libre kernel; under which everything - with the exception of bluetooth - still works, amazingly ^-^).

Assuming you have my overlay installed (if not, instructions for installing it may be found here), you can simply do:

~ # emerge -v ~sys-kernel/novena-sources-4.7.2
~ # eselect kernel list
( displays a numbered list of available kernels )
~ # eselect kernel set <n>
( substitute the linux-4.7.2-novena kernel's index from the list for <n>; e.g., "eselect kernel set 1" )
~ # cd /usr/src/linux
linux # make novena_defconfig
linux # make -j4 zImage modules dtbs
( this will take some time! if you have distcc installed, use pump make, and a higher -j value )
linux # make modules_install
( assuming your /boot is mounted, do: )
linux # cd /boot
boot # mv zImage{,.bak}
boot # mv novena.dtb{,.bak}
boot # cp "/usr/src/linux/arch/arm/boot/zImage" .
boot # cp "/usr/src/linux/arch/arm/boot/dts/imx6q-novena.dtb" novena.dtb
boot # sync

Then reboot to start using your new kernel!

Feedback Welcome!

If you have any problems, questions or comments regarding this project, feel free to drop me a line! (sakaki@deciban.com)