Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2171803yba; Fri, 19 Apr 2019 13:41:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqyBzUapWlACjpgeLuDaZzHCIq5mD9ll8yQ+2TxAIclF254Q58reNR8OZBBziTDypZn6lvz4 X-Received: by 2002:a62:6e05:: with SMTP id j5mr6084021pfc.5.1555706475792; Fri, 19 Apr 2019 13:41:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555706475; cv=none; d=google.com; s=arc-20160816; b=cFd992EQkTuP9d/28G/9YzyXT4HwEZ7t8BwxfM5AY2a8CBdoSQIX56eUeMlqiJl82T 5nlBpiiBMyfLb+X8O72EGPZ70T5Ro6vVEkSPGqwDg3SyD6ho/bhh4CSkcL3d7SHcx52a oV0qoFGUVUokJbnO/8yG7Ph9nF79k37Z0guYn/hdpuAtyOXvvimC7uuwERhDr+kVWXNH 7DG79+d0Thz5Lq26Vh0tNbYbkndM6zWqAibZRzq0EWaSmtB2GBq3iVLzxRNSuXqHAjkZ eWov5ji1XfTiwuFpmaGmtwpAP8WiaieAxtpX/XtcDvMGqygXp4e66bK+GUpDPi2RBKMg x+gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=cw6bh2fxqSE6QrJJ9OxyruqxJRzZ3gJCYa7Tc5dvqr8=; b=iuaHlrd6mCcWAf5h/HPEIcf7mJ1otNpnvFCkc6CNQP+uUX2aRqGyP+IG0zWtJ2GqIm fFPEcUpoxZPlm3n79cbae9NaHpYF68VRzO6s6IBXDg77CYatjHtKH9PSnOYrnhvh20bA F2PsULUS+1sQyKMwlKBbO4sctKsNJQXCnYg8ZGXwQHBvg2LuXVGu8h+azRQuxNwRTQxN 22ZkPDEQf3kmN9CXPrZnBZ2V6Q76uizIismTVLx9EAt5ZKIFXUgy4Kk4Wc+HXEKb80e9 2xmruQMfjvys5Gxj/FrkCEk6dQ63KApL6md9aoqrdZbYkwTb4CfTG7wh5V9K9kfofEFB RrBw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q8si5578145pgp.480.2019.04.19.13.40.59; Fri, 19 Apr 2019 13:41:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727138AbfDSUjm (ORCPT + 99 others); Fri, 19 Apr 2019 16:39:42 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:36467 "EHLO relay6-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725897AbfDSUjm (ORCPT ); Fri, 19 Apr 2019 16:39:42 -0400 X-Originating-IP: 90.66.53.80 Received: from localhost (lfbn-1-3034-80.w90-66.abo.wanadoo.fr [90.66.53.80]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 6E203C0009; Fri, 19 Apr 2019 20:39:39 +0000 (UTC) Date: Fri, 19 Apr 2019 22:39:39 +0200 From: Alexandre Belloni To: Han Nandor Cc: "a.zummo@towertech.it" , "linux-rtc@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v3 1/1] rtc: ds3232: get SRAM access using NVMEM Framework Message-ID: <20190419203939.GG12992@piout.net> References: <33e0d0d0764c8606dc611721c8c5abe37678675a> <20190416105741.11895-1-nandor.han@vaisala.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190416105741.11895-1-nandor.han@vaisala.com> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > > 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