summaryrefslogtreecommitdiffstats
path: root/sys/arm/at91/at91var.h
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2012-06-06 06:19:52 +0000
committerimp <imp@FreeBSD.org>2012-06-06 06:19:52 +0000
commit691dfc2d38f86af8b930db40efa6e0ec1a6e455d (patch)
tree617d0d8012fd119d3365d9c0af1002c05b650c26 /sys/arm/at91/at91var.h
parent189fa08e47a3906066f9b390ce70cd71487ca409 (diff)
downloadFreeBSD-src-691dfc2d38f86af8b930db40efa6e0ec1a6e455d.zip
FreeBSD-src-691dfc2d38f86af8b930db40efa6e0ec1a6e455d.tar.gz
Enhance the Atmel SoC chip identification routines to account for more
SoC variants. Fold the AT91SAM9XE chips into the AT91SAM9260 handling, where appropriate. The following SoCs/SoC families are recognized: at91cap9, at91rm9200, at91sam9260, at91sam9261, at91sam9263, at91sam9g10, at91sam9g20, at91sam9g45, at91sam9n12, at91sam9rl, at91sam9x5 and the following variations are also recognized: at91rm9200_bga, at91rm9200_pqfp, at91sam9xe, at91sam9g45, at91sam9m10, at91sam9g46, at91sam9m11, at91sam9g15, at91sam9g25, at91sam9g35, at91sam9x25, at91sam9x35 This is only the identification routine: no additional Atmel devices are supported at this time. # With these changes, I'm able to boot to the point of identification # on a few different Atmel SoCs that we don't yet support using the # KB920X config file -- someday tht will be an ATMEL config file...
Diffstat (limited to 'sys/arm/at91/at91var.h')
-rw-r--r--sys/arm/at91/at91var.h63
1 files changed, 57 insertions, 6 deletions
diff --git a/sys/arm/at91/at91var.h b/sys/arm/at91/at91var.h
index be82eee..a8df717 100644
--- a/sys/arm/at91/at91var.h
+++ b/sys/arm/at91/at91var.h
@@ -59,7 +59,59 @@ struct cpu_devs
const char *parent_clk;
};
-extern uint32_t at91_chip_id;
+enum at91_soc_type {
+ AT91_T_NONE = 0,
+ AT91_T_CAP9,
+ AT91_T_RM9200,
+ AT91_T_SAM9260,
+ AT91_T_SAM9261,
+ AT91_T_SAM9263,
+ AT91_T_SAM9G10,
+ AT91_T_SAM9G20,
+ AT91_T_SAM9G45,
+ AT91_T_SAM9N12,
+ AT91_T_SAM9RL,
+ AT91_T_SAM9X5,
+};
+
+enum at91_soc_subtype {
+ AT91_ST_NONE = 0,
+ /* AT91RM9200 */
+ AT91_ST_RM9200_BGA,
+ AT91_ST_RM9200_PQFP,
+ /* AT91SAM9260 */
+ AT91_ST_SAM9XE,
+ /* AT91SAM9G45 */
+ AT91_ST_SAM9G45,
+ AT91_ST_SAM9M10,
+ AT91_ST_SAM9G46,
+ AT91_ST_SAM9M11,
+ /* AT91SAM9X5 */
+ AT91_ST_SAM9G15,
+ AT91_ST_SAM9G25,
+ AT91_ST_SAM9G35,
+ AT91_ST_SAM9X25,
+ AT91_ST_SAM9X35,
+};
+
+enum at91_soc_family {
+ AT91_FAMILY_SAM9 = 0x19,
+ AT91_FAMILY_SAM9XE = 0x29,
+ AT91_FAMILY_RM92 = 0x92,
+};
+
+#define AT91_SOC_NAME_MAX 50
+
+struct at91_soc_info {
+ enum at91_soc_type type;
+ enum at91_soc_subtype subtype;
+ enum at91_soc_family family;
+ uint32_t cidr;
+ uint32_t exid;
+ char name[AT91_SOC_NAME_MAX];
+};
+
+extern struct at91_soc_info soc_data;
static inline int at91_is_rm92(void);
static inline int at91_is_sam9(void);
@@ -70,33 +122,32 @@ static inline int
at91_is_rm92(void)
{
- return (AT91_ARCH(at91_chip_id) == AT91_ARCH_RM92);
+ return (soc_data.type == AT91_T_RM9200);
}
static inline int
at91_is_sam9(void)
{
- return (AT91_ARCH(at91_chip_id) == AT91_ARCH_SAM9);
+ return (soc_data.family == AT91_FAMILY_SAM9);
}
static inline int
at91_is_sam9xe(void)
{
- return (AT91_ARCH(at91_chip_id) == AT91_ARCH_SAM9XE);
+ return (soc_data.family == AT91_FAMILY_SAM9XE);
}
static inline int
at91_cpu_is(u_int cpu)
{
- return (AT91_CPU(at91_chip_id) == cpu);
+ return (soc_data.type == cpu);
}
extern uint32_t at91_irq_system;
extern uint32_t at91_master_clock;
-
void at91_pmc_init_clock(void);
#endif /* _AT91VAR_H_ */
OpenPOWER on IntegriCloud