layerscape: update patches-4.9 to LSDK1712
[openwrt/staging/kaloz.git] / target / linux / layerscape / patches-4.9 / 201-config-support-layerscape.patch
index 4b4fd73c2577981ce23a670cd29ed4c9fddc42fd..218421265a2cfd4cb5181297a256ee8bcb7637da 100644 (file)
@@ -1,12 +1,12 @@
-From 7992b4384d94c5e1bad998ca3a9a5781caac8e62 Mon Sep 17 00:00:00 2001
+From e43dec70614b55ba1ce24dfcdf8f51e36d800af2 Mon Sep 17 00:00:00 2001
 From: Yangbo Lu <yangbo.lu@nxp.com>
-Date: Mon, 25 Sep 2017 09:52:26 +0800
-Subject: [PATCH] config: support layerscape
+Date: Wed, 17 Jan 2018 15:26:46 +0800
+Subject: [PATCH 01/30] config: support layerscape
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
 
-This is a integrated patch for layerscape config/makefile support.
+This is an integrated patch for layerscape config/makefile support.
 
 Signed-off-by: Yuantian Tang <andy.tang@nxp.com>
 Signed-off-by: Zhang Ying-22455 <ying.zhang22455@nxp.com>
@@ -16,38 +16,45 @@ Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
 Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
 Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 ---
drivers/base/Kconfig                    |   1 +
- drivers/crypto/Makefile                 |   2 +-
- drivers/net/ethernet/freescale/Kconfig  |   4 +-
- drivers/net/ethernet/freescale/Makefile |   2 +
- drivers/ptp/Kconfig                     |  29 ++++++
- drivers/rtc/Kconfig                     |   8 ++
- drivers/rtc/Makefile                    |   1 +
- drivers/soc/Kconfig                     |   3 +-
- drivers/soc/fsl/Kconfig                 |  22 +++++
- drivers/soc/fsl/Kconfig.arm             |  16 ++++
- drivers/soc/fsl/Makefile                |   4 +
- drivers/soc/fsl/layerscape/Kconfig      |  10 +++
- drivers/soc/fsl/layerscape/Makefile     |   1 +
- drivers/soc/fsl/rcpm.c                  | 154 ++++++++++++++++++++++++++++++++
- drivers/staging/Kconfig                 |   6 ++
- drivers/staging/Makefile                |   3 +
- drivers/staging/fsl-dpaa2/Kconfig       |  41 +++++++++
- drivers/staging/fsl-dpaa2/Makefile      |   9 ++
- 18 files changed, 312 insertions(+), 4 deletions(-)
arch/arm/mach-imx/Kconfig               |  1 +
+ drivers/base/Kconfig                    |  1 +
+ drivers/crypto/Makefile                 |  2 +-
+ drivers/net/ethernet/freescale/Kconfig  |  4 ++-
+ drivers/net/ethernet/freescale/Makefile |  2 ++
+ drivers/ptp/Kconfig                     | 29 +++++++++++++++++++
+ drivers/rtc/Kconfig                     |  8 ++++++
+ drivers/rtc/Makefile                    |  1 +
+ drivers/soc/Kconfig                     |  3 +-
+ drivers/soc/fsl/Kconfig                 | 22 ++++++++++++++
+ drivers/soc/fsl/Kconfig.arm             | 16 +++++++++++
+ drivers/soc/fsl/Makefile                |  4 +++
+ drivers/soc/fsl/layerscape/Kconfig      | 10 +++++++
+ drivers/soc/fsl/layerscape/Makefile     |  1 +
+ drivers/staging/Kconfig                 |  6 ++++
+ drivers/staging/Makefile                |  3 ++
+ drivers/staging/fsl-dpaa2/Kconfig       | 51 +++++++++++++++++++++++++++++++++
+ drivers/staging/fsl-dpaa2/Makefile      |  9 ++++++
+ 18 files changed, 169 insertions(+), 4 deletions(-)
  create mode 100644 drivers/soc/fsl/Kconfig
  create mode 100644 drivers/soc/fsl/Kconfig.arm
  create mode 100644 drivers/soc/fsl/layerscape/Kconfig
  create mode 100644 drivers/soc/fsl/layerscape/Makefile
- create mode 100644 drivers/soc/fsl/rcpm.c
  create mode 100644 drivers/staging/fsl-dpaa2/Kconfig
  create mode 100644 drivers/staging/fsl-dpaa2/Makefile
 
-diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig
-index e1c0e2e0..4211a7fd 100644
+--- a/arch/arm/mach-imx/Kconfig
++++ b/arch/arm/mach-imx/Kconfig
+@@ -1,6 +1,7 @@
+ menuconfig ARCH_MXC
+       bool "Freescale i.MX family"
+       depends on ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7 || ARM_SINGLE_ARMV7M
++      select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE
+       select ARCH_SUPPORTS_BIG_ENDIAN
+       select CLKSRC_IMX_GPT
+       select GENERIC_IRQ_CHIP
 --- a/drivers/base/Kconfig
 +++ b/drivers/base/Kconfig
-@@ -237,6 +237,7 @@ config GENERIC_CPU_AUTOPROBE
+@@ -240,6 +240,7 @@ config GENERIC_CPU_VULNERABILITIES
  
  config SOC_BUS
        bool
@@ -55,11 +62,9 @@ index e1c0e2e0..4211a7fd 100644
  
  source "drivers/base/regmap/Kconfig"
  
-diff --git a/drivers/crypto/Makefile b/drivers/crypto/Makefile
-index ad7250fa..6d788fd7 100644
 --- a/drivers/crypto/Makefile
 +++ b/drivers/crypto/Makefile
-@@ -3,7 +3,7 @@ obj-$(CONFIG_CRYPTO_DEV_ATMEL_SHA) += atmel-sha.o
+@@ -3,7 +3,7 @@ obj-$(CONFIG_CRYPTO_DEV_ATMEL_SHA) += at
  obj-$(CONFIG_CRYPTO_DEV_ATMEL_TDES) += atmel-tdes.o
  obj-$(CONFIG_CRYPTO_DEV_BFIN_CRC) += bfin_crc.o
  obj-$(CONFIG_CRYPTO_DEV_CCP) += ccp/
@@ -68,8 +73,6 @@ index ad7250fa..6d788fd7 100644
  obj-$(CONFIG_CRYPTO_DEV_GEODE) += geode-aes.o
  obj-$(CONFIG_CRYPTO_DEV_HIFN_795X) += hifn_795x.o
  obj-$(CONFIG_CRYPTO_DEV_IMGTEC_HASH) += img-hash.o
-diff --git a/drivers/net/ethernet/freescale/Kconfig b/drivers/net/ethernet/freescale/Kconfig
-index d1ca45fb..74a2864e 100644
 --- a/drivers/net/ethernet/freescale/Kconfig
 +++ b/drivers/net/ethernet/freescale/Kconfig
 @@ -5,7 +5,7 @@
@@ -88,8 +91,6 @@ index d1ca45fb..74a2864e 100644
 +source "drivers/net/ethernet/freescale/sdk_fman/Kconfig"
 +source "drivers/net/ethernet/freescale/sdk_dpaa/Kconfig"
  endif # NET_VENDOR_FREESCALE
-diff --git a/drivers/net/ethernet/freescale/Makefile b/drivers/net/ethernet/freescale/Makefile
-index cbe21dc7..a5d4405f 100644
 --- a/drivers/net/ethernet/freescale/Makefile
 +++ b/drivers/net/ethernet/freescale/Makefile
 @@ -21,4 +21,6 @@ gianfar_driver-objs := gianfar.o \
@@ -99,8 +100,6 @@ index cbe21dc7..a5d4405f 100644
 +obj-$(if $(CONFIG_FSL_SDK_FMAN),y) += sdk_fman/
 +obj-$(if $(CONFIG_FSL_SDK_DPAA_ETH),y) += sdk_dpaa/
  obj-$(CONFIG_FSL_FMAN) += fman/
-diff --git a/drivers/ptp/Kconfig b/drivers/ptp/Kconfig
-index ee3de342..4c45beda 100644
 --- a/drivers/ptp/Kconfig
 +++ b/drivers/ptp/Kconfig
 @@ -39,6 +39,35 @@ config PTP_1588_CLOCK_GIANFAR
@@ -139,8 +138,6 @@ index ee3de342..4c45beda 100644
  config PTP_1588_CLOCK_IXP46X
        tristate "Intel IXP46x as PTP clock"
        depends on IXP4XX_ETH
-diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
-index 0723c97e..df610dcd 100644
 --- a/drivers/rtc/Kconfig
 +++ b/drivers/rtc/Kconfig
 @@ -414,6 +414,14 @@ config RTC_DRV_PCF85063
@@ -158,11 +155,9 @@ index 0723c97e..df610dcd 100644
  config RTC_DRV_PCF8563
        tristate "Philips PCF8563/Epson RTC8564"
        help
-diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile
-index 1ac694a3..7675b8a7 100644
 --- a/drivers/rtc/Makefile
 +++ b/drivers/rtc/Makefile
-@@ -111,6 +111,7 @@ obj-$(CONFIG_RTC_DRV_PCF2127)      += rtc-pcf2127.o
+@@ -111,6 +111,7 @@ obj-$(CONFIG_RTC_DRV_PCF2127)      += rtc-pcf
  obj-$(CONFIG_RTC_DRV_PCF50633)        += rtc-pcf50633.o
  obj-$(CONFIG_RTC_DRV_PCF85063)        += rtc-pcf85063.o
  obj-$(CONFIG_RTC_DRV_PCF8523) += rtc-pcf8523.o
@@ -170,8 +165,6 @@ index 1ac694a3..7675b8a7 100644
  obj-$(CONFIG_RTC_DRV_PCF8563) += rtc-pcf8563.o
  obj-$(CONFIG_RTC_DRV_PCF8583) += rtc-pcf8583.o
  obj-$(CONFIG_RTC_DRV_PIC32)   += rtc-pic32.o
-diff --git a/drivers/soc/Kconfig b/drivers/soc/Kconfig
-index e6e90e80..f31bceb6 100644
 --- a/drivers/soc/Kconfig
 +++ b/drivers/soc/Kconfig
 @@ -1,8 +1,7 @@
@@ -184,9 +177,6 @@ index e6e90e80..f31bceb6 100644
  source "drivers/soc/mediatek/Kconfig"
  source "drivers/soc/qcom/Kconfig"
  source "drivers/soc/rockchip/Kconfig"
-diff --git a/drivers/soc/fsl/Kconfig b/drivers/soc/fsl/Kconfig
-new file mode 100644
-index 00000000..d4cd25f1
 --- /dev/null
 +++ b/drivers/soc/fsl/Kconfig
 @@ -0,0 +1,22 @@
@@ -212,9 +202,6 @@ index 00000000..d4cd25f1
 +if ARM || ARM64
 +source "drivers/soc/fsl/Kconfig.arm"
 +endif
-diff --git a/drivers/soc/fsl/Kconfig.arm b/drivers/soc/fsl/Kconfig.arm
-new file mode 100644
-index 00000000..106c9b98
 --- /dev/null
 +++ b/drivers/soc/fsl/Kconfig.arm
 @@ -0,0 +1,16 @@
@@ -234,8 +221,6 @@ index 00000000..106c9b98
 +if LS_SOC_DRIVERS
 +      source "drivers/soc/fsl/layerscape/Kconfig"
 +endif
-diff --git a/drivers/soc/fsl/Makefile b/drivers/soc/fsl/Makefile
-index 75e1f533..b8708569 100644
 --- a/drivers/soc/fsl/Makefile
 +++ b/drivers/soc/fsl/Makefile
 @@ -5,3 +5,7 @@
@@ -246,9 +231,6 @@ index 75e1f533..b8708569 100644
 +obj-$(CONFIG_FSL_LS2_CONSOLE)         += ls2-console/
 +obj-$(CONFIG_SUSPEND)                 += rcpm.o
 +obj-$(CONFIG_LS_SOC_DRIVERS)          += layerscape/
-diff --git a/drivers/soc/fsl/layerscape/Kconfig b/drivers/soc/fsl/layerscape/Kconfig
-new file mode 100644
-index 00000000..e1373aa1
 --- /dev/null
 +++ b/drivers/soc/fsl/layerscape/Kconfig
 @@ -0,0 +1,10 @@
@@ -262,175 +244,10 @@ index 00000000..e1373aa1
 +      Say y here to enable FTM alarm support.  The FTM alarm provides
 +      alarm functions for wakeup system from deep sleep.  There is only
 +      one FTM can be used in ALARM(FTM 0).
-diff --git a/drivers/soc/fsl/layerscape/Makefile b/drivers/soc/fsl/layerscape/Makefile
-new file mode 100644
-index 00000000..6299aa1d
 --- /dev/null
 +++ b/drivers/soc/fsl/layerscape/Makefile
 @@ -0,0 +1 @@
 +obj-$(CONFIG_FTM_ALARM) += ftm_alarm.o
-diff --git a/drivers/soc/fsl/rcpm.c b/drivers/soc/fsl/rcpm.c
-new file mode 100644
-index 00000000..a6a31c87
---- /dev/null
-+++ b/drivers/soc/fsl/rcpm.c
-@@ -0,0 +1,154 @@
-+/*
-+ * Run Control and Power Management (RCPM) driver
-+ *
-+ * Copyright 2016 NXP
-+ *
-+ * 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.
-+ *
-+ */
-+#define pr_fmt(fmt) "RCPM: %s: " fmt, __func__
-+
-+#include <linux/kernel.h>
-+#include <linux/io.h>
-+#include <linux/of_platform.h>
-+#include <linux/of_address.h>
-+#include <linux/suspend.h>
-+
-+/* RCPM register offset */
-+#define RCPM_IPPDEXPCR0                       0x140
-+
-+#define RCPM_WAKEUP_CELL_SIZE 2
-+
-+struct rcpm_config {
-+      int ipp_num;
-+      int ippdexpcr_offset;
-+      u32 ippdexpcr[2];
-+      void *rcpm_reg_base;
-+};
-+
-+static struct rcpm_config *rcpm;
-+
-+static inline void rcpm_reg_write(u32 offset, u32 value)
-+{
-+      iowrite32be(value, rcpm->rcpm_reg_base + offset);
-+}
-+
-+static inline u32 rcpm_reg_read(u32 offset)
-+{
-+      return ioread32be(rcpm->rcpm_reg_base + offset);
-+}
-+
-+static void rcpm_wakeup_fixup(struct device *dev, void *data)
-+{
-+      struct device_node *node = dev ? dev->of_node : NULL;
-+      u32 value[RCPM_WAKEUP_CELL_SIZE];
-+      int ret, i;
-+
-+      if (!dev || !node || !device_may_wakeup(dev))
-+              return;
-+
-+      /*
-+       * Get the values in the "rcpm-wakeup" property.
-+       * Three values are:
-+       * The first is a pointer to the RCPM node.
-+       * The second is the value of the ippdexpcr0 register.
-+       * The third is the value of the ippdexpcr1 register.
-+       */
-+      ret = of_property_read_u32_array(node, "fsl,rcpm-wakeup",
-+                                       value, RCPM_WAKEUP_CELL_SIZE);
-+      if (ret)
-+              return;
-+
-+      pr_debug("wakeup source: the device %s\n", node->full_name);
-+
-+      for (i = 0; i < rcpm->ipp_num; i++)
-+              rcpm->ippdexpcr[i] |= value[i + 1];
-+}
-+
-+static int rcpm_suspend_prepare(void)
-+{
-+      int i;
-+
-+      BUG_ON(!rcpm);
-+
-+      for (i = 0; i < rcpm->ipp_num; i++)
-+              rcpm->ippdexpcr[i] = 0;
-+
-+      dpm_for_each_dev(NULL, rcpm_wakeup_fixup);
-+
-+      for (i = 0; i < rcpm->ipp_num; i++) {
-+              rcpm_reg_write(rcpm->ippdexpcr_offset + 4 * i,
-+                             rcpm->ippdexpcr[i]);
-+              pr_debug("ippdexpcr%d = 0x%x\n", i, rcpm->ippdexpcr[i]);
-+      }
-+
-+      return 0;
-+}
-+
-+static int rcpm_suspend_notifier_call(struct notifier_block *bl,
-+                                    unsigned long state,
-+                                    void *unused)
-+{
-+      switch (state) {
-+      case PM_SUSPEND_PREPARE:
-+              rcpm_suspend_prepare();
-+              break;
-+      }
-+
-+      return NOTIFY_DONE;
-+}
-+
-+static struct rcpm_config rcpm_default_config = {
-+      .ipp_num = 1,
-+      .ippdexpcr_offset = RCPM_IPPDEXPCR0,
-+};
-+
-+static const struct of_device_id rcpm_matches[] = {
-+      {
-+              .compatible = "fsl,qoriq-rcpm-2.1",
-+              .data = &rcpm_default_config,
-+      },
-+      {}
-+};
-+
-+static struct notifier_block rcpm_suspend_notifier = {
-+      .notifier_call = rcpm_suspend_notifier_call,
-+};
-+
-+static int __init layerscape_rcpm_init(void)
-+{
-+      const struct of_device_id *match;
-+      struct device_node *np;
-+
-+      np = of_find_matching_node_and_match(NULL, rcpm_matches, &match);
-+      if (!np) {
-+              pr_err("Can't find the RCPM node.\n");
-+              return -EINVAL;
-+      }
-+
-+      if (match->data)
-+              rcpm = (struct rcpm_config *)match->data;
-+      else
-+              return -EINVAL;
-+
-+      rcpm->rcpm_reg_base = of_iomap(np, 0);
-+      of_node_put(np);
-+      if (!rcpm->rcpm_reg_base)
-+              return -ENOMEM;
-+
-+      register_pm_notifier(&rcpm_suspend_notifier);
-+
-+      pr_info("The RCPM driver initialized.\n");
-+
-+      return 0;
-+}
-+
-+subsys_initcall(layerscape_rcpm_init);
-diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
-index 58a7b350..6c69e3bd 100644
 --- a/drivers/staging/Kconfig
 +++ b/drivers/staging/Kconfig
 @@ -94,6 +94,8 @@ source "drivers/staging/fbtft/Kconfig"
@@ -451,8 +268,6 @@ index 58a7b350..6c69e3bd 100644
 +source "drivers/staging/fsl_ppfe/Kconfig"
 +
  endif # STAGING
-diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
-index 2fa9745d..ee817a5e 100644
 --- a/drivers/staging/Makefile
 +++ b/drivers/staging/Makefile
 @@ -36,9 +36,12 @@ obj-$(CONFIG_UNISYSSPAR)    += unisys/
@@ -468,12 +283,9 @@ index 2fa9745d..ee817a5e 100644
  obj-$(CONFIG_BCM2708_VCHIQ)   += vc04_services/
 +obj-$(CONFIG_FSL_SDK_DPA)     += fsl_qbman/
 +obj-$(CONFIG_FSL_PPFE)                += fsl_ppfe/
-diff --git a/drivers/staging/fsl-dpaa2/Kconfig b/drivers/staging/fsl-dpaa2/Kconfig
-new file mode 100644
-index 00000000..8042d9cc
 --- /dev/null
 +++ b/drivers/staging/fsl-dpaa2/Kconfig
-@@ -0,0 +1,41 @@
+@@ -0,0 +1,51 @@
 +#
 +# Freescale DataPath Acceleration Architecture Gen2 (DPAA2) drivers
 +#
@@ -510,14 +322,21 @@ index 00000000..8042d9cc
 +      default n
 +      ---help---
 +        Enable advanced statistics through debugfs interface.
++
++config FSL_DPAA2_ETH_DCB
++        bool "Data Center Bridging (DCB) Support"
++        default n
++        depends on DCB
++        ---help---
++          Say Y here if you want to use Data Center Bridging (DCB) features
++          (PFC) in the driver.
++
++          If unsure, say N.
 +endif
 +
 +source "drivers/staging/fsl-dpaa2/mac/Kconfig"
 +source "drivers/staging/fsl-dpaa2/evb/Kconfig"
 +source "drivers/staging/fsl-dpaa2/ethsw/Kconfig"
-diff --git a/drivers/staging/fsl-dpaa2/Makefile b/drivers/staging/fsl-dpaa2/Makefile
-new file mode 100644
-index 00000000..cbaa8c20
 --- /dev/null
 +++ b/drivers/staging/fsl-dpaa2/Makefile
 @@ -0,0 +1,9 @@
@@ -530,6 +349,3 @@ index 00000000..cbaa8c20
 +obj-$(CONFIG_FSL_DPAA2_EVB)   += evb/
 +obj-$(CONFIG_FSL_DPAA2_ETHSW) += ethsw/
 +obj-$(CONFIG_PTP_1588_CLOCK_DPAA2) += rtc/
--- 
-2.14.1
-