diff --git a/arch/arm/include/stm32f7/stm32f76xx77xx_irq.h b/arch/arm/include/stm32f7/stm32f76xx77xx_irq.h index 5d5f8d21209..fc6c6d1287a 100644 --- a/arch/arm/include/stm32f7/stm32f76xx77xx_irq.h +++ b/arch/arm/include/stm32f7/stm32f76xx77xx_irq.h @@ -179,7 +179,6 @@ #define STM32_IRQ_MDIOS (STM32_IRQ_FIRST + 109) /* 109: MDIO slave global interrupt */ #define STM32_IRQ_NEXTINTS 110 -#define STM32_IRQ_NIRQS (STM32_IRQ_FIRST + 110) /* EXTI interrupts (Do not use IRQ numbers) */ diff --git a/arch/arm/src/imxrt/imxrt_ehci.c b/arch/arm/src/imxrt/imxrt_ehci.c index 2a98806bdfb..3005066bea3 100644 --- a/arch/arm/src/imxrt/imxrt_ehci.c +++ b/arch/arm/src/imxrt/imxrt_ehci.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/imxrt/imxrt_ehci.c * - * Copyright (C) 2013-2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2013-2017, 2020 Gregory Nutt. All rights reserved. * Authors: Gregory Nutt * Dave Marples * diff --git a/arch/arm/src/imxrt/imxrt_usdhc.c b/arch/arm/src/imxrt/imxrt_usdhc.c index 76e3bf88a7f..a138a152e5f 100644 --- a/arch/arm/src/imxrt/imxrt_usdhc.c +++ b/arch/arm/src/imxrt/imxrt_usdhc.c @@ -78,7 +78,7 @@ /* Configuration ************************************************************/ -#if ((defined(CONFIG_IMXRT_USDHC1) && !defined(CONFIG_IMXRT_USDHC2)) || \ +#if ((defined(CONFIG_IMXRT_USDHC1) && !defined(CONFIG_IMXRT_USDHC2)) || \ (defined(CONFIG_IMXRT_USDHC2) && !defined(CONFIG_IMXRT_USDHC1))) # define IMXRT_MAX_SDHC_DEV_SLOTS 1 #elif (defined(CONFIG_IMXRT_USDHC1) && defined(CONFIG_IMXRT_USDHC2)) @@ -1232,11 +1232,30 @@ static int imxrt_interrupt(int irq, void *context, FAR void *arg) /* We don't want any more ints now, so switch it off */ - priv->cintints = 0; regval &= ~USDHC_INT_CINT; + priv->cintints = regval; putreg32(regval, priv->addr + IMXRT_USDHC_IRQSIGEN_OFFSET); } + if ((pending & USDHC_INT_CINS) != 0 || (pending & USDHC_INT_CRM) != 0) + { + if (up_interrupt_context()) + { + /* Yes.. queue it */ + + mcinfo("Queuing callback to %p(%p)\n", priv->callback, priv->cbarg); + (void)work_queue(HPWORK, &priv->cbwork, (worker_t)priv->callback, + priv->cbarg, 0); + } + else + { + /* No.. then just call the callback here */ + + mcinfo("Callback to %p(%p)\n", priv->callback, priv->cbarg); + priv->callback(priv->cbarg); + } + } + /* Handle wait events *****************************************************/ pending = enabled & priv->waitints; @@ -3019,7 +3038,14 @@ void imxrt_usdhc_set_sdio_card_isr(FAR struct sdio_dev_s *dev, priv->cintints = 0; } - flags = enter_critical_section(); +#if defined(CONFIG_MMCSD_HAVE_CARDDETECT) + if (priv->sw_cd_gpio == 0) + { + priv->cintints |= USDHC_INT_CINS | USDHC_INT_CRM; + } +#endif + + flags = enter_critical_section(); regval = getreg32(priv->addr + IMXRT_USDHC_IRQSIGEN_OFFSET); regval = (regval & ~USDHC_INT_CINT) | priv->cintints; putreg32(regval, priv->addr + IMXRT_USDHC_IRQSIGEN_OFFSET); diff --git a/arch/arm/src/stm32f7/stm32_irq.c b/arch/arm/src/stm32f7/stm32_irq.c index b43b36f6712..aea4de9aa0c 100644 --- a/arch/arm/src/stm32f7/stm32_irq.c +++ b/arch/arm/src/stm32f7/stm32_irq.c @@ -494,7 +494,7 @@ void up_irqinitialize(void) irq_attach(STM32_IRQ_RESERVED, stm32_reserved, NULL); #endif - stm32_dumpnvic("initial", STM32_IRQ_NIRQS); + stm32_dumpnvic("initial", NR_IRQS); /* If a debugger is connected, try to prevent it from catching hardfaults. * If CONFIG_ARMV7M_USEBASEPRI, no hardfaults are expected in normal diff --git a/arch/arm/src/stm32h7/stm32_irq.c b/arch/arm/src/stm32h7/stm32_irq.c index 0e878c972d4..b050e3c5d41 100644 --- a/arch/arm/src/stm32h7/stm32_irq.c +++ b/arch/arm/src/stm32h7/stm32_irq.c @@ -519,7 +519,7 @@ void up_irqinitialize(void) irq_attach(STM32_IRQ_RESERVED, stm32_reserved, NULL); #endif - stm32_dumpnvic("initial", STM32_IRQ_NIRQS); + stm32_dumpnvic("initial", NR_IRQS); /* If a debugger is connected, try to prevent it from catching hardfaults. * If CONFIG_ARMV7M_USEBASEPRI, no hardfaults are expected in normal diff --git a/arch/risc-v/include/fe310/irq.h b/arch/risc-v/include/fe310/irq.h index f330ead01b7..78c60b319ce 100644 --- a/arch/risc-v/include/fe310/irq.h +++ b/arch/risc-v/include/fe310/irq.h @@ -46,6 +46,7 @@ /* In mstatus register */ #define MSTATUS_MIE (0x1 << 3) /* Machine Interrupt Enable */ +#define MSTATUS_MPIE (0x1 << 7) /* Machine Previous Interrupt Enable */ /* In mie (machine interrupt enable) register */ diff --git a/arch/risc-v/src/fe310/fe310_clockconfig.c b/arch/risc-v/src/fe310/fe310_clockconfig.c index 6adb34c2896..cb9606fb322 100644 --- a/arch/risc-v/src/fe310/fe310_clockconfig.c +++ b/arch/risc-v/src/fe310/fe310_clockconfig.c @@ -1,5 +1,5 @@ /**************************************************************************** - * arch/arm/src/fe310/fe310_clockconfig.c + * arch/risc-v/src/fe310/fe310_clockconfig.c * * Copyright (C) 2019 Masayuki Ishikawa. All rights reserved. * Author: Masayuki Ishikawa diff --git a/arch/risc-v/src/fe310/fe310_clockconfig.h b/arch/risc-v/src/fe310/fe310_clockconfig.h index 9ecf280beac..b7cda135a44 100644 --- a/arch/risc-v/src/fe310/fe310_clockconfig.h +++ b/arch/risc-v/src/fe310/fe310_clockconfig.h @@ -1,5 +1,5 @@ /**************************************************************************** - * arch/arm/src/fe310/fe310_clockconfig.h + * arch/risc-v/src/fe310/fe310_clockconfig.h * * Copyright (C) 2019 Masayuki Ishikawa. All rights reserved. * Author: Masayuki Ishikawa diff --git a/arch/risc-v/src/fe310/fe310_gpio.c b/arch/risc-v/src/fe310/fe310_gpio.c index 71ed36f4791..c9905477410 100644 --- a/arch/risc-v/src/fe310/fe310_gpio.c +++ b/arch/risc-v/src/fe310/fe310_gpio.c @@ -1,5 +1,5 @@ /**************************************************************************** - * arch/arm/src/fe310/fe310_gpio.c + * arch/risc-v/src/fe310/fe310_gpio.c * * Copyright (C) 2019 Masayuki Ishikawa. All rights reserved. * Author: Masayuki Ishikawa diff --git a/arch/risc-v/src/fe310/fe310_irq.c b/arch/risc-v/src/fe310/fe310_irq.c index 7049599ee1b..7fabc9a6a23 100644 --- a/arch/risc-v/src/fe310/fe310_irq.c +++ b/arch/risc-v/src/fe310/fe310_irq.c @@ -100,7 +100,6 @@ void up_irqinitialize(void) /* Attach the ecall interrupt handler */ irq_attach(FE310_IRQ_ECALLM, up_swint, NULL); - up_enable_irq(FE310_IRQ_ECALLM); #ifndef CONFIG_SUPPRESS_INTERRUPTS @@ -188,13 +187,13 @@ void up_enable_irq(int irq) * Name: up_get_newintctx * * Description: - * Return a value for EPIC. But FE310 doesn't use EPIC for event control. + * Return initial mstatus when a task is created. * ****************************************************************************/ uint32_t up_get_newintctx(void) { - return 0; + return (MSTATUS_MPIE | MSTATUS_MIE); } /**************************************************************************** @@ -238,7 +237,7 @@ irqstate_t up_irq_save(void) void up_irq_restore(irqstate_t flags) { - /* Machine mode - mstatus */ + /* Write flags to mstatus */ asm volatile("csrw mstatus, %0" : /* no output */ : "r" (flags)); } diff --git a/arch/risc-v/src/fe310/fe310_serial.c b/arch/risc-v/src/fe310/fe310_serial.c index 704dc4b5447..1fca0669a19 100644 --- a/arch/risc-v/src/fe310/fe310_serial.c +++ b/arch/risc-v/src/fe310/fe310_serial.c @@ -398,6 +398,11 @@ static int up_interrupt(int irq, void *context, FAR void *arg) status = up_serialin(priv, UART_IP_OFFSET); + if (status == 0) + { + break; + } + if (status & UART_IP_RXWM) { /* Process incoming bytes */ @@ -405,9 +410,12 @@ static int up_interrupt(int irq, void *context, FAR void *arg) uart_recvchars(dev); } - /* Process outgoing bytes */ + if (status & UART_IP_TXWM) + { + /* Process outgoing bytes */ - uart_xmitchars(dev); + uart_xmitchars(dev); + } } return OK; diff --git a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_bringup.c b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_bringup.c index e38c96b1a01..c7376087306 100644 --- a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_bringup.c +++ b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_bringup.c @@ -1,7 +1,7 @@ /**************************************************************************** * boards/arm/imxrt/imxrt1060-evk/src/imxrt_bringup.c * - * Copyright (C) 2018 Gregory Nutt. All rights reserved. + * Copyright (C) 2018, 2020 Gregory Nutt. All rights reserved. * Authors: Gregory Nutt * David Sidrane * @@ -121,7 +121,10 @@ static int nsh_sdmmc_initialize(void) "ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n", ret); } + + imxrt_usdhc_set_sdio_card_isr(sdmmc, NULL, NULL); } + return OK; } #else diff --git a/drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c b/drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c index 041a83b305d..85af417f2c1 100644 --- a/drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c +++ b/drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c @@ -623,7 +623,7 @@ static void bcmf_poll_work(FAR void *arg) /* Setup the watchdog poll timer again */ wd_start(priv->bc_txpoll, BCMF_WDDELAY, bcmf_poll_expiry, 1, - , (wdparm_t)priv); + (wdparm_t)priv); exit_unlock: net_unlock(); } diff --git a/fs/vfs/fs_read.c b/fs/vfs/fs_read.c index 9422183f2eb..994c6139aa3 100644 --- a/fs/vfs/fs_read.c +++ b/fs/vfs/fs_read.c @@ -60,7 +60,7 @@ * Name: file_read * * Description: - * file_read() is an interanl OS interface. It is functionally similar to + * file_read() is an internal OS interface. It is functionally similar to * the standard read() interface except: * * - It does not modify the errno variable, diff --git a/include/nuttx/net/net.h b/include/nuttx/net/net.h index e86ebadb330..0d1f230de8d 100644 --- a/include/nuttx/net/net.h +++ b/include/nuttx/net/net.h @@ -466,18 +466,6 @@ int net_lockedwait_uninterruptible(sem_t *sem); FAR struct iob_s *net_ioballoc(bool throttled, enum iob_user_e consumerid); #endif -/**************************************************************************** - * Name: net_setipid - * - * Description: - * This function may be used at boot time to set the initial ip_id. - * - * Assumptions: - * - ****************************************************************************/ - -void net_setipid(uint16_t id); - /**************************************************************************** * Name: net_checksd * diff --git a/net/inet/Make.defs b/net/inet/Make.defs index 07895886f82..980db1bf49a 100644 --- a/net/inet/Make.defs +++ b/net/inet/Make.defs @@ -47,7 +47,6 @@ endif ifeq ($(CONFIG_NET_IPv4),y) SOCK_CSRCS += ipv4_setsockopt.c ipv4_getsockname.c ipv4_getpeername.c -SOCK_CSRCS += inet_setipid.c endif ifeq ($(CONFIG_NET_IPv6),y) diff --git a/net/inet/inet.h b/net/inet/inet.h index 154f149c2c1..54adbde7747 100644 --- a/net/inet/inet.h +++ b/net/inet/inet.h @@ -129,18 +129,6 @@ struct tcp_conn_s; /* Forward reference */ #endif struct socket; /* Forward reference */ -/**************************************************************************** - * Name: inet_setipid - * - * Description: - * This function may be used at boot time to set the initial ip_id. - * - * Assumptions: - * - ****************************************************************************/ - -void inet_setipid(uint16_t id); - /**************************************************************************** * Name: inet_sockif * @@ -159,7 +147,7 @@ void inet_setipid(uint16_t id); ****************************************************************************/ FAR const struct sock_intf_s * - inet_sockif(sa_family_t family, int type, int protocol); +inet_sockif(sa_family_t family, int type, int protocol); /**************************************************************************** * Name: ipv4_setsockopt and ipv6_setsockopt diff --git a/net/inet/inet_setipid.c b/net/inet/inet_setipid.c deleted file mode 100644 index 16ce2c111f7..00000000000 --- a/net/inet/inet_setipid.c +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** - * net/inet/net_setipid.c - * - * Copyright (C) 2007, 2009, 2017 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#ifdef CONFIG_NET - -#include -#include - -#include "inet/inet.h" - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: inet_setipid - * - * Description: - * This function may be used at boot time to set the initial ip_id. - * - * Assumptions: - * - ****************************************************************************/ - -void inet_setipid(uint16_t id) -{ - g_ipid = id; -} - -#endif /* CONFIG_NET */