21 #include <linux/kernel.h>
23 #include <linux/slab.h>
24 #include <linux/export.h>
25 #include <asm/debug.h>
37 for (par = of_node_get(node); par;) {
55 unsigned int cells,
size;
66 cells = prop ? *prop : 1;
73 if (index >= (size / (2*cells)))
76 reg = of_read_number(&prop[index * cells * 2], cells);
77 cnt = of_read_number(&prop[index * cells * 2 + cells], cells);
79 ret = scom_map(parent, reg, cnt);
86 #ifdef CONFIG_SCOM_DEBUGFS
87 struct scom_debug_entry {
98 struct scom_debug_entry *
ent =
data;
101 scom_unmap(ent->map);
103 ent->map = scom_map(ent->dn, val, 1);
104 if (scom_map_ok(ent->map))
112 static int scom_addr_get(
void *data,
u64 *val)
114 struct scom_debug_entry *ent =
data;
121 static int scom_val_set(
void *data,
u64 val)
123 struct scom_debug_entry *ent =
data;
125 if (!scom_map_ok(ent->map))
128 scom_write(ent->map, 0, val);
133 static int scom_val_get(
void *data,
u64 *val)
135 struct scom_debug_entry *ent =
data;
137 if (!scom_map_ok(ent->map))
140 *val = scom_read(ent->map, 0);
149 struct scom_debug_entry *ent;
156 ent->dn = of_node_get(dn);
157 ent->map = SCOM_MAP_INVALID;
159 snprintf(ent->name, 8,
"scom%d", i);
177 static int scom_debug_init(
void)
188 for_each_node_with_property(dn,
"scom-controller")
189 rc |= scom_debug_init_one(root, dn, i++);