Merge branch 'master' of github.com:apache/incubator-nuttx

This commit is contained in:
Gregory Nutt
2020-01-07 08:14:29 -06:00
18 changed files with 56 additions and 112 deletions
@@ -179,7 +179,6 @@
#define STM32_IRQ_MDIOS (STM32_IRQ_FIRST + 109) /* 109: MDIO slave global interrupt */ #define STM32_IRQ_MDIOS (STM32_IRQ_FIRST + 109) /* 109: MDIO slave global interrupt */
#define STM32_IRQ_NEXTINTS 110 #define STM32_IRQ_NEXTINTS 110
#define STM32_IRQ_NIRQS (STM32_IRQ_FIRST + 110)
/* EXTI interrupts (Do not use IRQ numbers) */ /* EXTI interrupts (Do not use IRQ numbers) */
+1 -1
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/imxrt/imxrt_ehci.c * 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 <gnutt@nuttx.org> * Authors: Gregory Nutt <gnutt@nuttx.org>
* Dave Marples <dave@marples.net> * Dave Marples <dave@marples.net>
* *
+29 -3
View File
@@ -78,7 +78,7 @@
/* Configuration ************************************************************/ /* 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))) (defined(CONFIG_IMXRT_USDHC2) && !defined(CONFIG_IMXRT_USDHC1)))
# define IMXRT_MAX_SDHC_DEV_SLOTS 1 # define IMXRT_MAX_SDHC_DEV_SLOTS 1
#elif (defined(CONFIG_IMXRT_USDHC1) && defined(CONFIG_IMXRT_USDHC2)) #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 */ /* We don't want any more ints now, so switch it off */
priv->cintints = 0;
regval &= ~USDHC_INT_CINT; regval &= ~USDHC_INT_CINT;
priv->cintints = regval;
putreg32(regval, priv->addr + IMXRT_USDHC_IRQSIGEN_OFFSET); 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 *****************************************************/ /* Handle wait events *****************************************************/
pending = enabled & priv->waitints; pending = enabled & priv->waitints;
@@ -3019,7 +3038,14 @@ void imxrt_usdhc_set_sdio_card_isr(FAR struct sdio_dev_s *dev,
priv->cintints = 0; 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 = getreg32(priv->addr + IMXRT_USDHC_IRQSIGEN_OFFSET);
regval = (regval & ~USDHC_INT_CINT) | priv->cintints; regval = (regval & ~USDHC_INT_CINT) | priv->cintints;
putreg32(regval, priv->addr + IMXRT_USDHC_IRQSIGEN_OFFSET); putreg32(regval, priv->addr + IMXRT_USDHC_IRQSIGEN_OFFSET);
+1 -1
View File
@@ -494,7 +494,7 @@ void up_irqinitialize(void)
irq_attach(STM32_IRQ_RESERVED, stm32_reserved, NULL); irq_attach(STM32_IRQ_RESERVED, stm32_reserved, NULL);
#endif #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 a debugger is connected, try to prevent it from catching hardfaults.
* If CONFIG_ARMV7M_USEBASEPRI, no hardfaults are expected in normal * If CONFIG_ARMV7M_USEBASEPRI, no hardfaults are expected in normal
+1 -1
View File
@@ -519,7 +519,7 @@ void up_irqinitialize(void)
irq_attach(STM32_IRQ_RESERVED, stm32_reserved, NULL); irq_attach(STM32_IRQ_RESERVED, stm32_reserved, NULL);
#endif #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 a debugger is connected, try to prevent it from catching hardfaults.
* If CONFIG_ARMV7M_USEBASEPRI, no hardfaults are expected in normal * If CONFIG_ARMV7M_USEBASEPRI, no hardfaults are expected in normal
+1
View File
@@ -46,6 +46,7 @@
/* In mstatus register */ /* In mstatus register */
#define MSTATUS_MIE (0x1 << 3) /* Machine Interrupt Enable */ #define MSTATUS_MIE (0x1 << 3) /* Machine Interrupt Enable */
#define MSTATUS_MPIE (0x1 << 7) /* Machine Previous Interrupt Enable */
/* In mie (machine interrupt enable) register */ /* In mie (machine interrupt enable) register */
+1 -1
View File
@@ -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. * Copyright (C) 2019 Masayuki Ishikawa. All rights reserved.
* Author: Masayuki Ishikawa <masayuki.ishikawa@gmail.com> * Author: Masayuki Ishikawa <masayuki.ishikawa@gmail.com>
+1 -1
View File
@@ -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. * Copyright (C) 2019 Masayuki Ishikawa. All rights reserved.
* Author: Masayuki Ishikawa <masayuki.ishikawa@gmail.com> * Author: Masayuki Ishikawa <masayuki.ishikawa@gmail.com>
+1 -1
View File
@@ -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. * Copyright (C) 2019 Masayuki Ishikawa. All rights reserved.
* Author: Masayuki Ishikawa <masayuki.ishikawa@gmail.com> * Author: Masayuki Ishikawa <masayuki.ishikawa@gmail.com>
+3 -4
View File
@@ -100,7 +100,6 @@ void up_irqinitialize(void)
/* Attach the ecall interrupt handler */ /* Attach the ecall interrupt handler */
irq_attach(FE310_IRQ_ECALLM, up_swint, NULL); irq_attach(FE310_IRQ_ECALLM, up_swint, NULL);
up_enable_irq(FE310_IRQ_ECALLM);
#ifndef CONFIG_SUPPRESS_INTERRUPTS #ifndef CONFIG_SUPPRESS_INTERRUPTS
@@ -188,13 +187,13 @@ void up_enable_irq(int irq)
* Name: up_get_newintctx * Name: up_get_newintctx
* *
* Description: * 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) 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) void up_irq_restore(irqstate_t flags)
{ {
/* Machine mode - mstatus */ /* Write flags to mstatus */
asm volatile("csrw mstatus, %0" : /* no output */ : "r" (flags)); asm volatile("csrw mstatus, %0" : /* no output */ : "r" (flags));
} }
+10 -2
View File
@@ -398,6 +398,11 @@ static int up_interrupt(int irq, void *context, FAR void *arg)
status = up_serialin(priv, UART_IP_OFFSET); status = up_serialin(priv, UART_IP_OFFSET);
if (status == 0)
{
break;
}
if (status & UART_IP_RXWM) if (status & UART_IP_RXWM)
{ {
/* Process incoming bytes */ /* Process incoming bytes */
@@ -405,9 +410,12 @@ static int up_interrupt(int irq, void *context, FAR void *arg)
uart_recvchars(dev); uart_recvchars(dev);
} }
/* Process outgoing bytes */ if (status & UART_IP_TXWM)
{
/* Process outgoing bytes */
uart_xmitchars(dev); uart_xmitchars(dev);
}
} }
return OK; return OK;
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* boards/arm/imxrt/imxrt1060-evk/src/imxrt_bringup.c * 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 <gnutt@nuttx.org> * Authors: Gregory Nutt <gnutt@nuttx.org>
* David Sidrane <david_s5@nscdg.com> * David Sidrane <david_s5@nscdg.com>
* *
@@ -121,7 +121,10 @@ static int nsh_sdmmc_initialize(void)
"ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n", "ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n",
ret); ret);
} }
imxrt_usdhc_set_sdio_card_isr(sdmmc, NULL, NULL);
} }
return OK; return OK;
} }
#else #else
@@ -623,7 +623,7 @@ static void bcmf_poll_work(FAR void *arg)
/* Setup the watchdog poll timer again */ /* Setup the watchdog poll timer again */
wd_start(priv->bc_txpoll, BCMF_WDDELAY, bcmf_poll_expiry, 1, wd_start(priv->bc_txpoll, BCMF_WDDELAY, bcmf_poll_expiry, 1,
, (wdparm_t)priv); (wdparm_t)priv);
exit_unlock: exit_unlock:
net_unlock(); net_unlock();
} }
+1 -1
View File
@@ -60,7 +60,7 @@
* Name: file_read * Name: file_read
* *
* Description: * 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: * the standard read() interface except:
* *
* - It does not modify the errno variable, * - It does not modify the errno variable,
-12
View File
@@ -466,18 +466,6 @@ int net_lockedwait_uninterruptible(sem_t *sem);
FAR struct iob_s *net_ioballoc(bool throttled, enum iob_user_e consumerid); FAR struct iob_s *net_ioballoc(bool throttled, enum iob_user_e consumerid);
#endif #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 * Name: net_checksd
* *
-1
View File
@@ -47,7 +47,6 @@ endif
ifeq ($(CONFIG_NET_IPv4),y) ifeq ($(CONFIG_NET_IPv4),y)
SOCK_CSRCS += ipv4_setsockopt.c ipv4_getsockname.c ipv4_getpeername.c SOCK_CSRCS += ipv4_setsockopt.c ipv4_getsockname.c ipv4_getpeername.c
SOCK_CSRCS += inet_setipid.c
endif endif
ifeq ($(CONFIG_NET_IPv6),y) ifeq ($(CONFIG_NET_IPv6),y)
+1 -13
View File
@@ -129,18 +129,6 @@ struct tcp_conn_s; /* Forward reference */
#endif #endif
struct socket; /* Forward reference */ 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 * Name: inet_sockif
* *
@@ -159,7 +147,7 @@ void inet_setipid(uint16_t id);
****************************************************************************/ ****************************************************************************/
FAR const struct sock_intf_s * 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 * Name: ipv4_setsockopt and ipv6_setsockopt
-67
View File
@@ -1,67 +0,0 @@
/****************************************************************************
* net/inet/net_setipid.c
*
* Copyright (C) 2007, 2009, 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* 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 <nuttx/config.h>
#ifdef CONFIG_NET
#include <stdint.h>
#include <debug.h>
#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 */