* [PATCH v5 01/22] at91: mmccpu: remove board support for mmccpu
2018-01-06 21:04 [PATCH v5 0/22] at91: move reset vector to board code Sam Ravnborg
@ 2018-01-06 21:10 ` Sam Ravnborg
2018-01-06 21:10 ` [PATCH v5 02/22] arm: at91: refactor lowlevel_init selection Sam Ravnborg
` (21 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Sam Ravnborg @ 2018-01-06 21:10 UTC (permalink / raw)
To: Barebox List; +Cc: Sam Ravnborg
Based on feedback from Sascha:
http://lists.infradead.org/pipermail/barebox/2018-January/031796.html
"
Let's just remove this board
instead of ventilating it any further.
"
Remove mmccpu board - and all references to this board.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
arch/arm/boards/Makefile | 1 -
arch/arm/boards/mmccpu/Makefile | 3 -
arch/arm/boards/mmccpu/env/bin/_update | 36 -------
arch/arm/boards/mmccpu/env/bin/boot | 47 ----------
arch/arm/boards/mmccpu/env/bin/init | 33 -------
arch/arm/boards/mmccpu/env/bin/update_kernel | 15 ---
arch/arm/boards/mmccpu/env/bin/update_root | 16 ----
arch/arm/boards/mmccpu/env/config | 30 ------
arch/arm/boards/mmccpu/init.c | 88 -----------------
arch/arm/boards/mmccpu/lowlevel_init.c | 135 ---------------------------
arch/arm/configs/mmccpu_defconfig | 37 --------
arch/arm/mach-at91/Kconfig | 5 -
12 files changed, 446 deletions(-)
delete mode 100644 arch/arm/boards/mmccpu/Makefile
delete mode 100644 arch/arm/boards/mmccpu/env/bin/_update
delete mode 100644 arch/arm/boards/mmccpu/env/bin/boot
delete mode 100644 arch/arm/boards/mmccpu/env/bin/init
delete mode 100644 arch/arm/boards/mmccpu/env/bin/update_kernel
delete mode 100644 arch/arm/boards/mmccpu/env/bin/update_root
delete mode 100644 arch/arm/boards/mmccpu/env/config
delete mode 100644 arch/arm/boards/mmccpu/init.c
delete mode 100644 arch/arm/boards/mmccpu/lowlevel_init.c
delete mode 100644 arch/arm/configs/mmccpu_defconfig
diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index 456e6fea4..ca187ccb8 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/mmccpu/Makefile b/arch/arm/boards/mmccpu/Makefile
deleted file mode 100644
index 1398c26a0..000000000
--- 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 014bce351..000000000
--- 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 533dea761..000000000
--- 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 ad9b65a76..000000000
--- 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 05c822d86..000000000
--- 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 a75137237..000000000
--- 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 5367cd9f5..000000000
--- 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 747c4b274..000000000
--- 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 c193eae58..000000000
--- 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/configs/mmccpu_defconfig b/arch/arm/configs/mmccpu_defconfig
deleted file mode 100644
index 8143b9862..000000000
--- 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/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 3b572ebdf..ee28c168b 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -405,11 +405,6 @@ config MACH_AT91SAM9263EK
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
--
2.12.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v5 02/22] arm: at91: refactor lowlevel_init selection
2018-01-06 21:04 [PATCH v5 0/22] at91: move reset vector to board code Sam Ravnborg
2018-01-06 21:10 ` [PATCH v5 01/22] at91: mmccpu: remove board support for mmccpu Sam Ravnborg
@ 2018-01-06 21:10 ` Sam Ravnborg
2018-01-06 21:10 ` [PATCH v5 03/22] arm: at91: drop unused at91sam9x5_lowlevel_init.c Sam Ravnborg
` (20 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Sam Ravnborg @ 2018-01-06 21:10 UTC (permalink / raw)
To: Barebox List; +Cc: Sam Ravnborg
The aim with this conversion is to drop the dependency
where the mach-at91/ code call code in the boards file.
This dependency must be dropepd to enable multi-image builds.
The selection of lowlevel_init functions are pushed to
the individual boards.
Use AT91SAM926X_BOARD_INIT for the boards that share the
at91sam926x_board_init file, and push this to the
individual boards. To be used in follow-up patches
bootstrap is likewise pushed out to the individual boards.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
arch/arm/boards/at91sam9261ek/Makefile | 2 +-
arch/arm/boards/at91sam9263ek/Makefile | 2 +-
arch/arm/boards/pm9261/Makefile | 2 +-
arch/arm/boards/pm9263/Makefile | 2 +-
arch/arm/boards/tny-a926x/Makefile | 6 +-
.../arm/boards/tny-a926x/tny_a9263_lowlevel_init.c | 1 +
arch/arm/boards/usb-a926x/Makefile | 6 +-
arch/arm/mach-at91/Kconfig | 86 ++++++++++++++++++----
arch/arm/mach-at91/Makefile | 26 +++----
.../mach-at91/include/mach/at91_lowlevel_init.h | 2 +-
10 files changed, 96 insertions(+), 39 deletions(-)
diff --git a/arch/arm/boards/at91sam9261ek/Makefile b/arch/arm/boards/at91sam9261ek/Makefile
index 1764da93f..667095ae4 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-$(CONFIG_AT91SAM926X_LWL) += lowlevel_init.o
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9261ek
diff --git a/arch/arm/boards/at91sam9263ek/Makefile b/arch/arm/boards/at91sam9263ek/Makefile
index 2072cd416..de4d75690 100644
--- a/arch/arm/boards/at91sam9263ek/Makefile
+++ b/arch/arm/boards/at91sam9263ek/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-at91sam9263ek
diff --git a/arch/arm/boards/pm9261/Makefile b/arch/arm/boards/pm9261/Makefile
index bff467b1d..e9bf1212f 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/pm9263/Makefile b/arch/arm/boards/pm9263/Makefile
index 1398c26a0..68bfbfa92 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/tny-a926x/Makefile b/arch/arm/boards/tny-a926x/Makefile
index dba2f8cfc..bebb197e4 100644
--- a/arch/arm/boards/tny-a926x/Makefile
+++ b/arch/arm/boards/tny-a926x/Makefile
@@ -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_AT91SAM926X_LWL) += tny_a9263_lowlevel_init.o
-lwl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += $(lowlevel_init-y)
bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-tny-a926x
diff --git a/arch/arm/boards/tny-a926x/tny_a9263_lowlevel_init.c b/arch/arm/boards/tny-a926x/tny_a9263_lowlevel_init.c
index 1b146da62..3b8b0a298 100644
--- a/arch/arm/boards/tny-a926x/tny_a9263_lowlevel_init.c
+++ b/arch/arm/boards/tny-a926x/tny_a9263_lowlevel_init.c
@@ -14,6 +14,7 @@
#include <mach/at91sam9_sdramc.h>
#include <mach/at91sam9_matrix.h>
#include <mach/at91_lowlevel_init.h>
+#include <mach/at91sam9263_matrix.h>
#define MASTER_CLOCK 180
diff --git a/arch/arm/boards/usb-a926x/Makefile b/arch/arm/boards/usb-a926x/Makefile
index 4f09581e3..a4eae1844 100644
--- a/arch/arm/boards/usb-a926x/Makefile
+++ b/arch/arm/boards/usb-a926x/Makefile
@@ -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
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index ee28c168b..3291293ad 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -29,7 +29,37 @@ 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
+
+# Select if 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
+ bool
+config AT91SAM9261_LWL
+ bool
+config AT91SAM9263_LWL
+ bool
+config AT91SAM9G45_LWL
+ bool
+config AT91SAM9X5_LWL
+ bool
+config AT91SAM9N12_LWL
+ bool
+config AT91RM9200_LWL
+ bool
+config SAMA5D3_LWL
+ bool
+config SAMA5D4_LWL
bool
config AT91SAM9_SMC
@@ -71,9 +101,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 +115,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 +124,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 +133,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
@@ -239,6 +263,7 @@ 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>
@@ -256,16 +281,19 @@ choice
config MACH_ANIMEO_IP
bool "Somfy Animeo IP"
+ select AT91SAM9260_LWL
depends on !CONSOLE_NONE
config MACH_AT91SAM9260EK
bool "Atmel AT91SAM9260-EK"
+ select AT91SAM9260_LWL
select HAVE_NAND_ATMEL_BUSWIDTH_16
help
Say y here if you are using Atmel's AT91SAM9260-EK Evaluation board
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>
@@ -273,6 +301,7 @@ 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>
@@ -280,12 +309,14 @@ 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>
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>
@@ -306,7 +337,9 @@ 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 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>
@@ -314,7 +347,9 @@ config MACH_AT91SAM9261EK
config MACH_PM9261
bool "Ronetix PM9261"
select HAS_DM9000
- select HAVE_AT91_LOWLEVEL_INIT
+ select HAVE_AT91_BOOTSTRAP
+ select AT91SAM9261_LWL
+ select AT91SAM926X_LWL
help
Say y here if you are using the Ronetix PM9261 Board
@@ -333,6 +368,7 @@ 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>
@@ -351,6 +387,7 @@ 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.
@@ -358,6 +395,7 @@ 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>
@@ -365,6 +403,7 @@ 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>
@@ -372,18 +411,21 @@ 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.
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>
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>
@@ -400,27 +442,37 @@ choice
config MACH_AT91SAM9263EK
bool "Atmel AT91SAM9263-EK"
- select HAVE_AT91_LOWLEVEL_INIT
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
config MACH_PM9263
bool "Ronetix PM9263"
- select HAVE_AT91_LOWLEVEL_INIT
+ select HAVE_AT91_BOOTSTRAP
+ select AT91SAM9263_LWL
+ select AT91SAM926X_LWL
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 AT91SAM9263_LWL
+ select AT91SAM926X_LWL
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 AT91SAM9263_LWL
+ select AT91SAM926X_LWL
help
Select this if you are using a Calao Systems USB-A9263.
<http://www.calao-systems.com>
@@ -436,12 +488,14 @@ choice
config MACH_AT91SAM9M10IHD
bool "Atmel AT91SAM9M10IDH Tablet"
+ select AT91SAM9G45_LWL
help
Select this if you are using Atmel's AT91SAM9M10IHD Tablet
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)
@@ -449,6 +503,7 @@ config MACH_AT91SAM9M10G45EK
config MACH_PM9G45
bool "Ronetix PM9G45"
+ select AT91SAM9G45_LWL
help
Say y here if you are using the Ronetix PM9G45 Board
@@ -465,6 +520,7 @@ 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.
@@ -481,11 +537,13 @@ 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.
@@ -502,11 +560,13 @@ 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.
@@ -591,7 +651,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 0892fb4b5..71851d26c 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -6,19 +6,19 @@ 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
+
+lwl-$(CONFIG_AT91SAM926X_LWL) += at91sam926x_lowlevel_init.o
+
+lwl-$(CONFIG_AT91RM9200_LWL) += at91rm9200_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_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
diff --git a/arch/arm/mach-at91/include/mach/at91_lowlevel_init.h b/arch/arm/mach-at91/include/mach/at91_lowlevel_init.h
index 6b37e49e9..d72dfff38 100644
--- a/arch/arm/mach-at91/include/mach/at91_lowlevel_init.h
+++ b/arch/arm/mach-at91/include/mach/at91_lowlevel_init.h
@@ -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
--
2.12.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v5 03/22] arm: at91: drop unused at91sam9x5_lowlevel_init.c
2018-01-06 21:04 [PATCH v5 0/22] at91: move reset vector to board code Sam Ravnborg
2018-01-06 21:10 ` [PATCH v5 01/22] at91: mmccpu: remove board support for mmccpu Sam Ravnborg
2018-01-06 21:10 ` [PATCH v5 02/22] arm: at91: refactor lowlevel_init selection Sam Ravnborg
@ 2018-01-06 21:10 ` Sam Ravnborg
2018-01-06 21:11 ` [PATCH v5 04/22] arm: at91: add at91sam926x_board_init.h Sam Ravnborg
` (19 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Sam Ravnborg @ 2018-01-06 21:10 UTC (permalink / raw)
To: Barebox List; +Cc: Sam Ravnborg
After refactoring of how we select lowlevel_init
it was apparent that at91sam9x5_lowlevel_init.c was no
longer used.
Delete the file and the now unused CONFIG symbol and it uses
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
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
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 3291293ad..234257eb9 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -51,8 +51,6 @@ config AT91SAM9263_LWL
bool
config AT91SAM9G45_LWL
bool
-config AT91SAM9X5_LWL
- bool
config AT91SAM9N12_LWL
bool
config AT91RM9200_LWL
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 71851d26c..66b83000a 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -15,7 +15,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_SAMA5D3_LWL) += sama5d3_lowlevel_init.o
lwl-$(CONFIG_SAMA5D4_LWL) += sama5d3_lowlevel_init.o
diff --git a/arch/arm/mach-at91/at91sam9x5_lowlevel_init.c b/arch/arm/mach-at91/at91sam9x5_lowlevel_init.c
deleted file mode 100644
index 48e69f947..000000000
--- a/arch/arm/mach-at91/at91sam9x5_lowlevel_init.c
+++ /dev/null
@@ -1,26 +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/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);
-}
--
2.12.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v5 04/22] arm: at91: add at91sam926x_board_init.h
2018-01-06 21:04 [PATCH v5 0/22] at91: move reset vector to board code Sam Ravnborg
` (2 preceding siblings ...)
2018-01-06 21:10 ` [PATCH v5 03/22] arm: at91: drop unused at91sam9x5_lowlevel_init.c Sam Ravnborg
@ 2018-01-06 21:11 ` Sam Ravnborg
2018-01-06 21:11 ` [PATCH v5 05/22] arm: at91: code cleanup in at91sam926x_board_init Sam Ravnborg
` (18 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Sam Ravnborg @ 2018-01-06 21:11 UTC (permalink / raw)
To: Barebox List; +Cc: Sam Ravnborg
To prepare moving reset code to board code create at91sam926x_board_init.h.
at91sam926x_board_init.h is a copy of at91sam926x_lowlevel_init.c
with a few changes:
- We no longer call board code from this function
- The struct is renamed to avoid name clashes
- Function renamed to better match the prurpose
This file allows board code to include at91sam926x_board_init.h
and use the init functions in their init code.
Users must select AT91SAM926X_BOARD_INIT
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
.../include/mach/at91sam926x_board_init.h | 222 +++++++++++++++++++++
1 file changed, 222 insertions(+)
create mode 100644 arch/arm/mach-at91/include/mach/at91sam926x_board_init.h
diff --git a/arch/arm/mach-at91/include/mach/at91sam926x_board_init.h b/arch/arm/mach-at91/include/mach/at91sam926x_board_init.h
new file mode 100644
index 000000000..54d67404c
--- /dev/null
+++ b/arch/arm/mach-at91/include/mach/at91sam926x_board_init.h
@@ -0,0 +1,222 @@
+#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
+ */
+
+#include <common.h>
+#include <init.h>
+
+#include <mach/at91sam9_sdramc.h>
+#include <mach/at91sam9_smc.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>
+
+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 __always_inline pmc_check_mckrdy(void)
+{
+ u32 r;
+
+ do {
+ r = at91_pmc_read(AT91_PMC_SR);
+ } while (!(r & AT91_PMC_MCKRDY));
+}
+
+static int __always_inline running_in_sram(void)
+{
+ u32 addr = get_pc();
+
+ addr >>= 28;
+ 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)
+
+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);
+ if (r && !in_sram)
+ return;
+
+ /* SDRAMC_MR : Normal Mode */
+ at91_sdramc_write(AT91_SDRAMC_MR, AT91_SDRAMC_MODE_NORMAL);
+
+ /* SDRAMC_TR - Refresh Timer register */
+ at91_sdramc_write(AT91_SDRAMC_TR, cfg->sdrc_tr1);
+
+ /* SDRAMC_CR - Configuration register*/
+ at91_sdramc_write(AT91_SDRAMC_CR, cfg->sdrc_cr);
+
+ /* Memory Device Type */
+ at91_sdramc_write(AT91_SDRAMC_MDR, cfg->sdrc_mdr);
+
+ /* SDRAMC_MR : Precharge All */
+ at91_sdramc_write(AT91_SDRAMC_MR, AT91_SDRAMC_MODE_PRECHARGE);
+
+ /* access SDRAM */
+ access_sdram();
+
+ /* SDRAMC_MR : refresh */
+ at91_sdramc_write(AT91_SDRAMC_MR, 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 */
+ access_sdram();
+
+ /* SDRAMC_MR : Normal Mode */
+ at91_sdramc_write(AT91_SDRAMC_MR, AT91_SDRAMC_MODE_NORMAL);
+
+ /* access SDRAM */
+ access_sdram();
+
+ /* SDRAMC_TR : Refresh Timer Counter */
+ at91_sdramc_write(AT91_SDRAMC_TR, cfg->sdrc_tr2);
+
+ /* access SDRAM */
+ access_sdram();
+}
+
+static void __always_inline at91sam926x_board_init(struct at91sam926x_board_cfg *cfg)
+{
+ u32 r;
+
+ if (!IS_ENABLED(CONFIG_AT91SAM926X_BOARD_INIT))
+ return;
+
+ __raw_writel(cfg->wdt_mr, AT91_BASE_WDT + AT91_WDT_MR);
+
+ /* configure PIOx as EBI0 D[16-31] */
+ at91_mux_gpio_disable(cfg->pio, cfg->ebi_pio_pdr);
+ at91_mux_set_pullup(cfg->pio, cfg->ebi_pio_ppudr, true);
+ if (cfg->ebi_pio_is_peripha)
+ at91_mux_set_A_periph(cfg->pio, cfg->ebi_pio_ppudr);
+
+ at91_sys_write(cfg->matrix_csa, cfg->ebi_csa);
+
+ /* 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
+ */
+ r = at91_pmc_read(AT91_PMC_MCKR);
+ if ((r & AT91_PMC_CSS) && !running_in_sram())
+ return;
+
+ /*
+ * 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
+ */
+ 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
+ */
+ at91_pmc_write(AT91_PMC_MCKR, cfg->pmc_mckr1);
+
+ pmc_check_mckrdy();
+
+ /*
+ * PCK/x = MCK Master Clock from PLLA
+ */
+ at91_pmc_write(AT91_PMC_MCKR, cfg->pmc_mckr2);
+
+ pmc_check_mckrdy();
+
+ /*
+ * 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
+ * so enable all of them
+ * We will shutdown what we don't need later
+ */
+ at91_pmc_write(AT91_PMC_PCER, 0xffffffff);
+}
+
+#endif /* __AT91SAM926X_BOARD_INIT_H__ */
--
2.12.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v5 05/22] arm: at91: code cleanup in at91sam926x_board_init
2018-01-06 21:04 [PATCH v5 0/22] at91: move reset vector to board code Sam Ravnborg
` (3 preceding siblings ...)
2018-01-06 21:11 ` [PATCH v5 04/22] arm: at91: add at91sam926x_board_init.h Sam Ravnborg
@ 2018-01-06 21:11 ` Sam Ravnborg
2018-01-06 21:11 ` [PATCH v5 06/22] at91sam9263ek: move reset vector to board code Sam Ravnborg
` (17 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Sam Ravnborg @ 2018-01-06 21:11 UTC (permalink / raw)
To: Barebox List; +Cc: Sam Ravnborg
- drop dead code (CONFIG_SYS_MATRIX_MCFG_REMAP not defined)
- drop use of macros for simple __read/__write functions
- delete extra lines
- Trivial comments kept on a single line
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
.../include/mach/at91sam926x_board_init.h | 73 +++++-----------------
1 file changed, 17 insertions(+), 56 deletions(-)
diff --git a/arch/arm/mach-at91/include/mach/at91sam926x_board_init.h b/arch/arm/mach-at91/include/mach/at91sam926x_board_init.h
index 54d67404c..70ae90337 100644
--- a/arch/arm/mach-at91/include/mach/at91sam926x_board_init.h
+++ b/arch/arm/mach-at91/include/mach/at91sam926x_board_init.h
@@ -70,66 +70,50 @@ static int __always_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)
-
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();
}
@@ -152,64 +136,41 @@ static void __always_inline at91sam926x_board_init(struct at91sam926x_board_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) && !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
--
2.12.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v5 06/22] at91sam9263ek: move reset vector to board code
2018-01-06 21:04 [PATCH v5 0/22] at91: move reset vector to board code Sam Ravnborg
` (4 preceding siblings ...)
2018-01-06 21:11 ` [PATCH v5 05/22] arm: at91: code cleanup in at91sam926x_board_init Sam Ravnborg
@ 2018-01-06 21:11 ` Sam Ravnborg
2018-01-06 21:11 ` [PATCH v5 07/22] at91sam9261ek, at91sam9g10ek: " Sam Ravnborg
` (16 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Sam Ravnborg @ 2018-01-06 21:11 UTC (permalink / raw)
To: Barebox List; +Cc: Sam Ravnborg
Move reset code to the board specific code.
This drops the dependency where mach-at91/ code
calls into the board code.
Drop the now (for this board) unessesary CONFIG select's
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
arch/arm/boards/at91sam9263ek/lowlevel_init.c | 43 ++++++++++++++++++++-------
arch/arm/mach-at91/Kconfig | 4 +--
2 files changed, 33 insertions(+), 14 deletions(-)
diff --git a/arch/arm/boards/at91sam9263ek/lowlevel_init.c b/arch/arm/boards/at91sam9263ek/lowlevel_init.c
index 2f8b312d3..70e0da3b1 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,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();
+}
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 234257eb9..552c992c0 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -442,9 +442,7 @@ config MACH_AT91SAM9263EK
bool "Atmel AT91SAM9263-EK"
select HAVE_NAND_ATMEL_BUSWIDTH_16
select HAVE_AT91_BOOTSTRAP
- select AT91SAM9263_LWL
- select AT91SAM926X_LWL
-
+ select AT91SAM926X_BOARD_INIT
help
Say y here if you are using Atmel's AT91SAM9263-EK Evaluation board
--
2.12.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v5 07/22] at91sam9261ek, at91sam9g10ek: move reset vector to board code
2018-01-06 21:04 [PATCH v5 0/22] at91: move reset vector to board code Sam Ravnborg
` (5 preceding siblings ...)
2018-01-06 21:11 ` [PATCH v5 06/22] at91sam9263ek: move reset vector to board code Sam Ravnborg
@ 2018-01-06 21:11 ` Sam Ravnborg
2018-01-06 21:11 ` [PATCH v5 08/22] pm9261: " Sam Ravnborg
` (15 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Sam Ravnborg @ 2018-01-06 21:11 UTC (permalink / raw)
To: Barebox List; +Cc: Sam Ravnborg
Move reset vector to board code and drop use
of arch/arm/mach-at91/at91sam9261_lowlevel_init.c.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
arch/arm/boards/at91sam9261ek/Makefile | 2 +-
arch/arm/boards/at91sam9261ek/lowlevel_init.c | 41 ++++++++++++++++++++-------
arch/arm/mach-at91/Kconfig | 4 +--
3 files changed, 32 insertions(+), 15 deletions(-)
diff --git a/arch/arm/boards/at91sam9261ek/Makefile b/arch/arm/boards/at91sam9261ek/Makefile
index 667095ae4..e7a9cde41 100644
--- a/arch/arm/boards/at91sam9261ek/Makefile
+++ b/arch/arm/boards/at91sam9261ek/Makefile
@@ -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
diff --git a/arch/arm/boards/at91sam9261ek/lowlevel_init.c b/arch/arm/boards/at91sam9261ek/lowlevel_init.c
index 056584166..c4e4957ca 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/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 552c992c0..84dbb3868 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -336,8 +336,7 @@ config MACH_AT91SAM9261EK
select HAVE_AT91_DATAFLASH_CARD
select HAVE_NAND_ATMEL_BUSWIDTH_16
select HAVE_AT91_BOOTSTRAP
- select AT91SAM9261_LWL
- select AT91SAM926X_LWL
+ 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>
@@ -366,7 +365,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>
--
2.12.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v5 08/22] pm9261: move reset vector to board code
2018-01-06 21:04 [PATCH v5 0/22] at91: move reset vector to board code Sam Ravnborg
` (6 preceding siblings ...)
2018-01-06 21:11 ` [PATCH v5 07/22] at91sam9261ek, at91sam9g10ek: " Sam Ravnborg
@ 2018-01-06 21:11 ` Sam Ravnborg
2018-01-06 21:11 ` [PATCH v5 09/22] at91: drop unused at91sam9261_lowlevel_init Sam Ravnborg
` (14 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Sam Ravnborg @ 2018-01-06 21:11 UTC (permalink / raw)
To: Barebox List; +Cc: Sam Ravnborg
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
arch/arm/boards/pm9261/lowlevel_init.c | 39 +++++++++++++++++++++++++---------
arch/arm/mach-at91/Kconfig | 3 +--
2 files changed, 30 insertions(+), 12 deletions(-)
diff --git a/arch/arm/boards/pm9261/lowlevel_init.c b/arch/arm/boards/pm9261/lowlevel_init.c
index 91a64b415..a4cb8af69 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/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 84dbb3868..abedbf762 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -345,8 +345,7 @@ config MACH_PM9261
bool "Ronetix PM9261"
select HAS_DM9000
select HAVE_AT91_BOOTSTRAP
- select AT91SAM9261_LWL
- select AT91SAM926X_LWL
+ select AT91SAM926X_BOARD_INIT
help
Say y here if you are using the Ronetix PM9261 Board
--
2.12.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v5 09/22] at91: drop unused at91sam9261_lowlevel_init
2018-01-06 21:04 [PATCH v5 0/22] at91: move reset vector to board code Sam Ravnborg
` (7 preceding siblings ...)
2018-01-06 21:11 ` [PATCH v5 08/22] pm9261: " Sam Ravnborg
@ 2018-01-06 21:11 ` Sam Ravnborg
2018-01-06 21:11 ` [PATCH v5 10/22] pm9263: move reset vector to board code Sam Ravnborg
` (13 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Sam Ravnborg @ 2018-01-06 21:11 UTC (permalink / raw)
To: Barebox List; +Cc: 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.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
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
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index abedbf762..242e21022 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -45,8 +45,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
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 66b83000a..1c7921914 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -12,7 +12,6 @@ lwl-$(CONFIG_AT91SAM926X_LWL) += at91sam926x_lowlevel_init.o
lwl-$(CONFIG_AT91RM9200_LWL) += at91rm9200_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
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 0ad7f0a0c..000000000
--- 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();
-}
--
2.12.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v5 10/22] pm9263: move reset vector to board code
2018-01-06 21:04 [PATCH v5 0/22] at91: move reset vector to board code Sam Ravnborg
` (8 preceding siblings ...)
2018-01-06 21:11 ` [PATCH v5 09/22] at91: drop unused at91sam9261_lowlevel_init Sam Ravnborg
@ 2018-01-06 21:11 ` Sam Ravnborg
2018-01-06 21:11 ` [PATCH v5 11/22] {usb,tny}-a926x: " Sam Ravnborg
` (12 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Sam Ravnborg @ 2018-01-06 21:11 UTC (permalink / raw)
To: Barebox List; +Cc: Sam Ravnborg
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
arch/arm/boards/pm9263/lowlevel_init.c | 43 +++++++++++++++++++++++++---------
arch/arm/mach-at91/Kconfig | 3 +--
2 files changed, 33 insertions(+), 13 deletions(-)
diff --git a/arch/arm/boards/pm9263/lowlevel_init.c b/arch/arm/boards/pm9263/lowlevel_init.c
index 6336d5106..6849f0a5b 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/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 242e21022..5fb17658a 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -444,8 +444,7 @@ config MACH_AT91SAM9263EK
config MACH_PM9263
bool "Ronetix PM9263"
select HAVE_AT91_BOOTSTRAP
- select AT91SAM9263_LWL
- select AT91SAM926X_LWL
+ select AT91SAM926X_BOARD_INIT
help
Say y here if you are using the Ronetix PM9263 Board
--
2.12.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v5 11/22] {usb,tny}-a926x: move reset vector to board code
2018-01-06 21:04 [PATCH v5 0/22] at91: move reset vector to board code Sam Ravnborg
` (9 preceding siblings ...)
2018-01-06 21:11 ` [PATCH v5 10/22] pm9263: move reset vector to board code Sam Ravnborg
@ 2018-01-06 21:11 ` Sam Ravnborg
2018-01-06 21:11 ` [PATCH v5 12/22] qil-a926x: " Sam Ravnborg
` (11 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Sam Ravnborg @ 2018-01-06 21:11 UTC (permalink / raw)
To: Barebox List; +Cc: Sam Ravnborg
For all Calao USB boards move reset vector to board code.
Introduce two different lowlevel.c files, one
for each processor.
Include renames to make filenames similar.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
arch/arm/boards/tny-a926x/Makefile | 5 ++-
arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c | 26 ++++++++++++
..._a9263_lowlevel_init.c => tny_a9263_lowlevel.c} | 48 +++++++++++++++-------
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 | 10 +----
7 files changed, 127 insertions(+), 35 deletions(-)
create mode 100644 arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c
rename arch/arm/boards/tny-a926x/{tny_a9263_lowlevel_init.c => tny_a9263_lowlevel.c} (73%)
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%)
diff --git a/arch/arm/boards/tny-a926x/Makefile b/arch/arm/boards/tny-a926x/Makefile
index bebb197e4..d40078875 100644
--- a/arch/arm/boards/tny-a926x/Makefile
+++ b/arch/arm/boards/tny-a926x/Makefile
@@ -2,6 +2,9 @@ obj-y += init.o
obj-$(CONFIG_AT91_BOOTSTRAP) += tny_a9263_bootstrap.o
-lwl-$(CONFIG_AT91SAM926X_LWL) += 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
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 000000000..b16ef31bf
--- /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
similarity index 73%
rename from arch/arm/boards/tny-a926x/tny_a9263_lowlevel_init.c
rename to arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c
index 3b8b0a298..86a469cc0 100644
--- a/arch/arm/boards/tny-a926x/tny_a9263_lowlevel_init.c
+++ b/arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c
@@ -1,31 +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 =
@@ -106,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 a4eae1844..65cc4082f 100644
--- a/arch/arm/boards/usb-a926x/Makefile
+++ b/arch/arm/boards/usb-a926x/Makefile
@@ -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
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 000000000..b16ef31bf
--- /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
similarity index 76%
rename from arch/arm/boards/usb-a926x/usb_a9263_lowlevel_init.c
rename to arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c
index f6dc58e3f..066452b95 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/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 5fb17658a..dc3503af0 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -297,7 +297,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>
@@ -305,7 +304,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>
@@ -388,7 +386,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>
@@ -396,7 +393,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>
@@ -452,8 +448,7 @@ config MACH_TNY_A9263
bool "CALAO TNY-A9263"
select SUPPORT_CALAO_MOB_TNY_MD2
select HAVE_AT91_BOOTSTRAP
- select AT91SAM9263_LWL
- select AT91SAM926X_LWL
+ select AT91SAM926X_BOARD_INIT
help
Select this if you are using a Calao Systems TNY-A9263.
<http://www.calao-systems.com>
@@ -461,8 +456,7 @@ config MACH_TNY_A9263
config MACH_USB_A9263
bool "CALAO USB-A9263"
select HAVE_AT91_BOOTSTRAP
- select AT91SAM9263_LWL
- select AT91SAM926X_LWL
+ select AT91SAM926X_BOARD_INIT
help
Select this if you are using a Calao Systems USB-A9263.
<http://www.calao-systems.com>
--
2.12.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v5 12/22] qil-a926x: move reset vector to board code
2018-01-06 21:04 [PATCH v5 0/22] at91: move reset vector to board code Sam Ravnborg
` (10 preceding siblings ...)
2018-01-06 21:11 ` [PATCH v5 11/22] {usb,tny}-a926x: " Sam Ravnborg
@ 2018-01-06 21:11 ` Sam Ravnborg
2018-01-06 21:11 ` [PATCH v5 13/22] haba-knx: " Sam Ravnborg
` (10 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Sam Ravnborg @ 2018-01-06 21:11 UTC (permalink / raw)
To: Barebox List; +Cc: Sam Ravnborg
Create new file lowlevel.c that contains the reset vector.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
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
diff --git a/arch/arm/boards/qil-a926x/Makefile b/arch/arm/boards/qil-a926x/Makefile
index 0c7bc3f04..82e46b369 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 000000000..b16ef31bf
--- /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/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index dc3503af0..1d614074e 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -289,7 +289,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>
@@ -407,7 +406,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>
--
2.12.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v5 13/22] haba-knx: move reset vector to board code
2018-01-06 21:04 [PATCH v5 0/22] at91: move reset vector to board code Sam Ravnborg
` (11 preceding siblings ...)
2018-01-06 21:11 ` [PATCH v5 12/22] qil-a926x: " Sam Ravnborg
@ 2018-01-06 21:11 ` Sam Ravnborg
2018-01-06 21:11 ` [PATCH v5 14/22] sama5d{3, 4}{xek, xplained}: " Sam Ravnborg
` (9 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Sam Ravnborg @ 2018-01-06 21:11 UTC (permalink / raw)
To: Barebox List; +Cc: Sam Ravnborg
Create new file lowlevel.c that contains the reset vector.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
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
diff --git a/arch/arm/boards/haba-knx/Makefile b/arch/arm/boards/haba-knx/Makefile
index d9db6aba6..b1c469dcf 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 000000000..b16ef31bf
--- /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/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 1d614074e..4f8a22cc5 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -412,7 +412,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>
--
2.12.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v5 14/22] sama5d{3, 4}{xek, xplained}: move reset vector to board code
2018-01-06 21:04 [PATCH v5 0/22] at91: move reset vector to board code Sam Ravnborg
` (12 preceding siblings ...)
2018-01-06 21:11 ` [PATCH v5 13/22] haba-knx: " Sam Ravnborg
@ 2018-01-06 21:11 ` Sam Ravnborg
2018-01-06 21:11 ` [PATCH v5 15/22] at91sam9n12ek: " Sam Ravnborg
` (8 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Sam Ravnborg @ 2018-01-06 21:11 UTC (permalink / raw)
To: Barebox List; +Cc: Sam Ravnborg
Include deletion of now unused CONFIG symbols
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
arch/arm/boards/sama5d3_xplained/Makefile | 1 +
.../sama5d3_xplained/lowlevel.c} | 12 +++++------
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, 78 insertions(+), 17 deletions(-)
rename arch/arm/{mach-at91/sama5d3_lowlevel_init.c => boards/sama5d3_xplained/lowlevel.c} (85%)
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
diff --git a/arch/arm/boards/sama5d3_xplained/Makefile b/arch/arm/boards/sama5d3_xplained/Makefile
index 3c301cb0c..fc6d83be8 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
similarity index 85%
rename from arch/arm/mach-at91/sama5d3_lowlevel_init.c
rename to arch/arm/boards/sama5d3_xplained/lowlevel.c
index 01d28514d..b791f2a03 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 32dcb4283..6ed914fc0 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 000000000..b791f2a03
--- /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 44550f528..8873dfc22 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 000000000..b791f2a03
--- /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 4363b3924..152750bbe 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 000000000..b791f2a03
--- /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/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 4f8a22cc5..9f05d4884 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -53,10 +53,6 @@ config AT91SAM9N12_LWL
bool
config AT91RM9200_LWL
bool
-config SAMA5D3_LWL
- bool
-config SAMA5D4_LWL
- bool
config AT91SAM9_SMC
bool
@@ -518,13 +514,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.
@@ -541,13 +535,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.
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 1c7921914..cb8dade6d 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -15,8 +15,6 @@ 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_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
--
2.12.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v5 15/22] at91sam9n12ek: move reset vector to board code
2018-01-06 21:04 [PATCH v5 0/22] at91: move reset vector to board code Sam Ravnborg
` (13 preceding siblings ...)
2018-01-06 21:11 ` [PATCH v5 14/22] sama5d{3, 4}{xek, xplained}: " Sam Ravnborg
@ 2018-01-06 21:11 ` Sam Ravnborg
2018-01-06 21:11 ` [PATCH v5 16/22] at91sam9260ek, at91sam9g20ek: " Sam Ravnborg
` (7 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Sam Ravnborg @ 2018-01-06 21:11 UTC (permalink / raw)
To: Barebox List; +Cc: Sam Ravnborg
Delete the unused at91sam9n12_lowlevel_init.c
Create new lowlevel.c that contains the reset vector.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
arch/arm/boards/at91sam9n12ek/Makefile | 3 +++
.../at91sam9n12ek/lowlevel.c} | 15 ++++++---------
arch/arm/mach-at91/Kconfig | 3 ---
arch/arm/mach-at91/Makefile | 1 -
4 files changed, 9 insertions(+), 13 deletions(-)
rename arch/arm/{mach-at91/at91sam9n12_lowlevel_init.c => boards/at91sam9n12ek/lowlevel.c} (83%)
diff --git a/arch/arm/boards/at91sam9n12ek/Makefile b/arch/arm/boards/at91sam9n12ek/Makefile
index f5d125a0e..458b05591 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
similarity index 83%
rename from arch/arm/mach-at91/at91sam9n12_lowlevel_init.c
rename to arch/arm/boards/at91sam9n12ek/lowlevel.c
index 2b5cb158b..47079336e 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/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 9f05d4884..44d57209f 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -49,8 +49,6 @@ config AT91SAM9263_LWL
bool
config AT91SAM9G45_LWL
bool
-config AT91SAM9N12_LWL
- bool
config AT91RM9200_LWL
bool
@@ -497,7 +495,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.
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index cb8dade6d..b51f1873b 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -14,7 +14,6 @@ lwl-$(CONFIG_AT91RM9200_LWL) += at91rm9200_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
-lwl-$(CONFIG_AT91SAM9N12_LWL) += at91sam9n12_lowlevel_init.o
obj-$(CONFIG_AT91SAM9_RESET) += at91sam9_reset.o
obj-$(CONFIG_AT91SAM9G45_RESET) += at91sam9g45_reset.o
--
2.12.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v5 16/22] at91sam9260ek, at91sam9g20ek: move reset vector to board code
2018-01-06 21:04 [PATCH v5 0/22] at91: move reset vector to board code Sam Ravnborg
` (14 preceding siblings ...)
2018-01-06 21:11 ` [PATCH v5 15/22] at91sam9n12ek: " Sam Ravnborg
@ 2018-01-06 21:11 ` Sam Ravnborg
2018-01-06 21:11 ` [PATCH v5 17/22] at91sam9m10g45ek, at91sam9m10ihd, pm9g45: " Sam Ravnborg
` (6 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Sam Ravnborg @ 2018-01-06 21:11 UTC (permalink / raw)
To: Barebox List; +Cc: Sam Ravnborg
Create new lowlevel.c that contains the reset vector.
Drop unused CONFIG symbols
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
arch/arm/boards/at91sam9260ek/Makefile | 3 +++
arch/arm/boards/at91sam9260ek/lowlevel.c | 26 ++++++++++++++++++++++++++
arch/arm/mach-at91/Kconfig | 2 --
3 files changed, 29 insertions(+), 2 deletions(-)
create mode 100644 arch/arm/boards/at91sam9260ek/lowlevel.c
diff --git a/arch/arm/boards/at91sam9260ek/Makefile b/arch/arm/boards/at91sam9260ek/Makefile
index 6e07f189f..9cc933a28 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 000000000..b16ef31bf
--- /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/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 44d57209f..cb692b813 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -276,7 +276,6 @@ config MACH_ANIMEO_IP
config MACH_AT91SAM9260EK
bool "Atmel AT91SAM9260-EK"
- select AT91SAM9260_LWL
select HAVE_NAND_ATMEL_BUSWIDTH_16
help
Say y here if you are using Atmel's AT91SAM9260-EK Evaluation board
@@ -371,7 +370,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.
--
2.12.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v5 17/22] at91sam9m10g45ek, at91sam9m10ihd, pm9g45: move reset vector to board code
2018-01-06 21:04 [PATCH v5 0/22] at91: move reset vector to board code Sam Ravnborg
` (15 preceding siblings ...)
2018-01-06 21:11 ` [PATCH v5 16/22] at91sam9260ek, at91sam9g20ek: " Sam Ravnborg
@ 2018-01-06 21:11 ` Sam Ravnborg
2018-01-06 21:11 ` [PATCH v5 18/22] animeo: " Sam Ravnborg
` (5 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Sam Ravnborg @ 2018-01-06 21:11 UTC (permalink / raw)
To: Barebox List; +Cc: Sam Ravnborg
These three board share the same at91sam9g45_lowlevel_init.c file.
Introduce lowlevel.c file for the boards that contains the reset vector.
Delete the now unused at91sam9g45_lowlevel_init.c file
Drop unused CONFIG symbols and Makefile references
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
arch/arm/boards/at91sam9m10g45ek/Makefile | 3 +++
.../at91sam9m10g45ek/lowlevel.c} | 13 +++++------
arch/arm/boards/at91sam9m10ihd/Makefile | 2 ++
arch/arm/boards/at91sam9m10ihd/lowlevel.c | 25 ++++++++++++++++++++++
arch/arm/boards/pm9g45/Makefile | 3 +++
arch/arm/boards/pm9g45/lowlevel.c | 24 +++++++++++++++++++++
arch/arm/mach-at91/Kconfig | 5 -----
arch/arm/mach-at91/Makefile | 1 -
8 files changed, 62 insertions(+), 14 deletions(-)
rename arch/arm/{mach-at91/at91sam9g45_lowlevel_init.c => boards/at91sam9m10g45ek/lowlevel.c} (83%)
create mode 100644 arch/arm/boards/at91sam9m10ihd/lowlevel.c
create mode 100644 arch/arm/boards/pm9g45/lowlevel.c
diff --git a/arch/arm/boards/at91sam9m10g45ek/Makefile b/arch/arm/boards/at91sam9m10g45ek/Makefile
index dd8052157..da011f825 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
similarity index 83%
rename from arch/arm/mach-at91/at91sam9g45_lowlevel_init.c
rename to arch/arm/boards/at91sam9m10g45ek/lowlevel.c
index 2cdb7a6a5..478ff11e1 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 f2acf201b..06193007a 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/boards/at91sam9m10ihd/lowlevel.c b/arch/arm/boards/at91sam9m10ihd/lowlevel.c
new file mode 100644
index 000000000..d5940b987
--- /dev/null
+++ b/arch/arm/boards/at91sam9m10ihd/lowlevel.c
@@ -0,0 +1,25 @@
+/*
+ * 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/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);
+}
diff --git a/arch/arm/boards/pm9g45/Makefile b/arch/arm/boards/pm9g45/Makefile
index d81b1881b..abf50243e 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 000000000..67454bde2
--- /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/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index cb692b813..2cffc74da 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -47,8 +47,6 @@ config AT91SAM9260_LWL
bool
config AT91SAM9263_LWL
bool
-config AT91SAM9G45_LWL
- bool
config AT91RM9200_LWL
bool
@@ -461,14 +459,12 @@ choice
config MACH_AT91SAM9M10IHD
bool "Atmel AT91SAM9M10IDH Tablet"
- select AT91SAM9G45_LWL
help
Select this if you are using Atmel's AT91SAM9M10IHD Tablet
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)
@@ -476,7 +472,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
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index b51f1873b..c430498ff 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -13,7 +13,6 @@ lwl-$(CONFIG_AT91SAM926X_LWL) += at91sam926x_lowlevel_init.o
lwl-$(CONFIG_AT91RM9200_LWL) += at91rm9200_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
obj-$(CONFIG_AT91SAM9_RESET) += at91sam9_reset.o
obj-$(CONFIG_AT91SAM9G45_RESET) += at91sam9g45_reset.o
--
2.12.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v5 18/22] animeo: move reset vector to board code
2018-01-06 21:04 [PATCH v5 0/22] at91: move reset vector to board code Sam Ravnborg
` (16 preceding siblings ...)
2018-01-06 21:11 ` [PATCH v5 17/22] at91sam9m10g45ek, at91sam9m10ihd, pm9g45: " Sam Ravnborg
@ 2018-01-06 21:11 ` Sam Ravnborg
2018-01-06 21:11 ` [PATCH v5 19/22] telit-evk-pro3: " Sam Ravnborg
` (4 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Sam Ravnborg @ 2018-01-06 21:11 UTC (permalink / raw)
To: Barebox List; +Cc: Sam Ravnborg
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
arch/arm/boards/animeo_ip/Makefile | 3 +++
arch/arm/boards/animeo_ip/lowlevel.c | 26 ++++++++++++++++++++++++++
arch/arm/mach-at91/Kconfig | 1 -
3 files changed, 29 insertions(+), 1 deletion(-)
create mode 100644 arch/arm/boards/animeo_ip/lowlevel.c
diff --git a/arch/arm/boards/animeo_ip/Makefile b/arch/arm/boards/animeo_ip/Makefile
index 510b142ff..61c714b45 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 000000000..b16ef31bf
--- /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/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 2cffc74da..fd4ae3a62 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -269,7 +269,6 @@ choice
config MACH_ANIMEO_IP
bool "Somfy Animeo IP"
- select AT91SAM9260_LWL
depends on !CONSOLE_NONE
config MACH_AT91SAM9260EK
--
2.12.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v5 19/22] telit-evk-pro3: move reset vector to board code
2018-01-06 21:04 [PATCH v5 0/22] at91: move reset vector to board code Sam Ravnborg
` (17 preceding siblings ...)
2018-01-06 21:11 ` [PATCH v5 18/22] animeo: " Sam Ravnborg
@ 2018-01-06 21:11 ` Sam Ravnborg
2018-01-06 21:11 ` [PATCH v5 20/22] dss11: " Sam Ravnborg
` (3 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Sam Ravnborg @ 2018-01-06 21:11 UTC (permalink / raw)
To: Barebox List; +Cc: Sam Ravnborg
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
arch/arm/boards/telit-evk-pro3/Makefile | 2 ++
arch/arm/boards/telit-evk-pro3/lowlevel.c | 26 ++++++++++++++++++++++++++
arch/arm/mach-at91/Kconfig | 1 -
3 files changed, 28 insertions(+), 1 deletion(-)
create mode 100644 arch/arm/boards/telit-evk-pro3/lowlevel.c
diff --git a/arch/arm/boards/telit-evk-pro3/Makefile b/arch/arm/boards/telit-evk-pro3/Makefile
index eb072c016..e11fd5b69 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 000000000..b16ef31bf
--- /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/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index fd4ae3a62..f0790da69 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -299,7 +299,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>
--
2.12.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v5 20/22] dss11: move reset vector to board code
2018-01-06 21:04 [PATCH v5 0/22] at91: move reset vector to board code Sam Ravnborg
` (18 preceding siblings ...)
2018-01-06 21:11 ` [PATCH v5 19/22] telit-evk-pro3: " Sam Ravnborg
@ 2018-01-06 21:11 ` Sam Ravnborg
2018-01-06 21:11 ` [PATCH v5 21/22] at91rm9200ek: " Sam Ravnborg
` (2 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Sam Ravnborg @ 2018-01-06 21:11 UTC (permalink / raw)
To: Barebox List; +Cc: Sam Ravnborg
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
arch/arm/boards/dss11/Makefile | 2 ++
arch/arm/boards/dss11/lowlevel.c | 26 ++++++++++++++++++++++++++
arch/arm/mach-at91/Kconfig | 1 -
3 files changed, 28 insertions(+), 1 deletion(-)
create mode 100644 arch/arm/boards/dss11/lowlevel.c
diff --git a/arch/arm/boards/dss11/Makefile b/arch/arm/boards/dss11/Makefile
index eb072c016..e11fd5b69 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 000000000..b16ef31bf
--- /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/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index f0790da69..1d2ac085d 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -387,7 +387,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.
--
2.12.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v5 21/22] at91rm9200ek: move reset vector to board code
2018-01-06 21:04 [PATCH v5 0/22] at91: move reset vector to board code Sam Ravnborg
` (19 preceding siblings ...)
2018-01-06 21:11 ` [PATCH v5 20/22] dss11: " Sam Ravnborg
@ 2018-01-06 21:11 ` Sam Ravnborg
2018-01-06 21:11 ` [PATCH v5 22/22] arm: at91: remove leftovers from moving reset code in mach-at91 Sam Ravnborg
2018-01-09 10:35 ` [PATCH v5 0/22] at91: move reset vector to board code Sascha Hauer
22 siblings, 0 replies; 24+ messages in thread
From: Sam Ravnborg @ 2018-01-06 21:11 UTC (permalink / raw)
To: Barebox List; +Cc: Sam Ravnborg
Include deletion of now unused at91rm9200_lowlevel_init.c
and related CONFIG symbols
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
arch/arm/boards/at91rm9200ek/Makefile | 3 +++
.../at91rm9200ek/lowlevel.c} | 14 ++++++--------
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%)
diff --git a/arch/arm/boards/at91rm9200ek/Makefile b/arch/arm/boards/at91rm9200ek/Makefile
index dec1c5045..a07c06a6d 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
similarity index 97%
rename from arch/arm/mach-at91/at91rm9200_lowlevel_init.c
rename to arch/arm/boards/at91rm9200ek/lowlevel.c
index f78e36808..a85a22e79 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/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 1d2ac085d..74e1a862b 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -47,8 +47,6 @@ config AT91SAM9260_LWL
bool
config AT91SAM9263_LWL
bool
-config AT91RM9200_LWL
- bool
config AT91SAM9_SMC
bool
@@ -251,7 +249,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>
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index c430498ff..7193b8690 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -10,7 +10,6 @@ obj-$(CONFIG_AT91_BOOTSTRAP) += bootstrap.o
lwl-$(CONFIG_AT91SAM926X_LWL) += at91sam926x_lowlevel_init.o
-lwl-$(CONFIG_AT91RM9200_LWL) += at91rm9200_lowlevel_init.o
lwl-$(CONFIG_AT91SAM9260_LWL) += at91sam9260_lowlevel_init.o
lwl-$(CONFIG_AT91SAM9263_LWL) += at91sam9263_lowlevel_init.o
--
2.12.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v5 22/22] arm: at91: remove leftovers from moving reset code in mach-at91
2018-01-06 21:04 [PATCH v5 0/22] at91: move reset vector to board code Sam Ravnborg
` (20 preceding siblings ...)
2018-01-06 21:11 ` [PATCH v5 21/22] at91rm9200ek: " Sam Ravnborg
@ 2018-01-06 21:11 ` Sam Ravnborg
2018-01-09 10:35 ` [PATCH v5 0/22] at91: move reset vector to board code Sascha Hauer
22 siblings, 0 replies; 24+ messages in thread
From: Sam Ravnborg @ 2018-01-06 21:11 UTC (permalink / raw)
To: Barebox List; +Cc: Sam Ravnborg
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
arch/arm/mach-at91/Kconfig | 11 --
arch/arm/mach-at91/Makefile | 5 -
arch/arm/mach-at91/at91sam9260_lowlevel_init.c | 48 -----
arch/arm/mach-at91/at91sam9263_lowlevel_init.c | 48 -----
arch/arm/mach-at91/at91sam926x_lowlevel_init.c | 199 ---------------------
.../mach-at91/include/mach/at91_lowlevel_init.h | 46 -----
6 files changed, 357 deletions(-)
delete mode 100644 arch/arm/mach-at91/at91sam9260_lowlevel_init.c
delete mode 100644 arch/arm/mach-at91/at91sam9263_lowlevel_init.c
delete mode 100644 arch/arm/mach-at91/at91sam926x_lowlevel_init.c
delete mode 100644 arch/arm/mach-at91/include/mach/at91_lowlevel_init.h
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 74e1a862b..fa9caedc9 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -37,17 +37,6 @@ config HAVE_AT91_BOOTSTRAP
config AT91SAM926X_BOARD_INIT
bool
-# Select if 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
- bool
-config AT91SAM9263_LWL
- bool
-
config AT91SAM9_SMC
bool
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 7193b8690..8462cba60 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -8,11 +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
-
obj-$(CONFIG_AT91SAM9_RESET) += at91sam9_reset.o
obj-$(CONFIG_AT91SAM9G45_RESET) += at91sam9g45_reset.o
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 7f84185ef..000000000
--- 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/at91sam9263_lowlevel_init.c b/arch/arm/mach-at91/at91sam9263_lowlevel_init.c
deleted file mode 100644
index 0be84551f..000000000
--- 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/at91sam926x_lowlevel_init.c b/arch/arm/mach-at91/at91sam926x_lowlevel_init.c
deleted file mode 100644
index 5dd8bc4e6..000000000
--- a/arch/arm/mach-at91/at91sam926x_lowlevel_init.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * 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 <mach/at91sam9_sdramc.h>
-#include <mach/at91sam9_smc.h>
-#include <mach/at91_lowlevel_init.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)
-{
- writel(0x00000000, AT91_SDRAM_BASE);
-}
-
-static void inline pmc_check_mckrdy(void)
-{
- u32 r;
-
- do {
- r = at91_pmc_read(AT91_PMC_SR);
- } while (!(r & AT91_PMC_MCKRDY));
-}
-
-static int inline running_in_sram(void)
-{
- u32 addr = get_pc();
-
- addr >>= 28;
- 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)
-{
- 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);
- if (r && !in_sram)
- return;
-
- /* SDRAMC_MR : Normal Mode */
- at91_sdramc_write(AT91_SDRAMC_MR, AT91_SDRAMC_MODE_NORMAL);
-
- /* SDRAMC_TR - Refresh Timer register */
- at91_sdramc_write(AT91_SDRAMC_TR, cfg->sdrc_tr1);
-
- /* SDRAMC_CR - Configuration register*/
- at91_sdramc_write(AT91_SDRAMC_CR, cfg->sdrc_cr);
-
- /* Memory Device Type */
- at91_sdramc_write(AT91_SDRAMC_MDR, cfg->sdrc_mdr);
-
- /* SDRAMC_MR : Precharge All */
- at91_sdramc_write(AT91_SDRAMC_MR, AT91_SDRAMC_MODE_PRECHARGE);
-
- /* access SDRAM */
- access_sdram();
-
- /* SDRAMC_MR : refresh */
- at91_sdramc_write(AT91_SDRAMC_MR, 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 */
- access_sdram();
-
- /* SDRAMC_MR : Normal Mode */
- at91_sdramc_write(AT91_SDRAMC_MR, AT91_SDRAMC_MODE_NORMAL);
-
- /* access SDRAM */
- access_sdram();
-
- /* SDRAMC_TR : Refresh Timer Counter */
- at91_sdramc_write(AT91_SDRAMC_TR, cfg->sdrc_tr2);
-
- /* access SDRAM */
- access_sdram();
-}
-
-void __bare_init at91sam926x_lowlevel_init(struct at91sam926x_lowlevel_cfg *cfg)
-{
- u32 r;
- int in_sram = running_in_sram();
-
- at91sam926x_lowlevel_board_config(cfg);
-
- __raw_writel(cfg->wdt_mr, AT91_BASE_WDT + AT91_WDT_MR);
-
- /* configure PIOx as EBI0 D[16-31] */
- at91_mux_gpio_disable(cfg->pio, cfg->ebi_pio_pdr);
- at91_mux_set_pullup(cfg->pio, cfg->ebi_pio_ppudr, true);
- if (cfg->ebi_pio_is_peripha)
- at91_mux_set_A_periph(cfg->pio, cfg->ebi_pio_ppudr);
-
- at91_sys_write(cfg->matrix_csa, cfg->ebi_csa);
-
- /* 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
- */
- r = at91_pmc_read(AT91_PMC_MCKR);
- if (r & AT91_PMC_CSS && !in_sram)
- return;
-
- /*
- * 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
- */
- 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
- */
- at91_pmc_write(AT91_PMC_MCKR, cfg->pmc_mckr1);
-
- pmc_check_mckrdy();
-
- /*
- * PCK/x = MCK Master Clock from PLLA
- */
- at91_pmc_write(AT91_PMC_MCKR, cfg->pmc_mckr2);
-
- pmc_check_mckrdy();
-
- /*
- * 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
- * so enable all of them
- * We will shutdown what we don't need later
- */
- at91_pmc_write(AT91_PMC_PCER, 0xffffffff);
-}
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 d72dfff38..000000000
--- 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_AT91SAM926X_LWL
-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__ */
--
2.12.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v5 0/22] at91: move reset vector to board code
2018-01-06 21:04 [PATCH v5 0/22] at91: move reset vector to board code Sam Ravnborg
` (21 preceding siblings ...)
2018-01-06 21:11 ` [PATCH v5 22/22] arm: at91: remove leftovers from moving reset code in mach-at91 Sam Ravnborg
@ 2018-01-09 10:35 ` Sascha Hauer
22 siblings, 0 replies; 24+ messages in thread
From: Sascha Hauer @ 2018-01-09 10:35 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: Barebox List
On Sat, Jan 06, 2018 at 10:04:50PM +0100, Sam Ravnborg wrote:
> Hi all.
>
> 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 includes removal of the mmccpu board.
>
> The patchset convert all at91 boards and thus clean up
> the old code that resided in mach-at91/
>
> The second 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.
>
> With this patchset applied we no longer have any
> places where we call board code from mach-at91/
> thus allowing us to introduce multi-images.
> And we are also on the right track to introduce
> DT support for additional AT91 based boards.
>
> 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).
>
> I consider the patchset ready for barebox-next.
Applied, thanks.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 24+ messages in thread