消息

消息

我有一台装有 PopOs 19.10 的 HP Envy 13-ad001la。读卡器不工作;当我使用时,lspci我得到这是一个 Alcor Micro 设备读取器:

01:00.0 Unassigned class [ff00]: Alcor Micro Device 6625
    Subsystem: Hewlett-Packard Company Device 834a
    Flags: fast devsel, IRQ 255
    Memory at a1200000 (64-bit, non-prefetchable) [disabled] [size=4K]
    Capabilities: [40] Power Management version 3
    Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
    Capabilities: [80] Express Endpoint, MSI 00
    Capabilities: [100] Latency Tolerance Reporting

据我了解,“未分配的类”意味着Linux无法找到该设备的驱动程序。我搜索了对应的驱动,发现驱动是“alcor_pci”(https://cateee.net/lkddb/web-lkddb/MISC_ALCOR_PCI.html)并且它没有加载,所以我使用 modprobe 来加载它。

 ~  lsmod | grep alcor     
alcor_pci              20480  0

但在此之后它仍然无法正常工作,lshw显示以下内容(NO RECLAMADO 意味着未声明):

*-pci:0
             descripción: PCI bridge
             producto: Sunrise Point-LP PCI Express Root Port #5
             fabricante: Intel Corporation
             id físico: 1c
             información del bus: pci@0000:00:1c.0
             versión: f1
             anchura: 32 bits
             reloj: 33MHz
             capacidades: pci normal_decode bus_master cap_list
             configuración: driver=pcieport
             recursos: irq:122 memoria:a1200000-a12fffff
           *-generic NO RECLAMADO
                descripción: Unassigned class
                producto: Alcor Micro
                fabricante: Alcor Micro
                id físico: 0
                información del bus: pci@0000:01:00.0
                versión: 00
                anchura: 64 bits
                reloj: 33MHz
                capacidades: cap_list
                configuración: latency=0
                recursos: memoria:a1200000-a1200fff

有人可以帮我吗?我不知道加载模块后是否需要执行其他操作。

答案1

它无法工作,因为 AU6625 设备 ID 仅添加在linux 5.6

一些司机即使不匹配,也确实支持“强制使用”模块,但我真的不会屏住呼吸让读卡器支持这一点)

答案2

(本文是从法语到英语的自动翻译。)

你好,
我用这张卡的经历:

*"Alcor Micro AU6625 PCI-E Flash card reader controller"*

如果您愿意重新编译您的 Linux 内核,该卡似乎可以与内核中已包含的 AU6621 驱动程序配合得很好(从内核版本 5.5.6 开始)。只需在模块的源代码中“重命名”它,然后重新编译linux内核即可。从内核版本 5.5.9 开始,这对我有用。我已经使用它几个月了,没有(明显的)问题,这些内核版本(5.5.9、5.5.16、5.6.7、5.6.9)

我的环境:

"HP ENVY Laptop 13-ad1xx"
LSPCI
02:00.0 Unassigned class [ff00]: Alcor Micro AU6625 PCI-E Flash card reader controller
Debian
Stock linux kernel: https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.6.7.tar.xz

警告,我不是开发人员,我只是一个喜欢时不时重新编译 Linux 内核的系统管理员。

本文的其余部分假设您已经知道如何重新编译 Linux 内核。否则最好不要继续这个过程;错误地构建内核并运行它可能非常危险,您可能会损坏硬盘驱动器上的所有数据。

提取源代码后,需要在解压的内核源代码的根目录中调整以下文件(通过 shell 命令“$ grep -i -n -r "AU662" *" 找到)。

将所有带有“6621”的引用更改为“6625”。

更改前: $ grep -i -r -n "AU662" *

*drivers/misc/cardreader/alcor_pci.c:5: * Driver for Alcor Micro AU6601 and AU6621 controllers*
*drivers/misc/cardreader/alcor_pci.c:37:static const struct alcor_dev_cfg au6621_cfg = {*
*drivers/misc/cardreader/alcor_pci.c:41:static const struct alcor_dev_cfg au6625_cfg = {*
*drivers/misc/cardreader/alcor_pci.c:48:    { PCI_DEVICE(PCI_ID_ALCOR_MICRO, PCI_ID_AU6621),*
*drivers/misc/cardreader/alcor_pci.c:49:        .driver_data = (kernel_ulong_t)&au6621_cfg },*
*drivers/misc/cardreader/alcor_pci.c:50:    { PCI_DEVICE(PCI_ID_ALCOR_MICRO, PCI_ID_AU6625),*
*drivers/misc/cardreader/alcor_pci.c:51:        .driver_data = (kernel_ulong_t)&au6625_cfg },*
*drivers/misc/cardreader/Kconfig:8:   au6621.*
*drivers/mmc/host/alcor.c:5: * Driver for Alcor Micro AU6601 and AU6621 controllers*
*drivers/mmc/host/alcor.c:892:      /* The clk will not work on au6621. We need to trigger data*
*include/linux/alcor_pci.h:5: * Driver for Alcor Micro AU6601 and AU6621 controllers*
*include/linux/alcor_pci.h:19:#define PCI_ID_AU6621             0x6621*
*include/linux/alcor_pci.h:20:#define PCI_ID_AU6625             0x6625*
*include/linux/alcor_pci.h:36: * 0x10 - ADMA phy address. AU6621 only?*
*include/linux/alcor_pci.h:45: * The au6601 and au6621 have different DMA engines with different issues. One*
*include/linux/alcor_pci.h:46: * For example au6621 engine is triggered by addr change. No other interaction*
*include/linux/alcor_pci.h:54:#define AU6621_DMA_PAGE_CNT           0x05*
*include/linux/alcor_pci.h:57:/* ADMA ctrl? AU6621 only. */*
*include/linux/alcor_pci.h:58:#define AU6621_DMA_CTRL               0x0c*
*include/linux/alcor_pci.h:59:#define AU6621_DMA_ENABLE         BIT(0)*

更改后:

*drivers/misc/cardreader/alcor_pci.c:5: * Driver for Alcor Micro AU6601 and AU6625 controllers*
*drivers/misc/cardreader/alcor_pci.c:37:static const struct alcor_dev_cfg au6625_cfg = {*
*drivers/misc/cardreader/alcor_pci.c:41:/*static const struct alcor_dev_cfg au6625_cfg = {*
*drivers/misc/cardreader/alcor_pci.c:48:    { PCI_DEVICE(PCI_ID_ALCOR_MICRO, PCI_ID_AU6625),*
*drivers/misc/cardreader/alcor_pci.c:49:        .driver_data = (kernel_ulong_t)&au6625_cfg },*
*drivers/misc/cardreader/Kconfig:8:   au6625.*
*drivers/mmc/host/alcor.c:5: * Driver for Alcor Micro AU6601 and AU6625 controllers*
*drivers/mmc/host/alcor.c:892:      /* The clk will not work on au6625. We need to trigger data*
*include/linux/alcor_pci.h:5: * Driver for Alcor Micro AU6601 and AU6625 controllers*
*include/linux/alcor_pci.h:19:#define PCI_ID_AU6621             0x6621*
*include/linux/alcor_pci.h:20:#define PCI_ID_AU6625             0x6625*
*include/linux/alcor_pci.h:36: * 0x10 - ADMA phy address. AU6625 only?*
*include/linux/alcor_pci.h:45: * The au6601 and au6625 have different DMA engines with different issues. One*
*include/linux/alcor_pci.h:46: * For example au6625 engine is triggered by addr change. No other interaction*
*include/linux/alcor_pci.h:54:#define AU6625_DMA_PAGE_CNT           0x05*
*include/linux/alcor_pci.h:57:/* ADMA ctrl? AU6625 only. */*
*include/linux/alcor_pci.h:58:#define AU6625_DMA_CTRL               0x0c*
*include/linux/alcor_pci.h:59:#define AU6625_DMA_ENABLE         BIT(0)*

两个重要注意事项:

  • 从内核 5.6.x 开始,内核中似乎包含了 AU6625 驱动程序的启动,但是这个包含的驱动程序似乎还不能工作(至少在我的配置上,直到我当前使用的 5.6.9 内核) )因此,您必须“注释”或从代码中删除这个新部分。

  • 在这个新编译的内核上重新启动后,“lspci”命令将继续显示“未分配的类...”。
    为我

    02:00.0 未分配类别 [ff00]:Alcor Micro AU6625 PCI-E 闪存卡读卡器控制器

但无论如何,该卡工作得很好,并且像其他卡一样安装在我的文件管理器(Nautilus)中。

消息

May 10 13:35:35 MylapX kernel: [    0.818161] pci 0000:02:00.0: [1aea:6625] type 00 class 0xff0000
May 10 13:35:35 MylapX kernel: [    0.818209] pci 0000:02:00.0: reg 0x10: [mem 0xb4200000-0xb4200fff 64bit]
May 10 13:35:35 MylapX kernel: [    0.818386] pci 0000:02:00.0: supports D1 D2
May 10 13:35:35 MylapX kernel: [    0.818388] pci 0000:02:00.0: PME# supported from D1 D2 D3hot D3cold

May 10 13:35:35 MylapX kernel: [    2.845290] alcor_pci 0000:02:00.0: enabling device (0000 -> 0002)

May 10 13:35:39 MylapX kernel: [    7.617586] mmc0: Skipping voltage switch
May 10 13:35:39 MylapX kernel: [    7.877031] mmc0: new high speed SDXC card at address aaaa
May 10 13:35:39 MylapX kernel: [    7.880661] mmcblk0: mmc0:aaaa ACLCF 119 GiB 
May 10 13:35:39 MylapX kernel: [    7.896324]  mmcblk0: p1

fdisk -l

Disk /dev/mmcblk0: 119.9 GiB, 127865454592 bytes, 249737216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device         Boot Start       End   Sectors   Size Id Type
/dev/mmcblk0p1      32768 249737215 249704448 119.1G  7 HPFS/NTFS/exFAT

$ df -h

Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p1  120G   98G   22G  82% /media/user/3561-6331

相关内容