[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<MA0P287MB2822C4FB66C0CD31BED2E3B8FEA32@MA0P287MB2822.INDP287.PROD.OUTLOOK.COM>
Date: Wed, 17 Jul 2024 16:01:25 +0800
From: Chen Wang <unicorn_wang@...look.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Cc: Chen Wang <unicornxw@...il.com>, adrian.hunter@...el.com,
aou@...s.berkeley.edu, conor+dt@...nel.org, guoren@...nel.org,
inochiama@...look.com, jszhang@...nel.org,
krzysztof.kozlowski+dt@...aro.org, palmer@...belt.com,
paul.walmsley@...ive.com, robh@...nel.org, ulf.hansson@...aro.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mmc@...r.kernel.org, linux-riscv@...ts.infradead.org,
chao.wei@...hgo.com, haijiao.liu@...hgo.com, xiaoguang.xing@...hgo.com,
tingzhu.wang@...hgo.com
Subject: Re: [PATCH v4 2/4] dt-bindings: mmc: sdhci-of-dwcmhsc: Add Sophgo
SG2042 support
On 2024/6/18 17:39, Krzysztof Kozlowski wrote:
> On 18/06/2024 10:38, Chen Wang wrote:
>> From: Chen Wang <unicorn_wang@...look.com>
>>
>> SG2042 use Synopsys dwcnshc IP for SD/eMMC controllers.
>>
>> SG2042 defines 3 clocks for SD/eMMC controllers.
>> - AXI_EMMC/AXI_SD for aclk/hclk(Bus interface clocks in DWC_mshc)
>> and blck(Core Base Clock in DWC_mshc), these 3 clocks share one
>> source, so reuse existing "core".
>> - 100K_EMMC/100K_SD for cqetmclk(Timer clocks in DWC_mshc), so reuse
>> existing "timer" which was added for rockchip specified.
>> - EMMC_100M/SD_100M for cclk(Card clocks in DWC_mshc), add new "card".
>>
>> Adding example for sg2042.
>>
>> Signed-off-by: Chen Wang <unicorn_wang@...look.com>
>> ---
>> .../bindings/mmc/snps,dwcmshc-sdhci.yaml | 69 +++++++++++++------
>> 1 file changed, 49 insertions(+), 20 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml b/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml
>> index 4d3031d9965f..b53f20733f79 100644
>> --- a/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml
>> +++ b/Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml
>> @@ -21,6 +21,7 @@ properties:
>> - snps,dwcmshc-sdhci
>> - sophgo,cv1800b-dwcmshc
>> - sophgo,sg2002-dwcmshc
>> + - sophgo,sg2042-dwcmshc
>> - thead,th1520-dwcmshc
>>
>> reg:
>> @@ -29,25 +30,6 @@ properties:
>> interrupts:
>> maxItems: 1
>>
>> - clocks:
> Widest constraints stay here.
>
>> - minItems: 1
>> - items:
>> - - description: core clock
>> - - description: bus clock for optional
>> - - description: axi clock for rockchip specified
>> - - description: block clock for rockchip specified
>> - - description: timer clock for rockchip specified
>> -
>> -
>> - clock-names:
>> - minItems: 1
> Widest constraints stay here.
hi, Krzysztof,
Please ask you a question about this widest constraints, I write
bindings as below:
```yaml
properties:
......
clocks:
minItems: 1
clock-names:
minItems: 1
......
allOf:
- $ref: mmc-controller.yaml#
- if:
properties:
compatible:
contains:
const: sophgo,sg2042-dwcmshc
then:
properties:
clocks:
minItems: 1
items:
- description: core clock
- description: bus clock
- description: timer
clock-names:
minItems: 1
items:
- const: core
- const: bus
- const: timer
else:
properties:
clocks:
minItems: 1
items:
- description: core clock
- description: bus clock for optional
- description: axi clock for rockchip specified
- description: block clock for rockchip specified
- description: timer clock for rockchip specified
clock-names:
minItems: 1
items:
- const: core
- const: bus
- const: axi
- const: block
- const: timer
```
and with DTS as below:
```dts
sd: mmc@...002b000 {
compatible = "sophgo,sg2042-dwcmshc";
reg = <0x70 0x4002b000 0x0 0x1000>;
interrupt-parent = <&intc>;
interrupts = <136 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clkgen GATE_CLK_SD_100M>,
<&clkgen GATE_CLK_AXI_SD>,
<&clkgen GATE_CLK_100K_SD>;
clock-names = "core",
"bus",
"timer";
status = "disabled";
};
```
dtb check will report error:
```
.../arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dtb: mmc@...002b000:
clocks: [[84, 38], [84, 64], [84, 76]] is too long
from schema $id:
http://devicetree.org/schemas/mmc/snps,dwcmshc-sdhci.yaml#
.../arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dtb: mmc@...002b000:
clock-names: ['core', 'bus', 'timer'] is too long
from schema $id:
http://devicetree.org/schemas/mmc/snps,dwcmshc-sdhci.yaml#
```
After I removed the widest constraints from the binding file, dtb check
passes.
Not sure if my understanding is wrong. Do you know what's the problem
here? Seems the widest constraints is not needed,
Thanks,
Chen
[......]
Powered by blists - more mailing lists