Commit Graph

15363 Commits

Author SHA1 Message Date
Xiang Xiao
7fd3a3bcca xarch/sim: Call pm_initialize from up_initialize directly
We don't need the additional flexibility since sim just has one chip.
2020-02-10 08:56:51 -06:00
Xiang Xiao
978575d79a arch/sim: Pass X11 related config to host environment
Remove the hard code CONFIG_SIM_X11NOSHM value from up_x11framebuffer.c
2020-02-10 08:56:37 -06:00
Xiang Xiao
856b62ca09 arch/sim: Fix X11 segmentation fault when CONFIG_SIM_X11NOSHM isn't enabled
up_x11mapsharedmem should assign the share memory to g_framebuffer
2020-02-10 08:56:22 -06:00
Xiang Xiao
406a9adfdd arch/sim: fix up_idle call the wrong pthread_yield version
The logic want the host version but link to NuttX version
2020-02-09 07:44:51 -06:00
Xiang Xiao
e06a4226ed arch/sim: Reuse the main thread as the simulated CPU0 2020-02-09 07:43:47 -06:00
Xiang Xiao
a87271617a arch/sim: Replace pthread mutex with atomic function for up_testset
up_testset may be called from signal hander but it isn't safe to call pthread API in that context
2020-02-09 07:43:10 -06:00
Xiang Xiao
7794dc8821 arch/sim: Set idle thread stack size to zero
To avoid ps generate "Segmentation fault" because do_stackcheck
check the stack color if the stack size doesn't equal zero
BTW, it is better to set idle task stack size to zero since idle
task use the host thread and the stack size from config isn't the
actual value.
2020-02-09 07:42:19 -06:00
Xiang Xiao
bfe1d471ce sim/arch: Fix up_head.c:122:11:implicit declaration of function 'up_cpu_index' 2020-02-09 07:41:42 -06:00
Xiang Xiao
04128b4570 arch/sim/src: Rename board_lcd.c to up_lcd.c like other sim code
Rename board_lcd.c to up_lcd.c like other sim code and compile up_spiflash.c and up_qspiflash.c conditionally
2020-02-08 08:52:34 -06:00
Xiang Xiao
fa3e66fe82 arch/sim/src/: Reimplement sim uart on top of serial driver framework
The benefits include:

1. Simplify the implementation
2. Support Ctrl+C automatically
3. Support poll automatically
4. Call pm_activity automatically
5. Save one polling thread
2020-02-08 07:52:26 -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
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
Masayuki Ishikawa
81f1133174 ELF64 support (#220)
* include: Introduce elf64.h and elf.h

    Added elf64.h for 64bit ELF support and moved common definitions
    from elf32.h to elf.h. Also introduced Elf_xxx to be used in
    common libraries such as binfmt.

  * binfmt, include, modlib, module: Add support for ELF64

    Elf_xxx must be used instead of Elf32_xxx to support ELF64.
    To use ELF64, CONFIG_ELF_64BIT must be enabled.

  * binfmt, modlib: Add support for relocate address

  * arch: risc-v: Add include/elf.h

  * libs: machine: Add risc-v related files.

    NOTE: Currently only supports ELF64

  * boards: maix-bit: Add elf and posix_spawn configurations

  * boards: maix-bit: Add support for module configuration
2020-02-07 17:10:23 -06:00
liuguo09
e21c30cf9d
arch/arm/include/stm32f010g0/chip.h: correct wrong #if defined to fix build break (#227)
/home/jenkins/jenkins-slave/workspace/NuttX-Nightly-Build/nuttx/include/arch/stm32f0l0g0/chip.h:53:42: error: missing ')' after "defined"
   53 | #if defined(CONFIG_ARCH_CHIP_STM32F030RC || CONFIG_ARCH_CHIP_STM32F030CC)
      |                                          ^~
/home/jenkins/jenkins-slave/workspace/NuttX-Nightly-Build/nuttx/include/arch/stm32f0l0g0/chip.h:53:45: error: missing binary operator before token "CONFIG_ARCH_CHIP_STM32F030CC"
   53 | #if defined(CONFIG_ARCH_CHIP_STM32F030RC || CONFIG_ARCH_CHIP_STM32F030CC)

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-02-07 08:30:58 -08:00
Peter van der Perk
499607d68f
S32K add support for Nxp drone boards (#224)
* S32K add support for Nxp drone boards

* Update arch/arm/src/s32k1xx/hardware/s32k1xx_rtc.h codestyle

Co-Authored-By: David Sidrane <David.Sidrane@Nscdg.com>

Co-authored-by: Jari van Ewijk <jari.vanewijk@nxp.com>
Co-authored-by: David Sidrane <David.Sidrane@Nscdg.com>
2020-02-07 04:53:40 -08:00
David Sidrane
2d5141baf8
Merge pull request #222 from han1raaijmakers/imxrtI2C
imxrt added missing i2c prescale mask
2020-02-07 04:09:24 -08:00
David Sidrane
cabd6927bc
Merge pull request #223 from han1raaijmakers/KinetisTJA110X
Kinetis renamed TJA1100 to TJA110X registers
2020-02-07 04:08:41 -08:00
Peter van der Perk
d79e673468 imxrt added missing i2c prescale mask 2020-02-07 10:09:43 +01:00
Peter van der Perk
513475c11c Kinetis renamed TJA1100 to TJA110X registers 2020-02-07 10:04:48 +01:00
Alan Carvalho de Assis
7f91a737ea arch/arm/include/stm32f010g0/chip.h: Add support for STM32F030CC 2020-02-06 17:40:05 +00:00
David Sidrane
4c0bc308cc
Merge pull request #212 from bkueng/stm32_spibus_initialize_fix
fix stm32_spibus_initialize: add missing leave_critical_section
2020-02-06 01:33:43 -08:00
Beat Küng
729af004c0
fix stm32_spibus_initialize: ensure leave_critical_section is called
in case the requested SPI bus is invalid or not configured.
2020-02-06 08:05:21 +01:00
Alan Carvalho de Assis
bc00f6e444 arch/arm/src/stm32f010g0: Add memorymap and pimmap support for the
STM32F030RC
2020-02-05 22:38:04 +00:00
Alan Carvalho de Assis
af68c22a2e arch/arm/src/kinetis/kinetis_spi.c: Clear the MDIS bit before trying to
disable TX or RX.
2020-02-04 20:45:00 +00: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
YAMAMOTO Takashi
2983fcdeb7 Fix an inverted logic in the following commit.
commit 39bd9ff670
	Author: YAMAMOTO Takashi <yamamoto@midokura.com>
	Date:   Wed Jan 29 00:17:05 2020 +0900

		sim: Prefix symbols with _ for non-ELF

		Namely for Mach-O.  Leave __CYGWIN__ case as it is.
2020-01-29 10:02:39 -08:00
David Sidrane
04a7ccdc68 imxrt - interrupt serial storm, add DTCM and set up I and D cache (#175)
* Serial Fixed interrupt storm

  The target would randomly hang in the serial isr.
  The priv->ie and the hardware were inconsistent.
  The isr used the priv->ie to gate offloading
  the RX data. Bang! Hung.

                  imxrt_disableuartint(priv, &ie);
                  ret = imxrt_setup(dev);

                  /* Restore the interrupt state */

                  imxrt_restoreuartint(priv, ie);
       interrupt->  Of no return
                  priv->ie = ie;

   On a fast cpu with FIFO, this will not work
   with out proper protections.

* Serial: Conditionally enable 9 bit mode

* armv7-mi/mpu.hi: Restructure API

   Preserve the existing API and enabled better granualriy on
   setting.

* Enable MPU for non protected builds to set cache

* mpuinit use symbolic values for addresses

* Allow DTCM on HEAP

* allocateheap Fix Coding style
2020-01-29 07:33:19 -06:00
YAMAMOTO Takashi
4174c818df sim: Don't bother to remove nuttx.rel after consuming
We usually don't remove input files like $OBJS.
2020-01-29 09:03:48 +01:00
YAMAMOTO Takashi
b5573c5b51 sim: Fix nuttx.rel for macOS
* ld doesn't have --start-groupi/--end-group things.  As far as I know,
  it works that way by default.

* objcopy with Mach-O support is not widely available.
  (GNU binutils seem to claim the support but it didn't actually work
  for me.  llvm-objcopy --redefine-syms explicitly rejects Mach-O.)
  Instead, use -unexported_symbols_list linker flag to hide symbols
  to avoid conflicts with host symbols.
2020-01-29 09:03:48 +01:00
YAMAMOTO Takashi
298c2e5e4f sim: Fix stack alignment
The recent x86-64 convention requires 16-byte alignment before
(not after) calling a function.

This fixes snprintf crash I observed on macOS while saving XMM registers.
2020-01-29 09:03:48 +01:00
YAMAMOTO Takashi
39bd9ff670 sim: Prefix symbols with _ for non-ELF
Namely for Mach-O.  Leave __CYGWIN__ case as it is.
2020-01-29 09:03:48 +01:00
YAMAMOTO Takashi
69a8b9721c sim: Check __ELF__ for .type/.size directives
Mach-O assembler doesn't have them either.
2020-01-29 09:03:48 +01:00
Dave Marples
e99a8d192d Generic SPI interface for controlling an LCD display 2020-01-28 11:32:35 -03:00
taikoyaP
4813b9d751 arch/arm/src/stm32l4/stm32l4_flash.c: Fix flash_erase(page) when page >= 256 (#170)
All STM32L4 MPUs have FLASH_CR_PNB bits (8 bits), and some MPUs have FLASH_CR_BKER bit to change bank if page >= 256.
The code wasn't setting or clearing FLASH_CR_BKER correctly.
2020-01-27 14:56:17 +00:00
YAMAMOTO Takashi
5515e09e8d Fix some "from from" in code comments 2020-01-27 08:46:46 +01:00
Satoshi Togawa
705ac84432 STM32L4: Add workaround of data cache corruption on RWW.
Author: Gregory Nutt <gnutt@nuttx.org>

    Run .c modified by the PR through tools/nxstyle and correct all reporting coding style problems noted in the file.

Author: Satoshi Togawa <togawa@develcb210.centurysys.co.jp>

    STM32L4: Add workaround of data cache corruption on RWW.

    Some STM32L4 chips has eratta "Data cache might be corrupted during Flash Read While Write operation". This is also in STM32, and arch/arm/src/stm32/stm32f20xxf40xx_flash.c has workaround.

    To enable this workaround, define CONFIG_STM32L4_FLASH_WORKAROUND_DATA_CACHE_CORRUPTION_ON_RWW.
2020-01-26 08:57:12 -06:00
y-sugino
cf756061f4 arch: fe310: Fix comments 2020-01-26 07:18:47 -06:00
Satoshi Togawa
50223920a8 arch/arm/src/stm32l4/hardware/stm32l4_flash.h: Add flash register bit in stm32l4x5
STM32L4x5 MPUs have flash bank register bits similar to STM32L4x6.  But it is not defined on these MPUs in stm32l4_flash.h.  So I define these bits.
2020-01-25 17:46:06 -06:00
patacongo
b46b76c956 Fix implicit definition warnings do to missing inclusion of nuttx/time.h (#162)
Recent changes removed CONFIG_TIME_ENHANCED and unmasked some warnings.  These warnings were caused by nuttx/time.h not being included by files that now referenced clock_daysbeforemonth() and clock_isleapyear().

This commit adds those missing inclusions and eliminates the warnings.

Co-authored-by: Gregory Nutt <gnutt@nuttx.org>
2020-01-24 23:06:19 +01:00
Gregory Nutt
d644b759b2 arch/arm/src/lpc17_40/lpc17_49_ethernet.c: Fix build failure.
Fix these build errors which occurred if there was no PHY:

chip/lpc17_40_ethernet.c:1643:31: error: expected expression before ';' token
  ret lpc17_40_phyinit();

chip/lpc17_40_ethernet.c:3941:1: error: expected identifier or '(' before '{' token
  {

chip/lpc17_40_ethernet.c:448:13: warning: 'lpc17_40_macmode' used but never defined
  static void lpc17_40_macmode(uint8_t mode);
2020-01-23 19:45:41 -03:00
Xiang Xiao
ac4735cf58 Many fixes on Kconfigs and defconfigs do SDIO, NETDEV, USBHOST
Author: Xiang Xiao <xiaoxiang@xiaomi.com>

    Fix warning: selects SDIO_DMA or SDIO_BLOCKSETUP which has unmet direct dependencies (MMCSD)

    Fix warning: selects NETDEV_TELNET which has unmet direct dependencies (NETDEVICES && NET && NET_TCP)

    Fix warning: selects ARCH_PHY_INTERRUPT which has unmet direct dependencies (NETDEVICES && ARCH_HAVE_PHY)

    Fix warning: selects USBHOST_HAVE_ASYNCH which has unmet direct dependencies (USBHOST)

    Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-01-23 11:41:12 -03: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