Skip to contentSkip to conversation

arm: socfpga: Enable Stratix10 SMMU access

PATCH New thor.thayer at linux.intel.com 3 participants 6 messages Nov 15, 2019 – Nov 18, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: socfpga: Enable Stratix10 SMMU access

From: Thor Thayer <[email protected]>

Enable TCU access through the Stratix10 CCU so that the SMMU can access the SDRAM.

---

 arch/arm/mach-socfpga/include/mach/firewall_s10.h |  7 +++++++
 drivers/ddr/altera/sdram_s10.c                    | 14 ++++++++++++++
 2 files changed, 21 insertions(+)
arch/arm/mach-socfpga/include/mach/firewall_s10.h +7 -0
index b96f779f1487..d698e4b9e2a1 100644
@@ -95,6 +95,13 @@ struct socfpga_firwall_l4_sys {
 
 #define CCU_IOM_MPRT_ADMASK_MEM_RAM0		0x18628
 
+#define CCU_TCU_MPRT_ADBASE_MEMSPACE0		0x2c520
+#define CCU_TCU_MPRT_ADBASE_MEMSPACE1A		0x2c540
+#define CCU_TCU_MPRT_ADBASE_MEMSPACE1B		0x2c560
+#define CCU_TCU_MPRT_ADBASE_MEMSPACE1C		0x2c580
+#define CCU_TCU_MPRT_ADBASE_MEMSPACE1D		0x2c5a0
+#define CCU_TCU_MPRT_ADBASE_MEMSPACE1E		0x2c5c0
+
 #define CCU_ADMASK_P_MASK			BIT(0)
 #define CCU_ADMASK_NS_MASK			BIT(1)
 
drivers/ddr/altera/sdram_s10.c +14 -0
index 56cbbac9fe1f..bc027c478452 100644
@@ -323,6 +323,20 @@ static int sdram_mmr_init_full(struct udevice *dev)
 	clrbits_le32(CCU_REG_ADDR(CCU_IOM_MPRT_ADBASE_MEMSPACE1E),
 		     CCU_ADBASE_DI_MASK);
 
+	/* Enable access to DDR from TCU */
+	clrbits_le32(CCU_REG_ADDR(CCU_TCU_MPRT_ADBASE_MEMSPACE0),
+		     CCU_ADBASE_DI_MASK);
+	clrbits_le32(CCU_REG_ADDR(CCU_TCU_MPRT_ADBASE_MEMSPACE1A),
+		     CCU_ADBASE_DI_MASK);
+	clrbits_le32(CCU_REG_ADDR(CCU_TCU_MPRT_ADBASE_MEMSPACE1B),
+		     CCU_ADBASE_DI_MASK);
+	clrbits_le32(CCU_REG_ADDR(CCU_TCU_MPRT_ADBASE_MEMSPACE1C),
+		     CCU_ADBASE_DI_MASK);
+	clrbits_le32(CCU_REG_ADDR(CCU_TCU_MPRT_ADBASE_MEMSPACE1D),
+		     CCU_ADBASE_DI_MASK);
+	clrbits_le32(CCU_REG_ADDR(CCU_TCU_MPRT_ADBASE_MEMSPACE1E),
+		     CCU_ADBASE_DI_MASK);
+
 	/* this enables nonsecure access to DDR */
 	/* mpuregion0addr_limit */
 	FW_MPU_DDR_SCR_WRITEL(0xFFFF0000, FW_MPU_DDR_SCR_MPUREGION0ADDR_LIMIT);
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 arm: socfpga: Enable Stratix10 SMMU access

Quoted 4 lines · Thor Thayer

Enable TCU access through the Stratix10 CCU so that the SMMU can access the SDRAM.

[...]

Looks good to me. Ley, can you take a look?
Thanks!

#2 lore raw

PATCH 1/1 arm: socfpga: Enable Stratix10 SMMU access

Quoted 15 lines

-----Original Message-----
From: Marek Vasut <[email protected]>
Sent: Saturday, November 16, 2019 7:10 PM
To: thor.thayer at linux.intel.com; Simon Goldschmidt <[email protected]>
Cc: u-boot at lists.denx.de; Albert Aribaud <[email protected]>; Tan, Ley Foon <[email protected]>; Dinh Nguyen <[email protected]>; Tom Rini <[email protected]>; Westergreen, Dalon <[email protected]>
Subject: Re: [PATCH v1] arm: socfpga: Enable Stratix10 SMMU access

Quoted 1 line · Thor Thayer
Quoted 8 lines
Quoted 3 lines

Enable TCU access through the Stratix10 CCU so that the SMMU can access the SDRAM.

[...]

Looks good to me. Ley, can you take a look?
Thanks!

Looks good to me too.
But, if this patch plan to apply after Agilex patch series, then need to rebase on top of it.

#3 lore raw

PATCH 1/1 arm: socfpga: Enable Stratix10 SMMU access

On 11/18/19 3:46 AM, Tan, Ley Foon wrote:
[...]

Quoted 7 lines
Quoted 7 lines · Thor Thayer
Quoted 4 lines

Enable TCU access through the Stratix10 CCU so that the SMMU can access the SDRAM.

Quoted 6 lines
Quoted 4 lines

[...]

Looks good to me. Ley, can you take a look?
Thanks!

Looks good to me too.
But, if this patch plan to apply after Agilex patch series, then need to rebase on top of it.

Is this a fix or a feature ?

#4 lore raw

PATCH 1/1 arm: socfpga: Enable Stratix10 SMMU access

Quoted 10 lines · Marek Vasut

On 11/18/19 3:46 AM, Tan, Ley Foon wrote:
[...]

Quoted 7 lines
Quoted 7 lines · Thor Thayer
Quoted 4 lines

Enable TCU access through the Stratix10 CCU so that the SMMU can access the SDRAM.

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines

[...]

Looks good to me. Ley, can you take a look?
Thanks!

Looks good to me too.
But, if this patch plan to apply after Agilex patch series, then need to rebase on top of it.

Is this a fix or a feature ?

This is a feature.

I didn't realize there was a refactoring. I will coordinate with Ley Foon. Thanks.

#5 lore raw

PATCH 1/1 arm: socfpga: Enable Stratix10 SMMU access

Quoted 19 lines · Thor Thayer
Quoted 18 lines · Marek Vasut

On 11/18/19 3:46 AM, Tan, Ley Foon wrote:
[...]

Quoted 14 lines
Quoted 11 lines · Thor Thayer
Quoted 4 lines

Enable TCU access through the Stratix10 CCU so that the SMMU can access the SDRAM.

[...]

Looks good to me. Ley, can you take a look?
Thanks!

Looks good to me too.
But, if this patch plan to apply after Agilex patch series, then need to rebase on top of it.

Quoted 6 lines
Quoted 2 lines

Is this a fix or a feature ?

This is a feature.

I didn't realize there was a refactoring. I will coordinate with Ley Foon. Thanks.

OK, sounds good, thanks.