Interrupt Bridge

Passes interrupts lines from Earl Grey through to Sonata. Earl Grey controls which interrupt lines are sent.

Theory of Operations

A fixed subset of Earl Grey interrupt lines are connected into the interrupt bridge. There is an enable bit for each interrupt. When the interrupt is enabled it is sent through to Sonata. The pass through uses a simple masking scheme. When enabling an interrupt through the bridge if an interrupt is raised on the Earl Grey side it will be instantly raised on the Sonata side. Similarly when disabling an interrupt through the bridge whilst it is raised it will be instanatly dropped on the Sonata side.

When Earl Grey is donating a peripheral to Sonata and enabling the relevant interrupts on the bridge it is recommended interrupts are disabled at the peripheral to avoid Sonata receiving interrupts during the donation process. The expectation is Sonata will enable the interrupts it is interested in when the peripheral donation is complete. Similarly interrupts should be disabled at the peripheral when Sonata is releasing the donated peripheral back to Earl Grey.

Registers

Enable Register

Read-write

One bit per interrupt enable. Each register has 32 enable bits. The bit index within this register of an enable is Bridge ID % 32. The index of the register of an enable is Bridge ID / 32.

Register Offsets

Register NameOffset
Enable 00x0
Enable 10x4
Enable 20x8
Enable 30xc

Interrupt Mapping Table

This table provides a mapping from the Earl Grey PLIC IRQ IDs to the Interrupt Bridge IDs

Interrupt NameEarl Grey PLIC IRQ IDInterrupt Bridge ID
Uart0TxWatermark10
Uart0RxWatermark21
Uart0TxEmpty32
Uart0RxOverflow43
Uart0RxFrameErr54
Uart0RxBreakErr65
Uart0RxTimeout76
Uart0RxParityErr87
Uart1TxWatermark98
Uart1RxWatermark109
Uart1TxEmpty1110
Uart1RxOverflow1211
Uart1RxFrameErr1312
Uart1RxBreakErr1413
Uart1RxTimeout1514
Uart1RxParityErr1615
Uart2TxWatermark1716
Uart2RxWatermark1817
Uart2TxEmpty1918
Uart2RxOverflow2019
Uart2RxFrameErr2120
Uart2RxBreakErr2221
Uart2RxTimeout2322
Uart2RxParityErr2423
Uart3TxWatermark2524
Uart3RxWatermark2625
Uart3TxEmpty2726
Uart3RxOverflow2827
Uart3RxFrameErr2928
Uart3RxBreakErr3029
Uart3RxTimeout3130
Uart3RxParityErr3231
SpiDeviceGenericRxFull6532
SpiDeviceGenericRxWatermark6633
SpiDeviceGenericTxWatermark6734
SpiDeviceGenericRxError6835
SpiDeviceGenericRxOverflow6936
SpiDeviceGenericTxUnderflow7037
SpiDeviceUploadCmdfifoNotEmpty7138
SpiDeviceUploadPayloadNotEmpty7239
SpiDeviceUploadPayloadOverflow7340
SpiDeviceReadbufWatermark7441
SpiDeviceReadbufFlip7542
SpiDeviceTpmHeaderNotEmpty7643
I2c0FmtThreshold7744
I2c0RxThreshold7845
I2c0FmtOverflow7946
I2c0RxOverflow8047
I2c0Nak8148
I2c0SclInterference8249
I2c0SdaInterference8350
I2c0StretchTimeout8451
I2c0SdaUnstable8552
I2c0CmdComplete8653
I2c0TxStretch8754
I2c0TxOverflow8855
I2c0AcqFull8956
I2c0UnexpStop9057
I2c0HostTimeout9158
I2c1FmtThreshold9259
I2c1RxThreshold9360
I2c1FmtOverflow9461
I2c1RxOverflow9562
I2c1Nak9663
I2c1SclInterference9764
I2c1SdaInterference9865
I2c1StretchTimeout9966
I2c1SdaUnstable10067
I2c1CmdComplete10168
I2c1TxStretch10269
I2c1TxOverflow10370
I2c1AcqFull10471
I2c1UnexpStop10572
I2c1HostTimeout10673
I2c2FmtThreshold10774
I2c2RxThreshold10875
I2c2FmtOverflow10976
I2c2RxOverflow11077
I2c2Nak11178
I2c2SclInterference11279
I2c2SdaInterference11380
I2c2StretchTimeout11481
I2c2SdaUnstable11582
I2c2CmdComplete11683
I2c2TxStretch11784
I2c2TxOverflow11885
I2c2AcqFull11986
I2c2UnexpStop12087
I2c2HostTimeout12188
SpiHost0Error13189
SpiHost0SpiEvent13290
SpiHost1Error13391
SpiHost1SpiEvent13492
UsbdevPktReceived13593
UsbdevPktSent13694
UsbdevDisconnected13795
UsbdevHostLost13896
UsbdevLinkReset13997
UsbdevLinkSuspend14098
UsbdevLinkResume14199
UsbdevAvEmpty142100
UsbdevRxFull143101
UsbdevAvOverflow144102
UsbdevLinkInErr145103
UsbdevRxCrcErr146104
UsbdevRxPidErr147105
UsbdevRxBitstuffErr148106
UsbdevFrame149107
UsbdevPowered150108
UsbdevLinkOutErr151109