Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp206775ybm; Thu, 28 May 2020 20:48:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsIMTsTCviWAn3K75zOrOMEYvuUY5xPwmOG3reNDmcsdtI4Ql4rHoHDoS0coNYicXFI9Br X-Received: by 2002:a17:906:6a92:: with SMTP id p18mr5724068ejr.233.1590724115612; Thu, 28 May 2020 20:48:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590724115; cv=none; d=google.com; s=arc-20160816; b=rYLXpRjdasPKkD36L8Ijr88BA1T7bd2uweYRavuUz8fyae93W5XokbxDccQw3koOGS Jb6pyVmy8YEZcfX30AyqfdArSm8GvWjRTLnX6a0nGXa0p81RZMz58vIVfYuBR4b+61PN n9tItjCjO9pilSg2MfyODTq3S0Kb2IGDVO+IXTcbarNYqp7d0gAIuq/7BZGfaP5wsEr0 ISwd/+3hwm0Jn7OXX9c0jT65lJ2ORi5NJsWOo3XIX4uYU14+zYJAawdPL0YqSimcjdN8 eXgEFRYzh0Guq7rZiY3yU7mxJNvh1V5kVRnkp20KtANASubkK1/sXYDgpbB1aROH2Trq 2H/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6SFAFXJYtDM09r0IiXhTKlWaECkzetbGTEU5IywAC8g=; b=mdQnvayUyPKuuJFiVkNUZWX5FCT7q5I4+E3mPl4legkyLlDq3Xyyw9NktO79iQy+Rx wt7uPguVGxXTWx7K/471savKo6Qhd6uHVnFAQojtrE66kptQO2yJLPvo8F+JkBU26RV2 Y8gtrqx9R4IV9ZlKE+fLBOK99PG1Yu/bZKRkMCIJ6qcJRiSAryy4F1lGGDSOrA6FtyEf 9DhsJgd6CbJxU6XA2sasoZCV1RB4dNbQhjLvLaSTblusYJooC4l4glfNd1gVB+rAMYFp 5xFFLQOHEDJSNvfIwee8soUaQUGRkrXbyeGI65E7KZVquDksAZNEjOFBJJVe0poUjutj Ph3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@flygoat.com header.s=vultr header.b=LteoWN63; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v28si5077896edd.233.2020.05.28.20.48.13; Thu, 28 May 2020 20:48:35 -0700 (PDT) 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; dkim=fail header.i=@flygoat.com header.s=vultr header.b=LteoWN63; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388274AbgE2Dp2 (ORCPT + 99 others); Thu, 28 May 2020 23:45:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388037AbgE2DpZ (ORCPT ); Thu, 28 May 2020 23:45:25 -0400 Received: from vultr.net.flygoat.com (vultr.net.flygoat.com [IPv6:2001:19f0:6001:3633:5400:2ff:fe8c:553]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75430C08C5C6; Thu, 28 May 2020 20:45:25 -0700 (PDT) Received: from localhost.localdomain (unknown [142.147.94.151]) by vultr.net.flygoat.com (Postfix) with ESMTPSA id 8F97E20CD9; Fri, 29 May 2020 03:45:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=flygoat.com; s=vultr; t=1590723925; bh=6/KuaceX+/j+g+1dcwRKN0arBJJEMAYjWfUJAYKj/1g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LteoWN63oyCtpyCqQOWc2NaEW43aff24Q8BC313rBIEefQS1agOsPJIai3SC7ovmG 57eERUXjX8dyPiP3/9Kcreezc8uCU3iX4RrKbWhWcn7+vdEJckeuF1uZdoqUtrfGrq +b9VnO+S+rxuh2MupGnOW5DFqO4UPsujGiRiukW/6LDNXnH3v4PaFwBZuxAUJFzFN7 B0+epzJPBdUlKhgnwg1F7fkZBPTO2wQ3mzvX2dTdnBT1/f1WL7TPqQCEXZmvDNmS1y ACArJfezrAP46ks9W8wlQ7C8z8jrcn5xm47nuZGLXJKmZ5O9Sg0zRcvigTc8iyxSha Uhx7/bWkgBDjg== From: Jiaxun Yang To: maz@kernel.org Cc: Jiaxun Yang , Thomas Bogendoerfer , Rob Herring , Huacai Chen , linux-mips@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] MIPS: Loongson64:Load LS7A dtbs Date: Fri, 29 May 2020 11:43:20 +0800 Message-Id: <20200529034338.1137776-4-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.27.0.rc0 In-Reply-To: <20200529034338.1137776-1-jiaxun.yang@flygoat.com> References: <20200529034338.1137776-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Load correct devicetree according to PRID and PCH type. Signed-off-by: Jiaxun Yang --- arch/mips/loongson64/env.c | 56 +++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 22 deletions(-) diff --git a/arch/mips/loongson64/env.c b/arch/mips/loongson64/env.c index d11bc346bbca..9b56f4a80b62 100644 --- a/arch/mips/loongson64/env.c +++ b/arch/mips/loongson64/env.c @@ -126,28 +126,6 @@ void __init prom_init_env(void) loongson_sysconf.cores_per_node - 1) / loongson_sysconf.cores_per_node; - if ((read_c0_prid() & PRID_IMP_MASK) == PRID_IMP_LOONGSON_64C) { - switch (read_c0_prid() & PRID_REV_MASK) { - case PRID_REV_LOONGSON3A_R1: - case PRID_REV_LOONGSON3A_R2_0: - case PRID_REV_LOONGSON3A_R2_1: - case PRID_REV_LOONGSON3A_R3_0: - case PRID_REV_LOONGSON3A_R3_1: - loongson_fdt_blob = __dtb_loongson3_4core_rs780e_begin; - break; - case PRID_REV_LOONGSON3B_R1: - case PRID_REV_LOONGSON3B_R2: - loongson_fdt_blob = __dtb_loongson3_8core_rs780e_begin; - break; - default: - break; - } - } - - - if (!loongson_fdt_blob) - pr_err("Failed to determine built-in Loongson64 dtb\n"); - loongson_sysconf.pci_mem_start_addr = eirq_source->pci_mem_start_addr; loongson_sysconf.pci_mem_end_addr = eirq_source->pci_mem_end_addr; loongson_sysconf.pci_io_base = eirq_source->pci_io_start_addr; @@ -198,4 +176,38 @@ void __init prom_init_env(void) loongson_sysconf.bridgetype = RS780E; loongson_sysconf.early_config = rs780e_early_config; } + + if ((read_c0_prid() & PRID_IMP_MASK) == PRID_IMP_LOONGSON_64C) { + switch (read_c0_prid() & PRID_REV_MASK) { + case PRID_REV_LOONGSON3A_R1: + case PRID_REV_LOONGSON3A_R2_0: + case PRID_REV_LOONGSON3A_R2_1: + case PRID_REV_LOONGSON3A_R3_0: + case PRID_REV_LOONGSON3A_R3_1: + switch (loongson_sysconf.bridgetype) { + case RS780E: + loongson_fdt_blob = __dtb_loongson3_4core_rs780e_begin; + break; + case LS7A: + loongson_fdt_blob = __dtb_loongson3_4core_ls7a_begin; + break; + default: + break; + } + break; + case PRID_REV_LOONGSON3B_R1: + case PRID_REV_LOONGSON3B_R2: + if (loongson_sysconf.bridgetype == RS780E) + loongson_fdt_blob = __dtb_loongson3_8core_rs780e_begin; + break; + default: + break; + } + } else if ((read_c0_prid() & PRID_IMP_MASK) == PRID_IMP_LOONGSON_64G) { + if (loongson_sysconf.bridgetype == LS7A) + loongson_fdt_blob = __dtb_loongson3_r4_ls7a_begin; + } + + if (!loongson_fdt_blob) + pr_err("Failed to determine built-in Loongson64 dtb\n"); } -- 2.27.0.rc0