83xx/pcie: fix build error for 83xx pcie
Subsystems (4)
PATCH v2 1/29 83xx/pcie: fix build error for 83xx pcie
From: Roy Zang <[email protected]>
fix the following build error:pcie.c: In function 'mpc83xx_pcie_init_bus':
pcie.c:315:34: error: 'PCI_LTSSM' undeclared (first use in this function)
pcie.c:315:34: note: each undeclared identifier is reported only once for each function it appears in
pcie.c:316:15: error: 'PCI_LTSSM_L0' undeclared (first use in this function)
make[1]: *** [pcie.o] Error 1
make: *** [arch/powerpc/cpu/mpc83xx/libmpc83xx.o] Error 2
--- arch/powerpc/cpu/mpc83xx/pcie.c | 2 ++ 1 file changed, 2 insertions(+)
arch/powerpc/cpu/mpc83xx/pcie.c +2 -0
@@ -312,6 +312,8 @@ static void mpc83xx_pcie_init_bus(int bus, struct pci_region *reg)printf ("PCIE%d: " , bus); +#define PCI_LTSSM 0x404/* PCIe Link Training, Status State Machine */ +#define PCI_LTSSM_L0 0x16/* L0 state */ reg16 =in_le16 (hose_cfg_base +PCI_LTSSM );if (reg16 >=PCI_LTSSM_L0 )printf ("link\n" );
Signature · 1 line
1.7.9.5
PATCH v2 2/29 Enable L2 cache parity/ECC error checking
From: James Yang <[email protected]>
Enable L2 cache parity/ECC error checking.
--- arch/powerpc/cpu/mpc85xx/cpu_init.c | 2 +- arch/powerpc/cpu/mpc85xx/start.S | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/cpu/mpc85xx/cpu_init.c +1 -1
@@ -337,7 +337,7 @@ int enable_cluster_l2(void)while ((in_be32 (&l2cache->l2csr0) & (L2CSR0_L2FI |L2CSR0_L2LFC )) !=0 ) ; -out_be32 (&l2cache->l2csr0,L2CSR0_L2E ); +out_be32 (&l2cache->l2csr0,L2CSR0_L2E |L2CSR0_L2PE ); } i++; }while (!(cluster &TP_CLUSTER_EOC ));
arch/powerpc/cpu/mpc85xx/start.S +1 -1
@@ -734,7 +734,7 @@ enable_l2_cluster_l2: isync and. r1, r0, r4 bne 1b - lis r4, L2CSR0_L2E at h + lis r4, (L2CSR0_L2E|L2CSR0_L2PE)@h sync stw r4, 0(r3) /* enable L2 */ delete_ccsr_l2_tlb:
Signature · 1 line
1.7.9.5
PATCH v2 3/29 net/phy: fix select line for TN80xx
In reply to York SunFrom: Shaohui Xie <[email protected]>
TN80xx has same PHY ID as TN2020, but it needs different setting to register 30.93 which used to select line, so we read register 30.32 which has bit 15:12 to indicate PHY hardware version, for TN20xx we will get 3 or 2, for TN80xx we will get 5 or 4.
--- drivers/net/phy/teranetics.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
drivers/net/phy/teranetics.c +14 -2
@@ -34,9 +34,21 @@ int tn2020_config(struct phy_device *phydev)unsigned short restart_an = (MDIO_AN_CTRL1_RESTART |MDIO_AN_CTRL1_ENABLE |MDIO_AN_CTRL1_XNP ); +u8 phy_hwversion; -phy_write (phydev,30 ,93 ,2 ); -phy_write (phydev,MDIO_MMD_AN ,MDIO_CTRL1 , restart_an); +/* +* bit 15:12 of register 30.32 indicates PHY hardware +* version. It can be used to distinguish TN80xx from +* TN2020. TN2020 needs write 0x2 to 30.93, but TN80xx +* needs 0x1. +*/ + phy_hwversion = (phy_read (phydev,30 ,32 ) >>12 ) &0xf ; +if (phy_hwversion <=3 ) { +phy_write (phydev,30 ,93 ,2 ); +phy_write (phydev,MDIO_MMD_AN ,MDIO_CTRL1 , restart_an); + }else { +phy_write (phydev,30 ,93 ,1 ); + } }return 0 ;
Signature · 1 line
1.7.9.5
PATCH v2 4/29 powerpc/mpc85xx: check if core is disabled for showing status
In reply to York Sun"cpu <num> status" should check if core is disabled before printing the spin table location.
--- arch/powerpc/cpu/mpc85xx/mp.c | 2 ++ 1 file changed, 2 insertions(+)
arch/powerpc/cpu/mpc85xx/mp.c +2 -0
@@ -80,6 +80,8 @@ int cpu_status(int nr)if (nr == id) { table = (u32 *)&__spin_table;printf ("table base @ 0x%p\n" , table); + }else if (is_core_disabled (nr)) { +puts ("Disabled\n" ); }else { table = (u32 *)&__spin_table + nr *NUM_BOOT_ENTRY ;printf ("Running on cpu %d\n" , id);
Signature · 1 line
1.7.9.5
PATCH v2 5/29 powerpc/t4240qds: Add VDD override
In reply to York SunAllow VDD voltage overriding with a command. This is an add-on feasture of VID. To override VDD, use command vdd_override with the value of voltage in mV, for example
vdd_override <voltage in mV, eg. 1050>
The above example will set the VDD to 1.050 volt. Any wrong value out of range of 0.8188 to 1.2125 volt or invalid string is ignored.
In addition to the command, if overriding VDD is needed earlier in booting process, save an variable and reboot:
setenv t4240qds_vdd_mv <voltage in mV>
saveenv
--- board/freescale/t4qds/t4qds.c | 39 +++++++++++++++++++++++++++++++++++++-- doc/README.t4240qds | 24 ++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 2 deletions(-)
board/freescale/t4qds/t4qds.c +37 -2
@@ -234,7 +234,7 @@ static inline int set_voltage(u8 vid) } -static int adjust_vdd (void ) +static int adjust_vdd (ulong vdd_override) {int re_enable =disable_interrupts (); ccsr_gur_t __iomem *gur =
@@ -243,6 +243,8 @@ static int adjust_vdd(void)u8 vid, vid_current;int vdd_target, vdd_current, vdd_last;int ret; +unsigned long vdd_string_override; +char *vdd_string;static const uint16_t vdd[32 ] = {0 ,/* unused */ 9875 ,/* 0.9875V */
@@ -292,6 +294,19 @@ static int adjust_vdd(void)FSL_CORENET_DCFG_FUSESR_ALTVID_MASK ; } vdd_target = vdd[vid]; + +/* check override variable for overriding VDD */ + vdd_string =getenv ("t4240qds_vdd_mv" ); +if (vdd_override ==0 && vdd_string && + !strict_strtoul (vdd_string,10 , &vdd_string_override)) + vdd_override = vdd_string_override; +if (vdd_override >=819 && vdd_override <=1212 ) { + vdd_target = vdd_override *10 ;/* convert to 1/10 mV */ +debug ("VDD override is %lu\n" , vdd_override); + }else if (vdd_override !=0 ) { +printf ("Invalid value.\n" ); + } +if (vdd_target ==0 ) {debug ("VID: VID not used\n" ); ret =0 ;
@@ -511,7 +526,7 @@ int board_early_init_r(void)* Adjust core voltage according to voltage ID * This function changes I2C mux to channel 2. */ -if (adjust_vdd ()) +if (adjust_vdd (0 ))printf ("Warning: Adjusting core voltage failed.\n" );/* Configure board SERDES ports crossbar */
@@ -801,3 +816,23 @@ void qixis_dump_switch(void) i + 1, byte_to_binary_mask(sw[i], mask[i], buf), sw[i]); } } + +static int do_vdd_adjust (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) +{ +ulong override; + +if (argc <2 ) +return CMD_RET_USAGE ; +if (!strict_strtoul (argv[1 ],10 , &override)) +adjust_vdd (override);/* the value is checked by callee */ +else +return CMD_RET_USAGE ; + +return 0 ; +} + +U_BOOT_CMD ( + vdd_override,2 ,0 , do_vdd_adjust, +"Override VDD" , +"- override with the voltage specified in mV, eg. 1050" +);
doc/README.t4240qds +24 -0
@@ -96,3 +96,27 @@ The addresses in brackets are physical addresses. 0x0_ffff_f000 (0x0_7fff_fff0) - 0x0_ffff_ffff 4KB Boot page translation for secondary cores The physical address of the last (boot page translation) varies with the actual DDR size. + +Voltage ID and VDD override +-------------------- +T4240 has a VID feature. U-boot reads the VID efuses and adjust the voltage +accordingly. The voltage can also be override by command vdd_override. The +syntax is + +vdd_override <voltage in mV>, eg. 1050 is for 1.050v. + +Upon success, the actual voltage will be read back. The value is checked +for safety and any invalid value will not adjust the voltage. + +Another way to override VDD is to use environmental variable, in case of using +command is too late for some debugging. The syntax is + +setenv t4240qds_vdd_mv <voltage in mV> +saveenv +reset + +The override voltage takes effect when booting. + +Note: voltage adjustment needs to be done step by step. Changing voltage too +rapidly may cause current surge. The voltage stepping is done by software. +Users can set the final voltage directly.
Signature · 1 line
1.7.9.5
PATCH v2 6/29 T4240/ramboot: enable PBL tool for T4240
In reply to York SunFrom: Shaohui Xie <[email protected]>
Added a default RCW(1_28_6_12) and PBI configure file for T4240, so it can use PBL tool to produce the ramboot image.
--- board/freescale/t4qds/t4_pbi.cfg | 36 ++++++++++++++++++++++++++++++++++++ board/freescale/t4qds/t4_rcw.cfg | 7 +++++++ include/configs/t4qds.h | 2 ++ 3 files changed, 45 insertions(+) create mode 100644 board/freescale/t4qds/t4_pbi.cfg create mode 100644 board/freescale/t4qds/t4_rcw.cfg
board/freescale/t4qds/t4_pbi.cfg new file +36 -0
@@ -0,0 +1,36 @@ +#PBI commands +#Initialize CPC1 +09010000 00200400 +09138000 00000000 +091380c0 00000100 +#512KB SRAM +09010100 00000000 +09010104 fff80009 +09010f00 08000000 +#enable CPC1 +09010000 80000000 +#Configure LAW for CPC1 +09000d00 00000000 +09000d04 fff80000 +09000d08 81000012 +#workaround for IFC bus speed +091241c0 f03f3f3f +091241c4 ff003f3f +09124010 00000101 +09124130 0000000c +#workaround for SERDES A-006031 +090ea000 064740e6 +090ea020 064740e6 +090eb000 064740e6 +090eb020 064740e6 +090ec000 064740e6 +090ec020 064740e6 +090ed000 064740e6 +090ed020 064740e6 +#Configure alternate space +09000010 00000000 +09000014 ff000000 +09000018 81000000 +#Flush PBL data +09138000 00000000 +091380c0 00000000
board/freescale/t4qds/t4_rcw.cfg new file +7 -0
@@ -0,0 +1,7 @@ +#PBL preamble and RCW header +aa55aa55 010e0100 +#serdes protocol 1_28_6_12 +14180019 0c101916 00000000 00000000 +04383060 30548c00 6c020000 19000000 +00000000 ee0000ee 00000000 000187fc +00000000 00000000 00000000 00000018
include/configs/t4qds.h +2 -0
@@ -29,6 +29,8 @@#ifdef CONFIG_RAMBOOT_PBL #define CONFIG_RAMBOOT_TEXT_BASE CONFIG_SYS_TEXT_BASE#define CONFIG_RESET_VECTOR_ADDRESS 0xfffffffc +#define CONFIG_PBLPBI_CONFIG $(SRCTREE)/board/freescale/t4qds/t4_pbi.cfg +#define CONFIG_PBLRCW_CONFIG $(SRCTREE)/board/freescale/t4qds/t4_rcw.cfg#endif #define CONFIG_CMD_REGINFO
Signature · 1 line
1.7.9.5
PATCH v2 7/29 Add e6500 L2 replacement policy selection
In reply to York SunFrom: James Yang <[email protected]>
Add e6500 L2 replacement policy selection. This is compile-time config.
--- arch/powerpc/cpu/mpc85xx/cpu_init.c | 2 +- arch/powerpc/cpu/mpc85xx/start.S | 1 + arch/powerpc/include/asm/processor.h | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-)
arch/powerpc/cpu/mpc85xx/cpu_init.c +1 -1
@@ -337,7 +337,7 @@ int enable_cluster_l2(void)while ((in_be32 (&l2cache->l2csr0) & (L2CSR0_L2FI |L2CSR0_L2LFC )) !=0 ) ; -out_be32 (&l2cache->l2csr0,L2CSR0_L2E |L2CSR0_L2PE ); +out_be32 (&l2cache->l2csr0,L2CSR0_L2E |L2CSR0_L2PE |L2CSR0_L2REP_MODE ); } i++; }while (!(cluster &TP_CLUSTER_EOC ));
arch/powerpc/cpu/mpc85xx/start.S +1 -0
@@ -735,6 +735,7 @@ enable_l2_cluster_l2: and. r1, r0, r4 bne 1b lis r4, (L2CSR0_L2E|L2CSR0_L2PE)@h + ori r4, r4, (L2CSR0_L2REP_MODE)@l sync stw r4, 0(r3) /* enable L2 */ delete_ccsr_l2_tlb:
arch/powerpc/include/asm/processor.h +9 -0
@@ -507,6 +507,15 @@#define L2CSR0_L2IO 0x00100000/* L2 Cache Instruction Only */ #define L2CSR0_L2DO 0x00010000/* L2 Cache Data Only */ #define L2CSR0_L2REP 0x00003000/* L2 Line Replacement Algo */ + +/* e6500 */ +#define L2CSR0_L2REP_SPLRUAGE 0x00000000/* L2REP Streaming PLRU with Aging */ +#define L2CSR0_L2REP_FIFO 0x00001000/* L2REP FIFO */ +#define L2CSR0_L2REP_SPLRU 0x00002000/* L2REP Streaming PLRU */ +#define L2CSR0_L2REP_PLRU 0x00003000/* L2REP PLRU */ + +#define L2CSR0_L2REP_MODE L2CSR0_L2REP_SPLRUAGE +#define L2CSR0_L2FL 0x00000800/* L2 Cache Flush */ #define L2CSR0_L2LFC 0x00000400/* L2 Cache Lock Flash Clear */ #define L2CSR0_L2LOA 0x00000080/* L2 Cache Lock Overflow Allocate */
Signature · 1 line
1.7.9.5
PATCH v2 8/29 powerpc/p5040: enable NAND, SD, SPI boot support
In reply to York SunFrom: Shaohui Xie <[email protected]>
--- boards.cfg | 3 +++ 1 file changed, 3 insertions(+)
boards.cfg +3 -0
@@ -874,6 +874,9 @@ P5020DS_SECURE_BOOT powerpc mpc85xx corenet_ds freesca P5020DS_SPIFLASH powerpc mpc85xx corenet_ds freescale - P5020DS:RAMBOOT_PBL,SPIFLASH,SYS_TEXT_BASE=0xFFF80000 P5020DS_SRIO_PCIE_BOOT powerpc mpc85xx corenet_ds freescale - P5020DS:SRIO_PCIE_BOOT_SLAVE,SYS_TEXT_BASE=0xFFF80000 P5040DS powerpc mpc85xx corenet_ds freescale +P5040DS_NAND powerpc mpc85xx corenet_ds freescale - P5040DS:RAMBOOT_PBL,NAND,SYS_TEXT_BASE=0xFFF80000 +P5040DS_SDCARD powerpc mpc85xx corenet_ds freescale - P5040DS:RAMBOOT_PBL,SDCARD,SYS_TEXT_BASE=0xFFF80000 +P5040DS_SPIFLASH powerpc mpc85xx corenet_ds freescale - P5040DS:RAMBOOT_PBL,SPIFLASH,SYS_TEXT_BASE=0xFFF80000 BSC9131RDB_SPIFLASH powerpc mpc85xx bsc9131rdb freescale - BSC9131RDB:BSC9131RDB,SPIFLASH BSC9132QDS_NOR_DDRCLK100 powerpc mpc85xx bsc9132qds freescale - BSC9132QDS:BSC9132QDS,SYS_CLK_100_DDR_100 BSC9132QDS_NOR_DDRCLK133 powerpc mpc85xx bsc9132qds freescale - BSC9132QDS:BSC9132QDS,SYS_CLK_100_DDR_133
Signature · 1 line
1.7.9.5
PATCH v2 9/29 powerpc/T4160: Merge T4160 and T4240 in config_mpc85xx.h
In reply to York SunT4160 is a subset of T4240. Merge them in config_mpc85xx.h to simplify the defines. Also move CONFIG_E6500 out of t4qds.h into config_mpc85xx.h.
--- arch/powerpc/include/asm/config_mpc85xx.h | 44 +++++++---------------------- include/configs/t4qds.h | 1 - 2 files changed, 10 insertions(+), 35 deletions(-)
arch/powerpc/include/asm/config_mpc85xx.h +10 -34
@@ -514,57 +514,33 @@#define CONFIG_SYS_FSL_ESDHC_P1010_BROKEN_SDCLK #define CONFIG_SYS_FSL_PCIE_COMPAT "fsl,qoriq-pcie-v2.2" -#elif defined(CONFIG_PPC_T4240 ) +#elif defined(CONFIG_PPC_T4240 ) || defined(CONFIG_PPC_T4160 ) +#define CONFIG_E6500 #define CONFIG_SYS_PPC64 /* 64-bit core */ #define CONFIG_FSL_CORENET /* Freescale CoreNet platform */ #define CONFIG_SYS_FSL_QORIQ_CHASSIS2 /* Freescale Chassis generation 2 */ #define CONFIG_SYS_FSL_QMAN_V3 /* QMAN version 3 */ +#ifdef CONFIG_PPC_T4240 #define CONFIG_MAX_CPUS 12 -#define CONFIG_SYS_FSL_NUM_CC_PLLS 5 -#define CONFIG_SYS_FSL_NUM_LAWS 32 -#define CONFIG_SYS_FSL_SRDS_3 -#define CONFIG_SYS_FSL_SRDS_4 -#define CONFIG_SYS_FSL_SEC_COMPAT 4 -#define CONFIG_SYS_NUM_FMAN 2#define CONFIG_SYS_NUM_FM1_DTSEC 8#define CONFIG_SYS_NUM_FM1_10GEC 2#define CONFIG_SYS_NUM_FM2_DTSEC 8#define CONFIG_SYS_NUM_FM2_10GEC 2#define CONFIG_NUM_DDR_CONTROLLERS 3 -#define CONFIG_SYS_FSL_DDR_VER FSL_DDR_VER_4_7 -#define CONFIG_SYS_FSL_IFC_BANK_COUNT 8 -#define CONFIG_SYS_FMAN_V3 -#define CONFIG_SYS_FM_MURAM_SIZE 0x60000 -#define CONFIG_SYS_FSL_TBCLK_DIV 16 -#define CONFIG_SYS_FSL_PCIE_COMPAT "fsl,qoriq-pcie-v3.0" -#define CONFIG_SYS_FSL_SRIO_MAX_PORTS 2 -#define CONFIG_SYS_FSL_SRIO_OB_WIN_NUM 9 -#define CONFIG_SYS_FSL_SRIO_IB_WIN_NUM 5 -#define CONFIG_SYS_FSL_USB_DUAL_PHY_ENABLE -#define CONFIG_SYS_FSL_USB_INTERNAL_UTMI_PHY -#define CONFIG_SYS_FSL_ERRATUM_A004468 -#define CONFIG_SYS_FSL_ERRATUM_A_004934 -#define CONFIG_SYS_FSL_ERRATUM_A005871 -#define CONFIG_SYS_CCSRBAR_DEFAULT 0xfe000000 -#define CONFIG_SYS_FSL_PCI_VER_3_X - -#elif defined(CONFIG_PPC_T4160 ) -#define CONFIG_SYS_PPC64 /* 64-bit core */ -#define CONFIG_FSL_CORENET /* Freescale CoreNet platform */ -#define CONFIG_SYS_FSL_QORIQ_CHASSIS2 /* Freescale Chassis generation 2 */ -#define CONFIG_SYS_FSL_QMAN_V3 /* QMAN version 3 */ +#else #define CONFIG_MAX_CPUS 8 +#define CONFIG_SYS_NUM_FM1_DTSEC 7 +#define CONFIG_SYS_NUM_FM1_10GEC 1 +#define CONFIG_SYS_NUM_FM2_DTSEC 7 +#define CONFIG_SYS_NUM_FM2_10GEC 1 +#define CONFIG_NUM_DDR_CONTROLLERS 2 +#endif #define CONFIG_SYS_FSL_NUM_CC_PLLS 5#define CONFIG_SYS_FSL_NUM_LAWS 32#define CONFIG_SYS_FSL_SRDS_3 #define CONFIG_SYS_FSL_SRDS_4 #define CONFIG_SYS_FSL_SEC_COMPAT 4#define CONFIG_SYS_NUM_FMAN 2 -#define CONFIG_SYS_NUM_FM1_DTSEC 7 -#define CONFIG_SYS_NUM_FM1_10GEC 1 -#define CONFIG_SYS_NUM_FM2_DTSEC 7 -#define CONFIG_SYS_NUM_FM2_10GEC 1 -#define CONFIG_NUM_DDR_CONTROLLERS 2#define CONFIG_SYS_FSL_DDR_VER FSL_DDR_VER_4_7#define CONFIG_SYS_FSL_IFC_BANK_COUNT 8#define CONFIG_SYS_FMAN_V3
include/configs/t4qds.h +0 -1
@@ -37,7 +37,6 @@/* High Level Configuration Options */ #define CONFIG_BOOKE -#define CONFIG_E6500 #define CONFIG_E500 /* BOOKE e500 family */ #define CONFIG_E500MC /* BOOKE e500mc family */ #define CONFIG_SYS_BOOK3E_HV /* Category E.HV supported */
Signature · 1 line
1.7.9.5
PATCH v2 10/29 powerpc/mpc8xxx: Add T1040 and variant SoCs
In reply to York SunT1040 and variants have e5500 cores and are compliant to QorIQ Chassis Generation 2. The major difference between T1040 and its variants is the number of cores and the number of L2 switch ports.
---
arch/powerpc/cpu/mpc85xx/Makefile | 3 +
.../cpu/mpc85xx/{b4860_ids.c => t1040_ids.c} | 14 +--
arch/powerpc/cpu/mpc85xx/t1040_serdes.c | 93 ++++++++++++++++++++
arch/powerpc/cpu/mpc8xxx/cpu.c | 6 ++
arch/powerpc/include/asm/config_mpc85xx.h | 26 ++++++
arch/powerpc/include/asm/fsl_serdes.h | 8 ++
arch/powerpc/include/asm/immap_85xx.h | 5 ++
arch/powerpc/include/asm/processor.h | 6 ++
8 files changed, 148 insertions(+), 13 deletions(-)
copy arch/powerpc/cpu/mpc85xx/{b4860_ids.c => t1040_ids.c} (90%)
create mode 100644 arch/powerpc/cpu/mpc85xx/t1040_serdes.carch/powerpc/cpu/mpc85xx/Makefile +3 -0
@@ -88,6 +88,7 @@ COBJS-$(CONFIG_PPC_B4420) += ddr-gen3.o COBJS-$(CONFIG_PPC_B4860) += ddr-gen3.o COBJS-$(CONFIG_BSC9131) += ddr-gen3.o COBJS-$(CONFIG_BSC9132) += ddr-gen3.o +COBJS-$(CONFIG_PPC_T1040) += ddr-gen3.o COBJS-$(CONFIG_CPM2) += ether_fcc.o COBJS-$(CONFIG_OF_LIBFDT) += fdt.o
@@ -106,6 +107,7 @@ COBJS-$(CONFIG_PPC_T4240) += t4240_ids.o COBJS-$(CONFIG_PPC_T4160) += t4240_ids.o COBJS-$(CONFIG_PPC_B4420) += b4860_ids.o COBJS-$(CONFIG_PPC_B4860) += b4860_ids.o +COBJS-$(CONFIG_PPC_T1040) += t1040_ids.o COBJS-$(CONFIG_QE) += qe_io.o COBJS-$(CONFIG_CPM2) += serial_scc.o
@@ -143,6 +145,7 @@ COBJS-$(CONFIG_PPC_T4160) += t4240_serdes.o COBJS-$(CONFIG_PPC_B4420) += b4860_serdes.o COBJS-$(CONFIG_PPC_B4860) += b4860_serdes.o COBJS-$(CONFIG_BSC9132) += bsc9132_serdes.o +COBJS-$(CONFIG_PPC_T1040) += t1040_serdes.o COBJS-y += cpu.o COBJS-y += cpu_init.o
arch/powerpc/cpu/mpc85xx/t1040_ids.c renamed from arch/powerpc/cpu/mpc85xx/b4860_ids.c +1 -13
@@ -55,13 +55,11 @@ struct qportal_info qp_info[CONFIG_SYS_QMAN_NUM_PORTALS] = { };#endif -#ifdef CONFIG_SYS_SRIO struct srio_liodn_id_table srio_liodn_tbl[] = {SET_SRIO_LIODN_1 (1 ,307 ),SET_SRIO_LIODN_1 (2 ,387 ), };int srio_liodn_tbl_sz =ARRAY_SIZE (srio_liodn_tbl); -#endif struct liodn_id_table liodn_tbl[] = {#ifdef CONFIG_SYS_DPAA_QBMAN
@@ -73,17 +71,15 @@ struct liodn_id_table liodn_tbl[] = {SET_USB_LIODN (1 ,"fsl-usb2-mph" ,553 ), -SET_PCI_LIODN (CONFIG_SYS_FSL_PCIE_COMPAT ,1 ,148 ), +SET_PCI_LIODN ("fsl,qoriq-pcie-v2.2" ,1 ,148 ),SET_DMA_LIODN (1 ,147 ),SET_DMA_LIODN (2 ,227 ), -#ifndef CONFIG_PPC_B4420SET_GUTS_LIODN ("fsl,rapidio-delta" ,199 , rio1liodnr,0 ),SET_GUTS_LIODN (NULL ,200 , rio2liodnr,0 ),SET_GUTS_LIODN (NULL ,201 , rio1maintliodnr,0 ), SET_GUTS_LIODN(NULL, 202, rio2maintliodnr, 0), -#endif /* SET_NEXUS_LIODN(557), -- not yet implemented */ };
@@ -97,10 +93,8 @@ struct liodn_id_table fman1_liodn_tbl[] = {SET_FMAN_RX_1G_LIODN (1 ,3 ,91 ),SET_FMAN_RX_1G_LIODN (1 ,4 ,92 ),SET_FMAN_RX_1G_LIODN (1 ,5 ,93 ), -#ifndef CONFIG_PPC_B4420SET_FMAN_RX_10G_LIODN (1 ,0 ,94 ), SET_FMAN_RX_10G_LIODN(1, 1, 95), -#endif };int fman1_liodn_tbl_sz =ARRAY_SIZE (fman1_liodn_tbl);#endif
@@ -116,12 +110,6 @@ struct liodn_id_table sec_liodn_tbl[] = {SET_SEC_RTIC_LIODN_ENTRY (d,551 ),SET_SEC_DECO_LIODN_ENTRY (0 ,541 ,610 ), SET_SEC_DECO_LIODN_ENTRY(1, 542, 611), -SET_SEC_DECO_LIODN_ENTRY (2 ,543 ,612 ), -SET_SEC_DECO_LIODN_ENTRY (3 ,544 ,613 ), -SET_SEC_DECO_LIODN_ENTRY (4 ,545 ,614 ), -SET_SEC_DECO_LIODN_ENTRY (5 ,546 ,615 ), -SET_SEC_DECO_LIODN_ENTRY (6 ,547 ,616 ), - SET_SEC_DECO_LIODN_ENTRY(7, 548, 617), };int sec_liodn_tbl_sz =ARRAY_SIZE (sec_liodn_tbl);
arch/powerpc/cpu/mpc85xx/t1040_serdes.c new file +93 -0
93 lines not on this page · raw message
arch/powerpc/cpu/mpc8xxx/cpu.c +6 -0
@@ -85,6 +85,12 @@ static struct cpu_type cpu_type_list[] = {CPU_TYPE_ENTRY (G4440 ,G4440 ,0 ),CPU_TYPE_ENTRY (B4420 ,B4420 ,0 ),CPU_TYPE_ENTRY (B4220 ,B4220 ,0 ), +CPU_TYPE_ENTRY (T1040 ,T1040 ,0 ), +CPU_TYPE_ENTRY (T1041 ,T1041 ,0 ), +CPU_TYPE_ENTRY (T1042 ,T1042 ,0 ), +CPU_TYPE_ENTRY (T1020 ,T1020 ,0 ), +CPU_TYPE_ENTRY (T1021 ,T1021 ,0 ), +CPU_TYPE_ENTRY (T1022 ,T1022 ,0 ),CPU_TYPE_ENTRY (BSC9130 ,9130 ,1 ),CPU_TYPE_ENTRY (BSC9131 ,9131 ,1 ), CPU_TYPE_ENTRY(BSC9132, 9132, 2),
arch/powerpc/include/asm/config_mpc85xx.h +26 -0
@@ -606,6 +606,32 @@#define CONFIG_SYS_FSL_ERRATUM_A_004934 #define CONFIG_SYS_CCSRBAR_DEFAULT 0xfe000000 +#elif defined(CONFIG_PPC_T1040 ) +#define CONFIG_E5500 +#define CONFIG_FSL_CORENET /* Freescale CoreNet platform */ +#define CONFIG_SYS_FSL_QORIQ_CHASSIS2 /* Freescale Chassis generation 2 */ +#define CONFIG_SYS_FSL_QMAN_V3 /* QMAN version 3 */ +#define CONFIG_MAX_CPUS 4 +#define CONFIG_SYS_FSL_NUM_CC_PLLS 5 +#define CONFIG_SYS_FSL_NUM_LAWS 16 +#define CONFIG_SYS_FSL_SEC_COMPAT 4 +#define CONFIG_SYS_NUM_FMAN 1 +#define CONFIG_SYS_NUM_FM1_DTSEC 5 +#define CONFIG_NUM_DDR_CONTROLLERS 1 +#define CONFIG_SYS_FSL_DDR_VER FSL_DDR_VER_4_7 +#define CONFIG_SYS_FSL_IFC_BANK_COUNT 4 +#define CONFIG_SYS_FMAN_V3 +#define CONFIG_SYS_FM_MURAM_SIZE 0x28000 +#define CONFIG_SYS_FSL_TBCLK_DIV 32 +#define CONFIG_SYS_FSL_PCIE_COMPAT "fsl,qoriq-pcie-v2.4" +#define CONFIG_SYS_FSL_SRIO_MAX_PORTS 2 +#define CONFIG_SYS_FSL_SRIO_OB_WIN_NUM 9 +#define CONFIG_SYS_FSL_SRIO_IB_WIN_NUM 5 +#define CONFIG_SYS_FSL_USB1_PHY_ENABLE +#define CONFIG_SYS_FSL_USB2_PHY_ENABLE +#define CONFIG_SYS_FSL_USB_INTERNAL_UTMI_PHY +#define CONFIG_SYS_CCSRBAR_DEFAULT 0xfe000000 +#else #error Processor type not defined for this platform#endif
arch/powerpc/include/asm/fsl_serdes.h +8 -0
@@ -80,6 +80,14 @@ enum srds_prtcl {XFI_FM2_MAC9 ,XFI_FM2_MAC10 ,INTERLAKEN , +SGMII_SW1_DTSEC1 ,/* SW indicates on L2 switch */ +SGMII_SW1_DTSEC2 , +SGMII_SW1_DTSEC3 , +SGMII_SW1_DTSEC4 , +SGMII_SW1_DTSEC5 , +SGMII_SW1_DTSEC6 , +QSGMII_SW1_A ,/* SW indicates on L2 swtich */ + QSGMII_SW1_B, }; enum srds {
arch/powerpc/include/asm/immap_85xx.h +5 -0
@@ -1844,6 +1844,11 @@ typedef struct ccsr_gur {#define FSL_CORENET2_RCWSR4_SRDS1_PRTCL_SHIFT 25#define FSL_CORENET2_RCWSR4_SRDS2_PRTCL 0x00ff0000#define FSL_CORENET2_RCWSR4_SRDS2_PRTCL_SHIFT 16 +#elif defined(CONFIG_PPC_T1040 ) +#define FSL_CORENET2_RCWSR4_SRDS1_PRTCL 0xff000000 +#define FSL_CORENET2_RCWSR4_SRDS1_PRTCL_SHIFT 24 +#define FSL_CORENET2_RCWSR4_SRDS2_PRTCL 0x00fe0000 +#define FSL_CORENET2_RCWSR4_SRDS2_PRTCL_SHIFT 17#endif #define FSL_CORENET2_RCWSR5_SRDS_PLL_PD_S1_PLL1 0x00800000#define FSL_CORENET2_RCWSR5_SRDS_PLL_PD_S1_PLL2 0x00400000
arch/powerpc/include/asm/processor.h +6 -0
@@ -1126,6 +1126,12 @@#define SVR_G4440 0x868101#define SVR_B4420 0x868102#define SVR_B4220 0x868103 +#define SVR_T1040 0x852000 +#define SVR_T1041 0x852001 +#define SVR_T1042 0x852002 +#define SVR_T1020 0x852100 +#define SVR_T1021 0x852101 +#define SVR_T1022 0x852102#define SVR_8610 0x80A000#define SVR_8641 0x809000
Signature · 1 line
1.7.9.5
PATCH v2 11/29 powerpc/chassis2: Change core numbering scheme
In reply to York SunTo align with chassis generation 2 spec, all cores are numbered in sequence. The cores may reside across multiple clusters. Each cluster has zero to four cores. The first available core is numbered as core 0. The second available core is numbered as core 1 and so on.
Core clocks are generated by each clusters. To identify the cluster of each core, topology registers are examined.
Cluster clock registers are reorganized to be easily indexed.
--- arch/powerpc/cpu/mpc85xx/release.S | 41 +++++++++++----------- arch/powerpc/cpu/mpc85xx/speed.c | 20 +++++------ arch/powerpc/cpu/mpc8xxx/cpu.c | 53 ++++++++++++++++++++++++----- arch/powerpc/include/asm/config_mpc85xx.h | 10 ++++++ arch/powerpc/include/asm/immap_85xx.h | 24 +++++-------- arch/powerpc/include/asm/processor.h | 2 ++ 6 files changed, 92 insertions(+), 58 deletions(-)
arch/powerpc/cpu/mpc85xx/release.S +19 -22
@@ -154,16 +154,12 @@ __secondary_start_page: ori r3,r3,toreset(__spin_table_addr)@l lwz r3,0(r3) - /* - * r10 has the base address for the entry. - * we cannot access it yet before setting up a new TLB - */ mfspr r0,SPRN_PIR #ifdef CONFIG_SYS_FSL_QORIQ_CHASSIS2 /* * PIR definition for Chassis 2 * 0-17 Reserved (logic 0s) - * 8-19 CHIP_ID, 2'b00 - SoC 1 + * 18-19 CHIP_ID, 2'b00 - SoC 1 * all others - reserved * 20-24 CLUSTER_ID 5'b00000 - CCM 1 * all others - reserved
@@ -177,32 +173,33 @@ __secondary_start_page: * 2'b11 - core 3 * 29-31 THREAD_ID 3'b000 - thread 0 * 3'b001 - thread 1 + * + * Power-on PIR increments threads by 0x01, cores within a cluster by 0x08 + * and clusters by 0x20. + * + * We renumber PIR so that all threads in the system are consecutive. */ - rlwinm r4,r0,29,25,31 + + rlwinm r8,r0,29,0x03 /* r8 = core within cluster */ + srwi r10,r0,5 /* r10 = cluster */ + + mulli r5,r10,CONFIG_SYS_FSL_CORES_PER_CLUSTER + add r5,r5,r8 /* for spin table index */ + mulli r4,r5,CONFIG_SYS_FSL_THREADS_PER_CORE /* for PIR */ #elif defined(CONFIG_E500MC) rlwinm r4,r0,27,27,31 + mr r5,r4 #else mr r4,r0 + mr r5,r4 #endif - slwi r8,r4,6 /* spin table is padded to 64 byte */ - add r10,r3,r8 -#ifdef CONFIG_SYS_FSL_QORIQ_CHASSIS2 - mfspr r0,SPRN_PIR /* - * core 0 thread 0: pir reset value 0x00, new pir 0 - * core 0 thread 1: pir reset value 0x01, new pir 1 - * core 1 thread 0: pir reset value 0x08, new pir 2 - * core 1 thread 1: pir reset value 0x09, new pir 3 - * core 2 thread 0: pir reset value 0x10, new pir 4 - * core 2 thread 1: pir reset value 0x11, new pir 5 - * etc. - * - * Only thread 0 of each core will be running, updating PIR doesn't - * need to deal with the thread bits. + * r10 has the base address for the entry. + * we cannot access it yet before setting up a new TLB */ - rlwinm r4,r0,30,24,30 -#endif + slwi r8,r5,6 /* spin table is padded to 64 byte */ + add r10,r3,r8 mtspr SPRN_PIR,r4 /* write to PIR register */
arch/powerpc/cpu/mpc85xx/speed.c +9 -11
@@ -112,23 +112,20 @@ void get_sys_info (sys_info_t * sysInfo)#ifdef CONFIG_SYS_FSL_QORIQ_CHASSIS2 /* * Each cluster has up to 4 cores, sharing the same PLL selection. -* The cluster assignment is fixed per SoC. There is no way identify the -* assignment so far, presuming the "first configuration" which is to -* fill the lower cluster group first before moving up to next group. -* PLL1, PLL2, PLL3 are cluster group A, feeding core 0~3 on cluster 1 -* and core 4~7 on cluster 2 -* PLL4, PLL5, PLL6 are cluster group B, feeding core 8~11 on cluster 3 -* and core 12~15 on cluster 4 if existing +* The cluster assignment is fixed per SoC. PLL1, PLL2, PLL3 are +* cluster group A, feeding cores on cluster 1 and cluster 2. +* PLL4, PLL5, PLL6 are cluster group B, feeding cores on cluster 3 +* and cluster 4 if existing. */ for_each_cpu (i, cpu,cpu_numcores (),cpu_mask ()) { -u32 c_pll_sel = (in_be32 (&clk->clkc0csr + (cpu /4 ) *8 ) >>27 ) +int cluster =fsl_qoriq_core_to_cluster (cpu); +u32 c_pll_sel = (in_be32 (&clk->clkcsr[cluster].clkcncsr) >>27 ) &0xf ;u32 cplx_pll = core_cplx_PLL[c_pll_sel];if (cplx_pll >3 )printf ("Unsupported architecture configuration" " in function %s\n" , __func__); - cplx_pll += (cpu /8 ) *3 ; - + cplx_pll += (cluster /2 ) *3 ; sysInfo->freqProcessor[cpu] = freqCC_PLL[cplx_pll] / core_cplx_PLL_div[c_pll_sel]; }
@@ -240,7 +237,8 @@ void get_sys_info (sys_info_t * sysInfo)#else /* CONFIG_SYS_FSL_QORIQ_CHASSIS2 */ for_each_cpu (i, cpu,cpu_numcores (),cpu_mask ()) { -u32 c_pll_sel = (in_be32 (&clk->clkc0csr + cpu*8 ) >>27 ) &0xf ; +u32 c_pll_sel = (in_be32 (&clk->clkcsr[cpu].clkcncsr) >>27 ) + &0xf ;u32 cplx_pll = core_cplx_PLL[c_pll_sel]; sysInfo->freqProcessor[cpu] =
arch/powerpc/cpu/mpc8xxx/cpu.c +44 -9
79 lines not on this page · raw message
arch/powerpc/include/asm/config_mpc85xx.h +10 -0
@@ -519,6 +519,7 @@#define CONFIG_SYS_PPC64 /* 64-bit core */ #define CONFIG_FSL_CORENET /* Freescale CoreNet platform */ #define CONFIG_SYS_FSL_QORIQ_CHASSIS2 /* Freescale Chassis generation 2 */ +#define CONFIG_SYS_FSL_CORES_PER_CLUSTER 4#define CONFIG_SYS_FSL_QMAN_V3 /* QMAN version 3 */ #ifdef CONFIG_PPC_T4240 #define CONFIG_MAX_CPUS 12
@@ -562,6 +563,7 @@#define CONFIG_SYS_PPC64 /* 64-bit core */ #define CONFIG_FSL_CORENET /* Freescale CoreNet platform */ #define CONFIG_SYS_FSL_QORIQ_CHASSIS2 /* Freescale Chassis generation 2 */ +#define CONFIG_SYS_FSL_CORES_PER_CLUSTER 4#define CONFIG_SYS_FSL_QMAN_V3 /* QMAN version 3 */ #define CONFIG_MAX_CPUS 2#define CONFIG_SYS_FSL_NUM_CC_PLLS 4
@@ -584,6 +586,7 @@#define CONFIG_SYS_PPC64 /* 64-bit core */ #define CONFIG_FSL_CORENET /* Freescale CoreNet platform */ #define CONFIG_SYS_FSL_QORIQ_CHASSIS2 /* Freescale Chassis generation 2 */ +#define CONFIG_SYS_FSL_CORES_PER_CLUSTER 4#define CONFIG_SYS_FSL_QMAN_V3 /* QMAN version 3 */ #define CONFIG_MAX_CPUS 4#define CONFIG_SYS_FSL_NUM_CC_PLLS 4
@@ -610,6 +613,7 @@#define CONFIG_E5500 #define CONFIG_FSL_CORENET /* Freescale CoreNet platform */ #define CONFIG_SYS_FSL_QORIQ_CHASSIS2 /* Freescale Chassis generation 2 */ +#define CONFIG_SYS_FSL_CORES_PER_CLUSTER 1#define CONFIG_SYS_FSL_QMAN_V3 /* QMAN version 3 */ #define CONFIG_MAX_CPUS 4#define CONFIG_SYS_FSL_NUM_CC_PLLS 5
@@ -640,4 +644,10 @@#error "CONFIG_SYS_CCSRBAR_DEFAULT is not defined for this platform."#endif +#ifdef CONFIG_E6500 +#define CONFIG_SYS_FSL_THREADS_PER_CORE 2 +#else +#define CONFIG_SYS_FSL_THREADS_PER_CORE 1 +#endif +#endif /* _ASM_MPC85xx_CONFIG_H_ */
arch/powerpc/include/asm/immap_85xx.h +8 -16
@@ -1996,6 +1996,7 @@ typedef struct ccsr_gur {#define TP_CLUSTER_EOC 0x80000000/* end of clusters */ #define TP_CLUSTER_INIT_MASK 0x0000003f/* initiator mask */ +#define TP_INIT_PER_CLUSTER 4#define FSL_CORENET_DCSR_SZ_MASK 0x00000003#define FSL_CORENET_DCSR_SZ_4M 0x0
@@ -2008,22 +2009,13 @@ typedef struct ccsr_gur {#define rmuliodnr rio1maintliodnr typedef struct ccsr_clk { - u32 clkc0csr; /* 0x000 Core 0 Clock control/status */ - u8 res1[0x1c]; - u32 clkc1csr; /* 0x020 Core 1 Clock control/status */ - u8 res2[0x1c]; - u32 clkc2csr; /* 0x040 Core 2 Clock control/status */ - u8 res3[0x1c]; - u32 clkc3csr; /* 0x060 Core 3 Clock control/status */ - u8 res4[0x1c]; - u32 clkc4csr; /* 0x080 Core 4 Clock control/status */ - u8 res5[0x1c]; - u32 clkc5csr; /* 0x0a0 Core 5 Clock control/status */ - u8 res6[0x1c]; - u32 clkc6csr; /* 0x0c0 Core 6 Clock control/status */ - u8 res7[0x1c]; - u32 clkc7csr; /* 0x0e0 Core 7 Clock control/status */ - u8 res8[0x71c]; + struct { + u32 clkcncsr; /* core cluster n clock control status */ + u8 res_004[0x0c]; + u32 clkcgnhwacsr;/* clock generator n hardware accelerator */ + u8 res_014[0x0c]; + } clkcsr[8]; + u8 res_100[0x700]; /* 0x100 */ u32 pllc1gsr; /* 0x800 Cluster PLL 1 General Status */ u8 res10[0x1c]; u32 pllc2gsr; /* 0x820 Cluster PLL 2 General Status */
arch/powerpc/include/asm/processor.h +2 -0
@@ -1200,6 +1200,8 @@ struct cpu_type {struct cpu_type *identify_cpu (u32 ver);int fixup_cpu (void ); +int fsl_qoriq_core_to_cluster (unsigned int core); +#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)#define CPU_TYPE_ENTRY (n, v, nc) \ { .name = #n, .soc_ver = SVR_##v, .num_cores = (nc), \
Signature · 1 line
1.7.9.5
PATCH v2 12/29 powerpc/mpc8xxx: Allow DDR overclock
In reply to York SunAllow DDR clock runs faster than SPD specifes. This may cause memory failure, but the user should know what is going to happen when using higher than expected DDR clock.
--- .../cpu/mpc8xxx/ddr/lc_common_dimm_params.c | 2 -- 1 file changed, 2 deletions(-)
arch/powerpc/cpu/mpc8xxx/ddr/lc_common_dimm_params.c +0 -2
@@ -44,7 +44,6 @@ compute_cas_latency_ddr3(const dimm_params_t *dimm_params,printf ("DDR clock (MCLK cycle %u ps) is faster than " "the slowest DIMM(s) (tCKmin %u ps) can support.\n" , mclk_ps, tCKmin_X_ps); -return 1 ; }/* determine the acutal cas latency */ caslat_actual = (tAAmin_ps + mclk_ps -1 ) / mclk_ps;
@@ -60,7 +59,6 @@ compute_cas_latency_ddr3(const dimm_params_t *dimm_params,if (caslat_actual * mclk_ps >20000 ) {printf ("The choosen cas latency %d is too large\n" , caslat_actual); -return 1 ; } outpdimm->lowest_common_SPD_caslat = caslat_actual;
Signature · 1 line
1.7.9.5
PATCH v2 13/29 powerpc/qixis: add clock measurement registers
In reply to York SunFrom: Ed Swarthout <[email protected]>
QIXIS includes frequency measurement functions for each major processor clock input. After reset (and after clocks are stable), QIXIS measures the clocks against a reference frequency and stores the results in CLK_FREQ registers. A base register supplies a multiplier which allows directly obtaining the measured value, without requiring knowledge of the target system or QIXIS core frequency.
--- board/freescale/common/qixis.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
board/freescale/common/qixis.h +5 -1
@@ -78,7 +78,11 @@ struct qixis {u8 trig_stat;u8 res12[3 ];u8 trig_ctr[4 ]; -u8 res13[48 ]; +u8 res13[16 ]; +u8 clk_freq[6 ];/* Clock Measurement Registers */ +u8 res_c6[8 ]; +u8 clk_base[2 ];/* Clock Frequency Base Reg */ +u8 res_d0[16 ];u8 aux2[4 ];/* Auxiliary Registers,0xE0 */ u8 res14[10 ];u8 aux_ad;
Signature · 1 line
1.7.9.5
PATCH v2 14/29 powerpc/t4qds: use clock measurement for sysclk and ddr clock
In reply to York SunFrom: Ed Swarthout <[email protected]>
Use QIXIS measurement registers to obtain sysclk and ddr clock. This allows using non-standard clock speeds, set by directly writing to clock chip or store the values in qixis clock data eeprom.
--- board/freescale/t4qds/t4qds.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
board/freescale/t4qds/t4qds.c +28 -0
@@ -540,6 +540,20 @@ int board_early_init_r(void)unsigned long get_board_sys_clk (void ) {u8 sysclk_conf =QIXIS_READ (brdcfg[1 ]); +#ifdef CONFIG_FSL_QIXIS_CLOCK_MEASUREMENT +/* use accurate clock measurement */ +int freq =QIXIS_READ (clk_freq[0 ]) <<8 |QIXIS_READ (clk_freq[1 ]); +int base =QIXIS_READ (clk_base[0 ]) <<8 |QIXIS_READ (clk_base[1 ]); +u32 val; + + val = freq * base; +if (val) { +debug ("SYS Clock measurement is: %d\n" , val); +return val; + }else { +printf ("Warning: SYS clock measurement is invalid, using value from brdcfg1.\n" ); + } +#endif switch (sysclk_conf &0x0F ) {case QIXIS_SYSCLK_83 :
@@ -563,6 +577,20 @@ unsigned long get_board_sys_clk(void)unsigned long get_board_ddr_clk (void ) {u8 ddrclk_conf =QIXIS_READ (brdcfg[1 ]); +#ifdef CONFIG_FSL_QIXIS_CLOCK_MEASUREMENT +/* use accurate clock measurement */ +int freq =QIXIS_READ (clk_freq[2 ]) <<8 |QIXIS_READ (clk_freq[3 ]); +int base =QIXIS_READ (clk_base[0 ]) <<8 |QIXIS_READ (clk_base[1 ]); +u32 val; + + val = freq * base; +if (val) { +debug ("DDR Clock measurement is: %d\n" , val); +return val; + }else { +printf ("Warning: DDR clock measurement is invalid, using value from brdcfg1.\n" ); + } +#endif switch ((ddrclk_conf &0x30 ) >>4 ) {case QIXIS_DDRCLK_100 :
Signature · 1 line
1.7.9.5
PATCH v2 15/29 powerpc/p5040: enable PBL tool support
In reply to York SunFrom: Shaohui Xie <[email protected]>
Provided a default RCW for P5040, then it can use PBL to build ramboot image.
--- board/freescale/corenet_ds/rcw_p5040ds.cfg | 11 +++++++++++ include/configs/corenet_ds.h | 2 ++ 2 files changed, 13 insertions(+) create mode 100644 board/freescale/corenet_ds/rcw_p5040ds.cfg
board/freescale/corenet_ds/rcw_p5040ds.cfg new file +11 -0
@@ -0,0 +1,11 @@ +# +# Default RCW for P5040DS. +# + +#PBL preamble and RCW header +aa55aa55 010e0100 +#64 bytes RCW data +0c580000 00000000 22121200 00000000 +089c4400 00283000 58000000 61000000 +00000000 00000000 00000000 10070000 +00000000 00000000 00000000 00000000
include/configs/corenet_ds.h +2 -0
@@ -38,6 +38,8 @@#define CONFIG_PBLRCW_CONFIG $(SRCTREE)/board/freescale/corenet_ds/rcw_p4080ds.cfg#elif defined(CONFIG_P5020DS )#define CONFIG_PBLRCW_CONFIG $(SRCTREE)/board/freescale/corenet_ds/rcw_p5020ds.cfg +#elif defined(CONFIG_P5040DS ) +#define CONFIG_PBLRCW_CONFIG $(SRCTREE)/board/freescale/corenet_ds/rcw_p5040ds.cfg#endif #endif
Signature · 1 line
1.7.9.5
PATCH v2 16/29 board/t4240qds, b4860qds: LAW/TLB for DCSR set to size 32M
In reply to York SunFrom: Stephen George <[email protected]>
Debug trace buffers are memory mapped in DCSR space beyond 4M.
--- board/freescale/b4860qds/law.c | 3 ++- board/freescale/b4860qds/tlb.c | 2 +- board/freescale/t4qds/law.c | 3 ++- board/freescale/t4qds/tlb.c | 2 +- doc/README.b4860qds | 4 ++-- doc/README.t4240qds | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-)
board/freescale/b4860qds/law.c +2 -1
@@ -34,7 +34,8 @@ struct law_entry law_table[] = {#endif SET_LAW(QIXIS_BASE_PHYS, LAW_SIZE_4K, LAW_TRGT_IF_IFC),#ifdef CONFIG_SYS_DCSRBAR_PHYS - SET_LAW(CONFIG_SYS_DCSRBAR_PHYS, LAW_SIZE_4M, LAW_TRGT_IF_DCSR), +/* Limit DCSR to 32M to access NPC Trace Buffer */ + SET_LAW(CONFIG_SYS_DCSRBAR_PHYS, LAW_SIZE_32M, LAW_TRGT_IF_DCSR),#endif #ifdef CONFIG_SYS_NAND_BASE_PHYS SET_LAW(CONFIG_SYS_NAND_BASE_PHYS, LAW_SIZE_64K, LAW_TRGT_IF_IFC),
board/freescale/b4860qds/tlb.c +1 -1
@@ -106,7 +106,7 @@ struct fsl_e_tlb_entry tlb_table[] = {#ifdef CONFIG_SYS_DCSRBAR_PHYS SET_TLB_ENTRY (1 ,CONFIG_SYS_DCSRBAR ,CONFIG_SYS_DCSRBAR_PHYS ,MAS3_SX |MAS3_SW |MAS3_SR ,MAS2_I |MAS2_G , -0 ,10 ,BOOKE_PAGESZ_4M ,1 ), +0 ,10 ,BOOKE_PAGESZ_32M ,1 ), #endif #ifdef CONFIG_SYS_NAND_BASE/*
board/freescale/t4qds/law.c +2 -1
@@ -37,7 +37,8 @@ struct law_entry law_table[] = {#endif SET_LAW(QIXIS_BASE_PHYS, LAW_SIZE_4K, LAW_TRGT_IF_IFC),#ifdef CONFIG_SYS_DCSRBAR_PHYS - SET_LAW(CONFIG_SYS_DCSRBAR_PHYS, LAW_SIZE_4M, LAW_TRGT_IF_DCSR), +/* Limit DCSR to 32M to access NPC Trace Buffer */ + SET_LAW(CONFIG_SYS_DCSRBAR_PHYS, LAW_SIZE_32M, LAW_TRGT_IF_DCSR),#endif #ifdef CONFIG_SYS_NAND_BASE_PHYS SET_LAW(CONFIG_SYS_NAND_BASE_PHYS, LAW_SIZE_64K, LAW_TRGT_IF_IFC),
board/freescale/t4qds/tlb.c +1 -1
@@ -115,7 +115,7 @@ struct fsl_e_tlb_entry tlb_table[] = {#ifdef CONFIG_SYS_DCSRBAR_PHYS SET_TLB_ENTRY (1 ,CONFIG_SYS_DCSRBAR ,CONFIG_SYS_DCSRBAR_PHYS ,MAS3_SX |MAS3_SW |MAS3_SR ,MAS2_I |MAS2_G , -0 ,13 ,BOOKE_PAGESZ_4M ,1 ), +0 ,13 ,BOOKE_PAGESZ_32M ,1 ), #endif #ifdef CONFIG_SYS_NAND_BASE/*
doc/README.b4860qds +2 -2
@@ -185,7 +185,7 @@ Start Address End Address Description Size 0xF_A0C0_0000 0xF_DFFF_FFFF Free 1012 MB 0xF_A000_0000 0xF_A0BF_FFFF MAPLE0/1/2 12 MB 0xF_0040_0000 0xF_9FFF_FFFF Free 12 GB -0xF_0000_0000 0xF_003F_FFFF DCSR 4 MB +0xF_0000_0000 0xF_01FF_FFFF DCSR 32 MB 0xC_4000_0000 0xE_FFFF_FFFF Free 11 GB 0xC_3000_0000 0xC_3FFF_FFFF sRIO-2 I/O 256 MB 0xC_2000_0000 0xC_2FFF_FFFF sRIO-1 I/O 256 MB
@@ -215,7 +215,7 @@ Start Address End Address Description Size 0xF_A0C0_0000 0xF_DFFF_FFFF Free 1012 MB 0xF_A000_0000 0xF_A0BF_FFFF MAPLE0/1/2 12 MB 0xF_0040_0000 0xF_9FFF_FFFF Free 12 GB -0xF_0000_0000 0xF_003F_FFFF DCSR 4 MB +0xF_0000_0000 0xF_01FF_FFFF DCSR 32 MB 0xC_4000_0000 0xE_FFFF_FFFF Free 11 GB 0xC_3000_0000 0xC_3FFF_FFFF sRIO-2 I/O 256 MB 0xC_2000_0000 0xC_2FFF_FFFF sRIO-1 I/O 256 MB
doc/README.t4240qds +1 -1
@@ -86,7 +86,7 @@ The addresses in brackets are physical addresses. 0x0_0000_0000 (0x0_0000_0000) - 0x0_7fff_ffff 2GB DDR (more than 2GB is initialized but not mapped under with TLB) 0x0_8000_0000 (0xc_0000_0000) - 0x0_dfff_ffff 1.5GB PCIE memory -0x0_f000_0000 (0xf_0000_0000) - 0x0_f03f_ffff 4MB DCSR +0x0_f000_0000 (0xf_0000_0000) - 0x0_f1ff_ffff 32MB DCSR (includes trace buffers) 0x0_f400_0000 (0xf_f400_0000) - 0x0_f5ff_ffff 32MB BMan 0x0_f600_0000 (0xf_f600_0000) - 0x0_f7ff_ffff 32MB QMan 0x0_f800_0000 (0xf_f800_0000) - 0x0_f803_ffff 256KB PCIE IO
Signature · 1 line
1.7.9.5
PATCH v2 17/29 Enable XAUI interface for B4860QDS
In reply to York SunFrom: Suresh Gupta <[email protected]>
- Added SERDES2 PRTCLs = 0x98, 0x9E
- Default Phy Addresses for Teranetics PHY on XAUI card
The PHY addresses of Teranetics PHY on XAUI riser card are assigned based on the slot it is in. Switches SW4[2:4] and SW6[2:4] on AMC2PEX-2S On B4860QDS, AMC2PEX card decide the PHY addresses on slot1 and slot2
- Configure MDIO for 10Gig Mac
--- board/freescale/b4860qds/eth_b4860qds.c | 35 +++++++++++++++++++++++++++++++ drivers/net/fm/b4860.c | 6 ++++-- include/configs/B4860QDS.h | 6 +++++- 3 files changed, 44 insertions(+), 3 deletions(-)
board/freescale/b4860qds/eth_b4860qds.c +35 -0
@@ -275,6 +275,24 @@ int board_eth_init(bd_t *bis)fm_info_set_phy_address (FM1_DTSEC4 ,CONFIG_SYS_FM1_DTSEC2_RISER_PHY_ADDR );break ; +case 0x98 : +/* XAUI in Slot1 and Slot2 */ +debug ("Setting phy addresses on B4860 QDS AMC2PEX-2S for FM1_10GEC1: %x\n" , +CONFIG_SYS_FM1_10GEC1_PHY_ADDR ); +fm_info_set_phy_address (FM1_10GEC1 , +CONFIG_SYS_FM1_10GEC1_PHY_ADDR ); +debug ("Setting phy addresses on B4860 QDS AMC2PEX-2S for FM1_10GEC2: %x\n" , +CONFIG_SYS_FM1_10GEC2_PHY_ADDR ); +fm_info_set_phy_address (FM1_10GEC2 , +CONFIG_SYS_FM1_10GEC2_PHY_ADDR ); +break ; +case 0x9E : +/* XAUI in Slot2 */ +debug ("Setting phy addresses on B4860 QDS AMC2PEX-2S for FM1_10GEC2: %x\n" , +CONFIG_SYS_FM1_10GEC2_PHY_ADDR ); +fm_info_set_phy_address (FM1_10GEC2 , +CONFIG_SYS_FM1_10GEC2_PHY_ADDR ); +break ;default :printf ("Fman: Unsupported SerDes2 Protocol 0x%02x\n" , serdes2_prtcl);
@@ -300,6 +318,23 @@ int board_eth_init(bd_t *bis) } } +for (i =FM1_10GEC1 ; i <FM1_10GEC1 +CONFIG_SYS_NUM_FM1_10GEC ; i++) { +int idx = i -FM1_10GEC1 ; + +switch (fm_info_get_enet_if (i)) { +case PHY_INTERFACE_MODE_XGMII : +fm_info_set_mdio (i, +miiphy_get_dev_by_name (DEFAULT_FM_TGEC_MDIO_NAME )); +break ; +default : +printf ("Fman1: 10GSEC%u set to unknown interface %i\n" , + idx +1 ,fm_info_get_enet_if (i)); +fm_info_set_phy_address (i,0 ); +break ; + } + } + +cpu_eth_init (bis);#endif
drivers/net/fm/b4860.c +4 -2
@@ -55,8 +55,10 @@ phy_interface_t fman_port_enet_if(enum fm_port port)if (is_device_disabled (port))return PHY_INTERFACE_MODE_NONE ; -if ((port ==FM1_10GEC1 || port ==FM1_10GEC2 ) - && (is_serdes_configured (XAUI_FM1 ))) +/*B4860 has two 10Gig Mac*/ +if ((port ==FM1_10GEC1 || port ==FM1_10GEC2 ) && + ((is_serdes_configured (XAUI_FM1_MAC9 )) || + (is_serdes_configured (XAUI_FM1_MAC10 ))))return PHY_INTERFACE_MODE_XGMII ;/* Fix me need to handle RGMII here first */
include/configs/B4860QDS.h +5 -1
@@ -623,7 +623,11 @@ unsigned long get_board_ddr_clk(void);#ifdef CONFIG_FMAN_ENET #define CONFIG_SYS_FM1_DTSEC5_PHY_ADDR 0x10#define CONFIG_SYS_FM1_DTSEC6_PHY_ADDR 0x11 -#define CONFIG_SYS_FM1_10GEC1_PHY_ADDR 4 + +/*B4860 QDS AMC2PEX-2S default PHY_ADDR */ +#define CONFIG_SYS_FM1_10GEC1_PHY_ADDR 0x7/*SLOT 1*/ +#define CONFIG_SYS_FM1_10GEC2_PHY_ADDR 0x6/*SLOT 2*/ +#define CONFIG_SYS_FM1_DTSEC1_RISER_PHY_ADDR 0x1c#define CONFIG_SYS_FM1_DTSEC2_RISER_PHY_ADDR 0x1d
Signature · 1 line
1.7.9.5
PATCH v2 18/29 powerpc/t4qds: Add SW7[4] in the DIP switch display
In reply to York SunSW7[4] is the new bit which controls the mapping of eMMC vs SDHC.
--- board/freescale/t4qds/t4qds.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
board/freescale/t4qds/t4qds.c +3 -2
@@ -801,7 +801,7 @@ void qixis_dump_switch(void)* Any bit with 1 means that bit cannot be reverse engineered. * It will be displayed as _ in binary format. */ -static const u8 mask[] = {0 ,0 ,0 ,0 ,0 ,0x1 ,0xdf ,0x3f ,0x1f }; +static const u8 mask[] = {0 ,0 ,0 ,0 ,0 ,0x1 ,0xcf ,0x3f ,0x1f };char buf[10 ];u8 brdcfg[16 ], dutcfg[16 ];
@@ -832,7 +832,8 @@ void qixis_dump_switch(void) sw[5 ] = ((brdcfg[0 ] &0x0f ) <<4 ) | \ ((QIXIS_READ (rst_ctl) &0x30 ) >>2 ) | \ ((brdcfg[0 ] &0x40 ) >>5 ); - sw[6 ] = (brdcfg[11 ] &0x20 ); + sw[6 ] = (brdcfg[11 ] &0x20 ) | + ((brdcfg[5 ] &0x02 ) <<3 ); sw[7 ] = (((~QIXIS_READ (rst_ctl)) &0x40 ) <<1 ) | \ ((brdcfg[5 ] &0x10 ) <<2 ); sw[8] = ((brdcfg[12] & 0x08) << 4) | \
Signature · 1 line
1.7.9.5
PATCH v2 19/29 powerpc/t4240qds: fix PHY reset timeout issue
In reply to York SunFrom: Shengzhou Liu <[email protected]>
QSGMII card has different PHY address against previous SGMII card. We check the type of card in slots and set correct PHY address to avoid complainning "PHY reset timed out" during u-boot booting up.
--- board/freescale/t4qds/eth.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
board/freescale/t4qds/eth.c +17 -2
@@ -365,24 +365,40 @@ static void initialize_qsgmiiphy_fix(void) qsgmiiphy_fix[FM1_DTSEC6 ] =1 ; qsgmiiphy_fix[FM1_DTSEC9 ] =1 ; qsgmiiphy_fix[FM1_DTSEC10 ] =1 ; + slot_qsgmii_phyaddr[1 ][0 ] =SGMII_CARD_PORT1_PHY_ADDR ; + slot_qsgmii_phyaddr[1 ][1 ] =SGMII_CARD_PORT2_PHY_ADDR ; + slot_qsgmii_phyaddr[1 ][2 ] =SGMII_CARD_PORT3_PHY_ADDR ; + slot_qsgmii_phyaddr[1 ][3 ] =SGMII_CARD_PORT4_PHY_ADDR ;break ;case 2 : qsgmiiphy_fix[FM1_DTSEC1 ] =1 ; qsgmiiphy_fix[FM1_DTSEC2 ] =1 ; qsgmiiphy_fix[FM1_DTSEC3 ] =1 ; qsgmiiphy_fix[FM1_DTSEC4 ] =1 ; + slot_qsgmii_phyaddr[2 ][0 ] =SGMII_CARD_PORT1_PHY_ADDR ; + slot_qsgmii_phyaddr[2 ][1 ] =SGMII_CARD_PORT2_PHY_ADDR ; + slot_qsgmii_phyaddr[2 ][2 ] =SGMII_CARD_PORT3_PHY_ADDR ; + slot_qsgmii_phyaddr[2 ][3 ] =SGMII_CARD_PORT4_PHY_ADDR ;break ;case 3 : qsgmiiphy_fix[FM2_DTSEC5 ] =1 ; qsgmiiphy_fix[FM2_DTSEC6 ] =1 ; qsgmiiphy_fix[FM2_DTSEC9 ] =1 ; qsgmiiphy_fix[FM2_DTSEC10 ] =1 ; + slot_qsgmii_phyaddr[3 ][0 ] =SGMII_CARD_PORT1_PHY_ADDR ; + slot_qsgmii_phyaddr[3 ][1 ] =SGMII_CARD_PORT2_PHY_ADDR ; + slot_qsgmii_phyaddr[3 ][2 ] =SGMII_CARD_PORT3_PHY_ADDR ; + slot_qsgmii_phyaddr[3 ][3 ] =SGMII_CARD_PORT4_PHY_ADDR ;break ;case 4 : qsgmiiphy_fix[FM2_DTSEC1 ] =1 ; qsgmiiphy_fix[FM2_DTSEC2 ] =1 ; qsgmiiphy_fix[FM2_DTSEC3 ] =1 ; qsgmiiphy_fix[FM2_DTSEC4 ] =1 ; + slot_qsgmii_phyaddr[4 ][0 ] =SGMII_CARD_PORT1_PHY_ADDR ; + slot_qsgmii_phyaddr[4 ][1 ] =SGMII_CARD_PORT2_PHY_ADDR ; + slot_qsgmii_phyaddr[4 ][2 ] =SGMII_CARD_PORT3_PHY_ADDR ; + slot_qsgmii_phyaddr[4 ][3 ] =SGMII_CARD_PORT4_PHY_ADDR ;break ;default :break ;
@@ -435,6 +451,7 @@ int board_eth_init(bd_t *bis)t4240qds_mdio_init (DEFAULT_FM_MDIO_NAME ,EMI1_SLOT7 );t4240qds_mdio_init (DEFAULT_FM_TGEC_MDIO_NAME ,EMI2 ); +initialize_qsgmiiphy_fix ();switch (srds_prtcl_s1) {case 1 :
@@ -702,8 +719,6 @@ int board_eth_init(bd_t *bis) }#endif /* CONFIG_SYS_NUM_FMAN */ -initialize_qsgmiiphy_fix (); -cpu_eth_init (bis);#endif /* CONFIG_FMAN_ENET */
Signature · 1 line
1.7.9.5
PATCH v2 20/29 powerpc/doc: Fix the misalignment of document README.srio-pcie-boot-corenet
In reply to York SunFrom: Liu Gang <[email protected]>
Misalignment will be found in the doc/README.srio-pcie-boot-corenet file when the tabs are set to 8 characters. And the standard for u-boot should be 8 character tabs!
--- doc/README.srio-pcie-boot-corenet | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
doc/README.srio-pcie-boot-corenet +6 -6
@@ -21,13 +21,13 @@ Environment of the SRIO or PCIE boot: e) Slave's RCW should configure the SerDes for SRIO or PCIE boot port, set the boot location to SRIO or PCIE, and holdoff all the cores. - ---------- ----------- ----------- - | | | | | | - | | | | | | + ----------- ----------- ----------- + | | | | | | + | | | | | | | NorFlash|<----->| Master |SRIO or PCIE | Slave |<---->[EEPROM] - | | | |<===========>| | - | | | | | | - ---------- ----------- ----------- + | | | |<===========>| | + | | | | | | + ----------- ----------- ----------- The example based on P4080DS platform: Two P4080DS platforms can be used to implement the boot from SRIO or PCIE.
Signature · 1 line
1.7.9.5
PATCH v2 21/29 powerpc/b4860: fix for Serdes connectivity to SFP's
In reply to York SunFrom: Shaveta Leekha <[email protected]>
Crossbar switches were wrongly programmed to route the CPRI lanes to SFP as the connectivity table was not correct.
Modified it correctly for SFPs connections.
--- arch/powerpc/cpu/mpc85xx/fdt.c | 5 ++++ board/freescale/b4860qds/b4860qds.c | 6 +++-- board/freescale/b4860qds/b4860qds_crossbar_con.h | 31 +++++++++++++++------- 3 files changed, 30 insertions(+), 12 deletions(-)
arch/powerpc/cpu/mpc85xx/fdt.c +5 -0
@@ -665,6 +665,11 @@ void ft_cpu_setup(void *blob, bd_t *bd) "clock-frequency", CONFIG_SYS_CLK_FREQ, 1);do_fixup_by_compat_u32 (blob,"fsl,qoriq-clockgen-2" ,"clock-frequency" ,CONFIG_SYS_CLK_FREQ ,1 ); +do_fixup_by_compat_u32 (blob,"fsl,mpic" , +"clock-frequency" ,get_bus_freq (0 )/2 ,1 ); +#else +do_fixup_by_compat_u32 (blob,"fsl,mpic" , +"clock-frequency" ,get_bus_freq (0 ),1 );#endif fdt_fixup_memory (blob, (u64 )bd->bi_memstart, (u64 )bd->bi_memsize);
board/freescale/b4860qds/b4860qds.c +4 -2
@@ -166,11 +166,13 @@ int configure_vsc3316_3308(void) ret =select_i2c_ch_pca (I2C_CH_VSC3316 );if (!ret) { ret =vsc3316_config (VSC3316_TX_ADDRESS , - vsc16_tx_sgmii_lane_ab, num_vsc16_con); + vsc16_tx_4sfp_sgmii_12_56, + num_vsc16_con);if (ret)return ret; ret =vsc3316_config (VSC3316_RX_ADDRESS , - vsc16_rx_sgmii_lane_ab, num_vsc16_con); + vsc16_rx_4sfp_sgmii_12_56, + num_vsc16_con);if (ret)return ret; }else {
board/freescale/b4860qds/b4860qds_crossbar_con.h +21 -10
@@ -26,42 +26,53 @@static const int8_t vsc16_tx_amc[8 ][2 ] = { {15 ,3 }, {0 ,2 }, {7 ,4 }, {9 ,10 }, {5 ,11 }, {4 ,5 }, {2 ,6 }, {12 ,9 } }; -static const int8_t vsc16_tx_sfp[8 ][2 ] = { {15 ,8 }, {0 ,0 }, {7 ,7 }, {9 ,1 }, - {5 ,15 }, {4 ,14 }, {2 ,12 }, {12 ,13 } }; +static const int8_t vsc16_tx_sfp[8 ][2 ] = { {15 ,7 }, {0 ,1 }, {7 ,8 }, {9 ,0 }, + {-1 ,-1 }, {-1 ,-1 }, {-1 ,-1 }, {-1 ,-1 } }; -static const int8_t vsc16_tx_sgmii_lane_ab[8 ][2 ] = { {2 ,14 }, {12 ,15 }, - {-1 ,-1 }, {-1 ,-1 }, {-1 ,-1 }, {-1 ,-1 }, {-1 ,-1 }, {-1 ,-1 } }; +static const int8_t vsc16_tx_4sfp_sgmii_12_56[8 ][2 ] = { {15 ,7 }, {0 ,1 }, + {7 ,8 }, {9 ,0 }, {2 ,14 }, {12 ,15 }, + {-1 ,-1 }, {-1 ,-1 } }; + +static const int8_t vsc16_tx_4sfp_sgmii_34[8 ][2 ] = { {15 ,7 }, {0 ,1 }, + {7 ,8 }, {9 ,0 }, {5 ,14 }, {4 ,15 }, + {-1 ,-1 }, {-1 ,-1 } };#ifdef CONFIG_PPC_B4420 static const int8_t vsc16_tx_sgmii_lane_cd[8 ][2 ] = { {5 ,14 }, {4 ,15 }, {-1 ,-1 }, {-1 ,-1 }, {-1 ,-1 }, {-1 ,-1 }, {-1 ,-1 }, {-1 ,-1 } };#endif +static const int8_t vsc16_tx_aurora[8 ][2 ] = { {2 ,13 }, {12 ,12 }, {-1 ,-1 }, {-1 ,-1 }, {-1 ,-1 }, {-1 ,-1 }, {-1 ,-1 }, {-1 ,-1 } };static const int8_t vsc16_rx_amc[8 ][2 ] = { {3 ,15 }, {2 ,1 }, {4 ,8 }, {10 ,9 }, {11 ,11 }, {5 ,10 }, {6 ,3 }, {9 ,12 } }; -static const int8_t vsc16_rx_sfp[8 ][2 ] = { {0 ,15 }, {8 ,1 }, {1 ,8 }, {7 ,9 }, +static const int8_t vsc16_rx_sfp[8 ][2 ] = { {8 ,15 }, {0 ,1 }, {7 ,8 }, {1 ,9 }, {-1 ,-1 }, {-1 ,-1 }, {-1 ,-1 }, {-1 ,-1 } }; -static const int8_t vsc16_rx_sgmii_lane_ab[8 ][2 ] = { {14 ,3 }, {15 ,12 }, - {-1 ,-1 }, {-1 ,-1 }, {-1 ,-1 }, {-1 ,-1 }, {-1 ,-1 }, {-1 ,-1 } }; +static const int8_t vsc16_rx_4sfp_sgmii_12_56[8 ][2 ] = { {8 ,15 }, {0 ,1 }, + {7 ,8 }, {1 ,9 }, {14 ,3 }, {15 ,12 }, + {-1 ,-1 }, {-1 ,-1 } }; + +static const int8_t vsc16_rx_4sfp_sgmii_34[8 ][2 ] = { {8 ,15 }, {0 ,1 }, + {7 ,8 }, {1 ,9 }, {14 ,11 }, {15 ,10 }, + {-1 ,-1 }, {-1 ,-1 } };#ifdef CONFIG_PPC_B4420 static const int8_t vsc16_rx_sgmii_lane_cd[8 ][2 ] = { {14 ,11 }, {15 ,10 }, {-1 ,-1 }, {-1 ,-1 }, {-1 ,-1 }, {-1 ,-1 }, {-1 ,-1 }, {-1 ,-1 } };#endif -static const int8_t vsc16_rx_aurora[8 ][2 ] = { {12 ,3 }, {13 ,12 }, {-1 ,-1 }, +static const int8_t vsc16_rx_aurora[8 ][2 ] = { {13 ,3 }, {12 ,12 }, {-1 ,-1 }, {-1 ,-1 }, {-1 ,-1 }, {-1 ,-1 }, {-1 ,-1 }, {-1 ,-1 } };static const int8_t vsc08_tx_amc[4 ][2 ] = { {2 ,2 }, {3 ,3 }, {7 ,4 }, {1 ,5 } }; -static const int8_t vsc08_tx_sfp[4 ][2 ] = { {2 ,6 }, {3 ,7 }, {7 ,1 }, {1 ,0 } }; +static const int8_t vsc08_tx_sfp[4 ][2 ] = { {2 ,1 }, {3 ,0 }, {7 ,6 }, {1 ,7 } };static const int8_t vsc08_rx_amc[4 ][2 ] = { {2 ,3 }, {3 ,4 }, {4 ,7 }, {5 ,1 } }; -static const int8_t vsc08_rx_sfp[4 ][2 ] = { {6 ,3 }, {7 ,4 }, {1 ,7 }, {0 ,1 } }; +static const int8_t vsc08_rx_sfp[4 ][2 ] = { {1 ,3 }, {0 ,4 }, {6 ,7 }, {7 ,1 } };#endif
Signature · 1 line
1.7.9.5
PATCH v2 22/29 powerpc/p2041: fix serdes reference clock frequency display for PC board
In reply to York SunFrom: Shaohui Xie <[email protected]>
PC board has different serdes clock setting with PB board, it uses same serdes frequency setting on bank2 as on bank1. PC board can be distingushed from PB board by checking CPLD version, if running on PC board, then fix the serdes reference clock frequency of bank2.
--- board/freescale/p2041rdb/p2041rdb.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
board/freescale/p2041rdb/p2041rdb.c +11 -0
@@ -227,6 +227,17 @@ int misc_init_r(void) "'00' is unsupported\n"); else actual[i] = freq[i][clock]; + +/* +* PC board uses a different CPLD with PB board, this CPLD +* has cpld_ver_sub = 1, and pcba_ver = 5. But CPLD on PB +* board has cpld_ver_sub = 0, and pcba_ver = 4. +*/ +if ((i ==1 ) && (CPLD_READ (cpld_ver_sub) ==1 ) && + (CPLD_READ (pcba_ver) ==5 )) { +/* PC board bank2 frequency */ + actual[i] = freq[i-1 ][clock]; + } }for (i =0 ; i <NUM_SRDS_BANKS ; i++) {
Signature · 1 line
1.7.9.5
PATCH v2 23/29 sf: spansion: Add support for S25FL128S
In reply to York SunFrom: Xie Xiaobo <[email protected]>
SPANSION recommend S25FL128S supersedes S25FL129P, and the two flash memory have the same device ID and Memory architecture. So they can use the same config parameters.
--- drivers/mtd/spi/spansion.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/spi/spansion.c +1 -1
@@ -94,7 +94,7 @@ static const struct spansion_spi_flash_params spansion_spi_flash_table[] = { .idcode2 = 0x4d01, .pages_per_sector = 256, .nr_sectors = 256, - .name = "S25FL129P_64K", + .name = "S25FL129P_64K/S25FL128S", }, { .idcode1 = 0x0219,
Signature · 1 line
1.7.9.5
PATCH v2 24/29 powerpc/B4: Merge B4420 and B4860 in config_mpc85xx.h
In reply to York SunFrom: Poonam Aggrwal <[email protected]>
B4420 is a subset of B4860. Merge them in config_mpc85xx.h to simplify the defines.
- Removed #define CONFIG_SYS_FSL_NUM_CLUSTERS as this is used nowhere.
- defined CONFIG_SYS_NUM_FM1_10GEC to 0 for B4420 as it does not have 10G.
Also move CONFIG_E6500 out of B4860QDSds.h into config_mpc85xx.h.
--- arch/powerpc/include/asm/config_mpc85xx.h | 36 ++++++++++------------------- include/configs/B4860QDS.h | 1 - 2 files changed, 12 insertions(+), 25 deletions(-)
arch/powerpc/include/asm/config_mpc85xx.h +12 -24
@@ -559,22 +559,18 @@#define CONFIG_SYS_CCSRBAR_DEFAULT 0xfe000000#define CONFIG_SYS_FSL_PCI_VER_3_X -#elif defined(CONFIG_PPC_B4420 ) +#elif defined(CONFIG_PPC_B4860 ) || defined(CONFIG_PPC_B4420 ) +#define CONFIG_E6500 #define CONFIG_SYS_PPC64 /* 64-bit core */ #define CONFIG_FSL_CORENET /* Freescale CoreNet platform */ #define CONFIG_SYS_FSL_QORIQ_CHASSIS2 /* Freescale Chassis generation 2 */ -#define CONFIG_SYS_FSL_CORES_PER_CLUSTER 4#define CONFIG_SYS_FSL_QMAN_V3 /* QMAN version 3 */ -#define CONFIG_MAX_CPUS 2 -#define CONFIG_SYS_FSL_NUM_CC_PLLS 4#define CONFIG_SYS_FSL_NUM_LAWS 32#define CONFIG_SYS_FSL_SEC_COMPAT 4#define CONFIG_SYS_NUM_FMAN 1 -#define CONFIG_SYS_NUM_FM1_DTSEC 4 -#define CONFIG_NUM_DDR_CONTROLLERS 1#define CONFIG_SYS_FSL_DDR_VER FSL_DDR_VER_4_7 -#define CONFIG_SYS_FSL_IFC_BANK_COUNT 4#define CONFIG_SYS_FMAN_V3 +#define CONFIG_SYS_FSL_IFC_BANK_COUNT 4#define CONFIG_SYS_FM_MURAM_SIZE 0x60000#define CONFIG_SYS_FSL_TBCLK_DIV 16#define CONFIG_SYS_FSL_PCIE_COMPAT "fsl,qoriq-pcie-v2.4"
@@ -582,32 +578,24 @@#define CONFIG_SYS_FSL_ERRATUM_A_004934 #define CONFIG_SYS_CCSRBAR_DEFAULT 0xfe000000 -#elif defined(CONFIG_PPC_B4860 ) -#define CONFIG_SYS_PPC64 /* 64-bit core */ -#define CONFIG_FSL_CORENET /* Freescale CoreNet platform */ -#define CONFIG_SYS_FSL_QORIQ_CHASSIS2 /* Freescale Chassis generation 2 */ +#ifdef CONFIG_PPC_B4860 #define CONFIG_SYS_FSL_CORES_PER_CLUSTER 4 -#define CONFIG_SYS_FSL_QMAN_V3 /* QMAN version 3 */ #define CONFIG_MAX_CPUS 4#define CONFIG_SYS_FSL_NUM_CC_PLLS 4 -#define CONFIG_SYS_FSL_NUM_LAWS 32 -#define CONFIG_SYS_FSL_SEC_COMPAT 4 -#define CONFIG_SYS_NUM_FMAN 1#define CONFIG_SYS_NUM_FM1_DTSEC 6#define CONFIG_SYS_NUM_FM1_10GEC 2#define CONFIG_NUM_DDR_CONTROLLERS 2 -#define CONFIG_SYS_FSL_DDR_VER FSL_DDR_VER_4_7 -#define CONFIG_SYS_FSL_IFC_BANK_COUNT 4 -#define CONFIG_SYS_FMAN_V3 -#define CONFIG_SYS_FM_MURAM_SIZE 0x60000 -#define CONFIG_SYS_FSL_TBCLK_DIV 16 -#define CONFIG_SYS_FSL_PCIE_COMPAT "fsl,qoriq-pcie-v2.4"#define CONFIG_SYS_FSL_SRIO_MAX_PORTS 2#define CONFIG_SYS_FSL_SRIO_OB_WIN_NUM 9#define CONFIG_SYS_FSL_SRIO_IB_WIN_NUM 5 -#define CONFIG_SYS_FSL_USB1_PHY_ENABLE -#define CONFIG_SYS_FSL_ERRATUM_A_004934 -#define CONFIG_SYS_CCSRBAR_DEFAULT 0xfe000000 +#else +#define CONFIG_MAX_CPUS 2 +#define CONFIG_SYS_FSL_CORES_PER_CLUSTER 2 +#define CONFIG_SYS_FSL_NUM_CC_PLLS 4 +#define CONFIG_SYS_NUM_FM1_DTSEC 4 +#define CONFIG_SYS_NUM_FM1_10GEC 0 +#define CONFIG_NUM_DDR_CONTROLLERS 1 +#endif #elif defined(CONFIG_PPC_T1040 )#define CONFIG_E5500
include/configs/B4860QDS.h +0 -1
@@ -36,7 +36,6 @@/* High Level Configuration Options */ #define CONFIG_BOOKE -#define CONFIG_E6500 #define CONFIG_E500 /* BOOKE e500 family */ #define CONFIG_E500MC /* BOOKE e500mc family */ #define CONFIG_SYS_BOOK3E_HV /* Category E.HV supported */
Signature · 1 line
1.7.9.5
PATCH v2 25/29 powerpc/p5040: fix mdio mux for 10G port
In reply to York SunFrom: Shaohui Xie <[email protected]>
Current driver of p5040 assumes 10G port follows 1G port DTSEC5 in eth port enum structure, it will assign mdio mux depend on this assumption. This is not true with Fman V3, which added more 1G ports after port DTSEC5 in eth port enum structure, then 10G ports on p5040 will have wrong mdio mux. So we use dynamic index for 10G ports instead of hardcoded enum value when doing mdio mux for 10G ports.
--- board/freescale/corenet_ds/eth_superhydra.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
board/freescale/corenet_ds/eth_superhydra.c +4 -4
@@ -605,8 +605,8 @@ int board_eth_init(bd_t *bis) lane =serdes_get_first_lane (XAUI_FM1 );if (lane >=0 ) {debug ("FM1 at TGEC1 expects XAUI in slot %u\n" , lane_to_slot[lane]); - mdio_mux[FM1_10GEC1 ].mask =BRDCFG1_EMI2_SEL_MASK ; - mdio_mux[FM1_10GEC1 ].val =BRDCFG1_EMI2_SEL_SLOT2 ; + mdio_mux[i].mask =BRDCFG1_EMI2_SEL_MASK ; + mdio_mux[i].val =BRDCFG1_EMI2_SEL_SLOT2 ;super_hydra_mdio_set_mux ("SUPER_HYDRA_FM1_TGEC_MDIO" , mdio_mux[i].mask, mdio_mux[i].val); }
@@ -704,8 +704,8 @@ int board_eth_init(bd_t *bis) lane =serdes_get_first_lane (XAUI_FM2 );if (lane >=0 ) {debug ("FM2 at TGEC1 expects XAUI in slot %u\n" , lane_to_slot[lane]); - mdio_mux[FM2_10GEC1 ].mask =BRDCFG1_EMI2_SEL_MASK ; - mdio_mux[FM2_10GEC1 ].val =BRDCFG1_EMI2_SEL_SLOT1 ; + mdio_mux[i].mask =BRDCFG1_EMI2_SEL_MASK ; + mdio_mux[i].val =BRDCFG1_EMI2_SEL_SLOT1 ;super_hydra_mdio_set_mux ("SUPER_HYDRA_FM2_TGEC_MDIO" , mdio_mux[i].mask, mdio_mux[i].val); }
Signature · 1 line
1.7.9.5
PATCH v2 26/29 powerpc/usb: Fix usb device-tree fix-up
In reply to York SunFrom: Ramneek Mehresh <[email protected]>
Fix USB device-tree fixup to properly handle device-tree fixup and print appropriate message when wrong/junk "dr_mode" or "phy_type" are mentioned in hwconfig string
--- arch/powerpc/cpu/mpc8xxx/fdt.c | 5 +++++ 1 file changed, 5 insertions(+)
arch/powerpc/cpu/mpc8xxx/fdt.c +5 -0
@@ -167,6 +167,11 @@ void fdt_fixup_dr_usb(void *blob, bd_t *bd) } } +if (mode_idx <0 || phy_idx <0 ) { +printf ("WARNING: wrong usb mode/phy defined!!\n" ); +return ; + } + dr_mode_type = modes[mode_idx]; dr_phy_type = phys[phy_idx];
Signature · 1 line
1.7.9.5
PATCH v2 27/29 fman/mEMAC: set SETSP bit in IF_MODE regisgter for RGMII speed
In reply to York SunFrom: Roy ZANG <[email protected]>
Some legacy RGMII phys don't have in band signaling for the speed information. so set the RGMII MAC mode according to the speed got from PHY.
--- arch/powerpc/include/asm/fsl_memac.h | 4 ++++ drivers/net/fm/memac.c | 15 +++++++++++++++ 2 files changed, 19 insertions(+)
arch/powerpc/include/asm/fsl_memac.h +4 -0
@@ -222,6 +222,10 @@ struct memac {/* IF_MODE - Interface Mode Register */ #define IF_MODE_EN_AUTO 0x00008000/* 1 - Enable automatic speed selection */ +#define IF_MODE_SETSP_100M 0x00000000/* 00 - 100Mbps RGMII */ +#define IF_MODE_SETSP_10M 0x00002000/* 01 - 10Mbps RGMII */ +#define IF_MODE_SETSP_1000M 0x00004000/* 10 - 1000Mbps RGMII */ +#define IF_MODE_SETSP_MASK 0x00006000/* setsp mask bits */ #define IF_MODE_XGMII 0x00000000/* 00- XGMII(10) interface mode */ #define IF_MODE_GMII 0x00000002/* 10- GMII interface mode */ #define IF_MODE_MASK 0x00000003/* mask for mode interface mode */
drivers/net/fm/memac.c +15 -0
@@ -112,6 +112,21 @@ static void memac_set_interface_mode(struct fsl_enet_mac *mac,/* Enable automatic speed selection */ if_mode |=IF_MODE_EN_AUTO ; +if (type ==PHY_INTERFACE_MODE_RGMII ) { + if_mode &= ~IF_MODE_EN_AUTO ; + if_mode &= ~IF_MODE_SETSP_MASK ; +switch (speed) { +case SPEED_1000 : + if_mode |=IF_MODE_SETSP_1000M ; +case SPEED_100 : + if_mode |=IF_MODE_SETSP_100M ; +case SPEED_10 : + if_mode |=IF_MODE_SETSP_10M ; +default : +break ; + } + } +debug (" %s, if_mode = %x\n" , __func__, if_mode);debug (" %s, if_status = %x\n" , __func__, if_status);out_be32 (®s->if_mode, if_mode);
Signature · 1 line
1.7.9.5
PATCH v2 28/29 powerpc/b4860qds: Add LAW Target ID and Create LAW entry for Maple
In reply to York SunFrom: Shaveta Leekha <[email protected]>
--- arch/powerpc/include/asm/fsl_law.h | 2 ++ board/freescale/b4860qds/law.c | 3 +++ include/configs/B4860QDS.h | 9 +++++++++ 3 files changed, 14 insertions(+)
arch/powerpc/include/asm/fsl_law.h +2 -0
@@ -70,6 +70,8 @@ enum law_trgt_if {LAW_TRGT_IF_DCSR =0x1d ,LAW_TRGT_IF_LBC =0x1f ,LAW_TRGT_IF_QMAN =0x3c , + + LAW_TRGT_IF_MAPLE = 0x50, };#define LAW_TRGT_IF_DDR LAW_TRGT_IF_DDR_1#define LAW_TRGT_IF_IFC LAW_TRGT_IF_LBC
board/freescale/b4860qds/law.c +3 -0
@@ -33,6 +33,9 @@ struct law_entry law_table[] = {SET_LAW (CONFIG_SYS_QMAN_MEM_PHYS ,LAW_SIZE_32M ,LAW_TRGT_IF_QMAN ), #endifSET_LAW (QIXIS_BASE_PHYS ,LAW_SIZE_4K ,LAW_TRGT_IF_IFC ), +#ifdef CONFIG_SYS_MAPLE_MEM_PHYS +SET_LAW (CONFIG_SYS_MAPLE_MEM_PHYS ,LAW_SIZE_16M ,LAW_TRGT_IF_MAPLE ), +#endif #ifdef CONFIG_SYS_DCSRBAR_PHYS/* Limit DCSR to 32M to access NPC Trace Buffer */ SET_LAW(CONFIG_SYS_DCSRBAR_PHYS, LAW_SIZE_32M, LAW_TRGT_IF_DCSR),
include/configs/B4860QDS.h +9 -0
@@ -527,6 +527,15 @@ unsigned long get_board_ddr_clk(void);#define CONFIG_SF_DEFAULT_MODE 0/* +* MAPLE +*/ +#ifdef CONFIG_PHYS_64BIT +#define CONFIG_SYS_MAPLE_MEM_PHYS 0xFA0000000ull +#else +#define CONFIG_SYS_MAPLE_MEM_PHYS 0xA0000000 +#endif + +/* * General PCI * Memory space is mapped 1-1, but I/O space must start from 0. */
Signature · 1 line
1.7.9.5
PATCH v2 29/29 SECURE BOOT - Removed deletion of TLB entries code
In reply to York SunFrom: Ruchika Gupta <[email protected]>
Boot ROM code creates TLB entries for 3.5G space before entering the u-boot. Earlier we were deleting these entries after early initialization of CPU. In recent past, code has been added to invalidate all these entries before relocation of u-boot code. So this code to delete TLB entries after CPU initialization is no longer required.
--- arch/powerpc/cpu/mpc85xx/cpu_init_early.c | 7 ------- arch/powerpc/include/asm/fsl_secure_boot.h | 10 ---------- 2 files changed, 17 deletions(-)
arch/powerpc/cpu/mpc85xx/cpu_init_early.c +0 -7
@@ -180,12 +180,5 @@ void cpu_init_early_f(void)invalidate_tlb (1 ); -#if defined(CONFIG_SECURE_BOOT ) -/* Disable the TLBs created by ISBC */ -for (i =CONFIG_SYS_ISBC_START_TLB ; - i <CONFIG_SYS_ISBC_START_TLB +CONFIG_SYS_ISBC_NUM_TLBS ; i++) -disable_tlb (i); -#endif -init_tlbs (); }
arch/powerpc/include/asm/fsl_secure_boot.h +0 -10
@@ -23,16 +23,6 @@#ifndef __FSL_SECURE_BOOT_H#define __FSL_SECURE_BOOT_H -/* Starting TLB number for the TLB entried for 3.5 G space created by ISBC */ -#if defined(CONFIG_FSL_CORENET ) -#define CONFIG_SYS_ISBC_START_TLB 3 -#else -#define CONFIG_SYS_ISBC_START_TLB 0 -#endif - -/* Number fo TLB's created by ISBC */ -#define CONFIG_SYS_ISBC_NUM_TLBS 5 -#if defined(CONFIG_FSL_CORENET )#define CONFIG_SYS_PBI_FLASH_BASE 0xc0000000#else
Signature · 1 line
1.7.9.5