Skip to content

drivers: Add a framework for MUX drivers

Pratyush Yadav u-boot 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest7 patches 0 repliesNew
  2. v36 patches 0 repliesSuperseded

Changes in v4 from the cover letter

- Drop the call to sandbox_set_enable_memio(). Use an emulated mux driver to test the default state instead.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7drivers: Add a new framework for multiplexer devicesdrivers/Kconfig drivers/Makefile drivers/mux/Kconfig +6 more+605 -01 reply
2/7dm: board: complete the initialization of the muxes in initr_dm()common/board_r.c drivers/mux/mux-uclass.c include/mux.h+47 -01 reply
3/7drivers: mux: mmio-based syscon mux controllerdrivers/mux/Kconfig drivers/mux/Makefile drivers/mux/mmio.c+156 -01 reply
4/7Kconfig: Increase the pre-relocation memoryKconfig+1 -12 replies
5/7test: Add tests for the multiplexer frameworkarch/sandbox/dts/test.dts configs/sandbox_defconfig test/dm/Makefile +2 more+280 -02 replies
6/7cmd: Add a mux commandcmd/Kconfig cmd/Makefile cmd/mux.c+190 -02 replies
7/7test: mux-cmd: Add tests for the 'mux' commandconfigs/sandbox_defconfig test/dm/Makefile test/dm/mux-cmd.c+179 -02 replies

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by.

PatchSimon Glass
1/7R-b
2/7R-b
3/7R-b
4/7R-b
5/7R-b
6/7R-b
7/7R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/7] drivers: Add a framework for MUX drivers

Hi,

This series is a re-roll of Jean-Jacques' earlier effort. It adds a new minimalistic subsystem that handles multiplexer controllers. It provides the same API as Linux and mux drivers should be portable with a minimum effort. This series also includes a port of the Linux's mmio-mux driver and an emulated mux driver for sandbox testing.

Travis CI run: https://travis-ci.org/github/prati0100/uboot/builds/736133605

Changes in v4:
- Drop the call to sandbox_set_enable_memio(). Use an emulated mux driver to test the default state instead.

Other changes are mentioned in individual patches.

Changes in v3:
- Add a new command called 'mux' that allows listing, selecting, and deselecting muxes on the fly.
- Move call to dm_mux_init() to initr_dm_devices().
- Enable mmio operations in sandbox on board_init() to dm_mux_init() can initialize muxes to their idle state and allow the tests to pass.
- Add help for CONFIG_MULTIPLEXER.
- Change dev_err() in mmio_mux_probe() to log_msg_ret() or log_err().
- Add comments on static functions in mux-class.c
- Make mux_uclass_post_probe() static.
- Make dm_mux_init() return an integer to signal failure.
- Change ifdef of mux-internal.h to _HUX_INTERNAL_H.
- Remove unused include from mux-internal.h
- Remove comments for non-existent members in struct mux_chip.
- Add missing comments for some members in struct mux_control.
- Add missing comments for some functions in mux.h
- Split up the mux_mmio test into two parts. More would lead to a lot of boilerplate.
- Change ut_assertok(IS_ERR(ptr)) to ut_assertok_ptr(ptr).
- Fix mis-spellings and capitalize comments.
- Rebase on latest master.

Changes in v2:
- Fixed warning in mux_of_xlate_default()
- Improved documentation
- Fixed SPL build
- insert the mux initialization in init_sequence_r[], just before the console is initialized as its serial port may be muxed
- moved the definition of dm_mux_init() in this commit
- Call sandbox_set_enable_memio(true) before running the test

Jean-Jacques Hiblot (4):
drivers: Add a new framework for multiplexer devices
dm: board: complete the initialization of the muxes in initr_dm()
drivers: mux: mmio-based syscon mux controller
test: Add tests for the multiplexer framework

Pratyush Yadav (3):
Kconfig: Increase the pre-relocation memory
cmd: Add a mux command
test: mux-cmd: Add tests for the 'mux' command

 Kconfig                       |   2 +-
 arch/sandbox/dts/test.dts     |  33 ++++
 cmd/Kconfig                   |   6 +
 cmd/Makefile                  |   1 +
 cmd/mux.c                     | 183 +++++++++++++++++++
 common/board_r.c              |  12 ++
 configs/sandbox_defconfig     |   3 +
 drivers/Kconfig               |   2 +
 drivers/Makefile              |   1 +
 drivers/mux/Kconfig           |  25 +++
 drivers/mux/Makefile          |   7 +
 drivers/mux/mmio.c            | 141 ++++++++++++++
 drivers/mux/mux-uclass.c      | 334 ++++++++++++++++++++++++++++++++++
 include/dm/uclass-id.h        |   1 +
 include/dt-bindings/mux/mux.h |  17 ++
 include/mux-internal.h        | 109 +++++++++++
 include/mux.h                 | 159 ++++++++++++++++
 test/dm/Makefile              |   3 +
 test/dm/mux-cmd.c             | 177 ++++++++++++++++++
 test/dm/mux-emul.c            | 105 +++++++++++
 test/dm/mux-mmio.c            | 138 ++++++++++++++
 21 files changed, 1458 insertions(+), 1 deletion(-)
 create mode 100644 cmd/mux.c
 create mode 100644 drivers/mux/Kconfig
 create mode 100644 drivers/mux/Makefile
 create mode 100644 drivers/mux/mmio.c
 create mode 100644 drivers/mux/mux-uclass.c
 create mode 100644 include/dt-bindings/mux/mux.h
 create mode 100644 include/mux-internal.h
 create mode 100644 include/mux.h
 create mode 100644 test/dm/mux-cmd.c
 create mode 100644 test/dm/mux-emul.c
 create mode 100644 test/dm/mux-mmio.c

--
2.28.0