On Fri, Aug 26, 2022 at 2:27 AM Dario Binacchi <dario.binacchi@xxxxxxxxxxxxxxxxxxxx> wrote: > > Hi Rob, > > On Thu, Aug 25, 2022 at 11:12 PM Rob Herring <robh@xxxxxxxxxx> wrote: > > > > On Sat, Aug 20, 2022 at 10:29:33AM +0200, Dario Binacchi wrote: > > > Add documentation of device tree bindings for the STM32 basic extended > > > CAN (bxcan) controller. > > > > > > Signed-off-by: Dario Binacchi <dariobin@xxxxxxxxx> > > > Signed-off-by: Dario Binacchi <dario.binacchi@xxxxxxxxxxxxxxxxxxxx> > > > > > > --- > > > > > > Changes in v2: > > > - Change the file name into 'st,stm32-bxcan-core.yaml'. > > > - Rename compatibles: > > > - st,stm32-bxcan-core -> st,stm32f4-bxcan-core > > > - st,stm32-bxcan -> st,stm32f4-bxcan > > > - Rename master property to st,can-master. > > > - Remove the status property from the example. > > > - Put the node child properties as required. > > > > > > .../bindings/net/can/st,stm32-bxcan.yaml | 136 ++++++++++++++++++ > > > 1 file changed, 136 insertions(+) > > > create mode 100644 Documentation/devicetree/bindings/net/can/st,stm32-bxcan.yaml > > > > > > diff --git a/Documentation/devicetree/bindings/net/can/st,stm32-bxcan.yaml b/Documentation/devicetree/bindings/net/can/st,stm32-bxcan.yaml > > > new file mode 100644 > > > index 000000000000..288631b5556d > > > --- /dev/null > > > +++ b/Documentation/devicetree/bindings/net/can/st,stm32-bxcan.yaml > > > @@ -0,0 +1,136 @@ > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > > +%YAML 1.2 > > > +--- > > > +$id: http://devicetree.org/schemas/net/can/st,stm32-bxcan.yaml# > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > + > > > +title: STMicroelectronics bxCAN controller > > > + > > > +description: STMicroelectronics BxCAN controller for CAN bus > > > + > > > +maintainers: > > > + - Dario Binacchi <dario.binacchi@xxxxxxxxxxxxxxxxxxxx> > > > + > > > +allOf: > > > + - $ref: can-controller.yaml# > > > + > > > +properties: > > > + compatible: > > > + enum: > > > + - st,stm32f4-bxcan-core > > > + > > > + reg: > > > + maxItems: 1 > > > + > > > + resets: > > > + maxItems: 1 > > > + > > > + clocks: > > > + description: > > > + Input clock for registers access > > > + maxItems: 1 > > > + > > > + '#address-cells': > > > + const: 1 > > > + > > > + '#size-cells': > > > + const: 0 > > > + > > > +additionalProperties: false > > > + > > > +required: > > > + - compatible > > > + - reg > > > + - resets > > > + - clocks > > > + - '#address-cells' > > > + - '#size-cells' > > > + > > > +patternProperties: > > > + "^can@[0-9]+$": > > > + type: object > > > + description: > > > + A CAN block node contains two subnodes, representing each one a CAN > > > + instance available on the machine. > > > + > > > + properties: > > > + compatible: > > > + enum: > > > + - st,stm32f4-bxcan > > > + > > > + st,can-master: > > > + description: > > > + Master and slave mode of the bxCAN peripheral is only relevant > > > + if the chip has two CAN peripherals. In that case they share > > > + some of the required logic, and that means you cannot use the > > > + slave CAN without the master CAN. > > > + type: boolean > > > + > > > + reg: > > > + description: | > > > + Offset of CAN instance in CAN block. Valid values are: > > > + - 0x0: CAN1 > > > + - 0x400: CAN2 > > > + maxItems: 1 > > > + > > > + interrupts: > > > + items: > > > + - description: transmit interrupt > > > + - description: FIFO 0 receive interrupt > > > + - description: FIFO 1 receive interrupt > > > + - description: status change error interrupt > > > + > > > + interrupt-names: > > > + items: > > > + - const: tx > > > + - const: rx0 > > > + - const: rx1 > > > + - const: sce > > > + > > > + resets: > > > + maxItems: 1 > > > + > > > + clocks: > > > + description: > > > + Input clock for registers access > > > + maxItems: 1 > > > + > > > + additionalProperties: false > > > + > > > + required: > > > + - compatible > > > + - reg > > > + - interrupts > > > + - resets > > > + > > > +examples: > > > + - | > > > + #include <dt-bindings/clock/stm32fx-clock.h> > > > + #include <dt-bindings/mfd/stm32f4-rcc.h> > > > + > > > + can: can@40006400 { > > > + compatible = "st,stm32f4-bxcan-core"; > > > + reg = <0x40006400 0x800>; > > > + resets = <&rcc STM32F4_APB1_RESET(CAN1)>; > > > + clocks = <&rcc 0 STM32F4_APB1_CLOCK(CAN1)>; > > > + #address-cells = <1>; > > > + #size-cells = <0>; > > > + > > > > Missing 'ranges'. > > In the file arch/arm/boot/dts/stm32f429.dtsi, I didn't find any other > node using the 'ranges' property, so > I didn't use it for the CAN node either. If the child node is a memory mapped address, then you need 'ranges'. Otherwise, things like of_iomap() don't work. Looking at the above file, only efuse@1fff7800 and adc@40012000 seem to be cases also missing 'ranges'. Rob