Received: by 10.213.65.68 with SMTP id h4csp81886imn; Thu, 5 Apr 2018 18:19:22 -0700 (PDT) X-Google-Smtp-Source: AIpwx496cDc2HIGc/jCawxNiPtlFmdqOnejdDRPo0HIrLEEBbjjKxpGxlEWGSCOkLwCYSZb11O4m X-Received: by 2002:a17:902:8e8b:: with SMTP id bg11-v6mr24999283plb.225.1522977562135; Thu, 05 Apr 2018 18:19:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522977562; cv=none; d=google.com; s=arc-20160816; b=Qe3YsMucZsYnbsYeVc417L7JxBSq8uxOMEuOI+UQvbOrYC4Vvq8ZSCDGqgioEqXWE0 /8T8A/1nVbxkNY7c/0PP2Siz52fCXe9q+ven5+dezbHuM/QuJZqUQQ+YBJrYxr1SAoAp E69Ua1FXzmYplaD2AFuzeFVzY6qGJbuwIaRyVUrIFAB20U4pgtLd4NqGG6DjAMxMLe7v x23AaYDFPO//C7k8olw0o0W+GL/2u8xpvTWh6lIRokVgE3AMUYJu0OA/GpYzGtcV3WBp I8dKhFySnENthdkcdv7gosH3feioMFyNekFUTDsfcne3pZxWBWtXqpaqqP2lyK17OOCd rtew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature :arc-authentication-results; bh=qlQshV/sxWW2wBxcw93B8RvTPpZLPI0wViLpcMeqhgQ=; b=VXvZrNn1tvRSE5FGhsgeJISKjOrHnnBVX1a3osGKKvTRT2gOx0NcAucveDSHwrfP0H QVzkUPmWU3j6jzUSl2+GK8C6SL3j98vXsaE8ua4GbOX/OJmawr1pn6g2K/gT3+X/u8Nx M4SoVmqb9dJ5TtL/k0SzxgUl0+Xm/TXWps+Miq/mO3FTKQVPWkdX3V0TkFDR//EjRu5W Y5PFDAAhruZinqRbx/dI9GcQ4gIvtJuUr2NQLnREGwz1lQSagHsutNWo+FcjC/7d1c1J YIi7t9uFbgABJKxabQ0iG6zY0lLVZEamydKJNKlwmQFLEuafxWe+ahOrNFfrIAJJ8HjL tAXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@animalcreek.com header.s=mesmtp header.b=LQTsJfrR; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=C1+HkOaL; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u137si6380659pgb.651.2018.04.05.18.19.07; Thu, 05 Apr 2018 18:19:22 -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=temperror (no key for signature) header.i=@animalcreek.com header.s=mesmtp header.b=LQTsJfrR; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=C1+HkOaL; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751415AbeDFBRk (ORCPT + 99 others); Thu, 5 Apr 2018 21:17:40 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:48119 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751314AbeDFBRi (ORCPT ); Thu, 5 Apr 2018 21:17:38 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 51E55211D8; Thu, 5 Apr 2018 21:17:37 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 05 Apr 2018 21:17:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=animalcreek.com; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=mesmtp; bh=qlQshV/sxWW2wB xcw93B8RvTPpZLPI0wViLpcMeqhgQ=; b=LQTsJfrRFw9KO6AOeWiDChOC+21bC/ R7hI0IHljb51dhIcR4DyZXzy6sSzf9QMtznkbm/uwq7LhhI5T6uSxIb6+ovVU6KT UrrexI90sQZgB0aNutaj7ZPzbSBUkvJtf8iPa5Yn/doqKeYRD728cjT3/tl4pmgb sw8c+bDRcUHJw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=qlQshV/sxWW2wBxcw93B8RvTPpZLPI0wViLpcMeqhgQ=; b=C1+HkOaL EW8VrtlZNMsjaKKI9W0PPqEblqDI6cA6mM5yIa4ZiUXAOibbDddefcconPU/jqC5 A++sPTcmmywM6CBQi/F9ms9BS0ds9+WqXoeW3x0H4qRptq6N6JyWh+sFveOOJDiP SDdBz69FPTIlN8MRYq4NohVCzuoi/lVHeTVyDAfzlT0g5hxuS1nE6UKNCrqRwfQm unEU4xZ6JC0RsK4BpwsO7RmdK1sIc4CpOuI1NH49sGsNRIakQFX9PtjJCUoA009m WHGz+3EhxqYMS+M2Mu/RovWKYBeZNaeYPUIxtPhzVFDSwXfzYiyc97/MP+aWzTlC m3Fgfmt6ZODh4g== X-ME-Sender: Received: from blue.animalcreek.com (ip68-3-119-204.ph.ph.cox.net [68.3.119.204]) by mail.messagingengine.com (Postfix) with ESMTPA id 0022B1025C; Thu, 5 Apr 2018 21:17:36 -0400 (EDT) Received: from blue.animalcreek.com (localhost [127.0.0.1]) by blue.animalcreek.com (Postfix) with ESMTP id 819CBA22834; Thu, 5 Apr 2018 18:17:35 -0700 (MST) From: Mark Greer To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: Remi Machet , Dale Farnsworth , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Mark Greer Subject: [PATCH 2/5] powerpc/boot: Remove support for Marvell MPSC serial controller Date: Thu, 5 Apr 2018 18:17:17 -0700 Message-Id: <20180406011720.7728-3-mgreer@animalcreek.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180406011720.7728-1-mgreer@animalcreek.com> References: <20180406011720.7728-1-mgreer@animalcreek.com> Organization: Animal Creek Technologies, Inc. Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There are no longer any platforms that use Marvell's MPSC serial controller so remove its driver. Signed-off-by: Mark Greer --- arch/powerpc/boot/Makefile | 2 +- arch/powerpc/boot/mpsc.c | 169 --------------------------------------------- arch/powerpc/boot/ops.h | 1 - arch/powerpc/boot/serial.c | 4 -- 4 files changed, 1 insertion(+), 175 deletions(-) delete mode 100644 arch/powerpc/boot/mpsc.c diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 70bf9b409fae..58f2dbfba275 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -120,7 +120,7 @@ src-wlib-$(CONFIG_40x) += 4xx.c planetcore.c src-wlib-$(CONFIG_44x) += 4xx.c ebony.c bamboo.c src-wlib-$(CONFIG_PPC_8xx) += mpc8xx.c planetcore.c fsl-soc.c src-wlib-$(CONFIG_PPC_82xx) += pq2.c fsl-soc.c planetcore.c -src-wlib-$(CONFIG_EMBEDDED6xx) += mpsc.c mv64x60.c mv64x60_i2c.c ugecon.c fsl-soc.c +src-wlib-$(CONFIG_EMBEDDED6xx) += mv64x60.c mv64x60_i2c.c ugecon.c fsl-soc.c src-wlib-$(CONFIG_XILINX_VIRTEX) += uartlite.c src-wlib-$(CONFIG_CPM) += cpm-serial.c diff --git a/arch/powerpc/boot/mpsc.c b/arch/powerpc/boot/mpsc.c deleted file mode 100644 index 425ad88cce8d..000000000000 --- a/arch/powerpc/boot/mpsc.c +++ /dev/null @@ -1,169 +0,0 @@ -/* - * MPSC/UART driver for the Marvell mv64360, mv64460, ... - * - * Author: Mark A. Greer - * - * 2007 (c) MontaVista Software, Inc. This file is licensed under - * the terms of the GNU General Public License version 2. This program - * is licensed "as is" without any warranty of any kind, whether express - * or implied. - */ - -#include -#include -#include "types.h" -#include "string.h" -#include "stdio.h" -#include "io.h" -#include "ops.h" - - -#define MPSC_CHR_1 0x000c - -#define MPSC_CHR_2 0x0010 -#define MPSC_CHR_2_TA (1<<7) -#define MPSC_CHR_2_TCS (1<<9) -#define MPSC_CHR_2_RA (1<<23) -#define MPSC_CHR_2_CRD (1<<25) -#define MPSC_CHR_2_EH (1<<31) - -#define MPSC_CHR_4 0x0018 -#define MPSC_CHR_4_Z (1<<29) - -#define MPSC_CHR_5 0x001c -#define MPSC_CHR_5_CTL1_INTR (1<<12) -#define MPSC_CHR_5_CTL1_VALID (1<<15) - -#define MPSC_CHR_10 0x0030 - -#define MPSC_INTR_CAUSE 0x0000 -#define MPSC_INTR_CAUSE_RCC (1<<6) -#define MPSC_INTR_MASK 0x0080 - -#define SDMA_SDCM 0x0008 -#define SDMA_SDCM_AR (1<<15) -#define SDMA_SDCM_AT (1<<31) - -static volatile char *mpsc_base; -static volatile char *mpscintr_base; -static u32 chr1, chr2; - -static int mpsc_open(void) -{ - chr1 = in_le32((u32 *)(mpsc_base + MPSC_CHR_1)) & 0x00ff0000; - chr2 = in_le32((u32 *)(mpsc_base + MPSC_CHR_2)) & ~(MPSC_CHR_2_TA - | MPSC_CHR_2_TCS | MPSC_CHR_2_RA | MPSC_CHR_2_CRD - | MPSC_CHR_2_EH); - out_le32((u32 *)(mpsc_base + MPSC_CHR_4), MPSC_CHR_4_Z); - out_le32((u32 *)(mpsc_base + MPSC_CHR_5), - MPSC_CHR_5_CTL1_INTR | MPSC_CHR_5_CTL1_VALID); - out_le32((u32 *)(mpsc_base + MPSC_CHR_2), chr2 | MPSC_CHR_2_EH); - return 0; -} - -static void mpsc_putc(unsigned char c) -{ - while (in_le32((u32 *)(mpsc_base + MPSC_CHR_2)) & MPSC_CHR_2_TCS); - - out_le32((u32 *)(mpsc_base + MPSC_CHR_1), chr1 | c); - out_le32((u32 *)(mpsc_base + MPSC_CHR_2), chr2 | MPSC_CHR_2_TCS); -} - -static unsigned char mpsc_getc(void) -{ - u32 cause = 0; - unsigned char c; - - while (!(cause & MPSC_INTR_CAUSE_RCC)) - cause = in_le32((u32 *)(mpscintr_base + MPSC_INTR_CAUSE)); - - c = in_8((u8 *)(mpsc_base + MPSC_CHR_10 + 2)); - out_8((u8 *)(mpsc_base + MPSC_CHR_10 + 2), c); - out_le32((u32 *)(mpscintr_base + MPSC_INTR_CAUSE), - cause & ~MPSC_INTR_CAUSE_RCC); - - return c; -} - -static u8 mpsc_tstc(void) -{ - return (u8)((in_le32((u32 *)(mpscintr_base + MPSC_INTR_CAUSE)) - & MPSC_INTR_CAUSE_RCC) != 0); -} - -static void mpsc_stop_dma(volatile char *sdma_base) -{ - out_le32((u32 *)(mpsc_base + MPSC_CHR_2),MPSC_CHR_2_TA | MPSC_CHR_2_RA); - out_le32((u32 *)(sdma_base + SDMA_SDCM), SDMA_SDCM_AR | SDMA_SDCM_AT); - - while ((in_le32((u32 *)(sdma_base + SDMA_SDCM)) - & (SDMA_SDCM_AR | SDMA_SDCM_AT)) != 0) - udelay(100); -} - -static volatile char *mpsc_get_virtreg_of_phandle(void *devp, char *prop) -{ - void *v; - int n; - - n = getprop(devp, prop, &v, sizeof(v)); - if (n != sizeof(v)) - goto err_out; - - devp = find_node_by_linuxphandle((u32)v); - if (devp == NULL) - goto err_out; - - n = getprop(devp, "virtual-reg", &v, sizeof(v)); - if (n == sizeof(v)) - return v; - -err_out: - return NULL; -} - -int mpsc_console_init(void *devp, struct serial_console_data *scdp) -{ - void *v; - int n, reg_set; - volatile char *sdma_base; - - n = getprop(devp, "virtual-reg", &v, sizeof(v)); - if (n != sizeof(v)) - goto err_out; - mpsc_base = v; - - sdma_base = mpsc_get_virtreg_of_phandle(devp, "sdma"); - if (sdma_base == NULL) - goto err_out; - - mpscintr_base = mpsc_get_virtreg_of_phandle(devp, "mpscintr"); - if (mpscintr_base == NULL) - goto err_out; - - n = getprop(devp, "cell-index", &v, sizeof(v)); - if (n != sizeof(v)) - goto err_out; - reg_set = (int)v; - - mpscintr_base += (reg_set == 0) ? 0x4 : 0xc; - - /* Make sure the mpsc ctlrs are shutdown */ - out_le32((u32 *)(mpscintr_base + MPSC_INTR_CAUSE), 0); - out_le32((u32 *)(mpscintr_base + MPSC_INTR_CAUSE), 0); - out_le32((u32 *)(mpscintr_base + MPSC_INTR_MASK), 0); - out_le32((u32 *)(mpscintr_base + MPSC_INTR_MASK), 0); - - mpsc_stop_dma(sdma_base); - - scdp->open = mpsc_open; - scdp->putc = mpsc_putc; - scdp->getc = mpsc_getc; - scdp->tstc = mpsc_tstc; - scdp->close = NULL; - - return 0; - -err_out: - return -1; -} diff --git a/arch/powerpc/boot/ops.h b/arch/powerpc/boot/ops.h index fad1862f4b2d..cd043726ed88 100644 --- a/arch/powerpc/boot/ops.h +++ b/arch/powerpc/boot/ops.h @@ -86,7 +86,6 @@ void start(void); void fdt_init(void *blob); int serial_console_init(void); int ns16550_console_init(void *devp, struct serial_console_data *scdp); -int mpsc_console_init(void *devp, struct serial_console_data *scdp); int cpm_console_init(void *devp, struct serial_console_data *scdp); int mpc5200_psc_console_init(void *devp, struct serial_console_data *scdp); int uartlite_console_init(void *devp, struct serial_console_data *scdp); diff --git a/arch/powerpc/boot/serial.c b/arch/powerpc/boot/serial.c index 88955095ec07..48e3743faedf 100644 --- a/arch/powerpc/boot/serial.c +++ b/arch/powerpc/boot/serial.c @@ -120,10 +120,6 @@ int serial_console_init(void) if (dt_is_compatible(devp, "ns16550") || dt_is_compatible(devp, "pnpPNP,501")) rc = ns16550_console_init(devp, &serial_cd); -#ifdef CONFIG_EMBEDDED6xx - else if (dt_is_compatible(devp, "marvell,mv64360-mpsc")) - rc = mpsc_console_init(devp, &serial_cd); -#endif #ifdef CONFIG_CPM else if (dt_is_compatible(devp, "fsl,cpm1-scc-uart") || dt_is_compatible(devp, "fsl,cpm1-smc-uart") || -- 2.16.2