summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/sama5d27-giantboard/lowlevel.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/boards/sama5d27-giantboard/lowlevel.c')
-rw-r--r--arch/arm/boards/sama5d27-giantboard/lowlevel.c53
1 files changed, 19 insertions, 34 deletions
diff --git a/arch/arm/boards/sama5d27-giantboard/lowlevel.c b/arch/arm/boards/sama5d27-giantboard/lowlevel.c
index 0236c424c1..49540bede0 100644
--- a/arch/arm/boards/sama5d27-giantboard/lowlevel.c
+++ b/arch/arm/boards/sama5d27-giantboard/lowlevel.c
@@ -5,59 +5,44 @@
#include <common.h>
#include <init.h>
-
-#include <asm/barebox-arm-head.h>
-#include <asm/barebox-arm.h>
-#include <mach/at91_pmc_ll.h>
-
-#include <mach/hardware.h>
-#include <mach/iomux.h>
+#include <mach/at91/barebox-arm.h>
+#include <mach/at91/sama5d2_ll.h>
+#include <mach/at91/xload.h>
+#include <mach/at91/sama5d2-sip-ddramc.h>
+#include <mach/at91/iomux.h>
#include <debug_ll.h>
-#include <mach/at91_dbgu.h>
/* PCK = 492MHz, MCK = 164MHz */
#define MASTER_CLOCK 164000000
-static inline void sama5d2_pmc_enable_periph_clock(int clk)
+SAMA5D2_ENTRY_FUNCTION(start_sama5d27_giantboard_xload_mmc, r4)
{
- at91_pmc_sam9x5_enable_periph_clock(IOMEM(SAMA5D2_BASE_PMC), clk);
-}
+ void __iomem *dbgu_base;
-static void dbgu_init(void)
-{
- unsigned mck = MASTER_CLOCK / 2;
+ sama5d2_lowlevel_init();
- sama5d2_pmc_enable_periph_clock(SAMA5D2_ID_PIOD);
-
- at91_mux_pio4_set_A_periph(IOMEM(SAMA5D2_BASE_PIOD),
- pin_to_mask(AT91_PIN_PD3)); /* DBGU TXD */
+ dbgu_base = sama5d2_resetup_uart_console(MASTER_CLOCK);
+ putc_ll('>');
- sama5d2_pmc_enable_periph_clock(SAMA5D2_ID_UART1);
+ relocate_to_current_adr();
+ setup_c();
- at91_dbgu_setup_ll(IOMEM(SAMA5D2_BASE_UART1), mck, 115200);
+ pbl_set_putc(at91_dbgu_putc, dbgu_base);
- putc_ll('>');
+ sama5d2_udelay_init(MASTER_CLOCK);
+ sama5d2_d1g_ddrconf();
+ sama5d2_sdhci_start_image(r4);
}
extern char __dtb_z_at91_sama5d27_giantboard_start[];
-static noinline void giantboard_entry(void)
+SAMA5D2_ENTRY_FUNCTION(start_sama5d27_giantboard, r4)
{
void *fdt;
- if (IS_ENABLED(CONFIG_DEBUG_LL))
- dbgu_init();
+ putc_ll('>');
fdt = __dtb_z_at91_sama5d27_giantboard_start + get_runtime_offset();
- barebox_arm_entry(SAMA5_DDRCS, SZ_128M, fdt);
-}
-
-ENTRY_FUNCTION(start_sama5d27_giantboard, r0, r1, r2)
-{
- arm_cpu_lowlevel_init();
-
- arm_setup_stack(SAMA5D2_SRAM_BASE + SAMA5D2_SRAM_SIZE);
-
- giantboard_entry();
+ sama5d2_barebox_entry(r4, fdt);
}