diff options
-rw-r--r-- | arch/x86/include/asm/mrst.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/early_printk.c | 2 | ||||
-rw-r--r-- | arch/x86/platform/mrst/early_printk_mrst.c | 16 | ||||
-rw-r--r-- | drivers/tty/serial/mfd.c | 18 |
4 files changed, 21 insertions, 17 deletions
diff --git a/arch/x86/include/asm/mrst.h b/arch/x86/include/asm/mrst.h index 719f00b28ff5..470776039af9 100644 --- a/arch/x86/include/asm/mrst.h +++ b/arch/x86/include/asm/mrst.h | |||
@@ -51,7 +51,7 @@ extern struct console early_mrst_console; | |||
51 | extern void mrst_early_console_init(void); | 51 | extern void mrst_early_console_init(void); |
52 | 52 | ||
53 | extern struct console early_hsu_console; | 53 | extern struct console early_hsu_console; |
54 | extern void hsu_early_console_init(void); | 54 | extern void hsu_early_console_init(const char *); |
55 | 55 | ||
56 | extern void intel_scu_devices_create(void); | 56 | extern void intel_scu_devices_create(void); |
57 | extern void intel_scu_devices_destroy(void); | 57 | extern void intel_scu_devices_destroy(void); |
diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c index cd28a350f7f9..9d42a52d2331 100644 --- a/arch/x86/kernel/early_printk.c +++ b/arch/x86/kernel/early_printk.c | |||
@@ -247,7 +247,7 @@ static int __init setup_early_printk(char *buf) | |||
247 | } | 247 | } |
248 | 248 | ||
249 | if (!strncmp(buf, "hsu", 3)) { | 249 | if (!strncmp(buf, "hsu", 3)) { |
250 | hsu_early_console_init(); | 250 | hsu_early_console_init(buf + 3); |
251 | early_console_register(&early_hsu_console, keep); | 251 | early_console_register(&early_hsu_console, keep); |
252 | } | 252 | } |
253 | #endif | 253 | #endif |
diff --git a/arch/x86/platform/mrst/early_printk_mrst.c b/arch/x86/platform/mrst/early_printk_mrst.c index 25bfdbb5b130..3c6e328483c7 100644 --- a/arch/x86/platform/mrst/early_printk_mrst.c +++ b/arch/x86/platform/mrst/early_printk_mrst.c | |||
@@ -245,16 +245,24 @@ struct console early_mrst_console = { | |||
245 | * Following is the early console based on Medfield HSU (High | 245 | * Following is the early console based on Medfield HSU (High |
246 | * Speed UART) device. | 246 | * Speed UART) device. |
247 | */ | 247 | */ |
248 | #define HSU_PORT2_PADDR 0xffa28180 | 248 | #define HSU_PORT_BASE 0xffa28080 |
249 | 249 | ||
250 | static void __iomem *phsu; | 250 | static void __iomem *phsu; |
251 | 251 | ||
252 | void hsu_early_console_init(void) | 252 | void hsu_early_console_init(const char *s) |
253 | { | 253 | { |
254 | unsigned long paddr, port = 0; | ||
254 | u8 lcr; | 255 | u8 lcr; |
255 | 256 | ||
256 | phsu = (void *)set_fixmap_offset_nocache(FIX_EARLYCON_MEM_BASE, | 257 | /* |
257 | HSU_PORT2_PADDR); | 258 | * Select the early HSU console port if specified by user in the |
259 | * kernel command line. | ||
260 | */ | ||
261 | if (*s && !kstrtoul(s, 10, &port)) | ||
262 | port = clamp_val(port, 0, 2); | ||
263 | |||
264 | paddr = HSU_PORT_BASE + port * 0x80; | ||
265 | phsu = (void *)set_fixmap_offset_nocache(FIX_EARLYCON_MEM_BASE, paddr); | ||
258 | 266 | ||
259 | /* Disable FIFO */ | 267 | /* Disable FIFO */ |
260 | writeb(0x0, phsu + UART_FCR); | 268 | writeb(0x0, phsu + UART_FCR); |
diff --git a/drivers/tty/serial/mfd.c b/drivers/tty/serial/mfd.c index 286c386d9c46..565f3fe3dd77 100644 --- a/drivers/tty/serial/mfd.c +++ b/drivers/tty/serial/mfd.c | |||
@@ -1156,7 +1156,6 @@ serial_hsu_console_setup(struct console *co, char *options) | |||
1156 | int bits = 8; | 1156 | int bits = 8; |
1157 | int parity = 'n'; | 1157 | int parity = 'n'; |
1158 | int flow = 'n'; | 1158 | int flow = 'n'; |
1159 | int ret; | ||
1160 | 1159 | ||
1161 | if (co->index == -1 || co->index >= serial_hsu_reg.nr) | 1160 | if (co->index == -1 || co->index >= serial_hsu_reg.nr) |
1162 | co->index = 0; | 1161 | co->index = 0; |
@@ -1167,9 +1166,7 @@ serial_hsu_console_setup(struct console *co, char *options) | |||
1167 | if (options) | 1166 | if (options) |
1168 | uart_parse_options(options, &baud, &parity, &bits, &flow); | 1167 | uart_parse_options(options, &baud, &parity, &bits, &flow); |
1169 | 1168 | ||
1170 | ret = uart_set_options(&up->port, co, baud, parity, bits, flow); | 1169 | return uart_set_options(&up->port, co, baud, parity, bits, flow); |
1171 | |||
1172 | return ret; | ||
1173 | } | 1170 | } |
1174 | 1171 | ||
1175 | static struct console serial_hsu_console = { | 1172 | static struct console serial_hsu_console = { |
@@ -1178,9 +1175,13 @@ static struct console serial_hsu_console = { | |||
1178 | .device = uart_console_device, | 1175 | .device = uart_console_device, |
1179 | .setup = serial_hsu_console_setup, | 1176 | .setup = serial_hsu_console_setup, |
1180 | .flags = CON_PRINTBUFFER, | 1177 | .flags = CON_PRINTBUFFER, |
1181 | .index = 2, | 1178 | .index = -1, |
1182 | .data = &serial_hsu_reg, | 1179 | .data = &serial_hsu_reg, |
1183 | }; | 1180 | }; |
1181 | |||
1182 | #define SERIAL_HSU_CONSOLE (&serial_hsu_console) | ||
1183 | #else | ||
1184 | #define SERIAL_HSU_CONSOLE NULL | ||
1184 | #endif | 1185 | #endif |
1185 | 1186 | ||
1186 | struct uart_ops serial_hsu_pops = { | 1187 | struct uart_ops serial_hsu_pops = { |
@@ -1210,6 +1211,7 @@ static struct uart_driver serial_hsu_reg = { | |||
1210 | .major = TTY_MAJOR, | 1211 | .major = TTY_MAJOR, |
1211 | .minor = 128, | 1212 | .minor = 128, |
1212 | .nr = 3, | 1213 | .nr = 3, |
1214 | .cons = SERIAL_HSU_CONSOLE, | ||
1213 | }; | 1215 | }; |
1214 | 1216 | ||
1215 | #ifdef CONFIG_PM | 1217 | #ifdef CONFIG_PM |
@@ -1344,12 +1346,6 @@ static int serial_hsu_probe(struct pci_dev *pdev, | |||
1344 | } | 1346 | } |
1345 | uart_add_one_port(&serial_hsu_reg, &uport->port); | 1347 | uart_add_one_port(&serial_hsu_reg, &uport->port); |
1346 | 1348 | ||
1347 | #ifdef CONFIG_SERIAL_MFD_HSU_CONSOLE | ||
1348 | if (index == 2) { | ||
1349 | register_console(&serial_hsu_console); | ||
1350 | uport->port.cons = &serial_hsu_console; | ||
1351 | } | ||
1352 | #endif | ||
1353 | pci_set_drvdata(pdev, uport); | 1349 | pci_set_drvdata(pdev, uport); |
1354 | } | 1350 | } |
1355 | 1351 | ||