]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
global: Move from bi_memstart/memsize -> gd->ram_base/ram_size
authorStefan Roese <sr@denx.de>
Wed, 12 Aug 2020 11:16:36 +0000 (13:16 +0200)
committerStefan Roese <sr@denx.de>
Wed, 26 Aug 2020 07:19:34 +0000 (09:19 +0200)
With the planned removal of bi_memstart & bi_memsize, this patch now
moves the references to the better suiting gd->ram_base/ram_size
variables.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 files changed:
api/api_platform-mips.c
api/api_platform-powerpc.c
arch/mips/lib/boot.c
arch/mips/lib/bootm.c
arch/powerpc/cpu/mpc83xx/fdt.c
arch/powerpc/cpu/mpc83xx/traps.c
arch/powerpc/cpu/mpc85xx/fdt.c
arch/powerpc/cpu/mpc85xx/traps.c
arch/powerpc/cpu/mpc86xx/fdt.c
arch/powerpc/cpu/mpc86xx/traps.c
arch/powerpc/cpu/mpc8xx/fdt.c
arch/powerpc/lib/bootm.c
arch/xtensa/lib/bootm.c
cmd/bedbug.c

index 51cd328b3d0f93085e83e6430ce149c1a09f6c86..e1509663af54c76d042eff4dbdc67a44330d3281 100644 (file)
@@ -24,8 +24,7 @@ DECLARE_GLOBAL_DATA_PTR;
 int platform_sys_info(struct sys_info *si)
 {
 
-       platform_set_mr(si, gd->bd->bi_memstart,
-                       gd->bd->bi_memsize, MR_ATTR_DRAM);
+       platform_set_mr(si, gd->ram_base, gd->ram_size, MR_ATTR_DRAM);
 
        return 1;
 }
index 15930cfdb66286fbc31c99ebf4779434dc853cbb..847a4a3015b0a46898a032c581c6fc38c1e49ea3 100644 (file)
@@ -42,7 +42,7 @@ int platform_sys_info(struct sys_info *si)
        si->bar = 0;
 #endif
 
-       platform_set_mr(si, gd->bd->bi_memstart, gd->bd->bi_memsize, MR_ATTR_DRAM);
+       platform_set_mr(si, gd->ram_base, gd->ram_size, MR_ATTR_DRAM);
        platform_set_mr(si, gd->bd->bi_flashstart, gd->bd->bi_flashsize, MR_ATTR_FLASH);
        platform_set_mr(si, gd->bd->bi_sramstart, gd->bd->bi_sramsize, MR_ATTR_SRAM);
 
index db862f637925e3bc2ddc56f19715aeeae54f263f..6ef9109022e30dfe9d3fbe3cad5fe0b79841c80f 100644 (file)
@@ -17,7 +17,7 @@ unsigned long do_go_exec(ulong (*entry)(int, char * const []),
         * whole SDRAM area, since we don't know the size of the image
         * that was loaded.
         */
-       flush_cache(gd->bd->bi_memstart, gd->ram_top - gd->bd->bi_memstart);
+       flush_cache(gd->ram_base, gd->ram_top - gd->ram_base);
 
        return entry(argc, argv);
 }
index 0a13f6edb7554a388d9f7a3cf82fa051b7154b19..d5c99d891cd0c3f1a5775faa95d6d5f18bb674df 100644 (file)
@@ -242,7 +242,7 @@ static int boot_reloc_fdt(bootm_headers_t *images)
 #if CONFIG_IS_ENABLED(MIPS_BOOT_FDT) && CONFIG_IS_ENABLED(OF_LIBFDT)
 int arch_fixup_fdt(void *blob)
 {
-       u64 mem_start = virt_to_phys((void *)gd->bd->bi_memstart);
+       u64 mem_start = virt_to_phys((void *)gd->ram_base);
        u64 mem_size = gd->ram_size;
 
        return fdt_fixup_memory_banks(blob, &mem_start, &mem_size, 1);
index ebdedb28889cf766fbf462156e1a8ca59997888b..4ea7b27ef412ec9584a4e88f30e86876a824c57f 100644 (file)
@@ -121,7 +121,7 @@ void ft_cpu_setup(void *blob, struct bd_info *bd)
                 "clock-frequency", get_serial_clock(), 1);
 #endif
 
-       fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
+       fdt_fixup_memory(blob, (u64)gd->ram_base, (u64)gd->ram_size);
 
 #if defined(CONFIG_BOOTCOUNT_LIMIT) && \
        (defined(CONFIG_QE) && !defined(CONFIG_ARCH_MPC831X))
index c3cc119d6542cbe712de611e4eb17cebc2d3f2cd..ea8bc6c15280d11e439f2652528d83ce21971d37 100644 (file)
@@ -23,7 +23,7 @@ DECLARE_GLOBAL_DATA_PTR;
 /* Returns 0 if exception not found and fixup otherwise.  */
 extern unsigned long search_exception_table(unsigned long);
 
-#define END_OF_MEM     (gd->bd->bi_memstart + gd->bd->bi_memsize)
+#define END_OF_MEM     (gd->ram_base + gd->ram_size)
 
 /*
  * Trap & Exception support
index 9569c1a64b81d6e5ac59d891a757ddc8866c59c4..0d8353ceb26cec7da8fd01c95c76e2e98ddbb24d 100644 (file)
@@ -672,10 +672,10 @@ void ft_cpu_setup(void *blob, struct bd_info *bd)
                "clock-frequency", get_bus_freq(0), 1);
 #endif
 
-       fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
+       fdt_fixup_memory(blob, (u64)gd->ram_base, (u64)gd->ram_size);
 
 #ifdef CONFIG_MP
-       ft_fixup_cpu(blob, (u64)bd->bi_memstart + (u64)bd->bi_memsize);
+       ft_fixup_cpu(blob, (u64)gd->ram_base + (u64)gd->ram_size);
        ft_fixup_num_cores(blob);
 #endif
 
index f37a45e2694ed4ec6720cdccedee2cf74e02f3df..db6ed1fc92e931a89cc3ee4aaa1ecf43cda757b8 100644 (file)
@@ -37,7 +37,7 @@ extern unsigned long search_exception_table(unsigned long);
  * amount of memory on the system if we're unable to keep all
  * the memory mapped in.
  */
-#define END_OF_MEM (gd->bd->bi_memstart + get_effective_memsize())
+#define END_OF_MEM     (gd->ram_base + get_effective_memsize())
 
 static __inline__ void set_tsr(unsigned long val)
 {
index 24e53115eccf8cda9ec3d824117a1a78eb57df5a..010b6d4fe60670236799535e6c7418ca373739b1 100644 (file)
@@ -8,6 +8,8 @@
 #include <fdt_support.h>
 #include <asm/mp.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 extern void ft_fixup_num_cores(void *blob);
 extern void ft_srio_setup(void *blob);
 
@@ -27,7 +29,7 @@ void ft_cpu_setup(void *blob, struct bd_info *bd)
        do_fixup_by_prop_u32(blob, "device_type", "soc", 4,
                             "bus-frequency", bd->bi_busfreq, 1);
 
-       fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
+       fdt_fixup_memory(blob, (u64)gd->ram_base, (u64)gd->ram_size);
 
 #ifdef CONFIG_SYS_NS16550
        do_fixup_by_compat_u32(blob, "ns16550",
index c0161e3379ccc71dad60d38e8fb6df114593acb1..3ee0ec859cf84e94beceb8963007575d7d88cdbd 100644 (file)
@@ -30,7 +30,7 @@ extern unsigned long search_exception_table(unsigned long);
  * amount of memory on the system if we're unable to keep all
  * the memory mapped in.
  */
-#define END_OF_MEM (gd->bd->bi_memstart + get_effective_memsize())
+#define END_OF_MEM     (gd->ram_base + get_effective_memsize())
 
 /*
  * Trap & Exception support
index 4d952a3882f08ad331c67a7023e97ca24713ba3a..226e258f0ea72ccf3ea094f0b9f1a0a006a980be 100644 (file)
@@ -25,5 +25,5 @@ void ft_cpu_setup(void *blob, struct bd_info *bd)
        do_fixup_by_compat_u32(blob, "fsl,cpm-brg", "clock-frequency",
                               gd->arch.brg_clk, 1);
 
-       fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
+       fdt_fixup_memory(blob, (u64)gd->ram_base, (u64)gd->ram_size);
 }
index 8c8ed99cd341fec94e5e23c6c42ffa7b3fc69594..b903e6ec8dc5e8ca567eec7d7dd17add1acdd490 100644 (file)
@@ -298,8 +298,8 @@ void boot_prep_vxworks(bootm_headers_t *images)
        if (!images->ft_addr)
                return;
 
-       base = (u64)gd->bd->bi_memstart;
-       size = (u64)gd->bd->bi_memsize;
+       base = (u64)gd->ram_base;
+       size = (u64)gd->ram_size;
 
        off = fdt_path_offset(images->ft_addr, "/memory");
        if (off < 0)
index 458eaf95c0443546d97ca2a76adad197f8745314..0e564507f94f6409a597233ebc9f369f547f9357 100644 (file)
@@ -41,15 +41,14 @@ static struct bp_tag *setup_last_tag(struct bp_tag *params)
 
 static struct bp_tag *setup_memory_tag(struct bp_tag *params)
 {
-       struct bd_info *bd = gd->bd;
        struct meminfo *mem;
 
        params->id = BP_TAG_MEMORY;
        params->size = sizeof(struct meminfo);
        mem = (struct meminfo *)params->data;
        mem->type = MEMORY_TYPE_CONVENTIONAL;
-       mem->start = bd->bi_memstart;
-       mem->end = bd->bi_memstart + bd->bi_memsize;
+       mem->start = PHYSADDR(gd->ram_base);
+       mem->end = PHYSADDR(gd->ram_base + gd->ram_size);
 
        printf("   MEMORY:          tag:0x%04x, type:0X%lx, start:0X%lx, end:0X%lx\n",
               BP_TAG_MEMORY, mem->type, mem->start, mem->end);
index 81ce2564805d1c59a8da51dff3b3578b9352de49..684e4a9ea5cfae486473b5a83ed5e3776a1a57a3 100644 (file)
@@ -348,7 +348,7 @@ int do_bedbug_stack(struct cmd_tbl *cmdtp, int flag, int argc,
                return 1;
        }
 
-       top = gd->bd->bi_memstart + gd->bd->bi_memsize;
+       top = gd->ram_start + gd->ram_size;
        depth = 0;
 
        printf ("Depth     PC\n");