-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
riscv: Add thead and xtheadvector as a vendor extension
Add support to the kernel for THead vendor extensions with the target of the new extension xtheadvector. Signed-off-by: Charlie Jenkins <charlie@rivosinc.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Tested-by: Yangyu Chen <cyy@cyyself.name> Link: https://lore.kernel.org/r/20241113-xtheadvector-v11-4-236c22791ef9@rivosinc.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
- Loading branch information
Charlie Jenkins
authored and
Palmer Dabbelt
committed
Jan 18, 2025
1 parent
ce1daee
commit cddd638
Showing
6 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
#ifndef _ASM_RISCV_VENDOR_EXTENSIONS_THEAD_H | ||
#define _ASM_RISCV_VENDOR_EXTENSIONS_THEAD_H | ||
|
||
#include <asm/vendor_extensions.h> | ||
|
||
#include <linux/types.h> | ||
|
||
/* | ||
* Extension keys must be strictly less than RISCV_ISA_VENDOR_EXT_MAX. | ||
*/ | ||
#define RISCV_ISA_VENDOR_EXT_XTHEADVECTOR 0 | ||
|
||
extern struct riscv_isa_vendor_ext_data_list riscv_isa_vendor_ext_list_thead; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# SPDX-License-Identifier: GPL-2.0-only | ||
|
||
obj-$(CONFIG_RISCV_ISA_VENDOR_EXT_ANDES) += andes.o | ||
obj-$(CONFIG_RISCV_ISA_VENDOR_EXT_THEAD) += thead.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
|
||
#include <asm/cpufeature.h> | ||
#include <asm/vendor_extensions.h> | ||
#include <asm/vendor_extensions/thead.h> | ||
|
||
#include <linux/array_size.h> | ||
#include <linux/types.h> | ||
|
||
/* All T-Head vendor extensions supported in Linux */ | ||
static const struct riscv_isa_ext_data riscv_isa_vendor_ext_thead[] = { | ||
__RISCV_ISA_EXT_DATA(xtheadvector, RISCV_ISA_VENDOR_EXT_XTHEADVECTOR), | ||
}; | ||
|
||
struct riscv_isa_vendor_ext_data_list riscv_isa_vendor_ext_list_thead = { | ||
.ext_data_count = ARRAY_SIZE(riscv_isa_vendor_ext_thead), | ||
.ext_data = riscv_isa_vendor_ext_thead, | ||
}; |