Wenyou Yang | 382d562 | 2016-07-20 17:16:28 +0800 | [diff] [blame] | 1 | * Atmel PIO4 Controller |
| 2 | |
| 3 | The Atmel PIO4 controller is used to select the function of a pin and to |
| 4 | configure it. |
| 5 | |
| 6 | Required properties: |
| 7 | - compatible: "atmel,sama5d2-pinctrl". |
| 8 | - reg: base address and length of the PIO controller. |
| 9 | |
| 10 | Please refer to pinctrl-bindings.txt in this directory for details of the |
| 11 | common pinctrl bindings used by client devices. |
| 12 | |
| 13 | Subnode format |
| 14 | Each node (or subnode) will list the pins it needs and how to configured these |
| 15 | pins. |
| 16 | |
| 17 | node { |
| 18 | pinmux = <PIN_NUMBER_PINMUX>; |
| 19 | GENERIC_PINCONFIG; |
| 20 | }; |
| 21 | |
| 22 | Required properties: |
| 23 | - pinmux: integer array. Each integer represents a pin number plus mux and |
| 24 | ioset settings. Use the macros from boot/dts/<soc>-pinfunc.h file to get the |
| 25 | right representation of the pin. |
| 26 | |
| 27 | Optional properties: |
Claudiu Beznea | 3a7d9f0 | 2021-01-27 15:00:29 +0200 | [diff] [blame] | 28 | - GENERIC_PINCONFIG: generic pinconfig options to use: |
| 29 | - bias-disable, bias-pull-down, bias-pull-up, drive-open-drain, |
| 30 | input-schmitt-enable, input-debounce |
| 31 | - slew-rate: 0 - disabled, 1 - enabled (default) |
Eugen Hristev | 386d530 | 2021-01-05 10:50:06 +0200 | [diff] [blame] | 32 | - atmel,drive-strength: 0 or 1 for low drive, 2 for medium drive and 3 for |
| 33 | high drive. The default value is low drive. |
Wenyou Yang | 382d562 | 2016-07-20 17:16:28 +0800 | [diff] [blame] | 34 | |
| 35 | Example: |
| 36 | |
| 37 | #include <sama5d2-pinfunc.h> |
| 38 | |
| 39 | ... |
| 40 | { |
| 41 | spi0: spi@f8000000 { |
| 42 | cs-gpios = <&pioA 17 0>, <0>, <0>, <0>; |
| 43 | pinctrl-names = "default"; |
| 44 | pinctrl-0 = <&pinctrl_spi0_default>; |
| 45 | status = "okay"; |
| 46 | |
| 47 | spi_flash@0 { |
Neil Armstrong | 2da69a8 | 2019-02-10 10:16:23 +0000 | [diff] [blame] | 48 | compatible = "jedec,spi-nor"; |
Wenyou Yang | 382d562 | 2016-07-20 17:16:28 +0800 | [diff] [blame] | 49 | reg = <0>; |
| 50 | spi-max-frequency = <50000000>; |
| 51 | }; |
| 52 | }; |
| 53 | |
| 54 | ... |
| 55 | |
| 56 | pioA: pinctrl@fc038000 { |
| 57 | compatible = "atmel,sama5d2-pinctrl"; |
| 58 | reg = <0xfc038000 0x600>; |
| 59 | |
| 60 | pinctrl_spi0_default: spi0_default { |
| 61 | pinmux = <PIN_PA14__SPI0_SPCK>, |
| 62 | <PIN_PA15__SPI0_MOSI>, |
| 63 | <PIN_PA16__SPI0_MISO>; |
| 64 | bias-disable; |
| 65 | }; |
| 66 | ... |
| 67 | }; |
| 68 | }; |
| 69 | ... |