diff options
author | ian <ian@FreeBSD.org> | 2014-12-22 23:07:53 +0800 |
---|---|---|
committer | ian <ian@FreeBSD.org> | 2014-12-22 23:07:53 +0800 |
commit | 11c066b28658a17dc1be5a7c42ed3a60d23bd6b2 (patch) | |
tree | 2e945752f1165f51852ef1067f925246dfff41a5 /sysutils/u-boot-beaglebone | |
parent | 2c0cda158e626db75e1f599a1a7e6362f29f632b (diff) | |
download | freebsd-ports-gnome-11c066b28658a17dc1be5a7c42ed3a60d23bd6b2.tar.gz freebsd-ports-gnome-11c066b28658a17dc1be5a7c42ed3a60d23bd6b2.tar.zst freebsd-ports-gnome-11c066b28658a17dc1be5a7c42ed3a60d23bd6b2.zip |
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
Diffstat (limited to 'sysutils/u-boot-beaglebone')
-rw-r--r-- | sysutils/u-boot-beaglebone/Makefile | 6 | ||||
-rw-r--r-- | sysutils/u-boot-beaglebone/files/patch-include_configs_am335x__evm.h | 66 |
2 files changed, 33 insertions, 39 deletions
diff --git a/sysutils/u-boot-beaglebone/Makefile b/sysutils/u-boot-beaglebone/Makefile index 8cec4289cd1e..e56db592c1a6 100644 --- a/sysutils/u-boot-beaglebone/Makefile +++ b/sysutils/u-boot-beaglebone/Makefile @@ -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> diff --git a/sysutils/u-boot-beaglebone/files/patch-include_configs_am335x__evm.h b/sysutils/u-boot-beaglebone/files/patch-include_configs_am335x__evm.h index deb61c3838f1..add727fd84b6 100644 --- a/sysutils/u-boot-beaglebone/files/patch-include_configs_am335x__evm.h +++ b/sysutils/u-boot-beaglebone/files/patch-include_configs_am335x__evm.h @@ -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 */ |