diff mbox

[U-Boot,v3,3/4] kirkwood: implement kw_sdram_size_adjust

Message ID 1342787667-30073-3-git-send-email-holger.brunck@keymile.com
State Accepted
Delegated to: Prafulla Wadaskar
Headers show

Commit Message

Holger Brunck July 20, 2012, 12:34 p.m. UTC
From: Gerlando Falauto <gerlando.falauto@keymile.com>

Size of the SDRAM chips might differ between any two (otherwise
identical) instances of the same board. So add a function which reads
out the current ram size and set them in the SDRAM size register of
kirkwood.

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
cc: Prafulla Wadaskar <prafulla@marvell.com>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Marek Vasut <marex@denx.de>
---
chages for v3: 
  - rename dram_size_fixup to kw_sdramsize_adjust and move them to kirkwood/dram.c
  
changes for v2:
  - rebase to current u-boot-marvell.git master branch

 arch/arm/cpu/arm926ejs/kirkwood/dram.c   |   11 +++++++++++
 arch/arm/include/asm/arch-kirkwood/cpu.h |    1 +
 2 files changed, 12 insertions(+), 0 deletions(-)

Comments

Prafulla Wadaskar July 20, 2012, 7:10 p.m. UTC | #1
> -----Original Message-----
> From: Holger Brunck [mailto:holger.brunck@keymile.com]
> Sent: 20 July 2012 18:04
> To: u-boot@lists.denx.de
> Cc: Gerlando Falauto; Holger Brunck; Prafulla Wadaskar; Valentin
> Longchamp; Marek Vasut
> Subject: [PATCH v3 3/4] kirkwood: implement kw_sdram_size_adjust
> 
> From: Gerlando Falauto <gerlando.falauto@keymile.com>
> 
> Size of the SDRAM chips might differ between any two (otherwise
> identical) instances of the same board. So add a function which reads
> out the current ram size and set them in the SDRAM size register of
> kirkwood.
> 
> Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
> cc: Prafulla Wadaskar <prafulla@marvell.com>
> cc: Valentin Longchamp <valentin.longchamp@keymile.com>
> cc: Marek Vasut <marex@denx.de>
> ---
> chages for v3:
>   - rename dram_size_fixup to kw_sdramsize_adjust and move them to
> kirkwood/dram.c
> 
> changes for v2:
>   - rebase to current u-boot-marvell.git master branch
> 
>  arch/arm/cpu/arm926ejs/kirkwood/dram.c   |   11 +++++++++++
>  arch/arm/include/asm/arch-kirkwood/cpu.h |    1 +
>  2 files changed, 12 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/cpu/arm926ejs/kirkwood/dram.c
> b/arch/arm/cpu/arm926ejs/kirkwood/dram.c
> index 5e2f9d8..9f97964 100644
> --- a/arch/arm/cpu/arm926ejs/kirkwood/dram.c
> +++ b/arch/arm/cpu/arm926ejs/kirkwood/dram.c
> @@ -97,6 +97,17 @@ u32 kw_sdram_bs(enum memory_bank bank)
>  	return result;
>  }
> 
> +void kw_sdram_size_adjust(void)

I think you must pass bank_id to this function so that one can tune any/all of the four available DRAM banks.

Regards..
Prafulla . . .

> +{
> +	u32 size;
> +
> +	/* probe currently equipped RAM size */
> +	size = get_ram_size((void *)kw_sdram_bar(0), kw_sdram_bs(0));
> +
> +	/* adjust SDRAM window size accordingly */
> +	kw_sdram_bs_set(0, size);
> +}
> +
>  #ifndef CONFIG_SYS_BOARD_DRAM_INIT
>  int dram_init(void)
>  {
> diff --git a/arch/arm/include/asm/arch-kirkwood/cpu.h
> b/arch/arm/include/asm/arch-kirkwood/cpu.h
> index d28c51a..128393c 100644
> --- a/arch/arm/include/asm/arch-kirkwood/cpu.h
> +++ b/arch/arm/include/asm/arch-kirkwood/cpu.h
> @@ -159,6 +159,7 @@ void reset_cpu(unsigned long ignored);
>  unsigned char get_random_hex(void);
>  unsigned int kw_sdram_bar(enum memory_bank bank);
>  unsigned int kw_sdram_bs(enum memory_bank bank);
> +void kw_sdram_size_adjust(void);
>  int kw_config_adr_windows(void);
>  void kw_config_gpio(unsigned int gpp0_oe_val, unsigned int
> gpp1_oe_val,
>  		unsigned int gpp0_oe, unsigned int gpp1_oe);
> --
> 1.7.1
Prafulla Wadaskar Sept. 6, 2012, 11:20 p.m. UTC | #2
> -----Original Message-----
> From: Prafulla Wadaskar
> Sent: 20 July 2012 12:10
> To: 'Holger Brunck'; u-boot@lists.denx.de
> Cc: Gerlando Falauto; Valentin Longchamp; Marek Vasut
> Subject: RE: [PATCH v3 3/4] kirkwood: implement kw_sdram_size_adjust
> 
> 
> 
> > -----Original Message-----
> > From: Holger Brunck [mailto:holger.brunck@keymile.com]
> > Sent: 20 July 2012 18:04
> > To: u-boot@lists.denx.de
> > Cc: Gerlando Falauto; Holger Brunck; Prafulla Wadaskar; Valentin
> > Longchamp; Marek Vasut
> > Subject: [PATCH v3 3/4] kirkwood: implement kw_sdram_size_adjust
> >
> > From: Gerlando Falauto <gerlando.falauto@keymile.com>
> >
> > Size of the SDRAM chips might differ between any two (otherwise
> > identical) instances of the same board. So add a function which
> reads
> > out the current ram size and set them in the SDRAM size register of
> > kirkwood.
> >
> > Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
> > Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
> > cc: Prafulla Wadaskar <prafulla@marvell.com>
> > cc: Valentin Longchamp <valentin.longchamp@keymile.com>
> > cc: Marek Vasut <marex@denx.de>
> > ---
> > chages for v3:
> >   - rename dram_size_fixup to kw_sdramsize_adjust and move them to
> > kirkwood/dram.c
> >
> > changes for v2:
> >   - rebase to current u-boot-marvell.git master branch
> >
> >  arch/arm/cpu/arm926ejs/kirkwood/dram.c   |   11 +++++++++++
> >  arch/arm/include/asm/arch-kirkwood/cpu.h |    1 +
> >  2 files changed, 12 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/arm/cpu/arm926ejs/kirkwood/dram.c
> > b/arch/arm/cpu/arm926ejs/kirkwood/dram.c
> > index 5e2f9d8..9f97964 100644
> > --- a/arch/arm/cpu/arm926ejs/kirkwood/dram.c
> > +++ b/arch/arm/cpu/arm926ejs/kirkwood/dram.c
> > @@ -97,6 +97,17 @@ u32 kw_sdram_bs(enum memory_bank bank)
> >  	return result;
> >  }
> >
> > +void kw_sdram_size_adjust(void)
> 
> I think you must pass bank_id to this function so that one can tune
> any/all of the four available DRAM banks.

Hi Hogler
This has not yet closed hence not pulled this patch series.

Do you have any comments on this?

Regards...
Prafulla . . .
Holger Brunck Sept. 7, 2012, 6:47 a.m. UTC | #3
On 09/07/2012 01:20 AM, Prafulla Wadaskar wrote:
> 
> 
>> -----Original Message-----
>> From: Prafulla Wadaskar
>> Sent: 20 July 2012 12:10
>> To: 'Holger Brunck'; u-boot@lists.denx.de
>> Cc: Gerlando Falauto; Valentin Longchamp; Marek Vasut
>> Subject: RE: [PATCH v3 3/4] kirkwood: implement kw_sdram_size_adjust
>>
>>
>>
>>> -----Original Message-----
>>> From: Holger Brunck [mailto:holger.brunck@keymile.com]
>>> Sent: 20 July 2012 18:04
>>> To: u-boot@lists.denx.de
>>> Cc: Gerlando Falauto; Holger Brunck; Prafulla Wadaskar; Valentin
>>> Longchamp; Marek Vasut
>>> Subject: [PATCH v3 3/4] kirkwood: implement kw_sdram_size_adjust
>>>
>>> From: Gerlando Falauto <gerlando.falauto@keymile.com>
>>>
>>> Size of the SDRAM chips might differ between any two (otherwise
>>> identical) instances of the same board. So add a function which
>> reads
>>> out the current ram size and set them in the SDRAM size register of
>>> kirkwood.
>>>
>>> Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
>>> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
>>> cc: Prafulla Wadaskar <prafulla@marvell.com>
>>> cc: Valentin Longchamp <valentin.longchamp@keymile.com>
>>> cc: Marek Vasut <marex@denx.de>
>>> ---
>>> chages for v3:
>>>   - rename dram_size_fixup to kw_sdramsize_adjust and move them to
>>> kirkwood/dram.c
>>>
>>> changes for v2:
>>>   - rebase to current u-boot-marvell.git master branch
>>>
>>>  arch/arm/cpu/arm926ejs/kirkwood/dram.c   |   11 +++++++++++
>>>  arch/arm/include/asm/arch-kirkwood/cpu.h |    1 +
>>>  2 files changed, 12 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/arch/arm/cpu/arm926ejs/kirkwood/dram.c
>>> b/arch/arm/cpu/arm926ejs/kirkwood/dram.c
>>> index 5e2f9d8..9f97964 100644
>>> --- a/arch/arm/cpu/arm926ejs/kirkwood/dram.c
>>> +++ b/arch/arm/cpu/arm926ejs/kirkwood/dram.c
>>> @@ -97,6 +97,17 @@ u32 kw_sdram_bs(enum memory_bank bank)
>>>  	return result;
>>>  }
>>>
>>> +void kw_sdram_size_adjust(void)
>>
>> I think you must pass bank_id to this function so that one can tune
>> any/all of the four available DRAM banks.
> 
> Hi Hogler
> This has not yet closed hence not pulled this patch series.
> 
> Do you have any comments on this?
> 

updates concerning these change request were send long time ago. The references are:

http://lists.denx.de/pipermail/u-boot/2012-July/129116.html
http://lists.denx.de/pipermail/u-boot/2012-July/129117.html

Regards
Holger
Prafulla Wadaskar Sept. 7, 2012, 4:56 p.m. UTC | #4
> -----Original Message-----
> From: Holger Brunck [mailto:holger.brunck@keymile.com]
> Sent: 06 September 2012 23:47
> To: Prafulla Wadaskar
> Cc: u-boot@lists.denx.de; Gerlando Falauto; Valentin Longchamp; Marek
> Vasut
> Subject: Re: [PATCH v3 3/4] kirkwood: implement kw_sdram_size_adjust
> 
> On 09/07/2012 01:20 AM, Prafulla Wadaskar wrote:
> >
> >
> >> -----Original Message-----
> >> From: Prafulla Wadaskar
> >> Sent: 20 July 2012 12:10
> >> To: 'Holger Brunck'; u-boot@lists.denx.de
> >> Cc: Gerlando Falauto; Valentin Longchamp; Marek Vasut
> >> Subject: RE: [PATCH v3 3/4] kirkwood: implement
> kw_sdram_size_adjust
> >>
> >>
> >>
> >>> -----Original Message-----
> >>> From: Holger Brunck [mailto:holger.brunck@keymile.com]
> >>> Sent: 20 July 2012 18:04
> >>> To: u-boot@lists.denx.de
> >>> Cc: Gerlando Falauto; Holger Brunck; Prafulla Wadaskar; Valentin
> >>> Longchamp; Marek Vasut
> >>> Subject: [PATCH v3 3/4] kirkwood: implement kw_sdram_size_adjust
> >>>
> >>> From: Gerlando Falauto <gerlando.falauto@keymile.com>
> >>>
> >>> Size of the SDRAM chips might differ between any two (otherwise
> >>> identical) instances of the same board. So add a function which
> >> reads
> >>> out the current ram size and set them in the SDRAM size register
> of
> >>> kirkwood.
> >>>
> >>> Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
> >>> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
> >>> cc: Prafulla Wadaskar <prafulla@marvell.com>
> >>> cc: Valentin Longchamp <valentin.longchamp@keymile.com>
> >>> cc: Marek Vasut <marex@denx.de>
> >>> ---
> >>> chages for v3:
> >>>   - rename dram_size_fixup to kw_sdramsize_adjust and move them to
> >>> kirkwood/dram.c
> >>>
> >>> changes for v2:
> >>>   - rebase to current u-boot-marvell.git master branch
> >>>
> >>>  arch/arm/cpu/arm926ejs/kirkwood/dram.c   |   11 +++++++++++
> >>>  arch/arm/include/asm/arch-kirkwood/cpu.h |    1 +
> >>>  2 files changed, 12 insertions(+), 0 deletions(-)
> >>>
> >>> diff --git a/arch/arm/cpu/arm926ejs/kirkwood/dram.c
> >>> b/arch/arm/cpu/arm926ejs/kirkwood/dram.c
> >>> index 5e2f9d8..9f97964 100644
> >>> --- a/arch/arm/cpu/arm926ejs/kirkwood/dram.c
> >>> +++ b/arch/arm/cpu/arm926ejs/kirkwood/dram.c
> >>> @@ -97,6 +97,17 @@ u32 kw_sdram_bs(enum memory_bank bank)
> >>>  	return result;
> >>>  }
> >>>
> >>> +void kw_sdram_size_adjust(void)
> >>
> >> I think you must pass bank_id to this function so that one can tune
> >> any/all of the four available DRAM banks.
> >
> > Hi Hogler
> > This has not yet closed hence not pulled this patch series.
> >
> > Do you have any comments on this?
> >
> 
> updates concerning these change request were send long time ago. The
> references are:
> 
> http://lists.denx.de/pipermail/u-boot/2012-July/129116.html
> http://lists.denx.de/pipermail/u-boot/2012-July/129117.html

Thanks Holger,
I will pull them soon.

Regards...
Prafulla . . .
diff mbox

Patch

diff --git a/arch/arm/cpu/arm926ejs/kirkwood/dram.c b/arch/arm/cpu/arm926ejs/kirkwood/dram.c
index 5e2f9d8..9f97964 100644
--- a/arch/arm/cpu/arm926ejs/kirkwood/dram.c
+++ b/arch/arm/cpu/arm926ejs/kirkwood/dram.c
@@ -97,6 +97,17 @@  u32 kw_sdram_bs(enum memory_bank bank)
 	return result;
 }
 
+void kw_sdram_size_adjust(void)
+{
+	u32 size;
+
+	/* probe currently equipped RAM size */
+	size = get_ram_size((void *)kw_sdram_bar(0), kw_sdram_bs(0));
+
+	/* adjust SDRAM window size accordingly */
+	kw_sdram_bs_set(0, size);
+}
+
 #ifndef CONFIG_SYS_BOARD_DRAM_INIT
 int dram_init(void)
 {
diff --git a/arch/arm/include/asm/arch-kirkwood/cpu.h b/arch/arm/include/asm/arch-kirkwood/cpu.h
index d28c51a..128393c 100644
--- a/arch/arm/include/asm/arch-kirkwood/cpu.h
+++ b/arch/arm/include/asm/arch-kirkwood/cpu.h
@@ -159,6 +159,7 @@  void reset_cpu(unsigned long ignored);
 unsigned char get_random_hex(void);
 unsigned int kw_sdram_bar(enum memory_bank bank);
 unsigned int kw_sdram_bs(enum memory_bank bank);
+void kw_sdram_size_adjust(void);
 int kw_config_adr_windows(void);
 void kw_config_gpio(unsigned int gpp0_oe_val, unsigned int gpp1_oe_val,
 		unsigned int gpp0_oe, unsigned int gpp1_oe);