* Some fixes for MPC5200 platforms @ 2016-05-27 9:32 Juergen Borleis 2016-05-27 9:32 ` [PATCH 1/4] PPC: fix size optimisation Juergen Borleis ` (4 more replies) 0 siblings, 5 replies; 6+ messages in thread From: Juergen Borleis @ 2016-05-27 9:32 UTC (permalink / raw) To: barebox Barebox for MPC5200 (PCM030 board for example) is currently broken. Below some fixes and improvemnts to make it boot/work again. Comments are welcome. Juergen _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/4] PPC: fix size optimisation 2016-05-27 9:32 Some fixes for MPC5200 platforms Juergen Borleis @ 2016-05-27 9:32 ` Juergen Borleis 2016-05-27 9:32 ` [PATCH 2/4] PPC: clean compiler warning Juergen Borleis ` (3 subsequent siblings) 4 siblings, 0 replies; 6+ messages in thread From: Juergen Borleis @ 2016-05-27 9:32 UTC (permalink / raw) To: barebox Since patch e92abad36307d the linker discards sections which seems not used to make the image smaller. But this change will discard the whole init and exception code from start.S which renders the final image useless. From 'barebox.map' without this patch: Discarded input sections .text 0x0000000000000000 0x358c arch/ppc/mach-mpc5xxx/start.o .data 0x0000000000000000 0x0 arch/ppc/mach-mpc5xxx/start.o .bss 0x0000000000000000 0x0 arch/ppc/mach-mpc5xxx/start.o .got2 0x0000000000000000 0x24 arch/ppc/mach-mpc5xxx/start.o [...] So, define the entry point to mark the init and exception used. From 'barebox.map' with this patch applied: Discarded input sections .data 0x0000000000000000 0x0 arch/ppc/mach-mpc5xxx/start.o .bss 0x0000000000000000 0x0 arch/ppc/mach-mpc5xxx/start.o [...] Note: tested on MPC5200 at run time, for MPC85XX compile time only Signed-off-by: Juergen Borleis <jbe@pengutronix.de> --- arch/ppc/boards/pcm030/barebox.lds.S | 1 + arch/ppc/mach-mpc85xx/barebox.lds.S | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/ppc/boards/pcm030/barebox.lds.S b/arch/ppc/boards/pcm030/barebox.lds.S index 0e08e05..0e34f0a 100644 --- a/arch/ppc/boards/pcm030/barebox.lds.S +++ b/arch/ppc/boards/pcm030/barebox.lds.S @@ -20,6 +20,7 @@ #include <asm-generic/barebox.lds.h> OUTPUT_ARCH("powerpc") +ENTRY(_start) /* Do we need any of these for elf? __DYNAMIC = 0; */ SECTIONS diff --git a/arch/ppc/mach-mpc85xx/barebox.lds.S b/arch/ppc/mach-mpc85xx/barebox.lds.S index 1f7f52c..beebab3 100644 --- a/arch/ppc/mach-mpc85xx/barebox.lds.S +++ b/arch/ppc/mach-mpc85xx/barebox.lds.S @@ -22,6 +22,7 @@ #endif OUTPUT_ARCH("powerpc") +ENTRY(_start_e500) PHDRS { -- 2.8.1 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/4] PPC: clean compiler warning 2016-05-27 9:32 Some fixes for MPC5200 platforms Juergen Borleis 2016-05-27 9:32 ` [PATCH 1/4] PPC: fix size optimisation Juergen Borleis @ 2016-05-27 9:32 ` Juergen Borleis 2016-05-27 9:32 ` [PATCH 3/4] PPC/MPC5XXX/reginfo: fix a bunch of compiler warnings Juergen Borleis ` (2 subsequent siblings) 4 siblings, 0 replies; 6+ messages in thread From: Juergen Borleis @ 2016-05-27 9:32 UTC (permalink / raw) To: barebox This change fixes the following compiler warning: arch/ppc/mach-mpc5xxx/cpu.c: In function 'restart_register_feature': arch/ppc/mach-mpc5xxx/cpu.c:81:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ Signed-off-by: Juergen Borleis <jbe@pengutronix.de> --- arch/ppc/mach-mpc5xxx/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/ppc/mach-mpc5xxx/cpu.c b/arch/ppc/mach-mpc5xxx/cpu.c index 33835e7..42ced9a 100644 --- a/arch/ppc/mach-mpc5xxx/cpu.c +++ b/arch/ppc/mach-mpc5xxx/cpu.c @@ -77,7 +77,7 @@ static void __noreturn mpc5xxx_restart_soc(struct restart_handler *rst) static int restart_register_feature(void) { - restart_handler_register_fn(mpc5xxx_restart_soc); + return restart_handler_register_fn(mpc5xxx_restart_soc); } coredevice_initcall(restart_register_feature); -- 2.8.1 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 3/4] PPC/MPC5XXX/reginfo: fix a bunch of compiler warnings 2016-05-27 9:32 Some fixes for MPC5200 platforms Juergen Borleis 2016-05-27 9:32 ` [PATCH 1/4] PPC: fix size optimisation Juergen Borleis 2016-05-27 9:32 ` [PATCH 2/4] PPC: clean compiler warning Juergen Borleis @ 2016-05-27 9:32 ` Juergen Borleis 2016-05-27 9:32 ` [PATCH 4/4] PPC/MPC5200: enable a useful command by default Juergen Borleis 2016-05-30 5:08 ` Some fixes for MPC5200 platforms Sascha Hauer 4 siblings, 0 replies; 6+ messages in thread From: Juergen Borleis @ 2016-05-27 9:32 UTC (permalink / raw) To: barebox This change fixes a bunch of compiler warnings of this type: arch/ppc/mach-mpc5xxx/reginfo.c: In function 'reginfo': arch/ppc/mach-mpc5xxx/reginfo.c:14:3: warning: format '%X' expects argument of type 'unsigned int', but argument 2 has type 'ulong' [-Wformat=] (*(volatile ulong*)MPC5XXX_ADDECR & 0x00010000) ? 1 : 0); ^ Signed-off-by: Juergen Borleis <jbe@pengutronix.de> --- arch/ppc/mach-mpc5xxx/reginfo.c | 77 +++++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 38 deletions(-) diff --git a/arch/ppc/mach-mpc5xxx/reginfo.c b/arch/ppc/mach-mpc5xxx/reginfo.c index 92a1b59..e41d235 100644 --- a/arch/ppc/mach-mpc5xxx/reginfo.c +++ b/arch/ppc/mach-mpc5xxx/reginfo.c @@ -1,6 +1,7 @@ #include <stdio.h> #include <config.h> #include <mach/mpc5xxx.h> +#include <asm/io.h> void reginfo(void) { @@ -8,52 +9,52 @@ void reginfo(void) printf ("MBAR=%08x\n", CFG_MBAR); puts ("Memory map registers\n"); printf ("\tCS0: start %08X\tstop %08X\tconfig %08X\ten %d\n", - *(volatile ulong*)MPC5XXX_CS0_START, - *(volatile ulong*)MPC5XXX_CS0_STOP, - *(volatile ulong*)MPC5XXX_CS0_CFG, - (*(volatile ulong*)MPC5XXX_ADDECR & 0x00010000) ? 1 : 0); + in_be32((void*)MPC5XXX_CS0_START), + in_be32((void*)MPC5XXX_CS0_STOP), + in_be32((void*)MPC5XXX_CS0_CFG), + in_be32((void*)MPC5XXX_ADDECR) & 0x00010000 ? 1 : 0); printf ("\tCS1: start %08X\tstop %08X\tconfig %08X\ten %d\n", - *(volatile ulong*)MPC5XXX_CS1_START, - *(volatile ulong*)MPC5XXX_CS1_STOP, - *(volatile ulong*)MPC5XXX_CS1_CFG, - (*(volatile ulong*)MPC5XXX_ADDECR & 0x00020000) ? 1 : 0); + in_be32((void*)MPC5XXX_CS1_START), + in_be32((void*)MPC5XXX_CS1_STOP), + in_be32((void*)MPC5XXX_CS1_CFG), + in_be32((void*)MPC5XXX_ADDECR) & 0x00020000 ? 1 : 0); printf ("\tCS2: start %08X\tstop %08X\tconfig %08X\ten %d\n", - *(volatile ulong*)MPC5XXX_CS2_START, - *(volatile ulong*)MPC5XXX_CS2_STOP, - *(volatile ulong*)MPC5XXX_CS2_CFG, - (*(volatile ulong*)MPC5XXX_ADDECR & 0x00040000) ? 1 : 0); + in_be32((void*)MPC5XXX_CS2_START), + in_be32((void*)MPC5XXX_CS2_STOP), + in_be32((void*)MPC5XXX_CS2_CFG), + in_be32((void*)MPC5XXX_ADDECR) & 0x00040000 ? 1 : 0); printf ("\tCS3: start %08X\tstop %08X\tconfig %08X\ten %d\n", - *(volatile ulong*)MPC5XXX_CS3_START, - *(volatile ulong*)MPC5XXX_CS3_STOP, - *(volatile ulong*)MPC5XXX_CS3_CFG, - (*(volatile ulong*)MPC5XXX_ADDECR & 0x00080000) ? 1 : 0); + in_be32((void*)MPC5XXX_CS3_START), + in_be32((void*)MPC5XXX_CS3_STOP), + in_be32((void*)MPC5XXX_CS3_CFG), + in_be32((void*)MPC5XXX_ADDECR) & 0x00080000 ? 1 : 0); printf ("\tCS4: start %08X\tstop %08X\tconfig %08X\ten %d\n", - *(volatile ulong*)MPC5XXX_CS4_START, - *(volatile ulong*)MPC5XXX_CS4_STOP, - *(volatile ulong*)MPC5XXX_CS4_CFG, - (*(volatile ulong*)MPC5XXX_ADDECR & 0x00100000) ? 1 : 0); + in_be32((void*)MPC5XXX_CS4_START), + in_be32((void*)MPC5XXX_CS4_STOP), + in_be32((void*)MPC5XXX_CS4_CFG), + in_be32((void*)MPC5XXX_ADDECR) & 0x00100000 ? 1 : 0); printf ("\tCS5: start %08X\tstop %08X\tconfig %08X\ten %d\n", - *(volatile ulong*)MPC5XXX_CS5_START, - *(volatile ulong*)MPC5XXX_CS5_STOP, - *(volatile ulong*)MPC5XXX_CS5_CFG, - (*(volatile ulong*)MPC5XXX_ADDECR & 0x00200000) ? 1 : 0); + in_be32((void*)MPC5XXX_CS5_START), + in_be32((void*)MPC5XXX_CS5_STOP), + in_be32((void*)MPC5XXX_CS5_CFG), + in_be32((void*)MPC5XXX_ADDECR) & 0x00200000 ? 1 : 0); printf ("\tCS6: start %08X\tstop %08X\tconfig %08X\ten %d\n", - *(volatile ulong*)MPC5XXX_CS6_START, - *(volatile ulong*)MPC5XXX_CS6_STOP, - *(volatile ulong*)MPC5XXX_CS6_CFG, - (*(volatile ulong*)MPC5XXX_ADDECR & 0x04000000) ? 1 : 0); + in_be32((void*)MPC5XXX_CS6_START), + in_be32((void*)MPC5XXX_CS6_STOP), + in_be32((void*)MPC5XXX_CS6_CFG), + in_be32((void*)MPC5XXX_ADDECR) & 0x04000000 ? 1 : 0); printf ("\tCS7: start %08X\tstop %08X\tconfig %08X\ten %d\n", - *(volatile ulong*)MPC5XXX_CS7_START, - *(volatile ulong*)MPC5XXX_CS7_STOP, - *(volatile ulong*)MPC5XXX_CS7_CFG, - (*(volatile ulong*)MPC5XXX_ADDECR & 0x08000000) ? 1 : 0); + in_be32((void*)MPC5XXX_CS7_START), + in_be32((void*)MPC5XXX_CS7_STOP), + in_be32((void*)MPC5XXX_CS7_CFG), + in_be32((void*)MPC5XXX_ADDECR) & 0x08000000 ? 1 : 0); printf ("\tBOOTCS: start %08X\tstop %08X\tconfig %08X\ten %d\n", - *(volatile ulong*)MPC5XXX_BOOTCS_START, - *(volatile ulong*)MPC5XXX_BOOTCS_STOP, - *(volatile ulong*)MPC5XXX_BOOTCS_CFG, - (*(volatile ulong*)MPC5XXX_ADDECR & 0x02000000) ? 1 : 0); + in_be32((void*)MPC5XXX_BOOTCS_START), + in_be32((void*)MPC5XXX_BOOTCS_STOP), + in_be32((void*)MPC5XXX_BOOTCS_CFG), + in_be32((void*)MPC5XXX_ADDECR) & 0x02000000 ? 1 : 0); printf ("\tSDRAMCS0: %08X\n", - *(volatile ulong*)MPC5XXX_SDRAM_CS0CFG); + in_be32((void*)MPC5XXX_SDRAM_CS0CFG)); printf ("\tSDRAMCS1: %08X\n", - *(volatile ulong*)MPC5XXX_SDRAM_CS1CFG); + in_be32((void*)MPC5XXX_SDRAM_CS1CFG)); } -- 2.8.1 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 4/4] PPC/MPC5200: enable a useful command by default 2016-05-27 9:32 Some fixes for MPC5200 platforms Juergen Borleis ` (2 preceding siblings ...) 2016-05-27 9:32 ` [PATCH 3/4] PPC/MPC5XXX/reginfo: fix a bunch of compiler warnings Juergen Borleis @ 2016-05-27 9:32 ` Juergen Borleis 2016-05-30 5:08 ` Some fixes for MPC5200 platforms Sascha Hauer 4 siblings, 0 replies; 6+ messages in thread From: Juergen Borleis @ 2016-05-27 9:32 UTC (permalink / raw) To: barebox Signed-off-by: Juergen Borleis <jbe@pengutronix.de> --- arch/ppc/configs/pcm030_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/ppc/configs/pcm030_defconfig b/arch/ppc/configs/pcm030_defconfig index 61380ac..fd010c8 100644 --- a/arch/ppc/configs/pcm030_defconfig +++ b/arch/ppc/configs/pcm030_defconfig @@ -9,6 +9,7 @@ CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/ppc/boards/pcm030/env" CONFIG_LONGHELP=y CONFIG_CMD_IOMEM=y CONFIG_CMD_MEMINFO=y +CONFIG_CMD_REGINFO=y CONFIG_CMD_BOOTM_SHOW_TYPE=y CONFIG_CMD_GO=y CONFIG_CMD_RESET=y -- 2.8.1 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Some fixes for MPC5200 platforms 2016-05-27 9:32 Some fixes for MPC5200 platforms Juergen Borleis ` (3 preceding siblings ...) 2016-05-27 9:32 ` [PATCH 4/4] PPC/MPC5200: enable a useful command by default Juergen Borleis @ 2016-05-30 5:08 ` Sascha Hauer 4 siblings, 0 replies; 6+ messages in thread From: Sascha Hauer @ 2016-05-30 5:08 UTC (permalink / raw) To: Juergen Borleis; +Cc: barebox On Fri, May 27, 2016 at 11:32:47AM +0200, Juergen Borleis wrote: > Barebox for MPC5200 (PCM030 board for example) is currently broken. Below > some fixes and improvemnts to make it boot/work again. > > Comments are welcome. Applied, thanks Sascha -- 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-05-30 5:08 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-05-27 9:32 Some fixes for MPC5200 platforms Juergen Borleis 2016-05-27 9:32 ` [PATCH 1/4] PPC: fix size optimisation Juergen Borleis 2016-05-27 9:32 ` [PATCH 2/4] PPC: clean compiler warning Juergen Borleis 2016-05-27 9:32 ` [PATCH 3/4] PPC/MPC5XXX/reginfo: fix a bunch of compiler warnings Juergen Borleis 2016-05-27 9:32 ` [PATCH 4/4] PPC/MPC5200: enable a useful command by default Juergen Borleis 2016-05-30 5:08 ` Some fixes for MPC5200 platforms Sascha Hauer
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox