Commit Graph

626 Commits

Author SHA1 Message Date
liuhaitao b4cf5f5dab arch: refine up_serialinit/up_earlyserialinit/rpmsg_serialinit 2020-02-23 09:11:57 -06:00
liuhaitao c5eab0dc8f arch: use ifdef USE_EARLYSERIALINIT to include up_earlyserialinit
There are cases that USE_SERIALDRIVER is defined but USE_EARLYSERIALINIT not defined in some configs. So use ifdef USE_EARLYSERIALINIT to include up_earlyserialinit anyway.
2020-02-23 09:11:43 -06:00
liuhaitao 8ca4ca5ae8 arch: undef USE_SERIALDRIVER if CONFIG_CONSOLE_SYSLOG
An error was introduced from:

  commit f982ee43db
  Author: Xiang Xiao <xiaoxiang@xiaomi.com>
  Date:   Tue Feb 18 09:55:04 2020 +0800

    drivers/serial: Remove the lowconsole driver

    Replace with the syslog console driver which has more capability than lowconsole
2020-02-23 09:10:06 -06:00
Xiang Xiao bd4e8e19d3 Run codespell -w against all files
and fix the wrong correction
2020-02-22 14:45:07 -06:00
Ouss4 ac4049682f arch/mips: Fix the SW0 priority set by commit eb1adca
It must be strictly greater than IPL to get serviced.
2020-02-21 17:00:04 -06:00
Ouss4 eb1adcafe3 arch/mips/src/pic32mX/pic32mX-irq.c: Use the defined CS0 irq number. 2020-02-20 19:30:48 -06:00
Xiang Xiao 51a2171c71 ramlog: Remove g_ramlog_syslog_channel since it's same as g_default_channel
And remove syslog_init_e because all initialization is later now and we don't
distinguish the initialition phase anymore after ramlog don't need special
initialize.
2020-02-18 13:04:45 -06:00
Xiang Xiao dcaaf2d912 ramlog: Remove all ramlog_consoleinit related code
Because we can get the same function by CONSOLE_SYSLOG/syslog_console_init.
BTW, it isn't a good choice to use g_ramlogfops as /dev/console since nsh
will read back what it send out which will surprise most people.
2020-02-18 12:57:43 -06:00
Xiang Xiao f982ee43db drivers/serial: Remove the lowconsole driver
Replace with the syslog console driver which has more capability than lowconsole
2020-02-18 12:51:09 -06:00
Xiang Xiao 6b77f73583 arch: Move iob_initialize into nx_start just after heap initialization
it doesn't make sense that iob initialization is in up_initialize
but other memory components initialization is called in nx_start

Change-Id: Id43aeaa995f340c5943f59a0067a483ff3ac34a2
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-18 10:26:19 -03:00
Xiang Xiao e7d9260014 arch: Customize the typedef of size_t instead of intptr_t
To ensure size_t same as toolchain definition in the first place and rename CXX_NEWLONG to ARCH_SIZET_LONG.  The change also check whether __SIZE_TYPE__ exist before CONFIG_ARCH_SIZET_LONG so our definition can align with toolchain(gcc/clang) definition automatically.
2020-02-18 07:15:19 -06:00
Juha Niskanen 15b78abccf Fix typos in comments 2020-02-14 08:50:45 -06:00
Ouss4 ac4e6618bb arch/mips: Clear the software interrupt through a common function
implemented in the chip specific code.
2020-02-10 12:40:41 -06:00
Ouss4 90043390ff arch/mips/: Fix architectures' references in Kconfigs and Toolchain.defs. 2020-02-10 12:40:41 -06:00
Ouss4 0dc1dc605d arch/mips: When a CPU implements an External Interrupt Controller,
use the IPL bits to control masking interrupts.
2020-02-10 12:40:41 -06:00
Xiang Xiao 6d69439f58 Call xxx_timer_initialize from clock subsystem
Call xxx_timer_initialize from clock subsystem to make timer ready for use as soon as possiblei and revert the workaround:

commit 0863e771a9
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Apr 26 07:24:57 2019 -0600

    Revert "sched/clock/clock_initialize.c:  clock_inittime() needs to be done with CONFIG_SCHED_TICKLESS and clock_initialize should skip clock_inittime() for external RTC case since the RTC isn't ready yet."

    This reverts commit 2bc709d4b9.

    Commit 2bc709d4b9 was intended to handle the case where up_timer_gettime may not start from zero case.  However, this change has the side-effect of breaking every implementation of tickless mode:  After this change the tickless timer structures are used before they are initialized in clock_inittime().  Initialization happens later when up_initialize is called() when arm_timer_initialize().

    Since the tickless mode timer is very special, one solution might be to

    1. Rename xxx_timer_initialize to up_timer_initialize
    2  Move up_timer_initialize to include/nuttx/arch.h
    3.  Call it from clock subsystem instead up_initialize

    Basically, this change make timer initialization almost same as rtc initialization(up_rtc_initialize).

    For now, however, we just need to revert the change.
2020-02-08 07:40:06 -06:00
Xiang Xiao 76bbed07a4 Call up_irqinitialize from irq subsystem
Call up_irqinitialize from irq subsystem to make the irq ready for use as soon as possible
2020-02-08 07:39:22 -06:00
Xiang Xiao c5b1554d84 Remove NETDEV_LOOPBACK option, NET_LOOPBACK is enough 2020-02-02 08:25:06 -06:00
Xiang Xiao 5c80b94820 Replace #include <semaphore.h> to #include <nuttx/semaphore.h>
Since the kernel side should call nxsem_xxx instead and remove the unused inclusion
2020-02-01 08:27:30 -06:00
Xiang Xiao 80277d1630
Refine the preprocessor conditional guard style (#190) 2020-01-31 19:07:39 +01:00
Xiang Xiao 68951e8d72 Remove exra whitespace from files (#189)
* Remove multiple newlines at the end of files
* Remove the whitespace from the end of lines
2020-01-31 09:24:49 -06:00
Gregory Nutt 960c26491c Run tools/nxstyle against all files modified by PR187 and correct complaints 2020-01-30 19:06:13 -06:00
Ouss4 73bdb433bb arch/mips/pic32mz/pic32mz-lowconsole.c: Wait for transfer complete.
Wait for the transfer to complete when using up_lowputc.
2020-01-30 19:03:54 -06:00
Ouss4 701b6897d7 arch/mips/src/pic32mz/pic32mz-head.S: Add showprogress macro 2020-01-30 19:03:01 -06:00
Ouss4 300fe5e354 arch/mips/src/Common and mips32: Access g_current_regs through the macro CURRENT_REGS. 2020-01-30 19:01:47 -06:00
Ouss4 84153ad1a5 arch/mips/src/pic32mz/pic32mz-timer.c: Eliminate a warning found during
testing.
2020-01-13 16:39:54 -06:00
Xiang Xiao 6a3c2aded6 Fix wait loop and void cast (#24)
* Simplify EINTR/ECANCEL error handling

1. Add semaphore uninterruptible wait function
2 .Replace semaphore wait loop with a single uninterruptible wait
3. Replace all sem_xxx to nxsem_xxx

* Unify the void cast usage

1. Remove void cast for function because many place ignore the returned value witout cast
2. Replace void cast for variable with UNUSED macro
2020-01-02 10:54:43 -06:00
Xiang Xiao 87cf5c58ae Correct some problems with network timed events when there are multiple network devices in the configuration.
Squashed commit of the following:

Author: Gregory Nutt <gnutt@nuttx.org>

    Ran nxstyle against many of the affected files.  But this job was too big for today.  Many of the network drivers under arch are highly non-compiant and generate many, many faults from nxstyle.  Those will have to be visited again another day.

Author: Xiang Xiao <xiaoxiang@xiaomi.com>

    This effects all network drivers as well as timing related portions of net/: devif_poll_tcp_timer shouldn't be skipped in the multiple card case.  devif_timer will be called multiple time in one period if the multiple card exist, the elapsed time calculated for the first callback is right, but the flowing callback in the same period is wrong(very short) because the global variable g_polltimer is used in the calculation.  So let's pass the delay time to devif_timer and remove g_polltimer.
2019-12-24 10:37:30 -06:00
Nathan Hartman 9655730ef8 Fix various typos and spelling errors. 2019-12-12 07:41:51 -06:00
Ouss4 47129b36bd arch/mips/*: Run nxstyle on the arch/mips directory. 2019-12-08 08:09:11 -06:00
Gregory Nutt 69318b1024 Re-implements reverted commit 344f7bc9f6 in a way that should not have the undesired side-effect. include/nuttx/sched.h: Add a bit to the TCB flags to indicat the thread is a user thread in a syscall. sched/nuttx/nxsig_dispatch.c: Delay dispatching to signal handlers if within a system call. In all syscall implementations: Process delayed signal handling when exiting system call. 2019-11-28 12:47:36 -06:00
Gregory Nutt cbdd590c82 Revert "include/nuttx/sched.h: Add storage for a previous signal mask. arch/: In all syscall implementations, block all signals before dispatching a system call; resotre signal mask when the system call returns."
Using the sigprocmask() for this purpose has too many side-effects.

This reverts commit 344f7bc9f6.
2019-11-28 11:57:54 -06:00
Gregory Nutt 344f7bc9f6 include/nuttx/sched.h: Add storage for a previous signal mask. arch/: In all syscall implemenations, block all signals before dispatching a system call; resotre signal mask when the system call returnes. 2019-11-28 10:51:29 -06:00
Ouss4 4e3e9fabc7 arch/mips/src/pic32mz/pic32mz-ethernet.c: Clean/invalidate descriptors and buffers when needed to account for an enabled cache. 2019-11-23 09:28:14 -06:00
Ouss4 bd45193a79 arch/mips: Add cache operations. Cache is initialized at startup (head.S) and the different operations are implemented in up_cache.S. 2019-11-23 09:16:41 -06:00
Ouss4 0970d742e9 arch/mips/src/pic32mz/pic32mz-lowinit.c: Remove the pic32mz_k0cache function, this was actually enabling cache in KSEG2. Correct (as per the datasheet) the values for initializing the prefetch module. Add a function to disable all ADC inputs at startup. When ADC is used each pin will be enabled individually. 2019-11-23 09:05:13 -06:00
Ouss4 fd1b82ae4b arch/mips/src/pic32mz/pic32mz-gpio.h: Include stdbool and stdint, they are used in this file. 2019-11-23 08:59:02 -06:00
Ouss4 5a3c9c914c arch/mips/src/pic32mz/pic32mz-i2c.c: When perfoming an i2c reset, the pins were used uninitialized. 2019-11-23 08:57:43 -06:00
Ouss4 cbc72f756c arch/mips/src/pic32mz/pic32mz-spi.c: Transfers can now be configured to use DMA. 2019-11-23 08:48:29 -06:00
Ouss4 fcc1410485 arch/mips/src/pic32mz/pic32mz-dma.c: Add a way to reconfigure a DMA channel. 2019-11-23 08:35:48 -06:00
Ouss4 b853a5c750 arch/mips/src/pic32mz/pic32mz-dma.c: Make the DMA interrupt event configurable when setting up a transfer. This allows changing the event without deallocating a channel first. Clear the DMA interrupt flag when the ISR is called. Change some misleading names. 2019-11-23 08:33:06 -06:00
Xiang Xiao 800e12fc42 arch/: Add rpmsg_serialini() call to every implementation of up_initialize() for rpmsg uart initialization. 2019-11-04 08:11:50 -06:00
Nathan Hartman 46aaec7ba0 Fix minor typos in docs and comments. 2019-09-29 12:52:20 -06:00
Juha Niskanen e8b5dd4528 Fix use of undefined pp-token #errror, other typos. 2019-09-19 18:19:18 -06:00
Juha Niskanen ebc6f51641 Fix some typos 2019-09-17 10:46:23 -06:00
Nathan Hartman 366053e464 Fix typos, 1 in a #define, others in comments. This changes one definition: _MQ_TIMEDRECIEVE is changed to _MQ_TIMEDRECEIVE. It appears this symbol is not used anywhere. 2019-09-11 08:56:56 -06:00
Gregory Nutt 240926c995 Beginning to update comments to reflect new organization of the boards/ sub-directory. 2019-08-08 08:46:54 -06:00
Gregory Nutt 615c0ea7ee Change naming configs/ to boards in comments, Documentation, etc. Still a few more to go. 2019-08-05 07:13:48 -06:00
Nathan Hartman 68d43d3679 Fix typos. 2019-08-04 14:50:28 -06:00
Ouss4 2d6e4bd26b arch/mips/src/pic32mz/pic32mz-config.h: Make the PLL input clock configurable. 2019-07-21 16:11:04 -06:00