Hi3519AV100开启UART串口

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 了

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值