public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ilya Yanok <yanok@emcraft.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/5] mpc83xx/pcie: make it compile with PCIE2 unconfigured
Date: Sat, 18 Sep 2010 01:35:35 +0400	[thread overview]
Message-ID: <4C93DF27.4020706@emcraft.com> (raw)
In-Reply-To: <20100916185453.cb967dd5.kim.phillips@freescale.com>

Hi Kim,

On 17.09.2010 03:54, Kim Phillips wrote:
>> +#if defined(CONFIG_SYS_PCIE2_CFG_BASE)&&  defined(CONFIG_SYS_PCIE2_SIZE)
>>   #define PCIE_MAX_BUSES 2
>> +#else
>> +#define PCIE_MAX_BUSES 1
>> +#endif
>>      
> Technically this should be an indirect function of MPC8308, but what's
> the problem with leaving MAX_BUSES as 2 always?
>    

Well, we can save a couple of bytes but I agree it doesn't worth it. 
I'll remove the ifdef here.

>> +	unsigned int *cfg_addr;
>> +
>> +	if (bus == 0) {
>> +		cfg_addr = (unsigned int *)CONFIG_SYS_PCIE1_CFG_BASE;
>> +	} else {
>> +#if defined(CONFIG_SYS_PCIE2_CFG_BASE)&&  defined(CONFIG_SYS_PCIE2_SIZE)
>> +		cfg_addr = (unsigned int *)CONFIG_SYS_PCIE2_CFG_BASE;
>> +#else
>> +		printf("Second PCIE host controller not configured!\n");
>> +		return;
>> +#endif
>>      
> let's reduce the new ifdefs introduced in the file down to one, and
> still be able remove the 'if (bus)' clauses by adding a static pcie cfg
> struct array[], to which this and code below it would directly
> dereference with array[bus].  The single ifdef should protect the
> second entry in the array.  The "second PCIE host controller not
> configured" check can be made by comparing num_buses with ARRAY_SIZE
> (array) in mpc83xx_pcie_init prior to calling mpc83xx_pcie_init_bus
> with an illegal bus value.
>    

Yes, this sounds like much cleaner code. I'll post the updated patches 
in the short while.

Regards, Ilya.

  reply	other threads:[~2010-09-17 21:35 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-25 14:00 [U-Boot] [PATCH] mpc8308_p1m: support for MPC8308 P1M board Ilya Yanok
2010-09-06 10:32 ` [U-Boot] [PATCH][v2] " Ilya Yanok
2010-09-07 21:47   ` Scott Wood
2010-09-08 21:36     ` [U-Boot] [PATCH][v3] " Ilya Yanok
2010-09-14  1:12       ` Kim Phillips
2010-09-14 20:40         ` [U-Boot] [PATCH 1/5] mpc83xx/pcie: make it compile with PCIE2 unconfigured Ilya Yanok
2010-09-14 20:40           ` [U-Boot] [PATCH 2/5] mpc83xx: add support for setting PCIE clocks Ilya Yanok
2010-09-14 20:40             ` [U-Boot] [PATCH 3/5] mpc8308: add SICR{L,H} fields definitions Ilya Yanok
2010-09-14 20:40               ` [U-Boot] [PATCH 4/5] MPC8308RDB: various clean ups Ilya Yanok
2010-09-14 20:40                 ` [U-Boot] [PATCH 5/5] mpc8308_p1m: support for MPC8308 P1M board Ilya Yanok
2010-09-16 23:56                 ` [U-Boot] [PATCH 4/5] MPC8308RDB: various clean ups Kim Phillips
2010-09-16 23:54           ` [U-Boot] [PATCH 1/5] mpc83xx/pcie: make it compile with PCIE2 unconfigured Kim Phillips
2010-09-17 21:35             ` Ilya Yanok [this message]
2010-09-17 21:41             ` Ilya Yanok
2010-09-22 21:02               ` Kim Phillips
2010-09-17 21:41             ` [U-Boot] [PATCH 2/5] mpc83xx: add support for setting PCIE clocks Ilya Yanok
2010-09-17 21:41             ` [U-Boot] [PATCH 3/5] mpc8308: add SICR{L,H} fields definitions Ilya Yanok
2010-09-17 21:41             ` [U-Boot] [PATCH 4/5] MPC8308RDB: various clean ups Ilya Yanok
2010-09-17 21:41             ` [U-Boot] [PATCH 5/5] mpc8308_p1m: support for MPC8308 P1M board Ilya Yanok
2010-09-18 20:35         ` [U-Boot] [PATCH][v3] " Wolfgang Denk
2010-09-20 16:18           ` Scott Wood
2010-09-20 16:42             ` Wolfgang Denk
2010-09-20 23:56               ` Kim Phillips

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=4C93DF27.4020706@emcraft.com \
    --to=yanok@emcraft.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox