[U-Boot] [PATCH v2 1/5] rockchip: rk322x: update dram bank size

2017-08-17 Thread Kever Yang
The DRAM start address is not 0, so need to update the last bank size
as:
DRAM start addr + DRAM_SIZE - last bank start addr

Signed-off-by: Kever Yang 
Acked-by: Philipp Tomsich 
Reviewed-by: Philipp Tomsich 
Reviewed-by: Simon Glass 
---

Changes in v2: None

 arch/arm/mach-rockchip/rk322x-board.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-rockchip/rk322x-board.c 
b/arch/arm/mach-rockchip/rk322x-board.c
index b6543a5..f93bd33 100644
--- a/arch/arm/mach-rockchip/rk322x-board.c
+++ b/arch/arm/mach-rockchip/rk322x-board.c
@@ -72,11 +72,13 @@ int board_init(void)
 
 int dram_init_banksize(void)
 {
-   /* Reserve 0x20 for OPTEE */
-   gd->bd->bi_dram[0].start = 0x6000;
+   gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
gd->bd->bi_dram[0].size = 0x840;
-   gd->bd->bi_dram[1].start = 0x6a40;
-   gd->bd->bi_dram[1].size = gd->ram_size - gd->bd->bi_dram[1].start;
+   /* Reserve 14M for OPTEE and TA */
+   gd->bd->bi_dram[1].start = CONFIG_SYS_SDRAM_BASE
+   + gd->bd->bi_dram[0].size + 0xe0;
+   gd->bd->bi_dram[1].size = gd->bd->bi_dram[0].start
+   + gd->ram_size - gd->bd->bi_dram[1].start;
 
return 0;
 }
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/5] rockchip: rk322x: update dram bank size

2017-09-06 Thread Kever Yang

Hi Philipp,

This patch is a bug fix for rk3229 ram size, and not relate to the 
dram driver,


could you share why you still not take this patch?


Thanks,
- Kever
On 08/17/2017 03:17 PM, Kever Yang wrote:

The DRAM start address is not 0, so need to update the last bank size
as:
DRAM start addr + DRAM_SIZE - last bank start addr

Signed-off-by: Kever Yang 
Acked-by: Philipp Tomsich 
Reviewed-by: Philipp Tomsich 
Reviewed-by: Simon Glass 
---

Changes in v2: None

  arch/arm/mach-rockchip/rk322x-board.c | 10 ++
  1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-rockchip/rk322x-board.c 
b/arch/arm/mach-rockchip/rk322x-board.c
index b6543a5..f93bd33 100644
--- a/arch/arm/mach-rockchip/rk322x-board.c
+++ b/arch/arm/mach-rockchip/rk322x-board.c
@@ -72,11 +72,13 @@ int board_init(void)
  
  int dram_init_banksize(void)

  {
-   /* Reserve 0x20 for OPTEE */
-   gd->bd->bi_dram[0].start = 0x6000;
+   gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
gd->bd->bi_dram[0].size = 0x840;
-   gd->bd->bi_dram[1].start = 0x6a40;
-   gd->bd->bi_dram[1].size = gd->ram_size - gd->bd->bi_dram[1].start;
+   /* Reserve 14M for OPTEE and TA */
+   gd->bd->bi_dram[1].start = CONFIG_SYS_SDRAM_BASE
+   + gd->bd->bi_dram[0].size + 0xe0;
+   gd->bd->bi_dram[1].size = gd->bd->bi_dram[0].start
+   + gd->ram_size - gd->bd->bi_dram[1].start;
  
  	return 0;

  }



___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/5] rockchip: rk322x: update dram bank size

2017-09-06 Thread Dr. Philipp Tomsich
Kever,

I don’t have a problem with the below patch, but the entire series is held
up by patch #2 (adding the SDRAM driver):
https://patchwork.ozlabs.org/patch/802385/

I generally don’t attempt to apply parts of a series (and always apply the
entire series), as this just increases the risk of things getting out of sync
and I often don’t have a way to test whether things will still work with just
a part of a series applied.

Regarding patch #2 of this series:
My concern is with the duplication of code between individual SDRAM drivers
and I want to make sure that we reduce the amount of clutter (i.e. do a bit of
clean-up and de-duplication every time we touch code in this area) as we add
new drivers instead of increasing the code-duplication every time.

Regards,
Philipp.

> On 6 Sep 2017, at 11:39, Kever Yang  wrote:
> 
> Hi Philipp,
> 
>This patch is a bug fix for rk3229 ram size, and not relate to the dram 
> driver,
> 
> could you share why you still not take this patch?
> 
> 
> Thanks,
> - Kever
> On 08/17/2017 03:17 PM, Kever Yang wrote:
>> The DRAM start address is not 0, so need to update the last bank size
>> as:
>> DRAM start addr + DRAM_SIZE - last bank start addr
>> 
>> Signed-off-by: Kever Yang 
>> Acked-by: Philipp Tomsich 
>> Reviewed-by: Philipp Tomsich 
>> Reviewed-by: Simon Glass 
>> ---
>> 
>> Changes in v2: None
>> 
>>  arch/arm/mach-rockchip/rk322x-board.c | 10 ++
>>  1 file changed, 6 insertions(+), 4 deletions(-)
>> 
>> diff --git a/arch/arm/mach-rockchip/rk322x-board.c 
>> b/arch/arm/mach-rockchip/rk322x-board.c
>> index b6543a5..f93bd33 100644
>> --- a/arch/arm/mach-rockchip/rk322x-board.c
>> +++ b/arch/arm/mach-rockchip/rk322x-board.c
>> @@ -72,11 +72,13 @@ int board_init(void)
>>int dram_init_banksize(void)
>>  {
>> -/* Reserve 0x20 for OPTEE */
>> -gd->bd->bi_dram[0].start = 0x6000;
>> +gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
>>  gd->bd->bi_dram[0].size = 0x840;
>> -gd->bd->bi_dram[1].start = 0x6a40;
>> -gd->bd->bi_dram[1].size = gd->ram_size - gd->bd->bi_dram[1].start;
>> +/* Reserve 14M for OPTEE and TA */
>> +gd->bd->bi_dram[1].start = CONFIG_SYS_SDRAM_BASE
>> ++ gd->bd->bi_dram[0].size + 0xe0;
>> +gd->bd->bi_dram[1].size = gd->bd->bi_dram[0].start
>> ++ gd->ram_size - gd->bd->bi_dram[1].start;
>>  return 0;
>>  }
> 
> 

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot