Commit Graph

860 Commits

Author SHA1 Message Date
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
a8de37fbec Ensure all source code end with one and only one newline
by this command:
git ls-files -z | while IFS= read -rd '' f; do tail -c1 < "$f" | read -r _ || echo >> "$f"; done
2020-02-08 07:25:56 -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
Xiang Xiao
1e3f457c9e Remove TIME_EXTENDED option to more conform C standard
Gregory Nutt <gnutt@nuttx.org>

    Run all .c and .h files modified in this PR through nxstyle and correct all coding standard problems.

Xiang Xiao <xiaoxiang@xiaomi.com>

    Remove TIME_EXTENDED option to more conform C standard

    Note: the code/data size increment is small
2020-01-23 08:17:22 -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
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
Xiang Xiao
3bc62f1ccc Change space to tab and help to ---help--- in Kconfig files. 2019-10-05 21:39:12 -06:00
Nathan Hartman
46aaec7ba0 Fix minor typos in docs and comments. 2019-09-29 12:52:20 -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
2730714774 Update more comments and README.txt files to reflect new organization of the boards/ sub-directory. 2019-08-08 09:17:04 -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
Alin Jerpelea
a1c991d921 Merged in alinjerpelea/nuttx (pull request #963)
Move boards to boards folder

* boards: rename configs folder to boards

    This is the proposed layout after the change:

    boards: - folder containing board folders
            <board>: - name of each board
                    drivers: - extra drivers specific for platform
                    include: - header files for the boars
                    scripts: - extra scripts specific for platform
                        src: - board specific code
                      tools: - extra tools specific for platform
                    <config>: - board specific configuration(s)

    Note:
    <xxx> names are dependent on platform

    This is a logical change to aim to the arch layout but this is a
    huge change it should be done in several steps to lower the risk.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* Kconfig: replace configs with boards

    The change is needed after the path change

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* Makefile: replace configs with boards

    The change is needed after the path change

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* Makefile.*: replace configs with boards

    The change is needed after the path change

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* Make.defs: replace configs with boards

    The change is needed after the path change

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* .sh: replace configs with boards

    The change is needed after the path change

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* .mk: replace configs with boards

    The change is needed after the path change

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* .c & .h: replace configs with boards

    The change is needed after the path change

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* .bat: replace configs with boards

    The change is needed after the path change

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-08-05 12:04:14 +00:00
Nathan Hartman
68d43d3679 Fix typos. 2019-08-04 14:50:28 -06:00
Gregory Nutt
a73cd667d9 configs/makerlisp: This commit brings in a new configuration to support execution entirely out of external SRAM.
Squashed commit of the following:

    configs/makerlisp/scripts/makerlisp_ram.linkcmd:  Fixup .RESET and .STARTUP.  These need to be redirected to RAM since they default to ROM.

    configs/makerlisp/scripts/makerlisp_ram.linkcmd:  Restore some settings that should be unnecessary but are really required by the current implementation.

    configs/makerlisp:  Rename nsh configuratinon to nsh_flash.  Create new configuration, nsh_ram, that is identical to the nsh_flash configuration except that the code runs out of external SRAM.

    configs/makerlisp/scripts:  Add a linker script to support execution from RAM.
2019-06-26 09:56:20 -06:00
Adam Porter
ac46dbbffd drivers/usbhost: Remove duplicate const in usbhost files. 2019-06-20 06:49:56 -06:00
Gregory Nutt
ad0181a6d4 arch/z80/src/ez80/ez80_spi.c: Fix a poorly constructed loop that would lead to hangs. 2019-06-18 09:28:13 -06:00
Gregory Nutt
4bfa6fe511 arch/z80/src/ez80: Correct setting of RTC time. 2019-06-18 08:32:31 -06:00
Gregory Nutt
4d78132c46 arch/z80/src/ez80: Fix a bad SPI register address definition. Clean up RTC lower half driver problems. Update a README. 2019-06-17 15:20:28 -06:00
Gregory Nutt
7aa8039179 Squashed commit of the following:
commit f5080f53516a853408dd80f09f85e1d1c139133f
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Mon Jun 17 12:24:22 2019 -0600

    arch/z80/src/ez80/ez80_spi.c:  SPI driver still does not work.  But the driver now has timeouts so that at least it does not hang the system on startup.

commit 5241e9ae643981c43c8c7fa8478a01d0c2e17eb0
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Mon Jun 17 10:45:11 2019 -0600

    arch/z80/src/ez80:  Fixes to SPI baud rate calculation.

commit ce2e9e3703485563a0a5b6a57e4080ad45d91fd7
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Mon Jun 17 09:29:13 2019 -0600

    arch/z80/src/ez80:  Cosmetic and unnecessary clean-up or serial driver.

commit 77287c8508a7e3262068d3e8cf1c5f8e27f3a144
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Mon Jun 17 09:08:56 2019 -0600

    arch/z80/src/common and arch/z80/src/ez80:  Clean up some assertion-related logic.

commit 4d2d3594c22f7240119255825fce2d2437301404
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Mon Jun 17 07:48:21 2019 -0600

    configs/makerlisp/nsh/defconfig:  Enable STACKDUMP on assertion.

commit 76b7a2faa3f213dd26634dd9440d12f746cac097
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Mon Jun 17 07:47:55 2019 -0600

    configs/makerlisp/include/board.h:  Don't put the board in reset on a simple assertion, onlhy a full panic.

commit 0a0dc12edcd39c07696769cb7249d8c39a148ccc
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Mon Jun 17 07:46:54 2019 -0600

    arch/z80/src/ez80/ez80_rtc_lowerhalf.c:  Remove all references to alarm ID.

commit 1a4dba1075fcf6466e87520a8ba66bbf91d696d7
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Mon Jun 17 07:33:29 2019 -0600

    configs/makerlisp/src/ez80_bringup.c:  Fix an error that was causing MMC/SD to fail to initialize.  Unfortunately now the system hangs.

commit 145a395c7a8e73336fe62caf803d108c59e306a5
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Mon Jun 17 07:32:50 2019 -0600

    arch/z80/src/ez80:  Add an RTC lower half driver.  Initial commit is just the STM32 RTC lower half with name changes.
2019-06-17 12:25:43 -06:00
Gregory Nutt
1fd6c432fc configs/makerlisp/nsh/defconfig: Enable Procfs, RTC, and SPI-based SD support. Various fixes under arch/z80/src/ez80 for a clean compile. 2019-06-16 14:45:38 -06:00
Gregory Nutt
a02858365a arch/z80/src/ez80/ez80_vectors.asm: Fix a logic error in vector initialization 2019-06-16 11:48:29 -06:00
Gregory Nutt
7e05bacd54 configs/makerlisp: Update external memory settings in linker script. 2019-06-16 11:48:29 -06:00
Gregory Nutt
495a648573 arch/z80/src: Rename up_doirq.c and up_internal.h to z80_doirq.c and z80_internal.h for better consistency with the naming conventions 2019-06-09 19:08:42 -06:00
Gregory Nutt
0148124e33 Squashed commit of the following:
nuttx/arch/z80/src:  To properly follow the coding standard, the z80 architecture common should up_mmuinit should be called z80_mmu_initialize.

    nuttx/arch/z80/src:  To properly follow the coding standard, the z80 architecture common should up_loweserialinit should be called z80_lowserial_initialize.

    configs/z80sim/src/z80_serial.c:  Remove unused function up_earlyserialinit()

    nuttx/arch/z80/src:  To properly follow the coding standard, the z80 architecture common should up_serialinit should be called z80_serial_initialize.

    nuttx/arch/z80/src:  To properly follow the coding standard, the z80 architecture common should up_doirq should be called z80_doirq.

    arch/z80/src/common:  up_addregion() must be prototyped in nuttx/mm/mm.h, not up_internal.h
2019-06-08 22:01:53 -06:00
Gregory Nutt
d39ac6c3a1 arch/z80/src/common: Fix some name of internal z80-family common functions. ez80_* is wrong. up_ is misleading. 2019-06-08 11:36:55 -06:00
Gregory Nutt
f5b890d098 Squashed commit of the following:
arch/z80/src/ez80:  Clean-up RTC driver; get a clean compilation.  Still untested.

    arch/z80/src/ez80:  This brings the RTC to code complete, but does not yet compile.

    arch/z80/src/ez80/ez80_rtc.c:  Bring in badly ported RTC driver from STM32F4.  Little more than naming changing at this point not even ready to attempt comilation

    arch/z80/src/ez80:  Add RTC driver.  Initial commit is just the STMF4 RTC driver with name changes.
2019-06-08 09:58:24 -06:00
Gregory Nutt
1f3958116a arch/z80/src/ez80/Make.defs: Fix some backward conditional loic 2019-06-07 13:23:54 -06:00
Gregory Nutt
fbb6f6cde0 configs/: Rename ZDS-II start files from xxx_lowinit.c to xxx_boot.c; rename board initialization logic from xxx_lowinit() to xxx_board_initialize(). These changes make the ZDS-II configurations more similar to board initialization conventions to used for other architectures. 2019-06-05 10:14:58 -06:00
Gregory Nutt
cf8268f7d8 configs/makerlisp/src/ez80_lowinit.c: Remove redundant SPI GPIO setup. This is already done in the SPI driver.
configs/makerlisp/src/ez80_spi.c:  Add hooks needed by SPI driver.  Move SPI MMC/SD chip selected configuration from ez80_lowinit.c to here as it done in other NuttX architectures.  This enables support for multiple devices on the SPI bus.
2019-06-05 08:20:00 -06:00
Gregory Nutt
4e98980045 Add initial support for the MakerLisp eZ80 board. Ref: https://makerlisp.com/
Squashed commit of the following:

    configs/makerlisp:  Update comments about use of serial console.

    configs/makerlisp:  Add LED support, remove vestiges of button support (the board has no user buttons).  Add support for SPI-based MMC/SD card slot.

    arch/z80/src/ez80:  Fix some link problems.

    libs/libc/syslog/lib_syslog.c:  The ZDS-II toolchain does not declare va_coy in stdarg.h.  I think that the use of va_copy in vsyslog() is no necessary.

    configs/makerlisp:  Initial configuration directories cloned from ez80f910200zco with little more than naming changes.
2019-06-04 11:12:17 -06:00
Gregory Nutt
4a7f0166cf arch/z80/src/ez80/ez80_i2c.c: Cosmetic changes from code review. Also makes I2C and SPI configurable options. 2019-06-04 06:49:45 -06:00
Gregory Nutt
6fbfd00396 arch/z80/src/ez80/ez80_spi.c: Cosmetic changes from code review. 2019-06-03 23:59:53 -06:00
Gregory Nutt
59f3180179 Re-verify ez80 build. Fixes to other ZiLOG architectures broke ez80 again. 2019-06-03 19:04:24 -06:00
Gregory Nutt
622c272ea3 Clean up some variouis compiler problems using SDCC to compiler Z180. 2019-06-03 18:16:23 -06:00
Gregory Nutt
7ab149d8e9 Various fixes to get a clean compile with the SDCC compiler. Compile is 'almost' clean. 2019-06-03 16:53:11 -06:00
Gregory Nutt
fd4436f559 arch/z80/src/Makefile.zdsiil: Minor cleanup 2019-06-03 15:35:36 -06:00
Gregory Nutt
27bb130bf8 arch/z80/src/: Fix a few more ez80 compile issues. Update README files. 2019-06-02 18:35:32 -06:00
Gregory Nutt
fc79fc5ce1 arch/z80/src: Fix ez80 compile problems due to New ZDS-II toolchain and ongoing bit rot due to non-C89 code creeping into the core OS. 2019-06-02 15:36:38 -06:00
Gregory Nutt
2767e80459 Squashed commit of the following:
ez80:  Fixing a few more compile problems.  I am afraid that the 5.3.0 compiler it too buggy to use.
    ez80:  Additional build-related fixed.
    eZ80:  Updating to use the newest ZDSII 5.3.0 toolchain.
2019-06-02 11:05:31 -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
Gregory Nutt
b290160b3b Rename sched_process_timer to nxsched_process_timer. That is the appropriate name for an internal sched/ function (still many named incorrectly). 2019-03-20 19:27:40 -06:00
Gregory Nutt
a64869aa67 CONFIG_NFILE_DESCRIPTORS=0 can no longer be used to disable the file system. NuttX with no file system does not make sense.
Squashed commit of the following:

    configs/:  The few configurations that formerly set CONFIG_NFILE_DESCRIPTORS=0 should not default, rather they should set the number of descriptors to 3.
    fs/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    tools/:  Tools updates for changes to usage of CONFIG_NFILE_DESCRIPTORS.
    syscall/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    libs/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    include/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    drivers/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    Documentation/:  Remove all references to CONFIG_NFILE_DESCRIPTORS == 0
    binfmt/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    arch/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    net/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    sched/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    sched/Kconfig:  CONFIG_NFILE_DESCRIPTORS may no longer to set to a value less than 3
    configs/:  Remove all settings for CONFIG_NFILE_DESCRIPTORS < 3
2019-02-11 12:09:26 -06:00
Gregory Nutt
a2e62f557d Squashed commit of the following:
sched/init/nx_bringup.c:  Fix a naming collision.
    sched/init:  Rename os_start() to nx_start()
    sched/init:  Rename os_smp* to nx_smp*
    sched/init:  Rename os_bringup to nx_bringup
    sched/init:  rename all internal static functions to begin with nx_ vs os_
2019-02-04 16:20:35 -06:00