From patchwork Tue Jan 21 10:03:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 212998 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=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS autolearn=ham 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 0960EC2D0CE for ; Tue, 21 Jan 2020 10:03:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C4E1A2465A for ; Tue, 21 Jan 2020 10:03:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="RPdrtCFl" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728803AbgAUKDe (ORCPT ); Tue, 21 Jan 2020 05:03:34 -0500 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:14542 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728512AbgAUKDe (ORCPT ); Tue, 21 Jan 2020 05:03:34 -0500 Received-SPF: Pass (esa6.microchip.iphmx.com: domain of Claudiu.Beznea@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa6.microchip.iphmx.com; envelope-from="Claudiu.Beznea@microchip.com"; x-sender="Claudiu.Beznea@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa6.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa6.microchip.iphmx.com; envelope-from="Claudiu.Beznea@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa6.microchip.iphmx.com; spf=Pass smtp.mailfrom=Claudiu.Beznea@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: /orkjCmffiyF2BaulGpbdtFKRbUa7qslI47o7LUXMZk+d0M6LyLsMragi27y9Ncn3ZJZX7HQHi rC/PogzoeOGWNY+yybuOcByPl1dAWro9cA6zski2R/84c27RGEqULVNubftfmhChjSOcCc72nL swGKFojqRVH7fqKYIRZJAozxw0yc6yUMdc+3tTXmZXMwBQ/F05+kPYkIYdqzcb2u7J0/5ijH2v CRfU3l2qmSLuLJs8CSkt2QafiTi8fmyHV0kThpUEHgR1oCyibhhbay+CEk9hVoE3x24pBsyv11 A+Y= X-IronPort-AV: E=Sophos;i="5.70,345,1574146800"; d="scan'208";a="61481928" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 21 Jan 2020 03:03:31 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 21 Jan 2020 03:03:31 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 21 Jan 2020 03:03:31 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NopsgyLdjAR+kICy3BVscE0GBn02otM6byGD0bB0ZBxNRxMQM8tlWY3M5eP/DHUJz2Wsc04jUAe1bl6T1PPqlEvXrPraO5fv5Q6b43LZ6O9v6uLA6XpdxP3Sr+IQdm4yZtT5j47WOsUky28LTsx1bhzZ9u5H/QJmtHgvYBVrdZLRJ2F165zZMNlL8xcvjYxny+shs/g74EnhXd21nnSf0UMTfFtdIaA6NJvt7uL8G2gcd9P/w5CdUuNVeqmHYcUyp72TLTuxbJP6y+IBgjsQhg9hU4UnbOqyV1OIU7+hmJbOyoITrhrKzKxvKEmQBX5QYTpncN4F5XFaFxvkMLNh2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sbLIJkPacqDzJVzTYUV+YvCo+E3r3beOus/TbYJHsMI=; b=jb/TpNkY2JIteQK6cxMtLtvj4/hdcJF22TrCFnQsPgXZH1HHEsr9NsrSd9notCsCJpmBhvQ9vKcrNmzp+wa8239zTD+mXwRfkRZrFnZvpeFBc4kqAnfe9AKgY8sIeOuB5DVE7jcnvpGnkNsc45/KVacaKngeMddcPUzwVT8TpPvJDyM+VFzXCvQOy0WqkYQ6x4qLuI5JCf+H+cnfFDgkW2qraPv4bU2I8VrMD26HkR2bDLYvXlJ9KXYp5/7YeWv7osSsPZ6hbpkWiwInfG+xoTngdg18l60SI+9PDZdfR3OE7TZYWbIZvf2NzJvVxv5DnH908kao9M2pTK7fDgROuA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sbLIJkPacqDzJVzTYUV+YvCo+E3r3beOus/TbYJHsMI=; b=RPdrtCFlbW1WKsGPKtr0DJjBxQmNJ2OiKGpW8PB9CWgb4yULAvbSPqK6IdOzlFFSu/+x3oumHz0YXjn0H3X7CgZs8De3jcMyPu8lILbBF2P6eBtyKTkJoVh+ntihOphT7HY+d/GgES7c2FyRTNwstWePrS/raw4glRufXSgNH8o= Received: from DM6PR11MB3225.namprd11.prod.outlook.com (20.176.120.224) by DM6PR11MB3195.namprd11.prod.outlook.com (20.176.121.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.23; Tue, 21 Jan 2020 10:03:29 +0000 Received: from DM6PR11MB3225.namprd11.prod.outlook.com ([fe80::dc6b:1191:3a76:8b6a]) by DM6PR11MB3225.namprd11.prod.outlook.com ([fe80::dc6b:1191:3a76:8b6a%7]) with mapi id 15.20.2644.024; Tue, 21 Jan 2020 10:03:29 +0000 From: To: , , , CC: , , , Subject: [PATCH 01/15] power: reset: at91-reset: introduce struct at91_reset Thread-Topic: [PATCH 01/15] power: reset: at91-reset: introduce struct at91_reset Thread-Index: AQHV0EIHIa10Wtf9lkq33X+2rWQtjA== Date: Tue, 21 Jan 2020 10:03:29 +0000 Message-ID: <1579601001-5711-2-git-send-email-claudiu.beznea@microchip.com> References: <1579601001-5711-1-git-send-email-claudiu.beznea@microchip.com> In-Reply-To: <1579601001-5711-1-git-send-email-claudiu.beznea@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [94.177.32.156] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5a673460-22cb-4d6b-c236-08d79e592a7d x-ms-traffictypediagnostic: DM6PR11MB3195: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:820; x-forefront-prvs: 0289B6431E x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(366004)(396003)(136003)(346002)(39860400002)(199004)(189003)(107886003)(26005)(186003)(36756003)(5660300002)(110136005)(54906003)(4326008)(66556008)(66476007)(6506007)(2906002)(76116006)(91956017)(6486002)(86362001)(64756008)(6512007)(66946007)(66446008)(8676002)(81156014)(2616005)(81166006)(8936002)(6636002)(71200400001)(316002)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR11MB3195; H:DM6PR11MB3225.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: fVTJAC6E3S/lXgbt5ZGvoKlMZq2cVTbliXKohUiEX7OdYjT974va/W/s/Vh7C0nbuQ/Q4zIu+Tr5eYXku1pJMUuesDjcU6OnbIOWvJq+C/ATBpH8BZUs5M/xwWNzH72oedibGuGOw0TLcxjP9gHnlaeozc0G782VTjS+8ZsQJm+ZHKuPUO06sM+OH0a7bjPw9NL0+u5jxnE0XQrjW7Tn7yUvwd2kAUI3IMSN4kjt+LTKnrJNEsHQ9uMnzLA9LDFyRF2XUlOF8Z8cgvLCJjTyYuENE7wfbGlHUyvMKDHJaRL+uXO9S2SdVfINehvGA7glQIgJeethKukbzrBHd4d1nJhs2xWKo93LCge+YK/Z/7XII8kAu6N/K18X+N4Zx/w9kvsKDZcVpjoKKrWUtGlsf/Cm3m6e5psJvXdNWUlGEPoi1YLvuK0Dmh3zQTY3VCyo MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 5a673460-22cb-4d6b-c236-08d79e592a7d X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jan 2020 10:03:29.8027 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: y0QIrBbADO5ckb+Iqo7o+KD/Vz30rTWE90zGhd3eNkCZjn+a6WKL+QiyCLrZyMEPoXmd/Q2feJiKDrbt/FZ1o30R4iU3Uid+ABfP3FP3GvE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3195 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Introduce struct at91_reset intended to keep all the at91 reset controller data. Signed-off-by: Claudiu Beznea --- drivers/power/reset/at91-reset.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/drivers/power/reset/at91-reset.c b/drivers/power/reset/at91-reset.c index d94e3267c3b6..2df0610e5527 100644 --- a/drivers/power/reset/at91-reset.c +++ b/drivers/power/reset/at91-reset.c @@ -49,7 +49,13 @@ enum reset_type { RESET_TYPE_ULP2 = 8, }; -static void __iomem *at91_ramc_base[2], *at91_rstc_base; +struct at91_reset { + void __iomem *rstc_base; +}; + +static struct at91_reset reset; + +static void __iomem *at91_ramc_base[2]; static struct clk *sclk; /* @@ -76,7 +82,7 @@ static int at91sam9260_restart(struct notifier_block *this, unsigned long mode, "b .\n\t" : : "r" (at91_ramc_base[0]), - "r" (at91_rstc_base), + "r" (reset.rstc_base), "r" (1), "r" cpu_to_le32(AT91_SDRAMC_LPCB_POWER_DOWN), "r" cpu_to_le32(AT91_RSTC_KEY | AT91_RSTC_PERRST | AT91_RSTC_PROCRST)); @@ -119,7 +125,7 @@ static int at91sam9g45_restart(struct notifier_block *this, unsigned long mode, : : "r" (at91_ramc_base[0]), "r" (at91_ramc_base[1]), - "r" (at91_rstc_base), + "r" (reset.rstc_base), "r" (1), "r" cpu_to_le32(AT91_DDRSDRC_LPCB_POWER_DOWN), "r" cpu_to_le32(AT91_RSTC_KEY | AT91_RSTC_PERRST | AT91_RSTC_PROCRST) @@ -131,8 +137,8 @@ static int at91sam9g45_restart(struct notifier_block *this, unsigned long mode, static int sama5d3_restart(struct notifier_block *this, unsigned long mode, void *cmd) { - writel(AT91_RSTC_KEY | AT91_RSTC_PERRST | AT91_RSTC_PROCRST, - at91_rstc_base); + writel(cpu_to_le32(AT91_RSTC_KEY | AT91_RSTC_PERRST | AT91_RSTC_PROCRST), + reset.rstc_base); return NOTIFY_DONE; } @@ -140,14 +146,16 @@ static int sama5d3_restart(struct notifier_block *this, unsigned long mode, static int samx7_restart(struct notifier_block *this, unsigned long mode, void *cmd) { - writel(AT91_RSTC_KEY | AT91_RSTC_PROCRST, at91_rstc_base); + writel(cpu_to_le32(AT91_RSTC_KEY | AT91_RSTC_PROCRST), + reset.rstc_base); + return NOTIFY_DONE; } static void __init at91_reset_status(struct platform_device *pdev) { const char *reason; - u32 reg = readl(at91_rstc_base + AT91_RSTC_SR); + u32 reg = readl(reset.rstc_base + AT91_RSTC_SR); switch ((reg & AT91_RSTC_RSTTYP) >> 8) { case RESET_TYPE_GENERAL: @@ -208,8 +216,8 @@ static int __init at91_reset_probe(struct platform_device *pdev) struct device_node *np; int ret, idx = 0; - at91_rstc_base = of_iomap(pdev->dev.of_node, 0); - if (!at91_rstc_base) { + reset.rstc_base = of_iomap(pdev->dev.of_node, 0); + if (!reset.rstc_base) { dev_err(&pdev->dev, "Could not map reset controller address\n"); return -ENODEV; } From patchwork Tue Jan 21 10:03:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 212994 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=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS autolearn=ham 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 1E5D6C35245 for ; Tue, 21 Jan 2020 10:04:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DF9642467E for ; Tue, 21 Jan 2020 10:04:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="n26XtQ28" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727220AbgAUKEI (ORCPT ); Tue, 21 Jan 2020 05:04:08 -0500 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:14575 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729352AbgAUKDn (ORCPT ); Tue, 21 Jan 2020 05:03:43 -0500 Received-SPF: Pass (esa6.microchip.iphmx.com: domain of Claudiu.Beznea@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa6.microchip.iphmx.com; envelope-from="Claudiu.Beznea@microchip.com"; x-sender="Claudiu.Beznea@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa6.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa6.microchip.iphmx.com; envelope-from="Claudiu.Beznea@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa6.microchip.iphmx.com; spf=Pass smtp.mailfrom=Claudiu.Beznea@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: ChmRYHNZ1a8HB/vquRZsN5NbRmpUkCTXaxReL6z8ozkHOEe8Nt78Vzv4OwC1FuzOIdFMDyco+2 nkyjolzYf5ccvJAKdyHvWgmqXn1dBAQ+GBB8Grnodw4jcZtVLp6PtrHZe+oB0SyZXVSzJySTAq qSLx/BM/PBR+fXELuLnjQusw0Qw8tcbUdXpuAvs8N3p9SWVoiHQADN40c4N0aS5gYn+fQZf6GU fh1JoTdlq4G4StPy+yKTZH3X7yJUX/PUn5WBbJZIS2GCt1j6l2hx94/3BKNGiaDoNoqt/gAp7a vZk= X-IronPort-AV: E=Sophos;i="5.70,345,1574146800"; d="scan'208";a="61481962" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 21 Jan 2020 03:03:42 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 21 Jan 2020 03:03:32 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 21 Jan 2020 03:03:32 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n4l6sAMi+zgUt36UNEgi11N2NfyHmr/bxqktPFHK963bvLAfdxr022cD1vpcMqVHRMd24B5F0iTYQGUKWIP7RwBm+1P0hBImYRyACGbzuym+oLBQc4HDROQWmJEAjR40PgQB0DABxWxpc7PTrDWedPYW7YsYL+CDs7UCplhue8Kfr/QEHpYvrXlz+iaSAfsVqXHRooSN6VEkOEMhnavfuEyKPqbv+8Hqi7rS0eLY03yhYIQfYy6kFTD1r5H7trkCqTyUPJ/9YNge4h7MN1lXIvcCDC/dACr2RZKrxc/NAYWAyePQphnkfgyljSm4KgpZ1zRZsVSt4++GevGrXIsLkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1X50fqRC8vzRm0UoalcRLP7y4LxFJa34i+FZXVLmURY=; b=aHebUNJ85H41/XoSxuoLwy2uH9lCupVP56PSjVeFI1wtxR5x0Eb9BvJl9o8wn9G8hG5BrZd2cjBp6eRgz1C1iKwIOg5E0t+pZcTj4XJ5kzmf5ikM7+cf2AgxYohfZCF2Lk16flHSnOxe0K1Ik6RBN2MsHEsZBnbvB80FH2hu8UrH3fb9HpMi6AqpBlDs8lRpHM6UTVZr7eGf4+zSntXK5MuKmYN0cd9S5Y9n2WLqICCrMPdKWr7aRGGKLbMoiPTUX2/O+45ZnmY/NGXDjMnSubzQvCuLH2gWh7XsE5jfbQcEK/v1yFapKkVfaaduI/VkW5tBJUa3J8kF0HLEhSmmDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1X50fqRC8vzRm0UoalcRLP7y4LxFJa34i+FZXVLmURY=; b=n26XtQ28hEOMOFNuvNeAn8gWoA946qncYcyGTjwnAZzjzJhJ+YsBoAlVTGMsbbxHw5EROiNvJN/NT34McJqoPvXFFTzdduCFZqYDqEYOXqCzSD/y0wUxK1rOc0yN/hkHFleydJ8lYTlpasDlxcLcP56XnuCXGEdfZ+9tnPJ2+xI= Received: from DM6PR11MB3225.namprd11.prod.outlook.com (20.176.120.224) by DM6PR11MB3195.namprd11.prod.outlook.com (20.176.121.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.23; Tue, 21 Jan 2020 10:03:30 +0000 Received: from DM6PR11MB3225.namprd11.prod.outlook.com ([fe80::dc6b:1191:3a76:8b6a]) by DM6PR11MB3225.namprd11.prod.outlook.com ([fe80::dc6b:1191:3a76:8b6a%7]) with mapi id 15.20.2644.024; Tue, 21 Jan 2020 10:03:30 +0000 From: To: , , , CC: , , , Subject: [PATCH 03/15] power: reset: at91-reset: add sclk to struct at91_reset Thread-Topic: [PATCH 03/15] power: reset: at91-reset: add sclk to struct at91_reset Thread-Index: AQHV0EIIYocZzik2O02q6OLYBPiBsQ== Date: Tue, 21 Jan 2020 10:03:30 +0000 Message-ID: <1579601001-5711-4-git-send-email-claudiu.beznea@microchip.com> References: <1579601001-5711-1-git-send-email-claudiu.beznea@microchip.com> In-Reply-To: <1579601001-5711-1-git-send-email-claudiu.beznea@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [94.177.32.156] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 86485129-78fa-4ddc-99c1-08d79e592b09 x-ms-traffictypediagnostic: DM6PR11MB3195: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1122; x-forefront-prvs: 0289B6431E x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(366004)(396003)(136003)(346002)(39860400002)(199004)(189003)(107886003)(26005)(186003)(36756003)(5660300002)(110136005)(54906003)(4326008)(66556008)(66476007)(6506007)(2906002)(76116006)(91956017)(6486002)(86362001)(64756008)(6512007)(66946007)(66446008)(8676002)(81156014)(2616005)(81166006)(8936002)(6636002)(71200400001)(316002)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR11MB3195; H:DM6PR11MB3225.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MIhDO18h+VS4ejEBDbzZnG7jJD+vLA0ueXtZjAZRujJwVq6Dk+KqC8ixpr+MCWOZTfeqAeuyX6XDrVdI6V+viaFOJDhyQeVyeS66hS//HPvAA0L/4rzvHCQUDW/bBfeFHk+lmWs6pbqUWbR2FpjwBCPYWVTYPqh7GBZV2FxoW2AgsJosT4/MPhquoxs7pS9s1GehImfC5EZJmKgkgwPcDKQl/rQxUJ9AsWm0nhbxH1Pc956h7yW3dAtE49OTW66uwbxRmBA3hTOTkpC7tynYJzUdI0CP8P7mEWlqbUtcdpaT0c+ubM2JAPGNMbjOQQPAMR02Eg8q+5pvpMs5C/mogorNPnvcJaBZMDf0AzAJw9qx5kgvriRuskbv9MjS4hc93rtFwkNXL0+c3ITQZ8HxRdCtfbtpxtnmZ/cxfHHQZbDNO0ns0tLBIdnD1LMviPPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 86485129-78fa-4ddc-99c1-08d79e592b09 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jan 2020 10:03:30.7202 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: t0rqAsV8B4Knsb4lQawZOvHO33FfwSoR0m9qkIo1Qw7rcMBat/P0euNDjl5nqNp2bNXjUSmUSPgstOwh1nMpLAd57GomPo4X7zZWamilkTE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3195 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Add sclk to struct at91_reset. Signed-off-by: Claudiu Beznea --- drivers/power/reset/at91-reset.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/power/reset/at91-reset.c b/drivers/power/reset/at91-reset.c index 999d3a1653d2..1bc39bfda0aa 100644 --- a/drivers/power/reset/at91-reset.c +++ b/drivers/power/reset/at91-reset.c @@ -52,12 +52,11 @@ enum reset_type { struct at91_reset { void __iomem *rstc_base; void __iomem *ramc_base[2]; + struct clk *sclk; }; static struct at91_reset reset; -static struct clk *sclk; - /* * unless the SDRAM is cleanly shutdown before we hit the * reset register it can be left driving the data bus and @@ -238,11 +237,11 @@ static int __init at91_reset_probe(struct platform_device *pdev) match = of_match_node(at91_reset_of_match, pdev->dev.of_node); at91_restart_nb.notifier_call = match->data; - sclk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(sclk)) - return PTR_ERR(sclk); + reset.sclk = devm_clk_get(&pdev->dev, NULL); + if (IS_ERR(reset.sclk)) + return PTR_ERR(reset.sclk); - ret = clk_prepare_enable(sclk); + ret = clk_prepare_enable(reset.sclk); if (ret) { dev_err(&pdev->dev, "Could not enable slow clock\n"); return ret; @@ -250,7 +249,7 @@ static int __init at91_reset_probe(struct platform_device *pdev) ret = register_restart_handler(&at91_restart_nb); if (ret) { - clk_disable_unprepare(sclk); + clk_disable_unprepare(reset.sclk); return ret; } @@ -262,7 +261,7 @@ static int __init at91_reset_probe(struct platform_device *pdev) static int __exit at91_reset_remove(struct platform_device *pdev) { unregister_restart_handler(&at91_restart_nb); - clk_disable_unprepare(sclk); + clk_disable_unprepare(reset.sclk); return 0; } From patchwork Tue Jan 21 10:03:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 212997 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=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS 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 1AA8BC33CBA for ; Tue, 21 Jan 2020 10:03:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DB73A20882 for ; Tue, 21 Jan 2020 10:03:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="bR+Miqsq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729557AbgAUKDp (ORCPT ); Tue, 21 Jan 2020 05:03:45 -0500 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:14578 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729547AbgAUKDo (ORCPT ); Tue, 21 Jan 2020 05:03:44 -0500 Received-SPF: Pass (esa6.microchip.iphmx.com: domain of Claudiu.Beznea@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa6.microchip.iphmx.com; envelope-from="Claudiu.Beznea@microchip.com"; x-sender="Claudiu.Beznea@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa6.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa6.microchip.iphmx.com; envelope-from="Claudiu.Beznea@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa6.microchip.iphmx.com; spf=Pass smtp.mailfrom=Claudiu.Beznea@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: xeVJn7man1HH7FlO7Z0pKUdlvajWaH+Ts5I7TTw/tiRrJXhDz4zKAWAl0RcsvjTdduKZTyVpuw om+ee4OhkPfibGP8wxLzufsMxLUWv9lNHB53twwMGZn1XYwD8v1oShGnC1syJdES12aUO0OILF oEkOz7AtjOoSuajc1aps9DVUslclZYz3KQkiVVRuTTIliu+/yvqiadIPBJ/41+A7r0/HXylEK+ EcztduSMeoWeB9WurqNfRvgVp8OftRK2056q+JfEG9mQGA2h+vy6VT6paOe9MYKVWVCB0bm30i tt4= X-IronPort-AV: E=Sophos;i="5.70,345,1574146800"; d="scan'208";a="61481965" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 21 Jan 2020 03:03:43 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 21 Jan 2020 03:03:32 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 21 Jan 2020 03:03:32 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KCt1omnpWjo92QiON6c6AmJHTdJ3sAOz+KMua4IPsJ+riSg7d5WjqaQy2U8nHYfJEQGRJQAtZHE2hIFHOKnErBwlBEFyw6iXcAYKOcOwGOqDVHOiHLKxeyvKUvnrP4lpyKGsII3Z0ORBom74mXC7D40RbGW9zt0BOo6j3k652S4AWFm9C7umye0TgV0xj96miiofNIgpv83vC0QkuKqHHinH6Mq7jcRzqJXjkabFn3BPBX52EypFNbCdqNWTfztuPY+YF5XeyALK0764o1JhOlbJdM5S0tvoww1o7XnBii9h7Ol0i+Gzw14vaKUjzWYxe+YnGNNyv12lnnHaoMDEfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=10nCea1OuXGgKhgut2z6FehDPAthGmYp6lnT6XoBvHc=; b=cOhBa+n7O4kUnTwC5nCJTC3O2jDSyA7pP0TmS4XsWtzZl4DXThDKjdgoO1AGApzZk2AcArh3cPpWpjDY3RmwMphpdb6jFyjDMzl+3fygjDZxX4mCIk8+wAIs0lFHjLW9rg9Oxb7ogLGvaiykVaB3y00V+OWmgAWIDi9OYaamldbL798LQCGyl2vLrc3E53BQ9j8H0+g4H35lnd1mGwrExw2eRL0Nj61OUcCScNYFlaX3n2y0t4se4KvVXAJOy+m4XSfM6zjXLbcCNmdLhUatop1xLb8Eg8uIsMOMHPNu4lmsvjhnXGKYVFmMsHe+sF5875hNHf0ZHAAhUFKVEFsgCw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=10nCea1OuXGgKhgut2z6FehDPAthGmYp6lnT6XoBvHc=; b=bR+MiqsqZOYP11wRP6DvEK0ZC4eJ3ZbRlLQUSYxcdIMXajf2sZvIdOg510Zcb75kuFTDdteoqnkMpJGZU18VdnlZy6GFJ0gXN2EdRKHrGR3ACP2naLSgYa24mDv4qjm4Jsri8v5jbzxDTs4IZvQOy6xOwvk33OyKGvqzBtOJ79Q= Received: from DM6PR11MB3225.namprd11.prod.outlook.com (20.176.120.224) by DM6PR11MB3195.namprd11.prod.outlook.com (20.176.121.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.23; Tue, 21 Jan 2020 10:03:31 +0000 Received: from DM6PR11MB3225.namprd11.prod.outlook.com ([fe80::dc6b:1191:3a76:8b6a]) by DM6PR11MB3225.namprd11.prod.outlook.com ([fe80::dc6b:1191:3a76:8b6a%7]) with mapi id 15.20.2644.024; Tue, 21 Jan 2020 10:03:31 +0000 From: To: , , , CC: , , , Subject: [PATCH 04/15] power: reset: at91-reset: add notifier block to struct at91_reset Thread-Topic: [PATCH 04/15] power: reset: at91-reset: add notifier block to struct at91_reset Thread-Index: AQHV0EIIU8blIOUR0kO6jGES0k9GCw== Date: Tue, 21 Jan 2020 10:03:31 +0000 Message-ID: <1579601001-5711-5-git-send-email-claudiu.beznea@microchip.com> References: <1579601001-5711-1-git-send-email-claudiu.beznea@microchip.com> In-Reply-To: <1579601001-5711-1-git-send-email-claudiu.beznea@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [94.177.32.156] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f44131d3-80af-4cec-f347-08d79e592b5b x-ms-traffictypediagnostic: DM6PR11MB3195: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:172; x-forefront-prvs: 0289B6431E x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(366004)(396003)(136003)(346002)(39860400002)(199004)(189003)(107886003)(26005)(186003)(36756003)(5660300002)(110136005)(54906003)(4326008)(66556008)(66476007)(6506007)(2906002)(76116006)(91956017)(6486002)(86362001)(64756008)(6512007)(66946007)(66446008)(8676002)(81156014)(2616005)(81166006)(8936002)(6636002)(71200400001)(316002)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR11MB3195; H:DM6PR11MB3225.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jeS5xRDwExHm+0+bdy1E4p7zOPhtxDS3rVQYxVPFoci8dDKpRYF6m9ANfFClCqz1Wfd+ey0BpnMy2njeE+Wjc/bXFelcq/dWQgOgTi3b6YzULLHKhVP/thcJalN2/gP+Z7+Fx5NW1DuG+pPHPKpQAuJBqcUEPJTtI1R7lHi4uBLWk50oyDpjb7VpMRCdu52eRW/y1hUDO//xeOVZI+d2cAP166Dj0lHJvzcT43+p8wTPcZi2C5PwJHgLzZwNUle8JSwxL9A8lTPGEv4yfPPxnbKPy0sosN7y8i/Xv4W0nvrjNk0mBS4ERu7A3+POiQVPCv2tDVrJC6e6Ep2+Gk/GmfWyOo6CcjNQDRErJ6uAMI44kYdv+xFPblHSDliUPrDeWliceAX5C4S9xyiDKnFJtY49oLm4Dl0zQh8fqvhT6KeY3P1W9ybceT8vUXWnE3j9 MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: f44131d3-80af-4cec-f347-08d79e592b5b X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jan 2020 10:03:31.1809 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: vDFweXCYr09a6tWK+1JmOYbOf7GDda25npKit1YKobKUoIt/ZvtfESHfxgBN11f0T0uwtryvD+q33U6FGxjjlne63bNVah+PX7LZBVF1vRs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3195 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Add struct notifier_block to struct at91_reset. Signed-off-by: Claudiu Beznea --- drivers/power/reset/at91-reset.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/power/reset/at91-reset.c b/drivers/power/reset/at91-reset.c index 1bc39bfda0aa..e8840193620d 100644 --- a/drivers/power/reset/at91-reset.c +++ b/drivers/power/reset/at91-reset.c @@ -53,6 +53,7 @@ struct at91_reset { void __iomem *rstc_base; void __iomem *ramc_base[2]; struct clk *sclk; + struct notifier_block nb; }; static struct at91_reset reset; @@ -205,10 +206,6 @@ static const struct of_device_id at91_reset_of_match[] = { }; MODULE_DEVICE_TABLE(of, at91_reset_of_match); -static struct notifier_block at91_restart_nb = { - .priority = 192, -}; - static int __init at91_reset_probe(struct platform_device *pdev) { const struct of_device_id *match; @@ -235,7 +232,8 @@ static int __init at91_reset_probe(struct platform_device *pdev) } match = of_match_node(at91_reset_of_match, pdev->dev.of_node); - at91_restart_nb.notifier_call = match->data; + reset.nb.notifier_call = match->data; + reset.nb.priority = 192; reset.sclk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(reset.sclk)) @@ -247,7 +245,7 @@ static int __init at91_reset_probe(struct platform_device *pdev) return ret; } - ret = register_restart_handler(&at91_restart_nb); + ret = register_restart_handler(&reset.nb); if (ret) { clk_disable_unprepare(reset.sclk); return ret; @@ -260,7 +258,7 @@ static int __init at91_reset_probe(struct platform_device *pdev) static int __exit at91_reset_remove(struct platform_device *pdev) { - unregister_restart_handler(&at91_restart_nb); + unregister_restart_handler(&reset.nb); clk_disable_unprepare(reset.sclk); return 0; From patchwork Tue Jan 21 10:03:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 212992 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=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS 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 2CC38C2D0DB for ; Tue, 21 Jan 2020 10:04:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E366F2465A for ; Tue, 21 Jan 2020 10:04:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="ulIOMOJA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729464AbgAUKDj (ORCPT ); Tue, 21 Jan 2020 05:03:39 -0500 Received: from esa4.microchip.iphmx.com ([68.232.154.123]:18585 "EHLO esa4.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729352AbgAUKDf (ORCPT ); Tue, 21 Jan 2020 05:03:35 -0500 Received-SPF: Pass (esa4.microchip.iphmx.com: domain of Claudiu.Beznea@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Claudiu.Beznea@microchip.com"; x-sender="Claudiu.Beznea@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa4.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Claudiu.Beznea@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa4.microchip.iphmx.com; spf=Pass smtp.mailfrom=Claudiu.Beznea@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: ca0145M9G2SDBq7LioglYWvecn0gKET4x5AZhCqBRL96JscZ08L9dm48BmUys93cwjzdYWnGfW /yU4Coqepf098M1whu/sdph2Yu8GUQnH/SxxlwWh5aOmvpIsl2eGSy+47HSAyR7HsqsUKt5mDU iAyQGtuxT57UtlH+49EYKONGKOHhBwefBBE+SQz+y/NE0LoqeYtqziX8/uJznRFotBQ5KHbenq /0s06swNoVWvMMj9CU+xbkNmn/l+Kn4cFeM0eWT98w3t6Fyc8LMrZDJRTM83S4iaFo6s19xRvx YA8= X-IronPort-AV: E=Sophos;i="5.70,345,1574146800"; d="scan'208";a="61695314" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 21 Jan 2020 03:03:34 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 21 Jan 2020 03:03:33 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 21 Jan 2020 03:03:33 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EifYahtq8uidVjkwEWDVEJVTUAjRLpah1AtPq+9ujWinbqoBMFVkWorQ3gjuuXDPkM29FEVkkg4TMP+AyQA6Lx94TS4WDX7+16nH5Tdy50zjS74WQ8bZR6mzQsFnTSassZ9Z/ALG1CAZyH0YMgWXvJWYxkiBHq6IOtayD6O2yOzLzSkWiwVYWEefiHaW624uV7Aoq7UjPmfLTHbt+0ONP/lRli3HN9jJzr63PWnfbjbjd1hqbgpbgSfrWbR14SijO6o27IwLTO8ZSndVoO3LhHNrc+XKh6vvlepKwFMItJ+DRGHkpZfMw/VzCzVjdfCnhSbjsTHgmi6qw8EYSo8oeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F2AYo1W7LWGeA2MKm2KYZLXjVcNJip8lPG4/cv8t56o=; b=ayqOa/OnoQIkknzaMe3IAveJtkV5iET09RkHU6aGt5Uzh9FQwehWIBQ1dln4aFCo5BMziT4RJzqzYTJQRLCJXTxHn7XDseCfDkQ0EwNztnSa+DxGBNwA2Hm7HgF8l3kMKcz9cdG8RQkqQZ9Spe48LqUVNO8d8Q7rsruUI+EcgtSQkWRbWG9OZ4HW6i+9CPb57JVBcq2VUAg1pq/XsCs9tIRPP5/xdUXQIwNeMqwgLti2OXNv/49ZaXCQ/wMzc9NN7teAVGPbijUfbXNzgal/gMD63chRjmldETkEuMNuu1KTPKODuRJZIzi4GCeWWoGFT9fORPnTymUnBNiw4qHAGQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F2AYo1W7LWGeA2MKm2KYZLXjVcNJip8lPG4/cv8t56o=; b=ulIOMOJABSjYjj/XyOYm0jSZv15ITLyoSCABZ3lXLEzVQqIJUEsh53GuBtcbWxJJBEaAyv+jv/p0HXrghl12Xtc3OPdE2Y433/OTkR/H6zzejfxl4lN206Me44wPs4kRCCLGFzEPzlKFkbN3XWiiZ6Fw4WbsKMc8XHJNEY5FkiM= Received: from DM6PR11MB3225.namprd11.prod.outlook.com (20.176.120.224) by DM6PR11MB3195.namprd11.prod.outlook.com (20.176.121.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.23; Tue, 21 Jan 2020 10:03:31 +0000 Received: from DM6PR11MB3225.namprd11.prod.outlook.com ([fe80::dc6b:1191:3a76:8b6a]) by DM6PR11MB3225.namprd11.prod.outlook.com ([fe80::dc6b:1191:3a76:8b6a%7]) with mapi id 15.20.2644.024; Tue, 21 Jan 2020 10:03:31 +0000 From: To: , , , CC: , , , Subject: [PATCH 05/15] power: reset: at91-reset: convert reset in pointer to struct at91_reset Thread-Topic: [PATCH 05/15] power: reset: at91-reset: convert reset in pointer to struct at91_reset Thread-Index: AQHV0EIJnY4G7esm70ub3Ro4FxXzlA== Date: Tue, 21 Jan 2020 10:03:31 +0000 Message-ID: <1579601001-5711-6-git-send-email-claudiu.beznea@microchip.com> References: <1579601001-5711-1-git-send-email-claudiu.beznea@microchip.com> In-Reply-To: <1579601001-5711-1-git-send-email-claudiu.beznea@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [94.177.32.156] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6ad519e4-6372-4489-81ec-08d79e592b9f x-ms-traffictypediagnostic: DM6PR11MB3195: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1824; x-forefront-prvs: 0289B6431E x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(366004)(396003)(136003)(346002)(39860400002)(199004)(189003)(107886003)(26005)(186003)(36756003)(5660300002)(110136005)(54906003)(4326008)(66556008)(66476007)(6506007)(2906002)(76116006)(91956017)(6486002)(86362001)(64756008)(6512007)(66946007)(66446008)(8676002)(81156014)(2616005)(81166006)(8936002)(6636002)(71200400001)(316002)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR11MB3195; H:DM6PR11MB3225.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: EXGMJNT52j9dpkURZINgyDnr5X19HKBvGAusI+ebnc2yyZ+0lBktbyHvilFACduaQSN4lBxUll7rrZA0QTYBK73O0taLnI69nEvFKWETpsFshOYb2JZ17v6T1cxbfS9Zm52G8M/z0VvrbNASEZjyacpaRwiu73tSEdzTMNFvEwm5raOcz7gHfQ7Gby7BqFnKqRYYgHEDc/LDVKYWGaKsvroDFZbCGfzdtt9V3kQBBZ7FBwNJHfdwpaOtrlNRR+CEFEsRsFOtYjBo6ZlhuCvseLcjtL5v+BDImxQKY9h/jpDOPxyCDyw3hv8/1/jHAk6l6BmoY52Hw2rcoM39RufPsuhruy3qPpb9ojlkXUNINqMjOOPrWDujCgJVmsuxmxiRb6iEC1sk/vZkZClzv1aQI6SRBSp6ccRiQnFno9wuUnVcM6hB1an4pheNqVkPO8in MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 6ad519e4-6372-4489-81ec-08d79e592b9f X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jan 2020 10:03:31.6486 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: PKoOCoLsWAHPpZUQtmm5yG3mjaadVVYkGH5fT8j7t2ggmfdV3kcZP/I+zoP+PcQ5wllKRV54hgVFEhqZmJ6f5OYmSeqmj8FClWdwtSrrq0I= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3195 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Convert reset in pointer to struct at91_reset. Signed-off-by: Claudiu Beznea --- drivers/power/reset/at91-reset.c | 50 ++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/drivers/power/reset/at91-reset.c b/drivers/power/reset/at91-reset.c index e8840193620d..4bb5eef4b258 100644 --- a/drivers/power/reset/at91-reset.c +++ b/drivers/power/reset/at91-reset.c @@ -56,7 +56,7 @@ struct at91_reset { struct notifier_block nb; }; -static struct at91_reset reset; +static struct at91_reset *reset; /* * unless the SDRAM is cleanly shutdown before we hit the @@ -81,8 +81,8 @@ static int at91sam9260_restart(struct notifier_block *this, unsigned long mode, "b .\n\t" : - : "r" (reset.ramc_base[0]), - "r" (reset.rstc_base), + : "r" (reset->ramc_base[0]), + "r" (reset->rstc_base), "r" (1), "r" cpu_to_le32(AT91_SDRAMC_LPCB_POWER_DOWN), "r" cpu_to_le32(AT91_RSTC_KEY | AT91_RSTC_PERRST | AT91_RSTC_PROCRST)); @@ -123,9 +123,9 @@ static int at91sam9g45_restart(struct notifier_block *this, unsigned long mode, " b .\n\t" : - : "r" (reset.ramc_base[0]), - "r" (reset.ramc_base[1]), - "r" (reset.rstc_base), + : "r" (reset->ramc_base[0]), + "r" (reset->ramc_base[1]), + "r" (reset->rstc_base), "r" (1), "r" cpu_to_le32(AT91_DDRSDRC_LPCB_POWER_DOWN), "r" cpu_to_le32(AT91_RSTC_KEY | AT91_RSTC_PERRST | AT91_RSTC_PROCRST) @@ -138,7 +138,7 @@ static int sama5d3_restart(struct notifier_block *this, unsigned long mode, void *cmd) { writel(cpu_to_le32(AT91_RSTC_KEY | AT91_RSTC_PERRST | AT91_RSTC_PROCRST), - reset.rstc_base); + reset->rstc_base); return NOTIFY_DONE; } @@ -147,7 +147,7 @@ static int samx7_restart(struct notifier_block *this, unsigned long mode, void *cmd) { writel(cpu_to_le32(AT91_RSTC_KEY | AT91_RSTC_PROCRST), - reset.rstc_base); + reset->rstc_base); return NOTIFY_DONE; } @@ -155,7 +155,7 @@ static int samx7_restart(struct notifier_block *this, unsigned long mode, static void __init at91_reset_status(struct platform_device *pdev) { const char *reason; - u32 reg = readl(reset.rstc_base + AT91_RSTC_SR); + u32 reg = readl(reset->rstc_base + AT91_RSTC_SR); switch ((reg & AT91_RSTC_RSTTYP) >> 8) { case RESET_TYPE_GENERAL: @@ -212,8 +212,12 @@ static int __init at91_reset_probe(struct platform_device *pdev) struct device_node *np; int ret, idx = 0; - reset.rstc_base = of_iomap(pdev->dev.of_node, 0); - if (!reset.rstc_base) { + reset = devm_kzalloc(&pdev->dev, sizeof(*reset), GFP_KERNEL); + if (!reset) + return -ENOMEM; + + reset->rstc_base = of_iomap(pdev->dev.of_node, 0); + if (!reset->rstc_base) { dev_err(&pdev->dev, "Could not map reset controller address\n"); return -ENODEV; } @@ -221,8 +225,8 @@ static int __init at91_reset_probe(struct platform_device *pdev) if (!of_device_is_compatible(pdev->dev.of_node, "atmel,sama5d3-rstc")) { /* we need to shutdown the ddr controller, so get ramc base */ for_each_matching_node(np, at91_ramc_of_match) { - reset.ramc_base[idx] = of_iomap(np, 0); - if (!reset.ramc_base[idx]) { + reset->ramc_base[idx] = of_iomap(np, 0); + if (!reset->ramc_base[idx]) { dev_err(&pdev->dev, "Could not map ram controller address\n"); of_node_put(np); return -ENODEV; @@ -232,22 +236,22 @@ static int __init at91_reset_probe(struct platform_device *pdev) } match = of_match_node(at91_reset_of_match, pdev->dev.of_node); - reset.nb.notifier_call = match->data; - reset.nb.priority = 192; + reset->nb.notifier_call = match->data; + reset->nb.priority = 192; - reset.sclk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(reset.sclk)) - return PTR_ERR(reset.sclk); + reset->sclk = devm_clk_get(&pdev->dev, NULL); + if (IS_ERR(reset->sclk)) + return PTR_ERR(reset->sclk); - ret = clk_prepare_enable(reset.sclk); + ret = clk_prepare_enable(reset->sclk); if (ret) { dev_err(&pdev->dev, "Could not enable slow clock\n"); return ret; } - ret = register_restart_handler(&reset.nb); + ret = register_restart_handler(&reset->nb); if (ret) { - clk_disable_unprepare(reset.sclk); + clk_disable_unprepare(reset->sclk); return ret; } @@ -258,8 +262,8 @@ static int __init at91_reset_probe(struct platform_device *pdev) static int __exit at91_reset_remove(struct platform_device *pdev) { - unregister_restart_handler(&reset.nb); - clk_disable_unprepare(reset.sclk); + unregister_restart_handler(&reset->nb); + clk_disable_unprepare(reset->sclk); return 0; } From patchwork Tue Jan 21 10:03:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 212995 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=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS 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 88F1BC35245 for ; Tue, 21 Jan 2020 10:04:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 54A0124655 for ; Tue, 21 Jan 2020 10:04:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="e7E6kK/j" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729605AbgAUKDt (ORCPT ); Tue, 21 Jan 2020 05:03:49 -0500 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:14578 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729598AbgAUKDt (ORCPT ); Tue, 21 Jan 2020 05:03:49 -0500 Received-SPF: Pass (esa6.microchip.iphmx.com: domain of Claudiu.Beznea@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa6.microchip.iphmx.com; envelope-from="Claudiu.Beznea@microchip.com"; x-sender="Claudiu.Beznea@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa6.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa6.microchip.iphmx.com; envelope-from="Claudiu.Beznea@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa6.microchip.iphmx.com; spf=Pass smtp.mailfrom=Claudiu.Beznea@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: r58NK1H09lJE6HK5EENXeRR19+c1fbnA4h68g2Jmo/76t4L74or2G1FA4fXDSYjZHEwN4TpXaB eDnjZDKZZFtXRHoy2Njrm//TDP3Zis5OJgSVibr77Zarx8VAyd6+9sWtq4YllPnqECwO1JtGli YbLPI6WOp4gOhFudYx1LOMVRtfKYm9FIM+WyLjPFB0roUyQlytXehCXvGFAFKJu4bAor82zPcL 7K2EsdNr+35YDwKe8JpRolacESCq4zQkOK2wilwW2m0XDKlL18UCkaoqnd+vHJLyDdWscnGBl+ DNc= X-IronPort-AV: E=Sophos;i="5.70,345,1574146800"; d="scan'208";a="61482001" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 21 Jan 2020 03:03:48 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 21 Jan 2020 03:03:39 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 21 Jan 2020 03:03:39 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SYJQPmZpZ3Rv0wdxW52FDVjUUEr6Rs07DEXqm0OWIH9Ch0txAw56nJoVb+Au/MjAduB5bzWLKgJupAeTBLp6pINtKxgEaJ2m9uK+d6yfUGLyDnEzblzD+FNAmGF1IyaQv/Y5Ot6BumNMvE5qvYFyuvJbcDo8pRDRqzEKFV4NawtgitvcF+HKKDxnjzxALx5OrVaWTRfKbIH13ZTEJFw1zdWuckeg8mn+n4/Px6Kbf4lHnSVnSInrDCHPzD5m0/b0szs6l5SuRAQfeeeVxWPq8Z7SOcPHGYuJ31gU6mpeBrCihwAIHAoWXO6bkQaZhG0PO1YfBbADKLDiP8kRE+qfzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RhtQU+CBLsVB99bvIxgdXMyFoajsowwgPLcLAi9dwgc=; b=Dy8v6quBLA/Dz9d1W2gPn0eLiSd3pIwIzRy32V54NF25jVP5+FNdxduxg8ISCspaGimOLQZBySmeB7/vXhOa+HXXpl9g+ifkvYi7CaBGOa/1z5FCpdz/Ov68ALJlpWr72NOJwD3YXfziklOi4MJsW0bmkuriOMOsXRbKque92dc2AS7jpo5M0N/f6xY80rJemNY4+z6wkzueFMul47XdrokxivZaBvvW0RT5mve7WPixZrfpBVbCHn3gYjrCxj/lCzD/Uk0oB7+Zu85hX9VCVJoPiLoYeLtCJ1BOI49qj9pPQ2eKtvBMn9pCSQlHKEM8nyk4j+2qkZzx1o7hFlvfsw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RhtQU+CBLsVB99bvIxgdXMyFoajsowwgPLcLAi9dwgc=; b=e7E6kK/jRFm8Uc1XJhifrbjsyPGjhR3iSMkCdKi0zSNIWVClp6uiQs8P45iqV5tM/okdX+DKGkMv33AdVekjzagN2uu6uysWNLnAxW1llkRBBYHFdu35//+L4BWPxlky5WFEgRE7iWaiOKrFgdveuV+a299cFBgVPXbk9KGLXy0= Received: from DM6PR11MB3225.namprd11.prod.outlook.com (20.176.120.224) by DM6PR11MB3195.namprd11.prod.outlook.com (20.176.121.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.23; Tue, 21 Jan 2020 10:03:38 +0000 Received: from DM6PR11MB3225.namprd11.prod.outlook.com ([fe80::dc6b:1191:3a76:8b6a]) by DM6PR11MB3225.namprd11.prod.outlook.com ([fe80::dc6b:1191:3a76:8b6a%7]) with mapi id 15.20.2644.024; Tue, 21 Jan 2020 10:03:38 +0000 From: To: , , , CC: , , , Subject: [PATCH 12/15] power: reset: at91-reset: make at91sam9g45_restart() generic Thread-Topic: [PATCH 12/15] power: reset: at91-reset: make at91sam9g45_restart() generic Thread-Index: AQHV0EIMzNNYH7bibkmfRa3URPRK0Q== Date: Tue, 21 Jan 2020 10:03:37 +0000 Message-ID: <1579601001-5711-13-git-send-email-claudiu.beznea@microchip.com> References: <1579601001-5711-1-git-send-email-claudiu.beznea@microchip.com> In-Reply-To: <1579601001-5711-1-git-send-email-claudiu.beznea@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [94.177.32.156] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 19de8d39-22a3-4999-7f06-08d79e592f8a x-ms-traffictypediagnostic: DM6PR11MB3195: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2150; x-forefront-prvs: 0289B6431E x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(366004)(396003)(136003)(346002)(39860400002)(199004)(189003)(107886003)(26005)(186003)(36756003)(5660300002)(110136005)(54906003)(4326008)(66556008)(66476007)(6506007)(2906002)(76116006)(91956017)(6486002)(86362001)(64756008)(6512007)(66946007)(66446008)(8676002)(81156014)(2616005)(81166006)(8936002)(6636002)(71200400001)(316002)(478600001)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR11MB3195; H:DM6PR11MB3225.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: eyFquF0mICdDMqiW6lBR0+cLnQfZyMa3HKOANV28WCBU6qNG0yBLc0HgAvQFf95vzZ09yY+f6+HgcbLEUib9VVWe+gzZZymRgpKLFib4ZYEa4p3EQlavXoYmfaXz106h1F7FbN4Aqz1ImkBAX+mJ1QVgWWnSfSOHwm1GaA1ZnULoLIoY67E2RVgOf6jK2KBAJv42QRm7OVDMKXf51pU/0YOY0aVjutjzJ0O/ki95k/C3OkUFCj9g7o3DuCPkjMFBadL5Fy/Tj03VhllP5TgZBcsHQ9wh/aaf26flfVkogcKpXR3ghtoxP5FJLc67uIHRfRKWwV+c5xnVVws1ZS3MJbORZY7lDdfYD4sgd4Lyt6sfNgNY4UL2KpnBhHc+i4PVdaeeqSa63eJ57qgccLPKcovK9FqnMfUIWwg6VDMUrp9uH9QWtg4Vc41sf21ea0DCp0dIVpLeGKQiUWCOshgZJ/7jXeYBAkTTC/g5tQhkfPY= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 19de8d39-22a3-4999-7f06-08d79e592f8a X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jan 2020 10:03:37.7241 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: qrFbL6wJdJz9oKq1ZwP4sij/ruQyyNGJfO1nqJsr8KPQxPRYTJGmy9k0K1fni+C+MCuliq8mrrT0bqgqmNSJzKM2FuzbT/MTlrvAp8G2g9A= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3195 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Make at91sam9g45_restart() generic. Signed-off-by: Claudiu Beznea --- drivers/power/reset/at91-reset.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/drivers/power/reset/at91-reset.c b/drivers/power/reset/at91-reset.c index 4e1961334e4d..61433060d784 100644 --- a/drivers/power/reset/at91-reset.c +++ b/drivers/power/reset/at91-reset.c @@ -105,32 +105,23 @@ static int at91sam9g45_restart(struct notifier_block *this, unsigned long mode, struct at91_reset *reset = container_of(this, struct at91_reset, nb); asm volatile( - /* - * Test wether we have a second RAM controller to care - * about. - * - * First, test that we can dereference the virtual address. - */ - "cmp %1, #0\n\t" - "beq 1f\n\t" - - /* Then, test that the RAM controller is enabled */ - "ldr r4, [%1]\n\t" - "cmp r4, #0\n\t" - /* Align to cache lines */ ".balign 32\n\t" /* Disable SDRAM0 accesses */ - "1: str %3, [%0, #" __stringify(AT91_DDRSDRC_RTR) "]\n\t" + " tst %0, #0\n\t" + " beq 1f\n\t" + " str %3, [%0, #" __stringify(AT91_DDRSDRC_RTR) "]\n\t" /* Power down SDRAM0 */ " str %4, [%0, %6]\n\t" /* Disable SDRAM1 accesses */ + "1: tst %1, #0\n\t" + " beq 2f\n\t" " strne %3, [%1, #" __stringify(AT91_DDRSDRC_RTR) "]\n\t" /* Power down SDRAM1 */ " strne %4, [%1, %6]\n\t" /* Reset CPU */ - " str %5, [%2, #" __stringify(AT91_RSTC_CR) "]\n\t" + "2: str %5, [%2, #" __stringify(AT91_RSTC_CR) "]\n\t" " b .\n\t" : From patchwork Tue Jan 21 10:03:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 212993 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=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS 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 921FCC33CB8 for ; Tue, 21 Jan 2020 10:04:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 55BA524676 for ; Tue, 21 Jan 2020 10:04:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="hfn6Bef9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729701AbgAUKEP (ORCPT ); Tue, 21 Jan 2020 05:04:15 -0500 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:14542 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729406AbgAUKDl (ORCPT ); Tue, 21 Jan 2020 05:03:41 -0500 Received-SPF: Pass (esa6.microchip.iphmx.com: domain of Claudiu.Beznea@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa6.microchip.iphmx.com; envelope-from="Claudiu.Beznea@microchip.com"; x-sender="Claudiu.Beznea@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa6.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa6.microchip.iphmx.com; envelope-from="Claudiu.Beznea@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa6.microchip.iphmx.com; spf=Pass smtp.mailfrom=Claudiu.Beznea@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: YaZ25HCHd9MDL4nrCKqEckPMp9U8nDYrmNcGMIMqjw6ZxtfmXVSoaW9PN4hQHKNTLVlbbHiJwd 9g180v09PukYAgP7skJdo8LkhHo9cbhYZoQHkdKD1Wy+nUU5k7KcMQ1QESsI3sRYWhIf64cIGT 8vJPBzptTKKjTsaSf/Q3Er+UcmKxkBzY1bhWML2uB8kmW+86YkDmSrR/cxxx7LewJZQzmALx2s U8LoUDafuq3+j1m9uW5QeLgeKMVO/ByVpJaqtQrtqDa9ePzpY3QlWOOc8dj9qA5ApD8FTW9F+3 wa8= X-IronPort-AV: E=Sophos;i="5.70,345,1574146800"; d="scan'208";a="61481956" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 21 Jan 2020 03:03:40 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 21 Jan 2020 03:03:39 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 21 Jan 2020 03:03:39 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gslh72yMcaJW/kv5f9s2vh89Vk3GHV4SPukRyWuggiitfkA0DsHHkkBdoYaZFBFVqPP/bdUKLQIi7K/kmiId6iY9Nozqw+wOweYKSZqvmOkS76+EjgMvhQuKDrBMBijT67uN2DUD94KcUTHTAWrSRZD5dWwCPOJ8L1dr2OwdfDdweAxZMn+Wxdgza19P1s1ltvXvfHy0Zi3pbuxaBdRLAkIZsWTPWJLTA4S57yyGnLuQnggK2MQjZ01I+4/9y8FAJxffwfkpAvSifXJSONNBvVAOyfb2JH3EX+rX/Tw6vHCqcMy2wpz+xKPfDcBHwnfa516XI0TQhjv8eiTrikBVbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CSgkQ+QVhd8fNuskSB4YcrNio8Fdt2ZF1VWo+k1UP70=; b=ZczlPGrrIBq0lrk38HrajB4fnncilKPcK+W4gq1aqLipmrowG/lhre93mkdmp4JFoSQMTJKGUJyP6m+oXVnxe8SGhYDtyFwy98vV7a1BMIR3C6OI6uMK4q/FFdKmWXtDSyvlGpcMghb4xzDGAIj1hUy92DT88KNqVAT47IbhhRw6s0/IsS7mGfYysOzZ87uV8RiUH8FQSeT0Gfwwa7v/MH45Xqh/Q55jeyBy+7wDBLbN9NCSCeYq9RgZxonjsfdLkH6WOa7h+5P5X0zrS//GzATJrP32SA5RI5C6hJDdRO2e5vAdHkS8qnp1bp2LPpjnGocQYtk7rpBY++bGCUq1xw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CSgkQ+QVhd8fNuskSB4YcrNio8Fdt2ZF1VWo+k1UP70=; b=hfn6Bef9o/lZNPNGVC0QXsHvSCFATcZZEkXf4A7O6dEfo0KEomI6BDoezKKYd22LKQj95P9WB17L63sH46CmDapybWA3xXpXG6Js9yDBUTadjko++dV7md0OzWRfJ8qifSzlKSKfL0BRib3Kp7LgiySrTxscu7JpzIL8GZZYRoU= Received: from DM6PR11MB3225.namprd11.prod.outlook.com (20.176.120.224) by DM6PR11MB3195.namprd11.prod.outlook.com (20.176.121.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.23; Tue, 21 Jan 2020 10:03:38 +0000 Received: from DM6PR11MB3225.namprd11.prod.outlook.com ([fe80::dc6b:1191:3a76:8b6a]) by DM6PR11MB3225.namprd11.prod.outlook.com ([fe80::dc6b:1191:3a76:8b6a%7]) with mapi id 15.20.2644.024; Tue, 21 Jan 2020 10:03:38 +0000 From: To: , , , CC: , , , Subject: [PATCH 13/15] power: reset: at91-reset: keep only one reset function Thread-Topic: [PATCH 13/15] power: reset: at91-reset: keep only one reset function Thread-Index: AQHV0EIN4pR9JeMnZ0SqGReN+xq8tA== Date: Tue, 21 Jan 2020 10:03:38 +0000 Message-ID: <1579601001-5711-14-git-send-email-claudiu.beznea@microchip.com> References: <1579601001-5711-1-git-send-email-claudiu.beznea@microchip.com> In-Reply-To: <1579601001-5711-1-git-send-email-claudiu.beznea@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [94.177.32.156] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 410ba330-7a36-4660-97e6-08d79e592fd6 x-ms-traffictypediagnostic: DM6PR11MB3195: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:651; x-forefront-prvs: 0289B6431E x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(366004)(396003)(136003)(346002)(39860400002)(199004)(189003)(107886003)(26005)(186003)(36756003)(5660300002)(110136005)(54906003)(4326008)(66556008)(66476007)(6506007)(2906002)(76116006)(91956017)(6486002)(86362001)(64756008)(6512007)(66946007)(66446008)(8676002)(81156014)(2616005)(81166006)(8936002)(6636002)(71200400001)(316002)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR11MB3195; H:DM6PR11MB3225.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: CNDJtTCStd+S0w2ha4ceIfKYX0tjsy/WEWbdYVABmAXPZQRB56u60n0HTUeTdD90XWpfMPZnD6c+B6oW/AWShHIQyyS1JeAS1sNm6/2QtC4F0SmskigcE7z9OA6/cu2k1HEMiDpshlR8DnY6/DAzf1pGSAN8YlFpkpKq/gBw5XDQusrCMuv0CaAV39mjEQLMcBIhx7RRAT8BV73RRAPdYjo7U2T6XWlBK+Znib4BFG9I24NwAcDuXU+8AeTC61Q1tkIhCAjmGzN5F8lOj1tXMSXiojDvmGfLWg6ACJ6BrlS/LEQj0vGf/qoxuC8n3Wl+Hp1J++GnG4D7QXpTGCHfWQXmNaxf0n+3dLHIb8jo68n15J8JVZCov40GFflzCOKnnONepDiGz+NTLP0OhrKJSU+2vvgyv+m3j5w1Vldhyt8XRIiY92Tgz0ZB4BwYue6v MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 410ba330-7a36-4660-97e6-08d79e592fd6 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jan 2020 10:03:38.3327 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: n1a4RQn737anXI1+YlaxSprpJCVE/xu+hOxBhLelakFqk+CbxUX8cc5aSlnD7crskUqGUlCfm3cULhhfHvngUnKw3rJYT8VAm5pp1JWOLic= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3195 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Keep only one reset function. With this, notifier_call member of struct at91_reset_data could be removed. Signed-off-by: Claudiu Beznea --- drivers/power/reset/at91-reset.c | 52 +++------------------------------------- 1 file changed, 3 insertions(+), 49 deletions(-) diff --git a/drivers/power/reset/at91-reset.c b/drivers/power/reset/at91-reset.c index 61433060d784..9c1b69f76a01 100644 --- a/drivers/power/reset/at91-reset.c +++ b/drivers/power/reset/at91-reset.c @@ -50,8 +50,6 @@ enum reset_type { }; struct at91_reset_data { - int (*notifier_call)(struct notifier_block *this, unsigned long mode, - void *cmd); u32 args; }; @@ -69,38 +67,8 @@ struct at91_reset { * reset register it can be left driving the data bus and * killing the chance of a subsequent boot from NAND */ -static int at91sam9260_restart(struct notifier_block *this, unsigned long mode, - void *cmd) -{ - struct at91_reset *reset = container_of(this, struct at91_reset, nb); - - asm volatile( - /* Align to cache lines */ - ".balign 32\n\t" - - /* Disable SDRAM accesses */ - "str %2, [%0, #" __stringify(AT91_SDRAMC_TR) "]\n\t" - - /* Power down SDRAM */ - "str %3, [%0, %5]\n\t" - - /* Reset CPU */ - "str %4, [%1, #" __stringify(AT91_RSTC_CR) "]\n\t" - - "b .\n\t" - : - : "r" (reset->ramc_base[0]), - "r" (reset->rstc_base), - "r" (1), - "r" cpu_to_le32(AT91_SDRAMC_LPCB_POWER_DOWN), - "r" (reset->args), - "r" (reset->ramc_lpr)); - - return NOTIFY_DONE; -} - -static int at91sam9g45_restart(struct notifier_block *this, unsigned long mode, - void *cmd) +static int at91_reset(struct notifier_block *this, unsigned long mode, + void *cmd) { struct at91_reset *reset = container_of(this, struct at91_reset, nb); @@ -137,16 +105,6 @@ static int at91sam9g45_restart(struct notifier_block *this, unsigned long mode, return NOTIFY_DONE; } -static int sama5d3_restart(struct notifier_block *this, unsigned long mode, - void *cmd) -{ - struct at91_reset *reset = container_of(this, struct at91_reset, nb); - - writel(reset->args, reset->rstc_base); - - return NOTIFY_DONE; -} - static void __init at91_reset_status(struct platform_device *pdev, void __iomem *base) { @@ -199,22 +157,18 @@ static const struct of_device_id at91_ramc_of_match[] = { }; static const struct at91_reset_data at91sam9260_reset_data = { - .notifier_call = at91sam9260_restart, .args = AT91_RSTC_KEY | AT91_RSTC_PERRST | AT91_RSTC_PROCRST, }; static const struct at91_reset_data at91sam9g45_reset_data = { - .notifier_call = at91sam9g45_restart, .args = AT91_RSTC_KEY | AT91_RSTC_PERRST | AT91_RSTC_PROCRST, }; static const struct at91_reset_data sama5d3_reset_data = { - .notifier_call = sama5d3_restart, .args = AT91_RSTC_KEY | AT91_RSTC_PERRST | AT91_RSTC_PROCRST, }; static const struct at91_reset_data samx7_reset_data = { - .notifier_call = sama5d3_restart, .args = AT91_RSTC_KEY | AT91_RSTC_PROCRST, }; @@ -277,7 +231,7 @@ static int __init at91_reset_probe(struct platform_device *pdev) match = of_match_node(at91_reset_of_match, pdev->dev.of_node); reset_data = match->data; - reset->nb.notifier_call = reset_data->notifier_call; + reset->nb.notifier_call = at91_reset; reset->nb.priority = 192; reset->args = reset_data->args; From patchwork Tue Jan 21 10:03:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 212996 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=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS autolearn=ham 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 13C4AC35243 for ; Tue, 21 Jan 2020 10:03:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D45D120882 for ; Tue, 21 Jan 2020 10:03:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="i8BXzg69" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729598AbgAUKDw (ORCPT ); Tue, 21 Jan 2020 05:03:52 -0500 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:14578 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729609AbgAUKDv (ORCPT ); Tue, 21 Jan 2020 05:03:51 -0500 Received-SPF: Pass (esa6.microchip.iphmx.com: domain of Claudiu.Beznea@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa6.microchip.iphmx.com; envelope-from="Claudiu.Beznea@microchip.com"; x-sender="Claudiu.Beznea@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa6.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa6.microchip.iphmx.com; envelope-from="Claudiu.Beznea@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa6.microchip.iphmx.com; spf=Pass smtp.mailfrom=Claudiu.Beznea@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: jiRiUdriH6fooGUBe7iwl9WoBzf4bwWUEldyEi3ggEBjOQ+6ev9cGg3bD75OjmO7RIDUDCidr9 06SGTgNA6tOhpLqkLnHxZ/HbBq4tTgHbl8nc/G62BwDYb+/VN/ZL1mGbk2pQ6vw3zRkRozbYRf k1KotOvjcPaRJ6rT6oNsFGxa5iBIU/QW7nzBfgKlA9E71scW6lejHeEKWu2UpUPVoRPvu4hw2Z 1BUBLUuBaFvvzGORjyRQ4bq5+653dW/pbE8qV5wzSgK4Hpkz2+4Q2yuGfla583ALoXl48i0FQK V6Y= X-IronPort-AV: E=Sophos;i="5.70,345,1574146800"; d="scan'208";a="61482013" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 21 Jan 2020 03:03:50 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 21 Jan 2020 03:03:41 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 21 Jan 2020 03:03:41 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=egD5L33uChgUe9f2/fGWwAFJ+K+Wc1eT2q5z8clrlPc9o5nkyb3d03JjTiOYm0NoRhtuYQAg7JJVpZk3F4IJrcPDk2DRA9JYLJPDYKkjkbXiMXUWL0vFTxmeQJ1T+mH4Zz28GXzhVAy4NRzeBG91lQDPkxT6OShqEMy07shkoTKMDHYIHRriPTOAnOQ6GUVmcmw+8hHsJtCCav8TWIm90amwP3RgFSsTOBpCnNGCQ6j+FGAqzIliJPkDRxO8uBkMNFY9XyIgcZ4PkGet0FAWrWgLY6Oo66WnBMuz42NgyXPpSu46yNBEpvcJ2MKdMMtaERT+8cACcKUWffxA0VfV5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CTDz3/gEuQTOjIc8iOtlt7s25+PU0XWggdpv+NKrLBU=; b=j2nEUtxb1F+QpKiavi74JAQzLYz13VhJZKvvz/b2eY/Eua8ji6AxeqR6h6aa9YUwizlQmEzLQ1mM1cQy+QXWI4SLmPqSIstVfQ6GmlLIfgKjffNf8cA8pnnAfuFwfxI+aUGvblAcHqk0TrTNCPwkJt6NsilCEGWADZu3hlI0BGu9K2CmmHxtSj9IFQH3EP/HEPn5+7ckfiYlSobwF3CWmShtQYka5jCbwNa4uM2ep97Re/k6ILX8JzK/qAbIVCmRRDNPJpqdA2NaCC3xWvErlVbdkEucj/47QbPOU8KONNYRn9OwETb7uav6moS7+VzxkuKA/KrrD8HjnPwAE+HwCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CTDz3/gEuQTOjIc8iOtlt7s25+PU0XWggdpv+NKrLBU=; b=i8BXzg69OE70+mPTg2DaIbIYbeK/39KRTIuKTat6kBgX6j/bWqEnd1vuYWsyqxtIMHA34zEIs3jRPtq+/ye0w5t62oy8KRC4+oeN/je5Qj35Gf2+mNQ+/+Me0oz1WZBJibowu2tRIBLdgOchHlNrIS5iKk6/N5GpY1JyQdRL0Uc= Received: from DM6PR11MB3225.namprd11.prod.outlook.com (20.176.120.224) by DM6PR11MB3195.namprd11.prod.outlook.com (20.176.121.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.23; Tue, 21 Jan 2020 10:03:39 +0000 Received: from DM6PR11MB3225.namprd11.prod.outlook.com ([fe80::dc6b:1191:3a76:8b6a]) by DM6PR11MB3225.namprd11.prod.outlook.com ([fe80::dc6b:1191:3a76:8b6a%7]) with mapi id 15.20.2644.024; Tue, 21 Jan 2020 10:03:39 +0000 From: To: , , , CC: , , , Subject: [PATCH 15/15] power: reset: at91-reset: handle nrst async for sam9x60 Thread-Topic: [PATCH 15/15] power: reset: at91-reset: handle nrst async for sam9x60 Thread-Index: AQHV0EINUPsFdrOD60ihk98/gadShw== Date: Tue, 21 Jan 2020 10:03:39 +0000 Message-ID: <1579601001-5711-16-git-send-email-claudiu.beznea@microchip.com> References: <1579601001-5711-1-git-send-email-claudiu.beznea@microchip.com> In-Reply-To: <1579601001-5711-1-git-send-email-claudiu.beznea@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [94.177.32.156] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cbcdb102-e729-47ce-17bc-08d79e59306f x-ms-traffictypediagnostic: DM6PR11MB3195: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:530; x-forefront-prvs: 0289B6431E x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(366004)(396003)(136003)(346002)(39860400002)(199004)(189003)(107886003)(26005)(186003)(36756003)(5660300002)(110136005)(54906003)(4326008)(66556008)(66476007)(6506007)(2906002)(76116006)(91956017)(6486002)(86362001)(64756008)(6512007)(66946007)(66446008)(8676002)(81156014)(2616005)(81166006)(8936002)(6636002)(71200400001)(316002)(478600001)(138113003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR11MB3195; H:DM6PR11MB3225.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: vJ0QTMB2AAPZlb99tjCmIk+MkE9KZIfbWvu/+kq/c+RR/5SCrW2YEKEAvJl6ByI4P676SPXwHZW/+lCa2oiw4nQILxKkO/wYC4b2wHOx1oHNosJguSbRIX0i5kccPTj/gonGzEKrQ6QWRJ72iK04VpySkYQTu8BJ1uor/YZlyiGL3uHHqbarZZ0ItitFMU0HzwOe+xd0rJzwFidIPMEmFqsN9/SSntvCSa+44nXJCCqtrSEX8x55ov5uHzn3lwlnh+BfCUsQXzL7zEJU+57TqAsixUl9KgSr+I/V/3DmwMgV+1qayY0II4hVFNGpNii2IveKZ5lKChFu+mNhWWfir9c//kFHcnVatZY3X7ujV7mEP8qmVv5/HbV9vXatx3LI8i7DPUxl7oAamuU6zLL/KnE8Ua4bisaLd92US62n8zKCdvU5kJ9t7KpRcSmbYcd9ydr8dRAaNTSqRPZf4nG/LjCd3Sh3vreXoWfANRkPyS5slmG4YhwNBDV+xbyJ1B/o MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: cbcdb102-e729-47ce-17bc-08d79e59306f X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jan 2020 10:03:39.5540 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: /MVJzzMJjKdLdxT96bEgdMeS5DsAyDRqsD4f3IErNarbqClc3F6Yd5dwTt9Y9LCwli05nJS8NuqbnvflWBtSfttWsF7CFTfZEl+ERziwo24= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3195 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Handle NRST asynchronously for SAM9X60 to avoid problem with fast drop of VDDCORE on shutdown operations in the first 100 us after CPU is shutdown. Signed-off-by: Claudiu Beznea --- drivers/power/reset/at91-reset.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/power/reset/at91-reset.c b/drivers/power/reset/at91-reset.c index 537ccb180568..3ff9d93a5226 100644 --- a/drivers/power/reset/at91-reset.c +++ b/drivers/power/reset/at91-reset.c @@ -35,6 +35,7 @@ #define AT91_RSTC_MR 0x08 /* Reset Controller Mode Register */ #define AT91_RSTC_URSTEN BIT(0) /* User Reset Enable */ +#define AT91_RSTC_URSTASYNC BIT(2) /* User Reset Asynchronous Control */ #define AT91_RSTC_URSTIEN BIT(4) /* User Reset Interrupt Enable */ #define AT91_RSTC_ERSTL GENMASK(11, 8) /* External Reset Length */ @@ -228,6 +229,13 @@ static int __init at91_reset_probe(struct platform_device *pdev) platform_set_drvdata(pdev, reset); + if (of_device_is_compatible(pdev->dev.of_node, "microchip,sam9x60-rstc")) { + u32 val = readl(reset->rstc_base + AT91_RSTC_MR); + + writel(AT91_RSTC_KEY | AT91_RSTC_URSTASYNC | val, + reset->rstc_base + AT91_RSTC_MR); + } + ret = register_restart_handler(&reset->nb); if (ret) { clk_disable_unprepare(reset->sclk);