From patchwork Thu Feb 20 02:32:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1241123 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=aDSdt/yN; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48NJYD5dHhz9sRG for ; Thu, 20 Feb 2020 13:33:20 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4782C813C0; Thu, 20 Feb 2020 03:33:05 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="aDSdt/yN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D15C6813B1; Thu, 20 Feb 2020 03:32:51 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 24203812DE for ; Thu, 20 Feb 2020 03:32:44 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kever.yang@gmail.com Received: by mail-pg1-x541.google.com with SMTP id y30so1116669pga.13 for ; Wed, 19 Feb 2020 18:32:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=SwQfc5Pu9ZY0QeOv1Egl+YK7AAl3Kw7aLXblQ/DAX8I=; b=aDSdt/yNYXYuqcDwcv9qaUe/XhEUr25N0hcsISDq7TZ7aCnXSkwW0WMLR0G18PQ3y1 saoNoVE0QFiELlLyRcjn6TnUmIynUU3YllfOvJHyROhHGl+Wy95lXDNmBmwWx47SlERZ F4z2Y32zOIVVfCDYnaWIJnY+k83B1xAhz0jovRmnlHcJoGnbAPpRoRhf7vJYlRqLFCav P8B80OSnTHXgOmMZ/h6FelvP5AY9/08zOO3AEEs+mjt8dFK/OR3NgOHejc5XWV32b9+Y DmihnnIJUqoeMDugFrivu17ZtkVAb+zroiABXOZP78R9ZGX1FwvG4dumlj+iXZdV4z4q 63LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=SwQfc5Pu9ZY0QeOv1Egl+YK7AAl3Kw7aLXblQ/DAX8I=; b=ii+fMSLIwvwtD5BKDYRtKZhbMLW54omNiX4j05AaqSrSSnh/6+OzSVsZ66iUUtEN77 pzAvXIOBXFHH6RkxIsb6RS5UoORWi908ESVj6OUJYwDfB0aD/2jxb1YHBNY3uUvohOQ4 oPweW7OIsuGvCyz3up3zwJmRGc/XHaEwzJAgaXfpIzxAu6h2byBOhDWvVLpCNroh7tQn VJ0qDLrvd1rpRYO72dpvlaX9wZjxdN8ML/OFjh75vlrIUydE0SMMpPDs+xSw89Zm6omT fufRQyk3E5jmH4BYX0Pxm4M2tNCQoBucty3akFyydxk3PB214YsWRW+Qb3mLT2uAx0Td Zn3g== X-Gm-Message-State: APjAAAXqMtREItPc5d0l7lnwRGiraMvSGHOTMpl2CrXuAcUiAvIecrZe NxrNSiPjxpX8CpwLwX7z96HfHTZT X-Google-Smtp-Source: APXvYqwrvtxeJGTUsv1yabiNvkWs+3+H2ojTtACAI9j6UTJMOIqHfp0mmzdozR+BQ1sCOPsEYnkiOA== X-Received: by 2002:a63:4617:: with SMTP id t23mr30828715pga.444.1582165962381; Wed, 19 Feb 2020 18:32:42 -0800 (PST) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id w25sm952107pfi.106.2020.02.19.18.32.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 18:32:42 -0800 (PST) From: Kever Yang To: u-boot@lists.denx.de Cc: frank.wang@rock-chips.com, Kever Yang , Marek Vasut , Mark Kettenis Subject: [PATCH v2 1/9] usb: dwc3-of-simple: Drop redundant inclding header file Date: Thu, 20 Feb 2020 10:32:16 +0800 Message-Id: <20200220023224.32146-2-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200220023224.32146-1-kever.yang@rock-chips.com> References: <20200220023224.32146-1-kever.yang@rock-chips.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean The fdtdec.h is no use in this file, remove the include code. Signed-off-by: Kever Yang --- Changes in v2: None drivers/usb/host/dwc3-of-simple.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/host/dwc3-of-simple.c b/drivers/usb/host/dwc3-of-simple.c index 45df614b09..e4abc6f3b9 100644 --- a/drivers/usb/host/dwc3-of-simple.c +++ b/drivers/usb/host/dwc3-of-simple.c @@ -12,7 +12,6 @@ #include #include -#include #include #include From patchwork Thu Feb 20 02:32:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1241124 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=nEBhz/BT; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48NJYT745Xz9sRG for ; Thu, 20 Feb 2020 13:33:33 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A850881439; Thu, 20 Feb 2020 03:33:10 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="nEBhz/BT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1C324813CC; Thu, 20 Feb 2020 03:32:51 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F34AC813B1 for ; Thu, 20 Feb 2020 03:32:45 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kever.yang@gmail.com Received: by mail-pf1-x443.google.com with SMTP id b185so1117134pfb.7 for ; Wed, 19 Feb 2020 18:32:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=JmtWIDmbyQbC5PrQhz3zPgBa2NjNvni4IkIEPZ8EZLE=; b=nEBhz/BTu04QH09U6V/980Tev+gUdBEHtESXt9uFVstvyONxQM1ICXxNR8XicUGjbW HKF90pTb+EOHWcGp0/ICmxjM172/nfSTUMEiLwUd6v3NSksIgKhIV1sWXl7cXubLA3fn zbl0XMW7Ss9GrmsuuCA8FG9dO/l131qZBgzBnXTLhIUxIi2DgGAk9b44T8kVhvsAGmYj sYsCpOX35OG4Jtag5CS62t+STIr6d/23AA8EZHn501Nf88cuK9jZwWmQEsYVBmA8mLnK NaUmfnD4N5WQrq6oQ0oQq3nn/L2doIxUC2xpv4KmQ3NW966jJ+EX0vT0/Gw6d2airm/9 yC5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=JmtWIDmbyQbC5PrQhz3zPgBa2NjNvni4IkIEPZ8EZLE=; b=Gb7GfXZ98FUZNzCEEJc8PaF5bhttHs/CAm+G1fuPpjuM6tdB/+iDsbCptColNvsg4Y MeSphK6eUdMNbvjbjj1WjxIM6KfVgz/C3OLXx52g12rryTSWCKFW992q8fRBTJ6rjMiQ jWsnUzLf8KszKh/k5Nug40EfjsP4Ut4n79tjMGNuCRoDoQWJTf+ubxkwvz5LfYZiDmQS Wyws918NWSM/SyuUnPctmgONFk7bNTNzdZLAye8jVwwiVU5pWNRHTPXGl83TCEC+EEoe PIzzx79GlaOvJmUeUbPNxh4EUvyVeyPTcw8FQpbXuLceN5OTGyGah4eCfKq298+PuibI hceQ== X-Gm-Message-State: APjAAAVe9YzNVQSN3FWpeK+qzIK8ySx2UIp1q4Na9AykkQsgflC5kNGq 6RWm54VyCGjEPZkCWL5Q3LFQju+C X-Google-Smtp-Source: APXvYqw2JpdMGhFbit6Eau64v27K4cPy5LI8BR1kd13UJoFfHO6r4bcQuiRdGgkV1UKNqG+HdRkbAQ== X-Received: by 2002:a63:cf06:: with SMTP id j6mr12040065pgg.379.1582165964426; Wed, 19 Feb 2020 18:32:44 -0800 (PST) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id w25sm952107pfi.106.2020.02.19.18.32.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 18:32:44 -0800 (PST) From: Kever Yang To: u-boot@lists.denx.de Cc: frank.wang@rock-chips.com, Kever Yang , Marek Vasut , Ramon Fried Subject: [PATCH v2 2/9] usb: ehci-msm: Use dev interface to get device address Date: Thu, 20 Feb 2020 10:32:17 +0800 Message-Id: <20200220023224.32146-3-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200220023224.32146-1-kever.yang@rock-chips.com> References: <20200220023224.32146-1-kever.yang@rock-chips.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Use dev_read_addr_ptr() instead of devfdt_get_addr() so that we can support live DT. Signed-off-by: Kever Yang Reviewed-by: Ramon Fried --- Changes in v2: None drivers/usb/host/ehci-msm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c index 5c257ccf4d..dd92808ff7 100644 --- a/drivers/usb/host/ehci-msm.c +++ b/drivers/usb/host/ehci-msm.c @@ -10,8 +10,6 @@ #include #include #include -#include -#include #include #include #include @@ -108,7 +106,7 @@ static int ehci_usb_ofdata_to_platdata(struct udevice *dev) struct msm_ehci_priv *priv = dev_get_priv(dev); priv->ulpi_vp.port_num = 0; - priv->ehci = (void *)devfdt_get_addr(dev); + priv->ehci = dev_read_addr_ptr(dev); if (priv->ehci == (void *)FDT_ADDR_T_NONE) return -EINVAL; From patchwork Thu Feb 20 02:32:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1241125 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=dvmzoXRA; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48NJYk12ghz9sRs for ; Thu, 20 Feb 2020 13:33:46 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B56F7813D1; Thu, 20 Feb 2020 03:33:13 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dvmzoXRA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BDF2A813D1; Thu, 20 Feb 2020 03:32:54 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5C53D813B5 for ; Thu, 20 Feb 2020 03:32:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kever.yang@gmail.com Received: by mail-pf1-x441.google.com with SMTP id b185so1117165pfb.7 for ; Wed, 19 Feb 2020 18:32:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Za2VodO4GWGt9kDqUzO8rQgUsENHZWLdueMVavGjdfg=; b=dvmzoXRA4CzACg84SUUl0kJI4kUiqEkMalLy26jdyFUPxVkdS+6TMEk1ft8W9U9Jbz AHmV4IwHCAfsuZyLbJpWeTg8lSS7urrrMYXKyP6jmfUhJSKhjbUQdjkK929XTFTgNbRc R+pH66MxSqo7rtENk4RR+rS2ruc9+C6j9zwxYlgcs3c7WHeSZwS1RZH3PV47F2OnyGIb KjYejK94mCHNXzLuPDwh5IdO9Klh6xApsBWgfVbPBmjaitB0wWsO9PmR1zbesgEXOSLU 6bPSjMUWtQavEBiXJVAr72Q+GoKSMuCEmx2z1pcn+Fhyjb0pyCgw5h4mzHd3UjMeP8/p POUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Za2VodO4GWGt9kDqUzO8rQgUsENHZWLdueMVavGjdfg=; b=CGh85Z3LNzQC426jaBV4YA3cveKX36IwswVzy/zObnyWN0rJa0MY+YIcbCaA9BLJHS U1gVqyY7h5RGZpIEu/hwM4eF10BTbVoS1xwwQhtn6znC06R8rS81iblm7aKqxVtlxaca 2/YuAJP2yyqofDamwI05TXtld5NMxdr43Y06VT+0oO65XVPYAnvgfXPIpEnfHO6gPTEy jSIkcb5qyrN4z4aHUDOxzTSNmr9X9Z+nTQ0BmsFFt3cfYLLaqKlNN3aSGQFSTLvKJ46Q ZGFxA1drVkO5suXpjhpfdr7iFRFQjY3YNA/SiWnGT9AWz0AbyRiuzsvYmmNMMaPtSBuR 3eCw== X-Gm-Message-State: APjAAAWfB1zNex5GXgm85IpjYbvG2lwYYiwVq0jVokFWl+Mv9GjVHdrC fa696rxid0ZlmgdLxXy5nJpN2lfP X-Google-Smtp-Source: APXvYqzQ0AiD/rwxfy/YCc2TVBb5HOuOAf6JeU+bcSAVud4iAcWmgWk2/3WSuMIxFglxSgA1yYovOg== X-Received: by 2002:a63:de0d:: with SMTP id f13mr31816629pgg.12.1582165966811; Wed, 19 Feb 2020 18:32:46 -0800 (PST) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id w25sm952107pfi.106.2020.02.19.18.32.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 18:32:46 -0800 (PST) From: Kever Yang To: u-boot@lists.denx.de Cc: frank.wang@rock-chips.com, Kever Yang , Anatolij Gustschin , Jean-Jacques Hiblot , Marek Vasut , Simon Glass , Vignesh Raghavendra Subject: [PATCH v2 3/9] usb: cdns3: Migrate to use ofnode API for bind function Date: Thu, 20 Feb 2020 10:32:18 +0800 Message-Id: <20200220023224.32146-4-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200220023224.32146-1-kever.yang@rock-chips.com> References: <20200220023224.32146-1-kever.yang@rock-chips.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Use ofnode_ instead of fdt_ APIs so that the driver can support live DT. Signed-off-by: Kever Yang --- Changes in v2: None drivers/usb/cdns3/core.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c index f947e6983c..75c3d4f200 100644 --- a/drivers/usb/cdns3/core.c +++ b/drivers/usb/cdns3/core.c @@ -384,23 +384,21 @@ static const struct udevice_id cdns3_ids[] = { int cdns3_bind(struct udevice *parent) { - int from = dev_of_offset(parent); - const void *fdt = gd->fdt_blob; enum usb_dr_mode dr_mode; struct udevice *dev; const char *driver; const char *name; - int node; + ofnode node; int ret; - node = fdt_node_offset_by_compatible(fdt, from, "cdns,usb3"); - if (node < 0) { + node = ofnode_by_compatible(parent->node, "cdns,usb3"); + if (!ofnode_valid(node)) { ret = -ENODEV; goto fail; } - name = fdt_get_name(fdt, node, NULL); - dr_mode = usb_get_dr_mode(node); + name = ofnode_get_name(node); + dr_mode = usb_get_dr_mode(ofnode_to_offset(node)); switch (dr_mode) { #if defined(CONFIG_SPL_USB_HOST_SUPPORT) || \ @@ -422,8 +420,7 @@ int cdns3_bind(struct udevice *parent) goto fail; }; - ret = device_bind_driver_to_node(parent, driver, name, - offset_to_ofnode(node), &dev); + ret = device_bind_driver_to_node(parent, driver, name, node, &dev); if (ret) { printf("%s: not able to bind usb device mode\n", __func__); From patchwork Thu Feb 20 02:32:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1241126 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=loCKakYL; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48NJYx3nTgz9sRG for ; Thu, 20 Feb 2020 13:33:57 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 431DC813DA; Thu, 20 Feb 2020 03:33:16 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="loCKakYL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 943D4813C3; Thu, 20 Feb 2020 03:32:56 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id ACE2C813C2 for ; Thu, 20 Feb 2020 03:32:50 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kever.yang@gmail.com Received: by mail-pg1-x542.google.com with SMTP id y30so1116799pga.13 for ; Wed, 19 Feb 2020 18:32:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=3jlVQuOM7EgT9OiNblRA/5oJ9XFGv/gHGDsyrw8jwyI=; b=loCKakYLh370jxhs5gPGLbI66mSi9wzSA/0JnRJHxeQ/RrKDO4ARl/4ATu0onjwZMI W9HpQEz+/l0Gvm1f9qKurtJF2W8lK1uFy46To7rSDPJ+i8KVqNVd/+Gke+AZpF46w6B2 YtcVVNwa6VpneI4ki1ILqgDjrxoF+m9NBcH22RIcn9QlQpSwZNK/b+sHMLIz83cErXqr xrTfjBWLxJG808ycY8op3KbU9+EzsXvljlfj89yBB5uP+QfJvK4fg2HPHsE9nFHMGNFH h4svzQOfNx3MT0dCb1nkyqp7Ld0NsaQEsY2LnxT48ZZKSP5BcgwJ20XzA9OeVbLDZ7Gu 8QGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=3jlVQuOM7EgT9OiNblRA/5oJ9XFGv/gHGDsyrw8jwyI=; b=B9cogyGx4ddaIakzbtyxG5F8fnT/0q+cUEldD8xn6VBzapY3S7Gfmqejpg0UsSL1Yx 6Q5lYK+w7yxz0kSJ0NCg7fu8oXH7ZIV63noKvZPRH7Jj2EAOB37ENmdryJvjUXfwrmHc kfIoVR5aglHeCJoNwwU6tcjBzggMz1jakO+vREMadJh2mDhhoFo2pzdcaz0sSfdEe+co Knbp23J7AI0l9e4kmYMllTCNAYwq+6+eAD7AmeQOI/yOrpfqfvWR0GULztzJCP5gLLo6 53d0yJorWzO365f9tJVZTDvThworEORygDyGr5LKMZRxq3gIRimgSmVMKzCBYz7udnX9 28nA== X-Gm-Message-State: APjAAAV2OnnNH1QB5SsJEaoxOVKnecOuiUetO17z2p/BmzuDQ5YCM6ey PChKf1qM4luEegz4A/WvdkFAuQ/5 X-Google-Smtp-Source: APXvYqyOxl+JnNAFq26l/mlpOKnphm+euHEpcf6j6cQ39biZ5IyG0ZouKctjR3xK1zJ7kYORTQMNUQ== X-Received: by 2002:aa7:9304:: with SMTP id 4mr29760524pfj.76.1582165969035; Wed, 19 Feb 2020 18:32:49 -0800 (PST) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id w25sm952107pfi.106.2020.02.19.18.32.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 18:32:48 -0800 (PST) From: Kever Yang To: u-boot@lists.denx.de Cc: frank.wang@rock-chips.com, Kever Yang , Jean-Jacques Hiblot , Marek Vasut , Simon Glass , Vignesh Raghavendra Subject: [PATCH v2 4/9] usb: dwc3-generic: Migrate to use ofnode API for bind function Date: Thu, 20 Feb 2020 10:32:19 +0800 Message-Id: <20200220023224.32146-5-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200220023224.32146-1-kever.yang@rock-chips.com> References: <20200220023224.32146-1-kever.yang@rock-chips.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Use ofnode_ instead of fdt_ APIs so that the driver can support live DT. Signed-off-by: Kever Yang --- Changes in v2: None drivers/usb/dwc3/dwc3-generic.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c index 3e116b2c5c..820cc7075c 100644 --- a/drivers/usb/dwc3/dwc3-generic.c +++ b/drivers/usb/dwc3/dwc3-generic.c @@ -284,20 +284,18 @@ struct dwc3_glue_ops ti_ops = { static int dwc3_glue_bind(struct udevice *parent) { - const void *fdt = gd->fdt_blob; - int node; + ofnode node; int ret; - for (node = fdt_first_subnode(fdt, dev_of_offset(parent)); node > 0; - node = fdt_next_subnode(fdt, node)) { - const char *name = fdt_get_name(fdt, node, NULL); + ofnode_for_each_subnode(node, parent->node) { + const char *name = ofnode_get_name(node); enum usb_dr_mode dr_mode; struct udevice *dev; const char *driver = NULL; debug("%s: subnode name: %s\n", __func__, name); - dr_mode = usb_get_dr_mode(node); + dr_mode = usb_get_dr_mode(ofnode_to_offset(node)); switch (dr_mode) { case USB_DR_MODE_PERIPHERAL: @@ -322,7 +320,7 @@ static int dwc3_glue_bind(struct udevice *parent) continue; ret = device_bind_driver_to_node(parent, driver, name, - offset_to_ofnode(node), &dev); + node, &dev); if (ret) { debug("%s: not able to bind usb device mode\n", __func__); From patchwork Thu Feb 20 02:32:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1241128 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=HqWLYKBi; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48NJZN28kPz9sRG for ; Thu, 20 Feb 2020 13:34:20 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EC69B81536; Thu, 20 Feb 2020 03:33:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="HqWLYKBi"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DB67281439; Thu, 20 Feb 2020 03:32:59 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F201D812C4 for ; Thu, 20 Feb 2020 03:32:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kever.yang@gmail.com Received: by mail-pg1-x544.google.com with SMTP id g3so1119727pgs.11 for ; Wed, 19 Feb 2020 18:32:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=7x0JHeTL2qShStLr17WqIyPi6vs2Alu8GFLtVvklQ8A=; b=HqWLYKBiLzjihzLWOlJhb1Fe/Uaeg4ksNdaQohx+ODekpYnLpNpsHyhR4z4KP6XaJV TzTXzRgKQWbof+BT4pfwj25o8pmL7BHYh7MCSyiFE4sjBZ5VQnDEgPPLPHVCaEPpKpHS qTh0bKigCkfzqEoT3invc2ku15COWmvDHNLrWTSezWi/CvkCQ/M2FP8pNxVuY8h6s5SR P6jX6oVh6gwT3EIAmf6wO/g8PPd5Q+TUF7iByxPBdrHnX+r5gJYztajNwTq/5SIc8ctC 5tnQFaS5l+z8V8JW9d+R6526wzWE6lj02MhkRKd6CDkYh6hsB+6K48D7N3uLKBYpdw9W 0tsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=7x0JHeTL2qShStLr17WqIyPi6vs2Alu8GFLtVvklQ8A=; b=QAgl7YHiYsQ1btpGQe4Zn1jMV3aOku/SRHDsBC/v/k1HIXX4k/hZhCUa2Wv/Gswg56 BqCsNsFungl4hG9TqgcvM1TS7svr2CSPaimVvnG3KjjB2a/pmtzQbGD72puuxV0w0r46 Dl4X7GJ1V1rXmK0Y6bW70NOMAmLJwH6n+z+DkSHKZryRbiwmCzR/wMN91BAxQWmwkDD/ QVOyaey23/kt/zHXhWFKlnoo8lDqR0N2JGt6axGaUm2qoQqADx0VAOlFln2D3Nx8CFvm k9NifLZbR5Vh/kOLXKEdzlIyz0YAN+1rRYlfUGRm8zg01PZE0NETVNS2M7vAJ98c/Pz6 5yig== X-Gm-Message-State: APjAAAVOmK21bJS4QMkWYBhHehEnbYT+i0IZmXrKWVgSBNJDoZXicivX zej+me24D98AZpgS8Uup4xjHSNLQ X-Google-Smtp-Source: APXvYqxehibg52bAcBM9NQdu0hNMI5Y6GhP9FnvhCemijJ0axhcJUBSMaGXBJHOH19ZkfKiMkYLgLA== X-Received: by 2002:a63:af52:: with SMTP id s18mr31698664pgo.263.1582165971437; Wed, 19 Feb 2020 18:32:51 -0800 (PST) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id w25sm952107pfi.106.2020.02.19.18.32.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 18:32:51 -0800 (PST) From: Kever Yang To: u-boot@lists.denx.de Cc: frank.wang@rock-chips.com, Kever Yang , Jean-Jacques Hiblot , Marek Vasut , Neil Armstrong , Simon Glass , Vignesh Raghavendra Subject: [PATCH v2 5/9] usb: dwc3-generic: Use dev_read_addr() instead of devfdt_get_addr() Date: Thu, 20 Feb 2020 10:32:20 +0800 Message-Id: <20200220023224.32146-6-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200220023224.32146-1-kever.yang@rock-chips.com> References: <20200220023224.32146-1-kever.yang@rock-chips.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Use more common API so that we can support live DT. Signed-off-by: Kever Yang --- Changes in v2: None drivers/usb/dwc3/dwc3-generic.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c index 820cc7075c..ced0f53bfd 100644 --- a/drivers/usb/dwc3/dwc3-generic.c +++ b/drivers/usb/dwc3/dwc3-generic.c @@ -88,17 +88,17 @@ static int dwc3_generic_remove(struct udevice *dev, static int dwc3_generic_ofdata_to_platdata(struct udevice *dev) { struct dwc3_generic_plat *plat = dev_get_platdata(dev); - int node = dev_of_offset(dev); + ofnode node = dev->node; - plat->base = devfdt_get_addr(dev); + plat->base = dev_read_addr(dev); - plat->maximum_speed = usb_get_maximum_speed(node); + plat->maximum_speed = usb_get_maximum_speed(ofnode_to_offset(node)); if (plat->maximum_speed == USB_SPEED_UNKNOWN) { pr_info("No USB maximum speed specified. Using super speed\n"); plat->maximum_speed = USB_SPEED_SUPER; } - plat->dr_mode = usb_get_dr_mode(node); + plat->dr_mode = usb_get_dr_mode(ofnode_to_offset(node)); if (plat->dr_mode == USB_DR_MODE_UNKNOWN) { pr_err("Invalid usb mode setup\n"); return -ENODEV; From patchwork Thu Feb 20 02:32:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1241129 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=M1fpV06R; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48NJZZ4Plgz9sRG for ; Thu, 20 Feb 2020 13:34:30 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EC49681541; Thu, 20 Feb 2020 03:33:24 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="M1fpV06R"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 126B381462; Thu, 20 Feb 2020 03:33:00 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DECF3813CE for ; Thu, 20 Feb 2020 03:32:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kever.yang@gmail.com Received: by mail-pj1-x1041.google.com with SMTP id d5so223232pjz.5 for ; Wed, 19 Feb 2020 18:32:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=bZK84/g7Jk3peGMsBJ+NOakTwHVjDPokZXp0kWflz5s=; b=M1fpV06Rq6QGTquizK4tzMEzf8p1894MG/cGwcsapnmgdxp0CSJ5fOTUi183w5Xy3B EdcuRDTaVQBFVOsmgZJJnVpS1e2/7xWIoI/9uY1ByfO9M8FQOKieNAdUja6VEEENFXUi Mu9Phr1aOXM/NNj38J1wrjika15cOAzw67XiyJ4PI+N/lKXiUwrzXOG9f833TIm5mHlF kWGcgxiQWXKNBITDM4wjy2w+H13gF9h935Vsvv2WsBqC7jI8+2MeLcFvlorZgshAq4kZ 6xXCQPg4Cr1se0fZHUHTJpdGY2wjAa9VNG+ndLctGZ/hwHCLwTMqUBwN/7ZgyQec35sw d1OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=bZK84/g7Jk3peGMsBJ+NOakTwHVjDPokZXp0kWflz5s=; b=gXNHiLl81B5GetxluH8HI314e6BDtS5A4l4gzqBnmL+IQB5fkruePpogizV/oivZYi 6Q0FicXYWrgyA0ItwoRpMndFB6oOm6Qf9Rjlq9DGkbs2/2CAebylB2UhV1Yqe1V68vrO aebRh6bb+Eo3c2GjB16VZTqcXG3dqRk4pd6JPRyaEu7sPOs1/whVsivvQ/jmtFoENqW+ NlZbHAKgzFxKSVdUD9LChGf7WrWwwvaXc8Zdv7TXKSwzNfoLQzS1rQz472WSuLP/Xzr6 Zf4IbY/MO0cwSV+6PGjnyzuZbmIy9HrZRRBzYlof0lJc+MqHBbV39h6vOHJ8YQw5MN8U NHRw== X-Gm-Message-State: APjAAAW5O5ZeLHeB989aBdWONtbrqPXVw0IAu1hPD+LXHDCcq3l5yh/z mzxCplRRdGujcapDTZBRztSUvFaw X-Google-Smtp-Source: APXvYqzFv09fhKFfEtuwfRaR9ykZTw8eS0mHRcYerJ3PdNHYjV8Sf0NwGY+L/NCVyBVTJ+AmJ7h88A== X-Received: by 2002:a17:902:7e4b:: with SMTP id a11mr28751109pln.61.1582165973300; Wed, 19 Feb 2020 18:32:53 -0800 (PST) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id w25sm952107pfi.106.2020.02.19.18.32.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 18:32:52 -0800 (PST) From: Kever Yang To: u-boot@lists.denx.de Cc: frank.wang@rock-chips.com, Kever Yang , Marek Vasut , Neil Armstrong Subject: [PATCH v2 6/9] usb: host: dwc3-sti-glue: Migrate to use ofnode API Date: Thu, 20 Feb 2020 10:32:21 +0800 Message-Id: <20200220023224.32146-7-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200220023224.32146-1-kever.yang@rock-chips.com> References: <20200220023224.32146-1-kever.yang@rock-chips.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Use ofnode_ instead of fdt_ or fdtdec_ APIs so that the driver can support live DT. Signed-off-by: Kever Yang --- Changes in v2: - fix build error for ofnode not define drivers/usb/host/dwc3-sti-glue.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/usb/host/dwc3-sti-glue.c b/drivers/usb/host/dwc3-sti-glue.c index ad7cf6e6b5..ae9573ab8a 100644 --- a/drivers/usb/host/dwc3-sti-glue.c +++ b/drivers/usb/host/dwc3-sti-glue.c @@ -10,8 +10,6 @@ #include #include #include -#include -#include #include #include #include @@ -109,8 +107,7 @@ static int sti_dwc3_glue_ofdata_to_platdata(struct udevice *dev) int ret; u32 reg[4]; - ret = fdtdec_get_int_array(gd->fdt_blob, dev_of_offset(dev), - "reg", reg, ARRAY_SIZE(reg)); + ret = ofnode_read_u32_array(dev->node, "reg", reg, ARRAY_SIZE(reg)); if (ret) { pr_err("unable to find st,stih407-dwc3 reg property(%d)\n", ret); return ret; @@ -153,24 +150,21 @@ static int sti_dwc3_glue_ofdata_to_platdata(struct udevice *dev) static int sti_dwc3_glue_bind(struct udevice *dev) { struct sti_dwc3_glue_platdata *plat = dev_get_platdata(dev); - int dwc3_node; + ofnode node, dwc3_node; - /* check if one subnode is present */ - dwc3_node = fdt_first_subnode(gd->fdt_blob, dev_of_offset(dev)); - if (dwc3_node <= 0) { - pr_err("Can't find subnode for %s\n", dev->name); - return -ENODEV; + /* Find snps,dwc3 node from subnode */ + ofnode_for_each_subnode(node, dev->node) { + if (ofnode_device_is_compatible(node, "snps,dwc3")) + dwc3_node = node; } - /* check if the subnode compatible string is the dwc3 one*/ - if (fdt_node_check_compatible(gd->fdt_blob, dwc3_node, - "snps,dwc3") != 0) { + if (!ofnode_valid(node)) { pr_err("Can't find dwc3 subnode for %s\n", dev->name); return -ENODEV; } /* retrieve the DWC3 dual role mode */ - plat->mode = usb_get_dr_mode(dwc3_node); + plat->mode = usb_get_dr_mode(ofnode_to_offset(dwc3_node)); if (plat->mode == USB_DR_MODE_UNKNOWN) /* by default set dual role mode to HOST */ plat->mode = USB_DR_MODE_HOST; From patchwork Thu Feb 20 02:32:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1241127 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=rdl2mViw; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48NJZ84pbVz9sRs for ; Thu, 20 Feb 2020 13:34:08 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9A2DF8152F; Thu, 20 Feb 2020 03:33:18 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="rdl2mViw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D0400813D0; Thu, 20 Feb 2020 03:33:04 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D66F9813C0 for ; Thu, 20 Feb 2020 03:32:56 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kever.yang@gmail.com Received: by mail-pj1-x1042.google.com with SMTP id d5so223256pjz.5 for ; Wed, 19 Feb 2020 18:32:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=fKlt+XHs+lQMhFyTp376SSZYkZZlQBHXbTsycrNUM14=; b=rdl2mViwRNYZOJBmyYFnaIIz7IB9CVcO8IJzts68nhw97JmoAeWrbzBNWUi1s3488y IPOCbT08jsXnHlqMrSsEV5Ukl0xjqhRnDGesfvaOw39ZOubDnWrbvO2oRghUnhmzAs9M oh9/U568GXk01LKXSZEKFdl+2bY5YFhLIyB8W7qz6ymI2ec/Y2lIKXtynceA/kqU+YOJ FEeoSDtfj4uhXOzoimj9I2O+yGkVvmWiijzybGt7VE78v60pz5SajHOTlNBkIJt94FJ2 yjZgK2hiig2jcOKO1G9//Ba7ZKmXF01T6NPJ3IEyDyU/rTxkBTKrfXze4YUBoPfYVDJ9 qTfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=fKlt+XHs+lQMhFyTp376SSZYkZZlQBHXbTsycrNUM14=; b=AVGaYDGTEnX0mK/lD5UBTTveT4uc6pNsJJWzj5eR6ryTH9E9hFiu+6iwQj+IDlsRE1 RN42HfDWOKNmoHk4wYHMBMIxOelM6CUAoOEh0j4mhM8Ij2Mh8QYANJLx9b5hMq0XfHsn 4AtvaKsVF55w57wgJj3BR5wTcuCif5UPevHSKdBkI1Wsm5EXbrOUCUMiApK9FvQkxVTS D7RgLj1TW1FiwU+7DEwpagHltcDTcZdKrz94Qb1FMcNODXnhuV79MLulTvIzXEgY/8vX jJKdCT2xvMxtiOo6CvsGewn7w0efTpFy+Kyd30KN5G1irHyvX7qDa77XCkz93+m96Q8Y QWhw== X-Gm-Message-State: APjAAAUsXYhwkbbN7eS389xT3oOedqhXH8sr1M08wxpq5/0zNm64sY51 I7bySmG/Q6jLBXO+/GebDhU+9A2s X-Google-Smtp-Source: APXvYqzMhYGjJanWBgrs3UfJFYPDazkXyqmnR9+KSuRmd0YoBJIrZ4fO3sOrdO3X9Mrn5kM1IoyAqA== X-Received: by 2002:a17:902:426:: with SMTP id 35mr28357200ple.302.1582165975317; Wed, 19 Feb 2020 18:32:55 -0800 (PST) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id w25sm952107pfi.106.2020.02.19.18.32.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 18:32:55 -0800 (PST) From: Kever Yang To: u-boot@lists.denx.de Cc: frank.wang@rock-chips.com, Kever Yang , Marek Vasut , Neil Armstrong , Simon Glass Subject: [PATCH v2 7/9] usb: musb-new: Migrate to use ofnode API Date: Thu, 20 Feb 2020 10:32:22 +0800 Message-Id: <20200220023224.32146-8-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200220023224.32146-1-kever.yang@rock-chips.com> References: <20200220023224.32146-1-kever.yang@rock-chips.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Use ofnode_ instead of fdt_ APIs so that the driver can support live DT. Signed-off-by: Kever Yang --- Changes in v2: None drivers/usb/musb-new/ti-musb.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/usb/musb-new/ti-musb.c b/drivers/usb/musb-new/ti-musb.c index 00759f3e83..69252a7222 100644 --- a/drivers/usb/musb-new/ti-musb.c +++ b/drivers/usb/musb-new/ti-musb.c @@ -285,28 +285,26 @@ U_BOOT_DRIVER(ti_musb_peripheral) = { #if CONFIG_IS_ENABLED(OF_CONTROL) static int ti_musb_wrapper_bind(struct udevice *parent) { - const void *fdt = gd->fdt_blob; - int node; + ofnode node; int ret; - for (node = fdt_first_subnode(fdt, dev_of_offset(parent)); node > 0; - node = fdt_next_subnode(fdt, node)) { + ofnode_for_each_subnode(node, parent->node) { struct udevice *dev; - const char *name = fdt_get_name(fdt, node, NULL); + const char *name = ofnode_get_name(node); enum usb_dr_mode dr_mode; struct driver *drv; if (strncmp(name, "usb@", 4)) continue; - dr_mode = usb_get_dr_mode(node); + dr_mode = usb_get_dr_mode(ofnode_to_offset(node)); switch (dr_mode) { case USB_DR_MODE_PERIPHERAL: /* Bind MUSB device */ ret = device_bind_driver_to_node(parent, "ti-musb-peripheral", name, - offset_to_ofnode(node), + node, &dev); if (ret) pr_err("musb - not able to bind usb peripheral node\n"); @@ -316,7 +314,7 @@ static int ti_musb_wrapper_bind(struct udevice *parent) ret = device_bind_driver_to_node(parent, "ti-musb-host", name, - offset_to_ofnode(node), + node, &dev); if (ret) pr_err("musb - not able to bind usb host node\n"); From patchwork Thu Feb 20 02:32:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1241130 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=g1NK9k4K; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48NJb00gGxz9sRG for ; Thu, 20 Feb 2020 13:34:52 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 31587813BE; Thu, 20 Feb 2020 03:33:51 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="g1NK9k4K"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E13D281528; Thu, 20 Feb 2020 03:33:11 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 91B89812C4 for ; Thu, 20 Feb 2020 03:33:00 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kever.yang@gmail.com Received: by mail-pl1-x644.google.com with SMTP id b22so914251pls.12 for ; Wed, 19 Feb 2020 18:33:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=3/yYMI7fSW/fyeOL73uBPuMERIg8Zg8ILuMGFpLBr+Q=; b=g1NK9k4KYHDvu+aZ5LyAqPpZVUHzqmNvzTq11xh0WbF1kmcgoqT1Kb3HWmkSopi3jS WKaK4So/6pspYXWSr24HAKm9yNaClgJ2oXwZdbdjyCy1J8JcDNmn5yqrzwStOZV7JZeq zGXhn3d+9SBfBua7wuYs1L1kqNsddmBeG7DIJUc5DKS8l8IYGykdFp51JgDKYc/KWdyS PM5HFwhUUBUl00BD6nHIfVDJF1NmwQOvUEXSlfWfx4cjmPTQJS9+KxzRqi8KBVjxTlyp 8zsyHlRGqBOmBNwOeiQWPc2R8GXOT0FzWpFZLQwUX+sxCXjunYdPcqyxPrOdpFTHreNg rvrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=3/yYMI7fSW/fyeOL73uBPuMERIg8Zg8ILuMGFpLBr+Q=; b=Z5Gs25SE5J9qMlPomeVXlhl1cYlbB76DF0twpM4RsGKwBseENYN/2h0gQUWdKZjtvT edDyWrm7c7IftvSbmsemHOtpfnyW+CpGWqLWh4hpUUH2Ak1giV2deNVLDBkvbYRM3DAK Ckyd2x3SRVVIX/4L62XejBiK3sd5Y/WdDbvzbH4s+zE7gRnNiGYsn0dq6mk/h1M6e2fs V1wk1VCzITqcKRHVaWaiZD6hq1tVhoSQe8xSei4cDVkrDCocYw1ESYEboSEoSyCVA+zo D2S04dbejaJ8fRBLtD+/NxUDEgFZlaI+GP3qMGJueXTrwpfWrOfI3Haw1O7EME+OsgJX tzIw== X-Gm-Message-State: APjAAAWju4MNG/1K6J2IXvk48p8zx/M+vRTG6KG3p836u2j4JanmLU8m Huvp6EsWEa3NL52oog9z6RTI+twS X-Google-Smtp-Source: APXvYqxwOjBPItx/MnXXzVEqRDqc3G82u6jsgix2bUA+QHIPfnDCQc/I2Pbqc0xfqXfrCS955u04WQ== X-Received: by 2002:a17:902:8343:: with SMTP id z3mr29815118pln.105.1582165978804; Wed, 19 Feb 2020 18:32:58 -0800 (PST) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id w25sm952107pfi.106.2020.02.19.18.32.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 18:32:58 -0800 (PST) From: Kever Yang To: u-boot@lists.denx.de Cc: frank.wang@rock-chips.com, Kever Yang , Adam Ford , Bin Meng , Igor Opaniuk , Jean-Jacques Hiblot , Lukasz Majewski , Marek Vasut , Neil Armstrong , Simon Glass , Vignesh Raghavendra , Ye Li , u-boot-amlogic@groups.io Subject: [PATCH v2 8/9] usb: Use ofnode as usb_get_dr_mode() parameter Date: Thu, 20 Feb 2020 10:32:23 +0800 Message-Id: <20200220023224.32146-9-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200220023224.32146-1-kever.yang@rock-chips.com> References: <20200220023224.32146-1-kever.yang@rock-chips.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean ofnode is more common and no need to convert to offset after we migrate other API to use ofnode. Signed-off-by: Kever Yang Acked-by: Neil Armstrong --- Changes in v2: - add ofnode.h in otg.h to avoid build error drivers/usb/cdns3/core.c | 4 ++-- drivers/usb/common/common.c | 7 +++---- drivers/usb/dwc3/dwc3-generic.c | 6 +++--- drivers/usb/dwc3/dwc3-meson-g12a.c | 2 +- drivers/usb/gadget/dwc2_udc_otg.c | 5 ++--- drivers/usb/host/dwc3-sti-glue.c | 2 +- drivers/usb/host/ehci-mx6.c | 2 +- drivers/usb/host/xhci-dwc3.c | 3 +-- drivers/usb/musb-new/ti-musb.c | 2 +- include/linux/usb/otg.h | 6 ++++-- 10 files changed, 19 insertions(+), 20 deletions(-) diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c index 75c3d4f200..ce846488a8 100644 --- a/drivers/usb/cdns3/core.c +++ b/drivers/usb/cdns3/core.c @@ -108,7 +108,7 @@ static int cdns3_core_init_role(struct cdns3 *cdns) enum usb_dr_mode dr_mode; int ret = 0; - dr_mode = usb_get_dr_mode(dev_of_offset(dev)); + dr_mode = usb_get_dr_mode(dev->node); cdns->role = USB_ROLE_NONE; /* @@ -398,7 +398,7 @@ int cdns3_bind(struct udevice *parent) } name = ofnode_get_name(node); - dr_mode = usb_get_dr_mode(ofnode_to_offset(node)); + dr_mode = usb_get_dr_mode(node); switch (dr_mode) { #if defined(CONFIG_SPL_USB_HOST_SUPPORT) || \ diff --git a/drivers/usb/common/common.c b/drivers/usb/common/common.c index a55def5aba..4300f711a9 100644 --- a/drivers/usb/common/common.c +++ b/drivers/usb/common/common.c @@ -7,7 +7,7 @@ */ #include -#include +#include #include #include @@ -20,13 +20,12 @@ static const char *const usb_dr_modes[] = { [USB_DR_MODE_OTG] = "otg", }; -enum usb_dr_mode usb_get_dr_mode(int node) +enum usb_dr_mode usb_get_dr_mode(ofnode node) { - const void *fdt = gd->fdt_blob; const char *dr_mode; int i; - dr_mode = fdt_getprop(fdt, node, "dr_mode", NULL); + dr_mode = ofnode_read_string(node, "dr_mode"); if (!dr_mode) { pr_err("usb dr_mode not found\n"); return USB_DR_MODE_UNKNOWN; diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c index ced0f53bfd..7178f12b47 100644 --- a/drivers/usb/dwc3/dwc3-generic.c +++ b/drivers/usb/dwc3/dwc3-generic.c @@ -98,7 +98,7 @@ static int dwc3_generic_ofdata_to_platdata(struct udevice *dev) plat->maximum_speed = USB_SPEED_SUPER; } - plat->dr_mode = usb_get_dr_mode(ofnode_to_offset(node)); + plat->dr_mode = usb_get_dr_mode(node); if (plat->dr_mode == USB_DR_MODE_UNKNOWN) { pr_err("Invalid usb mode setup\n"); return -ENODEV; @@ -295,7 +295,7 @@ static int dwc3_glue_bind(struct udevice *parent) debug("%s: subnode name: %s\n", __func__, name); - dr_mode = usb_get_dr_mode(ofnode_to_offset(node)); + dr_mode = usb_get_dr_mode(node); switch (dr_mode) { case USB_DR_MODE_PERIPHERAL: @@ -398,7 +398,7 @@ static int dwc3_glue_probe(struct udevice *dev) while (child) { enum usb_dr_mode dr_mode; - dr_mode = usb_get_dr_mode(dev_of_offset(child)); + dr_mode = usb_get_dr_mode(child->node); device_find_next_child(&child); if (ops && ops->select_dr_mode) ops->select_dr_mode(dev, index, dr_mode); diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c index 832bcd70ff..d4453f8784 100644 --- a/drivers/usb/dwc3/dwc3-meson-g12a.c +++ b/drivers/usb/dwc3/dwc3-meson-g12a.c @@ -393,7 +393,7 @@ static int dwc3_meson_g12a_probe(struct udevice *dev) } #endif - priv->otg_mode = usb_get_dr_mode(dev_of_offset(dev)); + priv->otg_mode = usb_get_dr_mode(dev->node); ret = dwc3_meson_g12a_usb_init(priv); if (ret) diff --git a/drivers/usb/gadget/dwc2_udc_otg.c b/drivers/usb/gadget/dwc2_udc_otg.c index 496abf38e7..b9c814cf73 100644 --- a/drivers/usb/gadget/dwc2_udc_otg.c +++ b/drivers/usb/gadget/dwc2_udc_otg.c @@ -1039,13 +1039,12 @@ void dwc2_phy_shutdown(struct udevice *dev, struct phy *usb_phys, int num_phys) static int dwc2_udc_otg_ofdata_to_platdata(struct udevice *dev) { struct dwc2_plat_otg_data *platdata = dev_get_platdata(dev); - int node = dev_of_offset(dev); ulong drvdata; void (*set_params)(struct dwc2_plat_otg_data *data); int ret; - if (usb_get_dr_mode(node) != USB_DR_MODE_PERIPHERAL && - usb_get_dr_mode(node) != USB_DR_MODE_OTG) { + if (usb_get_dr_mode(dev->node) != USB_DR_MODE_PERIPHERAL && + usb_get_dr_mode(dev->node) != USB_DR_MODE_OTG) { dev_dbg(dev, "Invalid mode\n"); return -ENODEV; } diff --git a/drivers/usb/host/dwc3-sti-glue.c b/drivers/usb/host/dwc3-sti-glue.c index ae9573ab8a..c99a1985cc 100644 --- a/drivers/usb/host/dwc3-sti-glue.c +++ b/drivers/usb/host/dwc3-sti-glue.c @@ -164,7 +164,7 @@ static int sti_dwc3_glue_bind(struct udevice *dev) } /* retrieve the DWC3 dual role mode */ - plat->mode = usb_get_dr_mode(ofnode_to_offset(dwc3_node)); + plat->mode = usb_get_dr_mode(dwc3_node); if (plat->mode == USB_DR_MODE_UNKNOWN) /* by default set dual role mode to HOST */ plat->mode = USB_DR_MODE_HOST; diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c index 1993ad620a..f2ceb51310 100644 --- a/drivers/usb/host/ehci-mx6.c +++ b/drivers/usb/host/ehci-mx6.c @@ -513,7 +513,7 @@ static int ehci_usb_ofdata_to_platdata(struct udevice *dev) struct usb_platdata *plat = dev_get_platdata(dev); enum usb_dr_mode dr_mode; - dr_mode = usb_get_dr_mode(dev_of_offset(dev)); + dr_mode = usb_get_dr_mode(dev->node); switch (dr_mode) { case USB_DR_MODE_HOST: diff --git a/drivers/usb/host/xhci-dwc3.c b/drivers/usb/host/xhci-dwc3.c index c1c681ca6c..9fcfa39d4b 100644 --- a/drivers/usb/host/xhci-dwc3.c +++ b/drivers/usb/host/xhci-dwc3.c @@ -9,7 +9,6 @@ #include #include -#include #include #include #include @@ -155,7 +154,7 @@ static int xhci_dwc3_probe(struct udevice *dev) writel(reg, &dwc3_reg->g_usb2phycfg[0]); - dr_mode = usb_get_dr_mode(dev_of_offset(dev)); + dr_mode = usb_get_dr_mode(dev->node); if (dr_mode == USB_DR_MODE_UNKNOWN) /* by default set dual role mode to HOST */ dr_mode = USB_DR_MODE_HOST; diff --git a/drivers/usb/musb-new/ti-musb.c b/drivers/usb/musb-new/ti-musb.c index 69252a7222..608facefa3 100644 --- a/drivers/usb/musb-new/ti-musb.c +++ b/drivers/usb/musb-new/ti-musb.c @@ -297,7 +297,7 @@ static int ti_musb_wrapper_bind(struct udevice *parent) if (strncmp(name, "usb@", 4)) continue; - dr_mode = usb_get_dr_mode(ofnode_to_offset(node)); + dr_mode = usb_get_dr_mode(node); switch (dr_mode) { case USB_DR_MODE_PERIPHERAL: /* Bind MUSB device */ diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index d2604c5caf..4f1f8ceb54 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h @@ -9,6 +9,8 @@ #ifndef __LINUX_USB_OTG_H #define __LINUX_USB_OTG_H +#include + enum usb_dr_mode { USB_DR_MODE_UNKNOWN, USB_DR_MODE_HOST, @@ -18,12 +20,12 @@ enum usb_dr_mode { /** * usb_get_dr_mode() - Get dual role mode for given device - * @node: Node offset to the given device + * @node: ofnode of the given device * * The function gets phy interface string from property 'dr_mode', * and returns the correspondig enum usb_dr_mode */ -enum usb_dr_mode usb_get_dr_mode(int node); +enum usb_dr_mode usb_get_dr_mode(ofnode node); /** * usb_get_maximum_speed() - Get maximum speed for given device From patchwork Thu Feb 20 02:32:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1241131 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=fSxPuuh4; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48NJZn6CtNz9sRs for ; Thu, 20 Feb 2020 13:34:41 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BA4948158E; Thu, 20 Feb 2020 03:33:27 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fSxPuuh4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6B1EA813D0; Thu, 20 Feb 2020 03:33:10 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5D2A5813B5 for ; Thu, 20 Feb 2020 03:33:03 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kever.yang@gmail.com Received: by mail-pg1-x542.google.com with SMTP id v23so1140960pgk.2 for ; Wed, 19 Feb 2020 18:33:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=BuUd6AJFnfvFy3K4Yx2hZCRQRnifT476WWnOfwoOjHI=; b=fSxPuuh4t8TJKWVL4S74XxOCad1W2x3VO3SUHY/3mPSc+wI1NjJgv4UPg54tbusy+g Us6CZTtnDjVMPzmb4uVrbLFOs6e1KNWmqYGTJLnTgwMNELxT2BLDCe18vOaBr9y1YoHh lDkn/rolv7Y+M5qs6wdop/on8HYBBg8rb6ZMeTx//8pplDV2eAo0q7Fd6yrnQ775u0mh SFq54yZ/JaPlHpDHnIm4Nai5ekeLomVb4LcvmhI82C70fCO5iXPXHsDB+DAOjb1K2Sv5 1OLFe9kc7AsDgdcYDcem2z8zJvCsVzCSSeI5dV2z3VWOHH36/bV7AaDTY+amemB5nXaz MW7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=BuUd6AJFnfvFy3K4Yx2hZCRQRnifT476WWnOfwoOjHI=; b=AqNsl7TVXKT672XVt8aJH8J5XlvlaQe0QDKtSE4864StKtvKolDG9oyej34j2emty0 5Fbu25XtctHUanLafUcr0tUMSox270XlfAFWds004iNoDGeB49BwCB1sYOt4TdP6tz4H LOVvEyU1cLWzEpwPgHPSlBeACTEocOEtcZRuApTtWKoUL4Q092pGMmo2oUAdylwJXnyx fEzb5WzBSs/Fk5l2kF9Zj6cB69U/d7F2HoyN/4ETXb5FZhkC1mja1WA8NW1Kr1E+e4w4 h56geQl1W09Ul81zk39y7/eOMszFAurC0vWw8ymgfu4wWu2Kw8YCNaVt2Ji525j9Mvjn syEQ== X-Gm-Message-State: APjAAAVXy0xLxIWhRYvnIt1RaSc0DRzYKiubrt8OJYmrA5RAcLi0Ie60 seIXD8pq/OI4pjs8iXJTSKZBeYIz X-Google-Smtp-Source: APXvYqz7MRh9T8X68F9ChKsu8/BDZq9ECDAKaSYaHYN5/b2PpoNWiZGotOkJIaZ+l2+nRq3f/FEp6g== X-Received: by 2002:a63:4a47:: with SMTP id j7mr30704093pgl.196.1582165981476; Wed, 19 Feb 2020 18:33:01 -0800 (PST) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id w25sm952107pfi.106.2020.02.19.18.32.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 18:33:01 -0800 (PST) From: Kever Yang To: u-boot@lists.denx.de Cc: frank.wang@rock-chips.com, Kever Yang , Anatolij Gustschin , Jean-Jacques Hiblot , Lokesh Vutla , Marek Vasut , Neil Armstrong , Simon Glass , Vignesh Raghavendra Subject: [PATCH v2 9/9] usb: Use ofnode as usb_get_maximum_speed() parameter Date: Thu, 20 Feb 2020 10:32:24 +0800 Message-Id: <20200220023224.32146-10-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200220023224.32146-1-kever.yang@rock-chips.com> References: <20200220023224.32146-1-kever.yang@rock-chips.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean ofnode is more common and no need to convert to offset after we migrate other API to use ofnode. Signed-off-by: Kever Yang --- Changes in v2: None drivers/usb/cdns3/gadget.c | 2 +- drivers/usb/common/common.c | 5 ++--- drivers/usb/dwc3/dwc3-generic.c | 2 +- include/linux/usb/otg.h | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c index 22e90a5717..8ebe64e8b3 100644 --- a/drivers/usb/cdns3/gadget.c +++ b/drivers/usb/cdns3/gadget.c @@ -2579,7 +2579,7 @@ static int cdns3_gadget_start(struct cdns3 *cdns) if (!priv_dev->onchip_buffers) priv_dev->onchip_buffers = 256; - max_speed = usb_get_maximum_speed(dev_of_offset(cdns->dev)); + max_speed = usb_get_maximum_speed(dev_ofnode(cdns->dev)); /* Check the maximum_speed parameter */ switch (max_speed) { diff --git a/drivers/usb/common/common.c b/drivers/usb/common/common.c index 4300f711a9..0db281b970 100644 --- a/drivers/usb/common/common.c +++ b/drivers/usb/common/common.c @@ -47,13 +47,12 @@ static const char *const speed_names[] = { [USB_SPEED_SUPER] = "super-speed", }; -enum usb_device_speed usb_get_maximum_speed(int node) +enum usb_device_speed usb_get_maximum_speed(ofnode node) { - const void *fdt = gd->fdt_blob; const char *max_speed; int i; - max_speed = fdt_getprop(fdt, node, "maximum-speed", NULL); + max_speed = ofnode_read_string(node, "maximum-speed"); if (!max_speed) { pr_err("usb maximum-speed not found\n"); return USB_SPEED_UNKNOWN; diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c index 7178f12b47..febcfc0f54 100644 --- a/drivers/usb/dwc3/dwc3-generic.c +++ b/drivers/usb/dwc3/dwc3-generic.c @@ -92,7 +92,7 @@ static int dwc3_generic_ofdata_to_platdata(struct udevice *dev) plat->base = dev_read_addr(dev); - plat->maximum_speed = usb_get_maximum_speed(ofnode_to_offset(node)); + plat->maximum_speed = usb_get_maximum_speed(node); if (plat->maximum_speed == USB_SPEED_UNKNOWN) { pr_info("No USB maximum speed specified. Using super speed\n"); plat->maximum_speed = USB_SPEED_SUPER; diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index 4f1f8ceb54..c19b916be9 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h @@ -29,11 +29,11 @@ enum usb_dr_mode usb_get_dr_mode(ofnode node); /** * usb_get_maximum_speed() - Get maximum speed for given device - * @node: Node offset to the given device + * @node: ofnode of the given device * * The function gets phy interface string from property 'maximum-speed', * and returns the correspondig enum usb_device_speed */ -enum usb_device_speed usb_get_maximum_speed(int node); +enum usb_device_speed usb_get_maximum_speed(ofnode node); #endif /* __LINUX_USB_OTG_H */