Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp686953ybi; Fri, 2 Aug 2019 02:37:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqzbavv2cO871uEENVRkUFMZRd1FT2nR5qoTGCaxrREgorwuhO0Xt6k9mcX/RMpWv0plIWrE X-Received: by 2002:a17:90b:d8b:: with SMTP id bg11mr3515776pjb.30.1564738627698; Fri, 02 Aug 2019 02:37:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1564738627; cv=pass; d=google.com; s=arc-20160816; b=stjId3j2USz1CmzZaE8K4UHiN+20uWo2k/heUIo6MZnMfwGLi/vTm6VXP8Nf7SfYw6 nrDONyYXyyvRm2zpWh+tMtEyTnF7rk3AMlwPwNA3GJrJEOXFQ4zBRCLKwd0v2wuFJWUk 9sNSBa4/YYH86VvIe2M06Hpg4fg+/DaZIKJMY58a26m6YpdMua/R8kpZoX70jwCnZ3AS PECceFLCpFgei0zLQ75+8yujAk2h0iBvQLL3zFeF4yesiP/hBevc39AeRN3aBSGHAR1g xmP6yIlKJO7ADm20YsUTItECI3fACcV9/h1qwhQDUlznEhO7SSi2GJhYhLPI+IpXLvFM pn+Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:domainkey-signature; bh=PCPvMtgwI7YymWHtU3P5pq3i16qnpFDI6NTvI4dHUbE=; b=MW4aPJPlJPHBJE7biW8yDpPmSHfMNKep8CAC9kQTKipayP/yq5WhuzIZA5CelNgY1O jg0dFnZVQOdF03O9LT4+1fXL+ygyXagR1OaK08M6iSBxg32g82INJuBwLmmS2HtK9Vx+ Ai1PIusS8JudsY7dGFGry8E59CRrZ0IFiD69gjtr7BZwx5I+VmpzFbwUePEW1g6NrY69 EIg2hdZWd9DScWT5yUgBiq0tpPGhEDFwz+6DHe0SEt6ZdgVbuert2AnOK8YbMOqhUl5h /xksQtId7Azh+6zymaLKEssq8ZPYr88M28bz+fhvv16wnX4DuVhY9ijGy8nRFD0BdWap ibmQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@zoho.com header.s=zm2019 header.b=lIroAuI1; arc=pass (i=1 spf=pass spfdomain=zoho.com dkim=pass dkdomain=zoho.com dmarc=pass fromdomain=zoho.com>); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=zoho.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m37si6429269pje.45.2019.08.02.02.36.51; Fri, 02 Aug 2019 02:37:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@zoho.com header.s=zm2019 header.b=lIroAuI1; arc=pass (i=1 spf=pass spfdomain=zoho.com dkim=pass dkdomain=zoho.com dmarc=pass fromdomain=zoho.com>); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=zoho.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404175AbfHBI2q (ORCPT + 99 others); Fri, 2 Aug 2019 04:28:46 -0400 Received: from sender4-pp-o95.zoho.com ([136.143.188.95]:25588 "EHLO sender4-pp-o95.zoho.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404152AbfHBI2p (ORCPT ); Fri, 2 Aug 2019 04:28:45 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1564734480; cv=none; d=zoho.com; s=zohoarc; b=K4YPf8BbkekWzsJBdqypN0JZO8w45AMEuh9V8fVUwzAqJ7p4MdlbbgsYlJfOMAjEuwy7JuKOXuTnpqbxCtRxT2SBzxffXac93nR4i7CP156U1TTigSzsYrzwd4X/iX/cX7qJdFqxullm05LvzBKyvRBOGRw6INK6bJbhbegjX+4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564734480; h=Cc:Date:From:In-Reply-To:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=PCPvMtgwI7YymWHtU3P5pq3i16qnpFDI6NTvI4dHUbE=; b=f50TVeGSAd4g8pHsriPTF45D61qPoZyn7qy3+eAcuOgNDrzVx1SrTIWS8jn3Wuvyr2DOK/Vb0NEyhWfhvC9eX00cCz5jOHy3KCBAuMUjXYW4KD4N2gJUBBCyoRCMI5Vscqi1Sn82Rin/byljm6hF2FC3Fvi6UJ9/+9/iOY86DDQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=zoho.com; spf=pass smtp.mailfrom=zhouyanjie@zoho.com; dmarc=pass header.from= header.from= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=zapps768; d=zoho.com; h=from:to:cc:subject:date:message-id:in-reply-to:references; b=PGwKfdJsDr8ibKz4W65JzVC2iLb/RfdjvLQUH6ALxaIm9sJsYdX2p8ZBq/MFCfMOQHUX/xjyV/BV SCrgD0rTJEaqsFAs/S71VGaXvLOVn1JMNscy96q8WQ9Z5Vb5uOpx DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1564734480; s=zm2019; d=zoho.com; i=zhouyanjie@zoho.com; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; l=1305; bh=PCPvMtgwI7YymWHtU3P5pq3i16qnpFDI6NTvI4dHUbE=; b=lIroAuI1pb1MaEYLeQX6Ho8fHAM7qCU/sldk+/0/1bq43Y4y9hysjbbRlHavRIkg skamL/sibLO/2rHbRvzqfd6bCa4mTXVXm8lZwhQHD9GLraxk68xk6T3G0NVb96tlY4F 2AfM35JOrHbeM4tjVjIDzVhDmmZEVjUB+uSUqAOQ= Received: from localhost.localdomain (125.71.5.36 [125.71.5.36]) by mx.zohomail.com with SMTPS id 1564734479346989.5209055678341; Fri, 2 Aug 2019 01:27:59 -0700 (PDT) From: Zhou Yanjie To: linux-mips@vger.kernel.org Cc: linux-kernel@vger.kernel.org, ralf@linux-mips.org, paul@crapouillou.net, paul.burton@mips.com, jhogan@kernel.org, malat@debian.org, gregkh@linuxfoundation.org, tglx@linutronix.de, allison@lohutok.net, syq@debian.org, chenhc@lemote.com, jiaxun.yang@flygoat.com Subject: [PATCH 1/2 v4] MIPS: Ingenic: Fix bugs when detecting X1000's L2 cache. Date: Fri, 2 Aug 2019 16:27:36 +0800 Message-Id: <1564734457-48801-2-git-send-email-zhouyanjie@zoho.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1564734457-48801-1-git-send-email-zhouyanjie@zoho.com> References: <1564498510-3751-1-git-send-email-zhouyanjie@zoho.com> <1564734457-48801-1-git-send-email-zhouyanjie@zoho.com> X-ZohoMailClient: External Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 1.fix bugs when detecting L2 cache sets value. 2.fix bugs when detecting L2 cache ways value. Signed-off-by: Zhou Yanjie --- arch/mips/mm/sc-mips.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/arch/mips/mm/sc-mips.c b/arch/mips/mm/sc-mips.c index 9385ddb..dbdbfe5 100644 --- a/arch/mips/mm/sc-mips.c +++ b/arch/mips/mm/sc-mips.c @@ -221,13 +221,26 @@ static inline int __init mips_sc_probe(void) else return 0; - /* - * According to config2 it would be 5-ways, but that is contradicted - * by all documentation. - */ - if (current_cpu_type() == CPU_XBURST && - mips_machtype == MACH_INGENIC_JZ4770) - c->scache.ways = 4; + if (current_cpu_type() == CPU_XBURST) { + switch (mips_machtype) { + /* + * According to config2 it would be 5-ways, but that is + * contradicted by all documentation. + */ + case MACH_INGENIC_JZ4770: + c->scache.ways = 4; + break; + + /* + * According to config2 it would be 5-ways and 512-sets, + * but that is contradicted by all documentation. + */ + case MACH_INGENIC_X1000: + c->scache.sets = 256; + c->scache.ways = 4; + break; + } + } c->scache.waysize = c->scache.sets * c->scache.linesz; c->scache.waybit = __ffs(c->scache.waysize); -- 2.7.4