Skip to content

i2c: designware_ic2: Improvements to timing and general cleanup

Simon Glass u-boot 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest23 patches 0 repliesNew
  2. v219 patches 0 repliesSuperseded
  3. v112 patches 0 repliesSuperseded

Changes in v3 from the cover letter

- Fix the address of comp_param1 by adding a gap
- Drop note about moving to driver model
- Use ARRAY_SIZE() for i2c_specs bounds check
- Add new patch with support for fast-plus speed
- Add new patch to move dw_i2c_speed_config to header
- Add new patch to separate out the speed calculation
- Add new patch to do more in the probe() method

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/23i2c: designware_i2c: Add more registersdrivers/i2c/designware_i2c.h+13 -10 replies
2/23i2c: designware_i2c: Don't allow changing IC_CLKdrivers/i2c/designware_i2c.h+0 -20 replies
3/23i2c: designware_i2c: Include clk.h in the header filedrivers/i2c/designware_i2c.c drivers/i2c/designware_i2c.h+2 -10 replies
4/23i2c: designware_i2c: Rename 'max' speed to 'high' speeddrivers/i2c/designware_i2c.c drivers/i2c/designware_i2c.h+9 -90 replies
5/23i2c: designware_i2c: Use an enum for selected speed modedrivers/i2c/designware_i2c.c drivers/i2c/designware_i2c.h+8 -40 replies
6/23i2c: designware_i2c: Use an accurate bus clock instead of MHzdrivers/i2c/designware_i2c.c drivers/i2c/designware_i2c.h+10 -120 replies
7/23i2c: designware_i2c: Bring in the binding filedoc/device-tree-bindings/i2c/i2c-designware.txt+73 -00 replies
8/23i2c: designware_i2c: Read device-tree propertiesdrivers/i2c/designware_i2c.c drivers/i2c/designware_i2c.h drivers/i2c/designware_i2c_pci.c+22 -30 replies
9/23i2c: designware_i2c: Drop scl_sda_cfg parameterdrivers/i2c/designware_i2c.c+8 -60 replies
10/23i2c: designware_i2c: Put hold config in a structdrivers/i2c/designware_i2c.c+55 -270 replies
11/23i2c: designware_i2c: Rewrite timing calculationdrivers/i2c/designware_i2c.c+147 -220 replies
12/23i2c: designware_i2c: Add spike supressiondrivers/i2c/designware_i2c.c drivers/i2c/designware_i2c.h drivers/i2c/designware_i2c_pci.c+13 -10 replies
13/23i2c: Add enums for i2c speed and address sizeinclude/i2c.h+26 -00 replies
14/23i2c: ast_i2c: Update to use standard enums for speeddrivers/i2c/ast_i2c.c drivers/i2c/ast_i2c.h+1 -30 replies
15/23i2c: designware_i2c: Update to use standard enums for speeddrivers/i2c/designware_i2c.c drivers/i2c/designware_i2c.h+5 -180 replies
16/23i2c: kona_i2c: Update to use standard enums for speeddrivers/i2c/kona_i2c.c+11 -170 replies
17/23i2c: omap: Update to use standard enums for speeddrivers/i2c/omap24xx_i2c.c drivers/i2c/omap24xx_i2c.h+1 -51 reply
18/23i2c: stm32: Update to use standard enums for speeddrivers/i2c/stm32f7_i2c.c+16 -270 replies
19/23i2c: Update drivers to use enum for speeddrivers/i2c/exynos_hs_i2c.c drivers/i2c/fsl_i2c.c drivers/i2c/i2c-cdns.c +11 more+32 -260 replies
20/23i2c: designware_i2c: Add support for fast-plus speeddrivers/i2c/designware_i2c.c drivers/i2c/designware_i2c.h+12 -20 replies
21/23i2c: designware_i2c: Move dw_i2c_speed_config to headerdrivers/i2c/designware_i2c.c drivers/i2c/designware_i2c.h+17 -170 replies
22/23i2c: designware_i2c: Separate out the speed calculationdrivers/i2c/designware_i2c.c drivers/i2c/designware_i2c.h+48 -331 reply
22/23i2c: designware_i2c: Separate out the speed calculation+0 -00 replies
23/23i2c: designware_i2c: Do more in the probe() methoddrivers/i2c/designware_i2c.c+8 -80 replies

Reviews trailers per patch

19 of 24 patches have a Reviewed-by or Acked-by.

PatchLey Foon TanJun ChenHeiko SchocherPatrick DelaunaySimon Glass
1/23R-b R-b R-b
2/23R-b
3/23R-b R-b R-b
4/23R-b R-b
5/23R-b R-b
6/23R-b
7/23R-b
8/23R-b
9/23R-b
10/23R-b
11/23R-b
12/23R-b
13/23R-b
14/23R-b
15/23R-b
16/23R-b
17/23R-b R-b R-b
18/23R-b R-b T-b
19/23R-b
20/23
21/23
22/23
22/23
23/23

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v3 thread

Cover letter [PATCH v3 00/23] i2c: designware_ic2: Improvements to timing and general cleanup

This series updates the Designware I2C driver to support reading its timing from the device tree and handling it in units of nanoseconds instead of clock cycles.

A new function converts from nanoseconds to the units used by the I2C controller and makes sure that the requested bus speed is not exceeded. This is more accurate than the existing method.

The series includes a few smaller clean-ups in the same driver.

In addition the v2 series adds enums for i2c speed and updates drivers to use them.

There is currently an existing configuration method used just for a few x86 boards (Baytrail). This method is retained but it should be removed in favour of using the device tree. I have not done this in this series since I am not sure of the timings to use.

Changes in v3:
- Fix the address of comp_param1 by adding a gap
- Drop note about moving to driver model
- Use ARRAY_SIZE() for i2c_specs bounds check
- Add new patch with support for fast-plus speed
- Add new patch to move dw_i2c_speed_config to header
- Add new patch to separate out the speed calculation
- Add new patch to do more in the probe() method

Changes in v2:
- Fix 'previde' typo
- Add a few more clean-up patches for i2c

Simon Glass (23):
i2c: designware_i2c: Add more registers
i2c: designware_i2c: Don't allow changing IC_CLK
i2c: designware_i2c: Include clk.h in the header file
i2c: designware_i2c: Rename 'max' speed to 'high' speed
i2c: designware_i2c: Use an enum for selected speed mode
i2c: designware_i2c: Use an accurate bus clock instead of MHz
i2c: designware_i2c: Bring in the binding file
i2c: designware_i2c: Read device-tree properties
i2c: designware_i2c: Drop scl_sda_cfg parameter
i2c: designware_i2c: Put hold config in a struct
i2c: designware_i2c: Rewrite timing calculation
i2c: designware_i2c: Add spike supression
i2c: Add enums for i2c speed and address size
i2c: ast_i2c: Update to use standard enums for speed
i2c: designware_i2c: Update to use standard enums for speed
i2c: kona_i2c: Update to use standard enums for speed
i2c: omap: Update to use standard enums for speed
i2c: stm32: Update to use standard enums for speed
i2c: Update drivers to use enum for speed
i2c: designware_i2c: Add support for fast-plus speed
i2c: designware_i2c: Move dw_i2c_speed_config to header
i2c: designware_i2c: Separate out the speed calculation
i2c: designware_i2c: Do more in the probe() method

 .../i2c/i2c-designware.txt                    |  73 +++++
 drivers/i2c/ast_i2c.c                         |   2 +-
 drivers/i2c/ast_i2c.h                         |   2 -
 drivers/i2c/designware_i2c.c                  | 300 ++++++++++++++----
 drivers/i2c/designware_i2c.h                  |  73 ++++-
 drivers/i2c/designware_i2c_pci.c              |   4 +-
 drivers/i2c/exynos_hs_i2c.c                   |   5 +-
 drivers/i2c/fsl_i2c.c                         |   3 +-
 drivers/i2c/i2c-cdns.c                        |   2 +-
 drivers/i2c/i2c-uclass.c                      |  12 +-
 drivers/i2c/i2c-uniphier-f.c                  |   2 +-
 drivers/i2c/i2c-uniphier.c                    |   2 +-
 drivers/i2c/imx_lpi2c.c                       |   8 +-
 drivers/i2c/kona_i2c.c                        |  28 +-
 drivers/i2c/mv_i2c.c                          |   4 +-
 drivers/i2c/mvtwsi.c                          |   5 +-
 drivers/i2c/omap24xx_i2c.c                    |   5 +-
 drivers/i2c/omap24xx_i2c.h                    |   4 -
 drivers/i2c/rcar_i2c.c                        |   2 +-
 drivers/i2c/rcar_iic.c                        |   2 +-
 drivers/i2c/s3c24x0_i2c.c                     |   5 +-
 drivers/i2c/sandbox_i2c.c                     |   3 +-
 drivers/i2c/stm32f7_i2c.c                     |  43 +--
 include/i2c.h                                 |  26 ++
 24 files changed, 454 insertions(+), 161 deletions(-)
 create mode 100644 doc/device-tree-bindings/i2c/i2c-designware.txt
Signature · 1 line
2.25.0.341.g760bfbb309-goog