Align U-Boot I2C DM bus ID handling with Linux
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest posting 5/50 of 7 patches 0 repliesNew
- v2 posting 4/50 of 7 patches 0 repliesSuperseded
- v2 posting 3/50 of 7 patches 0 repliesSuperseded
Earlier versions · 3
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 posting 2/5 | 0 of 7 patches | 0 replies | Superseded | |
| v2 posting 1/5 | 7 patches | 0 replies | Superseded | |
| v1 | 4 patches | 0 replies | Superseded |
Patches in v2 posting 5/5 No applies recorded yet
None of the 7 patches the cover letter announces are in this archive.
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [U-Boot] [PATCH v2 0/7] Align U-Boot I2C DM bus ID handling with Linux
Quoted 145 lines · Heiko Schocher
Hello Michal,
Am 11.02.2019 um 07:58 schrieb Michal Simek:
Quoted 142 lines · Heiko Schocher
Quoted 141 lines
Hello Michal,
Am 08.02.2019 um 12:24 schrieb Michal Simek:
Quoted 116 lines · Michal Simek
Quoted 115 lines · Heiko Schocher
Quoted 83 lines
Hello Michael,
Am 31.01.2019 um 16:30 schrieb Michal Simek:
Quoted 77 lines
U-Boot with
I2C_DMenabled is not capable to list i2c busses connected
to i2c mux. For getting this work there is a need to find out highest
alias ID and use this uniq number for new buses connected to I2C mux.
This series is making this happen.There is only one missing piece which is that also i2c controllers which
are not listed in DT are not using this feature.Removing setting up aliases from i2c mux code and unifying it in the same code ensures that numbering schema is proper if no alias is specified.
ZynqMP> i2c bus
Bus 0: i2c atff020000
20: gpio at 20, offset len 1, flags 0
21: gpio at 21, offset len 1, flags 0
75: i2c-mux at 75, offset len 1, flags 0
Bus 1: i2c at ff020000->i2c-mux at 75->i2c at 0 Bus 2: i2c at ff020000->i2c-mux at 75->i2c at 1 Bus 3: i2c at ff020000->i2c-mux at 75->i2c at 2 Bus 4: i2c at ff030000 (active 4)
74: i2c-mux at 74, offset len 1, flags 0
75: i2c-mux at 75, offset len 1, flags 0
Bus 5: i2c at ff030000->i2c-mux at 74->i2c at 0 (active 5) 54: eeprom at 54, offset len 1, flags 0
Bus 6: i2c at ff030000->i2c-mux at 74->i2c at 1 Bus 7: i2c at ff030000->i2c-mux at 74->i2c at 2 Bus 8: i2c at ff030000->i2c-mux at 74->i2c at 3 Bus 9: i2c at ff030000->i2c-mux at 74->i2c at 4 Bus 10: i2c at ff030000->i2c-mux at 75->i2c at 0 Bus 11: i2c at ff030000->i2c-mux at 75->i2c at 1 Bus 12: i2c at ff030000->i2c-mux at 75->i2c at 2 Bus 13: i2c at ff030000->i2c-mux at 75->i2c at 3 Bus 14: i2c at ff030000->i2c-mux at 75->i2c at 4 Bus 15: i2c at ff030000->i2c-mux at 75->i2c at 5 Bus 16: i2c at ff030000->i2c-mux at 75->i2c at 6 Bus 17: i2c at ff030000->i2c-mux at 75->i2c at 7Thanks,
MichalChanges in v2:
- Update kernel-doc binding
- Return -1 in case of error. -1 means that the next free alias is 0.
- New patch
- New patch
- Usedev_read_alias_highest_id()
- Use uclass private data
- Use private uclass data
- Fix headers
- Change patch description to focus only on bus nameMichal Simek (7):
dm: core: Addof_alias_get_highest_id()
fdt: Introducefdtdec_get_alias_highest_id()
dm: core: Introducedev_read_alias_highest_id()
dm: core: Add tests fordev_read_alias_highest_id()
i2c: dm: Record maximum id of devices before probing devices
i2c: Fillreq_seqini2c_post_bind()
i2c: mux: Generate longer i2c mux namedrivers/core/of_access.c | 18 ++++++++++++++ drivers/core/read.c | 8 ++++++ drivers/i2c/i2c-uclass.c | 50
+++++++++++++++++++++++++++++++++++---
drivers/i2c/muxes/i2c-mux-uclass.c| 29 +++++++++++++++++++--- include/dm/of_access.h | 10 ++++++++ include/dm/read.h | 16 ++++++++++++ include/fdtdec.h | 13 ++++++++++ lib/fdtdec.c | 33
+++++++++++++++++++++++++
test/dm/test-fdt.c | 23 ++++++++++++++++++Quoted 2 lines
9 files changed, 194 insertions(+), 6 deletions(-)Quoted 8 lines
I just applied your patches and triggered a build on travis:
It shows error for omap boards:
https://travis-ci.org/hsdenx/u-boot-i2c/jobs/490393822
I try to find time to look into it, but may you have time too?
This should be the fix. (I tried that on
omap35_logic_somlv_defconfig)drivers/i2c/i2c-uclass.c +4
-0@@ -655,8 +655,12 @@ int i2c_uclass_init(struct uclass *class) if (!priv) return -ENOMEM; +#if CONFIG_IS_ENABLED (OF_CONTROL ) /* Get the last allocated alias. */ priv->max_id = dev_read_alias_highest_id("i2c"); +#else + priv->max_id = -1; +#endif debug("%s: highest alias id is %d\n", __func__, priv->max_id);Quoted 6 lines
Quoted 3 lines
SPL has no
OF_CONTROLand also no LIBFDT that's why it is trying to call
it.:-) that sentence doesn't make sense. Correction:
...that's why it shouldn't be called.;-)
Quoted 10 lines
Maybe it should be enough to have dependency on
OF_LIBFDTbutKconfigis
saying thatOF_LIBFDTis bool setup to y whenOF_CONTROLis enabled. And inMakefilefdtdec is enabledobj-$(CONFIG_$(SPL_TPL_)OF_CONTROL) += fdtdec.o
or just
obj-$(CONFIG_OF_LIBFDT) += fdtdec.oAnyway it should be likely enough to have dependency just on
OF_LIBFDT.Ok, do you want to send a v3 of the patch:
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
dm: core: Add
of_alias_get_highest_id()or is it OK for you, if I add the above fix to this patch directly?
Please take it directly.
Ok, done. If all builds fine now, I make a pull request for Tom, thanks!
great.
Thanks.
Michal