From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gw4mA-0006Ue-BD for barebox@lists.infradead.org; Tue, 19 Feb 2019 12:45:32 +0000 Received: by mail-lj1-x243.google.com with SMTP id g80so17290281ljg.6 for ; Tue, 19 Feb 2019 04:45:29 -0800 (PST) Date: Tue, 19 Feb 2019 15:45:24 +0300 From: Antony Pavlov Message-Id: <20190219154524.7b17d385e0fdec276ce718fd@gmail.com> In-Reply-To: <48809c81-7785-4e84-b012-a66cfc697cd9@pengutronix.de> References: <20190218075202.10091-1-o.rempel@pengutronix.de> <48809c81-7785-4e84-b012-a66cfc697cd9@pengutronix.de> Mime-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: [PATCH v1 1/4] MIPS: relocation: pass ram size to pbl_main_entry To: Oleksij Rempel Cc: barebox@lists.infradead.org On Tue, 19 Feb 2019 09:34:43 +0100 Oleksij Rempel wrote: > Hi Antony, > = > your attention will be needed here.. Hi Oleksij! Sorry but this week I'm on vacation. Could you please push this patchseries to github? -- = Best regards, =A0 Antony Pavlov > = > On 18.02.19 08:51, Oleksij Rempel wrote: > > From: Oleksij Rempel > > = > > To make barebox dynamically relocatable it should know > > the RAM size to be able to calculate proper new location. > > = > > Signed-off-by: Oleksij Rempel > > --- > > arch/mips/boards/8devices-lima/lowlevel.S | 3 ++- > > arch/mips/boards/black-swift/lowlevel.S | 3 ++- > > arch/mips/boards/dlink-dir-320/lowlevel.S | 3 ++- > > arch/mips/boards/dptechnics-dpt-module/lowlevel.S | 3 ++- > > arch/mips/boards/img-ci20/lowlevel.S | 3 ++- > > arch/mips/boards/loongson-ls1b/lowlevel.S | 3 ++- > > arch/mips/boards/qemu-malta/lowlevel.S | 3 ++- > > arch/mips/boards/ritmix-rzx50/lowlevel.S | 3 ++- > > arch/mips/boards/tplink-mr3020/lowlevel.S | 3 ++- > > arch/mips/boards/tplink-wdr4300/lowlevel.S | 3 ++- > > arch/mips/boot/main_entry-pbl.c | 5 +++-- > > arch/mips/include/asm/asm.h | 3 ++- > > 12 files changed, 25 insertions(+), 13 deletions(-) > > = > > diff --git a/arch/mips/boards/8devices-lima/lowlevel.S b/arch/mips/boar= ds/8devices-lima/lowlevel.S > > index b53b23b42a..dd1ab6247d 100644 > > --- a/arch/mips/boards/8devices-lima/lowlevel.S > > +++ b/arch/mips/boards/8devices-lima/lowlevel.S > > @@ -11,6 +11,7 @@ > > #include > > #include > > #include > > +#include > > = > > ENTRY_FUNCTION(BOARD_PBL_START) > > = > > @@ -38,4 +39,4 @@ skip_flash_test: > > dcache_enable > > skip_pll_ram_config: > > = > > -ENTRY_FUNCTION_END(BOARD_PBL_START, qca4531_8devices_lima) > > +ENTRY_FUNCTION_END(BOARD_PBL_START, qca4531_8devices_lima, SZ_64M) > > diff --git a/arch/mips/boards/black-swift/lowlevel.S b/arch/mips/boards= /black-swift/lowlevel.S > > index 0ba77435f8..5c5afcdf09 100644 > > --- a/arch/mips/boards/black-swift/lowlevel.S > > +++ b/arch/mips/boards/black-swift/lowlevel.S > > @@ -11,9 +11,10 @@ > > #include > > #include > > #include > > +#include > > = > > ENTRY_FUNCTION(BOARD_PBL_START) > > = > > ar9331_pbl_generic_start > > = > > -ENTRY_FUNCTION_END(BOARD_PBL_START, black_swift) > > +ENTRY_FUNCTION_END(BOARD_PBL_START, black_swift, SZ_64M) > > diff --git a/arch/mips/boards/dlink-dir-320/lowlevel.S b/arch/mips/boar= ds/dlink-dir-320/lowlevel.S > > index 9f3bd5dead..da969bc74e 100644 > > --- a/arch/mips/boards/dlink-dir-320/lowlevel.S > > +++ b/arch/mips/boards/dlink-dir-320/lowlevel.S > > @@ -9,6 +9,7 @@ > > #include > > #include > > #include > > +#include > > = > > ENTRY_FUNCTION(BOARD_PBL_START) > > = > > @@ -19,4 +20,4 @@ ENTRY_FUNCTION(BOARD_PBL_START) > > /* CPU/SoC specific setup ... */ > > /* ... absent */ > > = > > -ENTRY_FUNCTION_END(BOARD_PBL_START, dlink_dir_320) > > +ENTRY_FUNCTION_END(BOARD_PBL_START, dlink_dir_320, SZ_32M) > > diff --git a/arch/mips/boards/dptechnics-dpt-module/lowlevel.S b/arch/m= ips/boards/dptechnics-dpt-module/lowlevel.S > > index 28b8f4fac7..b5621963c3 100644 > > --- a/arch/mips/boards/dptechnics-dpt-module/lowlevel.S > > +++ b/arch/mips/boards/dptechnics-dpt-module/lowlevel.S > > @@ -12,9 +12,10 @@ > > #include > > #include > > #include > > +#include > > = > > ENTRY_FUNCTION(BOARD_PBL_START) > > = > > ar9331_pbl_generic_start > > = > > -ENTRY_FUNCTION_END(BOARD_PBL_START, ar9331_dptechnics_dpt_module) > > +ENTRY_FUNCTION_END(BOARD_PBL_START, ar9331_dptechnics_dpt_module, SZ_6= 4M) > > diff --git a/arch/mips/boards/img-ci20/lowlevel.S b/arch/mips/boards/im= g-ci20/lowlevel.S > > index 056df17bf8..0295e44d1a 100644 > > --- a/arch/mips/boards/img-ci20/lowlevel.S > > +++ b/arch/mips/boards/img-ci20/lowlevel.S > > @@ -10,6 +10,7 @@ > > #include > > #include > > #include > > +#include > > = > > ENTRY_FUNCTION(BOARD_PBL_START) > > = > > @@ -23,4 +24,4 @@ ENTRY_FUNCTION(BOARD_PBL_START) > > debug_ll_outc '.' > > debug_ll_ns16550_outnl > > = > > -ENTRY_FUNCTION_END(BOARD_PBL_START, img_ci20) > > +ENTRY_FUNCTION_END(BOARD_PBL_START, img_ci20, SZ_1G) > > diff --git a/arch/mips/boards/loongson-ls1b/lowlevel.S b/arch/mips/boar= ds/loongson-ls1b/lowlevel.S > > index 37744e9fac..c533df3ce5 100644 > > --- a/arch/mips/boards/loongson-ls1b/lowlevel.S > > +++ b/arch/mips/boards/loongson-ls1b/lowlevel.S > > @@ -9,6 +9,7 @@ > > #include > > #include > > #include > > +#include > > = > > ENTRY_FUNCTION(BOARD_PBL_START) > > = > > @@ -21,4 +22,4 @@ ENTRY_FUNCTION(BOARD_PBL_START) > > debug_ll_outc '.' > > debug_ll_ns16550_outnl > > = > > -ENTRY_FUNCTION_END(BOARD_PBL_START, loongson_ls1b) > > +ENTRY_FUNCTION_END(BOARD_PBL_START, loongson_ls1b, SZ_64M) > > diff --git a/arch/mips/boards/qemu-malta/lowlevel.S b/arch/mips/boards/= qemu-malta/lowlevel.S > > index 3861ae9e46..e4ecde45cf 100644 > > --- a/arch/mips/boards/qemu-malta/lowlevel.S > > +++ b/arch/mips/boards/qemu-malta/lowlevel.S > > @@ -10,6 +10,7 @@ > > #include > > #include > > #include > > +#include > > = > > #include > > #include > > @@ -82,4 +83,4 @@ __start: > > li t0, GT_LD(0x1bdfffff) > > sw t0, GT_PCI0M1HD_OFS(t1) > > = > > -ENTRY_FUNCTION_END(BOARD_PBL_START, qemu_malta) > > +ENTRY_FUNCTION_END(BOARD_PBL_START, qemu_malta, SZ_256M) > > diff --git a/arch/mips/boards/ritmix-rzx50/lowlevel.S b/arch/mips/board= s/ritmix-rzx50/lowlevel.S > > index 7a9743835e..33810f67f5 100644 > > --- a/arch/mips/boards/ritmix-rzx50/lowlevel.S > > +++ b/arch/mips/boards/ritmix-rzx50/lowlevel.S > > @@ -10,6 +10,7 @@ > > #include > > #include > > #include > > +#include > > = > > ENTRY_FUNCTION(BOARD_PBL_START) > > = > > @@ -23,4 +24,4 @@ ENTRY_FUNCTION(BOARD_PBL_START) > > debug_ll_outc '.' > > debug_ll_ns16550_outnl > > = > > -ENTRY_FUNCTION_END(BOARD_PBL_START, rzx50) > > +ENTRY_FUNCTION_END(BOARD_PBL_START, rzx50, SZ_64M) > > diff --git a/arch/mips/boards/tplink-mr3020/lowlevel.S b/arch/mips/boar= ds/tplink-mr3020/lowlevel.S > > index 0a1c193c1e..b96292ecc4 100644 > > --- a/arch/mips/boards/tplink-mr3020/lowlevel.S > > +++ b/arch/mips/boards/tplink-mr3020/lowlevel.S > > @@ -11,9 +11,10 @@ > > #include > > #include > > #include > > +#include > > = > > ENTRY_FUNCTION(BOARD_PBL_START) > > = > > ar9331_pbl_generic_start > > = > > -ENTRY_FUNCTION_END(BOARD_PBL_START, tplink_mr3020) > > +ENTRY_FUNCTION_END(BOARD_PBL_START, tplink_mr3020, SZ_32M) > > diff --git a/arch/mips/boards/tplink-wdr4300/lowlevel.S b/arch/mips/boa= rds/tplink-wdr4300/lowlevel.S > > index 461b257f41..8aed5ddcf1 100644 > > --- a/arch/mips/boards/tplink-wdr4300/lowlevel.S > > +++ b/arch/mips/boards/tplink-wdr4300/lowlevel.S > > @@ -11,6 +11,7 @@ > > #include > > #include > > #include > > +#include > > = > > ENTRY_FUNCTION(BOARD_PBL_START) > > = > > @@ -35,4 +36,4 @@ skip_flash_test: > > = > > skip_pll_ram_config: > > = > > -ENTRY_FUNCTION_END(BOARD_PBL_START, ar9344_tl_wdr4300_v1.7) > > +ENTRY_FUNCTION_END(BOARD_PBL_START, ar9344_tl_wdr4300_v1.7, SZ_128M) > > diff --git a/arch/mips/boot/main_entry-pbl.c b/arch/mips/boot/main_entr= y-pbl.c > > index b40887b064..28eaa8791f 100644 > > --- a/arch/mips/boot/main_entry-pbl.c > > +++ b/arch/mips/boot/main_entry-pbl.c > > @@ -18,7 +18,7 @@ extern void *input_data_end; > > unsigned long free_mem_ptr; > > unsigned long free_mem_end_ptr; > > = > > -void pbl_main_entry(void *fdt, void *fdt_end); > > +void pbl_main_entry(void *fdt, void *fdt_end, u32 ram_size); > > = > > static unsigned long *ttb; > > = > > @@ -33,7 +33,8 @@ static void barebox_uncompress(void *compressed_start= , unsigned int len) > > pbl_barebox_uncompress((void*)TEXT_BASE, compressed_start, len); > > } > > = > > -void __section(.text_entry) pbl_main_entry(void *fdt, void *fdt_end) > > +void __section(.text_entry) pbl_main_entry(void *fdt, void *fdt_end, > > + u32 ram_size) > > { > > u32 pg_start, pg_end, pg_len, fdt_len; > > void *fdt_new; > > diff --git a/arch/mips/include/asm/asm.h b/arch/mips/include/asm/asm.h > > index 7d2b673bd9..a85467ceed 100644 > > --- a/arch/mips/include/asm/asm.h > > +++ b/arch/mips/include/asm/asm.h > > @@ -89,13 +89,14 @@ EXPORT(symbol) > > /* > > * ENTRY_FUNCTION_END - mark end of entry function > > */ > > -#define ENTRY_FUNCTION_END(symbol, dtb) \ > > +#define ENTRY_FUNCTION_END(symbol, dtb, ram_size) \ > > mips_nmon; \ > > copy_to_link_location symbol; \ > > stack_setup; \ > > \ > > la a0, __dtb_ ## dtb##_start; \ > > la a1, __dtb_ ## dtb##_end; \ > > + li a2, ram_size; \ > > la v0, pbl_main_entry; \ > > jal v0; \ > > nop; \ > > = > = > Kind regards, > Oleksij Rempel > = > -- = > Pengutronix e.K. | | > Industrial Linux Solutions | http://www.pengutronix.de/ | > Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox