summaryrefslogtreecommitdiffstats
path: root/sys/arm/at91/at91var.h
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2012-07-11 20:17:14 +0000
committerimp <imp@FreeBSD.org>2012-07-11 20:17:14 +0000
commit515d0c1d290c1ac2fb1aa99e74ef4175c158a007 (patch)
treecdb15b34649d1c3b0b980724718c54d34344146f /sys/arm/at91/at91var.h
parent003ccf85faf91187b67eb412e643bb75b87ae2a6 (diff)
downloadFreeBSD-src-515d0c1d290c1ac2fb1aa99e74ef4175c158a007.zip
FreeBSD-src-515d0c1d290c1ac2fb1aa99e74ef4175c158a007.tar.gz
Make the SoC stuff a little more modular, and start to move away from
having the CPU device that's a child of atmelarm that does stuff. o Create a linker_set for the support fucntions for the SoCs. o Rename soc_data to soc_info. o Move the delay and reset function pointers to new soc_data struct o Create elements for all known SoCs o Add lookup of the SoC we found, and print a warning if it isn't one we know about.
Diffstat (limited to 'sys/arm/at91/at91var.h')
-rw-r--r--sys/arm/at91/at91var.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/sys/arm/at91/at91var.h b/sys/arm/at91/at91var.h
index 614687c..183b723 100644
--- a/sys/arm/at91/at91var.h
+++ b/sys/arm/at91/at91var.h
@@ -74,6 +74,7 @@ enum at91_soc_type {
};
enum at91_soc_subtype {
+ AT91_ST_ANY = -1, /* Match any type */
AT91_ST_NONE = 0,
/* AT91RM9200 */
AT91_ST_RM9200_BGA,
@@ -104,6 +105,11 @@ enum at91_soc_family {
typedef void (*DELAY_t)(int);
typedef void (*cpu_reset_t)(void);
+struct at91_soc_data {
+ DELAY_t soc_delay;
+ cpu_reset_t soc_reset;
+};
+
struct at91_soc_info {
enum at91_soc_type type;
enum at91_soc_subtype subtype;
@@ -111,11 +117,10 @@ struct at91_soc_info {
uint32_t cidr;
uint32_t exid;
char name[AT91_SOC_NAME_MAX];
- DELAY_t delay;
- cpu_reset_t reset;
+ struct at91_soc_data *soc_data;
};
-extern struct at91_soc_info soc_data;
+extern struct at91_soc_info soc_info;
static inline int at91_is_rm92(void);
static inline int at91_is_sam9(void);
@@ -126,28 +131,28 @@ static inline int
at91_is_rm92(void)
{
- return (soc_data.type == AT91_T_RM9200);
+ return (soc_info.type == AT91_T_RM9200);
}
static inline int
at91_is_sam9(void)
{
- return (soc_data.family == AT91_FAMILY_SAM9);
+ return (soc_info.family == AT91_FAMILY_SAM9);
}
static inline int
at91_is_sam9xe(void)
{
- return (soc_data.family == AT91_FAMILY_SAM9XE);
+ return (soc_info.family == AT91_FAMILY_SAM9XE);
}
static inline int
at91_cpu_is(u_int cpu)
{
- return (soc_data.type == cpu);
+ return (soc_info.type == cpu);
}
void at91_add_child(device_t dev, int prio, const char *name, int unit,
OpenPOWER on IntegriCloud