From patchwork Thu Aug 6 18:20:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 257442 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4EE62C433E0 for ; Thu, 6 Aug 2020 18:33:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 716A52312F for ; Thu, 6 Aug 2020 18:33:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596738807; bh=gWYszA3rqYV5erGGQ6aQA0zIEaoB7n1mGCk9zgFoZXI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=aCk7yYHa04VbU2pe6fKIi2WY9uM3De0DgsIPGiUUgNqHnZsrxwtLDBwvZn6wxrg+9 ItCfd+ZNIVaBlNugoQzoV1wClOs+vgHu/jwqzhW67+3W0gSW0WvB8Z1U2FinmFeox4 7yWTwsVM9Af4d714phEZFmAPtDXCp+5DmatSm+bI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728664AbgHFSdY (ORCPT ); Thu, 6 Aug 2020 14:33:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726420AbgHFSdT (ORCPT ); Thu, 6 Aug 2020 14:33:19 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66730C0617A2 for ; Thu, 6 Aug 2020 11:33:19 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id f12so9099348wru.13 for ; Thu, 06 Aug 2020 11:33:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:resent-from:resent-date:resent-message-id :resent-to:dkim-signature:from:to:cc:subject:date:message-id :in-reply-to:references; bh=aQVJ5KQArHQc1uqs172CvIl42cGAzuVE1S+Y7bN0gvo=; b=ccHwI3y/UuMg6IwJzGZakGbM5AmMPgxNOc7Yj1rwo0aEE/W5R/z1ZSdl9jKCpK7tGq LP9CRWAYs3MXj9EuwMJDfa/f4FWTgYhGAmd4STOurSCCc/nq4jCq646GbCUXBnto3+cI aVMJLWL1qpVWn04s4Uqsro1HXIuJI1R/zyO2WFheN4ZXodgxduL6vSMXWf7qzZhVJLMl ieorIZltT/VMCDXckJLntNIxtK/vGvlnliBfy/PysjVj7NK+BmCgMwqlT6BZN1t/IMMf 3Ia8gPmVBxxhkKfTkZvKQ7EGYhOdR+SMAzrWntkATOXOEZtjC/3hbfVYG3cEg+EgxUsA K9gA== X-Gm-Message-State: AOAM530urCeSclafjG5hyUBczmdmfIF62qoP0S4i/vhL7IUgGn/KaRLv S1SbG+uXRDRoy18dO8xDtzBfUg/nMbo= X-Google-Smtp-Source: ABdhPJz147uPnl66XM/bgOzKVSVuhqhnKdDW8RKipouCPhKYEE1HqI/DPXwbXMs4ctc035fnZ59muA== X-Received: by 2002:a5d:550e:: with SMTP id b14mr9168703wrv.392.1596738796222; Thu, 06 Aug 2020 11:33:16 -0700 (PDT) Received: from kozik-lap ([194.230.155.117]) by smtp.googlemail.com with ESMTPSA id h14sm7149334wml.30.2020.08.06.11.33.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Aug 2020 11:33:15 -0700 (PDT) Received: by 2002:ab3:1105:0:0:0:0:0 with SMTP id j5csp1540153lta; Thu, 6 Aug 2020 11:21:12 -0700 (PDT) X-Received: by 2002:a65:48c1:: with SMTP id o1mr7897316pgs.83.1596738071781; Thu, 06 Aug 2020 11:21:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596738071; cv=none; d=google.com; s=arc-20160816; b=Gen2pBLG93UxYwE/lhcU2MxsiiMTYwoi09Yc4wUmly7ZMwPqynSlF4qDzpA8cJf2u6 dNkuXNkUeuMe8J5Ex5q43RIF6CKf5Is+E9YkTyoL5H61SMrwB6b00xgTjVIK2QVNccZN BqHMQR0Tcy9QgnZgYBLvUhJ40X9TVC8dH7vgZA4vTMDhIgZUEum64TPGvg5KKL1VA0DT c8JydeuipXpubJRzAeikushFxU/0rj8zsHCJaqFopiny00pMn37gh4yEO5qQETM0PufP elpldAb2V1h6KJrmAsrojfypkGY3r/b4enIQSeUS4K1x2tDbMSJZnTnr/6oUEFiEPIvp xEOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to; bh=aQVJ5KQArHQc1uqs172CvIl42cGAzuVE1S+Y7bN0gvo=; b=tgCY6TVxIQjmL3pdfT+jxVhyhbeKakTIAi3ofar1JLrYuHSO0ERnuMj1ZU6PQS9wsf v7M62vzih+MMJPbH7xNt3qLbgco+l7eiLXAn4XV7sGgStVf57SBs7I2MniZu3ovyLyuI L+OHC1jIp79rITwI6R8Q/ekP5LYp/b6smAgmdr1nmxach/45t8f6Qp4SUT6q0/YDIqda j/xrN7oROhBwj5gzZzR2noVcVyaxx8o2bL3jkQONtgtLUNcpuBuxV2MrohZHViCiCUA9 6EnbB6nUsZNzusodJfpbAN3/7jhjiiYjhmbuvPDLHyFf+kVM9rH4lPTLUqTr7fC1sstO y6cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AIR9gMTO; spf=pass (google.com: domain of krzk@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=krzk@kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from mail.kernel.org (mail.kernel.org. [198.145.29.99]) by mx.google.com with ESMTPS id l20si4058421plb.229.2020.08.06.11.21.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Aug 2020 11:21:11 -0700 (PDT) Received-SPF: pass (google.com: domain of krzk@kernel.org designates 198.145.29.99 as permitted sender) client-ip=198.145.29.99; Received: by mail.kernel.org (Postfix) id A925422CE3; Thu, 6 Aug 2020 18:21:11 +0000 (UTC) Received: from localhost.localdomain (unknown [194.230.155.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 43C5322CBB; Thu, 6 Aug 2020 18:21:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596738071; bh=gWYszA3rqYV5erGGQ6aQA0zIEaoB7n1mGCk9zgFoZXI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AIR9gMTObfVKOk1mNw4+1PtKpiDvpZD872ty8wZ52lKCqk+nchkm9FWjkDoLRb9SX 7oL2+EA4FLv9a3eLDkmMfSGrvp10LYrRawaish4kA220msiXFBhp8ekOrFAnl1k20s LCbmZGqoUOJNWT+pwqSMFKXeRUs1YZk9n6G0751c= From: Krzysztof Kozlowski To: linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Krzysztof Kozlowski , Russell King , Maxime Coquelin , Alexandre Torgue , Kukjin Kim , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 01/41] ARM: s3c: Remove unneeded machine header includes Date: Thu, 6 Aug 2020 20:20:18 +0200 Message-Id: <20200806182059.2431-1-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200806181932.2253-1-krzk@kernel.org> References: <20200806181932.2253-1-krzk@kernel.org> X-TUID: ZwOYwYqP7My/ Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Not all units use the contents of mach/hardware.h and mach/dma.h. Remove these includes when not needed. Signed-off-by: Krzysztof Kozlowski --- arch/arm/mach-s3c24xx/bast-irq.c | 1 - arch/arm/mach-s3c24xx/common-smdk.c | 1 - arch/arm/mach-s3c24xx/h1940-bluetooth.c | 1 - arch/arm/mach-s3c24xx/mach-amlm5900.c | 1 - arch/arm/mach-s3c24xx/mach-anubis.c | 1 - arch/arm/mach-s3c24xx/mach-at2440evb.c | 1 - arch/arm/mach-s3c24xx/mach-bast.c | 1 - arch/arm/mach-s3c24xx/mach-gta02.c | 1 - arch/arm/mach-s3c24xx/mach-mini2440.c | 1 - arch/arm/mach-s3c24xx/mach-nexcoder.c | 1 - arch/arm/mach-s3c24xx/mach-osiris.c | 1 - arch/arm/mach-s3c24xx/mach-otom.c | 1 - arch/arm/mach-s3c24xx/mach-qt2410.c | 1 - arch/arm/mach-s3c24xx/mach-rx3715.c | 1 - arch/arm/mach-s3c24xx/mach-smdk2410.c | 1 - arch/arm/mach-s3c24xx/mach-smdk2440.c | 1 - arch/arm/mach-s3c24xx/mach-smdk2443.c | 1 - arch/arm/mach-s3c24xx/mach-tct_hammer.c | 1 - arch/arm/mach-s3c24xx/mach-vr1000.c | 1 - arch/arm/mach-s3c24xx/mach-vstms.c | 1 - arch/arm/mach-s3c24xx/pm-s3c2410.c | 1 - arch/arm/mach-s3c24xx/pm-s3c2412.c | 1 - arch/arm/mach-s3c24xx/s3c2440.c | 1 - arch/arm/mach-s3c24xx/s3c2442.c | 1 - arch/arm/mach-s3c24xx/setup-i2c.c | 1 - arch/arm/mach-s3c24xx/setup-ts.c | 1 - arch/arm/mach-s3c24xx/simtec-audio.c | 1 - arch/arm/mach-s3c24xx/simtec-pm.c | 2 -- arch/arm/mach-s3c24xx/simtec-usb.c | 1 - arch/arm/mach-s3c64xx/dev-audio.c | 1 - arch/arm/plat-samsung/devs.c | 1 - 31 files changed, 32 deletions(-) diff --git a/arch/arm/mach-s3c24xx/bast-irq.c b/arch/arm/mach-s3c24xx/bast-irq.c index 03728058d58d..03209fefa5db 100644 --- a/arch/arm/mach-s3c24xx/bast-irq.c +++ b/arch/arm/mach-s3c24xx/bast-irq.c @@ -15,7 +15,6 @@ #include #include -#include #include #include "bast.h" diff --git a/arch/arm/mach-s3c24xx/common-smdk.c b/arch/arm/mach-s3c24xx/common-smdk.c index 75064dfaceb1..c0c176651f96 100644 --- a/arch/arm/mach-s3c24xx/common-smdk.c +++ b/arch/arm/mach-s3c24xx/common-smdk.c @@ -29,7 +29,6 @@ #include #include -#include #include #include diff --git a/arch/arm/mach-s3c24xx/h1940-bluetooth.c b/arch/arm/mach-s3c24xx/h1940-bluetooth.c index 186b5321658e..8533e7521b50 100644 --- a/arch/arm/mach-s3c24xx/h1940-bluetooth.c +++ b/arch/arm/mach-s3c24xx/h1940-bluetooth.c @@ -14,7 +14,6 @@ #include #include -#include #include #include diff --git a/arch/arm/mach-s3c24xx/mach-amlm5900.c b/arch/arm/mach-s3c24xx/mach-amlm5900.c index 623c320f8253..6324e608dcda 100644 --- a/arch/arm/mach-s3c24xx/mach-amlm5900.c +++ b/arch/arm/mach-s3c24xx/mach-amlm5900.c @@ -26,7 +26,6 @@ #include #include -#include #include #include #include diff --git a/arch/arm/mach-s3c24xx/mach-anubis.c b/arch/arm/mach-s3c24xx/mach-anubis.c index 44338dfb5470..753a314f4493 100644 --- a/arch/arm/mach-s3c24xx/mach-anubis.c +++ b/arch/arm/mach-s3c24xx/mach-anubis.c @@ -24,7 +24,6 @@ #include #include -#include #include #include diff --git a/arch/arm/mach-s3c24xx/mach-at2440evb.c b/arch/arm/mach-s3c24xx/mach-at2440evb.c index 02ac2e240bd7..6da4dcfd5c0f 100644 --- a/arch/arm/mach-s3c24xx/mach-at2440evb.c +++ b/arch/arm/mach-s3c24xx/mach-at2440evb.c @@ -24,7 +24,6 @@ #include #include -#include #include #include #include diff --git a/arch/arm/mach-s3c24xx/mach-bast.c b/arch/arm/mach-s3c24xx/mach-bast.c index cd67d00a46e4..9eef0f80175f 100644 --- a/arch/arm/mach-s3c24xx/mach-bast.c +++ b/arch/arm/mach-s3c24xx/mach-bast.c @@ -41,7 +41,6 @@ #include #include -#include #include #include #include diff --git a/arch/arm/mach-s3c24xx/mach-gta02.c b/arch/arm/mach-s3c24xx/mach-gta02.c index 81d94a75d1c2..346a158f9960 100644 --- a/arch/arm/mach-s3c24xx/mach-gta02.c +++ b/arch/arm/mach-s3c24xx/mach-gta02.c @@ -58,7 +58,6 @@ #include #include -#include #include #include #include diff --git a/arch/arm/mach-s3c24xx/mach-mini2440.c b/arch/arm/mach-s3c24xx/mach-mini2440.c index 936f7e3b7213..5bfe9ef62716 100644 --- a/arch/arm/mach-s3c24xx/mach-mini2440.c +++ b/arch/arm/mach-s3c24xx/mach-mini2440.c @@ -30,7 +30,6 @@ #include #include -#include #include #include diff --git a/arch/arm/mach-s3c24xx/mach-nexcoder.c b/arch/arm/mach-s3c24xx/mach-nexcoder.c index 92ecc15c4320..5385437ef464 100644 --- a/arch/arm/mach-s3c24xx/mach-nexcoder.c +++ b/arch/arm/mach-s3c24xx/mach-nexcoder.c @@ -28,7 +28,6 @@ #include #include -#include #include #include diff --git a/arch/arm/mach-s3c24xx/mach-osiris.c b/arch/arm/mach-s3c24xx/mach-osiris.c index ed03928dffe4..03595144126b 100644 --- a/arch/arm/mach-s3c24xx/mach-osiris.c +++ b/arch/arm/mach-s3c24xx/mach-osiris.c @@ -41,7 +41,6 @@ #include #include -#include #include #include #include diff --git a/arch/arm/mach-s3c24xx/mach-otom.c b/arch/arm/mach-s3c24xx/mach-otom.c index d65c65ca1a38..e7eec5ccddb3 100644 --- a/arch/arm/mach-s3c24xx/mach-otom.c +++ b/arch/arm/mach-s3c24xx/mach-otom.c @@ -22,7 +22,6 @@ #include #include -#include #include #include diff --git a/arch/arm/mach-s3c24xx/mach-qt2410.c b/arch/arm/mach-s3c24xx/mach-qt2410.c index 2f3c8b31a08a..4ac3d0531992 100644 --- a/arch/arm/mach-s3c24xx/mach-qt2410.c +++ b/arch/arm/mach-s3c24xx/mach-qt2410.c @@ -28,7 +28,6 @@ #include #include -#include #include #include diff --git a/arch/arm/mach-s3c24xx/mach-rx3715.c b/arch/arm/mach-s3c24xx/mach-rx3715.c index 740865ef8e23..617392de01ac 100644 --- a/arch/arm/mach-s3c24xx/mach-rx3715.c +++ b/arch/arm/mach-s3c24xx/mach-rx3715.c @@ -35,7 +35,6 @@ #include #include -#include #include #include #include diff --git a/arch/arm/mach-s3c24xx/mach-smdk2410.c b/arch/arm/mach-s3c24xx/mach-smdk2410.c index 1c2f20ab0520..1d4d8735f283 100644 --- a/arch/arm/mach-s3c24xx/mach-smdk2410.c +++ b/arch/arm/mach-s3c24xx/mach-smdk2410.c @@ -24,7 +24,6 @@ #include #include -#include #include #include diff --git a/arch/arm/mach-s3c24xx/mach-smdk2440.c b/arch/arm/mach-s3c24xx/mach-smdk2440.c index ebc184cd9aba..bd6a35105518 100644 --- a/arch/arm/mach-s3c24xx/mach-smdk2440.c +++ b/arch/arm/mach-s3c24xx/mach-smdk2440.c @@ -23,7 +23,6 @@ #include #include -#include #include #include diff --git a/arch/arm/mach-s3c24xx/mach-smdk2443.c b/arch/arm/mach-s3c24xx/mach-smdk2443.c index dcc4e446938a..8a1f2580c6c7 100644 --- a/arch/arm/mach-s3c24xx/mach-smdk2443.c +++ b/arch/arm/mach-s3c24xx/mach-smdk2443.c @@ -22,7 +22,6 @@ #include #include -#include #include #include diff --git a/arch/arm/mach-s3c24xx/mach-tct_hammer.c b/arch/arm/mach-s3c24xx/mach-tct_hammer.c index e334ddf0832f..fd51a098e443 100644 --- a/arch/arm/mach-s3c24xx/mach-tct_hammer.c +++ b/arch/arm/mach-s3c24xx/mach-tct_hammer.c @@ -24,7 +24,6 @@ #include #include -#include #include #include diff --git a/arch/arm/mach-s3c24xx/mach-vr1000.c b/arch/arm/mach-s3c24xx/mach-vr1000.c index 2f00217fa44e..638e53ec1e4f 100644 --- a/arch/arm/mach-s3c24xx/mach-vr1000.c +++ b/arch/arm/mach-s3c24xx/mach-vr1000.c @@ -35,7 +35,6 @@ #include #include -#include #include #include diff --git a/arch/arm/mach-s3c24xx/mach-vstms.c b/arch/arm/mach-s3c24xx/mach-vstms.c index 9f479e28b8fd..f0acbaa6dfd6 100644 --- a/arch/arm/mach-s3c24xx/mach-vstms.c +++ b/arch/arm/mach-s3c24xx/mach-vstms.c @@ -24,7 +24,6 @@ #include #include -#include #include #include #include diff --git a/arch/arm/mach-s3c24xx/pm-s3c2410.c b/arch/arm/mach-s3c24xx/pm-s3c2410.c index 2d8ea701380a..ffd0d6c2324f 100644 --- a/arch/arm/mach-s3c24xx/pm-s3c2410.c +++ b/arch/arm/mach-s3c24xx/pm-s3c2410.c @@ -16,7 +16,6 @@ #include -#include #include #include diff --git a/arch/arm/mach-s3c24xx/pm-s3c2412.c b/arch/arm/mach-s3c24xx/pm-s3c2412.c index 2dfdaab0aa1f..b1d0ad07301b 100644 --- a/arch/arm/mach-s3c24xx/pm-s3c2412.c +++ b/arch/arm/mach-s3c24xx/pm-s3c2412.c @@ -19,7 +19,6 @@ #include #include -#include #include #include diff --git a/arch/arm/mach-s3c24xx/s3c2440.c b/arch/arm/mach-s3c24xx/s3c2440.c index 451d9851b0a7..bbe1f9cf5cf0 100644 --- a/arch/arm/mach-s3c24xx/s3c2440.c +++ b/arch/arm/mach-s3c24xx/s3c2440.c @@ -23,7 +23,6 @@ #include #include -#include #include #include diff --git a/arch/arm/mach-s3c24xx/s3c2442.c b/arch/arm/mach-s3c24xx/s3c2442.c index 432d68325c9d..5b8751506d02 100644 --- a/arch/arm/mach-s3c24xx/s3c2442.c +++ b/arch/arm/mach-s3c24xx/s3c2442.c @@ -21,7 +21,6 @@ #include #include -#include #include #include #include diff --git a/arch/arm/mach-s3c24xx/setup-i2c.c b/arch/arm/mach-s3c24xx/setup-i2c.c index 1a01d44b5910..1be5372e0261 100644 --- a/arch/arm/mach-s3c24xx/setup-i2c.c +++ b/arch/arm/mach-s3c24xx/setup-i2c.c @@ -12,7 +12,6 @@ struct platform_device; #include #include -#include #include #include diff --git a/arch/arm/mach-s3c24xx/setup-ts.c b/arch/arm/mach-s3c24xx/setup-ts.c index 272d65400b71..65ec67e0759f 100644 --- a/arch/arm/mach-s3c24xx/setup-ts.c +++ b/arch/arm/mach-s3c24xx/setup-ts.c @@ -13,7 +13,6 @@ struct platform_device; /* don't need the contents */ #include #include -#include #include /** diff --git a/arch/arm/mach-s3c24xx/simtec-audio.c b/arch/arm/mach-s3c24xx/simtec-audio.c index 12e17f82dae3..cfe78bf8cc9b 100644 --- a/arch/arm/mach-s3c24xx/simtec-audio.c +++ b/arch/arm/mach-s3c24xx/simtec-audio.c @@ -12,7 +12,6 @@ #include #include -#include #include #include diff --git a/arch/arm/mach-s3c24xx/simtec-pm.c b/arch/arm/mach-s3c24xx/simtec-pm.c index c19074d81389..bc939dfce488 100644 --- a/arch/arm/mach-s3c24xx/simtec-pm.c +++ b/arch/arm/mach-s3c24xx/simtec-pm.c @@ -19,8 +19,6 @@ #include #include -#include - #include #include diff --git a/arch/arm/mach-s3c24xx/simtec-usb.c b/arch/arm/mach-s3c24xx/simtec-usb.c index dc1016ffed94..3488988316a8 100644 --- a/arch/arm/mach-s3c24xx/simtec-usb.c +++ b/arch/arm/mach-s3c24xx/simtec-usb.c @@ -23,7 +23,6 @@ #include #include -#include #include #include diff --git a/arch/arm/mach-s3c64xx/dev-audio.c b/arch/arm/mach-s3c64xx/dev-audio.c index e3c49b5d1355..1d3124db6afc 100644 --- a/arch/arm/mach-s3c64xx/dev-audio.c +++ b/arch/arm/mach-s3c64xx/dev-audio.c @@ -12,7 +12,6 @@ #include #include -#include #include #include diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c index 089a17687104..2ed3ef604a25 100644 --- a/arch/arm/plat-samsung/devs.c +++ b/arch/arm/plat-samsung/devs.c @@ -37,7 +37,6 @@ #include #include -#include #include #include From patchwork Thu Aug 6 18:20:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 247502 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1743128ilo; Thu, 6 Aug 2020 11:35:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxT6i0DvF71GZ37S3RLORGhLD2lb2v0e2GXBuK+R6/eB1faT/dUSs9pYgbG3ZbREdkmN64C X-Received: by 2002:a17:906:1e85:: with SMTP id e5mr5674410ejj.76.1596738953444; Thu, 06 Aug 2020 11:35:53 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rv7si3622798ejb.641.2020.08.06.11.35.53; Thu, 06 Aug 2020 11:35:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-samsung-soc-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=@kernel.org header.s=default header.b="P+Ms/qcK"; arc=fail (signature failed); spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727021AbgHFSfs (ORCPT + 4 others); Thu, 6 Aug 2020 14:35:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728574AbgHFSex (ORCPT ); Thu, 6 Aug 2020 14:34:53 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 683CAC06138D for ; Thu, 6 Aug 2020 11:34:51 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id z18so41378025wrm.12 for ; Thu, 06 Aug 2020 11:34:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:resent-from:resent-date:resent-message-id :resent-to:dkim-signature:from:to:cc:subject:date:message-id :in-reply-to:references; bh=l+Y4PAA9fdGSBBBW6oqoMtbOkO4wr96TBxesjGmzsTA=; b=ousxLHlYJl1gw2dtRvajuyLSF3JbJpjR97BqPFBc17X64higOHK9lMLjSW6aNdaZEY 5EcEKQWT0R79QqBIUIYKQHpUzicQzvUTFQX4jtAJ+RHN24Aq8U4hg71Cu2zi43e+Mad6 AjiIJbVP6WFLYwMeBx3eVnK44DMhhkuPNFSeiUIqHainZnXnxq/wZWA0KmGBRhV3yUHT WL3yUq+FYeGQ9OR7PRWmmNWMHkRmjTRrsAyHwpzJEPifTbrIzFOJ1GLY2hep0HlBi3lx TmZozvj5upKYto2y5+UfGBMh92lXH8Lock7S4y0gy41H2W3qIgiKjHyPML3avTmZxpOU Aopg== X-Gm-Message-State: AOAM5325E2JnBwVMuQLp2tOqIJSjLyE+TcEQBhSh68E7mLOS6JSEHTVA 2LiWC+z132tOJNddHxoAq4IgpbmzH9M= X-Received: by 2002:adf:c108:: with SMTP id r8mr9113243wre.41.1596738889739; Thu, 06 Aug 2020 11:34:49 -0700 (PDT) Received: from kozik-lap ([194.230.155.117]) by smtp.googlemail.com with ESMTPSA id v15sm7771100wrm.23.2020.08.06.11.34.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Aug 2020 11:34:49 -0700 (PDT) Received: by 2002:ab3:1105:0:0:0:0:0 with SMTP id j5csp1540624lta; Thu, 6 Aug 2020 11:21:54 -0700 (PDT) X-Received: by 2002:a65:608f:: with SMTP id t15mr7008343pgu.197.1596738113809; Thu, 06 Aug 2020 11:21:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596738113; cv=none; d=google.com; s=arc-20160816; b=I3Ohv+I4rX6FZxoBmHBszFPDD2x/nBpMDrx+v5NABFc8zwGd9+Hp1EP/TS0H/Jz7T+ mcfZwflwqPrN0pvjsKZ/TveBu9SEImlFXPHvLJKE3CYEVh3QcoDfekbLjHCiIMpnhV++ wyIsaZg+fU6fcQw2W+Uz4w0tZp5V/+cq2sgit71QwlJ3iyUO3CadxSYbpsEqYlWMjfv9 XioaZlZEaGZZxyyboU/+N5KQ2YvTSk+1m3O6CsDrA4FM76PZGUmhIUxcZoXtkGcUkOpJ NXg86r0mZrPmBZmVHb/4iQ/EcXVR/VHvGUkV6tToZJgBoCpXZ/7IVsjfbJ/Rcw2SCOv7 ztjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to; bh=l+Y4PAA9fdGSBBBW6oqoMtbOkO4wr96TBxesjGmzsTA=; b=AQpSYZlF5/4K+3j0wd8uHoolSe9+7AO64sWChMGzoaRPFHm4HHz4ylI4PeCOnhajnk zNTSZZVUOqBtSy4QPcV3y+C0R8zjl7baMmeIklvaFX4HTYrghETMvK+AaNg1LoQcJdZq Hqj9IgQes1axnhDd+p/8TndjFvSepB8eHw1+oQFQ1cFiXCrptyyhRo5Ta8hjsoei/y5+ 2iDkRq2I5HtwyPCR1zA+OkgPVIj6yxDFH7y7c3rPxGK+3rQFqpXOvRq9XT4wQMPww45s dsSRZnpaVJYXAvnHC0d2jgi/HOLLNVbveSdOXP9CrVCzFm0f9rvDvEzKHVQ3oa7KD4gA MGzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="P+Ms/qcK"; spf=pass (google.com: domain of krzk@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=krzk@kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from mail.kernel.org (mail.kernel.org. [198.145.29.99]) by mx.google.com with ESMTPS id bx1si3948901pjb.147.2020.08.06.11.21.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Aug 2020 11:21:53 -0700 (PDT) Received-SPF: pass (google.com: domain of krzk@kernel.org designates 198.145.29.99 as permitted sender) client-ip=198.145.29.99; Received: by mail.kernel.org (Postfix) id E308922CF7; Thu, 6 Aug 2020 18:21:53 +0000 (UTC) Received: from localhost.localdomain (unknown [194.230.155.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 89E5922CF6; Thu, 6 Aug 2020 18:21:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596738113; bh=b29MRqxgBIgA1mPnrXZBfnyrkbkNCjVraaT6UXOtfEc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P+Ms/qcKNO2G0FWOOgD//IvyVOPidSgAKCGv1rXKO4QNsR/Xl/94V1mjKVGuZOytZ Wbtxpv2tmyd6r9c0MhBnahAazeRFJkoNiLl/HofTWEm3/tluO7xSK+AnttSq4Ph+MD x53DMsu/ZjR/Mi0g1D+If0GHf1g/IYfWYy6F/cUQ= From: Krzysztof Kozlowski To: linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Krzysztof Kozlowski , Russell King , Ulf Hansson , Linus Walleij , linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 03/41] ARM: s3c24xx: fix mmc gpio lookup tables Date: Thu, 6 Aug 2020 20:20:20 +0200 Message-Id: <20200806182059.2431-3-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200806181932.2253-1-krzk@kernel.org> References: <20200806181932.2253-1-krzk@kernel.org> X-TUID: Qsznb6OG7Fgi Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Arnd Bergmann The gpio controller names differ between s3c24xx and s3c64xx, and it seems that these all got the wrong names, using GPx instead of GPIOx. Fixes: d2951dfa070d ("mmc: s3cmci: Use the slot GPIO descriptor") Signed-off-by: Arnd Bergmann Signed-off-by: Krzysztof Kozlowski --- arch/arm/mach-s3c24xx/mach-at2440evb.c | 2 +- arch/arm/mach-s3c24xx/mach-h1940.c | 4 ++-- arch/arm/mach-s3c24xx/mach-mini2440.c | 4 ++-- arch/arm/mach-s3c24xx/mach-n30.c | 4 ++-- arch/arm/mach-s3c24xx/mach-rx1950.c | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) -- 2.17.1 diff --git a/arch/arm/mach-s3c24xx/mach-at2440evb.c b/arch/arm/mach-s3c24xx/mach-at2440evb.c index 6da4dcfd5c0f..fe8f9f1bdc0a 100644 --- a/arch/arm/mach-s3c24xx/mach-at2440evb.c +++ b/arch/arm/mach-s3c24xx/mach-at2440evb.c @@ -141,7 +141,7 @@ static struct gpiod_lookup_table at2440evb_mci_gpio_table = { .dev_id = "s3c2410-sdi", .table = { /* Card detect S3C2410_GPG(10) */ - GPIO_LOOKUP("GPG", 10, "cd", GPIO_ACTIVE_LOW), + GPIO_LOOKUP("GPIOG", 10, "cd", GPIO_ACTIVE_LOW), { }, }, }; diff --git a/arch/arm/mach-s3c24xx/mach-h1940.c b/arch/arm/mach-s3c24xx/mach-h1940.c index c09f61d35d57..9c71472c939f 100644 --- a/arch/arm/mach-s3c24xx/mach-h1940.c +++ b/arch/arm/mach-s3c24xx/mach-h1940.c @@ -467,9 +467,9 @@ static struct gpiod_lookup_table h1940_mmc_gpio_table = { .dev_id = "s3c2410-sdi", .table = { /* Card detect S3C2410_GPF(5) */ - GPIO_LOOKUP("GPF", 5, "cd", GPIO_ACTIVE_LOW), + GPIO_LOOKUP("GPIOF", 5, "cd", GPIO_ACTIVE_LOW), /* Write protect S3C2410_GPH(8) */ - GPIO_LOOKUP("GPH", 8, "wp", GPIO_ACTIVE_LOW), + GPIO_LOOKUP("GPIOH", 8, "wp", GPIO_ACTIVE_LOW), { }, }, }; diff --git a/arch/arm/mach-s3c24xx/mach-mini2440.c b/arch/arm/mach-s3c24xx/mach-mini2440.c index 5bfe9ef62716..65f48094114e 100644 --- a/arch/arm/mach-s3c24xx/mach-mini2440.c +++ b/arch/arm/mach-s3c24xx/mach-mini2440.c @@ -242,9 +242,9 @@ static struct gpiod_lookup_table mini2440_mmc_gpio_table = { .dev_id = "s3c2410-sdi", .table = { /* Card detect S3C2410_GPG(8) */ - GPIO_LOOKUP("GPG", 8, "cd", GPIO_ACTIVE_LOW), + GPIO_LOOKUP("GPIOG", 8, "cd", GPIO_ACTIVE_LOW), /* Write protect S3C2410_GPH(8) */ - GPIO_LOOKUP("GPH", 8, "wp", GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("GPIOH", 8, "wp", GPIO_ACTIVE_HIGH), { }, }, }; diff --git a/arch/arm/mach-s3c24xx/mach-n30.c b/arch/arm/mach-s3c24xx/mach-n30.c index b9ceacfdd6ef..152f09242579 100644 --- a/arch/arm/mach-s3c24xx/mach-n30.c +++ b/arch/arm/mach-s3c24xx/mach-n30.c @@ -388,9 +388,9 @@ static struct gpiod_lookup_table n30_mci_gpio_table = { .dev_id = "s3c2410-sdi", .table = { /* Card detect S3C2410_GPF(1) */ - GPIO_LOOKUP("GPF", 1, "cd", GPIO_ACTIVE_LOW), + GPIO_LOOKUP("GPIOF", 1, "cd", GPIO_ACTIVE_LOW), /* Write protect S3C2410_GPG(10) */ - GPIO_LOOKUP("GPG", 10, "wp", GPIO_ACTIVE_LOW), + GPIO_LOOKUP("GPIOG", 10, "wp", GPIO_ACTIVE_LOW), { }, }, }; diff --git a/arch/arm/mach-s3c24xx/mach-rx1950.c b/arch/arm/mach-s3c24xx/mach-rx1950.c index c46fb6b9e11a..65440c39500e 100644 --- a/arch/arm/mach-s3c24xx/mach-rx1950.c +++ b/arch/arm/mach-s3c24xx/mach-rx1950.c @@ -570,9 +570,9 @@ static struct gpiod_lookup_table rx1950_mmc_gpio_table = { .dev_id = "s3c2410-sdi", .table = { /* Card detect S3C2410_GPF(5) */ - GPIO_LOOKUP("GPF", 5, "cd", GPIO_ACTIVE_LOW), + GPIO_LOOKUP("GPIOF", 5, "cd", GPIO_ACTIVE_LOW), /* Write protect S3C2410_GPH(8) */ - GPIO_LOOKUP("GPH", 8, "wp", GPIO_ACTIVE_LOW), + GPIO_LOOKUP("GPIOH", 8, "wp", GPIO_ACTIVE_LOW), { }, }, }; From patchwork Thu Aug 6 18:20:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 247532 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1747509ilo; Thu, 6 Aug 2020 11:42:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+IsAjVdHUcRCnCdUnq7b/VWf37nZzDXryHTg1qMwe+vb2rcKJ80+ch0BzvY5Q+5w3SLKv X-Received: by 2002:a17:906:dbf4:: with SMTP id yd20mr5628220ejb.369.1596739340611; Thu, 06 Aug 2020 11:42:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596739340; cv=none; d=google.com; s=arc-20160816; b=uk1V/rVCgmahuCdwDTwIe8akpK075g5qfIsnxyRaM5qxdmf/yMf7Fu0R84YSznVFAb flV0bGnFpmmeuQBRMkeACYuirNsJtgOmGu4cCdF9i25DvJtyJrCZ7vxJwmzeY/DONt89 nvaJTKoG+6DB+UB07OzG3qAYp34DYvv5xsYcvfWVjuCBgLOliLhPWE5QkW8T7YUhNcpC uoLiFBaPQH3WZMcKijrKV++6SzPPH4It48muvlF+QSOSQYrQ89qKAmsdxiUDx0/5tved hYLcwYTZvRLkFBYe4rY7wT1YuwiKTuM4OpbOmTfFc+KI8THNXGE7oZzhQkbNO3rjbyBE KFfw== ARC-Message-Signature: i=1; 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; bh=nElDFQA7t5lFRO8HlM6KpcLaUXMWt8Iv7WAcu6s5B9g=; b=XlNzgHK/6zV+k8Igs51o3ERgcxf1jlvNiBhElH8nUKE7llDdlXixQC8ql+7+Yi7y4X kh6zEsm3Gvuz1K/h+lkeRU+pV0Y2GHKGsDcvIeX70IbFaTIVE8Q1ntSZMY7r3Vh9lOKm xlYw6dM3/dy6M1hdKQEl1R/fxDOtuhVAndVxhoEEyH2RFsbhXlIen9f+QlhauwChmuRo It0TGhieHaO06dQgrR7ek4QLtypy8RrvtXRsbPDgBZ+Xxr2KP7JyeZ4MqE5hQDz3nImB mU5xg48JsukpIPZhe8cHwMF4kobjD7oeE8qjyK+ubbjhPKqciCzh1fXitzLu00mSP9SM qbwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=myqjfk5T; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g22si3756724ejd.159.2020.08.06.11.42.20; Thu, 06 Aug 2020 11:42:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-samsung-soc-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=@kernel.org header.s=default header.b=myqjfk5T; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729729AbgHFSl5 (ORCPT + 4 others); Thu, 6 Aug 2020 14:41:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:50238 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728279AbgHFSXb (ORCPT ); Thu, 6 Aug 2020 14:23:31 -0400 Received: from localhost.localdomain (unknown [194.230.155.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7680622CF7; Thu, 6 Aug 2020 18:21:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596738116; bh=jkHktbppRvONf+xJVWmfSCc2eQC8JATnpI2A2T7cDPw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=myqjfk5TqieOfDTqf9vLXeOC0RvfTRnK4oPV3KF2Mi25rXjpnyj89EYEB/pv3E6oD hX+zM779/ialBivqyBVc5q9adJbuO7yXflyYpaJyjYiFP0b4Ky4Q9mBCUgof7rc4uz lDAEWR85hJEmUil1JhdfzQKn8uqDhADiCt+ymd5c= From: Krzysztof Kozlowski To: linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Krzysztof Kozlowski , Russell King , Kukjin Kim , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 04/41] ARM: s3c24xx: iotiming: make functions static Date: Thu, 6 Aug 2020 20:20:21 +0200 Message-Id: <20200806182059.2431-4-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200806181932.2253-1-krzk@kernel.org> References: <20200806181932.2253-1-krzk@kernel.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Arnd Bergmann There are two functions in this file that are never called from anywhere else, so they should be static to allow the compiler to optimize it better and not pollute the global namespace. Signed-off-by: Arnd Bergmann Signed-off-by: Krzysztof Kozlowski --- arch/arm/mach-s3c24xx/iotiming-s3c2410.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/arch/arm/mach-s3c24xx/iotiming-s3c2410.c b/arch/arm/mach-s3c24xx/iotiming-s3c2410.c index 9f90aaf70bf3..39081c41958c 100644 --- a/arch/arm/mach-s3c24xx/iotiming-s3c2410.c +++ b/arch/arm/mach-s3c24xx/iotiming-s3c2410.c @@ -129,7 +129,7 @@ static unsigned int calc_0124(unsigned int cyc, unsigned long hclk_tns, return 0; } -int calc_tacp(unsigned int cyc, unsigned long hclk, unsigned long *v) +static int calc_tacp(unsigned int cyc, unsigned long hclk, unsigned long *v) { /* Currently no support for Tacp calculations. */ return 0; @@ -288,8 +288,8 @@ static unsigned int get_0124(unsigned long hclk_tns, * Given the BANKCON setting in @bt and the current frequency settings * in @cfg, update the cycle timing information. */ -void s3c2410_iotiming_getbank(struct s3c_cpufreq_config *cfg, - struct s3c2410_iobank_timing *bt) +static void s3c2410_iotiming_getbank(struct s3c_cpufreq_config *cfg, + struct s3c2410_iobank_timing *bt) { unsigned long bankcon = bt->bankcon; unsigned long hclk = cfg->freq.hclk_tns; From patchwork Thu Aug 6 18:20:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 247531 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1747268ilo; Thu, 6 Aug 2020 11:41:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8II3V4DotVrqcCmbaBGcQJiNrHfcWCqG85T9dUSxFKETcXs4pfMcLmn7dPLC25r73QrmP X-Received: by 2002:a17:906:f8d9:: with SMTP id lh25mr5927950ejb.458.1596739318952; Thu, 06 Aug 2020 11:41:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596739318; cv=none; d=google.com; s=arc-20160816; b=bEhvIagpJaRA3596/BA3merX9a6Vd3wFWWq/vgs0IlApMLKUybbL5r7RDDM1FgvlBP zPm8/ZJ+YOMEV3DMFDiwKkfN4uo20EJkfg4MZY6YVAuVC3Tt99oWxH/qsOhEExnCD/3K NsbNHTqapYUwUerW0UcF1MSND+I1U5x94VIG8yrGA6b3dI1JjmNZ22wo421OUCtgKhRR 6KdRK2UOsyUaR8R9tKRiUXLkRcBCalXJ2YZXQ+KuNLhHDCMBu7KpWWJcmf5JCGWKwy4d OT4XSXZHd5OxbJ0gALW+R3NK09pg34085SeErlliHyaulECfvplrkXKrxH+G2xGCO4hI qHMw== ARC-Message-Signature: i=1; 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; bh=5fmsOr+E0f7f7JxNMikB2FV6OPHFQ+GubGbLn2hnIOU=; b=B3CqND5iW2pFct8B9GOM7um52zrXKV3OHCMPGf12ySVHbdSonsRrGjrFWvHbJPiyAy KaJgqbjXHqMCUN9Uo6EeaBMqCKXrIJU8sDrKk8Dnd1pJnhw8dUKKFz5/OrKG0oloY/JL Ky9eMcjrMZfulwJIs+nCbhHzS71C372Vnu0xKkenUlNvGCehAy1lMrtEP33Y/Vpp5g8o 6obOOGH9BNJBuSnTKMM7yDywpJfmyHbL72EbGsNVQSCjroqoPRzP9PHRP7o9etpZyJ0L qmGUW2IRgzGRFaH8DniJLcThAPKN0qGj4Uqaj4WoNmHUV3stf1FZHLcWzbX34oHj2JHn MB6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=j35u3MXT; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l15si3582997edr.130.2020.08.06.11.41.58; Thu, 06 Aug 2020 11:41:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-samsung-soc-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=@kernel.org header.s=default header.b=j35u3MXT; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729806AbgHFSl5 (ORCPT + 4 others); Thu, 6 Aug 2020 14:41:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:50308 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728303AbgHFSXb (ORCPT ); Thu, 6 Aug 2020 14:23:31 -0400 Received: from localhost.localdomain (unknown [194.230.155.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7AE7622D00; Thu, 6 Aug 2020 18:21:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596738122; bh=NRxqjOGqoPFTWLmHKMktE6m1euhpzWseKiiSJ0AcWmo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j35u3MXT45QA/tPevvXazqEanrPD2LI2UfrNwXKhljiD/b9HapLDz+kRmx9VdG9or jdvh70v5fZf8gKQ3wdxNfY0TAzO+yjGzdD3Hxp1pnTSz1l76MtdSzNJRaIfZOw6nWN D486RGZpDRuSJIfYdpl4/beyb7K4z41bT2N6tDR4= From: Krzysztof Kozlowski To: linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Krzysztof Kozlowski , Russell King , Sylwester Nawrocki , Tomasz Figa , Chanwoo Choi , Michael Turquette , Stephen Boyd , Kukjin Kim , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org Subject: [PATCH v2 05/41] ARM: s3c24xx: make S3C24XX_MISCCR access indirect Date: Thu, 6 Aug 2020 20:20:22 +0200 Message-Id: <20200806182059.2431-5-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200806181932.2253-1-krzk@kernel.org> References: <20200806181932.2253-1-krzk@kernel.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Arnd Bergmann The clk driver uses both a function call into an exported platform file and a direct register access to a hardcoded virtual address for accessing the MISCCR register, both become are a problem for a multiplatform kernel because of the header file dependency. Make this an indirect function call through platform data instead. Signed-off-by: Arnd Bergmann Signed-off-by: Krzysztof Kozlowski --- arch/arm/mach-s3c24xx/common.c | 3 +++ drivers/clk/samsung/clk-s3c2410-dclk.c | 10 ++++------ 2 files changed, 7 insertions(+), 6 deletions(-) -- 2.17.1 Reviewed-by: Stephen Boyd diff --git a/arch/arm/mach-s3c24xx/common.c b/arch/arm/mach-s3c24xx/common.c index 0d55e88ee0a8..222238e8acbb 100644 --- a/arch/arm/mach-s3c24xx/common.c +++ b/arch/arm/mach-s3c24xx/common.c @@ -668,5 +668,8 @@ struct platform_device s3c2410_device_dclk = { .id = 0, .num_resources = ARRAY_SIZE(s3c2410_dclk_resource), .resource = s3c2410_dclk_resource, + .dev = { + .platform_data = s3c2410_modify_misccr, + }, }; #endif diff --git a/drivers/clk/samsung/clk-s3c2410-dclk.c b/drivers/clk/samsung/clk-s3c2410-dclk.c index 7dad9098e897..3e0f23e8ec21 100644 --- a/drivers/clk/samsung/clk-s3c2410-dclk.c +++ b/drivers/clk/samsung/clk-s3c2410-dclk.c @@ -14,10 +14,6 @@ #include #include "clk.h" -/* legacy access to misccr, until dt conversion is finished */ -#include -#include - #define MUX_DCLK0 0 #define MUX_DCLK1 1 #define DIV_DCLK0 2 @@ -52,6 +48,7 @@ struct s3c24xx_clkout { struct clk_hw hw; u32 mask; u8 shift; + unsigned int (*modify_misccr)(unsigned int clr, unsigned int chg); }; #define to_s3c24xx_clkout(_hw) container_of(_hw, struct s3c24xx_clkout, hw) @@ -62,7 +59,7 @@ static u8 s3c24xx_clkout_get_parent(struct clk_hw *hw) int num_parents = clk_hw_get_num_parents(hw); u32 val; - val = readl_relaxed(S3C24XX_MISCCR) >> clkout->shift; + val = clkout->modify_misccr(0, 0) >> clkout->shift; val >>= clkout->shift; val &= clkout->mask; @@ -76,7 +73,7 @@ static int s3c24xx_clkout_set_parent(struct clk_hw *hw, u8 index) { struct s3c24xx_clkout *clkout = to_s3c24xx_clkout(hw); - s3c2410_modify_misccr((clkout->mask << clkout->shift), + clkout->modify_misccr((clkout->mask << clkout->shift), (index << clkout->shift)); return 0; @@ -110,6 +107,7 @@ static struct clk_hw *s3c24xx_register_clkout(struct device *dev, clkout->shift = shift; clkout->mask = mask; clkout->hw.init = &init; + clkout->modify_misccr = dev->platform_data; ret = clk_hw_register(dev, &clkout->hw); if (ret) From patchwork Thu Aug 6 18:20:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 257431 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNWANTED_LANGUAGE_BODY, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BA7AC433E0 for ; Thu, 6 Aug 2020 18:42:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E4E8B221E2 for ; Thu, 6 Aug 2020 18:42:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596739341; bh=uTq56Rd/BLEMRLRt2a4oFDY8yngnlcDiHPMoyXV8GIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=JmU/lWoCsfEcRHzFc40xiOjgHTWyFS6o0hefk1Mvgw4SBJBoJA17KzfVL5EQSrlVp xD+CFVT0VsC+g7W3QC00pob9J2OFq2bxLdHLNRHWbk/b5cYcRp/RQ1oc6MmQistN/6 4xaIk6ye5Y6C7sCdtEGWRkc9andRZI3tJjPkQUvc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729551AbgHFSl5 (ORCPT ); Thu, 6 Aug 2020 14:41:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:51152 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728347AbgHFSXc (ORCPT ); Thu, 6 Aug 2020 14:23:32 -0400 Received: from localhost.localdomain (unknown [194.230.155.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 741DE22D02; Thu, 6 Aug 2020 18:22:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596738127; bh=uTq56Rd/BLEMRLRt2a4oFDY8yngnlcDiHPMoyXV8GIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r0ViwZBXaFQbX362Dpv2JFrMYMI5J1wOw2cwslKuXc+tZj/TKJXPBQXzjxka3jFE+ vZ8o27tl3/wsKhN5EVICaurW9DCiSzca4wy/PnhzernJs6DaORwPzdoPTlIg/04N7T uBt+HXxvWTPrOKwVHhjxAsYmwChdVeBMFhS9QdOc= From: Krzysztof Kozlowski To: linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Krzysztof Kozlowski , Russell King , Sylwester Nawrocki , Tomasz Figa , Chanwoo Choi , Michael Turquette , Stephen Boyd , Kukjin Kim , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org Subject: [PATCH v2 06/41] ARM: s3c24xx: pass pointer to clk driver via platform data Date: Thu, 6 Aug 2020 20:20:23 +0200 Message-Id: <20200806182059.2431-6-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200806181932.2253-1-krzk@kernel.org> References: <20200806181932.2253-1-krzk@kernel.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Passing pointers directly as platform data is fragile and undocumented. Better to create a platform data structure which explicitly documents what is passed to the driver. Suggested-by: Tomasz Figa [krzk: Update maintainer's entry] Signed-off-by: Krzysztof Kozlowski --- Changes since v1: 1. Update maintainer's entry. --- MAINTAINERS | 1 + arch/arm/mach-s3c24xx/common.c | 7 ++++++- drivers/clk/samsung/clk-s3c2410-dclk.c | 7 ++++++- include/linux/platform_data/clk-s3c2410.h | 19 +++++++++++++++++++ 4 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 include/linux/platform_data/clk-s3c2410.h diff --git a/MAINTAINERS b/MAINTAINERS index 5675fc9bfa00..81046738cba9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -15295,6 +15295,7 @@ F: Documentation/devicetree/bindings/clock/samsung,s5p* F: drivers/clk/samsung/ F: include/dt-bindings/clock/exynos*.h F: include/linux/clk/samsung.h +F: include/linux/platform_data/clk-s3c2410.h SAMSUNG SPI DRIVERS M: Kukjin Kim diff --git a/arch/arm/mach-s3c24xx/common.c b/arch/arm/mach-s3c24xx/common.c index 222238e8acbb..c476a673d07f 100644 --- a/arch/arm/mach-s3c24xx/common.c +++ b/arch/arm/mach-s3c24xx/common.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -663,13 +664,17 @@ static struct resource s3c2410_dclk_resource[] = { [0] = DEFINE_RES_MEM(0x56000084, 0x4), }; +static struct s3c2410_clk_platform_data s3c_clk_platform_data = { + .modify_misccr = s3c2410_modify_misccr, +}; + struct platform_device s3c2410_device_dclk = { .name = "s3c2410-dclk", .id = 0, .num_resources = ARRAY_SIZE(s3c2410_dclk_resource), .resource = s3c2410_dclk_resource, .dev = { - .platform_data = s3c2410_modify_misccr, + .platform_data = &s3c_clk_platform_data, }, }; #endif diff --git a/drivers/clk/samsung/clk-s3c2410-dclk.c b/drivers/clk/samsung/clk-s3c2410-dclk.c index 3e0f23e8ec21..f5e0a6ba2d12 100644 --- a/drivers/clk/samsung/clk-s3c2410-dclk.c +++ b/drivers/clk/samsung/clk-s3c2410-dclk.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include "clk.h" @@ -89,10 +90,14 @@ static struct clk_hw *s3c24xx_register_clkout(struct device *dev, const char *name, const char **parent_names, u8 num_parents, u8 shift, u32 mask) { + struct s3c2410_clk_platform_data *pdata = dev_get_platdata(dev); struct s3c24xx_clkout *clkout; struct clk_init_data init; int ret; + if (!pdata) + return ERR_PTR(-EINVAL); + /* allocate the clkout */ clkout = kzalloc(sizeof(*clkout), GFP_KERNEL); if (!clkout) @@ -107,7 +112,7 @@ static struct clk_hw *s3c24xx_register_clkout(struct device *dev, clkout->shift = shift; clkout->mask = mask; clkout->hw.init = &init; - clkout->modify_misccr = dev->platform_data; + clkout->modify_misccr = pdata->modify_misccr; ret = clk_hw_register(dev, &clkout->hw); if (ret) diff --git a/include/linux/platform_data/clk-s3c2410.h b/include/linux/platform_data/clk-s3c2410.h new file mode 100644 index 000000000000..7eb1cfa5409b --- /dev/null +++ b/include/linux/platform_data/clk-s3c2410.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (c) 2020 Krzysztof Kozlowski + */ + +#ifndef __LINUX_PLATFORM_DATA_CLK_S3C2410_H_ +#define __LINUX_PLATFORM_DATA_CLK_S3C2410_H_ + +/** + * struct s3c2410_clk_platform_data - platform data for S3C2410 clock driver + * + * @modify_misccr: Function to modify the MISCCR and return the new value + */ +struct s3c2410_clk_platform_data { + unsigned int (*modify_misccr)(unsigned int clr, unsigned int chg); +}; + +#endif /* __LINUX_PLATFORM_DATA_CLK_S3C2410_H_ */ + From patchwork Thu Aug 6 18:20:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 247507 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1743194ilo; Thu, 6 Aug 2020 11:35:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdy1qn+4tQoVOkPi6VhM4H7r/L1Hf8U0y45RsdeHqideSYS9ACb70VKi0EiVvfFZn09yhD X-Received: by 2002:a50:fd16:: with SMTP id i22mr5271612eds.281.1596738958378; Thu, 06 Aug 2020 11:35:58 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h14si3989758eje.503.2020.08.06.11.35.58; Thu, 06 Aug 2020 11:35:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-samsung-soc-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=@kernel.org header.s=default header.b=mi5Qr2ze; arc=fail (signature failed); spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727858AbgHFSfz (ORCPT + 4 others); Thu, 6 Aug 2020 14:35:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728298AbgHFSex (ORCPT ); Thu, 6 Aug 2020 14:34:53 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89BC6C0617B1 for ; Thu, 6 Aug 2020 11:34:48 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id 184so10630808wmb.0 for ; Thu, 06 Aug 2020 11:34:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:resent-from:resent-date:resent-message-id :resent-to:dkim-signature:from:to:cc:subject:date:message-id :in-reply-to:references; bh=sFS/aiLRv/bhQNkvBpURrlM8wpJw9I+uHLlJRaJ6dh0=; b=hK0y6mdISsi8RsPMWBBzIErkExxxxBlAr+hZ74WudlDuiacXlh48DuJ+g/OScAlOvZ 99PysWFzMhHwUg35GALpWZ432CLsTwFsQQ4Fj6ppctboL9sSk8vmouVQhRHG7wibW7a3 nPtuuGGWqpmntZx4TUqtxPQPyCrBrx8u3lpADdOTDtuB9owzcQoso6+Mu0ZPqw2P3szG zjodTBMC2iRvfbq55e3qLerYEXTMY90LSaYjK9FzG9HHxf2QuuRjZUu2QVSuk1pY+k+9 jpcuhVtoXcD0LKmuZtpNp6TYWect+pvh1ovoZtD/ITJrZYoHNR/w3ZQidJ8/xzrbd8Nh itxg== X-Gm-Message-State: AOAM533LFYbiF+44JEM2LvLL0tlhcZCUuNiKb5FgFxde1UA9eDUz5KEd /f9kgwljF6iQBJ/lbCFbKbiZzf/rmzw= X-Received: by 2002:a1c:c913:: with SMTP id f19mr8796834wmb.173.1596738886607; Thu, 06 Aug 2020 11:34:46 -0700 (PDT) Received: from kozik-lap ([194.230.155.117]) by smtp.googlemail.com with ESMTPSA id k126sm7870297wme.17.2020.08.06.11.34.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Aug 2020 11:34:46 -0700 (PDT) Received: by 2002:ab3:1105:0:0:0:0:0 with SMTP id j5csp1540784lta; Thu, 6 Aug 2020 11:22:09 -0700 (PDT) X-Received: by 2002:a17:90a:2309:: with SMTP id f9mr9337793pje.235.1596738129244; Thu, 06 Aug 2020 11:22:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596738129; cv=none; d=google.com; s=arc-20160816; b=ioSaGAwuS05fBvHFjVq18qbYfUZAjNhkBwaI26vO1Sc9AJcUbgOF8rcauIzpcsWLHb +Yk5ReFNGgCsund4GYl7qeph9DGgb/WNWC4rs3cndef5tEuejQsrXu/MoFwFQHlRaXXf SxC2yHSKo+xScmAjFqu9AzhrRfCvaZTLyu/x6nE72tno76ass210XBC+Yxq5GwGULZKv 7m07Skha2c6OblVDmOaedbqVWMcEavxjDd997w+BolEAxcUJHAxspB5up4Vt4oYZpss1 6dJQf5GHhJ78qZh4fqBmS7MXtqrJWgTzd8sDfGRDcnhMtP2/IrzgSpHyIDV2nY51xgZh 3GDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to; bh=sFS/aiLRv/bhQNkvBpURrlM8wpJw9I+uHLlJRaJ6dh0=; b=iVL3WXHSMPpzUxVTterlqgeXuzd/AT6/2kkeDawfkwUPtEuBzft4OuqdNA7nO/0194 JRZYHme8pYPUfPym8OMBYiRA4JbMyQGKlsnLMrS35cSLy7TTUW/REB5aOtQ03jNBsel8 O0TMuNM6iwipCjxbGEG5RXRV3Ma4r/06QVr/coz+69nydirf2rZeYbThbACcmxaRcefV WNOagpuYfkQVAbC02IMag/Vhg6GDxJpkZc47+pvJ8a/ZubHneARCsIUtHQa+Aorq/4hH QxC8XQtYrn5yIM3t0/w+tNXBIT1rxzo99+29m7GiSP+5JIMRESbkv99ptPMCOIC5s2xp sh3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mi5Qr2ze; spf=pass (google.com: domain of krzk@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=krzk@kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from mail.kernel.org (mail.kernel.org. [198.145.29.99]) by mx.google.com with ESMTPS id nm8si3923202pjb.127.2020.08.06.11.22.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Aug 2020 11:22:09 -0700 (PDT) Received-SPF: pass (google.com: domain of krzk@kernel.org designates 198.145.29.99 as permitted sender) client-ip=198.145.29.99; Received: by mail.kernel.org (Postfix) id 3E41F22D04; Thu, 6 Aug 2020 18:22:09 +0000 (UTC) Received: from localhost.localdomain (unknown [194.230.155.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A940F22D03; Thu, 6 Aug 2020 18:22:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596738129; bh=FhhYFVLgJraMVZW0kc7OuXR1kGXOMlH78bXD3yAep0U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mi5Qr2ze5eH90CPPUVDJV4zfkus51+4VVYxmnUSPF5gMES/SSZqJNQnw+9yFRXCWw DxA6Lp0OY6BCABBbFuU7pLGU7NBUIzruCm5WA5mgnPR8+SnBmSHuPnsZbIj3diDivo +FZEF8SMJLqsZ8eY5aNGkNOQ0sjIxnI0YPCfCdZs= From: Krzysztof Kozlowski To: linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Krzysztof Kozlowski , Russell King , linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 07/41] ARM: s3c24xx: simplify mach/io.h Date: Thu, 6 Aug 2020 20:20:24 +0200 Message-Id: <20200806182059.2431-7-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200806181932.2253-1-krzk@kernel.org> References: <20200806181932.2253-1-krzk@kernel.org> X-TUID: QZEDq402v1U9 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Arnd Bergmann s3c24xx has a custom implementation of the inb/outb family of I/O accessors, implementing both general register access and ISA I/O port through a multiplexer. As far as I can tell, the first case has never been needed, and certainly is not used now, as drivers only use inb/outb to actually driver ISA or PCI port I/O. Similarly, the special ISA support is limited to a single machine, the Simtec Electronics BAST (EB2410ITX) with its PC/104 expansion connector, all other machines could simply use the generic implementation from asm/io.h that expects a single memory-mapped address range for byte, word and dword access. As no other machines besides BAST actually selects CONFIG_ISA, this is likely not even necessary. As a cleanup, remove support for the non-ISA access from the helpers, and make the ISA access use the virtual address window that we use elsewhere for PCI I/O ports. In configurations without the BAST machine, this now falls back on the generic implementation from asm/io.h, but the mach/io.h header is still relied on to include a number of other header files implicitly. Signed-off-by: Arnd Bergmann Signed-off-by: Krzysztof Kozlowski --- arch/arm/mach-s3c24xx/include/mach/io.h | 209 +++---------------- arch/arm/plat-samsung/include/plat/map-s3c.h | 10 +- 2 files changed, 26 insertions(+), 193 deletions(-) -- 2.17.1 diff --git a/arch/arm/mach-s3c24xx/include/mach/io.h b/arch/arm/mach-s3c24xx/include/mach/io.h index f960e6d10114..3e8bff26cdd5 100644 --- a/arch/arm/mach-s3c24xx/include/mach/io.h +++ b/arch/arm/mach-s3c24xx/include/mach/io.h @@ -12,201 +12,40 @@ #include -#define IO_SPACE_LIMIT 0xffffffff /* - * We use two different types of addressing - PC style addresses, and ARM - * addresses. PC style accesses the PC hardware with the normal PC IO - * addresses, eg 0x3f8 for serial#1. ARM addresses are above A28 - * and are translated to the start of IO. Note that all addresses are - * not shifted left! + * ISA style IO, for each machine to sort out mappings for, + * if it implements it. We reserve two 16M regions for ISA, + * so the PC/104 can use separate addresses for 8-bit and + * 16-bit port I/O. */ +#define PCIO_BASE S3C_ADDR(0x02000000) +#define IO_SPACE_LIMIT 0x00ffffff +#define S3C24XX_VA_ISA_WORD (PCIO_BASE) +#define S3C24XX_VA_ISA_BYTE (PCIO_BASE + 0x01000000) -#define __PORT_PCIO(x) ((x) < (1<<28)) +#ifdef CONFIG_ISA -#define PCIO_BASE (S3C24XX_VA_ISA_WORD) -#define PCIO_BASE_b (S3C24XX_VA_ISA_BYTE) -#define PCIO_BASE_w (S3C24XX_VA_ISA_WORD) -#define PCIO_BASE_l (S3C24XX_VA_ISA_WORD) -/* - * Dynamic IO functions - let the compiler - * optimize the expressions - */ - -#define DECLARE_DYN_OUT(sz,fnsuffix,instr) \ -static inline void __out##fnsuffix (unsigned int val, unsigned int port) \ -{ \ - unsigned long temp; \ - __asm__ __volatile__( \ - "cmp %2, #(1<<28)\n\t" \ - "mov %0, %2\n\t" \ - "addcc %0, %0, %3\n\t" \ - "str" instr " %1, [%0, #0 ] @ out" #fnsuffix \ - : "=&r" (temp) \ - : "r" (val), "r" (port), "Ir" (PCIO_BASE_##fnsuffix) \ - : "cc"); \ -} - - -#define DECLARE_DYN_IN(sz,fnsuffix,instr) \ -static inline unsigned sz __in##fnsuffix (unsigned int port) \ -{ \ - unsigned long temp, value; \ - __asm__ __volatile__( \ - "cmp %2, #(1<<28)\n\t" \ - "mov %0, %2\n\t" \ - "addcc %0, %0, %3\n\t" \ - "ldr" instr " %1, [%0, #0 ] @ in" #fnsuffix \ - : "=&r" (temp), "=r" (value) \ - : "r" (port), "Ir" (PCIO_BASE_##fnsuffix) \ - : "cc"); \ - return (unsigned sz)value; \ -} +#define inb(p) readb(S3C24XX_VA_ISA_BYTE + (p)) +#define inw(p) readw(S3C24XX_VA_ISA_WORD + (p)) +#define inl(p) readl(S3C24XX_VA_ISA_WORD + (p)) -static inline void __iomem *__ioaddr (unsigned long port) -{ - return __PORT_PCIO(port) ? (PCIO_BASE + port) : (void __iomem *)port; -} +#define outb(v,p) writeb((v), S3C24XX_VA_ISA_BYTE + (p)) +#define outw(v,p) writew((v), S3C24XX_VA_ISA_WORD + (p)) +#define outl(v,p) writel((v), S3C24XX_VA_ISA_WORD + (p)) -#define DECLARE_IO(sz,fnsuffix,instr) \ - DECLARE_DYN_IN(sz,fnsuffix,instr) \ - DECLARE_DYN_OUT(sz,fnsuffix,instr) +#define insb(p,d,l) readsb(S3C24XX_VA_ISA_BYTE + (p),d,l) +#define insw(p,d,l) readsw(S3C24XX_VA_ISA_WORD + (p),d,l) +#define insl(p,d,l) readsl(S3C24XX_VA_ISA_WORD + (p),d,l) -DECLARE_IO(char,b,"b") -DECLARE_IO(short,w,"h") -DECLARE_IO(int,l,"") +#define outsb(p,d,l) writesb(S3C24XX_VA_ISA_BYTE + (p),d,l) +#define outsw(p,d,l) writesw(S3C24XX_VA_ISA_WORD + (p),d,l) +#define outsl(p,d,l) writesl(S3C24XX_VA_ISA_WORD + (p),d,l) -#undef DECLARE_IO -#undef DECLARE_DYN_IN - -/* - * Constant address IO functions - * - * These have to be macros for the 'J' constraint to work - - * +/-4096 immediate operand. - */ -#define __outbc(value,port) \ -({ \ - if (__PORT_PCIO((port))) \ - __asm__ __volatile__( \ - "strb %0, [%1, %2] @ outbc" \ - : : "r" (value), "r" (PCIO_BASE), "Jr" ((port))); \ - else \ - __asm__ __volatile__( \ - "strb %0, [%1, #0] @ outbc" \ - : : "r" (value), "r" ((port))); \ -}) +#else -#define __inbc(port) \ -({ \ - unsigned char result; \ - if (__PORT_PCIO((port))) \ - __asm__ __volatile__( \ - "ldrb %0, [%1, %2] @ inbc" \ - : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port))); \ - else \ - __asm__ __volatile__( \ - "ldrb %0, [%1, #0] @ inbc" \ - : "=r" (result) : "r" ((port))); \ - result; \ -}) +#define __io(x) (PCIO_BASE + (x)) -#define __outwc(value,port) \ -({ \ - unsigned long v = value; \ - if (__PORT_PCIO((port))) { \ - if ((port) < 256 && (port) > -256) \ - __asm__ __volatile__( \ - "strh %0, [%1, %2] @ outwc" \ - : : "r" (v), "r" (PCIO_BASE), "Jr" ((port))); \ - else if ((port) > 0) \ - __asm__ __volatile__( \ - "strh %0, [%1, %2] @ outwc" \ - : : "r" (v), \ - "r" (PCIO_BASE + ((port) & ~0xff)), \ - "Jr" (((port) & 0xff))); \ - else \ - __asm__ __volatile__( \ - "strh %0, [%1, #0] @ outwc" \ - : : "r" (v), \ - "r" (PCIO_BASE + (port))); \ - } else \ - __asm__ __volatile__( \ - "strh %0, [%1, #0] @ outwc" \ - : : "r" (v), "r" ((port))); \ -}) - -#define __inwc(port) \ -({ \ - unsigned short result; \ - if (__PORT_PCIO((port))) { \ - if ((port) < 256 && (port) > -256 ) \ - __asm__ __volatile__( \ - "ldrh %0, [%1, %2] @ inwc" \ - : "=r" (result) \ - : "r" (PCIO_BASE), \ - "Jr" ((port))); \ - else if ((port) > 0) \ - __asm__ __volatile__( \ - "ldrh %0, [%1, %2] @ inwc" \ - : "=r" (result) \ - : "r" (PCIO_BASE + ((port) & ~0xff)), \ - "Jr" (((port) & 0xff))); \ - else \ - __asm__ __volatile__( \ - "ldrh %0, [%1, #0] @ inwc" \ - : "=r" (result) \ - : "r" (PCIO_BASE + ((port)))); \ - } else \ - __asm__ __volatile__( \ - "ldrh %0, [%1, #0] @ inwc" \ - : "=r" (result) : "r" ((port))); \ - result; \ -}) - -#define __outlc(value,port) \ -({ \ - unsigned long v = value; \ - if (__PORT_PCIO((port))) \ - __asm__ __volatile__( \ - "str %0, [%1, %2] @ outlc" \ - : : "r" (v), "r" (PCIO_BASE), "Jr" ((port))); \ - else \ - __asm__ __volatile__( \ - "str %0, [%1, #0] @ outlc" \ - : : "r" (v), "r" ((port))); \ -}) - -#define __inlc(port) \ -({ \ - unsigned long result; \ - if (__PORT_PCIO((port))) \ - __asm__ __volatile__( \ - "ldr %0, [%1, %2] @ inlc" \ - : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port))); \ - else \ - __asm__ __volatile__( \ - "ldr %0, [%1, #0] @ inlc" \ - : "=r" (result) : "r" ((port))); \ - result; \ -}) - -#define __ioaddrc(port) ((__PORT_PCIO(port) ? PCIO_BASE + (port) : (void __iomem *)0 + (port))) - -#define inb(p) (__builtin_constant_p((p)) ? __inbc(p) : __inb(p)) -#define inw(p) (__builtin_constant_p((p)) ? __inwc(p) : __inw(p)) -#define inl(p) (__builtin_constant_p((p)) ? __inlc(p) : __inl(p)) -#define outb(v,p) (__builtin_constant_p((p)) ? __outbc(v,p) : __outb(v,p)) -#define outw(v,p) (__builtin_constant_p((p)) ? __outwc(v,p) : __outw(v,p)) -#define outl(v,p) (__builtin_constant_p((p)) ? __outlc(v,p) : __outl(v,p)) -#define __ioaddr(p) (__builtin_constant_p((p)) ? __ioaddr(p) : __ioaddrc(p)) - -#define insb(p,d,l) __raw_readsb(__ioaddr(p),d,l) -#define insw(p,d,l) __raw_readsw(__ioaddr(p),d,l) -#define insl(p,d,l) __raw_readsl(__ioaddr(p),d,l) - -#define outsb(p,d,l) __raw_writesb(__ioaddr(p),d,l) -#define outsw(p,d,l) __raw_writesw(__ioaddr(p),d,l) -#define outsl(p,d,l) __raw_writesl(__ioaddr(p),d,l) +#endif #endif diff --git a/arch/arm/plat-samsung/include/plat/map-s3c.h b/arch/arm/plat-samsung/include/plat/map-s3c.h index 4244acbf4b65..bf247d836684 100644 --- a/arch/arm/plat-samsung/include/plat/map-s3c.h +++ b/arch/arm/plat-samsung/include/plat/map-s3c.h @@ -9,6 +9,8 @@ #ifndef __ASM_PLAT_MAP_S3C_H #define __ASM_PLAT_MAP_S3C_H __FILE__ +#include + #define S3C24XX_VA_IRQ S3C_VA_IRQ #define S3C24XX_VA_MEMCTRL S3C_VA_MEM #define S3C24XX_VA_UART S3C_VA_UART @@ -45,16 +47,8 @@ #define S3C_VA_USB_HSPHY S3C64XX_VA_USB_HSPHY -/* - * ISA style IO, for each machine to sort out mappings for, - * if it implements it. We reserve two 16M regions for ISA. - */ - #define S3C2410_ADDR(x) S3C_ADDR(x) -#define S3C24XX_VA_ISA_WORD S3C2410_ADDR(0x02000000) -#define S3C24XX_VA_ISA_BYTE S3C2410_ADDR(0x03000000) - /* deal with the registers that move under the 2412/2413 */ #if defined(CONFIG_CPU_S3C2412) From patchwork Thu Aug 6 18:20:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 247501 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1743125ilo; Thu, 6 Aug 2020 11:35:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRmJ+tsC8H7o0I0UmND9hNTtVB6aNuGKrywLu7UNHsPbaw0+v0YqopH5okUaWL5hNuRofv X-Received: by 2002:a05:6402:1ad1:: with SMTP id ba17mr5183487edb.119.1596738953053; Thu, 06 Aug 2020 11:35:53 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rv7si3622798ejb.641.2020.08.06.11.35.52; Thu, 06 Aug 2020 11:35:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-samsung-soc-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=@kernel.org header.s=default header.b=SsUMJwrO; arc=fail (signature failed); spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728127AbgHFSfr (ORCPT + 4 others); Thu, 6 Aug 2020 14:35:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727021AbgHFSex (ORCPT ); Thu, 6 Aug 2020 14:34:53 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 265F9C0617AB for ; Thu, 6 Aug 2020 11:34:46 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id z18so41377813wrm.12 for ; Thu, 06 Aug 2020 11:34:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:resent-from:resent-date:resent-message-id :resent-to:dkim-signature:from:to:cc:subject:date:message-id :in-reply-to:references; bh=AO8nqkbr85lxncJm7Db/wKIEt/UUR9wqcHp46SsaYuE=; b=a1IKTAY8SY0OV2wEVnSy/rEXn3arHhYaza2Go/LeuNxgqps/YvUfHaYCh7D+VL+dfj 6622kBxKNPeBpx91raPA1nP7ZW2oBB7c4ZTuNCOF/gTpCBIjiLhDrNeXRJFe83xCTzZj Pd8co3v2vLhWjwliujRmK/+UrV6F1sXrGtLxj1kkVKy+47jXgHdyngPP8uyIqQOVNpZP /1SdQr2iAVVF7TGDRFP/PYkhoykKupeOWDZTvyMj4/8dSZpgoDhOfIpHHmprbcd4lJTr 74OpLVFE64uBkFvu98LZ6XgYuZjPSYliTmKB1rKKJTSYAwuO0bXJmuJFIeSb2HAkOmHv Uoww== X-Gm-Message-State: AOAM533OikmZUu23a6m4tQhweW8z235VAfD7+3LcGdBq0G14ils1NAZA GCDJxPx2ArYkGMN5Vsc6m1wszhMM8/U= X-Received: by 2002:adf:b441:: with SMTP id v1mr8655312wrd.61.1596738884448; Thu, 06 Aug 2020 11:34:44 -0700 (PDT) Received: from kozik-lap ([194.230.155.117]) by smtp.googlemail.com with ESMTPSA id p15sm7327090wrj.61.2020.08.06.11.34.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Aug 2020 11:34:44 -0700 (PDT) Received: by 2002:ab3:1105:0:0:0:0:0 with SMTP id j5csp1540869lta; Thu, 6 Aug 2020 11:22:17 -0700 (PDT) X-Received: by 2002:a63:d30a:: with SMTP id b10mr8273026pgg.430.1596738136966; Thu, 06 Aug 2020 11:22:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596738136; cv=none; d=google.com; s=arc-20160816; b=fEQKN7A/1Dy7stHUJpz3QaBPuPoC/O/Jj4rg0Tv2P4ry2TQU9OOZ7lwcxZb8o4YK3J OGy9uL5E73uHb3M4ffA+Q7O37o2A7R6cvoyvVSE1s+tosNBzT5BPAy7WK0oA/2Gdm0bU cok1iB1rUN6FOStiXeKP6tOP6ZE28h4ztSBlLD/v/re1kyFIrr1cmbjhDD+3f47Pwnoc l8RfiPmEqRbkRbgWrEnxdE4bAD2JDKlWnNqIaakLRIxlMdIDlVK7kL64wzmp6ErPrzkL gtWBDqeDr+3RRoM6MpIrRrOqmmCnTEZ8NJ9XnXJ+UZTjtkyAn+bgqZdl9A0Ms6q4QrTu JBhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to; bh=AO8nqkbr85lxncJm7Db/wKIEt/UUR9wqcHp46SsaYuE=; b=OAF0TWz/bB3LHw6tii1TiYH4lHE4x1GaL0n50ZKpuM+stQ66Vbg8ZMj2ZdOBmz1R4K fdqniSkBqFgMY5eHMWz+AjelRk/EF9uFA4CSe3/CTPQA57Fb0ZFz0YpXdgweWKyS5EvI yUveiK51cXNpIY1cyGDChJVy8fhOj2T1Y5kAu05A7rnk+oGyoo8fqldTgJ/IPrMfa7QA NkFPXsnVFYQpWslp+Syci3o7FlBoChHhROEzjiBtaWS21C4p2I5hVfdpNoRVuTFy63tj +oplN4+RQqs+5ckResdHDdLexGEotZfGBrpSI/nvhl8oyrZSv0TUx13cgp4XLlPA0Zkv qi4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SsUMJwrO; spf=pass (google.com: domain of krzk@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=krzk@kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from mail.kernel.org (mail.kernel.org. [198.145.29.99]) by mx.google.com with ESMTPS id k17si4046833pls.348.2020.08.06.11.22.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Aug 2020 11:22:16 -0700 (PDT) Received-SPF: pass (google.com: domain of krzk@kernel.org designates 198.145.29.99 as permitted sender) client-ip=198.145.29.99; Received: by mail.kernel.org (Postfix) id EDB5E22D0B; Thu, 6 Aug 2020 18:22:16 +0000 (UTC) Received: from localhost.localdomain (unknown [194.230.155.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F303122D06; Thu, 6 Aug 2020 18:22:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596738136; bh=41DB04g7bnvHlbjYbY4BAew/yHdDAUU2eHUM/YHd6eI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SsUMJwrOd4mJyKpNs/CIMXd3noEkrz6TxA8z2JExxEjdCSb3IJJHPuk97wtbWPoNL 32tVAIKOcDTCI80KbmrW63jnaPqRJp0bKqJ+sE67JAp/icDA8uMjs47IXI8dmZquco 2hUCicQHgZrDi4A0MumUHAwH2dDYkERdiTunAEqM= From: Krzysztof Kozlowski To: linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Krzysztof Kozlowski , Russell King , Felipe Balbi , Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org Subject: [PATCH v2 09/41] usb: gadget: s3c-hsudc: remove platform header dependency Date: Thu, 6 Aug 2020 20:20:26 +0200 Message-Id: <20200806182059.2431-9-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200806181932.2253-1-krzk@kernel.org> References: <20200806181932.2253-1-krzk@kernel.org> X-TUID: uGa4uWozuy+A Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Arnd Bergmann There is no real phy driver, so s3c-hsudc just pokes the registers itself. Improve this a little by making it a platform data callback like we do for gpios. There is only one board using this driver, and it's unlikely that another would be added, so this is a minimal workaround. Signed-off-by: Arnd Bergmann [krzk: Include regs-s3c2443-clock.h in ifdef to fixup build on s3c6400] Signed-off-by: Krzysztof Kozlowski --- Changes since v1: 1. Include regs-s3c2443-clock.h in ifdef to fixup build on s3c640 --- .../include/mach/regs-s3c2443-clock.h | 49 +++++++++++++++++ arch/arm/plat-samsung/devs.c | 6 ++ drivers/usb/gadget/udc/s3c-hsudc.c | 55 ++----------------- include/linux/platform_data/s3c-hsudc.h | 2 + 4 files changed, 61 insertions(+), 51 deletions(-) -- 2.17.1 diff --git a/arch/arm/mach-s3c24xx/include/mach/regs-s3c2443-clock.h b/arch/arm/mach-s3c24xx/include/mach/regs-s3c2443-clock.h index 6bf924612b06..682759549e63 100644 --- a/arch/arm/mach-s3c24xx/include/mach/regs-s3c2443-clock.h +++ b/arch/arm/mach-s3c24xx/include/mach/regs-s3c2443-clock.h @@ -10,6 +10,8 @@ #ifndef __ASM_ARM_REGS_S3C2443_CLOCK #define __ASM_ARM_REGS_S3C2443_CLOCK +#include + #define S3C2443_CLKREG(x) ((x) + S3C24XX_VA_CLKPWR) #define S3C2443_PLLCON_MDIVSHIFT 16 @@ -184,5 +186,52 @@ s3c2443_get_epll(unsigned int pllval, unsigned int baseclk) return (unsigned int)fvco; } +static inline void s3c_hsudc_init_phy(void) +{ + u32 cfg; + + cfg = readl(S3C2443_PWRCFG) | S3C2443_PWRCFG_USBPHY; + writel(cfg, S3C2443_PWRCFG); + + cfg = readl(S3C2443_URSTCON); + cfg |= (S3C2443_URSTCON_FUNCRST | S3C2443_URSTCON_PHYRST); + writel(cfg, S3C2443_URSTCON); + mdelay(1); + + cfg = readl(S3C2443_URSTCON); + cfg &= ~(S3C2443_URSTCON_FUNCRST | S3C2443_URSTCON_PHYRST); + writel(cfg, S3C2443_URSTCON); + + cfg = readl(S3C2443_PHYCTRL); + cfg &= ~(S3C2443_PHYCTRL_CLKSEL | S3C2443_PHYCTRL_DSPORT); + cfg |= (S3C2443_PHYCTRL_EXTCLK | S3C2443_PHYCTRL_PLLSEL); + writel(cfg, S3C2443_PHYCTRL); + + cfg = readl(S3C2443_PHYPWR); + cfg &= ~(S3C2443_PHYPWR_FSUSPEND | S3C2443_PHYPWR_PLL_PWRDN | + S3C2443_PHYPWR_XO_ON | S3C2443_PHYPWR_PLL_REFCLK | + S3C2443_PHYPWR_ANALOG_PD); + cfg |= S3C2443_PHYPWR_COMMON_ON; + writel(cfg, S3C2443_PHYPWR); + + cfg = readl(S3C2443_UCLKCON); + cfg |= (S3C2443_UCLKCON_DETECT_VBUS | S3C2443_UCLKCON_FUNC_CLKEN | + S3C2443_UCLKCON_TCLKEN); + writel(cfg, S3C2443_UCLKCON); +} + +static inline void s3c_hsudc_uninit_phy(void) +{ + u32 cfg; + + cfg = readl(S3C2443_PWRCFG) & ~S3C2443_PWRCFG_USBPHY; + writel(cfg, S3C2443_PWRCFG); + + writel(S3C2443_PHYPWR_FSUSPEND, S3C2443_PHYPWR); + + cfg = readl(S3C2443_UCLKCON) & ~S3C2443_UCLKCON_FUNC_CLKEN; + writel(cfg, S3C2443_UCLKCON); +} + #endif /* __ASM_ARM_REGS_S3C2443_CLOCK */ diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c index 2ed3ef604a25..0607d2984841 100644 --- a/arch/arm/plat-samsung/devs.c +++ b/arch/arm/plat-samsung/devs.c @@ -40,6 +40,10 @@ #include #include +#ifdef CONFIG_PLAT_S3C24XX +#include +#endif /* CONFIG_PLAT_S3C24XX */ + #include #include #include @@ -1037,6 +1041,8 @@ struct platform_device s3c_device_usb_hsudc = { void __init s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata *pd) { s3c_set_platdata(pd, sizeof(*pd), &s3c_device_usb_hsudc); + pd->phy_init = s3c_hsudc_init_phy; + pd->phy_uninit = s3c_hsudc_uninit_phy; } #endif /* CONFIG_PLAT_S3C24XX */ diff --git a/drivers/usb/gadget/udc/s3c-hsudc.c b/drivers/usb/gadget/udc/s3c-hsudc.c index aaca1b0a2f59..7bd5182ce3ef 100644 --- a/drivers/usb/gadget/udc/s3c-hsudc.c +++ b/drivers/usb/gadget/udc/s3c-hsudc.c @@ -30,8 +30,6 @@ #include #include -#include - #define S3C_HSUDC_REG(x) (x) /* Non-Indexed Registers */ @@ -186,53 +184,6 @@ static inline void __orr32(void __iomem *ptr, u32 val) writel(readl(ptr) | val, ptr); } -static void s3c_hsudc_init_phy(void) -{ - u32 cfg; - - cfg = readl(S3C2443_PWRCFG) | S3C2443_PWRCFG_USBPHY; - writel(cfg, S3C2443_PWRCFG); - - cfg = readl(S3C2443_URSTCON); - cfg |= (S3C2443_URSTCON_FUNCRST | S3C2443_URSTCON_PHYRST); - writel(cfg, S3C2443_URSTCON); - mdelay(1); - - cfg = readl(S3C2443_URSTCON); - cfg &= ~(S3C2443_URSTCON_FUNCRST | S3C2443_URSTCON_PHYRST); - writel(cfg, S3C2443_URSTCON); - - cfg = readl(S3C2443_PHYCTRL); - cfg &= ~(S3C2443_PHYCTRL_CLKSEL | S3C2443_PHYCTRL_DSPORT); - cfg |= (S3C2443_PHYCTRL_EXTCLK | S3C2443_PHYCTRL_PLLSEL); - writel(cfg, S3C2443_PHYCTRL); - - cfg = readl(S3C2443_PHYPWR); - cfg &= ~(S3C2443_PHYPWR_FSUSPEND | S3C2443_PHYPWR_PLL_PWRDN | - S3C2443_PHYPWR_XO_ON | S3C2443_PHYPWR_PLL_REFCLK | - S3C2443_PHYPWR_ANALOG_PD); - cfg |= S3C2443_PHYPWR_COMMON_ON; - writel(cfg, S3C2443_PHYPWR); - - cfg = readl(S3C2443_UCLKCON); - cfg |= (S3C2443_UCLKCON_DETECT_VBUS | S3C2443_UCLKCON_FUNC_CLKEN | - S3C2443_UCLKCON_TCLKEN); - writel(cfg, S3C2443_UCLKCON); -} - -static void s3c_hsudc_uninit_phy(void) -{ - u32 cfg; - - cfg = readl(S3C2443_PWRCFG) & ~S3C2443_PWRCFG_USBPHY; - writel(cfg, S3C2443_PWRCFG); - - writel(S3C2443_PHYPWR_FSUSPEND, S3C2443_PHYPWR); - - cfg = readl(S3C2443_UCLKCON) & ~S3C2443_UCLKCON_FUNC_CLKEN; - writel(cfg, S3C2443_UCLKCON); -} - /** * s3c_hsudc_complete_request - Complete a transfer request. * @hsep: Endpoint to which the request belongs. @@ -1188,7 +1139,8 @@ static int s3c_hsudc_start(struct usb_gadget *gadget, pm_runtime_get_sync(hsudc->dev); - s3c_hsudc_init_phy(); + if (hsudc->pd->phy_init) + hsudc->pd->phy_init(); if (hsudc->pd->gpio_init) hsudc->pd->gpio_init(); @@ -1210,7 +1162,8 @@ static int s3c_hsudc_stop(struct usb_gadget *gadget) spin_lock_irqsave(&hsudc->lock, flags); hsudc->gadget.speed = USB_SPEED_UNKNOWN; - s3c_hsudc_uninit_phy(); + if (hsudc->pd->phy_uninit) + hsudc->pd->phy_uninit(); pm_runtime_put(hsudc->dev); diff --git a/include/linux/platform_data/s3c-hsudc.h b/include/linux/platform_data/s3c-hsudc.h index 4dc9b8760166..a170939832d5 100644 --- a/include/linux/platform_data/s3c-hsudc.h +++ b/include/linux/platform_data/s3c-hsudc.h @@ -26,6 +26,8 @@ struct s3c24xx_hsudc_platdata { unsigned int epnum; void (*gpio_init)(void); void (*gpio_uninit)(void); + void (*phy_init)(void); + void (*phy_uninit)(void); }; #endif /* __LINUX_USB_S3C_HSUDC_H */ From patchwork Thu Aug 6 18:20:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 247500 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1743073ilo; Thu, 6 Aug 2020 11:35:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCq+akxEJ39w0JKeA7VWvD2CHdLbJutLgwzYll68jcF4PB7n/hgqzcLVykux4vjAVVOLRN X-Received: by 2002:aa7:d515:: with SMTP id y21mr5118502edq.381.1596738948452; Thu, 06 Aug 2020 11:35:48 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rv7si3622798ejb.641.2020.08.06.11.35.48; Thu, 06 Aug 2020 11:35:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-samsung-soc-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=@kernel.org header.s=default header.b=pncnbxRS; arc=fail (signature failed); spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728314AbgHFSfq (ORCPT + 4 others); Thu, 6 Aug 2020 14:35:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726490AbgHFSex (ORCPT ); Thu, 6 Aug 2020 14:34:53 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08C93C0617AA for ; Thu, 6 Aug 2020 11:34:44 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id f1so44399925wro.2 for ; Thu, 06 Aug 2020 11:34:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:resent-from:resent-date:resent-message-id :resent-to:dkim-signature:from:to:cc:subject:date:message-id :in-reply-to:references; bh=DtMV9yOgugrV8GsvXOMuutTXAsueynbX+Z9y4uN2Es4=; b=UZQFpiU/vPcBwKXvOOmwMkGaEY1lI+M+87Zc6sUDVKvQIjKgl2ulvzno1feCop7S2k vVHnFZfTSmoisrImIrnYmQk8RSQSNWJBlZvgb2WKUtDwdrc3WRLBaW5CNAvVUKbj4Ff8 JhQJI4lJ8E1xQqA5o/33F1bii8nPRjAhRYa2585wLNniffZHhxYsdtdSoT2JO4XQDbKl 7OnbkMIjLwnNezdQrlOiKKc5k4lowBgyW4ntgELI9SUXrTc1NBv4iqEhA/plqG5PsSJ1 ejRQI6dE4HrUdz/H1MXCksVlL9NHxbiPB2dK8LxFv8bvzruHCTFsOUUnLw9RKgYyiNdu IWlQ== X-Gm-Message-State: AOAM531g57AYf7O1Oi/TOis09d86CEyGjCucesQ5bZ762kogauopjyZQ 0q1BMsCpEt2l9tleI0WpD/HRVQa9BYw= X-Received: by 2002:adf:e94c:: with SMTP id m12mr8639560wrn.109.1596738882461; Thu, 06 Aug 2020 11:34:42 -0700 (PDT) Received: from kozik-lap ([194.230.155.117]) by smtp.googlemail.com with ESMTPSA id m8sm7608730wro.75.2020.08.06.11.34.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Aug 2020 11:34:42 -0700 (PDT) Received: by 2002:ab3:1105:0:0:0:0:0 with SMTP id j5csp1540885lta; Thu, 6 Aug 2020 11:22:19 -0700 (PDT) X-Received: by 2002:a63:1211:: with SMTP id h17mr7109822pgl.265.1596738139243; Thu, 06 Aug 2020 11:22:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596738139; cv=none; d=google.com; s=arc-20160816; b=DEKJE+/q2QqmioTll1Zrogt7qt2bKaY7pAx6RDsLdBxnvZF7VEexvicMDij+m9G4Ds elYcXoTsx4fzRRvrtt1jz3Ox36pRpCjPm6aXKM5AmMdv8uBSfsDuiw+FdkPoL6VtY2+U tCSiV6Jvmdz2TvHpFHUSEP4hOQyCZhd0MlJu+8Agi+wrru0YfjcdUQTXnaUn8XY5cBM2 60e6JpolseHHFdEy0tWTYE/qWbrbBAxyz3ytyXQPyAOtX/DaS12ZlTyGblvjndlJmfss 9ZXZSYAY9PRUZ8xY++IpU8AQokEVQ8QSBYpi9sGvfcH/bU2g855cHNAJOlTLVtEWlz13 GgYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to; bh=DtMV9yOgugrV8GsvXOMuutTXAsueynbX+Z9y4uN2Es4=; b=hwyzSRnSZ1C0pBD81SqMhROa/NIrZTsffMwVaI0ZElDRo6AjIAU9c5lJJRpr90+9wC X+aqfEn4bV8QKoHavCWSZeb+gwgn8ZMA1ZCQ6YcRSK8xY69HY+4gp900kPn8FQ9gZC7l 64kt3n4M3GhDgfwYiQ5yiqM/0d7zJxl2GctWGY+//8kBtwuuMWuNXhItfk/OINcXKw5m A7blyqcY2I/MMVzpDu1KulTlpB4Xtq1sCwp93HLlioYkYiEGKsyW6tbksigoaVSzuXAu tRx7LGxkbuQC4aGNMOBa9RkbCL4E6YkWgsPFb+a+4PKRzxehrB6Yr/62/Or/NlL2UsUL Xeog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pncnbxRS; spf=pass (google.com: domain of krzk@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=krzk@kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from mail.kernel.org (mail.kernel.org. [198.145.29.99]) by mx.google.com with ESMTPS id 190si1238520pgc.519.2020.08.06.11.22.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Aug 2020 11:22:19 -0700 (PDT) Received-SPF: pass (google.com: domain of krzk@kernel.org designates 198.145.29.99 as permitted sender) client-ip=198.145.29.99; Received: by mail.kernel.org (Postfix) id 44F2422D07; Thu, 6 Aug 2020 18:22:19 +0000 (UTC) Received: from localhost.localdomain (unknown [194.230.155.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 79F8722D2C; Thu, 6 Aug 2020 18:22:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596738139; bh=owgygttJoaXudGgUle7hLKq1gI0hpguByw/gxau5EAc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pncnbxRS1YGYxt5bbAaV7uBIk0K2zEZ5T7EBjSFe25aAcC8Vb0JYpISWHBN3IpNCW oYnKChADpbr5IMtWx4MKAJMVjfGvF4PB67Cooqq9YZiEzQFIEWib+zEJLW8HXza4ki KQqoD3mm9rjQrMJZReiQ4t5XcnGJXqwFyHaw3XLE= From: Krzysztof Kozlowski To: linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Krzysztof Kozlowski , Russell King , Pankaj Dubey , Kukjin Kim , linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 10/41] ARM: samsung: don't build plat/pm-common for Exynos Date: Thu, 6 Aug 2020 20:20:27 +0200 Message-Id: <20200806182059.2431-10-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200806181932.2253-1-krzk@kernel.org> References: <20200806181932.2253-1-krzk@kernel.org> X-TUID: Odg24HtfRJDu Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Arnd Bergmann This file has not had any callers since linux-4.7, so stop building it. Fixes: 5901f4c279f7 ("ARM: EXYNOS: Remove SROM related register settings from mach-exynos") Signed-off-by: Arnd Bergmann Signed-off-by: Krzysztof Kozlowski --- arch/arm/plat-samsung/Makefile | 1 - 1 file changed, 1 deletion(-) -- 2.17.1 diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile index ce339a96fbf7..d8a80fbcebb3 100644 --- a/arch/arm/plat-samsung/Makefile +++ b/arch/arm/plat-samsung/Makefile @@ -25,7 +25,6 @@ obj-$(CONFIG_GPIO_SAMSUNG) += gpio-samsung.o # PM support obj-$(CONFIG_PM_SLEEP) += pm-common.o -obj-$(CONFIG_EXYNOS_CPU_SUSPEND) += pm-common.o obj-$(CONFIG_SAMSUNG_PM) += pm.o obj-$(CONFIG_SAMSUNG_PM_GPIO) += pm-gpio.o obj-$(CONFIG_SAMSUNG_PM_CHECK) += pm-check.o From patchwork Thu Aug 6 18:20:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 247533 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1747551ilo; Thu, 6 Aug 2020 11:42:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx//ckE40I3SKQrDlc4DaEg18eRSv8yheThPhBYtu/V/fxPvq57Yl6ulppkZ2yG0jHm7q1V X-Received: by 2002:a50:e047:: with SMTP id g7mr5260484edl.290.1596739343322; Thu, 06 Aug 2020 11:42:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596739343; cv=none; d=google.com; s=arc-20160816; b=LyTDRf/4mnHisZM/pgam+PUpYfeu5ztZRkLuGcgp+eQuvb0lgUag9tkR2S/sjx3om0 xrwDAMIKdOU+r1wq5hRrfqhFF5pnZyOUMQTQdRFKkGfP90IFHCET8QFnqGgo2muIXQPc 1Ng2P1E5YKCdAVPhOOVtyhFfm+TG3YzYfXhwDdcl5IL9pls9AZJPpmNBTud1sEoolxPi 1gw/5Dffh24IaaDwddQDQgZEAS/K/1x2hNx3Vm0gZqblT1zLjed62tNaPd07ERpHoG0N Ik4O2EbxeqEx8h+gN/cQX1YG3MQCx0f/tN5gFWDBVHWVJpaICePqsntRuo+C11g/K5ym A7fQ== ARC-Message-Signature: i=1; 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; bh=UMdhNrcgS+acvJE1nALQZASdxUWVXFEJDXroBVzWA78=; b=jtccjcRys7O6iq+1xZsZFr8joHgPD8JVMxN0M/fDgmv7Dw/zFSAEM78P9ejpgtRBPj EVYck7WmvtthkhjqqwGCJzWd7Z7sUIcxW5+whfa3ckLHDstnHuJNdo12v6JZZKVgXT/A oOoqh5aoLdV8lMaBbFfpp0y9PBo3eVoXjAVi3eg4p8gEGku2NEHSz4WeVFYOOjkiQ8vQ a0pQ6ymkaQJvoPIcHTQIm7XbssWHtQj5pbzaGD56U9kX6ZEcfvuAdugNKtKXfIFpUtn5 OJul74umWxZkVuXbg7YFUQVN1WTIWmFgDv1wvOaLiNtrOSCYU57zNd7x+kPYBLp2ol7G BLmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tkd5XZmK; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x2si4109053ejy.84.2020.08.06.11.42.23; Thu, 06 Aug 2020 11:42:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-samsung-soc-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=@kernel.org header.s=default header.b=tkd5XZmK; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729015AbgHFSl4 (ORCPT + 4 others); Thu, 6 Aug 2020 14:41:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:51364 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728368AbgHFSXc (ORCPT ); Thu, 6 Aug 2020 14:23:32 -0400 Received: from localhost.localdomain (unknown [194.230.155.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 38FE022D07; Thu, 6 Aug 2020 18:22:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596738142; bh=apFcycz/O6DDKT5iJ4SnSfgBjc6oT0XDJlH7NQkB7HA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tkd5XZmKI9D0TfLj3IIwE7AoFaSbzXVHqlCJGeuNO1nUNoY7SpZQ1eFehbh1pWTnM ryXCTDP13QexBPF9tKlsF4GCLvCK8Y31mKvwJJPqhjcKb5It0oGVlCEkPFcrdTL8dc 9OE8YCKKrmpGSgj8t4hg8AskNCoVCdrq8EhG4PiI= From: Krzysztof Kozlowski To: linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Krzysztof Kozlowski , Russell King , Kukjin Kim , Kyungmin Park , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 11/41] ARM: samsung: remove s3c_pm_debug_init() Date: Thu, 6 Aug 2020 20:20:28 +0200 Message-Id: <20200806182059.2431-11-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200806181932.2253-1-krzk@kernel.org> References: <20200806181932.2253-1-krzk@kernel.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Arnd Bergmann On s3c24xx and s3c64xx, this is just a wrapper around s3c_pm_debug_init_uart(), but this function does not exist on s5pv210, which always uses an empty stub as CONFIG_SAMSUNG_ATAGS is normally not set. In a configuration that supports both s5pv210 and s3c64xx, we would always call the s3c64xx function, which is probably incorrect when running on s5pv210. Remove the function call completely on s5pv210 and skip the wrapper on s3c as a cleanup. As a side-effect, the s3c64xx behavior is now always the same, regardless of whether it is a DT-only configuration or both DT and ATAGS are supported for booting. Signed-off-by: Arnd Bergmann Signed-off-by: Krzysztof Kozlowski --- arch/arm/mach-s3c24xx/include/mach/pm-core.h | 2 ++ arch/arm/mach-s3c64xx/include/mach/pm-core.h | 2 ++ arch/arm/mach-s5pv210/pm.c | 2 -- arch/arm/plat-samsung/include/plat/pm-common.h | 10 ---------- arch/arm/plat-samsung/pm-debug.c | 7 ------- arch/arm/plat-samsung/pm.c | 5 ++--- 6 files changed, 6 insertions(+), 22 deletions(-) -- 2.17.1 diff --git a/arch/arm/mach-s3c24xx/include/mach/pm-core.h b/arch/arm/mach-s3c24xx/include/mach/pm-core.h index 5e4ce89d0158..cd6406820cb1 100644 --- a/arch/arm/mach-s3c24xx/include/mach/pm-core.h +++ b/arch/arm/mach-s3c24xx/include/mach/pm-core.h @@ -15,6 +15,7 @@ static inline void s3c_pm_debug_init_uart(void) { +#ifdef CONFIG_SAMSUNG_PM_DEBUG unsigned long tmp = __raw_readl(S3C2410_CLKCON); /* re-start uart clocks */ @@ -24,6 +25,7 @@ static inline void s3c_pm_debug_init_uart(void) __raw_writel(tmp, S3C2410_CLKCON); udelay(10); +#endif } static inline void s3c_pm_arch_prepare_irqs(void) diff --git a/arch/arm/mach-s3c64xx/include/mach/pm-core.h b/arch/arm/mach-s3c64xx/include/mach/pm-core.h index bbf79ed28583..1c7d179a86f3 100644 --- a/arch/arm/mach-s3c64xx/include/mach/pm-core.h +++ b/arch/arm/mach-s3c64xx/include/mach/pm-core.h @@ -20,6 +20,7 @@ static inline void s3c_pm_debug_init_uart(void) { +#ifdef CONFIG_SAMSUNG_PM_DEBUG u32 tmp = __raw_readl(S3C_PCLK_GATE); /* As a note, since the S3C64XX UARTs generally have multiple @@ -35,6 +36,7 @@ static inline void s3c_pm_debug_init_uart(void) __raw_writel(tmp, S3C_PCLK_GATE); udelay(10); +#endif } static inline void s3c_pm_arch_prepare_irqs(void) diff --git a/arch/arm/mach-s5pv210/pm.c b/arch/arm/mach-s5pv210/pm.c index b336df0c57f3..725e6746f345 100644 --- a/arch/arm/mach-s5pv210/pm.c +++ b/arch/arm/mach-s5pv210/pm.c @@ -99,8 +99,6 @@ static int s5pv210_suspend_enter(suspend_state_t state) u32 eint_wakeup_mask = s5pv210_read_eint_wakeup_mask(); int ret; - s3c_pm_debug_init(); - S3C_PMDBG("%s: suspending the system...\n", __func__); S3C_PMDBG("%s: wakeup masks: %08x,%08x\n", __func__, diff --git a/arch/arm/plat-samsung/include/plat/pm-common.h b/arch/arm/plat-samsung/include/plat/pm-common.h index 1268bae04234..467e7c867c46 100644 --- a/arch/arm/plat-samsung/include/plat/pm-common.h +++ b/arch/arm/plat-samsung/include/plat/pm-common.h @@ -69,22 +69,12 @@ struct pm_uart_save { */ extern void s3c_pm_dbg(const char *msg, ...); -/** - * s3c_pm_debug_init() - suspend/resume low level debug initialization. - * @base: Virtual base of UART to use for suspend/resume debugging. - * - * This function needs to be called before S3C_PMDBG() can be used, to set up - * UART port base address and configuration. - */ -extern void s3c_pm_debug_init(void); - #define S3C_PMDBG(fmt...) s3c_pm_dbg(fmt) extern void s3c_pm_save_uarts(void); extern void s3c_pm_restore_uarts(void); #else #define S3C_PMDBG(fmt...) pr_debug(fmt) -#define s3c_pm_debug_init() do { } while (0) static inline void s3c_pm_save_uarts(void) { } static inline void s3c_pm_restore_uarts(void) { } diff --git a/arch/arm/plat-samsung/pm-debug.c b/arch/arm/plat-samsung/pm-debug.c index b76b1e9ba4ae..105b61f3304e 100644 --- a/arch/arm/plat-samsung/pm-debug.c +++ b/arch/arm/plat-samsung/pm-debug.c @@ -22,7 +22,6 @@ #include #include #else -static inline void s3c_pm_debug_init_uart(void) {} static inline void s3c_pm_arch_update_uart(void __iomem *regs, struct pm_uart_save *save) {} #endif @@ -43,12 +42,6 @@ void s3c_pm_dbg(const char *fmt, ...) printascii(buff); } -void s3c_pm_debug_init(void) -{ - /* restart uart clocks so we can use them to output */ - s3c_pm_debug_init_uart(); -} - static inline void __iomem *s3c_pm_uart_base(void) { unsigned long paddr; diff --git a/arch/arm/plat-samsung/pm.c b/arch/arm/plat-samsung/pm.c index d6bfd66592b0..b40ab7abe6a9 100644 --- a/arch/arm/plat-samsung/pm.c +++ b/arch/arm/plat-samsung/pm.c @@ -70,8 +70,7 @@ static int s3c_pm_enter(suspend_state_t state) { int ret; /* ensure the debug is initialised (if enabled) */ - - s3c_pm_debug_init(); + s3c_pm_debug_init_uart(); S3C_PMDBG("%s(%d)\n", __func__, state); @@ -144,7 +143,7 @@ static int s3c_pm_enter(suspend_state_t state) s3c_pm_restored_gpios(); } - s3c_pm_debug_init(); + s3c_pm_debug_init_uart(); /* check what irq (if any) restored the system */ From patchwork Thu Aug 6 18:20:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 247517 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1744324ilo; Thu, 6 Aug 2020 11:37:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/TYL2oPXZg+85zzsb51v+fYvyQjZtP+viFQLZB+ovoEHLjM9xxnll3v65jGeAB6jGkiyx X-Received: by 2002:aa7:c259:: with SMTP id y25mr4625622edo.130.1596739045342; Thu, 06 Aug 2020 11:37:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596739045; cv=none; d=google.com; s=arc-20160816; b=IMW+4Ql3JKsoZbTmKDX8bJsZv7SY1mn/RhiVcjl6PF72kUQoYePokJubq50cIn3ery gDxOJeRYJh+S/XVPjEL0gz8QS9YcBLtx1bWb/pOGs7rZisY6DcS0EA0ECDb902VNEQuC Dm9Sm5Dw67UXIUO+35XYcDO5FllZmVwp1iikbtS+f55/XExecqKYWiXO5m13UiGp4SN3 KRdUBFPOTmMEs5rNlDr/XNYjpomno6MQVP2bY63hZNJ9mG5GbvPjSgZVkMbv/XCjrBEa mJDMAadjWHylK5zrM1pQF/WH1w8V+UbqRjMoehXvYgXdiLo1DO/d/BDdLeXTHc1ueYTH +hLg== ARC-Message-Signature: i=1; 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; bh=rbT7bm3svthYt8AcJmNRXuzrvW2Md1gCqxHdC0PiGno=; b=fGU3g2ObG2+4B8ukCeFrRsuusqjAyXtFc15/xnNT00sGNYmzEKj5Ty/lqGigcnXLh/ qLK6xFDRa2MQIVs5yQxoCqQfAtUY4eYW/39bGnyuSAZ7XWWvoc24WZ+ChautlB+ZR1Wh NGBUZOVTqOH7q10IRhhES8vdBYcI84SWDzxyWqgmn4s/+27VApRrGZe1gm2Ayqk4S42Q n4pskFi1MAfIV/is3J89YeDCqR0U8onEe1z8yTisxPHaBE0TT9FSdP89i9eH2qA406oH uew1v8SEX2CPGskh9ZOyQhrP4ar7lBue2R5ru8fbLfmLjb4WSsNEhEANx5yIesudxwaP raog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cVykUEsX; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ga10si3783633ejb.372.2020.08.06.11.37.25; Thu, 06 Aug 2020 11:37:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-samsung-soc-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=@kernel.org header.s=default header.b=cVykUEsX; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729601AbgHFShX (ORCPT + 4 others); Thu, 6 Aug 2020 14:37:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:58938 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729031AbgHFSf7 (ORCPT ); Thu, 6 Aug 2020 14:35:59 -0400 Received: from localhost.localdomain (unknown [194.230.155.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F3F2222D0B; Thu, 6 Aug 2020 18:22:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596738144; bh=SjPJsYrN3QRqHdDAx/ThlGF33s4qIJNCl4XoopDuY6Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cVykUEsX/OUpnsTlsq0nkF0ICVW5WxJlXQtVx00AL3zeBRe2rLWePXLOsQWqllsjX xgY9+r4wcRkKmXizwubDy6mngreyoyOko3SoeJxMdfEMTcn4WAV6QOnOqtOj286dH3 wq4S1Ub0nRxKjOS5+WnXA68R1fhzB9WEX2tlnWsk= From: Krzysztof Kozlowski To: linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Krzysztof Kozlowski , Russell King , Kukjin Kim , Kyungmin Park , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 12/41] ARM: samsung: make pm-debug platform independent Date: Thu, 6 Aug 2020 20:20:29 +0200 Message-Id: <20200806182059.2431-12-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200806181932.2253-1-krzk@kernel.org> References: <20200806181932.2253-1-krzk@kernel.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Arnd Bergmann The pm-debug code is one of the few things shared between s3c24xx/s3c64xx and the newer s5pv210. In order to make s5pv210 independent of plat-samsung, change the common bits of this code to no longer reference the s3c specific bits. In particular, all the CPU checks need to be moved out of the common code into platform specific files. Signed-off-by: Arnd Bergmann Signed-off-by: Krzysztof Kozlowski --- arch/arm/mach-s3c24xx/include/mach/pm-core.h | 5 -- arch/arm/mach-s3c64xx/include/mach/pm-core.h | 42 ---------------- arch/arm/mach-s3c64xx/pm.c | 50 +++++++++++++++++++ arch/arm/mach-s5pv210/pm.c | 4 +- .../arm/plat-samsung/include/plat/pm-common.h | 19 +++++-- arch/arm/plat-samsung/pm-debug.c | 16 ++---- arch/arm/plat-samsung/pm.c | 5 +- 7 files changed, 74 insertions(+), 67 deletions(-) -- 2.17.1 diff --git a/arch/arm/mach-s3c24xx/include/mach/pm-core.h b/arch/arm/mach-s3c24xx/include/mach/pm-core.h index cd6406820cb1..8f87606c4cdc 100644 --- a/arch/arm/mach-s3c24xx/include/mach/pm-core.h +++ b/arch/arm/mach-s3c24xx/include/mach/pm-core.h @@ -77,11 +77,6 @@ static inline void s3c_pm_arch_show_resume_irqs(void) s3c_irqwake_eintmask); } -static inline void s3c_pm_arch_update_uart(void __iomem *regs, - struct pm_uart_save *save) -{ -} - static inline void s3c_pm_restored_gpios(void) { } static inline void samsung_pm_saved_gpios(void) { } diff --git a/arch/arm/mach-s3c64xx/include/mach/pm-core.h b/arch/arm/mach-s3c64xx/include/mach/pm-core.h index 1c7d179a86f3..33cf242734a0 100644 --- a/arch/arm/mach-s3c64xx/include/mach/pm-core.h +++ b/arch/arm/mach-s3c64xx/include/mach/pm-core.h @@ -65,48 +65,6 @@ static inline void s3c_pm_arch_show_resume_irqs(void) #define s3c_irqwake_intallow 0 #endif -static inline void s3c_pm_arch_update_uart(void __iomem *regs, - struct pm_uart_save *save) -{ - u32 ucon = __raw_readl(regs + S3C2410_UCON); - u32 ucon_clk = ucon & S3C6400_UCON_CLKMASK; - u32 save_clk = save->ucon & S3C6400_UCON_CLKMASK; - u32 new_ucon; - u32 delta; - - /* S3C64XX UART blocks only support level interrupts, so ensure that - * when we restore unused UART blocks we force the level interrupt - * settigs. */ - save->ucon |= S3C2410_UCON_TXILEVEL | S3C2410_UCON_RXILEVEL; - - /* We have a constraint on changing the clock type of the UART - * between UCLKx and PCLK, so ensure that when we restore UCON - * that the CLK field is correctly modified if the bootloader - * has changed anything. - */ - if (ucon_clk != save_clk) { - new_ucon = save->ucon; - delta = ucon_clk ^ save_clk; - - /* change from UCLKx => wrong PCLK, - * either UCLK can be tested for by a bit-test - * with UCLK0 */ - if (ucon_clk & S3C6400_UCON_UCLK0 && - !(save_clk & S3C6400_UCON_UCLK0) && - delta & S3C6400_UCON_PCLK2) { - new_ucon &= ~S3C6400_UCON_UCLK0; - } else if (delta == S3C6400_UCON_PCLK2) { - /* as an precaution, don't change from - * PCLK2 => PCLK or vice-versa */ - new_ucon ^= S3C6400_UCON_PCLK2; - } - - S3C_PMDBG("ucon change %04x => %04x (save=%04x)\n", - ucon, new_ucon, save->ucon); - save->ucon = new_ucon; - } -} - static inline void s3c_pm_restored_gpios(void) { /* ensure sleep mode has been cleared from the system */ diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c index fd6dbb263ed5..a612e9779057 100644 --- a/arch/arm/mach-s3c64xx/pm.c +++ b/arch/arm/mach-s3c64xx/pm.c @@ -305,6 +305,56 @@ static void s3c64xx_pm_prepare(void) __raw_writel(__raw_readl(S3C64XX_WAKEUP_STAT), S3C64XX_WAKEUP_STAT); } +#ifdef CONFIG_SAMSUNG_PM_DEBUG +void s3c_pm_arch_update_uart(void __iomem *regs, struct pm_uart_save *save) +{ + u32 ucon; + u32 ucon_clk + u32 save_clk; + u32 new_ucon; + u32 delta; + + if (!soc_is_s3c64xx()) + return; + + ucon = __raw_readl(regs + S3C2410_UCON); + ucon_clk = ucon & S3C6400_UCON_CLKMASK; + sav_clk = save->ucon & S3C6400_UCON_CLKMASK; + + /* S3C64XX UART blocks only support level interrupts, so ensure that + * when we restore unused UART blocks we force the level interrupt + * settigs. */ + save->ucon |= S3C2410_UCON_TXILEVEL | S3C2410_UCON_RXILEVEL; + + /* We have a constraint on changing the clock type of the UART + * between UCLKx and PCLK, so ensure that when we restore UCON + * that the CLK field is correctly modified if the bootloader + * has changed anything. + */ + if (ucon_clk != save_clk) { + new_ucon = save->ucon; + delta = ucon_clk ^ save_clk; + + /* change from UCLKx => wrong PCLK, + * either UCLK can be tested for by a bit-test + * with UCLK0 */ + if (ucon_clk & S3C6400_UCON_UCLK0 && + !(save_clk & S3C6400_UCON_UCLK0) && + delta & S3C6400_UCON_PCLK2) { + new_ucon &= ~S3C6400_UCON_UCLK0; + } else if (delta == S3C6400_UCON_PCLK2) { + /* as an precaution, don't change from + * PCLK2 => PCLK or vice-versa */ + new_ucon ^= S3C6400_UCON_PCLK2; + } + + S3C_PMDBG("ucon change %04x => %04x (save=%04x)\n", + ucon, new_ucon, save->ucon); + save->ucon = new_ucon; + } +} +#endif + int __init s3c64xx_pm_init(void) { int i; diff --git a/arch/arm/mach-s5pv210/pm.c b/arch/arm/mach-s5pv210/pm.c index 725e6746f345..efdb5a27c060 100644 --- a/arch/arm/mach-s5pv210/pm.c +++ b/arch/arm/mach-s5pv210/pm.c @@ -111,7 +111,7 @@ static int s5pv210_suspend_enter(suspend_state_t state) return -EINVAL; } - s3c_pm_save_uarts(); + s3c_pm_save_uarts(false); s5pv210_pm_prepare(); flush_cache_all(); s3c_pm_check_store(); @@ -120,7 +120,7 @@ static int s5pv210_suspend_enter(suspend_state_t state) if (ret) return ret; - s3c_pm_restore_uarts(); + s3c_pm_restore_uarts(false); S3C_PMDBG("%s: wakeup stat: %08x\n", __func__, __raw_readl(S5P_WAKEUP_STAT)); diff --git a/arch/arm/plat-samsung/include/plat/pm-common.h b/arch/arm/plat-samsung/include/plat/pm-common.h index 467e7c867c46..87fa97fd6e8b 100644 --- a/arch/arm/plat-samsung/include/plat/pm-common.h +++ b/arch/arm/plat-samsung/include/plat/pm-common.h @@ -71,13 +71,24 @@ extern void s3c_pm_dbg(const char *msg, ...); #define S3C_PMDBG(fmt...) s3c_pm_dbg(fmt) -extern void s3c_pm_save_uarts(void); -extern void s3c_pm_restore_uarts(void); +extern void s3c_pm_save_uarts(bool is_s3c24xx); +extern void s3c_pm_restore_uarts(bool is_s3c24xx); + +#ifdef CONFIG_ARCH_S3C64XX +extern void s3c_pm_arch_update_uart(void __iomem *regs, + struct pm_uart_save *save); +#else +static inline void +s3c_pm_arch_update_uart(void __iomem *regs, struct pm_uart_save *save) +{ +} +#endif + #else #define S3C_PMDBG(fmt...) pr_debug(fmt) -static inline void s3c_pm_save_uarts(void) { } -static inline void s3c_pm_restore_uarts(void) { } +static inline void s3c_pm_save_uarts(bool is_s3c24xx) { } +static inline void s3c_pm_restore_uarts(bool is_s3c24xx) { } #endif /* suspend memory checking */ diff --git a/arch/arm/plat-samsung/pm-debug.c b/arch/arm/plat-samsung/pm-debug.c index 105b61f3304e..482d53753e93 100644 --- a/arch/arm/plat-samsung/pm-debug.c +++ b/arch/arm/plat-samsung/pm-debug.c @@ -18,14 +18,6 @@ #include #include -#ifdef CONFIG_SAMSUNG_ATAGS -#include -#include -#else -static inline void s3c_pm_arch_update_uart(void __iomem *regs, - struct pm_uart_save *save) {} -#endif - static struct pm_uart_save uart_save; extern void printascii(const char *); @@ -52,7 +44,7 @@ static inline void __iomem *s3c_pm_uart_base(void) return (void __iomem *)vaddr; } -void s3c_pm_save_uarts(void) +void s3c_pm_save_uarts(bool is_s3c2410) { void __iomem *regs = s3c_pm_uart_base(); struct pm_uart_save *save = &uart_save; @@ -63,14 +55,14 @@ void s3c_pm_save_uarts(void) save->umcon = __raw_readl(regs + S3C2410_UMCON); save->ubrdiv = __raw_readl(regs + S3C2410_UBRDIV); - if (!soc_is_s3c2410()) + if (!is_s3c2410) save->udivslot = __raw_readl(regs + S3C2443_DIVSLOT); S3C_PMDBG("UART[%p]: ULCON=%04x, UCON=%04x, UFCON=%04x, UBRDIV=%04x\n", regs, save->ulcon, save->ucon, save->ufcon, save->ubrdiv); } -void s3c_pm_restore_uarts(void) +void s3c_pm_restore_uarts(bool is_s3c2410) { void __iomem *regs = s3c_pm_uart_base(); struct pm_uart_save *save = &uart_save; @@ -83,6 +75,6 @@ void s3c_pm_restore_uarts(void) __raw_writel(save->umcon, regs + S3C2410_UMCON); __raw_writel(save->ubrdiv, regs + S3C2410_UBRDIV); - if (!soc_is_s3c2410()) + if (!is_s3c2410) __raw_writel(save->udivslot, regs + S3C2443_DIVSLOT); } diff --git a/arch/arm/plat-samsung/pm.c b/arch/arm/plat-samsung/pm.c index b40ab7abe6a9..03c22a9dee21 100644 --- a/arch/arm/plat-samsung/pm.c +++ b/arch/arm/plat-samsung/pm.c @@ -25,6 +25,7 @@ #include +#include #include #include @@ -99,7 +100,7 @@ static int s3c_pm_enter(suspend_state_t state) samsung_pm_saved_gpios(); } - s3c_pm_save_uarts(); + s3c_pm_save_uarts(soc_is_s3c2410()); s3c_pm_save_core(); /* set the irq configuration for wake */ @@ -136,7 +137,7 @@ static int s3c_pm_enter(suspend_state_t state) /* restore the system state */ s3c_pm_restore_core(); - s3c_pm_restore_uarts(); + s3c_pm_restore_uarts(soc_is_s3c2410()); if (!of_have_populated_dt()) { samsung_pm_restore_gpios(); From patchwork Thu Aug 6 18:20:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 247506 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1743188ilo; Thu, 6 Aug 2020 11:35:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzudkAyEsMWnR+UScNKzAtF+fHqSwSJDEEhNQ5Idsk4h0VWt/vf8JtEIktK3PXT5b8wc71v X-Received: by 2002:aa7:c915:: with SMTP id b21mr5464495edt.17.1596738958019; Thu, 06 Aug 2020 11:35:58 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h14si3989758eje.503.2020.08.06.11.35.57; Thu, 06 Aug 2020 11:35:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-samsung-soc-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=@kernel.org header.s=default header.b=wcaczOFF; arc=fail (signature failed); spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725783AbgHFSfy (ORCPT + 4 others); Thu, 6 Aug 2020 14:35:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728545AbgHFSex (ORCPT ); Thu, 6 Aug 2020 14:34:53 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BA68C0617A2 for ; Thu, 6 Aug 2020 11:34:42 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id t14so10615814wmi.3 for ; Thu, 06 Aug 2020 11:34:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:resent-from:resent-date:resent-message-id :resent-to:dkim-signature:from:to:cc:subject:date:message-id :in-reply-to:references; bh=p2JRocSR61t8MIpRNyaLstFtZmZuGgXB0g+/i6fpFKA=; b=asBxqDQEa66NGBXF3Y07MNLO6debM2BgQjXkbNzZlrUSUkeB/HpqPSNzz2uWBWcIBW lEjyK37/RqL+DwnhHlB+Ed2Wgsz+YdHPxuiALDrFwBCnkIYFdL1LbeEUUq5OzeqS4rq9 lZmr9YHbnaQFb+CdbvtIG9cU2/4er21AfwP/HzneKPhjKzibP4QtZ7tTPFqyMAPdG0a6 a+PGumM6jJ6R9bmeM39wxiclz4r57ob2AmdqNTdpBLYnQye8ssIibRfoxrLQsqPfMKho 9aaPFapEJ7Nup2HJ4HPCR8zygTgaoByuGnvb+7Y/ie5re5vRbJUxguw2SsWVDD+VMVW2 ZA2g== X-Gm-Message-State: AOAM5309AbaS12P7KzxAuRA3iJavXqT84+QZjZRR0VQ8j7v1hwrgDEb7 Dv4xAEEVPXeGkQ2AGKEV1lHD6lJkrj0= X-Received: by 2002:a1c:9d86:: with SMTP id g128mr9672978wme.78.1596738880496; Thu, 06 Aug 2020 11:34:40 -0700 (PDT) Received: from kozik-lap ([194.230.155.117]) by smtp.googlemail.com with ESMTPSA id v16sm4376761wmj.14.2020.08.06.11.34.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Aug 2020 11:34:40 -0700 (PDT) Received: by 2002:ab3:1105:0:0:0:0:0 with SMTP id j5csp1541011lta; Thu, 6 Aug 2020 11:22:29 -0700 (PDT) X-Received: by 2002:a17:90a:3549:: with SMTP id q67mr9720260pjb.56.1596738149026; Thu, 06 Aug 2020 11:22:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596738149; cv=none; d=google.com; s=arc-20160816; b=LT6i3fqV4ULBF5KEWgfsPzaUebBjnA+S5wZQ7Gc4lsVC1tBJNUCOdN8WlOTeg7MB8/ EQN1rMAUqd08pMzmZTXiL3mo46QTHxUL//D3jHGCPLxIIQAm/MmGqxoN/xWbDVdreMHf brrL2pvN4Wb114Ar8BX54tG3VGTpjRdVcaSP48V2YmQdEi/EStDbsiodHYqmAHIdqLaD nGQVMnfgI1gn0kG1DODBJIFrDbDA+uRzwh9pcjB4UrEX1CfsfVhKL9c3Kz9AATnNKhO3 QX/YLNUHrAa6ILjZZdwfXhk4lBZhqB9byDn6uzq6kAY5OAJp0W5ZVjfojds9/lRVJ1S5 PB4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to; bh=p2JRocSR61t8MIpRNyaLstFtZmZuGgXB0g+/i6fpFKA=; b=Flvv4CgkJ8fE48SXwc/2GnjosFc0Ooemq5l+tTfQOs++pYWEqEBoGuvqDtPKHVhsqD RjziEYnI0ojVg0wffmjblrzg0jt2O/RDE9qZ4ax4hWnVYEqzUvA5D1enuzH7xq4FdZcM RIVCL84bfyzYkcKL7ooT85NgzBlQDUEOte5mOZq/90FGMSdjZx2dlMb01POxM2Sa47sT 8D81HfygQfTiLhw5wewVBW2YalPkGwlMcJ8LxEQcps34kEFSopZroh/HyrzY2rrMdEKC qfHPzjRxA44hE1LVTGlXXBWb1a5NcG3FzX+CzBF0fuCBpu3KPVcAZFIhnMj2mS/Oov5x ojyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wcaczOFF; spf=pass (google.com: domain of krzk@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=krzk@kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from mail.kernel.org (mail.kernel.org. [198.145.29.99]) by mx.google.com with ESMTPS id y196si265083pfc.20.2020.08.06.11.22.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Aug 2020 11:22:29 -0700 (PDT) Received-SPF: pass (google.com: domain of krzk@kernel.org designates 198.145.29.99 as permitted sender) client-ip=198.145.29.99; Received: by mail.kernel.org (Postfix) id 2638A22D0A; Thu, 6 Aug 2020 18:22:29 +0000 (UTC) Received: from localhost.localdomain (unknown [194.230.155.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A45B522D3E; Thu, 6 Aug 2020 18:22:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596738149; bh=p2adxRzepEbIsLQnxW34looRrw9LWsLu4tmaRjq+7iw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wcaczOFFmsp8VscB4RMRsZcUMJ3Z9GGnvUERUz4wHqpgjT1ohnI5xUO58LjaXZubK XtjlA67UwEUfBH27ZKthnNxsFPkkgEQbTIPoFRm1pwSeQk9Lgi69cKBZtdQDngiuzr PsTRrHbU6fm17mWaxBr7oHpYsiM6ZNn/fQRs/wSY= From: Krzysztof Kozlowski To: linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Krzysztof Kozlowski , Russell King , linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 13/41] ARM: samsung: move CONFIG_DEBUG_S3C_UART to Kconfig.debug Date: Thu, 6 Aug 2020 20:20:30 +0200 Message-Id: <20200806182059.2431-13-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200806181932.2253-1-krzk@kernel.org> References: <20200806181932.2253-1-krzk@kernel.org> X-TUID: 1MazrltmgdNt Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Arnd Bergmann Before we can separate plat-samsung from the individual platforms, this one has to get moved to a place where it remains accessible. Signed-off-by: Arnd Bergmann Signed-off-by: Krzysztof Kozlowski --- arch/arm/Kconfig.debug | 10 ++++++++++ arch/arm/plat-samsung/Kconfig | 8 -------- 2 files changed, 10 insertions(+), 8 deletions(-) -- 2.17.1 diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 80000a66a4e3..7c34cf5c4a5b 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -1497,6 +1497,16 @@ config DEBUG_S3C64XX_UART config DEBUG_S5PV210_UART bool +config DEBUG_S3C_UART + depends on DEBUG_S3C2410_UART || DEBUG_S3C24XX_UART || \ + DEBUG_S3C64XX_UART || DEBUG_S5PV210_UART || \ + DEBUG_EXYNOS_UART + int + default "0" if DEBUG_S3C_UART0 + default "1" if DEBUG_S3C_UART1 + default "2" if DEBUG_S3C_UART2 + default "3" if DEBUG_S3C_UART3 + config DEBUG_OMAP2PLUS_UART bool depends on ARCH_OMAP2PLUS diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig index 3aca01067b3c..c3d18b0aad75 100644 --- a/arch/arm/plat-samsung/Kconfig +++ b/arch/arm/plat-samsung/Kconfig @@ -290,13 +290,5 @@ config SAMSUNG_WAKEMASK and above. This code allows a set of interrupt to wakeup-mask mappings. See -config DEBUG_S3C_UART - depends on PLAT_SAMSUNG - int - default "0" if DEBUG_S3C_UART0 - default "1" if DEBUG_S3C_UART1 - default "2" if DEBUG_S3C_UART2 - default "3" if DEBUG_S3C_UART3 - endmenu endif From patchwork Thu Aug 6 18:20:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 247513 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1744098ilo; Thu, 6 Aug 2020 11:37:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxP1X1BYSrI5r6eQhr6OED5FmQU67FS5zHE/fYC7iNVOpWuivhWAxBNzhLwoiQtps9C9xP9 X-Received: by 2002:a17:906:68da:: with SMTP id y26mr5567187ejr.250.1596739025649; Thu, 06 Aug 2020 11:37:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596739025; cv=none; d=google.com; s=arc-20160816; b=zBEThaZaVfo8aTKQC4l8cklgP1Aeic2wmmjAK8zf8Fac7AOOf3hvGH1WVxz4k+I/iy kWGKdXGg9dpHaw4DeHyGCWNdm6l0BHzMX4JYcNBDygPnAwRvoh8TIdNRLyjagtDcSjBq pC7vfzI6loXwm0TPPl+ykj6MW0O+0DcLyWfpIkQHYRRsSWz9gddpMBtEFabh7IlbRYi3 4567bvv+aNcrMilKhZBAzynVd/K7t1JPsGSacgHn/9qFeQnw/K1kWeYq/w+BvVl34RpX lEx4+z6NYG31+BHH8lCNIeuf0Dk8+gsyw3i4YutAQ7OUua/Ys64gG8SYneM6v/wraISQ b1Lg== ARC-Message-Signature: i=1; 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; bh=z0laPc+YGbAaOpLPVXCOJEX3eCrpwpLOr1fJZRrYdTA=; b=g6iuPcYWtEtlJnSo05zdrxPVR9SGwMeCvKgCnvd/z5koS3mSHUyjczfBr1TNoOYL2T lWx0mx+x8Kx6woYB16E9i269mL1IFahLliBoaHZaVHpYaAamEkG0imLdLwN5SqHdTGf/ N5OtDsjDZqmm7SvQKGhiYoIQK4bt2JENM8Rp0QP7d+R26xyyUCKQKE8oSOj7n2Kk12Pu PtBj9dUThkAkPE2am41IuoDy/Ww64jfLqYYD0WmPxGDbnyzQPXZHZa9XKA0jGIPGwe4k /dEb4CEVrWjqnlDQMTCWKMEOk3YWRQZNwBaFQrr0b6HSGSRMpEVTkmj1dONGNoGx5Hmf kiQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1S4zLTBm; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i20si3758027edg.519.2020.08.06.11.37.05; Thu, 06 Aug 2020 11:37:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-samsung-soc-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=@kernel.org header.s=default header.b=1S4zLTBm; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729505AbgHFShE (ORCPT + 4 others); Thu, 6 Aug 2020 14:37:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:58944 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729246AbgHFSf7 (ORCPT ); Thu, 6 Aug 2020 14:35:59 -0400 Received: from localhost.localdomain (unknown [194.230.155.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 082BF22D6D; Thu, 6 Aug 2020 18:22:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596738152; bh=/PMFfjSk9NUyRsvmP0bvVqx8N1FcZ6fBEHmpqrMucOI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1S4zLTBmIHGjPEL4OKjzgFV4utfJ4dcw40HvBwh1wzYezEOz5Za+hDxp8wJjLfdzt iBrk6tWN3kstsDQrv76NuOhxCXd88m202qMfFVS0YLkbp1a+6/DmKb2Lab4/Kg7Lfy 331LMtu5hVk5T+XSDC3/yAUcXA54WZuZR1Ja77UI= From: Krzysztof Kozlowski To: linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Krzysztof Kozlowski , Russell King , Kukjin Kim , Bartlomiej Zolnierkiewicz , Daniel Lezcano , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH v2 14/41] ARM: exynos: use private samsung_cpu_id copy Date: Thu, 6 Aug 2020 20:20:31 +0200 Message-Id: <20200806182059.2431-14-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200806181932.2253-1-krzk@kernel.org> References: <20200806181932.2253-1-krzk@kernel.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Arnd Bergmann The only part of plat-samsung that is shared with arch-exynos is the CPU identification code. Having a separate exynos_cpu_id variable makes the two completely independent and is actually a bit less code in total. Signed-off-by: Arnd Bergmann Signed-off-by: Krzysztof Kozlowski --- arch/arm/mach-exynos/common.h | 6 +++--- arch/arm/mach-exynos/exynos.c | 21 ++++++++++++++++---- arch/arm/mach-exynos/include/mach/map.h | 18 ----------------- arch/arm/mach-exynos/platsmp.c | 4 +--- arch/arm/mach-exynos/pm.c | 8 ++++---- arch/arm/plat-samsung/cpu.c | 17 ---------------- arch/arm/plat-samsung/include/plat/cpu.h | 3 --- arch/arm/plat-samsung/include/plat/map-s5p.h | 2 -- 8 files changed, 25 insertions(+), 54 deletions(-) delete mode 100644 arch/arm/mach-exynos/include/mach/map.h -- 2.17.1 diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h index afd988a92836..29eb075b24a4 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h @@ -24,12 +24,12 @@ #define EXYNOS5800_SOC_ID 0xE5422000 #define EXYNOS5_SOC_MASK 0xFFFFF000 -extern unsigned long samsung_cpu_id; +extern unsigned long exynos_cpu_id; #define IS_SAMSUNG_CPU(name, id, mask) \ static inline int is_samsung_##name(void) \ { \ - return ((samsung_cpu_id & mask) == (id & mask)); \ + return ((exynos_cpu_id & mask) == (id & mask)); \ } IS_SAMSUNG_CPU(exynos3250, EXYNOS3250_SOC_ID, EXYNOS3_SOC_MASK) @@ -147,7 +147,7 @@ extern struct cpuidle_exynos_data cpuidle_coupled_exynos_data; extern void exynos_set_delayed_reset_assertion(bool enable); -extern unsigned int samsung_rev(void); +extern unsigned int exynos_rev(void); extern void exynos_core_restart(u32 core_id); extern int exynos_set_boot_addr(u32 core_id, unsigned long boot_addr); extern int exynos_get_boot_addr(u32 core_id, unsigned long *boot_addr); diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c index 36c37444485a..3503274e5875 100644 --- a/arch/arm/mach-exynos/exynos.c +++ b/arch/arm/mach-exynos/exynos.c @@ -19,11 +19,12 @@ #include #include -#include -#include - #include "common.h" +#define S3C_ADDR_BASE 0xF6000000 +#define S3C_ADDR(x) ((void __iomem __force *)S3C_ADDR_BASE + (x)) +#define S5P_VA_CHIPID S3C_ADDR(0x02000000) + static struct platform_device exynos_cpuidle = { .name = "exynos_cpuidle", #ifdef CONFIG_ARM_EXYNOS_CPUIDLE @@ -36,6 +37,14 @@ void __iomem *sysram_base_addr __ro_after_init; phys_addr_t sysram_base_phys __ro_after_init; void __iomem *sysram_ns_base_addr __ro_after_init; +unsigned long exynos_cpu_id; +static unsigned int exynos_cpu_rev; + +unsigned int exynos_rev(void) +{ + return exynos_cpu_rev; +} + void __init exynos_sysram_init(void) { struct device_node *node; @@ -86,7 +95,11 @@ static void __init exynos_init_io(void) of_scan_flat_dt(exynos_fdt_map_chipid, NULL); /* detect cpu id and rev. */ - s5p_init_cpu(S5P_VA_CHIPID); + exynos_cpu_id = readl_relaxed(S5P_VA_CHIPID); + exynos_cpu_rev = exynos_cpu_id & 0xFF; + + pr_info("Samsung CPU ID: 0x%08lx\n", exynos_cpu_id); + } /* diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h deleted file mode 100644 index 8d58faa54ff7..000000000000 --- a/arch/arm/mach-exynos/include/mach/map.h +++ /dev/null @@ -1,18 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. - * http://www.samsung.com/ - * - * Exynos - Memory map definitions - */ - -#ifndef __ASM_ARCH_MAP_H -#define __ASM_ARCH_MAP_H __FILE__ - -#include - -#include - -#define EXYNOS_PA_CHIPID 0x10000000 - -#endif /* __ASM_ARCH_MAP_H */ diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c index 0cbbae8bf1f8..d7fedbb2eefe 100644 --- a/arch/arm/mach-exynos/platsmp.c +++ b/arch/arm/mach-exynos/platsmp.c @@ -22,8 +22,6 @@ #include #include -#include - #include "common.h" extern void exynos4_secondary_startup(void); @@ -188,7 +186,7 @@ void exynos_scu_enable(void) static void __iomem *cpu_boot_reg_base(void) { - if (soc_is_exynos4210() && samsung_rev() == EXYNOS4210_REV_1_1) + if (soc_is_exynos4210() && exynos_rev() == EXYNOS4210_REV_1_1) return pmu_base_addr + S5P_INFORM5; return sysram_base_addr; } diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c index 78af34cc89cc..30f4e55bf39e 100644 --- a/arch/arm/mach-exynos/pm.c +++ b/arch/arm/mach-exynos/pm.c @@ -26,18 +26,18 @@ static inline void __iomem *exynos_boot_vector_addr(void) { - if (samsung_rev() == EXYNOS4210_REV_1_1) + if (exynos_rev() == EXYNOS4210_REV_1_1) return pmu_base_addr + S5P_INFORM7; - else if (samsung_rev() == EXYNOS4210_REV_1_0) + else if (exynos_rev() == EXYNOS4210_REV_1_0) return sysram_base_addr + 0x24; return pmu_base_addr + S5P_INFORM0; } static inline void __iomem *exynos_boot_vector_flag(void) { - if (samsung_rev() == EXYNOS4210_REV_1_1) + if (exynos_rev() == EXYNOS4210_REV_1_1) return pmu_base_addr + S5P_INFORM6; - else if (samsung_rev() == EXYNOS4210_REV_1_0) + else if (exynos_rev() == EXYNOS4210_REV_1_0) return sysram_base_addr + 0x20; return pmu_base_addr + S5P_INFORM1; } diff --git a/arch/arm/plat-samsung/cpu.c b/arch/arm/plat-samsung/cpu.c index e1ba88ba31d8..8acba21bbf4b 100644 --- a/arch/arm/plat-samsung/cpu.c +++ b/arch/arm/plat-samsung/cpu.c @@ -14,13 +14,6 @@ #include unsigned long samsung_cpu_id; -static unsigned int samsung_cpu_rev; - -unsigned int samsung_rev(void) -{ - return samsung_cpu_rev; -} -EXPORT_SYMBOL(samsung_rev); void __init s3c64xx_init_cpu(void) { @@ -34,15 +27,5 @@ void __init s3c64xx_init_cpu(void) samsung_cpu_id = readl_relaxed(S3C_VA_SYS + 0xA1C); } - samsung_cpu_rev = 0; - - pr_info("Samsung CPU ID: 0x%08lx\n", samsung_cpu_id); -} - -void __init s5p_init_cpu(const void __iomem *cpuid_addr) -{ - samsung_cpu_id = readl_relaxed(cpuid_addr); - samsung_cpu_rev = samsung_cpu_id & 0xFF; - pr_info("Samsung CPU ID: 0x%08lx\n", samsung_cpu_id); } diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h index fadcddbea064..93ecd7127831 100644 --- a/arch/arm/plat-samsung/include/plat/cpu.h +++ b/arch/arm/plat-samsung/include/plat/cpu.h @@ -109,9 +109,6 @@ extern void s3c_init_cpu(unsigned long idcode, extern void s3c24xx_init_io(struct map_desc *mach_desc, int size); extern void s3c64xx_init_cpu(void); -extern void s5p_init_cpu(const void __iomem *cpuid_addr); - -extern unsigned int samsung_rev(void); extern void s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no); diff --git a/arch/arm/plat-samsung/include/plat/map-s5p.h b/arch/arm/plat-samsung/include/plat/map-s5p.h index d69a0ca09fb5..3812085f8761 100644 --- a/arch/arm/plat-samsung/include/plat/map-s5p.h +++ b/arch/arm/plat-samsung/include/plat/map-s5p.h @@ -9,8 +9,6 @@ #ifndef __ASM_PLAT_MAP_S5P_H #define __ASM_PLAT_MAP_S5P_H __FILE__ -#define S5P_VA_CHIPID S3C_ADDR(0x02000000) - #define VA_VIC(x) (S3C_VA_IRQ + ((x) * 0x10000)) #define VA_VIC0 VA_VIC(0) #define VA_VIC1 VA_VIC(1) From patchwork Thu Aug 6 18:20:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 247519 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1744879ilo; Thu, 6 Aug 2020 11:38:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydqLU8UBmK2SNjts2cXP4jbIsEhCECwfYEyySvSie4XGBme61FDl0ZEXPE7Woq5oetzP98 X-Received: by 2002:a50:8ace:: with SMTP id k14mr5472488edk.0.1596739100674; Thu, 06 Aug 2020 11:38:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596739100; cv=none; d=google.com; s=arc-20160816; b=N0Mm+MwdFkQBiryeGr0+SWdP2u+YZI69UPIxiU7j9f4nZ/9ZspEsxb8MzqW6lEQFvW KQWAvDcLEt8i8C1RPD+JTWaD1bVJHX7W6sBJcwurgZMDaJTZenAqA+Och/sV8cG0+ERp Rfz8y/nJDhkFxHIo1m2X4zy6jvf/ZYfzxDjsR86mXlwPBENwAQL1Fm3A6TOxAV/dkTp2 6w9myjB0KJylYwaKz3452XnkDqDyeN4gr5VHJFnax+e6Dr+D4N6wRxFINQpDemmtdk85 85XUS1VlxvIdvYXyQjarnDgZ5hUNtU4nnkovs/2RLwlr/unceWxjBQlBN53KekGJk9Ac 77AA== ARC-Message-Signature: i=1; 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; bh=PM4hWwORIHekonuHXUaMma5RRzb/t6NqAiZ/EglghZA=; b=dEkV3I99z1LcETOL06i9VjSOJESfghTZUqnLVKd/kObX8Dwi6ogfrKErIBEdJiXHie dE2ouxTtUmxwHvVv/YnTQEAdxswNU/00J93NAPt+GyaCjsI7LNX7yqaxZ3gsR/PiOQf+ 6fpaFioYIy6o64XVfLNsJ/JLu70APnix5TrpiY8UneVIHCv2sG9TMN4Voh2w4xdLj3dW g52jHIvGevRAXHmGtiQYM0ZMQrN8B94F4FjlQxENmLgHqiA8kYg/622Nd65ikaJtDrFq DG/vNxr8+D0XofhSBwseUN+tOBeeawZ47WOSOCsvi3ID/7PpItZl4C1CPa4kOoCV11ny GutA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=i20+XqhK; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v22si3943524eji.185.2020.08.06.11.38.20; Thu, 06 Aug 2020 11:38:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-samsung-soc-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=@kernel.org header.s=default header.b=i20+XqhK; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728261AbgHFShy (ORCPT + 4 others); Thu, 6 Aug 2020 14:37:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:58700 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729257AbgHFSfX (ORCPT ); Thu, 6 Aug 2020 14:35:23 -0400 Received: from localhost.localdomain (unknown [194.230.155.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6C31922D6E; Thu, 6 Aug 2020 18:22:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596738158; bh=hAZLCO5WhHq3DyAI5oEkcdHEncWOCsm/3pyKHSow4CE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i20+XqhKqtkDacJuZspJ6tcG7ONKYaXHJ/0mWgWzYxb44M1KnkLYqtAkpvIiqjTYb 4xBjxyKnTv3bP25MrP47ED+Wx+HnPJznrYf9243U7YSpPhqwv4V7LAEqZppaDGonQw kgr1A6QuuhUczhF1GiC/Iyf2rRZKhcz6SEeDHuM0= From: Krzysztof Kozlowski To: linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Krzysztof Kozlowski , Kyungmin Park , Russell King , Kukjin Kim , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 16/41] ARM: samsung: move pm check code to drivers/soc Date: Thu, 6 Aug 2020 20:20:33 +0200 Message-Id: <20200806182059.2431-16-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200806181932.2253-1-krzk@kernel.org> References: <20200806181932.2253-1-krzk@kernel.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Arnd Bergmann This is the only part of plat-samsung that is really shared between the s3c and s5p ports. Moving it to drivers/soc/ lets us make them completely independent. Signed-off-by: Arnd Bergmann Signed-off-by: Krzysztof Kozlowski --- arch/arm/mach-s5pv210/Kconfig | 1 + arch/arm/plat-samsung/Kconfig | 49 +---------- arch/arm/plat-samsung/Makefile | 2 - .../arm/plat-samsung/include/plat/pm-common.h | 70 +--------------- drivers/soc/samsung/Kconfig | 48 ++++++++++- drivers/soc/samsung/Makefile | 3 + .../soc/samsung/s3c-pm-check.c | 2 +- .../soc/samsung/s3c-pm-debug.c | 3 +- include/linux/soc/samsung/s3c-pm.h | 84 +++++++++++++++++++ 9 files changed, 139 insertions(+), 123 deletions(-) rename arch/arm/plat-samsung/pm-check.c => drivers/soc/samsung/s3c-pm-check.c (99%) rename arch/arm/plat-samsung/pm-debug.c => drivers/soc/samsung/s3c-pm-debug.c (97%) create mode 100644 include/linux/soc/samsung/s3c-pm.h -- 2.17.1 diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig index b3db1191e437..95d4e8284866 100644 --- a/arch/arm/mach-s5pv210/Kconfig +++ b/arch/arm/mach-s5pv210/Kconfig @@ -17,6 +17,7 @@ config ARCH_S5PV210 select HAVE_S3C_RTC if RTC_CLASS select PINCTRL select PINCTRL_EXYNOS + select SOC_SAMSUNG help Samsung S5PV210/S5PC110 series based systems diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig index 920931c3fefd..a7cb0db1d5cc 100644 --- a/arch/arm/plat-samsung/Kconfig +++ b/arch/arm/plat-samsung/Kconfig @@ -8,6 +8,7 @@ config PLAT_SAMSUNG default y select GENERIC_IRQ_CHIP select NO_IOPORT_MAP + select SOC_SAMSUNG help Base platform code for all Samsung SoC based systems @@ -234,54 +235,6 @@ config SAMSUNG_PM_GPIO pinctrl-samsung driver. endif -comment "Power management" - -config SAMSUNG_PM_DEBUG - bool "Samsung PM Suspend debug" - depends on PM && DEBUG_KERNEL - depends on PLAT_S3C24XX || ARCH_S3C64XX || ARCH_S5PV210 - depends on DEBUG_S3C24XX_UART || DEBUG_S3C2410_UART - help - Say Y here if you want verbose debugging from the PM Suspend and - Resume code. See - for more information. - -config S3C_PM_DEBUG_LED_SMDK - bool "SMDK LED suspend/resume debugging" - depends on PM && (MACH_SMDK6410) - help - Say Y here to enable the use of the SMDK LEDs on the baseboard - for debugging of the state of the suspend and resume process. - - Note, this currently only works for S3C64XX based SMDK boards. - -config SAMSUNG_PM_CHECK - bool "S3C2410 PM Suspend Memory CRC" - depends on PM && (PLAT_S3C24XX || ARCH_S3C64XX || ARCH_S5PV210) - select CRC32 - help - Enable the PM code's memory area checksum over sleep. This option - will generate CRCs of all blocks of memory, and store them before - going to sleep. The blocks are then checked on resume for any - errors. - - Note, this can take several seconds depending on memory size - and CPU speed. - - See - -config SAMSUNG_PM_CHECK_CHUNKSIZE - int "S3C2410 PM Suspend CRC Chunksize (KiB)" - depends on PM && SAMSUNG_PM_CHECK - default 64 - help - Set the chunksize in Kilobytes of the CRC for checking memory - corruption over suspend and resume. A smaller value will mean that - the CRC data block will take more memory, but will identify any - faults with better precision. - - See - config SAMSUNG_WAKEMASK bool depends on PM diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile index d8a80fbcebb3..c47f58ed83e2 100644 --- a/arch/arm/plat-samsung/Makefile +++ b/arch/arm/plat-samsung/Makefile @@ -27,7 +27,5 @@ obj-$(CONFIG_GPIO_SAMSUNG) += gpio-samsung.o obj-$(CONFIG_PM_SLEEP) += pm-common.o obj-$(CONFIG_SAMSUNG_PM) += pm.o obj-$(CONFIG_SAMSUNG_PM_GPIO) += pm-gpio.o -obj-$(CONFIG_SAMSUNG_PM_CHECK) += pm-check.o -obj-$(CONFIG_SAMSUNG_PM_DEBUG) += pm-debug.o obj-$(CONFIG_SAMSUNG_WAKEMASK) += wakeup-mask.o diff --git a/arch/arm/plat-samsung/include/plat/pm-common.h b/arch/arm/plat-samsung/include/plat/pm-common.h index 87fa97fd6e8b..18b9607e1e39 100644 --- a/arch/arm/plat-samsung/include/plat/pm-common.h +++ b/arch/arm/plat-samsung/include/plat/pm-common.h @@ -11,6 +11,7 @@ #define __PLAT_SAMSUNG_PM_COMMON_H __FILE__ #include +#include /* sleep save info */ @@ -36,73 +37,4 @@ extern void s3c_pm_do_save(struct sleep_save *ptr, int count); extern void s3c_pm_do_restore(const struct sleep_save *ptr, int count); extern void s3c_pm_do_restore_core(const struct sleep_save *ptr, int count); -/* PM debug functions */ - -/** - * struct pm_uart_save - save block for core UART - * @ulcon: Save value for S3C2410_ULCON - * @ucon: Save value for S3C2410_UCON - * @ufcon: Save value for S3C2410_UFCON - * @umcon: Save value for S3C2410_UMCON - * @ubrdiv: Save value for S3C2410_UBRDIV - * - * Save block for UART registers to be held over sleep and restored if they - * are needed (say by debug). -*/ -struct pm_uart_save { - u32 ulcon; - u32 ucon; - u32 ufcon; - u32 umcon; - u32 ubrdiv; - u32 udivslot; -}; - -#ifdef CONFIG_SAMSUNG_PM_DEBUG -/** - * s3c_pm_dbg() - low level debug function for use in suspend/resume. - * @msg: The message to print. - * - * This function is used mainly to debug the resume process before the system - * can rely on printk/console output. It uses the low-level debugging output - * routine printascii() to do its work. - */ -extern void s3c_pm_dbg(const char *msg, ...); - -#define S3C_PMDBG(fmt...) s3c_pm_dbg(fmt) - -extern void s3c_pm_save_uarts(bool is_s3c24xx); -extern void s3c_pm_restore_uarts(bool is_s3c24xx); - -#ifdef CONFIG_ARCH_S3C64XX -extern void s3c_pm_arch_update_uart(void __iomem *regs, - struct pm_uart_save *save); -#else -static inline void -s3c_pm_arch_update_uart(void __iomem *regs, struct pm_uart_save *save) -{ -} -#endif - -#else -#define S3C_PMDBG(fmt...) pr_debug(fmt) - -static inline void s3c_pm_save_uarts(bool is_s3c24xx) { } -static inline void s3c_pm_restore_uarts(bool is_s3c24xx) { } -#endif - -/* suspend memory checking */ - -#ifdef CONFIG_SAMSUNG_PM_CHECK -extern void s3c_pm_check_prepare(void); -extern void s3c_pm_check_restore(void); -extern void s3c_pm_check_cleanup(void); -extern void s3c_pm_check_store(void); -#else -#define s3c_pm_check_prepare() do { } while (0) -#define s3c_pm_check_restore() do { } while (0) -#define s3c_pm_check_cleanup() do { } while (0) -#define s3c_pm_check_store() do { } while (0) -#endif - #endif diff --git a/drivers/soc/samsung/Kconfig b/drivers/soc/samsung/Kconfig index 264185664594..5abe82079d2e 100644 --- a/drivers/soc/samsung/Kconfig +++ b/drivers/soc/samsung/Kconfig @@ -35,7 +35,53 @@ config EXYNOS_PMU_ARM_DRIVERS config EXYNOS_PM_DOMAINS bool "Exynos PM domains" if COMPILE_TEST - depends on PM_GENERIC_DOMAINS || COMPILE_TEST + depends on (ARCH_EXYNOS && PM_GENERIC_DOMAINS) || COMPILE_TEST + +config SAMSUNG_PM_DEBUG + bool "Samsung PM Suspend debug" + depends on PM && DEBUG_KERNEL + depends on PLAT_S3C24XX || ARCH_S3C64XX || ARCH_S5PV210 + depends on DEBUG_S3C24XX_UART || DEBUG_S3C2410_UART + help + Say Y here if you want verbose debugging from the PM Suspend and + Resume code. See + for more information. + +config S3C_PM_DEBUG_LED_SMDK + bool "SMDK LED suspend/resume debugging" + depends on PM && (MACH_SMDK6410) + help + Say Y here to enable the use of the SMDK LEDs on the baseboard + for debugging of the state of the suspend and resume process. + + Note, this currently only works for S3C64XX based SMDK boards. + +config SAMSUNG_PM_CHECK + bool "S3C2410 PM Suspend Memory CRC" + depends on PM && (PLAT_S3C24XX || ARCH_S3C64XX || ARCH_S5PV210) + select CRC32 + help + Enable the PM code's memory area checksum over sleep. This option + will generate CRCs of all blocks of memory, and store them before + going to sleep. The blocks are then checked on resume for any + errors. + + Note, this can take several seconds depending on memory size + and CPU speed. + + See + +config SAMSUNG_PM_CHECK_CHUNKSIZE + int "S3C2410 PM Suspend CRC Chunksize (KiB)" + depends on PM && SAMSUNG_PM_CHECK + default 64 + help + Set the chunksize in Kilobytes of the CRC for checking memory + corruption over suspend and resume. A smaller value will mean that + the CRC data block will take more memory, but will identify any + faults with better precision. + + See config EXYNOS_REGULATOR_COUPLER bool "Exynos SoC Regulator Coupler" if COMPILE_TEST diff --git a/drivers/soc/samsung/Makefile b/drivers/soc/samsung/Makefile index ecc3a32f6406..59e8e9453f27 100644 --- a/drivers/soc/samsung/Makefile +++ b/drivers/soc/samsung/Makefile @@ -10,3 +10,6 @@ obj-$(CONFIG_EXYNOS_PMU_ARM_DRIVERS) += exynos3250-pmu.o exynos4-pmu.o \ exynos5250-pmu.o exynos5420-pmu.o obj-$(CONFIG_EXYNOS_PM_DOMAINS) += pm_domains.o obj-$(CONFIG_EXYNOS_REGULATOR_COUPLER) += exynos-regulator-coupler.o + +obj-$(CONFIG_SAMSUNG_PM_CHECK) += s3c-pm-check.o +obj-$(CONFIG_SAMSUNG_PM_DEBUG) += s3c-pm-debug.o diff --git a/arch/arm/plat-samsung/pm-check.c b/drivers/soc/samsung/s3c-pm-check.c similarity index 99% rename from arch/arm/plat-samsung/pm-check.c rename to drivers/soc/samsung/s3c-pm-check.c index cd2c02c68bc3..ff3e099fc208 100644 --- a/arch/arm/plat-samsung/pm-check.c +++ b/drivers/soc/samsung/s3c-pm-check.c @@ -15,7 +15,7 @@ #include #include -#include +#include #if CONFIG_SAMSUNG_PM_CHECK_CHUNKSIZE < 1 #error CONFIG_SAMSUNG_PM_CHECK_CHUNKSIZE must be a positive non-zero value diff --git a/arch/arm/plat-samsung/pm-debug.c b/drivers/soc/samsung/s3c-pm-debug.c similarity index 97% rename from arch/arm/plat-samsung/pm-debug.c rename to drivers/soc/samsung/s3c-pm-debug.c index 482d53753e93..b5ce0e9a41e5 100644 --- a/arch/arm/plat-samsung/pm-debug.c +++ b/drivers/soc/samsung/s3c-pm-debug.c @@ -15,8 +15,7 @@ #include -#include -#include +#include static struct pm_uart_save uart_save; diff --git a/include/linux/soc/samsung/s3c-pm.h b/include/linux/soc/samsung/s3c-pm.h new file mode 100644 index 000000000000..730bd1d3d09a --- /dev/null +++ b/include/linux/soc/samsung/s3c-pm.h @@ -0,0 +1,84 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2013 Samsung Electronics Co., Ltd. + * Tomasz Figa + * Copyright (c) 2004 Simtec Electronics + * http://armlinux.simtec.co.uk/ + * Written by Ben Dooks, + */ + +#ifndef __LINUX_SOC_SAMSUNG_S3C_PM_H +#define __LINUX_SOC_SAMSUNG_S3C_PM_H __FILE__ + +#include + +/* PM debug functions */ + +/** + * struct pm_uart_save - save block for core UART + * @ulcon: Save value for S3C2410_ULCON + * @ucon: Save value for S3C2410_UCON + * @ufcon: Save value for S3C2410_UFCON + * @umcon: Save value for S3C2410_UMCON + * @ubrdiv: Save value for S3C2410_UBRDIV + * + * Save block for UART registers to be held over sleep and restored if they + * are needed (say by debug). +*/ +struct pm_uart_save { + u32 ulcon; + u32 ucon; + u32 ufcon; + u32 umcon; + u32 ubrdiv; + u32 udivslot; +}; + +#ifdef CONFIG_SAMSUNG_PM_DEBUG +/** + * s3c_pm_dbg() - low level debug function for use in suspend/resume. + * @msg: The message to print. + * + * This function is used mainly to debug the resume process before the system + * can rely on printk/console output. It uses the low-level debugging output + * routine printascii() to do its work. + */ +extern void s3c_pm_dbg(const char *msg, ...); + +#define S3C_PMDBG(fmt...) s3c_pm_dbg(fmt) + +extern void s3c_pm_save_uarts(bool is_s3c24xx); +extern void s3c_pm_restore_uarts(bool is_s3c24xx); + +#ifdef CONFIG_ARCH_S3C64XX +extern void s3c_pm_arch_update_uart(void __iomem *regs, + struct pm_uart_save *save); +#else +static inline void +s3c_pm_arch_update_uart(void __iomem *regs, struct pm_uart_save *save) +{ +} +#endif + +#else +#define S3C_PMDBG(fmt...) pr_debug(fmt) + +static inline void s3c_pm_save_uarts(bool is_s3c24xx) { } +static inline void s3c_pm_restore_uarts(bool is_s3c24xx) { } +#endif + +/* suspend memory checking */ + +#ifdef CONFIG_SAMSUNG_PM_CHECK +extern void s3c_pm_check_prepare(void); +extern void s3c_pm_check_restore(void); +extern void s3c_pm_check_cleanup(void); +extern void s3c_pm_check_store(void); +#else +#define s3c_pm_check_prepare() do { } while (0) +#define s3c_pm_check_restore() do { } while (0) +#define s3c_pm_check_cleanup() do { } while (0) +#define s3c_pm_check_store() do { } while (0) +#endif + +#endif From patchwork Thu Aug 6 18:20:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 247510 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1743681ilo; Thu, 6 Aug 2020 11:36:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9YHak5JSP1vVMiLmCzUhCDB6f+fH+sEkjPNR8M64y3PLxfIgBYyz1TuGMkjUvMNJU0Fbl X-Received: by 2002:a50:d908:: with SMTP id t8mr5141416edj.373.1596738994764; Thu, 06 Aug 2020 11:36:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596738994; cv=none; d=google.com; s=arc-20160816; b=ClxS4/es69/F7kIxCcarLhYa7XZEMp3kRQEMUhaV632I6AiF7dbLJhNCxiQSBGGhv6 E3sqHiKYqTxoTZ69Qeb6b1m17DK1h6jza0mN5IkWJp7pShlMN6fjpSPG3gkBOC5p9HOP X5e7dLd/R2yBTTxvlb8VrufLopfhjJRU8JKmcefq1gj2l/d/FlyDnzVdpElNZJI3S2QK lN9W9jn1ToEZrKjrpCumAw1ggwf06DGFARr00i3ZoYtdFH4+qgl3tXpRP8VayADTNDOE 8BTzaAt8djKv506Wf56MimqgE/XWwD7i+m0eIqJ7ubjtq9Ed9f70UjRNHvAM4cXn+6rz qlzA== ARC-Message-Signature: i=1; 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; bh=GaLpkfAjwzSI8Ql0zj8tzSbVsesNzKNDaK56DL4Y5Uk=; b=B+jlaYBlKlr7wGnSxxsoZ11VxoNpmmptO9cyAbsl/SWee/De1iRU3IGLpmF3oguI3F xZJLX8wC2Bn7uQQkWXfMJKXMBiu9AoMA28KIGz3j7TpshOnICy1g/JFPEp+c+f2oStMj WOPY0jySVrlBQuSuZiWgr8F295ylg3InA4UkWTyZv0vDwe6C1zJtYXNQvGTPfeZVpRAH MMq2Bm6enV5UiJYBaDfSsKssYYo8eBde92OXzR1jqsdY4d8/vgCyQmlXiYdyGSy5moW3 QuHPTCjJRM7nkrPPUPCba33nlZGqLL9ERN4VJOnrMjRkMkLA42auavQz6zUaLWEWI1WK ev/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VHn+t9EE; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t23si4170503ejj.626.2020.08.06.11.36.34; Thu, 06 Aug 2020 11:36:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-samsung-soc-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=@kernel.org header.s=default header.b=VHn+t9EE; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729350AbgHFSgR (ORCPT + 4 others); Thu, 6 Aug 2020 14:36:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:59086 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729342AbgHFSgO (ORCPT ); Thu, 6 Aug 2020 14:36:14 -0400 Received: from localhost.localdomain (unknown [194.230.155.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 459DD22D72; Thu, 6 Aug 2020 18:22:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596738167; bh=eC8+pdiOP0SN41WUeXwn8RHaqXAyWuLR/6yLOdAxbuk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VHn+t9EEdJVdosmd7F/izmV/f/BVJ2cqpO/rOXPJA+hkWnTb+ZcHGrmO09n3zqq00 cEZgOxnbH50Oz/fzhKpLLQL6S+SfioSMmFDm6iI8IBuS9MA7Eev/PZZ7uyPmHDHbnC Kp5ilhF0X14zo6b3c/21m8qfQP2BgvBkw8gI1mIY= From: Krzysztof Kozlowski To: linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Krzysztof Kozlowski , Kyungmin Park , Russell King , Kukjin Kim , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 17/41] ARM: s5pv210: use private pm save/restore Date: Thu, 6 Aug 2020 20:20:34 +0200 Message-Id: <20200806182059.2431-17-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200806181932.2253-1-krzk@kernel.org> References: <20200806181932.2253-1-krzk@kernel.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Arnd Bergmann The pm save/restore code is fairly small, so in order to separate the s3c and s5p platforms, adding an s5p specific copy instead of sharing it is actually easier. Signed-off-by: Arnd Bergmann Signed-off-by: Krzysztof Kozlowski --- arch/arm/mach-s5pv210/Makefile | 7 ----- arch/arm/mach-s5pv210/pm.c | 45 ++++++++++++++++++++++++++++-- arch/arm/mach-s5pv210/regs-clock.h | 4 ++- arch/arm/mach-s5pv210/s5pv210.c | 2 -- arch/arm/plat-samsung/Makefile | 3 +- 5 files changed, 47 insertions(+), 14 deletions(-) -- 2.17.1 diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile index e7b551e18e5c..aa0a1f091daf 100644 --- a/arch/arm/mach-s5pv210/Makefile +++ b/arch/arm/mach-s5pv210/Makefile @@ -3,12 +3,5 @@ # Copyright (c) 2010 Samsung Electronics Co., Ltd. # http://www.samsung.com/ -ccflags-$(CONFIG_ARCH_MULTIPLATFORM) += -I$(srctree)/arch/arm/plat-samsung/include - -# Core - obj-$(CONFIG_PM_SLEEP) += pm.o sleep.o - -# machine support - obj-y += s5pv210.o diff --git a/arch/arm/mach-s5pv210/pm.c b/arch/arm/mach-s5pv210/pm.c index efdb5a27c060..d59c094cdea8 100644 --- a/arch/arm/mach-s5pv210/pm.c +++ b/arch/arm/mach-s5pv210/pm.c @@ -13,15 +13,56 @@ #include #include #include +#include #include #include -#include - #include "common.h" #include "regs-clock.h" +/* helper functions to save and restore register state */ +struct sleep_save { + void __iomem *reg; + unsigned long val; +}; + +#define SAVE_ITEM(x) \ + { .reg = (x) } + +/** + * s3c_pm_do_save() - save a set of registers for restoration on resume. + * @ptr: Pointer to an array of registers. + * @count: Size of the ptr array. + * + * Run through the list of registers given, saving their contents in the + * array for later restoration when we wakeup. + */ +static void s3c_pm_do_save(struct sleep_save *ptr, int count) +{ + for (; count > 0; count--, ptr++) { + ptr->val = readl_relaxed(ptr->reg); + S3C_PMDBG("saved %p value %08lx\n", ptr->reg, ptr->val); + } +} + +/** + * s3c_pm_do_restore() - restore register values from the save list. + * @ptr: Pointer to an array of registers. + * @count: Size of the ptr array. + * + * Restore the register values saved from s3c_pm_do_save(). + * + * WARNING: Do not put any debug in here that may effect memory or use + * peripherals, as things may be changing! +*/ + +static void s3c_pm_do_restore_core(const struct sleep_save *ptr, int count) +{ + for (; count > 0; count--, ptr++) + writel_relaxed(ptr->val, ptr->reg); +} + static struct sleep_save s5pv210_core_save[] = { /* Clock ETC */ SAVE_ITEM(S5P_MDNIE_SEL), diff --git a/arch/arm/mach-s5pv210/regs-clock.h b/arch/arm/mach-s5pv210/regs-clock.h index 2a35c831a9b0..9cad2306e470 100644 --- a/arch/arm/mach-s5pv210/regs-clock.h +++ b/arch/arm/mach-s5pv210/regs-clock.h @@ -9,7 +9,9 @@ #ifndef __ASM_ARCH_REGS_CLOCK_H #define __ASM_ARCH_REGS_CLOCK_H __FILE__ -#include +#define S3C_ADDR_BASE 0xF6000000 +#define S3C_ADDR(x) ((void __iomem __force *)S3C_ADDR_BASE + (x)) +#define S3C_VA_SYS S3C_ADDR(0x00100000) #define S5P_CLKREG(x) (S3C_VA_SYS + (x)) diff --git a/arch/arm/mach-s5pv210/s5pv210.c b/arch/arm/mach-s5pv210/s5pv210.c index 868f9c20419d..a21ed3bb992a 100644 --- a/arch/arm/mach-s5pv210/s5pv210.c +++ b/arch/arm/mach-s5pv210/s5pv210.c @@ -13,8 +13,6 @@ #include #include -#include - #include "common.h" #include "regs-clock.h" diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile index c47f58ed83e2..feddb42cae51 100644 --- a/arch/arm/plat-samsung/Makefile +++ b/arch/arm/plat-samsung/Makefile @@ -24,8 +24,7 @@ obj-$(CONFIG_GPIO_SAMSUNG) += gpio-samsung.o # PM support -obj-$(CONFIG_PM_SLEEP) += pm-common.o -obj-$(CONFIG_SAMSUNG_PM) += pm.o +obj-$(CONFIG_SAMSUNG_PM) += pm.o pm-common.o obj-$(CONFIG_SAMSUNG_PM_GPIO) += pm-gpio.o obj-$(CONFIG_SAMSUNG_WAKEMASK) += wakeup-mask.o From patchwork Thu Aug 6 18:20:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 247508 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1743203ilo; Thu, 6 Aug 2020 11:35:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxk7+n7zvnGhWn7amuI39HlMMhqISQlDgihP6QrWn0gtehauyIb8V34AsHD98/99dH3NQmc X-Received: by 2002:a17:906:d050:: with SMTP id bo16mr6096267ejb.367.1596738958794; Thu, 06 Aug 2020 11:35:58 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h14si3989758eje.503.2020.08.06.11.35.58; Thu, 06 Aug 2020 11:35:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-samsung-soc-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=@kernel.org header.s=default header.b=RnJk8Nw2; arc=fail (signature failed); spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728298AbgHFSf5 (ORCPT + 4 others); Thu, 6 Aug 2020 14:35:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726094AbgHFSex (ORCPT ); Thu, 6 Aug 2020 14:34:53 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 707E6C061A12 for ; Thu, 6 Aug 2020 11:34:40 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id r2so39852189wrs.8 for ; Thu, 06 Aug 2020 11:34:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:resent-from:resent-date:resent-message-id :resent-to:dkim-signature:from:to:cc:subject:date:message-id :in-reply-to:references; bh=P/4Vf8XTg1yEubNoDSMrUtqrSAPvF4rBwDg8gqa3eIo=; b=LZRgE7GD55QiO1zbCYW27SJLCEKPPgL1zEs19FfgBRNpGVvsm6XvY+3AQjR41E3Pl0 lnW4uixrLDtWa/pjBY01mE3xYaw3PSsSl0sGitfC/AtBaGtNwSfwrQsiPEKIH4/UaAeZ zwqLDqGZOyVvSnhj0hGnqbyMYAPuxxyyza6DrmGqtjLlMZPbLzbENbNEh64JpfkTW53y 4ZfExocrtJArhihHsBABp5+vNbWHRZHp13O+gvw2qTQpTq7+4fJxcYyHc/W+65/hGE1N 56FhD7HwbOexFvSPdu1zTmzpWVhU/k4TUdPYBbB8aC6QC8yDTSxbCogTbiFv0FiyCD8i yB3A== X-Gm-Message-State: AOAM531cpd2zqmWjfsey67O8bPIgbw2IKbOhFny114Rjxyac0AIWPO4M qLmsvmiK2TxEnrYjcguM/a7Fzf/rorw= X-Received: by 2002:adf:a102:: with SMTP id o2mr8427596wro.319.1596738878693; Thu, 06 Aug 2020 11:34:38 -0700 (PDT) Received: from kozik-lap ([194.230.155.117]) by smtp.googlemail.com with ESMTPSA id 69sm7765836wmb.8.2020.08.06.11.34.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Aug 2020 11:34:38 -0700 (PDT) Received: by 2002:ab3:1105:0:0:0:0:0 with SMTP id j5csp1541288lta; Thu, 6 Aug 2020 11:22:53 -0700 (PDT) X-Received: by 2002:a62:1cce:: with SMTP id c197mr9367619pfc.267.1596738173375; Thu, 06 Aug 2020 11:22:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596738173; cv=none; d=google.com; s=arc-20160816; b=EESVSEur0rL0vSVS0cKkWj2FpLD86IF4Ydtn7wQb1Qdd60/CO7srCZIFREa7dC/P6i o0Xy4VT8On9ciija/OnS3VKOkBL7P8QzQeSYp+rdTqg+9WgCHQuMBk6pnB9qRzkvliHh W3EFMphL2W4QJJf6UJD0UHZyytxpPP+IbEekEsaIpLv/1KjtOAS65N0KLqeEIF8Y3wDn erjpd0g4WQrg6+pZrb8J1QAdefxBRU2D15ha6rylqXGU2OKveSbhnbCYSYmff5EIgERL DTdk9avVeglf94/ut/SB1zYLUQzoRJL/GQqmBf2GA4TppYz3VthZ8JHhLuJMyentwleh 9uQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to; bh=P/4Vf8XTg1yEubNoDSMrUtqrSAPvF4rBwDg8gqa3eIo=; b=EK0QJSsd7J8LLVSVJbwRlBVKFbs4W6R+odOo1dOLvzoU3fHTa8qAY7//HZu2MO3xhp vXEZsC+LYlFU14osbKoxOXUE+GNpjNnk88BKCPyEOyt5VIRnpemmL39OkRaRTFScmME0 8wxPaA8hCSSc84gh476MWi7THTJ446P33P7NYzYNfEPsDz4xmIIaYw0SotMfGJ9jcGD9 ITUAfDD4A8DwNu/VF+BiiwFInXx74igT5aqYgFBOv432KK6G3yGkrRPpQn56m6/EPB+1 h2TWzwncwyu+xfIFe6IWy3GcDoeSYQvFvgCVv1KXEm38norL0XlVeMlMnIpx9uEOWJsb ln3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RnJk8Nw2; spf=pass (google.com: domain of krzk@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=krzk@kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from mail.kernel.org (mail.kernel.org. [198.145.29.99]) by mx.google.com with ESMTPS id v20si3904172pgk.407.2020.08.06.11.22.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Aug 2020 11:22:53 -0700 (PDT) Received-SPF: pass (google.com: domain of krzk@kernel.org designates 198.145.29.99 as permitted sender) client-ip=198.145.29.99; Received: by mail.kernel.org (Postfix) id 7949422D74; Thu, 6 Aug 2020 18:22:53 +0000 (UTC) Received: from localhost.localdomain (unknown [194.230.155.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7B4C522D70; Thu, 6 Aug 2020 18:22:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596738173; bh=e1oSXjKRZ1/t6yaGmxeMpFJIIqxQuITtDtfD3fTgYtQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RnJk8Nw20oovJGOtix16awmixT2stIdDZnn5cCpdsfoPL1ZDrAouFmfTXazZkBryt U6+/C4sQrMYB7/RhwqVpMgQSY+Lnf776wVev3iQBKSSjccZfpKA0QCfvg58nAuJV/9 XLhS2JgfS/EMeK/1j1FFEu/fmUc6n1ay5mUcjoIg= From: Krzysztof Kozlowski To: linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Krzysztof Kozlowski , Russell King , Ulf Hansson , Thierry Reding , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Lee Jones , Mark Brown , Greg Kroah-Hartman , Jiri Slaby , Sangbeom Kim , Sylwester Nawrocki , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, linux-pwm@vger.kernel.org, linux-spi@vger.kernel.org, linux-serial@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH v2 18/41] ARM: s5pv210: don't imply CONFIG_PLAT_SAMSUNG Date: Thu, 6 Aug 2020 20:20:35 +0200 Message-Id: <20200806182059.2431-18-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200806181932.2253-1-krzk@kernel.org> References: <20200806181932.2253-1-krzk@kernel.org> X-TUID: ipnqe01njWQR Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Arnd Bergmann The plat-samsung directory and mach-s5pv210 can be build completely independently, so split the two Kconfig symbols CONFIG_PLAT_SAMSUNG and CONFIG_ARCH_S5PV210. Signed-off-by: Arnd Bergmann Acked-by: Ulf Hansson Acked-by: Thierry Reding Signed-off-by: Krzysztof Kozlowski --- arch/arm/Kconfig.debug | 6 +++--- arch/arm/Makefile | 1 - arch/arm/plat-samsung/Kconfig | 2 +- drivers/mmc/host/Kconfig | 2 +- drivers/pwm/Kconfig | 2 +- drivers/spi/Kconfig | 2 +- drivers/tty/serial/Kconfig | 2 +- sound/soc/samsung/Kconfig | 2 +- 8 files changed, 9 insertions(+), 10 deletions(-) -- 2.17.1 diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 153a9a35dd20..b4b41f9d246b 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -1005,7 +1005,7 @@ choice via SCIFA4 on Renesas SH-Mobile AG5 (SH73A0). config DEBUG_S3C_UART0 - depends on PLAT_SAMSUNG || ARCH_EXYNOS + depends on PLAT_SAMSUNG || ARCH_S5PV210 || ARCH_EXYNOS select DEBUG_EXYNOS_UART if ARCH_EXYNOS select DEBUG_S3C24XX_UART if ARCH_S3C24XX select DEBUG_S3C64XX_UART if ARCH_S3C64XX @@ -1017,7 +1017,7 @@ choice by the boot-loader before use. config DEBUG_S3C_UART1 - depends on PLAT_SAMSUNG || ARCH_EXYNOS + depends on PLAT_SAMSUNG || ARCH_S5PV210 || ARCH_EXYNOS select DEBUG_EXYNOS_UART if ARCH_EXYNOS select DEBUG_S3C24XX_UART if ARCH_S3C24XX select DEBUG_S3C64XX_UART if ARCH_S3C64XX @@ -1029,7 +1029,7 @@ choice by the boot-loader before use. config DEBUG_S3C_UART2 - depends on PLAT_SAMSUNG || ARCH_EXYNOS + depends on PLAT_SAMSUNG || ARCH_S5PV210 || ARCH_EXYNOS select DEBUG_EXYNOS_UART if ARCH_EXYNOS select DEBUG_S3C24XX_UART if ARCH_S3C24XX select DEBUG_S3C64XX_UART if ARCH_S3C64XX diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 826613a20b7d..3997cec8848e 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -234,7 +234,6 @@ machine-$(CONFIG_PLAT_SPEAR) += spear # by CONFIG_* macro name. plat-$(CONFIG_ARCH_OMAP) += omap plat-$(CONFIG_ARCH_S3C64XX) += samsung -plat-$(CONFIG_ARCH_S5PV210) += samsung plat-$(CONFIG_PLAT_ORION) += orion plat-$(CONFIG_PLAT_PXA) += pxa plat-$(CONFIG_PLAT_S3C24XX) += samsung diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig index a7cb0db1d5cc..13b39684b582 100644 --- a/arch/arm/plat-samsung/Kconfig +++ b/arch/arm/plat-samsung/Kconfig @@ -4,7 +4,7 @@ config PLAT_SAMSUNG bool - depends on PLAT_S3C24XX || ARCH_S3C64XX || ARCH_S5PV210 + depends on PLAT_S3C24XX || ARCH_S3C64XX default y select GENERIC_IRQ_CHIP select NO_IOPORT_MAP diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index ddce8e62280c..9f387daa764a 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -289,7 +289,7 @@ config MMC_SDHCI_TEGRA config MMC_SDHCI_S3C tristate "SDHCI support on Samsung S3C SoC" - depends on MMC_SDHCI && (PLAT_SAMSUNG || ARCH_EXYNOS) + depends on MMC_SDHCI && (PLAT_SAMSUNG || ARCH_S5PV210 || ARCH_EXYNOS) help This selects the Secure Digital Host Controller Interface (SDHCI) often referrered to as the HSMMC block in some of the Samsung S3C diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig index 7dbcf6973d33..9448e4ca8c73 100644 --- a/drivers/pwm/Kconfig +++ b/drivers/pwm/Kconfig @@ -410,7 +410,7 @@ config PWM_ROCKCHIP config PWM_SAMSUNG tristate "Samsung PWM support" - depends on PLAT_SAMSUNG || ARCH_EXYNOS || COMPILE_TEST + depends on PLAT_SAMSUNG || ARCH_S5PV210 || ARCH_EXYNOS || COMPILE_TEST help Generic PWM framework driver for Samsung. diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index c3008e423f59..85619ab64156 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -680,7 +680,7 @@ config SPI_S3C24XX_FIQ config SPI_S3C64XX tristate "Samsung S3C64XX series type SPI" - depends on (PLAT_SAMSUNG || ARCH_EXYNOS || COMPILE_TEST) + depends on (PLAT_SAMSUNG || ARCH_S5PV210 || ARCH_EXYNOS || COMPILE_TEST) help SPI driver for Samsung S3C64XX and newer SoCs. diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index 8a0352eb337c..10de494e808a 100644 --- a/drivers/tty/serial/Kconfig +++ b/drivers/tty/serial/Kconfig @@ -235,7 +235,7 @@ config SERIAL_CLPS711X_CONSOLE config SERIAL_SAMSUNG tristate "Samsung SoC serial support" - depends on PLAT_SAMSUNG || ARCH_EXYNOS || COMPILE_TEST + depends on PLAT_SAMSUNG || ARCH_S5PV210 || ARCH_EXYNOS || COMPILE_TEST select SERIAL_CORE help Support for the on-chip UARTs on the Samsung S3C24XX series CPUs, diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig index 1431be4ed054..a2221ebb1b6a 100644 --- a/sound/soc/samsung/Kconfig +++ b/sound/soc/samsung/Kconfig @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only menuconfig SND_SOC_SAMSUNG tristate "ASoC support for Samsung" - depends on PLAT_SAMSUNG || ARCH_EXYNOS || COMPILE_TEST + depends on PLAT_SAMSUNG || ARCH_S5PV210 || ARCH_EXYNOS || COMPILE_TEST depends on COMMON_CLK select SND_SOC_GENERIC_DMAENGINE_PCM help From patchwork Thu Aug 6 18:20:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 247518 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1744567ilo; Thu, 6 Aug 2020 11:37:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHXn/0UQ50EZ1Moodc0r7RoCFo0lpOX+LEZoS0MDFLhj8gkJ8o02ozIBy1ze6ei4kkfqdO X-Received: by 2002:aa7:dbd9:: with SMTP id v25mr5487809edt.137.1596739067277; Thu, 06 Aug 2020 11:37:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596739067; cv=none; d=google.com; s=arc-20160816; b=Q6a1H+ANhnUPbNts6tWTY4UPMtf66hPaHIFE+bmGCND8HJ0AGO5ylETJrb5j6c1rvP WJVm0gRnoNtQbxzJJHyEPVNodwSKLVofICTC8BfdLs+9vkLeve+qa6tlf1JvaKOYlrHb LHIdCvynKKUaLhIW8qbfq79W+DEEc1+v0R5i7BiFV7JIrUzG1U6ijhmcPca0K+CHnLom t1+u1sihzJf6jUQhhdtHEtMS5kVoGX0IWLW3mPAT1S1p+Ahjeg9QjUYxeoM89Sp06Swm vpLSJA4qeRR9k7ZU/SRBMoxOY2ulUXGzk9c0TLz2vcJ1TxzbwcBsZsHD0bti4Nk81IlE pqCA== ARC-Message-Signature: i=1; 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; bh=f00rwTynNc3TK3ekbPVFHDyznsVKlOtryz0XbkBhsoM=; b=Lev8zyoHjf0N2Lo/CX9mvoYIc4IGd0Xh8sJ2r59ylNb4kp7V4GI3a1EEipZFGJ6UPu bE1zQOFTg+YbeszTJdO0O1pQ+syZlpE/zyS2X+gXsY7QVl2NLWNBCFM1Ogsot9grn67G bXmYLI+DtykgW7jasaWw49yBzfPz/8eI6+ID/fu6hP90yTUZ0dTfLH7lu87WqyL1dVyP IBAcoosVL0zpcCk131+0sEjriCCGFM1D+44Xz3tOhawzkbjTv8FEmsJk3AcfcFdt+iwZ NC7B51g/SF8U9h6L+WiCuNwY4YUrPyNJtujKlRAr4+mzRjkUJozeKsPLXD7p4c8lBu2H i06A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2CkLjH1W; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z14si3823607edk.480.2020.08.06.11.37.47; Thu, 06 Aug 2020 11:37:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-samsung-soc-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=@kernel.org header.s=default header.b=2CkLjH1W; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728808AbgHFShq (ORCPT + 4 others); Thu, 6 Aug 2020 14:37:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:58936 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728935AbgHFSf6 (ORCPT ); Thu, 6 Aug 2020 14:35:58 -0400 Received: from localhost.localdomain (unknown [194.230.155.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7D81F22CE3; Thu, 6 Aug 2020 18:22:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596738176; bh=lU5wNn/T9PmwblR4OUI1J7Lrz/yR8NVfa8Ry3YJWFwQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2CkLjH1W6F26DkdSLwSedU1vIjnnjDrR3jFSKAOn3jiYv5qhJzJb5IL00vTAcBFWr i2VPDnZGE84wG8GJYdwLd3CVGXta3qSoS5aKbL46Y9IqUmleVAqPH1neNdkw7kR9N0 SWcWUrarZ4rqSDEogsdgJK6OyMBAihDa4woY0v5Y= From: Krzysztof Kozlowski To: linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Krzysztof Kozlowski , Russell King , Kukjin Kim , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 19/41] ARM: s3c64xx: remove mach/hardware.h Date: Thu, 6 Aug 2020 20:20:36 +0200 Message-Id: <20200806182059.2431-19-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200806181932.2253-1-krzk@kernel.org> References: <20200806181932.2253-1-krzk@kernel.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Arnd Bergmann This header is empty and conflicts with the s3c24xx version of the same file when we merge the two, so stop including it. Signed-off-by: Arnd Bergmann Acked-by: Charles Keepax Signed-off-by: Krzysztof Kozlowski --- arch/arm/mach-s3c64xx/common.c | 1 - arch/arm/mach-s3c64xx/dev-uart.c | 1 - arch/arm/mach-s3c64xx/include/mach/hardware.h | 17 ----------------- arch/arm/mach-s3c64xx/mach-anw6410.c | 1 - arch/arm/mach-s3c64xx/mach-crag6410.c | 1 - arch/arm/mach-s3c64xx/mach-hmt.c | 1 - arch/arm/mach-s3c64xx/mach-ncp.c | 1 - arch/arm/mach-s3c64xx/mach-smdk6400.c | 1 - arch/arm/mach-s3c64xx/mach-smdk6410.c | 1 - arch/arm/mach-s3c64xx/s3c6400.c | 1 - arch/arm/mach-s3c64xx/s3c6410.c | 1 - 11 files changed, 27 deletions(-) delete mode 100644 arch/arm/mach-s3c64xx/include/mach/hardware.h -- 2.17.1 diff --git a/arch/arm/mach-s3c64xx/common.c b/arch/arm/mach-s3c64xx/common.c index c9c20256488b..efda4bfb7948 100644 --- a/arch/arm/mach-s3c64xx/common.c +++ b/arch/arm/mach-s3c64xx/common.c @@ -37,7 +37,6 @@ #include #include -#include #include #include diff --git a/arch/arm/mach-s3c64xx/dev-uart.c b/arch/arm/mach-s3c64xx/dev-uart.c index 5fb59ad30008..021a2b7926fa 100644 --- a/arch/arm/mach-s3c64xx/dev-uart.c +++ b/arch/arm/mach-s3c64xx/dev-uart.c @@ -15,7 +15,6 @@ #include #include -#include #include #include diff --git a/arch/arm/mach-s3c64xx/include/mach/hardware.h b/arch/arm/mach-s3c64xx/include/mach/hardware.h deleted file mode 100644 index c4ed359474de..000000000000 --- a/arch/arm/mach-s3c64xx/include/mach/hardware.h +++ /dev/null @@ -1,17 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* linux/arch/arm/mach-s3c6400/include/mach/hardware.h - * - * Copyright 2008 Openmoko, Inc. - * Copyright 2008 Simtec Electronics - * Ben Dooks - * http://armlinux.simtec.co.uk/ - * - * S3C6400 - Hardware support - */ - -#ifndef __ASM_ARCH_HARDWARE_H -#define __ASM_ARCH_HARDWARE_H __FILE__ - -/* currently nothing here, placeholder */ - -#endif /* __ASM_ARCH_IRQ_H */ diff --git a/arch/arm/mach-s3c64xx/mach-anw6410.c b/arch/arm/mach-s3c64xx/mach-anw6410.c index e783f5b3593a..bb248b12e308 100644 --- a/arch/arm/mach-s3c64xx/mach-anw6410.c +++ b/arch/arm/mach-s3c64xx/mach-anw6410.c @@ -30,7 +30,6 @@ #include #include -#include #include #include diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c index 223a3d51d8b6..a2fefb2609e7 100644 --- a/arch/arm/mach-s3c64xx/mach-crag6410.c +++ b/arch/arm/mach-s3c64xx/mach-crag6410.c @@ -44,7 +44,6 @@ #include #include