summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorEvan Lojewski <github@meklort.com>2019-04-03 18:36:07 -0600
committerEvan Lojewski <github@meklort.com>2019-04-03 18:36:07 -0600
commitd864aaff9a2a58e3e180824389cff21f38669186 (patch)
treeeb095d9945a6d43cbee7618a8e6ac62b36428197 /libs
parentc588cad2f7b451ca24e0482fa9164308905332a0 (diff)
downloadbcm5719-ortega-d864aaff9a2a58e3e180824389cff21f38669186.tar.gz
bcm5719-ortega-d864aaff9a2a58e3e180824389cff21f38669186.zip
Regenerate headers + simulation code to allow arbitrary read/writes from the base component.
Diffstat (limited to 'libs')
-rw-r--r--libs/MII/include/bcm5719_MII.h12
-rw-r--r--libs/NVRam/bcm5719_NVM.h12
2 files changed, 24 insertions, 0 deletions
diff --git a/libs/MII/include/bcm5719_MII.h b/libs/MII/include/bcm5719_MII.h
index 1aa8581..50f6535 100644
--- a/libs/MII/include/bcm5719_MII.h
+++ b/libs/MII/include/bcm5719_MII.h
@@ -4240,6 +4240,18 @@ typedef struct {
/** @brief Note: Shadow Register Selector: 7 */
RegMIIMiscellaneousControl_t MiscellaneousControl;
+#ifdef CXX_SIMULATOR
+ typedef uint32_t (*read_callback_t)(uint32_t, void*);
+ read_callback_t mIndexReadCallback;
+ void* mIndexReadCallbackArgs;
+
+ typedef void (*write_callback_t)(uint32_t, uint32_t value, void*);
+ write_callback_t mIndexWriteCallback;
+ void* mIndexWriteCallbackArgs;
+
+ uint32_t read(int index) { return mIndexReadCallback(index, mIndexReadCallbackArgs); }
+ void write(int index, uint32_t value) { mIndexWriteCallback(index, value, mIndexWriteCallbackArgs); }
+#endif /* CXX_SIMULATOR */
} MII_t;
/** @brief MII Registers */
diff --git a/libs/NVRam/bcm5719_NVM.h b/libs/NVRam/bcm5719_NVM.h
index c74cb9a..664ea55 100644
--- a/libs/NVRam/bcm5719_NVM.h
+++ b/libs/NVRam/bcm5719_NVM.h
@@ -941,6 +941,18 @@ typedef struct {
/** @brief */
RegNVMAutoSenseStatus_t AutoSenseStatus;
+#ifdef CXX_SIMULATOR
+ typedef uint32_t (*read_callback_t)(uint32_t, void*);
+ read_callback_t mIndexReadCallback;
+ void* mIndexReadCallbackArgs;
+
+ typedef void (*write_callback_t)(uint32_t, uint32_t value, void*);
+ write_callback_t mIndexWriteCallback;
+ void* mIndexWriteCallbackArgs;
+
+ uint32_t read(int index) { return mIndexReadCallback(index, mIndexReadCallbackArgs); }
+ void write(int index, uint32_t value) { mIndexWriteCallback(index, value, mIndexWriteCallbackArgs); }
+#endif /* CXX_SIMULATOR */
} NVM_t;
/** @brief Non-Volatile Memory Registers */
OpenPOWER on IntegriCloud