diff mbox

[U-Boot] generic_board: Call "checkboard" even though the root node has a "model" property

Message ID 1436443083-18898-1-git-send-email-haikun.wang@freescale.com
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Haikun.Wang@freescale.com July 9, 2015, 11:58 a.m. UTC
In case of enable CONFIG_OF_CONTROL and has a "model" property in the root node,
the board special "checkboard" will not be called.
Usually we show some useful version information in the function.
This patch enable call "checkboard" in any case.
It is not conflicting with showing "model" at the same time.

For example on LS2085AQDS:
Showing "model" only:
Model: Freescale Layerscape 2085a QDS Board

Showing "checkboard" only:
Board: LS2085E-QDS, Board Arch: V1, Board version: B, boot from vBank: 4

Showing both:
Model: Freescale Layerscape 2085a QDS Board
Board: LS2085E-QDS, Board Arch: V1, Board version: B, boot from vBank: 4

Signed-off-by: Haikun Wang <haikun.wang@freescale.com>
---
 common/board_info.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Simon Glass July 9, 2015, 10:05 p.m. UTC | #1
Hi,

On 9 July 2015 at 05:58, Haikun Wang <haikun.wang@freescale.com> wrote:
> Showing both:
> Model: Freescale Layerscape 2085a QDS Board
> Board: LS2085E-QDS, Board Arch: V1, Board version: B, boot from vBank: 4

This looks like duplication (at least the first part).

Anyway I don't see any problem with this change.

Reviewed-by: Simon Glass <sjg@chromium.org>

Regards,
Simon
Haikun.Wang@freescale.com July 10, 2015, 3:50 a.m. UTC | #2
On 7/10/2015 6:06 AM, Simon Glass wrote:
> Hi,
>
> On 9 July 2015 at 05:58, Haikun Wang <haikun.wang@freescale.com> wrote:
>> Showing both:
>> Model: Freescale Layerscape 2085a QDS Board
>> Board: LS2085E-QDS, Board Arch: V1, Board version: B, boot from vBank: 4
>
> This looks like duplication (at least the first part).
>
> Anyway I don't see any problem with this change.
Hi Simon,

The "model" information is hard-coded.
Sometimes we need print run-time information of the board.

We just want to print the version information and they are stored in the 
on-board FPGA registers on LS2085AQDS.

Best regards,
Wang Haikun
>
> Reviewed-by: Simon Glass <sjg@chromium.org>
>
> Regards,
> Simon
>
Tom Rini July 28, 2015, 2:58 p.m. UTC | #3
On Thu, Jul 09, 2015 at 07:58:03PM +0800, Haikun.Wang@freescale.com wrote:

> In case of enable CONFIG_OF_CONTROL and has a "model" property in the root node,
> the board special "checkboard" will not be called.
> Usually we show some useful version information in the function.
> This patch enable call "checkboard" in any case.
> It is not conflicting with showing "model" at the same time.
> 
> For example on LS2085AQDS:
> Showing "model" only:
> Model: Freescale Layerscape 2085a QDS Board
> 
> Showing "checkboard" only:
> Board: LS2085E-QDS, Board Arch: V1, Board version: B, boot from vBank: 4
> 
> Showing both:
> Model: Freescale Layerscape 2085a QDS Board
> Board: LS2085E-QDS, Board Arch: V1, Board version: B, boot from vBank: 4
> 
> Signed-off-by: Haikun Wang <haikun.wang@freescale.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!
Bin Meng July 30, 2015, 10:42 a.m. UTC | #4
Hi Haikun, Simon,

On Fri, Jul 10, 2015 at 11:50 AM, Wang Haikun <Haikun.Wang@freescale.com> wrote:
> On 7/10/2015 6:06 AM, Simon Glass wrote:
>> Hi,
>>
>> On 9 July 2015 at 05:58, Haikun Wang <haikun.wang@freescale.com> wrote:
>>> Showing both:
>>> Model: Freescale Layerscape 2085a QDS Board
>>> Board: LS2085E-QDS, Board Arch: V1, Board version: B, boot from vBank: 4
>>
>> This looks like duplication (at least the first part).
>>
>> Anyway I don't see any problem with this change.
> Hi Simon,
>
> The "model" information is hard-coded.
> Sometimes we need print run-time information of the board.
>
> We just want to print the version information and they are stored in the
> on-board FPGA registers on LS2085AQDS.
>
> Best regards,
> Wang Haikun
>>
>> Reviewed-by: Simon Glass <sjg@chromium.org>

With rebase on u-boot/master, I now see board booting like this:

Model: Intel Bayley Bay
Board: Unknown

This looks a little bit odd (an unkown board?) to me. Does this mean
we need implement our own checkboard() for every board we support?

Regards,
Bin
Masahiro Yamada July 30, 2015, 10:47 a.m. UTC | #5
2015-07-30 19:42 GMT+09:00 Bin Meng <bmeng.cn@gmail.com>:
> Hi Haikun, Simon,
>
> On Fri, Jul 10, 2015 at 11:50 AM, Wang Haikun <Haikun.Wang@freescale.com> wrote:
>> On 7/10/2015 6:06 AM, Simon Glass wrote:
>>> Hi,
>>>
>>> On 9 July 2015 at 05:58, Haikun Wang <haikun.wang@freescale.com> wrote:
>>>> Showing both:
>>>> Model: Freescale Layerscape 2085a QDS Board
>>>> Board: LS2085E-QDS, Board Arch: V1, Board version: B, boot from vBank: 4
>>>
>>> This looks like duplication (at least the first part).
>>>
>>> Anyway I don't see any problem with this change.
>> Hi Simon,
>>
>> The "model" information is hard-coded.
>> Sometimes we need print run-time information of the board.
>>
>> We just want to print the version information and they are stored in the
>> on-board FPGA registers on LS2085AQDS.
>>
>> Best regards,
>> Wang Haikun
>>>
>>> Reviewed-by: Simon Glass <sjg@chromium.org>
>
> With rebase on u-boot/master, I now see board booting like this:
>
> Model: Intel Bayley Bay
> Board: Unknown
>
> This looks a little bit odd (an unkown board?) to me. Does this mean
> we need implement our own checkboard() for every board we support?
>


Absolutely, no.

I do not want to implement checkboard() for my boards that
have model names in DTS.
Bin Meng July 30, 2015, 10:51 a.m. UTC | #6
On Thu, Jul 30, 2015 at 6:47 PM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> 2015-07-30 19:42 GMT+09:00 Bin Meng <bmeng.cn@gmail.com>:
>> Hi Haikun, Simon,
>>
>> On Fri, Jul 10, 2015 at 11:50 AM, Wang Haikun <Haikun.Wang@freescale.com> wrote:
>>> On 7/10/2015 6:06 AM, Simon Glass wrote:
>>>> Hi,
>>>>
>>>> On 9 July 2015 at 05:58, Haikun Wang <haikun.wang@freescale.com> wrote:
>>>>> Showing both:
>>>>> Model: Freescale Layerscape 2085a QDS Board
>>>>> Board: LS2085E-QDS, Board Arch: V1, Board version: B, boot from vBank: 4
>>>>
>>>> This looks like duplication (at least the first part).
>>>>
>>>> Anyway I don't see any problem with this change.
>>> Hi Simon,
>>>
>>> The "model" information is hard-coded.
>>> Sometimes we need print run-time information of the board.
>>>
>>> We just want to print the version information and they are stored in the
>>> on-board FPGA registers on LS2085AQDS.
>>>
>>> Best regards,
>>> Wang Haikun
>>>>
>>>> Reviewed-by: Simon Glass <sjg@chromium.org>
>>
>> With rebase on u-boot/master, I now see board booting like this:
>>
>> Model: Intel Bayley Bay
>> Board: Unknown
>>
>> This looks a little bit odd (an unkown board?) to me. Does this mean
>> we need implement our own checkboard() for every board we support?
>>
>
>
> Absolutely, no.
>
> I do not want to implement checkboard() for my boards that
> have model names in DTS.
>

Then can we make this __weak checkboard() print nothing instead?
Showing "Board: Unknown" makes me think something went wrong at first
glance.

Regards,
Bin
Masahiro Yamada July 30, 2015, 10:55 a.m. UTC | #7
2015-07-30 19:51 GMT+09:00 Bin Meng <bmeng.cn@gmail.com>:
> On Thu, Jul 30, 2015 at 6:47 PM, Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
>> 2015-07-30 19:42 GMT+09:00 Bin Meng <bmeng.cn@gmail.com>:
>>> Hi Haikun, Simon,
>>>
>>> On Fri, Jul 10, 2015 at 11:50 AM, Wang Haikun <Haikun.Wang@freescale.com> wrote:
>>>> On 7/10/2015 6:06 AM, Simon Glass wrote:
>>>>> Hi,
>>>>>
>>>>> On 9 July 2015 at 05:58, Haikun Wang <haikun.wang@freescale.com> wrote:
>>>>>> Showing both:
>>>>>> Model: Freescale Layerscape 2085a QDS Board
>>>>>> Board: LS2085E-QDS, Board Arch: V1, Board version: B, boot from vBank: 4
>>>>>
>>>>> This looks like duplication (at least the first part).
>>>>>
>>>>> Anyway I don't see any problem with this change.
>>>> Hi Simon,
>>>>
>>>> The "model" information is hard-coded.
>>>> Sometimes we need print run-time information of the board.
>>>>
>>>> We just want to print the version information and they are stored in the
>>>> on-board FPGA registers on LS2085AQDS.
>>>>
>>>> Best regards,
>>>> Wang Haikun
>>>>>
>>>>> Reviewed-by: Simon Glass <sjg@chromium.org>
>>>
>>> With rebase on u-boot/master, I now see board booting like this:
>>>
>>> Model: Intel Bayley Bay
>>> Board: Unknown
>>>
>>> This looks a little bit odd (an unkown board?) to me. Does this mean
>>> we need implement our own checkboard() for every board we support?
>>>
>>
>>
>> Absolutely, no.
>>
>> I do not want to implement checkboard() for my boards that
>> have model names in DTS.
>>
>
> Then can we make this __weak checkboard() print nothing instead?

Sounds good to me.





> Showing "Board: Unknown" makes me think something went wrong at first
> glance.
Simon Glass July 30, 2015, 2:53 p.m. UTC | #8
Hi,

On 30 July 2015 at 04:55, Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
>
> 2015-07-30 19:51 GMT+09:00 Bin Meng <bmeng.cn@gmail.com>:
> > On Thu, Jul 30, 2015 at 6:47 PM, Masahiro Yamada
> > <yamada.masahiro@socionext.com> wrote:
> >> 2015-07-30 19:42 GMT+09:00 Bin Meng <bmeng.cn@gmail.com>:
> >>> Hi Haikun, Simon,
> >>>
> >>> On Fri, Jul 10, 2015 at 11:50 AM, Wang Haikun <Haikun.Wang@freescale.com> wrote:
> >>>> On 7/10/2015 6:06 AM, Simon Glass wrote:
> >>>>> Hi,
> >>>>>
> >>>>> On 9 July 2015 at 05:58, Haikun Wang <haikun.wang@freescale.com> wrote:
> >>>>>> Showing both:
> >>>>>> Model: Freescale Layerscape 2085a QDS Board
> >>>>>> Board: LS2085E-QDS, Board Arch: V1, Board version: B, boot from vBank: 4
> >>>>>
> >>>>> This looks like duplication (at least the first part).
> >>>>>
> >>>>> Anyway I don't see any problem with this change.
> >>>> Hi Simon,
> >>>>
> >>>> The "model" information is hard-coded.
> >>>> Sometimes we need print run-time information of the board.
> >>>>
> >>>> We just want to print the version information and they are stored in the
> >>>> on-board FPGA registers on LS2085AQDS.
> >>>>
> >>>> Best regards,
> >>>> Wang Haikun
> >>>>>
> >>>>> Reviewed-by: Simon Glass <sjg@chromium.org>
> >>>
> >>> With rebase on u-boot/master, I now see board booting like this:
> >>>
> >>> Model: Intel Bayley Bay
> >>> Board: Unknown
> >>>
> >>> This looks a little bit odd (an unkown board?) to me. Does this mean
> >>> we need implement our own checkboard() for every board we support?
> >>>
> >>
> >>
> >> Absolutely, no.
> >>
> >> I do not want to implement checkboard() for my boards that
> >> have model names in DTS.
> >>
> >
> > Then can we make this __weak checkboard() print nothing instead?
>
> Sounds good to me.
>
>
>
>
>
> > Showing "Board: Unknown" makes me think something went wrong at first
> > glance.
>

I missed this impact of the patch. Yes that sounds good - Bin are you
going to do a new patch?

Regards,
Simon
Bin Meng July 30, 2015, 3:32 p.m. UTC | #9
Hi Simon,

On Thu, Jul 30, 2015 at 10:53 PM, Simon Glass <sjg@chromium.org> wrote:
> Hi,
>
> On 30 July 2015 at 04:55, Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
>>
>> 2015-07-30 19:51 GMT+09:00 Bin Meng <bmeng.cn@gmail.com>:
>> > On Thu, Jul 30, 2015 at 6:47 PM, Masahiro Yamada
>> > <yamada.masahiro@socionext.com> wrote:
>> >> 2015-07-30 19:42 GMT+09:00 Bin Meng <bmeng.cn@gmail.com>:
>> >>> Hi Haikun, Simon,
>> >>>
>> >>> On Fri, Jul 10, 2015 at 11:50 AM, Wang Haikun <Haikun.Wang@freescale.com> wrote:
>> >>>> On 7/10/2015 6:06 AM, Simon Glass wrote:
>> >>>>> Hi,
>> >>>>>
>> >>>>> On 9 July 2015 at 05:58, Haikun Wang <haikun.wang@freescale.com> wrote:
>> >>>>>> Showing both:
>> >>>>>> Model: Freescale Layerscape 2085a QDS Board
>> >>>>>> Board: LS2085E-QDS, Board Arch: V1, Board version: B, boot from vBank: 4
>> >>>>>
>> >>>>> This looks like duplication (at least the first part).
>> >>>>>
>> >>>>> Anyway I don't see any problem with this change.
>> >>>> Hi Simon,
>> >>>>
>> >>>> The "model" information is hard-coded.
>> >>>> Sometimes we need print run-time information of the board.
>> >>>>
>> >>>> We just want to print the version information and they are stored in the
>> >>>> on-board FPGA registers on LS2085AQDS.
>> >>>>
>> >>>> Best regards,
>> >>>> Wang Haikun
>> >>>>>
>> >>>>> Reviewed-by: Simon Glass <sjg@chromium.org>
>> >>>
>> >>> With rebase on u-boot/master, I now see board booting like this:
>> >>>
>> >>> Model: Intel Bayley Bay
>> >>> Board: Unknown
>> >>>
>> >>> This looks a little bit odd (an unkown board?) to me. Does this mean
>> >>> we need implement our own checkboard() for every board we support?
>> >>>
>> >>
>> >>
>> >> Absolutely, no.
>> >>
>> >> I do not want to implement checkboard() for my boards that
>> >> have model names in DTS.
>> >>
>> >
>> > Then can we make this __weak checkboard() print nothing instead?
>>
>> Sounds good to me.
>>
>>
>>
>>
>>
>> > Showing "Board: Unknown" makes me think something went wrong at first
>> > glance.
>>
>
> I missed this impact of the patch. Yes that sounds good - Bin are you
> going to do a new patch?
>

Yes, I will send a new patch for this.

Regards,
Bin
diff mbox

Patch

diff --git a/common/board_info.c b/common/board_info.c
index 42d0641..4e5a1f7 100644
--- a/common/board_info.c
+++ b/common/board_info.c
@@ -14,8 +14,7 @@  int __weak checkboard(void)
 
 /*
  * If the root node of the DTB has a "model" property, show it.
- * If CONFIG_OF_CONTROL is disabled or the "model" property is missing,
- * fall back to checkboard().
+ * Then call checkboard().
  */
 int show_board_info(void)
 {
@@ -25,10 +24,8 @@  int show_board_info(void)
 
 	model = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
 
-	if (model) {
+	if (model)
 		printf("Model: %s\n", model);
-		return 0;
-	}
 #endif
 
 	return checkboard();