regmap: support firmware-described non-sequential register reads
Subsystems (3)
cover regmap: support firmware-described non-sequential register reads
Hi all,
this series adds support for firmware/device-tree described constraints on sequential register reads.
The motivating use case are camera modules from Vision Components. These modules may integrate image sensors that normally support incrementing multi-register reads, while the MCU (which sits basically "between" the I2C host and the camera sensors) breaks them. In such cases, single-register reads work, but sequential/bulk register reads do not.
This limitation is therefore not a property of the sensor silicon itself, but of the hardware module/integration in which the device is used. As a result, it cannot be identified from the deivce driver and handling it in each affected device driver does not scale well.
To address this, the series introduces a common firmware property (no-sequential-read) describing hardware integrations where reading multiple consecutive registers in a single operation is not reliable. regmap then consumes that property and maps it to its existing use_single_read configuration. This keeps the hardware constraint described in firmware/device-tree while applying it in the layer that already owns the register read transfer policy.
The initial discussion that motivated this approach can be found here:
https://lore.kernel.org/lkml/[email protected]/
Feedback is especially welcome on the property naming, the placement of the common binding schema, and if regmap is the best place to implment this.
Thanks,
Richard
---
Richard Leitner (2):
dt-bindings: regmap: add common schema for no-sequential-read
regmap: implement no-sequential-read firmware property
.../devicetree/bindings/regmap/common.yaml | 26 ++++++++++++++++++++++ drivers/base/regmap/regmap.c | 14 +++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-)
---
base-commit: 248951ddc14de84de3910f9b13f51491a8cd91df
change-id: 20260722-regmap-single-read-a2e95070cd66
Best regards,
Signature · 1 line
Richard Leitner <[email protected]>
RFC PATCH 1/2 dt-bindings: regmap: add common schema for no-sequential-read
Introduce a common regmap dt-binding schema with an optional boolean property no-sequential-read to describe hardware integrations where reading multiple consecutive registers in a single operation is not reliable and registers must be read individually.
A typical case are imaging sensors used on vendor-provided camera modules whose bus integration does not support reads that advance across consecutive register addresses. In such cases, single-register reads work, but bulk reads do not. This restriction is a property of the concrete hardware integration, not of the chip itself. It therefore cannot be identified from the device driver and duplicating firmware parsing in each affected driver does not scale.
--- .../devicetree/bindings/regmap/common.yaml | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+)
Documentation/devicetree/bindings/regmap/common.yaml new file +26 -0
@@ -0,0 +1,26 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/regmap/common.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Common register access constraints + +maintainers: + - TBD + +description: + Common properties describing register access constraints. + +properties: + no-sequential-read: + type: boolean + description: + Indicates that this device instance does not support sequential + register reads. + + Reads may start at a given register address, but reading multiple + consecutive registers in a single operation is not reliable. + Software must instead read registers individually. + +additionalProperties: true
Signature · 1 line
2.53.0
RFC PATCH 2/2 regmap: implement no-sequential-read firmware property
In reply to Richard LeitnerSome devices are integrated in hardware modules where incrementing multi-register reads are not reliable, even though the underlying chip normally supports them.
regmap already owns a configuration that selects between bulk reads and single-register reads. Letting regmap consume this firmware property makes use of this configuration and therefore keeps the override in the actual layer of implementation.
If the property is absent, existing behaviour is unchanged.
--- drivers/base/regmap/regmap.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/base/regmap/regmap.c +13 -1
@@ -674,6 +674,18 @@ enum regmap_endian regmap_get_val_endian(struct device *dev, }EXPORT_SYMBOL_GPL (regmap_get_val_endian); +static bool regmap_get_use_single_read (struct device *dev, +const struct regmap_bus *bus, +const struct regmap_config *config) +{ +struct fwnode_handle *fwnode = dev ?dev_fwnode (dev) :NULL ; + +if (fwnode_property_read_bool (fwnode,"no-sequential-read" )) +return true; + +return config->use_single_read || !(config->read || (bus && bus->read)); +} + struct regmap *__regmap_init(struct device *dev, const struct regmap_bus *bus, void *bus_context,
@@ -786,7 +798,7 @@ struct regmap *__regmap_init(struct device *dev, map->reg_stride_order =ilog2 (map->reg_stride); else map->reg_stride_order = -1; - map->use_single_read = config->use_single_read || !(config->read || (bus && bus->read)); + map->use_single_read =regmap_get_use_single_read (dev, bus, config); map->use_single_write = config->use_single_write || !(config->write || (bus && bus->write)); map->can_multi_write = config->can_multi_write && (config->write || (bus && bus->write));if (bus) {
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH RFC 1/2] dt-bindings: regmap: add common schema for no-sequential-read
In reply to Richard LeitnerThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] The `maintainers` field in the newly introduced DT binding schema contains the placeholder 'TBD'.…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The maintainers field in the newly introduced DT binding schema contains the placeholder 'TBD'. The device tree schema validation (dtschema) mandates that all items in the maintainers property must be valid names and email addresses matching the format 'Name <[email protected]>'. This will cause make dt_binding_check to fail. --
--- Patch [1]: [PATCH RFC 1/2] dt-bindings: regmap: add common schema for no-sequential-read --- commit 309f545ffe78e2e1263494a044512db6b6e61394
Author: Richard Leitner <[email protected]>
dt-bindings: regmap: add common schema for no-sequential-read
This commit introduces a common regmap dt-binding schema with an optional boolean property no-sequential-read. This describes hardware integrations where reading multiple consecutive registers in a single operation is not reliable and registers must be read individually.
Quoted 5 lines
Documentation/devicetree/bindings/regmap/common.yaml new file +0
-0@@ -0,0 +1,26 @@
[ ... ]
Documentation/devicetree/bindings/regmap/common.yaml line 10
Quoted 4 lines
Documentation/devicetree/bindings/regmap/common.yaml new file +4
-0+title: Common register access constraints + +maintainers: + - TBD
[Severity: Low]
Will this cause make dt_binding_check to fail?
Device tree schema validation mandates that all items in the maintainers property must be valid names and email addresses matching the format Name <[email protected]>. The placeholder TBD does not match this format and will trigger a meta-schema validation error.
Quoted 3 lines
Documentation/devicetree/bindings/regmap/common.yaml new file +3
-0+ +description: + Common properties describing register access constraints.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Mark Brown
maintainerRe: [PATCH RFC 1/2] dt-bindings: regmap: add common schema for no-sequential-read
In reply to Richard LeitnerQuoted 5 lines · Richard Leitner
Introduce a common regmap dt-binding schema with an optional boolean property no-sequential-read to describe hardware integrations where reading multiple consecutive registers in a single operation is not reliable and registers must be read individually.
Quoted 7 lines
A typical case are imaging sensors used on vendor-provided camera modules whose bus integration does not support reads that advance across consecutive register addresses. In such cases, single-register reads work, but bulk reads do not. This restriction is a property of the concrete hardware integration, not of the chip itself. It therefore cannot be identified from the device driver and duplicating firmware parsing in each affected driver does not scale.
No, this should not be a DT property. We should discover this through the bus, just like we do currently for the various I2C quirks that are advertied by the I2C subsystem.
Re: [PATCH RFC 1/2] dt-bindings: regmap: add common schema for no-sequential-read
Hi Mark,
thanks the quick feedback.
Quoted 14 lines · Mark Brown
Quoted 5 lines · Richard Leitner
Introduce a common regmap dt-binding schema with an optional boolean property no-sequential-read to describe hardware integrations where reading multiple consecutive registers in a single operation is not reliable and registers must be read individually.
Quoted 7 lines
A typical case are imaging sensors used on vendor-provided camera modules whose bus integration does not support reads that advance across consecutive register addresses. In such cases, single-register reads work, but bulk reads do not. This restriction is a property of the concrete hardware integration, not of the chip itself. It therefore cannot be identified from the device driver and duplicating firmware parsing in each affected driver does not scale.
Quoted 3 lines
No, this should not be a DT property. We should discover this through the bus, just like we do currently for the various I2C quirks that are advertied by the I2C subsystem.
What do you mean "discover this through the bus"? As mentioned in the commit message there is no possibility to detect that within the affected I2C device drivers.
Or do you mean that it should be "discovered" by modelling the MCU which "proxies" the I2C traffic between the host and the sensor/device as some kind of "parent" device of the sensor?
Or something other?
Sorry, if I don't get it, but currently I see no other option than providing this information somehow via device-tree. No matter if it's in regmap or I2C.
thanks & regards;rl
Re: [PATCH RFC 1/2] dt-bindings: regmap: add common schema for no-sequential-read
Quoted 19 lines · Richard Leitner
Quoted 14 lines · Mark Brown
Quoted 5 lines · Richard Leitner
Introduce a common regmap dt-binding schema with an optional boolean property no-sequential-read to describe hardware integrations where reading multiple consecutive registers in a single operation is not reliable and registers must be read individually.
Quoted 7 lines
A typical case are imaging sensors used on vendor-provided camera modules whose bus integration does not support reads that advance across consecutive register addresses. In such cases, single-register reads work, but bulk reads do not. This restriction is a property of the concrete hardware integration, not of the chip itself. It therefore cannot be identified from the device driver and duplicating firmware parsing in each affected driver does not scale.
Quoted 3 lines
No, this should not be a DT property. We should discover this through the bus, just like we do currently for the various I2C quirks that are advertied by the I2C subsystem.
Quoted 7 lines
What do you mean "discover this through the bus"? As mentioned in the commit message there is no possibility to detect that within the affected I2C device drivers.
Or do you mean that it should be "discovered" by modelling the MCU which "proxies" the I2C traffic between the host and the sensor/device as some kind of "parent" device of the sensor?
Mark's comment wasn't totally clear to me. I think this is what he meant.
Richard, do you know if the MCU (which is actually an FPGA if I'm not mistaken) intercepts the I2C signals (i.e. is interposed between the host and the image sensor), or is "just" connected on the same I2C bus and messes up the I2C transfer when it detects a condition it dislikes (for instance by pulling the SDA line down when it detects a read from a protected register) ?
Quoted 5 lines
Or something other?
Sorry, if I don't get it, but currently I see no other option than providing this information somehow via device-tree. No matter if it's in regmap or I2C.
Signature · 3 lines
Regards, Laurent Pinchart
Mark Brown
maintainerRe: [PATCH RFC 1/2] dt-bindings: regmap: add common schema for no-sequential-read
In reply to Richard LeitnerQuoted 6 lines · Richard Leitner
Quoted 3 lines · Mark Brown
No, this should not be a DT property. We should discover this through the bus, just like we do currently for the various I2C quirks that are advertied by the I2C subsystem.
Quoted 7 lines
What do you mean "discover this through the bus"? As mentioned in the commit message there is no possibility to detect that within the affected I2C device drivers.
Or do you mean that it should be "discovered" by modelling the MCU which "proxies" the I2C traffic between the host and the sensor/device as some kind of "parent" device of the sensor?
If there is hardware there that rewrites the traffic then obviously that hardware should be described in the device tree, yes. It sounds like this is the actual I2C controller and is what is imposing the limits.
Re: [PATCH RFC 1/2] dt-bindings: regmap: add common schema for no-sequential-read
In reply to Laurent PinchartQuoted 31 lines · Laurent Pinchart
Quoted 19 lines · Richard Leitner
Quoted 14 lines · Mark Brown
Quoted 5 lines · Richard Leitner
Introduce a common regmap dt-binding schema with an optional boolean property no-sequential-read to describe hardware integrations where reading multiple consecutive registers in a single operation is not reliable and registers must be read individually.
Quoted 7 lines
A typical case are imaging sensors used on vendor-provided camera modules whose bus integration does not support reads that advance across consecutive register addresses. In such cases, single-register reads work, but bulk reads do not. This restriction is a property of the concrete hardware integration, not of the chip itself. It therefore cannot be identified from the device driver and duplicating firmware parsing in each affected driver does not scale.
Quoted 3 lines
No, this should not be a DT property. We should discover this through the bus, just like we do currently for the various I2C quirks that are advertied by the I2C subsystem.
Quoted 7 lines
What do you mean "discover this through the bus"? As mentioned in the commit message there is no possibility to detect that within the affected I2C device drivers.
Or do you mean that it should be "discovered" by modelling the MCU which "proxies" the I2C traffic between the host and the sensor/device as some kind of "parent" device of the sensor?
Mark's comment wasn't totally clear to me. I think this is what he meant.
Quoted 6 lines
Richard, do you know if the MCU (which is actually an FPGA if I'm not mistaken) intercepts the I2C signals (i.e. is interposed between the host and the image sensor), or is "just" connected on the same I2C bus and messes up the I2C transfer when it detects a condition it dislikes (for instance by pulling the SDA line down when it detects a read from a protected register) ?
Tbh. I don't know. The VC MIPI Camera Module Hardware Operating manual suggests both, the controller and the sensor sit on the same I2C bus:
But that's just a block diagram and nothing is written down really.
I tried some reverse-engineering and probed most of the accessible pads of the camera module with my scope. I found no evidence that there is "a second I2C bus" with "delayed" signals as I would suspect if the FPGA really intercepts the I2C traffic.
Nonetheless this is by far no proof that this isn't the case, as the I2C lanes of the imaging sensor are not accessible without destroying the PCB :-(
So any help/feedback/information is greatly appreciated.
@Mark: I understood that if the fpga really intercepts the I2C bus, it should be modelled accordingly in device tree. But what would be the preferred implementation if both devices sit on the same I2C bus, but one is messing up some register reads on purpose?
thanks & regards;rl
Quoted 11 lines
Quoted 6 lines
Or something other?
Sorry, if I don't get it, but currently I see no other option than providing this information somehow via device-tree. No matter if it's in regmap or I2C.
Signature · 3 lines
Regards, Laurent Pinchart
Mark Brown
maintainerRe: [PATCH RFC 1/2] dt-bindings: regmap: add common schema for no-sequential-read
Quoted 4 lines · Richard Leitner
@Mark: I understood that if the fpga really intercepts the I2C bus, it should be modelled accordingly in device tree. But what would be the preferred implementation if both devices sit on the same I2C bus, but one is messing up some register reads on purpose?
I think we would need to have a coherent understanding and description of the actual issue to know how to describe it.
Please do not add random characters to my name.
Re: [PATCH RFC 1/2] dt-bindings: regmap: add common schema for no-sequential-read
Quoted 9 lines · Mark Brown
Quoted 4 lines · Richard Leitner
@Mark: I understood that if the fpga really intercepts the I2C bus, it should be modelled accordingly in device tree. But what would be the preferred implementation if both devices sit on the same I2C bus, but one is messing up some register reads on purpose?
I think we would need to have a coherent understanding and description of the actual issue to know how to describe it.
Understood. I will try to figure out how the hardware is really wired and come back to you.
Quoted 2 lines
Please do not add random characters to my name.
Sorry, I didn’t mean any harm.
Re: [PATCH RFC 1/2] dt-bindings: regmap: add common schema for no-sequential-read
Quoted 8 lines · Richard Leitner
Quoted 7 lines · Mark Brown
Quoted 4 lines · Richard Leitner
@Mark: I understood that if the fpga really intercepts the I2C bus, it should be modelled accordingly in device tree. But what would be the preferred implementation if both devices sit on the same I2C bus, but one is messing up some register reads on purpose?
Quoted 5 lines
Quoted 2 lines
I think we would need to have a coherent understanding and description of the actual issue to know how to describe it.
Understood. I will try to figure out how the hardware is really wired and come back to you.
Based on the information I have received so far, the FPGA is interposed between the host and sensor. It could therefore be modelled in DT as child of the I2C bus and a parent of the sensor.
New version of some of the Vision Components modules have fixed the multi-read bug, so we will still need a property in the FPGA DT node to indicate if the quirk should be activated.
Quoted 3 lines
Quoted 1 line
Please do not add random characters to my name.
Sorry, I didn’t mean any harm.
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH RFC 1/2] dt-bindings: regmap: add common schema for no-sequential-read
Quoted 15 lines · Laurent Pinchart
Quoted 8 lines · Richard Leitner
Quoted 7 lines · Mark Brown
Quoted 4 lines · Richard Leitner
@Mark: I understood that if the fpga really intercepts the I2C bus, it should be modelled accordingly in device tree. But what would be the preferred implementation if both devices sit on the same I2C bus, but one is messing up some register reads on purpose?
Quoted 5 lines
Quoted 2 lines
I think we would need to have a coherent understanding and description of the actual issue to know how to describe it.
Understood. I will try to figure out how the hardware is really wired and come back to you.
Quoted 7 lines
Based on the information I have received so far, the FPGA is interposed between the host and sensor. It could therefore be modelled in DT as child of the I2C bus and a parent of the sensor.
New version of some of the Vision Components modules have fixed the multi-read bug, so we will still need a property in the FPGA DT node to indicate if the quirk should be activated.
Or come up with a compatible for the FPGA DT node that uniquely identifies the revision of the RTL in use.
That's my preference for things that use some custom RTL that aren't configuration parameters.
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines
Please do not add random characters to my name.
Sorry, I didn’t mean any harm.
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH RFC 1/2] dt-bindings: regmap: add common schema for no-sequential-read
Quoted 20 lines · Conor Dooley
Quoted 19 lines · Laurent Pinchart
Quoted 8 lines · Richard Leitner
Quoted 7 lines · Mark Brown
Quoted 4 lines · Richard Leitner
@Mark: I understood that if the fpga really intercepts the I2C bus, it should be modelled accordingly in device tree. But what would be the preferred implementation if both devices sit on the same I2C bus, but one is messing up some register reads on purpose?
Quoted 5 lines
Quoted 2 lines
I think we would need to have a coherent understanding and description of the actual issue to know how to describe it.
Understood. I will try to figure out how the hardware is really wired and come back to you.
Based on the information I have received so far, the FPGA is interposed between the host and sensor. It could therefore be modelled in DT as child of the I2C bus and a parent of the sensor.
Quoted 8 lines
Quoted 3 lines
New version of some of the Vision Components modules have fixed the multi-read bug, so we will still need a property in the FPGA DT node to indicate if the quirk should be activated.
Or come up with a compatible for the FPGA DT node that uniquely identifies the revision of the RTL in use.
That's my preference for things that use some custom RTL that aren't configuration parameters.
I'm afraid we won't be able to get that information. We have limited visibility on the ecosystem of modules and what the FPGA does in each of them.
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Please do not add random characters to my name.
Sorry, I didn’t mean any harm.
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH RFC 1/2] dt-bindings: regmap: add common schema for no-sequential-read
Quoted 25 lines · Laurent Pinchart
Quoted 24 lines · Conor Dooley
Quoted 22 lines · Laurent Pinchart
Quoted 8 lines · Richard Leitner
Quoted 7 lines · Mark Brown
Quoted 4 lines · Richard Leitner
@Mark: I understood that if the fpga really intercepts the I2C bus, it should be modelled accordingly in device tree. But what would be the preferred implementation if both devices sit on the same I2C bus, but one is messing up some register reads on purpose?
Quoted 5 lines
Quoted 2 lines
I think we would need to have a coherent understanding and description of the actual issue to know how to describe it.
Understood. I will try to figure out how the hardware is really wired and come back to you.
Based on the information I have received so far, the FPGA is interposed between the host and sensor. It could therefore be modelled in DT as child of the I2C bus and a parent of the sensor.
New version of some of the Vision Components modules have fixed the multi-read bug, so we will still need a property in the FPGA DT node to indicate if the quirk should be activated.
Quoted 8 lines
Quoted 4 lines
Or come up with a compatible for the FPGA DT node that uniquely identifies the revision of the RTL in use.
That's my preference for things that use some custom RTL that aren't configuration parameters.I'm afraid we won't be able to get that information. We have limited visibility on the ecosystem of modules and what the FPGA does in each of them.
Oh well, I tried..
Re: [PATCH RFC 1/2] dt-bindings: regmap: add common schema for no-sequential-read
Quoted 31 lines · Conor Dooley
Quoted 30 lines · Laurent Pinchart
Quoted 28 lines · Conor Dooley
Quoted 15 lines · Laurent Pinchart
Quoted 8 lines · Richard Leitner
Quoted 7 lines · Mark Brown
Quoted 4 lines · Richard Leitner
@Mark: I understood that if the fpga really intercepts the I2C bus, it should be modelled accordingly in device tree. But what would be the preferred implementation if both devices sit on the same I2C bus, but one is messing up some register reads on purpose?
Quoted 5 lines
Quoted 2 lines
I think we would need to have a coherent understanding and description of the actual issue to know how to describe it.
Understood. I will try to figure out how the hardware is really wired and come back to you.
Quoted 7 lines
Based on the information I have received so far, the FPGA is interposed between the host and sensor. It could therefore be modelled in DT as child of the I2C bus and a parent of the sensor.
New version of some of the Vision Components modules have fixed the multi-read bug, so we will still need a property in the FPGA DT node to indicate if the quirk should be activated.
Or come up with a compatible for the FPGA DT node that uniquely identifies the revision of the RTL in use.
That's my preference for things that use some custom RTL that aren't configuration parameters.
Quoted 5 lines
Quoted 3 lines
I'm afraid we won't be able to get that information. We have limited visibility on the ecosystem of modules and what the FPGA does in each of them.
Oh well, I tried..
Let's look at the bright side: the vendor has fixed the issue after we reported them, so DT for newer modules will be better :-)
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH RFC 1/2] dt-bindings: regmap: add common schema for no-sequential-read
In reply to Laurent PinchartQuoted 25 lines · Laurent Pinchart
Quoted 24 lines · Conor Dooley
Quoted 22 lines · Laurent Pinchart
Quoted 8 lines · Richard Leitner
Quoted 7 lines · Mark Brown
Quoted 4 lines · Richard Leitner
@Mark: I understood that if the fpga really intercepts the I2C bus, it should be modelled accordingly in device tree. But what would be the preferred implementation if both devices sit on the same I2C bus, but one is messing up some register reads on purpose?
Quoted 5 lines
Quoted 2 lines
I think we would need to have a coherent understanding and description of the actual issue to know how to describe it.
Understood. I will try to figure out how the hardware is really wired and come back to you.
Based on the information I have received so far, the FPGA is interposed between the host and sensor. It could therefore be modelled in DT as child of the I2C bus and a parent of the sensor.
New version of some of the Vision Components modules have fixed the multi-read bug, so we will still need a property in the FPGA DT node to indicate if the quirk should be activated.
Quoted 8 lines
Quoted 4 lines
Or come up with a compatible for the FPGA DT node that uniquely identifies the revision of the RTL in use.
That's my preference for things that use some custom RTL that aren't configuration parameters.I'm afraid we won't be able to get that information. We have limited visibility on the ecosystem of modules and what the FPGA does in each of them.
Thanks for the clarification. Should I continue working on this topic (i.e. modelling the FPGA as I2C controller with the sensor as a "subdevice")? Or do you want to take over Laurent? Do you have any other downstream work on the vc-mipi stuff, except the patches in your gitlab repo?
I've additionally wrote "my Vision Components contact" an email asking for clarification of the I2C bus layout on the modules yesterday. If I get any new information from that path I will of course take it into account.
Thanks a lot, Laurent!
regards;rl
Re: [PATCH RFC 1/2] dt-bindings: regmap: add common schema for no-sequential-read
Quoted 35 lines · Richard Leitner
Quoted 25 lines · Laurent Pinchart
Quoted 24 lines · Conor Dooley
Quoted 22 lines · Laurent Pinchart
Quoted 8 lines · Richard Leitner
Quoted 7 lines · Mark Brown
Quoted 4 lines · Richard Leitner
@Mark: I understood that if the fpga really intercepts the I2C bus, it should be modelled accordingly in device tree. But what would be the preferred implementation if both devices sit on the same I2C bus, but one is messing up some register reads on purpose?
Quoted 5 lines
Quoted 2 lines
I think we would need to have a coherent understanding and description of the actual issue to know how to describe it.
Understood. I will try to figure out how the hardware is really wired and come back to you.
Based on the information I have received so far, the FPGA is interposed between the host and sensor. It could therefore be modelled in DT as child of the I2C bus and a parent of the sensor.
New version of some of the Vision Components modules have fixed the multi-read bug, so we will still need a property in the FPGA DT node to indicate if the quirk should be activated.
Quoted 8 lines
Quoted 4 lines
Or come up with a compatible for the FPGA DT node that uniquely identifies the revision of the RTL in use.
That's my preference for things that use some custom RTL that aren't configuration parameters.I'm afraid we won't be able to get that information. We have limited visibility on the ecosystem of modules and what the FPGA does in each of them.
Quoted 5 lines
Thanks for the clarification. Should I continue working on this topic (i.e. modelling the FPGA as I2C controller with the sensor as a "subdevice")? Or do you want to take over Laurent? Do you have any other downstream work on the vc-mipi stuff, except the patches in your gitlab repo?
I'm afraid I won't have time for the time being, as I will soon start my summer holidays. The patches in the git tree you mentioned are all I have.
Quoted 5 lines
I've additionally wrote "my Vision Components contact" an email asking for clarification of the I2C bus layout on the modules yesterday. If I get any new information from that path I will of course take it into account.
Thanks a lot, Laurent!
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH RFC 1/2] dt-bindings: regmap: add common schema for no-sequential-read
Quoted 42 lines · Laurent Pinchart
Quoted 35 lines · Richard Leitner
Quoted 25 lines · Laurent Pinchart
Quoted 24 lines · Conor Dooley
Quoted 22 lines · Laurent Pinchart
Quoted 8 lines · Richard Leitner
Quoted 7 lines · Mark Brown
Quoted 4 lines · Richard Leitner
@Mark: I understood that if the fpga really intercepts the I2C bus, it should be modelled accordingly in device tree. But what would be the preferred implementation if both devices sit on the same I2C bus, but one is messing up some register reads on purpose?
Quoted 5 lines
Quoted 2 lines
I think we would need to have a coherent understanding and description of the actual issue to know how to describe it.
Understood. I will try to figure out how the hardware is really wired and come back to you.
Based on the information I have received so far, the FPGA is interposed between the host and sensor. It could therefore be modelled in DT as child of the I2C bus and a parent of the sensor.
New version of some of the Vision Components modules have fixed the multi-read bug, so we will still need a property in the FPGA DT node to indicate if the quirk should be activated.
Quoted 8 lines
Quoted 4 lines
Or come up with a compatible for the FPGA DT node that uniquely identifies the revision of the RTL in use.
That's my preference for things that use some custom RTL that aren't configuration parameters.I'm afraid we won't be able to get that information. We have limited visibility on the ecosystem of modules and what the FPGA does in each of them.
Quoted 5 lines
Thanks for the clarification. Should I continue working on this topic (i.e. modelling the FPGA as I2C controller with the sensor as a "subdevice")? Or do you want to take over Laurent? Do you have any other downstream work on the vc-mipi stuff, except the patches in your gitlab repo?
Quoted 3 lines
I'm afraid I won't have time for the time being, as I will soon start my summer holidays. The patches in the git tree you mentioned are all I have.
Ok. Thanks. Then I will give it a try.
I did some more research on that module and it features a Lattice FPGA (LCMXO3LF-1300E) which to all of my measurement intercepts the I2C bus as expected.
As it additionally manages the regulators my approach would be to implement a Multi-Function Devices (MFD) driver for it.
The resulting DTS layout would then be something like:
&i2c1 {
fpga@10 {
compatible = "visioncomponents,vc-mipi-controller";
reg = <0x10>;
i2c-mux {
compatible = "visioncomponents,vc-mipi-i2c-mux";
i2c@0 {
reg = <0>;
ov9282: camera-sensor@60 {
compatible = "ovti,ov9282";
reg = <0x60>;
...
};
};
};
vc_mipi_reg: regulator {
compatible = "visioncomponents,vc-mipi-regulator";
};
};
};Mark, Laurent, if that's incorrect or otherwise not acceptable, please reach out. Thanks a lot!
regards;rl
Quoted 11 lines
Quoted 6 lines
I've additionally wrote "my Vision Components contact" an email asking for clarification of the I2C bus layout on the modules yesterday. If I get any new information from that path I will of course take it into account.
Thanks a lot, Laurent!
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH RFC 1/2] dt-bindings: regmap: add common schema for no-sequential-read
Quoted 83 lines · Richard Leitner
Quoted 42 lines · Laurent Pinchart
Quoted 35 lines · Richard Leitner
Quoted 25 lines · Laurent Pinchart
Quoted 24 lines · Conor Dooley
Quoted 22 lines · Laurent Pinchart
Quoted 8 lines · Richard Leitner
Quoted 7 lines · Mark Brown
Quoted 4 lines · Richard Leitner
@Mark: I understood that if the fpga really intercepts the I2C bus, it should be modelled accordingly in device tree. But what would be the preferred implementation if both devices sit on the same I2C bus, but one is messing up some register reads on purpose?
Quoted 5 lines
Quoted 2 lines
I think we would need to have a coherent understanding and description of the actual issue to know how to describe it.
Understood. I will try to figure out how the hardware is really wired and come back to you.
Based on the information I have received so far, the FPGA is interposed between the host and sensor. It could therefore be modelled in DT as child of the I2C bus and a parent of the sensor.
New version of some of the Vision Components modules have fixed the multi-read bug, so we will still need a property in the FPGA DT node to indicate if the quirk should be activated.
Quoted 8 lines
Quoted 4 lines
Or come up with a compatible for the FPGA DT node that uniquely identifies the revision of the RTL in use.
That's my preference for things that use some custom RTL that aren't configuration parameters.I'm afraid we won't be able to get that information. We have limited visibility on the ecosystem of modules and what the FPGA does in each of them.
Quoted 5 lines
Thanks for the clarification. Should I continue working on this topic (i.e. modelling the FPGA as I2C controller with the sensor as a "subdevice")? Or do you want to take over Laurent? Do you have any other downstream work on the vc-mipi stuff, except the patches in your gitlab repo?
Quoted 3 lines
I'm afraid I won't have time for the time being, as I will soon start my summer holidays. The patches in the git tree you mentioned are all I have.
Ok. Thanks. Then I will give it a try.
I did some more research on that module and it features a Lattice FPGA (LCMXO3LF-1300E) which to all of my measurement intercepts the I2C bus as expected.
As it additionally manages the regulators my approach would be to implement a Multi-Function Devices (MFD) driver for it.
The resulting DTS layout would then be something like:
&i2c1 { fpga@10 { compatible = "visioncomponents,vc-mipi-controller"; reg = <0x10>; i2c-mux { compatible = "visioncomponents,vc-mipi-i2c-mux"; i2c@0 { reg = <0>; ov9282: camera-sensor@60 { compatible = "ovti,ov9282"; reg = <0x60>; ... }; }; }; vc_mipi_reg: regulator { compatible = "visioncomponents,vc-mipi-regulator"; }; }; };
Quoted 2 lines
Mark, Laurent, if that's incorrect or otherwise not acceptable, please reach out. Thanks a lot!
You could also simplify it to
&i2c1 {
fpga@10 {
compatible = "visioncomponents,vc-mipi-controller";
reg = <0x10>;
i2c@0 {
reg = <0>;
ov9282: camera-sensor@60 {
compatible = "ovti,ov9282";
reg = <0x60>;
...
};
};
};
};and use a single driver that registers an I2C mux (and instantiate I2C child devices) as well as a regulator, without using the MFD framework. That could reduce the runtime complexity, which would be nice. If you prefer using the MFD framework with more complex bindings I'm not opposed to it though.
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
I've additionally wrote "my Vision Components contact" an email asking for clarification of the I2C bus layout on the modules yesterday. If I get any new information from that path I will of course take it into account.
Thanks a lot, Laurent!
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH RFC 1/2] dt-bindings: regmap: add common schema for no-sequential-read
Quoted 106 lines · Laurent Pinchart
Quoted 83 lines · Richard Leitner
Quoted 42 lines · Laurent Pinchart
Quoted 35 lines · Richard Leitner
Quoted 25 lines · Laurent Pinchart
Quoted 24 lines · Conor Dooley
Quoted 22 lines · Laurent Pinchart
Quoted 8 lines · Richard Leitner
Quoted 7 lines · Mark Brown
Quoted 4 lines · Richard Leitner
@Mark: I understood that if the fpga really intercepts the I2C bus, it should be modelled accordingly in device tree. But what would be the preferred implementation if both devices sit on the same I2C bus, but one is messing up some register reads on purpose?
Quoted 5 lines
Quoted 2 lines
I think we would need to have a coherent understanding and description of the actual issue to know how to describe it.
Understood. I will try to figure out how the hardware is really wired and come back to you.
Based on the information I have received so far, the FPGA is interposed between the host and sensor. It could therefore be modelled in DT as child of the I2C bus and a parent of the sensor.
New version of some of the Vision Components modules have fixed the multi-read bug, so we will still need a property in the FPGA DT node to indicate if the quirk should be activated.
Quoted 8 lines
Quoted 4 lines
Or come up with a compatible for the FPGA DT node that uniquely identifies the revision of the RTL in use.
That's my preference for things that use some custom RTL that aren't configuration parameters.I'm afraid we won't be able to get that information. We have limited visibility on the ecosystem of modules and what the FPGA does in each of them.
Quoted 5 lines
Thanks for the clarification. Should I continue working on this topic (i.e. modelling the FPGA as I2C controller with the sensor as a "subdevice")? Or do you want to take over Laurent? Do you have any other downstream work on the vc-mipi stuff, except the patches in your gitlab repo?
Quoted 3 lines
I'm afraid I won't have time for the time being, as I will soon start my summer holidays. The patches in the git tree you mentioned are all I have.
Ok. Thanks. Then I will give it a try.
I did some more research on that module and it features a Lattice FPGA (LCMXO3LF-1300E) which to all of my measurement intercepts the I2C bus as expected.
As it additionally manages the regulators my approach would be to implement a Multi-Function Devices (MFD) driver for it.
The resulting DTS layout would then be something like:
&i2c1 { fpga@10 { compatible = "visioncomponents,vc-mipi-controller"; reg = <0x10>; i2c-mux { compatible = "visioncomponents,vc-mipi-i2c-mux"; i2c@0 { reg = <0>; ov9282: camera-sensor@60 { compatible = "ovti,ov9282"; reg = <0x60>; ... }; }; }; vc_mipi_reg: regulator { compatible = "visioncomponents,vc-mipi-regulator"; }; }; };Quoted 2 lines
Mark, Laurent, if that's incorrect or otherwise not acceptable, please reach out. Thanks a lot!
You could also simplify it to
&i2c1 { fpga@10 { compatible = "visioncomponents,vc-mipi-controller"; reg = <0x10>; i2c@0 { reg = <0>; ov9282: camera-sensor@60 { compatible = "ovti,ov9282"; reg = <0x60>; ... }; }; }; };
Quoted 5 lines
and use a single driver that registers an I2C mux (and instantiate I2C child devices) as well as a regulator, without using the MFD framework. That could reduce the runtime complexity, which would be nice. If you prefer using the MFD framework with more complex bindings I'm not opposed to it though.
I prefer this version, however I think it becomes problematic because there are different types of child nodes, Richard mentioned regulators plural and even a single regulator I think should have a dedicated node.
Quoted 11 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
I've additionally wrote "my Vision Components contact" an email asking for clarification of the I2C bus layout on the modules yesterday. If I get any new information from that path I will of course take it into account.
Thanks a lot, Laurent!
Signature · 3 lines
Regards, Laurent Pinchart