Re: [U-Boot] [U-Boot,v2,04/23] spl: Set up the bloblist in SPL

2018-11-15 Thread Simon Glass
Hi Tom,

On 15 November 2018 at 16:10, Tom Rini  wrote:
> On Thu, Nov 15, 2018 at 04:07:59PM -0800, Simon Glass wrote:
>> Hi Tom,
>>
>> On 9 November 2018 at 10:43, Tom Rini  wrote:
>> > On Tue, Oct 02, 2018 at 05:22:34AM -0600, Simon Glass wrote:
>> >> The bloblist is normally set up in SPL ready for use by U-Boot. Add
>> >> a simple implementation of this to the common SPL code.
>> >>
>> >> Signed-off-by: Simon Glass 
>> >> ---
>> >>
>> >> Changes in v2: None
>> >>
>> >>  common/spl/spl.c | 18 --
>> >>  include/spl.h| 27 +++
>> >>  2 files changed, 43 insertions(+), 2 deletions(-)
>> >>
>> >> diff --git a/common/spl/spl.c b/common/spl/spl.c
>> >> index b917624e61d..2ca900ae9ed 100644
>> >> --- a/common/spl/spl.c
>> >> +++ b/common/spl/spl.c
>> >> @@ -7,6 +7,7 @@
>> >>   */
>> >>
>> >>  #include 
>> >> +#include 
>> >>  #include 
>> >>  #include 
>> >>  #include 
>> >> @@ -345,6 +346,14 @@ static int spl_common_init(bool setup_malloc)
>> >>   return ret;
>> >>   }
>> >>  #endif
>> >> + if (CONFIG_IS_ENABLED(BLOBLIST)) {
>> >> + ret = bloblist_init();
>> >> + if (ret) {
>> >> + debug("%s: Failed to set up bloblist: ret=%d\n",
>> >> +   __func__, ret);
>> >> + return ret;
>> >> + }
>> >> + }
>> >>   if (CONFIG_IS_ENABLED(OF_CONTROL) && 
>> >> !CONFIG_IS_ENABLED(OF_PLATDATA)) {
>> >>   ret = fdtdec_setup();
>> >>   if (ret) {
>> >> @@ -483,6 +492,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
>> >>   BOOT_DEVICE_NONE,
>> >>   };
>> >>   struct spl_image_info spl_image;
>> >> + int ret;
>> >>
>> >>   debug(">>spl:board_init_r()\n");
>> >>
>> >> @@ -529,6 +539,12 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
>> >>   }
>> >>
>> >>   spl_perform_fixups(_image);
>> >> + if (CONFIG_IS_ENABLED(BLOBLIST)) {
>> >> + ret = bloblist_finish();
>> >> + if (ret)
>> >> + printf("Warning: Failed to finish bloblist 
>> >> (ret=%d)\n",
>> >> +ret);
>> >> + }
>> >>
>> >>  #ifdef CONFIG_CPU_V7M
>> >>   spl_image.entry_point |= 0x1;
>> >> @@ -558,8 +574,6 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
>> >> gd->malloc_ptr / 1024);
>> >>  #endif
>> >>  #ifdef CONFIG_BOOTSTAGE_STASH
>> >> - int ret;
>> >> -
>> >>   bootstage_mark_name(BOOTSTAGE_ID_END_SPL, "end_spl");
>> >>   ret = bootstage_stash((void *)CONFIG_BOOTSTAGE_STASH_ADDR,
>> >> CONFIG_BOOTSTAGE_STASH_SIZE);
>> >
>> > I think we'll need a __maybe_unused on ret above for !BOOTSTAGE_STASH &&
>> > !BLOBLIST.
>> >
>>
>> The code for BLOBLIST uses if() rather than #if so it seems OK:
>>
>> if (CONFIG_IS_ENABLED(BLOBLIST)) {
>
> So long as it doesn't warn, OK :)

That's right. One of the benefits of if() is we can avoid #ifdefs
around local variables .

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot,v2,04/23] spl: Set up the bloblist in SPL

2018-11-15 Thread Simon Glass
Hi Tom,

On 9 November 2018 at 10:43, Tom Rini  wrote:
> On Tue, Oct 02, 2018 at 05:22:34AM -0600, Simon Glass wrote:
>> The bloblist is normally set up in SPL ready for use by U-Boot. Add
>> a simple implementation of this to the common SPL code.
>>
>> Signed-off-by: Simon Glass 
>> ---
>>
>> Changes in v2: None
>>
>>  common/spl/spl.c | 18 --
>>  include/spl.h| 27 +++
>>  2 files changed, 43 insertions(+), 2 deletions(-)
>>
>> diff --git a/common/spl/spl.c b/common/spl/spl.c
>> index b917624e61d..2ca900ae9ed 100644
>> --- a/common/spl/spl.c
>> +++ b/common/spl/spl.c
>> @@ -7,6 +7,7 @@
>>   */
>>
>>  #include 
>> +#include 
>>  #include 
>>  #include 
>>  #include 
>> @@ -345,6 +346,14 @@ static int spl_common_init(bool setup_malloc)
>>   return ret;
>>   }
>>  #endif
>> + if (CONFIG_IS_ENABLED(BLOBLIST)) {
>> + ret = bloblist_init();
>> + if (ret) {
>> + debug("%s: Failed to set up bloblist: ret=%d\n",
>> +   __func__, ret);
>> + return ret;
>> + }
>> + }
>>   if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) {
>>   ret = fdtdec_setup();
>>   if (ret) {
>> @@ -483,6 +492,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
>>   BOOT_DEVICE_NONE,
>>   };
>>   struct spl_image_info spl_image;
>> + int ret;
>>
>>   debug(">>spl:board_init_r()\n");
>>
>> @@ -529,6 +539,12 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
>>   }
>>
>>   spl_perform_fixups(_image);
>> + if (CONFIG_IS_ENABLED(BLOBLIST)) {
>> + ret = bloblist_finish();
>> + if (ret)
>> + printf("Warning: Failed to finish bloblist (ret=%d)\n",
>> +ret);
>> + }
>>
>>  #ifdef CONFIG_CPU_V7M
>>   spl_image.entry_point |= 0x1;
>> @@ -558,8 +574,6 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
>> gd->malloc_ptr / 1024);
>>  #endif
>>  #ifdef CONFIG_BOOTSTAGE_STASH
>> - int ret;
>> -
>>   bootstage_mark_name(BOOTSTAGE_ID_END_SPL, "end_spl");
>>   ret = bootstage_stash((void *)CONFIG_BOOTSTAGE_STASH_ADDR,
>> CONFIG_BOOTSTAGE_STASH_SIZE);
>
> I think we'll need a __maybe_unused on ret above for !BOOTSTAGE_STASH &&
> !BLOBLIST.
>

The code for BLOBLIST uses if() rather than #if so it seems OK:

if (CONFIG_IS_ENABLED(BLOBLIST)) {

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot,v2,04/23] spl: Set up the bloblist in SPL

2018-11-15 Thread Tom Rini
On Thu, Nov 15, 2018 at 04:07:59PM -0800, Simon Glass wrote:
> Hi Tom,
> 
> On 9 November 2018 at 10:43, Tom Rini  wrote:
> > On Tue, Oct 02, 2018 at 05:22:34AM -0600, Simon Glass wrote:
> >> The bloblist is normally set up in SPL ready for use by U-Boot. Add
> >> a simple implementation of this to the common SPL code.
> >>
> >> Signed-off-by: Simon Glass 
> >> ---
> >>
> >> Changes in v2: None
> >>
> >>  common/spl/spl.c | 18 --
> >>  include/spl.h| 27 +++
> >>  2 files changed, 43 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/common/spl/spl.c b/common/spl/spl.c
> >> index b917624e61d..2ca900ae9ed 100644
> >> --- a/common/spl/spl.c
> >> +++ b/common/spl/spl.c
> >> @@ -7,6 +7,7 @@
> >>   */
> >>
> >>  #include 
> >> +#include 
> >>  #include 
> >>  #include 
> >>  #include 
> >> @@ -345,6 +346,14 @@ static int spl_common_init(bool setup_malloc)
> >>   return ret;
> >>   }
> >>  #endif
> >> + if (CONFIG_IS_ENABLED(BLOBLIST)) {
> >> + ret = bloblist_init();
> >> + if (ret) {
> >> + debug("%s: Failed to set up bloblist: ret=%d\n",
> >> +   __func__, ret);
> >> + return ret;
> >> + }
> >> + }
> >>   if (CONFIG_IS_ENABLED(OF_CONTROL) && 
> >> !CONFIG_IS_ENABLED(OF_PLATDATA)) {
> >>   ret = fdtdec_setup();
> >>   if (ret) {
> >> @@ -483,6 +492,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
> >>   BOOT_DEVICE_NONE,
> >>   };
> >>   struct spl_image_info spl_image;
> >> + int ret;
> >>
> >>   debug(">>spl:board_init_r()\n");
> >>
> >> @@ -529,6 +539,12 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
> >>   }
> >>
> >>   spl_perform_fixups(_image);
> >> + if (CONFIG_IS_ENABLED(BLOBLIST)) {
> >> + ret = bloblist_finish();
> >> + if (ret)
> >> + printf("Warning: Failed to finish bloblist 
> >> (ret=%d)\n",
> >> +ret);
> >> + }
> >>
> >>  #ifdef CONFIG_CPU_V7M
> >>   spl_image.entry_point |= 0x1;
> >> @@ -558,8 +574,6 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
> >> gd->malloc_ptr / 1024);
> >>  #endif
> >>  #ifdef CONFIG_BOOTSTAGE_STASH
> >> - int ret;
> >> -
> >>   bootstage_mark_name(BOOTSTAGE_ID_END_SPL, "end_spl");
> >>   ret = bootstage_stash((void *)CONFIG_BOOTSTAGE_STASH_ADDR,
> >> CONFIG_BOOTSTAGE_STASH_SIZE);
> >
> > I think we'll need a __maybe_unused on ret above for !BOOTSTAGE_STASH &&
> > !BLOBLIST.
> >
> 
> The code for BLOBLIST uses if() rather than #if so it seems OK:
> 
> if (CONFIG_IS_ENABLED(BLOBLIST)) {

So long as it doesn't warn, OK :)

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot,v2,04/23] spl: Set up the bloblist in SPL

2018-11-09 Thread Tom Rini
On Tue, Oct 02, 2018 at 05:22:34AM -0600, Simon Glass wrote:
> The bloblist is normally set up in SPL ready for use by U-Boot. Add
> a simple implementation of this to the common SPL code.
> 
> Signed-off-by: Simon Glass 
> ---
> 
> Changes in v2: None
> 
>  common/spl/spl.c | 18 --
>  include/spl.h| 27 +++
>  2 files changed, 43 insertions(+), 2 deletions(-)
> 
> diff --git a/common/spl/spl.c b/common/spl/spl.c
> index b917624e61d..2ca900ae9ed 100644
> --- a/common/spl/spl.c
> +++ b/common/spl/spl.c
> @@ -7,6 +7,7 @@
>   */
>  
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -345,6 +346,14 @@ static int spl_common_init(bool setup_malloc)
>   return ret;
>   }
>  #endif
> + if (CONFIG_IS_ENABLED(BLOBLIST)) {
> + ret = bloblist_init();
> + if (ret) {
> + debug("%s: Failed to set up bloblist: ret=%d\n",
> +   __func__, ret);
> + return ret;
> + }
> + }
>   if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) {
>   ret = fdtdec_setup();
>   if (ret) {
> @@ -483,6 +492,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
>   BOOT_DEVICE_NONE,
>   };
>   struct spl_image_info spl_image;
> + int ret;
>  
>   debug(">>spl:board_init_r()\n");
>  
> @@ -529,6 +539,12 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
>   }
>  
>   spl_perform_fixups(_image);
> + if (CONFIG_IS_ENABLED(BLOBLIST)) {
> + ret = bloblist_finish();
> + if (ret)
> + printf("Warning: Failed to finish bloblist (ret=%d)\n",
> +ret);
> + }
>  
>  #ifdef CONFIG_CPU_V7M
>   spl_image.entry_point |= 0x1;
> @@ -558,8 +574,6 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
> gd->malloc_ptr / 1024);
>  #endif
>  #ifdef CONFIG_BOOTSTAGE_STASH
> - int ret;
> -
>   bootstage_mark_name(BOOTSTAGE_ID_END_SPL, "end_spl");
>   ret = bootstage_stash((void *)CONFIG_BOOTSTAGE_STASH_ADDR,
> CONFIG_BOOTSTAGE_STASH_SIZE);

I think we'll need a __maybe_unused on ret above for !BOOTSTAGE_STASH &&
!BLOBLIST.

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot