Skip to contentSkip to conversation

Linuxppc-dev Digest, Vol 57, Issue 42

DISCUSSION Hongjun Chen 1 participant 1 message May 18, 2009 1 message not in the archive

Subsystems (6)
lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Why should you reinvent wheel for MPC512x DMA driver? We have a ready DMA driver, which has been used by MPC5121 AC97, VIU, ATA etc.

B.R,
Hongjun Chen
2009-05-18

发件人: [email protected]
发送时间: 2009-05-07 04:38:43
收件人: [email protected]
抄送:
主题: Linuxppc-dev Digest, Vol 57, Issue 42

Send Linuxppc-dev mailing list submissions to
[email protected]

To subscribe or unsubscribe via the World Wide Web, visit
https://ozlabs.org/mailman/listinfo/linuxppc-dev
or, via email, send a message with subject or body 'help' to [email protected]

You can reach the person managing the list at
[email protected]

When replying, please edit your Subject line so it is more specific than "Re: Contents of Linuxppc-dev digest..."

Today's Topics:

1. [PATCH 08/12] mpc5121: Added I2C support. (Wolfgang Denk)
2. [PATCH 05/12] mpc5121ads: Added Reset Module node to DTS. (Wolfgang Denk)
3. [PATCH 10/12] mpc5121: Add MPC5121 Real time clock driver. (Wolfgang Denk)
4. [PATCH 11/12] mpc5121: Added MPC512x DMA driver. (Wolfgang Denk)

----------------------------------------------------------------------

Message: 1
Date: Wed, 6 May 2009 22:15:15 +0200
From: Wolfgang Denk <[email protected] >
Subject: [PATCH 08/12] mpc5121: Added I2C support.
To: [email protected]
Cc: [email protected], Piotr Ziecik <[email protected] >, Wolfgang Denk <[email protected] >
Message-ID: <[email protected] >

From: Piotr Ziecik <[email protected] >

- Enabled I2C interrupts on MPC5121.
- Updated Kconfig for i2c-mpc driver.

---
 arch/powerpc/platforms/512x/mpc5121_ads.c    |    2 ++
 arch/powerpc/platforms/512x/mpc512x.h        |    1 +
 arch/powerpc/platforms/512x/mpc512x_shared.c |   24 ++++++++++++++++++++++++
 drivers/i2c/busses/Kconfig                   |    9 +++++----
 4 files changed, 32 insertions(+), 4 deletions(-)
arch/powerpc/platforms/512x/mpc5121_ads.c +2 -0
index 441abc4..a8976b4 100644
@@ -42,6 +42,8 @@ static void __init mpc5121_ads_setup_arch(void)
  for_each_compatible_node(np, "pci", "fsl,mpc5121-pci")
  mpc83xx_add_bridge(np);
 #endif
+
+ mpc512x_init_i2c();
 }
 
 static void __init mpc5121_ads_init_IRQ(void)
arch/powerpc/platforms/512x/mpc512x.h +1 -0
index 9c03693..f4db8a7 100644
@@ -13,5 +13,6 @@
 #define __MPC512X_H__
 extern unsigned long mpc512x_find_ips_freq(struct device_node *node);
 extern void __init mpc512x_init_IRQ(void);
+extern void __init mpc512x_init_i2c(void);
 void __init mpc512x_declare_of_platform_devices(void);
 #endif /* __MPC512X_H__ */
arch/powerpc/platforms/512x/mpc512x_shared.c +24 -0
index 7135d89..b776e45 100644
@@ -65,6 +65,30 @@ void __init mpc512x_init_IRQ(void)
  ipic_set_default_priority();
 }
 
+void __init mpc512x_init_i2c(void)
+{
+ struct device_node *np;
+ void __iomem *i2cctl;
+
+ /* Enable I2C interrupts */
+ np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-i2c-ctrl");
+ if (np) {
+ i2cctl = of_iomap(np, 0);
+ if (i2cctl) {
+ /*
+  * Set interrupt enable bits:
+  *  - I2C-0: bit 24,
+  *  - I2C-1: bit 26,
+  *  - I2C-2: bit 28.
+  */
+ out_be32(i2cctl, 0x15000000);
+ iounmap(i2cctl);
+ }
+
+ of_node_put(np);
+ }
+}
+
 /*
  * Nodes to do bus probe on, soc and localbus
  */
drivers/i2c/busses/Kconfig +5 -4
index a48c8ae..57ed637 100644
@@ -391,13 +391,14 @@ config I2C_IXP2000
    instead.
 
 config I2C_MPC
- tristate "MPC107/824x/85xx/52xx/86xx"
+ tristate "MPC107/824x/85xx/512x/52xx/86xx"
  depends on PPC32
  help
    If you say yes to this option, support will be included for the
-   built-in I2C interface on the MPC107/Tsi107/MPC8240/MPC8245 and
-   MPC85xx/MPC8641 family processors. The driver may also work on 52xx
-   family processors, though interrupts are known not to work.
+   built-in I2C interface on the MPC107/Tsi107/MPC8240/MPC8245,
+   MPC85xx/MPC8641 and MPC512x family processors. The driver may
+   also work on 52xx family processors, though interrupts are known
+   not to work.
 
    This driver can also be built as a module.  If so, the module
    will be called i2c-mpc.
Signature · 23 lines
1.6.0.6



------------------------------

Message: 2
Date: Wed,  6 May 2009 22:15:12 +0200
From: Wolfgang Denk  <[email protected] >
Subject: [PATCH 05/12] mpc5121ads: Added Reset Module node to DTS.
To: [email protected]
Cc: Piotr Ziecik  <[email protected] >, Wolfgang Denk  <[email protected] >
Message-ID:  <[email protected] >

From: Piotr Ziecik  <[email protected] >

Signed-off-by: Piotr Ziecik  <[email protected] >
Signed-off-by: Wolfgang Denk  <[email protected] >
Cc: Grant Likely  <[email protected] >
Cc: John Rigby  <[email protected] >
---
 arch/powerpc/boot/dts/mpc5121ads.dts |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
arch/powerpc/boot/dts/mpc5121ads.dts +5 -0
index c2b8dbf..1b83a9d 100644
@@ -166,6 +166,11 @@
  interrupt-parent =  < &ipic  >;
  };
 
+ reset@e00 { // Reset module
+ compatible = "fsl,mpc5121-reset";
+ reg =  <0xe00 0x100 >;
+ };
+
  clock@f00 { // Clock control
  compatible = "fsl,mpc5121-clock";
  reg =  <0xf00 0x100 >;
Signature · 51 lines
1.6.0.6



------------------------------

Message: 3
Date: Wed,  6 May 2009 22:15:17 +0200
From: Wolfgang Denk  <[email protected] >
Subject: [PATCH 10/12] mpc5121: Add MPC5121 Real time clock driver.
To: [email protected]
Cc: Piotr Ziecik  <[email protected] >, [email protected],
John Rigby  <[email protected] >, Wolfgang Denk  <[email protected] >
Message-ID:  <[email protected] >

From: John Rigby  <[email protected] >

Based on Domen Puncer's rtc driver for 5200 posted to
the ppclinux mailing list:
http://patchwork.ozlabs.org/linuxppc-embedded/patch?id=11675
but never commited anywhere.

Changes to Domen's original:

    Changed filenames/routine names from mpc5200* to mpc5121*
    Changed match to only care about compatible and use "fsl,"
    convention for compatible.

    Make alarms more sane by dealing with lack of second alarm resolution.

    Deal with the fact that most of the 5121 rtc registers are not persistent
    across a reset even with a battery attached:

Use actual_time register for time keeping
and target_time register as an offset to linux time

The target_time register would normally be used for hibernation
but hibernation does not work on current silicon

Signed-off-by: John Rigby  <[email protected] >
Signed-off-by: Piotr Ziecik  <[email protected] >
Signed-off-by: Wolfgang Denk  <[email protected] >
Cc:  <[email protected] >
Cc: Grant Likely  <[email protected] >
Cc: John Rigby  <[email protected] >
---
 drivers/rtc/Kconfig       |   10 +
 drivers/rtc/Makefile      |    1 +
 drivers/rtc/rtc-mpc5121.c |  408 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 419 insertions(+), 0 deletions(-)
 create mode 100644 drivers/rtc/rtc-mpc5121.c
drivers/rtc/Kconfig +10 -0
index 4e9851f..900d5b8 100644
@@ -750,4 +750,14 @@ config RTC_DRV_PS3
    This driver can also be built as a module. If so, the module
    will be called rtc-ps3.
 
+config RTC_DRV_MPC5121
+ tristate "Freescale MPC5121 built-in RTC"
+ depends on RTC_CLASS
+ help
+   If you say yes here you will get support for the
+   built-in RTC MPC5121.
+
+   This driver can also be built as a module. If so, the module
+   will be called rtc-mpc5121.
+
 endif # RTC_CLASS
drivers/rtc/Makefile +1 -0
index 6c0639a..8c6d6a7 100644
@@ -51,6 +51,7 @@ obj-$(CONFIG_RTC_DRV_STARFIRE) += rtc-starfire.o
 obj-$(CONFIG_RTC_DRV_MAX6900) += rtc-max6900.o
 obj-$(CONFIG_RTC_DRV_MAX6902) += rtc-max6902.o
 obj-$(CONFIG_RTC_DRV_MV) += rtc-mv.o
+obj-$(CONFIG_RTC_DRV_MPC5121) += rtc-mpc5121.o
 obj-$(CONFIG_RTC_DRV_OMAP) += rtc-omap.o
 obj-$(CONFIG_RTC_DRV_PCF8563) += rtc-pcf8563.o
 obj-$(CONFIG_RTC_DRV_PCF8583) += rtc-pcf8583.o
drivers/rtc/rtc-mpc5121.c new file +408 -0

408 lines not on this page · raw message

Signature · 33 lines
1.6.0.6



------------------------------

Message: 4
Date: Wed,  6 May 2009 22:15:18 +0200
From: Wolfgang Denk  <[email protected] >
Subject: [PATCH 11/12] mpc5121: Added MPC512x DMA driver.
To: [email protected]
Cc: Piotr Ziecik  <[email protected] >, Wolfgang Denk  <[email protected] >
Message-ID:  <[email protected] >

From: Piotr Ziecik  <[email protected] >

This patch adds initial version of MPC512x DMA driver.
Only memory to memory transfers are currenly supported.

Signed-off-by: Piotr Ziecik  <[email protected] >
Signed-off-by: Wolfgang Denk  <[email protected] >
Cc: Grant Likely  <[email protected] >
Cc: John Rigby  <[email protected] >
---
 arch/powerpc/boot/dts/mpc5121ads.dts         |    2 +-
 arch/powerpc/platforms/512x/mpc512x_shared.c |    1 +
 drivers/dma/Kconfig                          |    7 +
 drivers/dma/Makefile                         |    1 +
 drivers/dma/mpc512x_dma.c                    |  642 ++++++++++++++++++++++++++
 drivers/dma/mpc512x_dma.h                    |  192 ++++++++
 6 files changed, 844 insertions(+), 1 deletions(-)
 create mode 100644 drivers/dma/mpc512x_dma.c
 create mode 100644 drivers/dma/mpc512x_dma.h
arch/powerpc/boot/dts/mpc5121ads.dts +1 -1
index c2d9de9..e7f0e09 100644
@@ -373,7 +373,7 @@
  };
 
  dma@14000 {
- compatible = "fsl,mpc5121-dma2";
+ compatible = "fsl,mpc512x-dma";
  reg =  <0x14000 0x1800 >;
  interrupts =  <65 0x8 >;
  interrupt-parent =  < &ipic  >;
arch/powerpc/platforms/512x/mpc512x_shared.c +1 -0
index b776e45..135fd6b 100644
@@ -95,6 +95,7 @@ void __init mpc512x_init_i2c(void)
 static struct of_device_id __initdata of_bus_ids[] = {
  { .compatible = "fsl,mpc5121-immr", },
  { .compatible = "fsl,mpc5121-localbus", },
+ { .compatible = "fsl,mpc5121-dma", },
  { .compatible = "fsl,mpc5121-nfc", },
  {},
 };
drivers/dma/Kconfig +7 -0
index 3b3c01b..e734a7a 100644
@@ -55,6 +55,13 @@ config FSL_DMA
    The Elo is the DMA controller on some 82xx and 83xx parts, and the
    Elo Plus is the DMA controller on 85xx and 86xx parts.
 
+config MPC512X_DMA
+ tristate "Freescale MPC512x built-in DMA engine support"
+ depends on PPC_MPC512x
+ select DMA_ENGINE
+ ---help---
+   Enable support for the Freescale MPC512x built-in DMA engine.
+
 config MV_XOR
  bool "Marvell XOR engine support"
  depends on PLAT_ORION
drivers/dma/Makefile +1 -0
index 2e5dc96..f02806c 100644
@@ -5,6 +5,7 @@ obj-$(CONFIG_INTEL_IOATDMA) += ioatdma.o
 ioatdma-objs := ioat.o ioat_dma.o ioat_dca.o
 obj-$(CONFIG_INTEL_IOP_ADMA) += iop-adma.o
 obj-$(CONFIG_FSL_DMA) += fsldma.o
+obj-$(CONFIG_MPC512X_DMA) += mpc512x_dma.o
 obj-$(CONFIG_MV_XOR) += mv_xor.o
 obj-$(CONFIG_DW_DMAC) += dw_dmac.o
 obj-$(CONFIG_MX3_IPU) += ipu/
drivers/dma/mpc512x_dma.c new file +642 -0

642 lines not on this page · raw message

drivers/dma/mpc512x_dma.h new file +192 -0

192 lines not on this page · raw message

Signature · 13 lines
1.6.0.6



------------------------------

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev

End of Linuxppc-dev Digest, Vol 57, Issue 42
********************************************