Skip to content

Commit

Permalink
Merged in masayuki2009/nuttx.nuttx/improve_gs2200m_performance (pull …
Browse files Browse the repository at this point in the history
…request #931)

Improve gs2200m performance

* arch/arm/src/cxd56xx: Fix dma initialization in cxd56_dmac.c

    up_dma_initialize() must be used instead of up_dmainitialize()

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* drivers/wireless: Introduce CONFIG_WL_GS2200M_SPI_FREQUENCY

    Also, changed usleep(100) to up_udelay(100) to avoid invalid response.

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* configs/spresense/wifi: Improve performance for webserver

    This commit changes followings.

      1. Enable SPI DMA for both TX and RX
      2. Increase SPI clock speed from 4MHz to 10MHz
      3. Increase buffer size for sendfile() from 512B to 1KB
      4. Enable sendfile() for webserver

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
  • Loading branch information
masayuki2009 authored and gregory-nutt committed Jul 4, 2019
1 parent 55026f2 commit 48760b2
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion arch/arm/src/cxd56xx/cxd56_dmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ static int dma_stop(int ch)
*
****************************************************************************/

void weak_function up_dmainitialize(void)
void weak_function up_dma_initialize(void)
{
int i;

Expand Down
6 changes: 6 additions & 0 deletions configs/spresense/wifi/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ CONFIG_BOOT_RUNFROMISRAM=y
CONFIG_BUILTIN=y
CONFIG_CLOCK_MONOTONIC=y
CONFIG_CODECS_HASH_MD5=y
CONFIG_CXD56_DMAC_SPI5_RX=y
CONFIG_CXD56_DMAC_SPI5_TX=y
CONFIG_CXD56_SDIO=y
CONFIG_CXD56_SPI5=y
CONFIG_CXD56_SPI=y
Expand All @@ -38,15 +40,18 @@ CONFIG_FS_PROCFS_REGISTER=y
CONFIG_HAVE_CXX=y
CONFIG_HAVE_CXXINITIALIZE=y
CONFIG_I2C=y
CONFIG_LIB_SENDFILE_BUFSIZE=1024
CONFIG_MAX_WDOGPARMS=2
CONFIG_MMCSD=y
CONFIG_MMCSD_SDIO=y
CONFIG_NAME_MAX=256
CONFIG_NET=y
CONFIG_NETDB_DNSCLIENT=y
CONFIG_NETDEVICES=y
CONFIG_NETINIT_NETLOCAL=y
CONFIG_NETUTILS_CODECS=y
CONFIG_NETUTILS_FTPC=y
CONFIG_NETUTILS_HTTPD_SENDFILE=y
CONFIG_NETUTILS_TELNETD=y
CONFIG_NETUTILS_WEBCLIENT=y
CONFIG_NETUTILS_WEBSERVER=y
Expand Down Expand Up @@ -93,3 +98,4 @@ CONFIG_USBMSC_REMOVABLE=y
CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_WIRELESS_GS2200M=y
CONFIG_WL_GS2200M=y
CONFIG_WL_GS2200M_SPI_FREQUENCY=10000000
9 changes: 9 additions & 0 deletions drivers/wireless/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ config WL_GS2200M
select SPI
select LIBC_SCANSET

if WL_GS2200M

config WL_GS2200M_SPI_FREQUENCY
int "SPI frequencey for GS2200M"
default 4000000
range 4000000 10000000

endif

source drivers/wireless/spirit/Kconfig

menuconfig DRIVERS_IEEE802154
Expand Down
13 changes: 10 additions & 3 deletions drivers/wireless/gs2200m.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

#define GS2200MWORK LPWORK

#define SPI_MAXFREQ (4000000) /* 4MHz. */
#define SPI_MAXFREQ CONFIG_WL_GS2200M_SPI_FREQUENCY
#define NRESPMSG 8

#define MAX_PKT_LEN 1500
Expand Down Expand Up @@ -861,7 +861,7 @@ static uint16_t _read_data_len(FAR struct gs2200m_dev_s *dev)
* workaround to avoid realy receiving an invalid frame response
*/

usleep(100);
up_udelay(100);

/* Read frame response */

Expand Down Expand Up @@ -1408,7 +1408,7 @@ static enum pkt_type_e gs2200m_get_mac(FAR struct gs2200m_dev_s *dev)
dev->net_dev.d_mac.ether.ether_addr_octet[n] = (uint8_t)mac[n];
}

errout:
errout:
_release_pkt_dat(&pkt_dat);
return r;
}
Expand Down Expand Up @@ -1868,6 +1868,13 @@ static int gs2200m_ioctl_connect(FAR struct gs2200m_dev_s *dev,
break;

default:
/* REVISIT:
* TYPE_BULK for other sockets might be received here,
* if the sockets have heavy bulk traffic.
* In this case, the packet should be queued and
* wait for a response to the NCTCP command.
*/

wlerr("+++ error: type=%d \n", type);
ASSERT(false);
ret = -EINVAL;
Expand Down

0 comments on commit 48760b2

Please sign in to comment.