diff mbox

[U-Boot,1/2] da8xx: Add cpu_is_da8xx macros

Message ID 1289486282-20988-2-git-send-email-sbabic@denx.de
State Accepted
Commit a131148efe21e92528a146f600613a9b89abdfdc
Delegated to: Sandeep Paulraj
Headers show

Commit Message

Stefano Babic Nov. 11, 2010, 2:38 p.m. UTC
From: Sudhakar Rajashekhara <sudhakar.raj@ti.com>

Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
CC: Stefano Babic <sbabic@denx.de>
CC: Detlev Zundev <dzu@denx.de>
CC: Ben Gardiner <bengardiner@nanometrics.ca>
---
 arch/arm/include/asm/arch-davinci/hardware.h |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

Comments

Ben Gardiner Nov. 11, 2010, 4:08 p.m. UTC | #1
On Thu, Nov 11, 2010 at 9:38 AM, Stefano Babic <sbabic@denx.de> wrote:
> From: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
>
> Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
> CC: Stefano Babic <sbabic@denx.de>
> CC: Detlev Zundev <dzu@denx.de>
> CC: Ben Gardiner <bengardiner@nanometrics.ca>

Applies cleanly to 0c0892be0d93a5a892b93739c5eb3bf692fed4ff of
git://git.denx.de/u-boot.git; no checkpatch warnings.

Tested along with "[PATCH 2/2] da850: Enable SPI Flash" on da850evm
with no changes to the config. SPI flash was usable as the environment
and location of the u-boot image.

Tested-by: Ben Gardiner <bengardiner@nanometrics.ca>

Best Regards,
Ben Gardiner

---
Nanometrics Inc.
http://www.nanometrics.ca
diff mbox

Patch

diff --git a/arch/arm/include/asm/arch-davinci/hardware.h b/arch/arm/include/asm/arch-davinci/hardware.h
index 3520cf8..2a460b5 100644
--- a/arch/arm/include/asm/arch-davinci/hardware.h
+++ b/arch/arm/include/asm/arch-davinci/hardware.h
@@ -149,6 +149,7 @@  typedef volatile unsigned int *	dv_reg_p;
 #define DAVINCI_DDR_EMIF_DATA_BASE		0xc0000000
 #define DAVINCI_INTC_BASE			0xfffee000
 #define DAVINCI_BOOTCFG_BASE			0x01c14000
+#define JTAG_ID_REG                            (DAVINCI_BOOTCFG_BASE + 0x18)
 
 #endif /* CONFIG_SOC_DA8XX */
 
@@ -442,6 +443,21 @@  struct davinci_uart_ctrl_regs {
 #define DAVINCI_UART_PWREMU_MGMT_URRST	(1 << 13)
 #define DAVINCI_UART_PWREMU_MGMT_UTRST	(1 << 14)
 
+static inline int cpu_is_da830(void)
+{
+	unsigned int jtag_id	= REG(JTAG_ID_REG);
+	unsigned short part_no	= (jtag_id >> 12) & 0xffff;
+
+	return ((part_no == 0xb7df) ? 1 : 0);
+}
+static inline int cpu_is_da850(void)
+{
+	unsigned int jtag_id    = REG(JTAG_ID_REG);
+	unsigned short part_no  = (jtag_id >> 12) & 0xffff;
+
+	return ((part_no == 0xb7d1) ? 1 : 0);
+}
+
 #endif /* CONFIG_SOC_DA8XX */
 
 #endif /* __ASM_ARCH_HARDWARE_H */