Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: dts: microchip: sam9x60: Move i2c address/size to dtsi

These properties are common for all i2c subnodes. Allows to add i2c device
nodes (like an rtc for example) in other .dts files including
sam9x60.dtsi without requiring to repeat these properties for each i2c
device again and again.

Found on a custom board after adding this in .dts:

&flx5 {
atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
status = "okay";

i2c5: i2c@600 {
pinctrl-0 = <&pinctrl_flx5_default>;
status = "okay";

pcf8523: rtc@68 {
compatible = "nxp,pcf8523";
reg = <0x68>;
};
};
};

… which created a warning like this:

[…]:236.4-17: Warning (reg_format): /ahb/apb/flexcom@f0004000/i2c@600/rtc@68:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
[…]: Warning (pci_device_reg): Failed prerequisite 'reg_format'
[…]: Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
[…]: Warning (simple_bus_reg): Failed prerequisite 'reg_format'
[…]/linux-6.6.25/arch/arm/boot/dts/microchip/sam9x60.dtsi:283.19-299.7: Warning (i2c_bus_bridge): /ahb/apb/flexcom@f0004000/i2c@600: incorrect #address-cells for I2C bus also defined at […]:228.16-238.4
[…]/linux-6.6.25/arch/arm/boot/dts/microchip/sam9x60.dtsi:283.19-299.7: Warning (i2c_bus_bridge): /ahb/apb/flexcom@f0004000/i2c@600: incorrect #size-cells for I2C bus also defined at […]:228.16-238.4
[…]: Warning (i2c_bus_reg): Failed prerequisite 'reg_format'
[…]: Warning (i2c_bus_reg): Failed prerequisite 'i2c_bus_bridge'
[…]: Warning (spi_bus_reg): Failed prerequisite 'reg_format'
[…]:234.19-237.5: Warning (avoid_default_addr_size): /ahb/apb/flexcom@f0004000/i2c@600/rtc@68: Relying on default #address-cells value
[…]:234.19-237.5: Warning (avoid_default_addr_size): /ahb/apb/flexcom@f0004000/i2c@600/rtc@68: Relying on default #size-cells value
[…]: Warning (avoid_unnecessary_addr_size): Failed prerequisite 'avoid_default_addr_size'
[…]: Warning (unique_unit_address): Failed prerequisite 'avoid_default_addr_size'

This probably should have been done with commit 84f23f3284d5 ("ARM: dts:
at91: sam9x60: move flexcom definitions") already, where those
address-cells and size-cells properties were left in the board .dts
files instead of moving them to the dtsi.

Signed-off-by: Alexander Dahl <ada@thorsis.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20240528153109.439407-1-ada@thorsis.com
[claudiu.beznea: adjusted commit message as the properties are not
required anymore]
Signed-off-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>

authored by

Alexander Dahl and committed by
Claudiu Beznea
9dbd9dbe d0d92d27

+26 -6
-2
arch/arm/boot/dts/microchip/at91-sam9x60_curiosity.dts
··· 198 198 dmas = <0>, <0>; 199 199 pinctrl-names = "default"; 200 200 pinctrl-0 = <&pinctrl_flx0_default>; 201 - #address-cells = <1>; 202 - #size-cells = <0>; 203 201 i2c-analog-filter; 204 202 i2c-digital-filter; 205 203 i2c-digital-filter-width-ns = <35>;
-4
arch/arm/boot/dts/microchip/at91-sam9x60ek.dts
··· 207 207 status = "okay"; 208 208 209 209 i2c0: i2c@600 { 210 - #address-cells = <1>; 211 - #size-cells = <0>; 212 210 dmas = <0>, <0>; 213 211 pinctrl-names = "default"; 214 212 pinctrl-0 = <&pinctrl_flx0_default>; ··· 252 254 status = "okay"; 253 255 254 256 i2c6: i2c@600 { 255 - #address-cells = <1>; 256 - #size-cells = <0>; 257 257 dmas = <0>, <0>; 258 258 pinctrl-names = "default"; 259 259 pinctrl-0 = <&pinctrl_flx6_default>;
+26
arch/arm/boot/dts/microchip/sam9x60.dtsi
··· 215 215 compatible = "microchip,sam9x60-i2c"; 216 216 reg = <0x600 0x200>; 217 217 interrupts = <13 IRQ_TYPE_LEVEL_HIGH 7>; 218 + #address-cells = <1>; 219 + #size-cells = <0>; 218 220 clocks = <&pmc PMC_TYPE_PERIPHERAL 13>; 219 221 dmas = <&dma0 220 222 (AT91_XDMAC_DT_MEM_IF(0) | ··· 286 284 compatible = "microchip,sam9x60-i2c"; 287 285 reg = <0x600 0x200>; 288 286 interrupts = <14 IRQ_TYPE_LEVEL_HIGH 7>; 287 + #address-cells = <1>; 288 + #size-cells = <0>; 289 289 clocks = <&pmc PMC_TYPE_PERIPHERAL 14>; 290 290 dmas = <&dma0 291 291 (AT91_XDMAC_DT_MEM_IF(0) | ··· 398 394 compatible = "microchip,sam9x60-i2c"; 399 395 reg = <0x600 0x200>; 400 396 interrupts = <32 IRQ_TYPE_LEVEL_HIGH 7>; 397 + #address-cells = <1>; 398 + #size-cells = <0>; 401 399 clocks = <&pmc PMC_TYPE_PERIPHERAL 32>; 402 400 dmas = <&dma0 403 401 (AT91_XDMAC_DT_MEM_IF(0) | ··· 449 443 compatible = "microchip,sam9x60-i2c"; 450 444 reg = <0x600 0x200>; 451 445 interrupts = <33 IRQ_TYPE_LEVEL_HIGH 7>; 446 + #address-cells = <1>; 447 + #size-cells = <0>; 452 448 clocks = <&pmc PMC_TYPE_PERIPHERAL 33>; 453 449 dmas = <&dma0 454 450 (AT91_XDMAC_DT_MEM_IF(0) | ··· 608 600 compatible = "microchip,sam9x60-i2c"; 609 601 reg = <0x600 0x200>; 610 602 interrupts = <9 IRQ_TYPE_LEVEL_HIGH 7>; 603 + #address-cells = <1>; 604 + #size-cells = <0>; 611 605 clocks = <&pmc PMC_TYPE_PERIPHERAL 9>; 612 606 dmas = <&dma0 613 607 (AT91_XDMAC_DT_MEM_IF(0) | ··· 659 649 compatible = "microchip,sam9x60-i2c"; 660 650 reg = <0x600 0x200>; 661 651 interrupts = <10 IRQ_TYPE_LEVEL_HIGH 7>; 652 + #address-cells = <1>; 653 + #size-cells = <0>; 662 654 clocks = <&pmc PMC_TYPE_PERIPHERAL 10>; 663 655 dmas = <&dma0 664 656 (AT91_XDMAC_DT_MEM_IF(0) | ··· 710 698 compatible = "microchip,sam9x60-i2c"; 711 699 reg = <0x600 0x200>; 712 700 interrupts = <11 IRQ_TYPE_LEVEL_HIGH 7>; 701 + #address-cells = <1>; 702 + #size-cells = <0>; 713 703 clocks = <&pmc PMC_TYPE_PERIPHERAL 11>; 714 704 dmas = <&dma0 715 705 (AT91_XDMAC_DT_MEM_IF(0) | ··· 780 766 compatible = "microchip,sam9x60-i2c"; 781 767 reg = <0x600 0x200>; 782 768 interrupts = <5 IRQ_TYPE_LEVEL_HIGH 7>; 769 + #address-cells = <1>; 770 + #size-cells = <0>; 783 771 clocks = <&pmc PMC_TYPE_PERIPHERAL 5>; 784 772 dmas = <&dma0 785 773 (AT91_XDMAC_DT_MEM_IF(0) | ··· 850 834 compatible = "microchip,sam9x60-i2c"; 851 835 reg = <0x600 0x200>; 852 836 interrupts = <6 IRQ_TYPE_LEVEL_HIGH 7>; 837 + #address-cells = <1>; 838 + #size-cells = <0>; 853 839 clocks = <&pmc PMC_TYPE_PERIPHERAL 6>; 854 840 dmas = <&dma0 855 841 (AT91_XDMAC_DT_MEM_IF(0) | ··· 920 902 compatible = "microchip,sam9x60-i2c"; 921 903 reg = <0x600 0x200>; 922 904 interrupts = <7 IRQ_TYPE_LEVEL_HIGH 7>; 905 + #address-cells = <1>; 906 + #size-cells = <0>; 923 907 clocks = <&pmc PMC_TYPE_PERIPHERAL 7>; 924 908 dmas = <&dma0 925 909 (AT91_XDMAC_DT_MEM_IF(0) | ··· 990 970 compatible = "microchip,sam9x60-i2c"; 991 971 reg = <0x600 0x200>; 992 972 interrupts = <8 IRQ_TYPE_LEVEL_HIGH 7>; 973 + #address-cells = <1>; 974 + #size-cells = <0>; 993 975 clocks = <&pmc PMC_TYPE_PERIPHERAL 8>; 994 976 dmas = <&dma0 995 977 (AT91_XDMAC_DT_MEM_IF(0) | ··· 1096 1074 compatible = "microchip,sam9x60-i2c"; 1097 1075 reg = <0x600 0x200>; 1098 1076 interrupts = <15 IRQ_TYPE_LEVEL_HIGH 7>; 1077 + #address-cells = <1>; 1078 + #size-cells = <0>; 1099 1079 clocks = <&pmc PMC_TYPE_PERIPHERAL 15>; 1100 1080 dmas = <&dma0 1101 1081 (AT91_XDMAC_DT_MEM_IF(0) | ··· 1147 1123 compatible = "microchip,sam9x60-i2c"; 1148 1124 reg = <0x600 0x200>; 1149 1125 interrupts = <16 IRQ_TYPE_LEVEL_HIGH 7>; 1126 + #address-cells = <1>; 1127 + #size-cells = <0>; 1150 1128 clocks = <&pmc PMC_TYPE_PERIPHERAL 16>; 1151 1129 dmas = <&dma0 1152 1130 (AT91_XDMAC_DT_MEM_IF(0) |