All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v2] sunxi: Add UART4 console support for A64
@ 2020-07-08 12:11 Nazım Gediz Aydındoğmuş
  2020-07-11  9:30 ` Jagan Teki
  2020-07-16  8:36 ` Maxime Ripard
  0 siblings, 2 replies; 5+ messages in thread
From: Nazım Gediz Aydındoğmuş @ 2020-07-08 12:11 UTC (permalink / raw)
  To: u-boot

UART4 port of A64 was in conflict with R_UART of older SoCs, like A23.

This commit adds necessary definitions to use UART4 port on A64.

Signed-off-by: Naz?m Gediz Ayd?ndo?mu? <gediz.aydindogmus@genemek.com>
Tested-by: Faruk K?lavuz <faruk.kilavuz@genemek.com>
---

Changes in v2:
- Removed redundant OF_STDOUT_PATH changes
- Simplified commit log to meet 80 characters

 arch/arm/include/asm/arch-sunxi/gpio.h | 1 +
 arch/arm/mach-sunxi/board.c            | 4 ++++
 arch/arm/mach-sunxi/clock_sun6i.c      | 3 ++-
 include/configs/sunxi-common.h         | 4 ++++
 4 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/arch-sunxi/gpio.h b/arch/arm/include/asm/arch-sunxi/gpio.h
index a646ea6a3c..1407aff25f 100644
--- a/arch/arm/include/asm/arch-sunxi/gpio.h
+++ b/arch/arm/include/asm/arch-sunxi/gpio.h
@@ -176,6 +176,7 @@ enum sunxi_gpio_number {
 #define SUNXI_GPD_LCD0		2
 #define SUNXI_GPD_LVDS0		3
 #define SUNXI_GPD_PWM		2
+#define SUN50I_GPD_UART4	3
 
 #define SUN5I_GPE_SDC2		3
 #define SUN8I_GPE_TWI2		3
diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c
index f40fccd8f8..7d95b7dd29 100644
--- a/arch/arm/mach-sunxi/board.c
+++ b/arch/arm/mach-sunxi/board.c
@@ -140,6 +140,10 @@ static int gpio_init(void)
 	sunxi_gpio_set_cfgpin(SUNXI_GPL(2), SUN8I_GPL_R_UART);
 	sunxi_gpio_set_cfgpin(SUNXI_GPL(3), SUN8I_GPL_R_UART);
 	sunxi_gpio_set_pull(SUNXI_GPL(3), SUNXI_GPIO_PULL_UP);
+#elif CONFIG_CONS_INDEX == 5 && defined(CONFIG_MACH_SUN50I)
+	sunxi_gpio_set_cfgpin(SUNXI_GPD(2), SUN50I_GPD_UART4);
+	sunxi_gpio_set_cfgpin(SUNXI_GPD(3), SUN50I_GPD_UART4);
+	sunxi_gpio_set_pull(SUNXI_GPD(3), SUNXI_GPIO_PULL_UP);
 #else
 #error Unsupported console port number. Please fix pin mux settings in board.c
 #endif
diff --git a/arch/arm/mach-sunxi/clock_sun6i.c b/arch/arm/mach-sunxi/clock_sun6i.c
index 8e84062bd7..95f8e807f3 100644
--- a/arch/arm/mach-sunxi/clock_sun6i.c
+++ b/arch/arm/mach-sunxi/clock_sun6i.c
@@ -83,7 +83,8 @@ void clock_init_sec(void)
 
 void clock_init_uart(void)
 {
-#if CONFIG_CONS_INDEX < 5
+#if CONFIG_CONS_INDEX < 5 || \
+		defined(CONFIG_MACH_SUN50I) && CONFIG_CONS_INDEX < 6
 	struct sunxi_ccm_reg *const ccm =
 		(struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
 
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 5b0bec0561..1324d60f60 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -45,8 +45,12 @@
 # define CONFIG_SYS_NS16550_COM2		SUNXI_UART1_BASE
 # define CONFIG_SYS_NS16550_COM3		SUNXI_UART2_BASE
 # define CONFIG_SYS_NS16550_COM4		SUNXI_UART3_BASE
+#if defined(CONFIG_MACH_SUN50I)
+# define CONFIG_SYS_NS16550_COM5		SUNXI_UART4_BASE
+#else
 # define CONFIG_SYS_NS16550_COM5		SUNXI_R_UART_BASE
 #endif
+#endif
 
 /* CPU */
 #define COUNTER_FREQUENCY		24000000
-- 
2.17.1

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

* [RFC PATCH v2] sunxi: Add UART4 console support for A64
  2020-07-08 12:11 [RFC PATCH v2] sunxi: Add UART4 console support for A64 Nazım Gediz Aydındoğmuş
@ 2020-07-11  9:30 ` Jagan Teki
  2020-07-13  8:11   ` Nazım Gediz AYDINDOĞMUŞ
  2020-07-16  8:36 ` Maxime Ripard
  1 sibling, 1 reply; 5+ messages in thread
From: Jagan Teki @ 2020-07-11  9:30 UTC (permalink / raw)
  To: u-boot

On Wed, Jul 8, 2020 at 5:41 PM Naz?m Gediz Ayd?ndo?mu?
<gediz.aydindogmus@genemek.com> wrote:
>
> UART4 port of A64 was in conflict with R_UART of older SoCs, like A23.
>
> This commit adds necessary definitions to use UART4 port on A64.
>
> Signed-off-by: Naz?m Gediz Ayd?ndo?mu? <gediz.aydindogmus@genemek.com>
> Tested-by: Faruk K?lavuz <faruk.kilavuz@genemek.com>
> ---

I think this cannot be RFC, otherwise

Acked-by: Jagan Teki <jagan@amarulasolutions.com>

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

* [RFC PATCH v2] sunxi: Add UART4 console support for A64
  2020-07-11  9:30 ` Jagan Teki
@ 2020-07-13  8:11   ` Nazım Gediz AYDINDOĞMUŞ
  0 siblings, 0 replies; 5+ messages in thread
From: Nazım Gediz AYDINDOĞMUŞ @ 2020-07-13  8:11 UTC (permalink / raw)
  To: u-boot

On 11.07.2020 12:30, Jagan Teki wrote:
> On Wed, Jul 8, 2020 at 5:41 PM Naz?m Gediz Ayd?ndo?mu?
> <gediz.aydindogmus@genemek.com> wrote:
>> UART4 port of A64 was in conflict with R_UART of older SoCs, like A23.
>>
>> This commit adds necessary definitions to use UART4 port on A64.
>>
>> Signed-off-by: Naz?m Gediz Ayd?ndo?mu? <gediz.aydindogmus@genemek.com>
>> Tested-by: Faruk K?lavuz <faruk.kilavuz@genemek.com>
>> ---
> I think this cannot be RFC, otherwise
>
> Acked-by: Jagan Teki <jagan@amarulasolutions.com>
>
Hello,

I thought it may be suitable to word the subject as RFC because Maxime
Ripard pointed out some incomplete parts about the preceding version of
the patch (I'm grateful for that) and it made me think that there may be
more of it. Is this patch eligible now to send as a non-RFC patch?

Thanks for the review.

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

* [RFC PATCH v2] sunxi: Add UART4 console support for A64
  2020-07-08 12:11 [RFC PATCH v2] sunxi: Add UART4 console support for A64 Nazım Gediz Aydındoğmuş
  2020-07-11  9:30 ` Jagan Teki
@ 2020-07-16  8:36 ` Maxime Ripard
  2020-07-21  5:06   ` Nazım Gediz AYDINDOĞMUŞ
  1 sibling, 1 reply; 5+ messages in thread
From: Maxime Ripard @ 2020-07-16  8:36 UTC (permalink / raw)
  To: u-boot

On Wed, Jul 08, 2020 at 03:11:18PM +0300, Naz?m Gediz Ayd?ndo?mu? wrote:
> UART4 port of A64 was in conflict with R_UART of older SoCs, like A23.
> 
> This commit adds necessary definitions to use UART4 port on A64.
> 
> Signed-off-by: Naz?m Gediz Ayd?ndo?mu? <gediz.aydindogmus@genemek.com>
> Tested-by: Faruk K?lavuz <faruk.kilavuz@genemek.com>
> ---
> 
> Changes in v2:
> - Removed redundant OF_STDOUT_PATH changes

AFAIK they are needed, but the path was wrong in your original version.

Maxime
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200716/9223838b/attachment.sig>

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

* [RFC PATCH v2] sunxi: Add UART4 console support for A64
  2020-07-16  8:36 ` Maxime Ripard
@ 2020-07-21  5:06   ` Nazım Gediz AYDINDOĞMUŞ
  0 siblings, 0 replies; 5+ messages in thread
From: Nazım Gediz AYDINDOĞMUŞ @ 2020-07-21  5:06 UTC (permalink / raw)
  To: u-boot

On 16.07.2020 11:36, Maxime Ripard wrote:
> On Wed, Jul 08, 2020 at 03:11:18PM +0300, Naz?m Gediz Ayd?ndo?mu? wrote:
>> UART4 port of A64 was in conflict with R_UART of older SoCs, like A23.
>>
>> This commit adds necessary definitions to use UART4 port on A64.
>>
>> Signed-off-by: Naz?m Gediz Ayd?ndo?mu? <gediz.aydindogmus@genemek.com>
>> Tested-by: Faruk K?lavuz <faruk.kilavuz@genemek.com>
>> ---
>>
>> Changes in v2:
>> - Removed redundant OF_STDOUT_PATH changes
> 
> AFAIK they are needed, but the path was wrong in your original version.
> 
> Maxime
> 

I will inspect it again in order to find a proper patch for a "soc" node 
on the DTS. Thanks.

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

end of thread, other threads:[~2020-07-21  5:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-08 12:11 [RFC PATCH v2] sunxi: Add UART4 console support for A64 Nazım Gediz Aydındoğmuş
2020-07-11  9:30 ` Jagan Teki
2020-07-13  8:11   ` Nazım Gediz AYDINDOĞMUŞ
2020-07-16  8:36 ` Maxime Ripard
2020-07-21  5:06   ` Nazım Gediz AYDINDOĞMUŞ

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.