mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +08:00
Merged in alinjerpelea/nuttx (pull request #1056)
boards: cxd56xx: add board support for LTE modem and modem driver
* drivers: modem: add altair modem driver
Add modem driver for the altair modem
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
* boards: cxd56xx: add board support for LTE modem
Add the Altair LTE modem support on the Spresense board
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
* boards: cxd56xx: spresense: add LTE defconfig
Add the Altair LTE modem defconfig for spresense board
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
committed by
Gregory Nutt
parent
185557440b
commit
07f9154e5b
@@ -68,4 +68,47 @@ config LCD_ON_MAIN_BOARD
|
||||
|
||||
endchoice
|
||||
endif
|
||||
comment "LTE Options"
|
||||
|
||||
menuconfig CXD56_LTE
|
||||
bool "LTE"
|
||||
default n
|
||||
|
||||
if CXD56_LTE
|
||||
|
||||
choice
|
||||
prompt "LTE SPI selection"
|
||||
default CXD56_LTE_SPI4
|
||||
|
||||
config CXD56_LTE_SPI4
|
||||
bool "Use SPI4"
|
||||
select CXD56_SPI4
|
||||
|
||||
config CXD56_LTE_SPI5
|
||||
bool "Use SPI5"
|
||||
select CXD56_SPI5
|
||||
endchoice
|
||||
|
||||
if CXD56_LTE_SPI4
|
||||
|
||||
config CXD56_LTE_SPI4_DMAC
|
||||
bool "Use DMAC for SPI4"
|
||||
default y
|
||||
select CXD56_DMAC_SPI4_TX
|
||||
select CXD56_DMAC_SPI4_RX
|
||||
|
||||
endif # CXD56_LTE_SPI4
|
||||
|
||||
if CXD56_LTE_SPI5
|
||||
|
||||
config CXD56_LTE_SPI5_DMAC
|
||||
bool "Use DMAC for SPI5"
|
||||
default y
|
||||
select CXD56_DMAC_SPI5_TX
|
||||
select CXD56_DMAC_SPI5_RX
|
||||
|
||||
endif # CXD56_LTE_SPI4
|
||||
|
||||
endif # CXD56_LTE
|
||||
|
||||
endif
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
#
|
||||
# This file is autogenerated: PLEASE DO NOT EDIT IT.
|
||||
#
|
||||
# You can use "make menuconfig" to make any modifications to the installed .config file.
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
# CONFIG_CXD56_I2C0_SCUSEQ is not set
|
||||
# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set
|
||||
# CONFIG_MMCSD_SPI is not set
|
||||
# CONFIG_MTD_SMART_WEAR_LEVEL is not set
|
||||
# CONFIG_STANDARD_SERIAL is not set
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="spresense"
|
||||
CONFIG_ARCH_BOARD_SPRESENSE=y
|
||||
CONFIG_ARCH_CHIP="cxd56xx"
|
||||
CONFIG_ARCH_CHIP_CXD56XX=y
|
||||
CONFIG_ARCH_STACKDUMP=y
|
||||
CONFIG_ARMV7M_USEBASEPRI=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=5434
|
||||
CONFIG_BOOT_RUNFROMISRAM=y
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_CLOCK_MONOTONIC=y
|
||||
CONFIG_CXD56_BINARY=y
|
||||
CONFIG_CXD56_I2C0=y
|
||||
CONFIG_CXD56_I2C=y
|
||||
CONFIG_CXD56_LTE=y
|
||||
CONFIG_CXD56_SDIO=y
|
||||
CONFIG_CXD56_SPI5=y
|
||||
CONFIG_CXD56_SPI=y
|
||||
CONFIG_CXD56_USBDEV=y
|
||||
CONFIG_DEBUG_FULLOPT=y
|
||||
CONFIG_DEBUG_SYMBOLS=y
|
||||
CONFIG_FAT_LCNAMES=y
|
||||
CONFIG_FAT_LFN=y
|
||||
CONFIG_FAT_MAXFNAME=64
|
||||
CONFIG_FS_FAT=y
|
||||
CONFIG_FS_PROCFS=y
|
||||
CONFIG_FS_PROCFS_REGISTER=y
|
||||
CONFIG_FS_SMARTFS=y
|
||||
CONFIG_HAVE_CXX=y
|
||||
CONFIG_HAVE_CXXINITIALIZE=y
|
||||
CONFIG_I2C=y
|
||||
CONFIG_MAX_TASKS=16
|
||||
CONFIG_MAX_WDOGPARMS=2
|
||||
CONFIG_MMCSD=y
|
||||
CONFIG_MMCSD_SDIO=y
|
||||
CONFIG_MODEM=y
|
||||
CONFIG_MTD_BYTE_WRITE=y
|
||||
CONFIG_MTD_PARTITION=y
|
||||
CONFIG_MTD_SMART=y
|
||||
CONFIG_MTD_SMART_ENABLE_CRC=y
|
||||
CONFIG_MTD_SMART_SECTOR_SIZE=4096
|
||||
CONFIG_NFILE_DESCRIPTORS=8
|
||||
CONFIG_NFILE_STREAMS=8
|
||||
CONFIG_NSH_ARCHINIT=y
|
||||
CONFIG_NSH_BUILTIN_APPS=y
|
||||
CONFIG_NSH_READLINE=y
|
||||
CONFIG_PREALLOC_MQ_MSGS=4
|
||||
CONFIG_PREALLOC_TIMERS=4
|
||||
CONFIG_PREALLOC_WDOGS=16
|
||||
CONFIG_RAM_SIZE=1572864
|
||||
CONFIG_RAM_START=0x0d000000
|
||||
CONFIG_READLINE_CMD_HISTORY=y
|
||||
CONFIG_RR_INTERVAL=200
|
||||
CONFIG_RTC=y
|
||||
CONFIG_RTC_DRIVER=y
|
||||
CONFIG_SCHED_WAITPID=y
|
||||
CONFIG_SDCLONE_DISABLE=y
|
||||
CONFIG_SMARTFS_ALIGNED_ACCESS=y
|
||||
CONFIG_SMARTFS_MAXNAMLEN=30
|
||||
CONFIG_SMARTFS_MULTI_ROOT_DIRS=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_START_DAY=6
|
||||
CONFIG_START_MONTH=12
|
||||
CONFIG_START_YEAR=2011
|
||||
CONFIG_SYSTEM_CLE=y
|
||||
CONFIG_SYSTEM_NSH=y
|
||||
CONFIG_SYSTEM_NSH_CXXINITIALIZE=y
|
||||
CONFIG_SYSTEM_USBMSC=y
|
||||
CONFIG_UART1_SERIAL_CONSOLE=y
|
||||
CONFIG_USBDEV=y
|
||||
CONFIG_USBDEV_DMA=y
|
||||
CONFIG_USBDEV_DUALSPEED=y
|
||||
CONFIG_USBMSC=y
|
||||
CONFIG_USBMSC_EPBULKIN=1
|
||||
CONFIG_USBMSC_REMOVABLE=y
|
||||
CONFIG_USER_ENTRYPOINT="spresense_main"
|
||||
@@ -57,6 +57,7 @@
|
||||
#include "cxd56_gpioif.h"
|
||||
|
||||
#include "cxd56_audio.h"
|
||||
#include "cxd56_altmdm.h"
|
||||
#include "cxd56_ak09912.h"
|
||||
#include "cxd56_apds9930.h"
|
||||
#include "cxd56_apds9960.h"
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
/****************************************************************************
|
||||
* boards/arm/cxd56xx/spresense/include/cxd56_altmdm.h
|
||||
*
|
||||
* Copyright 2018 Sony Semiconductor Solutions Corporation
|
||||
*
|
||||
* 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 of Sony Semiconductor Solutions Corporation 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_ALTMDM_H
|
||||
#define __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_ALTMDM_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/boardctl.h>
|
||||
#include <stdbool.h>
|
||||
#include <nuttx/irq.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Altair modem gpio definitions *******************************************/
|
||||
|
||||
#if defined(CONFIG_MODEM_ALTMDM) && defined(CONFIG_CXD56_GPIO_IRQ)
|
||||
|
||||
/* definitions of gpio pin number */
|
||||
|
||||
#define ALTMDM_GPIO_MODEM_WAKEUP (0)
|
||||
#define ALTMDM_GPIO_MASTER_REQ (1)
|
||||
#define ALTMDM_GPIO_SLAVE_REQ (2)
|
||||
|
||||
/* definitions of gpio interrupt polarity */
|
||||
|
||||
#define ALTMDM_GPIOINT_LEVEL_HIGH (0)
|
||||
#define ALTMDM_GPIOINT_LEVEL_LOW (1)
|
||||
#define ALTMDM_GPIOINT_EDGE_RISE (2)
|
||||
#define ALTMDM_GPIOINT_EDGE_FALL (3)
|
||||
#define ALTMDM_GPIOINT_EDGE_BOTH (4)
|
||||
|
||||
/* definitions of gpio interrupt noise filter */
|
||||
|
||||
#define ALTMDM_GPIOINT_NOISE_FILTER_ENABLE (0)
|
||||
#define ALTMDM_GPIOINT_NOISE_FILTER_DISABLE (1)
|
||||
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_MODEM_ALTMDM) && defined(CONFIG_CXD56_GPIO_IRQ)
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_altmdm_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize Altair modem
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_altmdm_initialize(FAR const char *devpath);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_altmdm_uninitialize
|
||||
*
|
||||
* Description:
|
||||
* Uninitialize Altair modem
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_altmdm_uninitialize(void);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_altmdm_power_control
|
||||
*
|
||||
* Description:
|
||||
* Power on/off the Altair modem device on the board.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void board_altmdm_power_control(bool en);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_altmdm_poweron
|
||||
*
|
||||
* Description:
|
||||
* Power on the Altair modem device on the board.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void board_altmdm_poweron(void);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_altmdm_poweroff
|
||||
*
|
||||
* Description:
|
||||
* Power off the Altair modem device on the board.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void board_altmdm_poweroff(void);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_altmdm_gpio_write
|
||||
*
|
||||
* Description:
|
||||
* Write GPIO pin.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void board_altmdm_gpio_write(uint32_t pin, bool value);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_altmdm_gpio_read
|
||||
*
|
||||
* Description:
|
||||
* Read GPIO pin.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
bool board_altmdm_gpio_read(uint32_t pin);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_altmdm_gpio_irq
|
||||
*
|
||||
* Description:
|
||||
* Register GPIO irq.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void board_altmdm_gpio_irq(uint32_t pin, uint32_t polarity,
|
||||
uint32_t noise_filter, xcpt_t irqhandler);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_altmdm_gpio_int_control
|
||||
*
|
||||
* Description:
|
||||
* Enable or disable GPIO interrupt.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void board_altmdm_gpio_int_control(uint32_t pin, bool en);
|
||||
|
||||
#endif
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_ALTMDM_H */
|
||||
@@ -389,6 +389,14 @@ int cxd56_bringup(void)
|
||||
usbdev_rndis_initialize(mac);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MODEM_ALTMDM
|
||||
ret = board_altmdm_initialize("/dev/altmdm");
|
||||
if (ret < 0)
|
||||
{
|
||||
_err("ERROR: Failed to initialze Altair modem. \n");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_WL_GS2200M
|
||||
ret = board_gs2200m_initialize("/dev/gs2200m", 5);
|
||||
if (ret < 0)
|
||||
|
||||
Reference in New Issue
Block a user