Open the "earlyprink" parameter in CmdLine

Source: Internet
Author: User
The problem solving process, good Article recommendation, are saved in the Firefox wilson_sq@qq.com record ~~~~~~~~




Grep-r "EARLYPRINTK" kernel


Kernel/documentation/driver-model/platform.txt:should use Early_platform_init ("EARLYPRINTK", &platform_driver ).
./arch/sh/configs/sh2007_defconfig:config_cmdline= "console=ttysc1,115200 ip=dhcp root=/dev/nfs rw nfsroot=/nfs/ rootfs,rsize=1024,wsize=1024 EARLYPRINTK=SH-SCI.1 "
./arch/sh/configs/rsk7203_defconfig:config_cmdline= "console=ttysc0,115200 earlyprintk=serial ignore_loglevel"
./arch/sh/configs/migor_defconfig:config_cmdline= "Console=tty0 console=ttysc0,115200 earlyprintk=serial ip=on Root =/dev/nfs Ip=dhcp "
./arch/sh/configs/sdk7786_defconfig:config_cmdline= "console=ttysc1,115200 earlyprintk=sh-sci.1,115200 root=/dev/ SDA1 nmi_debug=state,debounce rootdelay=5 pmb=iomap ignore_loglevel "
./arch/sh/configs/rsk7201_defconfig:config_cmdline= "console=ttysc0,115200 earlyprintk=serial ignore_loglevel"
./arch/sh/configs/shx3_defconfig:config_cmdline= "console=ttysc0,115200 Earlyprintk=bios ignore_loglevel"








/************************************
Full Search EARLYPRINTK view its invocation procedure
***************************************/
Full Search EARLYPRINTK view its invocation procedure
① in Kernel-parameters.txt The following description, see our correspondence which,
earlyprintk= [X86,sh,blackfin,arm] Earlyprintk=vga
Earlyprintk=xen
Earlyprintk=serial[,ttysn[,baudrate]]
earlyprintk=serial[,0x ... [, BaudRate]]
Earlyprintk=ttysn[,baudrate]
earlyprintk=dbgp[debugcontroller#]
And finally we call it: earlyprintk=msm_hsl_uart,0x078b0000. 0x078b0000 is the base site of Uart2.


/************************************
Determine the base address of the UART2:
***************************************/
Cd/android/kernel/arch/arm64/boot/dts
Grep-r "UART". |grep 8916
See a few lines, please.
./qcom/msm8916.dtsi:pinctrl-0 = <&hsuart_sleep>;
./qcom/msm8916.dtsi:pinctrl-1 = <&hsuart_active>;
./qcom/msm8916.dtsi:blsp1_uart2:serial@78b0000 {
./qcom/msm8916.dtsi:compatible = "Qcom,msm-lsuart-v14";
./qcom/msm8916.dtsi:clocks = &LT;&AMP;CLOCK_GCC Clk_gcc_blsp1_uart2_apps_clk>,
The 78b0000 in blsp1_uart2:serial@78b0000 here is the base site.
The base site can also be found in the manual.






If there is no relevant print display during startup, the necessary printing should be turned on:
#CONFIG_SERIAL_MSM_HS =y
#CONFIG_SERIAL_MSM_HSL =y
#CONFIG_SERIAL_MSM_HSL_CONSOLE =y




Config_cmdline's Location:
①android/device/qcom/msm8916_64/boardconfig.mk/************/EARLYPRINTK is set here after the./build.sh kernel after boot.img is not regenerated:
②android/kernel/arch/arm/boot/dts/qcom/msm8939.dtsi Search chosen{with Bootargs settings}
③android/bootable/bootloader/lk/app/aboot/aboot.c


View Cmdlines in the kernel
Cat/proc/cmdlines




Problems encountered during the process: after changing the cmdline in ①android/device/qcom/msm8916_64/boardconfig.mk, the/android/out directory in the build directory should be deleted again, otherwise./build.sh Kernel command is not updated after execution boot.img


Print the log In search Earlyprink/earlycon/bootconsoles, see a print
Found in the program: The reason is only cmdline+ earlyprintk, but not to Earlyprink assignment
if (!BUF) {
Pr_warning ("No earlyprintk arguments passed.\n");
return 0;
}




Kernel-parameters.txt is described in the following
earlycon= [KNL] Output early console device and options. Uart[8250],io,<addr>[,options]
Uart[8250],mmio,<addr>[,options]
Uart[8250],mmio32,<addr>[,options] Start An early, Polled-mode console on the 8250/16550
UART at the specified I/O port or MMIO address.
MMIO Inter-register Address Stride is either 8-bit
(Mmio) or 32-bit (MMIO32).
The options is the same as for TTYs, above.
earlycon******************
Earlycon according to the settings in the other config file
Grep-r "Earlycon" *config
./drivers/tty/serial/8250/kconfig: "EARLYCON=UART8250,IO,0X3F8,9600N8"
./drivers/tty/serial/8250/kconfig: "Earlycon=uart8250,mmio,0xff5e0000,115200n8".




void __init parse_early_options (char *cmdline)
Parse_args ("Early Options", CmdLine, NULL, 0, 0, 0, Do_early_param);
Parse_one (Param, Val, doing, params, num, Min_level, max_level, unknown);
Handle_unknown (Param, Val, doing); doing= "Early Options"



Another way to start:
Fastboot-c "earlyprintk=msm_hsl_uart,0x078b0000" boot boot.img can start the specified kernel via fastboot. Although the start did not succeed, but probably the order should be correct ~ ~ ~ to be improved.




Search for no EARLYPRINTK arguments passed in google
Https://lists.linaro.org/pipermail/linaro-kernel/2013-May/004416.html This article seems to have solved the problem








Setup of normal serial port: Console=ttyhsl0,115200,n8 parameter in CmdLine
Platform_driver_register (&msm_hsl_platform_driver);
Msm_hsl_platform_driver
Msm_serial_hsl_probe
Uart_add_one_port (&msm_hsl_uart_driver, Port);
Uport->cons = drv->cons;
Uart_configure_port (DRV, State, Uport);
Uart_configure_port (struct uart_driver *drv, struct uart_state *state,struct uart_port *port)
Register_console (port->cons);

Uart_add_one_port (&msm_hsl_uart_driver, Port);
static struct Uart_driver Msm_hsl_uart_driver = {
. Owner = This_module,
. driver_name = "MSM_SERIAL_HSL",
. Dev_name = "TTYHSL",
. NR = Uart_nr,
. cons = Msm_hsl_console,
};


static struct Console msm_hsl_console = {
. Name = "TTYHSL",
. write = Msm_hsl_console_write,
. device = Uart_console_device,
. Setup = Msm_hsl_console_setup,
. Flags = Con_printbuffer,
. index =-1,
. data = &msm_hsl_uart_driver,
};




Uart_console_write (port, S, Count, Msm_hsl_console_putchar);
Msm_hsl_console_putchar (struct uart_port *port, int ch)
Msm_hsl_write (port, CH, REGMAP[VID][UARTDM_TF]);

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.