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

Ryan Chen ryan_chen at aspeedtech.com
Wed Jun 12 16:33:19 AEST 2024


> -----Original Message-----
> From: Jeremy Kerr <jk at codeconstruct.com.au>
> Sent: Wednesday, June 12, 2024 2:24 PM
> To: Ryan Chen <ryan_chen at aspeedtech.com>; Neal Liu
> <neal_liu at aspeedtech.com>; Greg Kroah-Hartman
> <gregkh at linuxfoundation.org>; Joel Stanley <joel at jms.id.au>; Andrew Jeffery
> <andrew at codeconstruct.com.au>
> Cc: linux-usb at vger.kernel.org; linux-aspeed at lists.ozlabs.org
> 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.


More information about the Linux-aspeed mailing list