Skip to content

Commit 8fd6432

Browse files
committed
arch: microblaze: add MicroBlaze to arch/KConfig
Internal references: FWRIVERHD-4554 Signed-off-by: Alp Sayin <alpsayin@gmail.com>
1 parent bcbf808 commit 8fd6432

File tree

3 files changed

+183
-0
lines changed

3 files changed

+183
-0
lines changed

arch/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,18 @@ config NIOS2
104104
help
105105
Nios II Gen 2 architecture
106106

107+
config MICROBLAZE
108+
bool
109+
select ARCH_IS_SET
110+
select ATOMIC_OPERATIONS_C
111+
select HAS_DTS
112+
select GEN_ISR_TABLES
113+
select GEN_SW_ISR_TABLE
114+
imply DYNAMIC_INTERRUPTS
115+
imply ARCH_HAS_CUSTOM_BUSY_WAIT
116+
help
117+
MicroBlaze architecture
118+
107119
config RISCV
108120
bool
109121
select ARCH_IS_SET

arch/microblaze/Kconfig

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Copyright (c) 2023 Advanced Micro Devices, Inc. (AMD)
2+
# Copyright (c) 2023 Alp Sayin <alpsayin@gmail.com>
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
6+
menu "MicroBlaze Options"
7+
depends on MICROBLAZE
8+
9+
config ARCH
10+
def_string "microblaze"
11+
12+
config CPU_MICROBLAZE
13+
def_bool y
14+
select ARCH_HAS_EXTRA_EXCEPTION_INFO
15+
help
16+
This option signifies the use of a MicroBlaze CPU
17+
18+
config CPU_VERSION
19+
prompt "MicroBlaze CPU Version"
20+
def_string "v9.00.a"
21+
help
22+
Use features of, and schedule code for, the given CPU.
23+
Supported values are in the format "vX.YY.Z",
24+
where X is a major version, YY is the minor version, and Z is compatibility code.
25+
Example values are "v3.00.a", "v4.00.b", "v5.00.a", "v5.00.b", "v6.00.a".
26+
Taken from https://gcc.gnu.org/onlinedocs/gcc/MicroBlaze-Options.html
27+
28+
config GEN_IRQ_VECTOR_TABLE
29+
bool
30+
default n if MICROBLAZE
31+
help
32+
MicroBlaze has a single interrupt and therefore doesn't have an IRQ vector table.
33+
34+
config BIG_ENDIAN
35+
bool
36+
default n if MICROBLAZE
37+
help
38+
Our current default endianness is Little-endian.
39+
40+
config ARCH_SW_ISR_TABLE_ALIGN
41+
prompt "SW_ISR Table Align Size"
42+
default 4
43+
44+
config NUM_IRQS
45+
def_int 1
46+
help
47+
This isn't really a choice either because a barebones MicroBlaze offers
48+
only 1 external interrupt pin (which is usually connected to an Xlnx Intc
49+
or probably a single peripheral which a user wants IRQs from).
50+
51+
choice
52+
prompt "Idle Sleep Option"
53+
default MICROBLAZE_IDLE_NOP
54+
55+
config MICROBLAZE_IDLE_NOP
56+
bool "NOP (no power saving)"
57+
help
58+
Executes pseudo-assembly instruction nop in idle.
59+
Reset_Mode[0:1] is set to 10
60+
61+
config MICROBLAZE_IDLE_SLEEP
62+
bool "Sleep"
63+
help
64+
Executes pseudo-assembly instruction sleep in idle.
65+
Reset_Mode[0:1] is set to 10
66+
67+
config MICROBLAZE_IDLE_HIBERNATE
68+
bool "Hibernate"
69+
help
70+
Executes pseudo-assembly instruction hibernate in idle.
71+
72+
config MICROBLAZE_IDLE_SUSPEND
73+
bool "Suspend"
74+
help
75+
Executes pseudo-assembly instruction suspend in idle.
76+
endchoice
77+
78+
config MICROBLAZE_DUMP_ON_EXCEPTION
79+
bool "Dump core on exceptions"
80+
default y
81+
82+
# Bump the kernel default stack size values.
83+
config MAIN_STACK_SIZE
84+
default 4096 if COVERAGE_GCOV
85+
default 2048
86+
87+
config IDLE_STACK_SIZE
88+
default 1024
89+
90+
config ISR_STACK_SIZE
91+
default 4096
92+
93+
config TEST_EXTRA_STACK_SIZE
94+
default 4096 if COVERAGE_GCOV
95+
default 2048
96+
97+
config SYSTEM_WORKQUEUE_STACK_SIZE
98+
default 4096
99+
100+
source "arch/microblaze/Kconfig.features"
101+
102+
endmenu

arch/microblaze/Kconfig.features

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Copyright (c) 2023 Advanced Micro Devices, Inc. (AMD)
2+
# Copyright (c) 2023 Alp Sayin <alpsayin@gmail.com>
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
6+
menu "HW Feature Options"
7+
depends on MICROBLAZE
8+
9+
config MICROBLAZE_USE_MSR_INSTR
10+
prompt "Use msrset & msrclr instructions"
11+
def_bool y
12+
help
13+
This depends on CPU supporting msrset/msrclr instructions.
14+
xparameters would define this as USE_MSR_INSTR = 1.
15+
16+
config USE_BARREL_SHIFT_INSTR
17+
prompt "Use barrel shift instructions"
18+
def_bool y
19+
help
20+
This depends on CPU supporting barrel shift instructions.
21+
xparameters would define this as USE_BARREL = 1.
22+
23+
config USE_PATTERN_COMPARE_INSTR
24+
prompt "Use pattern compare instructions"
25+
def_bool y
26+
help
27+
This depends on CPU supporting pattern compare instructions.
28+
xparameters would define this as USE_PCMP = 1.
29+
30+
config USE_DIV_INSTR
31+
prompt "Use division instructions"
32+
def_bool y
33+
help
34+
This depends on CPU supporting hardware division instructions.
35+
xparameters would define this as USE_DIV = 1.
36+
37+
config USE_MUL_INSTR
38+
prompt "Use multiplication instructions"
39+
def_bool y
40+
help
41+
This depends on CPU supporting hardware multiplication instructions.
42+
xparameters would define this as USE_HW_MUL >= 1.
43+
44+
config USE_MULHI_INSTR
45+
prompt "Use mulhi for multiplication of higher bits"
46+
def_bool y
47+
depends on USE_MUL_INSTR
48+
help
49+
Use multiply high instructions for high part of 32x32 multiply.
50+
This depends on CPU supporting hardware high multiplication instructions.
51+
xparameters would define this as USE_HW_MUL = 2.
52+
53+
config USE_HARDWARE_FLOAT_INSTR
54+
def_bool n
55+
depends on CPU_HAS_FPU
56+
help
57+
This depends on CPU supporting hardware float instructions.
58+
xparameters would define this as USE_FPU = 1.
59+
60+
config DATA_IS_TEXT_RELATIVE
61+
bool "Assume data & text segment distance is static"
62+
default y
63+
help
64+
Assume that the displacement between the text and data segments is fixed at
65+
static link time. This allows data to be referenced by offset from start of
66+
text address instead of GOT (r20) since PC-relative addressing is not supported.
67+
Injects -mpic-data-is-text-relative
68+
69+
endmenu

0 commit comments

Comments
 (0)