Commit ad14e476 authored by Kevin Hilman's avatar Kevin Hilman

ARM: DaVinci: Add framework for run-time handling for DaVinci CPU family.

Add cpu_is* functions to handle various TI DaVinci based CPUs.
Signed-off-by: default avatarSteve Chen <schen@mvista.com>
Signed-off-by: default avatarKevin Hilman <khilman@mvista.com>
parent ef2dc0e6
...@@ -20,6 +20,10 @@ ...@@ -20,6 +20,10 @@
#define DAVINCI_DEV_ID 0x01c40028 #define DAVINCI_DEV_ID 0x01c40028
#define DAVINCI_DM6443_CPU_ID 0x64430000
#define DAVINCI_DM6467_CPU_ID 0x64670000
#define DAVINCI_DM350_CPU_ID 0x03500000
struct davinci_id { struct davinci_id {
u16 jtag_id; /* Device Part No. (Unique JTAG id)*/ u16 jtag_id; /* Device Part No. (Unique JTAG id)*/
u8 dev_rev; /* Processor revision */ u8 dev_rev; /* Processor revision */
...@@ -29,7 +33,14 @@ struct davinci_id { ...@@ -29,7 +33,14 @@ struct davinci_id {
/* Register values to detect the DaVinci version */ /* Register values to detect the DaVinci version */
static struct davinci_id davinci_ids[] __initdata = { static struct davinci_id davinci_ids[] __initdata = {
{ .jtag_id = 0xb700, .dev_rev = 0x2, .mfg_jtag_id = 0x017, .type = 0x64430000}, { .jtag_id = 0xb700, .dev_rev = 0x2, .mfg_jtag_id = 0x017,
.type = DAVINCI_DM6443_CPU_ID }, /* DaVinci */
{ .jtag_id = 0xb770, .dev_rev = 0x0, .mfg_jtag_id = 0x017,
.type = DAVINCI_DM6467_CPU_ID }, /* DaVinci HD */
{ .jtag_id = 0xb73b, .dev_rev = 0x0, .mfg_jtag_id = 0x00f,
.type = DAVINCI_DM350_CPU_ID },
}; };
/* /*
......
/*
* linux/include/asm-arm/arch-davinci/cpu.h
*
* Davinci cpu type detection
*
* Author: Steve Chen <schen@mvista.com>
*
* 2007 (c) MontaVista Software, Inc. This file is licensed under
* the terms of the GNU General Public License version 2. This program
* is licensed "as is" without any warranty of any kind, whether express
* or implied.
*/
#ifndef _ASM_ARCH_CPU_H
#define _ASM_ARCH_CPU_H
extern unsigned int system_rev;
#define GET_DAVINCI_CPU_TYPE ((system_rev >> 16) & 0xffff)
#define IS_DAVINCI_CPU(type, id) \
static inline int cpu_is_davinci_dm ##type (void) \
{ \
return (GET_DAVINCI_CPU_TYPE == (id)) ? 1 : 0; \
}
/* following generates the cpu_is_davinci_dmxxx */
IS_DAVINCI_CPU(6443, 0x6443) /* cpu_is_davinci_dm6443() */
IS_DAVINCI_CPU(6467, 0x6467) /* cpu_is_davinci_dm6467() */
IS_DAVINCI_CPU(350, 0x350) /* cpu_is_davinci_dm350() */
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment