From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966515AbcIHLER convert rfc822-to-8bit (ORCPT ); Thu, 8 Sep 2016 07:04:17 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:60716 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966498AbcIHLEP (ORCPT ); Thu, 8 Sep 2016 07:04:15 -0400 From: Arnd Bergmann To: zhichang Cc: linux-arm-kernel@lists.infradead.org, Zhichang Yuan , linuxarm@huawei.com, linux-kernel@vger.kernel.org, lorenzo.pieralisi@arm.com, minyard@acm.org, benh@kernel.crashing.org, gabriele.paoloni@huawei.com, john.garry@huawei.com, liviu.dudau@arm.com, zourongrong@gmail.com Subject: Re: [PATCH V2 4/4] ARM64 LPC: support earlycon for UART connected to LPC Date: Thu, 08 Sep 2016 13:04:01 +0200 Message-ID: <7585762.SZVHZyJdka@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <57D137AF.9070306@gmail.com> References: <1473255233-154297-1-git-send-email-yuanzhichang@hisilicon.com> <4291379.IHAA72aKCk@wuerfel> <57D137AF.9070306@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K0:QsWOCUdH4gsVDay1ciK46tR8wZtmkd2Ute3PEMZyBwIH/Pplcj2 OqVpaosZM7bE6jKKU4AfS/tr985S4ayzbKX3qA6Et/HZQjivc3HtcTh1zMZONWrZnc+XAb+ YFeB9OWsP9TaLDJoD2zDitPhdQALwZIpBIPPjMP2Bq1ja2K6FCbCnkP9toECtbvr1LJqL2Y lhVm21tUPWOOgVf3DpgHw== X-UI-Out-Filterresults: notjunk:1;V01:K0:QGZga9PQFE4=:JxuRdS1OQ92vpLnTrGF9Jl VBnwGCJ0qMAokN2bqKfH/qqbPmspXIM/EfhSnIS/cW0uhZtTgjoVqSQB/3wpBnBPWllgFrvxf errA7SuQt3vW3+QGSn1vCg9CPkPUN0KRVPkM5iNDy6Q1S9Kj2DSNlHExtL2acyqeKVKEG4eu7 0r3W5qZr9R8riHDP7dwrthEvrVKze9Si7wOa9Vu+QQ5u+SURHuMZil/QQwMLwniJN6vS/2iSW 5+Vm8Iw/bolQF7spg7N33qlBmXirn4wFDpMWjS8M2MfGQq4Rxd9vacZlCVi78NMr1z7+gH1y7 72NLQ836nfKRMpVZEDmjQKqe1fl9ilhnpBfL30chacAvA9NBTyut3rFHRWDjMT2XZ7x9eVLcr r30I4ma6j/K2yV8aUElLh+M+NY1MTkubsbLo+FRxNUiQxSr+QmzPXrVL5yDhR4uyUCkHYsmUy 06vyyXRA82o0oQgmUWWzTm8xm+pNq+O/gRN/hrxX2cKbAUM1FYDpMujZp6qL81PJ3tTeAaNcX wItEkoy0elkja/BWsT9YXdSN/PXkUXVhyIKYGXqtioAP8uFSDOBf6BpP1xHGUiUnpUXqU6tCG iC07nuOzfDftyfeKC37ec2T2XDV1gHveTtTo/FKST4gXV9vfq9Dx9WvQ0ufzIz+Chawx+AiYB gt9k/NLj46tjWd8tI+KHg+tpIM/of0R9TGrJ05bji+aQxdoE2O1s3gMWf159htItQ+X8N9Kdk /kswEDDojgQQhVg7 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday, September 8, 2016 6:04:31 PM CEST zhichang wrote: > Hi, Arnd, > > On 2016年09月07日 22:52, Arnd Bergmann wrote: > > On Wednesday, September 7, 2016 9:33:53 PM CEST Zhichang Yuan wrote: > >> From: "zhichang.yuan" > >> > >> This patch support the earlycon for UART connected to LPC on Hip06. > >> This patch is depended on the LPC driver. > >> > >> Signed-off-by: zhichang.yuan > >> > > > > I'm skeptical about this too. Is this just needed because the 8250 > > earlycon support comes before the lpc bus initialization? > I think you wonder why early_serial8250_setup can not be used direclty for this earlycon of LPC uart. > > 1. the earlycon kernel parameter format of LPC uart is different from 8250. something like that > "earlycon=hisilpcuart,mmio,0xa01b0000,0,0x2f8". You see, there is one more parameter after the baudrate. We should never need to specify the addresses manually like this, it's actually supposed to work if you just list "earlycon" here. The first membase is apparently only used during setup: + writel(LPC_IRQ_CLEAR, device->port.membase + LPC_REG_IRQ_ST); + /* ensure the LPC is available */ + while (!(readl(device->port.membase + LPC_REG_OP_STATUS) & + LPC_STATUS_IDLE)) Why doesn't the firmware do this before handing off control of the kernel to the console? > Hip06 LPC uart need two base addresses for earlycon. > 2. the IO type is mmio to introduce a memory base address to access LPC register file. But the real uart > IO type is UPIO_PORT. This is spcial... This sounds like a deficiency in the of_setup_earlycon() function, which can only handle MMIO addresses, and won't actually be able to understand nodes without a "ranges" property like you have here. I think we need to add a special case for port ranges here. Arnd