> -----Original Message----- > From: Jeremy Kerr <jk@xxxxxxxxxxxxxxxxxxxx> > Sent: Wednesday, June 12, 2024 2:24 PM > To: Ryan Chen <ryan_chen@xxxxxxxxxxxxxx>; Neal Liu > <neal_liu@xxxxxxxxxxxxxx>; Greg Kroah-Hartman > <gregkh@xxxxxxxxxxxxxxxxxxx>; Joel Stanley <joel@xxxxxxxxx>; Andrew Jeffery > <andrew@xxxxxxxxxxxxxxxxxxxx> > Cc: linux-usb@xxxxxxxxxxxxxxx; linux-aspeed@xxxxxxxxxxxxxxxx > Subject: Re: [PATCH] usb: gadget: aspeed_udc: fix device address configuration > > 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 Yes, thanks, after review the datasheet, it should be 0:6.