From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751375AbdKVGqZ (ORCPT ); Wed, 22 Nov 2017 01:46:25 -0500 Received: from mx.socionext.com ([202.248.49.38]:54520 "EHLO mx.socionext.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751194AbdKVGqY (ORCPT ); Wed, 22 Nov 2017 01:46:24 -0500 From: "Keiji Hayashibara" To: "'Kunihiko Hayashi'" Cc: "Srinivas Kandagatla" , =?iso-2022-jp?B?WWFtYWRhLCBNYXNhaGlyby8bJEI7M0VEGyhCIBskQj8/OTAbKEI=?= , , , , References: <1511327699-26396-1-git-send-email-hayashi.kunihiko@socionext.com> In-Reply-To: <1511327699-26396-1-git-send-email-hayashi.kunihiko@socionext.com> Subject: RE: [PATCH] nvmem: uniphier: change access unit from 32bit to 8bit Date: Wed, 22 Nov 2017 15:46:19 +0900 Message-ID: <000001d3635d$9a33c9f0$ce9b5dd0$@socionext.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQHTY1DkZtNo5EtRZ02gRfPt0WP5DKMf8//g Content-Language: ja x-securitypolicycheck: OK by SHieldMailChecker v2.5.2 x-shieldmailcheckerpolicyversion: POLICY170302 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reviewed-by: Keiji Hayashibara Thanks. ----- Best Regards, Keiji Hayashibara > -----Original Message----- > From: Kunihiko Hayashi [mailto:hayashi.kunihiko@socionext.com] > Sent: Wednesday, November 22, 2017 2:15 PM > To: Srinivas Kandagatla > Cc: Yamada, Masahiro/山田 真弘 ; Hayashibara, Keiji/林原 啓二 > ; masami.hiramatsu@linaro.org; jaswinder.singh@linaro.org; > linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; Hayashi, Kunihiko/林 邦彦 > > Subject: [PATCH] nvmem: uniphier: change access unit from 32bit to 8bit > > The efuse on UniPhier allows 8bit access according to the specification. > Since bit offset of nvmem is limited to 0-7, it is desiable to change access unit of nvmem to 8bit. > > Signed-off-by: Kunihiko Hayashi > --- > drivers/nvmem/uniphier-efuse.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/nvmem/uniphier-efuse.c b/drivers/nvmem/uniphier-efuse.c index 2bb45c4..fac3122 100644 > --- a/drivers/nvmem/uniphier-efuse.c > +++ b/drivers/nvmem/uniphier-efuse.c > @@ -27,11 +27,11 @@ static int uniphier_reg_read(void *context, > unsigned int reg, void *_val, size_t bytes) { > struct uniphier_efuse_priv *priv = context; > - u32 *val = _val; > + u8 *val = _val; > int offs; > > - for (offs = 0; offs < bytes; offs += sizeof(u32)) > - *val++ = readl(priv->base + reg + offs); > + for (offs = 0; offs < bytes; offs += sizeof(u8)) > + *val++ = readb(priv->base + reg + offs); > > return 0; > } > @@ -53,8 +53,8 @@ static int uniphier_efuse_probe(struct platform_device *pdev) > if (IS_ERR(priv->base)) > return PTR_ERR(priv->base); > > - econfig.stride = 4; > - econfig.word_size = 4; > + econfig.stride = 1; > + econfig.word_size = 1; > econfig.read_only = true; > econfig.reg_read = uniphier_reg_read; > econfig.size = resource_size(res); > -- > 2.7.4