From patchwork Thu Aug 13 05:47:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roese X-Patchwork-Id: 1344018 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=kjpt04Z4; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BRwcF5KZ2z9sTF for ; Thu, 13 Aug 2020 15:49:01 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 733C5821F7; Thu, 13 Aug 2020 07:48:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1597297704; bh=UjptevWLXQ05DhpGq8883tT2twXdz7ZITyUhzCpyE+E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=kjpt04Z4fsistv0I1/cV2IlpRuJAlCkmjwXTMQggk4lpR2/1/5UkXLC2zjAAvzRes knsjCAQ1W/jHvwTJLr95ut43vcnnEoiXPHVPuFAmxi2FuqGQInqMHkz3EJhmJVnzrS tLKHTwndsdqEvV/TdYbcmmyZ12OIXtzGEnZlN7ssSe4kqrkDHRI/MZPjecaCdzJJSK +IjwqUR4AMKgVIl/qByGNKpQ4ooK69/zA9GCE8TPmfNgXNxG447NbcDXjSH/j3Z0ed fEiHkbWGU42+55MFidOSMbec1tNwVmOQPIUfFV1//36ZiLkvI40MPRYXyBbCbRGVe8 ykq+h1bohlR1A== Received: by phobos.denx.de (Postfix, from userid 109) id 10F6281E39; Thu, 13 Aug 2020 07:48:19 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mx2.mailbox.org (mx2.mailbox.org [80.241.60.215]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 42EFA8219B for ; Thu, 13 Aug 2020 07:48:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=sr@denx.de Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id AFCDEA141E; Thu, 13 Aug 2020 07:48:13 +0200 (CEST) Received: from smtp1.mailbox.org ([80.241.60.240]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id vMToGbmNvAzL; Thu, 13 Aug 2020 07:48:09 +0200 (CEST) From: Stefan Roese To: u-boot@lists.denx.de Cc: =?utf-8?q?Pali_Roh=C3=A1r?= , trini@konsulko.com, sjg@chromium.org, daniel.schwierzeck@gmail.com, Christophe Leroy , Mario Six , Masahiro Yamada , Max Filippov , Ovidiu Panait , Priyanka Jain , Weijie Gao , Wolfgang Denk Subject: [PATCH v4 4/9] global: Move from bi_memstart/memsize -> gd->ram_base/ram_size Date: Thu, 13 Aug 2020 07:47:55 +0200 Message-Id: <20200813054800.469284-5-sr@denx.de> In-Reply-To: <20200813054800.469284-1-sr@denx.de> References: <20200813054800.469284-1-sr@denx.de> MIME-Version: 1.0 X-MBO-SPAM-Probability: ** X-Rspamd-Score: 2.22 / 15.00 / 15.00 X-Rspamd-Queue-Id: 567ED1832 X-Rspamd-UID: ed2486 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean With the 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 --- Changes in v4: - New patch api/api_platform-mips.c | 3 +-- api/api_platform-powerpc.c | 2 +- arch/mips/lib/boot.c | 2 +- arch/mips/lib/bootm.c | 2 +- arch/powerpc/cpu/mpc83xx/fdt.c | 2 +- arch/powerpc/cpu/mpc83xx/traps.c | 2 +- arch/powerpc/cpu/mpc85xx/fdt.c | 4 ++-- arch/powerpc/cpu/mpc85xx/traps.c | 2 +- arch/powerpc/cpu/mpc86xx/fdt.c | 4 +++- arch/powerpc/cpu/mpc86xx/traps.c | 2 +- arch/powerpc/cpu/mpc8xx/fdt.c | 2 +- arch/powerpc/lib/bootm.c | 4 ++-- arch/xtensa/lib/bootm.c | 5 ++--- cmd/bedbug.c | 2 +- 14 files changed, 19 insertions(+), 19 deletions(-) diff --git a/api/api_platform-mips.c b/api/api_platform-mips.c index 51cd328b3d..e1509663af 100644 --- a/api/api_platform-mips.c +++ b/api/api_platform-mips.c @@ -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; } diff --git a/api/api_platform-powerpc.c b/api/api_platform-powerpc.c index 15930cfdb6..847a4a3015 100644 --- a/api/api_platform-powerpc.c +++ b/api/api_platform-powerpc.c @@ -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); diff --git a/arch/mips/lib/boot.c b/arch/mips/lib/boot.c index db862f6379..6ef9109022 100644 --- a/arch/mips/lib/boot.c +++ b/arch/mips/lib/boot.c @@ -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); } diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c index 0a13f6edb7..d5c99d891c 100644 --- a/arch/mips/lib/bootm.c +++ b/arch/mips/lib/bootm.c @@ -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); diff --git a/arch/powerpc/cpu/mpc83xx/fdt.c b/arch/powerpc/cpu/mpc83xx/fdt.c index ebdedb2888..4ea7b27ef4 100644 --- a/arch/powerpc/cpu/mpc83xx/fdt.c +++ b/arch/powerpc/cpu/mpc83xx/fdt.c @@ -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)) diff --git a/arch/powerpc/cpu/mpc83xx/traps.c b/arch/powerpc/cpu/mpc83xx/traps.c index c3cc119d65..ea8bc6c152 100644 --- a/arch/powerpc/cpu/mpc83xx/traps.c +++ b/arch/powerpc/cpu/mpc83xx/traps.c @@ -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 diff --git a/arch/powerpc/cpu/mpc85xx/fdt.c b/arch/powerpc/cpu/mpc85xx/fdt.c index 9569c1a64b..0d8353ceb2 100644 --- a/arch/powerpc/cpu/mpc85xx/fdt.c +++ b/arch/powerpc/cpu/mpc85xx/fdt.c @@ -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 diff --git a/arch/powerpc/cpu/mpc85xx/traps.c b/arch/powerpc/cpu/mpc85xx/traps.c index f37a45e269..db6ed1fc92 100644 --- a/arch/powerpc/cpu/mpc85xx/traps.c +++ b/arch/powerpc/cpu/mpc85xx/traps.c @@ -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) { diff --git a/arch/powerpc/cpu/mpc86xx/fdt.c b/arch/powerpc/cpu/mpc86xx/fdt.c index 24e53115ec..010b6d4fe6 100644 --- a/arch/powerpc/cpu/mpc86xx/fdt.c +++ b/arch/powerpc/cpu/mpc86xx/fdt.c @@ -8,6 +8,8 @@ #include #include +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", diff --git a/arch/powerpc/cpu/mpc86xx/traps.c b/arch/powerpc/cpu/mpc86xx/traps.c index c0161e3379..3ee0ec859c 100644 --- a/arch/powerpc/cpu/mpc86xx/traps.c +++ b/arch/powerpc/cpu/mpc86xx/traps.c @@ -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 diff --git a/arch/powerpc/cpu/mpc8xx/fdt.c b/arch/powerpc/cpu/mpc8xx/fdt.c index 4d952a3882..226e258f0e 100644 --- a/arch/powerpc/cpu/mpc8xx/fdt.c +++ b/arch/powerpc/cpu/mpc8xx/fdt.c @@ -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); } diff --git a/arch/powerpc/lib/bootm.c b/arch/powerpc/lib/bootm.c index 8c8ed99cd3..b903e6ec8d 100644 --- a/arch/powerpc/lib/bootm.c +++ b/arch/powerpc/lib/bootm.c @@ -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) diff --git a/arch/xtensa/lib/bootm.c b/arch/xtensa/lib/bootm.c index 458eaf95c0..6fcbfc4292 100644 --- a/arch/xtensa/lib/bootm.c +++ b/arch/xtensa/lib/bootm.c @@ -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 = gd->ram_base; + mem->end = 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); diff --git a/cmd/bedbug.c b/cmd/bedbug.c index 81ce256480..684e4a9ea5 100644 --- a/cmd/bedbug.c +++ b/cmd/bedbug.c @@ -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");