Skip to content

Commit

Permalink
ARC: [arcfpga] Early ARC UART to be only activated by cmdline
Browse files Browse the repository at this point in the history
Earlier CONFIG_SERIAL_ARC_CONSOLE would unconditionally enable the
legacy ARC UART based early console even if platform lacked that UART
(e.g. nSIM OSCI platform).

So a multi-platform image containing the 2 UART drivers won't work.

Fix that by probing the driver only if "earlyprintk=ttyARC0" is present
in cmdline.

Reported-by: Chuck Jordan <cjordan@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
  • Loading branch information
Vineet Gupta committed Jun 3, 2014
1 parent c00bfd9 commit e87a850
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion arch/arc/boot/dts/angel4.dts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
interrupt-parent = <&intc>;

chosen {
bootargs = "console=ttyARC0,115200n8";
bootargs = "console=ttyARC0,115200n8 earlyprintk=ttyARC0";
};

aliases {
Expand Down
13 changes: 4 additions & 9 deletions arch/arc/plat-arcfpga/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,11 @@ static void arc_fpga_serial_init(void)
ARRAY_SIZE(fpga_early_devs));

/*
* ARC console driver registers itself as an early platform driver
* of class "earlyprintk".
* Install it here, followed by probe of devices.
* The installation here doesn't require earlyprintk in command line
* To do so however, replace the lines below with
* parse_early_param();
* early_platform_driver_probe("earlyprintk", 1, 1);
* ^^
* ARC console driver registers (build time) as an early platform driver
* of class "earlyprintk". However it needs explicit cmdline toggle
* "earlyprintk=ttyARC0" to be successfuly runtime registered.
* Otherwise the early probe below fails to find the driver
*/
early_platform_driver_register_all("earlyprintk");
early_platform_driver_probe("earlyprintk", 1, 0);

/*
Expand Down

0 comments on commit e87a850

Please sign in to comment.