xref: /freebsd-src/sys/contrib/device-tree/Bindings/fpga/lattice,sysconfig.yaml (revision fac71e4e09885bb2afa3d984a0c239a52e1a7418)
18bab661aSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
28bab661aSEmmanuel Vadot%YAML 1.2
38bab661aSEmmanuel Vadot---
48bab661aSEmmanuel Vadot$id: http://devicetree.org/schemas/fpga/lattice,sysconfig.yaml#
58bab661aSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
68bab661aSEmmanuel Vadot
78bab661aSEmmanuel Vadottitle: Lattice Slave SPI sysCONFIG FPGA manager
88bab661aSEmmanuel Vadot
98bab661aSEmmanuel Vadotmaintainers:
10*fac71e4eSEmmanuel Vadot  - Vladimir Georgiev <v.georgiev@metrotek.ru>
118bab661aSEmmanuel Vadot
128bab661aSEmmanuel Vadotdescription: |
138bab661aSEmmanuel Vadot  Lattice sysCONFIG port, which is used for FPGA configuration, among others,
148bab661aSEmmanuel Vadot  have Slave Serial Peripheral Interface. Only full reconfiguration is
158bab661aSEmmanuel Vadot  supported.
168bab661aSEmmanuel Vadot
178bab661aSEmmanuel Vadot  Programming of ECP5 is done by writing uncompressed bitstream image in .bit
188bab661aSEmmanuel Vadot  format into FPGA's SRAM configuration memory.
198bab661aSEmmanuel Vadot
208bab661aSEmmanuel Vadotproperties:
218bab661aSEmmanuel Vadot  compatible:
228bab661aSEmmanuel Vadot    enum:
238bab661aSEmmanuel Vadot      - lattice,sysconfig-ecp5
248bab661aSEmmanuel Vadot
258bab661aSEmmanuel Vadot  reg:
268bab661aSEmmanuel Vadot    maxItems: 1
278bab661aSEmmanuel Vadot
288bab661aSEmmanuel Vadot  program-gpios:
298bab661aSEmmanuel Vadot    description:
308bab661aSEmmanuel Vadot      A GPIO line connected to PROGRAMN (active low) pin of the device.
318bab661aSEmmanuel Vadot      Initiates configuration sequence.
328bab661aSEmmanuel Vadot    maxItems: 1
338bab661aSEmmanuel Vadot
348bab661aSEmmanuel Vadot  init-gpios:
358bab661aSEmmanuel Vadot    description:
368bab661aSEmmanuel Vadot      A GPIO line connected to INITN (active low) pin of the device.
378bab661aSEmmanuel Vadot      Indicates that the FPGA is ready to be configured.
388bab661aSEmmanuel Vadot    maxItems: 1
398bab661aSEmmanuel Vadot
408bab661aSEmmanuel Vadot  done-gpios:
418bab661aSEmmanuel Vadot    description:
428bab661aSEmmanuel Vadot      A GPIO line connected to DONE (active high) pin of the device.
438bab661aSEmmanuel Vadot      Indicates that the configuration sequence is complete.
448bab661aSEmmanuel Vadot    maxItems: 1
458bab661aSEmmanuel Vadot
468bab661aSEmmanuel Vadotrequired:
478bab661aSEmmanuel Vadot  - compatible
488bab661aSEmmanuel Vadot  - reg
498bab661aSEmmanuel Vadot
508bab661aSEmmanuel VadotallOf:
518bab661aSEmmanuel Vadot  - $ref: /schemas/spi/spi-peripheral-props.yaml
528bab661aSEmmanuel Vadot
538bab661aSEmmanuel Vadot  - if:
548bab661aSEmmanuel Vadot      properties:
558bab661aSEmmanuel Vadot        compatible:
568bab661aSEmmanuel Vadot          contains:
578bab661aSEmmanuel Vadot            const: lattice,sysconfig-ecp5
588bab661aSEmmanuel Vadot    then:
598bab661aSEmmanuel Vadot      properties:
608bab661aSEmmanuel Vadot        spi-max-frequency:
618bab661aSEmmanuel Vadot          maximum: 60000000
628bab661aSEmmanuel Vadot
638bab661aSEmmanuel VadotunevaluatedProperties: false
648bab661aSEmmanuel Vadot
658bab661aSEmmanuel Vadotexamples:
668bab661aSEmmanuel Vadot  - |
678bab661aSEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
688bab661aSEmmanuel Vadot
698bab661aSEmmanuel Vadot    spi {
708bab661aSEmmanuel Vadot        #address-cells = <1>;
718bab661aSEmmanuel Vadot        #size-cells = <0>;
728bab661aSEmmanuel Vadot
738bab661aSEmmanuel Vadot        fpga-mgr@0 {
748bab661aSEmmanuel Vadot            compatible = "lattice,sysconfig-ecp5";
758bab661aSEmmanuel Vadot            reg = <0>;
768bab661aSEmmanuel Vadot            spi-max-frequency = <20000000>;
778bab661aSEmmanuel Vadot            program-gpios = <&gpio3 4 GPIO_ACTIVE_LOW>;
788bab661aSEmmanuel Vadot            init-gpios = <&gpio3 3 GPIO_ACTIVE_LOW>;
798bab661aSEmmanuel Vadot            done-gpios = <&gpio3 2 GPIO_ACTIVE_HIGH>;
808bab661aSEmmanuel Vadot        };
818bab661aSEmmanuel Vadot    };
82