* [PATCH] nvmem: uniphier: change access unit from 32bit to 8bit
@ 2017-11-22 5:14 ` Kunihiko Hayashi
0 siblings, 0 replies; 10+ messages in thread
From: Kunihiko Hayashi @ 2017-11-22 5:14 UTC (permalink / raw)
To: Srinivas Kandagatla
Cc: Masahiro Yamada, hayashibara.keiji, masami.hiramatsu,
jaswinder.singh, linux-arm-kernel, linux-kernel,
Kunihiko Hayashi
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 <hayashi.kunihiko@socionext.com>
---
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
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH] nvmem: uniphier: change access unit from 32bit to 8bit
@ 2017-11-22 5:14 ` Kunihiko Hayashi
0 siblings, 0 replies; 10+ messages in thread
From: Kunihiko Hayashi @ 2017-11-22 5:14 UTC (permalink / raw)
To: linux-arm-kernel
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 <hayashi.kunihiko@socionext.com>
---
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
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] nvmem: uniphier: change access unit from 32bit to 8bit
2017-11-22 5:14 ` Kunihiko Hayashi
@ 2017-11-22 6:21 ` Masahiro Yamada
-1 siblings, 0 replies; 10+ messages in thread
From: Masahiro Yamada @ 2017-11-22 6:21 UTC (permalink / raw)
To: Kunihiko Hayashi
Cc: Srinivas Kandagatla, Keiji Hayashibara, Masami Hiramatsu,
Jassi Brar, linux-arm-kernel, Linux Kernel Mailing List
2017-11-22 14:14 GMT+09:00 Kunihiko Hayashi <hayashi.kunihiko@socionext.com>:
> 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 <hayashi.kunihiko@socionext.com>
Tested on LD4, sLD8, Pro4, PXs2, LD11, LD20, and PXs3.
All worked for me.
Tested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Thanks.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] nvmem: uniphier: change access unit from 32bit to 8bit
@ 2017-11-22 6:21 ` Masahiro Yamada
0 siblings, 0 replies; 10+ messages in thread
From: Masahiro Yamada @ 2017-11-22 6:21 UTC (permalink / raw)
To: linux-arm-kernel
2017-11-22 14:14 GMT+09:00 Kunihiko Hayashi <hayashi.kunihiko@socionext.com>:
> 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 <hayashi.kunihiko@socionext.com>
Tested on LD4, sLD8, Pro4, PXs2, LD11, LD20, and PXs3.
All worked for me.
Tested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Thanks.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [PATCH] nvmem: uniphier: change access unit from 32bit to 8bit
2017-11-22 5:14 ` Kunihiko Hayashi
@ 2017-11-22 6:46 ` Keiji Hayashibara
-1 siblings, 0 replies; 10+ messages in thread
From: Keiji Hayashibara @ 2017-11-22 6:46 UTC (permalink / raw)
To: 'Kunihiko Hayashi'
Cc: Srinivas Kandagatla, Yamada,
Masahiro/山田 真弘,
masami.hiramatsu, jaswinder.singh, linux-arm-kernel,
linux-kernel
Reviewed-by: Keiji Hayashibara <hayashibara.keiji@socionext.com>
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 <srinivas.kandagatla@linaro.org>
> Cc: Yamada, Masahiro/山田 真弘 <yamada.masahiro@socionext.com>; Hayashibara, Keiji/林原 啓二
> <hayashibara.keiji@socionext.com>; masami.hiramatsu@linaro.org; jaswinder.singh@linaro.org;
> linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; Hayashi, Kunihiko/林 邦彦
> <hayashi.kunihiko@socionext.com>
> 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 <hayashi.kunihiko@socionext.com>
> ---
> 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
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] nvmem: uniphier: change access unit from 32bit to 8bit
@ 2017-11-22 6:46 ` Keiji Hayashibara
0 siblings, 0 replies; 10+ messages in thread
From: Keiji Hayashibara @ 2017-11-22 6:46 UTC (permalink / raw)
To: linux-arm-kernel
Reviewed-by: Keiji Hayashibara <hayashibara.keiji@socionext.com>
Thanks.
-----
Best Regards,
Keiji Hayashibara
> -----Original Message-----
> From: Kunihiko Hayashi [mailto:hayashi.kunihiko at socionext.com]
> Sent: Wednesday, November 22, 2017 2:15 PM
> To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> Cc: Yamada, Masahiro/?? ?? <yamada.masahiro@socionext.com>; Hayashibara, Keiji/?? ??
> <hayashibara.keiji@socionext.com>; masami.hiramatsu at linaro.org; jaswinder.singh at linaro.org;
> linux-arm-kernel at lists.infradead.org; linux-kernel at vger.kernel.org; Hayashi, Kunihiko/? ??
> <hayashi.kunihiko@socionext.com>
> 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 <hayashi.kunihiko@socionext.com>
> ---
> 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
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] nvmem: uniphier: change access unit from 32bit to 8bit
2017-11-22 5:14 ` Kunihiko Hayashi
@ 2017-12-13 9:31 ` Kunihiko Hayashi
-1 siblings, 0 replies; 10+ messages in thread
From: Kunihiko Hayashi @ 2017-12-13 9:31 UTC (permalink / raw)
To: Srinivas Kandagatla
Cc: Masahiro Yamada, hayashibara.keiji, masami.hiramatsu,
jaswinder.singh, linux-arm-kernel, linux-kernel
Hello Srinivas,
This patch was already reviewed and tested for all UniPhier SoCs:
https://patchwork.kernel.org/patch/10069557/
Do you have any comments, or would you please pick it up?
Thank you,
On Wed, 22 Nov 2017 14:14:59 +0900 Kunihiko Hayashi <hayashi.kunihiko@socionext.com> wrote:
> 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 <hayashi.kunihiko@socionext.com>
> ---
> 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
---
Best Regards,
Kunihiko Hayashi
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] nvmem: uniphier: change access unit from 32bit to 8bit
@ 2017-12-13 9:31 ` Kunihiko Hayashi
0 siblings, 0 replies; 10+ messages in thread
From: Kunihiko Hayashi @ 2017-12-13 9:31 UTC (permalink / raw)
To: linux-arm-kernel
Hello Srinivas,
This patch was already reviewed and tested for all UniPhier SoCs:
https://patchwork.kernel.org/patch/10069557/
Do you have any comments, or would you please pick it up?
Thank you,
On Wed, 22 Nov 2017 14:14:59 +0900 Kunihiko Hayashi <hayashi.kunihiko@socionext.com> wrote:
> 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 <hayashi.kunihiko@socionext.com>
> ---
> 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
---
Best Regards,
Kunihiko Hayashi
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] nvmem: uniphier: change access unit from 32bit to 8bit
2017-12-13 9:31 ` Kunihiko Hayashi
@ 2017-12-13 9:36 ` Srinivas Kandagatla
-1 siblings, 0 replies; 10+ messages in thread
From: Srinivas Kandagatla @ 2017-12-13 9:36 UTC (permalink / raw)
To: Kunihiko Hayashi
Cc: Masahiro Yamada, hayashibara.keiji, masami.hiramatsu,
jaswinder.singh, linux-arm-kernel, linux-kernel
On 13/12/17 09:31, Kunihiko Hayashi wrote:
> Hello Srinivas,
>
> This patch was already reviewed and tested for all UniPhier SoCs:
> https://patchwork.kernel.org/patch/10069557/
>
> Do you have any comments, or would you please pick it up?
Thanks for your patience,
I will send it along with other fixes to Greg Sometime this week!
Rgrds,
Srini
>
> Thank you,
>
> On Wed, 22 Nov 2017 14:14:59 +0900 Kunihiko Hayashi <hayashi.kunihiko@socionext.com> wrote:
>
>> 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 <hayashi.kunihiko@socionext.com>
>> ---
>> 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
>
> ---
> Best Regards,
> Kunihiko Hayashi
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] nvmem: uniphier: change access unit from 32bit to 8bit
@ 2017-12-13 9:36 ` Srinivas Kandagatla
0 siblings, 0 replies; 10+ messages in thread
From: Srinivas Kandagatla @ 2017-12-13 9:36 UTC (permalink / raw)
To: linux-arm-kernel
On 13/12/17 09:31, Kunihiko Hayashi wrote:
> Hello Srinivas,
>
> This patch was already reviewed and tested for all UniPhier SoCs:
> https://patchwork.kernel.org/patch/10069557/
>
> Do you have any comments, or would you please pick it up?
Thanks for your patience,
I will send it along with other fixes to Greg Sometime this week!
Rgrds,
Srini
>
> Thank you,
>
> On Wed, 22 Nov 2017 14:14:59 +0900 Kunihiko Hayashi <hayashi.kunihiko@socionext.com> wrote:
>
>> 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 <hayashi.kunihiko@socionext.com>
>> ---
>> 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
>
> ---
> Best Regards,
> Kunihiko Hayashi
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2017-12-13 9:36 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-22 5:14 [PATCH] nvmem: uniphier: change access unit from 32bit to 8bit Kunihiko Hayashi
2017-11-22 5:14 ` Kunihiko Hayashi
2017-11-22 6:21 ` Masahiro Yamada
2017-11-22 6:21 ` Masahiro Yamada
2017-11-22 6:46 ` Keiji Hayashibara
2017-11-22 6:46 ` Keiji Hayashibara
2017-12-13 9:31 ` Kunihiko Hayashi
2017-12-13 9:31 ` Kunihiko Hayashi
2017-12-13 9:36 ` Srinivas Kandagatla
2017-12-13 9:36 ` Srinivas Kandagatla
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.