Received: by 10.223.164.202 with SMTP id h10csp3365264wrb; Sun, 19 Nov 2017 20:33:13 -0800 (PST) X-Google-Smtp-Source: AGs4zMZhnNT/n0OpBo1/QoAXS8Oui5e2EbQ7lL4xE+THOKIR6Y5eS3VamN8/Nu0cmhK0U9TsozaJ X-Received: by 10.99.180.11 with SMTP id s11mr11908957pgf.174.1511152393212; Sun, 19 Nov 2017 20:33:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511152393; cv=none; d=google.com; s=arc-20160816; b=cggZLFg7sV57JwC9l/Vceb4LZLsf4ccz6Te4mElj99xGg2pJ1T204go+aAg0kardCR HCWbyYnstswaK25r/nwmPJoXByF6OoE6pA7diPXCYbT82Rmebjfhi20mdVyxdpOWoMz1 1yz4hg0fFyBPMEuQtUE+5mGgA5f9BfozedZc9+dJM7G4I/6q+hvsnnEGHDkep7G/piU+ 06JWJfVWxWfPDc9M2oPv/JQZzRSumc7MsAwflOZFl/fEn83B4JhmOs2nzNLNrKTOsR2g y+L2XwBOljdIwxW3BFCwiPi6DI+TdN5GTMRSozzuFScvmHlrRFqKORDfsZqw4cBVCmkF mPcg== 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:from:references:to:subject:dkim-signature :arc-authentication-results; bh=Yg90lGzjEdsnY1KdjP1FIusiYMuxIW39y3+FZofXEkI=; b=H5xQ73ecWUbldAY1hAEp2K7S87HAwGP2/M8kzpZRgpaxd0kMz5B9hdkffRbt0lUoHo MWM/xyonjo6p7Gf7Tx0+cL7AfD9/Kj1/UJ/0LsQbuIx0kc8K3PEhXDLLGt2oJ3+JTnIt Tk0dRhBfeYqH4Cticohid0h4Ek+amJ8vrba6T87DVcWUnycsSTO5JsVbxy1aQgDsdmE3 AHeg6tJoFNKlbMjK2ve8XB7dDhXw0OoOFcTUNiJThoGKs/7Hgwgq9bLXFITZscabaT/h 6cXqJdKp00sgxHbljBpnDdQ/ThkXahY5Gd/dFGez5rKFCXu3CdzUDVFxRaGic4Cvk6dg k5qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JUmebsa2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a61si1461255pla.234.2017.11.19.20.33.02; Sun, 19 Nov 2017 20:33:13 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JUmebsa2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751092AbdKTEc2 (ORCPT + 68 others); Sun, 19 Nov 2017 23:32:28 -0500 Received: from mail-yb0-f195.google.com ([209.85.213.195]:34758 "EHLO mail-yb0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750969AbdKTEc1 (ORCPT ); Sun, 19 Nov 2017 23:32:27 -0500 Received: by mail-yb0-f195.google.com with SMTP id k40so2543891ybj.1; Sun, 19 Nov 2017 20:32:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=Yg90lGzjEdsnY1KdjP1FIusiYMuxIW39y3+FZofXEkI=; b=JUmebsa2bLAxxOgDQpy+0Ma+tT1+w5HfvQ7XQcGFcln4xQlprtYiuL2jlw2T2lfdGP dYf1t2zXKon7aOMOrMXMeswf4RPNo3eGWytcYT8zmO/DHVEdWHHSoTssDKcF0v+gCW7L 4ZGyTStilx9VeVN9WZjJ2R+00MYTjRVKZw2jgdl1chD4d/vrFs1vT009FHptJlDS0AEI GHkNC8XntelbNNH/JOOrvDg2pdio5JcHLbdlnrEZF7YJhp0jQidcqel1Ymse4NykZ8Lh kg6ICMTKxX1GWzbS04+TQ8hA99rSLWFYwyrHt2PDhoFDLnS4jAyqX1LoicHVjHM2OR2/ JNHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Yg90lGzjEdsnY1KdjP1FIusiYMuxIW39y3+FZofXEkI=; b=BgfSUfE8Irs/JRuHodYup7zDsb5vfW5V3bYAxb6Qu7TySdvFwNHoAmszd3yBrpfezU iotezdQIb8jdFyB1jQTRe7bfzrcdrBOjvrzPaKvlwhMYjPtxe54Zs+EW1v1gFGsOElK3 kMX96xgtX/7GAcvNgm/Y0WwVYAY6NIUpFOrReTU95e/323+wpbnUXNAdAlvqlHEjp03k 5zk3TJI0VMCG2twWFMXj5owQjIqqn6b32D+ZjnNFp2ZTWgWbliJeQwHegKFm9LsT3JLz GNWaeVpxkHd5u+f6q/72sIGOsCy+BJ7EtTrVbS+TiEvJ3oG2ga6+9Lhi2cDsg65Dubb+ Cb+g== X-Gm-Message-State: AJaThX4LO/KhFr2p9qSEmGeYEKakYLR5zKST4OR6eytfFR95r0Xq3EjI HyD1lKWqmAG5DyvXiL3HL1c= X-Received: by 10.37.70.195 with SMTP id t186mr8038611yba.407.1511152346628; Sun, 19 Nov 2017 20:32:26 -0800 (PST) Received: from [192.168.43.210] (mobile-166-172-189-26.mycingular.net. [166.172.189.26]) by smtp.gmail.com with ESMTPSA id 142sm817045ywf.74.2017.11.19.20.32.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Nov 2017 20:32:26 -0800 (PST) Subject: Re: RFC: Copying Device Tree File into reserved area of VMLINUX before deployment To: linux-kernel@emagii.com, LKML , "devicetree@vger.kernel.org" , Rob Herring References: <0b31e22b-202f-6fca-28f2-e16e6af6c6b7@emagii.com> From: Frank Rowand Message-ID: Date: Sun, 19 Nov 2017 23:32:24 -0500 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 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. >> 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. And again, I would first approach the H/W vendor before trying to come up with a work around like this. >> I envisage the support would look something like: >> >> ============ >> Kconfig. >> config MIPS >>     select    HAVE_IMAGE_DTB >> >> config    HAVE_IMAGE_DTB >>     bool >> >> if HAVE_IMAGE_DTB >> config     IMAGE_DTB >>     bool    "Allocated space for DTB within image >> >> config    DTB_SIZE >>     int    "DTB space (kB) >> >> config    DTB_TAG >>     string    "DTB space tag" >>     default    "OWRTDTB:" >> endif >> >> ============ >> Some Makefile >> obj-$(CONFIG_INCLUDE_DTB) += image_dtb.o >> >> ============ >> image_dtb.S: >>     .text >>     .align    5 >>     .ascii    CONFIG_DTB_TAG >>     EXPORT(__image_dtb) >>     .fill    DTB_SIZE * 1024 >> >> =================== >> arch/mips/xxx/of.c: >> >> #if    defined(CONFIG_IMAGE_DTB) >>     if () >>         __dt_setup_arch(__dtb_start); >>     else >>         __dt_setup_arch(&__image_dtb); >> #else >>     __dt_setup_arch(__dtb_start); >> #endif >> >> I imagine that if the support is enabled for a target, it should >> be possible to override it with a CMDLINE argument >>      >>      >> They do something similar for the CMDLINE; copying it into the vmlinux, to allow a smaller boot From 1584557610305288231@xxx Mon Nov 20 04:24:55 +0000 2017 X-GM-THRID: 1584466498009191251 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread