Re: [U-Boot] [PATCH 19/27] image: Account for CONFIG_SYS_SDRAM_BASE being physical

2016-10-03 Thread Simon Glass
On 1 October 2016 at 08:19, Paul Burton  wrote:
> README declares that CONFIG_SYS_SDRAM_BASE is meant to be the physical
> address of SDRAM, but right now that is not the case on MIPS systems,
> where it is instead a virtual address. In preparation for making it
> physical, use phys_to_virt to translate CONFIG_SYS_SDRAM_BASE & the
> associated bi_memstart field of struct bd_info to virtual addresses for
> use.
>
> Signed-off-by: Paul Burton 
> ---
>
>  common/image.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Simon Glass 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 19/27] image: Account for CONFIG_SYS_SDRAM_BASE being physical

2016-10-01 Thread Paul Burton
README declares that CONFIG_SYS_SDRAM_BASE is meant to be the physical
address of SDRAM, but right now that is not the case on MIPS systems,
where it is instead a virtual address. In preparation for making it
physical, use phys_to_virt to translate CONFIG_SYS_SDRAM_BASE & the
associated bi_memstart field of struct bd_info to virtual addresses for
use.

Signed-off-by: Paul Burton 
---

 common/image.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/image.c b/common/image.c
index a5d19ab..1581022 100644
--- a/common/image.c
+++ b/common/image.c
@@ -466,7 +466,7 @@ ulong getenv_bootm_low(void)
}
 
 #if defined(CONFIG_SYS_SDRAM_BASE)
-   return CONFIG_SYS_SDRAM_BASE;
+   return (ulong)phys_to_virt(CONFIG_SYS_SDRAM_BASE);
 #elif defined(CONFIG_ARM)
return gd->bd->bi_dram[0].start;
 #else
@@ -488,7 +488,7 @@ phys_size_t getenv_bootm_size(void)
start = gd->bd->bi_dram[0].start;
size = gd->bd->bi_dram[0].size;
 #else
-   start = gd->bd->bi_memstart;
+   start = (ulong)phys_to_virt(gd->bd->bi_memstart);
size = gd->bd->bi_memsize;
 #endif
 
-- 
2.10.0

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