meta-openpower: Add pdbg tool recipe

Change-Id: I4ce995e7780a355f1c850dd0f9092f763471df75
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/pdbg/pdbg.bb b/meta-openbmc-machines/meta-openpower/common/recipes-bsp/pdbg/pdbg.bb
new file mode 100644
index 0000000..df50c74
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/common/recipes-bsp/pdbg/pdbg.bb
@@ -0,0 +1,14 @@
+SUMMARY     = "PowerPC FSI Debugger"
+DESCRIPTION = "pdbg allows JTAG-like debugging of the host POWER processors from the BMC."
+LICENSE     = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"
+
+SRC_URI += "git://github.com/open-power/pdbg.git"
+SRC_URI += "file://0001-Makefile-Allow-out-of-tree-builds.patch"
+
+SRCREV = "90a7370a11e727f1482dea6ff2bd6aec20c64805"
+PV = "git${SRCREV}"
+
+S = "${WORKDIR}/git"
+
+inherit autotools
diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-bsp/pdbg/pdbg/0001-Makefile-Allow-out-of-tree-builds.patch b/meta-openbmc-machines/meta-openpower/common/recipes-bsp/pdbg/pdbg/0001-Makefile-Allow-out-of-tree-builds.patch
new file mode 100644
index 0000000..898c225
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/common/recipes-bsp/pdbg/pdbg/0001-Makefile-Allow-out-of-tree-builds.patch
@@ -0,0 +1,32 @@
+From 40b3bfd73bccd3f62c9743404e5f1d768b30cf0f Mon Sep 17 00:00:00 2001
+From: Patrick Williams <patrick@stwcx.xyz>
+Date: Fri, 5 Aug 2016 18:50:57 -0500
+Subject: [PATCH] Makefile: Allow out-of-tree builds
+
+Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
+---
+ Makefile.am | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index ca01f21..eced4f6 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,12 +1,12 @@
+ bin_PROGRAMS = pdbg
+ lib_LIBRARIES = libpdbg.a
+ 
+-AM_CFLAGS = -Iccan/array_size
++AM_CFLAGS = -I$(top_srcdir)/ccan/array_size
+ 
+ pdbg_SOURCES = \
+ 	src/main.c
+ pdbg_LDADD = libpdbg.a
+-pdbg_CFLAGS = -Ilibpdbg
++pdbg_CFLAGS = -I$(top_srcdir)/libpdbg
+ 
+ libpdbg_a_SOURCES = \
+ 	libpdbg/adu.c \
+-- 
+2.9.0
+