From patchwork Fri Jul 28 10:28:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Varshini Rajendran X-Patchwork-Id: 127536 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp365948vqg; Fri, 28 Jul 2023 04:31:15 -0700 (PDT) X-Google-Smtp-Source: APBJJlEs+EQf6mkxRgKJ04BmKrUtSeF9vPZiUspa2IThpavWjfm4YAMbX1yBfT2RcCog3Z8pgWl5 X-Received: by 2002:a17:902:8f8b:b0:1b6:b445:36d4 with SMTP id z11-20020a1709028f8b00b001b6b44536d4mr909413plo.43.1690543874788; Fri, 28 Jul 2023 04:31:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690543874; cv=none; d=google.com; s=arc-20160816; b=qMfXhk0UhaTIypdRT8WePweiuQvv2apUFzIhyvofpGOEBC58k5Bg14N0/x/65OYlnF dayE/lutEzFLtSZCpSorh6EI7io32dp3fFniR/U4il7wMZCDS7sxO6vVPnCMAvAe39xx QyU2xULMU1meVeQ0aoglT0LSzOGUShyOuvyqpqaI9fw1PLFsMUZ67w1dZOcAJhuW/oJm fZWn6bfVv9IVShDGiMDDG12Wg0jjq1wSpxQEJm3lVDm9GmQu50VACr+2VA6ZaGNYBRgj /+p1ILpOZAUtl2H1E3Gke0tF9+lH5bP2TQUPePzqYppJ0E00dkSRQihNKizgCAoOsIDE 9GlA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=vfQj4W34p32fpKplbk8SCScCBCxlioIe0oZY7qd0UAI=; fh=WSzKNqLojcVl23JN2OirrokcvFofWNf682DO0OVLZ+0=; b=G9XsiiEi7a1Im5q1KQNAqlaOHQEhkzmxNoI5zt2TV/muhALJm+rgr+6lwn6fBl5mqx lZwF2DJWcdHmNwczdlyNq7G6GF4JYKHe79Zsef9jHbcqiqoxfHLR6QogblOLnhcLTYj/ aevltkoqokoO3pxG1pUb7uGdHrbml3XotkeazvLXKrBOna6C71lg59oue1kuxxqH5LFf HgGw/zqleCJSO7TDBO+BhPCDCi9X2977uEGgKiv6gaQjdw2+KNKkBU1dEF+GSgTdmpGZ 1mRhFIzKDvwFsW9GIlLUvxF+7pXAauFBJIDjMPwwmHQqpXlcVczj8mKAVpFO5q3Fiz/D E8IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=X88ShCrP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e2-20020a170902f10200b001b8a699d248si2786293plb.389.2023.07.28.04.30.59; Fri, 28 Jul 2023 04:31:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=X88ShCrP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 S234096AbjG1KcT (ORCPT + 99 others); Fri, 28 Jul 2023 06:32:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235433AbjG1Kbz (ORCPT ); Fri, 28 Jul 2023 06:31:55 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3578E5264 for ; Fri, 28 Jul 2023 03:30:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1690540210; x=1722076210; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=TjFhqTnBLmMPxvyy40FYkm5ofg7q8wLKisUlMVjtAnk=; b=X88ShCrP6sLqYbcoe9HY01FIkVFssFB9el77hbaBe7qb+arYGSdkPMhR c4IUCiv4g+QTRrC4SLItX80kmEKaQWBs6m1WLrY0S+riXeJCJHChYc+2y G5P0Pphj76rHVvYDQMvwdEpfIFfIm5Hgb7TxJFN6SeIG8zfH2/OwphWbY RKn2NeqFUdty+BrZmQ5J9zaeV4scgHwN3Allqp8XxaVwAH/K4a8sAU0ER X8dUN9eZJHFVQbC3xySUnyQcoh/nLB+e5/aqQsX8IK9z/aHrhbggYWITP E1iqVC07sYzIqNIiend8GZS2g5VBSVtDnHrHLr1xssVj2NY6kX8WwyT61 A==; X-IronPort-AV: E=Sophos;i="6.01,237,1684825200"; d="scan'208";a="163712795" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 28 Jul 2023 03:29:22 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) 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, 28 Jul 2023 03:28:57 -0700 Received: from che-lt-i67070.amer.actel.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.21 via Frontend Transport; Fri, 28 Jul 2023 03:28:54 -0700 From: Varshini Rajendran To: , , , , , CC: Subject: [PATCH v3 34/50] ARM: at91: pm: add support for sam9x7 SoC family Date: Fri, 28 Jul 2023 15:58:51 +0530 Message-ID: <20230728102851.267029-1-varshini.rajendran@microchip.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 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, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772663733909471404 X-GMAIL-MSGID: 1772663733909471404 Add support and pm init config for sam9x7 SoC. Signed-off-by: Varshini Rajendran Reviewed-by: Claudiu Beznea --- 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 437dd0352fd4..b2d62a63e37a 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; @@ -1131,6 +1142,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" }, { }, }; @@ -1358,6 +1370,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 */ }, }; @@ -1495,6 +1508,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;