Received: by 10.223.164.202 with SMTP id h10csp5583944wrb; Tue, 21 Nov 2017 12:04:30 -0800 (PST) X-Google-Smtp-Source: AGs4zMYfoCN76086EaGeUrPhUTja5Pj3PFJX9a9BWh7jdH6bNiaeIxwP9tQJ4PsJW7OSUsWJd1LN X-Received: by 10.98.185.8 with SMTP id z8mr7356077pfe.166.1511294670845; Tue, 21 Nov 2017 12:04:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511294670; cv=none; d=google.com; s=arc-20160816; b=XrxOX9tXUuo3P4n+K0SUqXY44tMqCp+D8nbbeZmUuYPTNgcGDzd6Z+0zEHhqAZEAgk TbN8IgT4+qjcRuyeait/61VKRuLbr5k/aeS3rfeksA5DVuxS5SA05671ekUaDbWulbNw 66x4mdo1z2skrMjrLH/Dy/Y/iG+QvJLvERYuAOEYniexBT4jW+TBuT6mpU5jOY3Tn/iN /oZQGNSub2MfrJEBzTm/Eke/njgdqavwrsLU6o9py5PZsW8zAeprEeyQKcn3HLSsBHP3 LbQL2vxISWmRQSbJhv/bIpKY7IRrdPuYQRk6bwyp9+KabKcEUKBlApvCyQO6nf2KvqM3 vaNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject:reply-to :arc-authentication-results; bh=uEnMCe5zpO810gvOPHLsezkWjCVjWMiswHI4HyVL6jA=; b=JNbu9Q1fUhTapbtLuoUHmQ2grNtwA2dniTxwCMIVm8KMOrz/+SihnWFU5H4L49WyHf At6xHZ4db3nrGhJjq60SMVvDzorcPEs3hr2DXV141t4mrf5UKac9ZbNBfe0yQUTUpq9g v3Vbt0TEkTV2kc5pQefodNfD3i2KeXCXEVdSLzIjQjZunFoKfvWUONIrXBQHMjsXCVrT ZaHEUe6FnkqOEt2+T3grpUxW7zK+/UQi5UMYObPtHDU1g/RnJyangNXgNUuzKwNQX9Du ncJaERJV7gMDfqaxG02l1YYZ69YOpbV5Svqtjs0MIB7/byPvmqaceUBZBS5ybCEO2yQ1 /IPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d62si12724824pfl.79.2017.11.21.12.04.18; Tue, 21 Nov 2017 12:04:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751436AbdKUUDO (ORCPT + 76 others); Tue, 21 Nov 2017 15:03:14 -0500 Received: from v-smtpout1.han.skanova.net ([81.236.60.154]:60340 "EHLO v-smtpout1.han.skanova.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751145AbdKUUDM (ORCPT ); Tue, 21 Nov 2017 15:03:12 -0500 Received: from [10.175.196.237] ([37.123.169.62]) by cmsmtp with SMTP id HElBe4Wf60ynOHElBeM4YG; Tue, 21 Nov 2017 21:03:09 +0100 Reply-To: linux-kernel@emagii.com Subject: Re: RFC: Copying Device Tree File into reserved area of VMLINUX before deployment To: Rob Herring , Frank Rowand Cc: LKML , "devicetree@vger.kernel.org" References: <0b31e22b-202f-6fca-28f2-e16e6af6c6b7@emagii.com> <0e54f9f0-1226-7f2e-3143-ea4e450058e6@gmail.com> From: Ulf Samuelsson Organization: eMagii Message-ID: <4ce82f7e-a785-c152-3c48-8700534881d1@emagii.com> Date: Tue, 21 Nov 2017 21:03:09 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfNHp+93RpYpQ7d66h3mw7i21WuEGvLx+6KCsWzeXbmtU5jRr5Rmhf5uMbFlk73H3UnlOCEPgBFle1FGnnd8qT72WugJu0WldiwjDQFz0P017So8NCYwp vQLUSxHtCAwkuA0O0qfH271TtrC+3QX4dNtsTuawHnymcCZbyZVSECluuQPC3pnbEWW0zEYmKFzahPf8jGy69wgppwZEkBYWloPPY8MDE4LY00Mn5LAciqfC Cwcdf4AG71OX89s99B9MLwyUgwgzw1fJvz8iu2QsEZxAF4Aa1g/sShQh4dCEF3re Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017-11-21 18:09, Rob Herring wrote: > On Mon, Nov 20, 2017 at 3:39 PM, Frank Rowand wrote: >> Hi Ulf, Rob, >> >> On 11/20/17 15:19, Ulf Samuelsson wrote: >>> >>> >>> On 2017-11-20 05:32, Frank Rowand wrote: >>>> Hi Ulf, >>>> >>>> >>>> On 11/19/17 23:23, Frank Rowand wrote: >>>>> adding devicetree list, devicetree maintainers >>>>> >>>>> On 11/18/17 12:59, Ulf Samuelsson wrote: >>>>>> I noticed when checking out the OpenWRT support for the board that they have a method to avoid having to pass the device tree address to the kernel, and can thus boot device tree based kernels with U-boots that >>>>>> does not support device trees. >>>>>> >>>>>> Is this something that would be considered useful for including in mainstream: >>>>>> >>>>>> BACKGROUND: >>>>>> Trying to load a yocto kernel into a MIPS target (MT7620A based), >>>>>> and the U-Boot is more than stupid. >>>>>> Does not support the "run" command as an example. >>>>>> They modified the U-Boot MAGIC Word to complicate things. >>>>>> The U-Boot is not configured to use device tree files. >>>>>> The board runs a 2.6 kernel right now. >>>>>> >>>>>> Several attempts by me a and others to rebuild U-Boot according to >>>>>> the H/W vendors source code and build instructions results in a >>>>>> bricked unit. Bricked units cannot be recovered. >>>> >>>> Hopefully you have brought this to the attention of the vendor. U-Boot >>>> is GPL v2 (or in some ways possibly GPL v2 or later), so if you can not >>>> build U-Boot that is equivalent to the binary U-Boot they shipped, the >>>> vendor may want to ensure that they are shipping the proper source and >>>> build instructions. >>>> >>> >>> I am not the one in contact with the H/W vendor. >>> The U-boot is pretty old, and from comments from those >>> in contact with them, the U-Boot knowledge at the H/W vendor >>> is minimal at best. >>> It might even be that they program an U-boot where the upgrade of the U-boot is broken... >>> >>> >>>> >>>>>> Not my choice of H/W, so I cannot change it. >>>>>> >>>>>> >>>>>> =================================================================== >>>>>> OPENWRT: >>>>>> I noticed when checking out the OpenWRT support for the board that >>>>>> they have a method to avoid having to pass the device tree address >>>>>> to the kernel, and can thus boot device tree based kernels with >>>>>> U-boots that does not support device trees. >>>>>> >>>>>> What they do is to reserve 16 kB of kernel space, and tag it with >>>>>> an ASCII string "OWRTDTB:". After the kernel and dtb is built, a >>>>>> utility "patch-dtb" will update the vmlinux binary, copying in the >>>>>> device tree file. >>>>>> >>>>>> =================================================================== >>>>>> It would be useful to me, and I could of course patch the >>>>>> mainstream kernel, but first I would like to check if this is of >>>>>> interest for mainstream. >>>> >>>> Not in this form. Hard coding a fixed size area in the boot image >>>> to contain the FDT (aka DTB) is a non-starter. >>> >>> OK, Is it the fixed size, which is a problem? >> >> Yes, it is the fixed size which is a problem. >> >>> Is generally combining an image with a DTB into a single file also a non-starter? >> >> Can you jump in here Rob? My understanding is that CONFIG_ARM_APPENDED_DTB, >> which is the ARM based solution that Mark mentioned, was envisioned as a >> temporary stop gap until boot loaders could add devicetree support. I don't >> know if there is a desire to limit this approach or to remove it in the >> future. > > Yes, but I doubt we'll ever remove it. Most android devices use it (or > the multiple appended dtb stuff Qcom did) and there's out of tree > patches to do appended dtb on arm64. However, arm64 is a done a bit > differently in that the bootloader has to find the dtb rather than the > kernel (or really the decompressor). The purpose for arm64 is people > like the single kernel+dtb image, not legacy bootloader support as DT > support was there from day 1. > > Another option is to do what's called an impedance matcher like this[1]. > >> I'm not sure why this feature should not be permanently supported. I'm being >> cautious, just in case I'm overlooking or missing an important issue, thus >> asking for Rob's input. I do know that this feature does not advance the >> desires of people who want a single kernel (single boot image?) that runs on >> many different systems, instead of a boot image that is unique to each >> target platform. But I don't see why that desire precludes also having >> an option to have a target specific boot image. > > MIPS already supports built-in dtbs which is an in-kernel way to get > the dtb rather than the decompressor. The addition in this case is > just putting in a dummy dtb and putting in the real dtb later. I'm not > sure what MIPS image header looks like, but seems like it should be > possible to have the "built-in dtb" point to an appended dtb and just > update sizes in the image file. Then you don't have the fixed size. > > But now that I finished writing this, I see there is already appended > DTB support in MIPS. I just managed to complete a build using yocto where I made the following changes. I build the dtbs before linking the uImage. I add some configuration variables, which define * if the dtb should be included * which dtb file should be included uImage always gziped Checking the resulting uImage, shows that the ".appended_dtb" section now contains the dtb file. I have not loaded it into a board yet, but the default init seems to check if there is a U-boot header in the ".appended_dtb" section. My bootloader has a custom MAGIC so loading still won't work. > > Rob > > [1] https://github.com/zonque/pxa-impedance-matcher > -- Best Regards Ulf Samuelsson From 1584696501697828216@xxx Tue Nov 21 17:12:32 +0000 2017 X-GM-THRID: 1584466498009191251 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread