Sean Anderson | 0c1f6bf | 2020-06-24 06:41:14 -0400 | [diff] [blame] | 1 | Generic SYSCON mapped register reset driver |
| 2 | |
| 3 | This is a generic reset driver using syscon to map the reset register. |
| 4 | The reset is generally performed with a write to the reset register |
| 5 | defined by the register map pointed by syscon reference plus the offset and |
| 6 | shifted by the reset specifier/ |
| 7 | |
| 8 | To assert a reset on some device, the equivalent of the following operation is |
| 9 | performed, where reset_id is the reset specifier from the device's resets |
| 10 | property. |
| 11 | |
| 12 | if (BIT(reset_id) & mask) |
| 13 | regmap[offset][reset_id] = assert-high; |
| 14 | |
| 15 | Required properties: |
| 16 | - compatible: should contain "syscon-reset" |
| 17 | - #reset-cells: must be 1 |
| 18 | - regmap: this is phandle to the register map node |
| 19 | - offset: offset in the register map for the reboot register (in bytes) |
| 20 | |
| 21 | Optional properties: |
| 22 | - mask: accept only the reset specifiers defined by the mask (32 bit) |
| 23 | - assert-high: Bit to write when asserting a reset. Defaults to 1. |
| 24 | |
| 25 | Default will be little endian mode, 32 bit access only. |
| 26 | |
| 27 | Example: |
| 28 | |
| 29 | reset-controller { |
| 30 | compatible = "syscon-reset"; |
| 31 | #reset-cells = <1>; |
| 32 | regmap = <&sysctl>; |
| 33 | offset = <0x20>; |
| 34 | mask = <0x27FFFFFF>; |
| 35 | assert-high = <0>; |
| 36 | }; |