Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+4 -15
+4 -15
drivers/soc/versatile/soc-realview.c
··· 31 31 32 32 static u32 realview_coreid; 33 33 34 - static 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 - 46 34 static const char *realview_arch_str(u32 id) 47 35 { 48 36 switch ((id >> 8) & 0xf) { ··· 57 69 struct device_attribute *attr, 58 70 char *buf) 59 71 { 60 - return sprintf(buf, "%s\n", realview_board_str(realview_coreid)); 72 + return sprintf(buf, "HBI-%03x\n", ((realview_coreid >> 16) & 0xfff)); 61 73 } 62 74 63 75 static struct device_attribute realview_board_attr = ··· 121 133 device_create_file(soc_device_to_device(soc_dev), &realview_arch_attr); 122 134 device_create_file(soc_device_to_device(soc_dev), &realview_build_attr); 123 135 124 - dev_info(&pdev->dev, "RealView Syscon Core ID: 0x%08x\n", 125 - realview_coreid); 136 + dev_info(&pdev->dev, "RealView Syscon Core ID: 0x%08x, HBI-%03x\n", 137 + realview_coreid, 138 + ((realview_coreid >> 16) & 0xfff)); 126 139 /* FIXME: add attributes for SoC to sysfs */ 127 140 return 0; 128 141 }