1 // SPDX-License-Identifier: GPL-2.0-or-later 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* 2 /* 3 * Copyright (C) 2009 Lemote Inc. 3 * Copyright (C) 2009 Lemote Inc. 4 * Author: Wu Zhangjin, wuzhangjin@gmail.com 4 * Author: Wu Zhangjin, wuzhangjin@gmail.com 5 */ 5 */ 6 6 7 #include <linux/export.h> 7 #include <linux/export.h> 8 #include <asm/bootinfo.h> 8 #include <asm/bootinfo.h> 9 #include <asm/setup.h> 9 #include <asm/setup.h> 10 10 11 #include <loongson.h> 11 #include <loongson.h> 12 12 13 /* raw */ 13 /* raw */ 14 unsigned long loongson_uart_base; 14 unsigned long loongson_uart_base; 15 /* ioremapped */ 15 /* ioremapped */ 16 unsigned long _loongson_uart_base; 16 unsigned long _loongson_uart_base; 17 17 18 EXPORT_SYMBOL(loongson_uart_base); 18 EXPORT_SYMBOL(loongson_uart_base); 19 EXPORT_SYMBOL(_loongson_uart_base); 19 EXPORT_SYMBOL(_loongson_uart_base); 20 20 21 void prom_init_loongson_uart_base(void) 21 void prom_init_loongson_uart_base(void) 22 { 22 { 23 switch (mips_machtype) { 23 switch (mips_machtype) { 24 case MACH_LEMOTE_FL2E: 24 case MACH_LEMOTE_FL2E: 25 loongson_uart_base = LOONGSON_ 25 loongson_uart_base = LOONGSON_PCIIO_BASE + 0x3f8; 26 break; 26 break; 27 case MACH_LEMOTE_FL2F: 27 case MACH_LEMOTE_FL2F: 28 case MACH_LEMOTE_LL2F: 28 case MACH_LEMOTE_LL2F: 29 loongson_uart_base = LOONGSON_ 29 loongson_uart_base = LOONGSON_PCIIO_BASE + 0x2f8; 30 break; 30 break; 31 case MACH_LEMOTE_ML2F7: 31 case MACH_LEMOTE_ML2F7: 32 case MACH_LEMOTE_YL2F89: 32 case MACH_LEMOTE_YL2F89: 33 case MACH_DEXXON_GDIUM2F10: 33 case MACH_DEXXON_GDIUM2F10: 34 case MACH_LEMOTE_NAS: 34 case MACH_LEMOTE_NAS: 35 default: 35 default: 36 /* The CPU provided serial por 36 /* The CPU provided serial port (LPC) */ 37 loongson_uart_base = LOONGSON_ 37 loongson_uart_base = LOONGSON_LIO1_BASE + 0x3f8; 38 break; 38 break; 39 } 39 } 40 40 41 _loongson_uart_base = TO_UNCAC(loongso 41 _loongson_uart_base = TO_UNCAC(loongson_uart_base); 42 setup_8250_early_printk_port(_loongson 42 setup_8250_early_printk_port(_loongson_uart_base, 0, 1024); 43 } 43 } 44 44
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.