Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp63221pxf; Tue, 9 Mar 2021 23:58:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwvLL2trbMpe4rOozHIAIRdJ6dGrHxWIsXZmL1rzxJrBmBGinRtRQNgeG5juS35qeM2DKrj X-Received: by 2002:a17:906:30d9:: with SMTP id b25mr2306398ejb.348.1615363130559; Tue, 09 Mar 2021 23:58:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615363130; cv=none; d=google.com; s=arc-20160816; b=UPBZ/C6mG+aGanYERQJ091M3Tde1q0FhGS8t44K8JA5ecbhcRYc1gMpanUgUZDBXZo ibcW88hPFJFCEkP/7qoQ/3PZ41nRZDgfARc8tUEyE0Ku254T20draDhj6zxGB0W/e7Tq YJuEC4vCjpkbvs+BOv5AHkRZdwyW1hwZskUQKnHNa9IV9DFkJMvPrTLVD031CFu6t5fy dNNFNVJOw6uV1Mu+e9LpDnmE8LcI3/htsHBsk1derqNIhFkGvW+9Qm1soapIS0s6rsRg QJLKIR8a6jdIRMJi8yzQ9BxZXL5gW8DdjsNmRCfDEaeIDywmGRfNRY8REE64IdWJEfLY REmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=9IhYw22dvgOVv7IXejWvKaPokthdCFlQPSMEXK00dFQ=; b=LLg5zrJsmN8ZQ+7xWdsnJg6RQHqCdPh1sWi9Mf8htm/4WaO24IN39RXLi+61dgJ8Ah m9pQtieCe2Lm7B58rw1skp/62Ia86VHcrBDANVCtQYeTdzfjgYG7EDarsrO4yuxkxCEw US7mtTYfdJex8zxvT+g7+a8coIqiFsEDx/QeSbf2VHB9uzJew8h8+2dZXJqhl1FMzJ/b jLVhxeSquttemHhFhvXYJb0TkBsIHXHXeAyr+PZTXPcN9XsmQblfAu/eQCnpKVFsYsyw 615r2pZ1yjdkfC5WaOWuaQw4BRrnUqComiTwd8hVH3Ybx2bQWKgKj4ELTvP6hcgCByZ8 GYgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bs25si11345689ejb.238.2021.03.09.23.58.28; Tue, 09 Mar 2021 23:58:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232349AbhCJH5X (ORCPT + 99 others); Wed, 10 Mar 2021 02:57:23 -0500 Received: from mail.loongson.cn ([114.242.206.163]:33348 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229584AbhCJH4z (ORCPT ); Wed, 10 Mar 2021 02:56:55 -0500 Received: from localhost.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Dxn_O3e0hg6KoXAA--.12657S6; Wed, 10 Mar 2021 15:56:47 +0800 (CST) From: Qing Zhang To: Huacai Chen , Jiaxun Yang , Thomas Bogendoerfer , Thomas Gleixner , Marc Zyngier Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Ming Wang Subject: [PATCH v4 4/7] MIPS: Loongson64: Add Loongson-2K1000 early_printk_port Date: Wed, 10 Mar 2021 15:56:36 +0800 Message-Id: <20210310075639.20372-5-zhangqing@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210310075639.20372-1-zhangqing@loongson.cn> References: <20210310075639.20372-1-zhangqing@loongson.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0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I 8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjfUY3kuDUUUU X-CM-SenderInfo: x2kd0wptlqwqxorr0wxvrqhubq/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Distinguish between Loongson-3A series CPU and Loongson-2K1000 CPU UART0. Signed-off-by: Jiaxun Yang Signed-off-by: Qing Zhang Tested-by: Ming Wang --- v3-v4: Standard submission of information arch/mips/loongson64/init.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/mips/loongson64/init.c b/arch/mips/loongson64/init.c index ed280b73bf89..d5a1eddb8202 100644 --- a/arch/mips/loongson64/init.c +++ b/arch/mips/loongson64/init.c @@ -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; -- 2.20.1