Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2530280rwo; Thu, 3 Aug 2023 10:40:19 -0700 (PDT) X-Google-Smtp-Source: APBJJlFSRDSd/rhh5x1uwtGNeUGNMHUYz4aEjDGteRdubnvCRh6HHjX9tdpHR/Vr6CwX6EO8Xe9+ X-Received: by 2002:a05:6402:333:b0:522:29d3:4185 with SMTP id q19-20020a056402033300b0052229d34185mr8662219edw.32.1691084418937; Thu, 03 Aug 2023 10:40:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691084418; cv=none; d=google.com; s=arc-20160816; b=IcPn8I62QWyLy51P2rehVBSeaIwHOH+dkod3HY/JOvEhSt1hfENNR5Uyq2/dFnrKH+ nH3VL67RUDbxpE+diJs4a6FPeMv6TkPLPZolLjzkEtwzEKH/U5NSNETBd/8WbJKttBYN ZEDw9k2Afcz7/wbyOXSOZsaiESJd9sbbFMHcQ2JmeGhJhsnF1kcM7PPCXOOlzgVqU024 tvke1VhCOyu4CE884xOm1xcZoKSWZRjceDojgeE92rXNuKtZjM+c7i8ea0pgfKBwQj47 K0Jqwf2vvNVVmB8UjOO1nDDxnn9sHn+aubskDGddoXM2nAx+REJ12MrScEyoObBGQHTD ULRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=ap9tKouw072YkIwIE1OUhTE7tz2wKEeSEURmBKG1QQc=; fh=R6lL7HVr/xr66JEN9gBWoACCUGjW22l9pXSyxwjKCAE=; b=K+SJSjoOx2O7p2O40L1bW+UApvyhVob0bzmgSo8xY2+fwRqZ/H78k9HhHGkbyF6U2s cMPTPdatteOYYqmfIb2Bdf7TrNUNnr9H6R6SAx9e1taz8g8XICf/rWIAk3N6hj7F2RPc u8FKK3uoCfpmdjz12+Vjvgif88UjHvLazLYY2Vls3y/K+VmDfR2GwO4OD4wadQM8kGeS poh+XN5iMUKdKNjdgegPeEzA3wS0TYOwl8EIZBGk++jAlBHdVF8IChg0oP3Q+itffW6E Uc1YbnS4VxeL0ahQj4dAWgfGRt//f2lIoFY+6v0m17mxAeVfazLyh9lNFeLGZofx7g50 KQ6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Sle5TNoq; 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=NONE dis=NONE) header.from=ti.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w24-20020a056402129800b005230d9f5650si136461edv.46.2023.08.03.10.39.54; Thu, 03 Aug 2023 10:40:18 -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=@ti.com header.s=ti-com-17Q1 header.b=Sle5TNoq; 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=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235803AbjHCP5r (ORCPT + 99 others); Thu, 3 Aug 2023 11:57:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235687AbjHCP5p (ORCPT ); Thu, 3 Aug 2023 11:57:45 -0400 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE8A211F; Thu, 3 Aug 2023 08:57:43 -0700 (PDT) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 373Fvaa6079791; Thu, 3 Aug 2023 10:57:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1691078256; bh=ap9tKouw072YkIwIE1OUhTE7tz2wKEeSEURmBKG1QQc=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=Sle5TNoqJlPMEECyl3wVffUDjOuJYimYpvGTFuj9JwJMD+jLLzJubzKJExGD62yFs 3D7neFqK8quSne5q+eTGlHnC4sTawI+hHrV+mfuF9Et/00o+ScXLHb/4Ana75h2S2F a7ZzNiP735J9t3ChzY36JLOZlnAHk4WDhq0c1bgU= Received: from DLEE100.ent.ti.com (dlee100.ent.ti.com [157.170.170.30]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 373FvaQ2111483 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 3 Aug 2023 10:57:36 -0500 Received: from DLEE106.ent.ti.com (157.170.170.36) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 3 Aug 2023 10:57:35 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Thu, 3 Aug 2023 10:57:36 -0500 Received: from [10.250.36.243] (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 373FvZWK025943; Thu, 3 Aug 2023 10:57:35 -0500 Message-ID: <4019ef37-1c3d-ae2c-3006-17487e69f077@ti.com> Date: Thu, 3 Aug 2023 10:57:34 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH V6 1/4] firmware: ti_sci: Introduce Power Management Ops Content-Language: en-US To: Dhruva Gole CC: Nishanth Menon , Tero Kristo , "Santosh Shilimkar" , , , , Viresh Kumar , Praneeth Bajjuri , Tony Lindgren , Dave Gerlach , Vibhore Vardhan , Georgi Vlaev , Roger Quadros References: <20230803064247.503036-1-d-gole@ti.com> <20230803064247.503036-2-d-gole@ti.com> <930ffb16-f212-0bcb-4713-2acc138c4035@ti.com> <20230803154204.iyohslrpma7bqqpk@dhruva> From: Andrew Davis In-Reply-To: <20230803154204.iyohslrpma7bqqpk@dhruva> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 On 8/3/23 10:42 AM, Dhruva Gole wrote: > On Aug 03, 2023 at 10:14:03 -0500, Andrew Davis wrote: > [..snip..] >>> #define TI_SCI_IRQ_SECONDARY_HOST_INVALID 0xff >>> /** >>> diff --git a/include/linux/soc/ti/ti_sci_protocol.h b/include/linux/soc/ti/ti_sci_protocol.h >>> index bd0d11af76c5..f2d1d74ab8fc 100644 >>> --- a/include/linux/soc/ti/ti_sci_protocol.h >>> +++ b/include/linux/soc/ti/ti_sci_protocol.h >>> @@ -195,6 +195,49 @@ struct ti_sci_clk_ops { >>> u64 *current_freq); >>> }; >>> +/* TISCI LPM wake up sources */ >>> +#define TISCI_MSG_VALUE_LPM_WAKE_SOURCE_WKUP_I2C0 0x00 >>> +#define TISCI_MSG_VALUE_LPM_WAKE_SOURCE_WKUP_UART0 0x10 >>> +#define TISCI_MSG_VALUE_LPM_WAKE_SOURCE_MCU_GPIO0 0x20 >>> +#define TISCI_MSG_VALUE_LPM_WAKE_SOURCE_WKUP_ICEMELTER0 0x30 >>> +#define TISCI_MSG_VALUE_LPM_WAKE_SOURCE_WKUP_TIMER0 0x40 >>> +#define TISCI_MSG_VALUE_LPM_WAKE_SOURCE_WKUP_TIMER1 0x41 >>> +#define TISCI_MSG_VALUE_LPM_WAKE_SOURCE_WKUP_RTC0 0x50 >>> +#define TISCI_MSG_VALUE_LPM_WAKE_SOURCE_RESET 0x60 >>> +#define TISCI_MSG_VALUE_LPM_WAKE_SOURCE_USB0 0x70 >>> +#define TISCI_MSG_VALUE_LPM_WAKE_SOURCE_USB1 0x71 >>> +#define TISCI_MSG_VALUE_LPM_WAKE_SOURCE_MAIN_IO 0x80 >>> +#define TISCI_MSG_VALUE_LPM_WAKE_SOURCE_MCU_IO 0x81 >>> +#define TISCI_MSG_VALUE_LPM_WAKE_SOURCE_CAN_IO 0x82 >>> +#define TISCI_MSG_VALUE_LPM_WAKE_SOURCE_INVALID 0xFF >> >> I don't see these used in this series, do you need them? lpm_wake_reason() > > True, we are not currently using these macros. They _maybe required in > future. > I can remove them if required? > >> doesn't seem used either and I'm not sure how you plan to use it, could >> you detail that? > > When the system wakes from suspend-to-mem we can check which > subsystem has woken us up with the TISCI LPM_WAKEUP_REASON message. > There's no hardware event generated and we have to ask the firmware > for the actual wake reason. > > We may want to add support for a wake up interrupt controller that will > generate an interrupt for other subsystems. This might end up using this > lpm_wake_reason API, hence even though the function maybe unused today > it will be required for above described scenario. > > However if you prefer that I remove it and then add it in future when we > finally write a working interrupt controller driver, then do let me > know. > It's easier to review code that is used. We may go with a completely different approach by then, will be easier to unwind this if you don't start with it, only add it when used. Andrew >> >> Andrew >> >>> + >>> +/* TISCI LPM IO isolation control values */ >>> +#define TISCI_MSG_VALUE_IO_ENABLE 1 >>> +#define TISCI_MSG_VALUE_IO_DISABLE 0 >>> + > [..snip..] >