aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2016-02-18 08:21:54 -0500
committerLinus Walleij <linus.walleij@linaro.org>2016-04-04 04:58:47 -0400
commitfccc2b3675371e4077d7aa7f23d116e97dcdcd07 (patch)
tree243f7c21c9ab0586c93bbeb3a43bc1850d0e97fe
parent9735a22799b9214d17d3c231fe377fc852f042e9 (diff)
soc: versatile: dynamically detect RealView HBI numbers
We cannot pile all numbers on this list, just print the three hex digits representing the board ID so we can handle all the new RealView boards. Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/soc/versatile/soc-realview.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/drivers/soc/versatile/soc-realview.c b/drivers/soc/versatile/soc-realview.c
index c337764de867..282e371378ce 100644
--- a/drivers/soc/versatile/soc-realview.c
+++ b/drivers/soc/versatile/soc-realview.c
@@ -31,18 +31,6 @@ static const struct of_device_id realview_soc_of_match[] = {
31 31
32static u32 realview_coreid; 32static u32 realview_coreid;
33 33
34static const char *realview_board_str(u32 id)
35{
36 switch ((id >> 16) & 0xfff) {
37 case 0x0147:
38 return "HBI-0147";
39 case 0x0159:
40 return "HBI-0159";
41 default:
42 return "Unknown";
43 }
44}
45
46static const char *realview_arch_str(u32 id) 34static const char *realview_arch_str(u32 id)
47{ 35{
48 switch ((id >> 8) & 0xf) { 36 switch ((id >> 8) & 0xf) {
@@ -69,7 +57,7 @@ static ssize_t realview_get_board(struct device *dev,
69 struct device_attribute *attr, 57 struct device_attribute *attr,
70 char *buf) 58 char *buf)
71{ 59{
72 return sprintf(buf, "%s\n", realview_board_str(realview_coreid)); 60 return sprintf(buf, "HBI-%03x\n", ((realview_coreid >> 16) & 0xfff));
73} 61}
74 62
75static struct device_attribute realview_board_attr = 63static struct device_attribute realview_board_attr =
@@ -133,8 +121,9 @@ static int realview_soc_probe(struct platform_device *pdev)
133 device_create_file(soc_device_to_device(soc_dev), &realview_arch_attr); 121 device_create_file(soc_device_to_device(soc_dev), &realview_arch_attr);
134 device_create_file(soc_device_to_device(soc_dev), &realview_build_attr); 122 device_create_file(soc_device_to_device(soc_dev), &realview_build_attr);
135 123
136 dev_info(&pdev->dev, "RealView Syscon Core ID: 0x%08x\n", 124 dev_info(&pdev->dev, "RealView Syscon Core ID: 0x%08x, HBI-%03x\n",
137 realview_coreid); 125 realview_coreid,
126 ((realview_coreid >> 16) & 0xfff));
138 /* FIXME: add attributes for SoC to sysfs */ 127 /* FIXME: add attributes for SoC to sysfs */
139 return 0; 128 return 0;
140} 129}