summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/512x/mpc512x_shared.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-02-20 11:39:05 +1100
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-02-20 11:39:05 +1100
commitdffff02a6b10f25f879e1e523733770c0a492e76 (patch)
treea7f69af7963ece1afac5c76a902ce12dd5078294 /arch/powerpc/platforms/512x/mpc512x_shared.c
parent877d66856e9de4a6d1ffbf61bec6f830bde4d3bf (diff)
parentfa59f178552f927bd96771ba84e9706655bea705 (diff)
downloadop-kernel-dev-dffff02a6b10f25f879e1e523733770c0a492e76.zip
op-kernel-dev-dffff02a6b10f25f879e1e523733770c0a492e76.tar.gz
Merge remote-tracking branch 'agust/next' into next
<< Please pull mpc5xxx patches for v3.9. The bestcomm driver is moved to drivers/dma (so it will be usable for ColdFire). mpc5121 now provides common dtsi file and existing mpc5121 device trees use it. There are some minor clock init and sparse fixes and updates for various 5200 device tree files from Grant. Some fixes for bugs in the mpc5121 DIU driver are also included here (Andrew Morton suggested to push them via my mpc5xxx tree). >>
Diffstat (limited to 'arch/powerpc/platforms/512x/mpc512x_shared.c')
-rw-r--r--arch/powerpc/platforms/512x/mpc512x_shared.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c b/arch/powerpc/platforms/512x/mpc512x_shared.c
index c7f47cf..d30235b 100644
--- a/arch/powerpc/platforms/512x/mpc512x_shared.c
+++ b/arch/powerpc/platforms/512x/mpc512x_shared.c
@@ -426,8 +426,38 @@ void __init mpc512x_psc_fifo_init(void)
void __init mpc512x_init(void)
{
- mpc512x_declare_of_platform_devices();
mpc5121_clk_init();
+ mpc512x_declare_of_platform_devices();
mpc512x_restart_init();
mpc512x_psc_fifo_init();
}
+
+/**
+ * mpc512x_cs_config - Setup chip select configuration
+ * @cs: chip select number
+ * @val: chip select configuration value
+ *
+ * Perform chip select configuration for devices on LocalPlus Bus.
+ * Intended to dynamically reconfigure the chip select parameters
+ * for configurable devices on the bus.
+ */
+int mpc512x_cs_config(unsigned int cs, u32 val)
+{
+ static struct mpc512x_lpc __iomem *lpc;
+ struct device_node *np;
+
+ if (cs > 7)
+ return -EINVAL;
+
+ if (!lpc) {
+ np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-lpc");
+ lpc = of_iomap(np, 0);
+ of_node_put(np);
+ if (!lpc)
+ return -ENOMEM;
+ }
+
+ out_be32(&lpc->cs_cfg[cs], val);
+ return 0;
+}
+EXPORT_SYMBOL(mpc512x_cs_config);
OpenPOWER on IntegriCloud