mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-08-20 00:48:52 +09:00
OMAP4/5: device: Add support to get the device type.
Add support to identify the device as GP/EMU/HS. Signed-off-by: R Sricharan <r.sricharan@ti.com>
This commit is contained in:
parent
002a2c0c66
commit
c1fa3c37af
@ -217,7 +217,11 @@ int arch_cpu_init(void)
|
|||||||
*/
|
*/
|
||||||
u32 get_device_type(void)
|
u32 get_device_type(void)
|
||||||
{
|
{
|
||||||
return 0;
|
struct omap_sys_ctrl_regs *ctrl =
|
||||||
|
(struct omap_sys_ctrl_regs *) SYSCTRL_GENERAL_CORE_BASE;
|
||||||
|
|
||||||
|
return (readl(&ctrl->control_status) &
|
||||||
|
(DEVICE_TYPE_MASK)) >> DEVICE_TYPE_SHIFT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -139,6 +139,10 @@ struct s32ktimer {
|
|||||||
unsigned int s32k_cr; /* 0x10 */
|
unsigned int s32k_cr; /* 0x10 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define DEVICE_TYPE_SHIFT (0x8)
|
||||||
|
#define DEVICE_TYPE_MASK (0x7 << DEVICE_TYPE_SHIFT)
|
||||||
|
#define DEVICE_GP 0x3
|
||||||
|
|
||||||
struct omap_sys_ctrl_regs {
|
struct omap_sys_ctrl_regs {
|
||||||
unsigned int pad1[129];
|
unsigned int pad1[129];
|
||||||
unsigned int control_id_code; /* 0x4A002204 */
|
unsigned int control_id_code; /* 0x4A002204 */
|
||||||
|
@ -136,6 +136,10 @@ struct s32ktimer {
|
|||||||
unsigned int s32k_cr; /* 0x10 */
|
unsigned int s32k_cr; /* 0x10 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define DEVICE_TYPE_SHIFT 0x6
|
||||||
|
#define DEVICE_TYPE_MASK (0x7 << DEVICE_TYPE_SHIFT)
|
||||||
|
#define DEVICE_GP 0x3
|
||||||
|
|
||||||
struct omap_sys_ctrl_regs {
|
struct omap_sys_ctrl_regs {
|
||||||
u32 pad0[77]; /* 0x4A002000 */
|
u32 pad0[77]; /* 0x4A002000 */
|
||||||
u32 control_status; /* 0x4A002134 */
|
u32 control_status; /* 0x4A002134 */
|
||||||
|
Loading…
Reference in New Issue
Block a user