From patchwork Thu Apr 14 19:12:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Drew Fustini X-Patchwork-Id: 12813934 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9A606C433F5 for ; Thu, 14 Apr 2022 19:16:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TSp0ezEOsSFnhg3j/4DnMPUMTylsW6PDRK376tJdP1E=; b=ifgHfC2ND6OEha MGu0tc1iX5wWkLsslZ5npLa2P7VdokXyvpKV/OxiS+cvKRE4rZvfU1LeqoDrvHzOx88rENmVMBKYo tITSlZn1tjKS68S0DiZEt6BF2d1n4mltJL1X9KtreryGG5+tVK5oKCBurBsObO7AAgzqgmk3ptUIg 4acDqSxTLMvro2PRA99MUMQmvliG9qUbxBhFvndbmxww/egllXNaxk9E+4g4wvOSoiSSFL1/G0p24 8OsGdop9LzGbNqsS595+W+CUB4etyqHfHUY+QmWkKP04UrFQATsEv84n2OMtvXJfi4C9pxqjFkrQp rEUoJorcYlut9gXdCPYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nf4vv-0070xK-Be; Thu, 14 Apr 2022 19:15:11 +0000 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nf4va-0070rf-G3 for linux-arm-kernel@lists.infradead.org; Thu, 14 Apr 2022 19:14:53 +0000 Received: by mail-pj1-x102c.google.com with SMTP id j8-20020a17090a060800b001cd4fb60dccso6588497pjj.2 for ; Thu, 14 Apr 2022 12:14:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sC6zeBvAQu12F4pHcyP2yBc/sNcvkHC/U+oaZNn0uLo=; b=uOPnNAUNUQ7jwwDqzHgu4WNfYdX+MgOjquYim4Yn6+bLjo/U9mt3hsGfQRcXEeWut5 nqL/4igPajYp6EQbXgUOKztmxoV53xEfPVMXWYvPWURmBhCKUM8owh4x++rNHcV0xiOM nzlpYQ/uQZcV0eSBfQC7/sUc+0yrIzADf5be71GbD9Asgna2j14fi/Rd0Bd90m1Xc2Be aezeNYzxz19ZnqxGMpbvRLSX+br0+p7fzY3zIHVdMqNIcDkCoqVBJIAHPDL5wUApbQxC yywvJYCxIPrqSjlUMp963ymQy0bLjWocfsTWrzrMJk0H+A8Yvw5aguyCpOWlQbeNiw0C VBgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sC6zeBvAQu12F4pHcyP2yBc/sNcvkHC/U+oaZNn0uLo=; b=xnulys/Wpb/iWXDG9AcM+xoStmXj6Kb2TjHCvB1R0tr+uPa6PVFrS01jANZhLcvFpy kkJYtUkTGUED8OKDQh4P2lfF50/wqdVDRfRYtKn0Xd8u/kfbqm9yhbCWY6X+JwjPYoKg xOFsVoQLg0Gzy0zWEDovKq9qFxJJ9R3ghagD5cYHR45Ih0U9wSrs5GTZjupiYsxQ7TDo 4ild7Vswn38is/1tRSui7LxBmz4x5vn85HiTf05SNkgTyYyvmtIf7ZwCNbF+hT88woQD +JFQ1eR0GW2sd8n+VL6tHp3HfWu23hqINzik9eNrJB6kUyypXwP0X4kaZNn9oKl3VMC5 ob5A== X-Gm-Message-State: AOAM532QXE+0KSUWi2KD4vKKToy8EZj7bUnil/kFfblksNcmjLcF6g14 fnvqnkrsgloY8kIk79uQOzG7+w== X-Google-Smtp-Source: ABdhPJyf50ZI8IugN/R07ThnGCCofq3wROK1WuuGeKtd9INnnt9Chq5pHi+VbR6o91yKZi9RNl/dvQ== X-Received: by 2002:a17:902:f68f:b0:158:4a47:5607 with SMTP id l15-20020a170902f68f00b001584a475607mr25312057plg.89.1649963689119; Thu, 14 Apr 2022 12:14:49 -0700 (PDT) Received: from x1.hsd1.or.comcast.net ([2601:1c2:1001:7090:5b60:6a76:138d:2646]) by smtp.gmail.com with ESMTPSA id e12-20020a056a001a8c00b004fab88d7de8sm614148pfv.132.2022.04.14.12.14.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Apr 2022 12:14:48 -0700 (PDT) From: Drew Fustini To: Rob Herring , Krzysztof Kozlowski , Nishanth Menon , Santosh Shilimkar , Dave Gerlach , Tony Lindgren Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Drew Fustini , Keerthy Subject: [PATCH v2 2/2] soc: ti: wkup_m3_ipc: Add support for IO Isolation Date: Thu, 14 Apr 2022 12:12:50 -0700 Message-Id: <20220414191250.2969282-3-dfustini@baylibre.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220414191250.2969282-1-dfustini@baylibre.com> References: <20220414191250.2969282-1-dfustini@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220414_121450_593546_EA71984E X-CRM114-Status: GOOD ( 19.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Dave Gerlach AM43xx support isolation of the IOs so that control is taken from the peripheral they are connected to and overridden by values present in the CTRL_CONF_* registers for the pad in the control module. The actual toggling happens from the wkup_m3, so use a DT property from the wkup_m3_ipc node to allow the PM code to communicate the necessity for placing the IOs into isolation to the firmware. Signed-off-by: Dave Gerlach Signed-off-by: Keerthy Signed-off-by: Drew Fustini --- No changes from v1 drivers/soc/ti/wkup_m3_ipc.c | 14 ++++++++++++-- include/linux/wkup_m3_ipc.h | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/soc/ti/wkup_m3_ipc.c b/drivers/soc/ti/wkup_m3_ipc.c index 247a4b57a372..988162dd153a 100644 --- a/drivers/soc/ti/wkup_m3_ipc.c +++ b/drivers/soc/ti/wkup_m3_ipc.c @@ -46,6 +46,8 @@ #define IPC_VTT_STAT_MASK (0x1 << 3) #define IPC_VTT_GPIO_PIN_SHIFT (0x4) #define IPC_VTT_GPIO_PIN_MASK (0x3f << 4) +#define IPC_IO_ISOLATION_STAT_SHIFT (10) +#define IPC_IO_ISOLATION_STAT_MASK (0x1 << 10) #define M3_STATE_UNKNOWN 0 #define M3_STATE_RESET 1 @@ -228,6 +230,11 @@ static void wkup_m3_set_vtt_gpio(struct wkup_m3_ipc *m3_ipc, int gpio) (gpio << IPC_VTT_GPIO_PIN_SHIFT); } +static void wkup_m3_set_io_isolation(struct wkup_m3_ipc *m3_ipc) +{ + m3_ipc->isolation_conf = (1 << IPC_IO_ISOLATION_STAT_SHIFT); +} + /* Public functions */ /** * wkup_m3_set_mem_type - Pass wkup_m3 which type of memory is in use @@ -308,8 +315,8 @@ static int wkup_m3_prepare_low_power(struct wkup_m3_ipc *m3_ipc, int state) wkup_m3_ctrl_ipc_write(m3_ipc, m3_ipc->resume_addr, 0); wkup_m3_ctrl_ipc_write(m3_ipc, m3_power_state, 1); wkup_m3_ctrl_ipc_write(m3_ipc, m3_ipc->mem_type | - m3_ipc->vtt_conf, 4); - + m3_ipc->vtt_conf | + m3_ipc->isolation_conf, 4); wkup_m3_ctrl_ipc_write(m3_ipc, DS_IPC_DEFAULT, 2); wkup_m3_ctrl_ipc_write(m3_ipc, DS_IPC_DEFAULT, 3); wkup_m3_ctrl_ipc_write(m3_ipc, DS_IPC_DEFAULT, 5); @@ -518,6 +525,9 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev) dev_warn(dev, "Invalid VTT GPIO(%d) pin\n", temp); } + if (of_find_property(np, "ti,set-io-isolation", NULL)) + wkup_m3_set_io_isolation(m3_ipc); + /* * Wait for firmware loading completion in a thread so we * can boot the wkup_m3 as soon as it's ready without holding diff --git a/include/linux/wkup_m3_ipc.h b/include/linux/wkup_m3_ipc.h index 2bc52c6381d5..b706eac58f92 100644 --- a/include/linux/wkup_m3_ipc.h +++ b/include/linux/wkup_m3_ipc.h @@ -34,6 +34,7 @@ struct wkup_m3_ipc { int mem_type; unsigned long resume_addr; int vtt_conf; + int isolation_conf; int state; struct completion sync_complete;