From patchwork Mon Jun 29 02:13:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1318711 X-Patchwork-Delegate: sbabic@denx.de 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=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=BAvZ2e8q; 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 49w9S54mFZz9s6w for ; Mon, 29 Jun 2020 11:50:45 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4FAE081F00; Mon, 29 Jun 2020 03:50:22 +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="BAvZ2e8q"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 288DC81EED; Mon, 29 Jun 2020 03:50:04 +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 EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on20624.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1b::624]) (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 0A14581EE2 for ; Mon, 29 Jun 2020 03:49:45 +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=adjp3qGEX/7sSeq+pyI6wPzwp7pAzNyIWApE6SYOQ5h0yASWAxqFgG5R/IKxXj1EX63trtdUo1lEs1vuL0jEjjG95gaSF3anHW5WmP9jW1UJ+GOnMZr3HCOnp7zwZl26q7Cpv7D34KTJLVHem+ROcmHV5SDnafK9jQywOh0w+Vt7nqjJI4YrueHUYtI3LQDeOQq/zgjgsrFIzKW8YqyVV1KBmjPPK+bhwnfwX1qn/NQ34CMonkJ8uzNFB3slrn66RTEPNOLCztbTlbhYaIhEBMk9QFbjcIGupl4mPMgppTbmAs4zGfkueo+iqOFn4QVb3+/T70GB1rJDCc7ViCoDKw== 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=9hPVKvA8OR/HJ+EAxzADm1EVhlxLzCnWsZUrOWzU4KI=; b=g7zA80KsePDJ/+4dczO6SSxMImpk678wEPwu5bBnu+4DeMd6UVJ2M3JYEkT4Jd81oaGTDzdwMjNDNwSWyHG97rIXVvKkQ0KuKGkmmhw/2Dq8pY8m7EhZW/w+vaYeRNjA6BO094UcU7ArDlz7z+VJGB9+mHZkmXiu2bLtJJ3rU61CZ04Z9XMefI+Mqm/DhoGNOqoUe7JaQNEFrO8MjSi4Brx8iknyOSyEM8JuJMU+ynyHgDuVRm4eqGvUVP6CgfPP5nbIriKwsjgr+QqFhk6vAEqzCYLiXRAejrrAhKigQzRVKkFwsf/BNapYo3wcslwv3LJ9qp1LQI7eyJztrRQNpw== 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=9hPVKvA8OR/HJ+EAxzADm1EVhlxLzCnWsZUrOWzU4KI=; b=BAvZ2e8qISKbK4qbus5+oDMpbQXhXW9D8KKD4xOiUCr7P7sYb1bDlXBzweAebpyaGGHFN0Swtp147ZTFbxqb/fR7c0xgOTsevkb14wvCnjNI0OcXAbnse/8oYH17djaw+BM15YtrsxFj24SHwovR+QuqxtYfuQ3NhEjCR/5Px3w= 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 DB8PR04MB7177.eurprd04.prod.outlook.com (2603:10a6:10:127::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.21; Mon, 29 Jun 2020 01:49:37 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::2d36:b569:17c:7701]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::2d36:b569:17c:7701%4]) with mapi id 15.20.3131.026; Mon, 29 Jun 2020 01:49:37 +0000 From: Peng Fan To: sbabic@denx.de, marex@denx.de Cc: uboot-imx@nxp.com, u-boot@lists.denx.de, Ye Li , Peng Fan Subject: [PATCH 5/7] usb: ehci-mx6: fix controller index for imx8m and imx8 Date: Mon, 29 Jun 2020 10:13:48 +0800 Message-Id: <20200629021350.21262-5-peng.fan@nxp.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200629021350.21262-1-peng.fan@nxp.com> References: <20200629021350.21262-1-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR01CA0147.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::27) 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 SG2PR01CA0147.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.21 via Frontend Transport; Mon, 29 Jun 2020 01:49:35 +0000 X-Mailer: git-send-email 2.16.4 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ff003db4-2b7b-4bfe-f844-08d81bceae27 X-MS-TrafficTypeDiagnostic: DB8PR04MB7177: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 044968D9E1 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TjN9d5ps4JK31zmvA4wNnMdKIlmPSgm/Z/hbiej6NtBZ2+nC1249Yd28gb8uDVVybIuY7DJtv2CGYamD+oTCpjk7ciKuki4ryPGPOAI9k/GCSZ2VupP4z1kohKm5CP6KoJ/KbuoXOeifSIyyK6fdqjvH/V3p/hD7jOUFTfxFQHJDagBd26z7x1WfKzSkgDgECKgKsleaOk81b1n8UUC+TJM1x1o17XMoK1HsS7zH7ONv1h5HUSUui9HNOZy1PJ4Lt6BnzhOZpvLuYOwr7ONCSuheZ8vu4tJf85ObPeCx2EEbUmlyOUH4MyYwL9/03wcT7XZ6R1/TyaxuoB2nUbU7Dn5FPJs8GafPQcetOjEA81uCrpf0BATjdIcXVkdL0Jf9 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; SFTY:; SFS:(4636009)(346002)(376002)(366004)(136003)(39860400002)(396003)(86362001)(478600001)(956004)(1076003)(44832011)(6666004)(6512007)(8676002)(8936002)(6506007)(5660300002)(2616005)(36756003)(2906002)(6486002)(66476007)(66946007)(52116002)(54906003)(186003)(66556008)(16526019)(4326008)(26005)(316002)(83380400001)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: kWgXTFQvQW+RNemWd//VjQGx2SZgk+07Ic3ibU4ZYfUKaFDSQIob8lGhbpoqknuaR7Fq1dRAla9OHlhROcxhCyqtNmabvwFg5LMrMeQ3S+tdUP6sjvWKS05nyElen4vjovwemsSnYl2GhKGgIxT81xjcQAyo2F70z4zxwYvX4qUNy50kqipqbeoqfHuOGeoJys8dR8h+3ve4LXcimqIKAROGdPxUuBio7gmABfihEfMI3e788hgykeRjNPZuGjQLo3dEL/J2W3H3y16+B1Q9gkADkquOvBWmXWzWgxYPMyILUykAqCngUz4f/wt9v0eBXMxaZvPz+CwD+9DHYoxNRjnQuXAN26n1Tw8ISKzAxCTzWqhG6dpKBkwSBpy1bP9TazQ9nGwaMHlYuBuZvqmou4fkYuZrVK1IFZsBT36Wx4MuVR2t9GASqnRIc99D1HsxaKpk55Ab913XXLRJqkZrXVdmWZuzrFV43whBlKkRzHg= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ff003db4-2b7b-4bfe-f844-08d81bceae27 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2020 01:49:37.6061 (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: k1+x7vjYEEGcGWbIx4frF06ipCohb6WQrpq52vL6GOjNzA7teUpRMM/i/sTj73SJ7oYK9DlS6VGRntFmgn5veA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB7177 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 From: Ye Li The bind codes calculate the address offset for controller index, but it is wrong for imx8m and imx8. It causes secondary controller fails to work. So fix this problem, and also change all seq to req_seq. There is another issue here for imx8, the codes use runtime CPU type check. One iMX8, this check depends on IPC communication with SCFW, and need MU driver been probed. But the usbotg is configured with "u-boot,dm_spl" property for SDP download in SPL, so it will bind in early DM in u-boot while the MU is not bound at same time, so the CPU type check will hang. Fix it to use static check. Signed-off-by: Ye Li Signed-off-by: Peng Fan --- drivers/usb/host/ehci-mx6.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c index 046c6ab283..8090cb27fe 100644 --- a/drivers/usb/host/ehci-mx6.c +++ b/drivers/usb/host/ehci-mx6.c @@ -687,7 +687,11 @@ static int ehci_usb_bind(struct udevice *dev) * With these changes in place, the ad-hoc indexing goes away and * the driver is fully converted to DT probing. */ - u32 controller_spacing = is_mx7() ? 0x10000 : 0x200; + 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; @@ -714,7 +718,7 @@ static int ehci_usb_probe(struct udevice *dev) } priv->ehci = ehci; - priv->portnr = dev->seq; + priv->portnr = dev->req_seq; priv->init_type = type; ret = board_usb_init(priv->portnr, priv->init_type); @@ -766,7 +770,7 @@ int ehci_usb_remove(struct udevice *dev) ehci_deregister(dev); - return board_usb_cleanup(dev->seq, priv->init_type); + return board_usb_cleanup(dev->req_seq, priv->init_type); } static const struct udevice_id mx6_usb_ids[] = {