慢慢欣赏linux 串口驱动前传uboot传递串口参数

uboot找到默认串口
int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *images)
    =>boot_prep_linux(images);
    =>ret = boot_body_linux(images);
        =>/* allocate space for kernel copy of board info */
        ret = boot_bd_t_linux(images);
        =>ret = image_setup_linux(images);
            =>if (IMAGE_ENABLE_OF_LIBFDT && of_size)
                ret = image_setup_libfdt(images, *of_flat_tree, of_size, lmb);
                    =>fdt_chosen(blob)
                        =>fdt_fixup_stdout(fdt, nodeoffset);
                            =>fdt_setprop(fdt, chosenoff, "linux,stdout-path",  OF_STDOUT_PATH, strlen(OF_STDOUT_PATH) + 1);
                                #define OF_STDOUT_PATH        "/soc@01c00000/serial@01f02800:115200" //其中一个定义,定义默认输出串口
                                //另外一个例子,"/soc@ff0000000/serial@11c500"
    =>boot_jump_linux(images);
 

设备树定义

serial0: serial@11c500 {
            cell-index = <0>;
            device_type = "serial";
            compatible = "ns16550";
            reg = <0x11c500 0x100>;
            clock-frequency = <0>;
            interrupts = <36 2>;
            interrupt-parent = <&mpic>;
        };

        serial1: serial@11c600 {
            cell-index = <1>;
            device_type = "serial";
            compatible = "ns16550";
            reg = <0x11c600 0x100>;
            clock-frequency = <0>;
            interrupts = <36 2>;
            interrupt-parent = <&mpic>;
        };

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值