Skip to content

Add Hardware Spinlock class

Benjamin Gaignard u-boot 5 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest4 patches 0 repliesNew
  2. v44 patches 0 repliesSuperseded
  3. v34 patches 0 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v24 patches0 repliesSuperseded
v14 patches0 repliesSuperseded

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4dm: Add Hardware Spinlock classarch/sandbox/dts/test.dts arch/sandbox/include/asm/state.h configs/sandbox_defconfig +10 more+414 -01 reply
2/4clk: stm32: add hardware spinlock clockdrivers/clk/clk_stm32mp1.c+3 -01 reply
3/4hwspinlock: add stm32 hardware spinlock supportarch/arm/dts/stm32mp157c-ed1.dts arch/arm/dts/stm32mp157c.dtsi configs/stm32mp15_basic_defconfig +3 more+116 -01 reply
4/4pinctrl: stm32: make pinctrl use hwspinlockarch/arm/dts/stm32mp157c-ed1.dts drivers/pinctrl/pinctrl_stm32.c+27 -41 reply

Reviews trailers per patch

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

PatchSimon GlassPatrice Chotard
1/4R-b R-b
2/4R-b R-b
3/4R-b R-b
4/4R-b R-b

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

Read the v5 thread

Cover letter [U-Boot] [PATCH v5 0/4] Add Hardware Spinlock class

version 5:
- rebased on top of master branch (patches 1 and 4)

version 4:
- make timeout loop more robust

version 3:
- use dev_get_parent
- add Review-by

version 2:
- use -ETIMEDOUT and -ENOSYS for errors cases
- do not test if ops is valid
- remove useless include
- add a private structure to store base address
- be more verbose in configuration flag description and commit message
- log the error after hwspinlock_get_by_index()

This series add a news class to support hardware spinlock. Hardware spinlock could be used to protect critical sections of code between multi-processors.

The proposed API remain simple with only 3 functions to be called client:
- hwspinlock_get_by_index: get a hardware spinlock by integer index from device-tree node
- hwspinlock_lock_timeout: lock the hardware spinlock
- hwspinlock_unlock: unlock the hardware spinlock

Driver API offert 4 operations:
- of_xlate: translate a client's device-tree (OF) hardware specifier
- lock: lock the hardware spinlock
- unlock: unlock the hardware spinlock
- relax: wait time between two calls to lock operations

Benjamin Gaignard (4):
dm: Add Hardware Spinlock class
clk: stm32: add hardware spinlock clock
hwspinlock: add stm32 hardware spinlock support
pinctrl: stm32: make pinctrl use hwspinlock

 arch/arm/dts/stm32mp157c-ed1.dts        |   8 ++
 arch/arm/dts/stm32mp157c.dtsi           |   9 ++
 arch/sandbox/dts/test.dts               |   4 +
 arch/sandbox/include/asm/state.h        |   1 +
 configs/sandbox_defconfig               |   2 +
 configs/stm32mp15_basic_defconfig       |   2 +
 drivers/Kconfig                         |   2 +
 drivers/Makefile                        |   1 +
 drivers/clk/clk_stm32mp1.c              |   3 +
 drivers/hwspinlock/Kconfig              |  24 ++++++
 drivers/hwspinlock/Makefile             |   7 ++
 drivers/hwspinlock/hwspinlock-uclass.c  | 144 ++++++++++++++++++++++++++++++++
 drivers/hwspinlock/sandbox_hwspinlock.c |  56 +++++++++++++
 drivers/hwspinlock/stm32_hwspinlock.c   |  92 ++++++++++++++++++++
 drivers/pinctrl/pinctrl_stm32.c         |  27 +++++-
 include/dm/uclass-id.h                  |   1 +
 include/hwspinlock.h                    | 140 +++++++++++++++++++++++++++++++
 test/dm/Makefile                        |   1 +
 test/dm/hwspinlock.c                    |  40 +++++++++
 19 files changed, 560 insertions(+), 4 deletions(-)
 create mode 100644 drivers/hwspinlock/Kconfig
 create mode 100644 drivers/hwspinlock/Makefile
 create mode 100644 drivers/hwspinlock/hwspinlock-uclass.c
 create mode 100644 drivers/hwspinlock/sandbox_hwspinlock.c
 create mode 100644 drivers/hwspinlock/stm32_hwspinlock.c
 create mode 100644 include/hwspinlock.h
 create mode 100644 test/dm/hwspinlock.c
Signature · 1 line
2.15.0