[PATCH] usb: gadget: aspeed_udc: fix device address configuration

Jeremy Kerr jk at codeconstruct.com.au
Wed Jun 12 16:23:32 AEST 2024


Hi Ryan,

> > /* Main config reg */
> > -#define UDC_CFG_SET_ADDR(x)            ((x) & 0x3f)
> > -#define UDC_CFG_ADDR_MASK              (0x3f)
> > +#define UDC_CFG_SET_ADDR(x)            ((x) & UDC_CFG_ADDR_MASK)
> > +#define UDC_CFG_ADDR_MASK              GENMASK(6, 0)
> > 
> 
> It should be GENMASK(5,0), not GENMASK(6, 0), am I  right?

No, that was the bug: we need bits 0:6 (== 0x7f) here.

With the mask of 0:5 (== 0x3f), we don't get the full USB address set.

Cheers,


Jeremy


More information about the Linux-aspeed mailing list