[U-Boot-Users] [PATCH 0/4] AVR32: Add support for ATSTK1003 and ATSTK1004

ATSTK1003 and ATSTK1004 are CPU daughterboards for the ATSTK1000, featuring the AT32AP7001 and AT32AP7002 CPUs respectively. These CPUs are both derivatives of the AT32AP7000, so the actual code required to support them is minimal.
The following four patches will first refactor the AP7000 code so that it works for all the three CPUs. Then, support for the ATSTK1003 and ATSTK1004 board is trivially added.
I'm posting this for review so that it can be merged as soon as the next merge window opens. Combined diffstat, summary and shortlog below.
Haavard
Makefile | 8 +- cpu/at32ap/{at32ap7000 => at32ap700x}/Makefile | 0 cpu/at32ap/{at32ap7000 => at32ap700x}/gpio.c | 7 + include/asm-avr32/arch-at32ap700x/chip-features.h | 34 ++++ .../{arch-at32ap7000 => arch-at32ap700x}/clk.h | 8 + .../{arch-at32ap7000 => arch-at32ap700x}/gpio.h | 8 + .../hmatrix2.h | 0 .../memory-map.h | 0 .../{arch-at32ap7000 => arch-at32ap700x}/mmc.h | 0 include/configs/atstk1003.h | 184 +++++++++++++++++++ include/configs/atstk1004.h | 185 ++++++++++++++++++++ 11 files changed, 433 insertions(+), 1 deletions(-) rename cpu/at32ap/{at32ap7000 => at32ap700x}/Makefile (100%) rename cpu/at32ap/{at32ap7000 => at32ap700x}/gpio.c (96%) create mode 100644 include/asm-avr32/arch-at32ap700x/chip-features.h rename include/asm-avr32/{arch-at32ap7000 => arch-at32ap700x}/clk.h (92%) rename include/asm-avr32/{arch-at32ap7000 => arch-at32ap700x}/gpio.h (98%) rename include/asm-avr32/{arch-at32ap7000 => arch-at32ap700x}/hmatrix2.h (100%) rename include/asm-avr32/{arch-at32ap7000 => arch-at32ap700x}/memory-map.h (100%) rename include/asm-avr32/{arch-at32ap7000 => arch-at32ap700x}/mmc.h (100%) create mode 100644 include/configs/atstk1003.h create mode 100644 include/configs/atstk1004.h
Haavard Skinnemoen (4): AVR32: Rename at32ap7000 -> at32ap700x AVR32: Make some AT32AP700x peripherals optional AVR32: Add support for the ATSTK1003 board AVR32: Add support for the ATSTK1004 board

The SoC-specific code for all the AT32AP700x CPUs is practically identical; the only difference is that some chips have less features than others. By doing this rename, we can add support for the AP7000 derivatives simply by making some features conditional.
Signed-off-by: Haavard Skinnemoen hskinnemoen@atmel.com --- Makefile | 2 +- cpu/at32ap/{at32ap7000 => at32ap700x}/Makefile | 0 cpu/at32ap/{at32ap7000 => at32ap700x}/gpio.c | 0 .../{arch-at32ap7000 => arch-at32ap700x}/clk.h | 0 .../{arch-at32ap7000 => arch-at32ap700x}/gpio.h | 0 .../hmatrix2.h | 0 .../memory-map.h | 0 .../{arch-at32ap7000 => arch-at32ap700x}/mmc.h | 0 8 files changed, 1 insertions(+), 1 deletions(-) rename cpu/at32ap/{at32ap7000 => at32ap700x}/Makefile (100%) rename cpu/at32ap/{at32ap7000 => at32ap700x}/gpio.c (100%) rename include/asm-avr32/{arch-at32ap7000 => arch-at32ap700x}/clk.h (100%) rename include/asm-avr32/{arch-at32ap7000 => arch-at32ap700x}/gpio.h (100%) rename include/asm-avr32/{arch-at32ap7000 => arch-at32ap700x}/hmatrix2.h (100%) rename include/asm-avr32/{arch-at32ap7000 => arch-at32ap700x}/memory-map.h (100%) rename include/asm-avr32/{arch-at32ap7000 => arch-at32ap700x}/mmc.h (100%)
diff --git a/Makefile b/Makefile index 5643aa9..f650b27 100644 --- a/Makefile +++ b/Makefile @@ -2603,7 +2603,7 @@ bf561-ezkit_config: unconfig #########################################################################
atstk1002_config : unconfig - @$(MKCONFIG) $(@:_config=) avr32 at32ap atstk1000 atmel at32ap7000 + @$(MKCONFIG) $(@:_config=) avr32 at32ap atstk1000 atmel at32ap700x
######################################################################### ######################################################################### diff --git a/cpu/at32ap/at32ap7000/Makefile b/cpu/at32ap/at32ap700x/Makefile similarity index 100% rename from cpu/at32ap/at32ap7000/Makefile rename to cpu/at32ap/at32ap700x/Makefile diff --git a/cpu/at32ap/at32ap7000/gpio.c b/cpu/at32ap/at32ap700x/gpio.c similarity index 100% rename from cpu/at32ap/at32ap7000/gpio.c rename to cpu/at32ap/at32ap700x/gpio.c diff --git a/include/asm-avr32/arch-at32ap7000/clk.h b/include/asm-avr32/arch-at32ap700x/clk.h similarity index 100% rename from include/asm-avr32/arch-at32ap7000/clk.h rename to include/asm-avr32/arch-at32ap700x/clk.h diff --git a/include/asm-avr32/arch-at32ap7000/gpio.h b/include/asm-avr32/arch-at32ap700x/gpio.h similarity index 100% rename from include/asm-avr32/arch-at32ap7000/gpio.h rename to include/asm-avr32/arch-at32ap700x/gpio.h diff --git a/include/asm-avr32/arch-at32ap7000/hmatrix2.h b/include/asm-avr32/arch-at32ap700x/hmatrix2.h similarity index 100% rename from include/asm-avr32/arch-at32ap7000/hmatrix2.h rename to include/asm-avr32/arch-at32ap700x/hmatrix2.h diff --git a/include/asm-avr32/arch-at32ap7000/memory-map.h b/include/asm-avr32/arch-at32ap700x/memory-map.h similarity index 100% rename from include/asm-avr32/arch-at32ap7000/memory-map.h rename to include/asm-avr32/arch-at32ap700x/memory-map.h diff --git a/include/asm-avr32/arch-at32ap7000/mmc.h b/include/asm-avr32/arch-at32ap700x/mmc.h similarity index 100% rename from include/asm-avr32/arch-at32ap7000/mmc.h rename to include/asm-avr32/arch-at32ap700x/mmc.h

Add a chip-features file providing definitions of the form
AT32AP700x_CHIP_HAS_<peripheral>
to indicate the availability of the given peripheral on the currently selected chip.
Signed-off-by: Haavard Skinnemoen hskinnemoen@atmel.com --- cpu/at32ap/at32ap700x/gpio.c | 7 ++++ include/asm-avr32/arch-at32ap700x/chip-features.h | 34 +++++++++++++++++++++ include/asm-avr32/arch-at32ap700x/clk.h | 8 +++++ include/asm-avr32/arch-at32ap700x/gpio.h | 8 +++++ 4 files changed, 57 insertions(+), 0 deletions(-) create mode 100644 include/asm-avr32/arch-at32ap700x/chip-features.h
diff --git a/cpu/at32ap/at32ap700x/gpio.c b/cpu/at32ap/at32ap700x/gpio.c index 52f5372..2d53726 100644 --- a/cpu/at32ap/at32ap700x/gpio.c +++ b/cpu/at32ap/at32ap700x/gpio.c @@ -21,6 +21,7 @@ */ #include <common.h>
+#include <asm/arch/chip-features.h> #include <asm/arch/gpio.h>
/* @@ -52,6 +53,7 @@ void gpio_enable_ebi(void) #endif }
+#ifdef AT32AP700x_CHIP_HAS_USART void gpio_enable_usart0(void) { gpio_select_periph_B(GPIO_PIN_PA8, 0); @@ -75,7 +77,9 @@ void gpio_enable_usart3(void) gpio_select_periph_B(GPIO_PIN_PB18, 0); gpio_select_periph_B(GPIO_PIN_PB19, 0); } +#endif
+#ifdef AT32AP700x_CHIP_HAS_MACB void gpio_enable_macb0(void) { gpio_select_periph_A(GPIO_PIN_PC3, 0); /* TXD0 */ @@ -125,7 +129,9 @@ void gpio_enable_macb1(void) gpio_select_periph_B(GPIO_PIN_PD15, 0); /* SPD */ #endif } +#endif
+#ifdef AT32AP700x_CHIP_HAS_MMCI void gpio_enable_mmci(void) { gpio_select_periph_A(GPIO_PIN_PA10, 0); /* CLK */ @@ -135,3 +141,4 @@ void gpio_enable_mmci(void) gpio_select_periph_A(GPIO_PIN_PA14, 0); /* DATA2 */ gpio_select_periph_A(GPIO_PIN_PA15, 0); /* DATA3 */ } +#endif diff --git a/include/asm-avr32/arch-at32ap700x/chip-features.h b/include/asm-avr32/arch-at32ap700x/chip-features.h new file mode 100644 index 0000000..29b1fd6 --- /dev/null +++ b/include/asm-avr32/arch-at32ap700x/chip-features.h @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2007 Atmel Corporation + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ +#ifndef __ASM_AVR32_ARCH_CHIP_FEATURES_H__ +#define __ASM_AVR32_ARCH_CHIP_FEATURES_H__ + +/* Currently, all the AP700x chips have these */ +#define AT32AP700x_CHIP_HAS_USART +#define AT32AP700x_CHIP_HAS_MMCI + +/* Only AP7000 has ethernet interface */ +#ifdef CONFIG_AT32AP7000 +#define AT32AP700x_CHIP_HAS_MACB +#endif + +#endif /* __ASM_AVR32_ARCH_CHIP_FEATURES_H__ */ diff --git a/include/asm-avr32/arch-at32ap700x/clk.h b/include/asm-avr32/arch-at32ap700x/clk.h index 7e20d97..ea84c08 100644 --- a/include/asm-avr32/arch-at32ap700x/clk.h +++ b/include/asm-avr32/arch-at32ap700x/clk.h @@ -22,6 +22,8 @@ #ifndef __ASM_AVR32_ARCH_CLK_H__ #define __ASM_AVR32_ARCH_CLK_H__
+#include <asm/arch/chip-features.h> + #ifdef CONFIG_PLL #define MAIN_CLK_RATE ((CFG_OSC0_HZ / CFG_PLL0_DIV) * CFG_PLL0_MUL) #else @@ -50,10 +52,13 @@ static inline unsigned long get_sdram_clk_rate(void) { return get_hsb_clk_rate(); } +#ifdef AT32AP700x_CHIP_HAS_USART static inline unsigned long get_usart_clk_rate(unsigned int dev_id) { return get_pba_clk_rate(); } +#endif +#ifdef AT32AP700x_CHIP_HAS_USART static inline unsigned long get_macb_pclk_rate(unsigned int dev_id) { return get_pbb_clk_rate(); @@ -62,9 +67,12 @@ static inline unsigned long get_macb_hclk_rate(unsigned int dev_id) { return get_hsb_clk_rate(); } +#endif +#ifdef AT32AP700x_CHIP_HAS_MMCI static inline unsigned long get_mci_clk_rate(void) { return get_pbb_clk_rate(); } +#endif
#endif /* __ASM_AVR32_ARCH_CLK_H__ */ diff --git a/include/asm-avr32/arch-at32ap700x/gpio.h b/include/asm-avr32/arch-at32ap700x/gpio.h index e4812d4..b10a3e4 100644 --- a/include/asm-avr32/arch-at32ap700x/gpio.h +++ b/include/asm-avr32/arch-at32ap700x/gpio.h @@ -22,6 +22,7 @@ #ifndef __ASM_AVR32_ARCH_GPIO_H__ #define __ASM_AVR32_ARCH_GPIO_H__
+#include <asm/arch/chip-features.h> #include <asm/arch/memory-map.h>
#define NR_GPIO_CONTROLLERS 5 @@ -201,12 +202,19 @@ void gpio_select_periph_A(unsigned int pin, int use_pullup); void gpio_select_periph_B(unsigned int pin, int use_pullup);
void gpio_enable_ebi(void); + +#ifdef AT32AP700x_CHIP_HAS_USART void gpio_enable_usart0(void); void gpio_enable_usart1(void); void gpio_enable_usart2(void); void gpio_enable_usart3(void); +#endif +#ifdef AT32AP700x_CHIP_HAS_MACB void gpio_enable_macb0(void); void gpio_enable_macb1(void); +#endif +#ifdef AT32AP700x_CHIP_HAS_MMCI void gpio_enable_mmci(void); +#endif
#endif /* __ASM_AVR32_ARCH_GPIO_H__ */

ATSTK1003 is a daughterboard for ATSTK1000 with the AT32AP7001 CPU, which is a derivative of AT32AP7000.
Signed-off-by: Haavard Skinnemoen hskinnemoen@atmel.com --- Makefile | 3 + include/configs/atstk1003.h | 184 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 187 insertions(+), 0 deletions(-) create mode 100644 include/configs/atstk1003.h
diff --git a/Makefile b/Makefile index f650b27..03de2f1 100644 --- a/Makefile +++ b/Makefile @@ -2605,6 +2605,9 @@ bf561-ezkit_config: unconfig atstk1002_config : unconfig @$(MKCONFIG) $(@:_config=) avr32 at32ap atstk1000 atmel at32ap700x
+atstk1003_config : unconfig + @$(MKCONFIG) $(@:_config=) avr32 at32ap atstk1000 atmel at32ap700x + ######################################################################### ######################################################################### ######################################################################### diff --git a/include/configs/atstk1003.h b/include/configs/atstk1003.h new file mode 100644 index 0000000..194788b --- /dev/null +++ b/include/configs/atstk1003.h @@ -0,0 +1,184 @@ +/* + * Copyright (C) 2007 Atmel Corporation + * + * Configuration settings for the ATSTK1003 CPU daughterboard + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ +#ifndef __CONFIG_H +#define __CONFIG_H + +#define CONFIG_AVR32 1 +#define CONFIG_AT32AP 1 +#define CONFIG_AT32AP7001 1 +#define CONFIG_ATSTK1003 1 +#define CONFIG_ATSTK1000 1 + +#define CONFIG_ATSTK1000_EXT_FLASH 1 + +/* + * Timer clock frequency. We're using the CPU-internal COUNT register + * for this, so this is equivalent to the CPU core clock frequency + */ +#define CFG_HZ 1000 + +/* + * Set up the PLL to run at 140 MHz, the CPU to run at the PLL + * frequency, the HSB and PBB at 1/2, and the PBA to run at 1/4 the + * PLL frequency. + * (CFG_OSC0_HZ * CFG_PLL0_MUL) / CFG_PLL0_DIV = PLL MHz + */ +#define CONFIG_PLL 1 +#define CFG_POWER_MANAGER 1 +#define CFG_OSC0_HZ 20000000 +#define CFG_PLL0_DIV 1 +#define CFG_PLL0_MUL 7 +#define CFG_PLL0_SUPPRESS_CYCLES 16 +/* + * Set the CPU running at: + * PLL / (2^CFG_CLKDIV_CPU) = CPU MHz + */ +#define CFG_CLKDIV_CPU 0 +/* + * Set the HSB running at: + * PLL / (2^CFG_CLKDIV_HSB) = HSB MHz + */ +#define CFG_CLKDIV_HSB 1 +/* + * Set the PBA running at: + * PLL / (2^CFG_CLKDIV_PBA) = PBA MHz + */ +#define CFG_CLKDIV_PBA 2 +/* + * Set the PBB running at: + * PLL / (2^CFG_CLKDIV_PBB) = PBB MHz + */ +#define CFG_CLKDIV_PBB 1 + +/* + * The PLLOPT register controls the PLL like this: + * icp = PLLOPT<2> + * ivco = PLLOPT<1:0> + * + * We want icp=1 (default) and ivco=0 (80-160 MHz) or ivco=2 (150-240MHz). + */ +#define CFG_PLL0_OPT 0x04 + +#undef CONFIG_USART0 +#define CONFIG_USART1 1 +#undef CONFIG_USART2 +#undef CONFIG_USART3 + +/* User serviceable stuff */ +#define CONFIG_DOS_PARTITION 1 + +#define CONFIG_CMDLINE_TAG 1 +#define CONFIG_SETUP_MEMORY_TAGS 1 +#define CONFIG_INITRD_TAG 1 + +#define CONFIG_STACKSIZE (2048) + +#define CONFIG_BAUDRATE 115200 +#define CONFIG_BOOTARGS \ + "console=ttyS0 root=/dev/mmcblk0p1 rootwait" + +#define CONFIG_BOOTCOMMAND \ + "mmcinit; ext2load mmc 0:1 0x10400000 /boot/uImage; bootm" + +/* + * Only interrupt autoboot if <space> is pressed. Otherwise, garbage + * data on the serial line may interrupt the boot sequence. + */ +#define CONFIG_BOOTDELAY 1 +#define CONFIG_AUTOBOOT 1 +#define CONFIG_AUTOBOOT_KEYED 1 +#define CONFIG_AUTOBOOT_PROMPT \ + "Press SPACE to abort autoboot in %d seconds\n" +#define CONFIG_AUTOBOOT_DELAY_STR "d" +#define CONFIG_AUTOBOOT_STOP_STR " " + +/* + * Command line configuration. + */ +#include <config_cmd_default.h> + +#define CONFIG_CMD_ASKENV +#define CONFIG_CMD_EXT2 +#define CONFIG_CMD_FAT +#define CONFIG_CMD_JFFS2 +#define CONFIG_CMD_MMC + +#undef CONFIG_CMD_FPGA +#undef CONFIG_CMD_NET +#undef CONFIG_CMD_NFS +#undef CONFIG_CMD_SETGETDCR +#undef CONFIG_CMD_XIMG + +#define CONFIG_ATMEL_USART 1 +#define CONFIG_PIO2 1 +#define CFG_HSDRAMC 1 +#define CONFIG_MMC 1 + +#define CFG_DCACHE_LINESZ 32 +#define CFG_ICACHE_LINESZ 32 + +#define CONFIG_NR_DRAM_BANKS 1 + +/* External flash on STK1000 */ +#if 0 +#define CFG_FLASH_CFI 1 +#define CFG_FLASH_CFI_DRIVER 1 +#endif + +#define CFG_FLASH_BASE 0x00000000 +#define CFG_FLASH_SIZE 0x800000 +#define CFG_MAX_FLASH_BANKS 1 +#define CFG_MAX_FLASH_SECT 135 + +#define CFG_MONITOR_BASE CFG_FLASH_BASE + +#define CFG_INTRAM_BASE 0x24000000 +#define CFG_INTRAM_SIZE 0x8000 + +#define CFG_SDRAM_BASE 0x10000000 + +#define CFG_ENV_IS_IN_FLASH 1 +#define CFG_ENV_SIZE 65536 +#define CFG_ENV_ADDR (CFG_FLASH_BASE + CFG_FLASH_SIZE - CFG_ENV_SIZE) + +#define CFG_INIT_SP_ADDR (CFG_INTRAM_BASE + CFG_INTRAM_SIZE) + +#define CFG_MALLOC_LEN (256*1024) + +/* Allow 4MB for the kernel run-time image */ +#define CFG_LOAD_ADDR (CFG_SDRAM_BASE + 0x00400000) +#define CFG_BOOTPARAMS_LEN (16 * 1024) + +/* Other configuration settings that shouldn't have to change all that often */ +#define CFG_PROMPT "Uboot> " +#define CFG_CBSIZE 256 +#define CFG_MAXARGS 16 +#define CFG_PBSIZE (CFG_CBSIZE + sizeof(CFG_PROMPT) + 16) +#define CFG_LONGHELP 1 + +#define CFG_MEMTEST_START CFG_SDRAM_BASE +#define CFG_MEMTEST_END (CFG_MEMTEST_START + 0x700000) +#define CFG_BAUDRATE_TABLE { 115200, 38400, 19200, 9600, 2400 } + +#endif /* __CONFIG_H */

ATSTK1004 is a daughterboard for ATSTK1000 with the AT32AP7002 CPU, which is a derivative of AT32AP7000.
Signed-off-by: Haavard Skinnemoen hskinnemoen@atmel.com --- Makefile | 3 + include/configs/atstk1004.h | 185 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 188 insertions(+), 0 deletions(-) create mode 100644 include/configs/atstk1004.h
diff --git a/Makefile b/Makefile index 03de2f1..c24ecfd 100644 --- a/Makefile +++ b/Makefile @@ -2608,6 +2608,9 @@ atstk1002_config : unconfig atstk1003_config : unconfig @$(MKCONFIG) $(@:_config=) avr32 at32ap atstk1000 atmel at32ap700x
+atstk1004_config : unconfig + @$(MKCONFIG) $(@:_config=) avr32 at32ap atstk1000 atmel at32ap700x + ######################################################################### ######################################################################### ######################################################################### diff --git a/include/configs/atstk1004.h b/include/configs/atstk1004.h new file mode 100644 index 0000000..1bad171 --- /dev/null +++ b/include/configs/atstk1004.h @@ -0,0 +1,185 @@ +/* + * Copyright (C) 2007 Atmel Corporation + * + * Configuration settings for the ATSTK1003 CPU daughterboard + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ +#ifndef __CONFIG_H +#define __CONFIG_H + +#define CONFIG_AVR32 1 +#define CONFIG_AT32AP 1 +#define CONFIG_AT32AP7002 1 +#define CONFIG_ATSTK1004 1 +#define CONFIG_ATSTK1000 1 + +#define CONFIG_ATSTK1000_EXT_FLASH 1 + +/* + * Timer clock frequency. We're using the CPU-internal COUNT register + * for this, so this is equivalent to the CPU core clock frequency + */ +#define CFG_HZ 1000 + +/* + * Set up the PLL to run at 140 MHz, the CPU to run at the PLL + * frequency, the HSB and PBB at 1/2, and the PBA to run at 1/4 the + * PLL frequency. + * (CFG_OSC0_HZ * CFG_PLL0_MUL) / CFG_PLL0_DIV = PLL MHz + */ +#define CONFIG_PLL 1 +#define CFG_POWER_MANAGER 1 +#define CFG_OSC0_HZ 20000000 +#define CFG_PLL0_DIV 1 +#define CFG_PLL0_MUL 7 +#define CFG_PLL0_SUPPRESS_CYCLES 16 +/* + * Set the CPU running at: + * PLL / (2^CFG_CLKDIV_CPU) = CPU MHz + */ +#define CFG_CLKDIV_CPU 0 +/* + * Set the HSB running at: + * PLL / (2^CFG_CLKDIV_HSB) = HSB MHz + */ +#define CFG_CLKDIV_HSB 1 +/* + * Set the PBA running at: + * PLL / (2^CFG_CLKDIV_PBA) = PBA MHz + */ +#define CFG_CLKDIV_PBA 2 +/* + * Set the PBB running at: + * PLL / (2^CFG_CLKDIV_PBB) = PBB MHz + */ +#define CFG_CLKDIV_PBB 1 + +/* + * The PLLOPT register controls the PLL like this: + * icp = PLLOPT<2> + * ivco = PLLOPT<1:0> + * + * We want icp=1 (default) and ivco=0 (80-160 MHz) or ivco=2 (150-240MHz). + */ +#define CFG_PLL0_OPT 0x04 + +#undef CONFIG_USART0 +#define CONFIG_USART1 1 +#undef CONFIG_USART2 +#undef CONFIG_USART3 + +/* User serviceable stuff */ +#define CONFIG_DOS_PARTITION 1 + +#define CONFIG_CMDLINE_TAG 1 +#define CONFIG_SETUP_MEMORY_TAGS 1 +#define CONFIG_INITRD_TAG 1 + +#define CONFIG_STACKSIZE (2048) + +#define CONFIG_BAUDRATE 115200 +#define CONFIG_BOOTARGS \ + "console=ttyS0 root=/dev/mmcblk0p1 rootwait" + +#define CONFIG_BOOTCOMMAND \ + "mmcinit; ext2load mmc 0:1 0x10200000 /boot/uImage; bootm" + +/* + * Only interrupt autoboot if <space> is pressed. Otherwise, garbage + * data on the serial line may interrupt the boot sequence. + */ +#define CONFIG_BOOTDELAY 1 +#define CONFIG_AUTOBOOT 1 +#define CONFIG_AUTOBOOT_KEYED 1 +#define CONFIG_AUTOBOOT_PROMPT \ + "Press SPACE to abort autoboot in %d seconds\n" +#define CONFIG_AUTOBOOT_DELAY_STR "d" +#define CONFIG_AUTOBOOT_STOP_STR " " + +/* + * Command line configuration. + */ +#include <config_cmd_default.h> + +#define CONFIG_CMD_ASKENV +#define CONFIG_CMD_EXT2 +#define CONFIG_CMD_FAT +#define CONFIG_CMD_JFFS2 +#define CONFIG_CMD_MMC + +#undef CONFIG_CMD_FPGA +#undef CONFIG_CMD_NET +#undef CONFIG_CMD_NFS +#undef CONFIG_CMD_SETGETDCR +#undef CONFIG_CMD_XIMG + +#define CONFIG_ATMEL_USART 1 +#define CONFIG_PIO2 1 +#define CFG_HSDRAMC 1 +#define CONFIG_MMC 1 + +#define CFG_DCACHE_LINESZ 32 +#define CFG_ICACHE_LINESZ 32 + +#define CONFIG_NR_DRAM_BANKS 1 + +/* External flash on STK1000 */ +#if 0 +#define CFG_FLASH_CFI 1 +#define CFG_FLASH_CFI_DRIVER 1 +#endif + +#define CFG_FLASH_BASE 0x00000000 +#define CFG_FLASH_SIZE 0x800000 +#define CFG_MAX_FLASH_BANKS 1 +#define CFG_MAX_FLASH_SECT 135 + +#define CFG_MONITOR_BASE CFG_FLASH_BASE + +#define CFG_INTRAM_BASE 0x24000000 +#define CFG_INTRAM_SIZE 0x8000 + +#define CFG_SDRAM_BASE 0x10000000 +#define CFG_SDRAM_16BIT 1 + +#define CFG_ENV_IS_IN_FLASH 1 +#define CFG_ENV_SIZE 65536 +#define CFG_ENV_ADDR (CFG_FLASH_BASE + CFG_FLASH_SIZE - CFG_ENV_SIZE) + +#define CFG_INIT_SP_ADDR (CFG_INTRAM_BASE + CFG_INTRAM_SIZE) + +#define CFG_MALLOC_LEN (256*1024) + +/* Allow 4MB for the kernel run-time image */ +#define CFG_LOAD_ADDR (CFG_SDRAM_BASE + 0x00200000) +#define CFG_BOOTPARAMS_LEN (16 * 1024) + +/* Other configuration settings that shouldn't have to change all that often */ +#define CFG_PROMPT "Uboot> " +#define CFG_CBSIZE 256 +#define CFG_MAXARGS 16 +#define CFG_PBSIZE (CFG_CBSIZE + sizeof(CFG_PROMPT) + 16) +#define CFG_LONGHELP 1 + +#define CFG_MEMTEST_START CFG_SDRAM_BASE +#define CFG_MEMTEST_END (CFG_MEMTEST_START + 0x700000) +#define CFG_BAUDRATE_TABLE { 115200, 38400, 19200, 9600, 2400 } + +#endif /* __CONFIG_H */

On Tuesday 30 October 2007, Haavard Skinnemoen wrote:
ATSTK1003 is a daughterboard for ATSTK1000 with the AT32AP7001 CPU, which is a derivative of AT32AP7000.
Signed-off-by: Haavard Skinnemoen hskinnemoen@atmel.com
Makefile | 3 + include/configs/atstk1003.h | 184 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 187 insertions(+), 0 deletions(-) create mode 100644 include/configs/atstk1003.h
Please don't forget to add the new boards to MAKEALL and MAINTAINERS.
Best regards, Stefan
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office@denx.de =====================================================================

On Tue, 30 Oct 2007 10:34:38 +0100 Stefan Roese sr@denx.de wrote:
On Tuesday 30 October 2007, Haavard Skinnemoen wrote:
ATSTK1003 is a daughterboard for ATSTK1000 with the AT32AP7001 CPU, which is a derivative of AT32AP7000.
Signed-off-by: Haavard Skinnemoen hskinnemoen@atmel.com
Makefile | 3 + include/configs/atstk1003.h | 184 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 187 insertions(+), 0 deletions(-) create mode 100644 include/configs/atstk1003.h
Please don't forget to add the new boards to MAKEALL and MAINTAINERS.
Ah, right. Thanks for spotting that. I guess I should add them to README as well.
MAINTAINERS currently only mentions ATSTK1000, which is the motherboard for ATSTK100[234]. Should I add entries for all the daughterboards or should I simply update it to say AT32AP700x in the CPU column instead of AT32AP7000?
Håvard

On Tuesday 30 October 2007, Haavard Skinnemoen wrote:
Please don't forget to add the new boards to MAKEALL and MAINTAINERS.
Ah, right. Thanks for spotting that. I guess I should add them to README as well.
Not sure. Do we have a list of all official supported boards in the README too? The README is too big already from my point of view.
MAINTAINERS currently only mentions ATSTK1000, which is the motherboard for ATSTK100[234]. Should I add entries for all the daughterboards or should I simply update it to say AT32AP700x in the CPU column instead of AT32AP7000?
MAKEALL definitely has to have all boards listed. MAINTAINERS probably too, since it makes it easier to locate the board via a grep.
Best regards, Stefan
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office@denx.de =====================================================================

On Tue, 30 Oct 2007 13:44:27 +0100 Stefan Roese sr@denx.de wrote:
On Tuesday 30 October 2007, Haavard Skinnemoen wrote:
Please don't forget to add the new boards to MAKEALL and MAINTAINERS.
Ah, right. Thanks for spotting that. I guess I should add them to README as well.
Not sure. Do we have a list of all official supported boards in the README too? The README is too big already from my point of view.
I'm referring to this section:
- CPU Daughterboard Type: (if CONFIG_ATSTK1000 is defined) Define exactly one of CONFIG_ATSTK1002
I suppose we could remove it though. The new Kconfig stuff will make it obsolete anyway, right?
MAINTAINERS currently only mentions ATSTK1000, which is the motherboard for ATSTK100[234]. Should I add entries for all the daughterboards or should I simply update it to say AT32AP700x in the CPU column instead of AT32AP7000?
MAKEALL definitely has to have all boards listed. MAINTAINERS probably too, since it makes it easier to locate the board via a grep.
Sure, but MAKEALL needs to list all _configurations_ that are available (i.e. the stuff under include/configs.) If you're trying to locate the board, you'll find all three daughterboards living under boards/atmel/atstk1000, so grepping for ATSTK1000 is the natural thing to do, isn't it?
I guess the safest way is to include all of them, in addition to ATSTK1000. I'll do that as an additional patch since I need to add ATSTK1002 as well.
Håvard

On Tue, 30 Oct 2007 14:40:08 +0100 Haavard Skinnemoen hskinnemoen@atmel.com wrote:
On Tue, 30 Oct 2007 13:44:27 +0100 Stefan Roese sr@denx.de wrote:
On Tuesday 30 October 2007, Haavard Skinnemoen wrote:
Please don't forget to add the new boards to MAKEALL and MAINTAINERS.
Ah, right. Thanks for spotting that. I guess I should add them to README as well.
Not sure. Do we have a list of all official supported boards in the README too? The README is too big already from my point of view.
I'm referring to this section:
- CPU Daughterboard Type: (if CONFIG_ATSTK1000 is defined) Define exactly one of CONFIG_ATSTK1002
I suppose we could remove it though. The new Kconfig stuff will make it obsolete anyway, right?
yes. For some reason, that one missed the axe (see commit 2628114ec564f969f34b5f7105fbd168cb8c9c3f). Perhaps it should be changed to an "e.g." instead, to leave the reader aware of Daughterboard types.
MAINTAINERS currently only mentions ATSTK1000, which is the motherboard for ATSTK100[234]. Should I add entries for all the daughterboards or should I simply update it to say AT32AP700x in the CPU column instead of AT32AP7000?
MAKEALL definitely has to have all boards listed. MAINTAINERS probably too, since it makes it easier to locate the board via a grep.
Sure, but MAKEALL needs to list all _configurations_ that are available (i.e. the stuff under include/configs.) If you're trying to locate the board, you'll find all three daughterboards living under boards/atmel/atstk1000, so grepping for ATSTK1000 is the natural thing to do, isn't it?
technically MAKEALL uses the main Makefile targets.
I guess the safest way is to include all of them, in addition to ATSTK1000. I'll do that as an additional patch since I need to add ATSTK1002 as well.
yes, this'll give you the fullest testing coverage.
Håvard
Kim
participants (3)
-
Haavard Skinnemoen
-
Kim Phillips
-
Stefan Roese