From patchwork Wed Sep 16 12:57:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 312398 Delivered-To: patch@linaro.org Received: by 2002:a92:5ad1:0:0:0:0:0 with SMTP id b78csp416230ilg; Wed, 16 Sep 2020 05:34:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxy+daBpQKPUNsO/tDuHF6fyzcklwpHijk82z9Uq9/N0iZ1v/qTDgh+XdNSaPw5suasKQIc X-Received: by 2002:a17:906:1b15:: with SMTP id o21mr24691266ejg.377.1600259650648; Wed, 16 Sep 2020 05:34:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1600259650; cv=pass; d=google.com; s=arc-20160816; b=SeYYex0KhwX4jtr7ZeRLP2Zb4WNLH2wOI5KvPTcoo2ZKyjRI2SB4csMgbZEpCqDy4o ABqM9+QJoNG3AUZeI3kmYEw8gZpBmbfXPMrEBdyPI5HReKaxkL9EuqmRxyKRR4SIiLmR GtE4PCXs6fRi24YdatB6eItWG/L2bszISkL174VZpO7s0mSfbPRODyi8nnDBVOswhUt6 RM13knsoW28ItYQG5CjVVcnTS+dWiiyEeDLamMqj6c/AKe954+yjpn27afJXyeOT/T13 A/j0F9rOMp6BfMny1YUZu0s9Crn1DpetvfmMIqKJrhDUva2FDr3nqHwleOT14cAkeqYG U0fw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version :content-transfer-encoding:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=XMS18v6a01osic7S1kbgAiNucf8B6J/sxY3LQNaYmOk=; b=u2KELet0i5cof8Xwq4rKCAAh+UwBhdWNpF7hdgKMu/y3nVc1Tzw9bhyU35mKUI3hCj cZeKrgSBBUy1qLyqi1dd4DyAs2pu6kPEVRgfs2ZLKY7zJTSmgh6BK91Kp8YOeSIOHchW bhjyGHcfRuo69tWpP5vmReVw5QWo/3hxymNgg3IVUPOmLZO0+kEfRhbmj5amVdFW1N4x 50wHbpVDYiXI7Z47Ca7qI0SZGG8NhKIV0Znna9hyZ57GxA8UT5yLXpQuOstdliR4Tx2c HJeMAZXc6WRGccNhxktPVHRb6Tzg8PolCI3MDiOcWLiclV9WaZdx83mnjJHHxUM+zItL E8yQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=IyVjQzJ2; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id k6si12081913edr.111.2020.09.16.05.34.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 05:34:10 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=IyVjQzJ2; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BF14182389; Wed, 16 Sep 2020 14:31:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="IyVjQzJ2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B09AC82374; Wed, 16 Sep 2020 14:31:42 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0619.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe02::619]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2A2A382371 for ; Wed, 16 Sep 2020 14:31:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PNLJrApPFDE7AznVWT0LkCo0TU7HzOsq5EpGa6Xj0w/Rh/U0oVuGcLGvLf6OraElOZkpaNzeV9NESfc3VJEqXQL2nyIUVt89pXKH3aU4rLPu4Dn37hOZwnSC2YO1PheRqqo9H9eV46TXrohUuwBCK5N4yG2VRq/jcaQHigHwS86gOggbj2e5ZjkP6P3WQNr+RclQTzTfb/JUW30MiwBdfww5flBVZPt/niDVL1zZqVnMU+KPhMuNF63PFpsvlXrcCAr5SyoUR5wLmvtDJqok6WnLHABN1TfPj8neIS9Uae3mVULizC6wDkMYyQ3zTIzYsDxhXekRYTV676SVy+WV6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XMS18v6a01osic7S1kbgAiNucf8B6J/sxY3LQNaYmOk=; b=bNXqAS5oM9cwgOuO79gfmQJD3kcWwAcqW/0Aq3sB+vLTKGn8FNqQZUfH6me5EbRZ/V9pP7ePs7U/mncHbK/k1vzfp2XSMmeH8sjln5Z2RxK+Yj+7hS42foPvVsTR6JH6Wdewy7nvnqW803LE2UWnh3OQRUPhw1S3z4kXS+mEtA98Ii71FzhSc3Jc4kgacwbaeCtzkQmwffh3xAgz3YpClfomSkFRwzESInAEJHNKkCEOkhJnOKePFzc1whnJOHOGdB3X4BwXNoZxHfkuBuPNZQStdUdQd366dEDnvd6BqYskA+IaDLVAVb/0mO3nyS5vhU4IwToOHB+PDlAdHCtbKw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XMS18v6a01osic7S1kbgAiNucf8B6J/sxY3LQNaYmOk=; b=IyVjQzJ202ObkGWjjb0QPd6C6uuAo8s2TtO4xPLXWZUkQeZ1EF8eaRsBlQjrSdsAZXihUjKc0WopTBXzRkW0qaPJstZrYkvrJCVDFiCRH4PX/ddVyLgNVoHgFVDM+uxVyK6cykcnBi8nL+yoB7SKBACpPkA87d5b891wr7wfzw4= Authentication-Results: denx.de; dkim=none (message not signed) header.d=none;denx.de; dmarc=none action=none header.from=nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB3PR0402MB3915.eurprd04.prod.outlook.com (2603:10a6:8:e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.17; Wed, 16 Sep 2020 12:31:39 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::39ff:13b4:4f28:1413]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::39ff:13b4:4f28:1413%10]) with mapi id 15.20.3370.019; Wed, 16 Sep 2020 12:31:38 +0000 From: peng.fan@nxp.com To: sbabic@denx.de, marex@denx.de Cc: uboot-imx@nxp.com, u-boot@lists.denx.de, Ye Li , Peng Fan Subject: [PATCH 13/13] usb: ehci-mx6: Improve the bind function Date: Wed, 16 Sep 2020 20:57:05 +0800 Message-Id: <20200916125705.4341-14-peng.fan@nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200916125705.4341-1-peng.fan@nxp.com> References: <20200916125705.4341-1-peng.fan@nxp.com> X-ClientProxiedBy: SGBP274CA0023.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::35) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SGBP274CA0023.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.13 via Frontend Transport; Wed, 16 Sep 2020 12:31:36 +0000 X-Mailer: git-send-email 2.28.0 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2142d3b8-cc88-4204-f53d-08d85a3c7549 X-MS-TrafficTypeDiagnostic: DB3PR0402MB3915: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3631; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PHbzCilzkEGph2VjHg6/4G844aLCYXFFpM2Dga2bsoSkYmLD0snln1SPHy5exTQqFz+/f055BgvwQKV2pw+jgQQzxft9qDF7mg+B0/nOLVE5S+zizK+7+i8xT0il3ly+wMHfmwKPf4v45JaGGAl/Cs48nWJFAjTcgX/ue5pyfOO6LxzZidAapWNnA+oKtyMSQu2mdJTm5gPk847NunGPD2n/4+C0HfEDhmR/oLte4Dpk5iIjctm03T8xzlUWpOycnd9m6EtHEJ+AfQ4GxvrOLLOHEh0FxwdpKcElxvUIZcwVCkx6kjH926GvCJTMgLXR0IE+91Z9FUt1trfUzRl6Gg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(136003)(376002)(346002)(39860400002)(396003)(186003)(16526019)(6512007)(8936002)(54906003)(36756003)(6486002)(2906002)(1076003)(6506007)(478600001)(2616005)(956004)(5660300002)(6666004)(83380400001)(52116002)(316002)(86362001)(4326008)(26005)(66476007)(8676002)(9686003)(66946007)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: h4QfzO0T1BR7kFamYBTCbeMqbyYepl6/PPWJFPE3rKhPMpeAHSxHe2ROkZz5D28zBXex6f0DfkAW99Ju3gLuDku4dY+B6cGjn6VPMjqci9KTNCeNvvc96YPBzyS7vfe0q3E8aaennSRw6+PCHVNCHHC1X/5iaNZHBkp+YNLnu4PmACFugvLXwDZYxJ+txOh7dskBwtquHGdvTXsOiS2k3Y+oXKasmaN3A7/Q9vixjuEfZkglYu/iDCUNuhfNUEAwE9ElBDVuyN2APAtmv3Ck9RgD9WoNgew3zTpcCgGZIvrA4Yuko72ps66uRFgoVjSAf0AfePswbMpYZXdA8jDU3uM9NKyiv4fiY1qMSBFsnRxQ5AmeMe/7x0Gl4uyPRUEmIk5HlXKLxSZC0GmE5SVg0QGdw6G+14ROZP4+qrX2RwLTX8icJ8qqef0Ev/lAeinVPuI4+3jQcvnspyWJj80tOIbGL8hLI/GoqyMOYj0mtM3Cyqd4t5E5FNfipho+vivlwcjdwKAmJct5fBivTbMhZJv86YvXY57L9WWffc+l7bmJOB9AXJ+PsM388LfH1o4HKvzMZI4r7ZLAjvke/xUOvicMJt5PE2viBXr4uCLtFkeH2zswiTJzeThPj1SimGzWzskXAkJoM1lhRcYtxF52sw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2142d3b8-cc88-4204-f53d-08d85a3c7549 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2020 12:31:38.9242 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: FJd+Y9IGKYl4KkpxDoG9iMtKIE/Dim0jHY4JBqM0i+ySFHSDQLSc9dSK6VJXKcNovQ9xRHxLHsdYBdejg/yyUA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0402MB3915 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.3 at phobos.denx.de X-Virus-Status: Clean From: Ye Li To avoid calling devfdt_get_addr_index in bind, which introduces much overhead, checks the req_seq and only call the devfdt_get_addr_index when the req_seq (usb alias) is not set in DTS Signed-off-by: Ye Li Reviewed-by: Peng Fan Signed-off-by: Peng Fan --- drivers/usb/host/ehci-mx6.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) -- 2.28.0 diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c index 080bde71d3..20617850f3 100644 --- a/drivers/usb/host/ehci-mx6.c +++ b/drivers/usb/host/ehci-mx6.c @@ -735,13 +735,16 @@ static int ehci_usb_bind(struct udevice *dev) * the driver is fully converted to DT probing. */ u32 controller_spacing; - if (IS_ENABLED(CONFIG_MX6)) - controller_spacing = 0x200; - else - controller_spacing = 0x10000; - fdt_addr_t addr = devfdt_get_addr_index(dev, 0); - dev->req_seq = (addr - USB_BASE_ADDR) / controller_spacing; + if (dev->req_seq == -1) { + if (IS_ENABLED(CONFIG_MX6)) + controller_spacing = 0x200; + else + controller_spacing = 0x10000; + fdt_addr_t addr = devfdt_get_addr_index(dev, 0); + + dev->req_seq = (addr - USB_BASE_ADDR) / controller_spacing; + } return 0; }