18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
28c2ecf20Sopenharmony_ci%YAML 1.2
38c2ecf20Sopenharmony_ci---
48c2ecf20Sopenharmony_ci$id: http://devicetree.org/schemas/bus/socionext,uniphier-system-bus.yaml#
58c2ecf20Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_cititle: UniPhier System Bus
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_cidescription: |
108c2ecf20Sopenharmony_ci  The UniPhier System Bus is an external bus that connects on-board devices to
118c2ecf20Sopenharmony_ci  the UniPhier SoC. It is a simple (semi-)parallel bus with address, data, and
128c2ecf20Sopenharmony_ci  some control signals. It supports up to 8 banks (chip selects).
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci  Before any access to the bus, the bus controller must be configured; the bus
158c2ecf20Sopenharmony_ci  controller registers provide the control for the translation from the offset
168c2ecf20Sopenharmony_ci  within each bank to the CPU-viewed address. The needed setup includes the
178c2ecf20Sopenharmony_ci  base address, the size of each bank. Optionally, some timing parameters can
188c2ecf20Sopenharmony_ci  be optimized for faster bus access.
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_cimaintainers:
218c2ecf20Sopenharmony_ci  - Masahiro Yamada <yamada.masahiro@socionext.com>
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ciproperties:
248c2ecf20Sopenharmony_ci  compatible:
258c2ecf20Sopenharmony_ci    const: socionext,uniphier-system-bus
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci  reg:
288c2ecf20Sopenharmony_ci    maxItems: 1
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci  "#address-cells":
318c2ecf20Sopenharmony_ci    description: |
328c2ecf20Sopenharmony_ci      The first cell is the bank number (chip select).
338c2ecf20Sopenharmony_ci      The second cell is the address offset within the bank.
348c2ecf20Sopenharmony_ci    const: 2
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci  "#size-cells":
378c2ecf20Sopenharmony_ci    const: 1
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci  ranges:
408c2ecf20Sopenharmony_ci    description: |
418c2ecf20Sopenharmony_ci      Provide address translation from the System Bus to the parent bus.
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci      Note:
448c2ecf20Sopenharmony_ci      The address region(s) that can be assigned for the System Bus is
458c2ecf20Sopenharmony_ci      implementation defined. Some SoCs can use 0x00000000-0x0fffffff and
468c2ecf20Sopenharmony_ci      0x40000000-0x4fffffff, while other SoCs only 0x40000000-0x4fffffff.
478c2ecf20Sopenharmony_ci      There might be additional limitations depending on SoCs and the boot mode.
488c2ecf20Sopenharmony_ci      The address translation is arbitrary as long as the banks are assigned in
498c2ecf20Sopenharmony_ci      the supported address space with the required alignment and they do not
508c2ecf20Sopenharmony_ci      overlap one another.
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci      For example, it is possible to map:
538c2ecf20Sopenharmony_ci        bank 0 to 0x42000000-0x43ffffff, bank 5 to 0x46000000-0x46ffffff
548c2ecf20Sopenharmony_ci      It is also possible to map:
558c2ecf20Sopenharmony_ci        bank 0 to 0x48000000-0x49ffffff, bank 5 to 0x44000000-0x44ffffff
568c2ecf20Sopenharmony_ci      There is no reason to stick to a particular translation mapping, but the
578c2ecf20Sopenharmony_ci      "ranges" property should provide a "reasonable" default that is known to
588c2ecf20Sopenharmony_ci      work. The software should initialize the bus controller according to it.
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_cipatternProperties:
618c2ecf20Sopenharmony_ci  "^.*@[1-5],[1-9a-f][0-9a-f]+$":
628c2ecf20Sopenharmony_ci    description: Devices attached to chip selects
638c2ecf20Sopenharmony_ci    type: object
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_cirequired:
668c2ecf20Sopenharmony_ci  - compatible
678c2ecf20Sopenharmony_ci  - reg
688c2ecf20Sopenharmony_ci  - "#address-cells"
698c2ecf20Sopenharmony_ci  - "#size-cells"
708c2ecf20Sopenharmony_ci  - ranges
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ciadditionalProperties: false
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ciexamples:
758c2ecf20Sopenharmony_ci  - |
768c2ecf20Sopenharmony_ci    // In this example,
778c2ecf20Sopenharmony_ci    // - the Ethernet device is connected at the offset 0x01f00000 of CS1 and
788c2ecf20Sopenharmony_ci    //   mapped to 0x43f00000 of the parent bus.
798c2ecf20Sopenharmony_ci    // - the UART device is connected at the offset 0x00200000 of CS5 and
808c2ecf20Sopenharmony_ci    //   mapped to 0x46200000 of the parent bus.
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci    system-bus@58c00000 {
838c2ecf20Sopenharmony_ci        compatible = "socionext,uniphier-system-bus";
848c2ecf20Sopenharmony_ci        reg = <0x58c00000 0x400>;
858c2ecf20Sopenharmony_ci        #address-cells = <2>;
868c2ecf20Sopenharmony_ci        #size-cells = <1>;
878c2ecf20Sopenharmony_ci        ranges = <1 0x00000000 0x42000000 0x02000000>,
888c2ecf20Sopenharmony_ci                 <5 0x00000000 0x46000000 0x01000000>;
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci        ethernet@1,1f00000 {
918c2ecf20Sopenharmony_ci            compatible = "smsc,lan9115";
928c2ecf20Sopenharmony_ci            reg = <1 0x01f00000 0x1000>;
938c2ecf20Sopenharmony_ci            interrupts = <0 48 4>;
948c2ecf20Sopenharmony_ci            phy-mode = "mii";
958c2ecf20Sopenharmony_ci        };
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci        serial@5,200000 {
988c2ecf20Sopenharmony_ci            compatible = "ns16550a";
998c2ecf20Sopenharmony_ci            reg = <5 0x00200000 0x20>;
1008c2ecf20Sopenharmony_ci            interrupts = <0 49 4>;
1018c2ecf20Sopenharmony_ci            clock-frequency = <12288000>;
1028c2ecf20Sopenharmony_ci        };
1038c2ecf20Sopenharmony_ci    };
104