1 From 7992b4384d94c5e1bad998ca3a9a5781caac8e62 Mon Sep 17 00:00:00 2001
2 From: Yangbo Lu <yangbo.lu@nxp.com>
3 Date: Mon, 25 Sep 2017 09:52:26 +0800
4 Subject: [PATCH] config: support layerscape
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 This is a integrated patch for layerscape config/makefile support.
11 Signed-off-by: Yuantian Tang <andy.tang@nxp.com>
12 Signed-off-by: Zhang Ying-22455 <ying.zhang22455@nxp.com>
13 Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
14 Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
15 Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
16 Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
17 Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
19 drivers/base/Kconfig | 1 +
20 drivers/crypto/Makefile | 2 +-
21 drivers/net/ethernet/freescale/Kconfig | 4 +-
22 drivers/net/ethernet/freescale/Makefile | 2 +
23 drivers/ptp/Kconfig | 29 ++++++
24 drivers/rtc/Kconfig | 8 ++
25 drivers/rtc/Makefile | 1 +
26 drivers/soc/Kconfig | 3 +-
27 drivers/soc/fsl/Kconfig | 22 +++++
28 drivers/soc/fsl/Kconfig.arm | 16 ++++
29 drivers/soc/fsl/Makefile | 4 +
30 drivers/soc/fsl/layerscape/Kconfig | 10 +++
31 drivers/soc/fsl/layerscape/Makefile | 1 +
32 drivers/soc/fsl/rcpm.c | 154 ++++++++++++++++++++++++++++++++
33 drivers/staging/Kconfig | 6 ++
34 drivers/staging/Makefile | 3 +
35 drivers/staging/fsl-dpaa2/Kconfig | 41 +++++++++
36 drivers/staging/fsl-dpaa2/Makefile | 9 ++
37 18 files changed, 312 insertions(+), 4 deletions(-)
38 create mode 100644 drivers/soc/fsl/Kconfig
39 create mode 100644 drivers/soc/fsl/Kconfig.arm
40 create mode 100644 drivers/soc/fsl/layerscape/Kconfig
41 create mode 100644 drivers/soc/fsl/layerscape/Makefile
42 create mode 100644 drivers/soc/fsl/rcpm.c
43 create mode 100644 drivers/staging/fsl-dpaa2/Kconfig
44 create mode 100644 drivers/staging/fsl-dpaa2/Makefile
46 diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig
47 index e1c0e2e0..4211a7fd 100644
48 --- a/drivers/base/Kconfig
49 +++ b/drivers/base/Kconfig
50 @@ -237,6 +237,7 @@ config GENERIC_CPU_AUTOPROBE
56 source "drivers/base/regmap/Kconfig"
58 diff --git a/drivers/crypto/Makefile b/drivers/crypto/Makefile
59 index ad7250fa..6d788fd7 100644
60 --- a/drivers/crypto/Makefile
61 +++ b/drivers/crypto/Makefile
62 @@ -3,7 +3,7 @@ obj-$(CONFIG_CRYPTO_DEV_ATMEL_SHA) += atmel-sha.o
63 obj-$(CONFIG_CRYPTO_DEV_ATMEL_TDES) += atmel-tdes.o
64 obj-$(CONFIG_CRYPTO_DEV_BFIN_CRC) += bfin_crc.o
65 obj-$(CONFIG_CRYPTO_DEV_CCP) += ccp/
66 -obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM) += caam/
67 +obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM_COMMON) += caam/
68 obj-$(CONFIG_CRYPTO_DEV_GEODE) += geode-aes.o
69 obj-$(CONFIG_CRYPTO_DEV_HIFN_795X) += hifn_795x.o
70 obj-$(CONFIG_CRYPTO_DEV_IMGTEC_HASH) += img-hash.o
71 diff --git a/drivers/net/ethernet/freescale/Kconfig b/drivers/net/ethernet/freescale/Kconfig
72 index d1ca45fb..74a2864e 100644
73 --- a/drivers/net/ethernet/freescale/Kconfig
74 +++ b/drivers/net/ethernet/freescale/Kconfig
76 config NET_VENDOR_FREESCALE
77 bool "Freescale devices"
79 - depends on FSL_SOC || QUICC_ENGINE || CPM1 || CPM2 || PPC_MPC512x || \
80 + depends on FSL_SOC || (QUICC_ENGINE && PPC32) || CPM1 || CPM2 || PPC_MPC512x || \
81 M523x || M527x || M5272 || M528x || M520x || M532x || \
82 ARCH_MXC || ARCH_MXS || (PPC_MPC52xx && PPC_BESTCOMM) || \
84 @@ -93,4 +93,6 @@ config GIANFAR
85 and MPC86xx family of chips, the eTSEC on LS1021A and the FEC
88 +source "drivers/net/ethernet/freescale/sdk_fman/Kconfig"
89 +source "drivers/net/ethernet/freescale/sdk_dpaa/Kconfig"
90 endif # NET_VENDOR_FREESCALE
91 diff --git a/drivers/net/ethernet/freescale/Makefile b/drivers/net/ethernet/freescale/Makefile
92 index cbe21dc7..a5d4405f 100644
93 --- a/drivers/net/ethernet/freescale/Makefile
94 +++ b/drivers/net/ethernet/freescale/Makefile
95 @@ -21,4 +21,6 @@ gianfar_driver-objs := gianfar.o \
96 obj-$(CONFIG_UCC_GETH) += ucc_geth_driver.o
97 ucc_geth_driver-objs := ucc_geth.o ucc_geth_ethtool.o
99 +obj-$(if $(CONFIG_FSL_SDK_FMAN),y) += sdk_fman/
100 +obj-$(if $(CONFIG_FSL_SDK_DPAA_ETH),y) += sdk_dpaa/
101 obj-$(CONFIG_FSL_FMAN) += fman/
102 diff --git a/drivers/ptp/Kconfig b/drivers/ptp/Kconfig
103 index ee3de342..4c45beda 100644
104 --- a/drivers/ptp/Kconfig
105 +++ b/drivers/ptp/Kconfig
106 @@ -39,6 +39,35 @@ config PTP_1588_CLOCK_GIANFAR
107 To compile this driver as a module, choose M here: the module
108 will be called gianfar_ptp.
110 +config PTP_1588_CLOCK_DPAA
111 + tristate "Freescale DPAA as PTP clock"
112 + depends on FSL_SDK_DPAA_ETH
113 + select PTP_1588_CLOCK
117 + This driver adds support for using the DPAA 1588 timer module
118 + as a PTP clock. This clock is only useful if your PTP programs are
119 + getting hardware time stamps on the PTP Ethernet packets
120 + using the SO_TIMESTAMPING API.
122 + To compile this driver as a module, choose M here: the module
123 + will be called dpaa_ptp.
125 +config PTP_1588_CLOCK_DPAA2
126 + tristate "Freescale DPAA2 as PTP clock"
127 + depends on FSL_DPAA2_ETH
128 + select PTP_1588_CLOCK
131 + This driver adds support for using the DPAA2 1588 timer module
132 + as a PTP clock. This clock is only useful if your PTP programs are
133 + getting hardware time stamps on the PTP Ethernet packets
134 + using the SO_TIMESTAMPING API.
136 + To compile this driver as a module, choose M here: the module
137 + will be called dpaa2-rtc.
139 config PTP_1588_CLOCK_IXP46X
140 tristate "Intel IXP46x as PTP clock"
141 depends on IXP4XX_ETH
142 diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
143 index 0723c97e..df610dcd 100644
144 --- a/drivers/rtc/Kconfig
145 +++ b/drivers/rtc/Kconfig
146 @@ -414,6 +414,14 @@ config RTC_DRV_PCF85063
147 This driver can also be built as a module. If so, the module
148 will be called rtc-pcf85063.
150 +config RTC_DRV_PCF85263
151 + tristate "NXP PCF85263"
153 + If you say yes here you get support for the PCF85263 RTC chip
155 + This driver can also be built as a module. If so, the module
156 + will be called rtc-pcf85263.
158 config RTC_DRV_PCF8563
159 tristate "Philips PCF8563/Epson RTC8564"
161 diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile
162 index 1ac694a3..7675b8a7 100644
163 --- a/drivers/rtc/Makefile
164 +++ b/drivers/rtc/Makefile
165 @@ -111,6 +111,7 @@ obj-$(CONFIG_RTC_DRV_PCF2127) += rtc-pcf2127.o
166 obj-$(CONFIG_RTC_DRV_PCF50633) += rtc-pcf50633.o
167 obj-$(CONFIG_RTC_DRV_PCF85063) += rtc-pcf85063.o
168 obj-$(CONFIG_RTC_DRV_PCF8523) += rtc-pcf8523.o
169 +obj-$(CONFIG_RTC_DRV_PCF85263) += rtc-pcf85263.o
170 obj-$(CONFIG_RTC_DRV_PCF8563) += rtc-pcf8563.o
171 obj-$(CONFIG_RTC_DRV_PCF8583) += rtc-pcf8583.o
172 obj-$(CONFIG_RTC_DRV_PIC32) += rtc-pic32.o
173 diff --git a/drivers/soc/Kconfig b/drivers/soc/Kconfig
174 index e6e90e80..f31bceb6 100644
175 --- a/drivers/soc/Kconfig
176 +++ b/drivers/soc/Kconfig
178 menu "SOC (System On Chip) specific Drivers"
180 source "drivers/soc/bcm/Kconfig"
181 -source "drivers/soc/fsl/qbman/Kconfig"
182 -source "drivers/soc/fsl/qe/Kconfig"
183 +source "drivers/soc/fsl/Kconfig"
184 source "drivers/soc/mediatek/Kconfig"
185 source "drivers/soc/qcom/Kconfig"
186 source "drivers/soc/rockchip/Kconfig"
187 diff --git a/drivers/soc/fsl/Kconfig b/drivers/soc/fsl/Kconfig
189 index 00000000..d4cd25f1
191 +++ b/drivers/soc/fsl/Kconfig
194 +# Freescale SOC drivers
197 +source "drivers/soc/fsl/qbman/Kconfig"
198 +source "drivers/soc/fsl/qe/Kconfig"
199 +source "drivers/soc/fsl/ls2-console/Kconfig"
205 + The global utilities block controls power management, I/O device
206 + enabling, power-onreset(POR) configuration monitoring, alternate
207 + function selection for multiplexed signals,and clock control.
208 + This driver is to manage and access global utilities block.
209 + Initially only reading SVR and registering soc device are supported.
210 + Other guts accesses, such as reading RCW, should eventually be moved
211 + into this driver as well.
213 +source "drivers/soc/fsl/Kconfig.arm"
215 diff --git a/drivers/soc/fsl/Kconfig.arm b/drivers/soc/fsl/Kconfig.arm
217 index 00000000..106c9b98
219 +++ b/drivers/soc/fsl/Kconfig.arm
222 +# Freescale ARM SOC Drivers
225 +config LS_SOC_DRIVERS
226 + bool "Layerscape Soc Drivers"
227 + depends on ARCH_LAYERSCAPE || SOC_LS1021A
230 + Say y here to enable Freescale Layerscape Soc Device Drivers support.
231 + The Soc Drivers provides the device driver that is a specific block
232 + or feature on Layerscape platform.
235 + source "drivers/soc/fsl/layerscape/Kconfig"
237 diff --git a/drivers/soc/fsl/Makefile b/drivers/soc/fsl/Makefile
238 index 75e1f533..b8708569 100644
239 --- a/drivers/soc/fsl/Makefile
240 +++ b/drivers/soc/fsl/Makefile
242 obj-$(CONFIG_FSL_DPAA) += qbman/
243 obj-$(CONFIG_QUICC_ENGINE) += qe/
244 obj-$(CONFIG_CPM) += qe/
245 +obj-$(CONFIG_FSL_GUTS) += guts.o
246 +obj-$(CONFIG_FSL_LS2_CONSOLE) += ls2-console/
247 +obj-$(CONFIG_SUSPEND) += rcpm.o
248 +obj-$(CONFIG_LS_SOC_DRIVERS) += layerscape/
249 diff --git a/drivers/soc/fsl/layerscape/Kconfig b/drivers/soc/fsl/layerscape/Kconfig
251 index 00000000..e1373aa1
253 +++ b/drivers/soc/fsl/layerscape/Kconfig
256 +# Layerscape Soc drivers
259 + bool "FTM alarm driver"
262 + Say y here to enable FTM alarm support. The FTM alarm provides
263 + alarm functions for wakeup system from deep sleep. There is only
264 + one FTM can be used in ALARM(FTM 0).
265 diff --git a/drivers/soc/fsl/layerscape/Makefile b/drivers/soc/fsl/layerscape/Makefile
267 index 00000000..6299aa1d
269 +++ b/drivers/soc/fsl/layerscape/Makefile
271 +obj-$(CONFIG_FTM_ALARM) += ftm_alarm.o
272 diff --git a/drivers/soc/fsl/rcpm.c b/drivers/soc/fsl/rcpm.c
274 index 00000000..a6a31c87
276 +++ b/drivers/soc/fsl/rcpm.c
279 + * Run Control and Power Management (RCPM) driver
281 + * Copyright 2016 NXP
283 + * This program is free software; you can redistribute it and/or modify
284 + * it under the terms of the GNU General Public License as published by
285 + * the Free Software Foundation; either version 2 of the License, or
286 + * (at your option) any later version.
288 + * This program is distributed in the hope that it will be useful,
289 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
290 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
291 + * GNU General Public License for more details.
294 +#define pr_fmt(fmt) "RCPM: %s: " fmt, __func__
296 +#include <linux/kernel.h>
297 +#include <linux/io.h>
298 +#include <linux/of_platform.h>
299 +#include <linux/of_address.h>
300 +#include <linux/suspend.h>
302 +/* RCPM register offset */
303 +#define RCPM_IPPDEXPCR0 0x140
305 +#define RCPM_WAKEUP_CELL_SIZE 2
307 +struct rcpm_config {
309 + int ippdexpcr_offset;
311 + void *rcpm_reg_base;
314 +static struct rcpm_config *rcpm;
316 +static inline void rcpm_reg_write(u32 offset, u32 value)
318 + iowrite32be(value, rcpm->rcpm_reg_base + offset);
321 +static inline u32 rcpm_reg_read(u32 offset)
323 + return ioread32be(rcpm->rcpm_reg_base + offset);
326 +static void rcpm_wakeup_fixup(struct device *dev, void *data)
328 + struct device_node *node = dev ? dev->of_node : NULL;
329 + u32 value[RCPM_WAKEUP_CELL_SIZE];
332 + if (!dev || !node || !device_may_wakeup(dev))
336 + * Get the values in the "rcpm-wakeup" property.
337 + * Three values are:
338 + * The first is a pointer to the RCPM node.
339 + * The second is the value of the ippdexpcr0 register.
340 + * The third is the value of the ippdexpcr1 register.
342 + ret = of_property_read_u32_array(node, "fsl,rcpm-wakeup",
343 + value, RCPM_WAKEUP_CELL_SIZE);
347 + pr_debug("wakeup source: the device %s\n", node->full_name);
349 + for (i = 0; i < rcpm->ipp_num; i++)
350 + rcpm->ippdexpcr[i] |= value[i + 1];
353 +static int rcpm_suspend_prepare(void)
359 + for (i = 0; i < rcpm->ipp_num; i++)
360 + rcpm->ippdexpcr[i] = 0;
362 + dpm_for_each_dev(NULL, rcpm_wakeup_fixup);
364 + for (i = 0; i < rcpm->ipp_num; i++) {
365 + rcpm_reg_write(rcpm->ippdexpcr_offset + 4 * i,
366 + rcpm->ippdexpcr[i]);
367 + pr_debug("ippdexpcr%d = 0x%x\n", i, rcpm->ippdexpcr[i]);
373 +static int rcpm_suspend_notifier_call(struct notifier_block *bl,
374 + unsigned long state,
378 + case PM_SUSPEND_PREPARE:
379 + rcpm_suspend_prepare();
383 + return NOTIFY_DONE;
386 +static struct rcpm_config rcpm_default_config = {
388 + .ippdexpcr_offset = RCPM_IPPDEXPCR0,
391 +static const struct of_device_id rcpm_matches[] = {
393 + .compatible = "fsl,qoriq-rcpm-2.1",
394 + .data = &rcpm_default_config,
399 +static struct notifier_block rcpm_suspend_notifier = {
400 + .notifier_call = rcpm_suspend_notifier_call,
403 +static int __init layerscape_rcpm_init(void)
405 + const struct of_device_id *match;
406 + struct device_node *np;
408 + np = of_find_matching_node_and_match(NULL, rcpm_matches, &match);
410 + pr_err("Can't find the RCPM node.\n");
415 + rcpm = (struct rcpm_config *)match->data;
419 + rcpm->rcpm_reg_base = of_iomap(np, 0);
421 + if (!rcpm->rcpm_reg_base)
424 + register_pm_notifier(&rcpm_suspend_notifier);
426 + pr_info("The RCPM driver initialized.\n");
431 +subsys_initcall(layerscape_rcpm_init);
432 diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
433 index 58a7b350..6c69e3bd 100644
434 --- a/drivers/staging/Kconfig
435 +++ b/drivers/staging/Kconfig
436 @@ -94,6 +94,8 @@ source "drivers/staging/fbtft/Kconfig"
438 source "drivers/staging/fsl-mc/Kconfig"
440 +source "drivers/staging/fsl-dpaa2/Kconfig"
442 source "drivers/staging/wilc1000/Kconfig"
444 source "drivers/staging/most/Kconfig"
445 @@ -106,4 +108,8 @@ source "drivers/staging/greybus/Kconfig"
447 source "drivers/staging/vc04_services/Kconfig"
449 +source "drivers/staging/fsl_qbman/Kconfig"
451 +source "drivers/staging/fsl_ppfe/Kconfig"
454 diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
455 index 2fa9745d..ee817a5e 100644
456 --- a/drivers/staging/Makefile
457 +++ b/drivers/staging/Makefile
458 @@ -36,9 +36,12 @@ obj-$(CONFIG_UNISYSSPAR) += unisys/
459 obj-$(CONFIG_COMMON_CLK_XLNX_CLKWZRD) += clocking-wizard/
460 obj-$(CONFIG_FB_TFT) += fbtft/
461 obj-$(CONFIG_FSL_MC_BUS) += fsl-mc/
462 +obj-$(CONFIG_FSL_DPAA2) += fsl-dpaa2/
463 obj-$(CONFIG_WILC1000) += wilc1000/
464 obj-$(CONFIG_MOST) += most/
465 obj-$(CONFIG_ISDN_I4L) += i4l/
466 obj-$(CONFIG_KS7010) += ks7010/
467 obj-$(CONFIG_GREYBUS) += greybus/
468 obj-$(CONFIG_BCM2708_VCHIQ) += vc04_services/
469 +obj-$(CONFIG_FSL_SDK_DPA) += fsl_qbman/
470 +obj-$(CONFIG_FSL_PPFE) += fsl_ppfe/
471 diff --git a/drivers/staging/fsl-dpaa2/Kconfig b/drivers/staging/fsl-dpaa2/Kconfig
473 index 00000000..8042d9cc
475 +++ b/drivers/staging/fsl-dpaa2/Kconfig
478 +# Freescale DataPath Acceleration Architecture Gen2 (DPAA2) drivers
482 + bool "Freescale DPAA2 devices"
483 + depends on FSL_MC_BUS
485 + Build drivers for Freescale DataPath Acceleration
486 + Architecture (DPAA2) family of SoCs.
488 +config FSL_DPAA2_ETH
489 + tristate "Freescale DPAA2 Ethernet"
490 + depends on FSL_DPAA2 && FSL_MC_DPIO
492 + Ethernet driver for Freescale DPAA2 SoCs, using the
493 + Freescale MC bus driver
496 +config FSL_DPAA2_ETH_USE_ERR_QUEUE
497 + bool "Enable Rx error queue"
500 + Allow Rx error frames to be enqueued on an error queue
501 + and processed by the driver (by default they are dropped
503 + This may impact performance, recommended for debugging
506 +# QBMAN_DEBUG requires some additional DPIO APIs
507 +config FSL_DPAA2_ETH_DEBUGFS
508 + depends on DEBUG_FS && FSL_QBMAN_DEBUG
509 + bool "Enable debugfs support"
512 + Enable advanced statistics through debugfs interface.
515 +source "drivers/staging/fsl-dpaa2/mac/Kconfig"
516 +source "drivers/staging/fsl-dpaa2/evb/Kconfig"
517 +source "drivers/staging/fsl-dpaa2/ethsw/Kconfig"
518 diff --git a/drivers/staging/fsl-dpaa2/Makefile b/drivers/staging/fsl-dpaa2/Makefile
520 index 00000000..cbaa8c20
522 +++ b/drivers/staging/fsl-dpaa2/Makefile
525 +# Freescale DataPath Acceleration Architecture Gen2 (DPAA2) drivers
528 +obj-$(CONFIG_FSL_DPAA2_ETH) += ethernet/
529 +obj-$(CONFIG_FSL_DPAA2_MAC) += mac/
530 +obj-$(CONFIG_FSL_DPAA2_EVB) += evb/
531 +obj-$(CONFIG_FSL_DPAA2_ETHSW) += ethsw/
532 +obj-$(CONFIG_PTP_1588_CLOCK_DPAA2) += rtc/