Commit Graph

38006 Commits

Author SHA1 Message Date
Gregory Nutt df23fb3713 Fix PIC32MX/MZ typos
The pic32mx_usbpullup() and pic32mz_usbpullup() callbacks were referred to with various incorrect names in comments:  pic32mx_pullup(), pic32mz_pullup(), stm32_pullup().
2020-08-22 18:44:58 +01:00
Alan C. Assis 4c31ada2ce Fix a small typo - reported by Greg Nutt 2020-08-22 09:54:16 -07:00
Gregory Nutt e880bc9a71 Remove unused, non-modular procfs reference
fs/procfs/fs_procfs.c contained an unused reference to an STM32 procfs structure.  This is wrong in two ways:  (1) There should be not STM32 references outside of arch/arm and boards/arm and (2) the declare STM32 structure is not used anyway.
2020-08-22 16:22:18 +01:00
Ouss4 f2af90d1bd tools/configure: Align the .c and the .sh versions. 2020-08-21 21:23:13 -05:00
Ouss4 1c295aff19 tools/configure.sh: Don't distclean if no config was already in place. 2020-08-21 21:23:13 -05:00
Xiang Xiao 6670bc2b27 libc/time: Implement tm::tm_gmtoff field
defined by BSD and GNU library extension:
https://www.gnu.org/software/libc/manual/html_node/Broken_002ddown-Time.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I33113bc322f038a3602880db4fb9cf93001947ac
2020-08-21 07:48:52 -03:00
Xiang Xiao 8617cd94b2 Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-21 18:09:19 +08:00
Xiang Xiao 8ce0ff5ce4 arch/sim: Make up_internal.h includable in host environment
to avoid the declaration repetition

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-21 18:09:19 +08:00
Masayuki Ishikawa 3543950766 arch: cxd56xx: Use spinlock API in cxd56_serial.c
Summary:
- This commit improves cxd56_serial performance in SMP mode.

Impact:
- This commit affects SMP mode only.

Testing:
- Tested with spresense:smp

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-08-21 12:06:46 +02:00
Dong Heng 39539be149 xtensa/esp32: Improve SPI transmission
Master:
  1. add DMA RX/TX support
  2. add software chip selection
  3. add user defined chip selection
  4. add IOMUX check and IO map

Slave:
  1. add DMA RX/TX support
  2. add IOMUX check and IO map
  3. use full 256 bit SPI TX/RX cache in non-DMA mode
2020-08-21 10:04:27 +01:00
Xiang Xiao b3e01168db sched/signal: Add sighandler_t typedef
improve the compatibility for glibc

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I925e8cbea18848dfc75c97aa72a12b91810aa9e8
2020-08-21 09:59:46 +01:00
Xiang Xiao 297c294c0f libc: Change ctype macro to normal function
to avoid the argument evaluation more than once

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ib59c9bc8d259731bc6e7ff542379b74ba22d6e33
2020-08-21 16:56:00 +08:00
Masayuki Ishikawa 0d971d4673 arch: cxd56xx: Fix IRQ control in cxd56_dmac.c
Summary:
- This commit fixes IRQ control for the following use case
- The gs2200m Wi-Fi driver requests SPI-DMA to receive a packet.
- cxd56_dma.c enables IRQ for the SPI-DMA and start transfer.
- Then LCD driver requests SPI-DMA to display an image.
- These SPI-DMAs use different DMA channels but share the DMA controller.
- Also, they share the same IRQ.
- When the first SPI-DMA finishes the transfer, it disables the IRQ.
- And if the second SPI-DMA finishes the transfer just after the IRQ disabled.
- The second SPI-DMA will be in a deadlock condition.
- To resolve this issue, do not control IRQ during DMA transfer.
- Instead, up_enable_irq() is called in up_dma_initialize()

Impact:
- All use cases which use DMA

Testing:
- Tested with spresense:wifi with LCD

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-08-21 10:38:47 +02:00
Esteban Zamora 8beb1edbda Fix inverted errno in mq_open
Signed-off-by: Esteban Zamora <esteban.zamora@hpe.com>
2020-08-20 20:35:16 -03:00
Alan C. Assis 69f914adcd Another nxstyle issue fixed 2020-08-20 15:15:07 -06:00
Alan C. Assis 4e3070c542 Fix some right alignment 2020-08-20 15:15:07 -06:00
Alan C. Assis 34c144ad13 Fix many coding styles issues 2020-08-20 15:15:07 -06:00
Alan Carvalho de Assis 4d0f05c340 Update to divide long URL across many lines
Co-authored-by: patacongo <spudarnia@yahoo.com>
2020-08-20 15:15:07 -06:00
Alan C. Assis 7d88f1e9cf Fix the introduced long line 2020-08-20 15:15:07 -06:00
Alan C. Assis 5b719daf69 Fix issues reported in the pull request and update defconfig 2020-08-20 15:15:07 -06:00
chenwen 1e9ef469dc xtensa/esp32: Add functions to switch CPU frequency from 80MHz to 240Mhz 2020-08-20 15:15:07 -06:00
spiriou 0ddefd7c69 fs/vfs/fs_epoll: fix epoll_wait function 2020-08-20 11:49:20 -05:00
Gustavo Henrique Nihei b90c8914f3 tools/configure.sh: Create -E command for distcleaning regardless of
configuration changes

According to the usage documentation, [-e] option should "enforce
distclean if already configured". This behavior was broken due to the -e
option being evaluated only if the current defconfig is different from
the backup defconfig. The new -E command inherits this behavior.
2020-08-20 15:53:16 +01:00
David Sidrane 2953880f5c fs_cromfs: Removed DEBUGASSERT on non-exiting var node 2020-08-20 14:10:02 +01:00
Xiang Xiao beb745ef92 sched/pthread: Implement pthread_attr_[get|set]detachstate
specified here:
https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_attr_getdetachstate.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I84ec2d14f14cb7118aac3f7f356f83a5f9af4e18
2020-08-20 10:46:14 +01:00
Masayuki Ishikawa f9359d3fe8 boards: stm32f4discovery: Refactor stm32_gs2200m.c
Summary:
- This commit refactors stm32_gs2200m.c
- gs2200m_irq_enable() and gs2200m_irq_disable() are now symmetric.

Impact:
- All use cases which use the gs2200m driver.

Testing:
- Tested with stm32f4discovery:wifi

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-08-20 03:17:13 -05:00
Masayuki Ishikawa e3b3d21556 boards: cxd56xx: Refactor cxd56_gs2200m.c
Summary:
- This commit refactors cxd56_gs2200m.c
- gs2200m_irq_enable() and gs2200m_irq_disable() are now symmetric.

Impact:
- All use cases which use the gs2200m driver.

Testing:
- Tested with spresense:wifi

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-08-20 03:17:13 -05:00
Johannes Schock 83f6c94209 telnet.c: td_offset had been uint8_t. TELNET_RXBUFFER_SIZE over 256 had been broken. 2020-08-19 04:44:03 -05:00
David Sidrane e21dd68755 mmcsd_sdio:Fix breakage from 997d4 SD not functional
When CONFIG_MMCSD_MULTIBLOCK_DISABLE is lit, all SD
   read/write failed. The function return the number of
   blocks in `ret`, set on entry to nsectors. That was
   then wiped out by using the ret for the mmcsd_takesem.

   Since the code had many path setting return, the choices for
   the fix could have been add a new varaible or simple init it
   were used. I choose the latter.
2020-08-19 03:22:09 -05:00
qiaowei 1d97b2ecee stack check: Support Stack Smashing Protector(SSP)
and enable on sim as a demo. Here is the paper:
ftp://gcc.gnu.org/pub/gcc/summit/2003/Stackguard.pdf

Signed-off-by: qiaowei <qiaowei@xiaomi.com>
Change-Id: I1926936328dad54eee16b322dcaad0b42f9c4a62
2020-08-18 09:58:21 -07:00
leomarradke f5912b5cba arch: samd5e5 : Oneshot, freerun and tickless available support. All support runs on Timer/Counter (TC).
Some fixes in external interrupt controller (EIC) and clockconfig.

Testing:
- Build check only.

Signed-off-by: Leomar Mateus Radke  <leomar@falker.com.br>
2020-08-18 12:42:44 -03:00
leomarradke 171cc38ac2 arch: samd5e5 : Add watchdog timer drivers.
boards: metro-m4  Add support for starting the watchdog timer on the metro-m4.

Testing:
- Build check only

Signed-off-by: Leomar Mateus Radke  <leomar@falker.com.br>
2020-08-18 12:42:44 -03:00
Xiang Xiao a7a81b5126 libc: Replace all [nx]sem_xxx with _SEM_XXX
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I34f407ccd52391588ac1b720fce59d24458fe218
2020-08-18 07:59:21 -07:00
Xiang Xiao 8db91a7974 timers/timer.c:397:19: Fix warning: implicit declaration of function 'timer_setcallback'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-18 13:42:05 +01:00
Xiang Xiao 3d0cdc3d95 sim/loadable: Remove CONFIG_USERMAIN_STACKSIZE from defconfig
since it isn't used for elf binary

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-18 13:42:05 +01:00
chao.an 6176e33ed2 fs/littlefs: enable the low level log only on debug mode
Change-Id: I2fa95e2f1e861f76bb394a06344d90fac28ae195
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-08-18 12:13:32 +01:00
chao.an b89737395b vfs/epoll: add epoll_create1(2) implement
Linux Programmer's Manual

NAME
       epoll_create, epoll_create1 - open an epoll file descriptor

...
SYNOPSIS
       #include <sys/epoll.h>

       int epoll_create1(int flags);
...

   epoll_create1()
       If flags is 0, then, other than the fact that the obsolete
       size argument is dropped, epoll_create1() is the same as
       epoll_create(). The following value can be included in flags
       to obtain different behavior:

       EPOLL_CLOEXEC
              Set the close-on-exec (FD_CLOEXEC) flag on the new file
              descriptor. See the description of the O_CLOEXEC flag in
              open(2) for reasons why this may be useful.

https://man7.org/linux/man-pages/man7/epoll.7.html
2020-08-17 23:41:13 -05:00
chao.an 2e2ebb95ca sys/poll/epoll: sync the epoll_event struct layout with pollfd
epoll(2) call broken caused by 94fe5c8349

Change-Id: I0811bb7a756797651819d46236e26869559b1767
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-08-17 23:41:13 -05:00
chao.an 155860ad15 sys/epoll: move the private handle to epoll_data_t
sync the struct epoll_event define with linux:

Linux Programmer's Manual:

DESCRIPTION

  EPOLL_CTL_DEL
    ...
       The event argument describes the object linked to the file descriptor
       fd.  The struct epoll_event is defined as:

           typedef union epoll_data {
               void        *ptr;
               int          fd;
               uint32_t     u32;
               uint64_t     u64;
           } epoll_data_t;

           struct epoll_event {
               uint32_t     events;      /* Epoll events */
               epoll_data_t data;        /* User data variable */
           };

https: //man7.org/linux/man-pages/man2/epoll_ctl.2.html

Change-Id: I3ad447b485fd331190e461a198ef7c39301eb1bb
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-08-17 23:41:13 -05:00
chao.an f97b8436b3 drivers/bch: flush the dirty sector to keep the sector sequence
flush the dirty sector to keep the sector sequence before ftl write

Change-Id: I1096cce39965806d5c877c2929b5a2ecdab27ac9
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-08-17 23:38:57 -05:00
chao.an ed3cddb684 drivers/bch: delay the sector flush
Delay the sector flush to avoid multiple earse/write operations in sequence write

Change-Id: If4331b7fc8d2c2061325533212b28e826141b411
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-08-17 23:38:57 -05:00
chao.an e5f6dafe1f net/socket: add SOCK_CLOEXEC/SOCK_NONBLOCK support
Reference here:
https://github.com/torvalds/linux/blob/master/include/linux/net.h

Change-Id: I9fd0170bcd1ae7e778e951d454ada76f63854de5
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-08-17 23:38:18 -05:00
David Sidrane 07ce0deda0 Fix Added options for I-Cache & D-Cache broken on c101076704
The Kconfig names were not updated to reflect FLASH. This
   killed performance on F4 and F2.
2020-08-17 23:32:07 +01:00
Xiang Xiao d43bf7717e sched: Support config the argument passed to init
it is useful to pass the nonempty argument to change the init task behaviour

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I684e9c76b9eac54404d0e4e63ab78e51e039c9a8
2020-08-17 12:52:28 -06:00
chao.an 7ce2b3fa74 libc/pthread: Implement pthread_condattr_[g|s]etclock
Reference:
https: //pubs.opengroup.org/onlinepubs/009695399/functions/pthread_condattr_setclock.html

Change-Id: I19c15d5f219fcf28dbfeb2e5a1e3fc7b38ba2259
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-08-17 19:17:08 +01:00
Xiang Xiao 79d476e423 Fix libsupc++.a(vterminate.o): undefined reference to `_impure_ptr'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ibbd9d980aa642b5a23016b54de8a7808db7b3b9f
2020-08-17 13:45:56 -03:00
Xiang Xiao 6039fb48ae libxx: Integrate libc++ latest official release
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ic0a5f6dd8504382c49546c05399c2ea6470cd528
2020-08-17 13:45:56 -03:00
Xiang Xiao 4ebaf12b4b libxx: Ensure uClibc++ distclean clear
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-17 13:45:56 -03:00
Xiang Xiao 85428036ab fs/vfs: Don't check CONFIG_NFILE_STREAMS for mkdir/rename/rmdir/fs_unlink
since these function don't depend on standard input/output function

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I011a387a1e2c1360e8f37716d512bd32f93ad467
2020-08-17 00:16:26 +01:00
Masayuki Ishikawa 2fbb896a4b arch: cxd56xx: Add SMP support to cxd56_farapi.c
Summary:
- This commit adds SMP support to cxd56_farapi.c
- nxplayer now works in SMP mode

Impact:
- Spresense in SMP mode only

Testing:
- Add the following configs to spresense:wifi
- +CONFIG_SCHED_INSTRUMENTATION=yy
- +CONFIG_SCHED_INSTRUMENTATION_BUFFER=y
- +CONFIG_SMP=y
- +CONFIG_SMP_NCPUS=2
- +CONFIG_SPINLOCK_IRQ=y
- Run nxplayer and play an WAV file on uSD card
- NOTE: http streaming playback would cause deadlocks

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-08-16 00:03:18 +01:00