summaryrefslogtreecommitdiff
path: root/cesar
diff options
context:
space:
mode:
authorThierry Carré2013-01-28 17:13:38 +0100
committerThierry Carré2013-01-31 16:27:32 +0100
commit57dc850e67173ea5b26ca81ee6589e6b22c38018 (patch)
treeb5fd5b060f642d6a9f68ba723c8cee5cf6c1a902 /cesar
parent8300a01bf0a6d2c822396f6de2be04502af42831 (diff)
cesar: check the hardware compatibility when ipmbox is activated, refs #3680
Information about an assert could be collected by Linux, only after ipmbox activation.
Diffstat (limited to 'cesar')
-rw-r--r--cesar/hal/phy/maximus/src/maximus_phy_ctrl.c5
-rw-r--r--cesar/hal/phy/phy.h7
-rw-r--r--cesar/hal/phy/src/phy.c15
-rw-r--r--cesar/mac/ca/test/ca/src/phy_stub.c5
-rw-r--r--cesar/mac/pbproc/pbproc.h7
-rw-r--r--cesar/mac/pbproc/src/pbproc.c8
-rw-r--r--cesar/mac/pbproc/test/pbproc/src/phy.c5
-rw-r--r--cesar/station/src/station.c8
8 files changed, 56 insertions, 4 deletions
diff --git a/cesar/hal/phy/maximus/src/maximus_phy_ctrl.c b/cesar/hal/phy/maximus/src/maximus_phy_ctrl.c
index 9768ab85cf..b0d94cbafc 100644
--- a/cesar/hal/phy/maximus/src/maximus_phy_ctrl.c
+++ b/cesar/hal/phy/maximus/src/maximus_phy_ctrl.c
@@ -2021,6 +2021,11 @@ phy_init (void *user_data, phy_rx_fc_cb_t rx_fc_cb, phy_access_cb_t access_cb,
return &ctx;
}
+void
+phy_check_hardware (phy_t *ctx)
+{
+ dbg_assert_ptr (ctx);
+}
/**
* set errno to:
diff --git a/cesar/hal/phy/phy.h b/cesar/hal/phy/phy.h
index 7890320510..40b9593b87 100644
--- a/cesar/hal/phy/phy.h
+++ b/cesar/hal/phy/phy.h
@@ -99,6 +99,13 @@ phy_init (void *user_data, phy_rx_fc_cb_t rx_fc_cb, phy_access_cb_t access_cb,
phy_tx_false_alarm_cb_t tx_false_alarm_cb, phy_deferred_cb_t deferred_cb);
/**
+ * Check compatibility between software and hardware.
+ * \param ctx phy context
+ */
+void
+phy_check_hardware (phy_t *ctx);
+
+/**
* Set the tone mask and its related parameters, this is a kind of
* initialisation second step.
* \param ctx phy context
diff --git a/cesar/hal/phy/src/phy.c b/cesar/hal/phy/src/phy.c
index c397eacced..f308267844 100644
--- a/cesar/hal/phy/src/phy.c
+++ b/cesar/hal/phy/src/phy.c
@@ -640,10 +640,6 @@ phy_init (void *user_data, phy_rx_fc_cb_t rx_fc_cb, phy_access_cb_t access_cb,
cyg_drv_interrupt_unmask (LEON_ITC2_HIGH_PRIORITY_ITC1_IT);
/* Activate clocks and release DSP reset. */
phy_init_dsp ();
- /* Check hardware compatibility. */
- if (!CONFIG_PHY_AES_ALWAYS_BYPASSED)
- /* No AES on MSE500 revision 1. */
- dbg_assert (arch_mse500_chip () != 1);
/* Initialise hardware. */
phy_clock_set_numerator (ctx, 1000000);
PHY_PRATIC_IMMEDIATE_ACTION = PHY_PRATIC_ACTION__INIT_TX;
@@ -726,6 +722,17 @@ phy_init (void *user_data, phy_rx_fc_cb_t rx_fc_cb, phy_access_cb_t access_cb,
return ctx;
}
+void
+phy_check_hardware (phy_t *ctx)
+{
+ dbg_assert (ctx);
+
+ /* Check hardware compatibility. */
+ if (!CONFIG_PHY_AES_ALWAYS_BYPASSED)
+ /* No AES on MSE500 revision 1. */
+ dbg_assert (arch_mse500_chip () != 1);
+}
+
static void
phy_set_robo_param (phy_t *ctx, u32 *tonemask, uint carrier_nb)
{
diff --git a/cesar/mac/ca/test/ca/src/phy_stub.c b/cesar/mac/ca/test/ca/src/phy_stub.c
index fe279800b0..d5626afcaa 100644
--- a/cesar/mac/ca/test/ca/src/phy_stub.c
+++ b/cesar/mac/ca/test/ca/src/phy_stub.c
@@ -29,6 +29,11 @@ phy_init (void *user_data, phy_rx_fc_cb_t rx_fc_cb, phy_access_cb_t access_cb,
}
void
+phy_check_hardware (phy_t *ctx)
+{
+}
+
+void
phy_uninit (phy_t *ctx)
{
dbg_assert (ctx);
diff --git a/cesar/mac/pbproc/pbproc.h b/cesar/mac/pbproc/pbproc.h
index 138a47c21e..48fa3d2543 100644
--- a/cesar/mac/pbproc/pbproc.h
+++ b/cesar/mac/pbproc/pbproc.h
@@ -215,6 +215,13 @@ pbproc_init_cb (pbproc_t *ctx, void *user_data, pbproc_rx_cb_t rx_cb,
pbproc_rx_beacon_cb_t rx_beacon_cb);
/**
+ * Check compatibility between software and hardware.
+ * \param ctx pbproc context
+ */
+void
+pbproc_check_hardware (pbproc_t *ctx);
+
+/**
* Uninitialise a pbproc context.
* \param ctx pbproc context
*/
diff --git a/cesar/mac/pbproc/src/pbproc.c b/cesar/mac/pbproc/src/pbproc.c
index 83e4af3fd3..167aadc38d 100644
--- a/cesar/mac/pbproc/src/pbproc.c
+++ b/cesar/mac/pbproc/src/pbproc.c
@@ -277,6 +277,14 @@ pbproc_init_cb (pbproc_t *ctx, void *user_data, pbproc_rx_cb_t rx_cb,
}
void
+pbproc_check_hardware (pbproc_t *ctx)
+{
+ dbg_assert (ctx);
+
+ phy_check_hardware (ctx->phy);
+}
+
+void
pbproc_uninit (pbproc_t *ctx)
{
dbg_assert (ctx);
diff --git a/cesar/mac/pbproc/test/pbproc/src/phy.c b/cesar/mac/pbproc/test/pbproc/src/phy.c
index 6cba39b19d..4a0de08755 100644
--- a/cesar/mac/pbproc/test/pbproc/src/phy.c
+++ b/cesar/mac/pbproc/test/pbproc/src/phy.c
@@ -49,6 +49,11 @@ phy_init (void *user_data, phy_rx_fc_cb_t rx_fc_cb, phy_access_cb_t access_cb,
}
void
+phy_check_hardware (phy_t *ctx)
+{
+}
+
+void
phy_uninit (phy_t *ctx)
{
}
diff --git a/cesar/station/src/station.c b/cesar/station/src/station.c
index 9c462b9edd..e3cbb1c6e2 100644
--- a/cesar/station/src/station.c
+++ b/cesar/station/src/station.c
@@ -118,6 +118,14 @@ cesar_init (void)
// start HLE...
ipmbox_activate(cesar.ipmbox, true);
+ /* As ipmbox is activated, assert can be collected by
+ * Linux. Start hardware check compatibility.
+ *
+ * In other words, previous asserts can't be
+ * collected by Linux.
+ * */
+ pbproc_check_hardware (cesar.pbproc);
+
init_exec (INIT_LIST_CE);
return &cesar;