Skip to contentSkip to conversation

nios2: Move serial drivers to individual files in drivers/serial

PATCH New Scott McNutt 1 participant 1 message Mar 19, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nios2: Move serial drivers to individual files in drivers/serial

The standard Altera UART & JTAG UART as well as the OpenCores YANU driver are now in individual files in drivers/serial rather than a single file uner cpu/nios2.

---
 cpu/nios2/Makefile                |    2 +-
 cpu/nios2/serial.c                |  309 -------------------------------------
 drivers/serial/Makefile           |    3 +
 drivers/serial/altera_jtag_uart.c |   70 +++++++++
 drivers/serial/altera_uart.c      |   94 +++++++++++
 drivers/serial/opencores_yanu.c   |  188 ++++++++++++++++++++++
 include/configs/EP1C20.h          |    3 +-
 include/configs/EP1S10.h          |    3 +-
 include/configs/EP1S40.h          |    3 +-
 include/configs/PCI5441.h         |    3 +-
 include/configs/PK1C20.h          |    3 +-
 11 files changed, 366 insertions(+), 315 deletions(-)
 delete mode 100644 cpu/nios2/serial.c
 create mode 100644 drivers/serial/altera_jtag_uart.c
 create mode 100644 drivers/serial/altera_uart.c
 create mode 100644 drivers/serial/opencores_yanu.c
cpu/nios2/Makefile +1 -1
index 75f30b4..3dfaa83 100644
@@ -27,7 +27,7 @@ LIB	= $(obj)lib$(CPU).a
 
 START	= start.o
 SOBJS	= exceptions.o
-COBJS	= cpu.o interrupts.o serial.o sysid.o traps.o epcs.o
+COBJS	= cpu.o interrupts.o sysid.o traps.o epcs.o
 
 SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
cpu/nios2/serial.c deleted +0 -309

309 lines not on this page · raw message

drivers/serial/Makefile +3 -0
index 3c77a7c..d2b4820 100644
@@ -25,11 +25,14 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libserial.a
 
+COBJS-$(CONFIG_ALTERA_UART) += altera_uart.o
+COBJS-$(CONFIG_ALTERA_JTAG_UART) += altera_jtag_uart.o
 COBJS-$(CONFIG_ARM_DCC) += arm_dcc.o
 COBJS-$(CONFIG_AT91RM9200_USART) += at91rm9200_usart.o
 COBJS-$(CONFIG_ATMEL_USART) += atmel_usart.o
 COBJS-$(CONFIG_MCFUART) += mcfuart.o
 COBJS-$(CONFIG_NS9750_UART) += ns9750_serial.o
+COBJS-$(CONFIG_OPENCORES_YANU) += opencores_yanu.o
 COBJS-$(CONFIG_SYS_NS16550) += ns16550.o
 COBJS-$(CONFIG_DRIVER_S3C4510_UART) += s3c4510b_uart.o
 COBJS-$(CONFIG_S3C64XX) += s3c64xx.o
drivers/serial/altera_jtag_uart.c new file +70 -0

70 lines not on this page · raw message

drivers/serial/altera_uart.c new file +94 -0

94 lines not on this page · raw message

drivers/serial/opencores_yanu.c new file +188 -0

188 lines not on this page · raw message

include/configs/EP1C20.h +2 -1
index 61d8e20..dc82e54 100644
@@ -94,7 +94,8 @@
 /*------------------------------------------------------------------------
  * CONSOLE
  *----------------------------------------------------------------------*/
-#if defined(CONFIG_CONSOLE_JTAG)
+#define CONFIG_ALTERA_UART		1	/* Use altera uart */
+#if defined(CONFIG_ALTERA_JTAG_UART)
 #define CONFIG_SYS_NIOS_CONSOLE	0x021208b0	/* JTAG UART base addr	*/
 #else
 #define CONFIG_SYS_NIOS_CONSOLE	0x02120840	/* UART base addr	*/
include/configs/EP1S10.h +2 -1
index 41e64e6..498f26d 100644
@@ -92,7 +92,8 @@
 /*------------------------------------------------------------------------
  * CONSOLE
  *----------------------------------------------------------------------*/
-#if defined(CONFIG_CONSOLE_JTAG)
+#define CONFIG_ALTERA_UART		1	/* Use altera uart */
+#if defined(CONFIG_ALTERA_JTAG_UART)
 #define CONFIG_SYS_NIOS_CONSOLE	0x021208b0	/* JTAG UART base addr	*/
 #else
 #define CONFIG_SYS_NIOS_CONSOLE	0x02120840	/* UART base addr	*/
include/configs/EP1S40.h +2 -1
index 5b332e4..4ad65d8 100644
@@ -92,7 +92,8 @@
 /*------------------------------------------------------------------------
  * CONSOLE
  *----------------------------------------------------------------------*/
-#if defined(CONFIG_CONSOLE_JTAG)
+#define CONFIG_ALTERA_UART		1	/* Use altera uart */
+#if defined(CONFIG_ALTERA_JTAG_UART)
 #define CONFIG_SYS_NIOS_CONSOLE	0x021208b0	/* JTAG UART base addr	*/
 #else
 #define CONFIG_SYS_NIOS_CONSOLE	0x02120840	/* UART base addr	*/
include/configs/PCI5441.h +2 -1
index 831a60d..d06b7f8 100644
@@ -92,7 +92,8 @@
 /*------------------------------------------------------------------------
  * CONSOLE
  *----------------------------------------------------------------------*/
-#if defined(CONFIG_CONSOLE_JTAG)
+#define CONFIG_ALTERA_UART		1	/* Use altera uart */
+#if defined(CONFIG_ALTERA_JTAG_UART)
 #define CONFIG_SYS_NIOS_CONSOLE	0x00920820	/* JTAG UART base addr	*/
 #else
 #define CONFIG_SYS_NIOS_CONSOLE	0x009208a0	/* UART base addr	*/
include/configs/PK1C20.h +2 -1
index cf6f7a9..165dde0 100644
@@ -94,7 +94,8 @@
 /*------------------------------------------------------------------------
  * CONSOLE
  *----------------------------------------------------------------------*/
-#if defined(CONFIG_CONSOLE_JTAG)
+#define CONFIG_ALTERA_UART		1	/* Use altera uart */
+#if defined(CONFIG_ALTERA_JTAG_UART)
 #define CONFIG_SYS_NIOS_CONSOLE	0x021208b0	/* JTAG UART base addr	*/
 #else
 #define CONFIG_SYS_NIOS_CONSOLE	0x02120840	/* UART base addr	*/
Signature · 1 line
1.6.0.6