summaryrefslogtreecommitdiffstats
path: root/utils/regtools/lib
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2014-04-04 15:33:39 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2014-05-01 19:32:01 +0200
commit3754624edc48539c5cc5acbf426ce909477e87d8 (patch)
tree5b74dd28aa33186dcba9557c1ab516fc6e39d0db /utils/regtools/lib
parent0cd03c2d201b5b17d9465470cedccab3d4c5edd0 (diff)
downloadrockbox-3754624edc48539c5cc5acbf426ce909477e87d8.tar.gz
rockbox-3754624edc48539c5cc5acbf426ce909477e87d8.tar.bz2
rockbox-3754624edc48539c5cc5acbf426ce909477e87d8.zip
regtools: update soc desc parser/header to include desc fields
Change-Id: I32374784d17f4352905f15e404df23b01338235b
Diffstat (limited to 'utils/regtools/lib')
-rw-r--r--utils/regtools/lib/soc_desc.cpp4
-rw-r--r--utils/regtools/lib/soc_desc.hpp19
2 files changed, 16 insertions, 7 deletions
diff --git a/utils/regtools/lib/soc_desc.cpp b/utils/regtools/lib/soc_desc.cpp
index 21c2f8acac..6a6d47648f 100644
--- a/utils/regtools/lib/soc_desc.cpp
+++ b/utils/regtools/lib/soc_desc.cpp
@@ -147,6 +147,7 @@ bool parse_field_elem(xmlNode *node, soc_reg_field_t& field)
BEGIN_ATTR_MATCH(node->properties)
MATCH_TEXT_ATTR("name", field.name)
MATCH_BITRANGE_ATTR("bitrange", field.first_bit, field.last_bit)
+ MATCH_TEXT_ATTR("desc", field.desc)
END_ATTR_MATCH()
BEGIN_NODE_MATCH(node->children)
@@ -194,6 +195,7 @@ bool parse_reg_elem(xmlNode *node, soc_reg_t& reg)
MATCH_TEXT_ATTR("name", reg.name)
SOFT_MATCH_SCT_ATTR("sct", reg.flags)
SOFT_MATCH_X_ATTR("addr", parse_add_trivial_addr, reg)
+ MATCH_TEXT_ATTR("desc", reg.desc)
END_ATTR_MATCH()
BEGIN_NODE_MATCH(node->children)
@@ -227,6 +229,8 @@ bool parse_dev_elem(xmlNode *node, soc_dev_t& dev)
{
BEGIN_ATTR_MATCH(node->properties)
MATCH_TEXT_ATTR("name", dev.name)
+ MATCH_TEXT_ATTR("long_name", dev.long_name)
+ MATCH_TEXT_ATTR("desc", dev.desc)
MATCH_TEXT_ATTR("version", dev.version)
END_ATTR_MATCH()
diff --git a/utils/regtools/lib/soc_desc.hpp b/utils/regtools/lib/soc_desc.hpp
index 0324a90fad..efaf813eb2 100644
--- a/utils/regtools/lib/soc_desc.hpp
+++ b/utils/regtools/lib/soc_desc.hpp
@@ -63,15 +63,17 @@ const soc_reg_flags_t REG_HAS_SCT = 1 << 0; /// register SCT variants
/** SoC register field named value */
struct soc_reg_field_value_t
{
- std::string name;
- soc_word_t value;
+ std::string name; /// name of the value
+ soc_word_t value; /// numeric value
+ std::string desc; /// human description
};
/** SoC register field */
struct soc_reg_field_t
{
- std::string name;
- unsigned first_bit, last_bit;
+ std::string name; /// name of the field
+ std::string desc; /// human description
+ unsigned first_bit, last_bit; /// bit range of the field
soc_word_t bitmask() const
{
@@ -94,7 +96,7 @@ struct soc_reg_field_t
struct soc_reg_addr_t
{
std::string name; /// actual register name
- soc_addr_t addr;
+ soc_addr_t addr; /// actual register address (relative to device)
};
/** SoC register formula */
@@ -108,8 +110,9 @@ struct soc_reg_formula_t
struct soc_reg_t
{
std::string name; /// generic name (for multi registers) or actual name
- std::vector< soc_reg_addr_t > addr;
- soc_reg_formula_t formula;
+ std::string desc; /// human description
+ std::vector< soc_reg_addr_t > addr; /// instances of the registers
+ soc_reg_formula_t formula; /// formula for the instance addresses
soc_reg_flags_t flags; /// ORed value
std::vector< soc_reg_field_t > field;
@@ -126,6 +129,8 @@ struct soc_dev_addr_t
struct soc_dev_t
{
std::string name; /// generic name (of multi devices) or actual name
+ std::string long_name; /// human friendly name
+ std::string desc; /// human description
std::string version; /// description version
std::vector< soc_dev_addr_t > addr;