Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2418024pxu; Fri, 18 Dec 2020 12:46:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJyBTejyG0G8lnSYHVOFfldvmgJlFbef+Lr8YR5TT9QUVSo6fNkiHvqajBhKGVnIErt47K/7 X-Received: by 2002:a17:906:d152:: with SMTP id br18mr2095762ejb.297.1608324413061; Fri, 18 Dec 2020 12:46:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608324413; cv=none; d=google.com; s=arc-20160816; b=ckffQL2hCUrsATrirZlaKdUHHbhf3lRXFfWbBj7O6AbVKPQnAPPvPi7rD+P+ty5uSe BsmxKBbFKdut87gF1UDoA6tFHuwjjzEn9b0xXSam9WvnqNJ7oMyBPFg1UpPbQvF/IJsr CEA9pRAabM0f5w6Taeopv41JzQwaYGnr4oPBskX1aQFXoCYJJR7PhijX6Y/Iyyq1I1cQ 3UY9qJ/AaEiXyUp0XdQHR6HXyBH1KpSt5vWluiehvxKEbmblUcs8l5oloYB3sNPMeF2R SwHfhvSm8rJQf10Dsh02Tf0ZLhrK1ablA4bUsGQHMFLLVlF2t0AcNYUDCDGTEI00+6nD 5aUA== 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:sender :dkim-signature; bh=AJNJ4dnn/xQEXOKSPkMwYC+ElM0isCZbedzwf8ZReLQ=; b=pd8AdSlFr+6R/suWx0aTitFO3MhZz4kfbR4atFAmfoBiex5L2FYjP4gsYJJaDGalqB 4VFyyZyu7Ke8mv6wUsbiVpx3nh8eIoXusD9Wl6j2jO1WkTc6OfMzIs4rDtAReluNiu7R 31cLODNatfWgvDNi0npcBNg6nv/lOl9skrvIHU4PZPD9jR9PtHSrgXDIVqpFGhzOSBV4 OIhO22A1IR4acAmE09Un390Hu7jo0HMI1egh+n21W1PSy3aZrTWqK8wIAqV/uRhe200s jwaQG1G8FUPo12fUstD0ZixazX1xL2zTqc5Y1x63s7xyTmVxJPHghx1fgMdweuZLIdiG 8YyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=k0wuECPe; 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 c4si3398101ejk.182.2020.12.18.12.46.31; Fri, 18 Dec 2020 12:46:53 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=k0wuECPe; 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 S1732636AbgLRSpu (ORCPT + 99 others); Fri, 18 Dec 2020 13:45:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726339AbgLRSpf (ORCPT ); Fri, 18 Dec 2020 13:45:35 -0500 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39170C0611CC; Fri, 18 Dec 2020 10:44:26 -0800 (PST) Received: by mail-lf1-x135.google.com with SMTP id o13so7955373lfr.3; Fri, 18 Dec 2020 10:44:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AJNJ4dnn/xQEXOKSPkMwYC+ElM0isCZbedzwf8ZReLQ=; b=k0wuECPeRLjmJdKesuIAlelwdiMcdwStMe06IsC7eufCGjE/t4IOhE2U/P9DoFSWQi 311xp1B99amX15foq4uEYbVWqLBW0ScnPOBxVMBnAkX3Bvhhk4FWZiN6Po9ErwQLFF7D 4DAKuK2a1eOIkHAogH7TDtQnxPGt/BCmuKRLQdcg2Yejs93wSoSzLtJKW6WXq3iwvSuj U2mpjuK09ytk8hJHUXLWpaCjHxeZpbF6QHhNlsoutPTzjnC4I4OzfMGzKOxC7QNiH+n0 QXHtZRpEd/KjTxZ0o1ENkVtfvO/IURNpe9mYWmyF33WoMtq4amq3OHPV58oBxM3h1Zxa AXpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=AJNJ4dnn/xQEXOKSPkMwYC+ElM0isCZbedzwf8ZReLQ=; b=QXsJS3/TrHzer+4iBAhVg0y3EXdoVyvJue+EHAVT2USjnoXLRnzWdtpCFdhXq5rd72 X6DtUmlNQp99DpJm+/qTVvm4Wb3FK3UMoYZvH6GmK3n+/8KItQxwjVEl12g1LsLKj92C u5NNXSHNh4qmmoGRHEfvvDaP35mia7pCNuQIo3hamHT8XLhZ81UQBKS/8KL5+eaX1WvO IIzcBRE7zZwtFYcQ9KMeFgXAUVHT+Xt/eKlmtf6VKMeJgzO8TEXvaq/wxx3euZdHn6v+ rZ9fVejjBE26VoWN9Vvboy2gkrFoZWFtjnOi9K5qIj+FK/OjeVt9eNgpswOOMbdPYmvz kZGA== X-Gm-Message-State: AOAM530Vh0OfMiYb8+opEpHxcYNV4tk3j8mG7KAutvCDE6hPGsOTpfH5 NUcjDbqeK20T/izZutXLkGs= X-Received: by 2002:a2e:6a14:: with SMTP id f20mr2479790ljc.6.1608317064666; Fri, 18 Dec 2020 10:44:24 -0800 (PST) Received: from saturn.localdomain ([2a00:fd00:8060:1c00:2c04:50ad:1138:9ea2]) by smtp.gmail.com with ESMTPSA id s7sm1116980ljp.38.2020.12.18.10.44.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Dec 2020 10:44:24 -0800 (PST) Sender: Sam Ravnborg From: Sam Ravnborg To: David S Miller , sparclinux@vger.kernel.org, Andreas Larsson , Arnd Bergmann Cc: Alexey Dobriyan , Al Viro , Andrew Morton , Anshuman Khandual , Arvind Sankar , Christian Brauner , Denis Efremov , Dmitry Safonov <0x7f454c46@gmail.com>, Geert Uytterhoeven , Greg Kroah-Hartman , Ira Weiny , Lorenzo Pieralisi , Mark Rutland , Mike Rapoport , Pekka Enberg , Peter Zijlstra , Sam Ravnborg , Stephen Rothwell , Thomas Gleixner , Will Deacon , Willy Tarreau , linux-kernel@vger.kernel.org, debian-sparc@lists.debian.org, gentoo-sparc@l.g.o Subject: [PATCH v1 10/13] sparc32: Drop mbus support Date: Fri, 18 Dec 2020 19:43:44 +0100 Message-Id: <20201218184347.2180772-11-sam@ravnborg.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201218184347.2180772-1-sam@ravnborg.org> References: <20201218184347.2180772-1-sam@ravnborg.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Only used by older SAPRC HW, not used by LEON. Signed-off-by: Sam Ravnborg Cc: Sam Ravnborg Cc: Andrew Morton Cc: Mike Rapoport Cc: Arvind Sankar Cc: Greg Kroah-Hartman Cc: Pekka Enberg Cc: Ira Weiny Cc: "David S. Miller" Cc: Will Deacon Cc: Thomas Gleixner Cc: Arnd Bergmann Cc: Andreas Larsson --- arch/sparc/include/asm/elf_32.h | 2 - arch/sparc/include/asm/mbus.h | 97 --------------------------------- arch/sparc/kernel/cpu.c | 1 - arch/sparc/kernel/setup_32.c | 1 - arch/sparc/mm/iommu.c | 18 +----- arch/sparc/mm/srmmu.c | 48 ---------------- 6 files changed, 3 insertions(+), 164 deletions(-) delete mode 100644 arch/sparc/include/asm/mbus.h diff --git a/arch/sparc/include/asm/elf_32.h b/arch/sparc/include/asm/elf_32.h index 37a6016c9ccd..b2cca9be55c2 100644 --- a/arch/sparc/include/asm/elf_32.h +++ b/arch/sparc/include/asm/elf_32.h @@ -91,8 +91,6 @@ typedef struct { unsigned int pr_q[64]; } elf_fpregset_t; -#include - /* * This is used to ensure we don't load something for the wrong architecture. */ diff --git a/arch/sparc/include/asm/mbus.h b/arch/sparc/include/asm/mbus.h deleted file mode 100644 index 8b6dbe701b9b..000000000000 --- a/arch/sparc/include/asm/mbus.h +++ /dev/null @@ -1,97 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * mbus.h: Various defines for MBUS modules. - * - * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) - */ - -#ifndef _SPARC_MBUS_H -#define _SPARC_MBUS_H - -#include /* HyperSparc stuff */ -#include /* Ugh, bug city... */ - -enum mbus_module { - HyperSparc = 0, - Swift_ok = 4, - Swift_bad_c = 5, - Swift_lots_o_bugs = 6, - Tsunami = 7, - Viking_12 = 8, - Viking_2x = 9, - Viking_30 = 10, - Viking_35 = 11, - Viking_new = 12, - TurboSparc = 13, - SRMMU_INVAL_MOD = 14, -}; - -extern enum mbus_module srmmu_modtype; -extern unsigned int viking_rev, swift_rev, cypress_rev; - -/* HW Mbus module bugs we have to deal with */ -#define HWBUG_COPYBACK_BROKEN 0x00000001 -#define HWBUG_ASIFLUSH_BROKEN 0x00000002 -#define HWBUG_VACFLUSH_BITROT 0x00000004 -#define HWBUG_KERN_ACCBROKEN 0x00000008 -#define HWBUG_KERN_CBITBROKEN 0x00000010 -#define HWBUG_MODIFIED_BITROT 0x00000020 -#define HWBUG_PC_BADFAULT_ADDR 0x00000040 -#define HWBUG_SUPERSCALAR_BAD 0x00000080 -#define HWBUG_PACINIT_BITROT 0x00000100 - -/* First the module type values. To find out which you have, just load - * the mmu control register from ASI_M_MMUREG alternate address space and - * shift the value right 28 bits. - */ -/* IMPL field means the company which produced the chip. */ -#define MBUS_VIKING 0x4 /* bleech, Texas Instruments Module */ -#define MBUS_LSI 0x3 /* LSI Logics */ -#define MBUS_ROSS 0x1 /* Ross is nice */ -#define MBUS_FMI 0x0 /* Fujitsu Microelectronics/Swift */ - -/* Ross Module versions */ -#define ROSS_604_REV_CDE 0x0 /* revisions c, d, and e */ -#define ROSS_604_REV_F 0x1 /* revision f */ -#define ROSS_605 0xf /* revision a, a.1, and a.2 */ -#define ROSS_605_REV_B 0xe /* revision b */ - -/* TI Viking Module versions */ -#define VIKING_REV_12 0x1 /* Version 1.2 or SPARCclassic's CPU */ -#define VIKING_REV_2 0x2 /* Version 2.1, 2.2, 2.3, and 2.4 */ -#define VIKING_REV_30 0x3 /* Version 3.0 */ -#define VIKING_REV_35 0x4 /* Version 3.5 */ - -/* LSI Logics. */ -#define LSI_L64815 0x0 - -/* Fujitsu */ -#define FMI_AURORA 0x4 /* MB8690x, a Swift module... */ -#define FMI_TURBO 0x5 /* MB86907, a TurboSparc module... */ - -/* For multiprocessor support we need to be able to obtain the CPU id and - * the MBUS Module id. - */ - -/* The CPU ID is encoded in the trap base register, 20 bits to the left of - * bit zero, with 2 bits being significant. - */ -#define TBR_ID_SHIFT 20 - -static inline int get_cpuid(void) -{ - register int retval; - __asm__ __volatile__("rd %%tbr, %0\n\t" - "srl %0, %1, %0\n\t" : - "=r" (retval) : - "i" (TBR_ID_SHIFT)); - return (retval & 3); -} - -static inline int get_modid(void) -{ - return (get_cpuid() | 0x8); -} - - -#endif /* !(_SPARC_MBUS_H) */ diff --git a/arch/sparc/kernel/cpu.c b/arch/sparc/kernel/cpu.c index 79cd6ccfeac0..cca7de051593 100644 --- a/arch/sparc/kernel/cpu.c +++ b/arch/sparc/kernel/cpu.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include "kernel.h" diff --git a/arch/sparc/kernel/setup_32.c b/arch/sparc/kernel/setup_32.c index eea43a1aef1b..b6fd87928c73 100644 --- a/arch/sparc/kernel/setup_32.c +++ b/arch/sparc/kernel/setup_32.c @@ -42,7 +42,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/sparc/mm/iommu.c b/arch/sparc/mm/iommu.c index 0c0342e5b10d..125a3e96e3d2 100644 --- a/arch/sparc/mm/iommu.c +++ b/arch/sparc/mm/iommu.c @@ -18,7 +18,6 @@ #include #include -#include #include #include #include @@ -116,13 +115,7 @@ static void __init sbus_iommu_init(struct platform_device *op) prom_halt(); } bit_map_init(&iommu->usemap, bitmap, IOMMU_NPTES); - /* To be coherent on HyperSparc, the page color of DVMA - * and physical addresses must match. - */ - if (srmmu_modtype == HyperSparc) - iommu->usemap.num_colors = vac_cache_size >> PAGE_SHIFT; - else - iommu->usemap.num_colors = 1; + iommu->usemap.num_colors = 1; printk(KERN_INFO "IOMMU: impl %d vers %d table 0x%p[%d B] map [%d b]\n", impl, vers, iommu->page_table, @@ -444,11 +437,6 @@ static const struct dma_map_ops sbus_iommu_dma_pflush_ops = { void __init ld_mmu_iommu(void) { - if (viking_mxcc_present || srmmu_modtype == HyperSparc) { - dvma_prot = __pgprot(SRMMU_CACHE | SRMMU_ET_PTE | SRMMU_PRIV); - ioperm_noc = IOPTE_CACHE | IOPTE_WRITE | IOPTE_VALID; - } else { - dvma_prot = __pgprot(SRMMU_ET_PTE | SRMMU_PRIV); - ioperm_noc = IOPTE_WRITE | IOPTE_VALID; - } + dvma_prot = __pgprot(SRMMU_CACHE | SRMMU_ET_PTE | SRMMU_PRIV); + ioperm_noc = IOPTE_CACHE | IOPTE_WRITE | IOPTE_VALID; } diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c index d82cec45023a..802529aa02b9 100644 --- a/arch/sparc/mm/srmmu.c +++ b/arch/sparc/mm/srmmu.c @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -51,8 +50,6 @@ #include "mm_32.h" -enum mbus_module srmmu_modtype; -static unsigned int hwbug_bitmask; int vac_cache_size; EXPORT_SYMBOL(vac_cache_size); int vac_line_size; @@ -1116,7 +1113,6 @@ static const struct sparc32_cachetlb_ops hypersparc_ops = { static void __init init_hypersparc(void) { srmmu_name = "ROSS HyperSparc"; - srmmu_modtype = HyperSparc; init_vac_layout(); @@ -1175,45 +1171,6 @@ static void __init init_swift(void) "=r" (swift_rev) : "r" (SWIFT_MASKID_ADDR), "i" (ASI_M_BYPASS)); srmmu_name = "Fujitsu Swift"; - switch (swift_rev) { - case 0x11: - case 0x20: - case 0x23: - case 0x30: - srmmu_modtype = Swift_lots_o_bugs; - hwbug_bitmask |= (HWBUG_KERN_ACCBROKEN | HWBUG_KERN_CBITBROKEN); - /* - * Gee george, I wonder why Sun is so hush hush about - * this hardware bug... really braindamage stuff going - * on here. However I think we can find a way to avoid - * all of the workaround overhead under Linux. Basically, - * any page fault can cause kernel pages to become user - * accessible (the mmu gets confused and clears some of - * the ACC bits in kernel ptes). Aha, sounds pretty - * horrible eh? But wait, after extensive testing it appears - * that if you use pgd_t level large kernel pte's (like the - * 4MB pages on the Pentium) the bug does not get tripped - * at all. This avoids almost all of the major overhead. - * Welcome to a world where your vendor tells you to, - * "apply this kernel patch" instead of "sorry for the - * broken hardware, send it back and we'll give you - * properly functioning parts" - */ - break; - case 0x25: - case 0x31: - srmmu_modtype = Swift_bad_c; - hwbug_bitmask |= HWBUG_KERN_CBITBROKEN; - /* - * You see Sun allude to this hardware bug but never - * admit things directly, they'll say things like, - * "the Swift chip cache problems" or similar. - */ - break; - default: - srmmu_modtype = Swift_ok; - break; - } sparc32_cachetlb_ops = &swift_ops; flush_page_for_dma_global = 0; @@ -1366,7 +1323,6 @@ static const struct sparc32_cachetlb_ops turbosparc_ops = { static void __init init_turbosparc(void) { srmmu_name = "Fujitsu TurboSparc"; - srmmu_modtype = TurboSparc; sparc32_cachetlb_ops = &turbosparc_ops; poke_srmmu = poke_turbosparc; } @@ -1405,7 +1361,6 @@ static void __init init_tsunami(void) */ srmmu_name = "TI Tsunami"; - srmmu_modtype = Tsunami; sparc32_cachetlb_ops = &tsunami_ops; poke_srmmu = poke_tsunami; @@ -1545,9 +1500,6 @@ static void __init get_srmmu_type(void) unsigned long mreg, psr; unsigned long mod_typ, mod_rev, psr_typ, psr_vers; - srmmu_modtype = SRMMU_INVAL_MOD; - hwbug_bitmask = 0; - mreg = srmmu_get_mmureg(); psr = get_psr(); mod_typ = (mreg & 0xf0000000) >> 28; mod_rev = (mreg & 0x0f000000) >> 24; -- 2.27.0