[linux-yocto] [PATCH 3/5] minnow: Remove old patches for Ethernet and GPIO

Darren Hart dvhart at linux.intel.com
Wed Nov 13 11:09:37 PST 2013


Remove the patches from the BSP scc that have been moved to
standard/base or to the minnow-io feature. The MinnowBoard BSP will
select the minnow-io feature from "recipe-space"

Signed-off-by: Darren Hart <dvhart at linux.intel.com>
---
 .../gpio-sch-Add-sch_gpio_resume_set_enable.patch  |   70 ----
 meta/cfg/kernel-cache/bsp/minnow/minnow.cfg        |   11 -
 meta/cfg/kernel-cache/bsp/minnow/minnow.scc        |    5 -
 ...-Add-base-platform-driver-for-the-MinnowB.patch |  397 --------------------
 ...rd-gpio-Export-MinnowBoard-expansion-GPIO.patch |  179 ---------
 ...-keys-Bind-MinnowBoard-buttons-to-arrow-k.patch |  169 ---------
 .../minnow/pch_gbe-Add-MinnowBoard-support.patch   |  212 -----------
 7 files changed, 1043 deletions(-)
 delete mode 100644 meta/cfg/kernel-cache/bsp/minnow/gpio-sch-Add-sch_gpio_resume_set_enable.patch
 delete mode 100644 meta/cfg/kernel-cache/bsp/minnow/minnowboard-Add-base-platform-driver-for-the-MinnowB.patch
 delete mode 100644 meta/cfg/kernel-cache/bsp/minnow/minnowboard-gpio-Export-MinnowBoard-expansion-GPIO.patch
 delete mode 100644 meta/cfg/kernel-cache/bsp/minnow/minnowboard-keys-Bind-MinnowBoard-buttons-to-arrow-k.patch
 delete mode 100644 meta/cfg/kernel-cache/bsp/minnow/pch_gbe-Add-MinnowBoard-support.patch

diff --git a/meta/cfg/kernel-cache/bsp/minnow/gpio-sch-Add-sch_gpio_resume_set_enable.patch b/meta/cfg/kernel-cache/bsp/minnow/gpio-sch-Add-sch_gpio_resume_set_enable.patch
deleted file mode 100644
index 69fc0e4..0000000
--- a/meta/cfg/kernel-cache/bsp/minnow/gpio-sch-Add-sch_gpio_resume_set_enable.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-From 621384f34dbac8613101d9241cf6b97bd2a38876 Mon Sep 17 00:00:00 2001
-From: Darren Hart <dvhart at linux.intel.com>
-Date: Sat, 18 May 2013 14:45:54 -0700
-Subject: [PATCH 1/7] gpio-sch: Add sch_gpio_resume_set_enable()
-
-Allow for enabling and disabling of the resume well GPIOs. The E6xx Atom
-CPUs multiplex the resume GPIO 2:0 lines with LVDS and individual board
-drivers need to be able to enable or disable the lines appropriately.
-
-Unfortunately, the information regarding if the pins are being used for
-LVDS or GPIO is board specific and may not be available to the gpio-sch
-driver at probe time.
-
-Signed-off-by: Darren Hart <dvhart at linux.intel.com>
----
- drivers/gpio/gpio-sch.c  |   24 ++++++++++++++++++++++++
- include/linux/gpio-sch.h |    6 ++++++
- 2 files changed, 30 insertions(+)
- create mode 100644 include/linux/gpio-sch.h
-
-diff --git a/drivers/gpio/gpio-sch.c b/drivers/gpio/gpio-sch.c
-index 529c488..52df787 100644
---- a/drivers/gpio/gpio-sch.c
-+++ b/drivers/gpio/gpio-sch.c
-@@ -41,6 +41,30 @@ static DEFINE_SPINLOCK(gpio_lock);
- 
- static unsigned short gpio_ba;
- 
-+void sch_gpio_resume_set_enable(unsigned gpio_num, int val)
-+{
-+	u8 curr_en;
-+	unsigned short offset, bit;
-+
-+	spin_lock(&gpio_lock);
-+
-+	offset = RGEN + gpio_num / 8;
-+	bit = gpio_num % 8;
-+
-+	curr_en = inb(gpio_ba + offset);
-+
-+	if (val) {
-+		if (!(curr_en & (1 << bit)))
-+			outb(curr_en | (1 << bit), gpio_ba + offset);
-+	} else {
-+		if ((curr_en & (1 << bit)))
-+			outb(curr_en & ~(1 << bit), gpio_ba + offset);
-+	}
-+
-+	spin_unlock(&gpio_lock);
-+}
-+EXPORT_SYMBOL_GPL(sch_gpio_resume_set_enable);
-+
- static int sch_gpio_core_direction_in(struct gpio_chip *gc, unsigned  gpio_num)
- {
- 	u8 curr_dirs;
-diff --git a/include/linux/gpio-sch.h b/include/linux/gpio-sch.h
-new file mode 100644
-index 0000000..79e042f
---- /dev/null
-+++ b/include/linux/gpio-sch.h
-@@ -0,0 +1,6 @@
-+#ifndef _LINUX_GPIO_SCH_
-+#define _LINUX_GPIO_SCH_
-+
-+void sch_gpio_resume_set_enable(unsigned gpio_num, int val);
-+
-+#endif /* _LINUX_GPIO_SCH_ */
--- 
-1.7.10.4
-
diff --git a/meta/cfg/kernel-cache/bsp/minnow/minnow.cfg b/meta/cfg/kernel-cache/bsp/minnow/minnow.cfg
index c64d0dd..2be4ea4 100644
--- a/meta/cfg/kernel-cache/bsp/minnow/minnow.cfg
+++ b/meta/cfg/kernel-cache/bsp/minnow/minnow.cfg
@@ -1,10 +1,6 @@
 CONFIG_X86_32=y
 CONFIG_MATOM=y
 
-CONFIG_MINNOWBOARD=y
-CONFIG_MINNOWBOARD_GPIO=m
-CONFIG_MINNOWBOARD_KEYS=m
-
 # Configs required for boot on this device
 CONFIG_DMI=y
 CONFIG_MTRR=y
@@ -66,16 +62,9 @@ CONFIG_LPC_SCH=y
 CONFIG_GPIO_SCH=y
 CONFIG_GPIO_PCH=y
 
-# Input device support
-#CONFIG_INPUT_POLLDEV=m
-
 # Userland interfaces
 CONFIG_INPUT_EVDEV=y
 
-# Input Device Drivers
-#CONFIG_KEYBOARD_GPIO=m
-CONFIG_KEYBOARD_GPIO_POLLED=y
-
 # Ensure the performance govenor is the default for optimal boot time
 # (Leave it to userspace to change it after boot)
 # CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
diff --git a/meta/cfg/kernel-cache/bsp/minnow/minnow.scc b/meta/cfg/kernel-cache/bsp/minnow/minnow.scc
index 9744130..089d913 100644
--- a/meta/cfg/kernel-cache/bsp/minnow/minnow.scc
+++ b/meta/cfg/kernel-cache/bsp/minnow/minnow.scc
@@ -18,8 +18,3 @@ kconf hardware cfg/serial-8250.cfg
 
 kconf hardware minnow.cfg
 kconf hardware minnow-dev.cfg
-patch gpio-sch-Add-sch_gpio_resume_set_enable.patch
-patch minnowboard-Add-base-platform-driver-for-the-MinnowB.patch
-patch minnowboard-gpio-Export-MinnowBoard-expansion-GPIO.patch
-patch minnowboard-keys-Bind-MinnowBoard-buttons-to-arrow-k.patch
-patch pch_gbe-Add-MinnowBoard-support.patch
diff --git a/meta/cfg/kernel-cache/bsp/minnow/minnowboard-Add-base-platform-driver-for-the-MinnowB.patch b/meta/cfg/kernel-cache/bsp/minnow/minnowboard-Add-base-platform-driver-for-the-MinnowB.patch
deleted file mode 100644
index eb546b0..0000000
--- a/meta/cfg/kernel-cache/bsp/minnow/minnowboard-Add-base-platform-driver-for-the-MinnowB.patch
+++ /dev/null
@@ -1,397 +0,0 @@
-From 2dcfa9361333e98b20bf0a7f4d97ef560512d971 Mon Sep 17 00:00:00 2001
-From: Darren Hart <dvhart at linux.intel.com>
-Date: Sat, 18 May 2013 14:45:57 -0700
-Subject: [PATCH 2/7] minnowboard: Add base platform driver for the
- MinnowBoard
-
-The MinnowBoard (http://www.minnowboard.org) is an Intel Atom (E6xx) plus EG20T
-PCH development board. It uses a few GPIO lines for specific purposes and
-exposes the rest to the user.
-
-Request the dedicated GPIO lines:
-	HWID
-	LVDS_DETECT
-	PHY_RESET
-	LED0
-	LED1
-
-Setup platform drivers for the MinnowBoard LEDs using the leds-gpio
-driver. Setup led0 and led1 with heartbeat and mmc0 default triggers
-respectively.
-
-GPIO lines SUS[0-4] are dual purpose, either for LVDS signaling or as
-user GPIO. Determine which via the LVDS_DETECT signal and enable or
-disable them accordingly.
-
-Provide a minimal public interface:
-	minnow_detect()
-	minnow_lvds_detect()
-	minnow_hwid()
-	minnow_phy_reset()
-
-Signed-off-by: Darren Hart <dvhart at linux.intel.com>
----
- drivers/platform/x86/Kconfig            |   20 ++++
- drivers/platform/x86/Makefile           |    1 +
- drivers/platform/x86/minnowboard-gpio.h |   60 ++++++++++
- drivers/platform/x86/minnowboard.c      |  193 +++++++++++++++++++++++++++++++
- include/linux/minnowboard.h             |   37 ++++++
- 5 files changed, 311 insertions(+)
- create mode 100644 drivers/platform/x86/minnowboard-gpio.h
- create mode 100644 drivers/platform/x86/minnowboard.c
- create mode 100644 include/linux/minnowboard.h
-
-diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
-index c86bae8..d2c903e 100644
---- a/drivers/platform/x86/Kconfig
-+++ b/drivers/platform/x86/Kconfig
-@@ -15,6 +15,26 @@ menuconfig X86_PLATFORM_DEVICES
- 
- if X86_PLATFORM_DEVICES
- 
-+config MINNOWBOARD
-+	tristate "MinnowBoard GPIO and LVDS support"
-+	depends on LPC_SCH
-+	depends on GPIO_SCH
-+	depends on GPIO_PCH
-+	depends on LEDS_GPIO
-+	default n
-+	---help---
-+	  This driver configures the MinnowBoard fixed functionality GPIO lines.
-+
-+	  It ensures that the E6XX SUS GPIOs muxed with LVDS signals (SUS[0:2])
-+	  are disabled if the LVDS_DETECT signal is asserted.
-+
-+	  If LED_TRIGGER* are enabled, LED0 will use the heartbeat trigger and
-+	  LED1 will use the mmc0 trigger.
-+
-+	  The Minnow Hardware ID is read from the GPIO HWID lines and logged.
-+
-+	  If you have a MinnowBoard, say Y or M here.
-+
- config ACER_WMI
- 	tristate "Acer WMI Laptop Extras"
- 	depends on ACPI
-diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile
-index bf7e4f9..a787942 100644
---- a/drivers/platform/x86/Makefile
-+++ b/drivers/platform/x86/Makefile
-@@ -2,6 +2,7 @@
- # Makefile for linux/drivers/platform/x86
- # x86 Platform-Specific Drivers
- #
-+obj-$(CONFIG_MINNOWBOARD)	+= minnowboard.o
- obj-$(CONFIG_ASUS_LAPTOP)	+= asus-laptop.o
- obj-$(CONFIG_ASUS_WMI)		+= asus-wmi.o
- obj-$(CONFIG_ASUS_NB_WMI)	+= asus-nb-wmi.o
-diff --git a/drivers/platform/x86/minnowboard-gpio.h b/drivers/platform/x86/minnowboard-gpio.h
-new file mode 100644
-index 0000000..ccc8361
---- /dev/null
-+++ b/drivers/platform/x86/minnowboard-gpio.h
-@@ -0,0 +1,60 @@
-+/*
-+ * MinnowBoard Linux platform driver
-+ * Copyright (c) 2013, Intel Corporation.
-+ * All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms and conditions of the GNU General Public License,
-+ * version 2, as published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope 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.
-+ *
-+ * Author: Darren Hart <dvhart at linux.intel.com>
-+ */
-+
-+/* MinnowBoard GPIO definitions */
-+#define GPIO_BTN0 0
-+#define GPIO_BTN1 1
-+#define GPIO_BTN2 2
-+#define GPIO_BTN3 3
-+
-+#define GPIO_PROG_VOLTAGE 4
-+
-+/*
-+ * If !LVDS_DETECT, the AUX lines are available as GPIO,
-+ * otherwise they are used for LVDS signals.
-+ */
-+#define GPIO_AUX0 5
-+#define GPIO_AUX1 6
-+#define GPIO_AUX2 7
-+#define GPIO_AUX3 8
-+#define GPIO_AUX4 9
-+
-+#define GPIO_LED0 10
-+#define GPIO_LED1 11
-+
-+#define GPIO_USB_VBUS_DETECT 12
-+
-+#define GPIO_PHY_RESET 13
-+
-+#define GPIO_PCH0 244
-+#define GPIO_PCH1 245
-+#define GPIO_PCH2 246
-+#define GPIO_PCH3 247
-+#define GPIO_PCH4 248
-+#define GPIO_PCH5 249
-+#define GPIO_PCH6 250
-+#define GPIO_PCH7 251
-+
-+#define GPIO_HWID0 252
-+#define GPIO_HWID1 253
-+#define GPIO_HWID2 254
-+
-+#define GPIO_LVDS_DETECT 255
-diff --git a/drivers/platform/x86/minnowboard.c b/drivers/platform/x86/minnowboard.c
-new file mode 100644
-index 0000000..c0d93a9
---- /dev/null
-+++ b/drivers/platform/x86/minnowboard.c
-@@ -0,0 +1,193 @@
-+/*
-+ * MinnowBoard Linux platform driver
-+ * Copyright (c) 2013, Intel Corporation.
-+ * All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms and conditions of the GNU General Public License,
-+ * version 2, as published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope 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.
-+ *
-+ * Author: Darren Hart <dvhart at linux.intel.com>
-+ */
-+
-+#define pr_fmt(fmt) "MinnowBoard: " fmt
-+
-+#include <linux/platform_device.h>
-+#include <linux/module.h>
-+#include <linux/dmi.h>
-+#include <linux/input.h>
-+#include <linux/gpio.h>
-+#include <linux/leds.h>
-+#include <linux/gpio-sch.h>
-+#include <linux/delay.h>
-+#include <linux/minnowboard.h>
-+#include "minnowboard-gpio.h"
-+
-+static int minnow_hwid_val = -1;
-+
-+/* leds-gpio platform device structures */
-+static const struct gpio_led minnow_leds[] = {
-+	{ .name = "minnow_led0", .gpio = GPIO_LED0, .active_low = 0,
-+	  .retain_state_suspended = 1, .default_state = LEDS_GPIO_DEFSTATE_ON,
-+	  .default_trigger = "heartbeat"},
-+	{ .name = "minnow_led1", .gpio = GPIO_LED1, .active_low = 0,
-+	  .retain_state_suspended = 1, .default_state = LEDS_GPIO_DEFSTATE_ON,
-+	  .default_trigger = "mmc0"},
-+};
-+
-+static struct gpio_led_platform_data minnow_leds_platform_data = {
-+	.num_leds = ARRAY_SIZE(minnow_leds),
-+	.leds = (void *) minnow_leds,
-+};
-+
-+static struct platform_device minnow_gpio_leds = {
-+	.name =	"leds-gpio",
-+	.id = -1,
-+	.dev = {
-+		.platform_data = &minnow_leds_platform_data,
-+	},
-+};
-+
-+static struct gpio hwid_gpios[] = {
-+	{ GPIO_HWID0, GPIOF_DIR_IN | GPIOF_EXPORT, "minnow_gpio_hwid0" },
-+	{ GPIO_HWID1, GPIOF_DIR_IN | GPIOF_EXPORT, "minnow_gpio_hwid1" },
-+	{ GPIO_HWID2, GPIOF_DIR_IN | GPIOF_EXPORT, "minnow_gpio_hwid2" },
-+};
-+
-+int minnow_hwid(void)
-+{
-+	/* This should never be called prior to minnow_init_module() */
-+	WARN_ON_ONCE(minnow_hwid_val == -1);
-+	return minnow_hwid_val;
-+}
-+EXPORT_SYMBOL_GPL(minnow_hwid);
-+
-+bool minnow_detect(void)
-+{
-+	const char *cmp;
-+
-+	cmp = dmi_get_system_info(DMI_BOARD_NAME);
-+	if (cmp && strstr(cmp, "MinnowBoard"))
-+		return true;
-+
-+	return false;
-+}
-+EXPORT_SYMBOL_GPL(minnow_detect);
-+
-+bool minnow_lvds_detect(void)
-+{
-+	return !!gpio_get_value(GPIO_LVDS_DETECT);
-+}
-+EXPORT_SYMBOL_GPL(minnow_lvds_detect);
-+
-+void minnow_phy_reset(void)
-+{
-+	/*
-+	 * Hold reset for a little over 1ms and allow some time after to ensure
-+	 * the PHY has fully woken up.
-+	 */
-+	gpio_set_value(GPIO_PHY_RESET, 0);
-+	usleep_range(1250, 1250);
-+	gpio_set_value(GPIO_PHY_RESET, 1);
-+	usleep_range(1250, 1250);
-+}
-+EXPORT_SYMBOL_GPL(minnow_phy_reset);
-+
-+static int __init minnow_module_init(void)
-+{
-+	int err, val, i;
-+
-+	err = -ENODEV;
-+	if (!minnow_detect())
-+		goto out;
-+
-+#ifdef MODULE
-+/* Load any implicit dependencies that are not built-in */
-+#ifdef CONFIG_LPC_SCH_MODULE
-+	if (request_module("lpc_sch"))
-+		goto out;
-+#endif
-+#ifdef CONFIG_GPIO_SCH_MODULE
-+	if (request_module("gpio-sch"))
-+		goto out;
-+#endif
-+#ifdef CONFIG_GPIO_PCH_MODULE
-+	if (request_module("gpio-pch"))
-+		goto out;
-+#endif
-+#endif
-+
-+	/* HWID GPIOs */
-+	err = gpio_request_array(hwid_gpios, ARRAY_SIZE(hwid_gpios));
-+	if (err) {
-+		pr_err("Failed to request hwid GPIO lines\n");
-+		goto out;
-+	}
-+	minnow_hwid_val = (!!gpio_get_value(GPIO_HWID0)) |
-+			  (!!gpio_get_value(GPIO_HWID1) << 1) |
-+			  (!!gpio_get_value(GPIO_HWID2) << 2);
-+
-+	pr_info("Hardware ID: %d\n", minnow_hwid_val);
-+
-+	err = gpio_request_one(GPIO_LVDS_DETECT, GPIOF_DIR_IN | GPIOF_EXPORT,
-+			       "minnow_lvds_detect");
-+	if (err) {
-+		pr_err("Failed to request LVDS_DETECT GPIO line (%d)\n",
-+		       GPIO_LVDS_DETECT);
-+		goto out;
-+	}
-+
-+	/* Disable the GPIO lines if LVDS is detected */
-+	val = minnow_lvds_detect() ? 1 : 0;
-+	pr_info("Aux GPIO lines %s\n", val ? "Disabled" : "Enabled");
-+	for (i = 0; i < 5; i++)
-+		sch_gpio_resume_set_enable(i, !val);
-+
-+	/* Reserve the AR8031 PHY's ETH_RESET GPIO line */
-+	err = gpio_request_one(GPIO_PHY_RESET,
-+			       GPIOF_DIR_OUT | GPIOF_INIT_HIGH | GPIOF_EXPORT,
-+			       "minnow_phy_reset");
-+	if (err) {
-+		pr_err("Failed to request PHY_RESET GPIO line (%d)\n",
-+		       GPIO_PHY_RESET);
-+		goto out_lvds;
-+	}
-+
-+	/* GPIO LEDs */
-+	err = platform_device_register(&minnow_gpio_leds);
-+	if (err) {
-+		pr_err("Failed to register leds-gpio platform device\n");
-+		goto out_phy;
-+	}
-+	goto out;
-+
-+ out_phy:
-+	gpio_free(GPIO_PHY_RESET);
-+
-+ out_lvds:
-+	gpio_free(GPIO_LVDS_DETECT);
-+
-+ out:
-+	return err;
-+}
-+
-+static void __exit minnow_module_exit(void)
-+{
-+	gpio_free(GPIO_LVDS_DETECT);
-+	gpio_free(GPIO_PHY_RESET);
-+	platform_device_unregister(&minnow_gpio_leds);
-+}
-+
-+module_init(minnow_module_init);
-+module_exit(minnow_module_exit);
-+
-+MODULE_LICENSE("GPL");
-diff --git a/include/linux/minnowboard.h b/include/linux/minnowboard.h
-new file mode 100644
-index 0000000..d3608b8
---- /dev/null
-+++ b/include/linux/minnowboard.h
-@@ -0,0 +1,37 @@
-+/*
-+ * MinnowBoard Linux platform driver
-+ * Copyright (c) 2013, Intel Corporation.
-+ * All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms and conditions of the GNU General Public License,
-+ * version 2, as published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope 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.
-+ *
-+ * Author: Darren Hart <dvhart at linux.intel.com>
-+ */
-+
-+#ifndef _LINUX_MINNOWBOARD_H
-+#define _LINUX_MINNOWBOARD_H
-+
-+#if defined(CONFIG_MINNOWBOARD) || defined(CONFIG_MINNOWBOARD_MODULE)
-+bool minnow_detect(void);
-+bool minnow_lvds_detect(void);
-+int minnow_hwid(void);
-+void minnow_phy_reset(void);
-+#else
-+#define minnow_detect() (false)
-+#define minnow_lvds_detect() (false)
-+#define minnow_hwid() (-1)
-+#define minnow_phy_reset() do { } while (0)
-+#endif /* MINNOWBOARD */
-+
-+#endif /* _LINUX_MINNOWBOARD_H */
--- 
-1.7.10.4
-
diff --git a/meta/cfg/kernel-cache/bsp/minnow/minnowboard-gpio-Export-MinnowBoard-expansion-GPIO.patch b/meta/cfg/kernel-cache/bsp/minnow/minnowboard-gpio-Export-MinnowBoard-expansion-GPIO.patch
deleted file mode 100644
index c468485..0000000
--- a/meta/cfg/kernel-cache/bsp/minnow/minnowboard-gpio-Export-MinnowBoard-expansion-GPIO.patch
+++ /dev/null
@@ -1,179 +0,0 @@
-From 6d6fece1c3fa6c802824cbd139cd145c99de1d86 Mon Sep 17 00:00:00 2001
-From: Darren Hart <dvhart at linux.intel.com>
-Date: Sat, 18 May 2013 14:45:58 -0700
-Subject: [PATCH 3/7] minnowboard-gpio: Export MinnowBoard expansion GPIO
-
-Request and export the user-configurable GPIO lines to sysfs. This provides a
-label readable in /debugfs/gpio and a simple interface for experimenting with
-GPIO on the MinnowBoard.
-
-This is separate from the minnowboard driver to provide users with the
-flexibility to write kernel drivers for their own devices using these GPIO
-lines.
-
-Signed-off-by: Darren Hart <dvhart at linux.intel.com>
----
- drivers/platform/x86/Kconfig            |   18 ++++++
- drivers/platform/x86/Makefile           |    1 +
- drivers/platform/x86/minnowboard-gpio.c |  108 +++++++++++++++++++++++++++++++
- 3 files changed, 127 insertions(+)
- create mode 100644 drivers/platform/x86/minnowboard-gpio.c
-
-diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
-index d2c903e..d0aa2a7 100644
---- a/drivers/platform/x86/Kconfig
-+++ b/drivers/platform/x86/Kconfig
-@@ -35,6 +35,24 @@ config MINNOWBOARD
- 
- 	  If you have a MinnowBoard, say Y or M here.
- 
-+if MINNOWBOARD
-+config MINNOWBOARD_GPIO
-+	tristate "MinnowBoard Expansion GPIO"
-+	depends on MINNOWBOARD
-+	default n
-+	---help---
-+	  Export the EG20T (gpio-pch) lines on the expansion connector to sysfs
-+	  for easy manipulation from userspace. These will be named
-+	  "minnow_gpio_pch[0-7]". If LVDS is not in use, export the E6XX
-+	  (gpio-sch) lines on the expansion connector to sysfs, these will be
-+	  named "minnow_gpio_aux[0-4]".
-+
-+	  If you have a MinnowBoard, and want to experiment with the GPIO,
-+	  say Y or M here.
-+
-+endif # MINNOWBOARD
-+
-+
- config ACER_WMI
- 	tristate "Acer WMI Laptop Extras"
- 	depends on ACPI
-diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile
-index a787942..cc6e3de 100644
---- a/drivers/platform/x86/Makefile
-+++ b/drivers/platform/x86/Makefile
-@@ -3,6 +3,7 @@
- # x86 Platform-Specific Drivers
- #
- obj-$(CONFIG_MINNOWBOARD)	+= minnowboard.o
-+obj-$(CONFIG_MINNOWBOARD_GPIO)	+= minnowboard-gpio.o
- obj-$(CONFIG_ASUS_LAPTOP)	+= asus-laptop.o
- obj-$(CONFIG_ASUS_WMI)		+= asus-wmi.o
- obj-$(CONFIG_ASUS_NB_WMI)	+= asus-nb-wmi.o
-diff --git a/drivers/platform/x86/minnowboard-gpio.c b/drivers/platform/x86/minnowboard-gpio.c
-new file mode 100644
-index 0000000..0c6ff85
---- /dev/null
-+++ b/drivers/platform/x86/minnowboard-gpio.c
-@@ -0,0 +1,108 @@
-+/*
-+ * MinnowBoard Linux platform driver
-+ * Copyright (c) 2013, Intel Corporation.
-+ * All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms and conditions of the GNU General Public License,
-+ * version 2, as published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope 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.
-+ *
-+ * Author: Darren Hart <dvhart at linux.intel.com>
-+ */
-+
-+#include <linux/platform_device.h>
-+#include <linux/module.h>
-+#include <linux/gpio.h>
-+#include <linux/gpio_keys.h>
-+#include <linux/input.h>
-+#include <linux/minnowboard.h>
-+#include "minnowboard-gpio.h"
-+
-+static struct gpio expansion_gpios[] = {
-+	{ GPIO_PCH0, GPIOF_DIR_IN | GPIOF_EXPORT | GPIOF_EXPORT_CHANGEABLE,
-+	  "minnow_gpio_pch0" },
-+	{ GPIO_PCH1, GPIOF_DIR_IN | GPIOF_EXPORT | GPIOF_EXPORT_CHANGEABLE,
-+	  "minnow_gpio_pch1" },
-+	{ GPIO_PCH2, GPIOF_DIR_IN | GPIOF_EXPORT | GPIOF_EXPORT_CHANGEABLE,
-+	  "minnow_gpio_pch2" },
-+	{ GPIO_PCH3, GPIOF_DIR_IN | GPIOF_EXPORT | GPIOF_EXPORT_CHANGEABLE,
-+	  "minnow_gpio_pch3" },
-+	{ GPIO_PCH4, GPIOF_DIR_IN | GPIOF_EXPORT | GPIOF_EXPORT_CHANGEABLE,
-+	  "minnow_gpio_pch4" },
-+	{ GPIO_PCH5, GPIOF_DIR_IN | GPIOF_EXPORT | GPIOF_EXPORT_CHANGEABLE,
-+	  "minnow_gpio_pch5" },
-+	{ GPIO_PCH6, GPIOF_DIR_IN | GPIOF_EXPORT | GPIOF_EXPORT_CHANGEABLE,
-+	  "minnow_gpio_pch6" },
-+	{ GPIO_PCH7, GPIOF_DIR_IN | GPIOF_EXPORT | GPIOF_EXPORT_CHANGEABLE,
-+	  "minnow_gpio_pch7" },
-+};
-+
-+static struct gpio expansion_aux_gpios[] = {
-+	{ GPIO_AUX0, GPIOF_DIR_IN | GPIOF_EXPORT | GPIOF_EXPORT_CHANGEABLE,
-+	  "minnow_gpio_aux0" },
-+	{ GPIO_AUX1, GPIOF_DIR_IN | GPIOF_EXPORT | GPIOF_EXPORT_CHANGEABLE,
-+	  "minnow_gpio_aux1" },
-+	{ GPIO_AUX2, GPIOF_DIR_IN | GPIOF_EXPORT | GPIOF_EXPORT_CHANGEABLE,
-+	  "minnow_gpio_aux2" },
-+	{ GPIO_AUX3, GPIOF_DIR_IN | GPIOF_EXPORT | GPIOF_EXPORT_CHANGEABLE,
-+	  "minnow_gpio_aux3" },
-+	{ GPIO_AUX4, GPIOF_DIR_IN | GPIOF_EXPORT | GPIOF_EXPORT_CHANGEABLE,
-+	  "minnow_gpio_aux4" },
-+};
-+
-+static int __init minnow_gpio_module_init(void)
-+{
-+	int err;
-+
-+	err = -ENODEV;
-+	if (!minnow_detect())
-+		goto out;
-+
-+	/* Auxillary Expansion GPIOs */
-+	if (!minnow_lvds_detect()) {
-+		pr_debug("LVDS_DETECT not asserted, configuring Aux GPIO lines\n");
-+		err = gpio_request_array(expansion_aux_gpios,
-+					 ARRAY_SIZE(expansion_aux_gpios));
-+		if (err) {
-+			pr_err("Failed to request expansion aux GPIO lines\n");
-+			goto out;
-+		}
-+	} else {
-+		pr_debug("LVDS_DETECT asserted, ignoring aux GPIO lines\n");
-+	}
-+
-+	/* Expansion GPIOs */
-+	err = gpio_request_array(expansion_gpios, ARRAY_SIZE(expansion_gpios));
-+	if (err) {
-+		pr_err("Failed to request expansion GPIO lines\n");
-+		if (minnow_lvds_detect())
-+			gpio_free_array(expansion_aux_gpios,
-+					ARRAY_SIZE(expansion_aux_gpios));
-+		goto out;
-+	}
-+
-+ out:
-+	return err;
-+}
-+
-+static void __exit minnow_gpio_module_exit(void)
-+{
-+	if (minnow_lvds_detect())
-+		gpio_free_array(expansion_aux_gpios,
-+				ARRAY_SIZE(expansion_aux_gpios));
-+	gpio_free_array(expansion_gpios, ARRAY_SIZE(expansion_gpios));
-+}
-+
-+module_init(minnow_gpio_module_init);
-+module_exit(minnow_gpio_module_exit);
-+
-+MODULE_LICENSE("GPL");
--- 
-1.7.10.4
-
diff --git a/meta/cfg/kernel-cache/bsp/minnow/minnowboard-keys-Bind-MinnowBoard-buttons-to-arrow-k.patch b/meta/cfg/kernel-cache/bsp/minnow/minnowboard-keys-Bind-MinnowBoard-buttons-to-arrow-k.patch
deleted file mode 100644
index ba9b788..0000000
--- a/meta/cfg/kernel-cache/bsp/minnow/minnowboard-keys-Bind-MinnowBoard-buttons-to-arrow-k.patch
+++ /dev/null
@@ -1,169 +0,0 @@
-From f8056d37d56977c3a8dfe3780268e452c918fdcc Mon Sep 17 00:00:00 2001
-From: Darren Hart <dvhart at linux.intel.com>
-Date: Sat, 18 May 2013 14:45:59 -0700
-Subject: [PATCH 4/7] minnowboard-keys: Bind MinnowBoard buttons to arrow keys
-
-Configure the four buttons tied to the E6XX GPIO lines on the
-MinnowBoard as keys using the gpio-keys-polled platform driver. From
-left to right, bind them to LEFT, DOWN, UP, RIGHT, similar to the VI
-directional keys.
-
-This is separate from the minnowboard driver to provide users with the
-flexibility to write kernel drivers for their own devices using these GPIO
-lines.
-
-Signed-off-by: Darren Hart <dvhart at linux.intel.com>
----
- drivers/platform/x86/Kconfig            |   14 +++++
- drivers/platform/x86/Makefile           |    1 +
- drivers/platform/x86/minnowboard-keys.c |  101 +++++++++++++++++++++++++++++++
- 3 files changed, 116 insertions(+)
- create mode 100644 drivers/platform/x86/minnowboard-keys.c
-
-diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
-index d0aa2a7..89d1065 100644
---- a/drivers/platform/x86/Kconfig
-+++ b/drivers/platform/x86/Kconfig
-@@ -50,6 +50,20 @@ config MINNOWBOARD_GPIO
- 	  If you have a MinnowBoard, and want to experiment with the GPIO,
- 	  say Y or M here.
- 
-+config MINNOWBOARD_KEYS
-+	tristate "MinnowBoard GPIO Keys"
-+	depends on MINNOWBOARD
-+	depends on KEYBOARD_GPIO_POLLED
-+	default n
-+	---help---
-+	  Configure the four buttons tied to the E6XX GPIO lines on the
-+	  MinnowBoard as keys using the gpio-keys-polled platform driver. From
-+	  left to right, bind them to LEFT, DOWN, UP, RIGHT, similar to the VI
-+	  directional keys.
-+
-+	  If you have a MinnowBoard and want to use the buttons as arrow keys,
-+	  say Y or M here.
-+
- endif # MINNOWBOARD
- 
- 
-diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile
-index cc6e3de..171cd8d 100644
---- a/drivers/platform/x86/Makefile
-+++ b/drivers/platform/x86/Makefile
-@@ -4,6 +4,7 @@
- #
- obj-$(CONFIG_MINNOWBOARD)	+= minnowboard.o
- obj-$(CONFIG_MINNOWBOARD_GPIO)	+= minnowboard-gpio.o
-+obj-$(CONFIG_MINNOWBOARD_KEYS)	+= minnowboard-keys.o
- obj-$(CONFIG_ASUS_LAPTOP)	+= asus-laptop.o
- obj-$(CONFIG_ASUS_WMI)		+= asus-wmi.o
- obj-$(CONFIG_ASUS_NB_WMI)	+= asus-nb-wmi.o
-diff --git a/drivers/platform/x86/minnowboard-keys.c b/drivers/platform/x86/minnowboard-keys.c
-new file mode 100644
-index 0000000..319507a
---- /dev/null
-+++ b/drivers/platform/x86/minnowboard-keys.c
-@@ -0,0 +1,101 @@
-+/*
-+ * MinnowBoard Linux platform driver
-+ * Copyright (c) 2013, Intel Corporation.
-+ * All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms and conditions of the GNU General Public License,
-+ * version 2, as published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope 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.
-+ *
-+ * Author: Darren Hart <dvhart at linux.intel.com>
-+ */
-+
-+#include <linux/platform_device.h>
-+#include <linux/module.h>
-+#include <linux/gpio.h>
-+#include <linux/gpio_keys.h>
-+#include <linux/input.h>
-+#include <linux/minnowboard.h>
-+#include "minnowboard-gpio.h"
-+
-+/* VI-style direction keys seem like as good as anything */
-+#define GPIO_BTN0_KEY KEY_LEFT
-+#define GPIO_BTN1_KEY KEY_DOWN
-+#define GPIO_BTN2_KEY KEY_UP
-+#define GPIO_BTN3_KEY KEY_RIGHT
-+
-+/* Timing in milliseconds */
-+#define GPIO_DEBOUNCE 1
-+#define BUTTON_POLL_INTERVAL 300
-+
-+/* gpio-keys platform device structures */
-+static struct gpio_keys_button minnow_buttons[] = {
-+	{ .code = GPIO_BTN0_KEY, .gpio = GPIO_BTN0, .active_low = 1,
-+	  .desc = "minnow_btn0", .type = EV_KEY, .wakeup = 0,
-+	  .debounce_interval = GPIO_DEBOUNCE, .can_disable = true },
-+	{ .code = GPIO_BTN1_KEY, .gpio = GPIO_BTN1, .active_low = 1,
-+	  .desc = "minnow_btn1", .type = EV_KEY, .wakeup = 0,
-+	  .debounce_interval = GPIO_DEBOUNCE, .can_disable = true },
-+	{ .code = GPIO_BTN2_KEY, .gpio = GPIO_BTN2, .active_low = 1,
-+	  .desc = "minnow_btn2", .type = EV_KEY, .wakeup = 0,
-+	  .debounce_interval = GPIO_DEBOUNCE, .can_disable = true },
-+	{ .code = GPIO_BTN3_KEY, .gpio = GPIO_BTN3, .active_low = 1,
-+	  .desc = "minnow_btn3", .type = EV_KEY, .wakeup = 0,
-+	  .debounce_interval = GPIO_DEBOUNCE, .can_disable = true },
-+};
-+
-+static const struct gpio_keys_platform_data minnow_buttons_platform_data = {
-+	.buttons = minnow_buttons,
-+	.nbuttons = ARRAY_SIZE(minnow_buttons),
-+	.poll_interval = BUTTON_POLL_INTERVAL,
-+	.rep = 1,
-+	.enable = NULL,
-+	.disable = NULL,
-+	.name = "minnow_buttons",
-+};
-+
-+static struct platform_device minnow_gpio_buttons = {
-+	.name = "gpio-keys-polled",
-+	.id = -1,
-+	.dev = {
-+		.platform_data = (void *) &minnow_buttons_platform_data,
-+	},
-+};
-+
-+static int __init minnow_keys_module_init(void)
-+{
-+	int err;
-+
-+	err = -ENODEV;
-+	if (!minnow_detect())
-+		goto out;
-+
-+	/* Export GPIO buttons to sysfs */
-+	err = platform_device_register(&minnow_gpio_buttons);
-+	if (err) {
-+		pr_err("Failed to register gpio-keys-polled platform device\n");
-+		goto out;
-+	}
-+
-+ out:
-+	return err;
-+}
-+
-+static void __exit minnow_keys_module_exit(void)
-+{
-+	platform_device_unregister(&minnow_gpio_buttons);
-+}
-+
-+module_init(minnow_keys_module_init);
-+module_exit(minnow_keys_module_exit);
-+
-+MODULE_LICENSE("GPL");
--- 
-1.7.10.4
-
diff --git a/meta/cfg/kernel-cache/bsp/minnow/pch_gbe-Add-MinnowBoard-support.patch b/meta/cfg/kernel-cache/bsp/minnow/pch_gbe-Add-MinnowBoard-support.patch
deleted file mode 100644
index d73e6ae..0000000
--- a/meta/cfg/kernel-cache/bsp/minnow/pch_gbe-Add-MinnowBoard-support.patch
+++ /dev/null
@@ -1,212 +0,0 @@
-From b688fe510d9eaadb2274855a826bbe4605546452 Mon Sep 17 00:00:00 2001
-From: Darren Hart <dvhart at linux.intel.com>
-Date: Sat, 18 May 2013 14:46:00 -0700
-Subject: [PATCH 5/7] pch_gbe: Add MinnowBoard support
-
-The MinnowBoard uses an AR803x PHY with the PCH GBE.
-
-It does not implement the RGMII 2ns TX clock delay in the trace routing
-nor via strapping. Add a detection method for the board and the PHY and
-enable the tx clock delay via the registers.
-
-This PHY will hibernate without link for 10 seconds. Ensure the PHY is
-awake for probe and then disable hibernation. A future improvement would
-be to convert pch_gbe to using PHYLIB and making sure we can wake the
-PHY at the necessary times rather than permanently disabling it.
-
-Unfortunately, the board does not provide a unique PCI device ID. The
-the minnow_detect() function fills the gap comparing DMI_BOARD_NAME. It
-is admittedly sub-optimal.
-
-Signed-off-by: Darren Hart <dvhart at linux.intel.com>
----
- drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h    |    2 +
- .../net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c   |   12 +++
- .../net/ethernet/oki-semi/pch_gbe/pch_gbe_phy.c    |   89 ++++++++++++++++++++
- .../net/ethernet/oki-semi/pch_gbe/pch_gbe_phy.h    |    2 +
- 4 files changed, 105 insertions(+)
-
-diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h
-index 7fb7e17..bd4e0c5 100644
---- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h
-+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h
-@@ -384,6 +384,7 @@ struct pch_gbe_mac_info {
-  * @revision:		PHY's revision
-  * @reset_delay_us:	HW reset delay time[us]
-  * @autoneg_advertised:	Autoneg advertised
-+ * @tx_clk_delay:	Setup TX clock delay in the PHY
-  */
- struct pch_gbe_phy_info {
- 	u32 addr;
-@@ -391,6 +392,7 @@ struct pch_gbe_phy_info {
- 	u32 revision;
- 	u32 reset_delay_us;
- 	u16 autoneg_advertised;
-+	bool tx_clk_delay;
- };
- 
- /*!
-diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
-index 8adeb4d..f487ad7 100644
---- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
-+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
-@@ -23,6 +23,8 @@
- #include <linux/module.h>
- #include <linux/net_tstamp.h>
- #include <linux/ptp_classify.h>
-+#include <linux/gpio.h>
-+#include <linux/minnowboard.h>
- 
- #define DRV_VERSION     "1.01"
- const char pch_driver_version[] = DRV_VERSION;
-@@ -2601,6 +2603,13 @@ static int pch_gbe_probe(struct pci_dev *pdev,
- 
- 	pci_set_drvdata(pdev, netdev);
- 	adapter = netdev_priv(netdev);
-+
-+	adapter->hw.phy.tx_clk_delay = false;
-+	if (minnow_detect()) {
-+		adapter->hw.phy.tx_clk_delay = true;
-+		minnow_phy_reset();
-+	}
-+
- 	adapter->netdev = netdev;
- 	adapter->pdev = pdev;
- 	adapter->hw.back = adapter;
-@@ -2684,6 +2693,9 @@ static int pch_gbe_probe(struct pci_dev *pdev,
- 
- 	dev_dbg(&pdev->dev, "PCH Network Connection\n");
- 
-+	/* Disable hibernation on certain PHYs */
-+	pch_gbe_phy_disable_hibernate(&adapter->hw);
-+
- 	device_set_wakeup_enable(&pdev->dev, 1);
- 	return 0;
- 
-diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_phy.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_phy.c
-index 28bb960..bb8d8b4 100644
---- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_phy.c
-+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_phy.c
-@@ -20,6 +20,7 @@
- 
- #include "pch_gbe.h"
- #include "pch_gbe_phy.h"
-+#include <linux/gpio.h>
- 
- #define PHY_MAX_REG_ADDRESS   0x1F	/* 5 bit address bus (0-0x1F) */
- 
-@@ -74,6 +75,15 @@
- #define MII_SR_100X_FD_CAPS      0x4000	/* 100X  Full Duplex Capable */
- #define MII_SR_100T4_CAPS        0x8000	/* 100T4 Capable */
- 
-+/* AR8031 PHY Debug Registers */
-+#define PHY_AR803X_ID           0x00001374
-+#define PHY_AR8031_DBG_OFF      0x1D
-+#define PHY_AR8031_DBG_DAT      0x1E
-+#define PHY_AR8031_SERDES       0x05
-+#define PHY_AR8031_HIBERNATE    0x0B
-+#define PHY_AR8031_SERDES_TX_CLK_DLY   0x0100 /* TX clock delay of 2.0ns */
-+#define PHY_AR8031_PS_HIB_EN           0x8000 /* Hibernate enable */
-+
- /* Phy Id Register (word 2) */
- #define PHY_REVISION_MASK        0x000F
- 
-@@ -271,4 +281,83 @@ void pch_gbe_phy_init_setting(struct pch_gbe_hw *hw)
- 	mii_reg |= PHYSP_CTRL_ASSERT_CRS_TX;
- 	pch_gbe_phy_write_reg_miic(hw, PHY_PHYSP_CONTROL, mii_reg);
- 
-+	 /* Setup a TX clock delay for certain boards */
-+	 if (hw->phy.tx_clk_delay)
-+		pch_gbe_phy_tx_clk_delay(hw);
-+}
-+
-+/**
-+ * pch_gbe_phy_tx_clk_delay - Setup TX clock delay via the PHY
-+ * @hw:	            Pointer to the HW structure
-+ * Returns
-+ *	0:		Successful.
-+ *	-EINVAL:	Invalid argument.
-+ */
-+int pch_gbe_phy_tx_clk_delay(struct pch_gbe_hw *hw)
-+{
-+	/*
-+	 * The RGMII interface requires a ~2ns TX clock delay. This is typically
-+	 * done in layout with a longer trace or via PHY strapping, but can also
-+	 * be done via PHY configuration registers.
-+	 */
-+	u16 mii_reg;
-+	int ret = 0;
-+
-+	switch (hw->phy.id) {
-+	case PHY_AR803X_ID:
-+		pch_gbe_phy_read_reg_miic(hw, PHY_AR8031_DBG_OFF, &mii_reg);
-+		ret = pch_gbe_phy_write_reg_miic(hw, PHY_AR8031_DBG_OFF,
-+						 PHY_AR8031_SERDES);
-+		if (ret)
-+			break;
-+
-+		pch_gbe_phy_read_reg_miic(hw, PHY_AR8031_DBG_DAT, &mii_reg);
-+		mii_reg |= PHY_AR8031_SERDES_TX_CLK_DLY;
-+		ret = pch_gbe_phy_write_reg_miic(hw, PHY_AR8031_DBG_DAT,
-+						 mii_reg);
-+		break;
-+	default:
-+		pr_err("Unknown PHY (%x), could not set TX clock delay.\n",
-+		       hw->phy.id);
-+		return -EINVAL;
-+	}
-+
-+	if (ret)
-+		pr_err("Could not configure tx clock delay for PHY.\n");
-+	return ret;
-+}
-+
-+/**
-+ * pch_gbe_phy_disable_hibernate - Disable the PHY low power state
-+ * @hw:	            Pointer to the HW structure
-+ * Returns
-+ *	0:		Successful.
-+ *	-EINVAL:	Invalid argument.
-+ */
-+int pch_gbe_phy_disable_hibernate(struct pch_gbe_hw *hw)
-+{
-+	u16 mii_reg;
-+	int ret = 0;
-+
-+	switch (hw->phy.id) {
-+	case PHY_AR803X_ID:
-+		ret = pch_gbe_phy_write_reg_miic(hw, PHY_AR8031_DBG_OFF,
-+						 PHY_AR8031_HIBERNATE);
-+		if (ret)
-+			break;
-+
-+		pch_gbe_phy_read_reg_miic(hw, PHY_AR8031_DBG_DAT, &mii_reg);
-+		mii_reg &= ~PHY_AR8031_PS_HIB_EN;
-+		ret = pch_gbe_phy_write_reg_miic(hw, PHY_AR8031_DBG_DAT,
-+						 mii_reg);
-+		break;
-+	default:
-+		pr_err("Unknown PHY (%x), could not disable hibernation\n",
-+		       hw->phy.id);
-+		return -EINVAL;
-+	}
-+
-+	if (ret)
-+		pr_err("Could not disable PHY hibernation.\n");
-+	return ret;
- }
-diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_phy.h b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_phy.h
-index 03264dc..e3e4bc9 100644
---- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_phy.h
-+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_phy.h
-@@ -33,5 +33,7 @@ void pch_gbe_phy_power_up(struct pch_gbe_hw *hw);
- void pch_gbe_phy_power_down(struct pch_gbe_hw *hw);
- void pch_gbe_phy_set_rgmii(struct pch_gbe_hw *hw);
- void pch_gbe_phy_init_setting(struct pch_gbe_hw *hw);
-+int pch_gbe_phy_tx_clk_delay(struct pch_gbe_hw *hw);
-+int pch_gbe_phy_disable_hibernate(struct pch_gbe_hw *hw);
- 
- #endif /* _PCH_GBE_PHY_H_ */
--- 
-1.7.10.4
-
-- 
1.7.9.5




More information about the linux-yocto mailing list