Add support for MPC512x
Subsystems (10)
cover Add support for MPC512x
The following patch series brings support for the Freescale MPC512x processsors up to date:
[PATCH 01/12] fs_enet: Use defines to set driver tunables.
Cc: <[email protected]>
[PATCH 02/12] fs_enet: Add MPC5121 FEC support.
Cc: <[email protected]>
[PATCH 03/12] fs_enet: Add FEC TX Alignment workaround for MPC5121.
Cc: <[email protected]>
[PATCH 04/12] mpc5121: Added reset module registers representation. [PATCH 05/12] mpc5121ads: Added Reset Module node to DTS.
[PATCH 06/12] mpc5121: Added NAND Flash Controller driver.
Cc: <[email protected]>
[PATCH 07/12] mpc5121ads: Clean up and fix NAND description in mpc5121ads DTS. [PATCH 08/12] mpc5121: Added I2C support.
Cc: <[email protected]>
[PATCH 09/12] mpc5121ads: Added I2C RTC node to mpc5121ads DTS. [PATCH 10/12] mpc5121: Add MPC5121 Real time clock driver.
Cc: <[email protected]>
[PATCH 11/12] mpc5121: Added MPC512x DMA driver. [PATCH 12/12] mpc5121: Added default config for MPC5121.
The patches are based on v2.6.30-rc4 and cover the following items:
- platform, DTS
- DMA
- FEC Ethernet
- UART (without h/w flow control)
- I2C
- NAND
- RTC
The code has been tested on the Freescale/STX "MPC5121ADS" board (board rev. 4) with a MPC5121e Rev. 2. No attempt was made to provide backward compatibility to older silicon revisions or older revisions of the board.
The work for this project has been approved as OSADL project by a majority of OSADL members and funded by OSADL membership fees in 2009; for details please see www.osadl.org.
---
Summary statistics:
arch/powerpc/boot/dts/aria.dts | 410 ++++++ arch/powerpc/boot/dts/mpc5121ads.dts | 25 +- arch/powerpc/configs/512x/aria_defconfig | 1789 ++++++++++++++++++++++++ arch/powerpc/configs/512x/mpc5121ads_defconfig | 1190 ++++++++++++++++ arch/powerpc/configs/mpc5121_defconfig | 1158 +++++++++++++++ arch/powerpc/include/asm/mpc5121_fec.h | 111 ++ arch/powerpc/include/asm/mpc5121_nfc.h | 100 ++ arch/powerpc/include/asm/mpc512x.h | 13 + arch/powerpc/platforms/512x/Kconfig | 9 + arch/powerpc/platforms/512x/Makefile | 1 + arch/powerpc/platforms/512x/aria.c | 73 + arch/powerpc/platforms/512x/mpc5121_ads.c | 2 + arch/powerpc/platforms/512x/mpc5121_generic.c | 1 + arch/powerpc/platforms/512x/mpc512x.h | 1 + arch/powerpc/platforms/512x/mpc512x_shared.c | 26 + drivers/dma/Kconfig | 7 + drivers/dma/Makefile | 1 + drivers/dma/mpc512x_dma.c | 642 +++++++++ drivers/dma/mpc512x_dma.h | 192 +++ drivers/i2c/busses/Kconfig | 9 +- drivers/mtd/nand/Kconfig | 7 + drivers/mtd/nand/Makefile | 1 + drivers/mtd/nand/mpc5121_nfc.c | 855 +++++++++++ drivers/net/fs_enet/Kconfig | 13 +- drivers/net/fs_enet/fs_enet-main.c | 67 +- drivers/net/fs_enet/fs_enet.h | 6 + drivers/net/fs_enet/mac-fec.c | 30 +- drivers/net/fs_enet/mii-fec.c | 13 +- drivers/rtc/Kconfig | 10 + drivers/rtc/Makefile | 1 + drivers/rtc/rtc-mpc5121.c | 408 ++++++ 31 files changed, 7146 insertions(+), 25 deletions(-)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 8/12 mpc5121: Added I2C support.
From: Piotr Ziecik <kosmo-nYOzD4b6Jr9Wk0Htik3J/[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
@@ -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
@@ -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
@@ -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
@@ -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 · 1 line
1.6.0.6
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH 08/12] mpc5121: Added I2C support.
Quoted 4 lines · Wolfgang Denk
From: Piotr Ziecik <kosmo-nYOzD4b6Jr9Wk0Htik3J/[email protected]>
- Enabled I2C interrupts on MPC5121.
- UpdatedKconfigfor i2c-mpc driver.
I think this workaround belongs in the driver itself.
g.
Quoted 99 lines
Signed-off-by Wolfgang Denk <[email protected]>Cc <[email protected]>Cc Grant Likely <grant.likely-s3s/[email protected]>Cc John Rigby <[email protected]>---
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@@ -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@@ -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@@ -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 +0
-0@@ -391,13 +391,14 @@ config I2C_IXP2000instead.
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.
--
1.6.0.6
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
A message that is not in the archive (sent off-list or not yet received): fa686aa40905061401k319313c5q89fd3e245c30808f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Re: [PATCH 08/12] mpc5121: Added I2C support.
Dear Grant Likely,
Quoted 7 lines · In message <fa686aa40905061401k319313c5q89fd3e245c30808f-JsoAwUIsXosN+BqQ9rBEUg…
Quoted 4 lines · Wolfgang Denk
From: Piotr Ziecik <kosmo-nYOzD4b6Jr9Wk0Htik3J/[email protected]>
- Enabled I2C interrupts on MPC5121.
- UpdatedKconfigfor i2c-mpc driver.I think this workaround belongs in the driver itself.
Sorry, I don't get it. Which workaround? What exactly should I change?
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected] Time is an illusion perpetrated by the manufacturers of space.
Re: [PATCH 08/12] mpc5121: Added I2C support.
Quoted 4 lines · Wolfgang Denk
Dear Grant Likely,
Quoted 1 line · In message <[email protected]> you…
On Wed, May 6, 2009 at 2:15 PM, Wolfgang Denk <[email protected]> wrote:
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
From: Piotr Ziecik <[email protected]>
- Enabled I2C interrupts on MPC5121.
- UpdatedKconfigfor i2c-mpc driver.I think this workaround belongs in the driver itself.
Sorry, I don't get it. Which workaround? What exactly should I change?
Sorry, I misread the patch. Never mind.
g.
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
A message that is not in the archive (sent off-list or not yet received): fa686aa40905061551l8cf5940sf4d4cbf34331cf9a-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Re: [PATCH 08/12] mpc5121: Added I2C support.
Quoted 7 lines · Grant Likely
Quoted 6 lines · Wolfgang Denk
Dear Grant Likely,
Quoted 3 lines · In message <fa686aa40905061401k319313c5q89fd3e245c30808f-JsoAwUIsXotQFR93xxRIaA…
Quoted 2 lines · Wolfgang Denk
From: Piotr Ziecik <kosmo-nYOzD4b6Jr9Wk0Htik3J/[email protected]>
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
- Enabled I2C interrupts on MPC5121.
- UpdatedKconfigfor i2c-mpc driver.I think this workaround belongs in the driver itself.
Sorry, I don't get it. Which workaround? What exactly should I change?
Sorry, I misread the patch. Never mind.
Actually, on 3rd reading, I think my first impression was correct (even if I was wrong about it being a workaround). This code in mpc512x_init_i2c() is only relevant for i2c busses (it isn't shared with any other drivers). Therefore, it belongs with the i2c bus itself. It does not belong in platform code.
Cheers,
g.
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
A message that is not in the archive (sent off-list or not yet received): fa686aa40905061941p6fd4b03dt1097cf4d16bdd665-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Re: [PATCH 08/12] mpc5121: Added I2C support.
Quoted 11 lines · Grant Likely
Quoted 10 lines · Grant Likely
Quoted 9 lines · Wolfgang Denk
Dear Grant Likely,
Quoted 6 lines · In message <fa686aa40905061401k319313c5q89fd3e245c30808f-JsoAwUIsXosN+BqQ9rBEUg…
Quoted 4 lines · Wolfgang Denk
From: Piotr Ziecik <kosmo-nYOzD4b6Jr9Wk0Htik3J/[email protected]>
- Enabled I2C interrupts on MPC5121.
- UpdatedKconfigfor i2c-mpc driver.I think this workaround belongs in the driver itself.
Quoted 8 lines
Quoted 2 lines
Quoted 1 line
Sorry, I don't get it. Which workaround? What exactly should I change?
Sorry, I misread the patch. Never mind.
Actually, on 3rd reading, I think my first impression was correct (even if I was wrong about it being a workaround). This code in
mpc512x_init_i2c()is only relevant for i2c busses (it isn't shared with any other drivers). Therefore, it belongs with the i2c bus itself. It does not belong in platform code.
Right. Furthermore, the i2c-mpc.c should be extened to support bus speed setting for the MPC512x, which has been merged recently (see commit id f2bd5efe).
Wolfgang.
Re: [PATCH 08/12] mpc5121: Added I2C support.
Quoted 3 lines
Right. Furthermore, the
i2c-mpc.cshould be extened to support bus speed setting for the MPC512x, which has been merged recently (see commit idf2bd5efe).
I have simple question about bus speed setting support. Existing implementation uses default safe speed if there is no 'clock-frequency' property in i2c node. Comments in code suggest that this behaviour is left for backward compatibility only. Should I make the 'clock-frequency' property mandatory for a new type of I2C controller (MPC5121) ?
Signature · 2 lines
Best Regards. Piotr Zięcik
Re: [PATCH 08/12] mpc5121: Added I2C support.
2009/5/18 Piotr Zięcik <[email protected]>:
Quoted 9 lines
Quoted 3 lines
Right. Furthermore, the
i2c-mpc.cshould be extened to support bus speed setting for the MPC512x, which has been merged recently (see commit idf2bd5efe).I have simple question about bus speed setting support. Existing implementation uses default safe speed if there is no 'clock-frequency' property in i2c node. Comments in code suggest that this behaviour is left for backward compatibility only. Should I make the 'clock-frequency' property mandatory for a new type of I2C controller (MPC5121) ?
yes. At least in documentation, but I wouldn't do extra work to disable that behaviour for 5121 boards.
g.
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
A message that is not in the archive (sent off-list or not yet received): 200905181557.11766.kosmo-nYOzD4b6Jr9Wk0Htik3J/[email protected]
Re: [PATCH 08/12] mpc5121: Added I2C support.
Quoted 9 lines · Piotr Zięcik
Quoted 3 lines
Right. Furthermore, the
i2c-mpc.cshould be extened to support bus speed setting for the MPC512x, which has been merged recently (see commit idf2bd5efe).I have simple question about bus speed setting support. Existing implementation uses default safe speed if there is no 'clock-frequency' property in i2c node. Comments in code suggest that this behaviour is left for backward compatibility only. Should I make the 'clock-frequency' property mandatory for a new type of I2C controller (MPC5121) ?
I don't think so, for the same backward compatibility reason as for the other boards. But the DTS file might be changed to use clock-frequency. BTW, when I wrote the code I already had the MPC512x in mind. IIRC, the FDR table and the function scanning it for the MPC52xx should work for the MPC512x as well. It's mainly a matter of using the proper function to get the source clock frequency and fiddling with multiple-arch support.
Wolfgang.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH 08/12] mpc5121: Added I2C support.
Monday 18 May 2009 16:29:04 Wolfgang Grandegger napisał(a):
Quoted 8 lines
Quoted 5 lines
I have simple question about bus speed setting support. Existing implementation uses default safe speed if there is no 'clock-frequency' property in i2c node. Comments in code suggest that this behaviour is left for backward compatibility only. Should I make the 'clock-frequency' property mandatory for a new type of I2C controller (MPC5121) ?
I don't think so, for the same backward compatibility reason as for the other boards. But the DTS file might be changed to use clock-frequency.
In my opinion implementing "backward compatilility" for MPC5121 is not good idea. MPC5121 I2C support is completly new thing in mainline. Simply, there is no DTS with which I have to be compatible. Adding backward compatibility with nothing may be confusing.
Signature · 2 lines
Best Regards, Piotr Zięcik
Re: [PATCH 08/12] mpc5121: Added I2C support.
Quoted 6 lines · Piotr Zięcik
Monday 18 May 2009 16:29:04 Wolfgang Grandegger napisał(a):
Quoted 5 lines
Quoted 5 lines
I have simple question about bus speed setting support. Existing implementation uses default safe speed if there is no 'clock-frequency' property in i2c node. Comments in code suggest that this behaviour is left for backward compatibility only. Should I make the 'clock-frequency' property mandatory for a new type of I2C controller (MPC5121) ?
Quoted 7 lines
Quoted 2 lines
I don't think so, for the same backward compatibility reason as for the other boards. But the DTS file might be changed to use clock-frequency.
In my opinion implementing "backward compatilility" for MPC5121 is not good idea. MPC5121 I2C support is completly new thing in mainline. Simply, there is no DTS with which I have to be compatible. Adding backward compatibility with nothing may be confusing.
There is a port for the MPC5121 in mainline since 2.6.25 including DTS file:
http://lxr.linux.no/linux+v2.6.25/arch/powerpc/boot/dts/mpc5121ads.dts
If it was really usable or even used is another question. But it's fine for me be more restrictive, e.g. print a warning when save values are selected.
Wolfgang.
Re: [PATCH 08/12] mpc5121: Added I2C support.
In reply to Grant LikelyOk, the interrupt enabling should happen in the driver. Should it key off compatible or should a new property be added like the existing 5200 clocking property?
Quoted 25 lines · Grant Likely
Quoted 4 lines · Grant Likely
Quoted 3 lines · Wolfgang Denk
Dear Grant Likely,
In message <[email protected]>
Quoted 11 lines · you
Quoted 9 lines
Quoted 7 lines · Wolfgang Denk
Quoted 4 lines
From: Piotr Ziecik <[email protected]>
- Enabled I2C interrupts on MPC5121.
- UpdatedKconfigfor i2c-mpc driver.I think this workaround belongs in the driver itself.
Sorry, I don't get it. Which workaround? What exactly should I change?
Sorry, I misread the patch. Never mind.
Actually, on 3rd reading, I think my first impression was correct (even if I was wrong about it being a workaround). This code in
mpc512x_init_i2c()is only relevant for i2c busses (it isn't shared with any other drivers). Therefore, it belongs with the i2c bus itself. It does not belong in platform code.
Quoted 7 lines
Cheers,
g.--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH 08/12] mpc5121: Added I2C support.
Quoted 3 lines · John Rigby
Ok, the interrupt enabling should happen in the driver. Should it key off compatible or should a new property be added like the existing 5200 clocking property?
key off compatible. And the 5200 clocking property has been depreciated.
g.
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
PATCH 1/12 fs_enet: Use defines to set driver tunables.
In reply to Wolfgang DenkFrom: Piotr Ziecik <[email protected]>
--- drivers/net/fs_enet/fs_enet-main.c | 19 ++++++++++++++----- 1 files changed, 14 insertions(+), 5 deletions(-)
drivers/net/fs_enet/fs_enet-main.c +14 -5
@@ -46,6 +46,15 @@#include "fs_enet.h" +/* Driver tunables */ + +#define ENET_RX_RING_SIZE 32 +#define ENET_TX_RING_SIZE 32 +#define ENET_RX_COPYBREAK 240 + +#define ENET_USE_NAPI 1 +#define ENET_NAPI_WEIGHT 17 +/*************************************************/ MODULE_AUTHOR ("Pantelis Antoniou <[email protected]>" );
@@ -1057,11 +1066,11 @@ static int __devinit fs_enet_probe(struct of_device *ofdev, fpi->cp_command = *data; } - fpi->rx_ring =32 ; - fpi->tx_ring =32 ; - fpi->rx_copybreak =240 ; - fpi->use_napi =1 ; - fpi->napi_weight =17 ; + fpi->rx_ring =ENET_RX_RING_SIZE ; + fpi->tx_ring =ENET_TX_RING_SIZE ; + fpi->rx_copybreak =ENET_RX_COPYBREAK ; + fpi->use_napi =ENET_USE_NAPI ; + fpi->napi_weight =ENET_NAPI_WEIGHT ; ret =find_phy (ofdev->node, fpi);if (ret)
Signature · 1 line
1.6.0.6
Re: [PATCH 01/12] fs_enet: Use defines to set driver tunables.
Quoted 7 lines · Wolfgang Denk
From: Piotr Ziecik <[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]>
Not seeing much benefit to this patch, and the (non-existant) patch description doesn't really help me here either.
g.
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
Re: [PATCH 01/12] fs_enet: Use defines to set driver tunables.
Dear Grant,
Quoted 11 lines · In message <[email protected]> you…
Quoted 7 lines · Wolfgang Denk
From: Piotr Ziecik <[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]>Not seeing much benefit to this patch, and the (non-existant) patch description doesn't really help me here either.
Please see next patch which then uses the ability to change the defaults.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected] Program maintenance is an entropy-increasing process, and even its most skilfull execution only delays the subsidence of the system into unfixable obsolescence. - Fred Brooks, "The Mythical Man Month"
Re: [PATCH 01/12] fs_enet: Use defines to set driver tunables.
Quoted 12 lines · Wolfgang Denk
Dear Grant,
Quoted 9 lines · In message <[email protected]> you…
Quoted 7 lines · Wolfgang Denk
From: Piotr Ziecik <[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]>
Quoted 5 lines
Quoted 2 lines
Not seeing much benefit to this patch, and the (non-existant) patch description doesn't really help me here either.
Please see next patch which then uses the ability to change the defaults.
Please state that in the patch description when you repost it. :-P
g.
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
PATCH 2/12 fs_enet: Add MPC5121 FEC support.
In reply to Wolfgang DenkFrom: John Rigby <[email protected]>
Add support for MPC512x to fs_enet driver
drivers/net/fs_enet/*
Enable fs_enet driver to work 5121 FEC
Enable it with CONFIG_FS_ENET_MPC5121_FEC
--- arch/powerpc/include/asm/mpc5121_fec.h | 111 ++++++++++++++++++++++++++++++++ drivers/net/fs_enet/Kconfig | 10 ++- drivers/net/fs_enet/fs_enet-main.c | 7 ++ drivers/net/fs_enet/fs_enet.h | 6 ++ drivers/net/fs_enet/mac-fec.c | 30 ++++++++- drivers/net/fs_enet/mii-fec.c | 7 ++ 6 files changed, 166 insertions(+), 5 deletions(-) create mode 100644 arch/powerpc/include/asm/mpc5121_fec.h
arch/powerpc/include/asm/mpc5121_fec.h new file +111 -0
@@ -0,0 +1,111 @@ +/* +* Copyright (C) 2007,2008 Freescale Semiconductor, Inc. All rights reserved. +* +* Author: John Rigby, <[email protected]> +* +* Modified version of drivers/net/fec.h: +* +* fec.h -- Fast Ethernet Controller for Motorola ColdFire SoC +* processors. +* +* (C) Copyright 2000-2005, Greg Ungerer ([email protected]) +* (C) Copyright 2000-2001, Lineo (www.lineo.com) +* +* This is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ +#ifndef MPC5121_FEC_H +#define MPC5121_FEC_H + +typedef struct fec { +u32 fec_reserved0; +u32 fec_ievent;/* Interrupt event reg */ +u32 fec_imask;/* Interrupt mask reg */ +u32 fec_reserved1; +u32 fec_r_des_active;/* Receive descriptor reg */ +u32 fec_x_des_active;/* Transmit descriptor reg */ +u32 fec_reserved2[3 ]; +u32 fec_ecntrl;/* Ethernet control reg */ +u32 fec_reserved3[6 ]; +u32 fec_mii_data;/* MII manage frame reg */ +u32 fec_mii_speed;/* MII speed control reg */ +u32 fec_reserved4[7 ]; +u32 fec_mib_ctrlstat;/* MIB control/status reg */ +u32 fec_reserved5[7 ]; +u32 fec_r_cntrl;/* Receive control reg */ +u32 fec_reserved6[15 ]; +u32 fec_x_cntrl;/* Transmit Control reg */ +u32 fec_reserved7[7 ]; +u32 fec_addr_low;/* Low 32bits MAC address */ +u32 fec_addr_high;/* High 16bits MAC address */ +u32 fec_opd;/* Opcode + Pause duration */ +u32 fec_reserved8[10 ]; +u32 fec_hash_table_high;/* High 32bits hash table */ +u32 fec_hash_table_low;/* Low 32bits hash table */ +u32 fec_grp_hash_table_high;/* High 32bits hash table */ +u32 fec_grp_hash_table_low;/* Low 32bits hash table */ +u32 fec_reserved9[7 ]; +u32 fec_x_wmrk;/* FIFO transmit water mark */ +u32 fec_reserved10; +u32 fec_r_bound;/* FIFO receive bound reg */ +u32 fec_r_fstart;/* FIFO receive start reg */ +u32 fec_reserved11[11 ]; +u32 fec_r_des_start;/* Receive descriptor ring */ +u32 fec_x_des_start;/* Transmit descriptor ring */ +u32 fec_r_buff_size;/* Maximum receive buff size */ +u32 fec_reserved12[26 ]; +u32 fec_dma_control;/* DMA Endian and other ctrl */ +}fec_t ; + +/* +* Define the buffer descriptor structure. +*/ +typedef struct bufdesc { +ushort cbd_sc;/* Control and status info */ +ushort cbd_datlen;/* Data length */ +uint cbd_bufaddr;/* Buffer address */ +}cbd_t ; + +/* +* The following definitions courtesy of commproc.h, which where +* Copyright (c) 1997 Dan Malek ([email protected]). +*/ +#define BD_SC_WRAP ((ushort)0x2000) + +/* +* Buffer descriptor control/status used by Ethernet receive. +*/ +#define BD_ENET_RX_EMPTY ((ushort)0x8000) +#define BD_ENET_RX_WRAP ((ushort)0x2000) +#define BD_ENET_RX_INTR ((ushort)0x1000) +#define BD_ENET_RX_LAST ((ushort)0x0800) +#define BD_ENET_RX_FIRST ((ushort)0x0400) +#define BD_ENET_RX_MISS ((ushort)0x0100) +#define BD_ENET_RX_LG ((ushort)0x0020) +#define BD_ENET_RX_NO ((ushort)0x0010) +#define BD_ENET_RX_SH ((ushort)0x0008) +#define BD_ENET_RX_CR ((ushort)0x0004) +#define BD_ENET_RX_OV ((ushort)0x0002) +#define BD_ENET_RX_CL ((ushort)0x0001) +#define BD_ENET_RX_STATS ((ushort)0x013f)/* All status bits */ + +/* +* Buffer descriptor control/status used by Ethernet transmit. +*/ +#define BD_ENET_TX_READY ((ushort)0x8000) +#define BD_ENET_TX_PAD ((ushort)0x4000) +#define BD_ENET_TX_WRAP ((ushort)0x2000) +#define BD_ENET_TX_INTR ((ushort)0x1000) +#define BD_ENET_TX_LAST ((ushort)0x0800) +#define BD_ENET_TX_TC ((ushort)0x0400) +#define BD_ENET_TX_DEF ((ushort)0x0200) +#define BD_ENET_TX_HB ((ushort)0x0100) +#define BD_ENET_TX_LC ((ushort)0x0080) +#define BD_ENET_TX_RL ((ushort)0x0040) +#define BD_ENET_TX_UN ((ushort)0x0002) +#define BD_ENET_TX_CSL ((ushort)0x0001) +#define BD_ENET_TX_STATS ((ushort)0x03ff)/* All status bits */ + +#endif /* MPC5121_FEC_H */
drivers/net/fs_enet/Kconfig +7 -3
@@ -1,9 +1,13 @@ config FS_ENET tristate "Freescale Ethernet Driver" - depends on CPM1 || CPM2 + depends on CPM1 || CPM2 || PPC_MPC512x select MII select PHYLIB +config FS_ENET_MPC5121_FEC + def_bool y if (FS_ENET && PPC_MPC512x) + select FS_ENET_HAS_FEC + config FS_ENET_HAS_SCC bool "Chip has an SCC usable for ethernet" depends on FS_ENET && (CPM1 || CPM2)
@@ -16,13 +20,13 @@ config FS_ENET_HAS_FCC config FS_ENET_HAS_FEC bool "Chip has an FEC usable for ethernet" - depends on FS_ENET && CPM1 + depends on FS_ENET && (CPM1 || FS_ENET_MPC5121_FEC) select FS_ENET_MDIO_FEC default y config FS_ENET_MDIO_FEC tristate "MDIO driver for FEC" - depends on FS_ENET && CPM1 + depends on FS_ENET && (CPM1 || FS_ENET_MPC5121_FEC) config FS_ENET_MDIO_FCC tristate "MDIO driver for FCC"
drivers/net/fs_enet/fs_enet-main.c +7 -0
@@ -1183,11 +1183,18 @@ static struct of_device_id fs_enet_match[] = { },#endif #ifdef CONFIG_FS_ENET_HAS_FEC +#ifdef CONFIG_FS_ENET_MPC5121_FEC + { + .compatible = "fsl,mpc5121-fec", + .data = (void *)&fs_fec_ops, + }, +#else { .compatible = "fsl,pq1-fec-enet", .data = (void *)&fs_fec_ops, }, #endif +#endif {} };
drivers/net/fs_enet/fs_enet.h +6 -0
@@ -13,7 +13,13 @@#ifdef CONFIG_CPM1 #include <asm/cpm1.h> +#endif + +#ifdef CONFIG_FS_ENET_MPC5121_FEC +#include <asm/mpc5121_fec.h> +#endif +#if defined(CONFIG_CPM1) || defined(CONFIG_FS_ENET_MPC5121_FEC) struct fec_info { fec_t __iomem *fecp; u32 mii_speed;
drivers/net/fs_enet/mac-fec.c +28 -2
@@ -44,6 +44,10 @@#include <asm/cpm1.h> #endif +#ifdef CONFIG_FS_ENET_MPC5121_FEC +#include <asm/mpc5121_fec.h> +#endif +#include "fs_enet.h" #include "fec.h"
@@ -285,7 +289,11 @@ static void restart(struct net_device *dev)* Set maximum receive buffer size. */ FW (fecp, r_buff_size,PKT_MAXBLR_SIZE ); +#ifdef CONFIG_FS_ENET_MPC5121_FEC +FW (fecp, r_cntrl,PKT_MAXBUF_SIZE <<16 ); +#else FW (fecp, r_hash,PKT_MAXBUF_SIZE ); +#endif /* get physical address */ rx_bd_base_phys = fep->ring_mem_addr;
@@ -300,9 +308,14 @@ static void restart(struct net_device *dev)fs_init_bds (dev);/* -* Enable big endian and don't care about SDMA FC. +* Enable big endian. */ +#ifndef CONFIG_FS_ENET_MPC5121_FEC +/* Don't care about SDMA FC. */ FW (fecp, fun_code,0x78000000 ); +#else +FS (fecp, dma_control,0xC0000000 ); +#endif /* * Set MII speed.
@@ -313,7 +326,9 @@ static void restart(struct net_device *dev)* Clear any outstanding interrupt. */ FW (fecp, ievent,0xffc0 ); +#ifndef CONFIG_FS_ENET_MPC5121_FEC FW (fecp, ivec, (virq_to_hw (fep->interrupt) /2 ) <<29 ); +#endif /* * adjust to speed (only for DUET & RMII)
@@ -344,8 +359,19 @@ static void restart(struct net_device *dev) }#endif +/* +* Enable MII +*/ +#ifdef CONFIG_FS_ENET_MPC5121_FEC +/* +* Only set requested bit - do not touch maximum packet size +* configured earlier. +*/ +FS (fecp, r_cntrl,FEC_RCNTRL_MII_MODE ); +#else +FW (fecp, r_cntrl,FEC_RCNTRL_MII_MODE ); +#endif -FW (fecp, r_cntrl,FEC_RCNTRL_MII_MODE );/* MII enable */ /* * adjust to duplex mode */
drivers/net/fs_enet/mii-fec.c +7 -0
@@ -32,6 +32,7 @@#include <linux/bitops.h> #include <linux/platform_device.h> #include <linux/of_platform.h> +#include <linux/time.h> #include <asm/pgtable.h> #include <asm/irq.h>
@@ -211,9 +212,15 @@ static int fs_enet_mdio_remove(struct of_device *ofdev) } static struct of_device_id fs_enet_mdio_fec_match[] = { +#ifdef CONFIG_FS_ENET_MPC5121_FEC + { + .compatible = "fsl,mpc5121-fec-mdio", + }, +#else { .compatible = "fsl,pq1-fec-mdio", }, +#endif {}, };
Signature · 1 line
1.6.0.6
Re: [PATCH 02/12] fs_enet: Add MPC5121 FEC support.
Quoted 186 lines · Wolfgang Denk
From: John Rigby <[email protected]>
Add support for MPC512x to
fs_enetdriverdrivers/net/fs_enet/*
Enablefs_enetdriver to work 5121 FEC
Enable it withCONFIG_FS_ENET_MPC5121_FECSigned-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]>---
arch/powerpc/include/asm/mpc5121_fec.h | 111 ++++++++++++++++++++++++++++++++drivers/net/fs_enet/Kconfig| 10 ++-drivers/net/fs_enet/fs_enet-main.c| 7 ++drivers/net/fs_enet/fs_enet.h | 6 ++ drivers/net/fs_enet/mac-fec.c | 30 ++++++++- drivers/net/fs_enet/mii-fec.c | 7 ++ 6 files changed, 166 insertions(+), 5 deletions(-)create mode 100644
arch/powerpc/include/asm/mpc5121_fec.harch/powerpc/include/asm/mpc5121_fec.h new file +111
-0@@ -0,0 +1,111 @@ +/* +* Copyright (C) 2007,2008 Freescale Semiconductor, Inc. All rights reserved. +* +* Author: John Rigby, <[email protected]> +* +* Modified version of drivers/net/fec.h: +* +* fec.h -- Fast Ethernet Controller for Motorola ColdFire SoC +* processors. +* +* (C) Copyright 2000-2005, Greg Ungerer ([email protected]) +* (C) Copyright 2000-2001, Lineo (www.lineo.com) +* +* This is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ +#ifndef MPC5121_FEC_H +#define MPC5121_FEC_H + +typedef struct fec { + u32 fec_reserved0; + u32 fec_ievent; /* Interrupt event reg */ + u32 fec_imask; /* Interrupt mask reg */ + u32 fec_reserved1; + u32 fec_r_des_active; /* Receive descriptor reg */ + u32 fec_x_des_active; /* Transmit descriptor reg */ + u32 fec_reserved2[3]; + u32 fec_ecntrl; /* Ethernet control reg */ + u32 fec_reserved3[6]; + u32 fec_mii_data; /* MII manage frame reg */ + u32 fec_mii_speed; /* MII speed control reg */ + u32 fec_reserved4[7]; + u32 fec_mib_ctrlstat; /* MIB control/status reg */ + u32 fec_reserved5[7]; + u32 fec_r_cntrl; /* Receive control reg */ + u32 fec_reserved6[15]; + u32 fec_x_cntrl; /* Transmit Control reg */ + u32 fec_reserved7[7]; + u32 fec_addr_low; /* Low 32bits MAC address */ + u32 fec_addr_high; /* High 16bits MAC address */ + u32 fec_opd; /* Opcode + Pause duration */ + u32 fec_reserved8[10]; + u32 fec_hash_table_high; /* High 32bits hash table */ + u32 fec_hash_table_low; /* Low 32bits hash table */ + u32 fec_grp_hash_table_high; /* High 32bits hash table */ + u32 fec_grp_hash_table_low; /* Low 32bits hash table */ + u32 fec_reserved9[7]; + u32 fec_x_wmrk; /* FIFO transmit water mark */ + u32 fec_reserved10; + u32 fec_r_bound; /* FIFO receive bound reg */ + u32 fec_r_fstart; /* FIFO receive start reg */ + u32 fec_reserved11[11]; + u32 fec_r_des_start; /* Receive descriptor ring */ + u32 fec_x_des_start; /* Transmit descriptor ring */ + u32 fec_r_buff_size; /* Maximum receive buff size */ + u32 fec_reserved12[26]; + u32 fec_dma_control; /* DMA Endian and other ctrl */ +}fec_t ; + +/* +* Define the buffer descriptor structure. +*/ +typedef struct bufdesc { + ushort cbd_sc; /* Control and status info */ + ushort cbd_datlen; /* Data length */ + uint cbd_bufaddr; /* Buffer address */ +}cbd_t ; + +/* +* The following definitions courtesy of commproc.h, which where +* Copyright (c) 1997 Dan Malek ([email protected]). +*/ +#define BD_SC_WRAP ((ushort)0x2000) + +/* +* Buffer descriptor control/status used by Ethernet receive. +*/ +#define BD_ENET_RX_EMPTY ((ushort)0x8000) +#define BD_ENET_RX_WRAP ((ushort)0x2000) +#define BD_ENET_RX_INTR ((ushort)0x1000) +#define BD_ENET_RX_LAST ((ushort)0x0800) +#define BD_ENET_RX_FIRST ((ushort)0x0400) +#define BD_ENET_RX_MISS ((ushort)0x0100) +#define BD_ENET_RX_LG ((ushort)0x0020) +#define BD_ENET_RX_NO ((ushort)0x0010) +#define BD_ENET_RX_SH ((ushort)0x0008) +#define BD_ENET_RX_CR ((ushort)0x0004) +#define BD_ENET_RX_OV ((ushort)0x0002) +#define BD_ENET_RX_CL ((ushort)0x0001) +#define BD_ENET_RX_STATS ((ushort)0x013f)/* All status bits */ + +/* +* Buffer descriptor control/status used by Ethernet transmit. +*/ +#define BD_ENET_TX_READY ((ushort)0x8000) +#define BD_ENET_TX_PAD ((ushort)0x4000) +#define BD_ENET_TX_WRAP ((ushort)0x2000) +#define BD_ENET_TX_INTR ((ushort)0x1000) +#define BD_ENET_TX_LAST ((ushort)0x0800) +#define BD_ENET_TX_TC ((ushort)0x0400) +#define BD_ENET_TX_DEF ((ushort)0x0200) +#define BD_ENET_TX_HB ((ushort)0x0100) +#define BD_ENET_TX_LC ((ushort)0x0080) +#define BD_ENET_TX_RL ((ushort)0x0040) +#define BD_ENET_TX_UN ((ushort)0x0002) +#define BD_ENET_TX_CSL ((ushort)0x0001) +#define BD_ENET_TX_STATS ((ushort)0x03ff)/* All status bits */ + +#endif /* MPC5121_FEC_H */ drivers/net/fs_enet/Kconfig +0
-0@@ -1,9 +1,13 @@config
FS_ENET
tristate "Freescale Ethernet Driver"- depends on CPM1 || CPM2 + depends on CPM1 || CPM2 || PPC_MPC512xselect MII
select PHYLIBdrivers/net/fs_enet/Kconfig +4
-0+config FS_ENET_MPC5121_FEC + def_bool y if (FS_ENET && PPC_MPC512x) + select FS_ENET_HAS_FEC +config
FS_ENET_HAS_SCC
bool "Chip has an SCC usable for ethernet"
depends onFS_ENET&& (CPM1 || CPM2)drivers/net/fs_enet/Kconfig +0
-0@@ -16,13 +20,13 @@ config FS_ENET_HAS_FCCconfig
FS_ENET_HAS_FEC
bool "Chip has an FEC usable for ethernet"
- depends onFS_ENET&& CPM1
+ depends onFS_ENET&& (CPM1 ||FS_ENET_MPC5121_FEC) selectFS_ENET_MDIO_FEC
default yconfig
FS_ENET_MDIO_FEC
tristate "MDIO driver for FEC"
- depends onFS_ENET&& CPM1
+ depends onFS_ENET&& (CPM1 ||FS_ENET_MPC5121_FEC)config
FS_ENET_MDIO_FCC
tristate "MDIO driver for FCC"drivers/net/fs_enet/fs_enet-main.c +2
-0@@ -1183,11 +1183,18 @@ static struct of_device_id fs_enet_match[] = { }, #endif #ifdef CONFIG_FS_ENET_HAS_FEC +#ifdef CONFIG_FS_ENET_MPC5121_FEC + {
drivers/net/fs_enet/fs_enet-main.c static struct of_device_id fs_enet_match[] = { · line 1197
Quoted 10 lines
drivers/net/fs_enet/fs_enet-main.c +5
-0+ .compatible = "fsl,mpc5121-fec", + .data = (void *)&fs_fec_ops, + }, +#else { .compatible = "fsl,pq1-fec-enet", .data = (void *)&fs_fec_ops, }, #endif +#endif
Hmmm. A lot of these #ifdefs in here. Does this have a multiplatform impact? Not to mention the fact that it's just plain ugly. :-)
g.
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
Re: [PATCH 02/12] fs_enet: Add MPC5121 FEC support.
Quoted 8 lines · Grant Likely
Quoted 8 lines
#ifdef
CONFIG_FS_ENET_HAS_FECdrivers/net/fs_enet/fs_enet-main.c +6
-0+#ifdef CONFIG_FS_ENET_MPC5121_FEC + { + .compatible = "fsl,mpc5121-fec", + .data = (void *)&fs_fec_ops, + }, +#else {
Quoted 8 lines
Quoted 5 lines
.compatible = "fsl,pq1-fec-enet", .data = (void *)&fs_fec_ops, },#endif
+#endifHmmm. A lot of these #ifdefs in here. Does this have a multiplatform impact? Not to mention the fact that it's just plain ugly. :-)
Multiplatform between 512x and 8xx is currently impossible for other reasons (512x and CPM2 is another matter). That said, less ifdefs would be nice.
-Scott
Re: [PATCH 02/12] fs_enet: Add MPC5121 FEC support.
In reply to Grant LikelyDear Grant,
Quoted 1 line · in message <[email protected]> you…
...
Quoted 8 lines
Quoted 8 lines
#ifdef
CONFIG_FS_ENET_HAS_FECdrivers/net/fs_enet/fs_enet-main.c +6
-0+#ifdef CONFIG_FS_ENET_MPC5121_FEC + { + .compatible = "fsl,mpc5121-fec", + .data = (void *)&fs_fec_ops, + }, +#else {
Quoted 8 lines
Quoted 5 lines
.compatible = "fsl,pq1-fec-enet", .data = (void *)&fs_fec_ops,},
#endif
+#endifHmmm. A lot of these #ifdefs in here. Does this have a multiplatform impact? Not to mention the fact that it's just plain ugly. :-)
Agreed that it's ugly, but duplicatio9ng the code would have been even worse. I don't think that it has multiplatform - at least not as long as you don't ask for one image that runs on 83xx and on 512x.
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected] Our business is run on trust. We trust you will pay in advance.
Re: [PATCH 02/12] fs_enet: Add MPC5121 FEC support.
Quoted 22 lines · Wolfgang Denk
Dear Grant,
Quoted 1 line · in message <[email protected]> you…
...
Quoted 8 lines
Quoted 8 lines
#ifdef
CONFIG_FS_ENET_HAS_FECdrivers/net/fs_enet/fs_enet-main.c +6
-0+#ifdef CONFIG_FS_ENET_MPC5121_FEC + { + .compatible = "fsl,mpc5121-fec", + .data = (void *)&fs_fec_ops, + }, +#else {
Quoted 8 lines
Quoted 5 lines
.compatible = "fsl,pq1-fec-enet",
.data = (void *)&fs_fec_ops,
},
#endif
+#endifHmmm. A lot of these #ifdefs in here. Does this have a multiplatform impact? Not to mention the fact that it's just plain ugly. :-)
Quoted 3 lines
Agreed that it's ugly, but duplicatio9ng the code would have been even worse. I don't think that it has multiplatform - at least not as long as you don't ask for one image that runs on 83xx and on 512x.
Actually, I *am* asking for one image that runs on 83xx, 52xx and 521x. I already can and do build and test a single image which boots on all my 52xx boards, on my 8349 board, and on my G4 Mac.
g.
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
Re: [PATCH 02/12] fs_enet: Add MPC5121 FEC support.
Dear Grant,
Quoted 8 lines · In message <[email protected]> you…
Quoted 4 lines
Agreed that it's ugly, but duplicatio9ng the code would have been even worse. I don't think that it has multiplatform - at least not as long as you don't ask for one image that runs on 83xx and on 512x.
Actually, I *am* asking for one image that runs on 83xx, 52xx and 521x. I already can and do build and test a single image which boots on all my 52xx boards, on my 8349 board, and on my G4 Mac.
He. I was afraid you'd say that ;-)
In this case I need a helping hand as I can't figure out how to make this work. Any suggestions?
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected] "Here's a fish hangs in the net like a poor man's right in the law. 'Twill hardly come out." - Shakespeare, Pericles, Act II, Scene 1
Re: [PATCH 02/12] fs_enet: Add MPC5121 FEC support.
Quoted 8 lines · Wolfgang Denk
Dear Grant,
Quoted 5 lines · In message <[email protected]> you…
Quoted 4 lines
Agreed that it's ugly, but duplicatio9ng the code would have been even worse. I don't think that it has multiplatform - at least not as long as you don't ask for one image that runs on 83xx and on 512x.
Quoted 8 lines
Quoted 3 lines
Actually, I *am* asking for one image that runs on 83xx, 52xx and 521x. I already can and do build and test a single image which boots on all my 52xx boards, on my 8349 board, and on my G4 Mac.
He. I was afraid you'd say that ;-)
In this case I need a helping hand as I can't figure out how to make this work. Any suggestions?
Hmmm, it is rather ugly because the layout of fec_t is so different. Easiest solution would be to duplicate the driver in its entirety, but as you say it results in a lot of duplicate code. It might be the lesser of many weevils though.
Second easiest would be to factor out all the common code in the driver into a separate .c file that gets included by a 'wrapper' .c file for each config which first includes the correct definition of fec_t. This approach solves the duplicate code problem, but it also fell out of the ugly tree and hit every branch on the way down.
ie: the wrappers would look something like this:
fs_enet_cpm1.c:
#include <asm/cpm1.h>
#include "fs_enet_main.c"
fs_enet_cpm2.c:
#include <asm/cpm2.h>
#include "fs_enet_main.c"
fs_enet_512x.c:
#include <asm/mpc512x.h>
#include "fs_enet_main.c"
And then the makefile would be something along the lines of:
obj-${CONFIG_FS_ENET_CPM1_ += fs_enet_cpm1.o obj-${CONFIG_FS_ENET_CPM2_ += fs_enet_cpm2.o obj-${CONFIG_FS_ENET_MPC512x_ += fs_enet_512x.o
A brief look at the driver suggests that access to the fec_t structure is restricted to the fec-mii.c and mac-fec.c files. It might be appropriate to duplicate just those files and do some form of fs_enet_ops to select between them.
While on the topic, it looks to me like the driver could really use some refactoring love. Having multiple definitions of "fec_t" is confusing and potentially lead to hard to find bugs if the wrong header gets included by anyone. I'd like to see all the fec specific stuff in arch/powerpc/include/asm moved into drivers/net/fs_enet and renamed to reflect the hardware it is associate with. Stuff like "fec_t" is far to generic, not to mention that typedefs are discouraged now.
Regardless, I feel your pain. It is not a pretty situation.
g.
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
Re: [PATCH 02/12] fs_enet: Add MPC5121 FEC support.
Wolfgang,
Welcome to my world and why I gave up on this months ago.
Everyone else,
One thing to consider here is a rewrite with the goal of a new improved fec driver that would work on both 5121 and the various mx platforms that also have this same fec core.
Also don't forget that the register map is the same on 512x, mx and coldfire platforms but not on the other ppc platforms so if you want to one binary to rule them all you will need to have an offest table or some such.
John
Quoted 63 lines · Grant Likely
Quoted 3 lines · Wolfgang Denk
Dear Grant,
In message <[email protected]>
Quoted 5 lines · you
Quoted 5 lines
Quoted 4 lines
Agreed that it's ugly, but duplicatio9ng the code would have been even worse. I don't think that it has multiplatform - at least not as long as you don't ask for one image that runs on 83xx and on 512x.
Quoted 8 lines
Quoted 3 lines
Actually, I *am* asking for one image that runs on 83xx, 52xx and 521x. I already can and do build and test a single image which boots on all my 52xx boards, on my 8349 board, and on my G4 Mac.
He. I was afraid you'd say that ;-)
In this case I need a helping hand as I can't figure out how to make this work. Any suggestions?
Hmmm, it is rather ugly because the layout of
fec_tis so different. Easiest solution would be to duplicate the driver in its entirety, but as you say it results in a lot of duplicate code. It might be the lesser of many weevils though.Second easiest would be to factor out all the common code in the driver into a separate .c file that gets included by a 'wrapper' .c file for each config which first includes the correct definition of
fec_t. This approach solves the duplicate code problem, but it also fell out of the ugly tree and hit every branch on the way down.ie: the wrappers would look something like this:
fs_enet_cpm1.c:
#include <asm/cpm1.h>
#include "fs_enet_main.c"
fs_enet_cpm2.c:
#include <asm/cpm2.h>
#include "fs_enet_main.c"
fs_enet_512x.c:
#include <asm/mpc512x.h>
#include "fs_enet_main.c"And then the makefile would be something along the lines of:
obj-${CONFIG_FS_ENET_CPM1_ += fs_enet_cpm1.o obj-${CONFIG_FS_ENET_CPM2_ += fs_enet_cpm2.o obj-${CONFIG_FS_ENET_MPC512x_ += fs_enet_512x.oA brief look at the driver suggests that access to the
fec_tstructure is restricted to thefec-mii.candmac-fec.cfiles. It might be appropriate to duplicate just those files and do some form offs_enet_opsto select between them.While on the topic, it looks to me like the driver could really use some refactoring love. Having multiple definitions of "
fec_t" is confusing and potentially lead to hard to find bugs if the wrong header gets included by anyone. I'd like to see all the fec specific stuff inarch/powerpc/include/asmmoved intodrivers/net/fs_enetand renamed to reflect the hardware it is associate with. Stuff like "fec_t" is far to generic, not to mention that typedefs are discouraged now.
Quoted 8 lines
Regardless, I feel your pain. It is not a pretty situation.
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev
David Miller
maintainerRe: [PATCH 02/12] fs_enet: Add MPC5121 FEC support.
From: John Rigby <[email protected]>
Date: Thu, 7 May 2009 20:02:53 -0600
Quoted 4 lines
Also don't forget that the register map is the same on 512x, mx and coldfire platforms but not on the other ppc platforms so if you want to one binary to rule them all you will need to have an offest table or some such.
I would suggest using ->read_reg() ->write_reg() methods for abstracting this. That's how we handle all of the different way ESP scsi chips have their registers wired up.
I/O register reads take hundreds, if not thousands of CPU cycles so, relatively speaking, the indirection costs absolutely nothing.
Re: [PATCH 02/12] fs_enet: Add MPC5121 FEC support.
Quoted 8 lines · On Friday 08 May 2009 09:52:51 David Miller wrote:
From: John Rigby <[email protected]>
Date: Thu, 7 May 2009 20:02:53 -0600Quoted 4 lines
Also don't forget that the register map is the same on 512x, mx and coldfire platforms but not on the other ppc platforms so if you want to one binary to rule them all you will need to have an offest table or some such.
Quoted 6 lines
I would suggest using ->read_reg() ->write_reg() methods for abstracting this. That's how we handle all of the different way ESP scsi chips have their registers wired up.
I/O register reads take hundreds, if not thousands of CPU cycles so, relatively speaking, the indirection costs absolutely nothing.
I fear the memory-mapped I/O of the PowerPC SoC is *slightly* faster, so in terms of cycle count, this WILL matter, although depending on how much register-I/O the driver does, overall performance impact _may_ still be negligible. I suggest testing this (benchmarks) before and after the change.
Best regsards,
Signature · 2 lines
David Jander Protonic Holland.
Re: [PATCH 02/12] fs_enet: Add MPC5121 FEC support.
In reply to Grant LikelyQuoted 8 lines · On Thursday 07 May 2009 00:29:59 Grant Likely wrote:
Quoted 7 lines · Wolfgang Denk
Dear Grant,
in message <[email protected]> you wrote:
...
Quoted 15 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
#ifdef
CONFIG_FS_ENET_HAS_FEC(quoted diff) +6
-0+#ifdef CONFIG_FS_ENET_MPC5121_FEC + =A0 =A0{ + =A0 =A0 =A0 =A0.compatible =3D "fsl,mpc5121-fec", + =A0 =A0 =A0 =A0.data =3D (void *)&fs_fec_ops, + =A0 =A0}, +#elseQuoted 8 lines
Quoted 8 lines
Quoted 6 lines
=A0 =A0{
=A0 =A0 =A0 =A0.compatible =3D "fsl,pq1-fec-enet", =A0 =A0 =A0 =A0.data =3D (void *)&fs_fec_ops, =A0 =A0},
#endif
+#endifHmmm. =A0A lot of these #ifdefs in here. =A0Does this have a multiplat=
form
Quoted 9 lines
Quoted 5 lines
Quoted 1 line
impact? =A0Not to mention the fact that it's just plain ugly. =A0:-)
Agreed that it's ugly, but duplicatio9ng the code would have been even worse. I don't think that it has multiplatform - at least not as long as you don't ask for one image that runs on 83xx and on 512x.
Actually, I *am* asking for one image that runs on 83xx, 52xx and 521x. I already can and do build and test a single image which boots on all my 52xx boards, on my 8349 board, and on my G4 Mac.
Cool! I also want that! We have different boards with 5200 and 5121e's and = it=20
would be terrific if one day we'd be able to use just one kernel for all of= =20
them!
(Sorry for being a me-too-er)
Best regards,
=2D-=20
David Jander
Protonic Holland.
Re: [PATCH 02/12] fs_enet: Add MPC5121 FEC support.
In reply to Wolfgang DenkQuoted 23 lines · Wolfgang Denk
Dear Grant,
in message <[email protected]
Quoted 2 lines
you wrote:
...
Quoted 8 lines
Quoted 8 lines
#ifdef
CONFIG_FS_ENET_HAS_FECdrivers/net/fs_enet/fs_enet-main.c +6
-0+#ifdef CONFIG_FS_ENET_MPC5121_FEC + { + .compatible = "fsl,mpc5121-fec", + .data = (void *)&fs_fec_ops, + }, +#else {Quoted 8 lines
Quoted 5 lines
.compatible = "fsl,pq1-fec-enet", .data = (void *)&fs_fec_ops,},
#endif
+#endifHmmm. A lot of these #ifdefs in here. Does this have a multiplatform impact? Not to mention the fact that it's just plain ugly. :-)
Quoted 3 lines
Agreed that it's ugly, but duplicatio9ng the code would have been even worse. I don't think that it has multiplatform - at least not as long as you don't ask for one image that runs on 83xx and on 512x.
We do ask for that. The fedora ppc6xx kernel should work on any 6xx/7xx/7xxx based core chip. We should NOT be breaking such capability in drivers.
- k
David Miller
maintainerRe: [PATCH 02/12] fs_enet: Add MPC5121 FEC support.
In reply to Wolfgang DenkWould you be offended if I tell you that this is a horrible patch submission?
Your introductory email indicates 16 patches, yet the series indicates there were 12, and that intro email is only posted to the linuxppc-dev list for people to read. Nobody on netdev nor other interested parties that get CC:'d along the line are able to read what this patch series is about.
Since only some patches are CC:'d to netdev I have no idea if I should apply these or they are dependent on some other patches in the series that you didn't send here to netdev.
What a mess... how can any maintainer figure out what patch is what, and what tree you expect these patches to even get applied to?
I'm definitely sending all of the copies I have received to /dev/null, you need to submit this work properly.
Re: [PATCH 02/12] fs_enet: Add MPC5121 FEC support.
Dear David,
Quoted 9 lines · In message <[email protected]> you wrote:
Would you be offended if I tell you that this is a horrible patch submission?
Your introductory email indicates 16 patches, yet the series indicates there were 12, and that intro email is only posted to the linuxppc-dev list for people to read. Nobody on netdev nor other interested parties that get CC:'d along the line are able to read what this patch series is about.
Of course I am not offended, as you are absolutely right with your comment. I'm angry with myself, as I actually intended to do exactly what you find missing, but then forgot to write the file in the editor :-(
Quoted 2 lines
I'm definitely sending all of the copies I have received to
/dev/null, you need to submit this work properly.
OK. What exactly should I do?
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected] If I have seen further it is by standing on the shoulders of giants. - Isaac Newton, Letter to Robert Hooke, 5 February 1676
Re: [PATCH 02/12] fs_enet: Add MPC5121 FEC support.
In reply to Wolfgang DenkQuoted 38 lines · Wolfgang Denk
arch/powerpc/include/asm/mpc5121_fec.h new file +38
-0+/* +* Define the buffer descriptor structure. +*/ +typedef struct bufdesc { +ushort cbd_sc;/* Control and status info */ +ushort cbd_datlen;/* Data length */ +uint cbd_bufaddr;/* Buffer address */ +}cbd_t ; + +/* +* The following definitions courtesy of commproc.h, which where +* Copyright (c) 1997 Dan Malek ([email protected]). +*/ +#define BD_SC_WRAP ((ushort)0x2000) + +/* +* Buffer descriptor control/status used by Ethernet receive. +*/ +#define BD_ENET_RX_EMPTY ((ushort)0x8000) +#define BD_ENET_RX_WRAP ((ushort)0x2000) +#define BD_ENET_RX_INTR ((ushort)0x1000) +#define BD_ENET_RX_LAST ((ushort)0x0800) +#define BD_ENET_RX_FIRST ((ushort)0x0400) +#define BD_ENET_RX_MISS ((ushort)0x0100) +#define BD_ENET_RX_LG ((ushort)0x0020) +#define BD_ENET_RX_NO ((ushort)0x0010) +#define BD_ENET_RX_SH ((ushort)0x0008) +#define BD_ENET_RX_CR ((ushort)0x0004) +#define BD_ENET_RX_OV ((ushort)0x0002) +#define BD_ENET_RX_CL ((ushort)0x0001) +#define BD_ENET_RX_STATS ((ushort)0x013f)/* All status bits */ + +/* +* Buffer descriptor control/status used by Ethernet transmit. +*/ +#define BD_ENET_TX_READY ((ushort)0x8000) +#define BD_ENET_TX_PAD ((ushort)0x4000) +#define BD_ENET_TX_WRAP ((ushort)0x2000)
arch/powerpc/include/asm/mpc5121_fec.h line 109
Quoted 10 lines
arch/powerpc/include/asm/mpc5121_fec.h new file +10
-0+#define BD_ENET_TX_INTR ((ushort)0x1000) +#define BD_ENET_TX_LAST ((ushort)0x0800) +#define BD_ENET_TX_TC ((ushort)0x0400) +#define BD_ENET_TX_DEF ((ushort)0x0200) +#define BD_ENET_TX_HB ((ushort)0x0100) +#define BD_ENET_TX_LC ((ushort)0x0080) +#define BD_ENET_TX_RL ((ushort)0x0040) +#define BD_ENET_TX_UN ((ushort)0x0002) +#define BD_ENET_TX_CSL ((ushort)0x0001) +#define BD_ENET_TX_STATS ((ushort)0x03ff)/* All status bits */
All of the above is duplicative (with even the same names) of stuff in asm/cpm.h. Beyond just the duplication, what happens if both CPM2 and 512x are enabled in the same kernel?
-Scott
Re: [PATCH 02/12] fs_enet: Add MPC5121 FEC support.
Dear Scott,
Quoted 3 lines · in message <[email protected]> you wrote:
All of the above is duplicative (with even the same names) of stuff in
asm/cpm.h. Beyond just the duplication, what happens if both CPM2 and
OK, I can try to reuse the definitions from that file.
Quoted 1 line
512x are enabled in the same kernel?
Hm... both architectures look sufficiently different to me that I don't see sense in trying such a thing. Do you think that needs to be supported?
Best regards,
Wolfgang Denk
Signature · 7 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected] "You ain't experienced..." "Well, nor are you." "That's true. But the point is ... the point is ... the point is we've been not experienced for a lot longer than you. We've got a lot of experience of not having any experience." - Terry Pratchett, _Witches Abroad_
Re: [PATCH 02/12] fs_enet: Add MPC5121 FEC support.
Quoted 7 lines · Wolfgang Denk
Dear Scott,
Quoted 3 lines · in message <[email protected]> you wrote:
All of the above is duplicative (with even the same names) of stuff in
asm/cpm.h. Beyond just the duplication, what happens if both CPM2 and
Quoted 7 lines
OK, I can try to reuse the definitions from that file.
Quoted 1 line
512x are enabled in the same kernel?
Hm... both architectures look sufficiently different to me that I don't see sense in trying such a thing. Do you think that needs to be supported?
Yes! :-) It's not hard to do and it keeps the driver cleaner (IMNSHO). I don't think it is quite possible at the moment due to cache coherency issues, but with Becky's recently merged dma ops changes it should be fixable.
Cheers,
g.
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
Re: [PATCH 02/12] fs_enet: Add MPC5121 FEC support.
Thursday 07 May 2009 00:39:25 Grant Likely napisał(a):
Quoted 10 lines
Quoted 5 lines
Quoted 1 line
512x are enabled in the same kernel?
Hm... both architectures look sufficiently different to me that I don't see sense in trying such a thing. Do you think that needs to be supported?
Yes! :-) It's not hard to do and it keeps the driver cleaner (IMNSHO). I don't think it is quite possible at the moment due to cache coherency issues, but with Becky's recently merged dma ops changes it should be fixable.
Could you elaborate on the cache coherency issues in MPC5121 FEC context? Especially how these issues are related to the driver binary compatibility.
MPC5121 support was added to drivers/net/fs_enet. MPC52xx uses drivers/net/fec_mpc52xx.c. Do you think that creating one universal driver from these two is now possible? You said that it should be easy, however you also said that cache coherency issues makes this imposible.
Signature · 2 lines
Best Regards. Piotr Ziecik
Re: [PATCH 02/12] fs_enet: Add MPC5121 FEC support.
2009/5/14 Piotr Zięcik <[email protected]>:
Quoted 12 lines
Thursday 07 May 2009 00:39:25 Grant Likely napisał(a):
Quoted 10 lines
Quoted 5 lines
Quoted 1 line
512x are enabled in the same kernel?
Hm... both architectures look sufficiently different to me that I don't see sense in trying such a thing. Do you think that needs to be supported?
Yes! :-) It's not hard to do and it keeps the driver cleaner (IMNSHO). I don't think it is quite possible at the moment due to cache coherency issues, but with Becky's recently merged dma ops changes it should be fixable.
Quoted 8 lines
Could you elaborate on the cache coherency issues in MPC5121 FEC context? Especially how these issues are related to the driver binary compatibility.
MPC5121 support was added to
drivers/net/fs_enet. MPC52xx usesdrivers/net/fec_mpc52xx.c. Do you think that creating one universal driver from these two is now possible? You said that it should be easy, however you also said that cache coherency issues makes this imposible.
Not impossible. Hard.
The mpc5200 is a cache coherent part. Bestcomm memory accesses are noticed (snooped) by the cache, and it will flush out cache lines appropriately to maintain coherency.
The mpc5121 bus design is non-coherent. The e300 core is essentially the same as on the 5200, and the core can do snooping, but the multiport memory controller on the 5121 doesn't support bus snooping so the cache is not automatically maintained in a consistent state. On this part Linux needs to manually flush the relevant cache lines before initiating DMA transfers, and invalidiate them afterwards.
All of this doesn't actually affect the driver code at all. It's all handled by the kernel and the DMA apis. What it does affect is multiplatform kernels. The DMA behaviour is set at compile time, not run time, depending on the setting of CONFIG_NON_COHERENT_CACHE (see arch/powerpc/platforms/Kconfig.cputype). A kernel which has it on won't run properly on a platform which has it off, and visa-versa.
So, while the MPC5200 and MPC5121 (and MPC83xx) all have the same core, it isn't currently possible to build a single kernel which will boot on both the MPC5200 and the MPC5121. The solution (i think) is to kill CONFIG_NON_COHERENT_CACHE and have the platform setup code set the appropriate dmaops at platform init time.
Cheers,
g.
Quoted 5 lines
--
Best Regards.
Piotr Ziecik
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
Re: [PATCH 02/12] fs_enet: Add MPC5121 FEC support.
Quoted 7 lines · Grant Likely
All of this doesn't actually affect the driver code at all. It's all handled by the kernel and the DMA apis. What it does affect is multiplatform kernels. The DMA behaviour is set at compile time, not run time, depending on the setting of
CONFIG_NON_COHERENT_CACHE(seearch/powerpc/platforms/Kconfig.cputype). A kernel which has it on won't run properly on a platform which has it off, and visa-versa.
We are close to the point where we can make this a runtime option though, by just having a different set of dma_ops hooked in.
Cheers,
Ben.
Re: [PATCH 02/12] fs_enet: Add MPC5121 FEC support.
Quoted 4 lines · Tuesday 19 May 2009 00:17:31 Benjamin Herrenschmidt wrote:
We are close to the point where we can make this a runtime option though, by just having a different set of
dma_opshooked in.
Is somebody currently working on it? If yes, where we can see code ?
Signature · 2 lines
Best Regards. Piotr Zięcik
Re: [PATCH 02/12] fs_enet: Add MPC5121 FEC support.
Quoted 8 lines · Piotr Zięcik
Quoted 4 lines · Tuesday 19 May 2009 00:17:31 Benjamin Herrenschmidt wrote:
We are close to the point where we can make this a runtime option though, by just having a different set of
dma_opshooked in.Is somebody currently working on it? If yes, where we can see code ?
Well, the current upstream code has the dma ops support. Becky is massaging that more for swiotlb support which has been submitted to the linuxppc-dev list. We haven't yet added runtime support rather than compile time for non-cache coherent platforms, but it's becoming reasonably easy to add now (though still needs to be done).
Cheers,
Ben
Re: [PATCH 02/12] fs_enet: Add MPC5121 FEC support.
In reply to Grant LikelyQuoted 6 lines · Thursday 14 May 2009 16:00:33 Grant Likely wrote:
Quoted 4 lines
MPC5121 support was added to
drivers/net/fs_enet. MPC52xx usesdrivers/net/fec_mpc52xx.c. Do you think that creating one universal driver from these two is now possible? You said that it should be easy, however you also said that cache coherency issues makes this imposible.Not impossible. Hard.
I thought a bit more about merging FEC drivers and I see one problem more. Driver fs_enet works with FEC's with own DMA engine and fec_mpc52xx.c uses BestComm. Integration of these two drivers will need a DMA abstraction layer to keep everything clean. Unfortuanetly BestComm driver does not provide any abstraction - it only exports set of functions to deal with specific
hardware: FEC and PATA.
More #ifdef's will be needed to remove linking with BestComm driver if kernel will be compiled without 52xx support and resulting code will not be much better than existing one. Especially that new DMA abstraction layer probably will be quite complex.
Signature · 2 lines
Best Regards. Piotr Ziecik
Re: [PATCH 02/12] fs_enet: Add MPC5121 FEC support.
2009/5/21 Piotr Zięcik <[email protected]>:
Quoted 15 lines
Quoted 6 lines · Thursday 14 May 2009 16:00:33 Grant Likely wrote:
Quoted 4 lines
MPC5121 support was added to
drivers/net/fs_enet. MPC52xx usesdrivers/net/fec_mpc52xx.c. Do you think that creating one universal driver from these two is now possible? You said that it should be easy, however you also said that cache coherency issues makes this imposible.Not impossible. Hard.
I thought a bit more about merging FEC drivers and I see one problem more. Driver
fs_enetworks with FEC's with own DMA engine andfec_mpc52xx.cuses BestComm. Integration of these two drivers will need a DMA abstraction layer to keep everything clean. Unfortuanetly BestComm driver does not provide any abstraction - it only exports set of functions to deal with specific
hardware: FEC and PATA.
Quoted 4 lines
More #ifdef's will be needed to remove linking with BestComm driver if kernel will be compiled without 52xx support and resulting code will not be much better than existing one. Especially that new DMA abstraction layer probably will be quite complex.
If it looks too ugly, then just fork the driver.
g.
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
PATCH 3/12 fs_enet: Add FEC TX Alignment workaround for MPC5121.
In reply to Wolfgang DenkFrom: John Rigby <[email protected]>
The FEC on 5121 has problems with misaligned tx buffers. The RM says any alignment is ok but empirical results show that packet buffers ending in 0x1E will sometimes hang the FEC. Other bad alignment does not hang but will cause silent TX failures resulting in about a 1% packet loss as tested by ping -f from a remote host.
This patch is a work around that copies every tx packet to an aligned skb before sending.
--- drivers/net/fs_enet/Kconfig | 3 ++ drivers/net/fs_enet/fs_enet-main.c | 41 ++++++++++++++++++++++++++++++++++++ drivers/net/fs_enet/mac-fec.c | 2 +- 3 files changed, 45 insertions(+), 1 deletions(-)
drivers/net/fs_enet/Kconfig +3 -0
@@ -8,6 +8,9 @@ config FS_ENET_MPC5121_FEC def_bool y if (FS_ENET && PPC_MPC512x) select FS_ENET_HAS_FEC +config FS_ENET_FEC_TX_ALIGN_WORKAROUND + def_bool y if FS_ENET_MPC5121_FEC + config FS_ENET_HAS_SCC bool "Chip has an SCC usable for ethernet" depends on FS_ENET && (CPM1 || CPM2)
drivers/net/fs_enet/fs_enet-main.c +41 -0
53 lines not on this page · raw message
drivers/net/fs_enet/mac-fec.c +1 -1
@@ -311,7 +311,7 @@ static void restart(struct net_device *dev)* Enable big endian. */ #ifndef CONFIG_FS_ENET_MPC5121_FEC -/* Don't care about SDMA FC. */ +/* Don't care about SDMA Function Code. */ FW (fecp, fun_code,0x78000000 );#else FS (fecp, dma_control,0xC0000000 );
Signature · 1 line
1.6.0.6
Re: [PATCH 03/12] fs_enet: Add FEC TX Alignment workaround for MPC5121.
Quoted 11 lines · Wolfgang Denk
From: John Rigby <[email protected]>
The FEC on 5121 has problems with misaligned tx buffers. The RM says any alignment is ok but empirical results show that packet buffers ending in
0x1Ewill sometimes hang the FEC. Other bad alignment does not hang but will cause silent TX failures resulting in about a 1% packet loss as tested by ping -f from a remote host.This patch is a work around that copies every tx packet to an aligned skb before sending.
OUCH!
Quoted 28 lines
drivers/net/fs_enet/fs_enet-main.c +20
-0@@ -594,6 +594,37 @@ void fs_cleanup_bds(struct net_device *dev) /**********************************************************************************/ +#ifdef CONFIG_FS_ENET_FEC_TX_ALIGN_WORKAROUND +static struct sk_buff *tx_skb_align_workaround (struct net_device *dev, + struct sk_buff *skb) +{ + struct sk_buff *new_skb; + + /* Alloc new skb */ + new_skb = dev_alloc_skb(ENET_RX_FRSIZE + 32); + if (!new_skb) { + printk(KERN_WARNING DRV_MODULE_NAME + ": %s Memory squeeze, dropping tx packet.\n", + dev->name); + return NULL; + } + + /* Make sure new skb is properly aligned */ + skb_align(new_skb, 32); + + /* Copy data to new skb ... */ + skb_copy_from_linear_data(skb, new_skb->data, skb->len);
drivers/net/fs_enet/fs_enet-main.c void fs_cleanup_bds(struct net_device *dev) · line 626
Quoted 10 lines
drivers/net/fs_enet/fs_enet-main.c +10
-0+ skb_put(new_skb, skb->len); + + /* ... and free an old one */ + dev_kfree_skb_any(skb); + + return new_skb; +} +#else +#define tx_skb_align_workaround (dev, skb) (skb) +#endif
Another use of #ifdef blocks. What is the multiplatform impact?
g.
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
Re: [PATCH 03/12] fs_enet: Add FEC TX Alignment workaround for MPC5121.
Dear Grant Likely,
Quoted 8 lines · In message <[email protected]> you…
Quoted 8 lines
The FEC on 5121 has problems with misaligned tx buffers. The RM says any alignment is ok but empirical results show that packet buffers ending in
0x1Ewill sometimes hang the FEC. Other bad alignment does not hang but will cause silent TX failures resulting in about a 1% packet loss as tested by ping -f from a remote host.
Quoted 4 lines
Quoted 2 lines
This patch is a work around that copies every tx packet to an aligned skb before sending.
OUCH!
Yes :-(
Quoted 5 lines
drivers/net/fs_enet/fs_enet-main.c void fs_cleanup_bds(struct net_device *dev) · line 626
Quoted 3 lines
drivers/net/fs_enet/fs_enet-main.c +3
-0+#else +#define tx_skb_align_workaround (dev, skb) (skb) +#endif Another use of #ifdef blocks. What is the multiplatform impact?
Hm... Can you recommend a better way to solve the problem? Suggestions are welcome.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected] You don't have to worry about me. I might have been born yesterday... but I stayed up all night.
Re: [PATCH 03/12] fs_enet: Add FEC TX Alignment workaround for MPC5121.
Quoted 18 lines · Wolfgang Denk
Dear Grant Likely,
Quoted 8 lines · In message <[email protected]> you…
Quoted 8 lines
The FEC on 5121 has problems with misaligned tx buffers. The RM says any alignment is ok but empirical results show that packet buffers ending in
0x1Ewill sometimes hang the FEC. Other bad alignment does not hang but will cause silent TX failures resulting in about a 1% packet loss as tested by ping -f from a remote host.Quoted 4 lines
Quoted 2 lines
This patch is a work around that copies every tx packet to an aligned skb before sending.
OUCH!
Yes :-(
Quoted 8 lines
Quoted 5 lines
drivers/net/fs_enet/fs_enet-main.c void fs_cleanup_bds(struct net_device *dev) · line 626
Quoted 3 lines
drivers/net/fs_enet/fs_enet-main.c +3
-0+#else +#define tx_skb_align_workaround (dev, skb) (skb) +#endif Another use of #ifdef blocks. What is the multiplatform impact?
Hm... Can you recommend a better way to solve the problem? Suggestions are welcome.
I'd rather see a runtime selectable workaround. ie. enable it based on the compatible property.
g.
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
Re: [PATCH 03/12] fs_enet: Add FEC TX Alignment workaround for MPC5121.
I was having deja-vu with this and realized that I have fixed at least some of the objections to this patch.
Wolfgang you may want to look at the patch in my 5121 git tree here:
http://git.denx.de/?p=linux-mpc512x.git;a=commit;h=2950be3be42af7449941c3340998c27ef918f10f
It does runtime tx packet alignment It also has fewer ifdefs and trys to share more code. It also has a header that explains everything including that fact that there is not a runtime conflict sine the only other ppc that has fec is 8xx which is not in the same family.
Quoted 29 lines · Grant Likely
Quoted 3 lines · Wolfgang Denk
Dear Grant Likely,
In message <[email protected]>
Quoted 15 lines · you
Quoted 8 lines
Quoted 8 lines
The FEC on 5121 has problems with misaligned tx buffers. The RM says any alignment is ok but empirical results show that packet buffers ending in
0x1Ewill sometimes hang the FEC. Other bad alignment does not hang but will cause silent TX failures resulting in about a 1% packet loss as tested by ping -f from a remote host.Quoted 4 lines
Quoted 2 lines
This patch is a work around that copies every tx packet to an aligned skb before sending.
OUCH!
Yes :-(
Quoted 8 lines
Quoted 5 lines
drivers/net/fs_enet/fs_enet-main.c void fs_cleanup_bds(struct net_device *dev) · line 626
Quoted 3 lines
drivers/net/fs_enet/fs_enet-main.c +3
-0+#else +#define tx_skb_align_workaround (dev, skb) (skb) +#endif Another use of #ifdef blocks. What is the multiplatform impact?
Hm... Can you recommend a better way to solve the problem? Suggestions are welcome.
Quoted 9 lines
I'd rather see a runtime selectable workaround. ie. enable it based on the compatible property.
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev
PATCH 4/12 mpc5121: Added reset module registers representation.
In reply to Wolfgang DenkFrom: Piotr Ziecik <[email protected]>
--- arch/powerpc/include/asm/mpc512x.h | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-)
arch/powerpc/include/asm/mpc512x.h +13 -0
@@ -16,6 +16,19 @@#ifndef __ASM_POWERPC_MPC512x_H__#define __ASM_POWERPC_MPC512x_H__ +/* MPC512x Reset module registers */ +struct mpc512x_reset_module { +u32 rcwlr;/* Reset Configuration Word Low Register */ +u32 rcwhr;/* Reset Configuration Word High Register */ +u32 reserved1; +u32 reserved2; +u32 rsr;/* Reset Status Register */ +u32 rmr;/* Reset Mode Register */ +u32 rpr;/* Reset Protection Register */ +u32 rcr;/* Reset Control Register */ +u32 rcer;/* Reset Control Enable Register */ +} __attribute__ ((__packed__ )); +extern unsigned long mpc512x_find_ips_freq (struct device_node *node);#endif /* __ASM_POWERPC_MPC512x_H__ */
Signature · 1 line
1.6.0.6
Re: [PATCH 04/12] mpc5121: Added reset module registers representation.
Quoted 21 lines · Wolfgang Denk
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/include/asm/mpc512x.h | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-)arch/powerpc/include/asm/mpc512x.h +3
-0@@ -16,6 +16,19 @@ #ifndef __ASM_POWERPC_MPC512x_H__ #define __ASM_POWERPC_MPC512x_H__ +/* MPC512x Reset module registers */ +struct mpc512x_reset_module { + u32 rcwlr; /* Reset Configuration Word Low Register */
arch/powerpc/include/asm/mpc512x.h line 31
Quoted 10 lines
arch/powerpc/include/asm/mpc512x.h +10
-0+u32 rcwhr;/* Reset Configuration Word High Register */ +u32 reserved1; +u32 reserved2; +u32 rsr;/* Reset Status Register */ +u32 rmr;/* Reset Mode Register */ +u32 rpr;/* Reset Protection Register */ +u32 rcr;/* Reset Control Register */ +u32 rcer;/* Reset Control Enable Register */ +} __attribute__ ((__packed__)); +
83xx has the same registers; we should define it in a non-512x-specific header.
-Scott
Re: [PATCH 04/12] mpc5121: Added reset module registers representation.
Dear Scott,
Quoted 3 lines · in message <[email protected]> you wrote:
Quoted 3 lines
arch/powerpc/include/asm/mpc512x.h +0
-0
...
Quoted 2 lines
83xx has the same registers; we should define it in a non-512x-specific header.
Agreed. Any suggestion where?
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected] I know engineers. They love to change things. - Dr. McCoy
Re: [PATCH 04/12] mpc5121: Added reset module registers representation.
In reply to Wolfgang DenkQuoted 6 lines · Wolfgang Denk
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]>
No patch description. I would also like to see this patch merged with the actual user of it since it is so small.
arch/powerpc/include/as=
Quoted 5 lines
---
=A0arch/powerpc/include/asm/mpc512x.h | =A0 13 +++++++++++++ =A01 files changed, 13 insertions(+), 0 deletions(-)arch/powerpc/include/as= renamed from arch/powerpc/include/asm/mpc512x.h +0
-0
m/mpc512x.h
arch/powerpc/include/asm/mpc512x.h
Quoted 10 lines
index c48a165..ea50d8d 100644
arch/powerpc/include/asm/mpc512x.h +0
-0@@ -16,6 +16,19 @@=A0#ifndef
__ASM_POWERPC_MPC512x_H__=A0#define__ASM_POWERPC_MPC512x_H__arch/powerpc/include/asm/mpc512x.h +3
-0+/* MPC512x Reset module registers */ +struct mpc512x_reset_module { + =A0 =A0 =A0 u32 =A0 =A0 rcwlr; =A0/* Reset Configuration Word Low Regis=
ter */
Quoted 1 line
+ =A0 =A0 =A0 u32 =A0 =A0 rcwhr; =A0/* Reset Configuration Word High Regi=
ster */
Quoted 8 lines
+ =A0 =A0 =A0 u32 =A0 =A0 reserved1;
+ =A0 =A0 =A0 u32 =A0 =A0 reserved2;
+ =A0 =A0 =A0 u32 =A0 =A0 rsr; =A0 =A0/* Reset Status Register */
+ =A0 =A0 =A0 u32 =A0 =A0 rmr; =A0 =A0/* Reset Mode Register */
+ =A0 =A0 =A0 u32 =A0 =A0 rpr; =A0 =A0/* Reset Protection Register */
+ =A0 =A0 =A0 u32 =A0 =A0 rcr; =A0 =A0/* Reset Control Register */
+ =A0 =A0 =A0 u32 =A0 =A0 rcer; =A0 /* Reset Control Enable Register */ +}__attribute__((__packed__));
__attribute__((__packed__)); is unnecessary.
g.
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
Re: [PATCH 04/12] mpc5121: Added reset module registers representation.
Dear Grant Likely,
Quoted 3 lines · In message <[email protected]> you…
No patch description. I would also like to see this patch merged with the actual user of it since it is so small.
Will do. As for description - the Subject says it all.
Quoted 3 lines
Quoted 1 line
+}
__attribute__((__packed__));__attribute__((__packed__)); is unnecessary.
OK.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected] Applying computer technology is simply finding the right wrench to pound in the correct screw.
PATCH 5/12 mpc5121ads: Added Reset Module node to DTS.
In reply to Wolfgang DenkFrom: Piotr Ziecik <[email protected]>
--- arch/powerpc/boot/dts/mpc5121ads.dts | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
arch/powerpc/boot/dts/mpc5121ads.dts +5 -0
@@ -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 · 1 line
1.6.0.6
Re: [PATCH 05/12] mpc5121ads: Added Reset Module node to DTS.
Quoted 6 lines · Wolfgang Denk
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]>
Missing patch description. Otherwise looks okay.
g.
arch/powerpc/boot/dts=
Quoted 5 lines
---
=A0arch/powerpc/boot/dts/mpc5121ads.dts | =A0 =A05 +++++ =A01 files changed, 5 insertions(+), 0 deletions(-)arch/powerpc/boot/dts= renamed from arch/powerpc/boot/dts/mpc5121ads.dts +0
-0
/mpc5121ads.dts
Quoted 5 lines
index c2b8dbf..1b83a9d 100644
arch/powerpc/boot/dts/mpc5121ads.dts +0
-0@@ -166,6 +166,11 @@=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D < &ip=
ic >;
Quoted 4 lines
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0};
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 reset@e00 { =A0 =A0 // Reset module
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 compatible =3D "fsl,mpc5121=
-reset";
Quoted 5 lines
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 reg =3D <
0xe000x100>;
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 };
+
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0clock@f00 { =A0 =A0 // Clock control =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0compatible =3D "fsl,mpc512=
1-clock";
Quoted 5 lines
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0reg =3D <
0xf000x100>; --
1.6.0.6
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
Re: [PATCH 05/12] mpc5121ads: Added Reset Module node to DTS.
Dear Grant Likely,
Quoted 9 lines · In message <[email protected]> you…
Quoted 6 lines · Wolfgang Denk
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]>Missing patch description. Otherwise looks okay.
This is a repeating complaint. Do I really need an extra description for a trivial patch that does exactly what the Subject: says?
What is recommended practice in such a case?
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected] The software required `Windows 95 or better', so I installed Linux.
Re: [PATCH 05/12] mpc5121ads: Added Reset Module node to DTS.
Quoted 3 lines · Wolfgang Denk
Dear Grant Likely,
In message <[email protected]> =
Quoted 8 lines · you
Quoted 8 lines · Wolfgang Denk
Quoted 6 lines
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]>
Quoted 4 lines
Quoted 1 line
Missing patch description. =A0Otherwise looks okay.
This is a repeating complaint. Do I really need an extra =A0description for a trivial patch that does exactly what the Subject: says?
Fair enough. I was going through your series pretty quickly and this one doesn't really need it.
However, in this particular case, I think I would rather see both .dts rework patches put into the same patch so it can be reviewed all at once.
g.
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
PATCH 6/12 mpc5121: Added NAND Flash Controller driver.
In reply to Wolfgang DenkFrom: Piotr Ziecik <[email protected]>
This patch adds NAND Flash Controller driver for MPC5121 revision 2. All device features, except hardware ECC and power management, are supported.
--- arch/powerpc/include/asm/mpc5121_nfc.h | 100 +++ arch/powerpc/platforms/512x/mpc512x_shared.c | 1 + drivers/mtd/nand/Kconfig | 7 + drivers/mtd/nand/Makefile | 1 + drivers/mtd/nand/mpc5121_nfc.c | 855 ++++++++++++++++++++++++++ 5 files changed, 964 insertions(+), 0 deletions(-) create mode 100644 arch/powerpc/include/asm/mpc5121_nfc.h create mode 100644 drivers/mtd/nand/mpc5121_nfc.c
arch/powerpc/include/asm/mpc5121_nfc.h new file +100 -0
@@ -0,0 +1,100 @@ +/* +* Copyright 2004-2008 Freescale Semiconductor, Inc. +* Copyright 2009 Semihalf. +* +* Approved as OSADL project by a majority of OSADL members and funded +* by OSADL membership fees in 2009; for details see www.osadl.org. +* +* Based on original driver from Freescale Semiconductor +* written by John Rigby <[email protected]> on basis +* of drivers/mtd/nand/mxc_nand.c. Reworked and extended by +* Piotr Ziecik <[email protected]>. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +* MA 02110-1301, USA. +*/ + +#ifndef MPC5121_NFC_H +#define MPC5121_NFC_H + +/* Addresses for NFC MAIN RAM BUFFER areas */ +#define NFC_MAIN_AREA (n) ((n) * 0x200) + +/* Addresses for NFC SPARE BUFFER areas */ +#define NFC_SPARE_BUFFERS 8 +#define NFC_SPARE_LEN 0x40 +#define NFC_SPARE_AREA (n) (0x1000 + ((n) * NFC_SPARE_LEN)) + +/* MPC5121 NFC registers */ +#define NFC_BUF_ADDR 0x1E04 +#define NFC_FLASH_ADDR 0x1E06 +#define NFC_FLASH_CMD 0x1E08 +#define NFC_CONFIG 0x1E0A +#define NFC_ECC_STATUS1 0x1E0C +#define NFC_ECC_STATUS2 0x1E0E +#define NFC_SPAS 0x1E10 +#define NFC_WRPROT 0x1E12 +#define NFC_NF_WRPRST 0x1E18 +#define NFC_CONFIG1 0x1E1A +#define NFC_CONFIG2 0x1E1C +#define NFC_UNLOCKSTART_BLK0 0x1E20 +#define NFC_UNLOCKEND_BLK0 0x1E22 +#define NFC_UNLOCKSTART_BLK1 0x1E24 +#define NFC_UNLOCKEND_BLK1 0x1E26 +#define NFC_UNLOCKSTART_BLK2 0x1E28 +#define NFC_UNLOCKEND_BLK2 0x1E2A +#define NFC_UNLOCKSTART_BLK3 0x1E2C +#define NFC_UNLOCKEND_BLK3 0x1E2E + +/* Bit Definitions: NFC_BUF_ADDR */ +#define NFC_RBA_MASK (7 << 0) +#define NFC_ACTIVE_CS_SHIFT 5 +#define NFC_ACTIVE_CS_MASK (3 << NFC_ACTIVE_CS_SHIFT) + +/* Bit Definitions: NFC_CONFIG */ +#define NFC_BLS_UNLOCKED (1 << 1) + +/* Bit Definitions: NFC_CONFIG1 */ +#define NFC_ECC_4BIT (1 << 0) +#define NFC_FULL_PAGE_DMA (1 << 1) +#define NFC_SPARE_ONLY (1 << 2) +#define NFC_ECC_ENABLE (1 << 3) +#define NFC_INT_MASK (1 << 4) +#define NFC_BIG_ENDIAN (1 << 5) +#define NFC_RESET (1 << 6) +#define NFC_CE (1 << 7) +#define NFC_ONE_CYCLE (1 << 8) +#define NFC_PPB_32 (0 << 9) +#define NFC_PPB_64 (1 << 9) +#define NFC_PPB_128 (2 << 9) +#define NFC_PPB_256 (3 << 9) +#define NFC_PPB_MASK (3 << 9) +#define NFC_FULL_PAGE_INT (1 << 11) + +/* Bit Definitions: NFC_CONFIG2 */ +#define NFC_COMMAND (1 << 0) +#define NFC_ADDRESS (1 << 1) +#define NFC_INPUT (1 << 2) +#define NFC_OUTPUT (1 << 3) +#define NFC_ID (1 << 4) +#define NFC_STATUS (1 << 5) +#define NFC_CMD_FAIL (1 << 15) +#define NFC_INT (1 << 15) + +/* Bit Definitions: NFC_WRPROT */ +#define NFC_WPC_LOCK_TIGHT (1 << 0) +#define NFC_WPC_LOCK (1 << 1) +#define NFC_WPC_UNLOCK (1 << 2) + +#endif /* MPC5121_NFC_H */
arch/powerpc/platforms/512x/mpc512x_shared.c +1 -0
@@ -71,6 +71,7 @@ void __init mpc512x_init_IRQ(void)static struct of_device_id __initdata of_bus_ids[] = { { .compatible ="fsl,mpc5121-immr" , }, { .compatible ="fsl,mpc5121-localbus" , }, + { .compatible ="fsl,mpc5121-nfc" , }, {}, };
drivers/mtd/nand/Kconfig +7 -0
@@ -413,6 +413,13 @@ config MTD_NAND_FSL_UPM Enables support for NAND Flash chips wired onto Freescale PowerPC processor localbus with User-Programmable Machine support. +config MTD_NAND_MPC5121_NFC + tristate "MPC5121 built-in NAND Flash Controller support" + depends on PPC_MPC512x + help + This enables the driver for the NAND flash controller on the + MPC5121 SoC. + config MTD_NAND_MXC tristate "MXC NAND support" depends on ARCH_MX2 || ARCH_MX3
drivers/mtd/nand/Makefile +1 -0
@@ -39,5 +39,6 @@ obj-$(CONFIG_MTD_NAND_SH_FLCTL) += sh_flctl.o obj-$(CONFIG_MTD_NAND_MXC) += mxc_nand.o obj-$(CONFIG_MTD_NAND_SOCRATES) += socrates_nand.o obj-$(CONFIG_MTD_NAND_TXX9NDFMC) += txx9ndfmc.o +obj-$(CONFIG_MTD_NAND_MPC5121_NFC) += mpc5121_nfc.o nand-objs := nand_base.o nand_bbt.o
drivers/mtd/nand/mpc5121_nfc.c new file +855 -0
855 lines not on this page · raw message
Signature · 1 line
1.6.0.6
Re: [PATCH 06/12] mpc5121: Added NAND Flash Controller driver.
Quoted 11 lines · Wolfgang Denk
From: Piotr Ziecik <[email protected]>
This patch adds NAND Flash Controller driver for MPC5121 revision 2. All device features, except hardware ECC and power management, are supported.
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]>
Quoted 4 lines
---
=A0arch/powerpc/include/asm/mpc5121_nfc.h =A0 =A0 =A0 | =A0100 +++ =A0arch/powerpc/platforms/512x/mpc512x_shared.c | =A0 =A01 + =A0drivers/mtd/nand/Kconfig =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0=
=A07 +
Quoted 1 line
=A0drivers/mtd/nand/Makefile =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0=
=A01 +
Quoted 1 line
=A0drivers/mtd/nand/mpc5121_nfc.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0855 ++=
++++++++++++++++++++++++
arch/powerpc/includ=
Quoted 5 lines
=A05 files changed, 964 insertions(+), 0 deletions(-) =A0create mode 100644
arch/powerpc/include/asm/mpc5121_nfc.h=A0create mode 100644drivers/mtd/nand/mpc5121_nfc.carch/powerpc/includ= renamed from arch/powerpc/include/asm/mpc5121_nfc.h +0
-0
e/asm/mpc5121_nfc.h
arch/powerpc/include/asm/mpc5121_nfc.h
Quoted 4 lines
new file mode 100644
index 0000000..b96a5b9arch/powerpc/include/asm/mpc5121_nfc.h new file +0
-0
[... bunch of #defines trimmed]
There is only one user of this. It should be moved into the driver .c file. Otherwise okay.
arch/powerpc/=
Quoted 1 line
arch/powerpc/= renamed from arch/powerpc/platforms/512x/mpc512x_shared.c +0
-0
platforms/512x/mpc512x_shared.c
arch/powerpc/platforms/512x/mpc512x_shared.c void __init mpc512x_init_IRQ(void) · line 74
Quoted 8 lines
index d8cd579..7135d89 100644
arch/powerpc/platforms/512x/mpc512x_shared.c +1
-0@@ -71,6 +71,7 @@ void __init mpc512x_init_IRQ(void) =A0static struct of_device_id __initdata of_bus_ids[] =3D { =A0 =A0 =A0 =A0{ .compatible =3D "fsl,mpc5121-immr", }, =A0 =A0 =A0 =A0{ .compatible =3D "fsl,mpc5121-localbus", }, + =A0 =A0 =A0 { .compatible =3D "fsl,mpc5121-nfc", },
This doesn't look right. Shouldn't the NAND controller be hanging of the IMMR node?
drivers/mtd/nand/mpc5121_nf=
Quoted 4 lines
arch/powerpc/platforms/512x/mpc512x_shared.c +0
-0=A0 =A0 =A0 =A0{}, =A0};drivers/mtd/nand/mpc5121_nf= renamed from drivers/mtd/nand/mpc5121_nfc.c +0
-0
c.c
Quoted 35 lines
new file mode 100644
index 0000000..a8da4dbdrivers/mtd/nand/mpc5121_nfc.c new file +30
-0@@ -0,0 +1,855 @@ +/* +* Copyright 2004-2008 Freescale Semiconductor, Inc. +* Copyright 2009 Semihalf. +* +* Based on original driver from Freescale Semiconductor +* written by John Rigby <[email protected]> on basis +* of drivers/mtd/nand/mxc_nand.c. Reworked and extended +* Piotr Ziecik <[email protected]>. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +* MA 02110-1301, USA. +*/ + +#include <linux/module.h> +#include <linux/clk.h> +#include <linux/delay.h> +#include <linux/init.h> +#include <linux/interrupt.h> +#include <linux/io.h>
drivers/mtd/nand/mpc5121_nfc.c line 40
Quoted 10 lines
drivers/mtd/nand/mpc5121_nfc.c new file +10
-0+#include <linux/mtd/mtd.h> +#include <linux/mtd/nand.h> +#include <linux/mtd/partitions.h> +#include <linux/of_device.h> +#include <linux/of_platform.h> + +#include <asm/mpc512x.h> +#include <asm/mpc5121_nfc.h> + +#define =A0 =A0 =A0 =A0DRV_NAME =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"mpc5121_=
nfc"
drivers/mtd/nand/mpc5121_nfc.c line 41
Quoted 1 line
drivers/mtd/nand/mpc5121_nfc.c new file +1
-0+#define =A0 =A0 =A0 =A0DRV_VERSION =A0 =A0 =A0 =A0 =A0 =A0 "0.5"
Is this really necessary (especially the DRV_VERSION thing)?
drivers/mtd/nand/mpc5121_nfc.c line 52
Quoted 11 lines
drivers/mtd/nand/mpc5121_nfc.c new file +11
-0+/* Wait for operation complete */ +static void mpc5121_nfc_done(struct mtd_info *mtd) +{ + =A0 =A0 =A0 struct nand_chip *chip =3D mtd->priv; + =A0 =A0 =A0 struct mpc5121_nfc_prv *prv =3D chip->priv; + =A0 =A0 =A0 int rv; + + =A0 =A0 =A0 if ((nfc_read(mtd, NFC_CONFIG2) & NFC_INT) =3D=3D 0) { + =A0 =A0 =A0 =A0 =A0 =A0 =A0 nfc_clear(mtd, NFC_CONFIG1, NFC_INT_MASK); + =A0 =A0 =A0 =A0 =A0 =A0 =A0 rv =3D wait_event_timeout(prv->irq_waitq, + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (nfc_read(mtd, NFC_CONFIG2)=
& NFC_INT), NFC_TIMEOUT);
drivers/mtd/nand/mpc5121_nfc.c line 55
Quoted 3 lines
drivers/mtd/nand/mpc5121_nfc.c new file +3
-0+ + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!rv) + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 printk(KERN_WARNING DRV_NAM=
E
Throughout this driver printk() calls should really be dev_*() calls.
Quoted 9 lines
drivers/mtd/nand/mpc5121_nfc.c new file +9
-0+/* +* Read NFC configuration from Reset Config Word +* +* NFC is configured during reset in basis of information stored +* in Reset Config Word. There is no other way to set NAND block +* size, spare size and bus width. +*/ +static int mpc5121_nfc_read_hw_config (struct mtd_info *mtd) +{
drivers/mtd/nand/mpc5121_nfc.c
Quoted 10 lines
drivers/mtd/nand/mpc5121_nfc.c new file +10
-0+ =A0 =A0 =A0 struct nand_chip *chip =3D mtd->priv; + =A0 =A0 =A0 struct mpc512x_reset_module *rm; + =A0 =A0 =A0 struct device_node *rmnode; + =A0 =A0 =A0 uint rcw_pagesize =3D 0; + =A0 =A0 =A0 uint rcw_sparesize =3D 0; + =A0 =A0 =A0 uint rcw_width; + =A0 =A0 =A0 uint rcwh; + =A0 =A0 =A0 uint romloc, ps; + + =A0 =A0 =A0 rmnode =3D of_find_compatible_node(NULL, NULL, "fsl,mpc5121=
-reset");
drivers/mtd/nand/mpc5121_nfc.c line 76
Quoted 2 lines
drivers/mtd/nand/mpc5121_nfc.c new file +2
-0+ =A0 =A0 =A0 if (!rmnode) { + =A0 =A0 =A0 =A0 =A0 =A0 =A0 printk(KERN_ERR DRV_NAME ": Missing 'fsl,mp=
c5121-reset' "
drivers/mtd/nand/mpc5121_nfc.c line 77
Quoted 1 line
drivers/mtd/nand/mpc5121_nfc.c new file +1
-0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
=A0 =A0 =A0 =A0 =A0 "node in device tree!\n");
drivers/mtd/nand/mpc5121_nfc.c line 79
Quoted 2 lines
drivers/mtd/nand/mpc5121_nfc.c new file +2
-0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -ENODEV; + =A0 =A0 =A0 }
A little ugly, but I won't gripe too much about it. I'd rather see a platform code export some kind of api for manipulating the reset module (I assume that multiple drivers will need to fiddle with it), but I'm willing to be pragmatic here in the interest of getting it merged. It can always be reworked later with little risk.
drivers/mtd/nand/mpc5121_nfc.c line 87
Quoted 8 lines
drivers/mtd/nand/mpc5121_nfc.c new file +8
-0+static struct of_platform_driver mpc5121_nfc_driver =3D { + =A0 =A0 =A0 .owner =A0 =A0 =A0 =A0 =A0=3D THIS_MODULE, + =A0 =A0 =A0 .name =A0 =A0 =A0 =A0 =A0 =3D DRV_NAME, + =A0 =A0 =A0 .match_table =A0 =A0=3D mpc5121_nfc_match, + =A0 =A0 =A0 .probe =A0 =A0 =A0 =A0 =A0=3D mpc5121_nfc_probe, + =A0 =A0 =A0 .remove =A0 =A0 =A0 =A0 =3D __exit_p(mpc5121_nfc_remove), + =A0 =A0 =A0 .suspend =A0 =A0 =A0 =A0=3D NULL, + =A0 =A0 =A0 .resume =A0 =A0 =A0 =A0 =3D NULL,
2 unnecessary lines. gcc initializes unset fields to 0.
drivers/mtd/nand/mpc5121_nfc.c line 91
Quoted 4 lines
drivers/mtd/nand/mpc5121_nfc.c new file +4
-0+ =A0 =A0 =A0 .driver =A0 =A0 =A0 =A0 =3D { + =A0 =A0 =A0 =A0 =A0 =A0 =A0 .name =A0 =3D DRV_NAME, + =A0 =A0 =A0 =A0 =A0 =A0 =A0 .owner =A0=3D THIS_MODULE, + =A0 =A0 =A0 },
Duplicate settings. Don't need to set both .name/.owner and .driver.name and .driver.owner.
drivers/mtd/nand/mpc5121_nfc.c
Quoted 5 lines
drivers/mtd/nand/mpc5121_nfc.c new file +5
-0+}; + +static int __init mpc5121_nfc_init(void) +{ + =A0 =A0 =A0 if (of_register_platform_driver(&mpc5121_nfc_driver) !=3D 0=
) {
drivers/mtd/nand/mpc5121_nfc.c line 97
Quoted 1 line
drivers/mtd/nand/mpc5121_nfc.c new file +1
-0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 printk(KERN_ERR DRV_NAME ": Driver register=
failed!\n");
drivers/mtd/nand/mpc5121_nfc.c line 100
Quoted 3 lines
drivers/mtd/nand/mpc5121_nfc.c new file +3
-0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -ENODEV; + =A0 =A0 =A0 } + =A0 =A0 =A0 return 0;
Heh. "return of_register_platform_driver(&mpc5121_nfc_driver);" is sufficient and accepted here.
drivers/mtd/nand/mpc5121_nfc.c line 849
Quoted 8 lines
drivers/mtd/nand/mpc5121_nfc.c new file +8
-0+} + +static void __exit mpc5121_nfc_cleanup(void) +{ + =A0 =A0 =A0 of_unregister_platform_driver(&mpc5121_nfc_driver); +} + +module_init (mpc5121_nfc_init);
Please move this line to just below the mpc5121_nfc_init function.
drivers/mtd/nand/mpc5121_nfc.c line 855
Quoted 6 lines
drivers/mtd/nand/mpc5121_nfc.c new file +6
-0+module_exit (mpc5121_nfc_cleanup); + +MODULE_AUTHOR ("Freescale Semiconductor, Inc." ); +MODULE_DESCRIPTION ("MPC5121 NAND MTD driver" ); +MODULE_LICENSE ("GPL" ); +MODULE_VERSION (DRV_VERSION );
As I alluded to above, I really don't like the MODULE_VERSION think in mainline code.
I only skimmed the driver, but that being said, other than my comments it looks pretty good to me.
g.
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
Re: [PATCH 06/12] mpc5121: Added NAND Flash Controller driver.
Quoted 4 lines · Grant Likely
Review
Quoted 3 lines
(quoted diff) +0
-0
b/arch/powerpc/platforms/512x/mpc512x_shared.c
Quoted 12 lines
arch/powerpc/platforms/512x/mpc512x_shared.c void __init mpc512x_init_IRQ(void) · line 74
Quoted 8 lines
index d8cd579..7135d89 100644
arch/powerpc/platforms/512x/mpc512x_shared.c +1
-0@@ -71,6 +71,7 @@ void __init mpc512x_init_IRQ(void)static struct of_device_id __initdata of_bus_ids[] = { { .compatible ="fsl,mpc5121-immr" , }, { .compatible ="fsl,mpc5121-localbus" , }, + { .compatible ="fsl,mpc5121-nfc" , },This doesn't look right. Shouldn't the NAND controller be hanging of the IMMR node?
I just wanted to confirm that NFC is in its own memory space. It has its
own mapping and is not part of the IMMR space.
Re: [PATCH 06/12] mpc5121: Added NAND Flash Controller driver.
Quoted 20 lines · John Rigby
Quoted 15 lines · Grant Likely
arch/powerpc/platforms/512x/mpc512x_shared.c void __init mpc512x_init_IRQ(void) · line 74
Quoted 12 lines
arch/powerpc/platforms/512x/mpc512x_shared.c +1
-0@@ -71,6 +71,7 @@ void __init mpc512x_init_IRQ(void) =A0static struct of_device_id __initdata of_bus_ids[] =3D { =A0 =A0 =A0 =A0{ .compatible =3D "fsl,mpc5121-immr", }, =A0 =A0 =A0 =A0{ .compatible =3D "fsl,mpc5121-localbus", }, + =A0 =A0 =A0 { .compatible =3D "fsl,mpc5121-nfc", },This doesn't look right. =A0Shouldn't the NAND controller be hanging of the IMMR node?
Quoted 1 line
I just wanted to confirm that NFC is in its own memory space. =A0 It has =
its
Quoted 1 line
own mapping and is not part of the IMMR space.
Hmmm... I wonder then if it might be better to have an IPB node, and hang all the IPB connected nodes off of it.
g.
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
Re: [PATCH 06/12] mpc5121: Added NAND Flash Controller driver.
In reply to Wolfgang DenkQuoted 33 lines · On Wednesday 06 May 2009 22:15:13 Wolfgang Denk wrote:
drivers/mtd/nand/mpc5121_nfc.c new file +30
-0+/* Init external chip select logic on ADS5121 board */ +static int ads5121_chipselect_init (struct mtd_info *mtd) +{ +struct nand_chip *chip = mtd->priv; +struct mpc5121_nfc_prv *prv = chip->priv; +struct device_node *dn; + + dn =of_find_compatible_node (NULL ,NULL ,"fsl,mpc5121ads-cpld" ); +if (dn) { + prv->csreg =of_iomap (dn,0 ); +of_node_put (dn); +if (!prv->csreg) +return -ENOMEM ; + +/* CPLD Register 9 controls NAND /CE Lines */ + prv->csreg +=9 ; +return 0 ; + } + +return -EINVAL ; +} + +/* Control chips select signal on ADS5121 board */ +static void ads5121_select_chip (struct mtd_info *mtd,int chip) +{ +struct nand_chip *nand = mtd->priv; +struct mpc5121_nfc_prv *prv = nand->priv; +u8 v; + + v =in_8 (prv->csreg);
drivers/mtd/nand/mpc5121_nfc.c line 250
Quoted 10 lines
drivers/mtd/nand/mpc5121_nfc.c new file +10
-0+ v |=0x0F ; + +if (chip >=0 ) { +mpc5121_nfc_select_chip (mtd,0 ); + v &= ~(1 << chip); + }else +mpc5121_nfc_select_chip (mtd,-1 ); + +out_8 (prv->csreg, v); +}
I am just a humble beginner, but isn't this platform dependend code supposed to be in /arch/powerpc/platforms/.... ?
Quoted 96 lines
[...]
drivers/mtd/nand/mpc5121_nfc.c new file +95
-0+static int __init mpc5121_nfc_probe (struct of_device *op, +const struct of_device_id *match) +{ +struct device_node *rootnode, *dn = op->node; +struct device *dev = &op->dev; +struct mpc5121_nfc_prv *prv; +struct resource res; +struct mtd_info *mtd; +#ifdef CONFIG_MTD_PARTITIONS +struct mtd_partition *parts; +#endif +struct nand_chip *chip; +unsigned long regs_paddr, regs_size; +const uint *chips_no; +int resettime =0 ; +int retval =0 ; +int rev, len; + +/* +* Check SoC revision. This driver supports only NFC +* in MPC5121 revision 2. +*/ + rev = (mfspr (SPRN_SVR ) >>4 ) &0xF ; +if (rev !=2 ) { + printk(KERN_ERR DRV_NAME + ": SoC revision %u is not supported!\n", rev); +return -ENXIO ; + } + + prv =devm_kzalloc (dev,sizeof (*prv),GFP_KERNEL ); +if (!prv) { + printk(KERN_ERR DRV_NAME ": Memory exhausted!\n"); +return -ENOMEM ; + } + + mtd = &prv->mtd; + chip = &prv->chip; + + mtd->priv = chip; + chip->priv = prv; + +/* Read NFC configuration from Reset Config Word */ + retval =mpc5121_nfc_read_hw_config (mtd); +if (retval) { + printk(KERN_ERR DRV_NAME ": Unable to read NFC config!\n"); +return retval; + } + + prv->irq =irq_of_parse_and_map (dn,0 ); +if (prv->irq ==NO_IRQ ) { + printk(KERN_ERR DRV_NAME ": Error mapping IRQ!\n"); +return -EINVAL ; + } + + retval =of_address_to_resource (dn,0 , &res); +if (retval) { + printk(KERN_ERR DRV_NAME ": Error parsing memory region!\n"); +return retval; + } + + chips_no =of_get_property (dn,"chips" , &len); +if (!chips_no || len !=sizeof (*chips_no)) { + printk(KERN_ERR DRV_NAME ": Invalid/missing 'chips' " + "property!\n"); +return -EINVAL ; + } + + regs_paddr = res.start; + regs_size = res.end - res.start +1 ; + +if (!devm_request_mem_region (dev, regs_paddr, regs_size,DRV_NAME )) { + printk(KERN_ERR DRV_NAME ": Error requesting memory region!\n"); +return -EBUSY ; + } + + prv->regs =devm_ioremap (dev, regs_paddr, regs_size); +if (!prv->regs) { + printk(KERN_ERR DRV_NAME ": Error mapping memory region!\n"); +return -ENOMEM ; + } + + mtd->name ="MPC5121 NAND" ; + chip->dev_ready = mpc5121_nfc_dev_ready; + chip->cmdfunc = mpc5121_nfc_command; + chip->read_byte = mpc5121_nfc_read_byte; + chip->read_word = mpc5121_nfc_read_word; + chip->read_buf = mpc5121_nfc_read_buf; + chip->write_buf = mpc5121_nfc_write_buf; + chip->verify_buf = mpc5121_nfc_verify_buf; + chip->select_chip = mpc5121_nfc_select_chip; + chip->options =NAND_NO_AUTOINCR |NAND_USE_FLASH_BBT ; + chip->ecc.mode =NAND_ECC_SOFT ; + +/* Support external chip-select logic on ADS5121 board */ + rootnode =of_find_node_by_path ("/" );
drivers/mtd/nand/mpc5121_nfc.c line 682
Quoted 10 lines
drivers/mtd/nand/mpc5121_nfc.c new file +10
-0+if (of_device_is_compatible (rootnode,"fsl,mpc5121ads" )) { + retval =ads5121_chipselect_init (mtd); +if (retval) { + printk(KERN_ERR DRV_NAME ": Chipselect init error!\n"); +of_node_put (rootnode); +return retval; + } + + chip->select_chip = ads5121_select_chip; + }
Hmmm, I guess it would be overkill to build some sort of generic framework for providing special chip-select functions here.... but it just doesn't look clean like this.... oh well.
Best regards,
Signature · 2 lines
David Jander Protonic Holland.
Re: [PATCH 06/12] mpc5121: Added NAND Flash Controller driver.
In reply to Wolfgang DenkDid you choose to not support hardware ECC so you could use the spare area? The original driver only supported hardware ECC but unfortuneatly the hardware ECC includes the spare area so the spare area cannot be written separately.
Quoted 1,065 lines · Wolfgang Denk
From: Piotr Ziecik <[email protected]>
This patch adds NAND Flash Controller driver for MPC5121 revision 2. All device features, except hardware ECC and power management, are supported.
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]>--- arch/powerpc/include/asm/mpc5121_nfc.h | 100 +++ arch/powerpc/platforms/512x/mpc512x_shared.c | 1 + drivers/mtd/nand/Kconfig | 7 + drivers/mtd/nand/Makefile | 1 + drivers/mtd/nand/mpc5121_nfc.c | 855 ++++++++++++++++++++++++++ 5 files changed, 964 insertions(+), 0 deletions(-) create mode 100644 arch/powerpc/include/asm/mpc5121_nfc.h create mode 100644 drivers/mtd/nand/mpc5121_nfc.carch/powerpc/include/asm/mpc5121_nfc.h new file +100
-0@@ -0,0 +1,100 @@ +/* +* Copyright 2004-2008 Freescale Semiconductor, Inc. +* Copyright 2009 Semihalf. +* +* Approved as OSADL project by a majority of OSADL members and funded +* by OSADL membership fees in 2009; for details see www.osadl.org. +* +* Based on original driver from Freescale Semiconductor +* written by John Rigby <[email protected]> on basis +* of drivers/mtd/nand/mxc_nand.c. Reworked and extended by +* Piotr Ziecik <[email protected]>. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +* MA 02110-1301, USA. +*/ + +#ifndef MPC5121_NFC_H +#define MPC5121_NFC_H + +/* Addresses for NFC MAIN RAM BUFFER areas */ +#define NFC_MAIN_AREA (n) ((n) * 0x200) + +/* Addresses for NFC SPARE BUFFER areas */ +#define NFC_SPARE_BUFFERS 8 +#define NFC_SPARE_LEN 0x40 +#define NFC_SPARE_AREA (n) (0x1000 + ((n) * NFC_SPARE_LEN)) + +/* MPC5121 NFC registers */ +#define NFC_BUF_ADDR 0x1E04 +#define NFC_FLASH_ADDR 0x1E06 +#define NFC_FLASH_CMD 0x1E08 +#define NFC_CONFIG 0x1E0A +#define NFC_ECC_STATUS1 0x1E0C +#define NFC_ECC_STATUS2 0x1E0E +#define NFC_SPAS 0x1E10 +#define NFC_WRPROT 0x1E12 +#define NFC_NF_WRPRST 0x1E18 +#define NFC_CONFIG1 0x1E1A +#define NFC_CONFIG2 0x1E1C +#define NFC_UNLOCKSTART_BLK0 0x1E20 +#define NFC_UNLOCKEND_BLK0 0x1E22 +#define NFC_UNLOCKSTART_BLK1 0x1E24 +#define NFC_UNLOCKEND_BLK1 0x1E26 +#define NFC_UNLOCKSTART_BLK2 0x1E28 +#define NFC_UNLOCKEND_BLK2 0x1E2A +#define NFC_UNLOCKSTART_BLK3 0x1E2C +#define NFC_UNLOCKEND_BLK3 0x1E2E + +/* Bit Definitions: NFC_BUF_ADDR */ +#define NFC_RBA_MASK (7 << 0) +#define NFC_ACTIVE_CS_SHIFT 5 +#define NFC_ACTIVE_CS_MASK (3 << NFC_ACTIVE_CS_SHIFT) + +/* Bit Definitions: NFC_CONFIG */ +#define NFC_BLS_UNLOCKED (1 << 1) + +/* Bit Definitions: NFC_CONFIG1 */ +#define NFC_ECC_4BIT (1 << 0) +#define NFC_FULL_PAGE_DMA (1 << 1) +#define NFC_SPARE_ONLY (1 << 2) +#define NFC_ECC_ENABLE (1 << 3) +#define NFC_INT_MASK (1 << 4) +#define NFC_BIG_ENDIAN (1 << 5) +#define NFC_RESET (1 << 6) +#define NFC_CE (1 << 7) +#define NFC_ONE_CYCLE (1 << 8) +#define NFC_PPB_32 (0 << 9) +#define NFC_PPB_64 (1 << 9) +#define NFC_PPB_128 (2 << 9) +#define NFC_PPB_256 (3 << 9) +#define NFC_PPB_MASK (3 << 9) +#define NFC_FULL_PAGE_INT (1 << 11) + +/* Bit Definitions: NFC_CONFIG2 */ +#define NFC_COMMAND (1 << 0) +#define NFC_ADDRESS (1 << 1) +#define NFC_INPUT (1 << 2) +#define NFC_OUTPUT (1 << 3) +#define NFC_ID (1 << 4) +#define NFC_STATUS (1 << 5) +#define NFC_CMD_FAIL (1 << 15) +#define NFC_INT (1 << 15) + +/* Bit Definitions: NFC_WRPROT */ +#define NFC_WPC_LOCK_TIGHT (1 << 0) +#define NFC_WPC_LOCK (1 << 1) +#define NFC_WPC_UNLOCK (1 << 2) + +#endif /* MPC5121_NFC_H */ arch/powerpc/platforms/512x/mpc512x_shared.c +1
-0@@ -71,6 +71,7 @@ void __init mpc512x_init_IRQ(void)static struct of_device_id __initdata of_bus_ids[] = { { .compatible ="fsl,mpc5121-immr" , }, { .compatible ="fsl,mpc5121-localbus" , }, + { .compatible ="fsl,mpc5121-nfc" , }, {}, };drivers/mtd/nand/Kconfig +7
-0@@ -413,6 +413,13 @@ config MTD_NAND_FSL_UPM Enables support for NAND Flash chips wired onto Freescale PowerPC processor localbus with User-Programmable Machine support. +config MTD_NAND_MPC5121_NFC + tristate "MPC5121 built-in NAND Flash Controller support" + depends on PPC_MPC512x + help + This enables the driver for the NAND flash controller on the + MPC5121 SoC. + config MTD_NAND_MXC tristate "MXC NAND support" depends on ARCH_MX2 || ARCH_MX3drivers/mtd/nand/Makefile +0
-0@@ -39,5 +39,6 @@ obj-$(CONFIG_MTD_NAND_SH_FLCTL) +=sh_flctl.o
obj-$(CONFIG_MTD_NAND_MXC) += mxc_nand.o
obj-$(CONFIG_MTD_NAND_SOCRATES) += socrates_nand.o
obj-$(CONFIG_MTD_NAND_TXX9NDFMC) += txx9ndfmc.odrivers/mtd/nand/Makefile +1
-0+obj-$(CONFIG_MTD_NAND_MPC5121_NFC) += mpc5121_nfc.o nand-objs := nand_base.o nand_bbt.odrivers/mtd/nand/mpc5121_nfc.c new file +166
-0@@ -0,0 +1,855 @@ +/* +* Copyright 2004-2008 Freescale Semiconductor, Inc. +* Copyright 2009 Semihalf. +* +* Based on original driver from Freescale Semiconductor +* written by John Rigby <[email protected]> on basis +* of drivers/mtd/nand/mxc_nand.c. Reworked and extended +* Piotr Ziecik <[email protected]>. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +* MA 02110-1301, USA. +*/ + +#include <linux/module.h> +#include <linux/clk.h> +#include <linux/delay.h> +#include <linux/init.h> +#include <linux/interrupt.h> +#include <linux/io.h> +#include <linux/mtd/mtd.h> +#include <linux/mtd/nand.h> +#include <linux/mtd/partitions.h> +#include <linux/of_device.h> +#include <linux/of_platform.h> + +#include <asm/mpc512x.h> +#include <asm/mpc5121_nfc.h> + +#define DRV_NAME "mpc5121_nfc" +#define DRV_VERSION "0.5" + +/* Timeouts */ +#define NFC_RESET_TIMEOUT 1000/* 1 ms */ +#define NFC_TIMEOUT (HZ / 10)/* 1/10 s */ + +struct mpc5121_nfc_prv { +struct mtd_info mtd; +struct nand_chip chip; +int irq; +void __iomem *regs; +struct clk *clk; +wait_queue_head_t irq_waitq; +uint column; +int spareonly; +void __iomem *csreg; +}; + +static void mpc5121_nfc_done (struct mtd_info *mtd); + +#ifdef CONFIG_MTD_PARTITIONS +static const char *mpc5121_nfc_pprobes[] = {"cmdlinepart" ,NULL }; +#endif + +/* Read NFC register */ +static inline u16 nfc_read (struct mtd_info *mtd,uint reg) +{ +struct nand_chip *chip = mtd->priv; +struct mpc5121_nfc_prv *prv = chip->priv; + +return in_be16 (prv->regs + reg); +} + +/* Write NFC register */ +static inline void nfc_write (struct mtd_info *mtd,uint reg,u16 val) +{ +struct nand_chip *chip = mtd->priv; +struct mpc5121_nfc_prv *prv = chip->priv; + +out_be16 (prv->regs + reg, val); +} + +/* Set bits in NFC register */ +static inline void nfc_set (struct mtd_info *mtd,uint reg,u16 bits) +{ +nfc_write (mtd, reg,nfc_read (mtd, reg) | bits); +} + +/* Clear bits in NFC register */ +static inline void nfc_clear (struct mtd_info *mtd,uint reg,u16 bits) +{ +nfc_write (mtd, reg,nfc_read (mtd, reg) & ~bits); +} + +/* Invoke address cycle */ +static inline void mpc5121_nfc_send_addr (struct mtd_info *mtd,u16 addr) +{ +nfc_write (mtd,NFC_FLASH_ADDR , addr); +nfc_write (mtd,NFC_CONFIG2 ,NFC_ADDRESS ); +mpc5121_nfc_done (mtd); +} + +/* Invoke command cycle */ +static inline void mpc5121_nfc_send_cmd (struct mtd_info *mtd,u16 cmd) +{ +nfc_write (mtd,NFC_FLASH_CMD , cmd); +nfc_write (mtd,NFC_CONFIG2 ,NFC_COMMAND ); +mpc5121_nfc_done (mtd); +} + +/* Send data from NFC buffers to NAND flash */ +static inline void mpc5121_nfc_send_prog_page (struct mtd_info *mtd) +{ +nfc_clear (mtd,NFC_BUF_ADDR ,NFC_RBA_MASK ); +nfc_write (mtd,NFC_CONFIG2 ,NFC_INPUT ); +mpc5121_nfc_done (mtd); +} + +/* Receive data from NAND flash */ +static inline void mpc5121_nfc_send_read_page (struct mtd_info *mtd) +{ +nfc_clear (mtd,NFC_BUF_ADDR ,NFC_RBA_MASK ); +nfc_write (mtd,NFC_CONFIG2 ,NFC_OUTPUT ); +mpc5121_nfc_done (mtd); +} + +/* Receive ID from NAND flash */ +static inline void mpc5121_nfc_send_read_id (struct mtd_info *mtd) +{ +nfc_clear (mtd,NFC_BUF_ADDR ,NFC_RBA_MASK ); +nfc_write (mtd,NFC_CONFIG2 ,NFC_ID ); +mpc5121_nfc_done (mtd); +} + +/* Receive status from NAND flash */ +static inline void mpc5121_nfc_send_read_status (struct mtd_info *mtd) +{ +nfc_clear (mtd,NFC_BUF_ADDR ,NFC_RBA_MASK ); +nfc_write (mtd,NFC_CONFIG2 ,NFC_STATUS ); +mpc5121_nfc_done (mtd); +} + +/* NFC interrupt handler */ +static irqreturn_t mpc5121_nfc_irq (int irq,void *data) +{ +struct mtd_info *mtd = data; +struct nand_chip *chip = mtd->priv; +struct mpc5121_nfc_prv *prv = chip->priv; + +nfc_set (mtd,NFC_CONFIG1 ,NFC_INT_MASK ); +wake_up (&prv->irq_waitq); + +return IRQ_HANDLED ; +} + +/* Wait for operation complete */ +static void mpc5121_nfc_done (struct mtd_info *mtd) +{ +struct nand_chip *chip = mtd->priv; +struct mpc5121_nfc_prv *prv = chip->priv; +int rv; + +if ((nfc_read (mtd,NFC_CONFIG2 ) &NFC_INT ) ==0 ) { +nfc_clear (mtd,NFC_CONFIG1 ,NFC_INT_MASK ); + rv = wait_event_timeout(prv->irq_waitq, + (nfc_read(mtd, NFC_CONFIG2) & NFC_INT),
NFC_TIMEOUT);drivers/mtd/nand/mpc5121_nfc.c new file +4
-0+ +if (!rv) + printk(KERN_WARNING DRV_NAME + ": Timeout while waiting forinterrupt.\n");
drivers/mtd/nand/mpc5121_nfc.c new file +7
-0+ } + +nfc_clear (mtd,NFC_CONFIG2 ,NFC_INT ); +} + +/* Do address cycle(s) */ +static void mpc5121_nfc_addr_cycle(struct mtd_info *mtd, int column, intpage)
drivers/mtd/nand/mpc5121_nfc.c new file +30
-0+{ +struct nand_chip *chip = mtd->priv; +u32 pagemask = chip->pagemask; + +if (column !=-1 ) { +mpc5121_nfc_send_addr (mtd, column); +if (mtd->writesize >512 ) +mpc5121_nfc_send_addr (mtd, column >>8 ); + } + +if (page !=-1 ) { +do { +mpc5121_nfc_send_addr (mtd, page &0xFF ); + page >>=8 ; + pagemask >>=8 ; + }while (pagemask); + } +} + +/* Control chip select signals */ +static void mpc5121_nfc_select_chip (struct mtd_info *mtd,int chip) +{ +if (chip <0 ) { +nfc_clear (mtd,NFC_CONFIG1 ,NFC_CE ); +return ; + } + +nfc_clear (mtd,NFC_BUF_ADDR ,NFC_ACTIVE_CS_MASK ); + nfc_set(mtd, NFC_BUF_ADDR, (chip << NFC_ACTIVE_CS_SHIFT) & +
NFC_ACTIVE_CS_MASK);drivers/mtd/nand/mpc5121_nfc.c new file +49
-0+nfc_set (mtd,NFC_CONFIG1 ,NFC_CE ); +} + +/* Init external chip select logic on ADS5121 board */ +static int ads5121_chipselect_init (struct mtd_info *mtd) +{ +struct nand_chip *chip = mtd->priv; +struct mpc5121_nfc_prv *prv = chip->priv; +struct device_node *dn; + + dn =of_find_compatible_node (NULL ,NULL ,"fsl,mpc5121ads-cpld" ); +if (dn) { + prv->csreg =of_iomap (dn,0 ); +of_node_put (dn); +if (!prv->csreg) +return -ENOMEM ; + +/* CPLD Register 9 controls NAND /CE Lines */ + prv->csreg +=9 ; +return 0 ; + } + +return -EINVAL ; +} + +/* Control chips select signal on ADS5121 board */ +static void ads5121_select_chip (struct mtd_info *mtd,int chip) +{ +struct nand_chip *nand = mtd->priv; +struct mpc5121_nfc_prv *prv = nand->priv; +u8 v; + + v =in_8 (prv->csreg); + v |=0x0F ; + +if (chip >=0 ) { +mpc5121_nfc_select_chip (mtd,0 ); + v &= ~(1 << chip); + }else +mpc5121_nfc_select_chip (mtd,-1 ); + +out_8 (prv->csreg, v); +} + +/* Read NAND Ready/Busy signal */ +static int mpc5121_nfc_dev_ready (struct mtd_info *mtd) +{ +/* +* NFC handles ready/busy signal internally. Therefore, this function
drivers/mtd/nand/mpc5121_nfc.c new file +8
-0+* always returns status as ready. +*/ +return 1 ; +} + +/* Write command to NAND flash */ +static void mpc5121_nfc_command (struct mtd_info *mtd,unsigned command, + int column, intpage)
drivers/mtd/nand/mpc5121_nfc.c new file +73
-0+{ +struct nand_chip *chip = mtd->priv; +struct mpc5121_nfc_prv *prv = chip->priv; + + prv->column = (column >=0 ) ? column :0 ; + prv->spareonly =0 ; + +switch (command) { +case NAND_CMD_PAGEPROG : +mpc5121_nfc_send_prog_page (mtd); +break ; +/* +* NFC does not support sub-page reads and writes, +* so emulate them using full page transfers. +*/ +case NAND_CMD_READ0 : + column =0 ; +break ; + +case NAND_CMD_READ1 : + prv->column +=256 ; + command =NAND_CMD_READ0 ; + column =0 ; +break ; + +case NAND_CMD_READOOB : + prv->spareonly =1 ; + command =NAND_CMD_READ0 ; + column =0 ; +break ; + +case NAND_CMD_SEQIN : +mpc5121_nfc_command (mtd,NAND_CMD_READ0 , column, page); + column =0 ; +break ; + +case NAND_CMD_ERASE1 : +case NAND_CMD_ERASE2 : +case NAND_CMD_READID : +case NAND_CMD_STATUS : +break ; + +default : +return ; + } + +mpc5121_nfc_send_cmd (mtd, command); +mpc5121_nfc_addr_cycle (mtd, column, page); + +switch (command) { +case NAND_CMD_READ0 : +if (mtd->writesize >512 ) +mpc5121_nfc_send_cmd (mtd,NAND_CMD_READSTART ); +mpc5121_nfc_send_read_page (mtd); +break ; + +case NAND_CMD_READID : +mpc5121_nfc_send_read_id (mtd); +break ; + +case NAND_CMD_STATUS : +mpc5121_nfc_send_read_status (mtd); +if (chip->options &NAND_BUSWIDTH_16 ) + prv->column =1 ; +else + prv->column =0 ; +break ; + } +} + +/* Copy data from/to NFC spare buffers. */ +static void mpc5121_nfc_copy_spare (struct mtd_info *mtd,uint offset, + u8 *buffer, uint size, intwr)
drivers/mtd/nand/mpc5121_nfc.c new file +31
-0+{ +struct nand_chip *nand = mtd->priv; +struct mpc5121_nfc_prv *prv = nand->priv; +uint o, s, sbsize, blksize; + +/* +* NAND spare area is available through NFC spare buffers. +* The NFC divides spare area into (page_size / 512) chunks. +* Each chunk is placed into separate spare memory area, using +* first (spare_size / num_of_chunks) bytes of the buffer. +* +* For NAND device in which the spare area is not divided fully +* by the number of chunks, number of used bytes in each spare +* buffer is rounded down to the nearest even number of bytes, +* and all remaining bytes are added to the last used spare area. +* +* For more information read section 26.6.10 of MPC5121e +* Microcontroller Reference Manual, Rev. 3. +*/ + +/* Calculate number of valid bytes in each spare buffer */ + sbsize = (mtd->oobsize / (mtd->writesize /512 )) & ~1 ; + +while (size) { +/* Calculate spare buffer number */ + s = offset / sbsize; +if (s >NFC_SPARE_BUFFERS -1 ) + s =NFC_SPARE_BUFFERS -1 ; + +/* +* Calculate offset to requested data block in selected spare
drivers/mtd/nand/mpc5121_nfc.c new file +11
-0+* buffer and its size. +*/ + o = offset - (s * sbsize); + blksize =min (sbsize - o, size); + +if (wr) +memcpy_toio (prv->regs +NFC_SPARE_AREA (s) + o, + buffer, blksize); +else + memcpy_fromio(buffer, + prv->regs + NFC_SPARE_AREA(s) + o,blksize);
drivers/mtd/nand/mpc5121_nfc.c new file +9
-0+ + buffer += blksize; + offset += blksize; + size -= blksize; + }; +} + +/* Copy data from/to NFC main and spare buffers */ +static void mpc5121_nfc_buf_copy(struct mtd_info *mtd, u_char *buf, intlen,
+ int
wr)drivers/mtd/nand/mpc5121_nfc.c new file +39
-0+{ +struct nand_chip *chip = mtd->priv; +struct mpc5121_nfc_prv *prv = chip->priv; +uint c = prv->column; +uint l; + +/* Handle spare area access */ +if (prv->spareonly || c >= mtd->writesize) { +/* Calculate offset from beginning of spare area */ +if (c >= mtd->writesize) + c -= mtd->writesize; + + prv->column += len; +mpc5121_nfc_copy_spare (mtd, c, buf, len, wr); +return ; + } + +/* +* Handle main area access - limit copy length to prevent +* crossing main/spare boundary. +*/ + l =min ((uint )len, mtd->writesize - c); + prv->column += l; + +if (wr) +memcpy_toio (prv->regs +NFC_MAIN_AREA (0 ) + c, buf, l); +else +memcpy_fromio (buf, prv->regs +NFC_MAIN_AREA (0 ) + c, l); + +/* Handle crossing main/spare boundary */ +if (l != len) { + buf += l; + len -= l; +mpc5121_nfc_buf_copy (mtd, buf, len, wr); + } +} + +/* Read data from NFC buffers */ +static void mpc5121_nfc_read_buf(struct mtd_info *mtd, u_char *buf, intlen)
drivers/mtd/nand/mpc5121_nfc.c new file +81
-0+{ +mpc5121_nfc_buf_copy (mtd, buf, len,0 ); +} + +/* Write data to NFC buffers */ +static void mpc5121_nfc_write_buf (struct mtd_info *mtd, +const u_char *buf,int len) +{ +mpc5121_nfc_buf_copy (mtd, (u_char *)buf, len,1 ); +} + +/* Compare buffer with NAND flash */ +static int mpc5121_nfc_verify_buf (struct mtd_info *mtd, +const u_char *buf,int len) +{ +u_char tmp[256 ]; +uint bsize; + +while (len) { + bsize =min (len,256 ); +mpc5121_nfc_read_buf (mtd, tmp, bsize); + +if (memcmp (buf, tmp, bsize)) +return 1 ; + + buf += bsize; + len -= bsize; + } + +return 0 ; +} + +/* Read byte from NFC buffers */ +static u8 mpc5121_nfc_read_byte (struct mtd_info *mtd) +{ +u8 tmp; + +mpc5121_nfc_read_buf (mtd, &tmp,sizeof (tmp)); + +return tmp; +} + +/* Read word from NFC buffers */ +static u16 mpc5121_nfc_read_word (struct mtd_info *mtd) +{ +u16 tmp; + +mpc5121_nfc_read_buf (mtd, (u_char *)&tmp,sizeof (tmp)); + +return tmp; +} + +/* +* Read NFC configuration from Reset Config Word +* +* NFC is configured during reset in basis of information stored +* in Reset Config Word. There is no other way to set NAND block +* size, spare size and bus width. +*/ +static int mpc5121_nfc_read_hw_config (struct mtd_info *mtd) +{ +struct nand_chip *chip = mtd->priv; +struct mpc512x_reset_module *rm; +struct device_node *rmnode; +uint rcw_pagesize =0 ; +uint rcw_sparesize =0 ; +uint rcw_width; +uint rcwh; +uint romloc, ps; + + rmnode =of_find_compatible_node (NULL ,NULL ,"fsl,mpc5121-reset" ); +if (!rmnode) { + printk(KERN_ERR DRV_NAME ": Missing 'fsl,mpc5121-reset' " + "node in device tree!\n"); +return -ENODEV ; + } + + rm =of_iomap (rmnode,0 ); +if (!rm) { + printk(KERN_ERR DRV_NAME + ": Error mapping reset modulenode!\n");
drivers/mtd/nand/mpc5121_nfc.c new file +45
-0+return -EBUSY ; + } + + rcwh =in_be32 (&rm->rcwhr); + +/* Bit 6: NFC bus width */ + rcw_width = ((rcwh >>6 ) &0x1 ) ?2 :1 ; + +/* Bit 7: NFC Page/Spare size */ + ps = (rcwh >>7 ) &0x1 ; + +/* Bits [22:21]: ROM Location */ + romloc = (rcwh >>21 ) &0x3 ; + +/* Decode RCW bits */ +switch ((ps <<2 ) | romloc) { +case 0x00 : +case 0x01 : + rcw_pagesize =512 ; + rcw_sparesize =16 ; +break ; +case 0x02 : +case 0x03 : + rcw_pagesize =4096 ; + rcw_sparesize =128 ; +break ; +case 0x04 : +case 0x05 : + rcw_pagesize =2048 ; + rcw_sparesize =64 ; +break ; +case 0x06 : +case 0x07 : + rcw_pagesize =4096 ; + rcw_sparesize =218 ; +break ; + } + + mtd->writesize = rcw_pagesize; + mtd->oobsize = rcw_sparesize; +if (rcw_width ==2 ) + chip->options |=NAND_BUSWIDTH_16 ; + + printk(KERN_NOTICE DRV_NAME ": Configured for " + "%u-bit NAND, page size %u"
drivers/mtd/nand/mpc5121_nfc.c new file +2
-0+"with %u spare.\n" , + rcw_width * 8,
rcw_pagesize,drivers/mtd/nand/mpc5121_nfc.c new file +47
-0+ rcw_sparesize); +iounmap (rm); +of_node_put (rmnode); +return 0 ; +} + +/* Free driver resources */ +static void mpc5121_nfc_free (struct device *dev,struct mtd_info *mtd) +{ +struct nand_chip *chip = mtd->priv; +struct mpc5121_nfc_prv *prv = chip->priv; + +if (prv->clk) { +clk_disable (prv->clk); +clk_put (prv->clk); + } + +if (prv->csreg) +iounmap (prv->csreg); +} + +static int __init mpc5121_nfc_probe (struct of_device *op, +const struct of_device_id *match) +{ +struct device_node *rootnode, *dn = op->node; +struct device *dev = &op->dev; +struct mpc5121_nfc_prv *prv; +struct resource res; +struct mtd_info *mtd; +#ifdef CONFIG_MTD_PARTITIONS +struct mtd_partition *parts; +#endif +struct nand_chip *chip; +unsigned long regs_paddr, regs_size; +const uint *chips_no; +int resettime =0 ; +int retval =0 ; +int rev, len; + +/* +* Check SoC revision. This driver supports only NFC +* in MPC5121 revision 2. +*/ + rev = (mfspr (SPRN_SVR ) >>4 ) &0xF ; +if (rev !=2 ) { + printk(KERN_ERR DRV_NAME + ": SoC revision %u is not supported!\n",rev);
drivers/mtd/nand/mpc5121_nfc.c new file +31
-0+return -ENXIO ; + } + + prv =devm_kzalloc (dev,sizeof (*prv),GFP_KERNEL ); +if (!prv) { + printk(KERN_ERR DRV_NAME ": Memory exhausted!\n"); +return -ENOMEM ; + } + + mtd = &prv->mtd; + chip = &prv->chip; + + mtd->priv = chip; + chip->priv = prv; + +/* Read NFC configuration from Reset Config Word */ + retval =mpc5121_nfc_read_hw_config (mtd); +if (retval) { + printk(KERN_ERR DRV_NAME ": Unable to read NFC config!\n"); +return retval; + } + + prv->irq =irq_of_parse_and_map (dn,0 ); +if (prv->irq ==NO_IRQ ) { + printk(KERN_ERR DRV_NAME ": Error mapping IRQ!\n"); +return -EINVAL ; + } + + retval =of_address_to_resource (dn,0 , &res); +if (retval) { + printk(KERN_ERR DRV_NAME ": Error parsing memoryregion!\n");
drivers/mtd/nand/mpc5121_nfc.c new file +7
-0+return retval; + } + + chips_no =of_get_property (dn,"chips" , &len); +if (!chips_no || len !=sizeof (*chips_no)) { + printk(KERN_ERR DRV_NAME ": Invalid/missing 'chips' " +"property!\n");
drivers/mtd/nand/mpc5121_nfc.c new file +7
-0+return -EINVAL ; + } + + regs_paddr = res.start; + regs_size = res.end - res.start +1 ; + +if (!devm_request_mem_region (dev, regs_paddr, regs_size,DRV_NAME )){
+ printk(KERN_ERRDRV_NAME": Error requesting memory
region!\n");drivers/mtd/nand/mpc5121_nfc.c new file +6
-0+return -EBUSY ; + } + + prv->regs =devm_ioremap (dev, regs_paddr, regs_size); +if (!prv->regs) { + printk(KERN_ERR DRV_NAME ": Error mapping memoryregion!\n");
drivers/mtd/nand/mpc5121_nfc.c new file +21
-0+return -ENOMEM ; + } + + mtd->name ="MPC5121 NAND" ; + chip->dev_ready = mpc5121_nfc_dev_ready; + chip->cmdfunc = mpc5121_nfc_command; + chip->read_byte = mpc5121_nfc_read_byte; + chip->read_word = mpc5121_nfc_read_word; + chip->read_buf = mpc5121_nfc_read_buf; + chip->write_buf = mpc5121_nfc_write_buf; + chip->verify_buf = mpc5121_nfc_verify_buf; + chip->select_chip = mpc5121_nfc_select_chip; + chip->options =NAND_NO_AUTOINCR |NAND_USE_FLASH_BBT ; + chip->ecc.mode =NAND_ECC_SOFT ; + +/* Support external chip-select logic on ADS5121 board */ + rootnode =of_find_node_by_path ("/" ); +if (of_device_is_compatible (rootnode,"fsl,mpc5121ads" )) { + retval =ads5121_chipselect_init (mtd); +if (retval) { + printk(KERN_ERR DRV_NAME ": Chipselect initerror!\n");
drivers/mtd/nand/mpc5121_nfc.c new file +12
-0+of_node_put (rootnode); +return retval; + } + + chip->select_chip = ads5121_select_chip; + } +of_node_put (rootnode); + +/* Enable NFC clock */ + prv->clk =clk_get (dev,"nfc_clk" ); +if (!prv->clk) { + printk(KERN_ERR DRV_NAME ": Unable to acquire NFCclock!\n");
drivers/mtd/nand/mpc5121_nfc.c new file +12
-0+ retval = -ENODEV ; + goto error; + } + +clk_enable (prv->clk); + +/* Reset NAND Flash controller */ +nfc_set (mtd,NFC_CONFIG1 ,NFC_RESET ); +while (nfc_read (mtd,NFC_CONFIG1 ) &NFC_RESET ) { +if (resettime++ >=NFC_RESET_TIMEOUT ) { + printk(KERN_ERR DRV_NAME + ": Timeout while resettingNFC!\n");
drivers/mtd/nand/mpc5121_nfc.c new file +28
-0+ retval = -EINVAL ; + goto error; + } + +udelay (1 ); + } + +/* Enable write to NFC memory */ +nfc_write (mtd,NFC_CONFIG ,NFC_BLS_UNLOCKED ); + +/* Enable write to all NAND pages */ +nfc_write (mtd,NFC_UNLOCKSTART_BLK0 ,0x0000 ); +nfc_write (mtd,NFC_UNLOCKEND_BLK0 ,0xFFFF ); +nfc_write (mtd,NFC_WRPROT ,NFC_WPC_UNLOCK ); + +/* +* Setup NFC: +* - Big Endian transfers, +* - Interrupt after full page read/write. +*/ +nfc_write (mtd,NFC_CONFIG1 ,NFC_BIG_ENDIAN |NFC_INT_MASK | +NFC_FULL_PAGE_INT ); + +/* Set spare area size */ +nfc_write (mtd,NFC_SPAS , mtd->oobsize >>1 ); + +init_waitqueue_head (&prv->irq_waitq); + retval = devm_request_irq(dev, prv->irq, &mpc5121_nfc_irq, 0,
DRV_NAME,
+
mtd);drivers/mtd/nand/mpc5121_nfc.c new file +49
-0+if (retval) { + printk(KERN_ERR DRV_NAME ": Error requesting IRQ!\n"); + goto error; + } + +/* Detect NAND chips */ +if (nand_scan (mtd, *chips_no)) { + printk(KERN_ERR DRV_NAME ": NAND Flash not found !\n"); +devm_free_irq (dev, prv->irq, mtd); + retval = -ENXIO ; + goto error; + } + +/* Set erase block size */ +switch (mtd->erasesize / mtd->writesize) { +case 32 : +nfc_set (mtd,NFC_CONFIG1 ,NFC_PPB_32 ); +break ; + +case 64 : +nfc_set (mtd,NFC_CONFIG1 ,NFC_PPB_64 ); +break ; + +case 128 : +nfc_set (mtd,NFC_CONFIG1 ,NFC_PPB_128 ); +break ; + +case 256 : +nfc_set (mtd,NFC_CONFIG1 ,NFC_PPB_256 ); +break ; + +default : + printk(KERN_ERR DRV_NAME ": Unsupported NAND flash!\n"); +devm_free_irq (dev, prv->irq, mtd); + retval = -ENXIO ; + goto error; + } + +dev_set_drvdata (dev, mtd); + +/* Register device in MTD */ +#ifdef CONFIG_MTD_PARTITIONS + retval =parse_mtd_partitions (mtd, mpc5121_nfc_pprobes, &parts,0 ); +#ifdef CONFIG_MTD_OF_PARTS +if (retval ==0 ) + retval =of_mtd_parse_partitions (dev, dn, &parts); +#endif +if (retval <0 ) { + printk(KERN_ERR DRV_NAME ": Error parsing MTDpartitions!\n");
drivers/mtd/nand/mpc5121_nfc.c new file +77
-1+devm_free_irq (dev, prv->irq, mtd); + retval = -EINVAL ; + goto error; + } + +if (retval >0 ) + retval =add_mtd_partitions (mtd, parts, retval); + else +#endif + retval =add_mtd_device (mtd); + +if (retval) { + printk(KERN_ERR DRV_NAME ": Error adding MTD device!\n"); +devm_free_irq (dev, prv->irq, mtd); + goto error; + } + +return 0 ; +error: +mpc5121_nfc_free (dev, mtd); +return retval; +} + +static int __exit mpc5121_nfc_remove(struct of_device *op) +{ +struct device *dev = &op->dev; +struct mtd_info *mtd =dev_get_drvdata (dev); +struct nand_chip *chip = mtd->priv; +struct mpc5121_nfc_prv *prv = chip->priv; + +nand_release (mtd); +devm_free_irq (dev, prv->irq, mtd); +mpc5121_nfc_free (dev, mtd); + +return 0 ; +} + +static struct of_device_id mpc5121_nfc_match[] = { + { .compatible ="fsl,mpc5121-nfc" , }, + {}, +}; + +static struct of_platform_driver mpc5121_nfc_driver = { + .owner =THIS_MODULE , + .name =DRV_NAME , + .match_table = mpc5121_nfc_match, + .probe = mpc5121_nfc_probe, + .remove =__exit_p (mpc5121_nfc_remove), + .suspend =NULL , + .resume =NULL , + .driver = { + .name =DRV_NAME , + .owner =THIS_MODULE , + }, +}; + +static int __init mpc5121_nfc_init (void ) +{ +if (of_register_platform_driver (&mpc5121_nfc_driver) !=0 ) { + printk(KERN_ERR DRV_NAME ": Driver register failed!\n"); +return -ENODEV ; + } +return 0 ; +} + +static void __exit mpc5121_nfc_cleanup(void) +{ +of_unregister_platform_driver (&mpc5121_nfc_driver); +} + +module_init (mpc5121_nfc_init); +module_exit (mpc5121_nfc_cleanup); + +MODULE_AUTHOR ("Freescale Semiconductor, Inc." ); +MODULE_DESCRIPTION ("MPC5121 NAND MTD driver" ); +MODULE_LICENSE ("GPL" ); +MODULE_VERSION (DRV_VERSION ); --1.6.0.6
Re: [PATCH 06/12] mpc5121: Added NAND Flash Controller driver.
Friday 08 May 2009 05:30:15 John Rigby napisał(a):
Quoted 4 lines
Did you choose to not support hardware ECC so you could use the spare area? The original driver only supported hardware ECC but unfortuneatly the hardware ECC includes the spare area so the spare area cannot be written separately.
In short yes. There are fundamental problems which you described. Flash filesystems expect that ECC is calculated from main area only and writes to spare area not change it. MPC5121 NAND flash controller calculates ECC from both areas except few bytes holding ECC. This makes flash filesystems unusable when we turn on hardware ECC.
This could be fixed by disabling spare area usage in flash filesystems but this probably requires changes in the MTD/filesystem infrastructure.
Signature · 2 lines
Best Regards. Piotr Zięcik
PATCH 7/12 mpc5121ads: Clean up and fix NAND description in mpc5121ads DTS.
In reply to Wolfgang DenkFrom: Piotr Ziecik <[email protected]>
- Removed unused properties.
- Corrected NAND flash chip size.
--- arch/powerpc/boot/dts/mpc5121ads.dts | 13 ++++--------- 1 files changed, 4 insertions(+), 9 deletions(-)
arch/powerpc/boot/dts/mpc5121ads.dts +4 -9
@@ -62,17 +62,12 @@ interrupt-parent = < &ipic >; #address-cells = <1>; #size-cells = <1>; - bank-width = <1>; // ADS has two Hynix 512MB Nand flash chips in a single - // stacked package . + // stacked package. chips = <2>; - nand0@0 { - label = "nand0"; - reg = <0x00000000 0x02000000>; // first 32 MB of chip 0 - }; - nand1@20000000 { - label = "nand1"; - reg = <0x20000000 0x02000000>; // first 32 MB of chip 1 + nand@0 { + label = "nand"; + reg = <0x00000000 0x40000000>; // 512MB + 512MB }; };
Signature · 1 line
1.6.0.6
Re: [PATCH 07/12] mpc5121ads: Clean up and fix NAND description in mpc5121ads DTS.
Quoted 9 lines · Wolfgang Denk
From: Piotr Ziecik <[email protected]>
- Removed unused properties.
- Corrected NAND flash chip size.Signed-off-by Piotr Ziecik <[email protected]>Signed-off-by Wolfgang Denk <[email protected]>Cc Grant Likely <[email protected]>Cc John Rigby <[email protected]>
Looks okay to me.
g.
arch/powerpc/boot/dts=
Quoted 5 lines
---
=A0arch/powerpc/boot/dts/mpc5121ads.dts | =A0 13 ++++--------- =A01 files changed, 4 insertions(+), 9 deletions(-)arch/powerpc/boot/dts= renamed from arch/powerpc/boot/dts/mpc5121ads.dts +0
-0
/mpc5121ads.dts
Quoted 9 lines
index 1b83a9d..93fe12a 100644
arch/powerpc/boot/dts/mpc5121ads.dts +0
-1@@ -62,17 +62,12 @@ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D < &ipic >; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#address-cells =3D <1>; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#size-cells =3D <1>; - =A0 =A0 =A0 =A0 =A0 =A0 =A0 bank-width =3D <1>;=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// ADS has two Hynix 512MB Nand flash chip=
s in a single
Quoted 6 lines
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 // stacked package .
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 // stacked package.
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0chips =3D <2>;
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 nand0@0 {
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 label =3D "nand0";
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 reg =3D <0x000000000x02000=
000>; =A0// first 32 MB of chip 0
Quoted 4 lines
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 };
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 nand1@20000000 {
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 label =3D "nand1";
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 reg =3D <0x200000000x02000=
000>; =A0// first 32 MB of chip 1
Quoted 3 lines
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 nand@0 {
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 label =3D "nand";
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 reg =3D <0x000000000x40000=
000>; =A0// 512MB + 512MB
Quoted 7 lines
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0};
=A0 =A0 =A0 =A0};--
1.6.0.6
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
PATCH 9/12 mpc5121ads: Added I2C RTC node to mpc5121ads DTS.
In reply to Wolfgang DenkFrom: Piotr Ziecik <[email protected]>
--- arch/powerpc/boot/dts/mpc5121ads.dts | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
arch/powerpc/boot/dts/mpc5121ads.dts +5 -0
@@ -210,6 +210,11 @@ interrupts = <9 0x8>; interrupt-parent = < &ipic >; fsl5200-clocking; + + rtc@68 { + compatible = "stm,m41t80"; + reg = <0x68>; + }; }; i2c@1720 {
Signature · 1 line
1.6.0.6
Re: [PATCH 09/12] mpc5121ads: Added I2C RTC node to mpc5121ads DTS.
Quoted 5 lines · Wolfgang Denk
From: Piotr Ziecik <[email protected]>
Signed-off-by Piotr Ziecik <[email protected]>Signed-off-by Wolfgang Denk <[email protected]>Cc Grant Likely <[email protected]>
arch/powerpc/boot/dts=
Quoted 6 lines
Cc John Rigby <[email protected]>---
=A0arch/powerpc/boot/dts/mpc5121ads.dts | =A0 =A05 +++++ =A01 files changed, 5 insertions(+), 0 deletions(-)arch/powerpc/boot/dts= renamed from arch/powerpc/boot/dts/mpc5121ads.dts +0
-0
/mpc5121ads.dts
Quoted 6 lines
index 93fe12a..c2d9de9 100644
arch/powerpc/boot/dts/mpc5121ads.dts +0
-0@@ -210,6 +210,11 @@ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D <9 0x8>;=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D < &ip=
ic >;
Quoted 4 lines
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0fsl5200-clocking; +
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rtc@68 {
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 compatible =
=3D "stm,m41t80";
Quoted 1 line
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 reg =3D <0x=
68>;
Quoted 8 lines
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 };
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0};=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0i2c@1720 {
--
1.6.0.6
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
Re: [PATCH 09/12] mpc5121ads: Added I2C RTC node to mpc5121ads DTS.
In reply to Wolfgang DenkQuoted 15 lines · Wolfgang Denk
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 +0
-0
arch/powerpc/boot/dts/mpc5121ads.dts line 212
Quoted 3 lines
arch/powerpc/boot/dts/mpc5121ads.dts +0
-0@@ -210,6 +210,11 @@ interrupts = <9 0x8>; interrupt-parent = < &ipic >; fsl5200-clocking;
The above line is obsolete since -rc4. Please check the revised bindings in Documentation/powerpc/dts-bindings/fsl/i2c.txt. You may even want:
clock-frequency = <100000>;
Wolfgang.
PATCH 10/12 mpc5121: Add MPC5121 Real time clock driver.
In reply to Wolfgang DenkFrom: 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
--- 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
@@ -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
@@ -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 · 1 line
1.6.0.6
Re: [PATCH 10/12] mpc5121: Add MPC5121 Real time clock driver.
Quoted 5 lines · Wolfgang Denk
From: John Rigby <[email protected]>
Based on Domen Puncer's rtc driver for 5200 posted to
the ppclinux mailing list:
=A0 =A0 =A0 =A0http://patchwork.ozlabs.org/linuxppc-embedded/patch?id=3D1=
1675
Quoted 9 lines
but never commited anywhere.
Changes to Domen's original:
=A0 =A0Changed filenames/routine names from mpc5200* to mpc5121* =A0 =A0Changed match to only care about compatible and use "fsl," =A0 =A0convention for compatible.
=A0 =A0Make alarms more sane by dealing with lack of second alarm resolut=
ion.
Quoted 2 lines
=A0 =A0Deal with the fact that most of the 5121 rtc registers are not per=
sistent
Quoted 6 lines
=A0 =A0across a reset even with a battery attached:
=A0 =A0 =A0 =A0Use
actual_timeregister for time keeping =A0 =A0 =A0 =A0andtarget_timeregister as an offset to linux time=A0 =A0 =A0 =A0The
target_timeregister would normally be used for hibern=
ation
Quoted 8 lines
=A0 =A0 =A0 =A0but 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]>
On a *very* cursory review, I don't see anything here I object to. And it does not look dangerous.
Quoted 4 lines
---
=A0drivers/rtc/Kconfig =A0 =A0 =A0 | =A0 10 + =A0drivers/rtc/Makefile =A0 =A0 =A0| =A0 =A01 + =A0drivers/rtc/rtc-mpc5121.c | =A0408 +++++++++++++++++++++++++++++++++++=
++++++++++
Quoted 9 lines
=A03 files changed, 419 insertions(+), 0 deletions(-) =A0create mode 100644
drivers/rtc/rtc-mpc5121.cdrivers/rtc/Kconfig +0
-0@@ -750,4 +750,14 @@ config RTC_DRV_PS3=A0 =A0 =A0 =A0 =A0This driver can also be built as a module. If so, the =
module
drivers/rtc/Kconfig
Quoted 10 lines
=A0 =A0 =A0 =A0 =A0will be called rtc-ps3.
drivers/rtc/Kconfig +8
-0+config RTC_DRV_MPC5121 + =A0 =A0 =A0 tristate "Freescale MPC5121 built-in RTC" + =A0 =A0 =A0 depends on RTC_CLASS + =A0 =A0 =A0 help + =A0 =A0 =A0 =A0 If you say yes here you will get support for the + =A0 =A0 =A0 =A0 built-in RTC MPC5121. + + =A0 =A0 =A0 =A0 This driver can also be built as a module. If so, the m=
odule
drivers/rtc/Makefile obj-$(CONFIG_RTC_DRV_STARFIRE) =A0 =A0 =A0 =A0+=3D rtc-=
Quoted 8 lines
+ =A0 =A0 =A0 =A0 will be called rtc-mpc5121.
+
=A0endif #RTC_CLASSdrivers/rtc/Makefile +0
-0@@ -51,6 +51,7 @@ obj-$(CONFIG_RTC_DRV_STARFIRE) =A0 =A0 =A0 =A0+=3D rtc-=
starfire.o
Quoted 18 lines
=A0obj-$(CONFIG_RTC_DRV_MAX6900) =A0+=3D rtc-max6900.o =A0obj-$(CONFIG_RTC_DRV_MAX6902) =A0+=3D rtc-max6902.o =A0obj-$(CONFIG_RTC_DRV_MV) =A0 =A0 =A0 +=3D rtc-mv.o +obj-$(CONFIG_RTC_DRV_MPC5121) =A0+=3D rtc-mpc5121.o =A0obj-$(CONFIG_RTC_DRV_OMAP) =A0 =A0 +=3D rtc-omap.o =A0obj-$(CONFIG_RTC_DRV_PCF8563) =A0+=3D rtc-pcf8563.o =A0obj-$(CONFIG_RTC_DRV_PCF8583) =A0+=3D rtc-pcf8583.o
drivers/rtc/rtc-mpc5121.c new file +5
-0@@ -0,0 +1,408 @@ +/* +* Real-time clock driver for MPC5121 +* +* Copyright 2007, Domen Puncer <[email protected]> +* Copyright 2008, Freescale Semiconductor, Inc. All rights reserved.
drivers/rtc/rtc-mpc5121.c line 15
Quoted 10 lines
drivers/rtc/rtc-mpc5121.c new file +10
-0+* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +/* +* History: +* +* Based on mpc5200_rtc.c written by Domen Puncer <domen.puncer@telargo.=
com>
drivers/rtc/rtc-mpc5121.c line 17
Quoted 2 lines
drivers/rtc/rtc-mpc5121.c new file +2
-0+* =A0 posted to linuxppc-embedded mailing list: +* =A0 =A0 http://patchwork.ozlabs.org/linuxppc-embedded/patch?id=3D1167=
5
drivers/rtc/rtc-mpc5121.c
Quoted 6 lines
drivers/rtc/rtc-mpc5121.c new file +6
-0+* =A0 but never committed to any public tree. +* +* Author: John Rigby <[email protected]> +* =A0 Converted to 5121 rtc driver. +* +* =A0 Make alarms more sane by dealing with lack of second alarm resolu=
tion.
drivers/rtc/rtc-mpc5121.c line 25
Quoted 2 lines
drivers/rtc/rtc-mpc5121.c new file +2
-0+* +* =A0 Use actual_time time register for time keeping since it is persis=
tent
drivers/rtc/rtc-mpc5121.c line 26
Quoted 1 line
drivers/rtc/rtc-mpc5121.c new file +1
-0+* =A0 and the normal rtc registers are not. =A0Use target_time register=
as an
Quoted 42 lines
drivers/rtc/rtc-mpc5121.c new file +42
-0+* =A0 offset to linux time. +* +*/ + +#include <linux/module.h> +#include <linux/rtc.h> +#include <linux/of_device.h> +#include <linux/of_platform.h> +#include <linux/io.h> + +struct mpc5121_rtc_regs { + =A0 =A0 =A0 u8 set_time; =A0 =A0 =A0 =A0 =A0 =A0/* RTC + 0x00 */ + =A0 =A0 =A0 u8 hour_set; =A0 =A0 =A0 =A0 =A0 =A0/* RTC + 0x01 */ + =A0 =A0 =A0 u8 minute_set; =A0 =A0 =A0 =A0 =A0/* RTC + 0x02 */ + =A0 =A0 =A0 u8 second_set; =A0 =A0 =A0 =A0 =A0/* RTC + 0x03 */ + + =A0 =A0 =A0 u8 set_date; =A0 =A0 =A0 =A0 =A0 =A0/* RTC + 0x04 */ + =A0 =A0 =A0 u8 month_set; =A0 =A0 =A0 =A0 =A0 /* RTC + 0x05 */ + =A0 =A0 =A0 u8 weekday_set; =A0 =A0 =A0 =A0 /* RTC + 0x06 */ + =A0 =A0 =A0 u8 date_set; =A0 =A0 =A0 =A0 =A0 =A0/* RTC + 0x07 */ + + =A0 =A0 =A0 u8 write_sw; =A0 =A0 =A0 =A0 =A0 =A0/* RTC + 0x08 */ + =A0 =A0 =A0 u8 sw_set; =A0 =A0 =A0 =A0 =A0 =A0 =A0/* RTC + 0x09 */ + =A0 =A0 =A0 u16 year_set; =A0 =A0 =A0 =A0 =A0 /* RTC + 0x0a */ + + =A0 =A0 =A0 u8 alm_enable; =A0 =A0 =A0 =A0 =A0/* RTC + 0x0c */ + =A0 =A0 =A0 u8 alm_hour_set; =A0 =A0 =A0 =A0/* RTC + 0x0d */ + =A0 =A0 =A0 u8 alm_min_set; =A0 =A0 =A0 =A0 /* RTC + 0x0e */ + =A0 =A0 =A0 u8 int_enable; =A0 =A0 =A0 =A0 =A0/* RTC + 0x0f */ + + =A0 =A0 =A0 u8 reserved1; + =A0 =A0 =A0 u8 hour; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* RTC + 0x11 */ + =A0 =A0 =A0 u8 minute; =A0 =A0 =A0 =A0 =A0 =A0 =A0/* RTC + 0x12 */ + =A0 =A0 =A0 u8 second; =A0 =A0 =A0 =A0 =A0 =A0 =A0/* RTC + 0x13 */ + + =A0 =A0 =A0 u8 month; =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* RTC + 0x14 */ + =A0 =A0 =A0 u8 wday_mday; =A0 =A0 =A0 =A0 =A0 /* RTC + 0x15 */ + =A0 =A0 =A0 u16 year; =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* RTC + 0x16 */ + + =A0 =A0 =A0 u8 int_alm; =A0 =A0 =A0 =A0 =A0 =A0 /* RTC + 0x18 */ + =A0 =A0 =A0 u8 int_sw; =A0 =A0 =A0 =A0 =A0 =A0 =A0/* RTC + 0x19 */ + =A0 =A0 =A0 u8 alm_status; =A0 =A0 =A0 =A0 =A0/* RTC + 0x1a */
drivers/rtc/rtc-mpc5121.c line 78
Quoted 10 lines
drivers/rtc/rtc-mpc5121.c new file +10
-0+ =A0 =A0 =A0 u8 sw_minute; =A0 =A0 =A0 =A0 =A0 /* RTC + 0x1b */ + + =A0 =A0 =A0 u8 bus_error_1; =A0 =A0 =A0 =A0 /* RTC + 0x1c */ + =A0 =A0 =A0 u8 int_day; =A0 =A0 =A0 =A0 =A0 =A0 /* RTC + 0x1d */ + =A0 =A0 =A0 u8 int_min; =A0 =A0 =A0 =A0 =A0 =A0 /* RTC + 0x1e */ + =A0 =A0 =A0 u8 int_sec; =A0 =A0 =A0 =A0 =A0 =A0 /* RTC + 0x1f */ + + =A0 =A0 =A0 /* +=A0 =A0 =A0 =A0* target_time: +=A0 =A0 =A0 =A0* =A0 =A0 =A0intended to be used for hibernation but hib=
ernation
drivers/rtc/rtc-mpc5121.c line 79
Quoted 1 line
drivers/rtc/rtc-mpc5121.c new file +1
-0+ =A0 =A0 =A0 =A0* =A0 =A0 =A0does not work on silicon rev 1.5 so use it =
for non-volatile
drivers/rtc/rtc-mpc5121.c line 80
Quoted 1 line
drivers/rtc/rtc-mpc5121.c new file +1
-0+ =A0 =A0 =A0 =A0* =A0 =A0 =A0storage of offset between the actual_time r=
egister and linux
drivers/rtc/rtc-mpc5121.c line 86
Quoted 6 lines
drivers/rtc/rtc-mpc5121.c new file +6
-0+=A0 =A0 =A0 =A0* =A0 =A0 =A0time +=A0 =A0 =A0 =A0*/ + =A0 =A0 =A0 u32 target_time; =A0 =A0 =A0 =A0/* RTC + 0x20 */ + =A0 =A0 =A0 /* +=A0 =A0 =A0 =A0* actual_time: +=A0 =A0 =A0 =A0* =A0 =A0 =A0readonly time since VBAT_RTC was last conne=
cted
Quoted 9 lines
drivers/rtc/rtc-mpc5121.c new file +9
-0+=A0 =A0 =A0 =A0*/ + =A0 =A0 =A0 u32 actual_time; =A0 =A0 =A0 =A0/* RTC + 0x24 */ + =A0 =A0 =A0 u32 keep_alive; =A0 =A0 =A0 =A0 /* RTC + 0x28 */ +}; + +struct mpc5121_rtc_data { + =A0 =A0 =A0 unsigned irq; + =A0 =A0 =A0 unsigned irq_periodic; + =A0 =A0 =A0 struct mpc5121_rtc_regs __iomem *regs;
drivers/rtc/rtc-mpc5121.c
Quoted 10 lines
drivers/rtc/rtc-mpc5121.c new file +10
-0+ =A0 =A0 =A0 struct rtc_device *rtc; + =A0 =A0 =A0 struct rtc_wkalrm wkalarm; +}; + +/* +* Update second/minute/hour registers. +* +* This is just so alarm will work. +*/ +static void mpc5121_rtc_update_smh(struct mpc5121_rtc_regs __iomem *regs=
,
Quoted 4 lines
drivers/rtc/rtc-mpc5121.c new file +4
-0+ =A0 =A0 =A0 struct rtc_time *tm) +{ + =A0 =A0 =A0 out_8(®s->second_set, tm->tm_sec); + =A0 =A0 =A0 out_8(®s->minute_set, tm->tm_min);
drivers/rtc/rtc-mpc5121.c line 119
Quoted 10 lines
drivers/rtc/rtc-mpc5121.c new file +10
-0+ =A0 =A0 =A0 out_8(®s->hour_set, tm->tm_hour); + + =A0 =A0 =A0 /* set time sequence */ + =A0 =A0 =A0 out_8(®s->set_time, 0x1); + =A0 =A0 =A0 out_8(®s->set_time, 0x3); + =A0 =A0 =A0 out_8(®s->set_time, 0x1); + =A0 =A0 =A0 out_8(®s->set_time, 0x0); +} + +static int mpc5121_rtc_read_time(struct device *dev, struct rtc_time *tm=
)
drivers/rtc/rtc-mpc5121.c line 126
Quoted 7 lines
drivers/rtc/rtc-mpc5121.c new file +7
-0+{ + =A0 =A0 =A0 struct mpc5121_rtc_data *rtc =3D dev_get_drvdata(dev); + =A0 =A0 =A0 struct mpc5121_rtc_regs __iomem *regs =3D rtc->regs; + =A0 =A0 =A0 unsigned long now; + + =A0 =A0 =A0 /* +=A0 =A0 =A0 =A0* linux time is actual_time plus the offset saved in tar=
get_time
drivers/rtc/rtc-mpc5121.c line 128
Quoted 2 lines
drivers/rtc/rtc-mpc5121.c new file +2
-0+=A0 =A0 =A0 =A0*/ + =A0 =A0 =A0 now =3D in_be32(®s->actual_time) + in_be32(®s->target=
_time);
Quoted 12 lines
drivers/rtc/rtc-mpc5121.c new file +12
-0+ + =A0 =A0 =A0 rtc_time_to_tm(now, tm); + + =A0 =A0 =A0 /* +=A0 =A0 =A0 =A0* update second minute hour registers +=A0 =A0 =A0 =A0* so alarms will work +=A0 =A0 =A0 =A0*/ + =A0 =A0 =A0 mpc5121_rtc_update_smh(regs, tm); + + =A0 =A0 =A0 return 0; +} +
drivers/rtc/rtc-mpc5121.c line 150
Quoted 10 lines
drivers/rtc/rtc-mpc5121.c new file +10
-0+static int mpc5121_rtc_set_time (struct device *dev,struct rtc_time *tm) +{ + =A0 =A0 =A0 struct mpc5121_rtc_data *rtc =3D dev_get_drvdata(dev); + =A0 =A0 =A0 struct mpc5121_rtc_regs __iomem *regs =3D rtc->regs; + =A0 =A0 =A0 int ret; + =A0 =A0 =A0 unsigned long now; + + + =A0 =A0 =A0 /* +=A0 =A0 =A0 =A0* The actual_time register is read only so we write the =
offset
drivers/rtc/rtc-mpc5121.c line 155
Quoted 5 lines
drivers/rtc/rtc-mpc5121.c new file +5
-0+=A0 =A0 =A0 =A0* between it and linux time to the target_time register. +=A0 =A0 =A0 =A0*/ + =A0 =A0 =A0 ret =3D rtc_tm_to_time(tm, &now); + =A0 =A0 =A0 if (ret =3D=3D 0) + =A0 =A0 =A0 =A0 =A0 =A0 =A0 out_be32(®s->target_time, now - in_be32(=
®s->actual_time));
drivers/rtc/rtc-mpc5121.c line 166
Quoted 11 lines
drivers/rtc/rtc-mpc5121.c new file +11
-0+ + =A0 =A0 =A0 /* +=A0 =A0 =A0 =A0* update second minute hour registers +=A0 =A0 =A0 =A0* so alarms will work +=A0 =A0 =A0 =A0*/ + =A0 =A0 =A0 mpc5121_rtc_update_smh(regs, tm); + + =A0 =A0 =A0 return 0; +} + +static int mpc5121_rtc_read_alarm(struct device *dev, struct rtc_wkalrm =
*alarm)
drivers/rtc/rtc-mpc5121.c
Quoted 12 lines
drivers/rtc/rtc-mpc5121.c new file +12
-0+{ + =A0 =A0 =A0 struct mpc5121_rtc_data *rtc =3D dev_get_drvdata(dev); + =A0 =A0 =A0 struct mpc5121_rtc_regs __iomem *regs =3D rtc->regs; + + =A0 =A0 =A0 *alarm =3D rtc->wkalarm; + + =A0 =A0 =A0 alarm->pending =3D in_8(®s->alm_status); + + =A0 =A0 =A0 return 0; +} + +static int mpc5121_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *=
alarm)
Quoted 4 lines
drivers/rtc/rtc-mpc5121.c new file +4
-0+{ + =A0 =A0 =A0 struct mpc5121_rtc_data *rtc =3D dev_get_drvdata(dev); + =A0 =A0 =A0 struct mpc5121_rtc_regs __iomem *regs =3D rtc->regs; +
drivers/rtc/rtc-mpc5121.c line 192
Quoted 10 lines
drivers/rtc/rtc-mpc5121.c new file +10
-0+ =A0 =A0 =A0 /* + =A0 =A0 =A0 =A0* the alarm has no seconds so deal with it + =A0 =A0 =A0 =A0*/ + =A0 =A0 =A0 if (alarm->time.tm_sec) { + =A0 =A0 =A0 =A0 =A0 =A0 =A0 alarm->time.tm_sec =3D 0; + =A0 =A0 =A0 =A0 =A0 =A0 =A0 alarm->time.tm_min++; + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (alarm->time.tm_min >=3D 60) { + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 alarm->time.tm_min =3D 0; + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 alarm->time.tm_hour++; + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (alarm->time.tm_hour >=
=3D 24)
drivers/rtc/rtc-mpc5121.c line 193
Quoted 1 line
drivers/rtc/rtc-mpc5121.c new file +1
-0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 alarm->time=
.tm_hour =3D 0;
Quoted 9 lines
drivers/rtc/rtc-mpc5121.c new file +9
-0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 } + =A0 =A0 =A0 } + + =A0 =A0 =A0 alarm->time.tm_mday =3D -1; + =A0 =A0 =A0 alarm->time.tm_mon =3D -1; + =A0 =A0 =A0 alarm->time.tm_year =3D -1; + + =A0 =A0 =A0 out_8(®s->alm_min_set, alarm->time.tm_min); + =A0 =A0 =A0 out_8(®s->alm_hour_set, alarm->time.tm_hour);
drivers/rtc/rtc-mpc5121.c line 212
Quoted 10 lines
drivers/rtc/rtc-mpc5121.c new file +10
-0+ + =A0 =A0 =A0 out_8(®s->alm_enable, alarm->enabled); + + =A0 =A0 =A0 rtc->wkalarm =3D *alarm; + =A0 =A0 =A0 return 0; +} + +static irqreturn_t mpc5121_rtc_handler(int irq, void *dev) +{ + =A0 =A0 =A0 struct mpc5121_rtc_data *rtc =3D dev_get_drvdata((struct de=
vice *)dev);
drivers/rtc/rtc-mpc5121.c line 220
Quoted 8 lines
drivers/rtc/rtc-mpc5121.c new file +8
-0+ =A0 =A0 =A0 struct mpc5121_rtc_regs __iomem *regs =3D rtc->regs; + + =A0 =A0 =A0 if (in_8(®s->int_alm)) { + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* acknowledge and clear status */ + =A0 =A0 =A0 =A0 =A0 =A0 =A0 out_8(®s->int_alm, 1); + =A0 =A0 =A0 =A0 =A0 =A0 =A0 out_8(®s->alm_status, 1); + + =A0 =A0 =A0 =A0 =A0 =A0 =A0 rtc_update_irq(rtc->rtc, 1, RTC_IRQF | RTC_=
AF);
drivers/rtc/rtc-mpc5121.c
Quoted 9 lines
drivers/rtc/rtc-mpc5121.c new file +9
-0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 return IRQ_HANDLED; + =A0 =A0 =A0 } + + =A0 =A0 =A0 return IRQ_NONE; +} + +static irqreturn_t mpc5121_rtc_handler_upd(int irq, void *dev) +{ + =A0 =A0 =A0 struct mpc5121_rtc_data *rtc =3D dev_get_drvdata((struct de=
vice *)dev);
drivers/rtc/rtc-mpc5121.c line 232
Quoted 3 lines
drivers/rtc/rtc-mpc5121.c new file +3
-0+ =A0 =A0 =A0 struct mpc5121_rtc_regs __iomem *regs =3D rtc->regs; + + =A0 =A0 =A0 if (in_8(®s->int_sec) && (in_8(®s->int_enable) & 0x1)=
) {
drivers/rtc/rtc-mpc5121.c line 236
Quoted 4 lines
drivers/rtc/rtc-mpc5121.c new file +4
-0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* acknowledge */ + =A0 =A0 =A0 =A0 =A0 =A0 =A0 out_8(®s->int_sec, 1); + + =A0 =A0 =A0 =A0 =A0 =A0 =A0 rtc_update_irq(rtc->rtc, 1, RTC_IRQF | RTC_=
UF);
drivers/rtc/rtc-mpc5121.c
Quoted 8 lines
drivers/rtc/rtc-mpc5121.c new file +8
-0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 return IRQ_HANDLED; + =A0 =A0 =A0 } + + =A0 =A0 =A0 return IRQ_NONE; +} + +static int mpc5121_rtc_ioctl(struct device *dev, unsigned int cmd, + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 unsigned long arg)
Quoted 9 lines
drivers/rtc/rtc-mpc5121.c new file +9
-0+{ + =A0 =A0 =A0 struct mpc5121_rtc_data *rtc =3D dev_get_drvdata(dev); + =A0 =A0 =A0 struct mpc5121_rtc_regs __iomem *regs =3D rtc->regs; + + =A0 =A0 =A0 switch (cmd) { + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* alarm interrupt */ + =A0 =A0 =A0 case RTC_AIE_ON: + =A0 =A0 =A0 =A0 =A0 =A0 =A0 out_8(®s->alm_enable, 1); + =A0 =A0 =A0 =A0 =A0 =A0 =A0 rtc->wkalarm.enabled =3D 1;
drivers/rtc/rtc-mpc5121.c line 263
Quoted 10 lines
drivers/rtc/rtc-mpc5121.c new file +10
-0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; + =A0 =A0 =A0 case RTC_AIE_OFF: + =A0 =A0 =A0 =A0 =A0 =A0 =A0 out_8(®s->alm_enable, 0); + =A0 =A0 =A0 =A0 =A0 =A0 =A0 rtc->wkalarm.enabled =3D 0; + =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; + + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* update interrupt */ + =A0 =A0 =A0 case RTC_UIE_ON: + =A0 =A0 =A0 =A0 =A0 =A0 =A0 out_8(®s->int_enable, + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (in_8(®s=
->int_enable) & ~0x8) | 0x1);
drivers/rtc/rtc-mpc5121.c line 266
Quoted 3 lines
drivers/rtc/rtc-mpc5121.c new file +3
-0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; + =A0 =A0 =A0 case RTC_UIE_OFF: + =A0 =A0 =A0 =A0 =A0 =A0 =A0 out_8(®s->int_enable, in_8(®s->int_en=
able) & ~0x1);
Quoted 13 lines
drivers/rtc/rtc-mpc5121.c new file +13
-0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; + + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* no periodic interrupts */ + =A0 =A0 =A0 case RTC_IRQP_READ: + =A0 =A0 =A0 case RTC_IRQP_SET: + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -ENOTTY; + + =A0 =A0 =A0 default: + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -ENOIOCTLCMD; + =A0 =A0 =A0 } + =A0 =A0 =A0 return 0; +} +
drivers/rtc/rtc-mpc5121.c line 289
Quoted 10 lines
drivers/rtc/rtc-mpc5121.c new file +10
-0+static const struct rtc_class_ops mpc5121_rtc_ops =3D { + =A0 =A0 =A0 .read_time =3D mpc5121_rtc_read_time, + =A0 =A0 =A0 .set_time =3D mpc5121_rtc_set_time, + =A0 =A0 =A0 .read_alarm =3D mpc5121_rtc_read_alarm, + =A0 =A0 =A0 .set_alarm =3D mpc5121_rtc_set_alarm, + =A0 =A0 =A0 .ioctl =3D mpc5121_rtc_ioctl, +}; + +static int __devinit mpc5121_rtc_probe(struct of_device *op, + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
=A0 const struct of_device_id *match)
Quoted 5 lines
drivers/rtc/rtc-mpc5121.c new file +5
-0+{ + =A0 =A0 =A0 struct mpc5121_rtc_data *rtc; + =A0 =A0 =A0 int err =3D 0; + =A0 =A0 =A0 u32 ka; +
drivers/rtc/rtc-mpc5121.c line 304
Quoted 10 lines
drivers/rtc/rtc-mpc5121.c new file +10
-0+ =A0 =A0 =A0 rtc =3D kzalloc(sizeof(*rtc), GFP_KERNEL); + =A0 =A0 =A0 if (!rtc) { + =A0 =A0 =A0 =A0 =A0 =A0 =A0 err =3D -ENOMEM; + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto out; + =A0 =A0 =A0 } + + =A0 =A0 =A0 rtc->regs =3D of_iomap(op->node, 0); + + =A0 =A0 =A0 if (!rtc->regs) { + =A0 =A0 =A0 =A0 =A0 =A0 =A0 printk(KERN_ERR "%s: couldn't map io space\=
n", __func__);
drivers/rtc/rtc-mpc5121.c line 312
Quoted 8 lines
drivers/rtc/rtc-mpc5121.c new file +8
-0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 err =3D -ENOSYS; + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto out_free; + =A0 =A0 =A0 } + + =A0 =A0 =A0 device_init_wakeup(&op->dev, 1); + + =A0 =A0 =A0 rtc->rtc =3D rtc_device_register("mpc5121-rtc", &op->dev, + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
=A0 =A0 =A0 =A0 =A0 &mpc5121_rtc_ops, THIS_MODULE);
drivers/rtc/rtc-mpc5121.c line 321
Quoted 9 lines
drivers/rtc/rtc-mpc5121.c new file +9
-0+ =A0 =A0 =A0 if (IS_ERR(rtc->rtc)) { + =A0 =A0 =A0 =A0 =A0 =A0 =A0 err =3D PTR_ERR(rtc->rtc); + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto out_unmap; + =A0 =A0 =A0 } + + =A0 =A0 =A0 dev_set_drvdata(&op->dev, rtc); + + =A0 =A0 =A0 rtc->irq =3D irq_of_parse_and_map(op->node, 1); + =A0 =A0 =A0 err =3D request_irq(rtc->irq, mpc5121_rtc_handler, IRQF_DIS=
ABLED,
drivers/rtc/rtc-mpc5121.c line 322
Quoted 1 line
drivers/rtc/rtc-mpc5121.c new file +1
-0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
=A0 =A0 =A0 =A0 =A0 "mpc5121-rtc", &op->dev);
drivers/rtc/rtc-mpc5121.c line 324
Quoted 2 lines
drivers/rtc/rtc-mpc5121.c new file +2
-0+ =A0 =A0 =A0 if (err) { + =A0 =A0 =A0 =A0 =A0 =A0 =A0 printk(KERN_ERR "%s: could not request irq:=
%i\n",
drivers/rtc/rtc-mpc5121.c line 325
Quoted 1 line
drivers/rtc/rtc-mpc5121.c new file +1
-0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 __func__, rtc->irq);
drivers/rtc/rtc-mpc5121.c line 330
Quoted 5 lines
drivers/rtc/rtc-mpc5121.c new file +5
-0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto out_dispose; + =A0 =A0 =A0 } + + =A0 =A0 =A0 rtc->irq_periodic =3D irq_of_parse_and_map(op->node, 0); + =A0 =A0 =A0 err =3D request_irq(rtc->irq_periodic, mpc5121_rtc_handler_=
upd,
drivers/rtc/rtc-mpc5121.c line 331
Quoted 1 line
drivers/rtc/rtc-mpc5121.c new file +1
-0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0IRQF_DIS=
ABLED, "mpc5121-rtc_upd", &op->dev);
drivers/rtc/rtc-mpc5121.c line 333
Quoted 2 lines
drivers/rtc/rtc-mpc5121.c new file +2
-0+ =A0 =A0 =A0 if (err) { + =A0 =A0 =A0 =A0 =A0 =A0 =A0 printk(KERN_ERR "%s: could not request irq:=
%i\n",
drivers/rtc/rtc-mpc5121.c line 334
Quoted 1 line
drivers/rtc/rtc-mpc5121.c new file +1
-0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
=A0 =A0 =A0 =A0 =A0 __func__, rtc->irq_periodic);
drivers/rtc/rtc-mpc5121.c line 341
Quoted 7 lines
drivers/rtc/rtc-mpc5121.c new file +7
-0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto out_dispose2; + =A0 =A0 =A0 } + + =A0 =A0 =A0 ka =3D in_be32(&rtc->regs->keep_alive); + =A0 =A0 =A0 if (ka & 0x02) { + =A0 =A0 =A0 =A0 =A0 =A0 =A0 printk(KERN_WARNING + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "mpc5121-rtc: Battery or os=
cillator failure!\n");
Quoted 68 lines
drivers/rtc/rtc-mpc5121.c new file +67
-1+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 out_be32(&rtc->regs->keep_alive, ka); + =A0 =A0 =A0 } + + =A0 =A0 =A0 goto out; + +out_dispose2: + =A0 =A0 =A0 irq_dispose_mapping(rtc->irq_periodic); + =A0 =A0 =A0 free_irq(rtc->irq, &op->dev); +out_dispose: + =A0 =A0 =A0 irq_dispose_mapping(rtc->irq); +out_unmap: + =A0 =A0 =A0 iounmap(rtc->regs); +out_free: + =A0 =A0 =A0 kfree(rtc); +out: + =A0 =A0 =A0 return err; +} + +static int __devexit mpc5121_rtc_remove(struct of_device *op) +{ + =A0 =A0 =A0 struct mpc5121_rtc_data *rtc =3D dev_get_drvdata(&op->dev); + =A0 =A0 =A0 struct mpc5121_rtc_regs __iomem *regs =3D rtc->regs; + + =A0 =A0 =A0 /* disable interrupt, so there are no nasty surprises */ + =A0 =A0 =A0 out_8(®s->alm_enable, 0); + =A0 =A0 =A0 out_8(®s->int_enable, in_8(®s->int_enable) & ~0x1); + + =A0 =A0 =A0 rtc_device_unregister(rtc->rtc); + =A0 =A0 =A0 iounmap(rtc->regs); + =A0 =A0 =A0 free_irq(rtc->irq, &op->dev); + =A0 =A0 =A0 free_irq(rtc->irq_periodic, &op->dev); + =A0 =A0 =A0 irq_dispose_mapping(rtc->irq); + =A0 =A0 =A0 irq_dispose_mapping(rtc->irq_periodic); + =A0 =A0 =A0 dev_set_drvdata(&op->dev, NULL); + =A0 =A0 =A0 kfree(rtc); + + =A0 =A0 =A0 return 0; +} + +static struct of_device_id mpc5121_rtc_match[] =3D { + =A0 =A0 =A0 { .compatible =3D "fsl,mpc5121-rtc", }, + =A0 =A0 =A0 {}, +}; + +static struct of_platform_driver mpc5121_rtc_driver =3D { + =A0 =A0 =A0 .owner =3D THIS_MODULE, + =A0 =A0 =A0 .name =3D "mpc5121-rtc", + =A0 =A0 =A0 .match_table =3D mpc5121_rtc_match, + =A0 =A0 =A0 .probe =3D mpc5121_rtc_probe, + =A0 =A0 =A0 .remove =3D mpc5121_rtc_remove, +}; + +static int __init mpc5121_rtc_init (void ) +{ + =A0 =A0 =A0 return of_register_platform_driver(&mpc5121_rtc_driver); +} + +static void __exit mpc5121_rtc_exit(void) +{ + =A0 =A0 =A0 of_unregister_platform_driver(&mpc5121_rtc_driver); +} + +MODULE_LICENSE ("GPL" ); +MODULE_AUTHOR ("John Rigby <[email protected]>" ); + +module_init (mpc5121_rtc_init); +module_exit (mpc5121_rtc_exit); --
Quoted 3 lines
1.6.0.6
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
Re: [PATCH 10/12] mpc5121: Add MPC5121 Real time clock driver.
In reply to Wolfgang DenkQuoted 10 lines · Wolfgang Denk
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*
Why not changing it to mpc5xxx? From a glimpse, it should still work on MPC5200, too.
Regards,
Wolfram
Signature · 2 lines
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ |
Re: [PATCH 10/12] mpc5121: Add MPC5121 Real time clock driver.
Quoted 6 lines · Wolfram Sang
Quoted 5 lines · Wolfgang Denk
From: John Rigby <[email protected]>
Based on Domen Puncer's rtc driver for 5200 posted to
the ppclinux mailing list:
=A0 =A0 =A0 http://patchwork.ozlabs.org/linuxppc-embedded/patch?id=3D116=
75
Quoted 8 lines
Quoted 5 lines
but never commited anywhere.
Changes to Domen's original:
=A0 =A0 Changed filenames/routine names from mpc5200* to mpc5121*
Why not changing it to mpc5xxx? From a glimpse, it should still work on MPC5200, too.
If this is true, the I heartily agree with Wolfram. :-)
g.
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
Re: [rtc-linux] Re: [PATCH 10/12] mpc5121: Add MPC5121 Real time clock driver.
Can we get 5121 support in and add 5200 support later? They are not identical.
Quoted 34 lines · Grant Likely
Quoted 8 lines · Wolfram Sang
Quoted 7 lines · Wolfgang Denk
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.Quoted 6 lines
Quoted 3 lines
Changes to Domen's original:
Changed filenames/routine names from mpc5200* to mpc5121*
Why not changing it to mpc5xxx? From a glimpse, it should still work on MPC5200, too.
If this is true, the I heartily agree with Wolfram. :-)
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
-~----------~----~----~----~------~----~------~--~---
Re: [rtc-linux] Re: [PATCH 10/12] mpc5121: Add MPC5121 Real time clock driver.
Quoted 2 lines · John Rigby
Can we get 5121 support in and add 5200 support later?=A0 They are not identical.
That is fine by me, but since it is known that it will eventually support both, I'd like it to be renamed to 5xxx before it is merged to avoid a later rename patch.
g.
Quoted 11 lines
Quoted 9 lines · Grant Likely
Quoted 6 lines · Wolfram Sang
Quoted 5 lines · Wolfgang Denk
From: John Rigby <[email protected]>
Based on Domen Puncer's rtc driver for 5200 posted to
the ppclinux mailing list:
=A0 =A0 =A0 http://patchwork.ozlabs.org/linuxppc-embedded/patch?id=3D=
11675
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
but never commited anywhere.
Changes to Domen's original:
=A0 =A0 Changed filenames/routine names from mpc5200* to mpc5121*
Why not changing it to mpc5xxx? From a glimpse, it should still work o=
n
Quoted 19 lines
Quoted 10 lines
Quoted 1 line
MPC5200, too.
If this is true, the I heartily agree with Wolfram. =A0:-)
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.Quoted 7 lines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
-~----------~----~----~----~------~----~------~--~---
Quoted 5 lines
_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
Re: [rtc-linux] Re: [PATCH 10/12] mpc5121: Add MPC5121 Real time clock driver.
Quoted 3 lines · On Fri, 8 May 2009 09:53:20 -0600 Grant Likely <[email protected]>…
That is fine by me, but since it is known that it will eventually support both, I'd like it to be renamed to 5xxx before it is merged to avoid a later rename patch.
sorry, forget my last email, I misread the codes.
Signature · 6 lines
Best regards, Alessandro Zummo, Tower Technologies - Torino, Italy http://www.towertech.it
Re: [rtc-linux] Re: [PATCH 10/12] mpc5121: Add MPC5121 Real time clock driver.
In reply to Grant LikelyQuoted 3 lines · On Fri, 8 May 2009 09:53:20 -0600 Grant Likely <[email protected]>…
That is fine by me, but since it is known that it will eventually support both, I'd like it to be renamed to 5xxx before it is merged to avoid a later rename patch.
or 52xx ?
Signature · 6 lines
Best regards, Alessandro Zummo, Tower Technologies - Torino, Italy http://www.towertech.it
Re: [rtc-linux] Re: [PATCH 10/12] mpc5121: Add MPC5121 Real time clock driver.
Dear Alessandro Zummo,
Quoted 8 lines · In message <[email protected]> you wrote:
Quoted 3 lines · On Fri, 8 May 2009 09:53:20 -0600 Grant Likely <[email protected]>…
That is fine by me, but since it is known that it will eventually support both, I'd like it to be renamed to 5xxx before it is merged to avoid a later rename patch.
or 52xx ?
No, because the current version is for MPC5>1<2x
Best regards,
Wolfgang Denk
Signature · 7 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected] Misquotation is, in fact, the pride and privilege of the learned. A widely-read man never quotes accurately, for the rather obvious reason that he has read too widely. - Hesketh Pearson _Common Misquotations_ introduction
PATCH 11/12 mpc5121: Added MPC512x DMA driver.
In reply to Wolfgang DenkFrom: Piotr Ziecik <[email protected]>
This patch adds initial version of MPC512x DMA driver. Only memory to memory transfers are currenly supported.
--- 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
@@ -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
@@ -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
@@ -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
@@ -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 · 1 line
1.6.0.6
Re: [PATCH 11/12] mpc5121: Added MPC512x DMA driver.
Quoted 9 lines · Wolfgang Denk
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]>
Don't have time to review this in detail right now, but three quick comment= s:
Quoted 1 line
=A0drivers/dma/mpc512x_dma.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0=
642 ++++++++++++++++++++++++++
Quoted 1 line
=A0drivers/dma/mpc512x_dma.h =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0=
192 ++++++++
It looks to me like these two files should be merged.
arch/powerpc/boot/dts=
Quoted 1 line
arch/powerpc/boot/dts= renamed from arch/powerpc/boot/dts/mpc5121ads.dts +0
-0
/mpc5121ads.dts
arch/powerpc/boot/dts/mpc5121ads.dts line 376
Quoted 8 lines
index c2d9de9..e7f0e09 100644
arch/powerpc/boot/dts/mpc5121ads.dts +0
-1@@ -373,7 +373,7 @@ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0dma@14000 { - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 compatible =3D "fsl,mpc5121=
-dma2";
arch/powerpc/boot/dts/mpc5121ads.dts line 376
Quoted 1 line
arch/powerpc/boot/dts/mpc5121ads.dts +1
-0+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 compatible =3D "fsl,mpc512x=
-dma";
Nack. Compatible values should not use wildcards. Be specific. And be specific about what it is compatible to if another part implements the same device.
Quoted 3 lines
arch/powerpc/boot/dts/mpc5121ads.dts +0
-0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0reg =3D <0x14000 0x1800>; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D <65 0x8>;=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D < &ip=
ic >;
arch/powerpc/=
Quoted 1 line
arch/powerpc/= renamed from arch/powerpc/platforms/512x/mpc512x_shared.c +0
-0
platforms/512x/mpc512x_shared.c
arch/powerpc/platforms/512x/mpc512x_shared.c void __init mpc512x_init_i2c(void) · line 98
Quoted 8 lines
index b776e45..135fd6b 100644
arch/powerpc/platforms/512x/mpc512x_shared.c +1
-0@@ -95,6 +95,7 @@ void __init mpc512x_init_i2c(void) =A0static struct of_device_id __initdata of_bus_ids[] =3D { =A0 =A0 =A0 =A0{ .compatible =3D "fsl,mpc5121-immr", }, =A0 =A0 =A0 =A0{ .compatible =3D "fsl,mpc5121-localbus", }, + =A0 =A0 =A0 { .compatible =3D "fsl,mpc5121-dma", },
This doesn't look right either. Shouldn't the dma device hang off the IMMR node?
g.
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
Re: [PATCH 11/12] mpc5121: Added MPC512x DMA driver.
Quoted 28 lines · Grant Likely
Quoted 9 lines · Wolfgang Denk
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]>Don't have time to review this in detail right now, but three quick comments:
Quoted 1 line
drivers/dma/mpc512x_dma.c | 642++++++++++++++++++++++++++
Quoted 1 line
drivers/dma/mpc512x_dma.h | 192 ++++++++It looks to me like these two files should be merged.
Review
Quoted 1 line
(quoted diff) +0
-0
b/arch/powerpc/boot/dts/mpc5121ads.dtsQuoted 6 lines
index c2d9de9..e7f0e09 100644
arch/powerpc/boot/dts/mpc5121ads.dts +0
-0@@ -373,7 +373,7 @@ };
Quoted 7 lines
arch/powerpc/boot/dts/mpc5121ads.dts line 376
Quoted 3 lines
arch/powerpc/boot/dts/mpc5121ads.dts +1
-1dma@14000 { - compatible = "fsl,mpc5121-dma2"; + compatible = "fsl,mpc512x-dma";Nack. Compatible values should not use wildcards. Be specific. And be specific about what it is compatible to if another part implements the same device.
The internal name for the dma module was dma2 that is where the orginal name came from. There is a dma2 in some 8xxx but last I looked it is not at all the same. I would vote for fsl,mpc5121-dma.
Quoted 7 lines
Review
Quoted 6 lines
arch/powerpc/boot/dts/mpc5121ads.dts +0
-0reg = <0x14000 0x1800>; interrupts = <65 0x8>; interrupt-parent = < &ipic >;(quoted diff) +0
-0
b/arch/powerpc/platforms/512x/mpc512x_shared.c
Quoted 11 lines
arch/powerpc/platforms/512x/mpc512x_shared.c void __init mpc512x_init_i2c(void) · line 98
Quoted 8 lines
index b776e45..135fd6b 100644
arch/powerpc/platforms/512x/mpc512x_shared.c +1
-0@@ -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" , },This doesn't look right either. Shouldn't the dma device hang off the IMMR node?
Yes dma is part of IMMR.
Quoted 8 lines
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
Re: [PATCH 11/12] mpc5121: Added MPC512x DMA driver.
In reply to Wolfgang DenkSince you have reuse most part of our BSP, why should you reinvent wheel for MPC512x DMA? We have one ready DMA driver, which has been used by AC97, ATA, VIU etc.
Hongjun Chen
2009-05-19
发件人: Wolfgang Denk
发送时间: 2009-05-07 04:15:18
收件人: [email protected]
抄送: Piotr Ziecik; Wolfgang Denk
主题: [PATCH 11/12] mpc5121: Added MPC512x DMA driver.
From: Piotr Ziecik <[email protected]>
This patch adds initial version of MPC512x DMA driver. Only memory to memory transfers are currenly supported.
--- 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
_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH 11/12] mpc5121: Added MPC512x DMA driver.
Quoted 2 lines · Tuesday 19 May 2009 03:37:47 Hongjun Chen wrote:
Since you have reuse most part of our BSP, why should you reinvent wheel for MPC512x DMA? We have one ready DMA driver, which has been used by AC9=
7,
Quoted 2 lines
ATA, VIU etc.
Answer is simple. The old one does not fit Linux DMA API. New one uses=20 existing infrastructure which makes DMA engine aviable for existing consume= rs
in Linux kernel. For example network stack. Support for I/O <-> memory=20 transfers will be added when more consumers arrive.
=2D-=20
Best Regards.
Piotr Zi=EAcik
Re: Re: [PATCH 11/12] mpc5121: Added MPC512x DMA driver.
Hi John,
Did you use DMA driver in our FEC driver before?
Best Regards,
Hongjun Chen
2009-05-20
发件人: Piotr Zięcik
发送时间: 2009-05-19 16:05:05
收件人: Hongjun Chen
抄送: Wolfgang Denk; [email protected]
主题: Re: [PATCH 11/12] mpc5121: Added MPC512x DMA driver.
Quoted 4 lines · Tuesday 19 May 2009 03:37:47 Hongjun Chen wrote:
Since you have reuse most part of our BSP, why should you reinvent wheel for MPC512x DMA? We have one ready DMA driver, which has been used by AC97, ATA, VIU etc.
Answer is simple. The old one does not fit Linux DMA API. New one uses existing infrastructure which makes DMA engine aviable for existing consumers in Linux kernel. For example network stack. Support for I/O <- > memory transfers will be added when more consumers arrive.
Signature · 2 lines
Best Regards. Piotr Zięcik
PATCH 12/12 mpc5121: Added default config for MPC5121.
In reply to Wolfgang DenkFrom: Piotr Ziecik <[email protected]>
--- arch/powerpc/configs/mpc5121_defconfig | 1158 ++++++++++++++++++++++++++++++++ 1 files changed, 1158 insertions(+), 0 deletions(-) create mode 100644 arch/powerpc/configs/mpc5121_defconfig
arch/powerpc/configs/mpc5121_defconfig new file +1158 -0
@@ -0,0 +1,1158 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.29-rc5 +# Fri Feb 27 14:08:31 2009 +# +# CONFIG_PPC64 is not set + +# +# Processor support +# +CONFIG_6xx=y +# CONFIG_PPC_85xx is not set +# CONFIG_PPC_8xx is not set +# CONFIG_40x is not set +# CONFIG_44x is not set +# CONFIG_E200 is not set +CONFIG_PPC_FPU=y +# CONFIG_ALTIVEC is not set +CONFIG_PPC_STD_MMU=y +CONFIG_PPC_STD_MMU_32=y +# CONFIG_PPC_MM_SLICES is not set +# CONFIG_SMP is not set +CONFIG_NOT_COHERENT_CACHE=y +CONFIG_PPC32=y +CONFIG_WORD_SIZE=32 +# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set +CONFIG_MMU=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_GENERIC_TIME=y +CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_HARDIRQS=y +# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set +CONFIG_IRQ_PER_CPU=y +CONFIG_STACKTRACE_SUPPORT=y +CONFIG_HAVE_LATENCYTOP_SUPPORT=y +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_ARCH_HAS_ILOG2_U32=y +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_FIND_NEXT_BIT=y +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set +CONFIG_PPC=y +CONFIG_EARLY_PRINTK=y +CONFIG_GENERIC_NVRAM=y +CONFIG_SCHED_OMIT_FRAME_POINTER=y +CONFIG_ARCH_MAY_HAVE_PC_FDC=y +CONFIG_PPC_OF=y +CONFIG_OF=y +# CONFIG_PPC_UDBG_16550 is not set +# CONFIG_GENERIC_TBSYNC is not set +CONFIG_AUDIT_ARCH=y +CONFIG_GENERIC_BUG=y +CONFIG_DEFAULT_UIMAGE=y +# CONFIG_PPC_DCR_NATIVE is not set +# CONFIG_PPC_DCR_MMIO is not set +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" + +# +# General setup +# +CONFIG_EXPERIMENTAL=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +# CONFIG_SWAP is not set +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_TASKSTATS is not set +# CONFIG_AUDIT is not set + +# +# RCU Subsystem +# +CONFIG_CLASSIC_RCU=y +# CONFIG_TREE_RCU is not set +# CONFIG_PREEMPT_RCU is not set +# CONFIG_TREE_RCU_TRACE is not set +# CONFIG_PREEMPT_RCU_TRACE is not set +# CONFIG_IKCONFIG is not set +CONFIG_LOG_BUF_SHIFT=16 +# CONFIG_GROUP_SCHED is not set +# CONFIG_CGROUPS is not set +CONFIG_SYSFS_DEPRECATED=y +CONFIG_SYSFS_DEPRECATED_V2=y +# CONFIG_RELAY is not set +CONFIG_NAMESPACES=y +# CONFIG_UTS_NS is not set +# CONFIG_IPC_NS is not set +# CONFIG_USER_NS is not set +# CONFIG_PID_NS is not set +# CONFIG_NET_NS is not set +CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SYSCTL=y +# CONFIG_EMBEDDED is not set +CONFIG_SYSCTL_SYSCALL=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_HOTPLUG=y +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_ELF_CORE=y +# CONFIG_COMPAT_BRK is not set +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_ANON_INODES=y +CONFIG_EPOLL=y +CONFIG_SIGNALFD=y +CONFIG_TIMERFD=y +CONFIG_EVENTFD=y +CONFIG_SHMEM=y +CONFIG_AIO=y +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_PCI_QUIRKS=y +CONFIG_SLAB=y +# CONFIG_SLUB is not set +# CONFIG_SLOB is not set +# CONFIG_PROFILING is not set +CONFIG_HAVE_OPROFILE=y +# CONFIG_KPROBES is not set +CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y +CONFIG_HAVE_IOREMAP_PROT=y +CONFIG_HAVE_KPROBES=y +CONFIG_HAVE_KRETPROBES=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +CONFIG_HAVE_CLK=y +# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set +CONFIG_SLABINFO=y +CONFIG_RT_MUTEXES=y +CONFIG_BASE_SMALL=0 +CONFIG_MODULES=y +# CONFIG_MODULE_FORCE_LOAD is not set +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +# CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_BLOCK=y +# CONFIG_LBD is not set +# CONFIG_BLK_DEV_IO_TRACE is not set +# CONFIG_BLK_DEV_BSG is not set +# CONFIG_BLK_DEV_INTEGRITY is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +# CONFIG_IOSCHED_AS is not set +CONFIG_IOSCHED_DEADLINE=y +# CONFIG_IOSCHED_CFQ is not set +# CONFIG_DEFAULT_AS is not set +CONFIG_DEFAULT_DEADLINE=y +# CONFIG_DEFAULT_CFQ is not set +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_IOSCHED="deadline" +# CONFIG_FREEZER is not set +CONFIG_PPC_MSI_BITMAP=y + +# +# Platform support +# +CONFIG_PPC_MULTIPLATFORM=y +CONFIG_CLASSIC32=y +# CONFIG_PPC_CHRP is not set +CONFIG_PPC_MPC512x=y +CONFIG_PPC_MPC5121=y +CONFIG_MPC5121_ADS=y +# CONFIG_MPC5121_GENERIC is not set +# CONFIG_PPC_MPC52xx is not set +# CONFIG_PPC_PMAC is not set +# CONFIG_PPC_CELL is not set +# CONFIG_PPC_CELL_NATIVE is not set +# CONFIG_PPC_82xx is not set +# CONFIG_PQ2ADS is not set +# CONFIG_PPC_83xx is not set +# CONFIG_PPC_86xx is not set +# CONFIG_EMBEDDED6xx is not set +CONFIG_IPIC=y +# CONFIG_MPIC is not set +# CONFIG_MPIC_WEIRD is not set +# CONFIG_PPC_I8259 is not set +# CONFIG_PPC_RTAS is not set +# CONFIG_MMIO_NVRAM is not set +# CONFIG_PPC_MPC106 is not set +# CONFIG_PPC_970_NAP is not set +# CONFIG_PPC_INDIRECT_IO is not set +# CONFIG_GENERIC_IOMAP is not set +# CONFIG_CPU_FREQ is not set +# CONFIG_TAU is not set +# CONFIG_QUICC_ENGINE is not set +# CONFIG_FSL_ULI1575 is not set +# CONFIG_SIMPLE_GPIO is not set + +# +# Kernel options +# +# CONFIG_HIGHMEM is not set +CONFIG_TICK_ONESHOT=y +CONFIG_NO_HZ=y +# CONFIG_HIGH_RES_TIMERS is not set +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +# CONFIG_HZ_100 is not set +# CONFIG_HZ_250 is not set +# CONFIG_HZ_300 is not set +CONFIG_HZ_1000=y +CONFIG_HZ=1000 +# CONFIG_SCHED_HRTICK is not set +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_VOLUNTARY is not set +# CONFIG_PREEMPT is not set +CONFIG_BINFMT_ELF=y +# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set +# CONFIG_HAVE_AOUT is not set +# CONFIG_BINFMT_MISC is not set +# CONFIG_IOMMU_HELPER is not set +CONFIG_PPC_NEED_DMA_SYNC_OPS=y +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y +CONFIG_ARCH_HAS_WALK_MEMORY=y +CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y +# CONFIG_KEXEC is not set +# CONFIG_CRASH_DUMP is not set +CONFIG_ARCH_FLATMEM_ENABLE=y +CONFIG_ARCH_POPULATES_NODE_MAP=y +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_FLATMEM_MANUAL=y +# CONFIG_DISCONTIGMEM_MANUAL is not set +# CONFIG_SPARSEMEM_MANUAL is not set +CONFIG_FLATMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +CONFIG_PAGEFLAGS_EXTENDED=y +CONFIG_SPLIT_PTLOCK_CPUS=4 +# CONFIG_MIGRATION is not set +# CONFIG_PHYS_ADDR_T_64BIT is not set +CONFIG_ZONE_DMA_FLAG=1 +CONFIG_BOUNCE=y +CONFIG_VIRT_TO_BUS=y +# CONFIG_UNEVICTABLE_LRU is not set +CONFIG_PPC_4K_PAGES=y +# CONFIG_PPC_16K_PAGES is not set +# CONFIG_PPC_64K_PAGES is not set +CONFIG_FORCE_MAX_ZONEORDER=11 +CONFIG_PROC_DEVICETREE=y +# CONFIG_CMDLINE_BOOL is not set +CONFIG_EXTRA_TARGETS="" +# CONFIG_PM is not set +# CONFIG_SECCOMP is not set +CONFIG_ISA_DMA_API=y + +# +# Bus options +# +CONFIG_ZONE_DMA=y +CONFIG_GENERIC_ISA_DMA=y +CONFIG_PPC_INDIRECT_PCI=y +CONFIG_FSL_SOC=y +CONFIG_FSL_PCI=y +CONFIG_PPC_PCI_CHOICE=y +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_SYSCALL=y +CONFIG_PCIEPORTBUS=y +CONFIG_PCIEAER=y +# CONFIG_PCIEASPM is not set +CONFIG_ARCH_SUPPORTS_MSI=y +CONFIG_PCI_MSI=y +# CONFIG_PCI_LEGACY is not set +# CONFIG_PCI_STUB is not set +# CONFIG_PCCARD is not set +# CONFIG_HOTPLUG_PCI is not set +# CONFIG_HAS_RAPIDIO is not set + +# +# Advanced setup +# +# CONFIG_ADVANCED_OPTIONS is not set + +# +# Default settings for advanced configuration options are used +# +CONFIG_LOWMEM_SIZE=0x30000000 +CONFIG_PAGE_OFFSET=0xc0000000 +CONFIG_KERNEL_START=0xc0000000 +CONFIG_PHYSICAL_START=0x00000000 +CONFIG_TASK_SIZE=0xc0000000 +CONFIG_CONSISTENT_START=0xff100000 +CONFIG_CONSISTENT_SIZE=0x00200000 +CONFIG_NET=y + +# +# Networking options +# +CONFIG_COMPAT_NET_DEV_OPS=y +CONFIG_PACKET=y +# CONFIG_PACKET_MMAP is not set +CONFIG_UNIX=y +# CONFIG_NET_KEY is not set +CONFIG_INET=y +# CONFIG_IP_MULTICAST is not set +# CONFIG_IP_ADVANCED_ROUTER is not set +CONFIG_IP_FIB_HASH=y +CONFIG_IP_PNP=y +# CONFIG_IP_PNP_DHCP is not set +# CONFIG_IP_PNP_BOOTP is not set +# CONFIG_IP_PNP_RARP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_ARPD is not set +# CONFIG_SYN_COOKIES is not set +# CONFIG_INET_AH is not set +# CONFIG_INET_ESP is not set +# CONFIG_INET_IPCOMP is not set +# CONFIG_INET_XFRM_TUNNEL is not set +# CONFIG_INET_TUNNEL is not set +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set +# CONFIG_INET_XFRM_MODE_TUNNEL is not set +# CONFIG_INET_XFRM_MODE_BEET is not set +# CONFIG_INET_LRO is not set +# CONFIG_INET_DIAG is not set +# CONFIG_TCP_CONG_ADVANCED is not set +CONFIG_TCP_CONG_CUBIC=y +CONFIG_DEFAULT_TCP_CONG="cubic" +# CONFIG_TCP_MD5SIG is not set +# CONFIG_IPV6 is not set +# CONFIG_NETWORK_SECMARK is not set +# CONFIG_NETFILTER is not set +# CONFIG_IP_DCCP is not set +# CONFIG_IP_SCTP is not set +# CONFIG_TIPC is not set +# CONFIG_ATM is not set +# CONFIG_BRIDGE is not set +# CONFIG_NET_DSA is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_SCHED is not set +# CONFIG_DCB is not set + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_HAMRADIO is not set +# CONFIG_CAN is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set +# CONFIG_AF_RXRPC is not set +# CONFIG_PHONET is not set +# CONFIG_WIRELESS is not set +# CONFIG_WIMAX is not set +# CONFIG_RFKILL is not set +# CONFIG_NET_9P is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" +CONFIG_STANDALONE=y +# CONFIG_PREVENT_FIRMWARE_BUILD is not set +CONFIG_FW_LOADER=y +# CONFIG_FIRMWARE_IN_KERNEL is not set +CONFIG_EXTRA_FIRMWARE="" +# CONFIG_SYS_HYPERVISOR is not set +# CONFIG_CONNECTOR is not set +CONFIG_MTD=y +# CONFIG_MTD_DEBUG is not set +# CONFIG_MTD_CONCAT is not set +CONFIG_MTD_PARTITIONS=y +# CONFIG_MTD_TESTS is not set +# CONFIG_MTD_REDBOOT_PARTS is not set +# CONFIG_MTD_CMDLINE_PARTS is not set +# CONFIG_MTD_OF_PARTS is not set +# CONFIG_MTD_AR7_PARTS is not set + +# +# User Modules And Translation Layers +# +CONFIG_MTD_CHAR=y +CONFIG_MTD_BLKDEVS=y +CONFIG_MTD_BLOCK=y +# CONFIG_FTL is not set +# CONFIG_NFTL is not set +# CONFIG_INFTL is not set +# CONFIG_RFD_FTL is not set +# CONFIG_SSFDC is not set +# CONFIG_MTD_OOPS is not set + +# +# RAM/ROM/Flash chip drivers +# +# CONFIG_MTD_CFI is not set +# CONFIG_MTD_JEDECPROBE is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +# CONFIG_MTD_RAM is not set +# CONFIG_MTD_ROM is not set +# CONFIG_MTD_ABSENT is not set + +# +# Mapping drivers for chip access +# +# CONFIG_MTD_COMPLEX_MAPPINGS is not set +# CONFIG_MTD_INTEL_VR_NOR is not set +# CONFIG_MTD_PLATRAM is not set + +# +# Self-contained MTD device drivers +# +# CONFIG_MTD_PMC551 is not set +# CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_PHRAM is not set +# CONFIG_MTD_MTDRAM is not set +# CONFIG_MTD_BLOCK2MTD is not set + +# +# Disk-On-Chip Device Drivers +# +# CONFIG_MTD_DOC2000 is not set +# CONFIG_MTD_DOC2001 is not set +# CONFIG_MTD_DOC2001PLUS is not set +CONFIG_MTD_NAND=y +# CONFIG_MTD_NAND_VERIFY_WRITE is not set +# CONFIG_MTD_NAND_ECC_SMC is not set +# CONFIG_MTD_NAND_MUSEUM_IDS is not set +CONFIG_MTD_NAND_IDS=y +# CONFIG_MTD_NAND_DISKONCHIP is not set +# CONFIG_MTD_NAND_CAFE is not set +# CONFIG_MTD_NAND_NANDSIM is not set +# CONFIG_MTD_NAND_PLATFORM is not set +# CONFIG_MTD_NAND_FSL_ELBC is not set +CONFIG_MTD_NAND_MPC5121_NFC=y +# CONFIG_MTD_ONENAND is not set + +# +# LPDDR flash memory drivers +# +# CONFIG_MTD_LPDDR is not set +# CONFIG_MTD_QINFO_PROBE is not set + +# +# UBI - Unsorted block images +# +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MTD_UBI_BEB_RESERVE=1 +# CONFIG_MTD_UBI_GLUEBI is not set + +# +# UBI debugging options +# +# CONFIG_MTD_UBI_DEBUG is not set +CONFIG_OF_DEVICE=y +CONFIG_OF_I2C=y +# CONFIG_PARPORT is not set +CONFIG_BLK_DEV=y +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_COW_COMMON is not set +# CONFIG_BLK_DEV_LOOP is not set +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_SX8 is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=1 +CONFIG_BLK_DEV_RAM_SIZE=8192 +CONFIG_BLK_DEV_XIP=y +# CONFIG_CDROM_PKTCDVD is not set +# CONFIG_ATA_OVER_ETH is not set +# CONFIG_BLK_DEV_HD is not set +CONFIG_MISC_DEVICES=y +# CONFIG_PHANTOM is not set +# CONFIG_SGI_IOC4 is not set +# CONFIG_TIFM_CORE is not set +# CONFIG_ICS932S401 is not set +# CONFIG_ENCLOSURE_SERVICES is not set +# CONFIG_HP_ILO is not set +# CONFIG_C2PORT is not set + +# +# EEPROM support +# +CONFIG_EEPROM_AT24=y +# CONFIG_EEPROM_LEGACY is not set +# CONFIG_EEPROM_93CX6 is not set +CONFIG_HAVE_IDE=y +# CONFIG_IDE is not set + +# +# SCSI device support +# +# CONFIG_RAID_ATTRS is not set +# CONFIG_SCSI is not set +# CONFIG_SCSI_DMA is not set +# CONFIG_SCSI_NETLINK is not set +# CONFIG_ATA is not set +# CONFIG_MD is not set +# CONFIG_FUSION is not set + +# +# IEEE 1394 (FireWire) support +# + +# +# Enable only one of the two stacks, unless you know what you are doing +# +# CONFIG_FIREWIRE is not set +# CONFIG_IEEE1394 is not set +# CONFIG_I2O is not set +# CONFIG_MACINTOSH_DRIVERS is not set +CONFIG_NETDEVICES=y +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_MACVLAN is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set +# CONFIG_VETH is not set +# CONFIG_ARCNET is not set +CONFIG_PHYLIB=y + +# +# MII PHY device drivers +# +CONFIG_MARVELL_PHY=y +CONFIG_DAVICOM_PHY=y +CONFIG_QSEMI_PHY=y +CONFIG_LXT_PHY=y +CONFIG_CICADA_PHY=y +CONFIG_VITESSE_PHY=y +CONFIG_SMSC_PHY=y +CONFIG_BROADCOM_PHY=y +CONFIG_ICPLUS_PHY=y +CONFIG_REALTEK_PHY=y +CONFIG_NATIONAL_PHY=y +CONFIG_STE10XP=y +CONFIG_LSI_ET1011C_PHY=y +CONFIG_FIXED_PHY=y +CONFIG_MDIO_BITBANG=y +CONFIG_NET_ETHERNET=y +CONFIG_MII=y +# CONFIG_HAPPYMEAL is not set +# CONFIG_SUNGEM is not set +# CONFIG_CASSINI is not set +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_NET_TULIP is not set +# CONFIG_HP100 is not set +# CONFIG_IBM_NEW_EMAC_ZMII is not set +# CONFIG_IBM_NEW_EMAC_RGMII is not set +# CONFIG_IBM_NEW_EMAC_TAH is not set +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set +# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set +# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set +# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set +# CONFIG_NET_PCI is not set +# CONFIG_B44 is not set +# CONFIG_ATL2 is not set +CONFIG_FS_ENET=y +CONFIG_FS_ENET_MPC5121_FEC=y +CONFIG_FS_ENET_FEC_TX_ALIGN_WORKAROUND=y +CONFIG_FS_ENET_HAS_FEC=y +CONFIG_FS_ENET_MDIO_FEC=y +# CONFIG_NETDEV_1000 is not set +# CONFIG_NETDEV_10000 is not set +# CONFIG_TR is not set + +# +# Wireless LAN +# +# CONFIG_WLAN_PRE80211 is not set +# CONFIG_WLAN_80211 is not set +# CONFIG_IWLWIFI_LEDS is not set + +# +# Enable WiMAX (Networking options) to see the WiMAX drivers +# +# CONFIG_WAN is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set +# CONFIG_NETCONSOLE is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set +# CONFIG_ISDN is not set +# CONFIG_PHONE is not set + +# +# Input device support +# +CONFIG_INPUT=y +# CONFIG_INPUT_FF_MEMLESS is not set +# CONFIG_INPUT_POLLDEV is not set + +# +# Userland interfaces +# +CONFIG_INPUT_MOUSEDEV=y +# CONFIG_INPUT_MOUSEDEV_PSAUX is not set +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set +# CONFIG_INPUT_EVBUG is not set + +# +# Input Device Drivers +# +# CONFIG_INPUT_KEYBOARD is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TABLET is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_MISC is not set + +# +# Hardware I/O ports +# +# CONFIG_SERIO is not set +# CONFIG_GAMEPORT is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_CONSOLE_TRANSLATIONS=y +CONFIG_VT_CONSOLE=y +CONFIG_HW_CONSOLE=y +# CONFIG_VT_HW_CONSOLE_BINDING is not set +# CONFIG_DEVKMEM is not set +# CONFIG_SERIAL_NONSTANDARD is not set +# CONFIG_NOZOMI is not set + +# +# Serial drivers +# +# CONFIG_SERIAL_8250 is not set + +# +# Non-8250 serial port support +# +# CONFIG_SERIAL_UARTLITE is not set +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_SERIAL_MPC52xx=y +CONFIG_SERIAL_MPC52xx_CONSOLE=y +CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD=115200 +# CONFIG_SERIAL_JSM is not set +CONFIG_UNIX98_PTYS=y +# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set +# CONFIG_LEGACY_PTYS is not set +# CONFIG_HVC_UDBG is not set +# CONFIG_IPMI_HANDLER is not set +# CONFIG_HW_RANDOM is not set +# CONFIG_NVRAM is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set +# CONFIG_RAW_DRIVER is not set +# CONFIG_TCG_TPM is not set +CONFIG_DEVPORT=y +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_HELPER_AUTO=y + +# +# I2C Hardware Bus support +# + +# +# PC SMBus host controller drivers +# +# CONFIG_I2C_ALI1535 is not set +# CONFIG_I2C_ALI1563 is not set +# CONFIG_I2C_ALI15X3 is not set +# CONFIG_I2C_AMD756 is not set +# CONFIG_I2C_AMD8111 is not set +# CONFIG_I2C_I801 is not set +# CONFIG_I2C_ISCH is not set +# CONFIG_I2C_PIIX4 is not set +# CONFIG_I2C_NFORCE2 is not set +# CONFIG_I2C_SIS5595 is not set +# CONFIG_I2C_SIS630 is not set +# CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_VIA is not set +# CONFIG_I2C_VIAPRO is not set + +# +# I2C system bus drivers (mostly embedded / system-on-chip) +# +CONFIG_I2C_MPC=y +# CONFIG_I2C_OCORES is not set +# CONFIG_I2C_SIMTEC is not set + +# +# External I2C/SMBus adapter drivers +# +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_TAOS_EVM is not set + +# +# Graphics adapter I2C/DDC channel drivers +# +# CONFIG_I2C_VOODOO3 is not set + +# +# Other I2C/SMBus bus drivers +# +# CONFIG_I2C_PCA_PLATFORM is not set +# CONFIG_I2C_STUB is not set + +# +# Miscellaneous I2C Chip support +# +# CONFIG_DS1682 is not set +# CONFIG_SENSORS_PCF8574 is not set +# CONFIG_PCF8575 is not set +# CONFIG_SENSORS_PCA9539 is not set +# CONFIG_SENSORS_PCF8591 is not set +# CONFIG_SENSORS_MAX6875 is not set +# CONFIG_SENSORS_TSL2550 is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CHIP is not set +# CONFIG_SPI is not set +CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y +# CONFIG_GPIOLIB is not set +# CONFIG_W1 is not set +# CONFIG_POWER_SUPPLY is not set +# CONFIG_HWMON is not set +# CONFIG_THERMAL is not set +# CONFIG_THERMAL_HWMON is not set +# CONFIG_WATCHDOG is not set +CONFIG_SSB_POSSIBLE=y + +# +# Sonics Silicon Backplane +# +# CONFIG_SSB is not set + +# +# Multifunction device drivers +# +# CONFIG_MFD_CORE is not set +# CONFIG_MFD_SM501 is not set +# CONFIG_HTC_PASIC3 is not set +# CONFIG_TWL4030_CORE is not set +# CONFIG_MFD_TMIO is not set +# CONFIG_PMIC_DA903X is not set +# CONFIG_MFD_WM8400 is not set +# CONFIG_MFD_WM8350_I2C is not set +# CONFIG_MFD_PCF50633 is not set +# CONFIG_REGULATOR is not set + +# +# Multimedia devices +# + +# +# Multimedia core support +# +# CONFIG_VIDEO_DEV is not set +# CONFIG_DVB_CORE is not set +# CONFIG_VIDEO_MEDIA is not set + +# +# Multimedia drivers +# +# CONFIG_DAB is not set + +# +# Graphics support +# +# CONFIG_AGP is not set +# CONFIG_DRM is not set +# CONFIG_VGASTATE is not set +# CONFIG_VIDEO_OUTPUT_CONTROL is not set +# CONFIG_FB is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set + +# +# Display device support +# +# CONFIG_DISPLAY_SUPPORT is not set + +# +# Console display driver support +# +# CONFIG_VGA_CONSOLE is not set +CONFIG_DUMMY_CONSOLE=y +# CONFIG_SOUND is not set +# CONFIG_HID_SUPPORT is not set +# CONFIG_USB_SUPPORT is not set +# CONFIG_UWB is not set +# CONFIG_MMC is not set +# CONFIG_MEMSTICK is not set +# CONFIG_NEW_LEDS is not set +# CONFIG_ACCESSIBILITY is not set +# CONFIG_INFINIBAND is not set +# CONFIG_EDAC is not set +CONFIG_RTC_LIB=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_HCTOSYS=y +CONFIG_RTC_HCTOSYS_DEVICE="rtc1" +# CONFIG_RTC_DEBUG is not set + +# +# RTC interfaces +# +CONFIG_RTC_INTF_SYSFS=y +CONFIG_RTC_INTF_PROC=y +CONFIG_RTC_INTF_DEV=y +# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set +# CONFIG_RTC_DRV_TEST is not set + +# +# I2C RTC drivers +# +# CONFIG_RTC_DRV_DS1307 is not set +# CONFIG_RTC_DRV_DS1374 is not set +# CONFIG_RTC_DRV_DS1672 is not set +# CONFIG_RTC_DRV_MAX6900 is not set +# CONFIG_RTC_DRV_RS5C372 is not set +# CONFIG_RTC_DRV_ISL1208 is not set +# CONFIG_RTC_DRV_X1205 is not set +# CONFIG_RTC_DRV_PCF8563 is not set +# CONFIG_RTC_DRV_PCF8583 is not set +CONFIG_RTC_DRV_M41T80=y +# CONFIG_RTC_DRV_M41T80_WDT is not set +# CONFIG_RTC_DRV_S35390A is not set +# CONFIG_RTC_DRV_FM3130 is not set +# CONFIG_RTC_DRV_RX8581 is not set + +# +# SPI RTC drivers +# + +# +# Platform RTC drivers +# +# CONFIG_RTC_DRV_CMOS is not set +# CONFIG_RTC_DRV_DS1286 is not set +# CONFIG_RTC_DRV_DS1511 is not set +# CONFIG_RTC_DRV_DS1553 is not set +# CONFIG_RTC_DRV_DS1742 is not set +# CONFIG_RTC_DRV_STK17TA8 is not set +# CONFIG_RTC_DRV_M48T86 is not set +# CONFIG_RTC_DRV_M48T35 is not set +# CONFIG_RTC_DRV_M48T59 is not set +# CONFIG_RTC_DRV_BQ4802 is not set +# CONFIG_RTC_DRV_V3020 is not set + +# +# on-CPU RTC drivers +# +# CONFIG_RTC_DRV_PPC is not set +CONFIG_RTC_DRV_MPC5121=y +CONFIG_DMADEVICES=y + +# +# DMA Devices +# +# CONFIG_FSL_DMA is not set +CONFIG_MPC512X_DMA=y +CONFIG_DMA_ENGINE=y + +# +# DMA Clients +# +# CONFIG_NET_DMA is not set +CONFIG_DMATEST=m +# CONFIG_UIO is not set +# CONFIG_STAGING is not set + +# +# File systems +# +CONFIG_EXT2_FS=y +# CONFIG_EXT2_FS_XATTR is not set +CONFIG_EXT2_FS_XIP=y +# CONFIG_EXT3_FS is not set +# CONFIG_EXT4_FS is not set +CONFIG_FS_XIP=y +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +# CONFIG_FS_POSIX_ACL is not set +CONFIG_FILE_LOCKING=y +# CONFIG_XFS_FS is not set +# CONFIG_OCFS2_FS is not set +# CONFIG_BTRFS_FS is not set +# CONFIG_DNOTIFY is not set +# CONFIG_INOTIFY is not set +# CONFIG_QUOTA is not set +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_FUSE_FS is not set + +# +# CD-ROM/DVD Filesystems +# +# CONFIG_ISO9660_FS is not set +# CONFIG_UDF_FS is not set + +# +# DOS/FAT/NT Filesystems +# +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +# CONFIG_PROC_KCORE is not set +CONFIG_PROC_SYSCTL=y +CONFIG_PROC_PAGE_MONITOR=y +CONFIG_SYSFS=y +CONFIG_TMPFS=y +# CONFIG_TMPFS_POSIX_ACL is not set +# CONFIG_HUGETLB_PAGE is not set +# CONFIG_CONFIGFS_FS is not set +CONFIG_MISC_FILESYSTEMS=y +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +CONFIG_JFFS2_FS=y +CONFIG_JFFS2_FS_DEBUG=0 +CONFIG_JFFS2_FS_WRITEBUFFER=y +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set +# CONFIG_JFFS2_SUMMARY is not set +# CONFIG_JFFS2_FS_XATTR is not set +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set +CONFIG_JFFS2_ZLIB=y +# CONFIG_JFFS2_LZO is not set +CONFIG_JFFS2_RTIME=y +# CONFIG_JFFS2_RUBIN is not set +CONFIG_UBIFS_FS=y +# CONFIG_UBIFS_FS_XATTR is not set +# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set +CONFIG_UBIFS_FS_LZO=y +CONFIG_UBIFS_FS_ZLIB=y +# CONFIG_UBIFS_FS_DEBUG is not set +# CONFIG_CRAMFS is not set +# CONFIG_SQUASHFS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_OMFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_ROMFS_FS is not set +# CONFIG_SYSV_FS is not set +# CONFIG_UFS_FS is not set +CONFIG_NETWORK_FILESYSTEMS=y +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +# CONFIG_NFS_V3_ACL is not set +# CONFIG_NFS_V4 is not set +CONFIG_ROOT_NFS=y +# CONFIG_NFSD is not set +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=y +# CONFIG_SUNRPC_REGISTER_V4 is not set +# CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set +# CONFIG_SMB_FS is not set +# CONFIG_CIFS is not set +# CONFIG_NCP_FS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_NLS is not set +# CONFIG_DLM is not set + +# +# Library routines +# +CONFIG_BITREVERSE=y +CONFIG_GENERIC_FIND_LAST_BIT=y +# CONFIG_CRC_CCITT is not set +CONFIG_CRC16=y +# CONFIG_CRC_T10DIF is not set +# CONFIG_CRC_ITU_T is not set +CONFIG_CRC32=y +# CONFIG_CRC7 is not set +# CONFIG_LIBCRC32C is not set +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=y +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +CONFIG_PLIST=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAS_DMA=y +CONFIG_HAVE_LMB=y + +# +# Kernel hacking +# +# CONFIG_PRINTK_TIME is not set +# CONFIG_ENABLE_WARN_DEPRECATED is not set +# CONFIG_ENABLE_MUST_CHECK is not set +CONFIG_FRAME_WARN=1024 +# CONFIG_MAGIC_SYSRQ is not set +# CONFIG_UNUSED_SYMBOLS is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_HEADERS_CHECK is not set +# CONFIG_DEBUG_KERNEL is not set +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_MEMORY_INIT=y +# CONFIG_RCU_CPU_STALL_DETECTOR is not set +# CONFIG_LATENCYTOP is not set +# CONFIG_SYSCTL_SYSCALL_CHECK is not set +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y + +# +# Tracers +# +# CONFIG_DYNAMIC_PRINTK_DEBUG is not set +# CONFIG_SAMPLES is not set +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_PRINT_STACK_DEPTH=64 +# CONFIG_IRQSTACKS is not set +# CONFIG_BOOTX_TEXT is not set +# CONFIG_PPC_EARLY_DEBUG is not set + +# +# Security options +# +# CONFIG_KEYS is not set +# CONFIG_SECURITY is not set +# CONFIG_SECURITYFS is not set +# CONFIG_SECURITY_FILE_CAPABILITIES is not set +CONFIG_CRYPTO=y + +# +# Crypto core or helper +# +# CONFIG_CRYPTO_FIPS is not set +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_ALGAPI2=y +# CONFIG_CRYPTO_MANAGER is not set +# CONFIG_CRYPTO_MANAGER2 is not set +# CONFIG_CRYPTO_GF128MUL is not set +# CONFIG_CRYPTO_NULL is not set +# CONFIG_CRYPTO_CRYPTD is not set +# CONFIG_CRYPTO_AUTHENC is not set +# CONFIG_CRYPTO_TEST is not set + +# +# Authenticated Encryption with Associated Data +# +# CONFIG_CRYPTO_CCM is not set +# CONFIG_CRYPTO_GCM is not set +# CONFIG_CRYPTO_SEQIV is not set + +# +# Block modes +# +# CONFIG_CRYPTO_CBC is not set +# CONFIG_CRYPTO_CTR is not set +# CONFIG_CRYPTO_CTS is not set +# CONFIG_CRYPTO_ECB is not set +# CONFIG_CRYPTO_LRW is not set +# CONFIG_CRYPTO_PCBC is not set +# CONFIG_CRYPTO_XTS is not set + +# +# Hash modes +# +# CONFIG_CRYPTO_HMAC is not set +# CONFIG_CRYPTO_XCBC is not set + +# +# Digest +# +# CONFIG_CRYPTO_CRC32C is not set +# CONFIG_CRYPTO_MD4 is not set +# CONFIG_CRYPTO_MD5 is not set +# CONFIG_CRYPTO_MICHAEL_MIC is not set +# CONFIG_CRYPTO_RMD128 is not set +# CONFIG_CRYPTO_RMD160 is not set +# CONFIG_CRYPTO_RMD256 is not set +# CONFIG_CRYPTO_RMD320 is not set +# CONFIG_CRYPTO_SHA1 is not set +# CONFIG_CRYPTO_SHA256 is not set +# CONFIG_CRYPTO_SHA512 is not set +# CONFIG_CRYPTO_TGR192 is not set +# CONFIG_CRYPTO_WP512 is not set + +# +# Ciphers +# +# CONFIG_CRYPTO_AES is not set +# CONFIG_CRYPTO_ANUBIS is not set +# CONFIG_CRYPTO_ARC4 is not set +# CONFIG_CRYPTO_BLOWFISH is not set +# CONFIG_CRYPTO_CAMELLIA is not set +# CONFIG_CRYPTO_CAST5 is not set +# CONFIG_CRYPTO_CAST6 is not set +# CONFIG_CRYPTO_DES is not set +# CONFIG_CRYPTO_FCRYPT is not set +# CONFIG_CRYPTO_KHAZAD is not set +# CONFIG_CRYPTO_SALSA20 is not set +# CONFIG_CRYPTO_SEED is not set +# CONFIG_CRYPTO_SERPENT is not set +# CONFIG_CRYPTO_TEA is not set +# CONFIG_CRYPTO_TWOFISH is not set + +# +# Compression +# +CONFIG_CRYPTO_DEFLATE=y +CONFIG_CRYPTO_LZO=y + +# +# Random Number Generation +# +# CONFIG_CRYPTO_ANSI_CPRNG is not set +# CONFIG_CRYPTO_HW is not set +CONFIG_PPC_CLOCK=y +# CONFIG_VIRTUALIZATION is not set
Signature · 1 line
1.6.0.6
Re: [PATCH 12/12] mpc5121: Added default config for MPC5121.
Quoted 6 lines · Wolfgang Denk
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]>
Wait till about -rc2 time to do defconfig patches.
g.
Re: [PATCH 12/12] mpc5121: Added default config for MPC5121.
Dear Grant Likely,
Quoted 2 lines · In message <[email protected]> you…
Wait till about -rc2 time to do defconfig patches.
Would it offend you if I continue to include these (and you have to ignore them)? Posting a "complete" patch set that includs a defconfig allows users much easier testing...
Best regards,
Wolfgang Denk
Signature · 7 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected] WARNING: This Product Attracts Every Other Piece of Matter in the Universe, Including the Products of Other Manufacturers, with a Force Proportional to the Product of the Masses and Inversely Proportional to the Distance Between Them.
Re: [PATCH 12/12] mpc5121: Added default config for MPC5121.
Quoted 9 lines · Wolfgang Denk
Dear Grant Likely,
Quoted 2 lines · In message <[email protected]> you…
Wait till about -rc2 time to do defconfig patches.
Would it offend you if I continue to include these (and you have to ignore them)? Posting a "complete" patch set that includs a defconfig allows users much easier testing...
Yes, that's fine. My preference is if they appear at the end of the series.
g.
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.