All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@nvidia.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3] ventana: define CONFIG_MACH_VENTANA
Date: Thu, 01 Mar 2012 18:44:33 -0700	[thread overview]
Message-ID: <4F502601.6020102@nvidia.com> (raw)
In-Reply-To: <4F4FFE7D.7020809@boundarydevices.com>

On 03/01/2012 03:55 PM, Troy Kisky wrote:
> On 3/1/2012 2:30 PM, Stephen Warren wrote:
>> On 03/01/2012 02:13 PM, Troy Kisky wrote:
>>> ventana uses board/nvidia/seaboard/seaboard.c
>>> which uses machine_is_ventana.
>>> diff --git a/include/configs/ventana.h b/include/configs/ventana.h
>>> +#define CONFIG_MACH_VENTANA
>> It'd be nice not to have to do this; that header already does:
>>
>> #define CONFIG_MACH_TYPE                MACH_TYPE_VENTANA
>>
>> Can't the code key off that? Otherwise, any use of machine_is_xxx() will
>> be very error-prone, since CONFIG_MACH_XXX has to be manually defined,
>> and people will forget.
>>
> 
> Before patch 3/3 mach-types.h has
> 
> #ifdef CONFIG_MACH_VENTANA
> # ifdef machine_arch_type
> #  undef machine_arch_type
> #  define machine_arch_type    __machine_arch_type
> # else
> #  define machine_arch_type    MACH_TYPE_VENTANA
> # endif
> # define machine_is_ventana()  (machine_arch_type == MACH_TYPE_VENTANA)
> #else
> # define machine_is_ventana()  (0)
> #endif
> 
> So, it wants CONFIG_MACH_VENTANA defined.

Yes, there's certainly a pre-existing bug that needs to be fixed.

My point is that every board already needs to set CONFIG_MACH_TYPE to
the relevant type. It's quite unexpected that boards will /also/ need to
set e.g. CONFIG_MACH_VENTANA on top of that if they need to call
machine_is_xxx(). That is exactly why this bug exists for Ventana and
needs to be fixed.

So, rather than forcing this unusual requirement on boards, isn't it
possible to fix mach-types.h to use CONFIG_MACH_TYPE rather than
CONFIG_MACH_${machine_name}? It's probably not too hard to run some kind
of script over mach-types.h when importing it from the kernel, or
instead of importing the generated mach-types.h, import the source data
file and write a U-Boot-specific script that generates mach-types.h in a
format more suitable for U-Boot.

-- 
nvpublic

  parent reply	other threads:[~2012-03-02  1:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-01 21:13 [U-Boot] [PATCH 1/3] gplugd: use CONFIG_MACH_TYPE instead of MACH_TYPE_SHEEVAD Troy Kisky
2012-03-01 21:13 ` [U-Boot] [PATCH 2/3] ventana: define CONFIG_MACH_VENTANA Troy Kisky
2012-03-01 21:30   ` Stephen Warren
     [not found]     ` <4F4FFE7D.7020809@boundarydevices.com>
2012-03-02  1:44       ` Stephen Warren [this message]
2012-03-01 21:13 ` [U-Boot] [PATCH 3/3] ARM: Update mach-types Troy Kisky
2012-03-01 21:32   ` Stephen Warren
2012-03-01 21:54   ` Albert ARIBAUD
2012-03-01 22:50     ` Troy Kisky
2012-03-02  7:00       ` Wolfgang Denk
2012-03-02 17:45         ` Stephen Warren
2012-03-02 19:37           ` Troy Kisky
2012-03-02 20:08             ` Stephen Warren
2012-03-02 21:07       ` Troy Kisky
2012-03-03 10:15 ` [U-Boot] [PATCH 1/3] gplugd: use CONFIG_MACH_TYPE instead of MACH_TYPE_SHEEVAD Stefano Babic

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=4F502601.6020102@nvidia.com \
    --to=swarren@nvidia.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.