forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MIPS: Loongson: Cleanup the serial port support
To share the same kernel image amon different machines we have added the machtype command line support. In the old serial port implementation the UART base address is hardcoded as a macro in machine.h which breaks with machtype, so change that to discover the address dynamically. Also move the initialization of the UART base address to uart_base.c to avoid remapping twice for early_printk.c and serial.c. Signed-off-by: Wu Zhangjin <[email protected]> Cc: [email protected] Patchwork: http://patchwork.linux-mips.org/patch/581/ Patchwork: http://patchwork.linux-mips.org/patch/682/ Signed-off-by: Ralf Baechle <[email protected]>
- Loading branch information
1 parent
04cfb90
commit a3ed495
Showing
7 changed files
with
60 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology | ||
* Copyright (C) 2009 Lemote Inc. | ||
* Author: Wu Zhangjin, [email protected] | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
|
@@ -10,19 +10,22 @@ | |
|
||
#include <linux/bootmem.h> | ||
|
||
#include <asm/bootinfo.h> | ||
|
||
#include <loongson.h> | ||
|
||
void __init prom_init(void) | ||
{ | ||
/* init base address of io space */ | ||
/* init base address of io space */ | ||
set_io_port_base((unsigned long) | ||
ioremap(LOONGSON_PCIIO_BASE, LOONGSON_PCIIO_SIZE)); | ||
|
||
prom_init_cmdline(); | ||
prom_init_env(); | ||
prom_init_memory(); | ||
|
||
/*init the uart base address */ | ||
#if defined(CONFIG_EARLY_PRINTK) || defined(CONFIG_SERIAL_8250) | ||
prom_init_uart_base(); | ||
#endif | ||
} | ||
|
||
void __init prom_free_prom_memory(void) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (C) 2009 Lemote Inc. | ||
* Author: Wu Zhangjin, [email protected] | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation; either version 2 of the License, or (at your | ||
* option) any later version. | ||
*/ | ||
|
||
#include <linux/module.h> | ||
#include <asm/bootinfo.h> | ||
|
||
#include <loongson.h> | ||
|
||
unsigned long __maybe_unused _loongson_uart_base; | ||
EXPORT_SYMBOL(_loongson_uart_base); | ||
|
||
unsigned long __maybe_unused uart8250_base[] = { | ||
[MACH_LOONGSON_UNKNOWN] 0, | ||
[MACH_LEMOTE_FL2E] (LOONGSON_PCIIO_BASE + 0x3f8), | ||
[MACH_LEMOTE_FL2F] (LOONGSON_PCIIO_BASE + 0x2f8), | ||
[MACH_LEMOTE_ML2F7] (LOONGSON_LIO1_BASE + 0x3f8), | ||
[MACH_LEMOTE_YL2F89] (LOONGSON_LIO1_BASE + 0x3f8), | ||
[MACH_DEXXON_GDIUM2F10] (LOONGSON_LIO1_BASE + 0x3f8), | ||
[MACH_LOONGSON_END] 0, | ||
}; | ||
EXPORT_SYMBOL(uart8250_base); | ||
|
||
void __maybe_unused prom_init_uart_base(void) | ||
{ | ||
_loongson_uart_base = | ||
(unsigned long)ioremap_nocache(uart8250_base[mips_machtype], 8); | ||
} |