Re: [PATCH v3 1/1] rtc: ds3232: get SRAM access using NVMEM Framework

From: Alexandre Belloni
Date: Fri Apr 19 2019 - 16:39:44 EST


On 16/04/2019 10:57:54+0000, Han Nandor wrote:
> DS3232 RTC has 236 bytes of persistent memory.
>
> Add RTC SRAM read and write access using
> the NVMEM Framework.
>
> Signed-off-by: Nandor Han <nandor.han@xxxxxxxxxxx>
> ---
>
> Description
> -----------
> Provides DS3232 RTC SRAM access using NVMEM framework.
>
> Testing
> -------
> The test was done on a custom board which contains a
> DS3232 RTC device.
> Kernel Version: 4.14.60 (Just for clarity, the patch is against master)
>
> 1. Verify that SRAM is accessible using NVMEM interface: PASS
> `
> # hexdump /sys/bus/nvmem/devices/ds3232_sram0/nvmem
> 0000000 0000 0000 0000 0000 0000 0000 0000 0000
> *
> 00000e0
> `
> 2. Modify the content.
> `
> # echo testing > /sys/bus/nvmem/devices/ds3232_sram0/nvmem
> #
> `
> 3. Power cycle the board and verify that contents are preserved: PASS
> `
> # hexdump -n 10 -C /sys/bus/nvmem/devices/ds3232_sram0/nvmem
> 00000000 74 65 73 74 69 6e 67 0a 00 00 |testing...|
> 0000000a
> `
>
> Testing on Kernel v5.1.0-rc3
>
> 1. Update `arch/arm/configs/imx_v6_v7_defconfig` to contain
> `CONFIG_RTC_DRV_DS3232=y`
> 2. Verify that building the kernel is successful: PASS
> `
> make ARCH=arm CROSS_COMPILE=arm-linux-gnu- imx_v6_v7_defconfig zImage
> ...
> CC drivers/rtc/rtc-ds3232.o
> ...
> Kernel: arch/arm/boot/zImage is ready
> `
>
> Changes since v1
> ----------------
> - remove the unnecessary header "rtc-core.h"
> - use nvmem_config from the stack
> - configure the nvmem type
> - remove the `of_node` configuration
>
> Changes since v2
> ----------------
> - init unused struct nvmem_cfg members to 0
> - use regmap as private data to nvmem struct
>
> drivers/rtc/rtc-ds3232.c | 40 ++++++++++++++++++++++++++++++++++++++--
> 1 file changed, 38 insertions(+), 2 deletions(-)
>
Applied, thanks.

--
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com