All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Kelly <mkelly@xevo.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] sunxi: use CONFIG_DEFAULT_FDT_FILE everywhere
Date: Fri, 1 Jun 2018 10:16:07 -0700	[thread overview]
Message-ID: <e04c6afa-4e2c-136c-37a0-40df67cf1f1c@xevo.com> (raw)
In-Reply-To: <BEF26145-CEFF-4327-BE1C-D0A0F8177783@theobroma-systems.com>

On 05/31/2018 07:45 PM, klaus.goger at theobroma-systems.com wrote:
> 
> 
>> On 01.06.2018, at 02:59, Martin Kelly <mkelly@xevo.com> wrote:
>>
>> Currently, sunxi-common.h ignores CONFIG_DEFAULT_FDT_FILE and assumes
>> the kernel fdtfile and the u-boot devicetree names are the same.
>> Although this is typically the case, sometimes you might want to
>> customize one of these differently, so it's useful to allow them to be
>> different.
>>
>> Fix this to use only CONFIG_DEFAULT_FDT_FILE as other boards do, and set
>> CONFIG_DEFAULT_FDT_FILE in board files to be the same as the current
>> fdtfile= setting.
>>
>> Signed-off-by: Martin Kelly <mkelly@xevo.com>
>> ---
>> This patch is against u-boot master and thus conflicts with u-boot sunxi patch
>> 31510b41f6b736fd03e2779a2585f85df39e667f ("sunxi: allow CONFIG_DEFAULT_FDT_FILE
>> override"). If you would like me to apply this against the sunxi tree instead, I
>> would be happy to do so and resend it.
>>
>> Obviously, I cannot test a change like this on every board. Here's the tests I
>> did:
>>
>> - Booted on the nanopi neo plus2 (the board I do have).
>> - Compile-tested every affected config.
>> - To avoid missing anything I generated the config changes with the following
>>   Python script. This script mimics what the preprocessor was doing, but encodes
>>   it explicitly in the config. Reviewing the script is probably easier than
>>   reviewing each individual file:
>>
>> #!/usr/bin/python3
>>
>> import os
>>
>> root = '/home/martin/u-boot/configs'
>> for name in os.listdir(root):
>>     path = os.path.join(root, name)
>>     with open(path, 'r') as f:
>>         contents = f.read()
>>     if 'CONFIG_ARCH_SUNXI=y' not in contents:
>>         continue
>>     if 'CONFIG_DEFAULT_FDT_FILE=' in contents:
>>         # Make the script idempotent.
>>         continue
>>
>>     if 'CONFIG_MACH_SUN50I=y' in contents or 'CONFIG_MACH_SUN50I_H5=y' in contents:
>>         arm64 = True
>>     else:
>>         arm64 = False
>>
>>     lines = []
>>     for line in contents.split('\n'):
>>         if line.startswith('CONFIG_DEFAULT_DEVICE_TREE='):
>>             split = line.split('=')
>>             assert(len(split) == 2)
>>             dtb = split[1]
>>
>>             if dtb[0] == '"' and dtb[-1] == '"':
>>                 # Dequotify.
>>                 dtb = dtb[1:-1]
>>
>>             dtb = '%s.dtb' % dtb
>>             if arm64:
>>                 dtb = 'allwinner/%s' % dtb
>>
>>             lines.append('CONFIG_DEFAULT_FDT_FILE="%s"' % dtb)
>>         lines.append(line)
>>
>>     with open(path, 'w') as f:
>>         f.write('\n'.join(lines))
>>
>> [end script]
> 
> Looks fine to me.
> My only note would be that your script adds CONFIG_DEFAULT_FDT_FILE at a different
> line as when generated by savedefconfig.
> 

Good point. I might as well change that to avoid unnecessary churn when 
you run savedefconfig.

  reply	other threads:[~2018-06-01 17:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-01  0:59 [U-Boot] [PATCH] sunxi: use CONFIG_DEFAULT_FDT_FILE everywhere Martin Kelly
2018-06-01  2:45 ` klaus.goger at theobroma-systems.com
2018-06-01 17:16   ` Martin Kelly [this message]
2018-06-01 11:05 ` Maxime Ripard
2018-06-01 17:16   ` Martin Kelly
2018-06-04  8:21     ` Maxime Ripard
2018-06-04 18:15       ` Martin Kelly
2018-06-06 14:58         ` Maxime Ripard
2018-06-06 17:51           ` Martin Kelly
2018-06-11 17:19             ` Martin Kelly

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e04c6afa-4e2c-136c-37a0-40df67cf1f1c@xevo.com \
    --to=mkelly@xevo.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.