libpayload/xhci: Fix Slot State field width definition

According to the xHCI spec, the Slot State field in the Slot Context
Data Structure is 5 bits wide. So, fix the code to match.

ref. xHCI spec 1.2
section 6.2.2, Figure 6-2: Slot Context Data Structure

BUG=none
TEST=xHCI compiles

Change-Id: I0ae735af3d0840aeee846fa939c37af9aea3dff1
Signed-off-by: Caveh Jalali <caveh@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/45023
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Caveh Jalali 2020-08-28 19:54:45 -07:00 committed by Nico Huber
parent 00ff21f6da
commit b2280149c0
1 changed files with 1 additions and 1 deletions

View File

@ -204,7 +204,7 @@ typedef transfer_ring_t command_ring_t;
#define SC_UADDR_LEN 8 #define SC_UADDR_LEN 8
#define SC_STATE_FIELD f4 /* STATE - Slot State */ #define SC_STATE_FIELD f4 /* STATE - Slot State */
#define SC_STATE_START 27 #define SC_STATE_START 27
#define SC_STATE_LEN 8 #define SC_STATE_LEN 5
#define SC_MASK(tok) MASK(SC_##tok##_START, SC_##tok##_LEN) #define SC_MASK(tok) MASK(SC_##tok##_START, SC_##tok##_LEN)
#define SC_GET(tok, sc) (((sc)->SC_##tok##_FIELD & SC_MASK(tok)) \ #define SC_GET(tok, sc) (((sc)->SC_##tok##_FIELD & SC_MASK(tok)) \
>> SC_##tok##_START) >> SC_##tok##_START)