[U-Boot] usb: dwc2: does not compile in 2016-rc3 when updating from -rc1.

Marek Vasut marex at denx.de
Sun Jan 10 19:13:58 CET 2016


On Sunday, January 10, 2016 at 06:50:21 PM, Pavel Machek wrote:
> On Sun 2016-01-10 14:45:54, Marek Vasut wrote:
> > On Sunday, January 10, 2016 at 01:04:17 PM, Pavel Machek wrote:
> > > On Sun 2016-01-10 12:56:15, Pavel Machek wrote:
> > > > Hi!
> > > > 
> > > > After updating from 2016-rc1, I get this compile error:
> > > >   CC      common/main.o
> > > >   drivers/usb/host/dwc2.c: In function 'usb_lowlevel_init':
> > > >   drivers/usb/host/dwc2.c:1028:40: error: 'CONFIG_USB_DWC2_REG_ADDR'
> > > >   undeclared (first use in this function)
> > > >   
> > > >     priv->regs = (struct dwc2_core_regs *)CONFIG_USB_DWC2_REG_ADDR;
> > > >     
> > > >                                             ^
> > > > 
> > > > make mrproper socfpga_cyclone5_config
> > > > 
> > > > Fixes the problem.
> > > 
> > > Well, it "fixes" the problem by not compiling dwc2.
> > > 
> > > Socfpga clearly wants DWC2:
> > > 
> > > include/configs/socfpga_common.h:#define CONFIG_USB_DWC2
> > > include/configs/socfpga_common.h:#define CONFIG_USB_GADGET_DWC2_OTG
> > > 
> > > But does not contain required address:
> > > 
> > > [pavel at pollux u-boot]$ grep -ri USB_DWC2_REG_ADDR .
> > > ./drivers/usb/host/dwc2.c:  priv->regs = (struct dwc2_core_regs
> > > *)CONFIG_USB_DWC2_REG_ADDR; ./README:		CONFIG_USB_DWC2_REG_ADDR
> > 
> > the
> > 
> > > physical CPU address of the DWC2 ./include/configs/hikey.h:#define
> > > CONFIG_USB_DWC2_REG_ADDR 0xF72C0000
> > > ./include/configs/rpi-common.h:#define CONFIG_USB_DWC2_REG_ADDR
> > > 0x3f980000 ./include/configs/rpi-common.h:#define
> > > CONFIG_USB_DWC2_REG_ADDR 0x20980000
> > > 
> > > Plus, make socfpga_cyclone5_config does not enable USB, which is
> > > probably error.
> > 
> > SoCFPGA is using USB DM , so these base addresses are pulled from OF
> > and are no longer hard-coded.
> > 
> > Pristine u-boot 2016.01-rc4 compiles fine for CV SoCDK. Can you please
> > test mainline _before_ reporting issues ?
> 
> Can you please test mainline before complaining?

Yes I _did_ test mainline AND booted it on the actual board. The USB does work
(if you disable dcache, which is unrelated bug). It would be very nice if you
did the same thing before you start yelling on the list that there is a bug.

The config you use and the one produced by make socfpga_cyclone5_defconfig 
differ. Use the mainline one, otherwise you will observe possible problems.

> With d77a092dd3619ca747fb8290ae8f255e9799aaa6 and attached .config, I
> get the failure. No, CONFIG_DM_USB is not set in the config, which is
> probably the problem.

Again, the problem does not happen if you use mainline config. If you enable
random options, you might run into random problems.

> Maybe socfpga should select DM_USB or depend on it?

u-boot$ git grep DM_USB configs/socfpga_*
configs/socfpga_arria5_defconfig:CONFIG_DM_USB=y
configs/socfpga_cyclone5_defconfig:CONFIG_DM_USB=y
configs/socfpga_de0_nano_soc_defconfig:CONFIG_DM_USB=y
configs/socfpga_mcvevk_defconfig:CONFIG_DM_USB=y
configs/socfpga_sockit_defconfig:CONFIG_DM_USB=y
configs/socfpga_socrates_defconfig:CONFIG_DM_USB=y

So your config is broken or outdated, please update your config.

SoCFPGA should select DM_USB only for boards which use USB, so it's done in
each config on per-board basis for now. Once non-DM DWC2 goes away, DWC2 would 
select CONFIG_DM_USB.

Best regards,
Marek Vasut


More information about the U-Boot mailing list