Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c3d8d850 authored by Wu Zhangjin's avatar Wu Zhangjin Committed by Ralf Baechle
Browse files

MIPS: Loongson: Cleanups of serial port support



This patchs uses a loongson_uart_base variable instead of the
uart_base[] array and adds a new kernel option to avoid to compile
uart_base.c all the time, which will save a little bit of memory for us.

Signed-off-by: default avatarWu Zhangjin <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
http://patchwork.linux-mips.org/patch/727/


Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent c47a48d8
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -31,9 +31,17 @@ extern void __init prom_init_memory(void);
extern void __init prom_init_cmdline(void);
extern void __init prom_init_machtype(void);
extern void __init prom_init_env(void);
extern unsigned long _loongson_uart_base;
extern unsigned long uart8250_base[];
extern void prom_init_uart_base(void);
#ifdef CONFIG_LOONGSON_UART_BASE
extern unsigned long _loongson_uart_base, loongson_uart_base;
extern void prom_init_loongson_uart_base(void);
#endif

static inline void prom_init_uart_base(void)
{
#ifdef CONFIG_LOONGSON_UART_BASE
	prom_init_loongson_uart_base();
#endif
}

/* irq operation functions */
extern void bonito_irqdispatch(void);
+5 −0
Original line number Diff line number Diff line
@@ -78,3 +78,8 @@ config LOONGSON_SUSPEND
	bool
	default y
	depends on CPU_SUPPORTS_CPUFREQ && SUSPEND

config LOONGSON_UART_BASE
	bool
	default y
	depends on EARLY_PRINTK || SERIAL_8250
+3 −2
Original line number Diff line number Diff line
@@ -3,13 +3,14 @@
#

obj-y += setup.o init.o cmdline.o env.o time.o reset.o irq.o \
    pci.o bonito-irq.o mem.o machtype.o platform.o uart_base.o
    pci.o bonito-irq.o mem.o machtype.o platform.o

#
# Early printk support
# Serial port support
#
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
obj-$(CONFIG_SERIAL_8250) += serial.o
obj-$(CONFIG_LOONGSON_UART_BASE) += uart_base.o

#
# Enable CS5536 Virtual Support Module(VSM) to virtulize the PCI configure
+0 −2
Original line number Diff line number Diff line
@@ -31,9 +31,7 @@ void __init prom_init(void)
	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)
+7 −3
Original line number Diff line number Diff line
@@ -57,12 +57,16 @@ static struct platform_device uart8250_device = {

static int __init serial_init(void)
{
	if (uart8250_data[mips_machtype][0].iotype == UPIO_MEM)
	unsigned char iotype;

	iotype = uart8250_data[mips_machtype][0].iotype;

	if (UPIO_MEM == iotype)
		uart8250_data[mips_machtype][0].membase =
			(void __iomem *)_loongson_uart_base;
	else if (uart8250_data[mips_machtype][0].iotype == UPIO_PORT)
	else if (UPIO_PORT == iotype)
		uart8250_data[mips_machtype][0].iobase =
		    uart8250_base[mips_machtype] - LOONGSON_PCIIO_BASE;
		    loongson_uart_base - LOONGSON_PCIIO_BASE;

	uart8250_device.dev.platform_data = uart8250_data[mips_machtype];

Loading