Commit Graph

15482 Commits

Author SHA1 Message Date
Masayuki Ishikawa a5cb0b3731 arch: xtensa: Fix SMP related logic
NOTE: Applied the same logic as in other SMP architectures
2020-03-04 23:34:43 -06:00
liuhaitao b27cbf6de1 arch/x86: correct typo error to fix x86 boards build break 2020-03-04 07:03:22 -06:00
Masayuki Ishikawa e16c3ca25b arch: esp32: Fix compile error with xtensa-esp32-elf-gcc 8.2.0 2020-03-04 03:51:13 -06:00
liuhaitao 923c05f17f arch/x86_64: fix two typo errors to pass build
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-03-04 00:42:32 -06:00
Sonic Yang b984752aec Flat address x86_64 port of Nuttx (#411)
* arch: x86_64: Pour-in the x86_64 code from cRTOS repository, excluding modifications of NuttX kernel, jailhouse support and linux compatibility layer

* arch: x86_64: Refactor x86_64 loading procedure for better comprehension and included support for multiboot2

* arch: x86_64: Locate the kernel at 4GB~ and modify the page table initializing procedure accordingly

* arch: x86_64: Implemented kconfig option for various x86_64 capabilities, dynamic probe and check capability on lowsetup before enabling

* arch: x86_64: inte64_check_capability: Use Marco to prettify the capability checking procedure

* arch: x86_64: intel64_timerisr.c: Refactor with new frequency calibrating method

* arch: x86_64: Fix C alias of page table and GDT/IST

* arch: x86_64: Reload GTDR with GDT in high address in up_lowsetup

* arch: x86_64: Consolidate MSR definition in arch/arch.h

* arch: x86_64: Edit the way of handling GDT/IST in C into structures

* arch: x86_64: Correct the starting point of isr/irq stack

* arch: x86_64: Update up_initialize.c with the new initializing procedure

* arch: x86_64: up_map_region now take flags instead of assuming WR/PRESENT

* arch: x86_64: Overhual of interrupt initialization procedure

* arch: x86_64: Properly configure the heap to be memory as [_ebss, end of memory]

* arch: x86_64: Try to probe the TSC frequency, fall-back to user specified frequency on failure

* arch: x86_64: Remove debug printing during restore_aux, causing infinite CTX bug

* arch: x86_64: for X86 16500 serial interrupt to work, OUT2 of MCR must be 1. Make it stuck at 1 after boot

* arch: x86_64: Correctly apply license header, comment and format code

* arch: x86_64: properly send a SIGFPE on floating point error

* arch: x86_64: Remove unused variable in up_restore_auxstate

* arch: x86_64: properly trash the processor with an infinite loop

* arch: x86_64: Fix typo in ISR handler causing ISR not handled

* arch: x86_64: Fix possibile race conditions with scheduler debug option on in signal handling path

* arch: x86_64: Fix typo in MSR_X2APIC_LVTT_TSC_DEADLINE

* arch: x86_64: Migrate tickless implementation to the new MSR naming and frequency calibration method

* board: x86_64: qemu: Add guard to exclude up_netinitialize when compiling without net support

* arch: x86_64: update defconfigs

* arch: x86_64: rename qemu as qemu-intel64

* arch: x86_64: update Board readme
2020-03-03 19:02:59 -06:00
GOERLITZ Otmar 9623ffaf6d arch/arm/src/stm32/hardware/stm32f30xxx_rcc.h: Correction to RCC_CFGR3 definitions 2020-03-03 17:23:50 -06:00
Gregory Nutt 2eff5a6c63 z20X: Continued development of the W25 Bootloader.
Kconfig files.  Repartition some functionality.  Bootloader support will need to be provided in logic under arch/z80/src/ez80 so the critical configuration selections were moved the Kconfig file there.

arch/z80/src/ez80/ez80_i2c.h:  Rename arch/z80/src/ez80/ez80f91_i2c.h.  It is sharable by both ez80f91 and ez80f92.

arch/z80/src/ez80/:  Add logic to perform an additional level of interrupt redirection.  This is necessary because the the interrupt handling is part of the loader FLASH-based logic.  In order to share interrupts with the program loaded into RAM by the loader, another layer or redirection is required to get control to the interrupt handlers in the loaded program.  See ez809f2_loader.asm and ez80f92_program.asm

boards/z80/ez80/z20x/scripts:  Reduce size of the interrupt re-direction buffer from 1Kb to 512b.
2020-03-03 19:39:57 -03:00
Gregory Nutt a21120e3b6 Correct PR424 to coding standard
Run all .c files modified by PR424 through nxstyle and correct most of the complaints (many long line complaints ignored for now).  Update file headers to use Apache 2.0 license.
2020-03-03 13:59:54 -06:00
Daniel Agar 415fc17e98 stm32h7: spi_exchange (no dma) available with CONFIG_STM32H7_SPI_DMATHRESHOLD 2020-03-03 13:30:52 -06:00
Daniel Agar a0169e4c37 stm32f7: spi_exchange (no dma) available with CONFIG_STM32F7_SPI_DMATHRESHOLD 2020-03-03 13:30:52 -06:00
Daniel Agar 0600d08d1a stm32: spi_exchange (no dma) available with CONFIG_STM32_SPI_DMATHRESHOLD 2020-03-03 13:30:52 -06:00
GAEHWILER Reto e31f0f37f1 arch/arm/src/stm32h7/stm32_ethernet.c: Fix for network lock downs
Fix for network lock downs due to not freed buffers
2020-03-03 09:33:18 -06:00
GAEHWILER Reto 85e461c59c STM32H7/STM32F30: Typos, register correction and extension
* Correction in stm32h7x3xx_rcc
* Adding GPIO_TIM2_CH1OUT_1 to stm32f30xxx_pinmap
* Comment typo fix in drivers/mmcsd/mmcsd_spi.c
2020-03-03 09:20:58 -06:00
GAEHWILER Reto 7ffb5c11a0 arch/arm/src/stm32h7/stm32_ethernet.c: Re-organization of stm32_phy_boardinitialize
PHY has to be up and running before ethreset call
2020-03-03 09:18:02 -06:00
Juha Niskanen f3490e42c3 Fix typos in comments 2020-03-03 09:11:57 -06:00
johannes-nivus a7d783d463 NXP Freedom K28F Board SD-Card support (#423)
* Adds SDHC support for NXP Freedom-K28F
2020-03-03 09:06:17 -06:00
rajeshwaribhat e671a10b2a RX65N RTC Driver added 2020-03-03 08:30:49 -06:00
Daniel Agar 30a48e4217 arm/stm32h7 add STM32H7_SPI_DMATHRESHOLD 2020-03-02 23:08:12 +01:00
Daniel Agar c10fbbbb5f stm32f76xx77xx_dma.h fix DMAMAP_SPI2_RX_2/DMAMAP_SPI2_TX_2 2020-03-02 23:08:12 +01:00
Daniel Agar 608b59792e arm/stm32f7 add STM32F7_SPI_DMATHRESHOLD 2020-03-02 23:08:12 +01:00
Daniel Agar afb2248b7a arm/stm32 add STM32_SPI_DMATHRESHOLD 2020-03-02 23:08:12 +01:00
Augusto Fraga Giachero 0be87af99d arch/arm/src/lpc17xx_40xx/lpc17_40_i2c.c: Cancel timeout on i2c stop
Not canceling the I2C timeout watch dog immediately after finishing
all I2C transactions in interrupt context can lead to a race condition
due to nxsem_wait(&priv->wait) in lpc17_40_i2c_start() not resuming
execution fast enough (this can be easily triggered if another task /
thread is using a lot of cpu time).

Falling to cancel the watchdog up to time will cause the priv->wait
semaphore to be incremented twice (first by lpc17_40_i2c_stop() then
by lpc17_40_i2c_timeout()), so all I2C transactions after that will
return immediately and priv->msgs will hold pointers to memory it
doesn't own anymore.

Canceling the priv->timeout watch dog in lpc17_40_i2c_stop() prevents
this as it is executed from the I2C interrupt handler.

arch/arm/src/lpc17xx_40xx/lpc17_40_i2c.c: Fix timeout calculation

For each byte received / transmitted, an acknowledge bit is also
transmitted / received, requiring effectively 9 bits for each byte.
2020-03-02 22:14:05 +01:00
Gregory Nutt e814977c0f boards/z80/ez80/z20x/: Add W25 bootloader
The SD boot loader was not satisfactory because 1) the SD slot is on an optional board and, hence, cannot be part of a fundamental solution.  And 2) it is too big.

The only storage on borard is the Winbond W25 SPI-bsed FLASH.  This commit adds support for a bootload to 1) read code in HEX format from a serial port and write it to the W25 FLASH, or 2) read code in binary form from the W25 FLASH into SRAM and execute the loaded program.

boards/z80/ez80/z20x/configs:  Added w25boot configuration
boards/z80/ez80/z20x/src:  Add bootloader logic, w25_main.c.  Add logic to manage shared SRAM memory map so that the loaded program does not clobber the bootloader memory.  Add logic to recover the bootloader memory into the heap after the loaded program as started.
boards/z80/ez80/z20x/scripts:  Rework scripts and configuration to support a bootloader and program build.  The boolloader cannot use all of SRAM; the program must not clobber the SRAM region used by the bootloader.
2020-03-02 14:05:09 -03:00
David Sidrane fd3148dba6
imxrt: Adds the ability to run from OCRAM (#407)
* imxrt: GPIO make tables const
* imxrt: Call out to board to set up FlexRAM
* imxrt: Add Knob for adding the ROM bootloaders 40Kib of RAM to heap
* imxrt: imxrt1060-evk:Add the ability to run from OCRAM
2020-03-01 06:05:42 -06:00
David Sidrane 4a4b2853c2
Add USB Device support for i.MX RT (#408)
* arch/arm/src/imxrt/imxrt_usbdev.c: Add USB Device support for i.MX RT (USB OTG1)

Based on the LPC43xx USB Device driver.

* imxrt:usbotg Nxstyle fixes

Co-authored-by: thomasactia <61285689+thomasactia@users.noreply.github.com>
2020-02-29 14:03:52 -08:00
Gregory Nutt 41ef33bded eZ80: Fix optimization issues
board/z80/ez80/*/scripts/Make.defs:  Fix optimization definition use in assembly flags.  It was using the compiler optimization settings instead of the assembler optimization settings.  Hence, enabling optimization would could cause assembler command line errors.

arch/z80/src/ez80/Toolchain.defs:  Back out some work arounds.  Now compiler optimization flags can again set set without assembler command line errors.

boards/z80/ez80/z20x/README.txt:  Trivial update to size/optimization discussion.
2020-02-29 12:43:28 -03:00
Joshua Lange 0ce4e15363 Improvements to STM32H7: (i,w)WDG Flash, Ethernet, ADC, etc 2020-02-29 12:33:25 -03:00
Adam Feuer cbd3e704dc formatting comments 2020-02-28 13:39:36 -06:00
Adam Feuer 6b4f9038d4 fix for SAMA5D2 serial console
authored by Takeyoshi Kikuchi <kikuchi@centurysys.co.jp>
2020-02-28 13:39:36 -06:00
Gregory Nutt 8c00e43c1a arch/z80/src/ez80: Fix eZ80F92 Interrupt Controller
The eZ80F92 interrupt controller is very different from the eZ80F91.  The eZ80F91 has:

1. Four byte interrupt vectors
2. The vector base address register is 16-bit so the vector table can lie in RAM

Whereas the eZ80F92 has:

1. Two byte interrupt vectors
2. An 8-bit vector base address

This means that the vectors must lie in the first 16-bits of FLASH and there must be a "trampoline" to get to interrupt handlers outside of the first 64-Kb of FLASH.
2020-02-28 19:45:28 +00:00
YAMAMOTO Takashi 34b17ec5cb xtensa: Fix up_schedule_sigaction
This fixes various crashes in ostest.
2020-02-28 07:48:16 -06:00
YAMAMOTO Takashi 119a38ce10 xtensa: Fix typos and comments 2020-02-28 11:33:29 +01:00
Gregory Nutt 161104c76a eZ80/z20x: Correct uninitialized stack memory
arch/z80/src/ez80/Toolchain.defs:  Correct some CFLAGS when optimization suppressed.

arch/z80/src/ez80/Kconfig arch/z80/src/ez80/ez80_emac.c:  Remove configuration option for selecting EMAC RAM address.  This is duplicated and possibly conflicting.  The correct address for the RAM is provided in the linker command file.  The RAM should be configured once and using this single definitions.

arch/z80/src/ez80/ez80_startup.asm and arch/z80/src/ez80/ez80f9*_init.asm.  Move RAM and FLAH intialization out of MCU-specific logic to common start-up logic.  We cannot call any functions until SRAM is initialized and the stack is properly initialized because the return address is stored on the stack.  Use internal SRAM for the IDLE stack to avoid the chicken'n'egg problem.

boards/z80/ez80/z20x/configs/sdboot/sdboot.zdsproj:  Discuss build environments.
2020-02-27 22:53:27 +01:00
Masayuki Ishikawa 0cb7dfde79 arch: risc-v: Fix a warning in common/up_exit.c
common/up_exit.c:198:1: warning: 'noreturn' function does return
2020-02-27 08:55:55 +01:00
Masayuki Ishikawa f6b3e79d61 arch: lc823450: Remove unused variable in lc823450_cpustart.c
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-02-27 08:55:25 +01:00
Gregory Nutt 1521037083 arch/z80/src/Makefile.zdsii*: Correct libraries for eZ80F92
These makefiles set the the ZiLOG runtime libraries for the eZ80 parts.  The setup was, however, conditioned on CONFIG_ARCH_EZ80_EZ80F91 and, so, was not working for the eZ80F92 part (CONFIG_ARCH_EZ80_EZ80F92).

With this change, the z20x board FINALLY builds and links correctly with no errors.
2020-02-26 21:08:20 +00:00
Gregory Nutt fa5179a51a arch/z80/src/ez80/ez80f92_handlers.asm: Trivial typo fix. 2020-02-26 21:08:20 +00:00
Gregory Nutt fcee2f5a53 arch/z80/src/ez80/ez80_timerisr.c: Use Kconfig MCU configurations.
Don't use MCU selection from compiler.  It appears that we must compile ez80f92 code as ez80f91 so the comiler MCU selection is incorrect.  Instead, use the selected CPU part from the configuration.
2020-02-26 21:08:20 +00:00
Gregory Nutt b63024dc7b arch/z80: Make MCU selection menus more like other archs 2020-02-26 21:08:15 +00:00
Gregory Nutt a9610e16bd boards/z80/ez80/z20x: Update CFLAGS and linker scripts.
arch/z80/src/ez80/Toolchain.defs:  Update some CFLAGS to match CFLAGS from ZDS-II IDE.  Apparently, we must say that the CPU is an eZ80F91 event when compiler for eZ80F92.
boards/z80/ez80/z20x:  Update linker scripts.
2020-02-26 21:12:01 +01:00
YAMAMOTO Takashi 930e2788cc xtensa: Use ar and nm from the toolchain
This fixes build on macOS, where native ar is incompatible.
2020-02-26 10:47:26 -06:00
Adam Feuer cdc61a08e0
arch/arm/src/sama5/sam_gmac: Prevent txtimeout from always firing and fix txbuffer leak during high-volume sends 2020-02-25 23:10:04 +01:00
YAMAMOTO Takashi 9a8169acdf armv7-m: Fix syscall stack alignment
This fixes "df -h" with PROTECTED build.  Tested on qemu.

Reference:
	aapcs32 "6.2.1 The Stack/Stack constraints at a public interface"
2020-02-25 12:05:53 -06:00
YAMAMOTO Takashi d52628979a Suppress "'noreturn' function does return" warnings
up_pthread_start and up_task_start.
2020-02-25 04:07:02 -06:00
Gregory Nutt e6f545beab Extend revised ZDS-II support to z8 and z16f
* tools/zds/zds_Config.mk: Move  boards/z80/ez80/scripts/eZ80_Config.mk to tools/zds/zds_Config.mk where it can be shared by other ZDS-II platforms.
* boards/z16/z16f:  Duplicate changes for new ZDS-II support from ez80
* boards/z80/z8:  Duplicate changes for new ZDS-II support from ez80
* arch/z16/src/z16f/Toolchain.defs:  Create required Toolchain.defs file for Z16f
2020-02-24 22:37:28 +01:00
Xiang Xiao b9b86fcc63 arch/sim: Handle tap device initializition failure gracefully 2020-02-24 08:42:03 -06:00
Xiang Xiao 96adb827a3 arch/sim: Ensure all host printf end with \r\n
Since simulator switch console to raw mode, we have to add \r manually
2020-02-24 08:41:45 -06:00
Xiang Xiao cde88cabcc Run codespell -w with the latest dictonary again
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-23 22:27:46 +01:00
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