diff mbox

[U-Boot] rockchip: Fix SPL console output when ROCKCHIP_SPL_BACK_TO_BROM is enabled

Message ID 1470838907-27696-1-git-send-email-apatterson@sightlogix.com
State Accepted
Commit 427351dc1d054b6d92814017f3ea6694474949b7
Delegated to: Simon Glass
Headers show

Commit Message

Sandy Patterson Aug. 10, 2016, 2:21 p.m. UTC
Move back_to_bootrom() call later in SPL init so that the console is
initialized and printouts happen.

Currently when ROCKCHIP_SPL_BACK_TO_BROM is enabled there is no console
output from the SPL init stages.

I wasn't sure exactly where this should happen, so if we are set to do
run spl_board_init, then go back to bootrom there after
preloader_console_init(). Otherwise fall back to old behavior of doing
it in board_init_f.

Signed-off-by: Sandy Patterson <apatterson@sightlogix.com>
---

 arch/arm/mach-rockchip/rk3288-board-spl.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Xu Ziyuan Aug. 11, 2016, 3:01 a.m. UTC | #1
On 2016年08月10日 22:21, Sandy Patterson wrote:
> Move back_to_bootrom() call later in SPL init so that the console is
> initialized and printouts happen.
>
> Currently when ROCKCHIP_SPL_BACK_TO_BROM is enabled there is no console
> output from the SPL init stages.
>
> I wasn't sure exactly where this should happen, so if we are set to do
> run spl_board_init, then go back to bootrom there after
> preloader_console_init(). Otherwise fall back to old behavior of doing
> it in board_init_f.
In fact, ROCKCHIP_SPL_BACK_TO_BROM's aim is to reduce SPL's size, and we 
can undef CONFIG_SPL_MMC_SUPPORT and other thing.
The SPL only in charge of DDR initialization, so that boot rom could 
load u-boot to RAM.
If you really need something output, you can enable EARYLY_UART in 
rk3288-board-spl.c:board_init_f().
But the above is my own understanding.
>
> Signed-off-by: Sandy Patterson <apatterson@sightlogix.com>
> ---
>
>   arch/arm/mach-rockchip/rk3288-board-spl.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c b/arch/arm/mach-rockchip/rk3288-board-spl.c
> index e0d92a6..0c2d525 100644
> --- a/arch/arm/mach-rockchip/rk3288-board-spl.c
> +++ b/arch/arm/mach-rockchip/rk3288-board-spl.c
> @@ -206,7 +206,7 @@ void board_init_f(ulong dummy)
>   		debug("DRAM init failed: %d\n", ret);
>   		return;
>   	}
> -#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
> +#if defined(CONFIG_ROCKCHIP_SPL_BACK_TO_BROM) && !defined(CONFIG_SPL_BOARD_INIT)
>   	back_to_bootrom();
>   #endif
>   }
> @@ -273,6 +273,9 @@ void spl_board_init(void)
>   	}
>   
>   	preloader_console_init();
> +#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
> +	back_to_bootrom();
> +#endif
>   	return;
>   err:
>   	printf("spl_board_init: Error %d\n", ret);
Sandy Patterson Aug. 11, 2016, 11:08 a.m. UTC | #2
On Wed, Aug 10, 2016 at 11:01 PM, Ziyuan Xu <xzy.xu@rock-chips.com> wrote:

>
>
> On 2016年08月10日 22:21, Sandy Patterson wrote:
>
>> Move back_to_bootrom() call later in SPL init so that the console is
>> initialized and printouts happen.
>>
>> Currently when ROCKCHIP_SPL_BACK_TO_BROM is enabled there is no console
>> output from the SPL init stages.
>>
>> I wasn't sure exactly where this should happen, so if we are set to do
>> run spl_board_init, then go back to bootrom there after
>> preloader_console_init(). Otherwise fall back to old behavior of doing
>> it in board_init_f.
>>
> In fact, ROCKCHIP_SPL_BACK_TO_BROM's aim is to reduce SPL's size, and we
> can undef CONFIG_SPL_MMC_SUPPORT and other thing.
> The SPL only in charge of DDR initialization, so that boot rom could load
> u-boot to RAM.
> If you really need something output, you can enable EARYLY_UART in
> rk3288-board-spl.c:board_init_f().
> But the above is my own understanding.


EARLY_UART is a good tool, but this patch just fixes printouts. It's not
enabling or disabling any code compilation. The console init and version
information code is there. I just move the back_to_bootrom call later in
the SPL if that later point exits. You can still
disable CONFIG_SPL_BOARD_INIT and it will fall back to calling the bootrom
earlier.

We don't actually need that much space. We chose to use BOOT_TO_BROM
instead of disabling the console in SPL.

We disable CONFIG_SPL_MMC_SUPPORT in our production system within the
rock2.h file if CONFIG_SPL_MMC_SUPPORT. I'll submit another patch for that.
I think if boootrom is used then the mmc should be removed from spl. I'm
not really sure how the config system is supposed to work in this case.


>
>> Signed-off-by: Sandy Patterson <apatterson@sightlogix.com>
>> ---
>>
>>   arch/arm/mach-rockchip/rk3288-board-spl.c | 5 ++++-
>>   1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c
>> b/arch/arm/mach-rockchip/rk3288-board-spl.c
>> index e0d92a6..0c2d525 100644
>> --- a/arch/arm/mach-rockchip/rk3288-board-spl.c
>> +++ b/arch/arm/mach-rockchip/rk3288-board-spl.c
>> @@ -206,7 +206,7 @@ void board_init_f(ulong dummy)
>>                 debug("DRAM init failed: %d\n", ret);
>>                 return;
>>         }
>> -#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
>> +#if defined(CONFIG_ROCKCHIP_SPL_BACK_TO_BROM) &&
>> !defined(CONFIG_SPL_BOARD_INIT)
>>         back_to_bootrom();
>>   #endif
>>   }
>> @@ -273,6 +273,9 @@ void spl_board_init(void)
>>         }
>>         preloader_console_init();
>> +#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
>> +       back_to_bootrom();
>> +#endif
>>         return;
>>   err:
>>         printf("spl_board_init: Error %d\n", ret);
>>
>
>
>
Xu Ziyuan Aug. 13, 2016, 11:08 a.m. UTC | #3
Acked-by: Ziyuan Xu <xzy.xu@rock-chips.com>


On 2016年08月11日 19:08, Sandy Patterson wrote:
>
> On Wed, Aug 10, 2016 at 11:01 PM, Ziyuan Xu <xzy.xu@rock-chips.com 
> <mailto:xzy.xu@rock-chips.com>> wrote:
>
>
>
>     On 2016年08月10日 22:21, Sandy Patterson wrote:
>
>         Move back_to_bootrom() call later in SPL init so that the
>         console is
>         initialized and printouts happen.
>
>         Currently when ROCKCHIP_SPL_BACK_TO_BROM is enabled there is
>         no console
>         output from the SPL init stages.
>
>         I wasn't sure exactly where this should happen, so if we are
>         set to do
>         run spl_board_init, then go back to bootrom there after
>         preloader_console_init(). Otherwise fall back to old behavior
>         of doing
>         it in board_init_f.
>
>     In fact, ROCKCHIP_SPL_BACK_TO_BROM's aim is to reduce SPL's size,
>     and we can undef CONFIG_SPL_MMC_SUPPORT and other thing.
>     The SPL only in charge of DDR initialization, so that boot rom
>     could load u-boot to RAM.
>     If you really need something output, you can enable EARYLY_UART in
>     rk3288-board-spl.c:board_init_f().
>     But the above is my own understanding.
>
> EARLY_UART is a good tool, but this patch just fixes printouts. It's 
> not enabling or disabling any code compilation. The console init and 
> version information code is there. I just move the back_to_bootrom 
> call later in the SPL if that later point exits. You can still 
> disable CONFIG_SPL_BOARD_INIT and it will fall back to calling the 
> bootrom earlier.
>
> We don't actually need that much space. We chose to use BOOT_TO_BROM 
> instead of disabling the console in SPL.
>
> We disable CONFIG_SPL_MMC_SUPPORT in our production system within the 
> rock2.h file if CONFIG_SPL_MMC_SUPPORT. I'll submit another patch for 
> that. I think if boootrom is used then the mmc should be removed from 
> spl. I'm not really sure how the config system is supposed to work in 
> this case.
>
>
>         Signed-off-by: Sandy Patterson <apatterson@sightlogix.com
>         <mailto:apatterson@sightlogix.com>>
>         ---
>
>           arch/arm/mach-rockchip/rk3288-board-spl.c | 5 ++++-
>           1 file changed, 4 insertions(+), 1 deletion(-)
>
>         diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c
>         b/arch/arm/mach-rockchip/rk3288-board-spl.c
>         index e0d92a6..0c2d525 100644
>         --- a/arch/arm/mach-rockchip/rk3288-board-spl.c
>         +++ b/arch/arm/mach-rockchip/rk3288-board-spl.c
>         @@ -206,7 +206,7 @@ void board_init_f(ulong dummy)
>                         debug("DRAM init failed: %d\n", ret);
>                         return;
>                 }
>         -#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
>         +#if defined(CONFIG_ROCKCHIP_SPL_BACK_TO_BROM) &&
>         !defined(CONFIG_SPL_BOARD_INIT)
>                 back_to_bootrom();
>           #endif
>           }
>         @@ -273,6 +273,9 @@ void spl_board_init(void)
>                 }
>                 preloader_console_init();
>         +#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
>         +       back_to_bootrom();
>         +#endif
>                 return;
>           err:
>                 printf("spl_board_init: Error %d\n", ret);
>
>
>
>
Simon Glass Sept. 23, 2016, 2:28 a.m. UTC | #4
Acked-by: Simon Glass <sjg@chromium.org>

On 13 August 2016 at 05:08, Ziyuan Xu <xzy.xu@rock-chips.com> wrote:
> Acked-by: Ziyuan Xu <xzy.xu@rock-chips.com>
>
>
> On 2016年08月11日 19:08, Sandy Patterson wrote:
>>
>>
>> On Wed, Aug 10, 2016 at 11:01 PM, Ziyuan Xu <xzy.xu@rock-chips.com
>> <mailto:xzy.xu@rock-chips.com>> wrote:
>>
>>
>>
>>     On 2016年08月10日 22:21, Sandy Patterson wrote:
>>
>>         Move back_to_bootrom() call later in SPL init so that the
>>         console is
>>         initialized and printouts happen.
>>
>>         Currently when ROCKCHIP_SPL_BACK_TO_BROM is enabled there is
>>         no console
>>         output from the SPL init stages.
>>
>>         I wasn't sure exactly where this should happen, so if we are
>>         set to do
>>         run spl_board_init, then go back to bootrom there after
>>         preloader_console_init(). Otherwise fall back to old behavior
>>         of doing
>>         it in board_init_f.
>>
>>     In fact, ROCKCHIP_SPL_BACK_TO_BROM's aim is to reduce SPL's size,
>>     and we can undef CONFIG_SPL_MMC_SUPPORT and other thing.
>>     The SPL only in charge of DDR initialization, so that boot rom
>>     could load u-boot to RAM.
>>     If you really need something output, you can enable EARYLY_UART in
>>     rk3288-board-spl.c:board_init_f().
>>     But the above is my own understanding.
>>
>> EARLY_UART is a good tool, but this patch just fixes printouts. It's not
>> enabling or disabling any code compilation. The console init and version
>> information code is there. I just move the back_to_bootrom call later in the
>> SPL if that later point exits. You can still disable CONFIG_SPL_BOARD_INIT
>> and it will fall back to calling the bootrom earlier.
>>
>> We don't actually need that much space. We chose to use BOOT_TO_BROM
>> instead of disabling the console in SPL.
>>
>> We disable CONFIG_SPL_MMC_SUPPORT in our production system within the
>> rock2.h file if CONFIG_SPL_MMC_SUPPORT. I'll submit another patch for that.
>> I think if boootrom is used then the mmc should be removed from spl. I'm not
>> really sure how the config system is supposed to work in this case.
>>
>>
>>         Signed-off-by: Sandy Patterson <apatterson@sightlogix.com
>>         <mailto:apatterson@sightlogix.com>>
>>         ---
>>
>>           arch/arm/mach-rockchip/rk3288-board-spl.c | 5 ++++-
>>           1 file changed, 4 insertions(+), 1 deletion(-)
>>
>>         diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c
>>         b/arch/arm/mach-rockchip/rk3288-board-spl.c
>>         index e0d92a6..0c2d525 100644
>>         --- a/arch/arm/mach-rockchip/rk3288-board-spl.c
>>         +++ b/arch/arm/mach-rockchip/rk3288-board-spl.c
>>         @@ -206,7 +206,7 @@ void board_init_f(ulong dummy)
>>                         debug("DRAM init failed: %d\n", ret);
>>                         return;
>>                 }
>>         -#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
>>         +#if defined(CONFIG_ROCKCHIP_SPL_BACK_TO_BROM) &&
>>         !defined(CONFIG_SPL_BOARD_INIT)
>>                 back_to_bootrom();
>>           #endif
>>           }
>>         @@ -273,6 +273,9 @@ void spl_board_init(void)
>>                 }
>>                 preloader_console_init();
>>         +#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
>>         +       back_to_bootrom();
>>         +#endif
>>                 return;
>>           err:
>>                 printf("spl_board_init: Error %d\n", ret);
>>
>>
>>
>>
>
>
Simon Glass Sept. 24, 2016, 12:02 a.m. UTC | #5
On 22 September 2016 at 20:28, Simon Glass <sjg@chromium.org> wrote:
> Acked-by: Simon Glass <sjg@chromium.org>
>
> On 13 August 2016 at 05:08, Ziyuan Xu <xzy.xu@rock-chips.com> wrote:
>> Acked-by: Ziyuan Xu <xzy.xu@rock-chips.com>
>>
>>
>> On 2016年08月11日 19:08, Sandy Patterson wrote:
>>>
>>>
>>> On Wed, Aug 10, 2016 at 11:01 PM, Ziyuan Xu <xzy.xu@rock-chips.com
>>> <mailto:xzy.xu@rock-chips.com>> wrote:
>>>
>>>
>>>
>>>     On 2016年08月10日 22:21, Sandy Patterson wrote:
>>>
>>>         Move back_to_bootrom() call later in SPL init so that the
>>>         console is
>>>         initialized and printouts happen.
>>>
>>>         Currently when ROCKCHIP_SPL_BACK_TO_BROM is enabled there is
>>>         no console
>>>         output from the SPL init stages.
>>>
>>>         I wasn't sure exactly where this should happen, so if we are
>>>         set to do
>>>         run spl_board_init, then go back to bootrom there after
>>>         preloader_console_init(). Otherwise fall back to old behavior
>>>         of doing
>>>         it in board_init_f.
>>>
>>>     In fact, ROCKCHIP_SPL_BACK_TO_BROM's aim is to reduce SPL's size,
>>>     and we can undef CONFIG_SPL_MMC_SUPPORT and other thing.
>>>     The SPL only in charge of DDR initialization, so that boot rom
>>>     could load u-boot to RAM.
>>>     If you really need something output, you can enable EARYLY_UART in
>>>     rk3288-board-spl.c:board_init_f().
>>>     But the above is my own understanding.
>>>
>>> EARLY_UART is a good tool, but this patch just fixes printouts. It's not
>>> enabling or disabling any code compilation. The console init and version
>>> information code is there. I just move the back_to_bootrom call later in the
>>> SPL if that later point exits. You can still disable CONFIG_SPL_BOARD_INIT
>>> and it will fall back to calling the bootrom earlier.
>>>
>>> We don't actually need that much space. We chose to use BOOT_TO_BROM
>>> instead of disabling the console in SPL.
>>>
>>> We disable CONFIG_SPL_MMC_SUPPORT in our production system within the
>>> rock2.h file if CONFIG_SPL_MMC_SUPPORT. I'll submit another patch for that.
>>> I think if boootrom is used then the mmc should be removed from spl. I'm not
>>> really sure how the config system is supposed to work in this case.


Applied to u-boot-rockchip, thanks!
diff mbox

Patch

diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c b/arch/arm/mach-rockchip/rk3288-board-spl.c
index e0d92a6..0c2d525 100644
--- a/arch/arm/mach-rockchip/rk3288-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3288-board-spl.c
@@ -206,7 +206,7 @@  void board_init_f(ulong dummy)
 		debug("DRAM init failed: %d\n", ret);
 		return;
 	}
-#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
+#if defined(CONFIG_ROCKCHIP_SPL_BACK_TO_BROM) && !defined(CONFIG_SPL_BOARD_INIT)
 	back_to_bootrom();
 #endif
 }
@@ -273,6 +273,9 @@  void spl_board_init(void)
 	}
 
 	preloader_console_init();
+#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
+	back_to_bootrom();
+#endif
 	return;
 err:
 	printf("spl_board_init: Error %d\n", ret);