blob: 843dbf12d8b0553463a09fa317dcdfa1a181b2de (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
id = 2186
title = "riscv virt pflash0 writes not supported"
state = "closed"
created_at = "2024-02-22T14:53:03.207Z"
closed_at = "2024-02-26T10:17:39.981Z"
labels = []
url = "https://gitlab.com/qemu-project/qemu/-/issues/2186"
host-os = "Artix Linux"
host-arch = "x86"
qemu-version = "latest master (commit hash: 760b4dcddd)"
guest-os = "- OS/kernel version:"
guest-arch = "## Description of problem"
description = """I am using GDB to debug some Firmware related stuff. At some point in the execution my BIOS/Firmware writes into some global variable (at 0x2000525C) inside the .bss section which is linked to be inside the memory mapped pflash0. But when I step forward with GDB to the exact location where the store instruction (sw) is executed, QEMU prints the following:
```
pflash_write: Unimplemented flash cmd sequence (offset 000000000000525c, wcycle 0x0 cmd 0x0 value 0x1)
```
According to the top of `hw/block/pflash_cfi01.c` Flash writes are supported. I was also under the impression that the flash is memory mapped, but maybe that is not true? I am probably missing something here so it would be nice if someone could point me in the right direction. I would also gladly contribute if there is something missing in the riscv virt target.
I made a simple program to more easily reproduce this:
```
.section .text
.global _start
_start:
\tlui a5, 0x20000
\tli a4, 5
\tsw a4, 24(a5)
```
results in QEMU error msg:
```
pflash_write: Unimplemented flash cmd sequence (offset 0000000000000018, wcycle 0x0 cmd 0x0 value 0x5)
```"""
reproduce = """1. compile above assembly program like this:
```
riscv64-unknown-elf-gcc -nostdlib -O0 bios.S
riscv64-unknown-elf-objcopy -O binary a.out
truncate -s 33554432 a.out
```
2. start QEMU like this:
```
qemu-system-riscv64 -M virt -bios none -drive if=pflash,format=raw,unit=0,file=a.out -nographic -d unimp
```
3. notice the error message printed by QEMU"""
additional = "n/a"
|