Skip to contentSkip to conversation

update arm/at91rm9200 work with rework rework110202

PATCH Superseded Jens Scharsig 3 participants 5 messages Feb 19, 2011 – Jun 6, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 update arm/at91rm9200 work with rework rework110202

* convert at91rm9200ek and eb_cpux9k2 board to ATMEL_xxx name scheme
* Fix: timer.c compile error io.h not found with arm/at91rm9200
* update arm920t/at91 to ATMEL_xxx name scheme
* update arm920t/at91 soc lib
* update at91_emac driver

---

Changes since V2 whith space fix

 arch/arm/cpu/arm920t/at91/reset.c           |    2 +-
 arch/arm/cpu/arm920t/at91/timer.c           |   12 +-
 arch/arm/include/asm/arch-at91/at91_mc.h    |   12 +-
 arch/arm/include/asm/arch-at91/at91_pmc.h   |   10 +-
 arch/arm/include/asm/arch-at91/at91rm9200.h |  209 ++++++++++++++-------------
 board/BuS/eb_cpux9k2/cpux9k2.c              |   52 ++++----
 board/atmel/at91rm9200ek/at91rm9200ek.c     |    4 +-
 board/atmel/at91rm9200ek/led.c              |   22 ++--
 drivers/net/at91_emac.c                     |   32 ++--
 include/configs/at91rm9200ek.h              |    5 +-
 include/configs/eb_cpux9k2.h                |   23 ++--
 11 files changed, 196 insertions(+), 187 deletions(-)
arch/arm/cpu/arm920t/at91/reset.c +1 -1
index 51043ec..4fa0f98 100644
@@ -42,7 +42,7 @@ void  __attribute__((weak)) board_reset(void)
 
 void reset_cpu(ulong ignored)
 {
-	at91_st_t *st = (at91_st_t *) AT91_ST_BASE;
+	at91_st_t *st = (at91_st_t *) ATMEL_BASE_ST;
 #if defined(CONFIG_AT91RM9200_USART)
 	/*shutdown the console to avoid strange chars during reset */
 	serial_exit();
arch/arm/cpu/arm920t/at91/timer.c +6 -6
index d9a024f..f0ad7d6 100644
@@ -32,7 +32,7 @@
 
 #include <common.h>
 
-#include <asm/arch/io.h>
+#include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/at91_tc.h>
 #include <asm/arch/at91_pmc.h>
@@ -44,11 +44,11 @@ DECLARE_GLOBAL_DATA_PTR;
 
 int timer_init(void)
 {
-	at91_tc_t *tc = (at91_tc_t *) AT91_TC_BASE;
-	at91_pmc_t *pmc = (at91_pmc_t *) AT91_PMC_BASE;
+	at91_tc_t *tc = (at91_tc_t *) ATMEL_BASE_TC;
+	at91_pmc_t *pmc = (at91_pmc_t *) ATMEL_BASE_PMC;
 
 	/* enables TC1.0 clock */
-	writel(1 << AT91_ID_TC0, &pmc->pcer);	/* enable clock */
+	writel(1 << ATMEL_ID_TC0, &pmc->pcer);	/* enable clock */
 
 	writel(0, &tc->bcr);
 	writel(AT91_TC_BMR_TC0XC0S_NONE | AT91_TC_BMR_TC1XC1S_NONE |
@@ -96,14 +96,14 @@ void __udelay(unsigned long usec)
 void reset_timer_masked(void)
 {
 	/* reset time */
-	at91_tc_t *tc = (at91_tc_t *) AT91_TC_BASE;
+	at91_tc_t *tc = (at91_tc_t *) ATMEL_BASE_TC;
 	gd->lastinc = readl(&tc->tc[0].cv) & 0x0000ffff;
 	gd->tbl = 0;
 }
 
 ulong get_timer_raw(void)
 {
-	at91_tc_t *tc = (at91_tc_t *) AT91_TC_BASE;
+	at91_tc_t *tc = (at91_tc_t *) ATMEL_BASE_TC;
 	u32 now;
 
 	now = readl(&tc->tc[0].cv) & 0x0000ffff;
arch/arm/include/asm/arch-at91/at91_mc.h +6 -6
index acfbd10..e0d1320 100644
@@ -23,12 +23,12 @@
 #ifndef AT91_MC_H
 #define AT91_MC_H
 
-#define AT91_ASM_MC_EBI_CSA	(AT91_MC_BASE + 0x60)
-#define AT91_ASM_MC_EBI_CFG	(AT91_MC_BASE + 0x64)
-#define AT91_ASM_MC_SMC_CSR0	(AT91_MC_BASE + 0x70)
-#define AT91_ASM_MC_SDRAMC_MR	(AT91_MC_BASE + 0x90)
-#define AT91_ASM_MC_SDRAMC_TR	(AT91_MC_BASE + 0x94)
-#define AT91_ASM_MC_SDRAMC_CR	(AT91_MC_BASE + 0x98)
+#define AT91_ASM_MC_EBI_CSA	(ATMEL_BASE_MC + 0x60)
+#define AT91_ASM_MC_EBI_CFG	(ATMEL_BASE_MC + 0x64)
+#define AT91_ASM_MC_SMC_CSR0	(ATMEL_BASE_MC + 0x70)
+#define AT91_ASM_MC_SDRAMC_MR	(ATMEL_BASE_MC + 0x90)
+#define AT91_ASM_MC_SDRAMC_TR	(ATMEL_BASE_MC + 0x94)
+#define AT91_ASM_MC_SDRAMC_CR	(ATMEL_BASE_MC + 0x98)
 
 #ifndef __ASSEMBLY__
 
arch/arm/include/asm/arch-at91/at91_pmc.h +5 -5
index fb8bb17..086cb9b 100644
@@ -17,11 +17,11 @@
 #ifndef AT91_PMC_H
 #define AT91_PMC_H
 
-#define	AT91_ASM_PMC_MOR	(AT91_PMC_BASE + 0x20)
-#define	AT91_ASM_PMC_PLLAR	(AT91_PMC_BASE + 0x28)
-#define	AT91_ASM_PMC_PLLBR	(AT91_PMC_BASE + 0x2c)
-#define AT91_ASM_PMC_MCKR	(AT91_PMC_BASE + 0x30)
-#define AT91_ASM_PMC_SR		(AT91_PMC_BASE + 0x68)
+#define	AT91_ASM_PMC_MOR	(ATMEL_BASE_PMC + 0x20)
+#define	AT91_ASM_PMC_PLLAR	(ATMEL_BASE_PMC + 0x28)
+#define	AT91_ASM_PMC_PLLBR	(ATMEL_BASE_PMC + 0x2c)
+#define AT91_ASM_PMC_MCKR	(ATMEL_BASE_PMC + 0x30)
+#define AT91_ASM_PMC_SR		(ATMEL_BASE_PMC + 0x68)
 
 #ifndef __ASSEMBLY__
 
arch/arm/include/asm/arch-at91/at91rm9200.h +110 -99

225 lines not on this page · raw message

board/BuS/eb_cpux9k2/cpux9k2.c +26 -26

134 lines not on this page · raw message

board/atmel/at91rm9200ek/at91rm9200ek.c +2 -2
index d242583..5ebc24d 100644
@@ -44,7 +44,7 @@ int board_init(void)
 	 * Correct IRDA resistor problem
 	 * Set PA23_TXD in Output
 	 */
-	writel(AT91_PMX_AA_TXD2, &pio->pioa.oer);
+	writel(ATMEL_PMX_AA_TXD2, &pio->pioa.oer);
 
 	/* arch number of AT91RM9200EK-Board */
 	gd->bd->bi_arch_number = MACH_TYPE_AT91RM9200EK;
@@ -65,6 +65,6 @@ int dram_init (void)
 #ifdef CONFIG_DRIVER_AT91EMAC
 int board_eth_init(bd_t *bis)
 {
-	return at91emac_register(bis, (u32) AT91_EMAC_BASE);
+	return at91emac_register(bis, (u32) ATMEL_BASE_EMAC);
 }
 #endif
board/atmel/at91rm9200ek/led.c +12 -10
index 8d512e0..1766ddf 100644
@@ -26,8 +26,10 @@
  */
 
 #include <common.h>
-#include <asm/arch/gpio.h>
+#include <asm/io.h>
+#include <asm/arch/hardware.h>
 #include <asm/arch/at91_pmc.h>
+#include <asm/arch/at91_pio.h>
 
 /* bit mask in PIO port B */
 #define	GREEN_LED	(1<<0)
@@ -36,47 +38,47 @@
 
 void	green_LED_on(void)
 {
-	at91_pio_t *pio = (at91_pio_t *)AT91_PIO_BASE;
+	at91_pio_t *pio = (at91_pio_t *)ATMEL_BASE_PIO;
 	writel(GREEN_LED, &pio->piob.codr);
 }
 
 void	 yellow_LED_on(void)
 {
-	at91_pio_t *pio = (at91_pio_t *)AT91_PIO_BASE;
+	at91_pio_t *pio = (at91_pio_t *)ATMEL_BASE_PIO;
 	writel(YELLOW_LED, &pio->piob.codr);
 }
 
 void	 red_LED_on(void)
 {
-	at91_pio_t *pio = (at91_pio_t *)AT91_PIO_BASE;
+	at91_pio_t *pio = (at91_pio_t *)ATMEL_BASE_PIO;
 	writel(RED_LED, &pio->piob.codr);
 }
 
 void	green_LED_off(void)
 {
-	at91_pio_t *pio = (at91_pio_t *)AT91_PIO_BASE;
+	at91_pio_t *pio = (at91_pio_t *)ATMEL_BASE_PIO;
 	writel(GREEN_LED, &pio->piob.sodr);
 }
 
 void	yellow_LED_off(void)
 {
-	at91_pio_t *pio = (at91_pio_t *)AT91_PIO_BASE;
+	at91_pio_t *pio = (at91_pio_t *)ATMEL_BASE_PIO;
 	writel(YELLOW_LED, &pio->piob.sodr);
 }
 
 void	red_LED_off(void)
 {
-	at91_pio_t *pio = (at91_pio_t *)AT91_PIO_BASE;
+	at91_pio_t *pio = (at91_pio_t *)ATMEL_BASE_PIO;
 	writel(RED_LED, &pio->piob.sodr);
 }
 
 void coloured_LED_init (void)
 {
-	at91_pmc_t *pmc = (at91_pmc_t *)AT91_PMC_BASE;
-	at91_pio_t *pio = (at91_pio_t *)AT91_PIO_BASE;
+	at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC;
+	at91_pio_t *pio = (at91_pio_t *)ATMEL_BASE_PIO;
 
 	/* Enable PIOB clock */
-	writel(1 << AT91_ID_PIOB, &pmc->pcer);
+	writel(1 << ATMEL_ID_PIOB, &pmc->pcer);
 
 	/* Disable peripherals on LEDs */
 	writel(GREEN_LED | YELLOW_LED | RED_LED, &pio->piob.per);
drivers/net/at91_emac.c +16 -16
index 4e5685c..228dbae 100644
@@ -342,34 +342,34 @@ static int at91emac_init(struct eth_device *netdev, bd_t *bd)
 	u32 value;
 	emac_device *dev;
 	at91_emac_t *emac;
-	at91_pio_t *pio = (at91_pio_t *) AT91_PIO_BASE;
-	at91_pmc_t *pmc = (at91_pmc_t *) AT91_PMC_BASE;
+	at91_pio_t *pio = (at91_pio_t *) ATMEL_BASE_PIO;
+	at91_pmc_t *pmc = (at91_pmc_t *) ATMEL_BASE_PMC;
 
 	emac = (at91_emac_t *) netdev->iobase;
 	dev = (emac_device *) netdev->priv;
 
 	/* PIO Disable Register */
-	value =	AT91_PMX_AA_EMDIO |	AT91_PMX_AA_EMDC |
-		AT91_PMX_AA_ERXER |	AT91_PMX_AA_ERX1 |
-		AT91_PMX_AA_ERX0 |	AT91_PMX_AA_ECRS |
-		AT91_PMX_AA_ETX1 |	AT91_PMX_AA_ETX0 |
-		AT91_PMX_AA_ETXEN |	AT91_PMX_AA_EREFCK;
+	value =	ATMEL_PMX_AA_EMDIO |	ATMEL_PMX_AA_EMDC |
+		ATMEL_PMX_AA_ERXER |	ATMEL_PMX_AA_ERX1 |
+		ATMEL_PMX_AA_ERX0 |	ATMEL_PMX_AA_ECRS |
+		ATMEL_PMX_AA_ETX1 |	ATMEL_PMX_AA_ETX0 |
+		ATMEL_PMX_AA_ETXEN |	ATMEL_PMX_AA_EREFCK;
 
 	writel(value, &pio->pioa.pdr);
 	writel(value, &pio->pioa.asr);
 
 #ifdef CONFIG_RMII
-	value = AT91_PMX_BA_ERXCK;
+	value = ATMEL_PMX_BA_ERXCK;
 #else
-	value = AT91_PMX_BA_ERXCK |	AT91_PMX_BA_ECOL |
-		AT91_PMX_BA_ERXDV |	AT91_PMX_BA_ERX3 |
-		AT91_PMX_BA_ERX2 |	AT91_PMX_BA_ETXER |
-		AT91_PMX_BA_ETX3 |	AT91_PMX_BA_ETX2;
+	value = ATMEL_PMX_BA_ERXCK |	ATMEL_PMX_BA_ECOL |
+		ATMEL_PMX_BA_ERXDV |	ATMEL_PMX_BA_ERX3 |
+		ATMEL_PMX_BA_ERX2 |	ATMEL_PMX_BA_ETXER |
+		ATMEL_PMX_BA_ETX3 |	ATMEL_PMX_BA_ETX2;
 #endif
 	writel(value, &pio->piob.pdr);
 	writel(value, &pio->piob.bsr);
 
-	writel(1 << AT91_ID_EMAC, &pmc->pcer);
+	writel(1 << ATMEL_ID_EMAC, &pmc->pcer);
 	writel(readl(&emac->ctl) | AT91_EMAC_CTL_CSR, &emac->ctl);
 
 	/* Init Ethernet buffers */
@@ -476,11 +476,11 @@ static int at91emac_write_hwaddr(struct eth_device *netdev)
 {
 	emac_device *dev;
 	at91_emac_t *emac;
-	at91_pmc_t *pmc = (at91_pmc_t *) AT91_PMC_BASE;
+	at91_pmc_t *pmc = (at91_pmc_t *) ATMEL_BASE_PMC;
 	emac = (at91_emac_t *) netdev->iobase;
 	dev = (emac_device *) netdev->priv;
 
-	writel(1 << AT91_ID_EMAC, &pmc->pcer);
+	writel(1 << ATMEL_ID_EMAC, &pmc->pcer);
 	DEBUG_AT91EMAC("init MAC-ADDR %x%x \n",
 		cpu_to_le16(*((u16 *)(netdev->enetaddr + 4))),
 		cpu_to_le32(*((u32 *)netdev->enetaddr)));
@@ -498,7 +498,7 @@ int at91emac_register(bd_t *bis, unsigned long iobase)
 	struct eth_device *dev;
 
 	if (iobase == 0)
-		iobase = AT91_EMAC_BASE;
+		iobase = ATMEL_BASE_EMAC;
 	emac = malloc(sizeof(*emac)+512);
 	if (emac == NULL)
 		return -1;
include/configs/at91rm9200ek.h +1 -4
index 810023a..faaef10 100644
@@ -61,7 +61,6 @@
 #define CONFIG_SYS_HZ			1000
 
 /* CPU configuration */
-#define CONFIG_ARM920T
 #define CONFIG_AT91RM9200
 #define CONFIG_AT91RM9200EK
 #define CONFIG_CPUAT91
@@ -71,8 +70,6 @@
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_INITRD_TAG
 
-#define CONFIG_AT91FAMILY
-
 /*
  * Memory Configuration
  */
@@ -172,7 +169,7 @@
 #define CONFIG_DOS_PARTITION			1
 
 #define CONFIG_SYS_USB_OHCI_CPU_INIT		1
-#define CONFIG_SYS_USB_OHCI_REGS_BASE		AT91_USB_HOST_BASE
+#define CONFIG_SYS_USB_OHCI_REGS_BASE		ATMEL_USB_HOST_BASE
 #define CONFIG_SYS_USB_OHCI_SLOT_NAME		"at91rm9200"
 #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS	15
 
include/configs/eb_cpux9k2.h +11 -12
index 754fc8b..e12770a 100644
@@ -29,12 +29,11 @@
 
 /*--------------------------------------------------------------------------*/
 
-#define CONFIG_ARM920T		1	/* This is an ARM920T Core	*/
-#define CONFIG_AT91RM9200	1	/* It's an Atmel AT91RM9200 SoC	*/
-#define CONFIG_EB_CPUX9K2	1	/* on an EP+CPUX9K2 Board	*/
-#define USE_920T_MMU		1
+#define CONFIG_AT91RM9200		/* It's an Atmel AT91RM9200 SoC	*/
+#define CONFIG_EB_CPUX9K2		/* on an EP+CPUX9K2 Board	*/
+#define USE_920T_MMU
 
-#define CONFIG_VERSION_VARIABLE 1
+#define CONFIG_VERSION_VARIABLE
 #define CONFIG_IDENT_STRING	" on EB+CPUx9K2"
 
 #include <asm/arch/hardware.h>	/* needed for port definitions */
@@ -217,19 +216,19 @@
 #define CONFIG_SYS_I2C_INIT_BOARD
 
 #define I2C_INIT	i2c_init_board();
-#define I2C_ACTIVE	writel(AT91_PMX_AA_TWD, &pio->pioa.mddr);
-#define I2C_TRISTATE	writel(AT91_PMX_AA_TWD, &pio->pioa.mder);
-#define I2C_READ	((readl(&pio->pioa.pdsr) & AT91_PMX_AA_TWD) != 0)
+#define I2C_ACTIVE	writel(ATMEL_PMX_AA_TWD, &pio->pioa.mddr);
+#define I2C_TRISTATE	writel(ATMEL_PMX_AA_TWD, &pio->pioa.mder);
+#define I2C_READ	((readl(&pio->pioa.pdsr) & ATMEL_PMX_AA_TWD) != 0)
 #define I2C_SDA(bit)						\
 	if (bit)						\
-		writel(AT91_PMX_AA_TWD, &pio->pioa.sodr);	\
+		writel(ATMEL_PMX_AA_TWD, &pio->pioa.sodr);	\
 	else							\
-		writel(AT91_PMX_AA_TWD, &pio->pioa.codr);
+		writel(ATMEL_PMX_AA_TWD, &pio->pioa.codr);
 #define I2C_SCL(bit)						\
 	if (bit)						\
-		writel(AT91_PMX_AA_TWCK, &pio->pioa.sodr);	\
+		writel(ATMEL_PMX_AA_TWCK, &pio->pioa.sodr);	\
 	else							\
-		writel(AT91_PMX_AA_TWCK, &pio->pioa.codr);
+		writel(ATMEL_PMX_AA_TWCK, &pio->pioa.codr);
 
 #define I2C_DELAY	udelay(2500000/CONFIG_SYS_I2C_SPEED)
 
Signature · 1 line
1.7.1
#1 lore raw

PATCH v3 1/1 update arm/at91rm9200 work with rework rework110202

Dear Reinhard Meyer,

can you apply this patch to current atmel_rework 110411.

The eb_cpux9k2 board runs with this patch.

The at91rm9200_ek has compiled without error's.

Best regards

Jens Scharsig

#2 lore raw

PATCH v3 1/1 update arm/at91rm9200 work with rework rework110202

Dear Reinhard Meyer,

Am 12.04.2011 um 20:33 schrieb Jens Scharsig:

Quoted 3 lines

Dear Reinhard Meyer,

can you apply this patch to current atmel_rework 110411.

This patch should even go into atmel/next, it is required to have at91rm9200ek built with latest changes merged into atmel/next.

regards

Andreas Bie?mann

#3 lore raw

PATCH v3 1/1 update arm/at91rm9200 work with rework rework110202

In reply to Jens Scharsig

Dear Jens Scharsig,

Quoted 5 lines

can you apply this patch to current atmel_rework 110411.

The eb_cpux9k2 board runs with this patch.

The at91rm9200_ek has compiled without error's.

Applied to u-boot-atmel. I am running MAKEALL at91 right now.

Best Regards,
Reinhard

#4 lore raw

PATCH v3 1/1 update arm/at91rm9200 work with rework rework110202

Am 06.06.2011 08:35, schrieb Reinhard Meyer:

Quoted 11 lines

Dear Jens Scharsig,

Quoted 5 lines

can you apply this patch to current atmel_rework 110411.

The eb_cpux9k2 board runs with this patch.

The at91rm9200_ek has compiled without error's.

Applied to u-boot-atmel. I am running MAKEALL at91 right now.

Best Regards,
Reinhard

I have test u-boot-atmel on physical board (eb_cpux9k2), It's works.

Thanks

Jens Scharsig