diff mbox series

[v2,1/3] asm/arch-meson: add missing meson_sm_write_efuse signature

Message ID 20221213183129.75915-2-avromanov@sberdevices.ru
State Changes Requested
Delegated to: Neil Armstrong
Headers show
Series arch-meson: introduce efusedump command | expand

Commit Message

Alexey Romanov Dec. 13, 2022, 6:31 p.m. UTC
This function can be used by other modules.

Signed-off-by: Alexey Romanov <avromanov@sberdevices.ru>
---
 arch/arm/include/asm/arch-meson/sm.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Simon Glass Dec. 14, 2022, 4:39 a.m. UTC | #1
Hi Alexey,

On Tue, 13 Dec 2022 at 10:32, Alexey Romanov <avromanov@sberdevices.ru> wrote:
>
> This function can be used by other modules.
>
> Signed-off-by: Alexey Romanov <avromanov@sberdevices.ru>
> ---
>  arch/arm/include/asm/arch-meson/sm.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm/include/asm/arch-meson/sm.h b/arch/arm/include/asm/arch-meson/sm.h
> index f3ae46a6d6b..b68edf842e4 100644
> --- a/arch/arm/include/asm/arch-meson/sm.h
> +++ b/arch/arm/include/asm/arch-meson/sm.h
> @@ -8,6 +8,8 @@
>
>  ssize_t meson_sm_read_efuse(uintptr_t offset, void *buffer, size_t size);
>
> +ssize_t meson_sm_write_efuse(uintptr_t offset, void *buffer, size_t size);
> +
>  #define SM_SERIAL_SIZE 12
>
>  int meson_sm_get_serial(void *buffer, size_t size);
> --
> 2.25.1
>

Should add function comments.

Also, you might consider adding a uclass for this. It seems like an
important use case that is not handled right now.

Regards,
Simon
Alexey Romanov Dec. 14, 2022, 11:14 a.m. UTC | #2
Hello!

On Tue, Dec 13, 2022 at 08:39:46PM -0800, Simon Glass wrote:
> Hi Alexey,
> 
> On Tue, 13 Dec 2022 at 10:32, Alexey Romanov <avromanov@sberdevices.ru> wrote:
> >
> > This function can be used by other modules.
> >
> > Signed-off-by: Alexey Romanov <avromanov@sberdevices.ru>
> > ---
> >  arch/arm/include/asm/arch-meson/sm.h | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/arch/arm/include/asm/arch-meson/sm.h b/arch/arm/include/asm/arch-meson/sm.h
> > index f3ae46a6d6b..b68edf842e4 100644
> > --- a/arch/arm/include/asm/arch-meson/sm.h
> > +++ b/arch/arm/include/asm/arch-meson/sm.h
> > @@ -8,6 +8,8 @@
> >
> >  ssize_t meson_sm_read_efuse(uintptr_t offset, void *buffer, size_t size);
> >
> > +ssize_t meson_sm_write_efuse(uintptr_t offset, void *buffer, size_t size);
> > +
> >  #define SM_SERIAL_SIZE 12
> >
> >  int meson_sm_get_serial(void *buffer, size_t size);
> > --
> > 2.25.1
> >
> 
> Should add function comments.
> 
> Also, you might consider adding a uclass for this. It seems like an
> important use case that is not handled right now.
> 
> Regards,
> Simon

I'm afraid we can't generalize sm API for each arch types. It's very close to Secure Monitor 
vendor implementation and can provide various APIs for different purposes.
Neil Armstrong Dec. 14, 2022, 2:53 p.m. UTC | #3
On 14/12/2022 05:39, Simon Glass wrote:
> Hi Alexey,
> 
> On Tue, 13 Dec 2022 at 10:32, Alexey Romanov <avromanov@sberdevices.ru> wrote:
>>
>> This function can be used by other modules.
>>
>> Signed-off-by: Alexey Romanov <avromanov@sberdevices.ru>
>> ---
>>   arch/arm/include/asm/arch-meson/sm.h | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/arch/arm/include/asm/arch-meson/sm.h b/arch/arm/include/asm/arch-meson/sm.h
>> index f3ae46a6d6b..b68edf842e4 100644
>> --- a/arch/arm/include/asm/arch-meson/sm.h
>> +++ b/arch/arm/include/asm/arch-meson/sm.h
>> @@ -8,6 +8,8 @@
>>
>>   ssize_t meson_sm_read_efuse(uintptr_t offset, void *buffer, size_t size);
>>
>> +ssize_t meson_sm_write_efuse(uintptr_t offset, void *buffer, size_t size);
>> +
>>   #define SM_SERIAL_SIZE 12
>>
>>   int meson_sm_get_serial(void *buffer, size_t size);
>> --
>> 2.25.1
>>
> 
> Should add function comments.
> 
> Also, you might consider adding a uclass for this. It seems like an
> important use case that is not handled right now.

An NVMEM uclass would be a great addition, but for the scope of this
change it can be done later.

Neil

> 
> Regards,
> Simon
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#1378): https://groups.io/g/u-boot-amlogic/message/1378
> Mute This Topic: https://groups.io/mt/95651322/900740
> Group Owner: u-boot-amlogic+owner@groups.io
> Unsubscribe: https://groups.io/g/u-boot-amlogic/unsub [neil.armstrong@linaro.org]
> -=-=-=-=-=-=-=-=-=-=-=-
> 
>
diff mbox series

Patch

diff --git a/arch/arm/include/asm/arch-meson/sm.h b/arch/arm/include/asm/arch-meson/sm.h
index f3ae46a6d6b..b68edf842e4 100644
--- a/arch/arm/include/asm/arch-meson/sm.h
+++ b/arch/arm/include/asm/arch-meson/sm.h
@@ -8,6 +8,8 @@ 
 
 ssize_t meson_sm_read_efuse(uintptr_t offset, void *buffer, size_t size);
 
+ssize_t meson_sm_write_efuse(uintptr_t offset, void *buffer, size_t size);
+
 #define SM_SERIAL_SIZE	12
 
 int meson_sm_get_serial(void *buffer, size_t size);