svn commit: r375242 - in head/sysutils/u-boot-beaglebone: . files

Ian Lepore ian at FreeBSD.org
Mon Dec 22 15:07:55 UTC 2014


Author: ian (src committer)
Date: Mon Dec 22 15:07:53 2014
New Revision: 375242
URL: https://svnweb.freebsd.org/changeset/ports/375242
QAT: https://qat.redports.org/buildarchive/r375242/

Log:
  Changes to allow booting from eMMC on a Beaglebone Black.  Using the
  right config (am335x_boneblack_defconfig) is a big part of that.  The
  u-boot environment is also pretty extensively changed, both to support
  eMMC (choosing which device to load freebsd from) and to further trim
  and clean up the environment so it's easier to read and understand.
  
  In an ideal world, the 'mmc 0' device would always be the one u-boot was
  loaded from and 'mmc 1' would be 'the other' device.  That's what the
  Wandboard u-boot does, and it would be easy enough to do on Beaglebone too
  except I couldn't find a way to pass the load device number from MLO which
  knows it to the main u-boot.  So for now the removable sdcard is device 0
  and the onboard eMMC is device 1, and it prefers to boot from sdcard if
  it's present and has ubldr on it (unless the user has set the 'fatdev' env
  var, in which case it is used).
  
  Approved by:	imp

Modified:
  head/sysutils/u-boot-beaglebone/Makefile
  head/sysutils/u-boot-beaglebone/files/patch-include_configs_am335x__evm.h

Modified: head/sysutils/u-boot-beaglebone/Makefile
==============================================================================
--- head/sysutils/u-boot-beaglebone/Makefile	Mon Dec 22 15:02:23 2014	(r375241)
+++ head/sysutils/u-boot-beaglebone/Makefile	Mon Dec 22 15:07:53 2014	(r375242)
@@ -20,7 +20,7 @@ USES=		gmake tar:bzip2
 SSP_UNSAFE=	yes # cross-LD does not support -fstack-protector
 
 U_BOOT_DIR=	share/u-boot/${PORTNAME}${PKGNAMESUFFIX}
-PLIST_FILES=	${U_BOOT_DIR}/bb-uboot.img \
+PLIST_FILES=	${U_BOOT_DIR}/u-boot.img \
 		${U_BOOT_DIR}/MLO \
 		${U_BOOT_DIR}/README
 
@@ -28,12 +28,12 @@ MAKE_ARGS+=	ARCH=arm \
 		CROSS_COMPILE=arm-none-eabi-
 
 do-configure:
-	(cd ${WRKSRC}; ${GMAKE} am335x_evm_config)
+	(cd ${WRKSRC}; ${GMAKE} am335x_boneblack_defconfig)
 
 do-install:
 	${MKDIR} ${STAGEDIR}/${PREFIX}/${U_BOOT_DIR}
 	${CP} ${WRKSRC}/MLO ${STAGEDIR}/${PREFIX}/${U_BOOT_DIR}
-	${CP} ${WRKSRC}/u-boot.img ${STAGEDIR}/${PREFIX}/${U_BOOT_DIR}/bb-uboot.img
+	${CP} ${WRKSRC}/u-boot.img ${STAGEDIR}/${PREFIX}/${U_BOOT_DIR}/u-boot.img
 	${CP} ${.CURDIR}/pkg-descr ${STAGEDIR}/${PREFIX}/${U_BOOT_DIR}/README
 
 .include <bsd.port.mk>

Modified: head/sysutils/u-boot-beaglebone/files/patch-include_configs_am335x__evm.h
==============================================================================
--- head/sysutils/u-boot-beaglebone/files/patch-include_configs_am335x__evm.h	Mon Dec 22 15:02:23 2014	(r375241)
+++ head/sysutils/u-boot-beaglebone/files/patch-include_configs_am335x__evm.h	Mon Dec 22 15:07:53 2014	(r375242)
@@ -1,6 +1,6 @@
 --- include/configs/am335x_evm.h.orig	2014-10-14 08:47:15 UTC
 +++ include/configs/am335x_evm.h
-@@ -479,4 +479,82 @@
+@@ -479,4 +479,76 @@
  #endif
  #endif  /* NOR support */
  
@@ -8,78 +8,72 @@
 + * FreeBSD customizations from here down.
 + ****************************************************************************/
 +
-+/* No watchdog.  (Why?) */
-+#undef  CONFIG_HW_WATCHDOG
-+#undef  CONFIG_OMAP_WATCHDOG
-+#undef  CONFIG_SPL_WATCHDOG_SUPPORT
-+
 +/* Add the API and ELF features needed for ubldr. */
 +#ifndef CONFIG_SPL_BUILD
 +#define CONFIG_API
 +#define CONFIG_CMD_ELF
 +#define CONFIG_CMD_ENV_EXISTS
 +#define CONFIG_EFI_PARTITION
-+#define CONFIG_PREBOOT
 +#define CONFIG_SYS_MMC_MAX_DEVICE 2
 +#endif
 +
-+/* SPL loads bb-uboot.img. */
-+#ifdef CONFIG_SPL_BUILD
-+#undef  CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME
-+#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME	"bb-uboot.img"
-+#endif
-+
 +/* Save the env to the fat partition. */
 +#ifndef CONFIG_SPL_BUILD
 +#undef  CONFIG_ENV_IS_NOWHERE
 +#undef  CONFIG_ENV_IS_IN_NAND
++#undef  CONFIG_ENV_IS_IN_MMC
 +#define CONFIG_ENV_IS_IN_FAT
 +#define CONFIG_FAT_WRITE
 +#define FAT_ENV_INTERFACE	"mmc"
 +#define FAT_ENV_DEVICE_AND_PART	"0"
-+#define FAT_ENV_FILE		"uboot.env"
++#define FAT_ENV_FILE		"u-boot.env"
 +#endif
 +
 +/* Create a small(ish) boot environment for FreeBSD. */
 +#ifndef CONFIG_SPL_BUILD
 +#undef  CONFIG_EXTRA_ENV_SETTINGS
 +#define CONFIG_EXTRA_ENV_SETTINGS \
-+	"bootfile=bbubldr\0" \
-+	"fdt_file=undefined\0" \
-+	"fatdev=mmc 0:1\0" \
-+	"loadaddr=0x88000000\0" \
-+	"loaderdev=disk\0" \
-+	"uenv_file=bb-uEnv.txt\0" \
-+	\
-+	"fatboot=" \
-+	  "env exists user_fatboot && run user_fatboot; " \
++	"loadaddr=88000000\0" \
++	"Fatboot=" \
++	  "env exists loaderdev || env set loaderdev ${fatdev}; " \
++	  "env exists UserFatboot && run UserFatboot; " \
++	  "echo Booting from: ${fatdev} ${bootfile}; " \
 +	  "fatload ${fatdev} ${loadaddr} ${bootfile} && bootelf; " \
 +	"\0" \
-+	"netboot=" \
-+	  "env exists user_netboot && run user_netboot; " \
++	"Netboot=" \
++	  "env exists loaderdev || env set loaderdev net; " \
++	  "env exists UserNetboot && run UserNetboot; " \
 +	  "dhcp ${loadaddr} ${bootfile} && bootelf; " \
 +	"\0" \
-+	"preboot=" \
-+	  "env exists setfdt && run setfdt; " \
-+	  "env exists uenv_import && run uenv_import; " \
-+	  "env exists user_preboot && run user_preboot; " \
++	"Preboot=" \
++	  "env exists bootfile || bootfile=ubldr; " \
++	  "env exists uenv_file || uenv_file=uEnv.txt; " \
++	  "env exists SetupFdtfile && run SetupFdtfile; " \
++	  "env exists SetupFatdev && run SetupFatdev; " \
++	  "env exists SetupUenv && run SetupUenv; " \
++	  "env exists UserPreboot && run UserPreboot; " \
 +	"\0" \
-+	"setfdt=" \
++	"SetupFdtfile=" \
 +	  "if test ${board_name} = A335BONE; then " \
-+	      "env set fdt_file bbone.dtb; " \
++	      "env set fdt_file beaglebone.dtb; " \
 +	  "elif test ${board_name} = A335BNLT; then " \
-+	      "env set fdt_file bboneblk.dtb; " \
-+	  "else " \
-+	       "echo WARNING: Could not determine device tree to use; " \
++	      "env set fdt_file beaglebone-black.dtb; " \
 +	  "fi; " \
 +	"\0" \
-+	"uenv_import=" \
++	"SetupFatdev=" \
++	  "env exists fatdev || " \
++	    "fatsize ${fatdev:=mmc 0} ${bootfile} || " \
++	    "fatdev='mmc 1'; " \
++	"\0" \
++	"SetupUenv=" \
 +	  "fatload ${fatdev} ${loadaddr} ${uenv_file} && " \
 +	    "env import -t ${loadaddr} ${filesize}; " \
 +	"\0"
 +
 +#undef  CONFIG_BOOTCOMMAND
-+#define CONFIG_BOOTCOMMAND "run fatboot"
++#define CONFIG_BOOTCOMMAND	"run Fatboot"
++#undef  CONFIG_PREBOOT
++#define CONFIG_PREBOOT		"run Preboot"
 +#endif
 +
  #endif	/* ! __CONFIG_AM335X_EVM_H */


More information about the svn-ports-head mailing list