Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5189815pxv; Wed, 28 Jul 2021 05:27:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBIIBWa4MjXEobQO1nSLsM7X40OEnQkA70G+QAoy1TprvpSsc51PrHXnEhbTGKJinbCvyN X-Received: by 2002:a05:6e02:1154:: with SMTP id o20mr20375177ill.168.1627475261216; Wed, 28 Jul 2021 05:27:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627475261; cv=none; d=google.com; s=arc-20160816; b=E9s0mqwGD7hPSNrDFUdhm1lJQvcX+0KHIM4QunOJQdp1GAVELskDyUQn7rLZv+Ndxk ZESBfhrcgMSi2ZY7fn922bgocxAEXTCh6ZvjE1F7eb4Mq7ZYnSP490h/k663MelApmKs ndWtWX/OKfcreSbIF4f7N5QsLr83griWvI22Z/mfo7D9KaalysVV0q+G/aJLsT3smkgn 97bR1XfnX5zLDFJELZV9Mln1E++1GqgMm+T5j823P7FyEeqA6k8p7S0BNaZMQ4/QF58r 7z6Ni/vfabbelb3Lsb6526aCeqrpmb7T26xvdbLzQSrkOLA0rmAbHwf9oAmyiPcaQyBx uJ+g== 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=4fH6A/BcmiXnSJNIz36CupSiUjhhUBPUWUzzeHlruOE=; b=UhV0Ox8Yyj8qgFtGEEsxyB+ejYQ1WforCcoKn5ygR4zPUshQ3WyQ6HFY+FxJ/16FCt JtL3C1O2FXubZK3PcSmh45/YV1IwEx/OHVkXWKRPG9ZKJBn7p8jT5X4I6IH6VJg7yRrb IJLOZkhkielZSLF0G412ndPuu01X2m36dIJvOe3Ndadb36FA8l5rOU6ia7YGBIl7TpZb O0DPzKiUeYH0JOFWDucq7sm3g67yDDBypN0puqP/tFEvesPaVIyjauydp47gGvMhx9FF yUMoi6BPk29kOR4brMk6k6uZ9vfc+O8T8tlsOmKjQrR011eV3eURHmveROWHNaZAgJef mG7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JSpRYJD3; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t4si6521093iln.104.2021.07.28.05.27.29; Wed, 28 Jul 2021 05:27:41 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JSpRYJD3; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236282AbhG1M0c (ORCPT + 99 others); Wed, 28 Jul 2021 08:26:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235193AbhG1M0Z (ORCPT ); Wed, 28 Jul 2021 08:26:25 -0400 Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD6F8C061757; Wed, 28 Jul 2021 05:26:23 -0700 (PDT) Received: by mail-qv1-xf2d.google.com with SMTP id m12so763970qvt.1; Wed, 28 Jul 2021 05:26:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4fH6A/BcmiXnSJNIz36CupSiUjhhUBPUWUzzeHlruOE=; b=JSpRYJD3Xeg1OyyvcOBaRRAySh9dHFQ+LDF8TSLOCuQCkUAdVhut5t7Irx/fbJsdmf t8zJHrKzFbEPZqAYwX2oTFXMnBCi11S/SVlNZxqXSiGdCeBrSDMwvfEY6tMsG3mFvKOJ R00UIScGLqQU/50cCqzaM4k0VvpA0c4aminIhDp+CRIXUgH8jdNSrJxrkV0vB6gGPMvy /+j8eJVer672MKIOt+6kjdfUB7TQqJkiJdWk4iy39B2yJiiun6nGENDwXSU/FPc1hSN7 2d9lvxvUijKClXt2jafEQ6bcR2uKmq//N/73J2kyOkK0QFXNah/EgybglOQ9wlb3y7zq kysQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4fH6A/BcmiXnSJNIz36CupSiUjhhUBPUWUzzeHlruOE=; b=iOyAHSsiZZSxLaB279fqrTaTDtXJIj6LSBEBPAyDYB/u6rlwcQ6Hg4uV1p8/Sxgfye vfGLPc45udANMsRVDw1xNrfirPnJFsQ1FDJFxyiOZhP7B1p9dHZTmMupxRQgL8bU0yQ6 4vT7IikcdAv2N4p0xPt6G/o7qQO3BMHWsrUNxVO3ECXE4FFEL4xCFANJ2ppOsPY2DT7H D8gi+FqdOi5Gc3q7SQQ0qgrLbHSTrsjcBNj+gylcDfFdb7SydCvr/V3rITabMlGmBLKi d0Le/Xgvftl3MV6OJIDvTgiSrWu9d8AZQ1D8sa/FbS9uqDacVdafVYBHU6i//oBwEbau 71Bw== X-Gm-Message-State: AOAM530KuSV3DMAr+b8kY1/3ezNC3JUZlm1iIbtsWpRsbL3pWyFpbejr YPy6pj0qYnlynNRz3A6qdSw= X-Received: by 2002:a05:6214:1d2e:: with SMTP id f14mr1841834qvd.17.1627475182901; Wed, 28 Jul 2021 05:26:22 -0700 (PDT) Received: from master-laptop.sparksnet ([2601:153:980:85b1:b58:2ae8:d75f:660a]) by smtp.gmail.com with ESMTPSA id z9sm2842972qtn.54.2021.07.28.05.26.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jul 2021 05:26:22 -0700 (PDT) From: Peter Geis To: Rob Herring , Heiko Stuebner , Kishon Vijay Abraham I , Vinod Koul Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, Peter Geis Subject: [RFC PATCH 7/9] phy: phy-rockchip-inno-usb2: add rk3568 support Date: Wed, 28 Jul 2021 08:26:04 -0400 Message-Id: <20210728122606.697619-8-pgwipeout@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210728122606.697619-1-pgwipeout@gmail.com> References: <20210728122606.697619-1-pgwipeout@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The rk3568 usb2phy is a standalone device with a single muxed interrupt. Add support for the registers to the usb2phy driver. Signed-off-by: Peter Geis --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index fdeb2e7c937a..74420c439a07 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -1100,6 +1100,7 @@ static int rockchip_usb2phy_otg_port_init(struct rockchip_usb2phy *rphy, if (ret) { dev_err(rphy->dev, "failed to init irq for host port\n"); goto out; + } if (!IS_ERR(rphy->edev)) { rport->event_nb.notifier_call = rockchip_otg_event; @@ -1509,6 +1510,69 @@ static const struct rockchip_usb2phy_cfg rk3399_phy_cfgs[] = { { /* sentinel */ } }; +static const struct rockchip_usb2phy_cfg rk3568_phy_cfgs[] = { + { + .reg = 0xfe8a0000, + .num_ports = 2, + .clkout_ctl = { 0x0008, 4, 4, 1, 0 }, + .port_cfgs = { + [USB2PHY_PORT_OTG] = { + .phy_sus = { 0x0000, 8, 0, 0, 0x1d1 }, + .bvalid_det_en = { 0x0080, 2, 2, 0, 1 }, + .bvalid_det_st = { 0x0084, 2, 2, 0, 1 }, + .bvalid_det_clr = { 0x0088, 2, 2, 0, 1 }, + .utmi_avalid = { 0x00c0, 10, 10, 0, 1 }, + .utmi_bvalid = { 0x00c0, 9, 9, 0, 1 }, + }, + [USB2PHY_PORT_HOST] = { + /* Select suspend control from controller */ + .phy_sus = { 0x0004, 8, 0, 0x1d2, 0x1d2 }, + .ls_det_en = { 0x0080, 1, 1, 0, 1 }, + .ls_det_st = { 0x0084, 1, 1, 0, 1 }, + .ls_det_clr = { 0x0088, 1, 1, 0, 1 }, + .utmi_ls = { 0x00c0, 17, 16, 0, 1 }, + .utmi_hstdet = { 0x00c0, 19, 19, 0, 1 } + } + }, + .chg_det = { + .opmode = { 0x0000, 3, 0, 5, 1 }, + .cp_det = { 0x00c0, 24, 24, 0, 1 }, + .dcp_det = { 0x00c0, 23, 23, 0, 1 }, + .dp_det = { 0x00c0, 25, 25, 0, 1 }, + .idm_sink_en = { 0x0008, 8, 8, 0, 1 }, + .idp_sink_en = { 0x0008, 7, 7, 0, 1 }, + .idp_src_en = { 0x0008, 9, 9, 0, 1 }, + .rdm_pdwn_en = { 0x0008, 10, 10, 0, 1 }, + .vdm_src_en = { 0x0008, 12, 12, 0, 1 }, + .vdp_src_en = { 0x0008, 11, 11, 0, 1 }, + }, + }, + { + .reg = 0xfe8b0000, + .num_ports = 2, + .clkout_ctl = { 0x0008, 4, 4, 1, 0 }, + .port_cfgs = { + [USB2PHY_PORT_OTG] = { + .phy_sus = { 0x0000, 8, 0, 0x1d2, 0x1d1 }, + .ls_det_en = { 0x0080, 0, 0, 0, 1 }, + .ls_det_st = { 0x0084, 0, 0, 0, 1 }, + .ls_det_clr = { 0x0088, 0, 0, 0, 1 }, + .utmi_ls = { 0x00c0, 5, 4, 0, 1 }, + .utmi_hstdet = { 0x00c0, 7, 7, 0, 1 } + }, + [USB2PHY_PORT_HOST] = { + .phy_sus = { 0x0004, 8, 0, 0x1d2, 0x1d1 }, + .ls_det_en = { 0x0080, 1, 1, 0, 1 }, + .ls_det_st = { 0x0084, 1, 1, 0, 1 }, + .ls_det_clr = { 0x0088, 1, 1, 0, 1 }, + .utmi_ls = { 0x00c0, 17, 16, 0, 1 }, + .utmi_hstdet = { 0x00c0, 19, 19, 0, 1 } + } + }, + }, + { /* sentinel */ } +}; + static const struct rockchip_usb2phy_cfg rv1108_phy_cfgs[] = { { .reg = 0x100, @@ -1558,6 +1622,7 @@ static const struct of_device_id rockchip_usb2phy_dt_match[] = { { .compatible = "rockchip,rk3328-usb2phy", .data = &rk3328_phy_cfgs }, { .compatible = "rockchip,rk3366-usb2phy", .data = &rk3366_phy_cfgs }, { .compatible = "rockchip,rk3399-usb2phy", .data = &rk3399_phy_cfgs }, + { .compatible = "rockchip,rk3568-usb2phy", .data = &rk3568_phy_cfgs }, { .compatible = "rockchip,rv1108-usb2phy", .data = &rv1108_phy_cfgs }, {} }; -- 2.25.1