[U-Boot] [PATCH 1/3] mpc85xx: Add support for the MPC8572DS reference board
Scott Wood
scottwood at freescale.com
Tue Aug 12 18:23:40 CEST 2008
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
More information about the U-Boot
mailing list