Contributors: 5
Author |
Tokens |
Token Proportion |
Commits |
Commit Proportion |
Kelvin Cheung |
108 |
71.05% |
2 |
33.33% |
Jiaxun Yang |
35 |
23.03% |
1 |
16.67% |
Christoph Hellwig |
4 |
2.63% |
1 |
16.67% |
Thomas Bogendoerfer |
3 |
1.97% |
1 |
16.67% |
Thomas Gleixner |
2 |
1.32% |
1 |
16.67% |
Total |
152 |
|
6 |
|
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright (c) 2011 Zhang, Keguang <keguang.zhang@gmail.com>
*
* Modified from arch/mips/pnx833x/common/prom.c.
*/
#include <linux/io.h>
#include <linux/init.h>
#include <linux/memblock.h>
#include <linux/serial_reg.h>
#include <asm/fw/fw.h>
#include <loongson1.h>
unsigned long memsize;
void __init prom_init(void)
{
void __iomem *uart_base;
fw_init_cmdline();
memsize = fw_getenvl("memsize");
if(!memsize)
memsize = DEFAULT_MEMSIZE;
if (strstr(arcs_cmdline, "console=ttyS3"))
uart_base = ioremap(LS1X_UART3_BASE, 0x0f);
else if (strstr(arcs_cmdline, "console=ttyS2"))
uart_base = ioremap(LS1X_UART2_BASE, 0x0f);
else if (strstr(arcs_cmdline, "console=ttyS1"))
uart_base = ioremap(LS1X_UART1_BASE, 0x0f);
else
uart_base = ioremap(LS1X_UART0_BASE, 0x0f);
setup_8250_early_printk_port((unsigned long)uart_base, 0, 0);
}
void __init plat_mem_setup(void)
{
memblock_add(0x0, (memsize << 20));
}