qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Initial support for One-Time Programmable Memory (OTP) in BCM2835
@ 2024-05-18 20:01 Rayhan Faizel
  2024-05-18 20:01 ` [PATCH v2 1/3] hw/nvram: Add BCM2835 OTP device Rayhan Faizel
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rayhan Faizel @ 2024-05-18 20:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: philmd, peter.maydell, qemu-arm, Rayhan Faizel

All BCM2835 boards have on-board OTP memory with 66 32-bit rows. Usually,
its contents are accessible via mailbox commands.

[Changes in v2]

- Replace read/write with get/set in bcm2835_otp.c.
- Use impl instead of valid in bcm2835_otp.c.
- Replace all constant values with macros defined in bcm2835_otp.h.
- Change memory region size of OTP device to 0x80.
- After further testing on a real Raspberry Pi 3, I noticed a few things
contrary to my initial assumptions:
-- The customer OTP lock bit is bit 6 of row 32, NOT bit 30 of row 30. This is
currently undocumented to my knowledge.
-- The above lock indeed applies to the private key as well.

Rayhan Faizel (3):
  hw/nvram: Add BCM2835 OTP device
  hw/arm: Connect OTP device to BCM2835
  hw/misc: Implement mailbox properties for customer OTP and device
    specific private keys

 hw/arm/bcm2835_peripherals.c         |  15 ++-
 hw/misc/bcm2835_property.c           |  87 +++++++++++++
 hw/nvram/bcm2835_otp.c               | 187 +++++++++++++++++++++++++++
 hw/nvram/meson.build                 |   1 +
 include/hw/arm/bcm2835_peripherals.h |   3 +-
 include/hw/arm/raspberrypi-fw-defs.h |   2 +
 include/hw/misc/bcm2835_property.h   |   2 +
 include/hw/nvram/bcm2835_otp.h       |  67 ++++++++++
 8 files changed, 362 insertions(+), 2 deletions(-)
 create mode 100644 hw/nvram/bcm2835_otp.c
 create mode 100644 include/hw/nvram/bcm2835_otp.h

-- 
2.34.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-18 20:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-18 20:01 [PATCH v2 0/3] Initial support for One-Time Programmable Memory (OTP) in BCM2835 Rayhan Faizel
2024-05-18 20:01 ` [PATCH v2 1/3] hw/nvram: Add BCM2835 OTP device Rayhan Faizel
2024-05-18 20:01 ` [PATCH v2 2/3] hw/arm: Connect OTP device to BCM2835 Rayhan Faizel
2024-05-18 20:01 ` [PATCH v2 3/3] hw/misc: Implement mailbox properties for customer OTP and device specific private keys Rayhan Faizel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).