Commit graph

245 commits

Author SHA1 Message Date
Lucas Tamborrino 9421785fd0 dts: esp32c3: add bindings to GDMA
Add GDMA node to esp32c3.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2023-01-12 19:09:01 +01:00
Ruibin Chang 50274718e2 ITE dts/riscv/ite: separate dtsi node to it81xx2 from it8xxx2
The interrupt and watchdog registers of the it82xx2 will be
remapped, so these device nodes should be separated to
it81xx2 from it8xxx2. it8xxx2 dtsi are common settings
for it81xx2 and it82xx2.

Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
2023-01-11 09:42:11 +01:00
Michał Barnaś 0918442ba6 ec_host_cmd: add ITE SHI peripheral for the host commands
This commit adds the support for host commands being transported
by the Serial Host Interface on the IT8xxx2 SoC.

Signed-off-by: Michał Barnaś <mb@semihalf.com>
2023-01-11 09:38:45 +01:00
Tim Lin 31791f87e4 ITE: dts: it8xxx2: Separate device nodes from it8xxx2.dtsi
The GCR, PINCTRL, I2C and WUC registers of the it82xx2 will be remapped,
so these device nodes will not be in the it8xxx2.dtsi, these should be
separated to create a it81xx2.dtsi.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2023-01-09 10:14:21 +01:00
Sylvio Alves b58394bbbd sensor: esp32c3: fix coretemp DTS register address
Remove 0x prefix to avoid build warning.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-12-24 16:58:38 +01:00
Marek Matej 937ea00e7a drivers: adc: esp32: Add support for single-shot conversion
Allow single-shot adc conversion on all supported targets.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2022-12-23 23:45:05 +00:00
TOKITA Hiroshi 498ef65242 dts: bindings: gd32-dma-base: add gd,mem2mem property
Add `gd,mem2mem` property to indicate the DMA controller supports
memory to memory transfer.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2022-12-22 13:43:49 +01:00
TOKITA Hiroshi 59044c6d63 dts: bindings: gd32-dma: add config cell property
Add config cell property to gd,gd32-dma.
For supporting hardware variation, Splitting base definition
to gd,gd32-dma-base.yaml.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2022-12-22 13:43:49 +01:00
Marek Matej 45d55205db drivers: esp32: temp: CPU die temperature sensor
Support for the measuring the CPU die temperature
for the ESP32 targets S2,C3. The ESP32 support
was ommited due to lack of offset calibration.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2022-12-15 18:21:39 +01:00
TOKITA Hiroshi 33900ab99e dts: riscv: gd32vf103: Correct wrong clock configuration for dma1
The `dma1` node had used GD32_CLOCK_DMA0.
Correct it to GD32_CLOCK_DMA1.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2022-12-12 15:15:40 +00:00
Tim Lin ad2dc064a7 ITE: soc: it81xx2: Add new variant of it81xx2cx related configuration
Add new variant configuration of it81202cx and it81302cx.
This cx variant of it81xx2 changes are as follows:
1. SRAM size will increase from 60k to 128k.
2. Configurable ILM size is still 60k.
3. Support M extension of RISC-V.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2022-12-02 11:29:00 +01:00
Peter Marheine d4549ed808 it8xxx2: generalize ILM support
Executing code out of RAM on IT8xxx2 requires that the relevant
addresses be mapped onto the CPU's instruction memory bus, referred to
by ITE documentation as Instruction Local Memory (ILM). ILM mappings
configure blocks of RAM to be used for accesses to chosen addresses when
performing instruction fetch, instead of the memory that would normally
be accessed at that address.

ILM must be used for some chip features (particularly Flash
self-programming, to execute from RAM while writing to Flash), and has
historically been configured in the Flash driver. The RAM for that was
hard-coded as a single 4k block in the linker script.  Configuring ILM
in the flash driver is confusing because it is used by other SoC code as
well, currently in code that cannot depend on the Flash being functional
or in hand-selected functions that seem performance-critical.

This change moves ILM configuration to a new driver and dynamically
allocates RAM to ILM in the linker script, allowing software use of the
entire 64k RAM depending on configuration.  This makes ILM configuration
more discoverable and makes it much easier to correctly support the
CODE_DATA_RELOCATION feature on this SoC.

Signed-off-by: Peter Marheine <pmarheine@chromium.org>
2022-10-21 20:31:47 +02:00
Martin Jäger 00717da689 dts: riscv: espressif: esp32c3: add TWAI node
Add nodes to enable the TWAI (CAN bus) peripheral.

Signed-off-by: Martin Jäger <martin@libre.solar>
2022-10-14 09:55:09 +02:00
Lucas Tamborrino a29ebef6ce drivers: spi: esp32c3: add DMA support
Add SPI DMA support for esp32c3.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2022-10-04 10:35:14 +02:00
TOKITA Hiroshi 2472fee5cc dts: Add watchdog configuration for GD32 SoCs
Add watchdog node for GD32 series SoC's dts files.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2022-10-03 18:07:16 +02:00
Tim Lin 3474ba919f ITE: drivers/i2c: FIFO2 can be selected to support channel of B or C
FIFO2 can be selected to support channel of B or C by dtsi.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2022-09-22 14:58:42 +00:00
HaiLong Yang cc9a51a39f dts: add gd32 fmc flash memory info
There are three types GD32 FMC.

GD32 FMC v1: its flash memory has 1 bank, page size is equal in the
bank, flash size is smaller than 512KB.

GD32 FMC v2: its flash memory has 2 banks. Page size equal within the
same bank but different between banks. Flash size can be up to 3072KB.
FMC v2 has two registers to control bank0 and bank1 separately.

GD32 FMC v3: its flash memory has 2 banks, use sector size as the
minimum operating unit, the sector size is not equal.

Signed-off-by: HaiLong Yang <hailong.yang@brainco.cn>
2022-09-08 10:13:05 +02:00
Kevin Wang 93025635b3 dts: bindings: spi: add andes spi driver
Add Andes SPI atcspi200 dts binding.
Remove not necessary property for spi node in soc dtsi.

Signed-off-by: Kevin Wang <yunkai@andestech.com>
2022-09-07 15:34:47 +02:00
Gerard Marull-Paretas 64eb350e5e drivers: spi: gd32: use clock control API
Use the clock control API to enable/get rate of SPI clocks.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-09-06 09:57:25 +02:00
Gerard Marull-Paretas 0aadc2dd44 drivers: serial: gd32: use clock control API
Use the clock control API to enable the UART clock.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-09-06 09:57:25 +02:00
Gerard Marull-Paretas 22e64fddfd drivers: pwm: gd32: use clock control API
Use the clock control API to enable/get rate of timer clocks.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-09-06 09:57:25 +02:00
Gerard Marull-Paretas 4fcc1dae0d drivers: i2c: gd32: use clock control API
Use the clock control API to enable/get rate of I2C clock.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-09-06 09:57:25 +02:00
Gerard Marull-Paretas 455b95b6c2 drivers: gpio,pinctrl: gd32: use clock control API
Use the clock control API to enable peripheral clocks. Note that both
GPIO and pinctrl drivers are updated at once since they share some IP
blocks.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-09-06 09:57:25 +02:00
Gerard Marull-Paretas 8d100f4f98 drivers: dma: gd32: use clock control API
Use the clock control API to enable DMA clock.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-09-06 09:57:25 +02:00
Gerard Marull-Paretas 8693a0b63f drivers: dac: gd32: use clock control API
Use the clock control API to enable peripheral clock.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-09-06 09:57:25 +02:00
Gerard Marull-Paretas 86654dbeae drivers: adc: gd32: use clock control API
Use the clock control API to turn on ADC clocks. Note that clock
selection is not yet implemented, so we still rely on custom rcu
properties for that.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-09-06 09:57:25 +02:00
Gerard Marull-Paretas 4aa31b4526 drivers: clock_control: gd32: initial support
This patch adds a clock control driver for GD32 platforms. It is
important to note that the driver is only able to handle peripheral
clocks, but not "system clocks" (e.g. PLL settings, SYS_CK, etc.).  On
some similar platforms (STM32) this task is embedded in the same clock
driver, performed at init time but with no options to do any
manipulation at runtime via the API calls. The clock control API as-is
is really orthogonal to "system clocks", and it is arguably a bad idea
to embed system clock init code in a clock control driver. It can be
done at SoC level still using Devicetree as a source of hardware
description/initial configuration.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-09-06 09:57:25 +02:00
Gerard Marull-Paretas 30f50e5171 dts: gigadevice: gd32vf103: add missing i2c0 reset entry
i2c0 did not have the resets property set, required by the binding.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-09-05 09:36:04 +00:00
Gerard Marull-Paretas d55bc1f7ba drivers: spi: gd32: use reset API
Use the reset API to reset the peripheral state before initialization.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-08-29 10:30:49 +02:00
Gerard Marull-Paretas 0337905c7a drivers: serial: gd32: use reset API
Use the reset API to reset the peripheral state before initialization.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-08-29 10:30:49 +02:00
Gerard Marull-Paretas 2c740b4392 drivers: pwm: gd32: use reset API
Use the reset API to reset the peripheral state before initialization.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-08-29 10:30:49 +02:00
Gerard Marull-Paretas 5aa5af8ec2 drivers: gpio: gd32: use reset API
Use the reset API to restore the peripheral to its initial state before
configuring it.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-08-29 10:30:49 +02:00
Gerard Marull-Paretas e779767b25 drivers: dac: gd32: use reset API
Use the reset API to reset the peripheral state before initialization.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-08-29 10:30:49 +02:00
Gerard Marull-Paretas 6894a6c7ed drivers: adc: gd32: use reset API
Use the reset API to reset the peripheral state before initialization.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-08-29 10:30:49 +02:00
Gerard Marull-Paretas 28b59890a6 drivers: reset: gd32: add initial support
Add a new reset driver for GD32 platforms. This driver controls the
reset registers from the RCU peripheral. It can be used to restore
peripherals to their initial state when initializing a device.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-08-29 10:30:49 +02:00
Jimmy Zheng b24c3b9fe9 dts: riscv: andes_v5_ae350.dtsi: add PIT prescaler property
Add prescaler property to prevent counter driver imprecise when CPU clock
is close to the PIT clock.

Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
2022-08-26 11:55:36 +02:00
Sylvio Alves 7e9e3116e4 dtsi: esp32c3: add missing wifi node
Add ESP32C3 wifi entry in dtsi file.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-08-25 21:12:08 +00:00
Gerard Marull-Paretas a5e301e06f dts: gigadevice: remove deprecated device_type property
According to DT spec, device_type property is deprecated (ref. 0.3 spec,
2.3.11):

> The device_type property was used in IEEE 1275 to describe the device’s
FCode programming model. Because DTSpec does not have FCode, new use
of the property is deprecated, and it should be included only on cpu and
memory nodes for compatibility with IEEE 1275–derived devicetrees.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-08-25 09:09:51 +00:00
Gerard Marull-Paretas 61889de3d1 dts: gigadevice: always use DT_FREQ_M
Use the DT_FREQ_M helper to improve readability on clock frequencies.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-08-25 09:09:51 +00:00
Gerard Marull-Paretas 7442d86ab1 dts: gigadevice: simplify flash/sram size assignments
Make use of nodelabels to extend flash/sram nodes instead of re-defining
the whole tree. This pattern is already used in some other files.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-08-25 09:09:51 +00:00
Gerard Marull-Paretas 4bd872e875 dts: gigadevice: gd32vf103: remove redundant riscv compatible
The compatible has no known meaning, so remove it.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-08-25 09:09:51 +00:00
Gerard Marull-Paretas a40c4c74da dts: gigadevice: gd32vf103: remove redundant soc compatible
The gd,gd32vf103-soc compatible is redundant, drop it.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-08-25 09:09:51 +00:00
Gerard Marull-Paretas e7b9c8c955 dts: gigadevice: gd32vf103: move interrupt-parent to soc node
There's no need to specify the interrupt parent on each node, it can be
defined at soc level node instead (same as in ARM parts with NVIC).

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-08-25 09:09:51 +00:00
Tim Lin cb041d062f ITE: drivers/i2c: Add I2C FIFO mode
Adding I2C FIFO mode can reduce the time between each byte to
improve the I2C bus clock stretching during I2C transaction.
The I2C master supports two 32-bytes FIFOs, channel A and C
are supported now.

I2C FIFO mode of it8xxx2 can support I2C APIs including:
i2c_write(), i2c_read(), i2c_burst_read.

Test:
1. tests\drivers\i2c\i2c_api --> pass
2. Reading 16 bytes of data through i2c_burst_read() can reduce
   0.52ms(2.4ms->1.88ms) compared to the original pio mode when the
   frequency is 100KHz.
3. It is normal to read sensor data through I2C on Nereid's platform.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2022-08-23 10:16:36 +02:00
Wei-Tai Lee a718583b46 dts: riscv: andes: andes_v5_ae350: replaced smu with syscon
Use syscon to replace smu.

Signed-off-by: Wei-Tai Lee <wtlee@andestech.com>
2022-08-23 10:15:50 +02:00
Kumar Gala 89f356a0ff peci: ite_it8xxx2: Rename compatiable to match other compatiables
All the of the ITE it8xxx2 devicetree compatiables are of the form
ite,it8xxx2-<DEV>.  However the PECI device was ite,peci-it8xxx2,
rename the compatiable to match the pattern used everywhere else.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-12 14:16:59 +01:00
Kevin Wang d97dcd3e09 dts: riscv: andes: andes_v5_ae350: added CPU number to 8 hart
Add cpu node for supporting 8 cores.

Signed-off-by: Kevin Wang <yunkai@andestech.com>
2022-08-03 05:00:14 +01:00
Gerard Marull-Paretas 5a44f2e33f include: add missing zephyr/ prefixes
Some files were missed during the migration. This patch adds the prefix
where missing.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-02 18:03:58 +01:00
TOKITA Hiroshi 49ef9f9e20 dts: arm: gigadevice: Add DMA configuration
Add DMA support for GD32 series.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2022-08-02 09:13:21 +02:00
Gerard Marull-Paretas 00f51eff4e dts: riscv: andes: define machine timer
Define machine timer in Devicetree.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-02 09:12:31 +02:00