Received: by 10.223.164.202 with SMTP id h10csp4326301wrb; Mon, 20 Nov 2017 13:40:14 -0800 (PST) X-Google-Smtp-Source: AGs4zMbQ0KBoyx/iIjH5rcu+UThGZxNhk09GIG0W75ZOmFZGA/OLmqs6AFkO4fSENmDldroDLP2X X-Received: by 10.84.148.203 with SMTP id y11mr15183363plg.198.1511214014753; Mon, 20 Nov 2017 13:40:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511214014; cv=none; d=google.com; s=arc-20160816; b=RrfVByQ7n00iNRixCW790HidgOLAn6j4ZkeWQfo5dNGdmYpsSxTT1Gf6RAEWAeUrfM laaH0Evbj+gE6ohKeoxwUBVeDou1h3p7eTrGIJtQuyd0wEw/yrNX64c8F66NGmuPjBdH 3Ject4dftmiG06EiQ4TTPe+BN2QHwsQ9dbJY9u8LoR+KpwJwHVLBYDnaQSiV3cU709LU 6EwjWqUSvYTal+5TdXbERVYIkk7sdNvaRyM2Bv2zKfc12PCw7EOTHWzXecZBA4YH5lM6 rtpEYKQp7esXCrytiE7ZOphwaTbYwRoq3pAa9NcVceEKScOAC8bND+pB6hrhn8HITJr2 Tcxw== 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=8UYtyXlEWHNSj1jdPk3fvym4p7N6dx17NFgJiv4zu+s=; b=l6dfh1x/2g68K7ENvOJVi6+mgaVt3K7D4L7Q3rUe475fvp0z9iRiRvfcbA3KNqsPza n2BMbzbkWyWtIxF5Q5lr2Xevv2YnqJ/jLb8Ss3EPNWqfHZdH7z2cwXclt4y5GVkV7m5A QeyXzu01RJn+0rTcKNfZHG7B94MRE7+uMhUYxdjhl7g3CQY/WuMqQJ/zvIoqKYIFb5XD m87SH6kFBPjnCFFo8MrOf0lP47cgJMkiuDRB4knYpnqQLfrnfOW+80M6nNqOmsmZjlDX ByJ4kc3AtUfZCn9vgkiPjrEYnorNTUd0zJ7OXliQKFZHZqwdM9JagidM1qEAoJeQJmXU eGKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=adLYgYI0; 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 l193si8966752pge.778.2017.11.20.13.40.04; Mon, 20 Nov 2017 13:40:14 -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=adLYgYI0; 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 S1753082AbdKTVj0 (ORCPT + 67 others); Mon, 20 Nov 2017 16:39:26 -0500 Received: from mail-yw0-f170.google.com ([209.85.161.170]:39099 "EHLO mail-yw0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752991AbdKTVjX (ORCPT ); Mon, 20 Nov 2017 16:39:23 -0500 Received: by mail-yw0-f170.google.com with SMTP id g204so4882292ywa.6; Mon, 20 Nov 2017 13:39:23 -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=8UYtyXlEWHNSj1jdPk3fvym4p7N6dx17NFgJiv4zu+s=; b=adLYgYI0c/ePS6tN6bSd2Cs1M2cxhqui0pcM84CmwkIUs31Bytj0OAONcOm2G94Ctw xgGNypHAFDAW5J5SzmIxeL4ApYRmv3hyfNE0ZeWHzSeGRSoDP10Dp0rldK+E+/z7nUJN lq38ti5xC96uIaDyr84KO3t6yBiT3vCQUkr2gDIudNGqZZtGLUgHAdG7oz18FuWUu6zl 6D36nklEi4cdTJh7t7ohm3hyPPjZSSFs84riZL7Aulyq/XveQTwRp797/ucZIDZKMX+S XBWQ7xRK4Ue6H6NF8UKyKoOp5KyGy54jWTOgDXLTQfqy3TAO34a0mx69knIDbeYYy8mc Vqgg== 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=8UYtyXlEWHNSj1jdPk3fvym4p7N6dx17NFgJiv4zu+s=; b=ImCZw3KArVQCmWJCSkmKqnWTrk/w9BsXt10ogJa0a69eAb8UPqqnOISZJGL6rxj1r1 WpEFhu/3VbG/ucelaeNBDfQEUaSl+SGlVHd8N+WAix7/KFvqcxeeeDXUvnQGeKT6pvp7 Ijc3nWIbdoMGMgxaPyJekQW39sYeDbmd0liU9MvHeqInelXELnHW0ICsth9uyautHaiW KGzr/x+YYegaqqgFku4aEIedx/n+V8JT7YVRCztmUMge/W9SYy3w1EKiXVjTO7aemSXF U3Rai+g0o63JC03uF6p+/IsKH5rZo4PnvOL8xls2qFT1j3sGEj7/556yKWYV+doa6zsU Yg5g== X-Gm-Message-State: AJaThX4tVOs3myHjeqyrCpEk3KZOBn4aVbTZCYG6PAYaMR4jbhquAzOk 10FnCrf0esMNb802P96TAvc= X-Received: by 10.129.52.21 with SMTP id b21mr7182966ywa.309.1511213962901; Mon, 20 Nov 2017 13:39:22 -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 i77sm5005155ywc.48.2017.11.20.13.39.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2017 13:39:22 -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: <0e54f9f0-1226-7f2e-3143-ea4e450058e6@gmail.com> Date: Mon, 20 Nov 2017 16:39:20 -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, 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. 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. -Frank >> >> 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 1584617717758837652@xxx Mon Nov 20 20:20:18 +0000 2017 X-GM-THRID: 1584466498009191251 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread