On Tue, Jan 10, 2023 at 09:04:31PM -0500, Lwazi Dube wrote: > My Pandaboard fails to enumerate a USB hard drive (used as a root > device) and panics. Earlier, I had to add a 2s delay to make u-boot > boot from "spinning" USB disks (flash drives are ok). OpenBSD needs > the same change to make hard disk enumeration successful. The hard > drive is plugged directly into one of the two pandaboard USB ports. > When I dd the miniroot-panda-72.img snapshot onto the same disk, there > is no panic and installation is successful. The panic (included at the > end) happens after rebooting. Going through a powered hub panics too. > Only a Y adapter to a port on another machine "fixes" the issue. Once > the enumeration is over this "jumper cable" can be removed. With this > patch, a single pandaboard USB port powers the disk reliably. > Comments?
miod recently had a problem with pandaboard not reliably probing the builtin USB Ethernet. The problem could not be reproduced when using U-Boot from OpenBSD 6.6. It seems to me uhub is the wrong place to make changes. Any delay would be better placed in the omap4 specific omehci.c and not for a specific product id. The omap4 code doesn't use the clock functions for prcm and still has part of the old pre-device tree table driven approach. A clock not being configured or reset not happening could be part of the problem. > > Thanks for reading. > -Lwazi > > Index: sys/dev/usb/uhub.c > =================================================================== > RCS file: /cvs/src/sys/dev/usb/uhub.c,v > retrieving revision 1.97 > diff -u -p -u -p -r1.97 uhub.c > --- sys/dev/usb/uhub.c 4 Sep 2022 08:42:39 -0000 1.97 > +++ sys/dev/usb/uhub.c 11 Jan 2023 00:21:11 -0000 > @@ -44,6 +44,7 @@ > #include <dev/usb/usbdi.h> > #include <dev/usb/usbdi_util.h> > #include <dev/usb/usbdivar.h> > +#include <dev/usb/usbdevs.h> > > #define UHUB_INTR_INTERVAL 255 /* ms */ > > @@ -127,6 +128,7 @@ uhub_attach(struct device *parent, struc > } hd; > int p, port, nports, powerdelay; > struct usbd_interface *iface = uaa->iface; > + usb_device_descriptor_t *dd = usbd_get_device_descriptor(uaa->device); > usb_endpoint_descriptor_t *ed; > struct usbd_tt *tts = NULL; > uint8_t ttthink = 0; > @@ -169,6 +171,11 @@ uhub_attach(struct device *parent, struc > err = usbd_get_hub_descriptor(dev, &hd.hs, 1); > nports = hd.hs.bNbrPorts; > powerdelay = (hd.hs.bPwrOn2PwrGood * UHD_PWRON_FACTOR); > + /* Add extra time for Pandaboard to enable hard disk. */ > + if (UGETW(dd->idVendor) == USB_VENDOR_SMC2 && > + UGETW(dd->idProduct) == USB_PRODUCT_SMC2_LAN9514) { > + powerdelay += 2000; > + } > ttthink = UGETW(hd.hs.wHubCharacteristics) & UHD_TT_THINK; > if (!err && nports > 7) > usbd_get_hub_descriptor(dev, &hd.hs, nports); > Index: sys/dev/usb/usbdevs > =================================================================== > RCS file: /cvs/src/sys/dev/usb/usbdevs,v > retrieving revision 1.752 > diff -u -p -u -p -r1.752 usbdevs > --- sys/dev/usb/usbdevs 9 Nov 2022 10:03:04 -0000 1.752 > +++ sys/dev/usb/usbdevs 11 Jan 2023 00:21:11 -0000 > @@ -4223,6 +4223,7 @@ product SMC2 LAN7801 0x7801 LAN7801 > product SMC2 LAN7850 0x7850 LAN7850 > product SMC2 SMSC9500 0x9500 SMSC9500 > product SMC2 SMSC9505 0x9505 SMSC9505 > +product SMC2 LAN9514 0x9514 LAN9514 > product SMC2 LAN9530 0x9530 LAN9530 > product SMC2 LAN9730 0x9730 LAN9730 > product SMC2 SMSC9500_SAL10 0x9900 SMSC9500 > Index: sys/dev/usb/usbdevs.h > =================================================================== > RCS file: /cvs/src/sys/dev/usb/usbdevs.h,v > retrieving revision 1.764 > diff -u -p -u -p -r1.764 usbdevs.h > --- sys/dev/usb/usbdevs.h 9 Nov 2022 10:03:22 -0000 1.764 > +++ sys/dev/usb/usbdevs.h 11 Jan 2023 00:21:11 -0000 > @@ -1,4 +1,4 @@ > -/* $OpenBSD: usbdevs.h,v 1.764 2022/11/09 10:03:22 robert Exp $ */ > +/* $OpenBSD$ */ > > /* > * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. > @@ -4230,6 +4230,7 @@ > #define USB_PRODUCT_SMC2_LAN7850 0x7850 /* LAN7850 */ > #define USB_PRODUCT_SMC2_SMSC9500 0x9500 /* SMSC9500 */ > #define USB_PRODUCT_SMC2_SMSC9505 0x9505 /* SMSC9505 */ > +#define USB_PRODUCT_SMC2_LAN9514 0x9514 /* LAN9514 */ > #define USB_PRODUCT_SMC2_LAN9530 0x9530 /* LAN9530 */ > #define USB_PRODUCT_SMC2_LAN9730 0x9730 /* LAN9730 */ > #define USB_PRODUCT_SMC2_SMSC9500_SAL10 0x9900 /* SMSC9500 */ > Index: sys/dev/usb/usbdevs_data.h > =================================================================== > RCS file: /cvs/src/sys/dev/usb/usbdevs_data.h,v > retrieving revision 1.758 > diff -u -p -u -p -r1.758 usbdevs_data.h > --- sys/dev/usb/usbdevs_data.h 9 Nov 2022 10:03:22 -0000 1.758 > +++ sys/dev/usb/usbdevs_data.h 11 Jan 2023 00:21:12 -0000 > @@ -1,4 +1,4 @@ > -/* $OpenBSD: usbdevs_data.h,v 1.758 2022/11/09 10:03:22 robert Exp $ */ > +/* $OpenBSD$ */ > > /* > * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. > @@ -10872,6 +10872,10 @@ const struct usb_known_product usb_known > { > USB_VENDOR_SMC2, USB_PRODUCT_SMC2_SMSC9505, > "SMSC9505", > + }, > + { > + USB_VENDOR_SMC2, USB_PRODUCT_SMC2_LAN9514, > + "LAN9514", > }, > { > USB_VENDOR_SMC2, USB_PRODUCT_SMC2_LAN9530, > > ---------------------------------------- > > OpenBSD/armv7 booting ... > arg0 0xc0a2f7fc arg1 0x0 arg2 0xbcdf7000 > Allocating page tables > IRQ stack: p0x80a5e000 v0xc0a5e000 > ABT stack: p0x80a5f000 v0xc0a5f000 > UND stack: p0x80a60000 v0xc0a60000 > SVC stack: p0x80a61000 v0xc0a61000 > Creating L1 page table at 0x80a30000 > Mapping kernel > Constructing L2 page tables > undefined page type 0x2 pa 0x80000000 va 0x80000000 pages 0x2000 attr 0x8 > type 0x7 pa 0x82000000 va 0x82000000 pages 0x5ee6 attr 0x8 > type 0x9 pa 0x87ee6000 va 0x87ee6000 pages 0x34 attr 0x8 > type 0x7 pa 0x87f1a000 va 0x87f1a000 pages 0x100e6 attr 0x8 > type 0x4 pa 0x98000000 va 0x98000000 pages 0x7800 attr 0x8 > type 0x7 pa 0x9f800000 va 0x9f800000 pages 0x1d5f7 attr 0x8 > type 0x2 pa 0xbcdf7000 va 0xbcdf7000 pages 0x18 attr 0x8 > type 0x4 pa 0xbce0f000 va 0xbce0f000 pages 0x1 attr 0x8 > type 0x7 pa 0xbce10000 va 0xbce10000 pages 0x1 attr 0x8 > type 0x2 pa 0xbce11000 va 0xbce11000 pages 0x100 attr 0x8 > type 0x1 pa 0xbcf11000 va 0xbcf11000 pages 0x1d attr 0x8 > type 0x4 pa 0xbcf2e000 va 0xbcf2e000 pages 0x8 attr 0x8 > type 0x6 pa 0xbcf36000 va 0xbcf36000 pages 0x1 attr 0x8000000000000008 > type 0x4 pa 0xbcf37000 va 0xbcf37000 pages 0x3 attr 0x8 > type 0x6 pa 0xbcf3a000 va 0xbcf3a000 pages 0x1 attr 0x8000000000000008 > type 0x4 pa 0xbcf3b000 va 0xbcf3b000 pages 0x1 attr 0x8 > type 0x6 pa 0xbcf3c000 va 0xbcf3c000 pages 0x2 attr 0x8000000000000008 > type 0x4 pa 0xbcf3e000 va 0xbcf3e000 pages 0x1 attr 0x8 > type 0x6 pa 0xbcf3f000 va 0xbcf3f000 pages 0x4 attr 0x8000000000000008 > type 0x4 pa 0xbcf43000 va 0xbcf43000 pages 0xc attr 0x8 > type 0x3 pa 0xbcf4f000 va 0xbcf4f000 pages 0x303f attr 0x8 > type 0x5 pa 0xbff8e000 va 0xbff8e000 pages 0x1 attr 0x8000000000000008 > type 0x3 pa 0xbff8f000 va 0xbff8f000 pages 0x71 attr 0x8 > pmap [ using 916808 bytes of bsd ELF symbol table ] > Copyright (c) 1982, 1986, 1989, 1991, 1993 > The Regents of the University of California. All rights reserved. > Copyright (c) 1995-2022 OpenBSD. All rights reserved. https://www.OpenBSD.org > > OpenBSD 7.2 (GENERIC) #71: Thu Sep 29 11:47:02 MDT 2022 > dera...@armv7.openbsd.org:/usr/src/sys/arch/armv7/compile/GENERIC > real mem = 895234048 (853MB) > avail mem = 868569088 (828MB) > random: boothowto does not indicate good seed > mainbus0 at root: TI OMAP4 PandaBoard-ES > cpu0 at mainbus0 mpidr 0: ARM Cortex-A9 r2p10 > cpu0: 32KB 32b/line 4-way L1 VIPT I-cache, 32KB 32b/line 4-way L1 D-cache > cortex0 at mainbus0 > amptimer0 at cortex0: 396000 kHz > armliicc0 at cortex0: rtl 7 waymask: 0x0000000f > omap0 at mainbus0 > omapid0 at omap0: omap4460 > amptimer0: adjusting clock: new rate 350000 kHz > prcm0 at omap0 rev 0.0 > ampintc0 at mainbus0 nirq 160, ncpu 2: "interrupt-controller" > omwugen0 at mainbus0 > simplebus0 at mainbus0: "ocp" > omsysc0 at simplebus0: "target-module" > omsysc1 at simplebus0: "target-module" > omsysc2 at simplebus0: "target-module" > "l3-noc" at simplebus0 not configured > simplebus1 at simplebus0: "interconnect" > simplebus2 at simplebus1: "segment" > omsysc3 at simplebus2: "target-module" > "counter" at omsysc3 not configured > omsysc4 at simplebus2: "target-module" > simplebus3 at omsysc4: "prm" > omcm0 at simplebus3: "l4_wkup_cm" > omclock0 at omcm0: "clk" > omcm1 at simplebus3: "emu_sys_cm" > omclock1 at omcm1: "clk" > "prm" at simplebus3 not configured > "prm" at simplebus3 not configured > "prm" at simplebus3 not configured > "prm" at simplebus3 not configured > "prm" at simplebus3 not configured > "prm" at simplebus3 not configured > "prm" at simplebus3 not configured > "prm" at simplebus3 not configured > "prm" at simplebus3 not configured > "prm" at simplebus3 not configured > "prm" at simplebus3 not configured > "prm" at simplebus3 not configured > "prm" at simplebus3 not configured > "prm" at simplebus3 not configured > "prm" at simplebus3 not configured > omsysc5 at simplebus2: "target-module" > "scrm" at omsysc5 not configured > omsysc6 at simplebus2: "target-module" > "scm" at omsysc6 not configured > simplebus4 at simplebus1: "segment" > omsysc7 at simplebus4: "target-module" > omgpio0 at omsysc7: rev 0.1 > gpio0 at omgpio0: 32 pins > omsysc8 at simplebus4: "target-module" > omdog0 at omsysc8 rev 0.1 > omsysc9 at simplebus4: "target-module" > "timer" at omsysc9 not configured > omsysc10 at simplebus4: "target-module" > "keypad" at omsysc10 not configured > omsysc11 at simplebus4: "target-module" > pinctrl0 at omsysc11 > simplebus5 at simplebus1: "segment" > simplebus6 at simplebus0: "interconnect" > simplebus7 at simplebus6: "segment" > omsysc12 at simplebus7: "target-module" > simplebus8 at omsysc12: "scm" > syscon0 at simplebus8: "scm_conf" > "control-phy" at simplebus8 not configured > "control-phy" at simplebus8 not configured > omsysc13 at simplebus7: "target-module" > simplebus9 at omsysc13: "cm1" > omcm2 at simplebus9: "mpuss_cm" > omclock2 at omcm2: "clk" > omcm3 at simplebus9: "tesla_cm" > omclock3 at omcm3: "clk" > omcm4 at simplebus9: "abe_cm" > omclock4 at omcm4: "clk" > omsysc14 at simplebus7: "target-module" > simplebus10 at omsysc14: "cm2" > omcm5 at simplebus10: "l4_ao_cm" > omclock5 at omcm5: "clk" > omcm6 at simplebus10: "l3_1_cm" > omclock6 at omcm6: "clk" > omcm7 at simplebus10: "l3_2_cm" > omclock7 at omcm7: "clk" > omcm8 at simplebus10: "ducati_cm" > omclock8 at omcm8: "clk" > omcm9 at simplebus10: "l3_dma_cm" > omclock9 at omcm9: "clk" > omcm10 at simplebus10: "l3_emif_cm" > omclock10 at omcm10: "clk" > omcm11 at simplebus10: "d2d_cm" > omclock11 at omcm11: "clk" > omcm12 at simplebus10: "l4_cfg_cm" > omclock12 at omcm12: "clk" > omcm13 at simplebus10: "l3_instr_cm" > omclock13 at omcm13: "clk" > omcm14 at simplebus10: "ivahd_cm" > omclock14 at omcm14: "clk" > omcm15 at simplebus10: "iss_cm" > omclock15 at omcm15: "clk" > omcm16 at simplebus10: "l3_dss_cm" > omclock16 at omcm16: "clk" > omcm17 at simplebus10: "l3_gfx_cm" > omclock17 at omcm17: "clk" > omcm18 at simplebus10: "l3_init_cm" > omclock18 at omcm18: "clk" > omcm19 at simplebus10: "l4_per_cm" > omclock19 at omcm19: "clock" > omclock20 at omcm19: "clock" > omsysc15 at simplebus7: "target-module" > "dma-controller" at omsysc15 not configured > omsysc16 at simplebus7: "target-module" > "hsi" at omsysc16 not configured > omsysc17 at simplebus7: "target-module" > "usbhstll" at omsysc17 not configured > omsysc18 at simplebus7: "target-module" > omehci0 at omsysc18 > PHY reset operation timed out > usb0 at omehci0: USB revision 2.0 > uhub0 at usb0 configuration 1 interface 0 "TI OMAP EHCI root hub" rev > 2.00/1.00 addr 1 > omsysc19 at simplebus7: "target-module" > "mmu" at omsysc19 not configured > simplebus11 at simplebus6: "segment" > omsysc20 at simplebus11: "target-module" > omsysc21 at simplebus11: "target-module" > omsysc22 at simplebus11: "target-module" > "usb_otg_hs" at omsysc22 not configured > omsysc23 at simplebus11: "target-module" > "ocp2scp" at omsysc23 not configured > omsysc24 at simplebus11: "target-module" > "smartreflex" at omsysc24 not configured > omsysc25 at simplebus11: "target-module" > "smartreflex" at omsysc25 not configured > omsysc26 at simplebus11: "target-module" > "smartreflex" at omsysc26 not configured > omsysc27 at simplebus11: "target-module" > "mailbox" at omsysc27 not configured > omsysc28 at simplebus11: "target-module" > "spinlock" at omsysc28 not configured > simplebus12 at simplebus6: "segment" > omsysc29 at simplebus12: "target-module" > omsysc30 at simplebus12: "target-module" > syscon1 at omsysc30: "omap4_padconf_global" > pinctrl1 at omsysc30 > simplebus13 at simplebus6: "segment" > simplebus14 at simplebus6: "segment" > simplebus15 at simplebus6: "segment" > simplebus16 at simplebus6: "segment" > simplebus17 at simplebus0: "interconnect" > simplebus18 at simplebus17: "segment" > omsysc31 at simplebus18: "target-module" > omsysc32 at simplebus18: "target-module" > com0 at omsysc32: ti16750, 64 byte fifo > com0: console > omsysc33 at simplebus18: "target-module" > "timer" at omsysc33 not configured > omsysc34 at simplebus18: "target-module" > "timer" at omsysc34 not configured > omsysc35 at simplebus18: "target-module" > "timer" at omsysc35 not configured > omsysc36 at simplebus18: "target-module" > "timer" at omsysc36 not configured > omsysc37 at simplebus18: "target-module" > omgpio1 at omsysc37: rev 0.1 > gpio1 at omgpio1: 32 pins > omsysc38 at simplebus18: "target-module" > omgpio2 at omsysc38: rev 0.1 > gpio2 at omgpio2: 32 pins > omsysc39 at simplebus18: "target-module" > omgpio3 at omsysc39: rev 0.1 > gpio3 at omgpio3: 32 pins > omsysc40 at simplebus18: "target-module" > omgpio4 at omsysc40: rev 0.1 > gpio4 at omgpio4: 32 pins > omsysc41 at simplebus18: "target-module" > omgpio5 at omsysc41: rev 0.1 > gpio5 at omgpio5: 32 pins > omsysc42 at simplebus18: "target-module" > tiiic0 at omsysc42 rev 0.11 > iic0 at tiiic0 > "ti,eeprom" at iic0 addr 0x50 not configured > omsysc43 at simplebus18: "target-module" > com1 at omsysc43: ti16750, 64 byte fifo > com1: probed fifo depth: 0 bytes > omsysc44 at simplebus18: "target-module" > com2 at omsysc44: ti16750, 64 byte fifo > com2: probed fifo depth: 0 bytes > omsysc45 at simplebus18: "target-module" > com3 at omsysc45: ti16750, 64 byte fifo > com3: probed fifo depth: 0 bytes > omsysc46 at simplebus18: "target-module" > tiiic1 at omsysc46 rev 0.11 > iic1 at tiiic1 > "ti,twl6030" at iic1 addr 0x48 not configured > "ti,twl6040" at iic1 addr 0x4b not configured > omsysc47 at simplebus18: "target-module" > tiiic2 at omsysc47 rev 0.11 > iic2 at tiiic2 > omsysc48 at simplebus18: "target-module" > omsysc49 at simplebus18: "target-module" > "timer" at omsysc49 not configured > omsysc50 at simplebus18: "target-module" > "timer" at omsysc50 not configured > omsysc51 at simplebus18: "target-module" > omrng0 at omsysc51 > omsysc52 at simplebus18: "target-module" > omsysc53 at simplebus18: "target-module" > "spi" at omsysc53 not configured > omsysc54 at simplebus18: "target-module" > "spi" at omsysc54 not configured > omsysc55 at simplebus18: "target-module" > ommmc0 at omsysc55 > sdmmc0 at ommmc0: 8-bit > omsysc56 at simplebus18: "target-module" > "des" at omsysc56 not configured > omsysc57 at simplebus18: "target-module" > omsysc58 at simplebus18: "target-module" > "1w" at omsysc58 not configured > omsysc59 at simplebus18: "target-module" > omsysc60 at simplebus18: "target-module" > "spi" at omsysc60 not configured > omsysc61 at simplebus18: "target-module" > "spi" at omsysc61 not configured > omsysc62 at simplebus18: "target-module" > omsysc63 at simplebus18: "target-module" > ommmc1 at omsysc63 > sdmmc1 at ommmc1: 4-bit > simplebus19 at simplebus17: "segment" > omsysc64 at simplebus19: "target-module" > tiiic3 at omsysc64 rev 0.11 > iic3 at tiiic3 > omsysc65 at simplebus0: "target-module" > "mpu" at omsysc65 not configured > simplebus20 at simplebus0: "interconnect" > simplebus21 at simplebus20: "segment" > omsysc66 at simplebus21: "target-module" > omsysc67 at simplebus21: "target-module" > omsysc68 at simplebus21: "target-module" > "mcbsp" at omsysc68 not configured > omsysc69 at simplebus21: "target-module" > omsysc70 at simplebus21: "target-module" > omsysc71 at simplebus21: "target-module" > omsysc72 at simplebus21: "target-module" > omdog1 at omsysc72 rev 0.0 > omsysc73 at simplebus21: "target-module" > "mcpdm" at omsysc73 not configured > omsysc74 at simplebus21: "target-module" > "timer" at omsysc74 not configured > omsysc75 at simplebus21: "target-module" > "timer" at omsysc75 not configured > omsysc76 at simplebus21: "target-module" > "timer" at omsysc76 not configured > omsysc77 at simplebus21: "target-module" > "timer" at omsysc77 not configured > omsysc78 at simplebus0: "target-module" > "gpmc" at omsysc78 not configured > omsysc79 at simplebus0: "target-module" > "pmu" at omsysc79 not configured > omsysc80 at simplebus0: "target-module" > "mmu" at omsysc80 not configured > omsysc81 at simplebus0: "target-module" > "dmm" at omsysc81 not configured > omsysc82 at simplebus0: "target-module" > "emif" at omsysc82 not configured > omsysc83 at simplebus0: "target-module" > "emif" at omsysc83 not configured > "dsp" at simplebus0 not configured > "ipu" at simplebus0 not configured > omsysc84 at simplebus0: "target-module" > "aes" at omsysc84 not configured > omsysc85 at simplebus0: "target-module" > "aes" at omsysc85 not configured > omsysc86 at simplebus0: "target-module" > "sham" at omsysc86 not configured > "regulator-abb-mpu" at simplebus0 not configured > "regulator-abb-iva" at simplebus0 not configured > omsysc87 at simplebus0: "target-module" > "dss" at omsysc87 not configured > omsysc88 at simplebus0: "target-module" > "iva" at omsysc88 not configured > "bandgap" at simplebus0 not configured > sdmmc1: can't supply clock > sdmmc1: can't enable card > scsibus0 at sdmmc0: 2 targets, initiator 0 > sd0 at scsibus0 targ 1 lun 0: <SD/MMC, , 0010> removable > sd0: 3823MB, 512 bytes/sector, 7829504 sectors > uhub1 at uhub0 port 1 configuration 1 interface 0 "Standard > Microsystems product 0x9514" rev 2.00/2.00 addr 2 > smsc0 at uhub1 port 1 configuration 1 interface 0 "Standard > Microsystems SMSC9512/14" rev 2.00/2.00 addr 3 > smsc0: address 02:02:01:b3:12:a0 > ukphy0 at smsc0 phy 1: Generic IEEE 802.3u media interface, rev. 3: > OUI 0x0001f0, model 0x000c > uhub1: device problem, disabling port 2 > uhub2 at uhub1 port 3 configuration 1 interface 0 "Genesys Logic > USB2.0 Hub" rev 2.00/7.02 addr 4 > vscsi0 at root > scsibus1 at vscsi0: 256 targets > softraid0 at root > scsibus2 at softraid0: 256 targets > bootfile: sd0a:/bsd > boot device: sd0 > panic: root device (7d9db8caf760d407) not found > Stopped at db_enter: ldrb r15, [r15, r15, ror r15]! > TID PID UID PRFLAGS PFLAGS CPU COMMAND > * 0 0 0 0x10000 0x200 0 swapper > db_enter > rlv=0xc071c350 rfp=0xc0a62fa8 > duid_format > rlv=0xc054b730 rfp=0xc0a62fd0 > diskconf+0x148 > rlv=0xc03e4438 rfp=0xc0a62fe8 > main+0x454 > rlv=0xc05a5974 rfp=0xc0a62ffc > start+0x58 > rlv=0xedfe0dd0 rfp=0xc05a5970 > Bad frame pointer: 0xc05a5970 > https://www.openbsd.org/ddb.html describes the minimum info required in bug > reports. Insufficient info makes it difficult to find and fix bugs. > ddb> > ddb> > ddb> > >