agilex5: Update agilex5 device tree and device tree bindings
Subsystems (5)
cover agilex5: Update agilex5 device tree and device tree bindings
From: Adrian Ng Ho Yin <[email protected]>
This patch set is to update Agilex5 device tree and the related device tree bindings.
Altera Agilex5 address bus only supports up to 40 bits. This patch set adds support for a new property that is used to configure the dma-bit-mask if its present in the device tree.
This patch set includes the following changes:
-Add property for dw-axi-dmac that configures the dma-bit-mask to the required bits.
-Update cdns nand dt binding with iommus and dma-coherent as an optional property.
-Update Agilex5 dtsi and dts.
-Add implementation to set dma bit-mask to value configured in dma bit-mask quirk if present.
Adrian Ng Ho Yin (4):
dt-bindings: dma: snps,dw-axi-dmac: Add iommus dma-coherent and dma
bit-mask quirk
dt-bindings: mtd: cadence: Add iommus and dma-coherent properties
arm64: dts: socfpga: agilex5: Update Agilex5 DTSI and DTS
dma: dw-axi-dmac: Add support for dma-bit-mask property
.../bindings/dma/snps,dw-axi-dmac.yaml | 13 +++++++++++ .../devicetree/bindings/mtd/cdns,hp-nfc.yaml | 5 +++++ .../arm64/boot/dts/intel/socfpga_agilex5.dtsi | 22 +++++++++++++++++++ .../boot/dts/intel/socfpga_agilex5_socdk.dts | 4 ++++ .../dma/dw-axi-dmac/dw-axi-dmac-platform.c | 14 ++++++++++-- 5 files changed, 56 insertions(+), 2 deletions(-)
Signature · 1 line
2.49.GIT
PATCH 1/4 dt-bindings: dma: snps,dw-axi-dmac: Add iommus dma-coherent and dma bit-mask quirk
From: Adrian Ng Ho Yin <[email protected]>
Intel Agilex5 address bus only supports up to 40 bits. Add dma-bit-mask property to allow configuration of dma bit-mask size. Add iommu property for SMMU support. Add dma-coherent property for cache coherent support.
--- .../devicetree/bindings/dma/snps,dw-axi-dmac.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+)
Documentation/devicetree/bindings/dma/snps,dw-axi-dmac.yaml +13 -0
@@ -42,6 +42,9 @@ properties: minItems: 1 maxItems: 8 + iommus: + maxItems: 1 + clocks: items: - description: Bus Clock
@@ -61,6 +64,8 @@ properties: dma-noncoherent: true + dma-coherent: true + resets: minItems: 1 maxItems: 2
@@ -101,6 +106,14 @@ properties: minimum: 1 maximum: 256 + snps,dma-bit-mask: + description: + Defines the number of addressable bits for DMA. + If this property is missing, the default 64bit will be used. + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 32 + maximum: 64 + required: - compatible - reg
Signature · 1 line
2.49.GIT
PATCH 2/4 dt-bindings: mtd: cadence: Add iommus and dma-coherent properties
In reply to [email protected]From: Adrian Ng Ho Yin <[email protected]>
Update bindings to include iommus and dma-coherent as an optional properties.
--- Documentation/devicetree/bindings/mtd/cdns,hp-nfc.yaml | 5 +++++ 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/mtd/cdns,hp-nfc.yaml +5 -0
@@ -40,6 +40,11 @@ properties: dmas: maxItems: 1 + dma-coherent: true + + iommus: + maxItems: 1 + cdns,board-delay-ps: description: | Estimated Board delay. The value includes the total round trip
Signature · 1 line
2.49.GIT
PATCH 3/4 arm64: dts: socfpga: agilex5: Update Agilex5 DTSI and DTS
In reply to [email protected]From: Adrian Ng Ho Yin <[email protected]>
Add SMMU node in Agilex5 DTSI and enable it in socdk DTS. Add IOMMU support to the Agilex5 DMA controllers by adding the iommus, dma-coherent, and dma-bit-mask properties to the device tree nodes. Add IOMMU support Agilex5 NAND controller by adding iommus and dma-coherent properties.
Add IOMMU support Agilex5 DWC2 controller by adding iommus property. Add ADP support for Agilex5 DWC2 controller by adding otg-rev property.
--- .../arm64/boot/dts/intel/socfpga_agilex5.dtsi | 22 +++++++++++++++++++ .../boot/dts/intel/socfpga_agilex5_socdk.dts | 4 ++++ 2 files changed, 26 insertions(+)
arch/arm64/boot/dts/intel/socfpga_agilex5.dtsi +22 -0
@@ -272,6 +272,8 @@ nand: nand-controller@10b80000 { interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clkmgr AGILEX5_NAND_NF_CLK>; cdns,board-delay-ps = <4830>; + iommus = <&smmu 4>; + dma-coherent; status = "disabled"; };
@@ -291,6 +293,7 @@ dmac0: dma-controller@10db0000 { clock-names = "core-clk", "cfgr-clk"; interrupt-parent = <&intc>; interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>; + iommus = <&smmu 8>; #dma-cells = <1>; dma-channels = <4>; snps,dma-masters = <1>;
@@ -298,6 +301,8 @@ dmac0: dma-controller@10db0000 { snps,block-size = <32767 32767 32767 32767>; snps,priority = <0 1 2 3>; snps,axi-max-burst-len = <8>; + snps,dma-bit-mask = <40>; + dma-coherent; }; dmac1: dma-controller@10dc0000 {
@@ -308,6 +313,7 @@ dmac1: dma-controller@10dc0000 { clock-names = "core-clk", "cfgr-clk"; interrupt-parent = <&intc>; interrupts = <GIC_SPI 171 IRQ_TYPE_LEVEL_HIGH>; + iommus = <&smmu 9>; #dma-cells = <1>; dma-channels = <4>; snps,dma-masters = <1>;
@@ -315,6 +321,8 @@ dmac1: dma-controller@10dc0000 { snps,block-size = <32767 32767 32767 32767>; snps,priority = <0 1 2 3>; snps,axi-max-burst-len = <8>; + snps,dma-bit-mask = <40>; + dma-coherent; }; rst: rstmgr@10d11000 {
@@ -323,6 +331,18 @@ rst: rstmgr@10d11000 { #reset-cells = <1>; }; + smmu: iommu@16000000 { + compatible = "arm,smmu-v3"; + reg = <0x16000000 0x30000>; + interrupts = <GIC_SPI 134 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 129 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 132 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "eventq", "gerror", "priq"; + dma-coherent; + #iommu-cells = <1>; + status = "disabled"; + }; + spi0: spi@10da4000 { compatible = "snps,dw-apb-ssi"; reg = <0x10da4000 0x1000>;
@@ -423,8 +443,10 @@ usb0: usb@10b00000 { phy-names = "usb2-phy"; resets = <&rst USB0_RESET>, <&rst USB0_OCP_RESET>; reset-names = "dwc2", "dwc2-ecc"; + iommus = <&smmu 6>; clocks = <&clkmgr AGILEX5_USB2OTG_HCLK>; clock-names = "otg"; + otg-rev = <0x0200>; status = "disabled"; };
arch/arm64/boot/dts/intel/socfpga_agilex5_socdk.dts +4 -0
@@ -25,6 +25,10 @@ &osc1 { clock-frequency = <25000000>; }; +&smmu { + status = "okay"; +}; + &uart0 { status = "okay"; };
Signature · 1 line
2.49.GIT
PATCH 4/4 dma: dw-axi-dmac: Add support for dma-bit-mask property
In reply to [email protected]From: Adrian Ng Ho Yin <[email protected]>
Intel Agilex5 address bus only supports up to 40 bits. Add dma-bit-mask property support where configure dma-bit-mask based on dma-bit-mask property or fallback to default value if property is not present.
--- drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c +12 -2
@@ -265,13 +265,23 @@ static inline bool axi_chan_is_hw_enable(struct axi_dma_chan *chan)static void axi_dma_hw_init (struct axi_dma_chip *chip) {int ret; -u32 i; +u32 i, tmp;for (i =0 ; i < chip->dw->hdata->nr_channels; i++) {axi_chan_irq_disable (&chip->dw->chan[i],DWAXIDMAC_IRQ_ALL );axi_chan_disable (&chip->dw->chan[i]); } - ret =dma_set_mask_and_coherent (chip->dev,DMA_BIT_MASK (64 )); + + ret =device_property_read_u32 (dev,"snps,dma-bit-mask" , &tmp); +if (ret) + ret =dma_set_mask_and_coherent (chip->dev,DMA_BIT_MASK (64 )); +else { +if (tmp ==0 || tmp <<32 || tmp >64 ) +dev_err (chip->dev,"Invalid dma bit mask\n" ); + + ret =dma_set_mask_and_coherent (chip->dev,DMA_BIT_MASK (tmp)); + } +if (ret)dev_warn (chip->dev,"Unable to set coherent mask\n" ); }
Signature · 1 line
2.49.GIT
kernel test robot
build botRe: [PATCH 4/4] dma: dw-axi-dmac: Add support for dma-bit-mask property
kernel test robot noticed the following build warnings:
Hi,
kernel test robot noticed the following build warnings:
[auto build test WARNING on robh/for-next]
[also build test WARNING on vkoul-dmaengine/next mtd/mtd/next mtd/mtd/fixes linus/master v6.15-rc6] [cannot apply to next-20250516]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/adrianhoyin-ng-altera-com/dt-bindings-dma-snps-dw-axi-dmac-Add-iommus-dma-coherent-and-dma-bit-mask-quirk/20250516-120810 base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next patch link: https://lore.kernel.org/r/a10c000b7c8301018eb2b0a20fbf2d2d10e74a02.1747367749.git.adrianhoyin.ng%40altera.com patch subject: [PATCH 4/4] dma: dw-axi-dmac: Add support for dma-bit-mask property config: arc-randconfig-001-20250517 (https://download.01.org/0day-ci/archive/20250517/[email protected]/config) compiler: arc-linux-gcc (GCC) 10.5.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250517/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c: In function 'axi_dma_hw_init':
drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c:275:33: error: 'dev' undeclared (first use in this function); did you mean 'cdev'?
275 | ret = device_property_read_u32(dev, "snps,dma-bit-mask", &tmp);
| ^~~
| cdev
drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c:275:33: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c:279:23: warning: left shift count >= width of type [-Wshift-count-overflow]
279 | if (tmp == 0 || tmp << 32 || tmp > 64)
| ^~vim +279 drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
264
265 static void axi_dma_hw_init(struct axi_dma_chip *chip)
266 {
267 int ret;
268 u32 i, tmp;
269
270 for (i = 0; i < chip->dw->hdata->nr_channels; i++) {
271 axi_chan_irq_disable(&chip->dw->chan[i], DWAXIDMAC_IRQ_ALL);
272 axi_chan_disable(&chip->dw->chan[i]);
273 }
274
275 ret = device_property_read_u32(dev, "snps,dma-bit-mask", &tmp);
276 if (ret)
277 ret = dma_set_mask_and_coherent(chip->dev, DMA_BIT_MASK(64));
278 else {
> 279 if (tmp == 0 || tmp << 32 || tmp > 64)
280 dev_err(chip->dev, "Invalid dma bit mask\n");
281
282 ret = dma_set_mask_and_coherent(chip->dev, DMA_BIT_MASK(tmp));
283 }
284
285 if (ret)
286 dev_warn(chip->dev, "Unable to set coherent mask\n");
287 }
288
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
kernel test robot
build botRe: [PATCH 4/4] dma: dw-axi-dmac: Add support for dma-bit-mask property
In reply to [email protected]kernel test robot noticed the following build errors:
Hi,
kernel test robot noticed the following build errors:
[auto build test ERROR on robh/for-next]
[also build test ERROR on vkoul-dmaengine/next mtd/mtd/next mtd/mtd/fixes linus/master v6.15-rc6] [cannot apply to next-20250516]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/adrianhoyin-ng-altera-com/dt-bindings-dma-snps-dw-axi-dmac-Add-iommus-dma-coherent-and-dma-bit-mask-quirk/20250516-120810 base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next patch link: https://lore.kernel.org/r/a10c000b7c8301018eb2b0a20fbf2d2d10e74a02.1747367749.git.adrianhoyin.ng%40altera.com patch subject: [PATCH 4/4] dma: dw-axi-dmac: Add support for dma-bit-mask property config: arm-randconfig-001-20250517 (https://download.01.org/0day-ci/archive/20250517/[email protected]/config) compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250517/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All error/warnings (new ones prefixed by >>):
>> drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c:275:33: error: use of undeclared identifier 'dev'
275 | ret = device_property_read_u32(dev, "snps,dma-bit-mask", &tmp);
| ^
drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c:277:46: warning: shift count >= width of type [-Wshift-count-overflow]
277 | ret = dma_set_mask_and_coherent(chip->dev, DMA_BIT_MASK(64));
| ^~~~~~~~~~~~~~~~
include/linux/dma-mapping.h:73:54: note: expanded from macro 'DMA_BIT_MASK'
73 | #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
| ^ ~~~
>> drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c:279:23: warning: shift count >= width of type [-Wshift-count-overflow] 279 | if (tmp == 0 || tmp << 32 || tmp > 64)
| ^ ~~
2 warnings and 1 error generated.
vim +/dev +275 drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
264
265 static void axi_dma_hw_init(struct axi_dma_chip *chip)
266 {
267 int ret;
268 u32 i, tmp;
269
270 for (i = 0; i < chip->dw->hdata->nr_channels; i++) {
271 axi_chan_irq_disable(&chip->dw->chan[i], DWAXIDMAC_IRQ_ALL);
272 axi_chan_disable(&chip->dw->chan[i]);
273 }
274
> 275 ret = device_property_read_u32(dev, "snps,dma-bit-mask", &tmp);
276 if (ret)
277 ret = dma_set_mask_and_coherent(chip->dev, DMA_BIT_MASK(64));
278 else {
> 279 if (tmp == 0 || tmp << 32 || tmp > 64) 280 dev_err(chip->dev, "Invalid dma bit mask\n");
281
282 ret = dma_set_mask_and_coherent(chip->dev, DMA_BIT_MASK(tmp));
283 }
284
285 if (ret)
286 dev_warn(chip->dev, "Unable to set coherent mask\n");
287 }
288
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki