pm9263: lowlevel init update
PATCH 1/5 pm9263: lowlevel init update
move PSRAM init to pm9263.c
this will allow us after to make the nor lowlevel_init generic
--- board/ronetix/pm9263/lowlevel_init.S | 17 +---------------- board/ronetix/pm9263/pm9263.c | 21 +++++++++++++++++++++ include/configs/pm9263.h | 10 +--------- 3 files changed, 23 insertions(+), 25 deletions(-)
board/ronetix/pm9263/lowlevel_init.S +1 -16
@@ -194,12 +194,10 @@ SMRDATA: .word (AT91_BASE_SYS + AT91_MATRIX_EBI0CSA) .word CONFIG_SYS_MATRIX_EBI0CSA_VAL - .word (AT91_BASE_SYS + AT91_MATRIX_EBI1CSA) - .word CONFIG_SYS_MATRIX_EBI1CSA_VAL /* flash */ .word (AT91_BASE_SYS + AT91_SMC_MODE(0)) - .word CONFIG_SYS_SMC0_CTRL0_VAL + .word CONFIG_SYS_SMC0_MODE0_VAL .word (AT91_BASE_SYS + AT91_SMC_CYCLE(0)) .word CONFIG_SYS_SMC0_CYCLE0_VAL
@@ -210,19 +208,6 @@ SMRDATA: .word (AT91_BASE_SYS + AT91_SMC_SETUP(0)) .word CONFIG_SYS_SMC0_SETUP0_VAL - /* PSRAM */ - .word (AT91_BASE_SYS + AT91_SMC1_MODE(0)) - .word CONFIG_SYS_SMC1_CTRL0_VAL - - .word (AT91_BASE_SYS + AT91_SMC1_CYCLE(0)) - .word CONFIG_SYS_SMC1_CYCLE0_VAL - - .word (AT91_BASE_SYS + AT91_SMC1_PULSE(0)) - .word CONFIG_SYS_SMC1_PULSE0_VAL - - .word (AT91_BASE_SYS + AT91_SMC1_SETUP(0)) - .word CONFIG_SYS_SMC1_SETUP0_VAL - SMRDATA1: .word (AT91_BASE_SYS + AT91_SDRAMC_MR) .word CONFIG_SYS_SDRC_MR_VAL1
board/ronetix/pm9263/pm9263.c +21 -0
@@ -165,6 +165,27 @@ void lcd_disable(void)static int pm9263_lcd_hw_psram_init (void ) {volatile uint16_t x; +unsigned long csa; + +/* Enable CS3 3.3v, no pull-ups */ + csa =at91_sys_read (AT91_MATRIX_EBI1CSA ); +at91_sys_write (AT91_MATRIX_EBI1CSA , + csa |AT91_MATRIX_EBI1_DBPUC | +AT91_MATRIX_EBI1_VDDIOMSEL_3_3V ); + +/* Configure SMC1 CS0 for PSRAM - 16-bit */ +at91_sys_write (AT91_SMC1_SETUP (0 ), +AT91_SMC_NWESETUP_ (0 ) |AT91_SMC_NCS_WRSETUP_ (0 ) | +AT91_SMC_NRDSETUP_ (0 ) |AT91_SMC_NCS_RDSETUP_ (0 )); +at91_sys_write (AT91_SMC1_PULSE (0 ), +AT91_SMC_NWEPULSE_ (7 ) |AT91_SMC_NCS_WRPULSE_ (7 ) | +AT91_SMC_NRDPULSE_ (2 ) |AT91_SMC_NCS_RDPULSE_ (7 )); +at91_sys_write (AT91_SMC1_CYCLE (0 ), +AT91_SMC_NWECYCLE_ (8 ) |AT91_SMC_NRDCYCLE_ (8 )); +at91_sys_write (AT91_SMC1_MODE (0 ), +AT91_SMC_DBW_16 | +AT91_SMC_PMEN | +AT91_SMC_PS_32 );/* setup PB29 as output */ at91_set_gpio_output (PSRAM_CRE_PIN ,1 );
include/configs/pm9263.h +1 -9
@@ -67,8 +67,6 @@#define CONFIG_SYS_PIOD_PPUDR_VAL 0xFFFF0000/* EBI0_CSA, CS1 SDRAM, CS3 NAND Flash, 3.3V memories */ #define CONFIG_SYS_MATRIX_EBI0CSA_VAL 0x0001010A -/* EBI1_CSA, 3.3v, no pull-ups */ -#define CONFIG_SYS_MATRIX_EBI1CSA_VAL 0x00010100/* SDRAM */ /* SDRAMC_MR Mode register */
@@ -100,13 +98,7 @@#define CONFIG_SYS_SMC0_SETUP0_VAL 0x0A0A0A0A/* SMC_SETUP */ #define CONFIG_SYS_SMC0_PULSE0_VAL 0x0B0B0B0B/* SMC_PULSE */ #define CONFIG_SYS_SMC0_CYCLE0_VAL 0x00160016/* SMC_CYCLE */ -#define CONFIG_SYS_SMC0_CTRL0_VAL 0x00161003/* SMC_MODE */ - -/* setup SMC1, CS0 (PSRAM) - 16-bit */ -#define CONFIG_SYS_SMC1_SETUP0_VAL 0x00000000/* SMC_SETUP */ -#define CONFIG_SYS_SMC1_PULSE0_VAL 0x07020707/* SMC_PULSE */ -#define CONFIG_SYS_SMC1_CYCLE0_VAL 0x00080008/* SMC_CYCLE */ -#define CONFIG_SYS_SMC1_CTRL0_VAL 0x31001000/* SMC_MODE */ +#define CONFIG_SYS_SMC0_MODE0_VAL 0x00161003/* SMC_MODE */ #define CONFIG_SYS_RSTC_RMR_VAL 0xA5000301/* user reset enable */
Signature · 1 line
1.6.3.1
PATCH 2/5 pm9263: use macro instead of hardcode value for the lowlevel_init
optimize a few the RAM init
--- board/ronetix/pm9263/lowlevel_init.S | 2 +- board/ronetix/pm9263/pm9263.c | 2 +- include/asm-arm/arch-at91/at91_pmc.h | 1 + include/configs/pm9263.h | 105 +++++++++++++++++++++++++-------- 4 files changed, 82 insertions(+), 28 deletions(-)
board/ronetix/pm9263/lowlevel_init.S +1 -1
@@ -87,7 +87,7 @@ POS1: */ ldr r1, =(AT91_BASE_SYS + AT91_CKGR_MOR) ldr r2, =(AT91_BASE_SYS + AT91_PMC_SR) - ldr r0, =0x0000FF01 + ldr r0, =CONFIG_SYS_MOR_VAL str r0, [r1] /* Enable main oscillator, OSCOUNT = 0xFF */ /* Reading the PMC Status to detect when the Main Oscillator is enabled */
board/ronetix/pm9263/pm9263.c +1 -1
@@ -239,7 +239,7 @@ static int pm9263_lcd_hw_psram_init(void)at91_sys_write (AT91_MATRIX_SCFG5 ,AT91_MATRIX_ARBT_FIXED_PRIORITY | (AT91_MATRIX_FIXED_DEFMSTR & (5 <<18 )) |AT91_MATRIX_DEFMSTR_TYPE_FIXED | - (AT91_MATRIX_SLOT_CYCLE & (0x80 <<0 ))); + (AT91_MATRIX_SLOT_CYCLE & (0xFF <<0 )));return 0 ; }
include/asm-arm/arch-at91/at91_pmc.h +1 -0
@@ -65,6 +65,7 @@#define AT91_PMC_USBDIV_2 (1 << 28)#define AT91_PMC_USBDIV_4 (2 << 28)#define AT91_PMC_USB96M (1 << 28)/* Divider by 2 Enable (PLLB only) */ +#define AT91_PMC_PLLA_WR_ERRATA (1 << 29)/* Bit 29 must always be set to 1 when programming the CKGR_PLLAR register */ #define AT91_PMC_MCKR (AT91_PMC + 0x30)/* Master Clock Register */ #define AT91_PMC_CSS (3 << 0)/* Master Clock Selection */
include/configs/pm9263.h +81 -28
153 lines not on this page · raw message
Signature · 1 line
1.6.3.1
PATCH 3/5 at91: add support for the PM9261 board of Ronetix GmbH
From: Ilko Iliev <[email protected]>
The PM9261 board is based on the AT91SAM9261-EK board.
Here is the page on Ronetix website:
http://www.ronetix.at/starter_kit_9261.html
--- MAINTAINERS | 1 + MAKEALL | 1 + Makefile | 3 + board/ronetix/pm9261/Makefile | 61 ++++++ board/ronetix/pm9261/config.mk | 1 + board/ronetix/pm9261/led.c | 44 ++++ board/ronetix/pm9261/lowlevel_init.S | 259 +++++++++++++++++++++++ board/ronetix/pm9261/partition.c | 47 ++++ board/ronetix/pm9261/pm9261.c | 288 +++++++++++++++++++++++++ include/configs/pm9261.h | 382 ++++++++++++++++++++++++++++++++++ 10 files changed, 1087 insertions(+), 0 deletions(-) create mode 100644 board/ronetix/pm9261/Makefile create mode 100644 board/ronetix/pm9261/config.mk create mode 100644 board/ronetix/pm9261/led.c create mode 100644 board/ronetix/pm9261/lowlevel_init.S create mode 100644 board/ronetix/pm9261/partition.c create mode 100644 board/ronetix/pm9261/pm9261.c create mode 100644 include/configs/pm9261.h
MAINTAINERS +1 -0
@@ -209,6 +209,7 @@ Klaus Heydeck <[email protected]> Ilko Iliev <[email protected]> + PM9261 AT91SAM9261 PM9263 AT91SAM9263 Gary Jennejohn <[email protected]>
MAKEALL +1 -0
@@ -587,6 +587,7 @@ LIST_at91=" \ kb9202 \ mp2usb \ m501sk \ + pm9261 \ pm9263 \ "
Makefile +3 -0
@@ -2774,6 +2774,9 @@ at91sam9rlek_config : unconfig fi; @$(MKCONFIG) -a at91sam9rlek arm arm926ejs at91sam9rlek atmel at91 +pm9261_config : unconfig + @$(MKCONFIG) $(@:_config=) arm arm926ejs pm9261 ronetix at91 + pm9263_config : unconfig @$(MKCONFIG) $(@:_config=) arm arm926ejs pm9263 ronetix at91
board/ronetix/pm9261/Makefile new file +61 -0
61 lines not on this page · raw message
board/ronetix/pm9261/config.mk new file +1 -0
@@ -0,0 +1 @@ +TEXT_BASE = 0x23f00000
board/ronetix/pm9261/led.c new file +44 -0
44 lines not on this page · raw message
board/ronetix/pm9261/lowlevel_init.S new file +259 -0
259 lines not on this page · raw message
board/ronetix/pm9261/partition.c new file +47 -0
47 lines not on this page · raw message
board/ronetix/pm9261/pm9261.c new file +288 -0
288 lines not on this page · raw message
include/configs/pm9261.h new file +382 -0
382 lines not on this page · raw message
Signature · 1 line
1.6.3.1
PATCH 4/5 at91sam9263ek: add nor flash support
this will allow you to store use it for the env and to boot directly U-Boot from
--- Makefile | 9 + board/atmel/at91sam9263ek/Makefile | 7 +- board/atmel/at91sam9263ek/at91sam9263ek.c | 19 ++- board/atmel/at91sam9263ek/lowlevel_init.S | 264 +++++++++++++++++++++++++++++ doc/README.at91 | 5 + include/configs/at91sam9263ek.h | 142 +++++++++++++++- 6 files changed, 437 insertions(+), 9 deletions(-) create mode 100644 board/atmel/at91sam9263ek/lowlevel_init.S
Makefile +9 -0
@@ -2746,6 +2746,8 @@ at91sam9261ek_config : unconfig fi; @$(MKCONFIG) -a at91sam9261ek arm arm926ejs at91sam9261ek atmel at91 +at91sam9263ek_norflash_config \ +at91sam9263ek_norflash_boot_config \ at91sam9263ek_nandflash_config \ at91sam9263ek_dataflash_config \ at91sam9263ek_dataflash_cs0_config \
@@ -2754,10 +2756,17 @@ at91sam9263ek_config : unconfig @if [ "$(findstring _nandflash,$@)" ] ; then \ echo "#define CONFIG_SYS_USE_NANDFLASH 1" >>$(obj)include/config.h ; \ $(XECHO) "... with environment variable in NAND FLASH" ; \ + elif [ "$(findstring norflash,$@)" ] ; then \ + echo "#define CONFIG_SYS_USE_NORFLASH 1" >>$(obj)include/config.h ; \ + $(XECHO) "... with environment variable in NOR FLASH" ; \ else \ echo "#define CONFIG_SYS_USE_DATAFLASH 1" >>$(obj)include/config.h ; \ $(XECHO) "... with environment variable in SPI DATAFLASH CS0" ; \ fi; + @if [ "$(findstring norflash_boot,$@)" ] ; then \ + echo "#define CONFIG_SYS_USE_BOOT_NORFLASH 1" >>$(obj)include/config.h ; \ + $(XECHO) "... and boot from NOR FLASH" ; \ + fi; @$(MKCONFIG) -a at91sam9263ek arm arm926ejs at91sam9263ek atmel at91 at91sam9rlek_nandflash_config \
board/atmel/at91sam9263ek/Makefile +5 -2
@@ -32,10 +32,13 @@ LIB = $(obj)lib$(BOARD).a COBJS-y += at91sam9263ek.o COBJS-y += led.o COBJS-$(CONFIG_HAS_DATAFLASH) += partition.o +ifndef CONFIG_SKIP_LOWLEVEL_INIT +SOBJS-y += lowlevel_init.o +endif -SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c) +SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c) OBJS := $(addprefix $(obj),$(COBJS-y)) -SOBJS := $(addprefix $(obj),$(SOBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS-y)) $(LIB): $(obj).depend $(OBJS) $(SOBJS) $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
board/atmel/at91sam9263ek/at91sam9263ek.c +18 -1
@@ -196,9 +196,16 @@ static void at91sam9263ek_lcd_hw_init(void)#include <nand.h> #include <version.h> +#ifndef CONFIG_SYS_NO_FLASH +extern flash_info_t flash_info[]; +#endif +void lcd_show_board_info (void ) {ulong dram_size, nand_size; +#ifndef CONFIG_SYS_NO_FLASH +ulong flash_size; +#endif int i;char temp[32 ];
@@ -215,9 +222,19 @@ void lcd_show_board_info(void) nand_size =0 ;for (i =0 ; i <CONFIG_SYS_MAX_NAND_DEVICE ; i++) nand_size += nand_info[i].size; -lcd_printf (" %ld MB SDRAM, %ld MB NAND\n" , +#ifndef CONFIG_SYS_NO_FLASH + flash_size =0 ; +for (i =0 ; i <CONFIG_SYS_MAX_FLASH_BANKS ; i++) + flash_size += flash_info[i].size; +#endif +lcd_printf (" %ld MB SDRAM, %ld MB NAND" , dram_size >>20 , nand_size >>20 ); +#ifndef CONFIG_SYS_NO_FLASH +lcd_printf (",\n %ld MB NOR" , + flash_size >>20 ); +#endif +lcd_puts ("\n" ); }#endif /* CONFIG_LCD_INFO */ #endif
board/atmel/at91sam9263ek/lowlevel_init.S new file +264 -0
264 lines not on this page · raw message
doc/README.at91 +5 -0
@@ -62,11 +62,16 @@ Environment variables U-Boot environment variables can be stored at different places: - Dataflash on SPI chip select 0 (dataflash card) - Nand flash. + - Nor falsh (not populate by default) You can choose your storage location at config step (here for at91sam9260ek) : make at91sam9263ek_config - use data flash (spi cs0) (default) make at91sam9263ek_nandflash_config - use nand flash make at91sam9263ek_dataflash_cs0_config - use data flash (spi cs0) + make at91sam9263ek_norflash_config - use nor falsh + + You can choose to boot directly from U-Boot at config step + make at91sam9263ek_norflash_boot_config - boot from nor falsh ------------------------------------------------------------------------------
include/configs/at91sam9263ek.h +136 -6
166 lines not on this page · raw message
Signature · 1 line
1.6.3.1
PATCH 5/5 at91: unify nor boot support
the lowlevel init sequence is the same so unify it
---
board/atmel/at91sam9263ek/Makefile | 3 -
board/atmel/at91sam9263ek/lowlevel_init.S | 264 --------------------
board/ronetix/pm9261/Makefile | 4 -
board/ronetix/pm9261/lowlevel_init.S | 259 -------------------
board/ronetix/pm9263/Makefile | 4 -
cpu/arm926ejs/at91/Makefile | 8 +-
.../pm9263 => cpu/arm926ejs/at91}/lowlevel_init.S | 22 ++-
include/asm-arm/arch-at91/at91sam9_matrix.h | 28 ++
8 files changed, 52 insertions(+), 540 deletions(-)
delete mode 100644 board/atmel/at91sam9263ek/lowlevel_init.S
delete mode 100644 board/ronetix/pm9261/lowlevel_init.S
rename {board/ronetix/pm9263 => cpu/arm926ejs/at91}/lowlevel_init.S (92%)
create mode 100644 include/asm-arm/arch-at91/at91sam9_matrix.hboard/atmel/at91sam9263ek/Makefile +0 -3
@@ -32,9 +32,6 @@ LIB = $(obj)lib$(BOARD).a COBJS-y += at91sam9263ek.o COBJS-y += led.o COBJS-$(CONFIG_HAS_DATAFLASH) += partition.o -ifndef CONFIG_SKIP_LOWLEVEL_INIT -SOBJS-y += lowlevel_init.o -endif SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c) OBJS := $(addprefix $(obj),$(COBJS-y))
board/atmel/at91sam9263ek/lowlevel_init.S deleted +0 -264
264 lines not on this page · raw message
board/ronetix/pm9261/Makefile +0 -4
@@ -34,10 +34,6 @@ COBJS-y += $(BOARD).o COBJS-y += led.o COBJS-$(CONFIG_HAS_DATAFLASH) += partition.o -ifndef CONFIG_SKIP_LOWLEVEL_INIT -SOBJS-y := lowlevel_init.o -endif - SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c) OBJS := $(addprefix $(obj),$(COBJS-y) $(SOBJS-y)) SOBJS := $(addprefix $(obj),$(SOBJS-y))
board/ronetix/pm9261/lowlevel_init.S deleted +0 -259
259 lines not on this page · raw message
board/ronetix/pm9263/Makefile +0 -4
@@ -34,10 +34,6 @@ COBJS-y += pm9263.o COBJS-y += led.o COBJS-$(CONFIG_HAS_DATAFLASH) += partition.o -ifndef CONFIG_SKIP_LOWLEVEL_INIT -SOBJS-y := lowlevel_init.o -endif - SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c) OBJS := $(addprefix $(obj),$(COBJS-y) $(SOBJS-y)) SOBJS := $(addprefix $(obj),$(SOBJS-y))
cpu/arm926ejs/at91/Makefile +6 -2
@@ -37,8 +37,12 @@ COBJS-y += cpu.o COBJS-y += reset.o COBJS-y += timer.o -SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c) -OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS-y)) +ifndef CONFIG_SKIP_LOWLEVEL_INIT +SOBJS-y := lowlevel_init.o +endif + +SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c) +OBJS := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y)) all: $(obj).depend $(LIB)
cpu/arm926ejs/at91/lowlevel_init.S renamed from board/ronetix/pm9263/lowlevel_init.S +17 -3
@@ -33,9 +33,9 @@ #include <asm/arch/at91_pio.h> #include <asm/arch/at91_rstc.h> #include <asm/arch/at91_wdt.h> +#include <asm/arch/at91sam9_matrix.h> #include <asm/arch/at91sam9_sdramc.h> #include <asm/arch/at91sam9_smc.h> -#include <asm/arch/at91sam9263_matrix.h> _TEXT_BASE: .word TEXT_BASE
@@ -87,8 +87,9 @@ POS1: */ ldr r1, =(AT91_BASE_SYS + AT91_CKGR_MOR) ldr r2, =(AT91_BASE_SYS + AT91_PMC_SR) + /* Main oscillator Enable register PMC_MOR: */ ldr r0, =CONFIG_SYS_MOR_VAL - str r0, [r1] /* Enable main oscillator, OSCOUNT = 0xFF */ + str r0, [r1] /* Reading the PMC Status to detect when the Main Oscillator is enabled */ mov r4, #AT91_PMC_MOSCS
@@ -119,7 +120,7 @@ MOSCS_Loop1: /* ---------------------------------------------------------------------------- * PMC Init Step 3. * ---------------------------------------------------------------------------- - * - Switch on the Main Oscillator 18.432 MHz + * - Switch on the Main Oscillator * ---------------------------------------------------------------------------- */ ldr r1, =(AT91_BASE_SYS + AT91_PMC_MCKR)
@@ -185,15 +186,28 @@ SMRDATA: .word (AT91_BASE_SYS + AT91_WDT_MR) .word CONFIG_SYS_WDTC_WDMR_VAL + /* configure PIOx as EBI0 D[16-31] */ +#if defined(CONFIG_AT91SAM9263) .word (AT91_BASE_SYS + AT91_PIOD + PIO_PDR) .word CONFIG_SYS_PIOD_PDR_VAL1 .word (AT91_BASE_SYS + AT91_PIOD + PIO_PUDR) .word CONFIG_SYS_PIOD_PPUDR_VAL .word (AT91_BASE_SYS + AT91_PIOD + PIO_ASR) .word CONFIG_SYS_PIOD_PPUDR_VAL +#elif defined(CONFIG_AT91SAM9261) + .word (AT91_BASE_SYS + AT91_PIOC + PIO_PDR) + .word CONFIG_SYS_PIOC_PDR_VAL1 + .word (AT91_BASE_SYS + AT91_PIOC + PIO_PUDR) + .word CONFIG_SYS_PIOC_PPUDR_VAL +#endif +#if defined(AT91_MATRIX_EBI0CSA) .word (AT91_BASE_SYS + AT91_MATRIX_EBI0CSA) .word CONFIG_SYS_MATRIX_EBI0CSA_VAL +#else /* AT91_MATRIX_EBICSA */ + .word (AT91_BASE_SYS + AT91_MATRIX_EBICSA) + .word CONFIG_SYS_MATRIX_EBICSA_VAL +#endif /* flash */ .word (AT91_BASE_SYS + AT91_SMC_MODE(0))
include/asm-arm/arch-at91/at91sam9_matrix.h new file +28 -0
@@ -0,0 +1,28 @@ +/* +* Copyright (C) 2009 Jean-Christophe PLAGNIOL-VILLARD <[email protected]> +* +* 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. +* +*/ + +#ifndef __ASM_ARCH_AT91SAM9_MATRIX_H +#define __ASM_ARCH_AT91SAM9_MATRIX_H + +#if defined(CONFIG_AT91SAM9260 ) || defined(CONFIG_AT91SAM9G20 ) +#include <asm/arch/at91sam9260_matrix.h> +#elif defined(CONFIG_AT91SAM9261 ) +#include <asm/arch/at91sam9261_matrix.h> +#elif defined(CONFIG_AT91SAM9263 ) +#include <asm/arch/at91sam9263_matrix.h> +#elif defined(CONFIG_AT91SAM9RL ) +#include <asm/arch/at91sam9rl_matrix.h> +#elif defined(CONFIG_AT91CAP9 ) +#include <asm/arch/at91cap9_matrix.h> +#else +#error "Unsupported AT91SAM9/CAP9 processor" +#endif + +#endif /* __ASM_ARCH_AT91SAM9_MATRIX_H */
Signature · 1 line
1.6.3.1