Skip to contentSkip to conversation

Merged serial_pl010.c and serial_pl011.c.

PATCH New Andreas Engel 3 participants 11 messages Aug 25, 2008 – Sep 9, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Merged serial_pl010.c and serial_pl011.c.

They only differ in the init function.
This also adds the missing watchdog support for the PL011.

---
 drivers/serial/Makefile                           |    3 +-
 drivers/serial/serial_pl011.c                     |  161 ---------------------
 drivers/serial/{serial_pl010.c => serial_pl01x.c} |   83 +++++++++--
 drivers/serial/{serial_pl011.h => serial_pl01x.h} |    0
 4 files changed, 69 insertions(+), 178 deletions(-)
 delete mode 100644 drivers/serial/serial_pl011.c
 rename drivers/serial/{serial_pl010.c => serial_pl01x.c} (66%)
 rename drivers/serial/{serial_pl011.h => serial_pl01x.h} (100%)
drivers/serial/Makefile +1 -2
index 2384735..25f13df 100644
@@ -32,8 +32,7 @@ COBJS-y += ns16550.o
 COBJS-$(CONFIG_DRIVER_S3C4510_UART) += s3c4510b_uart.o
 COBJS-y += serial.o
 COBJS-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o
-COBJS-y += serial_pl010.o
-COBJS-y += serial_pl011.o
+COBJS-y += serial_pl01x.o
 COBJS-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
 COBJS-$(CONFIG_SCIF_CONSOLE) += serial_sh.o
 COBJS-$(CONFIG_USB_TTY) += usbtty.o
drivers/serial/serial_pl011.c deleted +0 -161

161 lines not on this page · raw message

drivers/serial/serial_pl01x.c renamed from drivers/serial/serial_pl010.c +68 -15

140 lines not on this page · raw message

drivers/serial/serial_pl01x.h renamed from drivers/serial/serial_pl011.h +0 -0
similarity index 100%
rename from drivers/serial/serial_pl011.h
rename to drivers/serial/serial_pl01x.h
Signature · 1 line
1.5.6.5
#1 lore raw

PATCH 1/1 Merged serial_pl010.c and serial_pl011.c.

Dear Andreas Engel,

Quoted 4 lines · In message <[email protected]> you…

They only differ in the init function.
This also adds the missing watchdog support for the PL011.

Quoted 9 lines
---
 drivers/serial/Makefile                           |    3 +-
 drivers/serial/serial_pl011.c                     |  161 ---------------------
 drivers/serial/{serial_pl010.c => serial_pl01x.c} |   83 +++++++++--
 drivers/serial/{serial_pl011.h => serial_pl01x.h} |    0
 4 files changed, 69 insertions(+), 178 deletions(-)
 delete mode 100644 drivers/serial/serial_pl011.c
 rename drivers/serial/{serial_pl010.c => serial_pl01x.c} (66%)
 rename drivers/serial/{serial_pl011.h => serial_pl01x.h} (100%)

This patch does not apply (any more?) :

Applying Merged serial_pl010.c and serial_pl011.c.
error: patch failed: drivers/serial/Makefile:32
error: drivers/serial/Makefile: patch does not apply
fatal: mode change for drivers/serial/serial_pl011.h, which is not in current HEAD
Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge.
Patch failed at 0001.

Please rebase and resubmit. Thanks in advance.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The use of anthropomorphic terminology when  dealing  with  computing
systems is a symptom of professional immaturity.   -- Edsger Dijkstra
#2 lore raw

PATCH 1/1 Merged serial_pl010.c and serial_pl011.c.

They only differ in the init function.
This also adds the missing watchdog support for the PL011.

---

Updated patch to the current git head as of today.

 drivers/serial/Makefile                           |    3 +-
 drivers/serial/serial_pl011.c                     |  161 ---------------------
 drivers/serial/{serial_pl010.c => serial_pl01x.c} |   83 +++++++++--
 drivers/serial/{serial_pl011.h => serial_pl01x.h} |    0
 4 files changed, 69 insertions(+), 178 deletions(-)
 delete mode 100644 drivers/serial/serial_pl011.c
 rename drivers/serial/{serial_pl010.c => serial_pl01x.c} (66%)
 rename drivers/serial/{serial_pl011.h => serial_pl01x.h} (100%)
drivers/serial/Makefile +1 -2
index f30014d..3cc1999 100644
@@ -33,8 +33,7 @@ COBJS-$(CONFIG_DRIVER_S3C4510_UART) += s3c4510b_uart.o
 COBJS-$(CONFIG_S3C64XX) += s3c64xx.o
 COBJS-y += serial.o
 COBJS-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o
-COBJS-y += serial_pl010.o
-COBJS-y += serial_pl011.o
+COBJS-y += serial_pl01x.o
 COBJS-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
 COBJS-$(CONFIG_SCIF_CONSOLE) += serial_sh.o
 COBJS-$(CONFIG_USB_TTY) += usbtty.o
drivers/serial/serial_pl011.c deleted +0 -161

161 lines not on this page · raw message

drivers/serial/serial_pl01x.c renamed from drivers/serial/serial_pl010.c +68 -15

140 lines not on this page · raw message

drivers/serial/serial_pl01x.h renamed from drivers/serial/serial_pl011.h +0 -0
similarity index 100%
rename from drivers/serial/serial_pl011.h
rename to drivers/serial/serial_pl01x.h
Signature · 1 line
1.5.6.5
#3 lore raw

PATCH 1/1 Merged serial_pl010.c and serial_pl011.c.

Quoted 54 lines · Andreas Engel

They only differ in the init function.
This also adds the missing watchdog support for the PL011.

---

Updated patch to the current git head as of today.

 drivers/serial/Makefile                           |    3 +-
 drivers/serial/serial_pl011.c                     |  161 ---------------------
 drivers/serial/{serial_pl010.c => serial_pl01x.c} |   83 +++++++++--
 drivers/serial/{serial_pl011.h => serial_pl01x.h} |    0
 4 files changed, 69 insertions(+), 178 deletions(-)
 delete mode 100644 drivers/serial/serial_pl011.c
 rename drivers/serial/{serial_pl010.c => serial_pl01x.c} (66%)
 rename drivers/serial/{serial_pl011.h => serial_pl01x.h} (100%)
drivers/serial/Makefile +1 -2
index f30014d..3cc1999 100644
@@ -33,8 +33,7 @@ COBJS-$(CONFIG_DRIVER_S3C4510_UART) += s3c4510b_uart.o
 COBJS-$(CONFIG_S3C64XX) += s3c64xx.o
 COBJS-y += serial.o
 COBJS-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o
-COBJS-y += serial_pl010.o
-COBJS-y += serial_pl011.o
+COBJS-y += serial_pl01x.o
 COBJS-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
 COBJS-$(CONFIG_SCIF_CONSOLE) += serial_sh.o
 COBJS-$(CONFIG_USB_TTY) += usbtty.o
drivers/serial/serial_pl011.c deleted +1 -15
deleted file mode 100644
index 4d35fe5..0000000
@@ -1,161 +0,0 @@
-/*
- * (C) Copyright 2000
- * Rob Taylor, Flying Pig Systems. robt at flyingpig.com.
- *
- * (C) Copyright 2004
- * ARM Ltd.
- * Philippe Robin, <[email protected]>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
+++ b/drivers/serial/serial_pl01x.c

drivers/serial/serial_pl011.c line 34

Quoted 5 lines
drivers/serial/serial_pl011.c deleted +1 -1
@@ -31,24 +31,28 @@
 #include <common.h>
 #include <watchdog.h>
 
-#ifdef CFG_PL010_SERIAL
+#if defined(CFG_PL010_SERIAL) || defined(CFG_PL011_SERIAL)

Please move this to the Makefile

Best Regards,
J.

#4 lore raw

PATCH 1/1 Merged serial_pl010.c and serial_pl011.c.

Quoted 6 lines · Jean-Christophe PLAGNIOL-VILLARD

drivers/serial/serial_pl01x.c line 34

Quoted 4 lines · Andreas Engel

[...]

drivers/serial/serial_pl01x.c renamed from drivers/serial/serial_pl010.c +1 -1
-#ifdef CFG_PL010_SERIAL
+#if defined(CFG_PL010_SERIAL) || defined(CFG_PL011_SERIAL)

Please move this to the Makefile

Shouldn't this better be a separate patch?

Regards,
Andreas

#5 lore raw

PATCH 1/1 Merged serial_pl010.c and serial_pl011.c.

Dear Andreas Engel,

Quoted 9 lines · In message <[email protected]> you wrote:
Quoted 6 lines · Jean-Christophe PLAGNIOL-VILLARD

drivers/serial/serial_pl01x.c line 34

Quoted 4 lines · Andreas Engel

[...]

drivers/serial/serial_pl01x.c renamed from drivers/serial/serial_pl010.c +1 -1
-#ifdef CFG_PL010_SERIAL
+#if defined(CFG_PL010_SERIAL) || defined(CFG_PL011_SERIAL)

Please move this to the Makefile

Shouldn't this better be a separate patch?

Yes, indeed.

Thanks in advance.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You have the capacity to learn from  mistakes.  You'll  learn  a  lot
today.
#6 lore raw

PATCH 1/1 Moved conditional compile into Makefile

In reply to Jean-Christophe PLAGNIOL-VILLARD
---
 README                         |    4 ++--
 drivers/serial/Makefile        |    3 ++-
 drivers/serial/serial_pl01x.c  |   15 +++++----------
 include/configs/integratorap.h |    2 +-
 include/configs/integratorcp.h |    2 +-
 include/configs/versatile.h    |    2 +-
 6 files changed, 12 insertions(+), 16 deletions(-)
README +2 -2
index 37449d1..4daff33 100644
@@ -380,11 +380,11 @@ The following options need to be configured:
 		param header, the default value is zero if undefined.
 
 - Serial Ports:
-		CFG_PL010_SERIAL
+		CONFIG_PL010_SERIAL
 
 		Define this if you want support for Amba PrimeCell PL010 UARTs.
 
-		CFG_PL011_SERIAL
+		CONFIG_PL011_SERIAL
 
 		Define this if you want support for Amba PrimeCell PL011 UARTs.
 
drivers/serial/Makefile +2 -1
index 3cc1999..b370828 100644
@@ -33,7 +33,8 @@ COBJS-$(CONFIG_DRIVER_S3C4510_UART) += s3c4510b_uart.o
 COBJS-$(CONFIG_S3C64XX) += s3c64xx.o
 COBJS-y += serial.o
 COBJS-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o
-COBJS-y += serial_pl01x.o
+COBJS-$(CONFIG_PL010_SERIAL) += serial_pl01x.o
+COBJS-$(CONFIG_PL011_SERIAL) += serial_pl01x.o
 COBJS-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
 COBJS-$(CONFIG_SCIF_CONSOLE) += serial_sh.o
 COBJS-$(CONFIG_USB_TTY) += usbtty.o
drivers/serial/serial_pl01x.c +5 -10
index d0497ec..c645cef 100644
@@ -25,14 +25,11 @@
  * MA 02111-1307 USA
  */
 
-/* Simple U-Boot driver for the PrimeCell PL011 UARTs on the IntegratorCP */
-/* Should be fairly simple to make it work with the PL010 as well */
+/* Simple U-Boot driver for the PrimeCell PL010/PL011 UARTs */
 
 #include <common.h>
 #include <watchdog.h>
 
-#if defined(CFG_PL010_SERIAL) || defined(CFG_PL011_SERIAL)
-
 #include "serial_pl01x.h"
 
 #define IO_WRITE(addr, val) (*(volatile unsigned int *)(addr) = (val))
@@ -52,7 +49,7 @@ static void pl01x_putc (int portnum, char c);
 static int pl01x_getc (int portnum);
 static int pl01x_tstc (int portnum);
 
-#ifdef CFG_PL010_SERIAL
+#ifdef CONFIG_PL010_SERIAL
 
 int serial_init (void)
 {
@@ -110,9 +107,9 @@ int serial_init (void)
 	return 0;
 }
 
-#endif /* CFG_PL010_SERIAL */
+#endif /* CONFIG_PL010_SERIAL */
 
-#ifdef CFG_PL011_SERIAL
+#ifdef CONFIG_PL011_SERIAL
 
 int serial_init (void)
 {
@@ -157,7 +154,7 @@ int serial_init (void)
 	return 0;
 }
 
-#endif /* CFG_PL011_SERIAL */
+#endif /* CONFIG_PL011_SERIAL */
 
 void serial_putc (const char c)
 {
@@ -224,5 +221,3 @@ static int pl01x_tstc (int portnum)
 	return !(IO_READ (port[portnum] + UART_PL01x_FR) &
 		 UART_PL01x_FR_RXFE);
 }
-
-#endif
include/configs/integratorap.h +1 -1
index 1452bf2..ba3c531 100644
@@ -58,7 +58,7 @@
 /*
  * PL010 Configuration
  */
-#define CFG_PL010_SERIAL
+#define CONFIG_PL010_SERIAL
 #define CONFIG_CONS_INDEX	0
 #define CONFIG_BAUDRATE		38400
 #define CONFIG_PL01x_PORTS	{ (void *) (CFG_SERIAL0), (void *) (CFG_SERIAL1) }
include/configs/integratorcp.h +1 -1
index 347fa02..5340f7c 100644
@@ -61,7 +61,7 @@
 /*
  * NS16550 Configuration
  */
-#define CFG_PL011_SERIAL
+#define CONFIG_PL011_SERIAL
 #define CONFIG_PL011_CLOCK	14745600
 #define CONFIG_PL01x_PORTS	{ (void *)CFG_SERIAL0, (void *)CFG_SERIAL1 }
 #define CONFIG_CONS_INDEX	0
include/configs/versatile.h +1 -1
index a88d356..c18a248 100644
@@ -86,7 +86,7 @@
 /*
  * NS16550 Configuration
  */
-#define CFG_PL011_SERIAL
+#define CONFIG_PL011_SERIAL
 #define CONFIG_PL011_CLOCK	24000000
 #define CONFIG_PL01x_PORTS	{ (void *)CFG_SERIAL0, (void *)CFG_SERIAL1 }
 #define CONFIG_CONS_INDEX	0
Signature · 1 line
1.5.6.5
#7 lore raw

PATCH 1/1 Moved conditional compile into Makefile

Quoted 34 lines · Andreas Engel
---
 README                         |    4 ++--
 drivers/serial/Makefile        |    3 ++-
 drivers/serial/serial_pl01x.c  |   15 +++++----------
 include/configs/integratorap.h |    2 +-
 include/configs/integratorcp.h |    2 +-
 include/configs/versatile.h    |    2 +-
 6 files changed, 12 insertions(+), 16 deletions(-)
README +2 -2
index 37449d1..4daff33 100644
@@ -380,11 +380,11 @@ The following options need to be configured:
 		param header, the default value is zero if undefined.
 
 - Serial Ports:
-		CFG_PL010_SERIAL
+		CONFIG_PL010_SERIAL
 
 		Define this if you want support for Amba PrimeCell PL010 UARTs.
 
-		CFG_PL011_SERIAL
+		CONFIG_PL011_SERIAL
 
 		Define this if you want support for Amba PrimeCell PL011 UARTs.
 
drivers/serial/Makefile +0 -0
index 3cc1999..b370828 100644

drivers/serial/Makefile COBJS-$(CONFIG_DRIVER_S3C4510_UART) += s3c4510b_uart.o · line 37

Quoted 6 lines
drivers/serial/Makefile +2 -1
@@ -33,7 +33,8 @@ COBJS-$(CONFIG_DRIVER_S3C4510_UART) += s3c4510b_uart.o
 COBJS-$(CONFIG_S3C64XX) += s3c64xx.o
 COBJS-y += serial.o
 COBJS-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o
-COBJS-y += serial_pl01x.o
+COBJS-$(CONFIG_PL010_SERIAL) += serial_pl01x.o
+COBJS-$(CONFIG_PL011_SERIAL) += serial_pl01x.o

what append if CONFIG_PL010_SERIAL and CONFIG_PL011_SERIAL is active at the same time?

serial_pl01x.c will be compile twice

so please move to +COBJS-$(CONFIG_PL010_SERIAL)$(CONFIG_PL011_SERIAL) += serial_pl01x.o

Best Regards,
J.

#8 lore raw

PATCH 1/1 Moved conditional compile into Makefile

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 3 lines · In message <[email protected]> you wrote:

what append if CONFIG_PL010_SERIAL and CONFIG_PL011_SERIAL is active at the same time?

Then something is missing.

Quoted 4 lines

serial_pl01x.c will be compile twice

so please move to +COBJS-$(CONFIG_PL010_SERIAL)$(CONFIG_PL011_SERIAL) += serial_pl01x.o

This alone is not sufficient, since then you need to add a rule for the resulting COBJS-yy.

But as I learned all of this is completely unnecessary.

As Detlev Zundel pointed out, just doing "COBJS-y = $(sort COBJS-y)" would fix any such problems in a clean and readable way.

I recommend to add such a statement instead.

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Do you know about being with somebody? Wanting to be? If  I  had  the
whole  universe,  I'd  give it to you, Janice. When I see you, I feel
like I'm hungry all over. Do you know how that feels?
	-- Charlie Evans, "Charlie X", stardate 1535.8
#9 lore raw

PATCH 1/1 Moved conditional compile into Makefile

Quoted 7 lines · Wolfgang Denk

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 2 lines · In message <[email protected]> you wrote:

what append if CONFIG_PL010_SERIAL and CONFIG_PL011_SERIAL is active at the same time?

Then something is missing.

In this particular case, this will not work anyway. The driver is not prepared to support both a PL010 and a PL011 at the same time. And I doubt that there's some real hardware out there which actually contains both types of uarts.

Quoted 7 lines
Quoted 4 lines

serial_pl01x.c will be compile twice

so please move to +COBJS-$(CONFIG_PL010_SERIAL)$(CONFIG_PL011_SERIAL) += serial_pl01x.o

This alone is not sufficient, since then you need to add a rule for the resulting COBJS-yy.

There's already such a rule in common/Makefile.

Quoted 6 lines

But as I learned all of this is completely unnecessary.

As Detlev Zundel pointed out, just doing "COBJS-y = $(sort COBJS-y)" would fix any such problems in a clean and readable way.

I recommend to add such a statement instead.

Yes, that's definitely better, as it also catches cases with more than two y's.

Regards,
Andreas

#10 lore raw

PATCH 1/1 Merged serial_pl010.c and serial_pl011.c.

In reply to Andreas Engel

Dear Andreas Engel,

Quoted 8 lines · In message <[email protected]> you…

They only differ in the init function.
This also adds the missing watchdog support for the PL011.

---

Updated patch to the current git head as of today.

Quoted 8 lines
 drivers/serial/Makefile                           |    3 +-
 drivers/serial/serial_pl011.c                     |  161 ---------------------
 drivers/serial/{serial_pl010.c => serial_pl01x.c} |   83 +++++++++--
 drivers/serial/{serial_pl011.h => serial_pl01x.h} |    0
 4 files changed, 69 insertions(+), 178 deletions(-)
 delete mode 100644 drivers/serial/serial_pl011.c
 rename drivers/serial/{serial_pl010.c => serial_pl01x.c} (66%)
 rename drivers/serial/{serial_pl011.h => serial_pl01x.h} (100%)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"A witty saying proves nothing."                           - Voltaire