Skip to contentSkip to conversation

ARM: socfpga: Configure PL310 latencies

PATCH New Marek Vasut 3 participants 8 messages Feb 19, 2019 – Mar 1, 2019

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

PATCH 1/1 ARM: socfpga: Configure PL310 latencies

Configure the PL310 tag and data latency registers, which slightly improves performance and aligns the behavior with Linux.

Cc Dalon Westergreen <[email protected]>
Cc Dinh Nguyen <[email protected]>
---
 arch/arm/mach-socfpga/misc.c | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach-socfpga/misc.c +3 -0
index 78fbe28724..1ea4e32c11 100644
@@ -62,6 +62,9 @@ void v7_outer_cache_enable(void)
 	/* Disable the L2 cache */
 	clrbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
 
+	writel(0x111, &pl310->pl310_tag_latency_ctrl);
+	writel(0x121, &pl310->pl310_data_latency_ctrl);
+
 	/* enable BRESP, instruction and data prefetch, full line of zeroes */
 	setbits_le32(&pl310->pl310_aux_ctrl,
 		     L310_AUX_CTRL_DATA_PREFETCH_MASK |
Signature · 1 line
2.19.2
#1 lore raw

PATCH 1/1 ARM: socfpga: Configure PL310 latencies

Quoted 16 lines · Marek Vasut

Configure the PL310 tag and data latency registers, which slightly improves performance and aligns the behavior with Linux.

Cc Dalon Westergreen <[email protected]>
Cc Dinh Nguyen <[email protected]>
---
 arch/arm/mach-socfpga/misc.c | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach-socfpga/misc.c +0 -0
index 78fbe28724..1ea4e32c11 100644

arch/arm/mach-socfpga/misc.c void v7_outer_cache_enable(void) · line 66

Quoted 5 lines
arch/arm/mach-socfpga/misc.c +2 -0
@@ -62,6 +62,9 @@ void v7_outer_cache_enable(void)
        /* Disable the L2 cache */
        clrbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
 
+       writel(0x111, &pl310->pl310_tag_latency_ctrl);
+       writel(0x121, &pl310->pl310_data_latency_ctrl);

Would it make sense to add defines as named constants for this? OTOH, in Linux, the values in the devicetree aren't really described, either, so:

Regards,
Simon

Quoted 6 lines
arch/arm/mach-socfpga/misc.c +1 -1
+
        /* enable BRESP, instruction and data prefetch, full line of zeroes */
        setbits_le32(&pl310->pl310_aux_ctrl,
                     L310_AUX_CTRL_DATA_PREFETCH_MASK |
--

2.19.2

maintainer
#2 lore raw

PATCH 1/1 ARM: socfpga: Configure PL310 latencies

Hi Marek,

Quoted 20 lines · Simon Goldschmidt
Quoted 19 lines · Marek Vasut

Configure the PL310 tag and data latency registers, which slightly improves performance and aligns the behavior with Linux.

Cc Dalon Westergreen <[email protected]>
Cc Dinh Nguyen <[email protected]>
---
 arch/arm/mach-socfpga/misc.c | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach-socfpga/misc.c +0 -0
index 78fbe28724..1ea4e32c11 100644
@@ -62,6 +62,9 @@ void v7_outer_cache_enable(void)
        /* Disable the L2 cache */
        clrbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
 
Quoted 6 lines

arch/arm/mach-socfpga/misc.c void v7_outer_cache_enable(void) · line 66

Quoted 2 lines
arch/arm/mach-socfpga/misc.c +2 -0
+       writel(0x111, &pl310->pl310_tag_latency_ctrl);
+       writel(0x121, &pl310->pl310_data_latency_ctrl);

Would it make sense to add defines as named constants for this? OTOH, in Linux, the values in the devicetree aren't really described, either, so:

I was thinking the same, so I'm working on a patch to get these values from the device tree.

So while I was doing that, I realized that this patch is wrong.

The patch should be like this:

	writel(0x0, &pl310->pl310_tag_latency_ctrl);
	writel(0x010, &pl310->pl310_data_latency_ctrl);

The reason is for the latency values:

000 = 1 cycle of latency, there is no additional latency. 001 = 2 cycles of latency.
010 = 3 cycles of latency.
011 = 4 cycles of latency.
100 = 5 cycles of latency.
101 = 6 cycles of latency.
110 = 7 cycles of latency.
111 = 8 cycles of latency.

So from the values in the device tree, they should be n-1.

It looks like you've already sent the patch to Tom. I'll send a follow up patch to fix that when it lands.

Dinh

#3 lore raw

PATCH 1/1 ARM: socfpga: Configure PL310 latencies

Quoted 51 lines · Dinh Nguyen

Hi Marek,

Quoted 20 lines · Simon Goldschmidt
Quoted 19 lines · Marek Vasut

Configure the PL310 tag and data latency registers, which slightly improves performance and aligns the behavior with Linux.

Cc Dalon Westergreen <[email protected]>
Cc Dinh Nguyen <[email protected]>
---
 arch/arm/mach-socfpga/misc.c | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach-socfpga/misc.c +0 -0
index 78fbe28724..1ea4e32c11 100644
@@ -62,6 +62,9 @@ void v7_outer_cache_enable(void)
        /* Disable the L2 cache */
        clrbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
 
Quoted 6 lines

arch/arm/mach-socfpga/misc.c void v7_outer_cache_enable(void) · line 66

Quoted 2 lines
arch/arm/mach-socfpga/misc.c +2 -0
+       writel(0x111, &pl310->pl310_tag_latency_ctrl);
+       writel(0x121, &pl310->pl310_data_latency_ctrl);

Would it make sense to add defines as named constants for this? OTOH, in Linux, the values in the devicetree aren't really described, either, so:

I was thinking the same, so I'm working on a patch to get these values from the device tree.

So while I was doing that, I realized that this patch is wrong.

The patch should be like this:

	writel(0x0, &pl310->pl310_tag_latency_ctrl);
	writel(0x010, &pl310->pl310_data_latency_ctrl);

The reason is for the latency values:

000 = 1 cycle of latency, there is no additional latency. 001 = 2 cycles of latency.
010 = 3 cycles of latency.
011 = 4 cycles of latency.
100 = 5 cycles of latency.
101 = 6 cycles of latency.
110 = 7 cycles of latency.
111 = 8 cycles of latency.

Quoted 4 lines

So from the values in the device tree, they should be n-1.

It looks like you've already sent the patch to Tom. I'll send a follow up patch to fix that when it lands.

Drat, thanks.

Better yet, pull the latency config into a function, so it can be used by other platforms. The prototype should take 7 parameters, address and latency in cycles, so that it shields the users from this n-1 stuff.

Signature · 2 lines
Best regards,
Marek Vasut
maintainer
#4 lore raw

PATCH 1/1 ARM: socfpga: Configure PL310 latencies

Quoted 54 lines · Marek Vasut
Quoted 53 lines · Dinh Nguyen

Hi Marek,

Quoted 20 lines · Simon Goldschmidt
Quoted 19 lines · Marek Vasut

Configure the PL310 tag and data latency registers, which slightly improves performance and aligns the behavior with Linux.

Cc Dalon Westergreen <[email protected]>
Cc Dinh Nguyen <[email protected]>
---
 arch/arm/mach-socfpga/misc.c | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach-socfpga/misc.c +0 -0
index 78fbe28724..1ea4e32c11 100644
@@ -62,6 +62,9 @@ void v7_outer_cache_enable(void)
        /* Disable the L2 cache */
        clrbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
 
Quoted 6 lines

arch/arm/mach-socfpga/misc.c void v7_outer_cache_enable(void) · line 66

Quoted 2 lines
arch/arm/mach-socfpga/misc.c +2 -0
+       writel(0x111, &pl310->pl310_tag_latency_ctrl);
+       writel(0x121, &pl310->pl310_data_latency_ctrl);

Would it make sense to add defines as named constants for this? OTOH, in Linux, the values in the devicetree aren't really described, either, so:

I was thinking the same, so I'm working on a patch to get these values from the device tree.

So while I was doing that, I realized that this patch is wrong.

The patch should be like this:

	writel(0x0, &pl310->pl310_tag_latency_ctrl);
	writel(0x010, &pl310->pl310_data_latency_ctrl);

The reason is for the latency values:

000 = 1 cycle of latency, there is no additional latency. 001 = 2 cycles of latency.
010 = 3 cycles of latency.
011 = 4 cycles of latency.
100 = 5 cycles of latency.
101 = 6 cycles of latency.
110 = 7 cycles of latency.
111 = 8 cycles of latency.

So from the values in the device tree, they should be n-1.

Quoted 9 lines
Quoted 2 lines

It looks like you've already sent the patch to Tom. I'll send a follow up patch to fix that when it lands.

Drat, thanks.

Better yet, pull the latency config into a function, so it can be used by other platforms. The prototype should take 7 parameters, address and latency in cycles, so that it shields the users from this n-1 stuff.

Agreed. I'm working on an RFC patch that creates a UBOOT_MISC driver to handle all of the pl310 settings. Hope to send it out sometime next week.

Dinh

#5 lore raw

PATCH 1/1 ARM: socfpga: Configure PL310 latencies

Quoted 62 lines · Dinh Nguyen
Quoted 59 lines · Marek Vasut
Quoted 51 lines · Dinh Nguyen

Hi Marek,

Quoted 20 lines · Simon Goldschmidt
Quoted 19 lines · Marek Vasut

Configure the PL310 tag and data latency registers, which slightly improves performance and aligns the behavior with Linux.

Cc Dalon Westergreen <[email protected]>
Cc Dinh Nguyen <[email protected]>
---
 arch/arm/mach-socfpga/misc.c | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach-socfpga/misc.c +0 -0
index 78fbe28724..1ea4e32c11 100644
@@ -62,6 +62,9 @@ void v7_outer_cache_enable(void)
        /* Disable the L2 cache */
        clrbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
 
Quoted 6 lines

arch/arm/mach-socfpga/misc.c void v7_outer_cache_enable(void) · line 66

Quoted 2 lines
arch/arm/mach-socfpga/misc.c +2 -0
+       writel(0x111, &pl310->pl310_tag_latency_ctrl);
+       writel(0x121, &pl310->pl310_data_latency_ctrl);

Would it make sense to add defines as named constants for this? OTOH, in Linux, the values in the devicetree aren't really described, either, so:

I was thinking the same, so I'm working on a patch to get these values from the device tree.

So while I was doing that, I realized that this patch is wrong.

The patch should be like this:

	writel(0x0, &pl310->pl310_tag_latency_ctrl);
	writel(0x010, &pl310->pl310_data_latency_ctrl);

The reason is for the latency values:

000 = 1 cycle of latency, there is no additional latency. 001 = 2 cycles of latency.
010 = 3 cycles of latency.
011 = 4 cycles of latency.
100 = 5 cycles of latency.
101 = 6 cycles of latency.
110 = 7 cycles of latency.
111 = 8 cycles of latency.

Quoted 4 lines

So from the values in the device tree, they should be n-1.

It looks like you've already sent the patch to Tom. I'll send a follow up patch to fix that when it lands.

Drat, thanks.

Quoted 7 lines
Quoted 4 lines

Better yet, pull the latency config into a function, so it can be used by other platforms. The prototype should take 7 parameters, address and latency in cycles, so that it shields the users from this n-1 stuff.

Agreed. I'm working on an RFC patch that creates a UBOOT_MISC driver to handle all of the pl310 settings. Hope to send it out sometime next week.

I'd like a simpler fix for this release if possible, and a subsequent patch for the DM conversion.

Signature · 2 lines
Best regards,
Marek Vasut
maintainer
#6 lore raw

PATCH 1/1 ARM: socfpga: Configure PL310 latencies

Quoted 68 lines · Marek Vasut
Quoted 67 lines · Dinh Nguyen
Quoted 63 lines · Marek Vasut
Quoted 51 lines · Dinh Nguyen

Hi Marek,

Quoted 20 lines · Simon Goldschmidt
Quoted 19 lines · Marek Vasut

Configure the PL310 tag and data latency registers, which slightly improves performance and aligns the behavior with Linux.

Cc Dalon Westergreen <[email protected]>
Cc Dinh Nguyen <[email protected]>
---
 arch/arm/mach-socfpga/misc.c | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach-socfpga/misc.c +0 -0
index 78fbe28724..1ea4e32c11 100644
@@ -62,6 +62,9 @@ void v7_outer_cache_enable(void)
        /* Disable the L2 cache */
        clrbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
 
Quoted 6 lines

arch/arm/mach-socfpga/misc.c void v7_outer_cache_enable(void) · line 66

Quoted 2 lines
arch/arm/mach-socfpga/misc.c +2 -0
+       writel(0x111, &pl310->pl310_tag_latency_ctrl);
+       writel(0x121, &pl310->pl310_data_latency_ctrl);

Would it make sense to add defines as named constants for this? OTOH, in Linux, the values in the devicetree aren't really described, either, so:

I was thinking the same, so I'm working on a patch to get these values from the device tree.

So while I was doing that, I realized that this patch is wrong.

The patch should be like this:

	writel(0x0, &pl310->pl310_tag_latency_ctrl);
	writel(0x010, &pl310->pl310_data_latency_ctrl);

The reason is for the latency values:

000 = 1 cycle of latency, there is no additional latency. 001 = 2 cycles of latency.
010 = 3 cycles of latency.
011 = 4 cycles of latency.
100 = 5 cycles of latency.
101 = 6 cycles of latency.
110 = 7 cycles of latency.
111 = 8 cycles of latency.

Quoted 4 lines

So from the values in the device tree, they should be n-1.

It looks like you've already sent the patch to Tom. I'll send a follow up patch to fix that when it lands.

Drat, thanks.

Better yet, pull the latency config into a function, so it can be used by other platforms. The prototype should take 7 parameters, address and latency in cycles, so that it shields the users from this n-1 stuff.

Quoted 6 lines
Quoted 2 lines

Agreed. I'm working on an RFC patch that creates a UBOOT_MISC driver to handle all of the pl310 settings. Hope to send it out sometime next week.

I'd like a simpler fix for this release if possible, and a subsequent patch for the DM conversion.

ok..

Dinh

maintainer
#7 lore raw

PATCH 1/1 ARM: socfpga: Configure PL310 latencies

In reply to Marek Vasut
Quoted 10 lines · Marek Vasut

Configure the PL310 tag and data latency registers, which slightly improves performance and aligns the behavior with Linux.

Cc Dalon Westergreen <[email protected]>
Cc Dinh Nguyen <[email protected]>
---
 arch/arm/mach-socfpga/misc.c | 3 +++
 1 file changed, 3 insertions(+)

Looks good!