* [U-Boot] [PATCH] at91: move get_chip_id() and get_extension_chip_id() to cpu.c, which can share with all at91 board.
@ 2012-11-01 10:57 Josh Wu
2012-11-05 10:18 ` Andreas Bießmann
0 siblings, 1 reply; 3+ messages in thread
From: Josh Wu @ 2012-11-01 10:57 UTC (permalink / raw)
To: u-boot
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(-)
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
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread* [U-Boot] [PATCH] at91: move get_chip_id() and get_extension_chip_id() to cpu.c, which can share with all at91 board.
2012-11-01 10:57 [U-Boot] [PATCH] at91: move get_chip_id() and get_extension_chip_id() to cpu.c, which can share with all at91 board Josh Wu
@ 2012-11-05 10:18 ` Andreas Bießmann
2012-11-06 9:21 ` Andreas Bießmann
0 siblings, 1 reply; 3+ messages in thread
From: Andreas Bießmann @ 2012-11-05 10:18 UTC (permalink / raw)
To: u-boot
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] at91: move get_chip_id() and get_extension_chip_id() to cpu.c, which can share with all at91 board.
2012-11-05 10:18 ` Andreas Bießmann
@ 2012-11-06 9:21 ` Andreas Bießmann
0 siblings, 0 replies; 3+ messages in thread
From: Andreas Bießmann @ 2012-11-06 9:21 UTC (permalink / raw)
To: u-boot
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-11-06 9:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-01 10:57 [U-Boot] [PATCH] at91: move get_chip_id() and get_extension_chip_id() to cpu.c, which can share with all at91 board Josh Wu
2012-11-05 10:18 ` Andreas Bießmann
2012-11-06 9:21 ` Andreas Bießmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox