diff options
Diffstat (limited to 'meta/conf/machine')
-rw-r--r-- | meta/conf/machine/include/mips/tune-mips-24k.inc | 3 | ||||
-rw-r--r-- | meta/conf/machine/include/mips/tune-mips-74k.inc | 1 | ||||
-rw-r--r-- | meta/conf/machine/include/mips/tune-octeon.inc | 1 | ||||
-rw-r--r-- | meta/conf/machine/include/qemu.inc | 7 | ||||
-rw-r--r-- | meta/conf/machine/include/riscv/README | 122 | ||||
-rw-r--r-- | meta/conf/machine/include/riscv/arch-riscv.inc | 138 | ||||
-rw-r--r-- | meta/conf/machine/include/riscv/tune-riscv.inc | 40 | ||||
-rw-r--r-- | meta/conf/machine/qemuriscv32.conf | 4 | ||||
-rw-r--r-- | meta/conf/machine/qemux86-64.conf | 6 | ||||
-rw-r--r-- | meta/conf/machine/qemux86.conf | 6 |
10 files changed, 267 insertions, 61 deletions
diff --git a/meta/conf/machine/include/mips/tune-mips-24k.inc b/meta/conf/machine/include/mips/tune-mips-24k.inc index ec4e53f63f..5dc2a8a115 100644 --- a/meta/conf/machine/include/mips/tune-mips-24k.inc +++ b/meta/conf/machine/include/mips/tune-mips-24k.inc | |||
@@ -5,13 +5,11 @@ MIPSPKGSFX_MIPS16E ??= "" | |||
5 | require conf/machine/include/mips/tune-mips32r2.inc | 5 | require conf/machine/include/mips/tune-mips32r2.inc |
6 | require conf/machine/include/mips/feature-mips-mips16e.inc | 6 | require conf/machine/include/mips/feature-mips-mips16e.inc |
7 | 7 | ||
8 | |||
9 | TUNEVALID[24kc] = "Enable MIPS 24Kc processor optimizations" | 8 | TUNEVALID[24kc] = "Enable MIPS 24Kc processor optimizations" |
10 | TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "24kc", " -mtune=24kc", "", d)}" | 9 | TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "24kc", " -mtune=24kc", "", d)}" |
11 | TUNEVALID[24kec] = "Enable MIPS 24KEc processor optimizations, including DSP" | 10 | TUNEVALID[24kec] = "Enable MIPS 24KEc processor optimizations, including DSP" |
12 | TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "24kec", " -mtune=24kec -mdsp", "", d)}" | 11 | TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "24kec", " -mtune=24kec -mdsp", "", d)}" |
13 | 12 | ||
14 | |||
15 | AVAILTUNES += "mips32r2-24kc mips32r2-24kec mips32r2-24kec-m16" | 13 | AVAILTUNES += "mips32r2-24kc mips32r2-24kec mips32r2-24kec-m16" |
16 | AVAILTUNES += "mips32r2el-24kc mips32r2el-24kec mips32r2el-24kec-m16" | 14 | AVAILTUNES += "mips32r2el-24kc mips32r2el-24kec mips32r2el-24kec-m16" |
17 | 15 | ||
@@ -32,7 +30,6 @@ MIPSPKGSFX_VARIANT:tune-mips32r2-24kec-m16 = "mips32r2-24kec${MIPSPKGSFX_MIPS16E | |||
32 | PACKAGE_EXTRA_ARCHS:tune-mips32r2-24kec-m16 = "${PACKAGE_EXTRA_ARCHS:tune-mips32r2-24kec} mips32r2-24kec-m16-nf" | 30 | PACKAGE_EXTRA_ARCHS:tune-mips32r2-24kec-m16 = "${PACKAGE_EXTRA_ARCHS:tune-mips32r2-24kec} mips32r2-24kec-m16-nf" |
33 | QEMU_EXTRAOPTIONS:tune-mips32r2-24kec-m16-nf = " -cpu 24KEc" | 31 | QEMU_EXTRAOPTIONS:tune-mips32r2-24kec-m16-nf = " -cpu 24KEc" |
34 | 32 | ||
35 | |||
36 | # little endian: kc, kc+dsp=kec, kc+dsp+mips16e=kec-m16 | 33 | # little endian: kc, kc+dsp=kec, kc+dsp+mips16e=kec-m16 |
37 | TUNE_FEATURES:tune-mips32r2el-24kc = "${TUNE_FEATURES:tune-mips32r2el-nf} 24kc" | 34 | TUNE_FEATURES:tune-mips32r2el-24kc = "${TUNE_FEATURES:tune-mips32r2el-nf} 24kc" |
38 | TUNE_FEATURES:tune-mips32r2el-24kec = "${TUNE_FEATURES:tune-mips32r2el-nf} 24kec" | 35 | TUNE_FEATURES:tune-mips32r2el-24kec = "${TUNE_FEATURES:tune-mips32r2el-nf} 24kec" |
diff --git a/meta/conf/machine/include/mips/tune-mips-74k.inc b/meta/conf/machine/include/mips/tune-mips-74k.inc index 0ec90ca076..e328b3b490 100644 --- a/meta/conf/machine/include/mips/tune-mips-74k.inc +++ b/meta/conf/machine/include/mips/tune-mips-74k.inc | |||
@@ -5,7 +5,6 @@ MIPSPKGSFX_MIPS16E ??= "" | |||
5 | require conf/machine/include/mips/tune-mips32r2.inc | 5 | require conf/machine/include/mips/tune-mips32r2.inc |
6 | require conf/machine/include/mips/feature-mips-mips16e.inc | 6 | require conf/machine/include/mips/feature-mips-mips16e.inc |
7 | 7 | ||
8 | |||
9 | TUNEVALID[74kc] = "Enable MIPS 74K with DSPr2 processor optimizations" | 8 | TUNEVALID[74kc] = "Enable MIPS 74K with DSPr2 processor optimizations" |
10 | TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "74kc", " -mtune=74kc", "", d)}" | 9 | TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "74kc", " -mtune=74kc", "", d)}" |
11 | 10 | ||
diff --git a/meta/conf/machine/include/mips/tune-octeon.inc b/meta/conf/machine/include/mips/tune-octeon.inc index d4670e3259..0004190c34 100644 --- a/meta/conf/machine/include/mips/tune-octeon.inc +++ b/meta/conf/machine/include/mips/tune-octeon.inc | |||
@@ -17,7 +17,6 @@ BASE_LIB:tune-octeon2_64 = "lib64" | |||
17 | MIPSPKGSFX_VARIANT:tune-octeon2_64 = "octeon2_64" | 17 | MIPSPKGSFX_VARIANT:tune-octeon2_64 = "octeon2_64" |
18 | PACKAGE_EXTRA_ARCHS:tune-octeon2_64 = "mips64 octeon2_64" | 18 | PACKAGE_EXTRA_ARCHS:tune-octeon2_64 = "mips64 octeon2_64" |
19 | 19 | ||
20 | |||
21 | TUNEVALID[octeon3] = "Enable optimization related to octeon3 support" | 20 | TUNEVALID[octeon3] = "Enable optimization related to octeon3 support" |
22 | TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'octeon3', ' -march=octeon3 ', '',d)}" | 21 | TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'octeon3', ' -march=octeon3 ', '',d)}" |
23 | 22 | ||
diff --git a/meta/conf/machine/include/qemu.inc b/meta/conf/machine/include/qemu.inc index d7392d4762..c143e37f71 100644 --- a/meta/conf/machine/include/qemu.inc +++ b/meta/conf/machine/include/qemu.inc | |||
@@ -1,10 +1,3 @@ | |||
1 | PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg" | ||
2 | PREFERRED_PROVIDER_virtual/egl ?= "mesa" | ||
3 | PREFERRED_PROVIDER_virtual/libgl ?= "mesa" | ||
4 | PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa" | ||
5 | PREFERRED_PROVIDER_virtual/libgles2 ?= "mesa" | ||
6 | PREFERRED_PROVIDER_virtual/libgles3 ?= "mesa" | ||
7 | |||
8 | XSERVER ?= "xserver-xorg \ | 1 | XSERVER ?= "xserver-xorg \ |
9 | ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'mesa-driver-swrast xserver-xorg-extension-glx', '', d)} \ | 2 | ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'mesa-driver-swrast xserver-xorg-extension-glx', '', d)} \ |
10 | xf86-video-fbdev \ | 3 | xf86-video-fbdev \ |
diff --git a/meta/conf/machine/include/riscv/README b/meta/conf/machine/include/riscv/README new file mode 100644 index 0000000000..beef68f523 --- /dev/null +++ b/meta/conf/machine/include/riscv/README | |||
@@ -0,0 +1,122 @@ | |||
1 | 2025/06/08 - Mark Hatle <mark.hatle@amd.com> | ||
2 | - Initial Revision | ||
3 | |||
4 | The RISC-V ISA is broken into two parts, a base ISA and extensions. As | ||
5 | of the writing of this document these are documented at: | ||
6 | |||
7 | https://lf-riscv.atlassian.net/wiki/spaces/HOME/pages/16154769/RISC-V+Technical+Specifications | ||
8 | |||
9 | Specifically "The RISC-V Instruction Set Manual Volume I: Unprivileged ISA" | ||
10 | was used to create this implementation. | ||
11 | |||
12 | Requirements | ||
13 | ------------ | ||
14 | As RISC-V is a “variable” ISA (a base isa plus numerous extensions), a | ||
15 | mechanism is required to specify a series of ISA features that a user or | ||
16 | tune can use to specify a specific CPU instantiation. | ||
17 | |||
18 | Not all ratified or draft features should or can be implemented with the | ||
19 | available resources. | ||
20 | |||
21 | The implementation should work for Linux, baremetal (newlib), zephyr and | ||
22 | other operating systems. Supported extensions should be based on | ||
23 | real-world examples. | ||
24 | |||
25 | Linux | ||
26 | ----- | ||
27 | Linux required base and support extensions should be available. Linux | ||
28 | requires: | ||
29 | * Base: rv32ima & rv64ima | ||
30 | * Optional FPU: fd | ||
31 | * Optional RISCV_ISA_C: c | ||
32 | * Optiona RISCV_ISA_V: v | ||
33 | * Required additional: _zicsr_zifencei | ||
34 | * Optional RISCV_ISA_ZBA: _zba | ||
35 | * Optional RISCV_ISA_ZBB: _zbb | ||
36 | * Optional RISCV_ISA_ZBC: _zbc (not supported by current QEMU design) | ||
37 | |||
38 | See: https://git.yoctoproject.org/linux-yocto/tree/arch/riscv/Makefile?h=v6.12/base | ||
39 | |||
40 | Baremetal | ||
41 | --------- | ||
42 | AMD Microblaze-V FPGA support uses the following static configurations: | ||
43 | Base: rv32e, rv32i, rv64i | ||
44 | Extensions: m, a, f, d, c, b, zicsr, zifencei | ||
45 | |||
46 | Zephyr | ||
47 | ------ | ||
48 | AMD Microblaze-V development for Zephyr is the same as Baremetal, with a | ||
49 | few additional extensions: zbc, zicbom | ||
50 | |||
51 | ABI | ||
52 | --- | ||
53 | The following ABIs are supported GNU tools and some combination of systems. | ||
54 | * ilp32 - Integer, long and pointer are 32-bit | ||
55 | * lp64 - Long and pointer are 64-bit (integer is 32-bit) | ||
56 | |||
57 | The ABI is dependent upon the core system implementation, as ilp32 can | ||
58 | only used on an ‘rv32’ system, while lp64 can only be used on an ‘rv64’ | ||
59 | system. | ||
60 | |||
61 | There are additional variations of each ABI: | ||
62 | * e - used with the Reduced register extension | ||
63 | * f - used when single precision floating point (but not double precision) is | ||
64 | enabled | ||
65 | * d - used when both single and double precision floating point is enabled | ||
66 | |||
67 | Based on the above, the ABI should be automatically determined based on | ||
68 | the selected Base ISA and Extensions. | ||
69 | |||
70 | Implementation | ||
71 | -------------- | ||
72 | To make it easier to generate the RISC-V canonical arch, ISA based -march, | ||
73 | and the ABI string, a few new variables are added for specific RISC-V items. | ||
74 | |||
75 | TUNE_RISCV_ARCH - This contains the canonical GNU style arch, generally this | ||
76 | will evaluate to "riscv32" or "riscv64". | ||
77 | |||
78 | TUNE_RISCV_MARCH - This will contain an ISA based -march string compatible | ||
79 | with gcc and similar toolchains. For example: | ||
80 | rv32imacfd_zicsr_zifencei | ||
81 | |||
82 | TUNE_RISCV_ABI - This is the generated ABI that corresponds to the ARCH and | ||
83 | MARCH/ISA values. For riscv32, the value will be ilp32 | ||
84 | (int, long and pointer is 32-bit) with the ISA | ||
85 | variation. For riscv64, the value will be lp64 (long | ||
86 | and pointer are 64-bit bit, while int is 32-bit) with the | ||
87 | ISA variation. The ISA affects the ABI when the 'e', 'f' | ||
88 | and 'd' extension are used. | ||
89 | |||
90 | TUNE_RISCV_PKGARCH - This is the generated PKGARCH value. | ||
91 | |||
92 | The standard variables are defined as: | ||
93 | |||
94 | TUNE_CCARGS = "${@ '-march=${TUNE_RISCV_MARCH} -mabi=${TUNE_RISCV_ABI}' if not d.getVar('TUNE_CCARGS:tune-${DEFAULTTUNE}') else 'TUNE_CCARGS:tune-${DEFAULTTUNE}'}" | ||
95 | |||
96 | The above will allow the user to specify an implementation specific | ||
97 | TUNE_CCARGS for a given processor tune if the default implementtion is | ||
98 | not adequate for some reason. It is expected that most, if not all, | ||
99 | implementations will use the default behavior. | ||
100 | |||
101 | TUNE_ARCH = "${TUNE_RISCV_ARCH}" | ||
102 | TUNE_PKGARCH = "${TUNE_RISCV_PKGARCH}" | ||
103 | |||
104 | The above two will always base their setting off the standard TUNE_FEATURES. | ||
105 | |||
106 | Ratified and draft extensions should be implemented as TUNE_FEATURES in | ||
107 | the arch-riscv.inc file. | ||
108 | |||
109 | Vendor specific extensions and processor specific settings should go | ||
110 | into a 'tune-<vendor>.inc' file, with tune-riscv.inc being reserved for | ||
111 | general purpose tunes. | ||
112 | |||
113 | TUNE_FEATURE Helper | ||
114 | ------------------- | ||
115 | A special helper function has been written that will convert RISC-V ISA | ||
116 | notation into TUNE_FEATURE notion, for example: | ||
117 | |||
118 | rv32g -> rv 32 i m a f d zicsr zifencei | ||
119 | |||
120 | The helper can be called using oe.tune.riscv_isa_to_tune("<ISA>") such as | ||
121 | oe.tune.riscv_isa_to_tune("rv64gc") which would return: | ||
122 | rv 64 i m a f d c zicsr zifencei | ||
diff --git a/meta/conf/machine/include/riscv/arch-riscv.inc b/meta/conf/machine/include/riscv/arch-riscv.inc index b34064e78f..99bed8fde5 100644 --- a/meta/conf/machine/include/riscv/arch-riscv.inc +++ b/meta/conf/machine/include/riscv/arch-riscv.inc | |||
@@ -1,14 +1,140 @@ | |||
1 | # RISCV Architecture definition | 1 | # RISCV Architecture definition |
2 | 2 | ||
3 | DEFAULTTUNE ?= "riscv64" | 3 | # Based on the RISC-V Instruction Set Manual Volume I: Unprivileged ISA from May 2025 |
4 | # As well as the RISC-V options for using GCC (as of June 2025) | ||
4 | 5 | ||
5 | TUNE_ARCH = "${TUNE_ARCH:tune-${DEFAULTTUNE}}" | 6 | # Note: the following should be implemented in the order that GCC expects |
6 | TUNE_PKGARCH = "${TUNE_PKGARCH:tune-${DEFAULTTUNE}}" | 7 | # -march= values to be defined in. |
7 | TUNE_CCARGS:append = "${@bb.utils.contains('TUNE_FEATURES', 'riscv64nf', ' -mabi=lp64', ' ', d)}" | ||
8 | TUNE_CCARGS:append = "${@bb.utils.contains('TUNE_FEATURES', 'riscv32nf', ' -mabi=ilp32', ' ', d)}" | ||
9 | 8 | ||
10 | TUNE_CCARGS:append = "${@bb.utils.contains('TUNE_FEATURES', 'riscv64nc', ' -march=rv64imafd', ' ', d)}" | 9 | # Base ISA |
10 | # All supported march strings must start with rv32 or rv64 | ||
11 | TUNEVALID[rv] = "RISC-V" | ||
12 | TUNE_RISCV_ARCH = "${@bb.utils.contains("TUNE_FEATURES", "rv", "riscv", "", d)}" | ||
13 | TUNE_RISCV_MARCH = "${@bb.utils.contains("TUNE_FEATURES", "rv", "rv", "", d)}" | ||
14 | TUNE_RISCV_ABI = "" | ||
11 | 15 | ||
16 | # There are two primary ABIs, ilp32 and lp64 | ||
17 | # There are variants of both, that appears to be based on extensions above | ||
18 | # For example: | ||
19 | # rv32i uses ilp32, rv32e uses ilp32e, rv32f uses ilp32f | ||
20 | # rv64i uses lp64, rv64if uses lp64f, rv64id uses lp64d | ||
21 | TUNEVALID[32] = "ISA XLEN - 32-bit" | ||
22 | TUNECONFLICTS[32] = "64" | ||
23 | TUNE_RISCV_ARCH .= "${@bb.utils.contains("TUNE_FEATURES", "32", "32", "", d)}" | ||
24 | TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "32", "32", "", d)}" | ||
25 | TUNE_RISCV_ABI .= "${@bb.utils.contains("TUNE_FEATURES", "32", "ilp32", "", d)}" | ||
26 | |||
27 | TUNEVALID[64] = "ISA XLEN - 64-bit" | ||
28 | TUNECONFLICTS[64] = "32" | ||
29 | TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "64", "64", "", d)}" | ||
30 | TUNE_RISCV_ARCH .= "${@bb.utils.contains("TUNE_FEATURES", "64", "64", "", d)}" | ||
31 | TUNE_RISCV_ABI .= "${@bb.utils.contains("TUNE_FEATURES", "64", "lp64", "", d)}" | ||
32 | |||
33 | # The package arch starts with the canonical arch, but adds some extensions to make | ||
34 | # package compatibility clear | ||
35 | TUNE_RISCV_PKGARCH = "${TUNE_RISCV_ARCH}" | ||
36 | |||
37 | # i, e, or g are defined by gcc, but 'g' refers to 'i' + extensions 'MAFD Zicsr Zifencei' | ||
38 | # So 'g' will not be defined here as it is an abbreviation of the expanded version | ||
39 | TUNEVALID[e] = "Reduced register base integer extension" | ||
40 | TUNECONFLICTS[e] = "i" | ||
41 | TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "e", "e", "", d)}" | ||
42 | TUNE_RISCV_ABI .= "${@bb.utils.contains("TUNE_FEATURES", "e", "e", "", d)}" | ||
43 | TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "e", "e", "", d)}" | ||
44 | |||
45 | TUNEVALID[i] = "Base integer extension" | ||
46 | TUNECONFLICTS[i] = "e" | ||
47 | TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "i", "i", "", d)}" | ||
48 | TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "i", "i", "", d)}" | ||
49 | |||
50 | # Extensions | ||
51 | TUNEVALID[m] = "Integer multiplication and division extension" | ||
52 | TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "m", "m", "", d)}" | ||
53 | TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "m", "m", "", d)}" | ||
54 | |||
55 | TUNEVALID[a] = "Atomic extension" | ||
56 | TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "a", "a", "", d)}" | ||
57 | TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "a", "a", "", d)}" | ||
58 | |||
59 | TUNEVALID[f] = "Single-precision floating-point extension" | ||
60 | TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "f d", "f", "", d)}" | ||
61 | TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "f d", "f", "", d)}" | ||
62 | |||
63 | TUNEVALID[d] = "Double-precision floating-point extension" | ||
64 | TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "d", "d", "", d)}" | ||
65 | TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "d", "d", "", d)}" | ||
66 | |||
67 | # Only f OR d, but just one | ||
68 | TUNE_RISCV_ABI .= "${@bb.utils.contains("TUNE_FEATURES", "d", "d", bb.utils.contains("TUNE_FEATURES", "f", "f", "", d), d)}" | ||
69 | |||
70 | TUNEVALID[c] = "Compressed extension" | ||
71 | TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "c", "c", "", d)}" | ||
72 | TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "c", "c", "", d)}" | ||
73 | |||
74 | TUNEVALID[b] = "Bit Manipulation extension" | ||
75 | # Handled below via zba, zbb, zbs | ||
76 | # This matches current Linux kernel behavior | ||
77 | #TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "b", "b", "", d)}" | ||
78 | #TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "b", "b", "", d)}" | ||
79 | |||
80 | TUNEVALID[v] = "Vector operations extension" | ||
81 | TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "v", "v", "", d)}" | ||
82 | TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "v", "v", "", d)}" | ||
83 | |||
84 | # Now the special Z extensions | ||
85 | TUNEVALID[zicbom] = "Cache-block management extension" | ||
86 | TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicbom", "_zicbom", "", d)}" | ||
87 | TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicbom", "_zicbom", "", d)}" | ||
88 | |||
89 | TUNEVALID[zicsr] = "Control and status register access extension" | ||
90 | TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicsr f d", "_zicsr", "", d)}" | ||
91 | # If zicsr (or zifencei) is in the path, OpenSBI fails to use the extensions, do to (Makefile): | ||
92 | # # Check whether the assembler and the compiler support the Zicsr and Zifencei extensions | ||
93 | # CC_SUPPORT_ZICSR_ZIFENCEI := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) -nostdlib -march=rv$(OPENSBI_CC_XLEN)imafd_zicsr_zifencei -x c /dev/null -o /dev/null 2>&1 | grep -e "zicsr" -e "zifencei" > /dev/null && echo n || echo y) | ||
94 | # this will match on the path containing zicsr or zifencei when an error is reported, which | ||
95 | # will always happens in this check. | ||
96 | # | ||
97 | # Yocto Project Bugzilla 15897 | ||
98 | # | ||
99 | #TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicsr f d", "_zicsr", "", d)}" | ||
100 | |||
101 | TUNEVALID[zifencei] = "Instruction-fetch fence extension" | ||
102 | TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zifencei", "_zifencei", "", d)}" | ||
103 | # See above Bug 15897 | ||
104 | #TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zifencei", "_zifencei", "", d)}" | ||
105 | |||
106 | TUNEVALID[zba] = "Address bit manipulation extension" | ||
107 | TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zba", "_zba", "", d)}" | ||
108 | TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zba", "_zba", "", d)}" | ||
109 | |||
110 | TUNEVALID[zbb] = "Basic bit manipulation extension" | ||
111 | TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zbb", "_zbb", "", d)}" | ||
112 | TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zbb", "_zbb", "", d)}" | ||
113 | |||
114 | TUNEVALID[zbc] = "Carry-less multiplication extension" | ||
115 | TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zbc", "_zbc", "", d)}" | ||
116 | TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zbc", "_zbc", "", d)}" | ||
117 | |||
118 | TUNEVALID[zbs] = "Single-bit manipulation extension" | ||
119 | TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zbs", "_zbs", "", d)}" | ||
120 | TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zbs", "_zbs", "", d)}" | ||
121 | |||
122 | # Construct TUNE_CCARGS | ||
123 | # This should result in a CCARG similar to: | ||
124 | # -march=rv32imac -mabi=ilp32 | ||
125 | TUNE_CCARGS = "${@ '-march=${TUNE_RISCV_MARCH} -mabi=${TUNE_RISCV_ABI}' if not d.getVar('TUNE_CCARGS:tune-${DEFAULTTUNE}') else 'TUNE_CCARGS:tune-${DEFAULTTUNE}'}" | ||
126 | |||
127 | # Construct TUNE_ARCH | ||
128 | # This should result in an arch string similar to: | ||
129 | # riscv32 | ||
130 | TUNE_ARCH = "${TUNE_RISCV_ARCH}" | ||
131 | |||
132 | # Construct TUNE_PKGARCH | ||
133 | # This should result in a package are like: | ||
134 | # riscv32imac | ||
135 | TUNE_PKGARCH = "${TUNE_RISCV_PKGARCH}" | ||
136 | |||
137 | # Misc settings | ||
12 | # Fix: ld: unrecognized option '--hash-style=sysv' | 138 | # Fix: ld: unrecognized option '--hash-style=sysv' |
13 | LINKER_HASH_STYLE:libc-newlib = "" | 139 | LINKER_HASH_STYLE:libc-newlib = "" |
14 | LINKER_HASH_STYLE:libc-picolibc = "" | 140 | LINKER_HASH_STYLE:libc-picolibc = "" |
diff --git a/meta/conf/machine/include/riscv/tune-riscv.inc b/meta/conf/machine/include/riscv/tune-riscv.inc index 804712077e..12c1125c8b 100644 --- a/meta/conf/machine/include/riscv/tune-riscv.inc +++ b/meta/conf/machine/include/riscv/tune-riscv.inc | |||
@@ -1,41 +1,23 @@ | |||
1 | require conf/machine/include/riscv/arch-riscv.inc | 1 | require conf/machine/include/riscv/arch-riscv.inc |
2 | 2 | ||
3 | TUNEVALID[riscv64] = "Enable 64-bit RISC-V optimizations" | 3 | DEFAULTTUNE ?= "riscv64" |
4 | TUNEVALID[riscv32] = "Enable 32-bit RISC-V optimizations" | ||
5 | |||
6 | TUNEVALID[riscv64nf] = "Enable 64-bit RISC-V optimizations no floating point" | ||
7 | TUNEVALID[riscv32nf] = "Enable 32-bit RISC-V optimizations no floating point" | ||
8 | |||
9 | TUNEVALID[riscv64nc] = "Enable 64-bit RISC-V optimizations without compressed instructions" | ||
10 | |||
11 | TUNEVALID[bigendian] = "Big endian mode" | ||
12 | 4 | ||
13 | AVAILTUNES += "riscv64 riscv32 riscv64nc riscv64nf riscv32nf" | 5 | AVAILTUNES += "riscv64 riscv32 riscv64nc riscv64nf riscv32nf" |
14 | 6 | ||
15 | # Default | 7 | # Default |
16 | TUNE_FEATURES:tune-riscv64 = "riscv64" | 8 | TUNE_FEATURES:tune-riscv64 := "${@oe.tune.riscv_isa_to_tune("rv64gc")}" |
17 | TUNE_ARCH:tune-riscv64 = "riscv64" | 9 | PACKAGE_EXTRA_ARCHS:tune-riscv64 = "${TUNE_RISCV_PKGARCH}" |
18 | TUNE_PKGARCH:tune-riscv64 = "riscv64" | ||
19 | PACKAGE_EXTRA_ARCHS:tune-riscv64 = "riscv64" | ||
20 | 10 | ||
21 | TUNE_FEATURES:tune-riscv32 = "riscv32" | 11 | TUNE_FEATURES:tune-riscv32 := "${@oe.tune.riscv_isa_to_tune("rv32gc")}" |
22 | TUNE_ARCH:tune-riscv32 = "riscv32" | 12 | PACKAGE_EXTRA_ARCHS:tune-riscv32 = "${TUNE_RISCV_PKGARCH}" |
23 | TUNE_PKGARCH:tune-riscv32 = "riscv32" | ||
24 | PACKAGE_EXTRA_ARCHS:tune-riscv32 = "riscv32" | ||
25 | 13 | ||
26 | # No float | 14 | # No float |
27 | TUNE_FEATURES:tune-riscv64nf = "${TUNE_FEATURES:tune-riscv64} riscv64nf" | 15 | TUNE_FEATURES:tune-riscv64nf := "${@oe.tune.riscv_isa_to_tune("rv64imac_zicsr_zifencei")}" |
28 | TUNE_ARCH:tune-riscv64nf = "riscv64" | 16 | PACKAGE_EXTRA_ARCHS:tune-riscv64nf = "${TUNE_RISCV_PKGARCH}" |
29 | TUNE_PKGARCH:tune-riscv64nf = "riscv64nf" | ||
30 | PACKAGE_EXTRA_ARCHS:tune-riscv64nf = "riscv64nf" | ||
31 | 17 | ||
32 | TUNE_FEATURES:tune-riscv32nf = "${TUNE_FEATURES:tune-riscv32} riscv32nf" | 18 | TUNE_FEATURES:tune-riscv32nf := "${@oe.tune.riscv_isa_to_tune("rv32imac_zicsr_zifencei")}" |
33 | TUNE_ARCH:tune-riscv32nf = "riscv32" | 19 | PACKAGE_EXTRA_ARCHS:tune-riscv32nf = "${TUNE_RISCV_PKGARCH}" |
34 | TUNE_PKGARCH:tune-riscv32nf = "riscv32nf" | ||
35 | PACKAGE_EXTRA_ARCHS:tune-riscv32nf = "riscv32nf" | ||
36 | 20 | ||
37 | # no compressed | 21 | # no compressed |
38 | TUNE_FEATURES:tune-riscv64nc = "${TUNE_FEATURES:tune-riscv64} riscv64nc" | 22 | TUNE_FEATURES:tune-riscv64nc := "${@oe.tune.riscv_isa_to_tune("rv64imafd_zicsr_zifencei")}" |
39 | TUNE_ARCH:tune-riscv64nc = "riscv64" | 23 | PACKAGE_EXTRA_ARCHS:tune-riscv64nc = "${TUNE_RISCV_PKGARCH}" |
40 | TUNE_PKGARCH:tune-riscv64nc = "riscv64nc" | ||
41 | PACKAGE_EXTRA_ARCHS:tune-riscv64nc = "riscv64nc" | ||
diff --git a/meta/conf/machine/qemuriscv32.conf b/meta/conf/machine/qemuriscv32.conf index d3858dc051..aff36c28a5 100644 --- a/meta/conf/machine/qemuriscv32.conf +++ b/meta/conf/machine/qemuriscv32.conf | |||
@@ -2,9 +2,9 @@ | |||
2 | #@NAME: generic riscv32 machine | 2 | #@NAME: generic riscv32 machine |
3 | #@DESCRIPTION: Machine configuration for running a generic riscv32 | 3 | #@DESCRIPTION: Machine configuration for running a generic riscv32 |
4 | 4 | ||
5 | require conf/machine/include/riscv/qemuriscv.inc | 5 | DEFAULTTUNE ?= "riscv32" |
6 | 6 | ||
7 | DEFAULTTUNE = "riscv32" | 7 | require conf/machine/include/riscv/qemuriscv.inc |
8 | 8 | ||
9 | PREFERRED_VERSION_openocd-native = "riscv" | 9 | PREFERRED_VERSION_openocd-native = "riscv" |
10 | PREFERRED_VERSION_openocd = "riscv" | 10 | PREFERRED_VERSION_openocd = "riscv" |
diff --git a/meta/conf/machine/qemux86-64.conf b/meta/conf/machine/qemux86-64.conf index 4a9c6d364b..62108b703b 100644 --- a/meta/conf/machine/qemux86-64.conf +++ b/meta/conf/machine/qemux86-64.conf | |||
@@ -2,12 +2,6 @@ | |||
2 | #@NAME: QEMU x86-64 machine | 2 | #@NAME: QEMU x86-64 machine |
3 | #@DESCRIPTION: Machine configuration for running an x86-64 system on QEMU | 3 | #@DESCRIPTION: Machine configuration for running an x86-64 system on QEMU |
4 | 4 | ||
5 | PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg" | ||
6 | PREFERRED_PROVIDER_virtual/libgl ?= "mesa" | ||
7 | PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa" | ||
8 | PREFERRED_PROVIDER_virtual/libgles2 ?= "mesa" | ||
9 | PREFERRED_PROVIDER_virtual/libgles3 ?= "mesa" | ||
10 | |||
11 | require conf/machine/include/qemu.inc | 5 | require conf/machine/include/qemu.inc |
12 | DEFAULTTUNE ?= "core2-64" | 6 | DEFAULTTUNE ?= "core2-64" |
13 | require conf/machine/include/x86/tune-x86-64-v3.inc | 7 | require conf/machine/include/x86/tune-x86-64-v3.inc |
diff --git a/meta/conf/machine/qemux86.conf b/meta/conf/machine/qemux86.conf index 1e072e1ae2..51f080bd2a 100644 --- a/meta/conf/machine/qemux86.conf +++ b/meta/conf/machine/qemux86.conf | |||
@@ -2,12 +2,6 @@ | |||
2 | #@NAME: QEMU x86 machine | 2 | #@NAME: QEMU x86 machine |
3 | #@DESCRIPTION: Machine configuration for running an x86 system on QEMU | 3 | #@DESCRIPTION: Machine configuration for running an x86 system on QEMU |
4 | 4 | ||
5 | PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg" | ||
6 | PREFERRED_PROVIDER_virtual/libgl ?= "mesa" | ||
7 | PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa" | ||
8 | PREFERRED_PROVIDER_virtual/libgles2 ?= "mesa" | ||
9 | PREFERRED_PROVIDER_virtual/libgles3 ?= "mesa" | ||
10 | |||
11 | require conf/machine/include/qemu.inc | 5 | require conf/machine/include/qemu.inc |
12 | DEFAULTTUNE ?= "core2-32" | 6 | DEFAULTTUNE ?= "core2-32" |
13 | require conf/machine/include/x86/tune-corei7.inc | 7 | require conf/machine/include/x86/tune-corei7.inc |