Skip to content

Commit

Permalink
dt-bindings: mmc: Convert pwrseq to json-schema
Browse files Browse the repository at this point in the history
Convert the pwrseq binding to DT schema format using json-schema.

At the same time, fix a couple of issues with the examples discovered by
the validation tool -- missing ";"

Signed-off-by: Jisheng Zhang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Ulf Hansson <[email protected]>
  • Loading branch information
Jisheng Zhang authored and storulf committed Jul 13, 2020
1 parent b9a349f commit 72f47ae
Show file tree
Hide file tree
Showing 6 changed files with 147 additions and 72 deletions.
25 changes: 0 additions & 25 deletions Documentation/devicetree/bindings/mmc/mmc-pwrseq-emmc.txt

This file was deleted.

46 changes: 46 additions & 0 deletions Documentation/devicetree/bindings/mmc/mmc-pwrseq-emmc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/mmc/mmc-pwrseq-emmc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Simple eMMC hardware reset provider binding

maintainers:
- Ulf Hansson <[email protected]>

description:
The purpose of this driver is to perform standard eMMC hw reset
procedure, as described by Jedec 4.4 specification. This procedure is
performed just after MMC core enabled power to the given mmc host (to
fix possible issues if bootloader has left eMMC card in initialized or
unknown state), and before performing complete system reboot (also in
case of emergency reboot call). The latter is needed on boards, which
doesn't have hardware reset logic connected to emmc card and (limited or
broken) ROM bootloaders are unable to read second stage from the emmc
card if the card is left in unknown or already initialized state.

properties:
compatible:
const: mmc-pwrseq-emmc

reset-gpios:
minItems: 1
description:
contains a GPIO specifier. The reset GPIO is asserted
and then deasserted to perform eMMC card reset. To perform
reset procedure as described in Jedec 4.4 specification, the
gpio line should be defined as GPIO_ACTIVE_LOW.

required:
- compatible
- reset-gpios

examples:
- |
#include <dt-bindings/gpio/gpio.h>
sdhci0_pwrseq {
compatible = "mmc-pwrseq-emmc";
reset-gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
};
...
16 changes: 0 additions & 16 deletions Documentation/devicetree/bindings/mmc/mmc-pwrseq-sd8787.txt

This file was deleted.

39 changes: 39 additions & 0 deletions Documentation/devicetree/bindings/mmc/mmc-pwrseq-sd8787.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/mmc/mmc-pwrseq-sd8787.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Marvell SD8787 power sequence provider binding

maintainers:
- Ulf Hansson <[email protected]>

properties:
compatible:
const: mmc-pwrseq-sd8787

powerdown-gpios:
minItems: 1
description:
contains a power down GPIO specifier with the default active state

reset-gpios:
minItems: 1
description:
contains a reset GPIO specifier with the default active state

required:
- compatible
- powerdown-gpios
- reset-gpios

examples:
- |
#include <dt-bindings/gpio/gpio.h>
wifi_pwrseq: wifi_pwrseq {
compatible = "mmc-pwrseq-sd8787";
powerdown-gpios = <&twl_gpio 0 GPIO_ACTIVE_LOW>;
reset-gpios = <&twl_gpio 1 GPIO_ACTIVE_LOW>;
};
...
31 changes: 0 additions & 31 deletions Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt

This file was deleted.

62 changes: 62 additions & 0 deletions Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/mmc/mmc-pwrseq-simple.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Simple MMC power sequence provider binding

maintainers:
- Ulf Hansson <[email protected]>

description:
The purpose of the simple MMC power sequence provider is to supports a set
of common properties between various SOC designs. It thus enables us to use
the same provider for several SOC designs.

properties:
compatible:
const: mmc-pwrseq-simple

reset-gpios:
minItems: 1
description:
contains a list of GPIO specifiers. The reset GPIOs are asserted
at initialization and prior we start the power up procedure of the card.
They will be de-asserted right after the power has been provided to the
card.

clocks:
minItems: 1
description: Handle for the entry in clock-names.

clock-names:
items:
- const: ext_clock
description: External clock provided to the card.

post-power-on-delay-ms:
description:
Delay in ms after powering the card and de-asserting the
reset-gpios (if any).
$ref: /schemas/types.yaml#/definitions/uint32

power-off-delay-us:
description:
Delay in us after asserting the reset-gpios (if any)
during power off of the card.
$ref: /schemas/types.yaml#/definitions/uint32

required:
- compatible

examples:
- |
#include <dt-bindings/gpio/gpio.h>
sdhci0_pwrseq {
compatible = "mmc-pwrseq-simple";
reset-gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
clocks = <&clk_32768_ck>;
clock-names = "ext_clock";
};
...

0 comments on commit 72f47ae

Please sign in to comment.