Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp12973540rwd; Fri, 23 Jun 2023 13:35:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6mi2pvnfsxUEYLqWD/49xtWrRV9fyd7z2xYQaAMsGAcEGwsW8Bjcgyqgq9rHhgetTiXJWd X-Received: by 2002:a05:6a20:3d10:b0:125:5f1d:9dbe with SMTP id y16-20020a056a203d1000b001255f1d9dbemr6271393pzi.2.1687552505783; Fri, 23 Jun 2023 13:35:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687552505; cv=none; d=google.com; s=arc-20160816; b=vaqCvrUHTcRvY4EnCUVPiCA9b6vF0XWo7YtLFU81ZTb1XznohS+T1spgxqhOz/Ipy8 S9eJbFG7OsaGfnggNecmnJVEkCcfa6g+K6xenMefSolF8V0W7CsfhAdHCW1wpc29v2XO Bhm4126ET8gfdESMT2AbTfgaqaMX2qLGYwWPYHhOWSzXR5CGSCjcaAiOHFSYcLy1OXkb qReuLGFGPnWHjj7TR+8bOf+JRavwodbYH34GwDPNhDDNc98myz4OMHO3VXcTNCLpBoqk HDd3nRgfI+6WJuj3HvMPAdsrK50IdhJ8jochhmdB0IUkccYSSpmNKW9xP/FWHhCGM4gb ScHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hu3+2Qv9/B+TyAjUrAOhFmPFeLsxClYcg1uIxOBWOOU=; b=w4WqB30T2ga0a76z76Bg0sMFdXqzUJMaqOm/CLGAUNXZOY+/xK8azuDfE9ud4mnPW6 6KVKEunYIS51FfkudsCQBUOZd4/xNfy9cpi6UGPCK6s3XCPjaTXMOSTiEr54ys/d6cu7 U+r/lLfmtQ/vaGfGaPVmLoWteaBN49SmPGpoRw+SevdWWjneXp7YQ7fkYm6rTjtzBcW8 6NcewpEbCUL8oO2QvulrT6vXOY8QajA5SRlpXaMaOJHM+Fpm4FbwMylVwMR+kyeB17ZJ C+Oi4p7DGMzWUmcJCH74JAtbuIYzZ298Wyjgbjq02Xmg1V5+oFClM56t5q6AyY/fGsr3 8Www== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b="0/CDT82g"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y29-20020aa79afd000000b0066885c2a4besi725586pfp.65.2023.06.23.13.34.52; Fri, 23 Jun 2023 13:35:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b="0/CDT82g"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232117AbjFWUej (ORCPT + 99 others); Fri, 23 Jun 2023 16:34:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230355AbjFWUe1 (ORCPT ); Fri, 23 Jun 2023 16:34:27 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F37AE2D5D; Fri, 23 Jun 2023 13:34:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1687552444; x=1719088444; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+/HQhcHBxeFox5idw381gGM3I1gJzj1ra4FhcdQBIWA=; b=0/CDT82gci5rkj6xHBtQ8ZUIxh0Fnj/JJPYnTVRLkRjcHhv4D4ZRnOLP VDrHHHyZN7F5Sq9qKWC/x2zmmS4g79xWeentG6N/Vbibc6CxCeBX95Yqj YAHU9+icEtBJV/eyFfTwCmwM3UqL7e/zbNvHTC8xqlZAkO27U1fGgIssV iAwNz4b+xlVuB//egXgUMoje+6RuD5l6gxHi3JlDqusV0FulfurkThYQH +QF0PjreFum86rpF+zEQkzKQ92JbgES69B0MPpzTeyd65AihhGZ227aRW Gs4E+a1zwZgDCOfFgfiIzDhsd1zFy312W72oMP4S5CQ0Ge+cRG65SZge1 g==; X-IronPort-AV: E=Sophos;i="6.01,153,1684825200"; d="scan'208";a="220216091" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 23 Jun 2023 13:34:02 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) 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.2507.21; Fri, 23 Jun 2023 13:33:57 -0700 Received: from che-lt-i67070.amer.actel.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.21 via Frontend Transport; Fri, 23 Jun 2023 13:33:29 -0700 From: Varshini Rajendran To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , , , , , Subject: [PATCH v2 05/45] ARM: at91: pm: add support for sam9x7 SoC family Date: Sat, 24 Jun 2023 02:00:16 +0530 Message-ID: <20230623203056.689705-6-varshini.rajendran@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230623203056.689705-1-varshini.rajendran@microchip.com> References: <20230623203056.689705-1-varshini.rajendran@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Add support and pm init config for sam9x7 SoC. Signed-off-by: Varshini Rajendran --- arch/arm/mach-at91/generic.h | 2 ++ arch/arm/mach-at91/pm.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h index 0c3960a8b3eb..acf0b3c82a30 100644 --- a/arch/arm/mach-at91/generic.h +++ b/arch/arm/mach-at91/generic.h @@ -12,6 +12,7 @@ extern void __init at91rm9200_pm_init(void); extern void __init at91sam9_pm_init(void); extern void __init sam9x60_pm_init(void); +extern void __init sam9x7_pm_init(void); extern void __init sama5_pm_init(void); extern void __init sama5d2_pm_init(void); extern void __init sama7_pm_init(void); @@ -19,6 +20,7 @@ extern void __init sama7_pm_init(void); static inline void __init at91rm9200_pm_init(void) { } static inline void __init at91sam9_pm_init(void) { } static inline void __init sam9x60_pm_init(void) { } +static inline void __init sam9x7_pm_init(void) { } static inline void __init sama5_pm_init(void) { } static inline void __init sama5d2_pm_init(void) { } static inline void __init sama7_pm_init(void) { } diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c index 60dc56d8acfb..43a77ae0c38c 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c @@ -232,6 +232,17 @@ static const struct of_device_id sama7g5_ws_ids[] = { { /* sentinel */ } }; +static const struct of_device_id sam9x7_ws_ids[] = { + { .compatible = "microchip,sam9x60-rtc", .data = &ws_info[1] }, + { .compatible = "atmel,at91rm9200-ohci", .data = &ws_info[2] }, + { .compatible = "usb-ohci", .data = &ws_info[2] }, + { .compatible = "atmel,at91sam9g45-ehci", .data = &ws_info[2] }, + { .compatible = "usb-ehci", .data = &ws_info[2] }, + { .compatible = "microchip,sam9x60-rtt", .data = &ws_info[4] }, + { .compatible = "microchip,sam9x7-gem", .data = &ws_info[5] }, + { /* sentinel */ } +}; + static int at91_pm_config_ws(unsigned int pm_mode, bool set) { const struct wakeup_source_info *wsi; @@ -1133,6 +1144,7 @@ static const struct of_device_id gmac_ids[] __initconst = { { .compatible = "atmel,sama5d2-gem" }, { .compatible = "atmel,sama5d29-gem" }, { .compatible = "microchip,sama7g5-gem" }, + { .compatible = "microchip,sam9x7-gem" }, { }, }; @@ -1360,6 +1372,7 @@ static const struct of_device_id atmel_pmc_ids[] __initconst = { { .compatible = "atmel,sama5d2-pmc", .data = &pmc_infos[1] }, { .compatible = "microchip,sam9x60-pmc", .data = &pmc_infos[4] }, { .compatible = "microchip,sama7g5-pmc", .data = &pmc_infos[5] }, + { .compatible = "microchip,sam9x7-pmc", .data = &pmc_infos[4] }, { /* sentinel */ }, }; @@ -1497,6 +1510,28 @@ void __init sam9x60_pm_init(void) soc_pm.config_pmc_ws = at91_sam9x60_config_pmc_ws; } +void __init sam9x7_pm_init(void) +{ + static const int modes[] __initconst = { + AT91_PM_STANDBY, AT91_PM_ULP0, + }; + + int ret; + + if (!IS_ENABLED(CONFIG_SOC_SAM9X7)) + return; + + at91_pm_modes_validate(modes, ARRAY_SIZE(modes)); + ret = at91_dt_ramc(false); + if (ret) + return; + + at91_pm_init(NULL); + + soc_pm.ws_ids = sam9x7_ws_ids; + soc_pm.config_pmc_ws = at91_sam9x60_config_pmc_ws; +} + void __init at91sam9_pm_init(void) { int ret; -- 2.25.1