Skip to content

Commit ab7cfb5

Browse files
committed
serial: sh-sci: Kill off bitrotted H8/300 support.
h8300 has never been updated upstream to support the conversion to the driver model (which happened mid-2.5), and it doesn't seem likely that it ever will. Kill off the remaining bitrotted support to reduce the maintenance burden going forward. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
1 parent 0792644 commit ab7cfb5

3 files changed

Lines changed: 14 additions & 121 deletions

File tree

‎drivers/tty/serial/Kconfig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ config SERIAL_IP22_ZILOG_CONSOLE
974974

975975
config SERIAL_SH_SCI
976976
tristate "SuperH SCI(F) serial port support"
977-
depends on HAVE_CLK && (SUPERH || H8300 || ARCH_SHMOBILE)
977+
depends on HAVE_CLK && (SUPERH || ARCH_SHMOBILE)
978978
select SERIAL_CORE
979979

980980
config SERIAL_SH_SCI_NR_UARTS

‎drivers/tty/serial/sh-sci.c‎

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@
5454
#include <asm/sh_bios.h>
5555
#endif
5656

57-
#ifdef CONFIG_H8300
58-
#include <asm/gpio.h>
59-
#endif
60-
6157
#include "sh-sci.h"
6258

6359
struct sci_port {
@@ -164,23 +160,7 @@ static void sci_poll_put_char(struct uart_port *port, unsigned char c)
164160
}
165161
#endif /* CONFIG_CONSOLE_POLL || CONFIG_SERIAL_SH_SCI_CONSOLE */
166162

167-
#if defined(__H8300H__) || defined(__H8300S__)
168-
static void sci_init_pins(struct uart_port *port, unsigned int cflag)
169-
{
170-
int ch = (port->mapbase - SMR0) >> 3;
171-
172-
/* set DDR regs */
173-
H8300_GPIO_DDR(h8300_sci_pins[ch].port,
174-
h8300_sci_pins[ch].rx,
175-
H8300_GPIO_INPUT);
176-
H8300_GPIO_DDR(h8300_sci_pins[ch].port,
177-
h8300_sci_pins[ch].tx,
178-
H8300_GPIO_OUTPUT);
179-
180-
/* tx mark output*/
181-
H8300_SCI_DR(ch) |= h8300_sci_pins[ch].tx;
182-
}
183-
#elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
163+
#if defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
184164
static inline void sci_init_pins(struct uart_port *port, unsigned int cflag)
185165
{
186166
if (port->mapbase == 0xA4400000) {
@@ -1863,14 +1843,8 @@ static int __devinit serial_console_setup(struct console *co, char *options)
18631843
if (options)
18641844
uart_parse_options(options, &baud, &parity, &bits, &flow);
18651845

1866-
ret = uart_set_options(port, co, baud, parity, bits, flow);
1867-
#if defined(__H8300H__) || defined(__H8300S__)
1868-
/* disable rx interrupt */
1869-
if (ret == 0)
1870-
sci_stop_rx(port);
1871-
#endif
18721846
/* TODO: disable clock */
1873-
return ret;
1847+
return uart_set_options(port, co, baud, parity, bits, flow);
18741848
}
18751849

18761850
static struct console serial_console = {

‎drivers/tty/serial/sh-sci.h‎

Lines changed: 11 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
#include <linux/io.h>
33
#include <linux/gpio.h>
44

5-
#if defined(CONFIG_H83007) || defined(CONFIG_H83068)
6-
#include <asm/regs306x.h>
7-
#endif
8-
#if defined(CONFIG_H8S2678)
9-
#include <asm/regs267x.h>
10-
#endif
11-
125
#if defined(CONFIG_CPU_SUBTYPE_SH7706) || \
136
defined(CONFIG_CPU_SUBTYPE_SH7707) || \
147
defined(CONFIG_CPU_SUBTYPE_SH7708) || \
@@ -72,10 +65,6 @@
7265
#elif defined(CONFIG_CPU_SUBTYPE_SH4_202)
7366
# define SCSPTR2 0xffe80020 /* 16 bit SCIF */
7467
# define SCIF_ORER 0x0001 /* overrun error bit */
75-
#elif defined(CONFIG_H83007) || defined(CONFIG_H83068)
76-
# define H8300_SCI_DR(ch) *(volatile char *)(P1DR + h8300_sci_pins[ch].port)
77-
#elif defined(CONFIG_H8S2678)
78-
# define H8300_SCI_DR(ch) *(volatile char *)(P1DR + h8300_sci_pins[ch].port)
7968
#elif defined(CONFIG_CPU_SUBTYPE_SH7757)
8069
# define SCSPTR0 0xfe4b0020
8170
# define SCIF_ORER 0x0001
@@ -223,17 +212,6 @@
223212
} \
224213
}
225214

226-
#ifdef CONFIG_H8300
227-
/* h8300 don't have SCIF */
228-
#define CPU_SCIF_FNS(name) \
229-
static inline unsigned int sci_##name##_in(struct uart_port *port) \
230-
{ \
231-
return 0; \
232-
} \
233-
static inline void sci_##name##_out(struct uart_port *port, unsigned int value) \
234-
{ \
235-
}
236-
#else
237215
#define CPU_SCIF_FNS(name, scif_offset, scif_size) \
238216
static inline unsigned int sci_##name##_in(struct uart_port *port) \
239217
{ \
@@ -243,7 +221,6 @@
243221
{ \
244222
SCI_OUT(scif_size, scif_offset, value); \
245223
}
246-
#endif
247224

248225
#define CPU_SCI_FNS(name, sci_offset, sci_size) \
249226
static inline unsigned int sci_##name##_in(struct uart_port* port) \
@@ -262,8 +239,7 @@
262239
defined(CONFIG_ARCH_SH7372)
263240
#if defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
264241
#define SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh4_sci_offset, sh4_sci_size, \
265-
sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size, \
266-
h8_sci_offset, h8_sci_size) \
242+
sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
267243
CPU_SCIx_FNS(name, sh4_sci_offset, sh4_sci_size, sh4_scif_offset, sh4_scif_size)
268244
#define SCIF_FNS(name, sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
269245
CPU_SCIF_FNS(name, sh4_scif_offset, sh4_scif_size)
@@ -282,19 +258,11 @@
282258
CPU_SCIF_FNS(name, scif_offset, scif_size)
283259
#else
284260
#define SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh4_sci_offset, sh4_sci_size, \
285-
sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size, \
286-
h8_sci_offset, h8_sci_size) \
261+
sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
287262
CPU_SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh3_scif_offset, sh3_scif_size)
288263
#define SCIF_FNS(name, sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
289264
CPU_SCIF_FNS(name, sh3_scif_offset, sh3_scif_size)
290265
#endif
291-
#elif defined(__H8300H__) || defined(__H8300S__)
292-
#define SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh4_sci_offset, sh4_sci_size, \
293-
sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size, \
294-
h8_sci_offset, h8_sci_size) \
295-
CPU_SCI_FNS(name, h8_sci_offset, h8_sci_size)
296-
#define SCIF_FNS(name, sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
297-
CPU_SCIF_FNS(name)
298266
#elif defined(CONFIG_CPU_SUBTYPE_SH7723) ||\
299267
defined(CONFIG_CPU_SUBTYPE_SH7724)
300268
#define SCIx_FNS(name, sh4_scifa_offset, sh4_scifa_size, sh4_scif_offset, sh4_scif_size) \
@@ -303,8 +271,7 @@
303271
CPU_SCIF_FNS(name, sh4_scif_offset, sh4_scif_size)
304272
#else
305273
#define SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh4_sci_offset, sh4_sci_size, \
306-
sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size, \
307-
h8_sci_offset, h8_sci_size) \
274+
sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
308275
CPU_SCIx_FNS(name, sh4_sci_offset, sh4_sci_size, sh4_scif_offset, sh4_scif_size)
309276
#define SCIF_FNS(name, sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
310277
CPU_SCIF_FNS(name, sh4_scif_offset, sh4_scif_size)
@@ -353,14 +320,14 @@ SCIF_FNS(SCFCR, 0x18, 16)
353320
SCIF_FNS(SCFDR, 0x1c, 16)
354321
SCIF_FNS(SCLSR, 0x24, 16)
355322
#else
356-
/* reg SCI/SH3 SCI/SH4 SCIF/SH3 SCIF/SH4 SCI/H8*/
357-
/* name off sz off sz off sz off sz off sz*/
358-
SCIx_FNS(SCSMR, 0x00, 8, 0x00, 8, 0x00, 8, 0x00, 16, 0x00, 8)
359-
SCIx_FNS(SCBRR, 0x02, 8, 0x04, 8, 0x02, 8, 0x04, 8, 0x01, 8)
360-
SCIx_FNS(SCSCR, 0x04, 8, 0x08, 8, 0x04, 8, 0x08, 16, 0x02, 8)
361-
SCIx_FNS(SCxTDR, 0x06, 8, 0x0c, 8, 0x06, 8, 0x0C, 8, 0x03, 8)
362-
SCIx_FNS(SCxSR, 0x08, 8, 0x10, 8, 0x08, 16, 0x10, 16, 0x04, 8)
363-
SCIx_FNS(SCxRDR, 0x0a, 8, 0x14, 8, 0x0A, 8, 0x14, 8, 0x05, 8)
323+
/* reg SCI/SH3 SCI/SH4 SCIF/SH3 SCIF/SH4 */
324+
/* name off sz off sz off sz off sz */
325+
SCIx_FNS(SCSMR, 0x00, 8, 0x00, 8, 0x00, 8, 0x00, 16)
326+
SCIx_FNS(SCBRR, 0x02, 8, 0x04, 8, 0x02, 8, 0x04, 8)
327+
SCIx_FNS(SCSCR, 0x04, 8, 0x08, 8, 0x04, 8, 0x08, 16)
328+
SCIx_FNS(SCxTDR, 0x06, 8, 0x0c, 8, 0x06, 8, 0x0C, 8)
329+
SCIx_FNS(SCxSR, 0x08, 8, 0x10, 8, 0x08, 16, 0x10, 16)
330+
SCIx_FNS(SCxRDR, 0x0a, 8, 0x14, 8, 0x0A, 8, 0x14, 8)
364331
SCIF_FNS(SCFCR, 0x0c, 8, 0x18, 16)
365332
#if defined(CONFIG_CPU_SUBTYPE_SH7760) || \
366333
defined(CONFIG_CPU_SUBTYPE_SH7780) || \
@@ -390,48 +357,6 @@ SCIF_FNS(SCLSR, 0, 0, 0x24, 16)
390357
#define sci_in(port, reg) sci_##reg##_in(port)
391358
#define sci_out(port, reg, value) sci_##reg##_out(port, value)
392359

393-
/* H8/300 series SCI pins assignment */
394-
#if defined(__H8300H__) || defined(__H8300S__)
395-
static const struct __attribute__((packed)) {
396-
int port; /* GPIO port no */
397-
unsigned short rx,tx; /* GPIO bit no */
398-
} h8300_sci_pins[] = {
399-
#if defined(CONFIG_H83007) || defined(CONFIG_H83068)
400-
{ /* SCI0 */
401-
.port = H8300_GPIO_P9,
402-
.rx = H8300_GPIO_B2,
403-
.tx = H8300_GPIO_B0,
404-
},
405-
{ /* SCI1 */
406-
.port = H8300_GPIO_P9,
407-
.rx = H8300_GPIO_B3,
408-
.tx = H8300_GPIO_B1,
409-
},
410-
{ /* SCI2 */
411-
.port = H8300_GPIO_PB,
412-
.rx = H8300_GPIO_B7,
413-
.tx = H8300_GPIO_B6,
414-
}
415-
#elif defined(CONFIG_H8S2678)
416-
{ /* SCI0 */
417-
.port = H8300_GPIO_P3,
418-
.rx = H8300_GPIO_B2,
419-
.tx = H8300_GPIO_B0,
420-
},
421-
{ /* SCI1 */
422-
.port = H8300_GPIO_P3,
423-
.rx = H8300_GPIO_B3,
424-
.tx = H8300_GPIO_B1,
425-
},
426-
{ /* SCI2 */
427-
.port = H8300_GPIO_P5,
428-
.rx = H8300_GPIO_B1,
429-
.tx = H8300_GPIO_B0,
430-
}
431-
#endif
432-
};
433-
#endif
434-
435360
#if defined(CONFIG_CPU_SUBTYPE_SH7706) || \
436361
defined(CONFIG_CPU_SUBTYPE_SH7707) || \
437362
defined(CONFIG_CPU_SUBTYPE_SH7708) || \
@@ -454,12 +379,6 @@ static inline int sci_rxd_in(struct uart_port *port)
454379
return __raw_readb(SCSPTR1)&0x01 ? 1 : 0; /* SCI */
455380
return 1;
456381
}
457-
#elif defined(__H8300H__) || defined(__H8300S__)
458-
static inline int sci_rxd_in(struct uart_port *port)
459-
{
460-
int ch = (port->mapbase - SMR0) >> 3;
461-
return (H8300_SCI_DR(ch) & h8300_sci_pins[ch].rx) ? 1 : 0;
462-
}
463382
#else /* default case for non-SCI processors */
464383
static inline int sci_rxd_in(struct uart_port *port)
465384
{

0 commit comments

Comments
 (0)