错误日志
Starting kernel ...
...
[ 2.728750] of_cfs_init
[ 2.731438] of_cfs_init: OK
[ 2.785046] mmc0: ADMA error: 0x02000000
[ 2.789187] mmc0: error -5 whilst initialising MMC card
[ 2.898239] mmc0: ADMA error: 0x02000000
[ 2.904356] mmc0: error -5 whilst initialising MMC card
// 环境
硬件:树莓派4b
内核源码分支:rpi-5.15.y
// 问题解决
修改设备树文件中的dma-ranges
arch/arm/boot/dts/bcm2711-rpi-4-b.dts
/*dma-ranges = <0x0 0xc0000000 0x0 0x00000000 0x40000000>;*/
dma-ranges = <0x00000000 0x00000000 0x00000000 0x00000000 0xfc000000>;
修改后重新编译设备树即可
全部日志如下
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 5.4.81-v7l+ (root@xxx-VirtualBox) (gcc version 4.8.3 20140106 (prerelease) (crosstool-NG linaro-1.13.1-4.8-2014.01 - Linaro GCC 2013.11)) #50 SMP Wed May 5 16:10:48 CEST 2021
[ 0.000000] CPU: ARMv7 Processor [410fd083] revision 3 (ARMv7), cr=30c5383d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
[ 0.000000] OF: fdt: Machine model: Raspberry Pi Compute Module 4
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] Reserved memory: created CMA memory pool at 0x000000002ac00000, size 64 MiB
[ 0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[ 0.000000] percpu: Embedded 20 pages/cpu s49920 r8192 d23808 u81920
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 502528
[ 0.000000] Kernel command line: dwc_otg.lpm_enable=0 earlyprintk console=ttyAMA0,115200 console=tty1 smsc95xx.macaddr=00:00:00:00:00:01 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait noinitrd elevator=deadline bcm2708_fb.fbwidth=1920 bcm2708_fb.fbheight=1080 coherent_pool=1M
[ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] software IO TLB: mapped [mem 0x25400000-0x29400000] (64MB)
[ 0.000000] Memory: 1844776K/2019328K available (10240K kernel code, 739K rwdata, 2816K rodata, 2048K init, 858K bss, 109016K reserved, 65536K cma-reserved, 1232896K highmem)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] ftrace: allocating 31148 entries in 61 pages
[ 0.000000] rcu: Hierarchical RCU implementation.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] GIC: Using split EOI/Deactivate mode
[ 0.000000] random: get_random_bytes called from start_kernel+0x2f8/0x51c with crng_init=0
[ 0.000008] sched_clock: 32 bits at 1000kHz, resolution 1000ns, wraps every 2147483647500ns
[ 0.000031] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275 ns
[ 0.000113] bcm2835: system timer (irq = 17)
[ 0.000809] arch_timer: cp15 timer(s) running at 54.00MHz (phys).
[ 0.000829] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0xc743ce346, max_idle_ns: 440795203123 ns
[ 0.000849] sched_clock: 56 bits at 54MHz, resolution 18ns, wraps every 4398046511102ns
[ 0.000865] Switching to timer-based delay loop, resolution 18ns
[ 0.001102] Console: colour dummy device 80x30
[ 0.001593] printk: console [tty1] enabled
[ 0.001656] Calibrating delay loop (skipped), value calculated using timer frequency.. 108.00 BogoMIPS (lpj=540000)
[ 0.001697] pid_max: default: 32768 minimum: 301
[ 0.001854] LSM: Security Framework initializing
[ 0.002053] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
[ 0.002093] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
[ 0.003309] Disabling memory control group subsystem
[ 0.003449] CPU: Testing write buffer coherency: ok
[ 0.003938] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.004786] Setting up static identity map for 0x200000 - 0x20003c
[ 0.004987] rcu: Hierarchical SRCU implementation.
[ 0.005636] smp: Bringing up secondary CPUs ...
[ 0.006767] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[ 0.008026] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[ 0.009231] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[ 0.009377] smp: Brought up 1 node, 4 CPUs
[ 0.009445] SMP: Total of 4 processors activated (432.00 BogoMIPS).
[ 0.009470] CPU: All CPU(s) started in HYP mode.
[ 0.009493] CPU: Virtualization extensions available.
[ 0.010279] devtmpfs: initialized
[ 0.023852] VFP support v0.3: implementor 41 architecture 3 part 40 variant 8 rev 0
[ 0.024123] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.024170] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[ 0.026566] pinctrl core: initialized pinctrl subsystem
[ 0.027527] NET: Registered protocol family 16
[ 0.031051] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[ 0.031654] audit: initializing netlink subsys (disabled)
[ 0.031910] audit: type=2000 audit(0.030:1): state=initialized audit_enabled=0 res=1
[ 0.032876] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.032909] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.033247] Serial: AMBA PL011 UART driver
[ 0.036458] bcm2835-mbox fe00b880.mailbox: mailbox enabled
[ 0.060861] raspberrypi-firmware soc:firmware: Attached to firmware from 2021-03-26 16:33, variant start
[ 0.070876] raspberrypi-firmware soc:firmware: Firmware hash is edf2e9c318863999c97c50cdb74eee235ede3af5
[ 0.124573] bcm2835-dma fe007000.dma: DMA legacy API manager, dmachans=0x1
[ 0.129283] vgaarb: loaded
[ 0.129757] SCSI subsystem initialized
[ 0.129994] usbcore: registered new interface driver usbfs
[ 0.130066] usbcore: registered new interface driver hub
[ 0.130193] usbcore: registered new device driver usb
[ 0.130513] usb_phy_generic phy: phy supply vcc not found, using dummy regulator
[ 0.132240] clocksource: Switched to clocksource arch_sys_counter
[ 0.890369] VFS: Disk quotas dquot_6.6.0
[ 0.890480] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.890685] FS-Cache: Loaded
[ 0.890899] CacheFiles: Loaded
[ 0.900824] thermal_sys: Registered thermal governor 'step_wise'
[ 0.901164] NET: Registered protocol family 2
[ 0.901913] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[ 0.901965] TCP established hash table entries: 8192 (order: 3, 32768 bytes, linear)
[ 0.902058] TCP bind hash table entries: 8192 (order: 4, 65536 bytes, linear)
[ 0.902146] TCP: Hash tables configured (established 8192 bind 8192)
[ 0.902487] UDP hash table entries: 512 (order: 2, 16384 bytes, linear)
[ 0.902537] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes, linear)
[ 0.902795] NET: Registered protocol family 1
[ 0.903518] RPC: Registered named UNIX socket transport module.
[ 0.903547] RPC: Registered udp transport module.
[ 0.903570] RPC: Registered tcp transport module.
[ 0.903594] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.903627] PCI: CLS 0 bytes, default 64
[ 0.905319] hw perfevents: enabled with armv7_cortex_a15 PMU driver, 7 counters available
[ 0.907462] Initialise system trusted keyrings
[ 0.907687] workingset: timestamp_bits=14 max_order=19 bucket_order=5
[ 0.918546] FS-Cache: Netfs 'nfs' registered for caching
[ 0.919240] NFS: Registering the id_resolver key type
[ 0.919308] Key type id_resolver registered
[ 0.919333] Key type id_legacy registered
[ 0.919366] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[ 0.920488] Key type asymmetric registered
[ 0.920516] Asymmetric key parser 'x509' registered
[ 0.920702] bounce: pool size: 64 pages
[ 0.920763] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[ 0.920990] io scheduler mq-deadline registered
[ 0.921016] io scheduler kyber registered
[ 0.924910] GPIO line 507 (ant1) hogged as output/high
[ 0.926281] GPIO line 511 (ant2) hogged as output/low
[ 0.927406] brcm-pcie fd500000.pcie: host bridge /scb/pcie@7d500000 ranges:
[ 0.927446] brcm-pcie fd500000.pcie: No bus range found for /scb/pcie@7d500000, using [bus 00-ff]
[ 0.927530] brcm-pcie fd500000.pcie: MEM 0x0600000000..0x0603ffffff -> 0x00f8000000
[ 0.927613] brcm-pcie fd500000.pcie: IB MEM 0x0000000000..0x00bfffffff -> 0x0000000000
[ 1.522269] brcm-pcie fd500000.pcie: link down
[ 1.522706] bcm2708_fb soc:fb: Unable to determine number of FBs. Disabling driver.
[ 1.522749] bcm2708_fb: probe of soc:fb failed with error -2
[ 1.526425] Serial: 8250/16550 driver, 1 ports, IRQ sharing enabled
[ 1.529285] iproc-rng200 fe104000.rng: hwrng registered
[ 1.529625] vc-mem: phys_addr:0x00000000 mem_base=0x00000000 mem_size:0x00000000(0 MiB)
[ 1.530298] vc-sm: Videocore shared memory driver
[ 1.530839] gpiomem-bcm2835 fe200000.gpiomem: Initialised: Registers at 0xfe200000
[ 1.542558] brd: module loaded
[ 1.554446] loop: module loaded
[ 1.555806] Loading iSCSI transport class v2.0-870.
[ 1.557743] libphy: Fixed MDIO Bus: probed
[ 1.558355] bcmgenet fd580000.ethernet: failed to get enet clock
[ 1.558389] bcmgenet fd580000.ethernet: GENET 5.0 EPHY: 0x0000
[ 1.558423] bcmgenet fd580000.ethernet: failed to get enet-wol clock
[ 1.558457] bcmgenet fd580000.ethernet: failed to get enet-eee clock
[ 1.558497] bcmgenet: Skipping UMAC reset
[ 1.572277] libphy: bcmgenet MII bus: probed
[ 1.592314] mdio_bus unimac-mdio--19: MDIO device at address 1 is missing.
[ 1.592347] unimac-mdio unimac-mdio.-19: Broadcom UniMAC MDIO bus
[ 1.593348] usbcore: registered new interface driver r8152
[ 1.593428] usbcore: registered new interface driver lan78xx
[ 1.593499] usbcore: registered new interface driver smsc95xx
[ 1.593999] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[ 1.594792] usbcore: registered new interface driver uas
[ 1.594868] usbcore: registered new interface driver usb-storage
[ 1.595082] mousedev: PS/2 mouse device common for all mice
[ 1.596853] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer
[ 1.600118] sdhci: Secure Digital Host Controller Interface driver
[ 1.600147] sdhci: Copyright(c) Pierre Ossman
[ 1.600742] mmc-bcm2835 fe300000.mmcnr: could not get clk, deferring probe
[ 1.601333] sdhci-pltfm: SDHCI platform and OF driver helper
[ 1.605099] ledtrig-cpu: registered to indicate activity on CPUs
[ 1.605411] hidraw: raw HID events driver (C) Jiri Kosina
[ 1.605603] usbcore: registered new interface driver usbhid
[ 1.605629] usbhid: USB HID core driver
[ 1.606660] vchiq: vchiq_init_state: slot_zero = (ptrval)
[ 1.608196] [vc_sm_connected_init]: start
[ 1.614294] [vc_sm_connected_init]: end - returning 0
[ 1.616122] Initializing XFRM netlink socket
[ 1.616172] NET: Registered protocol family 17
[ 1.616286] Key type dns_resolver registered
[ 1.616566] Registering SWP/SWPB emulation handler
[ 1.616895] registered taskstats version 1
[ 1.616927] Loading compiled-in X.509 certificates
[ 1.617436] Key type ._fscrypt registered
[ 1.617463] Key type .fscrypt registered
[ 1.627807] uart-pl011 fe201000.serial: cts_event_workaround enabled
[ 1.627895] fe201000.serial: ttyAMA0 at MMIO 0xfe201000 (irq = 29, base_baud = 0) is a PL011 rev2
[ 2.608756] printk: console [ttyAMA0] enabled
[ 2.619499] fe215040.serial: ttyS0 at MMIO 0x0 (irq = 32, base_baud = 62500000) is a 16550
[ 2.628498] bcm2835-power bcm2835-power: Broadcom BCM2835 power domains driver
[ 2.636658] mmc-bcm2835 fe300000.mmcnr: mmc_debug:0 mmc_debug2:0
[ 2.642710] mmc-bcm2835 fe300000.mmcnr: DMA channel allocated
[ 2.718415] mmc0: SDHCI controller on fe340000.emmc2 [fe340000.emmc2] using ADMA
[ 2.728750] of_cfs_init
[ 2.731438] of_cfs_init: OK
[ 2.785046] mmc0: ADMA error: 0x02000000
[ 2.789187] mmc0: error -5 whilst initialising MMC card
[ 2.898239] mmc0: ADMA error: 0x02000000
[ 2.904356] mmc0: error -5 whilst initialising MMC card
[ 3.009905] mmc0: ADMA error: 0x02000000
[ 3.013965] mmc0: error -5 whilst initialising MMC card
[ 13.341754] mmc0: ADMA error: 0x02000000
[ 13.345871] mmc0: error -5 whilst initialising MMC card
[ 14.478785] mmc0: ADMA error: 0x02000000
[ 14.482809] mmc0: error -5 whilst initialising MMC card
[ 14.563186] random: fast init done
[ 14.582762] mmc0: ADMA error: 0x02000000
[ 14.586798] mmc0: error -5 whilst initialising MMC card
[ 14.688769] mmc0: ADMA error: 0x02000000
[ 14.692823] mmc0: error -5 whilst initialising MMC card
[ 14.811931] mmc0: ADMA error: 0x02000000