All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/4] MIPS: call debug_uart_init right before board_init_f
@ 2017-04-23 10:50 Álvaro Fernández Rojas
  2017-04-23 10:50 ` [U-Boot] [PATCH 1/4] MIPS: QCA AP121: remove debug_uart_init call Álvaro Fernández Rojas
                   ` (4 more replies)
  0 siblings, 5 replies; 24+ messages in thread
From: Álvaro Fernández Rojas @ 2017-04-23 10:50 UTC (permalink / raw)
  To: u-boot

All MIPS boards that support debug uart are calling debug_uart_init right at
the beginning of board_early_init_f.
Instead of doing that, let's provide a generic call to debug_uart_init right
before the call to board_init_f if debug uart is enabled.

Daniel Schwierzeck (1):
  MIPS: call debug_uart_init right before board_init_f

Álvaro Fernández Rojas (3):
  MIPS: QCA AP121: remove debug_uart_init call
  MIPS: QCA AP143: remove debug_uart_init call
  MIPS: tl-wdr4300: remove debug_uart_init call

 arch/mips/cpu/start.S          |  6 ++++++
 board/qca/ap121/ap121.c        |  3 ---
 board/qca/ap143/ap143.c        |  3 ---
 board/tplink/wdr4300/wdr4300.c | 18 ++++++++++++++----
 4 files changed, 20 insertions(+), 10 deletions(-)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [U-Boot] [PATCH 1/4] MIPS: QCA AP121: remove debug_uart_init call
  2017-04-23 10:50 [U-Boot] [PATCH 0/4] MIPS: call debug_uart_init right before board_init_f Álvaro Fernández Rojas
@ 2017-04-23 10:50 ` Álvaro Fernández Rojas
  2017-04-23 10:50 ` [U-Boot] [PATCH 2/4] MIPS: QCA AP143: " Álvaro Fernández Rojas
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 24+ messages in thread
From: Álvaro Fernández Rojas @ 2017-04-23 10:50 UTC (permalink / raw)
  To: u-boot

In order to add a generic MIPS debug_uart_init call right before the call to
board_early_init_f, we need to remove all calls to debug_uart_init from every
MIPS boards.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
 board/qca/ap121/ap121.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/board/qca/ap121/ap121.c b/board/qca/ap121/ap121.c
index e245faa..ac9be35 100644
--- a/board/qca/ap121/ap121.c
+++ b/board/qca/ap121/ap121.c
@@ -43,9 +43,6 @@ void board_debug_uart_init(void)
 
 int board_early_init_f(void)
 {
-#ifdef CONFIG_DEBUG_UART
-	debug_uart_init();
-#endif
 	ddr_init();
 	ath79_eth_reset();
 	return 0;
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [U-Boot] [PATCH 2/4] MIPS: QCA AP143: remove debug_uart_init call
  2017-04-23 10:50 [U-Boot] [PATCH 0/4] MIPS: call debug_uart_init right before board_init_f Álvaro Fernández Rojas
  2017-04-23 10:50 ` [U-Boot] [PATCH 1/4] MIPS: QCA AP121: remove debug_uart_init call Álvaro Fernández Rojas
@ 2017-04-23 10:50 ` Álvaro Fernández Rojas
  2017-04-23 10:50 ` [U-Boot] [PATCH 3/4] MIPS: tl-wdr4300: " Álvaro Fernández Rojas
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 24+ messages in thread
From: Álvaro Fernández Rojas @ 2017-04-23 10:50 UTC (permalink / raw)
  To: u-boot

In order to add a generic MIPS debug_uart_init call right before the call to
board_early_init_f, we need to remove all calls to debug_uart_init from every
MIPS boards.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
 board/qca/ap143/ap143.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/board/qca/ap143/ap143.c b/board/qca/ap143/ap143.c
index e921ea5..19b55ac 100644
--- a/board/qca/ap143/ap143.c
+++ b/board/qca/ap143/ap143.c
@@ -59,9 +59,6 @@ void board_debug_uart_init(void)
 
 int board_early_init_f(void)
 {
-#ifdef CONFIG_DEBUG_UART
-	debug_uart_init();
-#endif
 	ddr_init();
 	ath79_eth_reset();
 	return 0;
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [U-Boot] [PATCH 3/4] MIPS: tl-wdr4300: remove debug_uart_init call
  2017-04-23 10:50 [U-Boot] [PATCH 0/4] MIPS: call debug_uart_init right before board_init_f Álvaro Fernández Rojas
  2017-04-23 10:50 ` [U-Boot] [PATCH 1/4] MIPS: QCA AP121: remove debug_uart_init call Álvaro Fernández Rojas
  2017-04-23 10:50 ` [U-Boot] [PATCH 2/4] MIPS: QCA AP143: " Álvaro Fernández Rojas
@ 2017-04-23 10:50 ` Álvaro Fernández Rojas
  2017-04-23 10:50 ` [U-Boot] [PATCH 4/4] MIPS: call debug_uart_init right before board_init_f Álvaro Fernández Rojas
  2017-04-24 17:03 ` [U-Boot] [PATCH 0/4] " Álvaro Fernández Rojas
  4 siblings, 0 replies; 24+ messages in thread
From: Álvaro Fernández Rojas @ 2017-04-23 10:50 UTC (permalink / raw)
  To: u-boot

In order to add a generic MIPS debug_uart_init call right before the call to
board_early_init_f, we need to remove all calls to debug_uart_init from every
MIPS boards.
WDR4300 doesn't provide a board_debug_uart_init and configures pinmux in
board_early_init_f instead. Since I have no idead of what's the needed uart
pinmux config, I copied the whole pinmux config to a new function that is
called from board_early_init_f if CONFIG_DEBUG_UART_BOARD_INIT is not enabled.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
 board/tplink/wdr4300/wdr4300.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/board/tplink/wdr4300/wdr4300.c b/board/tplink/wdr4300/wdr4300.c
index 6e070fd..0f59648 100644
--- a/board/tplink/wdr4300/wdr4300.c
+++ b/board/tplink/wdr4300/wdr4300.c
@@ -34,8 +34,7 @@ static void wdr4300_usb_start(void)
 static inline void wdr4300_usb_start(void) {}
 #endif
 
-#ifdef CONFIG_BOARD_EARLY_INIT_F
-int board_early_init_f(void)
+void wdr4300_pinmux_config(void)
 {
 	void __iomem *regs;
 
@@ -56,9 +55,20 @@ int board_early_init_f(void)
 	writel(0x00000000, regs + AR934X_GPIO_REG_OUT_FUNC3);
 	writel(0x0000004d, regs + AR934X_GPIO_REG_OUT_FUNC4);
 	writel(0x00000000, regs + AR934X_GPIO_REG_OUT_FUNC5);
+}
+
+#ifdef CONFIG_DEBUG_UART_BOARD_INIT
+void board_debug_uart_init(void)
+{
+	wdr4300_pinmux_config();
+}
+#endif
 
-#ifdef CONFIG_DEBUG_UART
-	debug_uart_init();
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+int board_early_init_f(void)
+{
+#ifndef CONFIG_DEBUG_UART_BOARD_INIT
+	wdr4300_pinmux_config();
 #endif
 
 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [U-Boot] [PATCH 4/4] MIPS: call debug_uart_init right before board_init_f
  2017-04-23 10:50 [U-Boot] [PATCH 0/4] MIPS: call debug_uart_init right before board_init_f Álvaro Fernández Rojas
                   ` (2 preceding siblings ...)
  2017-04-23 10:50 ` [U-Boot] [PATCH 3/4] MIPS: tl-wdr4300: " Álvaro Fernández Rojas
@ 2017-04-23 10:50 ` Álvaro Fernández Rojas
  2017-04-23 11:09   ` Marek Vasut
  2017-04-23 19:09   ` Daniel Schwierzeck
  2017-04-24 17:03 ` [U-Boot] [PATCH 0/4] " Álvaro Fernández Rojas
  4 siblings, 2 replies; 24+ messages in thread
From: Álvaro Fernández Rojas @ 2017-04-23 10:50 UTC (permalink / raw)
  To: u-boot

From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

All MIPS boards that support debug uart are calling debug_uart_init right at
the beginning of board_early_init_f.
Instead of doing that, let's provide a generic call to debug_uart_init right
before the call to board_init_f if debug uart is enabled.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
 arch/mips/cpu/start.S | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/mips/cpu/start.S b/arch/mips/cpu/start.S
index 6740fdf..f7dee81 100644
--- a/arch/mips/cpu/start.S
+++ b/arch/mips/cpu/start.S
@@ -265,6 +265,12 @@ wr_done:
 	setup_stack_gd
 #endif
 
+#ifdef CONFIG_DEBUG_UART
+	PTR_LA	t9, debug_uart_init
+	jalr	t9
+	 nop
+#endif
+
 	move	a0, zero		# a0 <-- boot_flags = 0
 	PTR_LA	t9, board_init_f
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [U-Boot] [PATCH 4/4] MIPS: call debug_uart_init right before board_init_f
  2017-04-23 10:50 ` [U-Boot] [PATCH 4/4] MIPS: call debug_uart_init right before board_init_f Álvaro Fernández Rojas
@ 2017-04-23 11:09   ` Marek Vasut
  2017-04-23 11:31     ` Álvaro Fernández Rojas
  2017-04-23 19:09   ` Daniel Schwierzeck
  1 sibling, 1 reply; 24+ messages in thread
From: Marek Vasut @ 2017-04-23 11:09 UTC (permalink / raw)
  To: u-boot

On 04/23/2017 12:50 PM, Álvaro Fernández Rojas wrote:
> From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
> 
> All MIPS boards that support debug uart are calling debug_uart_init right at
> the beginning of board_early_init_f.
> Instead of doing that, let's provide a generic call to debug_uart_init right
> before the call to board_init_f if debug uart is enabled.
> 
> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
> ---
>  arch/mips/cpu/start.S | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/arch/mips/cpu/start.S b/arch/mips/cpu/start.S
> index 6740fdf..f7dee81 100644
> --- a/arch/mips/cpu/start.S
> +++ b/arch/mips/cpu/start.S
> @@ -265,6 +265,12 @@ wr_done:
>  	setup_stack_gd
>  #endif
>  
> +#ifdef CONFIG_DEBUG_UART
> +	PTR_LA	t9, debug_uart_init

This should be called from C code somewhere, in fact, doesn't SPL's
common code call debug_uart_init already ?

> +	jalr	t9
> +	 nop
> +#endif
> +
>  	move	a0, zero		# a0 <-- boot_flags = 0
>  	PTR_LA	t9, board_init_f
>  
> 


-- 
Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [U-Boot] [PATCH 4/4] MIPS: call debug_uart_init right before board_init_f
  2017-04-23 11:09   ` Marek Vasut
@ 2017-04-23 11:31     ` Álvaro Fernández Rojas
  2017-04-23 11:44       ` Marek Vasut
  0 siblings, 1 reply; 24+ messages in thread
From: Álvaro Fernández Rojas @ 2017-04-23 11:31 UTC (permalink / raw)
  To: u-boot

Hi Marek,

El 23/04/2017 a las 13:09, Marek Vasut escribió:
> On 04/23/2017 12:50 PM, Álvaro Fernández Rojas wrote:
>> From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
>>
>> All MIPS boards that support debug uart are calling debug_uart_init right at
>> the beginning of board_early_init_f.
>> Instead of doing that, let's provide a generic call to debug_uart_init right
>> before the call to board_init_f if debug uart is enabled.
>>
>> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
>> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
>> ---
>>  arch/mips/cpu/start.S | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/arch/mips/cpu/start.S b/arch/mips/cpu/start.S
>> index 6740fdf..f7dee81 100644
>> --- a/arch/mips/cpu/start.S
>> +++ b/arch/mips/cpu/start.S
>> @@ -265,6 +265,12 @@ wr_done:
>>  	setup_stack_gd
>>  #endif
>>  
>> +#ifdef CONFIG_DEBUG_UART
>> +	PTR_LA	t9, debug_uart_init
> 
> This should be called from C code somewhere, in fact, doesn't SPL's
> common code call debug_uart_init already ?

Why should this be called from C code?
BTW, I don't think that SPL common code calls debug_uart_init.

> 
>> +	jalr	t9
>> +	 nop
>> +#endif
>> +
>>  	move	a0, zero		# a0 <-- boot_flags = 0
>>  	PTR_LA	t9, board_init_f
>>  
>>
> 
> 

Regards,
Álvaro.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [U-Boot] [PATCH 4/4] MIPS: call debug_uart_init right before board_init_f
  2017-04-23 11:31     ` Álvaro Fernández Rojas
@ 2017-04-23 11:44       ` Marek Vasut
  2017-04-23 12:04         ` Álvaro Fernández Rojas
  0 siblings, 1 reply; 24+ messages in thread
From: Marek Vasut @ 2017-04-23 11:44 UTC (permalink / raw)
  To: u-boot

On 04/23/2017 01:31 PM, Álvaro Fernández Rojas wrote:
> Hi Marek,
> 
> El 23/04/2017 a las 13:09, Marek Vasut escribió:
>> On 04/23/2017 12:50 PM, Álvaro Fernández Rojas wrote:
>>> From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
>>>
>>> All MIPS boards that support debug uart are calling debug_uart_init right at
>>> the beginning of board_early_init_f.
>>> Instead of doing that, let's provide a generic call to debug_uart_init right
>>> before the call to board_init_f if debug uart is enabled.
>>>
>>> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
>>> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
>>> ---
>>>  arch/mips/cpu/start.S | 6 ++++++
>>>  1 file changed, 6 insertions(+)
>>>
>>> diff --git a/arch/mips/cpu/start.S b/arch/mips/cpu/start.S
>>> index 6740fdf..f7dee81 100644
>>> --- a/arch/mips/cpu/start.S
>>> +++ b/arch/mips/cpu/start.S
>>> @@ -265,6 +265,12 @@ wr_done:
>>>  	setup_stack_gd
>>>  #endif
>>>  
>>> +#ifdef CONFIG_DEBUG_UART
>>> +	PTR_LA	t9, debug_uart_init
>>
>> This should be called from C code somewhere, in fact, doesn't SPL's
>> common code call debug_uart_init already ?
> 
> Why should this be called from C code?

Because the less stuff we have in assembler the better.

> BTW, I don't think that SPL common code calls debug_uart_init.

That's where it would make sense, grepping through the source indicates
a lot of boards call this from their spl code. Also, you enter
board_init_f right below, so you can start there ...

>>
>>> +	jalr	t9
>>> +	 nop
>>> +#endif
>>> +
>>>  	move	a0, zero		# a0 <-- boot_flags = 0
>>>  	PTR_LA	t9, board_init_f
>>>  
>>>
>>
>>
> 
> Regards,
> Álvaro.
> 


-- 
Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [U-Boot] [PATCH 4/4] MIPS: call debug_uart_init right before board_init_f
  2017-04-23 11:44       ` Marek Vasut
@ 2017-04-23 12:04         ` Álvaro Fernández Rojas
  2017-04-23 17:08           ` Marek Vasut
  0 siblings, 1 reply; 24+ messages in thread
From: Álvaro Fernández Rojas @ 2017-04-23 12:04 UTC (permalink / raw)
  To: u-boot

Hi Marek,

El 23/04/2017 a las 13:44, Marek Vasut escribió:
> On 04/23/2017 01:31 PM, Álvaro Fernández Rojas wrote:
>> Hi Marek,
>>
>> El 23/04/2017 a las 13:09, Marek Vasut escribió:
>>> On 04/23/2017 12:50 PM, Álvaro Fernández Rojas wrote:
>>>> From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
>>>>
>>>> All MIPS boards that support debug uart are calling debug_uart_init right at
>>>> the beginning of board_early_init_f.
>>>> Instead of doing that, let's provide a generic call to debug_uart_init right
>>>> before the call to board_init_f if debug uart is enabled.
>>>>
>>>> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
>>>> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
>>>> ---
>>>>  arch/mips/cpu/start.S | 6 ++++++
>>>>  1 file changed, 6 insertions(+)
>>>>
>>>> diff --git a/arch/mips/cpu/start.S b/arch/mips/cpu/start.S
>>>> index 6740fdf..f7dee81 100644
>>>> --- a/arch/mips/cpu/start.S
>>>> +++ b/arch/mips/cpu/start.S
>>>> @@ -265,6 +265,12 @@ wr_done:
>>>>  	setup_stack_gd
>>>>  #endif
>>>>  
>>>> +#ifdef CONFIG_DEBUG_UART
>>>> +	PTR_LA	t9, debug_uart_init
>>>
>>> This should be called from C code somewhere, in fact, doesn't SPL's
>>> common code call debug_uart_init already ?
>>
>> Why should this be called from C code?
> 
> Because the less stuff we have in assembler the better.
... or not.

> 
>> BTW, I don't think that SPL common code calls debug_uart_init.
> 
> That's where it would make sense, grepping through the source indicates
> a lot of boards call this from their spl code. Also, you enter
> board_init_f right below, so you can start there ...
Actually I was going to do that and Daniel suggested otherwise :)
https://lists.denx.de/pipermail/u-boot/2017-April/287388.html
---
I think we should move this to MIPS start.S to support this for all MIPS
boards in a generic way. Puttings following code between
'setup_stack_gd' and the jump to 'board_init_f' should work:

#ifdef CONFIG_DEBUG_UART
	PTR_LA	t9, debug_uart_init
	jalr	t9
	 nop
#endif
---
BTW, like Daniel I also think this is the proper way to go.

> 
>>>
>>>> +	jalr	t9
>>>> +	 nop
>>>> +#endif
>>>> +
>>>>  	move	a0, zero		# a0 <-- boot_flags = 0
>>>>  	PTR_LA	t9, board_init_f
>>>>  
>>>>
>>>
>>>
>>
>> Regards,
>> Álvaro.
>>
> 
> 

Regards,
Álvaro.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [U-Boot] [PATCH 4/4] MIPS: call debug_uart_init right before board_init_f
  2017-04-23 12:04         ` Álvaro Fernández Rojas
@ 2017-04-23 17:08           ` Marek Vasut
  2017-04-23 19:04             ` Daniel Schwierzeck
  0 siblings, 1 reply; 24+ messages in thread
From: Marek Vasut @ 2017-04-23 17:08 UTC (permalink / raw)
  To: u-boot

On 04/23/2017 02:04 PM, Álvaro Fernández Rojas wrote:
> Hi Marek,
> 
> El 23/04/2017 a las 13:44, Marek Vasut escribió:
>> On 04/23/2017 01:31 PM, Álvaro Fernández Rojas wrote:
>>> Hi Marek,
>>>
>>> El 23/04/2017 a las 13:09, Marek Vasut escribió:
>>>> On 04/23/2017 12:50 PM, Álvaro Fernández Rojas wrote:
>>>>> From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
>>>>>
>>>>> All MIPS boards that support debug uart are calling debug_uart_init right at
>>>>> the beginning of board_early_init_f.
>>>>> Instead of doing that, let's provide a generic call to debug_uart_init right
>>>>> before the call to board_init_f if debug uart is enabled.
>>>>>
>>>>> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
>>>>> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
>>>>> ---
>>>>>  arch/mips/cpu/start.S | 6 ++++++
>>>>>  1 file changed, 6 insertions(+)
>>>>>
>>>>> diff --git a/arch/mips/cpu/start.S b/arch/mips/cpu/start.S
>>>>> index 6740fdf..f7dee81 100644
>>>>> --- a/arch/mips/cpu/start.S
>>>>> +++ b/arch/mips/cpu/start.S
>>>>> @@ -265,6 +265,12 @@ wr_done:
>>>>>  	setup_stack_gd
>>>>>  #endif
>>>>>  
>>>>> +#ifdef CONFIG_DEBUG_UART
>>>>> +	PTR_LA	t9, debug_uart_init
>>>>
>>>> This should be called from C code somewhere, in fact, doesn't SPL's
>>>> common code call debug_uart_init already ?
>>>
>>> Why should this be called from C code?
>>
>> Because the less stuff we have in assembler the better.
> ... or not.
> 
>>
>>> BTW, I don't think that SPL common code calls debug_uart_init.
>>
>> That's where it would make sense, grepping through the source indicates
>> a lot of boards call this from their spl code. Also, you enter
>> board_init_f right below, so you can start there ...
> Actually I was going to do that and Daniel suggested otherwise :)
> https://lists.denx.de/pipermail/u-boot/2017-April/287388.html
> ---
> I think we should move this to MIPS start.S to support this for all MIPS
> boards in a generic way. Puttings following code between
> 'setup_stack_gd' and the jump to 'board_init_f' should work:
> 
> #ifdef CONFIG_DEBUG_UART
> 	PTR_LA	t9, debug_uart_init
> 	jalr	t9
> 	 nop
> #endif
> ---
> BTW, like Daniel I also think this is the proper way to go.

Can you elaborate why is it better to put more stuff into the assembler
rather than C? I'd love to hear the rationale for that.

I agree this should be called from common code , I disagree this should
be called from assembler.

-- 
Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [U-Boot] [PATCH 4/4] MIPS: call debug_uart_init right before board_init_f
  2017-04-23 17:08           ` Marek Vasut
@ 2017-04-23 19:04             ` Daniel Schwierzeck
  2017-04-23 19:40               ` Marek Vasut
  0 siblings, 1 reply; 24+ messages in thread
From: Daniel Schwierzeck @ 2017-04-23 19:04 UTC (permalink / raw)
  To: u-boot



Am 23.04.2017 um 19:08 schrieb Marek Vasut:
> On 04/23/2017 02:04 PM, Álvaro Fernández Rojas wrote:
>> Hi Marek,
>>
>> El 23/04/2017 a las 13:44, Marek Vasut escribió:
>>> On 04/23/2017 01:31 PM, Álvaro Fernández Rojas wrote:
>>>> Hi Marek,
>>>>
>>>> El 23/04/2017 a las 13:09, Marek Vasut escribió:
>>>>> On 04/23/2017 12:50 PM, Álvaro Fernández Rojas wrote:
>>>>>> From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
>>>>>>
>>>>>> All MIPS boards that support debug uart are calling debug_uart_init right at
>>>>>> the beginning of board_early_init_f.
>>>>>> Instead of doing that, let's provide a generic call to debug_uart_init right
>>>>>> before the call to board_init_f if debug uart is enabled.
>>>>>>
>>>>>> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
>>>>>> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
>>>>>> ---
>>>>>>  arch/mips/cpu/start.S | 6 ++++++
>>>>>>  1 file changed, 6 insertions(+)
>>>>>>
>>>>>> diff --git a/arch/mips/cpu/start.S b/arch/mips/cpu/start.S
>>>>>> index 6740fdf..f7dee81 100644
>>>>>> --- a/arch/mips/cpu/start.S
>>>>>> +++ b/arch/mips/cpu/start.S
>>>>>> @@ -265,6 +265,12 @@ wr_done:
>>>>>>  	setup_stack_gd
>>>>>>  #endif
>>>>>>  
>>>>>> +#ifdef CONFIG_DEBUG_UART
>>>>>> +	PTR_LA	t9, debug_uart_init
>>>>>
>>>>> This should be called from C code somewhere, in fact, doesn't SPL's
>>>>> common code call debug_uart_init already ?
>>>>
>>>> Why should this be called from C code?
>>>
>>> Because the less stuff we have in assembler the better.
>> ... or not.
>>
>>>
>>>> BTW, I don't think that SPL common code calls debug_uart_init.
>>>
>>> That's where it would make sense, grepping through the source indicates
>>> a lot of boards call this from their spl code. Also, you enter
>>> board_init_f right below, so you can start there ...
>> Actually I was going to do that and Daniel suggested otherwise :)
>> https://lists.denx.de/pipermail/u-boot/2017-April/287388.html
>> ---
>> I think we should move this to MIPS start.S to support this for all MIPS
>> boards in a generic way. Puttings following code between
>> 'setup_stack_gd' and the jump to 'board_init_f' should work:
>>
>> #ifdef CONFIG_DEBUG_UART
>> 	PTR_LA	t9, debug_uart_init
>> 	jalr	t9
>> 	 nop
>> #endif
>> ---
>> BTW, like Daniel I also think this is the proper way to go.
> 
> Can you elaborate why is it better to put more stuff into the assembler
> rather than C? I'd love to hear the rationale for that.
> 
> I agree this should be called from common code , I disagree this should
> be called from assembler.
> 

The purpose of debug_uart_init is to run as early as possible to provide
debug output in the init code until serial_init/console_init_f have been
executed. The earliest point for debug_uart_init depends on arch and/or
SoC. On MIPS this point is directly after the setup_stack_gd macro.
Actually there are two points on MIPS. One is before calling
lowlevel_init when the stack can be used from some SRAM (option
CONFIG_MIPS_INIT_STACK_IN_SRAM). This allows on some MIPS SoC's (not on
all!) to implement lowlevel_init in C and to use debug_uart. This can't
be realized with common code called from board_init_f. And no MIPS board
currently boots with SPL, so calling debug_uart_init from spl.c is also
not an option.

Also the earliest board-specific callback from board_init_f is
board_early_init_f from where some MIPS boards already call
debug_uart_init. Before each new MIPS board copies this style, it's
better to solve this in a generic way at least for MIPS. Solving this
for all archs would mean to call debug_uart_init as the first function
in board_init_f. But this would conflict with some archs (x86, xtensa,
nios) which already calling debug_uart_init from start.S.

-- 
- Daniel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170423/6356693c/attachment.sig>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [U-Boot] [PATCH 4/4] MIPS: call debug_uart_init right before board_init_f
  2017-04-23 10:50 ` [U-Boot] [PATCH 4/4] MIPS: call debug_uart_init right before board_init_f Álvaro Fernández Rojas
  2017-04-23 11:09   ` Marek Vasut
@ 2017-04-23 19:09   ` Daniel Schwierzeck
  1 sibling, 0 replies; 24+ messages in thread
From: Daniel Schwierzeck @ 2017-04-23 19:09 UTC (permalink / raw)
  To: u-boot



Am 23.04.2017 um 12:50 schrieb Álvaro Fernández Rojas:
> From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
> 
> All MIPS boards that support debug uart are calling debug_uart_init right at
> the beginning of board_early_init_f.
> Instead of doing that, let's provide a generic call to debug_uart_init right
> before the call to board_init_f if debug uart is enabled.
> 
> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
> ---
>  arch/mips/cpu/start.S | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/arch/mips/cpu/start.S b/arch/mips/cpu/start.S
> index 6740fdf..f7dee81 100644
> --- a/arch/mips/cpu/start.S
> +++ b/arch/mips/cpu/start.S
> @@ -265,6 +265,12 @@ wr_done:
>  	setup_stack_gd
>  #endif
>  
> +#ifdef CONFIG_DEBUG_UART
> +	PTR_LA	t9, debug_uart_init
> +	jalr	t9
> +	 nop
> +#endif
> +

I think we should move this inside the "#ifndef
CONFIG_MIPS_INIT_STACK_IN_SRAM ... #endif" block and also add this in
the "#ifdef CONFIG_MIPS_INIT_STACK_IN_SRAM ... #endif" block above. This
way a SoC can use debug_uart also in lowlevel_init if it supports the
initial stack in SRAM with option CONFIG_MIPS_INIT_STACK_IN_SRAM.

>  	move	a0, zero		# a0 <-- boot_flags = 0
>  	PTR_LA	t9, board_init_f
>  
> 

-- 
- Daniel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170423/bcf1c422/attachment.sig>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [U-Boot] [PATCH 4/4] MIPS: call debug_uart_init right before board_init_f
  2017-04-23 19:04             ` Daniel Schwierzeck
@ 2017-04-23 19:40               ` Marek Vasut
  0 siblings, 0 replies; 24+ messages in thread
From: Marek Vasut @ 2017-04-23 19:40 UTC (permalink / raw)
  To: u-boot

On 04/23/2017 09:04 PM, Daniel Schwierzeck wrote:
> 
> 
> Am 23.04.2017 um 19:08 schrieb Marek Vasut:
>> On 04/23/2017 02:04 PM, Álvaro Fernández Rojas wrote:
>>> Hi Marek,
>>>
>>> El 23/04/2017 a las 13:44, Marek Vasut escribió:
>>>> On 04/23/2017 01:31 PM, Álvaro Fernández Rojas wrote:
>>>>> Hi Marek,
>>>>>
>>>>> El 23/04/2017 a las 13:09, Marek Vasut escribió:
>>>>>> On 04/23/2017 12:50 PM, Álvaro Fernández Rojas wrote:
>>>>>>> From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
>>>>>>>
>>>>>>> All MIPS boards that support debug uart are calling debug_uart_init right at
>>>>>>> the beginning of board_early_init_f.
>>>>>>> Instead of doing that, let's provide a generic call to debug_uart_init right
>>>>>>> before the call to board_init_f if debug uart is enabled.
>>>>>>>
>>>>>>> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
>>>>>>> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
>>>>>>> ---
>>>>>>>  arch/mips/cpu/start.S | 6 ++++++
>>>>>>>  1 file changed, 6 insertions(+)
>>>>>>>
>>>>>>> diff --git a/arch/mips/cpu/start.S b/arch/mips/cpu/start.S
>>>>>>> index 6740fdf..f7dee81 100644
>>>>>>> --- a/arch/mips/cpu/start.S
>>>>>>> +++ b/arch/mips/cpu/start.S
>>>>>>> @@ -265,6 +265,12 @@ wr_done:
>>>>>>>  	setup_stack_gd
>>>>>>>  #endif
>>>>>>>  
>>>>>>> +#ifdef CONFIG_DEBUG_UART
>>>>>>> +	PTR_LA	t9, debug_uart_init
>>>>>>
>>>>>> This should be called from C code somewhere, in fact, doesn't SPL's
>>>>>> common code call debug_uart_init already ?
>>>>>
>>>>> Why should this be called from C code?
>>>>
>>>> Because the less stuff we have in assembler the better.
>>> ... or not.
>>>
>>>>
>>>>> BTW, I don't think that SPL common code calls debug_uart_init.
>>>>
>>>> That's where it would make sense, grepping through the source indicates
>>>> a lot of boards call this from their spl code. Also, you enter
>>>> board_init_f right below, so you can start there ...
>>> Actually I was going to do that and Daniel suggested otherwise :)
>>> https://lists.denx.de/pipermail/u-boot/2017-April/287388.html
>>> ---
>>> I think we should move this to MIPS start.S to support this for all MIPS
>>> boards in a generic way. Puttings following code between
>>> 'setup_stack_gd' and the jump to 'board_init_f' should work:
>>>
>>> #ifdef CONFIG_DEBUG_UART
>>> 	PTR_LA	t9, debug_uart_init
>>> 	jalr	t9
>>> 	 nop
>>> #endif
>>> ---
>>> BTW, like Daniel I also think this is the proper way to go.
>>
>> Can you elaborate why is it better to put more stuff into the assembler
>> rather than C? I'd love to hear the rationale for that.
>>
>> I agree this should be called from common code , I disagree this should
>> be called from assembler.
>>
> 
> The purpose of debug_uart_init is to run as early as possible to provide
> debug output in the init code until serial_init/console_init_f have been
> executed. The earliest point for debug_uart_init depends on arch and/or
> SoC. On MIPS this point is directly after the setup_stack_gd macro.
> Actually there are two points on MIPS. One is before calling
> lowlevel_init when the stack can be used from some SRAM (option
> CONFIG_MIPS_INIT_STACK_IN_SRAM). This allows on some MIPS SoC's (not on
> all!) to implement lowlevel_init in C and to use debug_uart. This can't
> be realized with common code called from board_init_f. And no MIPS board
> currently boots with SPL, so calling debug_uart_init from spl.c is also
> not an option.
> 
> Also the earliest board-specific callback from board_init_f is
> board_early_init_f from where some MIPS boards already call
> debug_uart_init. Before each new MIPS board copies this style, it's
> better to solve this in a generic way at least for MIPS. Solving this
> for all archs would mean to call debug_uart_init as the first function
> in board_init_f. But this would conflict with some archs (x86, xtensa,
> nios) which already calling debug_uart_init from start.S.

Then it might be time to drain the swamp ? Although that'd likely be way
out of scope of this patchset.

Isn't arch_cpu_init() called way before board_early_init_f() and
possibly the right place for you to put it ? If not, adding another
entry into init_sequence_f might be an option (note that this patch adds
the call to debug_uart_init() right before jumping into board_init_f ,
not right after setup_stack_gd ).

I cannot say I'm a big fan of growing something comparable to
init_sequence_f in mips assembler ... the assembler parts should only be
used to bring up the most basic environment to run C code, the rest
should be implemented in C code.

-- 
Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [U-Boot] [PATCH 0/4] MIPS: call debug_uart_init right before board_init_f
  2017-04-23 10:50 [U-Boot] [PATCH 0/4] MIPS: call debug_uart_init right before board_init_f Álvaro Fernández Rojas
                   ` (3 preceding siblings ...)
  2017-04-23 10:50 ` [U-Boot] [PATCH 4/4] MIPS: call debug_uart_init right before board_init_f Álvaro Fernández Rojas
@ 2017-04-24 17:03 ` Álvaro Fernández Rojas
  2017-04-24 17:03   ` [U-Boot] [PATCH 1/4] MIPS: QCA AP121: remove debug_uart_init call Álvaro Fernández Rojas
                     ` (4 more replies)
  4 siblings, 5 replies; 24+ messages in thread
From: Álvaro Fernández Rojas @ 2017-04-24 17:03 UTC (permalink / raw)
  To: u-boot

All MIPS boards that support debug uart are calling debug_uart_init right at
the beginning of board_early_init_f.
Instead of doing that, let's provide a generic call to debug_uart_init right
before the call to board_init_f if debug uart is enabled.

v2: Introduce the changes suggested by Daniel Schwierzeck:
 - Call debug_uart_init before low level init for boards with stack in SRAM.

Daniel Schwierzeck (1):
  MIPS: call debug_uart_init right before board_init_f

Álvaro Fernández Rojas (3):
  MIPS: QCA AP121: remove debug_uart_init call
  MIPS: QCA AP143: remove debug_uart_init call
  MIPS: tl-wdr4300: remove debug_uart_init call

 arch/mips/cpu/start.S          | 14 ++++++++++++++
 board/qca/ap121/ap121.c        |  3 ---
 board/qca/ap143/ap143.c        |  3 ---
 board/tplink/wdr4300/wdr4300.c | 18 ++++++++++++++----
 4 files changed, 28 insertions(+), 10 deletions(-)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [U-Boot] [PATCH 1/4] MIPS: QCA AP121: remove debug_uart_init call
  2017-04-24 17:03 ` [U-Boot] [PATCH 0/4] " Álvaro Fernández Rojas
@ 2017-04-24 17:03   ` Álvaro Fernández Rojas
  2017-04-30 18:22     ` Daniel Schwierzeck
  2017-04-24 17:03   ` [U-Boot] [PATCH 2/4] MIPS: QCA AP143: " Álvaro Fernández Rojas
                     ` (3 subsequent siblings)
  4 siblings, 1 reply; 24+ messages in thread
From: Álvaro Fernández Rojas @ 2017-04-24 17:03 UTC (permalink / raw)
  To: u-boot

In order to add a generic MIPS debug_uart_init call right before the call to
board_early_init_f, we need to remove all calls to debug_uart_init from every
MIPS boards.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
 v2: No changes.

 board/qca/ap121/ap121.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/board/qca/ap121/ap121.c b/board/qca/ap121/ap121.c
index e245faa..ac9be35 100644
--- a/board/qca/ap121/ap121.c
+++ b/board/qca/ap121/ap121.c
@@ -43,9 +43,6 @@ void board_debug_uart_init(void)
 
 int board_early_init_f(void)
 {
-#ifdef CONFIG_DEBUG_UART
-	debug_uart_init();
-#endif
 	ddr_init();
 	ath79_eth_reset();
 	return 0;
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [U-Boot] [PATCH 2/4] MIPS: QCA AP143: remove debug_uart_init call
  2017-04-24 17:03 ` [U-Boot] [PATCH 0/4] " Álvaro Fernández Rojas
  2017-04-24 17:03   ` [U-Boot] [PATCH 1/4] MIPS: QCA AP121: remove debug_uart_init call Álvaro Fernández Rojas
@ 2017-04-24 17:03   ` Álvaro Fernández Rojas
  2017-04-30 18:22     ` Daniel Schwierzeck
  2017-04-24 17:03   ` [U-Boot] [PATCH 3/4] MIPS: tl-wdr4300: " Álvaro Fernández Rojas
                     ` (2 subsequent siblings)
  4 siblings, 1 reply; 24+ messages in thread
From: Álvaro Fernández Rojas @ 2017-04-24 17:03 UTC (permalink / raw)
  To: u-boot

In order to add a generic MIPS debug_uart_init call right before the call to
board_early_init_f, we need to remove all calls to debug_uart_init from every
MIPS boards.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
 v2: No changes.

 board/qca/ap143/ap143.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/board/qca/ap143/ap143.c b/board/qca/ap143/ap143.c
index e921ea5..19b55ac 100644
--- a/board/qca/ap143/ap143.c
+++ b/board/qca/ap143/ap143.c
@@ -59,9 +59,6 @@ void board_debug_uart_init(void)
 
 int board_early_init_f(void)
 {
-#ifdef CONFIG_DEBUG_UART
-	debug_uart_init();
-#endif
 	ddr_init();
 	ath79_eth_reset();
 	return 0;
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [U-Boot] [PATCH 3/4] MIPS: tl-wdr4300: remove debug_uart_init call
  2017-04-24 17:03 ` [U-Boot] [PATCH 0/4] " Álvaro Fernández Rojas
  2017-04-24 17:03   ` [U-Boot] [PATCH 1/4] MIPS: QCA AP121: remove debug_uart_init call Álvaro Fernández Rojas
  2017-04-24 17:03   ` [U-Boot] [PATCH 2/4] MIPS: QCA AP143: " Álvaro Fernández Rojas
@ 2017-04-24 17:03   ` Álvaro Fernández Rojas
  2017-04-30 18:22     ` Daniel Schwierzeck
  2017-04-24 17:03   ` [U-Boot] [PATCH 4/4] MIPS: call debug_uart_init right before board_init_f Álvaro Fernández Rojas
  2017-04-25 15:48   ` [U-Boot] [PATCH 0/4] " Álvaro Fernández Rojas
  4 siblings, 1 reply; 24+ messages in thread
From: Álvaro Fernández Rojas @ 2017-04-24 17:03 UTC (permalink / raw)
  To: u-boot

In order to add a generic MIPS debug_uart_init call right before the call to
board_early_init_f, we need to remove all calls to debug_uart_init from every
MIPS boards.
WDR4300 doesn't provide a board_debug_uart_init and configures pinmux in
board_early_init_f instead. Since I have no idead of what's the needed uart
pinmux config, I copied the whole pinmux config to a new function that is
called from board_early_init_f if CONFIG_DEBUG_UART_BOARD_INIT is not enabled.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
 v2: No changes.

 board/tplink/wdr4300/wdr4300.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/board/tplink/wdr4300/wdr4300.c b/board/tplink/wdr4300/wdr4300.c
index 6e070fd..0f59648 100644
--- a/board/tplink/wdr4300/wdr4300.c
+++ b/board/tplink/wdr4300/wdr4300.c
@@ -34,8 +34,7 @@ static void wdr4300_usb_start(void)
 static inline void wdr4300_usb_start(void) {}
 #endif
 
-#ifdef CONFIG_BOARD_EARLY_INIT_F
-int board_early_init_f(void)
+void wdr4300_pinmux_config(void)
 {
 	void __iomem *regs;
 
@@ -56,9 +55,20 @@ int board_early_init_f(void)
 	writel(0x00000000, regs + AR934X_GPIO_REG_OUT_FUNC3);
 	writel(0x0000004d, regs + AR934X_GPIO_REG_OUT_FUNC4);
 	writel(0x00000000, regs + AR934X_GPIO_REG_OUT_FUNC5);
+}
+
+#ifdef CONFIG_DEBUG_UART_BOARD_INIT
+void board_debug_uart_init(void)
+{
+	wdr4300_pinmux_config();
+}
+#endif
 
-#ifdef CONFIG_DEBUG_UART
-	debug_uart_init();
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+int board_early_init_f(void)
+{
+#ifndef CONFIG_DEBUG_UART_BOARD_INIT
+	wdr4300_pinmux_config();
 #endif
 
 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [U-Boot] [PATCH 4/4] MIPS: call debug_uart_init right before board_init_f
  2017-04-24 17:03 ` [U-Boot] [PATCH 0/4] " Álvaro Fernández Rojas
                     ` (2 preceding siblings ...)
  2017-04-24 17:03   ` [U-Boot] [PATCH 3/4] MIPS: tl-wdr4300: " Álvaro Fernández Rojas
@ 2017-04-24 17:03   ` Álvaro Fernández Rojas
  2017-04-30 18:22     ` Daniel Schwierzeck
  2017-04-25 15:48   ` [U-Boot] [PATCH 0/4] " Álvaro Fernández Rojas
  4 siblings, 1 reply; 24+ messages in thread
From: Álvaro Fernández Rojas @ 2017-04-24 17:03 UTC (permalink / raw)
  To: u-boot

From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

All MIPS boards that support debug uart are calling debug_uart_init right at
the beginning of board_early_init_f.
Instead of doing that, let's provide a generic call to debug_uart_init right
before the call to board_init_f if debug uart is enabled for boards without
stack in SRAM.
On the other hand, boards with stack in SRAM can call earlier (right before
low level init).

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
 v2: Introduce the changes suggested by Daniel Schwierzeck:
  - Call debug_uart_init before low level init for boards with stack in SRAM.

 arch/mips/cpu/start.S | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/mips/cpu/start.S b/arch/mips/cpu/start.S
index 6740fdf..a6b7a04 100644
--- a/arch/mips/cpu/start.S
+++ b/arch/mips/cpu/start.S
@@ -237,6 +237,13 @@ wr_done:
 #ifdef CONFIG_MIPS_INIT_STACK_IN_SRAM
 	/* Set up initial stack and global data */
 	setup_stack_gd
+
+# ifdef CONFIG_DEBUG_UART
+	/* Earliest point to set up debug uart */
+	PTR_LA	t9, debug_uart_init
+	jalr	t9
+	 nop
+# endif
 #endif
 
 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
@@ -263,6 +270,13 @@ wr_done:
 #ifndef CONFIG_MIPS_INIT_STACK_IN_SRAM
 	/* Set up initial stack and global data */
 	setup_stack_gd
+
+# ifdef CONFIG_DEBUG_UART
+	/* Earliest point to set up debug uart */
+	PTR_LA	t9, debug_uart_init
+	jalr	t9
+	 nop
+# endif
 #endif
 
 	move	a0, zero		# a0 <-- boot_flags = 0
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [U-Boot] [PATCH 0/4] MIPS: call debug_uart_init right before board_init_f
  2017-04-24 17:03 ` [U-Boot] [PATCH 0/4] " Álvaro Fernández Rojas
                     ` (3 preceding siblings ...)
  2017-04-24 17:03   ` [U-Boot] [PATCH 4/4] MIPS: call debug_uart_init right before board_init_f Álvaro Fernández Rojas
@ 2017-04-25 15:48   ` Álvaro Fernández Rojas
  2017-04-25 16:32     ` Daniel Schwierzeck
  4 siblings, 1 reply; 24+ messages in thread
From: Álvaro Fernández Rojas @ 2017-04-25 15:48 UTC (permalink / raw)
  To: u-boot

I've just realized I sent this without v2 prefix.
Should I resend it?

El 24/04/2017 a las 19:03, Álvaro Fernández Rojas escribió:
> All MIPS boards that support debug uart are calling debug_uart_init right at
> the beginning of board_early_init_f.
> Instead of doing that, let's provide a generic call to debug_uart_init right
> before the call to board_init_f if debug uart is enabled.
> 
> v2: Introduce the changes suggested by Daniel Schwierzeck:
>  - Call debug_uart_init before low level init for boards with stack in SRAM.
> 
> Daniel Schwierzeck (1):
>   MIPS: call debug_uart_init right before board_init_f
> 
> Álvaro Fernández Rojas (3):
>   MIPS: QCA AP121: remove debug_uart_init call
>   MIPS: QCA AP143: remove debug_uart_init call
>   MIPS: tl-wdr4300: remove debug_uart_init call
> 
>  arch/mips/cpu/start.S          | 14 ++++++++++++++
>  board/qca/ap121/ap121.c        |  3 ---
>  board/qca/ap143/ap143.c        |  3 ---
>  board/tplink/wdr4300/wdr4300.c | 18 ++++++++++++++----
>  4 files changed, 28 insertions(+), 10 deletions(-)
> 

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [U-Boot] [PATCH 0/4] MIPS: call debug_uart_init right before board_init_f
  2017-04-25 15:48   ` [U-Boot] [PATCH 0/4] " Álvaro Fernández Rojas
@ 2017-04-25 16:32     ` Daniel Schwierzeck
  0 siblings, 0 replies; 24+ messages in thread
From: Daniel Schwierzeck @ 2017-04-25 16:32 UTC (permalink / raw)
  To: u-boot

2017-04-25 17:48 GMT+02:00 Álvaro Fernández Rojas <noltari@gmail.com>:
> I've just realized I sent this without v2 prefix.
> Should I resend it?

no, I've found the right patches in patchwork ;)

>
> El 24/04/2017 a las 19:03, Álvaro Fernández Rojas escribió:
>> All MIPS boards that support debug uart are calling debug_uart_init right at
>> the beginning of board_early_init_f.
>> Instead of doing that, let's provide a generic call to debug_uart_init right
>> before the call to board_init_f if debug uart is enabled.
>>
>> v2: Introduce the changes suggested by Daniel Schwierzeck:
>>  - Call debug_uart_init before low level init for boards with stack in SRAM.
>>
>> Daniel Schwierzeck (1):
>>   MIPS: call debug_uart_init right before board_init_f
>>
>> Álvaro Fernández Rojas (3):
>>   MIPS: QCA AP121: remove debug_uart_init call
>>   MIPS: QCA AP143: remove debug_uart_init call
>>   MIPS: tl-wdr4300: remove debug_uart_init call
>>
>>  arch/mips/cpu/start.S          | 14 ++++++++++++++
>>  board/qca/ap121/ap121.c        |  3 ---
>>  board/qca/ap143/ap143.c        |  3 ---
>>  board/tplink/wdr4300/wdr4300.c | 18 ++++++++++++++----
>>  4 files changed, 28 insertions(+), 10 deletions(-)
>>



-- 
- Daniel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [U-Boot] [PATCH 1/4] MIPS: QCA AP121: remove debug_uart_init call
  2017-04-24 17:03   ` [U-Boot] [PATCH 1/4] MIPS: QCA AP121: remove debug_uart_init call Álvaro Fernández Rojas
@ 2017-04-30 18:22     ` Daniel Schwierzeck
  0 siblings, 0 replies; 24+ messages in thread
From: Daniel Schwierzeck @ 2017-04-30 18:22 UTC (permalink / raw)
  To: u-boot



Am 24.04.2017 um 19:03 schrieb Álvaro Fernández Rojas:
> In order to add a generic MIPS debug_uart_init call right before the call to
> board_early_init_f, we need to remove all calls to debug_uart_init from every
> MIPS boards.
> 
> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
> ---
>  v2: No changes.
> 
>  board/qca/ap121/ap121.c | 3 ---
>  1 file changed, 3 deletions(-)
> 

applied to u-boot-mips/next, thanks!

-- 
- Daniel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170430/04ec7149/attachment.sig>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [U-Boot] [PATCH 2/4] MIPS: QCA AP143: remove debug_uart_init call
  2017-04-24 17:03   ` [U-Boot] [PATCH 2/4] MIPS: QCA AP143: " Álvaro Fernández Rojas
@ 2017-04-30 18:22     ` Daniel Schwierzeck
  0 siblings, 0 replies; 24+ messages in thread
From: Daniel Schwierzeck @ 2017-04-30 18:22 UTC (permalink / raw)
  To: u-boot



Am 24.04.2017 um 19:03 schrieb Álvaro Fernández Rojas:
> In order to add a generic MIPS debug_uart_init call right before the call to
> board_early_init_f, we need to remove all calls to debug_uart_init from every
> MIPS boards.
> 
> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
> ---
>  v2: No changes.
> 
>  board/qca/ap143/ap143.c | 3 ---
>  1 file changed, 3 deletions(-)
> 

applied to u-boot-mips/next, thanks!

-- 
- Daniel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170430/abf62bba/attachment.sig>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [U-Boot] [PATCH 3/4] MIPS: tl-wdr4300: remove debug_uart_init call
  2017-04-24 17:03   ` [U-Boot] [PATCH 3/4] MIPS: tl-wdr4300: " Álvaro Fernández Rojas
@ 2017-04-30 18:22     ` Daniel Schwierzeck
  0 siblings, 0 replies; 24+ messages in thread
From: Daniel Schwierzeck @ 2017-04-30 18:22 UTC (permalink / raw)
  To: u-boot



Am 24.04.2017 um 19:03 schrieb Álvaro Fernández Rojas:
> In order to add a generic MIPS debug_uart_init call right before the call to
> board_early_init_f, we need to remove all calls to debug_uart_init from every
> MIPS boards.
> WDR4300 doesn't provide a board_debug_uart_init and configures pinmux in
> board_early_init_f instead. Since I have no idead of what's the needed uart
> pinmux config, I copied the whole pinmux config to a new function that is
> called from board_early_init_f if CONFIG_DEBUG_UART_BOARD_INIT is not enabled.
> 
> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
> ---
>  v2: No changes.
> 
>  board/tplink/wdr4300/wdr4300.c | 18 ++++++++++++++----
>  1 file changed, 14 insertions(+), 4 deletions(-)
> 

applied to u-boot-mips/next, thanks!

-- 
- Daniel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170430/987d7c49/attachment.sig>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [U-Boot] [PATCH 4/4] MIPS: call debug_uart_init right before board_init_f
  2017-04-24 17:03   ` [U-Boot] [PATCH 4/4] MIPS: call debug_uart_init right before board_init_f Álvaro Fernández Rojas
@ 2017-04-30 18:22     ` Daniel Schwierzeck
  0 siblings, 0 replies; 24+ messages in thread
From: Daniel Schwierzeck @ 2017-04-30 18:22 UTC (permalink / raw)
  To: u-boot



Am 24.04.2017 um 19:03 schrieb Álvaro Fernández Rojas:
> From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
> 
> All MIPS boards that support debug uart are calling debug_uart_init right at
> the beginning of board_early_init_f.
> Instead of doing that, let's provide a generic call to debug_uart_init right
> before the call to board_init_f if debug uart is enabled for boards without
> stack in SRAM.
> On the other hand, boards with stack in SRAM can call earlier (right before
> low level init).
> 
> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
> ---
>  v2: Introduce the changes suggested by Daniel Schwierzeck:
>   - Call debug_uart_init before low level init for boards with stack in SRAM.
> 
>  arch/mips/cpu/start.S | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 

applied to u-boot-mips/next, thanks!

-- 
- Daniel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170430/738a1195/attachment.sig>

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2017-04-30 18:22 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-23 10:50 [U-Boot] [PATCH 0/4] MIPS: call debug_uart_init right before board_init_f Álvaro Fernández Rojas
2017-04-23 10:50 ` [U-Boot] [PATCH 1/4] MIPS: QCA AP121: remove debug_uart_init call Álvaro Fernández Rojas
2017-04-23 10:50 ` [U-Boot] [PATCH 2/4] MIPS: QCA AP143: " Álvaro Fernández Rojas
2017-04-23 10:50 ` [U-Boot] [PATCH 3/4] MIPS: tl-wdr4300: " Álvaro Fernández Rojas
2017-04-23 10:50 ` [U-Boot] [PATCH 4/4] MIPS: call debug_uart_init right before board_init_f Álvaro Fernández Rojas
2017-04-23 11:09   ` Marek Vasut
2017-04-23 11:31     ` Álvaro Fernández Rojas
2017-04-23 11:44       ` Marek Vasut
2017-04-23 12:04         ` Álvaro Fernández Rojas
2017-04-23 17:08           ` Marek Vasut
2017-04-23 19:04             ` Daniel Schwierzeck
2017-04-23 19:40               ` Marek Vasut
2017-04-23 19:09   ` Daniel Schwierzeck
2017-04-24 17:03 ` [U-Boot] [PATCH 0/4] " Álvaro Fernández Rojas
2017-04-24 17:03   ` [U-Boot] [PATCH 1/4] MIPS: QCA AP121: remove debug_uart_init call Álvaro Fernández Rojas
2017-04-30 18:22     ` Daniel Schwierzeck
2017-04-24 17:03   ` [U-Boot] [PATCH 2/4] MIPS: QCA AP143: " Álvaro Fernández Rojas
2017-04-30 18:22     ` Daniel Schwierzeck
2017-04-24 17:03   ` [U-Boot] [PATCH 3/4] MIPS: tl-wdr4300: " Álvaro Fernández Rojas
2017-04-30 18:22     ` Daniel Schwierzeck
2017-04-24 17:03   ` [U-Boot] [PATCH 4/4] MIPS: call debug_uart_init right before board_init_f Álvaro Fernández Rojas
2017-04-30 18:22     ` Daniel Schwierzeck
2017-04-25 15:48   ` [U-Boot] [PATCH 0/4] " Álvaro Fernández Rojas
2017-04-25 16:32     ` Daniel Schwierzeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.