Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3840735rwd; Sat, 3 Jun 2023 13:09:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4cWvkim6+51pcyqnwA0j5cLYrPkUOKdjlTb4lXzd0yAl21aCEypwGxu7VwsuXQIZvRc3CF X-Received: by 2002:a92:d3c7:0:b0:33a:b647:1bcb with SMTP id c7-20020a92d3c7000000b0033ab6471bcbmr13383788ilh.20.1685822940407; Sat, 03 Jun 2023 13:09:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685822940; cv=none; d=google.com; s=arc-20160816; b=ECeGSTQtzVIoyHsZEMoW2j77PZBhiYFPNBrtVUty2QkxfJbknmIHOltDZfCoE4xsTp XyQsEGFt0VGVJaBhJZBEANrMn2y0tgX46uyUDlOE/cr0uPiC374LLh0WLi9XdFy/tr/q sJQQLjTtm1/iTZ7JWS9McXdXJ9vA+nLP8IOoib9sk7nOnElPOTbJPpwJFwu3AbYYHsrc lH2/cQR8suI4o6K7VgAOm4VBWsQb1fmFjmDrtUJ3FyKgJ3A5gkq7KpDj9m9vKIO2pEbU YfRfPeTLsyWuccXb3Ky29Er9kUtZudNizKwDP3XkKAI6YGc8puSpBptFEEfqLi0HeOHc l5ow== 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=LBdARS0C8REfXZ5McP4F5R6E3MoiUi2tEwTBx8iQDoI=; b=WOqZa257yxNFr9vn5sEvXe8WeiZDVHQqIELQ+vS+O0hexGe4cwBB0slSXAImUDI1Ca U6GRZL4nA2jsGoMnnyeam61weaRSq3OUYFeKbP+J6rHoWnlGI/W8SoGW/TjUR07kqruV s6xQjVotT5z8rkiKYU/ccw3OSWHkcKNOb9YxsPZ0LF3zRlp8fr8it6p8rTxK1hCpNdZf iTaw2MAqIVBRMgWicQd63/lEPtYCXsgExBF1bxSl1XsCIblN/gYIFRDyKafMSqGKXnPg 7xjOwGedZSuADeYDNSF0dInFvuIJEKEwSNEwrfqIgPj/XtUwDplwI09soE8E/fTr1jBe LifA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=DMTjxsYT; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v16-20020a63d550000000b0053084a794f0si2957398pgi.290.2023.06.03.13.08.46; Sat, 03 Jun 2023 13:09:00 -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=DMTjxsYT; 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 S229879AbjFCUFI (ORCPT + 99 others); Sat, 3 Jun 2023 16:05:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229936AbjFCUE7 (ORCPT ); Sat, 3 Jun 2023 16:04:59 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C2011A7; Sat, 3 Jun 2023 13:04:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1685822693; x=1717358693; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=n72Mi5CHYjTekZNhh3wgxCm6RCoAYvNuRArMlcfF45k=; b=DMTjxsYT3cq2rfh2PVMWJQUNUbN5WmKqyujCihjSp0J9JEIwP2wekoSt JcTn/npy9yVYfzJQOqbGGmo1Gmv3+x77XbFKckZCPYljS4HxVN4PT3e05 gf+U43wuoR3k6plcaUi5aQ4ooiqCgaOkOywtDT2ujdxaRasMyUIFLuzWK XrjB+Lz55PLX5HxPRPKBHDnvui8oTSkCS1ePnluOLxirslIn7pi0BWoVU KPUnCPnf8lhzvapzKuye3i43PlEjfCHbDZ2AEIMrpzH1FKGt30P5tmpBA pdN9WFXVQFPTir0hrem5dRrkMT6amLTRn3lpofB0p/uN5q7nTNRJF8guE A==; X-IronPort-AV: E=Sophos;i="6.00,216,1681196400"; d="scan'208";a="228307928" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 03 Jun 2023 13:04:52 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) 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.2507.21; Sat, 3 Jun 2023 13:04:51 -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; Sat, 3 Jun 2023 13:04:39 -0700 From: Varshini Rajendran To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , , , , , Subject: [PATCH 08/21] ARM: at91: pm: add support for sam9x7 soc family Date: Sun, 4 Jun 2023 01:32:30 +0530 Message-ID: <20230603200243.243878-9-varshini.rajendran@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230603200243.243878-1-varshini.rajendran@microchip.com> References: <20230603200243.243878-1-varshini.rajendran@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-4.6 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-kernel@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