On Tue, Jul 31, 2012 at 12:59:23PM -0600, mathieu.poir...@linaro.org wrote:
> From: "Mathieu J. Poirier" <mathieu.poir...@linaro.org> > > Signed-off-by: Mathieu Poirier <mathieu.poir...@linaro.org> > Signed-off-by: John Rigby <john.ri...@linaro.org> [snip] > +++ b/board/st-ericsson/snowball/Makefile [snip] > +#prcmu.o Drop please. [snip] > +++ b/board/st-ericsson/snowball/snowball.c > +int dram_init(void) > +{ > + uint32_t unused_cols_rows; > + unsigned int nrows; > + unsigned int ncols; > + > + gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; > + gd->ram_size = PHYS_SDRAM_SIZE_1; > + > + /* > + * Assumption: 2 CS active, both CS have same layout. > + * 15 rows max, 11 cols max (controller spec). > + * memory chip has 8 banks, I/O width 32 bit. > + * The correct way would be to read MR#8: I/O width and density, > + * but this requires locking against the PRCMU firmware. > + * Simplified approach: > + * Read number of unused rows and columns from mem controller. > + * size = nCS x 2^(rows+cols) x nbanks x buswidth_bytes > + */ > + unused_cols_rows = readl(DMC_CTL_97); > + nrows = 15 - (unused_cols_rows & 0x07); > + ncols = 11 - ((unused_cols_rows & 0x0700) >> 8); > + gd->ram_size = gd->bd->bi_dram[0].size = > + 2 * (1 << (nrows + ncols)) * 8 * 4; Please use get_mem_size(CONFIG_SYS_SDRAM_BASE, possible-max-size) (and defining CONFIG_SYS_MAX_RAM_SIZE is common convention) instead of all the above. [snip] > +++ b/drivers/gpio/db8500_gpio.c [snip] > +/* > + * Macros to work with IO space > + * Not actually used? > + */ > +#define __iomem <linux/compiler.h> provides this for us, please use that instead. -- Tom _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot