Skip to contentSkip to conversation

ZOOM2 Add serial support.

PATCH New Tom Rix 2 participants 4 messages May 16, 2009 – May 17, 2009

lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/2 ZOOM2 Add serial support.

Zoom2 serial is in general supplied by one of the 4 UARTS on the debug board. The default serial is from the USB connector on left side of the debug board. The USB connector will produce 2 of the 4 UARTS. On your host pick the first enumeration.

The details of the setting of the serial gpmc setup are not available. The values were provided by another party.

The serial port set up is the same with Zoom1.
Baud rate 115200, 8 bit data, no parity, 1 stop bit, no flow.

The kernel bootargs are
console=ttyS3,115200n8

ixx

---
 board/omap3/zoom2/Makefile       |    3 +-
 board/omap3/zoom2/zoom2.c        |   38 +++++++++++
 board/omap3/zoom2/zoom2_serial.c |  130 ++++++++++++++++++++++++++++++++++++++
 board/omap3/zoom2/zoom2_serial.h |   75 ++++++++++++++++++++++
 common/serial.c                  |    2 +
 drivers/serial/ns16550.c         |    4 +-
 include/configs/omap3_zoom2.h    |   26 ++++----
 include/serial.h                 |    7 ++
 8 files changed, 269 insertions(+), 16 deletions(-)
 create mode 100644 board/omap3/zoom2/zoom2_serial.c
 create mode 100644 board/omap3/zoom2/zoom2_serial.h
board/omap3/zoom2/Makefile +2 -1
index b8fa5a7..d27990c 100644
@@ -26,7 +26,8 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)lib$(BOARD).a
 
 COBJS	:= zoom2.o \
-	debug_board.o
+	debug_board.o \
+	zoom2_serial.o
 
 SRCS	:= $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
board/omap3/zoom2/zoom2.c +38 -0
index 0700c56..83e02f6 100644
@@ -30,10 +30,32 @@
  */
 #include <common.h>
 #include <asm/io.h>
+#include <asm/arch/mem.h>
 #include <asm/arch/mux.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/mach-types.h>
 #include "zoom2.h"
+#include "zoom2_serial.h"
+
+/*
+ * This the the zoom2, board specific, gpmc configuration for the
+ * quad uart on the debug board.   The more general gpmc configurations
+ * are setup at the cpu level in cpu/arm_cortexa8/omap3/mem.c
+ *
+ * The details of the setting of the serial gpmc setup are not available.
+ * The values were provided by another party.
+ */
+extern void enable_gpmc_config(u32 *gpmc_config, gpmc_csx_t *gpmc_cs_base,
+			       u32 base, u32 size);
+
+static u32 gpmc_serial_TL16CP754C[GPMC_MAX_REG] = {
+	0x00011000,
+	0x001F1F01,
+	0x00080803,
+	0x1D091D09,
+	0x041D1F1F,
+	0x1D0904C4, 0
+};
 
 /*
  * Routine: board_init
@@ -42,13 +64,29 @@
 int board_init (void)
 {
 	DECLARE_GLOBAL_DATA_PTR;
+	gpmc_csx_t *serial_cs_base;
+	u32 *gpmc_config;
 
 	gpmc_init ();		/* in SRAM or SDRAM, finish GPMC */
+
+	/* Configure console support on zoom2 */
+	gpmc_config = gpmc_serial_TL16CP754C;
+	serial_cs_base = (gpmc_csx_t *) (GPMC_CONFIG_CS0_BASE +
+					 (3 * GPMC_CONFIG_WIDTH));
+	enable_gpmc_config(gpmc_config,
+			   serial_cs_base,
+			   SERIAL_TL16CP754C_BASE,
+			   GPMC_SIZE_16M);
+
 	/* board id for Linux */
 	gd->bd->bi_arch_number = MACH_TYPE_OMAP_ZOOM2;
 	/* boot param addr */
 	gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
 
+#if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
+	status_led_set (STATUS_LED_BOOT, STATUS_LED_ON);
+#endif
+
 	return 0;
 }
 
board/omap3/zoom2/zoom2_serial.c new file +130 -0

130 lines not on this page · raw message

board/omap3/zoom2/zoom2_serial.h new file +75 -0

75 lines not on this page · raw message

common/serial.c +2 -0
index 09385d0..dd80e7c 100644
@@ -68,6 +68,8 @@ struct serial_device *__default_serial_console (void)
 #else
 #error "CONFIG_SERIAL? missing."
 #endif
+#elif defined(CONFIG_OMAP3_ZOOM2)
+		return ZOOM2_DEFAULT_SERIAL_DEVICE;
 #else
 #error No default console
 #endif
drivers/serial/ns16550.c +2 -2
index 657c9da..2fcc8c3 100644
@@ -17,7 +17,7 @@
 void NS16550_init (NS16550_t com_port, int baud_divisor)
 {
 	com_port->ier = 0x00;
-#ifdef CONFIG_OMAP
+#if defined(CONFIG_OMAP) && !defined(CONFIG_OMAP3_ZOOM2)
 	com_port->mdr1 = 0x7;	/* mode select reset TL16C750*/
 #endif
 	com_port->lcr = UART_LCR_BKSE | UART_LCRVAL;
@@ -30,7 +30,7 @@ void NS16550_init (NS16550_t com_port, int baud_divisor)
 	com_port->dll = baud_divisor & 0xff;
 	com_port->dlm = (baud_divisor >> 8) & 0xff;
 	com_port->lcr = UART_LCRVAL;
-#if defined(CONFIG_OMAP)
+#if defined(CONFIG_OMAP) && !defined(CONFIG_OMAP3_ZOOM2)
 #if defined(CONFIG_APTIX)
 	com_port->mdr1 = 3;	/* /13 mode so Aptix 6MHz can hit 115200 */
 #else
include/configs/omap3_zoom2.h +13 -13
index 68f06e6..db35d70 100644
@@ -75,26 +75,26 @@
 
 /*
  * NS16550 Configuration
+ * Zoom2 uses the TL16CP754C on the debug board
  */
-#define V_NS16550_CLK			48000000	/* 48MHz (APLL96/2) */
+#define CONFIG_SERIAL_MULTI		1
+/*
+ * 0 - 1 : first  USB with respect to the left edge of the debug board
+ * 2 - 3 : second USB with respect to the left edge of the debug board
+ */
+#define ZOOM2_DEFAULT_SERIAL_DEVICE	(&zoom2_serial_device0)
+
+#define V_NS16550_CLK			(1843200)	/* 1.8432 Mhz */
 
 #define CONFIG_SYS_NS16550
-#define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE	(-4)
+#define CONFIG_SYS_NS16550_REG_SIZE	(-2)
 #define CONFIG_SYS_NS16550_CLK		V_NS16550_CLK
-
-/*
- * select serial console configuration
- */
-#define CONFIG_CONS_INDEX		3
-#define CONFIG_SYS_NS16550_COM3		OMAP34XX_UART3
-#define CONFIG_SERIAL3			3	/* UART3 */
+#define CONFIG_BAUDRATE			115200
+#define CONFIG_SYS_BAUDRATE_TABLE	{115200}
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
-#define CONFIG_BAUDRATE			115200
-#define CONFIG_SYS_BAUDRATE_TABLE	{4800, 9600, 19200, 38400, 57600,\
-					115200}
+
 #define CONFIG_MMC			1
 #define CONFIG_OMAP3_MMC		1
 #define CONFIG_DOS_PARTITION		1
include/serial.h +7 -0
index e3d8b36..aca5221 100644
@@ -42,6 +42,13 @@ extern struct serial_device s3c24xx_serial1_device;
 extern struct serial_device s3c24xx_serial2_device;
 #endif
 
+#if defined(CONFIG_OMAP3_ZOOM2)
+extern struct serial_device zoom2_serial_device0;
+extern struct serial_device zoom2_serial_device1;
+extern struct serial_device zoom2_serial_device2;
+extern struct serial_device zoom2_serial_device3;
+#endif
+
 extern struct serial_device serial_ffuart_device;
 extern struct serial_device serial_btuart_device;
 extern struct serial_device serial_stuart_device;
Signature · 1 line
1.6.0.5
author
#1 lore raw

PATCH 2/2 ZOOM2 Add led support.

This patch controls the large LED on the top left of the zoom2.

---
 board/omap3/zoom2/Makefile    |    8 ++-
 board/omap3/zoom2/led.c       |  129 +++++++++++++++++++++++++++++++++++++++++
 board/omap3/zoom2/zoom2.c     |    4 +-
 include/configs/omap3_zoom2.h |   16 +++++
 4 files changed, 153 insertions(+), 4 deletions(-)
 create mode 100644 board/omap3/zoom2/led.c
board/omap3/zoom2/Makefile +5 -3
index d27990c..2feafbe 100644
@@ -25,10 +25,12 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(BOARD).a
 
-COBJS	:= zoom2.o \
-	debug_board.o \
-	zoom2_serial.o
+COBJS-y := $(BOARD).o
+COBJS-y += debug_board.o
+COBJS-y += zoom2_serial.o
+COBJS-$(CONFIG_STATUS_LED) += led.o
 
+COBJS	:= $(sort $(COBJS-y))
 SRCS	:= $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
 
board/omap3/zoom2/led.c new file +129 -0

129 lines not on this page · raw message

board/omap3/zoom2/zoom2.c +3 -1
index 83e02f6..e5c248d 100644
@@ -29,6 +29,9 @@
  * MA 02111-1307 USA
  */
 #include <common.h>
+#ifdef CONFIG_STATUS_LED
+#include <status_led.h>
+#endif
 #include <asm/io.h>
 #include <asm/arch/mem.h>
 #include <asm/arch/mux.h>
@@ -86,7 +89,6 @@ int board_init (void)
 #if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
 	status_led_set (STATUS_LED_BOOT, STATUS_LED_ON);
 #endif
-
 	return 0;
 }
 
include/configs/omap3_zoom2.h +16 -0
index db35d70..e257419 100644
@@ -99,6 +99,22 @@
 #define CONFIG_OMAP3_MMC		1
 #define CONFIG_DOS_PARTITION		1
 
+/* Status LED */
+#define CONFIG_STATUS_LED		1 /* Status LED enabled	*/
+#define CONFIG_BOARD_SPECIFIC_LED	1
+#define STATUS_LED_BLUE			0
+#define STATUS_LED_RED			1
+/* Blue */
+#define STATUS_LED_BIT			STATUS_LED_BLUE
+#define STATUS_LED_STATE		STATUS_LED_ON
+#define STATUS_LED_PERIOD		(CONFIG_SYS_HZ / 2)
+/* Red */
+#define STATUS_LED_BIT1			STATUS_LED_RED
+#define STATUS_LED_STATE1		STATUS_LED_OFF
+#define STATUS_LED_PERIOD1		(CONFIG_SYS_HZ / 2)
+/* Optional value */
+#define STATUS_LED_BOOT			STATUS_LED_BIT
+
 /* commands to include */
 #include <config_cmd_default.h>
 
Signature · 1 line
1.6.0.5
#3 lore raw

PATCH 1/2 ZOOM2 Add serial support.

In reply to Tom Rix
Quoted 11 lines · Tom Rix

Zoom2 serial is in general supplied by one of the 4 UARTS on the debug board. The default serial is from the USB connector on left side of the debug board. The USB connector will produce 2 of the 4 UARTS. On your host pick the first enumeration.

The details of the setting of the serial gpmc setup are not available. The values were provided by another party.

The serial port set up is the same with Zoom1.
Baud rate 115200, 8 bit data, no parity, 1 stop bit, no flow.

Quoted 7 lines

The kernel bootargs are
console=ttyS3,115200n8

ixx

???

Quoted 1 line

---

Applied to arm/next

Best Regards,
J.