Since the beginning of July 2021 our changes to the linux kernel are upstreamed to grate-driver/linux. To be specific, we created a fork for pull-requests, but this repository may have not fully tested features.
This means you can either use grate-driver/linux, without the need of modifying the kernel source, or you can use mainline linux, with the need of applying patches.
git clone https://github.com/grate-driver/linux.git --depth=1 && cd linux to download the repository with a git history depth of 1 (to reduce the amount of data downloaded, full history is over 1 GB).
You should be able to use the latest versions without problems, the download link may need to be updated. (visit kernel.org)
tar -xf linux-5.12.3.tar.xz
The commands above download the kernel source into the linux-5.12.3 directory, relative from your current path.
./arch/arm/boot/dts, create a file with the name
tegra30-microsoft-surface-rt-efi.dts and paste the contents of the code block in the devicetree sub-section.
dtb-$(CONFIG_ARCH_TEGRA_3x_SOC) += in the Makefile (same directory), there you can see a few lines which begin with tegra30, add a line with the devicetree file name you created above, but instead of the extension .dts use .dtb. Be aware that you will need to add a backslash (\) at the end of the previous line. Here is a picture how it should look like:
Open up a terminal and cd into your linux-5.12.3 directory. Then download the patch from bellow and run
git apply 0001-Add-ACPI-Parking-Protocol-for-arm32-devices.patch
This should add ACPI Parking Protocol to your kernel and allows you to use SMP.
The patch doesn't follow kernel coding conventions. This will eventually be fixed.
This patch was created from commit c0a5652f from grate-driver/linux. The changes in the devicetree were removed. (Create with
git format-patch -1 c0a5652f) Run
git apply 0001-WIP-ARM-tegra-Add-Type-Touch-Power-Cover-support-for.patch to apply the patch.
This patch was created from commit e2a2772b from grate-driver/linux. (Create with
git format-patch -1 e2a2772b) Run
git apply 0001-i2c-GPIO-based-hotplug-gate.patch to apply the patch.
First run the command
make ARCH=arm tegra_defconfig
This will create a standard kernel config for tegra soc's.
Open the file
.config in the kernel source directory with your favorite text editor and paste the following at the end of the file
To build the kernel use the command
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j $(nproc)
It will use all of your available cores. This command can take a while depending on your computer's speed. (5+ minutes)
The output image is
The output device tree is