When you boot your precompiled U-Boot image for an ARM machine, it already includes: a kernel, an initramfs/initrd file, and a compiled device tree binary (.dtb) file rolled into an image format which U-Boot can recognise, unpack, load into memory and use to kick off the booting process. In this case, the console=ttyS0,115200 information is included in the .dtb file from the original device tree specification (DTS) file which will contain a section that looks like:
chosen {
bootargs = "console=ttyS0,115200n8 maxcpus=2, envaddr = <0xfa0f0000>";
};
Ultimately U-Boot loads the binary .dtb file into memory and passes a pointer to it to the kernel, which can then deduce the console parameters and display console output.
When instead you prefer to load the kernel into memory and use the U-Boot bootm command, you must yourself ensure that the initramfs/initrd and .dtb file have been loaded into memory (perhaps via tftp) and that the addresses are passed as arguments to bootm. Once that has been done, the kernel has the opportunity to fetch the console parameters from the .dtb as it did in the U-Boot image case and you should then see your console output. The kernel code to do this was, in the 4.19 kernel, located in drivers/of/base.c of_console_check().
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…