Received: by 10.223.164.202 with SMTP id h10csp3360425wrb; Sun, 19 Nov 2017 20:24:56 -0800 (PST) X-Google-Smtp-Source: AGs4zMaGqqS2FMUoMIpItPM20m86N2H0HuHLMkbMn1mi7fXbNsV43nyLEgWAnQJ26eIAtpLvmy6M X-Received: by 10.84.168.35 with SMTP id e32mr12730882plb.294.1511151895991; Sun, 19 Nov 2017 20:24:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511151895; cv=none; d=google.com; s=arc-20160816; b=BuiqcfZLAAdk7REC4JR84MyeXXHLrwTq2OCLLlyAahL9S1W/T8TvA6Z+p28McY0qTA BRVSDwcJWR6yYijGV6XuSw44c8t6mCVyf4fqndn517clUkJFLWmurrnXEq52wpfzAmgH UZ3Il101/LDTBiqZr47OZ0u9q+JOqmdUGbBWAmyjM+M5exJ8aBoUscXBSZSX3Sxt2j9/ XuSYh6I6iJ/NJu4xrzdpw3JoDo2W11A6oNx5FaArB2zTlthRJpz9UQnas3tSHrKJIq3M Ye6Lu7ED6+AUKDCiWfIIVpTGulrbj98k6x2uXsfpvZTbapqwWQkllqqGFKXnw8jkP49J asdg== 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=HQZthU75qA+PRigFTnmmmj8PwI//yB4ExO5ivxedB3E=; b=WG0pB689PzINvBM1d6Z76tAaDTIm9SNegHuk5xNa9jEOr6LdFgZsBOv4v5dPg5eijU 1Xyd7nna8mRSn5YYn/zf2G30yPP+QPPcUzmkDyl0uogVXGVcfNxBaH41Ox4BHbWscM9B +6KnMTLUZOwjSm/sUtBVS9L5fPWNVOxRypV7TRsTsq97L1mDZlUuuYJxInIazY4Id/V2 4ZQaYhYbJML4A8yQTbnOVdg95e+z9YiboZyQtgnzWbC+7kSFdEykGGZSttxbFGmY91RP SYWybupsJp+jEr5GiqIrE4G2FE2UBhBRZUwrXOryIQxGzbGzBKH3V36LExe+uJEPQHF3 Fc4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fmxyM5Ct; 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 q29si7158682pgc.795.2017.11.19.20.24.39; Sun, 19 Nov 2017 20:24:55 -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=fmxyM5Ct; 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 S1751075AbdKTEXs (ORCPT + 68 others); Sun, 19 Nov 2017 23:23:48 -0500 Received: from mail-yb0-f196.google.com ([209.85.213.196]:45905 "EHLO mail-yb0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750969AbdKTEXq (ORCPT ); Sun, 19 Nov 2017 23:23:46 -0500 Received: by mail-yb0-f196.google.com with SMTP id i126so2541609ybi.12; Sun, 19 Nov 2017 20:23:45 -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=HQZthU75qA+PRigFTnmmmj8PwI//yB4ExO5ivxedB3E=; b=fmxyM5CtzXjQt4JmvdFxTdF1dnF8gaWHgq4qtKlPoQ+B3Ll/q7vaEeH5ITYH+BALvL GqxaKwqFqFqkAHQqfgPI+3yRdwNMKhUD8dBW3xBz+5x5jY6bV4QDmz+bwOeGR00a6tQC TmQ4ME/oqQewMpCduXWpkpOn9kgXEXMW2QuaaDDHSx2lSLsUYAUabIX6VwkyaoPgFLLg XIAEhDsSgcqiSIZMdfcP7lDwkjvHSJZ7XPLhNmpmAT9Moz6fw0BBWL0ROJas/k/IVeL1 hVVp0xUF1pnoY3Fxd0EP/llb6bSVQlBm1oCxYQ0JZC1SjLdyD9viHrJ6zm4i3dbq1bTf L9kg== 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=HQZthU75qA+PRigFTnmmmj8PwI//yB4ExO5ivxedB3E=; b=c/cTzQjXsoy3PFC9tvQ3cSJInY0mJaXsjn9xYdaAoUctpf5WXMmWWXywam3/cb+7/W Us80qM7MzbLZhrc/ZAP/1haDzYpnH9rGBp6VBDOfn4fhUNGXbacTvbnkiMVOVwqLK3x+ lBsW+XH7NqatyIjsCkWIVpP344cQWH+sz1FIh9maNQ6a2MGVtmBuYmFlAJJwdvbhXpF1 4N4I+4DNmUw4VY8H3cruXBIyHMkkIOROcYQnASoD5EDPTbPAMxgoJN0EKV24BF6ryFLu miEbF/gym8rna+zL2OV+qKenXVHOEQT7D5imSLZNhPs+gw9uOpFemv6MkzXqw+m3arGW yDnA== X-Gm-Message-State: AJaThX78rRXLhvUvS/K2b/qjCPSJsW9DaFfUtkJYbcIXlhSh0E9LoWKU jbRZZPrwZ8e4L+jSQf0l758= X-Received: by 10.37.223.148 with SMTP id w142mr7873867ybg.145.1511151825275; Sun, 19 Nov 2017 20:23:45 -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 g145sm3433879ywb.56.2017.11.19.20.23.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Nov 2017 20:23:44 -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 , Frank Rowand References: <0b31e22b-202f-6fca-28f2-e16e6af6c6b7@emagii.com> From: Frank Rowand Message-ID: Date: Sun, 19 Nov 2017 23:23:42 -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: <0b31e22b-202f-6fca-28f2-e16e6af6c6b7@emagii.com> 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 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. > > 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. > > 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 1584466498009191251@xxx Sun Nov 19 04:16:44 +0000 2017 X-GM-THRID: 1584466498009191251 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread