* [PATCH v6 00/12] NVIDIA Tegra memory controller and IOMMU support
@ 2014-11-07 16:00 Thierry Reding
2014-11-07 16:00 ` [PATCH v6 01/12] clk: tegra: Implement memory-controller clock Thierry Reding
` (12 more replies)
0 siblings, 13 replies; 17+ messages in thread
From: Thierry Reding @ 2014-11-07 16:00 UTC (permalink / raw)
To: linux-arm-kernel
From: Thierry Reding <treding@nvidia.com>
This is the sixth installment in the Tegra IOMMU and memory controller
support series. This version addresses the final outstanding comments from
Olof about using proper Kconfig symbols to track the dependencies. It also
splits up the driver into one part that implements the memory controller
only and a second part that implements the SMMU. This plays nicely with
the new Kconfig options introduced.
Patch 1 is a preparatory patch that exposes the memory controller clock.
Patches 2 and 3 is a pair of precursory patches needed to make this all
work on 64-bit ARM in the future.
The device tree binding for the Tegra memory controller is added in patch
4 and patch 5 is the bulk of the series that move the existing memory
controller and IOMMU drivers into the new unified driver that supports
Tegra30, Tegra114 and Tegra124.
Patches 6, 7 and 8 add the DT nodes for the memory controller/IOMMU on
Tegra30, Tegra114 and Tegra124.
IOMMU support is enabled for the display controllers in patches 9, 10 and
11. This will allow the display controllers to have their memory accesses
translated by the SMMU, which will enable non-contiguous buffers to be
used for scan-out.
Finally patch 12 also adds support for Tegra132. It is kept separate because
none of the other Tegra132 patches have been merged yet, but I've included
it here for completeness.
Because the patches are rather intertwined, I'd like to merge them all via
the Tegra tree. For that I'll need Acked-bys from Mike, Russell and Joerg
on patches 1, 2 and 3, and 5, respectively.
Thierry
Thierry Reding (12):
clk: tegra: Implement memory-controller clock
amba: Add Kconfig file
ARM: tegra: Move AHB Kconfig to drivers/amba
of: Add NVIDIA Tegra memory controller binding
memory: Add NVIDIA Tegra memory controller support
ARM: tegra: Add memory controller support for Tegra30
ARM: tegra: Add memory controller support for Tegra114
ARM: tegra: Add memory controller support for Tegra124
ARM: tegra: Enable IOMMU for display controllers on Tegra30
ARM: tegra: Enable IOMMU for display controllers on Tegra114
ARM: tegra: Enable IOMMU for display controllers on Tegra124
memory: tegra: Add Tegra132 support
.../memory-controllers/nvidia,tegra-mc.txt | 36 +
arch/arm/Kconfig | 3 -
arch/arm/boot/dts/tegra114.dtsi | 23 +-
arch/arm/boot/dts/tegra124.dtsi | 16 +
arch/arm/boot/dts/tegra30.dtsi | 25 +-
arch/arm/mach-tegra/Kconfig | 9 +-
arch/arm64/Kconfig | 3 -
drivers/Kconfig | 2 +
drivers/amba/Kconfig | 14 +
drivers/clk/tegra/clk-divider.c | 13 +
drivers/clk/tegra/clk-tegra114.c | 7 +-
drivers/clk/tegra/clk-tegra124.c | 7 +-
drivers/clk/tegra/clk-tegra20.c | 8 +-
drivers/clk/tegra/clk-tegra30.c | 7 +-
drivers/clk/tegra/clk.h | 2 +
drivers/iommu/Makefile | 1 -
drivers/iommu/tegra-smmu.c | 1295 --------------------
drivers/memory/Kconfig | 12 +-
drivers/memory/Makefile | 3 +-
drivers/memory/tegra/Kconfig | 16 +
drivers/memory/tegra/Makefile | 9 +
drivers/memory/tegra/mc.c | 303 +++++
drivers/memory/tegra/mc.h | 129 ++
drivers/memory/tegra/smmu.c | 716 +++++++++++
drivers/memory/tegra/tegra114.c | 948 ++++++++++++++
drivers/memory/tegra/tegra124.c | 1028 ++++++++++++++++
drivers/memory/tegra/tegra30.c | 970 +++++++++++++++
drivers/memory/tegra30-mc.c | 378 ------
include/dt-bindings/clock/tegra114-car.h | 2 +-
include/dt-bindings/clock/tegra124-car.h | 2 +-
include/dt-bindings/clock/tegra20-car.h | 2 +-
include/dt-bindings/memory/tegra114-mc.h | 25 +
include/dt-bindings/memory/tegra124-mc.h | 31 +
include/dt-bindings/memory/tegra30-mc.h | 24 +
34 files changed, 4340 insertions(+), 1729 deletions(-)
create mode 100644 Documentation/devicetree/bindings/memory-controllers/nvidia,tegra-mc.txt
create mode 100644 drivers/amba/Kconfig
delete mode 100644 drivers/iommu/tegra-smmu.c
create mode 100644 drivers/memory/tegra/Kconfig
create mode 100644 drivers/memory/tegra/Makefile
create mode 100644 drivers/memory/tegra/mc.c
create mode 100644 drivers/memory/tegra/mc.h
create mode 100644 drivers/memory/tegra/smmu.c
create mode 100644 drivers/memory/tegra/tegra114.c
create mode 100644 drivers/memory/tegra/tegra124.c
create mode 100644 drivers/memory/tegra/tegra30.c
delete mode 100644 drivers/memory/tegra30-mc.c
create mode 100644 include/dt-bindings/memory/tegra114-mc.h
create mode 100644 include/dt-bindings/memory/tegra124-mc.h
create mode 100644 include/dt-bindings/memory/tegra30-mc.h
--
2.1.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v6 01/12] clk: tegra: Implement memory-controller clock
2014-11-07 16:00 [PATCH v6 00/12] NVIDIA Tegra memory controller and IOMMU support Thierry Reding
@ 2014-11-07 16:00 ` Thierry Reding
2014-11-07 16:00 ` [PATCH v6 02/12] amba: Add Kconfig file Thierry Reding
` (11 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: Thierry Reding @ 2014-11-07 16:00 UTC (permalink / raw)
To: linux-arm-kernel
From: Thierry Reding <treding@nvidia.com>
The memory controller clock runs either at half or the same frequency as
the EMC clock.
Reviewed-By: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
Mike, as I said in the cover letter there are tight dependencies between the
patches in this series, so I'd like to get your Acked-by on this one so I can
take it through the Tegra tree along with the others.
Thanks,
Thierry
Changes in v4:
- use name and parent name parameters passed in when registering clock
Changes in v3:
- split registration into a separate function that can be reused for all
SoC generations, but pass in the name and parent parameters for
clarity as well as the register address (in case it ever changes) and
the EMC spin-lock since it isn't globally available
drivers/clk/tegra/clk-divider.c | 13 +++++++++++++
drivers/clk/tegra/clk-tegra114.c | 7 ++++++-
drivers/clk/tegra/clk-tegra124.c | 7 ++++++-
drivers/clk/tegra/clk-tegra20.c | 8 +++++++-
drivers/clk/tegra/clk-tegra30.c | 7 ++++++-
drivers/clk/tegra/clk.h | 2 ++
include/dt-bindings/clock/tegra114-car.h | 2 +-
include/dt-bindings/clock/tegra124-car.h | 2 +-
include/dt-bindings/clock/tegra20-car.h | 2 +-
9 files changed, 43 insertions(+), 7 deletions(-)
diff --git a/drivers/clk/tegra/clk-divider.c b/drivers/clk/tegra/clk-divider.c
index 290f9c1a3749..59a5714dfe18 100644
--- a/drivers/clk/tegra/clk-divider.c
+++ b/drivers/clk/tegra/clk-divider.c
@@ -185,3 +185,16 @@ struct clk *tegra_clk_register_divider(const char *name,
return clk;
}
+
+static const struct clk_div_table mc_div_table[] = {
+ { .val = 0, .div = 2 },
+ { .val = 1, .div = 1 },
+ { .val = 0, .div = 0 },
+};
+
+struct clk *tegra_clk_register_mc(const char *name, const char *parent_name,
+ void __iomem *reg, spinlock_t *lock)
+{
+ return clk_register_divider_table(NULL, name, parent_name, 0, reg,
+ 16, 1, 0, mc_div_table, lock);
+}
diff --git a/drivers/clk/tegra/clk-tegra114.c b/drivers/clk/tegra/clk-tegra114.c
index f760f31d05c4..0b03d2cf7264 100644
--- a/drivers/clk/tegra/clk-tegra114.c
+++ b/drivers/clk/tegra/clk-tegra114.c
@@ -173,6 +173,7 @@ static DEFINE_SPINLOCK(pll_d_lock);
static DEFINE_SPINLOCK(pll_d2_lock);
static DEFINE_SPINLOCK(pll_u_lock);
static DEFINE_SPINLOCK(pll_re_lock);
+static DEFINE_SPINLOCK(emc_lock);
static struct div_nmp pllxc_nmp = {
.divm_shift = 0,
@@ -1228,7 +1229,11 @@ static __init void tegra114_periph_clk_init(void __iomem *clk_base,
ARRAY_SIZE(mux_pllmcp_clkm),
CLK_SET_RATE_NO_REPARENT,
clk_base + CLK_SOURCE_EMC,
- 29, 3, 0, NULL);
+ 29, 3, 0, &emc_lock);
+
+ clk = tegra_clk_register_mc("mc", "emc_mux", clk_base + CLK_SOURCE_EMC,
+ &emc_lock);
+ clks[TEGRA114_CLK_MC] = clk;
for (i = 0; i < ARRAY_SIZE(tegra_periph_clk_list); i++) {
data = &tegra_periph_clk_list[i];
diff --git a/drivers/clk/tegra/clk-tegra124.c b/drivers/clk/tegra/clk-tegra124.c
index e3a85842ce0c..f5f9baca7bb6 100644
--- a/drivers/clk/tegra/clk-tegra124.c
+++ b/drivers/clk/tegra/clk-tegra124.c
@@ -132,6 +132,7 @@ static DEFINE_SPINLOCK(pll_d2_lock);
static DEFINE_SPINLOCK(pll_e_lock);
static DEFINE_SPINLOCK(pll_re_lock);
static DEFINE_SPINLOCK(pll_u_lock);
+static DEFINE_SPINLOCK(emc_lock);
/* possible OSC frequencies in Hz */
static unsigned long tegra124_input_freq[] = {
@@ -1127,7 +1128,11 @@ static __init void tegra124_periph_clk_init(void __iomem *clk_base,
clk = clk_register_mux(NULL, "emc_mux", mux_pllmcp_clkm,
ARRAY_SIZE(mux_pllmcp_clkm), 0,
clk_base + CLK_SOURCE_EMC,
- 29, 3, 0, NULL);
+ 29, 3, 0, &emc_lock);
+
+ clk = tegra_clk_register_mc("mc", "emc_mux", clk_base + CLK_SOURCE_EMC,
+ &emc_lock);
+ clks[TEGRA124_CLK_MC] = clk;
/* cml0 */
clk = clk_register_gate(NULL, "cml0", "pll_e", 0, clk_base + PLLE_AUX,
diff --git a/drivers/clk/tegra/clk-tegra20.c b/drivers/clk/tegra/clk-tegra20.c
index dace2b1b5ae6..41272dcc9e22 100644
--- a/drivers/clk/tegra/clk-tegra20.c
+++ b/drivers/clk/tegra/clk-tegra20.c
@@ -140,6 +140,8 @@ static struct cpu_clk_suspend_context {
static void __iomem *clk_base;
static void __iomem *pmc_base;
+static DEFINE_SPINLOCK(emc_lock);
+
#define TEGRA_INIT_DATA_MUX(_name, _parents, _offset, \
_clk_num, _gate_flags, _clk_id) \
TEGRA_INIT_DATA(_name, NULL, NULL, _parents, _offset, \
@@ -819,11 +821,15 @@ static void __init tegra20_periph_clk_init(void)
ARRAY_SIZE(mux_pllmcp_clkm),
CLK_SET_RATE_NO_REPARENT,
clk_base + CLK_SOURCE_EMC,
- 30, 2, 0, NULL);
+ 30, 2, 0, &emc_lock);
clk = tegra_clk_register_periph_gate("emc", "emc_mux", 0, clk_base, 0,
57, periph_clk_enb_refcnt);
clks[TEGRA20_CLK_EMC] = clk;
+ clk = tegra_clk_register_mc("mc", "emc_mux", clk_base + CLK_SOURCE_EMC,
+ &emc_lock);
+ clks[TEGRA20_CLK_MC] = clk;
+
/* dsi */
clk = tegra_clk_register_periph_gate("dsi", "pll_d", 0, clk_base, 0,
48, periph_clk_enb_refcnt);
diff --git a/drivers/clk/tegra/clk-tegra30.c b/drivers/clk/tegra/clk-tegra30.c
index 5bbacd01094f..4b9d8bd3d0bf 100644
--- a/drivers/clk/tegra/clk-tegra30.c
+++ b/drivers/clk/tegra/clk-tegra30.c
@@ -177,6 +177,7 @@ static unsigned long input_freq;
static DEFINE_SPINLOCK(cml_lock);
static DEFINE_SPINLOCK(pll_d_lock);
+static DEFINE_SPINLOCK(emc_lock);
#define TEGRA_INIT_DATA_MUX(_name, _parents, _offset, \
_clk_num, _gate_flags, _clk_id) \
@@ -1157,11 +1158,15 @@ static void __init tegra30_periph_clk_init(void)
ARRAY_SIZE(mux_pllmcp_clkm),
CLK_SET_RATE_NO_REPARENT,
clk_base + CLK_SOURCE_EMC,
- 30, 2, 0, NULL);
+ 30, 2, 0, &emc_lock);
clk = tegra_clk_register_periph_gate("emc", "emc_mux", 0, clk_base, 0,
57, periph_clk_enb_refcnt);
clks[TEGRA30_CLK_EMC] = clk;
+ clk = tegra_clk_register_mc("mc", "emc_mux", clk_base + CLK_SOURCE_EMC,
+ &emc_lock);
+ clks[TEGRA30_CLK_MC] = clk;
+
/* cml0 */
clk = clk_register_gate(NULL, "cml0", "pll_e", 0, clk_base + PLLE_AUX,
0, 0, &cml_lock);
diff --git a/drivers/clk/tegra/clk.h b/drivers/clk/tegra/clk.h
index 16ec8d6bb87f..4e458aa8d45c 100644
--- a/drivers/clk/tegra/clk.h
+++ b/drivers/clk/tegra/clk.h
@@ -86,6 +86,8 @@ struct clk *tegra_clk_register_divider(const char *name,
const char *parent_name, void __iomem *reg,
unsigned long flags, u8 clk_divider_flags, u8 shift, u8 width,
u8 frac_width, spinlock_t *lock);
+struct clk *tegra_clk_register_mc(const char *name, const char *parent_name,
+ void __iomem *reg, spinlock_t *lock);
/*
* Tegra PLL:
diff --git a/include/dt-bindings/clock/tegra114-car.h b/include/dt-bindings/clock/tegra114-car.h
index fc12621fb432..534c03f8ad72 100644
--- a/include/dt-bindings/clock/tegra114-car.h
+++ b/include/dt-bindings/clock/tegra114-car.h
@@ -49,7 +49,7 @@
#define TEGRA114_CLK_I2S0 30
/* 31 */
-/* 32 */
+#define TEGRA114_CLK_MC 32
/* 33 */
#define TEGRA114_CLK_APBDMA 34
/* 35 */
diff --git a/include/dt-bindings/clock/tegra124-car.h b/include/dt-bindings/clock/tegra124-car.h
index 6bac637fd635..af9bc9a3ddbc 100644
--- a/include/dt-bindings/clock/tegra124-car.h
+++ b/include/dt-bindings/clock/tegra124-car.h
@@ -48,7 +48,7 @@
#define TEGRA124_CLK_I2S0 30
/* 31 */
-/* 32 */
+#define TEGRA124_CLK_MC 32
/* 33 */
#define TEGRA124_CLK_APBDMA 34
/* 35 */
diff --git a/include/dt-bindings/clock/tegra20-car.h b/include/dt-bindings/clock/tegra20-car.h
index 9406207cfac8..04500b243a4d 100644
--- a/include/dt-bindings/clock/tegra20-car.h
+++ b/include/dt-bindings/clock/tegra20-car.h
@@ -49,7 +49,7 @@
/* 30 */
#define TEGRA20_CLK_CACHE2 31
-#define TEGRA20_CLK_MEM 32
+#define TEGRA20_CLK_MC 32
#define TEGRA20_CLK_AHBDMA 33
#define TEGRA20_CLK_APBDMA 34
/* 35 */
--
2.1.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v6 02/12] amba: Add Kconfig file
2014-11-07 16:00 [PATCH v6 00/12] NVIDIA Tegra memory controller and IOMMU support Thierry Reding
2014-11-07 16:00 ` [PATCH v6 01/12] clk: tegra: Implement memory-controller clock Thierry Reding
@ 2014-11-07 16:00 ` Thierry Reding
2014-11-07 16:00 ` [PATCH v6 03/12] ARM: tegra: Move AHB Kconfig to drivers/amba Thierry Reding
` (10 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: Thierry Reding @ 2014-11-07 16:00 UTC (permalink / raw)
To: linux-arm-kernel
From: Thierry Reding <treding@nvidia.com>
Rather than duplicate the ARM_AMBA Kconfig symbol in both 32-bit and
64-bit ARM architectures, move the common definition to drivers/amba
where dependent drivers will be located.
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
Hi Russell, Will, Catalin,
As explained in the cover-letter there are tight dependencies between the
patches in this series, so for simplicity I'd like to take this patch through
the Tegra tree with your Acked-by.
Thanks,
Thierry
arch/arm/Kconfig | 3 ---
arch/arm64/Kconfig | 3 ---
drivers/amba/Kconfig | 2 ++
3 files changed, 2 insertions(+), 6 deletions(-)
create mode 100644 drivers/amba/Kconfig
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 9d580d0e89a9..21fbf144a9fd 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1242,9 +1242,6 @@ source "arch/arm/common/Kconfig"
menu "Bus support"
-config ARM_AMBA
- bool
-
config ISA
bool
help
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 66b0b519ea02..275d635041d6 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -167,9 +167,6 @@ endmenu
menu "Bus support"
-config ARM_AMBA
- bool
-
config PCI
bool "PCI support"
help
diff --git a/drivers/amba/Kconfig b/drivers/amba/Kconfig
new file mode 100644
index 000000000000..d1cba6a9b3b8
--- /dev/null
+++ b/drivers/amba/Kconfig
@@ -0,0 +1,2 @@
+config ARM_AMBA
+ bool
--
2.1.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v6 03/12] ARM: tegra: Move AHB Kconfig to drivers/amba
2014-11-07 16:00 [PATCH v6 00/12] NVIDIA Tegra memory controller and IOMMU support Thierry Reding
2014-11-07 16:00 ` [PATCH v6 01/12] clk: tegra: Implement memory-controller clock Thierry Reding
2014-11-07 16:00 ` [PATCH v6 02/12] amba: Add Kconfig file Thierry Reding
@ 2014-11-07 16:00 ` Thierry Reding
2014-11-07 16:00 ` [PATCH v6 04/12] of: Add NVIDIA Tegra memory controller binding Thierry Reding
` (9 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: Thierry Reding @ 2014-11-07 16:00 UTC (permalink / raw)
To: linux-arm-kernel
From: Thierry Reding <treding@nvidia.com>
This will allow the Kconfig option to be shared among 32-bit and 64-bit
ARM.
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
Hi Russell,
As explained in the cover-letter there are tight dependencies between the
patches in this series, so for simplicity I'd like to take this patch through
the Tegra tree with your Acked-by.
Thanks,
Thierry
Changes in v4:
- add precursory patch introducing drivers/amba/Kconfig, rebase on top
Changes in v3:
- select ARM_AMBA from ARCH_TEGRA to enable the TEGRA_AHB driver
arch/arm/mach-tegra/Kconfig | 9 +--------
drivers/Kconfig | 2 ++
drivers/amba/Kconfig | 12 ++++++++++++
3 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
index 095399618ca5..d0be9a1ef6b8 100644
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -2,6 +2,7 @@ menuconfig ARCH_TEGRA
bool "NVIDIA Tegra" if ARCH_MULTI_V7
select ARCH_REQUIRE_GPIOLIB
select ARCH_SUPPORTS_TRUSTED_FOUNDATIONS
+ select ARM_AMBA
select ARM_GIC
select CLKSRC_MMIO
select HAVE_ARM_SCU if SMP
@@ -59,12 +60,4 @@ config ARCH_TEGRA_124_SOC
Support for NVIDIA Tegra T124 processor family, based on the
ARM CortexA15MP CPU
-config TEGRA_AHB
- bool "Enable AHB driver for NVIDIA Tegra SoCs"
- default y
- help
- Adds AHB configuration functionality for NVIDIA Tegra SoCs,
- which controls AHB bus master arbitration and some
- performance parameters(priority, prefech size).
-
endif
diff --git a/drivers/Kconfig b/drivers/Kconfig
index 569ff7886dc3..694d5a70d6ce 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -1,5 +1,7 @@
menu "Device Drivers"
+source "drivers/amba/Kconfig"
+
source "drivers/base/Kconfig"
source "drivers/bus/Kconfig"
diff --git a/drivers/amba/Kconfig b/drivers/amba/Kconfig
index d1cba6a9b3b8..4a5c9d279059 100644
--- a/drivers/amba/Kconfig
+++ b/drivers/amba/Kconfig
@@ -1,2 +1,14 @@
config ARM_AMBA
bool
+
+if ARM_AMBA
+
+config TEGRA_AHB
+ bool "Enable AHB driver for NVIDIA Tegra SoCs"
+ default y if ARCH_TEGRA
+ help
+ Adds AHB configuration functionality for NVIDIA Tegra SoCs,
+ which controls AHB bus master arbitration and some performance
+ parameters (priority, prefetch size).
+
+endif
--
2.1.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v6 04/12] of: Add NVIDIA Tegra memory controller binding
2014-11-07 16:00 [PATCH v6 00/12] NVIDIA Tegra memory controller and IOMMU support Thierry Reding
` (2 preceding siblings ...)
2014-11-07 16:00 ` [PATCH v6 03/12] ARM: tegra: Move AHB Kconfig to drivers/amba Thierry Reding
@ 2014-11-07 16:00 ` Thierry Reding
2014-11-07 16:00 ` [PATCH v6 06/12] ARM: tegra: Add memory controller support for Tegra30 Thierry Reding
` (8 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: Thierry Reding @ 2014-11-07 16:00 UTC (permalink / raw)
To: linux-arm-kernel
From: Thierry Reding <treding@nvidia.com>
The memory controller on NVIDIA Tegra exposes various knobs that can be
used to tune the behaviour of the clients attached to it.
In addition, the memory controller implements an SMMU (IOMMU) which can
translate I/O virtual addresses to physical addresses for clients. This
is useful for scatter-gather operation on devices that don't support it
natively and for virtualization or process separation.
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
Changes in v3:
- add missing clocks and clock-names properties
- add example
.../memory-controllers/nvidia,tegra-mc.txt | 36 ++++++++++++++++++++++
1 file changed, 36 insertions(+)
create mode 100644 Documentation/devicetree/bindings/memory-controllers/nvidia,tegra-mc.txt
diff --git a/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra-mc.txt b/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra-mc.txt
new file mode 100644
index 000000000000..f3db93c85eea
--- /dev/null
+++ b/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra-mc.txt
@@ -0,0 +1,36 @@
+NVIDIA Tegra Memory Controller device tree bindings
+===================================================
+
+Required properties:
+- compatible: Should be "nvidia,tegra<chip>-mc"
+- reg: Physical base address and length of the controller's registers.
+- clocks: Must contain an entry for each entry in clock-names.
+ See ../clocks/clock-bindings.txt for details.
+- clock-names: Must include the following entries:
+ - mc: the module's clock input
+- interrupts: The interrupt outputs from the controller.
+- #iommu-cells: Should be 1. The single cell of the IOMMU specifier defines
+ the SWGROUP of the master.
+
+This device implements an IOMMU that complies with the generic IOMMU binding.
+See ../iommu/iommu.txt for details.
+
+Example:
+--------
+
+ mc: memory-controller at 0,70019000 {
+ compatible = "nvidia,tegra124-mc";
+ reg = <0x0 0x70019000 0x0 0x1000>;
+ clocks = <&tegra_car TEGRA124_CLK_MC>;
+ clock-names = "mc";
+
+ interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
+
+ #iommu-cells = <1>;
+ };
+
+ sdhci at 0,700b0000 {
+ compatible = "nvidia,tegra124-sdhci";
+ ...
+ iommus = <&mc TEGRA_SWGROUP_SDMMC1A>;
+ };
--
2.1.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v6 06/12] ARM: tegra: Add memory controller support for Tegra30
2014-11-07 16:00 [PATCH v6 00/12] NVIDIA Tegra memory controller and IOMMU support Thierry Reding
` (3 preceding siblings ...)
2014-11-07 16:00 ` [PATCH v6 04/12] of: Add NVIDIA Tegra memory controller binding Thierry Reding
@ 2014-11-07 16:00 ` Thierry Reding
2014-11-07 16:00 ` [PATCH v6 07/12] ARM: tegra: Add memory controller support for Tegra114 Thierry Reding
` (7 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: Thierry Reding @ 2014-11-07 16:00 UTC (permalink / raw)
To: linux-arm-kernel
From: Thierry Reding <treding@nvidia.com>
Collapses the old memory-controller and IOMMU device tree nodes into a
single node to more accurately describe the hardware.
While this is an incompatible change there are no users of the IOMMU on
Tegra, even though a driver has existed for some time.
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
arch/arm/boot/dts/tegra30.dtsi | 20 ++++++--------------
1 file changed, 6 insertions(+), 14 deletions(-)
diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi
index aa6ccea13d30..fa7e5b642434 100644
--- a/arch/arm/boot/dts/tegra30.dtsi
+++ b/arch/arm/boot/dts/tegra30.dtsi
@@ -623,23 +623,15 @@
clock-names = "pclk", "clk32k_in";
};
- memory-controller at 7000f000 {
+ mc: memory-controller at 7000f000 {
compatible = "nvidia,tegra30-mc";
- reg = <0x7000f000 0x010
- 0x7000f03c 0x1b4
- 0x7000f200 0x028
- 0x7000f284 0x17c>;
+ reg = <0x7000f000 0x400>;
+ clocks = <&tegra_car TEGRA30_CLK_MC>;
+ clock-names = "mc";
+
interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
- };
- iommu at 7000f010 {
- compatible = "nvidia,tegra30-smmu";
- reg = <0x7000f010 0x02c
- 0x7000f1f0 0x010
- 0x7000f228 0x05c>;
- nvidia,#asids = <4>; /* # of ASIDs */
- dma-window = <0 0x40000000>; /* IOVA start & length */
- nvidia,ahb = <&ahb>;
+ #iommu-cells = <1>;
};
fuse at 7000f800 {
--
2.1.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v6 07/12] ARM: tegra: Add memory controller support for Tegra114
2014-11-07 16:00 [PATCH v6 00/12] NVIDIA Tegra memory controller and IOMMU support Thierry Reding
` (4 preceding siblings ...)
2014-11-07 16:00 ` [PATCH v6 06/12] ARM: tegra: Add memory controller support for Tegra30 Thierry Reding
@ 2014-11-07 16:00 ` Thierry Reding
2014-11-07 16:00 ` [PATCH v6 08/12] ARM: tegra: Add memory controller support for Tegra124 Thierry Reding
` (6 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: Thierry Reding @ 2014-11-07 16:00 UTC (permalink / raw)
To: linux-arm-kernel
From: Thierry Reding <treding@nvidia.com>
Add the device tree node for the memory controller found on Tegra114
SoCs. The memory controller integrates an IOMMU (called SMMU) as well as
various knobs to tweak memory accesses by the various clients.
The old IOMMU device tree node is collapsed into the memory controller
node to more accurately describe the hardware. While this change is
incompatible, the IOMMU driver has never had any users so the change is
not going to cause any breakage.
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
arch/arm/boot/dts/tegra114.dtsi | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/arch/arm/boot/dts/tegra114.dtsi b/arch/arm/boot/dts/tegra114.dtsi
index 2ca9c1807f72..2c26b07c11ed 100644
--- a/arch/arm/boot/dts/tegra114.dtsi
+++ b/arch/arm/boot/dts/tegra114.dtsi
@@ -505,15 +505,15 @@
reset-names = "fuse";
};
- iommu at 70019010 {
- compatible = "nvidia,tegra114-smmu", "nvidia,tegra30-smmu";
- reg = <0x70019010 0x02c
- 0x700191f0 0x010
- 0x70019228 0x074>;
- nvidia,#asids = <4>;
- dma-window = <0 0x40000000>;
- nvidia,swgroups = <0x18659fe>;
- nvidia,ahb = <&ahb>;
+ mc: memory-controller at 70019000 {
+ compatible = "nvidia,tegra114-mc";
+ reg = <0x70019000 0x1000>;
+ clocks = <&tegra_car TEGRA114_CLK_MC>;
+ clock-names = "mc";
+
+ interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
+
+ #iommu-cells = <1>;
};
ahub at 70080000 {
--
2.1.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v6 08/12] ARM: tegra: Add memory controller support for Tegra124
2014-11-07 16:00 [PATCH v6 00/12] NVIDIA Tegra memory controller and IOMMU support Thierry Reding
` (5 preceding siblings ...)
2014-11-07 16:00 ` [PATCH v6 07/12] ARM: tegra: Add memory controller support for Tegra114 Thierry Reding
@ 2014-11-07 16:00 ` Thierry Reding
2014-11-07 16:01 ` [PATCH v6 09/12] ARM: tegra: Enable IOMMU for display controllers on Tegra30 Thierry Reding
` (5 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: Thierry Reding @ 2014-11-07 16:00 UTC (permalink / raw)
To: linux-arm-kernel
From: Thierry Reding <treding@nvidia.com>
Add the memory controller and wire up the interrupt that is used to
report errors. Provide a reference to the memory controller clock and
mark the device as being an IOMMU by adding an #iommu-cells property.
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
arch/arm/boot/dts/tegra124.dtsi | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/arch/arm/boot/dts/tegra124.dtsi b/arch/arm/boot/dts/tegra124.dtsi
index 478c555ebd96..afe9c6a34709 100644
--- a/arch/arm/boot/dts/tegra124.dtsi
+++ b/arch/arm/boot/dts/tegra124.dtsi
@@ -551,6 +551,17 @@
reset-names = "fuse";
};
+ mc: memory-controller at 0,70019000 {
+ compatible = "nvidia,tegra124-mc";
+ reg = <0x0 0x70019000 0x0 0x1000>;
+ clocks = <&tegra_car TEGRA124_CLK_MC>;
+ clock-names = "mc";
+
+ interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
+
+ #iommu-cells = <1>;
+ };
+
sata at 0,70020000 {
compatible = "nvidia,tegra124-ahci";
--
2.1.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v6 09/12] ARM: tegra: Enable IOMMU for display controllers on Tegra30
2014-11-07 16:00 [PATCH v6 00/12] NVIDIA Tegra memory controller and IOMMU support Thierry Reding
` (6 preceding siblings ...)
2014-11-07 16:00 ` [PATCH v6 08/12] ARM: tegra: Add memory controller support for Tegra124 Thierry Reding
@ 2014-11-07 16:01 ` Thierry Reding
2014-11-07 16:01 ` [PATCH v6 10/12] ARM: tegra: Enable IOMMU for display controllers on Tegra114 Thierry Reding
` (4 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: Thierry Reding @ 2014-11-07 16:01 UTC (permalink / raw)
To: linux-arm-kernel
From: Thierry Reding <treding@nvidia.com>
Add iommus properties to the device tree nodes for the two display
controllers found on Tegra30. This will allow the display controllers to
map physically non-contiguous buffers to I/O virtual contiguous address
spaces so that they can be used for scan-out.
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
arch/arm/boot/dts/tegra30.dtsi | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi
index fa7e5b642434..976eb9ba8659 100644
--- a/arch/arm/boot/dts/tegra30.dtsi
+++ b/arch/arm/boot/dts/tegra30.dtsi
@@ -1,5 +1,6 @@
#include <dt-bindings/clock/tegra30-car.h>
#include <dt-bindings/gpio/tegra-gpio.h>
+#include <dt-bindings/memory/tegra30-mc.h>
#include <dt-bindings/pinctrl/pinctrl-tegra.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
@@ -174,6 +175,8 @@
resets = <&tegra_car 27>;
reset-names = "dc";
+ iommus = <&mc TEGRA_SWGROUP_DC>;
+
nvidia,head = <0>;
rgb {
@@ -191,6 +194,8 @@
resets = <&tegra_car 26>;
reset-names = "dc";
+ iommus = <&mc TEGRA_SWGROUP_DCB>;
+
nvidia,head = <1>;
rgb {
--
2.1.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v6 10/12] ARM: tegra: Enable IOMMU for display controllers on Tegra114
2014-11-07 16:00 [PATCH v6 00/12] NVIDIA Tegra memory controller and IOMMU support Thierry Reding
` (7 preceding siblings ...)
2014-11-07 16:01 ` [PATCH v6 09/12] ARM: tegra: Enable IOMMU for display controllers on Tegra30 Thierry Reding
@ 2014-11-07 16:01 ` Thierry Reding
2014-11-07 16:01 ` [PATCH v6 11/12] ARM: tegra: Enable IOMMU for display controllers on Tegra124 Thierry Reding
` (3 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: Thierry Reding @ 2014-11-07 16:01 UTC (permalink / raw)
To: linux-arm-kernel
From: Thierry Reding <treding@nvidia.com>
Add iommus properties to the device tree nodes for the two display
controllers found on Tegra114. This will allow the display controllers
to map physically non-contiguous buffers to I/O virtual contiguous
address spaces so that they can be used for scan-out.
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
arch/arm/boot/dts/tegra114.dtsi | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/boot/dts/tegra114.dtsi b/arch/arm/boot/dts/tegra114.dtsi
index 2c26b07c11ed..c8c3b6438b4d 100644
--- a/arch/arm/boot/dts/tegra114.dtsi
+++ b/arch/arm/boot/dts/tegra114.dtsi
@@ -1,5 +1,6 @@
#include <dt-bindings/clock/tegra114-car.h>
#include <dt-bindings/gpio/tegra-gpio.h>
+#include <dt-bindings/memory/tegra114-mc.h>
#include <dt-bindings/pinctrl/pinctrl-tegra.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
@@ -57,6 +58,8 @@
resets = <&tegra_car 27>;
reset-names = "dc";
+ iommus = <&mc TEGRA_SWGROUP_DC>;
+
nvidia,head = <0>;
rgb {
@@ -74,6 +77,8 @@
resets = <&tegra_car 26>;
reset-names = "dc";
+ iommus = <&mc TEGRA_SWGROUP_DCB>;
+
nvidia,head = <1>;
rgb {
--
2.1.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v6 11/12] ARM: tegra: Enable IOMMU for display controllers on Tegra124
2014-11-07 16:00 [PATCH v6 00/12] NVIDIA Tegra memory controller and IOMMU support Thierry Reding
` (8 preceding siblings ...)
2014-11-07 16:01 ` [PATCH v6 10/12] ARM: tegra: Enable IOMMU for display controllers on Tegra114 Thierry Reding
@ 2014-11-07 16:01 ` Thierry Reding
2014-11-07 16:01 ` [PATCH v6 12/12] memory: tegra: Add Tegra132 support Thierry Reding
` (2 subsequent siblings)
12 siblings, 0 replies; 17+ messages in thread
From: Thierry Reding @ 2014-11-07 16:01 UTC (permalink / raw)
To: linux-arm-kernel
From: Thierry Reding <treding@nvidia.com>
Add iommus properties to the device tree nodes for the two display
controllers found on Tegra124. This will allow the display controllers
to map physically non-contiguous buffers to I/O virtual contiguous
address spaces so that they can be used for scan-out.
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
arch/arm/boot/dts/tegra124.dtsi | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/boot/dts/tegra124.dtsi b/arch/arm/boot/dts/tegra124.dtsi
index afe9c6a34709..652f595784e1 100644
--- a/arch/arm/boot/dts/tegra124.dtsi
+++ b/arch/arm/boot/dts/tegra124.dtsi
@@ -1,5 +1,6 @@
#include <dt-bindings/clock/tegra124-car.h>
#include <dt-bindings/gpio/tegra-gpio.h>
+#include <dt-bindings/memory/tegra124-mc.h>
#include <dt-bindings/pinctrl/pinctrl-tegra.h>
#include <dt-bindings/pinctrl/pinctrl-tegra-xusb.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
@@ -102,6 +103,8 @@
resets = <&tegra_car 27>;
reset-names = "dc";
+ iommus = <&mc TEGRA_SWGROUP_DC>;
+
nvidia,head = <0>;
};
@@ -115,6 +118,8 @@
resets = <&tegra_car 26>;
reset-names = "dc";
+ iommus = <&mc TEGRA_SWGROUP_DCB>;
+
nvidia,head = <1>;
};
--
2.1.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v6 12/12] memory: tegra: Add Tegra132 support
2014-11-07 16:00 [PATCH v6 00/12] NVIDIA Tegra memory controller and IOMMU support Thierry Reding
` (9 preceding siblings ...)
2014-11-07 16:01 ` [PATCH v6 11/12] ARM: tegra: Enable IOMMU for display controllers on Tegra124 Thierry Reding
@ 2014-11-07 16:01 ` Thierry Reding
2014-11-10 9:53 ` [PATCH v6 00/12] NVIDIA Tegra memory controller and IOMMU support Alexandre Courbot
[not found] ` <1415376063-17205-6-git-send-email-thierry.reding@gmail.com>
12 siblings, 0 replies; 17+ messages in thread
From: Thierry Reding @ 2014-11-07 16:01 UTC (permalink / raw)
To: linux-arm-kernel
From: Thierry Reding <treding@nvidia.com>
The memory controller on Tegra132 is very similar to the one found on
Tegra124. But the Denver CPUs don't have an outer cache, so dcache
maintenance is done slightly differently.
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
drivers/memory/tegra/Makefile | 1 +
drivers/memory/tegra/mc.c | 3 +++
drivers/memory/tegra/mc.h | 4 ++++
drivers/memory/tegra/tegra124.c | 33 +++++++++++++++++++++++++++++++++
4 files changed, 41 insertions(+)
diff --git a/drivers/memory/tegra/Makefile b/drivers/memory/tegra/Makefile
index b0732cc5686a..cdae9481c864 100644
--- a/drivers/memory/tegra/Makefile
+++ b/drivers/memory/tegra/Makefile
@@ -4,5 +4,6 @@ tegra-mc-$(CONFIG_TEGRA_IOMMU_SMMU) += smmu.o
tegra-mc-$(CONFIG_ARCH_TEGRA_3x_SOC) += tegra30.o
tegra-mc-$(CONFIG_ARCH_TEGRA_114_SOC) += tegra114.o
tegra-mc-$(CONFIG_ARCH_TEGRA_124_SOC) += tegra124.o
+tegra-mc-$(CONFIG_ARCH_TEGRA_132_SOC) += tegra124-mc.o
obj-$(CONFIG_TEGRA_MC) += tegra-mc.o
diff --git a/drivers/memory/tegra/mc.c b/drivers/memory/tegra/mc.c
index 359281def893..286b9c52e7fd 100644
--- a/drivers/memory/tegra/mc.c
+++ b/drivers/memory/tegra/mc.c
@@ -58,6 +58,9 @@ static const struct of_device_id tegra_mc_of_match[] = {
#ifdef CONFIG_ARCH_TEGRA_124_SOC
{ .compatible = "nvidia,tegra124-mc", .data = &tegra124_mc_soc },
#endif
+#ifdef CONFIG_ARCH_TEGRA_132_SOC
+ { .compatible = "nvidia,tegra132-mc", .data = &tegra132_mc_soc },
+#endif
{ }
};
diff --git a/drivers/memory/tegra/mc.h b/drivers/memory/tegra/mc.h
index 7cf7f5bb3cb3..8fabe993d51b 100644
--- a/drivers/memory/tegra/mc.h
+++ b/drivers/memory/tegra/mc.h
@@ -122,4 +122,8 @@ extern const struct tegra_mc_soc tegra114_mc_soc;
extern const struct tegra_mc_soc tegra124_mc_soc;
#endif
+#ifdef CONFIG_ARCH_TEGRA_132_SOC
+extern const struct tegra_mc_soc tegra132_mc_soc;
+#endif
+
#endif /* MEMORY_TEGRA_MC_H */
diff --git a/drivers/memory/tegra/tegra124.c b/drivers/memory/tegra/tegra124.c
index 278d40b854c1..ccd19d83ee91 100644
--- a/drivers/memory/tegra/tegra124.c
+++ b/drivers/memory/tegra/tegra124.c
@@ -993,3 +993,36 @@ const struct tegra_mc_soc tegra124_mc_soc = {
.smmu = &tegra124_smmu_soc,
};
#endif /* CONFIG_ARCH_TEGRA_124_SOC */
+
+#ifdef CONFIG_ARCH_TEGRA_132_SOC
+static void tegra132_flush_dcache(struct page *page, unsigned long offset,
+ size_t size)
+{
+ void *virt = page_address(page) + offset;
+
+ __flush_dcache_area(virt, size);
+}
+
+static const struct tegra_smmu_ops tegra132_smmu_ops = {
+ .flush_dcache = tegra132_flush_dcache,
+};
+
+static const struct tegra_smmu_soc tegra132_smmu_soc = {
+ .clients = tegra124_mc_clients,
+ .num_clients = ARRAY_SIZE(tegra124_mc_clients),
+ .swgroups = tegra124_swgroups,
+ .num_swgroups = ARRAY_SIZE(tegra124_swgroups),
+ .supports_round_robin_arbitration = true,
+ .supports_request_limit = true,
+ .num_asids = 128,
+ .ops = &tegra132_smmu_ops,
+};
+
+const struct tegra_mc_soc tegra132_mc_soc = {
+ .clients = tegra124_mc_clients,
+ .num_clients = ARRAY_SIZE(tegra124_mc_clients),
+ .num_address_bits = 34,
+ .atom_size = 32,
+ .smmu = &tegra132_smmu_soc,
+};
+#endif /* CONFIG_ARCH_TEGRA_132_SOC */
--
2.1.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v6 00/12] NVIDIA Tegra memory controller and IOMMU support
2014-11-07 16:00 [PATCH v6 00/12] NVIDIA Tegra memory controller and IOMMU support Thierry Reding
` (10 preceding siblings ...)
2014-11-07 16:01 ` [PATCH v6 12/12] memory: tegra: Add Tegra132 support Thierry Reding
@ 2014-11-10 9:53 ` Alexandre Courbot
[not found] ` <1415376063-17205-6-git-send-email-thierry.reding@gmail.com>
12 siblings, 0 replies; 17+ messages in thread
From: Alexandre Courbot @ 2014-11-10 9:53 UTC (permalink / raw)
To: linux-arm-kernel
On 11/08/2014 01:00 AM, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> This is the sixth installment in the Tegra IOMMU and memory controller
> support series. This version addresses the final outstanding comments from
> Olof about using proper Kconfig symbols to track the dependencies. It also
> splits up the driver into one part that implements the memory controller
> only and a second part that implements the SMMU. This plays nicely with
> the new Kconfig options introduced.
>
> Patch 1 is a preparatory patch that exposes the memory controller clock.
>
> Patches 2 and 3 is a pair of precursory patches needed to make this all
> work on 64-bit ARM in the future.
>
> The device tree binding for the Tegra memory controller is added in patch
> 4 and patch 5 is the bulk of the series that move the existing memory
> controller and IOMMU drivers into the new unified driver that supports
> Tegra30, Tegra114 and Tegra124.
>
> Patches 6, 7 and 8 add the DT nodes for the memory controller/IOMMU on
> Tegra30, Tegra114 and Tegra124.
>
> IOMMU support is enabled for the display controllers in patches 9, 10 and
> 11. This will allow the display controllers to have their memory accesses
> translated by the SMMU, which will enable non-contiguous buffers to be
> used for scan-out.
>
> Finally patch 12 also adds support for Tegra132. It is kept separate because
> none of the other Tegra132 patches have been merged yet, but I've included
> it here for completeness.
>
> Because the patches are rather intertwined, I'd like to merge them all via
> the Tegra tree. For that I'll need Acked-bys from Mike, Russell and Joerg
> on patches 1, 2 and 3, and 5, respectively.
FWIW,
Tested-by: Alexandre Courbot <acourbot@nvidia.com>
Works nicely with both the display and GPU clients, which allows us to
remove the need for CMA on Tegra.
Thanks,
Alex.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v6 05/12] memory: Add NVIDIA Tegra memory controller support
[not found] ` <1415376063-17205-6-git-send-email-thierry.reding@gmail.com>
@ 2014-11-12 14:21 ` Joerg Roedel
2014-11-12 14:47 ` Thierry Reding
0 siblings, 1 reply; 17+ messages in thread
From: Joerg Roedel @ 2014-11-12 14:21 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Nov 07, 2014 at 05:00:56PM +0100, Thierry Reding wrote:
> drivers/iommu/tegra-smmu.c | 1295 ------------------------------
> drivers/memory/tegra/smmu.c | 716 +++++++++++++++++
This new smmu.c is an IOMMU driver, why do you put it in drivers/memory
and not in drivers/iommu?
Joerg
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v6 05/12] memory: Add NVIDIA Tegra memory controller support
2014-11-12 14:21 ` [PATCH v6 05/12] memory: Add NVIDIA Tegra memory controller support Joerg Roedel
@ 2014-11-12 14:47 ` Thierry Reding
2014-11-12 15:02 ` Joerg Roedel
0 siblings, 1 reply; 17+ messages in thread
From: Thierry Reding @ 2014-11-12 14:47 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Nov 12, 2014 at 03:21:50PM +0100, Joerg Roedel wrote:
> On Fri, Nov 07, 2014 at 05:00:56PM +0100, Thierry Reding wrote:
> > drivers/iommu/tegra-smmu.c | 1295 ------------------------------
> > drivers/memory/tegra/smmu.c | 716 +++++++++++++++++
>
> This new smmu.c is an IOMMU driver, why do you put it in drivers/memory
> and not in drivers/iommu?
The SMMU is part of a larger IP block that's also a memory controller.
Having it in drivers/iommu would mean that we need to provide a
mechanism to synchronize between the two drivers. They also share a
number of data tables, so that would need to be shared somehow as well.
By keeping both in the same directory we don't have to expose any of
this publicly.
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141112/9b541f1f/attachment.sig>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v6 05/12] memory: Add NVIDIA Tegra memory controller support
2014-11-12 14:47 ` Thierry Reding
@ 2014-11-12 15:02 ` Joerg Roedel
2014-11-12 15:09 ` Thierry Reding
0 siblings, 1 reply; 17+ messages in thread
From: Joerg Roedel @ 2014-11-12 15:02 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Nov 12, 2014 at 03:47:16PM +0100, Thierry Reding wrote:
> The SMMU is part of a larger IP block that's also a memory controller.
> Having it in drivers/iommu would mean that we need to provide a
> mechanism to synchronize between the two drivers. They also share a
> number of data tables, so that would need to be shared somehow as well.
> By keeping both in the same directory we don't have to expose any of
> this publicly.
Since these parts are in different files you export the interfaces
anyway through non-static symbols and those dependencys also exist for
other IOMMU drivers. So I prefer this file to live in drivers/iommu.
Joerg
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v6 05/12] memory: Add NVIDIA Tegra memory controller support
2014-11-12 15:02 ` Joerg Roedel
@ 2014-11-12 15:09 ` Thierry Reding
0 siblings, 0 replies; 17+ messages in thread
From: Thierry Reding @ 2014-11-12 15:09 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Nov 12, 2014 at 04:02:34PM +0100, Joerg Roedel wrote:
> On Wed, Nov 12, 2014 at 03:47:16PM +0100, Thierry Reding wrote:
> > The SMMU is part of a larger IP block that's also a memory controller.
> > Having it in drivers/iommu would mean that we need to provide a
> > mechanism to synchronize between the two drivers. They also share a
> > number of data tables, so that would need to be shared somehow as well.
> > By keeping both in the same directory we don't have to expose any of
> > this publicly.
>
> Since these parts are in different files you export the interfaces
> anyway through non-static symbols and those dependencys also exist for
> other IOMMU drivers. So I prefer this file to live in drivers/iommu.
But we don't export symbols to the global symbol table since it's all
built as a single module. Moving one part to drivers/iommu will mean
that I need to provide a public header with the symbols. And I'd need
to actually EXPORT_SYMBOL them because technically there's nothing
preventing these drivers to be built as modules.
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141112/9fcf82a7/attachment.sig>
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2014-11-12 15:09 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-07 16:00 [PATCH v6 00/12] NVIDIA Tegra memory controller and IOMMU support Thierry Reding
2014-11-07 16:00 ` [PATCH v6 01/12] clk: tegra: Implement memory-controller clock Thierry Reding
2014-11-07 16:00 ` [PATCH v6 02/12] amba: Add Kconfig file Thierry Reding
2014-11-07 16:00 ` [PATCH v6 03/12] ARM: tegra: Move AHB Kconfig to drivers/amba Thierry Reding
2014-11-07 16:00 ` [PATCH v6 04/12] of: Add NVIDIA Tegra memory controller binding Thierry Reding
2014-11-07 16:00 ` [PATCH v6 06/12] ARM: tegra: Add memory controller support for Tegra30 Thierry Reding
2014-11-07 16:00 ` [PATCH v6 07/12] ARM: tegra: Add memory controller support for Tegra114 Thierry Reding
2014-11-07 16:00 ` [PATCH v6 08/12] ARM: tegra: Add memory controller support for Tegra124 Thierry Reding
2014-11-07 16:01 ` [PATCH v6 09/12] ARM: tegra: Enable IOMMU for display controllers on Tegra30 Thierry Reding
2014-11-07 16:01 ` [PATCH v6 10/12] ARM: tegra: Enable IOMMU for display controllers on Tegra114 Thierry Reding
2014-11-07 16:01 ` [PATCH v6 11/12] ARM: tegra: Enable IOMMU for display controllers on Tegra124 Thierry Reding
2014-11-07 16:01 ` [PATCH v6 12/12] memory: tegra: Add Tegra132 support Thierry Reding
2014-11-10 9:53 ` [PATCH v6 00/12] NVIDIA Tegra memory controller and IOMMU support Alexandre Courbot
[not found] ` <1415376063-17205-6-git-send-email-thierry.reding@gmail.com>
2014-11-12 14:21 ` [PATCH v6 05/12] memory: Add NVIDIA Tegra memory controller support Joerg Roedel
2014-11-12 14:47 ` Thierry Reding
2014-11-12 15:02 ` Joerg Roedel
2014-11-12 15:09 ` Thierry Reding
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).