Commit ffece480 authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
  sunsu: Use sunserial_console_termios() in sunsu_console_setup().
  sunsu: Pass true 'ignore_line' to console match when RSC or LOM console.
  serial: suncore: Fix RSC/LOM handling in sunserial_console_termios().
  serial: suncore: Add 'ignore_line' argument to sunserial_console_match().
  sunsu: Fix detection of SU ports which are RSC console or control.
  sunsab: Do not set sunsab_reg.cons right before registering minors.
  sparc64: Fix definition of VMEMMAP_SIZE.
parents cd79bf7b be24656a
...@@ -45,7 +45,7 @@ extern void free_initmem(void); ...@@ -45,7 +45,7 @@ extern void free_initmem(void);
#define VMEMMAP_ALIGN(x) (((x)+VMEMMAP_CHUNK-1UL)&VMEMMAP_CHUNK_MASK) #define VMEMMAP_ALIGN(x) (((x)+VMEMMAP_CHUNK-1UL)&VMEMMAP_CHUNK_MASK)
#define VMEMMAP_SIZE ((((1UL << MAX_PHYSADDR_BITS) >> PAGE_SHIFT) * \ #define VMEMMAP_SIZE ((((1UL << MAX_PHYSADDR_BITS) >> PAGE_SHIFT) * \
sizeof(struct page *)) >> VMEMMAP_CHUNK_SHIFT) sizeof(struct page)) >> VMEMMAP_CHUNK_SHIFT)
extern unsigned long vmemmap_table[VMEMMAP_SIZE]; extern unsigned long vmemmap_table[VMEMMAP_SIZE];
#endif #endif
......
...@@ -53,20 +53,21 @@ void sunserial_unregister_minors(struct uart_driver *drv, int count) ...@@ -53,20 +53,21 @@ void sunserial_unregister_minors(struct uart_driver *drv, int count)
EXPORT_SYMBOL(sunserial_unregister_minors); EXPORT_SYMBOL(sunserial_unregister_minors);
int sunserial_console_match(struct console *con, struct device_node *dp, int sunserial_console_match(struct console *con, struct device_node *dp,
struct uart_driver *drv, int line) struct uart_driver *drv, int line, bool ignore_line)
{ {
int off;
if (!con || of_console_device != dp) if (!con || of_console_device != dp)
return 0; return 0;
off = 0; if (!ignore_line) {
if (of_console_options && int off = 0;
*of_console_options == 'b')
off = 1;
if ((line & 1) != off) if (of_console_options &&
return 0; *of_console_options == 'b')
off = 1;
if ((line & 1) != off)
return 0;
}
con->index = line; con->index = line;
drv->cons = con; drv->cons = con;
...@@ -76,23 +77,24 @@ int sunserial_console_match(struct console *con, struct device_node *dp, ...@@ -76,23 +77,24 @@ int sunserial_console_match(struct console *con, struct device_node *dp,
} }
EXPORT_SYMBOL(sunserial_console_match); EXPORT_SYMBOL(sunserial_console_match);
void void sunserial_console_termios(struct console *con, struct device_node *uart_dp)
sunserial_console_termios(struct console *con)
{ {
struct device_node *dp; const char *mode, *s;
const char *od, *mode, *s;
char mode_prop[] = "ttyX-mode"; char mode_prop[] = "ttyX-mode";
int baud, bits, stop, cflag; int baud, bits, stop, cflag;
char parity; char parity;
dp = of_find_node_by_path("/options"); if (!strcmp(uart_dp->name, "rsc") ||
od = of_get_property(dp, "output-device", NULL); !strcmp(uart_dp->name, "rsc-console") ||
if (!strcmp(od, "rsc")) { !strcmp(uart_dp->name, "rsc-control")) {
mode = of_get_property(of_console_device, mode = of_get_property(uart_dp,
"ssp-console-modes", NULL); "ssp-console-modes", NULL);
if (!mode) if (!mode)
mode = "115200,8,n,1,-"; mode = "115200,8,n,1,-";
} else if (!strcmp(uart_dp->name, "lom-console")) {
mode = "9600,8,n,1,-";
} else { } else {
struct device_node *dp;
char c; char c;
c = 'a'; c = 'a';
...@@ -101,6 +103,7 @@ sunserial_console_termios(struct console *con) ...@@ -101,6 +103,7 @@ sunserial_console_termios(struct console *con)
mode_prop[3] = c; mode_prop[3] = c;
dp = of_find_node_by_path("/options");
mode = of_get_property(dp, mode_prop, NULL); mode = of_get_property(dp, mode_prop, NULL);
if (!mode) if (!mode)
mode = "9600,8,n,1,-"; mode = "9600,8,n,1,-";
......
...@@ -26,7 +26,8 @@ extern int sunserial_register_minors(struct uart_driver *, int); ...@@ -26,7 +26,8 @@ extern int sunserial_register_minors(struct uart_driver *, int);
extern void sunserial_unregister_minors(struct uart_driver *, int); extern void sunserial_unregister_minors(struct uart_driver *, int);
extern int sunserial_console_match(struct console *, struct device_node *, extern int sunserial_console_match(struct console *, struct device_node *,
struct uart_driver *, int); struct uart_driver *, int, bool);
extern void sunserial_console_termios(struct console *); extern void sunserial_console_termios(struct console *,
struct device_node *);
#endif /* !(_SERIAL_SUN_H) */ #endif /* !(_SERIAL_SUN_H) */
...@@ -566,7 +566,7 @@ static int __devinit hv_probe(struct of_device *op, const struct of_device_id *m ...@@ -566,7 +566,7 @@ static int __devinit hv_probe(struct of_device *op, const struct of_device_id *m
goto out_free_con_read_page; goto out_free_con_read_page;
sunserial_console_match(&sunhv_console, op->node, sunserial_console_match(&sunhv_console, op->node,
&sunhv_reg, port->line); &sunhv_reg, port->line, false);
err = uart_add_one_port(&sunhv_reg, port); err = uart_add_one_port(&sunhv_reg, port);
if (err) if (err)
......
...@@ -883,7 +883,7 @@ static int sunsab_console_setup(struct console *con, char *options) ...@@ -883,7 +883,7 @@ static int sunsab_console_setup(struct console *con, char *options)
printk("Console: ttyS%d (SAB82532)\n", printk("Console: ttyS%d (SAB82532)\n",
(sunsab_reg.minor - 64) + con->index); (sunsab_reg.minor - 64) + con->index);
sunserial_console_termios(con); sunserial_console_termios(con, to_of_device(up->port.dev)->node);
switch (con->cflag & CBAUD) { switch (con->cflag & CBAUD) {
case B150: baud = 150; break; case B150: baud = 150; break;
...@@ -1027,10 +1027,12 @@ static int __devinit sab_probe(struct of_device *op, const struct of_device_id * ...@@ -1027,10 +1027,12 @@ static int __devinit sab_probe(struct of_device *op, const struct of_device_id *
goto out1; goto out1;
sunserial_console_match(SUNSAB_CONSOLE(), op->node, sunserial_console_match(SUNSAB_CONSOLE(), op->node,
&sunsab_reg, up[0].port.line); &sunsab_reg, up[0].port.line,
false);
sunserial_console_match(SUNSAB_CONSOLE(), op->node, sunserial_console_match(SUNSAB_CONSOLE(), op->node,
&sunsab_reg, up[1].port.line); &sunsab_reg, up[1].port.line,
false);
err = uart_add_one_port(&sunsab_reg, &up[0].port); err = uart_add_one_port(&sunsab_reg, &up[0].port);
if (err) if (err)
...@@ -1116,7 +1118,6 @@ static int __init sunsab_init(void) ...@@ -1116,7 +1118,6 @@ static int __init sunsab_init(void)
if (!sunsab_ports) if (!sunsab_ports)
return -ENOMEM; return -ENOMEM;
sunsab_reg.cons = SUNSAB_CONSOLE();
err = sunserial_register_minors(&sunsab_reg, num_channels); err = sunserial_register_minors(&sunsab_reg, num_channels);
if (err) { if (err) {
kfree(sunsab_ports); kfree(sunsab_ports);
......
...@@ -1329,11 +1329,9 @@ static void sunsu_console_write(struct console *co, const char *s, ...@@ -1329,11 +1329,9 @@ static void sunsu_console_write(struct console *co, const char *s,
*/ */
static int __init sunsu_console_setup(struct console *co, char *options) static int __init sunsu_console_setup(struct console *co, char *options)
{ {
static struct ktermios dummy;
struct ktermios termios;
struct uart_port *port; struct uart_port *port;
int baud = 9600;
int bits = 8;
int parity = 'n';
int flow = 'n';
printk("Console: ttyS%d (SU)\n", printk("Console: ttyS%d (SU)\n",
(sunsu_reg.minor - 64) + co->index); (sunsu_reg.minor - 64) + co->index);
...@@ -1352,10 +1350,15 @@ static int __init sunsu_console_setup(struct console *co, char *options) ...@@ -1352,10 +1350,15 @@ static int __init sunsu_console_setup(struct console *co, char *options)
*/ */
spin_lock_init(&port->lock); spin_lock_init(&port->lock);
if (options) /* Get firmware console settings. */
uart_parse_options(options, &baud, &parity, &bits, &flow); sunserial_console_termios(co, to_of_device(port->dev)->node);
return uart_set_options(port, co, baud, parity, bits, flow); memset(&termios, 0, sizeof(struct ktermios));
termios.c_cflag = co->cflag;
port->mctrl |= TIOCM_DTR;
port->ops->set_termios(port, &termios, &dummy);
return 0;
} }
static struct console sunsu_console = { static struct console sunsu_console = {
...@@ -1409,6 +1412,7 @@ static int __devinit su_probe(struct of_device *op, const struct of_device_id *m ...@@ -1409,6 +1412,7 @@ static int __devinit su_probe(struct of_device *op, const struct of_device_id *m
struct uart_sunsu_port *up; struct uart_sunsu_port *up;
struct resource *rp; struct resource *rp;
enum su_type type; enum su_type type;
bool ignore_line;
int err; int err;
type = su_get_type(dp); type = su_get_type(dp);
...@@ -1467,8 +1471,14 @@ static int __devinit su_probe(struct of_device *op, const struct of_device_id *m ...@@ -1467,8 +1471,14 @@ static int __devinit su_probe(struct of_device *op, const struct of_device_id *m
up->port.ops = &sunsu_pops; up->port.ops = &sunsu_pops;
ignore_line = false;
if (!strcmp(dp->name, "rsc-console") ||
!strcmp(dp->name, "lom-console"))
ignore_line = true;
sunserial_console_match(SUNSU_CONSOLE(), dp, sunserial_console_match(SUNSU_CONSOLE(), dp,
&sunsu_reg, up->port.line); &sunsu_reg, up->port.line,
ignore_line);
err = uart_add_one_port(&sunsu_reg, &up->port); err = uart_add_one_port(&sunsu_reg, &up->port);
if (err) if (err)
goto out_unmap; goto out_unmap;
...@@ -1517,6 +1527,10 @@ static const struct of_device_id su_match[] = { ...@@ -1517,6 +1527,10 @@ static const struct of_device_id su_match[] = {
.name = "serial", .name = "serial",
.compatible = "su", .compatible = "su",
}, },
{
.type = "serial",
.compatible = "su",
},
{}, {},
}; };
MODULE_DEVICE_TABLE(of, su_match); MODULE_DEVICE_TABLE(of, su_match);
...@@ -1548,6 +1562,12 @@ static int __init sunsu_init(void) ...@@ -1548,6 +1562,12 @@ static int __init sunsu_init(void)
num_uart++; num_uart++;
} }
} }
for_each_node_by_type(dp, "serial") {
if (of_device_is_compatible(dp, "su")) {
if (su_get_type(dp) == SU_PORT_PORT)
num_uart++;
}
}
if (num_uart) { if (num_uart) {
err = sunserial_register_minors(&sunsu_reg, num_uart); err = sunserial_register_minors(&sunsu_reg, num_uart);
......
...@@ -1180,7 +1180,7 @@ static int __init sunzilog_console_setup(struct console *con, char *options) ...@@ -1180,7 +1180,7 @@ static int __init sunzilog_console_setup(struct console *con, char *options)
(sunzilog_reg.minor - 64) + con->index, con->index); (sunzilog_reg.minor - 64) + con->index, con->index);
/* Get firmware console settings. */ /* Get firmware console settings. */
sunserial_console_termios(con); sunserial_console_termios(con, to_of_device(up->port.dev)->node);
/* Firmware console speed is limited to 150-->38400 baud so /* Firmware console speed is limited to 150-->38400 baud so
* this hackish cflag thing is OK. * this hackish cflag thing is OK.
...@@ -1416,7 +1416,8 @@ static int __devinit zs_probe(struct of_device *op, const struct of_device_id *m ...@@ -1416,7 +1416,8 @@ static int __devinit zs_probe(struct of_device *op, const struct of_device_id *m
if (!keyboard_mouse) { if (!keyboard_mouse) {
if (sunserial_console_match(SUNZILOG_CONSOLE(), op->node, if (sunserial_console_match(SUNZILOG_CONSOLE(), op->node,
&sunzilog_reg, up[0].port.line)) &sunzilog_reg, up[0].port.line,
false))
up->flags |= SUNZILOG_FLAG_IS_CONS; up->flags |= SUNZILOG_FLAG_IS_CONS;
err = uart_add_one_port(&sunzilog_reg, &up[0].port); err = uart_add_one_port(&sunzilog_reg, &up[0].port);
if (err) { if (err) {
...@@ -1425,7 +1426,8 @@ static int __devinit zs_probe(struct of_device *op, const struct of_device_id *m ...@@ -1425,7 +1426,8 @@ static int __devinit zs_probe(struct of_device *op, const struct of_device_id *m
return err; return err;
} }
if (sunserial_console_match(SUNZILOG_CONSOLE(), op->node, if (sunserial_console_match(SUNZILOG_CONSOLE(), op->node,
&sunzilog_reg, up[1].port.line)) &sunzilog_reg, up[1].port.line,
false))
up->flags |= SUNZILOG_FLAG_IS_CONS; up->flags |= SUNZILOG_FLAG_IS_CONS;
err = uart_add_one_port(&sunzilog_reg, &up[1].port); err = uart_add_one_port(&sunzilog_reg, &up[1].port);
if (err) { if (err) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment