diff mbox

[U-Boot,1/7] Orion5x: Correct DRAM bank detection

Message ID 1300435803-4940-2-git-send-email-rogan@dawes.za.net
State Accepted
Delegated to: Prafulla Wadaskar
Headers show

Commit Message

Rogan Dawes March 18, 2011, 8:09 a.m. UTC
From: Rogan Dawes <rogan@dawes.za.net>

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

Comments

Prafulla Wadaskar March 18, 2011, 10:52 a.m. UTC | #1
> -----Original Message-----
> From: u-boot-bounces@lists.denx.de [mailto:u-boot-bounces@lists.denx.de]
> On Behalf Of rogan@dawes.za.net
> Sent: Friday, March 18, 2011 1:40 PM
> To: u-boot@lists.denx.de
> Subject: [U-Boot] [PATCH 1/7] Orion5x: Correct DRAM bank detection
> 

Some more explanation about the patch may find help full.
Please have a practice to provide some detailed comments.
 
> From: Rogan Dawes <rogan@dawes.za.net>
> 
> ---
>  arch/arm/cpu/arm926ejs/orion5x/dram.c       |    2 +-
>  arch/arm/include/asm/arch-orion5x/orion5x.h |    1 +
>  2 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/cpu/arm926ejs/orion5x/dram.c
> b/arch/arm/cpu/arm926ejs/orion5x/dram.c
> index b749282..2ae8f48 100644
> --- a/arch/arm/cpu/arm926ejs/orion5x/dram.c
> +++ b/arch/arm/cpu/arm926ejs/orion5x/dram.c
> @@ -38,7 +38,7 @@ u32 orion5x_sdram_bar(enum memory_bank bank)
>  {
>  	struct orion5x_ddr_addr_decode_registers *winregs =
>  		(struct orion5x_ddr_addr_decode_registers *)
> -		ORION5X_CPU_WIN_BASE;
> +		ORION5X_DRAM_BASE;

Any explanation about previous definition was wrong?
Does struct orion5x_ddr_addr_decode_registers still valid for this change?

Regards..
Prafulla . .
Rogan Dawes March 18, 2011, 11:40 a.m. UTC | #2
On 2011/03/18 12:52 PM, Prafulla Wadaskar wrote:
> 
> 
>> -----Original Message-----
>> From: u-boot-bounces@lists.denx.de [mailto:u-boot-bounces@lists.denx.de]
>> On Behalf Of rogan@dawes.za.net
>> Sent: Friday, March 18, 2011 1:40 PM
>> To: u-boot@lists.denx.de
>> Subject: [U-Boot] [PATCH 1/7] Orion5x: Correct DRAM bank detection
>>
> 
> Some more explanation about the patch may find help full.
> Please have a practice to provide some detailed comments.

Hi Prafulla,

My apologies.

The register which was being read was the wrong register entirely.

For the common case where there was just one bank, it coincidentally
returned the right answer anyway (0), but if we tried to detect multiple
banks, the rest were totally wrong.

There is a parallel patch from Michael Spang, which does basically the
same thing. See message-id:
AANLkTinpqD97sYeLQKiGnB05PtJHUFUBh=T+Nx1+THau@mail.gmail.com

Regards,

Rogan
Prafulla Wadaskar April 13, 2011, 2:41 p.m. UTC | #3
> -----Original Message-----
> From: u-boot-bounces@lists.denx.de [mailto:u-boot-bounces@lists.denx.de]
> On Behalf Of rogan@dawes.za.net
> Sent: Friday, March 18, 2011 1:40 PM
> To: u-boot@lists.denx.de
> Subject: [U-Boot] [PATCH 1/7] Orion5x: Correct DRAM bank detection
> 
> From: Rogan Dawes <rogan@dawes.za.net>
> 
> ---
>  arch/arm/cpu/arm926ejs/orion5x/dram.c       |    2 +-
>  arch/arm/include/asm/arch-orion5x/orion5x.h |    1 +
>  2 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/cpu/arm926ejs/orion5x/dram.c
> b/arch/arm/cpu/arm926ejs/orion5x/dram.c
> index b749282..2ae8f48 100644
> --- a/arch/arm/cpu/arm926ejs/orion5x/dram.c
> +++ b/arch/arm/cpu/arm926ejs/orion5x/dram.c
> @@ -38,7 +38,7 @@ u32 orion5x_sdram_bar(enum memory_bank bank)
>  {
>  	struct orion5x_ddr_addr_decode_registers *winregs =
>  		(struct orion5x_ddr_addr_decode_registers *)
> -		ORION5X_CPU_WIN_BASE;
> +		ORION5X_DRAM_BASE;
> 
>  	u32 result = 0;
>  	u32 enable = 0x01 & winregs[bank].size;
> diff --git a/arch/arm/include/asm/arch-orion5x/orion5x.h
> b/arch/arm/include/asm/arch-orion5x/orion5x.h
> index e3d3f76..1dd9f65 100644
> --- a/arch/arm/include/asm/arch-orion5x/orion5x.h
> +++ b/arch/arm/include/asm/arch-orion5x/orion5x.h
> @@ -42,6 +42,7 @@
>  #define ORION5X_REGISTER(x)			(ORION5X_REGS_PHY_BASE + x)
> 
>  /* Documented registers */
> +#define ORION5X_DRAM_BASE			(ORION5X_REGISTER(0x01500))
>  #define ORION5X_TWSI_BASE			(ORION5X_REGISTER(0x11000))
>  #define ORION5X_UART0_BASE			(ORION5X_REGISTER(0x12000))
>  #define ORION5X_UART1_BASE			(ORION5X_REGISTER(0x12100))
> --
> 1.7.1

Applied to u-boot-marvell.git master branch

Regards..
Prafulla . .
diff mbox

Patch

diff --git a/arch/arm/cpu/arm926ejs/orion5x/dram.c b/arch/arm/cpu/arm926ejs/orion5x/dram.c
index b749282..2ae8f48 100644
--- a/arch/arm/cpu/arm926ejs/orion5x/dram.c
+++ b/arch/arm/cpu/arm926ejs/orion5x/dram.c
@@ -38,7 +38,7 @@  u32 orion5x_sdram_bar(enum memory_bank bank)
 {
 	struct orion5x_ddr_addr_decode_registers *winregs =
 		(struct orion5x_ddr_addr_decode_registers *)
-		ORION5X_CPU_WIN_BASE;
+		ORION5X_DRAM_BASE;
 
 	u32 result = 0;
 	u32 enable = 0x01 & winregs[bank].size;
diff --git a/arch/arm/include/asm/arch-orion5x/orion5x.h b/arch/arm/include/asm/arch-orion5x/orion5x.h
index e3d3f76..1dd9f65 100644
--- a/arch/arm/include/asm/arch-orion5x/orion5x.h
+++ b/arch/arm/include/asm/arch-orion5x/orion5x.h
@@ -42,6 +42,7 @@ 
 #define ORION5X_REGISTER(x)			(ORION5X_REGS_PHY_BASE + x)
 
 /* Documented registers */
+#define ORION5X_DRAM_BASE			(ORION5X_REGISTER(0x01500))
 #define ORION5X_TWSI_BASE			(ORION5X_REGISTER(0x11000))
 #define ORION5X_UART0_BASE			(ORION5X_REGISTER(0x12000))
 #define ORION5X_UART1_BASE			(ORION5X_REGISTER(0x12100))