Skip to contentSkip to conversation

at91: move reset vector to board code

PATCH Superseded Sam Ravnborg 2 participants 26 messages Jul 7, 2017 – Jul 17, 2017

Subsystems (4)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v2 cover at91: move reset vector to board code

The following patchset moves the reset vector for at91 boards from mach-at91 to board code. This is similar to what other boards do and is done to prepare for multi-image and DT support.

The patchset convert all boards and thus clean up the old code that resided in mach-at91/

The first patch have minimal impact, but prepares for a board-by-board conversion.
All temporary CONFIG symbols are gone at the end of this series.

I kept Jean-Christophe PLAGNIOL-VILLARD and others copyright in all the created files and did not add copyright myself. The patchset does IMO not add any copyrightable material from my side as this is in reality just moving around code.

The patchset was successfully booted on a AT91SAM9263EK, and all defconfigs was built (expect the ones that failed to build before this patchset was applied).

Changes v1 => v2
- converted all boards over
- fixed author info

Sam

Sam Ravnborg (23):
at91: refactor lowlevel_init selection
at91: drop unused at91sam9x5_lowlevel_init.c
at91sam9263ek: move reset vector to board code at91sam9261ek, at91sam9g10ek: move reset vector to board code
pm9261: move reset vector to board code
at91: drop unused at91sam9261_lowlevel_init
mmccpu: move reset vector to board code
pm9263: move reset vector to board code
usb-a926x: move reset vector to board code
at91: delete at91sam926x_lowlevel_init
tny-a926x: move reset vector to board code
qil-a926x: move reset vector to board code
haba-knx: move reset vector to board code
at91: delete unused at91sam9263_lowlevel_init.c sama5d{3,4}{xek,xplained}: move reset vector to board code at91sam{9260,9G20,9m10g45,9n12}ek: move reset vector to board code
at91rm9200ek: move reset vector to board code
at91sam9m10ihd: move reset vector to board code
pm9g45: move reset vector to board code
animeo: move reset vector to board code
dss11: move reset vector to board code
telit-evk-pro3: move reset vector to board code
at91: remove leftovers from reset code in mach-at91

 arch/arm/boards/animeo_ip/Makefile                 |   1 +
 arch/arm/boards/animeo_ip/lowlevel.c               |  26 ++++
 arch/arm/boards/at91rm9200ek/Makefile              |   1 +
 .../at91rm9200ek/lowlevel.c}                       |  16 +--
 arch/arm/boards/at91sam9260ek/Makefile             |   1 +
 arch/arm/boards/at91sam9260ek/lowlevel.c           |  26 ++++
 arch/arm/boards/at91sam9261ek/Makefile             |   2 +-
 arch/arm/boards/at91sam9261ek/lowlevel_init.c      |  41 +++++--
 arch/arm/boards/at91sam9263ek/Makefile             |   2 +-
 arch/arm/boards/at91sam9263ek/lowlevel_init.c      |  43 +++++--
 arch/arm/boards/at91sam9m10g45ek/Makefile          |   1 +
 .../at91sam9m10g45ek/lowlevel.c}                   |  11 +-
 arch/arm/boards/at91sam9m10ihd/Makefile            |   2 +
 .../at91sam9m10ihd/lowlevel.c}                     |  19 ++-
 arch/arm/boards/at91sam9n12ek/Makefile             |   1 +
 .../at91sam9n12ek/lowlevel.c}                      |  13 +-
 arch/arm/boards/dss11/Makefile                     |   1 +
 arch/arm/boards/dss11/lowlevel.c                   |  26 ++++
 arch/arm/boards/haba-knx/Makefile                  |   3 +
 arch/arm/boards/haba-knx/lowlevel.c                |  26 ++++
 arch/arm/boards/mmccpu/Makefile                    |   2 +-
 arch/arm/boards/mmccpu/lowlevel.c                  |  26 ++++
 arch/arm/boards/mmccpu/lowlevel_init.c             | 135 ---------------------
 arch/arm/boards/pm9261/Makefile                    |   2 +-
 arch/arm/boards/pm9261/lowlevel_init.c             |  39 ++++--
 arch/arm/boards/pm9263/Makefile                    |   2 +-
 arch/arm/boards/pm9263/lowlevel_init.c             |  43 +++++--
 arch/arm/boards/pm9g45/Makefile                    |   1 +
 arch/arm/boards/pm9g45/lowlevel.c                  |  24 ++++
 arch/arm/boards/qil-a926x/Makefile                 |   3 +
 arch/arm/boards/qil-a926x/lowlevel.c               |  26 ++++
 arch/arm/boards/sama5d3_xplained/Makefile          |   1 +
 .../sama5d3_xplained/lowlevel.c}                   |  10 +-
 arch/arm/boards/sama5d3xek/Makefile                |   1 +
 arch/arm/boards/sama5d3xek/lowlevel.c              |  23 ++++
 arch/arm/boards/sama5d4_xplained/Makefile          |   1 +
 arch/arm/boards/sama5d4_xplained/lowlevel.c        |  23 ++++
 arch/arm/boards/sama5d4ek/Makefile                 |   1 +
 arch/arm/boards/sama5d4ek/lowlevel.c               |  23 ++++
 arch/arm/boards/telit-evk-pro3/Makefile            |   1 +
 arch/arm/boards/telit-evk-pro3/lowlevel.c          |  26 ++++
 arch/arm/boards/tny-a926x/Makefile                 |   9 +-
 arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c     |  26 ++++
 arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c     |  26 ++++
 .../arm/boards/tny-a926x/tny_a9263_lowlevel_init.c | 107 ----------------
 arch/arm/boards/usb-a926x/Makefile                 |   8 +-
 arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c     |  26 ++++
 ..._a9263_lowlevel_init.c => usb_a9263_lowlevel.c} |  43 +++++--
 arch/arm/mach-at91/Kconfig                         |  22 ++--
 arch/arm/mach-at91/Makefile                        |  12 --
 arch/arm/mach-at91/at91sam9260_lowlevel_init.c     |  48 --------
 arch/arm/mach-at91/at91sam9261_lowlevel_init.c     |  48 --------
 arch/arm/mach-at91/at91sam9263_lowlevel_init.c     |  48 --------
 .../mach-at91/include/mach/at91_lowlevel_init.h    |  46 -------
 .../mach/at91sam926x_board_init.h}                 |  63 ++++++----
 55 files changed, 622 insertions(+), 585 deletions(-)

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#1 lore raw

PATCH v2 1/23 at91: refactor lowlevel_init selection

Push selection of lowlevel_init functions out to the individual boards.
Pushing it to the individual boards allows us on a per board basis to migrate to a design where the mach-at91 code no longer calls the board specific code.

When the dependency mach-at91 => boards is dropped for a board the migration to a multi-image setup is one step closer.

---
 arch/arm/boards/at91sam9261ek/Makefile             |  2 +-
 arch/arm/boards/at91sam9263ek/Makefile             |  2 +-
 arch/arm/boards/mmccpu/Makefile                    |  2 +-
 arch/arm/boards/pm9261/Makefile                    |  2 +-
 arch/arm/boards/pm9263/Makefile                    |  2 +-
 arch/arm/boards/tny-a926x/Makefile                 |  8 +--
 arch/arm/boards/usb-a926x/Makefile                 |  6 +-
 arch/arm/mach-at91/Kconfig                         | 81 ++++++++++++++++++----
 arch/arm/mach-at91/Makefile                        | 24 +++----
 .../mach-at91/include/mach/at91_lowlevel_init.h    |  2 +-
 10 files changed, 91 insertions(+), 40 deletions(-)
arch/arm/boards/at91sam9261ek/Makefile +1 -1
index 1764da93f..667095ae4 100644
@@ -1,4 +1,4 @@
 obj-y += init.o
 
-lwl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
+lwl-$(CONFIG_AT91SAM926X_LWL) += lowlevel_init.o
 bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9261ek
arch/arm/boards/at91sam9263ek/Makefile +1 -1
index 2072cd416..de4d75690 100644
@@ -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-at91sam9263ek
arch/arm/boards/mmccpu/Makefile +1 -1
index 1398c26a0..a34efd541 100644
@@ -1,3 +1,3 @@
 obj-y += init.o
 
-lwl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
+lwl-n += lowlevel_init.o
arch/arm/boards/pm9261/Makefile +1 -1
index bff467b1d..e9bf1212f 100644
@@ -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
arch/arm/boards/pm9263/Makefile +1 -1
index 1398c26a0..68bfbfa92 100644
@@ -1,3 +1,3 @@
 obj-y += init.o
 
-lwl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
+lwl-y += lowlevel_init.o
arch/arm/boards/tny-a926x/Makefile +3 -5
index dba2f8cfc..5dee09a11 100644
@@ -1,9 +1,7 @@
 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)
+# Not used, documented by an -n assignment
+lwl-n += tny_a9263_lowlevel_init.o
 bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-tny-a926x
arch/arm/boards/usb-a926x/Makefile +2 -4
index 4f09581e3..a4eae1844 100644
@@ -1,9 +1,7 @@
 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_AT91SAM926X_LWL) += usb_a9263_lowlevel_init.o
 
-lwl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += $(lowlevel_init-y)
 bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-usb-a926x
arch/arm/mach-at91/Kconfig +68 -13

285 lines not on this page · raw message

arch/arm/mach-at91/Makefile +12 -12
index 0892fb4b5..5516b5f4f 100644
@@ -7,18 +7,18 @@ 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)
+
+lwl-$(CONFIG_AT91SAM926X_LWL) += at91sam926x_lowlevel_init.o
+
+lwl-$(CONFIG_AT91SAM9260_LWL) += at91sam9260_lowlevel_init.o
+lwl-$(CONFIG_AT91SAM9261_LWL) += at91sam9261_lowlevel_init.o
+lwl-$(CONFIG_AT91SAM9263_LWL) += at91sam9263_lowlevel_init.o
+lwl-$(CONFIG_AT91SAM9G45_LWL) += at91sam9g45_lowlevel_init.o
+lwl-$(CONFIG_AT91SAM9X5_LWL) += at91sam9x5_lowlevel_init.o
+lwl-$(CONFIG_AT91SAM9N12_LWL) += at91sam9n12_lowlevel_init.o
+lwl-$(CONFIG_AT91RM9200_LWL) += at91rm9200_lowlevel_init.o
+lwl-$(CONFIG_SAMA5D3_LWL) += sama5d3_lowlevel_init.o
+lwl-$(CONFIG_SAMA5D4_LWL) += sama5d3_lowlevel_init.o
 
 obj-$(CONFIG_AT91SAM9_RESET) += at91sam9_reset.o
 obj-$(CONFIG_AT91SAM9G45_RESET) += at91sam9g45_reset.o
arch/arm/mach-at91/include/mach/at91_lowlevel_init.h +1 -1
index 6b37e49e9..d72dfff38 100644
@@ -35,7 +35,7 @@ struct at91sam926x_lowlevel_cfg {
 	u32 rstc_rmr;
 };
 
-#ifdef CONFIG_HAVE_AT91_LOWLEVEL_INIT
+#ifdef CONFIG_AT91SAM926X_LWL
 void at91sam926x_lowlevel_board_config(struct at91sam926x_lowlevel_cfg *cfg);
 void at91sam926x_lowlevel_init(struct at91sam926x_lowlevel_cfg *cfg);
 #else
Signature · 7 lines
2.12.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

PATCH v2 2/23 at91: drop unused at91sam9x5_lowlevel_init.c

In reply to Sam Ravnborg

After the refactoring of how we select lowlevel_init it was easy to see that at91sam9x5_lowlevel_init.c was no longer used.
Delete the file and the now unused CONFIG symbol and it uses

---
 arch/arm/mach-at91/Kconfig                    |  2 --
 arch/arm/mach-at91/Makefile                   |  1 -
 arch/arm/mach-at91/at91sam9x5_lowlevel_init.c | 26 --------------------------
 3 files changed, 29 deletions(-)
 delete mode 100644 arch/arm/mach-at91/at91sam9x5_lowlevel_init.c
arch/arm/mach-at91/Kconfig +0 -2
index 37907b217..970ee07b1 100644
@@ -47,8 +47,6 @@ config AT91SAM9263_LWL
 	bool
 config AT91SAM9G45_LWL
 	bool
-config AT91SAM9X5_LWL
-	bool
 config AT91SAM9N12_LWL
 	bool
 config AT91RM9200_LWL
arch/arm/mach-at91/Makefile +0 -1
index 5516b5f4f..f683d0f65 100644
@@ -14,7 +14,6 @@ lwl-$(CONFIG_AT91SAM9260_LWL) += at91sam9260_lowlevel_init.o
 lwl-$(CONFIG_AT91SAM9261_LWL) += at91sam9261_lowlevel_init.o
 lwl-$(CONFIG_AT91SAM9263_LWL) += at91sam9263_lowlevel_init.o
 lwl-$(CONFIG_AT91SAM9G45_LWL) += at91sam9g45_lowlevel_init.o
-lwl-$(CONFIG_AT91SAM9X5_LWL) += at91sam9x5_lowlevel_init.o
 lwl-$(CONFIG_AT91SAM9N12_LWL) += at91sam9n12_lowlevel_init.o
 lwl-$(CONFIG_AT91RM9200_LWL) += at91rm9200_lowlevel_init.o
 lwl-$(CONFIG_SAMA5D3_LWL) += sama5d3_lowlevel_init.o
arch/arm/mach-at91/at91sam9x5_lowlevel_init.c deleted +0 -26
deleted file mode 100644
index 48e69f947..000000000
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
- *
- * 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/io.h>
-#include <mach/at91sam9_ddrsdr.h>
-#include <init.h>
-#include <linux/sizes.h>
-
-void __naked __bare_init barebox_arm_reset_vector(void)
-{
-	arm_cpu_lowlevel_init();
-
-	arm_setup_stack(AT91SAM9X5_SRAM_BASE + AT91SAM9X5_SRAM_SIZE - 16);
-
-	barebox_arm_entry(AT91_CHIPSELECT_1, at91sam9x5_get_ddram_size(), NULL);
-}
Signature · 7 lines
2.12.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw

PATCH v2 3/23 at91sam9263ek: move reset vector to board code

In reply to Sam Ravnborg

Create a new file at91sam926x_board_init.h which is a copy of at91sam926x_lowlevel_init.c with a few minor adjustments:
- We no longer call board code from this function
- The struct is renamed to avoid name clashes
- the function is rename to better match the prurpose

This file will be used in subsequent transformations

Otherwise just added the reset vector to the board code and drop the now obsolete CONFIG selectst

---
 arch/arm/boards/at91sam9263ek/lowlevel_init.c      |  43 ++--
 arch/arm/mach-at91/Kconfig                         |   2 -
 .../include/mach/at91sam926x_board_init.h          | 220 +++++++++++++++++++++
 3 files changed, 252 insertions(+), 13 deletions(-)
 create mode 100644 arch/arm/mach-at91/include/mach/at91sam926x_board_init.h
arch/arm/boards/at91sam9263ek/lowlevel_init.c +32 -11
index 2f8b312d3..70e0da3b1 100644
@@ -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,28 @@ 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)
+{
+	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),
+	                  NULL);
+}
+
+void __naked __bare_init barebox_arm_reset_vector(void)
+{
+	arm_cpu_lowlevel_init();
+
+	arm_setup_stack(AT91SAM9263_SRAM0_BASE + AT91SAM9263_SRAM0_SIZE - 16);
+
+	at91sam9263ek_init();
+}
arch/arm/mach-at91/Kconfig +0 -2
index 970ee07b1..99a8fdeb2 100644
@@ -437,8 +437,6 @@ config MACH_AT91SAM9263EK
 	bool "Atmel AT91SAM9263-EK"
 	select HAVE_NAND_ATMEL_BUSWIDTH_16
 	select HAVE_AT91_BOOTSTRAP
-	select AT91SAM9263_LWL
-	select AT91SAM926X_LWL
 	help
 	  Say y here if you are using Atmel's AT91SAM9263-EK Evaluation board
 
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h new file +220 -0

220 lines not on this page · raw message

Signature · 7 lines
2.12.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#4 lore raw

PATCH v2 4/23 at91sam9261ek, at91sam9g10ek: move reset vector to board code

In reply to Sam Ravnborg

The two evaluation boards share the same board code.

Drop obsolete select of CONFIG symbols
Simplify Makefile

---
 arch/arm/boards/at91sam9261ek/Makefile        |  2 +-
 arch/arm/boards/at91sam9261ek/lowlevel_init.c | 41 ++++++++++++++++++++-------
 arch/arm/mach-at91/Kconfig                    |  3 --
 3 files changed, 31 insertions(+), 15 deletions(-)
arch/arm/boards/at91sam9261ek/Makefile +1 -1
index 667095ae4..e7a9cde41 100644
@@ -1,4 +1,4 @@
 obj-y += init.o
 
-lwl-$(CONFIG_AT91SAM926X_LWL) += lowlevel_init.o
+lwl-y += lowlevel_init.o
 bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9261ek
arch/arm/boards/at91sam9261ek/lowlevel_init.c +30 -11

56 lines not on this page · raw message

arch/arm/mach-at91/Kconfig +0 -3
index 99a8fdeb2..6ae794f06 100644
@@ -331,8 +331,6 @@ config MACH_AT91SAM9261EK
 	select HAVE_AT91_DATAFLASH_CARD
 	select HAVE_NAND_ATMEL_BUSWIDTH_16
 	select HAVE_AT91_BOOTSTRAP
-	select AT91SAM9261_LWL
-	select AT91SAM926X_LWL
 	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>
@@ -361,7 +359,6 @@ config MACH_AT91SAM9G10EK
 	bool "Atmel AT91SAM9G10-EK Evaluation Kit"
 	select HAVE_NAND_ATMEL_BUSWIDTH_16
 	select HAS_DM9000
-	select AT91SAM9261_LWL
 	help
 	  Select this if you are using Atmel's AT91SAM9G10-EK Evaluation Kit.
 	  <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4588>
Signature · 7 lines
2.12.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#5 lore raw

PATCH v2 5/23 pm9261: move reset vector to board code

In reply to Sam Ravnborg
---
 arch/arm/boards/pm9261/lowlevel_init.c | 39 +++++++++++++++++++++++++---------
 arch/arm/mach-at91/Kconfig             |  2 --
 2 files changed, 29 insertions(+), 12 deletions(-)
arch/arm/boards/pm9261/lowlevel_init.c +29 -10
index 91a64b415..a4cb8af69 100644
@@ -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();
+}
arch/arm/mach-at91/Kconfig +0 -2
index 6ae794f06..3e41fe70d 100644
@@ -339,8 +339,6 @@ config MACH_PM9261
 	bool "Ronetix PM9261"
 	select HAS_DM9000
 	select HAVE_AT91_BOOTSTRAP
-	select AT91SAM9261_LWL
-	select AT91SAM926X_LWL
 	help
 	  Say y here if you are using the Ronetix PM9261 Board
 
Signature · 7 lines
2.12.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#6 lore raw

PATCH v2 6/23 at91: drop unused at91sam9261_lowlevel_init

In reply to Sam Ravnborg

All at91sam9261 based boards uses board specific reset vectors so the mach-at91 provided version is no longer in use.
Delete unused CONFIG symbols too.

---
 arch/arm/mach-at91/Kconfig                     |  2 --
 arch/arm/mach-at91/Makefile                    |  1 -
 arch/arm/mach-at91/at91sam9261_lowlevel_init.c | 48 --------------------------
 3 files changed, 51 deletions(-)
 delete mode 100644 arch/arm/mach-at91/at91sam9261_lowlevel_init.c
arch/arm/mach-at91/Kconfig +0 -2
index 3e41fe70d..704abcead 100644
@@ -41,8 +41,6 @@ config AT91SAM926X_LWL
 # as implemented in the *lowlevel_init.c files
 config AT91SAM9260_LWL
 	bool
-config AT91SAM9261_LWL
-	bool
 config AT91SAM9263_LWL
 	bool
 config AT91SAM9G45_LWL
arch/arm/mach-at91/Makefile +0 -1
index f683d0f65..587402903 100644
@@ -11,7 +11,6 @@ obj-$(CONFIG_AT91_BOOTSTRAP) += bootstrap.o
 lwl-$(CONFIG_AT91SAM926X_LWL) += at91sam926x_lowlevel_init.o
 
 lwl-$(CONFIG_AT91SAM9260_LWL) += at91sam9260_lowlevel_init.o
-lwl-$(CONFIG_AT91SAM9261_LWL) += at91sam9261_lowlevel_init.o
 lwl-$(CONFIG_AT91SAM9263_LWL) += at91sam9263_lowlevel_init.o
 lwl-$(CONFIG_AT91SAM9G45_LWL) += at91sam9g45_lowlevel_init.o
 lwl-$(CONFIG_AT91SAM9N12_LWL) += at91sam9n12_lowlevel_init.o
arch/arm/mach-at91/at91sam9261_lowlevel_init.c deleted +0 -48

48 lines not on this page · raw message

Signature · 7 lines
2.12.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#7 lore raw

PATCH v2 7/23 mmccpu: move reset vector to board code

In reply to Sam Ravnborg

As the mmccpu board do not have support for bootstrap the previous lowlevel_init.c was replaced with a simple lowlevel.c with contains only the reset vector.

---
 arch/arm/boards/mmccpu/Makefile        |   2 +-
 arch/arm/boards/mmccpu/lowlevel.c      |  26 +++++++
 arch/arm/boards/mmccpu/lowlevel_init.c | 135 ---------------------------------
 arch/arm/mach-at91/Kconfig             |   1 -
 4 files changed, 27 insertions(+), 137 deletions(-)
 create mode 100644 arch/arm/boards/mmccpu/lowlevel.c
 delete mode 100644 arch/arm/boards/mmccpu/lowlevel_init.c
arch/arm/boards/mmccpu/Makefile +1 -1
index a34efd541..e11fd5b69 100644
@@ -1,3 +1,3 @@
 obj-y += init.o
 
-lwl-n += lowlevel_init.o
+lwl-y += lowlevel.o
arch/arm/boards/mmccpu/lowlevel.c new file +26 -0
new file mode 100644
index 000000000..3ba24ce4c
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * 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/at91sam9263.h>
+#include <mach/hardware.h>
+
+void __naked __bare_init barebox_arm_reset_vector(void)
+{
+	arm_cpu_lowlevel_init();
+
+	arm_setup_stack(AT91SAM9263_SRAM0_BASE + AT91SAM9263_SRAM0_SIZE - 16);
+
+	barebox_arm_entry(AT91_CHIPSELECT_1,
+			  at91_get_sdram_size(IOMEM(AT91SAM9263_BASE_SDRAMC0)),
+	                  NULL);
+}
arch/arm/boards/mmccpu/lowlevel_init.c deleted +0 -135

135 lines not on this page · raw message

arch/arm/mach-at91/Kconfig +0 -1
index 704abcead..6363f1a15 100644
@@ -435,7 +435,6 @@ config MACH_AT91SAM9263EK
 
 config MACH_MMCCPU
 	bool "Bucyrus MMC-CPU"
-	select AT91SAM9263_LWL
 	help
 	  Say y here if you are using the Bucyrus MMC-CPU
 
Signature · 7 lines
2.12.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#8 lore raw

PATCH v2 8/23 pm9263: move reset vector to board code

In reply to Sam Ravnborg
---
 arch/arm/boards/pm9263/lowlevel_init.c | 43 +++++++++++++++++++++++++---------
 arch/arm/mach-at91/Kconfig             |  2 --
 2 files changed, 32 insertions(+), 13 deletions(-)
arch/arm/boards/pm9263/lowlevel_init.c +32 -11
index 6336d5106..6849f0a5b 100644
@@ -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();
+}
arch/arm/mach-at91/Kconfig +0 -2
index 6363f1a15..b7d08b1e6 100644
@@ -441,8 +441,6 @@ config MACH_MMCCPU
 config MACH_PM9263
 	bool "Ronetix PM9263"
 	select HAVE_AT91_BOOTSTRAP
-	select AT91SAM9263_LWL
-	select AT91SAM926X_LWL
 	help
 	  Say y here if you are using the Ronetix PM9263 Board
 
Signature · 7 lines
2.12.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#9 lore raw

PATCH v2 9/23 usb-a926x: move reset vector to board code

In reply to Sam Ravnborg

For all Calao USB boards move reset vector to board code. Introduce two different lowlevel.c files, on
for each processor.
Include a rename to make filenames similar.

---
 arch/arm/boards/usb-a926x/Makefile                 |  4 +-
 arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c     | 26 +++++++++++++
 ..._a9263_lowlevel_init.c => usb_a9263_lowlevel.c} | 43 ++++++++++++++++------
 arch/arm/mach-at91/Kconfig                         |  4 --
 4 files changed, 61 insertions(+), 16 deletions(-)
 create mode 100644 arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c
 rename arch/arm/boards/usb-a926x/{usb_a9263_lowlevel_init.c => usb_a9263_lowlevel.c} (76%)
arch/arm/boards/usb-a926x/Makefile +3 -1
index a4eae1844..65cc4082f 100644
@@ -2,6 +2,8 @@ obj-y += init.o
 
 obj-$(CONFIG_AT91_BOOTSTRAP) += usb_a9263_bootstrap.o
 
-lwl-$(CONFIG_AT91SAM926X_LWL) += 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
 
 bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-usb-a926x
arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c new file +26 -0
new file mode 100644
index 000000000..02896856d
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * 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);
+}
arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c renamed from arch/arm/boards/usb-a926x/usb_a9263_lowlevel_init.c +32 -11

58 lines not on this page · raw message

arch/arm/mach-at91/Kconfig +0 -4
index b7d08b1e6..1c9dbd578 100644
@@ -300,7 +300,6 @@ config MACH_TNY_A9260
 config MACH_USB_A9260
 	bool "CALAO USB-A9260"
 	select SUPPORT_CALAO_DAB_MMX
-	select AT91SAM9260_LWL
 	help
 	  Select this if you are using a Calao Systems USB-A9260.
 	  <http://www.calao-systems.com>
@@ -389,7 +388,6 @@ config MACH_TNY_A9G20
 config MACH_USB_A9G20
 	bool "CALAO USB-A9G20"
 	select SUPPORT_CALAO_DAB_MMX
-	select AT91SAM9260_LWL
 	help
 	  Select this if you are using a Calao Systems USB-A9G20.
 	  <http://www.calao-systems.com>
@@ -456,8 +454,6 @@ config MACH_TNY_A9263
 config MACH_USB_A9263
 	bool "CALAO USB-A9263"
 	select HAVE_AT91_BOOTSTRAP
-	select AT91SAM9263_LWL
-	select AT91SAM926X_LWL
 	help
 	  Select this if you are using a Calao Systems USB-A9263.
 	  <http://www.calao-systems.com>
Signature · 7 lines
2.12.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#10 lore raw

PATCH v2 10/23 at91: delete at91sam926x_lowlevel_init

In reply to Sam Ravnborg

The last user of at91sam926x_lowlevel_init is gone, so delete it

---
 arch/arm/mach-at91/Kconfig                     |   4 -
 arch/arm/mach-at91/Makefile                    |   2 -
 arch/arm/mach-at91/at91sam926x_lowlevel_init.c | 199 -------------------------
 3 files changed, 205 deletions(-)
 delete mode 100644 arch/arm/mach-at91/at91sam926x_lowlevel_init.c
arch/arm/mach-at91/Kconfig +0 -4
index 1c9dbd578..e38589127 100644
@@ -33,10 +33,6 @@ config HAVE_AT91_GENERATED_CLK
 config HAVE_AT91_BOOTSTRAP
 	bool
 
-# Select is board uses the common at91sam926x_lowlevel_init
-config AT91SAM926X_LWL
-	bool
-
 # Select if board uses barebox reset vector from mach-at91
 # as implemented in the *lowlevel_init.c files
 config AT91SAM9260_LWL
arch/arm/mach-at91/Makefile +0 -2
index 587402903..8293f279a 100644
@@ -8,8 +8,6 @@ obj-$(CONFIG_CMD_AT91_BOOT_TEST) += boot_test_cmd.o
 
 obj-$(CONFIG_AT91_BOOTSTRAP) += bootstrap.o
 
-lwl-$(CONFIG_AT91SAM926X_LWL) += at91sam926x_lowlevel_init.o
-
 lwl-$(CONFIG_AT91SAM9260_LWL) += at91sam9260_lowlevel_init.o
 lwl-$(CONFIG_AT91SAM9263_LWL) += at91sam9263_lowlevel_init.o
 lwl-$(CONFIG_AT91SAM9G45_LWL) += at91sam9g45_lowlevel_init.o
arch/arm/mach-at91/at91sam926x_lowlevel_init.c deleted +0 -199

199 lines not on this page · raw message

Signature · 7 lines
2.12.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#11 lore raw

PATCH v2 11/23 tny-a926x: move reset vector to board code

In reply to Sam Ravnborg

This commit deletes the unused tny_a9263_lowlevel_init.c and creates two files (one for each CPU) that contains the reset vector.

---
 arch/arm/boards/tny-a926x/Makefile                 |   5 +-
 arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c     |  26 +++++
 arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c     |  26 +++++
 .../arm/boards/tny-a926x/tny_a9263_lowlevel_init.c | 107 ---------------------
 arch/arm/mach-at91/Kconfig                         |   3 -
 5 files changed, 55 insertions(+), 112 deletions(-)
 create mode 100644 arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c
 create mode 100644 arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c
 delete mode 100644 arch/arm/boards/tny-a926x/tny_a9263_lowlevel_init.c
arch/arm/boards/tny-a926x/Makefile +3 -2
index 5dee09a11..1884cb3cd 100644
@@ -2,6 +2,7 @@ obj-y += init.o
 
 obj-$(CONFIG_AT91_BOOTSTRAP) += tny_a9263_bootstrap.o
 
-# Not used, documented by an -n assignment
-lwl-n += tny_a9263_lowlevel_init.o
+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
arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c new file +26 -0
new file mode 100644
index 000000000..02896856d
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * 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);
+}
arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c new file +26 -0
new file mode 100644
index 000000000..3ba24ce4c
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * 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/at91sam9263.h>
+#include <mach/hardware.h>
+
+void __naked __bare_init barebox_arm_reset_vector(void)
+{
+	arm_cpu_lowlevel_init();
+
+	arm_setup_stack(AT91SAM9263_SRAM0_BASE + AT91SAM9263_SRAM0_SIZE - 16);
+
+	barebox_arm_entry(AT91_CHIPSELECT_1,
+			  at91_get_sdram_size(IOMEM(AT91SAM9263_BASE_SDRAMC0)),
+	                  NULL);
+}
arch/arm/boards/tny-a926x/tny_a9263_lowlevel_init.c deleted +0 -107

107 lines not on this page · raw message

arch/arm/mach-at91/Kconfig +0 -3
index e38589127..c48923ba6 100644
@@ -288,7 +288,6 @@ config MACH_QIL_A9260
 config MACH_TNY_A9260
 	bool "CALAO TNY-A9260"
 	select SUPPORT_CALAO_MOB_TNY_MD2
-	select AT91SAM9260_LWL
 	help
 	  Select this if you are using a Calao Systems TNY-A9260.
 	  <http://www.calao-systems.com>
@@ -376,7 +375,6 @@ config MACH_AT91SAM9G20EK
 config MACH_TNY_A9G20
 	select SUPPORT_CALAO_MOB_TNY_MD2
 	bool "CALAO TNY-A9G20"
-	select AT91SAM9260_LWL
 	help
 	  Select this if you are using a Calao Systems TNY-A9G20.
 	  <http://www.calao-systems.com>
@@ -442,7 +440,6 @@ config MACH_TNY_A9263
 	bool "CALAO TNY-A9263"
 	select SUPPORT_CALAO_MOB_TNY_MD2
 	select HAVE_AT91_BOOTSTRAP
-	select AT91SAM9263_LWL
 	help
 	  Select this if you are using a Calao Systems TNY-A9263.
 	  <http://www.calao-systems.com>
Signature · 7 lines
2.12.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#12 lore raw

PATCH v2 12/23 qil-a926x: move reset vector to board code

In reply to Sam Ravnborg
---
 arch/arm/boards/qil-a926x/Makefile   |  3 +++
 arch/arm/boards/qil-a926x/lowlevel.c | 26 ++++++++++++++++++++++++++
 arch/arm/mach-at91/Kconfig           |  2 --
 3 files changed, 29 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/boards/qil-a926x/lowlevel.c
arch/arm/boards/qil-a926x/Makefile +3 -0
index 0c7bc3f04..82e46b369 100644
@@ -1,2 +1,5 @@
 obj-y += init.o
+
+lwl-y += lowlevel.o
+
 bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-qil-a926x
arch/arm/boards/qil-a926x/lowlevel.c new file +26 -0
new file mode 100644
index 000000000..02896856d
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * 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);
+}
arch/arm/mach-at91/Kconfig +0 -2
index c48923ba6..ed961593b 100644
@@ -280,7 +280,6 @@ config MACH_AT91SAM9260EK
 
 config MACH_QIL_A9260
 	bool "CALAO QIL-A9260 board"
-	select AT91SAM9260_LWL
 	help
 	  Select this if you are using a Calao Systems QIL-A9260 Board.
 	  <http://www.calao-systems.com>
@@ -396,7 +395,6 @@ config MACH_DSS11
 
 config MACH_QIL_A9G20
 	bool "CALAO QIL-A9G20 board"
-	select AT91SAM9260_LWL
 	help
 	  Select this if you are using a Calao Systems QIL-A9G20 Board.
 	  <http://www.calao-systems.com>
Signature · 7 lines
2.12.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#13 lore raw

PATCH v2 13/23 haba-knx: move reset vector to board code

In reply to Sam Ravnborg
---
 arch/arm/boards/haba-knx/Makefile   |  3 +++
 arch/arm/boards/haba-knx/lowlevel.c | 26 ++++++++++++++++++++++++++
 arch/arm/mach-at91/Kconfig          |  1 -
 3 files changed, 29 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boards/haba-knx/lowlevel.c
arch/arm/boards/haba-knx/Makefile +3 -0
index d9db6aba6..b1c469dcf 100644
@@ -1,2 +1,5 @@
 obj-y += init.o
+
+lwl-y += lowlevel.o
+
 bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-haba-knx
arch/arm/boards/haba-knx/lowlevel.c new file +26 -0
new file mode 100644
index 000000000..02896856d
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * 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);
+}
arch/arm/mach-at91/Kconfig +0 -1
index ed961593b..89ef5bfa7 100644
@@ -401,7 +401,6 @@ config MACH_QIL_A9G20
 
 config MACH_HABA_KNX_LITE
 	bool "CALAO HABA-KNX-LITE"
-	select AT91SAM9260_LWL
 	help
 	  Select this if you are using a Calao Systems HABA-KNX-LITE.
 	  <http://www.calao-systems.com>
Signature · 7 lines
2.12.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#14 lore raw

PATCH v2 14/23 at91: delete unused at91sam9263_lowlevel_init.c

In reply to Sam Ravnborg

With the last users gone delete it

---
 arch/arm/mach-at91/Kconfig                     |  2 --
 arch/arm/mach-at91/Makefile                    |  1 -
 arch/arm/mach-at91/at91sam9263_lowlevel_init.c | 48 --------------------------
 3 files changed, 51 deletions(-)
 delete mode 100644 arch/arm/mach-at91/at91sam9263_lowlevel_init.c
arch/arm/mach-at91/Kconfig +0 -2
index 89ef5bfa7..225b4735b 100644
@@ -37,8 +37,6 @@ config HAVE_AT91_BOOTSTRAP
 # as implemented in the *lowlevel_init.c files
 config AT91SAM9260_LWL
 	bool
-config AT91SAM9263_LWL
-	bool
 config AT91SAM9G45_LWL
 	bool
 config AT91SAM9N12_LWL
arch/arm/mach-at91/Makefile +0 -1
index 8293f279a..c044bfe26 100644
@@ -9,7 +9,6 @@ obj-$(CONFIG_CMD_AT91_BOOT_TEST) += boot_test_cmd.o
 obj-$(CONFIG_AT91_BOOTSTRAP) += bootstrap.o
 
 lwl-$(CONFIG_AT91SAM9260_LWL) += at91sam9260_lowlevel_init.o
-lwl-$(CONFIG_AT91SAM9263_LWL) += at91sam9263_lowlevel_init.o
 lwl-$(CONFIG_AT91SAM9G45_LWL) += at91sam9g45_lowlevel_init.o
 lwl-$(CONFIG_AT91SAM9N12_LWL) += at91sam9n12_lowlevel_init.o
 lwl-$(CONFIG_AT91RM9200_LWL) += at91rm9200_lowlevel_init.o
arch/arm/mach-at91/at91sam9263_lowlevel_init.c deleted +0 -48

48 lines not on this page · raw message

Signature · 7 lines
2.12.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#15 lore raw

PATCH v2 15/23 sama5d{3, 4}{xek, xplained}: move reset vector to board code

In reply to Sam Ravnborg

Include deletion of now unused sama5d3_lowlevel_init.c and related CONFIG symbols

---
 arch/arm/boards/sama5d3_xplained/Makefile          |  1 +
 .../sama5d3_xplained/lowlevel.c}                   | 10 ++++------
 arch/arm/boards/sama5d3xek/Makefile                |  1 +
 arch/arm/boards/sama5d3xek/lowlevel.c              | 23 ++++++++++++++++++++++
 arch/arm/boards/sama5d4_xplained/Makefile          |  1 +
 arch/arm/boards/sama5d4_xplained/lowlevel.c        | 23 ++++++++++++++++++++++
 arch/arm/boards/sama5d4ek/Makefile                 |  1 +
 arch/arm/boards/sama5d4ek/lowlevel.c               | 23 ++++++++++++++++++++++
 arch/arm/mach-at91/Kconfig                         |  8 --------
 arch/arm/mach-at91/Makefile                        |  2 --
 10 files changed, 77 insertions(+), 16 deletions(-)
 rename arch/arm/{mach-at91/sama5d3_lowlevel_init.c => boards/sama5d3_xplained/lowlevel.c} (86%)
 create mode 100644 arch/arm/boards/sama5d3xek/lowlevel.c
 create mode 100644 arch/arm/boards/sama5d4_xplained/lowlevel.c
 create mode 100644 arch/arm/boards/sama5d4ek/lowlevel.c
arch/arm/boards/sama5d3_xplained/Makefile +1 -0
index 3c301cb0c..fc6d83be8 100644
@@ -1,2 +1,3 @@
 obj-y += init.o
+lwl-y += lowlevel.o
 bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-sama5d3_xplained
arch/arm/boards/sama5d3_xplained/lowlevel.c renamed from arch/arm/mach-at91/sama5d3_lowlevel_init.c +4 -6
similarity index 86%
rename from arch/arm/mach-at91/sama5d3_lowlevel_init.c
rename to arch/arm/boards/sama5d3_xplained/lowlevel.c
index 01d28514d..161b473a7 100644
@@ -4,16 +4,14 @@
  * 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)
 {
arch/arm/boards/sama5d3xek/Makefile +1 -0
index 32dcb4283..6ed914fc0 100644
@@ -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
arch/arm/boards/sama5d3xek/lowlevel.c new file +23 -0
new file mode 100644
index 000000000..161b473a7
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * 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);
+}
arch/arm/boards/sama5d4_xplained/Makefile +1 -0
index 44550f528..8873dfc22 100644
@@ -1 +1,2 @@
 obj-y += sama5d4_xplained.o
+lwl-y += lowlevel.o
arch/arm/boards/sama5d4_xplained/lowlevel.c new file +23 -0
new file mode 100644
index 000000000..161b473a7
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * 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);
+}
arch/arm/boards/sama5d4ek/Makefile +1 -0
index 4363b3924..152750bbe 100644
@@ -1 +1,2 @@
 obj-y += sama5d4ek.o
+lwl-y += lowlevel.o
arch/arm/boards/sama5d4ek/lowlevel.c new file +23 -0
new file mode 100644
index 000000000..161b473a7
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * 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);
+}
arch/arm/mach-at91/Kconfig +0 -8
index 225b4735b..8122cf367 100644
@@ -43,10 +43,6 @@ config AT91SAM9N12_LWL
 	bool
 config AT91RM9200_LWL
 	bool
-config SAMA5D3_LWL
-	bool
-config SAMA5D4_LWL
-	bool
 
 config AT91SAM9_SMC
 	bool
@@ -506,13 +502,11 @@ choice
 
 config MACH_SAMA5D3XEK
 	bool "Atmel SAMA5D3X Evaluation Kit"
-	select SAMA5D3_LWL
 	help
 	  Select this if you are using Atmel's SAMA5D3X-EK Evaluation Kit.
 
 config MACH_SAMA5D3_XPLAINED
 	bool "Atmel SAMA5D3_XPLAINED Evaluation Kit"
-	select SAMA5D3_LWL
 	help
 	  Select this if you are using Atmel's SAMA5D3_XPLAINED Evaluation Kit.
 
@@ -529,13 +523,11 @@ choice
 
 config MACH_SAMA5D4EK
 	bool "Atmel SAMA5D4 Evaluation Kit"
-	select SAMA5D4_LWL
 	help
 	  Select this if you are using Atmel's SAMA5D4-EK Evaluation Kit.
 
 config MACH_SAMA5D4_XPLAINED
 	bool "Atmel SAMA5D4 XPLAINED ULTRA Evaluation Kit"
-	select SAMA5D4_LWL
 	help
 	  Select this if you are using Atmel's SAMA5D4_XPLAINED ULTRA Evaluation Kit.
 
arch/arm/mach-at91/Makefile +0 -2
index c044bfe26..bde9e898f 100644
@@ -12,8 +12,6 @@ lwl-$(CONFIG_AT91SAM9260_LWL) += at91sam9260_lowlevel_init.o
 lwl-$(CONFIG_AT91SAM9G45_LWL) += at91sam9g45_lowlevel_init.o
 lwl-$(CONFIG_AT91SAM9N12_LWL) += at91sam9n12_lowlevel_init.o
 lwl-$(CONFIG_AT91RM9200_LWL) += at91rm9200_lowlevel_init.o
-lwl-$(CONFIG_SAMA5D3_LWL) += sama5d3_lowlevel_init.o
-lwl-$(CONFIG_SAMA5D4_LWL) += sama5d3_lowlevel_init.o
 
 obj-$(CONFIG_AT91SAM9_RESET) += at91sam9_reset.o
 obj-$(CONFIG_AT91SAM9G45_RESET) += at91sam9g45_reset.o
Signature · 7 lines
2.12.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#16 lore raw

PATCH v2 16/23 at91sam{9260, 9G20, 9m10g45, 9n12}ek: move reset vector to board code

In reply to Sam Ravnborg

Include deletion of now unused at91sam9n12_lowlevel_init.c and related CONFIG symbols

---
 arch/arm/boards/at91sam9260ek/Makefile             |  1 +
 arch/arm/boards/at91sam9260ek/lowlevel.c           | 26 ++++++++++++++++++++++
 arch/arm/boards/at91sam9m10g45ek/Makefile          |  1 +
 arch/arm/boards/at91sam9m10g45ek/lowlevel.c        | 24 ++++++++++++++++++++
 arch/arm/boards/at91sam9n12ek/Makefile             |  1 +
 .../at91sam9n12ek/lowlevel.c}                      | 13 +++++------
 arch/arm/mach-at91/Kconfig                         |  6 -----
 arch/arm/mach-at91/Makefile                        |  1 -
 8 files changed, 58 insertions(+), 15 deletions(-)
 create mode 100644 arch/arm/boards/at91sam9260ek/lowlevel.c
 create mode 100644 arch/arm/boards/at91sam9m10g45ek/lowlevel.c
 rename arch/arm/{mach-at91/at91sam9n12_lowlevel_init.c => boards/at91sam9n12ek/lowlevel.c} (84%)
arch/arm/boards/at91sam9260ek/Makefile +1 -0
index 6e07f189f..9225ba08b 100644
@@ -1,2 +1,3 @@
 obj-y += init.o
+lwl-y += lowlevel.o
 bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9260ek
arch/arm/boards/at91sam9260ek/lowlevel.c new file +26 -0
new file mode 100644
index 000000000..02896856d
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * 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);
+}
arch/arm/boards/at91sam9m10g45ek/Makefile +1 -0
index dd8052157..8a7f2fdbb 100644
@@ -1,2 +1,3 @@
 obj-y += init.o
+lwl-y += lowlevel.o
 bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9m10g45ek
arch/arm/boards/at91sam9m10g45ek/lowlevel.c new file +24 -0
new file mode 100644
index 000000000..9be195837
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * Under GPLv2
+  */
+
+#include <common.h>
+#include <init.h>
+
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+#include <mach/hardware.h>
+#include <mach/at91sam9_ddrsdr.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);
+}
arch/arm/boards/at91sam9n12ek/Makefile +1 -0
index f5d125a0e..f42fbb979 100644
@@ -1,2 +1,3 @@
 obj-y += init.o
+lwl-y += lowlevel.o
 bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9n12ek
arch/arm/boards/at91sam9n12ek/lowlevel.c renamed from arch/arm/mach-at91/at91sam9n12_lowlevel_init.c +5 -8
similarity index 84%
rename from arch/arm/mach-at91/at91sam9n12_lowlevel_init.c
rename to arch/arm/boards/at91sam9n12ek/lowlevel.c
index 2b5cb158b..3c5234eb5 100644
@@ -4,17 +4,14 @@
  * 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)
 {
arch/arm/mach-at91/Kconfig +0 -6
index 8122cf367..cf59f0ce4 100644
@@ -39,8 +39,6 @@ config AT91SAM9260_LWL
 	bool
 config AT91SAM9G45_LWL
 	bool
-config AT91SAM9N12_LWL
-	bool
 config AT91RM9200_LWL
 	bool
 
@@ -268,7 +266,6 @@ config MACH_ANIMEO_IP
 config MACH_AT91SAM9260EK
 	bool "Atmel AT91SAM9260-EK"
 	select HAVE_NAND_ATMEL_BUSWIDTH_16
-	select AT91SAM9260_LWL
 	help
 	  Say y here if you are using Atmel's AT91SAM9260-EK Evaluation board
 
@@ -360,7 +357,6 @@ choice
 config MACH_AT91SAM9G20EK
 	bool "Atmel AT91SAM9G20-EK Evaluation Kit"
 	select HAVE_NAND_ATMEL_BUSWIDTH_16
-	select AT91SAM9260_LWL
 	help
 	  Select this if you are using Atmel's AT91SAM9G20-EK Evaluation Kit
 	  that embeds only one SD/MMC slot.
@@ -460,7 +456,6 @@ config MACH_AT91SAM9M10IHD
 config MACH_AT91SAM9M10G45EK
 	bool "Atmel AT91SAM9M10G45-EK Evaluation Kit"
 	select HAVE_NAND_ATMEL_BUSWIDTH_16
-	select AT91SAM9G45_LWL
 	help
 	  Select this if you are using Atmel's AT91SAM9M10G45-EK Evaluation Kit
 	  or AT91SAM9G45-EKES or AT91SAM9M10-EKES (for those 2 select the LG LCD)
@@ -485,7 +480,6 @@ choice
 
 config MACH_AT91SAM9N12EK
 	bool "Atmel AT91SAM9N12 Evaluation Kit"
-	select AT91SAM9N12_LWL
 	help
 	  Select this if you are using Atmel's AT91SAM9N12-EK Evaluation Kit.
 
arch/arm/mach-at91/Makefile +0 -1
index bde9e898f..89a88bf03 100644
@@ -10,7 +10,6 @@ obj-$(CONFIG_AT91_BOOTSTRAP) += bootstrap.o
 
 lwl-$(CONFIG_AT91SAM9260_LWL) += at91sam9260_lowlevel_init.o
 lwl-$(CONFIG_AT91SAM9G45_LWL) += at91sam9g45_lowlevel_init.o
-lwl-$(CONFIG_AT91SAM9N12_LWL) += at91sam9n12_lowlevel_init.o
 lwl-$(CONFIG_AT91RM9200_LWL) += at91rm9200_lowlevel_init.o
 
 obj-$(CONFIG_AT91SAM9_RESET) += at91sam9_reset.o
Signature · 7 lines
2.12.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#17 lore raw

PATCH v2 17/23 at91rm9200ek: move reset vector to board code

In reply to Sam Ravnborg

Include deletion of now unused at91rm9200_lowlevel_init.c and related CONFIG symbols

---
 arch/arm/boards/at91rm9200ek/Makefile                    |  1 +
 .../at91rm9200ek/lowlevel.c}                             | 16 ++++++++--------
 arch/arm/mach-at91/Kconfig                               |  3 ---
 arch/arm/mach-at91/Makefile                              |  1 -
 4 files changed, 9 insertions(+), 12 deletions(-)
 rename arch/arm/{mach-at91/at91rm9200_lowlevel_init.c => boards/at91rm9200ek/lowlevel.c} (97%)
arch/arm/boards/at91rm9200ek/Makefile +1 -0
index dec1c5045..b2d865e5d 100644
@@ -1,2 +1,3 @@
 obj-y += init.o
+lwl-y += lowlevel.o
 bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91rm9200ek
arch/arm/boards/at91rm9200ek/lowlevel.c renamed from arch/arm/mach-at91/at91rm9200_lowlevel_init.c +8 -8
similarity index 97%
rename from arch/arm/mach-at91/at91rm9200_lowlevel_init.c
rename to arch/arm/boards/at91rm9200ek/lowlevel.c
index f78e36808..d96ef5a6d 100644
@@ -4,19 +4,19 @@
  * 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>
+//#include <mach/io.h>
+//#include <init.h>
 
 void static inline access_sdram(void)
 {
arch/arm/mach-at91/Kconfig +0 -3
index cf59f0ce4..14cfa4759 100644
@@ -39,8 +39,6 @@ config AT91SAM9260_LWL
 	bool
 config AT91SAM9G45_LWL
 	bool
-config AT91RM9200_LWL
-	bool
 
 config AT91SAM9_SMC
 	bool
@@ -243,7 +241,6 @@ choice
 config MACH_AT91RM9200EK
 	bool "Atmel AT91RM9200-EK Evaluation Kit"
 	select HAVE_AT91_DATAFLASH_CARD
-	select AT91RM9200_LWL
 	help
 	  Select this if you are using Atmel's AT91RM9200-EK Evaluation Kit.
 	  <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3507>
arch/arm/mach-at91/Makefile +0 -1
index 89a88bf03..b853d9f02 100644
@@ -10,7 +10,6 @@ obj-$(CONFIG_AT91_BOOTSTRAP) += bootstrap.o
 
 lwl-$(CONFIG_AT91SAM9260_LWL) += at91sam9260_lowlevel_init.o
 lwl-$(CONFIG_AT91SAM9G45_LWL) += at91sam9g45_lowlevel_init.o
-lwl-$(CONFIG_AT91RM9200_LWL) += at91rm9200_lowlevel_init.o
 
 obj-$(CONFIG_AT91SAM9_RESET) += at91sam9_reset.o
 obj-$(CONFIG_AT91SAM9G45_RESET) += at91sam9g45_reset.o
Signature · 7 lines
2.12.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#18 lore raw

PATCH v2 18/23 at91sam9m10ihd: move reset vector to board code

In reply to Sam Ravnborg
---
 arch/arm/boards/at91sam9m10ihd/Makefile   |  2 ++
 arch/arm/boards/at91sam9m10ihd/lowlevel.c | 25 +++++++++++++++++++++++++
 arch/arm/mach-at91/Kconfig                |  1 -
 3 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boards/at91sam9m10ihd/lowlevel.c
arch/arm/boards/at91sam9m10ihd/Makefile +2 -0
index f2acf201b..741fd861b 100644
@@ -1,2 +1,4 @@
 obj-y += init.o
 obj-y += hw_version.o
+lwl-y += lowlevel.o
+
arch/arm/boards/at91sam9m10ihd/lowlevel.c new file +25 -0
new file mode 100644
index 000000000..624f7e800
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * 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/at91sam9g45.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);
+}
arch/arm/mach-at91/Kconfig +0 -1
index 14cfa4759..4ce4e6078 100644
@@ -446,7 +446,6 @@ choice
 
 config MACH_AT91SAM9M10IHD
 	bool "Atmel AT91SAM9M10IDH Tablet"
-	select AT91SAM9G45_LWL
 	help
 	  Select this if you are using Atmel's AT91SAM9M10IHD Tablet
 
Signature · 7 lines
2.12.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#19 lore raw

PATCH v2 19/23 pm9g45: move reset vector to board code

In reply to Sam Ravnborg

Include deletion of now unused at91sam9g45_lowlevel_init.c and related CONFIG symbols

---
 arch/arm/boards/pm9g45/Makefile                             |  1 +
 .../pm9g45/lowlevel.c}                                      | 13 +++++--------
 arch/arm/mach-at91/Kconfig                                  |  3 ---
 arch/arm/mach-at91/Makefile                                 |  1 -
 4 files changed, 6 insertions(+), 12 deletions(-)
 rename arch/arm/{mach-at91/at91sam9g45_lowlevel_init.c => boards/pm9g45/lowlevel.c} (84%)
arch/arm/boards/pm9g45/Makefile +1 -0
index d81b1881b..bd47d837b 100644
@@ -1,2 +1,3 @@
 obj-y += init.o
+lwl-y += lowlevel.o
 bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-pm9g45
arch/arm/boards/pm9g45/lowlevel.c renamed from arch/arm/mach-at91/at91sam9g45_lowlevel_init.c +5 -8
similarity index 84%
rename from arch/arm/mach-at91/at91sam9g45_lowlevel_init.c
rename to arch/arm/boards/pm9g45/lowlevel.c
index 2cdb7a6a5..182b9ea7d 100644
@@ -4,17 +4,14 @@
  * 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)
 {
arch/arm/mach-at91/Kconfig +0 -3
index 4ce4e6078..bae049726 100644
@@ -37,8 +37,6 @@ config HAVE_AT91_BOOTSTRAP
 # as implemented in the *lowlevel_init.c files
 config AT91SAM9260_LWL
 	bool
-config AT91SAM9G45_LWL
-	bool
 
 config AT91SAM9_SMC
 	bool
@@ -459,7 +457,6 @@ config MACH_AT91SAM9M10G45EK
 
 config MACH_PM9G45
 	bool "Ronetix PM9G45"
-	select AT91SAM9G45_LWL
 	help
 	  Say y here if you are using the Ronetix PM9G45 Board
 
arch/arm/mach-at91/Makefile +0 -1
index b853d9f02..af41802cf 100644
@@ -9,7 +9,6 @@ obj-$(CONFIG_CMD_AT91_BOOT_TEST) += boot_test_cmd.o
 obj-$(CONFIG_AT91_BOOTSTRAP) += bootstrap.o
 
 lwl-$(CONFIG_AT91SAM9260_LWL) += at91sam9260_lowlevel_init.o
-lwl-$(CONFIG_AT91SAM9G45_LWL) += at91sam9g45_lowlevel_init.o
 
 obj-$(CONFIG_AT91SAM9_RESET) += at91sam9_reset.o
 obj-$(CONFIG_AT91SAM9G45_RESET) += at91sam9g45_reset.o
Signature · 7 lines
2.12.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#20 lore raw

PATCH v2 20/23 animeo: move reset vector to board code

In reply to Sam Ravnborg
---
 arch/arm/boards/animeo_ip/Makefile   |  1 +
 arch/arm/boards/animeo_ip/lowlevel.c | 26 ++++++++++++++++++++++++++
 arch/arm/mach-at91/Kconfig           |  1 -
 3 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boards/animeo_ip/lowlevel.c
arch/arm/boards/animeo_ip/Makefile +1 -0
index 510b142ff..eef5879cb 100644
@@ -1,2 +1,3 @@
 obj-y += init.o
+lwl-y += lowlevel.o
 bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-animeo_ip
arch/arm/boards/animeo_ip/lowlevel.c new file +26 -0
new file mode 100644
index 000000000..02896856d
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * 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);
+}
arch/arm/mach-at91/Kconfig +0 -1
index bae049726..abbf9d4a1 100644
@@ -256,7 +256,6 @@ choice
 
 config MACH_ANIMEO_IP
 	bool "Somfy Animeo IP"
-	select AT91SAM9260_LWL
 
 config MACH_AT91SAM9260EK
 	bool "Atmel AT91SAM9260-EK"
Signature · 7 lines
2.12.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#21 lore raw

PATCH v2 21/23 dss11: move reset vector to board code

In reply to Sam Ravnborg
---
 arch/arm/boards/dss11/Makefile   |  1 +
 arch/arm/boards/dss11/lowlevel.c | 26 ++++++++++++++++++++++++++
 arch/arm/mach-at91/Kconfig       |  1 -
 3 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boards/dss11/lowlevel.c
arch/arm/boards/dss11/Makefile +1 -0
index eb072c016..2da0494d4 100644
@@ -1 +1,2 @@
 obj-y += init.o
+lwl-y += lowlevel.o
arch/arm/boards/dss11/lowlevel.c new file +26 -0
new file mode 100644
index 000000000..02896856d
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * 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);
+}
arch/arm/mach-at91/Kconfig +0 -1
index abbf9d4a1..73be26749 100644
@@ -372,7 +372,6 @@ config MACH_USB_A9G20
 config MACH_DSS11
 	bool "aizo dSS11"
 	select HAVE_NAND_ATMEL_BUSWIDTH_16
-	select AT91SAM9260_LWL
 	help
 	  Select this if you are using aizo dSS11
 	  that embeds only one SD/MMC slot.
Signature · 7 lines
2.12.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#22 lore raw

PATCH v2 22/23 telit-evk-pro3: move reset vector to board code

In reply to Sam Ravnborg
---
 arch/arm/boards/telit-evk-pro3/Makefile   |  1 +
 arch/arm/boards/telit-evk-pro3/lowlevel.c | 26 ++++++++++++++++++++++++++
 arch/arm/mach-at91/Kconfig                |  1 -
 3 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boards/telit-evk-pro3/lowlevel.c
arch/arm/boards/telit-evk-pro3/Makefile +1 -0
index eb072c016..2da0494d4 100644
@@ -1 +1,2 @@
 obj-y += init.o
+lwl-y += lowlevel.o
arch/arm/boards/telit-evk-pro3/lowlevel.c new file +26 -0
new file mode 100644
index 000000000..02896856d
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * 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);
+}
arch/arm/mach-at91/Kconfig +0 -1
index 73be26749..323287e6f 100644
@@ -285,7 +285,6 @@ config MACH_USB_A9260
 
 config MACH_GE863
 	bool "Telit EVK-PRO3"
-	select AT91SAM9260_LWL
 	help
 	  Say y here if you are using Telit EVK-PRO3 with GE863-PRO3
 	  <http://www.telit.com>
Signature · 7 lines
2.12.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#23 lore raw

PATCH v2 23/23 at91: remove leftovers from reset code in mach-at91

In reply to Sam Ravnborg
---
 arch/arm/mach-at91/Kconfig                         |  5 ---
 arch/arm/mach-at91/Makefile                        |  2 -
 arch/arm/mach-at91/at91sam9260_lowlevel_init.c     | 48 ----------------------
 .../mach-at91/include/mach/at91_lowlevel_init.h    | 46 ---------------------
 4 files changed, 101 deletions(-)
 delete mode 100644 arch/arm/mach-at91/at91sam9260_lowlevel_init.c
 delete mode 100644 arch/arm/mach-at91/include/mach/at91_lowlevel_init.h
arch/arm/mach-at91/Kconfig +0 -5
index 323287e6f..17e432fea 100644
@@ -33,11 +33,6 @@ config HAVE_AT91_GENERATED_CLK
 config HAVE_AT91_BOOTSTRAP
 	bool
 
-# Select if board uses barebox reset vector from mach-at91
-# as implemented in the *lowlevel_init.c files
-config AT91SAM9260_LWL
-	bool
-
 config AT91SAM9_SMC
 	bool
 
arch/arm/mach-at91/Makefile +0 -2
index af41802cf..a5e839248 100644
@@ -8,8 +8,6 @@ obj-$(CONFIG_CMD_AT91_BOOT_TEST) += boot_test_cmd.o
 
 obj-$(CONFIG_AT91_BOOTSTRAP) += bootstrap.o
 
-lwl-$(CONFIG_AT91SAM9260_LWL) += at91sam9260_lowlevel_init.o
-
 obj-$(CONFIG_AT91SAM9_RESET) += at91sam9_reset.o
 obj-$(CONFIG_AT91SAM9G45_RESET) += at91sam9g45_reset.o
 
arch/arm/mach-at91/at91sam9260_lowlevel_init.c deleted +0 -48

48 lines not on this page · raw message

arch/arm/mach-at91/include/mach/at91_lowlevel_init.h deleted +0 -46

46 lines not on this page · raw message

Signature · 7 lines
2.12.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#24 lore raw
In reply to Sam Ravnborg

Hi Sam,

Am Freitag, den 07.07.2017, 14:10 +0200 schrieb Sam Ravnborg:

Quoted 18 lines

The following patchset moves the reset vector for at91 boards from mach-at91 to board code. This is similar to what other boards do and is done to prepare for multi-image and DT support.

The patchset convert all boards and thus clean up the old code that resided in mach-at91/

The first patch have minimal impact, but prepares for a board-by-board conversion.
All temporary CONFIG symbols are gone at the end of this series.

I kept Jean-Christophe PLAGNIOL-VILLARD and others copyright in all the created files and did not add copyright myself. The patchset does IMO not add any copyrightable material from my side as this is in reality just moving around code.

Quoted 7 lines

The patchset was successfully booted on a AT91SAM9263EK, and all defconfigs was built (expect the ones that failed to build before this patchset was applied).

Changes v1 => v2
- converted all boards over
- fixed author info

Just to let you know the current status here: While I think you are on the right track with this, I'm currently lacking the bandwidth to properly review this series. I'm a bit hesitant to just throw it into -next without any kind of review, so I'm still hoping for others to take a look.

Regards,
Lucas

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#25 lore raw

Hi Lucas.

Quoted 6 lines

Just to let you know the current status here: While I think you are on the right track with this, I'm currently lacking the bandwidth to properly review this series. I'm a bit hesitant to just throw it into -next without any kind of review, so I'm still hoping for others to take a look.

Thanks for the heads-up.
Review is a must as I am in unknown land here.
The most important part is if the apporach is correct or not.

I have continued with the effort to DT enable the at91sam9263ek board and have a barebox that boots using DT now with most stuff working.

atmel_lcdfb did not support DT which I have added. All other drivers worked more or less out-of-the-box.

In the process there have been a few cleanups and fixes and I will post the patches after some more testing.

Not everything is working yet:
- the NAND cannot read BBT (NAND is properly identified)
- environment load /dev/env0 fails (maybe related to the above)
- no kernel booted yet
- bootstrap not tested (will provide a defconfig if I get it working)
- network is not yet tested

I expect to work on the above list and hold back patches until everything is working. That will take a few days.

If everything goes like for the other challenges I will run to the other side of the forest to pick up a small splinter of wood in my effort to find a fix. Which is OK as this is part of the fun :-)

Sam

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox