Merge pull request #2642 from rarbab/devicetree
Add BR2_SKIBOOT_DEVICETREE
diff --git a/openpower/configs/openpower_mambo_defconfig b/openpower/configs/opal_defconfig
similarity index 96%
rename from openpower/configs/openpower_mambo_defconfig
rename to openpower/configs/opal_defconfig
index da413fa..a790aef 100644
--- a/openpower/configs/openpower_mambo_defconfig
+++ b/openpower/configs/opal_defconfig
@@ -45,8 +45,9 @@
# BR2_PACKAGE_HOSTBOOT_BINARIES is not set
# BR2_PACKAGE_MACHINE_XML is not set
# BR2_PACKAGE_OPENPOWER_PNOR is not set
-BR2_OPENPOWER_CONFIG_NAME="openpower-mambo"
+BR2_OPENPOWER_CONFIG_NAME="opal"
BR2_PACKAGE_PETITBOOT=y
# BR2_PACKAGE_HOST_P8_PORE_BINUTILS is not set
# BR2_PACKAGE_CAPP_UCODE is not set
+BR2_SKIBOOT_DEVICETREE=y
# BR2_PACKAGE_IMA_CATALOG is not set
diff --git a/openpower/package/skiboot/Config.in b/openpower/package/skiboot/Config.in
index 3f8c037..a59482a 100644
--- a/openpower/package/skiboot/Config.in
+++ b/openpower/package/skiboot/Config.in
@@ -42,6 +42,9 @@
string "URL of custom repository"
depends on BR2_SKIBOOT_CUSTOM_GIT
+config BR2_SKIBOOT_DEVICETREE
+ bool "Build device trees"
+
endif
endmenu
diff --git a/openpower/package/skiboot/skiboot.mk b/openpower/package/skiboot/skiboot.mk
index 74c6623..5f3e258 100644
--- a/openpower/package/skiboot/skiboot.mk
+++ b/openpower/package/skiboot/skiboot.mk
@@ -18,6 +18,10 @@
SKIBOOT_INSTALL_IMAGES = YES
SKIBOOT_INSTALL_TARGET = NO
+ifeq ($(BR2_SKIBOOT_DEVICETREE),y)
+SKIBOOT_DEPENDENCIES += host-dtc
+endif
+
SKIBOOT_MAKE_OPTS += CC="$(TARGET_CC)" LD="$(TARGET_LD)" \
AS="$(TARGET_AS)" AR="$(TARGET_AR)" NM="$(TARGET_NM)" \
OBJCOPY="$(TARGET_OBJCOPY)" OBJDUMP="$(TARGET_OBJDUMP)" \
@@ -37,10 +41,17 @@
define SKIBOOT_BUILD_CMDS
$(TARGET_CONFIGURE_OPTS) SKIBOOT_VERSION=`cat $(SKIBOOT_VERSION_FILE)` \
$(MAKE) $(SKIBOOT_MAKE_OPTS) -C $(@D) all
+
+ $(if $(BR2_SKIBOOT_DEVICETREE), \
+ $(MAKE) -C $(@D)/external/devicetree)
endef
define SKIBOOT_INSTALL_IMAGES_CMDS
$(INSTALL) -D -m 755 $(@D)/skiboot.lid $(BINARIES_DIR)
+
+ $(if $(BR2_SKIBOOT_DEVICETREE), \
+ $(INSTALL) -D -m 644 \
+ $(@D)/external/devicetree/*.dtb $(BINARIES_DIR))
endef
$(eval $(generic-package))