[U-Boot] [PATCH 4/8] arm: Drop pxa serial driver

Simon Glass sjg at chromium.org
Thu Oct 20 21:06:56 CEST 2016


There are no boards using this driver and it has not been converted to
driver model. Drop it.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 doc/driver-model/serial-howto.txt |   1 -
 drivers/serial/Makefile           |   1 -
 drivers/serial/serial_pxa.c       | 299 --------------------------------------
 scripts/config_whitelist.txt      |   1 -
 4 files changed, 302 deletions(-)
 delete mode 100644 drivers/serial/serial_pxa.c

diff --git a/doc/driver-model/serial-howto.txt b/doc/driver-model/serial-howto.txt
index cddfb9f..ed846e5 100644
--- a/doc/driver-model/serial-howto.txt
+++ b/doc/driver-model/serial-howto.txt
@@ -6,7 +6,6 @@ ones remain:
 
    mcfuart.c
    serial_bfin.c
-   serial_pxa.c
    serial_s3c24x0.c
 
 The deadline for this work was the end of January 2016. If no one steps
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 21b1292..0c75718 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -26,7 +26,6 @@ obj-$(CONFIG_MCFUART) += mcfuart.o
 obj-$(CONFIG_SYS_NS16550) += ns16550.o
 obj-$(CONFIG_S5P) += serial_s5p.o
 obj-$(CONFIG_MXC_UART) += serial_mxc.o
-obj-$(CONFIG_PXA_SERIAL) += serial_pxa.o
 obj-$(CONFIG_MESON_SERIAL) += serial_meson.o
 ifdef CONFIG_SPL_BUILD
 obj-$(CONFIG_ROCKCHIP_SERIAL) += serial_rockchip.o
diff --git a/drivers/serial/serial_pxa.c b/drivers/serial/serial_pxa.c
deleted file mode 100644
index 1eb19ec..0000000
--- a/drivers/serial/serial_pxa.c
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- * Copyright (C) 2011 Marek Vasut <marek.vasut at gmail.com>
- *
- * (C) Copyright 2002
- * Wolfgang Denk, DENX Software Engineering, <wd at denx.de>
- *
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Marius Groeger <mgroeger at sysgo.de>
- *
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Alex Zuepke <azu at sysgo.de>
- *
- * Copyright (C) 1999 2000 2001 Erik Mouw (J.A.K.Mouw at its.tudelft.nl)
- *
- * SPDX-License-Identifier:	GPL-2.0+
- */
-
-#include <common.h>
-#include <asm/arch/pxa-regs.h>
-#include <asm/arch/regs-uart.h>
-#include <asm/io.h>
-#include <linux/compiler.h>
-#include <serial.h>
-#include <watchdog.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-/*
- * The numbering scheme differs here for PXA25x, PXA27x and PXA3xx so we can
- * easily handle enabling of clock.
- */
-#ifdef	CONFIG_CPU_MONAHANS
-#define	UART_CLK_BASE	CKENA_21_BTUART
-#define	UART_CLK_REG	CKENA
-#define	BTUART_INDEX	0
-#define	FFUART_INDEX	1
-#define	STUART_INDEX	2
-#elif	CONFIG_CPU_PXA25X
-#define	UART_CLK_BASE	(1 << 4)	/* HWUART */
-#define	UART_CLK_REG	CKEN
-#define	HWUART_INDEX	0
-#define	STUART_INDEX	1
-#define	FFUART_INDEX	2
-#define	BTUART_INDEX	3
-#else	/* PXA27x */
-#define	UART_CLK_BASE	CKEN5_STUART
-#define	UART_CLK_REG	CKEN
-#define	STUART_INDEX	0
-#define	FFUART_INDEX	1
-#define	BTUART_INDEX	2
-#endif
-
-/*
- * Only PXA250 has HWUART, to avoid poluting the code with more macros,
- * artificially introduce this.
- */
-#ifndef	CONFIG_CPU_PXA25X
-#define	HWUART_INDEX	0xff
-#endif
-
-static uint32_t pxa_uart_get_baud_divider(void)
-{
-	if (gd->baudrate == 1200)
-		return 768;
-	else if (gd->baudrate == 9600)
-		return 96;
-	else if (gd->baudrate == 19200)
-		return 48;
-	else if (gd->baudrate == 38400)
-		return 24;
-	else if (gd->baudrate == 57600)
-		return 16;
-	else if (gd->baudrate == 115200)
-		return 8;
-	else	/* Unsupported baudrate */
-		return 0;
-}
-
-static struct pxa_uart_regs *pxa_uart_index_to_regs(uint32_t uart_index)
-{
-	switch (uart_index) {
-	case FFUART_INDEX: return (struct pxa_uart_regs *)FFUART_BASE;
-	case BTUART_INDEX: return (struct pxa_uart_regs *)BTUART_BASE;
-	case STUART_INDEX: return (struct pxa_uart_regs *)STUART_BASE;
-	case HWUART_INDEX: return (struct pxa_uart_regs *)HWUART_BASE;
-	default:
-		return NULL;
-	}
-}
-
-static void pxa_uart_toggle_clock(uint32_t uart_index, int enable)
-{
-	uint32_t clk_reg, clk_offset, reg;
-
-	clk_reg = UART_CLK_REG;
-	clk_offset = UART_CLK_BASE << uart_index;
-
-	reg = readl(clk_reg);
-
-	if (enable)
-		reg |= clk_offset;
-	else
-		reg &= ~clk_offset;
-
-	writel(reg, clk_reg);
-}
-
-/*
- * Enable clock and set baud rate, parity etc.
- */
-void pxa_setbrg_dev(uint32_t uart_index)
-{
-	uint32_t divider = 0;
-	struct pxa_uart_regs *uart_regs;
-
-	divider = pxa_uart_get_baud_divider();
-	if (!divider)
-		hang();
-
-	uart_regs = pxa_uart_index_to_regs(uart_index);
-	if (!uart_regs)
-		hang();
-
-	pxa_uart_toggle_clock(uart_index, 1);
-
-	/* Disable interrupts and FIFOs */
-	writel(0, &uart_regs->ier);
-	writel(0, &uart_regs->fcr);
-
-	/* Set baud rate */
-	writel(LCR_WLS0 | LCR_WLS1 | LCR_DLAB, &uart_regs->lcr);
-	writel(divider & 0xff, &uart_regs->dll);
-	writel(divider >> 8, &uart_regs->dlh);
-	writel(LCR_WLS0 | LCR_WLS1, &uart_regs->lcr);
-
-	/* Enable UART */
-	writel(IER_UUE, &uart_regs->ier);
-}
-
-/*
- * Initialise the serial port with the given baudrate. The settings
- * are always 8 data bits, no parity, 1 stop bit, no start bits.
- */
-int pxa_init_dev(unsigned int uart_index)
-{
-	pxa_setbrg_dev (uart_index);
-	return 0;
-}
-
-/*
- * Output a single byte to the serial port.
- */
-void pxa_putc_dev(unsigned int uart_index, const char c)
-{
-	struct pxa_uart_regs *uart_regs;
-
-	/* If \n, also do \r */
-	if (c == '\n')
-		pxa_putc_dev(uart_index, '\r');
-
-	uart_regs = pxa_uart_index_to_regs(uart_index);
-	if (!uart_regs)
-		hang();
-
-	while (!(readl(&uart_regs->lsr) & LSR_TEMT))
-		WATCHDOG_RESET();
-	writel(c, &uart_regs->thr);
-}
-
-/*
- * Read a single byte from the serial port. Returns 1 on success, 0
- * otherwise. When the function is succesfull, the character read is
- * written into its argument c.
- */
-int pxa_tstc_dev(unsigned int uart_index)
-{
-	struct pxa_uart_regs *uart_regs;
-
-	uart_regs = pxa_uart_index_to_regs(uart_index);
-	if (!uart_regs)
-		return -1;
-
-	return readl(&uart_regs->lsr) & LSR_DR;
-}
-
-/*
- * Read a single byte from the serial port. Returns 1 on success, 0
- * otherwise. When the function is succesfull, the character read is
- * written into its argument c.
- */
-int pxa_getc_dev(unsigned int uart_index)
-{
-	struct pxa_uart_regs *uart_regs;
-
-	uart_regs = pxa_uart_index_to_regs(uart_index);
-	if (!uart_regs)
-		return -1;
-
-	while (!(readl(&uart_regs->lsr) & LSR_DR))
-		WATCHDOG_RESET();
-	return readl(&uart_regs->rbr) & 0xff;
-}
-
-void pxa_puts_dev(unsigned int uart_index, const char *s)
-{
-	while (*s)
-		pxa_putc_dev(uart_index, *s++);
-}
-
-#define	pxa_uart(uart, UART)						\
-	int uart##_init(void)						\
-	{								\
-		return pxa_init_dev(UART##_INDEX);			\
-	}								\
-									\
-	void uart##_setbrg(void)					\
-	{								\
-		return pxa_setbrg_dev(UART##_INDEX);			\
-	}								\
-									\
-	void uart##_putc(const char c)					\
-	{								\
-		return pxa_putc_dev(UART##_INDEX, c);			\
-	}								\
-									\
-	void uart##_puts(const char *s)					\
-	{								\
-		return pxa_puts_dev(UART##_INDEX, s);			\
-	}								\
-									\
-	int uart##_getc(void)						\
-	{								\
-		return pxa_getc_dev(UART##_INDEX);			\
-	}								\
-									\
-	int uart##_tstc(void)						\
-	{								\
-		return pxa_tstc_dev(UART##_INDEX);			\
-	}								\
-
-#define	pxa_uart_desc(uart)						\
-	struct serial_device serial_##uart##_device =			\
-	{								\
-		.name	= "serial_"#uart,				\
-		.start	= uart##_init,					\
-		.stop	= NULL,						\
-		.setbrg	= uart##_setbrg,				\
-		.getc	= uart##_getc,					\
-		.tstc	= uart##_tstc,					\
-		.putc	= uart##_putc,					\
-		.puts	= uart##_puts,					\
-	};
-
-#define	pxa_uart_multi(uart, UART)					\
-	pxa_uart(uart, UART)						\
-	pxa_uart_desc(uart)
-
-#if defined(CONFIG_HWUART)
-	pxa_uart_multi(hwuart, HWUART)
-#endif
-#if defined(CONFIG_STUART)
-	pxa_uart_multi(stuart, STUART)
-#endif
-#if defined(CONFIG_FFUART)
-	pxa_uart_multi(ffuart, FFUART)
-#endif
-#if defined(CONFIG_BTUART)
-	pxa_uart_multi(btuart, BTUART)
-#endif
-
-__weak struct serial_device *default_serial_console(void)
-{
-#if CONFIG_CONS_INDEX == 1
-	return &serial_hwuart_device;
-#elif CONFIG_CONS_INDEX == 2
-	return &serial_stuart_device;
-#elif CONFIG_CONS_INDEX == 3
-	return &serial_ffuart_device;
-#elif CONFIG_CONS_INDEX == 4
-	return &serial_btuart_device;
-#else
-#error "Bad CONFIG_CONS_INDEX."
-#endif
-}
-
-void pxa_serial_initialize(void)
-{
-#if defined(CONFIG_FFUART)
-	serial_register(&serial_ffuart_device);
-#endif
-#if defined(CONFIG_BTUART)
-	serial_register(&serial_btuart_device);
-#endif
-#if defined(CONFIG_STUART)
-	serial_register(&serial_stuart_device);
-#endif
-}
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 2c10c0b..4d42fc5 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -3751,7 +3751,6 @@ CONFIG_PWM_IMX
 CONFIG_PXA_LCD
 CONFIG_PXA_MMC_GENERIC
 CONFIG_PXA_PWR_I2C
-CONFIG_PXA_SERIAL
 CONFIG_PXA_STD_I2C
 CONFIG_PXA_VGA
 CONFIG_PXA_VIDEO
-- 
2.8.0.rc3.226.g39d4020



More information about the U-Boot mailing list