Skip to content

Commit

Permalink
Update the Icicle Kit device tree
Browse files Browse the repository at this point in the history
This series updates the Microchip Icicle Kit device tree by adding a
host of peripherals, and some updates to the memory map. In addition,
the device tree has been split into a third part, which contains "soft"
peripherals that are in the fpga fabric.

Several of the entries are for peripherals that have not get had their
drivers upstreamed, so in those cases the dt bindings are included where
appropriate in order to avoid the many "DT compatible string <x> appears
un-documented" errors.

* palmer/riscv-microchip:
  MAINTAINERS: update riscv/microchip entry
  riscv: dts: microchip: add new peripherals to icicle kit device tree
  riscv: dts: microchip: update peripherals in icicle kit device tree
  riscv: dts: microchip: refactor icicle kit device tree
  riscv: dts: microchip: add fpga fabric section to icicle kit
  riscv: dts: microchip: use clk defines for icicle kit
  dt-bindings: pwm: add microchip corepwm binding
  dt-bindings: gpio: add bindings for microchip mpfs gpio
  dt-bindings: rtc: add bindings for microchip mpfs rtc
  dt-bindings: soc/microchip: add info about services to mpfs sysctrl
  dt-bindings: soc/microchip: update syscontroller compatibles
  dt-bindings: clk: microchip: Add Microchip PolarFire host binding
  • Loading branch information
palmer-dabbelt committed Mar 10, 2022
2 parents d56201d + 48e8641 commit feeb386
Show file tree
Hide file tree
Showing 12 changed files with 694 additions and 104 deletions.
58 changes: 58 additions & 0 deletions Documentation/devicetree/bindings/clock/microchip,mpfs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/microchip,mpfs.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Microchip PolarFire Clock Control Module Binding

maintainers:
- Daire McNamara <[email protected]>

description: |
Microchip PolarFire clock control (CLKCFG) is an integrated clock controller,
which gates and enables all peripheral clocks.
This device tree binding describes 33 gate clocks. Clocks are referenced by
user nodes by the CLKCFG node phandle and the clock index in the group, from
0 to 32.
properties:
compatible:
const: microchip,mpfs-clkcfg

reg:
maxItems: 1

clocks:
maxItems: 1

'#clock-cells':
const: 1
description: |
The clock consumer should specify the desired clock by having the clock
ID in its "clocks" phandle cell. See include/dt-bindings/clock/microchip,mpfs-clock.h
for the full list of PolarFire clock IDs.
required:
- compatible
- reg
- clocks
- '#clock-cells'

additionalProperties: false

examples:
# Clock Config node:
- |
#include <dt-bindings/clock/microchip,mpfs-clock.h>
soc {
#address-cells = <2>;
#size-cells = <2>;
clkcfg: clock-controller@20002000 {
compatible = "microchip,mpfs-clkcfg";
reg = <0x0 0x20002000 0x0 0x1000>;
clocks = <&ref>;
#clock-cells = <1>;
};
};
79 changes: 79 additions & 0 deletions Documentation/devicetree/bindings/gpio/microchip,mpfs-gpio.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/gpio/microchip,mpfs-gpio.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Microchip MPFS GPIO Controller Device Tree Bindings

maintainers:
- Conor Dooley <[email protected]>

properties:
compatible:
items:
- enum:
- microchip,mpfs-gpio

reg:
maxItems: 1

interrupts:
description:
Interrupt mapping, one per GPIO. Maximum 32 GPIOs.
minItems: 1
maxItems: 32

interrupt-controller: true

clocks:
maxItems: 1

"#gpio-cells":
const: 2

"#interrupt-cells":
const: 1

ngpios:
description:
The number of GPIOs available.
minimum: 1
maximum: 32
default: 32

gpio-controller: true

required:
- compatible
- reg
- interrupts
- "#interrupt-cells"
- interrupt-controller
- "#gpio-cells"
- gpio-controller
- clocks

additionalProperties: false

examples:
- |
gpio@20122000 {
compatible = "microchip,mpfs-gpio";
reg = <0x20122000 0x1000>;
clocks = <&clkcfg 25>;
interrupt-parent = <&plic>;
gpio-controller;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <1>;
interrupts = <53>, <53>, <53>, <53>,
<53>, <53>, <53>, <53>,
<53>, <53>, <53>, <53>,
<53>, <53>, <53>, <53>,
<53>, <53>, <53>, <53>,
<53>, <53>, <53>, <53>,
<53>, <53>, <53>, <53>,
<53>, <53>, <53>, <53>;
};
...
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: "http://devicetree.org/schemas/mailbox/microchip,polarfire-soc-mailbox.yaml#"
$id: "http://devicetree.org/schemas/mailbox/microchip,mpfs-mailbox.yaml#"
$schema: "http://devicetree.org/meta-schemas/core.yaml#"

title: Microchip PolarFire SoC (MPFS) MSS (microprocessor subsystem) mailbox controller
Expand All @@ -11,7 +11,7 @@ maintainers:

properties:
compatible:
const: microchip,polarfire-soc-mailbox
const: microchip,mpfs-mailbox

reg:
items:
Expand All @@ -38,7 +38,7 @@ examples:
#address-cells = <2>;
#size-cells = <2>;
mbox: mailbox@37020000 {
compatible = "microchip,polarfire-soc-mailbox";
compatible = "microchip,mpfs-mailbox";
reg = <0x0 0x37020000 0x0 0x1000>, <0x0 0x2000318c 0x0 0x40>;
interrupt-parent = <&L1>;
interrupts = <96>;
Expand Down
81 changes: 81 additions & 0 deletions Documentation/devicetree/bindings/pwm/microchip,corepwm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)

%YAML 1.2
---
$id: http://devicetree.org/schemas/pwm/microchip,corepwm.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Microchip IP corePWM controller bindings

maintainers:
- Conor Dooley <[email protected]>

description: |
corePWM is an 16 channel pulse width modulator FPGA IP
https://www.microsemi.com/existing-parts/parts/152118
allOf:
- $ref: pwm.yaml#

properties:
compatible:
items:
- const: microchip,corepwm-rtl-v4

reg:
maxItems: 1

clocks:
maxItems: 1

"#pwm-cells":
const: 2

microchip,sync-update-mask:
description: |
Depending on how the IP is instantiated, there are two modes of operation.
In synchronous mode, all channels are updated at the beginning of the PWM period,
and in asynchronous mode updates happen as the control registers are written.
A 16 bit wide "SHADOW_REG_EN" parameter of the IP core controls whether synchronous
mode is possible for each channel, and is set by the bitstream programmed to the
FPGA. If the IP core is instantiated with SHADOW_REG_ENx=1, both registers that
control the duty cycle for channel x have a second "shadow"/buffer reg synthesised.
At runtime a bit wide register exposed to APB can be used to toggle on/off
synchronised mode for all channels it has been synthesised for.
Each bit of "microchip,sync-update-mask" corresponds to a PWM channel & represents
whether synchronous mode is possible for the PWM channel.
$ref: /schemas/types.yaml#/definitions/uint32
default: 0

microchip,dac-mode-mask:
description: |
Optional, per-channel Low Ripple DAC mode is possible on this IP core. It creates
a minimum period pulse train whose High/Low average is that of the chosen duty
cycle. This "DAC" will have far better bandwidth and ripple performance than the
standard PWM algorithm can achieve. A 16 bit DAC_MODE module parameter of the IP
core, set at instantiation and by the bitstream programmed to the FPGA, determines
whether a given channel operates in regular PWM or DAC mode.
Each bit corresponds to a PWM channel & represents whether DAC mode is enabled
for that channel.
$ref: /schemas/types.yaml#/definitions/uint32
default: 0

required:
- compatible
- reg
- clocks

additionalProperties: false

examples:
- |
pwm@41000000 {
compatible = "microchip,corepwm-rtl-v4";
microchip,sync-update-mask = /bits/ 32 <0>;
clocks = <&clkcfg 30>;
reg = <0x41000000 0xF0>;
#pwm-cells = <2>;
};
58 changes: 58 additions & 0 deletions Documentation/devicetree/bindings/rtc/microchip,mfps-rtc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/rtc/microchip,mfps-rtc.yaml#

$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Microchip PolarFire Soc (MPFS) RTC Device Tree Bindings

allOf:
- $ref: rtc.yaml#

maintainers:
- Daire McNamara <[email protected]>
- Lewis Hanly <[email protected]>

properties:
compatible:
enum:
- microchip,mpfs-rtc

reg:
maxItems: 1

interrupts:
items:
- description: |
RTC_WAKEUP interrupt
- description: |
RTC_MATCH, asserted when the content of the Alarm register is equal
to that of the RTC's count register.
clocks:
maxItems: 1

clock-names:
items:
- const: rtc

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

additionalProperties: false

examples:
- |
rtc@20124000 {
compatible = "microchip,mpfs-rtc";
reg = <0x20124000 0x1000>;
clocks = <&clkcfg 21>;
clock-names = "rtc";
interrupts = <80>, <81>;
};
...
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/soc/microchip/microchip,mpfs-sys-controller.yaml#"
$schema: "http://devicetree.org/meta-schemas/core.yaml#"

title: Microchip PolarFire SoC (MPFS) MSS (microprocessor subsystem) system controller

maintainers:
- Conor Dooley <[email protected]>

description: |
PolarFire SoC devices include a microcontroller acting as the system controller,
which provides "services" to the main processor and to the FPGA fabric. These
services include hardware rng, reprogramming of the FPGA and verfification of the
eNVM contents etc. More information on these services can be found online, at
https://onlinedocs.microchip.com/pr/GUID-1409CF11-8EF9-4C24-A94E-70979A688632-en-US-1/index.html
Communication with the system controller is done via a mailbox, of which the client
portion is documented here.
properties:
mboxes:
maxItems: 1

compatible:
const: microchip,mpfs-sys-controller

required:
- compatible
- mboxes

additionalProperties: false

examples:
- |
syscontroller {
compatible = "microchip,mpfs-sys-controller";
mboxes = <&mbox 0>;
};

This file was deleted.

2 changes: 2 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -16575,8 +16575,10 @@ K: riscv

RISC-V/MICROCHIP POLARFIRE SOC SUPPORT
M: Lewis Hanly <[email protected]>
M: Conor Dooley <[email protected]>
L: [email protected]
S: Supported
F: arch/riscv/boot/dts/microchip/
F: drivers/mailbox/mailbox-mpfs.c
F: drivers/soc/microchip/
F: include/soc/microchip/mpfs.h
Expand Down
Loading

0 comments on commit feeb386

Please sign in to comment.