Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2578783pxb; Tue, 21 Sep 2021 03:04:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw72zdR3Ob6+jz6w67dh/FDTkMslP4+qfBbWZysdHwP7T95DVs/X9LxJUC4OLo+21yMGnWC X-Received: by 2002:a17:907:784b:: with SMTP id lb11mr34585950ejc.307.1632218699042; Tue, 21 Sep 2021 03:04:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632218699; cv=none; d=google.com; s=arc-20160816; b=jiRTG9JWVhaHP7c6XEP1zi/uXg4ZInc3cc40AYGN1kwecE9VuTBr9TW+bsT6didv5r 4Wax/h6dH80y2IBTow1+8Y4n1LgMPhoQO5q6ATrgYqwRrtQzS+4mMGMwZ3nNhW/V+AhA nDfhUHYMKUfE2mlrCLg9R7t+2W+FcuDbhD/RAZXCb+8n9lT4iHor7gjPk7K4cWYtnvgn OOyVZgBYDyVBWq3vqIPg25BTYz24B0rS+DONIp8BmRo5XzM4jwpVyFy/ytD/AFLMR76G q3qQ8DW4jYJ6QpaQGd00EYluAgzSEWCQtdAsBuLlMgKleHJo1Z56BOE3Fc+qEJyYhP5Q yV8g== 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; bh=8u64R9gH8LL4KyUHZoACoV3O2jt4A7K1bysRD5330Bo=; b=TSZ7JnU15GRPvvpp3Q89caCQ4GXGMu46FFlr/AopHqDmmkY9pJe5q7pXF7ObJW984l w1nf5XnvTsjFgkmQGF/UegklBivJWiMuYSn5ELkWMqHYN/q4t4850z1D0zger50x4z2E +F6a0raUAXilPtTPfKFZ0sej2VzHL1W/sL1etVK5Yzj6b+YU5GC6AGOOJ/M+2/jA9JGn NhRdcKncNRK2cBB3muS3FIWz1wTb5aysnWX90z9MMLggZUip90WqiR3GoHL/yIdjat9w IfE3H2HmQ23r72AvQ60XgLEV9GYmpPpjEZNUBLtE/S5AibbQSzzFTRgnULJXt5fVmduc qgqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu11si5455228ejb.202.2021.09.21.03.04.34; Tue, 21 Sep 2021 03:04:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231758AbhIUKD3 (ORCPT + 99 others); Tue, 21 Sep 2021 06:03:29 -0400 Received: from muru.com ([72.249.23.125]:35460 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231670AbhIUKDJ (ORCPT ); Tue, 21 Sep 2021 06:03:09 -0400 Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id D4CF38336; Tue, 21 Sep 2021 10:02:06 +0000 (UTC) From: Tony Lindgren To: linux-omap@vger.kernel.org Cc: Dave Gerlach , Faiz Abbas , Greg Kroah-Hartman , Grygorii Strashko , Keerthy , Kevin Hilman , Nishanth Menon , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 7/9] bus: ti-sysc: Handle otg force idle quirk Date: Tue, 21 Sep 2021 13:01:13 +0300 Message-Id: <20210921100115.59865-8-tony@atomide.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210921100115.59865-1-tony@atomide.com> References: <20210921100115.59865-1-tony@atomide.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Let's add handling the otg force idle quirk for the old omap2430 glue layer used up to omap4 as the musb driver quirk only works if the driver is loaded. Unlike with the am335x glue layer, looks like we don't need the quirk handling for SYSC_QUIRK_REINIT_ON_CTX_LOST. Eventually when all the musb using SoCs are booting with device tree based configuration, we can just remove the related quirk handling from the musb driver. Signed-off-by: Tony Lindgren --- drivers/bus/ti-sysc.c | 24 +++++++++++++++++++++++- include/linux/platform_data/ti-sysc.h | 1 + 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -1610,7 +1610,8 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = { SYSC_QUIRK("usb_host_hs", 0, 0, 0x10, -ENODEV, 0x50700101, 0xffffffff, SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY), SYSC_QUIRK("usb_otg_hs", 0, 0x400, 0x404, 0x408, 0x00000050, - 0xffffffff, SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY), + 0xffffffff, SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY | + SYSC_MODULE_QUIRK_OTG), SYSC_QUIRK("usb_otg_hs", 0, 0, 0x10, -ENODEV, 0x4ea2080d, 0xffffffff, SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY | SYSC_QUIRK_REINIT_ON_CTX_LOST), @@ -1969,6 +1970,22 @@ static void sysc_module_lock_quirk_rtc(struct sysc *ddata) sysc_quirk_rtc(ddata, true); } +/* OTG omap2430 glue layer up to omap4 needs OTG_FORCESTDBY configured */ +static void sysc_module_enable_quirk_otg(struct sysc *ddata) +{ + int offset = 0x414; /* OTG_FORCESTDBY */ + + sysc_write(ddata, offset, 0); +} + +static void sysc_module_disable_quirk_otg(struct sysc *ddata) +{ + int offset = 0x414; /* OTG_FORCESTDBY */ + u32 val = BIT(0); /* ENABLEFORCE */ + + sysc_write(ddata, offset, val); +} + /* 36xx SGX needs a quirk for to bypass OCP IPG interrupt logic */ static void sysc_module_enable_quirk_sgx(struct sysc *ddata) { @@ -2051,6 +2068,11 @@ static void sysc_init_module_quirks(struct sysc *ddata) return; } + if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_OTG) { + ddata->module_enable_quirk = sysc_module_enable_quirk_otg; + ddata->module_disable_quirk = sysc_module_disable_quirk_otg; + } + if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_SGX) ddata->module_enable_quirk = sysc_module_enable_quirk_sgx; diff --git a/include/linux/platform_data/ti-sysc.h b/include/linux/platform_data/ti-sysc.h --- a/include/linux/platform_data/ti-sysc.h +++ b/include/linux/platform_data/ti-sysc.h @@ -50,6 +50,7 @@ struct sysc_regbits { s8 emufree_shift; }; +#define SYSC_MODULE_QUIRK_OTG BIT(30) #define SYSC_QUIRK_RESET_ON_CTX_LOST BIT(29) #define SYSC_QUIRK_REINIT_ON_CTX_LOST BIT(28) #define SYSC_QUIRK_REINIT_ON_RESUME BIT(27) -- 2.33.0