[U-Boot] [PATCH] qe: fixup the snum for MPC8569 Rev2.0

Kumar Gala galak at kernel.crashing.org
Wed Jan 13 18:12:26 CET 2010


On Jan 12, 2010, at 4:05 AM, Liu Yu wrote:

> Since 1.0 and 2.0 use different snum table,
> we fixup the snum value according to SPRN_SVR.
> 
> Signed-off-by: Liu Yu <yu.liu at freescale.com>
> ---
> board/freescale/mpc8569mds/mpc8569mds.c |   13 +++++++++++++
> 1 files changed, 13 insertions(+), 0 deletions(-)
> 
> diff --git a/board/freescale/mpc8569mds/mpc8569mds.c b/board/freescale/mpc8569mds/mpc8569mds.c
> index cdd7813..db8ae5d 100644
> --- a/board/freescale/mpc8569mds/mpc8569mds.c
> +++ b/board/freescale/mpc8569mds/mpc8569mds.c
> @@ -510,6 +510,18 @@ static void fdt_board_fixup_qe_usb(void *blob, bd_t *bd)
> 	clrbits_8(&bcsr[17], BCSR17_nUSBEN);
> }
> 
> +static void fdt_board_fixup_qe_snum(void *blob, bd_t *bd)
> +{
> +	if (mfspr(SPRN_SVR) == 0x80880010) {


Can we change this to:
	svr = mfspr(SPRN_SVR);
	if (SVR_SOC_VER(svr) == SVR_8569) && IS_SVR_REV(svr, 1, 0))
...

to be much more readable and not have a magic number.	

> +		/* Rev1.0 uses snum 46 */
> +		do_fixup_by_compat_u32(blob, "fsl,qe",
> +			"fsl,qe-num-snums", 46, 1);
> +	} else {
> +		do_fixup_by_compat_u32(blob, "fsl,qe",
> +			"fsl,qe-num-snums", 76, 1);
> +	}
> +}
> +
> #ifdef CONFIG_PCIE1
> static struct pci_controller pcie1_hose;
> #endif  /* CONFIG_PCIE1 */
> @@ -654,5 +666,6 @@ void ft_board_setup(void *blob, bd_t *bd)
> 	fdt_board_fixup_esdhc(blob, bd);
> 	fdt_board_fixup_qe_uart(blob, bd);
> 	fdt_board_fixup_qe_usb(blob, bd);
> +	fdt_board_fixup_qe_snum(blob, bd);
> }
> #endif
> -- 

- k



More information about the U-Boot mailing list