summaryrefslogtreecommitdiff
path: root/arch/powerpc/platforms/85xx/sbc8548.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-05-15 18:28:46 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-05-15 18:28:46 -0700
commitf26a3988917913b3d11b2bd741601a2c64ab9204 (patch)
tree69b3da12c23ebe30a4ed0563648eb1bca5e83185 /arch/powerpc/platforms/85xx/sbc8548.c
parentac0e9c30b1cb22c01f3edbb94857de2bae7611ca (diff)
parentfaa5b9daa8bd8a18b5b1f3a8dd79261503f7cdd3 (diff)
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: [POWERPC] macintosh: Replace deprecated __initcall with device_initcall [POWERPC] cell: Fix section mismatches in io-workarounds code [POWERPC] spufs: Fix compile error [POWERPC] Fix uninitialized variable bug in copy_{to|from}_user [POWERPC] Add null pointer check to of_find_property [POWERPC] vmemmap fixes to use smaller pages [POWERPC] spufs: Fix pointer reference in find_victim [POWERPC] 85xx: SBC8548 - Add flash support and HW Rev reporting [POWERPC] 85xx: Fix some sparse warnings for 85xx MDS [POWERPC] 83xx: Enable DMA engine on the MPC8377 MDS board. [POWERPC] 86xx: mpc8610_hpcd: fix second serial port [POWERPC] 86xx: mpc8610_hpcd: add support for NOR and NAND flashes [POWERPC] 85xx: Add 8568 PHY workarounds to board code [POWERPC] 86xx: mpc8610_hpcd: use ULI526X driver for on-board ethernet
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 @@
#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
+static int sbc_rev;
+
static void __init sbc8548_pic_init(void)
{
struct mpic *mpic;
@@ -79,6 +81,30 @@ static void __init sbc8548_pic_init(void)
mpic_init(mpic);
}
+/* Extract the HW Rev from the EPLD on the board */
+static int __init sbc8548_hw_rev(void)
+{
+ struct device_node *np;
+ struct resource res;
+ unsigned int *rev;
+ int board_rev = 0;
+
+ np = of_find_compatible_node(NULL, NULL, "hw-rev");
+ if (np == NULL) {
+ printk("No HW-REV found in DTB.\n");
+ return -ENODEV;
+ }
+
+ of_address_to_resource(np, 0, &res);
+ of_node_put(np);
+
+ rev = ioremap(res.start,sizeof(unsigned int));
+ board_rev = (*rev) >> 28;
+ iounmap(rev);
+
+ return board_rev;
+}
+
/*
* Setup the architecture
*/
@@ -104,6 +130,7 @@ static void __init sbc8548_setup_arch(void)
}
}
#endif
+ sbc_rev = sbc8548_hw_rev();
}
static void sbc8548_show_cpuinfo(struct seq_file *m)
@@ -115,7 +142,7 @@ static void sbc8548_show_cpuinfo(struct seq_file *m)
svid = mfspr(SPRN_SVR);
seq_printf(m, "Vendor\t\t: Wind River\n");
- seq_printf(m, "Machine\t\t: SBC8548\n");
+ seq_printf(m, "Machine\t\t: SBC8548 v%d\n", sbc_rev);
seq_printf(m, "PVR\t\t: 0x%x\n", pvid);
seq_printf(m, "SVR\t\t: 0x%x\n", svid);
@@ -130,6 +157,7 @@ static void sbc8548_show_cpuinfo(struct seq_file *m)
static struct of_device_id __initdata of_bus_ids[] = {
{ .name = "soc", },
{ .type = "soc", },
+ { .compatible = "simple-bus", },
{},
};