Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752018AbbBSRA1 (ORCPT ); Thu, 19 Feb 2015 12:00:27 -0500 Received: from mail-wi0-f181.google.com ([209.85.212.181]:33966 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751459AbbBSRAZ convert rfc822-to-8bit (ORCPT ); Thu, 19 Feb 2015 12:00:25 -0500 Subject: Re: [PATCH 2/4] of: DT quirks infrastructure Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Content-Type: text/plain; charset=utf-8 From: Pantelis Antoniou In-Reply-To: <54E613E7.2020405@gmail.com> Date: Thu, 19 Feb 2015 19:00:18 +0200 Cc: Mark Rutland , "devicetree@vger.kernel.org" , Tony Lindgren , Koen Kooi , Nicolas Ferre , "linux-kernel@vger.kernel.org" , Grant Likely , Ludovic Desroches , "linux-arm-kernel@lists.infradead.org" , Matt Porter , Guenter Roeck Content-Transfer-Encoding: 8BIT Message-Id: <670D0881-DBF0-45E8-A502-A6DB2B77A750@konsulko.com> References: <1424271576-1952-1-git-send-email-pantelis.antoniou@konsulko.com> <1424271576-1952-3-git-send-email-pantelis.antoniou@konsulko.com> <20150218154106.GC29429@leverpostej> <20150218173115.GG29429@leverpostej> <76BD1B22-BAED-4205-9B34-186907CE0217@konsulko.com> <54E613E7.2020405@gmail.com> To: frowand.list@gmail.com X-Mailer: Apple Mail (2.2070.6) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5280 Lines: 118 Hi Frank, > On Feb 19, 2015, at 18:48 , Frank Rowand wrote: > > On 2/19/2015 6:29 AM, Pantelis Antoniou wrote: >> Hi Mark, >> >>> On Feb 18, 2015, at 19:31 , Mark Rutland wrote: >>> >>>>>> +While this may in theory work, in practice it is very cumbersome >>>>>> +for the following reasons: >>>>>> + >>>>>> +1. The act of selecting a different boot device tree blob requires >>>>>> +a reasonably advanced bootloader with some kind of configuration or >>>>>> +scripting capabilities. Sadly this is not the case many times, the >>>>>> +bootloader is extremely dumb and can only use a single dt blob. >>>>> >>>>> You can have several bootloader builds, or even a single build with >>>>> something like appended DTB to get an appropriate DTB if the same binary >>>>> will otherwise work across all variants of a board. >>>>> >>>> >>>> No, the same DTB will not work across all the variants of a board. >>> >>> I wasn't on about the DTB. I was on about the loader binary, in the case >>> the FW/bootloader could be common even if the DTB couldn't. >>> >>> To some extent there must be a DTB that will work across all variants >>> (albeit with limited utility) or the quirk approach wouldn't work… >>> >> >> That’s not correct; the only part of the DTB that needs to be common >> is the model property that would allow the quirk detection logic to fire. >> >> So, there is a base DTB that will work on all variants, but that only means >> that it will work only up to the point that the quirk detector method >> can work. So while in recommended practice there are common subsets >> of the DTB that might work, they might be unsafe. >> >> For instance on the beaglebone the regulator configuration is different >> between white and black, it is imperative you get them right otherwise >> you risk board damage. >> >>>>> So it's not necessarily true that you need a complex bootloader. >>>>> >>>> >>>>>> +2. On many instances boot time is extremely critical; in some cases >>>>>> +there are hard requirements like having working video feeds in under >>>>>> +2 seconds from power-up. This leaves an extremely small time budget for >>>>>> +boot-up, as low as 500ms to kernel entry. The sanest way to get there >>>>>> +is by removing the standard bootloader from the normal boot sequence >>>>>> +altogether by having a very small boot shim that loads the kernel and >>>>>> +immediately jumps to kernel, like falcon-boot mode in u-boot does. >>>>> >>>>> Given my previous comments above I don't see why this is relevant. >>>>> You're already passing _some_ DTB here, so if you can organise for the >>>>> board to statically provide a sane DTB that's fine, or you can resort to >>>>> appended DTB if it's not possible to update the board configuration. >>>>> >>>> >>>> You’re missing the point. I can’t use the same DTB for each revision of the >>>> board. Each board is similar but it’s not identical. >>> >>> I think you've misunderstood my point. If you program the board with the >>> relevant DTB, or use appended DTB, then you will pass the correct DTB to >>> the kernel without need for quirks. >>> >>> I understand that each variant is somewhat incompatible (and hence needs >>> its own DTB). >> >> In theory it might work, in practice this does not. Ludovic mentioned that they >> have 27 different DTBs in use at the moment. At a relatively common 60k per DTB >> that’s 27x60k = 1.6MB of DTBs, that need to be installed. > > < snip > > > Or you can install the correct DTB on the board. You trust your manufacturing line > to install the correct resistors. You trust your manufacturing line to install the > correct kernel version (eg an updated version to resolve a security issue). > > I thought the DT blob was supposed to follow the same standard that other OS's or > bootloaders understood. Are you willing to break that? (This is one of those > ripples I mentioned in my other emails.) > Trust no-one. This is one of those things that the kernel community doesn’t understand which makes people who push product quite mad. Engineering a product is not only about meeting customer spec, in order to turn a profit the whole endeavor must be engineered as well for manufacturability. Yes, you can always manually install files in the bootloader. For 1 board no problem. For 10 doable. For 100 I guess you can hire an extra guy. For 1 million? Guess what, instead of turning a profit you’re losing money if you only have a few cents of profit per unit. No knobs to tweak means no knobs to break. And a broken knob can have pretty bad consequences for a few million units. And frankly I don’t care what other OSes do. If you were to take a look at the sorry DT support they have you’d be amazed. I would be very surprised if there’s another OS out there that can boot with a late Linux DTB. > -Frank Regards — Pantelis PS. For a real use case please take a look at the answer Guenter gave on this thread a little while back.-- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/