Mailbox property: RPI_FIRMWARE_GET_CUSTOMER_OTP
stefan.wahren at i2se.com
Tue Jan 2 08:49:45 PST 2018
> Phil Elwell <phil at raspberrypi.org> hat am 2. Januar 2018 um 15:10 geschrieben:
> Hi Stefan,
> On 28/12/2017 17:50, Stefan Wahren wrote:
> > Hi,
> > i made an attempt to write an NVMEM / OTP driver for the Raspberry Pi . Instead of accessing the registers from the ARM core i decided to use the Mailbox property interface of the GPU firmware. Unfortunately a documentation of property RPI_FIRMWARE_GET_CUSTOMER_OTP isn't available here .
> I don't see any reason why that property couldn't be documented - consider it an oversight.
> > So the following questions comes to my mind:
> > What is the proper definition of Request/Response?
> The request takes two parameters - an index and a length, both in 32-bit word
> units. The response contains the index and length, and adds the requested number
> of words as read from the customer area of the OTP, such that the buffer should
> be at least (2 + length) * 4 bytes long. Attempts to read outside the customer
> area will fail, returning the usual error code (0x80000000).
Looks like the enum definition in /include/soc/bcm2835/raspberrypi-firmware.h is wrong (maybe coming from the wrong documentation):
RPI_FIRMWARE_STATUS_SUCCESS = 0x80000000,
RPI_FIRMWARE_STATUS_ERROR = 0x80000001,
Btw does this struct also applies to RPI_FIRMWARE_SET_CUSTOMER_OTP?
> > How long is the OTP register range in bytes?
> The customer area of the OTP is 8 words long, addressable using index values 0 to 7.
> It is intended for customer applications, and will contains zeroes in an off-the-shelf
> > Can anyone help?
> I hope so.
Thank you very much, it work ...
> > Best regards
> > Stefan
> >  - https://github.com/lategoodbye/rpi-zero/tree/bcm2835-otp
> >  - https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface
More information about the linux-rpi-kernel