diff mbox series

[1/2] common: add prototype for populate_serial_number()

Message ID 20230921153720.542101-2-artur@conclusive.pl
State Changes Requested
Delegated to: Eugen Hristev
Headers show
Series Conclusive KSTR-SAMA5D27 support | expand

Commit Message

Artur Rojek Sept. 21, 2023, 3:37 p.m. UTC
Provide function prototype for populate_serial_number().
This is useful for boards that wish to read their serial number from
EEPROM at init.

Signed-off-by: Artur Rojek <artur@conclusive.pl>
---
 include/init.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Simon Glass Sept. 21, 2023, 4:29 p.m. UTC | #1
Hi Artur,

On Thu, 21 Sept 2023 at 09:44, Artur Rojek <artur@conclusive.pl> wrote:
>
> Provide function prototype for populate_serial_number().
> This is useful for boards that wish to read their serial number from
> EEPROM at init.
>
> Signed-off-by: Artur Rojek <artur@conclusive.pl>
> ---
>  include/init.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/include/init.h b/include/init.h
> index 3bf30476a2e0..e0b7fbc943ad 100644
> --- a/include/init.h
> +++ b/include/init.h
> @@ -283,6 +283,7 @@ void board_init_r(struct global_data *id, ulong dest_addr)
>  int cpu_init_r(void);
>  int last_stage_init(void);
>  int mac_read_from_eeprom(void);
> +int populate_serial_number(int devnum);

Please can you add a comment for this function? You can move it from the C file.

I also suggest renaming it to something like eeprom_get_serial() or
something like that.

>  int set_cpu_clk_info(void);
>  int update_flash_size(int flash_size);
>  int arch_early_init_r(void);
> --
> 2.42.0
>

BTW tlv_eeprom.c should really be converted to driver model.

Regards,
Simon
Artur Rojek Sept. 25, 2023, 7:07 p.m. UTC | #2
Hi Simon,

thanks for the review.
>Hi Artur,
>
>On Thu, 21 Sept 2023 at 09:44, Artur Rojek <artur@conclusive.pl> wrote:
>>
>> Provide function prototype for populate_serial_number().
>> This is useful for boards that wish to read their serial number from
>> EEPROM at init.
>>
>> Signed-off-by: Artur Rojek <artur@conclusive.pl>
>> ---
>>  include/init.h | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/include/init.h b/include/init.h
>> index 3bf30476a2e0..e0b7fbc943ad 100644
>> --- a/include/init.h
>> +++ b/include/init.h
>> @@ -283,6 +283,7 @@ void board_init_r(struct global_data *id, ulong dest_addr)
>>  int cpu_init_r(void);
>>  int last_stage_init(void);
>>  int mac_read_from_eeprom(void);
>> +int populate_serial_number(int devnum);
>
>Please can you add a comment for this function? You can move it from the C file.
>
>I also suggest renaming it to something like eeprom_get_serial() or
>something like that.
I'll go with eeprom_read_serial(), as the one you suggested is
apparently already taken by board/gateworks/venice/eeprom.c.
>
>>  int set_cpu_clk_info(void);
>>  int update_flash_size(int flash_size);
>>  int arch_early_init_r(void);
>> --
>> 2.42.0
>>
>
>BTW tlv_eeprom.c should really be converted to driver model.
It should, but maybe at some other opportunity :)

Cheers,
Artur
>
>Regards,
>Simon
diff mbox series

Patch

diff --git a/include/init.h b/include/init.h
index 3bf30476a2e0..e0b7fbc943ad 100644
--- a/include/init.h
+++ b/include/init.h
@@ -283,6 +283,7 @@  void board_init_r(struct global_data *id, ulong dest_addr)
 int cpu_init_r(void);
 int last_stage_init(void);
 int mac_read_from_eeprom(void);
+int populate_serial_number(int devnum);
 int set_cpu_clk_info(void);
 int update_flash_size(int flash_size);
 int arch_early_init_r(void);