Xtensa ESP32: Using wrong register to disable interrupts.
This commit is contained in:
parent
b506bd6ee6
commit
8de1127899
@ -77,6 +77,7 @@ config ARCH_X86
|
|||||||
|
|
||||||
config ARCH_XTENSA
|
config ARCH_XTENSA
|
||||||
bool "Xtensa"
|
bool "Xtensa"
|
||||||
|
select ARCH_HAVE_CUSTOMOPT
|
||||||
---help---
|
---help---
|
||||||
Cadence® Tensilica® Xtensa® actictures.
|
Cadence® Tensilica® Xtensa® actictures.
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ _xtensa_nmi_vector:
|
|||||||
s32i a0, sp, (4 * REG_A0)
|
s32i a0, sp, (4 * REG_A0)
|
||||||
|
|
||||||
s32i a2, sp, (4 * REG_A2)
|
s32i a2, sp, (4 * REG_A2)
|
||||||
movi a2, XTENSA_NMI_EXCEPTION /* Address of state save on stack */
|
movi a2, XTENSA_NMI_EXCEPTION /* Argument 1: Error code */
|
||||||
call0 _xtensa_panic /* Does not return */
|
call0 _xtensa_panic /* Does not return */
|
||||||
|
|
||||||
#else
|
#else
|
||||||
@ -245,7 +245,7 @@ _debug_exception_vector:
|
|||||||
s32i a0, sp, (4 * REG_A0)
|
s32i a0, sp, (4 * REG_A0)
|
||||||
|
|
||||||
s32i a2, sp, (4 * REG_A2)
|
s32i a2, sp, (4 * REG_A2)
|
||||||
movi a2, XTENSA_DEBUG_EXCEPTION /* Address of state save on stack */
|
movi a2, XTENSA_DEBUG_EXCEPTION /* Argument 1: Error code */
|
||||||
call0 _xtensa_panic /* Does not return */
|
call0 _xtensa_panic /* Does not return */
|
||||||
|
|
||||||
.end literal_prefix
|
.end literal_prefix
|
||||||
@ -284,7 +284,7 @@ _double_exception_vector:
|
|||||||
s32i a0, sp, (4 * REG_A0)
|
s32i a0, sp, (4 * REG_A0)
|
||||||
|
|
||||||
s32i a2, sp, (4 * REG_A2)
|
s32i a2, sp, (4 * REG_A2)
|
||||||
movi a2, XTENSA_DOUBLE_EXCEPTION /* Address of state save on stack */
|
movi a2, XTENSA_DOUBLE_EXCEPTION /* Argument 1: Error code */
|
||||||
call0 _xtensa_panic /* Does not return */
|
call0 _xtensa_panic /* Does not return */
|
||||||
|
|
||||||
.end literal_prefix
|
.end literal_prefix
|
||||||
@ -321,7 +321,7 @@ _kernel_exception_vector:
|
|||||||
s32i a0, sp, (4 * REG_A0)
|
s32i a0, sp, (4 * REG_A0)
|
||||||
|
|
||||||
s32i a2, sp, (4 * REG_A2)
|
s32i a2, sp, (4 * REG_A2)
|
||||||
movi a2, XTENSA_KERNEL_EXCEPTION /* Address of state save on stack */
|
movi a2, XTENSA_KERNEL_EXCEPTION /* Argument 1: Error code */
|
||||||
call0 _xtensa_panic /* Does not return */
|
call0 _xtensa_panic /* Does not return */
|
||||||
|
|
||||||
.end literal_prefix
|
.end literal_prefix
|
||||||
|
@ -1047,8 +1047,11 @@ static int esp32_receive(struct uart_dev_s *dev, unsigned int *status)
|
|||||||
static void esp32_rxint(struct uart_dev_s *dev, bool enable)
|
static void esp32_rxint(struct uart_dev_s *dev, bool enable)
|
||||||
{
|
{
|
||||||
struct esp32_dev_s *priv = (struct esp32_dev_s *)dev->priv;
|
struct esp32_dev_s *priv = (struct esp32_dev_s *)dev->priv;
|
||||||
|
irqstate_t flags;
|
||||||
int regval;
|
int regval;
|
||||||
|
|
||||||
|
flags = enter_critical_section();
|
||||||
|
|
||||||
if (enable)
|
if (enable)
|
||||||
{
|
{
|
||||||
/* Receive an interrupt when their is anything in the Rx data register (or an Rx
|
/* Receive an interrupt when their is anything in the Rx data register (or an Rx
|
||||||
@ -1066,10 +1069,13 @@ static void esp32_rxint(struct uart_dev_s *dev, bool enable)
|
|||||||
{
|
{
|
||||||
/* Disable the RX interrupts */
|
/* Disable the RX interrupts */
|
||||||
|
|
||||||
esp32_serialout(priv, UART_INT_CLR_OFFSET,
|
regval = esp32_serialin(priv, UART_INT_ENA_OFFSET);
|
||||||
(UART_RXFIFO_FULL_INT_CLR_S | UART_FRM_ERR_INT_CLR_S |
|
regval &= ~(UART_RXFIFO_FULL_INT_CLR_S | UART_FRM_ERR_INT_CLR_S |
|
||||||
UART_RXFIFO_TOUT_INT_CLR_S));
|
UART_RXFIFO_TOUT_INT_CLR_S);
|
||||||
|
esp32_serialout(priv, UART_INT_ENA_OFFSET, regval);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
leave_critical_section(flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -1114,13 +1120,12 @@ static void esp32_txint(struct uart_dev_s *dev, bool enable)
|
|||||||
{
|
{
|
||||||
struct esp32_dev_s *priv = (struct esp32_dev_s *)dev->priv;
|
struct esp32_dev_s *priv = (struct esp32_dev_s *)dev->priv;
|
||||||
irqstate_t flags;
|
irqstate_t flags;
|
||||||
|
int regval;
|
||||||
|
|
||||||
flags = enter_critical_section();
|
flags = enter_critical_section();
|
||||||
|
|
||||||
if (enable)
|
if (enable)
|
||||||
{
|
{
|
||||||
uint32_t regval;
|
|
||||||
|
|
||||||
/* Set to receive an interrupt when the TX holding register register
|
/* Set to receive an interrupt when the TX holding register register
|
||||||
* is empty
|
* is empty
|
||||||
*/
|
*/
|
||||||
@ -1141,8 +1146,9 @@ static void esp32_txint(struct uart_dev_s *dev, bool enable)
|
|||||||
{
|
{
|
||||||
/* Disable the TX interrupt */
|
/* Disable the TX interrupt */
|
||||||
|
|
||||||
esp32_serialout(priv, UART_INT_CLR_OFFSET,
|
regval = esp32_serialin(priv, UART_INT_ENA_OFFSET);
|
||||||
(UART_TX_DONE_INT_CLR_S | UART_TXFIFO_EMPTY_INT_CLR_S));
|
regval &= ~(UART_TX_DONE_INT_ENA_S | UART_TXFIFO_EMPTY_INT_ENA_S);
|
||||||
|
esp32_serialout(priv, UART_INT_ENA_OFFSET, regval);
|
||||||
}
|
}
|
||||||
|
|
||||||
leave_critical_section(flags);
|
leave_critical_section(flags);
|
||||||
|
Loading…
Reference in New Issue
Block a user