From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: u-boot@lists.denx.de
Subject: [PATCH v3 4/9] usb: xhci: convert to HCS_MAX_PORTS()
Date: Mon, 7 Sep 2020 15:12:02 +0800 [thread overview]
Message-ID: <1599462727-2188-4-git-send-email-chunfeng.yun@mediatek.com> (raw)
In-Reply-To: <1599462727-2188-1-git-send-email-chunfeng.yun@mediatek.com>
Use HCS_MAX_PORTS(p) instead of
((p & HCS_MAX_PORTS_MASK) >> HCS_MAX_PORTS_SHIFT)
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
---
v3: add reviewed-by Bin
v2: no changes
---
drivers/usb/host/xhci.c | 3 +--
include/usb/xhci.h | 2 --
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 51edeb2..5f3a0fb 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1257,8 +1257,7 @@ static int xhci_lowlevel_init(struct xhci_ctrl *ctrl)
return -ENOMEM;
reg = xhci_readl(&hccr->cr_hcsparams1);
- descriptor.hub.bNbrPorts = ((reg & HCS_MAX_PORTS_MASK) >>
- HCS_MAX_PORTS_SHIFT);
+ descriptor.hub.bNbrPorts = HCS_MAX_PORTS(reg);
printf("Register %x NbrPorts %d\n", reg, descriptor.hub.bNbrPorts);
/* Port Indicators */
diff --git a/include/usb/xhci.h b/include/usb/xhci.h
index 3de46cd..cf4c020 100644
--- a/include/usb/xhci.h
+++ b/include/usb/xhci.h
@@ -101,8 +101,6 @@ struct xhci_hccr {
/* bits 8:18, Max Interrupters */
#define HCS_MAX_INTRS(p) (((p) >> 8) & 0x7ff)
/* bits 24:31, Max Ports - max value is 0x7F = 127 ports */
-#define HCS_MAX_PORTS_SHIFT 24
-#define HCS_MAX_PORTS_MASK (0xff << HCS_MAX_PORTS_SHIFT)
#define HCS_MAX_PORTS(p) (((p) >> 24) & 0xff)
/* HCSPARAMS2 - hcs_params2 - bitmasks */
--
1.9.1
next prev parent reply other threads:[~2020-09-07 7:12 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-07 7:11 [PATCH v3 1/9] usb: xhci: add a member hci_version in xhci_ctrl struct Chunfeng Yun
2020-09-07 7:12 ` [PATCH v3 2/9] usb: xhci: create one unified function to calculate TRB TD remainder Chunfeng Yun
2020-09-08 5:41 ` Bin Meng
2020-09-08 7:40 ` Chunfeng Yun
2020-09-07 7:12 ` [PATCH v3 3/9] usb: xhci: add quirks flag to support MediaTek xHCI 0.96 Chunfeng Yun
2020-09-07 7:12 ` Chunfeng Yun [this message]
2020-09-07 7:12 ` [PATCH v3 5/9] usb: xhci: convert to TRB_TYPE() Chunfeng Yun
2020-09-07 7:12 ` [PATCH v3 6/9] usb: xhci: convert to TRB_LEN() and TRB_INTR_TARGET() Chunfeng Yun
2020-09-08 1:30 ` Bin Meng
2020-09-08 7:39 ` Chunfeng Yun
2020-09-07 7:12 ` [PATCH v3 7/9] usb: xhci: convert to TRB_TX_TYPE() Chunfeng Yun
2020-09-08 1:31 ` Bin Meng
2020-09-07 7:12 ` [PATCH v3 8/9] usb: xhci: use macros with parameter to fill ep_info2 Chunfeng Yun
2020-09-08 1:35 ` Bin Meng
2020-09-07 7:12 ` [PATCH v3 9/9] usb: xhci: convert to readx_poll_sleep_timeout() Chunfeng Yun
2020-09-08 1:44 ` Bin Meng
2020-09-08 11:13 ` Marek Vasut
2020-09-08 11:24 ` Chunfeng Yun
2020-09-08 15:45 ` Bin Meng
2020-09-08 16:15 ` Marek Vasut
2020-09-08 16:34 ` Frank Wunderlich
2020-09-08 16:47 ` Marek Vasut
2020-09-08 17:14 ` Frank Wunderlich
2020-09-08 17:30 ` Marek Vasut
2020-09-09 1:55 ` Bin Meng
2020-09-09 10:00 ` Marek Vasut
2020-09-09 13:46 ` Bin Meng
2020-09-09 14:02 ` Marek Vasut
2020-09-09 14:05 ` Bin Meng
2020-09-09 14:16 ` Tom Rini
2020-09-09 14:16 ` Marek Vasut
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1599462727-2188-4-git-send-email-chunfeng.yun@mediatek.com \
--to=chunfeng.yun@mediatek.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox