public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/1] OMAP3: add boot status GPIO LED for IGEP boards
Date: Sun, 23 Dec 2012 13:15:08 +0100	[thread overview]
Message-ID: <50D6F5CC.2020002@collabora.co.uk> (raw)
In-Reply-To: <50D6B9E4.3060309@compulab.co.il>

On 12/23/2012 08:59 AM, Igor Grinberg wrote:
> On 12/22/12 03:49, Javier Martinez Canillas wrote:
>> This patch adds an GPIO LED boot status for IGEP boards.
>> 

Hi Igor, thanks a lot for your comments

>> @@ -52,9 +55,15 @@ static const u32 gpmc_lan_config[] = {
>>  int board_init(void)
>>  {
>>  	gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
>> +	/* machine type for kernel */
>> +	gd->bd->bi_arch_number = MACH_TYPE_IGEP0020;
> 
> Please, use CONFIG_MACH_TYPE instead.
> 
> [...]
> 

Yes, I was just setting this to have some state that could be used latter on
board/isee/led.c but now I realized that bi_arch_number is set in
arch/arm/lib/board.c

gd->bd->bi_arch_number = CONFIG_MACH_TYPE; /* board id for Linux */

So, I'm just going to remove this assignment

>> diff --git a/board/isee/igep0030/igep0030.c b/board/isee/igep0030/igep0030.c
>> index 107cb7f..394a6cf 100644
>> --- a/board/isee/igep0030/igep0030.c
>> +++ b/board/isee/igep0030/igep0030.c
> 
> [...]
> 
>> @@ -39,9 +42,15 @@ DECLARE_GLOBAL_DATA_PTR;
>>  int board_init(void)
>>  {
>>  	gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
>> +	/* machine type for kernel */
>> +	gd->bd->bi_arch_number = MACH_TYPE_IGEP0030;
> 
> same here
> 

ditto

> [...]
> 
>> diff --git a/board/isee/led.c b/board/isee/led.c
>> new file mode 100644
>> index 0000000..b7a9a02
>> --- /dev/null
>> +++ b/board/isee/led.c
> 
> [...]
> 
>> +
>> +/* GPIO pins for the LED */
>> +#define IGEP0020_GPIO_LED    27
>> +#define IGEP0030_GPIO_LED    16
>> +
>> +DECLARE_GLOBAL_DATA_PTR;
>> +
>> +static int __get_gpio()
>> +{
>> +	if (gd->bd->bi_arch_number == MACH_TYPE_IGEP0020)
>> +		return IGEP0020_GPIO_LED;
>> +	else
>> +		return IGEP0030_GPIO_LED;
>> +}
> 
> Once you define the CONFIG_MACH_TYPE in your board config file,
> you can then just do something like:
> 
> #if (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0020)
> #define IGEP_GPIO_LED	27
> #else /* MACH_TYPE_IGEP0030 */
> #define IGEP_GPIO_LED	16
> #endif
> 
> remove the above function completely and just use IGEP_GPIO_LED define.
> This will also probably simplify the below code.
> What do you think?
> 

Agreed, your approach is much better and simpler.

Will send a v2 with your suggestions,

Thanks a lot and best regards,
Javier

      reply	other threads:[~2012-12-23 12:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-22  1:49 [U-Boot] [PATCH 1/1] OMAP3: add boot status GPIO LED for IGEP boards Javier Martinez Canillas
2012-12-23  7:59 ` Igor Grinberg
2012-12-23 12:15   ` Javier Martinez Canillas [this message]

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=50D6F5CC.2020002@collabora.co.uk \
    --to=javier.martinez@collabora.co.uk \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox