Re: [U-Boot] [PATCH] arm: AT91: add at91sam9x5ek board support
Hi Andreas, On 6/27/2012 21:47, Andreas Bießmann wrote: On 22.05.2012 12:06, Bo Shen wrote: Add at91sam9x5ek board support. support AT91SAM9G15, G25, G35, X25, X35 SoC Signed-off-by: Bo Shen voice.s...@atmel.com In general: ---8--- total: 14 errors, 11 warnings, 1148 lines checked NOTE: Ignored message types: COMPLEX_MACRO CONSIDER_KSTRTO MINMAX MULTISTATEMENT_MACRO_USE_DO_WHILE /tmp/[PATCH] arm: AT91: add at91sam9x5ek board support.eml has style problems, please review. ---8--- please fix these. Ok, I will fix this at next version patch. [...] diff --git a/arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c b/arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c new file mode 100644 index 000..e4262a5 --- /dev/null +++ b/arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c @@ -0,0 +1,223 @@ +/* + * Copyright (C) 2012 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 + */ + +#include common.h +#include asm/arch/at91_common.h +#include asm/arch/at91_pmc.h +#include asm/arch/gpio.h +#include asm/io.h + +#define AT91_CIDR_VERSION (0x1f 0) /* Version of the Device */ this should go into a header. Ok, I will fix this at next version patch. + +unsigned int get_chip_id(void) +{ + return readl(ATMEL_BASE_DBGU + 0x40) ~AT91_CIDR_VERSION; can we get some explanation of these magic numbers please (0x40 here and 0x44 later), maybe add these offsets to the header? Ok, I will fix this at next version patch. + +} [...] +void at91_serial2_hw_init(void) +{ + at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC; + + at91_set_a_periph(AT91_PIO_PORTA, 7, 1);/* TXD */ + at91_set_a_periph(AT91_PIO_PORTA, 8, 0);/* RXD */ + + writel(1 ATMEL_ID_USART2, pmc-pcer); +} + +#ifdef CONFIG_ATMEL_SPI +void at91_spi0_hw_init(unsigned long cs_mask) +{ + at91_pmc_t *pmc = (at91_pmc_t *) ATMEL_PMC_BASE; -^ please use same style everywhere (before there was no whitespace). I personally favour to remove it, but all other at91 xx_init() do have a whitespace here, so I tend to leave it as is and add the whitespace in the lines above. If you have a strong meaning here send patches for the other files too. I will keep the old style. Keep the whitespace. + [...] diff --git a/arch/arm/cpu/arm926ejs/at91/clock.c b/arch/arm/cpu/arm926ejs/at91/clock.c index a7085de..fd26faa 100644 --- a/arch/arm/cpu/arm926ejs/at91/clock.c +++ b/arch/arm/cpu/arm926ejs/at91/clock.c @@ -154,7 +154,8 @@ int at91_clock_init(unsigned long main_clock) * For now, assume this parentage won't change. */ mckr = readl(pmc-mckr); -#if defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) +#if defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) \ + || defined(CONFIG_AT91SAM9X5) /* plla divisor by 2 */ gd-plla_rate_hz /= (1 ((mckr 1 12) 12)); #endif @@ -168,7 +169,9 @@ int at91_clock_init(unsigned long main_clock) freq / ((mckr AT91_PMC_MCKR_MDIV_MASK) 7) : freq; if (mckr AT91_PMC_MCKR_MDIV_MASK) freq /= 2; /* processor clock division */ -#elif defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) + /* plla divisor by 2 */ Is this slipped in? This portion handles mck, plla was some lines above. The comment has a mistake. I will correct this. +#elif defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) \ + || defined(CONFIG_AT91SAM9X5) gd-mck_rate_hz = (mckr AT91_PMC_MCKR_MDIV_MASK) == (AT91_PMC_MCKR_MDIV_2 | AT91_PMC_MCKR_MDIV_4) ? freq / 3 [...] diff --git a/arch/arm/include/asm/arch-at91/at91sam9x5.h b/arch/arm/include/asm/arch-at91/at91sam9x5.h new file mode 100644 index 000..30bad24 --- /dev/null +++ b/arch/arm/include/asm/arch-at91/at91sam9x5.h @@ -0,0 +1,172 @@ +/* + * Chip-specific header file for the AT91SAM9x5 family + * + * Copyright (C) 2012 Atmel Corporation. + * + * Definitions for the SoC: + * AT91SAM9x5 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU
Re: [U-Boot] [PATCH] arm: AT91: add at91sam9x5ek board support
On 22.05.2012 12:06, Bo Shen wrote: Add at91sam9x5ek board support. support AT91SAM9G15, G25, G35, X25, X35 SoC Signed-off-by: Bo Shen voice.s...@atmel.com In general: ---8--- total: 14 errors, 11 warnings, 1148 lines checked NOTE: Ignored message types: COMPLEX_MACRO CONSIDER_KSTRTO MINMAX MULTISTATEMENT_MACRO_USE_DO_WHILE /tmp/[PATCH] arm: AT91: add at91sam9x5ek board support.eml has style problems, please review. ---8--- please fix these. --- MAINTAINERS|3 + arch/arm/cpu/arm926ejs/at91/Makefile |1 + arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c | 223 ++ arch/arm/cpu/arm926ejs/at91/clock.c|7 +- arch/arm/include/asm/arch-at91/at91sam9_matrix.h |2 + arch/arm/include/asm/arch-at91/at91sam9x5.h| 172 +++ arch/arm/include/asm/arch-at91/at91sam9x5_matrix.h | 91 ++ arch/arm/include/asm/arch-at91/hardware.h |2 + board/atmel/at91sam9x5ek/Makefile | 48 +++ board/atmel/at91sam9x5ek/at91sam9x5ek.c| 323 board/atmel/at91sam9x5ek/config.mk |1 + boards.cfg |1 + drivers/net/macb.c |4 +- include/configs/at91sam9x5ek.h | 216 + 14 files changed, 1090 insertions(+), 4 deletions(-) create mode 100644 arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c create mode 100644 arch/arm/include/asm/arch-at91/at91sam9x5.h create mode 100644 arch/arm/include/asm/arch-at91/at91sam9x5_matrix.h create mode 100644 board/atmel/at91sam9x5ek/Makefile create mode 100644 board/atmel/at91sam9x5ek/at91sam9x5ek.c create mode 100644 board/atmel/at91sam9x5ek/config.mk create mode 100644 include/configs/at91sam9x5ek.h diff --git a/MAINTAINERS b/MAINTAINERS index e2441d8..cd8b8b5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -658,6 +658,9 @@ Sedji Gaouaousedji.gaou...@atmel.com at91sam9g10ek ARM926EJS (AT91SAM9G10 SoC) at91sam9m10g45ekARM926EJS (AT91SAM9G45 SoC) +Bo Shen voice.s...@atmel.com + at91sam9x5ekARM926EJS (AT91SAM9X5 SoC) + Simon Guinot simon.gui...@sequanux.org inetspace_v2ARM926EJS (Kirkwood SoC) diff --git a/arch/arm/cpu/arm926ejs/at91/Makefile b/arch/arm/cpu/arm926ejs/at91/Makefile index f333753..346e58f 100644 --- a/arch/arm/cpu/arm926ejs/at91/Makefile +++ b/arch/arm/cpu/arm926ejs/at91/Makefile @@ -35,6 +35,7 @@ COBJS-$(CONFIG_AT91SAM9263) += at91sam9263_devices.o COBJS-$(CONFIG_AT91SAM9RL) += at91sam9rl_devices.o COBJS-$(CONFIG_AT91SAM9M10G45) += at91sam9m10g45_devices.o COBJS-$(CONFIG_AT91SAM9G45) += at91sam9m10g45_devices.o +COBJS-$(CONFIG_AT91SAM9X5) += at91sam9x5_devices.o COBJS-$(CONFIG_AT91_EFLASH) += eflash.o COBJS-$(CONFIG_AT91_LED) += led.o COBJS-y += clock.o diff --git a/arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c b/arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c new file mode 100644 index 000..e4262a5 --- /dev/null +++ b/arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c @@ -0,0 +1,223 @@ +/* + * Copyright (C) 2012 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 + */ + +#include common.h +#include asm/arch/at91_common.h +#include asm/arch/at91_pmc.h +#include asm/arch/gpio.h +#include asm/io.h + +#define AT91_CIDR_VERSION(0x1f 0) /* Version of the Device */ this should go into a header. + +unsigned int get_chip_id(void) +{ + return readl(ATMEL_BASE_DBGU + 0x40) ~AT91_CIDR_VERSION; can we get some explanation of these magic numbers please (0x40 here and 0x44 later), maybe add these offsets to the header? + +} +unsigned int get_extension_chip_id(void) +{ + return readl(ATMEL_BASE_DBGU + 0x44); +} + +unsigned int has_emac1() +{ + return cpu_is_at91sam9x25(); +} +unsigned int has_emac0() +{ + return !(cpu_is_at91sam9g15()); +} +unsigned int has_lcdc() +{ + return cpu_is_at91sam9g15() || cpu_is_at91sam9g35() + || cpu_is_at91sam9x35(); +} + +char *get_cpu_name()
Re: [U-Boot] [PATCH] arm: AT91: add at91sam9x5ek board support
Hi All, On 5/22/2012 18:06, Bo Shen wrote: Add at91sam9x5ek board support. support AT91SAM9G15, G25, G35, X25, X35 SoC Signed-off-by: Bo Shenvoice.s...@atmel.com --- MAINTAINERS|3 + arch/arm/cpu/arm926ejs/at91/Makefile |1 + arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c | 223 ++ arch/arm/cpu/arm926ejs/at91/clock.c|7 +- arch/arm/include/asm/arch-at91/at91sam9_matrix.h |2 + arch/arm/include/asm/arch-at91/at91sam9x5.h| 172 +++ arch/arm/include/asm/arch-at91/at91sam9x5_matrix.h | 91 ++ arch/arm/include/asm/arch-at91/hardware.h |2 + board/atmel/at91sam9x5ek/Makefile | 48 +++ board/atmel/at91sam9x5ek/at91sam9x5ek.c| 323 board/atmel/at91sam9x5ek/config.mk |1 + boards.cfg |1 + drivers/net/macb.c |4 +- include/configs/at91sam9x5ek.h | 216 + 14 files changed, 1090 insertions(+), 4 deletions(-) create mode 100644 arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c create mode 100644 arch/arm/include/asm/arch-at91/at91sam9x5.h create mode 100644 arch/arm/include/asm/arch-at91/at91sam9x5_matrix.h create mode 100644 board/atmel/at91sam9x5ek/Makefile create mode 100644 board/atmel/at91sam9x5ek/at91sam9x5ek.c create mode 100644 board/atmel/at91sam9x5ek/config.mk create mode 100644 include/configs/at91sam9x5ek.h ping diff --git a/MAINTAINERS b/MAINTAINERS index e2441d8..cd8b8b5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -658,6 +658,9 @@ Sedji Gaouaousedji.gaou...@atmel.com at91sam9g10ek ARM926EJS (AT91SAM9G10 SoC) at91sam9m10g45ekARM926EJS (AT91SAM9G45 SoC) +Bo Shenvoice.s...@atmel.com + at91sam9x5ekARM926EJS (AT91SAM9X5 SoC) + Simon Guinotsimon.gui...@sequanux.org inetspace_v2ARM926EJS (Kirkwood SoC) diff --git a/arch/arm/cpu/arm926ejs/at91/Makefile b/arch/arm/cpu/arm926ejs/at91/Makefile index f333753..346e58f 100644 --- a/arch/arm/cpu/arm926ejs/at91/Makefile +++ b/arch/arm/cpu/arm926ejs/at91/Makefile @@ -35,6 +35,7 @@ COBJS-$(CONFIG_AT91SAM9263) += at91sam9263_devices.o COBJS-$(CONFIG_AT91SAM9RL)+= at91sam9rl_devices.o COBJS-$(CONFIG_AT91SAM9M10G45)+= at91sam9m10g45_devices.o COBJS-$(CONFIG_AT91SAM9G45) += at91sam9m10g45_devices.o +COBJS-$(CONFIG_AT91SAM9X5) += at91sam9x5_devices.o COBJS-$(CONFIG_AT91_EFLASH) += eflash.o COBJS-$(CONFIG_AT91_LED) += led.o COBJS-y += clock.o diff --git a/arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c b/arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c new file mode 100644 index 000..e4262a5 --- /dev/null +++ b/arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c @@ -0,0 +1,223 @@ +/* + * Copyright (C) 2012 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 + */ + +#includecommon.h +#includeasm/arch/at91_common.h +#includeasm/arch/at91_pmc.h +#includeasm/arch/gpio.h +#includeasm/io.h + +#define AT91_CIDR_VERSION (0x1f 0) /* Version of the Device */ + +unsigned int get_chip_id(void) +{ + return readl(ATMEL_BASE_DBGU + 0x40) ~AT91_CIDR_VERSION; + +} +unsigned int get_extension_chip_id(void) +{ + return readl(ATMEL_BASE_DBGU + 0x44); +} + +unsigned int has_emac1() +{ + return cpu_is_at91sam9x25(); +} +unsigned int has_emac0() +{ + return !(cpu_is_at91sam9g15()); +} +unsigned int has_lcdc() +{ + return cpu_is_at91sam9g15() || cpu_is_at91sam9g35() + || cpu_is_at91sam9x35(); +} + +char *get_cpu_name() +{ + unsigned int extension_id = get_extension_chip_id(); + + if (cpu_is_at91sam9x5()) { + switch (extension_id) { + case ARCH_EXID_AT91SAM9G15: + return CONFIG_SYS_AT91_G15_CPU_NAME; + case ARCH_EXID_AT91SAM9G25: + return CONFIG_SYS_AT91_G25_CPU_NAME; + case ARCH_EXID_AT91SAM9G35: + return CONFIG_SYS_AT91_G35_CPU_NAME; + case ARCH_EXID_AT91SAM9X25:
[U-Boot] [PATCH] arm: AT91: add at91sam9x5ek board support
Add at91sam9x5ek board support. support AT91SAM9G15, G25, G35, X25, X35 SoC Signed-off-by: Bo Shen voice.s...@atmel.com --- MAINTAINERS|3 + arch/arm/cpu/arm926ejs/at91/Makefile |1 + arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c | 223 ++ arch/arm/cpu/arm926ejs/at91/clock.c|7 +- arch/arm/include/asm/arch-at91/at91sam9_matrix.h |2 + arch/arm/include/asm/arch-at91/at91sam9x5.h| 172 +++ arch/arm/include/asm/arch-at91/at91sam9x5_matrix.h | 91 ++ arch/arm/include/asm/arch-at91/hardware.h |2 + board/atmel/at91sam9x5ek/Makefile | 48 +++ board/atmel/at91sam9x5ek/at91sam9x5ek.c| 323 board/atmel/at91sam9x5ek/config.mk |1 + boards.cfg |1 + drivers/net/macb.c |4 +- include/configs/at91sam9x5ek.h | 216 + 14 files changed, 1090 insertions(+), 4 deletions(-) create mode 100644 arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c create mode 100644 arch/arm/include/asm/arch-at91/at91sam9x5.h create mode 100644 arch/arm/include/asm/arch-at91/at91sam9x5_matrix.h create mode 100644 board/atmel/at91sam9x5ek/Makefile create mode 100644 board/atmel/at91sam9x5ek/at91sam9x5ek.c create mode 100644 board/atmel/at91sam9x5ek/config.mk create mode 100644 include/configs/at91sam9x5ek.h diff --git a/MAINTAINERS b/MAINTAINERS index e2441d8..cd8b8b5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -658,6 +658,9 @@ Sedji Gaouaousedji.gaou...@atmel.com at91sam9g10ek ARM926EJS (AT91SAM9G10 SoC) at91sam9m10g45ekARM926EJS (AT91SAM9G45 SoC) +Bo Shen voice.s...@atmel.com + at91sam9x5ekARM926EJS (AT91SAM9X5 SoC) + Simon Guinot simon.gui...@sequanux.org inetspace_v2ARM926EJS (Kirkwood SoC) diff --git a/arch/arm/cpu/arm926ejs/at91/Makefile b/arch/arm/cpu/arm926ejs/at91/Makefile index f333753..346e58f 100644 --- a/arch/arm/cpu/arm926ejs/at91/Makefile +++ b/arch/arm/cpu/arm926ejs/at91/Makefile @@ -35,6 +35,7 @@ COBJS-$(CONFIG_AT91SAM9263) += at91sam9263_devices.o COBJS-$(CONFIG_AT91SAM9RL) += at91sam9rl_devices.o COBJS-$(CONFIG_AT91SAM9M10G45) += at91sam9m10g45_devices.o COBJS-$(CONFIG_AT91SAM9G45)+= at91sam9m10g45_devices.o +COBJS-$(CONFIG_AT91SAM9X5) += at91sam9x5_devices.o COBJS-$(CONFIG_AT91_EFLASH)+= eflash.o COBJS-$(CONFIG_AT91_LED) += led.o COBJS-y += clock.o diff --git a/arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c b/arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c new file mode 100644 index 000..e4262a5 --- /dev/null +++ b/arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c @@ -0,0 +1,223 @@ +/* + * Copyright (C) 2012 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 + */ + +#include common.h +#include asm/arch/at91_common.h +#include asm/arch/at91_pmc.h +#include asm/arch/gpio.h +#include asm/io.h + +#define AT91_CIDR_VERSION (0x1f 0) /* Version of the Device */ + +unsigned int get_chip_id(void) +{ + return readl(ATMEL_BASE_DBGU + 0x40) ~AT91_CIDR_VERSION; + +} +unsigned int get_extension_chip_id(void) +{ + return readl(ATMEL_BASE_DBGU + 0x44); +} + +unsigned int has_emac1() +{ + return cpu_is_at91sam9x25(); +} +unsigned int has_emac0() +{ + return !(cpu_is_at91sam9g15()); +} +unsigned int has_lcdc() +{ + return cpu_is_at91sam9g15() || cpu_is_at91sam9g35() + || cpu_is_at91sam9x35(); +} + +char *get_cpu_name() +{ + unsigned int extension_id = get_extension_chip_id(); + + if (cpu_is_at91sam9x5()) { + switch (extension_id) { + case ARCH_EXID_AT91SAM9G15: + return CONFIG_SYS_AT91_G15_CPU_NAME; + case ARCH_EXID_AT91SAM9G25: + return CONFIG_SYS_AT91_G25_CPU_NAME; + case ARCH_EXID_AT91SAM9G35: + return CONFIG_SYS_AT91_G35_CPU_NAME; + case ARCH_EXID_AT91SAM9X25: + return CONFIG_SYS_AT91_X25_CPU_NAME; +