]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge tag 'mvebu-fixes-3.15' of git://git.infradead.org/linux-mvebu into fixes
authorOlof Johansson <olof@lixom.net>
Mon, 5 May 2014 05:27:30 +0000 (22:27 -0700)
committerOlof Johansson <olof@lixom.net>
Mon, 5 May 2014 05:27:30 +0000 (22:27 -0700)
From Jason Cooper:
mvebu fixes for v3.15

 - devbus: fix bus-width conversion

 - orion5x: fix target ID for crypto SRAM window

* tag 'mvebu-fixes-3.15' of git://git.infradead.org/linux-mvebu:
  ARM: orion5x: fix target ID for crypto SRAM window
  memory: mvebu-devbus: fix the conversion of the bus width

Signed-off-by: Olof Johansson <olof@lixom.net>
arch/arm/mach-orion5x/common.h
drivers/memory/mvebu-devbus.c

index f565f9944af2ee45b795b180391853ffa8810a12..7548db2bfb8a7e595d7672c5cfbba3868651d689 100644 (file)
@@ -21,7 +21,7 @@ struct mv_sata_platform_data;
 #define ORION_MBUS_DEVBUS_BOOT_ATTR   0x0f
 #define ORION_MBUS_DEVBUS_TARGET(cs)  0x01
 #define ORION_MBUS_DEVBUS_ATTR(cs)    (~(1 << cs))
-#define ORION_MBUS_SRAM_TARGET        0x00
+#define ORION_MBUS_SRAM_TARGET        0x09
 #define ORION_MBUS_SRAM_ATTR          0x00
 
 /*
index 110c03627051cb749ef92d853e47322714b1dd51..b59a17fb7c3e3f3eff43faecac3610f58df1dbd8 100644 (file)
@@ -108,8 +108,19 @@ static int devbus_set_timing_params(struct devbus *devbus,
                        node->full_name);
                return err;
        }
-       /* Convert bit width to byte width */
-       r.bus_width /= 8;
+
+       /*
+        * The bus width is encoded into the register as 0 for 8 bits,
+        * and 1 for 16 bits, so we do the necessary conversion here.
+        */
+       if (r.bus_width == 8)
+               r.bus_width = 0;
+       else if (r.bus_width == 16)
+               r.bus_width = 1;
+       else {
+               dev_err(devbus->dev, "invalid bus width %d\n", r.bus_width);
+               return -EINVAL;
+       }
 
        err = get_timing_param_ps(devbus, node, "devbus,badr-skew-ps",
                                 &r.badr_skew);