Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp57504imm; Thu, 21 Jun 2018 13:53:01 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIzLJPh4BE50I6blyH9v4obWPxI/UTHFTVJXuZo/5ioLwDbay33jJ0BIiIuuPAInekkkjU/ X-Received: by 2002:a62:e03:: with SMTP id w3-v6mr28903437pfi.173.1529614381154; Thu, 21 Jun 2018 13:53:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529614381; cv=none; d=google.com; s=arc-20160816; b=t5p7OuG+9Ozk7a8Wg8jGDsrWBQPDEeADgcJWPNa1kWjEIasJrfeKCDOOaeqj48jlM0 gfpEUHOaEB16OTLho7W4/ZGRgfwTkSWfCf8NZrPUm9vprhHR7zzuxhptUkY18SIyxr8j U/ng+6I6OX7wAvrBkWES99KdNUiTAWUG/JwDwGc9A7k9JFclKG0t2PeEiMC8x+Mi8suk Ejt1M4FqbvffRKtXwpH45fLWQPz9Uttb/hh8gRRIDWmIwxGeCWSW3gKDlXu7iZUfsZ/T ACuuT7mj+WzxYjC/im33LEt3q1gIoqGOA91LzRdU6h+O8cQ//O1VZNGffAaw8FLmk3Go Td0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=pPSjA28UgvY+zPkM+3h/jyBgS4Coi60Mg0bLO2y52bw=; b=Z3e1UAnWaDgPNsCas3oR9iQES8b937l9UryOoeV2BS6YE6fbNbGwaJ7LTmJQwgpPHF DtnRDnflyrzxE8ooK3+A9hwSGQFECN+C5B24qzq14U4TZzCcfkh4NXle9SGjlC0udZ68 nPfvPL03wOu0sxVngxh2txQo85cRrE4VELbdbuMouA+9AdQwyU7NwHENMW2n210sDTyy wXmfxxe6dKwnarURPzfr1Us8VVEyNDDfIpdeP5NPzEJJwkBywPyc81tuWTY3jfVjkRbK hRqTncjDOrYvW3qPAM1CElJc1uAF5N70pDSq2cFUNGEJNh5fX6Z3UyO7ZjFn9b542Hw1 8Brw== 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 p9-v6si4665460pge.143.2018.06.21.13.52.46; Thu, 21 Jun 2018 13:53:01 -0700 (PDT) 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 S933482AbeFUUvl (ORCPT + 99 others); Thu, 21 Jun 2018 16:51:41 -0400 Received: from mail.bootlin.com ([62.4.15.54]:34596 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933443AbeFUUvk (ORCPT ); Thu, 21 Jun 2018 16:51:40 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id CFBF120834; Thu, 21 Jun 2018 22:51:38 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (unknown [88.191.26.124]) by mail.bootlin.com (Postfix) with ESMTPSA id 99C52206A0; Thu, 21 Jun 2018 22:51:38 +0200 (CEST) Date: Thu, 21 Jun 2018 22:51:39 +0200 From: Alexandre Belloni To: James Hogan Cc: Ralf Baechle , Allan Nielsen , Thomas Petazzoni , linux-mips@linux-mips.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] mips: generic: allow not building DTB in Message-ID: <20180621205139.GM7737@piout.net> References: <20180425211607.2645-1-alexandre.belloni@bootlin.com> <20180425211607.2645-2-alexandre.belloni@bootlin.com> <20180620220807.GD22606@jamesdev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180620220807.GD22606@jamesdev> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/06/2018 23:08:08+0100, James Hogan wrote: > On Wed, Apr 25, 2018 at 11:16:07PM +0200, Alexandre Belloni wrote: > > Allow not building any DTB in the generic kernel so it gets smaller. This > > is necessary for ocelot because it can be built as a legacy platform that > > needs a built-in DTB and it can also handle a separate DTB once it is > > updated with a more modern bootloader. In the latter case, it is preferable > > to not include any DTB in the kernel image so it is smaller. > > Since bootloaders can modify DTs before passing them to the kernel (e.g. > to add cmdline args or memory nodes), that would seem to make it > impossible to have a kernel supporting both legacy bootloader, and a > u-boot which might do that DT tweaking. > > Or perhaps its not important for this platform. > It is still possible to generate a FIT image containing a kernel with a built in DTB and a separate DTB: > > diff --git a/arch/mips/Makefile b/arch/mips/Makefile > > index 5e9fce076ab6..3d3554c13710 100644 > > --- a/arch/mips/Makefile > > +++ b/arch/mips/Makefile > > @@ -404,7 +404,7 @@ endif > > CLEAN_FILES += vmlinux.32 vmlinux.64 > > > > # device-trees > > -core-$(CONFIG_BUILTIN_DTB) += arch/mips/boot/dts/ > > +core-y += arch/mips/boot/dts/ > > Won't that result in DTBs being built unnecessarily on other platforms > which support BUILTIN_DTB but don't have it enabled? > > I suppose the alternative is another Kconfig symbol for when building of > DTBs is needed, selected by BUILTIN_DTB and MIPS_GENERIC. > Does it matter? On arm all the DTBs for selected platforms are always built. It is not adding much to the build time. IIRC, without that change, it is not possible to build any dtb without having CONFIG_BUILTIN_DTB set. > > diff --git a/arch/mips/generic/Kconfig b/arch/mips/generic/Kconfig > > index 6564f18b2012..012f283f99c4 100644 > > --- a/arch/mips/generic/Kconfig > > +++ b/arch/mips/generic/Kconfig > > @@ -3,6 +3,7 @@ if MIPS_GENERIC > > > > config LEGACY_BOARDS > > bool > > + select BUILTIN_DTB > > help > > Select this from your board if the board must use a legacy, non-UHI, > > boot protocol. This will cause the kernel to scan through the list of > > diff --git a/arch/mips/generic/vmlinux.its.S b/arch/mips/generic/vmlinux.its.S > > index 1a08438fd893..9c954f2ae561 100644 > > --- a/arch/mips/generic/vmlinux.its.S > > +++ b/arch/mips/generic/vmlinux.its.S > > @@ -21,6 +21,7 @@ > > }; > > }; > > > > +#if IS_ENABLED(CONFIG_BUILTIN_DTB) > > An #ifdef would do, but no matter if it works. Though shouldn't that be > if !IS_ENABLED (or #ifndef)? > No, that is exactly the configuration I need to remove when no DTB has been built in the kernel. In that case, it doesn't make sense to provide a configuration using only the kernel. > A comment would be great here too to mention why its helpful. > -- Alexandre Belloni, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com