Download mainline Linux

You should be able to use the latest versions without problems. You can get it on Github: git clone --depth=1 or use .tar files from

Applying patches

grate-driver/linux has these patches already included.

Adding a devicetree

Go to ./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.
Search for 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:
Picture shows the wrong file name

Apply patch for ACPI Parking Protocol

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.

Apply patch for tCover

This patch was created from commit c0a5652f from grate-driver/linux. The changes in the devicetree were removed. (Created with git format-patch -1 c0a5652f) Rungit apply 0001-WIP-ARM-tegra-Add-Type-Touch-Power-Cover-support-for.patch to apply the patch.

Apply patch for I2C GPIO hotplug for tCover

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.