2013-01-26 18:19:55 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
|
|
|
|
*
|
|
|
|
* Under GPLv2
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define __LOWLEVEL_INIT__
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <asm/system.h>
|
|
|
|
#include <asm/barebox-arm.h>
|
|
|
|
#include <asm/barebox-arm-head.h>
|
|
|
|
#include <mach/hardware.h>
|
|
|
|
#include <mach/at91_pmc.h>
|
|
|
|
#include <mach/at91_pio.h>
|
|
|
|
#include <mach/at91_rstc.h>
|
|
|
|
#include <mach/at91_wdt.h>
|
|
|
|
#include <mach/at91sam9_matrix.h>
|
|
|
|
#include <mach/at91sam9_sdramc.h>
|
|
|
|
#include <mach/at91sam9_smc.h>
|
|
|
|
#include <mach/at91_lowlevel_init.h>
|
|
|
|
#include <mach/io.h>
|
|
|
|
#include <init.h>
|
|
|
|
#include <sizes.h>
|
|
|
|
|
2013-02-03 15:24:12 +00:00
|
|
|
void __bare_init at91sam9260_lowlevel_init(void)
|
|
|
|
{
|
|
|
|
struct at91sam926x_lowlevel_cfg cfg;
|
|
|
|
|
|
|
|
cfg.pio = IOMEM(AT91SAM9260_BASE_PIOC);
|
2013-02-03 15:24:13 +00:00
|
|
|
cfg.sdramc = IOMEM(AT91SAM9260_BASE_SDRAMC);
|
2013-02-03 15:24:12 +00:00
|
|
|
cfg.ebi_pio_is_peripha = false;
|
|
|
|
cfg.matrix_csa = AT91_MATRIX_EBICSA;
|
|
|
|
|
|
|
|
at91sam926x_lowlevel_init(&cfg);
|
|
|
|
|
2013-02-03 15:24:13 +00:00
|
|
|
barebox_arm_entry(AT91_CHIPSELECT_1, at91_get_sdram_size(cfg.sdramc), 0);
|
2013-02-03 15:24:12 +00:00
|
|
|
}
|
|
|
|
|
2013-02-05 13:45:26 +00:00
|
|
|
void __naked __bare_init barebox_arm_reset_vector(void)
|
2013-01-26 18:19:55 +00:00
|
|
|
{
|
2013-02-05 13:45:26 +00:00
|
|
|
arm_cpu_lowlevel_init();
|
2013-01-26 18:19:55 +00:00
|
|
|
|
|
|
|
arm_setup_stack(AT91SAM9260_SRAM_BASE + AT91SAM9260_SRAM_SIZE - 16);
|
|
|
|
|
2013-02-03 15:24:12 +00:00
|
|
|
at91sam9260_lowlevel_init();
|
2013-01-26 18:19:55 +00:00
|
|
|
}
|