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>;
};

本文详细解析了U-Boot环境下加载Linux内核的过程,包括预处理、内存分配、设备树配置及最终跳转到Linux内核。特别关注了如何在设备树中定义并选择默认串口作为输出路径。
344

被折叠的 条评论
为什么被折叠?



