diff options
| author | Becky Bruce <beckyb@kernel.crashing.org> | 2010-06-17 11:37:26 -0500 | 
|---|---|---|
| committer | Kumar Gala <galak@kernel.crashing.org> | 2010-07-16 10:55:09 -0500 | 
| commit | f2d9a5da29eb539c2358615cad7f36e3450504fa (patch) | |
| tree | cdeb2f245589ae2ea72fc58b72e73ff5243b3c13 /arch/powerpc/cpu/mpc85xx | |
| parent | 199e262eb3c1b70553325c2010be0e28d9245460 (diff) | |
| download | olio-uboot-2014.01-f2d9a5da29eb539c2358615cad7f36e3450504fa.tar.xz olio-uboot-2014.01-f2d9a5da29eb539c2358615cad7f36e3450504fa.zip | |
powerpc 83xx/85xx: Merge lbc upmconfig code
Each platform had its own version of the upmconfig, despite the
init process being identical.  Now that we have a spot for common
lbc code, create a common upmconfig() there.
Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org>
Acked-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/cpu/mpc85xx')
| -rw-r--r-- | arch/powerpc/cpu/mpc85xx/cpu.c | 61 | 
1 files changed, 0 insertions, 61 deletions
| diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c b/arch/powerpc/cpu/mpc85xx/cpu.c index 790a6a4a4..fb8fa5ec5 100644 --- a/arch/powerpc/cpu/mpc85xx/cpu.c +++ b/arch/powerpc/cpu/mpc85xx/cpu.c @@ -252,67 +252,6 @@ reset_85xx_watchdog(void)  #endif	/* CONFIG_WATCHDOG */  /* - * Configures a UPM. The function requires the respective MxMR to be set - * before calling this function. "size" is the number or entries, not a sizeof. - */ -void upmconfig (uint upm, uint * table, uint size) -{ -	int i, mdr, mad, old_mad = 0; -	volatile u32 *mxmr; -	volatile fsl_lbc_t *lbc = LBC_BASE_ADDR; -	volatile u8* dummy = NULL; -	int upmmask; - -	switch (upm) { -	case UPMA: -		mxmr = &lbc->mamr; -		upmmask = BR_MS_UPMA; -		break; -	case UPMB: -		mxmr = &lbc->mbmr; -		upmmask = BR_MS_UPMB; -		break; -	case UPMC: -		mxmr = &lbc->mcmr; -		upmmask = BR_MS_UPMC; -		break; -	default: -		printf("%s: Bad UPM index %d to configure\n", __FUNCTION__, upm); -		hang(); -	} - -	/* Find the address for the dummy write transaction */ -	for (i = 0; i < 8; i++) { -		if ((get_lbc_br(i) & (BR_V | BR_MSEL)) == (BR_V | upmmask)) { -			dummy = (volatile u8 *)(get_lbc_br(i) & BR_BA); -			break; -		} -	} - -	if (i == 8) { -		printf("Error: %s() could not find matching BR\n", __FUNCTION__); -		hang(); -	} - -	for (i = 0; i < size; i++) { -		/* 1 */ -		out_be32(mxmr,  (in_be32(mxmr) & 0x4fffffc0) | MxMR_OP_WARR | i); -		/* 2 */ -		out_be32(&lbc->mdr, table[i]); -		/* 3 */ -		mdr = in_be32(&lbc->mdr); -		/* 4 */ -		*(volatile u8 *)dummy = 0; -		/* 5 */ -		do { -			mad = in_be32(mxmr) & MxMR_MAD_MSK; -		} while (mad <= old_mad && !(!mad && i == (size-1))); -		old_mad = mad; -	} -	out_be32(mxmr, (in_be32(mxmr) & 0x4fffffc0) | MxMR_OP_NORM); -} - -/*   * Initializes on-chip MMC controllers.   * to override, implement board_mmc_init()   */ |