Commit Graph

617 Commits

Author SHA1 Message Date
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
Ouss4
99111c2af8 drivers/mtd/sst26.c: Accept the 16MBit Flash when reading the JEDEC-ID at init. 2019-07-21 16:07:44 -06:00
Ouss4
145970a266 arch/mips/src/pic32mz/pic32mz-spi.c: Fix SPI Mode selection. CKE is the inversion of the CPHA. 2019-07-21 15:57:06 -06:00
Abdelatif Guettouche
ee32b449a6 arch/mips/src/pic32mz: Add DMA support. 2019-06-28 10:03:18 -06:00
Ouss4
87499ba3ec arch/mips/src/pic32mz/pic32mz-gpio.c: Use LAT instead of PORT when writing. 2019-06-28 09:51:19 -06:00
Gregory Nutt
b21c12bd18 Fix errors found in build testing:
arch/mips/src:  Previous commit used CP0 register definitions that were not defined in the cp0.h header file.  Probably these were from the Microchip hacked up GCC toolchain but are not generally available.  Fix:  Add definitions to NuttX cp0.h header file.

mm/iob:  Eliminate some warnings about testing the value of an undefined pre-processor variable.
2019-05-25 11:45:22 -06:00
Gregory Nutt
d5bbbba8ad Rename all remaining arch/xxx/src/xxx/chip to arch/xxx/src/xxx/hardware. 2019-05-25 09:27:28 -06:00
Gregory Nutt
7ef69fea47 arch/mips/src/mips32/up_vfork.c: Fix a copy-paste error. On vfork, the GP register was being set to the new SP value vs. the context GP value. NOTED in Bitbucket issue 155. 2019-05-22 08:51:51 -06:00
Gregory Nutt
abf6965c24 Squashed commit of the following:
libs/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    syscall/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    wireless/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    Documentation/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    include/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    drivers/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    sched/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    configs:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    arch/xtensa:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    arch/z80:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    arch/x86:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    arch/renesas and arch/risc-v:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    arch/or1k:  Remove all references to CONFIG_DISABLE_SIGNALS.  Signals are always enabled.
    arch/misoc:  Remove all references to CONFIG_DISABLE_SIGNALS.  Signals are always enabled.
    arch/mips:  Remove all references to CONFIG_DISABLE_SIGNALS.  Signals are always enabled.
    arch/avr:  Remove all references to CONFIG_DISABLE_SIGNALS.  Signals are always enabled.
    arch/arm:  Remove all references to CONFIG_DISABLE_SIGNALS.  Signals are always enabled.
2019-04-29 14:52:05 -06:00
Abdelatif Guettouche
e5f84dca39 The commit corrects the gpioirq when mismatch mode is selected and adds support for edge detect mode. Slew Rate was also added for completeness. 2019-04-03 17:26:22 -06:00