powerpc/85xx: P1010RDB
Subsystems (3)
v2 cover powerpc/85xx: P1010RDB
Patch series adds support for P1010RDB, NAND support (for IFC on P1010) and various errata fixes for P1010.
V2 changes:
* re-work based on CCSRBAR cleanup patches
* white space fixes
* checkpatch cleanup fixes
* rework 'dummy' udelay in nand spl code
- k
PATCH v2 1/7 powerpc/85xx: Add basic support for P1010RDB
From: Poonam Aggrwal <[email protected]>
Boot methods supported: NOR Flash, SPI Flash and SDCARD
This patch adds the following basic interfaces:
DDR3, eTSEC, DUART, I2C, SD/MMC, USB, SATA, PCIe, NOR Flash, SPI Flash.
P1010RDB Overview
-----------------
1Gbyte DDR3 (on board DDR)
Local Bus (IFC):
32Mbyte 16bit NOR flash
32Mbyte SLC NAND Flash
64KB CPLD device(GPCM interface)
SPI Flash:
128 Mbit SPI Flash memory
SD/MMC:
connector to interface with the SD memory card
SATA:
1 internal SATA connect to 2.5. 160G SATA2 HDD
1 eSATA connector to rear panel
USB 2.0:
x1 USB 2.0 port: connected via a UTMI PHY to Mini-AB interface. x1 USB 2.0 port: directly connected to Mini-AB interface Ethernet
eTSEC:
eTSEC1: Connected to RGMII PHY VSC8641XKO
eTSEC2: Connected to SGMII PHY VSC8221
eTSEC3: Connected to SGMII PHY VSC8221
eCAN:
Two DB-9 female connectors for Field bus interface
UART:
supports two UARTs up to 115200 bps for console
TDM:
2 FXS ports connected via an external SLIC to the TDM interface.
SLIC:
SPI SLIC
I2C:
Serial EEprom Real time clock 256 Kbit M24256 I2C EEPROM
PCIe:
PCIe and mPCIe connectors.
--- board/freescale/p1010rdb/Makefile | 52 +++ board/freescale/p1010rdb/ddr.c | 250 +++++++++++++ board/freescale/p1010rdb/law.c | 35 ++ board/freescale/p1010rdb/p1010rdb.c | 330 ++++++++++++++++ board/freescale/p1010rdb/tlb.c | 98 +++++ boards.cfg | 6 + include/configs/P1010RDB.h | 703 +++++++++++++++++++++++++++++++++++ 7 files changed, 1474 insertions(+), 0 deletions(-) create mode 100644 board/freescale/p1010rdb/Makefile create mode 100644 board/freescale/p1010rdb/ddr.c create mode 100644 board/freescale/p1010rdb/law.c create mode 100644 board/freescale/p1010rdb/p1010rdb.c create mode 100644 board/freescale/p1010rdb/tlb.c create mode 100644 include/configs/P1010RDB.h
board/freescale/p1010rdb/Makefile new file +52 -0
@@ -0,0 +1,52 @@ +# +# Copyright 2010-2011 Freescale Semiconductor, Inc. +# +# See file CREDITS for list of people who contributed to this +# project. +# +# 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., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +include $(TOPDIR)/config.mk + +LIB = $(obj)lib$(BOARD).o + +COBJS-y += $(BOARD).o +COBJS-y += ddr.o +COBJS-y += law.o +COBJS-y += tlb.o + +SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS-y)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB): $(obj).depend $(OBJS) $(SOBJS) + $(call cmd_link_o_target, $(OBJS)) + +clean: + rm -f $(OBJS) $(SOBJS) + +distclean: clean + rm -f $(LIB) core *.bak .depend + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +#########################################################################
board/freescale/p1010rdb/ddr.c new file +250 -0
250 lines not on this page · raw message
board/freescale/p1010rdb/law.c new file +35 -0
@@ -0,0 +1,35 @@ +/* +* Copyright 2010-2011 Freescale Semiconductor, Inc. +* +* See file CREDITS for list of people who contributed to this +* project. +* +* 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., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +*/ + +#include <common.h> +#include <asm/fsl_law.h> +#include <asm/mmu.h> + +struct law_entry law_table[] = { +#ifndef CONFIG_SDCARD +SET_LAW (CONFIG_SYS_FLASH_BASE_PHYS ,LAW_SIZE_32M ,LAW_TRGT_IF_IFC ), +SET_LAW (CONFIG_SYS_CPLD_BASE_PHYS ,LAW_SIZE_128K ,LAW_TRGT_IF_IFC ), + SET_LAW(CONFIG_SYS_NAND_BASE_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_IFC), +#endif +}; + +int num_law_entries =ARRAY_SIZE (law_table);
board/freescale/p1010rdb/p1010rdb.c new file +330 -0
330 lines not on this page · raw message
board/freescale/p1010rdb/tlb.c new file +98 -0
98 lines not on this page · raw message
boards.cfg +6 -0
@@ -579,6 +579,12 @@ MPC8569MDS_NAND powerpc mpc85xx mpc8569mds freesca MPC8572DS powerpc mpc85xx mpc8572ds freescale - MPC8572DS MPC8572DS_36BIT powerpc mpc85xx mpc8572ds freescale - MPC8572DS:36BIT MPC8572DS_NAND powerpc mpc85xx mpc8572ds freescale - MPC8572DS:NAND +P1010RDB_NOR powerpc mpc85xx p1010rdb freescale - P1010RDB:P1010RDB +P1010RDB_36BIT_NOR powerpc mpc85xx p1010rdb freescale - P1010RDB:P1010RDB,36BIT +P1010RDB_SDCARD powerpc mpc85xx p1010rdb freescale - P1010RDB:P1010RDB,SDCARD +P1010RDB_SPIFLASH powerpc mpc85xx p1010rdb freescale - P1010RDB:P1010RDB,SPIFLASH +P1010RDB_36BIT_SDCARD powerpc mpc85xx p1010rdb freescale - P1010RDB:P1010RDB,36BIT,SDCARD +P1010RDB_36BIT_SPIFLASH powerpc mpc85xx p1010rdb freescale - P1010RDB:P1010RDB,36BIT,SPIFLASH P1011RDB powerpc mpc85xx p1_p2_rdb freescale - P1_P2_RDB:P1011RDB P1011RDB_36BIT powerpc mpc85xx p1_p2_rdb freescale - P1_P2_RDB:P1011RDB,36BIT P1011RDB_36BIT_SDCARD powerpc mpc85xx p1_p2_rdb freescale - P1_P2_RDB:P1011RDB,36BIT,SDCARD
include/configs/P1010RDB.h new file +703 -0
703 lines not on this page · raw message
Signature · 1 line
1.7.3.4
PATCH v2 2/7 nand: Freescale Integrated Flash Controller NAND support
From: Dipen Dudhat <[email protected]>
Add NAND support (including spl) on IFC, such as is found on the p1010.
Note that using hardware ECC on IFC with small-page NAND (which is what comes on the p1010rdb reference board) means there will be insufficient OOB space for JFFS2, since IFC does not support 1-bit ECC. UBI should work, as it does not use OOB for anything but ECC.
When hardware ECC is not enabled in CSOR, software ECC is now used.
--- arch/powerpc/cpu/mpc85xx/cpu_init_nand.c | 10 + arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds | 18 +- arch/powerpc/include/asm/fsl_ifc.h | 6 +- drivers/mtd/nand/Makefile | 1 + drivers/mtd/nand/fsl_ifc_nand.c | 850 ++++++++++++++++++++++++++ nand_spl/nand_boot_fsl_ifc.c | 271 ++++++++ 6 files changed, 1149 insertions(+), 7 deletions(-) create mode 100644 drivers/mtd/nand/fsl_ifc_nand.c create mode 100644 nand_spl/nand_boot_fsl_ifc.c
arch/powerpc/cpu/mpc85xx/cpu_init_nand.c +10 -0
@@ -21,10 +21,12 @@*/ #include <common.h> +#include <asm/fsl_ifc.h> #include <asm/io.h> void cpu_init_f (void ) { +#ifdef CONFIG_FSL_LBC fsl_lbc_t *lbc =LBC_BASE_ADDR ;/*
@@ -39,6 +41,14 @@ void cpu_init_f(void)#else #error CONFIG_SYS_NAND_BR_PRELIM, CONFIG_SYS_NAND_OR_PRELIM must be defined#endif +#endif +#ifdef CONFIG_FSL_IFC +#if defined(CONFIG_SYS_CSPR0 ) && defined(CONFIG_SYS_CSOR0 ) +set_ifc_cspr (IFC_CS0 ,CONFIG_SYS_CSPR0 ); +set_ifc_amask (IFC_CS0 ,CONFIG_SYS_AMASK0 ); +set_ifc_csor (IFC_CS0 ,CONFIG_SYS_CSOR0 ); +#endif +#endif #if defined(CONFIG_SYS_RAMBOOT ) && defined(CONFIG_SYS_INIT_L2_ADDR )ccsr_l2cache_t *l2cache = (void *)CONFIG_SYS_MPC85xx_L2_ADDR;
arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds +15 -3
@@ -23,6 +23,8 @@ * MA 02111-1307 USA */ +#include "config.h" /* CONFIG_BOARDDIR */ + OUTPUT_ARCH(powerpc) SECTIONS {
@@ -52,8 +54,18 @@ SECTIONS . = ALIGN(8); __init_begin = .; __init_end = .; - - .resetvec ADDR(.text) + 0xffc : { +#if defined(CONFIG_FSL_IFC) /* Restrict bootpg at 4K boundry for IFC */ + .bootpg ADDR(.text) + 0x1000 : + { + start.o (.bootpg) + } +#define RESET_VECTOR_OFFSET 0x1ffc /* IFC has 8K sram */ +#elif defined(CONFIG_FSL_ELBC) +#define RESET_VECTOR_OFFSET 0xffc /* LBC has 4k sram */ +#else +#error unknown NAND controller +#endif + .resetvec ADDR(.text) + RESET_VECTOR_OFFSET : { KEEP(*(.resetvec)) } = 0xffff
@@ -64,4 +76,4 @@ SECTIONS } __bss_end__ = .; } -ASSERT(__init_end <= 0xfff00ffc, "NAND bootstrap too big"); +ASSERT(__init_end <= (0xfff00000 + RESET_VECTOR_OFFSET), "NAND bootstrap too big");
arch/powerpc/include/asm/fsl_ifc.h +2 -4
@@ -69,6 +69,7 @@*/ /* Enable ECC Encoder */ #define CSOR_NAND_ECC_ENC_EN 0x80000000 +#define CSOR_NAND_ECC_MODE_MASK 0x30000000/* 4 bit correction per 520 Byte sector */ #define CSOR_NAND_ECC_MODE_4 0x00000000/* 8 bit correction per 528 Byte sector */
@@ -857,10 +858,7 @@ struct fsl_ifc_nand {u32 res19[0x10 ];u32 nand_fsr;u32 res20; -u32 nand_eccstat0; -u32 nand_eccstat1; -u32 nand_eccstat2; -u32 nand_eccstat3; +u32 nand_eccstat[4 ];u32 res21[0x20 ];u32 nanndcr;u32 res22[0x2 ];
drivers/mtd/nand/Makefile +1 -0
@@ -37,6 +37,7 @@ COBJS-$(CONFIG_NAND_ATMEL) += atmel_nand.o COBJS-$(CONFIG_DRIVER_NAND_BFIN) += bfin_nand.o COBJS-$(CONFIG_NAND_DAVINCI) += davinci_nand.o COBJS-$(CONFIG_NAND_FSL_ELBC) += fsl_elbc_nand.o +COBJS-$(CONFIG_NAND_FSL_IFC) += fsl_ifc_nand.o COBJS-$(CONFIG_NAND_FSL_UPM) += fsl_upm.o COBJS-$(CONFIG_NAND_KB9202) += kb9202_nand.o COBJS-$(CONFIG_NAND_KIRKWOOD) += kirkwood_nand.o
drivers/mtd/nand/fsl_ifc_nand.c new file +850 -0
850 lines not on this page · raw message
nand_spl/nand_boot_fsl_ifc.c new file +271 -0
271 lines not on this page · raw message
Signature · 1 line
1.7.3.4
PATCH v2 3/7 powerpc/85xx: Add NAND/NAND_SPL support to P1010RDB
From: Dipen Dudhat <[email protected]>
And various defines to enable NAND support and NAND spl code for the P1010RDB platform.
--- boards.cfg | 2 + include/configs/P1010RDB.h | 59 ++++++++++ nand_spl/board/freescale/p1010rdb/Makefile | 141 +++++++++++++++++++++++++ nand_spl/board/freescale/p1010rdb/nand_boot.c | 130 +++++++++++++++++++++++ 4 files changed, 332 insertions(+), 0 deletions(-) create mode 100644 nand_spl/board/freescale/p1010rdb/Makefile create mode 100644 nand_spl/board/freescale/p1010rdb/nand_boot.c
boards.cfg +2 -0
@@ -581,6 +581,8 @@ MPC8572DS_36BIT powerpc mpc85xx mpc8572ds freesca MPC8572DS_NAND powerpc mpc85xx mpc8572ds freescale - MPC8572DS:NAND P1010RDB_NOR powerpc mpc85xx p1010rdb freescale - P1010RDB:P1010RDB P1010RDB_36BIT_NOR powerpc mpc85xx p1010rdb freescale - P1010RDB:P1010RDB,36BIT +P1010RDB_NAND powerpc mpc85xx p1010rdb freescale - P1010RDB:P1010RDB,NAND +P1010RDB_36BIT_NAND powerpc mpc85xx p1010rdb freescale - P1010RDB:P1010RDB,36BIT,NAND P1010RDB_SDCARD powerpc mpc85xx p1010rdb freescale - P1010RDB:P1010RDB,SDCARD P1010RDB_SPIFLASH powerpc mpc85xx p1010rdb freescale - P1010RDB:P1010RDB,SPIFLASH P1010RDB_36BIT_SDCARD powerpc mpc85xx p1010rdb freescale - P1010RDB:P1010RDB,36BIT,SDCARD
include/configs/P1010RDB.h +59 -0
119 lines not on this page · raw message
nand_spl/board/freescale/p1010rdb/Makefile new file +141 -0
141 lines not on this page · raw message
nand_spl/board/freescale/p1010rdb/nand_boot.c new file +130 -0
130 lines not on this page · raw message
Signature · 1 line
1.7.3.4
PATCH v2 4/7 powerpc/85xx: Expanding the window of CCSRBAR in AS=1 from 4k to 1M
From: Poonam Aggrwal <[email protected]>
For an IFC Erratum (A-003399) we will need to access IFC registers in cpu_init_early_f() so expand the TLB covering CCSR to 1M.
Since we need a TLB to cover 1M we move to using TLB1 array for all the early mappings so we can cover various sizes beyond 4k.
Additionally removed volatile from ccsr_virt declaration as its not needed for IO accessors
--- arch/powerpc/cpu/mpc85xx/cpu_init_early.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)
arch/powerpc/cpu/mpc85xx/cpu_init_early.c +4 -3
@@ -21,6 +21,7 @@#include <asm/processor.h> #include <asm/mmu.h> #include <asm/fsl_law.h> +#include <asm/io.h> DECLARE_GLOBAL_DATA_PTR ;
@@ -40,8 +41,8 @@ void cpu_init_early_f(void)for (i =0 ; i <sizeof (gd_t); i++) ((char *)gd)[i] =0 ; - mas0 =MAS0_TLBSEL (0 ) |MAS0_ESEL (0 ); - mas1 =MAS1_VALID |MAS1_TID (0 ) |MAS1_TS |MAS1_TSIZE (BOOKE_PAGESZ_4K ); + mas0 =MAS0_TLBSEL (1 ) |MAS0_ESEL (13 ); + mas1 =MAS1_VALID |MAS1_TID (0 ) |MAS1_TS |MAS1_TSIZE (BOOKE_PAGESZ_1M ); mas2 =FSL_BOOKE_MAS2 (CONFIG_SYS_CCSRBAR ,MAS2_I |MAS2_G ); mas3 =FSL_BOOKE_MAS3 (CONFIG_SYS_CCSRBAR_PHYS ,0 ,MAS3_SW |MAS3_SR ); mas7 =FSL_BOOKE_MAS7 (CONFIG_SYS_CCSRBAR_PHYS );
@@ -49,6 +50,6 @@ void cpu_init_early_f(void)write_tlb (mas0, mas1, mas2, mas3, mas7);init_laws (); -invalidate_tlb (0 ); +invalidate_tlb (1 );init_tlbs (); }
Signature · 1 line
1.7.3.4
PATCH v2 5/7 fsl_ifc: Add the workaround for erratum IFC-A002769 (enable on P1010)
From: Poonam Aggrwal <[email protected]>
Issue:
The NOR-FCM does not support access to unaligned addresses for 16 bit port size
Impact:
When 16 bit port size is used, accesses not aligned to 16 bit address boundary will result in incorrect data
Workaround:
The workaround is to switch to GPCM mode for NOR Flash access.
--- arch/powerpc/cpu/mpc85xx/cmd_errata.c | 3 +++ arch/powerpc/include/asm/config_mpc85xx.h | 2 ++ arch/powerpc/include/asm/fsl_ifc.h | 5 +++++ 3 files changed, 10 insertions(+), 0 deletions(-)
arch/powerpc/cpu/mpc85xx/cmd_errata.c +3 -0
@@ -87,6 +87,9 @@ static int do_errata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])puts ("Work-around for Erratum DDR111 enabled\n" );puts ("Work-around for Erratum DDR134 enabled\n" );#endif +#ifdef CONFIG_SYS_FSL_ERRATUM_IFC_A002769 +puts ("Work-around for Erratum IFC-A002769 enabled\n" ); +#endif return 0 ; }
arch/powerpc/include/asm/config_mpc85xx.h +2 -0
@@ -112,6 +112,7 @@#define CONFIG_SYS_CCSRBAR_DEFAULT 0xff700000#define CONFIG_SYS_FSL_PCIE_COMPAT "fsl,qoriq-pcie-v2.2"#define CONFIG_SYS_FSL_USB_INTERNAL_UTMI_PHY +#define CONFIG_SYS_FSL_ERRATUM_IFC_A002769 /* P1011 is single core version of P1020 */ #elif defined(CONFIG_P1011 )
@@ -160,6 +161,7 @@#define CONFIG_NUM_DDR_CONTROLLERS 1#define CONFIG_SYS_CCSRBAR_DEFAULT 0xff700000#define CONFIG_SYS_FSL_USB_INTERNAL_UTMI_PHY +#define CONFIG_SYS_FSL_ERRATUM_IFC_A002769 /* P1015 is single core version of P1024 */ #elif defined(CONFIG_P1015 )
arch/powerpc/include/asm/fsl_ifc.h +5 -0
@@ -951,5 +951,10 @@ struct fsl_ifc {struct fsl_ifc_gpcm ifc_gpcm; }; +#ifdef CONFIG_SYS_FSL_ERRATUM_IFC_A002769 +#undef CSPR_MSEL_NOR +#define CSPR_MSEL_NOR CSPR_MSEL_GPCM +#endif +#endif /* __ASSEMBLY__ */ #endif /* __ASM_PPC_FSL_IFC_H */
Signature · 1 line
1.7.3.4
PATCH v2 6/7 powerpc/P1010: Add workaround for erratum P1010-A003549 (related to IFC)
From: Poonam Aggrwal <[email protected]>
Issue:
Peripheral connected to IFC_CS3 may hamper booting from IFC.
Impact:
Boot from IFC may not be successful if IFC_CS3 is used.
Workaround:
If IFC_CS3 is used, gate IFC_CS3 while booting from NAND or NOR. Also Software should select IFC_CS3 using PMUXCR[26:27] = 0x01.
--- arch/powerpc/cpu/mpc85xx/cmd_errata.c | 3 +++ arch/powerpc/cpu/mpc85xx/cpu_init_early.c | 12 ++++++++++++ arch/powerpc/include/asm/config_mpc85xx.h | 2 ++ 3 files changed, 17 insertions(+), 0 deletions(-)
arch/powerpc/cpu/mpc85xx/cmd_errata.c +3 -0
@@ -90,6 +90,9 @@ static int do_errata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])#ifdef CONFIG_SYS_FSL_ERRATUM_IFC_A002769 puts ("Work-around for Erratum IFC-A002769 enabled\n" );#endif +#ifdef CONFIG_SYS_FSL_ERRATUM_P1010_A003549 +puts ("Work-around for Erratum P1010-A003549 enabled\n" ); +#endif return 0 ; }
arch/powerpc/cpu/mpc85xx/cpu_init_early.c +12 -0
@@ -30,6 +30,9 @@ void cpu_init_early_f(void) {u32 mas0, mas1, mas2, mas3, mas7;int i; +#ifdef CONFIG_SYS_FSL_ERRATUM_P1010_A003549 +ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); +#endif /* Pointer is writable since we allocated a register for it */ gd = (gd_t *) (CONFIG_SYS_INIT_RAM_ADDR +CONFIG_SYS_GBL_DATA_OFFSET );
@@ -49,6 +52,15 @@ void cpu_init_early_f(void)write_tlb (mas0, mas1, mas2, mas3, mas7); +/* +* Work Around for IFC Erratum A-003549. This issue is P1010 +* specific. LCLK(a free running clk signal) is muxed with IFC_CS3 on P1010 SOC +* Hence specifically selecting CS3. +*/ +#ifdef CONFIG_SYS_FSL_ERRATUM_P1010_A003549 +setbits_be32 (&gur->pmuxcr, MPC85xx_PMUXCR_LCLK_IFC_CS3); +#endif +init_laws ();invalidate_tlb (1 );init_tlbs ();
arch/powerpc/include/asm/config_mpc85xx.h +2 -0
@@ -113,6 +113,7 @@#define CONFIG_SYS_FSL_PCIE_COMPAT "fsl,qoriq-pcie-v2.2"#define CONFIG_SYS_FSL_USB_INTERNAL_UTMI_PHY #define CONFIG_SYS_FSL_ERRATUM_IFC_A002769 +#define CONFIG_SYS_FSL_ERRATUM_P1010_A003549 /* P1011 is single core version of P1020 */ #elif defined(CONFIG_P1011 )
@@ -162,6 +163,7 @@#define CONFIG_SYS_CCSRBAR_DEFAULT 0xff700000#define CONFIG_SYS_FSL_USB_INTERNAL_UTMI_PHY #define CONFIG_SYS_FSL_ERRATUM_IFC_A002769 +#define CONFIG_SYS_FSL_ERRATUM_P1010_A003549 /* P1015 is single core version of P1024 */ #elif defined(CONFIG_P1015 )
Signature · 1 line
1.7.3.4
PATCH v2 7/7 fsl_ifc: Add the workaround for erratum IFC A-003399(enabled on P1010)
From: Poonam Aggrwal <[email protected]>
Issue: Address masking doesn't work properly.
When sum of the base address, defined by BA, and memory bank size, defined by AM, exceeds 4GB (0xffff_ffff) then AMASKn[AM] doesn't mask CSPRn[BA] bits.
Impact:
This will impact booting when we are reprogramming CSPR0(BA) and AMASK0(AMASK) while executing from NOR Flash.
Workaround:
Re-programming of CSPR(BA) and AMASK is done while not executing from NOR Flash. The code which programs the BA and AMASK is executed from L2-SRAM.
--- arch/powerpc/cpu/mpc85xx/cmd_errata.c | 3 + arch/powerpc/cpu/mpc85xx/cpu_init_early.c | 86 +++++++++++++++++++++++++++++ arch/powerpc/cpu/mpc85xx/cpu_init_nand.c | 2 + arch/powerpc/cpu/mpc8xxx/fsl_ifc.c | 2 + arch/powerpc/include/asm/config_mpc85xx.h | 2 + 5 files changed, 95 insertions(+), 0 deletions(-)
arch/powerpc/cpu/mpc85xx/cmd_errata.c +3 -0
@@ -93,6 +93,9 @@ static int do_errata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])#ifdef CONFIG_SYS_FSL_ERRATUM_P1010_A003549 puts ("Work-around for Erratum P1010-A003549 enabled\n" );#endif +#ifdef CONFIG_SYS_FSL_ERRATUM_IFC_A003399 +puts ("Work-around for Erratum IFC A-003399 enabled\n" ); +#endif return 0 ; }
arch/powerpc/cpu/mpc85xx/cpu_init_early.c +86 -0
104 lines not on this page · raw message
arch/powerpc/cpu/mpc85xx/cpu_init_nand.c +2 -0
@@ -43,12 +43,14 @@ void cpu_init_f(void)#endif #endif #ifdef CONFIG_FSL_IFC +#ifndef CONFIG_SYS_FSL_ERRATUM_IFC_A003399 #if defined(CONFIG_SYS_CSPR0 ) && defined(CONFIG_SYS_CSOR0 )set_ifc_cspr (IFC_CS0 ,CONFIG_SYS_CSPR0 );set_ifc_amask (IFC_CS0 ,CONFIG_SYS_AMASK0 );set_ifc_csor (IFC_CS0 ,CONFIG_SYS_CSOR0 );#endif #endif +#endif #if defined(CONFIG_SYS_RAMBOOT ) && defined(CONFIG_SYS_INIT_L2_ADDR )ccsr_l2cache_t *l2cache = (void *)CONFIG_SYS_MPC85xx_L2_ADDR;
arch/powerpc/cpu/mpc8xxx/fsl_ifc.c +2 -0
@@ -43,10 +43,12 @@ void init_early_memctl_regs(void)set_ifc_ftim (IFC_CS0 ,IFC_FTIM2 ,CONFIG_SYS_CS0_FTIM2 );set_ifc_ftim (IFC_CS0 ,IFC_FTIM3 ,CONFIG_SYS_CS0_FTIM3 ); +#if !defined(CONFIG_SYS_FSL_ERRATUM_IFC_A003399 ) || defined(CONFIG_SYS_RAMBOOT )set_ifc_cspr (IFC_CS0 ,CONFIG_SYS_CSPR0 );set_ifc_amask (IFC_CS0 ,CONFIG_SYS_AMASK0 );set_ifc_csor (IFC_CS0 ,CONFIG_SYS_CSOR0 );#endif +#endif #if defined(CONFIG_SYS_CSPR1 ) && defined(CONFIG_SYS_CSOR1 )set_ifc_ftim (IFC_CS1 ,IFC_FTIM0 ,CONFIG_SYS_CS1_FTIM0 );
arch/powerpc/include/asm/config_mpc85xx.h +2 -0
@@ -114,6 +114,7 @@#define CONFIG_SYS_FSL_USB_INTERNAL_UTMI_PHY #define CONFIG_SYS_FSL_ERRATUM_IFC_A002769 #define CONFIG_SYS_FSL_ERRATUM_P1010_A003549 +#define CONFIG_SYS_FSL_ERRATUM_IFC_A003399 /* P1011 is single core version of P1020 */ #elif defined(CONFIG_P1011 )
@@ -164,6 +165,7 @@#define CONFIG_SYS_FSL_USB_INTERNAL_UTMI_PHY #define CONFIG_SYS_FSL_ERRATUM_IFC_A002769 #define CONFIG_SYS_FSL_ERRATUM_P1010_A003549 +#define CONFIG_SYS_FSL_ERRATUM_IFC_A003399 /* P1015 is single core version of P1024 */ #elif defined(CONFIG_P1015 )
Signature · 1 line
1.7.3.4
PATCH v2 7/7 fsl_ifc: Add the workaround for erratum IFC A-003399(enabled on P1010)
Dear Kumar Gala,
Quoted 11 lines · In message <[email protected]> you…
From: Poonam Aggrwal <[email protected]>
Issue: Address masking doesn't work properly.
When sum of the base address, defined by BA, and memory bank size, defined by AM, exceeds 4GB (0xffff_ffff) then AMASKn[AM] doesn't mask CSPRn[BA] bits.Impact:
This will impact booting when we are reprogramming CSPR0(BA) and AMASK0(AMASK) while executing from NOR Flash.
Quoted 6 lines
Workaround:
Re-programming of CSPR(BA) and AMASK is done while not executing from NOR Flash. The code which programs the BA and AMASK is executed from L2-SRAM.Signed-off-by Poonam Aggrwal <[email protected]>Signed-off-by Kumar Gala <[email protected]>
This commit introdces new build warnings for the following boards:
P1010RDB_36BIT_NOR P1010RDB_NOR P1010RDB_36BIT_NOR_SECBOOT P1010RDB_NOR_SECBOOT
For example:
Configuring for P1010RDB_NOR - Board: P1010RDB, Options: P1010RDB cpu_init_early.c: In function 'cpu_init_early_f':
cpu_init_early.c:74: warning: 'l2srbar' may be used uninitialized in this function
Please fix!
Kumar, Poonam - I'm really p*ssed off. Both of you have more than enough of experience to know that you should not submit untested patches. especially here, where I already had to reject this patch because it did not even pass checkpatch:
I wrote in message <[email protected]>:
| Dear Kumar Gala, | | In message <[email protected]> | you wrote: | > | > > Kumar, could you __please__ get used to running your patches | > > throuch | > > checkpatch __before__ submitting? Thanks. | > | > I try to, but not all of them are by me ;) | | I know. But you submitted them, so you are responsible.
This level of neglect is really disappointing.
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: wd at denx.de 1000 pains = 1 Megahertz
PATCH v2 7/7 fsl_ifc: Add the workaround for erratum IFC A-003399(enabled on P1010)
Quoted 57 lines · Wolfgang Denk
Dear Kumar Gala,
Quoted 11 lines · In message <[email protected]> you…
From: Poonam Aggrwal <[email protected]>
Issue: Address masking doesn't work properly.
When sum of the base address, defined by BA, and memory bank size, defined by AM, exceeds 4GB (0xffff_ffff) then AMASKn[AM] doesn't mask CSPRn[BA] bits.Impact:
This will impact booting when we are reprogramming CSPR0(BA) and AMASK0(AMASK) while executing from NOR Flash.Quoted 6 lines
Workaround:
Re-programming of CSPR(BA) and AMASK is done while not executing from NOR Flash. The code which programs the BA and AMASK is executed from L2-SRAM.Signed-off-by Poonam Aggrwal <[email protected]>Signed-off-by Kumar Gala <[email protected]>This commit introdces new build warnings for the following boards:
P1010RDB_36BIT_NOR P1010RDB_NOR P1010RDB_36BIT_NOR_SECBOOT P1010RDB_NOR_SECBOOTFor example:
Configuring for
P1010RDB_NOR- Board: P1010RDB, Options: P1010RDBcpu_init_early.c: In function 'cpu_init_early_f':
cpu_init_early.c:74: warning: 'l2srbar' may be used uninitialized in this functionPlease fix!
Kumar, Poonam - I'm really p*ssed off. Both of you have more than enough of experience to know that you should not submit untested patches. especially here, where I already had to reject this patch because it did not even pass checkpatch:
I wrote in message <[email protected]>:
| Dear Kumar Gala, | | In message <[email protected]> | you wrote: | > | > > Kumar, could you __please__ get used to running your patches | > > throuch | > > checkpatch __before__ submitting? Thanks. | > | > I try to, but not all of them are by me ;) | | I know. But you submitted them, so you are responsible.
Quoted 4 lines
This level of neglect is really disappointing.
Wolfgang Denk
If you look at the code I have NO IDEA how to fix this for older GCC. Gripping at me about this isn't fair. I'm sure if I hack something to make gcc-4.2 happy I'm going to piss off gcc-4.6. We can't win.
At some point we have to move off gcc-4.2 as the baseline compiler w/regards to warning and code generation.
- k
PATCH v2 7/7 fsl_ifc: Add the workaround for erratum IFC A-003399(enabled on P1010)
Kumar, Wolfgang
I think this is my mistake, I did not take care of checkpatch.
Please let me know , I can submit it again.
Regards
Poonam
Quoted 84 lines
-----Original Message-----
From: Kumar Gala [mailto:galak at kernel.crashing.org]
Sent: Tuesday, October 18, 2011 5:18 PM
To: Wolfgang Denk
Cc: u-boot at lists.denx.de; Aggrwal Poonam-B10812
Subject: Re: [U-Boot] [PATCH 7/7][v2]fsl_ifc: Add the workaround for erratum IFC A-003399(enabled on P1010)Quoted 3 lines · Wolfgang Denk
Dear Kumar Gala,
In message <1312555480-13401-8-git-send-email-
Quoted 7 lines · galak at kernel.crashing.org> you wrote:
Quoted 7 lines
From: Poonam Aggrwal <[email protected]>
Issue: Address masking doesn't work properly.
When sum of the base address, defined by BA, and memory bank size, defined by AM, exceeds 4GB (0xffff_ffff) then AMASKn[AM] doesn't mask CSPRn[BA] bits.Quoted 7 lines
Quoted 7 lines
Impact:
This will impact booting when we are reprogramming CSPR0(BA) and AMASK0(AMASK) while executing from NOR Flash.Workaround:
Re-programming of CSPR(BA) and AMASK is done while not executing from NOR Flash. The code which programs the BA and AMASK is executed fromL2-SRAM.
Quoted 41 lines
Quoted 3 lines
Signed-off-by Poonam Aggrwal <[email protected]>Signed-off-by Kumar Gala <[email protected]>This commit introdces new build warnings for the following boards:
P1010RDB_36BIT_NOR P1010RDB_NOR P1010RDB_36BIT_NOR_SECBOOT P1010RDB_NOR_SECBOOTFor example:
Configuring for
P1010RDB_NOR- Board: P1010RDB, Options: P1010RDBcpu_init_early.c: In function 'cpu_init_early_f':
cpu_init_early.c:74: warning: 'l2srbar' may be used uninitialized in this functionPlease fix!
Kumar, Poonam - I'm really p*ssed off. Both of you have more than enough of experience to know that you should not submit untested patches. especially here, where I already had to reject this patch because it did not even pass checkpatch:
I wrote in message <[email protected]>:
| Dear Kumar Gala, | | In message | <[email protected]> | you wrote: | > | > > Kumar, could you __please__ get used to running your patches | > > throuch checkpatch __before__ submitting? Thanks. | > | > I try to, but not all of them are by me ;) | | I know. But you submitted them, so you are responsible.Quoted 4 lines
This level of neglect is really disappointing.
Wolfgang Denk
If you look at the code I have NO IDEA how to fix this for older GCC. Gripping at me about this isn't fair. I'm sure if I hack something to make gcc-4.2 happy I'm going to piss off gcc-4.6. We can't win.
At some point we have to move off gcc-4.2 as the baseline compiler w/regards to warning and code generation.
- k
PATCH v2 7/7 fsl_ifc: Add the workaround for erratum IFC A-003399(enabled on P1010)
In reply to Kumar GalaDear Kumar,
Quoted 2 lines · In message <[email protected]> you wrote:
If you look at the code I have NO IDEA how to fix this for older GCC.
Maybe you have to explain the code to me. LIke the compiler, I wonder where l2srbar gets initialized:
Here is the declaration:
...
74 u32 *l2srbar, *dst, *src;
...
First use of this variable is here:
...
139 for (i = 0; i < 1024; i++)
140 *l2srbar++ = *src++;
...
Where is the initialization?
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] A year spent in artificial intelligence is enough to make one believe in God.
PATCH v2 7/7 fsl_ifc: Add the workaround for erratum IFC A-003399(enabled on P1010)
Quoted 15 lines · Wolfgang Denk
Dear Kumar,
Quoted 2 lines · In message <[email protected]> you wrote:
If you look at the code I have NO IDEA how to fix this for older GCC.
Maybe you have to explain the code to me. LIke the compiler, I wonder where l2srbar gets initialized:
Here is the declaration:
...
74 u32 *l2srbar, *dst, *src;
...
Quoted 8 lines
First use of this variable is here:
...
139 for (i = 0; i < 1024; i++)
140 *l2srbar++ = *src++;
...Where is the initialization?
I apologize, now that I look at this I question what in the world is going on.
Poonam,
What's going on whit this code:
dst = (u32 *) SRAM_BASE_ADDR;
src = (u32 *) setup_ifc;
for (i = 0; i < 1024; i++)
*l2srbar++ = *src++;we don't use 'dst' as far as I can tell and 'l2srbar' is never initialized so what in the world are we writing to?
- k
PATCH v2 7/7 fsl_ifc: Add the workaround for erratum IFC A-003399(enabled on P1010)
Quoted 45 lines
-----Original Message-----
From: Kumar Gala [mailto:galak at kernel.crashing.org]
Sent: Wednesday, October 19, 2011 11:52 AM
To: Aggrwal Poonam-B10812
Cc: u-boot at lists.denx.de List; Wolfgang Denk
Subject: Re: [U-Boot] [PATCH 7/7][v2]fsl_ifc: Add the workaround for erratum IFC A-003399(enabled on P1010)Quoted 3 lines · Wolfgang Denk
Dear Kumar,
In message <[email protected]>
Quoted 12 lines · you
Quoted 2 lines
If you look at the code I have NO IDEA how to fix this for older GCC.
Maybe you have to explain the code to me. LIke the compiler, I wonder where l2srbar gets initialized:
Here is the declaration:
...
74 u32 *l2srbar, *dst, *src;
...Quoted 8 lines
First use of this variable is here:
...
139 for (i = 0; i < 1024; i++)
140 *l2srbar++ = *src++;
...Where is the initialization?
I apologize, now that I look at this I question what in the world is going on.
Poonam,
What's going on whit this code:
Quoted 8 lines
dst = (u32 *) SRAM_BASE_ADDR; src = (u32 *) setup_ifc; for (i = 0; i < 1024; i++) *l2srbar++ = *src++;we don't use 'dst' as far as I can tell and 'l2srbar' is never initialized so what in the world are we writing to?
Hello Kumar, Wolfgang
This is a mistake, I admit.
Extremely sorry for this.
I will send a new patch.
Quoted 1 line
- k
PATCH v2 4/7 powerpc/85xx: Expanding the window of CCSRBAR in AS=1 from 4k to 1M
In reply to Kumar GalaHello.
Quoted 10 lines · Kumar Gala
From: Poonam Aggrwal<[email protected]>
For an IFC Erratum (A-003399) we will need to access IFC registers in
cpu_init_early_f()so expand the TLB covering CCSR to 1M.Since we need a TLB to cover 1M we move to using TLB1 array for all the early mappings so we can cover various sizes beyond 4k.
Additionally removed volatile from
ccsr_virtdeclaration as its not needed for IO accessors
I don't see that change in the patch...
Quoted 30 lines
Signed-off-by Poonam Aggrwal<[email protected]>Signed-off-by Kumar Gala<[email protected]>--- arch/powerpc/cpu/mpc85xx/cpu_init_early.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)arch/powerpc/cpu/mpc85xx/cpu_init_early.c +3
-2@@ -21,6 +21,7 @@#include <asm/processor.h> #include <asm/mmu.h> #include <asm/fsl_law.h> +#include <asm/io.h> DECLARE_GLOBAL_DATA_PTR ;@@ -40,8 +41,8 @@ void cpu_init_early_f(void)for (i =0 ; i<sizeof (gd_t); i++) ((char *)gd)[i] =0 ; - mas0 =MAS0_TLBSEL (0 ) |MAS0_ESEL (0 ); - mas1 =MAS1_VALID |MAS1_TID (0 ) |MAS1_TS |MAS1_TSIZE (BOOKE_PAGESZ_4K ); + mas0 =MAS0_TLBSEL (1 ) |MAS0_ESEL (13 ); + mas1 =MAS1_VALID |MAS1_TID (0 ) |MAS1_TS |MAS1_TSIZE (BOOKE_PAGESZ_1M ); mas2 =FSL_BOOKE_MAS2 (CONFIG_SYS_CCSRBAR ,MAS2_I |MAS2_G ); mas3 =FSL_BOOKE_MAS3 (CONFIG_SYS_CCSRBAR_PHYS ,0 ,MAS3_SW |MAS3_SR ); mas7 =FSL_BOOKE_MAS7 (CONFIG_SYS_CCSRBAR_PHYS );
arch/powerpc/cpu/mpc85xx/cpu_init_early.c void cpu_init_early_f(void) · line 55
Quoted 7 lines
arch/powerpc/cpu/mpc85xx/cpu_init_early.c +1
-1@@ -49,6 +50,6 @@ void cpu_init_early_f(void)write_tlb (mas0, mas1, mas2, mas3, mas7);init_laws (); -invalidate_tlb (0 ); +invalidate_tlb (1 );init_tlbs (); }
WBR, Sergei
PATCH v2 4/7 powerpc/85xx: Expanding the window of CCSRBAR in AS=1 from 4k to 1M
Quoted 9 lines · Sergei Shtylyov
Hello.
Quoted 4 lines · Kumar Gala
From: Poonam Aggrwal<[email protected]>
For an IFC Erratum (A-003399) we will need to access IFC registers in
cpu_init_early_f()so expand the TLB covering CCSR to 1M.
Quoted 7 lines
Quoted 5 lines
Since we need a TLB to cover 1M we move to using TLB1 array for all the early mappings so we can cover various sizes beyond 4k.
Additionally removed volatile from
ccsr_virtdeclaration as its not needed for IO accessorsI don't see that change in the patch...
oops, will update commit message (its stale)
- k
Quoted 6 lines
Quoted 6 lines
Signed-off-by Poonam Aggrwal<[email protected]>Signed-off-by Kumar Gala<[email protected]>--- arch/powerpc/cpu/mpc85xx/cpu_init_early.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)
v2 cover powerpc/85xx: P1010RDB
In reply to Kumar GalaQuoted 8 lines · Kumar Gala
Patch series adds support for P1010RDB, NAND support (for IFC on P1010) and various errata fixes for P1010.
V2 changes:
* re-work based on CCSRBAR cleanup patches
* white space fixes
* checkpatch cleanup fixes
* rework 'dummy' udelay in nand spl code
applied 1-7, with commit message fix to 85xx next
- k