diff options
Diffstat (limited to 'arch/powerpc/cpu/mpc85xx')
| -rw-r--r-- | arch/powerpc/cpu/mpc85xx/Makefile | 6 | ||||
| -rw-r--r-- | arch/powerpc/cpu/mpc85xx/cpu_init.c | 24 | ||||
| -rw-r--r-- | arch/powerpc/cpu/mpc85xx/cpu_init_early.c | 7 | ||||
| -rw-r--r-- | arch/powerpc/cpu/mpc85xx/ddr-gen3.c | 2 | ||||
| -rw-r--r-- | arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c | 2 | ||||
| -rw-r--r-- | arch/powerpc/cpu/mpc85xx/mp.c | 2 | ||||
| -rw-r--r-- | arch/powerpc/cpu/mpc85xx/portals.c | 36 | ||||
| -rw-r--r-- | arch/powerpc/cpu/mpc85xx/release.S | 53 | ||||
| -rw-r--r-- | arch/powerpc/cpu/mpc85xx/speed.c | 32 | ||||
| -rw-r--r-- | arch/powerpc/cpu/mpc85xx/start.S | 106 | ||||
| -rw-r--r-- | arch/powerpc/cpu/mpc85xx/t1040_ids.c | 135 | ||||
| -rw-r--r-- | arch/powerpc/cpu/mpc85xx/t1040_serdes.c | 93 | ||||
| -rw-r--r-- | arch/powerpc/cpu/mpc85xx/t4240_serdes.c | 150 | 
13 files changed, 524 insertions, 124 deletions
| diff --git a/arch/powerpc/cpu/mpc85xx/Makefile b/arch/powerpc/cpu/mpc85xx/Makefile index 6776c85e4..2318064a4 100644 --- a/arch/powerpc/cpu/mpc85xx/Makefile +++ b/arch/powerpc/cpu/mpc85xx/Makefile @@ -83,10 +83,12 @@ COBJS-$(CONFIG_PPC_P4080)	+= ddr-gen3.o  COBJS-$(CONFIG_PPC_P5020)	+= ddr-gen3.o  COBJS-$(CONFIG_PPC_P5040)	+= ddr-gen3.o  COBJS-$(CONFIG_PPC_T4240)	+= ddr-gen3.o +COBJS-$(CONFIG_PPC_T4160)	+= ddr-gen3.o  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 @@ -102,8 +104,10 @@ COBJS-$(CONFIG_PPC_P4080) += p4080_ids.o  COBJS-$(CONFIG_PPC_P5020) += p5020_ids.o  COBJS-$(CONFIG_PPC_P5040) += p5040_ids.o  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 @@ -137,9 +141,11 @@ COBJS-$(CONFIG_PPC_P4080) += p4080_serdes.o  COBJS-$(CONFIG_PPC_P5020) += p5020_serdes.o  COBJS-$(CONFIG_PPC_P5040) += p5040_serdes.o  COBJS-$(CONFIG_PPC_T4240) += t4240_serdes.o +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 diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init.c b/arch/powerpc/cpu/mpc85xx/cpu_init.c index 53713e31d..4067f0537 100644 --- a/arch/powerpc/cpu/mpc85xx/cpu_init.c +++ b/arch/powerpc/cpu/mpc85xx/cpu_init.c @@ -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|L2CSR0_L2REP_MODE);  		}  		i++;  	} while (!(cluster & TP_CLUSTER_EOC)); @@ -637,6 +637,28 @@ skip_l2:  	}  #endif +#if defined(CONFIG_SYS_FSL_USB_DUAL_PHY_ENABLE) +		ccsr_usb_phy_t *usb_phy = +			(void *)CONFIG_SYS_MPC85xx_USB1_PHY_ADDR; +		setbits_be32(&usb_phy->pllprg[1], +			     CONFIG_SYS_FSL_USB_PLLPRG2_PHY2_CLK_EN | +			     CONFIG_SYS_FSL_USB_PLLPRG2_PHY1_CLK_EN | +			     CONFIG_SYS_FSL_USB_PLLPRG2_MFI | +			     CONFIG_SYS_FSL_USB_PLLPRG2_PLL_EN); +		setbits_be32(&usb_phy->port1.ctrl, +			     CONFIG_SYS_FSL_USB_CTRL_PHY_EN); +		setbits_be32(&usb_phy->port1.drvvbuscfg, +			     CONFIG_SYS_FSL_USB_DRVVBUS_CR_EN); +		setbits_be32(&usb_phy->port1.pwrfltcfg, +			     CONFIG_SYS_FSL_USB_PWRFLT_CR_EN); +		setbits_be32(&usb_phy->port2.ctrl, +			     CONFIG_SYS_FSL_USB_CTRL_PHY_EN); +		setbits_be32(&usb_phy->port2.drvvbuscfg, +			     CONFIG_SYS_FSL_USB_DRVVBUS_CR_EN); +		setbits_be32(&usb_phy->port2.pwrfltcfg, +			     CONFIG_SYS_FSL_USB_PWRFLT_CR_EN); +#endif +  #ifdef CONFIG_FMAN_ENET  	fman_enet_init();  #endif diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c index dacfdd15e..234fde484 100644 --- a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c +++ b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c @@ -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();  } diff --git a/arch/powerpc/cpu/mpc85xx/ddr-gen3.c b/arch/powerpc/cpu/mpc85xx/ddr-gen3.c index ef0dd1da6..c5b47200e 100644 --- a/arch/powerpc/cpu/mpc85xx/ddr-gen3.c +++ b/arch/powerpc/cpu/mpc85xx/ddr-gen3.c @@ -142,7 +142,7 @@ void fsl_ddr_set_memctl_regs(const fsl_ddr_cfg_regs_t *regs,  		}  	}  #ifdef CONFIG_SYS_FSL_ERRATUM_A_004934 -	out_be32(&ddr->debug[28], 0x00003000); +	out_be32(&ddr->debug[28], 0x30003000);  #endif  #ifdef CONFIG_SYS_FSL_ERRATUM_DDR_A003474 diff --git a/arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c b/arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c index 01dcdf6bc..93eca7669 100644 --- a/arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c +++ b/arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c @@ -164,7 +164,7 @@ u64 serdes_init(u32 sd, u32 sd_addr, u32 sd_prctl_mask, u32 sd_prctl_shift)  	}  	cfg >>= sd_prctl_shift; -	printf("Using SERDES%d Protocol: 0x%x\n", sd + 1, cfg); +	printf("Using SERDES%d Protocol: %d (0x%x)\n", sd + 1, cfg, cfg);  	if (!is_serdes_prtcl_valid(sd, cfg))  		printf("SERDES%d[PRTCL] = 0x%x is not valid\n", sd + 1, cfg); diff --git a/arch/powerpc/cpu/mpc85xx/mp.c b/arch/powerpc/cpu/mpc85xx/mp.c index 43d483630..861c8e028 100644 --- a/arch/powerpc/cpu/mpc85xx/mp.c +++ b/arch/powerpc/cpu/mpc85xx/mp.c @@ -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); diff --git a/arch/powerpc/cpu/mpc85xx/portals.c b/arch/powerpc/cpu/mpc85xx/portals.c index d529095ee..672edde45 100644 --- a/arch/powerpc/cpu/mpc85xx/portals.c +++ b/arch/powerpc/cpu/mpc85xx/portals.c @@ -128,24 +128,32 @@ static int fdt_qportal(void *blob, int off, int id, char *name,  	childoff = fdt_subnode_offset(blob, off, name);  	if (create) { -		if (childoff <= 0) -			childoff = fdt_add_subnode(blob, off, name); +		char handle[64], *p; -		if (childoff > 0) { -			char handle[64], *p; +		strncpy(handle, name, sizeof(handle)); +		p = strchr(handle, '@'); +		if (!strncmp(name, "fman", 4)) { +			*p = *(p + 1); +			p++; +		} +		*p = '\0'; -			strncpy(handle, name, sizeof(handle)); -			p = strchr(handle, '@'); -			if (!strncmp(name, "fman", 4)) { -				*p = *(p + 1); -				p++; -			} -			*p = '\0'; +		dev_off = fdt_path_offset(blob, handle); +		/* skip this node if alias is not found */ +		if (dev_off == -FDT_ERR_BADPATH) +			return 0; +		if (dev_off < 0) +			return dev_off; -			dev_off = fdt_path_offset(blob, handle); -			if (dev_off < 0) -				return dev_off; +		if (childoff <= 0) +			childoff = fdt_add_subnode(blob, off, name); +		/* need to update the dev_off after adding a subnode */ +		dev_off = fdt_path_offset(blob, handle); +		if (dev_off < 0) +			return dev_off; + +		if (childoff > 0) {  			dev_handle = fdt_get_phandle(blob, dev_off);  			if (dev_handle <= 0) {  				dev_handle = fdt_alloc_phandle(blob); diff --git a/arch/powerpc/cpu/mpc85xx/release.S b/arch/powerpc/cpu/mpc85xx/release.S index 5c4b1e3b7..a4a21b037 100644 --- a/arch/powerpc/cpu/mpc85xx/release.S +++ b/arch/powerpc/cpu/mpc85xx/release.S @@ -69,9 +69,9 @@ __secondary_start_page:  #endif  #ifdef CONFIG_SYS_FSL_ERRATUM_CPU_A003999 -	mfspr	r3,977 +	mfspr	r3,SPRN_HDBCR1  	oris	r3,r3,0x0100 -	mtspr	977,r3 +	mtspr	SPRN_HDBCR1,r3  #endif  #ifdef CONFIG_SYS_FSL_ERRATUM_A004510 @@ -93,10 +93,10 @@ __secondary_start_page:  1:	/* Erratum says set bits 55:60 to 001001 */  	msync  	isync -	mfspr	r3,976 +	mfspr	r3,SPRN_HDBCR0  	li	r4,0x48  	rlwimi	r3,r4,0,0x1f8 -	mtspr	976,r3 +	mtspr	SPRN_HDBCR0,r3  	isync  2:  #endif @@ -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 -#if	defined(CONFIG_E6500) +#ifdef CONFIG_SYS_FSL_QORIQ_CHASSIS2  /* - * PIR definition for E6500 + * 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_E6500 -	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 */ diff --git a/arch/powerpc/cpu/mpc85xx/speed.c b/arch/powerpc/cpu/mpc85xx/speed.c index 297f2ed47..a4d6e9cc7 100644 --- a/arch/powerpc/cpu/mpc85xx/speed.c +++ b/arch/powerpc/cpu/mpc85xx/speed.c @@ -112,30 +112,32 @@ 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];  	} +#ifdef CONFIG_PPC_B4860 +#define FM1_CLK_SEL	0xe0000000 +#define FM1_CLK_SHIFT	29 +#else  #define PME_CLK_SEL	0xe0000000  #define PME_CLK_SHIFT	29  #define FM1_CLK_SEL	0x1c000000  #define FM1_CLK_SHIFT	26 +#endif  	rcw_tmp = in_be32(&gur->rcwsr[7]);  #ifdef CONFIG_SYS_DPAA_PME @@ -185,6 +187,9 @@ void get_sys_info (sys_info_t * sysInfo)  	case 4:  		sysInfo->freqFMan[0] = freqCC_PLL[3] / 4;  		break; +	case 5: +		sysInfo->freqFMan[0] = sysInfo->freqSystemBus; +		break;  	case 6:  		sysInfo->freqFMan[0] = freqCC_PLL[4] / 2;  		break; @@ -232,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] = @@ -285,6 +291,10 @@ void get_sys_info (sys_info_t * sysInfo)  #endif  #endif +#ifdef CONFIG_SYS_DPAA_QBMAN +	sysInfo->freqQMAN = sysInfo->freqSystemBus / 2; +#endif +  #endif /* CONFIG_SYS_FSL_QORIQ_CHASSIS2 */  #else /* CONFIG_FSL_CORENET */ diff --git a/arch/powerpc/cpu/mpc85xx/start.S b/arch/powerpc/cpu/mpc85xx/start.S index 3f76ee66c..4f0480b76 100644 --- a/arch/powerpc/cpu/mpc85xx/start.S +++ b/arch/powerpc/cpu/mpc85xx/start.S @@ -116,10 +116,10 @@ _start_e500:  	/* Erratum says set bits 55:60 to 001001 */  	msync  	isync -	mfspr	r3,976 +	mfspr	r3,SPRN_HDBCR0  	li	r4,0x48  	rlwimi	r3,r4,0,0x1f8 -	mtspr	976,r3 +	mtspr	SPRN_HDBCR0,r3  	isync  2:  #endif @@ -173,52 +173,6 @@ l2_disabled:  	mfspr	r1,DBSR  	mtspr	DBSR,r1		/* Clear all valid bits */ -	/* -	 *	Enable L1 Caches early -	 * -	 */ - -#ifdef CONFIG_SYS_CACHE_STASHING -	/* set stash id to (coreID) * 2 + 32 + L1 CT (0) */ -	li	r2,(32 + 0) -	mtspr	L1CSR2,r2 -#endif - -	/* Enable/invalidate the I-Cache */ -	lis	r2,(L1CSR1_ICFI|L1CSR1_ICLFR)@h -	ori	r2,r2,(L1CSR1_ICFI|L1CSR1_ICLFR)@l -	mtspr	SPRN_L1CSR1,r2 -1: -	mfspr	r3,SPRN_L1CSR1 -	and.	r1,r3,r2 -	bne	1b - -	lis	r3,(L1CSR1_CPE|L1CSR1_ICE)@h -	ori	r3,r3,(L1CSR1_CPE|L1CSR1_ICE)@l -	mtspr	SPRN_L1CSR1,r3 -	isync -2: -	mfspr	r3,SPRN_L1CSR1 -	andi.	r1,r3,L1CSR1_ICE@l -	beq	2b - -	/* Enable/invalidate the D-Cache */ -	lis	r2,(L1CSR0_DCFI|L1CSR0_DCLFR)@h -	ori	r2,r2,(L1CSR0_DCFI|L1CSR0_DCLFR)@l -	mtspr	SPRN_L1CSR0,r2 -1: -	mfspr	r3,SPRN_L1CSR0 -	and.	r1,r3,r2 -	bne	1b - -	lis	r3,(L1CSR0_CPE|L1CSR0_DCE)@h -	ori	r3,r3,(L1CSR0_CPE|L1CSR0_DCE)@l -	mtspr	SPRN_L1CSR0,r3 -	isync -2: -	mfspr	r3,SPRN_L1CSR0 -	andi.	r1,r3,L1CSR0_DCE@l -	beq	2b  	.macro	create_tlb1_entry esel ts tsize epn wimg rpn perm phy_high scratch  	lis	\scratch, FSL_BOOKE_MAS0(1, \esel, 0)@h @@ -372,9 +326,9 @@ l2_disabled:  #endif  #ifdef CONFIG_SYS_FSL_ERRATUM_CPU_A003999 -	mfspr	r3,977 +	mfspr	r3,SPRN_HDBCR1  	oris	r3,r3,0x0100 -	mtspr	977,r3 +	mtspr	SPRN_HDBCR1,r3  #endif  	/* Enable Branch Prediction */ @@ -780,13 +734,60 @@ enable_l2_cluster_l2:  	isync  	and.	r1, r0, r4  	bne	1b -	lis	r4, L2CSR0_L2E@h +	lis	r4, (L2CSR0_L2E|L2CSR0_L2PE)@h +	ori	r4, r4, (L2CSR0_L2REP_MODE)@l  	sync -	stw	r4, 0(r3)	/* eanble L2 */ +	stw	r4, 0(r3)	/* enable L2 */  delete_ccsr_l2_tlb:  	delete_tlb0_entry 0, CONFIG_SYS_CCSRBAR + 0xC20000, MAS2_I|MAS2_G, r3  #endif +	/* +	 * Enable the L1. On e6500, this has to be done +	 * after the L2 is up. +	 */ + +#ifdef CONFIG_SYS_CACHE_STASHING +	/* set stash id to (coreID) * 2 + 32 + L1 CT (0) */ +	li	r2,(32 + 0) +	mtspr	L1CSR2,r2 +#endif + +	/* Enable/invalidate the I-Cache */ +	lis	r2,(L1CSR1_ICFI|L1CSR1_ICLFR)@h +	ori	r2,r2,(L1CSR1_ICFI|L1CSR1_ICLFR)@l +	mtspr	SPRN_L1CSR1,r2 +1: +	mfspr	r3,SPRN_L1CSR1 +	and.	r1,r3,r2 +	bne	1b + +	lis	r3,(L1CSR1_CPE|L1CSR1_ICE)@h +	ori	r3,r3,(L1CSR1_CPE|L1CSR1_ICE)@l +	mtspr	SPRN_L1CSR1,r3 +	isync +2: +	mfspr	r3,SPRN_L1CSR1 +	andi.	r1,r3,L1CSR1_ICE@l +	beq	2b + +	/* Enable/invalidate the D-Cache */ +	lis	r2,(L1CSR0_DCFI|L1CSR0_DCLFR)@h +	ori	r2,r2,(L1CSR0_DCFI|L1CSR0_DCLFR)@l +	mtspr	SPRN_L1CSR0,r2 +1: +	mfspr	r3,SPRN_L1CSR0 +	and.	r1,r3,r2 +	bne	1b + +	lis	r3,(L1CSR0_CPE|L1CSR0_DCE)@h +	ori	r3,r3,(L1CSR0_CPE|L1CSR0_DCE)@l +	mtspr	SPRN_L1CSR0,r3 +	isync +2: +	mfspr	r3,SPRN_L1CSR0 +	andi.	r1,r3,L1CSR0_DCE@l +	beq	2b  #ifdef CONFIG_SYS_FSL_ERRATUM_A004510  #define DCSR_LAWBARH0	(CONFIG_SYS_CCSRBAR + 0x1000)  #define LAW_SIZE_1M	0x13 @@ -1905,6 +1906,7 @@ unlock_ram_in_cache:  	slwi	r4,r4,(10 - 1 - L1_CACHE_SHIFT)  	mtctr	r4  1:	dcbi	r0,r3 +	dcblc	r0,r3  	addi	r3,r3,CONFIG_SYS_CACHELINE_SIZE  	bdnz	1b  	sync diff --git a/arch/powerpc/cpu/mpc85xx/t1040_ids.c b/arch/powerpc/cpu/mpc85xx/t1040_ids.c new file mode 100644 index 000000000..ed615996f --- /dev/null +++ b/arch/powerpc/cpu/mpc85xx/t1040_ids.c @@ -0,0 +1,135 @@ +/* + * Copyright 2012 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_portals.h> +#include <asm/fsl_liodn.h> + +#ifdef CONFIG_SYS_DPAA_QBMAN +struct qportal_info qp_info[CONFIG_SYS_QMAN_NUM_PORTALS] = { +	/* dqrr liodn, frame data liodn, liodn off, sdest */ +	SET_QP_INFO(1, 27, 1, 0), +	SET_QP_INFO(2, 28, 1, 0), +	SET_QP_INFO(3, 29, 1, 1), +	SET_QP_INFO(4, 30, 1, 1), +	SET_QP_INFO(5, 31, 1, 2), +	SET_QP_INFO(6, 32, 1, 2), +	SET_QP_INFO(7, 33, 1, 3), +	SET_QP_INFO(8, 34, 1, 3), +	SET_QP_INFO(9, 35, 1, 0), +	SET_QP_INFO(10, 36, 1, 0), +	SET_QP_INFO(11, 37, 1, 1), +	SET_QP_INFO(12, 38, 1, 1), +	SET_QP_INFO(13, 39, 1, 2), +	SET_QP_INFO(14, 40, 1, 2), +	SET_QP_INFO(15, 41, 1, 3), +	SET_QP_INFO(16, 42, 1, 3), +	SET_QP_INFO(17, 43, 1, 0), +	SET_QP_INFO(18, 44, 1, 0), +	SET_QP_INFO(19, 45, 1, 1), +	SET_QP_INFO(20, 46, 1, 1), +	SET_QP_INFO(21, 47, 1, 2), +	SET_QP_INFO(22, 48, 1, 2), +	SET_QP_INFO(23, 49, 1, 3), +	SET_QP_INFO(24, 50, 1, 3), +	SET_QP_INFO(25, 51, 1, 0), +}; +#endif + +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); + +struct liodn_id_table liodn_tbl[] = { +#ifdef CONFIG_SYS_DPAA_QBMAN +	SET_QMAN_LIODN(62), +	SET_BMAN_LIODN(63), +#endif + +	SET_SDHC_LIODN(1, 552), + +	SET_USB_LIODN(1, "fsl-usb2-mph", 553), + +	SET_PCI_LIODN("fsl,qoriq-pcie-v2.2", 1, 148), + +	SET_DMA_LIODN(1, 147), +	SET_DMA_LIODN(2, 227), + +	SET_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), + +	/* SET_NEXUS_LIODN(557), -- not yet implemented */ +}; +int liodn_tbl_sz = ARRAY_SIZE(liodn_tbl); + +#ifdef CONFIG_SYS_DPAA_FMAN +struct liodn_id_table fman1_liodn_tbl[] = { +	SET_FMAN_RX_1G_LIODN(1, 0, 88), +	SET_FMAN_RX_1G_LIODN(1, 1, 89), +	SET_FMAN_RX_1G_LIODN(1, 2, 90), +	SET_FMAN_RX_1G_LIODN(1, 3, 91), +	SET_FMAN_RX_1G_LIODN(1, 4, 92), +	SET_FMAN_RX_1G_LIODN(1, 5, 93), +	SET_FMAN_RX_10G_LIODN(1, 0, 94), +	SET_FMAN_RX_10G_LIODN(1, 1, 95), +}; +int fman1_liodn_tbl_sz = ARRAY_SIZE(fman1_liodn_tbl); +#endif + +struct liodn_id_table sec_liodn_tbl[] = { +	SET_SEC_JR_LIODN_ENTRY(0, 454, 458), +	SET_SEC_JR_LIODN_ENTRY(1, 455, 459), +	SET_SEC_JR_LIODN_ENTRY(2, 456, 460), +	SET_SEC_JR_LIODN_ENTRY(3, 457, 461), +	SET_SEC_RTIC_LIODN_ENTRY(a, 453), +	SET_SEC_RTIC_LIODN_ENTRY(b, 549), +	SET_SEC_RTIC_LIODN_ENTRY(c, 550), +	SET_SEC_RTIC_LIODN_ENTRY(d, 551), +	SET_SEC_DECO_LIODN_ENTRY(0, 541, 610), +	SET_SEC_DECO_LIODN_ENTRY(1, 542, 611), +}; +int sec_liodn_tbl_sz = ARRAY_SIZE(sec_liodn_tbl); + +#ifdef CONFIG_SYS_DPAA_RMAN +struct liodn_id_table rman_liodn_tbl[] = { +	/* Set RMan block 0-3 liodn offset */ +	SET_RMAN_LIODN(0, 678), +	SET_RMAN_LIODN(1, 679), +	SET_RMAN_LIODN(2, 680), +	SET_RMAN_LIODN(3, 681), +}; +int rman_liodn_tbl_sz = ARRAY_SIZE(rman_liodn_tbl); +#endif + +struct liodn_id_table liodn_bases[] = { +	[FSL_HW_PORTAL_SEC]  = SET_LIODN_BASE_2(462, 558), +#ifdef CONFIG_SYS_DPAA_FMAN +	[FSL_HW_PORTAL_FMAN1] = SET_LIODN_BASE_1(973), +#endif +#ifdef CONFIG_SYS_DPAA_RMAN +	[FSL_HW_PORTAL_RMAN] = SET_LIODN_BASE_1(922), +#endif +}; diff --git a/arch/powerpc/cpu/mpc85xx/t1040_serdes.c b/arch/powerpc/cpu/mpc85xx/t1040_serdes.c new file mode 100644 index 000000000..8261e0347 --- /dev/null +++ b/arch/powerpc/cpu/mpc85xx/t1040_serdes.c @@ -0,0 +1,93 @@ +/* + * Copyright 2012 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_serdes.h> +#include <asm/processor.h> +#include <asm/io.h> +#include "fsl_corenet2_serdes.h" + +static u8 serdes_cfg_tbl[MAX_SERDES][0xC4][SRDS_MAX_LANES] = { +	{	/* SerDes 1 */ +	[0x69] = {PCIE1, SGMII_FM1_DTSEC3, QSGMII_SW1_A, QSGMII_SW1_B, +		PCIE2, PCIE3, SGMII_FM1_DTSEC4, SATA1}, +	[0x66] = {PCIE1, SGMII_FM1_DTSEC3, QSGMII_SW1_A, QSGMII_SW1_B, +		PCIE2, PCIE3, PCIE4, SATA1}, +	[0x67] = {PCIE1, SGMII_FM1_DTSEC3, QSGMII_SW1_A, QSGMII_SW1_B, +		PCIE2, PCIE3, PCIE4, SGMII_FM1_DTSEC5}, +	[0x60] = {PCIE1, SGMII_FM1_DTSEC3, QSGMII_SW1_A, QSGMII_SW1_B, +		PCIE2, PCIE2, PCIE2, PCIE2}, +	[0x8D] = {PCIE1, SGMII_SW1_DTSEC3, SGMII_SW1_DTSEC1, SGMII_SW1_DTSEC2, +		PCIE2, SGMII_SW1_DTSEC6, SGMII_SW1_DTSEC4, SGMII_SW1_DTSEC5}, +	[0x89] = {PCIE1, SGMII_SW1_DTSEC3, SGMII_SW1_DTSEC1, SGMII_SW1_DTSEC2, +		PCIE2, PCIE3, SGMII_SW1_DTSEC4, SATA1}, +	[0x86] = {PCIE1, SGMII_FM1_DTSEC3, SGMII_FM1_DTSEC1, SGMII_FM1_DTSEC2, +		PCIE2, PCIE3, PCIE4, SATA1}, +	[0x87] = {PCIE1, SGMII_FM1_DTSEC3, SGMII_FM1_DTSEC1, SGMII_FM1_DTSEC2, +		PCIE2, PCIE3, PCIE4, SGMII_FM1_DTSEC5}, +	[0xA7] = {PCIE1, SGMII_FM1_DTSEC3, SGMII_FM1_DTSEC1, SGMII_FM1_DTSEC2, +		 PCIE2, PCIE3, PCIE4, SGMII_FM1_DTSEC5}, +	[0xAA] = {PCIE1, SGMII_FM1_DTSEC3, SGMII_FM1_DTSEC1, SGMII_FM1_DTSEC2, +		 PCIE2, PCIE3, SGMII_FM1_DTSEC4, SGMII_FM1_DTSEC5}, +	[0x40] = {PCIE1, PCIE1, SGMII_FM1_DTSEC1, SGMII_FM1_DTSEC2, +		PCIE2, PCIE2, PCIE2, PCIE2}, +	[0x06] = {PCIE1, PCIE1, PCIE1, PCIE1, +		PCIE2, PCIE3, PCIE4, SATA1}, +	[0x08] = {PCIE1, PCIE1, PCIE1, PCIE1, +		PCIE2, PCIE3, SATA2, SATA1}, +	[0x8F] = {PCIE1, SGMII_FM1_DTSEC3, SGMII_FM1_DTSEC1, SGMII_FM1_DTSEC2, +		AURORA, NONE, SGMII_FM1_DTSEC4, SGMII_FM1_DTSEC5}, +	[0x85] = {PCIE1, SGMII_FM1_DTSEC3, SGMII_FM1_DTSEC1, SGMII_FM1_DTSEC2, +		PCIE2, PCIE2, SGMII_FM1_DTSEC4, SGMII_FM1_DTSEC5}, +	[0xA5] = {PCIE1, SGMII_FM1_DTSEC3, SGMII_FM1_DTSEC1, SGMII_FM1_DTSEC2, +		PCIE2, PCIE2, SGMII_FM1_DTSEC4, SGMII_FM1_DTSEC5}, +	[0x00] = {PCIE1, PCIE1, PCIE1, PCIE1, +		PCIE2, PCIE2, PCIE2, PCIE2}, +	}, +	{ +	}, +	{ +	}, +	{ +	}, +}; + + +enum srds_prtcl serdes_get_prtcl(int serdes, int cfg, int lane) +{ +	return serdes_cfg_tbl[serdes][cfg][lane]; +} + +int is_serdes_prtcl_valid(int serdes, u32 prtcl) +{ +	int i; + +	if (prtcl > (ARRAY_SIZE(serdes_cfg_tbl[serdes]))) +		return 0; + +	for (i = 0; i < SRDS_MAX_LANES; i++) { +		if (serdes_cfg_tbl[serdes][prtcl][i] != NONE) +			return 1; +	} + +	return 0; +} diff --git a/arch/powerpc/cpu/mpc85xx/t4240_serdes.c b/arch/powerpc/cpu/mpc85xx/t4240_serdes.c index 102defa56..c001780ca 100644 --- a/arch/powerpc/cpu/mpc85xx/t4240_serdes.c +++ b/arch/powerpc/cpu/mpc85xx/t4240_serdes.c @@ -31,7 +31,8 @@ struct serdes_config {  	u8 lanes[SRDS_MAX_LANES];  }; -static struct serdes_config serdes1_cfg_tbl[] = { +#ifdef CONFIG_PPC_T4240 +static const struct serdes_config serdes1_cfg_tbl[] = {  	/* SerDes 1 */  	{1, {XAUI_FM1_MAC9, XAUI_FM1_MAC9,  		XAUI_FM1_MAC9, XAUI_FM1_MAC9, @@ -66,7 +67,7 @@ static struct serdes_config serdes1_cfg_tbl[] = {  		NONE, NONE, QSGMII_FM1_A, NONE}},  	{}  }; -static struct serdes_config serdes2_cfg_tbl[] = { +static const struct serdes_config serdes2_cfg_tbl[] = {  	/* SerDes 2 */  	{1, {XAUI_FM2_MAC9, XAUI_FM2_MAC9,  		XAUI_FM2_MAC9, XAUI_FM2_MAC9, @@ -150,7 +151,7 @@ static struct serdes_config serdes2_cfg_tbl[] = {  		SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4}},  	{}  }; -static struct serdes_config serdes3_cfg_tbl[] = { +static const struct serdes_config serdes3_cfg_tbl[] = {  	/* SerDes 3 */  	{2, {PCIE1, PCIE1, PCIE1, PCIE1, PCIE1, PCIE1, PCIE1, PCIE1}},  	{4, {PCIE1, PCIE1, PCIE1, PCIE1, PCIE2, PCIE2, PCIE2, PCIE2}}, @@ -174,20 +175,151 @@ static struct serdes_config serdes3_cfg_tbl[] = {  		SRIO1, SRIO1, SRIO1, SRIO1}},  	{}  }; -static struct serdes_config serdes4_cfg_tbl[] = { +static const struct serdes_config serdes4_cfg_tbl[] = {  	/* SerDes 4 */  	{2, {PCIE3, PCIE3, PCIE3, PCIE3, PCIE3, PCIE3, PCIE3, PCIE3}},  	{4, {PCIE3, PCIE3, PCIE3, PCIE3, PCIE4, PCIE4, PCIE4, PCIE4}},  	{6, {PCIE3, PCIE3, PCIE3, PCIE3, SRIO2, SRIO2, SRIO2, SRIO2}},  	{8, {PCIE3, PCIE3, PCIE3, PCIE3, SRIO2, SRIO2, SRIO2, SRIO2}}, -	{10, {PCIE3, PCIE3, PCIE3, PCIE3, PCIE4, PCIE4, SATA1, SATA1}}, -	{12, {PCIE3, PCIE3, PCIE3, PCIE3, AURORA, AURORA, SATA1, SATA1}}, +	{10, {PCIE3, PCIE3, PCIE3, PCIE3, PCIE4, PCIE4, SATA1, SATA2} }, +	{12, {PCIE3, PCIE3, PCIE3, PCIE3, AURORA, AURORA, SATA1, SATA2} },  	{14, {PCIE3, PCIE3, PCIE3, PCIE3, AURORA, AURORA, SRIO2, SRIO2}},  	{16, {PCIE3, PCIE3, PCIE3, PCIE3, AURORA, AURORA, SRIO2, SRIO2}},  	{18, {PCIE3, PCIE3, PCIE3, PCIE3, AURORA, AURORA, AURORA, AURORA}},  	{}  }; -static struct serdes_config *serdes_cfg_tbl[] = { +#elif defined(CONFIG_PPC_T4160) +static const struct serdes_config serdes1_cfg_tbl[] = { +	/* SerDes 1 */ +	{1, {XAUI_FM1_MAC9, XAUI_FM1_MAC9, +		XAUI_FM1_MAC9, XAUI_FM1_MAC9, +		XAUI_FM1_MAC10, XAUI_FM1_MAC10, +		XAUI_FM1_MAC10, XAUI_FM1_MAC10} }, +	{2, {HIGIG_FM1_MAC9, HIGIG_FM1_MAC9, +		HIGIG_FM1_MAC9, HIGIG_FM1_MAC9, +		HIGIG_FM1_MAC10, HIGIG_FM1_MAC10, +		HIGIG_FM1_MAC10, HIGIG_FM1_MAC10} }, +	{4, {HIGIG_FM1_MAC9, HIGIG_FM1_MAC9, +		HIGIG_FM1_MAC9, HIGIG_FM1_MAC9, +		HIGIG_FM1_MAC10, HIGIG_FM1_MAC10, +		HIGIG_FM1_MAC10, HIGIG_FM1_MAC10} }, +	{28, {SGMII_FM1_DTSEC5, SGMII_FM1_DTSEC6, +		SGMII_FM1_DTSEC10, SGMII_FM1_DTSEC9, +		SGMII_FM1_DTSEC1, SGMII_FM1_DTSEC2, +		SGMII_FM1_DTSEC3, SGMII_FM1_DTSEC4} }, +	{36, {SGMII_FM1_DTSEC5, SGMII_FM1_DTSEC6, +		SGMII_FM1_DTSEC10, SGMII_FM1_DTSEC9, +		SGMII_FM1_DTSEC1, SGMII_FM1_DTSEC2, +		SGMII_FM1_DTSEC3, SGMII_FM1_DTSEC4} }, +	{38, {NONE, NONE, QSGMII_FM1_B, NONE, +		NONE, NONE, QSGMII_FM1_A, NONE} }, +	{} +}; +static const struct serdes_config serdes2_cfg_tbl[] = { +	/* SerDes 2 */ +	{7, {XAUI_FM2_MAC9, XAUI_FM2_MAC9, +		XAUI_FM2_MAC9, XAUI_FM2_MAC9, +		SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, +		SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, +	{13, {XAUI_FM2_MAC9, XAUI_FM2_MAC9, +		XAUI_FM2_MAC9, XAUI_FM2_MAC9, +		SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, +		SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, +	{16, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, +		HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, +		SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, +		SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, +	{22, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, +		HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, +		SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, +		SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, +	{25, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, +		HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, +		SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, +		SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, +	{26, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, +		HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, +		SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, +		NONE, NONE} }, +	{28, {SGMII_FM2_DTSEC5, SGMII_FM2_DTSEC6, +		SGMII_FM2_DTSEC10, SGMII_FM2_DTSEC9, +		SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, +		SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, +	{36, {SGMII_FM2_DTSEC5, SGMII_FM2_DTSEC6, +		SGMII_FM2_DTSEC10, SGMII_FM2_DTSEC9, +		SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, +		SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, +	{38, {NONE, NONE, QSGMII_FM2_B, NONE, +		NONE, QSGMII_FM1_A, NONE, NONE} }, +	{40, {SGMII_FM2_DTSEC5, SGMII_FM2_DTSEC6, +		SGMII_FM2_DTSEC10, SGMII_FM2_DTSEC9, +		NONE, QSGMII_FM1_A, NONE, NONE} }, +	{46, {SGMII_FM2_DTSEC5, SGMII_FM2_DTSEC6, +		SGMII_FM2_DTSEC10, SGMII_FM2_DTSEC9, +		NONE, QSGMII_FM1_A, NONE, NONE} }, +	{48, {SGMII_FM2_DTSEC5, SGMII_FM2_DTSEC6, +		SGMII_FM2_DTSEC10, SGMII_FM2_DTSEC9, +		NONE, QSGMII_FM1_A, NONE, NONE} }, +	{50, {XAUI_FM2_MAC9, XAUI_FM2_MAC9, +		XAUI_FM2_MAC9, XAUI_FM2_MAC9, +		NONE, NONE, NONE, NONE} }, +	{52, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, +		HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, +		NONE, NONE, NONE, NONE} }, +	{54, {HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, +		HIGIG_FM2_MAC9, HIGIG_FM2_MAC9, +		NONE, NONE, NONE, NONE} }, +	{56, {NONE, XFI_FM1_MAC10, +		XFI_FM2_MAC10, NONE, +		SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, +		SGMII_FM2_DTSEC3, SGMII_FM2_DTSEC4} }, +	{57, {NONE, XFI_FM1_MAC10, +		XFI_FM2_MAC10, NONE, +		SGMII_FM2_DTSEC1, SGMII_FM2_DTSEC2, +		NONE, NONE} }, +	{} +}; +static const struct serdes_config serdes3_cfg_tbl[] = { +	/* SerDes 3 */ +	{2, {PCIE1, PCIE1, PCIE1, PCIE1, PCIE1, PCIE1, PCIE1, PCIE1} }, +	{4, {PCIE1, PCIE1, PCIE1, PCIE1, PCIE2, PCIE2, PCIE2, PCIE2} }, +	{6, {PCIE1, PCIE1, PCIE1, PCIE1, SRIO1, SRIO1, SRIO1, SRIO1} }, +	{8, {PCIE1, PCIE1, PCIE1, PCIE1, SRIO1, NONE, NONE, NONE} }, +	{9, {INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN, +		INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN} }, +	{10, {INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN, +		INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN} }, +	{12, {INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN, +		PCIE2, PCIE2, PCIE2, PCIE2} }, +	{14, {INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN, +		PCIE2, PCIE2, PCIE2, PCIE2} }, +	{16, {INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN, +		SRIO1, SRIO1, SRIO1, SRIO1} }, +	{17, {INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN, +		SRIO1, SRIO1, SRIO1, SRIO1} }, +	{19, {INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN, +		SRIO1, SRIO1, SRIO1, SRIO1} }, +	{20, {INTERLAKEN, INTERLAKEN, INTERLAKEN, INTERLAKEN, +			NONE, NONE, NONE, NONE} }, +	{} +}; +static const struct serdes_config serdes4_cfg_tbl[] = { +	/* SerDes 4 */ +	{4, {PCIE3, PCIE3, PCIE3, PCIE3, PCIE4, PCIE4, PCIE4, PCIE4} }, +	{6, {SRIO2, SRIO2, SRIO2, SRIO2, SRIO2, SRIO2, SRIO2, SRIO2} }, +	{8, {SRIO2, SRIO2, SRIO2, SRIO2, SRIO2, SRIO2, SRIO2, SRIO2} }, +	{10, {PCIE3, PCIE3, PCIE3, PCIE3, SATA1, SATA1, SATA2, SATA2} }, +	{12, {AURORA, AURORA, AURORA, AURORA, SATA1, SATA1, SATA2, SATA2} }, +	{14, {AURORA, AURORA, AURORA, AURORA, SRIO2, SRIO2, SRIO2, SRIO2} }, +	{16, {AURORA, AURORA, AURORA, AURORA, SRIO2, SRIO2, SRIO2, SRIO2} }, +	{18, {AURORA, AURORA, AURORA, AURORA, AURORA, AURORA, AURORA, AURORA} }, +	{} +} +; +#else +#error "Need to define SerDes protocol" +#endif +static const struct serdes_config *serdes_cfg_tbl[] = {  	serdes1_cfg_tbl,  	serdes2_cfg_tbl,  	serdes3_cfg_tbl, @@ -196,7 +328,7 @@ static struct serdes_config *serdes_cfg_tbl[] = {  enum srds_prtcl serdes_get_prtcl(int serdes, int cfg, int lane)  { -	struct serdes_config *ptr; +	const struct serdes_config *ptr;  	if (serdes >= ARRAY_SIZE(serdes_cfg_tbl))  		return 0; @@ -213,7 +345,7 @@ enum srds_prtcl serdes_get_prtcl(int serdes, int cfg, int lane)  int is_serdes_prtcl_valid(int serdes, u32 prtcl)  {  	int i; -	struct serdes_config *ptr; +	const struct serdes_config *ptr;  	if (serdes >= ARRAY_SIZE(serdes_cfg_tbl))  		return 0; |