* [PATCH 1/1] mtd: cfi_flash: use __raw_writeq(), __raw_readq()
@ 2020-06-06 21:13 Heinrich Schuchardt
2020-06-07 18:42 ` Heinrich Schuchardt
0 siblings, 1 reply; 5+ messages in thread
From: Heinrich Schuchardt @ 2020-06-06 21:13 UTC (permalink / raw)
To: u-boot
Functions __raw_writeq(), __raw_readq() are available for all
architectures. So let's use them.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
drivers/mtd/cfi_flash.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index b7289ba539..e31e07ca80 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -155,8 +155,7 @@ __maybe_weak void flash_write32(u32 value, void *addr)
__maybe_weak void flash_write64(u64 value, void *addr)
{
- /* No architectures currently implement __raw_writeq() */
- *(volatile u64 *)addr = value;
+ __raw_writeq(value, addr);
}
__maybe_weak u8 flash_read8(void *addr)
@@ -176,8 +175,7 @@ __maybe_weak u32 flash_read32(void *addr)
__maybe_weak u64 flash_read64(void *addr)
{
- /* No architectures currently implement __raw_readq() */
- return *(volatile u64 *)addr;
+ return __raw_readq(addr);
}
/*-----------------------------------------------------------------------
--
2.26.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 1/1] mtd: cfi_flash: use __raw_writeq(), __raw_readq()
2020-06-06 21:13 [PATCH 1/1] mtd: cfi_flash: use __raw_writeq(), __raw_readq() Heinrich Schuchardt
@ 2020-06-07 18:42 ` Heinrich Schuchardt
2020-06-08 7:07 ` Stefan Roese
0 siblings, 1 reply; 5+ messages in thread
From: Heinrich Schuchardt @ 2020-06-07 18:42 UTC (permalink / raw)
To: u-boot
On 6/6/20 11:13 PM, Heinrich Schuchardt wrote:
> Functions __raw_writeq(), __raw_readq() are available for all
> architectures. So let's use them.
The major architectures have these but not m68k, microblaze, nd32,
nios2, powerpc, sh, xtenza.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
> drivers/mtd/cfi_flash.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
> index b7289ba539..e31e07ca80 100644
> --- a/drivers/mtd/cfi_flash.c
> +++ b/drivers/mtd/cfi_flash.c
> @@ -155,8 +155,7 @@ __maybe_weak void flash_write32(u32 value, void *addr)
>
> __maybe_weak void flash_write64(u64 value, void *addr)
> {
> - /* No architectures currently implement __raw_writeq() */
> - *(volatile u64 *)addr = value;
> + __raw_writeq(value, addr);
> }
>
> __maybe_weak u8 flash_read8(void *addr)
> @@ -176,8 +175,7 @@ __maybe_weak u32 flash_read32(void *addr)
>
> __maybe_weak u64 flash_read64(void *addr)
> {
> - /* No architectures currently implement __raw_readq() */
> - return *(volatile u64 *)addr;
> + return __raw_readq(addr);
> }
>
> /*-----------------------------------------------------------------------
> --
> 2.26.2
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/1] mtd: cfi_flash: use __raw_writeq(), __raw_readq()
2020-06-07 18:42 ` Heinrich Schuchardt
@ 2020-06-08 7:07 ` Stefan Roese
2020-06-08 7:12 ` Heinrich Schuchardt
0 siblings, 1 reply; 5+ messages in thread
From: Stefan Roese @ 2020-06-08 7:07 UTC (permalink / raw)
To: u-boot
On 07.06.20 20:42, Heinrich Schuchardt wrote:
> On 6/6/20 11:13 PM, Heinrich Schuchardt wrote:
>> Functions __raw_writeq(), __raw_readq() are available for all
>> architectures. So let's use them.
>
> The major architectures have these but not m68k, microblaze, nd32,
> nios2, powerpc, sh, xtenza.
Just checking to be clear: This patch breaks compiling on these
platforms and you are withdrawing it (for now)?
Thanks,
Stefan
>>
>> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>> ---
>> drivers/mtd/cfi_flash.c | 6 ++----
>> 1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
>> index b7289ba539..e31e07ca80 100644
>> --- a/drivers/mtd/cfi_flash.c
>> +++ b/drivers/mtd/cfi_flash.c
>> @@ -155,8 +155,7 @@ __maybe_weak void flash_write32(u32 value, void *addr)
>>
>> __maybe_weak void flash_write64(u64 value, void *addr)
>> {
>> - /* No architectures currently implement __raw_writeq() */
>> - *(volatile u64 *)addr = value;
>> + __raw_writeq(value, addr);
>> }
>>
>> __maybe_weak u8 flash_read8(void *addr)
>> @@ -176,8 +175,7 @@ __maybe_weak u32 flash_read32(void *addr)
>>
>> __maybe_weak u64 flash_read64(void *addr)
>> {
>> - /* No architectures currently implement __raw_readq() */
>> - return *(volatile u64 *)addr;
>> + return __raw_readq(addr);
>> }
>>
>> /*-----------------------------------------------------------------------
>> --
>> 2.26.2
>>
>
Viele Gr??e,
Stefan
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/1] mtd: cfi_flash: use __raw_writeq(), __raw_readq()
2020-06-08 7:07 ` Stefan Roese
@ 2020-06-08 7:12 ` Heinrich Schuchardt
2020-06-08 7:27 ` Stefan Roese
0 siblings, 1 reply; 5+ messages in thread
From: Heinrich Schuchardt @ 2020-06-08 7:12 UTC (permalink / raw)
To: u-boot
On 6/8/20 9:07 AM, Stefan Roese wrote:
> On 07.06.20 20:42, Heinrich Schuchardt wrote:
>> On 6/6/20 11:13 PM, Heinrich Schuchardt wrote:
>>> Functions __raw_writeq(), __raw_readq() are available for all
>>> architectures. So let's use them.
>>
>> The major architectures have these but not m68k, microblaze, nd32,
>> nios2, powerpc, sh, xtenza.
>
> Just checking to be clear: This patch breaks compiling on these
> platforms and you are withdrawing it (for now)?
Yes, it breaks compiling on the specified platforms.
This can be fixed by adding the missing functions to the platforms:
https://gitlab.denx.de/u-boot/custodians/u-boot-efi/-/commits/sunxi
But is it worthwhile to add __raw_writeq(), __raw_readq() to all of these?
Best regards
Heinrich
>
> Thanks,
> Stefan
>
>>>
>>> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>>> ---
>>> ? drivers/mtd/cfi_flash.c | 6 ++----
>>> ? 1 file changed, 2 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
>>> index b7289ba539..e31e07ca80 100644
>>> --- a/drivers/mtd/cfi_flash.c
>>> +++ b/drivers/mtd/cfi_flash.c
>>> @@ -155,8 +155,7 @@ __maybe_weak void flash_write32(u32 value, void
>>> *addr)
>>>
>>> ? __maybe_weak void flash_write64(u64 value, void *addr)
>>> ? {
>>> -??? /* No architectures currently implement __raw_writeq() */
>>> -??? *(volatile u64 *)addr = value;
>>> +??? __raw_writeq(value, addr);
>>> ? }
>>>
>>> ? __maybe_weak u8 flash_read8(void *addr)
>>> @@ -176,8 +175,7 @@ __maybe_weak u32 flash_read32(void *addr)
>>>
>>> ? __maybe_weak u64 flash_read64(void *addr)
>>> ? {
>>> -??? /* No architectures currently implement __raw_readq() */
>>> -??? return *(volatile u64 *)addr;
>>> +??? return __raw_readq(addr);
>>> ? }
>>>
>>> ?
>>> /*-----------------------------------------------------------------------
>>>
>>> --
>>> 2.26.2
>>>
>>
>
>
> Viele Gr??e,
> Stefan
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/1] mtd: cfi_flash: use __raw_writeq(), __raw_readq()
2020-06-08 7:12 ` Heinrich Schuchardt
@ 2020-06-08 7:27 ` Stefan Roese
0 siblings, 0 replies; 5+ messages in thread
From: Stefan Roese @ 2020-06-08 7:27 UTC (permalink / raw)
To: u-boot
On 08.06.20 09:12, Heinrich Schuchardt wrote:
> On 6/8/20 9:07 AM, Stefan Roese wrote:
>> On 07.06.20 20:42, Heinrich Schuchardt wrote:
>>> On 6/6/20 11:13 PM, Heinrich Schuchardt wrote:
>>>> Functions __raw_writeq(), __raw_readq() are available for all
>>>> architectures. So let's use them.
>>>
>>> The major architectures have these but not m68k, microblaze, nd32,
>>> nios2, powerpc, sh, xtenza.
>>
>> Just checking to be clear: This patch breaks compiling on these
>> platforms and you are withdrawing it (for now)?
>
> Yes, it breaks compiling on the specified platforms.
>
> This can be fixed by adding the missing functions to the platforms:
> https://gitlab.denx.de/u-boot/custodians/u-boot-efi/-/commits/sunxi
>
> But is it worthwhile to add __raw_writeq(), __raw_readq() to all of these?
Sure, why not?
Thanks,
Stefan
> Best regards
>
> Heinrich
>
>>
>> Thanks,
>> Stefan
>>
>>>>
>>>> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>>>> ---
>>>> ? drivers/mtd/cfi_flash.c | 6 ++----
>>>> ? 1 file changed, 2 insertions(+), 4 deletions(-)
>>>>
>>>> diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
>>>> index b7289ba539..e31e07ca80 100644
>>>> --- a/drivers/mtd/cfi_flash.c
>>>> +++ b/drivers/mtd/cfi_flash.c
>>>> @@ -155,8 +155,7 @@ __maybe_weak void flash_write32(u32 value, void
>>>> *addr)
>>>>
>>>> ? __maybe_weak void flash_write64(u64 value, void *addr)
>>>> ? {
>>>> -??? /* No architectures currently implement __raw_writeq() */
>>>> -??? *(volatile u64 *)addr = value;
>>>> +??? __raw_writeq(value, addr);
>>>> ? }
>>>>
>>>> ? __maybe_weak u8 flash_read8(void *addr)
>>>> @@ -176,8 +175,7 @@ __maybe_weak u32 flash_read32(void *addr)
>>>>
>>>> ? __maybe_weak u64 flash_read64(void *addr)
>>>> ? {
>>>> -??? /* No architectures currently implement __raw_readq() */
>>>> -??? return *(volatile u64 *)addr;
>>>> +??? return __raw_readq(addr);
>>>> ? }
>>>>
>>>>
>>>> /*-----------------------------------------------------------------------
>>>>
>>>> --
>>>> 2.26.2
>>>>
>>>
>>
>>
>> Viele Gr??e,
>> Stefan
>>
>
Viele Gr??e,
Stefan
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-06-08 7:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-06 21:13 [PATCH 1/1] mtd: cfi_flash: use __raw_writeq(), __raw_readq() Heinrich Schuchardt
2020-06-07 18:42 ` Heinrich Schuchardt
2020-06-08 7:07 ` Stefan Roese
2020-06-08 7:12 ` Heinrich Schuchardt
2020-06-08 7:27 ` Stefan Roese
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.