xref: /OK3568_Linux_fs/buildroot/arch/Config.in.riscv (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1# RISC-V CPU ISA extensions.
2
3config BR2_RISCV_ISA_RVI
4	bool
5
6config BR2_RISCV_ISA_RVM
7	bool
8
9config BR2_RISCV_ISA_RVA
10	bool
11
12config BR2_RISCV_ISA_RVF
13	bool
14
15config BR2_RISCV_ISA_RVD
16	bool
17
18config BR2_RISCV_ISA_RVC
19	bool
20
21choice
22	prompt "Target Architecture Variant"
23	default BR2_riscv_g
24
25config BR2_riscv_g
26	bool "General purpose (G)"
27	select BR2_RISCV_ISA_RVI
28	select BR2_RISCV_ISA_RVM
29	select BR2_RISCV_ISA_RVA
30	select BR2_RISCV_ISA_RVF
31	select BR2_RISCV_ISA_RVD
32	help
33	  General purpose (G) is equivalent to IMAFD.
34
35config BR2_riscv_custom
36	bool "Custom architecture"
37	select BR2_RISCV_ISA_RVI
38	select BR2_RISCV_ISA_CUSTOM_RVA
39
40endchoice
41
42if BR2_riscv_custom
43
44comment "Instruction Set Extensions"
45
46config BR2_RISCV_ISA_CUSTOM_RVM
47	bool "Integer Multiplication and Division (M)"
48	select BR2_RISCV_ISA_RVM
49
50config BR2_RISCV_ISA_CUSTOM_RVA
51	bool "Atomic Instructions (A)"
52	select BR2_RISCV_ISA_RVA
53
54config BR2_RISCV_ISA_CUSTOM_RVF
55	bool "Single-precision Floating-point (F)"
56	select BR2_RISCV_ISA_RVF
57
58config BR2_RISCV_ISA_CUSTOM_RVD
59	bool "Double-precision Floating-point (D)"
60	depends on BR2_RISCV_ISA_RVF
61	select BR2_RISCV_ISA_RVD
62
63config BR2_RISCV_ISA_CUSTOM_RVC
64	bool "Compressed Instructions (C)"
65	select BR2_RISCV_ISA_RVC
66endif
67
68choice
69	prompt "Target Architecture Size"
70	default BR2_RISCV_64
71
72config BR2_RISCV_32
73	bool "32-bit"
74	select BR2_ARCH_HAS_MMU_MANDATORY
75
76config BR2_RISCV_64
77	bool "64-bit"
78	select BR2_ARCH_IS_64
79	select BR2_ARCH_HAS_MMU_OPTIONAL
80
81endchoice
82
83choice
84	prompt "Target ABI"
85	default BR2_RISCV_ABI_ILP32D if !BR2_ARCH_IS_64 && BR2_RISCV_ISA_RVD
86	default BR2_RISCV_ABI_ILP32F if !BR2_ARCH_IS_64 && BR2_RISCV_ISA_RVF
87	default BR2_RISCV_ABI_ILP32  if !BR2_ARCH_IS_64
88	default BR2_RISCV_ABI_LP64D  if BR2_ARCH_IS_64 && BR2_RISCV_ISA_RVD
89	default BR2_RISCV_ABI_LP64F  if BR2_ARCH_IS_64 && BR2_RISCV_ISA_RVF
90	default BR2_RISCV_ABI_LP64   if BR2_ARCH_IS_64
91
92config BR2_RISCV_ABI_ILP32
93	bool "ilp32"
94	depends on !BR2_ARCH_IS_64
95
96config BR2_RISCV_ABI_ILP32F
97	bool "ilp32f"
98	depends on !BR2_ARCH_IS_64 && BR2_RISCV_ISA_RVF
99
100config BR2_RISCV_ABI_ILP32D
101	bool "ilp32d"
102	depends on !BR2_ARCH_IS_64 && BR2_RISCV_ISA_RVD
103
104config BR2_RISCV_ABI_LP64
105	bool "lp64"
106	depends on BR2_ARCH_IS_64
107
108config BR2_RISCV_ABI_LP64F
109	bool "lp64f"
110	depends on BR2_ARCH_IS_64 && BR2_RISCV_ISA_RVF
111
112config BR2_RISCV_ABI_LP64D
113	bool "lp64d"
114	depends on BR2_ARCH_IS_64 && BR2_RISCV_ISA_RVD
115endchoice
116
117config BR2_ARCH
118	default "riscv32" if !BR2_ARCH_IS_64
119	default "riscv64" if BR2_ARCH_IS_64
120
121config BR2_NORMALIZED_ARCH
122	default "riscv"
123
124config BR2_ENDIAN
125	default "LITTLE"
126
127config BR2_GCC_TARGET_ABI
128	default "ilp32" if BR2_RISCV_ABI_ILP32
129	default "ilp32f" if BR2_RISCV_ABI_ILP32F
130	default "ilp32d" if BR2_RISCV_ABI_ILP32D
131	default "lp64" if BR2_RISCV_ABI_LP64
132	default "lp64f" if BR2_RISCV_ABI_LP64F
133	default "lp64d" if BR2_RISCV_ABI_LP64D
134
135config BR2_READELF_ARCH_NAME
136	default "RISC-V"
137
138# vim: ft=kconfig
139# -*- mode:kconfig; -*-
140