diff options
Diffstat (limited to 'board')
184 files changed, 3319 insertions, 751 deletions
| diff --git a/board/a3m071/a3m071.c b/board/a3m071/a3m071.c index b96ba811fa2..ee1681b5db1 100644 --- a/board/a3m071/a3m071.c +++ b/board/a3m071/a3m071.c @@ -392,9 +392,11 @@ int misc_init_r(void)  }  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t * bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd); + +	return 0;  }  #endif /* defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP) */ diff --git a/board/a4m072/a4m072.c b/board/a4m072/a4m072.c index d3d4c181afa..c5d161bca3b 100644 --- a/board/a4m072/a4m072.c +++ b/board/a4m072/a4m072.c @@ -171,10 +171,11 @@ void pci_init_board(void)  #endif  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -void -ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd); + +	return 0;  }  #endif diff --git a/board/amcc/canyonlands/canyonlands.c b/board/amcc/canyonlands/canyonlands.c index 79d4babe067..c5cc4ffa690 100644 --- a/board/amcc/canyonlands/canyonlands.c +++ b/board/amcc/canyonlands/canyonlands.c @@ -490,9 +490,9 @@ int misc_init_r(void)  #endif	/* !defined(CONFIG_ARCHES) */  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -extern void __ft_board_setup(void *blob, bd_t *bd); +extern int __ft_board_setup(void *blob, bd_t *bd); -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	__ft_board_setup(blob, bd); @@ -515,5 +515,7 @@ void ft_board_setup(void *blob, bd_t *bd)  		fdt_find_and_setprop(blob, "/plb/sata@bffd1000", "status",  				     "disabled", sizeof("disabled"), 1);  	} + +	return 0;  }  #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */ diff --git a/board/amcc/sequoia/sequoia.c b/board/amcc/sequoia/sequoia.c index 53f9b3419fa..91c6cbf7aa8 100644 --- a/board/amcc/sequoia/sequoia.c +++ b/board/amcc/sequoia/sequoia.c @@ -10,6 +10,7 @@   */  #include <common.h> +#include <errno.h>  #include <libfdt.h>  #include <fdt_support.h>  #include <asm/ppc4xx.h> @@ -363,7 +364,7 @@ void board_pci_fixup_irq(struct pci_controller *hose, pci_dev_t dev)   * On NAND-booting sequoia, we need to patch the chips select numbers   * in the dtb (CS0 - NAND, CS3 - NOR)   */ -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	int rc;  	int len; @@ -381,15 +382,14 @@ void ft_board_setup(void *blob, bd_t *bd)  	prop = fdt_get_property_w(blob, nodeoffset, "reg", &len);  	if (prop == NULL) {  		printf("Unable to update NOR chip select for NAND booting\n"); -		return; +		return -FDT_ERR_NOTFOUND;  	}  	reg = (u32 *)&prop->data[0];  	reg[0] = 3;  	rc = fdt_find_and_setprop(blob, path, "reg", reg, 3 * sizeof(u32), 1);  	if (rc) { -		printf("Unable to update property NOR mappings, err=%s\n", -		       fdt_strerror(rc)); -		return; +		printf("Unable to update property NOR mappings\n"); +		return rc;  	}  	/* And now configure NAND chip select to 0 instead of 3 */ @@ -398,15 +398,16 @@ void ft_board_setup(void *blob, bd_t *bd)  	prop = fdt_get_property_w(blob, nodeoffset, "reg", &len);  	if (prop == NULL) {  		printf("Unable to update NDFC chip select for NAND booting\n"); -		return; +		return len;  	}  	reg = (u32 *)&prop->data[0];  	reg[0] = 0;  	rc = fdt_find_and_setprop(blob, path, "reg", reg, 3 * sizeof(u32), 1);  	if (rc) { -		printf("Unable to update property NDFC mappings, err=%s\n", -		       fdt_strerror(rc)); -		return; +		printf("Unable to update property NDFC mapping\n"); +		return rc;  	} + +	return 0;  }  #endif /* CONFIG_SYS_RAMBOOT */ diff --git a/board/bachmann/ot1200/ot1200.c b/board/bachmann/ot1200/ot1200.c index 007c1ef37d1..93f3d651764 100644 --- a/board/bachmann/ot1200/ot1200.c +++ b/board/bachmann/ot1200/ot1200.c @@ -173,7 +173,7 @@ struct fsl_esdhc_cfg usdhc_cfg[2] = {  int board_mmc_init(bd_t *bis)  { -	s32 status = 0; +	int ret;  	u32 index = 0;  	usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK); @@ -196,13 +196,15 @@ int board_mmc_init(bd_t *bis)  			printf("Warning: you configured more USDHC controllers"  				"(%d) then supported by the board (%d)\n",  				index + 1, CONFIG_SYS_FSL_USDHC_NUM); -			return status; +			return -EINVAL;  		} -		status |= fsl_esdhc_initialize(bis, &usdhc_cfg[index]); +		ret = fsl_esdhc_initialize(bis, &usdhc_cfg[index]); +		if (ret) +			return ret;  	} -	return status; +	return 0;  }  #define PC MUX_PAD_CTRL(I2C_PAD_CTRL) diff --git a/board/bluewater/snapper9260/MAINTAINERS b/board/bluewater/snapper9260/MAINTAINERS index ff1e9972cbd..1f8f4d6988f 100644 --- a/board/bluewater/snapper9260/MAINTAINERS +++ b/board/bluewater/snapper9260/MAINTAINERS @@ -1,5 +1,5 @@  SNAPPER9260 BOARD -M:	Ryan Mallon <ryan@bluewatersys.com> +M:	Simon Glass <sjg@chromium.org>  S:	Maintained  F:	board/bluewater/snapper9260/  F:	include/configs/snapper9260.h diff --git a/board/bluewater/snapper9260/snapper9260.c b/board/bluewater/snapper9260/snapper9260.c index bfde1291a59..95633b0d2e8 100644 --- a/board/bluewater/snapper9260/snapper9260.c +++ b/board/bluewater/snapper9260/snapper9260.c @@ -9,12 +9,15 @@   */  #include <common.h> +#include <dm.h>  #include <asm/io.h> +#include <asm/gpio.h>  #include <asm/arch/at91sam9260_matrix.h>  #include <asm/arch/at91sam9_smc.h>  #include <asm/arch/at91_common.h>  #include <asm/arch/at91_pmc.h>  #include <asm/arch/gpio.h> +#include <asm/arch/atmel_serial.h>  #include <net.h>  #include <netdev.h>  #include <i2c.h> @@ -95,10 +98,12 @@ static void nand_hw_init(void)  	       &smc->cs[3].mode);  	/* Configure RDY/BSY */ -	at91_set_gpio_input(CONFIG_SYS_NAND_READY_PIN, 1); +	gpio_request(CONFIG_SYS_NAND_READY_PIN, "nand_rdy"); +	gpio_direction_input(CONFIG_SYS_NAND_READY_PIN);  	/* Enable NandFlash */ -	at91_set_gpio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1); +	gpio_request(CONFIG_SYS_NAND_ENABLE_PIN, "nand_ce"); +	gpio_direction_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);  }  int board_init(void) @@ -140,3 +145,12 @@ int dram_init(void)  void reset_phy(void)  {  } + +static struct atmel_serial_platdata at91sam9260_serial_plat = { +	.base_addr = ATMEL_BASE_DBGU, +}; + +U_BOOT_DEVICE(at91sam9260_serial) = { +	.name	= "serial_atmel", +	.platdata = &at91sam9260_serial_plat, +}; diff --git a/board/boundary/nitrogen6x/nitrogen6x.c b/board/boundary/nitrogen6x/nitrogen6x.c index fcd4d82c4e7..e8ea256be0c 100644 --- a/board/boundary/nitrogen6x/nitrogen6x.c +++ b/board/boundary/nitrogen6x/nitrogen6x.c @@ -302,7 +302,7 @@ int board_mmc_getcd(struct mmc *mmc)  int board_mmc_init(bd_t *bis)  { -	s32 status = 0; +	int ret;  	u32 index = 0;  	usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK); @@ -325,13 +325,15 @@ int board_mmc_init(bd_t *bis)  		       printf("Warning: you configured more USDHC controllers"  			       "(%d) then supported by the board (%d)\n",  			       index + 1, CONFIG_SYS_FSL_USDHC_NUM); -		       return status; +		       return -EINVAL;  		} -		status |= fsl_esdhc_initialize(bis, &usdhc_cfg[index]); +		ret = fsl_esdhc_initialize(bis, &usdhc_cfg[index]); +		if (ret) +			return ret;  	} -	return status; +	return 0;  }  #endif diff --git a/board/broadcom/bcm11130/MAINTAINERS b/board/broadcom/bcm11130/MAINTAINERS new file mode 100644 index 00000000000..b22e86f6b1d --- /dev/null +++ b/board/broadcom/bcm11130/MAINTAINERS @@ -0,0 +1,6 @@ +BCM11130 BOARD +M:	Steve Rae <srae@broadcom.com> +S:	Maintained +F:	board/broadcom/bcm28155_ap/ +F:	include/configs/bcm_ep_board.h +F:	configs/bcm11130_defconfig diff --git a/board/broadcom/bcm11130_nand/MAINTAINERS b/board/broadcom/bcm11130_nand/MAINTAINERS new file mode 100644 index 00000000000..881db5bf789 --- /dev/null +++ b/board/broadcom/bcm11130_nand/MAINTAINERS @@ -0,0 +1,6 @@ +BCM11130_NAND BOARD +M:	Steve Rae <srae@broadcom.com> +S:	Maintained +F:	board/broadcom/bcm28155_ap/ +F:	include/configs/bcm_ep_board.h +F:	configs/bcm11130_nand_defconfig diff --git a/board/broadcom/bcm911360_entphn-ns/MAINTAINERS b/board/broadcom/bcm911360_entphn-ns/MAINTAINERS new file mode 100644 index 00000000000..b5f0207140d --- /dev/null +++ b/board/broadcom/bcm911360_entphn-ns/MAINTAINERS @@ -0,0 +1,6 @@ +BCM911360_ENTPHN-NS BOARD +M:	Steve Rae <srae@broadcom.com> +S:	Maintained +F:	board/broadcom/bcmcygnus/ +F:	include/configs/bcm_ep_board.h +F:	configs/bcm911360_entphn-ns_defconfig diff --git a/board/broadcom/bcm911360_entphn/MAINTAINERS b/board/broadcom/bcm911360_entphn/MAINTAINERS new file mode 100644 index 00000000000..fb7ee2bbc6e --- /dev/null +++ b/board/broadcom/bcm911360_entphn/MAINTAINERS @@ -0,0 +1,6 @@ +BCM911360_ENTPHN BOARD +M:	Steve Rae <srae@broadcom.com> +S:	Maintained +F:	board/broadcom/bcmcygnus/ +F:	include/configs/bcm_ep_board.h +F:	configs/bcm911360_entphn_defconfig diff --git a/board/broadcom/bcm911360k/MAINTAINERS b/board/broadcom/bcm911360k/MAINTAINERS new file mode 100644 index 00000000000..754a15f0c75 --- /dev/null +++ b/board/broadcom/bcm911360k/MAINTAINERS @@ -0,0 +1,6 @@ +BCM911360K BOARD +M:	Steve Rae <srae@broadcom.com> +S:	Maintained +F:	board/broadcom/bcmcygnus/ +F:	include/configs/bcm_ep_board.h +F:	configs/bcm911360k_defconfig diff --git a/board/broadcom/bcm958300k-ns/MAINTAINERS b/board/broadcom/bcm958300k-ns/MAINTAINERS new file mode 100644 index 00000000000..763401a3f1d --- /dev/null +++ b/board/broadcom/bcm958300k-ns/MAINTAINERS @@ -0,0 +1,6 @@ +BCM958300K-NS BOARD +M:	Steve Rae <srae@broadcom.com> +S:	Maintained +F:	board/broadcom/bcmcygnus/ +F:	include/configs/bcm_ep_board.h +F:	configs/bcm958300k-ns_defconfig diff --git a/board/broadcom/bcm958300k/MAINTAINERS b/board/broadcom/bcm958300k/MAINTAINERS index f75ee6e73c0..8afc728a25a 100644 --- a/board/broadcom/bcm958300k/MAINTAINERS +++ b/board/broadcom/bcm958300k/MAINTAINERS @@ -1,6 +1,6 @@ -Broadcom: Cygnus +BCM958300K BOARD  M:	Steve Rae <srae@broadcom.com>  S:	Maintained -F:	board/broadcom/bcm958300k/ +F:	board/broadcom/bcmcygnus/  F:	include/configs/bcm_ep_board.h  F:	configs/bcm958300k_defconfig diff --git a/board/broadcom/bcm958305k/MAINTAINERS b/board/broadcom/bcm958305k/MAINTAINERS new file mode 100644 index 00000000000..179fd4ee9e8 --- /dev/null +++ b/board/broadcom/bcm958305k/MAINTAINERS @@ -0,0 +1,6 @@ +BCM958305K BOARD +M:	Steve Rae <srae@broadcom.com> +S:	Maintained +F:	board/broadcom/bcmcygnus/ +F:	include/configs/bcm_ep_board.h +F:	configs/bcm958305k_defconfig diff --git a/board/broadcom/bcm958622hr/MAINTAINERS b/board/broadcom/bcm958622hr/MAINTAINERS index c34272f70db..d08aded83f2 100644 --- a/board/broadcom/bcm958622hr/MAINTAINERS +++ b/board/broadcom/bcm958622hr/MAINTAINERS @@ -1,6 +1,6 @@ -Broadcom: Northstar Plus +BCM958622HR BOARD  M:	Steve Rae <srae@broadcom.com>  S:	Maintained -F:	board/broadcom/bcm958622hr/ +F:	board/broadcom/bcmnsp/  F:	include/configs/bcm_ep_board.h  F:	configs/bcm958622hr_defconfig diff --git a/board/broadcom/bcm_ep/board.c b/board/broadcom/bcm_ep/board.c index e48cd3f7673..6a70a2e3056 100644 --- a/board/broadcom/bcm_ep/board.c +++ b/board/broadcom/bcm_ep/board.c @@ -53,3 +53,17 @@ int board_early_init_f(void)  	return status;  } + +#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT) +void smp_set_core_boot_addr(unsigned long addr, int corenr) +{ +} + +void smp_kick_all_cpus(void) +{ +} + +void smp_waitloop(unsigned previous_address) +{ +} +#endif diff --git a/board/broadcom/bcm958300k/Kconfig b/board/broadcom/bcmcygnus/Kconfig index 92892881afe..faba4cf82b1 100644 --- a/board/broadcom/bcm958300k/Kconfig +++ b/board/broadcom/bcmcygnus/Kconfig @@ -1,4 +1,4 @@ -if TARGET_BCM958300K +if TARGET_BCMCYGNUS  config SYS_BOARD  	default "bcm_ep" diff --git a/board/broadcom/bcm958622hr/Kconfig b/board/broadcom/bcmnsp/Kconfig index 861c55909bf..a975082355a 100644 --- a/board/broadcom/bcm958622hr/Kconfig +++ b/board/broadcom/bcmnsp/Kconfig @@ -1,4 +1,4 @@ -if TARGET_BCM958622HR +if TARGET_BCMNSP  config SYS_BOARD  	default "bcm_ep" diff --git a/board/cm5200/cm5200.c b/board/cm5200/cm5200.c index 048aa6c2e91..5276907b45c 100644 --- a/board/cm5200/cm5200.c +++ b/board/cm5200/cm5200.c @@ -359,9 +359,11 @@ int last_stage_init(void)  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd);  	ft_blob_update(blob, bd); + +	return 0;  }  #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */ diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c index 0206ae81fca..84e36439fa1 100644 --- a/board/compulab/cm_fx6/cm_fx6.c +++ b/board/compulab/cm_fx6/cm_fx6.c @@ -98,9 +98,6 @@ int sata_initialize(void)  	/* Make sure this gpio has logical 0 value */  	gpio_direction_output(CM_FX6_SATA_PWLOSS_INT, 0);  	udelay(100); - -	cm_fx6_sata_power(0); -	mdelay(250);  	cm_fx6_sata_power(1);  	for (i = 0; i < CM_FX6_SATA_INIT_RETRIES; i++) { @@ -125,6 +122,15 @@ int sata_initialize(void)  	return err;  } + +int sata_stop(void) +{ +	__sata_stop(); +	cm_fx6_sata_power(0); +	mdelay(250); + +	return 0; +}  #else  static int cm_fx6_setup_issd(void) { return 0; }  #endif @@ -452,7 +458,7 @@ int cm_fx6_setup_ecspi(void) { return 0; }  #endif  #ifdef CONFIG_OF_BOARD_SETUP -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	uint8_t enetaddr[6]; @@ -461,6 +467,8 @@ void ft_board_setup(void *blob, bd_t *bd)  		fdt_find_and_setprop(blob, "/fec", "local-mac-address",  				     enetaddr, 6, 1);  	} + +	return 0;  }  #endif diff --git a/board/compulab/cm_fx6/imximage.cfg b/board/compulab/cm_fx6/imximage.cfg deleted file mode 100644 index 420947e9ca7..00000000000 --- a/board/compulab/cm_fx6/imximage.cfg +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/ - * - * SPDX-License-Identifier:	GPL-2.0+ - */ - -IMAGE_VERSION 2 -BOOT_FROM	sd diff --git a/board/compulab/cm_t54/cm_t54.c b/board/compulab/cm_t54/cm_t54.c index b1a067d8816..2c2530ab3fd 100644 --- a/board/compulab/cm_t54/cm_t54.c +++ b/board/compulab/cm_t54/cm_t54.c @@ -121,7 +121,7 @@ int board_mmc_init(bd_t *bis)  #ifdef CONFIG_USB_HOST_ETHER -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	uint8_t enetaddr[6]; @@ -130,6 +130,8 @@ void ft_board_setup(void *blob, bd_t *bd)  		fdt_find_and_setprop(blob, "/smsc95xx@0", "mac-address",  				     enetaddr, 6, 1);  	} + +	return 0;  }  static void generate_mac_addr(uint8_t *enetaddr) diff --git a/board/chromebook-x86/coreboot/Kconfig b/board/coreboot/coreboot/Kconfig index 83385c7207d..6ca6cedf0d7 100644 --- a/board/chromebook-x86/coreboot/Kconfig +++ b/board/coreboot/coreboot/Kconfig @@ -4,7 +4,7 @@ config SYS_BOARD  	default "coreboot"  config SYS_VENDOR -	default "chromebook-x86" +	default "coreboot"  config SYS_SOC  	default "coreboot" diff --git a/board/chromebook-x86/coreboot/MAINTAINERS b/board/coreboot/coreboot/MAINTAINERS index 3b2fb52266d..6ce66f551f1 100644 --- a/board/chromebook-x86/coreboot/MAINTAINERS +++ b/board/coreboot/coreboot/MAINTAINERS @@ -1,6 +1,6 @@  COREBOOT BOARD  M:	Simon Glass <sjg@chromium.org>  S:	Maintained -F:	board/chromebook-x86/coreboot/ +F:	board/coreboot/coreboot/  F:	include/configs/coreboot.h  F:	configs/coreboot-x86_defconfig diff --git a/board/chromebook-x86/coreboot/Makefile b/board/coreboot/coreboot/Makefile index 27ebe78eb13..27ebe78eb13 100644 --- a/board/chromebook-x86/coreboot/Makefile +++ b/board/coreboot/coreboot/Makefile diff --git a/board/chromebook-x86/coreboot/coreboot.c b/board/coreboot/coreboot/coreboot.c index 0240c345810..0240c345810 100644 --- a/board/chromebook-x86/coreboot/coreboot.c +++ b/board/coreboot/coreboot/coreboot.c diff --git a/board/chromebook-x86/coreboot/coreboot_start.S b/board/coreboot/coreboot/coreboot_start.S index 932fe6c24bf..932fe6c24bf 100644 --- a/board/chromebook-x86/coreboot/coreboot_start.S +++ b/board/coreboot/coreboot/coreboot_start.S diff --git a/board/davedenx/aria/aria.c b/board/davedenx/aria/aria.c index c740669f33e..a15a9edac45 100644 --- a/board/davedenx/aria/aria.c +++ b/board/davedenx/aria/aria.c @@ -107,8 +107,10 @@ int checkboard (void)  }  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd); + +	return 0;  }  #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */ diff --git a/board/davinci/da8xxevm/u-boot-spl-hawk.lds b/board/davinci/da8xxevm/u-boot-spl-hawk.lds index 682f2685dc1..5c629db139b 100644 --- a/board/davinci/da8xxevm/u-boot-spl-hawk.lds +++ b/board/davinci/da8xxevm/u-boot-spl-hawk.lds @@ -20,7 +20,7 @@ SECTIONS  	{  	  *(.vectors)  	  arch/arm/cpu/arm926ejs/start.o		(.text*) -	  arch/arm/cpu/arm926ejs/davinci/built-in.o	(.text*) +	  arch/arm/cpu/arm926ejs/built-in.o		(.text*)  	  drivers/mtd/nand/built-in.o			(.text*)  	  *(.text*) diff --git a/board/embest/mx6boards/mx6boards.c b/board/embest/mx6boards/mx6boards.c index 02fb3fa1a41..f8c746824a7 100644 --- a/board/embest/mx6boards/mx6boards.c +++ b/board/embest/mx6boards/mx6boards.c @@ -216,7 +216,7 @@ int board_mmc_getcd(struct mmc *mmc)  int board_mmc_init(bd_t *bis)  { -	s32 status = 0; +	int ret;  	int i;  	/* @@ -268,13 +268,15 @@ int board_mmc_init(bd_t *bis)  			printf("Warning: you configured more USDHC controllers"  			       "(%d) then supported by the board (%d)\n",  			       i + 1, CONFIG_SYS_FSL_USDHC_NUM); -			return status; +			return -EINVAL;  		} -		status |= fsl_esdhc_initialize(bis, &usdhc_cfg[i]); +		ret = fsl_esdhc_initialize(bis, &usdhc_cfg[i]); +		if (ret) +			return ret;  	} -	return status; +	return 0;  }  #endif diff --git a/board/esd/common/auto_update.c b/board/esd/common/auto_update.c index b1680741e16..f3f70ffbad8 100644 --- a/board/esd/common/auto_update.c +++ b/board/esd/common/auto_update.c @@ -12,6 +12,7 @@  #include <image.h>  #include <asm/byteorder.h>  #include <fat.h> +#include <flash.h>  #include <part.h>  #include "auto_update.h" @@ -30,14 +31,8 @@ extern int N_AU_IMAGES;  #define MAX_LOADSZ 0x1c00000  /* externals */ -extern int fat_register_device(block_dev_desc_t *, int); -extern int file_fat_detectfs(void); -extern long file_fat_read(const char *, void *, unsigned long);  long do_fat_read (const char *filename, void *buffer,  		  unsigned long maxsize, int dols); -extern int flash_sect_erase(ulong, ulong); -extern int flash_sect_protect (int, ulong, ulong); -extern int flash_write (char *, ulong, ulong);  extern block_dev_desc_t ide_dev_desc[CONFIG_SYS_IDE_MAXDEVICE]; diff --git a/board/esd/cpci405/cpci405.c b/board/esd/cpci405/cpci405.c index 63cd862d2d2..e23ec55f2bb 100644 --- a/board/esd/cpci405/cpci405.c +++ b/board/esd/cpci405/cpci405.c @@ -508,7 +508,7 @@ int pci_pre_init(struct pci_controller *hose)  #endif /* defined(CONFIG_PCI) */  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	int rc; @@ -526,6 +526,8 @@ void ft_board_setup(void *blob, bd_t *bd)  			       fdt_strerror(rc));  		}  	} + +	return 0;  }  #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */ diff --git a/board/esd/mecp5123/mecp5123.c b/board/esd/mecp5123/mecp5123.c index 97006116f4e..cda1d7bccc5 100644 --- a/board/esd/mecp5123/mecp5123.c +++ b/board/esd/mecp5123/mecp5123.c @@ -199,8 +199,10 @@ int checkboard(void)  }  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd); + +	return 0;  }  #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */ diff --git a/board/esd/pmc405de/pmc405de.c b/board/esd/pmc405de/pmc405de.c index 4409ea6524f..3e1713247d3 100644 --- a/board/esd/pmc405de/pmc405de.c +++ b/board/esd/pmc405de/pmc405de.c @@ -300,7 +300,7 @@ int pci_pre_init(struct pci_controller *hose)  }  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	int rc; @@ -318,6 +318,8 @@ void ft_board_setup(void *blob, bd_t *bd)  			       fdt_strerror(rc));  		}  	} + +	return 0;  }  #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */ diff --git a/board/esd/pmc440/pmc440.c b/board/esd/pmc440/pmc440.c index 062ae672761..15c3151b842 100644 --- a/board/esd/pmc440/pmc440.c +++ b/board/esd/pmc440/pmc440.c @@ -882,7 +882,7 @@ int board_usb_cleanup(int index, enum usb_init_type init)  #endif /* defined(CONFIG_USB_OHCI) && defined(CONFIG_SYS_USB_OHCI_BOARD_INIT) */  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	int rc; @@ -899,5 +899,7 @@ void ft_board_setup(void *blob, bd_t *bd)  			printf("err=%s\n", fdt_strerror(rc));  		}  	} + +	return 0;  }  #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */ diff --git a/board/esd/vme8349/vme8349.c b/board/esd/vme8349/vme8349.c index 01365dcbd3a..f8f1834b59c 100644 --- a/board/esd/vme8349/vme8349.c +++ b/board/esd/vme8349/vme8349.c @@ -74,13 +74,15 @@ int board_eth_init(bd_t *bis)  #endif  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd);  #ifdef CONFIG_PCI  	ft_pci_setup(blob, bd);  #endif + +	return 0;  }  #endif diff --git a/board/freescale/b4860qds/b4860qds.c b/board/freescale/b4860qds/b4860qds.c index 34d66d5fd2d..bed8f56be43 100644 --- a/board/freescale/b4860qds/b4860qds.c +++ b/board/freescale/b4860qds/b4860qds.c @@ -1110,7 +1110,7 @@ int misc_init_r(void)  	return 0;  } -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	phys_addr_t base;  	phys_size_t size; @@ -1136,6 +1136,8 @@ void ft_board_setup(void *blob, bd_t *bd)  	fdt_fixup_fman_ethernet(blob);  	fdt_fixup_board_enet(blob);  #endif + +	return 0;  }  /* diff --git a/board/freescale/bsc9131rdb/bsc9131rdb.c b/board/freescale/bsc9131rdb/bsc9131rdb.c index 9146f492626..75e114217b6 100644 --- a/board/freescale/bsc9131rdb/bsc9131rdb.c +++ b/board/freescale/bsc9131rdb/bsc9131rdb.c @@ -58,7 +58,7 @@ struct node_info nodes[] = {  	{ "fsl,ifc-nand",		MTD_DEV_TYPE_NAND, },  };  #endif -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	phys_addr_t base;  	phys_size_t size; @@ -74,5 +74,7 @@ void ft_board_setup(void *blob, bd_t *bd)  #endif  	fdt_fixup_dr_usb(blob, bd); + +	return 0;  }  #endif diff --git a/board/freescale/bsc9132qds/bsc9132qds.c b/board/freescale/bsc9132qds/bsc9132qds.c index c88838b3dfa..36a68dbc4db 100644 --- a/board/freescale/bsc9132qds/bsc9132qds.c +++ b/board/freescale/bsc9132qds/bsc9132qds.c @@ -363,7 +363,7 @@ struct node_info nodes[] = {  	{ "fsl,ifc-nand",		MTD_DEV_TYPE_NAND, },  };  #endif -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	phys_addr_t base;  	phys_size_t size; @@ -423,5 +423,7 @@ void ft_board_setup(void *blob, bd_t *bd)  			printf("\nRemove sim from hwconfig and reset\n");  		}  	} + +	return 0;  }  #endif diff --git a/board/freescale/c29xpcie/c29xpcie.c b/board/freescale/c29xpcie/c29xpcie.c index 534c6d11b05..d75770969b1 100644 --- a/board/freescale/c29xpcie/c29xpcie.c +++ b/board/freescale/c29xpcie/c29xpcie.c @@ -128,7 +128,7 @@ void fdt_del_sec(void *blob, int offset)  	}  } -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	phys_addr_t base;  	phys_size_t size; @@ -150,5 +150,7 @@ void ft_board_setup(void *blob, bd_t *bd)  		fdt_del_sec(blob, 1);  	else if (cpu->soc_ver == SVR_C292)  		fdt_del_sec(blob, 2); + +	return 0;  }  #endif diff --git a/board/freescale/common/Makefile b/board/freescale/common/Makefile index 32b5a3b70ce..25a1bc1a0f5 100644 --- a/board/freescale/common/Makefile +++ b/board/freescale/common/Makefile @@ -53,6 +53,7 @@ obj-$(CONFIG_P5040DS)		+= ics307_clk.o  obj-$(CONFIG_VSC_CROSSBAR)    += vsc3316_3308.o  obj-$(CONFIG_IDT8T49N222A)	+= idt8t49n222a_serdes_clk.o  obj-$(CONFIG_ZM7300)		+= zm7300.o +obj-$(CONFIG_POWER_PFUZE100)	+= pfuze.o  # deal with common files for P-series corenet based devices  obj-$(CONFIG_P2041RDB)	+= p_corenet/ diff --git a/board/freescale/common/cds_pci_ft.c b/board/freescale/common/cds_pci_ft.c index 2e5dcdf0e28..571dfbbaada 100644 --- a/board/freescale/common/cds_pci_ft.c +++ b/board/freescale/common/cds_pci_ft.c @@ -63,13 +63,14 @@ static void cds_pci_fixup(void *blob)  	}  } -void -ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd);  #ifdef CONFIG_PCI  	ft_pci_setup(blob, bd);  	cds_pci_fixup(blob);  #endif + +	return 0;  }  #endif diff --git a/board/freescale/common/pfuze.c b/board/freescale/common/pfuze.c new file mode 100644 index 00000000000..2cd17944298 --- /dev/null +++ b/board/freescale/common/pfuze.c @@ -0,0 +1,54 @@ +/* + * Copyright 2014 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier:	GPL-2.0+ + */ + +#include <common.h> +#include <power/pmic.h> +#include <power/pfuze100_pmic.h> + +struct pmic *pfuze_common_init(unsigned char i2cbus) +{ +	struct pmic *p; +	int ret; +	unsigned int reg; + +	ret = power_pfuze100_init(i2cbus); +	if (ret) +		return NULL; + +	p = pmic_get("PFUZE100"); +	ret = pmic_probe(p); +	if (ret) +		return NULL; + +	pmic_reg_read(p, PFUZE100_DEVICEID, ®); +	printf("PMIC:  PFUZE100 ID=0x%02x\n", reg); + +	/* Set SW1AB stanby volage to 0.975V */ +	pmic_reg_read(p, PFUZE100_SW1ABSTBY, ®); +	reg &= ~SW1x_STBY_MASK; +	reg |= SW1x_0_975V; +	pmic_reg_write(p, PFUZE100_SW1ABSTBY, reg); + +	/* Set SW1AB/VDDARM step ramp up time from 16us to 4us/25mV */ +	pmic_reg_read(p, PUZE_100_SW1ABCONF, ®); +	reg &= ~SW1xCONF_DVSSPEED_MASK; +	reg |= SW1xCONF_DVSSPEED_4US; +	pmic_reg_write(p, PUZE_100_SW1ABCONF, reg); + +	/* Set SW1C standby voltage to 0.975V */ +	pmic_reg_read(p, PFUZE100_SW1CSTBY, ®); +	reg &= ~SW1x_STBY_MASK; +	reg |= SW1x_0_975V; +	pmic_reg_write(p, PFUZE100_SW1CSTBY, reg); + +	/* Set SW1C/VDDSOC step ramp up time from 16us to 4us/25mV */ +	pmic_reg_read(p, PFUZE100_SW1CCONF, ®); +	reg &= ~SW1xCONF_DVSSPEED_MASK; +	reg |= SW1xCONF_DVSSPEED_4US; +	pmic_reg_write(p, PFUZE100_SW1CCONF, reg); + +	return p; +} diff --git a/board/freescale/common/pfuze.h b/board/freescale/common/pfuze.h new file mode 100644 index 00000000000..7a4126cca01 --- /dev/null +++ b/board/freescale/common/pfuze.h @@ -0,0 +1,12 @@ +/* + * Copyright 2014 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier:	GPL-2.0+ + */ + +#ifndef __PFUZE_BOARD_HELPER__ +#define __PFUZE_BOARD_HELPER__ + +struct pmic *pfuze_common_init(unsigned char i2cbus); + +#endif diff --git a/board/freescale/common/sys_eeprom.c b/board/freescale/common/sys_eeprom.c index 3426b8ada36..5cb7570c8b8 100644 --- a/board/freescale/common/sys_eeprom.c +++ b/board/freescale/common/sys_eeprom.c @@ -114,7 +114,7 @@ static void show_eeprom(void)  		e.date[3] & 0x80 ? "PM" : "");  	/* Show MAC addresses  */ -	for (i = 0; i < min(e.mac_count, MAX_NUM_PORTS); i++) { +	for (i = 0; i < min(e.mac_count, (u8)MAX_NUM_PORTS); i++) {  		u8 *p = e.mac[i]; @@ -223,7 +223,7 @@ static int prog_eeprom(void)  	 */  	for (i = 0, p = &e; i < sizeof(e); i += 8, p += 8) {  		ret = i2c_write(CONFIG_SYS_I2C_EEPROM_ADDR, i, CONFIG_SYS_I2C_EEPROM_ADDR_LEN, -			p, min((sizeof(e) - i), 8)); +				p, min((int)(sizeof(e) - i), 8));  		if (ret)  			break;  		udelay(5000);	/* 5ms write cycle timing */ @@ -461,7 +461,7 @@ int mac_read_from_eeprom(void)  		memset(e.mac[8], 0xff, 6);  #endif -	for (i = 0; i < min(e.mac_count, MAX_NUM_PORTS); i++) { +	for (i = 0; i < min(e.mac_count, (u8)MAX_NUM_PORTS); i++) {  		if (memcmp(&e.mac[i], "\0\0\0\0\0\0", 6) &&  		    memcmp(&e.mac[i], "\xFF\xFF\xFF\xFF\xFF\xFF", 6)) {  			char ethaddr[18]; diff --git a/board/freescale/corenet_ds/corenet_ds.c b/board/freescale/corenet_ds/corenet_ds.c index 65b386741e1..6f0fea1a356 100644 --- a/board/freescale/corenet_ds/corenet_ds.c +++ b/board/freescale/corenet_ds/corenet_ds.c @@ -190,7 +190,7 @@ int misc_init_r(void)  	return 0;  } -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	phys_addr_t base;  	phys_size_t size; @@ -213,4 +213,6 @@ void ft_board_setup(void *blob, bd_t *bd)  	fdt_fixup_fman_ethernet(blob);  	fdt_fixup_board_enet(blob);  #endif + +	return 0;  } diff --git a/board/freescale/ls1021aqds/ls1021aqds.c b/board/freescale/ls1021aqds/ls1021aqds.c index d64b24c417e..0a7720a001c 100644 --- a/board/freescale/ls1021aqds/ls1021aqds.c +++ b/board/freescale/ls1021aqds/ls1021aqds.c @@ -254,9 +254,11 @@ int board_init(void)  	return 0;  } -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd); + +	return 0;  }  u8 flash_read8(void *addr) diff --git a/board/freescale/ls1021atwr/ls1021atwr.c b/board/freescale/ls1021atwr/ls1021atwr.c index 3f2dc1acadb..3e8c37b05d4 100644 --- a/board/freescale/ls1021atwr/ls1021atwr.c +++ b/board/freescale/ls1021atwr/ls1021atwr.c @@ -303,9 +303,11 @@ int misc_init_r(void)  }  #endif -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd); + +	return 0;  }  u8 flash_read8(void *addr) diff --git a/board/freescale/ls2085a/ls2085a.c b/board/freescale/ls2085a/ls2085a.c index 2c79a7181ec..163a4c486a6 100644 --- a/board/freescale/ls2085a/ls2085a.c +++ b/board/freescale/ls2085a/ls2085a.c @@ -100,7 +100,7 @@ void fdt_fixup_board_enet(void *fdt)  #endif  #ifdef CONFIG_OF_BOARD_SETUP -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	phys_addr_t base;  	phys_size_t size; @@ -115,5 +115,7 @@ void ft_board_setup(void *blob, bd_t *bd)  #ifdef CONFIG_FSL_MC_ENET  	fdt_fixup_board_enet(blob);  #endif + +	return 0;  }  #endif diff --git a/board/freescale/mpc5121ads/mpc5121ads.c b/board/freescale/mpc5121ads/mpc5121ads.c index 940978e649e..40bd55dfba6 100644 --- a/board/freescale/mpc5121ads/mpc5121ads.c +++ b/board/freescale/mpc5121ads/mpc5121ads.c @@ -275,8 +275,10 @@ int checkboard (void)  }  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd); + +	return 0;  }  #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */ diff --git a/board/freescale/mpc7448hpc2/mpc7448hpc2.c b/board/freescale/mpc7448hpc2/mpc7448hpc2.c index 71b760c4a98..11747ca4a4e 100644 --- a/board/freescale/mpc7448hpc2/mpc7448hpc2.c +++ b/board/freescale/mpc7448hpc2/mpc7448hpc2.c @@ -70,11 +70,12 @@ phys_size_t initdram (int board_type)  }  #if defined(CONFIG_OF_BOARD_SETUP) -void -ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd);  	fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize); + +	return 0;  }  #endif diff --git a/board/freescale/mpc8308rdb/mpc8308rdb.c b/board/freescale/mpc8308rdb/mpc8308rdb.c index fba41fe504a..93e1c50f393 100644 --- a/board/freescale/mpc8308rdb/mpc8308rdb.c +++ b/board/freescale/mpc8308rdb/mpc8308rdb.c @@ -161,11 +161,13 @@ int misc_init_r(void)  	return 0;  }  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd);  	fdt_fixup_dr_usb(blob, bd);  	fdt_fixup_esdhc(blob, bd); + +	return 0;  }  #endif diff --git a/board/freescale/mpc8313erdb/mpc8313erdb.c b/board/freescale/mpc8313erdb/mpc8313erdb.c index 69e98a50074..eac193e8177 100644 --- a/board/freescale/mpc8313erdb/mpc8313erdb.c +++ b/board/freescale/mpc8313erdb/mpc8313erdb.c @@ -116,12 +116,14 @@ int misc_init_r(void)  }  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd);  #ifdef CONFIG_PCI  	ft_pci_setup(blob, bd);  #endif + +	return 0;  }  #endif  #else /* CONFIG_SPL_BUILD */ diff --git a/board/freescale/mpc8315erdb/mpc8315erdb.c b/board/freescale/mpc8315erdb/mpc8315erdb.c index e6f091fd2f4..ed611c56c3f 100644 --- a/board/freescale/mpc8315erdb/mpc8315erdb.c +++ b/board/freescale/mpc8315erdb/mpc8315erdb.c @@ -188,7 +188,7 @@ void fdt_tsec1_fixup(void *fdt, bd_t *bd)  	do_fixup_by_path(fdt, path, "status", disabled, sizeof(disabled), 1);  } -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd);  #ifdef CONFIG_PCI @@ -196,6 +196,8 @@ void ft_board_setup(void *blob, bd_t *bd)  #endif  	fdt_fixup_dr_usb(blob, bd);  	fdt_tsec1_fixup(blob, bd); + +	return 0;  }  #endif diff --git a/board/freescale/mpc8323erdb/mpc8323erdb.c b/board/freescale/mpc8323erdb/mpc8323erdb.c index 3dce3623a41..0a0152ad9ea 100644 --- a/board/freescale/mpc8323erdb/mpc8323erdb.c +++ b/board/freescale/mpc8323erdb/mpc8323erdb.c @@ -172,12 +172,14 @@ void pci_init_board(void)  }  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd);  #ifdef CONFIG_PCI  	ft_pci_setup(blob, bd);  #endif + +	return 0;  }  #endif diff --git a/board/freescale/mpc832xemds/mpc832xemds.c b/board/freescale/mpc832xemds/mpc832xemds.c index b7ea0e44c39..adf425486e1 100644 --- a/board/freescale/mpc832xemds/mpc832xemds.c +++ b/board/freescale/mpc832xemds/mpc832xemds.c @@ -154,11 +154,13 @@ int checkboard(void)  }  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd);  #ifdef CONFIG_PCI  	ft_pci_setup(blob, bd);  #endif + +	return 0;  }  #endif diff --git a/board/freescale/mpc8349emds/mpc8349emds.c b/board/freescale/mpc8349emds/mpc8349emds.c index d9092201aa5..02b5040ef4a 100644 --- a/board/freescale/mpc8349emds/mpc8349emds.c +++ b/board/freescale/mpc8349emds/mpc8349emds.c @@ -273,11 +273,13 @@ void spi_cs_deactivate(struct spi_slave *slave)  #endif /* CONFIG_HARD_SPI */  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd);  #ifdef CONFIG_PCI  	ft_pci_setup(blob, bd);  #endif + +	return 0;  }  #endif diff --git a/board/freescale/mpc8349itx/mpc8349itx.c b/board/freescale/mpc8349itx/mpc8349itx.c index 803d7228060..22a1d99c884 100644 --- a/board/freescale/mpc8349itx/mpc8349itx.c +++ b/board/freescale/mpc8349itx/mpc8349itx.c @@ -378,11 +378,13 @@ int misc_init_r(void)  }  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd);  #ifdef CONFIG_PCI  	ft_pci_setup(blob, bd);  #endif + +	return 0;  }  #endif diff --git a/board/freescale/mpc8360emds/mpc8360emds.c b/board/freescale/mpc8360emds/mpc8360emds.c index 5ff9dff5870..f0a55f8a8d8 100644 --- a/board/freescale/mpc8360emds/mpc8360emds.c +++ b/board/freescale/mpc8360emds/mpc8360emds.c @@ -402,7 +402,7 @@ static void ft_board_fixup_qe_usb(void *blob, bd_t *bd)  			   "peripheral", sizeof("peripheral"), 1);  } -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd);  #ifdef CONFIG_PCI @@ -447,5 +447,7 @@ void ft_board_setup(void *blob, bd_t *bd)  #endif  		}  	} + +	return 0;  }  #endif diff --git a/board/freescale/mpc8360erdk/mpc8360erdk.c b/board/freescale/mpc8360erdk/mpc8360erdk.c index fef230bfbd5..478f8205a9c 100644 --- a/board/freescale/mpc8360erdk/mpc8360erdk.c +++ b/board/freescale/mpc8360erdk/mpc8360erdk.c @@ -340,9 +340,11 @@ void pci_init_board(void)  }  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd);  	ft_pci_setup(blob, bd); + +	return 0;  }  #endif diff --git a/board/freescale/mpc837xemds/mpc837xemds.c b/board/freescale/mpc837xemds/mpc837xemds.c index c749e5553a7..572913c7ac5 100644 --- a/board/freescale/mpc837xemds/mpc837xemds.c +++ b/board/freescale/mpc837xemds/mpc837xemds.c @@ -328,7 +328,7 @@ static void ft_pci_fixup(void *blob, bd_t *bd)  #endif  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd);  	ft_tsec_fixup(blob, bd); @@ -340,5 +340,7 @@ void ft_board_setup(void *blob, bd_t *bd)  		ft_pci_fixup(blob, bd);  	ft_pcie_fixup(blob, bd);  #endif + +	return 0;  }  #endif /* CONFIG_OF_BOARD_SETUP */ diff --git a/board/freescale/mpc837xerdb/mpc837xerdb.c b/board/freescale/mpc837xerdb/mpc837xerdb.c index 9afdcaf7aef..e0a10313808 100644 --- a/board/freescale/mpc837xerdb/mpc837xerdb.c +++ b/board/freescale/mpc837xerdb/mpc837xerdb.c @@ -199,7 +199,7 @@ int misc_init_r(void)  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  #ifdef CONFIG_PCI  	ft_pci_setup(blob, bd); @@ -207,5 +207,7 @@ void ft_board_setup(void *blob, bd_t *bd)  	ft_cpu_setup(blob, bd);  	fdt_fixup_dr_usb(blob, bd);  	fdt_fixup_esdhc(blob, bd); + +	return 0;  }  #endif /* CONFIG_OF_BOARD_SETUP */ diff --git a/board/freescale/mpc8536ds/mpc8536ds.c b/board/freescale/mpc8536ds/mpc8536ds.c index 93eed59b1a9..7b0f4619714 100644 --- a/board/freescale/mpc8536ds/mpc8536ds.c +++ b/board/freescale/mpc8536ds/mpc8536ds.c @@ -271,7 +271,7 @@ int board_eth_init(bd_t *bis)  }  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd); @@ -285,5 +285,6 @@ void ft_board_setup(void *blob, bd_t *bd)  	fdt_fixup_dr_usb(blob, bd);  #endif +	return 0;  }  #endif diff --git a/board/freescale/mpc8540ads/mpc8540ads.c b/board/freescale/mpc8540ads/mpc8540ads.c index 93288c7e9ce..1069e2c8c86 100644 --- a/board/freescale/mpc8540ads/mpc8540ads.c +++ b/board/freescale/mpc8540ads/mpc8540ads.c @@ -218,8 +218,7 @@ pci_init_board(void)  #if defined(CONFIG_OF_BOARD_SETUP) -void -ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	int node, tmp[2];  	const char *path; @@ -237,5 +236,7 @@ ft_board_setup(void *blob, bd_t *bd)  		}  #endif  	} + +	return 0;  }  #endif diff --git a/board/freescale/mpc8544ds/mpc8544ds.c b/board/freescale/mpc8544ds/mpc8544ds.c index 1b33db6f314..66fb228a908 100644 --- a/board/freescale/mpc8544ds/mpc8544ds.c +++ b/board/freescale/mpc8544ds/mpc8544ds.c @@ -305,7 +305,7 @@ int board_eth_init(bd_t *bis)  }  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd); @@ -314,5 +314,7 @@ void ft_board_setup(void *blob, bd_t *bd)  #ifdef CONFIG_FSL_SGMII_RISER  	fsl_sgmii_riser_fdt_fixup(blob);  #endif + +	return 0;  }  #endif diff --git a/board/freescale/mpc8560ads/mpc8560ads.c b/board/freescale/mpc8560ads/mpc8560ads.c index 7104e33156e..f99d639b2fb 100644 --- a/board/freescale/mpc8560ads/mpc8560ads.c +++ b/board/freescale/mpc8560ads/mpc8560ads.c @@ -438,8 +438,7 @@ pci_init_board(void)  #if defined(CONFIG_OF_BOARD_SETUP) -void -ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	int node, tmp[2];  	const char *path; @@ -457,5 +456,7 @@ ft_board_setup(void *blob, bd_t *bd)  		}  #endif  	} + +	return 0;  }  #endif diff --git a/board/freescale/mpc8568mds/mpc8568mds.c b/board/freescale/mpc8568mds/mpc8568mds.c index a8fdcb5f917..a5c5d9dd1ac 100644 --- a/board/freescale/mpc8568mds/mpc8568mds.c +++ b/board/freescale/mpc8568mds/mpc8568mds.c @@ -345,10 +345,12 @@ void pci_init_board(void)  #endif /* CONFIG_PCI */  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd);  	FT_FSL_PCI_SETUP; + +	return 0;  }  #endif diff --git a/board/freescale/mpc8569mds/mpc8569mds.c b/board/freescale/mpc8569mds/mpc8569mds.c index cb55e1c98c0..836578f3cb8 100644 --- a/board/freescale/mpc8569mds/mpc8569mds.c +++ b/board/freescale/mpc8569mds/mpc8569mds.c @@ -514,7 +514,7 @@ void pci_init_board(void)  #endif /* CONFIG_PCI */  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  #if defined(CONFIG_SYS_UCC_RMII_MODE)  	int nodeoff, off, err; @@ -579,5 +579,7 @@ 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); + +	return 0;  }  #endif diff --git a/board/freescale/mpc8572ds/mpc8572ds.c b/board/freescale/mpc8572ds/mpc8572ds.c index 1bbf8321487..3f68cf496a4 100644 --- a/board/freescale/mpc8572ds/mpc8572ds.c +++ b/board/freescale/mpc8572ds/mpc8572ds.c @@ -232,7 +232,7 @@ int board_eth_init(bd_t *bis)  #endif  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	phys_addr_t base;  	phys_size_t size; @@ -249,5 +249,7 @@ void ft_board_setup(void *blob, bd_t *bd)  #ifdef CONFIG_FSL_SGMII_RISER  	fsl_sgmii_riser_fdt_fixup(blob);  #endif + +	return 0;  }  #endif diff --git a/board/freescale/mpc8610hpcd/mpc8610hpcd.c b/board/freescale/mpc8610hpcd/mpc8610hpcd.c index d8740ddaccf..95e398c9f49 100644 --- a/board/freescale/mpc8610hpcd/mpc8610hpcd.c +++ b/board/freescale/mpc8610hpcd/mpc8610hpcd.c @@ -258,12 +258,13 @@ void pci_init_board(void)  }  #if defined(CONFIG_OF_BOARD_SETUP) -void -ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd);  	FT_FSL_PCI_SETUP; + +	return 0;  }  #endif diff --git a/board/freescale/mpc8641hpcn/mpc8641hpcn.c b/board/freescale/mpc8641hpcn/mpc8641hpcn.c index a58b5f9cd4b..94633b5c99d 100644 --- a/board/freescale/mpc8641hpcn/mpc8641hpcn.c +++ b/board/freescale/mpc8641hpcn/mpc8641hpcn.c @@ -119,12 +119,11 @@ void pci_init_board(void)  #if defined(CONFIG_OF_BOARD_SETUP) -void -ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	int off;  	u64 *tmp; -	u32 *addrcells; +	int addrcells;  	ft_cpu_setup(blob, bd); @@ -136,12 +135,13 @@ ft_board_setup(void *blob, bd_t *bd)  	 * which is defined by the "reg" property in the soc node.  	 */  	off = fdt_path_offset(blob, "/soc8641"); -	addrcells = (u32 *)fdt_getprop(blob, 0, "#address-cells", NULL); +	addrcells = fdt_address_cells(blob, 0);  	tmp = (u64 *)fdt_getprop(blob, off, "reg", NULL);  	if (tmp) {  		u64 addr; -		if (addrcells && (*addrcells == 1)) + +		if (addrcells == 1)  			addr = *(u32 *)tmp;  		else  			addr = *tmp; @@ -152,6 +152,8 @@ ft_board_setup(void *blob, bd_t *bd)  			       "in u-boot.  This means your .dts might "  			       "be old.\n");  	} + +	return 0;  }  #endif diff --git a/board/freescale/mx51evk/mx51evk.c b/board/freescale/mx51evk/mx51evk.c index 9b43c84e791..f1e5eb433a3 100644 --- a/board/freescale/mx51evk/mx51evk.c +++ b/board/freescale/mx51evk/mx51evk.c @@ -320,7 +320,7 @@ int board_mmc_init(bd_t *bis)  	};  	u32 index; -	s32 status = 0; +	int ret;  	esdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK);  	esdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK); @@ -340,11 +340,13 @@ int board_mmc_init(bd_t *bis)  			printf("Warning: you configured more ESDHC controller"  				"(%d) as supported by the board(2)\n",  				CONFIG_SYS_FSL_ESDHC_NUM); -			return status; +			return -EINVAL;  		} -		status |= fsl_esdhc_initialize(bis, &esdhc_cfg[index]); +		ret = fsl_esdhc_initialize(bis, &esdhc_cfg[index]); +		if (ret) +			return ret;  	} -	return status; +	return 0;  }  #endif diff --git a/board/freescale/mx53ard/mx53ard.c b/board/freescale/mx53ard/mx53ard.c index c960c44a618..8ba27288e31 100644 --- a/board/freescale/mx53ard/mx53ard.c +++ b/board/freescale/mx53ard/mx53ard.c @@ -166,7 +166,7 @@ int board_mmc_init(bd_t *bis)  	};  	u32 index; -	s32 status = 0; +	int ret;  	esdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK);  	esdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK); @@ -185,12 +185,14 @@ int board_mmc_init(bd_t *bis)  			printf("Warning: you configured more ESDHC controller"  				"(%d) as supported by the board(2)\n",  				CONFIG_SYS_FSL_ESDHC_NUM); -			return status; +			return -EINVAL;  		} -		status |= fsl_esdhc_initialize(bis, &esdhc_cfg[index]); +		ret = fsl_esdhc_initialize(bis, &esdhc_cfg[index]); +		if (ret) +			return ret;  	} -	return status; +	return 0;  }  #endif diff --git a/board/freescale/mx53evk/mx53evk.c b/board/freescale/mx53evk/mx53evk.c index 13519e26da2..6ee6d73ed21 100644 --- a/board/freescale/mx53evk/mx53evk.c +++ b/board/freescale/mx53evk/mx53evk.c @@ -195,7 +195,7 @@ int board_mmc_init(bd_t *bis)  	};  	u32 index; -	s32 status = 0; +	int ret;  	esdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK);  	esdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK); @@ -214,12 +214,14 @@ int board_mmc_init(bd_t *bis)  			printf("Warning: you configured more ESDHC controller"  				"(%d) as supported by the board(2)\n",  				CONFIG_SYS_FSL_ESDHC_NUM); -			return status; +			return -EINVAL;  		} -		status |= fsl_esdhc_initialize(bis, &esdhc_cfg[index]); +		ret = fsl_esdhc_initialize(bis, &esdhc_cfg[index]); +		if (ret) +			return ret;  	} -	return status; +	return 0;  }  #endif diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c index 7569ded8d82..efcf4b390d3 100644 --- a/board/freescale/mx53loco/mx53loco.c +++ b/board/freescale/mx53loco/mx53loco.c @@ -186,7 +186,7 @@ int board_mmc_init(bd_t *bis)  	};  	u32 index; -	s32 status = 0; +	int ret;  	esdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK);  	esdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK); @@ -205,12 +205,14 @@ int board_mmc_init(bd_t *bis)  			printf("Warning: you configured more ESDHC controller"  				"(%d) as supported by the board(2)\n",  				CONFIG_SYS_FSL_ESDHC_NUM); -			return status; +			return -EINVAL;  		} -		status |= fsl_esdhc_initialize(bis, &esdhc_cfg[index]); +		ret = fsl_esdhc_initialize(bis, &esdhc_cfg[index]); +		if (ret) +			return ret;  	} -	return status; +	return 0;  }  #endif diff --git a/board/freescale/mx53smd/mx53smd.c b/board/freescale/mx53smd/mx53smd.c index d64c674e915..0963fd7b43a 100644 --- a/board/freescale/mx53smd/mx53smd.c +++ b/board/freescale/mx53smd/mx53smd.c @@ -106,7 +106,7 @@ int board_mmc_init(bd_t *bis)  	};  	u32 index; -	s32 status = 0; +	int ret;  	esdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK); @@ -121,12 +121,14 @@ int board_mmc_init(bd_t *bis)  			printf("Warning: you configured more ESDHC controller"  				"(%d) as supported by the board(1)\n",  				CONFIG_SYS_FSL_ESDHC_NUM); -			return status; +			return -EINVAL;  		} -		status |= fsl_esdhc_initialize(bis, &esdhc_cfg[index]); +		ret = fsl_esdhc_initialize(bis, &esdhc_cfg[index]); +		if (ret) +			return ret;  	} -	return status; +	return 0;  }  #endif diff --git a/board/freescale/mx6qarm2/mx6qarm2.c b/board/freescale/mx6qarm2/mx6qarm2.c index 667dca532f4..3a5b26dde74 100644 --- a/board/freescale/mx6qarm2/mx6qarm2.c +++ b/board/freescale/mx6qarm2/mx6qarm2.c @@ -125,7 +125,7 @@ int board_mmc_getcd(struct mmc *mmc)  int board_mmc_init(bd_t *bis)  { -	s32 status = 0; +	int ret;  	u32 index = 0;  	usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK); @@ -145,13 +145,15 @@ int board_mmc_init(bd_t *bis)  			printf("Warning: you configured more USDHC controllers"  				"(%d) then supported by the board (%d)\n",  				index + 1, CONFIG_SYS_FSL_USDHC_NUM); -			return status; +			return -EINVAL;  		} -		status |= fsl_esdhc_initialize(bis, &usdhc_cfg[index]); +		ret = fsl_esdhc_initialize(bis, &usdhc_cfg[index]); +		if (ret) +			return ret;  	} -	return status; +	return 0;  }  #endif diff --git a/board/freescale/mx6qsabreauto/mx6qsabreauto.c b/board/freescale/mx6qsabreauto/mx6qsabreauto.c index c35dcaf3cf0..59387ffaaa7 100644 --- a/board/freescale/mx6qsabreauto/mx6qsabreauto.c +++ b/board/freescale/mx6qsabreauto/mx6qsabreauto.c @@ -28,6 +28,8 @@  #include <asm/imx-common/video.h>  #include <asm/arch/crm_regs.h>  #include <pca953x.h> +#include <power/pmic.h> +#include "../common/pfuze.h"  DECLARE_GLOBAL_DATA_PTR; @@ -53,6 +55,12 @@ DECLARE_GLOBAL_DATA_PTR;  #define PC MUX_PAD_CTRL(I2C_PAD_CTRL) +#define WEIM_NOR_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE |          \ +	PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED |               \ +	PAD_CTL_DSE_40ohm   | PAD_CTL_SRE_FAST) + +#define I2C_PMIC	1 +  int dram_init(void)  {  	gd->ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE); @@ -97,6 +105,7 @@ static struct i2c_pads_info i2c_pad_info1 = {  	}  }; +#ifndef CONFIG_SYS_FLASH_CFI  /*   * I2C3 MLB, Port Expanders (A, B, C), Video ADC, Light Sensor,   * Compass Sensor, Accelerometer, Res Touch @@ -113,6 +122,7 @@ static struct i2c_pads_info i2c_pad_info2 = {  		.gp = IMX_GPIO_NR(3, 18)  	}  }; +#endif  static iomux_v3_cfg_t const i2c3_pads[] = {  	MX6_PAD_EIM_A24__GPIO5_IO04		| MUX_PAD_CTRL(NO_PAD_CTRL), @@ -160,6 +170,75 @@ static int port_exp_direction_output(unsigned gpio, int value)  	return 0;  } +static iomux_v3_cfg_t const eimnor_pads[] = { +	MX6_PAD_EIM_D16__EIM_DATA16	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_D17__EIM_DATA17	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_D18__EIM_DATA18	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_D19__EIM_DATA19	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_D20__EIM_DATA20	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_D21__EIM_DATA21	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_D22__EIM_DATA22	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_D23__EIM_DATA23	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_D24__EIM_DATA24	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_D25__EIM_DATA25	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_D26__EIM_DATA26	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_D27__EIM_DATA27	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_D28__EIM_DATA28	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_D29__EIM_DATA29	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_D30__EIM_DATA30	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_D31__EIM_DATA31	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_DA0__EIM_AD00	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_DA1__EIM_AD01	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_DA2__EIM_AD02	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_DA3__EIM_AD03	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_DA4__EIM_AD04	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_DA5__EIM_AD05	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_DA6__EIM_AD06	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_DA7__EIM_AD07	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_DA8__EIM_AD08	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_DA9__EIM_AD09	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_DA10__EIM_AD10	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_DA11__EIM_AD11	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL) , +	MX6_PAD_EIM_DA12__EIM_AD12	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_DA13__EIM_AD13	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_DA14__EIM_AD14	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_DA15__EIM_AD15	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_A16__EIM_ADDR16	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_A17__EIM_ADDR17	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_A18__EIM_ADDR18	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_A19__EIM_ADDR19	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_A20__EIM_ADDR20	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_A21__EIM_ADDR21	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_A22__EIM_ADDR22	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_A23__EIM_ADDR23	| MUX_PAD_CTRL(WEIM_NOR_PAD_CTRL), +	MX6_PAD_EIM_OE__EIM_OE_B	| MUX_PAD_CTRL(NO_PAD_CTRL), +	MX6_PAD_EIM_RW__EIM_RW		| MUX_PAD_CTRL(NO_PAD_CTRL), +	MX6_PAD_EIM_CS0__EIM_CS0_B	| MUX_PAD_CTRL(NO_PAD_CTRL), +}; + +static void eimnor_cs_setup(void) +{ +	struct weim *weim_regs = (struct weim *)WEIM_BASE_ADDR; + +	writel(0x00020181, &weim_regs->cs0gcr1); +	writel(0x00000001, &weim_regs->cs0gcr2); +	writel(0x0a020000, &weim_regs->cs0rcr1); +	writel(0x0000c000, &weim_regs->cs0rcr2); +	writel(0x0804a240, &weim_regs->cs0wcr1); +	writel(0x00000120, &weim_regs->wcr); + +	set_chipselect_size(CS0_128); +} + +static void setup_iomux_eimnor(void) +{ +	imx_iomux_v3_setup_multiple_pads(eimnor_pads, ARRAY_SIZE(eimnor_pads)); + +	gpio_direction_output(IMX_GPIO_NR(5, 4), 0); + +	eimnor_cs_setup(); +} +  static void setup_iomux_enet(void)  {  	imx_iomux_v3_setup_multiple_pads(enet_pads, ARRAY_SIZE(enet_pads)); @@ -402,6 +481,7 @@ int board_early_init_f(void)  #ifdef CONFIG_NAND_MXS  	setup_gpmi_nand();  #endif +  	return 0;  } @@ -415,11 +495,13 @@ int board_init(void)  	/* I2C 3 Steer */  	gpio_direction_output(IMX_GPIO_NR(5, 4), 1);  	imx_iomux_v3_setup_multiple_pads(i2c3_pads, ARRAY_SIZE(i2c3_pads)); +#ifndef CONFIG_SYS_FLASH_CFI  	setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info2); - +#endif  	gpio_direction_output(IMX_GPIO_NR(1, 15), 1);  	imx_iomux_v3_setup_multiple_pads(port_exp, ARRAY_SIZE(port_exp)); +	setup_iomux_eimnor();  	return 0;  } @@ -430,6 +512,17 @@ int board_spi_cs_gpio(unsigned bus, unsigned cs)  }  #endif +int power_init_board(void) +{ +	struct pmic *p; + +	p = pfuze_common_init(I2C_PMIC); +	if (!p) +		return -ENODEV; + +	return 0; +} +  #ifdef CONFIG_CMD_BMODE  static const struct boot_mode board_boot_modes[] = {  	/* 4 bit bus width */ diff --git a/board/freescale/mx6sabresd/MAINTAINERS b/board/freescale/mx6sabresd/MAINTAINERS index 69c0a3065fc..0011ec7b493 100644 --- a/board/freescale/mx6sabresd/MAINTAINERS +++ b/board/freescale/mx6sabresd/MAINTAINERS @@ -5,3 +5,4 @@ F:	board/freescale/mx6sabresd/  F:	include/configs/mx6sabresd.h  F:	configs/mx6dlsabresd_defconfig  F:	configs/mx6qsabresd_defconfig +F:	configs/mx6sabresd_spl_defconfig diff --git a/board/freescale/mx6sabresd/mx6sabresd.c b/board/freescale/mx6sabresd/mx6sabresd.c index 1142e8a27ef..ac3757f0744 100644 --- a/board/freescale/mx6sabresd/mx6sabresd.c +++ b/board/freescale/mx6sabresd/mx6sabresd.c @@ -27,12 +27,11 @@  #include <i2c.h>  #include <power/pmic.h>  #include <power/pfuze100_pmic.h> +#include "../common/pfuze.h"  #include <asm/arch/mx6-ddr.h>  DECLARE_GLOBAL_DATA_PTR; -#define BOOT_CFG	0x020D8004 -  #define UART_PAD_CTRL  (PAD_CTL_PUS_100K_UP |			\  	PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm |			\  	PAD_CTL_SRE_FAST  | PAD_CTL_HYS) @@ -300,7 +299,8 @@ int board_mmc_init(bd_t *bis)  	return 0;  #else -	unsigned reg = readl(BOOT_CFG) >> 11; +	struct src *psrc = (struct src *)SRC_BASE_ADDR; +	unsigned reg = readl(&psrc->sbmr1) >> 11;  	/*  	 * Upon reading BOOT_CFG register the following map is done:  	 * Bit 11 and 12 of BOOT_CFG register can determine the current @@ -560,60 +560,27 @@ int board_init(void)  	return 0;  } -static int pfuze_init(void) +int power_init_board(void)  {  	struct pmic *p; -	int ret;  	unsigned int reg; -	ret = power_pfuze100_init(I2C_PMIC); -	if (ret) -		return ret; - -	p = pmic_get("PFUZE100"); -	ret = pmic_probe(p); -	if (ret) -		return ret; - -	pmic_reg_read(p, PFUZE100_DEVICEID, ®); -	printf("PMIC:  PFUZE100 ID=0x%02x\n", reg); +	p = pfuze_common_init(I2C_PMIC); +	if (!p) +		return -ENODEV;  	/* Increase VGEN3 from 2.5 to 2.8V */  	pmic_reg_read(p, PFUZE100_VGEN3VOL, ®); -	reg &= ~0xf; -	reg |= 0xa; +	reg &= ~LDO_VOL_MASK; +	reg |= LDOB_2_80V;  	pmic_reg_write(p, PFUZE100_VGEN3VOL, reg);  	/* Increase VGEN5 from 2.8 to 3V */  	pmic_reg_read(p, PFUZE100_VGEN5VOL, ®); -	reg &= ~0xf; -	reg |= 0xc; +	reg &= ~LDO_VOL_MASK; +	reg |= LDOB_3_00V;  	pmic_reg_write(p, PFUZE100_VGEN5VOL, reg); -	/* Set SW1AB stanby volage to 0.975V */ -	pmic_reg_read(p, PFUZE100_SW1ABSTBY, ®); -	reg &= ~0x3f; -	reg |= 0x1b; -	pmic_reg_write(p, PFUZE100_SW1ABSTBY, reg); - -	/* Set SW1AB/VDDARM step ramp up time from 16us to 4us/25mV */ -	pmic_reg_read(p, PUZE_100_SW1ABCONF, ®); -	reg &= ~0xc0; -	reg |= 0x40; -	pmic_reg_write(p, PUZE_100_SW1ABCONF, reg); - -	/* Set SW1C standby voltage to 0.975V */ -	pmic_reg_read(p, PFUZE100_SW1CSTBY, ®); -	reg &= ~0x3f; -	reg |= 0x1b; -	pmic_reg_write(p, PFUZE100_SW1CSTBY, reg); - -	/* Set SW1C/VDDSOC step ramp up time from 16us to 4us/25mV */ -	pmic_reg_read(p, PFUZE100_SW1CCONF, ®); -	reg &= ~0xc0; -	reg |= 0x40; -	pmic_reg_write(p, PFUZE100_SW1CCONF, reg); -  	return 0;  } @@ -640,8 +607,6 @@ int board_late_init(void)  #ifdef CONFIG_CMD_BMODE  	add_board_boot_modes(board_boot_modes);  #endif -	pfuze_init(); -  	return 0;  } @@ -729,11 +694,33 @@ static struct mx6_ddr3_cfg mem_ddr = {  	.trasmin = 3500,  }; +static void ccgr_init(void) +{ +	struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR; + +	writel(0x00C03F3F, &ccm->CCGR0); +	writel(0x0030FC03, &ccm->CCGR1); +	writel(0x0FFFC000, &ccm->CCGR2); +	writel(0x3FF00000, &ccm->CCGR3); +	writel(0x00FFF300, &ccm->CCGR4); +	writel(0x0F0000C3, &ccm->CCGR5); +	writel(0x000003FF, &ccm->CCGR6); +} + +static void gpr_init(void) +{ +	struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR; + +	/* enable AXI cache for VDOA/VPU/IPU */ +	writel(0xF00000CF, &iomux->gpr[4]); +	/* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */ +	writel(0x007F007F, &iomux->gpr[6]); +	writel(0x007F007F, &iomux->gpr[7]); +} +  /* - * This section require the differentiation - * between iMX6 Sabre Families. - * But for now, it will configure only for - * SabreSD. + * This section requires the differentiation between iMX6 Sabre boards, but + * for now, it will configure only for the mx6q variant.   */  static void spl_dram_init(void)  { @@ -768,6 +755,9 @@ void board_init_f(ulong dummy)  	/* setup AIPS and disable watchdog */  	arch_cpu_init(); +	ccgr_init(); +	gpr_init(); +  	/* iomux and setup of i2c */  	board_early_init_f(); diff --git a/board/freescale/mx6sabresd/mx6sabresd_spl.cfg b/board/freescale/mx6sabresd/mx6sabresd_spl.cfg deleted file mode 100644 index 2bf48175ef6..00000000000 --- a/board/freescale/mx6sabresd/mx6sabresd_spl.cfg +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2011 Freescale Semiconductor, Inc. - * Jason Liu <r64343@freescale.com> - * - * SPDX-License-Identifier:	GPL-2.0+ - * - * Refer doc/README.imximage for more details about how-to configure - * and create imximage boot image - * - * The syntax is taken as close as possible with the kwbimage - */ - -/* image version */ -IMAGE_VERSION 2 - -/* - * Boot Device : one of - * spi, sd (the board has no nand neither onenand) - */ -BOOT_FROM      sd - -/* - * Device Configuration Data (DCD) - * - * Each entry must have the format: - * Addr-type           Address        Value - * - * where: - *      Addr-type register length (1,2 or 4 bytes) - *      Address   absolute address of the register - *      value     value to be stored in the register - */ - -/* set the default clock gate to save power */ -DATA 4 0x020c4068 0x00C03F3F -DATA 4 0x020c406c 0x0030FC03 -DATA 4 0x020c4070 0x0FFFC000 -DATA 4 0x020c4074 0x3FF00000 -DATA 4 0x020c4078 0x00FFF300 -DATA 4 0x020c407c 0x0F0000C3 -DATA 4 0x020c4080 0x000003FF - -/* enable AXI cache for VDOA/VPU/IPU */ -DATA 4 0x020e0010 0xF00000CF -/* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */ -DATA 4 0x020e0018 0x007F007F -DATA 4 0x020e001c 0x007F007F - -/* - * Setup CCM_CCOSR register as follows: - * - * cko1_en  = 1	   --> CKO1 enabled - * cko1_div = 111  --> divide by 8 - * cko1_sel = 1011 --> ahb_clk_root - * - * This sets CKO1 at ahb_clk_root/8 = 132/8 = 16.5 MHz - */ -DATA 4 0x020c4060 0x000000fb diff --git a/board/freescale/mx6slevk/mx6slevk.c b/board/freescale/mx6slevk/mx6slevk.c index e76c343812e..8111edf8042 100644 --- a/board/freescale/mx6slevk/mx6slevk.c +++ b/board/freescale/mx6slevk/mx6slevk.c @@ -230,16 +230,11 @@ int board_eth_init(bd_t *bis)  static int setup_fec(void)  {  	struct iomuxc *iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR; -	int ret;  	/* clear gpr1[14], gpr1[18:17] to select anatop clock */  	clrsetbits_le32(&iomuxc_regs->gpr[1], IOMUX_GPR1_FEC_MASK, 0); -	ret = enable_fec_anatop_clock(ENET_50MHz); -	if (ret) -		return ret; - -	return 0; +	return enable_fec_anatop_clock(ENET_50MHz);  }  #endif diff --git a/board/freescale/mx6sxsabresd/mx6sxsabresd.c b/board/freescale/mx6sxsabresd/mx6sxsabresd.c index 68d37184a33..7aee074a87a 100644 --- a/board/freescale/mx6sxsabresd/mx6sxsabresd.c +++ b/board/freescale/mx6sxsabresd/mx6sxsabresd.c @@ -25,6 +25,7 @@  #include <netdev.h>  #include <power/pmic.h>  #include <power/pfuze100_pmic.h> +#include "../common/pfuze.h"  DECLARE_GLOBAL_DATA_PTR; @@ -68,6 +69,34 @@ static iomux_v3_cfg_t const uart1_pads[] = {  	MX6_PAD_GPIO1_IO05__UART1_RX | MUX_PAD_CTRL(UART_PAD_CTRL),  }; +static iomux_v3_cfg_t const usdhc2_pads[] = { +	MX6_PAD_SD2_CLK__USDHC2_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL), +	MX6_PAD_SD2_CMD__USDHC2_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL), +	MX6_PAD_SD2_DATA0__USDHC2_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL), +	MX6_PAD_SD2_DATA1__USDHC2_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL), +	MX6_PAD_SD2_DATA2__USDHC2_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL), +	MX6_PAD_SD2_DATA3__USDHC2_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL), +}; + +static iomux_v3_cfg_t const usdhc3_pads[] = { +	MX6_PAD_SD3_CLK__USDHC3_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL), +	MX6_PAD_SD3_CMD__USDHC3_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL), +	MX6_PAD_SD3_DATA0__USDHC3_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL), +	MX6_PAD_SD3_DATA1__USDHC3_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL), +	MX6_PAD_SD3_DATA2__USDHC3_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL), +	MX6_PAD_SD3_DATA3__USDHC3_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL), +	MX6_PAD_SD3_DATA4__USDHC3_DATA4 | MUX_PAD_CTRL(USDHC_PAD_CTRL), +	MX6_PAD_SD3_DATA5__USDHC3_DATA5 | MUX_PAD_CTRL(USDHC_PAD_CTRL), +	MX6_PAD_SD3_DATA6__USDHC3_DATA6 | MUX_PAD_CTRL(USDHC_PAD_CTRL), +	MX6_PAD_SD3_DATA7__USDHC3_DATA7 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + +	/* CD pin */ +	MX6_PAD_KEY_COL0__GPIO2_IO_10 | MUX_PAD_CTRL(NO_PAD_CTRL), + +	/* RST_B, used for power reset cycle */ +	MX6_PAD_KEY_COL1__GPIO2_IO_11 | MUX_PAD_CTRL(NO_PAD_CTRL), +}; +  static iomux_v3_cfg_t const usdhc4_pads[] = {  	MX6_PAD_SD4_CLK__USDHC4_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL),  	MX6_PAD_SD4_CMD__USDHC4_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL), @@ -119,7 +148,6 @@ static int setup_fec(void)  {  	struct iomuxc *iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;  	struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR; -	int ret;  	int reg;  	/* Use 125MHz anatop loopback REF_CLK1 for ENET1 */ @@ -140,11 +168,7 @@ static int setup_fec(void)  	reg |= BM_ANADIG_PLL_ENET_REF_25M_ENABLE;  	writel(reg, &anatop->pll_enet); -	ret = enable_fec_anatop_clock(ENET_125MHz); -	if (ret) -		return ret; - -	return 0; +	return enable_fec_anatop_clock(ENET_125MHz);  }  int board_eth_init(bd_t *bis) @@ -170,52 +194,19 @@ static struct i2c_pads_info i2c_pad_info1 = {  	},  }; -static int pfuze_init(void) +int power_init_board(void)  {  	struct pmic *p; -	int ret;  	unsigned int reg; -	ret = power_pfuze100_init(I2C_PMIC); -	if (ret) -		return ret; - -	p = pmic_get("PFUZE100"); -	ret = pmic_probe(p); -	if (ret) -		return ret; - -	pmic_reg_read(p, PFUZE100_DEVICEID, ®); -	printf("PMIC:  PFUZE100 ID=0x%02x\n", reg); - -	/* Set SW1AB standby voltage to 0.975V */ -	pmic_reg_read(p, PFUZE100_SW1ABSTBY, ®); -	reg &= ~0x3f; -	reg |= 0x1b; -	pmic_reg_write(p, PFUZE100_SW1ABSTBY, reg); - -	/* Set SW1AB/VDDARM step ramp up time from 16us to 4us/25mV */ -	pmic_reg_read(p, PUZE_100_SW1ABCONF, ®); -	reg &= ~0xc0; -	reg |= 0x40; -	pmic_reg_write(p, PUZE_100_SW1ABCONF, reg); - -	/* Set SW1C standby voltage to 0.975V */ -	pmic_reg_read(p, PFUZE100_SW1CSTBY, ®); -	reg &= ~0x3f; -	reg |= 0x1b; -	pmic_reg_write(p, PFUZE100_SW1CSTBY, reg); - -	/* Set SW1C/VDDSOC step ramp up time from 16us to 4us/25mV */ -	pmic_reg_read(p, PFUZE100_SW1CCONF, ®); -	reg &= ~0xc0; -	reg |= 0x40; -	pmic_reg_write(p, PFUZE100_SW1CCONF, reg); +	p = pfuze_common_init(I2C_PMIC); +	if (!p) +		return -ENODEV;  	/* Enable power of VGEN5 3V3, needed for SD3 */  	pmic_reg_read(p, PFUZE100_VGEN5VOL, ®); -	reg &= ~0x1F; -	reg |= 0x1F; +	reg &= ~LDO_VOL_MASK; +	reg |= (LDOB_3_30V | (1 << LDO_EN));  	pmic_reg_write(p, PFUZE100_VGEN5VOL, reg);  	return 0; @@ -243,7 +234,6 @@ int board_phy_config(struct phy_device *phydev)  int board_early_init_f(void)  {  	setup_iomux_uart(); -	setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1);  	/* Enable PERI_3V3, which is used by SD2, ENET, LVDS, BT */  	imx_iomux_v3_setup_multiple_pads(peri_3v3_pads, @@ -255,35 +245,98 @@ int board_early_init_f(void)  	return 0;  } -static struct fsl_esdhc_cfg usdhc_cfg[1] = { +static struct fsl_esdhc_cfg usdhc_cfg[3] = { +	{USDHC2_BASE_ADDR, 0, 4}, +	{USDHC3_BASE_ADDR},  	{USDHC4_BASE_ADDR},  }; +#define USDHC3_CD_GPIO	IMX_GPIO_NR(2, 10) +#define USDHC3_PWR_GPIO	IMX_GPIO_NR(2, 11) +#define USDHC4_CD_GPIO	IMX_GPIO_NR(6, 21) +  int board_mmc_getcd(struct mmc *mmc)  { -	return 1;	/* Assume boot SD always present */ +	struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv; +	int ret = 0; + +	switch (cfg->esdhc_base) { +	case USDHC2_BASE_ADDR: +		ret = 1; /* Assume uSDHC2 is always present */ +		break; +	case USDHC3_BASE_ADDR: +		ret = !gpio_get_value(USDHC3_CD_GPIO); +		break; +	case USDHC4_BASE_ADDR: +		ret = !gpio_get_value(USDHC4_CD_GPIO); +		break; +	} + +	return ret;  }  int board_mmc_init(bd_t *bis)  { -	imx_iomux_v3_setup_multiple_pads(usdhc4_pads, ARRAY_SIZE(usdhc4_pads)); +	int i, ret; -	usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC4_CLK); -	return fsl_esdhc_initialize(bis, &usdhc_cfg[0]); +	/* +	 * According to the board_mmc_init() the following map is done: +	 * (U-boot device node)    (Physical Port) +	 * mmc0                    USDHC2 +	 * mmc1                    USDHC3 +	 * mmc2                    USDHC4 +	 */ +	for (i = 0; i < CONFIG_SYS_FSL_USDHC_NUM; i++) { +		switch (i) { +		case 0: +			imx_iomux_v3_setup_multiple_pads( +				usdhc2_pads, ARRAY_SIZE(usdhc2_pads)); +			usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK); +			break; +		case 1: +			imx_iomux_v3_setup_multiple_pads( +				usdhc3_pads, ARRAY_SIZE(usdhc3_pads)); +			gpio_direction_input(USDHC3_CD_GPIO); +			gpio_direction_output(USDHC3_PWR_GPIO, 1); +			usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK); +			break; +		case 2: +			imx_iomux_v3_setup_multiple_pads( +				usdhc4_pads, ARRAY_SIZE(usdhc4_pads)); +			gpio_direction_input(USDHC4_CD_GPIO); +			usdhc_cfg[2].sdhc_clk = mxc_get_clock(MXC_ESDHC4_CLK); +			break; +		default: +			printf("Warning: you configured more USDHC controllers" +				"(%d) than supported by the board\n", i + 1); +			return -EINVAL; +			} + +			ret = fsl_esdhc_initialize(bis, &usdhc_cfg[i]); +			if (ret) { +				printf("Warning: failed to initialize mmc dev %d\n", i); +				return ret; +			} +	} + +	return 0;  } +  int board_init(void)  {  	/* Address of boot parameters */  	gd->bd->bi_boot_params = PHYS_SDRAM + 0x100; +#ifdef CONFIG_SYS_I2C_MXC +	setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1); +#endif +  	return 0;  }  int board_late_init(void)  { -	pfuze_init(); -  	return 0;  } diff --git a/board/freescale/p1010rdb/p1010rdb.c b/board/freescale/p1010rdb/p1010rdb.c index 491b576258c..1cf0ab78b71 100644 --- a/board/freescale/p1010rdb/p1010rdb.c +++ b/board/freescale/p1010rdb/p1010rdb.c @@ -444,7 +444,7 @@ void fdt_disable_uart1(void *blob)  	}  } -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	phys_addr_t base;  	phys_size_t size; @@ -496,6 +496,8 @@ void ft_board_setup(void *blob, bd_t *bd)  		fdt_del_flexcan(blob);  		fdt_disable_uart1(blob);  	} + +	return 0;  }  #endif diff --git a/board/freescale/p1022ds/p1022ds.c b/board/freescale/p1022ds/p1022ds.c index f5e18515a0f..d7dd478dff9 100644 --- a/board/freescale/p1022ds/p1022ds.c +++ b/board/freescale/p1022ds/p1022ds.c @@ -332,7 +332,7 @@ static void ft_codec_setup(void *blob, const char *compatible)  	}  } -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	phys_addr_t base;  	phys_size_t size; @@ -356,5 +356,7 @@ void ft_board_setup(void *blob, bd_t *bd)  	/* Update the WM8776 node's clock frequency property */  	ft_codec_setup(blob, "wlf,wm8776"); + +	return 0;  }  #endif diff --git a/board/freescale/p1023rdb/p1023rdb.c b/board/freescale/p1023rdb/p1023rdb.c index d4d277ba6d3..56f561a5058 100644 --- a/board/freescale/p1023rdb/p1023rdb.c +++ b/board/freescale/p1023rdb/p1023rdb.c @@ -130,7 +130,7 @@ int board_eth_init(bd_t *bis)  }  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	phys_addr_t base;  	phys_size_t size; @@ -147,5 +147,7 @@ void ft_board_setup(void *blob, bd_t *bd)  #endif  	fdt_fixup_fman_ethernet(blob); + +	return 0;  }  #endif diff --git a/board/freescale/p1_p2_rdb/p1_p2_rdb.c b/board/freescale/p1_p2_rdb/p1_p2_rdb.c index aba4f534b86..61ed466fa7f 100644 --- a/board/freescale/p1_p2_rdb/p1_p2_rdb.c +++ b/board/freescale/p1_p2_rdb/p1_p2_rdb.c @@ -234,7 +234,7 @@ int board_eth_init(bd_t *bis)  #if defined(CONFIG_OF_BOARD_SETUP)  extern void ft_pci_board_setup(void *blob); -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	const char *soc_usb_compat = "fsl-usb2-dr";  	int err, usb1_off, usb2_off; @@ -263,39 +263,41 @@ void ft_board_setup(void *blob, bd_t *bd)  		int off = fdt_node_offset_by_compatible(blob, -1,  			soc_elbc_compat);  		if (off < 0) { -			printf("WARNING: could not find compatible node" -				" %s: %s.\n", soc_elbc_compat, -				fdt_strerror(off)); -				return; +			printf("WARNING: could not find compatible node %s\n", +			       soc_elbc_compat); +			return off;  		}  		err = fdt_del_node(blob, off);  		if (err < 0) { -			printf("WARNING: could not remove %s: %s.\n", -				soc_elbc_compat, fdt_strerror(err)); +			printf("WARNING: could not remove %s\n", +			       soc_elbc_compat); +			return err;  		} -		return; +		return 0;  	}  #endif  	/* Delete USB2 node as it is muxed with eLBC */  	usb1_off = fdt_node_offset_by_compatible(blob, -1,  		soc_usb_compat);  	if (usb1_off < 0) { -		printf("WARNING: could not find compatible node" -			" %s: %s.\n", soc_usb_compat, -			fdt_strerror(usb1_off)); -		return; +		printf("WARNING: could not find compatible node %s\n", +		       soc_usb_compat); +		return usb1_off;  	}  	usb2_off = fdt_node_offset_by_compatible(blob, usb1_off,  			soc_usb_compat);  	if (usb2_off < 0) { -		printf("WARNING: could not find compatible node" -			" %s: %s.\n", soc_usb_compat, -			fdt_strerror(usb2_off)); -		return; +		printf("WARNING: could not find compatible node %s\n", +		       soc_usb_compat); +		return usb2_off;  	}  	err = fdt_del_node(blob, usb2_off); -	if (err < 0) -		printf("WARNING: could not remove %s: %s.\n", -			soc_usb_compat, fdt_strerror(err)); +	if (err < 0) { +		printf("WARNING: could not remove %s\n", soc_usb_compat); +		return err; +	} + +	return 0;  } +  #endif diff --git a/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c b/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c index a6756c68f40..3f47cfbb82a 100644 --- a/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c +++ b/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c @@ -424,7 +424,7 @@ static void fdt_board_fixup_qe_pins(void *blob)  #endif  #ifdef CONFIG_OF_BOARD_SETUP -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	phys_addr_t base;  	phys_size_t size; @@ -459,17 +459,17 @@ void ft_board_setup(void *blob, bd_t *bd)  		int off = fdt_node_offset_by_compatible(blob, -1,  				soc_elbc_compat);  		if (off < 0) { -			printf("WARNING: could not find compatible node %s: %s.\n", -			       soc_elbc_compat, -			       fdt_strerror(off)); -				return; +			printf("WARNING: could not find compatible node %s\n", +			       soc_elbc_compat); +			return off;  		}  		err = fdt_del_node(blob, off);  		if (err < 0) { -			printf("WARNING: could not remove %s: %s.\n", -			       soc_elbc_compat, fdt_strerror(err)); +			printf("WARNING: could not remove %s\n", +			       soc_elbc_compat); +			return err;  		} -		return; +		return 0;  	}  #endif @@ -477,24 +477,23 @@ void ft_board_setup(void *blob, bd_t *bd)  	usb1_off = fdt_node_offset_by_compatible(blob, -1,  		soc_usb_compat);  	if (usb1_off < 0) { -		printf("WARNING: could not find compatible node %s: %s.\n", -		       soc_usb_compat, -		       fdt_strerror(usb1_off)); -		return; +		printf("WARNING: could not find compatible node %s\n", +		       soc_usb_compat); +		return usb1_off;  	}  	usb2_off = fdt_node_offset_by_compatible(blob, usb1_off,  			soc_usb_compat);  	if (usb2_off < 0) { -		printf("WARNING: could not find compatible node %s: %s.\n", -		       soc_usb_compat, -		       fdt_strerror(usb2_off)); -		return; +		printf("WARNING: could not find compatible node %s\n", +		       soc_usb_compat); +		return usb2_off;  	}  	err = fdt_del_node(blob, usb2_off);  	if (err < 0) { -		printf("WARNING: could not remove %s: %s.\n", -		       soc_usb_compat, fdt_strerror(err)); +		printf("WARNING: could not remove %s\n", soc_usb_compat); +		return err;  	} +	return 0;  }  #endif diff --git a/board/freescale/p1_twr/p1_twr.c b/board/freescale/p1_twr/p1_twr.c index a0a416ba176..a40bea328b0 100644 --- a/board/freescale/p1_twr/p1_twr.c +++ b/board/freescale/p1_twr/p1_twr.c @@ -261,7 +261,7 @@ static void fdt_board_fixup_qe_pins(void *blob)  #endif  #ifdef CONFIG_OF_BOARD_SETUP -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	phys_addr_t base;  	phys_size_t size; @@ -283,5 +283,7 @@ void ft_board_setup(void *blob, bd_t *bd)  	fdt_board_fixup_qe_pins(blob);  #endif  	fdt_fixup_dr_usb(blob, bd); + +	return 0;  }  #endif diff --git a/board/freescale/p2020come/p2020come.c b/board/freescale/p2020come/p2020come.c index f777bb9d679..1db37e3be8e 100644 --- a/board/freescale/p2020come/p2020come.c +++ b/board/freescale/p2020come/p2020come.c @@ -250,7 +250,7 @@ int board_eth_init(bd_t *bis)  #endif  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	phys_addr_t base;  	phys_size_t size; @@ -269,5 +269,7 @@ void ft_board_setup(void *blob, bd_t *bd)  #ifdef CONFIG_HAS_FSL_DR_USB  	fdt_fixup_dr_usb(blob, bd);  #endif + +	return 0;  }  #endif diff --git a/board/freescale/p2020ds/p2020ds.c b/board/freescale/p2020ds/p2020ds.c index b72fcffdd08..5d18e8de75a 100644 --- a/board/freescale/p2020ds/p2020ds.c +++ b/board/freescale/p2020ds/p2020ds.c @@ -236,7 +236,7 @@ int board_eth_init(bd_t *bis)  #endif  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	phys_addr_t base;  	phys_size_t size; @@ -257,5 +257,7 @@ void ft_board_setup(void *blob, bd_t *bd)  #ifdef CONFIG_FSL_SGMII_RISER  	fsl_sgmii_riser_fdt_fixup(blob);  #endif + +	return 0;  }  #endif diff --git a/board/freescale/p2041rdb/p2041rdb.c b/board/freescale/p2041rdb/p2041rdb.c index a14b43b5a50..e600bdbc2a8 100644 --- a/board/freescale/p2041rdb/p2041rdb.c +++ b/board/freescale/p2041rdb/p2041rdb.c @@ -215,7 +215,7 @@ int misc_init_r(void)  	return 0;  } -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	phys_addr_t base;  	phys_size_t size; @@ -239,4 +239,6 @@ void ft_board_setup(void *blob, bd_t *bd)  #ifdef CONFIG_SYS_DPAA_FMAN  	fdt_fixup_fman_ethernet(blob);  #endif + +	return 0;  } diff --git a/board/freescale/qemu-ppce500/qemu-ppce500.c b/board/freescale/qemu-ppce500/qemu-ppce500.c index 230870d90e4..a0fca0d8808 100644 --- a/board/freescale/qemu-ppce500/qemu-ppce500.c +++ b/board/freescale/qemu-ppce500/qemu-ppce500.c @@ -235,9 +235,11 @@ int board_eth_init(bd_t *bis)  }  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	FT_FSL_PCI_SETUP; + +	return 0;  }  #endif diff --git a/board/freescale/t1040qds/t1040qds.c b/board/freescale/t1040qds/t1040qds.c index 19af46e48fd..13285be42cf 100644 --- a/board/freescale/t1040qds/t1040qds.c +++ b/board/freescale/t1040qds/t1040qds.c @@ -233,7 +233,7 @@ int misc_init_r(void)  	return 0;  } -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	phys_addr_t base;  	phys_size_t size; @@ -259,6 +259,8 @@ void ft_board_setup(void *blob, bd_t *bd)  	fdt_fixup_fman_ethernet(blob);  	fdt_fixup_board_enet(blob);  #endif + +	return 0;  }  void qixis_dump_switch(void) diff --git a/board/freescale/t104xrdb/t104xrdb.c b/board/freescale/t104xrdb/t104xrdb.c index ddb669fb06c..4734f9dd93b 100644 --- a/board/freescale/t104xrdb/t104xrdb.c +++ b/board/freescale/t104xrdb/t104xrdb.c @@ -85,7 +85,7 @@ int misc_init_r(void)  	return 0;  } -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	phys_addr_t base;  	phys_size_t size; @@ -110,6 +110,8 @@ void ft_board_setup(void *blob, bd_t *bd)  #ifdef CONFIG_SYS_DPAA_FMAN  	fdt_fixup_fman_ethernet(blob);  #endif + +	return 0;  }  #ifdef CONFIG_DEEP_SLEEP diff --git a/board/freescale/t208xqds/README b/board/freescale/t208xqds/README new file mode 100755 index 00000000000..83060c10f37 --- /dev/null +++ b/board/freescale/t208xqds/README @@ -0,0 +1,274 @@ +The T2080QDS is a high-performance computing evaluation, development and +test platform supporting the T2080 QorIQ Power Architecture processor. + +T2080 SoC Overview +------------------ +The T2080 QorIQ multicore processor combines four dual-threaded e6500 Power +Architecture processor cores with high-performance datapath acceleration +logic and network and peripheral bus interfaces required for networking, +telecom/datacom, wireless infrastructure, and mil/aerospace applications. + +T2080 includes the following functions and features: + - Four dual-threads 64-bit Power architecture e6500 cores, up to 1.8GHz + - 2MB L2 cache and 512KB CoreNet platform cache (CPC) + - Hierarchical interconnect fabric + - One 32-/64-bit DDR3/3L SDRAM memory controllers with ECC and interleaving + - Data Path Acceleration Architecture (DPAA) incorporating acceleration + - 16 SerDes lanes up to 10.3125 GHz + - 8 Ethernet interfaces, supporting combinations of the following: +   - Up to four 10 Gbps Ethernet MACs +   - Up to eight 1 Gbps Ethernet MACs +   - Up to four 2.5 Gbps Ethernet MACs + - High-speed peripheral interfaces +   - Four PCI Express controllers (two PCIe 2.0 and two PCIe 3.0 with SR-IOV) +   - Two Serial RapidIO 2.0 controllers/ports running at up to 5 GHz + - Additional peripheral interfaces +   - Two serial ATA (SATA 2.0) controllers +   - Two high-speed USB 2.0 controllers with integrated PHY +   - Enhanced secure digital host controller (SD/SDHC/SDXC/eMMC) +   - Enhanced serial peripheral interface (eSPI) +   - Four I2C controllers +   - Four 2-pin UARTs or two 4-pin UARTs +   - Integrated Flash Controller supporting NAND and NOR flash + - Three eight-channel DMA engines + - Support for hardware virtualization and partitioning enforcement + - QorIQ Platform's Trust Architecture 2.0 + +Differences between T2080 and T2081 +----------------------------------- +  Feature		T2080	 T2081 +  1G Ethernet numbers:  8	 6 +  10G Ethernet numbers: 4	 2 +  SerDes lanes:		16	 8 +  Serial RapidIO,RMan:  2	 no +  SATA Controller:	2	 no +  Aurora:		yes	 no +  SoC Package:		896-pins 780-pins + + +T2080QDS feature overview +------------------------- +Processor: + - T2080 SoC integrating four 64-bit dual-threads e6500 cores up to 1.8GHz +Memory: + - Single memory controller capable of supporting DDR3 and DDR3-LV devices + - Two DDR3 DIMMs up to 4GB, Dual rank @ 2133MT/s and ECC support +Ethernet interfaces: + - Two 1Gbps RGMII on-board ports + - Four 10Gbps XFI on-board cages + - 1Gbps/2.5Gbps SGMII Riser card + - 10Gbps XAUI Riser card +Accelerator: + - DPAA components consist of FMan, BMan, QMan, PME, DCE and SEC +SerDes: + - 16 lanes up to 10.3125GHz + - Supports Aurora debug, PEX, SATA, SGMII, sRIO, HiGig, XFI and XAUI +IFC: + - 128MB NOR Flash, 512MB NAND Flash, PromJet debug port and FPGA +eSPI: + - Three SPI flash (16MB N25Q128A + 16MB EN25S64 + 512KB SST25WF040) +USB: + - Two USB2.0 ports with internal PHY (one Type-A + one micro Type-AB) +PCIE: + - Four PCI Express controllers (two PCIe 2.0 and two PCIe 3.0 with SR-IOV) +SATA: + - Two SATA 2.0 ports on-board +SRIO: + - Two Serial RapidIO 2.0 ports up to 5 GHz +eSDHC: + - Supports SD/SDHC/SDXC/eMMC Card +I2C: + - Four I2C controllers. +UART: + - Dual 4-pins UART serial ports +System Logic: + - QIXIS-II FPGA system controll +Debug Features: + - Support Legacy, COP/JTAG, Aurora, Event and EVT +XFI: + - XFI is supported on T2080QDS through Lane A/B/C/D on Serdes 1 routed to + a on-board SFP+ cages, which to house optical module (fiber cable) or + direct attach cable(copper), the copper cable is used to emulate + 10GBASE-KR scenario. + So, for XFI usage, there are two scenarios, one will use fiber cable, + another will use copper cable. An hwconfig env "fsl_10gkr_copper" is + introduced to indicate a XFI port will use copper cable, and U-boot + will fixup the dtb accordingly. + It's used as: fsl_10gkr_copper:<10g_mac_name> + The <10g_mac_name> can be fm1_10g1, fm1_10g2, fm1_10g3, fm1_10g4, they + do not have to be coexist in hwconfig. If a MAC is listed in the env + "fsl_10gkr_copper", it will use copper cable, otherwise, fiber cable + will be used by default. + for ex. set "fsl_10gkr_copper:fm1_10g1,fm1_10g2,fm1_10g3,fm1_10g4" in + hwconfig, then both four XFI ports will use copper cable. + set "fsl_10gkr_copper:fm1_10g1,fm1_10g2" in hwconfig, then first two + XFI ports will use copper cable, the other two XFI ports will use fiber + cable. +1000BASE-KX(1G-KX): + - T2080QDS can support 1G-KX by using SGMII protocol, but serdes lane + runs in 1G-KX mode. By default, the lane runs in SGMII mode, to set a lane + in 1G-KX mode, need to set corresponding bit in SerDes Protocol Configuration + Register 1 (PCCR1), and U-boot fixup the dtb for kernel to do proper + initialization. + Hwconfig "fsl_1gkx" is used to indicate a lane runs in 1G-KX mode, MAC + 1/2/5/6/9/10 are available for 1G-KX, MAC 3/4 run in RGMII mode. To set a + MAC to use 1G-KX mode, set its' corresponding env in "fsl_1gkx", 'fm1_1g1' + stands for MAC 1, 'fm1_1g2' stands for MAC 2, etc. + For ex. set "fsl_1gkx:fm1_1g1,fm1_1g2,fm1_1g5,fm1_1g6,fm1_1g9,fm1_1g10" in + hwconfig, MAC 1/2/5/6/9/10 will use 1G-KX mode. + +System Memory map +---------------- + +Start Address  End Address      Description			Size +0xF_FFDF_0000  0xF_FFDF_0FFF    IFC - CPLD			4KB +0xF_FF80_0000  0xF_FF80_FFFF    IFC - NAND Flash		64KB +0xF_FE00_0000  0xF_FEFF_FFFF    CCSRBAR				16MB +0xF_F803_0000  0xF_F803_FFFF    PCI Express 4 I/O Space		64KB +0xF_F802_0000  0xF_F802_FFFF    PCI Express 3 I/O Space		64KB +0xF_F801_0000  0xF_F801_FFFF    PCI Express 2 I/O Space		64KB +0xF_F800_0000  0xF_F800_FFFF    PCI Express 1 I/O Space		64KB +0xF_F600_0000  0xF_F7FF_FFFF    Queue manager software portal	32MB +0xF_F400_0000  0xF_F5FF_FFFF    Buffer manager software portal	32MB +0xF_E800_0000  0xF_EFFF_FFFF    IFC - NOR Flash			128MB +0xF_0000_0000  0xF_003F_FFFF    DCSR				4MB +0xC_4000_0000  0xC_4FFF_FFFF    PCI Express 4 Mem Space		256MB +0xC_3000_0000  0xC_3FFF_FFFF    PCI Express 3 Mem Space		256MB +0xC_2000_0000  0xC_2FFF_FFFF    PCI Express 2 Mem Space		256MB +0xC_0000_0000  0xC_1FFF_FFFF    PCI Express 1 Mem Space		512MB +0x0_0000_0000  0x0_ffff_ffff    DDR				4GB + + +128M NOR Flash memory Map +------------------------- +Start Address   End Address	Definition			Max size +0xEFF40000	0xEFFFFFFF	u-boot (current bank)		768KB +0xEFF20000	0xEFF3FFFF	u-boot env (current bank)	128KB +0xEFF00000	0xEFF1FFFF	FMAN Ucode (current bank)	128KB +0xED300000	0xEFEFFFFF	rootfs (alt bank)		44MB +0xEC800000	0xEC8FFFFF	Hardware device tree (alt bank)	1MB +0xEC020000	0xEC7FFFFF	Linux.uImage (alt bank)		7MB + 875KB +0xEC000000	0xEC01FFFF	RCW (alt bank)			128KB +0xEBF40000	0xEBFFFFFF	u-boot (alt bank)		768KB +0xEBF20000	0xEBF3FFFF	u-boot env (alt bank)		128KB +0xEBF00000	0xEBF1FFFF	FMAN ucode (alt bank)		128KB +0xE9300000	0xEBEFFFFF	rootfs (current bank)		44MB +0xE8800000	0xE88FFFFF	Hardware device tree (cur bank)	1MB +0xE8020000	0xE86FFFFF	Linux.uImage (current bank)	7MB + 875KB +0xE8000000	0xE801FFFF	RCW (current bank)		128KB + + + +Software configurations and board settings +------------------------------------------ +1. NOR boot: +   a. build NOR boot image +	$  make T2080QDS_config +	$  make +   b. program u-boot.bin image to NOR flash +	=> tftp 1000000 u-boot.bin +	=> pro off all;era eff40000 efffffff;cp.b 1000000 eff40000 $filesize +	set SW1[1:8] = '00010011', SW2[1] = '1', SW6[1:4] = '0000' for NOR boot + +   Switching between default bank0 and alternate bank4 on NOR flash +   To change boot source to vbank4: +	by software:   run command 'qixis_reset altbank' in u-boot. +	by DIP-switch: set SW6[1:4] = '0100' + +   To change boot source to vbank0: +	by software:   run command 'qixis_reset' in u-boot. +	by DIP-Switch: set SW6[1:4] = '0000' + +2. NAND Boot: +   a. build PBL image for NAND boot +	$ make T2080QDS_NAND_config +	$ make +   b. program u-boot-with-spl-pbl.bin to NAND flash +	=> tftp 1000000 u-boot-with-spl-pbl.bin +	=> nand erase 0 $filesize +	=> nand write 1000000 0 $filesize +	set SW1[1:8] = '10000010', SW2[1] = '0' and SW6[1:4] = '1001' for NAND boot + +3. SPI Boot: +   a. build PBL image for SPI boot +	$ make T2080QDS_SPIFLASH_config +	$ make +   b. program u-boot-with-spl-pbl.bin to SPI flash +	=> tftp 1000000 u-boot-with-spl-pbl.bin +	=> sf probe 0 +	=> sf erase 0 f0000 +	=> sf write 1000000 0 $filesize +	set SW1[1:8] = '00100010', SW2[1] ='1' for SPI boot + +4. SD Boot: +   a. build PBL image for SD boot +	$ make T2080QDS_SDCARD_config +	$ make +   b. program u-boot-with-spl-pbl.bin to SD/MMC card +	=> tftp 1000000 u-boot-with-spl-pbl.bin +	=> mmc write 1000000 8 0x800 +	=> tftp 1000000 fsl_fman_ucode_T2080_xx.bin +	=> mmc write 1000000 0x820 80 +	set SW1[1:8] = '00100000', SW2[1] = '0' for SD boot + + +2-stage NAND/SPI/SD boot loader +------------------------------- +PBL initializes the internal CPC-SRAM and copy SPL(160K) to SRAM. +SPL further initializes DDR using SPD and environment variables +and copy u-boot(768 KB) from NAND/SPI/SD device to DDR. +Finally SPL transers control to u-boot for futher booting. + +SPL has following features: + - Executes within 256K + - No relocation required + +Run time view of SPL framework +------------------------------------------------- +|Area		   | Address			| +------------------------------------------------- +|SecureBoot header | 0xFFFC0000 (32KB)		| +------------------------------------------------- +|GD, BD		   | 0xFFFC8000 (4KB)		| +------------------------------------------------- +|ENV		   | 0xFFFC9000 (8KB)		| +------------------------------------------------- +|HEAP		   | 0xFFFCB000 (50KB)		| +------------------------------------------------- +|STACK		   | 0xFFFD8000 (22KB)		| +------------------------------------------------- +|U-boot SPL	   | 0xFFFD8000 (160KB)		| +------------------------------------------------- + +NAND Flash memory Map on T2080QDS +-------------------------------------------------------------- +Start		End		Definition	Size +0x000000	0x0FFFFF	u-boot img	1MB  (2 blocks) +0x100000	0x17FFFF	u-boot env	512KB (1 block) +0x180000	0x1FFFFF	FMAN ucode	512KB (1 block) + + +Micro SD Card memory Map on T2080QDS +---------------------------------------------------- +Block		#blocks		Definition	Size +0x008		2048		u-boot img	1MB +0x800		0016		u-boot env	8KB +0x820		0128		FMAN ucode	64KB + + +SPI Flash memory Map on T2080QDS +---------------------------------------------------- +Start		End		Definition	Size +0x000000	0x0FFFFF	u-boot img	1MB +0x100000	0x101FFF	u-boot env	8KB +0x110000	0x11FFFF	FMAN ucode	64KB + + +How to update the ucode of Freescale FMAN +----------------------------------------- +=> tftp 1000000 fsl_fman_ucode_t2080_xx.bin +=> pro off all;erase 0xeff00000 0xeff1ffff;cp 1000000 0xeff00000 $filesize + + +For more details, please refer to T2080QDS User Guide and access +website www.freescale.com and Freescale QorIQ SDK Infocenter document. diff --git a/board/freescale/t208xqds/eth_t208xqds.c b/board/freescale/t208xqds/eth_t208xqds.c index 5879198e4d3..b82e9e75402 100644 --- a/board/freescale/t208xqds/eth_t208xqds.c +++ b/board/freescale/t208xqds/eth_t208xqds.c @@ -23,6 +23,7 @@  #include <phy.h>  #include <asm/fsl_dtsec.h>  #include <asm/fsl_serdes.h> +#include <hwconfig.h>  #include "../common/qixis.h"  #include "../common/fman.h"  #include "t208xqds_qixis.h" @@ -46,6 +47,15 @@  #define EMI2		8  #endif +#define PCCR1_SGMIIA_KX_MASK		0x00008000 +#define PCCR1_SGMIIB_KX_MASK		0x00004000 +#define PCCR1_SGMIIC_KX_MASK		0x00002000 +#define PCCR1_SGMIID_KX_MASK		0x00001000 +#define PCCR1_SGMIIE_KX_MASK		0x00000800 +#define PCCR1_SGMIIF_KX_MASK		0x00000400 +#define PCCR1_SGMIIG_KX_MASK		0x00000200 +#define PCCR1_SGMIIH_KX_MASK		0x00000100 +  static int mdio_mux[NUM_FM_PORTS];  static const char * const mdio_names[] = { @@ -187,8 +197,18 @@ void board_ft_fman_fixup_port(void *fdt, char *compat, phys_addr_t addr,  {  	int phy;  	char alias[20]; +	char lane_mode[2][20] = {"1000BASE-KX", "10GBASE-KR"}; +	char buf[32] = "serdes-1,";  	struct fixed_link f_link; +	int media_type = 0; +	int off; +  	ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); +#ifdef CONFIG_T2080QDS +	serdes_corenet_t *srds_regs = +		(void *)CONFIG_SYS_FSL_CORENET_SERDES_ADDR; +	u32 srds1_pccr1 = in_be32(&srds_regs->srdspccr1); +#endif  	u32 srds_s1 = in_be32(&gur->rcwsr[4]) &  				FSL_CORENET2_RCWSR4_SRDS1_PRTCL; @@ -199,9 +219,54 @@ void board_ft_fman_fixup_port(void *fdt, char *compat, phys_addr_t addr,  		switch (port) {  #if defined(CONFIG_T2080QDS)  		case FM1_DTSEC1: +			if (hwconfig_sub("fsl_1gkx", "fm1_1g1")) { +				media_type = 1; +				fdt_set_phy_handle(fdt, compat, addr, +						   "phy_1gkx1"); +				fdt_status_okay_by_alias(fdt, "1gkx_pcs_mdio1"); +				sprintf(buf, "%s%s%s", buf, "lane-c,", +						(char *)lane_mode[0]); +				out_be32(&srds_regs->srdspccr1, srds1_pccr1 | +					 PCCR1_SGMIIH_KX_MASK); +				break; +			}  		case FM1_DTSEC2: +			if (hwconfig_sub("fsl_1gkx", "fm1_1g2")) { +				media_type = 1; +				fdt_set_phy_handle(fdt, compat, addr, +						   "phy_1gkx2"); +				fdt_status_okay_by_alias(fdt, "1gkx_pcs_mdio2"); +				sprintf(buf, "%s%s%s", buf, "lane-d,", +						(char *)lane_mode[0]); +				out_be32(&srds_regs->srdspccr1, srds1_pccr1 | +					 PCCR1_SGMIIG_KX_MASK); +				break; +			}  		case FM1_DTSEC9: +			if (hwconfig_sub("fsl_1gkx", "fm1_1g9")) { +				media_type = 1; +				fdt_set_phy_handle(fdt, compat, addr, +						   "phy_1gkx9"); +				fdt_status_okay_by_alias(fdt, "1gkx_pcs_mdio9"); +				sprintf(buf, "%s%s%s", buf, "lane-a,", +						(char *)lane_mode[0]); +				out_be32(&srds_regs->srdspccr1, srds1_pccr1 | +					 PCCR1_SGMIIE_KX_MASK); +				break; +			}  		case FM1_DTSEC10: +			if (hwconfig_sub("fsl_1gkx", "fm1_1g10")) { +				media_type = 1; +				fdt_set_phy_handle(fdt, compat, addr, +						   "phy_1gkx10"); +				fdt_status_okay_by_alias(fdt, +							 "1gkx_pcs_mdio10"); +				sprintf(buf, "%s%s%s", buf, "lane-b,", +						(char *)lane_mode[0]); +				out_be32(&srds_regs->srdspccr1, srds1_pccr1 | +					 PCCR1_SGMIIF_KX_MASK); +				break; +			}  			if (mdio_mux[port] == EMI1_SLOT2) {  				sprintf(alias, "phy_sgmii_s2_%x", phy);  				fdt_set_phy_handle(fdt, compat, addr, alias); @@ -213,7 +278,29 @@ void board_ft_fman_fixup_port(void *fdt, char *compat, phys_addr_t addr,  			}  			break;  		case FM1_DTSEC5: +			if (hwconfig_sub("fsl_1gkx", "fm1_1g5")) { +				media_type = 1; +				fdt_set_phy_handle(fdt, compat, addr, +						   "phy_1gkx5"); +				fdt_status_okay_by_alias(fdt, "1gkx_pcs_mdio5"); +				sprintf(buf, "%s%s%s", buf, "lane-g,", +						(char *)lane_mode[0]); +				out_be32(&srds_regs->srdspccr1, srds1_pccr1 | +					 PCCR1_SGMIIC_KX_MASK); +				break; +			}  		case FM1_DTSEC6: +			if (hwconfig_sub("fsl_1gkx", "fm1_1g6")) { +				media_type = 1; +				fdt_set_phy_handle(fdt, compat, addr, +						   "phy_1gkx6"); +				fdt_status_okay_by_alias(fdt, "1gkx_pcs_mdio6"); +				sprintf(buf, "%s%s%s", buf, "lane-h,", +						(char *)lane_mode[0]); +				out_be32(&srds_regs->srdspccr1, srds1_pccr1 | +					 PCCR1_SGMIID_KX_MASK); +				break; +			}  			if (mdio_mux[port] == EMI1_SLOT1) {  				sprintf(alias, "phy_sgmii_s1_%x", phy);  				fdt_set_phy_handle(fdt, compat, addr, alias); @@ -257,6 +344,12 @@ void board_ft_fman_fixup_port(void *fdt, char *compat, phys_addr_t addr,  		default:  			break;  		} +		if (media_type) { +			/* set property for 1000BASE-KX in dtb */ +			off = fdt_node_offset_by_compat_reg(fdt, +					"fsl,fman-memac-mdio", addr + 0x1000); +			fdt_setprop_string(fdt, off, "lane-instance", buf); +		}  	} else if (fm_info_get_enet_if(port) == PHY_INTERFACE_MODE_XGMII) {  		switch (srds_s1) { @@ -265,15 +358,77 @@ void board_ft_fman_fixup_port(void *fdt, char *compat, phys_addr_t addr,  		case 0x6c:  		case 0x6d:  		case 0x71: -			f_link.phy_id = port; -			f_link.duplex = 1; -			f_link.link_speed = 10000; -			f_link.pause = 0; -			f_link.asym_pause = 0; -			/* no PHY for XFI */ -			fdt_delprop(fdt, offset, "phy-handle"); -			fdt_setprop(fdt, offset, "fixed-link", &f_link, -				    sizeof(f_link)); +			/* +			* if the 10G is XFI, check hwconfig to see what is the +			* media type, there are two types, fiber or copper, +			* fix the dtb accordingly. +			*/ +			switch (port) { +			case FM1_10GEC1: +			if (hwconfig_sub("fsl_10gkr_copper", "fm1_10g1")) { +				/* it's MAC9 */ +				media_type = 1; +				fdt_set_phy_handle(fdt, compat, addr, +						"phy_xfi9"); +				fdt_status_okay_by_alias(fdt, "xfi_pcs_mdio9"); +				sprintf(buf, "%s%s%s", buf, "lane-a,", +						(char *)lane_mode[1]); +			} +				break; +			case FM1_10GEC2: +			if (hwconfig_sub("fsl_10gkr_copper", "fm1_10g2")) { +				/* it's MAC10 */ +				media_type = 1; +				fdt_set_phy_handle(fdt, compat, addr, +						"phy_xfi10"); +				fdt_status_okay_by_alias(fdt, "xfi_pcs_mdio10"); +				sprintf(buf, "%s%s%s", buf, "lane-b,", +						(char *)lane_mode[1]); +			} +				break; +			case FM1_10GEC3: +			if (hwconfig_sub("fsl_10gkr_copper", "fm1_10g3")) { +				/* it's MAC1 */ +				media_type = 1; +				fdt_set_phy_handle(fdt, compat, addr, +						"phy_xfi1"); +				fdt_status_okay_by_alias(fdt, "xfi_pcs_mdio1"); +				sprintf(buf, "%s%s%s", buf, "lane-c,", +						(char *)lane_mode[1]); +			} +				break; +			case FM1_10GEC4: +			if (hwconfig_sub("fsl_10gkr_copper", "fm1_10g4")) { +				/* it's MAC2 */ +				media_type = 1; +				fdt_set_phy_handle(fdt, compat, addr, +						"phy_xfi2"); +				fdt_status_okay_by_alias(fdt, "xfi_pcs_mdio2"); +				sprintf(buf, "%s%s%s", buf, "lane-d,", +						(char *)lane_mode[1]); +			} +				break; +			default: +				return; +			} + +			if (!media_type) { +				/* fixed-link is used for XFI fiber cable */ +				f_link.phy_id = port; +				f_link.duplex = 1; +				f_link.link_speed = 10000; +				f_link.pause = 0; +				f_link.asym_pause = 0; +				fdt_delprop(fdt, offset, "phy-handle"); +				fdt_setprop(fdt, offset, "fixed-link", &f_link, +					sizeof(f_link)); +			} else { +				/* set property for copper cable */ +				off = fdt_node_offset_by_compat_reg(fdt, +					"fsl,fman-memac-mdio", addr + 0x1000); +				fdt_setprop_string(fdt, off, +					"lane-instance", buf); +			}  			break;  		default:  			break; diff --git a/board/freescale/t208xqds/t208xqds.c b/board/freescale/t208xqds/t208xqds.c index fc6d2561117..5c470c3a497 100644 --- a/board/freescale/t208xqds/t208xqds.c +++ b/board/freescale/t208xqds/t208xqds.c @@ -437,7 +437,7 @@ int misc_init_r(void)  	return 0;  } -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	phys_addr_t base;  	phys_size_t size; @@ -460,4 +460,6 @@ void ft_board_setup(void *blob, bd_t *bd)  	fdt_fixup_fman_ethernet(blob);  	fdt_fixup_board_enet(blob);  #endif + +	return 0;  } diff --git a/board/freescale/t208xrdb/t208xrdb.c b/board/freescale/t208xrdb/t208xrdb.c index be99fb806dd..341453bc74e 100644 --- a/board/freescale/t208xrdb/t208xrdb.c +++ b/board/freescale/t208xrdb/t208xrdb.c @@ -103,7 +103,7 @@ int misc_init_r(void)  	return 0;  } -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	phys_addr_t base;  	phys_size_t size; @@ -126,4 +126,6 @@ void ft_board_setup(void *blob, bd_t *bd)  	fdt_fixup_fman_ethernet(blob);  	fdt_fixup_board_enet(blob);  #endif + +	return 0;  } diff --git a/board/freescale/t4qds/t4240emu.c b/board/freescale/t4qds/t4240emu.c index 479e124a396..54410943f28 100644 --- a/board/freescale/t4qds/t4240emu.c +++ b/board/freescale/t4qds/t4240emu.c @@ -69,7 +69,7 @@ int misc_init_r(void)  	return 0;  } -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	phys_addr_t base;  	phys_size_t size; @@ -83,4 +83,6 @@ void ft_board_setup(void *blob, bd_t *bd)  	fdt_fixup_liodn(blob);  	fdt_fixup_dr_usb(blob, bd); + +	return 0;  } diff --git a/board/freescale/t4qds/t4240qds.c b/board/freescale/t4qds/t4240qds.c index 6205fea35e7..4f2cccd709d 100644 --- a/board/freescale/t4qds/t4240qds.c +++ b/board/freescale/t4qds/t4240qds.c @@ -683,7 +683,7 @@ int misc_init_r(void)  	return 0;  } -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	phys_addr_t base;  	phys_size_t size; @@ -706,6 +706,8 @@ void ft_board_setup(void *blob, bd_t *bd)  	fdt_fixup_fman_ethernet(blob);  	fdt_fixup_board_enet(blob);  #endif + +	return 0;  }  /* diff --git a/board/freescale/t4rdb/t4240rdb.c b/board/freescale/t4rdb/t4240rdb.c index 2ff77b84873..fac442bfc8c 100644 --- a/board/freescale/t4rdb/t4240rdb.c +++ b/board/freescale/t4rdb/t4240rdb.c @@ -88,7 +88,7 @@ int misc_init_r(void)  	return 0;  } -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	phys_addr_t base;  	phys_size_t size; @@ -111,6 +111,8 @@ void ft_board_setup(void *blob, bd_t *bd)  	fdt_fixup_fman_ethernet(blob);  	fdt_fixup_board_enet(blob);  #endif + +	return 0;  }  /* diff --git a/board/galaxy5200/galaxy5200.c b/board/galaxy5200/galaxy5200.c index 29e40eb58aa..5d957b7e70f 100644 --- a/board/galaxy5200/galaxy5200.c +++ b/board/galaxy5200/galaxy5200.c @@ -146,9 +146,11 @@ int checkboard(void)  }  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t * bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd); + +	return 0;  }  #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */ diff --git a/board/gateworks/gw_ventana/clocks.cfg b/board/gateworks/gw_ventana/clocks.cfg deleted file mode 100644 index a8118a258e8..00000000000 --- a/board/gateworks/gw_ventana/clocks.cfg +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2013 Boundary Devices - * Copyright (C) 2013 Gateworks Corporation - * - * SPDX-License-Identifier: GPL-2.0+ - * - * Device Configuration Data (DCD) - * - * Each entry must have the format: - * Addr-type           Address        Value - * - * where: - *      Addr-type register length (1,2 or 4 bytes) - *      Address   absolute address of the register - *      value     value to be stored in the register - */ - -/* set the default clock gate to save power */ -DATA 4, CCM_CCGR0, 0x00C03F3F -DATA 4, CCM_CCGR1, 0x0030FC03 -DATA 4, CCM_CCGR2, 0x0FFFC000 -DATA 4, CCM_CCGR3, 0x3FF00000 -DATA 4, CCM_CCGR4, 0xFFFFF300 /* enable NAND/GPMI/BCH clocks */ -DATA 4, CCM_CCGR5, 0x0F0000C3 -DATA 4, CCM_CCGR6, 0x000003FF - -/* enable AXI cache for VDOA/VPU/IPU */ -DATA 4, MX6_IOMUXC_GPR4, 0xF00000CF -/* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */ -DATA 4, MX6_IOMUXC_GPR6, 0x007F007F -DATA 4, MX6_IOMUXC_GPR7, 0x007F007F - -/* - * Setup CCM_CCOSR register as follows: - * - * cko1_en  = 1    --> CKO1 enabled - * cko1_div = 111  --> divide by 8 - * cko1_sel = 1011 --> ahb_clk_root - * - * This sets CKO1 at ahb_clk_root/8 = 132/8 = 16.5 MHz - */ -DATA 4, CCM_CCOSR, 0x000000fb diff --git a/board/gateworks/gw_ventana/gw_ventana.c b/board/gateworks/gw_ventana/gw_ventana.c index df491a8fc88..bb08cd272ef 100644 --- a/board/gateworks/gw_ventana/gw_ventana.c +++ b/board/gateworks/gw_ventana/gw_ventana.c @@ -1483,7 +1483,7 @@ int misc_init_r(void)   *  - board (full model from EEPROM)   *  - peripherals removed from DTB if not loaded on board (per EEPROM config)   */ -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	struct ventana_board_info *info = &ventana_info;  	struct ventana_eeprom_config *cfg; @@ -1495,7 +1495,7 @@ void ft_board_setup(void *blob, bd_t *bd)  	if (getenv("fdt_noauto")) {  		puts("   Skiping ft_board_setup (fdt_noauto defined)\n"); -		return; +		return 0;  	}  	/* Update partition nodes using info from mtdparts env var */ @@ -1504,7 +1504,7 @@ void ft_board_setup(void *blob, bd_t *bd)  	if (!model) {  		puts("invalid board info: Leaving FDT fully enabled\n"); -		return; +		return 0;  	}  	printf("   Adjusting FDT per EEPROM for %s...\n", model); @@ -1523,7 +1523,7 @@ void ft_board_setup(void *blob, bd_t *bd)  	 */  	if (getenv("fdt_noconfig")) {  		puts("   Skiping periperhal config (fdt_noconfig defined)\n"); -		return; +		return 0;  	}  	cfg = econfig;  	while (cfg->name) { @@ -1533,6 +1533,8 @@ void ft_board_setup(void *blob, bd_t *bd)  		}  		cfg++;  	} + +	return 0;  }  #endif /* defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP) */ diff --git a/board/gateworks/gw_ventana/gw_ventana.cfg b/board/gateworks/gw_ventana/gw_ventana.cfg deleted file mode 100644 index 9ab95f5c93f..00000000000 --- a/board/gateworks/gw_ventana/gw_ventana.cfg +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2013 Gateworks Corporation - * - * SPDX-License-Identifier: GPL-2.0+ - * - * Refer doc/README.imximage for more details about how-to configure - * and create imximage boot image - * - * The syntax is taken as close as possible with the kwbimage - */ - -/* image version */ -IMAGE_VERSION 2 - -/* - * Boot Device : one of - * spi, sd, nand, sata - */ -#ifdef CONFIG_SPI_FLASH -BOOT_FROM      spi -#else -BOOT_FROM      nand -#endif - -#define __ASSEMBLY__ -#include <config.h> -#include "asm/arch/iomux.h" -#include "asm/arch/crm_regs.h" -#include "clocks.cfg" diff --git a/board/gateworks/gw_ventana/gw_ventana_spl.c b/board/gateworks/gw_ventana/gw_ventana_spl.c index ca35b3cb7ec..d6a584745bd 100644 --- a/board/gateworks/gw_ventana/gw_ventana_spl.c +++ b/board/gateworks/gw_ventana/gw_ventana_spl.c @@ -8,6 +8,7 @@  #include <common.h>  #include <i2c.h>  #include <asm/io.h> +#include <asm/arch/crm_regs.h>  #include <asm/arch/iomux.h>  #include <asm/arch/mx6-ddr.h>  #include <asm/arch/mx6-pins.h> @@ -392,6 +393,30 @@ static void spl_dram_init(int width, int size_mb, int board_model)  	mx6_dram_cfg(&sysinfo, calib, mem);  } +static void ccgr_init(void) +{ +	struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR; + +	writel(0x00C03F3F, &ccm->CCGR0); +	writel(0x0030FC03, &ccm->CCGR1); +	writel(0x0FFFC000, &ccm->CCGR2); +	writel(0x3FF00000, &ccm->CCGR3); +	writel(0x00FFF300, &ccm->CCGR4); +	writel(0x0F0000C3, &ccm->CCGR5); +	writel(0x000003FF, &ccm->CCGR6); +} + +static void gpr_init(void) +{ +	struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR; + +	/* enable AXI cache for VDOA/VPU/IPU */ +	writel(0xF00000CF, &iomux->gpr[4]); +	/* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */ +	writel(0x007F007F, &iomux->gpr[6]); +	writel(0x007F007F, &iomux->gpr[7]); +} +  /*   * called from C runtime startup code (arch/arm/lib/crt0.S:_main)   * - we have a stack and a place to store GD, both in SRAM @@ -405,6 +430,9 @@ void board_init_f(ulong dummy)  	/* setup AIPS and disable watchdog */  	arch_cpu_init(); +	ccgr_init(); +	gpr_init(); +  	/* iomux and setup of i2c */  	board_early_init_f();  	i2c_setup_iomux(); diff --git a/board/gdsys/405ep/iocon.c b/board/gdsys/405ep/iocon.c index 1bac97027d4..3a51d864cdb 100644 --- a/board/gdsys/405ep/iocon.c +++ b/board/gdsys/405ep/iocon.c @@ -17,6 +17,7 @@  #include "../common/osd.h"  #include "../common/mclink.h" +#include "../common/phy.h"  #include <i2c.h>  #include <pca953x.h> @@ -98,8 +99,6 @@ enum {  unsigned int mclink_fpgacount;  struct ihs_fpga *fpga_ptr[] = CONFIG_SYS_FPGA_PTR; -static int setup_88e1518(const char *bus, unsigned char addr); -  int fpga_set_reg(u32 fpga, u16 *reg, off_t regoff, u16 data)  {  	int res; @@ -180,11 +179,11 @@ static void print_fpga_info(unsigned int fpga, bool rgmii2_present)  	unsigned feature_carriers;  	unsigned feature_video_channels; -	int legacy = get_fpga_state(0) & FPGA_STATE_PLATFORM; +	int legacy = get_fpga_state(fpga) & FPGA_STATE_PLATFORM; -	FPGA_GET_REG(0, versions, &versions); -	FPGA_GET_REG(0, fpga_version, &fpga_version); -	FPGA_GET_REG(0, fpga_features, &fpga_features); +	FPGA_GET_REG(fpga, versions, &versions); +	FPGA_GET_REG(fpga, fpga_version, &fpga_version); +	FPGA_GET_REG(fpga, fpga_features, &fpga_features);  	unit_type = (versions & 0xf000) >> 12;  	feature_compression = (fpga_features & 0xe000) >> 13; @@ -369,10 +368,11 @@ int last_stage_init(void)  	unsigned char mclink_controllers[] = { 0x24, 0x25, 0x26 };  	int legacy = get_fpga_state(0) & FPGA_STATE_PLATFORM;  	u16 fpga_features; -	int feature_carrier_speed = fpga_features & (1<<4); +	int feature_carrier_speed;  	bool ch0_rgmii2_present = false;  	FPGA_GET_REG(0, fpga_features, &fpga_features); +	feature_carrier_speed = fpga_features & (1<<4);  	if (!legacy) {  		/* Turn on Parade DP501 */ @@ -646,190 +646,3 @@ struct bb_miiphy_bus bb_miiphy_buses[] = {  int bb_miiphy_buses_num = sizeof(bb_miiphy_buses) /  			  sizeof(bb_miiphy_buses[0]); - -enum { -	MIICMD_SET, -	MIICMD_MODIFY, -	MIICMD_VERIFY_VALUE, -	MIICMD_WAIT_FOR_VALUE, -}; - -struct mii_setupcmd { -	u8 token; -	u8 reg; -	u16 data; -	u16 mask; -	u32 timeout; -}; - -/* - * verify we are talking to a 88e1518 - */ -struct mii_setupcmd verify_88e1518[] = { -	{ MIICMD_SET, 22, 0x0000 }, -	{ MIICMD_VERIFY_VALUE, 2, 0x0141, 0xffff }, -	{ MIICMD_VERIFY_VALUE, 3, 0x0dd0, 0xfff0 }, -}; - -/* - * workaround for erratum mentioned in 88E1518 release notes - */ -struct mii_setupcmd fixup_88e1518[] = { -	{ MIICMD_SET, 22, 0x00ff }, -	{ MIICMD_SET, 17, 0x214b }, -	{ MIICMD_SET, 16, 0x2144 }, -	{ MIICMD_SET, 17, 0x0c28 }, -	{ MIICMD_SET, 16, 0x2146 }, -	{ MIICMD_SET, 17, 0xb233 }, -	{ MIICMD_SET, 16, 0x214d }, -	{ MIICMD_SET, 17, 0xcc0c }, -	{ MIICMD_SET, 16, 0x2159 }, -	{ MIICMD_SET, 22, 0x00fb }, -	{ MIICMD_SET,  7, 0xc00d }, -	{ MIICMD_SET, 22, 0x0000 }, -}; - -/* - * default initialization: - * - set RGMII receive timing to "receive clock transition when data stable" - * - set RGMII transmit timing to "transmit clock internally delayed" - * - set RGMII output impedance target to 78,8 Ohm - * - run output impedance calibration - * - set autonegotiation advertise to 1000FD only - */ -struct mii_setupcmd default_88e1518[] = { -	{ MIICMD_SET, 22, 0x0002 }, -	{ MIICMD_MODIFY, 21, 0x0030, 0x0030 }, -	{ MIICMD_MODIFY, 25, 0x0000, 0x0003 }, -	{ MIICMD_MODIFY, 24, 0x8000, 0x8000 }, -	{ MIICMD_WAIT_FOR_VALUE, 24, 0x4000, 0x4000, 2000 }, -	{ MIICMD_SET, 22, 0x0000 }, -	{ MIICMD_MODIFY, 4, 0x0000, 0x01e0 }, -	{ MIICMD_MODIFY, 9, 0x0200, 0x0300 }, -}; - -/* - * turn off CLK125 for PHY daughterboard - */ -struct mii_setupcmd ch1fix_88e1518[] = { -	{ MIICMD_SET, 22, 0x0002 }, -	{ MIICMD_MODIFY, 16, 0x0006, 0x0006 }, -	{ MIICMD_SET, 22, 0x0000 }, -}; - -/* - * perform copper software reset - */ -struct mii_setupcmd swreset_88e1518[] = { -	{ MIICMD_SET, 22, 0x0000 }, -	{ MIICMD_MODIFY, 0, 0x8000, 0x8000 }, -	{ MIICMD_WAIT_FOR_VALUE, 0, 0x0000, 0x8000, 2000 }, -}; - -static int process_setupcmd(const char *bus, unsigned char addr, -			    struct mii_setupcmd *setupcmd) -{ -	int res; -	u8 reg = setupcmd->reg; -	u16 data = setupcmd->data; -	u16 mask = setupcmd->mask; -	u32 timeout = setupcmd->timeout; -	u16 orig_data; -	unsigned long start; - -	debug("mii %s:%u reg %2u ", bus, addr, reg); - -	switch (setupcmd->token) { -	case MIICMD_MODIFY: -		res = miiphy_read(bus, addr, reg, &orig_data); -		if (res) -			break; -		debug("is %04x. (value %04x mask %04x) ", orig_data, data, -		      mask); -		data = (orig_data & ~mask) | (data & mask); -	case MIICMD_SET: -		debug("=> %04x\n", data); -		res = miiphy_write(bus, addr, reg, data); -		break; -	case MIICMD_VERIFY_VALUE: -		res = miiphy_read(bus, addr, reg, &orig_data); -		if (res) -			break; -		if ((orig_data & mask) != (data & mask)) -			res = -1; -		debug("(value %04x mask %04x) == %04x? %s\n", data, mask, -		      orig_data, res ? "FAIL" : "PASS"); -		break; -	case MIICMD_WAIT_FOR_VALUE: -		res = -1; -		start = get_timer(0); -		while ((res != 0) && (get_timer(start) < timeout)) { -			res = miiphy_read(bus, addr, reg, &orig_data); -			if (res) -				continue; -			if ((orig_data & mask) != (data & mask)) -				res = -1; -		} -		debug("(value %04x mask %04x) == %04x? %s after %lu ms\n", data, -		      mask, orig_data, res ? "FAIL" : "PASS", -		      get_timer(start)); -		break; -	default: -		res = -1; -		break; -	} - -	return res; -} - -static int process_setup(const char *bus, unsigned char addr, -			    struct mii_setupcmd *setupcmd, unsigned int count) -{ -	int res = 0; -	unsigned int k; - -	for (k = 0; k < count; ++k) { -		res = process_setupcmd(bus, addr, &setupcmd[k]); -		if (res) { -			printf("mii cmd %u on bus %s addr %u failed, aborting setup", -			       setupcmd[k].token, bus, addr); -			break; -		} -	} - -	return res; -} - -static int setup_88e1518(const char *bus, unsigned char addr) -{ -	int res; - -	res = process_setup(bus, addr, -			    verify_88e1518, ARRAY_SIZE(verify_88e1518)); -	if (res) -		return res; - -	res = process_setup(bus, addr, -			    fixup_88e1518, ARRAY_SIZE(fixup_88e1518)); -	if (res) -		return res; - -	res = process_setup(bus, addr, -			    default_88e1518, ARRAY_SIZE(default_88e1518)); -	if (res) -		return res; - -	if (addr) { -		res = process_setup(bus, addr, -				    ch1fix_88e1518, ARRAY_SIZE(ch1fix_88e1518)); -		if (res) -			return res; -	} - -	res = process_setup(bus, addr, -			    swreset_88e1518, ARRAY_SIZE(swreset_88e1518)); -	if (res) -		return res; - -	return 0; -} diff --git a/board/gdsys/common/Makefile b/board/gdsys/common/Makefile index 7f8b4277ebc..49579434df5 100644 --- a/board/gdsys/common/Makefile +++ b/board/gdsys/common/Makefile @@ -6,8 +6,10 @@  #  obj-$(CONFIG_SYS_FPGA_COMMON) += fpga.o +obj-$(CONFIG_CMD_IOLOOP) += cmd_ioloop.o  obj-$(CONFIG_IO) += miiphybb.o  obj-$(CONFIG_IO64) += miiphybb.o -obj-$(CONFIG_IOCON) += osd.o mclink.o dp501.o +obj-$(CONFIG_IOCON) += osd.o mclink.o dp501.o phy.o  obj-$(CONFIG_DLVISION_10G) += osd.o  obj-$(CONFIG_CONTROLCENTERD) += dp501.o +obj-$(CONFIG_HRCON) += osd.o mclink.o dp501.o phy.o diff --git a/board/gdsys/common/cmd_ioloop.c b/board/gdsys/common/cmd_ioloop.c new file mode 100644 index 00000000000..e0c74fee808 --- /dev/null +++ b/board/gdsys/common/cmd_ioloop.c @@ -0,0 +1,295 @@ +/* + * (C) Copyright 2014 + * Dirk Eibach, Guntermann & Drunck GmbH, dirk.eibach@gdsys.cc + * + * SPDX-License-Identifier:	GPL-2.0+ + */ + +#include <common.h> +#include <command.h> + +#include <gdsys_fpga.h> + +enum { +	STATE_TX_PACKET_BUILDING = 1<<0, +	STATE_TX_TRANSMITTING = 1<<1, +	STATE_TX_BUFFER_FULL = 1<<2, +	STATE_TX_ERR = 1<<3, +	STATE_RECEIVE_TIMEOUT = 1<<4, +	STATE_PROC_RX_STORE_TIMEOUT = 1<<5, +	STATE_PROC_RX_RECEIVE_TIMEOUT = 1<<6, +	STATE_RX_DIST_ERR = 1<<7, +	STATE_RX_LENGTH_ERR = 1<<8, +	STATE_RX_FRAME_CTR_ERR = 1<<9, +	STATE_RX_FCS_ERR = 1<<10, +	STATE_RX_PACKET_DROPPED = 1<<11, +	STATE_RX_DATA_LAST = 1<<12, +	STATE_RX_DATA_FIRST = 1<<13, +	STATE_RX_DATA_AVAILABLE = 1<<15, +}; + +enum { +	CTRL_PROC_RECEIVE_ENABLE = 1<<12, +	CTRL_FLUSH_TRANSMIT_BUFFER = 1<<15, +}; + +enum { +	IRQ_CPU_TRANSMITBUFFER_FREE_STATUS = 1<<5, +	IRQ_CPU_PACKET_TRANSMITTED_EVENT = 1<<6, +	IRQ_NEW_CPU_PACKET_RECEIVED_EVENT = 1<<7, +	IRQ_CPU_RECEIVE_DATA_AVAILABLE_STATUS = 1<<8, +}; + +struct io_generic_packet { +	u16 target_address; +	u16 source_address; +	u8 packet_type; +	u8 bc; +	u16 packet_length; +} __attribute__((__packed__)); + +unsigned long long rx_ctr; +unsigned long long tx_ctr; +unsigned long long err_ctr; + +static void io_check_status(unsigned int fpga, u16 status, bool silent) +{ +	u16 mask = STATE_RX_DIST_ERR | STATE_RX_LENGTH_ERR | +		   STATE_RX_FRAME_CTR_ERR | STATE_RX_FCS_ERR | +		   STATE_RX_PACKET_DROPPED | STATE_TX_ERR; + +	if (!(status & mask)) { +		FPGA_SET_REG(fpga, ep.rx_tx_status, status); +		return; +	} + +	err_ctr++; +	FPGA_SET_REG(fpga, ep.rx_tx_status, status); + +	if (silent) +		return; + +	if (status & STATE_RX_PACKET_DROPPED) +		printf("RX_PACKET_DROPPED, status %04x\n", status); + +	if (status & STATE_RX_DIST_ERR) +		printf("RX_DIST_ERR\n"); +	if (status & STATE_RX_LENGTH_ERR) +		printf("RX_LENGTH_ERR\n"); +	if (status & STATE_RX_FRAME_CTR_ERR) +		printf("RX_FRAME_CTR_ERR\n"); +	if (status & STATE_RX_FCS_ERR) +		printf("RX_FCS_ERR\n"); + +	if (status & STATE_TX_ERR) +		printf("TX_ERR\n"); +} + +static void io_send(unsigned int fpga, unsigned int size) +{ +	unsigned int k; +	struct io_generic_packet packet = { +		.source_address = 1, +		.packet_type = 1, +		.packet_length = size, +	}; +	u16 *p = (u16 *)&packet; + +	for (k = 0; k < sizeof(packet) / 2; ++k) +		FPGA_SET_REG(fpga, ep.transmit_data, *p++); + +	for (k = 0; k < (size + 1) / 2; ++k) +		FPGA_SET_REG(fpga, ep.transmit_data, k); + +	FPGA_SET_REG(fpga, ep.rx_tx_control, +		     CTRL_PROC_RECEIVE_ENABLE | CTRL_FLUSH_TRANSMIT_BUFFER); + +	tx_ctr++; +} + +static void io_receive(unsigned int fpga) +{ +	unsigned int k = 0; +	u16 rx_tx_status; + +	FPGA_GET_REG(fpga, ep.rx_tx_status, &rx_tx_status); + +	while (rx_tx_status & STATE_RX_DATA_AVAILABLE) { +		u16 rx; + +		if (rx_tx_status & STATE_RX_DATA_LAST) +			rx_ctr++; + +		FPGA_GET_REG(fpga, ep.receive_data, &rx); + +		FPGA_GET_REG(fpga, ep.rx_tx_status, &rx_tx_status); + +		++k; +	} +} + +static void io_reflect(unsigned int fpga) +{ +	u16 buffer[128]; + +	unsigned int k = 0; +	unsigned int n; +	u16 rx_tx_status; + +	FPGA_GET_REG(fpga, ep.rx_tx_status, &rx_tx_status); + +	while (rx_tx_status & STATE_RX_DATA_AVAILABLE) { +		FPGA_GET_REG(fpga, ep.receive_data, &buffer[k++]); +		if (rx_tx_status & STATE_RX_DATA_LAST) +			break; + +		FPGA_GET_REG(fpga, ep.rx_tx_status, &rx_tx_status); +	} + +	if (!k) +		return; + +	for (n = 0; n < k; ++n) +		FPGA_SET_REG(fpga, ep.transmit_data, buffer[n]); + +	FPGA_SET_REG(fpga, ep.rx_tx_control, +		     CTRL_PROC_RECEIVE_ENABLE | CTRL_FLUSH_TRANSMIT_BUFFER); + +	tx_ctr++; +} + +/* + * FPGA io-endpoint reflector + * + * Syntax: + *	ioreflect {fpga} {reportrate} + */ +int do_ioreflect(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ +	unsigned int fpga; +	unsigned int rate = 0; +	unsigned long long last_seen = 0; + +	if (argc < 2) +		return CMD_RET_USAGE; + +	fpga = simple_strtoul(argv[1], NULL, 10); + +	/* +	 * If another parameter, it is the report rate in packets. +	 */ +	if (argc > 2) +		rate = simple_strtoul(argv[2], NULL, 10); + +	/* enable receive path */ +	FPGA_SET_REG(fpga, ep.rx_tx_control, CTRL_PROC_RECEIVE_ENABLE); + +	/* set device address to dummy 1*/ +	FPGA_SET_REG(fpga, ep.device_address, 1); + +	rx_ctr = 0; tx_ctr = 0; err_ctr = 0; + +	while (1) { +		u16 top_int; +		u16 rx_tx_status; + +		FPGA_GET_REG(fpga, top_interrupt, &top_int); +		FPGA_GET_REG(fpga, ep.rx_tx_status, &rx_tx_status); + +		io_check_status(fpga, rx_tx_status, true); +		if ((top_int & IRQ_CPU_RECEIVE_DATA_AVAILABLE_STATUS) && +		    (top_int & IRQ_CPU_TRANSMITBUFFER_FREE_STATUS)) +			io_reflect(fpga); + +		if (rate) { +			if (!(tx_ctr % rate) && (tx_ctr != last_seen)) +				printf("refl %llu, err %llu\n", tx_ctr, +				       err_ctr); +			last_seen = tx_ctr; +		} + +		if (ctrlc()) +			break; +	} + +	return 0; +} + +/* + * FPGA io-endpoint looptest + * + * Syntax: + *	ioloop {fpga} {size} {rate} + */ +#define DISP_LINE_LEN	16 +int do_ioloop(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ +	unsigned int fpga; +	unsigned int size; +	unsigned int rate = 0; + +	if (argc < 3) +		return CMD_RET_USAGE; + +	/* +	 * FPGA is specified since argc > 2 +	 */ +	fpga = simple_strtoul(argv[1], NULL, 10); + +	/* +	 * packet size is specified since argc > 2 +	 */ +	size = simple_strtoul(argv[2], NULL, 10); + +	/* +	 * If another parameter, it is the test rate in packets per second. +	 */ +	if (argc > 3) +		rate = simple_strtoul(argv[3], NULL, 10); + +	/* enable receive path */ +	FPGA_SET_REG(fpga, ep.rx_tx_control, CTRL_PROC_RECEIVE_ENABLE); + +	/* set device address to dummy 1*/ +	FPGA_SET_REG(fpga, ep.device_address, 1); + +	rx_ctr = 0; tx_ctr = 0; err_ctr = 0; + +	while (1) { +		u16 top_int; +		u16 rx_tx_status; + +		FPGA_GET_REG(fpga, top_interrupt, &top_int); +		FPGA_GET_REG(fpga, ep.rx_tx_status, &rx_tx_status); + +		io_check_status(fpga, rx_tx_status, false); +		if (top_int & IRQ_CPU_TRANSMITBUFFER_FREE_STATUS) +			io_send(fpga, size); +		if (top_int & IRQ_CPU_RECEIVE_DATA_AVAILABLE_STATUS) +			io_receive(fpga); + +		if (rate) { +			if (ctrlc()) +				break; +			udelay(1000000 / rate); +			if (!(tx_ctr % rate)) +				printf("d %lld, tx %llu, rx %llu, err %llu\n", +				       tx_ctr - rx_ctr, tx_ctr, rx_ctr, +				       err_ctr); +		} +	} + +	return 0; +} + +U_BOOT_CMD( +	ioloop,	4,	0,	do_ioloop, +	"fpga io-endpoint looptest", +	"fpga packetsize [packets/sec]" +); + +U_BOOT_CMD( +	ioreflect, 3,	0,	do_ioreflect, +	"fpga io-endpoint reflector", +	"fpga reportrate" +); diff --git a/board/gdsys/common/ihs_mdio.c b/board/gdsys/common/ihs_mdio.c new file mode 100644 index 00000000000..1d6eb7bd55f --- /dev/null +++ b/board/gdsys/common/ihs_mdio.c @@ -0,0 +1,88 @@ +/* + * (C) Copyright 2014 + * Dirk Eibach,  Guntermann & Drunck GmbH, eibach@gdsys.de + * + * SPDX-License-Identifier:	GPL-2.0+ + */ + +#include <common.h> + +#include <gdsys_fpga.h> +#include <miiphy.h> + +#include "ihs_mdio.h" + +static int ihs_mdio_idle(struct mii_dev *bus) +{ +	struct ihs_mdio_info *info = bus->priv; +	u16 val; +	unsigned int ctr = 0; + +	do { +		FPGA_GET_REG(info->fpga, mdio.control, &val); +		udelay(100); +		if (ctr++ > 10) +			return -1; +	} while (!(val & (1 << 12))); + +	return 0; +} + +static int ihs_mdio_reset(struct mii_dev *bus) +{ +	ihs_mdio_idle(bus); + +	return 0; +} + +static int ihs_mdio_read(struct mii_dev *bus, int addr, int dev_addr, +			 int regnum) +{ +	struct ihs_mdio_info *info = bus->priv; +	u16 val; + +	ihs_mdio_idle(bus); + +	FPGA_SET_REG(info->fpga, mdio.control, +		     ((addr & 0x1f) << 5) | (regnum & 0x1f) | (2 << 10)); + +	/* wait for rx data available */ +	udelay(100); + +	FPGA_GET_REG(info->fpga, mdio.rx_data, &val); + +	return val; +} + +static int ihs_mdio_write(struct mii_dev *bus, int addr, int dev_addr, +			  int regnum, u16 value) +{ +	struct ihs_mdio_info *info = bus->priv; + +	ihs_mdio_idle(bus); + +	FPGA_SET_REG(info->fpga, mdio.address_data, value); +	FPGA_SET_REG(info->fpga, mdio.control, +		     ((addr & 0x1f) << 5) | (regnum & 0x1f) | (1 << 10)); + +	return 0; +} + +int ihs_mdio_init(struct ihs_mdio_info *info) +{ +	struct mii_dev *bus = mdio_alloc(); + +	if (!bus) { +		printf("Failed to allocate FSL MDIO bus\n"); +		return -1; +	} + +	bus->read = ihs_mdio_read; +	bus->write = ihs_mdio_write; +	bus->reset = ihs_mdio_reset; +	sprintf(bus->name, info->name); + +	bus->priv = info; + +	return mdio_register(bus); +} diff --git a/board/gdsys/common/ihs_mdio.h b/board/gdsys/common/ihs_mdio.h new file mode 100644 index 00000000000..64b40493780 --- /dev/null +++ b/board/gdsys/common/ihs_mdio.h @@ -0,0 +1,18 @@ +/* + * (C) Copyright 2014 + * Dirk Eibach,  Guntermann & Drunck GmbH, dirk.eibach@gdsys.cc + * + * SPDX-License-Identifier:	GPL-2.0+ + */ + +#ifndef _IHS_MDIO_H_ +#define _IHS_MDIO_H_ + +struct ihs_mdio_info { +	u32 fpga; +	char *name; +}; + +int ihs_mdio_init(struct ihs_mdio_info *info); + +#endif diff --git a/board/gdsys/common/osd.c b/board/gdsys/common/osd.c index 1c765e4cbfb..55ecdf10127 100644 --- a/board/gdsys/common/osd.c +++ b/board/gdsys/common/osd.c @@ -289,7 +289,6 @@ int osd_probe(unsigned screen)  {  	u16 version;  	u16 features; -	u8 value;  	int old_bus = i2c_get_bus_num();  	bool pixclock_present = false;  	bool output_driver_present = false; @@ -330,7 +329,8 @@ int osd_probe(unsigned screen)  #ifdef CONFIG_SYS_CH7301_I2C  	i2c_set_bus_num(ch7301_i2c[screen]);  	if (!i2c_probe(CH7301_I2C_ADDR)) { -		value = i2c_reg_read(CH7301_I2C_ADDR, CH7301_DID); +		u8 value = i2c_reg_read(CH7301_I2C_ADDR, CH7301_DID); +  		if (value == 0x17) {  			i2c_reg_write(CH7301_I2C_ADDR, CH7301_TPCP, 0x08);  			i2c_reg_write(CH7301_I2C_ADDR, CH7301_TPD, 0x16); @@ -345,8 +345,7 @@ int osd_probe(unsigned screen)  #ifdef CONFIG_SYS_SIL1178_I2C  	i2c_set_bus_num(sil1178_i2c[screen]);  	if (!i2c_probe(SIL1178_SLAVE_I2C_ADDRESS)) { -		value = i2c_reg_read(SIL1178_SLAVE_I2C_ADDRESS, 0x02); -		if (value == 0x06) { +		if (i2c_reg_read(SIL1178_SLAVE_I2C_ADDRESS, 0x02) == 0x06) {  			/*  			 * magic initialization sequence,  			 * adapted from datasheet diff --git a/board/gdsys/common/phy.c b/board/gdsys/common/phy.c new file mode 100644 index 00000000000..fb926581788 --- /dev/null +++ b/board/gdsys/common/phy.c @@ -0,0 +1,280 @@ +/* + * (C) Copyright 2014 + * Dirk Eibach,  Guntermann & Drunck GmbH, eibach@gdsys.de + * + * SPDX-License-Identifier:	GPL-2.0+ + */ + +#include <common.h> + +#include <miiphy.h> + +enum { +	MIICMD_SET, +	MIICMD_MODIFY, +	MIICMD_VERIFY_VALUE, +	MIICMD_WAIT_FOR_VALUE, +}; + +struct mii_setupcmd { +	u8 token; +	u8 reg; +	u16 data; +	u16 mask; +	u32 timeout; +}; + +/* + * verify we are talking to a 88e1518 + */ +struct mii_setupcmd verify_88e1518[] = { +	{ MIICMD_SET, 22, 0x0000 }, +	{ MIICMD_VERIFY_VALUE, 2, 0x0141, 0xffff }, +	{ MIICMD_VERIFY_VALUE, 3, 0x0dd0, 0xfff0 }, +}; + +/* + * workaround for erratum mentioned in 88E1518 release notes + */ +struct mii_setupcmd fixup_88e1518[] = { +	{ MIICMD_SET, 22, 0x00ff }, +	{ MIICMD_SET, 17, 0x214b }, +	{ MIICMD_SET, 16, 0x2144 }, +	{ MIICMD_SET, 17, 0x0c28 }, +	{ MIICMD_SET, 16, 0x2146 }, +	{ MIICMD_SET, 17, 0xb233 }, +	{ MIICMD_SET, 16, 0x214d }, +	{ MIICMD_SET, 17, 0xcc0c }, +	{ MIICMD_SET, 16, 0x2159 }, +	{ MIICMD_SET, 22, 0x00fb }, +	{ MIICMD_SET,  7, 0xc00d }, +	{ MIICMD_SET, 22, 0x0000 }, +}; + +/* + * default initialization: + * - set RGMII receive timing to "receive clock transition when data stable" + * - set RGMII transmit timing to "transmit clock internally delayed" + * - set RGMII output impedance target to 78,8 Ohm + * - run output impedance calibration + * - set autonegotiation advertise to 1000FD only + */ +struct mii_setupcmd default_88e1518[] = { +	{ MIICMD_SET, 22, 0x0002 }, +	{ MIICMD_MODIFY, 21, 0x0030, 0x0030 }, +	{ MIICMD_MODIFY, 25, 0x0000, 0x0003 }, +	{ MIICMD_MODIFY, 24, 0x8000, 0x8000 }, +	{ MIICMD_WAIT_FOR_VALUE, 24, 0x4000, 0x4000, 2000 }, +	{ MIICMD_SET, 22, 0x0000 }, +	{ MIICMD_MODIFY, 4, 0x0000, 0x01e0 }, +	{ MIICMD_MODIFY, 9, 0x0200, 0x0300 }, +}; + +/* + * turn off CLK125 for PHY daughterboard + */ +struct mii_setupcmd ch1fix_88e1518[] = { +	{ MIICMD_SET, 22, 0x0002 }, +	{ MIICMD_MODIFY, 16, 0x0006, 0x0006 }, +	{ MIICMD_SET, 22, 0x0000 }, +}; + +/* + * perform copper software reset + */ +struct mii_setupcmd swreset_88e1518[] = { +	{ MIICMD_SET, 22, 0x0000 }, +	{ MIICMD_MODIFY, 0, 0x8000, 0x8000 }, +	{ MIICMD_WAIT_FOR_VALUE, 0, 0x0000, 0x8000, 2000 }, +}; + +/* + * special one for 88E1514: + * Force SGMII to Copper mode + */ +struct mii_setupcmd mii_to_copper_88e1514[] = { +	{ MIICMD_SET, 22, 0x0012 }, +	{ MIICMD_MODIFY, 20, 0x0001, 0x0007 }, +	{ MIICMD_MODIFY, 20, 0x8000, 0x8000 }, +	{ MIICMD_SET, 22, 0x0000 }, +}; + +/* + * turn off SGMII auto-negotiation + */ +struct mii_setupcmd sgmii_autoneg_off_88e1518[] = { +	{ MIICMD_SET, 22, 0x0001 }, +	{ MIICMD_MODIFY, 0, 0x0000, 0x1000 }, +	{ MIICMD_MODIFY, 0, 0x8000, 0x8000 }, +	{ MIICMD_SET, 22, 0x0000 }, +}; + +/* + * invert LED2 polarity + */ +struct mii_setupcmd invert_led2_88e1514[] = { +	{ MIICMD_SET, 22, 0x0003 }, +	{ MIICMD_MODIFY, 17, 0x0030, 0x0010 }, +	{ MIICMD_SET, 22, 0x0000 }, +}; + +static int process_setupcmd(const char *bus, unsigned char addr, +			    struct mii_setupcmd *setupcmd) +{ +	int res; +	u8 reg = setupcmd->reg; +	u16 data = setupcmd->data; +	u16 mask = setupcmd->mask; +	u32 timeout = setupcmd->timeout; +	u16 orig_data; +	unsigned long start; + +	debug("mii %s:%u reg %2u ", bus, addr, reg); + +	switch (setupcmd->token) { +	case MIICMD_MODIFY: +		res = miiphy_read(bus, addr, reg, &orig_data); +		if (res) +			break; +		debug("is %04x. (value %04x mask %04x) ", orig_data, data, +		      mask); +		data = (orig_data & ~mask) | (data & mask); +		/* fallthrough */ +	case MIICMD_SET: +		debug("=> %04x\n", data); +		res = miiphy_write(bus, addr, reg, data); +		break; +	case MIICMD_VERIFY_VALUE: +		res = miiphy_read(bus, addr, reg, &orig_data); +		if (res) +			break; +		if ((orig_data & mask) != (data & mask)) +			res = -1; +		debug("(value %04x mask %04x) == %04x? %s\n", data, mask, +		      orig_data, res ? "FAIL" : "PASS"); +		break; +	case MIICMD_WAIT_FOR_VALUE: +		res = -1; +		start = get_timer(0); +		while ((res != 0) && (get_timer(start) < timeout)) { +			res = miiphy_read(bus, addr, reg, &orig_data); +			if (res) +				continue; +			if ((orig_data & mask) != (data & mask)) +				res = -1; +		} +		debug("(value %04x mask %04x) == %04x? %s after %lu ms\n", data, +		      mask, orig_data, res ? "FAIL" : "PASS", +		      get_timer(start)); +		break; +	default: +		res = -1; +		break; +	} + +	return res; +} + +static int process_setup(const char *bus, unsigned char addr, +			    struct mii_setupcmd *setupcmd, unsigned int count) +{ +	int res = 0; +	unsigned int k; + +	for (k = 0; k < count; ++k) { +		res = process_setupcmd(bus, addr, &setupcmd[k]); +		if (res) { +			printf("mii cmd %u on bus %s addr %u failed, aborting setup\n", +			       setupcmd[k].token, bus, addr); +			break; +		} +	} + +	return res; +} + +int setup_88e1518(const char *bus, unsigned char addr) +{ +	int res; + +	res = process_setup(bus, addr, +			    verify_88e1518, ARRAY_SIZE(verify_88e1518)); +	if (res) +		return res; + +	res = process_setup(bus, addr, +			    fixup_88e1518, ARRAY_SIZE(fixup_88e1518)); +	if (res) +		return res; + +	res = process_setup(bus, addr, +			    default_88e1518, ARRAY_SIZE(default_88e1518)); +	if (res) +		return res; + +	if (addr) { +		res = process_setup(bus, addr, +				    ch1fix_88e1518, ARRAY_SIZE(ch1fix_88e1518)); +		if (res) +			return res; +	} + +	res = process_setup(bus, addr, +			    swreset_88e1518, ARRAY_SIZE(swreset_88e1518)); +	if (res) +		return res; + +	return 0; +} + +int setup_88e1514(const char *bus, unsigned char addr) +{ +	int res; + +	res = process_setup(bus, addr, +			    verify_88e1518, ARRAY_SIZE(verify_88e1518)); +	if (res) +		return res; + +	res = process_setup(bus, addr, +			    fixup_88e1518, ARRAY_SIZE(fixup_88e1518)); +	if (res) +		return res; + +	res = process_setup(bus, addr, +			    mii_to_copper_88e1514, +			    ARRAY_SIZE(mii_to_copper_88e1514)); +	if (res) +		return res; + +	res = process_setup(bus, addr, +			    sgmii_autoneg_off_88e1518, +			    ARRAY_SIZE(sgmii_autoneg_off_88e1518)); +	if (res) +		return res; + +	res = process_setup(bus, addr, +			    invert_led2_88e1514, +			    ARRAY_SIZE(invert_led2_88e1514)); +	if (res) +		return res; + +	res = process_setup(bus, addr, +			    default_88e1518, ARRAY_SIZE(default_88e1518)); +	if (res) +		return res; + +	if (addr) { +		res = process_setup(bus, addr, +				    ch1fix_88e1518, ARRAY_SIZE(ch1fix_88e1518)); +		if (res) +			return res; +	} + +	res = process_setup(bus, addr, +			    swreset_88e1518, ARRAY_SIZE(swreset_88e1518)); +	if (res) +		return res; + +	return 0; +} diff --git a/board/gdsys/common/phy.h b/board/gdsys/common/phy.h new file mode 100644 index 00000000000..afbdc65a9e8 --- /dev/null +++ b/board/gdsys/common/phy.h @@ -0,0 +1,14 @@ +/* + * (C) Copyright 2014 + * Dirk Eibach,  Guntermann & Drunck GmbH, dirk.eibach@gdsys.cc + * + * SPDX-License-Identifier:	GPL-2.0+ + */ + +#ifndef _PHY_H_ +#define _PHY_H_ + +int setup_88e1514(const char *bus, unsigned char addr); +int setup_88e1518(const char *bus, unsigned char addr); + +#endif diff --git a/board/gdsys/intip/intip.c b/board/gdsys/intip/intip.c index ee6f9e06c35..8d01d8b116f 100644 --- a/board/gdsys/intip/intip.c +++ b/board/gdsys/intip/intip.c @@ -206,7 +206,7 @@ int misc_init_r(void)  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)  extern void __ft_board_setup(void *blob, bd_t *bd); -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	__ft_board_setup(blob, bd); @@ -215,5 +215,7 @@ void ft_board_setup(void *blob, bd_t *bd)  	fdt_find_and_setprop(blob, "/plb/sata@bffd1000", "status",  			     "disabled", sizeof("disabled"), 1); + +	return 0;  }  #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */ diff --git a/board/gdsys/mpc8308/Kconfig b/board/gdsys/mpc8308/Kconfig new file mode 100644 index 00000000000..43e1663d19f --- /dev/null +++ b/board/gdsys/mpc8308/Kconfig @@ -0,0 +1,12 @@ +if TARGET_HRCON + +config SYS_BOARD +	default "mpc8308" + +config SYS_VENDOR +	default "gdsys" + +config SYS_CONFIG_NAME +	default "hrcon" + +endif diff --git a/board/gdsys/mpc8308/MAINTAINERS b/board/gdsys/mpc8308/MAINTAINERS new file mode 100644 index 00000000000..a7853a59df1 --- /dev/null +++ b/board/gdsys/mpc8308/MAINTAINERS @@ -0,0 +1,6 @@ +MPC8308 BOARD +M:	Dirk Eibach <eibach@gdsys.de> +S:	Maintained +F:	board/gdsys/mpc8308/ +F:	include/configs/hrcon.h +F:	configs/hrcon_defconfig diff --git a/board/gdsys/mpc8308/Makefile b/board/gdsys/mpc8308/Makefile new file mode 100644 index 00000000000..b5dfdbb1900 --- /dev/null +++ b/board/gdsys/mpc8308/Makefile @@ -0,0 +1,9 @@ +# +# (C) Copyright 2014 +# Dirk Eibach,  Guntermann & Drunck GmbH, eibach@gdsys.de +# +# SPDX-License-Identifier:	GPL-2.0+ +# + +obj-y := mpc8308.o sdram.o +obj-$(CONFIG_HRCON) += hrcon.o diff --git a/board/gdsys/mpc8308/hrcon.c b/board/gdsys/mpc8308/hrcon.c new file mode 100644 index 00000000000..e4434b3b6b7 --- /dev/null +++ b/board/gdsys/mpc8308/hrcon.c @@ -0,0 +1,677 @@ +/* + * (C) Copyright 2014 + * Dirk Eibach,  Guntermann & Drunck GmbH, eibach@gdsys.de + * + * SPDX-License-Identifier:	GPL-2.0+ + */ + +#include <common.h> +#include <hwconfig.h> +#include <i2c.h> +#include <spi.h> +#include <libfdt.h> +#include <fdt_support.h> +#include <pci.h> +#include <mpc83xx.h> +#include <fsl_esdhc.h> +#include <asm/io.h> +#include <asm/fsl_serdes.h> +#include <asm/fsl_mpc83xx_serdes.h> + +#include "mpc8308.h" + +#include <gdsys_fpga.h> + +#include "../common/osd.h" +#include "../common/mclink.h" +#include "../common/phy.h" + +#include <pca953x.h> +#include <pca9698.h> + +#include <miiphy.h> + +DECLARE_GLOBAL_DATA_PTR; + +#define MAX_MUX_CHANNELS 2 + +enum { +	UNITTYPE_MAIN_SERVER = 0, +	UNITTYPE_MAIN_USER = 1, +	UNITTYPE_VIDEO_SERVER = 2, +	UNITTYPE_VIDEO_USER = 3, +}; + +enum { +	UNITTYPEPCB_DVI = 0, +	UNITTYPEPCB_DP_165 = 1, +	UNITTYPEPCB_DP_300 = 2, +	UNITTYPEPCB_HDMI = 3, +}; + +enum { +	HWVER_100 = 0, +	HWVER_110 = 1, +}; + +enum { +	FPGA_HWVER_200 = 0, +	FPGA_HWVER_210 = 1, +}; + +enum { +	COMPRESSION_NONE = 0, +	COMPRESSION_TYPE1_DELTA = 1, +	COMPRESSION_TYPE1_TYPE2_DELTA = 3, +}; + +enum { +	AUDIO_NONE = 0, +	AUDIO_TX = 1, +	AUDIO_RX = 2, +	AUDIO_RXTX = 3, +}; + +enum { +	SYSCLK_147456 = 0, +}; + +enum { +	RAM_DDR2_32 = 0, +	RAM_DDR3_32 = 1, +}; + +enum { +	CARRIER_SPEED_1G = 0, +	CARRIER_SPEED_2_5G = 1, +}; + +enum { +	MCFPGA_DONE = 1 << 0, +	MCFPGA_INIT_N = 1 << 1, +	MCFPGA_PROGRAM_N = 1 << 2, +	MCFPGA_UPDATE_ENABLE_N = 1 << 3, +	MCFPGA_RESET_N = 1 << 4, +}; + +enum { +	GPIO_MDC = 1 << 14, +	GPIO_MDIO = 1 << 15, +}; + +unsigned int mclink_fpgacount; +struct ihs_fpga *fpga_ptr[] = CONFIG_SYS_FPGA_PTR; + +int fpga_set_reg(u32 fpga, u16 *reg, off_t regoff, u16 data) +{ +	int res; + +	switch (fpga) { +	case 0: +		out_le16(reg, data); +		break; +	default: +		res = mclink_send(fpga - 1, regoff, data); +		if (res < 0) { +			printf("mclink_send reg %02lx data %04x returned %d\n", +			       regoff, data, res); +			return res; +		} +		break; +	} + +	return 0; +} + +int fpga_get_reg(u32 fpga, u16 *reg, off_t regoff, u16 *data) +{ +	int res; + +	switch (fpga) { +	case 0: +		*data = in_le16(reg); +		break; +	default: +		if (fpga > mclink_fpgacount) +			return -EINVAL; +		res = mclink_receive(fpga - 1, regoff, data); +		if (res < 0) { +			printf("mclink_receive reg %02lx returned %d\n", +			       regoff, res); +			return res; +		} +	} + +	return 0; +} + +int checkboard(void) +{ +	char *s = getenv("serial#"); +	bool hw_type_cat = pca9698_get_value(0x20, 20); + +	puts("Board: "); + +	printf("HRCon %s", hw_type_cat ? "CAT" : "Fiber"); + +	if (s != NULL) { +		puts(", serial# "); +		puts(s); +	} + +	puts("\n"); + +	return 0; +} + +static void print_fpga_info(unsigned int fpga, bool rgmii2_present) +{ +	u16 versions; +	u16 fpga_version; +	u16 fpga_features; +	unsigned unit_type; +	unsigned unit_type_pcb_video; +	unsigned hardware_version; +	unsigned feature_compression; +	unsigned feature_osd; +	unsigned feature_audio; +	unsigned feature_sysclock; +	unsigned feature_ramconfig; +	unsigned feature_carrier_speed; +	unsigned feature_carriers; +	unsigned feature_video_channels; + +	FPGA_GET_REG(fpga, versions, &versions); +	FPGA_GET_REG(fpga, fpga_version, &fpga_version); +	FPGA_GET_REG(fpga, fpga_features, &fpga_features); + +	unit_type = (versions & 0xf000) >> 12; +	unit_type_pcb_video = (versions & 0x01c0) >> 6; +	feature_compression = (fpga_features & 0xe000) >> 13; +	feature_osd = fpga_features & (1<<11); +	feature_audio = (fpga_features & 0x0600) >> 9; +	feature_sysclock = (fpga_features & 0x0180) >> 7; +	feature_ramconfig = (fpga_features & 0x0060) >> 5; +	feature_carrier_speed = fpga_features & (1<<4); +	feature_carriers = (fpga_features & 0x000c) >> 2; +	feature_video_channels = fpga_features & 0x0003; + +	switch (unit_type) { +	case UNITTYPE_MAIN_USER: +		printf("Mainchannel"); +		break; + +	case UNITTYPE_VIDEO_USER: +		printf("Videochannel"); +		break; + +	default: +		printf("UnitType %d(not supported)", unit_type); +		break; +	} + +	if (unit_type == UNITTYPE_MAIN_USER) { +		hardware_version = +			  (!!pca9698_get_value(0x20, 24) << 0) +			| (!!pca9698_get_value(0x20, 25) << 1) +			| (!!pca9698_get_value(0x20, 26) << 2) +			| (!!pca9698_get_value(0x20, 27) << 3) +			| (!!pca9698_get_value(0x20, 28) << 4); +		switch (hardware_version) { +		case HWVER_100: +			printf(" HW-Ver 1.00,"); +			break; + +		case HWVER_110: +			printf(" HW-Ver 1.10,"); +			break; + +		default: +			printf(" HW-Ver %d(not supported),", +			       hardware_version); +			break; +		} +		if (rgmii2_present) +			printf(" RGMII2,"); +	} + +	if (unit_type == UNITTYPE_VIDEO_USER) { +		hardware_version = versions & 0x000f; +		switch (hardware_version) { +		case FPGA_HWVER_200: +			printf(" HW-Ver 2.00,"); +			break; + +		case FPGA_HWVER_210: +			printf(" HW-Ver 2.10,"); +			break; + +		default: +			printf(" HW-Ver %d(not supported),", +			       hardware_version); +			break; +		} +	} + +	switch (unit_type_pcb_video) { +	case UNITTYPEPCB_DVI: +		printf(" DVI,"); +		break; + +	case UNITTYPEPCB_DP_165: +		printf(" DP 165MPix/s,"); +		break; + +	case UNITTYPEPCB_DP_300: +		printf(" DP 300MPix/s,"); +		break; + +	case UNITTYPEPCB_HDMI: +		printf(" HDMI,"); +		break; +	} + +	printf(" FPGA V %d.%02d\n       features:", +	       fpga_version / 100, fpga_version % 100); + + +	switch (feature_compression) { +	case COMPRESSION_NONE: +		printf(" no compression"); +		break; + +	case COMPRESSION_TYPE1_DELTA: +		printf(" type1-deltacompression"); +		break; + +	case COMPRESSION_TYPE1_TYPE2_DELTA: +		printf(" type1-deltacompression, type2-inlinecompression"); +		break; + +	default: +		printf(" compression %d(not supported)", feature_compression); +		break; +	} + +	printf(", %sosd", feature_osd ? "" : "no "); + +	switch (feature_audio) { +	case AUDIO_NONE: +		printf(", no audio"); +		break; + +	case AUDIO_TX: +		printf(", audio tx"); +		break; + +	case AUDIO_RX: +		printf(", audio rx"); +		break; + +	case AUDIO_RXTX: +		printf(", audio rx+tx"); +		break; + +	default: +		printf(", audio %d(not supported)", feature_audio); +		break; +	} + +	puts(",\n       "); + +	switch (feature_sysclock) { +	case SYSCLK_147456: +		printf("clock 147.456 MHz"); +		break; + +	default: +		printf("clock %d(not supported)", feature_sysclock); +		break; +	} + +	switch (feature_ramconfig) { +	case RAM_DDR2_32: +		printf(", RAM 32 bit DDR2"); +		break; + +	case RAM_DDR3_32: +		printf(", RAM 32 bit DDR3"); +		break; + +	default: +		printf(", RAM %d(not supported)", feature_ramconfig); +		break; +	} + +	printf(", %d carrier(s) %s", feature_carriers, +	       feature_carrier_speed ? "2.5Gbit/s" : "1Gbit/s"); + +	printf(", %d video channel(s)\n", feature_video_channels); +} + +int last_stage_init(void) +{ +	int slaves; +	unsigned int k; +	unsigned int mux_ch; +	unsigned char mclink_controllers[] = { 0x24, 0x25, 0x26 }; +	u16 fpga_features; +	bool hw_type_cat = pca9698_get_value(0x20, 20); +	bool ch0_rgmii2_present = false; + +	FPGA_GET_REG(0, fpga_features, &fpga_features); + +	/* Turn on Parade DP501 */ +	pca9698_direction_output(0x20, 10, 1); + +	ch0_rgmii2_present = !pca9698_get_value(0x20, 30); + +	/* wait for FPGA done */ +	for (k = 0; k < ARRAY_SIZE(mclink_controllers); ++k) { +		unsigned int ctr = 0; + +		if (i2c_probe(mclink_controllers[k])) +			continue; + +		while (!(pca953x_get_val(mclink_controllers[k]) +		       & MCFPGA_DONE)) { +			udelay(100000); +			if (ctr++ > 5) { +				printf("no done for mclink_controller %d\n", k); +				break; +			} +		} +	} + +	if (hw_type_cat) { +		miiphy_register(bb_miiphy_buses[0].name, bb_miiphy_read, +				bb_miiphy_write); +		for (mux_ch = 0; mux_ch < MAX_MUX_CHANNELS; ++mux_ch) { +			if ((mux_ch == 1) && !ch0_rgmii2_present) +				continue; + +			setup_88e1514(bb_miiphy_buses[0].name, mux_ch); +		} +	} + +	/* give slave-PLLs and Parade DP501 some time to be up and running */ +	udelay(500000); + +	mclink_fpgacount = CONFIG_SYS_MCLINK_MAX; +	slaves = mclink_probe(); +	mclink_fpgacount = 0; + +	print_fpga_info(0, ch0_rgmii2_present); +	osd_probe(0); + +	if (slaves <= 0) +		return 0; + +	mclink_fpgacount = slaves; + +	for (k = 1; k <= slaves; ++k) { +		FPGA_GET_REG(k, fpga_features, &fpga_features); + +		print_fpga_info(k, false); +		osd_probe(k); +		if (hw_type_cat) { +			miiphy_register(bb_miiphy_buses[k].name, +					bb_miiphy_read, bb_miiphy_write); +			setup_88e1514(bb_miiphy_buses[k].name, 0); +		} +	} + +	return 0; +} + +/* + * provide access to fpga gpios (for I2C bitbang) + * (these may look all too simple but make iocon.h much more readable) + */ +void fpga_gpio_set(unsigned int bus, int pin) +{ +	FPGA_SET_REG(bus, gpio.set, pin); +} + +void fpga_gpio_clear(unsigned int bus, int pin) +{ +	FPGA_SET_REG(bus, gpio.clear, pin); +} + +int fpga_gpio_get(unsigned int bus, int pin) +{ +	u16 val; + +	FPGA_GET_REG(bus, gpio.read, &val); + +	return val & pin; +} + +void mpc8308_init(void) +{ +	pca9698_direction_output(0x20, 4, 1); +} + +void mpc8308_set_fpga_reset(unsigned state) +{ +	pca9698_set_value(0x20, 4, state ? 0 : 1); +} + +void mpc8308_setup_hw(void) +{ +	immap_t *immr = (immap_t *)CONFIG_SYS_IMMR; + +	/* +	 * set "startup-finished"-gpios +	 */ +	setbits_be32(&immr->gpio[0].dir, (1 << (31-11)) | (1 << (31-12))); +	setbits_be32(&immr->gpio[0].dat, 1 << (31-12)); +} + +int mpc8308_get_fpga_done(unsigned fpga) +{ +	return pca9698_get_value(0x20, 19); +} + +#ifdef CONFIG_FSL_ESDHC +int board_mmc_init(bd_t *bd) +{ +	immap_t *immr = (immap_t *)CONFIG_SYS_IMMR; +	sysconf83xx_t *sysconf = &immr->sysconf; + +	/* Enable cache snooping in eSDHC system configuration register */ +	out_be32(&sysconf->sdhccr, 0x02000000); + +	return fsl_esdhc_mmc_init(bd); +} +#endif + +static struct pci_region pcie_regions_0[] = { +	{ +		.bus_start = CONFIG_SYS_PCIE1_MEM_BASE, +		.phys_start = CONFIG_SYS_PCIE1_MEM_PHYS, +		.size = CONFIG_SYS_PCIE1_MEM_SIZE, +		.flags = PCI_REGION_MEM, +	}, +	{ +		.bus_start = CONFIG_SYS_PCIE1_IO_BASE, +		.phys_start = CONFIG_SYS_PCIE1_IO_PHYS, +		.size = CONFIG_SYS_PCIE1_IO_SIZE, +		.flags = PCI_REGION_IO, +	}, +}; + +void pci_init_board(void) +{ +	immap_t *immr = (immap_t *)CONFIG_SYS_IMMR; +	sysconf83xx_t *sysconf = &immr->sysconf; +	law83xx_t *pcie_law = sysconf->pcielaw; +	struct pci_region *pcie_reg[] = { pcie_regions_0 }; + +	fsl_setup_serdes(CONFIG_FSL_SERDES1, FSL_SERDES_PROTO_PEX, +			 FSL_SERDES_CLK_100, FSL_SERDES_VDD_1V); + +	/* Deassert the resets in the control register */ +	out_be32(&sysconf->pecr1, 0xE0008000); +	udelay(2000); + +	/* Configure PCI Express Local Access Windows */ +	out_be32(&pcie_law[0].bar, CONFIG_SYS_PCIE1_BASE & LAWBAR_BAR); +	out_be32(&pcie_law[0].ar, LBLAWAR_EN | LBLAWAR_512MB); + +	mpc83xx_pcie_init(1, pcie_reg); +} + +ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t *info) +{ +	info->portwidth = FLASH_CFI_16BIT; +	info->chipwidth = FLASH_CFI_BY16; +	info->interface = FLASH_CFI_X16; +	return 1; +} + +#if defined(CONFIG_OF_BOARD_SETUP) +int ft_board_setup(void *blob, bd_t *bd) +{ +	ft_cpu_setup(blob, bd); +	fdt_fixup_dr_usb(blob, bd); +	fdt_fixup_esdhc(blob, bd); + +	return 0; +} +#endif + +/* + * FPGA MII bitbang implementation + */ + +struct fpga_mii { +	unsigned fpga; +	int mdio; +} fpga_mii[] = { +	{ 0, 1}, +	{ 1, 1}, +	{ 2, 1}, +	{ 3, 1}, +}; + +static int mii_dummy_init(struct bb_miiphy_bus *bus) +{ +	return 0; +} + +static int mii_mdio_active(struct bb_miiphy_bus *bus) +{ +	struct fpga_mii *fpga_mii = bus->priv; + +	if (fpga_mii->mdio) +		FPGA_SET_REG(fpga_mii->fpga, gpio.set, GPIO_MDIO); +	else +		FPGA_SET_REG(fpga_mii->fpga, gpio.clear, GPIO_MDIO); + +	return 0; +} + +static int mii_mdio_tristate(struct bb_miiphy_bus *bus) +{ +	struct fpga_mii *fpga_mii = bus->priv; + +	FPGA_SET_REG(fpga_mii->fpga, gpio.set, GPIO_MDIO); + +	return 0; +} + +static int mii_set_mdio(struct bb_miiphy_bus *bus, int v) +{ +	struct fpga_mii *fpga_mii = bus->priv; + +	if (v) +		FPGA_SET_REG(fpga_mii->fpga, gpio.set, GPIO_MDIO); +	else +		FPGA_SET_REG(fpga_mii->fpga, gpio.clear, GPIO_MDIO); + +	fpga_mii->mdio = v; + +	return 0; +} + +static int mii_get_mdio(struct bb_miiphy_bus *bus, int *v) +{ +	u16 gpio; +	struct fpga_mii *fpga_mii = bus->priv; + +	FPGA_GET_REG(fpga_mii->fpga, gpio.read, &gpio); + +	*v = ((gpio & GPIO_MDIO) != 0); + +	return 0; +} + +static int mii_set_mdc(struct bb_miiphy_bus *bus, int v) +{ +	struct fpga_mii *fpga_mii = bus->priv; + +	if (v) +		FPGA_SET_REG(fpga_mii->fpga, gpio.set, GPIO_MDC); +	else +		FPGA_SET_REG(fpga_mii->fpga, gpio.clear, GPIO_MDC); + +	return 0; +} + +static int mii_delay(struct bb_miiphy_bus *bus) +{ +	udelay(1); + +	return 0; +} + +struct bb_miiphy_bus bb_miiphy_buses[] = { +	{ +		.name = "board0", +		.init = mii_dummy_init, +		.mdio_active = mii_mdio_active, +		.mdio_tristate = mii_mdio_tristate, +		.set_mdio = mii_set_mdio, +		.get_mdio = mii_get_mdio, +		.set_mdc = mii_set_mdc, +		.delay = mii_delay, +		.priv = &fpga_mii[0], +	}, +	{ +		.name = "board1", +		.init = mii_dummy_init, +		.mdio_active = mii_mdio_active, +		.mdio_tristate = mii_mdio_tristate, +		.set_mdio = mii_set_mdio, +		.get_mdio = mii_get_mdio, +		.set_mdc = mii_set_mdc, +		.delay = mii_delay, +		.priv = &fpga_mii[1], +	}, +	{ +		.name = "board2", +		.init = mii_dummy_init, +		.mdio_active = mii_mdio_active, +		.mdio_tristate = mii_mdio_tristate, +		.set_mdio = mii_set_mdio, +		.get_mdio = mii_get_mdio, +		.set_mdc = mii_set_mdc, +		.delay = mii_delay, +		.priv = &fpga_mii[2], +	}, +	{ +		.name = "board3", +		.init = mii_dummy_init, +		.mdio_active = mii_mdio_active, +		.mdio_tristate = mii_mdio_tristate, +		.set_mdio = mii_set_mdio, +		.get_mdio = mii_get_mdio, +		.set_mdc = mii_set_mdc, +		.delay = mii_delay, +		.priv = &fpga_mii[3], +	}, +}; + +int bb_miiphy_buses_num = sizeof(bb_miiphy_buses) / +			  sizeof(bb_miiphy_buses[0]); diff --git a/board/gdsys/mpc8308/mpc8308.c b/board/gdsys/mpc8308/mpc8308.c new file mode 100644 index 00000000000..4338a331268 --- /dev/null +++ b/board/gdsys/mpc8308/mpc8308.c @@ -0,0 +1,109 @@ +/* + * (C) Copyright 2014 + * Dirk Eibach,  Guntermann & Drunck GmbH, eibach@gdsys.de + * + * SPDX-License-Identifier:	GPL-2.0+ + */ + +#include <common.h> +#include <command.h> +#include <asm/processor.h> +#include <asm/io.h> +#include <asm/ppc4xx-gpio.h> +#include <asm/global_data.h> + +#include "mpc8308.h" +#include <gdsys_fpga.h> + +#define REFLECTION_TESTPATTERN 0xdede +#define REFLECTION_TESTPATTERN_INV (~REFLECTION_TESTPATTERN & 0xffff) + +#ifdef CONFIG_SYS_FPGA_NO_RFL_HI +#define REFLECTION_TESTREG reflection_low +#else +#define REFLECTION_TESTREG reflection_high +#endif + +DECLARE_GLOBAL_DATA_PTR; + +int get_fpga_state(unsigned dev) +{ +	return gd->arch.fpga_state[dev]; +} + +void print_fpga_state(unsigned dev) +{ +	if (gd->arch.fpga_state[dev] & FPGA_STATE_DONE_FAILED) +		puts("       Waiting for FPGA-DONE timed out.\n"); +	if (gd->arch.fpga_state[dev] & FPGA_STATE_REFLECTION_FAILED) +		puts("       FPGA reflection test failed.\n"); +} + +int board_early_init_f(void) +{ +	unsigned k; + +	for (k = 0; k < CONFIG_SYS_FPGA_COUNT; ++k) +		gd->arch.fpga_state[k] = 0; + +	return 0; +} + +int board_early_init_r(void) +{ +	unsigned k; +	unsigned ctr; + +	for (k = 0; k < CONFIG_SYS_FPGA_COUNT; ++k) +		gd->arch.fpga_state[k] = 0; + +	/* +	 * reset FPGA +	 */ +	mpc8308_init(); + +	mpc8308_set_fpga_reset(1); + +	mpc8308_setup_hw(); + +	for (k = 0; k < CONFIG_SYS_FPGA_COUNT; ++k) { +		ctr = 0; +		while (!mpc8308_get_fpga_done(k)) { +			udelay(100000); +			if (ctr++ > 5) { +				gd->arch.fpga_state[k] |= +					FPGA_STATE_DONE_FAILED; +				break; +			} +		} +	} + +	udelay(10); + +	mpc8308_set_fpga_reset(0); + +	for (k = 0; k < CONFIG_SYS_FPGA_COUNT; ++k) { +		/* +		 * wait for fpga out of reset +		 */ +		ctr = 0; +		while (1) { +			u16 val; + +			FPGA_SET_REG(k, reflection_low, REFLECTION_TESTPATTERN); + +			FPGA_GET_REG(k, REFLECTION_TESTREG, &val); +			if (val == REFLECTION_TESTPATTERN_INV) +				break; + +			udelay(100000); +			if (ctr++ > 5) { +				gd->arch.fpga_state[k] |= +					FPGA_STATE_REFLECTION_FAILED; +				break; +			} +		} +	} + +	return 0; +} diff --git a/board/gdsys/mpc8308/mpc8308.h b/board/gdsys/mpc8308/mpc8308.h new file mode 100644 index 00000000000..dc07d564eb5 --- /dev/null +++ b/board/gdsys/mpc8308/mpc8308.h @@ -0,0 +1,10 @@ +#ifndef __MPC8308_H_ +#define __MPC8308_H_ + +/* functions to be provided by board implementation */ +void mpc8308_init(void); +void mpc8308_set_fpga_reset(unsigned state); +void mpc8308_setup_hw(void); +int mpc8308_get_fpga_done(unsigned fpga); + +#endif /* __MPC8308_H_ */ diff --git a/board/gdsys/mpc8308/sdram.c b/board/gdsys/mpc8308/sdram.c new file mode 100644 index 00000000000..0fce8cfbab6 --- /dev/null +++ b/board/gdsys/mpc8308/sdram.c @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2007 Freescale Semiconductor, Inc. + * Copyright (C) 2010 Ilya Yanok, Emcraft Systems, yanok@emcraft.com + * + * Authors: Nick.Spence@freescale.com + *          Wilson.Lo@freescale.com + *          scottwood@freescale.com + * + * This files is  mostly identical to the original from + * board\freescale\mpc8315erdb\sdram.c + * + * SPDX-License-Identifier:	GPL-2.0+ + */ + +#include <common.h> +#include <mpc83xx.h> +#include <spd_sdram.h> + +#include <asm/bitops.h> +#include <asm/io.h> + +#include <asm/processor.h> + +DECLARE_GLOBAL_DATA_PTR; + +/* Fixed sdram init -- doesn't use serial presence detect. + * + * This is useful for faster booting in configs where the RAM is unlikely + * to be changed, or for things like NAND booting where space is tight. + */ +static long fixed_sdram(void) +{ +	immap_t *im = (immap_t *)CONFIG_SYS_IMMR; +	u32 msize = CONFIG_SYS_DDR_SIZE * 1024 * 1024; +	u32 msize_log2 = __ilog2(msize); + +	out_be32(&im->sysconf.ddrlaw[0].bar, +		 CONFIG_SYS_DDR_SDRAM_BASE  & 0xfffff000); +	out_be32(&im->sysconf.ddrlaw[0].ar, LBLAWAR_EN | (msize_log2 - 1)); +	out_be32(&im->sysconf.ddrcdr, CONFIG_SYS_DDRCDR_VALUE); + +	out_be32(&im->ddr.csbnds[0].csbnds, (msize - 1) >> 24); +	out_be32(&im->ddr.cs_config[0], CONFIG_SYS_DDR_CS0_CONFIG); + +	/* Currently we use only one CS, so disable the other bank. */ +	out_be32(&im->ddr.cs_config[1], 0); + +	out_be32(&im->ddr.sdram_clk_cntl, CONFIG_SYS_DDR_SDRAM_CLK_CNTL); +	out_be32(&im->ddr.timing_cfg_3, CONFIG_SYS_DDR_TIMING_3); +	out_be32(&im->ddr.timing_cfg_1, CONFIG_SYS_DDR_TIMING_1); +	out_be32(&im->ddr.timing_cfg_2, CONFIG_SYS_DDR_TIMING_2); +	out_be32(&im->ddr.timing_cfg_0, CONFIG_SYS_DDR_TIMING_0); + +	out_be32(&im->ddr.sdram_cfg, CONFIG_SYS_DDR_SDRAM_CFG); +	out_be32(&im->ddr.sdram_cfg2, CONFIG_SYS_DDR_SDRAM_CFG2); +	out_be32(&im->ddr.sdram_mode, CONFIG_SYS_DDR_MODE); +	out_be32(&im->ddr.sdram_mode2, CONFIG_SYS_DDR_MODE2); + +	out_be32(&im->ddr.sdram_interval, CONFIG_SYS_DDR_INTERVAL); +	sync(); + +	/* enable DDR controller */ +	setbits_be32(&im->ddr.sdram_cfg, SDRAM_CFG_MEM_EN); +	sync(); + +	return get_ram_size(CONFIG_SYS_DDR_SDRAM_BASE, msize); +} + +phys_size_t initdram(int board_type) +{ +	immap_t *im = (immap_t *)CONFIG_SYS_IMMR; +	u32 msize; + +	if ((in_be32(&im->sysconf.immrbar) & IMMRBAR_BASE_ADDR) != (u32)im) +		return -1; + +	/* DDR SDRAM */ +	msize = fixed_sdram(); + +	/* return total bus SDRAM size(bytes)  -- DDR */ +	return msize; +} diff --git a/board/gdsys/p1022/controlcenterd-id.c b/board/gdsys/p1022/controlcenterd-id.c index 70eff912aa6..11d075c3859 100644 --- a/board/gdsys/p1022/controlcenterd-id.c +++ b/board/gdsys/p1022/controlcenterd-id.c @@ -236,7 +236,7 @@ static int ccdm_mmc_read(struct mmc *mmc, u64 src, u8 *dst, int size)  			tmp_buf);  		if (!n)  			goto failure; -		result = min(size, blk_len - ofs); +		result = min(size, (int)(blk_len - ofs));  		memcpy(dst, tmp_buf + ofs, result);  		dst += result;  		size -= result; @@ -736,7 +736,8 @@ do_bin_func:  				src_buf = buf;  				for (ptr = (uint8_t *)src_buf, i = 20; i > 0;  					i -= data_size, ptr += data_size) -					memcpy(ptr, data, min(i, data_size)); +					memcpy(ptr, data, +					       min_t(size_t, i, data_size));  			}  		}  		bin_func(dst_reg->digest, src_buf, 20); @@ -931,11 +932,12 @@ static struct key_program *load_key_chunk(const char *ifname,  	struct key_program header;  	uint32_t crc;  	uint8_t buf[12]; -	int i; +	loff_t i;  	if (fs_set_blk_dev(ifname, dev_part_str, fs_type))  		goto failure; -	i = fs_read(path, (ulong)buf, 0, 12); +	if (fs_read(path, (ulong)buf, 0, 12, &i) < 0) +		goto failure;  	if (i < 12)  		goto failure;  	header.magic = get_unaligned_be32(buf); @@ -950,8 +952,9 @@ static struct key_program *load_key_chunk(const char *ifname,  		goto failure;  	if (fs_set_blk_dev(ifname, dev_part_str, fs_type))  		goto failure; -	i = fs_read(path, (ulong)result, 0, -		sizeof(struct key_program) + header.code_size); +	if (fs_read(path, (ulong)result, 0, +		    sizeof(struct key_program) + header.code_size, &i) < 0) +		goto failure;  	if (i <= 0)  		goto failure;  	*result = header; @@ -1042,7 +1045,7 @@ static int second_stage_init(void)  	const char *image_path = "/ccdm.itb";  	char *mac_path = NULL;  	ulong image_addr; -	size_t image_size; +	loff_t image_size;  	uint32_t err;  	printf("CCDM S2\n"); @@ -1084,10 +1087,11 @@ static int second_stage_init(void)  	image_addr = (ulong)get_image_location();  	if (fs_set_blk_dev("mmc", mmcdev, FS_TYPE_EXT))  		goto failure; -	image_size = fs_read(image_path, image_addr, 0, 0); +	if (fs_read(image_path, image_addr, 0, 0, &image_size) < 0) +		goto failure;  	if (image_size <= 0)  		goto failure; -	printf("CCDM image found on %s, %d bytes\n", mmcdev, image_size); +	printf("CCDM image found on %s, %lld bytes\n", mmcdev, image_size);  	hmac_blob = load_key_chunk("mmc", mmcdev, FS_TYPE_EXT, mac_path);  	if (!hmac_blob) { diff --git a/board/gdsys/p1022/controlcenterd.c b/board/gdsys/p1022/controlcenterd.c index f76d9689627..64d90dd3fde 100644 --- a/board/gdsys/p1022/controlcenterd.c +++ b/board/gdsys/p1022/controlcenterd.c @@ -326,7 +326,7 @@ int board_eth_init(bd_t *bis)  }  #ifdef CONFIG_OF_BOARD_SETUP -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	phys_addr_t base;  	phys_size_t size; @@ -343,6 +343,8 @@ void ft_board_setup(void *blob, bd_t *bd)  #endif  	FT_FSL_PCI_SETUP; + +	return 0;  }  #endif diff --git a/board/google/chromebook_link/Kconfig b/board/google/chromebook_link/Kconfig new file mode 100644 index 00000000000..3a4f557d309 --- /dev/null +++ b/board/google/chromebook_link/Kconfig @@ -0,0 +1,31 @@ +if TARGET_CHROMEBOOK_LINK + +config SYS_BOARD +	default "chromebook_link" + +config SYS_VENDOR +	default "google" + +config SYS_SOC +	default "ivybridge" + +config SYS_CONFIG_NAME +	default "chromebook_link" + +config BOARD_SPECIFIC_OPTIONS # dummy +	def_bool y +	select CPU_INTEL_SOCKET_RPGA989 +	select NORTHBRIDGE_INTEL_IVYBRIDGE +	select SOUTHBRIDGE_INTEL_C216 +	select HAVE_ACPI_RESUME +	select MARK_GRAPHICS_MEM_WRCOMB + +config MMCONF_BASE_ADDRESS +	hex +	default 0xf0000000 + +config EARLY_POST_CROS_EC +	bool "Enable early post to Chrome OS EC" +	default y + +endif diff --git a/board/google/chromebook_link/MAINTAINERS b/board/google/chromebook_link/MAINTAINERS new file mode 100644 index 00000000000..bc253a2ba7b --- /dev/null +++ b/board/google/chromebook_link/MAINTAINERS @@ -0,0 +1,6 @@ +CHROMEBOOK LINK BOARD +M:	Simon Glass <sjg@chromium.org> +S:	Maintained +F:	board/google/chromebook_link/ +F:	include/configs/chromebook_link.h +F:	configs/chromebook_link_defconfig diff --git a/board/google/chromebook_link/Makefile b/board/google/chromebook_link/Makefile new file mode 100644 index 00000000000..a133c2e894b --- /dev/null +++ b/board/google/chromebook_link/Makefile @@ -0,0 +1,15 @@ +# +# Copyright (c) 2011 The Chromium OS Authors. +# (C) Copyright 2008 +# Graeme Russ, graeme.russ@gmail.com. +# +# (C) Copyright 2006 +# Wolfgang Denk, DENX Software Engineering, wd@denx.de. +# +# (C) Copyright 2002 +# Daniel Engström, Omicron Ceti AB, daniel@omicron.se. +# +# SPDX-License-Identifier:	GPL-2.0+ +# + +obj-y	+= link.o diff --git a/board/google/chromebook_link/link.c b/board/google/chromebook_link/link.c new file mode 100644 index 00000000000..88cee052415 --- /dev/null +++ b/board/google/chromebook_link/link.c @@ -0,0 +1,124 @@ +/* + * Copyright (C) 2014 Google, Inc + * + * SPDX-License-Identifier:	GPL-2.0+ + */ + +#include <common.h> +#include <asm/gpio.h> + +int arch_early_init_r(void) +{ +	return 0; +} + +int board_early_init_r(void) +{ +	return 0; +} + +static const struct pch_gpio_set1 pch_gpio_set1_mode = { +	.gpio0 = GPIO_MODE_GPIO,  /* NMI_DBG# */ +	.gpio3 = GPIO_MODE_GPIO,  /* ALS_INT# */ +	.gpio5 = GPIO_MODE_GPIO,  /* SIM_DET */ +	.gpio7 = GPIO_MODE_GPIO,  /* EC_SCI# */ +	.gpio8 = GPIO_MODE_GPIO,  /* EC_SMI# */ +	.gpio9 = GPIO_MODE_GPIO,  /* RECOVERY# */ +	.gpio10 = GPIO_MODE_GPIO, /* SPD vector D3 */ +	.gpio11 = GPIO_MODE_GPIO, /* smbalert#, let's keep it initialized */ +	.gpio12 = GPIO_MODE_GPIO, /* TP_INT# */ +	.gpio14 = GPIO_MODE_GPIO, /* Touch_INT_L */ +	.gpio15 = GPIO_MODE_GPIO, /* EC_LID_OUT# (EC_WAKE#) */ +	.gpio21 = GPIO_MODE_GPIO, /* EC_IN_RW */ +	.gpio24 = GPIO_MODE_GPIO, /* DDR3L_EN */ +	.gpio28 = GPIO_MODE_GPIO, /* SLP_ME_CSW_DEV# */ +}; + +static const struct pch_gpio_set1 pch_gpio_set1_direction = { +	.gpio0 = GPIO_DIR_INPUT, +	.gpio3 = GPIO_DIR_INPUT, +	.gpio5 = GPIO_DIR_INPUT, +	.gpio7 = GPIO_DIR_INPUT, +	.gpio8 = GPIO_DIR_INPUT, +	.gpio9 = GPIO_DIR_INPUT, +	.gpio10 = GPIO_DIR_INPUT, +	.gpio11 = GPIO_DIR_INPUT, +	.gpio12 = GPIO_DIR_INPUT, +	.gpio14 = GPIO_DIR_INPUT, +	.gpio15 = GPIO_DIR_INPUT, +	.gpio21 = GPIO_DIR_INPUT, +	.gpio24 = GPIO_DIR_OUTPUT, +	.gpio28 = GPIO_DIR_INPUT, +}; + +static const struct pch_gpio_set1 pch_gpio_set1_level = { +	.gpio1 = GPIO_LEVEL_HIGH, +	.gpio6 = GPIO_LEVEL_HIGH, +	.gpio24 = GPIO_LEVEL_LOW, +}; + +static const struct pch_gpio_set1 pch_gpio_set1_invert = { +	.gpio7 = GPIO_INVERT, +	.gpio8 = GPIO_INVERT, +	.gpio12 = GPIO_INVERT, +	.gpio14 = GPIO_INVERT, +	.gpio15 = GPIO_INVERT, +}; + +static const struct pch_gpio_set2 pch_gpio_set2_mode = { +	.gpio36 = GPIO_MODE_GPIO, /* W_DISABLE_L */ +	.gpio41 = GPIO_MODE_GPIO, /* SPD vector D0 */ +	.gpio42 = GPIO_MODE_GPIO, /* SPD vector D1 */ +	.gpio43 = GPIO_MODE_GPIO, /* SPD vector D2 */ +	.gpio57 = GPIO_MODE_GPIO, /* PCH_SPI_WP_D */ +	.gpio60 = GPIO_MODE_GPIO, /* DRAMRST_CNTRL_PCH */ +}; + +static const struct pch_gpio_set2 pch_gpio_set2_direction = { +	.gpio36 = GPIO_DIR_OUTPUT, +	.gpio41 = GPIO_DIR_INPUT, +	.gpio42 = GPIO_DIR_INPUT, +	.gpio43 = GPIO_DIR_INPUT, +	.gpio57 = GPIO_DIR_INPUT, +	.gpio60 = GPIO_DIR_OUTPUT, +}; + +static const struct pch_gpio_set2 pch_gpio_set2_level = { +	.gpio36 = GPIO_LEVEL_HIGH, +	.gpio60 = GPIO_LEVEL_HIGH, +}; + +static const struct pch_gpio_set3 pch_gpio_set3_mode = { +}; + +static const struct pch_gpio_set3 pch_gpio_set3_direction = { +}; + +static const struct pch_gpio_set3 pch_gpio_set3_level = { +}; + +static const struct pch_gpio_map link_gpio_map = { +	.set1 = { +		.mode      = &pch_gpio_set1_mode, +		.direction = &pch_gpio_set1_direction, +		.level     = &pch_gpio_set1_level, +		.invert    = &pch_gpio_set1_invert, +	}, +	.set2 = { +		.mode      = &pch_gpio_set2_mode, +		.direction = &pch_gpio_set2_direction, +		.level     = &pch_gpio_set2_level, +	}, +	.set3 = { +		.mode      = &pch_gpio_set3_mode, +		.direction = &pch_gpio_set3_direction, +		.level     = &pch_gpio_set3_level, +	}, +}; + +int board_early_init_f(void) +{ +	ich_gpio_set_gpio_map(&link_gpio_map); + +	return 0; +} diff --git a/board/google/common/Makefile b/board/google/common/Makefile new file mode 100644 index 00000000000..b38bc14ff66 --- /dev/null +++ b/board/google/common/Makefile @@ -0,0 +1,7 @@ +# +# Copyright (c) 2014 Google, Inc +# +# SPDX-License-Identifier:	GPL-2.0+ +# + +obj-y += early_init.o diff --git a/board/google/common/early_init.S b/board/google/common/early_init.S new file mode 100644 index 00000000000..7017185d06d --- /dev/null +++ b/board/google/common/early_init.S @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2014 Google, Inc + * + * SPDX-License-Identifier:	GPL-2.0+ + */ + +.globl early_board_init +early_board_init: +	/* Enable post codes to EC */ +#ifdef CONFIG_EARLY_POST_CROS_EC +	mov    $0x1b, %ecx +	rdmsr +	and    $0x100, %eax +	test   %eax, %eax +	je     1f + +	mov    $0x8000f8f0, %eax +	mov    $0xcf8, %dx +	out    %eax, (%dx) +	mov    $0xfed1c001, %eax +	mov    $0xcfc, %dx +	out    %eax, (%dx) +	mov    $0xfed1f410, %esp +	mov    (%esp), %eax +	and    $0xfffffffb, %eax +	mov    %eax, (%esp) +1: +#endif +	jmp	early_board_init_ret diff --git a/board/highbank/highbank.c b/board/highbank/highbank.c index a1b67494f6c..fc2385cf31a 100644 --- a/board/highbank/highbank.c +++ b/board/highbank/highbank.c @@ -94,7 +94,7 @@ void dram_init_banksize(void)  }  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *fdt, bd_t *bd) +int ft_board_setup(void *fdt, bd_t *bd)  {  	static const char disabled[] = "disabled";  	u32 reg = readl(HB_SREG_A9_PWRDOM_STAT); @@ -106,6 +106,8 @@ void ft_board_setup(void *fdt, bd_t *bd)  	if (!(reg & PWRDOM_STAT_EMMC))  		do_fixup_by_compat(fdt, "calxeda,hb-sdhci", "status",  			disabled, sizeof(disabled), 1); + +	return 0;  }  #endif diff --git a/board/icecube/icecube.c b/board/icecube/icecube.c index a99416b3aaf..f0af24ad9bd 100644 --- a/board/icecube/icecube.c +++ b/board/icecube/icecube.c @@ -311,10 +311,11 @@ void ide_set_reset (int idereset)  #endif  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -void -ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd); + +	return 0;  }  #endif diff --git a/board/ids/ids8313/ids8313.c b/board/ids/ids8313/ids8313.c index f742143bb9d..e7838dcd2a6 100644 --- a/board/ids/ids8313/ids8313.c +++ b/board/ids/ids8313/ids8313.c @@ -138,9 +138,11 @@ phys_size_t initdram(int board_type)  }  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd); + +	return 0;  }  #endif diff --git a/board/ifm/ac14xx/ac14xx.c b/board/ifm/ac14xx/ac14xx.c index 0fbdfdbf71a..5d2ab2fad3c 100644 --- a/board/ifm/ac14xx/ac14xx.c +++ b/board/ifm/ac14xx/ac14xx.c @@ -608,8 +608,10 @@ int checkboard(void)  }  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd); + +	return 0;  }  #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */ diff --git a/board/ifm/o2dnt2/o2dnt2.c b/board/ifm/o2dnt2/o2dnt2.c index 6716ffc9d0e..ca09767d287 100644 --- a/board/ifm/o2dnt2/o2dnt2.c +++ b/board/ifm/o2dnt2/o2dnt2.c @@ -364,7 +364,7 @@ int update_flash_size(int flash_size)  }  #endif /* defined(CONFIG_SYS_UPDATE_FLASH_SIZE) */ -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	int phy_addr = CONFIG_PHY_ADDR;  	char eth_path[] = "/soc5200@f0000000/mdio@3000/ethernet-phy@0"; @@ -380,5 +380,7 @@ void ft_board_setup(void *blob, bd_t *bd)  #endif  	/* fix up the phy address */  	do_fixup_by_path(blob, eth_path, "reg", &phy_addr, sizeof(int), 0); + +	return 0;  }  #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */ diff --git a/board/imgtec/malta/malta.c b/board/imgtec/malta/malta.c index d363e49919e..78c4bd4efe7 100644 --- a/board/imgtec/malta/malta.c +++ b/board/imgtec/malta/malta.c @@ -37,7 +37,7 @@ static void malta_lcd_puts(const char *str)  	void *reg = (void *)CKSEG1ADDR(MALTA_ASCIIPOS0);  	/* print up to 8 characters of the string */ -	for (i = 0; i < min(strlen(str), 8); i++) { +	for (i = 0; i < min((int)strlen(str), 8); i++) {  		__raw_writel(str[i], reg);  		reg += MALTA_ASCIIPOS1 - MALTA_ASCIIPOS0;  	} diff --git a/board/intercontrol/digsy_mtc/digsy_mtc.c b/board/intercontrol/digsy_mtc/digsy_mtc.c index 584372521b4..4ab71609c03 100644 --- a/board/intercontrol/digsy_mtc/digsy_mtc.c +++ b/board/intercontrol/digsy_mtc/digsy_mtc.c @@ -454,7 +454,7 @@ int update_flash_size (int flash_size)  }  #endif /* defined(CONFIG_SYS_UPDATE_FLASH_SIZE) */ -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	int phy_addr = CONFIG_PHY_ADDR;  	char eth_path[] = "/soc5200@f0000000/mdio@3000/ethernet-phy@0"; @@ -478,5 +478,7 @@ void ft_board_setup(void *blob, bd_t *bd)  #endif  	/* fix up the phy address */  	do_fixup_by_path(blob, eth_path, "reg", &phy_addr, sizeof(int), 0); + +	return 0;  }  #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */ diff --git a/board/ipek01/ipek01.c b/board/ipek01/ipek01.c index d44c4bf6695..2078f537690 100644 --- a/board/ipek01/ipek01.c +++ b/board/ipek01/ipek01.c @@ -196,10 +196,12 @@ void pci_init_board (void)  #endif  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup (void *blob, bd_t * bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup (blob, bd);  	fdt_fixup_memory (blob, (u64) bd->bi_memstart, (u64) bd->bi_memsize); + +	return 0;  }  #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */ diff --git a/board/jupiter/jupiter.c b/board/jupiter/jupiter.c index 78e4b5d1e91..88563936869 100644 --- a/board/jupiter/jupiter.c +++ b/board/jupiter/jupiter.c @@ -283,9 +283,10 @@ void ide_set_reset (int idereset)  #endif  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -void -ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd); + +	return 0;  }  #endif diff --git a/board/keymile/km82xx/km82xx.c b/board/keymile/km82xx/km82xx.c index dfbfab81369..e2009357de8 100644 --- a/board/keymile/km82xx/km82xx.c +++ b/board/keymile/km82xx/km82xx.c @@ -460,8 +460,10 @@ static void setports(int gpio)  }  #endif  #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd); + +	return 0;  }  #endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */ diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c index 0543483d5a9..1da0dcb9d8a 100644 --- a/board/keymile/km83xx/km83xx.c +++ b/board/keymile/km83xx/km83xx.c @@ -359,9 +359,11 @@ int checkboard(void)  }  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd); + +	return 0;  }  #endif diff --git a/board/keymile/kmp204x/kmp204x.c b/board/keymile/kmp204x/kmp204x.c index 4a736137e3f..a74f75bad41 100644 --- a/board/keymile/kmp204x/kmp204x.c +++ b/board/keymile/kmp204x/kmp204x.c @@ -261,7 +261,7 @@ void fdt_fixup_fman_mac_addresses(void *blob)  }  #endif -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	phys_addr_t base;  	phys_size_t size; @@ -286,6 +286,8 @@ void ft_board_setup(void *blob, bd_t *bd)  	fdt_fixup_fman_ethernet(blob);  	fdt_fixup_fman_mac_addresses(blob);  #endif + +	return 0;  }  #if defined(CONFIG_POST) diff --git a/board/korat/korat.c b/board/korat/korat.c index 8b830005090..d9ab2fd4216 100644 --- a/board/korat/korat.c +++ b/board/korat/korat.c @@ -610,7 +610,7 @@ void pci_target_init(struct pci_controller *hose)  #endif /* defined(CONFIG_PCI) && defined(CONFIG_SYS_PCI_TARGET_INIT) */  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	u32 val[4];  	int rc; @@ -627,5 +627,7 @@ void ft_board_setup(void *blob, bd_t *bd)  	if (rc)  		printf("Unable to update property NOR mapping, err=%s\n",  		       fdt_strerror(rc)); + +	return 0;  }  #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */ diff --git a/board/kosagi/novena/novena_spl.c b/board/kosagi/novena/novena_spl.c index c4155ddee22..c07735ad03a 100644 --- a/board/kosagi/novena/novena_spl.c +++ b/board/kosagi/novena/novena_spl.c @@ -17,6 +17,7 @@  #include <asm/imx-common/boot_mode.h>  #include <asm/imx-common/iomux-v3.h>  #include <asm/imx-common/mxc_i2c.h> +#include <asm/arch/crm_regs.h>  #include <i2c.h>  #include <mmc.h>  #include <fsl_esdhc.h> @@ -533,6 +534,30 @@ static struct mx6_ddr3_cfg elpida_4gib_1600 = {  	.trasmin	= 3590,  }; +static void ccgr_init(void) +{ +	struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR; + +	writel(0x00C03F3F, &ccm->CCGR0); +	writel(0x0030FC03, &ccm->CCGR1); +	writel(0x0FFFC000, &ccm->CCGR2); +	writel(0x3FF00000, &ccm->CCGR3); +	writel(0xFFFFF300, &ccm->CCGR4); +	writel(0x0F0000C3, &ccm->CCGR5); +	writel(0x000003FF, &ccm->CCGR6); +} + +static void gpr_init(void) +{ +	struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR; + +	/* enable AXI cache for VDOA/VPU/IPU */ +	writel(0xF00000CF, &iomux->gpr[4]); +	/* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */ +	writel(0x007F007F, &iomux->gpr[6]); +	writel(0x007F007F, &iomux->gpr[7]); +} +  /*   * called from C runtime startup code (arch/arm/lib/crt0.S:_main)   * - we have a stack and a place to store GD, both in SRAM @@ -543,6 +568,9 @@ void board_init_f(ulong dummy)  	/* setup AIPS and disable watchdog */  	arch_cpu_init(); +	ccgr_init(); +	gpr_init(); +  	/* setup GP timer */  	timer_init(); diff --git a/board/kosagi/novena/setup.cfg b/board/kosagi/novena/setup.cfg deleted file mode 100644 index 18d139c3421..00000000000 --- a/board/kosagi/novena/setup.cfg +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2014 Marek Vasut <marex@denx.de> - * - * SPDX-License-Identifier:	GPL-2.0+ - * - * Refer docs/README.imxmage for more details about how-to configure - * and create imximage boot image - * - * The syntax is taken as close as possible with the kwbimage - */ - -/* image version */ -IMAGE_VERSION 2 - -/* Boot Device : sd */ -BOOT_FROM sd - -#define __ASSEMBLY__ -#include <config.h> -#include "asm/arch/iomux.h" -#include "asm/arch/crm_regs.h" - -/* set the default clock gate to save power */ -DATA 4, CCM_CCGR0, 0x00C03F3F -DATA 4, CCM_CCGR1, 0x0030FC03 -DATA 4, CCM_CCGR2, 0x0FFFC000 -DATA 4, CCM_CCGR3, 0x3FF00000 -DATA 4, CCM_CCGR4, 0xFFFFF300 /* enable NAND/GPMI/BCH clocks */ -DATA 4, CCM_CCGR5, 0x0F0000C3 -DATA 4, CCM_CCGR6, 0x000003FF - -/* enable AXI cache for VDOA/VPU/IPU */ -DATA 4, MX6_IOMUXC_GPR4, 0xF00000CF -/* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */ -DATA 4, MX6_IOMUXC_GPR6, 0x007F007F -DATA 4, MX6_IOMUXC_GPR7, 0x007F007F - -/* - * Setup CCM_CCOSR register as follows: - * - * cko1_en  = 1    --> CKO1 enabled - * cko1_div = 111  --> divide by 8 - * cko1_sel = 1011 --> ahb_clk_root - * - * This sets CKO1 at ahb_clk_root/8 = 132/8 = 16.5 MHz - */ -DATA 4, CCM_CCOSR, 0x000000fb diff --git a/board/kup/kup4k/kup4k.c b/board/kup/kup4k/kup4k.c index a4c199859c3..71c6a79ae14 100644 --- a/board/kup/kup4k/kup4k.c +++ b/board/kup/kup4k/kup4k.c @@ -280,8 +280,10 @@ static unsigned char swapbyte(unsigned char c)   * Device Tree Support   */  #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd); + +	return 0;  }  #endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */ diff --git a/board/manroland/mucmc52/mucmc52.c b/board/manroland/mucmc52/mucmc52.c index c3ce66d8d06..c8ed5b73f42 100644 --- a/board/manroland/mucmc52/mucmc52.c +++ b/board/manroland/mucmc52/mucmc52.c @@ -385,8 +385,10 @@ void pci_init_board (void)  #endif  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd); + +	return 0;  }  #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */ diff --git a/board/manroland/uc101/uc101.c b/board/manroland/uc101/uc101.c index 5c5afa21ef5..e794c4645ee 100644 --- a/board/manroland/uc101/uc101.c +++ b/board/manroland/uc101/uc101.c @@ -358,8 +358,10 @@ void hw_watchdog_reset(void)  #endif  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd); + +	return 0;  }  #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */ diff --git a/board/motionpro/motionpro.c b/board/motionpro/motionpro.c index a6235e53945..4d0ebaab745 100644 --- a/board/motionpro/motionpro.c +++ b/board/motionpro/motionpro.c @@ -185,9 +185,11 @@ int checkboard(void)  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd); + +	return 0;  }  #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */ diff --git a/board/mpc8308_p1m/mpc8308_p1m.c b/board/mpc8308_p1m/mpc8308_p1m.c index 2009e62a1a7..688cc12a6c9 100644 --- a/board/mpc8308_p1m/mpc8308_p1m.c +++ b/board/mpc8308_p1m/mpc8308_p1m.c @@ -62,10 +62,12 @@ void pci_init_board(void)  }  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd);  	fdt_fixup_dr_usb(blob, bd); + +	return 0;  }  #endif diff --git a/board/muas3001/muas3001.c b/board/muas3001/muas3001.c index 08eb5e82903..529a58c2221 100644 --- a/board/muas3001/muas3001.c +++ b/board/muas3001/muas3001.c @@ -329,9 +329,11 @@ void ft_blob_update (void *blob, bd_t *bd)  	}  } -void ft_board_setup (void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup (blob, bd);  	ft_blob_update (blob, bd); + +	return 0;  }  #endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */ diff --git a/board/munices/munices.c b/board/munices/munices.c index 319fa8cba41..23d0f56bd62 100644 --- a/board/munices/munices.c +++ b/board/munices/munices.c @@ -146,9 +146,10 @@ void pci_init_board(void)  #endif  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -void -ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd); + +	return 0;  }  #endif diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c index 51125df34f0..0e4a65ad059 100644 --- a/board/nvidia/common/board.c +++ b/board/nvidia/common/board.c @@ -6,6 +6,7 @@   */  #include <common.h> +#include <dm.h>  #include <ns16550.h>  #include <linux/compiler.h>  #include <asm/io.h> @@ -43,6 +44,13 @@  DECLARE_GLOBAL_DATA_PTR; +#ifdef CONFIG_SPL_BUILD +/* TODO(sjg@chromium.org): Remove once SPL supports device tree */ +U_BOOT_DEVICE(tegra_gpios) = { +	"gpio_tegra" +}; +#endif +  const struct tegra_sysinfo sysinfo = {  	CONFIG_TEGRA_BOARD_STRING  }; diff --git a/board/pdm360ng/pdm360ng.c b/board/pdm360ng/pdm360ng.c index 15f8f3163d7..81f3024ed99 100644 --- a/board/pdm360ng/pdm360ng.c +++ b/board/pdm360ng/pdm360ng.c @@ -477,7 +477,7 @@ static unsigned char edid_buf[128] = {  };  #endif -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	u32 val[8];  	int rc, i = 0; @@ -526,6 +526,8 @@ void ft_board_setup(void *blob, bd_t *bd)  	if (rc)  		printf("Unable to update flash reg property, err=%s\n",  		       fdt_strerror(rc)); + +	return 0;  }  #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */ diff --git a/board/phytec/pcm030/pcm030.c b/board/phytec/pcm030/pcm030.c index ce515d834c6..ed41de13d47 100644 --- a/board/phytec/pcm030/pcm030.c +++ b/board/phytec/pcm030/pcm030.c @@ -164,9 +164,11 @@ void pci_init_board(void)  #endif  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t * bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd); + +	return 0;  }  #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */ diff --git a/board/raspberrypi/rpi_b/rpi_b.c b/board/raspberrypi/rpi_b/rpi_b.c index 7445f5318ad..db904a4107f 100644 --- a/board/raspberrypi/rpi_b/rpi_b.c +++ b/board/raspberrypi/rpi_b/rpi_b.c @@ -154,7 +154,7 @@ int board_mmc_init(bd_t *bis)  				  msg_clk->get_clock_rate.body.resp.rate_hz);  } -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	/*  	 * For now, we simply always add the simplefb DT node. Later, we @@ -162,4 +162,6 @@ void ft_board_setup(void *blob, bd_t *bd)  	 * node exists for the "real" graphics driver.  	 */  	lcd_dt_simplefb_add_node(blob); + +	return 0;  } diff --git a/board/samsung/odroid/odroid.c b/board/samsung/odroid/odroid.c index 33003ee9b56..b7d23817e14 100644 --- a/board/samsung/odroid/odroid.c +++ b/board/samsung/odroid/odroid.c @@ -382,6 +382,22 @@ static void board_gpio_init(void)  	gpio_set_pull(EXYNOS4X12_GPIO_X31, S5P_GPIO_PULL_UP);  	gpio_set_drv(EXYNOS4X12_GPIO_X31, S5P_GPIO_DRV_4X);  	gpio_direction_input(EXYNOS4X12_GPIO_X31); + +	/* Blue LED (Odroid X2/U2/U3) */ +	gpio_request(EXYNOS4X12_GPIO_C10, "Blue LED"); + +	gpio_direction_output(EXYNOS4X12_GPIO_C10, 0); + +#ifdef CONFIG_CMD_USB +	/* USB3503A Reference frequency */ +	gpio_request(EXYNOS4X12_GPIO_X30, "USB3503A RefFreq"); + +	/* USB3503A Connect */ +	gpio_request(EXYNOS4X12_GPIO_X34, "USB3503A Connect"); + +	/* USB3503A Reset */ +	gpio_request(EXYNOS4X12_GPIO_X35, "USB3503A Reset"); +#endif  }  static int pmic_init_max77686(void) @@ -462,9 +478,39 @@ struct s3c_plat_otg_data s5pc210_otg_data = {  	.usb_phy_ctrl	= EXYNOS4X12_USBPHY_CONTROL,  	.usb_flags	= PHY0_SLEEP,  }; +#endif + +#if defined(CONFIG_USB_GADGET) || defined(CONFIG_CMD_USB)  int board_usb_init(int index, enum usb_init_type init)  { +#ifdef CONFIG_CMD_USB +	struct pmic *p_pmic; + +	/* Set Ref freq 0 => 24MHz, 1 => 26MHz*/ +	/* Odroid Us have it at 24MHz, Odroid Xs at 26MHz */ +	if (gd->board_type == ODROID_TYPE_U3) +		gpio_direction_output(EXYNOS4X12_GPIO_X30, 0); +	else +		gpio_direction_output(EXYNOS4X12_GPIO_X30, 1); + +	/* Disconnect, Reset, Connect */ +	gpio_direction_output(EXYNOS4X12_GPIO_X34, 0); +	gpio_direction_output(EXYNOS4X12_GPIO_X35, 0); +	gpio_direction_output(EXYNOS4X12_GPIO_X35, 1); +	gpio_direction_output(EXYNOS4X12_GPIO_X34, 1); + +	/* Power off and on BUCK8 for LAN9730 */ +	debug("LAN9730 - Turning power buck 8 OFF and ON.\n"); + +	p_pmic = pmic_get("MAX77686_PMIC"); +	if (p_pmic && !pmic_probe(p_pmic)) { +		max77686_set_buck_voltage(p_pmic, 8, 750000); +		max77686_set_buck_voltage(p_pmic, 8, 3300000); +	} + +#endif +  	debug("USB_udc_probe\n");  	return s3c_udc_probe(&s5pc210_otg_data);  } diff --git a/board/samsung/smdk5420/Kconfig b/board/samsung/smdk5420/Kconfig index d3a5b7f7d7f..e7aafe5bebd 100644 --- a/board/samsung/smdk5420/Kconfig +++ b/board/samsung/smdk5420/Kconfig @@ -1,3 +1,19 @@ +if TARGET_PEACH_PI + +config SYS_BOARD +	string +	default "smdk5420" + +config SYS_VENDOR +	string +	default "samsung" + +config SYS_CONFIG_NAME +	string +	default "peach-pi" + +endif +  if TARGET_PEACH_PIT  config SYS_BOARD diff --git a/board/samsung/smdk5420/MAINTAINERS b/board/samsung/smdk5420/MAINTAINERS index e0f5c7a530e..1423f839955 100644 --- a/board/samsung/smdk5420/MAINTAINERS +++ b/board/samsung/smdk5420/MAINTAINERS @@ -6,3 +6,5 @@ F:	include/configs/peach-pit.h  F:	configs/peach-pit_defconfig  F:	include/configs/smdk5420.h  F:	configs/smdk5420_defconfig +F:	include/configs/peach-pi.h +F:	configs/peach-pi_defconfig diff --git a/board/sbc8349/sbc8349.c b/board/sbc8349/sbc8349.c index 89da47ed12d..72786d2ace6 100644 --- a/board/sbc8349/sbc8349.c +++ b/board/sbc8349/sbc8349.c @@ -214,11 +214,13 @@ void sdram_init(void)  #endif  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd);  #ifdef CONFIG_PCI  	ft_pci_setup(blob, bd);  #endif + +	return 0;  }  #endif diff --git a/board/sbc8548/sbc8548.c b/board/sbc8548/sbc8548.c index d584276253a..25329e44736 100644 --- a/board/sbc8548/sbc8548.c +++ b/board/sbc8548/sbc8548.c @@ -301,12 +301,14 @@ int last_stage_init(void)  }  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd);  #ifdef CONFIG_FSL_PCI_INIT  	FT_FSL_PCI_SETUP;  #endif + +	return 0;  }  #endif diff --git a/board/sbc8641d/sbc8641d.c b/board/sbc8641d/sbc8641d.c index 4906be48893..6bdf1a28e97 100644 --- a/board/sbc8641d/sbc8641d.c +++ b/board/sbc8641d/sbc8641d.c @@ -173,11 +173,13 @@ void pci_init_board(void)  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup (void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd);  	FT_FSL_PCI_SETUP; + +	return 0;  }  #endif diff --git a/board/socrates/socrates.c b/board/socrates/socrates.c index 2caefbbe584..953a43ff316 100644 --- a/board/socrates/socrates.c +++ b/board/socrates/socrates.c @@ -218,8 +218,7 @@ int board_early_init_r (void)  #endif /* CONFIG_BOARD_EARLY_INIT_R */  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -void -ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	u32 val[12];  	int rc, i = 0; @@ -251,6 +250,8 @@ ft_board_setup(void *blob, bd_t *bd)  	if (rc)  		printf("Unable to update localbus ranges, err=%s\n",  		       fdt_strerror(rc)); + +	return 0;  }  #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */ diff --git a/board/stx/stxssa/stxssa.c b/board/stx/stxssa/stxssa.c index f5c3d750cee..6e4eed86a5f 100644 --- a/board/stx/stxssa/stxssa.c +++ b/board/stx/stxssa/stxssa.c @@ -233,9 +233,11 @@ reset_phy(void)  }  #ifdef CONFIG_OF_BOARD_SETUP -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup (blob, bd); + +	return 0;  }  #endif /* CONFIG_OF_BOARD_SETUP */ diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index c3f865d2983..246cd9a1a70 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -21,7 +21,10 @@ config MACH_SUN6I  config MACH_SUN7I  	bool "sun7i (Allwinner A20)"  	select CPU_V7 +	select CPU_V7_HAS_NONSEC +	select CPU_V7_HAS_VIRT  	select SUPPORT_SPL +	select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT  config MACH_SUN8I  	bool "sun8i (Allwinner A23)" @@ -213,4 +216,18 @@ config USB2_VBUS_PIN  	---help---  	See USB1_VBUS_PIN help text. +config VIDEO +	boolean "Enable graphical uboot console on HDMI" +	default y +	---help--- +	Say Y here to add support for using a cfb console on the HDMI output +	found on most sunxi devices. + +config USB_KEYBOARD +	boolean "Enable USB keyboard support" +	default y +	---help--- +	Say Y here to add support for using a USB keyboard (typically used +	in combination with a graphical console on HDMI). +  endif diff --git a/board/sunxi/ahci.c b/board/sunxi/ahci.c index 5e123285b03..b7f0dda2058 100644 --- a/board/sunxi/ahci.c +++ b/board/sunxi/ahci.c @@ -76,6 +76,8 @@ void scsi_init(void)  #ifdef CONFIG_SATAPWR  	gpio_request(CONFIG_SATAPWR, "satapwr");  	gpio_direction_output(CONFIG_SATAPWR, 1); +	/* Give attached sata device time to power-up to avoid link timeouts */ +	mdelay(500);  #endif  	if (sunxi_ahci_phy_init(SUNXI_SATA_BASE) < 0) diff --git a/board/sunxi/board.c b/board/sunxi/board.c index e6ec5b8fc10..4c1c69a6ae1 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -24,6 +24,7 @@  #endif  #include <asm/arch/clock.h>  #include <asm/arch/cpu.h> +#include <asm/arch/display.h>  #include <asm/arch/dram.h>  #include <asm/arch/gpio.h>  #include <asm/arch/mmc.h> @@ -237,3 +238,12 @@ int misc_init_r(void)  	return 0;  }  #endif + +#ifdef CONFIG_OF_BOARD_SETUP +int ft_board_setup(void *blob, bd_t *bd) +{ +#ifdef CONFIG_VIDEO_DT_SIMPLEFB +	return sunxi_simplefb_setup(blob); +#endif +} +#endif /* CONFIG_OF_BOARD_SETUP */ diff --git a/board/sunxi/gmac.c b/board/sunxi/gmac.c index 051aca01a83..571bc9e0ab0 100644 --- a/board/sunxi/gmac.c +++ b/board/sunxi/gmac.c @@ -13,7 +13,12 @@ int sunxi_gmac_initialize(bd_t *bis)  		(struct sunxi_ccm_reg *)SUNXI_CCM_BASE;  	/* Set up clock gating */ +#ifndef CONFIG_MACH_SUN6I  	setbits_le32(&ccm->ahb_gate1, 0x1 << AHB_GATE_OFFSET_GMAC); +#else +	setbits_le32(&ccm->ahb_reset0_cfg, 0x1 << AHB_RESET_OFFSET_GMAC); +	setbits_le32(&ccm->ahb_gate0, 0x1 << AHB_GATE_OFFSET_GMAC); +#endif  	/* Set MII clock */  #ifdef CONFIG_RGMII @@ -33,6 +38,7 @@ int sunxi_gmac_initialize(bd_t *bis)  	setbits_le32(&ccm->gmac_clk_cfg, 0x3 << 10);  #endif +#ifndef CONFIG_MACH_SUN6I  	/* Configure pin mux settings for GMAC */  	for (pin = SUNXI_GPA(0); pin <= SUNXI_GPA(16); pin++) {  #ifdef CONFIG_RGMII @@ -43,9 +49,48 @@ int sunxi_gmac_initialize(bd_t *bis)  		sunxi_gpio_set_cfgpin(pin, SUN7I_GPA0_GMAC);  		sunxi_gpio_set_drv(pin, 3);  	} +#elif defined CONFIG_RGMII +	/* Configure sun6i RGMII mode pin mux settings */ +	for (pin = SUNXI_GPA(0); pin <= SUNXI_GPA(3); pin++) { +		sunxi_gpio_set_cfgpin(pin, SUN6I_GPA0_GMAC); +		sunxi_gpio_set_drv(pin, 3); +	} +	for (pin = SUNXI_GPA(9); pin <= SUNXI_GPA(14); pin++) { +		sunxi_gpio_set_cfgpin(pin, SUN6I_GPA0_GMAC); +		sunxi_gpio_set_drv(pin, 3); +	} +	for (pin = SUNXI_GPA(19); pin <= SUNXI_GPA(20); pin++) { +		sunxi_gpio_set_cfgpin(pin, SUN6I_GPA0_GMAC); +		sunxi_gpio_set_drv(pin, 3); +	} +	for (pin = SUNXI_GPA(25); pin <= SUNXI_GPA(27); pin++) { +		sunxi_gpio_set_cfgpin(pin, SUN6I_GPA0_GMAC); +		sunxi_gpio_set_drv(pin, 3); +	} +#elif defined CONFIG_GMII +	/* Configure sun6i GMII mode pin mux settings */ +	for (pin = SUNXI_GPA(0); pin <= SUNXI_GPA(27); pin++) { +		sunxi_gpio_set_cfgpin(pin, SUN6I_GPA0_GMAC); +		sunxi_gpio_set_drv(pin, 2); +	} +#else +	/* Configure sun6i MII mode pin mux settings */ +	for (pin = SUNXI_GPA(0); pin <= SUNXI_GPA(3); pin++) +		sunxi_gpio_set_cfgpin(pin, SUN6I_GPA0_GMAC); +	for (pin = SUNXI_GPA(8); pin <= SUNXI_GPA(9); pin++) +		sunxi_gpio_set_cfgpin(pin, SUN6I_GPA0_GMAC); +	for (pin = SUNXI_GPA(11); pin <= SUNXI_GPA(14); pin++) +		sunxi_gpio_set_cfgpin(pin, SUN6I_GPA0_GMAC); +	for (pin = SUNXI_GPA(19); pin <= SUNXI_GPA(24); pin++) +		sunxi_gpio_set_cfgpin(pin, SUN6I_GPA0_GMAC); +	for (pin = SUNXI_GPA(26); pin <= SUNXI_GPA(27); pin++) +		sunxi_gpio_set_cfgpin(pin, SUN6I_GPA0_GMAC); +#endif  #ifdef CONFIG_RGMII  	return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_RGMII); +#elif defined CONFIG_GMII +	return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_GMII);  #else  	return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_MII);  #endif diff --git a/board/tbs/tbs2910/tbs2910.c b/board/tbs/tbs2910/tbs2910.c index daf8ff4e621..dfa430e4ab6 100644 --- a/board/tbs/tbs2910/tbs2910.c +++ b/board/tbs/tbs2910/tbs2910.c @@ -219,15 +219,13 @@ int board_mmc_getcd(struct mmc *mmc)  int board_mmc_init(bd_t *bis)  { -	s32 status = 0; -	int i; -  	/*  	 * (U-boot device node)    (Physical Port)  	 * mmc0                    SD2  	 * mmc1                    SD3  	 * mmc2                    eMMC  	 */ +	int i, ret;  	for (i = 0; i < CONFIG_SYS_FSL_USDHC_NUM; i++) {  		switch (i) {  		case 0: @@ -251,12 +249,13 @@ int board_mmc_init(bd_t *bis)  			printf("Warning: you configured more USDHC controllers"  			       "(%d) then supported by the board (%d)\n",  			       i + 1, CONFIG_SYS_FSL_USDHC_NUM); -			return status; +			return -EINVAL;  		} - -		status |= fsl_esdhc_initialize(bis, &usdhc_cfg[i]); +		ret = fsl_esdhc_initialize(bis, &usdhc_cfg[i]); +		if (ret) +			return ret;  	} -	return status; +	return 0;  }  #endif /* CONFIG_FSL_ESDHC */ diff --git a/board/ti/ks2_evm/board.c b/board/ti/ks2_evm/board.c index ff7bc4bb18d..04ec6751036 100644 --- a/board/ti/ks2_evm/board.c +++ b/board/ti/ks2_evm/board.c @@ -114,7 +114,7 @@ u32 spl_boot_device(void)  #endif  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	int lpae;  	char *env; @@ -217,6 +217,8 @@ void ft_board_setup(void *blob, bd_t *bd)  			}  		}  	} + +	return 0;  }  void ft_board_setup_ex(void *blob, bd_t *bd) diff --git a/board/tqc/tqm5200/tqm5200.c b/board/tqc/tqm5200/tqm5200.c index a1f56cde296..e9363ea3948 100644 --- a/board/tqc/tqm5200/tqm5200.c +++ b/board/tqc/tqm5200/tqm5200.c @@ -863,12 +863,14 @@ int board_get_height (void)  #endif /* CONFIG_VIDEO_SM501 */  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd);  #if defined(CONFIG_VIDEO)  	fdt_add_edid(blob, "smi,sm501", edid_buf);  #endif + +	return 0;  }  #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */ diff --git a/board/tqc/tqm834x/tqm834x.c b/board/tqc/tqm834x/tqm834x.c index 814fcb26573..d891a3844ca 100644 --- a/board/tqc/tqm834x/tqm834x.c +++ b/board/tqc/tqm834x/tqm834x.c @@ -414,12 +414,14 @@ static void set_ddr_config(void) {  }  #ifdef CONFIG_OF_BOARD_SETUP -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd);  #ifdef CONFIG_PCI  	ft_pci_setup(blob, bd);  #endif	/* CONFIG_PCI */ + +	return 0;  }  #endif	/* CONFIG_OF_BOARD_SETUP */ diff --git a/board/tqc/tqm8xx/tqm8xx.c b/board/tqc/tqm8xx/tqm8xx.c index 9ce2a5739f3..3b5230abc0d 100644 --- a/board/tqc/tqm8xx/tqm8xx.c +++ b/board/tqc/tqm8xx/tqm8xx.c @@ -674,10 +674,12 @@ void ft_blob_update (void *blob, bd_t *bd)  	}  } -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd);  	ft_blob_update(blob, bd); + +	return 0;  }  #endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */ diff --git a/board/tqc/tqma6/tqma6.c b/board/tqc/tqma6/tqma6.c index fd1bd59c6c3..c9e163e7d5e 100644 --- a/board/tqc/tqma6/tqma6.c +++ b/board/tqc/tqma6/tqma6.c @@ -17,6 +17,7 @@  #include <asm/gpio.h>  #include <asm/io.h>  #include <asm/imx-common/mxc_i2c.h> +#include <asm/imx-common/spi.h>  #include <common.h>  #include <fsl_esdhc.h>  #include <libfdt.h> @@ -50,7 +51,7 @@ DECLARE_GLOBAL_DATA_PTR;  int dram_init(void)  { -	gd->ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE); +	gd->ram_size = imx_ddr_size();  	return 0;  } @@ -180,8 +181,14 @@ static struct i2c_pads_info tqma6_i2c3_pads = {  static void tqma6_setup_i2c(void)  { -	/* use logical index for bus, e.g. I2C1 -> 0 */ -	setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &tqma6_i2c3_pads); +	int ret; +	/* +	 * use logical index for bus, e.g. I2C1 -> 0 +	 * warn on error +	 */ +	ret = setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &tqma6_i2c3_pads); +	if (ret) +		printf("setup I2C3 failed: %d\n", ret);  }  int board_early_init_f(void) @@ -259,12 +266,14 @@ int checkboard(void)   * Device Tree Support   */  #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	/* bring in eMMC dsr settings */  	do_fixup_by_path_u32(blob,  			     "/soc/aips-bus@02100000/usdhc@02198000",  			     "dsr", tqma6_emmc_dsr, 2);  	tqma6_bb_ft_board_setup(blob, bd); + +	return 0;  }  #endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */ diff --git a/board/tqc/tqma6/tqma6_mba6.c b/board/tqc/tqma6/tqma6_mba6.c index fd592875d8c..6f4cffd95ec 100644 --- a/board/tqc/tqma6/tqma6_mba6.c +++ b/board/tqc/tqma6/tqma6_mba6.c @@ -224,8 +224,14 @@ static struct i2c_pads_info mba6_i2c1_pads = {  static void mba6_setup_i2c(void)  { -	/* use logical index for bus, e.g. I2C1 -> 0 */ -	setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &mba6_i2c1_pads); +	int ret; +	/* +	 * use logical index for bus, e.g. I2C1 -> 0 +	 * warn on error +	 */ +	ret = setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &mba6_i2c1_pads); +	if (ret) +		printf("setup I2C1 failed: %d\n", ret);  } diff --git a/board/ve8313/ve8313.c b/board/ve8313/ve8313.c index c4feef8196e..7f24a30688a 100644 --- a/board/ve8313/ve8313.c +++ b/board/ve8313/ve8313.c @@ -192,11 +192,13 @@ void pci_init_board(void)  #endif  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  	ft_cpu_setup(blob, bd);  #ifdef CONFIG_PCI  	ft_pci_setup(blob, bd);  #endif + +	return 0;  }  #endif diff --git a/board/wandboard/wandboard.c b/board/wandboard/wandboard.c index 3c8b7a5d2d0..1075c6589d5 100644 --- a/board/wandboard/wandboard.c +++ b/board/wandboard/wandboard.c @@ -144,7 +144,7 @@ int board_mmc_getcd(struct mmc *mmc)  int board_mmc_init(bd_t *bis)  { -	s32 status = 0; +	int ret;  	u32 index = 0;  	/* @@ -173,13 +173,15 @@ int board_mmc_init(bd_t *bis)  			printf("Warning: you configured more USDHC controllers"  			       "(%d) then supported by the board (%d)\n",  			       index + 1, CONFIG_SYS_FSL_USDHC_NUM); -			return status; +			return -EINVAL;  		} -		status |= fsl_esdhc_initialize(bis, &usdhc_cfg[index]); +		ret = fsl_esdhc_initialize(bis, &usdhc_cfg[index]); +		if (ret) +			return ret;  	} -	return status; +	return 0;  }  static int mx6_rgmii_rework(struct phy_device *phydev) diff --git a/board/xes/xpedite517x/xpedite517x.c b/board/xes/xpedite517x/xpedite517x.c index b7ad3495025..0028870db07 100644 --- a/board/xes/xpedite517x/xpedite517x.c +++ b/board/xes/xpedite517x/xpedite517x.c @@ -69,11 +69,13 @@ phys_size_t initdram(int board_type)  }  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  #ifdef CONFIG_PCI  	ft_board_pci_setup(blob, bd);  #endif  	ft_cpu_setup(blob, bd); + +	return 0;  }  #endif diff --git a/board/xes/xpedite520x/xpedite520x.c b/board/xes/xpedite520x/xpedite520x.c index aa9e99d108e..6a3df52391e 100644 --- a/board/xes/xpedite520x/xpedite520x.c +++ b/board/xes/xpedite520x/xpedite520x.c @@ -70,11 +70,13 @@ int board_early_init_r(void)  }  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  #ifdef CONFIG_PCI  	ft_board_pci_setup(blob, bd);  #endif  	ft_cpu_setup(blob, bd); + +	return 0;  }  #endif diff --git a/board/xes/xpedite537x/xpedite537x.c b/board/xes/xpedite537x/xpedite537x.c index efd563b266b..41419feb178 100644 --- a/board/xes/xpedite537x/xpedite537x.c +++ b/board/xes/xpedite537x/xpedite537x.c @@ -72,11 +72,13 @@ int board_early_init_r(void)  }  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  #ifdef CONFIG_PCI  	ft_board_pci_setup(blob, bd);  #endif  	ft_cpu_setup(blob, bd); + +	return 0;  }  #endif diff --git a/board/xes/xpedite550x/xpedite550x.c b/board/xes/xpedite550x/xpedite550x.c index e64d682afe7..1f05150d0ff 100644 --- a/board/xes/xpedite550x/xpedite550x.c +++ b/board/xes/xpedite550x/xpedite550x.c @@ -72,11 +72,13 @@ int board_early_init_r(void)  }  #if defined(CONFIG_OF_BOARD_SETUP) -void ft_board_setup(void *blob, bd_t *bd) +int ft_board_setup(void *blob, bd_t *bd)  {  #ifdef CONFIG_PCI  	ft_board_pci_setup(blob, bd);  #endif  	ft_cpu_setup(blob, bd); + +	return 0;  }  #endif | 
