mbox series

[0/8] Add RK3588 OTP memory support

Message ID 20230501084401.765169-1-cristian.ciocaltea@collabora.com
Headers show
Series Add RK3588 OTP memory support | expand

Message

Cristian Ciocaltea May 1, 2023, 8:43 a.m. UTC
This patch series adds OTP memory support for Rockchip RK3588 SoC, 
while also providing a few improvements to the existing rockchip-otp 
driver, in addition to converting the bindings to dt-schema.

Cristian Ciocaltea (8):
  dt-bindings: nvmem: Convert rockchip-otp.txt to dt-schema
  dt-bindings: nvmem: rockchip-otp: Add compatible for RK3588
  nvmem: rockchip-otp: Add clocks and reg_read to rockchip_data
  nvmem: rockchip-otp: Generalize rockchip_otp_wait_status()
  nvmem: rockchip-otp: Use devm_reset_control_array_get_exclusive()
  nvmem: rockchip-otp: Improve probe error handling
  nvmem: rockchip-otp: Add support for RK3588
  arm64: dts: rockchip: Add rk3588 OTP node

 .../bindings/nvmem/rockchip-otp.txt           |  25 ---
 .../bindings/nvmem/rockchip-otp.yaml          | 132 ++++++++++++
 arch/arm64/boot/dts/rockchip/rk3588s.dtsi     |  54 +++++
 drivers/nvmem/rockchip-otp.c                  | 191 +++++++++++++-----
 4 files changed, 330 insertions(+), 72 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/nvmem/rockchip-otp.txt
 create mode 100644 Documentation/devicetree/bindings/nvmem/rockchip-otp.yaml

Comments

Cristian Ciocaltea May 2, 2023, 12:40 p.m. UTC | #1
On 5/2/23 11:26, Vincent Legoll wrote:
> Hello,
> 
> On Mon, May 1, 2023 at 8:44 AM Cristian Ciocaltea
> <cristian.ciocaltea@collabora.com> wrote:
>> This patch series adds OTP memory support for Rockchip RK3588 SoC,
>> while also providing a few improvements to the existing rockchip-otp
>> driver, in addition to converting the bindings to dt-schema.
> 
> I tested this on a QuartzPro64 dev board, I applied your series top of my tree:
> Collabora's rk3588-v6.3 + some DT patches to add support for the qp64 board.
> 
> Here is the output from the commands you told me to try:
> 
> # ls -1 /sys/bus/nvmem/devices/*/nvmem
> /sys/bus/nvmem/devices/rockchip-otp0/nvmem
> 
> #  od -N 64 -A x -t x1z -v /sys/bus/nvmem/devices/rockchip-otp0/nvmem
> 000000 52 4b 35 88 91 fe 21 41 5a 43 39 36 00 00 00 00  >RK5...!AZC96....<
> 000010 00 00 00 00 0f 0b 0d 0a 0a 0c 25 0e 00 00 00 00  >..........%.....<
> 000020 00 00 00 00 00 00 00 00 08 0c 00 00 00 00 00 00  >................<
> 000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  >................<
> 000040
> 
> This is working as expected.
> 
> You can add my T-B, for the whole series:
> 
> Tested-by: Vincent Legoll <vincent.legoll@gmail.com>

Thanks for testing!

Regards,
Cristian
Cristian Ciocaltea May 2, 2023, 12:49 p.m. UTC | #2
On 5/2/23 11:47, Heiko Stübner wrote:
> Am Montag, 1. Mai 2023, 10:43:55 CEST schrieb Cristian Ciocaltea:
>> In preparation to support new Rockchip OTP memory devices with different
>> clock configurations and register layout, extend rockchip_data struct
>> with the related members: clocks, num_clks, reg_read.
>>
>> Additionally, to avoid managing redundant driver data, drop num_clks
>> member from rockchip_otp struct and update all references to point to
>> the equivalent member in rockchip_data.
>>
>> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
>> ---
>>  drivers/nvmem/rockchip-otp.c | 79 ++++++++++++++++++++++--------------
>>  1 file changed, 49 insertions(+), 30 deletions(-)
>>
>> diff --git a/drivers/nvmem/rockchip-otp.c b/drivers/nvmem/rockchip-otp.c
>> index 9f53bcce2f87..a5b234e60735 100644
>> --- a/drivers/nvmem/rockchip-otp.c
>> +++ b/drivers/nvmem/rockchip-otp.c
>> @@ -54,21 +54,19 @@
>>  
>>  #define OTPC_TIMEOUT			10000
>>  
>> +struct rockchip_data {
>> +	int size;
>> +	const char * const *clocks;
>> +	int num_clks;
> 
> nit: might be nice to use either "clocks" or "clks" as part for both names

Indeed, will handle this in v2.

> other than that
> Reviewed-by: Heiko Stuebner <heiko@sntech.de>

Thanks,
Cristian