> Date: Sat, 15 Jun 2024 21:35:30 +0000
> From: Klemens Nanni <k...@openbsd.org>
> 
> Unchartevice 6640MA notebook with amd64 ZHAOXIN KaiXian KX-6640MA CPU.
> 
> https://unchartevice.ru
> https://www.devicekb.com/hardware/pci-vendors/ven_1d17-dev_9083
> 
> BIOS one of three SATA speed modes:
> - Gen1/2: bsd.rd reaches installer, but SSD does not attach
>   ahci0: device not communicating on port 0
> - Gen3:   bsd.rd attaches SSD and hangs after
>   scsibus2 at softraid0: 256 targets
> 
> Diff below adds PCI IDs and disables MSI for the AHCI controller,
> then bsd.rd attaches the SSD and successfully installs to it:
> 
> |@@
> |-ahci0 at pci0 dev 15 function 0 unknown vendor 0x1d17 product 0x9083 rev 
> 0x01: msi, AHCI 1.3.1
> |-ahci0: device not communicating on port 0
> |+ahci0 at pci0 dev 15 function 0 "Zhaoxin StorX AHCI" rev 0x01: apic 9 int 
> 21, AHCI 1.3.1
> |+ahci0: port 0: 6.0Gb/s
> | scsibus0 at ahci0: 32 targets
> |+sd0 at scsibus0 targ 0 lun 0: <ATA, 256GB SSD, V1.3> naa.5000000000000000
> |+sd0: 244198MB, 512 bytes/sector, 500118192 sectors, thin
> |@@
> |-sd0 at scsibus1 targ 1 lun 0: <USB, SanDisk 3.2Gen1, 1.00> removable 
> serial.07815583810735aa43ca
> |-sd0: 29340MB, 512 bytes/sector, 60088320 sectors
> |+sd1 at scsibus1 targ 1 lun 0: <USB, SanDisk 3.2Gen1, 1.00> removable 
> serial.07815583810735aa43ca
> |+sd1: 29340MB, 512 bytes/sector, 60088320 sectors
> 
> Feedback? Objection? OK? on either pcidevs or ahci?

MSIs work for the other devices (e.g. iwm(4) or xhci(4))?

> GENERIC and GENERIC_MP both hang with this diff after
>   cpu0: 4MB 64b/line 16-way L2 cache
> but I haven't looked into that yet.
> 
> 
> Index: dev/pci/pcidevs
> ===================================================================
> RCS file: /cvs/src/sys/dev/pci/pcidevs,v
> diff -u -p -r1.2076 pcidevs
> --- dev/pci/pcidevs   22 May 2024 16:24:59 -0000      1.2076
> +++ dev/pci/pcidevs   15 Jun 2024 20:11:14 -0000
> @@ -352,6 +352,7 @@ vendor    ROCKCHIP        0x1d87  Rockchip
>  vendor       LONGSYS         0x1d97  Longsys
>  vendor       TEKRAM2         0x1de1  Tekram
>  vendor       AMPERE          0x1def  Ampere
> +vendor       ZHAOXIN         0x1d17  Zhaoxin
>  vendor       KIOXIA          0x1e0f  Kioxia
>  vendor       YMTC            0x1e49  YMTC
>  vendor       SSSTC           0x1e95  SSSTC
> @@ -10038,6 +10039,9 @@ product YMTC PC005            0x1001  PC005
>  
>  /* Zeinet products */
>  product ZEINET 1221          0x0001  1221
> +
> +/* Zhaoxin products */
> +product ZHAOXIN STORX_AHCI   0x9083  StorX AHCI
>  
>  /* Ziatech products */
>  product ZIATECH ZT8905               0x8905  PCI-ST32
> Index: dev/pci/ahci_pci.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/pci/ahci_pci.c,v
> diff -u -p -r1.17 ahci_pci.c
> --- dev/pci/ahci_pci.c        24 May 2024 06:02:53 -0000      1.17
> +++ dev/pci/ahci_pci.c        15 Jun 2024 20:19:30 -0000
> @@ -71,6 +71,8 @@ int                 ahci_intel_attach(struct ahci_soft
>                           struct pci_attach_args *);
>  int                  ahci_samsung_attach(struct ahci_softc *,
>                           struct pci_attach_args *);
> +int                  ahci_storx_attach(struct ahci_softc *,
> +                         struct pci_attach_args *);
>  
>  static const struct ahci_device ahci_devices[] = {
>       { PCI_VENDOR_AMD,       PCI_PRODUCT_AMD_HUDSON2_SATA_1,
> @@ -148,7 +150,10 @@ static const struct ahci_device ahci_dev
>           NULL,               ahci_samsung_attach },
>  
>       { PCI_VENDOR_VIATECH,   PCI_PRODUCT_VIATECH_VT8251_SATA,
> -       ahci_no_match,        ahci_vt8251_attach }
> +       ahci_no_match,        ahci_vt8251_attach },
> +
> +     { PCI_VENDOR_ZHAOXIN,   PCI_PRODUCT_ZHAOXIN_STORX_AHCI,
> +       NULL,                 ahci_storx_attach },
>  };
>  
>  int                  ahci_pci_match(struct device *, void *, void *);
> @@ -279,6 +284,19 @@ ahci_samsung_attach(struct ahci_softc *s
>        * as the XP941 SSD controller.
>        * https://bugzilla.kernel.org/show_bug.cgi?id=60731
>        * https://bugzilla.kernel.org/show_bug.cgi?id=89171
> +      */
> +     sc->sc_flags |= AHCI_F_NO_MSI;
> +
> +     return (0);
> +}
> +
> +int
> +ahci_storx_attach(struct ahci_softc *sc, struct pci_attach_args *pa)
> +{
> +     /*
> +      * Disable MSI with the ZX-100/ZX-200/ZX-E StorX AHCI Controller
> +      * in the Unchartevice 6640MA notebook, otherwise ahci(4) hangs
> +      * with SATA speed set to "Gen3" in BIOS.
>        */
>       sc->sc_flags |= AHCI_F_NO_MSI;
>  
> 
> 
> OpenBSD 7.5-current (RAMDISK_CD) #127: Fri Jun 14 09:55:04 MDT 2024
>     dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/RAMDISK_CD
> real mem = 8026165248 (7654MB)
> avail mem = 7778664448 (7418MB)
> random: good seed from bootblocks
> mainbus0 at root
> bios0 at mainbus0: SMBIOS rev. 3.1 @ 0x9648a000 (37 entries)
> bios0: vendor Byosoft version "R20" date 05/06/2022
> bios0: IP3 Tech. ZEN1
> acpi0 at bios0: ACPI 6.0
> acpi0: tables DSDT FACP SLIC UEFI HPET APIC MCFG DMAR FPDT BGRT
> acpihpet0 at acpi0: 14318179 Hz
> acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
> cpu0 at mainbus0: apid 0 (boot processor)
> cpu0: ZHAOXIN KaiXian KX-6640MA@2.2+GHz, 2594.84 MHz, 07-0b-00
> cpu0: cpuid 1 
> edx=bfcbfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
>  
> ecx=77da63eb<SSE3,PCLMUL,MWAIT,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PCID,SSE4.1,SSE4.2,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND>
> cpu0: cpuid 6 eax=3<SENSOR> ecx=1<EFFFREQ>
> cpu0: cpuid 7.0 
> ebx=c258b<FSGSBASE,TSC_ADJUST,BMI1,SMEP,BMI2,INVPCID,RDSEED,ADX> ecx=4<UMIP> 
> edx=20000000
> cpu0: cpuid a vers=2, gp=4, gpwidth=48, ff=3, ffwidth=48
> cpu0: cpuid d.1 eax=1<XSAVEOPT>
> cpu0: cpuid 80000001 edx=2c100800<NXE,PAGE1GB,RDTSCP,LONG> 
> ecx=121<LAHF,ABM,3DNOWP>
> cpu0: cpuid 80000007 edx=100<ITSC>
> cpu0: 32KB 64b/line 8-way D-cache, 32KB 64b/line 8-way I-cache
> cpu0: 4MB 64b/line 16-way L2 cache
> cpu0: apic clock running at 99MHz
> cpu0: RNG AES AES-CTR SHA1 SHA256 RSA
> cpu0: mwait min=64, max=64, C-substates=0.2.2.2.2, IBE
> cpu at mainbus0: not configured
> cpu at mainbus0: not configured
> cpu at mainbus0: not configured
> ioapic0 at mainbus0: apid 9 pa 0xfec00000, version 3, 24 pins
> ioapic1 at mainbus0: apid 10 pa 0xfecc0000, version 3, 24 pins
> acpiprt0 at acpi0: bus 0 (PCI0)
> acpiprt1 at acpi0: bus 1 (NPE0)
> acpiprt2 at acpi0: bus 2 (NPE4)
> acpiprt3 at acpi0: bus 3 (NPE5)
> acpiprt4 at acpi0: bus 4 (NPE6)
> acpiprt5 at acpi0: bus 5 (NPE7)
> acpiec0 at acpi0
> acpipci0 at acpi0 PCI0: 0x00000010 0x00000011 0x00000000
> acpicmos0 at acpi0
> "PNP0C0E" at acpi0 not configured
> "PNP0C0D" at acpi0 not configured
> "ACPI0003" at acpi0 not configured
> "PNP0C0A" at acpi0 not configured
> "PNP0C0C" at acpi0 not configured
> acpicpu at acpi0 not configured
> acpipwrres at acpi0 not configured
> pci0 at mainbus0 bus 0
> pchb0 at pci0 dev 0 function 0 unknown vendor 0x1d17 product 0x1003 rev 0x80
> pchb1 at pci0 dev 0 function 1 unknown vendor 0x1d17 product 0x31b0 rev 0x04
> pchb2 at pci0 dev 0 function 2 unknown vendor 0x1d17 product 0x31b1 rev 0x04
> pchb3 at pci0 dev 0 function 3 unknown vendor 0x1d17 product 0x31b2 rev 0x04
> pchb4 at pci0 dev 0 function 4 unknown vendor 0x1d17 product 0x31b3 rev 0x04
> pchb5 at pci0 dev 0 function 5 unknown vendor 0x1d17 product 0x31b4 rev 0x04
> pchb6 at pci0 dev 0 function 6 unknown vendor 0x1d17 product 0x31b5 rev 0x04
> unknown vendor 0x1d17 product 0x3a04 (class display subclass VGA, rev 0x00) 
> at pci0 dev 1 function 0 not configured
> unknown vendor 0x1d17 product 0x9144 (class multimedia subclass hdaudio, rev 
> 0x00) at pci0 dev 1 function 1 not configured
> ppb0 at pci0 dev 3 function 0 unknown vendor 0x1d17 product 0x0717 rev 0x01: 
> msi
> pci1 at ppb0 bus 1
> ppb1 at pci0 dev 4 function 0 unknown vendor 0x1d17 product 0x071b rev 0x01: 
> msi
> pci2 at ppb1 bus 2
> ppb2 at pci0 dev 4 function 1 unknown vendor 0x1d17 product 0x071c rev 0x01: 
> msi
> pci3 at ppb2 bus 3
> ppb3 at pci0 dev 5 function 0 unknown vendor 0x1d17 product 0x071d rev 0x01: 
> msi
> pci4 at ppb3 bus 4
> iwm0 at pci4 dev 0 function 0 "Intel AC 7265" rev 0x59, msi
> ppb4 at pci0 dev 5 function 1 unknown vendor 0x1d17 product 0x071e rev 0x01: 
> msi
> pci5 at ppb4 bus 5
> ahci0 at pci0 dev 15 function 0 unknown vendor 0x1d17 product 0x9083 rev 
> 0x01: msi, AHCI 1.3.1
> ahci0: device not communicating on port 0
> scsibus0 at ahci0: 32 targets
> uhci0 at pci0 dev 16 function 0 unknown vendor 0x1d17 product 0x3038 rev 
> 0xa0: apic 9 int 20
> uhci1 at pci0 dev 16 function 1 unknown vendor 0x1d17 product 0x3038 rev 
> 0xa0: apic 9 int 22
> ehci0 at pci0 dev 16 function 7 unknown vendor 0x1d17 product 0x3104 rev 
> 0x90: apic 9 int 21
> usb0 at ehci0: USB revision 2.0
> uhub0 at usb0 configuration 1 interface 0 "vendor 0x1d17 EHCI root hub" rev 
> 2.00/1.00 addr 1
> unknown vendor 0x1d17 product 0x1001 (class bridge subclass ISA, rev 0x03) at 
> pci0 dev 17 function 0 not configured
> pchb7 at pci0 dev 17 function 7 unknown vendor 0x1d17 product 0x31b7 rev 0x04
> xhci0 at pci0 dev 18 function 0 unknown vendor 0x1d17 product 0x9204 rev 
> 0x00: msi, xHCI 1.10
> usb1 at xhci0: USB revision 3.0
> uhub1 at usb1 configuration 1 interface 0 "vendor 0x1d17 xHCI root hub" rev 
> 3.00/1.00 addr 1
> unknown vendor 0x1d17 product 0x3288 (class multimedia subclass hdaudio, rev 
> 0x20) at pci0 dev 20 function 0 not configured
> usb2 at uhci0: USB revision 1.0
> uhub2 at usb2 configuration 1 interface 0 "vendor 0x1d17 UHCI root hub" rev 
> 1.00/1.00 addr 1
> usb3 at uhci1: USB revision 1.0
> uhub3 at usb3 configuration 1 interface 0 "vendor 0x1d17 UHCI root hub" rev 
> 1.00/1.00 addr 1
> isa0 at mainbus0
> com1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
> pckbc0 at isa0 port 0x60/5 irq 1 irq 12
> pckbd0 at pckbc0 (kbd slot)
> wskbd0 at pckbd0: console keyboard
> efifb0 at mainbus0: 1920x1080, 32bpp
> wsdisplay0 at efifb0 mux 1: console (std, vt100 emulation), using wskbd0
> uhub4 at uhub0 port 2 configuration 1 interface 0 "vendor 0x05e3 USB2.0 Hub" 
> rev 2.00/85.36 addr 2
> "Generic USB2.0-CRW" rev 2.00/39.60 addr 3 at uhub4 port 1 not configured
> "Sonix Technology Co., Ltd. USB 2.0 Camera" rev 2.00/1.00 addr 4 at uhub0 
> port 4 not configured
> uhub5 at uhub1 port 2 configuration 1 interface 0 "Generic 4-Port USB 2.1 
> Hub" rev 2.10/1.01 addr 2
> umass0 at uhub1 port 3 configuration 1 interface 0 "USB SanDisk 3.2Gen1" rev 
> 3.20/1.00 addr 3
> umass0: using SCSI over Bulk-Only
> scsibus1 at umass0: 2 targets, initiator 0
> sd0 at scsibus1 targ 1 lun 0: <USB, SanDisk 3.2Gen1, 1.00> removable 
> serial.07815583810735aa43ca
> sd0: 29340MB, 512 bytes/sector, 60088320 sectors
> uhub6 at uhub1 port 4 configuration 1 interface 0 "Generic 4-Port USB 3.1 
> Hub" rev 3.10/1.01 addr 4
> "vendor 0x8087 product 0x0a2a" rev 2.00/0.03 addr 2 at uhub3 port 1 not 
> configured
> softraid0 at root
> scsibus2 at softraid0: 256 targets
> root on rd0a swap on rd0b dump on rd0b
> iwm0: could not read firmware iwm-7265-17 (error 2)
> iwm0: failed to load init firmware
> 
> 

Reply via email to