openpower: Allow building MTD support in Petitboot
Create the BR2_PACKAGE_PETITBOOT_MTD option to enable MTD support when
building Petitboot. This depends on the openpower 'libflash' package.
Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
diff --git a/openpower/package/petitboot/Config.in b/openpower/package/petitboot/Config.in
index a6021dd..b85618d 100644
--- a/openpower/package/petitboot/Config.in
+++ b/openpower/package/petitboot/Config.in
@@ -19,3 +19,12 @@
comment "petitboot requires udev to be enabled"
depends on !BR2_PACKAGE_HAS_UDEV
+
+config BR2_PACKAGE_PETITBOOT_MTD
+ bool "petitboot-mtd"
+ depends on BR2_PACKAGE_PETITBOOT
+ select BR2_PACKAGE_LIBFLASH
+ help
+ Adds Petitboot support for MTD devices
+
+comment "Add support for accessing MTD devices"
diff --git a/openpower/package/petitboot/petitboot.mk b/openpower/package/petitboot/petitboot.mk
index d26f564..2262986 100644
--- a/openpower/package/petitboot/petitboot.mk
+++ b/openpower/package/petitboot/petitboot.mk
@@ -23,6 +23,13 @@
PETITBOOT_CONF_OPTS += --enable-debug
endif
+ifeq ($(BR2_PACKAGE_PETITBOOT_MTD),y)
+PETITBOOT_CONF_OPTS += --enable-mtd
+PETITBOOT_DEPENDENCIES += libflash
+PETITBOOT_CPPFLAGS += -I$(STAGING_DIR)
+PETITBOOT_LDFLAGS += -L$(STAGING_DIR)
+endif
+
ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y)
PETITBOOT_CONF_OPTS += --with-ncursesw MENU_LIB=-lmenuw FORM_LIB=-lformw
endif