From: Paweł Anikiel <hidden> Date: 2021-10-05 14:38:20
The following patches add support for the Mercury+ AA1 with an
Arria 10 SoCFPGA.
This version differs from the previous one by removing the spi
flash node, renaming the memory and mdio nodes, adding gpio nodes,
and adding a bus number property to Synopsys DesignWare i2c
controller node.
Paweł Anikiel (4):
i2c: check bus number property in DesignWare I2C Controller
dt-bindings: add bus number property
reset: socfpga: add empty driver allowing consumers to probe
dts: socfpga: Add Mercury+ AA1 devicetree
.../bindings/i2c/snps,designware-i2c.yaml | 5 +
arch/arm/boot/dts/Makefile | 1 +
.../boot/dts/socfpga_arria10_mercury_aa1.dts | 99 +++++++++++++++++++
drivers/i2c/busses/i2c-designware-platdrv.c | 3 +-
drivers/reset/reset-socfpga.c | 26 +++++
5 files changed, 133 insertions(+), 1 deletion(-)
create mode 100644 arch/arm/boot/dts/socfpga_arria10_mercury_aa1.dts
--
2.25.1
From: Paweł Anikiel <hidden> Date: 2021-10-05 14:38:17
On SoCFPGA systems, it's desireable to have fixed numbering for
i2c busses, while being able to enable/disable them (e.g. have i2c1
be mapped to /dev/i2c-1, even though i2c0 is disabled). This can also
be achieved using devicetree aliases (see i2c_add_adapter). However,
having the driver be self-contained without relying on aliases is more
robust.
Signed-off-by: Paweł Anikiel <redacted>
---
drivers/i2c/busses/i2c-designware-platdrv.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
From: Paweł Anikiel <hidden> Date: 2021-10-05 14:38:22
On SoCFPGA systems, it's desireable to have fixed numbering for
i2c busses, while being able to enable/disable them (e.g. have i2c1
be mapped to /dev/i2c-1, even though i2c0 is disabled). This can also
be achieved using devicetree aliases (see i2c_add_adapter). However,
having the driver be self-contained without relying on aliases is more
robust.
Signed-off-by: Paweł Anikiel <redacted>
---
.../devicetree/bindings/i2c/snps,designware-i2c.yaml | 5 +++++
1 file changed, 5 insertions(+)
@@ -93,6 +93,11 @@ properties:-const:tx-const:rx+busno:+description:|+The property should contain the desired bus number (as opposed to+being assigned automatically)+unevaluatedProperties:falserequired:
From: Paweł Anikiel <hidden> Date: 2021-10-05 14:38:28
The early reset driver doesn't ever probe, which causes consuming
devices to be unable to probe. Add an empty driver to set this device
as available, allowing consumers to probe.
Signed-off-by: Paweł Anikiel <redacted>
---
drivers/reset/reset-socfpga.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Date: 2021-10-05 16:20:09
On Tue, Oct 05, 2021 at 04:37:45PM +0200, Paweł Anikiel wrote:
On SoCFPGA systems, it's desireable to have fixed numbering for
i2c busses, while being able to enable/disable them (e.g. have i2c1
be mapped to /dev/i2c-1, even though i2c0 is disabled). This can also
be achieved using devicetree aliases (see i2c_add_adapter). However,
having the driver be self-contained without relying on aliases is more
robust.
Why? This number means nothing, user space has another means to have
this being robust. Sorry, but I don't see any even close to good enough
justification, NAK.
--
With Best Regards,
Andy Shevchenko
On Tue, Oct 5, 2021 at 4:37 PM Paweł Anikiel [off-list ref] wrote:
On SoCFPGA systems, it's desireable to have fixed numbering for
i2c busses, while being able to enable/disable them (e.g. have i2c1
be mapped to /dev/i2c-1, even though i2c0 is disabled). This can also
be achieved using devicetree aliases (see i2c_add_adapter). However,
having the driver be self-contained without relying on aliases is more
robust.
Signed-off-by: Paweł Anikiel <redacted>
I don't see how adding a nonstandard property in one of the i2c bus
drivers helps at all. How do you expect this to work when there are
multiple i2c controllers in the system using different drivers? What
should happen if both an alias and the busno property are set?
Arnd
On Tue, Oct 5, 2021 at 4:37 PM Paweł Anikiel [off-list ref] wrote:
quoted
On SoCFPGA systems, it's desireable to have fixed numbering for
i2c busses, while being able to enable/disable them (e.g. have i2c1
be mapped to /dev/i2c-1, even though i2c0 is disabled). This can also
be achieved using devicetree aliases (see i2c_add_adapter). However,
having the driver be self-contained without relying on aliases is more
robust.
Signed-off-by: Paweł Anikiel <redacted>
I don't see how adding a nonstandard property in one of the i2c bus
drivers helps at all. How do you expect this to work when there are
multiple i2c controllers in the system using different drivers? What
should happen if both an alias and the busno property are set?
What happens when two nodes have the same busno property because e.g.
one is in a dtsi and the other one is in a dts?
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
From: Paweł Anikiel <hidden> Date: 2021-10-06 08:29:22
On Tue, Oct 5, 2021 at 6:28 PM Alexandre Belloni
[off-list ref] wrote:
On 05/10/2021 18:22:12+0200, Arnd Bergmann wrote:
quoted
On Tue, Oct 5, 2021 at 4:37 PM Paweł Anikiel [off-list ref] wrote:
quoted
On SoCFPGA systems, it's desireable to have fixed numbering for
i2c busses, while being able to enable/disable them (e.g. have i2c1
be mapped to /dev/i2c-1, even though i2c0 is disabled). This can also
be achieved using devicetree aliases (see i2c_add_adapter). However,
having the driver be self-contained without relying on aliases is more
robust.
Signed-off-by: Paweł Anikiel <redacted>
I don't see how adding a nonstandard property in one of the i2c bus
drivers helps at all. How do you expect this to work when there are
multiple i2c controllers in the system using different drivers? What
should happen if both an alias and the busno property are set?
What happens when two nodes have the same busno property because e.g.
one is in a dtsi and the other one is in a dts?
If busno is set, the alias is ignored (the code that checks aliases
is never reached). If two nodes have the same busno property, we get
a WARN in drivers/i2c/i2c-core-base.c:1637, and only on of them
gets attached.
What is a better way of doing this then? Is adding aliases to the
devicetree like this okay?
aliases {
...
i2c0 = &i2c0;
i2c1 = &i2c1;
};