From patchwork Fri Sep 11 12:40:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 1362415 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=2NhmaPo+; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=ddh25YuX; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BnwNn0lfBz9sTS for ; Fri, 11 Sep 2020 22:41:29 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=JQneEMWOPetm6q8V+zLbNFAx94G+erhl447ngglqKOw=; b=2NhmaPo+rdyL04Uwq2QdZ0cwcK kwnrJBtFwGNvAE7tAaMXBS8VsWC8f4VdjJi3COCidI3ZSIJlYQV2qhMzLVh98MluSKbpqcppAodP3 41Bba7Va9tau6iKYK2d7mO8+ojiJomnK6E/bTO3gMwA0rcEK/jBfAcUjw1WJ5uvhbYyO7qVdY5xAJ 5dVs9J1IvIBCmRiWi9X7+ApxIP48Sz8hgUwduZofoQh91eeZrWn81KVoWm/Wtc8c0fy+2FlO4UTqG m3n+U3KTQ1IzmUF8SHxOqQyAsYa5W/FNhL4vG/BkjxAo7l2Ksp08HIGZ9vtJiB2+3ELTfgw+1S5jR vDYYMWpw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGiMV-0003gM-V2; Fri, 11 Sep 2020 12:41:07 +0000 Received: from mail-qt1-x833.google.com ([2607:f8b0:4864:20::833]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGiMP-0003eO-Br for linux-arm-kernel@lists.infradead.org; Fri, 11 Sep 2020 12:41:02 +0000 Received: by mail-qt1-x833.google.com with SMTP id k25so7693617qtu.4 for ; Fri, 11 Sep 2020 05:41:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YScv+n3jHyanBTcLWdsLrqrbsLCwT+U6JshYGUhi5x4=; b=ddh25YuXH3dI0SQXVuzIqWriIE7sCQ7TlQyYWcwwhjY86PMfhjvQF92HGWyb7gtjJY 2ModqKU63SkRIycqO77dv+Hcex8FV/pE0iJlrIgopu2i2TSYGpe5TDZH8PIGgRggXhQV T5UUd5ILX/q8Rv4khp+6WQFtVHTUUX3AeXx8UBcCF9HThByAML1/1uolGkvTQGt97fCN 4VleDjEgrAPoytYTzMn+bQ+8BYQ+MCQSVuiprrc23jfYun0RkM2p4kKOd92S5prr5xX9 U8I9d7YuULvVQnT2O0GP2EsH38Vj6Duj7YFznzSU3RdtCwhKG28LFZSR4gT7s+47Lnhk Dz/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YScv+n3jHyanBTcLWdsLrqrbsLCwT+U6JshYGUhi5x4=; b=fZBLZNZmaihAQXWo4F2FK75wuSqcwYwwTYuuBsNQ8BgOz/I8jgAvJYMz3upvpG/E6m N0bYuqCvR46vXGXEr4vO31MmSthtkUmzP+GM38JYBKXdPTQuIYhhNxqt6c0qhxsyxPFy 7563iWLdP77eLTxWfS2BR+lpijH4EHSCE2fGlaF3h4w9Tq4IwZgvI/YfP1Uyi0BznsFv L0Jid3DmCKo91nHjmRsD72Mzk68jFvQgbWLhqI5kKlsb2o9lpXEH6o7VhrRmHI+G/VDC dOEkNz2l5/dDaok/ATmzeZBsas/MPURnlpTUyvtInopZFt7xoKEJC3ucYHWwe/Mo8Jbt voCQ== X-Gm-Message-State: AOAM533YbfPbB1nqQEMR6RoL9/o34xy78fNbIRJIGEafs5qbozD0bjca osuAs3n2Rn11HFxB6UzVKCE= X-Google-Smtp-Source: ABdhPJx9XyoRb1+UIT+KTD0kTu2PZJ1Rj63yVNHqVzbs7Y7SuxLsoa2eFx1fGe+2OazcRdlSI9/IpA== X-Received: by 2002:aed:37c3:: with SMTP id j61mr1680951qtb.11.1599828059314; Fri, 11 Sep 2020 05:40:59 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:482:640:e918:537:c362:6060]) by smtp.gmail.com with ESMTPSA id c13sm2343931qtq.5.2020.09.11.05.40.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 05:40:58 -0700 (PDT) From: Fabio Estevam To: shawnguo@kernel.org Subject: [PATCH 2/9] ARM: imx27: Remove iomux-v1 board code Date: Fri, 11 Sep 2020 09:40:27 -0300 Message-Id: <20200911124034.6792-3-festevam@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200911124034.6792-1-festevam@gmail.com> References: <20200911124034.6792-1-festevam@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200911_084101_446687_93DD63ED X-CRM114-Status: GOOD ( 19.53 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:833 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [festevam[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, Fabio Estevam , arnd@arndb.de, linux-imx@nxp.com, kernel@pengutronix.de MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org IMX_HAVE_IOMUX_V1 was only used by i.MX27 board files. Since the board files users are gone, it is safe to remove iomux-v1 related code. Signed-off-by: Fabio Estevam --- arch/arm/mach-imx/Kconfig | 4 - arch/arm/mach-imx/Makefile | 1 - arch/arm/mach-imx/iomux-v1.c | 174 ----------------------------------- arch/arm/mach-imx/mm-imx27.c | 4 - 4 files changed, 183 deletions(-) delete mode 100644 arch/arm/mach-imx/iomux-v1.c diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index c23e10fa8242..138c5344f2f2 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig @@ -47,9 +47,6 @@ config HAVE_IMX_SRC def_bool y if SMP select ARCH_HAS_RESET_CONTROLLER -config IMX_HAVE_IOMUX_V1 - bool - config ARCH_MXC_IOMUX_V3 bool @@ -99,7 +96,6 @@ config SOC_IMX25 config SOC_IMX27 bool "i.MX27 support" - select IMX_HAVE_IOMUX_V1 select CPU_ARM926T select MXC_AVIC select PINCTRL_IMX27 diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile index ca35d3e4cab4..7fe3060c300e 100644 --- a/arch/arm/mach-imx/Makefile +++ b/arch/arm/mach-imx/Makefile @@ -11,7 +11,6 @@ obj-$(CONFIG_SOC_IMX35) += mm-imx3.o cpu-imx35.o mach-imx35.o imx5-pm-$(CONFIG_PM) += pm-imx5.o obj-$(CONFIG_SOC_IMX5) += cpu-imx5.o $(imx5-pm-y) -obj-$(CONFIG_IMX_HAVE_IOMUX_V1) += iomux-v1.o obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o obj-$(CONFIG_MXC_TZIC) += tzic.o diff --git a/arch/arm/mach-imx/iomux-v1.c b/arch/arm/mach-imx/iomux-v1.c deleted file mode 100644 index a4bec3b9b2b3..000000000000 --- a/arch/arm/mach-imx/iomux-v1.c +++ /dev/null @@ -1,174 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * arch/arm/plat-mxc/iomux-v1.c - * - * Copyright (C) 2004 Sascha Hauer, Synertronixx GmbH - * Copyright (C) 2009 Uwe Kleine-Koenig, Pengutronix - * - * Common code for i.MX1, i.MX21 and i.MX27 - */ - -#include -#include -#include -#include -#include -#include - -#include - -#include "hardware.h" -#include "iomux-v1.h" - -static void __iomem *imx_iomuxv1_baseaddr; -static unsigned imx_iomuxv1_numports; - -static inline unsigned long imx_iomuxv1_readl(unsigned offset) -{ - return imx_readl(imx_iomuxv1_baseaddr + offset); -} - -static inline void imx_iomuxv1_writel(unsigned long val, unsigned offset) -{ - imx_writel(val, imx_iomuxv1_baseaddr + offset); -} - -static inline void imx_iomuxv1_rmwl(unsigned offset, - unsigned long mask, unsigned long value) -{ - unsigned long reg = imx_iomuxv1_readl(offset); - - reg &= ~mask; - reg |= value; - - imx_iomuxv1_writel(reg, offset); -} - -static inline void imx_iomuxv1_set_puen( - unsigned int port, unsigned int pin, int on) -{ - unsigned long mask = 1 << pin; - - imx_iomuxv1_rmwl(MXC_PUEN(port), mask, on ? mask : 0); -} - -static inline void imx_iomuxv1_set_ddir( - unsigned int port, unsigned int pin, int out) -{ - unsigned long mask = 1 << pin; - - imx_iomuxv1_rmwl(MXC_DDIR(port), mask, out ? mask : 0); -} - -static inline void imx_iomuxv1_set_gpr( - unsigned int port, unsigned int pin, int af) -{ - unsigned long mask = 1 << pin; - - imx_iomuxv1_rmwl(MXC_GPR(port), mask, af ? mask : 0); -} - -static inline void imx_iomuxv1_set_gius( - unsigned int port, unsigned int pin, int inuse) -{ - unsigned long mask = 1 << pin; - - imx_iomuxv1_rmwl(MXC_GIUS(port), mask, inuse ? mask : 0); -} - -static inline void imx_iomuxv1_set_ocr( - unsigned int port, unsigned int pin, unsigned int ocr) -{ - unsigned long shift = (pin & 0xf) << 1; - unsigned long mask = 3 << shift; - unsigned long value = ocr << shift; - unsigned long offset = pin < 16 ? MXC_OCR1(port) : MXC_OCR2(port); - - imx_iomuxv1_rmwl(offset, mask, value); -} - -static inline void imx_iomuxv1_set_iconfa( - unsigned int port, unsigned int pin, unsigned int aout) -{ - unsigned long shift = (pin & 0xf) << 1; - unsigned long mask = 3 << shift; - unsigned long value = aout << shift; - unsigned long offset = pin < 16 ? MXC_ICONFA1(port) : MXC_ICONFA2(port); - - imx_iomuxv1_rmwl(offset, mask, value); -} - -static inline void imx_iomuxv1_set_iconfb( - unsigned int port, unsigned int pin, unsigned int bout) -{ - unsigned long shift = (pin & 0xf) << 1; - unsigned long mask = 3 << shift; - unsigned long value = bout << shift; - unsigned long offset = pin < 16 ? MXC_ICONFB1(port) : MXC_ICONFB2(port); - - imx_iomuxv1_rmwl(offset, mask, value); -} - -int mxc_gpio_mode(int gpio_mode) -{ - unsigned int pin = gpio_mode & GPIO_PIN_MASK; - unsigned int port = (gpio_mode & GPIO_PORT_MASK) >> GPIO_PORT_SHIFT; - unsigned int ocr = (gpio_mode & GPIO_OCR_MASK) >> GPIO_OCR_SHIFT; - unsigned int aout = (gpio_mode >> GPIO_AOUT_SHIFT) & 3; - unsigned int bout = (gpio_mode >> GPIO_BOUT_SHIFT) & 3; - - if (port >= imx_iomuxv1_numports) - return -EINVAL; - - /* Pullup enable */ - imx_iomuxv1_set_puen(port, pin, gpio_mode & GPIO_PUEN); - - /* Data direction */ - imx_iomuxv1_set_ddir(port, pin, gpio_mode & GPIO_OUT); - - /* Primary / alternate function */ - imx_iomuxv1_set_gpr(port, pin, gpio_mode & GPIO_AF); - - /* use as gpio? */ - imx_iomuxv1_set_gius(port, pin, !(gpio_mode & (GPIO_PF | GPIO_AF))); - - imx_iomuxv1_set_ocr(port, pin, ocr); - - imx_iomuxv1_set_iconfa(port, pin, aout); - - imx_iomuxv1_set_iconfb(port, pin, bout); - - return 0; -} - -static int imx_iomuxv1_setup_multiple(const int *list, unsigned count) -{ - size_t i; - int ret = 0; - - for (i = 0; i < count; ++i) { - ret = mxc_gpio_mode(list[i]); - - if (ret) - return ret; - } - - return ret; -} - -int mxc_gpio_setup_multiple_pins(const int *pin_list, unsigned count, - const char *label) -{ - int ret; - - ret = imx_iomuxv1_setup_multiple(pin_list, count); - return ret; -} - -int __init imx_iomuxv1_init(void __iomem *base, int numports) -{ - imx_iomuxv1_baseaddr = base; - imx_iomuxv1_numports = numports; - - return 0; -} diff --git a/arch/arm/mach-imx/mm-imx27.c b/arch/arm/mach-imx/mm-imx27.c index caf1da1754f6..17345066b043 100644 --- a/arch/arm/mach-imx/mm-imx27.c +++ b/arch/arm/mach-imx/mm-imx27.c @@ -7,13 +7,11 @@ #include #include -#include #include #include "common.h" #include "devices/devices-common.h" #include "hardware.h" -#include "iomux-v1.h" /* MX27 memory map definition */ static struct map_desc imx27_io_desc[] __initdata = { @@ -52,8 +50,6 @@ void __init mx27_map_io(void) void __init imx27_init_early(void) { mxc_set_cpu_type(MXC_CPU_MX27); - imx_iomuxv1_init(MX27_IO_ADDRESS(MX27_GPIO_BASE_ADDR), - MX27_NUM_GPIO_PORT); } void __init mx27_init_irq(void)