Received: by 2002:a05:7208:3188:b0:7e:5202:c8b4 with SMTP id r8csp990545rbd; Fri, 23 Feb 2024 09:33:01 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVCrJdblMvFZFWJ0f6Swag7wvz4+eMHernb/wyj5+Gp5fLU+/BzyDyIgI6VChji4CB8TbG+sbwjOgUywrmTq+jkiiyoFR/CT4QJafgIMw== X-Google-Smtp-Source: AGHT+IE6QhqW5GnNuEqAL9vTLu8yp+8eD3hVzZJcv7BzjDSk3HrK6XC9840LADo6ozKnFrwrXMuX X-Received: by 2002:a17:906:b2d1:b0:a3f:c7bd:d52b with SMTP id cf17-20020a170906b2d100b00a3fc7bdd52bmr285243ejb.65.1708709581566; Fri, 23 Feb 2024 09:33:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708709581; cv=pass; d=google.com; s=arc-20160816; b=GG7dj4tYk6DxDwLVCKbjwcRWqokQD5MqbBR16vDZPRX/ReZucrC8bo4a+tl6tmS3am ORmAO4hvi4N3clOVSuT9G5LGAtKQBPtHcI90DizDAum/m0QvTmKu7Hxz5S+KAjndE3vz bBigwY21GRyXQh2UOpMvwgqKzVt2x1FCJWfl5MqvCIYNqXwzyraQIqZmXtmG2VllqZvF D4vm+6vmXUcTqBCPaeeVVKRa1exJC4rbmG3c3ZmyefkHi86E5+1M335W2XRfHD+ktaI2 joJYcExwmmHQZXsZaspZ1fCGzZlnx37agD0HHj/1N2nMVH0N0AM1tPPnWLkWGIJjkfY0 21dw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=JZ11T7xhsyyW6tze+iQIRcT2RAe5djmR+Rwan9YlnzA=; fh=2Cm8Id6fAmXHzJnPhIJkt6oDbq5aI4DP8RPEyJyozkc=; b=PS96CzNcKCdeT7HqXW844ISMZztMt+oyfPhohN4qyXMiGZzdqa0Wjr8rFozoz5bg3p nE4g9EzBx0wNnHXrkvAqgL2lBqnNzNaGMjpbL8lEOMLpq/W4Pt8Vcd18O06oAszljocD FEFrZf0lyDOnnOSI1j2waq1OsSdMMZRq57crPDgmoQ60ZiT8zSSNRaPS4WuoD/9d3mVn F5/B5yRQCDaa6LEv2Ztn7mSB9+Up4TLbiXBwwgP1vMXd3lZ1XWOYiSthDpxeU8iNGDsG 6FKrkjOgpJOgttVpRPFNPio9NdrBKeT4kaT3pGfOxLPaTeA9nuo8rWetnQpbrPmXW9gg xFIA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=aU60QDsl; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-78852-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78852-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gs34-20020a1709072d2200b00a3ec9d2cdf6si4553569ejc.897.2024.02.23.09.33.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 09:33:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78852-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=aU60QDsl; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-78852-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78852-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=microchip.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4E87B1F22F45 for ; Fri, 23 Feb 2024 17:33:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A7C65149380; Fri, 23 Feb 2024 17:27:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="aU60QDsl" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 65C2913DB98 for ; Fri, 23 Feb 2024 17:27:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708709236; cv=none; b=Ez1N3Z4Gv0yakR0bmucAeHNFtwu6FoMhQEK7Hex5x0w3kHrGiqqJ2sYgfk/vMjd6SBh+aho6XwULCvFOsRn9ZzdtzrJaMeeHIIYKAwv78hZrJk63VKl9IgLGpCIYvGkuen+C+AZAEGAoRvcJlNBfoe+SJhWFF5JRLYyRG2ItJ60= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708709236; c=relaxed/simple; bh=vvJunj56YSppCZwvuGVYQ/lD0VzVIdWbYqO/n682iDg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=p936Jg1SdZtxn0x4TiqJNROsADUVUNxKRaam7j5P/oAz++kqhjWzdWy2wa1l9Zo+lvM+5LYJVeramJqqjMULITgR+HuQQssIuauJ2trcXEBPjig9JreYiQYKGQT3Yss5I/tbvRjaHyINHFQYxrcOyNncB5Of9hhu4wxFOU/9Qek= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=aU60QDsl; arc=none smtp.client-ip=68.232.153.233 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1708709235; x=1740245235; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vvJunj56YSppCZwvuGVYQ/lD0VzVIdWbYqO/n682iDg=; b=aU60QDslGfDAICmh1NTYkD2Z1wUYK489Sy1Y7VA62KPSPkuwzLZ/xlyn I/iWUwPesuJOfdZuy9i2ZHIcnC6yM9DIvR494l5K+tjkGmEARE5P2UFFB ZyK4EMtgh/bXvLYtJTwkmOXnJIFXaE36f62zxmHvwI19+6KPj/9FXr+44 gBDW/yI2Y/PkJjaXh2aZGX5BqRPpjTp8zqqtOwKYhogQh8xsc0HV4RBDf lx3F+Lkg9BxOQHEMXiN3TPyl1eC3CRdDiau6vQde+g+W1yVHPsTrQzho6 eHKGUW3AkWGyHWkbungymKeFFL12pqReppATmGwyXCbwH3giFlhFUYukg A==; X-CSE-ConnectionGUID: WGdUDJySTO6s5AHkHy7fsA== X-CSE-MsgGUID: gWYSPU5eRWi9MtFedH5gFw== X-IronPort-AV: E=Sophos;i="6.06,180,1705388400"; d="scan'208";a="18276165" 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/ECDHE-RSA-AES128-GCM-SHA256; 23 Feb 2024 10:27:14 -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.2507.35; Fri, 23 Feb 2024 10:27:12 -0700 Received: from che-lt-i67070.microchip.com (10.10.85.11) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Fri, 23 Feb 2024 10:27:09 -0700 From: Varshini Rajendran To: , , , , , CC: , Claudiu Beznea Subject: [PATCH v4 18/39] ARM: at91: pm: add support for sam9x7 SoC family Date: Fri, 23 Feb 2024 22:57:05 +0530 Message-ID: <20240223172705.672488-1-varshini.rajendran@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240223171342.669133-1-varshini.rajendran@microchip.com> References: <20240223171342.669133-1-varshini.rajendran@microchip.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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 345b91dc6627..b81556387aa3 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c @@ -233,6 +233,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; @@ -1135,6 +1146,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" }, { }, }; @@ -1362,6 +1374,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 */ }, }; @@ -1499,6 +1512,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