Skip to content

Commit

Permalink
WIP: ARM: tegra: Add device-tree for EFI booting Surface RT
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Bambura <[email protected]>
Signed-off-by: Jonas Schwöbel <[email protected]>
  • Loading branch information
jenneron authored and digetx committed Feb 20, 2022
1 parent 00898c5 commit e839699
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/arm/boot/dts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1353,6 +1353,7 @@ dtb-$(CONFIG_ARCH_TEGRA_3x_SOC) += \
tegra30-colibri-eval-v3.dtb \
tegra30-lenovo-ideatab-a2109a.dtb \
tegra30-microsoft-surface-rt.dtb \
tegra30-microsoft-surface-rt-efi.dtb \
tegra30-ouya.dtb \
tegra30-pegatron-chagall.dtb
dtb-$(CONFIG_ARCH_TEGRA_114_SOC) += \
Expand Down
63 changes: 63 additions & 0 deletions arch/arm/boot/dts/tegra30-microsoft-surface-rt-efi.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// SPDX-License-Identifier: GPL-2.0-only

#include "tegra30-microsoft-surface-rt.dts"

/*
* Temporary Microsoft Surface RT device-tree for EFI booting.
* Replacing PMIC with fixed regulators.
*/

/ {
compatible = "microsoft,surface-rt-efi", "microsoft,surface-rt", "nvidia,tegra30";

/* L2 cache does not work yet */
/delete-node/ cache-controller@50043000;

pmc@7000e400 {
/* CPU Idle does not work yet, disabling LP2 */
/delete-property/ nvidia,suspend-mode;

/* Core regulator cannot work with UEFI, use fallback stub */
core-supply = <&vdd_pd_core_stub>;
};

ldo5_reg: tps65911-ldo5 {
compatible = "regulator-fixed";
regulator-name = "vddio_sdmmc";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
};

/* Core regulator cannot work with UEFI, delete it */
i2c@7000d000 {
/delete-node/ core-regulator@60;
};

/* DVFS cannot work with UEFI, delete it */
cpus {
cpu@0 {
/delete-property/ cpu-supply;
/delete-property/ operating-points-v2;
};

cpu@1 {
/delete-property/ cpu-supply;
/delete-property/ operating-points-v2;
};

cpu@2 {
/delete-property/ cpu-supply;
/delete-property/ operating-points-v2;
};

cpu@3 {
/delete-property/ cpu-supply;
/delete-property/ operating-points-v2;
};
};
};

&pmic {
/delete-node/ regulators;
};
12 changes: 12 additions & 0 deletions drivers/i2c/i2c-core-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,12 @@ static unsigned short i2c_encode_flags_to_addr(struct i2c_client *client)
* are purposely not enforced, except for the general call address. */
static int i2c_check_addr_validity(unsigned int addr, unsigned short flags)
{
// Fix for Surface RT tCover support.
// tCover uses address 0x00 which is reserved for general call
if (addr == 0x00 && of_machine_is_compatible("microsoft,surface-rt")) {
return 0;
}

if (flags & I2C_CLIENT_TEN) {
/* 10-bit address, all values are valid */
if (addr > 0x3ff)
Expand Down Expand Up @@ -755,6 +761,12 @@ int i2c_check_7bit_addr_validity_strict(unsigned short addr)
* 0x78-0x7b 10-bit slave addressing
* 0x7c-0x7f Reserved for future purposes
*/
// Fix for Surface RT tCover support.
// tCover uses address 0x00 which is reserved for general call
if (addr == 0x00 && of_machine_is_compatible("microsoft,surface-rt")) {
return 0;
}

if (addr < 0x08 || addr > 0x77)
return -EINVAL;
return 0;
Expand Down

0 comments on commit e839699

Please sign in to comment.