]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
sh: fix cf support on r2d boards
authorMagnus Damm <damm@igel.co.jp>
Fri, 3 Aug 2007 01:16:29 +0000 (10:16 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Fri, 3 Aug 2007 01:16:29 +0000 (10:16 +0900)
This patch makes sure cf support is enabled on R2D-PLUS but disabled
on R2D-1. Without this fix R2D-1 boards hang on bootup.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/boards/renesas/rts7751r2d/setup.c
include/asm-sh/rts7751r2d.h

index e165d85c03b5543050d721bd98ef2b5c7b4f9166..6f7029d33241db4beeb46395968c24b81e0403e0 100644 (file)
@@ -140,12 +140,19 @@ static struct platform_device sm501_device = {
 static struct platform_device *rts7751r2d_devices[] __initdata = {
        &uart_device,
        &heartbeat_device,
-       &cf_ide_device,
        &sm501_device,
 };
 
 static int __init rts7751r2d_devices_setup(void)
 {
+       int ret;
+
+       if (ctrl_inw(PA_BVERREG) == 0x10) { /* only working on R2D-PLUS */
+               ret = platform_device_register(&cf_ide_device);
+               if (ret)
+                       return ret;
+       }
+
        return platform_add_devices(rts7751r2d_devices,
                                    ARRAY_SIZE(rts7751r2d_devices));
 }
index 10565ac7966a4f7c5c43ccd534501f60ee3c9f1f..5d7800aa31b514df1954f128481569549388c622 100644 (file)
@@ -37,7 +37,7 @@
 #define PA_VERREG      0xa4000032      /* FPGA Version Register */
 #define PA_INPORT      0xa4000034      /* KEY Input Port control */
 #define PA_OUTPORT     0xa4000036      /* LED control */
-#define PA_DMPORT      0xa4000038      /* DM270 Output Port control */
+#define PA_BVERREG     0xa4000038      /* Board Revision Register */
 
 #define PA_AX88796L    0xaa000400      /* AX88796L Area */
 #define PA_VOYAGER     0xab000000      /* VOYAGER GX Area */