Skip to content

Commit

Permalink
add k230 reboot reset,dts modify
Browse files Browse the repository at this point in the history
  • Loading branch information
wangjianxin-canaan committed Jul 18, 2024
1 parent f0744f4 commit ba0b281
Show file tree
Hide file tree
Showing 8 changed files with 675 additions and 142 deletions.
65 changes: 65 additions & 0 deletions Documentation/devicetree/bindings/mmc/kendryte,k230-dw-mshc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/mmc/canaan,k230-dw-mshc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: kendryte Sparx5 Mobile Storage Host Controller

allOf:
- $ref: mmc-controller.yaml

maintainers:
- Lars Povlsen <[email protected]>

# Everything else is described in the common file
properties:
compatible:
const: canaan,k230-dw-mshc

reg:
maxItems: 1

interrupts:
maxItems: 1

clocks:
maxItems: 1
description:
Handle to "core" clock for the sdhci controller.

clock-names:
items:
- const: core

microchip,clock-delay:
description: Delay clock to card to meet setup time requirements.
Each step increase by 1.25ns.
$ref: /schemas/types.yaml#/definitions/uint32
minimum: 1
maximum: 15

required:
- compatible
- reg
- interrupts
- clocks
- clock-names

unevaluatedProperties: false

examples:
- |
sdhci0@91580000 {
compatible = "canaan,k230-dw-mshc";
reg = <0x0 0x91580000 0x0 0x1000>;
interrupts = <142 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "sdhci0irq";
clocks = <&dummy_sd>,<&dummy_sd>;
clock-names = "core", "bus";
max-frequency = <200000000>;
bus-width = <8>;
sdhci,auto-cmd12;
dma-noncoherent;
status = "disabled";
};
40 changes: 40 additions & 0 deletions Documentation/devicetree/bindings/reset/canaan,k230-rst.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/reset/canaan,k230-sysctl-reset.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Canaan Kendryte k230 Reset Controller

maintainers:
- Damien Le Moal <[email protected]>

description: |
Canaan Kendryte k230 reset controller driver which supports the SoC
system controller supplied reset registers for the various peripherals
of the SoC. The k230 reset controller node must be defined as a child
node of the k230 system controller node.
See also:
- dt-bindings/reset/k230-rst.h
properties:
compatible:
const: canaan,k230-sysctl-reset

'#reset-cells':
const: 1

required:
- '#reset-cells'
- compatible

additionalProperties: false

examples:
- |
#include <dt-bindings/reset/k230-rst.h>
sysrst: reset-controller {
compatible = "canaan,k230-sysctl-reset";
#reset-cells = <4>;
};
2 changes: 2 additions & 0 deletions arch/riscv/boot/dts/canaan/k230-canmv-01studio.dts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
cap-sd-highspeed;
rx_delay_line = <0x0d>;
tx_delay_line = <0xb0>;
clocks = <&sd0_cclk_gate>,<&sd0_cclk_gate>;
clock-names = "core", "bus";
};
&mmc_sd1{
status = "okay";
Expand Down
15 changes: 14 additions & 1 deletion arch/riscv/boot/dts/canaan/k230.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,22 @@
g-tx-fifo-size = <512 1024 64 64 64 64>;
status = "disabled";
};
mmc_sd0: sdhci0@91580000 {
compatible = "canaan,k230-dw-mshc";
reg = <0x0 0x91580000 0x0 0x1000>;
interrupts = <142 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "sdhci0irq";
clocks = <&dummy_sd>,<&dummy_sd>;
clock-names = "core", "bus";
max-frequency = <200000000>;
bus-width = <8>;
sdhci,auto-cmd12;
dma-noncoherent;
status = "disabled";
};

mmc_sd1: sdhci1@91581000 {
compatible = "kendryte,k230-dw-mshc";
compatible = "canaan,k230-dw-mshc";
reg = <0x0 0x91581000 0x0 0x1000>;
interrupts = <144 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "sdhci1irq";
Expand Down
Loading

0 comments on commit ba0b281

Please sign in to comment.