]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
powerpc/83xx: Add eSDHC support for MPC837xE-RDB/WLAN boards
authorAnton Vorontsov <avorontsov@ru.mvista.com>
Fri, 24 Jul 2009 21:42:30 +0000 (01:42 +0400)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 20 Aug 2009 00:27:51 +0000 (10:27 +1000)
Actually, the support is already there, but it requires newer U-Boots
(to fill-in clock-frequency, and setup pin multiplexing).

Though, it appears that on RDB boards USBB pins aren't multiplexed
between USB and eSDHC (unlike MDS boards, where USB and eSDHC share
pctl and pwrfault pins).

So, for RDB boards we can safely setup pinmux and manually fill-in
clock-frequency, thus making eSDHC work even with older u-boots.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/boot/dts/mpc8377_rdb.dts
arch/powerpc/boot/dts/mpc8378_rdb.dts
arch/powerpc/boot/dts/mpc8379_rdb.dts
arch/powerpc/platforms/83xx/mpc837x_rdb.c
arch/powerpc/platforms/83xx/mpc83xx.h

index 4f06dbc0d27e8e96a454175c969c26a28f7be037..28e022ac41796fb83d057060d61c8728de4d238a 100644 (file)
                                interrupts = <42 0x8>;
                                interrupt-parent = <&ipic>;
                                /* Filled in by U-Boot */
-                               clock-frequency = <0>;
+                               clock-frequency = <111111111>;
                        };
                };
 
index aabf3437cadf6f38426c10cf672b3ca2e8ef5dc9..a11ead8214b4d699ef2e6e6740c19cbc08f4bb61 100644 (file)
                                interrupts = <42 0x8>;
                                interrupt-parent = <&ipic>;
                                /* Filled in by U-Boot */
-                               clock-frequency = <0>;
+                               clock-frequency = <111111111>;
                        };
                };
 
index 9b1da864d89043c0887fa6e69ace6a6c25b28b81..e35dfba587c8d33425d80eb940f0d63a3fe38ba2 100644 (file)
                                interrupts = <42 0x8>;
                                interrupt-parent = <&ipic>;
                                /* Filled in by U-Boot */
-                               clock-frequency = <0>;
+                               clock-frequency = <111111111>;
                        };
                };
 
index 91d19ab3a794b573af1fa6588f7d5968a646ec48..a1908d261240e07ca93d096418c24fe2e4ad0d76 100644 (file)
 #include <asm/time.h>
 #include <asm/ipic.h>
 #include <asm/udbg.h>
+#include <sysdev/fsl_soc.h>
 #include <sysdev/fsl_pci.h>
 
 #include "mpc83xx.h"
 
+static void mpc837x_rdb_sd_cfg(void)
+{
+       void __iomem *im;
+
+       im = ioremap(get_immrbase(), 0x1000);
+       if (!im) {
+               WARN_ON(1);
+               return;
+       }
+
+       /*
+        * On RDB boards (in contrast to MDS) USBB pins are used for SD only,
+        * so we can safely mux them away from the USB block.
+        */
+       clrsetbits_be32(im + MPC83XX_SICRL_OFFS, MPC837X_SICRL_USBB_MASK,
+                                                MPC837X_SICRL_SD);
+       clrsetbits_be32(im + MPC83XX_SICRH_OFFS, MPC837X_SICRH_SPI_MASK,
+                                                MPC837X_SICRH_SD);
+       iounmap(im);
+}
+
 /* ************************************************************************
  *
  * Setup the architecture
@@ -42,6 +64,7 @@ static void __init mpc837x_rdb_setup_arch(void)
                mpc83xx_add_bridge(np);
 #endif
        mpc837x_usb_cfg();
+       mpc837x_rdb_sd_cfg();
 }
 
 static struct of_device_id mpc837x_ids[] = {
index d1dc5b0b4fbfac991beb22578cb99cb559ae3238..0fea8811d45beb304bbf5d4163f6fd467940c521 100644 (file)
@@ -30,6 +30,8 @@
 #define MPC8315_SICRL_USB_ULPI     0x00000054
 #define MPC837X_SICRL_USB_MASK     0xf0000000
 #define MPC837X_SICRL_USB_ULPI     0x50000000
+#define MPC837X_SICRL_USBB_MASK    0x30000000
+#define MPC837X_SICRL_SD           0x20000000
 
 /* system i/o configuration register high */
 #define MPC83XX_SICRH_OFFS         0x118
@@ -38,6 +40,8 @@
 #define MPC831X_SICRH_USB_ULPI     0x000000a0
 #define MPC8315_SICRH_USB_MASK     0x0000ff00
 #define MPC8315_SICRH_USB_ULPI     0x00000000
+#define MPC837X_SICRH_SPI_MASK     0x00000003
+#define MPC837X_SICRH_SD           0x00000001
 
 /* USB Control Register */
 #define FSL_USB2_CONTROL_OFFS      0x500