diff mbox series

[v2,2/4] ARC: ARCv2: support loop buffer (LPB) disabling

Message ID 20200604173927.23127-3-Eugeniy.Paltsev@synopsys.com
State New
Headers show
Series ARC: [plat-hsdk-4xd] initial port for HSDK-4xD board | expand

Commit Message

Eugeniy Paltsev June 4, 2020, 5:39 p.m. UTC
On HS cores, loop buffer (LPB) is programmable in runtime and can
be optionally disabled.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
---
 arch/arc/Kconfig       | 6 ++++++
 arch/arc/kernel/head.S | 8 ++++++++
 2 files changed, 14 insertions(+)

Comments

Eugeniy Paltsev June 18, 2020, 7:50 p.m. UTC | #1
Hi Vineet,

could you also peek this patch to for-curr as we don't have any disagreement about it?

I'll respin the rest of the patches later. Thanks.
---
 Eugeniy Paltsev
Vineet Gupta June 18, 2020, 8 p.m. UTC | #2
On 6/18/20 12:50 PM, Eugeniy Paltsev wrote:
> Hi Vineet,
>
> could you also peek this patch to for-curr as we don't have any disagreement about it?
>
> I'll respin the rest of the patches later. Thanks.
> ---
>  Eugeniy Paltsev

Added !

-Vineet
diff mbox series

Patch

diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index 7034c217708f..2dc142c8e1f5 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -473,6 +473,12 @@  config ARC_IRQ_NO_AUTOSAVE
 	  This is programmable and can be optionally disabled in which case
 	  software INTERRUPT_PROLOGUE/EPILGUE do the needed work
 
+config ARC_LPB_DISABLE
+	bool "Disable loop buffer (LPB)"
+	help
+	  On HS cores, loop buffer (LPB) is programmable in runtime and can
+	  be optionally disabled.
+
 endif # ISA_ARCV2
 
 endmenu   # "ARC CPU Configuration"
diff --git a/arch/arc/kernel/head.S b/arch/arc/kernel/head.S
index 6eb23f1545ee..17fd1ed700cc 100644
--- a/arch/arc/kernel/head.S
+++ b/arch/arc/kernel/head.S
@@ -59,6 +59,14 @@ 
 	bclr	r5, r5, STATUS_AD_BIT
 #endif
 	kflag	r5
+
+#ifdef CONFIG_ARC_LPB_DISABLE
+	lr	r5, [ARC_REG_LPB_BUILD]
+	breq    r5, 0, 1f		; LPB doesn't exist
+	mov	r5, 1
+	sr	r5, [ARC_REG_LPB_CTRL]
+1:
+#endif /* CONFIG_ARC_LPB_DISABLE */
 #endif
 	; Config DSP_CTRL properly, so kernel may use integer multiply,
 	; multiply-accumulate, and divide operations