summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-04-07 09:59:38 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-04-07 09:59:38 +0200
commit79d7972ef4c513dabb0afb84ef5739f88f26e1f7 (patch)
tree7a3a2c04775f56251d41e6380139d6e1b9a108c1
parent5d834decbe062273393acfcf172fdd29ead6a166 (diff)
parentce579e2187071e2a10be39bfdd11b6bb1086c107 (diff)
downloadbarebox-79d7972ef4c513dabb0afb84ef5739f88f26e1f7.tar.gz
barebox-79d7972ef4c513dabb0afb84ef5739f88f26e1f7.tar.xz
Merge branch 'for-next/tegra'
-rw-r--r--arch/arm/configs/tegra_v7_defconfig1
-rw-r--r--arch/arm/dts/tegra124-jetson-tk1.dts4
-rw-r--r--arch/arm/dts/tegra124.dtsi42
-rw-r--r--drivers/Kconfig1
-rw-r--r--drivers/Makefile1
-rw-r--r--drivers/memory/Kconfig11
-rw-r--r--drivers/memory/Makefile1
-rw-r--r--drivers/memory/mc-tegra124.c75
8 files changed, 130 insertions, 6 deletions
diff --git a/arch/arm/configs/tegra_v7_defconfig b/arch/arm/configs/tegra_v7_defconfig
index 66534a71d8..65b9807b80 100644
--- a/arch/arm/configs/tegra_v7_defconfig
+++ b/arch/arm/configs/tegra_v7_defconfig
@@ -46,6 +46,7 @@ CONFIG_MCI=y
CONFIG_MCI_MMC_BOOT_PARTITIONS=y
CONFIG_MCI_TEGRA=y
CONFIG_PCI_TEGRA=y
+CONFIG_MC_TEGRA124=y
CONFIG_FS_EXT4=y
CONFIG_FS_TFTP=y
CONFIG_FS_NFS=y
diff --git a/arch/arm/dts/tegra124-jetson-tk1.dts b/arch/arm/dts/tegra124-jetson-tk1.dts
index 26f405ca3d..00ae58fb27 100644
--- a/arch/arm/dts/tegra124-jetson-tk1.dts
+++ b/arch/arm/dts/tegra124-jetson-tk1.dts
@@ -3,7 +3,7 @@
/ {
chosen {
- stdout-path = "/serial@0,70006300/";
+ stdout-path = &uartd;
environment@0 {
compatible = "barebox,environment";
@@ -12,6 +12,6 @@
};
/* eMMC */
- emmc: sdhci@0,700b0600 {
+ emmc: sdhci@700b0600 {
};
};
diff --git a/arch/arm/dts/tegra124.dtsi b/arch/arm/dts/tegra124.dtsi
index 9276f2f0bd..ce618db78c 100644
--- a/arch/arm/dts/tegra124.dtsi
+++ b/arch/arm/dts/tegra124.dtsi
@@ -1,8 +1,42 @@
+#include <dt-bindings/pinctrl/pinctrl-tegra-xusb.h>
+
/ {
aliases {
- mmc0 = "/sdhci@0,700b0000/";
- mmc1 = "/sdhci@0,700b0200/";
- mmc2 = "/sdhci@0,700b0400/";
- mmc3 = "/sdhci@0,700b0600/";
+ mmc0 = "/sdhci@700b0000/";
+ mmc1 = "/sdhci@700b0200/";
+ mmc2 = "/sdhci@700b0400/";
+ mmc3 = "/sdhci@700b0600/";
+ };
+
+ pcie-controller@01003000 {
+ phys = <&padctl TEGRA_XUSB_PADCTL_PCIE>;
+ phy-names = "pcie";
+ };
+
+ padctl@7009f000 {
+ pinctrl-0 = <&padctl_default>;
+ pinctrl-names = "default";
+ #phy-cells = <1>;
+
+ padctl_default: pinmux {
+ usb3 {
+ nvidia,lanes = "pcie-0", "pcie-1";
+ nvidia,function = "usb3";
+ nvidia,iddq = <0>;
+ };
+
+ pcie {
+ nvidia,lanes = "pcie-2", "pcie-3",
+ "pcie-4";
+ nvidia,function = "pcie";
+ nvidia,iddq = <0>;
+ };
+
+ sata {
+ nvidia,lanes = "sata-0";
+ nvidia,function = "sata";
+ nvidia,iddq = <0>;
+ };
+ };
};
};
diff --git a/drivers/Kconfig b/drivers/Kconfig
index ced8f3d0f8..1e0246da6d 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -36,5 +36,6 @@ source "drivers/rtc/Kconfig"
source "drivers/firmware/Kconfig"
source "drivers/phy/Kconfig"
source "drivers/crypto/Kconfig"
+source "drivers/memory/Kconfig"
endmenu
diff --git a/drivers/Makefile b/drivers/Makefile
index 4ce781b63f..767789d541 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -37,3 +37,4 @@ obj-$(CONFIG_GENERIC_PHY) += phy/
obj-$(CONFIG_HAB) += hab/
obj-$(CONFIG_CRYPTO_HW) += crypto/
obj-$(CONFIG_AIODEV) += aiodev/
+obj-y += memory/
diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig
new file mode 100644
index 0000000000..39fd644773
--- /dev/null
+++ b/drivers/memory/Kconfig
@@ -0,0 +1,11 @@
+menu "Memory controller drivers"
+
+config MC_TEGRA124
+ bool "Support for Tegra124 memory controller"
+ depends on ARCH_TEGRA
+ help
+ Say yes here to include the driver for the memory controller found on
+ the Tegra124 SoC. This driver performs the necessary initialization
+ to provide a function GPU when the OS is running.
+
+endmenu
diff --git a/drivers/memory/Makefile b/drivers/memory/Makefile
new file mode 100644
index 0000000000..bd5ace9fdd
--- /dev/null
+++ b/drivers/memory/Makefile
@@ -0,0 +1 @@
+obj-$(CONFIG_MC_TEGRA124) += mc-tegra124.o
diff --git a/drivers/memory/mc-tegra124.c b/drivers/memory/mc-tegra124.c
new file mode 100644
index 0000000000..a8d16094c6
--- /dev/null
+++ b/drivers/memory/mc-tegra124.c
@@ -0,0 +1,75 @@
+/* *
+ * Copyright (C) 2017 Lucas Stach <l.stach@pengutronix.de>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <common.h>
+#include <init.h>
+#include <io.h>
+#include <of.h>
+
+#define MC_VIDEO_PROTECT_SIZE_MB 0x64c
+#define MC_VIDEO_PROTECT_REG_CTRL 0x650
+#define MC_VIDEO_PROTECT_REG_WR_DIS (1 << 0)
+
+static int tegra124_mc_of_fixup(struct device_node *root, void *context)
+{
+ struct device_node *np;
+
+ np = of_find_compatible_node(root, NULL, "nvidia,gk20a");
+ if (np)
+ of_device_enable(np);
+
+ return 0;
+}
+
+static int tegra124_mc_probe(struct device_d *dev)
+{
+ struct resource *iores;
+ void __iomem *base;
+
+ iores = dev_request_mem_resource(dev, 0);
+ if (IS_ERR(iores)) {
+ dev_err(dev, "could not get memory region\n");
+ return PTR_ERR(iores);
+ }
+ base = IOMEM(iores->start);
+
+ /* disable video protect region */
+ writel(0 , base + MC_VIDEO_PROTECT_SIZE_MB);
+ writel(MC_VIDEO_PROTECT_REG_WR_DIS, base + MC_VIDEO_PROTECT_REG_CTRL);
+ readl(base + MC_VIDEO_PROTECT_REG_CTRL); /* readback to flush */
+
+ return of_register_fixup(tegra124_mc_of_fixup, NULL);
+}
+
+static __maybe_unused struct of_device_id tegra124_mc_dt_ids[] = {
+ {
+ .compatible = "nvidia,tegra124-mc",
+ }, {
+ /* sentinel */
+ },
+};
+
+static struct driver_d tegra124_mc_driver = {
+ .name = "tegra124-mc",
+ .of_compatible = DRV_OF_COMPAT(tegra124_mc_dt_ids),
+ .probe = tegra124_mc_probe,
+};
+
+static int __init tegra124_mc_init(void)
+{
+ return platform_driver_register(&tegra124_mc_driver);
+}
+device_initcall(tegra124_mc_init);