[U-Boot] [PATCH] serial: fix struct serial_device initialisation

Anatolij Gustschin agust at denx.de
Tue Apr 13 16:31:35 CEST 2010


Commit d774442c60756a8dd5d75de85574120ce375bd72
extended struct serial_device but didn't add
appropriate initialization in all serial drivers.
This results in bricking a huge number of boards.

This patch adds needed initialization in serial
drivers.

Reported-by: Wolfgang Denk <wd at denx.de>
Signed-off-by: Anatolij Gustschin <agust at denx.de>
---
This patch is based on u-boot-mpc5xxx master.

 board/logicpd/zoom2/zoom2_serial.h |    1 +
 cpu/mpc5xxx/serial.c               |    2 ++
 cpu/mpc8xx/serial.c                |    2 ++
 cpu/ppc4xx/4xx_uart.c              |    2 ++
 drivers/serial/serial.c            |    1 +
 drivers/serial/serial_pxa.c        |    3 +++
 drivers/serial/serial_s3c24x0.c    |    1 +
 drivers/serial/serial_s5pc1xx.c    |    1 +
 8 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/board/logicpd/zoom2/zoom2_serial.h b/board/logicpd/zoom2/zoom2_serial.h
index c98158f..a6d2427 100644
--- a/board/logicpd/zoom2/zoom2_serial.h
+++ b/board/logicpd/zoom2/zoom2_serial.h
@@ -65,6 +65,7 @@ struct serial_device zoom2_serial_device##n =	\
 	N(n),					\
 	U(n),					\
 	quad_init_##n,				\
+	NULL,					\
 	quad_setbrg_##n,			\
 	quad_getc_##n,				\
 	quad_tstc_##n,				\
diff --git a/cpu/mpc5xxx/serial.c b/cpu/mpc5xxx/serial.c
index a8a384a..f68caa0 100644
--- a/cpu/mpc5xxx/serial.c
+++ b/cpu/mpc5xxx/serial.c
@@ -357,6 +357,7 @@ struct serial_device serial0_device =
 	"serial0",
 	"UART0",
 	serial0_init,
+	NULL,
 	serial0_setbrg,
 	serial0_getc,
 	serial0_tstc,
@@ -369,6 +370,7 @@ struct serial_device serial1_device =
 	"serial1",
 	"UART1",
 	serial1_init,
+	NULL,
 	serial1_setbrg,
 	serial1_getc,
 	serial1_tstc,
diff --git a/cpu/mpc8xx/serial.c b/cpu/mpc8xx/serial.c
index 664db65..9514c66 100644
--- a/cpu/mpc8xx/serial.c
+++ b/cpu/mpc8xx/serial.c
@@ -392,6 +392,7 @@ struct serial_device serial_smc_device =
 	"serial_smc",
 	"SMC",
 	smc_init,
+	NULL,
 	smc_setbrg,
 	smc_getc,
 	smc_tstc,
@@ -662,6 +663,7 @@ struct serial_device serial_scc_device =
 	"serial_scc",
 	"SCC",
 	scc_init,
+	NULL,
 	scc_setbrg,
 	scc_getc,
 	scc_tstc,
diff --git a/cpu/ppc4xx/4xx_uart.c b/cpu/ppc4xx/4xx_uart.c
index 8de6542..e6ab570 100644
--- a/cpu/ppc4xx/4xx_uart.c
+++ b/cpu/ppc4xx/4xx_uart.c
@@ -822,6 +822,7 @@ struct serial_device serial0_device =
 	"serial0",
 	"UART0",
 	serial0_init,
+	NULL,
 	serial0_setbrg,
 	serial0_getc,
 	serial0_tstc,
@@ -834,6 +835,7 @@ struct serial_device serial1_device =
 	"serial1",
 	"UART1",
 	serial1_init,
+	NULL,
 	serial1_setbrg,
 	serial1_getc,
 	serial1_tstc,
diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c
index dd5f332..8eda95c 100644
--- a/drivers/serial/serial.c
+++ b/drivers/serial/serial.c
@@ -115,6 +115,7 @@ static NS16550_t serial_ports[4] = {
 	name,\
 	bus,\
 	eserial##port##_init,\
+	NULL,\
 	eserial##port##_setbrg,\
 	eserial##port##_getc,\
 	eserial##port##_tstc,\
diff --git a/drivers/serial/serial_pxa.c b/drivers/serial/serial_pxa.c
index 9ba457e..b74e439 100644
--- a/drivers/serial/serial_pxa.c
+++ b/drivers/serial/serial_pxa.c
@@ -266,6 +266,7 @@ struct serial_device serial_ffuart_device =
 	"serial_ffuart",
 	"PXA",
 	ffuart_init,
+	NULL,
 	ffuart_setbrg,
 	ffuart_getc,
 	ffuart_tstc,
@@ -310,6 +311,7 @@ struct serial_device serial_btuart_device =
 	"serial_btuart",
 	"PXA",
 	btuart_init,
+	NULL,
 	btuart_setbrg,
 	btuart_getc,
 	btuart_tstc,
@@ -354,6 +356,7 @@ struct serial_device serial_stuart_device =
 	"serial_stuart",
 	"PXA",
 	stuart_init,
+	NULL,
 	stuart_setbrg,
 	stuart_getc,
 	stuart_tstc,
diff --git a/drivers/serial/serial_s3c24x0.c b/drivers/serial/serial_s3c24x0.c
index 5dd4dd8..8a3e302 100644
--- a/drivers/serial/serial_s3c24x0.c
+++ b/drivers/serial/serial_s3c24x0.c
@@ -78,6 +78,7 @@ DECLARE_GLOBAL_DATA_PTR;
 	name, \
 	bus, \
 	s3serial##port##_init, \
+	NULL,\
 	s3serial##port##_setbrg, \
 	s3serial##port##_getc, \
 	s3serial##port##_tstc, \
diff --git a/drivers/serial/serial_s5pc1xx.c b/drivers/serial/serial_s5pc1xx.c
index 73669a9..8da0c86 100644
--- a/drivers/serial/serial_s5pc1xx.c
+++ b/drivers/serial/serial_s5pc1xx.c
@@ -185,6 +185,7 @@ void s5p_serial##port##_puts(const char *s) { serial_puts_dev(s, port); }
 	name, \
 	bus, \
 	s5p_serial##port##_init, \
+	NULL, \
 	s5p_serial##port##_setbrg, \
 	s5p_serial##port##_getc, \
 	s5p_serial##port##_tstc, \
-- 
1.6.3.3



More information about the U-Boot mailing list