arch/arm/mach-omap2/soc.h

Source file repositories/reference/linux-study-clean/arch/arm/mach-omap2/soc.h

File Facts

System
Linux kernel
Corpus path
arch/arm/mach-omap2/soc.h
Extension
.h
Size
14805 bytes
Lines
505
Domain
Architecture Layer
Bucket
arch/arm
Inferred role
Architecture Layer: exported/initcall integration point
Status
integration implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

#include "omap24xx.h"
#include "omap34xx.h"
#include "omap44xx.h"
#include "ti81xx.h"
#include "am33xx.h"
#include "omap54xx.h"

#ifndef __ASSEMBLY__

#include <linux/bitops.h>
#include <linux/of.h>

/*
 * OMAP2+ is always defined as ARCH_MULTIPLATFORM in Kconfig
 */
#undef MULTI_OMAP2
#define MULTI_OMAP2

/*
 * Omap device type i.e. EMU/HS/TST/GP/BAD
 */
#define OMAP2_DEVICE_TYPE_TEST		0
#define OMAP2_DEVICE_TYPE_EMU		1
#define OMAP2_DEVICE_TYPE_SEC		2
#define OMAP2_DEVICE_TYPE_GP		3
#define OMAP2_DEVICE_TYPE_BAD		4

int omap_type(void);

/*
 * omap_rev bits:
 * SoC id bits	(0730, 1510, 1710, 2422...)	[31:16]
 * SoC revision	(See _REV_ defined in cpu.h)	[15:08]
 * SoC class bits (15xx, 16xx, 24xx, 34xx...)	[07:00]
 */
unsigned int omap_rev(void);

static inline int soc_is_omap(void)
{
	return omap_rev() != 0;
}

/*
 * Get the SoC revision for OMAP devices
 */
#define GET_OMAP_REVISION()	((omap_rev() >> 8) & 0xff)

/*
 * Macros to group OMAP into cpu classes.
 * These can be used in most places.
 * soc_is_omap24xx():	True for OMAP2420, OMAP2422, OMAP2423, OMAP2430
 * soc_is_omap242x():	True for OMAP2420, OMAP2422, OMAP2423
 * soc_is_omap243x():	True for OMAP2430
 * soc_is_omap343x():	True for OMAP3430
 * soc_is_omap443x():	True for OMAP4430
 * soc_is_omap446x():	True for OMAP4460
 * soc_is_omap447x():	True for OMAP4470
 * soc_is_omap543x():	True for OMAP5430, OMAP5432
 */
#define GET_OMAP_CLASS	(omap_rev() & 0xff)

#define IS_OMAP_CLASS(class, id)			\
static inline int is_omap ##class (void)		\
{							\
	return (GET_OMAP_CLASS == (id)) ? 1 : 0;	\
}

#define GET_AM_CLASS	((omap_rev() >> 24) & 0xff)

#define IS_AM_CLASS(class, id)				\
static inline int is_am ##class (void)			\
{							\
	return (GET_AM_CLASS == (id)) ? 1 : 0;		\
}

#define GET_TI_CLASS	((omap_rev() >> 24) & 0xff)

#define IS_TI_CLASS(class, id)			\
static inline int is_ti ##class (void)		\
{							\
	return (GET_TI_CLASS == (id)) ? 1 : 0;	\
}

#define GET_DRA_CLASS	((omap_rev() >> 24) & 0xff)

#define IS_DRA_CLASS(class, id)				\
static inline int is_dra ##class (void)			\
{							\
	return (GET_DRA_CLASS == (id)) ? 1 : 0;		\
}

Annotation

Implementation Notes