Commit graph

105 commits

Author SHA1 Message Date
Kumar Gala 1fe41c169a dts/bindings: Add gpio-nexus base binding
Add a base binding for GPIO nexus nodes.  This will get used by an GPIO
connectors.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-08-09 14:10:40 -05:00
Kumar Gala d2c758b49d dts: Add base gpio-controller to dts bindings
Introduce a gpio.yaml that GPIO controller bindings should inherit
from.  gpio.yaml defines the properties "gpio-controller" and
"#gpio-cells" which all gpio controllers should have.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-08-09 14:10:40 -05:00
Kumar Gala a3318a4583 gpio: arm: cmsdk-gpio: Fixup dts binding / nodes
Add missing gpio-cells and gpio-controller properties to arm,cmsdk-gpio
binding and dts nodes.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-08-09 11:49:16 -05:00
Ulf Magnusson 0ec0c84808 dts: bindings: Remove unused 'version' field
No binding has anything but 'version: 0.1', and the code in scripts/dts/
never does anything with it except print a warning if it isn't there.
It's undocumented what it means.

I suspect it's overkill if it's meant to be the binding format version.
If we'd need to tell different versions from each other, we could change
some other minor thing in the format, and it probably won't be needed.

Remove the 'version' fields from the bindings and the warning from the
scripts/dts/ scripts.

The new device tree script will give an error when unknown fields appear
in bindings.

The deletion was done with

    git ls-files 'dts/bindings/*.yaml' | xargs sed -i '/^\s*version: /d'

Some blank lines at the beginning of bindings were removed as well.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-07-22 09:28:07 -04:00
Ulf Magnusson 4bf7ceaa11 dts: bindings: Do not require 'interrupts' on STM32 GPIO nodes
I'm guessing STM32 GPIO nodes don't generate interrupts, because I can't
find any device tree nodes with 'compatible = "st,stm32-gpio"' and an
'interrupts' property.

Remove the required 'interrupts' property from the binding. This fixes a
bunch of errors in
https://github.com/zephyrproject-rtos/zephyr/issues/17532.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-07-19 10:59:46 -04:00
Kumar Gala ad183ce6af dts/bindings: Mark 'rdc' as optional in nxp,imx-gpio
Since the nxp,imx-gpio binding is shared between i.MX and i.MX-RT SoC
the 'rdc' property needs to be optional (as it doesn't make sense on the
RT SoCs).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-07-18 11:02:23 -04:00
Kumar Gala ba49051034 dts/bindings: Fix 'required' for interrupts
A number of dts bindings mark 'interrupts' as a required property when
in fact they are not for those devices.  Remove the 'required' setting
and just have 'interrupts' as 'optional'.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-07-17 23:30:08 -04:00
Kumar Gala 6e8c155cfa dts/binding: Move clocks into base.yaml
Add clocks as optional in base.yaml and cleanup other yamls

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-07-17 09:13:01 -04:00
Kumar Gala da02634778 dts/bindings: remove stale cell_string
We removed support for cell_string some time ago, so we have some stale
references in a number of bindings that we can remove.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-07-16 08:35:13 -04:00
Kumar Gala 8e1d3f3328 dts/bindings: Remove generation from binding
Now that the generation script doesn't look at the "generation" in the
YAML, we can remove it from the binding files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-07-11 06:51:17 -04:00
Kumar Gala bf0f6d911d dts: Add concept of sub-nodes to YAML and generator
Several bindings have an expectation of sub-nodes that describe the
actual infomation.  The sub-nodes don't have any compatiable so we can't
key on that.

So we can add the concept of a sub-node to the YAML to handle cases like
'gpio-keys', 'gpio-leds', 'pwm-leds', etc..

The sub-node in the YAML is effective the "binding" params that describe
what properties should exist in the sub-node.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-21 15:34:28 +02:00
Ulf Magnusson eba81c6e54 yaml: Remove redundant document separators
YAML document separators are needed e.g. when doing

  $ cat doc1.yaml doc2.yaml | <parser>

For the bindings, we never parse concatenated documents. Assume we don't
for any other .yaml files either.

Having document separators in e.g. base.yaml makes !include a bit
confusing, since the !included files are merged and not separate
documents (the merging is done in Python code though, so it makes no
difference for behavior).

The replacement was done with

    $ git ls-files '*.yaml' | \
        xargs sed -i -e '${/\s*\.\.\.\s*/d;}' -e 's/^\s*---\s*$//'

First pattern removes ... at the end of files, second pattern clears a
line with a lone --- on it.

Some redundant blank lines at the end of files were cleared with

    $ git ls-files '*.yaml' | xargs sed -i '${/^\s*$/d}'

This is more about making sure people can understand why every part of a
binding is there than about removing some text.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-06-19 10:40:10 +02:00
Kumar Gala 48100df875 dts/bindings: Move common properties into a base.yaml
Move common properties like 'compatible', 'reg', 'reg-names',
'interrupts', 'interrupt-names', and 'label' into one common base.yaml
that all the other yaml's can inherit from.  This removes both
duplication and inconsistent definition.

The device specific yamls just need to say if a property is 'required'
or not.

NOTE: due to some generation conflicts we did not covert
'soc-nv-flash.yaml' to use base.yaml.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-10 11:17:41 -05:00
Nathaniel Graff 3093f5cd2f drivers/gpio: Remove DTS fixups for SiFive GPIO
Change the DT macros used by the SiFive GPIO driver so that fixups
are no longer required.

Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
2019-05-30 18:40:26 -04:00
Michael Scott cf5b08131d dts/bindings: introduce Arduino-header-R3 GPIO binding
This allows HW with compatible headers to define the related GPIOs

Signed-off-by: Michael Scott <mike@foundries.io>
2019-05-21 08:17:20 -04:00
Francisco Munoz 2452b84c89 dts : Introduce gpio node entries for Microchip MEC
Dts Nodes for all the GPIO portswere defined. In addition,
a new binding file was created for the gpio driver.

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
2019-05-08 16:39:54 -07:00
Henrik Brix Andersen 98cecb3681 drivers: gpio: ht16k33: add GPIO driver for Holtek HT16K33 LED driver
The HT16K33 is a memory mapping, multifunction LED controller
driver. The controller supports up to 128 LEDs (up to 16 rows and 8
commons) and matrix key scan circuit of up to 13x3 keys.

This commit adds support for the keyscan functionality of the HT16K33.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2019-05-07 22:33:06 -04:00
Brett Witherspoon f101b77db2 soc: ti_simplelink: add support for TI CC13x2 / CC26x2 series
Add initial support for the TI CC13x2 / CC26x2 series with the CC2652R
and CC1352R SoCs. The UART and GPIO peripherals are supported. Drivers
use the driverlib HAL from the TI CC13x2 / CC26x2 SDK.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-05-04 09:13:43 -05:00
Charles E. Youse 6fc655351c drivers/gpio/gpio_intel_apl: remove dependency on shared interrupts
The GPIO driver for the Intel Apollo Lake has so many pins it has to
export ten devices to shoehorn its one device into the GPIO API. The
current implementation uses the shared IRQ driver because these
pseudodevices all share one IRQ. However, since the GPIO driver is
aware of all the possible interrupt sources, it's smaller and faster
(and not even messy) to handle it internally, so this patch eliminates
the dependency on the shared IRQ driver.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-04-23 09:10:00 -07:00
Henrik Brix Andersen 36ff55cba0 gpio: rv32m1: enable GPIO port clocks
Enable the clock for GPIO ports on the RV32M1 SoC before attempting to
access the port controller registers.

Fixes: #15339

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2019-04-17 10:40:37 -05:00
Daniel Leung f7a42a70f8 gpio: intel_apl: rework driver for pin_mask callback
To avoid confusion, callbacks using ordinal pin numbers
is going to be reverted. So the driver has to be re-worked
to expose multiple devices so each device has 32 pins.

Also fixes #12765

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-02-06 07:18:15 -05:00
Anas Nashif a93651085e boards: remove pulpino board
This board is unmaintained and unsupported. It is not known to work and
has lots of conditional code across the tree that makes code
unmaintainable.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-31 22:47:18 -05:00
Michael Scott 0f314ebdda gpio: RV32M1: introduce gpio driver / DT bindings
Add a GPIO driver.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-01-25 11:59:46 -05:00
Christian Taedcke e6d5c4e3da soc: silabs_exx32: Add SWO logger support to EFM32PG12B
By default, after reset SWO signal is not connected to GPIO pin.

Signed-off-by: Christian Taedcke <hacking@taedcke.com>
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-01-09 15:30:59 +01:00
Piotr Mienkowski 8bed2d5e27 soc: silabs_exx32: Add SWO logger support
By default, after reset SWO signal is not connected to GPIO pin. This
commit adds required initialization code to enable support for SWO
logger. Not all SoC series support the feature.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-01-09 15:30:59 +01:00
Ashokkumar B 3c00d955f3 drivers: gpio: Add DTS support for Stellaris gpio driver.
* Add DTS support for gpio controller driver

Signed-off-by: Ashokkumar B <ashokkumar@zilogic.com>
Signed-off-by: Subash G <subash@zilogic.com>
Signed-off-by: Vishnu K <vishnu@zilogic.com>
Signed-off-by: Vaishnavi D <vaishnavi.d@zilogic.com>
2019-01-08 13:30:26 -06:00
Kumar Gala ac7da0b65c gpio: ti cc32xx: Add device tree support for GPIO
Convert gpio_cc32xx driver over to using device tree. Added binding
files, updates to dts for various SoCs that use cc32xx.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-05 11:08:35 -06:00
Diego Sueiro 537798db0d soc: arm: exx32: Add Silabs EFR32MG12P soc files
The Silicon Labs EFR32MG12P Mighty Gecko MCU includes:
* Cortex-M4F core at 40MHz
* up to 1024KB of flash and 256KB of RAM
* integrated Sub-GHz and/or 2.4GHz radio
* multiple low power peripherals

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
Signed-off-by: Endre Karlson <endre.karslon@gmail.com>
2018-10-19 13:47:49 -05:00
Kumar Gala 011b93011e dts: yaml: remove unused id field
The 'id' field was never used and tended to just have the compat of the
node.  Lets remove it and removed some code in extract_dts_includes.py
related to it.  Added a warning if 'id' is set in a yaml so we can
remove it going forward.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-11 08:03:44 -05:00
Kumar Gala c3076d6eb2 gpio: silabs gecko: Add device tree support for GPIO
Convert gpio_gecko driver over to using device tree. Added binding
files, updates to dts for various SoCs that use gpio_gecko.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-09 22:34:56 -04:00
Kumar Gala db74c62398 gpio: sx1509b: Add device tree support for GPIO generation
Add the missing bits to the yaml & dts to enable GPIO pin generation
based on device tree.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-08 12:53:18 -04:00
Kumar Gala da7ac50683 gpio: sifive: Add device tree support for GPIO generation
Add the missing bits to the yaml, dts, and Kconfig to enable GPIO pin
generation based on device tree.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-05 13:21:49 -05:00
Kumar Gala f331cc5c09 dts: atmel: Add missing GPIO properties
The gpio controllers on SAM4S, SAME70, and SAMD were missing properties
related to GPIO pin generation.  Add the missing details into the yaml
and dts files to allow boards to specific gpio pins.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-04 07:49:03 -05:00
Kumar Gala 68edf341c2 dts: atmel: gpio: rename dts binding file
File was named atmel.sam-gpio.yaml, rather than our convention of
atmel,sam-gpio.yaml.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-04 07:49:03 -05:00
Kumar Gala db2ca70a23 dts: pulpino: Add device tree support for GPIO controller
Add the needed bits to get device tree support for the GPIO controller
on the Zedboard-Pulpino.  This will allow us to move LED & button info
into the board.dts.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-04 07:48:32 -05:00
Daniel Leung 8d18ebde9b gpio: add driver for Intel Apollo Lake SoC
This adds a driver for GPIO controller on the Intel
Apollo Lake SoC.

Origin: Original

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-09-19 21:36:16 -04:00
Erwan Gouriou 1755cf6582 dts/bindings: Add 'generation' directive on for 'compatible' property
Add 'generation: define' directive to 'compatible' property.
When existing for a type of device, move compatible property
description in device base structure (eg: i2c.yaml)

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-09-14 08:02:53 -05:00
Mieszko Mierunski 4f6aac1a67 dts: nrf5: Changed GPIO and GPIOTE define names
Changed names using nrf5 to nrf for consistency with other drivers.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2018-08-17 07:29:14 -07:00
Nathaniel Graff 45d5d5db48 boards: riscv: Convert HiFive1 to DTS
Adds DTS bindings for sifive,pwm0, sifive,uart0, sifive,spi0, and
riscv,plic0.

Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
2018-08-13 18:35:38 -05:00
Diego Sueiro 9283ee7acc arch: i.MX add RDC peripheral permission setting for applications cores
This patch adds the RDC (Resource Domain Controller) peripheral
permissions settings for the i.MX applications cores (Cortex A9 on
i.MX6 and Cortex A7 on i.MX7).

This will enable both Linux (on application's core) and Zephyr (on M4
core) to share the peripherals and coexist.

The settings are defined at devicetree level and applied in the soc.c.

A complete solution should involve the SEMA4 to control the peripherals
access and prevent resource deadlocking and misusage.

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2018-08-09 10:17:32 -05:00
Maureen Helm bbda4455e4 dts: yaml: Add missing id property to nxp bindings
Fixes build warnings:

extract_dts_includes.py: 'id' property missing in 'Kinetis GPIO'
	binding. Using '<unknown id>'.
extract_dts_includes.py: 'id' property missing in 'Kinetis I2C
	Controller' binding. Using '<unknown id>'.
extract_dts_includes.py: 'id' property missing in 'Kinetis Pinmux'
	binding. Using '<unknown id>'.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-07-13 09:41:34 -05:00
Marc Reilly 6c60abb03b drivers: gpio: add dts support for nrf52 gpio
This adds basic support for declaring gpio nodes in dts for nrf52.
The dts.fixup provides mapping for the generated defines to the config
defines currently used by the nrf gpio driver.

Existing boards that use nrf52 are updated.

Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
2018-06-14 15:56:39 +02:00
Tomasz Bursztyka 17a2c1e699 dts: Add yaml descriptor for the QMSI SS GPIO driver
Used in Intel Quark SE ARC core.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-05-18 20:18:50 +03:00
Tomasz Bursztyka 878d0fb877 dts: Add yaml descriptor for the QMSI GPIO driver
Used in Intel Quark SE/D2000 SoCs.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-05-18 20:18:50 +03:00
Wayne Ren 532e4d22ee dts: optimize and bug fixes the dts of em_starterkit
* add gpio, i2c, spi definitions
* optimize and bug fix the dts.fixup
* optimize and bug fix the em_starterkit related definitions
  in dts folder

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2018-05-15 09:48:11 +02:00
Erwan Gouriou 93d3a42776 scripts: extract_includes_dts: Remove usage of cell_string yaml attribute
'cell_string' yaml attribute has been introduced in order to
help enforcement of specific string during defines generation.
This adds complexity in understanding script behavior as a black
box and create additional dependency which is not strictly required.

For node specific generation functions (pinctrl and interrupts),
this could be replaced directly by an hardcoded version
(as everyone used the same 'cell_string' anyway).
For extract_cells functions, string could be replaced by extracted
property name. As a consequence, we're now able to generate defines
for properties refering to these controllers via phandle.
For instance, in following node
 	spbtle-rf@0 {
 		compatible = "st,spbtle-rf";
 		reg = <0>;
		reset-gpios = <&gpioa 8 0>;
 	};
We'll be able to generate:
 #define ST_STM32_SPI_...LE_RF_0_RESET_GPIOS_CONTROLLER	"GPIOA"
 #define ST_STM32_SPI_...PBTLE_RF_0_RESET_GPIOS_FLAGS_0		0
 #define ST_STM32_SPI_..._SPBTLE_RF_0_RESET_GPIOS_PIN_0		8

Only impact for this whole change is for NXP clocks which were the
only ones using 'cell_string' attribute with a value different than
the default one.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-05-10 10:38:23 -05:00
Maureen Helm 22955b83fd dts: Add gpio labels to all kinetis socs
Adds gpio labels to all kinetis socs in preparation for refactoring the
mcux gpio driver to dts. The kl25z was missing gpio nodes altogether, so
they are added.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-04-20 08:54:11 -05:00
Erwan Gouriou 2b4cb5a7ad dts: provide yaml bindings for led and gpio keys
Provide yaml bindings for led and gpio keys (buttons).
These are based on gpio bindings.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-04-13 13:36:45 -05:00
Erwan Gouriou 6c92e55635 dts: bindings: add bindings for stm32 gpio
Provide yaml bindings for gpio nodes properties generation

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-04-13 13:36:45 -05:00
Aapo Vienamo dd9719bf46 gpio: Add a driver for SX1509B
Adds a driver for SX1509B I2C GPIO chip. This driver only supports the
basic GPIO features and does not currently implement the LED driver and
keypad matrix features.

Signed-off-by: Aapo Vienamo <aapo.vienamo@iki.fi>
2018-03-13 12:31:16 -05:00
Justin Watson b9c65e1882 drivers: GPIO Added GPIO for SAM family.
Added GPIO driver for SAM family of SoCs.

Signed-off-by: Justin Watson <jwatson5@gmail.com>
2018-03-10 11:42:25 -06:00
Michael Hope 54c6fbdca7 gpio: add a GPIO driver for the SAM0 family.
Signed-off-by: Michael Hope <mlhx@google.com>
2018-01-04 13:18:25 -05:00
Erwan Gouriou 104553d93f yaml: fix properties syntax to 'mapping' instead of 'series'
According to yaml syntaxic rules, 'properties' described in dts
bindings yaml files could be seen as 'mapping'(key/value couple),
instead of 'series' (list of single elements).
yaml 'mappings' will then be converted by yaml python library as
python 'dict' which will ease treatment (instead of current list
as were before this commit).
Same treatment is applied to 'inherits'.

script extract_dts_inlcude is updated to take change of yaml_list
structre into account. This allows some code simplification. Largest
impact is yaml_collapse function which works now allow complete
overload method on all the attributes of a yaml nodes.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-11-28 11:42:59 -06:00
Maureen Helm 6043c74fd3 gpio: Introduce mcux igpio shim driver
Adds a new gpio driver for the NXP i.MX family of SoCs. Read, write,
configure, and callback API functions are all implemented.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-11-15 09:09:58 -06:00
Kumar Gala b5c4237009 dts: yaml: rework yaml file layout
Moved yaml files to be under dts/bindings and have the bindings try
and match the linux doc device tree binding dir structure as the
canonical binding reference.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-10-23 15:02:00 +02:00