[U-Boot,02/16] x86: Display the SPL banner only once

Message ID 20170319185935.20950-3-sjg@chromium.org
State Accepted
Delegated to: Bin Meng
Headers show

Commit Message

Simon Glass March 19, 2017, 6:59 p.m.
At present on a cold reboot we must reset the CPU to get it to full speed.
With 64-bit U-Boot this happens in SPL. At present we print the banner
before doing this, the end result being that we print the banner twice.
Print the banner a little later (after the CPU is ready) to avoid this.

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

 arch/x86/lib/spl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Bin Meng April 12, 2017, 3:09 a.m. | #1
Hi Simon,

On Mon, Mar 20, 2017 at 2:59 AM, Simon Glass <sjg@chromium.org> wrote:
> At present on a cold reboot we must reset the CPU to get it to full speed.
> With 64-bit U-Boot this happens in SPL. At present we print the banner
> before doing this, the end result being that we print the banner twice.
> Print the banner a little later (after the CPU is ready) to avoid this.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>  arch/x86/lib/spl.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>

Looks no difference when testing this on QEMU 64-bit. Am I missing anything?

Regards,
Bin
Simon Glass April 12, 2017, 3:29 a.m. | #2
Hi Bin,

On 11 April 2017 at 21:09, Bin Meng <bmeng.cn@gmail.com> wrote:
>
> Hi Simon,
>
> On Mon, Mar 20, 2017 at 2:59 AM, Simon Glass <sjg@chromium.org> wrote:
> > At present on a cold reboot we must reset the CPU to get it to full speed.
> > With 64-bit U-Boot this happens in SPL. At present we print the banner
> > before doing this, the end result being that we print the banner twice.
> > Print the banner a little later (after the CPU is ready) to avoid this.
> >
> > Signed-off-by: Simon Glass <sjg@chromium.org>
> > ---
> >
> >  arch/x86/lib/spl.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
>
> Looks no difference when testing this on QEMU 64-bit. Am I missing anything?

I suspect that QEMU doesn't have this problem, but on chromebook_link
we have to reset to change the CPU speed.

Regards,
Simon
Bin Meng April 18, 2017, 7:30 a.m. | #3
On Wed, Apr 12, 2017 at 11:29 AM, Simon Glass <sjg@chromium.org> wrote:
> Hi Bin,
>
> On 11 April 2017 at 21:09, Bin Meng <bmeng.cn@gmail.com> wrote:
>>
>> Hi Simon,
>>
>> On Mon, Mar 20, 2017 at 2:59 AM, Simon Glass <sjg@chromium.org> wrote:
>> > At present on a cold reboot we must reset the CPU to get it to full speed.
>> > With 64-bit U-Boot this happens in SPL. At present we print the banner
>> > before doing this, the end result being that we print the banner twice.
>> > Print the banner a little later (after the CPU is ready) to avoid this.
>> >
>> > Signed-off-by: Simon Glass <sjg@chromium.org>
>> > ---
>> >
>> >  arch/x86/lib/spl.c | 3 +--
>> >  1 file changed, 1 insertion(+), 2 deletions(-)
>> >
>>
>> Looks no difference when testing this on QEMU 64-bit. Am I missing anything?
>
> I suspect that QEMU doesn't have this problem, but on chromebook_link
> we have to reset to change the CPU speed.
>

That makes sense.

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested on QEMU
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Bin Meng April 18, 2017, 7:34 a.m. | #4
On Tue, Apr 18, 2017 at 3:30 PM, Bin Meng <bmeng.cn@gmail.com> wrote:
> On Wed, Apr 12, 2017 at 11:29 AM, Simon Glass <sjg@chromium.org> wrote:
>> Hi Bin,
>>
>> On 11 April 2017 at 21:09, Bin Meng <bmeng.cn@gmail.com> wrote:
>>>
>>> Hi Simon,
>>>
>>> On Mon, Mar 20, 2017 at 2:59 AM, Simon Glass <sjg@chromium.org> wrote:
>>> > At present on a cold reboot we must reset the CPU to get it to full speed.
>>> > With 64-bit U-Boot this happens in SPL. At present we print the banner
>>> > before doing this, the end result being that we print the banner twice.
>>> > Print the banner a little later (after the CPU is ready) to avoid this.
>>> >
>>> > Signed-off-by: Simon Glass <sjg@chromium.org>
>>> > ---
>>> >
>>> >  arch/x86/lib/spl.c | 3 +--
>>> >  1 file changed, 1 insertion(+), 2 deletions(-)
>>> >
>>>
>>> Looks no difference when testing this on QEMU 64-bit. Am I missing anything?
>>
>> I suspect that QEMU doesn't have this problem, but on chromebook_link
>> we have to reset to change the CPU speed.
>>
>
> That makes sense.
>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> Tested on QEMU
> Tested-by: Bin Meng <bmeng.cn@gmail.com>

applied to u-boot-x86, thanks!

Patch

diff --git a/arch/x86/lib/spl.c b/arch/x86/lib/spl.c
index ed2d40b552..fa93d64a7a 100644
--- a/arch/x86/lib/spl.c
+++ b/arch/x86/lib/spl.c
@@ -37,8 +37,6 @@  static int x86_spl_init(void)
 		debug("%s: spl_init() failed\n", __func__);
 		return ret;
 	}
-	preloader_console_init();
-
 	ret = arch_cpu_init();
 	if (ret) {
 		debug("%s: arch_cpu_init() failed\n", __func__);
@@ -49,6 +47,7 @@  static int x86_spl_init(void)
 		debug("%s: arch_cpu_init_dm() failed\n", __func__);
 		return ret;
 	}
+	preloader_console_init();
 	ret = print_cpuinfo();
 	if (ret) {
 		debug("%s: print_cpuinfo() failed\n", __func__);