firmware icon indicating copy to clipboard operation
firmware copied to clipboard

[Question] What are the other OTP Values?

Open jriwanek opened this issue 8 years ago • 34 comments

It's understood that 17 is where USB Host bit is programmed (3 instead of 1 in first column), 28 is the Serial, 30 is revision, and 32 is used atleast in part for the warrenty bit, but I was wondering what the other values are, and about any of the other numbers like say "x020000a" in 17.

jriwanek avatar Apr 16 '18 04:04 jriwanek

17 is the bootmode register and 18 is a copy: Bit 1 sets the oscillator frequency to 19.2MHz Bit 3 enables pull ups on the SDIO pins Bit 19 enabled GPIO bootmode Bit 20 sets the bank to check for GPIO bootmode Bit 21 enabled booting from SD card Bit 22 sets the bank to boot from Bit 28 enables USB device booting Bit 29 enables USB host booting (ethernet and mass storage)

28/29 is the serial number and ~serial

30 is revision number

64/65: MAC Address

66 is advanced boot: bits 0-6: gpio for ETH CLK output pin bit 7: enable ETH_CLK output bits 8-14: gpio for LAN_RUN output pin bit 15: enable LAN_RUN output bit 24: Extend USB HUB timeout parameter bit 25: ETH_CLK frequency: 0 - 25MHz 1 - 24MHz

On 16 April 2018 at 05:58, Jasmine Iwanek [email protected] wrote:

It's understood that 17 is where USB Host is programmed (3 instead of 1 in first column), 28 is the Serial, 30 is revision, and 32 is used atleast in part for the warrenty bit, but I was wondering what the other values are, and about any of the other numbers like say "x020000f" in 17.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/raspberrypi/firmware/issues/974, or mute the thread https://github.com/notifications/unsubscribe-auth/AB9CHCzWpnVcmiw89CVUGzRuP-o2FgIAks5tpCUTgaJpZM4TV31B .

ghollingworth avatar Apr 16 '18 09:04 ghollingworth

@ghollingworth Does this need to go in the docs somewhere?

JamesH65 avatar Apr 16 '18 09:04 JamesH65

Probably...

:)

Thanks for volunteering James...

ghollingworth avatar Apr 16 '18 10:04 ghollingworth

Added a docs issue

https://github.com/raspberrypi/documentation/issues/886

JamesH65 avatar Apr 16 '18 10:04 JamesH65

16 appears to be used: "6c280000" On a 1B+, "00280000" on 2B 1.1 and later, Bits 0 and 2 appear to be used from 17/18 on the 1B+, Any idea what they're for? 27 appears to be used: "00005050" on a 1B+ & 2B 1.1, "00007373" on a 2B 1.2, "00002727" on a 3B & "00001f1f" on a 3B+ 31 is the batch number 64 and 65 seem to be 0 on all my Pi's, Is one the WIFI and one the Ethernet, and if so, which is which?

jriwanek avatar Apr 16 '18 23:04 jriwanek

Also, you say 29 is "~Serial" What exactly is that?

And I believe 32 used to be used for warrenty bit, which bit exactly was used?

jriwanek avatar Apr 16 '18 23:04 jriwanek

The serial number of the Pi...

Everything else is manufacturer specific and silicon specific, i.e. you don't need to know

On 17 April 2018 at 00:54, Jasmine Iwanek [email protected] wrote:

Also, you say 29 is "~Serial" What exactly is that?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/raspberrypi/firmware/issues/974#issuecomment-381785810, or mute the thread https://github.com/notifications/unsubscribe-auth/AB9CHN_qwwKoBQMhOCCpewPyXxqmzgkwks5tpS87gaJpZM4TV31B .

ghollingworth avatar Apr 17 '18 10:04 ghollingworth

~ is the bitwise complement operator in many programming languages. So ~serial is the serial number with every bit flipped as a simple sanity check.

6by9 avatar Apr 17 '18 10:04 6by9

@ghollingworth Considering you didn't answer the question about the warranty bit, and that's not "manufacturer and silicon specific", nor is the bit to prevent overvolting it would appear your claim there is incorrect, It'd be nice to get a straight answer at least for those, And while I appreciate you're likely bound by NDA, It'd be nice if you'd give straight answers rather than gaslighting, I'd rather not have to mess with the OTP on one of my PI's needlessly just to get the answer to those questions.

To recap what I'd like to know:

  1. Which is Warrenty Bit (Does get set in current firmware, doesn't appear to be stored in otp)
  2. Which is Overvolt Prevention Bit (Appears to be 32 bit 0)
  3. 17/18 Bits 0 and 2 (If not used for 2)
  4. Why 64/65 are zeroed on every pi I've checked despite you saying they're for the MAC address, and Which is used for which MAC (Wifi/Ethernet)

jriwanek avatar Apr 20 '18 10:04 jriwanek

It'd be nice if you'd give straight answers rather than gaslighting

We are under no obligation to divulge any information about the OTP contents - Gordon has been more forthcoming than I would have expected. The answers have been very straight, so please adjust your attitude. Do you even know what the word "gaslighting" means?

pelwell avatar Apr 20 '18 10:04 pelwell

Yes, I do, And as I said, the issue is "x is all manufacturer and silicon specific" rather than "I'd rather not answer any further of your questions". Considering that said info could be gleaned from twidding settings in config.txt, clearly they're not.

jriwanek avatar Apr 20 '18 10:04 jriwanek

@jriwanek From what I have found the warranty bit is pretty much not used anymore. One place state that it is shown as the high bit of the board revision (30) and found in /proc/cpuinfo, and it was defined by:

(force_turbo || current_limit_override || temp_limit>85) && over_voltage>0)

I'm also curious to the MAC part, but each onboard chip already has a hard-coded MAC. So I guess that if you supply a new MAC in the cmdline, then perhaps it will show up there...

E3V3A avatar Apr 22 '18 10:04 E3V3A

The system will use the MAC address in the OTP in preference to the automatically generated one from the serial number. If you bought your own OUI you'd be able to program it in there. Can't remember at the moment whether I created a config.txt parameter to program it... try:

strings /boot/string | grep program

To see...

Gordon

ghollingworth avatar Apr 22 '18 12:04 ghollingworth

in current firmware, strings /boot/start.elf (I assume you typoed as there was no /boot/string), returns: program_batch_num (Sets value in 31) program_board_rev program_emmc_boot (Setting to 1 appears to do nothing on a zero) program_gpio_bootmode (already documented) program_mac_address program_serial_number program_serial_random program_usb_boot_mode (already documented) program_usb_boot_timeout (already documented)

jriwanek avatar Apr 22 '18 20:04 jriwanek

Okay, done some more testing, didn't set program_mac_address as I was using a pi zero and I don't want to really mess with that anyway, more questions:

  1. Parameter format for program_mac_address, I assume just the straight mac address as format like: "ffeeddbbaa998877"?
  2. As I couldn't test, is 64 ethernet, 65 wifi, the other way round or are they a mirror of each other and used for both?
  3. never_over_voltage=1 sets 32 bit 0 correct?
  4. overvolting sets the warrenty bit but the warrenty bit isn't stored in otp?
  5. is program_emmc_boot actually implemented and if so is it only available on a pi 3 and later like program_usb_boot?
  6. Is SPI and NAND boot implemented in current firmware and if not, could it be (and also documented on how to use) please
  7. Use of 17/18 bits 0 and 2

jriwanek avatar Apr 22 '18 23:04 jriwanek

Parameter format for program_mac_address, I assume just the straight mac address as format like: "ffeeddbbaa998877"?

program_mac_address=ff:ee:dd:bb:aa:99

As I couldn't test, is 64 ethernet, 65 wifi, the other way round or are they a mirror of each other and used for both?

WiFi is a modified version of the ethernet MAC address, uses the same OUI but rest is derived, same with the bluetooth MAC address

never_over_voltage=1 sets 32 bit 0 correct?

@popcornmix

overvolting sets the warrenty bit but the warrenty bit isn't stored in otp?

@popcornmix

is program_emmc_boot actually implemented and if so is it only available on a pi 3 and later like program_usb_boot?

Yes, but it doesn't do anything useful for you... It's used for CM3 just to help get around a bug in the bootrom

Is SPI and NAND boot implemented in current firmware and if not, could it be (and also documented on how to use) please

Currently not implemented in bootcode.bin or start.elf. Unlikely to be supported unless we've got a customer with a 100k CM3 order.

Use of 17/18 bits 0 and 2

Not used

ghollingworth avatar Apr 23 '18 09:04 ghollingworth

Okay, and pushing my luck maybe, How about 16 and 27? (Thanks btw for prior answers) I'm now putting together a small Python program to list all this stuff in a pretty way as a front end for vcgencmd.

jriwanek avatar Apr 23 '18 09:04 jriwanek

Sorry cannot comment on those

ghollingworth avatar Apr 23 '18 10:04 ghollingworth

Okay, so those are those mfr and silicon specific ones you mentioned, I won't ask further about them then.

Right, last questions barring the ones you've tagged popcorn to answer: 17/18 bits 4-18, 23-27, 30-31 66 bits 16-23, 26-31

and a side question on 17/18-0 and 2: I'm assuming the fact they're set on my 1B+ is just a programming error?

jriwanek avatar Apr 23 '18 10:04 jriwanek

17/18 everything else is unused / unusable bootcode functionality 66 nothing else in there

Are you sure bits 0 and 2 are set, because I wouldn't expect it to boot if they were

ghollingworth avatar Apr 23 '18 10:04 ghollingworth