aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bcma
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/bcma')
-rw-r--r--drivers/bcma/scan.c54
1 files changed, 40 insertions, 14 deletions
diff --git a/drivers/bcma/scan.c b/drivers/bcma/scan.c
index f94cccccfa56..e19e987bc9e1 100644
--- a/drivers/bcma/scan.c
+++ b/drivers/bcma/scan.c
@@ -19,7 +19,14 @@ struct bcma_device_id_name {
19 u16 id; 19 u16 id;
20 const char *name; 20 const char *name;
21}; 21};
22struct bcma_device_id_name bcma_device_names[] = { 22
23static const struct bcma_device_id_name bcma_arm_device_names[] = {
24 { BCMA_CORE_ARM_1176, "ARM 1176" },
25 { BCMA_CORE_ARM_7TDMI, "ARM 7TDMI" },
26 { BCMA_CORE_ARM_CM3, "ARM CM3" },
27};
28
29static const struct bcma_device_id_name bcma_bcm_device_names[] = {
23 { BCMA_CORE_OOB_ROUTER, "OOB Router" }, 30 { BCMA_CORE_OOB_ROUTER, "OOB Router" },
24 { BCMA_CORE_INVALID, "Invalid" }, 31 { BCMA_CORE_INVALID, "Invalid" },
25 { BCMA_CORE_CHIPCOMMON, "ChipCommon" }, 32 { BCMA_CORE_CHIPCOMMON, "ChipCommon" },
@@ -27,7 +34,6 @@ struct bcma_device_id_name bcma_device_names[] = {
27 { BCMA_CORE_SRAM, "SRAM" }, 34 { BCMA_CORE_SRAM, "SRAM" },
28 { BCMA_CORE_SDRAM, "SDRAM" }, 35 { BCMA_CORE_SDRAM, "SDRAM" },
29 { BCMA_CORE_PCI, "PCI" }, 36 { BCMA_CORE_PCI, "PCI" },
30 { BCMA_CORE_MIPS, "MIPS" },
31 { BCMA_CORE_ETHERNET, "Fast Ethernet" }, 37 { BCMA_CORE_ETHERNET, "Fast Ethernet" },
32 { BCMA_CORE_V90, "V90" }, 38 { BCMA_CORE_V90, "V90" },
33 { BCMA_CORE_USB11_HOSTDEV, "USB 1.1 Hostdev" }, 39 { BCMA_CORE_USB11_HOSTDEV, "USB 1.1 Hostdev" },
@@ -44,7 +50,6 @@ struct bcma_device_id_name bcma_device_names[] = {
44 { BCMA_CORE_PHY_A, "PHY A" }, 50 { BCMA_CORE_PHY_A, "PHY A" },
45 { BCMA_CORE_PHY_B, "PHY B" }, 51 { BCMA_CORE_PHY_B, "PHY B" },
46 { BCMA_CORE_PHY_G, "PHY G" }, 52 { BCMA_CORE_PHY_G, "PHY G" },
47 { BCMA_CORE_MIPS_3302, "MIPS 3302" },
48 { BCMA_CORE_USB11_HOST, "USB 1.1 Host" }, 53 { BCMA_CORE_USB11_HOST, "USB 1.1 Host" },
49 { BCMA_CORE_USB11_DEV, "USB 1.1 Device" }, 54 { BCMA_CORE_USB11_DEV, "USB 1.1 Device" },
50 { BCMA_CORE_USB20_HOST, "USB 2.0 Host" }, 55 { BCMA_CORE_USB20_HOST, "USB 2.0 Host" },
@@ -58,15 +63,11 @@ struct bcma_device_id_name bcma_device_names[] = {
58 { BCMA_CORE_PHY_N, "PHY N" }, 63 { BCMA_CORE_PHY_N, "PHY N" },
59 { BCMA_CORE_SRAM_CTL, "SRAM Controller" }, 64 { BCMA_CORE_SRAM_CTL, "SRAM Controller" },
60 { BCMA_CORE_MINI_MACPHY, "Mini MACPHY" }, 65 { BCMA_CORE_MINI_MACPHY, "Mini MACPHY" },
61 { BCMA_CORE_ARM_1176, "ARM 1176" },
62 { BCMA_CORE_ARM_7TDMI, "ARM 7TDMI" },
63 { BCMA_CORE_PHY_LP, "PHY LP" }, 66 { BCMA_CORE_PHY_LP, "PHY LP" },
64 { BCMA_CORE_PMU, "PMU" }, 67 { BCMA_CORE_PMU, "PMU" },
65 { BCMA_CORE_PHY_SSN, "PHY SSN" }, 68 { BCMA_CORE_PHY_SSN, "PHY SSN" },
66 { BCMA_CORE_SDIO_DEV, "SDIO Device" }, 69 { BCMA_CORE_SDIO_DEV, "SDIO Device" },
67 { BCMA_CORE_ARM_CM3, "ARM CM3" },
68 { BCMA_CORE_PHY_HT, "PHY HT" }, 70 { BCMA_CORE_PHY_HT, "PHY HT" },
69 { BCMA_CORE_MIPS_74K, "MIPS 74K" },
70 { BCMA_CORE_MAC_GBIT, "GBit MAC" }, 71 { BCMA_CORE_MAC_GBIT, "GBit MAC" },
71 { BCMA_CORE_DDR12_MEM_CTL, "DDR1/DDR2 Memory Controller" }, 72 { BCMA_CORE_DDR12_MEM_CTL, "DDR1/DDR2 Memory Controller" },
72 { BCMA_CORE_PCIE_RC, "PCIe Root Complex" }, 73 { BCMA_CORE_PCIE_RC, "PCIe Root Complex" },
@@ -79,16 +80,41 @@ struct bcma_device_id_name bcma_device_names[] = {
79 { BCMA_CORE_SHIM, "SHIM" }, 80 { BCMA_CORE_SHIM, "SHIM" },
80 { BCMA_CORE_DEFAULT, "Default" }, 81 { BCMA_CORE_DEFAULT, "Default" },
81}; 82};
82const char *bcma_device_name(struct bcma_device_id *id) 83
84static const struct bcma_device_id_name bcma_mips_device_names[] = {
85 { BCMA_CORE_MIPS, "MIPS" },
86 { BCMA_CORE_MIPS_3302, "MIPS 3302" },
87 { BCMA_CORE_MIPS_74K, "MIPS 74K" },
88};
89
90static const char *bcma_device_name(const struct bcma_device_id *id)
83{ 91{
84 int i; 92 const struct bcma_device_id_name *names;
93 int size, i;
94
95 /* search manufacturer specific names */
96 switch (id->manuf) {
97 case BCMA_MANUF_ARM:
98 names = bcma_arm_device_names;
99 size = ARRAY_SIZE(bcma_arm_device_names);
100 break;
101 case BCMA_MANUF_BCM:
102 names = bcma_bcm_device_names;
103 size = ARRAY_SIZE(bcma_bcm_device_names);
104 break;
105 case BCMA_MANUF_MIPS:
106 names = bcma_mips_device_names;
107 size = ARRAY_SIZE(bcma_mips_device_names);
108 break;
109 default:
110 return "UNKNOWN";
111 }
85 112
86 if (id->manuf == BCMA_MANUF_BCM) { 113 for (i = 0; i < size; i++) {
87 for (i = 0; i < ARRAY_SIZE(bcma_device_names); i++) { 114 if (names[i].id == id->id)
88 if (bcma_device_names[i].id == id->id) 115 return names[i].name;
89 return bcma_device_names[i].name;
90 }
91 } 116 }
117
92 return "UNKNOWN"; 118 return "UNKNOWN";
93} 119}
94 120