at91: move reset vector to board code
Subsystems (4)
v3 cover at91: move reset vector to board code
The following patchset moves the reset vector for at91 boards from mach-at91 to board code. This is similar to what other boards do and is done to prepare for multi-image and DT support.
The patchset convert all boards and thus clean up the old code that resided in mach-at91/
The first patch have minimal impact, but prepares for a board-by-board conversion.
All temporary CONFIG symbols are gone at the end of this series.
I kept Jean-Christophe PLAGNIOL-VILLARD and others copyright in all the created files and did not add copyright myself. The patchset does IMO not add any copyrightable material from my side as this is in reality just moving around code.
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.
Changes v2 => v3
v2 was posted in July - but I have lacked spare time until now to give it a proper respin
- respin of all patches on top of v2017.12.0
- fix bogus handling of at91sam926x_board_init
- Introduce new CONFIG symbol for at91sam926x_board_init to allow bisects
Changes v1 => v2
- converted all boards over
- fixed author info
Sam Ravnborg (24):
arm: at91: refactor lowlevel_init selection
arm: at91: drop unused at91sam9x5_lowlevel_init.c
arm: at91: add at91sam926x_board_init.h
at91sam9263ek: move reset vector to board code at91sam9261ek, at91sam9g10ek: move reset vector to board code
pm9261: move reset vector to board code
at91: drop unused at91sam9261_lowlevel_init
pm9263: move reset vector to board code
usb-a926x: move reset vector to board code
mmccpu: delete unused lowlevel_init
mmccpu: move reset vector to board code
tny-a926x: delete unused tny_a9263_lowlevel_init.c
tny-a926x: move reset vector to board code
qil-a926x: move reset vector to board code
haba-knx: move reset vector to board code sama5d{3,4}{xek,xplained}: move reset vector to board code
at91sam9n12ek: move reset vector to board code at91sam9260ek, at91sam9g20ek: move reset vector to board code at91sam9m10g45ek, at91sam9m10ihd, pm9g45: move reset vector to board code
animeo: move reset vector to board code
telit-evk-pro3: move reset vector to board code
dss11: move reset vector to board code
at91rm9200ek: move reset vector to board code
arm: at91: remove leftovers from moving reset code in mach-at91
# git diff --stat=200 -M -C
arch/arm/boards/animeo_ip/Makefile | 3 +++
arch/arm/{mach-at91/sama5d3_lowlevel_init.c => boards/animeo_ip/lowlevel.c} | 17 +++++++------
arch/arm/boards/at91rm9200ek/Makefile | 3 +++
arch/arm/{mach-at91/at91rm9200_lowlevel_init.c => boards/at91rm9200ek/lowlevel.c} | 14 +++++------
arch/arm/boards/at91sam9260ek/Makefile | 3 +++
arch/arm/{mach-at91/sama5d3_lowlevel_init.c => boards/at91sam9260ek/lowlevel.c} | 17 +++++++------
arch/arm/boards/at91sam9261ek/Makefile | 2 +-
arch/arm/boards/at91sam9261ek/lowlevel_init.c | 41 ++++++++++++++++++++++---------
arch/arm/boards/at91sam9263ek/Makefile | 2 +-
arch/arm/boards/at91sam9263ek/lowlevel_init.c | 43 ++++++++++++++++++++++++---------
arch/arm/boards/at91sam9m10g45ek/Makefile | 3 +++
arch/arm/{mach-at91/at91sam9g45_lowlevel_init.c => boards/at91sam9m10g45ek/lowlevel.c} | 11 +++------
arch/arm/boards/at91sam9m10ihd/Makefile | 2 ++
arch/arm/{mach-at91/at91sam9x5_lowlevel_init.c => boards/at91sam9m10ihd/lowlevel.c} | 19 +++++++--------
arch/arm/boards/at91sam9n12ek/Makefile | 3 +++
arch/arm/{mach-at91/at91sam9n12_lowlevel_init.c => boards/at91sam9n12ek/lowlevel.c} | 13 ++++------
arch/arm/boards/dss11/Makefile | 2 ++
arch/arm/{mach-at91/sama5d3_lowlevel_init.c => boards/dss11/lowlevel.c} | 17 +++++++------
arch/arm/boards/haba-knx/Makefile | 3 +++
arch/arm/{mach-at91/sama5d3_lowlevel_init.c => boards/haba-knx/lowlevel.c} | 17 +++++++------
arch/arm/boards/mmccpu/Makefile | 2 +-
arch/arm/{mach-at91/at91sam9n12_lowlevel_init.c => boards/mmccpu/lowlevel.c} | 19 +++++++--------
arch/arm/boards/mmccpu/lowlevel_init.c | 135 ------------------------------------------------------------------------------------------------------
arch/arm/boards/pm9261/Makefile | 2 +-
arch/arm/boards/pm9261/lowlevel_init.c | 39 ++++++++++++++++++++++--------
arch/arm/boards/pm9263/Makefile | 2 +-
arch/arm/boards/pm9263/lowlevel_init.c | 43 ++++++++++++++++++++++++---------
arch/arm/boards/pm9g45/Makefile | 3 +++
arch/arm/{mach-at91/at91sam9g45_lowlevel_init.c => boards/pm9g45/lowlevel.c} | 13 ++++------
arch/arm/boards/qil-a926x/Makefile | 3 +++
arch/arm/{mach-at91/sama5d3_lowlevel_init.c => boards/qil-a926x/lowlevel.c} | 17 +++++++------
arch/arm/boards/sama5d3_xplained/Makefile | 1 +
arch/arm/{mach-at91/sama5d3_lowlevel_init.c => boards/sama5d3_xplained/lowlevel.c} | 10 +++-----
arch/arm/boards/sama5d3xek/Makefile | 1 +
arch/arm/{mach-at91/sama5d3_lowlevel_init.c => boards/sama5d3xek/lowlevel.c} | 10 +++-----
arch/arm/boards/sama5d4_xplained/Makefile | 1 +
arch/arm/{mach-at91/sama5d3_lowlevel_init.c => boards/sama5d4_xplained/lowlevel.c} | 10 +++-----
arch/arm/boards/sama5d4ek/Makefile | 1 +
arch/arm/{mach-at91/sama5d3_lowlevel_init.c => boards/sama5d4ek/lowlevel.c} | 10 +++-----
arch/arm/boards/telit-evk-pro3/Makefile | 2 ++
arch/arm/{mach-at91/sama5d3_lowlevel_init.c => boards/telit-evk-pro3/lowlevel.c} | 17 +++++++------
arch/arm/boards/tny-a926x/Makefile | 8 +++---
arch/arm/{mach-at91/sama5d3_lowlevel_init.c => boards/tny-a926x/tny_a9260_lowlevel.c} | 17 +++++++------
arch/arm/{mach-at91/at91sam9n12_lowlevel_init.c => boards/tny-a926x/tny_a9263_lowlevel.c} | 19 +++++++--------
arch/arm/boards/tny-a926x/tny_a9263_lowlevel_init.c | 107 ---------------------------------------------------------------------------------
arch/arm/boards/usb-a926x/Makefile | 8 +++---
arch/arm/{mach-at91/sama5d3_lowlevel_init.c => boards/usb-a926x/usb_a9260_lowlevel.c} | 17 +++++++------
arch/arm/boards/usb-a926x/{usb_a9263_lowlevel_init.c => usb_a9263_lowlevel.c} | 43 ++++++++++++++++++++++++---------
arch/arm/mach-at91/Kconfig | 31 ++++++++++++++----------
arch/arm/mach-at91/Makefile | 14 +----------
arch/arm/mach-at91/at91sam9260_lowlevel_init.c | 48 ------------------------------------
arch/arm/mach-at91/at91sam9261_lowlevel_init.c | 48 ------------------------------------
arch/arm/mach-at91/at91sam9263_lowlevel_init.c | 48 ------------------------------------
arch/arm/mach-at91/include/mach/at91_lowlevel_init.h | 46 -----------------------------------
arch/arm/mach-at91/{at91sam926x_lowlevel_init.c => include/mach/at91sam926x_board_init.h} | 82 +++++++++++++++++++++++++++++++++++++++++++-------------------
55 files changed, 413 insertions(+), 699 deletions(-)_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 1/24 arm: at91: refactor lowlevel_init selection
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.
bootstrap is likewise pushed out to the individual boards.
--- arch/arm/boards/at91sam9261ek/Makefile | 2 +- arch/arm/boards/at91sam9263ek/Makefile | 2 +- arch/arm/boards/mmccpu/Makefile | 3 +- arch/arm/boards/pm9261/Makefile | 2 +- arch/arm/boards/pm9263/Makefile | 2 +- arch/arm/boards/tny-a926x/Makefile | 7 +- arch/arm/boards/usb-a926x/Makefile | 6 +- arch/arm/mach-at91/Kconfig | 85 ++++++++++++++++++---- arch/arm/mach-at91/Makefile | 26 +++---- .../mach-at91/include/mach/at91_lowlevel_init.h | 2 +- 10 files changed, 97 insertions(+), 40 deletions(-)
arch/arm/boards/at91sam9261ek/Makefile +1 -1
@@ -1,4 +1,4 @@ obj-y += init.o -lwl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o +lwl-$(CONFIG_AT91SAM926X_LWL) += lowlevel_init.o bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9261ek
arch/arm/boards/at91sam9263ek/Makefile +1 -1
@@ -1,4 +1,4 @@ obj-y += init.o -lwl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o +lwl-y += lowlevel_init.o bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9263ek
arch/arm/boards/mmccpu/Makefile +2 -1
@@ -1,3 +1,4 @@ obj-y += init.o -lwl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o +# Not used, documented by a lwl-n assignment +lwl-n += lowlevel_init.o
arch/arm/boards/pm9261/Makefile +1 -1
@@ -1,4 +1,4 @@ obj-y += init.o -lwl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o +lwl-y += lowlevel_init.o bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-pm9261
arch/arm/boards/pm9263/Makefile +1 -1
@@ -1,3 +1,3 @@ obj-y += init.o -lwl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o +lwl-y += lowlevel_init.o
arch/arm/boards/tny-a926x/Makefile +3 -4
@@ -1,9 +1,8 @@ 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 +# Not used, documented with a lwl-n assignment +lwl-n += tny_a9263_lowlevel_init.o -lwl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += $(lowlevel_init-y) bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-tny-a926x
arch/arm/boards/usb-a926x/Makefile +2 -4
@@ -1,9 +1,7 @@ obj-y += init.o -bootstrap-$(CONFIG_MACH_USB_A9263) = usb_a9263_bootstrap.o -obj-$(CONFIG_AT91_BOOTSTRAP) += $(bootstrap-y) +obj-$(CONFIG_AT91_BOOTSTRAP) += usb_a9263_bootstrap.o -lowlevel_init-$(CONFIG_MACH_USB_A9263) = usb_a9263_lowlevel_init.o +lwl-$(CONFIG_AT91SAM926X_LWL) += usb_a9263_lowlevel_init.o -lwl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += $(lowlevel_init-y) bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-usb-a926x
arch/arm/mach-at91/Kconfig +72 -13
290 lines not on this page · raw message
arch/arm/mach-at91/Makefile +13 -13
@@ -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
arch/arm/mach-at91/include/mach/at91_lowlevel_init.h +1 -1
@@ -35,7 +35,7 @@ struct at91sam926x_lowlevel_cfg {u32 rstc_rmr; }; -#ifdef CONFIG_HAVE_AT91_LOWLEVEL_INIT +#ifdef CONFIG_AT91SAM926X_LWL void at91sam926x_lowlevel_board_config (struct at91sam926x_lowlevel_cfg *cfg);void at91sam926x_lowlevel_init (struct at91sam926x_lowlevel_cfg *cfg);#else
Signature · 7 lines
2.12.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 2/24 arm: at91: drop unused at91sam9x5_lowlevel_init.c
In reply to Sam RavnborgAfter refactoring of how we select lowlevel_init it was appearant that at91sam9x5_lowlevel_init.c was no longer used.
Delete the file and the now unused CONFIG symbol and it uses
--- arch/arm/mach-at91/Kconfig | 2 -- arch/arm/mach-at91/Makefile | 1 - arch/arm/mach-at91/at91sam9x5_lowlevel_init.c | 26 -------------------------- 3 files changed, 29 deletions(-) delete mode 100644 arch/arm/mach-at91/at91sam9x5_lowlevel_init.c
arch/arm/mach-at91/Kconfig +0 -2
@@ -51,8 +51,6 @@ config AT91SAM9263_LWL bool config AT91SAM9G45_LWL bool -config AT91SAM9X5_LWL - bool config AT91SAM9N12_LWL bool config AT91RM9200_LWL
arch/arm/mach-at91/Makefile +0 -1
@@ -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
arch/arm/mach-at91/at91sam9x5_lowlevel_init.c deleted +0 -26
@@ -1,26 +0,0 @@ -/* -* Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> -* -* Under GPLv2 -*/ - -#define __LOWLEVEL_INIT__ - -#include <common.h> -#include <asm/system.h> -#include <asm/barebox-arm.h> -#include <asm/barebox-arm-head.h> -#include <mach/hardware.h> -#include <mach/io.h> -#include <mach/at91sam9_ddrsdr.h> -#include <init.h> -#include <linux/sizes.h> - -void __naked __bare_init barebox_arm_reset_vector(void) -{ -arm_cpu_lowlevel_init (); - -arm_setup_stack (AT91SAM9X5_SRAM_BASE +AT91SAM9X5_SRAM_SIZE -16 ); - -barebox_arm_entry (AT91_CHIPSELECT_1 ,at91sam9x5_get_ddram_size (),NULL ); -}
Signature · 7 lines
2.12.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 02/24] arm: at91: drop unused at91sam9x5_lowlevel_init.c
Quoted 2 lines · Sam Ravnborg
After refactoring of how we select
lowlevel_initit was appearant thatat91sam9x5_lowlevel_init.cwas no
Nit: s/appearant/apparent/
Quoted 72 lines
longer used.
Delete the file and the now unused CONFIG symbol and it usesSigned-off-by Sam Ravnborg <[email protected]>--- 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.carch/arm/mach-at91/Kconfig +0
-2@@ -51,8 +51,6 @@ config AT91SAM9263_LWL bool config AT91SAM9G45_LWL bool -config AT91SAM9X5_LWL - bool config AT91SAM9N12_LWL bool config AT91RM9200_LWLarch/arm/mach-at91/Makefile +0
-1@@ -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.oarch/arm/mach-at91/at91sam9x5_lowlevel_init.c deleted +0
-27@@ -1,26 +0,0 @@ -/* -* Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> -* -* Under GPLv2 -*/ - -#define __LOWLEVEL_INIT__ - -#include <common.h> -#include <asm/system.h> -#include <asm/barebox-arm.h> -#include <asm/barebox-arm-head.h> -#include <mach/hardware.h> -#include <mach/io.h> -#include <mach/at91sam9_ddrsdr.h> -#include <init.h> -#include <linux/sizes.h> - -void __naked __bare_init barebox_arm_reset_vector(void) -{ -arm_cpu_lowlevel_init (); - -arm_setup_stack (AT91SAM9X5_SRAM_BASE +AT91SAM9X5_SRAM_SIZE -16 ); - -barebox_arm_entry (AT91_CHIPSELECT_1 ,at91sam9x5_get_ddram_size (),NULL ); -} --2.12.0
Quoted 4 lines
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 3/24 arm: at91: add at91sam926x_board_init.h
In reply to Sam RavnborgTo 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
--- .../include/mach/at91sam926x_board_init.h | 231 +++++++++++++++++++++ 1 file changed, 231 insertions(+) create mode 100644 arch/arm/mach-at91/include/mach/at91sam926x_board_init.h
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h new file +231 -0
@@ -0,0 +1,231 @@ +#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 <[email protected]> +* +* 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 __bare_init 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 (); +} + +#if !defined(CONFIG_AT91SAM926X_BOARD_INIT ) +/* +* Empty function if the board do not use this. +* Board code can call this, and let Kconfig select decide if +* the board uses at91sam926x_board_init() +*/ +static void __always_inline __bare_init at91sam926x_board_init(struct at91sam926x_board_cfg *cfg) +{ +} +#else +static void __always_inline __bare_init at91sam926x_board_init(struct at91sam926x_board_cfg *cfg) +{ +u32 r; +int in_sram =running_in_sram (); + +__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 ); +} +#endif /* CONFIG_AT91SAM926X_BOARD_INIT */ + +#endif /* __AT91SAM926X_BOARD_INIT_H__ */
Signature · 7 lines
2.12.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 03/24] arm: at91: add at91sam926x_board_init.h
Quoted 8 lines · Sam Ravnborg
To prepare moving reset code to board code create
at91sam926x_board_init.h.
at91sam926x_board_init.his a copy ofat91sam926x_lowlevel_init.cwith 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
Quoted 5 lines
This file allows board code to include
at91sam926x_board_init.hand use the init functions in their init code.Users must select
AT91SAM926X_BOARD_INIT
If the intent of this commit is to keep this code as close to original at91sam926x_lowlevel_init.c then a whole bunch of my comments below could probably be ignored, but I added them anyway just FWIW.
Quoted 56 lines
Signed-off-by Sam Ravnborg <[email protected]>--- .../include/mach/at91sam926x_board_init.h | 231 +++++++++++++++++++++ 1 file changed, 231 insertions(+) create mode 100644 arch/arm/mach-at91/include/mach/at91sam926x_board_init.harch/arm/mach-at91/include/mach/at91sam926x_board_init.h new file +44
-0@@ -0,0 +1,231 @@ +#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 <[email protected]> + * + * 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;
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h line 54
Quoted 10 lines
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h new file +10
-0+u32 sdrc_mdr; +u32 sdrc_tr2; +u32 rstc_rmr; +}; + + +static void __always_inline access_sdram(void) +{ +writel (0x00000000 ,AT91_SDRAM_BASE ); +}
Is there a reason to use __always_inline vs regular inline here?
Quoted 13 lines
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h new file +13
-0+ +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 ();
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h line 77
Quoted 10 lines
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h new file +10
-0+ + 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)
I'd rather these were inline functions that didn't implicitly rely on "cfg" to be defined, but that's my personal preference, so feel free to keep it this way.
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h line 80
Quoted 3 lines
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h new file +3
-0+ +static void __always_inline __bare_init at91sam926x_sdramc_init(struct at91sam926x_board_cfg *cfg) +{
Using __always_inline and __bare_init at the same time doesn't make much sense to me. If function is always inlined then it ends up in whatever section its caller is in and if it is placed into "bare init" section then it's not really inlined. Am I missing something?
Quoted 17 lines
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h new file +17
-0+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); +
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h line 107
Quoted 10 lines
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h new file +10
-0+/* 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 */
As much as I like comments in code, this one is not really useful (I can see what's being done already and it doesn't really clarify why). Would you mind dropping this and other comment like this?
Quoted 33 lines
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h new file +33
-0+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 (); +} + +#if !defined(CONFIG_AT91SAM926X_BOARD_INIT ) +/* +* Empty function if the board do not use this. +* Board code can call this, and let Kconfig select decide if +* the board uses at91sam926x_board_init()
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h line 150
Quoted 10 lines
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h new file +10
-0+*/ +static void __always_inline __bare_init at91sam926x_board_init(struct at91sam926x_board_cfg *cfg) +{ +} +#else +static void __always_inline __bare_init at91sam926x_board_init(struct at91sam926x_board_cfg *cfg) +{ +u32 r; +int in_sram =running_in_sram (); +
if (!IS_ENABLED(CONFIG_AT91SAM926X_BOARD_INIT)
return;
instead to avoid having to repeat the signature twice?
Quoted 15 lines
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h new file +15
-0+__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); +
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h line 175
Quoted 10 lines
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h new file +10
-0+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 ;
Does GCC say anything about lack of parenthesis around bitwise and above?
Quoted 35 lines
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h new file +35
-0+ +/* +* 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
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h line 220
Quoted 10 lines
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h new file +10
-0+*/ +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
if (IS_ENABLED(CONFIG_SYS_MATRIX_MCFG_REMAP))
here as well?
Thanks,
Andrey Smirnov
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 03/24] arm: at91: add at91sam926x_board_init.h
Hi Andrey.
Quoted 12 lines · Andrey Smirnov
Quoted 11 lines · Sam Ravnborg
To prepare moving reset code to board code create
at91sam926x_board_init.h.
at91sam926x_board_init.his a copy ofat91sam926x_lowlevel_init.cwith 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 prurposeThis file allows board code to include
at91sam926x_board_init.hand use the init functions in their init code.
Quoted 6 lines
Quoted 2 lines
Users must select
AT91SAM926X_BOARD_INITIf the intent of this commit is to keep this code as close to original
at91sam926x_lowlevel_init.cthen a whole bunch of my comments below could probably be ignored, but I added them anyway just FWIW.
The intent was more in the area of "it works, so do not break it". I will divide this in two patches where the second patch will go through the code and update thereby implicit addressing many of your comments.
Quoted 61 lines
Quoted 61 lines
Signed-off-by Sam Ravnborg <[email protected]>--- .../include/mach/at91sam926x_board_init.h | 231 +++++++++++++++++++++ 1 file changed, 231 insertions(+) create mode 100644 arch/arm/mach-at91/include/mach/at91sam926x_board_init.harch/arm/mach-at91/include/mach/at91sam926x_board_init.h new file +48
-0@@ -0,0 +1,231 @@ +#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 <[email protected]> +* +* 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; +};
Quoted 8 lines
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h line 54
Quoted 6 lines
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h new file +6
-0+ + +static void __always_inline access_sdram(void) +{ +writel (0x00000000 ,AT91_SDRAM_BASE ); +}Is there a reason to use
__always_inlinevs regular inline here?
My thinking here is that the compiler is forced to inline this, so everything ends up in one function and thus in the same section. So inline is not a hint, but an order that must be followed.
Quoted 20 lines
Quoted 20 lines
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h new file +19
-0+ +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) \
Quoted 8 lines
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h line 77
Quoted 4 lines
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h new file +4
-0+ __raw_readl(cfg->sdramc + field) + +#define at91_sdramc_write (field, value) \ + __raw_writel(value, cfg->sdramc + field)I'd rather these were inline functions that didn't implicitly rely on "cfg" to be defined, but that's my personal preference, so feel free to keep it this way.
Will drop the macros in second patch.
Quoted 9 lines
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h line 80
Quoted 4 lines
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h new file +3
-0+ +static void __always_inline __bare_init at91sam926x_sdramc_init(struct at91sam926x_board_cfg *cfg) +{Using
__always_inlineand__bare_initat the same time doesn't make much sense to me. If function is always inlined then it ends up in whatever section its caller is in and if it is placed into "bare init" section then it's not really inlined. Am I missing something?
My bad, thanks for spotting this. Will drop __bare_init here.
Quoted 78 lines
Quoted 18 lines
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h new file +17
-0+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); +arch/arm/mach-at91/include/mach/at91sam926x_board_init.h line 107
Quoted 10 lines
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h new file +10
-0+/* 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 */ As much as I like comments in code, this one is not really useful (I can see what's being done already and it doesn't really clarify why). Would you mind dropping this and other comment like this?
Quoted 33 lines
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h new file +33
-0+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 (); +} + +#if !defined(CONFIG_AT91SAM926X_BOARD_INIT ) +/* +* Empty function if the board do not use this. +* Board code can call this, and let Kconfig select decide if +* the board uses at91sam926x_board_init() arch/arm/mach-at91/include/mach/at91sam926x_board_init.h line 150
Quoted 10 lines
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h new file +10
-0+*/ +static void __always_inline __bare_init at91sam926x_board_init(struct at91sam926x_board_cfg *cfg) +{ +} +#else +static void __always_inline __bare_init at91sam926x_board_init(struct at91sam926x_board_cfg *cfg) +{ +u32 r; +int in_sram =running_in_sram (); +if (!IS_ENABLED(CONFIG_AT91SAM926X_BOARD_INIT)
Quoted 3 lines
return;instead to avoid having to repeat the signature twice?
Yes, much better.
Quoted 20 lines
Quoted 20 lines
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h new file +19
-0+__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); +
Quoted 8 lines
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h line 175
Quoted 6 lines
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h new file +6
-0+/* +* PMC Check if the PLL is already initialized +*/ + r =at91_pmc_read (AT91_PMC_MCKR ); +if (r &AT91_PMC_CSS && !in_sram) +return ;Does GCC say anything about lack of parenthesis around bitwise and above?
No warning, but will add ().
Quoted 49 lines
Quoted 36 lines
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h new file +35
-0+ +/* +* 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 arch/arm/mach-at91/include/mach/at91sam926x_board_init.h line 220
Quoted 10 lines
arch/arm/mach-at91/include/mach/at91sam926x_board_init.h new file +10
-0+*/ +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 if (
IS_ENABLED(CONFIG_SYS_MATRIX_MCFG_REMAP))
Quoted 1 line
here as well?
Will delete this chunk, as there are no other references to SYS_MATRIX_MCFG_REMAP
Thanks for your feedback. Will post an updated patch set.
Sam
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 4/24 at91sam9263ek: move reset vector to board code
In reply to Sam RavnborgMove 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
--- arch/arm/boards/at91sam9263ek/lowlevel_init.c | 43 ++++++++++++++++++++------- arch/arm/mach-at91/Kconfig | 3 +- 2 files changed, 33 insertions(+), 13 deletions(-)
arch/arm/boards/at91sam9263ek/lowlevel_init.c +32 -11
@@ -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_cAT91_RSTC_RSTTYP_WAKEUP |AT91_RSTC_RSTTYP_WATCHDOG ; } + +static void __bare_init at91sam9263ek_init(void) +{ +struct at91sam926x_board_cfg cfg; + + cfg.pio =IOMEM (AT91SAM9263_BASE_PIOD ); + cfg.sdramc =IOMEM (AT91SAM9263_BASE_SDRAMC0 ); + cfg.ebi_pio_is_peripha = true; + cfg.matrix_csa =AT91_MATRIX_EBI0CSA ; + +at91sam9263ek_board_config (&cfg); +at91sam926x_board_init (&cfg); + +barebox_arm_entry (AT91_CHIPSELECT_1 ,at91_get_sdram_size (cfg.sdramc), +NULL ); +} + +void __naked __bare_init barebox_arm_reset_vector(void) +{ +arm_cpu_lowlevel_init (); + +arm_setup_stack (AT91SAM9263_SRAM0_BASE +AT91SAM9263_SRAM0_SIZE -16 ); + +at91sam9263ek_init (); +}
arch/arm/mach-at91/Kconfig +1 -2
@@ -442,8 +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
Signature · 7 lines
2.12.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 5/24 at91sam9261ek, at91sam9g10ek: move reset vector to board code
In reply to Sam RavnborgMove reset vector to board code and drop use of arch/arm/mach-at91/at91sam9261_lowlevel_init.c.
--- 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(-)
arch/arm/boards/at91sam9261ek/Makefile +1 -1
@@ -1,4 +1,4 @@ obj-y += init.o -lwl-$(CONFIG_AT91SAM926X_LWL) += lowlevel_init.o +lwl-y += lowlevel_init.o bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9261ek
arch/arm/boards/at91sam9261ek/lowlevel_init.c +30 -11
56 lines not on this page · raw message
arch/arm/mach-at91/Kconfig +1 -3
@@ -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>
Signature · 7 lines
2.12.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 6/24 pm9261: move reset vector to board code
In reply to Sam Ravnborg--- arch/arm/boards/pm9261/lowlevel_init.c | 39 +++++++++++++++++++++++++--------- arch/arm/mach-at91/Kconfig | 3 +-- 2 files changed, 30 insertions(+), 12 deletions(-)
arch/arm/boards/pm9261/lowlevel_init.c +29 -10
@@ -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_cAT91_RSTC_RSTTYP_WAKEUP |AT91_RSTC_RSTTYP_WATCHDOG ; } + +static void __bare_init pm9261_init(void) +{ +struct at91sam926x_board_cfg cfg; + + cfg.pio =IOMEM (AT91SAM9261_BASE_PIOC ); + cfg.sdramc =IOMEM (AT91SAM9261_BASE_SDRAMC ); + cfg.ebi_pio_is_peripha = false; + cfg.matrix_csa =AT91_MATRIX_EBICSA ; + +pm9261_board_config (&cfg); +at91sam926x_board_init (&cfg); + +barebox_arm_entry (AT91_CHIPSELECT_1 ,at91_get_sdram_size (cfg.sdramc), +NULL ); +} + +void __naked __bare_init barebox_arm_reset_vector(void) +{ +arm_cpu_lowlevel_init (); + +arm_setup_stack (AT91SAM9261_SRAM_BASE +AT91SAM9261_SRAM_SIZE -16 ); + +pm9261_init (); +}
arch/arm/mach-at91/Kconfig +1 -2
@@ -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
Signature · 7 lines
2.12.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 7/24 at91: drop unused at91sam9261_lowlevel_init
In reply to Sam RavnborgAll at91sam9261 based boards uses board specific reset vectors so the mach-at91 provided version is no longer in use.
Delete unused CONFIG symbols too.
--- arch/arm/mach-at91/Kconfig | 2 -- arch/arm/mach-at91/Makefile | 1 - arch/arm/mach-at91/at91sam9261_lowlevel_init.c | 48 -------------------------- 3 files changed, 51 deletions(-) delete mode 100644 arch/arm/mach-at91/at91sam9261_lowlevel_init.c
arch/arm/mach-at91/Kconfig +0 -2
@@ -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
arch/arm/mach-at91/Makefile +0 -1
@@ -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
arch/arm/mach-at91/at91sam9261_lowlevel_init.c deleted +0 -48
48 lines not on this page · raw message
Signature · 7 lines
2.12.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 8/24 pm9263: move reset vector to board code
In reply to Sam Ravnborg--- arch/arm/boards/pm9263/lowlevel_init.c | 43 +++++++++++++++++++++++++--------- arch/arm/mach-at91/Kconfig | 3 +-- 2 files changed, 33 insertions(+), 13 deletions(-)
arch/arm/boards/pm9263/lowlevel_init.c +32 -11
@@ -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_cAT91_RSTC_RSTTYP_WAKEUP |AT91_RSTC_RSTTYP_WATCHDOG ; } + +static void __bare_init pm9263_board_init(void) +{ +struct at91sam926x_board_cfg cfg; + + cfg.pio =IOMEM (AT91SAM9263_BASE_PIOD ); + cfg.sdramc =IOMEM (AT91SAM9263_BASE_SDRAMC0 ); + cfg.ebi_pio_is_peripha = true; + cfg.matrix_csa =AT91_MATRIX_EBI0CSA ; + +pm9263_board_config (&cfg); +at91sam926x_board_init (&cfg); + +barebox_arm_entry (AT91_CHIPSELECT_1 ,at91_get_sdram_size (cfg.sdramc), +NULL ); +} + +void __naked __bare_init barebox_arm_reset_vector(void) +{ +arm_cpu_lowlevel_init (); + +arm_setup_stack (AT91SAM9263_SRAM0_BASE +AT91SAM9263_SRAM0_SIZE -16 ); + +pm9263_board_init (); +}
arch/arm/mach-at91/Kconfig +1 -2
@@ -450,8 +450,7 @@ config MACH_MMCCPU 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
Signature · 7 lines
2.12.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 9/24 usb-a926x: move reset vector to board code
In reply to Sam RavnborgFor all Calao USB boards move reset vector to board code. Introduce two different lowlevel.c files, one for each processor.
Include a rename to make filenames similar.
---
arch/arm/boards/usb-a926x/Makefile | 4 +-
arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c | 26 +++++++++++++
..._a9263_lowlevel_init.c => usb_a9263_lowlevel.c} | 43 ++++++++++++++++------
arch/arm/mach-at91/Kconfig | 5 +--
4 files changed, 62 insertions(+), 16 deletions(-)
create mode 100644 arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c
rename arch/arm/boards/usb-a926x/{usb_a9263_lowlevel_init.c => usb_a9263_lowlevel.c} (76%)arch/arm/boards/usb-a926x/Makefile +3 -1
@@ -2,6 +2,8 @@ obj-y += init.o obj-$(CONFIG_AT91_BOOTSTRAP) += usb_a9263_bootstrap.o -lwl-$(CONFIG_AT91SAM926X_LWL) += usb_a9263_lowlevel_init.o +lwl-$(CONFIG_MACH_USB_A9260) += usb_a9260_lowlevel.o +lwl-$(CONFIG_MACH_USB_A9G20) += usb_a9260_lowlevel.o +lwl-$(CONFIG_MACH_USB_A9263) += usb_a9263_lowlevel.o bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-usb-a926x
arch/arm/boards/usb-a926x/usb_a9260_lowlevel.c new file +26 -0
@@ -0,0 +1,26 @@ +/* +* Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> +* +* Under GPLv2 +*/ + +#include <common.h> +#include <init.h> + +#include <asm/barebox-arm-head.h> +#include <asm/barebox-arm.h> + +#include <mach/at91sam9_sdramc.h> +#include <mach/at91sam9260.h> +#include <mach/hardware.h> + +void __naked __bare_init barebox_arm_reset_vector(void) +{ +arm_cpu_lowlevel_init (); + +arm_setup_stack (AT91SAM9260_SRAM_BASE +AT91SAM9260_SRAM_SIZE -16 ); + +barebox_arm_entry (AT91_CHIPSELECT_1 , +at91_get_sdram_size (IOMEM (AT91SAM9260_BASE_SDRAMC )), +NULL ); +}
arch/arm/boards/usb-a926x/usb_a9263_lowlevel.c renamed from arch/arm/boards/usb-a926x/usb_a9263_lowlevel_init.c +32 -11
58 lines not on this page · raw message
arch/arm/mach-at91/Kconfig +1 -4
@@ -305,7 +305,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>
@@ -396,7 +395,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>
@@ -466,8 +464,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>
Signature · 7 lines
2.12.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 10/24 mmccpu: delete unused lowlevel_init
In reply to Sam Ravnborg--- arch/arm/boards/mmccpu/Makefile | 3 - arch/arm/boards/mmccpu/lowlevel_init.c | 135 --------------------------------- 2 files changed, 138 deletions(-) delete mode 100644 arch/arm/boards/mmccpu/lowlevel_init.c
arch/arm/boards/mmccpu/Makefile +0 -3
@@ -1,4 +1 @@ obj-y += init.o - -# Not used, documented by a lwl-n assignment -lwl-n += lowlevel_init.o
arch/arm/boards/mmccpu/lowlevel_init.c deleted +0 -135
135 lines not on this page · raw message
Signature · 7 lines
2.12.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 11/24 mmccpu: move reset vector to board code
In reply to Sam RavnborgIntroduce lowlevel.c to hold the reser vector code for the board.
--- arch/arm/boards/mmccpu/Makefile | 2 ++ arch/arm/boards/mmccpu/lowlevel.c | 26 ++++++++++++++++++++++++++ arch/arm/mach-at91/Kconfig | 1 - 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 arch/arm/boards/mmccpu/lowlevel.c
arch/arm/boards/mmccpu/Makefile +2 -0
@@ -1 +1,3 @@ obj-y += init.o + +lwl-y += lowlevel.o
arch/arm/boards/mmccpu/lowlevel.c new file +26 -0
@@ -0,0 +1,26 @@ +/* +* Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> +* +* Under GPLv2 +*/ + +#include <common.h> +#include <init.h> + +#include <asm/barebox-arm-head.h> +#include <asm/barebox-arm.h> + +#include <mach/at91sam9_sdramc.h> +#include <mach/at91sam9263.h> +#include <mach/hardware.h> + +void __naked __bare_init barebox_arm_reset_vector(void) +{ +arm_cpu_lowlevel_init (); + +arm_setup_stack (AT91SAM9263_SRAM0_BASE +AT91SAM9263_SRAM0_SIZE -16 ); + +barebox_arm_entry (AT91_CHIPSELECT_1 , +at91_get_sdram_size (IOMEM (AT91SAM9263_BASE_SDRAMC0 )), +NULL ); +}
arch/arm/mach-at91/Kconfig +0 -1
@@ -441,7 +441,6 @@ config MACH_AT91SAM9263EK config MACH_MMCCPU bool "Bucyrus MMC-CPU" - select AT91SAM9263_LWL help Say y here if you are using the Bucyrus MMC-CPU
Signature · 7 lines
2.12.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 12/24 tny-a926x: delete unused tny_a9263_lowlevel_init.c
In reply to Sam Ravnborg--- arch/arm/boards/tny-a926x/Makefile | 3 - .../arm/boards/tny-a926x/tny_a9263_lowlevel_init.c | 107 --------------------- 2 files changed, 110 deletions(-) delete mode 100644 arch/arm/boards/tny-a926x/tny_a9263_lowlevel_init.c
arch/arm/boards/tny-a926x/Makefile +0 -3
@@ -2,7 +2,4 @@ obj-y += init.o obj-$(CONFIG_AT91_BOOTSTRAP) += tny_a9263_bootstrap.o -# Not used, documented with a lwl-n assignment -lwl-n += tny_a9263_lowlevel_init.o - bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-tny-a926x
arch/arm/boards/tny-a926x/tny_a9263_lowlevel_init.c deleted +0 -107
107 lines not on this page · raw message
Signature · 7 lines
2.12.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 13/24 tny-a926x: move reset vector to board code
In reply to Sam RavnborgCreate two files (one for each CPU type) that
contains the reset vector.
--- arch/arm/boards/tny-a926x/Makefile | 4 ++++ arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c | 26 ++++++++++++++++++++++++++ arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c | 26 ++++++++++++++++++++++++++ arch/arm/mach-at91/Kconfig | 3 --- 4 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c create mode 100644 arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c
arch/arm/boards/tny-a926x/Makefile +4 -0
@@ -2,4 +2,8 @@ obj-y += init.o obj-$(CONFIG_AT91_BOOTSTRAP) += tny_a9263_bootstrap.o +lwl-$(CONFIG_MACH_TNY_A9260) += tny_a9260_lowlevel.o +lwl-$(CONFIG_MACH_TNY_A9G20) += tny_a9260_lowlevel.o +lwl-$(CONFIG_MACH_TNY_A9263) += tny_a9263_lowlevel.o + bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-tny-a926x
arch/arm/boards/tny-a926x/tny_a9260_lowlevel.c new file +26 -0
@@ -0,0 +1,26 @@ +/* +* Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> +* +* Under GPLv2 +*/ + +#include <common.h> +#include <init.h> + +#include <asm/barebox-arm-head.h> +#include <asm/barebox-arm.h> + +#include <mach/at91sam9_sdramc.h> +#include <mach/at91sam9260.h> +#include <mach/hardware.h> + +void __naked __bare_init barebox_arm_reset_vector(void) +{ +arm_cpu_lowlevel_init (); + +arm_setup_stack (AT91SAM9260_SRAM_BASE +AT91SAM9260_SRAM_SIZE -16 ); + +barebox_arm_entry (AT91_CHIPSELECT_1 , +at91_get_sdram_size (IOMEM (AT91SAM9260_BASE_SDRAMC )), +NULL ); +}
arch/arm/boards/tny-a926x/tny_a9263_lowlevel.c new file +26 -0
@@ -0,0 +1,26 @@ +/* +* Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> +* +* Under GPLv2 +*/ + +#include <common.h> +#include <init.h> + +#include <asm/barebox-arm-head.h> +#include <asm/barebox-arm.h> + +#include <mach/at91sam9_sdramc.h> +#include <mach/at91sam9263.h> +#include <mach/hardware.h> + +void __naked __bare_init barebox_arm_reset_vector(void) +{ +arm_cpu_lowlevel_init (); + +arm_setup_stack (AT91SAM9263_SRAM0_BASE +AT91SAM9263_SRAM0_SIZE -16 ); + +barebox_arm_entry (AT91_CHIPSELECT_1 , +at91_get_sdram_size (IOMEM (AT91SAM9263_BASE_SDRAMC0 )), +NULL ); +}
arch/arm/mach-at91/Kconfig +0 -3
@@ -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>
@@ -387,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>
@@ -455,7 +453,6 @@ config MACH_TNY_A9263 bool "CALAO TNY-A9263" select SUPPORT_CALAO_MOB_TNY_MD2 select HAVE_AT91_BOOTSTRAP - select AT91SAM9263_LWL help Select this if you are using a Calao Systems TNY-A9263. <http://www.calao-systems.com>
Signature · 7 lines
2.12.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 14/24 qil-a926x: move reset vector to board code
In reply to Sam RavnborgCreate new file lowlevel.c that contains the reset vector.
--- arch/arm/boards/qil-a926x/Makefile | 3 +++ arch/arm/boards/qil-a926x/lowlevel.c | 26 ++++++++++++++++++++++++++ arch/arm/mach-at91/Kconfig | 2 -- 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 arch/arm/boards/qil-a926x/lowlevel.c
arch/arm/boards/qil-a926x/Makefile +3 -0
@@ -1,2 +1,5 @@ obj-y += init.o + +lwl-y += lowlevel.o + bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-qil-a926x
arch/arm/boards/qil-a926x/lowlevel.c new file +26 -0
@@ -0,0 +1,26 @@ +/* +* Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> +* +* Under GPLv2 +*/ + +#include <common.h> +#include <init.h> + +#include <asm/barebox-arm-head.h> +#include <asm/barebox-arm.h> + +#include <mach/at91sam9_sdramc.h> +#include <mach/at91sam9260.h> +#include <mach/hardware.h> + +void __naked __bare_init barebox_arm_reset_vector(void) +{ +arm_cpu_lowlevel_init (); + +arm_setup_stack (AT91SAM9260_SRAM_BASE +AT91SAM9260_SRAM_SIZE -16 ); + +barebox_arm_entry (AT91_CHIPSELECT_1 , +at91_get_sdram_size (IOMEM (AT91SAM9260_BASE_SDRAMC )), +NULL ); +}
arch/arm/mach-at91/Kconfig +0 -2
@@ -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>
Signature · 7 lines
2.12.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 15/24 haba-knx: move reset vector to board code
In reply to Sam RavnborgCreate new file lowlevel.c that contains the reset vector.
--- arch/arm/boards/haba-knx/Makefile | 3 +++ arch/arm/boards/haba-knx/lowlevel.c | 26 ++++++++++++++++++++++++++ arch/arm/mach-at91/Kconfig | 1 - 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 arch/arm/boards/haba-knx/lowlevel.c
arch/arm/boards/haba-knx/Makefile +3 -0
@@ -1,2 +1,5 @@ obj-y += init.o + +lwl-y += lowlevel.o + bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-haba-knx
arch/arm/boards/haba-knx/lowlevel.c new file +26 -0
@@ -0,0 +1,26 @@ +/* +* Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> +* +* Under GPLv2 +*/ + +#include <common.h> +#include <init.h> + +#include <asm/barebox-arm-head.h> +#include <asm/barebox-arm.h> + +#include <mach/at91sam9_sdramc.h> +#include <mach/at91sam9260.h> +#include <mach/hardware.h> + +void __naked __bare_init barebox_arm_reset_vector(void) +{ +arm_cpu_lowlevel_init (); + +arm_setup_stack (AT91SAM9260_SRAM_BASE +AT91SAM9260_SRAM_SIZE -16 ); + +barebox_arm_entry (AT91_CHIPSELECT_1 , +at91_get_sdram_size (IOMEM (AT91SAM9260_BASE_SDRAMC )), +NULL ); +}
arch/arm/mach-at91/Kconfig +0 -1
@@ -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>
Signature · 7 lines
2.12.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 16/24 sama5d{3, 4}{xek, xplained}: move reset vector to board code
In reply to Sam RavnborgInclude deletion of now unused sama5d3_lowlevel_init.c and related CONFIG symbols
---
arch/arm/boards/sama5d3_xplained/Makefile | 1 +
.../sama5d3_xplained/lowlevel.c} | 10 ++++------
arch/arm/boards/sama5d3xek/Makefile | 1 +
arch/arm/boards/sama5d3xek/lowlevel.c | 23 ++++++++++++++++++++++
arch/arm/boards/sama5d4_xplained/Makefile | 1 +
arch/arm/boards/sama5d4_xplained/lowlevel.c | 23 ++++++++++++++++++++++
arch/arm/boards/sama5d4ek/Makefile | 1 +
arch/arm/boards/sama5d4ek/lowlevel.c | 23 ++++++++++++++++++++++
arch/arm/mach-at91/Kconfig | 8 --------
arch/arm/mach-at91/Makefile | 2 --
10 files changed, 77 insertions(+), 16 deletions(-)
rename arch/arm/{mach-at91/sama5d3_lowlevel_init.c => boards/sama5d3_xplained/lowlevel.c} (86%)
create mode 100644 arch/arm/boards/sama5d3xek/lowlevel.c
create mode 100644 arch/arm/boards/sama5d4_xplained/lowlevel.c
create mode 100644 arch/arm/boards/sama5d4ek/lowlevel.carch/arm/boards/sama5d3_xplained/Makefile +1 -0
@@ -1,2 +1,3 @@ obj-y += init.o +lwl-y += lowlevel.o bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-sama5d3_xplained
arch/arm/boards/sama5d3_xplained/lowlevel.c renamed from arch/arm/mach-at91/sama5d3_lowlevel_init.c +4 -6
@@ -4,16 +4,14 @@* Under GPLv2 */ -#define __LOWLEVEL_INIT__ -#include <common.h> -#include <linux/sizes.h> #include <init.h> -#include <asm/system.h> -#include <asm/barebox-arm.h> +#include <asm/barebox-arm-head.h> -#include <mach/hardware.h> +#include <asm/barebox-arm.h> +#include <mach/at91sam9_ddrsdr.h> +#include <mach/hardware.h> void __naked __bare_init barebox_arm_reset_vector(void) {
arch/arm/boards/sama5d3xek/Makefile +1 -0
@@ -1,3 +1,4 @@ obj-y += init.o obj-$(CONFIG_W1) += hw_version.o +lwl-y += lowlevel.o bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-sama5d3xek
arch/arm/boards/sama5d3xek/lowlevel.c new file +23 -0
@@ -0,0 +1,23 @@ +/* +* Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> +* +* Under GPLv2 +*/ + +#include <common.h> +#include <init.h> + +#include <asm/barebox-arm-head.h> +#include <asm/barebox-arm.h> + +#include <mach/at91sam9_ddrsdr.h> +#include <mach/hardware.h> + +void __naked __bare_init barebox_arm_reset_vector(void) +{ +arm_cpu_lowlevel_init (); + +arm_setup_stack (SAMA5D3_SRAM_BASE +SAMA5D3_SRAM_SIZE -16 ); + +barebox_arm_entry (SAMA5_DDRCS ,at91sama5_get_ddram_size (),NULL ); +}
arch/arm/boards/sama5d4_xplained/Makefile +1 -0
@@ -1 +1,2 @@ obj-y += sama5d4_xplained.o +lwl-y += lowlevel.o
arch/arm/boards/sama5d4_xplained/lowlevel.c new file +23 -0
@@ -0,0 +1,23 @@ +/* +* Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> +* +* Under GPLv2 +*/ + +#include <common.h> +#include <init.h> + +#include <asm/barebox-arm-head.h> +#include <asm/barebox-arm.h> + +#include <mach/at91sam9_ddrsdr.h> +#include <mach/hardware.h> + +void __naked __bare_init barebox_arm_reset_vector(void) +{ +arm_cpu_lowlevel_init (); + +arm_setup_stack (SAMA5D3_SRAM_BASE +SAMA5D3_SRAM_SIZE -16 ); + +barebox_arm_entry (SAMA5_DDRCS ,at91sama5_get_ddram_size (),NULL ); +}
arch/arm/boards/sama5d4ek/Makefile +1 -0
@@ -1 +1,2 @@ obj-y += sama5d4ek.o +lwl-y += lowlevel.o
arch/arm/boards/sama5d4ek/lowlevel.c new file +23 -0
@@ -0,0 +1,23 @@ +/* +* Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> +* +* Under GPLv2 +*/ + +#include <common.h> +#include <init.h> + +#include <asm/barebox-arm-head.h> +#include <asm/barebox-arm.h> + +#include <mach/at91sam9_ddrsdr.h> +#include <mach/hardware.h> + +void __naked __bare_init barebox_arm_reset_vector(void) +{ +arm_cpu_lowlevel_init (); + +arm_setup_stack (SAMA5D3_SRAM_BASE +SAMA5D3_SRAM_SIZE -16 ); + +barebox_arm_entry (SAMA5_DDRCS ,at91sama5_get_ddram_size (),NULL ); +}
arch/arm/mach-at91/Kconfig +0 -8
@@ -53,10 +53,6 @@ config AT91SAM9N12_LWL bool config AT91RM9200_LWL bool -config SAMA5D3_LWL - bool -config SAMA5D4_LWL - bool config AT91SAM9_SMC bool
@@ -522,13 +518,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.
@@ -545,13 +539,11 @@ choice config MACH_SAMA5D4EK bool "Atmel SAMA5D4 Evaluation Kit" - select SAMA5D4_LWL help Select this if you are using Atmel's SAMA5D4-EK Evaluation Kit. config MACH_SAMA5D4_XPLAINED bool "Atmel SAMA5D4 XPLAINED ULTRA Evaluation Kit" - select SAMA5D4_LWL help Select this if you are using Atmel's SAMA5D4_XPLAINED ULTRA Evaluation Kit.
arch/arm/mach-at91/Makefile +0 -2
@@ -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
Signature · 7 lines
2.12.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 17/24 at91sam9n12ek: move reset vector to board code
In reply to Sam RavnborgDelete the unused at91sam9n12_lowlevel_init.c Create new lowlevel.c that contains the reset vector.
---
arch/arm/boards/at91sam9n12ek/Makefile | 3 +++
.../at91sam9n12ek/lowlevel.c} | 13 +++++--------
arch/arm/mach-at91/Kconfig | 3 ---
arch/arm/mach-at91/Makefile | 1 -
4 files changed, 8 insertions(+), 12 deletions(-)
rename arch/arm/{mach-at91/at91sam9n12_lowlevel_init.c => boards/at91sam9n12ek/lowlevel.c} (84%)arch/arm/boards/at91sam9n12ek/Makefile +3 -0
@@ -1,2 +1,5 @@ obj-y += init.o + +lwl-y += lowlevel.o + bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9n12ek
arch/arm/boards/at91sam9n12ek/lowlevel.c renamed from arch/arm/mach-at91/at91sam9n12_lowlevel_init.c +5 -8
@@ -4,17 +4,14 @@* Under GPLv2 */ -#define __LOWLEVEL_INIT__ -#include <common.h> -#include <asm/system.h> -#include <asm/barebox-arm.h> +#include <init.h> +#include <asm/barebox-arm-head.h> -#include <mach/hardware.h> -#include <mach/io.h> +#include <asm/barebox-arm.h> +#include <mach/at91sam9_ddrsdr.h> -#include <init.h> -#include <linux/sizes.h> +#include <mach/hardware.h> void __naked __bare_init barebox_arm_reset_vector(void) {
arch/arm/mach-at91/Kconfig +0 -3
@@ -49,8 +49,6 @@ config AT91SAM9263_LWL bool config AT91SAM9G45_LWL bool -config AT91SAM9N12_LWL - bool config AT91RM9200_LWL bool
@@ -501,7 +499,6 @@ choice config MACH_AT91SAM9N12EK bool "Atmel AT91SAM9N12 Evaluation Kit" - select AT91SAM9N12_LWL help Select this if you are using Atmel's AT91SAM9N12-EK Evaluation Kit.
arch/arm/mach-at91/Makefile +0 -1
@@ -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
Signature · 7 lines
2.12.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 18/24 at91sam9260ek, at91sam9g20ek: move reset vector to board code
In reply to Sam RavnborgCreate new lowlevel.c that contains the reset vector. Drop unused CONFIG symbols
--- 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
arch/arm/boards/at91sam9260ek/Makefile +3 -0
@@ -1,2 +1,5 @@ obj-y += init.o + +lwl-y += lowlevel.o + bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9260ek
arch/arm/boards/at91sam9260ek/lowlevel.c new file +26 -0
@@ -0,0 +1,26 @@ +/* +* Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> +* +* Under GPLv2 +*/ + +#include <common.h> +#include <init.h> + +#include <asm/barebox-arm-head.h> +#include <asm/barebox-arm.h> + +#include <mach/at91sam9_sdramc.h> +#include <mach/at91sam9260.h> +#include <mach/hardware.h> + +void __naked __bare_init barebox_arm_reset_vector(void) +{ +arm_cpu_lowlevel_init (); + +arm_setup_stack (AT91SAM9260_SRAM_BASE +AT91SAM9260_SRAM_SIZE -16 ); + +barebox_arm_entry (AT91_CHIPSELECT_1 , +at91_get_sdram_size (IOMEM (AT91SAM9260_BASE_SDRAMC )), +NULL ); +}
arch/arm/mach-at91/Kconfig +0 -2
@@ -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.
Signature · 7 lines
2.12.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 19/24 at91sam9m10g45ek, at91sam9m10ihd, pm9g45: move reset vector to board code
In reply to Sam RavnborgThese 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
---
arch/arm/boards/at91sam9m10g45ek/Makefile | 3 +++
.../at91sam9m10g45ek/lowlevel.c} | 11 ++++------
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, 61 insertions(+), 13 deletions(-)
rename arch/arm/{mach-at91/at91sam9g45_lowlevel_init.c => boards/at91sam9m10g45ek/lowlevel.c} (84%)
create mode 100644 arch/arm/boards/at91sam9m10ihd/lowlevel.c
create mode 100644 arch/arm/boards/pm9g45/lowlevel.carch/arm/boards/at91sam9m10g45ek/Makefile +3 -0
@@ -1,2 +1,5 @@ obj-y += init.o + +lwl-y += lowlevel.o + bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9m10g45ek
arch/arm/boards/at91sam9m10g45ek/lowlevel.c renamed from arch/arm/mach-at91/at91sam9g45_lowlevel_init.c +4 -7
@@ -4,17 +4,14 @@* Under GPLv2 */ -#define __LOWLEVEL_INIT__ -#include <common.h> -#include <asm/system.h> -#include <asm/barebox-arm.h> +#include <init.h> +#include <asm/barebox-arm-head.h> +#include <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) {
arch/arm/boards/at91sam9m10ihd/Makefile +2 -0
@@ -1,2 +1,4 @@ obj-y += init.o obj-y += hw_version.o + +lwl-y += lowlevel.o
arch/arm/boards/at91sam9m10ihd/lowlevel.c new file +25 -0
@@ -0,0 +1,25 @@ +/* +* Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> +* +* Under GPLv2 +*/ + +#include <common.h> +#include <init.h> + +#include <asm/barebox-arm-head.h> +#include <asm/barebox-arm.h> + +#include <mach/at91sam9_ddrsdr.h> +#include <mach/at91sam9g45.h> +#include <mach/hardware.h> + +void __naked __bare_init barebox_arm_reset_vector(void) +{ +arm_cpu_lowlevel_init (); + +arm_setup_stack (AT91SAM9G45_SRAM_BASE +AT91SAM9G45_SRAM_SIZE -16 ); + +barebox_arm_entry (AT91_CHIPSELECT_6 ,at91sam9g45_get_ddram_size (1 ), +NULL ); +}
arch/arm/boards/pm9g45/Makefile +3 -0
@@ -1,2 +1,5 @@ obj-y += init.o + +lwl-y += lowlevel.o + bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-pm9g45
arch/arm/boards/pm9g45/lowlevel.c new file +24 -0
@@ -0,0 +1,24 @@ +/* +* Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> +* +* Under GPLv2 +*/ + +#include <common.h> +#include <init.h> + +#include <asm/barebox-arm-head.h> +#include <asm/barebox-arm.h> + +#include <mach/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 ); +}
arch/arm/mach-at91/Kconfig +0 -5
@@ -47,8 +47,6 @@ config AT91SAM9260_LWL bool config AT91SAM9263_LWL bool -config AT91SAM9G45_LWL - bool config AT91RM9200_LWL bool
@@ -465,14 +463,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)
@@ -480,7 +476,6 @@ config MACH_AT91SAM9M10G45EK config MACH_PM9G45 bool "Ronetix PM9G45" - select AT91SAM9G45_LWL help Say y here if you are using the Ronetix PM9G45 Board
arch/arm/mach-at91/Makefile +0 -1
@@ -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
Signature · 7 lines
2.12.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 20/24 animeo: move reset vector to board code
In reply to Sam Ravnborg--- 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
arch/arm/boards/animeo_ip/Makefile +3 -0
@@ -1,2 +1,5 @@ obj-y += init.o + +lwl-y += lowlevel.o + bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-animeo_ip
arch/arm/boards/animeo_ip/lowlevel.c new file +26 -0
@@ -0,0 +1,26 @@ +/* +* Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> +* +* Under GPLv2 +*/ + +#include <common.h> +#include <init.h> + +#include <asm/barebox-arm-head.h> +#include <asm/barebox-arm.h> + +#include <mach/at91sam9_sdramc.h> +#include <mach/at91sam9260.h> +#include <mach/hardware.h> + +void __naked __bare_init barebox_arm_reset_vector(void) +{ +arm_cpu_lowlevel_init (); + +arm_setup_stack (AT91SAM9260_SRAM_BASE +AT91SAM9260_SRAM_SIZE -16 ); + +barebox_arm_entry (AT91_CHIPSELECT_1 , +at91_get_sdram_size (IOMEM (AT91SAM9260_BASE_SDRAMC )), +NULL ); +}
arch/arm/mach-at91/Kconfig +0 -1
@@ -269,7 +269,6 @@ choice config MACH_ANIMEO_IP bool "Somfy Animeo IP" - select AT91SAM9260_LWL depends on !CONSOLE_NONE config MACH_AT91SAM9260EK
Signature · 7 lines
2.12.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 21/24 telit-evk-pro3: move reset vector to board code
In reply to Sam Ravnborg--- 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
arch/arm/boards/telit-evk-pro3/Makefile +2 -0
@@ -1 +1,3 @@ obj-y += init.o + +lwl-y += lowlevel.o
arch/arm/boards/telit-evk-pro3/lowlevel.c new file +26 -0
@@ -0,0 +1,26 @@ +/* +* Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> +* +* Under GPLv2 +*/ + +#include <common.h> +#include <init.h> + +#include <asm/barebox-arm-head.h> +#include <asm/barebox-arm.h> + +#include <mach/at91sam9_sdramc.h> +#include <mach/at91sam9260.h> +#include <mach/hardware.h> + +void __naked __bare_init barebox_arm_reset_vector(void) +{ +arm_cpu_lowlevel_init (); + +arm_setup_stack (AT91SAM9260_SRAM_BASE +AT91SAM9260_SRAM_SIZE -16 ); + +barebox_arm_entry (AT91_CHIPSELECT_1 , +at91_get_sdram_size (IOMEM (AT91SAM9260_BASE_SDRAMC )), +NULL ); +}
arch/arm/mach-at91/Kconfig +0 -1
@@ -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>
Signature · 7 lines
2.12.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 22/24 dss11: move reset vector to board code
In reply to Sam Ravnborg--- 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
arch/arm/boards/dss11/Makefile +2 -0
@@ -1 +1,3 @@ obj-y += init.o + +lwl-y += lowlevel.o
arch/arm/boards/dss11/lowlevel.c new file +26 -0
@@ -0,0 +1,26 @@ +/* +* Copyright (C) 2009-2013 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> +* +* Under GPLv2 +*/ + +#include <common.h> +#include <init.h> + +#include <asm/barebox-arm-head.h> +#include <asm/barebox-arm.h> + +#include <mach/at91sam9_sdramc.h> +#include <mach/at91sam9260.h> +#include <mach/hardware.h> + +void __naked __bare_init barebox_arm_reset_vector(void) +{ +arm_cpu_lowlevel_init (); + +arm_setup_stack (AT91SAM9260_SRAM_BASE +AT91SAM9260_SRAM_SIZE -16 ); + +barebox_arm_entry (AT91_CHIPSELECT_1 , +at91_get_sdram_size (IOMEM (AT91SAM9260_BASE_SDRAMC )), +NULL ); +}
arch/arm/mach-at91/Kconfig +0 -1
@@ -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.
Signature · 7 lines
2.12.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 23/24 at91rm9200ek: move reset vector to board code
In reply to Sam RavnborgInclude deletion of now unused at91rm9200_lowlevel_init.c and related CONFIG symbols
---
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%)arch/arm/boards/at91rm9200ek/Makefile +3 -0
@@ -1,2 +1,5 @@ obj-y += init.o + +lwl-y += lowlevel.o + bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91rm9200ek
arch/arm/boards/at91rm9200ek/lowlevel.c renamed from arch/arm/mach-at91/at91rm9200_lowlevel_init.c +6 -8
@@ -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 ) {
arch/arm/mach-at91/Kconfig +0 -3
@@ -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>
arch/arm/mach-at91/Makefile +0 -1
@@ -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
Signature · 7 lines
2.12.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 24/24 arm: at91: remove leftovers from moving reset code in mach-at91
In reply to Sam Ravnborg--- 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
arch/arm/mach-at91/Kconfig +0 -11
@@ -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
arch/arm/mach-at91/Makefile +0 -5
@@ -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
arch/arm/mach-at91/at91sam9260_lowlevel_init.c deleted +0 -48
48 lines not on this page · raw message
arch/arm/mach-at91/at91sam9263_lowlevel_init.c deleted +0 -48
48 lines not on this page · raw message
arch/arm/mach-at91/at91sam926x_lowlevel_init.c deleted +0 -199
199 lines not on this page · raw message
arch/arm/mach-at91/include/mach/at91_lowlevel_init.h deleted +0 -46
46 lines not on this page · raw message
Signature · 7 lines
2.12.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox