summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cesar/hal/arch/inc/regs_addr.h3
-rw-r--r--cesar/hal/arch/platform.h41
2 files changed, 44 insertions, 0 deletions
diff --git a/cesar/hal/arch/inc/regs_addr.h b/cesar/hal/arch/inc/regs_addr.h
index d951903088..2c5f34f706 100644
--- a/cesar/hal/arch/inc/regs_addr.h
+++ b/cesar/hal/arch/inc/regs_addr.h
@@ -22,4 +22,7 @@
/* This one is not supposed to be changed after startup, drop volatile. */
#define ARCH_MARIA_RB_LEON_ADD_START ARCH_MARIA_RB_CONST_REG (0x120)
+/* Maria 2 device ID (MSE500) */
+#define ARCH_MARIA_RB_DEVICE_ID ARCH_MARIA_RB_CONST_REG (0xC)
+
#endif /* regs_addr_h */
diff --git a/cesar/hal/arch/platform.h b/cesar/hal/arch/platform.h
new file mode 100644
index 0000000000..9cbc82d7ca
--- /dev/null
+++ b/cesar/hal/arch/platform.h
@@ -0,0 +1,41 @@
+#ifndef hal_arch_platform_h
+#define hal_arch_platform_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2012 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file hal/arch/platform.h
+ * \brief Platform specific functions.
+ * \ingroup hal_arch
+ */
+#include "hal/arch/inc/regs_addr.h"
+
+BEGIN_DECLS
+
+/**
+ * Return true if the platform is SPC300.
+ * \return true if spc300
+ */
+extern inline bool
+arch_is_spc300 (void)
+{
+ return !ARCH_MARIA_RB_DEVICE_ID;
+}
+
+/**
+ * Return true if the platform is MSE500
+ * \return true if mse500
+ */
+extern inline bool
+arch_is_mse500 (void)
+{
+ return ARCH_MARIA_RB_DEVICE_ID;
+}
+
+END_DECLS
+
+#endif /* hal_arch_platform_h */