aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/fmc/fmc-sdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/fmc/fmc-sdb.c')
-rw-r--r--drivers/fmc/fmc-sdb.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/drivers/fmc/fmc-sdb.c b/drivers/fmc/fmc-sdb.c
index 69f42d70bc74..4603fdb74465 100644
--- a/drivers/fmc/fmc-sdb.c
+++ b/drivers/fmc/fmc-sdb.c
@@ -150,11 +150,27 @@ int fmc_reprogram(struct fmc_device *fmc, struct fmc_driver *d, char *gw,
150} 150}
151EXPORT_SYMBOL(fmc_reprogram); 151EXPORT_SYMBOL(fmc_reprogram);
152 152
153static char *__strip_trailing_space(char *buf, char *str, int len)
154{
155 int i = len - 1;
156
157 memcpy(buf, str, len);
158 while(i >= 0 && buf[i] == ' ')
159 buf[i--] = '\0';
160 return buf;
161}
162
163#define __sdb_string(buf, field) ({ \
164 BUILD_BUG_ON(sizeof(buf) < sizeof(field)); \
165 __strip_trailing_space(buf, (void *)(field), sizeof(field)); \
166 })
167
153static void __fmc_show_sdb_tree(const struct fmc_device *fmc, 168static void __fmc_show_sdb_tree(const struct fmc_device *fmc,
154 const struct sdb_array *arr) 169 const struct sdb_array *arr)
155{ 170{
156 unsigned long base = arr->baseaddr; 171 unsigned long base = arr->baseaddr;
157 int i, j, n = arr->len, level = arr->level; 172 int i, j, n = arr->len, level = arr->level;
173 char buf[64];
158 174
159 for (i = 0; i < n; i++) { 175 for (i = 0; i < n; i++) {
160 union sdb_record *r; 176 union sdb_record *r;
@@ -190,8 +206,8 @@ static void __fmc_show_sdb_tree(const struct fmc_device *fmc,
190 p->name, 206 p->name,
191 __be64_to_cpu(c->addr_first) + base); 207 __be64_to_cpu(c->addr_first) + base);
192 if (IS_ERR(arr->subtree[i])) { 208 if (IS_ERR(arr->subtree[i])) {
193 printk(KERN_CONT "(bridge error %li)\n", 209 dev_info(&fmc->dev, "SDB: (bridge error %li)\n",
194 PTR_ERR(arr->subtree[i])); 210 PTR_ERR(arr->subtree[i]));
195 break; 211 break;
196 } 212 }
197 __fmc_show_sdb_tree(fmc, arr->subtree[i]); 213 __fmc_show_sdb_tree(fmc, arr->subtree[i]);
@@ -200,10 +216,20 @@ static void __fmc_show_sdb_tree(const struct fmc_device *fmc,
200 printk(KERN_CONT "integration\n"); 216 printk(KERN_CONT "integration\n");
201 break; 217 break;
202 case sdb_type_repo_url: 218 case sdb_type_repo_url:
203 printk(KERN_CONT "repo-url\n"); 219 printk(KERN_CONT "Synthesis repository: %s\n",
220 __sdb_string(buf, r->repo_url.repo_url));
204 break; 221 break;
205 case sdb_type_synthesis: 222 case sdb_type_synthesis:
206 printk(KERN_CONT "synthesis-info\n"); 223 printk(KERN_CONT "Bitstream '%s' ",
224 __sdb_string(buf, r->synthesis.syn_name));
225 printk(KERN_CONT "synthesized %08x by %s ",
226 __be32_to_cpu(r->synthesis.date),
227 __sdb_string(buf, r->synthesis.user_name));
228 printk(KERN_CONT "(%s version %x), ",
229 __sdb_string(buf, r->synthesis.tool_name),
230 __be32_to_cpu(r->synthesis.tool_version));
231 printk(KERN_CONT "commit %pm\n",
232 r->synthesis.commit_id);
207 break; 233 break;
208 case sdb_type_empty: 234 case sdb_type_empty:
209 printk(KERN_CONT "empty\n"); 235 printk(KERN_CONT "empty\n");