Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752632AbcLFHOq (ORCPT ); Tue, 6 Dec 2016 02:14:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54178 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752244AbcLFHOo (ORCPT ); Tue, 6 Dec 2016 02:14:44 -0500 Subject: Re: [PATCH] SPCR: check bit width for the 16550 UART To: Duc Dang References: <20161205130534.11080-1-aleksey.makarov@linaro.org> <3a6193ef-ca86-c113-b09a-5d6c882137e2@redhat.com> <53421849-d031-77e1-9edb-53c9d673d462@redhat.com> <966938c5-4540-593d-e763-18cf879b325d@redhat.com> Cc: Aleksey Makarov , "Rafael J . Wysocki" , linux-acpi@vger.kernel.org, linux-serial@vger.kernel.org, Linux Kernel Mailing List , Greg Kroah-Hartman , Russell King , Peter Hurley , Mark Salter , Graeme Gregory , Len Brown , Rob Herring From: Jon Masters Message-ID: <0b8324fe-e564-226a-94b1-8ed2946db3d1@redhat.com> Date: Tue, 6 Dec 2016 02:13:52 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <966938c5-4540-593d-e763-18cf879b325d@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 06 Dec 2016 07:13:59 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2315 Lines: 50 On 12/06/2016 01:53 AM, Jon Masters wrote: > On 12/06/2016 01:34 AM, Jon Masters wrote: >> On 12/05/2016 10:55 PM, Duc Dang wrote: >>> On Mon, Dec 5, 2016 at 6:27 PM, Jon Masters wrote: > ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301") /* Device Properties for _DSD */, > Package (0x01) > { > Package (0x02) > { > "clock-frequency", > Zero > } > } > I suspect Mustang is doing similar. So you read the magic frequency ^^^^^^^^^^^^^ spoiler, it is :) > info and pass this in through a DSD in the AML. It's ok, I've made my > peace with this (but obviously we're trying to kill all DSD hacks), > but it explains how this "works" after boot, but not for early console. > > To fix this, we're going to need to be able to know that your 8250 is > both needful of 32-bit accesses *AND* needs a different base UART clock. > Fortunately our good friends at Microsoft are amenable to adding a > subtype that covers this and are going to followup tomorrow for me. For the earlycon setup, you'll probably benefit from figuring out ahead of time how you'll want to handle this. The "easy" option is to remove the baud in the case of X-Gene with new subtype but that'll be potential fragile. You might also decide that struct earlycon_device wants to grow a "quirks" flag that you can set for this kind of thing (bound to be more). Copying Rob as well in case he has suggestions for you. Rob, as an FYI the AppliedMicro X-Gene 16550 "compatible" requires both 32-bit accesses (which Aleksey tried to address earlier in this thread) but also has a special non-standard clock (to be fair, it's not as if we architected a standard UART clock for arm64, we just assumed it was like x86 but didn't mandate this early when Applied were doing their design - another life lesson). Microsoft will add a new DBG2 subtype that allows for both of these situations. But you'll want to somehow convey this information (quirks) in one of the earlycon structures. Jon. -- Computer Architect | Sent from my Fedora powered laptop