summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/at91sam9260.c
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2012-12-28 20:16:10 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-01-07 18:56:58 +0100
commit29597813dcfa9008f26a65002ee0e3f0979326f9 (patch)
treef3cdaeb88d4276364564131cf6ecf4b8efc61026 /arch/arm/mach-at91/at91sam9260.c
parent49edc4c9876d0698c090ddfc2de6802eedee5e93 (diff)
downloadbarebox-29597813dcfa9008f26a65002ee0e3f0979326f9.tar.gz
barebox-29597813dcfa9008f26a65002ee0e3f0979326f9.tar.xz
at91: autodetect the soc one time at postcore_initcall
and then register a device The code is take from linux drop AT91_BASE_SYS for dbgu factorise the soc type in the Kconfig but keep the ARCH_ so far as the device code have the same function accross soc which for now does not allow us to compile soc together Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-at91/at91sam9260.c')
-rw-r--r--arch/arm/mach-at91/at91sam9260.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index b76bfb2e85..4c76d949a5 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -4,6 +4,7 @@
#include <asm/hardware.h>
#include <mach/at91_pmc.h>
+#include "soc.h"
#include "generic.h"
#include "clock.h"
@@ -221,7 +222,7 @@ static void __init at91sam9260_register_clocks(void)
clk_register(&pck1);
}
-static int at91sam9260_initialize(void)
+static void at91sam9260_initialize(void)
{
/* Init clock subsystem */
at91_clock_init(AT91_MAIN_CLOCK);
@@ -229,18 +230,14 @@ static int at91sam9260_initialize(void)
/* Register the processor-specific clocks */
at91sam9260_register_clocks();
- return 0;
-}
-core_initcall(at91sam9260_initialize);
-
-static int at91sam9260_gpio_init(void)
-{
/* Register GPIO subsystem */
at91_add_rm9200_gpio(0, AT91_BASE_PIOA);
at91_add_rm9200_gpio(1, AT91_BASE_PIOB);
at91_add_rm9200_gpio(2, AT91_BASE_PIOC);
- at91_add_pit(AT91SAM9260_BASE_PIT);
- return 0;
+ at91_add_pit(AT91SAM9260_BASE_PIT);
}
-postcore_initcall(at91sam9260_gpio_init);
+
+AT91_SOC_START(sam9260)
+ .init = at91sam9260_initialize,
+AT91_SOC_END