[PATCH 1/2] riscv: Move vendor errata definitions into vendorid_list.h

guoren@kernel.org posted 2 patches 1 year ago
[PATCH 1/2] riscv: Move vendor errata definitions into vendorid_list.h
Posted by guoren@kernel.org 1 year ago
From: Guo Ren <guoren@linux.alibaba.com>

Move vendor errata definitions into vendorid_list and make it re-useable
for other header files.

Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Signed-off-by: Guo Ren <guoren@kernel.org>
---
 arch/riscv/include/asm/errata_list.h   | 17 -----------------
 arch/riscv/include/asm/vendorid_list.h | 17 +++++++++++++++++
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/arch/riscv/include/asm/errata_list.h b/arch/riscv/include/asm/errata_list.h
index 7c8a71a526a3..589a3ebe2ae2 100644
--- a/arch/riscv/include/asm/errata_list.h
+++ b/arch/riscv/include/asm/errata_list.h
@@ -11,23 +11,6 @@
 #include <asm/hwcap.h>
 #include <asm/vendorid_list.h>
 
-#ifdef CONFIG_ERRATA_ANDES
-#define ERRATA_ANDES_NO_IOCP 0
-#define ERRATA_ANDES_NUMBER 1
-#endif
-
-#ifdef CONFIG_ERRATA_SIFIVE
-#define	ERRATA_SIFIVE_CIP_453 0
-#define	ERRATA_SIFIVE_CIP_1200 1
-#define	ERRATA_SIFIVE_NUMBER 2
-#endif
-
-#ifdef CONFIG_ERRATA_THEAD
-#define	ERRATA_THEAD_MAE 0
-#define	ERRATA_THEAD_PMU 1
-#define	ERRATA_THEAD_NUMBER 2
-#endif
-
 #ifdef __ASSEMBLY__
 
 #define ALT_INSN_FAULT(x)						\
diff --git a/arch/riscv/include/asm/vendorid_list.h b/arch/riscv/include/asm/vendorid_list.h
index 2f2bb0c84f9a..7a387368633a 100644
--- a/arch/riscv/include/asm/vendorid_list.h
+++ b/arch/riscv/include/asm/vendorid_list.h
@@ -9,4 +9,21 @@
 #define SIFIVE_VENDOR_ID	0x489
 #define THEAD_VENDOR_ID		0x5b7
 
+#ifdef CONFIG_ERRATA_ANDES
+#define ERRATA_ANDES_NO_IOCP 0
+#define ERRATA_ANDES_NUMBER 1
+#endif
+
+#ifdef CONFIG_ERRATA_SIFIVE
+#define	ERRATA_SIFIVE_CIP_453 0
+#define	ERRATA_SIFIVE_CIP_1200 1
+#define	ERRATA_SIFIVE_NUMBER 2
+#endif
+
+#ifdef CONFIG_ERRATA_THEAD
+#define	ERRATA_THEAD_MAE 0
+#define	ERRATA_THEAD_PMU 1
+#define	ERRATA_THEAD_NUMBER 2
+#endif
+
 #endif
-- 
2.40.1
Re: [PATCH 1/2] riscv: Move vendor errata definitions into vendorid_list.h
Posted by Charlie Jenkins 11 months ago
On Sat, Dec 14, 2024 at 09:30:38AM -0500, guoren@kernel.org wrote:
> From: Guo Ren <guoren@linux.alibaba.com>
> 
> Move vendor errata definitions into vendorid_list and make it re-useable
> for other header files.

Why can't errata_list.h be included wherever the errata definitions are
needed?

- Charlie
Re: [PATCH 1/2] riscv: Move vendor errata definitions into vendorid_list.h
Posted by Guo Ren 11 months ago
On Sat, Jan 18, 2025 at 4:27 AM Charlie Jenkins <charlie@rivosinc.com> wrote:
>
> On Sat, Dec 14, 2024 at 09:30:38AM -0500, guoren@kernel.org wrote:
> > From: Guo Ren <guoren@linux.alibaba.com>
> >
> > Move vendor errata definitions into vendorid_list and make it re-useable
> > for other header files.
>
> Why can't errata_list.h be included wherever the errata definitions are
> needed?
errata_list.h can't be included in rwonce.h.

>
> - Charlie
>


-- 
Best Regards
 Guo Ren
Re: [PATCH 1/2] riscv: Move vendor errata definitions into vendorid_list.h
Posted by Alexandre Ghiti 9 months, 3 weeks ago
Hi Guo,

On 18/01/2025 04:46, Guo Ren wrote:
> On Sat, Jan 18, 2025 at 4:27 AM Charlie Jenkins <charlie@rivosinc.com> wrote:
>> On Sat, Dec 14, 2024 at 09:30:38AM -0500, guoren@kernel.org wrote:
>>> From: Guo Ren <guoren@linux.alibaba.com>
>>>
>>> Move vendor errata definitions into vendorid_list and make it re-useable
>>> for other header files.
>> Why can't errata_list.h be included wherever the errata definitions are
>> needed?
> errata_list.h can't be included in rwonce.h.


vendorid_list.h does not seem appropriate, I think the best solution 
would be to fix the header issue and if not simply possible, introduce a 
new header.

Thanks,

Alex


>
>> - Charlie
>>
>