1.首先找到内核源码 Hi3519AV100_SDK_V2.0.2.0/osdrv/opensource/kernel/linux-4.9.y
2.修改hi3519av100.dts文件:源码/arch/arm/boot/dts/hi3519av100.dts
&uart0 {
status = "okay";
};
&uart1 { //自行加入
status = "okay"; //自行加入
}; //自行加入
&uart2 { //自行加入
status = "okay"; //自行加入
}; //自行加入
3.修改hi3519av100.dtsi文件:源码/arch/arm/boot/dts/hi3519av100.dtsi
aliases {
serial0 = &uart0;
serial1 = &uart1; //自行加入
serial2 = &uart2; //自行加入
amba {
#address-cells = <1>;
#size-cells = <1>;
compatible = "arm,amba-bus";
ranges;
uart0: uart@04540000 {
compatible = "arm,pl011", "arm,primecell";
reg = <0x04540000 0x1000>;
interrupts = <0 36 4>;
clocks = <&clock HI3519AV100_UART0_CLK>;
clock-names = "apb_pclk";
status = "okay"; //由disable改为okay
};
uart1: uart@04541000 {
compatible = "arm,pl011", "arm,primecell";
reg = <0x04541000 0x1000>;
interrupts = <0 37 4>;
clocks = <&clock HI3519AV100_UART1_CLK>;
clock-names = "apb_pclk";
dmas = <&hiedmacv310_0 2 2>, <&hiedmacv310_0 3 3>;
dma-names = "tx","rx";
status = "okay"; //由disable改为okay
};
uart2: uart@04542000 {
compatible = "arm,pl011", "arm,primecell";
reg = <0x04542000 0x1000>;
interrupts = <0 38 4>;
clocks = <&clock HI3519AV100_UART2_CLK>;
clock-names = "apb_pclk";
dmas = <&hiedmacv310_0 4 4>, <&hiedmacv310_0 5 5>;
dma-names = "tx","rx";
status = "okay"; //由disable改为okay
};
4.打开终端进入到源码目录
cd Hi3519AV100_SDK_V2.0.2.0/osdrv/opensource/kernel/linux-4.9.y
5.拷贝对应的配置文件
cp arch/arm/configs/hi3519av100_xxxxxx_defconfig .config
可选的配置文件如下
hi3519av100_amp_defconfig
hi3519av100_amp_nand_defconfig
hi3519av100_amp_emmc_defconfig
hi3519av100_smp_defconfig
hi3519av100_smp_nand_defconfig
hi3519av100_smp_emmc_defconfig
6.编译,进入kernel configuration
make ARCH=arm CROSS_COMPILE=arm-himix200-linux- menuconfig
按照如下配置
Device Drivers --->
Character devices --->
Serial drivers --->
<*> ARM AMBA PL011 serial port support
[*] Support for console on AMBA serial port
保存修改并退出
7.编译生成uImage
make ARCH=arm CROSS_COMPILE=arm-himix200-linux- uImage
8. ls /dev就会查看到 ttyAMA0?ttyAMA1?ttyAMA2 了
|