Skip to contentSkip to conversation

at91: move get_chip_id() and get_extension_chip_id() to cpu.c, which can share with all at91 board.

PATCH New Josh Wu 2 participants 3 messages Nov 1, 2012 – Nov 6, 2012

Subsystems (2)
lore
Share & tools
lore

Josh Wu

author
#0 lore raw

PATCH 1/1 at91: move get_chip_id() and get_extension_chip_id() to cpu.c, which can share with all at91 board.

---
 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(-)
arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c +0 -12
index 9348552..6855d3e 100644
@@ -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();
arch/arm/cpu/arm926ejs/at91/cpu.c +11 -0
index 5cf4fad..351e19c 100644
@@ -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);
+}
arch/arm/include/asm/arch-at91/at91_dbu.h +4 -0
index 3429293..fe64198 100644
@@ -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
arch/arm/include/asm/arch-at91/at91sam9x5.h +0 -1
index 0e728c9..659c01d 100644
@@ -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
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 at91: move get_chip_id() and get_extension_chip_id() to cpu.c, which can share with all at91 board.

Dear Josh Wu,

Quoted 7 lines · Josh Wu
---
 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

#2 lore raw

PATCH 1/1 at91: move get_chip_id() and get_extension_chip_id() to cpu.c, which can share with all at91 board.

Dear Josh Wu,

Quoted 11 lines · Andreas Bie?mann

Dear Josh Wu,

Quoted 7 lines · Josh Wu
---
 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(-)
Quoted 2 lines

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