5.2.3 config.txt file
The RDK uses a configuration file config.txt to set some system configurations at boot time. This file is read config.txt during the boot process and supports modifying the device tree configuration, I/O pin states, ION memory, CPU frequency, and more. This file is typically accessible from Linux and must be edited as a user. If the file doesn't exist during the configuration process, simply create it as a new text file.uboot /boot/config.txt root config.txt
Notes
Device Tree
dtdebug
dtdebug If non-zero, uboot configuration logs will be output to the serial port during the device tree configuration phase.
dtdebug=1
dtoverlay
Support device tree overlay, providing a more flexible way to adjust the device tree.
【RDK X3】For example, by ion_resize adjusting ION the memory size, the following configuration will modify ION the memory size to 1GB.
dtoverlay=ion_resize,size=0x40000000
[RDK X5] Add /dev/spidev5.0 via dtoverlay_spi5_spidev (Note: the can device is also connected to spi5, so you can only choose one between spidev and can)
dtoverlay=dtoverlay_spi5_spidev
RDK X5 with
Modify the boot environment variables through ion_reserved_size, ion_carveout_size, and ion_cma_size to modify the ION partition size.
| boot environment variable name | dts tag | dts compatible string | Default size |
|---|---|---|---|
| ion_reserved_size | ion_reserved | ion-pool | 320M |
| ion_carveout_size | ion_carveout | ion-carveout | 320M |
| ion_cma_size | ion_cma | ion-cma | 128M |
ion=ion_reserved_size=0x14000000
ion=ion_carveout_size=0x14000000
ion=ion_cma_size=0x08000000
You can view the size of each ION area through the startup information:
root@ubuntu:~# dmesg | grep "Reserverd ion"
[ 0.207939] Reserverd ion-pool MEM start 0xa4100000, size 0x14000000
[ 0.207964] Reserverd ion-carveout MEM start 0xb8100000, size 0x14000000
[ 0.208068] Reserverd ion-cma MEM start 0xcc100000, size 0x8000000
dtparam
Supports enabling and disabling of buses such as uart, i2c, spi, and i2s.
Currently supported option parameters:
RDK X3 interface: uart3, spi0, spi1, spi2, i2c0, i2c1, i2c2, i2c3, i2c4, i2c5, i2s0, i2s1
RDK X5 modules: uart1, uart2, uart3, uart6, spi1, spi2, i2c0, i2c1, i2c5, i2c4, i2c5, dw_i2s1
For example, to close serial port 3:
dtparam=uart3=off
For example, open i2c5:
dtparam=i2c5=on
X5 CPU
For CPU details on the scheduling method, please refer to X5 CPU Frequency Management. This section only introduces the configuration method of config.txt.
arm_boost
When set to 1, overclocking is enabled and the maximum frequency of RDK RDK X5 is increased to 1.8GHz. By cat /sys/devices/system/cpu/cpufreq/policy0/scaling_boost_frequencies enabling boost, higher CPU frequencies will be opened.
By default, overclocking is disabled. It can be enabled arm_boost when 1
arm_boost=1
governor
The CPU frequency scheduling method has conservative ondemand userspace powersave performance schedutil two options. You cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors can get the configurable mode through.
For example, to set it CPU to run in performance mode:
governor=performance
frequency
governor When set to userspace, you can use this option to set it CPU to run at a fixed frequency. Currently, 300000 600000 1200000 1500000 these frequencies can generally be set. For details, you can use to cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_frequencies obtain a list of configurable frequencies.
For example, set CPU the frequency reduction to run at 1.2GHz:
governor=userspace
frequency=1200000
IO
gpio
Supports setting IO function multiplexing, output, output mode, output high, low level, pull-up and pull-down modes.
gpio:
ip - Input 设置为输入模式
op - Output 设置为输出模式
f0-f3 - Func0-Func3 设置功能复用,X3 f3功能都是设置为io模式,X3的其他功能和X5的所有功能请查看40PIN 管脚定义,或查阅相关寄存器文档
dh - Driving high (for outputs) 输出高电平
dl - Driving low (for outputs) 输出低电平
pu - Pull up 推挽上拉
pd - Pull down 推挽下拉
pn/np - No pull 无上下拉
Example
Configure the and 40Pin on the pins to IO mode:GPIO5 GPIO6
gpio=5=f3
gpio=6=f3
# 对于连续的管脚,也可以使用以下方式配置
gpio=5-6=f3
Configure 40Pin the pin to GPIO5 input mode:
gpio=5=f3
gpio=5=ip
Configure 40Pin the pin GPIO6 to output mode and output low level:
gpio=6=f3
gpio=6=op,dl
Configure 40Pin the pin GPIO6 to output mode, output high level, and set pull-up:
gpio=6=f3
gpio=6=op,dh,pu
Temperature
throttling_temp
The system CPU and BPU frequency reduction temperature point. When the temperature exceeds this point, the CPU and BPU will reduce their operating frequency to reduce power consumption. The CPU will be reduced to 240MHz and the BPU will be reduced to 400MHz.
shutdown_temp
System shutdown temperature point. If the temperature exceeds this point, the system will automatically shut down to protect the chip and hardware. It is recommended to properly dissipate heat to avoid device shutdown, as the device will not automatically restart after a shutdown.
Option
Supports using [] to set filter items. The settings of filter items need to be added at the end of the configuration file, because the part of the file without adding filter items belongs to it all. Once the filter setting is added, the subsequent configuration only belongs to the filter attribute until the end of the configuration file or another filter item is set.
Currently supported filter items are differentiated by hardware model and support the following filter items:
| Filter Items | Compatible models |
|---|---|
| [all] | All hardware, default properties |
| [rdkv1] | RDK x3 v1.0,RDK x3 v1.1 |
| [rdkv1.2] | RDK x3 v1.2 |
| [rdkv2] | RDK x3 v2.1 |
| [rdkmd] | RDK x3 Module |
| [x5-rdk] | RDK X5 V0.1 |
Voltage
voltage_domain
Configure the voltage domain of the 40-pin pin, supporting configurations of 3.3V and 1.8V. If not configured, the default is 3.3V.
This configuration item needs to be used in conjunction with the voltage domain switching jumper cap on the hardware.
For example, if the configuration RDK Module is 40Pin to work in 3v3 voltage mode, the following example uses the following [rdkmd] as a filter item:
# Voltage domain configuration for 40 Pin, 3.3V or 1.8V, defualt 3.3V
# Only RDK Module supported
[rdkmd]
voltage_domain=3.3V