From 667832dd000453d222f650cbd01532fcc2367003 Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Mon, 13 Jul 2015 18:00:52 +0200 Subject: Add 0001-Tegra-updates.patch --- 0001-Tegra-updates.patch | 273 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 273 insertions(+) create mode 100644 0001-Tegra-updates.patch diff --git a/0001-Tegra-updates.patch b/0001-Tegra-updates.patch new file mode 100644 index 00000000..12325e44 --- /dev/null +++ b/0001-Tegra-updates.patch @@ -0,0 +1,273 @@ +From 6f77eca7f15affdcfbeece59e2f2886c2a8fc60f Mon Sep 17 00:00:00 2001 +From: Nicolas Chauvet +Date: Mon, 13 Jul 2015 17:58:33 +0200 +Subject: [PATCH] Tegra updates + +--- + .../bindings/video/backlight/pwm-backlight.txt | 1 + + arch/arm/boot/dts/tegra124-jetson-tk1.dts | 11 ++++++++++- + arch/arm/boot/dts/tegra124-venice2.dts | 11 ++++++++++- + arch/arm/boot/dts/tegra124.dtsi | 3 +++ + arch/arm/boot/dts/tegra20.dtsi | 5 +++++ + arch/arm/configs/tegra_defconfig | 3 +++ + arch/arm/include/asm/psci.h | 6 +++++- + arch/arm/mach-tegra/Kconfig | 1 + + arch/arm/mach-tegra/tegra.c | 4 +++- + drivers/gpu/vga/vgaarb.c | 7 +++++-- + drivers/soc/tegra/pmc.c | 4 ++-- + drivers/video/backlight/pwm_bl.c | 17 ++++++++++++++++- + include/linux/pwm_backlight.h | 2 ++ + 13 files changed, 66 insertions(+), 9 deletions(-) + +diff --git a/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt b/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt +index 764db86..65e001a 100644 +--- a/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt ++++ b/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt +@@ -17,6 +17,7 @@ Optional properties: + "pwms" property (see PWM binding[0]) + - enable-gpios: contains a single GPIO specifier for the GPIO which enables + and disables the backlight (see GPIO binding[1]) ++ - backlight-boot-off: keep the backlight disabled on boot + + [0]: Documentation/devicetree/bindings/pwm/pwm.txt + [1]: Documentation/devicetree/bindings/gpio/gpio.txt +diff --git a/arch/arm/boot/dts/tegra124-jetson-tk1.dts b/arch/arm/boot/dts/tegra124-jetson-tk1.dts +index bd43ed6..1c7e120 100644 +--- a/arch/arm/boot/dts/tegra124-jetson-tk1.dts ++++ b/arch/arm/boot/dts/tegra124-jetson-tk1.dts +@@ -53,6 +53,15 @@ + }; + }; + ++ gpu@0,57000000 { ++ status = "okay"; ++ /* ++ * Node left disabled on purpose - the bootloader will enable ++ * it after having set the VPR up ++ */ ++ vdd-supply = <&vdd_gpu>; ++ }; ++ + pinmux: pinmux@0,70000868 { + pinctrl-names = "boot"; + pinctrl-0 = <&state_boot>; +@@ -1514,7 +1523,7 @@ + regulator-always-on; + }; + +- sd6 { ++ vdd_gpu: sd6 { + regulator-name = "+VDD_GPU_AP"; + regulator-min-microvolt = <650000>; + regulator-max-microvolt = <1200000>; +diff --git a/arch/arm/boot/dts/tegra124-venice2.dts b/arch/arm/boot/dts/tegra124-venice2.dts +index 79e724b..29db7fc 100644 +--- a/arch/arm/boot/dts/tegra124-venice2.dts ++++ b/arch/arm/boot/dts/tegra124-venice2.dts +@@ -43,6 +43,15 @@ + }; + }; + ++ gpu@0,57000000 { ++ status = "okay"; ++ /* ++ * Node left disabled on purpose - the bootloader will enable ++ * it after having set the VPR up ++ */ ++ vdd-supply = <&vdd_gpu>; ++ }; ++ + pinmux: pinmux@0,70000868 { + pinctrl-names = "boot"; + pinctrl-0 = <&pinmux_boot>; +@@ -735,7 +744,7 @@ + regulator-always-on; + }; + +- sd6 { ++ vdd_gpu: sd6 { + regulator-name = "+VDD_GPU_AP"; + regulator-min-microvolt = <650000>; + regulator-max-microvolt = <1200000>; +diff --git a/arch/arm/boot/dts/tegra124.dtsi b/arch/arm/boot/dts/tegra124.dtsi +index 01a9f74..10ca11a 100644 +--- a/arch/arm/boot/dts/tegra124.dtsi ++++ b/arch/arm/boot/dts/tegra124.dtsi +@@ -188,6 +188,9 @@ + clock-names = "gpu", "pwr"; + resets = <&tegra_car 184>; + reset-names = "gpu"; ++ ++ iommus = <&mc TEGRA_SWGROUP_GPU>; ++ + status = "disabled"; + }; + +diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi +index f444b67..0af9a7e 100644 +--- a/arch/arm/boot/dts/tegra20.dtsi ++++ b/arch/arm/boot/dts/tegra20.dtsi +@@ -9,6 +9,11 @@ + compatible = "nvidia,tegra20"; + interrupt-parent = <&lic>; + ++ chosen { ++ /* tegra20 will requires at least 64M from CMA for graphics */ ++ bootargs = "cma=64M"; ++ }; ++ + host1x@50000000 { + compatible = "nvidia,tegra20-host1x", "simple-bus"; + reg = <0x50000000 0x00024000>; +diff --git a/arch/arm/configs/tegra_defconfig b/arch/arm/configs/tegra_defconfig +index cdf9abb..605677f 100644 +--- a/arch/arm/configs/tegra_defconfig ++++ b/arch/arm/configs/tegra_defconfig +@@ -302,3 +302,6 @@ CONFIG_EARLY_PRINTK=y + CONFIG_CRYPTO_TWOFISH=y + # CONFIG_CRYPTO_ANSI_CPRNG is not set + CONFIG_CRC_CCITT=y ++CONFIG_DRM_NOUVEAU=m ++CONFIG_NOUVEAU_DEBUG=5 ++CONFIG_NOUVEAU_DEBUG_DEFAULT=3 +diff --git a/arch/arm/include/asm/psci.h b/arch/arm/include/asm/psci.h +index c25ef3e..eef6a0a 100644 +--- a/arch/arm/include/asm/psci.h ++++ b/arch/arm/include/asm/psci.h +@@ -39,9 +39,13 @@ extern struct smp_operations psci_smp_ops; + + #ifdef CONFIG_ARM_PSCI + int psci_init(void); +-bool psci_smp_available(void); + #else + static inline int psci_init(void) { return 0; } ++#endif ++ ++#if defined(CONFIG_ARM_PSCI) && defined(CONFIG_SMP) ++bool psci_smp_available(void); ++#else + static inline bool psci_smp_available(void) { return false; } + #endif + +diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig +index 5d1a318..f93e4dc 100644 +--- a/arch/arm/mach-tegra/Kconfig ++++ b/arch/arm/mach-tegra/Kconfig +@@ -4,6 +4,7 @@ menuconfig ARCH_TEGRA + select ARCH_SUPPORTS_TRUSTED_FOUNDATIONS + select ARM_AMBA + select ARM_GIC ++ select ARM_PSCI + select CLKSRC_MMIO + select HAVE_ARM_SCU if SMP + select HAVE_ARM_TWD if SMP +diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c +index 2378fa56..d97c961 100644 +--- a/arch/arm/mach-tegra/tegra.c ++++ b/arch/arm/mach-tegra/tegra.c +@@ -44,6 +44,7 @@ + #include + #include + #include ++#include + + #include "board.h" + #include "common.h" +@@ -136,7 +137,8 @@ static void __init tegra_dt_init_late(void) + int i; + + tegra_init_suspend(); +- tegra_cpuidle_init(); ++ if (!psci_smp_available()) ++ tegra_cpuidle_init(); + + for (i = 0; i < ARRAY_SIZE(board_init_funcs); i++) { + if (of_machine_is_compatible(board_init_funcs[i].machine)) { +diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c +index 7bcbf86..3b1e65b 100644 +--- a/drivers/gpu/vga/vgaarb.c ++++ b/drivers/gpu/vga/vgaarb.c +@@ -1091,8 +1091,11 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf, + vgadev = vgadev_find(pdev); + pr_debug("vgaarb: vgadev %p\n", vgadev); + if (vgadev == NULL) { +- pr_err("vgaarb: this pci device is not a vga device\n"); +- pci_dev_put(pdev); ++ if (pdev) { ++ pr_err("vgaarb: this pci device is not a vga device\n"); ++ pci_dev_put(pdev); ++ } ++ + ret_val = -ENODEV; + goto done; + } +diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c +index 75d0457..fa7036c 100644 +--- a/drivers/soc/tegra/pmc.c ++++ b/drivers/soc/tegra/pmc.c +@@ -736,12 +736,12 @@ void tegra_pmc_init_tsense_reset(struct tegra_pmc *pmc) + u32 value, checksum; + + if (!pmc->soc->has_tsense_reset) +- goto out; ++ return; + + np = of_find_node_by_name(pmc->dev->of_node, "i2c-thermtrip"); + if (!np) { + dev_warn(dev, "i2c-thermtrip node not found, %s.\n", disabled); +- goto out; ++ return; + } + + if (of_property_read_u32(np, "nvidia,i2c-controller-id", &ctrl_id)) { +diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c +index eff379b..80cc87d 100644 +--- a/drivers/video/backlight/pwm_bl.c ++++ b/drivers/video/backlight/pwm_bl.c +@@ -175,6 +175,7 @@ static int pwm_backlight_parse_dt(struct device *dev, + } + + data->enable_gpio = -EINVAL; ++ + return 0; + } + +@@ -321,7 +322,21 @@ static int pwm_backlight_probe(struct platform_device *pdev) + } + + bl->props.brightness = data->dft_brightness; +- backlight_update_status(bl); ++ bl->props.power = FB_BLANK_UNBLANK; ++ ++ /* ++ * When platform data was associated with the device, assume that the ++ * device wasn't instantiated from device tree. In these legacy cases ++ * the backlight is usually a standalone object only controlled from ++ * userspace. It must therefore be enabled at probe time for backward ++ * compatibility. ++ * ++ * If the device was instantiated from the device tree, assume that a ++ * display driver will take control of the backlight and enable it at ++ * the right time. ++ */ ++ if (data != &defdata) ++ backlight_update_status(bl); + + platform_set_drvdata(pdev, bl); + return 0; +diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h +index efdd922..1fc1498 100644 +--- a/include/linux/pwm_backlight.h ++++ b/include/linux/pwm_backlight.h +@@ -15,6 +15,8 @@ struct platform_pwm_backlight_data { + unsigned int *levels; + /* TODO remove once all users are switched to gpiod_* API */ + int enable_gpio; ++ bool boot_off; ++ + int (*init)(struct device *dev); + int (*notify)(struct device *dev, int brightness); + void (*notify_after)(struct device *dev, int brightness); +-- +2.1.0 + -- cgit