Introducing the Phosphor OpenBMC OE layer

 -Codifies the IBM vision for an OpenBMC build system.
 -Structured around a core DBUS API architecture.
 -Provides implementation flexibility within that architecture.
 -Provides sample qemuarm BSP layer.
diff --git a/meta-sample-bsp/conf/layer.conf b/meta-sample-bsp/conf/layer.conf
new file mode 100644
index 0000000..90a037c
--- /dev/null
+++ b/meta-sample-bsp/conf/layer.conf
@@ -0,0 +1,10 @@
+# We have a conf and classes directory, add to BBPATH
+BBPATH .= ":${LAYERDIR}"
+
+# We have a recipes-* directories, add to BBFILES
+BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
+        ${LAYERDIR}/recipes-*/*/*.bbappend"
+
+BBFILE_COLLECTIONS += "qemuphosphor"
+BBFILE_PATTERN_qemuphosphor = "^${LAYERDIR}/"
+LAYERVERSION_qemuphosphor = "1"
diff --git a/meta-sample-bsp/conf/machine/qemuphosphor.conf b/meta-sample-bsp/conf/machine/qemuphosphor.conf
new file mode 100644
index 0000000..076ac41
--- /dev/null
+++ b/meta-sample-bsp/conf/machine/qemuphosphor.conf
@@ -0,0 +1,30 @@
+#@TYPE: Machine
+#@NAME: qemuphosphor
+#@DESCRIPTION: Machine configuration for qemuphosphor systems
+
+require conf/machine/include/qemu.inc
+require conf/machine/include/tune-arm926ejs.inc
+require conf/machine/include/qemuphosphor.inc
+
+KERNEL_IMAGETYPE = "zImage"
+SERIAL_CONSOLE = "115200 ttyAMA0"
+
+MACHINE_FEATURES += "\
+        obmc-phosphor-fan-mgmt \
+        obmc-phosphor-chassis-mgmt \
+        obmc-phosphor-sensor-mgmt \
+        obmc-phosphor-flash-mgmt \
+        "
+
+VIRTUAL-RUNTIME_obmc-phosphor-fan-ctl = " \
+       obmc-phosphor-qemu \
+       "
+VIRTUAL-RUNTIME_obmc-phosphor-sensor-ctl = " \
+       obmc-phosphor-qemu \
+       "
+VIRTUAL-RUNTIME_obmc-phosphor-chassis-ctl = " \
+       obmc-phosphor-qemu \
+       "
+VIRTUAL-RUNTIME_obmc-phosphor-flash-ctl = " \
+       obmc-phosphor-qemu \
+       "
diff --git a/meta-sample-bsp/recipes-bsp/formfactor/formfactor/qemuphosphor/machconfig b/meta-sample-bsp/recipes-bsp/formfactor/formfactor/qemuphosphor/machconfig
new file mode 100644
index 0000000..54a7eab
--- /dev/null
+++ b/meta-sample-bsp/recipes-bsp/formfactor/formfactor/qemuphosphor/machconfig
@@ -0,0 +1,3 @@
+# Assume a USB mouse and keyboard are connected
+HAVE_TOUCHSCREEN=n
+HAVE_KEYBOARD=n
diff --git a/meta-sample-bsp/recipes-bsp/formfactor/formfactor_0.0.bbappend b/meta-sample-bsp/recipes-bsp/formfactor/formfactor_0.0.bbappend
new file mode 100644
index 0000000..6d4804d
--- /dev/null
+++ b/meta-sample-bsp/recipes-bsp/formfactor/formfactor_0.0.bbappend
@@ -0,0 +1,2 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
diff --git a/meta-sample-bsp/recipes-core/init-ifupdown/init-ifupdown/qemuphosphor/interfaces b/meta-sample-bsp/recipes-core/init-ifupdown/init-ifupdown/qemuphosphor/interfaces
new file mode 100644
index 0000000..d7409f7
--- /dev/null
+++ b/meta-sample-bsp/recipes-core/init-ifupdown/init-ifupdown/qemuphosphor/interfaces
@@ -0,0 +1,5 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+
+# The loopback interface
+auto lo
+iface lo inet loopback
diff --git a/meta-sample-bsp/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend b/meta-sample-bsp/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend
new file mode 100644
index 0000000..72d991c
--- /dev/null
+++ b/meta-sample-bsp/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend
@@ -0,0 +1 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
diff --git a/meta-sample-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuphosphor/xorg.conf b/meta-sample-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuphosphor/xorg.conf
new file mode 100644
index 0000000..d191868
--- /dev/null
+++ b/meta-sample-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuphosphor/xorg.conf
@@ -0,0 +1,71 @@
+
+Section "Files"
+EndSection
+
+Section "InputDevice"
+    Identifier    "Generic Keyboard"
+    Driver        "evdev"
+    Option        "CoreKeyboard"
+    Option        "Device"      "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
+    Option        "XkbRules"    "xorg"
+    Option        "XkbModel"    "evdev"
+    Option        "XkbLayout"    "us"
+EndSection
+
+Section "InputDevice"
+    Identifier    "Configured Mouse"
+    Driver        "mouse"
+
+    Option        "CorePointer"
+    Option        "Device"        "/dev/input/mice"
+    Option        "Protocol"        "ImPS/2"
+    Option        "ZAxisMapping"        "4 5"
+    Option        "Emulate3Buttons"    "true"
+EndSection
+
+Section "InputDevice"
+    Identifier    "Qemu Tablet"
+    Driver        "evdev"
+    Option        "CorePointer"
+    Option        "Device"        "/dev/input/touchscreen0"
+    Option        "USB"           "on"
+EndSection
+
+Section "Device"
+    Identifier    "Graphics Controller"
+    Driver        "fbdev"
+
+EndSection
+
+Section "Monitor"
+    Identifier    "Generic Monitor"
+    Option        "DPMS"
+    # 1024x600 59.85 Hz (CVT) hsync: 37.35 kHz; pclk: 49.00 MHz
+    Modeline "1024x600_60.00"   49.00  1024 1072 1168 1312  600 603 613 624 -hsync +vsync
+    # 640x480 @ 60Hz (Industry standard) hsync: 31.5kHz
+    ModeLine "640x480"    25.2  640  656  752  800    480  490  492  525 -hsync -vsync
+    # 640x480 @ 72Hz (VESA) hsync: 37.9kHz
+    ModeLine "640x480"    31.5  640  664  704  832    480  489  491  520 -hsync -vsync
+    # 640x480 @ 75Hz (VESA) hsync: 37.5kHz
+    ModeLine "640x480"    31.5  640  656  720  840    480  481  484  500 -hsync -vsync
+    # 640x480 @ 85Hz (VESA) hsync: 43.3kHz
+    ModeLine "640x480"    36.0  640  696  752  832    480  481  484  509 -hsync -vsync
+EndSection
+
+Section "Screen"
+    Identifier    "Default Screen"
+    Device        "Graphics Controller"
+    Monitor        "Generic Monitor"
+    SubSection "Display"
+        Modes     "640x480"
+    EndSubSection
+EndSection
+
+Section "ServerLayout"
+    Identifier    "Default Layout"
+    Screen        "Default Screen"
+    InputDevice    "Generic Keyboard"
+    # InputDevice    "Configured Mouse"
+    InputDevice    "QEMU Tablet"
+    Option         "AllowEmptyInput" "no"
+EndSection
diff --git a/meta-sample-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend b/meta-sample-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend
new file mode 100644
index 0000000..72d991c
--- /dev/null
+++ b/meta-sample-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend
@@ -0,0 +1 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
diff --git a/meta-sample-bsp/recipes-kernel/linux/files/qemuphosphor-preempt-rt.scc b/meta-sample-bsp/recipes-kernel/linux/files/qemuphosphor-preempt-rt.scc
new file mode 100644
index 0000000..b9260c7
--- /dev/null
+++ b/meta-sample-bsp/recipes-kernel/linux/files/qemuphosphor-preempt-rt.scc
@@ -0,0 +1,7 @@
+define KMACHINE qemuphosphor
+define KTYPE preempt-rt
+define KARCH arm
+
+include ktypes/preempt-rt/preempt-rt.scc
+
+include qemuphosphor.scc
diff --git a/meta-sample-bsp/recipes-kernel/linux/files/qemuphosphor-standard.scc b/meta-sample-bsp/recipes-kernel/linux/files/qemuphosphor-standard.scc
new file mode 100644
index 0000000..75cd200
--- /dev/null
+++ b/meta-sample-bsp/recipes-kernel/linux/files/qemuphosphor-standard.scc
@@ -0,0 +1,7 @@
+define KMACHINE qemuphosphor
+define KTYPE standard
+define KARCH arm
+
+include bsp/arm-versatile-926ejs/arm-versatile-926ejs-standard
+
+include qemuphosphor.scc
diff --git a/meta-sample-bsp/recipes-kernel/linux/files/qemuphosphor-tiny.scc b/meta-sample-bsp/recipes-kernel/linux/files/qemuphosphor-tiny.scc
new file mode 100644
index 0000000..f479d81
--- /dev/null
+++ b/meta-sample-bsp/recipes-kernel/linux/files/qemuphosphor-tiny.scc
@@ -0,0 +1,7 @@
+define KMACHINE qemuphosphor
+define KTYPE tiny
+define KARCH arm
+
+include ktypes/tiny/tiny.scc
+
+include qemuphosphor.scc
diff --git a/meta-sample-bsp/recipes-kernel/linux/files/qemuphosphor-user-config.cfg b/meta-sample-bsp/recipes-kernel/linux/files/qemuphosphor-user-config.cfg
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/meta-sample-bsp/recipes-kernel/linux/files/qemuphosphor-user-config.cfg
diff --git a/meta-sample-bsp/recipes-kernel/linux/files/qemuphosphor-user-features.scc b/meta-sample-bsp/recipes-kernel/linux/files/qemuphosphor-user-features.scc
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/meta-sample-bsp/recipes-kernel/linux/files/qemuphosphor-user-features.scc
diff --git a/meta-sample-bsp/recipes-kernel/linux/files/qemuphosphor-user-patches.scc b/meta-sample-bsp/recipes-kernel/linux/files/qemuphosphor-user-patches.scc
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/meta-sample-bsp/recipes-kernel/linux/files/qemuphosphor-user-patches.scc
diff --git a/meta-sample-bsp/recipes-kernel/linux/files/qemuphosphor.cfg b/meta-sample-bsp/recipes-kernel/linux/files/qemuphosphor.cfg
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/meta-sample-bsp/recipes-kernel/linux/files/qemuphosphor.cfg
diff --git a/meta-sample-bsp/recipes-kernel/linux/files/qemuphosphor.scc b/meta-sample-bsp/recipes-kernel/linux/files/qemuphosphor.scc
new file mode 100644
index 0000000..52144aa
--- /dev/null
+++ b/meta-sample-bsp/recipes-kernel/linux/files/qemuphosphor.scc
@@ -0,0 +1,4 @@
+kconf hardware qemuphosphor.cfg
+
+kconf hardware qemuphosphor-user-config.cfg
+include qemuphosphor-user-patches.scc
diff --git a/meta-sample-bsp/recipes-kernel/linux/linux-yocto_%.bbappend b/meta-sample-bsp/recipes-kernel/linux/linux-yocto_%.bbappend
new file mode 100644
index 0000000..ce876ad
--- /dev/null
+++ b/meta-sample-bsp/recipes-kernel/linux/linux-yocto_%.bbappend
@@ -0,0 +1,12 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+PR := "${PR}.1"
+
+COMPATIBLE_MACHINE_qemuphosphor = "qemuphosphor"
+
+KBRANCH_qemuphosphor  = "standard/arm-versatile-926ejs"
+
+KERNEL_FEATURES_append_qemuphosphor += " cfg/smp.scc"
+
+SRC_URI += "file://qemuphosphor-standard.scc \
+           "