Integrated Flash Controller support
Subsystems (3)
PATCH 1/2 Integrated Flash Controller support
From: Liu Shuo <[email protected]>
Integrated Flash Controller supports various flashes like NOR, NAND and other devices using NOR, NAND and GPCM Machine available on it. IFC supports four chip selects.
--- arch/powerpc/Kconfig | 8 + arch/powerpc/include/asm/fsl_ifc.h | 834 ++++++++++++++++++++++++++++++++++++ arch/powerpc/sysdev/Makefile | 1 + arch/powerpc/sysdev/fsl_ifc.c | 322 ++++++++++++++ 4 files changed, 1165 insertions(+), 0 deletions(-) create mode 100644 arch/powerpc/include/asm/fsl_ifc.h create mode 100644 arch/powerpc/sysdev/fsl_ifc.c
arch/powerpc/Kconfig +8 -0
@@ -688,6 +688,14 @@ config FSL_LBC controller. Also contains some common code used by drivers for specific local bus peripherals. +config FSL_IFC + bool "Freescale Integrated Flash Controller support" + depends on FSL_SOC + help + Enables reporting of errors from the Freescale integrated + flash controller. Also contains some common code used by + drivers for specific ifc controller peripherals. + config FSL_GTM bool depends on PPC_83xx || QUICC_ENGINE || CPM2
arch/powerpc/include/asm/fsl_ifc.h new file +834 -0
834 lines not on this page · raw message
arch/powerpc/sysdev/Makefile +1 -0
@@ -17,6 +17,7 @@ obj-$(CONFIG_FSL_SOC) += fsl_soc.o obj-$(CONFIG_FSL_PCI) += fsl_pci.o $(fsl-msi-obj-y) obj-$(CONFIG_FSL_PMC) += fsl_pmc.o obj-$(CONFIG_FSL_LBC) += fsl_lbc.o +obj-$(CONFIG_FSL_IFC) += fsl_ifc.o obj-$(CONFIG_FSL_GTM) += fsl_gtm.o obj-$(CONFIG_MPC8xxx_GPIO) += mpc8xxx_gpio.o obj-$(CONFIG_FSL_85XX_CACHE_SRAM) += fsl_85xx_l2ctlr.o fsl_85xx_cache_sram.o
arch/powerpc/sysdev/fsl_ifc.c new file +322 -0
322 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 1/1 mtd/nand : set Nand flash page address to FBAR and FPAR correctly
From: Liu Shuo <[email protected]>
If we use the Nand flash chip whose number of pages in a block is greater than 64(for large page), we must treat the low bit of FBAR as being the high bit of the page address due to the limitation of FCM, it simply uses the low 6-bits (for large page) of the combined block/page address as the FPAR component, rather than considering the actual block size.
--- drivers/mtd/nand/fsl_elbc_nand.c | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-)
drivers/mtd/nand/fsl_elbc_nand.c +10 -3
@@ -167,15 +167,22 @@ static void set_addr(struct mtd_info *mtd, int column, int page_addr, int oob) elbc_fcm_ctrl->page = page_addr; -out_be32 (&lbc->fbar, - page_addr >> (chip->phys_erase_shift - chip->page_shift)); -if (priv->page_size) { +/* +* large page size chip : FPAR[PI] save the lowest 6 bits, +* FBAR[BLK] save the other bits. +*/ +out_be32 (&lbc->fbar, page_addr >>6 );out_be32 (&lbc->fpar, ((page_addr <<FPAR_LP_PI_SHIFT ) &FPAR_LP_PI ) | (oob ?FPAR_LP_MS :0 ) | column); buf_num = (page_addr &1 ) <<2 ; }else { +/* +* small page size chip : FPAR[PI] save the lowest 5 bits, +* FBAR[BLK] save the other bits. +*/ +out_be32 (&lbc->fbar, page_addr >>5 );out_be32 (&lbc->fpar, ((page_addr <<FPAR_SP_PI_SHIFT ) &FPAR_SP_PI ) | (oob ?FPAR_SP_MS :0 ) | column);
Signature · 1 line
1.7.1
PATCH 2/2 NAND Machine support for Integrated Flash Controller
In reply to [email protected]From: Liu Shuo <[email protected]>
Integrated Flash Controller(IFC) can be used to hook NAND Flash chips using NAND Flash Machine available on it.
--- drivers/mtd/nand/Kconfig | 10 + drivers/mtd/nand/Makefile | 1 + drivers/mtd/nand/fsl_ifc_nand.c | 1076 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 1087 insertions(+), 0 deletions(-) create mode 100644 drivers/mtd/nand/fsl_ifc_nand.c
drivers/mtd/nand/Kconfig +10 -0
@@ -456,6 +456,16 @@ config MTD_NAND_FSL_ELBC Enabling this option will enable you to use this to control external NAND devices. +config MTD_NAND_FSL_IFC + tristate "NAND support for Freescale IFC controller" + depends on MTD_NAND && FSL_SOC + select FSL_IFC + help + Various Freescale chips e.g P1010, include a NAND Flash machine + with built-in hardware ECC capabilities. + Enabling this option will enable you to use this to control + external NAND devices. + config MTD_NAND_FSL_UPM tristate "Support for NAND on Freescale UPM" depends on PPC_83xx || PPC_85xx
drivers/mtd/nand/Makefile +1 -0
@@ -38,6 +38,7 @@ obj-$(CONFIG_MTD_ALAUDA) += alauda.o obj-$(CONFIG_MTD_NAND_PASEMI) += pasemi_nand.o obj-$(CONFIG_MTD_NAND_ORION) += orion_nand.o obj-$(CONFIG_MTD_NAND_FSL_ELBC) += fsl_elbc_nand.o +obj-$(CONFIG_MTD_NAND_FSL_IFC) += fsl_ifc_nand.o obj-$(CONFIG_MTD_NAND_FSL_UPM) += fsl_upm.o obj-$(CONFIG_MTD_NAND_SH_FLCTL) += sh_flctl.o obj-$(CONFIG_MTD_NAND_MXC) += mxc_nand.o
drivers/mtd/nand/fsl_ifc_nand.c new file +1076 -0
1,076 lines not on this page · raw message
Signature · 1 line
1.7.1
Probably some PPC mailing list should be CCed? Could you please CC at least LKML?
arch/powerpc/Kconfig config FSL_LBC · line 697
Quoted 7 lines · On Fri, 2011-10-28 at 13:40 +0800, [email protected] wrote:
arch/powerpc/Kconfig +7
-0+config FSL_IFC + bool "Freescale Integrated Flash Controller support" + depends on FSL_SOC + help + Enables reporting of errors from the Freescale integrated + flash controller. Also contains some common code used by + drivers for specific ifc controller peripherals.
Why this cannot be a module?
Quoted 15 lines
arch/powerpc/include/asm/fsl_ifc.h new file +15
-0+/* +* IFC Controller NAND Machine registers +*/ +struct fsl_ifc_nand { +__be32 ncfgr; +u32 res1[0x4 ]; +__be32 nand_fcr0; +__be32 nand_fcr1; +u32 res2[0x8 ]; +__be32 row0; +u32 res3; +__be32 col0; +u32 res4; +__be32 row1; +u32 res5;
arch/powerpc/include/asm/fsl_ifc.h line 697
Quoted 10 lines
arch/powerpc/include/asm/fsl_ifc.h new file +10
-0+__be32 col1; +u32 res6; +__be32 row2; +u32 res7; +__be32 col2; +u32 res8; +__be32 row3; +u32 res9; +__be32 col3; +u32 res10[0x24 ];
I do not know the HW, but I wonder why some fields are __be32 and some are u32? What is the logic behind that?
Quoted 2 lines · Artem Bityutskiy
Probably some PPC mailing list should be CCed? Could you please CC at least LKML?
Have re-sent.
Quoted 9 lines · On Fri, 2011-10-28 at 13:40 +0800, [email protected] wrote:
arch/powerpc/Kconfig config FSL_LBC · line 697
Quoted 7 lines
arch/powerpc/Kconfig +7
-0+config FSL_IFC + bool "Freescale Integrated Flash Controller support" + depends on FSL_SOC + help + Enables reporting of errors from the Freescale integrated + flash controller. Also contains some common code used by + drivers for specific ifc controller peripherals.Why this cannot be a module?
Have changed it to be selected by other drivers only (NAND_FSL_IFC).
Quoted 20 lines
Quoted 20 lines
arch/powerpc/include/asm/fsl_ifc.h new file +19
-0+/* +* IFC Controller NAND Machine registers +*/ +struct fsl_ifc_nand { +__be32 ncfgr; +u32 res1[0x4 ]; +__be32 nand_fcr0; +__be32 nand_fcr1; +u32 res2[0x8 ]; +__be32 row0; +u32 res3; +__be32 col0; +u32 res4; +__be32 row1; +u32 res5; +__be32 col1; +u32 res6; +__be32 row2; +u32 res7;
Quoted 9 lines
arch/powerpc/include/asm/fsl_ifc.h line 697
Quoted 6 lines
arch/powerpc/include/asm/fsl_ifc.h new file +6
-0+__be32 col2; +u32 res8; +__be32 row3; +u32 res9; +__be32 col3; +u32 res10[0x24 ];I do not know the HW, but I wonder why some fields are
__be32and some are u32? What is the logic behind that?
These u32s are reserved space, I think it should be ok.
-LiuShuo