[PATCH v2 00/12] rockchip: Add efuse and otp support to more SoCs

Jonas Karlman jonas at kwiboo.se
Wed Feb 22 23:44:38 CET 2023


This series refactors and add support for more SoCs to the rockchip
efuse and otp driver.

Support is added for the following SoCs:
- efuse: RK3036, RK3066, RK3128, RK3188, RK3228, RK3288 and RK3328
- otp: RK3568 and RK3588

This also changes so that eth1addr is also set along with ethaddr.
And a small change so that ethernet mac addresses is set based on
CONFIG_HASH and CONFIG_SHA256 instead of CONFIG_CMD_NET.

I have only been able to test the efuse driver on RK3288, RK3328, RK3399
and the otp driver on RK3568 and RK3588. Information on the remaining
SoCs is based on information at [1], [2] and in TRM.

Alex Bee found and fixed an issue on RK3188 and RK3128, fix is included
in v2, thanks!

The last patches enables use of the otp driver for RK3568 and RK3588.
To handle the unique cpuid offset used on RK3568 a new const
CFG_CPUID_OFFSET was added.

Ideally, we should get this cpuid offset from the id node in the fdt.
Something that can be improved in a future series.

This series can also be found at [3].

Changes in v2:
- Use readl instead of readb/readw (Alex Bee)
- Always set eth1addr (Chen-Yu Tsai)
- Collect r-b tags
- Add patch to enable read of cpuid on rk3588

[1] https://github.com/rockchip-linux/kernel/blob/release-3.10/arch/arm/mach-rockchip/efuse.c
[2] https://github.com/rockchip-linux/kernel/blob/develop-5.10/drivers/nvmem/rockchip-otp.c
[2] https://github.com/Kwiboo/u-boot-rockchip/commits/rk3568-efuse-otp

Jonas Karlman (12):
  rockchip: otp: Refactor to use driver data and ops
  rockchip: otp: Add support for RK3568
  rockchip: otp: Add support for RK3588
  rockchip: otp: Add dump_otp debug command
  rockchip: efuse: Refactor to use driver data and ops
  rockchip: efuse: Add support for RK3288 and more
  rockchip: efuse: Add support for RK3328
  rockchip: efuse: Add support for RK3128
  rockchip: efuse: Add support for RK3036
  rockchip: misc: Set eth1addr mac address
  rockchip: rk3568: Read cpuid from otp
  rockchip: rk3588: Read cpuid from otp

 arch/arm/dts/rk356x-u-boot.dtsi   |  12 ++
 arch/arm/dts/rk3588s-u-boot.dtsi  |  12 ++
 arch/arm/mach-rockchip/Kconfig    |   4 +
 arch/arm/mach-rockchip/board.c    |   2 +-
 arch/arm/mach-rockchip/misc.c     |   6 +-
 drivers/misc/Kconfig              |   4 -
 drivers/misc/rockchip-efuse.c     | 333 +++++++++++++++++++++++-------
 drivers/misc/rockchip-otp.c       | 230 +++++++++++++++++----
 include/configs/rk3568_common.h   |   2 +
 include/configs/rockchip-common.h |   4 +
 10 files changed, 491 insertions(+), 118 deletions(-)

-- 
2.39.2



More information about the U-Boot mailing list