summaryrefslogtreecommitdiff
path: root/utils/imxtools/regtools/desc_parser.hpp
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-06-12 19:49:26 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-06-12 19:49:26 +0200
commit7143ea681c377fe5901bd79801366a26ae0d394a (patch)
tree34fdaaa83590130b57b187878a89394505950b82 /utils/imxtools/regtools/desc_parser.hpp
parent11da9d23fe323ce452fcd04a10a0ddf78eaa63ea (diff)
downloadrockbox-7143ea681c377fe5901bd79801366a26ae0d394a.tar.gz
rockbox-7143ea681c377fe5901bd79801366a26ae0d394a.zip
imxtools: move regtools to its own directory
The register tools are in no way stmp specific. The XML description of the registers is powerful enough to describe the STMP register which should be more than enough to describe virtually all other SoCs. The generators follow the STMP coding convention but others could be used as well. Change-Id: If1a9f56e4a3594161688de34adbea698e5aaecd8
Diffstat (limited to 'utils/imxtools/regtools/desc_parser.hpp')
-rw-r--r--utils/imxtools/regtools/desc_parser.hpp108
1 files changed, 0 insertions, 108 deletions
diff --git a/utils/imxtools/regtools/desc_parser.hpp b/utils/imxtools/regtools/desc_parser.hpp
deleted file mode 100644
index 908cff8940..0000000000
--- a/utils/imxtools/regtools/desc_parser.hpp
+++ /dev/null
@@ -1,108 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Amaury Pouly
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#ifndef __DESC_PARSER__
22#define __DESC_PARSER__
23
24#include <stdint.h>
25#include <vector>
26#include <string>
27
28typedef uint32_t soc_addr_t;
29typedef uint32_t soc_word_t;
30typedef uint32_t soc_reg_flags_t;
31
32const soc_addr_t SOC_NO_ADDR = 0xffffffff;
33const soc_reg_flags_t REG_HAS_SCT = 1 << 0;
34
35struct soc_reg_field_value_t
36{
37 std::string name;
38 soc_word_t value;
39};
40
41struct soc_reg_field_t
42{
43 std::string name;
44 unsigned first_bit, last_bit;
45
46 soc_word_t bitmask() const
47 {
48 return ((1 << (last_bit - first_bit + 1)) - 1) << first_bit;
49 }
50
51 std::vector< soc_reg_field_value_t > values;
52};
53
54struct soc_reg_t
55{
56 std::string name;
57 soc_addr_t addr;
58 soc_reg_flags_t flags;
59
60 std::vector< soc_reg_field_t > fields;
61};
62
63struct soc_multireg_t
64{
65 std::string name;
66 soc_addr_t base;
67 unsigned count;
68 soc_addr_t offset;
69 soc_reg_flags_t flags;
70
71 std::vector< soc_reg_t > regs;
72 std::vector< soc_reg_field_t > fields;
73};
74
75struct soc_dev_t
76{
77 std::string name;
78 std::string long_name;
79 std::string desc;
80 soc_addr_t addr;
81
82 std::vector< soc_multireg_t > multiregs;
83 std::vector< soc_reg_t > regs;
84};
85
86struct soc_multidev_t
87{
88 std::string name;
89 std::string long_name;
90 std::string desc;
91
92 std::vector< soc_dev_t > devs;
93 std::vector< soc_multireg_t > multiregs;
94 std::vector< soc_reg_t > regs;
95};
96
97struct soc_t
98{
99 std::string name;
100 std::string desc;
101
102 std::vector< soc_dev_t > devs;
103 std::vector< soc_multidev_t > multidevs;
104};
105
106bool parse_soc_desc(const std::string& filename, std::vector< soc_t >& soc);
107
108#endif /* __DESC_PARSER__ */ \ No newline at end of file