documentation icon indicating copy to clipboard operation
documentation copied to clipboard

BCM2711: AUX_MU_IER_REG bit positions wrong?

Open MrMino opened this issue 3 years ago • 9 comments

Latest BCM2711 Peripherals documentation (Jan 18 2022) states the following about AUX_MU_IER_REG (when DLAB=0) :

Bit Name Description Type Reset
1 Enable receive If this bit is set the interrupt line is asserted whenever the receive FIFO holds at least 1 byte. If this bit is clear no receive interrupts are generated. RW 0x0
0 Enable transmit If this bit is set the interrupt line is asserted whenever the transmit FIFO is empty. If this bit is clear no transmit interrupts are generated. RW 0x0

Poking around, it seems to me like this is not the case - the bit numbers are backwards.

Setting bit 1 in a code that expects an interrupt when a key is pressed in an uart console leaves me with IRQ 125 storming the CPU. Setting bit 0 has the correct behavior - it fires an interrupt only once, when I press the key. The code clears the FIFO and nothing else happens.

Am I misreading something here or is this a documentation bug?

MrMino avatar Jan 28 '22 22:01 MrMino

This seems to be a documentation bug, dating back to the BCM2835 documentation: https://elinux.org/BCM2835_datasheet_errata#p12

Bits 1:0 are swaped. bit 0 is receive interrupt and bit 1 is transmit.

You can find an updated unofficial version of the BCM2835 documentation here: https://github.com/raspberrypi/documentation/issues/325#issuecomment-362877591

Kristine1975 avatar Jan 29 '22 09:01 Kristine1975

ping @pelwell ?

lurch avatar Jan 29 '22 10:01 lurch

The kernel headers agree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/include/uapi/linux/serial_reg.h#n27 Since interrupts are enabled for ttyS0 and it seems to work, bit 0 must be receive and bit 1 transmit.

pelwell avatar Jan 31 '22 10:01 pelwell

Thanks @pelwell.

@lurch I'll assign this one to you as backlog for next time we update the BCM2711 Peripherals document.

aallan avatar Jan 31 '22 11:01 aallan

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar May 08 '22 02:05 github-actions[bot]

This is low priority, but should remain open until the "next time we update the BCM2711 Peripherals document".

lurch avatar May 08 '22 08:05 lurch

Ignore - wrong thread.

pelwell avatar May 08 '22 13:05 pelwell

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Jul 10 '22 02:07 github-actions[bot]

Still in backlog.

lurch avatar Jul 11 '22 12:07 lurch