aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-orion5x/ts78xx-setup.c
diff options
context:
space:
mode:
authorAlexander Clouter <alex@digriz.org.uk>2011-03-05 06:49:36 -0500
committerNicolas Pitre <nico@fluxnic.net>2011-03-05 14:31:53 -0500
commitb3882330843650b751817712db57b9a7061e7879 (patch)
treef214ee378dabf403c59ebeec0650da1118b386f5 /arch/arm/mach-orion5x/ts78xx-setup.c
parentf9b1184e12e5ff8129b04837dffddb5a3c390473 (diff)
ARM: orion5x: use safer FPGA ID 'default' for TS-78xx
Originally the FPGA ID checking switch statement left disabled all the TS implemented FPGA devices if the ID was unknown to it. Michael Spang created a fix in f9b1184e that changed the default to enable the devices in the event TS silently release more revisions into the wild, this unfortunately breaks custom FPGA bitstreams. This patch amends the switch statement so that the TS devices are only enabled if on the revision number is unknown (whilst the magic matches). Changelog: v2: neater implementation and some cosmetic changes v1: initial release <20110305112937.GA22117@chipmunk> Signed-off-by: Alexander Clouter <alex@digriz.org.uk> Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Diffstat (limited to 'arch/arm/mach-orion5x/ts78xx-setup.c')
-rw-r--r--arch/arm/mach-orion5x/ts78xx-setup.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/arch/arm/mach-orion5x/ts78xx-setup.c b/arch/arm/mach-orion5x/ts78xx-setup.c
index 1cac714e982d..3f2e1cdf11f6 100644
--- a/arch/arm/mach-orion5x/ts78xx-setup.c
+++ b/arch/arm/mach-orion5x/ts78xx-setup.c
@@ -399,11 +399,20 @@ static void ts78xx_fpga_supports(void)
399 ts78xx_fpga.supports.ts_rng.present = 1; 399 ts78xx_fpga.supports.ts_rng.present = 1;
400 break; 400 break;
401 default: 401 default:
402 printk(KERN_WARNING "Unrecognized TS-78XX FPGA ID 0x%02x", 402 /* enable devices if magic matches */
403 ts78xx_fpga.id); 403 switch ((ts78xx_fpga.id >> 8) & 0xffffff) {
404 ts78xx_fpga.supports.ts_rtc.present = 1; 404 case TS7800_FPGA_MAGIC:
405 ts78xx_fpga.supports.ts_nand.present = 1; 405 printk(KERN_WARNING "TS-7800 FPGA: unrecognized revision 0x%.2x\n",
406 ts78xx_fpga.supports.ts_rng.present = 1; 406 ts78xx_fpga.id & 0xff);
407 ts78xx_fpga.supports.ts_rtc.present = 1;
408 ts78xx_fpga.supports.ts_nand.present = 1;
409 ts78xx_fpga.supports.ts_rng.present = 1;
410 break;
411 default:
412 ts78xx_fpga.supports.ts_rtc.present = 0;
413 ts78xx_fpga.supports.ts_nand.present = 0;
414 ts78xx_fpga.supports.ts_rng.present = 0;
415 }
407 } 416 }
408} 417}
409 418