From 6173c45b21ca584fd691b21dc81a44d852d4bdce Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Tue, 9 Dec 2014 22:25:05 -0700 Subject: power: Add AMS AS3722 PMIC support The AS3722 provides a number of DC/DC converters and LDOs as well as 8 GPIOs. Signed-off-by: Thierry Reding Signed-off-by: Simon Glass Signed-off-by: Tom Warren --- include/fdtdec.h | 1 + include/power/as3722.h | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 include/power/as3722.h (limited to 'include') diff --git a/include/fdtdec.h b/include/fdtdec.h index d2b665ca11..cc2dc5ce2a 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -123,6 +123,7 @@ enum fdt_compat_id { COMPAT_INTEL_PANTHERPOINT_AHCI, /* Intel Pantherpoint AHCI */ COMPAT_INTEL_MODEL_206AX, /* Intel Model 206AX CPU */ COMPAT_INTEL_GMA, /* Intel Graphics Media Accelerator */ + COMPAT_AMS_AS3722, /* AMS AS3722 PMIC */ COMPAT_COUNT, }; diff --git a/include/power/as3722.h b/include/power/as3722.h new file mode 100644 index 0000000000..aa966d2cca --- /dev/null +++ b/include/power/as3722.h @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2014 NVIDIA Corporation + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef __POWER_AS3722_H__ +#define __POWER_AS3722_H__ + +#include + +#define AS3722_GPIO_OUTPUT_VDDH (1 << 0) +#define AS3722_GPIO_INVERT (1 << 1) + +struct udevice; + +int as3722_init(struct udevice **devp); +int as3722_sd_enable(struct udevice *pmic, unsigned int sd); +int as3722_sd_set_voltage(struct udevice *pmic, unsigned int sd, u8 value); +int as3722_ldo_enable(struct udevice *pmic, unsigned int ldo); +int as3722_ldo_set_voltage(struct udevice *pmic, unsigned int ldo, u8 value); +int as3722_gpio_configure(struct udevice *pmic, unsigned int gpio, + unsigned long flags); +int as3722_gpio_direction_output(struct udevice *pmic, unsigned int gpio, + unsigned int level); + +#endif /* __POWER_AS3722_H__ */ -- cgit v1.2.1 From 79c7a90f6c642c27da3de5c134816be7f0405f1d Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Tue, 9 Dec 2014 22:25:09 -0700 Subject: ARM: tegra: Implement XUSB pad controller This controller was introduced on Tegra114 to handle XUSB pads. On Tegra124 it is also used for PCIe and SATA pin muxing and PHY control. Only the Tegra124 PCIe and SATA functionality is currently implemented, with weak symbols on Tegra114. Tegra20 and Tegra30 also provide weak symbols for these functions so that drivers can use the same API irrespective of which SoC they're being built for. Signed-off-by: Thierry Reding Signed-off-by: Simon Glass Signed-off-by: Tom Warren --- include/dt-bindings/pinctrl/pinctrl-tegra-xusb.h | 7 +++++++ include/fdtdec.h | 2 ++ 2 files changed, 9 insertions(+) create mode 100644 include/dt-bindings/pinctrl/pinctrl-tegra-xusb.h (limited to 'include') diff --git a/include/dt-bindings/pinctrl/pinctrl-tegra-xusb.h b/include/dt-bindings/pinctrl/pinctrl-tegra-xusb.h new file mode 100644 index 0000000000..914d56da93 --- /dev/null +++ b/include/dt-bindings/pinctrl/pinctrl-tegra-xusb.h @@ -0,0 +1,7 @@ +#ifndef _DT_BINDINGS_PINCTRL_TEGRA_XUSB_H +#define _DT_BINDINGS_PINCTRL_TEGRA_XUSB_H 1 + +#define TEGRA_XUSB_PADCTL_PCIE 0 +#define TEGRA_XUSB_PADCTL_SATA 1 + +#endif /* _DT_BINDINGS_PINCTRL_TEGRA_XUSB_H */ diff --git a/include/fdtdec.h b/include/fdtdec.h index cc2dc5ce2a..71aa82c725 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -86,6 +86,8 @@ enum fdt_compat_id { COMPAT_NVIDIA_TEGRA20_SFLASH, /* Tegra 2 SPI flash controller */ COMPAT_NVIDIA_TEGRA20_SLINK, /* Tegra 2 SPI SLINK controller */ COMPAT_NVIDIA_TEGRA114_SPI, /* Tegra 114 SPI controller */ + COMPAT_NVIDIA_TEGRA124_XUSB_PADCTL, + /* Tegra124 XUSB pad controller */ COMPAT_SMSC_LAN9215, /* SMSC 10/100 Ethernet LAN9215 */ COMPAT_SAMSUNG_EXYNOS5_SROMC, /* Exynos5 SROMC */ COMPAT_SAMSUNG_S3C2440_I2C, /* Exynos I2C Controller */ -- cgit v1.2.1 From f315828b0d31cac2559af626f75bcb7f5a0ac524 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Tue, 9 Dec 2014 22:25:12 -0700 Subject: pci: tegra: Add Tegra PCIe driver Add support for the PCIe controller found on some generations of Tegra. Tegra20 has 2 root ports with a total of 4 lanes, Tegra30 has 3 root ports with a total of 6 lanes and Tegra124 has 2 root ports with a total of 5 lanes. This is based on the Linux kernel driver, originally submitted upstream by Mike Rapoport. Signed-off-by: Mike Rapoport Signed-off-by: Thierry Reding Signed-off-by: Simon Glass Signed-off-by: Tom Warren --- include/fdtdec.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/fdtdec.h b/include/fdtdec.h index 71aa82c725..5effa240af 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -86,6 +86,9 @@ enum fdt_compat_id { COMPAT_NVIDIA_TEGRA20_SFLASH, /* Tegra 2 SPI flash controller */ COMPAT_NVIDIA_TEGRA20_SLINK, /* Tegra 2 SPI SLINK controller */ COMPAT_NVIDIA_TEGRA114_SPI, /* Tegra 114 SPI controller */ + COMPAT_NVIDIA_TEGRA124_PCIE, /* Tegra 124 PCIe controller */ + COMPAT_NVIDIA_TEGRA30_PCIE, /* Tegra 30 PCIe controller */ + COMPAT_NVIDIA_TEGRA20_PCIE, /* Tegra 20 PCIe controller */ COMPAT_NVIDIA_TEGRA124_XUSB_PADCTL, /* Tegra124 XUSB pad controller */ COMPAT_SMSC_LAN9215, /* SMSC 10/100 Ethernet LAN9215 */ -- cgit v1.2.1 From 65d2465d5d4cdb347506438b226b01d6ef0eec79 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Tue, 9 Dec 2014 22:25:13 -0700 Subject: ARM: tegra: Add Tegra20 PCIe device tree node Add the device tree node for the PCIe controller found on Tegra20 SoCs. Acked-by: Stephen Warren Signed-off-by: Thierry Reding Signed-off-by: Simon Glass Signed-off-by: Tom Warren --- include/dt-bindings/clock/tegra20-car.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/dt-bindings/clock/tegra20-car.h b/include/dt-bindings/clock/tegra20-car.h index 9406207cfa..a1ae9a8fdd 100644 --- a/include/dt-bindings/clock/tegra20-car.h +++ b/include/dt-bindings/clock/tegra20-car.h @@ -92,7 +92,7 @@ #define TEGRA20_CLK_OWR 71 #define TEGRA20_CLK_AFI 72 #define TEGRA20_CLK_CSITE 73 -/* 74 */ +#define TEGRA20_CLK_PCIE_XCLK 74 #define TEGRA20_CLK_AVPUCQ 75 #define TEGRA20_CLK_LA 76 /* 77 */ -- cgit v1.2.1 From 7dd8738f08144b01d91185f250af9ce2648cb25f Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Tue, 9 Dec 2014 22:25:14 -0700 Subject: ARM: tegra: Enable PCIe on TrimSlice The TrimSlice has an ethernet NIC connected to the PCIe bus. Enable the PCIe controller and the network driver so that the device can boot over the network. Signed-off-by: Thierry Reding Signed-off-by: Simon Glass Signed-off-by: Tom Warren --- include/configs/trimslice.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/configs/trimslice.h b/include/configs/trimslice.h index a254f86409..59f4f6767b 100644 --- a/include/configs/trimslice.h +++ b/include/configs/trimslice.h @@ -60,6 +60,16 @@ #define CONFIG_USB_HOST_ETHER #define CONFIG_USB_ETHER_ASIX +/* PCI host support */ +#define CONFIG_PCI +#define CONFIG_PCI_TEGRA +#define CONFIG_PCI_PNP +#define CONFIG_CMD_PCI +#define CONFIG_CMD_PCI_ENUM + +/* PCI networking support */ +#define CONFIG_RTL8169 + /* General networking support */ #define CONFIG_CMD_NET #define CONFIG_CMD_DHCP -- cgit v1.2.1 From a1811bc5b999998ef5f42e2312a1140eb7cf3957 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Tue, 9 Dec 2014 22:25:16 -0700 Subject: ARM: tegra: Add Tegra30 PCIe device tree node Add the device tree node for the PCIe controller found on Tegra30 SoCs. Signed-off-by: Thierry Reding Signed-off-by: Simon Glass Signed-off-by: Tom Warren --- include/dt-bindings/clock/tegra30-car.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/dt-bindings/clock/tegra30-car.h b/include/dt-bindings/clock/tegra30-car.h index 889e49ba0a..22445820a9 100644 --- a/include/dt-bindings/clock/tegra30-car.h +++ b/include/dt-bindings/clock/tegra30-car.h @@ -92,7 +92,7 @@ #define TEGRA30_CLK_OWR 71 #define TEGRA30_CLK_AFI 72 #define TEGRA30_CLK_CSITE 73 -/* 74 */ +#define TEGRA30_CLK_PCIEX 74 #define TEGRA30_CLK_AVPUCQ 75 #define TEGRA30_CLK_LA 76 /* 77 */ -- cgit v1.2.1 From 5a2c96a0e5d1dfc13f71b295f07be8a4b7ac8fdb Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Tue, 9 Dec 2014 22:25:17 -0700 Subject: ARM: tegra: Enable PCIe on Cardhu The PCIe bus on Cardhu is routed to the dock connector. An ethernet NIC is available on the dock over the PCIe bus. Enable the PCIe controller and the network device driver so that the device can boot over the network. Signed-off-by: Thierry Reding Signed-off-by: Simon Glass Signed-off-by: Tom Warren --- include/configs/cardhu.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/configs/cardhu.h b/include/configs/cardhu.h index 758b7ad392..5e13b655c2 100644 --- a/include/configs/cardhu.h +++ b/include/configs/cardhu.h @@ -78,6 +78,16 @@ #define CONFIG_USB_HOST_ETHER #define CONFIG_USB_ETHER_ASIX +/* PCI host support */ +#define CONFIG_PCI +#define CONFIG_PCI_TEGRA +#define CONFIG_PCI_PNP +#define CONFIG_CMD_PCI +#define CONFIG_CMD_PCI_ENUM + +/* PCI networking support */ +#define CONFIG_RTL8169 + /* General networking support */ #define CONFIG_CMD_NET #define CONFIG_CMD_DHCP -- cgit v1.2.1 From affe026928db2f1579261ca3b80fe28b6b9f3765 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Tue, 9 Dec 2014 22:25:18 -0700 Subject: ARM: tegra: Enable PCIe on Beaver The Beaver has an ethernet NIC connected to the PCIe bus. Enable the PCIe controller and the network device driver so that the device can boot over the network. In addition the board has a mini-PCIe expansion slot. Signed-off-by: Thierry Reding Signed-off-by: Simon Glass Signed-off-by: Tom Warren --- include/configs/beaver.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/configs/beaver.h b/include/configs/beaver.h index 5d765f3d36..5df460c96b 100644 --- a/include/configs/beaver.h +++ b/include/configs/beaver.h @@ -76,6 +76,16 @@ #define CONFIG_USB_HOST_ETHER #define CONFIG_USB_ETHER_ASIX +/* PCI host support */ +#define CONFIG_PCI +#define CONFIG_PCI_TEGRA +#define CONFIG_PCI_PNP +#define CONFIG_CMD_PCI +#define CONFIG_CMD_PCI_ENUM + +/* PCI networking support */ +#define CONFIG_RTL8169 + /* General networking support */ #define CONFIG_CMD_NET #define CONFIG_CMD_DHCP -- cgit v1.2.1 From 6e2fca94ff4f754024e46e7d986221a75be611f3 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Tue, 9 Dec 2014 22:25:21 -0700 Subject: ARM: tegra: Enable PCIe on Jetson TK1 The Jetson TK1 has an ethernet NIC connected to the PCIe bus and routes the second root port to a miniPCIe slot. Enable the PCIe controller and the network driver to allow the device to boot over the network. Signed-off-by: Thierry Reding Signed-off-by: Simon Glass Signed-off-by: Tom Warren --- include/configs/jetson-tk1.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include') diff --git a/include/configs/jetson-tk1.h b/include/configs/jetson-tk1.h index a7d76650ce..0a79c7cfc3 100644 --- a/include/configs/jetson-tk1.h +++ b/include/configs/jetson-tk1.h @@ -10,6 +10,9 @@ #include +/* enable PMIC */ +#define CONFIG_AS3722_POWER + #include "tegra124-common.h" /* High-level configuration options */ @@ -61,6 +64,16 @@ #define CONFIG_USB_HOST_ETHER #define CONFIG_USB_ETHER_ASIX +/* PCI host support */ +#define CONFIG_PCI +#define CONFIG_PCI_TEGRA +#define CONFIG_PCI_PNP +#define CONFIG_CMD_PCI +#define CONFIG_CMD_PCI_ENUM + +/* PCI networking support */ +#define CONFIG_RTL8169 + /* General networking support */ #define CONFIG_CMD_NET #define CONFIG_CMD_DHCP -- cgit v1.2.1 From d1e5b4065ee14a6dbabd9318a8f73194c6536d6e Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Tue, 9 Dec 2014 22:25:23 -0700 Subject: ARM: tegra: Enable non-cached memory Some boards, most notably those with a PCIe ethernet NIC, require this to avoid cache coherency problems. Since the option adds very little code and overhead enable it across all Tegra generations. Other drivers may also start supporting this functionality at some point, so enabling it now will automatically reap the benefits later on. Acked-by: Stephen Warren Signed-off-by: Thierry Reding Signed-off-by: Simon Glass Signed-off-by: Tom Warren --- include/configs/tegra-common.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/configs/tegra-common.h b/include/configs/tegra-common.h index 06853285a2..8f1e370915 100644 --- a/include/configs/tegra-common.h +++ b/include/configs/tegra-common.h @@ -47,7 +47,9 @@ * Size of malloc() pool */ #define CONFIG_SYS_MALLOC_LEN (4 << 20) /* 4MB */ -#define CONFIG_SYS_MALLOC_F_LEN (1 << 10) +#define CONFIG_SYS_MALLOC_F_LEN (1 << 10) + +#define CONFIG_SYS_NONCACHED_MEMORY (1 << 20) /* 1 MiB */ /* * NS16550 Configuration -- cgit v1.2.1