summaryrefslogtreecommitdiffstats
path: root/meta-aspeed/recipes-bsp
diff options
context:
space:
mode:
Diffstat (limited to 'meta-aspeed/recipes-bsp')
-rw-r--r--meta-aspeed/recipes-bsp/u-boot/files/alt_fw_env.config25
-rw-r--r--meta-aspeed/recipes-bsp/u-boot/files/default-gcc.patch39
-rw-r--r--meta-aspeed/recipes-bsp/u-boot/files/fw_env.config25
-rw-r--r--meta-aspeed/recipes-bsp/u-boot/u-boot-aspeed_2016.07.bb5
-rw-r--r--meta-aspeed/recipes-bsp/u-boot/u-boot-common-aspeed_2016.07.inc17
-rw-r--r--meta-aspeed/recipes-bsp/u-boot/u-boot-fw-utils-aspeed_2016.07.bb44
6 files changed, 155 insertions, 0 deletions
diff --git a/meta-aspeed/recipes-bsp/u-boot/files/alt_fw_env.config b/meta-aspeed/recipes-bsp/u-boot/files/alt_fw_env.config
new file mode 100644
index 000000000..3d85f9974
--- /dev/null
+++ b/meta-aspeed/recipes-bsp/u-boot/files/alt_fw_env.config
@@ -0,0 +1,25 @@
+# Configuration file for fw_(printenv/setenv) utility.
+# Up to two entries are valid, in this case the redundant
+# environment sector is assumed present.
+# Notice, that the "Number of sectors" is ignored on NOR and SPI-dataflash.
+# Furthermore, if the Flash sector size is omitted, this value is assumed to
+# be the same as the Environment size, which is valid for NOR and SPI-dataflash
+
+# NOR example
+# MTD device name Device offset Env. size Flash sector size Number of sectors
+#/dev/mtd1 0x0000 0x20000 0x20000
+#/dev/mtd2 0x0000 0x4000 0x4000
+
+# MTD SPI-dataflash example
+# MTD device name Device offset Env. size Flash sector size Number of sectors
+#/dev/mtd2 0x00000 0x20000
+/dev/mtd/alt-u-boot-env 0x00000 0x10000
+/dev/mtd/alt-u-boot-env 0x10000 0x10000
+#/dev/mtd5 0x4200 0x4200
+#/dev/mtd6 0x4200 0x4200
+
+# NAND example
+#/dev/mtd0 0x4000 0x4000 0x20000 2
+
+# Block device example
+#/dev/mmcblk0 0xc0000 0x20000
diff --git a/meta-aspeed/recipes-bsp/u-boot/files/default-gcc.patch b/meta-aspeed/recipes-bsp/u-boot/files/default-gcc.patch
new file mode 100644
index 000000000..04184df8b
--- /dev/null
+++ b/meta-aspeed/recipes-bsp/u-boot/files/default-gcc.patch
@@ -0,0 +1,39 @@
+OE needs to be able to change the default compiler. If we pass in HOSTCC
+through the make command, it overwrites not only this setting but also the
+setting in tools/Makefile wrapped in ifneq ($(CROSS_BUILD_TOOLS),) which
+breaks the build.
+
+We therefore use override to ensure the value of HOSTCC is overwritten when
+needed.
+
+RP: Updated the patch to the version being submitted to upstream u-boot
+
+Upstream-Status: Submitted [emailed to Masahiro Yamada for discussion]
+RP 2017/3/11
+
+Index: git/tools/Makefile
+===================================================================
+--- git.orig/tools/Makefile
++++ git/tools/Makefile
+@@ -262,7 +262,7 @@ $(LICENSE_H): $(obj)/bin2header $(srctre
+ subdir- += env
+
+ ifneq ($(CROSS_BUILD_TOOLS),)
+-HOSTCC = $(CC)
++override HOSTCC = $(CC)
+
+ quiet_cmd_crosstools_strip = STRIP $^
+ cmd_crosstools_strip = $(STRIP) $^; touch $@
+Index: git/tools/env/Makefile
+===================================================================
+--- git.orig/tools/env/Makefile
++++ git/tools/env/Makefile
+@@ -8,7 +8,7 @@
+ # fw_printenv is supposed to run on the target system, which means it should be
+ # built with cross tools. Although it may look weird, we only replace "HOSTCC"
+ # with "CC" here for the maximum code reuse of scripts/Makefile.host.
+-HOSTCC = $(CC)
++override HOSTCC = $(CC)
+
+ # Compile for a hosted environment on the target
+ HOST_EXTRACFLAGS = $(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \
diff --git a/meta-aspeed/recipes-bsp/u-boot/files/fw_env.config b/meta-aspeed/recipes-bsp/u-boot/files/fw_env.config
new file mode 100644
index 000000000..19ace4b88
--- /dev/null
+++ b/meta-aspeed/recipes-bsp/u-boot/files/fw_env.config
@@ -0,0 +1,25 @@
+# Configuration file for fw_(printenv/setenv) utility.
+# Up to two entries are valid, in this case the redundant
+# environment sector is assumed present.
+# Notice, that the "Number of sectors" is ignored on NOR and SPI-dataflash.
+# Furthermore, if the Flash sector size is omitted, this value is assumed to
+# be the same as the Environment size, which is valid for NOR and SPI-dataflash
+
+# NOR example
+# MTD device name Device offset Env. size Flash sector size Number of sectors
+#/dev/mtd1 0x0000 0x20000 0x20000
+#/dev/mtd2 0x0000 0x4000 0x4000
+
+# MTD SPI-dataflash example
+# MTD device name Device offset Env. size Flash sector size Number of sectors
+#/dev/mtd2 0x00000 0x20000
+/dev/mtd/u-boot-env 0x00000 0x10000
+/dev/mtd/u-boot-env 0x10000 0x10000
+#/dev/mtd5 0x4200 0x4200
+#/dev/mtd6 0x4200 0x4200
+
+# NAND example
+#/dev/mtd0 0x4000 0x4000 0x20000 2
+
+# Block device example
+#/dev/mmcblk0 0xc0000 0x20000
diff --git a/meta-aspeed/recipes-bsp/u-boot/u-boot-aspeed_2016.07.bb b/meta-aspeed/recipes-bsp/u-boot/u-boot-aspeed_2016.07.bb
new file mode 100644
index 000000000..b3a41a28a
--- /dev/null
+++ b/meta-aspeed/recipes-bsp/u-boot/u-boot-aspeed_2016.07.bb
@@ -0,0 +1,5 @@
+require u-boot-common-aspeed_${PV}.inc
+require recipes-bsp/u-boot/u-boot.inc
+
+PROVIDES += "u-boot"
+DEPENDS += "dtc-native"
diff --git a/meta-aspeed/recipes-bsp/u-boot/u-boot-common-aspeed_2016.07.inc b/meta-aspeed/recipes-bsp/u-boot/u-boot-common-aspeed_2016.07.inc
new file mode 100644
index 000000000..e92ba8760
--- /dev/null
+++ b/meta-aspeed/recipes-bsp/u-boot/u-boot-common-aspeed_2016.07.inc
@@ -0,0 +1,17 @@
+HOMEPAGE = "https://github.com/openbmc/u-boot"
+SECTION = "bootloaders"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6"
+PE = "1"
+
+# We use the revision in order to avoid having to fetch it from the
+# repo during parse
+SRCREV = "fc8646ea8a4f24ff8267fa2eee0ee33327f1f36c"
+
+UBRANCH = "v2016.07-aspeed-openbmc"
+SRC_URI = "git://git@github.com/openbmc/u-boot.git;branch=${UBRANCH};protocol=https"
+
+S = "${WORKDIR}/git"
+
+PV = "v2016.07+git${SRCPV}"
diff --git a/meta-aspeed/recipes-bsp/u-boot/u-boot-fw-utils-aspeed_2016.07.bb b/meta-aspeed/recipes-bsp/u-boot/u-boot-fw-utils-aspeed_2016.07.bb
new file mode 100644
index 000000000..713133ceb
--- /dev/null
+++ b/meta-aspeed/recipes-bsp/u-boot/u-boot-fw-utils-aspeed_2016.07.bb
@@ -0,0 +1,44 @@
+require u-boot-common-aspeed_${PV}.inc
+
+SRC_URI += "file://default-gcc.patch"
+SRC_URI += "file://fw_env.config"
+SRC_URI += "file://alt_fw_env.config"
+
+SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities"
+DEPENDS = "mtd-utils"
+
+PROVIDES += "u-boot-fw-utils"
+
+INSANE_SKIP_${PN} = "already-stripped"
+EXTRA_OEMAKE_class-target = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" V=1'
+EXTRA_OEMAKE_class-cross = 'ARCH=${TARGET_ARCH} CC="${CC} ${CFLAGS} ${LDFLAGS}" V=1'
+
+inherit uboot-config
+
+do_compile () {
+ oe_runmake ${UBOOT_MACHINE}
+ oe_runmake env
+}
+
+do_install () {
+ install -d ${D}${base_sbindir}
+ install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv
+ install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_setenv
+
+ install -d ${D}${sysconfdir}
+ install -m 644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config
+ install -m 644 ${WORKDIR}/alt_fw_env.config ${D}${sysconfdir}/alt_fw_env.config
+}
+
+do_install_class-cross () {
+ install -d ${D}${bindir_cross}
+ install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_printenv
+ install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_setenv
+}
+
+SYSROOT_DIRS_append_class-cross = " ${bindir_cross}"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+BBCLASSEXTEND = "cross"
+
+RDEPENDS_${PN} = "udev-aspeed-mtd-partitions"
OpenPOWER on IntegriCloud