Re: [PATCH RFC] riscv: dts: spacemit: Add DMA translation buses for K1

From: Vivian Wang
Date: Tue Jun 17 2025 - 06:11:20 EST


On 6/17/25 17:35, Krzysztof Kozlowski wrote:
> On 17/06/2025 10:48, Vivian Wang wrote:
>> Hi Krzysztof,
>>
>> On 6/17/25 14:21, Krzysztof Kozlowski wrote:
>>> On 17/06/2025 07:21, Vivian Wang wrote:
>>>> The SpacemiT K1 has various static translations of DMA accesses. Add
>>>> these as simple-bus nodes. Devices actually using these translation will
>>>> be added in later patches.
>>>>
>>>> The bus names are assigned according to consensus with SpacemiT [1].
>>> Read the feedback there:
>>>
>>> "So, as you are submitting the first node(s) under network_bus: bus@5, you
>>> should have this added into your patchset, instead of sending out with
>>> none."
>> As mentioned in the patch extra message, this is an RFC meant for
>> achieving consensus on what the bus nodes should look like, not an
>> actual patch meant to be taken. I was hoping I was clear on that, but I
>> guess that paragraph was buried too deep. Well...
>>> Plus simple bus within MMIO node needs unit address. IOW, don't mix MMIO
>>> with non-MMIO. I also suspect this does not pass checks, so the tools
>>> can do our review...
>> This DT passes "make dtbs_check" fine, with only unrelated warnings on
>> sec_uart1 that was already there before:
>>
>>   DTC [C] arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dtb
>> .../arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dtb: serial@f0612000
>> (spacemit,k1-uart): 'clock-names' is a required property
>>         from schema $id: http://devicetree.org/schemas/serial/8250.yaml#
>>   DTC [C] arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dtb
>> .../arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dtb: serial@f0612000
>> (spacemit,k1-uart): 'clock-names' is a required property
>>         from schema $id: http://devicetree.org/schemas/serial/8250.yaml#
>>
>> To be honest, I don't understand what "within MMIO node" means here.
>> Should the buses be taken out of /soc and added as its siblings?
> These looks like children of simple-bus. If that's right: children of
> simple-bus are supposed to have unit addresses (see also simple-bus in
> the DT schema).

The history of the simple-bus.yaml bindings file suggests that a
simple-bus with empty ranges and no unit address as a child of a parent
simple-bus is intentionally allowed [1]. The commit message also
suggests that even in older versions of the same file it was not the
intention to disallow such nested buses.

[1]: https://github.com/devicetree-org/dt-schema/commit/ed9190d20f146d13e262cc9138506326f7d4da91

Regards,
Vivian "dramforever" Wang