From patchwork Wed Sep 16 12:56:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1365260 X-Patchwork-Delegate: trini@ti.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=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=J5oNf8HC; 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 4BrzyQ6VY6z9sS8 for ; Wed, 16 Sep 2020 22:32:46 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 845EB82355; Wed, 16 Sep 2020 14:31:34 +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="J5oNf8HC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1350B82338; Wed, 16 Sep 2020 14:31:25 +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-db5eur01on0631.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe02::631]) (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 09DCC8233E for ; Wed, 16 Sep 2020 14:31: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=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XGkvt05s+C+UuhqJ36zkSKK2QdBp2nhBpzQOVYCjhT0v2blWwnA6qZbrspqoeZVivXMbK9h6wVt4PHcIT4qgC8hSFONkvewyTOoNnG9M9GF9Z6Z/QGtYISYVyHPsLV/vRLLyd6+XbS6RHkMPA8Xmd0l8JOdLny+114UVMuFJ0zi1KQfzLMoiJtLXJxNhihAMRRFClsXnHOJ02z6upTQfdcaddkje5dYNJP2MdikXC6uz6kst71YmEEDpYV7QTQapoA0auw+Z/c9CJGXFwfrSXKphIgpColWj4UzBeXExuNO+X+zPqNobh/QoQO9lJ2fMKAq50Zsp+gfZqWTUik6gNA== 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=7VxvI1UM8Cv/s/Wj6jrUhcDaO/qR8j12KWZMs66cM5I=; b=gCbSs7LBqvUA+q6k99R5EmmAut2HPS+Npeawwx02aJgFe9qtpdpwCmprCF//HUd9W941+tWrv+OOqdHEEKGGParBiG5O7aBpA4bXsMNROSYT8M/KQ5V2AgpJks88WJbx7Bpl2NRW3zWMEA6iAARtVkD3TZQIJxnvA4WHMP82ofQoa/QxsNUkLXIqJVEoT/kHVxgWk3KrLSCe9bJKDgiJjNsBWC6dVnOucVkQMy1O7Z9wq2BYFnwVvd+SYP8v2Miorh4SP3+QajhKzcuypyGUf6BiWu4iL7I3+qLZxDtBo7S3V8EQI0Z+tEOH33/Ei8liYEZCozf8pbj6rV83L9zirA== 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=7VxvI1UM8Cv/s/Wj6jrUhcDaO/qR8j12KWZMs66cM5I=; b=J5oNf8HCZ2xIxVgQMTMgaXcJKxDIOQDxR7YpvJZlhI8dDV7oxRwFdpDxiU7jc6Fh+KGJfgZdmjwgWGyuH8DZZKOC3lu/Xit7KvW2+8oakH/xL6ZAWQram15u++Xod1EAB4dUgZtbdJBbEDR83NluLOoKL+foMFn/xjnqp3Z/zu8= 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:20 +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:20 +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 06/13] usb: ehci-mx6: fix controller index for imx8m and imx8 Date: Wed, 16 Sep 2020 20:56:58 +0800 Message-Id: <20200916125705.4341-7-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:18 +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: 4c49145f-c61b-4ec2-3f1e-08d85a3c6a8f X-MS-TrafficTypeDiagnostic: DB3PR0402MB3915: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Gs6ccT2+yWYnEA1YQ8nMt3w+7uEFl9ylREp+DVjgmMSEPndpcOumoXST0z9FunP/YPUYlXGoy8zZma4e7/Vvo8XJj7qCIEXy+RFebDA46Wit/oIiCy4NXqQib4w3wDLcazs24g4uUVJfmM8xor6rR0hVMY1q7UxMcardiXRhrsu8JgCL9xjyIx/x3MzsSIvBBhWgIu0AK95Gy/VfPZAKiKlewFjmzL29PSOohmQAL945kk9Te4DU8vaRvRcqXHe/W0mPRpW589ruGcRr1zRR6chn4ODYHg4PdSkPf7os8Oq0nBKBAsv91I5ucoOv24eNwg0YCaTvneajmt+aCDSYEm9NfxXoqNnZ4YCUn1LoNoFnzPEn8RXti/0iGWlphhmC 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)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: CUhoFwqmBQgjGXZYRQfEBfCLaknE01c/yy4d6CI1jTABECLo3yePHK3X+beJrAI5FwHF1eBROIIHOkiW4PRoXS/BPy1MIoYSJYT4gT4lGEnv5nxMHNCVMuHKwfu41s2eNoJ8/O8BYw8iGO8t0CfZWQjr6BcuvS35BmxQQlWZ5RFaXh/JNP0fltSFhd/XQxQzyEEX/YxUb3q62EZt3MsdiP0itGYNxbeWCQubR1D6hy5811FaW/2A+TfRDlA3D4mpDV8zCowpUITBIMjzTNrgkgwZgD/KbSYT9z8cXYekCHEdpT2x5Xey4vMN4tJqw+vFuCcLGwZd9iviOv3V7y53xpE1p7zt/gLYSKeArX1N+s1jYIAIk3xy5HGX+sB4EMxiOpCw1uR4cEdZNwQ9MAxI/3XbFHDhh1eDNaqFycooD5UNucDZRYpEm515cbCxfTJ9s0Vdbz31L2HS3gsPG8ZDov+wSRkl6Cu+j2lSuc++jyrAsCvaHEg9UXpIfBKMqbvmiB3VSdIKysTRBgoqxG1T1X4S9iyghyf0fDLtx2YkCVbksyuyG0Pc8PLTjCZBQOPi/x3PcJC4/HDprQQ256Jy3tgKwdBe2Rhbw0bj/y7SsG/XnbBCA0sGaUT+fgptZGteU1cVG8hNDcN4UKQyzJtY+g== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4c49145f-c61b-4ec2-3f1e-08d85a3c6a8f 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:20.7304 (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: FmDnJ4Df/qg9f9Tq4j5rG0R2s4WTw0+rCCwIQOM0mFbe0BuwtHzuO9h/1skTpWfZVvnvRbWyy20K3+UVVstCzQ== 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 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 1db27949c6..96dcf7655b 100644 --- a/drivers/usb/host/ehci-mx6.c +++ b/drivers/usb/host/ehci-mx6.c @@ -665,7 +665,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; @@ -692,7 +696,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); @@ -744,7 +748,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[] = {