aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGreen Wan <green.wan@sifive.com>2020-10-20 11:37:32 +0800
committerAlistair Francis <alistair.francis@wdc.com>2020-10-22 12:00:50 -0700
commit51b6c1bbc3dd1b139a9e9b021d87bcfd7d82299e (patch)
tree04644e91396869bcad6af97d597b611292c8e101 /include
parenta54d259157e2575b69e2cf7cf03592c74559cb7e (diff)
downloadqemu-51b6c1bbc3dd1b139a9e9b021d87bcfd7d82299e.zip
qemu-51b6c1bbc3dd1b139a9e9b021d87bcfd7d82299e.tar.gz
qemu-51b6c1bbc3dd1b139a9e9b021d87bcfd7d82299e.tar.bz2
hw/misc/sifive_u_otp: Add backend drive support
Add '-drive' support to OTP device. Allow users to assign a raw file as OTP image. test commands for 16k otp.img filled with zero: $ dd if=/dev/zero of=./otp.img bs=1k count=16 $ ./qemu-system-riscv64 -M sifive_u -m 256M -nographic -bios none \ -kernel ../opensbi/build/platform/sifive/fu540/firmware/fw_payload.elf \ -d guest_errors -drive if=none,format=raw,file=otp.img Signed-off-by: Green Wan <green.wan@sifive.com> Reviewed-by: Bin Meng <bin.meng@windriver.com> Tested-by: Bin Meng <bin.meng@windriver.com> Acked-by: Alistair Francis <alistair.francis@wdc.com> Message-id: 20201020033732.12921-3-green.wan@sifive.com Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'include')
-rw-r--r--include/hw/misc/sifive_u_otp.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/hw/misc/sifive_u_otp.h b/include/hw/misc/sifive_u_otp.h
index ebffbc1..5d0d7df 100644
--- a/include/hw/misc/sifive_u_otp.h
+++ b/include/hw/misc/sifive_u_otp.h
@@ -46,6 +46,7 @@
#define SIFIVE_U_OTP_PA_MASK 0xfff
#define SIFIVE_U_OTP_NUM_FUSES 0x1000
+#define SIFIVE_U_OTP_FUSE_WORD 4
#define SIFIVE_U_OTP_SERIAL_ADDR 0xfc
#define SIFIVE_U_OTP_REG_SIZE 0x1000
@@ -80,6 +81,7 @@ struct SiFiveUOTPState {
uint32_t fuse_wo[SIFIVE_U_OTP_NUM_FUSES];
/* config */
uint32_t serial;
+ BlockBackend *blk;
};
#endif /* HW_SIFIVE_U_OTP_H */