Added USB interrupt handler. And defined some macros regarding USB.

This commit is contained in:
Deval Shah
2016-07-22 13:57:11 +05:30
committed by Pavel Pisa
parent 0055b65986
commit 1c62f7ee2d
3 changed files with 25 additions and 0 deletions

View File

@@ -36,6 +36,7 @@
#define BCM2835_INTC_TOTAL_IRQ 64 + 8
#define BCM2835_IRQ_ID_USB 9
#define BCM2835_IRQ_ID_AUX 29
#define BCM2835_IRQ_ID_SPI_SLAVE 43
#define BCM2835_IRQ_ID_PWA0 45

View File

@@ -336,6 +336,15 @@
/** @} */
/**
* @name USB Registers
*
* @{
*/
#define BCM2835_USB_BASE (RPI_PERIPHERAL_BASE + 0x980000) /* DTC_OTG USB controller */
/** @} */
/** @} */

View File

@@ -91,6 +91,11 @@ void bsp_interrupt_dispatch(void)
{
vector = BCM2835_IRQ_ID_SPI;
}
/* USB */
else if ( BCM2835_REG(BCM2835_IRQ_PENDING1) & BCM2835_BIT(9) )
{
vector = BCM2835_IRQ_ID_USB;
}
if ( vector < 255 )
{
@@ -144,6 +149,11 @@ rtems_status_code bsp_interrupt_vector_enable(rtems_vector_number vector)
{
BCM2835_REG(BCM2835_IRQ_ENABLE2) = BCM2835_BIT(22);
}
/* USB */
else if ( vector == BCM2835_IRQ_ID_USB )
{
BCM2835_REG(BCM2835_IRQ_ENABLE1) = BCM2835_BIT(9);
}
rtems_interrupt_enable(level);
@@ -194,6 +204,11 @@ rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
{
BCM2835_REG(BCM2835_IRQ_DISABLE2) = BCM2835_BIT(22);
}
/* USB */
else if ( vector == BCM2835_IRQ_ID_USB )
{
BCM2835_REG(BCM2835_IRQ_DISABLE1) = BCM2835_BIT(9);
}
rtems_interrupt_enable(level);