Re: [U-Boot] [PATCH ATMEL REWORK] update arm/at91rm9200 work with rework rework110202

2011-02-11 Thread Andreas Bießmann
Dear Jens Scharsig,

Am 10.02.2011 um 20:31 schrieb Jens Scharsig:

 * update arm920t/at91 to ATMEL_xxx name scheme
 * convert at91rm9200ek and eb_cpux9k2 board to ATMEL_xxx name scheme
 * update arm920t/at91 soc lib
 * update at91_emac driver
 
 Signed-off-by: Jens Scharsig js_at...@scharsoft.de

Tested-by: Andreas Bießmann andreas.de...@gmail.com

But some changes

 ---
 
 The eb_cpux9k2 board can compile and runs after patch changes
 The at91rm9200ek can compile, but i have no hardware to test it.

at91rm9200ek is working but the change for timer.c is needed
 Testet peripheral for at91rm9200ek is:
  - USB (fatls)
  - EMAC (tftp)

 arch/arm/cpu/arm920t/at91/reset.c   |2 +-
 arch/arm/cpu/arm920t/at91/timer.c   |   10 +-
 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  |2 +-
 include/configs/eb_cpux9k2.h|   29 +++--
 11 files changed, 201 insertions(+), 183 deletions(-)

[reset.c is OK]

Please add:

diff --git a/arch/arm/cpu/arm920t/at91/timer.c 
b/arch/arm/cpu/arm920t/at91/timer.c
index e2630b8..f0ad7d6 100644
--- a/arch/arm/cpu/arm920t/at91/timer.c
+++ b/arch/arm/cpu/arm920t/at91/timer.c
@@ -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

[other changes to timer.c are OK]
[at91_mc.h is OK]
[at91_pmc.h is OK]

 diff --git a/arch/arm/include/asm/arch-at91/at91rm9200.h 
 b/arch/arm/include/asm/arch-at91/at91rm9200.h
 index 1bee6f2..58f0e39 100644
 --- a/arch/arm/include/asm/arch-at91/at91rm9200.h
 +++ b/arch/arm/include/asm/arch-at91/at91rm9200.h
 @@ -21,115 +21,126 @@
 #ifndef __AT91RM9200_H__
 #define __AT91RM9200_H__
 
 +#define CONFIG_AT91FAMILY/* it's a member of AT91 */
 +#define CONFIG_ARM920T   /* This is an ARM920T Core  */
 +

These are defined in board header .. I saw they are defined also in other 
at91xxx.h files, we should discuss where to define these since all of the 
at91xx.h files are included by hardware.h

 /* Periperial Identifiers */

[snip changes to at91rm9200.h which are obviously OK]

 +#define ATMEL_PIO_PORTS  4   /* theese SoCs have 3 PIO */

3 or 4 PIO?

 +#define ATMEL_PMC_UHPAT91RM9200_PMC_UHP
 +
 +#define CONFIG_SYS_ATMEL_CPU_NAMEAT91RM9200
 
 #endif

[cpux9k2.c is OK]
[at91rm9200ek.c is OK]
[at91rm9200ek/led.c is OK]
[at91_emac.c is OK]
[at91rm9200ek.h is OK]

 --- a/include/configs/eb_cpux9k2.h
 +++ b/include/configs/eb_cpux9k2.h
 @@ -29,12 +29,13 @@
 
 /*--*/
 
 -#define CONFIG_ARM920T   1   /* This is an ARM920T Core  
 */
 -#define CONFIG_AT91RM92001   /* It's an Atmel AT91RM9200 SoC */
 -#define CONFIG_EB_CPUX9K21   /* on an EP+CPUX9K2 Board   */
 -#define USE_920T_MMU 1
 +#define CONFIG_ARM920T   /* This is an ARM920T Core  
 */
 +#define CONFIG_AT91FAMILY
 +#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_STRINGon EB+CPUx9K2
 
 #include asm/arch/hardware.h/* needed for port definitions */
 @@ -186,8 +187,12 @@
 #define CONFIG_NET_RETRY_COUNT10
 #define CONFIG_RESET_PHY_R1
 
 +

please remove this additional empty line

 #define CONFIG_DRIVER_AT91EMAC1
 #define CONFIG_DRIVER_AT91EMAC_QUIET  1
 +/*
 +#define CONFIG_DRIVER_MACB   1
 +*/

why this? Either it is needed or not.

 #define CONFIG_SYS_RX_ETH_BUFFER  8
 #define CONFIG_MII1
 
 @@ -217,19 +222,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

Re: [U-Boot] [PATCH ATMEL REWORK] update arm/at91rm9200 work with rework rework110202

2011-02-11 Thread Jens Scharsig
Dear Andreas Bießmann,

I'm offline for the net 10 days. So I fast include your comments to a V2 patch 
version

Am 11.02.2011 09:11, schrieb Andreas Bießmann:
 Dear Jens Scharsig,
 
 Am 10.02.2011 um 20:31 schrieb Jens Scharsig:
 
 * update arm920t/at91 to ATMEL_xxx name scheme
 * convert at91rm9200ek and eb_cpux9k2 board to ATMEL_xxx name scheme
 * update arm920t/at91 soc lib
 * update at91_emac driver

 Signed-off-by: Jens Scharsig js_at...@scharsoft.de
 
 Tested-by: Andreas Bießmann andreas.de...@gmail.com
 
 But some changes

I have prepare a second version of my patch.
 
 ---

 The eb_cpux9k2 board can compile and runs after patch changes
 The at91rm9200ek can compile, but i have no hardware to test it.
 
 at91rm9200ek is working but the change for timer.c is needed

The timer.c changes I sent i a previous patch. I have join them to V2
  Testet peripheral for at91rm9200ek is:
   - USB (fatls)
   - EMAC (tftp)
 

 +#define CONFIG_AT91FAMILY   /* it's a member of AT91 */
 +#define CONFIG_ARM920T  /* This is an ARM920T Core  */
 +
 
 These are defined in board header .. I saw they are defined also in other 
 at91xxx.h files, we should discuss where to define these since all of the 
 at91xx.h files are included by hardware.h

In V2 a have remove the define from board config's
 
 /* Periperial Identifiers */
 
 [snip changes to at91rm9200.h which are obviously OK]
 
 +#define ATMEL_PIO_PORTS 4   /* theese SoCs have 3 PIO */
 
 3 or 4 PIO?

3 for PLCC and 4 for BGA variants. In PLCC the 4th port is not bound out. 
I set the comment to 4 in V2


 +
 
 please remove this additional empty line

removed
 
 #define CONFIG_DRIVER_AT91EMAC   1
 #define CONFIG_DRIVER_AT91EMAC_QUIET 1
 +/*
 +#define CONFIG_DRIVER_MACB  1
 +*/
 
 why this? Either it is needed or not.
 
waste from testing, removed

Best regard 

Jens Scharsig
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH ATMEL REWORK] update arm/at91rm9200 work with rework rework110202

2011-02-10 Thread Jens Scharsig
* update arm920t/at91 to ATMEL_xxx name scheme
* convert at91rm9200ek and eb_cpux9k2 board to ATMEL_xxx name scheme
* update arm920t/at91 soc lib
* update at91_emac driver

Signed-off-by: Jens Scharsig js_at...@scharsoft.de
---

The eb_cpux9k2 board can compile and runs after patch changes
The at91rm9200ek can compile, but i have no hardware to test it.

 arch/arm/cpu/arm920t/at91/reset.c   |2 +-
 arch/arm/cpu/arm920t/at91/timer.c   |   10 +-
 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  |2 +-
 include/configs/eb_cpux9k2.h|   29 +++--
 11 files changed, 201 insertions(+), 183 deletions(-)

diff --git a/arch/arm/cpu/arm920t/at91/reset.c 
b/arch/arm/cpu/arm920t/at91/reset.c
index 51043ec..4fa0f98 100644
--- a/arch/arm/cpu/arm920t/at91/reset.c
+++ b/arch/arm/cpu/arm920t/at91/reset.c
@@ -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();
diff --git a/arch/arm/cpu/arm920t/at91/timer.c 
b/arch/arm/cpu/arm920t/at91/timer.c
index c4c5eef..f0ad7d6 100644
--- a/arch/arm/cpu/arm920t/at91/timer.c
+++ b/arch/arm/cpu/arm920t/at91/timer.c
@@ -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)  0x;
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)  0x;
diff --git a/arch/arm/include/asm/arch-at91/at91_mc.h 
b/arch/arm/include/asm/arch-at91/at91_mc.h
index acfbd10..e0d1320 100644
--- a/arch/arm/include/asm/arch-at91/at91_mc.h
+++ b/arch/arm/include/asm/arch-at91/at91_mc.h
@@ -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__
 
diff --git a/arch/arm/include/asm/arch-at91/at91_pmc.h 
b/arch/arm/include/asm/arch-at91/at91_pmc.h
index fb8bb17..086cb9b 100644
--- a/arch/arm/include/asm/arch-at91/at91_pmc.h
+++ b/arch/arm/include/asm/arch-at91/at91_pmc.h
@@ -17,11 +17,11 @@
 #ifndef AT91_PMC_H
 #define AT91_PMC_H
 
-#defineAT91_ASM_PMC_MOR(AT91_PMC_BASE + 0x20)
-#defineAT91_ASM_PMC_PLLAR  (AT91_PMC_BASE + 0x28)
-#defineAT91_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)
+#defineAT91_ASM_PMC_MOR(ATMEL_BASE_PMC + 0x20)
+#defineAT91_ASM_PMC_PLLAR  (ATMEL_BASE_PMC + 0x28)
+#defineAT91_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__
 
diff --git a/arch/arm/include/asm/arch-at91/at91rm9200.h 
b/arch/arm/include/asm/arch-at91/at91rm9200.h
index 1bee6f2..58f0e39 100644
--- a/arch/arm/include/asm/arch-at91/at91rm9200.h
+++ b/arch/arm/include/asm/arch-at91/at91rm9200.h
@@ -21,115 +21,126 @@
 #ifndef