summaryrefslogtreecommitdiffstats
path: root/utils/regtools/qeditor/backend.h
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-08-21 20:16:26 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-08-21 20:18:37 +0200
commitc323381f0b3ee68b0093442335e8e7cbb112858a (patch)
treeac27964bd0da6bc56f05ad965ce4de957ef22d59 /utils/regtools/qeditor/backend.h
parent902306378e38ce571f4595ae8dabb2acd2412faa (diff)
downloadrockbox-c323381f0b3ee68b0093442335e8e7cbb112858a.tar.gz
rockbox-c323381f0b3ee68b0093442335e8e7cbb112858a.tar.bz2
rockbox-c323381f0b3ee68b0093442335e8e7cbb112858a.zip
regtools: add graphical register explorer + analyser
This tool allows one to explore any register map. Register dumps (like produced by hwstub tools) can be loaded and decoded by the tool. Finally some analysers are provided for specific soc analysis like clock tree and emi on imx233 for example. Change-Id: Iaf81bd52d15f3e44ab4fe9bc039153fcf60cf92a
Diffstat (limited to 'utils/regtools/qeditor/backend.h')
-rw-r--r--utils/regtools/qeditor/backend.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/utils/regtools/qeditor/backend.h b/utils/regtools/qeditor/backend.h
new file mode 100644
index 0000000000..536eb8cec5
--- /dev/null
+++ b/utils/regtools/qeditor/backend.h
@@ -0,0 +1,77 @@
+#ifndef __BACKEND_H__
+#define __BACKEND_H__
+
+#include <QObject>
+#include <QStringList>
+#include <QMap>
+#include "soc_desc.hpp"
+
+class IoBackend : public QObject
+{
+ Q_OBJECT
+public:
+ IoBackend();
+
+ virtual QString GetSocName() = 0;
+ virtual bool ReadRegister(const QString& name, soc_word_t& value) = 0;
+ virtual bool Reload() = 0;
+};
+
+class DummyIoBackend : public IoBackend
+{
+ Q_OBJECT
+public:
+ DummyIoBackend();
+
+ virtual QString GetSocName();
+ virtual bool ReadRegister(const QString& name, soc_word_t& value);
+ virtual bool Reload();
+};
+
+class FileIoBackend : public IoBackend
+{
+ Q_OBJECT
+public:
+ FileIoBackend(const QString& filename);
+
+ virtual QString GetSocName();
+ virtual bool ReadRegister(const QString& name, soc_word_t& value);
+ virtual bool Reload();
+
+protected:
+ QString m_filename;
+ QString m_soc;
+ QMap< QString, soc_word_t > m_map;
+};
+
+class Backend : public QObject
+{
+ Q_OBJECT
+public:
+ Backend();
+
+ QStringList GetSocNameList();
+ bool LoadSocDesc(const QString& filename);
+ bool GetSocByName(const QString& name, soc_t& s);
+ IoBackend *CreateDummyIoBackend();
+ IoBackend *CreateFileIoBackend(const QString& filename);
+
+signals:
+ void OnSocListChanged();
+private:
+ std::vector< soc_t > m_socs;
+};
+
+class BackendHelper
+{
+public:
+ BackendHelper(IoBackend *io_backend, const soc_t& soc);
+ bool ReadRegister(const QString& dev, const QString& reg, soc_word_t& v);
+ bool ReadRegisterField(const QString& dev, const QString& reg,
+ const QString& field, soc_word_t& v);
+private:
+ IoBackend *m_io_backend;
+ soc_t m_soc;
+};
+
+#endif /* __BACKEND_H__ */