All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 0/2] rockchip: rk3399: spl: Make baudrate and UART configurable
@ 2017-03-23 22:24 Philipp Tomsich
  2017-03-23 22:24 ` [U-Boot] [PATCH v2 1/2] rockchip: rk3399: spl: add UART0 support for SPL Philipp Tomsich
  2017-03-23 22:24 ` [U-Boot] [PATCH v2 2/2] rockchip: config: rk3399: update defconfigs and rk3399_common Philipp Tomsich
  0 siblings, 2 replies; 9+ messages in thread
From: Philipp Tomsich @ 2017-03-23 22:24 UTC (permalink / raw)
  To: u-boot


The default configuration for debug output from the RK3399 SPL is
UART2 at 1.5MBaud. While this works reasonably well for the EVB,
custom boards may want to change these settings.

To simplify the enablement (i.e. to use the RS232 connector on our
baseboard and to improve the compatibility with commonly available
RS232-to-UART dongles) for the RK3399-Q7 SoM, we need to make both
the UART and the baudrate configurable.

This patch-series makes CONFIG_BAUDRATE a first-class citizen within
the Kconfig framework (so we can set it via defconfig) and adds the
required iomux support for UART0 in the RK3399 SPL.

Changes in v2:
- Changed hex constant to lowercase

Philipp Tomsich (2):
  rockchip: rk3399: spl: add UART0 support for SPL
  rockchip: config: rk3399: update defconfigs and rk3399_common

 arch/arm/include/asm/arch-rockchip/grf_rk3399.h |  8 +++++++
 arch/arm/mach-rockchip/rk3399-board-spl.c       | 29 ++++++++++++++++++-------
 configs/evb-rk3399_defconfig                    |  2 ++
 configs/puma_defconfig                          |  4 +++-
 include/configs/rk3399_common.h                 |  1 -
 5 files changed, 34 insertions(+), 10 deletions(-)

-- 
1.9.1

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

* [U-Boot] [PATCH v2 1/2] rockchip: rk3399: spl: add UART0 support for SPL
  2017-03-23 22:24 [U-Boot] [PATCH v2 0/2] rockchip: rk3399: spl: Make baudrate and UART configurable Philipp Tomsich
@ 2017-03-23 22:24 ` Philipp Tomsich
  2017-03-24  2:12   ` Kever Yang
  2017-03-23 22:24 ` [U-Boot] [PATCH v2 2/2] rockchip: config: rk3399: update defconfigs and rk3399_common Philipp Tomsich
  1 sibling, 1 reply; 9+ messages in thread
From: Philipp Tomsich @ 2017-03-23 22:24 UTC (permalink / raw)
  To: u-boot

The RK3399-Q7 ("Puma") SoM exposes UART0 as the Qseven UART (i.e. the
serial line available via standardised pins on the edge connector and
available on a RS232 connector).

To support boards (such as the RK3399-Q7) that require UART0 as a
debug console, we match CONFIG_DEBUG_UART_BASE and add the appropriate
iomux setup to the rk3399 SPL code.

As we are already touching this code, we also move the board-specific
UART setup (i.e. iomux setup) into board_debug_uart_init(). This will
be called from the debug UART init when CONFIG_DEBUG_UART_BOARD_INIT
is set.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
---

Changes in v2:
- Changed hex constant to lowercase

 arch/arm/include/asm/arch-rockchip/grf_rk3399.h |  8 +++++++
 arch/arm/mach-rockchip/rk3399-board-spl.c       | 29 ++++++++++++++++++-------
 2 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/arch/arm/include/asm/arch-rockchip/grf_rk3399.h b/arch/arm/include/asm/arch-rockchip/grf_rk3399.h
index 62d8496..4701cfb 100644
--- a/arch/arm/include/asm/arch-rockchip/grf_rk3399.h
+++ b/arch/arm/include/asm/arch-rockchip/grf_rk3399.h
@@ -333,6 +333,14 @@ enum {
 	GRF_GPIO2B4_SEL_MASK	= 3 << GRF_GPIO2B4_SEL_SHIFT,
 	GRF_SPI2TPM_CSN0	= 1,
 
+	/* GRF_GPIO2C_IOMUX */
+	GRF_GPIO2C0_SEL_SHIFT   = 0,
+	GRF_GPIO2C0_SEL_MASK    = 3 << GRF_GPIO2C0_SEL_SHIFT,
+	GRF_UART0BT_SIN         = 1,
+	GRF_GPIO2C1_SEL_SHIFT   = 2,
+	GRF_GPIO2C1_SEL_MASK    = 3 << GRF_GPIO2C1_SEL_SHIFT,
+	GRF_UART0BT_SOUT        = 1,
+
 	/* GRF_GPIO3A_IOMUX */
 	GRF_GPIO3A4_SEL_SHIFT	= 8,
 	GRF_GPIO3A4_SEL_MASK	= 3 << GRF_GPIO3A4_SEL_SHIFT,
diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c
index 7b4e0a1..c212143 100644
--- a/arch/arm/mach-rockchip/rk3399-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3399-board-spl.c
@@ -57,19 +57,22 @@ void secure_timer_init(void)
 	writel(TIMER_EN | TIMER_FMODE, TIMER_CHN10_BASE + TIMER_CONTROL_REG);
 }
 
-#define GRF_EMMCCORE_CON11 0xff77f02c
-void board_init_f(ulong dummy)
+void board_debug_uart_init(void)
 {
-	struct udevice *pinctrl;
-	struct udevice *dev;
-	int ret;
-
-	/* Example code showing how to enable the debug UART on RK3288 */
 #include <asm/arch/grf_rk3399.h>
-	/* Enable early UART2 channel C on the RK3399 */
 #define GRF_BASE	0xff770000
 	struct rk3399_grf_regs * const grf = (void *)GRF_BASE;
 
+#if defined(CONFIG_DEBUG_UART_BASE) && (CONFIG_DEBUG_UART_BASE == 0xff180000)
+	/* Enable early UART0 on the RK3399 */
+	rk_clrsetreg(&grf->gpio2c_iomux,
+		     GRF_GPIO2C0_SEL_MASK,
+		     GRF_UART0BT_SIN << GRF_GPIO2C0_SEL_SHIFT);
+	rk_clrsetreg(&grf->gpio2c_iomux,
+		     GRF_GPIO2C1_SEL_MASK,
+		     GRF_UART0BT_SOUT << GRF_GPIO2C1_SEL_SHIFT);
+#else
+	/* Enable early UART2 channel C on the RK3399 */
 	rk_clrsetreg(&grf->gpio4c_iomux,
 		     GRF_GPIO4C3_SEL_MASK,
 		     GRF_UART2DGBC_SIN << GRF_GPIO4C3_SEL_SHIFT);
@@ -80,6 +83,16 @@ void board_init_f(ulong dummy)
 	rk_clrsetreg(&grf->soc_con7,
 		     GRF_UART_DBG_SEL_MASK,
 		     GRF_UART_DBG_SEL_C << GRF_UART_DBG_SEL_SHIFT);
+#endif
+}
+
+#define GRF_EMMCCORE_CON11 0xff77f02c
+void board_init_f(ulong dummy)
+{
+	struct udevice *pinctrl;
+	struct udevice *dev;
+	int ret;
+
 #define EARLY_UART
 #ifdef EARLY_UART
 	/*
-- 
1.9.1

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

* [U-Boot] [PATCH v2 2/2] rockchip: config: rk3399: update defconfigs and rk3399_common
  2017-03-23 22:24 [U-Boot] [PATCH v2 0/2] rockchip: rk3399: spl: Make baudrate and UART configurable Philipp Tomsich
  2017-03-23 22:24 ` [U-Boot] [PATCH v2 1/2] rockchip: rk3399: spl: add UART0 support for SPL Philipp Tomsich
@ 2017-03-23 22:24 ` Philipp Tomsich
  2017-03-24  2:13   ` Kever Yang
  2017-03-26  1:17   ` Simon Glass
  1 sibling, 2 replies; 9+ messages in thread
From: Philipp Tomsich @ 2017-03-23 22:24 UTC (permalink / raw)
  To: u-boot

With everything set up to define CONFIG_BAUDRATE via defconfig and
with to have the SPL debug UART either on UART0 or UART2, the configs
for the RK3399 EVB and for the RK3399-Q7 can be updated.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

---

Changes in v2: None

 configs/evb-rk3399_defconfig    | 2 ++
 configs/puma_defconfig          | 4 +++-
 include/configs/rk3399_common.h | 1 -
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/configs/evb-rk3399_defconfig b/configs/evb-rk3399_defconfig
index 22405ce..7a82869 100644
--- a/configs/evb-rk3399_defconfig
+++ b/configs/evb-rk3399_defconfig
@@ -43,7 +43,9 @@ CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_PWM_ROCKCHIP=y
 CONFIG_RAM=y
 CONFIG_SPL_RAM=y
+CONFIG_BAUDRATE=1500000
 CONFIG_DEBUG_UART=y
+CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xFF1A0000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART_SHIFT=2
diff --git a/configs/puma_defconfig b/configs/puma_defconfig
index 515185e..8e29d96 100644
--- a/configs/puma_defconfig
+++ b/configs/puma_defconfig
@@ -43,8 +43,10 @@ CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_PWM_ROCKCHIP=y
 CONFIG_RAM=y
 CONFIG_SPL_RAM=y
+CONFIG_BAUDRATE=115200
 CONFIG_DEBUG_UART=y
-CONFIG_DEBUG_UART_BASE=0xFF1A0000
+CONFIG_DEBUG_UART_BOARD_INIT=y
+CONFIG_DEBUG_UART_BASE=0xFF180000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_SYS_NS16550=y
diff --git a/include/configs/rk3399_common.h b/include/configs/rk3399_common.h
index bc91eb6..c1ea616 100644
--- a/include/configs/rk3399_common.h
+++ b/include/configs/rk3399_common.h
@@ -12,7 +12,6 @@
 #define CONFIG_NR_DRAM_BANKS		1
 #define CONFIG_ENV_SIZE			0x2000
 #define CONFIG_SYS_MAXARGS		16
-#define CONFIG_BAUDRATE			1500000
 #define CONFIG_SYS_MALLOC_LEN		(32 << 20)
 #define CONFIG_SYS_CBSIZE		1024
 #define CONFIG_SKIP_LOWLEVEL_INIT
-- 
1.9.1

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

* [U-Boot] [PATCH v2 1/2] rockchip: rk3399: spl: add UART0 support for SPL
  2017-03-23 22:24 ` [U-Boot] [PATCH v2 1/2] rockchip: rk3399: spl: add UART0 support for SPL Philipp Tomsich
@ 2017-03-24  2:12   ` Kever Yang
  2017-03-26  2:38     ` Simon Glass
  0 siblings, 1 reply; 9+ messages in thread
From: Kever Yang @ 2017-03-24  2:12 UTC (permalink / raw)
  To: u-boot

Hi Philipp,

On 03/24/2017 06:24 AM, Philipp Tomsich wrote:
> The RK3399-Q7 ("Puma") SoM exposes UART0 as the Qseven UART (i.e. the
> serial line available via standardised pins on the edge connector and
> available on a RS232 connector).
>
> To support boards (such as the RK3399-Q7) that require UART0 as a
> debug console, we match CONFIG_DEBUG_UART_BASE and add the appropriate
> iomux setup to the rk3399 SPL code.
>
> As we are already touching this code, we also move the board-specific
> UART setup (i.e. iomux setup) into board_debug_uart_init(). This will
> be called from the debug UART init when CONFIG_DEBUG_UART_BOARD_INIT
> is set.
>
> Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> ---
>
> Changes in v2:
> - Changed hex constant to lowercase
>
>   arch/arm/include/asm/arch-rockchip/grf_rk3399.h |  8 +++++++
>   arch/arm/mach-rockchip/rk3399-board-spl.c       | 29 ++++++++++++++++++-------
>   2 files changed, 29 insertions(+), 8 deletions(-)
>
> diff --git a/arch/arm/include/asm/arch-rockchip/grf_rk3399.h b/arch/arm/include/asm/arch-rockchip/grf_rk3399.h
> index 62d8496..4701cfb 100644
> --- a/arch/arm/include/asm/arch-rockchip/grf_rk3399.h
> +++ b/arch/arm/include/asm/arch-rockchip/grf_rk3399.h
> @@ -333,6 +333,14 @@ enum {
>   	GRF_GPIO2B4_SEL_MASK	= 3 << GRF_GPIO2B4_SEL_SHIFT,
>   	GRF_SPI2TPM_CSN0	= 1,
>   
> +	/* GRF_GPIO2C_IOMUX */
> +	GRF_GPIO2C0_SEL_SHIFT   = 0,
> +	GRF_GPIO2C0_SEL_MASK    = 3 << GRF_GPIO2C0_SEL_SHIFT,
> +	GRF_UART0BT_SIN         = 1,
> +	GRF_GPIO2C1_SEL_SHIFT   = 2,
> +	GRF_GPIO2C1_SEL_MASK    = 3 << GRF_GPIO2C1_SEL_SHIFT,
> +	GRF_UART0BT_SOUT        = 1,
> +
>   	/* GRF_GPIO3A_IOMUX */
>   	GRF_GPIO3A4_SEL_SHIFT	= 8,
>   	GRF_GPIO3A4_SEL_MASK	= 3 << GRF_GPIO3A4_SEL_SHIFT,
> diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c
> index 7b4e0a1..c212143 100644
> --- a/arch/arm/mach-rockchip/rk3399-board-spl.c
> +++ b/arch/arm/mach-rockchip/rk3399-board-spl.c
> @@ -57,19 +57,22 @@ void secure_timer_init(void)
>   	writel(TIMER_EN | TIMER_FMODE, TIMER_CHN10_BASE + TIMER_CONTROL_REG);
>   }
>   
> -#define GRF_EMMCCORE_CON11 0xff77f02c
> -void board_init_f(ulong dummy)
> +void board_debug_uart_init(void)
>   {
> -	struct udevice *pinctrl;
> -	struct udevice *dev;
> -	int ret;
> -
> -	/* Example code showing how to enable the debug UART on RK3288 */
>   #include <asm/arch/grf_rk3399.h>
> -	/* Enable early UART2 channel C on the RK3399 */
>   #define GRF_BASE	0xff770000
>   	struct rk3399_grf_regs * const grf = (void *)GRF_BASE;
>   
> +#if defined(CONFIG_DEBUG_UART_BASE) && (CONFIG_DEBUG_UART_BASE == 0xff180000)
> +	/* Enable early UART0 on the RK3399 */
> +	rk_clrsetreg(&grf->gpio2c_iomux,
> +		     GRF_GPIO2C0_SEL_MASK,
> +		     GRF_UART0BT_SIN << GRF_GPIO2C0_SEL_SHIFT);
> +	rk_clrsetreg(&grf->gpio2c_iomux,
> +		     GRF_GPIO2C1_SEL_MASK,
> +		     GRF_UART0BT_SOUT << GRF_GPIO2C1_SEL_SHIFT);
> +#else
> +	/* Enable early UART2 channel C on the RK3399 */
>   	rk_clrsetreg(&grf->gpio4c_iomux,
>   		     GRF_GPIO4C3_SEL_MASK,
>   		     GRF_UART2DGBC_SIN << GRF_GPIO4C3_SEL_SHIFT);
> @@ -80,6 +83,16 @@ void board_init_f(ulong dummy)
>   	rk_clrsetreg(&grf->soc_con7,
>   		     GRF_UART_DBG_SEL_MASK,
>   		     GRF_UART_DBG_SEL_C << GRF_UART_DBG_SEL_SHIFT);
> +#endif
> +}
> +
> +#define GRF_EMMCCORE_CON11 0xff77f02c
> +void board_init_f(ulong dummy)
> +{
> +	struct udevice *pinctrl;
> +	struct udevice *dev;
> +	int ret;
> +
>   #define EARLY_UART
>   #ifdef EARLY_UART
>   	/*

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

Thanks,
- Kever

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

* [U-Boot] [PATCH v2 2/2] rockchip: config: rk3399: update defconfigs and rk3399_common
  2017-03-23 22:24 ` [U-Boot] [PATCH v2 2/2] rockchip: config: rk3399: update defconfigs and rk3399_common Philipp Tomsich
@ 2017-03-24  2:13   ` Kever Yang
  2017-03-26  1:17   ` Simon Glass
  1 sibling, 0 replies; 9+ messages in thread
From: Kever Yang @ 2017-03-24  2:13 UTC (permalink / raw)
  To: u-boot

Hi Philipp,

On 03/24/2017 06:24 AM, Philipp Tomsich wrote:
> With everything set up to define CONFIG_BAUDRATE via defconfig and
> with to have the SPL debug UART either on UART0 or UART2, the configs
> for the RK3399 EVB and for the RK3399-Q7 can be updated.
>
> Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
>
> ---
>
> Changes in v2: None
>
>   configs/evb-rk3399_defconfig    | 2 ++
>   configs/puma_defconfig          | 4 +++-
>   include/configs/rk3399_common.h | 1 -
>   3 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/configs/evb-rk3399_defconfig b/configs/evb-rk3399_defconfig
> index 22405ce..7a82869 100644
> --- a/configs/evb-rk3399_defconfig
> +++ b/configs/evb-rk3399_defconfig
> @@ -43,7 +43,9 @@ CONFIG_DM_REGULATOR_FIXED=y
>   CONFIG_PWM_ROCKCHIP=y
>   CONFIG_RAM=y
>   CONFIG_SPL_RAM=y
> +CONFIG_BAUDRATE=1500000
>   CONFIG_DEBUG_UART=y
> +CONFIG_DEBUG_UART_BOARD_INIT=y
>   CONFIG_DEBUG_UART_BASE=0xFF1A0000
>   CONFIG_DEBUG_UART_CLOCK=24000000
>   CONFIG_DEBUG_UART_SHIFT=2
> diff --git a/configs/puma_defconfig b/configs/puma_defconfig
> index 515185e..8e29d96 100644
> --- a/configs/puma_defconfig
> +++ b/configs/puma_defconfig
> @@ -43,8 +43,10 @@ CONFIG_DM_REGULATOR_FIXED=y
>   CONFIG_PWM_ROCKCHIP=y
>   CONFIG_RAM=y
>   CONFIG_SPL_RAM=y
> +CONFIG_BAUDRATE=115200
>   CONFIG_DEBUG_UART=y
> -CONFIG_DEBUG_UART_BASE=0xFF1A0000
> +CONFIG_DEBUG_UART_BOARD_INIT=y
> +CONFIG_DEBUG_UART_BASE=0xFF180000
>   CONFIG_DEBUG_UART_CLOCK=24000000
>   CONFIG_DEBUG_UART_SHIFT=2
>   CONFIG_SYS_NS16550=y
> diff --git a/include/configs/rk3399_common.h b/include/configs/rk3399_common.h
> index bc91eb6..c1ea616 100644
> --- a/include/configs/rk3399_common.h
> +++ b/include/configs/rk3399_common.h
> @@ -12,7 +12,6 @@
>   #define CONFIG_NR_DRAM_BANKS		1
>   #define CONFIG_ENV_SIZE			0x2000
>   #define CONFIG_SYS_MAXARGS		16
> -#define CONFIG_BAUDRATE			1500000
>   #define CONFIG_SYS_MALLOC_LEN		(32 << 20)
>   #define CONFIG_SYS_CBSIZE		1024
>   #define CONFIG_SKIP_LOWLEVEL_INIT

Looks good to me.

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

Thanks,
- Kever

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

* [U-Boot] [PATCH v2 2/2] rockchip: config: rk3399: update defconfigs and rk3399_common
  2017-03-23 22:24 ` [U-Boot] [PATCH v2 2/2] rockchip: config: rk3399: update defconfigs and rk3399_common Philipp Tomsich
  2017-03-24  2:13   ` Kever Yang
@ 2017-03-26  1:17   ` Simon Glass
  1 sibling, 0 replies; 9+ messages in thread
From: Simon Glass @ 2017-03-26  1:17 UTC (permalink / raw)
  To: u-boot

Hi,

On 23 March 2017 at 16:24, Philipp Tomsich
<philipp.tomsich@theobroma-systems.com> wrote:
> With everything set up to define CONFIG_BAUDRATE via defconfig and
> with to have the SPL debug UART either on UART0 or UART2, the configs
> for the RK3399 EVB and for the RK3399-Q7 can be updated.
>
> Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
>
> ---
>
> Changes in v2: None
>
>  configs/evb-rk3399_defconfig    | 2 ++
>  configs/puma_defconfig          | 4 +++-
>  include/configs/rk3399_common.h | 1 -
>  3 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/configs/evb-rk3399_defconfig b/configs/evb-rk3399_defconfig
> index 22405ce..7a82869 100644
> --- a/configs/evb-rk3399_defconfig
> +++ b/configs/evb-rk3399_defconfig
> @@ -43,7 +43,9 @@ CONFIG_DM_REGULATOR_FIXED=y
>  CONFIG_PWM_ROCKCHIP=y
>  CONFIG_RAM=y
>  CONFIG_SPL_RAM=y
> +CONFIG_BAUDRATE=1500000
>  CONFIG_DEBUG_UART=y
> +CONFIG_DEBUG_UART_BOARD_INIT=y
>  CONFIG_DEBUG_UART_BASE=0xFF1A0000
>  CONFIG_DEBUG_UART_CLOCK=24000000
>  CONFIG_DEBUG_UART_SHIFT=2
> diff --git a/configs/puma_defconfig b/configs/puma_defconfig
> index 515185e..8e29d96 100644
> --- a/configs/puma_defconfig
> +++ b/configs/puma_defconfig

I don't have this file in my tree. Is this based on mainline?

Regards,
Simon

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

* [U-Boot] [PATCH v2 1/2] rockchip: rk3399: spl: add UART0 support for SPL
  2017-03-24  2:12   ` Kever Yang
@ 2017-03-26  2:38     ` Simon Glass
  2017-03-26 16:30       ` Dr. Philipp Tomsich
  0 siblings, 1 reply; 9+ messages in thread
From: Simon Glass @ 2017-03-26  2:38 UTC (permalink / raw)
  To: u-boot

Hi,

On 23 March 2017 at 20:12, Kever Yang <kever.yang@rock-chips.com> wrote:
>
> Hi Philipp,
>
>
> On 03/24/2017 06:24 AM, Philipp Tomsich wrote:
>>
>> The RK3399-Q7 ("Puma") SoM exposes UART0 as the Qseven UART (i.e. the
>> serial line available via standardised pins on the edge connector and
>> available on a RS232 connector).
>>
>> To support boards (such as the RK3399-Q7) that require UART0 as a
>> debug console, we match CONFIG_DEBUG_UART_BASE and add the appropriate
>> iomux setup to the rk3399 SPL code.
>>
>> As we are already touching this code, we also move the board-specific
>> UART setup (i.e. iomux setup) into board_debug_uart_init(). This will
>> be called from the debug UART init when CONFIG_DEBUG_UART_BOARD_INIT
>> is set.
>>
>> Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
>> ---
>>
>> Changes in v2:
>> - Changed hex constant to lowercase
>>
>>   arch/arm/include/asm/arch-rockchip/grf_rk3399.h |  8 +++++++
>>   arch/arm/mach-rockchip/rk3399-board-spl.c       | 29 ++++++++++++++++++-------
>>   2 files changed, 29 insertions(+), 8 deletions(-)

This patch causes a build error for me:

   aarch64:  +   evb-rk3399
+arch/arm/mach-rockchip/rk3399-board-spl.c:60:6: error: redefinition
of 'board_debug_uart_init'
+ void board_debug_uart_init(void)
+      ^
+In file included from arch/arm/mach-rockchip/rk3399-board-spl.c:8:0:
+include/debug_uart.h:68:20: note: previous definition of
'board_debug_uart_init' was here
+ static inline void board_debug_uart_init(void)
+                    ^
+make[3]: *** [spl/arch/arm/mach-rockchip/rk3399-board-spl.o] Error 1
+make[2]: *** [spl/arch/arm/mach-rockchip] Error 2
+make[1]: *** [spl/u-boot-spl] Error 2
+make: *** [sub-make] Error 2


Regards,
Simon

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

* [U-Boot] [PATCH v2 1/2] rockchip: rk3399: spl: add UART0 support for SPL
  2017-03-26  2:38     ` Simon Glass
@ 2017-03-26 16:30       ` Dr. Philipp Tomsich
  2017-04-01  4:22         ` Simon Glass
  0 siblings, 1 reply; 9+ messages in thread
From: Dr. Philipp Tomsich @ 2017-03-26 16:30 UTC (permalink / raw)
  To: u-boot

Simon,

you’ll need
	CONFIG_DEBUG_UART_BOARD_INIT=y
as include/debug_uart.h checks this macro and either defines this function inline (with
an empty body) or allows the function definition.

Seems like everyone just adds this to their defconfig (as did we), but I am open towards
an automatic selection of this for ROCKCHIP_RK3399 via Kconfig.

Regards,
Philipp.

> On 26 Mar 2017, at 04:38, Simon Glass <sjg@chromium.org> wrote:
> 
> Hi,
> 
> On 23 March 2017 at 20:12, Kever Yang <kever.yang at rock-chips.com <mailto:kever.yang@rock-chips.com>> wrote:
>> 
>> Hi Philipp,
>> 
>> 
>> On 03/24/2017 06:24 AM, Philipp Tomsich wrote:
>>> 
>>> The RK3399-Q7 ("Puma") SoM exposes UART0 as the Qseven UART (i.e. the
>>> serial line available via standardised pins on the edge connector and
>>> available on a RS232 connector).
>>> 
>>> To support boards (such as the RK3399-Q7) that require UART0 as a
>>> debug console, we match CONFIG_DEBUG_UART_BASE and add the appropriate
>>> iomux setup to the rk3399 SPL code.
>>> 
>>> As we are already touching this code, we also move the board-specific
>>> UART setup (i.e. iomux setup) into board_debug_uart_init(). This will
>>> be called from the debug UART init when CONFIG_DEBUG_UART_BOARD_INIT
>>> is set.
>>> 
>>> Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
>>> ---
>>> 
>>> Changes in v2:
>>> - Changed hex constant to lowercase
>>> 
>>>  arch/arm/include/asm/arch-rockchip/grf_rk3399.h |  8 +++++++
>>>  arch/arm/mach-rockchip/rk3399-board-spl.c       | 29 ++++++++++++++++++-------
>>>  2 files changed, 29 insertions(+), 8 deletions(-)
> 
> This patch causes a build error for me:
> 
>   aarch64:  +   evb-rk3399
> +arch/arm/mach-rockchip/rk3399-board-spl.c:60:6: error: redefinition
> of 'board_debug_uart_init'
> + void board_debug_uart_init(void)
> +      ^
> +In file included from arch/arm/mach-rockchip/rk3399-board-spl.c:8:0:
> +include/debug_uart.h:68:20: note: previous definition of
> 'board_debug_uart_init' was here
> + static inline void board_debug_uart_init(void)
> +                    ^
> +make[3]: *** [spl/arch/arm/mach-rockchip/rk3399-board-spl.o] Error 1
> +make[2]: *** [spl/arch/arm/mach-rockchip] Error 2
> +make[1]: *** [spl/u-boot-spl] Error 2
> +make: *** [sub-make] Error 2
> 
> 
> Regards,
> Simon

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

* [U-Boot] [PATCH v2 1/2] rockchip: rk3399: spl: add UART0 support for SPL
  2017-03-26 16:30       ` Dr. Philipp Tomsich
@ 2017-04-01  4:22         ` Simon Glass
  0 siblings, 0 replies; 9+ messages in thread
From: Simon Glass @ 2017-04-01  4:22 UTC (permalink / raw)
  To: u-boot

Hi,

On 26 March 2017 at 10:30, Dr. Philipp Tomsich
<philipp.tomsich@theobroma-systems.com> wrote:
> Simon,
>
> you’ll need
> CONFIG_DEBUG_UART_BOARD_INIT=y
> as include/debug_uart.h checks this macro and either defines this function
> inline (with
> an empty body) or allows the function definition.
>
> Seems like everyone just adds this to their defconfig (as did we), but I am
> open towards
> an automatic selection of this for ROCKCHIP_RK3399 via Kconfig.

Well we need to do something since I cannot apply patches which break
the build! Please can you make sure your patches apply cleaning to
u-boot mainline or u-boot-rockchip, and that each one independently
builds. It really speeds up the process!

>
> Regards,
> Philipp.
>
> On 26 Mar 2017, at 04:38, Simon Glass <sjg@chromium.org> wrote:
>
> Hi,
>
> On 23 March 2017 at 20:12, Kever Yang <kever.yang@rock-chips.com> wrote:
>
>
> Hi Philipp,
>
>
> On 03/24/2017 06:24 AM, Philipp Tomsich wrote:
>
>
> The RK3399-Q7 ("Puma") SoM exposes UART0 as the Qseven UART (i.e. the
> serial line available via standardised pins on the edge connector and
> available on a RS232 connector).
>
> To support boards (such as the RK3399-Q7) that require UART0 as a
> debug console, we match CONFIG_DEBUG_UART_BASE and add the appropriate
> iomux setup to the rk3399 SPL code.
>
> As we are already touching this code, we also move the board-specific
> UART setup (i.e. iomux setup) into board_debug_uart_init(). This will
> be called from the debug UART init when CONFIG_DEBUG_UART_BOARD_INIT
> is set.
>
> Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> ---
>
> Changes in v2:
> - Changed hex constant to lowercase
>
>  arch/arm/include/asm/arch-rockchip/grf_rk3399.h |  8 +++++++
>  arch/arm/mach-rockchip/rk3399-board-spl.c       | 29
> ++++++++++++++++++-------
>  2 files changed, 29 insertions(+), 8 deletions(-)
>
>
> This patch causes a build error for me:
>
>   aarch64:  +   evb-rk3399
> +arch/arm/mach-rockchip/rk3399-board-spl.c:60:6: error: redefinition
> of 'board_debug_uart_init'
> + void board_debug_uart_init(void)
> +      ^
> +In file included from arch/arm/mach-rockchip/rk3399-board-spl.c:8:0:
> +include/debug_uart.h:68:20: note: previous definition of
> 'board_debug_uart_init' was here
> + static inline void board_debug_uart_init(void)
> +                    ^
> +make[3]: *** [spl/arch/arm/mach-rockchip/rk3399-board-spl.o] Error 1
> +make[2]: *** [spl/arch/arm/mach-rockchip] Error 2
> +make[1]: *** [spl/u-boot-spl] Error 2
> +make: *** [sub-make] Error 2
>

Regards,
Simon

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

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

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-23 22:24 [U-Boot] [PATCH v2 0/2] rockchip: rk3399: spl: Make baudrate and UART configurable Philipp Tomsich
2017-03-23 22:24 ` [U-Boot] [PATCH v2 1/2] rockchip: rk3399: spl: add UART0 support for SPL Philipp Tomsich
2017-03-24  2:12   ` Kever Yang
2017-03-26  2:38     ` Simon Glass
2017-03-26 16:30       ` Dr. Philipp Tomsich
2017-04-01  4:22         ` Simon Glass
2017-03-23 22:24 ` [U-Boot] [PATCH v2 2/2] rockchip: config: rk3399: update defconfigs and rk3399_common Philipp Tomsich
2017-03-24  2:13   ` Kever Yang
2017-03-26  1:17   ` Simon Glass

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.