Synopsis:       Marvell Yukon EC Ultra (88E8056/88E1149) hangs during cold boot
Category:       kernel amd64 i386
Environment:
        System      : OpenBSD 5.0
        Details     : OpenBSD 5.0 (GENERIC.MP) #6: Fri Aug  5 20:23:41 MDT 2011
                         
[email protected]:/usr/src/sys/arch/i386/compile/GENERIC.MP

        Architecture: OpenBSD.i386
        Machine     : i386
Description:
        When a Yukon EC_U (88E8056/88E1149) cold boots, the kernel hangs
        trying to attach the PHY.
How-To-Repeat:
        Cold boot
Fix:
        This is from NetBSD if_msk.c revision 1.22.  I've only used this
        patch with i386 (the problem does exist in amd64).

Index: dev/pci/if_msk.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_msk.c,v
retrieving revision 1.93
diff -u dev/pci/if_msk.c
--- dev/pci/if_msk.c    22 Jun 2011 16:44:27 -0000      1.93
+++ dev/pci/if_msk.c    6 Aug 2011 02:28:10 -0000
@@ -694,6 +694,29 @@
                reg1 |= (SK_Y2_REG1_PHY1_COMA | SK_Y2_REG1_PHY2_COMA);
        else
                reg1&= ~(SK_Y2_REG1_PHY1_COMA | SK_Y2_REG1_PHY2_COMA);
+
+       if (sc->sk_type == SK_YUKON_EC_U) {
+               uint32_t our;
+       
+#if 0
+               CSR_WRITE_2(sc, SK_CSR, SK_CSR_WOL_ON);
+#endif
+       
+               /* enable all clocks. */
+               sk_win_write_4(sc, SK_Y2_PCI_REG(SK_PCI_OURREG3), 0);
+               our = sk_win_read_4(sc, SK_Y2_PCI_REG(SK_PCI_OURREG4));
+               our&= (SK_Y2_REG4_FORCE_ASPM_REQUEST|
+                       SK_Y2_REG4_ASPM_GPHY_LINK_DOWN|
+                       SK_Y2_REG4_ASPM_INT_FIFO_EMPTY|
+                       SK_Y2_REG4_ASPM_CLKRUN_REQUEST);
+               /* Set all bits to 0 except bits 15..12 */
+               sk_win_write_4(sc, SK_Y2_PCI_REG(SK_PCI_OURREG4), our);
+               /* Set to default value */
+               sk_win_write_4(sc, SK_Y2_PCI_REG(SK_PCI_OURREG5), 0);
+       }
+       
+       /* release PHY from PowerDown/Coma mode. */
+
        sk_win_write_4(sc, SK_Y2_PCI_REG(SK_PCI_OURREG1), reg1);

        if (sc->sk_type == SK_YUKON_XL&&   sc->sk_rev>   SK_YUKON_XL_REV_A1)
Index: dev/pci/if_skreg.h
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_skreg.h,v
retrieving revision 1.55
diff -u dev/pci/if_skreg.h
--- dev/pci/if_skreg.h  17 Nov 2010 13:19:39 -0000      1.55
+++ dev/pci/if_skreg.h  6 Aug 2011 02:28:11 -0000
@@ -1475,11 +1475,26 @@
 #define SK_PCI_PWRMGMTCAP      0x004A /* 16 bits */
 #define SK_PCI_PWRMGMTCTRL     0x004C /* 16 bits */
 #define SK_PCI_PME_EVENT       0x004F
+#define SK_PCI_OURREG3         0x0080 /* Yukon EC U */
+#define SK_PCI_OURREG4         0x0084
+#define SK_PCI_OURREG5         0x0088

 #define SK_Y2_REG1_PHY1_PWRD   0x04000000
 #define SK_Y2_REG1_PHY2_PWRD   0x08000000
 #define SK_Y2_REG1_PHY1_COMA   0x10000000
 #define SK_Y2_REG1_PHY2_COMA   0x20000000
+
+/* SK_PCI_OURREG4 32bits (Yukon-ECU only) */
+#define SK_Y2_REG4_TIMER_VALUE_MSK     (0xff<<   16)
+#define SK_Y2_REG4_FORCE_ASPM_REQUEST  0x8000          //__BIT(15)     
+#define SK_Y2_REG4_ASPM_GPHY_LINK_DOWN 0x4000          //__BIT(14)
+#define SK_Y2_REG4_ASPM_INT_FIFO_EMPTY 0x2000          //__BIT(13)
+#define SK_Y2_REG4_ASPM_CLKRUN_REQUEST 0x1000          //__BIT(12)
+#define SK_Y2_REG4_ASPM_FORCE_CLKREQ_ENA       0x10    //__BIT(4)
+#define SK_Y2_REG4_ASPM_CLKREQ_PAD     0x08            //__BIT(3)
+#define SK_Y2_REG4_ASPM_A1_MODE_SELECT 0x04            //__BIT(2)
+#define SK_Y2_REG4_CLK_GATE_PEX_UNIT_ENA       0x02    //__BIT(1)
+#define SK_Y2_REG4_CLK_GATE_ROOT_COR_ENA       0x01    //__BIT(0)

 #define SK_PSTATE_MASK         0x0003
 #define SK_PSTATE_D0           0x0000


dmesg:
OpenBSD 5.0 (GENERIC.MP) #6: Fri Aug  5 20:23:41 MDT 2011
    [email protected]:/usr/src/sys/arch/i386/compile/GENERIC.MP
cpu0: AMD Phenom(tm) 9500 Quad-Core Processor ("AuthenticAMD" 686-class, 512KB 
L2 cache) 2.20 GHz
cpu0: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,MWAIT,CX16,POPCNT
real mem  = 2952196096 (2815MB)
avail mem = 2893836288 (2759MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 01/08/08, BIOS32 rev. 0 @ 0xfa5a0, SMBIOS 
rev. 2.5 @ 0xf0000 (53 entries)
bios0: vendor Phoenix Technologies, LTD version "R02-B1" date 01/08/2008
bios0: Acer Aspire M5100
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SSDT HPET SLIC MCFG APIC
acpi0: wakeup devices USB0(S4) USB1(S4) USB2(S4) USB3(S4) USB4(S4) USB5(S4) 
SBAZ(S4) P2P_(S5) PCE2(S4) PCE3(S4) PCE4(S4) PCE5(S4) PCE6(S4) PCE7(S4) 
PCE8(S4) PS2M(S5) PS2K(S5) PCI0(S5)
acpitimer0 at acpi0: 3579545 Hz, 32 bits
acpihpet0 at acpi0: 14318180 Hz
acpimcfg0 at acpi0 addr 0xe0000000, bus 0-255
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: apic clock running at 199MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: AMD Phenom(tm) 9500 Quad-Core Processor ("AuthenticAMD" 686-class, 512KB 
L2 cache) 2.20 GHz
cpu1: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,MWAIT,CX16,POPCNT
cpu2 at mainbus0: apid 2 (application processor)
cpu2: AMD Phenom(tm) 9500 Quad-Core Processor ("AuthenticAMD" 686-class, 512KB 
L2 cache) 2.20 GHz
cpu2: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,MWAIT,CX16,POPCNT
cpu3 at mainbus0: apid 3 (application processor)
cpu3: AMD Phenom(tm) 9500 Quad-Core Processor ("AuthenticAMD" 686-class, 512KB 
L2 cache) 2.20 GHz
cpu3: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,MWAIT,CX16,POPCNT
ioapic0 at mainbus0: apid 4 pa 0xfec00000, version 21, 24 pins
ioapic0: misconfigured as apic 0, remapped to apid 4
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 3 (P2P_)
acpiprt2 at acpi0: bus 1 (PCE2)
acpiprt3 at acpi0: bus -1 (PCE3)
acpiprt4 at acpi0: bus -1 (PCE4)
acpiprt5 at acpi0: bus -1 (PCE5)
acpiprt6 at acpi0: bus -1 (PCE6)
acpiprt7 at acpi0: bus 2 (PCE7)
acpiprt8 at acpi0: bus -1 (PCE8)
acpiprt9 at acpi0: bus -1 (AGP_)
acpicpu0 at acpi0: PSS
acpicpu1 at acpi0: PSS
acpicpu2 at acpi0: PSS
acpicpu3 at acpi0: PSS
acpitz0 at acpi0: critical temperature is 90 degC
acpibtn0 at acpi0: PWRB
bios0: ROM list: 0xc0000/0xde00! 0xce000/0x1000
cpu0: 2195 MHz: speeds: 2200 1100 MHz
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 "ATI RS690 Host" rev 0x00
ppb0 at pci0 dev 2 function 0 "ATI RS690M PCIE" rev 0x00
pci1 at ppb0 bus 1
vga1 at pci1 dev 0 function 0 "NVIDIA GeForce 210" rev 0xa2
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
azalia0 at pci1 dev 0 function 1 vendor "NVIDIA", unknown product 0x0be3 rev 
0xa1: msi
azalia0: no supported codecs
ppb1 at pci0 dev 7 function 0 "ATI RS690 PCIE" rev 0x00
pci2 at ppb1 bus 2
mskc0 at pci2 dev 0 function 0 "Marvell Yukon 88E8056" rev 0x20, Yukon-2 EC 
Ultra rev. B0 (0x3): apic 4 int 19
msk0 at mskc0 port A: address 00:1c:25:57:71:eb
eephy0 at msk0 phy 0: 88E1149 Gigabit PHY, rev. 1
ahci0 at pci0 dev 18 function 0 "ATI SB600 SATA" rev 0x00: apic 4 int 22, AHCI 
1.1
scsibus0 at ahci0: 32 targets
sd0 at scsibus0 targ 0 lun 0:<ATA, ST3320418AS, CC37>   SCSI3 0/direct fixed 
naa.5000c500195aad79
sd0: 305245MB, 512 bytes/sector, 625142448 sectors
cd0 at scsibus0 targ 1 lun 0:<HL-DT-ST, DVDRAM_GSA-H60N, CA01>   ATAPI 5/cdrom 
removable
ohci0 at pci0 dev 19 function 0 "ATI SB600 USB" rev 0x00: apic 4 int 16, 
version 1.0, legacy support
ohci1 at pci0 dev 19 function 1 "ATI SB600 USB" rev 0x00: apic 4 int 17, 
version 1.0, legacy support
ohci2 at pci0 dev 19 function 2 "ATI SB600 USB" rev 0x00: apic 4 int 18, 
version 1.0, legacy support
ohci3 at pci0 dev 19 function 3 "ATI SB600 USB" rev 0x00: apic 4 int 17, 
version 1.0, legacy support
ohci4 at pci0 dev 19 function 4 "ATI SB600 USB" rev 0x00: apic 4 int 18, 
version 1.0, legacy support
ehci0 at pci0 dev 19 function 5 "ATI SB600 USB2" rev 0x00: apic 4 int 19
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "ATI EHCI root hub" rev 2.00/1.00 addr 1
piixpm0 at pci0 dev 20 function 0 "ATI SBx00 SMBus" rev 0x14: SMI
iic0 at piixpm0
spdmem0 at iic0 addr 0x50: 1GB DDR2 SDRAM non-parity PC2-5300CL5
spdmem1 at iic0 addr 0x51: 1GB DDR2 SDRAM non-parity PC2-5300CL5
spdmem2 at iic0 addr 0x52: 512MB DDR2 SDRAM non-parity PC2-5300CL5
spdmem3 at iic0 addr 0x53: 512MB DDR2 SDRAM non-parity PC2-5300CL5
pciide0 at pci0 dev 20 function 1 "ATI SB600 IDE" rev 0x00: DMA, channel 0 
configured to compatibility, channel 1 configured to compatibility
wd0 at pciide0 channel 0 drive 0:<WDC WD2500JB-00GVC0>
wd0: 16-sector PIO, LBA48, 238475MB, 488397168 sectors
wd0(pciide0:0:0): using PIO mode 4, DMA mode 2, Ultra-DMA mode 5
azalia1 at pci0 dev 20 function 2 "ATI SBx00 HD Audio" rev 0x00: apic 4 int 16
azalia1: codecs: Realtek ALC888
audio0 at azalia1
pcib0 at pci0 dev 20 function 3 "ATI SB600 ISA" rev 0x00
ppb2 at pci0 dev 20 function 4 "ATI SB600 PCI" rev 0x00
pci3 at ppb2 bus 3
"TI TSB43AB23 FireWire" rev 0x00 at pci3 dev 6 function 0 not configured
pchb1 at pci0 dev 24 function 0 "AMD AMD64 10h HyperTransport" rev 0x00
pchb2 at pci0 dev 24 function 1 "AMD AMD64 10h Address Map" rev 0x00
pchb3 at pci0 dev 24 function 2 "AMD AMD64 10h DRAM Cfg" rev 0x00
km0 at pci0 dev 24 function 3 "AMD AMD64 10h Misc Cfg" rev 0x00
pchb4 at pci0 dev 24 function 4 "AMD AMD64 10h Link Cfg" rev 0x00
usb1 at ohci0: USB revision 1.0
uhub1 at usb1 "ATI OHCI root hub" rev 1.00/1.00 addr 1
usb2 at ohci1: USB revision 1.0
uhub2 at usb2 "ATI OHCI root hub" rev 1.00/1.00 addr 1
usb3 at ohci2: USB revision 1.0
uhub3 at usb3 "ATI OHCI root hub" rev 1.00/1.00 addr 1
usb4 at ohci3: USB revision 1.0
uhub4 at usb4 "ATI OHCI root hub" rev 1.00/1.00 addr 1
usb5 at ohci4: USB revision 1.0
uhub5 at usb5 "ATI OHCI root hub" rev 1.00/1.00 addr 1
isa0 at pcib0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
com1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
lpt0 at isa0 port 0x378/4 irq 7
it0 at isa0 port 0x2e/2: IT8718F rev 3, EC port 0x290
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
mtrr: Pentium Pro MTRR support
umass0 at uhub0 port 5 configuration 1 interface 0 "Generic USB2.0-CRW" rev 
2.00/11.22 addr 2
umass0: using SCSI over Bulk-Only
scsibus1 at umass0: 2 targets, initiator 0
sd1 at scsibus1 targ 1 lun 0:<Generic-, Compact Flash, 1.00>   SCSI0 0/direct 
removable
sd2 at scsibus1 targ 1 lun 1:<Generic-, SM/xD-Picture, 1.00>   SCSI0 0/direct 
removable
sd3 at scsibus1 targ 1 lun 2:<Generic-, SD/MMC, 1.00>   SCSI0 0/direct removable
sd4 at scsibus1 targ 1 lun 3:<Generic-, MS/MS-Pro, 1.00>   SCSI0 0/direct 
removable
uhidev0 at uhub3 port 2 configuration 1 interface 0 "Acer IR  Receiver" rev 
1.10/2.03 addr 2
uhidev0: iclass 3/1, 5 report ids
uhid0 at uhidev0 reportid 1: input=4, output=0, feature=0
uhid1 at uhidev0 reportid 2: input=1, output=0, feature=0
uhid2 at uhidev0 reportid 3: input=2, output=0, feature=0
uhid3 at uhidev0 reportid 4: input=1, output=0, feature=0
ukbd0 at uhidev0 reportid 5: 8 modifier keys, 1 key codes
wskbd1 at ukbd0 mux 1
wskbd1: connecting to wsdisplay0
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
scsibus3 at softraid0: 256 targets
root on wd0a swap on wd0b dump on wd0b

usbdevs:
Controller /dev/usb0:
addr 1: high speed, self powered, config 1, EHCI root hub(0x0000), ATI(0x1002), 
rev 1.00
 port 1 powered
 port 2 powered
 port 3 powered
 port 4 powered
 port 5 addr 2: high speed, power 500 mA, config 1, USB2.0-CRW(0x0111), 
Generic(0x0bda), rev 11.22, iSerialNumber 20021111153705700
 port 6 powered
 port 7 powered
 port 8 powered
 port 9 powered
 port 10 powered
Controller /dev/usb1:
addr 1: full speed, self powered, config 1, OHCI root hub(0x0000), ATI(0x1002), 
rev 1.00
 port 1 powered
 port 2 powered
Controller /dev/usb2:
addr 1: full speed, self powered, config 1, OHCI root hub(0x0000), ATI(0x1002), 
rev 1.00
 port 1 powered
 port 2 powered
Controller /dev/usb3:
addr 1: full speed, self powered, config 1, OHCI root hub(0x0000), ATI(0x1002), 
rev 1.00
 port 1 powered
 port 2 addr 2: low speed, power 100 mA, config 1, IR  Receiver(0xe00d), 
Acer(0x147a), rev 2.03
Controller /dev/usb4:
addr 1: full speed, self powered, config 1, OHCI root hub(0x0000), ATI(0x1002), 
rev 1.00
 port 1 powered
 port 2 powered
Controller /dev/usb5:
addr 1: full speed, self powered, config 1, OHCI root hub(0x0000), ATI(0x1002), 
rev 1.00
 port 1 powered
 port 2 powered

Reply via email to