Switch userspace to use MTD access by default

Currently pflash defaults to using the MMIO interface through /dev/mem.
We want to disable /dev/mem in production systems in the near future, so
all non-debugging uses of it need to be eliminated.

The new version of pflash defaults to MTD access. It also brings some
API cleanups to libflash.

We recently moved flasher to use MTD. This updates skeleton to pull in
an update to flasher so that it can build against the new libflash API.

Fixes: openbmc/openbmc#713

Change-Id: I6bde91c7df5d0588fc48dd2e847f21f0624a6950
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-bsp/skiboot/skiboot.inc b/meta-openbmc-machines/meta-openpower/common/recipes-bsp/skiboot/skiboot.inc
index 941f86c..248e13f 100644
--- a/meta-openbmc-machines/meta-openpower/common/recipes-bsp/skiboot/skiboot.inc
+++ b/meta-openbmc-machines/meta-openpower/common/recipes-bsp/skiboot/skiboot.inc
@@ -3,15 +3,13 @@
 
 SRC_URI += "git://github.com/open-power/skiboot.git;nobranch=1"
 SRC_URI += "file://0001-external-Use-more-standard-PREFIX-vs-prefix.patch"
-SRC_URI += "file://0002-external-Utilize-DESTDIR-in-shared-makefile.patch"
-SRC_URI += "file://0003-gard-Fix-Makefile-race-condition.patch"
 
 FILESEXTRAPATHS_append := "${THISDIR}/skiboot:"
 
 LIC_FILES_CHKSUM = "file://${S}/LICENCE;md5=3b83ef96387f14655fc854ddc3c6bd57"
 
-SRCREV = "skiboot-5.3.5"
-PV = "5.3.5"
+SRCREV = "skiboot-5.4.0-rc3"
+PV = "5.4.0-rc3"
 
 S = "${WORKDIR}/git"
 
diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-bsp/skiboot/skiboot/0002-external-Utilize-DESTDIR-in-shared-makefile.patch b/meta-openbmc-machines/meta-openpower/common/recipes-bsp/skiboot/skiboot/0002-external-Utilize-DESTDIR-in-shared-makefile.patch
deleted file mode 100644
index 89ee54a..0000000
--- a/meta-openbmc-machines/meta-openpower/common/recipes-bsp/skiboot/skiboot/0002-external-Utilize-DESTDIR-in-shared-makefile.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 6c5cf9f87a9047bc56ccd8b6096b8ec4a6af96ab Mon Sep 17 00:00:00 2001
-From: Patrick Williams <patrick@stwcx.xyz>
-Date: Fri, 5 Aug 2016 16:53:21 -0500
-Subject: [PATCH 2/2] external: Utilize DESTDIR in shared makefile
-
-Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
----
- external/shared/Makefile | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/external/shared/Makefile b/external/shared/Makefile
-index e0b3ff3..4baa6b4 100644
---- a/external/shared/Makefile
-+++ b/external/shared/Makefile
-@@ -39,15 +39,15 @@ all: links arch_links $(OBJS)
- 	$(CC) -shared -Wl,-soname,libflash.so -o $(SHARED_NAME) $(OBJS)
- 
- install-lib: all
--	install -D -m 0755 $(SHARED_NAME) $(LIBDIR)/$(SHARED_NAME)
--	ln -sf $(SHARED_NAME) $(LIBDIR)/libflash.so
-+	install -D -m 0755 $(SHARED_NAME) $(DESTDIR)$(LIBDIR)/$(SHARED_NAME)
-+	ln -sf $(SHARED_NAME) $(DESTDIR)$(LIBDIR)/libflash.so
- 
- install-dev: links arch_links
--	mkdir -p $(INCDIR)
--	install -m 0644 $(LIBFLASH_H) $(ARCHFLASH_H) $(INCDIR)
-+	mkdir -p $(DESTDIR)$(INCDIR)
-+	install -m 0644 $(LIBFLASH_H) $(ARCHFLASH_H) $(DESTDIR)$(INCDIR)
- 
- install: install-lib install-dev
- 
- uninstall:
--	rm -f $(LIBDIR)/libflash*
--	rm -rf $(INCDIR)
-+	rm -f $(DESTDIR)$(LIBDIR)/libflash*
-+	rm -rf $(DESTDIR)$(INCDIR)
--- 
-2.9.0
-
diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-bsp/skiboot/skiboot/0003-gard-Fix-Makefile-race-condition.patch b/meta-openbmc-machines/meta-openpower/common/recipes-bsp/skiboot/skiboot/0003-gard-Fix-Makefile-race-condition.patch
deleted file mode 100644
index 703874e..0000000
--- a/meta-openbmc-machines/meta-openpower/common/recipes-bsp/skiboot/skiboot/0003-gard-Fix-Makefile-race-condition.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 7355feb27c79c406cc57e03da29e8f7a28f38c7e Mon Sep 17 00:00:00 2001
-From: Patrick Williams <patrick@stwcx.xyz>
-Date: Fri, 16 Sep 2016 15:41:02 -0500
-Subject: [PATCH] gard: Fix Makefile race condition
-
-Commit fd599965 added some dependencies in 'external/pflash'
-for libflash files that are created via symlink.  Replicate
-that same behavior in 'external/gard' to prevent race conditions
-where we attempt to compile files from libflash before they are
-symlink'd.
-
-Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
----
- external/gard/rules.mk | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/external/gard/rules.mk b/external/gard/rules.mk
-index dfe93d5..3a7f6d9 100644
---- a/external/gard/rules.mk
-+++ b/external/gard/rules.mk
-@@ -2,7 +2,9 @@
- 
- override CFLAGS += -O2 -Wall -Werror -I.
- OBJS      = version.o gard.o
--LIBFLASH_OBJS     += libflash-file.o libflash-libflash.o libflash-libffs.o libflash-ecc.o libflash-blocklevel.o
-+LIBFLASH_FILES    := libflash.c libffs.c ecc.c blocklevel.c file.c
-+LIBFLASH_OBJS     := $(addprefix libflash-, $(LIBFLASH_FILES:.c=.o))
-+LIBFLASH_SRC      := $(addprefix libflash/,$(LIBFLASH_FILES))
- OBJS     += $(LIBFLASH_OBJS)
- OBJS     += common-arch_flash.o
- EXE       = gard
-@@ -24,6 +26,8 @@ version.c: make_version.sh .version
- %.o : %.c
- 	$(CC) $(CFLAGS) -c $< -o $@
- 
-+$(LIBFLASH_SRC): | links
-+
- $(LIBFLASH_OBJS): libflash-%.o : libflash/%.c
- 	$(CC) $(CFLAGS) -c $< -o $@
- 
--- 
-2.7.3
-
diff --git a/meta-phosphor/classes/skeleton-rev.bbclass b/meta-phosphor/classes/skeleton-rev.bbclass
index abc56b3..82b3f0a 100644
--- a/meta-phosphor/classes/skeleton-rev.bbclass
+++ b/meta-phosphor/classes/skeleton-rev.bbclass
@@ -1,2 +1,2 @@
-SRCREV ?= "29eaf4d4143056d271ee65f1c6126c533b87a49d"
+SRCREV ?= "ead1c62dca8f8237ad3a898ca0af4d48e3855ff2"
 SKELETON_URI ?= "git://github.com/openbmc/skeleton"