From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753622AbcI0NVF (ORCPT ); Tue, 27 Sep 2016 09:21:05 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:16775 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751900AbcI0NVE (ORCPT ); Tue, 27 Sep 2016 09:21:04 -0400 Subject: Re: [PATCH 5/5] tty: amba-pl011: Add earlycon support for SBSA UART To: Greg Kroah-Hartman References: <1474708465-38958-1-git-send-email-wangkefeng.wang@huawei.com> <1474708465-38958-6-git-send-email-wangkefeng.wang@huawei.com> <20160927105748.GA3847@kroah.com> CC: Wei Xu , Rob Herring , "Mark Rutland" , , Catalin Marinas , Will Deacon , , , , Russell King From: Kefeng Wang Message-ID: <281fb262-d9b8-9543-e35e-5db41fcea5d1@huawei.com> Date: Tue, 27 Sep 2016 21:15:12 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <20160927105748.GA3847@kroah.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.19.180] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090201.57EA70F3.00A6,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: ea6539090c0ca9d19f86a3133857885e Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016/9/27 18:57, Greg Kroah-Hartman wrote: > On Sat, Sep 24, 2016 at 05:14:25PM +0800, Kefeng Wang wrote: >> Declare an OF early console for SBSA UART so that the early console device >> can be specified via the "stdout-path" property in device-tree. >> >> Cc: Russell King >> Cc: Greg Kroah-Hartman >> Signed-off-by: Kefeng Wang >> --- >> drivers/tty/serial/amba-pl011.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c >> index 7d9b291..3688d3b 100644 >> --- a/drivers/tty/serial/amba-pl011.c >> +++ b/drivers/tty/serial/amba-pl011.c >> @@ -2330,6 +2330,7 @@ static int __init pl011_early_console_setup(struct earlycon_device *device, >> return 0; >> } >> OF_EARLYCON_DECLARE(pl011, "arm,pl011", pl011_early_console_setup); >> +OF_EARLYCON_DECLARE(pl011, "arm,sbsa-uart", pl011_early_console_setup); > > Why do you need another option for the same thing? It is used to support earlycon(without option) for sbsa-uart in bootargs. chosen { stdout-path = "serial0:115200n8"; bootargs = "earlycon" }; uart0: uart@602b0000 { compatible = "arm,sbsa-uart"; reg = <0x0 0x602b0000 0x0 0x1000>; ... }; We setup a unique struct with compatible name by OF_EARLYCON_DECLARE, #define OF_EARLYCON_DECLARE(_name, compat, fn) \ static const struct earlycon_id __UNIQUE_ID(__earlycon_##_name) \ __used __section(__earlycon_table) \ = { .name = __stringify(_name), \ .compatible = compat, \ .setup = fn } if without this patch(see drivers/of/fdt.c), early_init_dt_scan_chosen_serial() - for (match = __earlycon_table; match < __earlycon_table_end; match++) -- if (fdt_node_check_compatible(fdt, offset, match->compatible)) countinue; -- of_setup_earlycon(match, offset, options); // will never touch here. Thanks, Kefeng > > confused, > > greg k-h > > . >