如何开启UART4?
我的配置arch/arm64/boot/dts/freescale/fsl-imx8mm.dtsi中
uart4: serial@30a60000 {
compatible = "fsl,imx8mm-uart",
"fsl,imx6q-uart", "fsl,imx21-uart";
reg = <0x0 0x30a60000 0x0 0x10000>;
interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clk IMX8MM_CLK_UART4_ROOT>,
<&clk IMX8MM_CLK_UART4_ROOT>;
clock-names = "ipg", "per";
dmas = <&sdma1 28 4 0>, <&sdma1 29 4 0>;
dma-names = "rx", "tx";
status = "disabled";
};
arch/arm64/boot/dts/freescale/ok8mm-evk.dts中
pinctrl_uart4: uart4grp {
fsl,pins = <
MX8MM_IOMUXC_UART4_RXD_UART4_DCE_RX 0x140
MX8MM_IOMUXC_UART4_TXD_UART4_DCE_TX 0x140
>;
};
&uart4 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart4>;
assigned-clocks = <&clk IMX8MM_CLK_UART4_SRC>;
assigned-clock-parents = <&clk IMX8MM_SYS_PLL1_80M>;
status = "okay";
};
请教一下,我是不是哪里配置的不对?
开机直接内核崩溃了
以下是日志
U-Boot 2018.03-dirty (Feb 25 2020 - 02:38:23 +0000)
CPU: Freescale i.MX8MMQ rev1.0 1800 MHz (running at 1200 MHz)
CPU: Commercial temperature grade (0C to 95C) at 57C
Reset cause: POR
Model: FSL i.MX8MM EVK board
DRAM:2 GiB
MMC: FSL_SDHC: 0, FSL_SDHC: 1
Loading Environment from MMC... *** Warning - bad CRC, using default environment
OK
Display: MIPI7 (1024x600)
Video: 1024x600x24
360054 bytes read in 13 ms (26.4 MiB/s)
Logo:
Image size : 400 x 300
Bits per pixel: 24
Compression : 0
In: serial
Out: serial
Err: serial
BuildInfo:
- ATF d6451cc
- U-Boot 2018.03-dirty
switch to partitions #0, OK
mmc1(part 0) is current device
flash target is MMC:1
Net: No ethernet found.
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot:0
switch to partitions #0, OK
mmc1(part 0) is current device
** Unable to read file boot.scr **
19749376 bytes read in 243 ms (77.5 MiB/s)
Booting from mmc ...
42845 bytes read in 9 ms (4.5 MiB/s)
## Flattened Device Tree blob at 43000000
Booting using the fdt blob at 0x43000000
reserving fdt memory region: addr=7f000000 size=1000000
Using Device Tree in place at 0000000043000000, end 000000004300d75c
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.14.78 (zys@zys-pc) (gcc version 7.3.0 (GCC)) #1 SMP PREEMPT Wed Aug 19 17:41:42 CST 2020
[ 0.000000] Boot CPU: AArch64 Processor
[ 0.000000] Machine model: Forlinx i.MX8MM EVK board
[ 0.000000] earlycon: ec_imx6q0 at MMIO 0x0000000030890000 (options '115200')
[ 0.000000] bootconsole enabled
[ 0.000000] efi: Getting EFI parameters from FDT:
[ 0.000000] efi: UEFI not found.
[ 0.000000] Reserved memory: created CMA memory pool at 0x0000000056000000, size 640 MiB
[ 0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[ 0.000000] NUMA: No NUMA configuration found
[ 0.000000] NUMA: Faking a node at
[ 0.000000] NUMA: NODE_DATA
[ 0.000000] Zone ranges:
[ 0.000000] DMA
[ 0.000000] Normal empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0:
[ 0.000000] node 0:
[ 0.000000] Initmem setup node 0
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: PSCIv1.1 detected in firmware.
[ 0.000000] psci: Using standard PSCI v0.2 function IDs
[ 0.000000] psci: MIGRATE_INFO_TYPE not supported.
[ 0.000000] psci: SMC Calling Convention v1.1
[ 0.000000] percpu: Embedded 24 pages/cpu @ffff80007ff58000 s57624 r8192 d32488 u98304
[ 0.000000] Detected VIPT I-cache on CPU0
[ 0.000000] CPU features: enabling workaround for ARM erratum 845719
[ 0.000000] Speculative Store Bypass Disable mitigation not required
[ 0.000000] Built 1 zonelists, mobility grouping on.Total pages: 515072
[ 0.000000] Policy zone: DMA
[ 0.000000] Kernel command line: console=ttymxc1,115200 earlycon=ec_imx6q,0x30890000,115200 root=/dev/mmcblk2p2 rootwait rw
[ 0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.000000] Memory: 1368060K/2093056K available (12604K kernel code, 1174K rwdata, 4696K rodata, 768K init, 425K bss, 69636K reserved, 655360K cma-reserved)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] modules : 0xffff000000000000 - 0xffff000008000000 ( 128 MB)
[ 0.000000] vmalloc : 0xffff000008000000 - 0xffff7dffbfff0000 (129022 GB)
[ 0.000000] .text : 0xffff000008080000 - 0xffff000008cd0000 ( 12608 KB)
[ 0.000000] .rodata : 0xffff000008cd0000 - 0xffff000009170000 (4736 KB)
[ 0.000000] .init : 0xffff000009170000 - 0xffff000009230000 ( 768 KB)
[ 0.000000] .data : 0xffff000009230000 - 0xffff000009355a00 (1175 KB)
[ 0.000000] .bss : 0xffff000009355a00 - 0xffff0000093bffb8 ( 426 KB)
[ 0.000000] fixed : 0xffff7dfffe7f9000 - 0xffff7dfffec00000 (4124 KB)
[ 0.000000] PCI I/O : 0xffff7dfffee00000 - 0xffff7dffffe00000 ( 16 MB)
[ 0.000000] vmemmap : 0xffff7e0000000000 - 0xffff800000000000 (2048 GB maximum)
[ 0.000000] 0xffff7e0000000000 - 0xffff7e0002000000 ( 32 MB actual)
[ 0.000000] memory: 0xffff800000000000 - 0xffff800080000000 (2048 MB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000]RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=4.
[ 0.000000]Tasks RCU enabled.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[ 0.000000] GICv3: GIC: Using split EOI/Deactivate mode
[ 0.000000] GICv3: no VLPI support, no direct LPI support
[ 0.000000] ITS: No ITS available, not enabling LPIs
[ 0.000000] GICv3: CPU0: found redistributor 0 region 0:0x0000000038880000
[ 0.000000] i.MX8MM clock driver init done
[ 0.000000] arch_timer: cp15 timer(s) running at 8.00MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 440795202120 ns
[ 0.000004] sched_clock: 56 bits at 8MHz, resolution 125ns, wraps every 2199023255500ns
[ 0.008451] system counter timer init
[ 0.011766] sched_clock: 56 bits at 8MHz, resolution 125ns, wraps every 2199023255500ns
[ 0.019776] clocksource: imx sysctr: mask: 0xffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 440795202120 ns
[ 0.030960] Console: colour dummy device 80x25
[ 0.034628] Calibrating delay loop (skipped), value calculated using timer frequency.. 16.00 BogoMIPS (lpj=32000)
[ 0.044898] pid_max: default: 32768 minimum: 301
[ 0.049596] Security Framework initialized
[ 0.054270] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes)
[ 0.061126] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes)
[ 0.067930] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.074655] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.097890] ASID allocator initialised with 32768 entries
[ 0.105887] Hierarchical SRCU implementation.
[ 0.114446] Cannot find MU entry in device tree
[ 0.116255] CPU identified as i.MX8MM, silicon rev 1.0
[ 0.121379] EFI services will not be available.
[ 0.133870] smp: Bringing up secondary CPUs ...
[ 0.162004] Detected VIPT I-cache on CPU1
[ 0.162040] GICv3: CPU1: found redistributor 1 region 0:0x00000000388a0000
[ 0.162080] CPU1: Booted secondary processor
[ 0.190041] Detected VIPT I-cache on CPU2
[ 0.190062] GICv3: CPU2: found redistributor 2 region 0:0x00000000388c0000
[ 0.190080] CPU2: Booted secondary processor
[ 0.218095] Detected VIPT I-cache on CPU3
[ 0.218111] GICv3: CPU3: found redistributor 3 region 0:0x00000000388e0000
[ 0.218126] CPU3: Booted secondary processor
[ 0.218183] smp: Brought up 1 node, 4 CPUs
[ 0.267995] SMP: Total of 4 processors activated.
[ 0.272721] CPU features: detected feature: GIC system register CPU inte**ce
[ 0.279896] CPU features: detected feature: 32-bit EL0 Support
[ 0.285758] CPU features: detected feature: Kernel page table isolation (KPTI)
[ 0.298516] CPU: All CPU(s) started at EL2
[ 0.299769] alternatives: patching kernel code
[ 0.305598] devtmpfs: initialized
[ 0.312710] random: get_random_u32 called from bucket_table_alloc+0x108/0x260 with crng_init=0
[ 0.319205] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[ 0.328360] futex hash table entries: 1024 (order: 5, 131072 bytes)
[ 0.354071] pinctrl core: initialized pinctrl subsystem
[ 0.357626] DMI not present or invalid.
[ 0.360648] NET: Registered protocol family 16
[ 0.366355] cpuidle: using governor menu
[ 0.369560] vdso: 2 pages (1 code @ ffff000008cd6000, 1 data @ ffff000009234000)
[ 0.376193] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[ 0.394457] DMA: preallocated 256 KiB pool for atomic allocations
[ 0.398500] Serial: AMBA PL011 UART driver
[ 0.405163] imx8mm-pinctrl 30330000.pinctrl: initialized IMX pinctrl driver
[ 0.431200] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[ 0.442955] ACPI: Interpreter disabled.
[ 0.447901] vgaarb: loaded
[ 0.448247] SCSI subsystem initialized
[ 0.452069] usbcore: registered new inte**ce driver usbfs
[ 0.457101] usbcore: registered new inte**ce driver hub
[ 0.462449] usbcore: registered new device driver usb
[ 0.468145] usb_phy_generic usbphynop1: usbphynop1 supply vcc not found, using dummy regulator
[ 0.476402] usb_phy_generic usbphynop2: usbphynop2 supply vcc not found, using dummy regulator
[ 0.492959] bd71837 0-004b: Device ID=0xA1
[ 0.494226] bd71837 0-004b: gpio_intr = 3
[ 0.498332] bd71837 0-004b: chip_irq=72
[ 0.510474] bd71837-pmic bd71837-pmic: regulator register name 'buck1'
[ 0.530635] bd71837-pmic bd71837-pmic: regulator register name 'buck2'
[ 0.550656] bd71837-pmic bd71837-pmic: regulator register name 'buck3'
[ 0.562705] bd71837-pmic bd71837-pmic: regulator register name 'buck4'
[ 0.574706] bd71837-pmic bd71837-pmic: regulator register name 'buck5'
[ 0.586731] bd71837-pmic bd71837-pmic: regulator register name 'buck6'
[ 0.598766] bd71837-pmic bd71837-pmic: regulator register name 'buck7'
[ 0.610789] bd71837-pmic bd71837-pmic: regulator register name 'buck8'
[ 0.622812] bd71837-pmic bd71837-pmic: regulator register name 'ldo1'
[ 0.642855] bd71837-pmic bd71837-pmic: regulator register name 'ldo2'
[ 0.650875] bd71837-pmic bd71837-pmic: regulator register name 'ldo3'
[ 0.670919] bd71837-pmic bd71837-pmic: regulator register name 'ldo4'
[ 0.690956] bd71837-pmic bd71837-pmic: regulator register name 'ldo5'
[ 0.698976] bd71837-pmic bd71837-pmic: regulator register name 'ldo6'
[ 0.719027] bd71837-pmic bd71837-pmic: regulator register name 'ldo7'
[ 0.739072] i2c i2c-0: IMX I2C adapter registered
[ 0.740934] i2c i2c-0: can't use DMA, using PIO instead.
[ 0.746945] i2c i2c-2: IMX I2C adapter registered
[ 0.751016] i2c i2c-2: can't use DMA, using PIO instead.
[ 0.756453] BD71837:bd71837_pmic_interrupt() in.
[ 0.757126] i2c i2c-3: IMX I2C adapter registered
[ 0.757133] i2c i2c-3: can't use DMA, using PIO instead.
[ 0.757582] media: Linux media inte**ce: v0.10
[ 0.757636] Linux video capture inte**ce: v2.00
[ 0.757765] pps_core: LinuxPPS API ver. 1 registered
[ 0.757771] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.757790] PTP clock support registered
[ 0.757998] EDAC MC: Ver: 3.0.0
[ 0.758385] dmi: Firmware registration failed.
[ 0.759399] MU is ready for cross core communication!
[ 0.812870] virtio_rpmsg_bus virtio0: rpmsg host is online
[ 0.816665] BD71837:IRQ_WDOG
[ 0.817055] imx rpmsg driver is registered.
[ 0.817323] Advanced Linux Sound Architecture Driver Initialized.
[ 0.818033] Bluetooth: Core ver 2.22
[ 0.818066] NET: Registered protocol family 31
[ 0.818070] Bluetooth: HCI device and connection manager initialized
[ 0.818083] Bluetooth: HCI socket layer initialized
[ 0.818088] Bluetooth: L2CAP socket layer initialized
[ 0.818108] Bluetooth: SCO socket layer initialized
[ 0.819473] clocksource: Switched to clocksource arch_sys_counter
[ 0.819641] VFS: Disk quotas dquot_6.6.0
[ 0.819706] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[ 0.819851] pnp: PnP ACPI: disabled
[ 0.825836] NET: Registered protocol family 2
[ 0.826469] TCP established hash table entries: 16384 (order: 5, 131072 bytes)
[ 0.826610] TCP bind hash table entries: 16384 (order: 6, 262144 bytes)
[ 0.826966] TCP: Hash tables configured (established 16384 bind 16384)
[ 0.827094] UDP hash table entries: 1024 (order: 3, 32768 bytes)
[ 0.827139] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes)
[ 0.827298] NET: Registered protocol family 1
[ 0.827893] RPC: Registered named UNIX socket transport module.
[ 0.827896] RPC: Registered udp transport module.
[ 0.827898] RPC: Registered tcp transport module.
[ 0.827900] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.943149] BD71837:IRQ_ON_REQ
[ 0.946892] hw perfevents: enabled with armv8_pmuv3 PMU driver, 7 counters available
[ 0.954447] kvm : 8-bit VMID
[ 0.957971] kvm : GICv3: no GICV resource entry
[ 0.961962] kvm : disabling GICv2 emulation
[ 0.966447] kvm : GIC system register CPU inte**ce enabled
[ 0.972357] kvm : vgic interrupt IRQ1
[ 0.976314] kvm : Hyp mode initialized successfully
[ 0.984042] audit: initializing netlink subsys (disabled)
[ 0.986935] audit: type=2000 audit(0.880:1): state=initialized audit_enabled=0 res=1
[ 0.987287] workingset: timestamp_bits=44 max_order=19 bucket_order=0
[ 0.993044] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.993635] NFS: Registering the id_resolver key type
[ 0.993663] Key type id_resolver registered
[ 0.993666] Key type id_legacy registered
[ 0.993676] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[ 0.993697] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[ 0.994229] 9p: Installing v9fs 9p2000 file system support
[ 1.008874] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245)
[ 1.008882] io scheduler noop registered
[ 1.009033] io scheduler cfq registered (default)
[ 1.009038] io scheduler mq-deadline registered
[ 1.009041] io scheduler kyber registered
[ 1.017476] pwm-backlight backlight@0: backlight@0 supply power not found, using dummy regulator
[ 1.020293] imx-sdma 30bd0000.dma-controller: no iram assigned, using external mem
[ 1.029356] imx-sdma 30bd0000.dma-controller: Falling back to user helper
[ 1.032034] imx-sdma 302c0000.dma-controller: no iram assigned, using external mem
[ 1.037319] imx-sdma 302b0000.dma-controller: no iram assigned, using external mem
[ 1.044623] mxs-dma 33000000.dma-apbh: initialized
[ 1.046252] Bus freq driver module loaded
[ 1.050390] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[ 1.053288] 30860000.serial: ttymxc0 at MMIO 0x30860000 (irq = 27, base_baud = 5000000) is a IMX
[ 1.054294] 30880000.serial: ttymxc2 at MMIO 0x30880000 (irq = 28, base_baud = 5000000) is a IMX
[ 1.054978] 30890000.serial: ttymxc1 at MMIO 0x30890000 (irq = 29, base_baud = 1500000) is a IMX
[ 1.147040] console enabled
[ 1.147040] console enabled
[ 1.151521] bootconsole disabled
[ 1.151521] bootconsole disabled
[ 1.161227] Synchronous External Abort: synchronous external abort (0x96000210) at 0xffff00000b810080
[ 1.172115] Internal error: : 96000210 [#1] PREEMPT SMP
[ 1.177340] Modules linked in:
[ 1.180401] CPU: 3 PID: 1 Comm: swapper/0 Not tainted 4.14.78 #1
[ 1.186405] Hardware name: Forlinx i.MX8MM EVK board (DT)
[ 1.191803] task: ffff80007a3b0000 task.stack: ffff000008078000
[ 1.197734] PC is at serial_imx_probe+0x2f0/0x618
[ 1.202439] LR is at serial_imx_probe+0x2e0/0x618
[ 1.207142] pc : [<ffff0000085ae928>] lr : [<ffff0000085ae918>] pstate: 40000145
[ 1.214535] sp : ffff00000807bbf0
[ 1.217848] x29: ffff00000807bbf0 x28: ffff00000921bba8
[ 1.223161] x27: 0000000000000007 x26: ffff80007ad3d380
[ 1.228474] x25: 00000000fffffffa x24: 00000000fffffffa
[ 1.233787] x23: 0000000000000021 x22: ffff80007a737c00
[ 1.239100] x21: ffff80007a737c10 x20: 0000000000000000
[ 1.244413] x19: ffff80007ad67418 x18: 0000000000000001
[ 1.249725] x17: 0000000000000001 x16: 0000000000000000
[ 1.255038] x15: ffffffffffffffff x14: ffffffffffffffff
[ 1.260351] x13: 0000000000000018 x12: 0101010101010101
[ 1.265664] x11: 0000000000000028 x10: 0101010101010101
[ 1.270977] x9 : 0000000000000000 x8 : ffff80007ad3d780
[ 1.276290] x7 : 0000000000000000 x6 : 000000000000003f
[ 1.281603] x5 : 0000000000000000 x4 : ffff00000939de50
[ 1.286916] x3 : 0000000000000000 x2 : ffff00000b810080
[ 1.292229] x1 : ffff80007a3b0000 x0 : ffff00000b810000
[ 1.297543] Process swapper/0 (pid: 1, stack limit = 0xffff000008078000)
[ 1.304242] Call trace:
[ 1.306689] Exception stack(0xffff00000807bab0 to 0xffff00000807bbf0)
[ 1.313130] baa0: ffff00000b810000 ffff80007a3b0000
[ 1.320960] bac0: ffff00000b810080 0000000000000000 ffff00000939de50 0000000000000000
[ 1.328789] bae0: 000000000000003f 0000000000000000 ffff80007ad3d780 0000000000000000
[ 1.336618] bb00: 0101010101010101 0000000000000028 0101010101010101 0000000000000018
[ 1.344447] bb20: ffffffffffffffff ffffffffffffffff 0000000000000000 0000000000000001
[ 1.352276] bb40: 0000000000000001 ffff80007ad67418 0000000000000000 ffff80007a737c10
[ 1.360106] bb60: ffff80007a737c00 0000000000000021 00000000fffffffa 00000000fffffffa
[ 1.367935] bb80: ffff80007ad3d380 0000000000000007 ffff00000921bba8 ffff00000807bbf0
[ 1.375765] bba0: ffff0000085ae918 ffff00000807bbf0 ffff0000085ae928 0000000040000145
[ 1.383594] bbc0: ffff00000807bbe0 ffff00000851bfb4 ffffffffffffffff 0000000000000000
[ 1.391422] bbe0: ffff00000807bbf0 ffff0000085ae928
[ 1.396302] [<ffff0000085ae928>] serial_imx_probe+0x2f0/0x618
[ 1.402052] [<ffff00000864e918>] platform_drv_probe+0x58/0xb8
[ 1.407801] [<ffff00000864ccf8>] driver_probe_device+0x210/0x2d0
[ 1.413809] [<ffff00000864ce74>] __driver_attach+0xbc/0xc0
[ 1.419297] [<ffff00000864ae54>] bus_for_each_dev+0x4c/0x98
[ 1.424869] [<ffff00000864c610>] driver_attach+0x20/0x28
[ 1.430182] [<ffff00000864c160>] bus_add_driver+0x1b8/0x228
[ 1.435755] [<ffff00000864d810>] driver_register+0x60/0xf8
[ 1.441240] [<ffff00000864e868>] __platform_driver_register+0x40/0x48
[ 1.447684] [<ffff0000091adc9c>] imx_serial_init+0x38/0x5c
[ 1.453173] [<ffff000008083c90>] do_one_initcall+0x38/0x128
[ 1.458749] [<ffff000009170d0c>] kernel_init_freeable+0x188/0x22c
[ 1.464846] [<ffff000008cae5b8>] kernel_init+0x10/0x108
[ 1.470071] [<ffff000008084f60>] ret_from_fork+0x10/0x18
[ 1.475385] Code: 2a0003f4 35001620 f9400a60 91020002 (b9400041)
[ 1.481488] ---[ end trace 3b465399d1503b51 ]---
[ 1.486200] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[ 1.486200]
[ 1.495334] SMP: stopping secondary CPUs
[ 1.499258] Kernel Offset: disabled
[ 1.502747] CPU features: 0x080200c
[ 1.506234] Memory Limit: none
[ 1.509290] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[ 1.509290]
[ 62.531585] imx-sdma 30bd0000.dma-controller: external firmware not found, using ROM firmware
页:
[1]