From patchwork Tue Apr 6 10:10:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roese X-Patchwork-Id: 1462720 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; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=afuFhFfK; 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 4FF3FH0Nckz9sRf for ; Tue, 6 Apr 2021 20:10:40 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1DFA1806CE; Tue, 6 Apr 2021 12:10:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1617703830; bh=eVlcNw5Viof9FAGiP6nCaXzhg6ES93TdVfu3Z5gZM2E=; h=From:To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=afuFhFfKNfSlCtXz0rYSwnkemPShI1i7cOhc2DnquOkbdS+Nouwcv4NVPb75eOMsV fjHmfU83xiM3rQGa+rsHGU0PzdsAybso4NJimgpYg2MUi73tId/rAxksjdaJeM+nJZ 8EeuHo79ERp5f/iwdUkHhJZtVawzLZ5Y2I9ATdxFjTM5H2fZh5l2u4vUpr8OU7Im/X dpJuUWMXxyOm/h9cRQkK0ejPAzIEa1LMUkLZtB+0/O6J9XByXEIZlFeiaQ5Jrvnn3k kTrEE2I4+Uwbm2SJTB7E7p+lDYhrksZfkfhCdEEHKygzuFFJGi+Jac2t1QJz88Fu5R VzVhiffd15qQg== Received: by phobos.denx.de (Postfix, from userid 109) id 387CC81578; Tue, 6 Apr 2021 12:10:27 +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.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [91.198.250.253]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2F7ED8006D for ; Tue, 6 Apr 2021 12:10:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=sr@denx.de Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4FF3Dv0CPJzQjnx; Tue, 6 Apr 2021 12:10:23 +0200 (CEST) Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter05.heinlein-hosting.de (spamfilter05.heinlein-hosting.de [80.241.56.123]) (amavisd-new, port 10030) with ESMTP id 4pWurKsyI2DX; Tue, 6 Apr 2021 12:10:19 +0200 (CEST) From: Stefan Roese To: u-boot@lists.denx.de Cc: Aaron Williams , Chandrakala Chavva , Bin Meng , Marek Vasut Subject: [PATCH 1/3] usb: hub: Fix usb_get_port_status() for big-endian platforms Date: Tue, 6 Apr 2021 12:10:16 +0200 Message-Id: <20210406101018.30037-1-sr@denx.de> MIME-Version: 1.0 X-MBO-SPAM-Probability: X-Rspamd-Score: -1.02 / 15.00 / 15.00 X-Rspamd-Queue-Id: ACFFC1899 X-Rspamd-UID: 1b4d12 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.4 at phobos.denx.de X-Virus-Status: Clean From: Aaron Williams Add missing endianness conversions to usb_get_port_status(). This (amongst others) is necessary to enable the use of USB 3 hubs on big-endian platforms like MIPS Octeon. Signed-off-by: Aaron Williams Signed-off-by: Stefan Roese Cc: Chandrakala Chavva Cc: Bin Meng Cc: Marek Vasut --- common/usb_hub.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/usb_hub.c b/common/usb_hub.c index 3d856e7de792..ba11a188ca64 100644 --- a/common/usb_hub.c +++ b/common/usb_hub.c @@ -144,7 +144,8 @@ int usb_get_port_status(struct usb_device *dev, int port, void *data) if (!usb_hub_is_root_hub(dev->dev) && usb_hub_is_superspeed(dev)) { struct usb_port_status *status = (struct usb_port_status *)data; - u16 tmp = (status->wPortStatus) & USB_SS_PORT_STAT_MASK; + u16 tmp = le16_to_cpu(status->wPortStatus) & + USB_SS_PORT_STAT_MASK; if (status->wPortStatus & USB_SS_PORT_STAT_POWER) tmp |= USB_PORT_STAT_POWER; @@ -152,7 +153,7 @@ int usb_get_port_status(struct usb_device *dev, int port, void *data) USB_SS_PORT_STAT_SPEED_5GBPS) tmp |= USB_PORT_STAT_SUPER_SPEED; - status->wPortStatus = tmp; + status->wPortStatus = cpu_to_le16(tmp); } #endif From patchwork Tue Apr 6 10:10:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roese X-Patchwork-Id: 1462722 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; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=oTKCA/DE; 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 4FF3Fn3y0Hz9sRf for ; Tue, 6 Apr 2021 20:11:09 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2E75081693; Tue, 6 Apr 2021 12:10:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1617703840; bh=KHhLJxMwY27sh8pravmOYse5g8msFNsFodM/bCuULQ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=oTKCA/DEdM5KM8t9KN7qQOxc/+kUrEyMp9ZHvyiCOewKpoFOnKyJI7xNvDwWGLivJ 553IuY93QiFtaTvTEmquHfphYLkHIYGKL2drcaLM4qn6k2/9xbqUJKjqP61uxVAyJ3 t94SGhiUmCh9G+M3ZrNM3d+Rmq2RnZGT4/GgYJA+VnP8zSaJcOq6UkdaR9TVwJiWAx qDZtD0KQdBfv3rv2Aco/uwqUcUHB/vmIHJAgssBmGx6jXqMu3/LhdXvfBdayy6ce+7 8wvTBkJV5rlizNCnESJyeMX9qgV94Zd86uSpciYOXEIC+J0l2ajPdakUD72x+PvKdX 1pztcXgrMAjBg== Received: by phobos.denx.de (Postfix, from userid 109) id ADE7380433; Tue, 6 Apr 2021 12:10:32 +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.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mout-u-107.mailbox.org (mout-u-107.mailbox.org [91.198.250.252]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4324D80433 for ; Tue, 6 Apr 2021 12:10:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=sr@denx.de Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-107.mailbox.org (Postfix) with ESMTPS id 4FF3Dy1fQhzQjpK; Tue, 6 Apr 2021 12:10:26 +0200 (CEST) Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id OFc_3etbC8O2; Tue, 6 Apr 2021 12:10:19 +0200 (CEST) From: Stefan Roese To: u-boot@lists.denx.de Cc: Aaron Williams , Chandrakala Chavva , Bin Meng , Marek Vasut Subject: [PATCH 2/3] usb: xhci: Add missing xhci_readl() Date: Tue, 6 Apr 2021 12:10:17 +0200 Message-Id: <20210406101018.30037-2-sr@denx.de> In-Reply-To: <20210406101018.30037-1-sr@denx.de> References: <20210406101018.30037-1-sr@denx.de> MIME-Version: 1.0 X-MBO-SPAM-Probability: X-Rspamd-Score: -1.02 / 15.00 / 15.00 X-Rspamd-Queue-Id: 31A8C1893 X-Rspamd-UID: 75d872 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.4 at phobos.denx.de X-Virus-Status: Clean From: Aaron Williams Accessing the xHCI controller registers should be done via the xhci_readl/writel functions. This patch adds this to a few missing places. Signed-off-by: Aaron Williams Signed-off-by: Stefan Roese Cc: Chandrakala Chavva Cc: Bin Meng Cc: Marek Vasut --- drivers/usb/host/xhci-mem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 83147d51b5c0..1c11c2e7e04d 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c @@ -434,9 +434,9 @@ static struct xhci_container_ctx BUG_ON((type != XHCI_CTX_TYPE_DEVICE) && (type != XHCI_CTX_TYPE_INPUT)); ctx->type = type; ctx->size = (MAX_EP_CTX_NUM + 1) * - CTX_SIZE(readl(&ctrl->hccr->cr_hccparams)); + CTX_SIZE(xhci_readl(&ctrl->hccr->cr_hccparams)); if (type == XHCI_CTX_TYPE_INPUT) - ctx->size += CTX_SIZE(readl(&ctrl->hccr->cr_hccparams)); + ctx->size += CTX_SIZE(xhci_readl(&ctrl->hccr->cr_hccparams)); ctx->bytes = xhci_malloc(ctx->size); @@ -636,7 +636,7 @@ struct xhci_slot_ctx *xhci_get_slot_ctx(struct xhci_ctrl *ctrl, return (struct xhci_slot_ctx *)ctx->bytes; return (struct xhci_slot_ctx *) - (ctx->bytes + CTX_SIZE(readl(&ctrl->hccr->cr_hccparams))); + (ctx->bytes + CTX_SIZE(xhci_readl(&ctrl->hccr->cr_hccparams))); } /** @@ -658,7 +658,7 @@ struct xhci_ep_ctx *xhci_get_ep_ctx(struct xhci_ctrl *ctrl, return (struct xhci_ep_ctx *) (ctx->bytes + - (ep_index * CTX_SIZE(readl(&ctrl->hccr->cr_hccparams)))); + (ep_index * CTX_SIZE(xhci_readl(&ctrl->hccr->cr_hccparams)))); } /** From patchwork Tue Apr 6 10:10:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roese X-Patchwork-Id: 1462721 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; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=xfsnBvex; 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 4FF3FY53r4z9sRf for ; Tue, 6 Apr 2021 20:10:57 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4E65D8168B; Tue, 6 Apr 2021 12:10:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1617703832; bh=L8Da5iKJHn/jyAcLlG0pV83KRLh2jA06Ca4vOqR+y0Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=xfsnBvexJY9A/faa2h3xsEAhkfaPEI/bU7s5TKfz0td9mrFa+eJedNJb3XH8D3S9N ExYWHsnKCsVULwHbofEnzRoHjhrrZ6EvOmPEOHoRlGvexXfo/M2kTjSo6G8St4ddIN CGUknmSpiBMZrUSNCdtG32zr1A2ODspJVoHPGbHJk9EpFM48EQUCzfrle8PLK1VBzb 821B/0PGFe0q9s8h37jBB/sH8aPN0C6MXPfxqEF926sqSBdQs4mNr1gp4zZGNoMZYk U3Ri3HlEVOllVSDYeDzi+AjXT1hh4NN9AG8StI+rcvd6CBnDZRM4b9jaIenkrogqRP bZpmhjkb4iWHg== Received: by phobos.denx.de (Postfix, from userid 109) id 5E37A805B4; Tue, 6 Apr 2021 12:10:27 +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.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mout-u-107.mailbox.org (mout-u-107.mailbox.org [91.198.250.252]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8A4068039D for ; Tue, 6 Apr 2021 12:10:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=sr@denx.de Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-107.mailbox.org (Postfix) with ESMTPS id 4FF3Dv3YlWzQjpK; Tue, 6 Apr 2021 12:10:23 +0200 (CEST) Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter05.heinlein-hosting.de (spamfilter05.heinlein-hosting.de [80.241.56.123]) (amavisd-new, port 10030) with ESMTP id mH5zfc5E9DQh; Tue, 6 Apr 2021 12:10:20 +0200 (CEST) From: Stefan Roese To: u-boot@lists.denx.de Cc: Aaron Williams , Chandrakala Chavva , Bin Meng , Marek Vasut Subject: [PATCH 3/3] usb: xhci: Make debug output better readable and checkpatch clean Date: Tue, 6 Apr 2021 12:10:18 +0200 Message-Id: <20210406101018.30037-3-sr@denx.de> In-Reply-To: <20210406101018.30037-1-sr@denx.de> References: <20210406101018.30037-1-sr@denx.de> MIME-Version: 1.0 X-MBO-SPAM-Probability: X-Rspamd-Score: -1.02 / 15.00 / 15.00 X-Rspamd-Queue-Id: 333DC243 X-Rspamd-UID: 43c6d4 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.4 at phobos.denx.de X-Virus-Status: Clean This change makes debugging a bit easier as the output is better readable with the added space. The explicit le16_to_cpu() is not needed in the output. Also this patch moves the strings into one line to make the patch checkpatch clean. Signed-off-by: Stefan Roese Cc: Aaron Williams Cc: Chandrakala Chavva Cc: Bin Meng Cc: Marek Vasut --- drivers/usb/host/xhci-ring.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 46c137f85781..35bd5cd29e15 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -849,12 +849,9 @@ int xhci_ctrl_tx(struct usb_device *udev, unsigned long pipe, } } - debug("req->requesttype = %d, req->request = %d," - "le16_to_cpu(req->value) = %d," - "le16_to_cpu(req->index) = %d," - "le16_to_cpu(req->length) = %d\n", - req->requesttype, req->request, le16_to_cpu(req->value), - le16_to_cpu(req->index), le16_to_cpu(req->length)); + debug("req->requesttype = %d, req->request = %d, req->value = %d, req->index = %d, req->length = %d\n", + req->requesttype, req->request, le16_to_cpu(req->value), + le16_to_cpu(req->index), le16_to_cpu(req->length)); trb_fields[0] = req->requesttype | req->request << 8 | le16_to_cpu(req->value) << 16;