#include "stmmac.h"
#include <linux/reset.h>
#include <linux/of_mdio.h>
+#ifdef CONFIG_ARM_S5Pxx18_DEVFREQ
+#include <linux/pm_qos.h>
+#include <linux/soc/nexell/cpufreq.h>
+#include <linux/workqueue.h>
+#endif
+
+#ifdef CONFIG_ARM_S5Pxx18_DEVFREQ
+#define QOS_REQUEST_TIMEOUT_US 100000 /* 100 milliseconds */
+static struct pm_qos_request nx_net_qos;
+
+static void nx_net_qos_update(int val, int timeout)
+{
+ if (!pm_qos_request_active(&nx_net_qos))
+ pm_qos_add_request(&nx_net_qos, PM_QOS_BUS_THROUGHPUT, val);
+ else
+ pm_qos_update_request_timeout(&nx_net_qos, val,
+ timeout);
+}
+
+static void qos_request_work(struct work_struct *work)
+{
+ struct stmmac_priv *priv = container_of(work, struct stmmac_priv,
+ qos_work);
+ int timeout = priv->plat->boost_busfreq_timeout ? :
+ QOS_REQUEST_TIMEOUT_US;
+
+ nx_net_qos_update(NX_BUS_CLK_HIGH_KHZ, timeout);
+}
+#endif
- #define STMMAC_ALIGN(x) L1_CACHE_ALIGN(x)
+ #define STMMAC_ALIGN(x) __ALIGN_KERNEL(x, SMP_CACHE_BYTES)
/* Module parameters */
#define TX_TIMEO 5000