Merged in masayuki2009/nuttx.nuttx/lc823450_rndis (pull request #549)
configs/lc823450-xgevk: Add rndis configuration Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com> Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
parent
4a5532a772
commit
da7f0542f0
173
configs/lc823450-xgevk/rndis/defconfig
Normal file
173
configs/lc823450-xgevk/rndis/defconfig
Normal file
@ -0,0 +1,173 @@
|
|||||||
|
CONFIG_AQM_1248A=y
|
||||||
|
CONFIG_ARCH="arm"
|
||||||
|
CONFIG_ARCH_BOARD="lc823450-xgevk"
|
||||||
|
CONFIG_ARCH_BOARD_LC823450_XGEVK=y
|
||||||
|
CONFIG_ARCH_CHIP_LC823450=y
|
||||||
|
CONFIG_ARCH_FLOAT_H=y
|
||||||
|
CONFIG_ARCH_INTERRUPTSTACK=2048
|
||||||
|
CONFIG_ARCH_STDARG_H=y
|
||||||
|
CONFIG_AUDIO_BUFFER_NUMBYTES=1024
|
||||||
|
CONFIG_AUDIO_EXCLUDE_BALANCE=y
|
||||||
|
CONFIG_AUDIO_EXCLUDE_FFORWARD=y
|
||||||
|
CONFIG_AUDIO_EXCLUDE_TONE=y
|
||||||
|
# CONFIG_AUDIO_FORMAT_MP3 is not set
|
||||||
|
CONFIG_AUDIO_WM8776=y
|
||||||
|
CONFIG_AUDIO=y
|
||||||
|
CONFIG_BOARDCTL_RESET=y
|
||||||
|
CONFIG_BOARDCTL_USBDEVCTRL=y
|
||||||
|
CONFIG_BOARD_LOOPSPERMSEC=12061
|
||||||
|
CONFIG_BUILTIN=y
|
||||||
|
CONFIG_C99_BOOL8=y
|
||||||
|
CONFIG_CODECS_HASH_MD5=y
|
||||||
|
CONFIG_DEBUG_ASSERTIONS=y
|
||||||
|
CONFIG_DEBUG_ERROR=y
|
||||||
|
CONFIG_DEBUG_FEATURES=y
|
||||||
|
CONFIG_DEBUG_FULLOPT=y
|
||||||
|
CONFIG_DEBUG_INFO=y
|
||||||
|
CONFIG_DEBUG_NET=y
|
||||||
|
CONFIG_DEBUG_SYMBOLS=y
|
||||||
|
CONFIG_DEBUG_WARN=y
|
||||||
|
CONFIG_DEV_ZERO=y
|
||||||
|
CONFIG_DISABLE_POSIX_TIMERS=y
|
||||||
|
CONFIG_DRIVERS_AUDIO=y
|
||||||
|
CONFIG_EXAMPLES_HELLO=y
|
||||||
|
CONFIG_EXAMPLES_NSH=y
|
||||||
|
CONFIG_EXAMPLES_NXHELLO_BPP=1
|
||||||
|
CONFIG_EXAMPLES_NXHELLO=y
|
||||||
|
CONFIG_EXAMPLES_OSTEST=y
|
||||||
|
CONFIG_EXAMPLES_PIPE=y
|
||||||
|
CONFIG_EXAMPLES_SMP=y
|
||||||
|
CONFIG_EXPERIMENTAL=y
|
||||||
|
CONFIG_FAT_LCNAMES=y
|
||||||
|
CONFIG_FAT_LFN=y
|
||||||
|
CONFIG_FS_FATTIME=y
|
||||||
|
CONFIG_FS_FAT=y
|
||||||
|
CONFIG_FS_PROCFS=y
|
||||||
|
CONFIG_I2C_RESET=y
|
||||||
|
CONFIG_I2CTOOL_MAXBUS=1
|
||||||
|
CONFIG_I2C=y
|
||||||
|
CONFIG_I2S=y
|
||||||
|
CONFIG_INTELHEX_BINARY=y
|
||||||
|
CONFIG_IOB_BUFSIZE=384
|
||||||
|
CONFIG_IOB_NBUFFERS=128
|
||||||
|
CONFIG_IOB_NCHAINS=64
|
||||||
|
CONFIG_LC823450_I2C0=y
|
||||||
|
CONFIG_LC823450_I2C1=y
|
||||||
|
CONFIG_LC823450_I2S0=y
|
||||||
|
CONFIG_LC823450_MTD=y
|
||||||
|
CONFIG_LC823450_SDIF_SDC=y
|
||||||
|
CONFIG_LC823450_SPI_DMA=y
|
||||||
|
CONFIG_LC823450_UART0=y
|
||||||
|
CONFIG_LCD_ST7565=y
|
||||||
|
CONFIG_LCD=y
|
||||||
|
CONFIG_LIB_KBDCODEC=y
|
||||||
|
CONFIG_LIBM=y
|
||||||
|
CONFIG_MAX_TASKS=64
|
||||||
|
CONFIG_MAX_WDOGPARMS=2
|
||||||
|
CONFIG_MEMSET_OPTSPEED=y
|
||||||
|
CONFIG_MQ_MAXMSGSIZE=64
|
||||||
|
CONFIG_MTD=y
|
||||||
|
CONFIG_NAME_MAX=765
|
||||||
|
CONFIG_NET_ARP_SEND=y
|
||||||
|
CONFIG_NET_BROADCAST=y
|
||||||
|
CONFIG_NETDB_DNSCLIENT=y
|
||||||
|
CONFIG_NETDEVICES=y
|
||||||
|
CONFIG_NET_ETH_MTU=1500
|
||||||
|
CONFIG_NET_ETH_TCP_RECVWNDO=2800
|
||||||
|
CONFIG_NET_ICMP_SOCKET=y
|
||||||
|
CONFIG_NET_ICMP=y
|
||||||
|
CONFIG_NET_LOOPBACK=y
|
||||||
|
CONFIG_NET_PKT=y
|
||||||
|
CONFIG_NET_ROUTE=y
|
||||||
|
CONFIG_NET_SOCKOPTS=y
|
||||||
|
CONFIG_NET_STATISTICS=y
|
||||||
|
CONFIG_NET_TCP_WRITE_BUFFERS=y
|
||||||
|
CONFIG_NET_TCP=y
|
||||||
|
CONFIG_NET_UDP=y
|
||||||
|
CONFIG_NETUTILS_CODECS=y
|
||||||
|
CONFIG_NETUTILS_DHCPC=y
|
||||||
|
CONFIG_NETUTILS_PING=y
|
||||||
|
CONFIG_NETUTILS_TELNETD=y
|
||||||
|
CONFIG_NETUTILS_WEBCLIENT=y
|
||||||
|
CONFIG_NET=y
|
||||||
|
CONFIG_NFILE_DESCRIPTORS=45
|
||||||
|
CONFIG_NFILE_STREAMS=8
|
||||||
|
CONFIG_NSH_ARCHINIT=y
|
||||||
|
# CONFIG_NSH_ARGCAT is not set
|
||||||
|
CONFIG_NSH_BUILTIN_APPS=y
|
||||||
|
CONFIG_NSH_CMDOPT_DD_STATS=y
|
||||||
|
CONFIG_NSH_DHCPC=y
|
||||||
|
CONFIG_NSH_DISABLE_BASENAME=y
|
||||||
|
CONFIG_NSH_DISABLE_DIRNAME=y
|
||||||
|
CONFIG_NSH_DISABLE_EXEC=y
|
||||||
|
CONFIG_NSH_DISABLE_GET=y
|
||||||
|
CONFIG_NSH_DISABLE_LOSETUP=y
|
||||||
|
CONFIG_NSH_DISABLE_MB=y
|
||||||
|
CONFIG_NSH_DISABLE_MH=y
|
||||||
|
CONFIG_NSH_DISABLE_MKFIFO=y
|
||||||
|
CONFIG_NSH_DISABLE_MKRD=y
|
||||||
|
CONFIG_NSH_DISABLE_PUT=y
|
||||||
|
CONFIG_NSH_DISABLE_SH=y
|
||||||
|
CONFIG_NSH_DISABLE_XD=y
|
||||||
|
CONFIG_NSH_DRIPADDR=0xa9feab5a
|
||||||
|
CONFIG_NSH_FILEIOSIZE=512
|
||||||
|
CONFIG_NSH_LINELEN=128
|
||||||
|
CONFIG_NSH_MACADDR=0x00e0deadbeff
|
||||||
|
CONFIG_NSH_MAXARGUMENTS=10
|
||||||
|
CONFIG_NSH_NETINIT_THREAD=y
|
||||||
|
CONFIG_NSH_NETMASK=0xffff0000
|
||||||
|
CONFIG_NSH_NOMAC=y
|
||||||
|
CONFIG_NSH_READLINE=y
|
||||||
|
CONFIG_NSH_WGET_USERAGENT="NuttX/7.2x.x (; http://www.nuttx.org/)"
|
||||||
|
CONFIG_NX_BLOCKING=y
|
||||||
|
# CONFIG_NX_DISABLE_1BPP is not set
|
||||||
|
CONFIG_NXFONT_MONO5X8=y
|
||||||
|
CONFIG_NX=y
|
||||||
|
CONFIG_PIPES=y
|
||||||
|
CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=2048
|
||||||
|
CONFIG_PREALLOC_MQ_MSGS=4
|
||||||
|
CONFIG_PREALLOC_TIMERS=4
|
||||||
|
CONFIG_PREALLOC_WDOGS=16
|
||||||
|
CONFIG_PTHREAD_MUTEX_TYPES=y
|
||||||
|
CONFIG_PTHREAD_STACK_DEFAULT=3072
|
||||||
|
CONFIG_RAM_SIZE=1044480
|
||||||
|
CONFIG_RAM_START=0x02001000
|
||||||
|
CONFIG_RAW_BINARY=y
|
||||||
|
CONFIG_READLINE_CMD_HISTORY=y
|
||||||
|
CONFIG_RNDIS=y
|
||||||
|
CONFIG_RTC_DATETIME=y
|
||||||
|
CONFIG_RTC=y
|
||||||
|
CONFIG_SCHED_ATEXIT=y
|
||||||
|
CONFIG_SCHED_CHILD_STATUS=y
|
||||||
|
CONFIG_SCHED_HAVE_PARENT=y
|
||||||
|
CONFIG_SCHED_HPWORKPERIOD=50000
|
||||||
|
CONFIG_SCHED_HPWORKPRIORITY=192
|
||||||
|
CONFIG_SCHED_HPWORK=y
|
||||||
|
CONFIG_SCHED_LPWORK=y
|
||||||
|
CONFIG_SCHED_ONEXIT_MAX=32
|
||||||
|
CONFIG_SCHED_ONEXIT=y
|
||||||
|
CONFIG_SCHED_STARTHOOK=y
|
||||||
|
CONFIG_SCHED_WAITPID=y
|
||||||
|
CONFIG_SDCLONE_DISABLE=y
|
||||||
|
CONFIG_SENSORS=y
|
||||||
|
CONFIG_SERIAL_TERMIOS=y
|
||||||
|
CONFIG_SMP_NCPUS=2
|
||||||
|
CONFIG_SMP=y
|
||||||
|
# CONFIG_SPI_EXCHANGE is not set
|
||||||
|
CONFIG_SPI=y
|
||||||
|
CONFIG_START_DAY=3
|
||||||
|
CONFIG_START_MONTH=10
|
||||||
|
CONFIG_START_YEAR=2013
|
||||||
|
CONFIG_SYSTEM_I2CTOOL=y
|
||||||
|
CONFIG_SYSTEM_PING=y
|
||||||
|
CONFIG_TASK_NAME_SIZE=24
|
||||||
|
CONFIG_UART0_RXBUFSIZE=512
|
||||||
|
CONFIG_UART0_SERIAL_CONSOLE=y
|
||||||
|
CONFIG_UART0_TXBUFSIZE=2048
|
||||||
|
CONFIG_USBDEV_BUSPOWERED=y
|
||||||
|
CONFIG_USBDEV_DUALSPEED=y
|
||||||
|
CONFIG_USBDEV_MAXPOWER=500
|
||||||
|
CONFIG_USBDEV=y
|
||||||
|
CONFIG_USER_ENTRYPOINT="nsh_main"
|
||||||
|
CONFIG_USERMAIN_STACKSIZE=3072
|
||||||
|
CONFIG_WM8776_SWAP_HPOUT=y
|
@ -45,6 +45,10 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
|
|
||||||
|
#ifdef CONFIG_RNDIS
|
||||||
|
# include <nuttx/usb/rndis.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_WATCHDOG
|
#ifdef CONFIG_WATCHDOG
|
||||||
# include "lc823450_wdt.h"
|
# include "lc823450_wdt.h"
|
||||||
#endif
|
#endif
|
||||||
@ -81,6 +85,14 @@ int lc823450_bringup(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_FS_FAT
|
||||||
|
ret = mount("/dev/mtdblock0p10", "/mnt/sd0", "vfat", 0, NULL);
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
syslog(LOG_ERR, "ERROR: Failed to mount vfat at /mnt/sd0: %d\n", ret);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_BMA250
|
#ifdef CONFIG_BMA250
|
||||||
lc823450_bma250initialize("/dev/accel");
|
lc823450_bma250initialize("/dev/accel");
|
||||||
#endif
|
#endif
|
||||||
@ -89,6 +101,17 @@ int lc823450_bringup(void)
|
|||||||
lc823450_wm8776initialize(0);
|
lc823450_wm8776initialize(0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(CONFIG_RNDIS) && defined(CONFIG_NSH_MACADDR)
|
||||||
|
uint8_t mac[6];
|
||||||
|
mac[0] = 0xaa; /* TODO */
|
||||||
|
mac[1] = (CONFIG_NSH_MACADDR >> (8 * 4)) & 0xff;
|
||||||
|
mac[2] = (CONFIG_NSH_MACADDR >> (8 * 3)) & 0xff;
|
||||||
|
mac[3] = (CONFIG_NSH_MACADDR >> (8 * 2)) & 0xff;
|
||||||
|
mac[4] = (CONFIG_NSH_MACADDR >> (8 * 1)) & 0xff;
|
||||||
|
mac[5] = (CONFIG_NSH_MACADDR >> (8 * 0)) & 0xff;
|
||||||
|
usbdev_rndis_initialize(mac);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* If we got here then perhaps not all initialization was successful, but
|
/* If we got here then perhaps not all initialization was successful, but
|
||||||
* at least enough succeeded to bring-up NSH with perhaps reduced
|
* at least enough succeeded to bring-up NSH with perhaps reduced
|
||||||
* capabilities.
|
* capabilities.
|
||||||
|
52
configs/lc823450-xgevk/src/lc823450_netinit.c
Normal file
52
configs/lc823450-xgevk/src/lc823450_netinit.c
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* configs/lc823450-xgevk/src/lc823450_netinit.c
|
||||||
|
*
|
||||||
|
* Copyright (C) 2017 Sony Corporation. All rights reserved.
|
||||||
|
* Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
|
||||||
|
*
|
||||||
|
* 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>
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: up_netinitialize
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
void up_netinitialize(void)
|
||||||
|
{
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user