kernel: bump 4.9 to 4.9.63

Refreshed all patches.

Removed upstreamed parts.

Compile-tested: cns3xxx, imx6, mvebu, layerscape
Run-tested: cns3xxx, imx6

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
v19.07.3_mercusys_ac12_duma
Koen Vandeputte 7 years ago committed by Hauke Mehrtens
parent 9052dd6534
commit 62ede4f783

@ -4,11 +4,11 @@ LINUX_RELEASE?=1
LINUX_VERSION-3.18 = .71
LINUX_VERSION-4.4 = .93
LINUX_VERSION-4.9 = .58
LINUX_VERSION-4.9 = .63
LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
LINUX_KERNEL_HASH-4.4.93 = ed349314f16e78a6571b5f8884f6452782aef6c26b81bcc7ccdac44ecd917c36
LINUX_KERNEL_HASH-4.9.58 = 748f12a28689644b6a9102c67f8fa7938ca73823a949ba6f65024aecf2f221a7
LINUX_KERNEL_HASH-4.9.63 = 21c9386f33fd3453ca67f7478b4c1ba34067645ef6d391871029cbd7f5df2ea3
ifdef KERNEL_PATCHVER
LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))

@ -1,23 +0,0 @@
From 443ab715a40881d6c9ba11b027ba154bac904cb0 Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Date: Sat, 10 May 2014 23:19:08 +0200
Subject: [PATCH] MIPS/AR7: ensure that serial ports are properly set up
without UPF_FIXED_TYPE, the data from the PORT_AR7 uart_config entry is
never copied, resulting in a dead port.
Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
---
arch/mips/ar7/platform.c | 1 +
1 file changed, 1 insertion(+)
--- a/arch/mips/ar7/platform.c
+++ b/arch/mips/ar7/platform.c
@@ -576,6 +576,7 @@ static int __init ar7_register_uarts(voi
uart_port.type = PORT_AR7;
uart_port.uartclk = clk_get_rate(bus_clk) / 2;
uart_port.iotype = UPIO_MEM32;
+ uart_port.flags = UPF_FIXED_TYPE;
uart_port.regshift = 2;
uart_port.line = 0;

@ -1,45 +0,0 @@
From 3a8d54573f9d187779d36d6b45e8e0288b82c31a Mon Sep 17 00:00:00 2001
From: Jonas Gorski <jonas.gorski@gmail.com>
Date: Thu, 26 Oct 2017 23:25:44 +0200
Subject: [PATCH 1/3] MIPS: AR7: defer registration of GPIO
When called from prom init code, ar7_gpio_init() will fail as it will
call gpiochip_add() which relies on a working kmalloc() to alloc
the gpio_desc array and kmalloc is not useable yet at prom init time.
Move ar7_gpio_init() to ar7_register_devices() (a device_initcall)
where kmalloc works.
Fixes: 14e85c0e69d5 ("gpio: remove gpio_descs global array")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
Text shamelessy stolen from commit 2ec459f2a77b8.
arch/mips/ar7/platform.c | 4 ++++
arch/mips/ar7/prom.c | 2 --
2 files changed, 4 insertions(+), 2 deletions(-)
--- a/arch/mips/ar7/platform.c
+++ b/arch/mips/ar7/platform.c
@@ -655,6 +655,10 @@ static int __init ar7_register_devices(v
u32 val;
int res;
+ res = ar7_gpio_init();
+ if (res)
+ pr_warn("unable to register gpios: %d\n", res);
+
res = ar7_register_uarts();
if (res)
pr_err("unable to setup uart(s): %d\n", res);
--- a/arch/mips/ar7/prom.c
+++ b/arch/mips/ar7/prom.c
@@ -246,8 +246,6 @@ void __init prom_init(void)
ar7_init_cmdline(fw_arg0, (char **)fw_arg1);
ar7_init_env((struct env_var *)fw_arg2);
console_config();
-
- ar7_gpio_init();
}
#define PORT(offset) (KSEG1ADDR(AR7_REGS_UART0 + (offset * 4)))

@ -1,6 +1,6 @@
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -1211,4 +1211,12 @@ config GPIO_VIPERBOARD
@@ -1213,4 +1213,12 @@ config GPIO_VIPERBOARD
endmenu

@ -1,6 +1,6 @@
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -1218,4 +1218,9 @@ config GPIO_NXP_74HC153
@@ -1220,4 +1220,9 @@ config GPIO_NXP_74HC153
Platform driver for NXP 74HC153 Dual 4-input Multiplexer. This
provides a GPIO interface supporting input mode only.

@ -696,7 +696,7 @@ Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
}
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -5042,7 +5042,7 @@ static void port_event(struct usb_hub *h
@@ -5045,7 +5045,7 @@ static void port_event(struct usb_hub *h
if (portchange & USB_PORT_STAT_C_OVERCURRENT) {
u16 status = 0, unused;

@ -60,7 +60,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
nval = cmpxchg(&tp->tsq_flags, oval, nval);
if (nval != oval)
continue;
@@ -2182,6 +2182,8 @@ static bool tcp_write_xmit(struct sock *
@@ -2183,6 +2183,8 @@ static bool tcp_write_xmit(struct sock *
unlikely(tso_fragment(sk, skb, limit, mss_now, gfp)))
break;

@ -19,7 +19,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2087,6 +2087,15 @@ static bool tcp_small_queue_check(struct
@@ -2088,6 +2088,15 @@ static bool tcp_small_queue_check(struct
limit <<= factor;
if (atomic_read(&sk->sk_wmem_alloc) > limit) {

@ -114,7 +114,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (nval != oval)
continue;
@@ -2096,7 +2096,7 @@ static bool tcp_small_queue_check(struct
@@ -2097,7 +2097,7 @@ static bool tcp_small_queue_check(struct
skb->prev == sk->sk_write_queue.next)
return false;
@ -123,7 +123,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* It is possible TX completion already happened
* before we set TSQ_THROTTLED, so we must
* test again the condition.
@@ -2194,8 +2194,8 @@ static bool tcp_write_xmit(struct sock *
@@ -2195,8 +2195,8 @@ static bool tcp_write_xmit(struct sock *
unlikely(tso_fragment(sk, skb, limit, mss_now, gfp)))
break;
@ -134,7 +134,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (tcp_small_queue_check(sk, skb, 0))
break;
@@ -3508,8 +3508,6 @@ void tcp_send_ack(struct sock *sk)
@@ -3509,8 +3509,6 @@ void tcp_send_ack(struct sock *sk)
/* We do not want pure acks influencing TCP Small Queues or fq/pacing
* too much.
* SKB_TRUESIZE(max(1 .. 66, MAX_TCP_HEADER)) is unfortunately ~784

@ -55,7 +55,7 @@ Cc: Kir Kolyshkin <kir@openvz.org>
rwlock_t sk_callback_lock;
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -2478,6 +2478,7 @@ void sock_init_data(struct socket *sock,
@@ -2475,6 +2475,7 @@ void sock_init_data(struct socket *sock,
sk->sk_max_pacing_rate = ~0U;
sk->sk_pacing_rate = ~0U;
@ -74,7 +74,7 @@ Cc: Kir Kolyshkin <kir@openvz.org>
sk->sk_gso_max_size - 1 - MAX_TCP_HEADER);
/* Goal is to send at least one packet per ms,
@@ -2083,7 +2083,7 @@ static bool tcp_small_queue_check(struct
@@ -2084,7 +2084,7 @@ static bool tcp_small_queue_check(struct
{
unsigned int limit;

@ -399,7 +399,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* bnx2x_has_rx_work() reads the status block,
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -1768,7 +1768,7 @@ static int bnxt_poll_nitroa0(struct napi
@@ -1774,7 +1774,7 @@ static int bnxt_poll_nitroa0(struct napi
}
if (!bnxt_has_work(bp, cpr) && rx_pkts < budget) {
@ -803,7 +803,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -2696,11 +2696,9 @@ static int mvneta_poll(struct napi_struc
@@ -2697,11 +2697,9 @@ static int mvneta_poll(struct napi_struc
rx_done = mvneta_rx_swbm(pp, budget, &pp->rxqs[rx_queue]);
}
@ -1346,7 +1346,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -2800,7 +2800,7 @@ static int ath10k_pci_napi_poll(struct n
@@ -2804,7 +2804,7 @@ static int ath10k_pci_napi_poll(struct n
done = ath10k_htt_txrx_compl_task(ar, budget);
if (done < budget) {

@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/include/uapi/linux/spi/spidev.h
+++ b/include/uapi/linux/spi/spidev.h
@@ -111,7 +111,7 @@ struct spi_ioc_transfer {
@@ -112,7 +112,7 @@ struct spi_ioc_transfer {
/* not all platforms use <asm-generic/ioctl.h> or _IOC_TYPECHECK() ... */
#define SPI_MSGSIZE(N) \

@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
device, it has to decide which ones to send first, which ones to
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -1976,7 +1976,7 @@ static int __init pktsched_init(void)
@@ -1978,7 +1978,7 @@ static int __init pktsched_init(void)
return err;
}

@ -1,6 +1,6 @@
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -499,6 +499,12 @@ struct phy_driver {
@@ -495,6 +495,12 @@ struct phy_driver {
/* Determines the negotiated speed and duplex */
int (*read_status)(struct phy_device *phydev);

@ -50,7 +50,7 @@
phy_device_free(phydev);
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -863,6 +863,23 @@ void mdio_bus_exit(void);
@@ -859,6 +859,23 @@ void mdio_bus_exit(void);
extern struct bus_type mdio_bus_type;

@ -39,7 +39,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
depends on ARCH_AT91 || (ARM && COMPILE_TEST)
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -1642,10 +1642,12 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1640,10 +1640,12 @@ int spi_nor_scan(struct spi_nor *nor, co
#ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS
/* prefer "small sector" erase if possible */

@ -8,7 +8,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/netfilter/nf_nat_core.c
+++ b/net/netfilter/nf_nat_core.c
@@ -95,6 +95,9 @@ int nf_xfrm_me_harder(struct net *net, s
@@ -93,6 +93,9 @@ int nf_xfrm_me_harder(struct net *net, s
struct dst_entry *dst;
int err;

@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#define PACKET_FANOUT_LB 1
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -1778,6 +1778,7 @@ static int packet_rcv_spkt(struct sk_buf
@@ -1780,6 +1780,7 @@ static int packet_rcv_spkt(struct sk_buf
{
struct sock *sk;
struct sockaddr_pkt *spkt;
@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/*
* When we registered the protocol we saved the socket in the data
@@ -1785,6 +1786,7 @@ static int packet_rcv_spkt(struct sk_buf
@@ -1787,6 +1788,7 @@ static int packet_rcv_spkt(struct sk_buf
*/
sk = pt->af_packet_priv;
@ -46,7 +46,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/*
* Yank back the headers [hope the device set this
@@ -1797,7 +1799,7 @@ static int packet_rcv_spkt(struct sk_buf
@@ -1799,7 +1801,7 @@ static int packet_rcv_spkt(struct sk_buf
* so that this procedure is noop.
*/
@ -55,7 +55,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
goto out;
if (!net_eq(dev_net(dev), sock_net(sk)))
@@ -2035,12 +2037,12 @@ static int packet_rcv(struct sk_buff *sk
@@ -2037,12 +2039,12 @@ static int packet_rcv(struct sk_buff *sk
unsigned int snaplen, res;
bool is_drop_n_account = false;
@ -71,7 +71,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (!net_eq(dev_net(dev), sock_net(sk)))
goto drop;
@@ -2166,12 +2168,12 @@ static int tpacket_rcv(struct sk_buff *s
@@ -2168,12 +2170,12 @@ static int tpacket_rcv(struct sk_buff *s
BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32);
BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48);
@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (!net_eq(dev_net(dev), sock_net(sk)))
goto drop;
@@ -3250,6 +3252,7 @@ static int packet_create(struct net *net
@@ -3252,6 +3254,7 @@ static int packet_create(struct net *net
mutex_init(&po->pg_vec_lock);
po->rollover = NULL;
po->prot_hook.func = packet_rcv;
@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (sock->type == SOCK_PACKET)
po->prot_hook.func = packet_rcv_spkt;
@@ -3836,6 +3839,16 @@ packet_setsockopt(struct socket *sock, i
@@ -3838,6 +3841,16 @@ packet_setsockopt(struct socket *sock, i
po->xmit = val ? packet_direct_xmit : dev_queue_xmit;
return 0;
}
@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
default:
return -ENOPROTOOPT;
}
@@ -3888,6 +3901,13 @@ static int packet_getsockopt(struct sock
@@ -3891,6 +3904,13 @@ static int packet_getsockopt(struct sock
case PACKET_VNET_HDR:
val = po->has_vnet_hdr;
break;

@ -62,7 +62,7 @@ Signed-off-by: John Crispin <john@phrozen.org>
* @phydev: the phy_device struct
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -820,6 +820,7 @@ int phy_ethtool_ksettings_get(struct phy
@@ -816,6 +816,7 @@ int phy_ethtool_ksettings_get(struct phy
struct ethtool_link_ksettings *cmd);
int phy_ethtool_ksettings_set(struct phy_device *phydev,
const struct ethtool_link_ksettings *cmd);

@ -23,7 +23,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
phy_suspend(phydev);
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -511,6 +511,12 @@ struct phy_driver {
@@ -507,6 +507,12 @@ struct phy_driver {
*/
int (*did_interrupt)(struct phy_device *phydev);

@ -1,6 +1,6 @@
--- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi
+++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi
@@ -40,7 +40,7 @@
@@ -38,7 +38,7 @@
clock-frequency = <48000000>;
};

@ -43,7 +43,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
}
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -373,6 +373,7 @@ struct phy_device {
@@ -369,6 +369,7 @@ struct phy_device {
bool is_pseudo_fixed_link;
bool has_fixups;
bool suspended;

@ -43,8 +43,6 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
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/drivers/base/Kconfig
+++ b/drivers/base/Kconfig
@@ -237,6 +237,7 @@ config GENERIC_CPU_AUTOPROBE
@ -55,11 +53,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 +64,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 +82,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 +91,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 +129,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 +146,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 +156,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 +168,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 +193,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 +212,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 +222,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,16 +235,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 @@
@ -429,8 +396,6 @@ index 00000000..a6a31c87
+}
+
+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 +416,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,9 +431,6 @@ 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 @@
@ -515,9 +475,6 @@ index 00000000..8042d9cc
+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 +487,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

@ -33,8 +33,6 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
13 files changed, 309 insertions(+), 3 deletions(-)
create mode 100644 include/linux/fsl/svr.h
diff --git a/drivers/base/devres.c b/drivers/base/devres.c
index 8fc654f0..71d57702 100644
--- a/drivers/base/devres.c
+++ b/drivers/base/devres.c
@@ -10,6 +10,7 @@
@ -45,7 +43,7 @@ index 8fc654f0..71d57702 100644
#include "base.h"
@@ -985,3 +986,68 @@ void devm_free_pages(struct device *dev, unsigned long addr)
@@ -985,3 +986,68 @@ void devm_free_pages(struct device *dev,
&devres));
}
EXPORT_SYMBOL_GPL(devm_free_pages);
@ -114,8 +112,6 @@ index 8fc654f0..71d57702 100644
+ (void *)pdata));
+}
+EXPORT_SYMBOL_GPL(devm_free_percpu);
diff --git a/drivers/base/soc.c b/drivers/base/soc.c
index b63f23e6..0c5cf872 100644
--- a/drivers/base/soc.c
+++ b/drivers/base/soc.c
@@ -13,6 +13,7 @@
@ -195,11 +191,9 @@ index b63f23e6..0c5cf872 100644
+ return NULL;
+}
+EXPORT_SYMBOL_GPL(soc_device_match);
diff --git a/include/linux/device.h b/include/linux/device.h
index 8d732965..6d206930 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -688,6 +688,25 @@ void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res);
@@ -688,6 +688,25 @@ void __iomem *devm_ioremap_resource(stru
int devm_add_action(struct device *dev, void (*action)(void *), void *data);
void devm_remove_action(struct device *dev, void (*action)(void *), void *data);
@ -225,9 +219,6 @@ index 8d732965..6d206930 100644
static inline int devm_add_action_or_reset(struct device *dev,
void (*action)(void *), void *data)
{
diff --git a/include/linux/fsl/svr.h b/include/linux/fsl/svr.h
new file mode 100644
index 00000000..e95c8f43
--- /dev/null
+++ b/include/linux/fsl/svr.h
@@ -0,0 +1,97 @@
@ -328,8 +319,6 @@ index 00000000..e95c8f43
+#define SVR_Unknown 0xFFFFFF
+
+#endif
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
index f2912914..22308465 100644
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -99,7 +99,10 @@ struct fsl_usb2_platform_data {
@ -343,8 +332,6 @@ index f2912914..22308465 100644
unsigned check_phy_clk_valid:1;
/* register save area for suspend/resume */
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
index 9c6c8ef2..90b4107e 100644
--- a/include/linux/netdev_features.h
+++ b/include/linux/netdev_features.h
@@ -74,6 +74,7 @@ enum {
@ -363,8 +350,6 @@ index 9c6c8ef2..90b4107e 100644
#define for_each_netdev_feature(mask_addr, bit) \
for_each_set_bit(bit, (unsigned long *)mask_addr, NETDEV_FEATURE_COUNT)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index c3a1537c..9740875b 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1509,6 +1509,8 @@ enum netdev_priv_flags {
@ -385,8 +370,6 @@ index c3a1537c..9740875b 100644
unsigned short type;
unsigned short hard_header_len;
unsigned short min_header_len;
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 9a0c945e..06f33c98 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -903,6 +903,7 @@ void kfree_skb(struct sk_buff *skb);
@ -397,7 +380,7 @@ index 9a0c945e..06f33c98 100644
void __kfree_skb(struct sk_buff *skb);
extern struct kmem_cache *skbuff_head_cache;
@@ -3057,6 +3058,7 @@ static inline void skb_free_datagram_locked(struct sock *sk,
@@ -3057,6 +3058,7 @@ static inline void skb_free_datagram_loc
}
int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, unsigned int flags);
int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len);
@ -405,8 +388,6 @@ index 9a0c945e..06f33c98 100644
int skb_store_bits(struct sk_buff *skb, int offset, const void *from, int len);
__wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset, u8 *to,
int len, __wsum csum);
diff --git a/include/linux/sys_soc.h b/include/linux/sys_soc.h
index 2739ccb6..9f5eb06f 100644
--- a/include/linux/sys_soc.h
+++ b/include/linux/sys_soc.h
@@ -13,6 +13,7 @@ struct soc_device_attribute {
@ -417,15 +398,13 @@ index 2739ccb6..9f5eb06f 100644
};
/**
@@ -34,4 +35,6 @@ void soc_device_unregister(struct soc_device *soc_dev);
@@ -34,4 +35,6 @@ void soc_device_unregister(struct soc_de
*/
struct device *soc_device_to_device(struct soc_device *soc);
+const struct soc_device_attribute *soc_device_match(
+ const struct soc_device_attribute *matches);
#endif /* __SOC_BUS_H */
diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h
index 51f38442..5c01afbf 100644
--- a/include/uapi/linux/if_ether.h
+++ b/include/uapi/linux/if_ether.h
@@ -35,6 +35,7 @@
@ -436,11 +415,9 @@ index 51f38442..5c01afbf 100644
/*
* These are the defined Ethernet Protocol ID's.
diff --git a/net/core/dev.c b/net/core/dev.c
index 512086f2..6e3bb7bc 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -6603,9 +6603,18 @@ int dev_set_mtu(struct net_device *dev, int new_mtu)
@@ -6603,9 +6603,18 @@ int dev_set_mtu(struct net_device *dev,
if (new_mtu == dev->mtu)
return 0;
@ -461,11 +438,9 @@ index 512086f2..6e3bb7bc 100644
if (!netif_device_present(dev))
return -ENODEV;
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 7e7b7ce0..0f9c014a 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -842,6 +842,32 @@ void napi_consume_skb(struct sk_buff *skb, int budget)
@@ -842,6 +842,32 @@ void napi_consume_skb(struct sk_buff *sk
}
EXPORT_SYMBOL(napi_consume_skb);
@ -498,7 +473,7 @@ index 7e7b7ce0..0f9c014a 100644
/* Make sure a field is enclosed inside headers_start/headers_end section */
#define CHECK_SKB_FIELD(field) \
BUILD_BUG_ON(offsetof(struct sk_buff, field) < \
@@ -1073,7 +1099,7 @@ static void skb_headers_offset_update(struct sk_buff *skb, int off)
@@ -1073,7 +1099,7 @@ static void skb_headers_offset_update(st
skb->inner_mac_header += off;
}
@ -507,7 +482,7 @@ index 7e7b7ce0..0f9c014a 100644
{
__copy_skb_header(new, old);
@@ -1081,6 +1107,7 @@ static void copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
@@ -1081,6 +1107,7 @@ static void copy_skb_header(struct sk_bu
skb_shinfo(new)->gso_segs = skb_shinfo(old)->gso_segs;
skb_shinfo(new)->gso_type = skb_shinfo(old)->gso_type;
}
@ -515,11 +490,9 @@ index 7e7b7ce0..0f9c014a 100644
static inline int skb_alloc_rx_flag(const struct sk_buff *skb)
{
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 8018dd3a..ea760b83 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -309,6 +309,13 @@ static void dev_watchdog(unsigned long arg)
@@ -309,6 +309,13 @@ static void dev_watchdog(unsigned long a
txq->trans_timeout++;
break;
}
@ -533,6 +506,3 @@ index 8018dd3a..ea760b83 100644
}
if (some_queue_timedout) {
--
2.14.1

@ -37,8 +37,6 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
arch/arm64/mm/dma-mapping.c | 23 ++++++++++---
15 files changed, 209 insertions(+), 8 deletions(-)
diff --git a/arch/arm/include/asm/delay.h b/arch/arm/include/asm/delay.h
index b1ce037e..1445b0ca 100644
--- a/arch/arm/include/asm/delay.h
+++ b/arch/arm/include/asm/delay.h
@@ -57,6 +57,22 @@ extern void __bad_udelay(void);
@ -64,11 +62,9 @@ index b1ce037e..1445b0ca 100644
/* Loop-based definitions for assembly code. */
extern void __loop_delay(unsigned long loops);
extern void __loop_udelay(unsigned long usecs);
diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index 021692c6..172a4f2e 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -129,6 +129,7 @@ static inline u32 __raw_readl(const volatile void __iomem *addr)
@@ -129,6 +129,7 @@ static inline u32 __raw_readl(const vola
#define MT_DEVICE_NONSHARED 1
#define MT_DEVICE_CACHED 2
#define MT_DEVICE_WC 3
@ -76,7 +72,7 @@ index 021692c6..172a4f2e 100644
/*
* types 4 onwards can be found in asm/mach/map.h and are undefined
* for ioremap
@@ -220,6 +221,34 @@ extern int pci_ioremap_io(unsigned int offset, phys_addr_t phys_addr);
@@ -220,6 +221,34 @@ extern int pci_ioremap_io(unsigned int o
#endif
#endif
@ -111,7 +107,7 @@ index 021692c6..172a4f2e 100644
/*
* IO port access primitives
* -------------------------
@@ -408,6 +437,8 @@ void __iomem *ioremap_wc(resource_size_t res_cookie, size_t size);
@@ -408,6 +437,8 @@ void __iomem *ioremap_wc(resource_size_t
#define ioremap_wc ioremap_wc
#define ioremap_wt ioremap_wc
@ -120,8 +116,6 @@ index 021692c6..172a4f2e 100644
void iounmap(volatile void __iomem *iomem_cookie);
#define iounmap iounmap
diff --git a/arch/arm/include/asm/mach/map.h b/arch/arm/include/asm/mach/map.h
index 9b7c328f..27f3df7d 100644
--- a/arch/arm/include/asm/mach/map.h
+++ b/arch/arm/include/asm/mach/map.h
@@ -21,9 +21,9 @@ struct map_desc {
@ -136,8 +130,6 @@ index 9b7c328f..27f3df7d 100644
MT_CACHECLEAN,
MT_MINICLEAN,
MT_LOW_VECTORS,
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
index a8d656d9..4ab57b37 100644
--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -118,6 +118,13 @@ extern pgprot_t pgprot_s2_device;
@ -154,8 +146,6 @@ index a8d656d9..4ab57b37 100644
#define pgprot_writecombine(prot) \
__pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_BUFFERABLE)
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index 2f0e0773..d2f4869a 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -11,6 +11,8 @@
@ -167,11 +157,10 @@ index 2f0e0773..d2f4869a 100644
#include <asm/mach-types.h>
#include <asm/mach/map.h>
@@ -63,6 +65,47 @@ void pcibios_report_status(u_int status_mask, int warn)
pcibios_bus_report_status(bus, status_mask, warn);
@@ -64,6 +66,47 @@ void pcibios_report_status(u_int status_
}
+/*
/*
+ * Check device tree if the service interrupts are there
+ */
+int pcibios_check_service_irqs(struct pci_dev *dev, int *irqs, int mask)
@ -212,14 +201,13 @@ index 2f0e0773..d2f4869a 100644
+ return count;
+}
+
/*
+/*
* We don't use this to fix the device, but initialisation of it.
* It's not the correct use for this, but it works.
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index ab771000..9b5f4465 100644
* Note that the arbiter/ISA bridge appears to be buggy, specifically in
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -2392,6 +2392,7 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
@@ -2392,6 +2392,7 @@ void arch_setup_dma_ops(struct device *d
set_dma_ops(dev, dma_ops);
}
@ -227,11 +215,9 @@ index ab771000..9b5f4465 100644
void arch_teardown_dma_ops(struct device *dev)
{
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index ff0eed23..2f2f4269 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -398,6 +398,13 @@ void __iomem *ioremap_wc(resource_size_t res_cookie, size_t size)
@@ -398,6 +398,13 @@ void __iomem *ioremap_wc(resource_size_t
}
EXPORT_SYMBOL(ioremap_wc);
@ -245,11 +231,9 @@ index ff0eed23..2f2f4269 100644
/*
* Remap an arbitrary physical address space into the kernel virtual
* address space as memory. Needed when the kernel wants to execute
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index f7c74135..4a2fb704 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -313,6 +313,13 @@ static struct mem_type mem_types[] __ro_after_init = {
@@ -313,6 +313,13 @@ static struct mem_type mem_types[] __ro_
.prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE,
.domain = DOMAIN_KERNEL,
},
@ -263,7 +247,7 @@ index f7c74135..4a2fb704 100644
[MT_ROM] = {
.prot_sect = PMD_TYPE_SECT,
.domain = DOMAIN_KERNEL,
@@ -644,6 +651,7 @@ static void __init build_mem_type_table(void)
@@ -644,6 +651,7 @@ static void __init build_mem_type_table(
}
kern_pgprot |= PTE_EXT_AF;
vecs_pgprot |= PTE_EXT_AF;
@ -271,7 +255,7 @@ index f7c74135..4a2fb704 100644
/*
* Set PXN for user mappings
@@ -672,6 +680,7 @@ static void __init build_mem_type_table(void)
@@ -672,6 +680,7 @@ static void __init build_mem_type_table(
mem_types[MT_MEMORY_RWX].prot_pte |= kern_pgprot;
mem_types[MT_MEMORY_RW].prot_sect |= ecc_mask | cp->pmd;
mem_types[MT_MEMORY_RW].prot_pte |= kern_pgprot;
@ -279,8 +263,6 @@ index f7c74135..4a2fb704 100644
mem_types[MT_MEMORY_DMA_READY].prot_pte |= kern_pgprot;
mem_types[MT_MEMORY_RWX_NONCACHED].prot_sect |= ecc_mask;
mem_types[MT_ROM].prot_sect |= cp->pmd;
diff --git a/arch/arm64/include/asm/cache.h b/arch/arm64/include/asm/cache.h
index 5082b30b..bde44993 100644
--- a/arch/arm64/include/asm/cache.h
+++ b/arch/arm64/include/asm/cache.h
@@ -18,7 +18,7 @@
@ -292,11 +274,9 @@ index 5082b30b..bde44993 100644
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
/*
diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h
index 0bba427b..36c1fbf3 100644
--- a/arch/arm64/include/asm/io.h
+++ b/arch/arm64/include/asm/io.h
@@ -171,6 +171,8 @@ extern void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size);
@@ -171,6 +171,8 @@ extern void __iomem *ioremap_cache(phys_
#define ioremap_nocache(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE))
#define ioremap_wc(addr, size) __ioremap((addr), (size), __pgprot(PROT_NORMAL_NC))
#define ioremap_wt(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE))
@ -305,11 +285,9 @@ index 0bba427b..36c1fbf3 100644
#define iounmap __iounmap
/*
diff --git a/arch/arm64/include/asm/pci.h b/arch/arm64/include/asm/pci.h
index b9a7ba9c..8a189159 100644
--- a/arch/arm64/include/asm/pci.h
+++ b/arch/arm64/include/asm/pci.h
@@ -31,6 +31,10 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
@@ -31,6 +31,10 @@ static inline int pci_get_legacy_ide_irq
return -ENODEV;
}
@ -320,8 +298,6 @@ index b9a7ba9c..8a189159 100644
static inline int pci_proc_domain(struct pci_bus *bus)
{
return 1;
diff --git a/arch/arm64/include/asm/pgtable-prot.h b/arch/arm64/include/asm/pgtable-prot.h
index 2142c772..cdf8b25d 100644
--- a/arch/arm64/include/asm/pgtable-prot.h
+++ b/arch/arm64/include/asm/pgtable-prot.h
@@ -42,6 +42,7 @@
@ -332,11 +308,9 @@ index 2142c772..cdf8b25d 100644
#define PROT_SECT_DEVICE_nGnRE (PROT_SECT_DEFAULT | PMD_SECT_PXN | PMD_SECT_UXN | PMD_ATTRINDX(MT_DEVICE_nGnRE))
#define PROT_SECT_NORMAL (PROT_SECT_DEFAULT | PMD_SECT_PXN | PMD_SECT_UXN | PMD_ATTRINDX(MT_NORMAL))
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index 61e21401..b8c876fb 100644
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -356,6 +356,11 @@ static inline int pmd_protnone(pmd_t pmd)
@@ -356,6 +356,11 @@ static inline int pmd_protnone(pmd_t pmd
__pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_nGnRnE) | PTE_PXN | PTE_UXN)
#define pgprot_writecombine(prot) \
__pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC) | PTE_PXN | PTE_UXN)
@ -348,8 +322,6 @@ index 61e21401..b8c876fb 100644
#define pgprot_device(prot) \
__pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_nGnRE) | PTE_PXN | PTE_UXN)
#define __HAVE_PHYS_MEM_ACCESS_PROT
diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c
index 409abc45..0568ec3a 100644
--- a/arch/arm64/kernel/pci.c
+++ b/arch/arm64/kernel/pci.c
@@ -17,6 +17,8 @@
@ -361,10 +333,11 @@ index 409abc45..0568ec3a 100644
#include <linux/pci.h>
#include <linux/pci-acpi.h>
#include <linux/pci-ecam.h>
@@ -54,6 +56,66 @@ int pcibios_alloc_irq(struct pci_dev *dev)
@@ -53,6 +55,66 @@ int pcibios_alloc_irq(struct pci_dev *de
return 0;
}
+
+/*
+ * Check device tree if the service interrupts are there
+ */
@ -424,12 +397,9 @@ index 409abc45..0568ec3a 100644
+
+ return 0;
+}
+
/*
* raw_pci_read/write - Platform-specific PCI config space access.
*/
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c
index b5bf46ce..5a010bcc 100644
--- a/arch/arm64/mm/dma-mapping.c
+++ b/arch/arm64/mm/dma-mapping.c
@@ -30,6 +30,7 @@
@ -440,49 +410,19 @@ index b5bf46ce..5a010bcc 100644
static int swiotlb __ro_after_init;
@@ -836,14 +837,21 @@ static bool do_iommu_attach(struct device *dev, const struct iommu_ops *ops,
* then the IOMMU core will have already configured a group for this
* device, and allocated the default domain for that group.
*/
- if (!domain || iommu_dma_init_domain(domain, dma_base, size, dev)) {
- pr_warn("Failed to set up IOMMU for device %s; retaining platform DMA ops\n",
- dev_name(dev));
- return false;
+ if (!domain)
+ goto out_err;
+
+ if (domain->type == IOMMU_DOMAIN_DMA) {
+ if (iommu_dma_init_domain(domain, dma_base, size, dev))
+ goto out_err;
+
+ dev->archdata.dma_ops = &iommu_dma_ops;
}
- dev->archdata.dma_ops = &iommu_dma_ops;
return true;
+out_err:
+ pr_warn("Failed to set up IOMMU for device %s; retaining platform DMA ops\n",
+ dev_name(dev));
+ return false;
}
static void queue_iommu_attach(struct device *dev, const struct iommu_ops *ops,
@@ -917,6 +925,10 @@ static int __init __iommu_dma_init(void)
#ifdef CONFIG_PCI
@@ -925,6 +926,10 @@ static int __init __iommu_dma_init(void)
if (!ret)
ret = register_iommu_dma_ops_notifier(&pci_bus_type);
+#endif
#endif
+#ifdef CONFIG_FSL_MC_BUS
+ if (!ret)
+ ret = register_iommu_dma_ops_notifier(&fsl_mc_bus_type);
#endif
+#endif
return ret;
}
@@ -971,3 +983,4 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
arch_initcall(__iommu_dma_init);
@@ -978,3 +983,4 @@ void arch_setup_dma_ops(struct device *d
dev->archdata.dma_coherent = coherent;
__iommu_setup_dma_ops(dev, dma_base, size, iommu);
}
+EXPORT_SYMBOL(arch_setup_dma_ops);
--
2.14.1

@ -11,8 +11,6 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
arch/arm/mach-imx/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 9155b639..3ded3f98 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -1,6 +1,7 @@
@ -23,6 +21,3 @@ index 9155b639..3ded3f98 100644
select ARCH_SUPPORTS_BIG_ENDIAN
select CLKSRC_IMX_GPT
select GENERIC_IRQ_CHIP
--
2.14.1

@ -23,11 +23,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
include/linux/mtd/spi-nor.h | 14 +-
4 files changed, 409 insertions(+), 70 deletions(-)
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index 2a47a3f0..4f21401d 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -451,7 +451,7 @@ static int mtdchar_readoob(struct file *file, struct mtd_info *mtd,
@@ -451,7 +451,7 @@ static int mtdchar_readoob(struct file *
* data. For our userspace tools it is important to dump areas
* with ECC errors!
* For kernel internal usage it also might return -EUCLEAN
@ -36,8 +34,6 @@ index 2a47a3f0..4f21401d 100644
* been corrected by the ECC algorithm.
*
* Note: currently the standard NAND function, nand_read_oob_std,
diff --git a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c
index 5c82e4ef..33ecc27a 100644
--- a/drivers/mtd/spi-nor/fsl-quadspi.c
+++ b/drivers/mtd/spi-nor/fsl-quadspi.c
@@ -41,6 +41,8 @@
@ -90,7 +86,7 @@ index 5c82e4ef..33ecc27a 100644
.devtype = FSL_QUADSPI_VYBRID,
.rxfifo = 128,
.txfifo = 64,
@@ -232,7 +241,7 @@ static struct fsl_qspi_devtype_data vybrid_data = {
@@ -232,7 +241,7 @@ static struct fsl_qspi_devtype_data vybr
.driver_data = QUADSPI_QUIRK_SWAP_ENDIAN,
};
@ -99,7 +95,7 @@ index 5c82e4ef..33ecc27a 100644
.devtype = FSL_QUADSPI_IMX6SX,
.rxfifo = 128,
.txfifo = 512,
@@ -241,7 +250,7 @@ static struct fsl_qspi_devtype_data imx6sx_data = {
@@ -241,7 +250,7 @@ static struct fsl_qspi_devtype_data imx6
| QUADSPI_QUIRK_TKT245618,
};
@ -108,7 +104,7 @@ index 5c82e4ef..33ecc27a 100644
.devtype = FSL_QUADSPI_IMX7D,
.rxfifo = 512,
.txfifo = 512,
@@ -250,7 +259,7 @@ static struct fsl_qspi_devtype_data imx7d_data = {
@@ -250,7 +259,7 @@ static struct fsl_qspi_devtype_data imx7
| QUADSPI_QUIRK_4X_INT_CLK,
};
@ -117,7 +113,7 @@ index 5c82e4ef..33ecc27a 100644
.devtype = FSL_QUADSPI_IMX6UL,
.rxfifo = 128,
.txfifo = 512,
@@ -267,6 +276,14 @@ static struct fsl_qspi_devtype_data ls1021a_data = {
@@ -267,6 +276,14 @@ static struct fsl_qspi_devtype_data ls10
.driver_data = 0,
};
@ -140,7 +136,7 @@ index 5c82e4ef..33ecc27a 100644
unsigned int chip_base_addr; /* We may support two chips. */
bool has_second_chip;
bool big_endian;
@@ -309,6 +327,23 @@ static inline int needs_wakeup_wait_mode(struct fsl_qspi *q)
@@ -309,6 +327,23 @@ static inline int needs_wakeup_wait_mode
return q->devtype_data->driver_data & QUADSPI_QUIRK_TKT245618;
}
@ -164,7 +160,7 @@ index 5c82e4ef..33ecc27a 100644
/*
* R/W functions for big- or little-endian registers:
* The qSPI controller's endian is independent of the CPU core's endian.
@@ -331,6 +366,31 @@ static u32 qspi_readl(struct fsl_qspi *q, void __iomem *addr)
@@ -331,6 +366,31 @@ static u32 qspi_readl(struct fsl_qspi *q
return ioread32(addr);
}
@ -196,7 +192,7 @@ index 5c82e4ef..33ecc27a 100644
/*
* An IC bug makes us to re-arrange the 32-bit data.
* The following chips, such as IMX6SLX, have fixed this bug.
@@ -373,8 +433,15 @@ static void fsl_qspi_init_lut(struct fsl_qspi *q)
@@ -373,8 +433,15 @@ static void fsl_qspi_init_lut(struct fsl
void __iomem *base = q->iobase;
int rxfifo = q->devtype_data->rxfifo;
u32 lut_base;
@ -213,13 +209,15 @@ index 5c82e4ef..33ecc27a 100644
fsl_qspi_unlock_lut(q);
@@ -382,25 +449,51 @@ static void fsl_qspi_init_lut(struct fsl_qspi *q)
@@ -382,24 +449,50 @@ static void fsl_qspi_init_lut(struct fsl
for (i = 0; i < QUADSPI_LUT_NUM; i++)
qspi_writel(q, 0, base + QUADSPI_LUT_BASE + i * 4);
- /* Quad Read */
- lut_base = SEQID_QUAD_READ * 4;
-
+ /* Read */
+ lut_base = SEQID_READ * 4;
- if (q->nor_size <= SZ_16M) {
- cmd = SPINOR_OP_READ_1_1_4;
- addrlen = ADDR24BIT;
@ -232,9 +230,6 @@ index 5c82e4ef..33ecc27a 100644
- }
-
- qspi_writel(q, LUT0(CMD, PAD1, cmd) | LUT1(ADDR, PAD1, addrlen),
+ /* Read */
+ lut_base = SEQID_READ * 4;
+
+ if (nor->flash_read == SPI_NOR_FAST) {
+ qspi_writel(q, LUT0(CMD, PAD1, read_op) |
+ LUT1(ADDR, PAD1, addrlen),
@ -247,10 +242,11 @@ index 5c82e4ef..33ecc27a 100644
+ read_op = 0xEC;
+ qspi_writel(q,
+ LUT0(CMD, PAD1, read_op) | LUT1(ADDR, PAD4, addrlen),
+ base + QUADSPI_LUT(lut_base));
base + QUADSPI_LUT(lut_base));
- qspi_writel(q, LUT0(DUMMY, PAD1, dummy) | LUT1(FSL_READ, PAD4, rxfifo),
+ qspi_writel(q,
+ LUT0(MODE, PAD4, 0xff) | LUT1(DUMMY, PAD4, read_dm),
+ base + QUADSPI_LUT(lut_base + 1));
base + QUADSPI_LUT(lut_base + 1));
+ qspi_writel(q,
+ LUT0(FSL_READ, PAD4, rxfifo),
+ base + QUADSPI_LUT(lut_base + 2));
@ -266,22 +262,20 @@ index 5c82e4ef..33ecc27a 100644
+ /* read mode : 1-4-4, such as Spansion s25fl128s. */
+ qspi_writel(q, LUT0(CMD, PAD1, read_op)
+ | LUT1(ADDR_DDR, PAD4, addrlen),
base + QUADSPI_LUT(lut_base));
- qspi_writel(q, LUT0(DUMMY, PAD1, dummy) | LUT1(FSL_READ, PAD4, rxfifo),
+ base + QUADSPI_LUT(lut_base));
+
+ qspi_writel(q, LUT0(MODE_DDR, PAD4, 0xff)
+ | LUT1(DUMMY, PAD1, read_dm),
base + QUADSPI_LUT(lut_base + 1));
+ base + QUADSPI_LUT(lut_base + 1));
+
+ qspi_writel(q, LUT0(FSL_READ_DDR, PAD4, rxfifo)
+ | LUT1(JMP_ON_CS, PAD1, 0),
+ base + QUADSPI_LUT(lut_base + 2));
+ }
+
/* Write enable */
lut_base = SEQID_WREN * 4;
qspi_writel(q, LUT0(CMD, PAD1, SPINOR_OP_WREN),
@@ -409,16 +502,8 @@ static void fsl_qspi_init_lut(struct fsl_qspi *q)
@@ -409,16 +502,8 @@ static void fsl_qspi_init_lut(struct fsl
/* Page Program */
lut_base = SEQID_PP * 4;
@ -300,7 +294,7 @@ index 5c82e4ef..33ecc27a 100644
base + QUADSPI_LUT(lut_base));
qspi_writel(q, LUT0(FSL_WRITE, PAD1, 0),
base + QUADSPI_LUT(lut_base + 1));
@@ -432,10 +517,8 @@ static void fsl_qspi_init_lut(struct fsl_qspi *q)
@@ -432,10 +517,8 @@ static void fsl_qspi_init_lut(struct fsl
/* Erase a sector */
lut_base = SEQID_SE * 4;
@ -313,7 +307,7 @@ index 5c82e4ef..33ecc27a 100644
base + QUADSPI_LUT(lut_base));
/* Erase the whole chip */
@@ -476,6 +559,44 @@ static void fsl_qspi_init_lut(struct fsl_qspi *q)
@@ -476,6 +559,44 @@ static void fsl_qspi_init_lut(struct fsl
qspi_writel(q, LUT0(CMD, PAD1, SPINOR_OP_BRWR),
base + QUADSPI_LUT(lut_base));
@ -358,7 +352,7 @@ index 5c82e4ef..33ecc27a 100644
fsl_qspi_lock_lut(q);
}
@@ -483,8 +604,24 @@ static void fsl_qspi_init_lut(struct fsl_qspi *q)
@@ -483,8 +604,24 @@ static void fsl_qspi_init_lut(struct fsl
static int fsl_qspi_get_seqid(struct fsl_qspi *q, u8 cmd)
{
switch (cmd) {
@ -384,7 +378,7 @@ index 5c82e4ef..33ecc27a 100644
case SPINOR_OP_WREN:
return SEQID_WREN;
case SPINOR_OP_WRDI:
@@ -496,6 +633,7 @@ static int fsl_qspi_get_seqid(struct fsl_qspi *q, u8 cmd)
@@ -496,6 +633,7 @@ static int fsl_qspi_get_seqid(struct fsl
case SPINOR_OP_CHIP_ERASE:
return SEQID_CHIP_ERASE;
case SPINOR_OP_PP:
@ -392,7 +386,7 @@ index 5c82e4ef..33ecc27a 100644
return SEQID_PP;
case SPINOR_OP_RDID:
return SEQID_RDID;
@@ -507,6 +645,8 @@ static int fsl_qspi_get_seqid(struct fsl_qspi *q, u8 cmd)
@@ -507,6 +645,8 @@ static int fsl_qspi_get_seqid(struct fsl
return SEQID_EN4B;
case SPINOR_OP_BRWR:
return SEQID_BRWR;
@ -401,7 +395,7 @@ index 5c82e4ef..33ecc27a 100644
default:
if (cmd == q->nor[0].erase_opcode)
return SEQID_SE;
@@ -531,8 +671,11 @@ fsl_qspi_runcmd(struct fsl_qspi *q, u8 cmd, unsigned int addr, int len)
@@ -531,8 +671,11 @@ fsl_qspi_runcmd(struct fsl_qspi *q, u8 c
/* save the reg */
reg = qspi_readl(q, base + QUADSPI_MCR);
@ -415,7 +409,7 @@ index 5c82e4ef..33ecc27a 100644
qspi_writel(q, QUADSPI_RBCT_WMRK_MASK | QUADSPI_RBCT_RXBRD_USEIPS,
base + QUADSPI_RBCT);
qspi_writel(q, reg | QUADSPI_MCR_CLR_RXF_MASK, base + QUADSPI_MCR);
@@ -582,10 +725,10 @@ static void fsl_qspi_read_data(struct fsl_qspi *q, int len, u8 *rxbuf)
@@ -582,10 +725,10 @@ static void fsl_qspi_read_data(struct fs
q->chip_base_addr, tmp);
if (len >= 4) {
@ -428,7 +422,7 @@ index 5c82e4ef..33ecc27a 100644
break;
}
@@ -619,11 +762,12 @@ static inline void fsl_qspi_invalid(struct fsl_qspi *q)
@@ -619,11 +762,12 @@ static inline void fsl_qspi_invalid(stru
}
static ssize_t fsl_qspi_nor_write(struct fsl_qspi *q, struct spi_nor *nor,
@ -442,7 +436,7 @@ index 5c82e4ef..33ecc27a 100644
dev_dbg(q->dev, "to 0x%.8x:0x%.8x, len : %d\n",
q->chip_base_addr, to, count);
@@ -633,10 +777,13 @@ static ssize_t fsl_qspi_nor_write(struct fsl_qspi *q, struct spi_nor *nor,
@@ -633,10 +777,13 @@ static ssize_t fsl_qspi_nor_write(struct
qspi_writel(q, tmp | QUADSPI_MCR_CLR_TXF_MASK, q->iobase + QUADSPI_MCR);
/* fill the TX data to the FIFO */
@ -458,7 +452,7 @@ index 5c82e4ef..33ecc27a 100644
}
/* fill the TXFIFO upto 16 bytes for i.MX7d */
@@ -657,11 +804,43 @@ static void fsl_qspi_set_map_addr(struct fsl_qspi *q)
@@ -657,11 +804,43 @@ static void fsl_qspi_set_map_addr(struct
{
int nor_size = q->nor_size;
void __iomem *base = q->iobase;
@ -506,7 +500,7 @@ index 5c82e4ef..33ecc27a 100644
}
/*
@@ -704,6 +883,11 @@ static void fsl_qspi_init_abh_read(struct fsl_qspi *q)
@@ -704,6 +883,11 @@ static void fsl_qspi_init_abh_read(struc
seqid = fsl_qspi_get_seqid(q, q->nor[0].read_opcode);
qspi_writel(q, seqid << QUADSPI_BFGENCR_SEQID_SHIFT,
q->iobase + QUADSPI_BFGENCR);
@ -518,7 +512,7 @@ index 5c82e4ef..33ecc27a 100644
}
/* This function was used to prepare and enable QSPI clock */
@@ -822,6 +1006,7 @@ static const struct of_device_id fsl_qspi_dt_ids[] = {
@@ -822,6 +1006,7 @@ static const struct of_device_id fsl_qsp
{ .compatible = "fsl,imx7d-qspi", .data = (void *)&imx7d_data, },
{ .compatible = "fsl,imx6ul-qspi", .data = (void *)&imx6ul_data, },
{ .compatible = "fsl,ls1021a-qspi", .data = (void *)&ls1021a_data, },
@ -526,7 +520,7 @@ index 5c82e4ef..33ecc27a 100644
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, fsl_qspi_dt_ids);
@@ -835,8 +1020,12 @@ static int fsl_qspi_read_reg(struct spi_nor *nor, u8 opcode, u8 *buf, int len)
@@ -835,8 +1020,12 @@ static int fsl_qspi_read_reg(struct spi_
{
int ret;
struct fsl_qspi *q = nor->priv;
@ -540,7 +534,7 @@ index 5c82e4ef..33ecc27a 100644
if (ret)
return ret;
@@ -848,9 +1037,13 @@ static int fsl_qspi_write_reg(struct spi_nor *nor, u8 opcode, u8 *buf, int len)
@@ -848,9 +1037,13 @@ static int fsl_qspi_write_reg(struct spi
{
struct fsl_qspi *q = nor->priv;
int ret;
@ -555,7 +549,7 @@ index 5c82e4ef..33ecc27a 100644
if (ret)
return ret;
@@ -859,7 +1052,7 @@ static int fsl_qspi_write_reg(struct spi_nor *nor, u8 opcode, u8 *buf, int len)
@@ -859,7 +1052,7 @@ static int fsl_qspi_write_reg(struct spi
} else if (len > 0) {
ret = fsl_qspi_nor_write(q, nor, opcode, 0,
@ -564,7 +558,7 @@ index 5c82e4ef..33ecc27a 100644
if (ret > 0)
return 0;
} else {
@@ -875,7 +1068,7 @@ static ssize_t fsl_qspi_write(struct spi_nor *nor, loff_t to,
@@ -875,7 +1068,7 @@ static ssize_t fsl_qspi_write(struct spi
{
struct fsl_qspi *q = nor->priv;
ssize_t ret = fsl_qspi_nor_write(q, nor, nor->program_opcode, to,
@ -573,7 +567,7 @@ index 5c82e4ef..33ecc27a 100644
/* invalid the data in the AHB buffer. */
fsl_qspi_invalid(q);
@@ -922,7 +1115,7 @@ static ssize_t fsl_qspi_read(struct spi_nor *nor, loff_t from,
@@ -922,7 +1115,7 @@ static ssize_t fsl_qspi_read(struct spi_
len);
/* Read out the data directly from the AHB buffer.*/
@ -582,7 +576,7 @@ index 5c82e4ef..33ecc27a 100644
len);
return len;
@@ -980,6 +1173,8 @@ static int fsl_qspi_probe(struct platform_device *pdev)
@@ -980,6 +1173,8 @@ static int fsl_qspi_probe(struct platfor
struct spi_nor *nor;
struct mtd_info *mtd;
int ret, i = 0;
@ -591,7 +585,7 @@ index 5c82e4ef..33ecc27a 100644
q = devm_kzalloc(dev, sizeof(*q), GFP_KERNEL);
if (!q)
@@ -1027,6 +1222,12 @@ static int fsl_qspi_probe(struct platform_device *pdev)
@@ -1027,6 +1222,12 @@ static int fsl_qspi_probe(struct platfor
goto clk_failed;
}
@ -604,7 +598,7 @@ index 5c82e4ef..33ecc27a 100644
/* find the irq */
ret = platform_get_irq(pdev, 0);
if (ret < 0) {
@@ -1050,6 +1251,7 @@ static int fsl_qspi_probe(struct platform_device *pdev)
@@ -1050,6 +1251,7 @@ static int fsl_qspi_probe(struct platfor
mutex_init(&q->lock);
@ -612,7 +606,7 @@ index 5c82e4ef..33ecc27a 100644
/* iterate the subnodes. */
for_each_available_child_of_node(dev->of_node, np) {
/* skip the holes */
@@ -1076,18 +1278,25 @@ static int fsl_qspi_probe(struct platform_device *pdev)
@@ -1076,18 +1278,25 @@ static int fsl_qspi_probe(struct platfor
ret = of_property_read_u32(np, "spi-max-frequency",
&q->clk_rate);
if (ret < 0)
@ -642,7 +636,7 @@ index 5c82e4ef..33ecc27a 100644
/* Set the correct NOR size now. */
if (q->nor_size == 0) {
@@ -1110,8 +1319,12 @@ static int fsl_qspi_probe(struct platform_device *pdev)
@@ -1110,8 +1319,12 @@ static int fsl_qspi_probe(struct platfor
nor->page_size = q->devtype_data->txfifo;
i++;
@ -655,8 +649,6 @@ index 5c82e4ef..33ecc27a 100644
/* finish the rest init. */
ret = fsl_qspi_nor_setup_last(q);
if (ret)
diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
index 793d321d..190e0e45 100644
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -40,6 +40,13 @@
@ -704,7 +696,7 @@ index 793d321d..190e0e45 100644
*/
static int read_cr(struct spi_nor *nor)
{
@@ -160,6 +170,8 @@ static inline int spi_nor_read_dummy_cycles(struct spi_nor *nor)
@@ -160,6 +170,8 @@ static inline int spi_nor_read_dummy_cyc
case SPI_NOR_DUAL:
case SPI_NOR_QUAD:
return 8;
@ -713,7 +705,7 @@ index 793d321d..190e0e45 100644
case SPI_NOR_NORMAL:
return 0;
}
@@ -961,6 +973,8 @@ static const struct flash_info spi_nor_ids[] = {
@@ -961,6 +973,8 @@ static const struct flash_info spi_nor_i
/* ESMT */
{ "f25l32pa", INFO(0x8c2016, 0, 64 * 1024, 64, SECT_4K | SPI_NOR_HAS_LOCK) },
@ -722,7 +714,7 @@ index 793d321d..190e0e45 100644
/* Everspin */
{ "mr25h256", CAT25_INFO( 32 * 1024, 1, 256, 2, SPI_NOR_NO_ERASE | SPI_NOR_NO_FR) },
@@ -1014,12 +1028,15 @@ static const struct flash_info spi_nor_ids[] = {
@@ -1014,12 +1028,15 @@ static const struct flash_info spi_nor_i
{ "mx25l3205d", INFO(0xc22016, 0, 64 * 1024, 64, SECT_4K) },
{ "mx25l3255e", INFO(0xc29e16, 0, 64 * 1024, 64, SECT_4K) },
{ "mx25l6405d", INFO(0xc22017, 0, 64 * 1024, 128, SECT_4K) },
@ -739,7 +731,7 @@ index 793d321d..190e0e45 100644
{ "mx25l25655e", INFO(0xc22619, 0, 64 * 1024, 512, 0) },
{ "mx66l51235l", INFO(0xc2201a, 0, 64 * 1024, 1024, SPI_NOR_QUAD_READ) },
{ "mx66l1g55g", INFO(0xc2261b, 0, 64 * 1024, 2048, SPI_NOR_QUAD_READ) },
@@ -1033,10 +1050,11 @@ static const struct flash_info spi_nor_ids[] = {
@@ -1033,10 +1050,11 @@ static const struct flash_info spi_nor_i
{ "n25q128a11", INFO(0x20bb18, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_QUAD_READ) },
{ "n25q128a13", INFO(0x20ba18, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_QUAD_READ) },
{ "n25q256a", INFO(0x20ba19, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_QUAD_READ) },
@ -753,7 +745,7 @@ index 793d321d..190e0e45 100644
/* PMC */
{ "pm25lv512", INFO(0, 0, 32 * 1024, 2, SECT_4K_PMC) },
@@ -1054,8 +1072,11 @@ static const struct flash_info spi_nor_ids[] = {
@@ -1054,8 +1072,11 @@ static const struct flash_info spi_nor_i
{ "s70fl01gs", INFO(0x010221, 0x4d00, 256 * 1024, 256, 0) },
{ "s25sl12800", INFO(0x012018, 0x0300, 256 * 1024, 64, 0) },
{ "s25sl12801", INFO(0x012018, 0x0301, 64 * 1024, 256, 0) },
@ -766,7 +758,7 @@ index 793d321d..190e0e45 100644
{ "s25fl129p1", INFO(0x012018, 0x4d01, 64 * 1024, 256, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
{ "s25sl004a", INFO(0x010212, 0, 64 * 1024, 8, 0) },
{ "s25sl008a", INFO(0x010213, 0, 64 * 1024, 16, 0) },
@@ -1130,6 +1151,9 @@ static const struct flash_info spi_nor_ids[] = {
@@ -1130,6 +1151,9 @@ static const struct flash_info spi_nor_i
{ "w25x80", INFO(0xef3014, 0, 64 * 1024, 16, SECT_4K) },
{ "w25x16", INFO(0xef3015, 0, 64 * 1024, 32, SECT_4K) },
{ "w25x32", INFO(0xef3016, 0, 64 * 1024, 64, SECT_4K) },
@ -776,7 +768,7 @@ index 793d321d..190e0e45 100644
{ "w25q32", INFO(0xef4016, 0, 64 * 1024, 64, SECT_4K) },
{
"w25q32dw", INFO(0xef6016, 0, 64 * 1024, 64,
@@ -1192,6 +1216,53 @@ static const struct flash_info *spi_nor_read_id(struct spi_nor *nor)
@@ -1192,6 +1216,53 @@ static const struct flash_info *spi_nor_
id[0], id[1], id[2]);
return ERR_PTR(-ENODEV);
}
@ -830,7 +822,7 @@ index 793d321d..190e0e45 100644
static int spi_nor_read(struct mtd_info *mtd, loff_t from, size_t len,
size_t *retlen, u_char *buf)
@@ -1411,7 +1482,7 @@ static int macronix_quad_enable(struct spi_nor *nor)
@@ -1411,7 +1482,7 @@ static int macronix_quad_enable(struct s
* Write status Register and configuration register with 2 bytes
* The first byte will be written to the status register, while the
* second byte will be written to the configuration register.
@ -839,7 +831,7 @@ index 793d321d..190e0e45 100644
*/
static int write_sr_cr(struct spi_nor *nor, u16 val)
{
@@ -1459,6 +1530,24 @@ static int spansion_quad_enable(struct spi_nor *nor)
@@ -1459,6 +1530,24 @@ static int spansion_quad_enable(struct s
return 0;
}
@ -864,7 +856,7 @@ index 793d321d..190e0e45 100644
static int set_quad_mode(struct spi_nor *nor, const struct flash_info *info)
{
int status;
@@ -1604,9 +1693,25 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
@@ -1604,9 +1693,25 @@ int spi_nor_scan(struct spi_nor *nor, co
write_sr(nor, 0);
spi_nor_wait_till_ready(nor);
}
@ -890,7 +882,7 @@ index 793d321d..190e0e45 100644
mtd->priv = nor;
mtd->type = MTD_NORFLASH;
mtd->writesize = 1;
@@ -1639,6 +1744,8 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
@@ -1639,6 +1744,8 @@ int spi_nor_scan(struct spi_nor *nor, co
nor->flags |= SNOR_F_USE_FSR;
if (info->flags & SPI_NOR_HAS_TB)
nor->flags |= SNOR_F_HAS_SR_TB;
@ -899,7 +891,7 @@ index 793d321d..190e0e45 100644
#ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS
/* prefer "small sector" erase if possible */
@@ -1676,9 +1783,15 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
@@ -1678,9 +1785,15 @@ int spi_nor_scan(struct spi_nor *nor, co
/* Some devices cannot do fast-read, no matter what DT tells us */
if (info->flags & SPI_NOR_NO_FR)
nor->flash_read = SPI_NOR_NORMAL;
@ -918,7 +910,7 @@ index 793d321d..190e0e45 100644
ret = set_quad_mode(nor, info);
if (ret) {
dev_err(dev, "quad mode not supported\n");
@@ -1691,6 +1804,9 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
@@ -1693,6 +1806,9 @@ int spi_nor_scan(struct spi_nor *nor, co
/* Default commands */
switch (nor->flash_read) {
@ -928,8 +920,6 @@ index 793d321d..190e0e45 100644
case SPI_NOR_QUAD:
nor->read_opcode = SPINOR_OP_READ_1_1_4;
break;
diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h
index f2a71803..5003ff64 100644
--- a/include/linux/mtd/spi-nor.h
+++ b/include/linux/mtd/spi-nor.h
@@ -31,10 +31,10 @@
@ -994,6 +984,3 @@ index f2a71803..5003ff64 100644
int (*prepare)(struct spi_nor *nor, enum spi_nor_ops ops);
void (*unprepare)(struct spi_nor *nor, enum spi_nor_ops ops);
--
2.14.1

@ -30,8 +30,6 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
create mode 100644 drivers/pci/host/pci-layerscape-ep.c
create mode 100644 drivers/pci/host/pci-layerscape-ep.h
diff --git a/drivers/irqchip/irq-ls-scfg-msi.c b/drivers/irqchip/irq-ls-scfg-msi.c
index 02cca74c..57e3d900 100644
--- a/drivers/irqchip/irq-ls-scfg-msi.c
+++ b/drivers/irqchip/irq-ls-scfg-msi.c
@@ -17,13 +17,32 @@
@ -84,7 +82,7 @@ index 02cca74c..57e3d900 100644
};
static struct irq_chip ls_scfg_msi_irq_chip = {
@@ -49,19 +71,56 @@ static struct msi_domain_info ls_scfg_msi_domain_info = {
@@ -49,19 +71,56 @@ static struct msi_domain_info ls_scfg_ms
.chip = &ls_scfg_msi_irq_chip,
};
@ -143,7 +141,7 @@ index 02cca74c..57e3d900 100644
}
static struct irq_chip ls_scfg_msi_parent_chip = {
@@ -81,8 +140,8 @@ static int ls_scfg_msi_domain_irq_alloc(struct irq_domain *domain,
@@ -81,8 +140,8 @@ static int ls_scfg_msi_domain_irq_alloc(
WARN_ON(nr_irqs != 1);
spin_lock(&msi_data->lock);
@ -154,7 +152,7 @@ index 02cca74c..57e3d900 100644
__set_bit(pos, msi_data->used);
else
err = -ENOSPC;
@@ -106,7 +165,7 @@ static void ls_scfg_msi_domain_irq_free(struct irq_domain *domain,
@@ -106,7 +165,7 @@ static void ls_scfg_msi_domain_irq_free(
int pos;
pos = d->hwirq;
@ -163,7 +161,7 @@ index 02cca74c..57e3d900 100644
pr_err("failed to teardown msi. Invalid hwirq %d\n", pos);
return;
}
@@ -123,15 +182,22 @@ static const struct irq_domain_ops ls_scfg_msi_domain_ops = {
@@ -123,15 +182,22 @@ static const struct irq_domain_ops ls_sc
static void ls_scfg_msi_irq_handler(struct irq_desc *desc)
{
@ -191,7 +189,7 @@ index 02cca74c..57e3d900 100644
if (virq)
generic_handle_irq(virq);
}
@@ -143,7 +209,7 @@ static int ls_scfg_msi_domains_init(struct ls_scfg_msi *msi_data)
@@ -143,7 +209,7 @@ static int ls_scfg_msi_domains_init(stru
{
/* Initialize MSI domain parent */
msi_data->parent = irq_domain_add_linear(NULL,
@ -200,7 +198,7 @@ index 02cca74c..57e3d900 100644
&ls_scfg_msi_domain_ops,
msi_data);
if (!msi_data->parent) {
@@ -164,16 +230,118 @@ static int ls_scfg_msi_domains_init(struct ls_scfg_msi *msi_data)
@@ -164,16 +230,118 @@ static int ls_scfg_msi_domains_init(stru
return 0;
}
@ -320,7 +318,7 @@ index 02cca74c..57e3d900 100644
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
msi_data->regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(msi_data->regs)) {
@@ -182,23 +350,48 @@ static int ls_scfg_msi_probe(struct platform_device *pdev)
@@ -182,23 +350,48 @@ static int ls_scfg_msi_probe(struct plat
}
msi_data->msiir_addr = res->start;
@ -379,7 +377,7 @@ index 02cca74c..57e3d900 100644
platform_set_drvdata(pdev, msi_data);
return 0;
@@ -207,8 +400,10 @@ static int ls_scfg_msi_probe(struct platform_device *pdev)
@@ -207,8 +400,10 @@ static int ls_scfg_msi_probe(struct plat
static int ls_scfg_msi_remove(struct platform_device *pdev)
{
struct ls_scfg_msi *msi_data = platform_get_drvdata(pdev);
@ -391,7 +389,7 @@ index 02cca74c..57e3d900 100644
irq_domain_remove(msi_data->msi_domain);
irq_domain_remove(msi_data->parent);
@@ -218,12 +413,6 @@ static int ls_scfg_msi_remove(struct platform_device *pdev)
@@ -218,12 +413,6 @@ static int ls_scfg_msi_remove(struct pla
return 0;
}
@ -404,11 +402,9 @@ index 02cca74c..57e3d900 100644
static struct platform_driver ls_scfg_msi_driver = {
.driver = {
.name = "ls-scfg-msi",
diff --git a/drivers/pci/host/Makefile b/drivers/pci/host/Makefile
index 084cb498..88e87704 100644
--- a/drivers/pci/host/Makefile
+++ b/drivers/pci/host/Makefile
@@ -17,7 +17,7 @@ obj-$(CONFIG_PCIE_XILINX) += pcie-xilinx.o
@@ -17,7 +17,7 @@ obj-$(CONFIG_PCIE_XILINX) += pcie-xilinx
obj-$(CONFIG_PCIE_XILINX_NWL) += pcie-xilinx-nwl.o
obj-$(CONFIG_PCI_XGENE) += pci-xgene.o
obj-$(CONFIG_PCI_XGENE_MSI) += pci-xgene-msi.o
@ -417,9 +413,6 @@ index 084cb498..88e87704 100644
obj-$(CONFIG_PCI_VERSATILE) += pci-versatile.o
obj-$(CONFIG_PCIE_IPROC) += pcie-iproc.o
obj-$(CONFIG_PCIE_IPROC_MSI) += pcie-iproc-msi.o
diff --git a/drivers/pci/host/pci-layerscape-ep-debugfs.c b/drivers/pci/host/pci-layerscape-ep-debugfs.c
new file mode 100644
index 00000000..5f4870ba
--- /dev/null
+++ b/drivers/pci/host/pci-layerscape-ep-debugfs.c
@@ -0,0 +1,758 @@
@ -1181,9 +1174,6 @@ index 00000000..5f4870ba
+MODULE_AUTHOR("Minghuan Lian <Minghuan.Lian@freescale.com>");
+MODULE_DESCRIPTION("Freescale Layerscape PCIe EP controller driver");
+MODULE_LICENSE("GPL v2");
diff --git a/drivers/pci/host/pci-layerscape-ep.c b/drivers/pci/host/pci-layerscape-ep.c
new file mode 100644
index 00000000..8f1cca6e
--- /dev/null
+++ b/drivers/pci/host/pci-layerscape-ep.c
@@ -0,0 +1,309 @@
@ -1496,9 +1486,6 @@ index 00000000..8f1cca6e
+MODULE_AUTHOR("Minghuan Lian <Minghuan.Lian@freescale.com>");
+MODULE_DESCRIPTION("Freescale Layerscape PCIe EP driver");
+MODULE_LICENSE("GPL v2");
diff --git a/drivers/pci/host/pci-layerscape-ep.h b/drivers/pci/host/pci-layerscape-ep.h
new file mode 100644
index 00000000..990c0ff5
--- /dev/null
+++ b/drivers/pci/host/pci-layerscape-ep.h
@@ -0,0 +1,115 @@
@ -1617,8 +1604,6 @@ index 00000000..990c0ff5
+int ls_pcie_ep_dbgfs_remove(struct ls_pcie *pcie);
+
+#endif /* _PCIE_LAYERSCAPE_EP_H */
diff --git a/drivers/pci/host/pci-layerscape.c b/drivers/pci/host/pci-layerscape.c
index 65370799..7ce32ff0 100644
--- a/drivers/pci/host/pci-layerscape.c
+++ b/drivers/pci/host/pci-layerscape.c
@@ -35,12 +35,14 @@
@ -1638,7 +1623,7 @@ index 65370799..7ce32ff0 100644
struct pcie_host_ops *ops;
};
@@ -86,6 +88,14 @@ static void ls_pcie_drop_msg_tlp(struct ls_pcie *pcie)
@@ -86,6 +88,14 @@ static void ls_pcie_drop_msg_tlp(struct
iowrite32(val, pcie->pp.dbi_base + PCIE_STRFMR1);
}
@ -1653,7 +1638,7 @@ index 65370799..7ce32ff0 100644
static int ls1021_pcie_link_up(struct pcie_port *pp)
{
u32 state;
@@ -134,7 +144,7 @@ static int ls_pcie_link_up(struct pcie_port *pp)
@@ -134,7 +144,7 @@ static int ls_pcie_link_up(struct pcie_p
struct ls_pcie *pcie = to_ls_pcie(pp);
u32 state;
@ -1662,7 +1647,7 @@ index 65370799..7ce32ff0 100644
pcie->drvdata->ltssm_shift) &
LTSSM_STATE_MASK;
@@ -153,6 +163,9 @@ static void ls_pcie_host_init(struct pcie_port *pp)
@@ -153,6 +163,9 @@ static void ls_pcie_host_init(struct pci
ls_pcie_clear_multifunction(pcie);
ls_pcie_drop_msg_tlp(pcie);
iowrite32(0, pcie->pp.dbi_base + PCIE_DBI_RO_WR_EN);
@ -1672,7 +1657,7 @@ index 65370799..7ce32ff0 100644
}
static int ls_pcie_msi_host_init(struct pcie_port *pp,
@@ -196,20 +209,39 @@ static struct ls_pcie_drvdata ls1021_drvdata = {
@@ -196,20 +209,39 @@ static struct ls_pcie_drvdata ls1021_drv
static struct ls_pcie_drvdata ls1043_drvdata = {
.lut_offset = 0x10000,
.ltssm_shift = 24,
@ -1712,11 +1697,9 @@ index 65370799..7ce32ff0 100644
{ },
};
diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c
index af8f6e92..2358e049 100644
--- a/drivers/pci/host/pcie-designware.c
+++ b/drivers/pci/host/pcie-designware.c
@@ -478,6 +478,12 @@ int dw_pcie_wait_for_link(struct pcie_port *pp)
@@ -478,6 +478,12 @@ int dw_pcie_wait_for_link(struct pcie_po
return -ETIMEDOUT;
}
@ -1729,22 +1712,18 @@ index af8f6e92..2358e049 100644
int dw_pcie_link_up(struct pcie_port *pp)
{
u32 val;
diff --git a/drivers/pci/host/pcie-designware.h b/drivers/pci/host/pcie-designware.h
index a567ea28..4e6672b2 100644
--- a/drivers/pci/host/pcie-designware.h
+++ b/drivers/pci/host/pcie-designware.h
@@ -82,5 +82,6 @@ int dw_pcie_wait_for_link(struct pcie_port *pp);
@@ -82,5 +82,6 @@ int dw_pcie_wait_for_link(struct pcie_po
int dw_pcie_link_up(struct pcie_port *pp);
void dw_pcie_setup_rc(struct pcie_port *pp);
int dw_pcie_host_init(struct pcie_port *pp);
+void dw_pcie_disable_outbound_atu(struct pcie_port *pp, int index);
#endif /* _PCIE_DESIGNWARE_H */
diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c
index e9270b40..1bad877a 100644
--- a/drivers/pci/pcie/portdrv_core.c
+++ b/drivers/pci/pcie/portdrv_core.c
@@ -44,52 +44,30 @@ static void release_pcie_device(struct device *dev)
@@ -44,52 +44,30 @@ static void release_pcie_device(struct d
}
/**
@ -1808,7 +1787,7 @@ index e9270b40..1bad877a 100644
/*
* Allocate as many entries as the port wants, so that we can check
@@ -97,20 +75,13 @@ static int pcie_port_enable_msix(struct pci_dev *dev, int *vectors, int mask)
@@ -97,20 +75,13 @@ static int pcie_port_enable_msix(struct
* equal to the number of entries this port actually uses, we'll happily
* go through without any tricks.
*/
@ -1834,7 +1813,7 @@ index e9270b40..1bad877a 100644
/*
* The code below follows the PCI Express Base Specification 2.0
@@ -125,18 +96,16 @@ static int pcie_port_enable_msix(struct pci_dev *dev, int *vectors, int mask)
@@ -125,18 +96,16 @@ static int pcie_port_enable_msix(struct
pcie_capability_read_word(dev, PCI_EXP_FLAGS, &reg16);
entry = (reg16 & PCI_EXP_FLAGS_IRQ) >> 9;
if (entry >= nr_entries)
@ -1858,7 +1837,7 @@ index e9270b40..1bad877a 100644
/*
* The code below follows Section 7.10.10 of the PCI Express
@@ -151,13 +120,11 @@ static int pcie_port_enable_msix(struct pci_dev *dev, int *vectors, int mask)
@@ -151,13 +120,11 @@ static int pcie_port_enable_msix(struct
pci_read_config_dword(dev, pos + PCI_ERR_ROOT_STATUS, &reg32);
entry = reg32 >> 27;
if (entry >= nr_entries)
@ -1875,7 +1854,7 @@ index e9270b40..1bad877a 100644
}
/*
@@ -165,41 +132,54 @@ static int pcie_port_enable_msix(struct pci_dev *dev, int *vectors, int mask)
@@ -165,41 +132,54 @@ static int pcie_port_enable_msix(struct
* what we have. Otherwise, the port has some extra entries not for the
* services we know and we need to work around that.
*/
@ -1949,7 +1928,7 @@ index e9270b40..1bad877a 100644
/*
* If MSI cannot be used for PCIe PME or hotplug, we have to use
@@ -207,41 +187,25 @@ static int init_service_irqs(struct pci_dev *dev, int *irqs, int mask)
@@ -207,41 +187,25 @@ static int init_service_irqs(struct pci_
*/
if (((mask & PCIE_PORT_SERVICE_PME) && pcie_pme_no_msi()) ||
((mask & PCIE_PORT_SERVICE_HP) && pciehp_no_msi())) {
@ -2003,7 +1982,7 @@ index e9270b40..1bad877a 100644
/**
* get_port_device_capability - discover capabilities of a PCI Express port
* @dev: PCI Express port to examine
@@ -378,7 +342,7 @@ int pcie_port_device_register(struct pci_dev *dev)
@@ -378,7 +342,7 @@ int pcie_port_device_register(struct pci
* that can be used in the absence of irqs. Allow them to determine
* if that is to be used.
*/
@ -2012,7 +1991,7 @@ index e9270b40..1bad877a 100644
if (status) {
capabilities &= PCIE_PORT_SERVICE_VC | PCIE_PORT_SERVICE_HP;
if (!capabilities)
@@ -401,7 +365,7 @@ int pcie_port_device_register(struct pci_dev *dev)
@@ -401,7 +365,7 @@ int pcie_port_device_register(struct pci
return 0;
error_cleanup_irqs:
@ -2021,7 +2000,7 @@ index e9270b40..1bad877a 100644
error_disable:
pci_disable_device(dev);
return status;
@@ -469,7 +433,7 @@ static int remove_iter(struct device *dev, void *data)
@@ -469,7 +433,7 @@ static int remove_iter(struct device *de
void pcie_port_device_remove(struct pci_dev *dev)
{
device_for_each_child(&dev->dev, NULL, remove_iter);
@ -2030,7 +2009,7 @@ index e9270b40..1bad877a 100644
pci_disable_device(dev);
}
@@ -499,7 +463,6 @@ static int pcie_port_probe_service(struct device *dev)
@@ -499,7 +463,6 @@ static int pcie_port_probe_service(struc
if (status)
return status;
@ -2038,7 +2017,7 @@ index e9270b40..1bad877a 100644
get_device(dev);
return 0;
}
@@ -524,8 +487,6 @@ static int pcie_port_remove_service(struct device *dev)
@@ -524,8 +487,6 @@ static int pcie_port_remove_service(stru
pciedev = to_pcie_device(dev);
driver = to_service_driver(dev->driver);
if (driver && driver->remove) {
@ -2047,11 +2026,9 @@ index e9270b40..1bad877a 100644
driver->remove(pciedev);
put_device(dev);
}
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 1b711796..6738d816 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1823,6 +1823,7 @@ void pcibios_release_device(struct pci_dev *dev);
@@ -1823,6 +1823,7 @@ void pcibios_release_device(struct pci_d
void pcibios_penalize_isa_irq(int irq, int active);
int pcibios_alloc_irq(struct pci_dev *dev);
void pcibios_free_irq(struct pci_dev *dev);
@ -2059,6 +2036,3 @@ index 1b711796..6738d816 100644
#ifdef CONFIG_HIBERNATE_CALLBACKS
extern struct dev_pm_ops pcibios_pm_ops;
--
2.14.1

@ -1741,7 +1741,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
PHY_INTERFACE_MODE_MAX,
} phy_interface_t;
@@ -784,6 +785,9 @@ int phy_stop_interrupts(struct phy_devic
@@ -780,6 +781,9 @@ int phy_stop_interrupts(struct phy_devic
static inline int phy_read_status(struct phy_device *phydev)
{

@ -78,9 +78,6 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
create mode 100644 drivers/staging/fsl_ppfe/pfe_sysfs.c
create mode 100644 drivers/staging/fsl_ppfe/pfe_sysfs.h
diff --git a/drivers/staging/fsl_ppfe/Kconfig b/drivers/staging/fsl_ppfe/Kconfig
new file mode 100644
index 00000000..e4096435
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/Kconfig
@@ -0,0 +1,20 @@
@ -104,9 +101,6 @@ index 00000000..e4096435
+ UTIL PE has to be enabled only if required.
+
+endif # FSL_PPFE
diff --git a/drivers/staging/fsl_ppfe/Makefile b/drivers/staging/fsl_ppfe/Makefile
new file mode 100644
index 00000000..07cd351b
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/Makefile
@@ -0,0 +1,19 @@
@ -129,17 +123,11 @@ index 00000000..07cd351b
+ pfe_debugfs.o \
+ pfe_ls1012a_platform.o \
+ pfe_hal.o
diff --git a/drivers/staging/fsl_ppfe/TODO b/drivers/staging/fsl_ppfe/TODO
new file mode 100644
index 00000000..43c48ccd
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/TODO
@@ -0,0 +1,2 @@
+TODO:
+ - provide pfe pe monitoring support
diff --git a/drivers/staging/fsl_ppfe/include/pfe/cbus.h b/drivers/staging/fsl_ppfe/include/pfe/cbus.h
new file mode 100644
index 00000000..04503d28
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/include/pfe/cbus.h
@@ -0,0 +1,78 @@
@ -221,9 +209,6 @@ index 00000000..04503d28
+#define DDR_BUF_SIZE BIT(DDR_BUF_SIZE_LN2)
+
+#endif /* _CBUS_H_ */
diff --git a/drivers/staging/fsl_ppfe/include/pfe/cbus/bmu.h b/drivers/staging/fsl_ppfe/include/pfe/cbus/bmu.h
new file mode 100644
index 00000000..87738ca3
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/bmu.h
@@ -0,0 +1,55 @@
@ -282,9 +267,6 @@ index 00000000..87738ca3
+#define BMU2_MCAST_ALLOC_CTRL (BMU2_BASE_ADDR + BMU_MCAST_ALLOC_CTRL)
+
+#endif /* _BMU_H_ */
diff --git a/drivers/staging/fsl_ppfe/include/pfe/cbus/class_csr.h b/drivers/staging/fsl_ppfe/include/pfe/cbus/class_csr.h
new file mode 100644
index 00000000..e4dadff5
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/class_csr.h
@@ -0,0 +1,289 @@
@ -577,9 +559,6 @@ index 00000000..e4dadff5
+};
+
+#endif /* _CLASS_CSR_H_ */
diff --git a/drivers/staging/fsl_ppfe/include/pfe/cbus/emac_mtip.h b/drivers/staging/fsl_ppfe/include/pfe/cbus/emac_mtip.h
new file mode 100644
index 00000000..9c5d7919
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/emac_mtip.h
@@ -0,0 +1,242 @@
@ -825,9 +804,6 @@ index 00000000..9c5d7919
+#define EMAC_SPEC_ADDR_MAX 4
+
+#endif /* _EMAC_H_ */
diff --git a/drivers/staging/fsl_ppfe/include/pfe/cbus/gpi.h b/drivers/staging/fsl_ppfe/include/pfe/cbus/gpi.h
new file mode 100644
index 00000000..7b295830
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/gpi.h
@@ -0,0 +1,86 @@
@ -917,9 +893,6 @@ index 00000000..7b295830
+#define EGPI_PAUSE_TIME 0x000007D0
+#define EGPI_PAUSE_ENABLE 0x40000000
+#endif /* _GPI_H_ */
diff --git a/drivers/staging/fsl_ppfe/include/pfe/cbus/hif.h b/drivers/staging/fsl_ppfe/include/pfe/cbus/hif.h
new file mode 100644
index 00000000..71cf81a7
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/hif.h
@@ -0,0 +1,100 @@
@ -1023,9 +996,6 @@ index 00000000..71cf81a7
+#define PROC_ID(id) ((id) << 18)
+
+#endif /* _HIF_H_ */
diff --git a/drivers/staging/fsl_ppfe/include/pfe/cbus/hif_nocpy.h b/drivers/staging/fsl_ppfe/include/pfe/cbus/hif_nocpy.h
new file mode 100644
index 00000000..3d4d43ce
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/hif_nocpy.h
@@ -0,0 +1,50 @@
@ -1079,9 +1049,6 @@ index 00000000..3d4d43ce
+#define HIF_NOCPY_INT_COAL (HIF_NOCPY_BASE_ADDR + 0x90)
+
+#endif /* _HIF_NOCPY_H_ */
diff --git a/drivers/staging/fsl_ppfe/include/pfe/cbus/tmu_csr.h b/drivers/staging/fsl_ppfe/include/pfe/cbus/tmu_csr.h
new file mode 100644
index 00000000..05f3d681
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/tmu_csr.h
@@ -0,0 +1,168 @@
@ -1253,9 +1220,6 @@ index 00000000..05f3d681
+#define DEFAULT_TMU3_QDEPTH 127
+
+#endif /* _TMU_CSR_H_ */
diff --git a/drivers/staging/fsl_ppfe/include/pfe/cbus/util_csr.h b/drivers/staging/fsl_ppfe/include/pfe/cbus/util_csr.h
new file mode 100644
index 00000000..ae623cda
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/util_csr.h
@@ -0,0 +1,61 @@
@ -1320,9 +1284,6 @@ index 00000000..ae623cda
+};
+
+#endif /* _UTIL_CSR_H_ */
diff --git a/drivers/staging/fsl_ppfe/include/pfe/pfe.h b/drivers/staging/fsl_ppfe/include/pfe/pfe.h
new file mode 100644
index 00000000..d93ae4c6
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/include/pfe/pfe.h
@@ -0,0 +1,372 @@
@ -1698,9 +1659,6 @@ index 00000000..d93ae4c6
+}
+
+#endif /* _PFE_H_ */
diff --git a/drivers/staging/fsl_ppfe/pfe_ctrl.c b/drivers/staging/fsl_ppfe/pfe_ctrl.c
new file mode 100644
index 00000000..dfa8547c
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/pfe_ctrl.c
@@ -0,0 +1,238 @@
@ -1942,9 +1900,6 @@ index 00000000..dfa8547c
+{
+ pr_info("%s\n", __func__);
+}
diff --git a/drivers/staging/fsl_ppfe/pfe_ctrl.h b/drivers/staging/fsl_ppfe/pfe_ctrl.h
new file mode 100644
index 00000000..22115c76
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/pfe_ctrl.h
@@ -0,0 +1,112 @@
@ -2060,9 +2015,6 @@ index 00000000..22115c76
+int relax(unsigned long end);
+
+#endif /* _PFE_CTRL_H_ */
diff --git a/drivers/staging/fsl_ppfe/pfe_debugfs.c b/drivers/staging/fsl_ppfe/pfe_debugfs.c
new file mode 100644
index 00000000..4156610d
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/pfe_debugfs.c
@@ -0,0 +1,111 @@
@ -2177,9 +2129,6 @@ index 00000000..4156610d
+{
+ debugfs_remove_recursive(pfe->dentry);
+}
diff --git a/drivers/staging/fsl_ppfe/pfe_debugfs.h b/drivers/staging/fsl_ppfe/pfe_debugfs.h
new file mode 100644
index 00000000..301d9fc2
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/pfe_debugfs.h
@@ -0,0 +1,25 @@
@ -2208,9 +2157,6 @@ index 00000000..301d9fc2
+void pfe_debugfs_exit(struct pfe *pfe);
+
+#endif /* _PFE_DEBUGFS_H_ */
diff --git a/drivers/staging/fsl_ppfe/pfe_eth.c b/drivers/staging/fsl_ppfe/pfe_eth.c
new file mode 100644
index 00000000..02cd7c52
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/pfe_eth.c
@@ -0,0 +1,2434 @@
@ -4648,9 +4594,6 @@ index 00000000..02cd7c52
+ for (ii = NUM_GEMAC_SUPPORT - 1; ii >= 0; ii--)
+ pfe_eth_exit_one(pfe->eth.eth_priv[ii]);
+}
diff --git a/drivers/staging/fsl_ppfe/pfe_eth.h b/drivers/staging/fsl_ppfe/pfe_eth.h
new file mode 100644
index 00000000..721bef3e
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/pfe_eth.h
@@ -0,0 +1,184 @@
@ -4838,9 +4781,6 @@ index 00000000..721bef3e
+int pfe_eth_mdio_reset(struct mii_bus *bus);
+
+#endif /* _PFE_ETH_H_ */
diff --git a/drivers/staging/fsl_ppfe/pfe_firmware.c b/drivers/staging/fsl_ppfe/pfe_firmware.c
new file mode 100644
index 00000000..47462b9f
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/pfe_firmware.c
@@ -0,0 +1,314 @@
@ -5158,9 +5098,6 @@ index 00000000..47462b9f
+ util_disable();
+#endif
+}
diff --git a/drivers/staging/fsl_ppfe/pfe_firmware.h b/drivers/staging/fsl_ppfe/pfe_firmware.h
new file mode 100644
index 00000000..5ade848b
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/pfe_firmware.h
@@ -0,0 +1,32 @@
@ -5196,9 +5133,6 @@ index 00000000..5ade848b
+void pfe_firmware_exit(struct pfe *pfe);
+
+#endif /* _PFE_FIRMWARE_H_ */
diff --git a/drivers/staging/fsl_ppfe/pfe_hal.c b/drivers/staging/fsl_ppfe/pfe_hal.c
new file mode 100644
index 00000000..0915034b
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/pfe_hal.c
@@ -0,0 +1,1516 @@
@ -6718,9 +6652,6 @@ index 00000000..0915034b
+ hif_int &= HIF_RXPKT_INT_EN;
+ writel(hif_int, HIF_INT_ENABLE);
+}
diff --git a/drivers/staging/fsl_ppfe/pfe_hif.c b/drivers/staging/fsl_ppfe/pfe_hif.c
new file mode 100644
index 00000000..6835e140
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/pfe_hif.c
@@ -0,0 +1,1072 @@
@ -7796,9 +7727,6 @@ index 00000000..6835e140
+ pfe_hif_release_buffers(hif);
+ pfe_hif_free_descr(hif);
+}
diff --git a/drivers/staging/fsl_ppfe/pfe_hif.h b/drivers/staging/fsl_ppfe/pfe_hif.h
new file mode 100644
index 00000000..6e36f0c1
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/pfe_hif.h
@@ -0,0 +1,211 @@
@ -8013,9 +7941,6 @@ index 00000000..6e36f0c1
+#define __memcpy(dst, src, len) memcpy(dst, src, len)
+
+#endif /* _PFE_HIF_H_ */
diff --git a/drivers/staging/fsl_ppfe/pfe_hif_lib.c b/drivers/staging/fsl_ppfe/pfe_hif_lib.c
new file mode 100644
index 00000000..837eaa24
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/pfe_hif_lib.c
@@ -0,0 +1,601 @@
@ -8620,9 +8545,6 @@ index 00000000..837eaa24
+
+ pfe_hif_shm_clean(pfe->hif.shm);
+}
diff --git a/drivers/staging/fsl_ppfe/pfe_hif_lib.h b/drivers/staging/fsl_ppfe/pfe_hif_lib.h
new file mode 100644
index 00000000..49e7b5f1
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/pfe_hif_lib.h
@@ -0,0 +1,239 @@
@ -8865,9 +8787,6 @@ index 00000000..49e7b5f1
+ })
+
+#endif /* _PFE_HIF_LIB_H_ */
diff --git a/drivers/staging/fsl_ppfe/pfe_hw.c b/drivers/staging/fsl_ppfe/pfe_hw.c
new file mode 100644
index 00000000..16ea2c65
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/pfe_hw.c
@@ -0,0 +1,176 @@
@ -9047,9 +8966,6 @@ index 00000000..16ea2c65
+ bmu_disable(BMU2_BASE_ADDR);
+ bmu_reset(BMU2_BASE_ADDR);
+}
diff --git a/drivers/staging/fsl_ppfe/pfe_hw.h b/drivers/staging/fsl_ppfe/pfe_hw.h
new file mode 100644
index 00000000..53b5fe14
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/pfe_hw.h
@@ -0,0 +1,27 @@
@ -9080,9 +8996,6 @@ index 00000000..53b5fe14
+void pfe_hw_exit(struct pfe *pfe);
+
+#endif /* _PFE_HW_H_ */
diff --git a/drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c b/drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c
new file mode 100644
index 00000000..c579eb58
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c
@@ -0,0 +1,394 @@
@ -9480,9 +9393,6 @@ index 00000000..c579eb58
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("PFE Ethernet driver");
+MODULE_AUTHOR("NXP DNCPE");
diff --git a/drivers/staging/fsl_ppfe/pfe_mod.c b/drivers/staging/fsl_ppfe/pfe_mod.c
new file mode 100644
index 00000000..d5ba56a3
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/pfe_mod.c
@@ -0,0 +1,141 @@
@ -9627,9 +9537,6 @@ index 00000000..d5ba56a3
+
+ return 0;
+}
diff --git a/drivers/staging/fsl_ppfe/pfe_mod.h b/drivers/staging/fsl_ppfe/pfe_mod.h
new file mode 100644
index 00000000..3012f17f
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/pfe_mod.h
@@ -0,0 +1,112 @@
@ -9745,9 +9652,6 @@ index 00000000..3012f17f
+#define BMU1_LMEM_SIZE (LMEM_BUF_SIZE * BMU1_BUF_COUNT)
+
+#endif /* _PFE_MOD_H */
diff --git a/drivers/staging/fsl_ppfe/pfe_perfmon.h b/drivers/staging/fsl_ppfe/pfe_perfmon.h
new file mode 100644
index 00000000..84908121
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/pfe_perfmon.h
@@ -0,0 +1,38 @@
@ -9789,9 +9693,6 @@ index 00000000..84908121
+void pfe_perfmon_exit(struct pfe *pfe);
+
+#endif /* _PFE_PERFMON_H_ */
diff --git a/drivers/staging/fsl_ppfe/pfe_sysfs.c b/drivers/staging/fsl_ppfe/pfe_sysfs.c
new file mode 100644
index 00000000..2a763844
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/pfe_sysfs.c
@@ -0,0 +1,818 @@
@ -10613,9 +10514,6 @@ index 00000000..2a763844
+ device_remove_file(pfe->dev, &dev_attr_tmu);
+ device_remove_file(pfe->dev, &dev_attr_class);
+}
diff --git a/drivers/staging/fsl_ppfe/pfe_sysfs.h b/drivers/staging/fsl_ppfe/pfe_sysfs.h
new file mode 100644
index 00000000..4fb39c93
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/pfe_sysfs.h
@@ -0,0 +1,29 @@
@ -10648,6 +10546,3 @@ index 00000000..4fb39c93
+void pfe_sysfs_exit(struct pfe *pfe);
+
+#endif /* _PFE_SYSFS_H_ */
--
2.14.1

@ -30,8 +30,6 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
create mode 100644 drivers/dma/dpaa2-qdma/fsl_dpdmai_cmd.h
create mode 100644 drivers/dma/fsl-qdma.c
diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index 141aefbe..8caaf091 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -192,6 +192,20 @@ config FSL_EDMA
@ -79,8 +77,6 @@ index 141aefbe..8caaf091 100644
# driver files
source "drivers/dma/bestcomm/Kconfig"
diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile
index e4dc9cac..a694da0e 100644
--- a/drivers/dma/Makefile
+++ b/drivers/dma/Makefile
@@ -29,6 +29,8 @@ obj-$(CONFIG_DW_DMAC_CORE) += dw/
@ -92,7 +88,7 @@ index e4dc9cac..a694da0e 100644
obj-$(CONFIG_FSL_RAID) += fsl_raid.o
obj-$(CONFIG_HSU_DMA) += hsu/
obj-$(CONFIG_IMG_MDC_DMA) += img-mdc-dma.o
@@ -67,6 +69,7 @@ obj-$(CONFIG_TI_DMA_CROSSBAR) += ti-dma-crossbar.o
@@ -67,6 +69,7 @@ obj-$(CONFIG_TI_DMA_CROSSBAR) += ti-dma-
obj-$(CONFIG_TI_EDMA) += edma.o
obj-$(CONFIG_XGENE_DMA) += xgene-dma.o
obj-$(CONFIG_ZX_DMA) += zx296702_dma.o
@ -100,9 +96,6 @@ index e4dc9cac..a694da0e 100644
obj-y += qcom/
obj-y += xilinx/
diff --git a/drivers/dma/caam_dma.c b/drivers/dma/caam_dma.c
new file mode 100644
index 00000000..e430b320
--- /dev/null
+++ b/drivers/dma/caam_dma.c
@@ -0,0 +1,563 @@
@ -669,9 +662,6 @@ index 00000000..e430b320
+MODULE_LICENSE("Dual BSD/GPL");
+MODULE_DESCRIPTION("NXP CAAM support for SG DMA");
+MODULE_AUTHOR("NXP Semiconductors");
diff --git a/drivers/dma/dpaa2-qdma/Kconfig b/drivers/dma/dpaa2-qdma/Kconfig
new file mode 100644
index 00000000..084e34bf
--- /dev/null
+++ b/drivers/dma/dpaa2-qdma/Kconfig
@@ -0,0 +1,8 @@
@ -683,9 +673,6 @@ index 00000000..084e34bf
+ ---help---
+ NXP Data Path Acceleration Architecture 2 QDMA driver,
+ using the NXP MC bus driver.
diff --git a/drivers/dma/dpaa2-qdma/Makefile b/drivers/dma/dpaa2-qdma/Makefile
new file mode 100644
index 00000000..ba599ac6
--- /dev/null
+++ b/drivers/dma/dpaa2-qdma/Makefile
@@ -0,0 +1,8 @@
@ -697,9 +684,6 @@ index 00000000..ba599ac6
+obj-$(CONFIG_FSL_DPAA2_QDMA) += fsl-dpaa2-qdma.o
+
+fsl-dpaa2-qdma-objs := dpaa2-qdma.o dpdmai.o
diff --git a/drivers/dma/dpaa2-qdma/dpaa2-qdma.c b/drivers/dma/dpaa2-qdma/dpaa2-qdma.c
new file mode 100644
index 00000000..ad6b03f7
--- /dev/null
+++ b/drivers/dma/dpaa2-qdma/dpaa2-qdma.c
@@ -0,0 +1,986 @@
@ -1689,9 +1673,6 @@ index 00000000..ad6b03f7
+
+MODULE_DESCRIPTION("NXP DPAA2 qDMA driver");
+MODULE_LICENSE("Dual BSD/GPL");
diff --git a/drivers/dma/dpaa2-qdma/dpaa2-qdma.h b/drivers/dma/dpaa2-qdma/dpaa2-qdma.h
new file mode 100644
index 00000000..71a00db8
--- /dev/null
+++ b/drivers/dma/dpaa2-qdma/dpaa2-qdma.h
@@ -0,0 +1,262 @@
@ -1957,9 +1938,6 @@ index 00000000..71a00db8
+#define SG_POOL_SIZE (sizeof(struct qdma_sg_blk) +\
+ sizeof(struct dpaa2_qdma_sg) * NUM_SG_PER_BLK)
+#endif /* __DPAA2_QDMA_H */
diff --git a/drivers/dma/dpaa2-qdma/dpdmai.c b/drivers/dma/dpaa2-qdma/dpdmai.c
new file mode 100644
index 00000000..ad13fc1e
--- /dev/null
+++ b/drivers/dma/dpaa2-qdma/dpdmai.c
@@ -0,0 +1,454 @@
@ -2417,9 +2395,6 @@ index 00000000..ad13fc1e
+
+ return 0;
+}
diff --git a/drivers/dma/dpaa2-qdma/fsl_dpdmai.h b/drivers/dma/dpaa2-qdma/fsl_dpdmai.h
new file mode 100644
index 00000000..e931ce16
--- /dev/null
+++ b/drivers/dma/dpaa2-qdma/fsl_dpdmai.h
@@ -0,0 +1,521 @@
@ -2944,9 +2919,6 @@ index 00000000..e931ce16
+ struct dpdmai_tx_queue_attr *attr);
+
+#endif /* __FSL_DPDMAI_H */
diff --git a/drivers/dma/dpaa2-qdma/fsl_dpdmai_cmd.h b/drivers/dma/dpaa2-qdma/fsl_dpdmai_cmd.h
new file mode 100644
index 00000000..7d403c01
--- /dev/null
+++ b/drivers/dma/dpaa2-qdma/fsl_dpdmai_cmd.h
@@ -0,0 +1,222 @@
@ -3172,9 +3144,6 @@ index 00000000..7d403c01
+ MC_RSP_OP(cmd, 1, 0, 32, uint32_t, attr->fqid)
+
+#endif /* _FSL_DPDMAI_CMD_H */
diff --git a/drivers/dma/fsl-qdma.c b/drivers/dma/fsl-qdma.c
new file mode 100644
index 00000000..6c4c2813
--- /dev/null
+++ b/drivers/dma/fsl-qdma.c
@@ -0,0 +1,1201 @@
@ -4379,6 +4348,3 @@ index 00000000..6c4c2813
+MODULE_ALIAS("platform:fsl-qdma");
+MODULE_DESCRIPTION("Freescale qDMA engine driver");
+MODULE_LICENSE("GPL v2");
--
2.14.1

@ -14,11 +14,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2 files changed, 371 insertions(+), 4 deletions(-)
create mode 100644 drivers/soc/fsl/layerscape/ftm_alarm.c
diff --git a/drivers/clocksource/fsl_ftm_timer.c b/drivers/clocksource/fsl_ftm_timer.c
index 738515b8..770bbbca 100644
--- a/drivers/clocksource/fsl_ftm_timer.c
+++ b/drivers/clocksource/fsl_ftm_timer.c
@@ -83,11 +83,11 @@ static inline void ftm_counter_disable(void __iomem *base)
@@ -83,11 +83,11 @@ static inline void ftm_counter_disable(v
static inline void ftm_irq_acknowledge(void __iomem *base)
{
@ -34,9 +32,6 @@ index 738515b8..770bbbca 100644
}
static inline void ftm_irq_enable(void __iomem *base)
diff --git a/drivers/soc/fsl/layerscape/ftm_alarm.c b/drivers/soc/fsl/layerscape/ftm_alarm.c
new file mode 100644
index 00000000..49865b0b
--- /dev/null
+++ b/drivers/soc/fsl/layerscape/ftm_alarm.c
@@ -0,0 +1,367 @@
@ -407,6 +402,3 @@ index 00000000..49865b0b
+ return platform_driver_register(&ftm_alarm_driver);
+}
+device_initcall(ftm_alarm_init);
--
2.14.1

@ -23,11 +23,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
include/linux/iommu.h | 55 +++++++---
10 files changed, 739 insertions(+), 157 deletions(-)
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index c380b7e8..93199931 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -373,6 +373,8 @@ static struct iommu_group *acpihid_device_group(struct device *dev)
@@ -373,6 +373,8 @@ static struct iommu_group *acpihid_devic
if (!entry->group)
entry->group = generic_device_group(dev);
@ -36,7 +34,7 @@ index c380b7e8..93199931 100644
return entry->group;
}
@@ -3159,9 +3161,10 @@ static bool amd_iommu_capable(enum iommu_cap cap)
@@ -3160,9 +3162,10 @@ static bool amd_iommu_capable(enum iommu
return false;
}
@ -49,7 +47,7 @@ index c380b7e8..93199931 100644
struct unity_map_entry *entry;
int devid;
@@ -3170,41 +3173,56 @@ static void amd_iommu_get_dm_regions(struct device *dev,
@@ -3171,41 +3174,56 @@ static void amd_iommu_get_dm_regions(str
return;
list_for_each_entry(entry, &amd_iommu_unity_map, list) {
@ -120,7 +118,7 @@ index c380b7e8..93199931 100644
{
struct dma_ops_domain *dma_dom = to_dma_ops_domain(to_pdomain(domain));
unsigned long start, end;
@@ -3228,9 +3246,9 @@ static const struct iommu_ops amd_iommu_ops = {
@@ -3229,9 +3247,9 @@ static const struct iommu_ops amd_iommu_
.add_device = amd_iommu_add_device,
.remove_device = amd_iommu_remove_device,
.device_group = amd_iommu_device_group,
@ -133,8 +131,6 @@ index c380b7e8..93199931 100644
.pgsize_bitmap = AMD_IOMMU_PGSIZES,
};
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index e6f9b2d7..48e2a7c4 100644
--- a/drivers/iommu/arm-smmu-v3.c
+++ b/drivers/iommu/arm-smmu-v3.c
@@ -410,6 +410,9 @@
@ -173,7 +169,7 @@ index e6f9b2d7..48e2a7c4 100644
};
struct arm_smmu_domain {
@@ -1000,9 +1009,9 @@ static void arm_smmu_write_strtab_ent(struct arm_smmu_device *smmu, u32 sid,
@@ -1000,9 +1009,9 @@ static void arm_smmu_write_strtab_ent(st
* This is hideously complicated, but we only really care about
* three cases at the moment:
*
@ -186,19 +182,13 @@ index e6f9b2d7..48e2a7c4 100644
*
* Given that we can't update the STE atomically and the SMMU
* doesn't read the thing in a defined order, that leaves us
@@ -1040,17 +1049,16 @@ static void arm_smmu_write_strtab_ent(struct arm_smmu_device *smmu, u32 sid,
}
@@ -1041,11 +1050,15 @@ static void arm_smmu_write_strtab_ent(st
}
- /* Nuke the existing Config, as we're going to rewrite it */
- val &= ~(STRTAB_STE_0_CFG_MASK << STRTAB_STE_0_CFG_SHIFT);
+ /* Nuke the existing STE_0 value, as we're going to rewrite it */
/* Nuke the existing STE_0 value, as we're going to rewrite it */
- val = ste->valid ? STRTAB_STE_0_V : 0;
+ val = STRTAB_STE_0_V;
- if (ste->valid)
- val |= STRTAB_STE_0_V;
- else
- val &= ~STRTAB_STE_0_V;
+
+ /* Bypass/fault */
+ if (!ste->assigned || !(ste->s1_cfg || ste->s2_cfg)) {
+ if (!ste->assigned && disable_bypass)
@ -212,15 +202,7 @@ index e6f9b2d7..48e2a7c4 100644
dst[0] = cpu_to_le64(val);
dst[1] = cpu_to_le64(STRTAB_STE_1_SHCFG_INCOMING
<< STRTAB_STE_1_SHCFG_SHIFT);
@@ -1081,7 +1089,6 @@ static void arm_smmu_write_strtab_ent(struct arm_smmu_device *smmu, u32 sid,
val |= (ste->s1_cfg->cdptr_dma & STRTAB_STE_0_S1CTXPTR_MASK
<< STRTAB_STE_0_S1CTXPTR_SHIFT) |
STRTAB_STE_0_CFG_S1_TRANS;
-
}
if (ste->s2_cfg) {
@@ -1114,10 +1121,7 @@ static void arm_smmu_write_strtab_ent(struct arm_smmu_device *smmu, u32 sid,
@@ -1108,10 +1121,7 @@ static void arm_smmu_write_strtab_ent(st
static void arm_smmu_init_bypass_stes(u64 *strtab, unsigned int nent)
{
unsigned int i;
@ -232,7 +214,7 @@ index e6f9b2d7..48e2a7c4 100644
for (i = 0; i < nent; ++i) {
arm_smmu_write_strtab_ent(NULL, -1, strtab, &ste);
@@ -1370,8 +1374,6 @@ static bool arm_smmu_capable(enum iommu_cap cap)
@@ -1364,8 +1374,6 @@ static bool arm_smmu_capable(enum iommu_
switch (cap) {
case IOMMU_CAP_CACHE_COHERENCY:
return true;
@ -241,7 +223,7 @@ index e6f9b2d7..48e2a7c4 100644
case IOMMU_CAP_NOEXEC:
return true;
default:
@@ -1383,7 +1385,9 @@ static struct iommu_domain *arm_smmu_domain_alloc(unsigned type)
@@ -1377,7 +1385,9 @@ static struct iommu_domain *arm_smmu_dom
{
struct arm_smmu_domain *smmu_domain;
@ -252,7 +234,7 @@ index e6f9b2d7..48e2a7c4 100644
return NULL;
/*
@@ -1514,6 +1518,11 @@ static int arm_smmu_domain_finalise(struct iommu_domain *domain)
@@ -1508,6 +1518,11 @@ static int arm_smmu_domain_finalise(stru
struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain);
struct arm_smmu_device *smmu = smmu_domain->smmu;
@ -264,7 +246,7 @@ index e6f9b2d7..48e2a7c4 100644
/* Restrict the stage to what we can actually support */
if (!(smmu->features & ARM_SMMU_FEAT_TRANS_S1))
smmu_domain->stage = ARM_SMMU_DOMAIN_S2;
@@ -1584,7 +1593,7 @@ static __le64 *arm_smmu_get_step_for_sid(struct arm_smmu_device *smmu, u32 sid)
@@ -1578,7 +1593,7 @@ static __le64 *arm_smmu_get_step_for_sid
return step;
}
@ -273,7 +255,7 @@ index e6f9b2d7..48e2a7c4 100644
{
int i;
struct arm_smmu_master_data *master = fwspec->iommu_priv;
@@ -1596,17 +1605,14 @@ static int arm_smmu_install_ste_for_dev(struct iommu_fwspec *fwspec)
@@ -1590,17 +1605,14 @@ static int arm_smmu_install_ste_for_dev(
arm_smmu_write_strtab_ent(smmu, sid, step, &master->ste);
}
@ -293,7 +275,7 @@ index e6f9b2d7..48e2a7c4 100644
}
static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev)
@@ -1625,7 +1631,7 @@ static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev)
@@ -1619,7 +1631,7 @@ static int arm_smmu_attach_dev(struct io
ste = &master->ste;
/* Already attached to a different domain? */
@ -302,7 +284,7 @@ index e6f9b2d7..48e2a7c4 100644
arm_smmu_detach_dev(dev);
mutex_lock(&smmu_domain->init_mutex);
@@ -1646,10 +1652,12 @@ static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev)
@@ -1640,10 +1652,12 @@ static int arm_smmu_attach_dev(struct io
goto out_unlock;
}
@ -318,7 +300,7 @@ index e6f9b2d7..48e2a7c4 100644
ste->s1_cfg = &smmu_domain->s1_cfg;
ste->s2_cfg = NULL;
arm_smmu_write_ctx_desc(smmu, ste->s1_cfg);
@@ -1658,10 +1666,7 @@ static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev)
@@ -1652,10 +1666,7 @@ static int arm_smmu_attach_dev(struct io
ste->s2_cfg = &smmu_domain->s2_cfg;
}
@ -330,7 +312,7 @@ index e6f9b2d7..48e2a7c4 100644
out_unlock:
mutex_unlock(&smmu_domain->init_mutex);
return ret;
@@ -1709,6 +1714,9 @@ arm_smmu_iova_to_phys(struct iommu_domain *domain, dma_addr_t iova)
@@ -1703,6 +1714,9 @@ arm_smmu_iova_to_phys(struct iommu_domai
struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain);
struct io_pgtable_ops *ops = smmu_domain->pgtbl_ops;
@ -340,7 +322,7 @@ index e6f9b2d7..48e2a7c4 100644
if (!ops)
return 0;
@@ -1807,7 +1815,7 @@ static void arm_smmu_remove_device(struct device *dev)
@@ -1801,7 +1815,7 @@ static void arm_smmu_remove_device(struc
return;
master = fwspec->iommu_priv;
@ -349,7 +331,7 @@ index e6f9b2d7..48e2a7c4 100644
arm_smmu_detach_dev(dev);
iommu_group_remove_device(dev);
kfree(master);
@@ -1836,6 +1844,9 @@ static int arm_smmu_domain_get_attr(struct iommu_domain *domain,
@@ -1830,6 +1844,9 @@ static int arm_smmu_domain_get_attr(stru
{
struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain);
@ -359,7 +341,7 @@ index e6f9b2d7..48e2a7c4 100644
switch (attr) {
case DOMAIN_ATTR_NESTING:
*(int *)data = (smmu_domain->stage == ARM_SMMU_DOMAIN_NESTED);
@@ -1851,6 +1862,9 @@ static int arm_smmu_domain_set_attr(struct iommu_domain *domain,
@@ -1845,6 +1862,9 @@ static int arm_smmu_domain_set_attr(stru
int ret = 0;
struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain);
@ -369,7 +351,7 @@ index e6f9b2d7..48e2a7c4 100644
mutex_lock(&smmu_domain->init_mutex);
switch (attr) {
@@ -1880,6 +1894,31 @@ static int arm_smmu_of_xlate(struct device *dev, struct of_phandle_args *args)
@@ -1874,6 +1894,31 @@ static int arm_smmu_of_xlate(struct devi
return iommu_fwspec_add_ids(dev, args->args, 1);
}
@ -401,7 +383,7 @@ index e6f9b2d7..48e2a7c4 100644
static struct iommu_ops arm_smmu_ops = {
.capable = arm_smmu_capable,
.domain_alloc = arm_smmu_domain_alloc,
@@ -1895,6 +1934,8 @@ static struct iommu_ops arm_smmu_ops = {
@@ -1889,6 +1934,8 @@ static struct iommu_ops arm_smmu_ops = {
.domain_get_attr = arm_smmu_domain_get_attr,
.domain_set_attr = arm_smmu_domain_set_attr,
.of_xlate = arm_smmu_of_xlate,
@ -410,8 +392,6 @@ index e6f9b2d7..48e2a7c4 100644
.pgsize_bitmap = -1UL, /* Restricted during device attach */
};
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index 8f728144..3243a96d 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -49,6 +49,7 @@
@ -448,7 +428,7 @@ index 8f728144..3243a96d 100644
};
struct arm_smmu_domain {
@@ -821,6 +827,12 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain,
@@ -821,6 +827,12 @@ static int arm_smmu_init_domain_context(
if (smmu_domain->smmu)
goto out_unlock;
@ -461,7 +441,7 @@ index 8f728144..3243a96d 100644
/*
* Mapping the requested stage onto what we support is surprisingly
* complicated, mainly because the spec allows S1+S2 SMMUs without
@@ -981,7 +993,7 @@ static void arm_smmu_destroy_domain_context(struct iommu_domain *domain)
@@ -981,7 +993,7 @@ static void arm_smmu_destroy_domain_cont
void __iomem *cb_base;
int irq;
@ -470,7 +450,7 @@ index 8f728144..3243a96d 100644
return;
/*
@@ -1004,7 +1016,9 @@ static struct iommu_domain *arm_smmu_domain_alloc(unsigned type)
@@ -1004,7 +1016,9 @@ static struct iommu_domain *arm_smmu_dom
{
struct arm_smmu_domain *smmu_domain;
@ -481,7 +461,7 @@ index 8f728144..3243a96d 100644
return NULL;
/*
* Allocate the domain and initialise some of its data structures.
@@ -1202,10 +1216,15 @@ static int arm_smmu_domain_add_master(struct arm_smmu_domain *smmu_domain,
@@ -1202,10 +1216,15 @@ static int arm_smmu_domain_add_master(st
{
struct arm_smmu_device *smmu = smmu_domain->smmu;
struct arm_smmu_s2cr *s2cr = smmu->s2crs;
@ -498,7 +478,7 @@ index 8f728144..3243a96d 100644
for_each_cfg_sme(fwspec, i, idx) {
if (type == s2cr[idx].type && cbndx == s2cr[idx].cbndx)
continue;
@@ -1343,6 +1362,9 @@ static phys_addr_t arm_smmu_iova_to_phys(struct iommu_domain *domain,
@@ -1343,6 +1362,9 @@ static phys_addr_t arm_smmu_iova_to_phys
struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain);
struct io_pgtable_ops *ops= smmu_domain->pgtbl_ops;
@ -508,7 +488,7 @@ index 8f728144..3243a96d 100644
if (!ops)
return 0;
@@ -1368,8 +1390,6 @@ static bool arm_smmu_capable(enum iommu_cap cap)
@@ -1368,8 +1390,6 @@ static bool arm_smmu_capable(enum iommu_
* requests.
*/
return true;
@ -517,7 +497,7 @@ index 8f728144..3243a96d 100644
case IOMMU_CAP_NOEXEC:
return true;
default:
@@ -1478,10 +1498,12 @@ static struct iommu_group *arm_smmu_device_group(struct device *dev)
@@ -1478,10 +1498,12 @@ static struct iommu_group *arm_smmu_devi
}
if (group)
@ -531,7 +511,7 @@ index 8f728144..3243a96d 100644
else
group = generic_device_group(dev);
@@ -1493,6 +1515,9 @@ static int arm_smmu_domain_get_attr(struct iommu_domain *domain,
@@ -1493,6 +1515,9 @@ static int arm_smmu_domain_get_attr(stru
{
struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain);
@ -541,7 +521,7 @@ index 8f728144..3243a96d 100644
switch (attr) {
case DOMAIN_ATTR_NESTING:
*(int *)data = (smmu_domain->stage == ARM_SMMU_DOMAIN_NESTED);
@@ -1508,6 +1533,9 @@ static int arm_smmu_domain_set_attr(struct iommu_domain *domain,
@@ -1508,6 +1533,9 @@ static int arm_smmu_domain_set_attr(stru
int ret = 0;
struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain);
@ -551,7 +531,7 @@ index 8f728144..3243a96d 100644
mutex_lock(&smmu_domain->init_mutex);
switch (attr) {
@@ -1534,17 +1562,44 @@ static int arm_smmu_domain_set_attr(struct iommu_domain *domain,
@@ -1534,17 +1562,44 @@ out_unlock:
static int arm_smmu_of_xlate(struct device *dev, struct of_phandle_args *args)
{
@ -606,7 +586,7 @@ index 8f728144..3243a96d 100644
.pgsize_bitmap = -1UL, /* Restricted during device attach */
};
@@ -1581,16 +1638,22 @@ static void arm_smmu_device_reset(struct arm_smmu_device *smmu)
@@ -1581,16 +1638,22 @@ static void arm_smmu_device_reset(struct
for (i = 0; i < smmu->num_mapping_groups; ++i)
arm_smmu_write_sme(smmu, i);
@ -638,7 +618,7 @@ index 8f728144..3243a96d 100644
writel_relaxed(reg, gr0_base + ARM_SMMU_GR0_sACR);
}
@@ -2024,6 +2087,11 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev)
@@ -2024,6 +2087,11 @@ static int arm_smmu_device_dt_probe(stru
bus_set_iommu(&pci_bus_type, &arm_smmu_ops);
}
#endif
@ -650,8 +630,6 @@ index 8f728144..3243a96d 100644
return 0;
}
diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
index 1520e7f0..3ade4153 100644
--- a/drivers/iommu/dma-iommu.c
+++ b/drivers/iommu/dma-iommu.c
@@ -37,15 +37,50 @@ struct iommu_dma_msi_page {
@ -709,11 +687,10 @@ index 1520e7f0..3ade4153 100644
}
int iommu_dma_init(void)
@@ -61,26 +96,54 @@ int iommu_dma_init(void)
* callback when domain->type == IOMMU_DOMAIN_DMA.
@@ -62,25 +97,53 @@ int iommu_dma_init(void)
*/
int iommu_get_dma_cookie(struct iommu_domain *domain)
+{
{
+ if (domain->iova_cookie)
+ return -EEXIST;
+
@ -738,7 +715,7 @@ index 1520e7f0..3ade4153 100644
+ * used by the devices attached to @domain.
+ */
+int iommu_get_msi_cookie(struct iommu_domain *domain, dma_addr_t base)
{
+{
struct iommu_dma_cookie *cookie;
+ if (domain->type != IOMMU_DOMAIN_UNMANAGED)
@ -769,7 +746,7 @@ index 1520e7f0..3ade4153 100644
*
* IOMMU drivers should normally call this from their domain_free callback.
*/
@@ -92,7 +155,7 @@ void iommu_put_dma_cookie(struct iommu_domain *domain)
@@ -92,7 +155,7 @@ void iommu_put_dma_cookie(struct iommu_d
if (!cookie)
return;
@ -778,7 +755,7 @@ index 1520e7f0..3ade4153 100644
put_iova_domain(&cookie->iovad);
list_for_each_entry_safe(msi, tmp, &cookie->msi_page_list, list) {
@@ -104,21 +167,99 @@ void iommu_put_dma_cookie(struct iommu_domain *domain)
@@ -104,21 +167,99 @@ void iommu_put_dma_cookie(struct iommu_d
}
EXPORT_SYMBOL(iommu_put_dma_cookie);
@ -884,7 +861,7 @@ index 1520e7f0..3ade4153 100644
}
/**
@@ -136,11 +277,12 @@ static void iova_reserve_pci_windows(struct pci_dev *dev,
@@ -136,11 +277,12 @@ static void iova_reserve_pci_windows(str
int iommu_dma_init_domain(struct iommu_domain *domain, dma_addr_t base,
u64 size, struct device *dev)
{
@ -900,7 +877,7 @@ index 1520e7f0..3ade4153 100644
/* Use the smallest supported page size for IOVA granularity */
order = __ffs(domain->pgsize_bitmap);
@@ -160,22 +302,37 @@ int iommu_dma_init_domain(struct iommu_domain *domain, dma_addr_t base,
@@ -160,22 +302,37 @@ int iommu_dma_init_domain(struct iommu_d
end_pfn = min_t(unsigned long, end_pfn,
domain->geometry.aperture_end >> order);
}
@ -947,7 +924,7 @@ index 1520e7f0..3ade4153 100644
}
EXPORT_SYMBOL(iommu_dma_init_domain);
@@ -643,11 +800,12 @@ static struct iommu_dma_msi_page *iommu_dma_get_msi_page(struct device *dev,
@@ -643,11 +800,12 @@ static struct iommu_dma_msi_page *iommu_
{
struct iommu_dma_cookie *cookie = domain->iova_cookie;
struct iommu_dma_msi_page *msi_page;
@ -962,7 +939,7 @@ index 1520e7f0..3ade4153 100644
list_for_each_entry(msi_page, &cookie->msi_page_list, list)
if (msi_page->phys == msi_addr)
return msi_page;
@@ -656,13 +814,18 @@ static struct iommu_dma_msi_page *iommu_dma_get_msi_page(struct device *dev,
@@ -656,13 +814,18 @@ static struct iommu_dma_msi_page *iommu_
if (!msi_page)
return NULL;
@ -987,7 +964,7 @@ index 1520e7f0..3ade4153 100644
goto out_free_iova;
INIT_LIST_HEAD(&msi_page->list);
@@ -670,7 +833,10 @@ static struct iommu_dma_msi_page *iommu_dma_get_msi_page(struct device *dev,
@@ -670,7 +833,10 @@ static struct iommu_dma_msi_page *iommu_
return msi_page;
out_free_iova:
@ -999,7 +976,7 @@ index 1520e7f0..3ade4153 100644
out_free_page:
kfree(msi_page);
return NULL;
@@ -711,7 +877,7 @@ void iommu_dma_map_msi_msg(int irq, struct msi_msg *msg)
@@ -711,7 +877,7 @@ void iommu_dma_map_msi_msg(int irq, stru
msg->data = ~0U;
} else {
msg->address_hi = upper_32_bits(msi_page->iova);
@ -1008,8 +985,6 @@ index 1520e7f0..3ade4153 100644
msg->address_lo += lower_32_bits(msi_page->iova);
}
}
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 002f8a42..befbfd30 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -440,6 +440,7 @@ struct dmar_rmrr_unit {
@ -1020,7 +995,7 @@ index 002f8a42..befbfd30 100644
};
struct dmar_atsr_unit {
@@ -4250,27 +4251,40 @@ static inline void init_iommu_pm_ops(void) {}
@@ -4250,27 +4251,40 @@ static inline void init_iommu_pm_ops(voi
int __init dmar_parse_one_rmrr(struct acpi_dmar_header *header, void *arg)
{
struct acpi_dmar_reserved_memory *rmrr;
@ -1074,7 +1049,7 @@ index 002f8a42..befbfd30 100644
kfree(rmrru);
}
@@ -5219,6 +5234,45 @@ static void intel_iommu_remove_device(struct device *dev)
@@ -5219,6 +5234,45 @@ static void intel_iommu_remove_device(st
iommu_device_unlink(iommu->iommu_dev, dev);
}
@ -1120,7 +1095,7 @@ index 002f8a42..befbfd30 100644
#ifdef CONFIG_INTEL_IOMMU_SVM
#define MAX_NR_PASID_BITS (20)
static inline unsigned long intel_iommu_get_pts(struct intel_iommu *iommu)
@@ -5349,19 +5403,21 @@ struct intel_iommu *intel_svm_device_to_iommu(struct device *dev)
@@ -5349,19 +5403,21 @@ struct intel_iommu *intel_svm_device_to_
#endif /* CONFIG_INTEL_IOMMU_SVM */
static const struct iommu_ops intel_iommu_ops = {
@ -1155,8 +1130,6 @@ index 002f8a42..befbfd30 100644
};
static void quirk_iommu_g4x_gfx(struct pci_dev *dev)
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 87d3060f..e6a8c225 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -36,6 +36,7 @@
@ -1181,7 +1154,7 @@ index 87d3060f..e6a8c225 100644
#define IOMMU_GROUP_ATTR(_name, _mode, _show, _store) \
struct iommu_group_attribute iommu_group_attr_##_name = \
__ATTR(_name, _mode, _show, _store)
@@ -86,6 +94,18 @@ static int __iommu_attach_group(struct iommu_domain *domain,
@@ -86,6 +94,18 @@ static int __iommu_attach_group(struct i
static void __iommu_detach_group(struct iommu_domain *domain,
struct iommu_group *group);
@ -1200,7 +1173,7 @@ index 87d3060f..e6a8c225 100644
static ssize_t iommu_group_attr_show(struct kobject *kobj,
struct attribute *__attr, char *buf)
{
@@ -133,8 +153,131 @@ static ssize_t iommu_group_show_name(struct iommu_group *group, char *buf)
@@ -133,8 +153,131 @@ static ssize_t iommu_group_show_name(str
return sprintf(buf, "%s\n", group->name);
}
@ -1332,7 +1305,7 @@ index 87d3060f..e6a8c225 100644
static void iommu_group_release(struct kobject *kobj)
{
struct iommu_group *group = to_iommu_group(kobj);
@@ -212,6 +355,11 @@ struct iommu_group *iommu_group_alloc(void)
@@ -212,6 +355,11 @@ struct iommu_group *iommu_group_alloc(vo
*/
kobject_put(&group->kobj);
@ -1344,7 +1317,7 @@ index 87d3060f..e6a8c225 100644
pr_debug("Allocated group %d\n", group->id);
return group;
@@ -318,7 +466,7 @@ static int iommu_group_create_direct_mappings(struct iommu_group *group,
@@ -318,7 +466,7 @@ static int iommu_group_create_direct_map
struct device *dev)
{
struct iommu_domain *domain = group->default_domain;
@ -1353,7 +1326,7 @@ index 87d3060f..e6a8c225 100644
struct list_head mappings;
unsigned long pg_size;
int ret = 0;
@@ -331,18 +479,21 @@ static int iommu_group_create_direct_mappings(struct iommu_group *group,
@@ -331,18 +479,21 @@ static int iommu_group_create_direct_map
pg_size = 1UL << __ffs(domain->pgsize_bitmap);
INIT_LIST_HEAD(&mappings);
@ -1378,7 +1351,7 @@ index 87d3060f..e6a8c225 100644
for (addr = start; addr < end; addr += pg_size) {
phys_addr_t phys_addr;
@@ -358,7 +509,7 @@ static int iommu_group_create_direct_mappings(struct iommu_group *group,
@@ -358,7 +509,7 @@ static int iommu_group_create_direct_map
}
out:
@ -1387,11 +1360,10 @@ index 87d3060f..e6a8c225 100644
return ret;
}
@@ -562,6 +713,19 @@ struct iommu_group *iommu_group_get(struct device *dev)
}
@@ -563,6 +714,19 @@ struct iommu_group *iommu_group_get(stru
EXPORT_SYMBOL_GPL(iommu_group_get);
+/**
/**
+ * iommu_group_ref_get - Increment reference on a group
+ * @group: the group to use, must not be NULL
+ *
@ -1404,10 +1376,11 @@ index 87d3060f..e6a8c225 100644
+ return group;
+}
+
/**
+/**
* iommu_group_put - Decrement group reference
* @group: the group to use
@@ -845,10 +1009,19 @@ struct iommu_group *iommu_group_get_for_dev(struct device *dev)
*
@@ -845,10 +1009,19 @@ struct iommu_group *iommu_group_get_for_
* IOMMU driver.
*/
if (!group->default_domain) {
@ -1430,7 +1403,7 @@ index 87d3060f..e6a8c225 100644
}
ret = iommu_group_add_device(group, dev);
@@ -1557,20 +1730,38 @@ int iommu_domain_set_attr(struct iommu_domain *domain,
@@ -1557,20 +1730,38 @@ int iommu_domain_set_attr(struct iommu_d
}
EXPORT_SYMBOL_GPL(iommu_domain_set_attr);
@ -1475,11 +1448,9 @@ index 87d3060f..e6a8c225 100644
}
/* Request that a device is direct mapped by the IOMMU */
diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c
index b12c12d7..9799daea 100644
--- a/drivers/iommu/mtk_iommu.c
+++ b/drivers/iommu/mtk_iommu.c
@@ -410,6 +410,8 @@ static struct iommu_group *mtk_iommu_device_group(struct device *dev)
@@ -410,6 +410,8 @@ static struct iommu_group *mtk_iommu_dev
data->m4u_group = iommu_group_alloc();
if (IS_ERR(data->m4u_group))
dev_err(dev, "Failed to allocate M4U IOMMU group\n");
@ -1488,11 +1459,9 @@ index b12c12d7..9799daea 100644
}
return data->m4u_group;
}
diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c
index b8aeb076..c7063e9d 100644
--- a/drivers/iommu/mtk_iommu_v1.c
+++ b/drivers/iommu/mtk_iommu_v1.c
@@ -502,6 +502,8 @@ static struct iommu_group *mtk_iommu_device_group(struct device *dev)
@@ -502,6 +502,8 @@ static struct iommu_group *mtk_iommu_dev
data->m4u_group = iommu_group_alloc();
if (IS_ERR(data->m4u_group))
dev_err(dev, "Failed to allocate M4U IOMMU group\n");
@ -1501,8 +1470,6 @@ index b8aeb076..c7063e9d 100644
}
return data->m4u_group;
}
diff --git a/include/linux/dma-iommu.h b/include/linux/dma-iommu.h
index 32c58906..36d3206d 100644
--- a/include/linux/dma-iommu.h
+++ b/include/linux/dma-iommu.h
@@ -27,6 +27,7 @@ int iommu_dma_init(void);
@ -1513,7 +1480,7 @@ index 32c58906..36d3206d 100644
void iommu_put_dma_cookie(struct iommu_domain *domain);
/* Setup call for arch DMA mapping code */
@@ -66,6 +67,7 @@ int iommu_dma_mapping_error(struct device *dev, dma_addr_t dma_addr);
@@ -66,6 +67,7 @@ int iommu_dma_mapping_error(struct devic
/* The DMA API isn't _quite_ the whole story, though... */
void iommu_dma_map_msi_msg(int irq, struct msi_msg *msg);
@ -1521,7 +1488,7 @@ index 32c58906..36d3206d 100644
#else
@@ -82,6 +84,11 @@ static inline int iommu_get_dma_cookie(struct iommu_domain *domain)
@@ -82,6 +84,11 @@ static inline int iommu_get_dma_cookie(s
return -ENODEV;
}
@ -1533,7 +1500,7 @@ index 32c58906..36d3206d 100644
static inline void iommu_put_dma_cookie(struct iommu_domain *domain)
{
}
@@ -90,6 +97,10 @@ static inline void iommu_dma_map_msi_msg(int irq, struct msi_msg *msg)
@@ -90,6 +97,10 @@ static inline void iommu_dma_map_msi_msg
{
}
@ -1544,8 +1511,6 @@ index 32c58906..36d3206d 100644
#endif /* CONFIG_IOMMU_DMA */
#endif /* __KERNEL__ */
#endif /* __DMA_IOMMU_H */
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 436dc213..188599f5 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -117,18 +117,32 @@ enum iommu_attr {
@ -1614,7 +1579,7 @@ index 436dc213..188599f5 100644
/* Window handling functions */
int (*domain_window_enable)(struct iommu_domain *domain, u32 wnd_nr,
@@ -233,9 +248,14 @@ extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_addr_t io
@@ -233,9 +248,14 @@ extern phys_addr_t iommu_iova_to_phys(st
extern void iommu_set_fault_handler(struct iommu_domain *domain,
iommu_fault_handler_t handler, void *token);
@ -1631,7 +1596,7 @@ index 436dc213..188599f5 100644
extern int iommu_attach_group(struct iommu_domain *domain,
struct iommu_group *group);
@@ -253,6 +273,7 @@ extern void iommu_group_remove_device(struct device *dev);
@@ -253,6 +273,7 @@ extern void iommu_group_remove_device(st
extern int iommu_group_for_each_dev(struct iommu_group *group, void *data,
int (*fn)(struct device *, void *));
extern struct iommu_group *iommu_group_get(struct device *dev);
@ -1639,7 +1604,7 @@ index 436dc213..188599f5 100644
extern void iommu_group_put(struct iommu_group *group);
extern int iommu_group_register_notifier(struct iommu_group *group,
struct notifier_block *nb);
@@ -439,16 +460,22 @@ static inline void iommu_set_fault_handler(struct iommu_domain *domain,
@@ -439,16 +460,22 @@ static inline void iommu_set_fault_handl
{
}
@ -1664,6 +1629,3 @@ index 436dc213..188599f5 100644
static inline int iommu_request_dm_for_dev(struct device *dev)
{
return -ENODEV;
--
2.14.1

@ -35,11 +35,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
include/linux/usb/of.h | 2 +
18 files changed, 730 insertions(+), 73 deletions(-)
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index afb953a2..c9c86495 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -1812,6 +1812,10 @@ static int rx_bottom(struct r8152 *tp, int budget)
@@ -1812,6 +1812,10 @@ static int rx_bottom(struct r8152 *tp, i
unsigned int pkt_len;
struct sk_buff *skb;
@ -50,11 +48,9 @@ index afb953a2..c9c86495 100644
pkt_len = le32_to_cpu(rx_desc->opts1) & RX_LEN_MASK;
if (pkt_len < ETH_ZLEN)
break;
diff --git a/drivers/usb/common/common.c b/drivers/usb/common/common.c
index 5ef8da6e..176dee01 100644
--- a/drivers/usb/common/common.c
+++ b/drivers/usb/common/common.c
@@ -105,6 +105,56 @@ static const char *const usb_dr_modes[] = {
@@ -105,6 +105,56 @@ static const char *const usb_dr_modes[]
[USB_DR_MODE_OTG] = "otg",
};
@ -111,11 +107,9 @@ index 5ef8da6e..176dee01 100644
static enum usb_dr_mode usb_get_dr_mode_from_string(const char *str)
{
int ret;
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 80d4ef31..e23acf03 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -4412,6 +4412,14 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
@@ -4415,6 +4415,14 @@ hub_port_init(struct usb_hub *hub, struc
else
speed = usb_speed_string(udev->speed);
@ -130,11 +124,9 @@ index 80d4ef31..e23acf03 100644
if (udev->speed < USB_SPEED_SUPER)
dev_info(&udev->dev,
"%s %s USB device number %d using %s\n",
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index fea44690..e34ef90a 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -58,6 +58,7 @@ static int dwc3_get_dr_mode(struct dwc3 *dwc)
@@ -58,6 +58,7 @@ static int dwc3_get_dr_mode(struct dwc3
enum usb_dr_mode mode;
struct device *dev = dwc->dev;
unsigned int hw_mode;
@ -142,7 +134,7 @@ index fea44690..e34ef90a 100644
if (dwc->dr_mode == USB_DR_MODE_UNKNOWN)
dwc->dr_mode = USB_DR_MODE_OTG;
@@ -83,6 +84,24 @@ static int dwc3_get_dr_mode(struct dwc3 *dwc)
@@ -83,6 +84,24 @@ static int dwc3_get_dr_mode(struct dwc3
mode = USB_DR_MODE_HOST;
break;
default:
@ -167,7 +159,7 @@ index fea44690..e34ef90a 100644
if (IS_ENABLED(CONFIG_USB_DWC3_HOST))
mode = USB_DR_MODE_HOST;
else if (IS_ENABLED(CONFIG_USB_DWC3_GADGET))
@@ -213,8 +232,9 @@ static void dwc3_frame_length_adjustment(struct dwc3 *dwc)
@@ -213,8 +232,9 @@ static void dwc3_frame_length_adjustment
reg = dwc3_readl(dwc->regs, DWC3_GFLADJ);
dft = reg & DWC3_GFLADJ_30MHZ_MASK;
@ -179,7 +171,7 @@ index fea44690..e34ef90a 100644
reg &= ~DWC3_GFLADJ_30MHZ_MASK;
reg |= DWC3_GFLADJ_30MHZ_SDBND_SEL | dwc->fladj;
dwc3_writel(dwc->regs, DWC3_GFLADJ, reg);
@@ -579,6 +599,99 @@ static int dwc3_phy_setup(struct dwc3 *dwc)
@@ -579,6 +599,99 @@ static int dwc3_phy_setup(struct dwc3 *d
return 0;
}
@ -279,7 +271,7 @@ index fea44690..e34ef90a 100644
static void dwc3_core_exit(struct dwc3 *dwc)
{
dwc3_event_buffers_cleanup(dwc);
@@ -721,6 +834,8 @@ static int dwc3_core_init(struct dwc3 *dwc)
@@ -721,6 +834,8 @@ static int dwc3_core_init(struct dwc3 *d
if (ret)
goto err1;
@ -288,7 +280,7 @@ index fea44690..e34ef90a 100644
/* Adjust Frame Length */
dwc3_frame_length_adjustment(dwc);
@@ -919,11 +1034,109 @@ static void dwc3_core_exit_mode(struct dwc3 *dwc)
@@ -919,11 +1034,109 @@ static void dwc3_core_exit_mode(struct d
}
}
@ -398,7 +390,7 @@ index fea44690..e34ef90a 100644
struct resource *res;
struct dwc3 *dwc;
u8 lpm_nyet_threshold;
@@ -955,6 +1168,11 @@ static int dwc3_probe(struct platform_device *pdev)
@@ -955,6 +1168,11 @@ static int dwc3_probe(struct platform_de
dwc->xhci_resources[0].flags = res->flags;
dwc->xhci_resources[0].name = res->name;
@ -410,7 +402,7 @@ index fea44690..e34ef90a 100644
res->start += DWC3_GLOBALS_REGS_START;
/*
@@ -997,6 +1215,12 @@ static int dwc3_probe(struct platform_device *pdev)
@@ -997,6 +1215,12 @@ static int dwc3_probe(struct platform_de
dwc->usb3_lpm_capable = device_property_read_bool(dev,
"snps,usb3_lpm_capable");
@ -423,7 +415,7 @@ index fea44690..e34ef90a 100644
dwc->disable_scramble_quirk = device_property_read_bool(dev,
"snps,disable_scramble_quirk");
dwc->u2exit_lfps_quirk = device_property_read_bool(dev,
@@ -1041,6 +1265,8 @@ static int dwc3_probe(struct platform_device *pdev)
@@ -1041,6 +1265,8 @@ static int dwc3_probe(struct platform_de
dwc->hird_threshold = hird_threshold
| (dwc->is_utmi_l1_suspend << 4);
@ -432,7 +424,7 @@ index fea44690..e34ef90a 100644
platform_set_drvdata(pdev, dwc);
dwc3_cache_hwparams(dwc);
@@ -1064,6 +1290,11 @@ static int dwc3_probe(struct platform_device *pdev)
@@ -1064,6 +1290,11 @@ static int dwc3_probe(struct platform_de
if (ret < 0)
goto err1;
@ -444,8 +436,6 @@ index fea44690..e34ef90a 100644
pm_runtime_forbid(dev);
ret = dwc3_alloc_event_buffers(dwc, DWC3_EVENT_BUFFERS_SIZE);
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index 884c4371..9151eef4 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -26,6 +26,7 @@
@ -563,8 +553,6 @@ index 884c4371..9151eef4 100644
};
/* -------------------------------------------------------------------------- */
diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index 626d87d5..f1b98273 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -17,6 +17,8 @@
@ -600,8 +588,6 @@ index 626d87d5..f1b98273 100644
dwc->xhci = xhci;
ret = platform_device_add_resources(xhci, dwc->xhci_resources,
diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c b/drivers/usb/gadget/udc/fsl_udc_core.c
index aac0ce8a..fe49e758 100644
--- a/drivers/usb/gadget/udc/fsl_udc_core.c
+++ b/drivers/usb/gadget/udc/fsl_udc_core.c
@@ -198,7 +198,11 @@ __acquires(ep->udc->lock)
@ -617,7 +603,7 @@ index aac0ce8a..fe49e758 100644
spin_lock(&ep->udc->lock);
ep->stopped = stopped;
@@ -245,10 +249,10 @@ static int dr_controller_setup(struct fsl_udc *udc)
@@ -245,10 +249,10 @@ static int dr_controller_setup(struct fs
if (udc->pdata->have_sysif_regs) {
if (udc->pdata->controller_ver) {
/* controller version 1.6 or above */
@ -630,7 +616,7 @@ index aac0ce8a..fe49e758 100644
}
}
portctrl |= PORTSCX_PTS_ULPI;
@@ -257,13 +261,14 @@ static int dr_controller_setup(struct fsl_udc *udc)
@@ -257,13 +261,14 @@ static int dr_controller_setup(struct fs
portctrl |= PORTSCX_PTW_16BIT;
/* fall through */
case FSL_USB2_PHY_UTMI:
@ -647,7 +633,7 @@ index aac0ce8a..fe49e758 100644
mdelay(FSL_UTMI_PHY_DLY); /* Delay for UTMI
PHY CLK to become stable - 10ms*/
}
@@ -329,22 +334,22 @@ static int dr_controller_setup(struct fsl_udc *udc)
@@ -329,22 +334,22 @@ static int dr_controller_setup(struct fs
/* Config control enable i/o output, cpu endian register */
#ifndef CONFIG_ARCH_MXC
if (udc->pdata->have_sysif_regs) {
@ -675,7 +661,7 @@ index aac0ce8a..fe49e758 100644
}
#endif
@@ -1057,7 +1062,7 @@ static int fsl_ep_fifo_status(struct usb_ep *_ep)
@@ -1057,7 +1062,7 @@ static int fsl_ep_fifo_status(struct usb
struct ep_queue_head *qh;
ep = container_of(_ep, struct fsl_ep, ep);
@ -684,7 +670,7 @@ index aac0ce8a..fe49e758 100644
return -ENODEV;
udc = (struct fsl_udc *)ep->udc;
@@ -1599,14 +1604,13 @@ static int process_ep_req(struct fsl_udc *udc, int pipe,
@@ -1599,14 +1604,13 @@ static int process_ep_req(struct fsl_udc
struct fsl_req *curr_req)
{
struct ep_td_struct *curr_td;
@ -700,7 +686,7 @@ index aac0ce8a..fe49e758 100644
actual = curr_req->req.length;
for (j = 0; j < curr_req->dtd_count; j++) {
@@ -1651,11 +1655,9 @@ static int process_ep_req(struct fsl_udc *udc, int pipe,
@@ -1651,11 +1655,9 @@ static int process_ep_req(struct fsl_udc
status = -EPROTO;
break;
} else {
@ -712,7 +698,7 @@ index aac0ce8a..fe49e758 100644
VDBG("dTD transmitted successful");
}
@@ -1698,7 +1700,7 @@ static void dtd_complete_irq(struct fsl_udc *udc)
@@ -1698,7 +1700,7 @@ static void dtd_complete_irq(struct fsl_
curr_ep = get_ep_by_pipe(udc, i);
/* If the ep is configured */
@ -721,7 +707,7 @@ index aac0ce8a..fe49e758 100644
WARNING("Invalid EP?");
continue;
}
@@ -2420,10 +2422,12 @@ static int fsl_udc_probe(struct platform_device *pdev)
@@ -2420,10 +2422,12 @@ static int fsl_udc_probe(struct platform
usb_sys_regs = (void *)dr_regs + USB_DR_SYS_OFFSET;
#endif
@ -734,7 +720,7 @@ index aac0ce8a..fe49e758 100644
/* Read Device Controller Capability Parameters register */
dccparams = fsl_readl(&dr_regs->dccparams);
@@ -2463,9 +2467,11 @@ static int fsl_udc_probe(struct platform_device *pdev)
@@ -2463,9 +2467,11 @@ static int fsl_udc_probe(struct platform
dr_controller_setup(udc_controller);
}
@ -746,7 +732,7 @@ index aac0ce8a..fe49e758 100644
/* Setup gadget structure */
udc_controller->gadget.ops = &fsl_gadget_ops;
@@ -2478,6 +2484,7 @@ static int fsl_udc_probe(struct platform_device *pdev)
@@ -2478,6 +2484,7 @@ static int fsl_udc_probe(struct platform
/* Setup gadget.dev and register with kernel */
dev_set_name(&udc_controller->gadget.dev, "gadget");
udc_controller->gadget.dev.of_node = pdev->dev.of_node;
@ -754,7 +740,7 @@ index aac0ce8a..fe49e758 100644
if (!IS_ERR_OR_NULL(udc_controller->transceiver))
udc_controller->gadget.is_otg = 1;
@@ -2529,7 +2536,9 @@ static int fsl_udc_probe(struct platform_device *pdev)
@@ -2529,7 +2536,9 @@ err_free_irq:
err_iounmap:
if (pdata->exit)
pdata->exit(pdev);
@ -764,7 +750,7 @@ index aac0ce8a..fe49e758 100644
err_iounmap_noclk:
iounmap(dr_regs);
err_release_mem_region:
@@ -2557,8 +2566,9 @@ static int fsl_udc_remove(struct platform_device *pdev)
@@ -2557,8 +2566,9 @@ static int fsl_udc_remove(struct platfor
udc_controller->done = &done;
usb_del_gadget_udc(&udc_controller->gadget);
@ -775,7 +761,7 @@ index aac0ce8a..fe49e758 100644
/* DR has been stopped in usb_gadget_unregister_driver() */
remove_proc_file();
@@ -2570,7 +2580,7 @@ static int fsl_udc_remove(struct platform_device *pdev)
@@ -2570,7 +2580,7 @@ static int fsl_udc_remove(struct platfor
dma_pool_destroy(udc_controller->td_pool);
free_irq(udc_controller->irq, udc_controller);
iounmap(dr_regs);
@ -784,8 +770,6 @@ index aac0ce8a..fe49e758 100644
release_mem_region(res->start, resource_size(res));
/* free udc --wait for the release() finished */
diff --git a/drivers/usb/gadget/udc/fsl_usb2_udc.h b/drivers/usb/gadget/udc/fsl_usb2_udc.h
index 84715625..f76c4ddd 100644
--- a/drivers/usb/gadget/udc/fsl_usb2_udc.h
+++ b/drivers/usb/gadget/udc/fsl_usb2_udc.h
@@ -20,6 +20,10 @@
@ -818,8 +802,6 @@ index 84715625..f76c4ddd 100644
#endif
#endif
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 0b80cee3..a57d95c3 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -165,7 +165,7 @@ config XPS_USB_HCD_XILINX
@ -831,8 +813,6 @@ index 0b80cee3..a57d95c3 100644
select USB_EHCI_ROOT_HUB_TT
---help---
Variation of ARC USB block used in some Freescale chips.
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index 9f5ffb62..cd16860c 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -37,13 +37,141 @@
@ -977,7 +957,7 @@ index 9f5ffb62..cd16860c 100644
/* configure so an HC device and id are always provided */
/* always called with process context; sleeping is OK */
@@ -131,6 +259,12 @@ static int fsl_ehci_drv_probe(struct platform_device *pdev)
@@ -131,6 +259,12 @@ static int fsl_ehci_drv_probe(struct pla
clrsetbits_be32(hcd->regs + FSL_SOC_USB_CTRL,
CONTROL_REGISTER_W1C_MASK, 0x4);
@ -990,7 +970,7 @@ index 9f5ffb62..cd16860c 100644
/*
* Enable UTMI phy and program PTS field in UTMI mode before asserting
* controller reset for USB Controller version 2.5
@@ -143,16 +277,20 @@ static int fsl_ehci_drv_probe(struct platform_device *pdev)
@@ -143,16 +277,20 @@ static int fsl_ehci_drv_probe(struct pla
/* Don't need to set host mode here. It will be done by tdi_reset() */
@ -1013,7 +993,7 @@ index 9f5ffb62..cd16860c 100644
dev_dbg(&pdev->dev, "hcd=0x%p ehci=0x%p, phy=0x%p\n",
hcd, ehci, hcd->usb_phy);
@@ -168,6 +306,11 @@ static int fsl_ehci_drv_probe(struct platform_device *pdev)
@@ -168,6 +306,11 @@ static int fsl_ehci_drv_probe(struct pla
retval = -ENODEV;
goto err2;
}
@ -1025,7 +1005,7 @@ index 9f5ffb62..cd16860c 100644
}
#endif
return retval;
@@ -181,6 +324,18 @@ static int fsl_ehci_drv_probe(struct platform_device *pdev)
@@ -181,6 +324,18 @@ static int fsl_ehci_drv_probe(struct pla
return retval;
}
@ -1044,7 +1024,7 @@ index 9f5ffb62..cd16860c 100644
static int ehci_fsl_setup_phy(struct usb_hcd *hcd,
enum fsl_usb2_phy_modes phy_mode,
unsigned int port_offset)
@@ -219,6 +374,21 @@ static int ehci_fsl_setup_phy(struct usb_hcd *hcd,
@@ -219,6 +374,21 @@ static int ehci_fsl_setup_phy(struct usb
/* fall through */
case FSL_USB2_PHY_UTMI:
case FSL_USB2_PHY_UTMI_DUAL:
@ -1066,7 +1046,7 @@ index 9f5ffb62..cd16860c 100644
if (pdata->have_sysif_regs && pdata->controller_ver) {
/* controller version 1.6 or above */
clrsetbits_be32(non_ehci + FSL_SOC_USB_CTRL,
@@ -292,14 +462,9 @@ static int ehci_fsl_usb_setup(struct ehci_hcd *ehci)
@@ -292,14 +462,9 @@ static int ehci_fsl_usb_setup(struct ehc
return -EINVAL;
if (pdata->operating_mode == FSL_USB2_MPH_HOST) {
@ -1082,7 +1062,7 @@ index 9f5ffb62..cd16860c 100644
ehci->has_fsl_port_bug = 1;
if (pdata->port_enables & FSL_USB2_PORT0_ENABLED)
@@ -379,16 +544,57 @@ static int ehci_fsl_setup(struct usb_hcd *hcd)
@@ -379,16 +544,57 @@ static int ehci_fsl_setup(struct usb_hcd
return retval;
}
@ -1147,7 +1127,7 @@ index 9f5ffb62..cd16860c 100644
#ifdef CONFIG_PPC_MPC512x
static int ehci_fsl_mpc512x_drv_suspend(struct device *dev)
@@ -535,26 +741,43 @@ static inline int ehci_fsl_mpc512x_drv_resume(struct device *dev)
@@ -535,26 +741,43 @@ static inline int ehci_fsl_mpc512x_drv_r
}
#endif /* CONFIG_PPC_MPC512x */
@ -1198,7 +1178,7 @@ index 9f5ffb62..cd16860c 100644
if (!fsl_deep_sleep())
return 0;
@@ -568,12 +791,34 @@ static int ehci_fsl_drv_resume(struct device *dev)
@@ -568,12 +791,34 @@ static int ehci_fsl_drv_resume(struct de
struct ehci_fsl *ehci_fsl = hcd_to_ehci_fsl(hcd);
struct ehci_hcd *ehci = hcd_to_ehci(hcd);
void __iomem *non_ehci = hcd->regs;
@ -1233,8 +1213,6 @@ index 9f5ffb62..cd16860c 100644
ehci_prepare_ports_for_controller_resume(ehci);
if (!fsl_deep_sleep())
return 0;
diff --git a/drivers/usb/host/ehci-fsl.h b/drivers/usb/host/ehci-fsl.h
index 1a8a60a5..42ea2976 100644
--- a/drivers/usb/host/ehci-fsl.h
+++ b/drivers/usb/host/ehci-fsl.h
@@ -63,4 +63,7 @@
@ -1245,11 +1223,9 @@ index 1a8a60a5..42ea2976 100644
+/* Retry count for checking UTMI PHY CLK validity */
+#define UTMI_PHY_CLK_VALID_CHK_RETRY 5
#endif /* _EHCI_FSL_H */
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index 255acca8..c8838c33 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -305,6 +305,8 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
@@ -305,6 +305,8 @@ static int ehci_bus_suspend (struct usb_
USB_PORT_STAT_HIGH_SPEED)
fs_idle_delay = true;
ehci_writel(ehci, t2, reg);
@ -1258,11 +1234,9 @@ index 255acca8..c8838c33 100644
changed = 1;
}
}
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 3b06bb77..f296d1fb 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -180,6 +180,9 @@ struct ehci_hcd { /* one per controller */
@@ -180,6 +180,9 @@ struct ehci_hcd { /* one per controlle
unsigned periodic_count; /* periodic activity count */
unsigned uframe_periodic_max; /* max periodic time per uframe */
@ -1272,7 +1246,7 @@ index 3b06bb77..f296d1fb 100644
/* list of itds & sitds completed while now_frame was still active */
struct list_head cached_itd_list;
@@ -706,8 +709,10 @@ ehci_port_speed(struct ehci_hcd *ehci, unsigned int portsc)
@@ -706,8 +709,10 @@ ehci_port_speed(struct ehci_hcd *ehci, u
* incoming packets get corrupted in HS mode
*/
#define ehci_has_fsl_hs_errata(e) ((e)->has_fsl_hs_errata)
@ -1283,11 +1257,9 @@ index 3b06bb77..f296d1fb 100644
#endif
/*
diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-of.c
index f07ccb25..1e59ea9f 100644
--- a/drivers/usb/host/fsl-mph-dr-of.c
+++ b/drivers/usb/host/fsl-mph-dr-of.c
@@ -226,6 +226,18 @@ static int fsl_usb2_mph_dr_of_probe(struct platform_device *ofdev)
@@ -226,6 +226,18 @@ static int fsl_usb2_mph_dr_of_probe(stru
of_property_read_bool(np, "fsl,usb-erratum-a007792");
pdata->has_fsl_erratum_a005275 =
of_property_read_bool(np, "fsl,usb-erratum-a005275");
@ -1306,8 +1278,6 @@ index f07ccb25..1e59ea9f 100644
/*
* Determine whether phy_clk_valid needs to be checked
diff --git a/drivers/usb/phy/phy-fsl-usb.c b/drivers/usb/phy/phy-fsl-usb.c
index 94eb2923..836355fa 100644
--- a/drivers/usb/phy/phy-fsl-usb.c
+++ b/drivers/usb/phy/phy-fsl-usb.c
@@ -1,5 +1,5 @@
@ -1325,7 +1295,7 @@ index 94eb2923..836355fa 100644
struct device *dev;
struct fsl_otg *otg_dev =
container_of(otg->usb_phy, struct fsl_otg, phy);
@@ -486,6 +487,7 @@ int fsl_otg_start_host(struct otg_fsm *fsm, int on)
@@ -486,6 +487,7 @@ int fsl_otg_start_host(struct otg_fsm *f
otg_reset_controller();
VDBG("host on......\n");
if (dev->driver->pm && dev->driver->pm->resume) {
@ -1333,7 +1303,7 @@ index 94eb2923..836355fa 100644
retval = dev->driver->pm->resume(dev);
if (fsm->id) {
/* default-b */
@@ -510,8 +512,11 @@ int fsl_otg_start_host(struct otg_fsm *fsm, int on)
@@ -510,8 +512,11 @@ int fsl_otg_start_host(struct otg_fsm *f
else {
VDBG("host off......\n");
if (dev && dev->driver) {
@ -1346,7 +1316,7 @@ index 94eb2923..836355fa 100644
if (fsm->id)
/* default-b */
fsl_otg_drv_vbus(fsm, 0);
@@ -539,8 +544,17 @@ int fsl_otg_start_gadget(struct otg_fsm *fsm, int on)
@@ -539,8 +544,17 @@ int fsl_otg_start_gadget(struct otg_fsm
dev = otg->gadget->dev.parent;
if (on) {
@ -1365,7 +1335,7 @@ index 94eb2923..836355fa 100644
} else {
if (dev->driver->suspend)
dev->driver->suspend(dev, otg_suspend_state);
@@ -672,6 +686,10 @@ static void fsl_otg_event(struct work_struct *work)
@@ -672,6 +686,10 @@ static void fsl_otg_event(struct work_st
fsl_otg_start_host(fsm, 0);
otg_drv_vbus(fsm, 0);
fsl_otg_start_gadget(fsm, 1);
@ -1376,7 +1346,7 @@ index 94eb2923..836355fa 100644
}
}
@@ -724,6 +742,7 @@ irqreturn_t fsl_otg_isr(int irq, void *dev_id)
@@ -724,6 +742,7 @@ irqreturn_t fsl_otg_isr(int irq, void *d
{
struct otg_fsm *fsm = &((struct fsl_otg *)dev_id)->fsm;
struct usb_otg *otg = ((struct fsl_otg *)dev_id)->phy.otg;
@ -1384,7 +1354,7 @@ index 94eb2923..836355fa 100644
u32 otg_int_src, otg_sc;
otg_sc = fsl_readl(&usb_dr_regs->otgsc);
@@ -753,18 +772,8 @@ irqreturn_t fsl_otg_isr(int irq, void *dev_id)
@@ -753,18 +772,8 @@ irqreturn_t fsl_otg_isr(int irq, void *d
otg->gadget->is_a_peripheral = !fsm->id;
VDBG("ID int (ID is %d)\n", fsm->id);
@ -1405,7 +1375,7 @@ index 94eb2923..836355fa 100644
return IRQ_HANDLED;
}
}
@@ -923,12 +932,32 @@ int usb_otg_start(struct platform_device *pdev)
@@ -923,12 +932,32 @@ int usb_otg_start(struct platform_device
temp &= ~(PORTSC_PHY_TYPE_SEL | PORTSC_PTW);
switch (pdata->phy_mode) {
case FSL_USB2_PHY_ULPI:
@ -1438,8 +1408,6 @@ index 94eb2923..836355fa 100644
temp |= PORTSC_PTS_UTMI;
/* fall through */
default:
diff --git a/drivers/usb/phy/phy-fsl-usb.h b/drivers/usb/phy/phy-fsl-usb.h
index 23149954..c4c08730 100644
--- a/drivers/usb/phy/phy-fsl-usb.h
+++ b/drivers/usb/phy/phy-fsl-usb.h
@@ -199,6 +199,14 @@
@ -1457,8 +1425,6 @@ index 23149954..c4c08730 100644
/* BCSR5 */
#define BCSR5_INT_USB (0x02)
diff --git a/include/linux/usb.h b/include/linux/usb.h
index eba1f10e..c334e281 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -362,6 +362,7 @@ struct usb_bus {
@ -1469,8 +1435,6 @@ index eba1f10e..c334e281 100644
unsigned is_b_host:1; /* true during some HNP roleswitches */
unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */
unsigned no_stop_on_short:1; /*
diff --git a/include/linux/usb/of.h b/include/linux/usb/of.h
index 5ff9032e..2a57e0d2 100644
--- a/include/linux/usb/of.h
+++ b/include/linux/usb/of.h
@@ -11,6 +11,8 @@
@ -1482,6 +1446,3 @@ index 5ff9032e..2a57e0d2 100644
#if IS_ENABLED(CONFIG_OF)
enum usb_dr_mode of_usb_get_dr_mode_by_phy(struct device_node *np, int arg0);
bool of_usb_host_tpl_support(struct device_node *np);
--
2.14.1

@ -34,7 +34,7 @@ Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--- a/net/dsa/Kconfig
+++ b/net/dsa/Kconfig
@@ -41,4 +41,6 @@ config NET_DSA_TAG_TRAILER
@@ -42,4 +42,6 @@ config NET_DSA_TAG_TRAILER
config NET_DSA_TAG_QCA
bool

@ -1,6 +1,6 @@
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -1719,8 +1719,10 @@ static struct mvneta_tx_queue *mvneta_tx
@@ -1720,8 +1720,10 @@ static struct mvneta_tx_queue *mvneta_tx
/* Free tx queue skbuffs */
static void mvneta_txq_bufs_free(struct mvneta_port *pp,
@ -12,7 +12,7 @@
int i;
for (i = 0; i < num; i++) {
@@ -1728,6 +1730,11 @@ static void mvneta_txq_bufs_free(struct
@@ -1729,6 +1731,11 @@ static void mvneta_txq_bufs_free(struct
txq->txq_get_index;
struct sk_buff *skb = txq->tx_skb[txq->txq_get_index];
@ -24,7 +24,7 @@
mvneta_txq_inc_get(txq);
if (!IS_TSO_HEADER(txq, tx_desc->buf_phys_addr))
@@ -1738,6 +1745,8 @@ static void mvneta_txq_bufs_free(struct
@@ -1739,6 +1746,8 @@ static void mvneta_txq_bufs_free(struct
continue;
dev_kfree_skb_any(skb);
}
@ -33,7 +33,7 @@
}
/* Handle end of transmission */
@@ -1751,7 +1760,7 @@ static void mvneta_txq_done(struct mvnet
@@ -1752,7 +1761,7 @@ static void mvneta_txq_done(struct mvnet
if (!tx_done)
return;
@ -42,7 +42,7 @@
txq->count -= tx_done;
@@ -2358,6 +2367,8 @@ out:
@@ -2359,6 +2368,8 @@ out:
struct mvneta_pcpu_stats *stats = this_cpu_ptr(pp->stats);
struct netdev_queue *nq = netdev_get_tx_queue(dev, txq_id);
@ -51,7 +51,7 @@
txq->count += frags;
mvneta_txq_pend_desc_add(pp, txq, frags);
@@ -2382,9 +2393,10 @@ static void mvneta_txq_done_force(struct
@@ -2383,9 +2394,10 @@ static void mvneta_txq_done_force(struct
struct mvneta_tx_queue *txq)
{
@ -63,7 +63,7 @@
/* reset txq */
txq->count = 0;
@@ -2880,6 +2892,8 @@ static int mvneta_txq_init(struct mvneta
@@ -2881,6 +2893,8 @@ static int mvneta_txq_init(struct mvneta
static void mvneta_txq_deinit(struct mvneta_port *pp,
struct mvneta_tx_queue *txq)
{
@ -72,7 +72,7 @@
kfree(txq->tx_skb);
if (txq->tso_hdrs)
@@ -2891,6 +2905,8 @@ static void mvneta_txq_deinit(struct mvn
@@ -2892,6 +2906,8 @@ static void mvneta_txq_deinit(struct mvn
txq->size * MVNETA_DESC_ALIGNED_SIZE,
txq->descs, txq->descs_phys);

@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -3833,6 +3833,16 @@ static int mvneta_ethtool_get_rxfh(struc
@@ -3834,6 +3834,16 @@ static int mvneta_ethtool_get_rxfh(struc
return 0;
}
@ -26,7 +26,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static const struct net_device_ops mvneta_netdev_ops = {
.ndo_open = mvneta_open,
.ndo_stop = mvneta_stop,
@@ -3843,6 +3853,7 @@ static const struct net_device_ops mvnet
@@ -3844,6 +3854,7 @@ static const struct net_device_ops mvnet
.ndo_fix_features = mvneta_fix_features,
.ndo_get_stats64 = mvneta_get_stats64,
.ndo_do_ioctl = mvneta_ioctl,

@ -167,7 +167,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -429,6 +429,7 @@ struct phy_device {
@@ -425,6 +425,7 @@ struct phy_device {
u8 mdix;

@ -256,7 +256,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
+EXPORT_SYMBOL(phy_write_mmd);
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -630,14 +630,7 @@ struct phy_fixup {
@@ -626,14 +626,7 @@ struct phy_fixup {
*
* Same rules as for phy_read();
*/
@ -272,7 +272,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
/**
* phy_read_mmd_indirect - reads data from the MMD registers
@@ -731,16 +724,7 @@ static inline bool phy_is_pseudo_fixed_l
@@ -727,16 +720,7 @@ static inline bool phy_is_pseudo_fixed_l
*
* Same rules as for phy_write();
*/

@ -64,7 +64,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
EXPORT_SYMBOL(phy_write_mmd);
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -573,6 +573,30 @@ struct phy_driver {
@@ -569,6 +569,30 @@ struct phy_driver {
*/
void (*link_change_notify)(struct phy_device *dev);

@ -295,7 +295,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
}
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -810,6 +810,8 @@ static inline const char *phydev_name(co
@@ -806,6 +806,8 @@ static inline const char *phydev_name(co
void phy_attached_print(struct phy_device *phydev, const char *fmt, ...)
__printf(2, 3);
void phy_attached_info(struct phy_device *phydev);
@ -304,7 +304,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
int genphy_config_init(struct phy_device *phydev);
int genphy_setup_forced(struct phy_device *phydev);
int genphy_restart_aneg(struct phy_device *phydev);
@@ -824,6 +826,16 @@ static inline int genphy_no_soft_reset(s
@@ -820,6 +822,16 @@ static inline int genphy_no_soft_reset(s
{
return 0;
}

@ -91,7 +91,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
{
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -645,6 +645,9 @@ struct phy_fixup {
@@ -641,6 +641,9 @@ struct phy_fixup {
int (*run)(struct phy_device *phydev);
};

@ -305,7 +305,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
{
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -648,6 +648,21 @@ struct phy_fixup {
@@ -644,6 +644,21 @@ struct phy_fixup {
const char *phy_speed_to_str(int speed);
const char *phy_duplex_to_str(unsigned int duplex);

@ -999,7 +999,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
+MODULE_LICENSE("GPL");
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -153,6 +153,7 @@ static inline const char *phy_modes(phy_
@@ -149,6 +149,7 @@ static inline const char *phy_modes(phy_
#define MII_ADDR_C45 (1<<30)
struct device;
@ -1007,7 +1007,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
struct sk_buff;
/*
@@ -425,6 +426,7 @@ struct phy_device {
@@ -421,6 +422,7 @@ struct phy_device {
struct mutex lock;

@ -21,15 +21,15 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Marvell ARMADA XP, ARMADA 370 and ARMADA 38x SoC family.
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -28,6 +28,7 @@
#include <linux/of_mdio.h>
@@ -29,6 +29,7 @@
#include <linux/of_net.h>
#include <linux/phy.h>
#include <linux/phy_fixed.h>
+#include <linux/phylink.h>
#include <linux/platform_device.h>
#include <linux/skbuff.h>
#include <net/hwbm.h>
@@ -188,6 +189,7 @@
@@ -189,6 +190,7 @@
#define MVNETA_GMAC_CTRL_0 0x2c00
#define MVNETA_GMAC_MAX_RX_SIZE_SHIFT 2
#define MVNETA_GMAC_MAX_RX_SIZE_MASK 0x7ffc
@ -37,7 +37,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
#define MVNETA_GMAC0_PORT_ENABLE BIT(0)
#define MVNETA_GMAC_CTRL_2 0x2c08
#define MVNETA_GMAC2_INBAND_AN_ENABLE BIT(0)
@@ -203,13 +205,19 @@
@@ -204,13 +206,19 @@
#define MVNETA_GMAC_TX_FLOW_CTRL_ENABLE BIT(5)
#define MVNETA_GMAC_RX_FLOW_CTRL_ACTIVE BIT(6)
#define MVNETA_GMAC_TX_FLOW_CTRL_ACTIVE BIT(7)
@ -57,7 +57,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
#define MVNETA_GMAC_AN_FLOW_CTRL_EN BIT(11)
#define MVNETA_GMAC_CONFIG_FULL_DUPLEX BIT(12)
#define MVNETA_GMAC_AN_DUPLEX_EN BIT(13)
@@ -399,14 +407,9 @@ struct mvneta_port {
@@ -400,14 +408,9 @@ struct mvneta_port {
u16 tx_ring_size;
u16 rx_ring_size;
@ -74,7 +74,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
struct mvneta_bm *bm_priv;
struct mvneta_bm_pool *pool_long;
@@ -1240,44 +1243,6 @@ static void mvneta_set_other_mcast_table
@@ -1241,44 +1244,6 @@ static void mvneta_set_other_mcast_table
mvreg_write(pp, MVNETA_DA_FILT_OTH_MCAST + offset, val);
}
@ -119,7 +119,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
static void mvneta_percpu_unmask_interrupt(void *arg)
{
struct mvneta_port *pp = arg;
@@ -1425,7 +1390,6 @@ static void mvneta_defaults_set(struct m
@@ -1426,7 +1391,6 @@ static void mvneta_defaults_set(struct m
val &= ~MVNETA_PHY_POLLING_ENABLE;
mvreg_write(pp, MVNETA_UNIT_CONTROL, val);
@ -127,7 +127,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
mvneta_set_ucast_table(pp, -1);
mvneta_set_special_mcast_table(pp, -1);
mvneta_set_other_mcast_table(pp, -1);
@@ -2630,26 +2594,11 @@ static irqreturn_t mvneta_isr(int irq, v
@@ -2631,26 +2595,11 @@ static irqreturn_t mvneta_isr(int irq, v
return IRQ_HANDLED;
}
@ -156,7 +156,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
/* NAPI handler
@@ -2665,7 +2614,6 @@ static int mvneta_poll(struct napi_struc
@@ -2666,7 +2615,6 @@ static int mvneta_poll(struct napi_struc
u32 cause_rx_tx;
int rx_queue;
struct mvneta_port *pp = netdev_priv(napi->dev);
@ -164,7 +164,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
struct mvneta_pcpu_port *port = this_cpu_ptr(pp->ports);
if (!netif_running(pp->dev)) {
@@ -2679,12 +2627,11 @@ static int mvneta_poll(struct napi_struc
@@ -2680,12 +2628,11 @@ static int mvneta_poll(struct napi_struc
u32 cause_misc = mvreg_read(pp, MVNETA_INTR_MISC_CAUSE);
mvreg_write(pp, MVNETA_INTR_MISC_CAUSE, 0);
@ -182,7 +182,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
/* Release Tx descriptors */
@@ -2980,7 +2927,6 @@ static int mvneta_setup_txqs(struct mvne
@@ -2981,7 +2928,6 @@ static int mvneta_setup_txqs(struct mvne
static void mvneta_start_dev(struct mvneta_port *pp)
{
int cpu;
@ -190,7 +190,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
mvneta_max_rx_size_set(pp, pp->pkt_size);
mvneta_txq_max_tx_size_set(pp, pp->pkt_size);
@@ -3003,16 +2949,15 @@ static void mvneta_start_dev(struct mvne
@@ -3004,16 +2950,15 @@ static void mvneta_start_dev(struct mvne
MVNETA_CAUSE_LINK_CHANGE |
MVNETA_CAUSE_PSC_SYNC_CHANGE);
@ -209,7 +209,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
for_each_online_cpu(cpu) {
struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu);
@@ -3182,99 +3127,210 @@ static int mvneta_set_mac_addr(struct ne
@@ -3183,99 +3128,210 @@ static int mvneta_set_mac_addr(struct ne
return 0;
}
@ -490,7 +490,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
/* Electing a CPU must be done in an atomic way: it should be done
@@ -3532,10 +3588,9 @@ static int mvneta_stop(struct net_device
@@ -3533,10 +3589,9 @@ static int mvneta_stop(struct net_device
static int mvneta_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
@ -503,7 +503,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
/* Ethtool methods */
@@ -3546,44 +3601,18 @@ mvneta_ethtool_set_link_ksettings(struct
@@ -3547,44 +3602,18 @@ mvneta_ethtool_set_link_ksettings(struct
const struct ethtool_link_ksettings *cmd)
{
struct mvneta_port *pp = netdev_priv(ndev);
@ -557,7 +557,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
/* Set interrupt coalescing for ethtools */
@@ -3691,26 +3720,28 @@ static void mvneta_ethtool_update_stats(
@@ -3692,26 +3721,28 @@ static void mvneta_ethtool_update_stats(
{
const struct mvneta_statistic *s;
void __iomem *base = pp->base;
@ -591,7 +591,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
}
@@ -3870,7 +3901,7 @@ const struct ethtool_ops mvneta_eth_tool
@@ -3871,7 +3902,7 @@ const struct ethtool_ops mvneta_eth_tool
.get_rxnfc = mvneta_ethtool_get_rxnfc,
.get_rxfh = mvneta_ethtool_get_rxfh,
.set_rxfh = mvneta_ethtool_set_rxfh,
@ -600,7 +600,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
.set_link_ksettings = mvneta_ethtool_set_link_ksettings,
};
@@ -3997,14 +4028,13 @@ static int mvneta_probe(struct platform_
@@ -3998,14 +4029,13 @@ static int mvneta_probe(struct platform_
const struct mbus_dram_target_info *dram_target_info;
struct resource *res;
struct device_node *dn = pdev->dev.of_node;
@ -616,7 +616,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
int tx_csum_limit;
int phy_mode;
int err;
@@ -4020,31 +4050,11 @@ static int mvneta_probe(struct platform_
@@ -4021,31 +4051,11 @@ static int mvneta_probe(struct platform_
goto err_free_netdev;
}
@ -649,7 +649,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
dev->tx_queue_len = MVNETA_MAX_TXD;
@@ -4055,12 +4065,7 @@ static int mvneta_probe(struct platform_
@@ -4056,12 +4066,7 @@ static int mvneta_probe(struct platform_
pp = netdev_priv(dev);
spin_lock_init(&pp->lock);
@ -663,7 +663,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
pp->rxq_def = rxq_def;
@@ -4071,7 +4076,7 @@ static int mvneta_probe(struct platform_
@@ -4072,7 +4077,7 @@ static int mvneta_probe(struct platform_
pp->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(pp->clk)) {
err = PTR_ERR(pp->clk);
@ -672,7 +672,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
clk_prepare_enable(pp->clk);
@@ -4179,6 +4184,14 @@ static int mvneta_probe(struct platform_
@@ -4180,6 +4185,14 @@ static int mvneta_probe(struct platform_
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
dev->gso_max_segs = MVNETA_MAX_TSO_SEGS;
@ -687,7 +687,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
err = register_netdev(dev);
if (err < 0) {
dev_err(&pdev->dev, "failed to register\n");
@@ -4190,14 +4203,6 @@ static int mvneta_probe(struct platform_
@@ -4191,14 +4204,6 @@ static int mvneta_probe(struct platform_
platform_set_drvdata(pdev, pp->dev);
@ -702,7 +702,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
return 0;
err_netdev:
@@ -4208,16 +4213,14 @@ err_netdev:
@@ -4209,16 +4214,14 @@ err_netdev:
1 << pp->id);
}
err_free_stats:
@ -721,7 +721,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
err_free_irq:
irq_dispose_mapping(dev->irq);
err_free_netdev:
@@ -4229,7 +4232,6 @@ err_free_netdev:
@@ -4230,7 +4233,6 @@ err_free_netdev:
static int mvneta_remove(struct platform_device *pdev)
{
struct net_device *dev = platform_get_drvdata(pdev);
@ -729,7 +729,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
struct mvneta_port *pp = netdev_priv(dev);
unregister_netdev(dev);
@@ -4237,10 +4239,8 @@ static int mvneta_remove(struct platform
@@ -4238,10 +4240,8 @@ static int mvneta_remove(struct platform
clk_disable_unprepare(pp->clk);
free_percpu(pp->ports);
free_percpu(pp->stats);

@ -12,7 +12,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -2629,9 +2629,11 @@ static int mvneta_poll(struct napi_struc
@@ -2630,9 +2630,11 @@ static int mvneta_poll(struct napi_struc
mvreg_write(pp, MVNETA_INTR_MISC_CAUSE, 0);
if (cause_misc & (MVNETA_CAUSE_PHY_STATUS_CHANGE |
@ -26,7 +26,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
}
/* Release Tx descriptors */
@@ -2946,8 +2948,7 @@ static void mvneta_start_dev(struct mvne
@@ -2947,8 +2949,7 @@ static void mvneta_start_dev(struct mvne
mvreg_write(pp, MVNETA_INTR_MISC_MASK,
MVNETA_CAUSE_PHY_STATUS_CHANGE |
@ -36,7 +36,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
phylink_start(pp->phylink);
netif_tx_start_all_queues(pp->dev);
@@ -3438,8 +3439,7 @@ static int mvneta_cpu_online(unsigned in
@@ -3439,8 +3440,7 @@ static int mvneta_cpu_online(unsigned in
on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true);
mvreg_write(pp, MVNETA_INTR_MISC_MASK,
MVNETA_CAUSE_PHY_STATUS_CHANGE |
@ -46,7 +46,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
netif_tx_start_all_queues(pp->dev);
spin_unlock(&pp->lock);
return 0;
@@ -3480,8 +3480,7 @@ static int mvneta_cpu_dead(unsigned int
@@ -3481,8 +3481,7 @@ static int mvneta_cpu_dead(unsigned int
on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true);
mvreg_write(pp, MVNETA_INTR_MISC_MASK,
MVNETA_CAUSE_PHY_STATUS_CHANGE |

@ -11,7 +11,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -3614,6 +3614,13 @@ mvneta_ethtool_get_link_ksettings(struct
@@ -3615,6 +3615,13 @@ mvneta_ethtool_get_link_ksettings(struct
return phylink_ethtool_ksettings_get(pp->phylink, cmd);
}
@ -25,7 +25,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
/* Set interrupt coalescing for ethtools */
static int mvneta_ethtool_set_coalesce(struct net_device *dev,
struct ethtool_coalesce *c)
@@ -3887,6 +3894,7 @@ static const struct net_device_ops mvnet
@@ -3888,6 +3895,7 @@ static const struct net_device_ops mvnet
};
const struct ethtool_ops mvneta_eth_tool_ops = {

@ -11,7 +11,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -3178,6 +3178,12 @@ static int mvneta_mac_link_state(struct
@@ -3179,6 +3179,12 @@ static int mvneta_mac_link_state(struct
state->link = !!(gmac_stat & MVNETA_GMAC_LINK_UP);
state->duplex = !!(gmac_stat & MVNETA_GMAC_FULL_DUPLEX);
@ -24,7 +24,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
return 1;
}
@@ -3220,6 +3226,8 @@ static void mvneta_mac_config(struct net
@@ -3221,6 +3227,8 @@ static void mvneta_mac_config(struct net
if (phylink_test(state->advertising, Pause))
new_an |= MVNETA_GMAC_ADVERT_SYM_FLOW_CTRL;
@ -33,7 +33,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
switch (mode) {
case MLO_AN_SGMII:
@@ -3244,7 +3252,7 @@ static void mvneta_mac_config(struct net
@@ -3245,7 +3253,7 @@ static void mvneta_mac_config(struct net
/* The MAC only supports FD mode */
MVNETA_GMAC_CONFIG_FULL_DUPLEX;
@ -42,7 +42,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
new_an |= MVNETA_GMAC_AN_FLOW_CTRL_EN;
break;
@@ -3710,6 +3718,22 @@ static int mvneta_ethtool_set_ringparam(
@@ -3711,6 +3719,22 @@ static int mvneta_ethtool_set_ringparam(
return 0;
}
@ -65,7 +65,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
static void mvneta_ethtool_get_strings(struct net_device *netdev, u32 sset,
u8 *data)
{
@@ -3901,6 +3925,8 @@ const struct ethtool_ops mvneta_eth_tool
@@ -3902,6 +3926,8 @@ const struct ethtool_ops mvneta_eth_tool
.get_drvinfo = mvneta_ethtool_get_drvinfo,
.get_ringparam = mvneta_ethtool_get_ringparam,
.set_ringparam = mvneta_ethtool_set_ringparam,

@ -12,7 +12,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -3152,10 +3152,11 @@ static void mvneta_validate_support(stru
@@ -3153,10 +3153,11 @@ static void mvneta_validate_support(stru
phylink_set(mask, 10baseT_Full);
phylink_set(mask, 100baseT_Half);
phylink_set(mask, 100baseT_Full);

@ -11,7 +11,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -3142,6 +3142,8 @@ static void mvneta_validate_support(stru
@@ -3143,6 +3143,8 @@ static void mvneta_validate_support(stru
phylink_set(mask, BNC);
phylink_set(mask, Backplane);
@ -20,7 +20,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
/* Half-duplex at speeds higher than 100Mbit is unsupported */
phylink_set(mask, 1000baseT_Full);
phylink_set(mask, 1000baseX_Full);
@@ -3154,9 +3156,6 @@ static void mvneta_validate_support(stru
@@ -3155,9 +3157,6 @@ static void mvneta_validate_support(stru
phylink_set(mask, 100baseT_Full);
}

@ -10,7 +10,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -3304,7 +3304,8 @@ static void mvneta_mac_link_down(struct
@@ -3305,7 +3305,8 @@ static void mvneta_mac_link_down(struct
}
}

@ -13,7 +13,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -243,6 +243,12 @@
@@ -244,6 +244,12 @@
#define MVNETA_TXQ_TOKEN_SIZE_REG(q) (0x3e40 + ((q) << 2))
#define MVNETA_TXQ_TOKEN_SIZE_MAX 0x7fffffff
@ -26,7 +26,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
#define MVNETA_CAUSE_TXQ_SENT_DESC_ALL_MASK 0xff
/* Descriptor ring Macros */
@@ -316,6 +322,11 @@
@@ -317,6 +323,11 @@
#define MVNETA_RX_GET_BM_POOL_ID(rxd) \
(((rxd)->status & MVNETA_RXD_BM_POOL_MASK) >> MVNETA_RXD_BM_POOL_SHIFT)
@ -38,7 +38,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
struct mvneta_statistic {
unsigned short offset;
unsigned short type;
@@ -324,6 +335,7 @@ struct mvneta_statistic {
@@ -325,6 +336,7 @@ struct mvneta_statistic {
#define T_REG_32 32
#define T_REG_64 64
@ -46,7 +46,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
static const struct mvneta_statistic mvneta_statistics[] = {
{ 0x3000, T_REG_64, "good_octets_received", },
@@ -358,6 +370,7 @@ static const struct mvneta_statistic mvn
@@ -359,6 +371,7 @@ static const struct mvneta_statistic mvn
{ 0x304c, T_REG_32, "broadcast_frames_sent", },
{ 0x3054, T_REG_32, "fc_sent", },
{ 0x300c, T_REG_32, "internal_mac_transmit_err", },
@ -54,7 +54,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
};
struct mvneta_pcpu_stats {
@@ -416,6 +429,10 @@ struct mvneta_port {
@@ -417,6 +430,10 @@ struct mvneta_port {
struct mvneta_bm_pool *pool_short;
int bm_win_id;
@ -65,7 +65,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
u64 ethtool_stats[ARRAY_SIZE(mvneta_statistics)];
u32 indir[MVNETA_RSS_LU_TABLE_SIZE];
@@ -3289,6 +3306,18 @@ static void mvneta_mac_config(struct net
@@ -3290,6 +3307,18 @@ static void mvneta_mac_config(struct net
mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, new_an);
}
@ -84,7 +84,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
static void mvneta_mac_link_down(struct net_device *ndev, unsigned int mode)
{
struct mvneta_port *pp = netdev_priv(ndev);
@@ -3302,6 +3331,9 @@ static void mvneta_mac_link_down(struct
@@ -3303,6 +3332,9 @@ static void mvneta_mac_link_down(struct
val |= MVNETA_GMAC_FORCE_LINK_DOWN;
mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
}
@ -94,7 +94,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
static void mvneta_mac_link_up(struct net_device *ndev, unsigned int mode,
@@ -3318,6 +3350,11 @@ static void mvneta_mac_link_up(struct ne
@@ -3319,6 +3351,11 @@ static void mvneta_mac_link_up(struct ne
}
mvneta_port_up(pp);
@ -106,7 +106,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
static const struct phylink_mac_ops mvneta_phylink_ops = {
@@ -3770,6 +3807,13 @@ static void mvneta_ethtool_update_stats(
@@ -3771,6 +3808,13 @@ static void mvneta_ethtool_update_stats(
high = readl_relaxed(base + s->offset + 4);
val = (u64)high << 32 | low;
break;
@ -120,7 +120,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
}
pp->ethtool_stats[i] += val;
@@ -3905,6 +3949,47 @@ static u16 mvneta_select_queue(struct ne
@@ -3906,6 +3950,47 @@ static u16 mvneta_select_queue(struct ne
}
@ -168,7 +168,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
static const struct net_device_ops mvneta_netdev_ops = {
.ndo_open = mvneta_open,
.ndo_stop = mvneta_stop,
@@ -3937,6 +4022,8 @@ const struct ethtool_ops mvneta_eth_tool
@@ -3938,6 +4023,8 @@ const struct ethtool_ops mvneta_eth_tool
.set_rxfh = mvneta_ethtool_set_rxfh,
.get_link_ksettings = mvneta_ethtool_get_link_ksettings,
.set_link_ksettings = mvneta_ethtool_set_link_ksettings,

@ -7,7 +7,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -3949,6 +3949,22 @@ static u16 mvneta_select_queue(struct ne
@@ -3950,6 +3950,22 @@ static u16 mvneta_select_queue(struct ne
}
@ -30,7 +30,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
static int mvneta_ethtool_get_eee(struct net_device *dev,
struct ethtool_eee *eee)
{
@@ -4022,6 +4038,8 @@ const struct ethtool_ops mvneta_eth_tool
@@ -4023,6 +4039,8 @@ const struct ethtool_ops mvneta_eth_tool
.set_rxfh = mvneta_ethtool_set_rxfh,
.get_link_ksettings = mvneta_ethtool_get_link_ksettings,
.set_link_ksettings = mvneta_ethtool_set_link_ksettings,

@ -43,7 +43,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
}
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -373,6 +373,7 @@ struct phy_device {
@@ -369,6 +369,7 @@ struct phy_device {
bool is_pseudo_fixed_link;
bool has_fixups;
bool suspended;

@ -173,7 +173,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_WRITE);
return ret;
}
@@ -1715,8 +1787,10 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1717,8 +1789,10 @@ int spi_nor_scan(struct spi_nor *nor, co
else if (mtd->size > 0x1000000) {
/* enable 4-byte addressing if the device exceeds 16MiB */
nor->addr_width = 4;

@ -83,7 +83,7 @@
if (info->flags & USE_FSR)
nor->flags |= SNOR_F_USE_FSR;
@@ -1735,11 +1798,20 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1737,11 +1800,20 @@ int spi_nor_scan(struct spi_nor *nor, co
mtd->writebufsize = nor->page_size;
if (np) {

@ -1,12 +0,0 @@
--- a/arch/mips/include/asm/mips-cm.h
+++ b/arch/mips/include/asm/mips-cm.h
@@ -239,8 +239,7 @@ BUILD_CM_Cx_R_(tcid_8_priority, 0x80)
#define CM_GCR_BASE_GCRBASE_MSK (_ULCAST_(0x1ffff) << 15)
#define CM_GCR_BASE_CMDEFTGT_SHF 0
#define CM_GCR_BASE_CMDEFTGT_MSK (_ULCAST_(0x3) << 0)
-#define CM_GCR_BASE_CMDEFTGT_DISABLED 0
-#define CM_GCR_BASE_CMDEFTGT_MEM 1
+#define CM_GCR_BASE_CMDEFTGT_MEM 0
#define CM_GCR_BASE_CMDEFTGT_IOCU0 2
#define CM_GCR_BASE_CMDEFTGT_IOCU1 3

@ -2887,7 +2887,7 @@
+
+ /* Display RX ring */
+ priv->hw->desc->display_ring(head_rx, DMA_RX_SIZE, true);
}
+ }
+}
+
+static void stmmac_display_tx_rings(struct stmmac_priv *priv)
@ -2906,15 +2906,15 @@
+ head_tx = (void *)tx_q->dma_etx;
+ else
+ head_tx = (void *)tx_q->dma_tx;
+
+ priv->hw->desc->display_ring(head_tx, DMA_TX_SIZE, false);
}
+}
- /* Display Rx ring */
- priv->hw->desc->display_ring(head_rx, DMA_RX_SIZE, true);
- /* Display Tx ring */
- priv->hw->desc->display_ring(head_tx, DMA_TX_SIZE, false);
+ priv->hw->desc->display_ring(head_tx, DMA_TX_SIZE, false);
+ }
+}
+
+static void stmmac_display_rings(struct stmmac_priv *priv)
+{
+ /* Display RX ring */
@ -3131,7 +3131,7 @@
if (priv->hw->mode->set_16kib_bfsize)
bfsize = priv->hw->mode->set_16kib_bfsize(dev->mtu);
@@ -1018,235 +1228,409 @@ static int init_dma_desc_rings(struct ne
@@ -1018,257 +1228,516 @@ static int init_dma_desc_rings(struct ne
priv->dma_buf_sz = bfsize;
@ -3163,7 +3163,10 @@
+ p = &((rx_q->dma_erx + i)->basic);
+ else
+ p = rx_q->dma_rx + i;
+
- ret = stmmac_init_rx_buffers(priv, p, i, flags);
- if (ret)
- goto err_init_rx_buffers;
+ ret = stmmac_init_rx_buffers(priv, p, i, flags,
+ queue);
+ if (ret)
@ -3173,18 +3176,15 @@
+ rx_q->rx_skbuff[i], rx_q->rx_skbuff[i]->data,
+ (unsigned int)rx_q->rx_skbuff_dma[i]);
+ }
- ret = stmmac_init_rx_buffers(priv, p, i, flags);
- if (ret)
- goto err_init_rx_buffers;
+
+ rx_q->cur_rx = 0;
+ rx_q->dirty_rx = (unsigned int)(i - DMA_RX_SIZE);
+
+ stmmac_clear_rx_descriptors(priv, queue);
- netif_dbg(priv, probe, priv->dev, "[%p]\t[%p]\t[%x]\n",
- priv->rx_skbuff[i], priv->rx_skbuff[i]->data,
- (unsigned int)priv->rx_skbuff_dma[i]);
+ stmmac_clear_rx_descriptors(priv, queue);
+
+ /* Setup the chained descriptor addresses */
+ if (priv->mode == STMMAC_CHAIN_MODE) {
+ if (priv->extend_desc)
@ -3277,8 +3277,13 @@
+ priv->hw->mode->init(tx_q->dma_tx,
+ tx_q->dma_tx_phy,
+ DMA_TX_SIZE, 0);
+ }
+
}
- priv->tx_skbuff_dma[i].buf = 0;
- priv->tx_skbuff_dma[i].map_as_page = false;
- priv->tx_skbuff_dma[i].len = 0;
- priv->tx_skbuff_dma[i].last_segment = false;
- priv->tx_skbuff[i] = NULL;
+ for (i = 0; i < DMA_TX_SIZE; i++) {
+ struct dma_desc *p;
+ if (priv->extend_desc)
@ -3300,13 +3305,8 @@
+ tx_q->tx_skbuff_dma[i].len = 0;
+ tx_q->tx_skbuff_dma[i].last_segment = false;
+ tx_q->tx_skbuff[i] = NULL;
}
- priv->tx_skbuff_dma[i].buf = 0;
- priv->tx_skbuff_dma[i].map_as_page = false;
- priv->tx_skbuff_dma[i].len = 0;
- priv->tx_skbuff_dma[i].last_segment = false;
- priv->tx_skbuff[i] = NULL;
+ }
+
+ tx_q->dirty_tx = 0;
+ tx_q->cur_tx = 0;
+
@ -3387,17 +3387,10 @@
- priv->tx_skbuff_dma[i].buf,
- priv->tx_skbuff_dma[i].len,
- DMA_TO_DEVICE);
- }
+ for (i = 0; i < DMA_TX_SIZE; i++)
+ stmmac_free_tx_buffer(priv, queue, i);
+}
- if (priv->tx_skbuff[i]) {
- dev_kfree_skb_any(priv->tx_skbuff[i]);
- priv->tx_skbuff[i] = NULL;
- priv->tx_skbuff_dma[i].buf = 0;
- priv->tx_skbuff_dma[i].map_as_page = false;
- }
+
+/**
+ * free_dma_rx_desc_resources - free RX dma desc resources
+ * @priv: private structure
@ -3426,11 +3419,10 @@
+
+ kfree(rx_q->rx_skbuff_dma);
+ kfree(rx_q->rx_skbuff);
}
}
/**
- * alloc_dma_desc_resources - alloc TX/RX resources.
+ }
+}
+
+/**
+ * free_dma_tx_desc_resources - free TX dma desc resources
+ * @priv: private structure
+ */
@ -3463,90 +3455,36 @@
+
+/**
+ * alloc_dma_rx_desc_resources - alloc RX resources.
* @priv: private structure
* Description: according to which descriptor can be used (extend or basic)
* this function allocates the resources for TX and RX paths. In case of
* reception, for example, it pre-allocated the RX socket buffer in order to
* allow zero-copy mechanism.
*/
-static int alloc_dma_desc_resources(struct stmmac_priv *priv)
+ * @priv: private structure
+ * Description: according to which descriptor can be used (extend or basic)
+ * this function allocates the resources for TX and RX paths. In case of
+ * reception, for example, it pre-allocated the RX socket buffer in order to
+ * allow zero-copy mechanism.
+ */
+static int alloc_dma_rx_desc_resources(struct stmmac_priv *priv)
{
+{
+ u32 rx_count = priv->plat->rx_queues_to_use;
int ret = -ENOMEM;
+ int ret = -ENOMEM;
+ u32 queue;
- priv->rx_skbuff_dma = kmalloc_array(DMA_RX_SIZE, sizeof(dma_addr_t),
- GFP_KERNEL);
- if (!priv->rx_skbuff_dma)
- return -ENOMEM;
+
+ /* RX queues buffers and DMA */
+ for (queue = 0; queue < rx_count; queue++) {
+ struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue];
- priv->rx_skbuff = kmalloc_array(DMA_RX_SIZE, sizeof(struct sk_buff *),
- GFP_KERNEL);
- if (!priv->rx_skbuff)
- goto err_rx_skbuff;
-
- priv->tx_skbuff_dma = kmalloc_array(DMA_TX_SIZE,
- sizeof(*priv->tx_skbuff_dma),
- GFP_KERNEL);
- if (!priv->tx_skbuff_dma)
- goto err_tx_skbuff_dma;
-
- priv->tx_skbuff = kmalloc_array(DMA_TX_SIZE, sizeof(struct sk_buff *),
- GFP_KERNEL);
- if (!priv->tx_skbuff)
- goto err_tx_skbuff;
-
- if (priv->extend_desc) {
- priv->dma_erx = dma_zalloc_coherent(priv->device, DMA_RX_SIZE *
- sizeof(struct
- dma_extended_desc),
- &priv->dma_rx_phy,
- GFP_KERNEL);
- if (!priv->dma_erx)
- goto err_dma;
+
+ rx_q->queue_index = queue;
+ rx_q->priv_data = priv;
- priv->dma_etx = dma_zalloc_coherent(priv->device, DMA_TX_SIZE *
- sizeof(struct
- dma_extended_desc),
- &priv->dma_tx_phy,
+
+ rx_q->rx_skbuff_dma = kmalloc_array(DMA_RX_SIZE,
+ sizeof(dma_addr_t),
GFP_KERNEL);
- if (!priv->dma_etx) {
- dma_free_coherent(priv->device, DMA_RX_SIZE *
- sizeof(struct dma_extended_desc),
- priv->dma_erx, priv->dma_rx_phy);
- goto err_dma;
- }
- } else {
- priv->dma_rx = dma_zalloc_coherent(priv->device, DMA_RX_SIZE *
- sizeof(struct dma_desc),
- &priv->dma_rx_phy,
- GFP_KERNEL);
- if (!priv->dma_rx)
- goto err_dma;
+ GFP_KERNEL);
+ if (!rx_q->rx_skbuff_dma)
+ return -ENOMEM;
- priv->dma_tx = dma_zalloc_coherent(priv->device, DMA_TX_SIZE *
- sizeof(struct dma_desc),
- &priv->dma_tx_phy,
- GFP_KERNEL);
- if (!priv->dma_tx) {
- dma_free_coherent(priv->device, DMA_RX_SIZE *
- sizeof(struct dma_desc),
- priv->dma_rx, priv->dma_rx_phy);
+
+ rx_q->rx_skbuff = kmalloc_array(DMA_RX_SIZE,
+ sizeof(struct sk_buff *),
+ GFP_KERNEL);
+ if (!rx_q->rx_skbuff)
goto err_dma;
+ goto err_dma;
+
+ if (priv->extend_desc) {
+ rx_q->dma_erx = dma_zalloc_coherent(priv->device,
@ -3567,19 +3505,12 @@
+ GFP_KERNEL);
+ if (!rx_q->dma_rx)
+ goto err_dma;
}
}
return 0;
err_dma:
- kfree(priv->tx_skbuff);
-err_tx_skbuff:
- kfree(priv->tx_skbuff_dma);
-err_tx_skbuff_dma:
- kfree(priv->rx_skbuff);
-err_rx_skbuff:
- kfree(priv->rx_skbuff_dma);
+ }
+ }
+
+ return 0;
+
+err_dma:
+ free_dma_rx_desc_resources(priv);
+
+ return ret;
@ -3636,7 +3567,7 @@
+ GFP_KERNEL);
+ if (!tx_q->dma_tx)
+ goto err_dma_buffers;
+ }
}
+ }
+
+ return 0;
@ -3644,9 +3575,9 @@
+err_dma_buffers:
+ free_dma_tx_desc_resources(priv);
+
return ret;
}
+ return ret;
+}
+
+/**
+ * alloc_dma_desc_resources - alloc TX/RX resources.
+ * @priv: private structure
@ -3672,78 +3603,119 @@
+ * free_dma_desc_resources - free dma desc resources
+ * @priv: private structure
+ */
static void free_dma_desc_resources(struct stmmac_priv *priv)
{
- /* Release the DMA TX/RX socket buffers */
- dma_free_rx_skbufs(priv);
- dma_free_tx_skbufs(priv);
-
- /* Free DMA regions of consistent memory previously allocated */
- if (!priv->extend_desc) {
- dma_free_coherent(priv->device,
- DMA_TX_SIZE * sizeof(struct dma_desc),
- priv->dma_tx, priv->dma_tx_phy);
- dma_free_coherent(priv->device,
- DMA_RX_SIZE * sizeof(struct dma_desc),
- priv->dma_rx, priv->dma_rx_phy);
- } else {
- dma_free_coherent(priv->device, DMA_TX_SIZE *
- sizeof(struct dma_extended_desc),
- priv->dma_etx, priv->dma_tx_phy);
- dma_free_coherent(priv->device, DMA_RX_SIZE *
- sizeof(struct dma_extended_desc),
- priv->dma_erx, priv->dma_rx_phy);
- }
- kfree(priv->rx_skbuff_dma);
- kfree(priv->rx_skbuff);
- kfree(priv->tx_skbuff_dma);
- kfree(priv->tx_skbuff);
+static void free_dma_desc_resources(struct stmmac_priv *priv)
+{
+ /* Release the DMA RX socket buffers */
+ free_dma_rx_desc_resources(priv);
+
+ /* Release the DMA TX socket buffers */
+ free_dma_tx_desc_resources(priv);
}
/**
@@ -1256,19 +1640,104 @@ static void free_dma_desc_resources(stru
*/
static void stmmac_mac_enable_rx_queues(struct stmmac_priv *priv)
{
- int rx_count = priv->dma_cap.number_rx_queues;
- int queue = 0;
+}
+
+/**
+ * stmmac_mac_enable_rx_queues - Enable MAC rx queues
+ * @priv: driver private structure
+ * Description: It is used for enabling the rx queues in the MAC
+ */
+static void stmmac_mac_enable_rx_queues(struct stmmac_priv *priv)
+{
+ u32 rx_queues_count = priv->plat->rx_queues_to_use;
+ int queue;
+ u8 mode;
- /* If GMAC does not have multiple queues, then this is not necessary*/
- if (rx_count == 1)
- return;
- if (priv->tx_skbuff[i]) {
- dev_kfree_skb_any(priv->tx_skbuff[i]);
- priv->tx_skbuff[i] = NULL;
- priv->tx_skbuff_dma[i].buf = 0;
- priv->tx_skbuff_dma[i].map_as_page = false;
- }
+ for (queue = 0; queue < rx_queues_count; queue++) {
+ mode = priv->plat->rx_queues_cfg[queue].mode_to_use;
+ priv->hw->mac->rx_queue_enable(priv->hw, mode, queue);
+ }
+}
}
}
- /**
- * If the core is synthesized with multiple rx queues / multiple
- * dma channels, then rx queues will be disabled by default.
- * For now only rx queue 0 is enabled.
- */
- priv->hw->mac->rx_queue_enable(priv->hw, queue);
+/**
/**
- * alloc_dma_desc_resources - alloc TX/RX resources.
- * @priv: private structure
- * Description: according to which descriptor can be used (extend or basic)
- * this function allocates the resources for TX and RX paths. In case of
- * reception, for example, it pre-allocated the RX socket buffer in order to
- * allow zero-copy mechanism.
+ * stmmac_start_rx_dma - start RX DMA channel
+ * @priv: driver private structure
+ * @chan: RX channel index
+ * Description:
+ * This starts a RX DMA channel
+ */
*/
-static int alloc_dma_desc_resources(struct stmmac_priv *priv)
+static void stmmac_start_rx_dma(struct stmmac_priv *priv, u32 chan)
+{
{
- int ret = -ENOMEM;
-
- priv->rx_skbuff_dma = kmalloc_array(DMA_RX_SIZE, sizeof(dma_addr_t),
- GFP_KERNEL);
- if (!priv->rx_skbuff_dma)
- return -ENOMEM;
-
- priv->rx_skbuff = kmalloc_array(DMA_RX_SIZE, sizeof(struct sk_buff *),
- GFP_KERNEL);
- if (!priv->rx_skbuff)
- goto err_rx_skbuff;
-
- priv->tx_skbuff_dma = kmalloc_array(DMA_TX_SIZE,
- sizeof(*priv->tx_skbuff_dma),
- GFP_KERNEL);
- if (!priv->tx_skbuff_dma)
- goto err_tx_skbuff_dma;
-
- priv->tx_skbuff = kmalloc_array(DMA_TX_SIZE, sizeof(struct sk_buff *),
- GFP_KERNEL);
- if (!priv->tx_skbuff)
- goto err_tx_skbuff;
-
- if (priv->extend_desc) {
- priv->dma_erx = dma_zalloc_coherent(priv->device, DMA_RX_SIZE *
- sizeof(struct
- dma_extended_desc),
- &priv->dma_rx_phy,
- GFP_KERNEL);
- if (!priv->dma_erx)
- goto err_dma;
-
- priv->dma_etx = dma_zalloc_coherent(priv->device, DMA_TX_SIZE *
- sizeof(struct
- dma_extended_desc),
- &priv->dma_tx_phy,
- GFP_KERNEL);
- if (!priv->dma_etx) {
- dma_free_coherent(priv->device, DMA_RX_SIZE *
- sizeof(struct dma_extended_desc),
- priv->dma_erx, priv->dma_rx_phy);
- goto err_dma;
- }
- } else {
- priv->dma_rx = dma_zalloc_coherent(priv->device, DMA_RX_SIZE *
- sizeof(struct dma_desc),
- &priv->dma_rx_phy,
- GFP_KERNEL);
- if (!priv->dma_rx)
- goto err_dma;
+ netdev_dbg(priv->dev, "DMA RX processes started in channel %d\n", chan);
+ priv->hw->dma->start_rx(priv->ioaddr, chan);
+}
+
- priv->dma_tx = dma_zalloc_coherent(priv->device, DMA_TX_SIZE *
- sizeof(struct dma_desc),
- &priv->dma_tx_phy,
- GFP_KERNEL);
- if (!priv->dma_tx) {
- dma_free_coherent(priv->device, DMA_RX_SIZE *
- sizeof(struct dma_desc),
- priv->dma_rx, priv->dma_rx_phy);
- goto err_dma;
- }
- }
+/**
+ * stmmac_start_tx_dma - start TX DMA channel
+ * @priv: driver private structure
@ -3756,7 +3728,8 @@
+ netdev_dbg(priv->dev, "DMA TX processes started in channel %d\n", chan);
+ priv->hw->dma->start_tx(priv->ioaddr, chan);
+}
+
- return 0;
+/**
+ * stmmac_stop_rx_dma - stop RX DMA channel
+ * @priv: driver private structure
@ -3769,7 +3742,16 @@
+ netdev_dbg(priv->dev, "DMA RX processes stopped in channel %d\n", chan);
+ priv->hw->dma->stop_rx(priv->ioaddr, chan);
+}
+
-err_dma:
- kfree(priv->tx_skbuff);
-err_tx_skbuff:
- kfree(priv->tx_skbuff_dma);
-err_tx_skbuff_dma:
- kfree(priv->rx_skbuff);
-err_rx_skbuff:
- kfree(priv->rx_skbuff_dma);
- return ret;
+/**
+ * stmmac_stop_tx_dma - stop TX DMA channel
+ * @priv: driver private structure
@ -3781,8 +3763,9 @@
+{
+ netdev_dbg(priv->dev, "DMA TX processes stopped in channel %d\n", chan);
+ priv->hw->dma->stop_tx(priv->ioaddr, chan);
+}
+
}
-static void free_dma_desc_resources(struct stmmac_priv *priv)
+/**
+ * stmmac_start_all_dma - start all RX and TX DMA channels
+ * @priv: driver private structure
@ -3790,7 +3773,31 @@
+ * This starts all the RX and TX DMA channels
+ */
+static void stmmac_start_all_dma(struct stmmac_priv *priv)
+{
{
- /* Release the DMA TX/RX socket buffers */
- dma_free_rx_skbufs(priv);
- dma_free_tx_skbufs(priv);
-
- /* Free DMA regions of consistent memory previously allocated */
- if (!priv->extend_desc) {
- dma_free_coherent(priv->device,
- DMA_TX_SIZE * sizeof(struct dma_desc),
- priv->dma_tx, priv->dma_tx_phy);
- dma_free_coherent(priv->device,
- DMA_RX_SIZE * sizeof(struct dma_desc),
- priv->dma_rx, priv->dma_rx_phy);
- } else {
- dma_free_coherent(priv->device, DMA_TX_SIZE *
- sizeof(struct dma_extended_desc),
- priv->dma_etx, priv->dma_tx_phy);
- dma_free_coherent(priv->device, DMA_RX_SIZE *
- sizeof(struct dma_extended_desc),
- priv->dma_erx, priv->dma_rx_phy);
- }
- kfree(priv->rx_skbuff_dma);
- kfree(priv->rx_skbuff);
- kfree(priv->tx_skbuff_dma);
- kfree(priv->tx_skbuff);
+ u32 rx_channels_count = priv->plat->rx_queues_to_use;
+ u32 tx_channels_count = priv->plat->tx_queues_to_use;
+ u32 chan = 0;
@ -3800,23 +3807,38 @@
+
+ for (chan = 0; chan < tx_channels_count; chan++)
+ stmmac_start_tx_dma(priv, chan);
+}
+
+/**
}
/**
- * stmmac_mac_enable_rx_queues - Enable MAC rx queues
- * @priv: driver private structure
- * Description: It is used for enabling the rx queues in the MAC
+ * stmmac_stop_all_dma - stop all RX and TX DMA channels
+ * @priv: driver private structure
+ * Description:
+ * This stops the RX and TX DMA channels
+ */
*/
-static void stmmac_mac_enable_rx_queues(struct stmmac_priv *priv)
+static void stmmac_stop_all_dma(struct stmmac_priv *priv)
+{
{
- int rx_count = priv->dma_cap.number_rx_queues;
- int queue = 0;
+ u32 rx_channels_count = priv->plat->rx_queues_to_use;
+ u32 tx_channels_count = priv->plat->tx_queues_to_use;
+ u32 chan = 0;
+
- /* If GMAC does not have multiple queues, then this is not necessary*/
- if (rx_count == 1)
- return;
+ for (chan = 0; chan < rx_channels_count; chan++)
+ stmmac_stop_rx_dma(priv, chan);
+
- /**
- * If the core is synthesized with multiple rx queues / multiple
- * dma channels, then rx queues will be disabled by default.
- * For now only rx queue 0 is enabled.
- */
- priv->hw->mac->rx_queue_enable(priv->hw, queue);
+ for (chan = 0; chan < tx_channels_count; chan++)
+ stmmac_stop_tx_dma(priv, chan);
}

@ -35,7 +35,7 @@ Signed-off-by: Richard Weinberger <richard@nod.at>
struct iovec iov;
if (have_xstate_support) {
@@ -34,9 +35,9 @@ int save_fp_registers(int pid, unsigned
@@ -34,9 +35,9 @@ int save_fp_registers(int pid, unsigned
if (ptrace(PTRACE_GETREGSET, pid, NT_X86_XSTATE, &iov) < 0)
return -errno;
return 0;

@ -1,6 +1,6 @@
--- a/drivers/clocksource/cs5535-clockevt.c
+++ b/drivers/clocksource/cs5535-clockevt.c
@@ -129,7 +129,8 @@ static irqreturn_t mfgpt_tick(int irq, v
@@ -130,7 +130,8 @@ static irqreturn_t mfgpt_tick(int irq, v
cs5535_mfgpt_write(cs5535_event_clock, MFGPT_REG_SETUP,
MFGPT_SETUP_CNTEN | MFGPT_SETUP_CMP2);

Loading…
Cancel
Save