* [PATCH 2/5] ARM: socfpga: sockit: convert to lowlevel helper
2018-11-02 15:04 [PATCH 1/5] ARM: socfpga: add lowlevel header with common code Steffen Trumtrar
@ 2018-11-02 15:04 ` Steffen Trumtrar
2018-11-02 15:04 ` [PATCH 3/5] ARM: socfgpa: de0-nano-soc: convert to lowlevel helpers Steffen Trumtrar
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Steffen Trumtrar @ 2018-11-02 15:04 UTC (permalink / raw)
To: Barebox List
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
---
arch/arm/boards/terasic-sockit/lowlevel.c | 71 ++---------------------
1 file changed, 4 insertions(+), 67 deletions(-)
diff --git a/arch/arm/boards/terasic-sockit/lowlevel.c b/arch/arm/boards/terasic-sockit/lowlevel.c
index 05b7d800a244..1dd7940aebd9 100644
--- a/arch/arm/boards/terasic-sockit/lowlevel.c
+++ b/arch/arm/boards/terasic-sockit/lowlevel.c
@@ -1,23 +1,14 @@
-#include <common.h>
-#include <linux/sizes.h>
-#include <io.h>
-#include <asm/barebox-arm-head.h>
-#include <asm/barebox-arm.h>
-#include <mach/generic.h>
-#include <debug_ll.h>
-#include <asm/cache.h>
#include "sdram_config.h"
-#include <mach/cyclone5-sdram-config.h>
#include "pinmux_config.c"
#include "pll_config.h"
-#include <mach/pll_config.h>
#include "sequencer_defines.h"
#include "sequencer_auto.h"
-#include <mach/cyclone5-sequencer.c>
#include "sequencer_auto_inst_init.c"
#include "sequencer_auto_ac_init.c"
#include "iocsr_config_cyclone5.c"
+#include <mach/lowlevel.h>
+
static inline void ledon(int led)
{
u32 val;
@@ -44,59 +35,5 @@ static inline void ledoff(int led)
writel(val, 0xFF709004);
}
-extern char __dtb_socfpga_cyclone5_sockit_start[];
-
-ENTRY_FUNCTION(start_socfpga_sockit, r0, r1, r2)
-{
- void *fdt;
-
- arm_cpu_lowlevel_init();
-
- fdt = __dtb_socfpga_cyclone5_sockit_start + get_runtime_offset();
-
- barebox_arm_entry(0x0, SZ_1G, fdt);
-}
-
-static noinline void sockit_entry(void)
-{
- struct socfpga_io_config io_config;
- int ret;
-
- arm_early_mmu_cache_invalidate();
-
- relocate_to_current_adr();
- setup_c();
-
- io_config.pinmux = sys_mgr_init_table;
- io_config.num_pin = ARRAY_SIZE(sys_mgr_init_table);
- io_config.iocsr_emac_mixed2 = iocsr_scan_chain0_table;
- io_config.iocsr_mixed1_flash = iocsr_scan_chain1_table;
- io_config.iocsr_general = iocsr_scan_chain2_table;
- io_config.iocsr_ddr = iocsr_scan_chain3_table;
-
- socfpga_lowlevel_init(&cm_default_cfg, &io_config);
-
- puts_ll("lowlevel init done\n");
- puts_ll("SDRAM setup...\n");
-
- socfpga_sdram_mmr_init();
-
- puts_ll("SDRAM calibration...\n");
-
- ret = socfpga_mem_calibration();
- if (!ret)
- hang();
-
- puts_ll("done\n");
-
- barebox_arm_entry(0x0, SZ_1G, NULL);
-}
-
-ENTRY_FUNCTION(start_socfpga_sockit_xload, r0, r1, r2)
-{
- arm_cpu_lowlevel_init();
-
- arm_setup_stack(0xffff0000 + SZ_64K - SZ_4K - 16);
-
- sockit_entry();
-}
+SOCFPGA_C5_ENTRY(start_socfpga_sockit, socfpga_cyclone5_sockit, SZ_1G);
+SOCFPGA_C5_XLOAD_ENTRY(start_socfpga_sockit_xload, SZ_1G);
--
2.19.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/5] ARM: socfgpa: de0-nano-soc: convert to lowlevel helpers
2018-11-02 15:04 [PATCH 1/5] ARM: socfpga: add lowlevel header with common code Steffen Trumtrar
2018-11-02 15:04 ` [PATCH 2/5] ARM: socfpga: sockit: convert to lowlevel helper Steffen Trumtrar
@ 2018-11-02 15:04 ` Steffen Trumtrar
2018-11-02 15:04 ` [PATCH 4/5] ARM: socfpga: socdk: " Steffen Trumtrar
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Steffen Trumtrar @ 2018-11-02 15:04 UTC (permalink / raw)
To: Barebox List
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
---
.../boards/terasic-de0-nano-soc/lowlevel.c | 69 +------------------
1 file changed, 3 insertions(+), 66 deletions(-)
diff --git a/arch/arm/boards/terasic-de0-nano-soc/lowlevel.c b/arch/arm/boards/terasic-de0-nano-soc/lowlevel.c
index dfb8271724bc..deac0e9cb289 100644
--- a/arch/arm/boards/terasic-de0-nano-soc/lowlevel.c
+++ b/arch/arm/boards/terasic-de0-nano-soc/lowlevel.c
@@ -1,76 +1,13 @@
-#include <common.h>
-#include <linux/sizes.h>
-#include <io.h>
-#include <asm/barebox-arm-head.h>
-#include <asm/barebox-arm.h>
-#include <mach/generic.h>
-#include <debug_ll.h>
-#include <asm/cache.h>
#include "sdram_config.h"
-#include <mach/cyclone5-sdram-config.h>
#include "pinmux_config.c"
#include "pll_config.h"
-#include <mach/pll_config.h>
#include "sequencer_defines.h"
#include "sequencer_auto.h"
-#include <mach/cyclone5-sequencer.c>
#include "sequencer_auto_inst_init.c"
#include "sequencer_auto_ac_init.c"
#include "iocsr_config_cyclone5.c"
-extern char __dtb_socfpga_cyclone5_de0_nano_soc_start[];
+#include <mach/lowlevel.h>
-ENTRY_FUNCTION(start_socfpga_de0_nano_soc, r0, r1, r2)
-{
- void *fdt;
-
- arm_cpu_lowlevel_init();
-
- fdt = __dtb_socfpga_cyclone5_de0_nano_soc_start + get_runtime_offset();
-
- barebox_arm_entry(0x0, SZ_1G, fdt);
-}
-
-static noinline void de0_nano_soc_entry(void)
-{
- struct socfpga_io_config io_config;
- int ret;
-
- arm_early_mmu_cache_invalidate();
-
- relocate_to_current_adr();
- setup_c();
-
- io_config.pinmux = sys_mgr_init_table;
- io_config.num_pin = ARRAY_SIZE(sys_mgr_init_table);
- io_config.iocsr_emac_mixed2 = iocsr_scan_chain0_table;
- io_config.iocsr_mixed1_flash = iocsr_scan_chain1_table;
- io_config.iocsr_general = iocsr_scan_chain2_table;
- io_config.iocsr_ddr = iocsr_scan_chain3_table;
-
- socfpga_lowlevel_init(&cm_default_cfg, &io_config);
-
- puts_ll("lowlevel init done\n");
- puts_ll("SDRAM setup...\n");
-
- socfpga_sdram_mmr_init();
-
- puts_ll("SDRAM calibration...\n");
-
- ret = socfpga_mem_calibration();
- if (!ret)
- hang();
-
- puts_ll("done\n");
-
- barebox_arm_entry(0x0, SZ_1G, NULL);
-}
-
-ENTRY_FUNCTION(start_socfpga_de0_nano_soc_xload, r0, r1, r2)
-{
- arm_cpu_lowlevel_init();
-
- arm_setup_stack(0xffff0000 + SZ_64K - SZ_4K - 16);
-
- de0_nano_soc_entry();
-}
+SOCFPGA_C5_ENTRY(start_socfpga_de0_nano_soc, socfpga_cyclone5_de0_nano_soc, SZ_1G);
+SOCFPGA_C5_XLOAD_ENTRY(start_socfpga_de0_nano_soc_xload, SZ_1G);
--
2.19.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/5] ARM: socfpga: socdk: convert to lowlevel helpers
2018-11-02 15:04 [PATCH 1/5] ARM: socfpga: add lowlevel header with common code Steffen Trumtrar
2018-11-02 15:04 ` [PATCH 2/5] ARM: socfpga: sockit: convert to lowlevel helper Steffen Trumtrar
2018-11-02 15:04 ` [PATCH 3/5] ARM: socfgpa: de0-nano-soc: convert to lowlevel helpers Steffen Trumtrar
@ 2018-11-02 15:04 ` Steffen Trumtrar
2018-11-02 15:04 ` [PATCH 5/5] ARM: socfpga: socrates: " Steffen Trumtrar
2018-11-06 8:30 ` [PATCH 1/5] ARM: socfpga: add lowlevel header with common code Sascha Hauer
4 siblings, 0 replies; 6+ messages in thread
From: Steffen Trumtrar @ 2018-11-02 15:04 UTC (permalink / raw)
To: Barebox List
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
---
arch/arm/boards/altera-socdk/lowlevel.c | 69 ++-----------------------
1 file changed, 3 insertions(+), 66 deletions(-)
diff --git a/arch/arm/boards/altera-socdk/lowlevel.c b/arch/arm/boards/altera-socdk/lowlevel.c
index 08e70a0fc659..822c3d8ee60d 100644
--- a/arch/arm/boards/altera-socdk/lowlevel.c
+++ b/arch/arm/boards/altera-socdk/lowlevel.c
@@ -1,76 +1,13 @@
-#include <common.h>
-#include <linux/sizes.h>
-#include <io.h>
-#include <asm/barebox-arm-head.h>
-#include <asm/barebox-arm.h>
-#include <mach/generic.h>
-#include <debug_ll.h>
-#include <asm/cache.h>
#include "sdram_config.h"
-#include <mach/cyclone5-sdram-config.h>
#include "pinmux_config.c"
#include "pll_config.h"
-#include <mach/pll_config.h>
#include "sequencer_defines.h"
#include "sequencer_auto.h"
-#include <mach/cyclone5-sequencer.c>
#include "sequencer_auto_inst_init.c"
#include "sequencer_auto_ac_init.c"
#include "iocsr_config_cyclone5.c"
-extern char __dtb_socfpga_cyclone5_socdk_start[];
+#include <mach/lowlevel.h>
-ENTRY_FUNCTION(start_socfpga_socdk, r0, r1, r2)
-{
- void *fdt;
-
- arm_cpu_lowlevel_init();
-
- fdt = __dtb_socfpga_cyclone5_socdk_start + get_runtime_offset();
-
- barebox_arm_entry(0x0, SZ_1G, fdt);
-}
-
-static noinline void socdk_entry(void)
-{
- struct socfpga_io_config io_config;
- int ret;
-
- arm_early_mmu_cache_invalidate();
-
- relocate_to_current_adr();
- setup_c();
-
- io_config.pinmux = sys_mgr_init_table;
- io_config.num_pin = ARRAY_SIZE(sys_mgr_init_table);
- io_config.iocsr_emac_mixed2 = iocsr_scan_chain0_table;
- io_config.iocsr_mixed1_flash = iocsr_scan_chain1_table;
- io_config.iocsr_general = iocsr_scan_chain2_table;
- io_config.iocsr_ddr = iocsr_scan_chain3_table;
-
- socfpga_lowlevel_init(&cm_default_cfg, &io_config);
-
- puts_ll("lowlevel init done\n");
- puts_ll("SDRAM setup...\n");
-
- socfpga_sdram_mmr_init();
-
- puts_ll("SDRAM calibration...\n");
-
- ret = socfpga_mem_calibration();
- if (!ret)
- hang();
-
- puts_ll("done\n");
-
- barebox_arm_entry(0x0, SZ_1G, NULL);
-}
-
-ENTRY_FUNCTION(start_socfpga_socdk_xload, r0, r1, r2)
-{
- arm_cpu_lowlevel_init();
-
- arm_setup_stack(0xffff0000 + SZ_64K - SZ_4K - 16);
-
- socdk_entry();
-}
+SOCFPGA_C5_ENTRY(start_socfpga_socdk, socfpga_cyclone5_socdk, SZ_1G);
+SOCFPGA_C5_XLOAD_ENTRY(start_socfpga_socdk_xload, SZ_1G);
--
2.19.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 5/5] ARM: socfpga: socrates: convert to lowlevel helpers
2018-11-02 15:04 [PATCH 1/5] ARM: socfpga: add lowlevel header with common code Steffen Trumtrar
` (2 preceding siblings ...)
2018-11-02 15:04 ` [PATCH 4/5] ARM: socfpga: socdk: " Steffen Trumtrar
@ 2018-11-02 15:04 ` Steffen Trumtrar
2018-11-06 8:30 ` [PATCH 1/5] ARM: socfpga: add lowlevel header with common code Sascha Hauer
4 siblings, 0 replies; 6+ messages in thread
From: Steffen Trumtrar @ 2018-11-02 15:04 UTC (permalink / raw)
To: Barebox List
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
---
arch/arm/boards/ebv-socrates/lowlevel.c | 71 ++-----------------------
1 file changed, 4 insertions(+), 67 deletions(-)
diff --git a/arch/arm/boards/ebv-socrates/lowlevel.c b/arch/arm/boards/ebv-socrates/lowlevel.c
index ef9f4535f6e9..3f12ae806fc8 100644
--- a/arch/arm/boards/ebv-socrates/lowlevel.c
+++ b/arch/arm/boards/ebv-socrates/lowlevel.c
@@ -1,23 +1,14 @@
-#include <common.h>
-#include <linux/sizes.h>
-#include <io.h>
-#include <asm/barebox-arm-head.h>
-#include <asm/barebox-arm.h>
-#include <asm/cache.h>
-#include <mach/generic.h>
-#include <debug_ll.h>
#include "sdram_config.h"
-#include <mach/cyclone5-sdram-config.h>
#include "pinmux_config.c"
#include "pll_config.h"
-#include <mach/pll_config.h>
#include "sequencer_defines.h"
#include "sequencer_auto.h"
-#include <mach/cyclone5-sequencer.c>
#include "sequencer_auto_inst_init.c"
#include "sequencer_auto_ac_init.c"
#include "iocsr_config_cyclone5.c"
+#include <mach/lowlevel.h>
+
static inline void ledon(void)
{
u32 val;
@@ -44,59 +35,5 @@ static inline void ledoff(void)
writel(val, 0xFF708004);
}
-extern char __dtb_socfpga_cyclone5_socrates_start[];
-
-ENTRY_FUNCTION(start_socfpga_socrates, r0, r1, r2)
-{
- void *fdt;
-
- arm_cpu_lowlevel_init();
-
- fdt = __dtb_socfpga_cyclone5_socrates_start + get_runtime_offset();
-
- barebox_arm_entry(0x0, SZ_1G, fdt);
-}
-
-static noinline void socrates_entry(void)
-{
- struct socfpga_io_config io_config;
- int ret;
-
- arm_early_mmu_cache_invalidate();
-
- relocate_to_current_adr();
- setup_c();
-
- io_config.pinmux = sys_mgr_init_table;
- io_config.num_pin = ARRAY_SIZE(sys_mgr_init_table);
- io_config.iocsr_emac_mixed2 = iocsr_scan_chain0_table;
- io_config.iocsr_mixed1_flash = iocsr_scan_chain1_table;
- io_config.iocsr_general = iocsr_scan_chain2_table;
- io_config.iocsr_ddr = iocsr_scan_chain3_table;
-
- socfpga_lowlevel_init(&cm_default_cfg, &io_config);
-
- puts_ll("lowlevel init done\n");
- puts_ll("SDRAM setup...\n");
-
- socfpga_sdram_mmr_init();
-
- puts_ll("SDRAM calibration...\n");
-
- ret = socfpga_mem_calibration();
- if (!ret)
- hang();
-
- puts_ll("done\n");
-
- barebox_arm_entry(0x0, SZ_1G, NULL);
-}
-
-ENTRY_FUNCTION(start_socfpga_socrates_xload, r0, r1, r2)
-{
- arm_cpu_lowlevel_init();
-
- arm_setup_stack(0xffff0000 + SZ_64K - SZ_4K - 16);
-
- socrates_entry();
-}
+SOCFPGA_C5_ENTRY(start_socfpga_socrates, socfpga_cyclone5_socrates, SZ_1G);
+SOCFPGA_C5_XLOAD_ENTRY(start_socfpga_socrates_xload, SZ_1G);
--
2.19.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: [PATCH 1/5] ARM: socfpga: add lowlevel header with common code
2018-11-02 15:04 [PATCH 1/5] ARM: socfpga: add lowlevel header with common code Steffen Trumtrar
` (3 preceding siblings ...)
2018-11-02 15:04 ` [PATCH 5/5] ARM: socfpga: socrates: " Steffen Trumtrar
@ 2018-11-06 8:30 ` Sascha Hauer
4 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2018-11-06 8:30 UTC (permalink / raw)
To: Steffen Trumtrar; +Cc: Barebox List
On Fri, Nov 02, 2018 at 04:04:20PM +0100, Steffen Trumtrar wrote:
> Apart from the RAM size, all cyclone5-based Socfpga boards use the
> same lowlevel code. Instead of duplicating it for every board, move
> it to mach-socfpga and provide a macro to use it in the boardspecific
> code.
>
> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
> ---
> arch/arm/mach-socfpga/include/mach/lowlevel.h | 80 +++++++++++++++++++
> 1 file changed, 80 insertions(+)
> create mode 100644 arch/arm/mach-socfpga/include/mach/lowlevel.h
Nice diffstat ;) 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