All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ARM: uniphier: set gd->ram_base correctly
@ 2020-01-30 13:20 Masahiro Yamada
  2020-01-30 13:20 ` [PATCH 2/2] ARM: uniphier: use $loadaddr for source command Masahiro Yamada
  2020-01-31 16:56 ` [PATCH 1/2] ARM: uniphier: set gd->ram_base correctly Masahiro Yamada
  0 siblings, 2 replies; 4+ messages in thread
From: Masahiro Yamada @ 2020-01-30 13:20 UTC (permalink / raw)
  To: u-boot

gd->ram_base is not set at all if the end address of the DRAM ch0
exceeds 4GB.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/mach-uniphier/dram_init.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/arch/arm/mach-uniphier/dram_init.c b/arch/arm/mach-uniphier/dram_init.c
index 13821a928831..5f9d90fe6dc0 100644
--- a/arch/arm/mach-uniphier/dram_init.c
+++ b/arch/arm/mach-uniphier/dram_init.c
@@ -248,12 +248,7 @@ int dram_init(void)
 
 		max_size = (1ULL << 32) - dram_map[i].base;
 
-		if (dram_map[i].size > max_size) {
-			gd->ram_size += max_size;
-			break;
-		}
-
-		gd->ram_size += dram_map[i].size;
+		gd->ram_size = min(dram_map[i].size, max_size);
 
 		if (!valid_bank_found)
 			gd->ram_base = dram_map[i].base;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] ARM: uniphier: use $loadaddr for source command
  2020-01-30 13:20 [PATCH 1/2] ARM: uniphier: set gd->ram_base correctly Masahiro Yamada
@ 2020-01-30 13:20 ` Masahiro Yamada
  2020-01-31 16:57   ` Masahiro Yamada
  2020-01-31 16:56 ` [PATCH 1/2] ARM: uniphier: set gd->ram_base correctly Masahiro Yamada
  1 sibling, 1 reply; 4+ messages in thread
From: Masahiro Yamada @ 2020-01-30 13:20 UTC (permalink / raw)
  To: u-boot

If the "source" command is not given the address, it uses
CONFIG_SYS_LOAD_ADDR, which is compile-time determined.

Using the "loadaddr" environment variable is handier because it is
relocated according to the memory base when CONFIG_POSITION_INDEPENDENT
is enabled.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 include/configs/uniphier.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/configs/uniphier.h b/include/configs/uniphier.h
index 29866668c491..b95fb9c93fa9 100644
--- a/include/configs/uniphier.h
+++ b/include/configs/uniphier.h
@@ -169,17 +169,17 @@
 		"ubi part UBI && " \
 		"ubifsmount ubi0:boot && " \
 		"ubifsload ${loadaddr} ${script} && " \
-		"source\0" \
+		"source $loadaddr\0" \
 	"norscript=echo Running ${script} from tftp ... && " \
 		"tftpboot ${script} &&" \
-		"source\0" \
+		"source $loadaddr\0" \
 	"usbscript=usb start && " \
 		"setenv devtype usb && " \
 		"setenv devnum 0 && " \
 		"run loadscript_fat\0" \
 	"loadscript_fat=echo Running ${script} from ${devtype}${devnum} ... && " \
 		"load ${devtype} ${devnum}:1 ${loadaddr} ${script} && " \
-		"source\0" \
+		"source $loadaddr\0" \
 	"sramupdate=setexpr tmp_addr $nor_base + 0x50000 &&"	\
 		"tftpboot $tmp_addr $second_image && " \
 		"setexpr tmp_addr $nor_base + 0x70000 && " \
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 1/2] ARM: uniphier: set gd->ram_base correctly
  2020-01-30 13:20 [PATCH 1/2] ARM: uniphier: set gd->ram_base correctly Masahiro Yamada
  2020-01-30 13:20 ` [PATCH 2/2] ARM: uniphier: use $loadaddr for source command Masahiro Yamada
@ 2020-01-31 16:56 ` Masahiro Yamada
  1 sibling, 0 replies; 4+ messages in thread
From: Masahiro Yamada @ 2020-01-31 16:56 UTC (permalink / raw)
  To: u-boot

On Thu, Jan 30, 2020 at 10:21 PM Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> gd->ram_base is not set at all if the end address of the DRAM ch0
> exceeds 4GB.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---


Applied to u-boot-uniphier.



>
>  arch/arm/mach-uniphier/dram_init.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/arch/arm/mach-uniphier/dram_init.c b/arch/arm/mach-uniphier/dram_init.c
> index 13821a928831..5f9d90fe6dc0 100644
> --- a/arch/arm/mach-uniphier/dram_init.c
> +++ b/arch/arm/mach-uniphier/dram_init.c
> @@ -248,12 +248,7 @@ int dram_init(void)
>
>                 max_size = (1ULL << 32) - dram_map[i].base;
>
> -               if (dram_map[i].size > max_size) {
> -                       gd->ram_size += max_size;
> -                       break;
> -               }
> -
> -               gd->ram_size += dram_map[i].size;
> +               gd->ram_size = min(dram_map[i].size, max_size);
>
>                 if (!valid_bank_found)
>                         gd->ram_base = dram_map[i].base;
> --
> 2.17.1
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] ARM: uniphier: use $loadaddr for source command
  2020-01-30 13:20 ` [PATCH 2/2] ARM: uniphier: use $loadaddr for source command Masahiro Yamada
@ 2020-01-31 16:57   ` Masahiro Yamada
  0 siblings, 0 replies; 4+ messages in thread
From: Masahiro Yamada @ 2020-01-31 16:57 UTC (permalink / raw)
  To: u-boot

On Thu, Jan 30, 2020 at 10:21 PM Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> If the "source" command is not given the address, it uses
> CONFIG_SYS_LOAD_ADDR, which is compile-time determined.
>
> Using the "loadaddr" environment variable is handier because it is
> relocated according to the memory base when CONFIG_POSITION_INDEPENDENT
> is enabled.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---


Applied to u-boot-uniphier.


>
>  include/configs/uniphier.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/include/configs/uniphier.h b/include/configs/uniphier.h
> index 29866668c491..b95fb9c93fa9 100644
> --- a/include/configs/uniphier.h
> +++ b/include/configs/uniphier.h
> @@ -169,17 +169,17 @@
>                 "ubi part UBI && " \
>                 "ubifsmount ubi0:boot && " \
>                 "ubifsload ${loadaddr} ${script} && " \
> -               "source\0" \
> +               "source $loadaddr\0" \
>         "norscript=echo Running ${script} from tftp ... && " \
>                 "tftpboot ${script} &&" \
> -               "source\0" \
> +               "source $loadaddr\0" \
>         "usbscript=usb start && " \
>                 "setenv devtype usb && " \
>                 "setenv devnum 0 && " \
>                 "run loadscript_fat\0" \
>         "loadscript_fat=echo Running ${script} from ${devtype}${devnum} ... && " \
>                 "load ${devtype} ${devnum}:1 ${loadaddr} ${script} && " \
> -               "source\0" \
> +               "source $loadaddr\0" \
>         "sramupdate=setexpr tmp_addr $nor_base + 0x50000 &&"    \
>                 "tftpboot $tmp_addr $second_image && " \
>                 "setexpr tmp_addr $nor_base + 0x70000 && " \
> --
> 2.17.1
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-01-31 16:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-30 13:20 [PATCH 1/2] ARM: uniphier: set gd->ram_base correctly Masahiro Yamada
2020-01-30 13:20 ` [PATCH 2/2] ARM: uniphier: use $loadaddr for source command Masahiro Yamada
2020-01-31 16:57   ` Masahiro Yamada
2020-01-31 16:56 ` [PATCH 1/2] ARM: uniphier: set gd->ram_base correctly Masahiro Yamada

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.