diff mbox series

[v1,u-boot-marvell,3/5] arm: mvebu: turris_mox: support devices with RAM > 1 GB

Message ID 20200408172522.18941-4-marek.behun@nic.cz
State Accepted
Commit 4e9eb04c8d258521f2ec80ad857179f5e362f7fa
Headers show
Series MVEBU ARM64 improvments + another Turris Mox patch | expand

Commit Message

Marek BehĂșn April 8, 2020, 5:25 p.m. UTC
In order to support MOX boards with 2 GB or 4 GB RAM, we use the new
Armada-3700 generic code for memory information structures. This is done
by removing dram_init and dram_init_banksize from turris_mox.c, in order
for the generic, weak definitions to be used.

Also for boards with 4 GB RAM it is needed to increase
CONFIG_NR_DRAM_BANKS to 2 in turris_mox_defconfig.

Signed-off-by: Marek Beh?n <marek.behun at nic.cz>
---
 board/CZ.NIC/turris_mox/turris_mox.c | 16 ----------------
 configs/turris_mox_defconfig         |  2 +-
 2 files changed, 1 insertion(+), 17 deletions(-)

Comments

Stefan Roese April 14, 2020, 8:03 a.m. UTC | #1
On 08.04.20 19:25, Marek Beh?n wrote:
> In order to support MOX boards with 2 GB or 4 GB RAM, we use the new
> Armada-3700 generic code for memory information structures. This is done
> by removing dram_init and dram_init_banksize from turris_mox.c, in order
> for the generic, weak definitions to be used.
> 
> Also for boards with 4 GB RAM it is needed to increase
> CONFIG_NR_DRAM_BANKS to 2 in turris_mox_defconfig.
> 
> Signed-off-by: Marek Beh?n <marek.behun at nic.cz>

Reviewed-by: Stefan Roese <sr at denx.de>

Thanks,
Stefan

> ---
>   board/CZ.NIC/turris_mox/turris_mox.c | 16 ----------------
>   configs/turris_mox_defconfig         |  2 +-
>   2 files changed, 1 insertion(+), 17 deletions(-)
> 
> diff --git a/board/CZ.NIC/turris_mox/turris_mox.c b/board/CZ.NIC/turris_mox/turris_mox.c
> index 5bb53b1260..8e4c023103 100644
> --- a/board/CZ.NIC/turris_mox/turris_mox.c
> +++ b/board/CZ.NIC/turris_mox/turris_mox.c
> @@ -43,22 +43,6 @@
>   
>   DECLARE_GLOBAL_DATA_PTR;
>   
> -int dram_init(void)
> -{
> -	gd->ram_base = 0;
> -	gd->ram_size = (phys_size_t)get_ram_size(0, 0x40000000);
> -
> -	return 0;
> -}
> -
> -int dram_init_banksize(void)
> -{
> -	gd->bd->bi_dram[0].start = (phys_addr_t)0;
> -	gd->bd->bi_dram[0].size = gd->ram_size;
> -
> -	return 0;
> -}
> -
>   #if defined(CONFIG_OF_BOARD_FIXUP)
>   int board_fix_fdt(void *blob)
>   {
> diff --git a/configs/turris_mox_defconfig b/configs/turris_mox_defconfig
> index 3bc69cda4d..d786255d1d 100644
> --- a/configs/turris_mox_defconfig
> +++ b/configs/turris_mox_defconfig
> @@ -8,7 +8,7 @@ CONFIG_ENV_SIZE=0x10000
>   CONFIG_ENV_SECT_SIZE=0x10000
>   CONFIG_ENV_OFFSET=0x180000
>   CONFIG_DM_GPIO=y
> -CONFIG_NR_DRAM_BANKS=1
> +CONFIG_NR_DRAM_BANKS=2
>   CONFIG_DEBUG_UART_BASE=0xd0012000
>   CONFIG_DEBUG_UART_CLOCK=25804800
>   CONFIG_DEBUG_UART=y
> 


Viele Gr??e,
Stefan
diff mbox series

Patch

diff --git a/board/CZ.NIC/turris_mox/turris_mox.c b/board/CZ.NIC/turris_mox/turris_mox.c
index 5bb53b1260..8e4c023103 100644
--- a/board/CZ.NIC/turris_mox/turris_mox.c
+++ b/board/CZ.NIC/turris_mox/turris_mox.c
@@ -43,22 +43,6 @@ 
 
 DECLARE_GLOBAL_DATA_PTR;
 
-int dram_init(void)
-{
-	gd->ram_base = 0;
-	gd->ram_size = (phys_size_t)get_ram_size(0, 0x40000000);
-
-	return 0;
-}
-
-int dram_init_banksize(void)
-{
-	gd->bd->bi_dram[0].start = (phys_addr_t)0;
-	gd->bd->bi_dram[0].size = gd->ram_size;
-
-	return 0;
-}
-
 #if defined(CONFIG_OF_BOARD_FIXUP)
 int board_fix_fdt(void *blob)
 {
diff --git a/configs/turris_mox_defconfig b/configs/turris_mox_defconfig
index 3bc69cda4d..d786255d1d 100644
--- a/configs/turris_mox_defconfig
+++ b/configs/turris_mox_defconfig
@@ -8,7 +8,7 @@  CONFIG_ENV_SIZE=0x10000
 CONFIG_ENV_SECT_SIZE=0x10000
 CONFIG_ENV_OFFSET=0x180000
 CONFIG_DM_GPIO=y
-CONFIG_NR_DRAM_BANKS=1
+CONFIG_NR_DRAM_BANKS=2
 CONFIG_DEBUG_UART_BASE=0xd0012000
 CONFIG_DEBUG_UART_CLOCK=25804800
 CONFIG_DEBUG_UART=y