From patchwork Fri Feb 17 11:58:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2721 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 5D1CB3F07F for ; Fri, 17 Feb 2023 12:59:14 +0100 (CET) Received: by mail-pf1-f197.google.com with SMTP id c6-20020a62e806000000b005a8ba9365c1sf204211pfi.18 for ; Fri, 17 Feb 2023 03:59:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1676635153; cv=pass; d=google.com; s=arc-20160816; b=DwBF91NZ7om79LGl14oPoo/kPSzSqcJAcuOTIvhM6lL5x1KJbjXWntSYbDgWfXm3da U3Mh01Q1a/QHQ+s0TE2P6N9egose05Gvdck4zWqn58BI4vu0O19myXaDrmEjfs5M9Uf7 gudaL+/6gx+r1Tm3nDrUjxyurb0gdcw9QNlpT14i7Wzu9qof5SZIlyT4OkTNwRUiEeTL zk5vOb6fhr3asHARLRX+yQz0LA9UPJFx4N6ihOZLjz0lh5OmH41jR54UbRuafEsaXpKo JOUr1iibhsPBsQ4QKidVcifuDmvVp0bcF8oWH/VLeh/OOOvlqrLHHRCeEzurYtGbqn6Z cIpQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=GZRMRFAKWeBZX2m6v3BufIA6Cl9U2MIk3RQoZV3/wd0=; b=BzqXraKCAl4wa8eLMPvNhMN9uD3+yYxHw+7JlBv8m+7rqL4DLwL12gFhHjQCYAXimK COqdtnX3ftBhBOvvFj0+K4ZCVYFNiPdjET26ZFzYkwxkcIWvGxUZQ+wWASDu0qay1KG/ WOMQFdokhE4YMDu9ZOHPZ8tEZV2rar1w/x7fmY6kGsdH9oF2ye49l1Qkqu4xrevPk3T/ KCLx6hjq10Ai722e8XaFuwwdC/DJoieo+1EHOB9164IlphtVQ74r1atuW0gczq/qFiBA MnCvRgkZ34hbCk0rKNMDJhnA0eCzo5Dk7xXFCVMgFuf/KFL8QOLoTq6GaIvztJKL1Bk4 lJzQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=hOf3UpMl; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=GZRMRFAKWeBZX2m6v3BufIA6Cl9U2MIk3RQoZV3/wd0=; b=OgBwyoE3Gn3HfXabocKOefvcpJntSJNcRE0E79uQkG7E5VXwe+NsYH75qIgCClkf6X Fpw2+pdcD/Ubw/+KYzIBrth/Ty0gSuPcWAQoH5kyLU8EN7rgFvdmmQob1bco55uK/dMQ gD38+wU7+RWGwVEdvTVE5Xm9J3un1QGotQATE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GZRMRFAKWeBZX2m6v3BufIA6Cl9U2MIk3RQoZV3/wd0=; b=yTqdeYVT3UiuRVi1INbBV7/NGpqohawAajB+7JTuyKdLoAKV9KnG4amIitAEjtTVjl +GOeb4MXZ99p+L/oowrWWKLbxIuTbNZNta7AsKmivohzQ6ENcfuE4TPlXp531WLvt9JW nS2fNV9TkF8GqBxusk6o3IsqAe3cDtwMuWkWpOUZeQe1J09NTIlIpUrqYjKeh2Dv2Vby M97g/W1A0ix+4xhiNZOmMiU/97Q+yjZiouJBKS5eHyp9Wj2EklinoFVB7cLC6+MLSKw8 Q3/wRaVJSB8HtXbno1I/VCYLrZPZDnkgb5ICJopLXff9ktNzpIQWo/X+GG79JpEtLXJq 42Ng== X-Gm-Message-State: AO0yUKUfkNfer3FIfTJyygOTSY01Pvo9wNw8dVuoXezgLfU3/uP7VIJk 98fZAB6rIDqpoaopi7Zv6lXRtyEy X-Google-Smtp-Source: AK7set88qao1zrfgUCiDFu+muy0bjsqUbmd5Vv9dOF2IzwWhLQP8iM8iqSZrGF/jAlJGGGtuDhpNXw== X-Received: by 2002:a05:6a00:98a:b0:5a8:5c7d:e4db with SMTP id u10-20020a056a00098a00b005a85c7de4dbmr413688pfg.3.1676635153121; Fri, 17 Feb 2023 03:59:13 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:e54a:b0:233:e65f:ffb9 with SMTP id ei10-20020a17090ae54a00b00233e65fffb9ls1457208pjb.3.-pod-canary-gmail; Fri, 17 Feb 2023 03:59:12 -0800 (PST) X-Received: by 2002:a17:902:ce82:b0:19a:59a5:e88e with SMTP id f2-20020a170902ce8200b0019a59a5e88emr10630368plg.59.1676635152235; Fri, 17 Feb 2023 03:59:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676635152; cv=none; d=google.com; s=arc-20160816; b=0G6WIaizk3vvDxDQHJlHlujn3WUaqh9DSrw0AeBlii6OprUNAk7bJngOOfIeoBCEYU qyKShm6EXoPUnvnjz0AJqKsFEaVZ4aIWvYohgXjnx2cog2GG1QfxzSuxMo6a2N6VGlj0 mKRMfETzU9lGUS3HDPyHoByWha6lZ9C+FD7ArKMvYJQeg5kaBci44vmYMbRYKMZKwS2f XytMB5dU7nBB9721HPlKJwijQUqrFUDrOxRD4XinwNd7ZVoqppXNLnUsK+zwyFMhGO5I 8Xk1DRqpQy5KOU1Zd+zaTc8BaDpsqTpP53/ihtZndAis117KZzP9n2MdtjggetjX6ccI 012A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Vrxbb/3kk6uouYGyo1ZvlY/hJbFYigXlDsHcgLMFg/k=; b=fuj/Pip4cE8LqahbqVF4DQFnmwKON8SP4xOzzEwrga5mMD455AGlehgcnG1KXMBfb6 cxzxFuAgTfShWDLPd2Kwzzs50JV2zUrsVzpFJhE0YWh848deFcH93wsCe0tRUnCQSEp1 T5SsjWXQv33qfAk5C051/6SOyPrmB4mW7aUBOcvfiTwYS8Q4x4SeRl/DRWDIMEztKq9B lauejVKAGRWrn1O3b+NJWoaA8zeh7ylB6pLufm4Hi6HrdGeNs/KSUEmgqr9rgach9kca NpNF+FSgxgmm49Ih5jeToeXdkE8JTMmqzmsoyMtEA6KNV1IjmKiwH3IKr6/gKzBJgkc4 dEWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=hOf3UpMl; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id jh19-20020a170903329300b0019ac7319ee7sor2260607plb.57.2023.02.17.03.59.12 for (Google Transport Security); Fri, 17 Feb 2023 03:59:12 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:902:ea0c:b0:199:2e77:fe56 with SMTP id s12-20020a170902ea0c00b001992e77fe56mr11911675plg.52.1676635151917; Fri, 17 Feb 2023 03:59:11 -0800 (PST) Received: from localhost.localdomain ([183.83.141.79]) by smtp.gmail.com with ESMTPSA id ik15-20020a170902ab0f00b001991d6c6c64sm2989418plb.185.2023.02.17.03.59.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 03:59:11 -0800 (PST) From: Jagan Teki To: Kever Yang , Philipp Tomsich , Simon Glass Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki , Manoj Sai Subject: [PATCH v4 06/12] phy: rockchip: inno-usb2: Add support #address_cells = 2 Date: Fri, 17 Feb 2023 17:28:39 +0530 Message-Id: <20230217115845.75303-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230217115845.75303-1-jagan@amarulasolutions.com> References: <20230217115845.75303-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=hOf3UpMl; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , New Rockchip devices have the usb phy nodes as standalone devices. These nodes have register nodes with #address_cells = 2, but only use 32 bit addresses. Adjust the driver to check if the returned address is "0", and adjust the index in that case. Derived and adjusted the similar change from linux-next with below commit <9c19c531dc98> ("phy: phy-rockchip-inno-usb2: support #address_cells = 2") Co-developed-by: Manoj Sai Signed-off-by: Manoj Sai Signed-off-by: Jagan Teki Reviewed-by: Kever Yang --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index b32a498ea7..a01148db22 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -179,12 +179,21 @@ static int rockchip_usb2phy_probe(struct udevice *dev) if (IS_ERR(priv->reg_base)) return PTR_ERR(priv->reg_base); - ret = ofnode_read_u32(dev_ofnode(dev), "reg", ®); + ret = ofnode_read_u32_index(dev_ofnode(dev), "reg", 0, ®); if (ret) { dev_err(dev, "failed to read reg property (ret = %d)\n", ret); return ret; } + /* support address_cells=2 */ + if (reg == 0) { + if (ofnode_read_u32_index(dev_ofnode(dev), "reg", 1, ®)) { + dev_err(dev, "%s must have reg[1]\n", + ofnode_get_name(dev_ofnode(dev))); + return -EINVAL; + } + } + phy_cfgs = (const struct rockchip_usb2phy_cfg *) dev_get_driver_data(dev); if (!phy_cfgs)