summaryrefslogtreecommitdiffstats
path: root/meta-facebook/meta-wedge100
diff options
context:
space:
mode:
Diffstat (limited to 'meta-facebook/meta-wedge100')
-rw-r--r--meta-facebook/meta-wedge100/conf/bblayers.conf.sample23
-rw-r--r--meta-facebook/meta-wedge100/conf/conf-notes.txt2
-rw-r--r--meta-facebook/meta-wedge100/conf/layer.conf10
-rw-r--r--meta-facebook/meta-wedge100/conf/local.conf.sample145
-rw-r--r--meta-facebook/meta-wedge100/conf/machine/wedge100.conf18
-rwxr-xr-xmeta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl/get_fan_speed.sh59
-rwxr-xr-xmeta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl/set_fan_speed.sh46
-rw-r--r--meta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl/setup-fan.sh33
-rw-r--r--meta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl_0.1.bbappend46
-rw-r--r--meta-facebook/meta-wedge100/recipes-core/images/wedge100-image.bb82
-rw-r--r--meta-facebook/meta-wedge100/recipes-core/sysvinit/sysvinit-inittab_%.bbappend5
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/files/COPYING340
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/files/Makefile31
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/files/com_e_driver.c365
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/kernel-module-com-e-driver_0.1.bb40
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/COPYING340
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/Makefile31
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/fancpld.c396
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/syscpld.c281
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/kernel-module-cpld_0.1.bb42
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/COPYING340
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/Makefile31
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/i2c_dev_sysfs.c349
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/i2c_dev_sysfs.h84
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/kernel-module-i2c-dev-sysfs_0.1.bb42
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/linux/files/defconfig1462
-rw-r--r--meta-facebook/meta-wedge100/recipes-kernel/linux/linux-aspeed_2.6%.bbappend8
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/lm_sensors/files/wedge100.conf78
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/lm_sensors/lmsensors_%.bbappend10
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/oob-nic/oob-nic_%.bbappend5
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/board_gpio_rev_table.py33
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/board_gpio_table_v1.py107
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/board_gpio_table_v2.py118
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/data/wedge100-BMC-GPIO-DVT.csv104
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/data/wedge100-BMC-GPIO-EVT.csv83
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/openbmc_gpio_setup.py75
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/setup_board.py22
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/wedge100_gpio_parse.py102
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/openbmc-gpio_%.bbappend36
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/COPYING340
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/board-utils.sh81
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/disable_watchdog.sh6
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/power-on.sh51
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/wedge_power.sh187
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/wedge_us_mac.sh38
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/openbmc-utils_%.bbappend64
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/wedge-eeprom/libwedge-eeprom_0.1.bbappend18
47 files changed, 6209 insertions, 0 deletions
diff --git a/meta-facebook/meta-wedge100/conf/bblayers.conf.sample b/meta-facebook/meta-wedge100/conf/bblayers.conf.sample
new file mode 100644
index 0000000..5b69b43
--- /dev/null
+++ b/meta-facebook/meta-wedge100/conf/bblayers.conf.sample
@@ -0,0 +1,23 @@
+# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
+# changes incompatibly
+LCONF_VERSION = "6"
+
+BBPATH = "${TOPDIR}"
+BBFILES ?= ""
+
+BBLAYERS ?= " \
+ ##OEROOT##/meta \
+ ##OEROOT##/meta-yocto \
+ ##OEROOT##/meta-yocto-bsp \
+ ##OEROOT##/meta-openembedded/meta-oe \
+ ##OEROOT##/meta-openembedded/meta-networking \
+ ##OEROOT##/meta-openembedded/meta-python \
+ ##OEROOT##/meta-openbmc \
+ ##OEROOT##/meta-openbmc/meta-aspeed \
+ ##OEROOT##/meta-openbmc/meta-facebook/meta-wedge \
+ ##OEROOT##/meta-openbmc/meta-facebook/meta-wedge100 \
+ "
+BBLAYERS_NON_REMOVABLE ?= " \
+ ##OEROOT##/meta \
+ ##OEROOT##/meta-yocto \
+ "
diff --git a/meta-facebook/meta-wedge100/conf/conf-notes.txt b/meta-facebook/meta-wedge100/conf/conf-notes.txt
new file mode 100644
index 0000000..becc2df
--- /dev/null
+++ b/meta-facebook/meta-wedge100/conf/conf-notes.txt
@@ -0,0 +1,2 @@
+Common targets are:
+ wedge100-image
diff --git a/meta-facebook/meta-wedge100/conf/layer.conf b/meta-facebook/meta-wedge100/conf/layer.conf
new file mode 100644
index 0000000..63e14cb
--- /dev/null
+++ b/meta-facebook/meta-wedge100/conf/layer.conf
@@ -0,0 +1,10 @@
+# We have a conf and classes directory, add to BBPATH
+BBPATH .= ":${LAYERDIR}"
+
+# We have recipes-* directories, add to BBFILES
+BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
+ ${LAYERDIR}/recipes-*/*/*.bbappend"
+
+BBFILE_COLLECTIONS += "wedge100"
+BBFILE_PATTERN_wedge100 = "^${LAYERDIR}/"
+BBFILE_PRIORITY_wedge100 = "10"
diff --git a/meta-facebook/meta-wedge100/conf/local.conf.sample b/meta-facebook/meta-wedge100/conf/local.conf.sample
new file mode 100644
index 0000000..c322b71
--- /dev/null
+++ b/meta-facebook/meta-wedge100/conf/local.conf.sample
@@ -0,0 +1,145 @@
+#
+# Local configuration file for building the OpenBMC image.
+#
+
+# Always look for packages first in our own local package mirror
+SOURCE_MIRROR_URL ?= "file://${TOPDIR}/../meta-openbmc/source_mirror/"
+INHERIT += "own-mirrors"
+
+# Save local tarballs for all packages we download.
+# This can be used to update our mirror directory above.
+BB_GENERATE_MIRROR_TARBALLS = "1"
+
+# The following setting will prevent bitbake from downloading anything over the
+# network. This can be used to ensure that we get everything from a local
+# file:// mirror.
+#
+# Comment this out if you do need to download new packages from the internet.
+# However, once you have downloaded the package you should check them into our
+# mirror repository so that other developers will always get it from the mirror
+# repo.
+BB_NO_NETWORK = "fb-only"
+
+# Parallelism Options
+#
+# How many tasks bitbake should run in parallel:
+BB_NUMBER_THREADS ?= "${@oe.utils.cpu_count()}"
+# How many processes make should run in parallel:
+PARALLEL_MAKE ?= "-j ${@oe.utils.cpu_count()}"
+
+# Machine Selection
+MACHINE ??= "wedge100"
+
+# Build directory locationds.
+#
+#DL_DIR ?= "${TOPDIR}/downloads"
+#SSTATE_DIR ?= "${TOPDIR}/sstate-cache"
+#TMPDIR = "${TOPDIR}/tmp"
+
+#
+# Default policy config
+# We could eventually create our own distro config if desired,
+# but for now we use the standard poky distro settings.
+#
+DISTRO ?= "poky"
+
+# Use RPM packages
+PACKAGE_CLASSES ?= "package_rpm"
+
+# Extra image features.
+# Currently we do not enable anything extra here.
+#EXTRA_IMAGE_FEATURES = ""
+
+# We build on CentOS 6.3.
+# Don't complain about it, even though it isn't in poky's default
+# list of supported distros.
+SANITY_TESTED_DISTROS_append ?= " CentOS-6.3 \n "
+
+#
+# Additional image features
+#
+# The following is a list of additional classes to use when building images which
+# enable extra features. Some available options which can be included in this variable
+# are:
+# - 'buildstats' collect build statistics
+# - 'image-mklibs' to reduce shared library files size for an image
+# - 'image-prelink' in order to prelink the filesystem image
+# - 'image-swab' to perform host system intrusion detection
+# NOTE: if listing mklibs & prelink both, then make sure mklibs is before prelink
+# NOTE: mklibs also needs to be explicitly enabled for a given image, see local.conf.extended
+USER_CLASSES ?= "buildstats image-mklibs image-prelink"
+
+#
+# Interactive shell configuration
+#
+# Under certain circumstances the system may need input from you and to do this it
+# can launch an interactive shell. It needs to do this since the build is
+# multithreaded and needs to be able to handle the case where more than one parallel
+# process may require the user's attention. The default is iterate over the available
+# terminal types to find one that works.
+#
+# Examples of the occasions this may happen are when resolving patches which cannot
+# be applied, to use the devshell or the kernel menuconfig
+#
+# Supported values are auto, gnome, xfce, rxvt, screen, konsole (KDE 3.x only), none
+# Note: currently, Konsole support only works for KDE 3.x due to the way
+# newer Konsole versions behave
+#OE_TERMINAL = "auto"
+# By default disable interactive patch resolution (tasks will just fail instead):
+PATCHRESOLVE = "noop"
+
+#
+# Disk Space Monitoring during the build
+#
+# Monitor the disk space during the build. If there is less that 1GB of space or less
+# than 100K inodes in any key build location (TMPDIR, DL_DIR, SSTATE_DIR), gracefully
+# shutdown the build. If there is less that 100MB or 1K inodes, perform a hard abort
+# of the build. The reason for this is that running completely out of space can corrupt
+# files and damages the build in ways which may not be easily recoverable.
+BB_DISKMON_DIRS = "\
+ STOPTASKS,${TMPDIR},1G,100K \
+ STOPTASKS,${DL_DIR},1G,100K \
+ STOPTASKS,${SSTATE_DIR},1G,100K \
+ ABORT,${TMPDIR},100M,1K \
+ ABORT,${DL_DIR},100M,1K \
+ ABORT,${SSTATE_DIR},100M,1K"
+
+#
+# Shared-state files from other locations
+#
+# As mentioned above, shared state files are prebuilt cache data objects which can
+# used to accelerate build time. This variable can be used to configure the system
+# to search other mirror locations for these objects before it builds the data itself.
+#
+# This can be a filesystem directory, or a remote url such as http or ftp. These
+# would contain the sstate-cache results from previous builds (possibly from other
+# machines). This variable works like fetcher MIRRORS/PREMIRRORS and points to the
+# cache locations to check for the shared objects.
+# NOTE: if the mirror uses the same structure as SSTATE_DIR, you need to add PATH
+# at the end as shown in the examples below. This will be substituted with the
+# correct path within the directory structure.
+#SSTATE_MIRRORS ?= "\
+#file://.* http://someserver.tld/share/sstate/PATH;downloadfilename=PATH \n \
+#file://.* file:///some/local/dir/sstate/PATH"
+
+
+# CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to
+# track the version of this file when it was generated. This can safely be ignored if
+# this doesn't mean anything to you.
+CONF_VERSION = "1"
+
+
+# Update root password to '0penBmc' and change the root shell back to bash.
+# This default root password is used at the ODM and system integrator. It will be
+# changed during provisioning at the datacenter.
+INHERIT += "extrausers"
+
+EXTRA_USERS_PARAMS = " \
+ usermod -s /bin/bash root; \
+ usermod -p '\$1\$UGMqyqdG\$FZiylVFmRRfl9Z0Ue8G7e/' root; \
+ "
+
+OLDEST_KERNEL = "2.6.28"
+
+INHERIT += "blacklist"
+PNBLACKLIST[glibc] = "glibc 2.21 does not work with our kernel 2.6.28"
diff --git a/meta-facebook/meta-wedge100/conf/machine/wedge100.conf b/meta-facebook/meta-wedge100/conf/machine/wedge100.conf
new file mode 100644
index 0000000..2416809
--- /dev/null
+++ b/meta-facebook/meta-wedge100/conf/machine/wedge100.conf
@@ -0,0 +1,18 @@
+#@TYPE: Machine
+#@NAME: Wedge100
+#@DESCRIPTION: Machine configuration for Facebook Wedge100
+
+UBOOT_MACHINE_wedge100 = "wedge100_config"
+
+require conf/machine/include/ast1250.inc
+
+# configuration for preferred version of packages
+PREFERRED_VERSION_libipmi = "0.1"
+PREFERRED_VERSION_ipmid = "0.1"
+PREFERRED_VERSION_rest-api = "0.1"
+
+MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-module-i2c-dev-sysfs"
+MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-module-cpld"
+MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-module-com-e-driver"
+
+TCLIBC = 'eglibc'
diff --git a/meta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl/get_fan_speed.sh b/meta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl/get_fan_speed.sh
new file mode 100755
index 0000000..042a72f
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl/get_fan_speed.sh
@@ -0,0 +1,59 @@
+#!/bin/sh
+#
+# Copyright 2015-present Facebook. All Rights Reserved.
+#
+# This program file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program in a file named COPYING; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+usage() {
+ echo "Usage: $0 [Fan Unit (1..5)]" >&2
+}
+
+FAN_DIR=/sys/class/i2c-adapter/i2c-8/8-0033
+
+show_pwm()
+{
+ pwm="${FAN_DIR}/fantray${1}_pwm"
+ val=$(cat $pwm | head -n 1)
+ echo "$((val * 100 / 31))%"
+}
+
+show_rpm()
+{
+ front_rpm="${FAN_DIR}/fan$((($1 * 2 - 1)))_input"
+ rear_rpm="${FAN_DIR}/fan$((($1 * 2)))_input"
+ echo "$(cat $front_rpm), $(cat $rear_rpm)"
+}
+
+set -e
+
+# refer to the comments in init_pwn.sh regarding
+# the fan unit and tacho mapping
+if [ "$#" -eq 0 ]; then
+ FANS="1 2 3 4 5"
+elif [ "$#" -eq 1 ]; then
+ if [ $1 -gt 5 ]; then
+ usage
+ exit 1
+ fi
+ FANS="$1"
+else
+ usage
+ exit 1
+fi
+
+for fan in $FANS; do
+ echo "Fan $fan RPMs: $(show_rpm $fan), ($(show_pwm $fan))"
+done
diff --git a/meta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl/set_fan_speed.sh b/meta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl/set_fan_speed.sh
new file mode 100755
index 0000000..ff5a584
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl/set_fan_speed.sh
@@ -0,0 +1,46 @@
+#!/bin/sh
+#
+# Copyright 2015-present Facebook. All Rights Reserved.
+#
+# This program file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program in a file named COPYING; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+usage() {
+ echo "Usage: $0 <PERCENT (0..100)> <Fan Unit (1..5)> " >&2
+}
+
+FAN_DIR=/sys/class/i2c-adapter/i2c-8/8-0033
+
+set -e
+
+if [ "$#" -ne 2 ] && [ "$#" -ne 1 ]; then
+ usage
+ exit 1
+fi
+
+if [ "$#" -eq 1 ]; then
+ FANS="1 2 3 4 5"
+else
+ FANS="$2"
+fi
+
+# Convert the percentage to our 1/32th unit (0-31).
+unit=$(( ( $1 * 31 ) / 100 ))
+
+for fan in $FANS; do
+ pwm="${FAN_DIR}/fantray${fan}_pwm"
+ echo "$unit" > $pwm
+ echo "Successfully set fan ${fan} speed to $1%"
+done
diff --git a/meta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl/setup-fan.sh b/meta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl/setup-fan.sh
new file mode 100644
index 0000000..26691dc
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl/setup-fan.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+#
+# Copyright 2014-present Facebook. All Rights Reserved.
+#
+# This program file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program in a file named COPYING; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+
+### BEGIN INIT INFO
+# Provides: setup-fan
+# Required-Start: board-id
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+# Short-Description: Set fan speed
+### END INIT INFO
+
+echo -n "Setup fan speed... "
+/usr/local/bin/set_fan_speed.sh 50
+/usr/local/bin/fand
+echo "done."
diff --git a/meta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl_0.1.bbappend b/meta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl_0.1.bbappend
new file mode 100644
index 0000000..ff5f2d5
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-core/fan-ctrl/fan-ctrl_0.1.bbappend
@@ -0,0 +1,46 @@
+# Copyright 2015-present Facebook. All Rights Reserved.
+#
+# This program file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program in a file named COPYING; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301 USA
+
+DEPENDS_append = " update-rc.d-native"
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+SRC_URI += "file://get_fan_speed.sh \
+ file://set_fan_speed.sh \
+ file://setup-fan.sh \
+ "
+
+S = "${WORKDIR}"
+
+binfiles = " \
+ get_fan_speed.sh \
+ set_fan_speed.sh \
+ fand \
+ "
+
+CXXFLAGS_prepend = "-DCONFIG_WEDGE100 "
+
+do_install() {
+ bin="${D}/usr/local/bin"
+ install -d $bin
+ for f in ${binfiles}; do
+ install -m 755 $f ${bin}/$f
+ done
+ install -d ${D}${sysconfdir}/init.d
+ install -d ${D}${sysconfdir}/rcS.d
+ install -m 755 setup-fan.sh ${D}${sysconfdir}/init.d/setup-fan.sh
+ update-rc.d -r ${D} setup-fan.sh start 91 S .
+}
diff --git a/meta-facebook/meta-wedge100/recipes-core/images/wedge100-image.bb b/meta-facebook/meta-wedge100/recipes-core/images/wedge100-image.bb
new file mode 100644
index 0000000..291ebf0
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-core/images/wedge100-image.bb
@@ -0,0 +1,82 @@
+inherit aspeed_uboot_image
+
+# /dev
+require recipes-core/images/aspeed-dev.inc
+
+# Base this image on core-image-minimal
+include recipes-core/images/core-image-minimal.bb
+
+# Changing the image compression from gz to lzma achieves 30% saving (~3M).
+# However, the current u-boot does not have lzma enabled. Stick to gz
+# until we generate a new u-boot image.
+IMAGE_FSTYPES += "cpio.lzma.u-boot"
+UBOOT_IMAGE_ENTRYPOINT = "0x40800000"
+
+PYTHON_PKGS = " \
+ python-core \
+ python-io \
+ python-json \
+ python-shell \
+ python-subprocess \
+ python-argparse \
+ python-ctypes \
+ python-datetime \
+ python-email \
+ python-threading \
+ python-mime \
+ python-pickle \
+ python-misc \
+ python-netserver \
+ "
+
+NTP_PKGS = " \
+ ntp \
+ ntp-utils \
+ sntp \
+ ntpdate \
+ "
+
+# Include modules in rootfs
+IMAGE_INSTALL += " \
+ kernel-modules \
+ u-boot \
+ u-boot-fw-utils \
+ openbmc-utils \
+ openbmc-gpio \
+ fan-ctrl \
+ rackmon \
+ watchdog-ctrl \
+ i2c-tools \
+ sensor-setup \
+ usb-console \
+ oob-nic \
+ lldp-util \
+ lmsensors-sensors \
+ wedge-eeprom \
+ sms-kcsd \
+ rest-api \
+ bottle \
+ ipmid \
+ po-eeprom \
+ bitbang \
+ ${PYTHON_PKGS} \
+ ${NTP_PKGS} \
+ iproute2 \
+ dhcp-client \
+ jbi \
+ flashrom \
+ cherryPy \
+ "
+
+IMAGE_FEATURES += " \
+ ssh-server-openssh \
+ tools-debug \
+ "
+
+DISTRO_FEATURES += " \
+ ext2 \
+ ipv6 \
+ nfs \
+ usbgadget \
+ usbhost \
+ "
diff --git a/meta-facebook/meta-wedge100/recipes-core/sysvinit/sysvinit-inittab_%.bbappend b/meta-facebook/meta-wedge100/recipes-core/sysvinit/sysvinit-inittab_%.bbappend
new file mode 100644
index 0000000..6d4deb3
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-core/sysvinit/sysvinit-inittab_%.bbappend
@@ -0,0 +1,5 @@
+# ttyS0 is UART5, connected through SYSCPLD, to debug board, if GPIOE0 is 1
+# ttyS1 is UART1, connected through SYSCPLD, to micro-server console, if GPIOE0 is 1
+# ttyS2 is UART3, connected to the front panel Console port
+# ttyS3 is UART4, connected through SYSCPLD, to rackmon RS485
+SERIAL_CONSOLES = "57600;ttyS0 9600;ttyS2"
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/files/COPYING b/meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/files/COPYING
new file mode 100644
index 0000000..6d45519
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/files/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/files/Makefile b/meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/files/Makefile
new file mode 100644
index 0000000..d3b524e
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/files/Makefile
@@ -0,0 +1,31 @@
+# Copyright 2015-present Facebook. All Rights Reserved.
+#
+# This program file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program in a file named COPYING; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301 USA
+
+obj-m := com_e_driver.o
+
+SRC := $(shell pwd)
+
+all:
+ $(MAKE) -C $(KERNEL_SRC) M=$(SRC)
+
+modules_install:
+ $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install
+
+clean:
+ rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c
+ rm -f Module.markers Module.symvers modules.order
+ rm -rf .tmp_versions Modules.symvers
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/files/com_e_driver.c b/meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/files/com_e_driver.c
new file mode 100644
index 0000000..0a3df37
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/files/com_e_driver.c
@@ -0,0 +1,365 @@
+/*
+ * com_e_driver.c - The i2c driver for COMe
+ *
+ * Copyright 2015-present Facebook. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/errno.h>
+#include <linux/module.h>
+#include <linux/i2c.h>
+#include <linux/i2c_dev_sysfs.h>
+
+#ifdef DEBUG
+
+#define PP_DEBUG(fmt, ...) do { \
+ printk(KERN_DEBUG "%s:%d " fmt "\n", \
+ __FUNCTION__, __LINE__, ##__VA_ARGS__); \
+} while (0)
+
+#else /* !DEBUG */
+
+#define PP_DEBUG(fmt, ...)
+
+#endif
+
+static ssize_t i2c_dev_show_mac(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ uint8_t values[6];
+ int ret_val;
+
+ ret_val = i2c_dev_read_nbytes(dev, attr, values, 6);
+ if (ret_val < 0) {
+ return ret_val;
+ }
+ //values[] : mac address
+ return scnprintf(buf, PAGE_SIZE, "%02x:%02x:%02x:%02x:%02x:%02x\n", values[0],
+ values[1], values[2], values[3], values[4], values[5]);
+}
+
+static ssize_t i2c_dev_show_date(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ uint8_t values[3];
+ int ret_val;
+
+ ret_val = i2c_dev_read_nbytes(dev, attr, values, 3);
+ if (ret_val < 0) {
+ return ret_val;
+ }
+ //values[0] : year
+ //values[1] : month
+ //values[2] : day
+ return scnprintf(buf, PAGE_SIZE, "%x/%x/%x\n", values[1],
+ values[2], values[0]);
+}
+
+static ssize_t i2c_dev_show_version(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ uint8_t values[3];
+ int ret_val;
+
+ ret_val = i2c_dev_read_nbytes(dev, attr, values, 3);
+ if (ret_val < 0) {
+ return ret_val;
+ }
+ //values[0] : Version_R
+ //values[1] : Version_E
+ //values[2] : Version_T
+ return scnprintf(buf, PAGE_SIZE, "EC Version R=0x%02x E=0x%02x T=0x%2x\n",
+ values[0], values[1], values[2]);
+
+}
+
+static ssize_t i2c_dev_show_cpu_temp(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ int ret_val;
+
+ ret_val = i2c_dev_read_byte(dev, attr);
+ if (ret_val < 0) {
+ return ret_val;
+ }
+ return scnprintf(buf, PAGE_SIZE, "%u\n", ret_val);
+}
+
+static ssize_t i2c_dev_show_voltage0(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ int result;
+
+ result = i2c_dev_read_word_littleendian(dev, attr);
+ if (result < 0) {
+ return result;
+ }
+ result = (result * 1000) / 341;
+ return scnprintf(buf, PAGE_SIZE, "%u\n", result);
+}
+
+static ssize_t i2c_dev_show_voltage1(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ int result;
+
+ result = i2c_dev_read_word_littleendian(dev, attr);
+ if (result < 0) {
+ return result;
+ }
+ result = (result * 2000) / 341;
+ return scnprintf(buf, PAGE_SIZE, "%u\n", result);
+}
+
+static ssize_t i2c_dev_show_voltage2(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ int result;
+
+ result = i2c_dev_read_word_littleendian(dev, attr);
+ if (result < 0) {
+ return result;
+ }
+ result = (result * 3200) / 341;
+ return scnprintf(buf, PAGE_SIZE, "%u\n", result);
+}
+
+static ssize_t i2c_dev_show_voltage3(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ int result;
+
+ result = i2c_dev_read_word_littleendian(dev, attr);
+ if (result < 0) {
+ return result;
+ }
+ result = (result * 6600) / 341;
+ return scnprintf(buf, PAGE_SIZE, "%u\n", result);
+}
+
+static const i2c_dev_attr_st com_e_attr_table[] = {
+ {
+ "temp1_input", // cpu_temp
+ NULL,
+ i2c_dev_show_cpu_temp,
+ NULL,
+ 0x0, 0, 8,
+ },
+ {
+ "version", // version_r,_e,_t
+ NULL,
+ i2c_dev_show_version,
+ NULL,
+ 0x1D, 0, 24,
+ },
+ {
+ "in0_input", // CPU_vcore
+ NULL,
+ i2c_dev_show_voltage0,
+ NULL,
+ 0x20, 0, 16,
+ },
+ {
+ "in1_input",// 3V
+ NULL,
+ i2c_dev_show_voltage1,
+ NULL,
+ 0x22, 0, 16,
+ },
+ {
+ "in2_input",// 5V
+ NULL,
+ i2c_dev_show_voltage2,
+ NULL,
+ 0x24, 0, 16,
+ },
+ {
+ "date",
+ NULL,
+ i2c_dev_show_date,
+ NULL,
+ 0x2D, 0, 24,
+ },
+ {
+ "in3_input",// 12V
+ NULL,
+ i2c_dev_show_voltage3,
+ NULL,
+ 0x30, 0, 16,
+ },
+ {
+ "in4_input",// VDIMM
+ NULL,
+ i2c_dev_show_voltage0,
+ NULL,
+ 0x32, 0, 16,
+ },
+ {
+ "product_name",
+ NULL,
+ i2c_dev_show_ascii,
+ NULL,
+ 0x3C, 0, 32,
+ },
+ {
+ "customize_name",
+ NULL,
+ i2c_dev_show_ascii,
+ NULL,
+ 0x4D, 0, 24,
+ },
+ {
+ "mac",
+ NULL,
+ i2c_dev_show_mac,
+ NULL,
+ 0x50, 0, 48,
+ },
+ {
+ "serial_number",
+ NULL,
+ i2c_dev_show_ascii,
+ NULL,
+ 0x60, 0, 256,
+ },
+ {
+ "in0_label",
+ "CPU Vcore",
+ i2c_dev_show_label,
+ NULL,
+ 0x0, 0, 0,
+ },
+ {
+ "in1_label",
+ "+3V Voltage",
+ i2c_dev_show_label,
+ NULL,
+ 0x0, 0, 0,
+ },
+ {
+ "in2_label",
+ "+5V Voltage",
+ i2c_dev_show_label,
+ NULL,
+ 0x0, 0, 0,
+ },
+ {
+ "in3_label",
+ "+12V Voltage",
+ i2c_dev_show_label,
+ NULL,
+ 0x0, 0, 0,
+ },
+ {
+ "in4_label",
+ "VDIMM Voltage",
+ i2c_dev_show_label,
+ NULL,
+ 0x0, 0, 0,
+ },
+ {
+ "temp1_label",
+ "CPU Temp",
+ i2c_dev_show_label,
+ NULL,
+ 0x0, 0, 0,
+ },
+};
+
+static i2c_dev_data_st com_e_data;
+
+/*
+ * COMe i2c addresses.
+ * normal_i2c is used in I2C_CLIENT_INSMOD_1()
+ */
+static const unsigned short normal_i2c[] = {
+ 0x33, I2C_CLIENT_END
+};
+
+/*
+ * Insmod parameters
+ */
+I2C_CLIENT_INSMOD_1(com_e);
+
+/* COMe id */
+static const struct i2c_device_id com_e_id[] = {
+ { "com_e_driver", com_e_id },
+ { },
+};
+MODULE_DEVICE_TABLE(i2c, com_e_id);
+
+/* Return 0 if detection is successful, -ENODEV otherwise */
+static int com_e_detect(struct i2c_client *client, int kind,
+ struct i2c_board_info *info)
+{
+ /*
+ * We don't currently do any detection of the COMe
+ */
+ strlcpy(info->type, "com_e_driver", I2C_NAME_SIZE);
+ return 0;
+}
+
+static int com_e_probe(struct i2c_client *client,
+ const struct i2c_device_id *id)
+{
+ int n_attrs = sizeof(com_e_attr_table) / sizeof(com_e_attr_table[0]);
+ return i2c_dev_sysfs_data_init(client, &com_e_data,
+ com_e_attr_table, n_attrs);
+}
+
+static int com_e_remove(struct i2c_client *client)
+{
+ i2c_dev_sysfs_data_clean(client, &com_e_data);
+ return 0;
+}
+
+static struct i2c_driver com_e_driver = {
+ .class = I2C_CLASS_HWMON,
+ .driver = {
+ .name = "com_e_driver",
+ },
+ .probe = com_e_probe,
+ .remove = com_e_remove,
+ .id_table = com_e_id,
+ .detect = com_e_detect,
+ /* addr_data is defined through I2C_CLIENT_INSMOD_1() */
+ .address_data = &addr_data,
+};
+
+static int __init com_e_mod_init(void)
+{
+ return i2c_add_driver(&com_e_driver);
+}
+
+static void __exit com_e_mod_exit(void)
+{
+ i2c_del_driver(&com_e_driver);
+}
+
+MODULE_AUTHOR("Vineela Kukkadapu <vineelak@fb.com>");
+MODULE_DESCRIPTION("COM_E Driver");
+MODULE_LICENSE("GPL");
+
+module_init(com_e_mod_init);
+module_exit(com_e_mod_exit);
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/kernel-module-com-e-driver_0.1.bb b/meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/kernel-module-com-e-driver_0.1.bb
new file mode 100644
index 0000000..53f679e
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-kernel/com-e-mod/kernel-module-com-e-driver_0.1.bb
@@ -0,0 +1,40 @@
+# Copyright 2015-present Facebook. All Rights Reserved.
+#
+# This program file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program in a file named COPYING; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301 USA
+
+SUMMARY = "Wedge100 COMe driver"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"
+
+inherit module
+
+PR = "r0"
+PV = "0.1"
+
+SRC_URI = "file://Makefile \
+ file://com_e_driver.c \
+ file://COPYING \
+ "
+
+S = "${WORKDIR}"
+
+DEPENDS += "kernel-module-i2c-dev-sysfs"
+
+RDEPENDS_${PN} += "kernel-module-i2c-dev-sysfs"
+
+KERNEL_MODULE_AUTOLOAD += " \
+ com_e_driver \
+"
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/COPYING b/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/COPYING
new file mode 100644
index 0000000..6d45519
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/Makefile b/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/Makefile
new file mode 100644
index 0000000..bfbd786
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/Makefile
@@ -0,0 +1,31 @@
+# Copyright 2015-present Facebook. All Rights Reserved.
+#
+# This program file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program in a file named COPYING; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301 USA
+
+obj-m := syscpld.o fancpld.o
+
+SRC := $(shell pwd)
+
+all:
+ $(MAKE) -C $(KERNEL_SRC) M=$(SRC)
+
+modules_install:
+ $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install
+
+clean:
+ rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c
+ rm -f Module.markers Module.symvers modules.order
+ rm -rf .tmp_versions Modules.symvers
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/fancpld.c b/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/fancpld.c
new file mode 100644
index 0000000..65ea0d1
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/fancpld.c
@@ -0,0 +1,396 @@
+/*
+ * fancpld.c - The i2c driver for FANBOARDCPLD
+ *
+ * Copyright 2015-present Facebook. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+//#define DEBUG
+
+#include <linux/errno.h>
+#include <linux/module.h>
+#include <linux/i2c.h>
+#include <linux/i2c_dev_sysfs.h>
+
+#ifdef DEBUG
+
+#define PP_DEBUG(fmt, ...) do { \
+ printk(KERN_DEBUG "%s:%d " fmt "\n", \
+ __FUNCTION__, __LINE__, ##__VA_ARGS__); \
+} while (0)
+
+#else /* !DEBUG */
+
+#define PP_DEBUG(fmt, ...)
+
+#endif
+
+static ssize_t fancpld_fan_rpm_show(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ int val;
+
+ val = i2c_dev_read_byte(dev, attr);
+ if (val < 0) {
+ return val;
+ }
+ /* Multiply by 150 to get the RPM */
+ val *= 150;
+
+ return scnprintf(buf, PAGE_SIZE, "%u\n", val);
+}
+
+#define FANTRAY_PWM_HELP \
+ "each value represents 1/32 duty cycle"
+#define FANTRAY_LED_CTRL_HELP \
+ "0x0: Under HW control\n" \
+ "0x1: Red off, Blue on\n" \
+ "0x2: Red on, Blue off\n" \
+ "0x3: Red off, Blue off"
+#define FANTRAY_LED_BLINK_HELP \
+ "0: no blink\n" \
+ "1: blink"
+
+static const i2c_dev_attr_st fancpld_attr_table[] = {
+ {
+ "board_rev",
+ NULL,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ NULL,
+ 0, 0, 4,
+ },
+ {
+ "model_id",
+ "0x0: wedge100\n"
+ "0x1: 6-pack100 linecard\n"
+ "0x2: 6-pack100 fabric card\n"
+ "0x3: reserved",
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ NULL,
+ 0, 4, 2,
+ },
+ {
+ "cpld_rev",
+ NULL,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ NULL,
+ 1, 0, 6,
+ },
+ {
+ "cpld_released",
+ NULL,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ NULL,
+ 1, 6, 1,
+ },
+ {
+ "cpld_sub_rev",
+ NULL,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ NULL,
+ 2, 0, 8,
+ },
+ {
+ "slotid",
+ NULL,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ NULL,
+ 3, 0, 5,
+ },
+ {
+ "jaybox_gpio",
+ NULL,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ NULL,
+ 4, 0, 8,
+ },
+ {
+ "jaybox_status",
+ NULL,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ NULL,
+ 5, 0, 2,
+ },
+ {
+ "fantray_failure",
+ "bit value 0: fan tray has failure\n"
+ "bit value 1: fan try is good and alive",
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ NULL,
+ 9, 0, 5,
+ },
+ {
+ "fan1_input",
+ NULL,
+ fancpld_fan_rpm_show,
+ NULL,
+ 0x10, 0, 8,
+ },
+ {
+ "fan2_input",
+ NULL,
+ fancpld_fan_rpm_show,
+ NULL,
+ 0x11, 0, 8,
+ },
+ {
+ "fan3_input",
+ NULL,
+ fancpld_fan_rpm_show,
+ NULL,
+ 0x12, 0, 8,
+ },
+ {
+ "fan4_input",
+ NULL,
+ fancpld_fan_rpm_show,
+ NULL,
+ 0x13, 0, 8,
+ },
+ {
+ "fan5_input",
+ NULL,
+ fancpld_fan_rpm_show,
+ NULL,
+ 0x14, 0, 8,
+ },
+ {
+ "fan6_input",
+ NULL,
+ fancpld_fan_rpm_show,
+ NULL,
+ 0x15, 0, 8,
+ },
+ {
+ "fan7_input",
+ NULL,
+ fancpld_fan_rpm_show,
+ NULL,
+ 0x16, 0, 8,
+ },
+ {
+ "fan8_input",
+ NULL,
+ fancpld_fan_rpm_show,
+ NULL,
+ 0x17, 0, 8,
+ },
+ {
+ "fan9_input",
+ NULL,
+ fancpld_fan_rpm_show,
+ NULL,
+ 0x18, 0, 8,
+ },
+ {
+ "fan10_input",
+ NULL,
+ fancpld_fan_rpm_show,
+ NULL,
+ 0x19, 0, 8,
+ },
+ {
+ "fantray_present",
+ "0: present\n"
+ "1: not present",
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ NULL,
+ 0x1d, 0, 5,
+ },
+ {
+ "fantray1_pwm",
+ FANTRAY_PWM_HELP,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ I2C_DEV_ATTR_STORE_DEFAULT,
+ 0x20, 0, 5,
+ },
+ {
+ "fantray2_pwm",
+ FANTRAY_PWM_HELP,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ I2C_DEV_ATTR_STORE_DEFAULT,
+ 0x21, 0, 5,
+ },
+ {
+ "fantray3_pwm",
+ FANTRAY_PWM_HELP,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ I2C_DEV_ATTR_STORE_DEFAULT,
+ 0x22, 0, 5,
+ },
+ {
+ "fantray4_pwm",
+ FANTRAY_PWM_HELP,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ I2C_DEV_ATTR_STORE_DEFAULT,
+ 0x23, 0, 5,
+ },
+ {
+ "fantray5_pwm",
+ FANTRAY_PWM_HELP,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ I2C_DEV_ATTR_STORE_DEFAULT,
+ 0x24, 0, 5,
+ },
+ {
+ "fantray1_led_ctrl",
+ FANTRAY_LED_CTRL_HELP,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ I2C_DEV_ATTR_STORE_DEFAULT,
+ 0x25, 0, 2,
+ },
+ {
+ "fantray1_led_blink",
+ FANTRAY_LED_BLINK_HELP,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ I2C_DEV_ATTR_STORE_DEFAULT,
+ 0x25, 2, 1,
+ },
+ {
+ "fantray2_led_ctrl",
+ FANTRAY_LED_CTRL_HELP,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ I2C_DEV_ATTR_STORE_DEFAULT,
+ 0x25, 4, 2,
+ },
+ {
+ "fantray2_led_blink",
+ FANTRAY_LED_BLINK_HELP,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ I2C_DEV_ATTR_STORE_DEFAULT,
+ 0x25, 6, 1,
+ },
+ {
+ "fantray3_led_ctrl",
+ FANTRAY_LED_CTRL_HELP,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ I2C_DEV_ATTR_STORE_DEFAULT,
+ 0x26, 0, 2,
+ },
+ {
+ "fantray3_led_blink",
+ FANTRAY_LED_BLINK_HELP,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ I2C_DEV_ATTR_STORE_DEFAULT,
+ 0x26, 2, 1,
+ },
+ {
+ "fantray4_led_ctrl",
+ FANTRAY_LED_CTRL_HELP,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ I2C_DEV_ATTR_STORE_DEFAULT,
+ 0x26, 4, 2,
+ },
+ {
+ "fantray4_led_blink",
+ FANTRAY_LED_BLINK_HELP,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ I2C_DEV_ATTR_STORE_DEFAULT,
+ 0x26, 6, 1,
+ },
+ {
+ "fantray5_led_ctrl",
+ FANTRAY_LED_CTRL_HELP,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ I2C_DEV_ATTR_STORE_DEFAULT,
+ 0x27, 0, 2,
+ },
+ {
+ "fantray5_led_blink",
+ FANTRAY_LED_BLINK_HELP,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ I2C_DEV_ATTR_STORE_DEFAULT,
+ 0x27, 2, 1,
+ },
+};
+
+static i2c_dev_data_st fancpld_data;
+
+/*
+ * FANCPLD i2c addresses.
+ * normal_i2c is used in I2C_CLIENT_INSMOD_1()
+ */
+static const unsigned short normal_i2c[] = {
+ 0x33, I2C_CLIENT_END
+};
+
+/*
+ * Insmod parameters
+ */
+I2C_CLIENT_INSMOD_1(fancpld);
+
+/* FANCPLD id */
+static const struct i2c_device_id fancpld_id[] = {
+ { "fancpld", fancpld },
+ { },
+};
+MODULE_DEVICE_TABLE(i2c, fancpld_id);
+
+/* Return 0 if detection is successful, -ENODEV otherwise */
+static int fancpld_detect(struct i2c_client *client, int kind,
+ struct i2c_board_info *info)
+{
+ /*
+ * We don't currently do any detection of the FANCPLD
+ */
+ strlcpy(info->type, "fancpld", I2C_NAME_SIZE);
+ return 0;
+}
+
+static int fancpld_probe(struct i2c_client *client,
+ const struct i2c_device_id *id)
+{
+ int n_attrs = sizeof(fancpld_attr_table) / sizeof(fancpld_attr_table[0]);
+ return i2c_dev_sysfs_data_init(client, &fancpld_data,
+ fancpld_attr_table, n_attrs);
+}
+
+static int fancpld_remove(struct i2c_client *client)
+{
+ i2c_dev_sysfs_data_clean(client, &fancpld_data);
+ return 0;
+}
+
+static struct i2c_driver fancpld_driver = {
+ .class = I2C_CLASS_HWMON,
+ .driver = {
+ .name = "fancpld",
+ },
+ .probe = fancpld_probe,
+ .remove = fancpld_remove,
+ .id_table = fancpld_id,
+ .detect = fancpld_detect,
+ /* addr_data is defined through I2C_CLIENT_INSMOD_1() */
+ .address_data = &addr_data,
+};
+
+static int __init fancpld_mod_init(void)
+{
+ return i2c_add_driver(&fancpld_driver);
+}
+
+static void __exit fancpld_mod_exit(void)
+{
+ i2c_del_driver(&fancpld_driver);
+}
+
+MODULE_AUTHOR("Tian Fang <tfang@fb.com>");
+MODULE_DESCRIPTION("FANCPLD Driver");
+MODULE_LICENSE("GPL");
+
+module_init(fancpld_mod_init);
+module_exit(fancpld_mod_exit);
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/syscpld.c b/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/syscpld.c
new file mode 100644
index 0000000..1f5abeb
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/files/syscpld.c
@@ -0,0 +1,281 @@
+/*
+ * syscpld.c - The i2c driver for SYSCPLD
+ *
+ * Copyright 2015-present Facebook. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+//#define DEBUG
+
+#include <linux/errno.h>
+#include <linux/module.h>
+#include <linux/i2c.h>
+#include <linux/i2c_dev_sysfs.h>
+
+#ifdef DEBUG
+
+#define PP_DEBUG(fmt, ...) do { \
+ printk(KERN_DEBUG "%s:%d " fmt "\n", \
+ __FUNCTION__, __LINE__, ##__VA_ARGS__); \
+} while (0)
+
+#else /* !DEBUG */
+
+#define PP_DEBUG(fmt, ...)
+
+#endif
+
+static const i2c_dev_attr_st syscpld_attr_table[] = {
+ {
+ "board_rev",
+ NULL,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ NULL,
+ 0, 0, 4,
+ },
+ {
+ "model_id",
+ "0x0: wedge100\n"
+ "0x1: 6-pack100 linecard\n"
+ "0x2: 6-pack100 fabric card\n"
+ "0x3: reserved",
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ NULL,
+ 0, 4, 2,
+ },
+ {
+ "cpld_rev",
+ NULL,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ NULL,
+ 1, 0, 6,
+ },
+ {
+ "cpld_released",
+ NULL,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ NULL,
+ 1, 6, 1,
+ },
+ {
+ "cpld_sub_rev",
+ NULL,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ NULL,
+ 2, 0, 8,
+ },
+ {
+ "slotid",
+ NULL,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ NULL,
+ 3, 0, 5,
+ },
+ {
+ "psu1_present",
+ NULL,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ NULL,
+ 8, 0, 1,
+ },
+ {
+ "psu2_present",
+ NULL,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ NULL,
+ 8, 1, 1,
+ },
+ {
+ "fan_rackmon_present",
+ NULL,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ NULL,
+ 8, 2, 1,
+ },
+ {
+ "micro_srv_present",
+ NULL,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ NULL,
+ 8, 3, 1,
+ },
+ {
+ "th_rov",
+ NULL,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ NULL,
+ 0xb, 0, 4,
+ },
+ {
+ "vcore_idsel",
+ NULL,
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ NULL,
+ 0xb, 4, 3,
+ },
+ {
+ "uart_mux",
+ "0x0: UART_SELECT_BMC\n0x1: UART_SELECT_DBG\n"
+ "0x2: Force to select 0\n0x3: Force to select 1\n\n"
+ "UART_SEL\n"
+ "1: micro-server console connected to BMC\n"
+ "0: micro-server console connected to debug header",
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ I2C_DEV_ATTR_STORE_DEFAULT,
+ 0x26, 0, 2,
+ },
+ {
+ "heart_attach_en",
+ "0: no fan tray fatal error attack\n"
+ "1: fan-tray fatal error attack mode enabled",
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ I2C_DEV_ATTR_STORE_DEFAULT,
+ 0x2e, 7, 1,
+ },
+ {
+ "dual_boot_en",
+ "0: single boot\n"
+ "1: dual boot",
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ I2C_DEV_ATTR_STORE_DEFAULT,
+ 0x2f, 0, 1,
+ },
+ {
+ "2nd_flash_wp",
+ "0: writeable\n"
+ "1: write protected",
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ I2C_DEV_ATTR_STORE_DEFAULT,
+ 0x2f, 1, 1,
+ },
+ {
+ "pwr_cyc_all_n",
+ "0: power cycle all power\n"
+ "1: normal",
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ I2C_DEV_ATTR_STORE_DEFAULT,
+ 0x30, 0, 1,
+ },
+ {
+ "pwr_main_n",
+ "0: main power is off\n"
+ "1: main power is enabled",
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ I2C_DEV_ATTR_STORE_DEFAULT,
+ 0x30, 1, 1,
+ },
+ {
+ "pwr_usrv_en",
+ "0: micro-server power is off\n"
+ "1: micro-server power is on",
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ I2C_DEV_ATTR_STORE_DEFAULT,
+ 0x30, 2, 1,
+ },
+ {
+ "pwr_usrv_btn_en",
+ "0: micro-server power button is off\n"
+ "1: micro-server power button is on",
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ I2C_DEV_ATTR_STORE_DEFAULT,
+ 0x30, 3, 1,
+ },
+ {
+ "usrv_rst_n",
+ "0: write 0 to trigger micro-server reset"
+ "1: normal",
+ I2C_DEV_ATTR_SHOW_DEFAULT,
+ I2C_DEV_ATTR_STORE_DEFAULT,
+ 0x32, 0, 1,
+ },
+};
+
+static i2c_dev_data_st syscpld_data;
+
+/*
+ * SYSCPLD i2c addresses.
+ * normal_i2c is used in I2C_CLIENT_INSMOD_1()
+ */
+static const unsigned short normal_i2c[] = {
+ 0x31, I2C_CLIENT_END
+};
+
+/*
+ * Insmod parameters
+ */
+I2C_CLIENT_INSMOD_1(syscpld);
+
+/* SYSCPLD id */
+static const struct i2c_device_id syscpld_id[] = {
+ { "syscpld", syscpld },
+ { },
+};
+MODULE_DEVICE_TABLE(i2c, syscpld_id);
+
+/* Return 0 if detection is successful, -ENODEV otherwise */
+static int syscpld_detect(struct i2c_client *client, int kind,
+ struct i2c_board_info *info)
+{
+ /*
+ * We don't currently do any detection of the SYSCPLD
+ */
+ strlcpy(info->type, "syscpld", I2C_NAME_SIZE);
+ return 0;
+}
+
+static int syscpld_probe(struct i2c_client *client,
+ const struct i2c_device_id *id)
+{
+ int n_attrs = sizeof(syscpld_attr_table) / sizeof(syscpld_attr_table[0]);
+ return i2c_dev_sysfs_data_init(client, &syscpld_data,
+ syscpld_attr_table, n_attrs);
+}
+
+static int syscpld_remove(struct i2c_client *client)
+{
+ i2c_dev_sysfs_data_clean(client, &syscpld_data);
+ return 0;
+}
+
+static struct i2c_driver syscpld_driver = {
+ .class = I2C_CLASS_HWMON,
+ .driver = {
+ .name = "syscpld",
+ },
+ .probe = syscpld_probe,
+ .remove = syscpld_remove,
+ .id_table = syscpld_id,
+ .detect = syscpld_detect,
+ /* addr_data is defined through I2C_CLIENT_INSMOD_1() */
+ .address_data = &addr_data,
+};
+
+static int __init syscpld_mod_init(void)
+{
+ return i2c_add_driver(&syscpld_driver);
+}
+
+static void __exit syscpld_mod_exit(void)
+{
+ i2c_del_driver(&syscpld_driver);
+}
+
+MODULE_AUTHOR("Tian Fang <tfang@fb.com>");
+MODULE_DESCRIPTION("SYSCPLD Driver");
+MODULE_LICENSE("GPL");
+
+module_init(syscpld_mod_init);
+module_exit(syscpld_mod_exit);
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/kernel-module-cpld_0.1.bb b/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/kernel-module-cpld_0.1.bb
new file mode 100644
index 0000000..dd0b6c6
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-kernel/cpld-mod/kernel-module-cpld_0.1.bb
@@ -0,0 +1,42 @@
+# Copyright 2015-present Facebook. All Rights Reserved.
+#
+# This program file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program in a file named COPYING; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301 USA
+
+SUMMARY = "Wedge100 CPLD drivers"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"
+
+inherit module
+
+PR = "r0"
+PV = "0.1"
+
+SRC_URI = "file://Makefile \
+ file://syscpld.c \
+ file://fancpld.c \
+ file://COPYING \
+ "
+
+S = "${WORKDIR}"
+
+DEPENDS += "kernel-module-i2c-dev-sysfs"
+
+RDEPENDS_${PN} += "kernel-module-i2c-dev-sysfs"
+
+KERNEL_MODULE_AUTOLOAD += " \
+ syscpld \
+ fancpld \
+"
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/COPYING b/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/COPYING
new file mode 100644
index 0000000..6d45519
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/Makefile b/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/Makefile
new file mode 100644
index 0000000..4be7b62
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/Makefile
@@ -0,0 +1,31 @@
+# Copyright 2015-present Facebook. All Rights Reserved.
+#
+# This program file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program in a file named COPYING; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301 USA
+
+obj-m := i2c_dev_sysfs.o
+
+SRC := $(shell pwd)
+
+all:
+ $(MAKE) -C $(KERNEL_SRC) M=$(SRC)
+
+modules_install:
+ $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install
+
+clean:
+ rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c
+ rm -f Module.markers Module.symvers modules.order
+ rm -rf .tmp_versions Modules.symvers
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/i2c_dev_sysfs.c b/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/i2c_dev_sysfs.c
new file mode 100644
index 0000000..96c1b98
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/i2c_dev_sysfs.c
@@ -0,0 +1,349 @@
+/*
+ * i2c_dev_sysfs.c - The i2c device sysfs library
+ *
+ * Copyright 2015-present Facebook. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+//#define DEBUG
+
+#include <linux/err.h>
+#include <linux/errno.h>
+#include <linux/hwmon.h>
+#include <linux/hwmon-sysfs.h>
+#include <linux/i2c.h>
+#include <linux/module.h>
+#include <linux/mutex.h>
+#include <linux/sysfs.h>
+
+#include "i2c_dev_sysfs.h"
+
+#ifdef DEBUG
+
+#define PP_DEBUG(fmt, ...) do { \
+ printk(KERN_DEBUG "%s:%d " fmt "\n", \
+ __FUNCTION__, __LINE__, ##__VA_ARGS__); \
+} while (0)
+
+#else /* !DEBUG */
+
+#define PP_DEBUG(fmt, ...)
+
+#endif
+
+ssize_t i2c_dev_show_label(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ i2c_sysfs_attr_st *i2c_attr = TO_I2C_SYSFS_ATTR(attr);
+ const i2c_dev_attr_st *dev_attr = i2c_attr->isa_i2c_attr;
+
+ if (dev_attr->ida_help) {
+ return sprintf(buf, "%s\n", dev_attr->ida_help);
+ }
+ return sprintf(buf, "%s\n", dev_attr->ida_name);
+}
+EXPORT_SYMBOL_GPL(i2c_dev_show_label);
+
+int i2c_dev_read_byte(struct device *dev,
+ struct device_attribute *attr)
+{
+ struct i2c_client *client = to_i2c_client(dev);
+ i2c_dev_data_st *data = i2c_get_clientdata(client);
+ i2c_sysfs_attr_st *i2c_attr = TO_I2C_SYSFS_ATTR(attr);
+ const i2c_dev_attr_st *dev_attr = i2c_attr->isa_i2c_attr;
+ int val;
+ int val_mask;
+
+ val_mask = ~(((-1) >> (dev_attr->ida_n_bits)) << (dev_attr->ida_n_bits));
+
+ mutex_lock(&data->idd_lock);
+
+ val = i2c_smbus_read_byte_data(client, dev_attr->ida_reg);
+
+ mutex_unlock(&data->idd_lock);
+
+ if (val < 0) {
+ /* error case */
+ return val;
+ }
+
+ val = (val >> dev_attr->ida_bit_offset) & val_mask;
+ return val;
+}
+EXPORT_SYMBOL_GPL(i2c_dev_read_byte);
+
+int i2c_dev_read_nbytes(struct device *dev,
+ struct device_attribute *attr,
+ uint8_t values[],
+ int nbytes)
+{
+ struct i2c_client *client = to_i2c_client(dev);
+ i2c_dev_data_st *data = i2c_get_clientdata(client);
+ i2c_sysfs_attr_st *i2c_attr = TO_I2C_SYSFS_ATTR(attr);
+ const i2c_dev_attr_st *dev_attr = i2c_attr->isa_i2c_attr;
+ int i;
+
+ mutex_lock(&data->idd_lock);
+ for (i = 0; i < nbytes; ++i) {
+ values[i] = i2c_smbus_read_byte_data(client, dev_attr->ida_reg + i);
+ if (values[i] < 0) {
+ mutex_unlock(&data->idd_lock);
+ return values[i];
+ }
+ }
+ mutex_unlock(&data->idd_lock);
+ return nbytes;
+}
+EXPORT_SYMBOL_GPL(i2c_dev_read_nbytes);
+
+int i2c_dev_read_word_littleendian(struct device *dev,
+ struct device_attribute *attr)
+{
+ uint8_t values[2];
+ int ret_val;
+
+ ret_val = i2c_dev_read_nbytes(dev, attr, values, 2);
+ if (ret_val < 0) {
+ return ret_val;
+ }
+ // values[0] : LSB
+ // values[1] : MSB
+ return ((values[1]<<8) + values[0]);
+}
+EXPORT_SYMBOL_GPL(i2c_dev_read_word_littleendian);
+
+int i2c_dev_read_word_bigendian(struct device *dev,
+ struct device_attribute *attr)
+{
+ uint8_t values[2];
+ int ret_val;
+
+ ret_val = i2c_dev_read_nbytes(dev, attr, values, 2);
+ if (ret_val < 0) {
+ return ret_val;
+ }
+ // values[0] : MSB
+ // values[1] : LSB
+ return ((values[0]<<8) + values[1]);
+}
+EXPORT_SYMBOL_GPL(i2c_dev_read_word_bigendian);
+
+ssize_t i2c_dev_show_ascii(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ i2c_sysfs_attr_st *i2c_attr = TO_I2C_SYSFS_ATTR(attr);
+ const i2c_dev_attr_st *dev_attr = i2c_attr->isa_i2c_attr;
+ int nbytes, ret_val;
+
+ nbytes = (dev_attr->ida_n_bits) / 8;
+ ret_val = i2c_dev_read_nbytes(dev, attr, buf, nbytes);
+ if (ret_val < 0) {
+ return ret_val;
+ }
+ //buf[] : ascii data
+ buf[nbytes] = '\n';
+ return (nbytes + 1);
+}
+EXPORT_SYMBOL_GPL(i2c_dev_show_ascii);
+
+static ssize_t i2c_dev_sysfs_show(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ struct i2c_client *client = to_i2c_client(dev);
+ i2c_dev_data_st *data = i2c_get_clientdata(client);
+ i2c_sysfs_attr_st *i2c_attr = TO_I2C_SYSFS_ATTR(attr);
+ const i2c_dev_attr_st *dev_attr = i2c_attr->isa_i2c_attr;
+ int val;
+ int val_mask;
+
+ if (!dev_attr->ida_show) {
+ return -EOPNOTSUPP;
+ }
+
+ if (dev_attr->ida_show != I2C_DEV_ATTR_SHOW_DEFAULT) {
+ return dev_attr->ida_show(dev, attr, buf);
+ }
+
+ val_mask = ~(((-1) >> (dev_attr->ida_n_bits)) << (dev_attr->ida_n_bits));
+
+ mutex_lock(&data->idd_lock);
+
+ /* default handling */
+ val = i2c_smbus_read_byte_data(client, dev_attr->ida_reg);
+
+ mutex_unlock(&data->idd_lock);
+
+ if (val < 0) {
+ /* error case */
+ return val;
+ }
+
+ val = (val >> dev_attr->ida_bit_offset) & val_mask;
+
+ return scnprintf(buf, PAGE_SIZE, "0x%x%s%s\n", val,
+ (dev_attr->ida_help) ? "\n\nNote:\n" : "",
+ (dev_attr->ida_help) ? dev_attr->ida_help : "");
+}
+
+static ssize_t i2c_dev_sysfs_store(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ struct i2c_client *client = to_i2c_client(dev);
+ i2c_dev_data_st *data = i2c_get_clientdata(client);
+ i2c_sysfs_attr_st *i2c_attr = TO_I2C_SYSFS_ATTR(attr);
+ const i2c_dev_attr_st *dev_attr = i2c_attr->isa_i2c_attr;
+ int val;
+ int req_val;
+ int req_val_mask;
+
+ if (!dev_attr->ida_store) {
+ return -EOPNOTSUPP;
+ }
+
+ if (dev_attr->ida_store != I2C_DEV_ATTR_STORE_DEFAULT) {
+ return dev_attr->ida_store(dev, attr, buf, count);
+ }
+
+ /* parse the buffer */
+ if (sscanf(buf, "%i", &req_val) <= 0) {
+ return -EINVAL;
+ }
+ req_val_mask = ~(((-1) >> (dev_attr->ida_n_bits)) << (dev_attr->ida_n_bits));
+ req_val &= req_val_mask;
+
+ mutex_lock(&data->idd_lock);
+
+ /* default handling, first read back the current value */
+ val = i2c_smbus_read_byte_data(client, dev_attr->ida_reg);
+
+ if (val < 0) {
+ /* fail to read */
+ goto unlock_out;
+ }
+
+ /* mask out all bits for the value requested */
+ val &= ~(req_val_mask << dev_attr->ida_bit_offset);
+ val |= req_val << dev_attr->ida_bit_offset;
+
+ val = i2c_smbus_write_byte_data(client, dev_attr->ida_reg, val);
+
+ unlock_out:
+ mutex_unlock(&data->idd_lock);
+
+ if (val < 0) {
+ /* error case */
+ return val;
+ }
+
+ return count;
+}
+
+void i2c_dev_sysfs_data_clean(struct i2c_client *client, i2c_dev_data_st *data)
+{
+ if (!data) {
+ return;
+ }
+ if (data->idd_hwmon_dev) {
+ hwmon_device_unregister(data->idd_hwmon_dev);
+ }
+ if (data->idd_attr_group.attrs) {
+ sysfs_remove_group(&client->dev.kobj, &data->idd_attr_group);
+ kfree(data->idd_attr_group.attrs);
+ }
+ if (data->idd_attrs) {
+ kfree(data->idd_attrs);
+ }
+ memset(data, 0, sizeof(*data));
+}
+EXPORT_SYMBOL_GPL(i2c_dev_sysfs_data_clean);
+
+int i2c_dev_sysfs_data_init(struct i2c_client *client,
+ i2c_dev_data_st *data,
+ const i2c_dev_attr_st *dev_attrs,
+ int n_attrs)
+{
+ int i;
+ int err;
+ i2c_sysfs_attr_st *cur_attr;
+ const i2c_dev_attr_st *cur_dev_attr;
+ struct attribute **cur_grp_attr;
+
+ memset(data, 0, sizeof(*data));
+
+ i2c_set_clientdata(client, data);
+ mutex_init(&data->idd_lock);
+
+ /* allocate all attribute */
+ data->idd_attrs = kzalloc(sizeof(*data->idd_attrs) * n_attrs, GFP_KERNEL);
+ /* allocate the attribute group. +1 for the last NULL */
+ data->idd_attr_group.attrs
+ = kzalloc(sizeof(*data->idd_attr_group.attrs) * (n_attrs + 1), GFP_KERNEL);
+ if (!data->idd_attrs || !data->idd_attr_group.attrs) {
+ err = -ENOMEM;
+ goto exit_cleanup;
+ }
+ PP_DEBUG("Allocated %u attributes", n_attrs);
+
+ for (i = 0,
+ cur_attr = &data->idd_attrs[0],
+ cur_grp_attr = &data->idd_attr_group.attrs[0],
+ cur_dev_attr = dev_attrs;
+ i < n_attrs;
+ i++, cur_attr++, cur_grp_attr++, cur_dev_attr++) {
+
+ mode_t mode = S_IRUGO;
+ if (cur_dev_attr->ida_store) {
+ mode |= S_IWUSR;
+ }
+ cur_attr->isa_dev_attr.attr.name = cur_dev_attr->ida_name;
+ cur_attr->isa_dev_attr.attr.mode = mode;
+ cur_attr->isa_dev_attr.show = i2c_dev_sysfs_show;
+ cur_attr->isa_dev_attr.store = i2c_dev_sysfs_store;
+ *cur_grp_attr = &cur_attr->isa_dev_attr.attr;
+ cur_attr->isa_i2c_attr = cur_dev_attr;
+ PP_DEBUG("Created attribute \"%s\"", cur_attr->isa_dev_attr.attr.name);
+ }
+
+ /* Register sysfs hooks */
+ if ((err = sysfs_create_group(&client->dev.kobj, &data->idd_attr_group))) {
+ goto exit_cleanup;
+ }
+
+ data->idd_hwmon_dev = hwmon_device_register(&client->dev);
+ if (IS_ERR(data->idd_hwmon_dev)) {
+ err = PTR_ERR(data->idd_hwmon_dev);
+ data->idd_hwmon_dev = NULL;
+ goto exit_cleanup;
+ }
+
+ PP_DEBUG("i2c device sysfs init data done");
+
+ return 0;
+
+ exit_cleanup:
+ i2c_dev_sysfs_data_clean(client, data);
+ return err;
+}
+EXPORT_SYMBOL_GPL(i2c_dev_sysfs_data_init);
+
+
+MODULE_AUTHOR("Tian Fang <tfang@fb.com>");
+MODULE_DESCRIPTION("i2c device sysfs attribute library");
+MODULE_LICENSE("GPL");
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/i2c_dev_sysfs.h b/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/i2c_dev_sysfs.h
new file mode 100644
index 0000000..47862cc
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/files/i2c_dev_sysfs.h
@@ -0,0 +1,84 @@
+/*
+ * i2c_dev_sysfs.h - The i2c device sysfs library header
+ *
+ * Copyright 2015-present Facebook. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef I2C_DEV_SYSFS_H
+#define I2C_DEV_SYSFS_H
+
+#include <linux/device.h>
+#include <linux/types.h>
+
+typedef ssize_t (*i2c_dev_attr_show_fn)(struct device *dev,
+ struct device_attribute *attr,
+ char *buf);
+typedef ssize_t (*i2c_dev_attr_store_fn)(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count);
+
+#define I2C_DEV_ATTR_SHOW_DEFAULT (i2c_dev_attr_show_fn)(1)
+#define I2C_DEV_ATTR_STORE_DEFAULT (i2c_dev_attr_store_fn)(1)
+
+typedef struct i2c_dev_attr_st_ {
+ const char *ida_name;
+ const char *ida_help;
+ i2c_dev_attr_show_fn ida_show;
+ i2c_dev_attr_store_fn ida_store;
+ int ida_reg;
+ int ida_bit_offset;
+ int ida_n_bits;
+} i2c_dev_attr_st;
+
+typedef struct i2c_sysfs_attr_st_{
+ struct device_attribute isa_dev_attr;
+ const i2c_dev_attr_st *isa_i2c_attr;
+} i2c_sysfs_attr_st;
+
+#define TO_I2C_SYSFS_ATTR(_attr) \
+ container_of(_attr, i2c_sysfs_attr_st, isa_dev_attr)
+
+typedef struct i2c_dev_data_st_ {
+ struct device *idd_hwmon_dev;
+ struct mutex idd_lock;
+ i2c_sysfs_attr_st *idd_attrs;
+ struct attribute_group idd_attr_group;
+} i2c_dev_data_st;
+
+int i2c_dev_sysfs_data_init(struct i2c_client *client,
+ i2c_dev_data_st *data,
+ const i2c_dev_attr_st *dev_attrs,
+ int n_attrs);
+void i2c_dev_sysfs_data_clean(struct i2c_client *client, i2c_dev_data_st *data);
+int i2c_dev_read_byte(struct device *dev,
+ struct device_attribute *attr);
+int i2c_dev_read_nbytes(struct device *dev,
+ struct device_attribute *attr,
+ uint8_t values[],
+ int nbytes);
+int i2c_dev_read_word_littleendian(struct device *dev,
+ struct device_attribute *attr);
+int i2c_dev_read_word_bigendian(struct device *dev,
+ struct device_attribute *attr);
+ssize_t i2c_dev_show_label(struct device *dev,
+ struct device_attribute *attr,
+ char *buf);
+ssize_t i2c_dev_show_ascii(struct device *dev,
+ struct device_attribute *attr,
+ char *buf);
+
+#endif
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/kernel-module-i2c-dev-sysfs_0.1.bb b/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/kernel-module-i2c-dev-sysfs_0.1.bb
new file mode 100644
index 0000000..8e42144
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-kernel/i2c-dev-sysfs-mod/kernel-module-i2c-dev-sysfs_0.1.bb
@@ -0,0 +1,42 @@
+# Copyright 2015-present Facebook. All Rights Reserved.
+#
+# This program file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program in a file named COPYING; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301 USA
+
+SUMMARY = "Wedge100 i2c device library"
+DESCRIPTION = "i2c device sysfs attribute library"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"
+
+inherit module
+
+PR = "r0"
+PV = "0.1"
+
+SRC_URI = "file://Makefile \
+ file://i2c_dev_sysfs.c \
+ file://i2c_dev_sysfs.h \
+ file://COPYING \
+ "
+
+S = "${WORKDIR}"
+
+do_install_append() {
+ kerneldir=${STAGING_KERNEL_DIR}/include/linux
+ install -d ${kerneldir}
+ install -m 0644 i2c_dev_sysfs.h ${kerneldir}/
+}
+
+FILES_${PN}-dev = "${kerneldir}/i2c_dev_sysfs.h"
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/linux/files/defconfig b/meta-facebook/meta-wedge100/recipes-kernel/linux/files/defconfig
new file mode 100644
index 0000000..0f9f0f7
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-kernel/linux/files/defconfig
@@ -0,0 +1,1462 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.28.9
+# Wed Aug 5 18:43:53 2015
+#
+CONFIG_ARM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_GENERIC_GPIO=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_MMU=y
+# CONFIG_NO_IOPORT is not set
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_HAVE_LATENCYTOP_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_KERNEL_GZIP=y
+# CONFIG_KERNEL_BZIP2 is not set
+# CONFIG_KERNEL_LZMA is not set
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+CONFIG_IKCONFIG=m
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=16
+# CONFIG_CGROUPS is not set
+# CONFIG_GROUP_SCHED is not set
+CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_RELAY is not set
+CONFIG_NAMESPACES=y
+# CONFIG_UTS_NS is not set
+# CONFIG_IPC_NS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+# CONFIG_EMBEDDED is not set
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_EXTRA_PASS=y
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLUB_DEBUG=y
+CONFIG_COMPAT_BRK=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+CONFIG_CLASSIC_RCU=y
+CONFIG_FREEZER=y
+
+#
+# System Type
+#
+CONFIG_ARCH_ASPEED=y
+# CONFIG_ARCH_AAEC2000 is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_VERSATILE is not set
+# CONFIG_ARCH_AT91 is not set
+# CONFIG_ARCH_CLPS7500 is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_IOP13XX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_KIRKWOOD is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_LOKI is not set
+# CONFIG_ARCH_MV78XX0 is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_ORION5X is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_DAVINCI is not set
+# CONFIG_ARCH_OMAP is not set
+# CONFIG_ARCH_MSM is not set
+CONFIG_IRMP=y
+# CONFIG_PCEXT is not set
+# CONFIG_REMOTEFX is not set
+# CONFIG_ARCH_AST1100 is not set
+# CONFIG_ARCH_AST2100 is not set
+# CONFIG_ARCH_AST2200 is not set
+# CONFIG_ARCH_AST2300 is not set
+CONFIG_ARCH_AST2400=y
+# CONFIG_ARCH_AST2500 is not set
+
+#
+# FLASH Chip Select
+#
+# CONFIG_AST_CS0_NOR is not set
+# CONFIG_AST_CS0_NAND is not set
+CONFIG_AST_CS0_SPI=y
+# CONFIG_AST_CS0_NONE is not set
+# CONFIG_AST_CS1_NOR is not set
+# CONFIG_AST_CS1_NAND is not set
+# CONFIG_AST_CS1_SPI is not set
+CONFIG_AST_CS1_NONE=y
+# CONFIG_AST_CS2_NOR is not set
+# CONFIG_AST_CS2_NAND is not set
+# CONFIG_AST_CS2_SPI is not set
+CONFIG_AST_CS2_NONE=y
+# CONFIG_AST_CS3_NOR is not set
+# CONFIG_AST_CS3_NAND is not set
+# CONFIG_AST_CS3_SPI is not set
+CONFIG_AST_CS3_NONE=y
+# CONFIG_AST_CS4_NOR is not set
+# CONFIG_AST_CS4_NAND is not set
+# CONFIG_AST_CS4_SPI is not set
+CONFIG_AST_CS4_NONE=y
+# CONFIG_ARCH_AST1070 is not set
+# CONFIG_AST_SCU_LOCK is not set
+# CONFIG_WEDGE is not set
+CONFIG_WEDGE100=y
+# CONFIG_YOSEMITE is not set
+
+#
+# Boot options
+#
+
+#
+# Power management
+#
+CONFIG_PLAT_ASPEED=y
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_ARM926T=y
+CONFIG_CPU_32v5=y
+CONFIG_CPU_ABRT_EV5TJ=y
+CONFIG_CPU_PABRT_NOIFAR=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_COPY_V4WB=y
+CONFIG_CPU_TLB_V4WBI=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
+# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
+# CONFIG_OUTER_CACHE is not set
+
+#
+# Bus support
+#
+CONFIG_ARM_AMBA=y
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+# CONFIG_PREEMPT is not set
+CONFIG_HZ=100
+CONFIG_AEABI=y
+CONFIG_OABI_COMPAT=y
+CONFIG_ARCH_FLATMEM_HAS_HOLES=y
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4096
+# CONFIG_RESOURCES_64BIT is not set
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=0
+CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0
+CONFIG_ZBOOT_ROM_BSS=0
+CONFIG_CMDLINE=""
+# CONFIG_XIP_KERNEL is not set
+# CONFIG_KEXEC is not set
+
+#
+# CPU Power Management
+#
+# CONFIG_CPU_IDLE is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_FPE_NWFPE=y
+CONFIG_FPE_NWFPE_XP=y
+# CONFIG_FPE_FASTFPE is not set
+CONFIG_VFP=y
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HAVE_AOUT=y
+CONFIG_BINFMT_AOUT=y
+# CONFIG_BINFMT_MISC is not set
+
+#
+# Power management options
+#
+CONFIG_PM=y
+# CONFIG_PM_DEBUG is not set
+CONFIG_PM_SLEEP=y
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+# CONFIG_APM_EMULATION is not set
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+# CONFIG_XFRM_USER is not set
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_XFRM_STATISTICS is not set
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+CONFIG_INET_TUNNEL=m
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+CONFIG_IPV6=m
+# CONFIG_IPV6_PRIVACY is not set
+# CONFIG_IPV6_ROUTER_PREF is not set
+# CONFIG_IPV6_OPTIMISTIC_DAD is not set
+# CONFIG_INET6_AH is not set
+# CONFIG_INET6_ESP is not set
+# CONFIG_INET6_IPCOMP is not set
+# CONFIG_IPV6_MIP6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+CONFIG_INET6_XFRM_MODE_TRANSPORT=m
+CONFIG_INET6_XFRM_MODE_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_BEET=m
+# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+CONFIG_IPV6_SIT=m
+CONFIG_IPV6_NDISC_NODETYPE=y
+# CONFIG_IPV6_TUNNEL is not set
+# CONFIG_IPV6_MULTIPLE_TABLES is not set
+# CONFIG_IPV6_MROUTE is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
+CONFIG_VLAN_8021Q=m
+# CONFIG_VLAN_8021Q_GVRP is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+CONFIG_WAN_ROUTER=y
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_PHONET is not set
+# CONFIG_WIRELESS is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_SYS_HYPERVISOR is not set
+CONFIG_CONNECTOR=y
+CONFIG_PROC_EVENTS=y
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=y
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_AFS_PARTS is not set
+# CONFIG_MTD_AR7_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+CONFIG_MTD_DATAFLASH=m
+CONFIG_MTD_DATAFLASH_WRITE_VERIFY=y
+# CONFIG_MTD_DATAFLASH_OTP is not set
+CONFIG_MTD_M25P80=y
+CONFIG_M25PXX_USE_FAST_READ=y
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+# CONFIG_MTD_NAND is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# UBI - Unsorted block images
+#
+# CONFIG_MTD_UBI is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+CONFIG_BLK_DEV_NBD=y
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=16384
+# CONFIG_BLK_DEV_XIP is not set
+# CONFIG_RD_BZIP2 is not set
+CONFIG_RD_LZMA=y
+CONFIG_RD_GZIP=y
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_EEPROM_93CX6 is not set
+# CONFIG_ICS932S401 is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_C2PORT is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+CONFIG_SCSI_TGT=y
+# CONFIG_SCSI_NETLINK is not set
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+CONFIG_CHR_DEV_SG=y
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+CONFIG_SCSI_SCAN_ASYNC=y
+CONFIG_SCSI_WAIT_SCAN=m
+
+#
+# SCSI Transports
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+CONFIG_SCSI_ISCSI_ATTRS=m
+# CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
+# CONFIG_SCSI_LOWLEVEL is not set
+# CONFIG_SCSI_DH is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+CONFIG_BONDING=m
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+CONFIG_TUN=m
+# CONFIG_VETH is not set
+# CONFIG_NET_ETHERNET is not set
+CONFIG_NETDEV_1000=y
+CONFIG_ASPEEDMAC=y
+# CONFIG_NETDEV_10000 is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_GPIO is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_LIFEBOOK=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+CONFIG_MOUSE_SERIAL=y
+# CONFIG_MOUSE_APPLETOUCH is not set
+# CONFIG_MOUSE_BCM5974 is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_MOUSE_GPIO is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_AMBAKMI is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVKMEM=y
+CONFIG_SERIAL_NONSTANDARD=y
+# CONFIG_N_HDLC is not set
+# CONFIG_RISCOM8 is not set
+# CONFIG_SPECIALIX is not set
+# CONFIG_RIO is not set
+# CONFIG_STALDRV is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_AST_DMA_UART is not set
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_AMBA_PL010 is not set
+# CONFIG_SERIAL_AMBA_PL011 is not set
+# CONFIG_SERIAL_AST is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_IPMI_HANDLER is not set
+CONFIG_AST_MISC=y
+# CONFIG_AST_VIDEO is not set
+# CONFIG_ADC_CAT9883 is not set
+# CONFIG_AST_SPI_BIOS is not set
+CONFIG_AST_PECI=y
+# CONFIG_AST_KCS is not set
+# CONFIG_AST_GPIO is not set
+# CONFIG_HW_RANDOM is not set
+CONFIG_NVRAM=y
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_HELPER_AUTO=y
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+# CONFIG_I2C_GPIO is not set
+# CONFIG_I2C_OCORES is not set
+CONFIG_I2C_AST=y
+CONFIG_AST_I2C_SLAVE_MODE=y
+CONFIG_AST_I2C_SLAVE_EEPROM=y
+# CONFIG_AST_I2C_SLAVE_RDWR is not set
+# CONFIG_I2C_SIMTEC is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_TINY_USB is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_STUB is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_DS1682 is not set
+CONFIG_AT24=m
+# CONFIG_SENSORS_EEPROM is not set
+CONFIG_SENSORS_PCF8574=m
+# CONFIG_PCF8575 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_TPS65010 is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_AST=y
+CONFIG_SPI_FMC=y
+CONFIG_SPI_BITBANG=y
+
+#
+# SPI Protocol Masters
+#
+CONFIG_SPI_AT25=m
+CONFIG_SPI_SPIDEV=m
+# CONFIG_SPI_TLE62X0 is not set
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_GPIOLIB=y
+CONFIG_GPIO_SYSFS=y
+
+#
+# Memory mapped GPIO expanders:
+#
+
+#
+# I2C GPIO expanders:
+#
+# CONFIG_GPIO_MAX732X is not set
+# CONFIG_GPIO_PCA953X is not set
+# CONFIG_GPIO_PCF857X is not set
+
+#
+# PCI GPIO expanders:
+#
+
+#
+# SPI GPIO expanders:
+#
+# CONFIG_GPIO_MAX7301 is not set
+# CONFIG_GPIO_MCP23S08 is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_AD7414 is not set
+# CONFIG_SENSORS_AD7418 is not set
+# CONFIG_SENSORS_ADCXX is not set
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1026 is not set
+# CONFIG_SENSORS_ADM1029 is not set
+# CONFIG_SENSORS_ADM1031 is not set
+# CONFIG_SENSORS_ADM9240 is not set
+# CONFIG_SENSORS_ADT7462 is not set
+# CONFIG_SENSORS_ADT7470 is not set
+# CONFIG_SENSORS_ADT7473 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_F71882FG is not set
+# CONFIG_SENSORS_F75375S is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_LM63 is not set
+# CONFIG_SENSORS_LM70 is not set
+CONFIG_SENSORS_LM75=m
+# CONFIG_SENSORS_LM77 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM87 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_LM92 is not set
+# CONFIG_SENSORS_LM93 is not set
+CONFIG_SENSORS_MAX127=m
+# CONFIG_SENSORS_MAX1111 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_MAX6650 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_PC87427 is not set
+# CONFIG_SENSORS_DME1737 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47M192 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+CONFIG_SENSORS_ADS7828=m
+# CONFIG_SENSORS_THMC50 is not set
+# CONFIG_SENSORS_VT1211 is not set
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83791D is not set
+# CONFIG_SENSORS_W83792D is not set
+# CONFIG_SENSORS_W83793 is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83L786NG is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+CONFIG_SENSORS_AST_ADC=m
+# CONFIG_SENSORS_AST_PWM_FAN is not set
+CONFIG_SENSORS_FB_PANTHER_PLUS=m
+CONFIG_PMBUS=m
+CONFIG_SENSORS_PMBUS=m
+CONFIG_SENSORS_ADM1275=m
+# CONFIG_SENSORS_LM25066 is not set
+# CONFIG_SENSORS_LTC2978 is not set
+# CONFIG_SENSORS_MAX16064 is not set
+# CONFIG_SENSORS_MAX34440 is not set
+# CONFIG_SENSORS_MAX8688 is not set
+CONFIG_SENSORS_PFE1100=m
+CONFIG_SENSORS_PFE3000=m
+# CONFIG_SENSORS_UCD9000 is not set
+# CONFIG_SENSORS_UCD9200 is not set
+# CONFIG_SENSORS_ZL6100 is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+CONFIG_THERMAL=y
+CONFIG_THERMAL_HWMON=y
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_AST_WATCHDOG=y
+CONFIG_AST_WATCHDOG_REARM_DUAL_BOOT=y
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_MFD_ASIC3 is not set
+# CONFIG_HTC_EGPIO is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_MFD_TC6393XB is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM8350_I2C is not set
+
+#
+# Multimedia devices
+#
+
+#
+# Multimedia core support
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_VIDEO_MEDIA is not set
+
+#
+# Multimedia drivers
+#
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_SOUND is not set
+# CONFIG_HID_SUPPORT is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+# CONFIG_USB_ARCH_HAS_OHCI is not set
+CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_USB=m
+# CONFIG_USB_DEBUG is not set
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_DEVICE_CLASS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_SUSPEND is not set
+# CONFIG_USB_OTG is not set
+# CONFIG_USB_MON is not set
+# CONFIG_USB_WUSB is not set
+# CONFIG_USB_WUSB_CBAF is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_C67X00_HCD is not set
+# CONFIG_USB_EHCI_HCD is not set
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+# CONFIG_USB_HWA_HCD is not set
+
+#
+# AST USB Drivers
+#
+CONFIG_AST_USB_UHCI_HCD=m
+# CONFIG_AST_USB_UHCI_MULTIPORT_1 is not set
+# CONFIG_AST_USB_UHCI_MULTIPORT_2 is not set
+CONFIG_AST_USB_UHCI_MULTIPORT_4=y
+# CONFIG_USB_GADGET_MUSB_HDRC is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+# CONFIG_USB_WDM is not set
+# CONFIG_USB_TMC is not set
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
+#
+
+#
+# see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_ONETOUCH is not set
+# CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_SEVSEG is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_BERRY_CHARGE is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGET is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
+# CONFIG_USB_TEST is not set
+# CONFIG_USB_ISIGHTFW is not set
+# CONFIG_USB_VST is not set
+CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_VBUS_DRAW=2
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_AT91 is not set
+# CONFIG_USB_GADGET_ATMEL_USBA is not set
+# CONFIG_USB_GADGET_FSL_USB2 is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_PXA25X is not set
+# CONFIG_USB_GADGET_PXA27X is not set
+# CONFIG_USB_GADGET_S3C2410 is not set
+# CONFIG_USB_GADGET_M66592 is not set
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_FSL_QE is not set
+# CONFIG_USB_GADGET_NET2280 is not set
+# CONFIG_USB_GADGET_GOKU is not set
+CONFIG_USB_GADGET_ASPEED_AST=y
+CONFIG_USB_ASPEED_AST=y
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+CONFIG_USB_ZERO=m
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_RNDIS=y
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_FILE_STORAGE=m
+# CONFIG_USB_FILE_STORAGE_TEST is not set
+CONFIG_USB_G_SERIAL=m
+# CONFIG_USB_MIDI_GADGET is not set
+# CONFIG_USB_G_PRINTER is not set
+CONFIG_USB_CDC_COMPOSITE=m
+# CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_ACCESSIBILITY is not set
+# CONFIG_NEW_LEDS is not set
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+# CONFIG_RTC_HCTOSYS is not set
+# CONFIG_RTC_DEBUG is not set
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# CONFIG_RTC_DRV_X1205 is not set
+# CONFIG_RTC_DRV_PCF8563 is not set
+# CONFIG_RTC_DRV_PCF8583 is not set
+# CONFIG_RTC_DRV_M41T80 is not set
+# CONFIG_RTC_DRV_S35390A is not set
+# CONFIG_RTC_DRV_FM3130 is not set
+# CONFIG_RTC_DRV_RX8581 is not set
+
+#
+# SPI RTC drivers
+#
+# CONFIG_RTC_DRV_M41T94 is not set
+# CONFIG_RTC_DRV_DS1305 is not set
+# CONFIG_RTC_DRV_DS1390 is not set
+# CONFIG_RTC_DRV_MAX6902 is not set
+# CONFIG_RTC_DRV_R9701 is not set
+# CONFIG_RTC_DRV_RS5C348 is not set
+# CONFIG_RTC_DRV_DS3234 is not set
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+# CONFIG_RTC_DRV_PL030 is not set
+# CONFIG_RTC_DRV_PL031 is not set
+CONFIG_RTC_DRV_ASPEED=y
+# CONFIG_DMADEVICES is not set
+# CONFIG_REGULATOR is not set
+# CONFIG_UIO is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+# CONFIG_EXT2_FS_XIP is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_EXT4_FS is not set
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_FILE_LOCKING=y
+# CONFIG_XFS_FS is not set
+# CONFIG_OCFS2_FS is not set
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+CONFIG_GENERIC_ACL=y
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+CONFIG_NTFS_FS=y
+# CONFIG_NTFS_DEBUG is not set
+CONFIG_NTFS_RW=y
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_CONFIGFS_FS=m
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
+# CONFIG_JFFS2_SUMMARY is not set
+# CONFIG_JFFS2_FS_XATTR is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+# CONFIG_JFFS2_LZO is not set
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+# CONFIG_NFS_V3 is not set
+# CONFIG_NFS_V4 is not set
+CONFIG_ROOT_NFS=y
+# CONFIG_NFSD is not set
+CONFIG_LOCKD=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+# CONFIG_SUNRPC_REGISTER_V4 is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="utf8"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+CONFIG_NLS_CODEPAGE_936=y
+CONFIG_NLS_CODEPAGE_950=y
+CONFIG_NLS_CODEPAGE_932=y
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+CONFIG_NLS_ASCII=y
+CONFIG_NLS_ISO8859_1=y
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+CONFIG_NLS_UTF8=y
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+# CONFIG_SLUB_DEBUG_ON is not set
+# CONFIG_SLUB_STATS is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+CONFIG_DEBUG_MEMORY_INIT=y
+CONFIG_FRAME_POINTER=y
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_LATENCYTOP is not set
+# CONFIG_SYSCTL_SYSCALL_CHECK is not set
+CONFIG_HAVE_FUNCTION_TRACER=y
+
+#
+# Tracers
+#
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_DEBUG_USER is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+# CONFIG_CRYPTO_FIPS is not set
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD=m
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+# CONFIG_CRYPTO_GF128MUL is not set
+CONFIG_CRYPTO_NULL=y
+# CONFIG_CRYPTO_CRYPTD is not set
+CONFIG_CRYPTO_AUTHENC=m
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+# CONFIG_CRYPTO_ECB is not set
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+CONFIG_CRYPTO_HMAC=y
+# CONFIG_CRYPTO_XCBC is not set
+
+#
+# Digest
+#
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+CONFIG_CRYPTO_SHA1=y
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+
+#
+# Compression
+#
+CONFIG_CRYPTO_DEFLATE=m
+# CONFIG_CRYPTO_LZO is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+# CONFIG_CRYPTO_HW is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_T10DIF is not set
+CONFIG_CRC_ITU_T=m
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
diff --git a/meta-facebook/meta-wedge100/recipes-kernel/linux/linux-aspeed_2.6%.bbappend b/meta-facebook/meta-wedge100/recipes-kernel/linux/linux-aspeed_2.6%.bbappend
new file mode 100644
index 0000000..fd0302e
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-kernel/linux/linux-aspeed_2.6%.bbappend
@@ -0,0 +1,8 @@
+LINUX_VERSION_EXTENSION = "-wedge100"
+
+COMPATIBLE_MACHINE = "wedge100"
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+SRC_URI += "file://defconfig \
+ "
diff --git a/meta-facebook/meta-wedge100/recipes-utils/lm_sensors/files/wedge100.conf b/meta-facebook/meta-wedge100/recipes-utils/lm_sensors/files/wedge100.conf
new file mode 100644
index 0000000..770d343
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-utils/lm_sensors/files/wedge100.conf
@@ -0,0 +1,78 @@
+
+bus "i2c-3" "ast_i2c.3"
+
+bus "i2c-4" "ast_i2c.4"
+
+bus "i2c-8" "ast_i2c.8"
+
+chip "tmp75-i2c-3-48"
+ label temp1 "Outlet Middle Temp"
+ set temp1_max 70
+ set temp1_max_hyst 60
+
+chip "tmp75-i2c-3-49"
+ label temp1 "Inlet Middle Temp"
+ set temp1_max 70
+ set temp1_max_hyst 60
+
+chip "tmp75-i2c-3-4a"
+ label temp1 "Inlet Left Temp"
+ set temp1_max 70
+ set temp1_max_hyst 60
+
+chip "tmp75-i2c-3-4b"
+ label temp1 "Switch Temp"
+ set temp1_max 70
+ set temp1_max_hyst 60
+
+chip "tmp75-i2c-3-4c"
+ label temp1 "Inlet Right Temp"
+ set temp1_max 70
+ set temp1_max_hyst 60
+
+chip "tmp75-i2c-8-48"
+ label temp1 "Outlet Right Temp"
+ set temp1_max 70
+ set temp1_max_hyst 60
+
+chip "tmp75-i2c-8-49"
+ label temp1 "Outlet Left Temp"
+ set temp1_max 70
+ set temp1_max_hyst 60
+
+chip "fancpld-i2c-8-33"
+ label fan1 "Fan 1 front"
+ label fan2 "Fan 1 rear"
+ label fan3 "Fan 2 front"
+ label fan4 "Fan 2 rear"
+ label fan5 "Fan 3 front"
+ label fan6 "Fan 3 rear"
+ label fan7 "Fan 4 front"
+ label fan8 "Fan 4 rear"
+ label fan9 "Fan 5 front"
+ label fan10 "Fan 5 rear"
+
+chip "fb_panther_plus-*"
+ label temp1 "CPU Temp"
+ label temp2 "DIMM0 Temp"
+ ignore temp3
+ ignore temp4
+ ignore temp5
+
+chip "ast_adc-isa-0000"
+ ignore in0
+ ignore in1
+ ignore in2
+ ignore in3
+ ignore in4
+ label in5 "+1 Core Voltage"
+ label in6 "+1 Analog Voltage"
+ label in7 "+5 Voltage"
+ label in8 "+3.3 Voltage"
+ label in9 "+2.5 Voltage"
+ ignore in10
+ ignore in11
+ ignore in12
+ ignore in13
+ ignore in14
+ ignore in15
diff --git a/meta-facebook/meta-wedge100/recipes-utils/lm_sensors/lmsensors_%.bbappend b/meta-facebook/meta-wedge100/recipes-utils/lm_sensors/lmsensors_%.bbappend
new file mode 100644
index 0000000..23a3cc3
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-utils/lm_sensors/lmsensors_%.bbappend
@@ -0,0 +1,10 @@
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+SRC_URI += "file://wedge100.conf \
+ "
+
+do_install_board_config() {
+ install -d ${D}${sysconfdir}/sensors.d
+ install -m 644 ../wedge100.conf ${D}${sysconfdir}/sensors.d/wedge100.conf
+}
diff --git a/meta-facebook/meta-wedge100/recipes-utils/oob-nic/oob-nic_%.bbappend b/meta-facebook/meta-wedge100/recipes-utils/oob-nic/oob-nic_%.bbappend
new file mode 100644
index 0000000..6f46ea6
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-utils/oob-nic/oob-nic_%.bbappend
@@ -0,0 +1,5 @@
+# No OOB NIC on wedge100. Just copy the i2craw
+do_install() {
+ install -d ${D}${sbindir}
+ install -m 755 i2craw ${D}${sbindir}/i2craw
+}
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/board_gpio_rev_table.py b/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/board_gpio_rev_table.py
new file mode 100644
index 0000000..353944e
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/board_gpio_rev_table.py
@@ -0,0 +1,33 @@
+# Copyright 2015-present Facebook. All rights reserved.
+#
+# This program file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program in a file named COPYING; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301 USA
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import print_function
+from __future__ import unicode_literals
+
+from openbmc_gpio_table import BoardGPIO
+
+# The fallowing table is generated using:
+# python wedge100_gpio_parser.py data/wedge100-BMC-gpio.csv
+# DO NOT MODIFY THE TABLE!!!
+# Manual modification will be overridden!!!
+
+board_gpio_rev_table = [
+ BoardGPIO('GPIOY0', 'BOARD_REV_ID0'),
+ BoardGPIO('GPIOY1', 'BOARD_REV_ID1'),
+ BoardGPIO('GPIOY2', 'BOARD_REV_ID2'),
+]
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/board_gpio_table_v1.py b/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/board_gpio_table_v1.py
new file mode 100644
index 0000000..d51bafb
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/board_gpio_table_v1.py
@@ -0,0 +1,107 @@
+# Copyright 2015-present Facebook. All rights reserved.
+#
+# This program file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program in a file named COPYING; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301 USA
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import print_function
+from __future__ import unicode_literals
+
+from openbmc_gpio_table import BoardGPIO
+
+
+# The fallowing table is generated using:
+# python wedge100_gpio_parser.py data/wedge100-BMC-gpio.csv
+# DO NOT MODIFY THE TABLE!!!
+# Manual modification will be overridden!!!
+
+board_gpio_table_v1 = [
+ BoardGPIO('GPIOB0', 'PANTHER_I2C_ALERT_N'),
+ BoardGPIO('GPIOB1', 'MSERV_NIC_SMBUS_ALERT_N'),
+ BoardGPIO('GPIOB2', 'DEBUG_PORT_UART_SEL_N'),
+ BoardGPIO('GPIOB4', 'LED_POSTCODE_4'),
+ BoardGPIO('GPIOB5', 'LED_POSTCODE_5'),
+ BoardGPIO('GPIOB6', 'LED_POSTCODE_6'),
+ BoardGPIO('GPIOB7', 'LED_POSTCODE_7'),
+ BoardGPIO('GPIOC2', 'ISO_BUF_EN'),
+ BoardGPIO('GPIOD0', 'BMC_PWR_BTN_IN_N'),
+ BoardGPIO('GPIOD1', 'BMC_PWR_BTN_OUT_N'),
+ BoardGPIO('GPIOD2', 'BMC_CPLD_RESET1'),
+ BoardGPIO('GPIOD3', 'BMC_CPLD_RESET2'),
+ BoardGPIO('GPIOD4', 'BMC_CPLD_RESET3'),
+ BoardGPIO('GPIOD5', 'BMC_CPLD_RESET4'),
+ BoardGPIO('GPIOD7', 'BMC_CPLD_QSFP_INT'),
+ BoardGPIO('GPIOE0', 'DEBUG_UART_SEL_0'),
+ BoardGPIO('GPIOE2', 'SWITCH_EEPROM1_WRT'),
+ BoardGPIO('GPIOE4', 'ISO_MICROSRV_PRSNT_N'),
+ BoardGPIO('GPIOE5', 'LED_PWR_BLUE'),
+ BoardGPIO('GPIOF0', 'MSERVE_ISOBUF_EN'),
+ BoardGPIO('GPIOF1', 'BMC_MAIN_RESET_N'),
+ BoardGPIO('GPIOF2', 'CPLD_JTAG_SEL'),
+ BoardGPIO('GPIOF4', 'MSERV_POWERUP'),
+ BoardGPIO('GPIOF5', 'RCKMON_RS485_DE'),
+ BoardGPIO('GPIOG0', 'LED_POSTCODE_0'),
+ BoardGPIO('GPIOG1', 'LED_POSTCODE_1'),
+ BoardGPIO('GPIOG2', 'LED_POSTCODE_2'),
+ BoardGPIO('GPIOG3', 'LED_POSTCODE_3'),
+ BoardGPIO('GPIOG4', 'BMC_WDTRST1'),
+ BoardGPIO('GPIOG5', 'BMC_WDTRST2'),
+ BoardGPIO('GPIOH3', 'QSFP_LED_POSITION'),
+ BoardGPIO('GPIOH4', 'PM_SM_ALERT_N'),
+ BoardGPIO('GPIOI4', 'BMC_EEPROM1_SPI_SS'),
+ BoardGPIO('GPIOI5', 'BMC_EEPROM1_SPI_SCK'),
+ BoardGPIO('GPIOI6', 'BMC_EEPROM1_SPI_MOSI'),
+ BoardGPIO('GPIOI7', 'BMC_EEPROM1_SPI_MISO'),
+ BoardGPIO('GPIOJ0', 'RCKMON_SPARE0'),
+ BoardGPIO('GPIOJ1', 'RCKMON_SPARE1'),
+ BoardGPIO('GPIOJ2', 'RCKMON_SPARE2'),
+ BoardGPIO('GPIOJ3', 'RCKMON_SPARE3'),
+ BoardGPIO('GPIOJ4', 'FANCARD_CPLD_TMS'),
+ BoardGPIO('GPIOJ5', 'FANCARD_CPLD_TCK'),
+ BoardGPIO('GPIOJ6', 'FANCARD_CPLD_TDI'),
+ BoardGPIO('GPIOJ7', 'FANCARD_CPLD_TDO'),
+ BoardGPIO('GPIOL5', 'BMC_UART_1_RTS'),
+ BoardGPIO('GPIOM0', 'CPLD_UPD_EN'),
+ BoardGPIO('GPIOM1', 'SMB_ALERT'),
+ BoardGPIO('GPIOM3', 'TH_POWERUP'),
+ BoardGPIO('GPIOM4', 'BMC_CPLD_TMS'),
+ BoardGPIO('GPIOM5', 'BMC_CPLD_TDI'),
+ BoardGPIO('GPIOM6', 'BMC_CPLD_TCK'),
+ BoardGPIO('GPIOM7', 'BMC_CPLD_TDO'),
+ BoardGPIO('GPIOO0', 'RCKMON_SPARE4'),
+ BoardGPIO('GPIOO1', 'RCKMON_SPARE5'),
+ BoardGPIO('GPIOO2', 'RCKMON_SPARE10'),
+ BoardGPIO('GPIOO3', 'RCKMON_SPARE11'),
+ BoardGPIO('GPIOO4', 'RCKMON_SPARE8'),
+ BoardGPIO('GPIOO5', 'RCKMON_SPARE9'),
+ BoardGPIO('GPIOO6', 'RCKMON_SPARE6'),
+ BoardGPIO('GPIOO7', 'RCKMON_SPARE7'),
+ BoardGPIO('GPIOP0', 'RMON1_PF'),
+ BoardGPIO('GPIOP1', 'RMON1_RF'),
+ BoardGPIO('GPIOP2', 'RMON2_PF'),
+ BoardGPIO('GPIOP3', 'RMON2_RF'),
+ BoardGPIO('GPIOP4', 'RMON3_PF'),
+ BoardGPIO('GPIOP5', 'RMON3_RF'),
+ BoardGPIO('GPIOP6', 'FANCARD_I2C_ALARM'),
+ BoardGPIO('GPIOP7', 'BMC_READY_N'),
+ BoardGPIO('GPIOQ4', 'BMC_CPLD_POWER_INT'),
+ BoardGPIO('GPIOQ5', 'BMC_CPLD_SPARE7'),
+ BoardGPIO('GPIOQ6', 'USB_OCS_N1'),
+ BoardGPIO('GPIOQ7', 'BMC_HEARTBEAT_N'),
+ BoardGPIO('GPIOR0', 'SPI_IBMC_BT_CS1_N_R'),
+ BoardGPIO('GPIOR6', 'SWITCH_MDC'),
+ BoardGPIO('GPIOR7', 'SWITCH_MDIO'),
+ BoardGPIO('GPIOS0', 'BMC_SPI_WP_N'),
+]
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/board_gpio_table_v2.py b/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/board_gpio_table_v2.py
new file mode 100644
index 0000000..a95ecf4
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/board_gpio_table_v2.py
@@ -0,0 +1,118 @@
+# Copyright 2015-present Facebook. All rights reserved.
+#
+# This program file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program in a file named COPYING; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301 USA
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import print_function
+from __future__ import unicode_literals
+
+from openbmc_gpio_table import BoardGPIO
+
+
+# The fallowing table is generated using:
+# python wedge100_gpio_parser.py data/wedge100-BMC-gpio.csv
+# DO NOT MODIFY THE TABLE!!!
+# Manual modification will be overridden!!!
+
+board_gpio_table_v2 = [
+ BoardGPIO('GPIOB0', 'PANTHER_I2C_ALERT_N'),
+ BoardGPIO('GPIOB1', 'MSERV_NIC_SMBUS_ALERT_N'),
+ BoardGPIO('GPIOB2', 'DEBUG_PORT_UART_SEL_N'),
+ BoardGPIO('GPIOB5', 'LED_POSTCODE_5'),
+ BoardGPIO('GPIOB6', 'LED_POSTCODE_6'),
+ BoardGPIO('GPIOB7', 'LED_POSTCODE_7'),
+ BoardGPIO('GPIOC2', 'ISO_BUF_EN'),
+ BoardGPIO('GPIOD0', 'BMC_PWR_BTN_IN_N'),
+ BoardGPIO('GPIOD1', 'BMC_PWR_BTN_OUT_N'),
+ BoardGPIO('GPIOD2', 'BMC_CPLD_RESET1'),
+ BoardGPIO('GPIOD3', 'BMC_CPLD_RESET2'),
+ BoardGPIO('GPIOD4', 'BMC_CPLD_RESET3'),
+ BoardGPIO('GPIOD5', 'BMC_CPLD_RESET4'),
+ BoardGPIO('GPIOD7', 'BMC_CPLD_QSFP_INT'),
+ BoardGPIO('GPIOE0', 'DEBUG_UART_SEL_0'),
+ BoardGPIO('GPIOE2', 'SWITCH_EEPROM1_WRT'),
+ BoardGPIO('GPIOE4', 'ISO_MICROSRV_PRSNT_N'),
+ BoardGPIO('GPIOE5', 'LED_PWR_BLUE'),
+ BoardGPIO('GPIOF0', 'MSERVE_ISOBUF_EN'),
+ BoardGPIO('GPIOF1', 'BMC_MAIN_RESET_N'),
+ BoardGPIO('GPIOF2', 'CPLD_JTAG_SEL'),
+ BoardGPIO('GPIOF4', 'MSERV_POWERUP'),
+ BoardGPIO('GPIOF5', 'BMC_UART_4_RTS'),
+ BoardGPIO('GPIOG0', 'LED_POSTCODE_0'),
+ BoardGPIO('GPIOG1', 'LED_POSTCODE_1'),
+ BoardGPIO('GPIOG2', 'LED_POSTCODE_2'),
+ BoardGPIO('GPIOG3', 'LED_POSTCODE_3'),
+ BoardGPIO('GPIOG4', 'BMC_WDTRST1'),
+ BoardGPIO('GPIOG5', 'BMC_WDTRST2'),
+ BoardGPIO('GPIOG6', 'BMC_COM_NIC_ISOBUF_EN'),
+ BoardGPIO('GPIOG7', 'BMC_COM_PANTHER_ISOBUF_EN'),
+ BoardGPIO('GPIOH3', 'QSFP_LED_POSITION'),
+ BoardGPIO('GPIOH4', 'PM_SM_ALERT_N'),
+ BoardGPIO('GPIOI4', 'BMC_EEPROM1_SPI_SS'),
+ BoardGPIO('GPIOI5', 'BMC_EEPROM1_SPI_SCK'),
+ BoardGPIO('GPIOI6', 'BMC_EEPROM1_SPI_MOSI'),
+ BoardGPIO('GPIOI7', 'BMC_EEPROM1_SPI_MISO'),
+ BoardGPIO('GPIOJ0', 'RCKMON_SPARE0'),
+ BoardGPIO('GPIOJ1', 'RCKMON_SPARE1'),
+ BoardGPIO('GPIOJ2', 'RCKMON_SPARE2'),
+ BoardGPIO('GPIOJ3', 'RCKMON_SPARE3'),
+ BoardGPIO('GPIOJ4', 'FANCARD_CPLD_TMS'),
+ BoardGPIO('GPIOJ5', 'FANCARD_CPLD_TCK'),
+ BoardGPIO('GPIOJ6', 'FANCARD_CPLD_TDI'),
+ BoardGPIO('GPIOJ7', 'FANCARD_CPLD_TDO'),
+ BoardGPIO('GPIOL5', 'BMC_UART_1_RTS'),
+ BoardGPIO('GPIOM0', 'CPLD_UPD_EN'),
+ BoardGPIO('GPIOM1', 'SMB_ALERT'),
+ BoardGPIO('GPIOM3', 'TH_POWERUP'),
+ BoardGPIO('GPIOM4', 'BMC_CPLD_TMS'),
+ BoardGPIO('GPIOM5', 'BMC_CPLD_TDI'),
+ BoardGPIO('GPIOM6', 'BMC_CPLD_TCK'),
+ BoardGPIO('GPIOM7', 'BMC_CPLD_TDO'),
+ BoardGPIO('GPION0', 'ISO_COM_SUS_S3_N'),
+ BoardGPIO('GPION1', 'ISO_COM_SUS_S4_N'),
+ BoardGPIO('GPION2', 'ISO_COM_SUS_S5_N'),
+ BoardGPIO('GPION3', 'ISO_COM_SUS_STAT_N'),
+ BoardGPIO('GPION4', 'ISO_COM_BRG_WDT'),
+ BoardGPIO('GPION5', 'BRG_COM_BIOS_DIS0_N'),
+ BoardGPIO('GPION6', 'BRG_COM_BIOS_DIS1_N'),
+ BoardGPIO('GPION7', 'ISO_COM_PWROK'),
+ BoardGPIO('GPIOO0', 'COM_SPI_SEL'),
+ BoardGPIO('GPIOO1', 'COM6_BUF_EN'),
+ BoardGPIO('GPIOO2', 'RCKMON_SPARE4'),
+ BoardGPIO('GPIOO3', 'RCKMON_SPARE5'),
+ BoardGPIO('GPIOO4', 'TPM_SPI_SEL'),
+ BoardGPIO('GPIOO5', 'TPM_SPI_BUF_EN'),
+ BoardGPIO('GPIOO6', 'ISO_BRG_THRMTRIP_N'),
+ BoardGPIO('GPIOO7', 'ISO_BRG_THRM_N'),
+ BoardGPIO('GPIOP0', 'RMON1_PF'),
+ BoardGPIO('GPIOP1', 'RMON1_RF'),
+ BoardGPIO('GPIOP2', 'RMON2_PF'),
+ BoardGPIO('GPIOP3', 'RMON2_RF'),
+ BoardGPIO('GPIOP4', 'RMON3_PF'),
+ BoardGPIO('GPIOP5', 'RMON3_RF'),
+ BoardGPIO('GPIOP6', 'FANCARD_I2C_ALARM'),
+ BoardGPIO('GPIOP7', 'BMC_READY_N'),
+ BoardGPIO('GPIOQ4', 'BMC_CPLD_POWER_INT'),
+ BoardGPIO('GPIOQ5', 'BMC_CPLD_SPARE7'),
+ BoardGPIO('GPIOQ6', 'USB_OCS_N1'),
+ BoardGPIO('GPIOQ7', 'BMC_HEARTBEAT_N'),
+ BoardGPIO('GPIOR0', 'SPI_IBMC_BT_CS1_N_R'),
+ BoardGPIO('GPIOR6', 'SWITCH_MDC'),
+ BoardGPIO('GPIOR7', 'SWITCH_MDIO'),
+ BoardGPIO('GPIOS0', 'BMC_SPI_WP_N'),
+ BoardGPIO('GPIOY3', 'LED_POSTCODE_4'),
+]
+
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/data/wedge100-BMC-GPIO-DVT.csv b/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/data/wedge100-BMC-GPIO-DVT.csv
new file mode 100644
index 0000000..1ded15c
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/data/wedge100-BMC-GPIO-DVT.csv
@@ -0,0 +1,104 @@
+J21,GPIOB0_SALT1,In,PANTHER_I2C_ALERT_N,panther i2c alert_n
+J20,GPIOB1_SALT2,In,MSERV_NIC_SMBUS_ALERT_N,"micro server NIC SMBUS alert_n, active low"
+H18,GPIOB2_SALT3,In,DEBUG_PORT_UART_SEL_N,The DEBUG_PORT_UART_SEL_N is connected to a push button in the front panel. When Debug port select button in Front panel is pressed DEBUG_PORT_UART_SEL_N becomes low.
+E19,GPIOB4_LPCRST_N,Out,LPC_RST_N,Signal to reset LPC
+H19,GPIOB5_LPCPD_N_LPCSMI_N,Out,LED_POSTCODE_5,LED 7-segment code bit-5 for facebook debug header
+H20,GPIOB6_LPCPME_N,Out,LED_POSTCODE_6,LED 7-segment code bit-6 for facebook debug header
+E18,GPIOB7_EXTRST_N_SPICS1_N,Out,LED_POSTCODE_7,LED 7-segment code bit-7 for facebook debug header
+A2,GPIOC2_SD1DAT0_SCL11,Out,ISO_BUF_EN,"reserved for ISO_BUFFER control, in default serial resister is depop, use CPLD to control"
+A18,GPIOD0_SD2CLK,,BMC_PWR_BTN_IN_N,to emulate Microserver power button function using BMC
+D16,GPIOD1_SD2CMD,,BMC_PWR_BTN_OUT_N,
+B17,GPIOD2_SD2DAT0,Out,BMC_CPLD_RESET1,Spare Reset signal connected to CPLD
+A17,GPIOD3_SD2DAT1,Out,BMC_CPLD_RESET2,Spare Reset signal connected to CPLD
+C16,GPIOD4_SD2DAT2,Out,BMC_CPLD_RESET3,Spare Reset signal connected to CPLD (USB_BRDG RST function moved to CPLD)
+B16,GPIOD5_SD2DAT3,Out,BMC_CPLD_RESET4,Spare Reset signal connected to CPLD
+E15,GPIOD7_SD2WP_N,In,BMC_CPLD_QSFP_INT,Intrerrupt from CPLD to BMC for any QSFP events (USB RESET function moved to CPLD)
+D15,GPIOE0_NCTS3,Out,DEBUG_UART_SEL_0,FB debug connector UART select 0: BMC uART 1: microserver UART
+B15,GPIOE2_NDSR3,out,SWITCH_EEPROM1_WRT,"0: BCM5387 SPI interface connect to SPI EEPROM
+1: BCM5387 SPI interface connect to BMC SPI EEPROM interface
+this bit is used as BCM5387 straping configuration too"
+E14,GPIOE4_NDTR3,in,ISO_MICROSRV_PRSNT_N,"0: Microserver is present in PCIe slot
+1: microserver is not present in PCIe slot"
+D14,GPIOE5_NRTS3,out,LED_PWR_BLUE,"Power LED blue will be ON when LED_PWR_BLUE is high.
+Power LED blue will be off when LED_PWR_BLUE is low"
+D18,GPIOF0_NCTS4,Out,MSERVE_ISOBUF_EN,To enable isolation buffer dedicated for microserver com port
+B19,GPIOF1_NDCD4_SIOPBI_N,Out,BMC_MAIN_RESET_N,BMC can request cpld to reset main power
+A20,GPIOF2_NDSR4_SIOPWRGD,Out,CPLD_JTAG_SEL,"SYSCPLD upgrade enable, 0: jtag header program, 1: BMC programming"
+B18,GPIOF4_NDTR4,Out,MSERV_POWERUP,To request cpld to turn on P12_uServer for microserver
+A19,GPIOF5_NRTS4_SIOSCI_N,Out,BMC_UART_4_RTS,BMC com port 4 rts to cpld
+E16,GPIOF6_TXD4,In,BMC_UART_4_TX,BMC com port to cpld
+C17,GPIOF7_RXD4,Out,BMC_UART_4_RX,BMC com port to cpld
+A14,GPIOG0_SGPSCK,Out,LED_POSTCODE_0,LED 7-segment code bit-0 for facebook debug header
+E13,GPIOG1_SGPSLD,Out,LED_POSTCODE_1,LED 7-segment code bit-1 for facebook debug header
+D13,GPIOG2_SGPSI0,Out,LED_POSTCODE_2,LED 7-segment code bit-2 for facebook debug header
+C13,GPIOG3_SGPSI1,Out,LED_POSTCODE_3,LED 7-segment code bit-3 for facebook debug header
+B13,GPIOG4_WDTRST1_OSCCLK,Out,BMC_WDTRST1,Watch dog timer reset1 output from BMC to CPLD
+Y21,GPIOG5_WDTRST2_USBCKI,Out,BMC_WDTRST2,Watch dog timer reset2 output from BMC to CPLD
+AA22,GPIOG6_FLBUSY_N,Out,BMC_COM_NIC_ISOBUF_EN,Active low signal to enable the isolation buffer for SMBUS to COMe
+U18,GPIOG7_FLWP_N,Out,BMC_COM_PANTHER_ISOBUF_EN,Active low signal to enable the isolation buffer for I2C BUS to COMe
+A7,GPIOH3_ROMD11_NRI6,In,QSFP_LED_POSITION,QSFP position select input
+D7,GPIOH4_ROMD12_NDTR6,In,PM_SM_ALERT_N,SM bus alert from power manager (also connected to CPLD)
+C22,GPIOI0_SYSCS_N,Out,BMC_TPM_SPI_CS_N,BMC SPI interface to SPI based TPM
+G18,GPIOI1_SYSCK,Out,BMC_TPM_SPI_CLK,BMC SPI interface to SPI based TPM
+D19,GPIOI2_SYSDO,Out,BMC_TPM_SPI_MOSI,BMC SPI interface to SPI based TPM
+C20,GPIOI3_SYSDI,In,BMC_TPM_SPI_MISO,BMC SPI interface to SPI based TPM
+B22,GPIOI4_SPICS0_N_VBCS_N,Out,BMC_EEPROM1_SPI_SS,"BMC SPI EEPROM interface connect to BCM5387 switch if SWITCH_EEPRM1_WRT is 1, "
+G19,GPIOI5_SPICK_VBCK,Out,BMC_EEPROM1_SPI_SCK,
+C18,GPIOI6_SPIDO_VBDO,Out,BMC_EEPROM1_SPI_MOSI,
+E20,GPIOI7_SPIDI_VBDI,In,BMC_EEPROM1_SPI_MISO,
+J5,GPIOJ0_SGPMCK,Bi,RCKMON_SPARE0,Spare gpios to rack mon card
+J4,GPIOJ1_SGPMLD,Bi,RCKMON_SPARE1,Spare gpios to rack mon card
+K5,GPIOJ2_SGPMO,Bi,RCKMON_SPARE2,Spare gpios to rack mon card
+J3,GPIOJ3_SGPMI,Bi,RCKMON_SPARE3,Spare gpios to rack mon card
+T4,VGAHS_GPIOJ4,,FANCARD_CPLD_TMS,"fancard CPLD JTAG upgrade interface, BMC output to CPLD TMS"
+U2,VGAVS_GPIOJ5,,FANCARD_CPLD_TCK,"fancard CPLD JTAG upgrade interface, BMC output to CPLD TCK"
+T2,DDCCLK_GPIOJ6,,FANCARD_CPLD_TDI,"fancard CPLD JTAG upgrade interface, BMC output to CPLD TDI"
+T1,DDCDAT_GPIOJ7,,FANCARD_CPLD_TDO,"fancard CPLD JTAG upgrade interface, BMC input to CPLD TDO"
+V2,GPIOL5_NRTS1_VPICLK,Out,BMC_UART_1_RTS,connect to SYSCPLD
+W1,GPIOL6_TXD1_VPIB0,Out,BMC_UART_TX_1,connect to SYSCPLD
+U5,GPIOL7_RXD1_VPIB1,In,BMC_UART_RX_1,connect to SYSCPLD
+V3,GPIOM0_NCTS2_VPIB2,Out,CPLD_UPD_EN,"fan_card CPLD upgrade enable, 0: jtag header programming, 1: BMC programming"
+W2,GPIOM1_NDCD2_VPIB3,In,SMB_ALERT,"Alert signal from cpld representing Alert from the power supplies(Vcore,vanlg,3.3)"
+V4,GPIOM3_NRI2_VPIB5,out,TH_POWERUP,"tomahawk power up enable, active high. Connect to CPLD, cpld will control pwr1014a"
+W3,GPIOM4_NDTR2_VPIB6,out,BMC_CPLD_TMS,"SYSCPLD CPLD JTAG upgrade interface, BMC output to SYSCPLD TMS"
+Y2,GPIOM5_NRTS2_VPIB7,out,BMC_CPLD_TDI,"SYSCPLD CPLD JTAG upgrade interface, BMC output to SYSCPLD TDI"
+AA1,GPIOM6_TXD2_VPIB8,out,BMC_CPLD_TCK,"SYSCPLD CPLD JTAG upgrade interface, BMC output to SYSCPLD TCK"
+V5,GPIOM7_RXD2_VPIB9,In,BMC_CPLD_TDO,"SYSCPLD CPLD JTAG upgrade interface, BMC output to SYSCPLD TDO"
+W4,GPION0_PWM0_VPIG0,In,ISO_COM_SUS_S3_N,s3 sleep signal from com(COME Signal)
+Y3,GPION1_PWM1_VPIG1,In,ISO_COM_SUS_S4_N,s4 sleep signal from com (COME Signal)
+AA2,GPION2_PWM2_VPIG2,In,ISO_COM_SUS_S5_N,s5 sleep signal from com (COME Signal)
+AB1,GPION3_PWM3_VPIG3,In,ISO_COM_SUS_STAT_N,suspend status signal from com (COME Signal)
+W5,GPION4_PWM4_VPIG4,In,ISO_COM_BRG_WDT,watch dog timer output from com(COME Signal)
+Y4,GPION5_PWM5_VPIG5,Out,BRG_COM_BIOS_DIS0_N,BMC can select the bootdevice of COM (COME Signal)
+AA3,GPION6_PWM6_VPIG6,Out,BRG_COM_BIOS_DIS1_N,BMC can select the bootdevice of COM (COME Signal)
+AB2,GPION7_PWM7_VPIG7,Out,ISO_COM_PWROK,com power ok signal from BMC (COME Signal)
+V6,GPIOO0_TACH0_VPIG8,Out,COM_SPI_SEL,"override signal from bmc to select bmc to upgrade com eeprom
+0:On board spi flash
+1:BMC can write into SPI flash"
+Y5,GPIOO1_TACH1_VPIG9,Out,COM6_BUF_EN,Active low signal to enable isolation buffer dedicated for com signals
+AA4,GPIOO2_TACH2_VPIR0,BI,RCKMON_SPARE4,RCKMON_SPARE[0:11] connect to fan_ctrl_rmon card connector
+AB3,GPIOO3_TACH3_VPIR1,BI,RCKMON_SPARE5,RCKMON_SPARE[0:11] connect to fan_ctrl_rmon card connector
+W6,GPIOO4_TACH4_VPIR2,Out,TPM_SPI_SEL,Signal from BMC to select whether BMC or COM SPI should go to TPM module. By default COM SPI is Selected. BMC can drive this signal high to select SPI from BMC
+AA5,GPIOO5_TACH5_VPIR3,Out,TPM_SPI_BUF_EN,Signal from BMC to enable or disable the MUX which selects BMC or COM SPI to TPM module. Default the MUX is enabled .BMC can drive high to disable it.
+AB4,GPIOO6_TACH6_VPIR4,In,ISO_BRG_THRMTRIP_N,"Active low Signal from COM to indicate processor over heating ,and com will go into s5 state (COME Signal)"
+V7,GPIOO7_TACH7_VPIR5,Out,ISO_BRG_THRM_N,Active low Signal from BMC to indicate overtemperature (COME Signal)
+Y6,GPIOP0_TACH8_VPIR6,In,RMON1_PF,"rack 1 monitor status, Power Failure, active low"
+AB5,GPIOP1_TACH9_VPIR7,In,RMON1_RF,"rack 1 monitor status, redudancy Failure, active low"
+W7,GPIOP2_TACH10_VPIR8,In,RMON2_PF,"rack 2 monitor status, Power Failure, active low"
+AA6,GPIOP3_TACH11_VPIR9,In,RMON2_RF,"rack 2 monitor status, redudancy Failure, active low"
+AB6,GPIOP4_TACH12,In,RMON3_PF,"rack 3 monitor status, Power Failure, active low"
+Y7,GPIOP5_TACH13,In,RMON3_RF,"rack 3 monitor status, redudancy Failure, active low"
+AA7,GPIOP6_TACH14_BMCINT,In,FANCARD_I2C_ALARM,"fan card alarm input, active low"
+AB7,GPIOP7_TACH15_FLACK,out,BMC_READY_N,"0: BMC is ready for service. 1: BMC is not ready, or during initialization"
+H4,GPIOQ4_SCL14,In,BMC_CPLD_POWER_INT,Intrerrupt from CPLD to BMC for any Power events
+H3,GPIOQ5_SDA14,,BMC_CPLD_SPARE7,Spare GPIOs to CPLD
+H2,GPIOQ6,out,USB_OCS_N1,over-current sense output to USB2513 hub
+H1,GPIOQ7,out,BMC_HEARTBEAT_N,BMC heatbeat output to onboard heartbeat LED
+V20,GPIOR0_ROMCS1_N,out,SPI_IBMC_BT_CS1_N_R,chip select to secondary boot SPI flash
+C6,GPIOR6_MDC1,BI,SWITCH_MDC,MDC/MDIO to GE Switch
+A5,GPIOR7_MDIO1,BI,SWITCH_MDIO,
+U21,ROMD4_GPIOS0_VPODE,Out,BMC_SPI_WP_N,Write protect for Secondary Boot Flash. Connected to CPLD. CPLD will drive it to the flash chip
+C21,GPIOY0_SIOS3_N,In,BOARD_REV_ID0,"Board ID input bit0, resister straping, connect to both BMC and CPLD"
+F20,GPIOY1_SIOS5_N,In,BOARD_REV_ID1,"Board ID input bit1, resister straping, connect to both BMC and CPLD"
+G20,GPIOY2_SIOPWREQ_N,In,BOARD_REV_ID2,"Board ID input bit2, resister straping, connect to both BMC and CPLD"
+K20,GPIOY3_SIOONCTRL_N,,LED_POSTCODE_4,LED 7-segment code bit-4 for facebook debug header \ No newline at end of file
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/data/wedge100-BMC-GPIO-EVT.csv b/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/data/wedge100-BMC-GPIO-EVT.csv
new file mode 100644
index 0000000..781d739
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/data/wedge100-BMC-GPIO-EVT.csv
@@ -0,0 +1,83 @@
+J21,GPIOB0_SALT1,In,PANTHER_I2C_ALERT_N,panther i2c alert_n
+J20,GPIOB1_SALT2,In,MSERV_NIC_SMBUS_ALERT_N,"micro server NIC SMBUS alert_n, active low"
+H18,GPIOB2_SALT3,In,DEBUG_PORT_UART_SEL_N,The DEBUG_PORT_UART_SEL_N is connected to a push button in the front panel. When Debug port select button in Front panel is pressed DEBUG_PORT_UART_SEL_N becomes low.
+E19,GPIOB4_LPCRST_N,Out,LED_POSTCODE_4,LED 7-segment code bit-4 for facebook debug header
+H19,GPIOB5_LPCPD_N_LPCSMI_N,Out,LED_POSTCODE_5,LED 7-segment code bit-5 for facebook debug header
+H20,GPIOB6_LPCPME_N,Out,LED_POSTCODE_6,LED 7-segment code bit-6 for facebook debug header
+E18,GPIOB7_EXTRST_N_SPICS1_N,Out,LED_POSTCODE_7,LED 7-segment code bit-7 for facebook debug header
+A2,GPIOC2_SD1DAT0_SCL11,Out,ISO_BUF_EN,"reserved for ISO_BUFFER control, in default serial resister is depop, use CPLD to control"
+A18,GPIOD0_SD2CLK,,BMC_PWR_BTN_IN_N,to emulate Microserver power button function using BMC
+D16,GPIOD1_SD2CMD,,BMC_PWR_BTN_OUT_N,
+B17,GPIOD2_SD2DAT0,Out,BMC_CPLD_RESET1,Spare Reset signal connected to CPLD
+A17,GPIOD3_SD2DAT1,Out,BMC_CPLD_RESET2,Spare Reset signal connected to CPLD
+C16,GPIOD4_SD2DAT2,Out,BMC_CPLD_RESET3,Spare Reset signal connected to CPLD (USB_BRDG RST function moved to CPLD)
+B16,GPIOD5_SD2DAT3,Out,BMC_CPLD_RESET4,Spare Reset signal connected to CPLD
+E15,GPIOD7_SD2WP_N,In,BMC_CPLD_QSFP_INT,Intrerrupt from CPLD to BMC for any QSFP events (USB RESET function moved to CPLD)
+D15,GPIOE0_NCTS3,Out,DEBUG_UART_SEL_0,FB debug connector UART select 0: BMC uART 1: microserver UART
+B15,GPIOE2_NDSR3,out,SWITCH_EEPROM1_WRT,"0: BCM5387 SPI interface connect to SPI EEPROM
+1: BCM5387 SPI interface connect to BMC SPI EEPROM interface
+this bit is used as BCM5387 straping configuration too"
+E14,GPIOE4_NDTR3,in,ISO_MICROSRV_PRSNT_N,"0: Microserver is present in PCIe slot
+1: microserver is not present in PCIe slot"
+D14,GPIOE5_NRTS3,out,LED_PWR_BLUE,"Power LED blue will be ON when LED_PWR_BLUE is high.
+Power LED blue will be off when LED_PWR_BLUE is low"
+D18,GPIOF0_NCTS4,Out,MSERVE_ISOBUF_EN,To enable isolation buffer dedicated for microserver com port
+B19,GPIOF1_NDCD4_SIOPBI_N,Out,BMC_MAIN_RESET_N,BMC can request cpld to reset main power
+A20,GPIOF2_NDSR4_SIOPWRGD,Out,CPLD_JTAG_SEL,"SYSCPLD upgrade enable, 0: jtag header program, 1: BMC programming"
+B18,GPIOF4_NDTR4,Out,MSERV_POWERUP,To request cpld to turn on P12_uServer for microserver
+A19,GPIOF5_NRTS4,Out,RCKMON_RS485_DE,RS485 Drive Enable (TX/RX Toggle) pin for rackmon
+A14,GPIOG0_SGPSCK,Out,LED_POSTCODE_0,LED 7-segment code bit-0 for facebook debug header
+E13,GPIOG1_SGPSLD,Out,LED_POSTCODE_1,LED 7-segment code bit-1 for facebook debug header
+D13,GPIOG2_SGPSI0,Out,LED_POSTCODE_2,LED 7-segment code bit-2 for facebook debug header
+C13,GPIOG3_SGPSI1,Out,LED_POSTCODE_3,LED 7-segment code bit-3 for facebook debug header
+B13,GPIOG4_WDTRST1_OSCCLK,Out,BMC_WDTRST1,Watch dog timer reset1 output from BMC to CPLD
+Y21,GPIOG5_WDTRST2_USBCKI,Out,BMC_WDTRST2,Watch dog timer reset2 output from BMC to CPLD
+A7,GPIOH3_ROMD11_NRI6,In,QSFP_LED_POSITION,QSFP position select input
+D7,GPIOH4_ROMD12_NDTR6,In,PM_SM_ALERT_N,SM bus alert from power manager (also connected to CPLD)
+B22,GPIOI4_SPICS0_N_VBCS_N,Out,BMC_EEPROM1_SPI_SS,"BMC SPI EEPROM interface connect to BCM5387 switch if SWITCH_EEPRM1_WRT is 1, "
+G19,GPIOI5_SPICK_VBCK,Out,BMC_EEPROM1_SPI_SCK,
+C18,GPIOI6_SPIDO_VBDO,Out,BMC_EEPROM1_SPI_MOSI,
+E20,GPIOI7_SPIDI_VBDI,In,BMC_EEPROM1_SPI_MISO,
+J5,GPIOJ0_SGPMCK,Bi,RCKMON_SPARE0,Spare gpios to rack mon card
+J4,GPIOJ1_SGPMLD,Bi,RCKMON_SPARE1,Spare gpios to rack mon card
+K5,GPIOJ2_SGPMO,Bi,RCKMON_SPARE2,Spare gpios to rack mon card
+J3,GPIOJ3_SGPMI,Bi,RCKMON_SPARE3,Spare gpios to rack mon card
+T4,VGAHS_GPIOJ4,,FANCARD_CPLD_TMS,"fancard CPLD JTAG upgrade interface, BMC output to CPLD TMS"
+U2,VGAVS_GPIOJ5,,FANCARD_CPLD_TCK,"fancard CPLD JTAG upgrade interface, BMC output to CPLD TCK"
+T2,DDCCLK_GPIOJ6,,FANCARD_CPLD_TDI,"fancard CPLD JTAG upgrade interface, BMC output to CPLD TDI"
+T1,DDCDAT_GPIOJ7,,FANCARD_CPLD_TDO,"fancard CPLD JTAG upgrade interface, BMC input to CPLD TDO"
+V2,GPIOL5_NRTS1_VPICLK,Out,BMC_UART_1_RTS,connect to SYSCPLD
+V3,GPIOM0_NCTS2_VPIB2,Out,CPLD_UPD_EN,"fan_card CPLD upgrade enable, 0: jtag header programming, 1: BMC programming"
+W2,GPIOM1_NDCD2_VPIB3,In,SMB_ALERT,"Alert signal from cpld representing Alert from the power supplies(Vcore,vanlg,3.3)"
+V4,GPIOM3_NRI2_VPIB5,out,TH_POWERUP,"tomahawk power up enable, active high. Connect to CPLD, cpld will control pwr1014a"
+W3,GPIOM4_NDTR2_VPIB6,out,BMC_CPLD_TMS,"SYSCPLD CPLD JTAG upgrade interface, BMC output to SYSCPLD TMS"
+Y2,GPIOM5_NRTS2_VPIB7,out,BMC_CPLD_TDI,"SYSCPLD CPLD JTAG upgrade interface, BMC output to SYSCPLD TDI"
+AA1,GPIOM6_TXD2_VPIB8,out,BMC_CPLD_TCK,"SYSCPLD CPLD JTAG upgrade interface, BMC output to SYSCPLD TCK"
+V5,GPIOM7_RXD2_VPIB9,In,BMC_CPLD_TDO,"SYSCPLD CPLD JTAG upgrade interface, BMC output to SYSCPLD TDO"
+V6,GPIOO0_TACH0_VPIG8,BI,RCKMON_SPARE4,RCKMON_SPARE[0:11] connect to fan_ctrl_rmon card connector
+Y5,GPIOO1_TACH1_VPIG9,BI,RCKMON_SPARE5,RCKMON_SPARE[0:11] connect to fan_ctrl_rmon card connector
+AA4,GPIOO2_TACH2_VPIR0,BI,RCKMON_SPARE10,RCKMON_SPARE[0:11] connect to fan_ctrl_rmon card connector(now not connected)
+AB3,GPIOO3_TACH3_VPIR1,BI,RCKMON_SPARE11,RCKMON_SPARE[0:11] connect to fan_ctrl_rmon card connector(now not connected)
+W6,GPIOO4_TACH4_VPIR2,BI,RCKMON_SPARE8,RCKMON_SPARE[0:11] connect to fan_ctrl_rmon card connector(now not connected)
+AA5,GPIOO5_TACH5_VPIR3,BI,RCKMON_SPARE9,RCKMON_SPARE[0:11] connect to fan_ctrl_rmon card connector(now not connected)
+AB4,GPIOO6_TACH6_VPIR4,BI,RCKMON_SPARE6,RCKMON_SPARE[0:11] connect to fan_ctrl_rmon card connector(now not connected)
+V7,GPIOO7_TACH7_VPIR5,BI,RCKMON_SPARE7,RCKMON_SPARE[0:11] connect to fan_ctrl_rmon card connector(now not connected)
+Y6,GPIOP0_TACH8_VPIR6,In,RMON1_PF,"rack 1 monitor status, Power Failure, active low"
+AB5,GPIOP1_TACH9_VPIR7,In,RMON1_RF,"rack 1 monitor status, redudancy Failure, active low"
+W7,GPIOP2_TACH10_VPIR8,In,RMON2_PF,"rack 2 monitor status, Power Failure, active low"
+AA6,GPIOP3_TACH11_VPIR9,In,RMON2_RF,"rack 2 monitor status, redudancy Failure, active low"
+AB6,GPIOP4_TACH12,In,RMON3_PF,"rack 3 monitor status, Power Failure, active low"
+Y7,GPIOP5_TACH13,In,RMON3_RF,"rack 3 monitor status, redudancy Failure, active low"
+AA7,GPIOP6_TACH14_BMCINT,In,FANCARD_I2C_ALARM,"fan card alarm input, active low"
+AB7,GPIOP7_TACH15_FLACK,out,BMC_READY_N,"0: BMC is ready for service. 1: BMC is not ready, or during initialization"
+H4,GPIOQ4_SCL14,In,BMC_CPLD_POWER_INT,Intrerrupt from CPLD to BMC for any Power events
+H3,GPIOQ5_SDA14,,BMC_CPLD_SPARE7,Spare GPIOs to CPLD
+H2,GPIOQ6,out,USB_OCS_N1,over-current sense output to USB2513 hub
+H1,GPIOQ7,out,BMC_HEARTBEAT_N,BMC heatbeat output to onboard heartbeat LED
+C6,GPIOR6_MDC1,BI,SWITCH_MDC,MDC/MDIO to GE Switch
+A5,GPIOR7_MDIO1,BI,SWITCH_MDIO,
+V20,GPIOR0_ROMCS1_N,out,SPI_IBMC_BT_CS1_N_R,chip select to secondary boot SPI flash
+U21,ROMD4_GPIOS0_VPODE,Out,BMC_SPI_WP_N,Write protect for Secondary Boot Flash. Connected to CPLD. CPLD will drive it to the flash chip
+C21,GPIOY0_SIOS3_N,In,BOARD_REV_ID0,"Board ID input bit0, resister straping, connect to both BMC and CPLD"
+F20,GPIOY1_SIOS5_N,In,BOARD_REV_ID1,"Board ID input bit1, resister straping, connect to both BMC and CPLD"
+G20,GPIOY2_SIOPWREQ_N,In,BOARD_REV_ID2,"Board ID input bit2, resister straping, connect to both BMC and CPLD"
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/openbmc_gpio_setup.py b/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/openbmc_gpio_setup.py
new file mode 100644
index 0000000..dd14763
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/openbmc_gpio_setup.py
@@ -0,0 +1,75 @@
+#!/usr/bin/python -tt
+# Copyright 2015-present Facebook. All rights reserved.
+#
+# This program file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program in a file named COPYING; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301 USA
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import print_function
+from __future__ import unicode_literals
+
+from board_gpio_rev_table import board_gpio_rev_table
+from board_gpio_table_v1 import board_gpio_table_v1
+from board_gpio_table_v2 import board_gpio_table_v2
+from soc_gpio_table import soc_gpio_table
+from openbmc_gpio_table import setup_board_gpio
+from soc_gpio import soc_get_register
+
+import openbmc_gpio
+import sys
+
+def set_register():
+ '''
+ For DVT/EVT boards the framework is not able to handle for GPIOS0 and
+ causes error : 'Failed to configure "GPIOS0" for "BMC_SPI_WP_N":
+ Not able to unsatisfy an AND condition'. In order to fix the error
+ set the specific bit in the register so the framework can handle it.
+ '''
+ l_reg = soc_get_register(0x8C)
+ l_reg.clear_bit(0, write_through=True)
+
+def wedge_board_rev(soc_gpio_table, board_gpio_rev_table):
+ # Setup to read revision
+ setup_board_gpio(soc_gpio_table, board_gpio_rev_table)
+ # Read the gpio values
+ v0 = openbmc_gpio.gpio_get('BOARD_REV_ID0')
+ v1 = openbmc_gpio.gpio_get('BOARD_REV_ID1')
+ v2 = openbmc_gpio.gpio_get('BOARD_REV_ID2')
+ return ((v2 << 2) | (v1 << 1) | v0)
+
+def main():
+ print('Setting up GPIOs ... ', end='')
+ sys.stdout.flush()
+ openbmc_gpio.setup_shadow()
+ version = wedge_board_rev(soc_gpio_table,board_gpio_rev_table)
+ # In order to satisy/unsatisfy conditions in setup_board_gpio()
+ # modify the registers
+ set_register()
+ if version is 1:
+ print('Using GPIO EVT table ', end='')
+ setup_board_gpio(soc_gpio_table, board_gpio_table_v1)
+ else:
+ if version is 2:
+ print('Using GPIO DVT table ', end='')
+ else:
+ print('Unexpected board version %s. Using GPIO DVT table. '
+ % version, end='')
+ setup_board_gpio(soc_gpio_table, board_gpio_table_v2)
+ print('Done')
+ sys.stdout.flush()
+ return 0
+
+if __name__ == '__main__':
+ sys.exit(main())
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/setup_board.py b/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/setup_board.py
new file mode 100644
index 0000000..bb6ccb1
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/setup_board.py
@@ -0,0 +1,22 @@
+# Copyright 2015-present Facebook. All rights reserved.
+#
+# This program file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program in a file named COPYING; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301 USA
+
+board_py_modules=[
+ 'board_gpio_table_v1',
+ 'board_gpio_table_v2',
+ 'board_gpio_rev_table',
+]
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/wedge100_gpio_parse.py b/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/wedge100_gpio_parse.py
new file mode 100644
index 0000000..b53f9de
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/files/wedge100_gpio_parse.py
@@ -0,0 +1,102 @@
+#!/usr/bin/python -tt
+# Copyright 2015-present Facebook. All Rights Reserved.
+#
+# This program file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program in a file named COPYING; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301 USA
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import print_function
+from __future__ import unicode_literals
+
+import argparse
+import csv
+import logging
+import re
+import sys
+
+
+GPIO_SYMBOL = 'BoardGPIO'
+
+
+class CsvReader:
+ '''
+ A class for parsing the CSV files containing the board GPIO config
+ '''
+ def __init__(self, path):
+ self.path = path
+
+ fileobj = open(path, 'r')
+ self.reader = csv.reader(fileobj, delimiter=b',', quotechar=b'"')
+
+ def next(self):
+ try:
+ line = self.reader.next()
+ except StopIteration:
+ return None
+ return line
+
+
+class WedgeGPIO(object):
+ def __init__(self, data):
+ self.data = data
+ self.gpios = {}
+ self.names = set()
+
+ def parse(self):
+ while True:
+ line = self.data.next()
+ if line is None:
+ break
+
+ logging.debug('Parsing line: %s' % line)
+
+ if len(line) < 4:
+ logging.error('No enough fields in "%s". Skip!' % line)
+ continue
+
+ gpio = None
+ for part in line[1].split('_'):
+ if part.startswith('GPIO'):
+ gpio = part
+ break
+ if gpio is None:
+ logging.error('Cannot find GPIO file from "%s". Skip!' % line)
+ continue
+
+ name = line[3]
+ assert gpio not in self.gpios and name not in self.names
+ self.gpios[gpio] = name
+ self.names.add(name)
+
+ def print(self, out):
+ for gpio in sorted(self.gpios):
+ out.write(' %s(\'%s\', \'%s\'),\n'
+ % (GPIO_SYMBOL, gpio, self.gpios[gpio]))
+
+
+def main():
+ ap = argparse.ArgumentParser()
+ ap.add_argument('data', help='The GPIO data file')
+ args = ap.parse_args()
+
+ logging.basicConfig(level=logging.INFO, format='%(asctime)s: %(message)s')
+
+ gpio = WedgeGPIO(CsvReader(args.data))
+ gpio.parse()
+ gpio.print(sys.stdout)
+
+
+rc = main()
+sys.exit(rc)
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/openbmc-gpio_%.bbappend b/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/openbmc-gpio_%.bbappend
new file mode 100644
index 0000000..afc133a
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-utils/openbmc-gpio/openbmc-gpio_%.bbappend
@@ -0,0 +1,36 @@
+# Copyright 2014-present Facebook. All Rights Reserved.
+#
+# This program file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program in a file named COPYING; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301 USA
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+SRC_URI += " \
+ file://board_gpio_table_v1.py \
+ file://board_gpio_table_v2.py \
+ file://board_gpio_rev_table.py \
+ file://openbmc_gpio_setup.py \
+ file://setup_board.py \
+ "
+OPENBMC_GPIO_SOC_TABLE = "ast2400_gpio_table.py"
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/init.d
+ install -d ${D}${sysconfdir}/rcS.d
+ install -m 755 openbmc_gpio_setup.py ${D}${sysconfdir}/init.d/openbmc_gpio_setup.py
+ update-rc.d -r ${D} openbmc_gpio_setup.py start 59 S .
+}
+
+FILES_${PN} += "/usr/local/bin ${sysconfdir}"
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/COPYING b/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/COPYING
new file mode 100644
index 0000000..3912109
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/board-utils.sh b/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/board-utils.sh
new file mode 100644
index 0000000..a999a9c
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/board-utils.sh
@@ -0,0 +1,81 @@
+# Copyright 2015-present Facebook. All Rights Reserved.
+
+SYSCPLD_SYSFS_DIR="/sys/class/i2c-adapter/i2c-12/12-0031"
+PWR_MAIN_SYSFS="${SYSCPLD_SYSFS_DIR}/pwr_main_n"
+PWR_USRV_SYSFS="${SYSCPLD_SYSFS_DIR}/pwr_usrv_en"
+PWR_USRV_BTN_SYSFS="${SYSCPLD_SYSFS_DIR}/pwr_usrv_btn_en"
+SLOTID_SYSFS="${SYSCPLD_SYSFS_DIR}/slotid"
+
+wedge_iso_buf_enable() {
+ # TODO, no isolation buffer
+ return 0
+}
+
+wedge_iso_buf_disable() {
+ # TODO, no isolation buffer
+ return 0
+}
+
+wedge_is_us_on() {
+ local val n retries prog
+ if [ $# -gt 0 ]; then
+ retries="$1"
+ else
+ retries=1
+ fi
+ if [ $# -gt 1 ]; then
+ prog="$2"
+ else
+ prog=""
+ fi
+ if [ $# -gt 2 ]; then
+ default=$3 # value 0 means defaul is 'ON'
+ else
+ default=1
+ fi
+ val=$(cat $PWR_USRV_SYSFS 2> /dev/null | head -n 1)
+ if [ -z "$val" ]; then
+ return $default
+ elif [ "$val" == "0x1" ]; then
+ return 0 # powered on
+ else
+ return 1
+ fi
+}
+
+wedge_board_type() {
+ echo 'WEDGE100'
+}
+
+wedge_slot_id() {
+ printf "%d\n" $(cat $SLOTID_SYSFS)
+}
+
+wedge_board_rev() {
+ local val0 val1 val2
+ val0=$(gpio_get BOARD_REV_ID0)
+ val1=$(gpio_get BOARD_REV_ID1)
+ val2=$(gpio_get BOARD_REV_ID2)
+ echo $((val0 | (val1 << 1) | (val2 << 2)))
+}
+
+# Should we enable OOB interface or not
+wedge_should_enable_oob() {
+ # wedge100 uses BMC MAC since beginning
+ return -1
+}
+
+wedge_power_on_board() {
+ local val
+ # power on main power, uServer power, and enable power button
+ val=$(cat $PWR_MAIN_SYSFS | head -n 1)
+ if [ "$val" != "0x1" ]; then
+ echo 1 > $PWR_MAIN_SYSFS
+ sleep 2
+ fi
+ val=$(cat $PWR_USRV_BTN_SYSFS | head -n 1)
+ if [ "$val" != "0x1" ]; then
+ echo 1 > $PWR_USRV_BTN_SYSFS
+ sleep 1
+ fi
+}
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/disable_watchdog.sh b/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/disable_watchdog.sh
new file mode 100644
index 0000000..07826d6
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/disable_watchdog.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+. /usr/local/bin/openbmc-utils.sh
+
+# Disable the dual boot watch dog
+devmem_clear_bit 0x1e78502c 0
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/power-on.sh b/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/power-on.sh
new file mode 100644
index 0000000..1f22dcf
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/power-on.sh
@@ -0,0 +1,51 @@
+#!/bin/sh
+#
+# Copyright 2014-present Facebook. All Rights Reserved.
+#
+# This program file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program in a file named COPYING; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301 USA
+
+### BEGIN INIT INFO
+# Provides: power-on
+# Required-Start:
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+# Short-Description: Power on micro-server
+### END INIT INFO
+. /usr/local/bin/openbmc-utils.sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
+
+# make power button high to prepare for power on sequence
+gpio_set BMC_PWR_BTN_OUT_N 1
+
+# First power on TH, and if Panther+ is used,
+# provide standby power to Panther+.
+wedge_power_on_board
+
+echo -n "Checking microserver power status ... "
+if wedge_is_us_on 10 "."; then
+ echo "on"
+ on=1
+else
+ echo "off"
+ on=0
+fi
+
+if [ $on -eq 0 ]; then
+ # Power on now
+ wedge_power.sh on -f
+fi
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/wedge_power.sh b/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/wedge_power.sh
new file mode 100644
index 0000000..0ad93e6
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/wedge_power.sh
@@ -0,0 +1,187 @@
+#!/bin/bash
+#
+# Copyright 2015-present Facebook. All Rights Reserved.
+#
+# This program file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program in a file named COPYING; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+
+. /usr/local/bin/openbmc-utils.sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
+
+prog="$0"
+
+PWR_BTN_GPIO="BMC_PWR_BTN_OUT_N"
+PWR_SYSTEM_SYSFS="${SYSCPLD_SYSFS_DIR}/pwr_cyc_all_n"
+PWR_USRV_RST_SYSFS="${SYSCPLD_SYSFS_DIR}/usrv_rst_n"
+
+usage() {
+ echo "Usage: $prog <command> [command options]"
+ echo
+ echo "Commands:"
+ echo " status: Get the current microserver power status"
+ echo
+ echo " on: Power on microserver if not powered on already"
+ echo " options:"
+ echo " -f: Re-do power on sequence no matter if microserver has "
+ echo " been powered on or not."
+ echo
+ echo " off: Power off microserver ungracefully"
+ echo
+ echo " reset: Power reset microserver ungracefully"
+ echo " options:"
+ echo " -s: Power reset whole wedge system ungracefully"
+ echo
+}
+
+do_status() {
+ echo -n "Microserver power is "
+ if wedge_is_us_on; then
+ echo "on"
+ else
+ echo "off"
+ fi
+ return 0
+}
+
+do_on_com_e() {
+ echo 1 > $PWR_USRV_SYSFS
+ return $?
+}
+
+do_on() {
+ local force opt ret
+ force=0
+ while getopts "f" opt; do
+ case $opt in
+ f)
+ force=1
+ ;;
+ *)
+ usage
+ exit -1
+ ;;
+
+ esac
+ done
+ echo -n "Power on microserver ..."
+ if [ $force -eq 0 ]; then
+ # need to check if uS is on or not
+ if wedge_is_us_on 10 "."; then
+ echo " Already on. Skip!"
+ return 1
+ fi
+ fi
+
+ # power on sequence
+ do_on_com_e
+ ret=$?
+ if [ $ret -eq 0 ]; then
+ echo " Done"
+ else
+ echo " Failed"
+ fi
+ return $ret
+}
+
+do_off_com_e() {
+ echo 0 > $PWR_USRV_SYSFS
+ return $?
+}
+
+do_off() {
+ local ret
+ echo -n "Power off microserver ..."
+ do_off_com_e
+ ret=$?
+ if [ $ret -eq 0 ]; then
+ echo " Done"
+ else
+ echo " Failed"
+ fi
+ return $ret
+}
+
+do_reset() {
+ local system opt pulse_us
+ system=0
+ while getopts "s" opt; do
+ case $opt in
+ s)
+ system=1
+ ;;
+ *)
+ usage
+ exit -1
+ ;;
+ esac
+ done
+ if [ $system -eq 1 ]; then
+ pulse_us=100000 # 100ms
+ echo -n "Power reset whole system ..."
+ sleep 1
+ echo 0 > $PWR_SYSTEM_SYSFS
+ # Echo 0 above should work already. However, after CPLD upgrade,
+ # We need to re-generate the pulse to make this work
+ usleep $pulse_us
+ echo 1 > $PWR_SYSTEM_SYSFS
+ usleep $pulse_us
+ echo 0 > $PWR_SYSTEM_SYSFS
+ usleep $pulse_us
+ echo 1 > $PWR_SYSTEM_SYSFS
+ else
+ if ! wedge_is_us_on; then
+ echo "Power resetting microserver that is powered off has no effect."
+ echo "Use '$prog on' to power the microserver on"
+ return -1
+ fi
+ echo -n "Power reset microserver ..."
+ echo 0 > $PWR_USRV_RST_SYSFS
+ sleep 1
+ echo 1 > $PWR_USRV_RST_SYSFS
+ fi
+ echo " Done"
+ return 0
+}
+
+if [ $# -lt 1 ]; then
+ usage
+ exit -1
+fi
+
+command="$1"
+shift
+
+case "$command" in
+ status)
+ do_status $@
+ ;;
+ on)
+ do_on $@
+ ;;
+ off)
+ do_off $@
+ ;;
+ reset)
+ do_reset $@
+ ;;
+ *)
+ usage
+ exit -1
+ ;;
+esac
+
+exit $?
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/wedge_us_mac.sh b/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/wedge_us_mac.sh
new file mode 100644
index 0000000..8ad2fec
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/wedge_us_mac.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+#
+# Copyright 2015-present Facebook. All Rights Reserved.
+#
+# This program file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program in a file named COPYING; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
+
+. /usr/local/bin/openbmc-utils.sh
+
+if ! wedge_is_us_on; then
+ echo "Cannot retrive microserver MAC when microserver is powered off." 1>&2
+ exit -2
+fi
+
+mac=$(i2cdump -f -y 0x4 0x33 b 2> /dev/null | grep '^50: '| awk '{ printf "%s:%s:%s:%s:%s:%s\n", $2, $3, $4, $5, $6, $7 }')
+
+if [ -n "$mac" -a "${mac/X/}" = "${mac}" ]; then
+ echo $mac
+ exit 0
+else
+ echo "Cannot find out the microserver MAC" 1>&2
+ exit -1
+fi
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/openbmc-utils_%.bbappend b/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/openbmc-utils_%.bbappend
new file mode 100644
index 0000000..87db374
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/openbmc-utils_%.bbappend
@@ -0,0 +1,64 @@
+# Copyright 2015-present Facebook. All Rights Reserved.
+#
+# This program file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program in a file named COPYING; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301 USA
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+SRC_URI += "file://disable_watchdog.sh \
+ file://board-utils.sh \
+ "
+
+OPENBMC_UTILS_FILES += " \
+ disable_watchdog.sh \
+ "
+
+DEPENDS_append = " update-rc.d-native"
+
+do_install_board() {
+ # for backward compatible, create /usr/local/fbpackages/utils/ast-functions
+ olddir="/usr/local/fbpackages/utils"
+ install -d ${D}${olddir}
+ ln -s "/usr/local/bin/openbmc-utils.sh" "${D}${olddir}/ast-functions"
+
+ # common lib and include files
+ install -d ${D}${includedir}/facebook
+ install -m 0644 src/include/i2c-dev.h ${D}${includedir}/facebook/i2c-dev.h
+
+ # init
+ install -d ${D}${sysconfdir}/init.d
+ install -d ${D}${sysconfdir}/rcS.d
+ # the script to mount /mnt/data
+ install -m 0755 ${WORKDIR}/mount_data0.sh ${D}${sysconfdir}/init.d/mount_data0.sh
+ update-rc.d -r ${D} mount_data0.sh start 03 S .
+ install -m 0755 ${WORKDIR}/rc.early ${D}${sysconfdir}/init.d/rc.early
+ update-rc.d -r ${D} rc.early start 04 S .
+
+ # networking is done after rcS, any start level within rcS
+ # for mac fixup should work
+ install -m 755 eth0_mac_fixup.sh ${D}${sysconfdir}/init.d/eth0_mac_fixup.sh
+ update-rc.d -r ${D} eth0_mac_fixup.sh start 70 S .
+
+ install -m 755 power-on.sh ${D}${sysconfdir}/init.d/power-on.sh
+ update-rc.d -r ${D} power-on.sh start 85 S .
+
+ install -m 0755 ${WORKDIR}/rc.local ${D}${sysconfdir}/init.d/rc.local
+ update-rc.d -r ${D} rc.local start 99 2 3 4 5 .
+
+ install -m 0755 ${WORKDIR}/disable_watchdog.sh ${D}${sysconfdir}/init.d/disable_watchdog.sh
+ update-rc.d -r ${D} disable_watchdog.sh start 99 2 3 4 5 .
+}
+
+FILES_${PN} += "${sysconfdir}"
diff --git a/meta-facebook/meta-wedge100/recipes-utils/wedge-eeprom/libwedge-eeprom_0.1.bbappend b/meta-facebook/meta-wedge100/recipes-utils/wedge-eeprom/libwedge-eeprom_0.1.bbappend
new file mode 100644
index 0000000..bb2fba7
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-utils/wedge-eeprom/libwedge-eeprom_0.1.bbappend
@@ -0,0 +1,18 @@
+# Copyright 2015-present Facebook. All Rights Reserved.
+#
+# This program file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program in a file named COPYING; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301 USA
+
+CFLAGS_prepend = "-DFBW_EEPROM_FILE=\\"/sys/class/i2c-adapter/i2c-6/6-0051/eeprom\\" "
OpenPOWER on IntegriCloud