Linux-4.1.15移植(一)

一:添加开发板配置文件

/arch/arm/configs目录下创建“imx_my_emmc_defconfig”配置文件

二:添加开发板设备树文件

/arch/arm/boot/dts目录下创建“imx6ull-my-emmc.dts”设备树文件

同目录下Makefile中“CONFIG_SOC_IMX6ULL”一栏添加设备树文件:“imx6ull-my-emmc.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-my-emmc.dtb \

... ...

三:修改CPU主频

1、Linux内核一共有5种调频策略

(1):Performance,最高性能,直接用最高频率,不考虑耗电。

(2):Interactive,一开始直接用最高频率,然后根据 CPU负载慢慢降低。

(3):Powersave,省电模式,通常以最低频率运行,系统性能会受到影响,一般不用。

(4):Userspace,可以在用户空间手动调节频率。

(5):Ondemand,定时检查负载,然后根据负载来调节频率。负载低的时候降低 CPU频率,
这样省电,负载高的时候提高 CPU频率,增加性能。

2、修改方法

(1):修改配置文件xxx_defconfig

... ...

CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y

... ...

(2):图形界面配置

3、CPU频率修改

按照需求修改imx6ull.dtsi文件中对应参数即可

		cpu0: cpu@0 {
			compatible = "arm,cortex-a7";
			device_type = "cpu";
			reg = <0>;
			clock-latency = <61036>; /* two CLK32 periods */
			operating-points = <
				/* kHz	uV */
				996000	1275000
				792000	1225000
				528000	1175000
				396000	1025000
				198000	950000
			>;
			fsl,soc-operating-points = <
				/* KHz	uV */
				996000	1175000
				792000	1175000
				528000	1175000
				396000	1175000
				198000	1175000
			>;

修改完毕后执行“make dtbs”命令编译设备树即可。

四:使能8路EMMC驱动

由系统配置的设备树文件“imx6ull-14x14-evk.dts”可以看到linux驱动默认为4路emmc。

/*  imx6ull-14x14-evk.dts   */

&usdhc1 {
	pinctrl-names = "default", "state_100mhz", "state_200mhz";
	pinctrl-0 = <&pinctrl_usdhc1>;
	pinctrl-1 = <&pinctrl_usdhc1_100mhz>;
	pinctrl-2 = <&pinctrl_usdhc1_200mhz>;
	cd-gpios = <&gpio1 19 GPIO_ACTIVE_LOW>;
	keep-power-in-suspend;
	enable-sdio-wakeup;
	vmmc-supply = <&reg_sd1_vmmc>;
	status = "okay";
};

&usdhc2 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_usdhc2>;
	non-removable;
	status = "okay";
};

修改自己创建的设备树配置文件“usdhc2”属性:

/*  imx6ull-my-emmc.dts  */


#include "imx6ull-14x14-evk.dts"

&usdhc2 {
	pinctrl-names = "default", "state_100mhz", "state_200mhz";
	pinctrl-0 = <&pinctrl_usdhc2_8bit>;
	pinctrl-1 = <&pinctrl_usdhc2_8bit_100mhz>;
	pinctrl-2 = <&pinctrl_usdhc2_8bit_200mhz>;
	bus-width = <8>;
	non-removable;
	status = "okay";
};

猜你喜欢

转载自blog.csdn.net/qq_34968572/article/details/103061257