Commit Graph

209 Commits

Author SHA1 Message Date
Gerard Marull-Paretas 02aec77f77 dts: pwm: gd,gd32-pwm: add period to PWM cells
Add the period cell to GD32 PWM compatible and update all boards
accordingly. A period of 20 ms (50 Hz) has been set for all PWM LEDs.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-04-07 09:35:22 +02:00
Shawn Nematbakhsh a8ffd19281 soc: riscv: sifive-freedom: fe310: Support custom coreclk rate in DTS.
Allow coreclk to be configured up to 320 MHz from DTS.

Signed-off-by: Shawn Nematbakhsh <shawn@rivosinc.com>
2022-04-05 12:00:03 +02:00
Shawn Nematbakhsh c74526919d soc: riscv: sifive-freedom: Get coreclk and peripheral clock from DTS.
Rather than specify input clock for each peripheral individually, instead
specify the relevant clocks in DTS.

This will enable easier support for non-default coreclk on fe310 in a
follow-up CL.

Signed-off-by: Shawn Nematbakhsh <shawn@rivosinc.com>
2022-04-05 12:00:03 +02:00
Yuichiro SAGISAKA 82ac3fa079 boards: riscv: longan_nano: Update document
Improve documentation

- Add a photo of the board
- Add hardware information from the board manual
- Fix options for build (set OPENOCD_DEFAULT_PATH to make it
  valid for also windows environment)
- Improve the build instructions to make it easier to understand

Signed-off-by: Yuichiro SAGISAKA <yu.sagisaka@fujitsu.com>
2022-03-29 12:35:30 -07:00
HaiLong Yang 140bce498b boards: add gd35q16 flash to gd32f450i_eval and gd32vf103v_eval boards
Add gd25q16 as "jedec,spi-nor" compatible flash to gd32f450i_eval and
gd32vf103v_eval boards.

Signed-off-by: HaiLong Yang <cameledyang@pm.me>
2022-03-29 10:21:15 -05:00
Ruibin Chang dbd31a6a02 ITE boards/it8xxx2_evb/dts: add voltage comparator instance
Add voltage comparator instance for driver test.

Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
2022-03-25 15:00:35 -07:00
Filip Kokosinski 38f38e0be8 boards: FE310-based boards: transition to pinctrl driver
This commit makes the transition from the pinmux driver to the pinctrl
driver. It also modifies UART, SPI and I2C drivers used in FE310-based
boards to use the new pinctrl API.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2022-03-24 10:46:34 +01:00
Filip Kokosinski a9543e0ff4 boards: qemu_riscv32: add pinctrl configuration for qemu_riscv32_xip
Add pinctrl configuration for future use with the new pinctrl driver.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2022-03-24 10:46:34 +01:00
Filip Kokosinski 99e787de21 boards: hifive1_revb: add pinctrl configuration for hifive1_revb board
Add pinctrl configuration for future use with the new pinctrl driver.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2022-03-24 10:46:34 +01:00
Filip Kokosinski 0d3ec151c8 boards: hifive1: add pinctrl configuration for hifive1 board
Add pinctrl configuration for future use with the new pinctrl driver.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2022-03-24 10:46:34 +01:00
Nicolas Pitre a50c433012 riscv: exception code mega simplification and optimization
Complete revamp of the exception entry code, including syscall handling.
Proper syscall frame exception trigger. Many correctness fixes, hacks
removal, etc. etc.

I tried to make this into several commits, but this stuff is all
inter-related and a pain to split.

The diffstat summary:

 14 files changed, 250 insertions(+), 802 deletions(-)

Binary size (before):

   text	   data	    bss	    dec	    hex	filename
   1104	      0	      0	   1104	    450	isr.S.obj
     64	      0	      0	     64	     40	userspace.S.obj

Binary size (after):

   text	   data	    bss	    dec	    hex	filename
    600	      0	      0	    600	    258	isr.S.obj
     36	      0	      0	     36	     24	userspace.S.obj

Run of samples/userspace/syscall_perf (before):

*** Booting Zephyr OS build zephyr-v3.0.0-325-g3748accae018  ***
Main Thread started; qemu_riscv32
Supervisor thread started
User thread started
Supervisor thread(0x80010048):       384 cycles	     509 instructions
User thread(0x80010140):           77312 cycles	   77437 instructions

Run of samples/userspace/syscall_perf (after):

*** Booting Zephyr OS build zephyr-v3.0.0-326-g4c877a2753b3  ***
Main Thread started; qemu_riscv32
Supervisor thread started
User thread started
Supervisor thread(0x80010048):       384 cycles	     509 instructions
User thread(0x80010138):            7040 cycles     7165 instructions

Yes, that's more than a 10x speed-up!

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2022-03-21 07:28:05 -04:00
Nazar Kazakov f483b1bc4c everywhere: fix typos
Fix a lot of typos

Signed-off-by: Nazar Kazakov <nazar.kazakov.work@gmail.com>
2022-03-18 13:24:08 -04:00
Nazar Kazakov 9713f0d47c everywhere: fix typos
Fix a lot of typos

Signed-off-by: Nazar Kazakov <nazar.kazakov.work@gmail.com>
2022-03-14 20:22:24 -04:00
YuLong Yao af06d94e00 boards: riscv: introduce gd32vf103c_starter board
add gd32vf103c_starter board.

Signed-off-by: YuLong Yao <feilongphone@gmail.com>
2022-03-08 11:10:30 +01:00
Gerard Marull-Paretas 260deccb6e doc: use :kconfig:option: domain role
Kconfig options now belong to the Kconfig domain, therefore, the
:kconfig:option: role needs to be used.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-02 09:28:37 +01:00
Ederson de Souza 6babbd32e1 boards/riscv: Add qemu_riscv32_smp and qemu_riscv64_smp
Based on qemu_riscv32 and qemu_riscv64, add minimal SMP support
using the "virt" machine.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-02-25 19:13:50 -05:00
Fu Haolei 2d58806161 twister: for twister can run tests on ITE board.
Set board flasher, so twister can run tests on ITE(it8xxx2_evb) board.
Add supported drivers of it8xxx2_evb board, so twister could run these
driver tests without skipping.

Signed-off-by: Fu Haolei <haolei.fu@intel.com>
2022-02-25 10:07:19 -08:00
Katsuhiro Suzuki feaf0070fc boards: riscv: hifive_unleashed: add GPIO support
This patch adds GPIO and 96board LS (Low Speed)iexpansion  connector
support for SiFive HiFive Unleashed and also enables GPIO basic test.

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
2022-02-21 20:46:47 -05:00
Ruibin Chang 5f3bba54e8 ITE drivers/pwm: support tests/drivers/pwm/pwm_api
Add pwm-0 to support tests/drivers/pwm/pwm_api.

Solve tests code runtime error on it8xxx2_evb:
1.If the pwm channel target frequency is < 1, then we will
  return an error code.

2.If the target_freq is <= 324Hz, we will configure that this pwm
  channel need to output in EC power saving mode.
  In test_pwm_cycle() case, the period is 64000, then the
  target_freq is 8000000 / 64000 = 125Hz and <= 324Hz, so we will
  switch the prescaler clock source from 8MHz to 32.768kHz.
  Then the target_freq is 32768 / 64000 = 0.512Hz and < 1Hz,
  this will return an error code. In order to get the same
  target_freq, we always return PWM_FREQ in
  pwm_it8xxx2_get_cycles_per_sec().

Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
2022-02-21 20:44:41 -05:00
BJ Chen 59cd9fd551 ITE: drivers/peci: Add PECI driver module of ITE IT8xxx2
Added the PECI driver tested with the samples/drivers/peci.

Signed-off-by: BJ Chen <bj.chen@ite.com.tw>
2022-02-21 19:43:40 -05:00
Yuriy Vynnychek dfd82a025c boards: riscv: tlsr9518adk80d: doc: improved Build and Flash info
Updated Build and Flash chapters with new information.

Signed-off-by: Yuriy Vynnychek <yura.vynnychek@telink-semi.com>
2022-02-21 19:41:44 -05:00
Yuriy Vynnychek 851599080d boards: riscv: tlsr9518adk80d: doc: improved Build and Flash info
Updated Build and Flash chapters with new information.

Signed-off-by: Yuriy Vynnychek <yura.vynnychek@telink-semi.com>
2022-02-21 19:41:44 -05:00
Gerard Marull-Paretas a9f7891c14 boards: riscv: rv32m1_vega: remove redundant Kconfig comment
The defconfig files are just used to change defaults, not to define any
new Kconfig nodes.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-21 19:35:21 -05:00
TOKITA Hiroshi 45995212ab boards: riscv: longan_nano: Add BOARD definition
Define missing definition BOARD_LONGAN_NANO to defconfig.
And cleaning up some verbose comments.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2022-01-31 14:23:45 -06:00
Sylvio Alves f1e26219d0 soc: esp32c3: prepare kconfigs and cmake to support mcuboot
This modifies esp32c3 SOC configuration to support MCUBoot.

CmakeLists is moved from board to soc specific. It also
includes MCUBoot changes.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-01-22 16:55:00 -05:00
Sylvio Alves 8ee785c54e boards: esp32c3_devkitm: update device tree to add new partitions
This adds mcuboot slot0, slot1 and scratch partition

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-01-22 16:55:00 -05:00
Jim Shu 03d1e9b52a boards: riscv: qemu_riscv64: Enable RISC-V PMP
Enable PMP and Userspace on RV64 QEMU to improve CI coverage

Signed-off-by: Jim Shu <cwshu09@gmail.com>
2022-01-18 13:11:36 -05:00
Ruibin Chang 1a11a3362e ITE drivers/watchdog: support tests/drivers/watchdog/wdt_basic_api
Add watchdog0 to support tests/drivers/watchdog/wdt_basic_api.

Solve tests code runtime error on it8xxx2_evb:

1.When run the wdt tests api, we shouldn't reduce the warning
timer time, so I add config WDT_ITE_REDUCE_WARNING_LEADING_TIME,
this config will be enabled only on platform EC.

2.Upper limit window timeouts can't be 0 when we install timeout.

3.Since we support wdt_it8xxx2_disable(), then we should support
flag WDT_OPT_PAUSE_HALTED_BY_DBG, too. Watchdog can be stopped
by IT8XXX2_WDT_EWDSCEN bit of ETWCTRL reg.

Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
2022-01-18 12:14:26 -05:00
Ruibin Chang 336d0f67b3 ITE drivers/kscan: support tests/driver/kscan/kscan_api
Add kscan0 to support tests/driver/kscan/kscan_api.

When running the tests code on it8xxx2_evb, it shows fatal
error: IRQ is enabled. We find that once polling_task() is
created and executed, the KSI interrupt will be enabled and
before we call irq_connect_dynamic(), so we switch both
function sequence.

Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
2022-01-17 11:44:05 -05:00
TOKITA Hiroshi c72b75fc45 boards: riscv: longan_nano: Add LED and button configuration
Add configuration to support onboard LED and button.

- LED_R: PC13 (active low/output)
- LED_G: PA1  (active low/output)
- LED_B: PA2  (active low/output)
- BOOT0: PA8  (active high/input)

And enable timer1 to control LED_G and LED_B with PWM.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2022-01-14 09:59:35 -06:00
Tim Lin 96203820db boards: it8xxx2_evb: add aliases of i2c0
Add the aliases, we are able to build test of
tests/drivers/i2c/i2c_api for the it8xxx2_evb board.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2022-01-11 11:51:04 +01:00
Gerard Marull-Paretas a4790bcfab boards: riscv: gd32vf103v_eval: initial support
Add initial support for the GD32VF103V-EVAL board. The board is based on
the GD32VF103 RISC-V MCU.

This board can run on Zephyr now largerly thanks to the initial work
done by @soburi.

Note that this board requires using the riscv-openocd fork, however,
programming is slow when using OpenOCD even though it works (including
debugging). J-Link option has also been enabled as it seems to be more
realiable and works _out of the box_. Some details are given in the
board documentation file.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-01-11 11:50:35 +01:00
Jim Shu 74faa18902 soc: riscv: virt: enable RISC-V PMP support
Enable CONFIG_RISCV_PMP in qemu virt soc. Use this SoC as CI testing
platform of RISC-V PMP and Userspace.

Signed-off-by: Jim Shu <cwshu@andestech.com>
2022-01-11 11:47:03 +01:00
Dino Li 22d2bc9567 boards: it8xxx2_evb: enable LED0
With this change, we are able to build test of
tests/drivers/gpio/gpio_api_1pin for the board.

Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
2022-01-05 14:58:22 -05:00
TOKITA Hiroshi a1fa5bba25 boards: riscv: longan_nano: Add DAC configuration
Add configuration to support DAC

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2022-01-04 11:49:14 +01:00
TOKITA Hiroshi 7e80c74f95 drivers: serial: Add USART support for GD32V
Modifying configuration to enable with gd32vf103

- Add usart definition to devicetree.
- Define USART_STAT as alias of USART_STAT0 if not defined it.
- Enable USART if SOC_SERIES_RISCV_GIGADEVICE_GD32VF103.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2021-12-20 17:51:30 +01:00
TOKITA Hiroshi c21bc77169 boards: riscv: Add SiPeed Longan Nano platform
SiPeed Longan Nano is a minimal development board
based on GigaDevice's RISC-V processor.
There are 2 board variations.

longan_nano:      GDGD32VF103CBT6 (128K Flash/32K SRAM)
longan_nano_lite: GDGD32VF103C8T6 ( 64K Flash/20K SRAM)

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2021-12-20 17:51:30 +01:00
Glauber Maroto Ferreira dd04a328cf soc: riscv: esp32c3: dts: uart node refactoring
Not all boards use the same UART's defaults properties.

This commit updates device tree declarations by deferring
specific definitions to the board's DTS.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2021-12-09 19:57:10 -05:00
Alex Kolosov f374d6b1f1 scripts: runners: Add west flash command for B91 platform
This commit implements west flash command for Telink B91 platform.
west flash command uses ICEman and SPI burn from AndeSight for flashing.

Signed-off-by: Alex Kolosov <rikorsev@gmail.com>
2021-12-06 07:28:38 -05:00
Ruibin Chang fad78a2c07 ITE drivers/sensor: add tachometer driver for it8xxx2_evb
Add tachometer driver for it8xxx2_evb.

Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
2021-11-29 08:25:19 -05:00
Ruibin Chang b0cbff901f ITE borads/riscv/it8xxx2_evb: delete pwmleds node in dts
Delete pwmleds node in dts, because there isn't led on evb board.

Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
2021-11-19 10:24:11 -06:00
Tim Lin e29a15c0e3 ITE: drivers/serial: add the UART driver for the PM callback function
IT8XXX2 uses shared ns16550.c driver which does not provide a power
management callback(pm_action_cb), so create driver to handle
IT8XXX2 specific UART features.

note: pm_action_cb(old name: pm_control_fn)

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2021-11-16 21:23:42 -05:00
Filip Kokosinski 0851255258 boards: riscv: hifive1: add support for QEMU and Renode simulation
This commit adds required config files for Renode simulation and adds
missing QEMU_binary_suffix. It also adds flash and newlib tags to
ignore_tags, as flash chip is currently not provided by default in
Renode for FE310 and newlib does not fit into the available memory.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2021-11-12 21:33:42 -05:00
Filip Kokosinski 94428044e2 cmake: support multiple entries in board.cmake
Currently there is no way to support running a board on multiple
emulation platforms nor to choose a desired emulation platform for the
simulation to be run on. This commit introduces a new
SUPPORTED_EMU_PLATFORMS list, which defines available emulation
platforms for a given board.

Fixes #12375.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2021-11-12 21:33:42 -05:00
Ruibin Chang e501c4a21a ITE boards/it8xxx2_evb: remove CONFIG_* not for every application
These drivers are no longer enabled for every application,
even hello_world. The right SoC-specific drivers are
enabled in applications that need them.

Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
2021-11-12 10:25:47 -06:00
Ruibin Chang 4393f66ba2 ITE soc/riscv-ite/it8xxx2: move config to soc from board
Make config conditional and move to soc Kconfig.defconfig.series
from it8xxx2_evb_defconfig.

Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
2021-11-12 10:25:47 -06:00
Felipe Neves b50cb2a537 drivers: counter: esp32: add support for esp32c3
to the unified esp32 counter driver.

Signed-off-by: Felipe Neves <felipe.neves@espressif.com>
2021-11-11 19:14:15 -05:00
Felipe Neves 857a188c76 drivers: watchdog: esp32: enabled esp32c3
support for the unified esp32 wdt driver.

Signed-off-by: Felipe Neves <felipe.neves@espressif.com>
2021-11-08 10:56:28 -05:00
Sylvio Alves ab91612a6d driver: esp32: I2C code refactoring
Use i2c_hal functions to enable support for
multiple SoCs.

Use DT compat to enable I2C from device
tree configuration

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2021-11-05 14:07:09 -04:00
Henrik Brix Andersen 6cc536daa8 boards: riscv: neorv32: minor documentation improvements
Add a few minor improvements to the NEORV32 board documentation based on
community feedback.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2021-11-05 12:18:30 -05:00