i.MX6ULL系统移植:Linux移植6 - Linux 内核移植

一、测试 NXP 官方linux

1、解压 NXP 官方 Linux 内核

tar -vxif linux-imx-rel_imx_4.1.15_2.1.0_ga.tar.bz2

2、清除配置

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- distclean

3、配置工程

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- imx_v7_defconfig

4、编译

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- all -j4

5、Linux 内核启动测试

tftp 80800000 zImage 
tftp 83000000 imx6ull-14x14-evk.dtb 
bootz 80800000 - 83000000
=> ping 192.168.6.129
FEC1 Waiting for PHY auto negotiation to complete.... done
Using FEC1 device
host 192.168.6.129 is alive
=> tftp 80800000 zImage
Using FEC1 device
TFTP from server 192.168.6.129; our IP address is 192.168.6.200
Filename 'zImage'.
Load address: 0x80800000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #
         2.4 MiB/s
done
Bytes transferred = 6680416 (65ef60 hex)
=> tftp 83000000 imx6ull-14x14-evk.dtb
Using FEC1 device
TFTP from server 192.168.6.129; our IP address is 192.168.6.200
Filename 'imx6ull-14x14-evk.dtb'.
Load address: 0x83000000
Loading: ###
         1.1 MiB/s
done
Bytes transferred = 35969 (8c81 hex)
=> bootz 80800000 - 83000000
Kernel image @ 0x80800000 [ 0x000000 - 0x65ef60 ]
## Flattened Device Tree blob at 83000000
   Booting using the fdt blob at 0x83000000
   Using Device Tree in place at 83000000, end 8300bc80

Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 4.1.15 (onlylove@ubuntu) (gcc version 4.9.4 (Linaro GCC 4.9-2017.01) ) #1 SMP PREEMPT Sun Nov 14 07:54:32 PST 2021
CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c53c7d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine model: Freescale i.MX6 ULL 14x14 EVK Board
Reserved memory: created CMA memory pool at 0x8c000000, size 320 MiB
Reserved memory: initialized node linux,cma, compatible id shared-dma-pool
Memory policy: Data cache writealloc
PERCPU: Embedded 12 pages/cpu @8bb32000 s16960 r8192 d24000 u49152
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
Kernel command line: console=ttymxc0,115200 root=/dev/nfs ip=dhcp nfsroot=:,v3,tcp
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 178576K/524288K available (8396K kernel code, 446K rwdata, 2928K rodata, 440K init, 450K bss, 18032K reserved, 327680K cma-reserved, 0K highmem)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xa0800000 - 0xff000000   (1512 MB)
    lowmem  : 0x80000000 - 0xa0000000   ( 512 MB)
    pkmap   : 0x7fe00000 - 0x80000000   (   2 MB)
    modules : 0x7f000000 - 0x7fe00000   (  14 MB)
      .text : 0x80008000 - 0x80b17374   (11325 kB)
      .init : 0x80b18000 - 0x80b86000   ( 440 kB)
      .data : 0x80b86000 - 0x80bf5be0   ( 447 kB)
       .bss : 0x80bf8000 - 0x80c68a1c   ( 451 kB)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Preemptible hierarchical RCU implementation.
        Additional per-CPU info printed with stalls.
        RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=1.
RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
NR_IRQS:16 nr_irqs:16 16
mxc_clocksource_init 3000000
Switching to timer-based delay loop, resolution 333ns
sched_clock: 32 bits at 3000kHz, resolution 333ns, wraps every 715827882841ns
clocksource mxc_timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 637086815595 ns
Console: colour dummy device 80x30
Calibrating delay loop (skipped), value calculated using timer frequency.. 6.00 BogoMIPS (lpj=30000)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
/cpus/cpu@0 missing clock-frequency property
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x80008280 - 0x800082d8
Brought up 1 CPUs
SMP: Total of 1 processors activated (6.00 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
device-tree: Duplicate name in lcdif@021c8000, renamed to "display#1"
VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
clocksource jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor ladder
cpuidle: using governor menu
hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 8 bytes.
imx6ul-pinctrl 20e0000.iomuxc: initialized IMX pinctrl driver
imx6ul-pinctrl 2290000.iomuxc-snvs: initialized IMX pinctrl driver
mxs-dma 1804000.dma-apbh: initialized
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
i2c i2c-0: IMX I2C adapter registered
i2c i2c-0: can't use DMA
i2c i2c-1: IMX I2C adapter registered
i2c i2c-1: can't use DMA
Linux video capture interface: v2.00
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
PTP clock support registered
MIPI CSI2 driver module loaded
Advanced Linux Sound Architecture Driver Initialized.
Bluetooth: Core ver 2.20
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Bluetooth: L2CAP socket layer initialized
Bluetooth: SCO socket layer initialized
Switched to clocksource mxc_timer1
NET: Registered protocol family 2
TCP established hash table entries: 4096 (order: 2, 16384 bytes)
TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
UDP hash table entries: 256 (order: 1, 8192 bytes)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
imx rpmsg driver is registered.
Bus freq driver module loaded
futex hash table entries: 256 (order: 2, 16384 bytes)
VFS: Disk quotas dquot_6.6.0
VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
NFS: Registering the id_resolver key type
Key type id_resolver registered
Key type id_legacy registered
jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
fuse init (API version 7.23)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
imx-weim 21b8000.weim: Driver registered.
backlight supply power not found, using dummy regulator
MIPI DSI driver module loaded
MIPI DSI driver module loaded
21c8000.lcdif supply lcd not found, using dummy regulator
mxsfb 21c8000.lcdif: failed to find mxc display driver
Console: switching to colour frame buffer device 60x34
mxsfb 21c8000.lcdif: initialized
imx-sdma 20ec000.sdma: no event needs to be remapped
imx-sdma 20ec000.sdma: loaded firmware 3.3
imx-sdma 20ec000.sdma: initialized
2020000.serial: ttymxc0 at MMIO 0x2020000 (irq = 18, base_baud = 5000000) is a IMX
console [ttymxc0] enabled
21e8000.serial: ttymxc1 at MMIO 0x21e8000 (irq = 235, base_baud = 5000000) is a IMX
imx-rng 2284000.rngb: iMX RNG Registered.
imx sema4 driver is registered.
[drm] Initialized drm 1.1.0 20060810
[drm] Initialized vivante 1.0.0 20120216 on minor 0
brd: module loaded
loop: module loaded
fsl-quadspi 21e0000.qspi: unrecognized JEDEC id bytes: ff, ff, ff
fsl-quadspi 21e0000.qspi: Freescale QuadSPI probe failed
spi_gpio spi4: gpio-miso property not found, switching to no-rx mode
CAN device driver interface
flexcan 2090000.can: device registered (reg_base=a09f8000, irq=27)
flexcan 2094000.can: device registered (reg_base=a0a00000, irq=28)
20b4000.ethernet supply phy not found, using dummy regulator
pps pps0: new PPS source ptp0
libphy: fec_enet_mii_bus: probed
fec 20b4000.ethernet eth0: registered PHC device 0
2188000.ethernet supply phy not found, using dummy regulator
pps pps1: new PPS source ptp1
fec 2188000.ethernet eth1: registered PHC device 1
usbcore: registered new interface driver asix
usbcore: registered new interface driver ax88179_178a
usbcore: registered new interface driver cdc_ether
usbcore: registered new interface driver net1080
usbcore: registered new interface driver cdc_subset
usbcore: registered new interface driver zaurus
usbcore: registered new interface driver cdc_ncm
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-mxc: Freescale On-Chip EHCI Host driver
usbcore: registered new interface driver usb-storage
usbcore: registered new interface driver usb_ehset_test
2184800.usbmisc supply vbus-wakeup not found, using dummy regulator
2184000.usb supply vbus not found, using dummy regulator
2184200.usb supply vbus not found, using dummy regulator
ci_hdrc ci_hdrc.1: EHCI Host Controller
ci_hdrc ci_hdrc.1: new USB bus registered, assigned bus number 1
ci_hdrc ci_hdrc.1: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
mousedev: PS/2 mouse device common for all mice
input: 20cc000.snvs:snvs-powerkey as /devices/platform/soc/2000000.aips-bus/20cc000.snvs/20cc000.snvs:snvs-powerkey/input/input0
input: iMX6UL TouchScreen Controller as /devices/platform/soc/2000000.aips-bus/2040000.tsc/input/input1
read sensor who am i (0x0)error !
fxls8471: probe of 0-001e failed with error -22
snvs_rtc 20cc000.snvs:snvs-rtc-lp: rtc core: registered 20cc000.snvs:snvs-r as rtc0
i2c /dev entries driver
IR NEC protocol handler initialized
IR RC5(x/sz) protocol handler initialized
IR RC6 protocol handler initialized
IR JVC protocol handler initialized
IR Sony protocol handler initialized
IR SANYO protocol handler initialized
IR Sharp protocol handler initialized
IR MCE Keyboard/mouse protocol handler initialized
IR XMP protocol handler initialized
pxp-v4l2 pxp_v4l2: initialized
0-000e supply vdd not found, using dummy regulator
0-000e supply vddio not found, using dummy regulator
mag3110 0-000e: check mag3110 chip ID
mag3110 0-000e: read chip ID 0xfffffffb is not equal to 0xc4!
mag3110: probe of 0-000e failed with error -22
imx2-wdt 20bc000.wdog: use WDOG_B to reboot.
imx2-wdt 20bc000.wdog: timeout 60 sec (nowayout=0)
Bluetooth: HCI UART driver ver 2.3
Bluetooth: HCI UART protocol H4 registered
Bluetooth: HCI UART protocol BCSP registered
Bluetooth: HCI UART protocol ATH3K registered
usbcore: registered new interface driver bcm203x
usbcore: registered new interface driver btusb
usbcore: registered new interface driver ath3k
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
/soc/aips-bus@02100000/usdhc@02190000: voltage-ranges unspecified
sdhci-esdhc-imx 2190000.usdhc: Got CD GPIO
sdhci-esdhc-imx 2190000.usdhc: No vqmmc regulator found
mmc0: SDHCI controller on 2190000.usdhc [2190000.usdhc] using ADMA
/soc/aips-bus@02100000/usdhc@02194000: voltage-ranges unspecified
sdhci-esdhc-imx 2194000.usdhc: could not get ultra high speed state, work on normal mode
sdhci-esdhc-imx 2194000.usdhc: No vmmc regulator found
sdhci-esdhc-imx 2194000.usdhc: No vqmmc regulator found
usb 1-1: new high-speed USB device number 2 using ci_hdrc
mmc1: SDHCI controller on 2194000.usdhc [2194000.usdhc] using ADMA
mmc0: host does not support reading read-only switch, assuming write-enable
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
fsl-asrc 2034000.asrc: driver registered
imx-wm8960 sound: wm8960-hifi <-> 202c000.sai mapping ok
imx-wm8960 sound: snd-soc-dummy-dai <-> 2034000.asrc mapping ok
imx-wm8960 sound: wm8960-hifi <-> 202c000.sai mapping ok
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 4 ports detected
mmc0: new ultra high speed SDR104 SDHC card at address aaaa
mmcblk0: mmc0:aaaa SC16G 14.8 GiB
 mmcblk0: p1
NET: Registered protocol family 26
NET: Registered protocol family 10
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
can: controller area network core (rev 20120528 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20120528)
can: broadcast manager protocol (rev 20120528 t)
can: netlink gateway (rev 20130117) max_hops=1
Bluetooth: RFCOMM TTY layer initialized
Bluetooth: RFCOMM socket layer initialized
Bluetooth: RFCOMM ver 1.11
Bluetooth: BNEP (Ethernet Emulation) ver 1.3
Bluetooth: BNEP filters: protocol multicast
Bluetooth: BNEP socket layer initialized
Bluetooth: HIDP (Human Interface Emulation) ver 1.2
Bluetooth: HIDP socket layer initialized
8021q: 802.1Q VLAN Support v1.8
Key type dns_resolver registered
mmc1: MAN_BKOPS_EN bit is not set
dhd_module_init in
snvs_rtc 20cc000.snvs:snvs-rtc-lp: setting system clock to 1970-01-01 07:26:04 UTC (26764)
mmc1: new DDR MMC card at address 0001
mmcblk1: mmc1:0001 8GTF4R 7.28 GiB
mmcblk1boot0: mmc1:0001 8GTF4R partition 1 4.00 MiB
IP-Config: Failed to open eth0
mmcblk1boot1: mmc1:0001 8GTF4R partition 2 4.00 MiB
mmcblk1rpmb: mmc1:0001 8GTF4R partition 3 512 KiB
IP-Config: Failed to open eth1
IP-Config: No network devices available
gpio_dvfs: disabling
can-3v3: disabling
ALSA device list:
  #0: wm8960-audio
 mmcblk1: p1 p2
Root-NFS: no NFS server address
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "nfs" or unknown-block(2,0): error -6
Please append a correct "root=" boot option; here are the available partitions:
0100           65536 ram0  (driver?)
0101           65536 ram1  (driver?)
0102           65536 ram2  (driver?)
0103           65536 ram3  (driver?)
0104           65536 ram4  (driver?)
0105           65536 ram5  (driver?)
0106           65536 ram6  (driver?)
0107           65536 ram7  (driver?)
0108           65536 ram8  (driver?)
0109           65536 ram9  (driver?)
010a           65536 ram10  (driver?)
010b           65536 ram11  (driver?)
010c           65536 ram12  (driver?)
010d           65536 ram13  (driver?)
010e           65536 ram14  (driver?)
010f           65536 ram15  (driver?)
b300        15558144 mmcblk0  driver: mmcblk
  b301        15554048 mmcblk0p1 c41dc538-01
b308         7634944 mmcblk1  driver: mmcblk
  b309           32768 mmcblk1p1 2663a867-01
  b30a         7601152 mmcblk1p2 2663a867-02
b320             512 mmcblk1rpmb  (driver?)
b318            4096 mmcblk1boot1  (driver?)
b310            4096 mmcblk1boot0  (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)

二、在 Linux 中添加自己的开发板

1、添加开发板默认配置文件

arch/arm/configs 目 录 下 的 imx_v7_defconfig 重 新 复 制 一 份 , 命 名 为 imx_lq_defconfig,命令如下:

cp imx_v7_defconfig imx_lq_defconfig

2、添加开发板对应的设备树文件

进入目录 arch/arm/boot/dts 中,复制一份 imx6ull-14x14-evk.dts,然后将其重命名为 imx6ull-lq-evk.dts,命令如下:

cp imx6ull-14x14-evk.dts imx6ull-lq-evk.dts

.dts 是设备树源码文件,编译 Linux 的时候会将其编译为 .dtb 文件。

修改 arch/arm/boot/dts/Makefile 找 到 dtb$(CONFIG_SOC_IMX6ULL) 配置项,在此配置项中加入 imx6ull-lq-evk.dtb,如下 所示:

dtb-$(CONFIG_SOC_IMX6ULL) += \
	imx6ull-14x14-ddr3-arm2.dtb \
	imx6ull-14x14-ddr3-arm2-adc.dtb \
	imx6ull-14x14-ddr3-arm2-cs42888.dtb \
	imx6ull-14x14-ddr3-arm2-ecspi.dtb \
	imx6ull-14x14-ddr3-arm2-emmc.dtb \
	imx6ull-14x14-ddr3-arm2-epdc.dtb \
	imx6ull-14x14-ddr3-arm2-flexcan2.dtb \
	imx6ull-14x14-ddr3-arm2-gpmi-weim.dtb \
	imx6ull-14x14-ddr3-arm2-lcdif.dtb \
	imx6ull-14x14-ddr3-arm2-ldo.dtb \
	imx6ull-14x14-ddr3-arm2-qspi.dtb \
	imx6ull-14x14-ddr3-arm2-qspi-all.dtb \
	imx6ull-14x14-ddr3-arm2-tsc.dtb \
	imx6ull-14x14-ddr3-arm2-uart2.dtb \
	imx6ull-14x14-ddr3-arm2-usb.dtb \
	imx6ull-14x14-ddr3-arm2-wm8958.dtb \
	imx6ull-14x14-evk.dtb \
	imx6ull-lq-evk.dtb \
	imx6ull-14x14-evk-btwifi.dtb \
	imx6ull-14x14-evk-emmc.dtb \
	imx6ull-14x14-evk-gpmi-weim.dtb \
	imx6ull-14x14-evk-usb-certi.dtb \
	imx6ull-9x9-evk.dtb \
	imx6ull-9x9-evk-btwifi.dtb \
	imx6ull-9x9-evk-ldo.dtb

3、编译测试

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- distclean
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- imx_lq_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- all -j4
tftp 80800000 zImage
tftp 83000000 imx6ull-lq-evk.dtb
bootz 80800000 - 83000000

4、CPU主频修改

1、查看cpu信息

root@ATK-IMX6U:~# cat /proc/cpuinfo
processor       : 0
model name      : ARMv7 Processor rev 5 (v7l)
BogoMIPS        : 8.00
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xc07
CPU revision    : 5

Hardware        : Freescale i.MX6 Ultralite (Device Tree)
Revision        : 0000
Serial          : 0000000000000000
root@ATK-IMX6U:~#

2、查看当前CPU 的工作频率

root@ATK-IMX6U:~# cd /sys/bus/cpu/devices/cpu0/cpufreq
root@ATK-IMX6U:/sys/bus/cpu/devices/cpu0/cpufreq# ls -l
total 0
-r--r--r-- 1 root root 4096 Feb 22 13:26 affected_cpus
-r-------- 1 root root 4096 Feb 22 13:26 cpuinfo_cur_freq
-r--r--r-- 1 root root 4096 Feb 22 13:26 cpuinfo_max_freq
-r--r--r-- 1 root root 4096 Feb 22 13:26 cpuinfo_min_freq
-r--r--r-- 1 root root 4096 Feb 22 13:26 cpuinfo_transition_latency
-r--r--r-- 1 root root 4096 Feb 22 13:26 related_cpus
-r--r--r-- 1 root root 4096 Feb 22 13:26 scaling_available_frequencies
-r--r--r-- 1 root root 4096 Feb 22 13:26 scaling_available_governors
-r--r--r-- 1 root root 4096 Feb 22 13:26 scaling_cur_freq
-r--r--r-- 1 root root 4096 Feb 22 13:26 scaling_driver
-rw-r--r-- 1 root root 4096 Feb 22 13:26 scaling_governor
-rw-r--r-- 1 root root 4096 Feb 22 13:26 scaling_max_freq
-rw-r--r-- 1 root root 4096 Feb 22 13:26 scaling_min_freq
-rw-r--r-- 1 root root 4096 Feb 22 13:26 scaling_setspeed
drwxr-xr-x 2 root root    0 Feb 22 13:26 stats
root@ATK-IMX6U:/sys/bus/cpu/devices/cpu0/cpufreq#
1、affected_cpus

需要软件协调频率的 CPU 列表。

root@ATK-IMX6U:/sys/bus/cpu/devices/cpu0/cpufreq# cat affected_cpus
0
2、cpuinfo_cur_freq

当前 cpu 工作频率,从CPU寄存器读取到的工作频率。

root@ATK-IMX6U:/sys/bus/cpu/devices/cpu0/cpufreq# cat cpuinfo_cur_freq
396000
3、cpuinfo_max_freq

处理器所能运行的最高工作频率(单位: KHz)。

root@ATK-IMX6U:/sys/bus/cpu/devices/cpu0/cpufreq# cat cpuinfo_max_freq
792000
4、cpuinfo_min_freq

处理器所能运行的最低工作频率(单位: KHz)。

root@ATK-IMX6U:/sys/bus/cpu/devices/cpu0/cpufreq# cat cpuinfo_min_freq
198000
5、cpuinfo_transition_latency

处理器切换频率所需要的时间(单位:ns)。

root@ATK-IMX6U:/sys/bus/cpu/devices/cpu0/cpufreq# cat cpuinfo_transition_latency
91036
6、related_cpus

需要软件或硬件来协调 CPU 频率的列表。

root@ATK-IMX6U:/sys/bus/cpu/devices/cpu0/cpufreq# cat related_cpus
0
7、scaling_available_frequencies

处理器支持的主频率列表(单位: KHz)。

root@ATK-IMX6U:/sys/bus/cpu/devices/cpu0/cpufreq# cat scaling_available_frequencies
198000 396000 528000 792000
8、scaling_available_governors

当前内核中支持的所有 governor(调频)类型。

root@ATK-IMX6U:/sys/bus/cpu/devices/cpu0/cpufreq# cat scaling_available_governors
interactive conservative userspace powersave ondemand performance

Linux 内核一共有 5 中调频策略:

  • Interactive,一开始直接用最高频率,然后根据CPU负载慢慢降低。
  • Conservative,和ondemand模式相似,规则是“慢升快降”,注重省电,当有高需求时逐渐提高频率,当低需求时迅速跳至低频率。
  • Userspace,可以在用户空间手动调节频率。
  • Powersave,省电模式,通常以最低频率运行,系统性能会受影响,一般不会用这个!
  • Ondemand,定时检查负载,然后根据负载来调节频率。负载低的时候降低 CPU 频率,这样省电,负载高的时候提高 CPU 频率,增加性能。
  • Performance,最高性能,直接用最高频率,不考虑耗电。
9、scaling_cur_freq

保存着 cpufreq 模块缓存的当前 CPU 频率,不会对 CPU 硬件寄存器进行检查。

root@ATK-IMX6U:/sys/bus/cpu/devices/cpu0/cpufreq# cat scaling_cur_freq
396000
10、scaling_driver

该文件保存当前 CPU 所使用的调频驱动。

root@ATK-IMX6U:/sys/bus/cpu/devices/cpu0/cpufreq# cat scaling_driver
imx6q-cpufreq
11、scaling_governor

governor(调频)策略。

root@ATK-IMX6U:/sys/bus/cpu/devices/cpu0/cpufreq# cat scaling_governor
ondemand
12、scaling_max_freq

governor(调频)可以调节的最高频率。

root@ATK-IMX6U:/sys/bus/cpu/devices/cpu0/cpufreq# cat scaling_max_freq
792000
13、scaling_min_freq

governor(调频)可以调节的最低频率。

root@ATK-IMX6U:/sys/bus/cpu/devices/cpu0/cpufreq# cat scaling_min_freq
198000
14、scaling_setspeed

如果用户选择了“userspace” governor, 那么可以设置cpu工作主频率到某一个指定值。

root@ATK-IMX6U:/sys/bus/cpu/devices/cpu0/cpufreq# cat scaling_setspeed
<unsupported>
15、stats

stats 目录下给出了 CPU 各种运行频率的统计情况,比如 CPU 在各频率下的运行时间以及变频次数。

root@ATK-IMX6U:/sys/bus/cpu/devices/cpu0/cpufreq#
root@ATK-IMX6U:/sys/bus/cpu/devices/cpu0/cpufreq# cd stats/
root@ATK-IMX6U:/sys/bus/cpu/devices/cpu0/cpufreq/stats# ls -l
total 0
-r--r--r-- 1 root root 4096 Feb 22 13:55 time_in_state
-r--r--r-- 1 root root 4096 Feb 22 13:55 total_trans
root@ATK-IMX6U:/sys/bus/cpu/devices/cpu0/cpufreq/stats# cat time_in_state
198000 90557
396000 108610
528000 660
792000 2281
root@ATK-IMX6U:/sys/bus/cpu/devices/cpu0/cpufreq/stats# cat total_trans
18237
root@ATK-IMX6U:/sys/bus/cpu/devices/cpu0/cpufreq/stats#

3、修改调频策略

arch/arm/configs/xx_deconfig 中配置如下参数:

CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y	# 默认调频策略
CONFIG_CPU_FREQ_GOV_POWERSAVE=y				# 使能
CONFIG_CPU_FREQ_GOV_USERSPACE=y				# 使能
CONFIG_CPU_FREQ_GOV_INTERACTIVE=y			# 使能
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y			# 使能

4、使能 8 线EMMC驱动

<保留>

5、修改网络驱动

<保留>

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
i.MX6ULL是NXP半导体推出的一款低功耗、高集成度的应用处理器,适用于嵌入式系统和物联网设备。在使用i.MX6ULL处理器运行Linux操作系统时,安全性是一个重要的考虑因素。 i.MX6ULL Linux系统的安全性可以从多个方面来考虑。首先,Linux操作系统本身具有良好的安全性,具备权限管理、访问控制、安全隔离等功能。通过合理的配置和管理,可以保护系统免受外部攻击。 其次,i.MX6ULL芯片本身也提供了一些安全特性,如硬件加密引擎和安全启动功能。硬件加密引擎可以加密数据传输,确保数据的机密性;安全启动功能则提供了验证和保护引导加载程序的机制,防止恶意软件的篡改。 此外,i.MX6ULL还支持TrustZone技术,通过硬件隔离将系统分成安全世界和非安全世界。在安全世界中,可以运行关键的安全任务,而非安全世界则可以运行一般的应用程序。这种硬件隔离可以提供额外的保护,防止恶意程序对关键数据和系统功能的攻击。 最后,开发者在使用i.MX6ULL时还可以采取一些安全措施,如定期更新操作系统和软件包、使用强密码、限制外部设备的访问等。同时,定期进行安全漏洞扫描和风险评估,及时修复发现的漏洞和弱点,也是提高系统安全性的重要手段。 综上所述,i.MX6ULL在运行Linux操作系统时可以通过合理配置、硬件特性和开发者的安全措施来提高系统的安全性,保障系统和数据的保密性、完整性和可用性。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值