Patchwork [U-Boot] at91: move get_chip_id() and get_extension_chip_id() to cpu.c, which can share with all at91 board.

login
register
mail settings
Submitter Wu, Josh
Date Nov. 1, 2012, 10:57 a.m.
Message ID <1351767447-19268-1-git-send-email-josh.wu@atmel.com>
Download mbox | patch
Permalink /patch/196157/
State Rejected
Delegated to: Andreas Bießmann
Headers show

Comments

Wu, Josh - Nov. 1, 2012, 10:57 a.m.
Signed-off-by: Josh Wu <josh.wu@atmel.com>
---
 arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c |   12 ------------
 arch/arm/cpu/arm926ejs/at91/cpu.c                |   11 +++++++++++
 arch/arm/include/asm/arch-at91/at91_dbu.h        |    4 ++++
 arch/arm/include/asm/arch-at91/at91sam9x5.h      |    1 -
 4 files changed, 15 insertions(+), 13 deletions(-)
Andreas Bießmann - Nov. 5, 2012, 10:18 a.m.
Dear Josh Wu,

On 01.11.2012 11:57, Josh Wu wrote:
> Signed-off-by: Josh Wu <josh.wu@atmel.com>
> ---
>  arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c |   12 ------------
>  arch/arm/cpu/arm926ejs/at91/cpu.c                |   11 +++++++++++
>  arch/arm/include/asm/arch-at91/at91_dbu.h        |    4 ++++
>  arch/arm/include/asm/arch-at91/at91sam9x5.h      |    1 -
>  4 files changed, 15 insertions(+), 13 deletions(-)

applied to u-boot-atmel/master, thanks!

Best regards

Andreas Bießmann
Andreas Bießmann - Nov. 6, 2012, 9:21 a.m.
Dear Josh Wu,

On 05.11.2012 11:18, Andreas Bießmann wrote:
> Dear Josh Wu,
> 
> On 01.11.2012 11:57, Josh Wu wrote:
>> Signed-off-by: Josh Wu <josh.wu@atmel.com>
>> ---
>>  arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c |   12 ------------
>>  arch/arm/cpu/arm926ejs/at91/cpu.c                |   11 +++++++++++
>>  arch/arm/include/asm/arch-at91/at91_dbu.h        |    4 ++++
>>  arch/arm/include/asm/arch-at91/at91sam9x5.h      |    1 -
>>  4 files changed, 15 insertions(+), 13 deletions(-)
> 
> applied to u-boot-atmel/master, thanks!
> 

Patch was removed from u-boot-atmel cause of a NAK from ARM custodian.
Please read http://article.gmane.org/gmane.comp.boot-loaders.u-boot/146403
and provide a user for the moved functions.

Best regards

Andreas Bießmann

Patch

diff --git a/arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c b/arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c
index 9348552..6855d3e 100644
--- a/arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c
+++ b/arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c
@@ -26,18 +26,6 @@ 
 #include <asm/arch/gpio.h>
 #include <asm/io.h>
 
-unsigned int get_chip_id(void)
-{
-	/* The 0x40 is the offset of cidr in DBGU */
-	return readl(ATMEL_BASE_DBGU + 0x40) & ~ARCH_ID_VERSION_MASK;
-}
-
-unsigned int get_extension_chip_id(void)
-{
-	/* The 0x44 is the offset of exid in DBGU */
-	return readl(ATMEL_BASE_DBGU + 0x44);
-}
-
 unsigned int has_emac1()
 {
 	return cpu_is_at91sam9x25();
diff --git a/arch/arm/cpu/arm926ejs/at91/cpu.c b/arch/arm/cpu/arm926ejs/at91/cpu.c
index 5cf4fad..351e19c 100644
--- a/arch/arm/cpu/arm926ejs/at91/cpu.c
+++ b/arch/arm/cpu/arm926ejs/at91/cpu.c
@@ -26,6 +26,7 @@ 
 #include <common.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
+#include <asm/arch/at91_dbu.h>
 #include <asm/arch/at91_pmc.h>
 #include <asm/arch/at91_pit.h>
 #include <asm/arch/at91_gpbr.h>
@@ -71,3 +72,13 @@  int print_cpuinfo(void)
 	return 0;
 }
 #endif
+
+unsigned int get_chip_id(void)
+{
+	return readl(ATMEL_BASE_DBGU + AT91_DBU_CIDR) & ~AT91_DBU_CIDR_VERSION;
+}
+
+unsigned int get_extension_chip_id(void)
+{
+	return readl(ATMEL_BASE_DBGU + AT91_DBU_EXID);
+}
diff --git a/arch/arm/include/asm/arch-at91/at91_dbu.h b/arch/arm/include/asm/arch-at91/at91_dbu.h
index 3429293..fe64198 100644
--- a/arch/arm/include/asm/arch-at91/at91_dbu.h
+++ b/arch/arm/include/asm/arch-at91/at91_dbu.h
@@ -38,4 +38,8 @@  typedef struct at91_dbu {
 #define AT91_DBU_CID_ARCH_9xx		0x01900000
 #define AT91_DBU_CID_ARCH_9XExx	0x02900000
 
+#define AT91_DBU_CIDR_VERSION		(0x1f << 0)
+#define AT91_DBU_CIDR			0x40
+#define AT91_DBU_EXID			0x44
+
 #endif
diff --git a/arch/arm/include/asm/arch-at91/at91sam9x5.h b/arch/arm/include/asm/arch-at91/at91sam9x5.h
index 0e728c9..659c01d 100644
--- a/arch/arm/include/asm/arch-at91/at91sam9x5.h
+++ b/arch/arm/include/asm/arch-at91/at91sam9x5.h
@@ -118,7 +118,6 @@ 
 
 /* 9x5 series chip id definitions */
 #define ARCH_ID_AT91SAM9X5	0x819a05a0
-#define ARCH_ID_VERSION_MASK	0x1f
 #define ARCH_EXID_AT91SAM9G15	0x00000000
 #define ARCH_EXID_AT91SAM9G35	0x00000001
 #define ARCH_EXID_AT91SAM9X35	0x00000002