aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/85xx/sbc8548.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/85xx/sbc8548.c')
-rw-r--r--arch/powerpc/platforms/85xx/sbc8548.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/85xx/sbc8548.c b/arch/powerpc/platforms/85xx/sbc8548.c
index 488facb99fe8..b9246ea0928a 100644
--- a/arch/powerpc/platforms/85xx/sbc8548.c
+++ b/arch/powerpc/platforms/85xx/sbc8548.c
@@ -49,6 +49,8 @@
49#include <sysdev/fsl_soc.h> 49#include <sysdev/fsl_soc.h>
50#include <sysdev/fsl_pci.h> 50#include <sysdev/fsl_pci.h>
51 51
52static int sbc_rev;
53
52static void __init sbc8548_pic_init(void) 54static void __init sbc8548_pic_init(void)
53{ 55{
54 struct mpic *mpic; 56 struct mpic *mpic;
@@ -79,6 +81,30 @@ static void __init sbc8548_pic_init(void)
79 mpic_init(mpic); 81 mpic_init(mpic);
80} 82}
81 83
84/* Extract the HW Rev from the EPLD on the board */
85static int __init sbc8548_hw_rev(void)
86{
87 struct device_node *np;
88 struct resource res;
89 unsigned int *rev;
90 int board_rev = 0;
91
92 np = of_find_compatible_node(NULL, NULL, "hw-rev");
93 if (np == NULL) {
94 printk("No HW-REV found in DTB.\n");
95 return -ENODEV;
96 }
97
98 of_address_to_resource(np, 0, &res);
99 of_node_put(np);
100
101 rev = ioremap(res.start,sizeof(unsigned int));
102 board_rev = (*rev) >> 28;
103 iounmap(rev);
104
105 return board_rev;
106}
107
82/* 108/*
83 * Setup the architecture 109 * Setup the architecture
84 */ 110 */
@@ -104,6 +130,7 @@ static void __init sbc8548_setup_arch(void)
104 } 130 }
105 } 131 }
106#endif 132#endif
133 sbc_rev = sbc8548_hw_rev();
107} 134}
108 135
109static void sbc8548_show_cpuinfo(struct seq_file *m) 136static void sbc8548_show_cpuinfo(struct seq_file *m)
@@ -115,7 +142,7 @@ static void sbc8548_show_cpuinfo(struct seq_file *m)
115 svid = mfspr(SPRN_SVR); 142 svid = mfspr(SPRN_SVR);
116 143
117 seq_printf(m, "Vendor\t\t: Wind River\n"); 144 seq_printf(m, "Vendor\t\t: Wind River\n");
118 seq_printf(m, "Machine\t\t: SBC8548\n"); 145 seq_printf(m, "Machine\t\t: SBC8548 v%d\n", sbc_rev);
119 seq_printf(m, "PVR\t\t: 0x%x\n", pvid); 146 seq_printf(m, "PVR\t\t: 0x%x\n", pvid);
120 seq_printf(m, "SVR\t\t: 0x%x\n", svid); 147 seq_printf(m, "SVR\t\t: 0x%x\n", svid);
121 148
@@ -130,6 +157,7 @@ static void sbc8548_show_cpuinfo(struct seq_file *m)
130static struct of_device_id __initdata of_bus_ids[] = { 157static struct of_device_id __initdata of_bus_ids[] = {
131 { .name = "soc", }, 158 { .name = "soc", },
132 { .type = "soc", }, 159 { .type = "soc", },
160 { .compatible = "simple-bus", },
133 {}, 161 {},
134}; 162};
135 163