From 7e1784651b057136847259358a3383c148d6f374 Mon Sep 17 00:00:00 2001 From: Marcel Ziswiler Date: Wed, 28 Sep 2016 11:24:05 +0200 Subject: tegra: usb gadget: fix ci udc operation if not hostpc capable The Tegra 2 aka T20 is not host PC capable. Therefore gate the define CONFIG_CI_UDC_HAS_HOSTPC in tegra-common-usb-gadget.h in case of CONFIG_TEGRA20. Signed-off-by: Marcel Ziswiler Acked-by: Stephen Warren Signed-off-by: Tom Warren diff --git a/include/configs/tegra-common-usb-gadget.h b/include/configs/tegra-common-usb-gadget.h index 00f854e..58a5a30 100644 --- a/include/configs/tegra-common-usb-gadget.h +++ b/include/configs/tegra-common-usb-gadget.h @@ -10,7 +10,9 @@ #ifndef CONFIG_SPL_BUILD /* USB gadget mode support*/ +#ifndef CONFIG_TEGRA20 #define CONFIG_CI_UDC_HAS_HOSTPC +#endif /* USB mass storage protocol */ #define CONFIG_USB_FUNCTION_MASS_STORAGE /* DFU protocol */ -- cgit v0.10.2 From 28c694c86f954c563a000c279151a84b9510989c Mon Sep 17 00:00:00 2001 From: Marcel Ziswiler Date: Wed, 28 Sep 2016 11:24:06 +0200 Subject: simple panel: fix spelling of debug message Fix spelling of debug message from cnnot to cannot. Signed-off-by: Marcel Ziswiler Acked-by: Anatolij Gustschin Signed-off-by: Tom Warren diff --git a/drivers/video/simple_panel.c b/drivers/video/simple_panel.c index b2fe345..baa95f6 100644 --- a/drivers/video/simple_panel.c +++ b/drivers/video/simple_panel.c @@ -42,7 +42,7 @@ static int simple_panel_ofdata_to_platdata(struct udevice *dev) ret = uclass_get_device_by_phandle(UCLASS_REGULATOR, dev, "power-supply", &priv->reg); if (ret) { - debug("%s: Warning: cnnot get power supply: ret=%d\n", + debug("%s: Warning: cannot get power supply: ret=%d\n", __func__, ret); if (ret != -ENOENT) return ret; -- cgit v0.10.2 From dc06f63f2ac566746dd6aae4aeb76bed40928ed4 Mon Sep 17 00:00:00 2001 From: Marcel Ziswiler Date: Wed, 28 Sep 2016 11:24:07 +0200 Subject: regulator: fixed: honour optionality of enable gpio According to the binding documentation the fixed regulator enable GPIO is optional. However so far registration thereof failed if no enable GPIO was specified. Fix this by making it entirely optional whether an enable GPIO is used. Signed-off-by: Marcel Ziswiler Acked-by: Stephen Warren Signed-off-by: Tom Warren diff --git a/drivers/power/regulator/fixed.c b/drivers/power/regulator/fixed.c index 37b8400..62dc47f 100644 --- a/drivers/power/regulator/fixed.c +++ b/drivers/power/regulator/fixed.c @@ -37,11 +37,15 @@ static int fixed_regulator_ofdata_to_platdata(struct udevice *dev) /* Set type to fixed */ uc_pdata->type = REGULATOR_TYPE_FIXED; - /* Get fixed regulator gpio desc */ + /* Get fixed regulator optional enable GPIO desc */ gpio = &dev_pdata->gpio; ret = gpio_request_by_name(dev, "gpio", 0, gpio, GPIOD_IS_OUT); - if (ret) - debug("Fixed regulator gpio - not found! Error: %d", ret); + if (ret) { + debug("Fixed regulator optional enable GPIO - not found! Error: %d\n", + ret); + if (ret != -ENOENT) + return ret; + } /* Get optional ramp up delay */ dev_pdata->startup_delay_us = fdtdec_get_uint(gd->fdt_blob, @@ -87,8 +91,9 @@ static bool fixed_regulator_get_enable(struct udevice *dev) { struct fixed_regulator_platdata *dev_pdata = dev_get_platdata(dev); + /* Enable GPIO is optional */ if (!dev_pdata->gpio.dev) - return false; + return true; return dm_gpio_get_value(&dev_pdata->gpio); } @@ -98,8 +103,12 @@ static int fixed_regulator_set_enable(struct udevice *dev, bool enable) struct fixed_regulator_platdata *dev_pdata = dev_get_platdata(dev); int ret; - if (!dev_pdata->gpio.dev) - return -ENOSYS; + /* Enable GPIO is optional */ + if (!dev_pdata->gpio.dev) { + if (!enable) + return -ENOSYS; + return 0; + } ret = dm_gpio_set_value(&dev_pdata->gpio, enable); if (ret) { -- cgit v0.10.2 From 28f224a52fee79ce83013707632dda62bf061d9b Mon Sep 17 00:00:00 2001 From: Marcel Ziswiler Date: Wed, 28 Sep 2016 11:24:08 +0200 Subject: colibri_t20: fix display configuration Without this patch the following error will be shown: stdio_add_devices: Video device failed (ret=-22) As commit ec5507707a1d1e84056a6c864338f95f6118d3ca (video: tegra: Move to using simple-panel and pwm-backlight) states the Colibri T20 needs updating too which this patch finally attempts doing. Signed-off-by: Marcel Ziswiler Acked-by: Stephen Warren Signed-off-by: Tom Warren diff --git a/arch/arm/dts/tegra20-colibri.dts b/arch/arm/dts/tegra20-colibri.dts index 777f63e..c198eef 100644 --- a/arch/arm/dts/tegra20-colibri.dts +++ b/arch/arm/dts/tegra20-colibri.dts @@ -21,12 +21,24 @@ }; host1x@50000000 { - status = "okay"; dc@54200000 { - status = "okay"; rgb { status = "okay"; nvidia,panel = <&lcd_panel>; + display-timings { + timing@0 { + /* VESA VGA */ + clock-frequency = <25175000>; + hactive = <640>; + vactive = <480>; + hback-porch = <48>; + hfront-porch = <16>; + hsync-len = <96>; + vback-porch = <31>; + vfront-porch = <11>; + vsync-len = <2>; + }; + }; }; }; }; @@ -61,6 +73,10 @@ }; }; + pwm@7000a000 { + status = "okay"; + }; + /* * GEN1_I2C: I2C_SDA/SCL on SODIMM pin 194/196 (e.g. RTC on carrier * board) @@ -92,6 +108,18 @@ cd-gpios = <&gpio TEGRA_GPIO(C, 7) GPIO_ACTIVE_LOW>; }; + backlight: backlight { + compatible = "pwm-backlight"; + + brightness-levels = <255 128 64 32 16 8 4 0>; + default-brightness-level = <6>; + /* BL_ON */ + enable-gpios = <&gpio TEGRA_GPIO(T, 4) GPIO_ACTIVE_HIGH>; + power-supply = <®_3v3>; + /* PWM */ + pwms = <&pwm 0 5000000>; + }; + clocks { compatible = "simple-bus"; #address-cells = <1>; @@ -105,25 +133,28 @@ }; }; - pwm: pwm@7000a000 { - status = "okay"; + lcd_panel: panel { + /* + * edt,et057090dhu: EDT 5.7" LCD TFT + * edt,et070080dh6: EDT 7.0" LCD TFT + */ + compatible = "edt,et057090dhu", "simple-panel"; + + backlight = <&backlight>; }; - lcd_panel: panel { - clock = <25175000>; - xres = <640>; - yres = <480>; - left-margin = <48>; /* horizontal back porch */ - right-margin = <16>; /* horizontal front porch */ - hsync-len = <96>; - lower-margin = <11>; /* vertical front porch */ - upper-margin = <31>; /* vertical back porch */ - vsync-len = <2>; - hsync-active-high; - vsync-active-high; - nvidia,bits-per-pixel = <16>; - nvidia,pwm = <&pwm 0 0>; - nvidia,backlight-enable-gpios = <&gpio TEGRA_GPIO(T, 4) GPIO_ACTIVE_HIGH>; - nvidia,panel-timings = <0 0 0 0>; + regulators { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <0>; + + reg_3v3: regulator@0 { + compatible = "regulator-fixed"; + reg = <0>; + regulator-name = "+V3.3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; }; }; -- cgit v0.10.2 From d5a24d8b53d350364bd429b7104ec369b817e4b8 Mon Sep 17 00:00:00 2001 From: Marcel Ziswiler Date: Wed, 28 Sep 2016 11:24:09 +0200 Subject: colibri_t20: fix usb operation and controller order Without this patch the following error will be shown: Colibri T20 # usb start starting USB... No controllers found This patch fixes USB operation and also the controller order as the CI UDC driver may only be instantiated on the first aka OTG port. Signed-off-by: Marcel Ziswiler Acked-by: Stephen Warren Signed-off-by: Tom Warren diff --git a/arch/arm/dts/tegra20-colibri.dts b/arch/arm/dts/tegra20-colibri.dts index c198eef..89adfb6 100644 --- a/arch/arm/dts/tegra20-colibri.dts +++ b/arch/arm/dts/tegra20-colibri.dts @@ -14,10 +14,10 @@ i2c0 = "/i2c@7000d000"; i2c1 = "/i2c@7000c000"; i2c2 = "/i2c@7000c400"; - usb0 = "/usb@c5008000"; - usb1 = "/usb@c5000000"; - usb2 = "/usb@c5004000"; mmc0 = "/sdhci@c8000600"; + usb0 = "/usb@c5000000"; + usb1 = "/usb@c5004000"; /* on-module only, for ASIX */ + usb2 = "/usb@c5008000"; }; host1x@50000000 { @@ -43,25 +43,6 @@ }; }; - usb@c5000000 { - statuc = "okay"; - dr_mode = "otg"; - }; - - usb@c5004000 { - statuc = "okay"; - /* VBUS_LAN */ - nvidia,phy-reset-gpio = <&gpio TEGRA_GPIO(V, 1) - GPIO_ACTIVE_LOW>; - nvidia,vbus-gpio = <&gpio TEGRA_GPIO(BB, 1) GPIO_ACTIVE_HIGH>; - }; - - usb@c5008000 { - statuc = "okay"; - /* USBH_PEN */ - nvidia,vbus-gpio = <&gpio TEGRA_GPIO(W, 2) GPIO_ACTIVE_LOW>; - }; - nand-controller@70008000 { nvidia,wp-gpios = <&gpio TEGRA_GPIO(S, 0) GPIO_ACTIVE_HIGH>; nvidia,width = <8>; @@ -102,6 +83,27 @@ clock-frequency = <100000>; }; + /* EHCI instance 0: USB1_DP/N -> USBC_P/N */ + usb@c5000000 { + status = "okay"; + dr_mode = "otg"; + }; + + /* EHCI instance 1: ULPI -> USB3340 -> AX88772B */ + usb@c5004000 { + status = "okay"; + /* VBUS_LAN */ + nvidia,phy-reset-gpio = <&gpio TEGRA_GPIO(V, 1) GPIO_ACTIVE_HIGH>; + nvidia,vbus-gpio = <&gpio TEGRA_GPIO(BB, 1) GPIO_ACTIVE_HIGH>; + }; + + /* EHCI instance 2: USB3_DP/N -> USBH_P/N */ + usb@c5008000 { + status = "okay"; + /* USBH_PEN */ + nvidia,vbus-gpio = <&gpio TEGRA_GPIO(W, 2) GPIO_ACTIVE_LOW>; + }; + sdhci@c8000600 { status = "okay"; bus-width = <4>; -- cgit v0.10.2 From d40d69ee350b62af90c2b522e05cbb3eb5f27112 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Mon, 10 Oct 2016 09:50:55 -0600 Subject: ARM: tegra: reduce DRAM size mapped into MMU on ARM64 ARM CPUs can architecturally (speculatively) prefetch completely arbitrary normal memory locations, as defined by the current translation tables. The current MMU configuration for 64-bit Tegras maps an extremely large range of addresses as DRAM, well beyond the actual physical maximum DRAM window, even though U-Boot only needs access to the first 2GB of DRAM; the Tegra port of U-Boot deliberately limits itself to 2GB of RAM since some HW modules on at least some 64-bit Tegra SoCs can only access a 32-bit physical address space. This change reduces the amount of RAM mapped via the MMU to disallow the CPU from ever speculatively accessing RAM that U-Boot will definitely not access. This avoids the possibility of the HW raising SError due to accesses to always-invalid physical addresses. Signed-off-by: Stephen Warren Signed-off-by: Tom Warren diff --git a/arch/arm/mach-tegra/arm64-mmu.c b/arch/arm/mach-tegra/arm64-mmu.c index 7b1d258..a79a519 100644 --- a/arch/arm/mach-tegra/arm64-mmu.c +++ b/arch/arm/mach-tegra/arm64-mmu.c @@ -23,7 +23,7 @@ static struct mm_region tegra_mem_map[] = { }, { .virt = 0x80000000UL, .phys = 0x80000000UL, - .size = 0xff80000000UL, + .size = 0x80000000UL, .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) | PTE_BLOCK_INNER_SHARE }, { -- cgit v0.10.2