MIPS: Loongson64: Add Loongson-2K1000 early_printk_port
authorQing Zhang <zhangqing@loongson.cn>
Mon, 15 Mar 2021 07:50:01 +0000 (15:50 +0800)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Thu, 25 Mar 2021 09:44:01 +0000 (10:44 +0100)
Distinguish between Loongson-3A series CPU and Loongson-2K1000 CPU UART0.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
Tested-by: Ming Wang <wangming01@loongson.cn>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/loongson64/init.c

index ed280b73bf89320dc590e47658fa756ea91245a1..d5a1eddb820248ebed6ac3324c784d44536ab07a 100644 (file)
@@ -120,7 +120,10 @@ void __init prom_init(void)
 #endif
 
        /* Hardcode to CPU UART 0 */
-       setup_8250_early_printk_port(TO_UNCAC(LOONGSON_REG_BASE + 0x1e0), 0, 1024);
+       if ((read_c0_prid() & PRID_IMP_MASK) == PRID_IMP_LOONGSON_64R)
+               setup_8250_early_printk_port(TO_UNCAC(LOONGSON_REG_BASE), 0, 1024);
+       else
+               setup_8250_early_printk_port(TO_UNCAC(LOONGSON_REG_BASE + 0x1e0), 0, 1024);
 
        register_smp_ops(&loongson3_smp_ops);
        board_nmi_handler_setup = mips_nmi_setup;