From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jon Loeliger Date: Wed, 12 Mar 2008 18:18:15 -0500 Subject: [U-Boot-Users] [RFC/PATCH] fix initdram / use of phys_addr_t In-Reply-To: References: <20080312222533.GF18968@game.jcrosoft.org> Message-ID: <47D864B7.5040505@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Kumar Gala wrote: > So is this acceptable? > > - k > > diff --git a/board/freescale/mpc8544ds/mpc8544ds.c b/board/freescale/mpc8544ds/mpc8544ds.c > index 8107016..24eea6f 100644 > --- a/board/freescale/mpc8544ds/mpc8544ds.c > +++ b/board/freescale/mpc8544ds/mpc8544ds.c > @@ -64,10 +64,9 @@ int checkboard (void) > return 0; > } > > -long int > -initdram(int board_type) > +phys_size_t initdram(int board_type) > { > - long dram_size = 0; > + phys_size_t dram_size = 0; > > puts("Initializing\n"); > > diff --git a/cpu/mpc85xx/spd_sdram.c b/cpu/mpc85xx/spd_sdram.c > index abc63c4..b2b1911 100644 > --- a/cpu/mpc85xx/spd_sdram.c > +++ b/cpu/mpc85xx/spd_sdram.c > @@ -169,8 +169,7 @@ unsigned int determine_refresh_rate(unsigned int spd_refresh) > } > > > -long int > -spd_sdram(void) > +phys_size_t spd_sdram(void) > { > volatile ccsr_ddr_t *ddr = (void *)(CFG_MPC85xx_DDR_ADDR); > spd_eeprom_t spd; > diff --git a/include/asm-ppc/types.h b/include/asm-ppc/types.h > index 7adf145..a797a00 100644 > --- a/include/asm-ppc/types.h > +++ b/include/asm-ppc/types.h > @@ -44,6 +44,8 @@ typedef unsigned long long u64; > /* DMA addresses are 32-bits wide */ > typedef u32 dma_addr_t; > > +typedef unsigned long phys_size_t; > + > #endif /* __KERNEL__ */ > #endif /* __ASSEMBLY__ */ > > diff --git a/include/common.h b/include/common.h > index cd8aad0..97e8e5a 100644 > --- a/include/common.h > +++ b/include/common.h > @@ -107,6 +107,8 @@ typedef volatile unsigned char vu_char; > #include > #endif > > +#include > + > #include > #include > #include > @@ -191,7 +193,7 @@ int serial_buffered_tstc (void); > void hang (void) __attribute__ ((noreturn)); > > /* */ > -long int initdram (int); > +phys_size_t initdram (int); > int display_options (void); > void print_size (ulong, const char *); > int print_buffer (ulong addr, void* data, uint width, uint count, uint linelen); > diff --git a/include/spd_sdram.h b/include/spd_sdram.h > index a2be96c..4909e41 100644 > --- a/include/spd_sdram.h > +++ b/include/spd_sdram.h > @@ -1,6 +1,6 @@ > #ifndef _SPD_SDRAM_H_ > #define _SPD_SDRAM_H_ > > -long int spd_sdram(void); > +phys_size_t spd_sdram(void); > > #endif Looks good to me. Is this the right patch to change the type of the parameter to print_size() too? jdl