mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: barebox@lists.infradead.org
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Subject: [PATCH 02/45] at91sam9x5ek: Convert to mult-image build
Date: Mon,  6 Mar 2017 14:53:13 -0800	[thread overview]
Message-ID: <20170306225356.31475-3-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <20170306225356.31475-1-andrew.smirnov@gmail.com>

Convert AT91SAM9X5-EK board code to multi-image build process, similar
to how majority of i.MX board code is built.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/Kconfig                        |  1 -
 arch/arm/boards/at91sam9x5ek/Makefile   |  1 +
 arch/arm/boards/at91sam9x5ek/lowlevel.c | 16 +++++++++++++
 arch/arm/configs/at91sam9x5ek_defconfig |  4 +++-
 arch/arm/mach-at91/Kconfig              | 40 +++++++++++++++++++--------------
 images/Makefile                         |  1 +
 images/Makefile.at91                    |  7 ++++++
 7 files changed, 51 insertions(+), 19 deletions(-)
 create mode 100644 arch/arm/boards/at91sam9x5ek/lowlevel.c
 create mode 100644 images/Makefile.at91

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index e4663ea..cfa9214 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -52,7 +52,6 @@ config ARCH_AT91
 	select GPIOLIB
 	select CLKDEV_LOOKUP
 	select HAS_DEBUG_LL
-	select HAVE_MACH_ARM_HEAD
 	select HAVE_CLK
 	select PINCTRL_AT91
 
diff --git a/arch/arm/boards/at91sam9x5ek/Makefile b/arch/arm/boards/at91sam9x5ek/Makefile
index 559df8f..4939b7e 100644
--- a/arch/arm/boards/at91sam9x5ek/Makefile
+++ b/arch/arm/boards/at91sam9x5ek/Makefile
@@ -1,3 +1,4 @@
 obj-y += init.o
 obj-y += hw_version.o
 bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9x5ek
+lwl-y += lowlevel.o
diff --git a/arch/arm/boards/at91sam9x5ek/lowlevel.c b/arch/arm/boards/at91sam9x5ek/lowlevel.c
new file mode 100644
index 0000000..9b5c926
--- /dev/null
+++ b/arch/arm/boards/at91sam9x5ek/lowlevel.c
@@ -0,0 +1,16 @@
+#include <common.h>
+#include <linux/sizes.h>
+#include <mach/at91sam9_ddrsdr.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <io.h>
+#include <debug_ll.h>
+
+
+ENTRY_FUNCTION(start_at91sam9x5ek, r0, r1, r2)
+{
+	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);
+}
diff --git a/arch/arm/configs/at91sam9x5ek_defconfig b/arch/arm/configs/at91sam9x5ek_defconfig
index 6ee0052..76ee3d9 100644
--- a/arch/arm/configs/at91sam9x5ek_defconfig
+++ b/arch/arm/configs/at91sam9x5ek_defconfig
@@ -1,12 +1,14 @@
 CONFIG_ARCH_AT91SAM9X5=y
+CONFIG_AT91_MULTI_BOARDS=y
+CONFIG_MACH_AT91SAM9X5EK=y
 CONFIG_BAREBOX_MAX_IMAGE_SIZE=0x40000
 CONFIG_AEABI=y
 CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
-CONFIG_PBL_IMAGE=y
 CONFIG_MMU=y
 CONFIG_MALLOC_SIZE=0xa00000
 CONFIG_EXPERIMENTAL=y
 CONFIG_MALLOC_TLSF=y
+CONFIG_RELOCATABLE=y
 CONFIG_PROMPT="9G20-EK:"
 CONFIG_GLOB=y
 CONFIG_PROMPT_HUSH_PS2="y"
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index c45fc4d..969182c 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -143,18 +143,22 @@ config ARCH_AT91SAM9261
 config ARCH_AT91SAM9263
 	bool "AT91SAM9263"
 	select SOC_AT91SAM9263
+	select HAVE_MACH_ARM_HEAD
 
 config ARCH_AT91SAM9G10
 	bool "AT91SAM9G10"
 	select SOC_AT91SAM9261
+	select HAVE_MACH_ARM_HEAD
 
 config ARCH_AT91SAM9G20
 	bool "AT91SAM9G20"
 	select SOC_AT91SAM9260
+	select HAVE_MACH_ARM_HEAD
 
 config ARCH_AT91SAM9G45
 	bool "AT91SAM9G45 or AT91SAM9M10"
 	select SOC_AT91SAM9G45
+	select HAVE_MACH_ARM_HEAD
 
 config ARCH_AT91SAM9X5
 	bool "AT91SAM9X5"
@@ -163,6 +167,7 @@ config ARCH_AT91SAM9X5
 config ARCH_AT91SAM9N12
 	bool "AT91SAM9N12"
 	select SOC_AT91SAM9N12
+	select HAVE_MACH_ARM_HEAD
 
 config ARCH_SAMA5D3
 	bool "SAMA5D3x"
@@ -170,6 +175,7 @@ config ARCH_SAMA5D3
 	select HAVE_AT91_DBGU1
 	select HAS_MACB
 	select AT91SAM9G45_RESET
+	select HAVE_MACH_ARM_HEAD
 
 config ARCH_SAMA5D4
 	bool "SAMA5D4"
@@ -177,6 +183,7 @@ config ARCH_SAMA5D4
 	select HAVE_AT91_DBGU2
 	select HAS_MACB
 	select AT91SAM9G45_RESET
+	select HAVE_MACH_ARM_HEAD
 
 endchoice
 
@@ -432,23 +439,6 @@ endif
 
 # ----------------------------------------------------------
 
-if ARCH_AT91SAM9X5
-
-choice
-	prompt "AT91SAM9x5 Series Board Type"
-
-config MACH_AT91SAM9X5EK
-	bool "Atmel AT91SAM9x5 Series Evaluation Kit"
-	help
-	  Select this if you re using Atmel's AT91SAM9x5-EK Evaluation Kit.
-	  Supported chips are sam9g15, sam9g25, sam9x25, sam9g35 and sam9x35.
-
-endchoice
-
-endif
-
-# ----------------------------------------------------------
-
 if ARCH_AT91SAM9N12
 
 choice
@@ -507,6 +497,22 @@ endif
 
 # ----------------------------------------------------------
 
+
+config AT91_MULTI_BOARDS
+	bool "Allow multiple boards to be selected"
+	select HAVE_PBL_MULTI_IMAGES
+
+if AT91_MULTI_BOARDS
+
+config MACH_AT91SAM9X5EK
+	bool "Atmel AT91SAM9x5 Series Evaluation Kit"
+	depends on ARCH_AT91SAM9X5
+	help
+	  Select this if you re using Atmel's AT91SAM9x5-EK Evaluation Kit.
+	  Supported chips are sam9g15, sam9g25, sam9x25, sam9g35 and sam9x35.
+
+endif
+
 comment "AT91 Board Options"
 
 config MTD_AT91_DATAFLASH_CARD
diff --git a/images/Makefile b/images/Makefile
index 0537af1..2e84ba7 100644
--- a/images/Makefile
+++ b/images/Makefile
@@ -110,6 +110,7 @@ include $(srctree)/images/Makefile.omap3
 include $(srctree)/images/Makefile.rockchip
 include $(srctree)/images/Makefile.socfpga
 include $(srctree)/images/Makefile.tegra
+include $(srctree)/images/Makefile.at91
 
 targets += $(image-y) pbl.lds barebox.x barebox.z
 targets += $(patsubst %,%.pblx,$(pblx-y))
diff --git a/images/Makefile.at91 b/images/Makefile.at91
new file mode 100644
index 0000000..0f40a05
--- /dev/null
+++ b/images/Makefile.at91
@@ -0,0 +1,7 @@
+#
+# barebox image generation Makefile for AT91 images
+#
+
+pblx-y += start_at91sam9x5ek
+FILE_barebox-at91sam9x5ek.img = start_at91sam9x5ek.pblx
+image-y += barebox-at91sam9x5ek.img
-- 
2.9.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2017-03-06 22:54 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-06 22:53 [PATCH 00/45] AT91, at91sam9x5ek updates Andrey Smirnov
2017-03-06 22:53 ` [PATCH 01/45] at91: Fix bug/typo in debug_ll.h Andrey Smirnov
2017-03-06 22:53 ` Andrey Smirnov [this message]
2017-03-06 22:53 ` [PATCH 03/45] at91sam9x5ek: Add CONFIG_KALLSYMS to defconfig Andrey Smirnov
2017-03-06 22:53 ` [PATCH 04/45] at91sam9x5ek: Add preliminary device tree support Andrey Smirnov
2017-03-06 22:53 ` [PATCH 05/45] clocksource: at91: Move to 'drivers/clocksource' Andrey Smirnov
2017-03-06 22:53 ` [PATCH 06/45] clocksource: at91: Add DT compatibility table Andrey Smirnov
2017-03-06 22:53 ` [PATCH 07/45] serial: atmel: Check result of clk_get() Andrey Smirnov
2017-03-07  7:46   ` Sascha Hauer
2017-03-06 22:53 ` [PATCH 08/45] serial: atmel: Add DT compatibility table Andrey Smirnov
2017-03-06 22:53 ` [PATCH 09/45] regmap: Implement syscon_node_to_regmap() Andrey Smirnov
2017-03-06 22:53 ` [PATCH 10/45] clk: Port two helper functions from Linux Andrey Smirnov
2017-03-06 22:53 ` [PATCH 11/45] clk: Make COMMON_CLK_OF_PROVIDER depend on OFTREE Andrey Smirnov
2017-03-06 22:53 ` [PATCH 12/45] clk: No-op CLK_OF_DECLARE if not enabled Andrey Smirnov
2017-03-06 22:53 ` [PATCH 13/45] clk: at91: Port at91 DT clock code Andrey Smirnov
2017-03-06 22:53 ` [PATCH 14/45] at91sam9x5ek: Convert to use DT clock tree Andrey Smirnov
2017-03-06 22:53 ` [PATCH 15/45] at91sam9x5ek: Remove at91sam9x5ek_mem_init() Andrey Smirnov
2017-03-06 22:53 ` [PATCH 16/45] at91sam9x5ek: Configure LEDs in DT Andrey Smirnov
2017-03-06 22:53 ` [PATCH 17/45] pinctrl-at91: Fix a bug in at91_pinctrl_set_conf() Andrey Smirnov
2017-03-06 22:53 ` [PATCH 18/45] at91: Enable PINCTRL for SOC_AT91SAM9 Andrey Smirnov
2017-03-06 22:53 ` [PATCH 19/45] at91sam9x5ek: Configure I2C via DT Andrey Smirnov
2017-03-06 22:53 ` [PATCH 20/45] mci: Allow parsing for explicit DT node Andrey Smirnov
2017-03-06 22:53 ` [PATCH 21/45] mci: atmel_mci: Add DT support Andrey Smirnov
2017-03-06 22:53 ` [PATCH 22/45] at91sam9x5ek: Configure MMC in DT Andrey Smirnov
2017-03-06 22:53 ` [PATCH 23/45] of: base: Use scoring in DT device matching Andrey Smirnov
2017-03-06 22:53 ` [PATCH 24/45] pinctrl: at91: Fix a bug in at91_pinctrl_set_state Andrey Smirnov
2017-03-06 22:53 ` [PATCH 25/45] pinctrl: at91: Implement .get_direction hook Andrey Smirnov
2017-03-06 22:53 ` [PATCH 26/45] spi: atmel_spi: Add DT support Andrey Smirnov
2017-03-06 22:53 ` [PATCH 27/45] spi: atmel_spi: Configure CS GPIO as output Andrey Smirnov
2017-03-06 22:53 ` [PATCH 28/45] spi: atmel_spi: Use VERSION register instead of CPU type Andrey Smirnov
2017-03-06 22:53 ` [PATCH 29/45] at91sam9x5ek: Configure SPI in DT Andrey Smirnov
2017-03-06 22:53 ` [PATCH 30/45] w1-gpio: Add DT support Andrey Smirnov
2017-03-06 22:53 ` [PATCH 31/45] at91sam9x5ek: Configure 1-wire in DT Andrey Smirnov
2017-03-06 22:53 ` [PATCH 32/45] usb: ohci-at91: Check result of clk_get() Andrey Smirnov
2017-03-07 16:35   ` Sam Ravnborg
2017-03-07 21:21     ` Andrey Smirnov
2017-03-07 21:52       ` Sam Ravnborg
2017-03-06 22:53 ` [PATCH 33/45] usb: ohci-at91: Convert global variables to private data Andrey Smirnov
2017-03-06 22:53 ` [PATCH 34/45] usb: ohci-at91: Check result of clk_enable() Andrey Smirnov
2017-03-06 22:53 ` [PATCH 35/45] usb: ohci-at91: Add DT support Andrey Smirnov
2017-03-07 16:40   ` Sam Ravnborg
2017-03-06 22:53 ` [PATCH 36/45] usb/host: Allow USB_OHCI_AT91 even if USB_OHCI is disabled Andrey Smirnov
2017-03-06 22:53 ` [PATCH 37/45] usb: ehci-atmel: Check result of clk_enable() Andrey Smirnov
2017-03-06 22:53 ` [PATCH 38/45] usb: echi-atmel: Convert global variables to private data Andrey Smirnov
2017-03-06 22:53 ` [PATCH 39/45] usb: ehci-atmel: Zero ehci_data before using it Andrey Smirnov
2017-03-06 22:53 ` [PATCH 40/45] usb: echi-atmel: Check result of ehci_register() Andrey Smirnov
2017-03-06 22:53 ` [PATCH 41/45] usb: echi-atmel: Add DT support Andrey Smirnov
2017-03-06 22:53 ` [PATCH 42/45] at91sam9x5ek: Configure USB in DT Andrey Smirnov
2017-03-06 22:53 ` [PATCH 43/45] net: macb: Add DT support Andrey Smirnov
2017-03-06 22:53 ` [PATCH 44/45] at91sam9x5ek: Configure Ethernet in DT Andrey Smirnov
2017-03-06 22:53 ` [PATCH 45/45] at91sam9x5ek: Configure NAND " Andrey Smirnov
2017-03-07  8:13 ` [PATCH 00/45] AT91, at91sam9x5ek updates Sascha Hauer
2017-03-07 21:09   ` Andrey Smirnov
2017-03-07 16:34 ` Sam Ravnborg
2017-03-07 16:56   ` Jean-Christophe PLAGNIOL-VILLARD
2017-03-07 20:58     ` Sam Ravnborg
2017-03-07 21:18       ` Andrey Smirnov
2017-03-07 21:47         ` Jean-Christophe PLAGNIOL-VILLARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170306225356.31475-3-andrew.smirnov@gmail.com \
    --to=andrew.smirnov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox