From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/3] mpc85xx: Add support for the MPC8572DS reference board
Date: Tue, 12 Aug 2008 11:23:40 -0500 [thread overview]
Message-ID: <48A1B90C.8060708@freescale.com> (raw)
In-Reply-To: <1218557695-2062-1-git-send-email-galak@kernel.crashing.org>
Kumar Gala wrote:
> + for (i = 0; i < CONFIG_CHIP_SELECTS_PER_CTRL; i++) {
> + unsigned int bnds = 0;
> + unsigned int config = 0;
> + unsigned int config_2 = 0;
> + unsigned int *pbnds = NULL;
> + unsigned int *pconfig = NULL;
> + unsigned int *pconfig_2 = NULL;
> +
> + if (i == 0) {
> + bnds = ddr->cs0_bnds;
> + config = ddr->cs0_config;
> + config_2 = ddr->cs0_config_2;
> + pbnds = (unsigned int *)&ddr->cs0_bnds;
> + pconfig = (unsigned int *)&ddr->cs0_config;
> + pconfig_2= (unsigned int *)&ddr->cs0_config_2;
> +
> + } else if (i == 1) {
> + bnds = ddr->cs1_bnds;
> + config = ddr->cs1_config;
> + config_2 = ddr->cs1_config_2;
> + pbnds = (unsigned int *)&ddr->cs1_bnds;
> + pconfig = (unsigned int *)&ddr->cs1_config;
> + pconfig_2= (unsigned int *)&ddr->cs1_config_2;
> +
> + } else if (i == 2) {
> + bnds = ddr->cs2_bnds;
> + config = ddr->cs2_config;
> + config_2 = ddr->cs2_config_2;
> + pbnds = (unsigned int *)&ddr->cs2_bnds;
> + pconfig = (unsigned int *)&ddr->cs2_config;
> + pconfig_2= (unsigned int *)&ddr->cs2_config_2;
> +
> + } else if (i == 3) {
> + bnds = ddr->cs3_bnds;
> + config = ddr->cs3_config;
> + config_2 = ddr->cs3_config_2;
> + pbnds = (unsigned int *) &ddr->cs3_bnds;
> + pconfig = (unsigned int *) &ddr->cs3_config;
> + pconfig_2= (unsigned int *) &ddr->cs3_config_2;
> +
> + } else {
> + /*
> + * FIXME what happens if CONFIG_CHIP_SELECTS_PER_CTRL > 4
> + */
> + }
> +
> + printf("cs%u_bnds = %08X\t%p\n", i, bnds, pbnds);
> + printf("cs%u_config = %08X\t%p\n", i, config, pconfig);
> + printf("cs%u_config_2 = %08X\t%p\n",
> + i, config_2, pconfig_2);
> + }
Couldn't we use arrays for this sort of thing?
-Scott
next prev parent reply other threads:[~2008-08-12 16:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-12 16:14 [U-Boot] [PATCH 1/3] mpc85xx: Add support for the MPC8572DS reference board Kumar Gala
2008-08-12 16:14 ` [U-Boot] [PATCH 2/3] mpc85xx: Add support for the MPC8536 Kumar Gala
2008-08-12 16:14 ` [U-Boot] [PATCH 3/3] mpc85xx: Add support for the MPC8536DS reference board Kumar Gala
2008-08-12 16:23 ` Scott Wood [this message]
2008-08-12 16:27 ` [U-Boot] [PATCH 1/3] mpc85xx: Add support for the MPC8572DS " Kumar Gala
2008-08-12 16:42 ` Scott Wood
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=48A1B90C.8060708@freescale.com \
--to=scottwood@freescale.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.