Commit graph

65 commits

Author SHA1 Message Date
Ryan McClelland 83c298cd32 drivers: spi: dw: define max-xfer-size
The max size was determined by looking at the ARCH of the cpu. This really
comes from the ip configuration when generated. Add `max-xfer-size`
property to the devicetree.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-01-20 13:11:42 +01:00
Ryan McClelland 330dba0861 drivers: spi: dw: fix naming convention of aux-reg
aux-reg should be defined with a hyphen in the bindings

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-01-20 13:11:42 +01:00
Daniel Leung 9f9b4a8afa uart: ns16550: use io-mapped DT property for IO port access
The old CONFIG_UART_NS16550_ACCESS_IOPORT has been used to
indicate whether to access the NS16550 UART via IO port
before device tree is used to describe hardware. Now we have
device tree, and we can specify whether a particular UART
needs to be accessed via IO port using property io-mapped.
Therefore, CONFIG_UART_NS16550_ACCESS_IOPORT is no longer
needed (and thus also CONFIG_UART_NS16550_SIMULT_ACCESS).
Remove these two kconfigs and modify code to use device tree
to figure out how to access the UART hardware.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-09-26 12:03:04 +02:00
Siyuan Cheng 4babd545cc drivers: pinctrl: add pinctrl driver for ARC emsdp
Add Synopsys ARC EMSDP board Pin controller for its Pmod
and Arduino shield interface.

Signed-off-by: Siyuan Cheng <siyuanc@synopsys.com>
2023-05-29 09:21:07 -04:00
Siyuan Cheng cbdd2f38da drivers: spi: add Data Fusion Subsystem SPI driver
Introduce DesignWare ARC Data Fusion IP Subsystem(DFSS) SPI
driver for ARC boards, i.e. EMSDP, which uses DW SPI to controll
SPI-Flash and DFSS SPI to connect external devices. Both drivers
share most source code, but DFSS uses ARC auxiliary registers.
Move FIFO depth setting to device tree.

Signed-off-by: Siyuan Cheng <siyuanc@synopsys.com>
2023-05-22 15:25:19 +02:00
Nikolay Agishev 0d8292ab6b ARC: Add HS4x support
Minimal HSDK4xD support

Signed-off-by: Nikolay Agishev <agishev@synopsys.com>
2023-05-02 16:54:24 +02:00
Siyuan Cheng f9d155b7d5 dts: boards :emsdp: add SPI support
There is a spi-flash fl256s on emsdp board, which can be
contolled by DesignWare SPI driver. Now add DW SPI and
SPI-FLASH support for emsdp board.

Signed-off-by: Siyuan Cheng <siyuanc@synopsys.com>
2023-03-10 11:39:24 +01:00
Gerard Marull-Paretas b2a1eeb6ac soc: arc: define ICI in DT
ICI (Inter-Core Interrupt Unit) interrupts and priorities were hardcoded
in C files. This patch moves this information to Devicetree and updates
code to make use of it.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-03 07:46:14 -04:00
Gerard Marull-Paretas 754c022fa2 soc: arc: snps_arc_iot: define sysconf in DT
sysconf base address was hardcoded in <soc.h>. Create a new compatible
and define it in Devicetree, where hardware needs to be described.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-03 07:46:14 -04:00
Gerard Marull-Paretas 5f40a9f40f soc: arc: synopsys: move secure timer0 definition to DT
Use Devicetree to describe secure timer0 instead of hardcoding values in
<soc.h>.

DT files have been structured to match the following requirements: In
case of sectimer0 - it's should be only enabled for:

- emsdp_em7d_esp.dts
- em_starterkit_em7d.dts
- nsim_sem_mpu_stack_guard.dts
- nsim_sem.dts

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-03 07:46:14 -04:00
Gerard Marull-Paretas 44250fe3d3 soc: arch: synopsys: move timer0/1 IRQ information to DT
timer0/1 IRQ information was hardcoded in soc.h, however, Devicetree is
nowadays a better place to describe hardware. Note that I have followed
existing upstream Linux code to do these changes.

Ref.
- https://elixir.bootlin.com/linux/latest/source/arch/arc/boot/dts/
  hsdk.dts
- https://elixir.bootlin.com/linux/latest/source/Documentation/
  devicetree/bindings/timer/snps,arc-timer.txt

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-03 07:46:14 -04:00
Gerard Marull-Paretas 247d5acdf9 dts: arc: synopsys: move intc out of cpus node
interrupt controller is not a CPU, move it to the root node.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-03 07:46:14 -04:00
Kumar Gala b2f10ce0d0 dts: arc: Remove label property from devicetrees
Label properties are not required.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-20 09:23:45 -05:00
Kumar Gala 762eadc15d drivers: gpio: dw: rework init to use DT_INST_FOREACH_STATUS_OKAY
Use DT_INST_FOREACH_STATUS_OKAY to reduce duplicated code for each
instance.

We make interrupts optional since they aren't always available.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-14 10:31:42 +02:00
Gerard Marull-Paretas 4c8a8149de dts: add reg-shift property to all ns16550 devices
The ns16550 flags reg-shift property as optional. In case it is not
supplied, the ns16550 driver relies on a value defined in <soc.h>, or,
by default it takes 4 (shift by 2).

This patch adds the property to all ns16550 nodes, with the following
values:

- 2 if SoC did not have any custom value defined by
  UART_REG_ADDR_INTERVAL (corresponds to 1 << 2 = 4)
- If SoC defined DEFAULT_REG_INTERVAL (snps_arc_iot/it8xxx2), use such
  value (4=2, 2=1, 1=0).

These changes will allow simplifying the ns16550 driver.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-06-15 16:59:02 -05:00
Evgeniy Paltsev f81b3e03ac ARC: boards: HSDK: ged rid of pinmux usage
Pinmux is deprecated (see #39740) so let's get rid of
it's usage for HSDK board.

As we call pinmux only once at init phase we simply do
register setup in platform code instead of pinmux.

Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2022-05-18 17:20:26 +02:00
Maureen Helm de514bb7d0 dts: arc: synopsys: Move SoC devicetree includes under a vendor dir
Cleans up SoC devicetree include file locations to follow the convention
of dts/<arch>/<vendor>/

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-05-09 17:54:48 -04:00
Gerard Marull-Paretas 0d85931315 dts: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all dts code to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to zephyrproject-rtos#45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 19:54:54 +02: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
Watson Zeng 79f5be006e boards: arc: hsdk: add creg_gpio driver support
Add creg_gpio driver support for hsdk board.

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2021-07-13 09:42:59 -04:00
Watson Zeng a6cc3f1838 dts: designware-gpio: remove reduplicative property bits
bits property indicates the number of in-use slots of available slots
for GPIOS. We have a similar property ngpios in gpio-controller.yaml,
we will use ngpios to calculate port_pin_mask. Let's remove bits and
only use ngpios.

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2021-06-28 13:53:57 -05:00
Kumar Gala 4276d7d247 pinmux: hsdk: Convert ARC HSDK pinmux to be devicetree based
Add a simple pinctrl node for the CREG GPIO MUX register to be used
by the pinmux driver.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-15 08:29:56 -05:00
Kumar Gala 38cd37f726 dts: remove incorrect use of mmio-sram compatible
For memory that is truly device_type = "memory" we should not have a
mmio-sram compatible.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-07-28 07:31:01 -05:00
Kumar Gala 6f53c0a809 dts: arc: emsdp: Cleanup PSRAM use of device_type = "memory"
Remove the device_type = "memory" property from the PSRAM node.  We make
the slightly arbitrary distinction of using 'mmio-sram' compatible for
memories that don't need some kinda of dram style configuration or may
be on die.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-07-24 12:06:48 +02:00
Kumar Gala 77a56fd725 dts: remove incorrect use of device_type property
For true mmio-sram, arc,iccm, arc,dccm nodes we should not be setting
device_type = "memory".  This should be used for true DRAM regions of
memory and not on SoC SRAMs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-07-23 06:37:41 -05:00
Wayne Ren 21e9ee75d9 board: iotdk: disable unused peripherals in dts
By defaut, only one uart is used as console.
Disable unused peripherals in dts to avoid
conflicts (issue #23475), save memory footprint,
and reduce the boot time.

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2020-04-28 11:53:46 -05:00
Kumar Gala 6f51ef8a4c boards: em_starterkit: cleanup dts warnings
Fix the following device tree warnings:

unit-address and first reg (0x20000) don't match for iccm@0
unit-address and first reg (0x80010000) don't match for dccm@80000000

Since the em_starterkit_em7d_normal has a different base address for
iccm & dccm, and most of the em_starterkit variants have different sizes
for iccm & dccm.  Just define the nodes in the specific
em_starterkit*.dts file and remove them from emsk.dtsi.  This removes
the issue reported in the warning.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 17:10:54 -05:00
Evgeniy Didin 8922afb0f8 arc: hsdk: Set SRAM_BASE_ADDRESS in defconfig
On power-on boot-ROM is mapped to address 0 in HSDK board.
Normally later when U-Boot gets started by boot-ROM we change mappings
so that real DDR is mapped to entire address space including 0:
https://elixir.bootlin.com/u-boot/latest/source/board/synopsys/hsdk/hsdk.c#L474

But if U-Boot is not started (which is controlled by the BIM dip-switch
on the board) boot-ROM remains mapped to 0, and essentially any attempt
to write to that location fails, thus we cannot upload contents of our
target Elf there even with JTAG.

The next logical option is to use beginning of the non-translated
memory region 0x8000_0000 which we typically use for loading
U-Boot & Linux kernel on ARC boards. But in case of HSDK
we have DCCM (Data Closely-Coupled MEmory - fast on-chip SRAM)
mapped there and since we cannot execute code from DCCM
we need to skip that region as well which gives us the next option
being 0x9000_0000 . That's because DCCM owns entire 256 MiB "aperture"
even though it may have much smaller size up-to 8 MiB.

We are mapping only 5 apertures because the last two
(0xe000_0000-0xffff_ffff) are used for peripherals and AXI.

Signed-off-by: Evgeniy Didin <didin@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2019-12-09 16:37:12 -05:00
Kumar Gala 89f92ab0f8 arc: Remove bogus references to intel,qmsi-ss-{gpio,i2c}
The arc_iot.dtsi used "intel,qmsi-ss-gpio" and "intel,qmsi-ss-i2c"
compatiables, however we have no drivers for these and it seems wrong
that the ARC platform would utilize such compatiables.  Remove the
compatiable fields for now (proper one's can be added when there are I2C
and GPIO drivers for this platform).

Also remove the binding files associated with "intel,qmsi-ss-gpio" and
"intel,qmsi-ss-i2c" as nothing in tree utilizes them.

Fixes: 19227

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-09-18 22:32:01 -04:00
Watson Zeng 9d50f9b5a7 arc: hsdk: dts: bug fix
bug fix in arc_hsdk.dtsi

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2019-09-17 20:40:38 +08:00
Wayne Ren dbc29fe77e boards: hsdk: add initial support of ARC HS Development Kit
This commit includes the initial support of ARC HS Development Kit:
* hsdk soc support
* hsdk board support
* no mmu support, so no userspace
* smp support

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-08-10 20:11:29 +02:00
Watson Zeng 80ca3e064e board: emsdp: doc update and bug fixes
- update doc for different core configuration.

- fix some bugs in dts related files.

- add dts config and defconfig for different core configuration.

- end files with a newline in boards/arc/emsdp/board.dtsi

- remove unused head in boards/arc/emsdp/doc/index.rst

- ARC_MPU_VER in different core is fixed. so remove some useless code
  for ARC_MPU_VER judgements in Kconfig.defconfig.* files for emsdp

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2019-08-08 11:48:39 +02:00
Watson Zeng bcba284e8f boards: arc: emsdp: add basic emsdp board support
* add basic emsdp board support

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2019-08-08 11:48:39 +02:00
Kumar Gala a5ae0daa35 dts: arc: Remove device_type = "memory" from {d,i}ccm nodes
The "{d,i}ccm" nodes should not have had a 'device_type' property.
Remove it from the cases that we clearly know are {d,i}ccm.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-08-06 08:59:22 -04:00
Anas Nashif 578ae40761 boards: remove quarl_se_c1000
This board and SoC was discontinued some time ago and is currently not
maintained in the zephyr tree.
Remove all associated configurations and variants from the tree.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-29 21:30:25 -07:00
Piotr Zięcik e4bd11b3f3 dts: Add information about system bus frequency to the dts
This commit adds a fixed clock node (representing clock driving
system bus). The added node is then referenced by peripherals requiring
information about driving clock frequency.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-07-17 21:53:36 +02:00
Piotr Zięcik 7d56fc35fd dts: Add information about CPU frequency to the cpu nodes
This commit adds 'clock-frequency' property to the cpu nodes.
The clock frequency specified in the added property is used
during platform configuration. Examples:

- The SWO logger uses clock frequency to configure SWO output.
- Plenty of platforms need CPU clock specified for their HAL.
- Most of devices with USB needs information about CPU clock
  in order to configure USB clock source.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-07-17 21:53:36 +02:00
Kumar Gala 6a0fcf1b45 dts: arc: fix cpu num
Fix the cpu number to match the node name

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-07-11 06:15:58 -04:00
Wayne Ren b69ed0373e boards: iotdk: add mpu and fpu configuration
* iotdk supports fpu and mpu
* iotdk supports fast irq
* a fix in device tree

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-04-29 09:03:24 -07:00
Charles E. Youse e039053546 uart/ns16550, drivers/pcie: add PCI(e) support
A parallel PCI implementation ("pcie") is added with features for PCIe.
In particular, message-signaled interrupts (MSI) are supported, which
are essential to the use of any non-trivial PCIe device.

The NS16550 UART driver is modified to use pcie.

pcie is a complete replacement for the old PCI support ("pci"). It is
smaller, by an order of magnitude, and cleaner. Both pci and pcie can
(and do) coexist in the same builds, but the intent is to rework any
existing drivers that depend on pci and ultimately remove pci entirely.

This patch is large, but things in mirror are smaller than they appear.
Most of the modified files are configuration-related, and are changed
only slightly to accommodate the modified UART driver.

Deficiencies:

64-bit support is minimal. The code works fine with 64-bit capable
devices, but will not cooperate with MMIO regions (or MSI targets) that
have high bits set. This is not needed on any current boards, and is
unlikely to be needed in the future. Only superficial changes would
be required if we change our minds.

The method specifying PCI endpoints in devicetree is somewhat kludgey.
The "right" way would be to hang PCI devices off a topological tree;
while this would be more aesthetically pleasing, I don't think it's
worth the effort, given our non-standard use of devicetree.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-04-17 10:50:05 -07:00
Wayne Ren 022f061632 board: add the initial support of iotdk
The initial support of iotdk which is a board based on Synopsys
ARC IoT SoC.

In this commit, it includes

* processor support
* UART driver

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-01-10 07:05:51 -05:00
Kumar Gala 582e676248 dts: arc: emsk: Remove emsk_dt.h and CONFIG options from dtsi
There are different interrupt numbers for R22 v R23.  Before this was
being handled via using Kconfig symbol CONFIG_BOARD_EM_STARTERKIT_R23 in
emsk_dt.h.  Since we want to remove use of Kconfig in dts we handle this
via different dtsi files and having the proper one included by the
proper board revision dts file.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-23 09:13:55 -05:00
Kumar Gala 8d92653f26 dts: arc: emsk: Remove DT_APB_CLK_HZ from emsk_dt.h
As we want to remove emsk_dt.h we just fold the DT_APB_CLK_HZ into the
emsk.dtsi.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-23 09:13:55 -05:00
Kumar Gala 7feb430b38 dts: arc: emsk: Remove DT_{I,D}CCM_SIZE from emsk_dt.h
Towards removing Kconfig from DTS we need to move setting of the sizes
of ICCM/DCCM into the SoC specific DTS files and out of emsk_dt.h

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-23 09:13:55 -05:00
Kumar Gala 0eb0e78d67 dts: Fix warnings associated with reg/unit-address not matching
Newer DTC now warns about mismatch between the reg and unit-address.
Most of these cases are due to case not matching, so fix thoses so
everything is lowercase.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-10 09:11:58 -05:00
Savinay Dharmappa bf389e0853 drivers: watchdog: Add dts support for QMSI based watchdog.
patch adds the device binding for qmsi watchdog and device node
for socs which are using wdt qmsi driver.

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-14 14:16:03 -04:00
Kumar Gala 325a9b3ea4 boards: arc: Convert boards to use device tree for LEDs & Buttons
Convert over arc based boards to use device tree instead of board.h to
describe buttons & LEDs.  There are a few boards that the button gpio
flags need validation.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-10 09:26:32 -04:00
Maureen Helm 55caa7b743 drivers: spi: Select HAS_DTS_SPI in designware driver
Makes the designware spi driver consistent with other spi drivers by
selecting HAS_DTS_SPI in the driver. This required adding spi nodes and
dts fixups to several arc and x86 socs, as well as enabling those nodes
in associated boards.

Also refactors the driver to use the base address, interrupt number, and
interrupt priority from dts.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-09-28 06:27:06 +05:30
Erwan Gouriou 1ac3517c6a dts: Add missing 'compatible' property in flash base nodes
'compatible' property was missing in flash base nodes for
some .dtsi files. Fix this.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-09-21 07:23:49 -07:00
Kumar Gala 0ff2ae1fe8 dts: Cleanup warnings associated with interrupt controller nodes
We get several warnings of the form:

	Warning (unit_address_vs_reg): /cpus/arcv2-intc@0:
	node has a unit name, but no reg property

Fix by removing the unit address from the nodes.  Some cases we had a
reg property and a unit address for such interrupt controllers, in those
cases remove both the reg & unit address in the node name.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-09-18 10:44:45 -07:00