我有一台裝有 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
答案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