summaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/boards/Makefile1
-rw-r--r--arch/arm/boards/animeo_ip/Makefile3
-rw-r--r--arch/arm/boards/animeo_ip/lowlevel.c26
-rw-r--r--arch/arm/boards/at91rm9200ek/Makefile3
-rw-r--r--arch/arm/boards/at91rm9200ek/lowlevel.c (renamed from arch/arm/mach-at91/at91rm9200_lowlevel_init.c)14
-rw-r--r--arch/arm/boards/at91sam9260ek/Makefile3
-rw-r--r--arch/arm/boards/at91sam9260ek/lowlevel.c26
-rw-r--r--arch/arm/boards/at91sam9261ek/Makefile2
-rw-r--r--arch/arm/boards/at91sam9261ek/lowlevel_init.c41
-rw-r--r--arch/arm/boards/at91sam9263ek/Makefile6
-rw-r--r--arch/arm/boards/at91sam9263ek/lowlevel_init.c52
-rw-r--r--arch/arm/boards/at91sam9263ek/of_init.c93
-rw-r--r--arch/arm/boards/at91sam9m10g45ek/Makefile3
-rw-r--r--arch/arm/boards/at91sam9m10g45ek/lowlevel.c (renamed from arch/arm/mach-at91/at91sam9g45_lowlevel_init.c)13
-rw-r--r--arch/arm/boards/at91sam9m10ihd/Makefile2
-rw-r--r--arch/arm/boards/at91sam9m10ihd/lowlevel.c (renamed from arch/arm/mach-at91/at91sam9x5_lowlevel_init.c)21
-rw-r--r--arch/arm/boards/at91sam9n12ek/Makefile3
-rw-r--r--arch/arm/boards/at91sam9n12ek/lowlevel.c (renamed from arch/arm/mach-at91/at91sam9n12_lowlevel_init.c)15
-rw-r--r--arch/arm/boards/dss11/Makefile2
-rw-r--r--arch/arm/boards/dss11/lowlevel.c26
-rw-r--r--arch/arm/boards/haba-knx/Makefile3
-rw-r--r--arch/arm/boards/haba-knx/lowlevel.c26
-rw-r--r--arch/arm/boards/mmccpu/Makefile3
-rw-r--r--arch/arm/boards/mmccpu/env/bin/_update36
-rw-r--r--arch/arm/boards/mmccpu/env/bin/boot47
-rw-r--r--arch/arm/boards/mmccpu/env/bin/init33
-rw-r--r--arch/arm/boards/mmccpu/env/bin/update_kernel15
-rw-r--r--arch/arm/boards/mmccpu/env/bin/update_root16
-rw-r--r--arch/arm/boards/mmccpu/env/config30
-rw-r--r--arch/arm/boards/mmccpu/init.c88
-rw-r--r--arch/arm/boards/mmccpu/lowlevel_init.c135
-rw-r--r--arch/arm/boards/phytec-som-am335x/lowlevel.c1
-rw-r--r--arch/arm/boards/pm9261/Makefile2
-rw-r--r--arch/arm/boards/pm9261/lowlevel_init.c39
-rw-r--r--arch/arm/boards/pm9263/Makefile2
-rw-r--r--arch/arm/boards/pm9263/lowlevel_init.c43
-rw-r--r--arch/arm/boards/pm9g45/Makefile3
-rw-r--r--arch/arm/boards/pm9g45/lowlevel.c24
-rw-r--r--arch/arm/boards/qil-a926x/Makefile3
-rw-r--r--arch/arm/boards/qil-a926x/lowlevel.c26
-rw-r--r--arch/arm/boards/sama5d3_xplained/Makefile1
-rw-r--r--arch/arm/boards/sama5d3_xplained/lowlevel.c (renamed from arch/arm/mach-at91/sama5d3_lowlevel_init.c)12
-rw-r--r--arch/arm/boards/sama5d3xek/Makefile1
-rw-r--r--arch/arm/boards/sama5d3xek/lowlevel.c23
-rw-r--r--arch/arm/boards/sama5d4_xplained/Makefile1
-rw-r--r--arch/arm/boards/sama5d4_xplained/lowlevel.c23
-rw-r--r--arch/arm/boards/sama5d4ek/Makefile1
-rw-r--r--arch/arm/boards/sama5d4ek/lowlevel.c23
-rw-r--r--arch/arm/boards/telit-evk-pro3/Makefile2
-rw-r--r--arch/arm/boards/telit-evk-pro3/lowlevel.c26
-rw-r--r--arch/arm/boards/tny-a926x/Makefile9
-rw-r--r--arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c26
-rw-r--r--arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c (renamed from arch/arm/boards/tny-a926x/tny_a9263_lowlevel_init.c)49
-rw-r--r--arch/arm/boards/usb-a926x/Makefile8
-rw-r--r--arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c26
-rw-r--r--arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c (renamed from arch/arm/boards/usb-a926x/usb_a9263_lowlevel_init.c)43
-rw-r--r--arch/arm/configs/at91sam9263ek_defconfig10
-rw-r--r--arch/arm/configs/mmccpu_defconfig37
-rw-r--r--arch/arm/dts/Makefile2
-rw-r--r--arch/arm/dts/at91sam9263ek.dts48
-rw-r--r--arch/arm/mach-at91/Kconfig63
-rw-r--r--arch/arm/mach-at91/Makefile20
-rw-r--r--arch/arm/mach-at91/at91rm9200.c10
-rw-r--r--arch/arm/mach-at91/at91sam9260.c10
-rw-r--r--arch/arm/mach-at91/at91sam9260_devices.c1
-rw-r--r--arch/arm/mach-at91/at91sam9260_lowlevel_init.c48
-rw-r--r--arch/arm/mach-at91/at91sam9261.c10
-rw-r--r--arch/arm/mach-at91/at91sam9261_devices.c1
-rw-r--r--arch/arm/mach-at91/at91sam9261_lowlevel_init.c48
-rw-r--r--arch/arm/mach-at91/at91sam9263.c10
-rw-r--r--arch/arm/mach-at91/at91sam9263_devices.c1
-rw-r--r--arch/arm/mach-at91/at91sam9263_lowlevel_init.c48
-rw-r--r--arch/arm/mach-at91/at91sam9g45.c10
-rw-r--r--arch/arm/mach-at91/at91sam9g45_devices.c1
-rw-r--r--arch/arm/mach-at91/at91sam9n12.c10
-rw-r--r--arch/arm/mach-at91/generic.h11
-rw-r--r--arch/arm/mach-at91/include/mach/at91_lowlevel_init.h46
-rw-r--r--arch/arm/mach-at91/include/mach/at91_rtt.h16
-rw-r--r--arch/arm/mach-at91/include/mach/at91sam926x_board_init.h (renamed from arch/arm/mach-at91/at91sam926x_lowlevel_init.c)148
-rw-r--r--arch/arm/mach-at91/irq_fixup.c22
-rw-r--r--arch/arm/mach-at91/sama5d3.c10
-rw-r--r--arch/arm/mach-at91/sama5d4.c10
-rw-r--r--arch/arm/mach-at91/setup.c26
-rw-r--r--arch/arm/mach-at91/soc.h76
-rw-r--r--arch/arm/mach-imx/include/mach/imx6.h2
-rw-r--r--arch/arm/mach-imx/include/mach/imx7-ccm-regs.h3
-rw-r--r--arch/arm/mach-imx/include/mach/imx7-regs.h2
-rw-r--r--arch/arm/mach-imx/include/mach/revision.h1
88 files changed, 931 insertions, 1034 deletions
diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index 456e6fea4b..ca187ccb89 100644
--- a/arch/arm/boards/Makefile
+++ b/arch/arm/boards/Makefile
@@ -67,7 +67,6 @@ obj-$(CONFIG_MACH_MAINSTONE) += mainstone/
obj-$(CONFIG_MACH_MARVELL_ARMADA_XP_GP) += marvell-armada-xp-gp/
obj-$(CONFIG_MACH_MB7707) += module-mb7707/
obj-$(CONFIG_MACH_MIOA701) += mioa701/
-obj-$(CONFIG_MACH_MMCCPU) += mmccpu/
obj-$(CONFIG_MACH_MX23EVK) += freescale-mx23-evk/
obj-$(CONFIG_MACH_MX28EVK) += freescale-mx28-evk/
obj-$(CONFIG_MACH_MX31MOBOARD) += mx31moboard/
diff --git a/arch/arm/boards/animeo_ip/Makefile b/arch/arm/boards/animeo_ip/Makefile
index 510b142ff3..61c714b45d 100644
--- a/arch/arm/boards/animeo_ip/Makefile
+++ b/arch/arm/boards/animeo_ip/Makefile
@@ -1,2 +1,5 @@
obj-y += init.o
+
+lwl-y += lowlevel.o
+
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-animeo_ip
diff --git a/arch/arm/boards/animeo_ip/lowlevel.c b/arch/arm/boards/animeo_ip/lowlevel.c
new file mode 100644
index 0000000000..b16ef31bf0
--- /dev/null
+++ b/arch/arm/boards/animeo_ip/lowlevel.c
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+ *
+ * Under GPLv2
+ */
+
+#include <common.h>
+#include <init.h>
+
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+#include <mach/at91sam9_sdramc.h>
+#include <mach/at91sam9260.h>
+#include <mach/hardware.h>
+
+void __naked __bare_init barebox_arm_reset_vector(void)
+{
+ arm_cpu_lowlevel_init();
+
+ arm_setup_stack(AT91SAM9260_SRAM_BASE + AT91SAM9260_SRAM_SIZE - 16);
+
+ barebox_arm_entry(AT91_CHIPSELECT_1,
+ at91_get_sdram_size(IOMEM(AT91SAM9260_BASE_SDRAMC)),
+ NULL);
+}
diff --git a/arch/arm/boards/at91rm9200ek/Makefile b/arch/arm/boards/at91rm9200ek/Makefile
index dec1c50455..a07c06a6d9 100644
--- a/arch/arm/boards/at91rm9200ek/Makefile
+++ b/arch/arm/boards/at91rm9200ek/Makefile
@@ -1,2 +1,5 @@
obj-y += init.o
+
+lwl-y += lowlevel.o
+
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91rm9200ek
diff --git a/arch/arm/mach-at91/at91rm9200_lowlevel_init.c b/arch/arm/boards/at91rm9200ek/lowlevel.c
index f78e368086..a85a22e797 100644
--- a/arch/arm/mach-at91/at91rm9200_lowlevel_init.c
+++ b/arch/arm/boards/at91rm9200ek/lowlevel.c
@@ -4,19 +4,17 @@
* Under GPLv2
*/
-#define __LOWLEVEL_INIT__
-
#include <common.h>
-#include <asm/system.h>
-#include <asm/barebox-arm.h>
+#include <init.h>
+
#include <asm/barebox-arm-head.h>
-#include <mach/hardware.h>
-#include <mach/at91rm9200.h>
+#include <asm/barebox-arm.h>
+
#include <mach/at91rm9200_mc.h>
+#include <mach/at91rm9200.h>
#include <mach/at91_pio.h>
#include <mach/at91_pmc.h>
-#include <mach/io.h>
-#include <init.h>
+#include <mach/hardware.h>
void static inline access_sdram(void)
{
diff --git a/arch/arm/boards/at91sam9260ek/Makefile b/arch/arm/boards/at91sam9260ek/Makefile
index 6e07f189fa..9cc933a287 100644
--- a/arch/arm/boards/at91sam9260ek/Makefile
+++ b/arch/arm/boards/at91sam9260ek/Makefile
@@ -1,2 +1,5 @@
obj-y += init.o
+
+lwl-y += lowlevel.o
+
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9260ek
diff --git a/arch/arm/boards/at91sam9260ek/lowlevel.c b/arch/arm/boards/at91sam9260ek/lowlevel.c
new file mode 100644
index 0000000000..b16ef31bf0
--- /dev/null
+++ b/arch/arm/boards/at91sam9260ek/lowlevel.c
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+ *
+ * Under GPLv2
+ */
+
+#include <common.h>
+#include <init.h>
+
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+#include <mach/at91sam9_sdramc.h>
+#include <mach/at91sam9260.h>
+#include <mach/hardware.h>
+
+void __naked __bare_init barebox_arm_reset_vector(void)
+{
+ arm_cpu_lowlevel_init();
+
+ arm_setup_stack(AT91SAM9260_SRAM_BASE + AT91SAM9260_SRAM_SIZE - 16);
+
+ barebox_arm_entry(AT91_CHIPSELECT_1,
+ at91_get_sdram_size(IOMEM(AT91SAM9260_BASE_SDRAMC)),
+ NULL);
+}
diff --git a/arch/arm/boards/at91sam9261ek/Makefile b/arch/arm/boards/at91sam9261ek/Makefile
index 1764da93f2..e7a9cde419 100644
--- a/arch/arm/boards/at91sam9261ek/Makefile
+++ b/arch/arm/boards/at91sam9261ek/Makefile
@@ -1,4 +1,4 @@
obj-y += init.o
-lwl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
+lwl-y += lowlevel_init.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9261ek
diff --git a/arch/arm/boards/at91sam9261ek/lowlevel_init.c b/arch/arm/boards/at91sam9261ek/lowlevel_init.c
index 056584166c..c4e4957ca7 100644
--- a/arch/arm/boards/at91sam9261ek/lowlevel_init.c
+++ b/arch/arm/boards/at91sam9261ek/lowlevel_init.c
@@ -4,16 +4,10 @@
* Under GPLv2
*/
-#include <common.h>
-#include <init.h>
-#include <mach/hardware.h>
-#include <mach/at91_rstc.h>
-#include <mach/at91_wdt.h>
-#include <mach/at91_pmc.h>
-#include <mach/at91sam9_smc.h>
-#include <mach/at91sam9_sdramc.h>
-#include <mach/at91sam9_matrix.h>
-#include <mach/at91_lowlevel_init.h>
+#include <asm/barebox-arm.h>
+
+#include <mach/at91sam926x_board_init.h>
+#include <mach/at91sam9261_matrix.h>
#define MASTER_CLOCK 200
@@ -25,7 +19,7 @@
#define MASTER_PLL_DIV 1
#endif
-void __bare_init at91sam926x_lowlevel_board_config(struct at91sam926x_lowlevel_cfg *cfg)
+static void __bare_init at91sam9261ek_board_config(struct at91sam926x_board_cfg *cfg)
{
/* Disable Watchdog */
cfg->wdt_mr =
@@ -106,3 +100,28 @@ void __bare_init at91sam926x_lowlevel_board_config(struct at91sam926x_lowlevel_c
AT91_RSTC_RSTTYP_WAKEUP |
AT91_RSTC_RSTTYP_WATCHDOG;
}
+
+static void __bare_init at91sam9261ek_init(void)
+{
+ struct at91sam926x_board_cfg cfg;
+
+ cfg.pio = IOMEM(AT91SAM9261_BASE_PIOC);
+ cfg.sdramc = IOMEM(AT91SAM9261_BASE_SDRAMC);
+ cfg.ebi_pio_is_peripha = false;
+ cfg.matrix_csa = AT91_MATRIX_EBICSA;
+
+ at91sam9261ek_board_config(&cfg);
+ at91sam926x_board_init(&cfg);
+
+ barebox_arm_entry(AT91_CHIPSELECT_1, at91_get_sdram_size(cfg.sdramc),
+ NULL);
+}
+
+void __naked __bare_init barebox_arm_reset_vector(void)
+{
+ arm_cpu_lowlevel_init();
+
+ arm_setup_stack(AT91SAM9261_SRAM_BASE + AT91SAM9261_SRAM_SIZE - 16);
+
+ at91sam9261ek_init();
+}
diff --git a/arch/arm/boards/at91sam9263ek/Makefile b/arch/arm/boards/at91sam9263ek/Makefile
index 2072cd4164..7af6fab8e1 100644
--- a/arch/arm/boards/at91sam9263ek/Makefile
+++ b/arch/arm/boards/at91sam9263ek/Makefile
@@ -1,4 +1,6 @@
-obj-y += init.o
+obj-$(CONFIG_AT91_BOOTSTRAP) += init.o
+obj-$(CONFIG_OF_DEVICE) += of_init.o
+
+lwl-y += lowlevel_init.o
-lwl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9263ek
diff --git a/arch/arm/boards/at91sam9263ek/lowlevel_init.c b/arch/arm/boards/at91sam9263ek/lowlevel_init.c
index 2f8b312d34..2004d70cbe 100644
--- a/arch/arm/boards/at91sam9263ek/lowlevel_init.c
+++ b/arch/arm/boards/at91sam9263ek/lowlevel_init.c
@@ -4,21 +4,17 @@
* Under GPLv2
*/
-#include <common.h>
-#include <init.h>
-#include <mach/hardware.h>
-#include <mach/at91_rstc.h>
-#include <mach/at91_wdt.h>
-#include <mach/at91_pmc.h>
-#include <mach/at91sam9_smc.h>
-#include <mach/at91sam9_sdramc.h>
-#include <mach/at91sam9_matrix.h>
-#include <mach/at91_lowlevel_init.h>
+#include <linux/sizes.h>
+
+#include <asm/barebox-arm.h>
+
+#include <mach/at91sam926x_board_init.h>
+#include <mach/at91sam9263_matrix.h>
#define MASTER_PLL_MUL 171
#define MASTER_PLL_DIV 14
-void __bare_init at91sam926x_lowlevel_board_config(struct at91sam926x_lowlevel_cfg *cfg)
+static void __bare_init at91sam9263ek_board_config(struct at91sam926x_board_cfg *cfg)
{
/* Disable Watchdog */
cfg->wdt_mr =
@@ -102,3 +98,37 @@ void __bare_init at91sam926x_lowlevel_board_config(struct at91sam926x_lowlevel_c
AT91_RSTC_RSTTYP_WAKEUP |
AT91_RSTC_RSTTYP_WATCHDOG;
}
+
+static void __bare_init at91sam9263ek_init(void *fdt)
+{
+ struct at91sam926x_board_cfg cfg;
+
+ cfg.pio = IOMEM(AT91SAM9263_BASE_PIOD);
+ cfg.sdramc = IOMEM(AT91SAM9263_BASE_SDRAMC0);
+ cfg.ebi_pio_is_peripha = true;
+ cfg.matrix_csa = AT91_MATRIX_EBI0CSA;
+
+ at91sam9263ek_board_config(&cfg);
+ at91sam926x_board_init(&cfg);
+
+ barebox_arm_entry(AT91_CHIPSELECT_1, at91_get_sdram_size(cfg.sdramc),
+ fdt);
+}
+
+extern char __dtb_at91sam9263ek_start[];
+
+ENTRY_FUNCTION(start_at91sam9263ek, r0, r1, r2)
+{
+ void *fdt;
+
+ arm_cpu_lowlevel_init();
+
+ arm_setup_stack(AT91SAM9263_SRAM0_BASE + AT91SAM9263_SRAM0_SIZE - 16);
+
+ if (IS_ENABLED(CONFIG_MACH_AT91SAM9263EK_DT))
+ fdt = __dtb_at91sam9263ek_start - get_runtime_offset();
+ else
+ fdt = NULL;
+
+ at91sam9263ek_init(fdt);
+}
diff --git a/arch/arm/boards/at91sam9263ek/of_init.c b/arch/arm/boards/at91sam9263ek/of_init.c
new file mode 100644
index 0000000000..b4d216fa3e
--- /dev/null
+++ b/arch/arm/boards/at91sam9263ek/of_init.c
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2017 Sam Ravnborg <sam@ravnborg.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <common.h>
+#include <envfs.h>
+#include <init.h>
+#include <gpio.h>
+
+#include <mach/at91sam9263_matrix.h>
+#include <mach/at91sam9_smc.h>
+#include <mach/at91_rtt.h>
+#include <mach/hardware.h>
+#include <mach/iomux.h>
+#include <mach/io.h>
+
+static int add_smc_devices(void)
+{
+ add_generic_device("at91sam9-smc", 0, NULL, AT91SAM9263_BASE_SMC0, 0x200,
+ IORESOURCE_MEM, NULL);
+ add_generic_device("at91sam9-smc", 1, NULL, AT91SAM9263_BASE_SMC1, 0x200,
+ IORESOURCE_MEM, NULL);
+
+ return 0;
+}
+coredevice_initcall(add_smc_devices);
+
+static struct sam9_smc_config ek_nand_smc_config = {
+ .ncs_read_setup = 0,
+ .nrd_setup = 1,
+ .ncs_write_setup = 0,
+ .nwe_setup = 1,
+
+ .ncs_read_pulse = 3,
+ .nrd_pulse = 3,
+ .ncs_write_pulse = 3,
+ .nwe_pulse = 3,
+
+ .read_cycle = 5,
+ .write_cycle = 5,
+
+ .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE,
+ .tdf_cycles = 2,
+};
+
+static int at91sam9263_smc_init(void)
+{
+ unsigned long csa;
+
+ if (!of_machine_is_compatible("atmel,at91sam9263ek"))
+ return 0;
+
+ /* setup bus-width (8 or 16) */
+ if (IS_ENABLED(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16))
+ ek_nand_smc_config.mode |= AT91_SMC_DBW_16;
+ else
+ ek_nand_smc_config.mode |= AT91_SMC_DBW_8;
+
+ csa = at91_sys_read(AT91_MATRIX_EBI0CSA);
+ csa |= AT91_MATRIX_EBI0_CS3A_SMC_SMARTMEDIA;
+ at91_sys_write(AT91_MATRIX_EBI0CSA, csa);
+
+ /* configure chip-select 3 (NAND) */
+ sam9_smc_configure(0, 3, &ek_nand_smc_config);
+
+ return 0;
+}
+device_initcall(at91sam9263_smc_init);
+
+static int at91sam9263ek_env_init(void)
+{
+ if (!of_machine_is_compatible("atmel,at91sam9263ek"))
+ return 0;
+
+ at91_rtt_irq_fixup(IOMEM(AT91SAM9263_BASE_RTT0));
+ at91_rtt_irq_fixup(IOMEM(AT91SAM9263_BASE_RTT1));
+
+ if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+ defaultenv_append_directory(defaultenv_at91sam9263ek);
+
+ return 0;
+}
+late_initcall(at91sam9263ek_env_init);
diff --git a/arch/arm/boards/at91sam9m10g45ek/Makefile b/arch/arm/boards/at91sam9m10g45ek/Makefile
index dd8052157e..da011f825b 100644
--- a/arch/arm/boards/at91sam9m10g45ek/Makefile
+++ b/arch/arm/boards/at91sam9m10g45ek/Makefile
@@ -1,2 +1,5 @@
obj-y += init.o
+
+lwl-y += lowlevel.o
+
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9m10g45ek
diff --git a/arch/arm/mach-at91/at91sam9g45_lowlevel_init.c b/arch/arm/boards/at91sam9m10g45ek/lowlevel.c
index 2cdb7a6a5f..478ff11e1d 100644
--- a/arch/arm/mach-at91/at91sam9g45_lowlevel_init.c
+++ b/arch/arm/boards/at91sam9m10g45ek/lowlevel.c
@@ -2,19 +2,16 @@
* 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 <init.h>
+
#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
#include <mach/hardware.h>
-#include <mach/io.h>
#include <mach/at91sam9_ddrsdr.h>
-#include <init.h>
-#include <linux/sizes.h>
void __naked __bare_init barebox_arm_reset_vector(void)
{
diff --git a/arch/arm/boards/at91sam9m10ihd/Makefile b/arch/arm/boards/at91sam9m10ihd/Makefile
index f2acf201b4..06193007ad 100644
--- a/arch/arm/boards/at91sam9m10ihd/Makefile
+++ b/arch/arm/boards/at91sam9m10ihd/Makefile
@@ -1,2 +1,4 @@
obj-y += init.o
obj-y += hw_version.o
+
+lwl-y += lowlevel.o
diff --git a/arch/arm/mach-at91/at91sam9x5_lowlevel_init.c b/arch/arm/boards/at91sam9m10ihd/lowlevel.c
index 48e69f947d..d5940b987a 100644
--- a/arch/arm/mach-at91/at91sam9x5_lowlevel_init.c
+++ b/arch/arm/boards/at91sam9m10ihd/lowlevel.c
@@ -2,25 +2,24 @@
* 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 <init.h>
+
#include <asm/barebox-arm-head.h>
-#include <mach/hardware.h>
-#include <mach/io.h>
+#include <asm/barebox-arm.h>
+
#include <mach/at91sam9_ddrsdr.h>
-#include <init.h>
-#include <linux/sizes.h>
+#include <mach/at91sam9g45.h>
+#include <mach/hardware.h>
void __naked __bare_init barebox_arm_reset_vector(void)
{
arm_cpu_lowlevel_init();
- arm_setup_stack(AT91SAM9X5_SRAM_BASE + AT91SAM9X5_SRAM_SIZE - 16);
+ arm_setup_stack(AT91SAM9G45_SRAM_BASE + AT91SAM9G45_SRAM_SIZE - 16);
- barebox_arm_entry(AT91_CHIPSELECT_1, at91sam9x5_get_ddram_size(), NULL);
+ barebox_arm_entry(AT91_CHIPSELECT_6, at91sam9g45_get_ddram_size(1),
+ NULL);
}
diff --git a/arch/arm/boards/at91sam9n12ek/Makefile b/arch/arm/boards/at91sam9n12ek/Makefile
index f5d125a0e7..458b055918 100644
--- a/arch/arm/boards/at91sam9n12ek/Makefile
+++ b/arch/arm/boards/at91sam9n12ek/Makefile
@@ -1,2 +1,5 @@
obj-y += init.o
+
+lwl-y += lowlevel.o
+
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9n12ek
diff --git a/arch/arm/mach-at91/at91sam9n12_lowlevel_init.c b/arch/arm/boards/at91sam9n12ek/lowlevel.c
index 2b5cb158b0..47079336e6 100644
--- a/arch/arm/mach-at91/at91sam9n12_lowlevel_init.c
+++ b/arch/arm/boards/at91sam9n12ek/lowlevel.c
@@ -2,19 +2,16 @@
* 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 <init.h>
+
#include <asm/barebox-arm-head.h>
-#include <mach/hardware.h>
-#include <mach/io.h>
+#include <asm/barebox-arm.h>
+
#include <mach/at91sam9_ddrsdr.h>
-#include <init.h>
-#include <linux/sizes.h>
+#include <mach/hardware.h>
void __naked __bare_init barebox_arm_reset_vector(void)
{
diff --git a/arch/arm/boards/dss11/Makefile b/arch/arm/boards/dss11/Makefile
index eb072c0161..e11fd5b692 100644
--- a/arch/arm/boards/dss11/Makefile
+++ b/arch/arm/boards/dss11/Makefile
@@ -1 +1,3 @@
obj-y += init.o
+
+lwl-y += lowlevel.o
diff --git a/arch/arm/boards/dss11/lowlevel.c b/arch/arm/boards/dss11/lowlevel.c
new file mode 100644
index 0000000000..b16ef31bf0
--- /dev/null
+++ b/arch/arm/boards/dss11/lowlevel.c
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+ *
+ * Under GPLv2
+ */
+
+#include <common.h>
+#include <init.h>
+
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+#include <mach/at91sam9_sdramc.h>
+#include <mach/at91sam9260.h>
+#include <mach/hardware.h>
+
+void __naked __bare_init barebox_arm_reset_vector(void)
+{
+ arm_cpu_lowlevel_init();
+
+ arm_setup_stack(AT91SAM9260_SRAM_BASE + AT91SAM9260_SRAM_SIZE - 16);
+
+ barebox_arm_entry(AT91_CHIPSELECT_1,
+ at91_get_sdram_size(IOMEM(AT91SAM9260_BASE_SDRAMC)),
+ NULL);
+}
diff --git a/arch/arm/boards/haba-knx/Makefile b/arch/arm/boards/haba-knx/Makefile
index d9db6aba62..b1c469dcf9 100644
--- a/arch/arm/boards/haba-knx/Makefile
+++ b/arch/arm/boards/haba-knx/Makefile
@@ -1,2 +1,5 @@
obj-y += init.o
+
+lwl-y += lowlevel.o
+
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-haba-knx
diff --git a/arch/arm/boards/haba-knx/lowlevel.c b/arch/arm/boards/haba-knx/lowlevel.c
new file mode 100644
index 0000000000..b16ef31bf0
--- /dev/null
+++ b/arch/arm/boards/haba-knx/lowlevel.c
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+ *
+ * Under GPLv2
+ */
+
+#include <common.h>
+#include <init.h>
+
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+#include <mach/at91sam9_sdramc.h>
+#include <mach/at91sam9260.h>
+#include <mach/hardware.h>
+
+void __naked __bare_init barebox_arm_reset_vector(void)
+{
+ arm_cpu_lowlevel_init();
+
+ arm_setup_stack(AT91SAM9260_SRAM_BASE + AT91SAM9260_SRAM_SIZE - 16);
+
+ barebox_arm_entry(AT91_CHIPSELECT_1,
+ at91_get_sdram_size(IOMEM(AT91SAM9260_BASE_SDRAMC)),
+ NULL);
+}
diff --git a/arch/arm/boards/mmccpu/Makefile b/arch/arm/boards/mmccpu/Makefile
deleted file mode 100644
index 1398c26a0f..0000000000
--- a/arch/arm/boards/mmccpu/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-obj-y += init.o
-
-lwl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
diff --git a/arch/arm/boards/mmccpu/env/bin/_update b/arch/arm/boards/mmccpu/env/bin/_update
deleted file mode 100644
index 014bce3512..0000000000
--- a/arch/arm/boards/mmccpu/env/bin/_update
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/sh
-
-if [ -z "$part" -o -z "$image" ]; then
- echo "define \$part and \$image"
- exit 1
-fi
-
-if [ ! -e "$part" ]; then
- echo "Partition $part does not exist"
- exit 1
-fi
-
-if [ $# = 1 ]; then
- image=$1
-fi
-
-if [ x$ip = xdhcp ]; then
- dhcp
-fi
-
-ping $eth0.serverip
-if [ $? -ne 0 ] ; then
- echo "update aborted"
- exit 1
-fi
-
-unprotect $part
-
-echo
-echo "erasing partition $part"
-erase $part
-
-echo
-echo "flashing $image to $part"
-echo
-tftp $image $part
diff --git a/arch/arm/boards/mmccpu/env/bin/boot b/arch/arm/boards/mmccpu/env/bin/boot
deleted file mode 100644
index 533dea7618..0000000000
--- a/arch/arm/boards/mmccpu/env/bin/boot
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/sh
-
-. /env/config
-
-if [ x$1 = xnand ]; then
- root=nand
- kernel=nand
-fi
-
-if [ x$1 = xnet ]; then
- root=net
- kernel=net
-fi
-
-if [ x$1 = xnor ]; then
- root=nor
- kernel=nor
-fi
-
-if [ x$ip = xdhcp ]; then
- bootargs="$bootargs ip=dhcp"
-else
- bootargs="$bootargs ip=$eth0.ipaddr:$eth0.serverip:$eth0.gateway:$eth0.netmask:::"
-fi
-
-if [ x$root = xnand ]; then
- bootargs="$bootargs root=$rootpart_nand rootfstype=jffs2"
-elif [ x$root = xnor ]; then
- bootargs="$bootargs root=$rootpart_nor rootfstype=jffs2"
-else
- bootargs="$bootargs root=/dev/nfs nfsroot=$eth0.serverip:$nfsroot,v3,tcp"
-fi
-
-bootargs="$bootargs mtdparts=physmap-flash.0:$nor_parts"
-
-if [ $kernel = net ]; then
- if [ x$ip = xdhcp ]; then
- dhcp
- fi
- tftp $uimage uImage || exit 1
- bootm uImage
-elif [ $kernel = nor ]; then
- bootm /dev/nor0.kernel
-else
- bootm /dev/nand0.kernel.bb
-fi
-
diff --git a/arch/arm/boards/mmccpu/env/bin/init b/arch/arm/boards/mmccpu/env/bin/init
deleted file mode 100644
index ad9b65a765..0000000000
--- a/arch/arm/boards/mmccpu/env/bin/init
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/sh
-
-PATH=/env/bin
-export PATH
-
-. /env/config
-if [ -e /dev/nor0 ]; then
- addpart /dev/nor0 $nor_parts
-fi
-
-if [ -e /dev/nand0 ]; then
- addpart /dev/nand0 $nand_parts
-fi
-
-if [ -z $eth0.ethaddr ]; then
- while [ -z $eth0.ethaddr ]; do
- readline "no MAC address set for eth0. please enter the one found on your board: " eth0.ethaddr
- done
- echo -a /env/config "eth0.ethaddr=$eth0.ethaddr"
-fi
-
-echo
-echo -n "Hit any key to stop autoboot: "
-timeout -a $autoboot_timeout
-if [ $? != 0 ]; then
- echo
- echo "type update_kernel nor [<imagename>] to update kernel into flash"
- echo "type update_root nor [<imagename>] to update rootfs into flash"
- echo
- exit
-fi
-
-boot
diff --git a/arch/arm/boards/mmccpu/env/bin/update_kernel b/arch/arm/boards/mmccpu/env/bin/update_kernel
deleted file mode 100644
index 05c822d860..0000000000
--- a/arch/arm/boards/mmccpu/env/bin/update_kernel
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-. /env/config
-
-image=$uimage
-if [ x$1 = xnand ]; then
- part=/dev/nand0.kernel.bb
-elif [ x$1 = xnor ]; then
- part=/dev/nor0.kernel
-else
- echo "usage: $0 nor|nand [imagename]"
- exit 1
-fi
-
-. /env/bin/_update $2
diff --git a/arch/arm/boards/mmccpu/env/bin/update_root b/arch/arm/boards/mmccpu/env/bin/update_root
deleted file mode 100644
index a75137237b..0000000000
--- a/arch/arm/boards/mmccpu/env/bin/update_root
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-. /env/config
-
-image=$jffs2
-if [ x$1 = xnand ]; then
- part=/dev/nand0.root.bb
-elif [ x$1 = xnor ]; then
- part=/dev/nor0.root
-else
- echo "usage: $0 nor|nand [imagename]"
- exit 1
-fi
-
-. /env/bin/_update $2
-
diff --git a/arch/arm/boards/mmccpu/env/config b/arch/arm/boards/mmccpu/env/config
deleted file mode 100644
index 5367cd9f56..0000000000
--- a/arch/arm/boards/mmccpu/env/config
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-
-# can be either 'net', 'nor' or 'nand''
-kernel=nor
-root=nor
-
-uimage=uImage-mmccpu
-jffs2=root-mmccpu.jffs2
-
-autoboot_timeout=3
-
-nfsroot="/home/kschwinne/src/pengutronix/OSELAS.BSP-Bucyrus-Grabowski-trunk/platform-Bucyrus-mmccpu/root"
-
-bootargs="console=ttyS0,115200 mmccpu=p299"
-
-#nor_parts="256k(barebox)ro,128k(bareboxenv),1536k(kernel),-(root)"
-nor_parts="256k(barebox)ro,128k(bareboxenv),1536k(kernel),10240k(root),10240k(rootbu),-(data)"
-rootpart_nor="/dev/mtdblock3"
-
-#nand_parts="256k(barebox)ro,64k(bareboxenv),1536k(kernel),-(root)"
-#rootpart_nand="/dev/mtdblock7"
-
-# use 'dhcp' to do dhcp in barebox and in kernel
-ip=dhcp
-
-# or set your networking parameters here
-#eth0.ipaddr=a.b.c.d
-#eth0.netmask=a.b.c.d
-#eth0.gateway=a.b.c.d
-#eth0.serverip=a.b.c.d
diff --git a/arch/arm/boards/mmccpu/init.c b/arch/arm/boards/mmccpu/init.c
deleted file mode 100644
index 747c4b2742..0000000000
--- a/arch/arm/boards/mmccpu/init.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (C) 2007 Sascha Hauer, Pengutronix
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- *
- */
-
-#include <common.h>
-#include <net.h>
-#include <init.h>
-#include <environment.h>
-#include <gpio.h>
-#include <asm/armlinux.h>
-#include <generated/mach-types.h>
-#include <partition.h>
-#include <fs.h>
-#include <fcntl.h>
-#include <io.h>
-#include <mach/hardware.h>
-#include <nand.h>
-#include <linux/mtd/nand.h>
-#include <mach/at91_pmc.h>
-#include <mach/board.h>
-#include <mach/iomux.h>
-#include <mach/io.h>
-
-static struct macb_platform_data macb_pdata = {
- .phy_flags = PHYLIB_FORCE_LINK,
- .phy_addr = 4,
-};
-
-static int mmccpu_mem_init(void)
-{
- at91_add_device_sdram(128 * 1024 * 1024);
-
- return 0;
-}
-mem_initcall(mmccpu_mem_init);
-
-static int mmccpu_devices_init(void)
-{
- /*
- * PB27 enables the 50MHz oscillator for Ethernet PHY
- * 1 - enable
- * 0 - disable
- */
- at91_set_gpio_output(AT91_PIN_PB27, 1);
- gpio_set_value(AT91_PIN_PB27, 1); /* 1- enable, 0 - disable */
-
- at91_add_device_eth(0, &macb_pdata);
- add_cfi_flash_device(0, AT91_CHIPSELECT_0, 0, 0);
-
- devfs_add_partition("nor0", 0x00000, 256 * 1024, DEVFS_PARTITION_FIXED, "self0");
- devfs_add_partition("nor0", 0x40000, 128 * 1024, DEVFS_PARTITION_FIXED, "env0");
-
- armlinux_set_architecture(MACH_TYPE_MMCCPU);
-
- return 0;
-}
-
-device_initcall(mmccpu_devices_init);
-
-static int mmccpu_console_init(void)
-{
- barebox_set_model("Bucyrus MMC-CPU");
- barebox_set_hostname("mmccpu");
-
- at91_register_uart(0, 0);
- return 0;
-}
-
-console_initcall(mmccpu_console_init);
-
-static int mmccpu_main_clock(void)
-{
- at91_set_main_clock(18432000);
- return 0;
-}
-pure_initcall(mmccpu_main_clock);
diff --git a/arch/arm/boards/mmccpu/lowlevel_init.c b/arch/arm/boards/mmccpu/lowlevel_init.c
deleted file mode 100644
index c193eae58e..0000000000
--- a/arch/arm/boards/mmccpu/lowlevel_init.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (C) 2009-2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
- *
- * Under GPLv2
- */
-
-#include <common.h>
-#include <init.h>
-#include <mach/hardware.h>
-#include <mach/at91_rstc.h>
-#include <mach/at91_wdt.h>
-#include <mach/at91_pmc.h>
-#include <mach/at91sam9_smc.h>
-#include <mach/at91sam9_sdramc.h>
-#include <mach/at91sam9_matrix.h>
-#include <mach/at91_lowlevel_init.h>
-
-#define MASTER_PLL_MUL 54
-#define MASTER_PLL_DIV 4
-
-void __bare_init at91sam926x_lowlevel_board_config(struct at91sam926x_lowlevel_cfg *cfg)
-{
- /* Disable Watchdog */
- cfg->wdt_mr =
- AT91_WDT_WDIDLEHLT | AT91_WDT_WDDBGHLT |
- AT91_WDT_WDV |
- AT91_WDT_WDDIS |
- AT91_WDT_WDD;
-
- /* define PDC[31:16] as DATA[31:16] */
- cfg->ebi_pio_pdr = 0xFFFF0000;
- /* no pull-up for D[31:16] */
- cfg->ebi_pio_ppudr = 0xFFFF0000;
- /* EBI0_CSA, CS1 SDRAM, CS3 NAND Flash, 3.3V memories */
- cfg->ebi_csa =
- AT91_MATRIX_EBI0_DBPUC | AT91_MATRIX_EBI0_VDDIOMSEL_1_8V |
- AT91_MATRIX_EBI0_CS1A_SDRAMC |
- AT91_MATRIX_EBI0_CS3A_SMC_SMARTMEDIA;
-
- cfg->smc_cs = 0;
-#if 1
- cfg->smc_mode =
- AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
- AT91_SMC_DBW_16 |
- AT91_SMC_TDFMODE |
- AT91_SMC_TDF_(6);
- cfg->smc_cycle =
- AT91_SMC_NWECYCLE_(16) | AT91_SMC_NRDCYCLE_(16);
- cfg->smc_pulse =
- AT91_SMC_NWEPULSE_(5) | AT91_SMC_NCS_WRPULSE_(7) |
- AT91_SMC_NRDPULSE_(5) | AT91_SMC_NCS_RDPULSE_(13);
- cfg->smc_setup =
- AT91_SMC_NWESETUP_(3) | AT91_SMC_NCS_WRSETUP_(2) |
- AT91_SMC_NRDSETUP_(8) | AT91_SMC_NCS_RDSETUP_(0);
-#elif 0 /* slow setup */
- cfg->smc_mode =
- AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
- AT91_SMC_DBW_16 |
- AT91_SMC_TDFMODE |
- AT91_SMC_TDF_(1);
- cfg->smc_cycle =
- AT91_SMC_NWECYCLE_(0xd00) | AT91_SMC_NRDCYCLE_(0xd00);
- cfg->smc_pulse =
- AT91_SMC_NWEPULSE_(5) | AT91_SMC_NCS_WRPULSE_(7) |
- AT91_SMC_NRDPULSE_(5) | AT91_SMC_NCS_RDPULSE_(13);
- cfg->smc_setup =
- AT91_SMC_NWESETUP_(3) | AT91_SMC_NCS_WRSETUP_(2) |
- AT91_SMC_NRDSETUP_(8) | AT91_SMC_NCS_RDSETUP_(0);
-#else /* RONETIX' original values */
- cfg->smc_mode =
- AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
- AT91_SMC_DBW_16 |
- AT91_SMC_TDFMODE |
- AT91_SMC_TDF_(6);
- cfg->smc_cycle =
- AT91_SMC_NWECYCLE_(22) | AT91_SMC_NRDCYCLE_(22);
- cfg->smc_pulse =
- AT91_SMC_NWEPULSE_(11) | AT91_SMC_NCS_WRPULSE_(11) |
- AT91_SMC_NRDPULSE_(11) | AT91_SMC_NCS_RDPULSE_(11);
- cfg->smc_setup =
- AT91_SMC_NWESETUP_(10) | AT91_SMC_NCS_WRSETUP_(10) |
- AT91_SMC_NRDSETUP_(10) | AT91_SMC_NCS_RDSETUP_(10);
-#endif
-
- cfg->pmc_mor =
- AT91_PMC_MOSCEN |
- (255 << 8); /* Main Oscillator Start-up Time */
- cfg->pmc_pllar =
- AT91_PMC_PLLA_WR_ERRATA | /* Bit 29 must be 1 when prog */
- AT91_PMC_OUT |
- AT91_PMC_PLLCOUNT | /* PLL Counter */
- (2 << 28) | /* PLL Clock Frequency Range */
- ((MASTER_PLL_MUL - 1) << 16) | (MASTER_PLL_DIV);
- /* PCK/2 = MCK Master Clock from PLLA */
- cfg->pmc_mckr1 =
- AT91_PMC_CSS_SLOW |
- AT91_PMC_PRES_1 |
- AT91SAM9_PMC_MDIV_2 |
- AT91_PMC_PDIV_1;
- /* PCK/2 = MCK Master Clock from PLLA */
- cfg->pmc_mckr2 =
- AT91_PMC_CSS_PLLA |
- AT91_PMC_PRES_1 |
- AT91SAM9_PMC_MDIV_2 |
- AT91_PMC_PDIV_1;
-
- /* SDRAM */
- /* SDRAMC_TR - Refresh Timer register */
- cfg->sdrc_tr1 = 0x13C;
- /* SDRAMC_CR - Configuration register*/
- cfg->sdrc_cr =
- AT91_SDRAMC_NC_9 |
- AT91_SDRAMC_NR_13 |
- AT91_SDRAMC_NB_4 |
- AT91_SDRAMC_CAS_3 |
- AT91_SDRAMC_DBW_32 |
- (2 << 8) | /* tWR - Write Recovery Delay */
- (8 << 12) | /* tRC - Row Cycle Delay */
- (2 << 16) | /* tRP - Row Precharge Delay */
- (2 << 20) | /* tRCD - Row to Column Delay */
- (5 << 24) | /* tRAS - Active to Precharge Delay */
- (12 << 28); /* tXSR - Exit Self Refresh to Active Delay */
-
- /* Memory Device Register -> SDRAM */
- cfg->sdrc_mdr = AT91_SDRAMC_MD_SDRAM;
- /* SDRAM_TR */
- cfg->sdrc_tr2 = 780;
-
- /* user reset enable */
- cfg->rstc_rmr =
- AT91_RSTC_KEY |
- AT91_RSTC_PROCRST |
- AT91_RSTC_RSTTYP_WAKEUP |
- AT91_RSTC_RSTTYP_WATCHDOG;
-}
diff --git a/arch/arm/boards/phytec-som-am335x/lowlevel.c b/arch/arm/boards/phytec-som-am335x/lowlevel.c
index b1576ee21a..338d13a391 100644
--- a/arch/arm/boards/phytec-som-am335x/lowlevel.c
+++ b/arch/arm/boards/phytec-som-am335x/lowlevel.c
@@ -238,6 +238,7 @@ PHYTEC_ENTRY_MLO(start_am33xx_phytec_phycore_sram_128mb, am335x_phytec_phycore_s
PHYTEC_ENTRY_MLO(start_am33xx_phytec_phycore_sram_256mb, am335x_phytec_phycore_som_mlo, PHYCORE_MT41J128M16125IT_256MB);
PHYTEC_ENTRY_MLO(start_am33xx_phytec_phycore_sram_512mb, am335x_phytec_phycore_som_mlo, PHYCORE_MT41J256M16HA15EIT_512MB);
PHYTEC_ENTRY_MLO(start_am33xx_phytec_phycore_sram_2x512mb, am335x_phytec_phycore_som_mlo, PHYCORE_MT41J512M8125IT_2x512MB);
+PHYTEC_ENTRY_MLO(start_am33xx_phytec_phycore_r2_sram_1024mb, am335x_phytec_phycore_som_mlo, PHYCORE_R2_MT41K512M16HA125IT_1024MB);
PHYTEC_ENTRY_UNIFIED_MLO(start_am33xx_phytec_phycore_r2_sram, am335x_phytec_phycore_som_mlo, PHYCORE_R2);
PHYTEC_ENTRY(start_am33xx_phytec_phycore_nand_sdram, am335x_phytec_phycore_som_nand);
PHYTEC_ENTRY(start_am33xx_phytec_phycore_emmc_sdram, am335x_phytec_phycore_som_emmc);
diff --git a/arch/arm/boards/pm9261/Makefile b/arch/arm/boards/pm9261/Makefile
index bff467b1dc..e9bf1212fe 100644
--- a/arch/arm/boards/pm9261/Makefile
+++ b/arch/arm/boards/pm9261/Makefile
@@ -1,4 +1,4 @@
obj-y += init.o
-lwl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
+lwl-y += lowlevel_init.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-pm9261
diff --git a/arch/arm/boards/pm9261/lowlevel_init.c b/arch/arm/boards/pm9261/lowlevel_init.c
index 91a64b4158..a4cb8af697 100644
--- a/arch/arm/boards/pm9261/lowlevel_init.c
+++ b/arch/arm/boards/pm9261/lowlevel_init.c
@@ -4,22 +4,16 @@
* Under GPLv2
*/
-#include <common.h>
-#include <init.h>
-#include <mach/hardware.h>
-#include <mach/at91_rstc.h>
-#include <mach/at91_wdt.h>
-#include <mach/at91_pmc.h>
-#include <mach/at91sam9_smc.h>
-#include <mach/at91sam9_sdramc.h>
+#include <asm/barebox-arm.h>
+
+#include <mach/at91sam926x_board_init.h>
#include <mach/at91sam9_matrix.h>
-#include <mach/at91_lowlevel_init.h>
#define MASTER_PLL_DIV 15
#define MASTER_PLL_MUL 162
#define MAIN_PLL_DIV 2
-void __bare_init at91sam926x_lowlevel_board_config(struct at91sam926x_lowlevel_cfg *cfg)
+static void __bare_init pm9261_board_config(struct at91sam926x_board_cfg *cfg)
{
/* Disable Watchdog */
cfg->wdt_mr =
@@ -100,3 +94,28 @@ void __bare_init at91sam926x_lowlevel_board_config(struct at91sam926x_lowlevel_c
AT91_RSTC_RSTTYP_WAKEUP |
AT91_RSTC_RSTTYP_WATCHDOG;
}
+
+static void __bare_init pm9261_init(void)
+{
+ struct at91sam926x_board_cfg cfg;
+
+ cfg.pio = IOMEM(AT91SAM9261_BASE_PIOC);
+ cfg.sdramc = IOMEM(AT91SAM9261_BASE_SDRAMC);
+ cfg.ebi_pio_is_peripha = false;
+ cfg.matrix_csa = AT91_MATRIX_EBICSA;
+
+ pm9261_board_config(&cfg);
+ at91sam926x_board_init(&cfg);
+
+ barebox_arm_entry(AT91_CHIPSELECT_1, at91_get_sdram_size(cfg.sdramc),
+ NULL);
+}
+
+void __naked __bare_init barebox_arm_reset_vector(void)
+{
+ arm_cpu_lowlevel_init();
+
+ arm_setup_stack(AT91SAM9261_SRAM_BASE + AT91SAM9261_SRAM_SIZE - 16);
+
+ pm9261_init();
+}
diff --git a/arch/arm/boards/pm9263/Makefile b/arch/arm/boards/pm9263/Makefile
index 1398c26a0f..68bfbfa926 100644
--- a/arch/arm/boards/pm9263/Makefile
+++ b/arch/arm/boards/pm9263/Makefile
@@ -1,3 +1,3 @@
obj-y += init.o
-lwl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
+lwl-y += lowlevel_init.o
diff --git a/arch/arm/boards/pm9263/lowlevel_init.c b/arch/arm/boards/pm9263/lowlevel_init.c
index 6336d51063..6849f0a5bf 100644
--- a/arch/arm/boards/pm9263/lowlevel_init.c
+++ b/arch/arm/boards/pm9263/lowlevel_init.c
@@ -4,22 +4,18 @@
* Under GPLv2
*/
-#include <common.h>
-#include <init.h>
-#include <mach/hardware.h>
-#include <mach/at91_rstc.h>
-#include <mach/at91_wdt.h>
-#include <mach/at91_pmc.h>
-#include <mach/at91sam9_smc.h>
-#include <mach/at91sam9_sdramc.h>
-#include <mach/at91sam9_matrix.h>
-#include <mach/at91_lowlevel_init.h>
+#include <linux/sizes.h>
+
+#include <asm/barebox-arm.h>
+
+#include <mach/at91sam926x_board_init.h>
+#include <mach/at91sam9263_matrix.h>
#define MASTER_PLL_DIV 6
#define MASTER_PLL_MUL 65
#define MAIN_PLL_DIV 2 /* 2 or 4 */
-void __bare_init at91sam926x_lowlevel_board_config(struct at91sam926x_lowlevel_cfg *cfg)
+static void __bare_init pm9263_board_config(struct at91sam926x_board_cfg *cfg)
{
/* Disable Watchdog */
cfg->wdt_mr =
@@ -119,3 +115,28 @@ void __bare_init at91sam926x_lowlevel_board_config(struct at91sam926x_lowlevel_c
AT91_RSTC_RSTTYP_WAKEUP |
AT91_RSTC_RSTTYP_WATCHDOG;
}
+
+static void __bare_init pm9263_board_init(void)
+{
+ struct at91sam926x_board_cfg cfg;
+
+ cfg.pio = IOMEM(AT91SAM9263_BASE_PIOD);
+ cfg.sdramc = IOMEM(AT91SAM9263_BASE_SDRAMC0);
+ cfg.ebi_pio_is_peripha = true;
+ cfg.matrix_csa = AT91_MATRIX_EBI0CSA;
+
+ pm9263_board_config(&cfg);
+ at91sam926x_board_init(&cfg);
+
+ barebox_arm_entry(AT91_CHIPSELECT_1, at91_get_sdram_size(cfg.sdramc),
+ NULL);
+}
+
+void __naked __bare_init barebox_arm_reset_vector(void)
+{
+ arm_cpu_lowlevel_init();
+
+ arm_setup_stack(AT91SAM9263_SRAM0_BASE + AT91SAM9263_SRAM0_SIZE - 16);
+
+ pm9263_board_init();
+}
diff --git a/arch/arm/boards/pm9g45/Makefile b/arch/arm/boards/pm9g45/Makefile
index d81b1881b3..abf50243e5 100644
--- a/arch/arm/boards/pm9g45/Makefile
+++ b/arch/arm/boards/pm9g45/Makefile
@@ -1,2 +1,5 @@
obj-y += init.o
+
+lwl-y += lowlevel.o
+
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-pm9g45
diff --git a/arch/arm/boards/pm9g45/lowlevel.c b/arch/arm/boards/pm9g45/lowlevel.c
new file mode 100644
index 0000000000..67454bde26
--- /dev/null
+++ b/arch/arm/boards/pm9g45/lowlevel.c
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+ *
+ * Under GPLv2
+ */
+
+#include <common.h>
+#include <init.h>
+
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+#include <mach/at91sam9_ddrsdr.h>
+#include <mach/hardware.h>
+
+void __naked __bare_init barebox_arm_reset_vector(void)
+{
+ arm_cpu_lowlevel_init();
+
+ arm_setup_stack(AT91SAM9G45_SRAM_BASE + AT91SAM9G45_SRAM_SIZE - 16);
+
+ barebox_arm_entry(AT91_CHIPSELECT_6, at91sam9g45_get_ddram_size(1),
+ NULL);
+}
diff --git a/arch/arm/boards/qil-a926x/Makefile b/arch/arm/boards/qil-a926x/Makefile
index 0c7bc3f043..82e46b369f 100644
--- a/arch/arm/boards/qil-a926x/Makefile
+++ b/arch/arm/boards/qil-a926x/Makefile
@@ -1,2 +1,5 @@
obj-y += init.o
+
+lwl-y += lowlevel.o
+
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-qil-a926x
diff --git a/arch/arm/boards/qil-a926x/lowlevel.c b/arch/arm/boards/qil-a926x/lowlevel.c
new file mode 100644
index 0000000000..b16ef31bf0
--- /dev/null
+++ b/arch/arm/boards/qil-a926x/lowlevel.c
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+ *
+ * Under GPLv2
+ */
+
+#include <common.h>
+#include <init.h>
+
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+#include <mach/at91sam9_sdramc.h>
+#include <mach/at91sam9260.h>
+#include <mach/hardware.h>
+
+void __naked __bare_init barebox_arm_reset_vector(void)
+{
+ arm_cpu_lowlevel_init();
+
+ arm_setup_stack(AT91SAM9260_SRAM_BASE + AT91SAM9260_SRAM_SIZE - 16);
+
+ barebox_arm_entry(AT91_CHIPSELECT_1,
+ at91_get_sdram_size(IOMEM(AT91SAM9260_BASE_SDRAMC)),
+ NULL);
+}
diff --git a/arch/arm/boards/sama5d3_xplained/Makefile b/arch/arm/boards/sama5d3_xplained/Makefile
index 3c301cb0cd..fc6d83be8c 100644
--- a/arch/arm/boards/sama5d3_xplained/Makefile
+++ b/arch/arm/boards/sama5d3_xplained/Makefile
@@ -1,2 +1,3 @@
obj-y += init.o
+lwl-y += lowlevel.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-sama5d3_xplained
diff --git a/arch/arm/mach-at91/sama5d3_lowlevel_init.c b/arch/arm/boards/sama5d3_xplained/lowlevel.c
index 01d28514d1..b791f2a03c 100644
--- a/arch/arm/mach-at91/sama5d3_lowlevel_init.c
+++ b/arch/arm/boards/sama5d3_xplained/lowlevel.c
@@ -2,18 +2,16 @@
* Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
*
* Under GPLv2
- */
-
-#define __LOWLEVEL_INIT__
+ */
#include <common.h>
-#include <linux/sizes.h>
#include <init.h>
-#include <asm/system.h>
-#include <asm/barebox-arm.h>
+
#include <asm/barebox-arm-head.h>
-#include <mach/hardware.h>
+#include <asm/barebox-arm.h>
+
#include <mach/at91sam9_ddrsdr.h>
+#include <mach/hardware.h>
void __naked __bare_init barebox_arm_reset_vector(void)
{
diff --git a/arch/arm/boards/sama5d3xek/Makefile b/arch/arm/boards/sama5d3xek/Makefile
index 32dcb4283c..6ed914fc0a 100644
--- a/arch/arm/boards/sama5d3xek/Makefile
+++ b/arch/arm/boards/sama5d3xek/Makefile
@@ -1,3 +1,4 @@
obj-y += init.o
obj-$(CONFIG_W1) += hw_version.o
+lwl-y += lowlevel.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-sama5d3xek
diff --git a/arch/arm/boards/sama5d3xek/lowlevel.c b/arch/arm/boards/sama5d3xek/lowlevel.c
new file mode 100644
index 0000000000..b791f2a03c
--- /dev/null
+++ b/arch/arm/boards/sama5d3xek/lowlevel.c
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+ *
+ * Under GPLv2
+ */
+
+#include <common.h>
+#include <init.h>
+
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+#include <mach/at91sam9_ddrsdr.h>
+#include <mach/hardware.h>
+
+void __naked __bare_init barebox_arm_reset_vector(void)
+{
+ arm_cpu_lowlevel_init();
+
+ arm_setup_stack(SAMA5D3_SRAM_BASE + SAMA5D3_SRAM_SIZE - 16);
+
+ barebox_arm_entry(SAMA5_DDRCS, at91sama5_get_ddram_size(), NULL);
+}
diff --git a/arch/arm/boards/sama5d4_xplained/Makefile b/arch/arm/boards/sama5d4_xplained/Makefile
index 44550f5288..8873dfc22c 100644
--- a/arch/arm/boards/sama5d4_xplained/Makefile
+++ b/arch/arm/boards/sama5d4_xplained/Makefile
@@ -1 +1,2 @@
obj-y += sama5d4_xplained.o
+lwl-y += lowlevel.o
diff --git a/arch/arm/boards/sama5d4_xplained/lowlevel.c b/arch/arm/boards/sama5d4_xplained/lowlevel.c
new file mode 100644
index 0000000000..b791f2a03c
--- /dev/null
+++ b/arch/arm/boards/sama5d4_xplained/lowlevel.c
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+ *
+ * Under GPLv2
+ */
+
+#include <common.h>
+#include <init.h>
+
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+#include <mach/at91sam9_ddrsdr.h>
+#include <mach/hardware.h>
+
+void __naked __bare_init barebox_arm_reset_vector(void)
+{
+ arm_cpu_lowlevel_init();
+
+ arm_setup_stack(SAMA5D3_SRAM_BASE + SAMA5D3_SRAM_SIZE - 16);
+
+ barebox_arm_entry(SAMA5_DDRCS, at91sama5_get_ddram_size(), NULL);
+}
diff --git a/arch/arm/boards/sama5d4ek/Makefile b/arch/arm/boards/sama5d4ek/Makefile
index 4363b39243..152750bbe0 100644
--- a/arch/arm/boards/sama5d4ek/Makefile
+++ b/arch/arm/boards/sama5d4ek/Makefile
@@ -1 +1,2 @@
obj-y += sama5d4ek.o
+lwl-y += lowlevel.o
diff --git a/arch/arm/boards/sama5d4ek/lowlevel.c b/arch/arm/boards/sama5d4ek/lowlevel.c
new file mode 100644
index 0000000000..b791f2a03c
--- /dev/null
+++ b/arch/arm/boards/sama5d4ek/lowlevel.c
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+ *
+ * Under GPLv2
+ */
+
+#include <common.h>
+#include <init.h>
+
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+#include <mach/at91sam9_ddrsdr.h>
+#include <mach/hardware.h>
+
+void __naked __bare_init barebox_arm_reset_vector(void)
+{
+ arm_cpu_lowlevel_init();
+
+ arm_setup_stack(SAMA5D3_SRAM_BASE + SAMA5D3_SRAM_SIZE - 16);
+
+ barebox_arm_entry(SAMA5_DDRCS, at91sama5_get_ddram_size(), NULL);
+}
diff --git a/arch/arm/boards/telit-evk-pro3/Makefile b/arch/arm/boards/telit-evk-pro3/Makefile
index eb072c0161..e11fd5b692 100644
--- a/arch/arm/boards/telit-evk-pro3/Makefile
+++ b/arch/arm/boards/telit-evk-pro3/Makefile
@@ -1 +1,3 @@
obj-y += init.o
+
+lwl-y += lowlevel.o
diff --git a/arch/arm/boards/telit-evk-pro3/lowlevel.c b/arch/arm/boards/telit-evk-pro3/lowlevel.c
new file mode 100644
index 0000000000..b16ef31bf0
--- /dev/null
+++ b/arch/arm/boards/telit-evk-pro3/lowlevel.c
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+ *
+ * Under GPLv2
+ */
+
+#include <common.h>
+#include <init.h>
+
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+#include <mach/at91sam9_sdramc.h>
+#include <mach/at91sam9260.h>
+#include <mach/hardware.h>
+
+void __naked __bare_init barebox_arm_reset_vector(void)
+{
+ arm_cpu_lowlevel_init();
+
+ arm_setup_stack(AT91SAM9260_SRAM_BASE + AT91SAM9260_SRAM_SIZE - 16);
+
+ barebox_arm_entry(AT91_CHIPSELECT_1,
+ at91_get_sdram_size(IOMEM(AT91SAM9260_BASE_SDRAMC)),
+ NULL);
+}
diff --git a/arch/arm/boards/tny-a926x/Makefile b/arch/arm/boards/tny-a926x/Makefile
index dba2f8cfcf..d400788757 100644
--- a/arch/arm/boards/tny-a926x/Makefile
+++ b/arch/arm/boards/tny-a926x/Makefile
@@ -1,9 +1,10 @@
obj-y += init.o
-bootstrap-$(CONFIG_MACH_TNY_A9263) = tny_a9263_bootstrap.o
-obj-$(CONFIG_AT91_BOOTSTRAP) += $(bootstrap-y)
+obj-$(CONFIG_AT91_BOOTSTRAP) += tny_a9263_bootstrap.o
-lowlevel_init-$(CONFIG_MACH_TNY_A9263) = tny_a9263_lowlevel_init.o
-lwl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += $(lowlevel_init-y)
+lwl-$(CONFIG_MACH_TNY_A9260) += tny_a9260_lowlevel.o
+lwl-$(CONFIG_MACH_TNY_A9G20) += tny_a9260_lowlevel.o
+lwl-$(CONFIG_MACH_TNY_A9263) += tny_a9263_lowlevel.o
+
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-tny-a926x
diff --git a/arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c b/arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c
new file mode 100644
index 0000000000..b16ef31bf0
--- /dev/null
+++ b/arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+ *
+ * Under GPLv2
+ */
+
+#include <common.h>
+#include <init.h>
+
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+#include <mach/at91sam9_sdramc.h>
+#include <mach/at91sam9260.h>
+#include <mach/hardware.h>
+
+void __naked __bare_init barebox_arm_reset_vector(void)
+{
+ arm_cpu_lowlevel_init();
+
+ arm_setup_stack(AT91SAM9260_SRAM_BASE + AT91SAM9260_SRAM_SIZE - 16);
+
+ barebox_arm_entry(AT91_CHIPSELECT_1,
+ at91_get_sdram_size(IOMEM(AT91SAM9260_BASE_SDRAMC)),
+ NULL);
+}
diff --git a/arch/arm/boards/tny-a926x/tny_a9263_lowlevel_init.c b/arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c
index 1b146da625..4b57b74e13 100644
--- a/arch/arm/boards/tny-a926x/tny_a9263_lowlevel_init.c
+++ b/arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c
@@ -1,30 +1,24 @@
/*
- * Copyright (C) 2009-2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
*
* Under GPLv2
*/
#include <common.h>
#include <init.h>
-#include <mach/hardware.h>
-#include <mach/at91_rstc.h>
-#include <mach/at91_wdt.h>
-#include <mach/at91_pmc.h>
-#include <mach/at91sam9_smc.h>
-#include <mach/at91sam9_sdramc.h>
-#include <mach/at91sam9_matrix.h>
-#include <mach/at91_lowlevel_init.h>
+
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+#include <mach/at91sam926x_board_init.h>
+#include <mach/at91sam9263_matrix.h>
#define MASTER_CLOCK 180
-#if MASTER_CLOCK == 200
-#define MASTER_PLL_MUL 100
-#else
#define MASTER_PLL_MUL 90
-#endif
#define MASTER_PLL_DIV 6
-void __bare_init at91sam926x_lowlevel_board_config(struct at91sam926x_lowlevel_cfg *cfg)
+static void __bare_init tny_a9263_board_config(struct at91sam926x_board_cfg *cfg)
{
/* Disable Watchdog */
cfg->wdt_mr =
@@ -105,3 +99,30 @@ void __bare_init at91sam926x_lowlevel_board_config(struct at91sam926x_lowlevel_c
AT91_RSTC_RSTTYP_WAKEUP |
AT91_RSTC_RSTTYP_WATCHDOG;
}
+
+static void __bare_init tny_a9263_init(void)
+{
+ struct at91sam926x_board_cfg cfg;
+
+ cfg.pio = IOMEM(AT91SAM9263_BASE_PIOD);
+ cfg.sdramc = IOMEM(AT91SAM9263_BASE_SDRAMC0);
+ cfg.ebi_pio_is_peripha = true;
+ cfg.matrix_csa = AT91_MATRIX_EBI0CSA;
+
+ tny_a9263_board_config(&cfg);
+
+ at91sam926x_board_init(&cfg);
+
+ barebox_arm_entry(AT91_CHIPSELECT_1,
+ at91_get_sdram_size(IOMEM(AT91SAM9263_BASE_SDRAMC0)),
+ NULL);
+}
+
+void __naked __bare_init barebox_arm_reset_vector(void)
+{
+ arm_cpu_lowlevel_init();
+
+ arm_setup_stack(AT91SAM9263_SRAM0_BASE + AT91SAM9263_SRAM0_SIZE - 16);
+
+ tny_a9263_init();
+}
diff --git a/arch/arm/boards/usb-a926x/Makefile b/arch/arm/boards/usb-a926x/Makefile
index 4f09581e33..65cc4082fc 100644
--- a/arch/arm/boards/usb-a926x/Makefile
+++ b/arch/arm/boards/usb-a926x/Makefile
@@ -1,9 +1,9 @@
obj-y += init.o
-bootstrap-$(CONFIG_MACH_USB_A9263) = usb_a9263_bootstrap.o
-obj-$(CONFIG_AT91_BOOTSTRAP) += $(bootstrap-y)
+obj-$(CONFIG_AT91_BOOTSTRAP) += usb_a9263_bootstrap.o
-lowlevel_init-$(CONFIG_MACH_USB_A9263) = usb_a9263_lowlevel_init.o
+lwl-$(CONFIG_MACH_USB_A9260) += usb_a9260_lowlevel.o
+lwl-$(CONFIG_MACH_USB_A9G20) += usb_a9260_lowlevel.o
+lwl-$(CONFIG_MACH_USB_A9263) += usb_a9263_lowlevel.o
-lwl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += $(lowlevel_init-y)
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-usb-a926x
diff --git a/arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c b/arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c
new file mode 100644
index 0000000000..b16ef31bf0
--- /dev/null
+++ b/arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+ *
+ * Under GPLv2
+ */
+
+#include <common.h>
+#include <init.h>
+
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+#include <mach/at91sam9_sdramc.h>
+#include <mach/at91sam9260.h>
+#include <mach/hardware.h>
+
+void __naked __bare_init barebox_arm_reset_vector(void)
+{
+ arm_cpu_lowlevel_init();
+
+ arm_setup_stack(AT91SAM9260_SRAM_BASE + AT91SAM9260_SRAM_SIZE - 16);
+
+ barebox_arm_entry(AT91_CHIPSELECT_1,
+ at91_get_sdram_size(IOMEM(AT91SAM9260_BASE_SDRAMC)),
+ NULL);
+}
diff --git a/arch/arm/boards/usb-a926x/usb_a9263_lowlevel_init.c b/arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c
index f6dc58e3f6..066452b956 100644
--- a/arch/arm/boards/usb-a926x/usb_a9263_lowlevel_init.c
+++ b/arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c
@@ -4,16 +4,12 @@
* Under GPLv2
*/
-#include <common.h>
-#include <init.h>
-#include <mach/hardware.h>
-#include <mach/at91_rstc.h>
-#include <mach/at91_wdt.h>
-#include <mach/at91_pmc.h>
-#include <mach/at91sam9_smc.h>
-#include <mach/at91sam9_sdramc.h>
-#include <mach/at91sam9_matrix.h>
-#include <mach/at91_lowlevel_init.h>
+#include <linux/sizes.h>
+
+#include <asm/barebox-arm.h>
+
+#include <mach/at91sam926x_board_init.h>
+#include <mach/at91sam9263_matrix.h>
#define MASTER_CLOCK 180
@@ -24,7 +20,7 @@
#endif
#define MASTER_PLL_DIV 6
-void __bare_init at91sam926x_lowlevel_board_config(struct at91sam926x_lowlevel_cfg *cfg)
+static void __bare_init usb_a9263_board_config(struct at91sam926x_board_cfg *cfg)
{
/* Disable Watchdog */
cfg->wdt_mr =
@@ -109,3 +105,28 @@ void __bare_init at91sam926x_lowlevel_board_config(struct at91sam926x_lowlevel_c
AT91_RSTC_RSTTYP_WAKEUP |
AT91_RSTC_RSTTYP_WATCHDOG;
}
+
+static void __bare_init usb_a9263_init(void)
+{
+ struct at91sam926x_board_cfg cfg;
+
+ cfg.pio = IOMEM(AT91SAM9263_BASE_PIOD);
+ cfg.sdramc = IOMEM(AT91SAM9263_BASE_SDRAMC0);
+ cfg.ebi_pio_is_peripha = true;
+ cfg.matrix_csa = AT91_MATRIX_EBI0CSA;
+
+ usb_a9263_board_config(&cfg);
+ at91sam926x_board_init(&cfg);
+
+ barebox_arm_entry(AT91_CHIPSELECT_1, at91_get_sdram_size(cfg.sdramc),
+ NULL);
+}
+
+void __naked __bare_init barebox_arm_reset_vector(void)
+{
+ arm_cpu_lowlevel_init();
+
+ arm_setup_stack(AT91SAM9263_SRAM0_BASE + AT91SAM9263_SRAM0_SIZE - 16);
+
+ usb_a9263_init();
+}
diff --git a/arch/arm/configs/at91sam9263ek_defconfig b/arch/arm/configs/at91sam9263ek_defconfig
index b28614d43e..e8ad841fa1 100644
--- a/arch/arm/configs/at91sam9263ek_defconfig
+++ b/arch/arm/configs/at91sam9263ek_defconfig
@@ -1,10 +1,12 @@
CONFIG_ARCH_AT91SAM9263=y
+CONFIG_AT91_MULTI_BOARDS=y
+CONFIG_MACH_AT91SAM9263EK=y
CONFIG_BAREBOX_MAX_IMAGE_SIZE=0x40000
CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
-CONFIG_PBL_IMAGE=y
CONFIG_MMU=y
CONFIG_EXPERIMENTAL=y
CONFIG_MALLOC_TLSF=y
+CONFIG_RELOCATABLE=y
CONFIG_PROMPT="9263-EK:"
CONFIG_GLOB=y
CONFIG_HUSH_FANCY_PROMPT=y
@@ -18,6 +20,7 @@ CONFIG_CONSOLE_ACTIVATE_ALL=y
CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
# CONFIG_CMD_ARM_CPUINFO is not set
CONFIG_LONGHELP=y
+CONFIG_CMD_IOMEM=y
CONFIG_CMD_MEMINFO=y
# CONFIG_CMD_BOOTU is not set
CONFIG_CMD_GO=y
@@ -36,6 +39,7 @@ CONFIG_CMD_EDIT=y
CONFIG_CMD_SPLASH=y
CONFIG_CMD_READLINE=y
CONFIG_CMD_TIMEOUT=y
+CONFIG_CMD_CLK=y
CONFIG_CMD_FLASH=y
CONFIG_CMD_GPIO=y
CONFIG_CMD_LED=y
@@ -43,6 +47,7 @@ CONFIG_CMD_LED_TRIGGER=y
CONFIG_CMD_OFTREE=y
CONFIG_NET=y
CONFIG_NET_NFS=y
+CONFIG_OF_BAREBOX_DRIVERS=y
CONFIG_DRIVER_NET_MACB=y
# CONFIG_SPI is not set
CONFIG_MTD=y
@@ -62,9 +67,12 @@ CONFIG_VIDEO=y
CONFIG_DRIVER_VIDEO_ATMEL=y
CONFIG_MCI=y
CONFIG_MCI_ATMEL=y
+CONFIG_SRAM=y
CONFIG_LED=y
CONFIG_LED_GPIO=y
+CONFIG_LED_GPIO_OF=y
CONFIG_LED_TRIGGERS=y
+CONFIG_KEYBOARD_GPIO=y
CONFIG_FS_TFTP=y
CONFIG_FS_FAT=y
CONFIG_FS_FAT_LFN=y
diff --git a/arch/arm/configs/mmccpu_defconfig b/arch/arm/configs/mmccpu_defconfig
deleted file mode 100644
index 8143b9862d..0000000000
--- a/arch/arm/configs/mmccpu_defconfig
+++ /dev/null
@@ -1,37 +0,0 @@
-CONFIG_ARCH_AT91SAM9263=y
-CONFIG_MACH_MMCCPU=y
-CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
-CONFIG_GLOB=y
-CONFIG_PROMPT_HUSH_PS2="y"
-CONFIG_CMDLINE_EDITING=y
-CONFIG_AUTO_COMPLETE=y
-CONFIG_BOOTM_SHOW_TYPE=y
-CONFIG_PARTITION=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/mmccpu/env"
-CONFIG_LONGHELP=y
-CONFIG_CMD_MEMINFO=y
-CONFIG_CMD_GO=y
-CONFIG_CMD_RESET=y
-CONFIG_CMD_PARTITION=y
-CONFIG_CMD_EXPORT=y
-CONFIG_CMD_LOADENV=y
-CONFIG_CMD_PRINTENV=y
-CONFIG_CMD_SAVEENV=y
-CONFIG_CMD_SLEEP=y
-CONFIG_CMD_DHCP=y
-CONFIG_CMD_PING=y
-CONFIG_CMD_TFTP=y
-CONFIG_CMD_EDIT=y
-CONFIG_CMD_READLINE=y
-CONFIG_CMD_TIMEOUT=y
-CONFIG_CMD_CRC=y
-CONFIG_CMD_FLASH=y
-CONFIG_CMD_GPIO=y
-CONFIG_NET=y
-CONFIG_DRIVER_NET_MACB=y
-# CONFIG_SPI is not set
-CONFIG_I2C=y
-CONFIG_MTD=y
-CONFIG_DRIVER_CFI=y
-CONFIG_CFI_BUFFER_WRITE=y
-CONFIG_FS_TFTP=y
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 4f13d4e372..0526a6f407 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -104,7 +104,7 @@ pbl-dtb-$(CONFIG_MACH_ZII_VF610_DEV) += \
vf610-zii-cfu1-rev-a.dtb.o \
vf610-zii-spu3-rev-a.dtb.o \
vf610-zii-scu4-aib-rev-c.dtb.o
-
+pbl-dtb-$(CONFIG_MACH_AT91SAM9263EK_DT) += at91sam9263ek.dtb.o
pbl-dtb-$(CONFIG_MACH_AT91SAM9X5EK) += at91sam9x5ek.dtb.o
clean-files := *.dtb *.dtb.S .*.dtc .*.pre .*.dts *.dtb.lzo
diff --git a/arch/arm/dts/at91sam9263ek.dts b/arch/arm/dts/at91sam9263ek.dts
new file mode 100644
index 0000000000..3681b845d9
--- /dev/null
+++ b/arch/arm/dts/at91sam9263ek.dts
@@ -0,0 +1,48 @@
+#include <arm/at91sam9263ek.dts>
+/ {
+ chosen {
+ environment@0 {
+ compatible = "barebox,environment";
+ device-path = &nand_controller, "partname:bareboxenv";
+ };
+ };
+
+ ahb {
+ apb {
+ mmc1: mmc@fff84000 {
+ pinctrl-0 = <
+ &pinctrl_board_mmc1
+ &pinctrl_mmc1_clk
+ &pinctrl_mmc1_slot0_cmd_dat0
+ &pinctrl_mmc1_slot0_dat1_3>;
+ cd-gpios = <&pioE 18 GPIO_ACTIVE_HIGH>;
+ status = "okay";
+ slot@0 {
+ reg = <0>;
+ bus-width = <4>;
+ cd-gpios = <&pioE 18 GPIO_ACTIVE_HIGH>;
+ wp-gpios = <&pioE 19 GPIO_ACTIVE_HIGH>;
+ };
+ };
+ };
+ };
+
+
+ pinctrl@fffff200 {
+ pinctrl_board_mmc1: mmc1-board {
+ atmel,pins =
+ <AT91_PIOE 18 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH /* PE18 gpio CD pin pull up and deglitch */
+ AT91_PIOE 19 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP>; /* PE19 gpio WP pin pull up */
+ };
+ };
+};
+
+&pioB {
+ /* Enable the 50MHz oscillator for Ethernet PHY */
+ phy_50mhz {
+ gpio-hog;
+ gpios = <27 GPIO_ACTIVE_LOW>;
+ output-high;
+ line-name = "PHY 50 MHz oscillator";
+ };
+};
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 3b572ebdfe..0a9cf3ad13 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -20,6 +20,13 @@ config COMMON_CLK_AT91
select COMMON_CLK
select MFD_SYSCON
+config MACH_AT91SAM9263EK_DT
+ def_bool y
+ depends on MACH_AT91SAM9263EK && OFDEVICE
+ help
+ Enabled for at91sam9263ek - evaluation kit.
+ But only if we need the device tree (bootstrap do not use DT)
+
config HAVE_AT91_SMD
bool
@@ -29,7 +36,12 @@ config HAVE_AT91_H32MX
config HAVE_AT91_GENERATED_CLK
bool
-config HAVE_AT91_LOWLEVEL_INIT
+# Select if board support bootstrap
+config HAVE_AT91_BOOTSTRAP
+ bool
+
+# Select if board uses the common at91sam926x_board_init
+config AT91SAM926X_BOARD_INIT
bool
config AT91SAM9_SMC
@@ -71,9 +83,6 @@ config AT91SAM9G45_RESET
config HAVE_AT91_LOAD_BAREBOX_SRAM
bool
-config AT91SAM9_LOWLEVEL_INIT
- bool
-
comment "Atmel AT91 System-on-Chip"
config SOC_AT91RM9200
@@ -88,7 +97,6 @@ config SOC_AT91SAM9260
select HAVE_AT91_DBGU0
select HAS_MACB
select AT91SAM9_RESET
- select AT91SAM9_LOWLEVEL_INIT
help
Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE
or AT91SAM9G20 SoC.
@@ -98,7 +106,6 @@ config SOC_AT91SAM9261
select SOC_AT91SAM9
select HAVE_AT91_DBGU0
select AT91SAM9_RESET
- select AT91SAM9_LOWLEVEL_INIT
help
Select this if you are using one of Atmel's AT91SAM9261 or AT91SAM9G10 SoC.
@@ -108,7 +115,6 @@ config SOC_AT91SAM9263
select HAVE_AT91_DBGU1
select HAS_MACB
select AT91SAM9_RESET
- select AT91SAM9_LOWLEVEL_INIT
select HAVE_AT91_LOAD_BAREBOX_SRAM
config SOC_AT91SAM9G45
@@ -229,6 +235,8 @@ config SUPPORT_CALAO_DAB_MMX
config SUPPORT_CALAO_MOB_TNY_MD2
bool
+if !AT91_MULTI_BOARDS
+
# ----------------------------------------------------------
if ARCH_AT91RM9200
@@ -306,7 +314,8 @@ config MACH_AT91SAM9261EK
select HAS_DM9000
select HAVE_AT91_DATAFLASH_CARD
select HAVE_NAND_ATMEL_BUSWIDTH_16
- select HAVE_AT91_LOWLEVEL_INIT
+ select HAVE_AT91_BOOTSTRAP
+ select AT91SAM926X_BOARD_INIT
help
Select this if you are using Atmel's AT91SAM9261-EK Evaluation Kit.
<http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3820>
@@ -314,7 +323,8 @@ config MACH_AT91SAM9261EK
config MACH_PM9261
bool "Ronetix PM9261"
select HAS_DM9000
- select HAVE_AT91_LOWLEVEL_INIT
+ select HAVE_AT91_BOOTSTRAP
+ select AT91SAM926X_BOARD_INIT
help
Say y here if you are using the Ronetix PM9261 Board
@@ -398,34 +408,26 @@ if ARCH_AT91SAM9263
choice
prompt "AT91SAM9263 Board Type"
-config MACH_AT91SAM9263EK
- bool "Atmel AT91SAM9263-EK"
- select HAVE_AT91_LOWLEVEL_INIT
- select HAVE_NAND_ATMEL_BUSWIDTH_16
- help
- Say y here if you are using Atmel's AT91SAM9263-EK Evaluation board
-
-config MACH_MMCCPU
- bool "Bucyrus MMC-CPU"
- help
- Say y here if you are using the Bucyrus MMC-CPU
-
config MACH_PM9263
bool "Ronetix PM9263"
- select HAVE_AT91_LOWLEVEL_INIT
+ select HAVE_AT91_BOOTSTRAP
+ select AT91SAM926X_BOARD_INIT
help
Say y here if you are using the Ronetix PM9263 Board
config MACH_TNY_A9263
bool "CALAO TNY-A9263"
select SUPPORT_CALAO_MOB_TNY_MD2
+ select HAVE_AT91_BOOTSTRAP
+ select AT91SAM926X_BOARD_INIT
help
Select this if you are using a Calao Systems TNY-A9263.
<http://www.calao-systems.com>
config MACH_USB_A9263
bool "CALAO USB-A9263"
- select HAVE_AT91_LOWLEVEL_INIT
+ select HAVE_AT91_BOOTSTRAP
+ select AT91SAM926X_BOARD_INIT
help
Select this if you are using a Calao Systems USB-A9263.
<http://www.calao-systems.com>
@@ -518,6 +520,7 @@ config MACH_SAMA5D4_XPLAINED
endchoice
endif
+endif
# ----------------------------------------------------------
@@ -528,6 +531,18 @@ config AT91_MULTI_BOARDS
if AT91_MULTI_BOARDS
+config MACH_AT91SAM9263EK
+ bool "Atmel AT91SAM9263-EK"
+ depends on ARCH_AT91SAM9263
+ select OFDEVICE
+ select COMMON_CLK_OF_PROVIDER
+ select HAVE_AT91_USB_CLK
+ select HAVE_NAND_ATMEL_BUSWIDTH_16
+ select HAVE_AT91_BOOTSTRAP
+ select AT91SAM926X_BOARD_INIT
+ help
+ Say y here if you are using Atmel's AT91SAM9263-EK Evaluation board
+
config MACH_AT91SAM9X5EK
bool "Atmel AT91SAM9x5 Series Evaluation Kit"
depends on ARCH_AT91SAM9X5
@@ -596,7 +611,7 @@ config CALAO_MB_QIL_A9260
config AT91_BOOTSTRAP
bool "at91 bootstrap"
- depends on HAVE_AT91_LOWLEVEL_INIT
+ depends on HAVE_AT91_BOOTSTRAP
select BOOTSTRAP
config AT91_LOAD_BAREBOX_SRAM
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 0892fb4b57..664201ceb6 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -1,4 +1,4 @@
-obj-y += setup.o irq_fixup.o
+obj-y += setup.o
ifeq ($(CONFIG_COMMON_CLK_OF_PROVIDER),)
obj-y += clock.o
@@ -6,19 +6,7 @@ endif
obj-$(CONFIG_CMD_AT91_BOOT_TEST) += boot_test_cmd.o
-obj-$(CONFIG_AT91_BOOTSTRAP) += bootstrap.o
-sam926x_lowlevel_init-$(CONFIG_AT91SAM9_LOWLEVEL_INIT) = at91sam926x_lowlevel_init.o
-lowlevel_init-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) = $(sam926x_lowlevel_init-y)
-lowlevel_init-$(CONFIG_SOC_AT91SAM9260) += at91sam9260_lowlevel_init.o
-lowlevel_init-$(CONFIG_SOC_AT91SAM9261) += at91sam9261_lowlevel_init.o
-lowlevel_init-$(CONFIG_SOC_AT91SAM9263) += at91sam9263_lowlevel_init.o
-lowlevel_init-$(CONFIG_SOC_AT91SAM9G45) += at91sam9g45_lowlevel_init.o
-lowlevel_init-$(CONFIG_SOC_AT91SAM9X5) += at91sam9x5_lowlevel_init.o
-lowlevel_init-$(CONFIG_SOC_AT91SAM9N12) += at91sam9n12_lowlevel_init.o
-lowlevel_init-$(CONFIG_ARCH_AT91RM9200) = at91rm9200_lowlevel_init.o
-lowlevel_init-$(CONFIG_ARCH_SAMA5D3) += sama5d3_lowlevel_init.o
-lowlevel_init-$(CONFIG_ARCH_SAMA5D4) += sama5d3_lowlevel_init.o
-lwl-y += $(lowlevel_init-y)
+obj-$(CONFIG_AT91_BOOTSTRAP) += bootstrap.o
obj-$(CONFIG_AT91SAM9_RESET) += at91sam9_reset.o
obj-$(CONFIG_AT91SAM9G45_RESET) += at91sam9g45_reset.o
@@ -29,8 +17,10 @@ obj-$(CONFIG_AT91SAM9_SMC) += sam9_smc.o
obj-$(CONFIG_ARCH_AT91RM9200) += at91rm9200.o at91rm9200_time.o at91rm9200_devices.o
obj-$(CONFIG_ARCH_AT91SAM9260) += at91sam9260.o at91sam9260_devices.o
obj-$(CONFIG_ARCH_AT91SAM9261) += at91sam9261.o at91sam9261_devices.o
-obj-$(CONFIG_ARCH_AT91SAM9263) += at91sam9263.o at91sam9263_devices.o
obj-$(CONFIG_ARCH_AT91SAM9G10) += at91sam9261.o at91sam9261_devices.o
+ifeq ($(CONFIG_OFDEVICE),)
+obj-$(CONFIG_ARCH_AT91SAM9263) += at91sam9263.o at91sam9263_devices.o
+endif
obj-$(CONFIG_ARCH_AT91SAM9G20) += at91sam9260.o at91sam9260_devices.o
obj-$(CONFIG_ARCH_AT91SAM9G45) += at91sam9g45.o at91sam9g45_devices.o
obj-$(CONFIG_ARCH_AT91SAM9X5) += at91sam9x5_devices.o
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index d12e8d97bf..ba680eb81f 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -4,7 +4,6 @@
#include <mach/hardware.h>
#include <mach/at91_pmc.h>
-#include "soc.h"
#include "clock.h"
#include "generic.h"
@@ -235,6 +234,9 @@ static void __init at91rm9200_initialize(void)
at91_add_rm9200_gpio(3, AT91RM9200_BASE_PIOD);
}
-AT91_SOC_START(rm9200)
- .init = at91rm9200_initialize,
-AT91_SOC_END
+static int at91rm9200_setup(void)
+{
+ at91_boot_soc = at91rm9200_initialize;
+ return 0;
+}
+pure_initcall(at91rm9200_setup);
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index fbd7884141..8975bf4665 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -4,7 +4,6 @@
#include <mach/hardware.h>
#include <mach/at91_pmc.h>
-#include "soc.h"
#include "generic.h"
#include "clock.h"
@@ -236,6 +235,9 @@ static void at91sam9260_initialize(void)
at91_add_sam9_smc(DEVICE_ID_SINGLE, AT91SAM9260_BASE_SMC, 0x200);
}
-AT91_SOC_START(sam9260)
- .init = at91sam9260_initialize,
-AT91_SOC_END
+static int at91sam9260_setup(void)
+{
+ at91_boot_soc = at91sam9260_initialize;
+ return 0;
+}
+pure_initcall(at91sam9260_setup);
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c
index 99919b3f82..1cb8983514 100644
--- a/arch/arm/mach-at91/at91sam9260_devices.c
+++ b/arch/arm/mach-at91/at91sam9260_devices.c
@@ -19,6 +19,7 @@
#include <mach/at91_pmc.h>
#include <mach/at91sam9260_matrix.h>
#include <mach/at91sam9_sdramc.h>
+#include <mach/at91_rtt.h>
#include <mach/iomux.h>
#include <mach/io.h>
#include <mach/cpu.h>
diff --git a/arch/arm/mach-at91/at91sam9260_lowlevel_init.c b/arch/arm/mach-at91/at91sam9260_lowlevel_init.c
deleted file mode 100644
index 7f84185ef9..0000000000
--- a/arch/arm/mach-at91/at91sam9260_lowlevel_init.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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 <linux/sizes.h>
-
-void __bare_init at91sam9260_lowlevel_init(void)
-{
- struct at91sam926x_lowlevel_cfg cfg;
-
- cfg.pio = IOMEM(AT91SAM9260_BASE_PIOC);
- cfg.sdramc = IOMEM(AT91SAM9260_BASE_SDRAMC);
- cfg.ebi_pio_is_peripha = false;
- cfg.matrix_csa = AT91_MATRIX_EBICSA;
-
- at91sam926x_lowlevel_init(&cfg);
-
- barebox_arm_entry(AT91_CHIPSELECT_1, at91_get_sdram_size(cfg.sdramc),
- NULL);
-}
-
-void __naked __bare_init barebox_arm_reset_vector(void)
-{
- arm_cpu_lowlevel_init();
-
- arm_setup_stack(AT91SAM9260_SRAM_BASE + AT91SAM9260_SRAM_SIZE - 16);
-
- at91sam9260_lowlevel_init();
-}
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 37a65ecd3d..35aaa9c96a 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -4,7 +4,6 @@
#include <mach/hardware.h>
#include <mach/at91_pmc.h>
-#include "soc.h"
#include "generic.h"
#include "clock.h"
@@ -228,6 +227,9 @@ static void at91sam9261_initialize(void)
at91_add_sam9_smc(DEVICE_ID_SINGLE, AT91SAM9261_BASE_SMC, 0x200);
}
-AT91_SOC_START(sam9261)
- .init = at91sam9261_initialize,
-AT91_SOC_END
+static int at91sam9261_setup(void)
+{
+ at91_boot_soc = at91sam9261_initialize;
+ return 0;
+}
+pure_initcall(at91sam9261_setup);
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
index e63e0e7516..6be390937d 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -18,6 +18,7 @@
#include <mach/at91_pmc.h>
#include <mach/at91sam9261_matrix.h>
#include <mach/at91sam9_sdramc.h>
+#include <mach/at91_rtt.h>
#include <mach/board.h>
#include <mach/iomux.h>
#include <mach/io.h>
diff --git a/arch/arm/mach-at91/at91sam9261_lowlevel_init.c b/arch/arm/mach-at91/at91sam9261_lowlevel_init.c
deleted file mode 100644
index 0ad7f0a0c5..0000000000
--- a/arch/arm/mach-at91/at91sam9261_lowlevel_init.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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 <linux/sizes.h>
-
-void __bare_init at91sam9261_lowlevel_init(void)
-{
- struct at91sam926x_lowlevel_cfg cfg;
-
- cfg.pio = IOMEM(AT91SAM9261_BASE_PIOC);
- cfg.sdramc = IOMEM(AT91SAM9261_BASE_SDRAMC);
- cfg.ebi_pio_is_peripha = false;
- cfg.matrix_csa = AT91_MATRIX_EBICSA;
-
- at91sam926x_lowlevel_init(&cfg);
-
- barebox_arm_entry(AT91_CHIPSELECT_1, at91_get_sdram_size(cfg.sdramc),
- NULL);
-}
-
-void __naked __bare_init barebox_arm_reset_vector(void)
-{
- arm_cpu_lowlevel_init();
-
- arm_setup_stack(AT91SAM9261_SRAM_BASE + AT91SAM9261_SRAM_SIZE - 16);
-
- at91sam9261_lowlevel_init();
-}
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index 35d187b4b5..ee48115ea8 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -4,7 +4,6 @@
#include <mach/hardware.h>
#include <mach/at91_pmc.h>
-#include "soc.h"
#include "clock.h"
#include "generic.h"
@@ -249,6 +248,9 @@ static void at91sam9263_initialize(void)
at91_add_sam9_smc(1, AT91SAM9263_BASE_SMC1, 0x200);
}
-AT91_SOC_START(sam9263)
- .init = at91sam9263_initialize,
-AT91_SOC_END
+static int at91sam9263_setup(void)
+{
+ at91_boot_soc = at91sam9263_initialize;
+ return 0;
+}
+pure_initcall(at91sam9263_setup);
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index 559b77e9d8..6302684b2d 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -18,6 +18,7 @@
#include <mach/at91_pmc.h>
#include <mach/at91sam9263_matrix.h>
#include <mach/at91sam9_sdramc.h>
+#include <mach/at91_rtt.h>
#include <mach/board.h>
#include <mach/iomux.h>
#include <mach/io.h>
diff --git a/arch/arm/mach-at91/at91sam9263_lowlevel_init.c b/arch/arm/mach-at91/at91sam9263_lowlevel_init.c
deleted file mode 100644
index 0be84551f8..0000000000
--- a/arch/arm/mach-at91/at91sam9263_lowlevel_init.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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 <linux/sizes.h>
-
-void __bare_init at91sam9263_lowlevel_init(void)
-{
- struct at91sam926x_lowlevel_cfg cfg;
-
- cfg.pio = IOMEM(AT91SAM9263_BASE_PIOD);
- cfg.sdramc = IOMEM(AT91SAM9263_BASE_SDRAMC0);
- cfg.ebi_pio_is_peripha = true;
- cfg.matrix_csa = AT91_MATRIX_EBI0CSA;
-
- at91sam926x_lowlevel_init(&cfg);
-
- barebox_arm_entry(AT91_CHIPSELECT_1, at91_get_sdram_size(cfg.sdramc),
- NULL);
-}
-
-void __naked __bare_init barebox_arm_reset_vector(void)
-{
- arm_cpu_lowlevel_init();
-
- arm_setup_stack(AT91SAM9263_SRAM0_BASE + AT91SAM9263_SRAM0_SIZE - 16);
-
- at91sam9263_lowlevel_init();
-}
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index ce6ce90db2..c70036b389 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -6,7 +6,6 @@
#include <mach/at91_pmc.h>
#include <mach/cpu.h>
-#include "soc.h"
#include "generic.h"
#include "clock.h"
@@ -264,6 +263,9 @@ static void at91sam9g45_initialize(void)
at91_add_sam9_smc(DEVICE_ID_SINGLE, AT91SAM9G45_BASE_SMC, 0x200);
}
-AT91_SOC_START(sam9g45)
- .init = at91sam9g45_initialize,
-AT91_SOC_END
+static int at91sam9g45_setup(void)
+{
+ at91_boot_soc = at91sam9g45_initialize;
+ return 0;
+}
+pure_initcall(at91sam9g45_setup);
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index bc41320405..67ca3590c3 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -18,6 +18,7 @@
#include <mach/at91_pmc.h>
#include <mach/at91sam9g45_matrix.h>
#include <mach/at91sam9_ddrsdr.h>
+#include <mach/at91_rtt.h>
#include <mach/board.h>
#include <mach/iomux.h>
#include <mach/io.h>
diff --git a/arch/arm/mach-at91/at91sam9n12.c b/arch/arm/mach-at91/at91sam9n12.c
index c551f9a744..7ab44e4964 100644
--- a/arch/arm/mach-at91/at91sam9n12.c
+++ b/arch/arm/mach-at91/at91sam9n12.c
@@ -6,7 +6,6 @@
#include <mach/io.h>
#include <mach/cpu.h>
-#include "soc.h"
#include "generic.h"
#include "clock.h"
@@ -220,6 +219,9 @@ static void at91sam9n12_initialize(void)
at91_add_sam9_smc(DEVICE_ID_SINGLE, AT91SAM9N12_BASE_SMC, 0x200);
}
-AT91_SOC_START(sam9n12)
- .init = at91sam9n12_initialize,
-AT91_SOC_END
+static int at91sam9n12_setup(void)
+{
+ at91_boot_soc = at91sam9n12_initialize;
+ return 0;
+}
+pure_initcall(at91sam9n12_setup);
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index a47bcb2c57..d125e5ffd0 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -8,8 +8,15 @@
* published by the Free Software Foundation.
*/
- /* Clocks */
+/* function called by setup to perform late init */
+extern void (*at91_boot_soc)(void);
+
+/* Clocks */
+#ifdef CONFIG_COMMON_CLK_OF_PROVIDER
+static inline int __init at91_clock_init(void) { return 0; }
+#else
extern int __init at91_clock_init(void);
+#endif
static inline struct device_d *at91_add_rm9200_gpio(int id, resource_size_t start)
{
@@ -35,5 +42,3 @@ static inline struct device_d *at91_add_sam9_smc(int id, resource_size_t start,
return add_generic_device("at91sam9-smc", id, NULL, start, size,
IORESOURCE_MEM, NULL);
}
-
-void at91_rtt_irq_fixup(void *base);
diff --git a/arch/arm/mach-at91/include/mach/at91_lowlevel_init.h b/arch/arm/mach-at91/include/mach/at91_lowlevel_init.h
deleted file mode 100644
index 6b37e49e96..0000000000
--- a/arch/arm/mach-at91/include/mach/at91_lowlevel_init.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2009-2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
- *
- * Under GPLv2
- */
-
-#ifndef __AT91_LOWLEVEL_INIT_H__
-#define __AT91_LOWLEVEL_INIT_H__
-
-struct at91sam926x_lowlevel_cfg {
- /* SoC specific */
- void __iomem *pio;
- void __iomem *sdramc;
- u32 ebi_pio_is_peripha;
- u32 matrix_csa;
-
- /* board specific */
- u32 wdt_mr;
- u32 ebi_pio_pdr;
- u32 ebi_pio_ppudr;
- u32 ebi_csa;
- u32 smc_cs;
- u32 smc_mode;
- u32 smc_cycle;
- u32 smc_pulse;
- u32 smc_setup;
- u32 pmc_mor;
- u32 pmc_pllar;
- u32 pmc_mckr1;
- u32 pmc_mckr2;
- u32 sdrc_cr;
- u32 sdrc_tr1;
- u32 sdrc_mdr;
- u32 sdrc_tr2;
- u32 rstc_rmr;
-};
-
-#ifdef CONFIG_HAVE_AT91_LOWLEVEL_INIT
-void at91sam926x_lowlevel_board_config(struct at91sam926x_lowlevel_cfg *cfg);
-void at91sam926x_lowlevel_init(struct at91sam926x_lowlevel_cfg *cfg);
-#else
-static inline void at91sam926x_lowlevel_board_config(struct at91sam926x_lowlevel_cfg *cfg) {}
-static inline void at91sam926x_lowlevel_init(struct at91sam926x_lowlevel_cfg *cfg) {}
-#endif
-
-#endif /* __AT91_LOWLEVEL_INIT_H__ */
diff --git a/arch/arm/mach-at91/include/mach/at91_rtt.h b/arch/arm/mach-at91/include/mach/at91_rtt.h
index 7ec75de8bb..ad29df1918 100644
--- a/arch/arm/mach-at91/include/mach/at91_rtt.h
+++ b/arch/arm/mach-at91/include/mach/at91_rtt.h
@@ -16,6 +16,8 @@
#ifndef AT91_RTT_H
#define AT91_RTT_H
+#include <io.h>
+
#define AT91_RTT_MR 0x00 /* Real-time Mode Register */
#define AT91_RTT_RTPRES (0xffff << 0) /* Real-time Timer Prescaler Value */
#define AT91_RTT_ALMIEN (1 << 16) /* Alarm Interrupt Enable */
@@ -32,4 +34,18 @@
#define AT91_RTT_ALMS (1 << 0) /* Real-time Alarm Status */
#define AT91_RTT_RTTINC (1 << 1) /* Real-time Timer Increment */
+
+/*
+ * As the RTT is powered by the backup power so if the interrupt
+ * is still on when the kernel start, the kernel will end up with
+ * dead lock interrupt that it can not clear. Because the interrupt line is
+ * shared with the basic timer (PIT) on AT91_ID_SYS.
+ */
+static inline void at91_rtt_irq_fixup(void *base)
+{
+ void __iomem *reg = base + AT91_RTT_MR;
+ u32 mr = readl(reg);
+
+ writel(mr & ~(AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN), reg);
+}
#endif
diff --git a/arch/arm/mach-at91/at91sam926x_lowlevel_init.c b/arch/arm/mach-at91/include/mach/at91sam926x_board_init.h
index 5dd8bc4e60..70ae903374 100644
--- a/arch/arm/mach-at91/at91sam926x_lowlevel_init.c
+++ b/arch/arm/mach-at91/include/mach/at91sam926x_board_init.h
@@ -1,38 +1,59 @@
+#ifndef __AT91SAM926X_BOARD_INIT_H__
+#define __AT91SAM926X_BOARD_INIT_H__
/*
* Copyright (C) 2008 Ronetix Ilko Iliev (www.ronetix.at)
* Copyright (C) 2009-2011 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 <init.h>
+
#include <mach/at91sam9_sdramc.h>
#include <mach/at91sam9_smc.h>
-#include <mach/at91_lowlevel_init.h>
+#include <mach/at91_rstc.h>
+#include <mach/at91_pio.h>
+#include <mach/at91_pmc.h>
+#include <mach/at91_wdt.h>
+#include <mach/hardware.h>
#include <mach/gpio.h>
-#include <mach/io.h>
-#include <init.h>
-#include <linux/sizes.h>
-
-#include "gpio.h"
-static void inline access_sdram(void)
+struct at91sam926x_board_cfg {
+ /* SoC specific */
+ void __iomem *pio;
+ void __iomem *sdramc;
+ u32 ebi_pio_is_peripha;
+ u32 matrix_csa;
+
+ /* board specific */
+ u32 wdt_mr;
+ u32 ebi_pio_pdr;
+ u32 ebi_pio_ppudr;
+ u32 ebi_csa;
+ u32 smc_cs;
+ u32 smc_mode;
+ u32 smc_cycle;
+ u32 smc_pulse;
+ u32 smc_setup;
+ u32 pmc_mor;
+ u32 pmc_pllar;
+ u32 pmc_mckr1;
+ u32 pmc_mckr2;
+ u32 sdrc_cr;
+ u32 sdrc_tr1;
+ u32 sdrc_mdr;
+ u32 sdrc_tr2;
+ u32 rstc_rmr;
+};
+
+
+static void __always_inline access_sdram(void)
{
writel(0x00000000, AT91_SDRAM_BASE);
}
-static void inline pmc_check_mckrdy(void)
+static void __always_inline pmc_check_mckrdy(void)
{
u32 r;
@@ -41,7 +62,7 @@ static void inline pmc_check_mckrdy(void)
} while (!(r & AT91_PMC_MCKRDY));
}
-static int inline running_in_sram(void)
+static int __always_inline running_in_sram(void)
{
u32 addr = get_pc();
@@ -49,75 +70,59 @@ static int inline running_in_sram(void)
return addr == 0;
}
-#define at91_sdramc_read(field) \
- __raw_readl(cfg->sdramc + field)
-
-#define at91_sdramc_write(field, value) \
- __raw_writel(value, cfg->sdramc + field)
-
-void __bare_init at91sam926x_sdramc_init(struct at91sam926x_lowlevel_cfg *cfg)
+static void __always_inline at91sam926x_sdramc_init(struct at91sam926x_board_cfg *cfg)
{
u32 r;
int i;
int in_sram = running_in_sram();
- /*
- * SDRAMC Check if Refresh Timer Counter is already initialized
- */
- r = at91_sdramc_read(AT91_SDRAMC_TR);
+ /* SDRAMC Check if Refresh Timer Counter is already initialized */
+ r = __raw_readl(cfg->sdramc + AT91_SDRAMC_TR);
if (r && !in_sram)
return;
/* SDRAMC_MR : Normal Mode */
- at91_sdramc_write(AT91_SDRAMC_MR, AT91_SDRAMC_MODE_NORMAL);
+ __raw_writel(AT91_SDRAMC_MR, cfg->sdramc + AT91_SDRAMC_MODE_NORMAL);
/* SDRAMC_TR - Refresh Timer register */
- at91_sdramc_write(AT91_SDRAMC_TR, cfg->sdrc_tr1);
+ __raw_writel(AT91_SDRAMC_TR, cfg->sdramc + cfg->sdrc_tr1);
/* SDRAMC_CR - Configuration register*/
- at91_sdramc_write(AT91_SDRAMC_CR, cfg->sdrc_cr);
+ __raw_writel(AT91_SDRAMC_CR, cfg->sdramc + cfg->sdrc_cr);
/* Memory Device Type */
- at91_sdramc_write(AT91_SDRAMC_MDR, cfg->sdrc_mdr);
+ __raw_writel(AT91_SDRAMC_MDR, cfg->sdramc + cfg->sdrc_mdr);
/* SDRAMC_MR : Precharge All */
- at91_sdramc_write(AT91_SDRAMC_MR, AT91_SDRAMC_MODE_PRECHARGE);
-
- /* access SDRAM */
+ __raw_writel(AT91_SDRAMC_MR, cfg->sdramc + AT91_SDRAMC_MODE_PRECHARGE);
access_sdram();
/* SDRAMC_MR : refresh */
- at91_sdramc_write(AT91_SDRAMC_MR, AT91_SDRAMC_MODE_REFRESH);
+ __raw_writel(AT91_SDRAMC_MR, cfg->sdramc + AT91_SDRAMC_MODE_REFRESH);
/* access SDRAM 8 times */
for (i = 0; i < 8; i++)
access_sdram();
/* SDRAMC_MR : Load Mode Register */
- at91_sdramc_write(AT91_SDRAMC_MR, AT91_SDRAMC_MODE_LMR);
-
- /* access SDRAM */
+ __raw_writel(AT91_SDRAMC_MR, cfg->sdramc + AT91_SDRAMC_MODE_LMR);
access_sdram();
/* SDRAMC_MR : Normal Mode */
- at91_sdramc_write(AT91_SDRAMC_MR, AT91_SDRAMC_MODE_NORMAL);
-
- /* access SDRAM */
+ __raw_writel(AT91_SDRAMC_MR, cfg->sdramc + AT91_SDRAMC_MODE_NORMAL);
access_sdram();
/* SDRAMC_TR : Refresh Timer Counter */
- at91_sdramc_write(AT91_SDRAMC_TR, cfg->sdrc_tr2);
-
- /* access SDRAM */
+ __raw_writel(AT91_SDRAMC_TR, cfg->sdramc + cfg->sdrc_tr2);
access_sdram();
}
-void __bare_init at91sam926x_lowlevel_init(struct at91sam926x_lowlevel_cfg *cfg)
+static void __always_inline at91sam926x_board_init(struct at91sam926x_board_cfg *cfg)
{
u32 r;
- int in_sram = running_in_sram();
- at91sam926x_lowlevel_board_config(cfg);
+ if (!IS_ENABLED(CONFIG_AT91SAM926X_BOARD_INIT))
+ return;
__raw_writel(cfg->wdt_mr, AT91_BASE_WDT + AT91_WDT_MR);
@@ -131,64 +136,41 @@ void __bare_init at91sam926x_lowlevel_init(struct at91sam926x_lowlevel_cfg *cfg)
/* flash */
at91_smc_write(cfg->smc_cs, AT91_SAM9_SMC_MODE, cfg->smc_mode);
-
at91_smc_write(cfg->smc_cs, AT91_SMC_CYCLE, cfg->smc_cycle);
-
at91_smc_write(cfg->smc_cs, AT91_SMC_PULSE, cfg->smc_pulse);
-
at91_smc_write(cfg->smc_cs, AT91_SMC_SETUP, cfg->smc_setup);
- /*
- * PMC Check if the PLL is already initialized
- */
+ /* PMC Check if the PLL is already initialized */
r = at91_pmc_read(AT91_PMC_MCKR);
- if (r & AT91_PMC_CSS && !in_sram)
+ if ((r & AT91_PMC_CSS) && !running_in_sram())
return;
- /*
- * Enable the Main Oscillator
- */
+ /* Enable the Main Oscillator */
at91_pmc_write(AT91_CKGR_MOR, cfg->pmc_mor);
-
do {
r = at91_pmc_read(AT91_PMC_SR);
} while (!(r & AT91_PMC_MOSCS));
- /*
- * PLLAR: x MHz for PCK
- */
+ /* PLLAR: x MHz for PCK */
at91_pmc_write(AT91_CKGR_PLLAR, cfg->pmc_pllar);
-
do {
r = at91_pmc_read(AT91_PMC_SR);
} while (!(r & AT91_PMC_LOCKA));
- /*
- * PCK/x = MCK Master Clock from SLOW
- */
+ /* PCK/x = MCK Master Clock from SLOW */
at91_pmc_write(AT91_PMC_MCKR, cfg->pmc_mckr1);
-
pmc_check_mckrdy();
- /*
- * PCK/x = MCK Master Clock from PLLA
- */
+ /* PCK/x = MCK Master Clock from PLLA */
at91_pmc_write(AT91_PMC_MCKR, cfg->pmc_mckr2);
-
pmc_check_mckrdy();
- /*
- * Init SDRAM
- */
+ /* Init SDRAM */
at91sam926x_sdramc_init(cfg);
/* User reset enable*/
at91_sys_write(AT91_RSTC_MR, cfg->rstc_rmr);
-#ifdef CONFIG_SYS_MATRIX_MCFG_REMAP
- /* MATRIX_MCFG - REMAP all masters */
- at91_sys_write(AT91_MATRIX_MCFG0, 0x1FF);
-#endif
/*
* When boot from external boot
* we need to enable mck and ohter clock
@@ -197,3 +179,5 @@ void __bare_init at91sam926x_lowlevel_init(struct at91sam926x_lowlevel_cfg *cfg)
*/
at91_pmc_write(AT91_PMC_PCER, 0xffffffff);
}
+
+#endif /* __AT91SAM926X_BOARD_INIT_H__ */
diff --git a/arch/arm/mach-at91/irq_fixup.c b/arch/arm/mach-at91/irq_fixup.c
deleted file mode 100644
index 9815ac2ca5..0000000000
--- a/arch/arm/mach-at91/irq_fixup.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
- *
- * Under GPLv2 only
- */
-
-#include <io.h>
-#include <mach/at91_rtt.h>
-
-/*
- * As the RTT is powered by the backup power so if the interrupt
- * is still on when the kernel start, the kernel will end up with
- * dead lock interrupt that it can not clear. Because the interrupt line is
- * shared with the basic timer (PIT) on AT91_ID_SYS.
- */
-void at91_rtt_irq_fixup(void *base)
-{
- void __iomem *reg = base + AT91_RTT_MR;
- u32 mr = readl(reg);
-
- writel(mr & ~(AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN), reg);
-}
diff --git a/arch/arm/mach-at91/sama5d3.c b/arch/arm/mach-at91/sama5d3.c
index 85efb2d78f..b52c6b49be 100644
--- a/arch/arm/mach-at91/sama5d3.c
+++ b/arch/arm/mach-at91/sama5d3.c
@@ -7,7 +7,6 @@
#include <mach/cpu.h>
#include <linux/clk.h>
-#include "soc.h"
#include "generic.h"
#include "clock.h"
@@ -391,6 +390,9 @@ static void sama5d3_initialize(void)
at91_add_sam9_smc(DEVICE_ID_SINGLE, SAMA5D3_BASE_HSMC + 0x600, 0xa0);
}
-AT91_SOC_START(sama5d3)
- .init = sama5d3_initialize,
-AT91_SOC_END
+static int sama5d3_setup(void)
+{
+ at91_boot_soc = sama5d3_initialize;
+ return 0;
+}
+pure_initcall(sama5d3_setup);
diff --git a/arch/arm/mach-at91/sama5d4.c b/arch/arm/mach-at91/sama5d4.c
index 4d380ed88e..d6b18fca24 100644
--- a/arch/arm/mach-at91/sama5d4.c
+++ b/arch/arm/mach-at91/sama5d4.c
@@ -16,7 +16,6 @@
#include <mach/cpu.h>
#include <linux/clk.h>
-#include "soc.h"
#include "generic.h"
#include "clock.h"
@@ -299,6 +298,9 @@ static void sama5d4_initialize(void)
at91_add_sam9_smc(DEVICE_ID_SINGLE, SAMA5D4_BASE_HSMC + 0x600, 0xa0);
}
-AT91_SOC_START(sama5d4)
- .init = sama5d4_initialize,
-AT91_SOC_END
+static int sama5d4_setup(void)
+{
+ at91_boot_soc = sama5d4_initialize;
+ return 0;
+}
+pure_initcall(sama5d4_setup);
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index 8f32af043d..7a19c45ea4 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -14,10 +14,10 @@
#include <mach/cpu.h>
#include <mach/at91_dbgu.h>
-#include "soc.h"
#include "generic.h"
-struct at91_init_soc __initdata at91_boot_soc;
+/* function called by at91_detect() - if assigned */
+void __initdata (*at91_boot_soc)(void);
struct at91_socinfo at91_soc_initdata;
EXPORT_SYMBOL(at91_soc_initdata);
@@ -48,39 +48,32 @@ static void __init soc_detect(u32 dbgu_base)
at91_soc_initdata.type = AT91_SOC_RM9200;
if (at91_soc_initdata.subtype == AT91_SOC_SUBTYPE_NONE)
at91_soc_initdata.subtype = AT91_SOC_RM9200_BGA;
- at91_boot_soc = at91rm9200_soc;
break;
case ARCH_ID_AT91SAM9260:
at91_soc_initdata.type = AT91_SOC_SAM9260;
- at91_boot_soc = at91sam9260_soc;
break;
case ARCH_ID_AT91SAM9261:
at91_soc_initdata.type = AT91_SOC_SAM9261;
- at91_boot_soc = at91sam9261_soc;
break;
case ARCH_ID_AT91SAM9263:
at91_soc_initdata.type = AT91_SOC_SAM9263;
- at91_boot_soc = at91sam9263_soc;
break;
case ARCH_ID_AT91SAM9G20:
at91_soc_initdata.type = AT91_SOC_SAM9G20;
- at91_boot_soc = at91sam9260_soc;
break;
case ARCH_ID_AT91SAM9G45:
at91_soc_initdata.type = AT91_SOC_SAM9G45;
if (cidr == ARCH_ID_AT91SAM9G45ES)
at91_soc_initdata.subtype = AT91_SOC_SAM9G45ES;
- at91_boot_soc = at91sam9g45_soc;
break;
case ARCH_ID_AT91SAM9RL64:
at91_soc_initdata.type = AT91_SOC_SAM9RL;
- at91_boot_soc = at91sam9rl_soc;
break;
case ARCH_ID_AT91SAM9X5:
@@ -89,17 +82,14 @@ static void __init soc_detect(u32 dbgu_base)
case ARCH_ID_AT91SAM9N12:
at91_soc_initdata.type = AT91_SOC_SAM9N12;
- at91_boot_soc = at91sam9n12_soc;
break;
case ARCH_ID_SAMA5:
if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D3) {
at91_soc_initdata.type = AT91_SOC_SAMA5D3;
- at91_boot_soc = at91sama5d3_soc;
} else {
if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D4) {
at91_soc_initdata.type = AT91_SOC_SAMA5D4;
- at91_boot_soc = at91sama5d4_soc;
}
}
break;
@@ -108,13 +98,11 @@ static void __init soc_detect(u32 dbgu_base)
/* at91sam9g10 */
if ((socid & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) {
at91_soc_initdata.type = AT91_SOC_SAM9G10;
- at91_boot_soc = at91sam9261_soc;
}
/* at91sam9xe */
else if ((cidr & AT91_CIDR_ARCH) == ARCH_FAMILY_AT91SAM9XE) {
at91_soc_initdata.type = AT91_SOC_SAM9260;
at91_soc_initdata.subtype = AT91_SOC_SAM9XE;
- at91_boot_soc = at91sam9260_soc;
}
if (!at91_soc_is_detected())
@@ -283,17 +271,11 @@ static int at91_detect(void)
pr_info("AT91: Detected soc subtype: %s\n",
at91_get_soc_subtype(&at91_soc_initdata));
- if (IS_ENABLED(CONFIG_COMMON_CLK_OF_PROVIDER))
- return 0;
-
- if (!at91_soc_is_enabled())
- panic("AT91: Soc not enabled");
-
/* Init clock subsystem */
at91_clock_init();
- if (at91_boot_soc.init)
- at91_boot_soc.init();
+ if (at91_boot_soc != NULL)
+ at91_boot_soc();
return 0;
}
diff --git a/arch/arm/mach-at91/soc.h b/arch/arm/mach-at91/soc.h
deleted file mode 100644
index 76e4621f8a..0000000000
--- a/arch/arm/mach-at91/soc.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
- *
- * Under GPLv2
- */
-
-struct at91_init_soc {
- int builtin;
- void (*init)(void);
-};
-
-extern struct at91_init_soc at91_boot_soc;
-extern struct at91_init_soc at91rm9200_soc;
-extern struct at91_init_soc at91sam9260_soc;
-extern struct at91_init_soc at91sam9261_soc;
-extern struct at91_init_soc at91sam9263_soc;
-extern struct at91_init_soc at91sam9g45_soc;
-extern struct at91_init_soc at91sam9rl_soc;
-extern struct at91_init_soc at91sam9x5_soc;
-extern struct at91_init_soc at91sam9n12_soc;
-extern struct at91_init_soc at91sama5d3_soc;
-extern struct at91_init_soc at91sama5d4_soc;
-
-#define AT91_SOC_START(_name) \
-struct at91_init_soc __initdata at91##_name##_soc \
- __used \
- = { \
- .builtin = 1, \
-
-#define AT91_SOC_END \
-};
-
-static inline int at91_soc_is_enabled(void)
-{
- return at91_boot_soc.builtin;
-}
-
-#if !defined(CONFIG_SOC_AT91RM9200)
-#define at91rm9200_soc at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9260)
-#define at91sam9260_soc at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9261)
-#define at91sam9261_soc at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9263)
-#define at91sam9263_soc at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9G45)
-#define at91sam9g45_soc at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9RL)
-#define at91sam9rl_soc at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9X5)
-#define at91sam9x5_soc at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9N12)
-#define at91sam9n12_soc at91_boot_soc
-#endif
-
-#if !defined(CONFIG_ARCH_SAMA5D3)
-#define at91sama5d3_soc at91_boot_soc
-#endif
-
-#if !defined(CONFIG_ARCH_SAMA5D4)
-#define at91sama5d4_soc at91_boot_soc
-#endif
diff --git a/arch/arm/mach-imx/include/mach/imx6.h b/arch/arm/mach-imx/include/mach/imx6.h
index e0ced7edc6..288c7539ae 100644
--- a/arch/arm/mach-imx/include/mach/imx6.h
+++ b/arch/arm/mach-imx/include/mach/imx6.h
@@ -109,6 +109,8 @@ static inline int __imx6_cpu_revision(void)
return IMX_CHIP_REV_1_4;
case 0x05:
return IMX_CHIP_REV_1_5;
+ case 0x06:
+ return IMX_CHIP_REV_1_6;
case 0x100:
return IMX_CHIP_REV_2_0;
}
diff --git a/arch/arm/mach-imx/include/mach/imx7-ccm-regs.h b/arch/arm/mach-imx/include/mach/imx7-ccm-regs.h
index a4217cca5d..97fe240fc4 100644
--- a/arch/arm/mach-imx/include/mach/imx7-ccm-regs.h
+++ b/arch/arm/mach-imx/include/mach/imx7-ccm-regs.h
@@ -6,6 +6,7 @@
#define CCM_CCGRn_CLR(n) (0x4008 + 16 * (n))
#define CCM_CCGR_UART1 148
+#define CCM_CCGR_UART2 149
#define CCM_CCGR_SETTINGn(n, s) ((s) << ((n) * 4))
#define CCM_CCGR_SETTINGn_NOT_NEEDED(n) CCM_CCGR_SETTINGn(n, 0b00)
@@ -28,5 +29,7 @@
#define UART1_CLK_ROOT CLOCK_ROOT_INDEX(0xaf80)
#define UART1_CLK_ROOT__OSC_24M CCM_TARGET_ROOTn_MUX(0b000)
+#define UART2_CLK_ROOT CLOCK_ROOT_INDEX(0xb000)
+#define UART2_CLK_ROOT__OSC_24M CCM_TARGET_ROOTn_MUX(0b000)
#endif
diff --git a/arch/arm/mach-imx/include/mach/imx7-regs.h b/arch/arm/mach-imx/include/mach/imx7-regs.h
index 8774c32d73..8625d0b619 100644
--- a/arch/arm/mach-imx/include/mach/imx7-regs.h
+++ b/arch/arm/mach-imx/include/mach/imx7-regs.h
@@ -78,7 +78,7 @@
#define MX7_ECSPI2_BASE_ADDR (MX7_AIPS3_BASE_ADDR + 0x30000)
#define MX7_ECSPI3_BASE_ADDR (MX7_AIPS3_BASE_ADDR + 0x40000)
#define MX7_UART1_BASE_ADDR (MX7_AIPS3_BASE_ADDR + 0x60000)
-#define MX7_UART2_BASE_ADDR (MX7_AIPS3_BASE_ADDR + 0x70000)
+#define MX7_UART2_BASE_ADDR (MX7_AIPS3_BASE_ADDR + 0x90000)
#define MX7_UART3_BASE_ADDR (MX7_AIPS3_BASE_ADDR + 0x80000)
#define MX7_SAI1_BASE_ADDR (MX7_AIPS3_BASE_ADDR + 0xA0000)
#define MX7_SAI2_BASE_ADDR (MX7_AIPS3_BASE_ADDR + 0xB0000)
diff --git a/arch/arm/mach-imx/include/mach/revision.h b/arch/arm/mach-imx/include/mach/revision.h
index 908a0a1d74..d9495d967f 100644
--- a/arch/arm/mach-imx/include/mach/revision.h
+++ b/arch/arm/mach-imx/include/mach/revision.h
@@ -8,6 +8,7 @@
#define IMX_CHIP_REV_1_3 0x13
#define IMX_CHIP_REV_1_4 0x14
#define IMX_CHIP_REV_1_5 0x15
+#define IMX_CHIP_REV_1_6 0x16
#define IMX_CHIP_REV_2_0 0x20
#define IMX_CHIP_REV_2_1 0x21
#define IMX_CHIP_REV_2_2 0x22