* [U-Boot] [PATCH 1/6] dm: freescale: Drop mxs_auart serial driver
2016-01-31 16:16 [U-Boot] [PATCH 0/6] dm: serial: Remove serial drivers not yet converted to driver model Simon Glass
@ 2016-01-31 16:16 ` Simon Glass
2016-02-08 20:47 ` [U-Boot] [U-Boot, " Tom Rini
2016-01-31 16:16 ` [U-Boot] [PATCH 2/6] dm: opencores: Drop opencores_yanu " Simon Glass
` (4 subsequent siblings)
5 siblings, 1 reply; 17+ messages in thread
From: Simon Glass @ 2016-01-31 16:16 UTC (permalink / raw)
To: u-boot
This does not appear to be used, and has not been converted to driver model
by the deadline (doc/driver-model/serial-howto.txt).
Signed-off-by: Simon Glass <sjg@chromium.org>
---
drivers/serial/Makefile | 1 -
drivers/serial/mxs_auart.c | 151 ---------------------------------------------
include/configs/mxs.h | 2 -
3 files changed, 154 deletions(-)
delete mode 100644 drivers/serial/mxs_auart.c
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index dd87147..3ce3ab6 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -37,7 +37,6 @@ obj-$(CONFIG_SCIF_CONSOLE) += serial_sh.o
obj-$(CONFIG_ZYNQ_SERIAL) += serial_zynq.o
obj-$(CONFIG_BFIN_SERIAL) += serial_bfin.o
obj-$(CONFIG_FSL_LPUART) += serial_lpuart.o
-obj-$(CONFIG_MXS_AUART) += mxs_auart.o
obj-$(CONFIG_ARC_SERIAL) += serial_arc.o
obj-$(CONFIG_UNIPHIER_SERIAL) += serial_uniphier.o
obj-$(CONFIG_STM32_SERIAL) += serial_stm32.o
diff --git a/drivers/serial/mxs_auart.c b/drivers/serial/mxs_auart.c
deleted file mode 100644
index fc0fa96..0000000
--- a/drivers/serial/mxs_auart.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Freescale i.MX23/i.MX28 AUART driver
- *
- * Copyright (C) 2013 Andreas Wass <andreas.wass@dalelven.com>
- *
- * Based on the MXC serial driver:
- *
- * (c) 2007 Sascha Hauer <s.hauer@pengutronix.de>
- *
- * Further based on the Linux mxs-auart.c driver:
- *
- * Freescale STMP37XX/STMP38X Application UART drkiver
- * Copyright 2008-2010 Freescale Semiconductor, Inc.
- *
- * SPDX-License-Identifier: GPL-2.0+
- */
-#include <common.h>
-#include <asm/io.h>
-#include <serial.h>
-#include <linux/compiler.h>
-#include <asm/arch/regs-base.h>
-#include <asm/arch/regs-uartapp.h>
-#include <asm/arch/sys_proto.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-#ifndef CONFIG_MXS_AUART_BASE
-#error "CONFIG_MXS_AUART_BASE must be set to the base UART to use"
-#endif
-
-/* AUART clock always supplied by XTAL and always 24MHz */
-#define MXS_AUART_CLK 24000000
-
-static struct mxs_uartapp_regs *get_uartapp_registers(void)
-{
- return (struct mxs_uartapp_regs *)CONFIG_MXS_AUART_BASE;
-}
-
-/**
- * Sets the baud rate and settings.
- * The settings are: 8 data bits, no parit and 1 stop bit.
- */
-static void mxs_auart_setbrg(void)
-{
- u32 div;
- u32 linectrl = 0;
- struct mxs_uartapp_regs *regs = get_uartapp_registers();
-
- if (!gd->baudrate)
- gd->baudrate = CONFIG_BAUDRATE;
-
- /*
- * From i.MX28 datasheet:
- * div is calculated by calculating UARTCLK*32/baudrate, rounded to int
- * div must be between 0xEC and 0x003FFFC0 inclusive
- * Lowest 6 bits of div goes in BAUD_DIVFRAC part of LINECTRL register
- * Next 16 bits goes in BAUD_DIVINT part of LINECTRL register
- */
- div = (MXS_AUART_CLK * 32) / gd->baudrate;
- if (div < 0xEC || div > 0x003FFFC0)
- return;
-
- linectrl |= ((div & UARTAPP_LINECTRL_EXTRACT_BAUD_DIVFRAC_MASK) <<
- UARTAPP_LINECTRL_BAUD_DIVFRAC_OFFSET) &
- UARTAPP_LINECTRL_BAUD_DIVFRAC_MASK;
- linectrl |= ((div >> UARTAPP_LINECTRL_EXTRACT_BAUD_DIVINT_OFFSET) <<
- UARTAPP_LINECTRL_BAUD_DIVINT_OFFSET) &
- UARTAPP_LINECTRL_BAUD_DIVINT_MASK;
-
- /* Word length: 8 bits */
- linectrl |= UARTAPP_LINECTRL_WLEN_8BITS;
-
- /* Enable FIFOs. */
- linectrl |= UARTAPP_LINECTRL_FEN_MASK;
-
- /* Write above settings, no parity, 1 stop bit */
- writel(linectrl, ®s->hw_uartapp_linectrl);
-}
-
-static int mxs_auart_init(void)
-{
- struct mxs_uartapp_regs *regs = get_uartapp_registers();
- /* Reset everything */
- mxs_reset_block(®s->hw_uartapp_ctrl0_reg);
- /* Disable interrupts */
- writel(0, ®s->hw_uartapp_intr);
- /* Set baud rate and settings */
- serial_setbrg();
- /* Disable RTS and CTS, ignore LINECTRL2 register */
- writel(UARTAPP_CTRL2_RTSEN_MASK |
- UARTAPP_CTRL2_CTSEN_MASK |
- UARTAPP_CTRL2_USE_LCR2_MASK,
- ®s->hw_uartapp_ctrl2_clr);
- /* Enable receiver, transmitter and UART */
- writel(UARTAPP_CTRL2_RXE_MASK |
- UARTAPP_CTRL2_TXE_MASK |
- UARTAPP_CTRL2_UARTEN_MASK,
- ®s->hw_uartapp_ctrl2_set);
- return 0;
-}
-
-static void mxs_auart_putc(const char c)
-{
- struct mxs_uartapp_regs *regs = get_uartapp_registers();
- /* Wait in loop while the transmit FIFO is full */
- while (readl(®s->hw_uartapp_stat) & UARTAPP_STAT_TXFF_MASK)
- ;
-
- writel(c, ®s->hw_uartapp_data);
-
- if (c == '\n')
- mxs_auart_putc('\r');
-}
-
-static int mxs_auart_tstc(void)
-{
- struct mxs_uartapp_regs *regs = get_uartapp_registers();
- /* Checks if receive FIFO is empty */
- return !(readl(®s->hw_uartapp_stat) & UARTAPP_STAT_RXFE_MASK);
-}
-
-static int mxs_auart_getc(void)
-{
- struct mxs_uartapp_regs *regs = get_uartapp_registers();
- /* Wait until a character is available to read */
- while (!mxs_auart_tstc())
- ;
- /* Read the character from the data register */
- return readl(®s->hw_uartapp_data) & 0xFF;
-}
-
-static struct serial_device mxs_auart_drv = {
- .name = "mxs_auart_serial",
- .start = mxs_auart_init,
- .stop = NULL,
- .setbrg = mxs_auart_setbrg,
- .putc = mxs_auart_putc,
- .puts = default_serial_puts,
- .getc = mxs_auart_getc,
- .tstc = mxs_auart_tstc,
-};
-
-void mxs_auart_initialize(void)
-{
- serial_register(&mxs_auart_drv);
-}
-
-__weak struct serial_device *default_serial_console(void)
-{
- return &mxs_auart_drv;
-}
diff --git a/include/configs/mxs.h b/include/configs/mxs.h
index 63fdf9e..4c490ae 100644
--- a/include/configs/mxs.h
+++ b/include/configs/mxs.h
@@ -121,12 +121,10 @@
* DUART Serial Driver.
* Conflicts with AUART driver which can be set by board.
*/
-#ifndef CONFIG_MXS_AUART
#define CONFIG_PL011_SERIAL
#define CONFIG_PL011_CLOCK 24000000
#define CONFIG_PL01x_PORTS { (void *)MXS_UARTDBG_BASE }
#define CONFIG_CONS_INDEX 0
-#endif
/* Default baudrate can be overriden by board! */
#ifndef CONFIG_BAUDRATE
#define CONFIG_BAUDRATE 115200
--
2.7.0.rc3.207.g0ac5344
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [U-Boot] [PATCH 2/6] dm: opencores: Drop opencores_yanu serial driver
2016-01-31 16:16 [U-Boot] [PATCH 0/6] dm: serial: Remove serial drivers not yet converted to driver model Simon Glass
2016-01-31 16:16 ` [U-Boot] [PATCH 1/6] dm: freescale: Drop mxs_auart serial driver Simon Glass
@ 2016-01-31 16:16 ` Simon Glass
2016-02-04 17:40 ` Tom Rini
2016-02-08 20:47 ` [U-Boot] [U-Boot, " Tom Rini
2016-01-31 16:16 ` [U-Boot] [PATCH 3/6] dm: freescale: serial: Drop serial_imx " Simon Glass
` (3 subsequent siblings)
5 siblings, 2 replies; 17+ messages in thread
From: Simon Glass @ 2016-01-31 16:16 UTC (permalink / raw)
To: u-boot
This does not appear to be used, and has not been converted to driver model
by the deadline (doc/driver-model/serial-howto.txt).
Signed-off-by: Simon Glass <sjg@chromium.org>
---
drivers/serial/Makefile | 1 -
drivers/serial/opencores_yanu.c | 242 ----------------------------------------
2 files changed, 243 deletions(-)
delete mode 100644 drivers/serial/opencores_yanu.c
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 3ce3ab6..ba11dd6 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -22,7 +22,6 @@ obj-$(CONFIG_ATMEL_USART) += atmel_usart.o
obj-$(CONFIG_EFI_APP) += serial_efi.o
obj-$(CONFIG_LPC32XX_HSUART) += lpc32xx_hsuart.o
obj-$(CONFIG_MCFUART) += mcfuart.o
-obj-$(CONFIG_OPENCORES_YANU) += opencores_yanu.o
obj-$(CONFIG_SYS_NS16550) += ns16550.o
obj-$(CONFIG_S5P) += serial_s5p.o
obj-$(CONFIG_IMX_SERIAL) += serial_imx.o
diff --git a/drivers/serial/opencores_yanu.c b/drivers/serial/opencores_yanu.c
deleted file mode 100644
index f68c8d0..0000000
--- a/drivers/serial/opencores_yanu.c
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * Altera NiosII YANU serial interface by Imagos
- * please see http://www.opencores.org/project,yanu for
- * information/downloads
- *
- * Copyright 2010, Renato Andreola <renato.andreola@imagos.it>
- *
- * SPDX-License-Identifier: GPL-2.0+
- */
-
-#include <common.h>
-#include <watchdog.h>
-#include <asm/io.h>
-#include <serial.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-/*-----------------------------------------------------------------*/
-/* YANU Imagos serial port */
-/*-----------------------------------------------------------------*/
-
-#define YANU_MAX_PRESCALER_N ((1 << 4) - 1) /* 15 */
-#define YANU_MAX_PRESCALER_M ((1 << 11) -1) /* 2047 */
-#define YANU_FIFO_SIZE (16)
-#define YANU_RXFIFO_SIZE (YANU_FIFO_SIZE)
-#define YANU_TXFIFO_SIZE (YANU_FIFO_SIZE)
-
-#define YANU_RXFIFO_DLY (10*11)
-#define YANU_TXFIFO_THR (10)
-#define YANU_DATA_CHAR_MASK (0xFF)
-
-/* data register */
-#define YANU_DATA_OFFSET (0) /* data register offset */
-
-#define YANU_CONTROL_OFFSET (4) /* control register offset */
-/* interrupt enable */
-#define YANU_CONTROL_IE_RRDY (1<<0) /* ie on received character ready */
-#define YANU_CONTROL_IE_OE (1<<1) /* ie on rx overrun */
-#define YANU_CONTROL_IE_BRK (1<<2) /* ie on break detect */
-#define YANU_CONTROL_IE_FE (1<<3) /* ie on framing error */
-#define YANU_CONTROL_IE_PE (1<<4) /* ie on parity error */
-#define YANU_CONTROL_IE_TRDY (1<<5) /* ie interrupt on tranmitter ready */
-/* control bits */
-#define YANU_CONTROL_BITS_POS (6) /* bits number pos */
-#define YANU_CONTROL_BITS (1<<YANU_CONTROL_BITS_POS) /* number of rx/tx bits per word. 3 bit unsigned integer */
-#define YANU_CONTROL_BITS_N (3) /* ... its bit filed length */
-#define YANU_CONTROL_PARENA (1<<9) /* enable parity bit transmission/reception */
-#define YANU_CONTROL_PAREVEN (1<<10) /* parity even */
-#define YANU_CONTROL_STOPS (1<<11) /* number of stop bits */
-#define YANU_CONTROL_HHENA (1<<12) /* Harware Handshake enable... */
-#define YANU_CONTROL_FORCEBRK (1<<13) /* if set than txd = active (0) */
-/* tuning part */
-#define YANU_CONTROL_RDYDLY (1<<14) /* delay from "first" before setting rrdy (in bit) */
-#define YANU_CONTROL_RDYDLY_N (8) /* ... its bit filed length */
-#define YANU_CONTROL_TXTHR (1<<22) /* tx interrupt threshold: the trdy set if txfifo_chars<= txthr (chars) */
-#define YANU_CONTROL_TXTHR_N (4) /* ... its bit field length */
-
-#define YANU_BAUD_OFFSET (8) /* baud register offset */
-#define YANU_BAUDM (1<<0) /* baud mantissa lsb */
-#define YANU_BAUDM_N (12) /* ...its bit filed length */
-#define YANU_BAUDE (1<<12) /* baud exponent lsb */
-#define YANU_BAUDE_N (4) /* ...its bit field length */
-
-#define YANU_ACTION_OFFSET (12) /* action register... write only */
-#define YANU_ACTION_RRRDY (1<<0) /* reset rrdy */
-#define YANU_ACTION_ROE (1<<1) /* reset oe */
-#define YANU_ACTION_RBRK (1<<2) /* reset brk */
-#define YANU_ACTION_RFE (1<<3) /* reset fe */
-#define YANU_ACTION_RPE (1<<4) /* reset pe */
-#define YANU_ACTION_SRRDY (1<<5) /* set rrdy */
-#define YANU_ACTION_SOE (1<<6) /* set oe */
-#define YANU_ACTION_SBRK (1<<7) /* set brk */
-#define YANU_ACTION_SFE (1<<8) /* set fe */
-#define YANU_ACTION_SPE (1<<9) /* set pe */
-#define YANU_ACTION_RFIFO_PULL (1<<10) /* pull a char from rx fifo we MUST do it before taking a char */
-#define YANU_ACTION_RFIFO_CLEAR (1<<11) /* clear rx fifo */
-#define YANU_ACTION_TFIFO_CLEAR (1<<12) /* clear tx fifo */
-#define YANU_ACTION_RTRDY (1<<13) /* clear trdy */
-#define YANU_ACTION_STRDY (1<<14) /* set trdy */
-
-#define YANU_STATUS_OFFSET (16)
-#define YANU_STATUS_RRDY (1<<0) /* rxrdy flag */
-#define YANU_STATUS_TRDY (1<<1) /* txrdy flag */
-#define YANU_STATUS_OE (1<<2) /* rx overrun error */
-#define YANU_STATUS_BRK (1<<3) /* rx break detect flag */
-#define YANU_STATUS_FE (1<<4) /* rx framing error flag */
-#define YANU_STATUS_PE (1<<5) /* rx parity erro flag */
-#define YANU_RFIFO_CHARS_POS (6)
-#define YANU_RFIFO_CHARS (1<<RFIFO_CHAR_POS) /* number of chars into rx fifo */
-#define YANU_RFIFO_CHARS_N (5) /* ...its bit field length: 32 chars */
-#define YANU_TFIFO_CHARS_POS (11)
-#define YANU_TFIFO_CHARS (1<<TFIFO_CHAR_POS) /* number of chars into tx fifo */
-#define YANU_TFIFO_CHARS_N (5) /* ...its bit field length: 32 chars */
-
-typedef volatile struct {
- volatile unsigned data;
- volatile unsigned control; /* control register (RW) 32-bit */
- volatile unsigned baud; /* baud/prescaler register (RW) 32-bit */
- volatile unsigned action; /* action register (W) 32-bit */
- volatile unsigned status; /* status register (R) 32-bit */
- volatile unsigned magic; /* magic register (R) 32-bit */
-} yanu_uart_t;
-
-static yanu_uart_t *uart = (yanu_uart_t *)CONFIG_SYS_NIOS_CONSOLE;
-
-static void oc_serial_setbrg(void)
-{
- int n, k;
- const unsigned max_uns = 0xFFFFFFFF;
- unsigned best_n, best_m, baud;
- unsigned baudrate;
-
-#if defined(CONFIG_SYS_NIOS_FIXEDBAUD)
- /* Everything's already setup for fixed-baud PTF assignment */
- baudrate = CONFIG_BAUDRATE;
-#else
- baudrate = gd->baudrate;
-#endif
- /* compute best N and M couple */
- best_n = YANU_MAX_PRESCALER_N;
- for (n = YANU_MAX_PRESCALER_N; n >= 0; n--) {
- if ((unsigned)CONFIG_SYS_CLK_FREQ / (1 << (n + 4)) >=
- baudrate) {
- best_n = n;
- break;
- }
- }
- for (k = 0;; k++) {
- if (baudrate <= (max_uns >> (15+n-k)))
- break;
- }
- best_m =
- (baudrate * (1 << (15 + n - k))) /
- ((unsigned)CONFIG_SYS_CLK_FREQ >> k);
-
- baud = best_m + best_n * YANU_BAUDE;
- writel(baud, &uart->baud);
-
- return;
-}
-
-static int oc_serial_init(void)
-{
- unsigned action,control;
-
- /* status register cleanup */
- action = YANU_ACTION_RRRDY |
- YANU_ACTION_RTRDY |
- YANU_ACTION_ROE |
- YANU_ACTION_RBRK |
- YANU_ACTION_RFE |
- YANU_ACTION_RPE |
- YANU_ACTION_RFE | YANU_ACTION_RFIFO_CLEAR | YANU_ACTION_TFIFO_CLEAR;
-
- writel(action, &uart->action);
-
- /*
- * control register cleanup
- * no interrupts enabled
- * one stop bit
- * hardware flow control disabled
- * 8 bits
- */
- control = (0x7 << YANU_CONTROL_BITS_POS);
- /* enven parity just to be clean */
- control |= YANU_CONTROL_PAREVEN;
- /* we set threshold for fifo */
- control |= YANU_CONTROL_RDYDLY * YANU_RXFIFO_DLY;
- control |= YANU_CONTROL_TXTHR * YANU_TXFIFO_THR;
-
- writel(control, &uart->control);
-
- /* to set baud rate */
- serial_setbrg();
-
- return (0);
-}
-
-
-/*-----------------------------------------------------------------------
- * YANU CONSOLE
- *---------------------------------------------------------------------*/
-static void oc_serial_putc(char c)
-{
- int tx_chars;
- unsigned status;
-
- if (c == '\n')
- serial_putc ('\r');
-
- while (1) {
- status = readl(&uart->status);
- tx_chars = (status>>YANU_TFIFO_CHARS_POS)
- & ((1<<YANU_TFIFO_CHARS_N)-1);
- if (tx_chars < YANU_TXFIFO_SIZE-1)
- break;
- WATCHDOG_RESET ();
- }
-
- writel((unsigned char)c, &uart->data);
-}
-
-static int oc_serial_tstc(void)
-{
- unsigned status ;
-
- status = readl(&uart->status);
- return (((status >> YANU_RFIFO_CHARS_POS) &
- ((1 << YANU_RFIFO_CHARS_N) - 1)) > 0);
-}
-
-static int oc_serial_getc(void)
-{
- while (serial_tstc() == 0)
- WATCHDOG_RESET ();
-
- /* first we pull the char */
- writel(YANU_ACTION_RFIFO_PULL, &uart->action);
-
- return(readl(&uart->data) & YANU_DATA_CHAR_MASK);
-}
-
-static struct serial_device oc_serial_drv = {
- .name = "oc_serial",
- .start = oc_serial_init,
- .stop = NULL,
- .setbrg = oc_serial_setbrg,
- .putc = oc_serial_putc,
- .puts = default_serial_puts,
- .getc = oc_serial_getc,
- .tstc = oc_serial_tstc,
-};
-
-void oc_serial_initialize(void)
-{
- serial_register(&oc_serial_drv);
-}
-
-__weak struct serial_device *default_serial_console(void)
-{
- return &oc_serial_drv;
-}
--
2.7.0.rc3.207.g0ac5344
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [U-Boot] [PATCH 2/6] dm: opencores: Drop opencores_yanu serial driver
2016-01-31 16:16 ` [U-Boot] [PATCH 2/6] dm: opencores: Drop opencores_yanu " Simon Glass
@ 2016-02-04 17:40 ` Tom Rini
2016-02-08 20:47 ` [U-Boot] [U-Boot, " Tom Rini
1 sibling, 0 replies; 17+ messages in thread
From: Tom Rini @ 2016-02-04 17:40 UTC (permalink / raw)
To: u-boot
On Sun, Jan 31, 2016 at 09:16:13AM -0700, Simon Glass wrote:
> This does not appear to be used, and has not been converted to driver model
> by the deadline (doc/driver-model/serial-howto.txt).
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
Dead code:
Reviewed-by: Tom Rini <trini@konsulko.com>
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160204/02b6e16f/attachment.sig>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [U-Boot] [U-Boot, 2/6] dm: opencores: Drop opencores_yanu serial driver
2016-01-31 16:16 ` [U-Boot] [PATCH 2/6] dm: opencores: Drop opencores_yanu " Simon Glass
2016-02-04 17:40 ` Tom Rini
@ 2016-02-08 20:47 ` Tom Rini
1 sibling, 0 replies; 17+ messages in thread
From: Tom Rini @ 2016-02-08 20:47 UTC (permalink / raw)
To: u-boot
On Sun, Jan 31, 2016 at 09:16:13AM -0700, Simon Glass wrote:
> This does not appear to be used, and has not been converted to driver model
> by the deadline (doc/driver-model/serial-howto.txt).
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Tom Rini <trini@konsulko.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160208/ca53907b/attachment.sig>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [U-Boot] [PATCH 3/6] dm: freescale: serial: Drop serial_imx serial driver
2016-01-31 16:16 [U-Boot] [PATCH 0/6] dm: serial: Remove serial drivers not yet converted to driver model Simon Glass
2016-01-31 16:16 ` [U-Boot] [PATCH 1/6] dm: freescale: Drop mxs_auart serial driver Simon Glass
2016-01-31 16:16 ` [U-Boot] [PATCH 2/6] dm: opencores: Drop opencores_yanu " Simon Glass
@ 2016-01-31 16:16 ` Simon Glass
2016-02-04 17:40 ` Tom Rini
2016-02-08 20:47 ` [U-Boot] [U-Boot, " Tom Rini
2016-01-31 16:16 ` [U-Boot] [PATCH 4/6] dm: serial: Drop serial_max3100 " Simon Glass
` (2 subsequent siblings)
5 siblings, 2 replies; 17+ messages in thread
From: Simon Glass @ 2016-01-31 16:16 UTC (permalink / raw)
To: u-boot
This does not appear to be used, and has not been converted to driver model
by the deadline (doc/driver-model/serial-howto.txt).
Signed-off-by: Simon Glass <sjg@chromium.org>
---
drivers/serial/Makefile | 1 -
drivers/serial/serial_imx.c | 223 --------------------------------------------
2 files changed, 224 deletions(-)
delete mode 100644 drivers/serial/serial_imx.c
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index ba11dd6..6d79e46 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -24,7 +24,6 @@ obj-$(CONFIG_LPC32XX_HSUART) += lpc32xx_hsuart.o
obj-$(CONFIG_MCFUART) += mcfuart.o
obj-$(CONFIG_SYS_NS16550) += ns16550.o
obj-$(CONFIG_S5P) += serial_s5p.o
-obj-$(CONFIG_IMX_SERIAL) += serial_imx.o
obj-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o
obj-$(CONFIG_MXC_UART) += serial_mxc.o
obj-$(CONFIG_PXA_SERIAL) += serial_pxa.o
diff --git a/drivers/serial/serial_imx.c b/drivers/serial/serial_imx.c
deleted file mode 100644
index d43a5fe..0000000
--- a/drivers/serial/serial_imx.c
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * (c) 2004 Sascha Hauer <sascha@saschahauer.de>
- *
- * SPDX-License-Identifier: GPL-2.0+
- */
-
-#include <common.h>
-#include <asm/arch/imx-regs.h>
-#include <serial.h>
-#include <linux/compiler.h>
-
-#if defined CONFIG_IMX_SERIAL1
-#define UART_BASE IMX_UART1_BASE
-#elif defined CONFIG_IMX_SERIAL2
-#define UART_BASE IMX_UART2_BASE
-#else
-#error "define CONFIG_IMX_SERIAL1, CONFIG_IMX_SERIAL2 or CONFIG_IMX_SERIAL_NONE"
-#endif
-
-struct imx_serial {
- volatile uint32_t urxd[16];
- volatile uint32_t utxd[16];
- volatile uint32_t ucr1;
- volatile uint32_t ucr2;
- volatile uint32_t ucr3;
- volatile uint32_t ucr4;
- volatile uint32_t ufcr;
- volatile uint32_t usr1;
- volatile uint32_t usr2;
- volatile uint32_t uesc;
- volatile uint32_t utim;
- volatile uint32_t ubir;
- volatile uint32_t ubmr;
- volatile uint32_t ubrc;
- volatile uint32_t bipr[4];
- volatile uint32_t bmpr[4];
- volatile uint32_t uts;
-};
-
-DECLARE_GLOBAL_DATA_PTR;
-
-static void imx_serial_setbrg(void)
-{
- serial_init();
-}
-
-extern void imx_gpio_mode(int gpio_mode);
-
-/*
- * Initialise the serial port with the given baudrate. The settings
- * are always 8 data bits, no parity, 1 stop bit, no start bits.
- *
- */
-static int imx_serial_init(void)
-{
- volatile struct imx_serial* base = (struct imx_serial *)UART_BASE;
- unsigned int ufcr_rfdiv;
- unsigned int refclk;
-
-#ifdef CONFIG_IMX_SERIAL1
- imx_gpio_mode(PC11_PF_UART1_TXD);
- imx_gpio_mode(PC12_PF_UART1_RXD);
-#else
- imx_gpio_mode(PB30_PF_UART2_TXD);
- imx_gpio_mode(PB31_PF_UART2_RXD);
-#endif
-
- /* Disable UART */
- base->ucr1 &= ~UCR1_UARTEN;
-
- /* Set to default POR state */
-
- base->ucr1 = 0x00000004;
- base->ucr2 = 0x00000000;
- base->ucr3 = 0x00000000;
- base->ucr4 = 0x00008040;
- base->uesc = 0x0000002B;
- base->utim = 0x00000000;
- base->ubir = 0x00000000;
- base->ubmr = 0x00000000;
- base->uts = 0x00000000;
- /* Set clocks */
- base->ucr4 |= UCR4_REF16;
-
- /* Configure FIFOs */
- base->ufcr = 0xa81;
-
- /* set the baud rate.
- *
- * baud * 16 x
- * --------- = -
- * refclk y
- *
- * x - 1 = UBIR
- * y - 1 = UBMR
- *
- * each register is 16 bits wide. refclk max is 96 MHz
- *
- */
-
- ufcr_rfdiv = ((base->ufcr) & UFCR_RFDIV) >> 7;
- if (ufcr_rfdiv == 6)
- ufcr_rfdiv = 7;
- else
- ufcr_rfdiv = 6 - ufcr_rfdiv;
-
- refclk = get_PERCLK1();
- refclk /= ufcr_rfdiv;
-
- /* Set the numerator value minus one of the BRM ratio */
- base->ubir = (gd->baudrate / 100) - 1;
-
- /* Set the denominator value minus one of the BRM ratio */
- base->ubmr = (refclk/(16 * 100)) - 1;
-
- /* Set to 8N1 */
- base->ucr2 &= ~UCR2_PREN;
- base->ucr2 |= UCR2_WS;
- base->ucr2 &= ~UCR2_STPB;
-
- /* Ignore RTS */
- base->ucr2 |= UCR2_IRTS;
-
- /* Enable UART */
- base->ucr1 |= UCR1_UARTEN | UCR1_UARTCLKEN;
-
- /* Enable FIFOs */
- base->ucr2 |= UCR2_SRST | UCR2_RXEN | UCR2_TXEN;
-
- /* Clear status flags */
- base->usr2 |= USR2_ADET |
- USR2_DTRF |
- USR2_IDLE |
- USR2_IRINT |
- USR2_WAKE |
- USR2_RTSF |
- USR2_BRCD |
- USR2_ORE;
-
- /* Clear status flags */
- base->usr1 |= USR1_PARITYERR |
- USR1_RTSD |
- USR1_ESCF |
- USR1_FRAMERR |
- USR1_AIRINT |
- USR1_AWAKE;
- return (0);
-}
-
-/*
- * Read a single byte from the serial port. Returns 1 on success, 0
- * otherwise. When the function is successful, the character read is
- * written into its argument c.
- */
-static int imx_serial_getc(void)
-{
- volatile struct imx_serial* base = (struct imx_serial *)UART_BASE;
- unsigned char ch;
-
- while(base->uts & UTS_RXEMPTY);
-
- ch = (char)base->urxd[0];
-
- return ch;
-}
-
-#ifdef CONFIG_HWFLOW
-static int hwflow = 0; /* turned off by default */
-int hwflow_onoff(int on)
-{
-}
-#endif
-
-/*
- * Output a single byte to the serial port.
- */
-static void imx_serial_putc(const char c)
-{
- volatile struct imx_serial* base = (struct imx_serial *)UART_BASE;
-
- /* Wait for Tx FIFO not full */
- while (base->uts & UTS_TXFULL);
-
- base->utxd[0] = c;
-
- /* If \n, also do \r */
- if (c == '\n')
- serial_putc ('\r');
-}
-
-/*
- * Test whether a character is in the RX buffer
- */
-static int imx_serial_tstc(void)
-{
- volatile struct imx_serial* base = (struct imx_serial *)UART_BASE;
-
- /* If receive fifo is empty, return false */
- if (base->uts & UTS_RXEMPTY)
- return 0;
- return 1;
-}
-
-static struct serial_device imx_serial_drv = {
- .name = "imx_serial",
- .start = imx_serial_init,
- .stop = NULL,
- .setbrg = imx_serial_setbrg,
- .putc = imx_serial_putc,
- .puts = default_serial_puts,
- .getc = imx_serial_getc,
- .tstc = imx_serial_tstc,
-};
-
-void imx_serial_initialize(void)
-{
- serial_register(&imx_serial_drv);
-}
-
-__weak struct serial_device *default_serial_console(void)
-{
- return &imx_serial_drv;
-}
--
2.7.0.rc3.207.g0ac5344
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [U-Boot] [PATCH 3/6] dm: freescale: serial: Drop serial_imx serial driver
2016-01-31 16:16 ` [U-Boot] [PATCH 3/6] dm: freescale: serial: Drop serial_imx " Simon Glass
@ 2016-02-04 17:40 ` Tom Rini
2016-02-08 20:47 ` [U-Boot] [U-Boot, " Tom Rini
1 sibling, 0 replies; 17+ messages in thread
From: Tom Rini @ 2016-02-04 17:40 UTC (permalink / raw)
To: u-boot
On Sun, Jan 31, 2016 at 09:16:14AM -0700, Simon Glass wrote:
> This does not appear to be used, and has not been converted to driver model
> by the deadline (doc/driver-model/serial-howto.txt).
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
Dead code:
Reviewed-by: Tom Rini <trini@konsulko.com>
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160204/480dc9d3/attachment.sig>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [U-Boot] [U-Boot, 3/6] dm: freescale: serial: Drop serial_imx serial driver
2016-01-31 16:16 ` [U-Boot] [PATCH 3/6] dm: freescale: serial: Drop serial_imx " Simon Glass
2016-02-04 17:40 ` Tom Rini
@ 2016-02-08 20:47 ` Tom Rini
1 sibling, 0 replies; 17+ messages in thread
From: Tom Rini @ 2016-02-08 20:47 UTC (permalink / raw)
To: u-boot
On Sun, Jan 31, 2016 at 09:16:14AM -0700, Simon Glass wrote:
> This does not appear to be used, and has not been converted to driver model
> by the deadline (doc/driver-model/serial-howto.txt).
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Tom Rini <trini@konsulko.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160208/54905a95/attachment.sig>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [U-Boot] [PATCH 4/6] dm: serial: Drop serial_max3100 serial driver
2016-01-31 16:16 [U-Boot] [PATCH 0/6] dm: serial: Remove serial drivers not yet converted to driver model Simon Glass
` (2 preceding siblings ...)
2016-01-31 16:16 ` [U-Boot] [PATCH 3/6] dm: freescale: serial: Drop serial_imx " Simon Glass
@ 2016-01-31 16:16 ` Simon Glass
2016-02-04 17:41 ` Tom Rini
2016-02-08 20:47 ` [U-Boot] [U-Boot, " Tom Rini
2016-01-31 16:16 ` [U-Boot] [PATCH 5/6] dm: pxa: serial: Drop serial_sa1100 " Simon Glass
2016-01-31 16:16 ` [U-Boot] [PATCH 6/6] dm: Update on current serial driver status Simon Glass
5 siblings, 2 replies; 17+ messages in thread
From: Simon Glass @ 2016-01-31 16:16 UTC (permalink / raw)
To: u-boot
This does not appear to be used, and has not been converted to driver model
by the deadline (doc/driver-model/serial-howto.txt).
Signed-off-by: Simon Glass <sjg@chromium.org>
---
drivers/serial/Makefile | 1 -
drivers/serial/serial_max3100.c | 294 ----------------------------------------
2 files changed, 295 deletions(-)
delete mode 100644 drivers/serial/serial_max3100.c
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 6d79e46..a1711c6 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -24,7 +24,6 @@ obj-$(CONFIG_LPC32XX_HSUART) += lpc32xx_hsuart.o
obj-$(CONFIG_MCFUART) += mcfuart.o
obj-$(CONFIG_SYS_NS16550) += ns16550.o
obj-$(CONFIG_S5P) += serial_s5p.o
-obj-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o
obj-$(CONFIG_MXC_UART) += serial_mxc.o
obj-$(CONFIG_PXA_SERIAL) += serial_pxa.o
obj-$(CONFIG_SA1100_SERIAL) += serial_sa1100.o
diff --git a/drivers/serial/serial_max3100.c b/drivers/serial/serial_max3100.c
deleted file mode 100644
index 027d919..0000000
--- a/drivers/serial/serial_max3100.c
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- * (C) Copyright 2003
- *
- * Pantelis Antoniou <panto@intracom.gr>
- * Intracom S.A.
- *
- * SPDX-License-Identifier: GPL-2.0+
- */
-
-#include <common.h>
-#include <watchdog.h>
-#include <serial.h>
-#include <linux/compiler.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-/**************************************************************/
-
-/* convienient macros */
-#define MAX3100_SPI_RXD() (MAX3100_SPI_RXD_PORT & MAX3100_SPI_RXD_BIT)
-
-#define MAX3100_SPI_TXD(x) \
- do { \
- if (x) \
- MAX3100_SPI_TXD_PORT |= MAX3100_SPI_TXD_BIT; \
- else \
- MAX3100_SPI_TXD_PORT &= ~MAX3100_SPI_TXD_BIT; \
- } while(0)
-
-#define MAX3100_SPI_CLK(x) \
- do { \
- if (x) \
- MAX3100_SPI_CLK_PORT |= MAX3100_SPI_CLK_BIT; \
- else \
- MAX3100_SPI_CLK_PORT &= ~MAX3100_SPI_CLK_BIT; \
- } while(0)
-
-#define MAX3100_SPI_CLK_TOGGLE() (MAX3100_SPI_CLK_PORT ^= MAX3100_SPI_CLK_BIT)
-
-#define MAX3100_CS(x) \
- do { \
- if (x) \
- MAX3100_CS_PORT |= MAX3100_CS_BIT; \
- else \
- MAX3100_CS_PORT &= ~MAX3100_CS_BIT; \
- } while(0)
-
-/**************************************************************/
-
-/* MAX3100 definitions */
-
-#define MAX3100_WC (3 << 14) /* write configuration */
-#define MAX3100_RC (1 << 14) /* read configuration */
-#define MAX3100_WD (2 << 14) /* write data */
-#define MAX3100_RD (0 << 14) /* read data */
-
-/* configuration register bits */
-#define MAX3100_FEN (1 << 13) /* FIFO enable */
-#define MAX3100_SHDN (1 << 12) /* shutdown bit */
-#define MAX3100_TM (1 << 11) /* T bit irq mask */
-#define MAX3100_RM (1 << 10) /* R bit irq mask */
-#define MAX3100_PM (1 << 9) /* P bit irq mask */
-#define MAX3100_RAM (1 << 8) /* mask for RA/FE bit */
-#define MAX3100_IR (1 << 7) /* IRDA timing mode */
-#define MAX3100_ST (1 << 6) /* transmit stop bit */
-#define MAX3100_PE (1 << 5) /* parity enable bit */
-#define MAX3100_L (1 << 4) /* Length bit */
-#define MAX3100_B_MASK (0x000F) /* baud rate bits mask */
-#define MAX3100_B(x) ((x) & 0x000F) /* baud rate select bits */
-
-/* data register bits (write) */
-#define MAX3100_TE (1 << 10) /* transmit enable bit (active low) */
-#define MAX3100_RTS (1 << 9) /* request-to-send bit (inverted ~RTS pin) */
-
-/* data register bits (read) */
-#define MAX3100_RA (1 << 10) /* receiver activity when in shutdown mode */
-#define MAX3100_FE (1 << 10) /* framing error when in normal mode */
-#define MAX3100_CTS (1 << 9) /* clear-to-send bit (inverted ~CTS pin) */
-
-/* data register bits (both directions) */
-#define MAX3100_R (1 << 15) /* receive bit */
-#define MAX3100_T (1 << 14) /* transmit bit */
-#define MAX3100_P (1 << 8) /* parity bit */
-#define MAX3100_D_MASK 0x00FF /* data bits mask */
-#define MAX3100_D(x) ((x) & 0x00FF) /* data bits */
-
-/* these definitions are valid only for fOSC = 3.6864MHz */
-#define MAX3100_B_230400 MAX3100_B(0)
-#define MAX3100_B_115200 MAX3100_B(1)
-#define MAX3100_B_57600 MAX3100_B(2)
-#define MAX3100_B_38400 MAX3100_B(9)
-#define MAX3100_B_19200 MAX3100_B(10)
-#define MAX3100_B_9600 MAX3100_B(11)
-#define MAX3100_B_4800 MAX3100_B(12)
-#define MAX3100_B_2400 MAX3100_B(13)
-#define MAX3100_B_1200 MAX3100_B(14)
-#define MAX3100_B_600 MAX3100_B(15)
-
-/**************************************************************/
-
-static inline unsigned int max3100_transfer(unsigned int val)
-{
- unsigned int rx;
- int b;
-
- MAX3100_SPI_CLK(0);
- MAX3100_CS(0);
-
- rx = 0; b = 16;
- while (--b >= 0) {
- MAX3100_SPI_TXD(val & 0x8000);
- val <<= 1;
- MAX3100_SPI_CLK_TOGGLE();
- udelay(1);
- rx <<= 1;
- if (MAX3100_SPI_RXD())
- rx |= 1;
- MAX3100_SPI_CLK_TOGGLE();
- udelay(1);
- }
-
- MAX3100_SPI_CLK(1);
- MAX3100_CS(1);
-
- return rx;
-}
-
-/**************************************************************/
-
-/* must be power of 2 */
-#define RXFIFO_SZ 16
-
-static int rxfifo_cnt;
-static int rxfifo_in;
-static int rxfifo_out;
-static unsigned char rxfifo_buf[16];
-
-static void max3100_serial_putc_raw(int c)
-{
- unsigned int rx;
-
- while (((rx = max3100_transfer(MAX3100_RC)) & MAX3100_T) == 0)
- WATCHDOG_RESET();
-
- rx = max3100_transfer(MAX3100_WD | (c & 0xff));
- if ((rx & MAX3100_RD) != 0 && rxfifo_cnt < RXFIFO_SZ) {
- rxfifo_cnt++;
- rxfifo_buf[rxfifo_in++] = rx & 0xff;
- rxfifo_in &= RXFIFO_SZ - 1;
- }
-}
-
-static int max3100_serial_getc(void)
-{
- int c;
- unsigned int rx;
-
- while (rxfifo_cnt == 0) {
- rx = max3100_transfer(MAX3100_RD);
- if ((rx & MAX3100_R) != 0) {
- do {
- rxfifo_cnt++;
- rxfifo_buf[rxfifo_in++] = rx & 0xff;
- rxfifo_in &= RXFIFO_SZ - 1;
-
- if (rxfifo_cnt >= RXFIFO_SZ)
- break;
- } while (((rx = max3100_transfer(MAX3100_RD)) & MAX3100_R) != 0);
- }
- WATCHDOG_RESET();
- }
-
- rxfifo_cnt--;
- c = rxfifo_buf[rxfifo_out++];
- rxfifo_out &= RXFIFO_SZ - 1;
- return c;
-}
-
-static int max3100_serial_tstc(void)
-{
- unsigned int rx;
-
- if (rxfifo_cnt > 0)
- return 1;
-
- rx = max3100_transfer(MAX3100_RD);
- if ((rx & MAX3100_R) == 0)
- return 0;
-
- do {
- rxfifo_cnt++;
- rxfifo_buf[rxfifo_in++] = rx & 0xff;
- rxfifo_in &= RXFIFO_SZ - 1;
-
- if (rxfifo_cnt >= RXFIFO_SZ)
- break;
- } while (((rx = max3100_transfer(MAX3100_RD)) & MAX3100_R) != 0);
-
- return 1;
-}
-
-static int max3100_serial_init(void)
-{
- unsigned int wconf, rconf;
- int i;
-
- wconf = 0;
-
- /* Set baud rate */
- switch (gd->baudrate) {
- case 1200:
- wconf = MAX3100_B_1200;
- break;
- case 2400:
- wconf = MAX3100_B_2400;
- break;
- case 4800:
- wconf = MAX3100_B_4800;
- break;
- case 9600:
- wconf = MAX3100_B_9600;
- break;
- case 19200:
- wconf = MAX3100_B_19200;
- break;
- case 38400:
- wconf = MAX3100_B_38400;
- break;
- case 57600:
- wconf = MAX3100_B_57600;
- break;
- default:
- case 115200:
- wconf = MAX3100_B_115200;
- break;
- case 230400:
- wconf = MAX3100_B_230400;
- break;
- }
-
- /* try for 10ms, with a 100us gap */
- for (i = 0; i < 10000; i += 100) {
-
- max3100_transfer(MAX3100_WC | wconf);
- rconf = max3100_transfer(MAX3100_RC) & 0x3fff;
-
- if (rconf == wconf)
- break;
- udelay(100);
- }
-
- rxfifo_in = rxfifo_out = rxfifo_cnt = 0;
-
- return (0);
-}
-
-static void max3100_serial_putc(const char c)
-{
- if (c == '\n')
- max3100_serial_putc_raw('\r');
-
- max3100_serial_putc_raw(c);
-}
-
-static void max3100_serial_puts(const char *s)
-{
- while (*s)
- max3100_serial_putc_raw(*s++);
-}
-
-static void max3100_serial_setbrg(void)
-{
-}
-
-static struct serial_device max3100_serial_drv = {
- .name = "max3100_serial",
- .start = max3100_serial_init,
- .stop = NULL,
- .setbrg = max3100_serial_setbrg,
- .putc = max3100_serial_putc,
- .puts = max3100_serial_puts,
- .getc = max3100_serial_getc,
- .tstc = max3100_serial_tstc,
-};
-
-void max3100_serial_initialize(void)
-{
- serial_register(&max3100_serial_drv);
-}
-
-__weak struct serial_device *default_serial_console(void)
-{
- return &max3100_serial_drv;
-}
--
2.7.0.rc3.207.g0ac5344
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [U-Boot] [PATCH 4/6] dm: serial: Drop serial_max3100 serial driver
2016-01-31 16:16 ` [U-Boot] [PATCH 4/6] dm: serial: Drop serial_max3100 " Simon Glass
@ 2016-02-04 17:41 ` Tom Rini
2016-02-08 20:47 ` [U-Boot] [U-Boot, " Tom Rini
1 sibling, 0 replies; 17+ messages in thread
From: Tom Rini @ 2016-02-04 17:41 UTC (permalink / raw)
To: u-boot
On Sun, Jan 31, 2016 at 09:16:15AM -0700, Simon Glass wrote:
> This does not appear to be used, and has not been converted to driver model
> by the deadline (doc/driver-model/serial-howto.txt).
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
Dead code:
Reviewed-by: Tom Rini <trini@konsulko.com>
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160204/c59cc01c/attachment.sig>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [U-Boot] [U-Boot, 4/6] dm: serial: Drop serial_max3100 serial driver
2016-01-31 16:16 ` [U-Boot] [PATCH 4/6] dm: serial: Drop serial_max3100 " Simon Glass
2016-02-04 17:41 ` Tom Rini
@ 2016-02-08 20:47 ` Tom Rini
1 sibling, 0 replies; 17+ messages in thread
From: Tom Rini @ 2016-02-08 20:47 UTC (permalink / raw)
To: u-boot
On Sun, Jan 31, 2016 at 09:16:15AM -0700, Simon Glass wrote:
> This does not appear to be used, and has not been converted to driver model
> by the deadline (doc/driver-model/serial-howto.txt).
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Tom Rini <trini@konsulko.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160208/52276188/attachment.sig>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [U-Boot] [PATCH 5/6] dm: pxa: serial: Drop serial_sa1100 serial driver
2016-01-31 16:16 [U-Boot] [PATCH 0/6] dm: serial: Remove serial drivers not yet converted to driver model Simon Glass
` (3 preceding siblings ...)
2016-01-31 16:16 ` [U-Boot] [PATCH 4/6] dm: serial: Drop serial_max3100 " Simon Glass
@ 2016-01-31 16:16 ` Simon Glass
2016-02-04 17:41 ` Tom Rini
2016-02-08 20:47 ` [U-Boot] [U-Boot, " Tom Rini
2016-01-31 16:16 ` [U-Boot] [PATCH 6/6] dm: Update on current serial driver status Simon Glass
5 siblings, 2 replies; 17+ messages in thread
From: Simon Glass @ 2016-01-31 16:16 UTC (permalink / raw)
To: u-boot
This does not appear to be used, and has not been converted to driver model
by the deadline (doc/driver-model/serial-howto.txt).
Signed-off-by: Simon Glass <sjg@chromium.org>
---
drivers/serial/Makefile | 1 -
drivers/serial/serial_sa1100.c | 162 -----------------------------------------
2 files changed, 163 deletions(-)
delete mode 100644 drivers/serial/serial_sa1100.c
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index a1711c6..435fce3 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -26,7 +26,6 @@ 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_SA1100_SERIAL) += serial_sa1100.o
obj-$(CONFIG_S3C24X0_SERIAL) += serial_s3c24x0.o
obj-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
obj-$(CONFIG_SANDBOX_SERIAL) += sandbox.o
diff --git a/drivers/serial/serial_sa1100.c b/drivers/serial/serial_sa1100.c
deleted file mode 100644
index 78f241d..0000000
--- a/drivers/serial/serial_sa1100.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * (C) Copyright 2002
- * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
- *
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Marius Groeger <mgroeger@sysgo.de>
- *
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Alex Zuepke <azu@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 <SA-1100.h>
-#include <serial.h>
-#include <linux/compiler.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-static void sa1100_serial_setbrg(void)
-{
- unsigned int reg = 0;
-
- if (gd->baudrate == 1200)
- reg = 191;
- else if (gd->baudrate == 9600)
- reg = 23;
- else if (gd->baudrate == 19200)
- reg = 11;
- else if (gd->baudrate == 38400)
- reg = 5;
- else if (gd->baudrate == 57600)
- reg = 3;
- else if (gd->baudrate == 115200)
- reg = 1;
- else
- hang ();
-
-#ifdef CONFIG_SERIAL1
- /* SA1110 uart function */
- Ser1SDCR0 |= SDCR0_SUS;
-
- /* Wait until port is ready ... */
- while(Ser1UTSR1 & UTSR1_TBY) {}
-
- /* init serial serial 1 */
- Ser1UTCR3 = 0x00;
- Ser1UTSR0 = 0xff;
- Ser1UTCR0 = ( UTCR0_1StpBit | UTCR0_8BitData );
- Ser1UTCR1 = 0;
- Ser1UTCR2 = (u32)reg;
- Ser1UTCR3 = ( UTCR3_RXE | UTCR3_TXE );
-#elif defined(CONFIG_SERIAL3)
- /* Wait until port is ready ... */
- while (Ser3UTSR1 & UTSR1_TBY) {
- }
-
- /* init serial serial 3 */
- Ser3UTCR3 = 0x00;
- Ser3UTSR0 = 0xff;
- Ser3UTCR0 = (UTCR0_1StpBit | UTCR0_8BitData);
- Ser3UTCR1 = 0;
- Ser3UTCR2 = (u32) reg;
- Ser3UTCR3 = (UTCR3_RXE | UTCR3_TXE);
-#else
-#error "Bad: you didn't configured serial ..."
-#endif
-}
-
-
-/*
- * Initialise the serial port with the given baudrate. The settings
- * are always 8 data bits, no parity, 1 stop bit, no start bits.
- *
- */
-static int sa1100_serial_init(void)
-{
- serial_setbrg ();
-
- return (0);
-}
-
-
-/*
- * Output a single byte to the serial port.
- */
-static void sa1100_serial_putc(const char c)
-{
-#ifdef CONFIG_SERIAL1
- /* wait for room in the tx FIFO on SERIAL1 */
- while ((Ser1UTSR0 & UTSR0_TFS) == 0);
-
- Ser1UTDR = c;
-#elif defined(CONFIG_SERIAL3)
- /* wait for room in the tx FIFO on SERIAL3 */
- while ((Ser3UTSR0 & UTSR0_TFS) == 0);
-
- Ser3UTDR = c;
-#endif
-
- /* If \n, also do \r */
- if (c == '\n')
- serial_putc ('\r');
-}
-
-/*
- * 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.
- */
-static int sa1100_serial_tstc(void)
-{
-#ifdef CONFIG_SERIAL1
- return Ser1UTSR1 & UTSR1_RNE;
-#elif defined(CONFIG_SERIAL3)
- return Ser3UTSR1 & UTSR1_RNE;
-#endif
-}
-
-/*
- * 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.
- */
-static int sa1100_serial_getc(void)
-{
-#ifdef CONFIG_SERIAL1
- while (!(Ser1UTSR1 & UTSR1_RNE));
-
- return (char) Ser1UTDR & 0xff;
-#elif defined(CONFIG_SERIAL3)
- while (!(Ser3UTSR1 & UTSR1_RNE));
-
- return (char) Ser3UTDR & 0xff;
-#endif
-}
-
-static struct serial_device sa1100_serial_drv = {
- .name = "sa1100_serial",
- .start = sa1100_serial_init,
- .stop = NULL,
- .setbrg = sa1100_serial_setbrg,
- .putc = sa1100_serial_putc,
- .puts = default_serial_puts,
- .getc = sa1100_serial_getc,
- .tstc = sa1100_serial_tstc,
-};
-
-void sa1100_serial_initialize(void)
-{
- serial_register(&sa1100_serial_drv);
-}
-
-__weak struct serial_device *default_serial_console(void)
-{
- return &sa1100_serial_drv;
-}
--
2.7.0.rc3.207.g0ac5344
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [U-Boot] [PATCH 5/6] dm: pxa: serial: Drop serial_sa1100 serial driver
2016-01-31 16:16 ` [U-Boot] [PATCH 5/6] dm: pxa: serial: Drop serial_sa1100 " Simon Glass
@ 2016-02-04 17:41 ` Tom Rini
2016-02-08 20:47 ` [U-Boot] [U-Boot, " Tom Rini
1 sibling, 0 replies; 17+ messages in thread
From: Tom Rini @ 2016-02-04 17:41 UTC (permalink / raw)
To: u-boot
On Sun, Jan 31, 2016 at 09:16:16AM -0700, Simon Glass wrote:
> This does not appear to be used, and has not been converted to driver model
> by the deadline (doc/driver-model/serial-howto.txt).
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
Dead code:
Reviewed-by: Tom Rini <trini@konsulko.com>
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160204/fbe17d74/attachment.sig>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [U-Boot] [U-Boot, 5/6] dm: pxa: serial: Drop serial_sa1100 serial driver
2016-01-31 16:16 ` [U-Boot] [PATCH 5/6] dm: pxa: serial: Drop serial_sa1100 " Simon Glass
2016-02-04 17:41 ` Tom Rini
@ 2016-02-08 20:47 ` Tom Rini
1 sibling, 0 replies; 17+ messages in thread
From: Tom Rini @ 2016-02-08 20:47 UTC (permalink / raw)
To: u-boot
On Sun, Jan 31, 2016 at 09:16:16AM -0700, Simon Glass wrote:
> This does not appear to be used, and has not been converted to driver model
> by the deadline (doc/driver-model/serial-howto.txt).
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Tom Rini <trini@konsulko.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160208/b3db92b1/attachment.sig>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [U-Boot] [PATCH 6/6] dm: Update on current serial driver status
2016-01-31 16:16 [U-Boot] [PATCH 0/6] dm: serial: Remove serial drivers not yet converted to driver model Simon Glass
` (4 preceding siblings ...)
2016-01-31 16:16 ` [U-Boot] [PATCH 5/6] dm: pxa: serial: Drop serial_sa1100 " Simon Glass
@ 2016-01-31 16:16 ` Simon Glass
2016-02-08 20:47 ` [U-Boot] [U-Boot, " Tom Rini
5 siblings, 1 reply; 17+ messages in thread
From: Simon Glass @ 2016-01-31 16:16 UTC (permalink / raw)
To: u-boot
Update the README to reflect the current status.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
doc/driver-model/serial-howto.txt | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/doc/driver-model/serial-howto.txt b/doc/driver-model/serial-howto.txt
index e5e482e..61f2da3 100644
--- a/doc/driver-model/serial-howto.txt
+++ b/doc/driver-model/serial-howto.txt
@@ -1,23 +1,17 @@
How to port a serial driver to driver model
===========================================
-About 16 of 33 serial drivers have been converted as at September 2015. It
-is time for maintainers to start converting over the remaining serial drivers:
+Almost all of the serial drivers have been converted as at January 2016. These
+ones remain:
arm_dcc.c
- lpc32xx_hsuart.c
mcfuart.c
- mxs_auart.c
- opencores_yanu.c
serial_bfin.c
- serial_imx.c
- serial_max3100.c
serial_pxa.c
serial_s3c24x0.c
- serial_sa1100.c
- usbtty.c
-You should complete this by the end of January 2016.
+The deadline for this work was the end of January 2016. If no one steps
+forward to convert these, at some point there may come a patch to remove them!
Here is a suggested approach for converting your serial driver over to driver
model. Please feel free to update this file with your ideas and suggestions.
--
2.7.0.rc3.207.g0ac5344
^ permalink raw reply related [flat|nested] 17+ messages in thread