diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2020-07-01 11:11:21 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-07-14 20:32:56 +0200 |
commit | b12324293fbec7e07a5d03588ad412c7476668a1 (patch) | |
tree | 218da371458dc9232984a9607bf607368a201f47 /arch/arm | |
parent | 9ac9186550fce7fe13ddb389ddf2e81c47859662 (diff) | |
download | barebox-b12324293fbec7e07a5d03588ad412c7476668a1.tar.gz barebox-b12324293fbec7e07a5d03588ad412c7476668a1.tar.xz |
ARM: at91: sama5d27-giantboard: add additional first stage entry point
The BootROM constrains us to a 64K big first stage bootloader. Add a PBL
entry point for a xload barebox that sets up the minimum necessary to
load a FAT32 barebox.bin from the SD-Card.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/boards/sama5d27-giantboard/lowlevel.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/arch/arm/boards/sama5d27-giantboard/lowlevel.c b/arch/arm/boards/sama5d27-giantboard/lowlevel.c index 3dada9baf2..ee8297fa45 100644 --- a/arch/arm/boards/sama5d27-giantboard/lowlevel.c +++ b/arch/arm/boards/sama5d27-giantboard/lowlevel.c @@ -5,22 +5,33 @@ #include <common.h> #include <init.h> - -#include <asm/barebox-arm-head.h> #include <mach/barebox-arm.h> #include <mach/sama5d2_ll.h> +#include <mach/xload.h> +#include <mach/sama5d2-sip-ddramc.h> #include <mach/iomux.h> #include <debug_ll.h> -#include <mach/at91_dbgu.h> /* PCK = 492MHz, MCK = 164MHz */ #define MASTER_CLOCK 164000000 -static void dbgu_init(void) +SAMA5_ENTRY_FUNCTION(start_sama5d27_giantboard_xload_mmc, r4) { - sama5d2_resetup_uart_console(MASTER_CLOCK); + void __iomem *dbgu_base; + + sama5d2_lowlevel_init(); + dbgu_base = sama5d2_resetup_uart_console(MASTER_CLOCK); putc_ll('>'); + + relocate_to_current_adr(); + setup_c(); + + pbl_set_putc(at91_dbgu_putc, dbgu_base); + + sama5d2_udelay_init(MASTER_CLOCK); + sama5d2_d1g_ddrconf(); + sama5d2_sdhci_start_image(r4); } extern char __dtb_z_at91_sama5d27_giantboard_start[]; @@ -29,10 +40,7 @@ SAMA5_ENTRY_FUNCTION(start_sama5d27_giantboard, r4) { void *fdt; - arm_cpu_lowlevel_init(); - - if (IS_ENABLED(CONFIG_DEBUG_LL)) - dbgu_init(); + putc_ll('>'); fdt = __dtb_z_at91_sama5d27_giantboard_start + get_runtime_offset(); |