Skip to content

Commit a2b9872

Browse files
committed
arch: microblaze: Support files (Minimal Board Support Package)
Internal references: FWRIVERHD-4980,FWRIVERHD-4990 Signed-off-by: Alp Sayin <alpsayin@gmail.com>
1 parent f0464cb commit a2b9872

12 files changed

+708
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* Copyright (c) 2023 Advanced Micro Devices, Inc. (AMD)
3+
* Copyright (c) 2023 Alp Sayin <alpsayin@gmail.com>
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
9+
10+
11+
.text
12+
.globl microblaze_disable_dcache
13+
.ent microblaze_disable_dcache
14+
.balign 4
15+
microblaze_disable_dcache:
16+
#if CONFIG_MICROBLAZE_USE_MSR_INSTR == 1
17+
18+
#if CONFIG_MICROBLAZE_DCACHE_USE_WRITEBACK != 0
19+
addik r1, r1, -8
20+
swi r15, r1, 0
21+
/* microblaze_flush_dcache does not use r1*/
22+
brlid r15, microblaze_flush_dcache
23+
nop
24+
lwi r15, r1, 0
25+
addik r1, r1, 8
26+
#endif /* CONFIG_MICROBLAZE_DCACHE_USE_WRITEBACK != 0 */
27+
rtsd r15, 8
28+
msrclr r0, 0x80
29+
30+
#else /* CONFIG_MICROBLAZE_USE_MSR_INSTR == 1 */
31+
32+
addik r1, r1, -8
33+
34+
#if CONFIG_MICROBLAZE_DCACHE_USE_WRITEBACK != 0
35+
swi r15, r1, 0
36+
brlid r15, microblaze_flush_dcache
37+
nop
38+
#endif /* CONFIG_MICROBLAZE_DCACHE_USE_WRITEBACK != 0 */
39+
mfs r11, rmsr
40+
andi r11, r11, ~(0x80)
41+
mts rmsr, r11
42+
43+
#if CONFIG_MICROBLAZE_DCACHE_USE_WRITEBACK != 0
44+
lwi r15, r1, 0
45+
#endif /* CONFIG_MICROBLAZE_DCACHE_USE_WRITEBACK != 0 */
46+
47+
addik r1, r1, 8
48+
rtsd r15, 8
49+
nop
50+
51+
#endif /*CONFIG_MICROBLAZE_USE_MSR_INSTR == 1*/
52+
.end microblaze_disable_dcache
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (c) 2023 Advanced Micro Devices, Inc. (AMD)
3+
* Copyright (c) 2023 Alp Sayin <alpsayin@gmail.com>
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
9+
.text
10+
.globl microblaze_disable_exceptions
11+
.ent microblaze_disable_exceptions
12+
.balign 4
13+
microblaze_disable_exceptions:
14+
#if CONFIG_MICROBLAZE_USE_MSR_INSTR == 1
15+
rtsd r15, 8
16+
msrclr r0, 0x100
17+
#else
18+
mfs r4, rmsr;
19+
/* Turn OFF the EE bit */
20+
andi r4, r4, ~(0x100);
21+
mts rmsr, r4;
22+
rtsd r15, 8;
23+
nop;
24+
#endif
25+
.end microblaze_disable_exceptions
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright (c) 2023 Advanced Micro Devices, Inc. (AMD)
3+
* Copyright (c) 2023 Alp Sayin <alpsayin@gmail.com>
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
9+
.text
10+
.globl microblaze_disable_icache
11+
.ent microblaze_disable_icache
12+
.balign 4
13+
microblaze_disable_icache:
14+
#if CONFIG_MICROBLAZE_USE_MSR_INSTR == 1
15+
rtsd r15, 8
16+
msrclr r0, 0x20
17+
#else /*CONFIG_MICROBLAZE_USE_MSR_INSTR == 1*/
18+
#Read the MSR register
19+
mfs r8, rmsr
20+
#Clear the icache enable bit
21+
andi r8, r8, ~(0x20)
22+
#Save the MSR register
23+
mts rmsr, r8
24+
#Return
25+
rtsd r15, 8
26+
nop
27+
#endif
28+
.end microblaze_disable_icache
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright (c) 2023 Advanced Micro Devices, Inc. (AMD)
3+
* Copyright (c) 2023 Alp Sayin <alpsayin@gmail.com>
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
9+
.text
10+
.globl microblaze_disable_interrupts
11+
.ent microblaze_disable_interrupts
12+
.balign 4
13+
microblaze_disable_interrupts:
14+
#if CONFIG_MICROBLAZE_USE_MSR_INSTR == 1
15+
rtsd r15, 8
16+
msrclr r0, 0x2
17+
#else /*CONFIG_MICROBLAZE_USE_MSR_INSTR == 1*/
18+
#Read the MSR register
19+
mfs r12, rmsr
20+
#Clear the interrupt enable bit
21+
andi r12, r12, ~(0x2)
22+
#Save the MSR register
23+
mts rmsr, r12
24+
#Return
25+
rtsd r15, 8
26+
nop
27+
#endif /*CONFIG_MICROBLAZE_USE_MSR_INSTR == 1*/
28+
.end microblaze_disable_interrupts
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright (c) 2023 Advanced Micro Devices, Inc. (AMD)
3+
* Copyright (c) 2023 Alp Sayin <alpsayin@gmail.com>
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
9+
10+
.text
11+
.globl microblaze_enable_dcache
12+
.ent microblaze_enable_dcache
13+
.balign 4
14+
microblaze_enable_dcache:
15+
16+
#if CONFIG_MICROBLAZE_USE_MSR_INSTR == 1
17+
rtsd r15, 8
18+
msrset r0, 0x80
19+
#else /*CONFIG_MICROBLAZE_USE_MSR_INSTR == 1*/
20+
#Read the MSR register
21+
mfs r8, rmsr
22+
#Set the interrupt enable bit
23+
ori r8, r8, 0x80
24+
#Save the MSR register
25+
mts rmsr, r8
26+
#Return
27+
rtsd r15, 8
28+
nop
29+
#endif /*CONFIG_MICROBLAZE_USE_MSR_INSTR == 1*/
30+
.end microblaze_enable_dcache
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (c) 2023 Advanced Micro Devices, Inc. (AMD)
3+
* Copyright (c) 2023 Alp Sayin <alpsayin@gmail.com>
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
9+
.text
10+
.globl microblaze_enable_exceptions
11+
.ent microblaze_enable_exceptions
12+
.balign 4
13+
microblaze_enable_exceptions:
14+
#if CONFIG_MICROBLAZE_USE_MSR_INSTR == 1
15+
rtsd r15, 8;
16+
msrset r0, 0x100
17+
#else /*CONFIG_MICROBLAZE_USE_MSR_INSTR == 1*/
18+
mfs r4, rmsr;
19+
/* Turn ON the EE bit */
20+
ori r4, r4, 0x100;
21+
mts rmsr, r4;
22+
rtsd r15, 8;
23+
nop;
24+
#endif /*CONFIG_MICROBLAZE_USE_MSR_INSTR == 1*/
25+
.end microblaze_enable_exceptions
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright (c) 2023 Advanced Micro Devices, Inc. (AMD)
3+
* Copyright (c) 2023 Alp Sayin <alpsayin@gmail.com>
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
9+
10+
.text
11+
.globl microblaze_enable_icache
12+
.ent microblaze_enable_icache
13+
.balign 4
14+
microblaze_enable_icache:
15+
#if CONFIG_MICROBLAZE_USE_MSR_INSTR == 1
16+
rtsd r15, 8
17+
msrset r0, 0x20
18+
#else /*CONFIG_MICROBLAZE_USE_MSR_INSTR == 1*/
19+
#Read the MSR register
20+
mfs r8, rmsr
21+
#Set the interrupt enable bit
22+
ori r8, r8, 0x20
23+
#Save the MSR register
24+
mts rmsr, r8
25+
#Return
26+
rtsd r15, 8
27+
nop
28+
#endif /*CONFIG_MICROBLAZE_USE_MSR_INSTR == 1*/
29+
.end microblaze_enable_icache
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright (c) 2023 Advanced Micro Devices, Inc. (AMD)
3+
* Copyright (c) 2023 Alp Sayin <alpsayin@gmail.com>
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
9+
10+
.text
11+
.globl microblaze_enable_interrupts
12+
.ent microblaze_enable_interrupts
13+
.balign 4
14+
microblaze_enable_interrupts:
15+
#if CONFIG_MICROBLAZE_USE_MSR_INSTR == 1
16+
rtsd r15, 8
17+
msrset r0, 0x2
18+
nop
19+
#else /*CONFIG_MICROBLAZE_USE_MSR_INSTR == 1*/
20+
#Read the MSR register
21+
mfs r12, rmsr
22+
#Set the interrupt enable bit
23+
ori r12, r12, 0x2
24+
#Save the MSR register
25+
mts rmsr, r12
26+
#Return
27+
rtsd r15, 8
28+
nop
29+
#endif /*CONFIG_MICROBLAZE_USE_MSR_INSTR == 1*/
30+
.end microblaze_enable_interrupts

0 commit comments

Comments
 (0)