From: Álvaro Fernández Rojas Date: Thu, 2 Jun 2016 13:34:34 +0000 (+0200) Subject: kernel: update kernel 4.4 to version 4.4.12 X-Git-Tag: v17.01.0-rc1~2559 X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=a105eac4dd424fafdea3a72c270ef9cf9cdc1433;p=openwrt%2Fstaging%2Fchunkeey.git kernel: update kernel 4.4 to version 4.4.12 Signed-off-by: Álvaro Fernández Rojas --- diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 0142ef6a18..893dc0a698 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -4,11 +4,11 @@ LINUX_RELEASE?=1 LINUX_VERSION-3.18 = .29 LINUX_VERSION-4.1 = .20 -LINUX_VERSION-4.4 = .11 +LINUX_VERSION-4.4 = .12 LINUX_KERNEL_MD5SUM-3.18.29 = b25737a0bc98e80d12200de93f239c28 LINUX_KERNEL_MD5SUM-4.1.20 = 075c38a3a23ca5bc80437b13606df00a -LINUX_KERNEL_MD5SUM-4.4.11 = 58b2eaccb3cec0d78e46ff4e968b431a +LINUX_KERNEL_MD5SUM-4.4.12 = eed37d7fa5c2095f42f62803fa077c33 ifdef KERNEL_PATCHVER LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER))) diff --git a/target/linux/bcm53xx/patches-4.4/405-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch b/target/linux/bcm53xx/patches-4.4/405-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch index 1cf883a963..ca930e75f0 100644 --- a/target/linux/bcm53xx/patches-4.4/405-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch +++ b/target/linux/bcm53xx/patches-4.4/405-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch @@ -13,7 +13,7 @@ Signed-off-by: Rafał Miłecki --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -869,6 +869,18 @@ static const struct flash_info *spi_nor_ +@@ -870,6 +870,18 @@ static const struct flash_info *spi_nor_ } dev_err(nor->dev, "unrecognized JEDEC id bytes: %02x, %2x, %2x\n", id[0], id[1], id[2]); diff --git a/target/linux/bcm53xx/patches-4.4/500-UBI-Detect-EOF-mark-and-erase-all-remaining-blocks.patch b/target/linux/bcm53xx/patches-4.4/500-UBI-Detect-EOF-mark-and-erase-all-remaining-blocks.patch index 11bd956163..636e63eb29 100644 --- a/target/linux/bcm53xx/patches-4.4/500-UBI-Detect-EOF-mark-and-erase-all-remaining-blocks.patch +++ b/target/linux/bcm53xx/patches-4.4/500-UBI-Detect-EOF-mark-and-erase-all-remaining-blocks.patch @@ -49,7 +49,7 @@ Signed-off-by: Rafał Miłecki return UBI_IO_BAD_HDR_EBADMSG; --- a/drivers/mtd/ubi/ubi.h +++ b/drivers/mtd/ubi/ubi.h -@@ -781,6 +781,7 @@ extern struct mutex ubi_devices_mutex; +@@ -783,6 +783,7 @@ extern struct mutex ubi_devices_mutex; extern struct blocking_notifier_head ubi_notifiers; /* attach.c */ diff --git a/target/linux/brcm2708/patches-4.4/0252-clk-bcm2835-add-a-round-up-ability-to-the-clock-divi.patch b/target/linux/brcm2708/patches-4.4/0252-clk-bcm2835-add-a-round-up-ability-to-the-clock-divi.patch index 99bb5dbfd3..55680acc95 100644 --- a/target/linux/brcm2708/patches-4.4/0252-clk-bcm2835-add-a-round-up-ability-to-the-clock-divi.patch +++ b/target/linux/brcm2708/patches-4.4/0252-clk-bcm2835-add-a-round-up-ability-to-the-clock-divi.patch @@ -17,7 +17,7 @@ Signed-off-by: Michael Turquette --- a/drivers/clk/bcm/clk-bcm2835.c +++ b/drivers/clk/bcm/clk-bcm2835.c -@@ -1150,22 +1150,24 @@ static int bcm2835_clock_is_on(struct cl +@@ -1154,22 +1154,24 @@ static int bcm2835_clock_is_on(struct cl static u32 bcm2835_clock_choose_div(struct clk_hw *hw, unsigned long rate, @@ -50,7 +50,7 @@ Signed-off-by: Michael Turquette /* Clamp to the limits. */ div = max(div, unused_frac_mask + 1); -@@ -1204,7 +1206,7 @@ static long bcm2835_clock_round_rate(str +@@ -1208,7 +1210,7 @@ static long bcm2835_clock_round_rate(str unsigned long *parent_rate) { struct bcm2835_clock *clock = bcm2835_clock_from_hw(hw); @@ -59,7 +59,7 @@ Signed-off-by: Michael Turquette return bcm2835_clock_rate_from_divisor(clock, *parent_rate, div); } -@@ -1273,7 +1275,7 @@ static int bcm2835_clock_set_rate(struct +@@ -1277,7 +1279,7 @@ static int bcm2835_clock_set_rate(struct struct bcm2835_clock *clock = bcm2835_clock_from_hw(hw); struct bcm2835_cprman *cprman = clock->cprman; const struct bcm2835_clock_data *data = clock->data; diff --git a/target/linux/brcm2708/patches-4.4/0253-clk-bcm2835-Support-for-clock-parent-selection.patch b/target/linux/brcm2708/patches-4.4/0253-clk-bcm2835-Support-for-clock-parent-selection.patch index 68af214691..629e5b2c6b 100644 --- a/target/linux/brcm2708/patches-4.4/0253-clk-bcm2835-Support-for-clock-parent-selection.patch +++ b/target/linux/brcm2708/patches-4.4/0253-clk-bcm2835-Support-for-clock-parent-selection.patch @@ -24,7 +24,7 @@ Signed-off-by: Michael Turquette --- a/drivers/clk/bcm/clk-bcm2835.c +++ b/drivers/clk/bcm/clk-bcm2835.c -@@ -1201,16 +1201,6 @@ static long bcm2835_clock_rate_from_divi +@@ -1205,16 +1205,6 @@ static long bcm2835_clock_rate_from_divi return temp; } @@ -41,7 +41,7 @@ Signed-off-by: Michael Turquette static unsigned long bcm2835_clock_get_rate(struct clk_hw *hw, unsigned long parent_rate) { -@@ -1282,13 +1272,75 @@ static int bcm2835_clock_set_rate(struct +@@ -1286,13 +1276,75 @@ static int bcm2835_clock_set_rate(struct return 0; } @@ -118,7 +118,7 @@ Signed-off-by: Michael Turquette }; static int bcm2835_vpu_clock_is_on(struct clk_hw *hw) -@@ -1304,7 +1356,9 @@ static const struct clk_ops bcm2835_vpu_ +@@ -1308,7 +1360,9 @@ static const struct clk_ops bcm2835_vpu_ .is_prepared = bcm2835_vpu_clock_is_on, .recalc_rate = bcm2835_clock_get_rate, .set_rate = bcm2835_clock_set_rate, @@ -129,7 +129,7 @@ Signed-off-by: Michael Turquette }; static struct clk *bcm2835_register_pll(struct bcm2835_cprman *cprman, -@@ -1398,45 +1452,23 @@ static struct clk *bcm2835_register_cloc +@@ -1402,45 +1456,23 @@ static struct clk *bcm2835_register_cloc { struct bcm2835_clock *clock; struct clk_init_data init; diff --git a/target/linux/brcm2708/patches-4.4/0254-clk-bcm2835-Add-PWM-clock-support.patch b/target/linux/brcm2708/patches-4.4/0254-clk-bcm2835-Add-PWM-clock-support.patch index 1f79e88d0f..0465e49aee 100644 --- a/target/linux/brcm2708/patches-4.4/0254-clk-bcm2835-Add-PWM-clock-support.patch +++ b/target/linux/brcm2708/patches-4.4/0254-clk-bcm2835-Add-PWM-clock-support.patch @@ -33,7 +33,7 @@ Signed-off-by: Michael Turquette struct bcm2835_pll { struct clk_hw hw; struct bcm2835_cprman *cprman; -@@ -1586,6 +1596,9 @@ static int bcm2835_clk_probe(struct plat +@@ -1590,6 +1600,9 @@ static int bcm2835_clk_probe(struct plat cprman->regs + CM_PERIICTL, CM_GATE_BIT, 0, &cprman->regs_lock); diff --git a/target/linux/brcm2708/patches-4.4/0257-clk-bcm2835-add-locking-to-pll-_on-off-methods.patch b/target/linux/brcm2708/patches-4.4/0257-clk-bcm2835-add-locking-to-pll-_on-off-methods.patch deleted file mode 100644 index 29f45529e8..0000000000 --- a/target/linux/brcm2708/patches-4.4/0257-clk-bcm2835-add-locking-to-pll-_on-off-methods.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 39c3c0d0a8d038a692b95cc13e7d6acf2d04cf14 Mon Sep 17 00:00:00 2001 -From: Martin Sperl -Date: Mon, 29 Feb 2016 11:39:18 +0000 -Subject: [PATCH 257/304] clk: bcm2835: add locking to pll*_on/off methods - -Add missing locking to: -* bcm2835_pll_divider_on -* bcm2835_pll_divider_off -to protect the read modify write cycle for the -register access protecting both cm_reg and a2w_reg -registers. - -Fixes: 41691b8862e2 ("clk: bcm2835: Add support for programming the -audio domain clocks") - -Signed-off-by: Martin Sperl -Signed-off-by: Eric Anholt -Reviewed-by: Eric Anholt -(cherry picked from commit ec36a5c6682fdd5328abf15c3c67281bed0241d7) ---- - drivers/clk/bcm/clk-bcm2835.c | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/drivers/clk/bcm/clk-bcm2835.c -+++ b/drivers/clk/bcm/clk-bcm2835.c -@@ -1097,10 +1097,12 @@ static void bcm2835_pll_divider_off(stru - struct bcm2835_cprman *cprman = divider->cprman; - const struct bcm2835_pll_divider_data *data = divider->data; - -+ spin_lock(&cprman->regs_lock); - cprman_write(cprman, data->cm_reg, - (cprman_read(cprman, data->cm_reg) & - ~data->load_mask) | data->hold_mask); - cprman_write(cprman, data->a2w_reg, A2W_PLL_CHANNEL_DISABLE); -+ spin_unlock(&cprman->regs_lock); - } - - static int bcm2835_pll_divider_on(struct clk_hw *hw) -@@ -1109,12 +1111,14 @@ static int bcm2835_pll_divider_on(struct - struct bcm2835_cprman *cprman = divider->cprman; - const struct bcm2835_pll_divider_data *data = divider->data; - -+ spin_lock(&cprman->regs_lock); - cprman_write(cprman, data->a2w_reg, - cprman_read(cprman, data->a2w_reg) & - ~A2W_PLL_CHANNEL_DISABLE); - - cprman_write(cprman, data->cm_reg, - cprman_read(cprman, data->cm_reg) & ~data->hold_mask); -+ spin_unlock(&cprman->regs_lock); - - return 0; - } diff --git a/target/linux/generic/patches-4.4/494-mtd-ubi-add-EOF-marker-support.patch b/target/linux/generic/patches-4.4/494-mtd-ubi-add-EOF-marker-support.patch index 14fae764fe..dd5ee306ef 100644 --- a/target/linux/generic/patches-4.4/494-mtd-ubi-add-EOF-marker-support.patch +++ b/target/linux/generic/patches-4.4/494-mtd-ubi-add-EOF-marker-support.patch @@ -41,7 +41,7 @@ break; --- a/drivers/mtd/ubi/ubi.h +++ b/drivers/mtd/ubi/ubi.h -@@ -739,6 +739,7 @@ struct ubi_attach_info { +@@ -741,6 +741,7 @@ struct ubi_attach_info { int mean_ec; uint64_t ec_sum; int ec_count; diff --git a/target/linux/mediatek/patches-4.4/0001-NET-multi-phy-support.patch b/target/linux/mediatek/patches-4.4/0001-NET-multi-phy-support.patch index 6ff4e7507b..4b75613979 100644 --- a/target/linux/mediatek/patches-4.4/0001-NET-multi-phy-support.patch +++ b/target/linux/mediatek/patches-4.4/0001-NET-multi-phy-support.patch @@ -9,11 +9,9 @@ Signed-off-by: John Crispin include/linux/phy.h | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) -diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c -index 47cd306d..f69d12f 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c -@@ -844,7 +844,8 @@ void phy_state_machine(struct work_struct *work) +@@ -888,7 +888,8 @@ void phy_state_machine(struct work_struc /* If the link is down, give up on negotiation for now */ if (!phydev->link) { phydev->state = PHY_NOLINK; @@ -23,7 +21,7 @@ index 47cd306d..f69d12f 100644 phydev->adjust_link(phydev->attached_dev); break; } -@@ -927,7 +928,8 @@ void phy_state_machine(struct work_struct *work) +@@ -971,7 +972,8 @@ void phy_state_machine(struct work_struc netif_carrier_on(phydev->attached_dev); } else { phydev->state = PHY_NOLINK; @@ -33,7 +31,7 @@ index 47cd306d..f69d12f 100644 } phydev->adjust_link(phydev->attached_dev); -@@ -939,7 +941,8 @@ void phy_state_machine(struct work_struct *work) +@@ -983,7 +985,8 @@ void phy_state_machine(struct work_struc case PHY_HALTED: if (phydev->link) { phydev->link = 0; @@ -43,8 +41,6 @@ index 47cd306d..f69d12f 100644 phydev->adjust_link(phydev->attached_dev); do_suspend = true; } -diff --git a/include/linux/phy.h b/include/linux/phy.h -index 05fde31..276ab8a 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -377,6 +377,7 @@ struct phy_device { @@ -55,6 +51,3 @@ index 05fde31..276ab8a 100644 enum phy_state state; --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0002-soc-mediatek-Separate-scpsys-driver-common-code.patch b/target/linux/mediatek/patches-4.4/0002-soc-mediatek-Separate-scpsys-driver-common-code.patch index 9514e86186..194e66970e 100644 --- a/target/linux/mediatek/patches-4.4/0002-soc-mediatek-Separate-scpsys-driver-common-code.patch +++ b/target/linux/mediatek/patches-4.4/0002-soc-mediatek-Separate-scpsys-driver-common-code.patch @@ -17,8 +17,6 @@ Signed-off-by: James Liao create mode 100644 drivers/soc/mediatek/mtk-scpsys-mt8173.c create mode 100644 drivers/soc/mediatek/mtk-scpsys.h -diff --git a/drivers/soc/mediatek/Kconfig b/drivers/soc/mediatek/Kconfig -index 0a4ea80..eca6fb7 100644 --- a/drivers/soc/mediatek/Kconfig +++ b/drivers/soc/mediatek/Kconfig @@ -22,11 +22,20 @@ config MTK_PMIC_WRAP @@ -44,8 +42,6 @@ index 0a4ea80..eca6fb7 100644 + driver. + The System Control Processor System (SCPSYS) has several power + management related tasks in the system. -diff --git a/drivers/soc/mediatek/Makefile b/drivers/soc/mediatek/Makefile -index 12998b0..3b22baa 100644 --- a/drivers/soc/mediatek/Makefile +++ b/drivers/soc/mediatek/Makefile @@ -1,3 +1,4 @@ @@ -53,9 +49,6 @@ index 12998b0..3b22baa 100644 obj-$(CONFIG_MTK_PMIC_WRAP) += mtk-pmic-wrap.o obj-$(CONFIG_MTK_SCPSYS) += mtk-scpsys.o +obj-$(CONFIG_MTK_SCPSYS_MT8173) += mtk-scpsys-mt8173.o -diff --git a/drivers/soc/mediatek/mtk-scpsys-mt8173.c b/drivers/soc/mediatek/mtk-scpsys-mt8173.c -new file mode 100644 -index 0000000..3c7b569 --- /dev/null +++ b/drivers/soc/mediatek/mtk-scpsys-mt8173.c @@ -0,0 +1,179 @@ @@ -238,8 +231,6 @@ index 0000000..3c7b569 +}; + +module_platform_driver_probe(scpsys_drv, scpsys_probe); -diff --git a/drivers/soc/mediatek/mtk-scpsys.c b/drivers/soc/mediatek/mtk-scpsys.c -index 4d4203c..a0943c5 100644 --- a/drivers/soc/mediatek/mtk-scpsys.c +++ b/drivers/soc/mediatek/mtk-scpsys.c @@ -11,28 +11,14 @@ @@ -257,7 +248,7 @@ index 4d4203c..a0943c5 100644 -#include #include -#include -- + -#define SPM_VDE_PWR_CON 0x0210 -#define SPM_MFG_PWR_CON 0x0214 -#define SPM_VEN_PWR_CON 0x0230 @@ -268,7 +259,6 @@ index 4d4203c..a0943c5 100644 -#define SPM_MFG_2D_PWR_CON 0x02c0 -#define SPM_MFG_ASYNC_PWR_CON 0x02c4 -#define SPM_USB_PWR_CON 0x02cc -+ +#include "mtk-scpsys.h" + #define SPM_PWR_STATUS 0x060c @@ -428,7 +418,7 @@ index 4d4203c..a0943c5 100644 static int scpsys_domain_is_on(struct scp_domain *scpd) { struct scp *scp = scpd->scp; -@@ -398,63 +237,89 @@ static bool scpsys_active_wakeup(struct device *dev) +@@ -398,63 +237,89 @@ static bool scpsys_active_wakeup(struct return scpd->active_wakeup; } @@ -518,13 +508,13 @@ index 4d4203c..a0943c5 100644 + return ERR_PTR(-ENOMEM); + + pd_data = &scp->pd_data; -+ + +- for (i = 0; i < NUM_DOMAINS; i++) { + pd_data->domains = devm_kzalloc(&pdev->dev, + sizeof(*pd_data->domains) * num, GFP_KERNEL); + if (!pd_data->domains) + return ERR_PTR(-ENOMEM); - -- for (i = 0; i < NUM_DOMAINS; i++) { ++ + pd_data->num_domains = num; + + init_clks(pdev, clk); @@ -549,7 +539,7 @@ index 4d4203c..a0943c5 100644 pd_data->domains[i] = genpd; scpd->scp = scp; -@@ -464,13 +329,25 @@ static int __init scpsys_probe(struct platform_device *pdev) +@@ -464,13 +329,25 @@ static int __init scpsys_probe(struct pl scpd->sram_pdn_ack_bits = data->sram_pdn_ack_bits; scpd->bus_prot_mask = data->bus_prot_mask; scpd->active_wakeup = data->active_wakeup; @@ -577,7 +567,7 @@ index 4d4203c..a0943c5 100644 /* * Initially turn on all domains to make the domains usable -@@ -489,37 +366,9 @@ static int __init scpsys_probe(struct platform_device *pdev) +@@ -489,37 +366,9 @@ static int __init scpsys_probe(struct pl * valid. */ @@ -616,9 +606,6 @@ index 4d4203c..a0943c5 100644 -}; - -module_platform_driver_probe(scpsys_drv, scpsys_probe); -diff --git a/drivers/soc/mediatek/mtk-scpsys.h b/drivers/soc/mediatek/mtk-scpsys.h -new file mode 100644 -index 0000000..466728d --- /dev/null +++ b/drivers/soc/mediatek/mtk-scpsys.h @@ -0,0 +1,54 @@ @@ -676,6 +663,3 @@ index 0000000..466728d + struct scp *scp, int num); + +#endif /* __DRV_SOC_MTK_H */ --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0003-soc-mediatek-Init-MT8173-scpsys-driver-earlier.patch b/target/linux/mediatek/patches-4.4/0003-soc-mediatek-Init-MT8173-scpsys-driver-earlier.patch index cdcb6c2ecb..46af96450b 100644 --- a/target/linux/mediatek/patches-4.4/0003-soc-mediatek-Init-MT8173-scpsys-driver-earlier.patch +++ b/target/linux/mediatek/patches-4.4/0003-soc-mediatek-Init-MT8173-scpsys-driver-earlier.patch @@ -12,11 +12,9 @@ Signed-off-by: James Liao drivers/soc/mediatek/mtk-scpsys-mt8173.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) -diff --git a/drivers/soc/mediatek/mtk-scpsys-mt8173.c b/drivers/soc/mediatek/mtk-scpsys-mt8173.c -index 3c7b569..827e696 100644 --- a/drivers/soc/mediatek/mtk-scpsys-mt8173.c +++ b/drivers/soc/mediatek/mtk-scpsys-mt8173.c -@@ -176,4 +176,15 @@ static struct platform_driver scpsys_drv = { +@@ -176,4 +176,15 @@ static struct platform_driver scpsys_drv }, }; @@ -33,6 +31,3 @@ index 3c7b569..827e696 100644 + +subsys_initcall(scpsys_drv_init); +module_exit(scpsys_drv_exit); --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0004-soc-mediatek-Add-MT2701-power-dt-bindings.patch b/target/linux/mediatek/patches-4.4/0004-soc-mediatek-Add-MT2701-power-dt-bindings.patch index 33e3178d48..132d6c89c8 100644 --- a/target/linux/mediatek/patches-4.4/0004-soc-mediatek-Add-MT2701-power-dt-bindings.patch +++ b/target/linux/mediatek/patches-4.4/0004-soc-mediatek-Add-MT2701-power-dt-bindings.patch @@ -12,9 +12,6 @@ Signed-off-by: James Liao 1 file changed, 27 insertions(+) create mode 100644 include/dt-bindings/power/mt2701-power.h -diff --git a/include/dt-bindings/power/mt2701-power.h b/include/dt-bindings/power/mt2701-power.h -new file mode 100644 -index 0000000..64cc826 --- /dev/null +++ b/include/dt-bindings/power/mt2701-power.h @@ -0,0 +1,27 @@ @@ -45,6 +42,3 @@ index 0000000..64cc826 +#define MT2701_POWER_DOMAIN_IFR_MSC 8 + +#endif /* _DT_BINDINGS_POWER_MT2701_POWER_H */ --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0005-soc-mediatek-Add-MT2701-MT7623-scpsys-driver.patch b/target/linux/mediatek/patches-4.4/0005-soc-mediatek-Add-MT2701-MT7623-scpsys-driver.patch index 388dc08adc..2f2337a8e3 100644 --- a/target/linux/mediatek/patches-4.4/0005-soc-mediatek-Add-MT2701-MT7623-scpsys-driver.patch +++ b/target/linux/mediatek/patches-4.4/0005-soc-mediatek-Add-MT2701-MT7623-scpsys-driver.patch @@ -14,8 +14,6 @@ Signed-off-by: James Liao 3 files changed, 173 insertions(+) create mode 100644 drivers/soc/mediatek/mtk-scpsys-mt2701.c -diff --git a/drivers/soc/mediatek/Kconfig b/drivers/soc/mediatek/Kconfig -index eca6fb7..92cf838 100644 --- a/drivers/soc/mediatek/Kconfig +++ b/drivers/soc/mediatek/Kconfig @@ -39,3 +39,14 @@ config MTK_SCPSYS_MT8173 @@ -33,18 +31,13 @@ index eca6fb7..92cf838 100644 + domain driver. + The System Control Processor System (SCPSYS) has several power + management related tasks in the system. -diff --git a/drivers/soc/mediatek/Makefile b/drivers/soc/mediatek/Makefile -index 3b22baa..822986d 100644 --- a/drivers/soc/mediatek/Makefile +++ b/drivers/soc/mediatek/Makefile -@@ -2,3 +2,4 @@ obj-$(CONFIG_MTK_INFRACFG) += mtk-infracfg.o +@@ -2,3 +2,4 @@ obj-$(CONFIG_MTK_INFRACFG) += mtk-infrac obj-$(CONFIG_MTK_PMIC_WRAP) += mtk-pmic-wrap.o obj-$(CONFIG_MTK_SCPSYS) += mtk-scpsys.o obj-$(CONFIG_MTK_SCPSYS_MT8173) += mtk-scpsys-mt8173.o +obj-$(CONFIG_MTK_SCPSYS_MT2701) += mtk-scpsys-mt2701.o -diff --git a/drivers/soc/mediatek/mtk-scpsys-mt2701.c b/drivers/soc/mediatek/mtk-scpsys-mt2701.c -new file mode 100644 -index 0000000..339d5b8 --- /dev/null +++ b/drivers/soc/mediatek/mtk-scpsys-mt2701.c @@ -0,0 +1,161 @@ @@ -209,6 +202,3 @@ index 0000000..339d5b8 + +MODULE_DESCRIPTION("MediaTek MT2701 scpsys driver"); +MODULE_LICENSE("GPL v2"); --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0006-clk-mediatek-Refine-the-makefile-to-support-multiple.patch b/target/linux/mediatek/patches-4.4/0006-clk-mediatek-Refine-the-makefile-to-support-multiple.patch index 40c38ca9b4..d4bac233b9 100644 --- a/target/linux/mediatek/patches-4.4/0006-clk-mediatek-Refine-the-makefile-to-support-multiple.patch +++ b/target/linux/mediatek/patches-4.4/0006-clk-mediatek-Refine-the-makefile-to-support-multiple.patch @@ -16,8 +16,6 @@ Signed-off-by: James Liao 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 drivers/clk/mediatek/Kconfig -diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig -index c3e3a02..b7a37dc 100644 --- a/drivers/clk/Kconfig +++ b/drivers/clk/Kconfig @@ -198,3 +198,4 @@ source "drivers/clk/mvebu/Kconfig" @@ -25,9 +23,6 @@ index c3e3a02..b7a37dc 100644 source "drivers/clk/samsung/Kconfig" source "drivers/clk/tegra/Kconfig" +source "drivers/clk/mediatek/Kconfig" -diff --git a/drivers/clk/mediatek/Kconfig b/drivers/clk/mediatek/Kconfig -new file mode 100644 -index 0000000..dc224e6 --- /dev/null +++ b/drivers/clk/mediatek/Kconfig @@ -0,0 +1,23 @@ @@ -54,8 +49,6 @@ index 0000000..dc224e6 + default ARCH_MEDIATEK + ---help--- + This driver supports Mediatek MT8173 clocks. -diff --git a/drivers/clk/mediatek/Makefile b/drivers/clk/mediatek/Makefile -index 95fdfac..32e7222 100644 --- a/drivers/clk/mediatek/Makefile +++ b/drivers/clk/mediatek/Makefile @@ -1,4 +1,4 @@ @@ -66,6 +59,3 @@ index 95fdfac..32e7222 100644 -obj-y += clk-mt8173.o +obj-$(CONFIG_COMMON_CLK_MT8135) += clk-mt8135.o +obj-$(CONFIG_COMMON_CLK_MT8173) += clk-mt8173.o --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0007-dt-bindings-ARM-Mediatek-Document-bindings-for-MT270.patch b/target/linux/mediatek/patches-4.4/0007-dt-bindings-ARM-Mediatek-Document-bindings-for-MT270.patch index 9a0dc11436..fd21c0b788 100644 --- a/target/linux/mediatek/patches-4.4/0007-dt-bindings-ARM-Mediatek-Document-bindings-for-MT270.patch +++ b/target/linux/mediatek/patches-4.4/0007-dt-bindings-ARM-Mediatek-Document-bindings-for-MT270.patch @@ -25,11 +25,9 @@ Signed-off-by: James Liao create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,ethsys.txt create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,hifsys.txt -diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,apmixedsys.txt b/Documentation/devicetree/bindings/arm/mediatek/mediatek,apmixedsys.txt -index 936166f..a701e19 100644 --- a/Documentation/devicetree/bindings/arm/mediatek/mediatek,apmixedsys.txt +++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,apmixedsys.txt -@@ -6,6 +6,7 @@ The Mediatek apmixedsys controller provides the PLLs to the system. +@@ -6,6 +6,7 @@ The Mediatek apmixedsys controller provi Required Properties: - compatible: Should be: @@ -37,9 +35,6 @@ index 936166f..a701e19 100644 - "mediatek,mt8135-apmixedsys" - "mediatek,mt8173-apmixedsys" - #clock-cells: Must be 1 -diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,bdpsys.txt b/Documentation/devicetree/bindings/arm/mediatek/mediatek,bdpsys.txt -new file mode 100644 -index 0000000..4137196 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,bdpsys.txt @@ -0,0 +1,22 @@ @@ -65,9 +60,6 @@ index 0000000..4137196 + reg = <0 0x1c000000 0 0x1000>; + #clock-cells = <1>; +}; -diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,ethsys.txt b/Documentation/devicetree/bindings/arm/mediatek/mediatek,ethsys.txt -new file mode 100644 -index 0000000..768f3a5 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,ethsys.txt @@ -0,0 +1,22 @@ @@ -93,9 +85,6 @@ index 0000000..768f3a5 + reg = <0 0x1b000000 0 0x1000>; + #clock-cells = <1>; +}; -diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,hifsys.txt b/Documentation/devicetree/bindings/arm/mediatek/mediatek,hifsys.txt -new file mode 100644 -index 0000000..b7a39b6 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,hifsys.txt @@ -0,0 +1,22 @@ @@ -121,11 +110,9 @@ index 0000000..b7a39b6 + reg = <0 0x1a000000 0 0x1000>; + #clock-cells = <1>; +}; -diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,imgsys.txt b/Documentation/devicetree/bindings/arm/mediatek/mediatek,imgsys.txt -index b1f2ce1..9bda7f7 100644 --- a/Documentation/devicetree/bindings/arm/mediatek/mediatek,imgsys.txt +++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,imgsys.txt -@@ -6,6 +6,7 @@ The Mediatek imgsys controller provides various clocks to the system. +@@ -6,6 +6,7 @@ The Mediatek imgsys controller provides Required Properties: - compatible: Should be: @@ -133,8 +120,6 @@ index b1f2ce1..9bda7f7 100644 - "mediatek,mt8173-imgsys", "syscon" - #clock-cells: Must be 1 -diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,infracfg.txt b/Documentation/devicetree/bindings/arm/mediatek/mediatek,infracfg.txt -index f6cd3e4..2f11a69 100644 --- a/Documentation/devicetree/bindings/arm/mediatek/mediatek,infracfg.txt +++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,infracfg.txt @@ -7,6 +7,7 @@ outputs to the system. @@ -145,11 +130,9 @@ index f6cd3e4..2f11a69 100644 - "mediatek,mt8135-infracfg", "syscon" - "mediatek,mt8173-infracfg", "syscon" - #clock-cells: Must be 1 -diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,mmsys.txt b/Documentation/devicetree/bindings/arm/mediatek/mediatek,mmsys.txt -index 4385946..c9d9d43 100644 --- a/Documentation/devicetree/bindings/arm/mediatek/mediatek,mmsys.txt +++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,mmsys.txt -@@ -6,6 +6,7 @@ The Mediatek mmsys controller provides various clocks to the system. +@@ -6,6 +6,7 @@ The Mediatek mmsys controller provides v Required Properties: - compatible: Should be: @@ -157,8 +140,6 @@ index 4385946..c9d9d43 100644 - "mediatek,mt8173-mmsys", "syscon" - #clock-cells: Must be 1 -diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,pericfg.txt b/Documentation/devicetree/bindings/arm/mediatek/mediatek,pericfg.txt -index f25b854..d3454cd 100644 --- a/Documentation/devicetree/bindings/arm/mediatek/mediatek,pericfg.txt +++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,pericfg.txt @@ -7,6 +7,7 @@ outputs to the system. @@ -169,11 +150,9 @@ index f25b854..d3454cd 100644 - "mediatek,mt8135-pericfg", "syscon" - "mediatek,mt8173-pericfg", "syscon" - #clock-cells: Must be 1 -diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,topckgen.txt b/Documentation/devicetree/bindings/arm/mediatek/mediatek,topckgen.txt -index f9e9179..602e5bc 100644 --- a/Documentation/devicetree/bindings/arm/mediatek/mediatek,topckgen.txt +++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,topckgen.txt -@@ -6,6 +6,7 @@ The Mediatek topckgen controller provides various clocks to the system. +@@ -6,6 +6,7 @@ The Mediatek topckgen controller provide Required Properties: - compatible: Should be: @@ -181,11 +160,9 @@ index f9e9179..602e5bc 100644 - "mediatek,mt8135-topckgen" - "mediatek,mt8173-topckgen" - #clock-cells: Must be 1 -diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,vdecsys.txt b/Documentation/devicetree/bindings/arm/mediatek/mediatek,vdecsys.txt -index 1faacf1..f5b1e7d 100644 --- a/Documentation/devicetree/bindings/arm/mediatek/mediatek,vdecsys.txt +++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,vdecsys.txt -@@ -6,6 +6,7 @@ The Mediatek vdecsys controller provides various clocks to the system. +@@ -6,6 +6,7 @@ The Mediatek vdecsys controller provides Required Properties: - compatible: Should be: @@ -193,6 +170,3 @@ index 1faacf1..f5b1e7d 100644 - "mediatek,mt8173-vdecsys", "syscon" - #clock-cells: Must be 1 --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0008-clk-mediatek-Add-dt-bindings-for-MT2701-clocks.patch b/target/linux/mediatek/patches-4.4/0008-clk-mediatek-Add-dt-bindings-for-MT2701-clocks.patch index 4057365849..422a5bec3a 100644 --- a/target/linux/mediatek/patches-4.4/0008-clk-mediatek-Add-dt-bindings-for-MT2701-clocks.patch +++ b/target/linux/mediatek/patches-4.4/0008-clk-mediatek-Add-dt-bindings-for-MT2701-clocks.patch @@ -13,9 +13,6 @@ Signed-off-by: James Liao 1 file changed, 481 insertions(+) create mode 100644 include/dt-bindings/clock/mt2701-clk.h -diff --git a/include/dt-bindings/clock/mt2701-clk.h b/include/dt-bindings/clock/mt2701-clk.h -new file mode 100644 -index 0000000..50972d1 --- /dev/null +++ b/include/dt-bindings/clock/mt2701-clk.h @@ -0,0 +1,481 @@ @@ -500,6 +497,3 @@ index 0000000..50972d1 +#define CLK_BDP_NR 50 + +#endif /* _DT_BINDINGS_CLK_MT2701_H */ --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0009-clk-mediatek-Add-MT2701-clock-support.patch b/target/linux/mediatek/patches-4.4/0009-clk-mediatek-Add-MT2701-clock-support.patch index 488fd3f824..6f8f68a300 100644 --- a/target/linux/mediatek/patches-4.4/0009-clk-mediatek-Add-MT2701-clock-support.patch +++ b/target/linux/mediatek/patches-4.4/0009-clk-mediatek-Add-MT2701-clock-support.patch @@ -19,8 +19,6 @@ Signed-off-by: James Liao 7 files changed, 1334 insertions(+), 3 deletions(-) create mode 100644 drivers/clk/mediatek/clk-mt2701.c -diff --git a/drivers/clk/mediatek/Kconfig b/drivers/clk/mediatek/Kconfig -index dc224e6..6c7cdc0 100644 --- a/drivers/clk/mediatek/Kconfig +++ b/drivers/clk/mediatek/Kconfig @@ -6,6 +6,14 @@ config COMMON_CLK_MEDIATEK @@ -38,8 +36,6 @@ index dc224e6..6c7cdc0 100644 config COMMON_CLK_MT8135 bool "Clock driver for Mediatek MT8135" depends on COMMON_CLK -diff --git a/drivers/clk/mediatek/Makefile b/drivers/clk/mediatek/Makefile -index 32e7222..5b2b91b 100644 --- a/drivers/clk/mediatek/Makefile +++ b/drivers/clk/mediatek/Makefile @@ -1,4 +1,5 @@ @@ -48,11 +44,9 @@ index 32e7222..5b2b91b 100644 +obj-$(CONFIG_COMMON_CLK_MT2701) += clk-mt2701.o obj-$(CONFIG_COMMON_CLK_MT8135) += clk-mt8135.o obj-$(CONFIG_COMMON_CLK_MT8173) += clk-mt8173.o -diff --git a/drivers/clk/mediatek/clk-gate.c b/drivers/clk/mediatek/clk-gate.c -index 576bdb7..38badb4 100644 --- a/drivers/clk/mediatek/clk-gate.c +++ b/drivers/clk/mediatek/clk-gate.c -@@ -61,6 +61,26 @@ static void mtk_cg_clr_bit(struct clk_hw *hw) +@@ -61,6 +61,26 @@ static void mtk_cg_clr_bit(struct clk_hw regmap_write(cg->regmap, cg->clr_ofs, BIT(cg->bit)); } @@ -79,7 +73,7 @@ index 576bdb7..38badb4 100644 static int mtk_cg_enable(struct clk_hw *hw) { mtk_cg_clr_bit(hw); -@@ -85,6 +105,30 @@ static void mtk_cg_disable_inv(struct clk_hw *hw) +@@ -85,6 +105,30 @@ static void mtk_cg_disable_inv(struct cl mtk_cg_clr_bit(hw); } @@ -110,7 +104,7 @@ index 576bdb7..38badb4 100644 const struct clk_ops mtk_clk_gate_ops_setclr = { .is_enabled = mtk_cg_bit_is_cleared, .enable = mtk_cg_enable, -@@ -97,6 +141,18 @@ const struct clk_ops mtk_clk_gate_ops_setclr_inv = { +@@ -97,6 +141,18 @@ const struct clk_ops mtk_clk_gate_ops_se .disable = mtk_cg_disable_inv, }; @@ -129,11 +123,9 @@ index 576bdb7..38badb4 100644 struct clk * __init mtk_clk_register_gate( const char *name, const char *parent_name, -diff --git a/drivers/clk/mediatek/clk-gate.h b/drivers/clk/mediatek/clk-gate.h -index 11e25c9..7f7ef34 100644 --- a/drivers/clk/mediatek/clk-gate.h +++ b/drivers/clk/mediatek/clk-gate.h -@@ -36,6 +36,8 @@ static inline struct mtk_clk_gate *to_clk_gate(struct clk_hw *hw) +@@ -36,6 +36,8 @@ static inline struct mtk_clk_gate *to_cl extern const struct clk_ops mtk_clk_gate_ops_setclr; extern const struct clk_ops mtk_clk_gate_ops_setclr_inv; @@ -142,9 +134,6 @@ index 11e25c9..7f7ef34 100644 struct clk *mtk_clk_register_gate( const char *name, -diff --git a/drivers/clk/mediatek/clk-mt2701.c b/drivers/clk/mediatek/clk-mt2701.c -new file mode 100644 -index 0000000..2f521f4 --- /dev/null +++ b/drivers/clk/mediatek/clk-mt2701.c @@ -0,0 +1,1210 @@ @@ -1358,11 +1347,9 @@ index 0000000..2f521f4 +} +CLK_OF_DECLARE(mtk_apmixedsys, "mediatek,mt2701-apmixedsys", + mtk_apmixedsys_init); -diff --git a/drivers/clk/mediatek/clk-mtk.c b/drivers/clk/mediatek/clk-mtk.c -index cf08db6..be19a41 100644 --- a/drivers/clk/mediatek/clk-mtk.c +++ b/drivers/clk/mediatek/clk-mtk.c -@@ -242,3 +242,28 @@ void __init mtk_clk_register_composites(const struct mtk_composite *mcs, +@@ -242,3 +242,28 @@ void __init mtk_clk_register_composites( clk_data->clks[mc->id] = clk; } } @@ -1391,8 +1378,6 @@ index cf08db6..be19a41 100644 + clk_data->clks[mcd->id] = clk; + } +} -diff --git a/drivers/clk/mediatek/clk-mtk.h b/drivers/clk/mediatek/clk-mtk.h -index 32d2e45..60701e8 100644 --- a/drivers/clk/mediatek/clk-mtk.h +++ b/drivers/clk/mediatek/clk-mtk.h @@ -110,7 +110,8 @@ struct mtk_composite { @@ -1444,6 +1429,3 @@ index 32d2e45..60701e8 100644 struct clk_onecell_data *mtk_alloc_clk_data(unsigned int clk_num); --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0010-reset-mediatek-mt2701-reset-controller-dt-binding-fi.patch b/target/linux/mediatek/patches-4.4/0010-reset-mediatek-mt2701-reset-controller-dt-binding-fi.patch index e2988b6b18..b5b10e7b0b 100644 --- a/target/linux/mediatek/patches-4.4/0010-reset-mediatek-mt2701-reset-controller-dt-binding-fi.patch +++ b/target/linux/mediatek/patches-4.4/0010-reset-mediatek-mt2701-reset-controller-dt-binding-fi.patch @@ -14,9 +14,6 @@ Signed-off-by: Shunli Wang 1 file changed, 74 insertions(+) create mode 100644 include/dt-bindings/reset-controller/mt2701-resets.h -diff --git a/include/dt-bindings/reset-controller/mt2701-resets.h b/include/dt-bindings/reset-controller/mt2701-resets.h -new file mode 100644 -index 0000000..00efeb0 --- /dev/null +++ b/include/dt-bindings/reset-controller/mt2701-resets.h @@ -0,0 +1,74 @@ @@ -94,6 +91,3 @@ index 0000000..00efeb0 +#define MT2701_TOPRGU_BDP_DISP_RST 13 + +#endif /* _DT_BINDINGS_RESET_CONTROLLER_MT2701 */ --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0011-reset-mediatek-mt2701-reset-driver.patch b/target/linux/mediatek/patches-4.4/0011-reset-mediatek-mt2701-reset-driver.patch index e69c043741..18d4fbf252 100644 --- a/target/linux/mediatek/patches-4.4/0011-reset-mediatek-mt2701-reset-driver.patch +++ b/target/linux/mediatek/patches-4.4/0011-reset-mediatek-mt2701-reset-driver.patch @@ -14,11 +14,9 @@ Acked-by: Philipp Zabel drivers/clk/mediatek/clk-mt2701.c | 4 ++++ 1 file changed, 4 insertions(+) -diff --git a/drivers/clk/mediatek/clk-mt2701.c b/drivers/clk/mediatek/clk-mt2701.c -index 2f521f4..39472e4 100644 --- a/drivers/clk/mediatek/clk-mt2701.c +++ b/drivers/clk/mediatek/clk-mt2701.c -@@ -665,6 +665,8 @@ static void __init mtk_infrasys_init(struct device_node *node) +@@ -665,6 +665,8 @@ static void __init mtk_infrasys_init(str if (r) pr_err("%s(): could not register clock provider: %d\n", __func__, r); @@ -27,7 +25,7 @@ index 2f521f4..39472e4 100644 } CLK_OF_DECLARE(mtk_infrasys, "mediatek,mt2701-infracfg", mtk_infrasys_init); -@@ -782,6 +784,8 @@ static void __init mtk_pericfg_init(struct device_node *node) +@@ -782,6 +784,8 @@ static void __init mtk_pericfg_init(stru if (r) pr_err("%s(): could not register clock provider: %d\n", __func__, r); @@ -36,6 +34,3 @@ index 2f521f4..39472e4 100644 } CLK_OF_DECLARE(mtk_pericfg, "mediatek,mt2701-pericfg", mtk_pericfg_init); --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0012-ARM-mediatek-Add-MT2701-config-options-for-mediatek-.patch b/target/linux/mediatek/patches-4.4/0012-ARM-mediatek-Add-MT2701-config-options-for-mediatek-.patch index 8d699eb880..479334a92d 100644 --- a/target/linux/mediatek/patches-4.4/0012-ARM-mediatek-Add-MT2701-config-options-for-mediatek-.patch +++ b/target/linux/mediatek/patches-4.4/0012-ARM-mediatek-Add-MT2701-config-options-for-mediatek-.patch @@ -14,8 +14,6 @@ Acked-by: Linus Walleij arch/arm/mach-mediatek/Kconfig | 4 ++++ 1 file changed, 4 insertions(+) -diff --git a/arch/arm/mach-mediatek/Kconfig b/arch/arm/mach-mediatek/Kconfig -index aeece17..37dd438 100644 --- a/arch/arm/mach-mediatek/Kconfig +++ b/arch/arm/mach-mediatek/Kconfig @@ -9,6 +9,10 @@ menuconfig ARCH_MEDIATEK @@ -29,6 +27,3 @@ index aeece17..37dd438 100644 config MACH_MT6589 bool "MediaTek MT6589 SoCs support" default ARCH_MEDIATEK --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0013-dt-bindings-mediatek-Modify-pinctrl-bindings-for-mt2.patch b/target/linux/mediatek/patches-4.4/0013-dt-bindings-mediatek-Modify-pinctrl-bindings-for-mt2.patch index 8308771aa1..af1ad668f5 100644 --- a/target/linux/mediatek/patches-4.4/0013-dt-bindings-mediatek-Modify-pinctrl-bindings-for-mt2.patch +++ b/target/linux/mediatek/patches-4.4/0013-dt-bindings-mediatek-Modify-pinctrl-bindings-for-mt2.patch @@ -11,11 +11,9 @@ Reviewed-by: Mathias Brugger Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt -index 0480bc3..9ffb0b2 100644 --- a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt -@@ -4,10 +4,11 @@ The Mediatek's Pin controller is used to control SoC pins. +@@ -4,10 +4,11 @@ The Mediatek's Pin controller is used to Required properties: - compatible: value should be one of the following. @@ -31,6 +29,3 @@ index 0480bc3..9ffb0b2 100644 - pins-are-numbered: Specify the subnodes are using numbered pinmux to specify pins. - gpio-controller : Marks the device node as a gpio controller. --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0014-pinctrl-dt-bindings-Add-pinfunc-header-file-for-mt27.patch b/target/linux/mediatek/patches-4.4/0014-pinctrl-dt-bindings-Add-pinfunc-header-file-for-mt27.patch index 38e3eaeb61..0df6d186ba 100644 --- a/target/linux/mediatek/patches-4.4/0014-pinctrl-dt-bindings-Add-pinfunc-header-file-for-mt27.patch +++ b/target/linux/mediatek/patches-4.4/0014-pinctrl-dt-bindings-Add-pinfunc-header-file-for-mt27.patch @@ -21,9 +21,6 @@ Acked-by: Linus Walleij create mode 100644 drivers/pinctrl/mediatek/pinctrl-mt2701.c create mode 100644 drivers/pinctrl/mediatek/pinctrl-mtk-mt2701.h -diff --git a/arch/arm/boot/dts/mt2701-pinfunc.h b/arch/arm/boot/dts/mt2701-pinfunc.h -new file mode 100644 -index 0000000..e24ebc8 --- /dev/null +++ b/arch/arm/boot/dts/mt2701-pinfunc.h @@ -0,0 +1,735 @@ @@ -762,8 +759,6 @@ index 0000000..e24ebc8 +#define MT2701_PIN_278_JTAG_RESET__FUNC_JTAG_RESET (MTK_PIN_NO(278) | 1) + +#endif /* __DTS_MT2701_PINFUNC_H */ -diff --git a/drivers/pinctrl/mediatek/Kconfig b/drivers/pinctrl/mediatek/Kconfig -index 02f6f92..13e9939 100644 --- a/drivers/pinctrl/mediatek/Kconfig +++ b/drivers/pinctrl/mediatek/Kconfig @@ -9,6 +9,12 @@ config PINCTRL_MTK_COMMON @@ -779,8 +774,6 @@ index 02f6f92..13e9939 100644 config PINCTRL_MT8135 bool "Mediatek MT8135 pin control" if COMPILE_TEST && !MACH_MT8135 depends on OF -diff --git a/drivers/pinctrl/mediatek/Makefile b/drivers/pinctrl/mediatek/Makefile -index eb923d6..da30314 100644 --- a/drivers/pinctrl/mediatek/Makefile +++ b/drivers/pinctrl/mediatek/Makefile @@ -2,6 +2,7 @@ @@ -791,9 +784,6 @@ index eb923d6..da30314 100644 obj-$(CONFIG_PINCTRL_MT8135) += pinctrl-mt8135.o obj-$(CONFIG_PINCTRL_MT8127) += pinctrl-mt8127.o obj-$(CONFIG_PINCTRL_MT8173) += pinctrl-mt8173.o -diff --git a/drivers/pinctrl/mediatek/pinctrl-mt2701.c b/drivers/pinctrl/mediatek/pinctrl-mt2701.c -new file mode 100644 -index 0000000..4861b5d --- /dev/null +++ b/drivers/pinctrl/mediatek/pinctrl-mt2701.c @@ -0,0 +1,586 @@ @@ -1383,8 +1373,6 @@ index 0000000..4861b5d +} + +arch_initcall(mtk_pinctrl_init); -diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c -index 5c71727..05ba7a8 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c @@ -47,6 +47,8 @@ @@ -1396,7 +1384,7 @@ index 5c71727..05ba7a8 100644 }; /* -@@ -81,6 +83,9 @@ static int mtk_pmx_gpio_set_direction(struct pinctrl_dev *pctldev, +@@ -81,6 +83,9 @@ static int mtk_pmx_gpio_set_direction(st reg_addr = mtk_get_port(pctl, offset) + pctl->devdata->dir_offset; bit = BIT(offset & 0xf); @@ -1406,7 +1394,7 @@ index 5c71727..05ba7a8 100644 if (input) /* Different SoC has different alignment offset. */ reg_addr = CLR_ADDR(reg_addr, pctl); -@@ -347,6 +352,7 @@ static int mtk_pconf_parse_conf(struct pinctrl_dev *pctldev, +@@ -347,6 +352,7 @@ static int mtk_pconf_parse_conf(struct p ret = mtk_pconf_set_pull_select(pctl, pin, true, false, arg); break; case PIN_CONFIG_INPUT_ENABLE: @@ -1414,7 +1402,7 @@ index 5c71727..05ba7a8 100644 ret = mtk_pconf_set_ies_smt(pctl, pin, arg, param); break; case PIN_CONFIG_OUTPUT: -@@ -354,6 +360,7 @@ static int mtk_pconf_parse_conf(struct pinctrl_dev *pctldev, +@@ -354,6 +360,7 @@ static int mtk_pconf_parse_conf(struct p ret = mtk_pmx_gpio_set_direction(pctldev, NULL, pin, false); break; case PIN_CONFIG_INPUT_SCHMITT_ENABLE: @@ -1422,7 +1410,7 @@ index 5c71727..05ba7a8 100644 ret = mtk_pconf_set_ies_smt(pctl, pin, arg, param); break; case PIN_CONFIG_DRIVE_STRENGTH: -@@ -667,9 +674,14 @@ static int mtk_pmx_set_mode(struct pinctrl_dev *pctldev, +@@ -667,9 +674,14 @@ static int mtk_pmx_set_mode(struct pinct unsigned int mask = (1L << GPIO_MODE_BITS) - 1; struct mtk_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); @@ -1437,7 +1425,7 @@ index 5c71727..05ba7a8 100644 bit = pin % MAX_GPIO_MODE_PER_REG; mask <<= (GPIO_MODE_BITS * bit); val = (mode << (GPIO_MODE_BITS * bit)); -@@ -746,6 +758,10 @@ static int mtk_gpio_get_direction(struct gpio_chip *chip, unsigned offset) +@@ -746,6 +758,10 @@ static int mtk_gpio_get_direction(struct reg_addr = mtk_get_port(pctl, offset) + pctl->devdata->dir_offset; bit = BIT(offset & 0xf); @@ -1448,8 +1436,6 @@ index 5c71727..05ba7a8 100644 regmap_read(pctl->regmap1, reg_addr, &read_val); return !(read_val & bit); } -diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.h b/drivers/pinctrl/mediatek/pinctrl-mtk-common.h -index 55a5343..8543bc4 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.h +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.h @@ -209,7 +209,14 @@ struct mtk_eint_offsets { @@ -1478,9 +1464,6 @@ index 55a5343..8543bc4 100644 unsigned int dir_offset; unsigned int ies_offset; unsigned int smt_offset; -diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-mt2701.h b/drivers/pinctrl/mediatek/pinctrl-mtk-mt2701.h -new file mode 100644 -index 0000000..f906420 --- /dev/null +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-mt2701.h @@ -0,0 +1,2323 @@ @@ -3807,6 +3790,3 @@ index 0000000..f906420 +}; + +#endif /* __PINCTRL_MTK_MT2701_H */ --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0015-dt-bindings-mediatek-Modify-pinctrl-bindings-for-mt7.patch b/target/linux/mediatek/patches-4.4/0015-dt-bindings-mediatek-Modify-pinctrl-bindings-for-mt7.patch index 7fed07c3bc..fcd39c487d 100644 --- a/target/linux/mediatek/patches-4.4/0015-dt-bindings-mediatek-Modify-pinctrl-bindings-for-mt7.patch +++ b/target/linux/mediatek/patches-4.4/0015-dt-bindings-mediatek-Modify-pinctrl-bindings-for-mt7.patch @@ -11,8 +11,6 @@ Signed-off-by: John Crispin 2 files changed, 522 insertions(+) create mode 100644 include/dt-bindings/pinctrl/mt7623-pinfunc.h -diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt -index 9ffb0b2..17631d0 100644 --- a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt @@ -6,6 +6,7 @@ Required properties: @@ -23,9 +21,6 @@ index 9ffb0b2..17631d0 100644 "mediatek,mt8127-pinctrl", compatible with mt8127 pinctrl. "mediatek,mt8135-pinctrl", compatible with mt8135 pinctrl. "mediatek,mt8173-pinctrl", compatible with mt8173 pinctrl. -diff --git a/include/dt-bindings/pinctrl/mt7623-pinfunc.h b/include/dt-bindings/pinctrl/mt7623-pinfunc.h -new file mode 100644 -index 0000000..891b173 --- /dev/null +++ b/include/dt-bindings/pinctrl/mt7623-pinfunc.h @@ -0,0 +1,521 @@ @@ -550,6 +545,3 @@ index 0000000..891b173 + +#endif /* __DTS_MT7623_PINFUNC_H */ + --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0016-pinctrl-dt-bindings-Add-pinctrl-file-for-mt7623.patch b/target/linux/mediatek/patches-4.4/0016-pinctrl-dt-bindings-Add-pinctrl-file-for-mt7623.patch index e4440828fb..3428fce39c 100644 --- a/target/linux/mediatek/patches-4.4/0016-pinctrl-dt-bindings-Add-pinctrl-file-for-mt7623.patch +++ b/target/linux/mediatek/patches-4.4/0016-pinctrl-dt-bindings-Add-pinctrl-file-for-mt7623.patch @@ -17,8 +17,6 @@ Signed-off-by: John Crispin create mode 100644 drivers/pinctrl/mediatek/pinctrl-mt7623.c create mode 100644 drivers/pinctrl/mediatek/pinctrl-mtk-mt7623.h -diff --git a/drivers/pinctrl/mediatek/Kconfig b/drivers/pinctrl/mediatek/Kconfig -index 13e9939..78654a8 100644 --- a/drivers/pinctrl/mediatek/Kconfig +++ b/drivers/pinctrl/mediatek/Kconfig @@ -15,6 +15,12 @@ config PINCTRL_MT2701 @@ -34,11 +32,9 @@ index 13e9939..78654a8 100644 config PINCTRL_MT8135 bool "Mediatek MT8135 pin control" if COMPILE_TEST && !MACH_MT8135 depends on OF -diff --git a/drivers/pinctrl/mediatek/Makefile b/drivers/pinctrl/mediatek/Makefile -index da30314..1be2f3f 100644 --- a/drivers/pinctrl/mediatek/Makefile +++ b/drivers/pinctrl/mediatek/Makefile -@@ -3,6 +3,7 @@ obj-$(CONFIG_PINCTRL_MTK_COMMON) += pinctrl-mtk-common.o +@@ -3,6 +3,7 @@ obj-$(CONFIG_PINCTRL_MTK_COMMON) += pinc # SoC Drivers obj-$(CONFIG_PINCTRL_MT2701) += pinctrl-mt2701.o @@ -46,9 +42,6 @@ index da30314..1be2f3f 100644 obj-$(CONFIG_PINCTRL_MT8135) += pinctrl-mt8135.o obj-$(CONFIG_PINCTRL_MT8127) += pinctrl-mt8127.o obj-$(CONFIG_PINCTRL_MT8173) += pinctrl-mt8173.o -diff --git a/drivers/pinctrl/mediatek/pinctrl-mt7623.c b/drivers/pinctrl/mediatek/pinctrl-mt7623.c -new file mode 100644 -index 0000000..bf0d05b --- /dev/null +++ b/drivers/pinctrl/mediatek/pinctrl-mt7623.c @@ -0,0 +1,380 @@ @@ -432,9 +425,6 @@ index 0000000..bf0d05b +} + +arch_initcall(mtk_pinctrl_init); -diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-mt7623.h b/drivers/pinctrl/mediatek/pinctrl-mtk-mt7623.h -new file mode 100644 -index 0000000..fb63c01 --- /dev/null +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-mt7623.h @@ -0,0 +1,1937 @@ @@ -2375,8 +2365,6 @@ index 0000000..fb63c01 +}; + +#endif /* __PINCTRL_MTK_MT7623_H */ -diff --git a/include/dt-bindings/pinctrl/mt7623-pinfunc.h b/include/dt-bindings/pinctrl/mt7623-pinfunc.h -index 891b173..eeb2380 100644 --- a/include/dt-bindings/pinctrl/mt7623-pinfunc.h +++ b/include/dt-bindings/pinctrl/mt7623-pinfunc.h @@ -505,6 +505,9 @@ @@ -2389,6 +2377,3 @@ index 891b173..eeb2380 100644 #define MT7623_PIN_274_G2_RXDV_FUNC_GPIO274 (MTK_PIN_NO(274) | 0) #define MT7623_PIN_274_G2_RXDV_FUNC_G2_RXDV (MTK_PIN_NO(274) | 1) --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0017-clk-add-hifsys-reset.patch b/target/linux/mediatek/patches-4.4/0017-clk-add-hifsys-reset.patch index d443971aa7..d7d151cedb 100644 --- a/target/linux/mediatek/patches-4.4/0017-clk-add-hifsys-reset.patch +++ b/target/linux/mediatek/patches-4.4/0017-clk-add-hifsys-reset.patch @@ -18,11 +18,9 @@ Signed-off-by: John Crispin include/dt-bindings/reset-controller/mt2701-resets.h | 9 +++++++++ 2 files changed, 11 insertions(+) -diff --git a/drivers/clk/mediatek/clk-mt2701.c b/drivers/clk/mediatek/clk-mt2701.c -index 39472e4..0e40bb8 100644 --- a/drivers/clk/mediatek/clk-mt2701.c +++ b/drivers/clk/mediatek/clk-mt2701.c -@@ -1000,6 +1000,8 @@ static void __init mtk_hifsys_init(struct device_node *node) +@@ -1000,6 +1000,8 @@ static void __init mtk_hifsys_init(struc if (r) pr_err("%s(): could not register clock provider: %d\n", __func__, r); @@ -31,8 +29,6 @@ index 39472e4..0e40bb8 100644 } CLK_OF_DECLARE(mtk_hifsys, "mediatek,mt2701-hifsys", mtk_hifsys_init); -diff --git a/include/dt-bindings/reset-controller/mt2701-resets.h b/include/dt-bindings/reset-controller/mt2701-resets.h -index 00efeb0..aaf0305 100644 --- a/include/dt-bindings/reset-controller/mt2701-resets.h +++ b/include/dt-bindings/reset-controller/mt2701-resets.h @@ -71,4 +71,13 @@ @@ -49,6 +45,3 @@ index 00efeb0..aaf0305 100644 +#define MT2701_HIFSYS_PCIE2_RST 26 + #endif /* _DT_BINDINGS_RESET_CONTROLLER_MT2701 */ --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0018-dt-bindings-Add-a-binding-for-Mediatek-xHCI-host-con.patch b/target/linux/mediatek/patches-4.4/0018-dt-bindings-Add-a-binding-for-Mediatek-xHCI-host-con.patch index 357ef7ef05..9c178f2918 100644 --- a/target/linux/mediatek/patches-4.4/0018-dt-bindings-Add-a-binding-for-Mediatek-xHCI-host-con.patch +++ b/target/linux/mediatek/patches-4.4/0018-dt-bindings-Add-a-binding-for-Mediatek-xHCI-host-con.patch @@ -13,9 +13,6 @@ Signed-off-by: Chunfeng Yun 1 file changed, 51 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/mt8173-xhci.txt -diff --git a/Documentation/devicetree/bindings/usb/mt8173-xhci.txt b/Documentation/devicetree/bindings/usb/mt8173-xhci.txt -new file mode 100644 -index 0000000..a78f20b --- /dev/null +++ b/Documentation/devicetree/bindings/usb/mt8173-xhci.txt @@ -0,0 +1,51 @@ @@ -70,6 +67,3 @@ index 0000000..a78f20b + mediatek,syscon-wakeup = <&pericfg>; + mediatek,wakeup-src = <1>; +}; --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0019-xhci-mediatek-support-MTK-xHCI-host-controller.patch b/target/linux/mediatek/patches-4.4/0019-xhci-mediatek-support-MTK-xHCI-host-controller.patch index a7dd38a643..f344be6fdd 100644 --- a/target/linux/mediatek/patches-4.4/0019-xhci-mediatek-support-MTK-xHCI-host-controller.patch +++ b/target/linux/mediatek/patches-4.4/0019-xhci-mediatek-support-MTK-xHCI-host-controller.patch @@ -31,8 +31,6 @@ Reviewed-by: Daniel Thompson create mode 100644 drivers/usb/host/xhci-mtk.c create mode 100644 drivers/usb/host/xhci-mtk.h -diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig -index 3bb0887..daa563f 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -41,6 +41,15 @@ config USB_XHCI_PLATFORM @@ -51,8 +49,6 @@ index 3bb0887..daa563f 100644 config USB_XHCI_MVEBU tristate "xHCI support for Marvell Armada 375/38x" select USB_XHCI_PLATFORM -diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile -index e7558ab..65a06b4 100644 --- a/drivers/usb/host/Makefile +++ b/drivers/usb/host/Makefile @@ -13,6 +13,9 @@ fhci-$(CONFIG_FHCI_DEBUG) += fhci-dbg.o @@ -73,9 +69,6 @@ index e7558ab..65a06b4 100644 obj-$(CONFIG_USB_SL811_HCD) += sl811-hcd.o obj-$(CONFIG_USB_SL811_CS) += sl811_cs.o obj-$(CONFIG_USB_U132_HCD) += u132-hcd.o -diff --git a/drivers/usb/host/xhci-mtk-sch.c b/drivers/usb/host/xhci-mtk-sch.c -new file mode 100644 -index 0000000..c30de7c --- /dev/null +++ b/drivers/usb/host/xhci-mtk-sch.c @@ -0,0 +1,415 @@ @@ -494,9 +487,6 @@ index 0000000..c30de7c + } +} +EXPORT_SYMBOL_GPL(xhci_mtk_drop_ep_quirk); -diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c -new file mode 100644 -index 0000000..c9ab6a4 --- /dev/null +++ b/drivers/usb/host/xhci-mtk.c @@ -0,0 +1,763 @@ @@ -1263,9 +1253,6 @@ index 0000000..c9ab6a4 +MODULE_AUTHOR("Chunfeng Yun "); +MODULE_DESCRIPTION("MediaTek xHCI Host Controller Driver"); +MODULE_LICENSE("GPL v2"); -diff --git a/drivers/usb/host/xhci-mtk.h b/drivers/usb/host/xhci-mtk.h -new file mode 100644 -index 0000000..7da677c --- /dev/null +++ b/drivers/usb/host/xhci-mtk.h @@ -0,0 +1,162 @@ @@ -1431,8 +1418,6 @@ index 0000000..7da677c +#endif + +#endif /* _XHCI_MTK_H_ */ -diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c -index eeaa6c6..f1c21c4 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -68,6 +68,7 @@ @@ -1443,7 +1428,7 @@ index eeaa6c6..f1c21c4 100644 /* * Returns zero if the TRB isn't in this segment, otherwise it returns the DMA -@@ -3075,17 +3076,22 @@ static u32 xhci_td_remainder(struct xhci_hcd *xhci, int transferred, +@@ -3065,17 +3066,22 @@ static u32 xhci_td_remainder(struct xhci { u32 maxp, total_packet_count; @@ -1470,7 +1455,7 @@ index eeaa6c6..f1c21c4 100644 /* Queueing functions don't count the current TRB into transferred */ return (total_packet_count - ((transferred + trb_buff_len) / maxp)); } -@@ -3473,7 +3479,7 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags, +@@ -3463,7 +3469,7 @@ int xhci_queue_ctrl_tx(struct xhci_hcd * field |= 0x1; /* xHCI 1.0/1.1 6.4.1.2.1: Transfer Type field */ @@ -1479,8 +1464,6 @@ index eeaa6c6..f1c21c4 100644 if (urb->transfer_buffer_length > 0) { if (setup->bRequestType & USB_DIR_IN) field |= TRB_TX_TYPE(TRB_DATA_IN); -diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c -index 3f91270..15fedb2 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -31,6 +31,7 @@ @@ -1491,7 +1474,7 @@ index 3f91270..15fedb2 100644 #define DRIVER_AUTHOR "Sarah Sharp" #define DRIVER_DESC "'eXtensible' Host Controller (xHC) Driver" -@@ -634,7 +635,11 @@ int xhci_run(struct usb_hcd *hcd) +@@ -635,7 +636,11 @@ int xhci_run(struct usb_hcd *hcd) "// Set the interrupt modulation register"); temp = readl(&xhci->ir_set->irq_control); temp &= ~ER_IRQ_INTERVAL_MASK; @@ -1504,7 +1487,7 @@ index 3f91270..15fedb2 100644 writel(temp, &xhci->ir_set->irq_control); /* Set the HCD state before we enable the irqs */ -@@ -1698,6 +1703,9 @@ int xhci_drop_endpoint(struct usb_hcd *hcd, struct usb_device *udev, +@@ -1701,6 +1706,9 @@ int xhci_drop_endpoint(struct usb_hcd *h xhci_endpoint_zero(xhci, xhci->devs[udev->slot_id], ep); @@ -1514,7 +1497,7 @@ index 3f91270..15fedb2 100644 xhci_dbg(xhci, "drop ep 0x%x, slot id %d, new drop flags = %#x, new add flags = %#x\n", (unsigned int) ep->desc.bEndpointAddress, udev->slot_id, -@@ -1793,6 +1801,15 @@ int xhci_add_endpoint(struct usb_hcd *hcd, struct usb_device *udev, +@@ -1796,6 +1804,15 @@ int xhci_add_endpoint(struct usb_hcd *hc return -ENOMEM; } @@ -1530,11 +1513,9 @@ index 3f91270..15fedb2 100644 ctrl_ctx->add_flags |= cpu_to_le32(added_ctxs); new_add_flags = le32_to_cpu(ctrl_ctx->add_flags); -diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h -index 0b94512..40cf36e 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h -@@ -1630,6 +1630,7 @@ struct xhci_hcd { +@@ -1631,6 +1631,7 @@ struct xhci_hcd { /* For controllers with a broken beyond repair streams implementation */ #define XHCI_BROKEN_STREAMS (1 << 19) #define XHCI_PME_STUCK_QUIRK (1 << 20) @@ -1542,6 +1523,3 @@ index 0b94512..40cf36e 100644 unsigned int num_active_eps; unsigned int limit_active_eps; /* There are two roothubs to keep track of bus suspend info for */ --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0020-arm64-dts-mediatek-add-xHCI-usb-phy-for-mt8173.patch b/target/linux/mediatek/patches-4.4/0020-arm64-dts-mediatek-add-xHCI-usb-phy-for-mt8173.patch index 5a5476f8bf..50c03ee892 100644 --- a/target/linux/mediatek/patches-4.4/0020-arm64-dts-mediatek-add-xHCI-usb-phy-for-mt8173.patch +++ b/target/linux/mediatek/patches-4.4/0020-arm64-dts-mediatek-add-xHCI-usb-phy-for-mt8173.patch @@ -11,8 +11,6 @@ Signed-off-by: Chunfeng Yun arch/arm64/boot/dts/mediatek/mt8173.dtsi | 42 +++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) -diff --git a/arch/arm64/boot/dts/mediatek/mt8173-evb.dts b/arch/arm64/boot/dts/mediatek/mt8173-evb.dts -index 811cb76..9b1482a 100644 --- a/arch/arm64/boot/dts/mediatek/mt8173-evb.dts +++ b/arch/arm64/boot/dts/mediatek/mt8173-evb.dts @@ -13,6 +13,7 @@ @@ -49,8 +47,6 @@ index 811cb76..9b1482a 100644 + vbus-supply = <&usb_p1_vbus>; + mediatek,wakeup-src = <1>; +}; -diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi -index 4dd5f93..c1fd275 100644 --- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi @@ -14,6 +14,7 @@ @@ -109,6 +105,3 @@ index 4dd5f93..c1fd275 100644 mmsys: clock-controller@14000000 { compatible = "mediatek,mt8173-mmsys", "syscon"; reg = <0 0x14000000 0 0x1000>; --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0021-Document-DT-Add-bindings-for-mediatek-MT7623-SoC-Pla.patch b/target/linux/mediatek/patches-4.4/0021-Document-DT-Add-bindings-for-mediatek-MT7623-SoC-Pla.patch index 5fdfc04a3d..223c2263f3 100644 --- a/target/linux/mediatek/patches-4.4/0021-Document-DT-Add-bindings-for-mediatek-MT7623-SoC-Pla.patch +++ b/target/linux/mediatek/patches-4.4/0021-Document-DT-Add-bindings-for-mediatek-MT7623-SoC-Pla.patch @@ -13,8 +13,6 @@ Signed-off-by: John Crispin Documentation/devicetree/bindings/timer/mediatek,mtk-timer.txt | 1 + 3 files changed, 6 insertions(+) -diff --git a/Documentation/devicetree/bindings/arm/mediatek.txt b/Documentation/devicetree/bindings/arm/mediatek.txt -index 618a9199..40e9d32 100644 --- a/Documentation/devicetree/bindings/arm/mediatek.txt +++ b/Documentation/devicetree/bindings/arm/mediatek.txt @@ -10,6 +10,7 @@ compatible: Must contain one of @@ -35,8 +33,6 @@ index 618a9199..40e9d32 100644 - MTK mt8127 tablet moose EVB: Required root node properties: - compatible = "mediatek,mt8127-moose", "mediatek,mt8127"; -diff --git a/Documentation/devicetree/bindings/serial/mtk-uart.txt b/Documentation/devicetree/bindings/serial/mtk-uart.txt -index 2d47add..474f0cf 100644 --- a/Documentation/devicetree/bindings/serial/mtk-uart.txt +++ b/Documentation/devicetree/bindings/serial/mtk-uart.txt @@ -2,6 +2,7 @@ @@ -47,8 +43,6 @@ index 2d47add..474f0cf 100644 * "mediatek,mt8135-uart" for MT8135 compatible UARTS * "mediatek,mt8127-uart" for MT8127 compatible UARTS * "mediatek,mt8173-uart" for MT8173 compatible UARTS -diff --git a/Documentation/devicetree/bindings/timer/mediatek,mtk-timer.txt b/Documentation/devicetree/bindings/timer/mediatek,mtk-timer.txt -index 64083bc..6bacda1b3 100644 --- a/Documentation/devicetree/bindings/timer/mediatek,mtk-timer.txt +++ b/Documentation/devicetree/bindings/timer/mediatek,mtk-timer.txt @@ -5,6 +5,7 @@ Required properties: @@ -59,6 +53,3 @@ index 64083bc..6bacda1b3 100644 * "mediatek,mt8127-timer" for MT8127 compatible timers * "mediatek,mt8135-timer" for MT8135 compatible timers * "mediatek,mt8173-timer" for MT8173 compatible timers --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0022-soc-mediatek-add-compat-string-for-mt7623-to-scpsys.patch b/target/linux/mediatek/patches-4.4/0022-soc-mediatek-add-compat-string-for-mt7623-to-scpsys.patch index 282686cbbe..453b61288a 100644 --- a/target/linux/mediatek/patches-4.4/0022-soc-mediatek-add-compat-string-for-mt7623-to-scpsys.patch +++ b/target/linux/mediatek/patches-4.4/0022-soc-mediatek-add-compat-string-for-mt7623-to-scpsys.patch @@ -9,11 +9,9 @@ Signed-off-by: John Crispin drivers/soc/mediatek/mtk-scpsys-mt2701.c | 2 ++ 1 file changed, 2 insertions(+) -diff --git a/drivers/soc/mediatek/mtk-scpsys-mt2701.c b/drivers/soc/mediatek/mtk-scpsys-mt2701.c -index 339d5b8..3a31946 100644 --- a/drivers/soc/mediatek/mtk-scpsys-mt2701.c +++ b/drivers/soc/mediatek/mtk-scpsys-mt2701.c -@@ -136,6 +136,8 @@ static const struct of_device_id of_scpsys_match_tbl[] = { +@@ -136,6 +136,8 @@ static const struct of_device_id of_scps { .compatible = "mediatek,mt2701-scpsys", }, { @@ -22,6 +20,3 @@ index 339d5b8..3a31946 100644 /* sentinel */ } }; --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0023-ARM-dts-mediatek-add-MT7623-basic-support.patch b/target/linux/mediatek/patches-4.4/0023-ARM-dts-mediatek-add-MT7623-basic-support.patch index 22cd1edbca..5be3b27eb2 100644 --- a/target/linux/mediatek/patches-4.4/0023-ARM-dts-mediatek-add-MT7623-basic-support.patch +++ b/target/linux/mediatek/patches-4.4/0023-ARM-dts-mediatek-add-MT7623-basic-support.patch @@ -16,8 +16,6 @@ Signed-off-by: John Crispin create mode 100644 arch/arm/boot/dts/mt7623-evb.dts create mode 100644 arch/arm/boot/dts/mt7623.dtsi -diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile -index 30bbc37..2bce370 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -774,6 +774,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \ @@ -28,9 +26,6 @@ index 30bbc37..2bce370 100644 mt8127-moose.dtb \ mt8135-evbp1.dtb dtb-$(CONFIG_ARCH_ZX) += zx296702-ad1.dtb -diff --git a/arch/arm/boot/dts/mt7623-evb.dts b/arch/arm/boot/dts/mt7623-evb.dts -new file mode 100644 -index 0000000..5ad1448 --- /dev/null +++ b/arch/arm/boot/dts/mt7623-evb.dts @@ -0,0 +1,421 @@ @@ -455,9 +450,6 @@ index 0000000..5ad1448 + mediatek,reset-pin = <&pio 15 0>; + status = "okay"; +}; -diff --git a/arch/arm/boot/dts/mt7623.dtsi b/arch/arm/boot/dts/mt7623.dtsi -new file mode 100644 -index 0000000..cbbdf16 --- /dev/null +++ b/arch/arm/boot/dts/mt7623.dtsi @@ -0,0 +1,601 @@ @@ -1062,8 +1054,6 @@ index 0000000..cbbdf16 + status = "disabled"; + }; +}; -diff --git a/arch/arm/mach-mediatek/Kconfig b/arch/arm/mach-mediatek/Kconfig -index 37dd438..7fb605e 100644 --- a/arch/arm/mach-mediatek/Kconfig +++ b/arch/arm/mach-mediatek/Kconfig @@ -21,6 +21,10 @@ config MACH_MT6592 @@ -1077,11 +1067,9 @@ index 37dd438..7fb605e 100644 config MACH_MT8127 bool "MediaTek MT8127 SoCs support" default ARCH_MEDIATEK -diff --git a/arch/arm/mach-mediatek/mediatek.c b/arch/arm/mach-mediatek/mediatek.c -index d019a08..bcfca37 100644 --- a/arch/arm/mach-mediatek/mediatek.c +++ b/arch/arm/mach-mediatek/mediatek.c -@@ -46,6 +46,7 @@ static void __init mediatek_timer_init(void) +@@ -46,6 +46,7 @@ static void __init mediatek_timer_init(v static const char * const mediatek_board_dt_compat[] = { "mediatek,mt6589", "mediatek,mt6592", @@ -1089,6 +1077,3 @@ index d019a08..bcfca37 100644 "mediatek,mt8127", "mediatek,mt8135", NULL, --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0024-dt-bindings-add-MediaTek-PCIe-binding-documentation.patch b/target/linux/mediatek/patches-4.4/0024-dt-bindings-add-MediaTek-PCIe-binding-documentation.patch index 0df02b6ae6..d6fe977793 100644 --- a/target/linux/mediatek/patches-4.4/0024-dt-bindings-add-MediaTek-PCIe-binding-documentation.patch +++ b/target/linux/mediatek/patches-4.4/0024-dt-bindings-add-MediaTek-PCIe-binding-documentation.patch @@ -9,9 +9,6 @@ Signed-off-by: John Crispin 1 file changed, 140 insertions(+) create mode 100644 Documentation/devicetree/bindings/pci/mediatek-pcie.txt -diff --git a/Documentation/devicetree/bindings/pci/mediatek-pcie.txt b/Documentation/devicetree/bindings/pci/mediatek-pcie.txt -new file mode 100644 -index 0000000..8fea3ed --- /dev/null +++ b/Documentation/devicetree/bindings/pci/mediatek-pcie.txt @@ -0,0 +1,140 @@ @@ -155,6 +152,3 @@ index 0000000..8fea3ed + status = "okay"; + }; + }; --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0025-PCI-mediatek-add-support-for-PCIe-found-on-MT7623-MT.patch b/target/linux/mediatek/patches-4.4/0025-PCI-mediatek-add-support-for-PCIe-found-on-MT7623-MT.patch index 5079c2b569..bcb109d6a9 100644 --- a/target/linux/mediatek/patches-4.4/0025-PCI-mediatek-add-support-for-PCIe-found-on-MT7623-MT.patch +++ b/target/linux/mediatek/patches-4.4/0025-PCI-mediatek-add-support-for-PCIe-found-on-MT7623-MT.patch @@ -17,8 +17,6 @@ Signed-off-by: John Crispin 4 files changed, 654 insertions(+) create mode 100644 drivers/pci/host/pcie-mediatek.c -diff --git a/arch/arm/mach-mediatek/Kconfig b/arch/arm/mach-mediatek/Kconfig -index 7fb605e..a7fef77 100644 --- a/arch/arm/mach-mediatek/Kconfig +++ b/arch/arm/mach-mediatek/Kconfig @@ -24,6 +24,7 @@ config MACH_MT6592 @@ -29,11 +27,9 @@ index 7fb605e..a7fef77 100644 config MACH_MT8127 bool "MediaTek MT8127 SoCs support" -diff --git a/drivers/pci/host/Kconfig b/drivers/pci/host/Kconfig -index f131ba9..912f0e1 100644 --- a/drivers/pci/host/Kconfig +++ b/drivers/pci/host/Kconfig -@@ -172,4 +172,15 @@ config PCI_HISI +@@ -173,4 +173,15 @@ config PCI_HISI help Say Y here if you want PCIe controller support on HiSilicon HIP05 SoC @@ -49,18 +45,13 @@ index f131ba9..912f0e1 100644 + PCIe include one Host/PCI bridge and 3 PCIe MAC. + endmenu -diff --git a/drivers/pci/host/Makefile b/drivers/pci/host/Makefile -index 9d4d3c6..3b53374 100644 --- a/drivers/pci/host/Makefile +++ b/drivers/pci/host/Makefile -@@ -20,3 +20,4 @@ obj-$(CONFIG_PCIE_IPROC_BCMA) += pcie-iproc-bcma.o +@@ -20,3 +20,4 @@ obj-$(CONFIG_PCIE_IPROC_BCMA) += pcie-ip obj-$(CONFIG_PCIE_ALTERA) += pcie-altera.o obj-$(CONFIG_PCIE_ALTERA_MSI) += pcie-altera-msi.o obj-$(CONFIG_PCI_HISI) += pcie-hisi.o +obj-$(CONFIG_PCIE_MTK) += pcie-mediatek.o -diff --git a/drivers/pci/host/pcie-mediatek.c b/drivers/pci/host/pcie-mediatek.c -new file mode 100644 -index 0000000..ef03952 --- /dev/null +++ b/drivers/pci/host/pcie-mediatek.c @@ -0,0 +1,641 @@ @@ -705,6 +696,3 @@ index 0000000..ef03952 +} + +module_init(mtk_pcie_init); --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0026-scpsys-various-fixes.patch b/target/linux/mediatek/patches-4.4/0026-scpsys-various-fixes.patch index 263539232f..7ec3033463 100644 --- a/target/linux/mediatek/patches-4.4/0026-scpsys-various-fixes.patch +++ b/target/linux/mediatek/patches-4.4/0026-scpsys-various-fixes.patch @@ -9,11 +9,9 @@ Subject: [PATCH 026/102] scpsys: various fixes include/dt-bindings/power/mt2701-power.h | 4 ++-- 3 files changed, 4 insertions(+), 10 deletions(-) -diff --git a/drivers/clk/mediatek/clk-mt2701.c b/drivers/clk/mediatek/clk-mt2701.c -index 0e40bb8..812b347 100644 --- a/drivers/clk/mediatek/clk-mt2701.c +++ b/drivers/clk/mediatek/clk-mt2701.c -@@ -1043,6 +1043,8 @@ static void __init mtk_ethsys_init(struct device_node *node) +@@ -1043,6 +1043,8 @@ static void __init mtk_ethsys_init(struc if (r) pr_err("%s(): could not register clock provider: %d\n", __func__, r); @@ -22,11 +20,9 @@ index 0e40bb8..812b347 100644 } CLK_OF_DECLARE(mtk_ethsys, "mediatek,mt2701-ethsys", mtk_ethsys_init); -diff --git a/drivers/soc/mediatek/mtk-scpsys-mt2701.c b/drivers/soc/mediatek/mtk-scpsys-mt2701.c -index 3a31946..19489bc 100644 --- a/drivers/soc/mediatek/mtk-scpsys-mt2701.c +++ b/drivers/soc/mediatek/mtk-scpsys-mt2701.c -@@ -61,14 +61,6 @@ static const struct scp_domain_data scp_domain_data[] = { +@@ -61,14 +61,6 @@ static const struct scp_domain_data scp_ .bus_prot_mask = MT2701_TOP_AXI_PROT_EN_DISP, .active_wakeup = true, }, @@ -41,8 +37,6 @@ index 3a31946..19489bc 100644 [MT2701_POWER_DOMAIN_VDEC] = { .name = "vdec", .sta_mask = VDE_PWR_STA_MASK, -diff --git a/include/dt-bindings/power/mt2701-power.h b/include/dt-bindings/power/mt2701-power.h -index 64cc826..c168597 100644 --- a/include/dt-bindings/power/mt2701-power.h +++ b/include/dt-bindings/power/mt2701-power.h @@ -16,12 +16,12 @@ @@ -60,6 +54,3 @@ index 64cc826..c168597 100644 +#define MT2701_POWER_DOMAIN_IFR_MSC 2 #endif /* _DT_BINDINGS_POWER_MT2701_POWER_H */ --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0027-soc-mediatek-PMIC-wrap-Clear-the-vldclr-if-state-mac.patch b/target/linux/mediatek/patches-4.4/0027-soc-mediatek-PMIC-wrap-Clear-the-vldclr-if-state-mac.patch index f80a677134..964373bf49 100644 --- a/target/linux/mediatek/patches-4.4/0027-soc-mediatek-PMIC-wrap-Clear-the-vldclr-if-state-mac.patch +++ b/target/linux/mediatek/patches-4.4/0027-soc-mediatek-PMIC-wrap-Clear-the-vldclr-if-state-mac.patch @@ -20,11 +20,9 @@ Signed-off-by: Matthias Brugger drivers/soc/mediatek/mtk-pmic-wrap.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) -diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c -index 105597a..696071b 100644 --- a/drivers/soc/mediatek/mtk-pmic-wrap.c +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c -@@ -412,6 +412,20 @@ static bool pwrap_is_fsm_vldclr(struct pmic_wrapper *wrp) +@@ -412,6 +412,20 @@ static bool pwrap_is_fsm_vldclr(struct p return PWRAP_GET_WACS_FSM(val) == PWRAP_WACS_FSM_WFVLDCLR; } @@ -45,7 +43,7 @@ index 105597a..696071b 100644 static bool pwrap_is_sync_idle(struct pmic_wrapper *wrp) { return pwrap_readl(wrp, PWRAP_WACS2_RDATA) & PWRAP_STATE_SYNC_IDLE0; -@@ -445,8 +459,10 @@ static int pwrap_write(struct pmic_wrapper *wrp, u32 adr, u32 wdata) +@@ -445,8 +459,10 @@ static int pwrap_write(struct pmic_wrapp int ret; ret = pwrap_wait_for_state(wrp, pwrap_is_fsm_idle); @@ -57,7 +55,7 @@ index 105597a..696071b 100644 pwrap_writel(wrp, (1 << 31) | ((adr >> 1) << 16) | wdata, PWRAP_WACS2_CMD); -@@ -459,8 +475,10 @@ static int pwrap_read(struct pmic_wrapper *wrp, u32 adr, u32 *rdata) +@@ -459,8 +475,10 @@ static int pwrap_read(struct pmic_wrappe int ret; ret = pwrap_wait_for_state(wrp, pwrap_is_fsm_idle); @@ -69,6 +67,3 @@ index 105597a..696071b 100644 pwrap_writel(wrp, (adr >> 1) << 16, PWRAP_WACS2_CMD); --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0028-ARM-mediatek-add-MT7623-smp-bringup-code.patch b/target/linux/mediatek/patches-4.4/0028-ARM-mediatek-add-MT7623-smp-bringup-code.patch index 130850e197..4aacd26a1f 100644 --- a/target/linux/mediatek/patches-4.4/0028-ARM-mediatek-add-MT7623-smp-bringup-code.patch +++ b/target/linux/mediatek/patches-4.4/0028-ARM-mediatek-add-MT7623-smp-bringup-code.patch @@ -11,11 +11,9 @@ Signed-off-by: Matthias Brugger arch/arm/mach-mediatek/platsmp.c | 7 +++++++ 1 file changed, 7 insertions(+) -diff --git a/arch/arm/mach-mediatek/platsmp.c b/arch/arm/mach-mediatek/platsmp.c -index 8141f3f..8151400 100644 --- a/arch/arm/mach-mediatek/platsmp.c +++ b/arch/arm/mach-mediatek/platsmp.c -@@ -44,6 +44,12 @@ static const struct mtk_smp_boot_info mtk_mt6589_boot = { +@@ -44,6 +44,12 @@ static const struct mtk_smp_boot_info mt { 0x38, 0x3c, 0x40 }, }; @@ -28,7 +26,7 @@ index 8141f3f..8151400 100644 static const struct of_device_id mtk_tz_smp_boot_infos[] __initconst = { { .compatible = "mediatek,mt8135", .data = &mtk_mt8135_tz_boot }, { .compatible = "mediatek,mt8127", .data = &mtk_mt8135_tz_boot }, -@@ -51,6 +57,7 @@ static const struct of_device_id mtk_tz_smp_boot_infos[] __initconst = { +@@ -51,6 +57,7 @@ static const struct of_device_id mtk_tz_ static const struct of_device_id mtk_smp_boot_infos[] __initconst = { { .compatible = "mediatek,mt6589", .data = &mtk_mt6589_boot }, @@ -36,6 +34,3 @@ index 8141f3f..8151400 100644 }; static void __iomem *mtk_smp_base; --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0029-soc-mediatek-PMIC-wrap-clear-the-STAUPD_TRIG-bit-of-.patch b/target/linux/mediatek/patches-4.4/0029-soc-mediatek-PMIC-wrap-clear-the-STAUPD_TRIG-bit-of-.patch index 3c38ac4935..eb936a789b 100644 --- a/target/linux/mediatek/patches-4.4/0029-soc-mediatek-PMIC-wrap-clear-the-STAUPD_TRIG-bit-of-.patch +++ b/target/linux/mediatek/patches-4.4/0029-soc-mediatek-PMIC-wrap-clear-the-STAUPD_TRIG-bit-of-.patch @@ -14,8 +14,6 @@ Signed-off-by: Matthias Brugger drivers/soc/mediatek/mtk-pmic-wrap.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) -diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c -index 696071b..0d9b19a 100644 --- a/drivers/soc/mediatek/mtk-pmic-wrap.c +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c @@ -60,6 +60,15 @@ @@ -34,7 +32,7 @@ index 696071b..0d9b19a 100644 /* macro for slave device wrapper registers */ #define PWRAP_DEW_BASE 0xbc00 #define PWRAP_DEW_EVENT_OUT_EN (PWRAP_DEW_BASE + 0x0) -@@ -822,7 +831,7 @@ MODULE_DEVICE_TABLE(of, of_pwrap_match_tbl); +@@ -822,7 +831,7 @@ MODULE_DEVICE_TABLE(of, of_pwrap_match_t static int pwrap_probe(struct platform_device *pdev) { @@ -43,7 +41,7 @@ index 696071b..0d9b19a 100644 struct pmic_wrapper *wrp; struct device_node *np = pdev->dev.of_node; const struct of_device_id *of_id = -@@ -912,7 +921,13 @@ static int pwrap_probe(struct platform_device *pdev) +@@ -912,7 +921,13 @@ static int pwrap_probe(struct platform_d /* Initialize watchdog, may not be done by the bootloader */ pwrap_writel(wrp, 0xf, PWRAP_WDT_UNIT); @@ -58,6 +56,3 @@ index 696071b..0d9b19a 100644 pwrap_writel(wrp, 0x1, PWRAP_TIMER_EN); pwrap_writel(wrp, ~((1 << 31) | (1 << 1)), PWRAP_INT_EN); --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0030-ARM-mediatek-add-mt2701-smp-bringup-code.patch b/target/linux/mediatek/patches-4.4/0030-ARM-mediatek-add-mt2701-smp-bringup-code.patch index 940fa44337..790ccca1ff 100644 --- a/target/linux/mediatek/patches-4.4/0030-ARM-mediatek-add-mt2701-smp-bringup-code.patch +++ b/target/linux/mediatek/patches-4.4/0030-ARM-mediatek-add-mt2701-smp-bringup-code.patch @@ -11,11 +11,9 @@ Signed-off-by: Matthias Brugger arch/arm/mach-mediatek/platsmp.c | 1 + 1 file changed, 1 insertion(+) -diff --git a/arch/arm/mach-mediatek/platsmp.c b/arch/arm/mach-mediatek/platsmp.c -index 8151400..2078f92d5 100644 --- a/arch/arm/mach-mediatek/platsmp.c +++ b/arch/arm/mach-mediatek/platsmp.c -@@ -53,6 +53,7 @@ static const struct mtk_smp_boot_info mtk_mt7623_boot = { +@@ -53,6 +53,7 @@ static const struct mtk_smp_boot_info mt static const struct of_device_id mtk_tz_smp_boot_infos[] __initconst = { { .compatible = "mediatek,mt8135", .data = &mtk_mt8135_tz_boot }, { .compatible = "mediatek,mt8127", .data = &mtk_mt8135_tz_boot }, @@ -23,6 +21,3 @@ index 8151400..2078f92d5 100644 }; static const struct of_device_id mtk_smp_boot_infos[] __initconst = { --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0031-dt-bindings-ARM-Mediatek-add-MT2701-7623-string-to-t.patch b/target/linux/mediatek/patches-4.4/0031-dt-bindings-ARM-Mediatek-add-MT2701-7623-string-to-t.patch index 6a3ec46a48..186b2f4e34 100644 --- a/target/linux/mediatek/patches-4.4/0031-dt-bindings-ARM-Mediatek-add-MT2701-7623-string-to-t.patch +++ b/target/linux/mediatek/patches-4.4/0031-dt-bindings-ARM-Mediatek-add-MT2701-7623-string-to-t.patch @@ -11,8 +11,6 @@ Cc: devicetree@vger.kernel.org Documentation/devicetree/bindings/soc/mediatek/pwrap.txt | 1 + 1 file changed, 1 insertion(+) -diff --git a/Documentation/devicetree/bindings/soc/mediatek/pwrap.txt b/Documentation/devicetree/bindings/soc/mediatek/pwrap.txt -index ddeb5b6..107700d 100644 --- a/Documentation/devicetree/bindings/soc/mediatek/pwrap.txt +++ b/Documentation/devicetree/bindings/soc/mediatek/pwrap.txt @@ -18,6 +18,7 @@ IP Pairing @@ -23,6 +21,3 @@ index ddeb5b6..107700d 100644 "mediatek,mt8135-pwrap" for MT8135 SoCs "mediatek,mt8173-pwrap" for MT8173 SoCs - interrupts: IRQ for pwrap in SOC --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0032-soc-mediatek-PMIC-wrap-don-t-duplicate-the-wrapper-d.patch b/target/linux/mediatek/patches-4.4/0032-soc-mediatek-PMIC-wrap-don-t-duplicate-the-wrapper-d.patch index b7afdbc273..8092e96d71 100644 --- a/target/linux/mediatek/patches-4.4/0032-soc-mediatek-PMIC-wrap-don-t-duplicate-the-wrapper-d.patch +++ b/target/linux/mediatek/patches-4.4/0032-soc-mediatek-PMIC-wrap-don-t-duplicate-the-wrapper-d.patch @@ -13,8 +13,6 @@ Signed-off-by: John Crispin drivers/soc/mediatek/mtk-pmic-wrap.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) -diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c -index 0d9b19a..340c4b5 100644 --- a/drivers/soc/mediatek/mtk-pmic-wrap.c +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c @@ -376,9 +376,7 @@ struct pmic_wrapper { @@ -55,7 +53,7 @@ index 0d9b19a..340c4b5 100644 } static bool pwrap_is_fsm_idle(struct pmic_wrapper *wrp) -@@ -697,7 +695,7 @@ static int pwrap_init(struct pmic_wrapper *wrp) +@@ -697,7 +695,7 @@ static int pwrap_init(struct pmic_wrappe pwrap_writel(wrp, 1, PWRAP_WRAP_EN); @@ -64,7 +62,7 @@ index 0d9b19a..340c4b5 100644 pwrap_writel(wrp, 1, PWRAP_WACS2_EN); -@@ -742,7 +740,7 @@ static int pwrap_init(struct pmic_wrapper *wrp) +@@ -742,7 +740,7 @@ static int pwrap_init(struct pmic_wrappe pwrap_writel(wrp, 0x1, PWRAP_CRC_EN); pwrap_writel(wrp, 0x0, PWRAP_SIG_MODE); pwrap_writel(wrp, PWRAP_DEW_CRC_VAL, PWRAP_SIG_ADR); @@ -73,7 +71,7 @@ index 0d9b19a..340c4b5 100644 if (pwrap_is_mt8135(wrp)) pwrap_writel(wrp, 0x7, PWRAP_RRARB_EN); -@@ -836,7 +834,6 @@ static int pwrap_probe(struct platform_device *pdev) +@@ -836,7 +834,6 @@ static int pwrap_probe(struct platform_d struct device_node *np = pdev->dev.of_node; const struct of_device_id *of_id = of_match_device(of_pwrap_match_tbl, &pdev->dev); @@ -81,7 +79,7 @@ index 0d9b19a..340c4b5 100644 struct resource *res; wrp = devm_kzalloc(&pdev->dev, sizeof(*wrp), GFP_KERNEL); -@@ -845,10 +842,7 @@ static int pwrap_probe(struct platform_device *pdev) +@@ -845,10 +842,7 @@ static int pwrap_probe(struct platform_d platform_set_drvdata(pdev, wrp); @@ -93,6 +91,3 @@ index 0d9b19a..340c4b5 100644 wrp->dev = &pdev->dev; res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pwrap"); --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0033-soc-mediatek-PMIC-wrap-add-wrapper-callbacks-for-ini.patch b/target/linux/mediatek/patches-4.4/0033-soc-mediatek-PMIC-wrap-add-wrapper-callbacks-for-ini.patch index 25d7f746c4..9368a85f82 100644 --- a/target/linux/mediatek/patches-4.4/0033-soc-mediatek-PMIC-wrap-add-wrapper-callbacks-for-ini.patch +++ b/target/linux/mediatek/patches-4.4/0033-soc-mediatek-PMIC-wrap-add-wrapper-callbacks-for-ini.patch @@ -12,8 +12,6 @@ Signed-off-by: John Crispin drivers/soc/mediatek/mtk-pmic-wrap.c | 70 ++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 32 deletions(-) -diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c -index 340c4b5..b22b664 100644 --- a/drivers/soc/mediatek/mtk-pmic-wrap.c +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c @@ -354,24 +354,6 @@ enum pwrap_type { @@ -55,7 +53,7 @@ index 340c4b5..b22b664 100644 static inline int pwrap_is_mt8135(struct pmic_wrapper *wrp) { return wrp->master->type == PWRAP_MT8135; -@@ -578,20 +567,23 @@ static int pwrap_init_sidly(struct pmic_wrapper *wrp) +@@ -578,20 +567,23 @@ static int pwrap_init_sidly(struct pmic_ return 0; } @@ -92,7 +90,7 @@ index 340c4b5..b22b664 100644 return 0; } -@@ -699,7 +691,7 @@ static int pwrap_init(struct pmic_wrapper *wrp) +@@ -699,7 +691,7 @@ static int pwrap_init(struct pmic_wrappe pwrap_writel(wrp, 1, PWRAP_WACS2_EN); @@ -101,7 +99,7 @@ index 340c4b5..b22b664 100644 if (ret) return ret; -@@ -814,6 +806,20 @@ static const struct regmap_config pwrap_regmap_config = { +@@ -814,6 +806,20 @@ static const struct regmap_config pwrap_ .max_register = 0xffff, }; @@ -122,6 +120,3 @@ index 340c4b5..b22b664 100644 static struct of_device_id of_pwrap_match_tbl[] = { { .compatible = "mediatek,mt8135-pwrap", --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0034-soc-mediatek-PMIC-wrap-split-SoC-specific-init-into-.patch b/target/linux/mediatek/patches-4.4/0034-soc-mediatek-PMIC-wrap-split-SoC-specific-init-into-.patch index 3a74a6a42b..6d9c99a695 100644 --- a/target/linux/mediatek/patches-4.4/0034-soc-mediatek-PMIC-wrap-split-SoC-specific-init-into-.patch +++ b/target/linux/mediatek/patches-4.4/0034-soc-mediatek-PMIC-wrap-split-SoC-specific-init-into-.patch @@ -16,8 +16,6 @@ Signed-off-by: John Crispin drivers/soc/mediatek/mtk-pmic-wrap.c | 67 +++++++++++++++++++++------------- 1 file changed, 42 insertions(+), 25 deletions(-) -diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c -index b22b664..22c89e9 100644 --- a/drivers/soc/mediatek/mtk-pmic-wrap.c +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c @@ -372,6 +372,7 @@ struct pmic_wrapper_type { @@ -28,7 +26,7 @@ index b22b664..22c89e9 100644 }; static inline int pwrap_is_mt8135(struct pmic_wrapper *wrp) -@@ -665,6 +666,41 @@ static int pwrap_init_cipher(struct pmic_wrapper *wrp) +@@ -665,6 +666,41 @@ static int pwrap_init_cipher(struct pmic return 0; } @@ -70,7 +68,7 @@ index b22b664..22c89e9 100644 static int pwrap_init(struct pmic_wrapper *wrp) { int ret; -@@ -743,31 +779,10 @@ static int pwrap_init(struct pmic_wrapper *wrp) +@@ -743,31 +779,10 @@ static int pwrap_init(struct pmic_wrappe pwrap_writel(wrp, 0x5, PWRAP_STAUPD_PRD); pwrap_writel(wrp, 0xff, PWRAP_STAUPD_GRPEN); @@ -106,7 +104,7 @@ index b22b664..22c89e9 100644 } /* Setup the init done registers */ -@@ -811,6 +826,7 @@ static struct pmic_wrapper_type pwrap_mt8135 = { +@@ -811,6 +826,7 @@ static struct pmic_wrapper_type pwrap_mt .type = PWRAP_MT8135, .arb_en_all = 0x1ff, .init_reg_clock = pwrap_mt8135_init_reg_clock, @@ -114,7 +112,7 @@ index b22b664..22c89e9 100644 }; static struct pmic_wrapper_type pwrap_mt8173 = { -@@ -818,6 +834,7 @@ static struct pmic_wrapper_type pwrap_mt8173 = { +@@ -818,6 +834,7 @@ static struct pmic_wrapper_type pwrap_mt .type = PWRAP_MT8173, .arb_en_all = 0x3f, .init_reg_clock = pwrap_mt8173_init_reg_clock, @@ -122,6 +120,3 @@ index b22b664..22c89e9 100644 }; static struct of_device_id of_pwrap_match_tbl[] = { --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0035-soc-mediatek-PMIC-wrap-WRAP_INT_EN-needs-a-different.patch b/target/linux/mediatek/patches-4.4/0035-soc-mediatek-PMIC-wrap-WRAP_INT_EN-needs-a-different.patch index c51f84cbb8..42fbe2e1ca 100644 --- a/target/linux/mediatek/patches-4.4/0035-soc-mediatek-PMIC-wrap-WRAP_INT_EN-needs-a-different.patch +++ b/target/linux/mediatek/patches-4.4/0035-soc-mediatek-PMIC-wrap-WRAP_INT_EN-needs-a-different.patch @@ -11,8 +11,6 @@ Signed-off-by: John Crispin drivers/soc/mediatek/mtk-pmic-wrap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c -index 22c89e9..9df1135 100644 --- a/drivers/soc/mediatek/mtk-pmic-wrap.c +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c @@ -371,6 +371,7 @@ struct pmic_wrapper_type { @@ -23,7 +21,7 @@ index 22c89e9..9df1135 100644 int (*init_reg_clock)(struct pmic_wrapper *wrp); int (*init_soc_specific)(struct pmic_wrapper *wrp); }; -@@ -825,6 +826,7 @@ static struct pmic_wrapper_type pwrap_mt8135 = { +@@ -825,6 +826,7 @@ static struct pmic_wrapper_type pwrap_mt .regs = mt8135_regs, .type = PWRAP_MT8135, .arb_en_all = 0x1ff, @@ -31,7 +29,7 @@ index 22c89e9..9df1135 100644 .init_reg_clock = pwrap_mt8135_init_reg_clock, .init_soc_specific = pwrap_mt8135_init_soc_specific, }; -@@ -833,6 +835,7 @@ static struct pmic_wrapper_type pwrap_mt8173 = { +@@ -833,6 +835,7 @@ static struct pmic_wrapper_type pwrap_mt .regs = mt8173_regs, .type = PWRAP_MT8173, .arb_en_all = 0x3f, @@ -39,7 +37,7 @@ index 22c89e9..9df1135 100644 .init_reg_clock = pwrap_mt8173_init_reg_clock, .init_soc_specific = pwrap_mt8173_init_soc_specific, }; -@@ -946,7 +949,7 @@ static int pwrap_probe(struct platform_device *pdev) +@@ -946,7 +949,7 @@ static int pwrap_probe(struct platform_d PWRAP_WDT_SRC_MASK_NO_STAUPD : PWRAP_WDT_SRC_MASK_ALL; pwrap_writel(wrp, wdt_src, PWRAP_WDT_SRC_EN); pwrap_writel(wrp, 0x1, PWRAP_TIMER_EN); @@ -48,6 +46,3 @@ index 22c89e9..9df1135 100644 irq = platform_get_irq(pdev, 0); ret = devm_request_irq(wrp->dev, irq, pwrap_interrupt, IRQF_TRIGGER_HIGH, --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0036-soc-mediatek-PMIC-wrap-SPI_WRITE-needs-a-different-b.patch b/target/linux/mediatek/patches-4.4/0036-soc-mediatek-PMIC-wrap-SPI_WRITE-needs-a-different-b.patch index e47a4c5b98..a80bd731d9 100644 --- a/target/linux/mediatek/patches-4.4/0036-soc-mediatek-PMIC-wrap-SPI_WRITE-needs-a-different-b.patch +++ b/target/linux/mediatek/patches-4.4/0036-soc-mediatek-PMIC-wrap-SPI_WRITE-needs-a-different-b.patch @@ -13,8 +13,6 @@ Signed-off-by: John Crispin drivers/soc/mediatek/mtk-pmic-wrap.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) -diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c -index 9df1135..8ce1bad 100644 --- a/drivers/soc/mediatek/mtk-pmic-wrap.c +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c @@ -372,6 +372,7 @@ struct pmic_wrapper_type { @@ -25,7 +23,7 @@ index 9df1135..8ce1bad 100644 int (*init_reg_clock)(struct pmic_wrapper *wrp); int (*init_soc_specific)(struct pmic_wrapper *wrp); }; -@@ -511,15 +512,15 @@ static int pwrap_reset_spislave(struct pmic_wrapper *wrp) +@@ -511,15 +512,15 @@ static int pwrap_reset_spislave(struct p pwrap_writel(wrp, 1, PWRAP_MAN_EN); pwrap_writel(wrp, 0, PWRAP_DIO_EN); @@ -45,7 +43,7 @@ index 9df1135..8ce1bad 100644 PWRAP_MAN_CMD); ret = pwrap_wait_for_state(wrp, pwrap_is_sync_idle); -@@ -827,6 +828,7 @@ static struct pmic_wrapper_type pwrap_mt8135 = { +@@ -827,6 +828,7 @@ static struct pmic_wrapper_type pwrap_mt .type = PWRAP_MT8135, .arb_en_all = 0x1ff, .int_en_all = ~(BIT(31) | BIT(1)), @@ -53,7 +51,7 @@ index 9df1135..8ce1bad 100644 .init_reg_clock = pwrap_mt8135_init_reg_clock, .init_soc_specific = pwrap_mt8135_init_soc_specific, }; -@@ -836,6 +838,7 @@ static struct pmic_wrapper_type pwrap_mt8173 = { +@@ -836,6 +838,7 @@ static struct pmic_wrapper_type pwrap_mt .type = PWRAP_MT8173, .arb_en_all = 0x3f, .int_en_all = ~(BIT(31) | BIT(1)), @@ -61,6 +59,3 @@ index 9df1135..8ce1bad 100644 .init_reg_clock = pwrap_mt8173_init_reg_clock, .init_soc_specific = pwrap_mt8173_init_soc_specific, }; --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0037-soc-mediatek-PMIC-wrap-move-wdt_src-into-the-pmic_wr.patch b/target/linux/mediatek/patches-4.4/0037-soc-mediatek-PMIC-wrap-move-wdt_src-into-the-pmic_wr.patch index e082096718..1e2c587605 100644 --- a/target/linux/mediatek/patches-4.4/0037-soc-mediatek-PMIC-wrap-move-wdt_src-into-the-pmic_wr.patch +++ b/target/linux/mediatek/patches-4.4/0037-soc-mediatek-PMIC-wrap-move-wdt_src-into-the-pmic_wr.patch @@ -13,8 +13,6 @@ Signed-off-by: John Crispin drivers/soc/mediatek/mtk-pmic-wrap.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c -index 8ce1bad..aa54df3 100644 --- a/drivers/soc/mediatek/mtk-pmic-wrap.c +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c @@ -373,6 +373,7 @@ struct pmic_wrapper_type { @@ -25,7 +23,7 @@ index 8ce1bad..aa54df3 100644 int (*init_reg_clock)(struct pmic_wrapper *wrp); int (*init_soc_specific)(struct pmic_wrapper *wrp); }; -@@ -829,6 +830,7 @@ static struct pmic_wrapper_type pwrap_mt8135 = { +@@ -829,6 +830,7 @@ static struct pmic_wrapper_type pwrap_mt .arb_en_all = 0x1ff, .int_en_all = ~(BIT(31) | BIT(1)), .spi_w = PWRAP_MAN_CMD_SPI_WRITE, @@ -33,7 +31,7 @@ index 8ce1bad..aa54df3 100644 .init_reg_clock = pwrap_mt8135_init_reg_clock, .init_soc_specific = pwrap_mt8135_init_soc_specific, }; -@@ -839,6 +841,7 @@ static struct pmic_wrapper_type pwrap_mt8173 = { +@@ -839,6 +841,7 @@ static struct pmic_wrapper_type pwrap_mt .arb_en_all = 0x3f, .int_en_all = ~(BIT(31) | BIT(1)), .spi_w = PWRAP_MAN_CMD_SPI_WRITE, @@ -41,7 +39,7 @@ index 8ce1bad..aa54df3 100644 .init_reg_clock = pwrap_mt8173_init_reg_clock, .init_soc_specific = pwrap_mt8173_init_soc_specific, }; -@@ -858,7 +861,7 @@ MODULE_DEVICE_TABLE(of, of_pwrap_match_tbl); +@@ -858,7 +861,7 @@ MODULE_DEVICE_TABLE(of, of_pwrap_match_t static int pwrap_probe(struct platform_device *pdev) { @@ -50,7 +48,7 @@ index 8ce1bad..aa54df3 100644 struct pmic_wrapper *wrp; struct device_node *np = pdev->dev.of_node; const struct of_device_id *of_id = -@@ -948,9 +951,7 @@ static int pwrap_probe(struct platform_device *pdev) +@@ -948,9 +951,7 @@ static int pwrap_probe(struct platform_d * Since STAUPD was not used on mt8173 platform, * so STAUPD of WDT_SRC which should be turned off */ @@ -61,6 +59,3 @@ index 8ce1bad..aa54df3 100644 pwrap_writel(wrp, 0x1, PWRAP_TIMER_EN); pwrap_writel(wrp, wrp->master->int_en_all, PWRAP_INT_EN); --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0038-soc-mediatek-PMIC-wrap-remove-pwrap_is_mt8135-and-pw.patch b/target/linux/mediatek/patches-4.4/0038-soc-mediatek-PMIC-wrap-remove-pwrap_is_mt8135-and-pw.patch index 94d4b8c752..001793f585 100644 --- a/target/linux/mediatek/patches-4.4/0038-soc-mediatek-PMIC-wrap-remove-pwrap_is_mt8135-and-pw.patch +++ b/target/linux/mediatek/patches-4.4/0038-soc-mediatek-PMIC-wrap-remove-pwrap_is_mt8135-and-pw.patch @@ -18,8 +18,6 @@ Signed-off-by: John Crispin drivers/soc/mediatek/mtk-pmic-wrap.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) -diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c -index aa54df3..a2bacda 100644 --- a/drivers/soc/mediatek/mtk-pmic-wrap.c +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c @@ -374,20 +374,11 @@ struct pmic_wrapper_type { @@ -44,7 +42,7 @@ index aa54df3..a2bacda 100644 static u32 pwrap_readl(struct pmic_wrapper *wrp, enum pwrap_regs reg) { return readl(wrp->base + wrp->master->regs[reg]); -@@ -619,11 +610,14 @@ static int pwrap_init_cipher(struct pmic_wrapper *wrp) +@@ -619,11 +610,14 @@ static int pwrap_init_cipher(struct pmic pwrap_writel(wrp, 0x1, PWRAP_CIPHER_KEY_SEL); pwrap_writel(wrp, 0x2, PWRAP_CIPHER_IV_SEL); @@ -61,7 +59,7 @@ index aa54df3..a2bacda 100644 } /* Config cipher mode @PMIC */ -@@ -713,7 +707,7 @@ static int pwrap_init(struct pmic_wrapper *wrp) +@@ -713,7 +707,7 @@ static int pwrap_init(struct pmic_wrappe if (wrp->rstc_bridge) reset_control_reset(wrp->rstc_bridge); @@ -70,7 +68,7 @@ index aa54df3..a2bacda 100644 /* Enable DCM */ pwrap_writel(wrp, 3, PWRAP_DCM_EN); pwrap_writel(wrp, 0, PWRAP_DCM_DBC_PRD); -@@ -773,7 +767,7 @@ static int pwrap_init(struct pmic_wrapper *wrp) +@@ -773,7 +767,7 @@ static int pwrap_init(struct pmic_wrappe pwrap_writel(wrp, PWRAP_DEW_CRC_VAL, PWRAP_SIG_ADR); pwrap_writel(wrp, wrp->master->arb_en_all, PWRAP_HIPRIO_ARB_EN); @@ -79,7 +77,7 @@ index aa54df3..a2bacda 100644 pwrap_writel(wrp, 0x7, PWRAP_RRARB_EN); pwrap_writel(wrp, 0x1, PWRAP_WACS0_EN); -@@ -793,7 +787,7 @@ static int pwrap_init(struct pmic_wrapper *wrp) +@@ -793,7 +787,7 @@ static int pwrap_init(struct pmic_wrappe pwrap_writel(wrp, 1, PWRAP_INIT_DONE0); pwrap_writel(wrp, 1, PWRAP_INIT_DONE1); @@ -88,7 +86,7 @@ index aa54df3..a2bacda 100644 writel(1, wrp->bridge_base + PWRAP_MT8135_BRIDGE_INIT_DONE3); writel(1, wrp->bridge_base + PWRAP_MT8135_BRIDGE_INIT_DONE4); } -@@ -831,6 +825,7 @@ static struct pmic_wrapper_type pwrap_mt8135 = { +@@ -831,6 +825,7 @@ static struct pmic_wrapper_type pwrap_mt .int_en_all = ~(BIT(31) | BIT(1)), .spi_w = PWRAP_MAN_CMD_SPI_WRITE, .wdt_src = PWRAP_WDT_SRC_MASK_ALL, @@ -96,7 +94,7 @@ index aa54df3..a2bacda 100644 .init_reg_clock = pwrap_mt8135_init_reg_clock, .init_soc_specific = pwrap_mt8135_init_soc_specific, }; -@@ -842,6 +837,7 @@ static struct pmic_wrapper_type pwrap_mt8173 = { +@@ -842,6 +837,7 @@ static struct pmic_wrapper_type pwrap_mt .int_en_all = ~(BIT(31) | BIT(1)), .spi_w = PWRAP_MAN_CMD_SPI_WRITE, .wdt_src = PWRAP_WDT_SRC_MASK_NO_STAUPD, @@ -104,7 +102,7 @@ index aa54df3..a2bacda 100644 .init_reg_clock = pwrap_mt8173_init_reg_clock, .init_soc_specific = pwrap_mt8173_init_soc_specific, }; -@@ -889,7 +885,7 @@ static int pwrap_probe(struct platform_device *pdev) +@@ -889,7 +885,7 @@ static int pwrap_probe(struct platform_d return ret; } @@ -113,6 +111,3 @@ index aa54df3..a2bacda 100644 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pwrap-bridge"); wrp->bridge_base = devm_ioremap_resource(wrp->dev, res); --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0039-soc-mediatek-PMIC-wrap-add-a-slave-specific-struct.patch b/target/linux/mediatek/patches-4.4/0039-soc-mediatek-PMIC-wrap-add-a-slave-specific-struct.patch index 5b1ab7a70f..dea271af66 100644 --- a/target/linux/mediatek/patches-4.4/0039-soc-mediatek-PMIC-wrap-add-a-slave-specific-struct.patch +++ b/target/linux/mediatek/patches-4.4/0039-soc-mediatek-PMIC-wrap-add-a-slave-specific-struct.patch @@ -13,8 +13,6 @@ Signed-off-by: John Crispin drivers/soc/mediatek/mtk-pmic-wrap.c | 159 ++++++++++++++++++++++++---------- 1 file changed, 112 insertions(+), 47 deletions(-) -diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c -index a2bacda..bcc841e 100644 --- a/drivers/soc/mediatek/mtk-pmic-wrap.c +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c @@ -69,33 +69,54 @@ @@ -126,7 +124,7 @@ index a2bacda..bcc841e 100644 struct clk *clk_spi; struct clk *clk_wrap; struct reset_control *rstc; -@@ -544,7 +575,8 @@ static int pwrap_init_sidly(struct pmic_wrapper *wrp) +@@ -544,7 +575,8 @@ static int pwrap_init_sidly(struct pmic_ for (i = 0; i < 4; i++) { pwrap_writel(wrp, i, PWRAP_SIDLY); @@ -136,7 +134,7 @@ index a2bacda..bcc841e 100644 if (rdata == PWRAP_DEW_READ_TEST_VAL) { dev_dbg(wrp->dev, "[Read Test] pass, SIDLY=%x\n", i); pass |= 1 << i; -@@ -593,7 +625,8 @@ static bool pwrap_is_pmic_cipher_ready(struct pmic_wrapper *wrp) +@@ -593,7 +625,8 @@ static bool pwrap_is_pmic_cipher_ready(s u32 rdata; int ret; @@ -146,7 +144,7 @@ index a2bacda..bcc841e 100644 if (ret) return 0; -@@ -621,12 +654,12 @@ static int pwrap_init_cipher(struct pmic_wrapper *wrp) +@@ -621,12 +654,12 @@ static int pwrap_init_cipher(struct pmic } /* Config cipher mode @PMIC */ @@ -165,7 +163,7 @@ index a2bacda..bcc841e 100644 /* wait for cipher data ready@AP */ ret = pwrap_wait_for_state(wrp, pwrap_is_cipher_ready); -@@ -643,7 +676,7 @@ static int pwrap_init_cipher(struct pmic_wrapper *wrp) +@@ -643,7 +676,7 @@ static int pwrap_init_cipher(struct pmic } /* wait for cipher mode idle */ @@ -174,7 +172,7 @@ index a2bacda..bcc841e 100644 ret = pwrap_wait_for_state(wrp, pwrap_is_fsm_idle_and_sync_idle); if (ret) { dev_err(wrp->dev, "cipher mode idle fail, ret=%d\n", ret); -@@ -653,9 +686,11 @@ static int pwrap_init_cipher(struct pmic_wrapper *wrp) +@@ -653,9 +686,11 @@ static int pwrap_init_cipher(struct pmic pwrap_writel(wrp, 1, PWRAP_CIPHER_MODE); /* Write Test */ @@ -189,7 +187,7 @@ index a2bacda..bcc841e 100644 dev_err(wrp->dev, "rdata=0x%04X\n", rdata); return -EFAULT; } -@@ -677,8 +712,10 @@ static int pwrap_mt8135_init_soc_specific(struct pmic_wrapper *wrp) +@@ -677,8 +712,10 @@ static int pwrap_mt8135_init_soc_specifi writel(0x7ff, wrp->bridge_base + PWRAP_MT8135_BRIDGE_INT_EN); /* enable PMIC event out and sources */ @@ -202,7 +200,7 @@ index a2bacda..bcc841e 100644 dev_err(wrp->dev, "enable dewrap fail\n"); return -EFAULT; } -@@ -689,8 +726,10 @@ static int pwrap_mt8135_init_soc_specific(struct pmic_wrapper *wrp) +@@ -689,8 +726,10 @@ static int pwrap_mt8135_init_soc_specifi static int pwrap_mt8173_init_soc_specific(struct pmic_wrapper *wrp) { /* PMIC_DEWRAP enables */ @@ -215,7 +213,7 @@ index a2bacda..bcc841e 100644 dev_err(wrp->dev, "enable dewrap fail\n"); return -EFAULT; } -@@ -734,7 +773,7 @@ static int pwrap_init(struct pmic_wrapper *wrp) +@@ -734,7 +773,7 @@ static int pwrap_init(struct pmic_wrappe return ret; /* Enable dual IO mode */ @@ -224,7 +222,7 @@ index a2bacda..bcc841e 100644 /* Check IDLE & INIT_DONE in advance */ ret = pwrap_wait_for_state(wrp, pwrap_is_fsm_idle_and_sync_idle); -@@ -746,7 +785,7 @@ static int pwrap_init(struct pmic_wrapper *wrp) +@@ -746,7 +785,7 @@ static int pwrap_init(struct pmic_wrappe pwrap_writel(wrp, 1, PWRAP_DIO_EN); /* Read Test */ @@ -233,7 +231,7 @@ index a2bacda..bcc841e 100644 if (rdata != PWRAP_DEW_READ_TEST_VAL) { dev_err(wrp->dev, "Read test failed after switch to DIO mode: 0x%04x != 0x%04x\n", PWRAP_DEW_READ_TEST_VAL, rdata); -@@ -759,12 +798,13 @@ static int pwrap_init(struct pmic_wrapper *wrp) +@@ -759,12 +798,13 @@ static int pwrap_init(struct pmic_wrappe return ret; /* Signature checking - using CRC */ @@ -249,7 +247,7 @@ index a2bacda..bcc841e 100644 pwrap_writel(wrp, wrp->master->arb_en_all, PWRAP_HIPRIO_ARB_EN); if (wrp->master->type == PWRAP_MT8135) -@@ -818,6 +858,21 @@ static const struct regmap_config pwrap_regmap_config = { +@@ -818,6 +858,21 @@ static const struct regmap_config pwrap_ .max_register = 0xffff, }; @@ -271,7 +269,7 @@ index a2bacda..bcc841e 100644 static struct pmic_wrapper_type pwrap_mt8135 = { .regs = mt8135_regs, .type = PWRAP_MT8135, -@@ -862,8 +917,17 @@ static int pwrap_probe(struct platform_device *pdev) +@@ -862,8 +917,17 @@ static int pwrap_probe(struct platform_d struct device_node *np = pdev->dev.of_node; const struct of_device_id *of_id = of_match_device(of_pwrap_match_tbl, &pdev->dev); @@ -289,7 +287,7 @@ index a2bacda..bcc841e 100644 wrp = devm_kzalloc(&pdev->dev, sizeof(*wrp), GFP_KERNEL); if (!wrp) return -ENOMEM; -@@ -871,6 +935,7 @@ static int pwrap_probe(struct platform_device *pdev) +@@ -871,6 +935,7 @@ static int pwrap_probe(struct platform_d platform_set_drvdata(pdev, wrp); wrp->master = of_id->data; @@ -297,6 +295,3 @@ index a2bacda..bcc841e 100644 wrp->dev = &pdev->dev; res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pwrap"); --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0040-soc-mediatek-PMIC-wrap-add-mt6323-slave-support.patch b/target/linux/mediatek/patches-4.4/0040-soc-mediatek-PMIC-wrap-add-mt6323-slave-support.patch index 70840e2651..51f06288fb 100644 --- a/target/linux/mediatek/patches-4.4/0040-soc-mediatek-PMIC-wrap-add-mt6323-slave-support.patch +++ b/target/linux/mediatek/patches-4.4/0040-soc-mediatek-PMIC-wrap-add-mt6323-slave-support.patch @@ -11,8 +11,6 @@ Signed-off-by: John Crispin drivers/soc/mediatek/mtk-pmic-wrap.c | 43 ++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) -diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c -index bcc841e..0e4ebb8 100644 --- a/drivers/soc/mediatek/mtk-pmic-wrap.c +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c @@ -93,6 +93,27 @@ enum dew_regs { @@ -51,7 +49,7 @@ index bcc841e..0e4ebb8 100644 PMIC_MT6397, }; -@@ -661,6 +683,19 @@ static int pwrap_init_cipher(struct pmic_wrapper *wrp) +@@ -661,6 +683,19 @@ static int pwrap_init_cipher(struct pmic pwrap_write(wrp, wrp->slave->dew_regs[PWRAP_DEW_CIPHER_LOAD], 0x1); pwrap_write(wrp, wrp->slave->dew_regs[PWRAP_DEW_CIPHER_START], 0x1); @@ -71,7 +69,7 @@ index bcc841e..0e4ebb8 100644 /* wait for cipher data ready@AP */ ret = pwrap_wait_for_state(wrp, pwrap_is_cipher_ready); if (ret) { -@@ -858,6 +893,11 @@ static const struct regmap_config pwrap_regmap_config = { +@@ -858,6 +893,11 @@ static const struct regmap_config pwrap_ .max_register = 0xffff, }; @@ -83,7 +81,7 @@ index bcc841e..0e4ebb8 100644 static const struct pwrap_slv_type pmic_mt6397 = { .dew_regs = mt6397_regs, .type = PMIC_MT6397, -@@ -865,6 +905,9 @@ static const struct pwrap_slv_type pmic_mt6397 = { +@@ -865,6 +905,9 @@ static const struct pwrap_slv_type pmic_ static const struct of_device_id of_slave_match_tbl[] = { { @@ -93,6 +91,3 @@ index bcc841e..0e4ebb8 100644 .compatible = "mediatek,mt6397", .data = &pmic_mt6397, }, { --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0041-soc-mediatek-PMIC-wrap-add-MT2701-7623-support.patch b/target/linux/mediatek/patches-4.4/0041-soc-mediatek-PMIC-wrap-add-MT2701-7623-support.patch index aa5e3fb6ca..a50a34af6a 100644 --- a/target/linux/mediatek/patches-4.4/0041-soc-mediatek-PMIC-wrap-add-MT2701-7623-support.patch +++ b/target/linux/mediatek/patches-4.4/0041-soc-mediatek-PMIC-wrap-add-MT2701-7623-support.patch @@ -11,8 +11,6 @@ Signed-off-by: John Crispin drivers/soc/mediatek/mtk-pmic-wrap.c | 154 ++++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) -diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c -index 0e4ebb8..3c3e56d 100644 --- a/drivers/soc/mediatek/mtk-pmic-wrap.c +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c @@ -52,6 +52,7 @@ @@ -138,7 +136,7 @@ index 0e4ebb8..3c3e56d 100644 PWRAP_MT8135, PWRAP_MT8173, }; -@@ -637,6 +732,31 @@ static int pwrap_mt8173_init_reg_clock(struct pmic_wrapper *wrp) +@@ -637,6 +732,31 @@ static int pwrap_mt8173_init_reg_clock(s return 0; } @@ -170,7 +168,7 @@ index 0e4ebb8..3c3e56d 100644 static bool pwrap_is_cipher_ready(struct pmic_wrapper *wrp) { return pwrap_readl(wrp, PWRAP_CIPHER_RDY) & 1; -@@ -670,6 +790,7 @@ static int pwrap_init_cipher(struct pmic_wrapper *wrp) +@@ -670,6 +790,7 @@ static int pwrap_init_cipher(struct pmic pwrap_writel(wrp, 1, PWRAP_CIPHER_LOAD); pwrap_writel(wrp, 1, PWRAP_CIPHER_START); break; @@ -178,7 +176,7 @@ index 0e4ebb8..3c3e56d 100644 case PWRAP_MT8173: pwrap_writel(wrp, 1, PWRAP_CIPHER_EN); break; -@@ -772,6 +893,24 @@ static int pwrap_mt8173_init_soc_specific(struct pmic_wrapper *wrp) +@@ -772,6 +893,24 @@ static int pwrap_mt8173_init_soc_specifi return 0; } @@ -203,7 +201,7 @@ index 0e4ebb8..3c3e56d 100644 static int pwrap_init(struct pmic_wrapper *wrp) { int ret; -@@ -916,6 +1055,18 @@ static const struct of_device_id of_slave_match_tbl[] = { +@@ -916,6 +1055,18 @@ static const struct of_device_id of_slav }; MODULE_DEVICE_TABLE(of, of_slave_match_tbl); @@ -222,7 +220,7 @@ index 0e4ebb8..3c3e56d 100644 static struct pmic_wrapper_type pwrap_mt8135 = { .regs = mt8135_regs, .type = PWRAP_MT8135, -@@ -942,6 +1093,9 @@ static struct pmic_wrapper_type pwrap_mt8173 = { +@@ -942,6 +1093,9 @@ static struct pmic_wrapper_type pwrap_mt static struct of_device_id of_pwrap_match_tbl[] = { { @@ -232,6 +230,3 @@ index 0e4ebb8..3c3e56d 100644 .compatible = "mediatek,mt8135-pwrap", .data = &pwrap_mt8135, }, { --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0042-dt-bindings-mfd-Add-bindings-for-the-MediaTek-MT6323.patch b/target/linux/mediatek/patches-4.4/0042-dt-bindings-mfd-Add-bindings-for-the-MediaTek-MT6323.patch index f38b522cc7..701ee67bad 100644 --- a/target/linux/mediatek/patches-4.4/0042-dt-bindings-mfd-Add-bindings-for-the-MediaTek-MT6323.patch +++ b/target/linux/mediatek/patches-4.4/0042-dt-bindings-mfd-Add-bindings-for-the-MediaTek-MT6323.patch @@ -11,8 +11,6 @@ Cc: devicetree@vger.kernel.org Documentation/devicetree/bindings/mfd/mt6397.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -diff --git a/Documentation/devicetree/bindings/mfd/mt6397.txt b/Documentation/devicetree/bindings/mfd/mt6397.txt -index 15043e6..949c85f 100644 --- a/Documentation/devicetree/bindings/mfd/mt6397.txt +++ b/Documentation/devicetree/bindings/mfd/mt6397.txt @@ -1,6 +1,6 @@ @@ -24,7 +22,7 @@ index 15043e6..949c85f 100644 - Regulator - RTC - Audio codec -@@ -8,14 +8,14 @@ MT6397 is a multifunction device with the following sub modules: +@@ -8,14 +8,14 @@ MT6397 is a multifunction device with th - Clock It is interfaced to host controller using SPI interface by a proprietary hardware @@ -50,6 +48,3 @@ index 15043e6..949c85f 100644 - codec Required properties: - compatible: "mediatek,mt6397-codec" --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0043-mfd-mt6397-int_con-and-int_status-may-vary-in-locati.patch b/target/linux/mediatek/patches-4.4/0043-mfd-mt6397-int_con-and-int_status-may-vary-in-locati.patch index c08541e2b0..6b433b0dfa 100644 --- a/target/linux/mediatek/patches-4.4/0043-mfd-mt6397-int_con-and-int_status-may-vary-in-locati.patch +++ b/target/linux/mediatek/patches-4.4/0043-mfd-mt6397-int_con-and-int_status-may-vary-in-locati.patch @@ -13,11 +13,9 @@ Signed-off-by: John Crispin include/linux/mfd/mt6397/core.h | 2 ++ 2 files changed, 19 insertions(+), 10 deletions(-) -diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c -index 1749c1c..75ad0fe 100644 --- a/drivers/mfd/mt6397-core.c +++ b/drivers/mfd/mt6397-core.c -@@ -69,8 +69,10 @@ static void mt6397_irq_sync_unlock(struct irq_data *data) +@@ -69,8 +69,10 @@ static void mt6397_irq_sync_unlock(struc { struct mt6397_chip *mt6397 = irq_data_get_irq_chip_data(data); @@ -30,7 +28,7 @@ index 1749c1c..75ad0fe 100644 mutex_unlock(&mt6397->irqlock); } -@@ -147,8 +149,8 @@ static irqreturn_t mt6397_irq_thread(int irq, void *data) +@@ -147,8 +149,8 @@ static irqreturn_t mt6397_irq_thread(int { struct mt6397_chip *mt6397 = data; @@ -41,7 +39,7 @@ index 1749c1c..75ad0fe 100644 return IRQ_HANDLED; } -@@ -177,8 +179,8 @@ static int mt6397_irq_init(struct mt6397_chip *mt6397) +@@ -177,8 +179,8 @@ static int mt6397_irq_init(struct mt6397 mutex_init(&mt6397->irqlock); /* Mask all interrupt sources */ @@ -52,7 +50,7 @@ index 1749c1c..75ad0fe 100644 mt6397->irq_domain = irq_domain_add_linear(mt6397->dev->of_node, MT6397_IRQ_NR, &mt6397_irq_domain_ops, mt6397); -@@ -203,8 +205,8 @@ static int mt6397_irq_suspend(struct device *dev) +@@ -203,8 +205,8 @@ static int mt6397_irq_suspend(struct dev { struct mt6397_chip *chip = dev_get_drvdata(dev); @@ -63,7 +61,7 @@ index 1749c1c..75ad0fe 100644 enable_irq_wake(chip->irq); -@@ -215,8 +217,8 @@ static int mt6397_irq_resume(struct device *dev) +@@ -215,8 +217,8 @@ static int mt6397_irq_resume(struct devi { struct mt6397_chip *chip = dev_get_drvdata(dev); @@ -74,7 +72,7 @@ index 1749c1c..75ad0fe 100644 disable_irq_wake(chip->irq); -@@ -237,6 +239,11 @@ static int mt6397_probe(struct platform_device *pdev) +@@ -237,6 +239,11 @@ static int mt6397_probe(struct platform_ return -ENOMEM; mt6397->dev = &pdev->dev; @@ -86,8 +84,6 @@ index 1749c1c..75ad0fe 100644 /* * mt6397 MFD is child device of soc pmic wrapper. * Regmap is set from its parent. -diff --git a/include/linux/mfd/mt6397/core.h b/include/linux/mfd/mt6397/core.h -index 45b8e8a..d678f52 100644 --- a/include/linux/mfd/mt6397/core.h +++ b/include/linux/mfd/mt6397/core.h @@ -60,6 +60,8 @@ struct mt6397_chip { @@ -99,6 +95,3 @@ index 45b8e8a..d678f52 100644 }; #endif /* __MFD_MT6397_CORE_H__ */ --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0044-mfd-mt6397-add-support-for-different-Slave-types.patch b/target/linux/mediatek/patches-4.4/0044-mfd-mt6397-add-support-for-different-Slave-types.patch index 3d0cf28b24..bae05fb51b 100644 --- a/target/linux/mediatek/patches-4.4/0044-mfd-mt6397-add-support-for-different-Slave-types.patch +++ b/target/linux/mediatek/patches-4.4/0044-mfd-mt6397-add-support-for-different-Slave-types.patch @@ -8,8 +8,6 @@ Signed-off-by: John Crispin drivers/mfd/mt6397-core.c | 58 ++++++++++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 17 deletions(-) -diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c -index 75ad0fe..aa91606 100644 --- a/drivers/mfd/mt6397-core.c +++ b/drivers/mfd/mt6397-core.c @@ -24,6 +24,9 @@ @@ -22,7 +20,7 @@ index 75ad0fe..aa91606 100644 static const struct resource mt6397_rtc_resources[] = { { .start = MT6397_RTC_BASE, -@@ -232,39 +235,60 @@ static SIMPLE_DEV_PM_OPS(mt6397_pm_ops, mt6397_irq_suspend, +@@ -232,39 +235,60 @@ static SIMPLE_DEV_PM_OPS(mt6397_pm_ops, static int mt6397_probe(struct platform_device *pdev) { int ret; @@ -100,6 +98,3 @@ index 75ad0fe..aa91606 100644 return ret; } --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0045-mfd-mt6397-add-MT6323-support-to-MT6397-driver.patch b/target/linux/mediatek/patches-4.4/0045-mfd-mt6397-add-MT6323-support-to-MT6397-driver.patch index cec58eacad..d673a0a096 100644 --- a/target/linux/mediatek/patches-4.4/0045-mfd-mt6397-add-MT6323-support-to-MT6397-driver.patch +++ b/target/linux/mediatek/patches-4.4/0045-mfd-mt6397-add-MT6323-support-to-MT6397-driver.patch @@ -12,8 +12,6 @@ Signed-off-by: John Crispin create mode 100644 include/linux/mfd/mt6323/core.h create mode 100644 include/linux/mfd/mt6323/registers.h -diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c -index aa91606..8234cd3 100644 --- a/drivers/mfd/mt6397-core.c +++ b/drivers/mfd/mt6397-core.c @@ -19,11 +19,14 @@ @@ -31,7 +29,7 @@ index aa91606..8234cd3 100644 #define MT6391_CID_CODE 0x91 #define MT6397_CID_CODE 0x97 -@@ -40,6 +43,13 @@ static const struct resource mt6397_rtc_resources[] = { +@@ -40,6 +43,13 @@ static const struct resource mt6397_rtc_ }, }; @@ -45,7 +43,7 @@ index aa91606..8234cd3 100644 static const struct mfd_cell mt6397_devs[] = { { .name = "mt6397-rtc", -@@ -261,6 +271,15 @@ static int mt6397_probe(struct platform_device *pdev) +@@ -261,6 +271,15 @@ static int mt6397_probe(struct platform_ } switch (id & 0xff) { @@ -61,7 +59,7 @@ index aa91606..8234cd3 100644 case MT6397_CID_CODE: case MT6391_CID_CODE: pmic->int_con[0] = MT6397_INT_CON0; -@@ -302,6 +321,7 @@ static int mt6397_remove(struct platform_device *pdev) +@@ -302,6 +321,7 @@ static int mt6397_remove(struct platform static const struct of_device_id mt6397_of_match[] = { { .compatible = "mediatek,mt6397" }, @@ -69,9 +67,6 @@ index aa91606..8234cd3 100644 { } }; MODULE_DEVICE_TABLE(of, mt6397_of_match); -diff --git a/include/linux/mfd/mt6323/core.h b/include/linux/mfd/mt6323/core.h -new file mode 100644 -index 0000000..06d0ec3 --- /dev/null +++ b/include/linux/mfd/mt6323/core.h @@ -0,0 +1,36 @@ @@ -111,9 +106,6 @@ index 0000000..06d0ec3 +}; + +#endif /* __MFD_MT6323_CORE_H__ */ -diff --git a/include/linux/mfd/mt6323/registers.h b/include/linux/mfd/mt6323/registers.h -new file mode 100644 -index 0000000..160f3c0 --- /dev/null +++ b/include/linux/mfd/mt6323/registers.h @@ -0,0 +1,408 @@ @@ -525,6 +517,3 @@ index 0000000..160f3c0 +#define MT6323_ACCDET_CON16 0x079A + +#endif /* __MFD_MT6323_REGISTERS_H__ */ --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0046-regulator-Add-document-for-MT6323-regulator.patch b/target/linux/mediatek/patches-4.4/0046-regulator-Add-document-for-MT6323-regulator.patch index 78cd0c132d..d70631483a 100644 --- a/target/linux/mediatek/patches-4.4/0046-regulator-Add-document-for-MT6323-regulator.patch +++ b/target/linux/mediatek/patches-4.4/0046-regulator-Add-document-for-MT6323-regulator.patch @@ -10,9 +10,6 @@ Cc: devicetree@vger.kernel.org 1 file changed, 239 insertions(+) create mode 100644 Documentation/devicetree/bindings/regulator/mt6323-regulator.txt -diff --git a/Documentation/devicetree/bindings/regulator/mt6323-regulator.txt b/Documentation/devicetree/bindings/regulator/mt6323-regulator.txt -new file mode 100644 -index 0000000..9fd95e7 --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/mt6323-regulator.txt @@ -0,0 +1,239 @@ @@ -255,6 +252,3 @@ index 0000000..9fd95e7 + }; + }; + }; --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0047-regulator-mt6323-Add-support-for-MT6323-regulator.patch b/target/linux/mediatek/patches-4.4/0047-regulator-mt6323-Add-support-for-MT6323-regulator.patch index d914eceaee..6456c27dce 100644 --- a/target/linux/mediatek/patches-4.4/0047-regulator-mt6323-Add-support-for-MT6323-regulator.patch +++ b/target/linux/mediatek/patches-4.4/0047-regulator-mt6323-Add-support-for-MT6323-regulator.patch @@ -18,11 +18,9 @@ Signed-off-by: John Crispin create mode 100644 drivers/regulator/mt6323-regulator.c create mode 100644 include/linux/regulator/mt6323-regulator.h -diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig -index 8df0b0e..4aec931 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig -@@ -452,6 +452,15 @@ config REGULATOR_MT6311 +@@ -453,6 +453,15 @@ config REGULATOR_MT6311 This driver supports the control of different power rails of device through regulator interface. @@ -38,11 +36,9 @@ index 8df0b0e..4aec931 100644 config REGULATOR_MT6397 tristate "MediaTek MT6397 PMIC" depends on MFD_MT6397 -diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile -index 0f81749..b42a84e 100644 --- a/drivers/regulator/Makefile +++ b/drivers/regulator/Makefile -@@ -60,6 +60,7 @@ obj-$(CONFIG_REGULATOR_MC13783) += mc13783-regulator.o +@@ -60,6 +60,7 @@ obj-$(CONFIG_REGULATOR_MC13783) += mc137 obj-$(CONFIG_REGULATOR_MC13892) += mc13892-regulator.o obj-$(CONFIG_REGULATOR_MC13XXX_CORE) += mc13xxx-regulator-core.o obj-$(CONFIG_REGULATOR_MT6311) += mt6311-regulator.o @@ -50,9 +46,6 @@ index 0f81749..b42a84e 100644 obj-$(CONFIG_REGULATOR_MT6397) += mt6397-regulator.o obj-$(CONFIG_REGULATOR_QCOM_RPM) += qcom_rpm-regulator.o obj-$(CONFIG_REGULATOR_QCOM_SMD_RPM) += qcom_smd-regulator.o -diff --git a/drivers/regulator/mt6323-regulator.c b/drivers/regulator/mt6323-regulator.c -new file mode 100644 -index 0000000..28ebbda --- /dev/null +++ b/drivers/regulator/mt6323-regulator.c @@ -0,0 +1,432 @@ @@ -488,9 +481,6 @@ index 0000000..28ebbda +MODULE_AUTHOR("Chen Zhong "); +MODULE_DESCRIPTION("Regulator Driver for MediaTek MT6397 PMIC"); +MODULE_LICENSE("GPL v2"); -diff --git a/include/linux/regulator/mt6323-regulator.h b/include/linux/regulator/mt6323-regulator.h -new file mode 100644 -index 0000000..67011cd --- /dev/null +++ b/include/linux/regulator/mt6323-regulator.h @@ -0,0 +1,52 @@ @@ -546,6 +536,3 @@ index 0000000..67011cd +#define MT6323_MAX_REGULATOR MT6323_ID_RG_MAX + +#endif /* __LINUX_REGULATOR_MT6323_H */ --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0048-net-next-mediatek-document-MediaTek-SoC-ethernet-bin.patch b/target/linux/mediatek/patches-4.4/0048-net-next-mediatek-document-MediaTek-SoC-ethernet-bin.patch index b4da16b7c7..7d1e7422ea 100644 --- a/target/linux/mediatek/patches-4.4/0048-net-next-mediatek-document-MediaTek-SoC-ethernet-bin.patch +++ b/target/linux/mediatek/patches-4.4/0048-net-next-mediatek-document-MediaTek-SoC-ethernet-bin.patch @@ -15,9 +15,6 @@ Cc: devicetree@vger.kernel.org 1 file changed, 77 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/mediatek-net.txt -diff --git a/Documentation/devicetree/bindings/net/mediatek-net.txt b/Documentation/devicetree/bindings/net/mediatek-net.txt -new file mode 100644 -index 0000000..5ca7929 --- /dev/null +++ b/Documentation/devicetree/bindings/net/mediatek-net.txt @@ -0,0 +1,77 @@ @@ -98,6 +95,3 @@ index 0000000..5ca7929 + }; + }; +}; --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0049-net-next-mediatek-add-support-for-MT7623-ethernet.patch b/target/linux/mediatek/patches-4.4/0049-net-next-mediatek-add-support-for-MT7623-ethernet.patch index 5efcc37520..98b008399c 100644 --- a/target/linux/mediatek/patches-4.4/0049-net-next-mediatek-add-support-for-MT7623-ethernet.patch +++ b/target/linux/mediatek/patches-4.4/0049-net-next-mediatek-add-support-for-MT7623-ethernet.patch @@ -26,9 +26,6 @@ Signed-off-by: John Crispin create mode 100644 drivers/net/ethernet/mediatek/mtk_eth_soc.c create mode 100644 drivers/net/ethernet/mediatek/mtk_eth_soc.h -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -new file mode 100644 -index 0000000..ba3afa5 --- /dev/null +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -0,0 +1,1807 @@ @@ -1839,9 +1836,6 @@ index 0000000..ba3afa5 +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("John Crispin "); +MODULE_DESCRIPTION("Ethernet driver for MediaTek SoC"); -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h -new file mode 100644 -index 0000000..48a5292 --- /dev/null +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h @@ -0,0 +1,421 @@ @@ -2266,6 +2260,3 @@ index 0000000..48a5292 +u32 mtk_r32(struct mtk_eth *eth, unsigned reg); + +#endif /* MTK_ETH_H */ --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0050-net-next-mediatek-add-Kconfig-and-Makefile.patch b/target/linux/mediatek/patches-4.4/0050-net-next-mediatek-add-Kconfig-and-Makefile.patch index cc4e671c0f..0c7a89e622 100644 --- a/target/linux/mediatek/patches-4.4/0050-net-next-mediatek-add-Kconfig-and-Makefile.patch +++ b/target/linux/mediatek/patches-4.4/0050-net-next-mediatek-add-Kconfig-and-Makefile.patch @@ -15,8 +15,6 @@ Signed-off-by: John Crispin create mode 100644 drivers/net/ethernet/mediatek/Kconfig create mode 100644 drivers/net/ethernet/mediatek/Makefile -diff --git a/drivers/net/ethernet/Kconfig b/drivers/net/ethernet/Kconfig -index 31c5e47..cd28b95 100644 --- a/drivers/net/ethernet/Kconfig +++ b/drivers/net/ethernet/Kconfig @@ -106,6 +106,7 @@ config LANTIQ_ETOP @@ -27,8 +25,6 @@ index 31c5e47..cd28b95 100644 source "drivers/net/ethernet/mellanox/Kconfig" source "drivers/net/ethernet/micrel/Kconfig" source "drivers/net/ethernet/microchip/Kconfig" -diff --git a/drivers/net/ethernet/Makefile b/drivers/net/ethernet/Makefile -index 071f84e..c62191f 100644 --- a/drivers/net/ethernet/Makefile +++ b/drivers/net/ethernet/Makefile @@ -46,6 +46,7 @@ obj-$(CONFIG_JME) += jme.o @@ -39,9 +35,6 @@ index 071f84e..c62191f 100644 obj-$(CONFIG_NET_VENDOR_MELLANOX) += mellanox/ obj-$(CONFIG_NET_VENDOR_MICREL) += micrel/ obj-$(CONFIG_NET_VENDOR_MICROCHIP) += microchip/ -diff --git a/drivers/net/ethernet/mediatek/Kconfig b/drivers/net/ethernet/mediatek/Kconfig -new file mode 100644 -index 0000000..b0229f4 --- /dev/null +++ b/drivers/net/ethernet/mediatek/Kconfig @@ -0,0 +1,17 @@ @@ -62,9 +55,6 @@ index 0000000..b0229f4 + MediaTek MT2701/MT7623 chipset family. + +endif #NET_VENDOR_MEDIATEK -diff --git a/drivers/net/ethernet/mediatek/Makefile b/drivers/net/ethernet/mediatek/Makefile -new file mode 100644 -index 0000000..aa3f1c8 --- /dev/null +++ b/drivers/net/ethernet/mediatek/Makefile @@ -0,0 +1,5 @@ @@ -73,6 +63,3 @@ index 0000000..aa3f1c8 +# + +obj-$(CONFIG_NET_MEDIATEK_SOC) += mtk_eth_soc.o --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0051-net-next-mediatek-add-an-entry-to-MAINTAINERS.patch b/target/linux/mediatek/patches-4.4/0051-net-next-mediatek-add-an-entry-to-MAINTAINERS.patch index d3f84abbd5..59ed5fc7a8 100644 --- a/target/linux/mediatek/patches-4.4/0051-net-next-mediatek-add-an-entry-to-MAINTAINERS.patch +++ b/target/linux/mediatek/patches-4.4/0051-net-next-mediatek-add-an-entry-to-MAINTAINERS.patch @@ -11,11 +11,9 @@ Signed-off-by: John Crispin MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+) -diff --git a/MAINTAINERS b/MAINTAINERS -index 233f834..73f0592 100644 --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -6902,6 +6902,13 @@ F: include/uapi/linux/meye.h +@@ -6907,6 +6907,13 @@ F: include/uapi/linux/meye.h F: include/uapi/linux/ivtv* F: include/uapi/linux/uvcvideo.h @@ -29,6 +27,3 @@ index 233f834..73f0592 100644 MEDIATEK MT7601U WIRELESS LAN DRIVER M: Jakub Kicinski L: linux-wireless@vger.kernel.org --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0052-clk-dont-disable-unused-clocks.patch b/target/linux/mediatek/patches-4.4/0052-clk-dont-disable-unused-clocks.patch index 277fbca5c7..87e4a54ed3 100644 --- a/target/linux/mediatek/patches-4.4/0052-clk-dont-disable-unused-clocks.patch +++ b/target/linux/mediatek/patches-4.4/0052-clk-dont-disable-unused-clocks.patch @@ -8,8 +8,6 @@ Signed-off-by: John Crispin drivers/clk/clk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c -index f13c3f4..5e9ddae 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -233,7 +233,7 @@ unlock_out: @@ -21,6 +19,3 @@ index f13c3f4..5e9ddae 100644 static int __init clk_ignore_unused_setup(char *__unused) { clk_ignore_unused = true; --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0053-clk-mediatek-enable-critical-clocks.patch b/target/linux/mediatek/patches-4.4/0053-clk-mediatek-enable-critical-clocks.patch index f22f7860be..39939001f1 100644 --- a/target/linux/mediatek/patches-4.4/0053-clk-mediatek-enable-critical-clocks.patch +++ b/target/linux/mediatek/patches-4.4/0053-clk-mediatek-enable-critical-clocks.patch @@ -8,11 +8,9 @@ Signed-off-by: John Crispin drivers/clk/mediatek/clk-mt2701.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) -diff --git a/drivers/clk/mediatek/clk-mt2701.c b/drivers/clk/mediatek/clk-mt2701.c -index 812b347..1634288 100644 --- a/drivers/clk/mediatek/clk-mt2701.c +++ b/drivers/clk/mediatek/clk-mt2701.c -@@ -573,6 +573,20 @@ static const struct mtk_gate top_clks[] __initconst = { +@@ -573,6 +573,20 @@ static const struct mtk_gate top_clks[] GATE_TOP_AUD(CLK_TOP_AUD_I2S6_MCLK, "aud_i2s6_mclk", "aud_k6_src_div", 28), }; @@ -33,7 +31,7 @@ index 812b347..1634288 100644 static void __init mtk_topckgen_init(struct device_node *node) { struct clk_onecell_data *clk_data; -@@ -585,7 +599,7 @@ static void __init mtk_topckgen_init(struct device_node *node) +@@ -585,7 +599,7 @@ static void __init mtk_topckgen_init(str return; } @@ -42,7 +40,7 @@ index 812b347..1634288 100644 mtk_clk_register_fixed_clks(top_fixed_clks, ARRAY_SIZE(top_fixed_clks), clk_data); -@@ -606,6 +620,8 @@ static void __init mtk_topckgen_init(struct device_node *node) +@@ -606,6 +620,8 @@ static void __init mtk_topckgen_init(str if (r) pr_err("%s(): could not register clock provider: %d\n", __func__, r); @@ -51,7 +49,7 @@ index 812b347..1634288 100644 } CLK_OF_DECLARE(mtk_topckgen, "mediatek,mt2701-topckgen", mtk_topckgen_init); -@@ -1202,7 +1218,7 @@ static void __init mtk_apmixedsys_init(struct device_node *node) +@@ -1202,7 +1218,7 @@ static void __init mtk_apmixedsys_init(s struct clk_onecell_data *clk_data; int r; @@ -60,7 +58,7 @@ index 812b347..1634288 100644 if (!clk_data) return; -@@ -1213,6 +1229,8 @@ static void __init mtk_apmixedsys_init(struct device_node *node) +@@ -1213,6 +1229,8 @@ static void __init mtk_apmixedsys_init(s if (r) pr_err("%s(): could not register clock provider: %d\n", __func__, r); @@ -69,6 +67,3 @@ index 812b347..1634288 100644 } CLK_OF_DECLARE(mtk_apmixedsys, "mediatek,mt2701-apmixedsys", mtk_apmixedsys_init); --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0054-clk-mediatek-Export-CPU-mux-clocks-for-CPU-frequency.patch b/target/linux/mediatek/patches-4.4/0054-clk-mediatek-Export-CPU-mux-clocks-for-CPU-frequency.patch index 057f95e009..d5af5f0c82 100644 --- a/target/linux/mediatek/patches-4.4/0054-clk-mediatek-Export-CPU-mux-clocks-for-CPU-frequency.patch +++ b/target/linux/mediatek/patches-4.4/0054-clk-mediatek-Export-CPU-mux-clocks-for-CPU-frequency.patch @@ -20,8 +20,6 @@ Signed-off-by: Pi-Cheng Chen create mode 100644 drivers/clk/mediatek/clk-cpumux.c create mode 100644 drivers/clk/mediatek/clk-cpumux.h -diff --git a/drivers/clk/mediatek/Makefile b/drivers/clk/mediatek/Makefile -index 5b2b91b..76bfab6 100644 --- a/drivers/clk/mediatek/Makefile +++ b/drivers/clk/mediatek/Makefile @@ -1,4 +1,4 @@ @@ -30,9 +28,6 @@ index 5b2b91b..76bfab6 100644 obj-$(CONFIG_RESET_CONTROLLER) += reset.o obj-$(CONFIG_COMMON_CLK_MT2701) += clk-mt2701.o obj-$(CONFIG_COMMON_CLK_MT8135) += clk-mt8135.o -diff --git a/drivers/clk/mediatek/clk-cpumux.c b/drivers/clk/mediatek/clk-cpumux.c -new file mode 100644 -index 0000000..91b5238 --- /dev/null +++ b/drivers/clk/mediatek/clk-cpumux.c @@ -0,0 +1,127 @@ @@ -163,9 +158,6 @@ index 0000000..91b5238 + + return 0; +} -diff --git a/drivers/clk/mediatek/clk-cpumux.h b/drivers/clk/mediatek/clk-cpumux.h -new file mode 100644 -index 0000000..52c769f --- /dev/null +++ b/drivers/clk/mediatek/clk-cpumux.h @@ -0,0 +1,22 @@ @@ -191,8 +183,6 @@ index 0000000..52c769f + struct clk_onecell_data *clk_data); + +#endif /* __DRV_CLK_CPUMUX_H */ -diff --git a/drivers/clk/mediatek/clk-mt2701.c b/drivers/clk/mediatek/clk-mt2701.c -index 1634288..5c37fcb 100644 --- a/drivers/clk/mediatek/clk-mt2701.c +++ b/drivers/clk/mediatek/clk-mt2701.c @@ -18,6 +18,7 @@ @@ -203,7 +193,7 @@ index 1634288..5c37fcb 100644 #include -@@ -465,6 +466,10 @@ static const char * const cpu_parents[] __initconst = { +@@ -465,6 +466,10 @@ static const char * const cpu_parents[] "mmpll" }; @@ -214,7 +204,7 @@ index 1634288..5c37fcb 100644 static const struct mtk_composite top_muxes[] __initconst = { MUX_GATE(CLK_TOP_AXI_SEL, "axi_sel", axi_parents, 0x0040, 0, 3, INVALID_MUX_GATE_BIT), -@@ -677,6 +682,9 @@ static void __init mtk_infrasys_init(struct device_node *node) +@@ -677,6 +682,9 @@ static void __init mtk_infrasys_init(str mtk_clk_register_factors(infra_fixed_divs, ARRAY_SIZE(infra_fixed_divs), clk_data); @@ -224,8 +214,6 @@ index 1634288..5c37fcb 100644 r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data); if (r) pr_err("%s(): could not register clock provider: %d\n", -diff --git a/drivers/clk/mediatek/clk-mt8173.c b/drivers/clk/mediatek/clk-mt8173.c -index 227e356..b82c0e2 100644 --- a/drivers/clk/mediatek/clk-mt8173.c +++ b/drivers/clk/mediatek/clk-mt8173.c @@ -18,6 +18,7 @@ @@ -236,7 +224,7 @@ index 227e356..b82c0e2 100644 #include -@@ -526,6 +527,25 @@ static const char * const i2s3_b_ck_parents[] __initconst = { +@@ -526,6 +527,25 @@ static const char * const i2s3_b_ck_pare "apll2_div5" }; @@ -262,7 +250,7 @@ index 227e356..b82c0e2 100644 static const struct mtk_composite top_muxes[] __initconst = { /* CLK_CFG_0 */ MUX(CLK_TOP_AXI_SEL, "axi_sel", axi_parents, 0x0040, 0, 3), -@@ -945,6 +965,9 @@ static void __init mtk_infrasys_init(struct device_node *node) +@@ -945,6 +965,9 @@ static void __init mtk_infrasys_init(str clk_data); mtk_clk_register_factors(infra_divs, ARRAY_SIZE(infra_divs), clk_data); @@ -272,8 +260,6 @@ index 227e356..b82c0e2 100644 r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data); if (r) pr_err("%s(): could not register clock provider: %d\n", -diff --git a/include/dt-bindings/clock/mt2701-clk.h b/include/dt-bindings/clock/mt2701-clk.h -index 50972d1..a6c63b8 100644 --- a/include/dt-bindings/clock/mt2701-clk.h +++ b/include/dt-bindings/clock/mt2701-clk.h @@ -217,7 +217,8 @@ @@ -286,8 +272,6 @@ index 50972d1..a6c63b8 100644 /* PERICFG */ -diff --git a/include/dt-bindings/clock/mt8173-clk.h b/include/dt-bindings/clock/mt8173-clk.h -index 7956ba1..c82ed7c 100644 --- a/include/dt-bindings/clock/mt8173-clk.h +++ b/include/dt-bindings/clock/mt8173-clk.h @@ -192,7 +192,9 @@ @@ -301,6 +285,3 @@ index 7956ba1..c82ed7c 100644 /* PERI_SYS */ --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0055-cpufreq-mediatek-add-driver.patch b/target/linux/mediatek/patches-4.4/0055-cpufreq-mediatek-add-driver.patch index 897b8c7602..8b476361ff 100644 --- a/target/linux/mediatek/patches-4.4/0055-cpufreq-mediatek-add-driver.patch +++ b/target/linux/mediatek/patches-4.4/0055-cpufreq-mediatek-add-driver.patch @@ -11,8 +11,6 @@ Signed-off-by: John Crispin 3 files changed, 399 insertions(+) create mode 100644 drivers/cpufreq/mt7623-cpufreq.c -diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm -index b1f8a73..baf945e 100644 --- a/drivers/cpufreq/Kconfig.arm +++ b/drivers/cpufreq/Kconfig.arm @@ -81,6 +81,15 @@ config ARM_KIRKWOOD_CPUFREQ @@ -31,11 +29,9 @@ index b1f8a73..baf945e 100644 config ARM_MT8173_CPUFREQ bool "Mediatek MT8173 CPUFreq support" depends on ARCH_MEDIATEK && REGULATOR -diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile -index c0af1a1..e198752 100644 --- a/drivers/cpufreq/Makefile +++ b/drivers/cpufreq/Makefile -@@ -57,6 +57,7 @@ obj-$(CONFIG_ARM_HISI_ACPU_CPUFREQ) += hisi-acpu-cpufreq.o +@@ -57,6 +57,7 @@ obj-$(CONFIG_ARM_HISI_ACPU_CPUFREQ) += h obj-$(CONFIG_ARM_IMX6Q_CPUFREQ) += imx6q-cpufreq.o obj-$(CONFIG_ARM_INTEGRATOR) += integrator-cpufreq.o obj-$(CONFIG_ARM_KIRKWOOD_CPUFREQ) += kirkwood-cpufreq.o @@ -43,9 +39,6 @@ index c0af1a1..e198752 100644 obj-$(CONFIG_ARM_MT8173_CPUFREQ) += mt8173-cpufreq.o obj-$(CONFIG_ARM_OMAP2PLUS_CPUFREQ) += omap-cpufreq.o obj-$(CONFIG_ARM_PXA2xx_CPUFREQ) += pxa2xx-cpufreq.o -diff --git a/drivers/cpufreq/mt7623-cpufreq.c b/drivers/cpufreq/mt7623-cpufreq.c -new file mode 100644 -index 0000000..8d154ce --- /dev/null +++ b/drivers/cpufreq/mt7623-cpufreq.c @@ -0,0 +1,389 @@ @@ -438,6 +431,3 @@ index 0000000..8d154ce + return 0; +} +device_initcall(mt7623_cpufreq_driver_init); --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0056-arm-mediatek-make-a7-timer-work-Signed-off-by-John-C.patch b/target/linux/mediatek/patches-4.4/0056-arm-mediatek-make-a7-timer-work-Signed-off-by-John-C.patch index 18ecb8080a..fe81b47290 100644 --- a/target/linux/mediatek/patches-4.4/0056-arm-mediatek-make-a7-timer-work-Signed-off-by-John-C.patch +++ b/target/linux/mediatek/patches-4.4/0056-arm-mediatek-make-a7-timer-work-Signed-off-by-John-C.patch @@ -9,8 +9,6 @@ Subject: [PATCH 056/102] arm: mediatek: make a7 timer work Signed-off-by: arch/arm/mach-mediatek/mediatek.c | 1 + 2 files changed, 2 insertions(+) -diff --git a/arch/arm/mach-mediatek/Kconfig b/arch/arm/mach-mediatek/Kconfig -index a7fef77..2c05bc31 100644 --- a/arch/arm/mach-mediatek/Kconfig +++ b/arch/arm/mach-mediatek/Kconfig @@ -24,6 +24,7 @@ config MACH_MT6592 @@ -21,11 +19,9 @@ index a7fef77..2c05bc31 100644 select MIGHT_HAVE_PCI config MACH_MT8127 -diff --git a/arch/arm/mach-mediatek/mediatek.c b/arch/arm/mach-mediatek/mediatek.c -index bcfca37..7553a8c 100644 --- a/arch/arm/mach-mediatek/mediatek.c +++ b/arch/arm/mach-mediatek/mediatek.c -@@ -29,6 +29,7 @@ static void __init mediatek_timer_init(void) +@@ -29,6 +29,7 @@ static void __init mediatek_timer_init(v void __iomem *gpt_base; if (of_machine_is_compatible("mediatek,mt6589") || @@ -33,6 +29,3 @@ index bcfca37..7553a8c 100644 of_machine_is_compatible("mediatek,mt8135") || of_machine_is_compatible("mediatek,mt8127")) { /* turn on GPT6 which ungates arch timer clocks */ --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0057-net-mediatek-checking-for-IS_ERR-instead-of-NULL.patch b/target/linux/mediatek/patches-4.4/0057-net-mediatek-checking-for-IS_ERR-instead-of-NULL.patch index a25385eeb4..f00e9682bc 100644 --- a/target/linux/mediatek/patches-4.4/0057-net-mediatek-checking-for-IS_ERR-instead-of-NULL.patch +++ b/target/linux/mediatek/patches-4.4/0057-net-mediatek-checking-for-IS_ERR-instead-of-NULL.patch @@ -11,11 +11,9 @@ Signed-off-by: Dan Carpenter drivers/net/ethernet/mediatek/mtk_eth_soc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index ba3afa5..9759fe5 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -186,9 +186,9 @@ static int mtk_phy_connect_node(struct mtk_eth *eth, struct mtk_mac *mac, +@@ -186,9 +186,9 @@ static int mtk_phy_connect_node(struct m phydev = of_phy_connect(eth->netdev[mac->id], phy_node, mtk_phy_link_adjust, 0, phy_mode); @@ -27,6 +25,3 @@ index ba3afa5..9759fe5 100644 } dev_info(eth->dev, --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0058-net-mediatek-unlock-on-error-in-mtk_tx_map.patch b/target/linux/mediatek/patches-4.4/0058-net-mediatek-unlock-on-error-in-mtk_tx_map.patch index 9f7dfd5438..a3f861b72c 100644 --- a/target/linux/mediatek/patches-4.4/0058-net-mediatek-unlock-on-error-in-mtk_tx_map.patch +++ b/target/linux/mediatek/patches-4.4/0058-net-mediatek-unlock-on-error-in-mtk_tx_map.patch @@ -11,8 +11,6 @@ Signed-off-by: Dan Carpenter drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 ++ 1 file changed, 2 insertions(+) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index 9759fe5..c2c2e206 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -661,6 +661,8 @@ err_dma: @@ -24,6 +22,3 @@ index 9759fe5..c2c2e206 100644 return -ENOMEM; } --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0059-net-mediatek-use-dma_addr_t-correctly.patch b/target/linux/mediatek/patches-4.4/0059-net-mediatek-use-dma_addr_t-correctly.patch index f428d0b618..0dd5f2d29d 100644 --- a/target/linux/mediatek/patches-4.4/0059-net-mediatek-use-dma_addr_t-correctly.patch +++ b/target/linux/mediatek/patches-4.4/0059-net-mediatek-use-dma_addr_t-correctly.patch @@ -17,11 +17,9 @@ Signed-off-by: Arnd Bergmann drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index c2c2e206..a005bc4 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -453,7 +453,7 @@ static inline void mtk_rx_get_desc(struct mtk_rx_dma *rxd, +@@ -453,7 +453,7 @@ static inline void mtk_rx_get_desc(struc /* the qdma core needs scratch memory to be setup */ static int mtk_init_fq_dma(struct mtk_eth *eth) { @@ -30,6 +28,3 @@ index c2c2e206..a005bc4 100644 int cnt = MTK_DMA_SIZE; dma_addr_t dma_addr; int i; --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0060-net-mediatek-remove-incorrect-dma_mask-assignment.patch b/target/linux/mediatek/patches-4.4/0060-net-mediatek-remove-incorrect-dma_mask-assignment.patch index 56c9809815..d1df7327b1 100644 --- a/target/linux/mediatek/patches-4.4/0060-net-mediatek-remove-incorrect-dma_mask-assignment.patch +++ b/target/linux/mediatek/patches-4.4/0060-net-mediatek-remove-incorrect-dma_mask-assignment.patch @@ -17,11 +17,9 @@ Signed-off-by: Arnd Bergmann drivers/net/ethernet/mediatek/mtk_eth_soc.c | 3 --- 1 file changed, 3 deletions(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index a005bc4..fcd4ed7 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1678,9 +1678,6 @@ static int mtk_probe(struct platform_device *pdev) +@@ -1678,9 +1678,6 @@ static int mtk_probe(struct platform_dev struct mtk_eth *eth; int err; @@ -31,6 +29,3 @@ index a005bc4..fcd4ed7 100644 device_reset(&pdev->dev); match = of_match_device(of_mtk_match, &pdev->dev); --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0061-net-mediatek-check-device_reset-return-code.patch b/target/linux/mediatek/patches-4.4/0061-net-mediatek-check-device_reset-return-code.patch index f87a3e6724..ebc6d9b361 100644 --- a/target/linux/mediatek/patches-4.4/0061-net-mediatek-check-device_reset-return-code.patch +++ b/target/linux/mediatek/patches-4.4/0061-net-mediatek-check-device_reset-return-code.patch @@ -18,11 +18,9 @@ Signed-off-by: Arnd Bergmann drivers/net/ethernet/mediatek/mtk_eth_soc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index fcd4ed7..7f2126b 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1678,7 +1678,9 @@ static int mtk_probe(struct platform_device *pdev) +@@ -1678,7 +1678,9 @@ static int mtk_probe(struct platform_dev struct mtk_eth *eth; int err; @@ -33,6 +31,3 @@ index fcd4ed7..7f2126b 100644 match = of_match_device(of_mtk_match, &pdev->dev); soc = (struct mtk_soc_data *)match->data; --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0062-net-mediatek-watchdog_timeo-was-not-set.patch b/target/linux/mediatek/patches-4.4/0062-net-mediatek-watchdog_timeo-was-not-set.patch index 498393ee7b..ca2e791a37 100644 --- a/target/linux/mediatek/patches-4.4/0062-net-mediatek-watchdog_timeo-was-not-set.patch +++ b/target/linux/mediatek/patches-4.4/0062-net-mediatek-watchdog_timeo-was-not-set.patch @@ -11,11 +11,9 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.c | 1 + 1 file changed, 1 insertion(+) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index 7f2126b..7e6d2e2 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1645,6 +1645,7 @@ static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) +@@ -1645,6 +1645,7 @@ static int mtk_add_mac(struct mtk_eth *e mac->hw_stats->reg_offset = id * MTK_STAT_OFFSET; SET_NETDEV_DEV(eth->netdev[id], eth->dev); @@ -23,6 +21,3 @@ index 7f2126b..7e6d2e2 100644 eth->netdev[id]->netdev_ops = &mtk_netdev_ops; eth->netdev[id]->base_addr = (unsigned long)eth->base; eth->netdev[id]->vlan_features = MTK_HW_FEATURES & --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0063-net-mediatek-mtk_cal_txd_req-returns-bad-value.patch b/target/linux/mediatek/patches-4.4/0063-net-mediatek-mtk_cal_txd_req-returns-bad-value.patch index f40a1a06d8..a81f165980 100644 --- a/target/linux/mediatek/patches-4.4/0063-net-mediatek-mtk_cal_txd_req-returns-bad-value.patch +++ b/target/linux/mediatek/patches-4.4/0063-net-mediatek-mtk_cal_txd_req-returns-bad-value.patch @@ -12,11 +12,9 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index 7e6d2e2..4d8d0a3 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -681,7 +681,7 @@ static inline int mtk_cal_txd_req(struct sk_buff *skb) +@@ -681,7 +681,7 @@ static inline int mtk_cal_txd_req(struct nfrags += skb_shinfo(skb)->nr_frags; } @@ -25,6 +23,3 @@ index 7e6d2e2..4d8d0a3 100644 } static int mtk_start_xmit(struct sk_buff *skb, struct net_device *dev) --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0064-net-mediatek-remove-superflous-reset-call.patch b/target/linux/mediatek/patches-4.4/0064-net-mediatek-remove-superflous-reset-call.patch index 44769d0474..434a6e38ed 100644 --- a/target/linux/mediatek/patches-4.4/0064-net-mediatek-remove-superflous-reset-call.patch +++ b/target/linux/mediatek/patches-4.4/0064-net-mediatek-remove-superflous-reset-call.patch @@ -11,11 +11,9 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.c | 4 ---- 1 file changed, 4 deletions(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index 4d8d0a3..293ea59 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1679,10 +1679,6 @@ static int mtk_probe(struct platform_device *pdev) +@@ -1679,10 +1679,6 @@ static int mtk_probe(struct platform_dev struct mtk_eth *eth; int err; @@ -26,6 +24,3 @@ index 4d8d0a3..293ea59 100644 match = of_match_device(of_mtk_match, &pdev->dev); soc = (struct mtk_soc_data *)match->data; --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0065-net-mediatek-fix-stop-and-wakeup-of-queue.patch b/target/linux/mediatek/patches-4.4/0065-net-mediatek-fix-stop-and-wakeup-of-queue.patch index 43b083d5a6..1660e4204d 100644 --- a/target/linux/mediatek/patches-4.4/0065-net-mediatek-fix-stop-and-wakeup-of-queue.patch +++ b/target/linux/mediatek/patches-4.4/0065-net-mediatek-fix-stop-and-wakeup-of-queue.patch @@ -13,11 +13,9 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.c | 37 +++++++++++++++++++-------- 1 file changed, 27 insertions(+), 10 deletions(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index 293ea59..04bdb9d 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -684,6 +684,28 @@ static inline int mtk_cal_txd_req(struct sk_buff *skb) +@@ -684,6 +684,28 @@ static inline int mtk_cal_txd_req(struct return nfrags; } @@ -46,7 +44,7 @@ index 293ea59..04bdb9d 100644 static int mtk_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct mtk_mac *mac = netdev_priv(dev); -@@ -695,7 +717,7 @@ static int mtk_start_xmit(struct sk_buff *skb, struct net_device *dev) +@@ -695,7 +717,7 @@ static int mtk_start_xmit(struct sk_buff tx_num = mtk_cal_txd_req(skb); if (unlikely(atomic_read(&ring->free_count) <= tx_num)) { @@ -55,7 +53,7 @@ index 293ea59..04bdb9d 100644 netif_err(eth, tx_queued, dev, "Tx Ring full when queue awake!\n"); return NETDEV_TX_BUSY; -@@ -720,10 +742,10 @@ static int mtk_start_xmit(struct sk_buff *skb, struct net_device *dev) +@@ -720,10 +742,10 @@ static int mtk_start_xmit(struct sk_buff goto drop; if (unlikely(atomic_read(&ring->free_count) <= ring->thresh)) { @@ -68,7 +66,7 @@ index 293ea59..04bdb9d 100644 } return NETDEV_TX_OK; -@@ -897,13 +919,8 @@ static int mtk_poll_tx(struct mtk_eth *eth, int budget, bool *tx_again) +@@ -897,13 +919,8 @@ static int mtk_poll_tx(struct mtk_eth *e if (!total) return 0; @@ -84,6 +82,3 @@ index 293ea59..04bdb9d 100644 return total; } --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0066-net-mediatek-fix-mtk_pending_work.patch b/target/linux/mediatek/patches-4.4/0066-net-mediatek-fix-mtk_pending_work.patch index 197419573b..b233578106 100644 --- a/target/linux/mediatek/patches-4.4/0066-net-mediatek-fix-mtk_pending_work.patch +++ b/target/linux/mediatek/patches-4.4/0066-net-mediatek-fix-mtk_pending_work.patch @@ -13,11 +13,9 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.c | 30 +++++++++++++++++++-------- 1 file changed, 21 insertions(+), 9 deletions(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index 04bdb9d..26eeb1a 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1430,19 +1430,31 @@ static int mtk_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) +@@ -1430,19 +1430,31 @@ static int mtk_do_ioctl(struct net_devic static void mtk_pending_work(struct work_struct *work) { @@ -58,6 +56,3 @@ index 04bdb9d..26eeb1a 100644 } rtnl_unlock(); } --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0067-net-mediatek-fix-TX-locking.patch b/target/linux/mediatek/patches-4.4/0067-net-mediatek-fix-TX-locking.patch index da252594cf..d750de6af1 100644 --- a/target/linux/mediatek/patches-4.4/0067-net-mediatek-fix-TX-locking.patch +++ b/target/linux/mediatek/patches-4.4/0067-net-mediatek-fix-TX-locking.patch @@ -15,11 +15,9 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index 26eeb1a..67b18f9 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -536,7 +536,6 @@ static int mtk_tx_map(struct sk_buff *skb, struct net_device *dev, +@@ -536,7 +536,6 @@ static int mtk_tx_map(struct sk_buff *sk struct mtk_eth *eth = mac->hw; struct mtk_tx_dma *itxd, *txd; struct mtk_tx_buf *tx_buf; @@ -27,7 +25,7 @@ index 26eeb1a..67b18f9 100644 dma_addr_t mapped_addr; unsigned int nr_frags; int i, n_desc = 1; -@@ -568,11 +567,6 @@ static int mtk_tx_map(struct sk_buff *skb, struct net_device *dev, +@@ -568,11 +567,6 @@ static int mtk_tx_map(struct sk_buff *sk if (unlikely(dma_mapping_error(&dev->dev, mapped_addr))) return -ENOMEM; @@ -39,7 +37,7 @@ index 26eeb1a..67b18f9 100644 WRITE_ONCE(itxd->txd1, mapped_addr); tx_buf->flags |= MTK_TX_FLAGS_SINGLE0; dma_unmap_addr_set(tx_buf, dma_addr0, mapped_addr); -@@ -632,8 +626,6 @@ static int mtk_tx_map(struct sk_buff *skb, struct net_device *dev, +@@ -632,8 +626,6 @@ static int mtk_tx_map(struct sk_buff *sk WRITE_ONCE(itxd->txd3, (TX_DMA_SWC | TX_DMA_PLEN0(skb_headlen(skb)) | (!nr_frags * TX_DMA_LS0))); @@ -57,7 +55,7 @@ index 26eeb1a..67b18f9 100644 return -ENOMEM; } -@@ -712,14 +702,22 @@ static int mtk_start_xmit(struct sk_buff *skb, struct net_device *dev) +@@ -712,14 +702,22 @@ static int mtk_start_xmit(struct sk_buff struct mtk_eth *eth = mac->hw; struct mtk_tx_ring *ring = ð->tx_ring; struct net_device_stats *stats = &dev->stats; @@ -80,7 +78,7 @@ index 26eeb1a..67b18f9 100644 return NETDEV_TX_BUSY; } -@@ -747,10 +745,12 @@ static int mtk_start_xmit(struct sk_buff *skb, struct net_device *dev) +@@ -747,10 +745,12 @@ static int mtk_start_xmit(struct sk_buff ring->thresh)) mtk_wake_queue(eth); } @@ -93,6 +91,3 @@ index 26eeb1a..67b18f9 100644 stats->tx_dropped++; dev_kfree_skb(skb); return NETDEV_TX_OK; --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0068-net-mediatek-move-the-pending_work-struct-to-the-dev.patch b/target/linux/mediatek/patches-4.4/0068-net-mediatek-move-the-pending_work-struct-to-the-dev.patch index 18f978315e..497309144c 100644 --- a/target/linux/mediatek/patches-4.4/0068-net-mediatek-move-the-pending_work-struct-to-the-dev.patch +++ b/target/linux/mediatek/patches-4.4/0068-net-mediatek-move-the-pending_work-struct-to-the-dev.patch @@ -13,11 +13,9 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.h | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index 67b18f9..bbcd607 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1193,7 +1193,7 @@ static void mtk_tx_timeout(struct net_device *dev) +@@ -1193,7 +1193,7 @@ static void mtk_tx_timeout(struct net_de eth->netdev[mac->id]->stats.tx_errors++; netif_err(eth, tx_err, dev, "transmit timed out\n"); @@ -26,7 +24,7 @@ index 67b18f9..bbcd607 100644 } static irqreturn_t mtk_handle_irq(int irq, void *_eth) -@@ -1438,7 +1438,7 @@ static void mtk_pending_work(struct work_struct *work) +@@ -1438,7 +1438,7 @@ static void mtk_pending_work(struct work /* stop all devices to make sure that dma is properly shut down */ for (i = 0; i < MTK_MAC_COUNT; i++) { @@ -35,7 +33,7 @@ index 67b18f9..bbcd607 100644 continue; mtk_stop(eth->netdev[i]); __set_bit(i, &restart); -@@ -1464,15 +1464,13 @@ static int mtk_cleanup(struct mtk_eth *eth) +@@ -1464,15 +1464,13 @@ static int mtk_cleanup(struct mtk_eth *e int i; for (i = 0; i < MTK_MAC_COUNT; i++) { @@ -52,7 +50,7 @@ index 67b18f9..bbcd607 100644 return 0; } -@@ -1660,7 +1658,6 @@ static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) +@@ -1660,7 +1658,6 @@ static int mtk_add_mac(struct mtk_eth *e mac->id = id; mac->hw = eth; mac->of_node = np; @@ -60,7 +58,7 @@ index 67b18f9..bbcd607 100644 mac->hw_stats = devm_kzalloc(eth->dev, sizeof(*mac->hw_stats), -@@ -1762,6 +1759,7 @@ static int mtk_probe(struct platform_device *pdev) +@@ -1762,6 +1759,7 @@ static int mtk_probe(struct platform_dev eth->dev = &pdev->dev; eth->msg_enable = netif_msg_init(mtk_msg_level, MTK_DEFAULT_MSG_ENABLE); @@ -68,8 +66,6 @@ index 67b18f9..bbcd607 100644 err = mtk_hw_init(eth); if (err) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h -index 48a5292..eed626d 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h @@ -363,6 +363,7 @@ struct mtk_rx_ring { @@ -104,6 +100,3 @@ index 48a5292..eed626d 100644 }; /* the struct describing the SoC. these are declared in the soc_xyz.c files */ --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0069-net-mediatek-do-not-set-the-QID-field-in-the-TX-DMA-.patch b/target/linux/mediatek/patches-4.4/0069-net-mediatek-do-not-set-the-QID-field-in-the-TX-DMA-.patch index a596bb9132..72f96e2174 100644 --- a/target/linux/mediatek/patches-4.4/0069-net-mediatek-do-not-set-the-QID-field-in-the-TX-DMA-.patch +++ b/target/linux/mediatek/patches-4.4/0069-net-mediatek-do-not-set-the-QID-field-in-the-TX-DMA-.patch @@ -18,11 +18,9 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index bbcd607..bab5d45 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -603,8 +603,7 @@ static int mtk_tx_map(struct sk_buff *skb, struct net_device *dev, +@@ -603,8 +603,7 @@ static int mtk_tx_map(struct sk_buff *sk WRITE_ONCE(txd->txd1, mapped_addr); WRITE_ONCE(txd->txd3, (TX_DMA_SWC | TX_DMA_PLEN0(frag_map_size) | @@ -32,6 +30,3 @@ index bbcd607..bab5d45 100644 WRITE_ONCE(txd->txd4, 0); tx_buf->skb = (struct sk_buff *)MTK_DMA_DUMMY_DESC; --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0070-net-mediatek-update-the-IRQ-part-of-the-binding-docu.patch b/target/linux/mediatek/patches-4.4/0070-net-mediatek-update-the-IRQ-part-of-the-binding-docu.patch index b2ceb87087..efc59c06f2 100644 --- a/target/linux/mediatek/patches-4.4/0070-net-mediatek-update-the-IRQ-part-of-the-binding-docu.patch +++ b/target/linux/mediatek/patches-4.4/0070-net-mediatek-update-the-IRQ-part-of-the-binding-docu.patch @@ -16,11 +16,9 @@ Signed-off-by: John Crispin Documentation/devicetree/bindings/net/mediatek-net.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -diff --git a/Documentation/devicetree/bindings/net/mediatek-net.txt b/Documentation/devicetree/bindings/net/mediatek-net.txt -index 5ca7929..32eaaca 100644 --- a/Documentation/devicetree/bindings/net/mediatek-net.txt +++ b/Documentation/devicetree/bindings/net/mediatek-net.txt -@@ -9,7 +9,8 @@ have dual GMAC each represented by a child node.. +@@ -9,7 +9,8 @@ have dual GMAC each represented by a chi Required properties: - compatible: Should be "mediatek,mt7623-eth" - reg: Address and length of the register set for the device @@ -41,6 +39,3 @@ index 5ca7929..32eaaca 100644 power-domains = <&scpsys MT2701_POWER_DOMAIN_ETH>; resets = <ðsys MT2701_ETHSYS_ETH_RST>; reset-names = "eth"; --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0071-pwm-add-pwm-mediatek.patch b/target/linux/mediatek/patches-4.4/0071-pwm-add-pwm-mediatek.patch index 9d7a27eeac..8ca6c491e9 100644 --- a/target/linux/mediatek/patches-4.4/0071-pwm-add-pwm-mediatek.patch +++ b/target/linux/mediatek/patches-4.4/0071-pwm-add-pwm-mediatek.patch @@ -13,8 +13,6 @@ Signed-off-by: John Crispin 5 files changed, 279 insertions(+) create mode 100644 drivers/pwm/pwm-mediatek.c -diff --git a/arch/arm/boot/dts/mt7623-evb.dts b/arch/arm/boot/dts/mt7623-evb.dts -index 5ad1448..70bc6b1 100644 --- a/arch/arm/boot/dts/mt7623-evb.dts +++ b/arch/arm/boot/dts/mt7623-evb.dts @@ -341,6 +341,17 @@ @@ -45,8 +43,6 @@ index 5ad1448..70bc6b1 100644 + pinctrl-0 = <&pwm_pins>; + status = "okay"; +}; -diff --git a/arch/arm/boot/dts/mt7623.dtsi b/arch/arm/boot/dts/mt7623.dtsi -index cbbdf16..3f50e7e 100644 --- a/arch/arm/boot/dts/mt7623.dtsi +++ b/arch/arm/boot/dts/mt7623.dtsi @@ -324,6 +324,28 @@ @@ -78,8 +74,6 @@ index cbbdf16..3f50e7e 100644 spi: spi@1100a000 { compatible = "mediatek,mt7623-spi", "mediatek,mt6589-spi"; reg = <0 0x1100a000 0 0x1000>; -diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig -index 2f4641a..5860b1f 100644 --- a/drivers/pwm/Kconfig +++ b/drivers/pwm/Kconfig @@ -260,6 +260,15 @@ config PWM_MTK_DISP @@ -98,11 +92,9 @@ index 2f4641a..5860b1f 100644 config PWM_MXS tristate "Freescale MXS PWM support" depends on ARCH_MXS && OF -diff --git a/drivers/pwm/Makefile b/drivers/pwm/Makefile -index 69b8275..a90d5de 100644 --- a/drivers/pwm/Makefile +++ b/drivers/pwm/Makefile -@@ -22,6 +22,7 @@ obj-$(CONFIG_PWM_LPC32XX) += pwm-lpc32xx.o +@@ -22,6 +22,7 @@ obj-$(CONFIG_PWM_LPC32XX) += pwm-lpc32xx obj-$(CONFIG_PWM_LPSS) += pwm-lpss.o obj-$(CONFIG_PWM_LPSS_PCI) += pwm-lpss-pci.o obj-$(CONFIG_PWM_LPSS_PLATFORM) += pwm-lpss-platform.o @@ -110,9 +102,6 @@ index 69b8275..a90d5de 100644 obj-$(CONFIG_PWM_MTK_DISP) += pwm-mtk-disp.o obj-$(CONFIG_PWM_MXS) += pwm-mxs.o obj-$(CONFIG_PWM_PCA9685) += pwm-pca9685.o -diff --git a/drivers/pwm/pwm-mediatek.c b/drivers/pwm/pwm-mediatek.c -new file mode 100644 -index 0000000..9d8d16d --- /dev/null +++ b/drivers/pwm/pwm-mediatek.c @@ -0,0 +1,230 @@ @@ -346,6 +335,3 @@ index 0000000..9d8d16d +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("John Crispin "); +MODULE_ALIAS("platform:mtk-pwm"); --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0072-mtd-backport-v4.7-0day-patches-from-Boris.patch b/target/linux/mediatek/patches-4.4/0072-mtd-backport-v4.7-0day-patches-from-Boris.patch index c52557c647..ccbf8d0fb2 100644 --- a/target/linux/mediatek/patches-4.4/0072-mtd-backport-v4.7-0day-patches-from-Boris.patch +++ b/target/linux/mediatek/patches-4.4/0072-mtd-backport-v4.7-0day-patches-from-Boris.patch @@ -55,7 +55,7 @@ Signed-off-by: John Crispin --- a/drivers/mtd/Kconfig +++ b/drivers/mtd/Kconfig -@@ -131,7 +131,7 @@ +@@ -131,7 +131,7 @@ config MTD_CMDLINE_PARTS config MTD_AFS_PARTS tristate "ARM Firmware Suite partition parsing" @@ -64,7 +64,7 @@ Signed-off-by: John Crispin ---help--- The ARM Firmware Suite allows the user to divide flash devices into multiple 'images'. Each such image has a header containing its name -@@ -161,7 +161,7 @@ +@@ -161,7 +161,7 @@ config MTD_AR7_PARTS config MTD_BCM63XX_PARTS tristate "BCM63XX CFE partitioning support" @@ -75,7 +75,7 @@ Signed-off-by: John Crispin This provides partions parsing for BCM63xx devices with CFE --- a/drivers/mtd/cmdlinepart.c +++ b/drivers/mtd/cmdlinepart.c -@@ -304,7 +304,7 @@ +@@ -304,7 +304,7 @@ static int mtdpart_setup_real(char *s) * the first one in the chain if a NULL mtd_id is passed in. */ static int parse_cmdline_partitions(struct mtd_info *master, @@ -84,7 +84,7 @@ Signed-off-by: John Crispin struct mtd_part_parser_data *data) { unsigned long long offset; -@@ -382,7 +382,6 @@ +@@ -382,7 +382,6 @@ static int __init mtdpart_setup(char *s) __setup("mtdparts=", mtdpart_setup); static struct mtd_part_parser cmdline_parser = { @@ -94,7 +94,7 @@ Signed-off-by: John Crispin }; --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c -@@ -174,22 +174,6 @@ +@@ -174,22 +174,6 @@ static int m25p80_read(struct spi_nor *n return 0; } @@ -117,7 +117,7 @@ Signed-off-by: John Crispin /* * board specific setup should have ensured the SPI clock used here * matches what the READ command supports, at least until this driver -@@ -197,12 +181,11 @@ +@@ -197,12 +181,11 @@ static int m25p80_erase(struct spi_nor * */ static int m25p_probe(struct spi_device *spi) { @@ -131,7 +131,7 @@ Signed-off-by: John Crispin int ret; data = dev_get_platdata(&spi->dev); -@@ -216,12 +199,11 @@ +@@ -216,12 +199,11 @@ static int m25p_probe(struct spi_device /* install the hooks */ nor->read = m25p80_read; nor->write = m25p80_write; @@ -145,7 +145,7 @@ Signed-off-by: John Crispin nor->priv = flash; spi_set_drvdata(spi, flash); -@@ -242,6 +224,8 @@ +@@ -242,6 +224,8 @@ static int m25p_probe(struct spi_device */ if (data && data->type) flash_name = data->type; @@ -154,7 +154,7 @@ Signed-off-by: John Crispin else flash_name = spi->modalias; -@@ -249,11 +233,8 @@ +@@ -249,11 +233,8 @@ static int m25p_probe(struct spi_device if (ret) return ret; @@ -168,7 +168,7 @@ Signed-off-by: John Crispin } -@@ -279,14 +260,21 @@ +@@ -279,14 +260,21 @@ static int m25p_remove(struct spi_device */ static const struct spi_device_id m25p_ids[] = { /* @@ -195,7 +195,7 @@ Signed-off-by: John Crispin {"mr25h256"}, --- a/drivers/mtd/maps/physmap_of.c +++ b/drivers/mtd/maps/physmap_of.c -@@ -128,7 +128,6 @@ +@@ -128,7 +128,6 @@ static int of_flash_probe(struct platfor int reg_tuple_size; struct mtd_info **mtd_list = NULL; resource_size_t res_size; @@ -203,7 +203,7 @@ Signed-off-by: John Crispin bool map_indirect; const char *mtd_name = NULL; -@@ -272,8 +271,9 @@ +@@ -272,8 +271,9 @@ static int of_flash_probe(struct platfor if (err) goto err_out; @@ -217,7 +217,7 @@ Signed-off-by: John Crispin kfree(mtd_list); --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c -@@ -465,38 +465,111 @@ +@@ -465,38 +465,111 @@ static int mtdchar_readoob(struct file * } /* @@ -346,7 +346,7 @@ Signed-off-by: John Crispin static int mtdchar_blkpg_ioctl(struct mtd_info *mtd, struct blkpg_ioctl_arg *arg) { -@@ -815,16 +888,12 @@ +@@ -815,16 +888,12 @@ static int mtdchar_ioctl(struct file *fi { struct nand_oobinfo oi; @@ -367,7 +367,7 @@ Signed-off-by: John Crispin if (copy_to_user(argp, &oi, sizeof(struct nand_oobinfo))) return -EFAULT; -@@ -913,14 +982,14 @@ +@@ -913,14 +982,14 @@ static int mtdchar_ioctl(struct file *fi { struct nand_ecclayout_user *usrlay; @@ -386,7 +386,7 @@ Signed-off-by: John Crispin ret = -EFAULT; --- a/drivers/mtd/mtdconcat.c +++ b/drivers/mtd/mtdconcat.c -@@ -777,7 +777,7 @@ +@@ -777,7 +777,7 @@ struct mtd_info *mtd_concat_create(struc } @@ -405,7 +405,7 @@ Signed-off-by: John Crispin #include #include #include -@@ -446,6 +447,7 @@ +@@ -446,6 +447,7 @@ int add_mtd_device(struct mtd_info *mtd) mtd->dev.devt = MTD_DEVT(i); dev_set_name(&mtd->dev, "mtd%d", i); dev_set_drvdata(&mtd->dev, mtd); @@ -413,7 +413,7 @@ Signed-off-by: John Crispin error = device_register(&mtd->dev); if (error) goto fail_added; -@@ -477,6 +479,7 @@ +@@ -477,6 +479,7 @@ int add_mtd_device(struct mtd_info *mtd) return 0; fail_added: @@ -421,7 +421,7 @@ Signed-off-by: John Crispin idr_remove(&mtd_idr, i); fail_locked: mutex_unlock(&mtd_table_mutex); -@@ -518,6 +521,7 @@ +@@ -518,6 +521,7 @@ int del_mtd_device(struct mtd_info *mtd) device_unregister(&mtd->dev); idr_remove(&mtd_idr, mtd->index); @@ -429,7 +429,7 @@ Signed-off-by: John Crispin module_put(THIS_MODULE); ret = 0; -@@ -529,9 +533,10 @@ +@@ -529,9 +533,10 @@ out_error: } static int mtd_add_device_partitions(struct mtd_info *mtd, @@ -442,7 +442,7 @@ Signed-off-by: John Crispin int ret; if (nbparts == 0 || IS_ENABLED(CONFIG_MTD_PARTITIONED_MASTER)) { -@@ -600,29 +605,29 @@ +@@ -600,29 +605,29 @@ int mtd_device_parse_register(struct mtd const struct mtd_partition *parts, int nr_parts) { @@ -487,7 +487,7 @@ Signed-off-by: John Crispin if (ret) goto out; -@@ -642,7 +647,8 @@ +@@ -642,7 +647,8 @@ int mtd_device_parse_register(struct mtd } out: @@ -497,7 +497,7 @@ Signed-off-by: John Crispin return ret; } EXPORT_SYMBOL_GPL(mtd_device_parse_register); -@@ -767,7 +773,6 @@ +@@ -767,7 +773,6 @@ out: } EXPORT_SYMBOL_GPL(get_mtd_device); @@ -505,7 +505,7 @@ Signed-off-by: John Crispin int __get_mtd_device(struct mtd_info *mtd) { int err; -@@ -1001,6 +1006,366 @@ +@@ -1001,6 +1006,366 @@ int mtd_read_oob(struct mtd_info *mtd, l } EXPORT_SYMBOL_GPL(mtd_read_oob); @@ -874,7 +874,7 @@ Signed-off-by: John Crispin * devices. The user data is one time programmable but the factory data is read --- a/drivers/mtd/mtdcore.h +++ b/drivers/mtd/mtdcore.h -@@ -10,10 +10,15 @@ +@@ -10,10 +10,15 @@ int add_mtd_device(struct mtd_info *mtd) int del_mtd_device(struct mtd_info *mtd); int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *, int); int del_mtd_partitions(struct mtd_info *); @@ -893,7 +893,7 @@ Signed-off-by: John Crispin --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -55,9 +55,12 @@ +@@ -55,9 +55,12 @@ static void mtd_partition_split(struct m /* * Given a pointer to the MTD object in the mtd_part structure, we can retrieve @@ -908,7 +908,7 @@ Signed-off-by: John Crispin /* -@@ -68,7 +71,7 @@ +@@ -68,7 +71,7 @@ static void mtd_partition_split(struct m static int part_read(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf) { @@ -917,7 +917,7 @@ Signed-off-by: John Crispin struct mtd_ecc_stats stats; int res; -@@ -87,7 +90,7 @@ +@@ -87,7 +90,7 @@ static int part_read(struct mtd_info *mt static int part_point(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, void **virt, resource_size_t *phys) { @@ -926,7 +926,7 @@ Signed-off-by: John Crispin return part->master->_point(part->master, from + part->offset, len, retlen, virt, phys); -@@ -95,7 +98,7 @@ +@@ -95,7 +98,7 @@ static int part_point(struct mtd_info *m static int part_unpoint(struct mtd_info *mtd, loff_t from, size_t len) { @@ -935,7 +935,7 @@ Signed-off-by: John Crispin return part->master->_unpoint(part->master, from + part->offset, len); } -@@ -105,7 +108,7 @@ +@@ -105,7 +108,7 @@ static unsigned long part_get_unmapped_a unsigned long offset, unsigned long flags) { @@ -944,7 +944,7 @@ Signed-off-by: John Crispin offset += part->offset; return part->master->_get_unmapped_area(part->master, len, offset, -@@ -115,7 +118,7 @@ +@@ -115,7 +118,7 @@ static unsigned long part_get_unmapped_a static int part_read_oob(struct mtd_info *mtd, loff_t from, struct mtd_oob_ops *ops) { @@ -953,7 +953,7 @@ Signed-off-by: John Crispin int res; if (from >= mtd->size) -@@ -130,10 +133,7 @@ +@@ -130,10 +133,7 @@ static int part_read_oob(struct mtd_info if (ops->oobbuf) { size_t len, pages; @@ -965,7 +965,7 @@ Signed-off-by: John Crispin pages = mtd_div_by_ws(mtd->size, mtd); pages -= mtd_div_by_ws(from, mtd); if (ops->ooboffs + ops->ooblen > pages * len) -@@ -153,7 +153,7 @@ +@@ -153,7 +153,7 @@ static int part_read_oob(struct mtd_info static int part_read_user_prot_reg(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf) { @@ -974,7 +974,7 @@ Signed-off-by: John Crispin return part->master->_read_user_prot_reg(part->master, from, len, retlen, buf); } -@@ -161,7 +161,7 @@ +@@ -161,7 +161,7 @@ static int part_read_user_prot_reg(struc static int part_get_user_prot_info(struct mtd_info *mtd, size_t len, size_t *retlen, struct otp_info *buf) { @@ -983,7 +983,7 @@ Signed-off-by: John Crispin return part->master->_get_user_prot_info(part->master, len, retlen, buf); } -@@ -169,7 +169,7 @@ +@@ -169,7 +169,7 @@ static int part_get_user_prot_info(struc static int part_read_fact_prot_reg(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf) { @@ -992,7 +992,7 @@ Signed-off-by: John Crispin return part->master->_read_fact_prot_reg(part->master, from, len, retlen, buf); } -@@ -177,7 +177,7 @@ +@@ -177,7 +177,7 @@ static int part_read_fact_prot_reg(struc static int part_get_fact_prot_info(struct mtd_info *mtd, size_t len, size_t *retlen, struct otp_info *buf) { @@ -1001,7 +1001,7 @@ Signed-off-by: John Crispin return part->master->_get_fact_prot_info(part->master, len, retlen, buf); } -@@ -185,7 +185,7 @@ +@@ -185,7 +185,7 @@ static int part_get_fact_prot_info(struc static int part_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf) { @@ -1010,7 +1010,7 @@ Signed-off-by: John Crispin return part->master->_write(part->master, to + part->offset, len, retlen, buf); } -@@ -193,7 +193,7 @@ +@@ -193,7 +193,7 @@ static int part_write(struct mtd_info *m static int part_panic_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf) { @@ -1019,7 +1019,7 @@ Signed-off-by: John Crispin return part->master->_panic_write(part->master, to + part->offset, len, retlen, buf); } -@@ -201,7 +201,7 @@ +@@ -201,7 +201,7 @@ static int part_panic_write(struct mtd_i static int part_write_oob(struct mtd_info *mtd, loff_t to, struct mtd_oob_ops *ops) { @@ -1028,7 +1028,7 @@ Signed-off-by: John Crispin if (to >= mtd->size) return -EINVAL; -@@ -213,7 +213,7 @@ +@@ -213,7 +213,7 @@ static int part_write_oob(struct mtd_inf static int part_write_user_prot_reg(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf) { @@ -1037,7 +1037,7 @@ Signed-off-by: John Crispin return part->master->_write_user_prot_reg(part->master, from, len, retlen, buf); } -@@ -221,21 +221,21 @@ +@@ -221,21 +221,21 @@ static int part_write_user_prot_reg(stru static int part_lock_user_prot_reg(struct mtd_info *mtd, loff_t from, size_t len) { @@ -1062,7 +1062,7 @@ Signed-off-by: John Crispin int ret; -@@ -299,7 +299,7 @@ +@@ -299,7 +299,7 @@ static int part_erase(struct mtd_info *m void mtd_erase_callback(struct erase_info *instr) { if (instr->mtd->_erase == part_erase) { @@ -1071,7 +1071,7 @@ Signed-off-by: John Crispin size_t wrlen = 0; if (instr->mtd->flags & MTD_ERASE_PARTIAL) { -@@ -330,13 +330,13 @@ +@@ -330,13 +330,13 @@ EXPORT_SYMBOL_GPL(mtd_erase_callback); static int part_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len) { @@ -1087,7 +1087,7 @@ Signed-off-by: John Crispin ofs += part->offset; if (mtd->flags & MTD_ERASE_PARTIAL) { -@@ -349,45 +349,45 @@ +@@ -349,45 +349,45 @@ static int part_unlock(struct mtd_info * static int part_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len) { @@ -1140,7 +1140,7 @@ Signed-off-by: John Crispin int res; ofs += part->offset; -@@ -397,6 +397,27 @@ +@@ -397,6 +397,27 @@ static int part_block_markbad(struct mtd return res; } @@ -1168,7 +1168,7 @@ Signed-off-by: John Crispin static inline void free_partition(struct mtd_part *p) { kfree(p->mtd.name); -@@ -614,7 +635,7 @@ +@@ -614,7 +635,7 @@ static struct mtd_part *allocate_partiti slave->mtd.erasesize = slave->mtd.size; } @@ -1177,7 +1177,7 @@ Signed-off-by: John Crispin slave->mtd.ecc_step_size = master->ecc_step_size; slave->mtd.ecc_strength = master->ecc_strength; slave->mtd.bitflip_threshold = master->bitflip_threshold; -@@ -639,7 +660,7 @@ +@@ -639,7 +660,7 @@ static ssize_t mtd_partition_offset_show struct device_attribute *attr, char *buf) { struct mtd_info *mtd = dev_get_drvdata(dev); @@ -1186,7 +1186,7 @@ Signed-off-by: John Crispin return snprintf(buf, PAGE_SIZE, "%lld\n", part->offset); } -@@ -677,11 +698,10 @@ +@@ -677,11 +698,10 @@ int mtd_add_partition(struct mtd_info *m if (length <= 0) return -EINVAL; @@ -1199,7 +1199,7 @@ Signed-off-by: John Crispin new = allocate_partition(master, &part, -1, offset); if (IS_ERR(new)) -@@ -845,7 +865,7 @@ +@@ -845,7 +865,7 @@ int add_mtd_partitions(struct mtd_info * static DEFINE_SPINLOCK(part_parser_lock); static LIST_HEAD(part_parsers); @@ -1208,7 +1208,7 @@ Signed-off-by: John Crispin { struct mtd_part_parser *p, *ret = NULL; -@@ -862,7 +882,20 @@ +@@ -862,7 +882,20 @@ static struct mtd_part_parser *get_parti return ret; } @@ -1230,7 +1230,7 @@ Signed-off-by: John Crispin static struct mtd_part_parser * get_partition_parser_by_type(enum mtd_parser_type type, -@@ -874,7 +907,7 @@ +@@ -874,7 +907,7 @@ get_partition_parser_by_type(enum mtd_pa p = list_prepare_entry(start, &part_parsers, list); if (start) @@ -1239,7 +1239,7 @@ Signed-off-by: John Crispin list_for_each_entry_continue(p, &part_parsers, list) { if (p->type == type && try_module_get(p->owner)) { -@@ -888,13 +921,19 @@ +@@ -888,13 +921,19 @@ get_partition_parser_by_type(enum mtd_pa return ret; } @@ -1262,7 +1262,7 @@ Signed-off-by: John Crispin void deregister_mtd_parser(struct mtd_part_parser *p) { -@@ -954,7 +993,7 @@ +@@ -954,7 +993,7 @@ static const char * const default_mtd_pa * parse_mtd_partitions - parse MTD partitions * @master: the master partition (describes whole MTD device) * @types: names of partition parsers to try or %NULL @@ -1271,7 +1271,7 @@ Signed-off-by: John Crispin * @data: MTD partition parser-specific data * * This function tries to find partition on MTD device @master. It uses MTD -@@ -966,45 +1005,42 @@ +@@ -966,45 +1005,42 @@ static const char * const default_mtd_pa * * This function may return: * o a negative error code in case of failure @@ -1329,7 +1329,7 @@ Signed-off-by: John Crispin /* * Stash the first error we see; only report it if no parser * succeeds -@@ -1034,7 +1070,7 @@ +@@ -1034,7 +1070,7 @@ int parse_mtd_partitions_by_type(struct ret = (*parser->parse_fn)(master, pparts, data); if (ret > 0) { @@ -1338,7 +1338,7 @@ Signed-off-by: John Crispin printk(KERN_NOTICE "%d %s partitions found on MTD device %s\n", ret, parser->name, master->name); -@@ -1048,6 +1084,22 @@ +@@ -1048,6 +1084,22 @@ int parse_mtd_partitions_by_type(struct } EXPORT_SYMBOL_GPL(parse_mtd_partitions_by_type); @@ -1361,7 +1361,7 @@ Signed-off-by: John Crispin int mtd_is_partition(const struct mtd_info *mtd) { struct mtd_part *part; -@@ -1070,7 +1122,7 @@ +@@ -1070,7 +1122,7 @@ struct mtd_info *mtdpart_get_master(cons if (!mtd_is_partition(mtd)) return (struct mtd_info *)mtd; @@ -1370,7 +1370,7 @@ Signed-off-by: John Crispin } EXPORT_SYMBOL_GPL(mtdpart_get_master); -@@ -1079,7 +1131,7 @@ +@@ -1079,7 +1131,7 @@ uint64_t mtdpart_get_offset(const struct if (!mtd_is_partition(mtd)) return 0; @@ -1379,7 +1379,7 @@ Signed-off-by: John Crispin } EXPORT_SYMBOL_GPL(mtdpart_get_offset); -@@ -1089,6 +1141,6 @@ +@@ -1089,6 +1141,6 @@ uint64_t mtd_get_device_size(const struc if (!mtd_is_partition(mtd)) return mtd->size; @@ -1389,7 +1389,7 @@ Signed-off-by: John Crispin EXPORT_SYMBOL_GPL(mtd_get_device_size); --- a/drivers/mtd/mtdswap.c +++ b/drivers/mtd/mtdswap.c -@@ -346,7 +346,7 @@ +@@ -346,7 +346,7 @@ static int mtdswap_read_markers(struct m if (mtd_can_have_bb(d->mtd) && mtd_block_isbad(d->mtd, offset)) return MTDSWAP_SCANNED_BAD; @@ -1398,7 +1398,7 @@ Signed-off-by: John Crispin ops.oobbuf = d->oob_buf; ops.ooboffs = 0; ops.datbuf = NULL; -@@ -359,7 +359,7 @@ +@@ -359,7 +359,7 @@ static int mtdswap_read_markers(struct m data = (struct mtdswap_oobdata *)d->oob_buf; data2 = (struct mtdswap_oobdata *) @@ -1407,7 +1407,7 @@ Signed-off-by: John Crispin if (le16_to_cpu(data->magic) == MTDSWAP_MAGIC_CLEAN) { eb->erase_count = le32_to_cpu(data->count); -@@ -933,7 +933,7 @@ +@@ -933,7 +933,7 @@ static unsigned int mtdswap_eblk_passes( ops.mode = MTD_OPS_AUTO_OOB; ops.len = mtd->writesize; @@ -1416,7 +1416,7 @@ Signed-off-by: John Crispin ops.ooboffs = 0; ops.datbuf = d->page_buf; ops.oobbuf = d->oob_buf; -@@ -945,7 +945,7 @@ +@@ -945,7 +945,7 @@ static unsigned int mtdswap_eblk_passes( for (i = 0; i < mtd_pages; i++) { patt = mtdswap_test_patt(test + i); memset(d->page_buf, patt, mtd->writesize); @@ -1425,7 +1425,7 @@ Signed-off-by: John Crispin ret = mtd_write_oob(mtd, pos, &ops); if (ret) goto error; -@@ -964,7 +964,7 @@ +@@ -964,7 +964,7 @@ static unsigned int mtdswap_eblk_passes( if (p1[j] != patt) goto error; @@ -1434,7 +1434,7 @@ Signed-off-by: John Crispin if (p2[j] != (unsigned char)patt) goto error; -@@ -1387,7 +1387,7 @@ +@@ -1387,7 +1387,7 @@ static int mtdswap_init(struct mtdswap_d if (!d->page_buf) goto page_buf_fail; @@ -1443,7 +1443,7 @@ Signed-off-by: John Crispin if (!d->oob_buf) goto oob_buf_fail; -@@ -1417,7 +1417,6 @@ +@@ -1417,7 +1417,6 @@ static void mtdswap_add_mtd(struct mtd_b unsigned long part; unsigned int eblocks, eavailable, bad_blocks, spare_cnt; uint64_t swap_size, use_size, size_limit; @@ -1451,7 +1451,7 @@ Signed-off-by: John Crispin int ret; parts = &partitions[0]; -@@ -1447,17 +1446,10 @@ +@@ -1447,17 +1446,10 @@ static void mtdswap_add_mtd(struct mtd_b return; } @@ -1473,7 +1473,7 @@ Signed-off-by: John Crispin --- a/drivers/mtd/nand/Kconfig +++ b/drivers/mtd/nand/Kconfig -@@ -55,7 +55,7 @@ +@@ -55,7 +55,7 @@ config MTD_NAND_DENALI_PCI config MTD_NAND_DENALI_DT tristate "Support Denali NAND controller as a DT device" select MTD_NAND_DENALI @@ -1482,7 +1482,7 @@ Signed-off-by: John Crispin help Enable the driver for NAND flash on platforms using a Denali NAND controller as a DT device. -@@ -74,6 +74,7 @@ +@@ -74,6 +74,7 @@ config MTD_NAND_DENALI_SCRATCH_REG_ADDR config MTD_NAND_GPIO tristate "GPIO assisted NAND Flash driver" depends on GPIOLIB || COMPILE_TEST @@ -1490,7 +1490,7 @@ Signed-off-by: John Crispin help This enables a NAND flash driver where control signals are connected to GPIO pins, and commands and data are communicated -@@ -310,6 +311,7 @@ +@@ -310,6 +311,7 @@ config MTD_NAND_CAFE config MTD_NAND_CS553X tristate "NAND support for CS5535/CS5536 (AMD Geode companion chip)" depends on X86_32 @@ -1498,7 +1498,7 @@ Signed-off-by: John Crispin help The CS553x companion chips for the AMD Geode processor include NAND flash controllers with built-in hardware ECC -@@ -463,6 +465,7 @@ +@@ -463,6 +465,7 @@ config MTD_NAND_MPC5121_NFC config MTD_NAND_VF610_NFC tristate "Support for Freescale NFC for VF610/MPC5125" depends on (SOC_VF610 || COMPILE_TEST) @@ -1506,7 +1506,7 @@ Signed-off-by: John Crispin help Enables support for NAND Flash Controller on some Freescale processors like the VF610, MPC5125, MCF54418 or Kinetis K70. -@@ -480,7 +483,7 @@ +@@ -480,7 +483,7 @@ config MTD_NAND_MXC config MTD_NAND_SH_FLCTL tristate "Support for NAND on Renesas SuperH FLCTL" @@ -1515,7 +1515,7 @@ Signed-off-by: John Crispin depends on HAS_IOMEM depends on HAS_DMA help -@@ -519,6 +522,13 @@ +@@ -519,6 +522,13 @@ config MTD_NAND_JZ4740 help Enables support for NAND Flash on JZ4740 SoC based boards. @@ -1529,7 +1529,7 @@ Signed-off-by: John Crispin config MTD_NAND_FSMC tristate "Support for NAND on ST Micros FSMC" depends on PLAT_SPEAR || ARCH_NOMADIK || ARCH_U8500 || MACH_U300 -@@ -546,4 +556,11 @@ +@@ -546,4 +556,11 @@ config MTD_NAND_HISI504 help Enables support for NAND controller on Hisilicon SoC Hip04. @@ -1543,7 +1543,7 @@ Signed-off-by: John Crispin endif # MTD_NAND --- a/drivers/mtd/nand/Makefile +++ b/drivers/mtd/nand/Makefile -@@ -49,11 +49,13 @@ +@@ -49,11 +49,13 @@ obj-$(CONFIG_MTD_NAND_MPC5121_NFC) += mp obj-$(CONFIG_MTD_NAND_VF610_NFC) += vf610_nfc.o obj-$(CONFIG_MTD_NAND_RICOH) += r852.o obj-$(CONFIG_MTD_NAND_JZ4740) += jz4740_nand.o @@ -1610,7 +1610,7 @@ Signed-off-by: John Crispin static int nand_get_device(struct mtd_info *mtd, int new_state); static int nand_do_write_oob(struct mtd_info *mtd, loff_t to, -@@ -103,10 +59,96 @@ +@@ -103,10 +59,96 @@ static int nand_do_write_oob(struct mtd_ */ DEFINE_LED_TRIGGER(nand_led_trigger); @@ -1708,7 +1708,7 @@ Signed-off-by: John Crispin int ret = 0; /* Start address must align on block boundary */ -@@ -132,7 +174,7 @@ +@@ -132,7 +174,7 @@ static int check_offs_len(struct mtd_inf */ static void nand_release_device(struct mtd_info *mtd) { @@ -1717,7 +1717,7 @@ Signed-off-by: John Crispin /* Release the controller and the chip */ spin_lock(&chip->controller->lock); -@@ -150,7 +192,7 @@ +@@ -150,7 +192,7 @@ static void nand_release_device(struct m */ static uint8_t nand_read_byte(struct mtd_info *mtd) { @@ -1726,7 +1726,7 @@ Signed-off-by: John Crispin return readb(chip->IO_ADDR_R); } -@@ -163,7 +205,7 @@ +@@ -163,7 +205,7 @@ static uint8_t nand_read_byte(struct mtd */ static uint8_t nand_read_byte16(struct mtd_info *mtd) { @@ -1735,7 +1735,7 @@ Signed-off-by: John Crispin return (uint8_t) cpu_to_le16(readw(chip->IO_ADDR_R)); } -@@ -175,7 +217,7 @@ +@@ -175,7 +217,7 @@ static uint8_t nand_read_byte16(struct m */ static u16 nand_read_word(struct mtd_info *mtd) { @@ -1744,7 +1744,7 @@ Signed-off-by: John Crispin return readw(chip->IO_ADDR_R); } -@@ -188,7 +230,7 @@ +@@ -188,7 +230,7 @@ static u16 nand_read_word(struct mtd_inf */ static void nand_select_chip(struct mtd_info *mtd, int chipnr) { @@ -1753,7 +1753,7 @@ Signed-off-by: John Crispin switch (chipnr) { case -1: -@@ -211,7 +253,7 @@ +@@ -211,7 +253,7 @@ static void nand_select_chip(struct mtd_ */ static void nand_write_byte(struct mtd_info *mtd, uint8_t byte) { @@ -1762,7 +1762,7 @@ Signed-off-by: John Crispin chip->write_buf(mtd, &byte, 1); } -@@ -225,7 +267,7 @@ +@@ -225,7 +267,7 @@ static void nand_write_byte(struct mtd_i */ static void nand_write_byte16(struct mtd_info *mtd, uint8_t byte) { @@ -1771,7 +1771,7 @@ Signed-off-by: John Crispin uint16_t word = byte; /* -@@ -257,7 +299,7 @@ +@@ -257,7 +299,7 @@ static void nand_write_byte16(struct mtd */ static void nand_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len) { @@ -1780,7 +1780,7 @@ Signed-off-by: John Crispin iowrite8_rep(chip->IO_ADDR_W, buf, len); } -@@ -272,7 +314,7 @@ +@@ -272,7 +314,7 @@ static void nand_write_buf(struct mtd_in */ static void nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) { @@ -1789,7 +1789,7 @@ Signed-off-by: John Crispin ioread8_rep(chip->IO_ADDR_R, buf, len); } -@@ -287,7 +329,7 @@ +@@ -287,7 +329,7 @@ static void nand_read_buf(struct mtd_inf */ static void nand_write_buf16(struct mtd_info *mtd, const uint8_t *buf, int len) { @@ -1798,7 +1798,7 @@ Signed-off-by: John Crispin u16 *p = (u16 *) buf; iowrite16_rep(chip->IO_ADDR_W, p, len >> 1); -@@ -303,7 +345,7 @@ +@@ -303,7 +345,7 @@ static void nand_write_buf16(struct mtd_ */ static void nand_read_buf16(struct mtd_info *mtd, uint8_t *buf, int len) { @@ -1807,7 +1807,7 @@ Signed-off-by: John Crispin u16 *p = (u16 *) buf; ioread16_rep(chip->IO_ADDR_R, p, len >> 1); -@@ -313,14 +355,13 @@ +@@ -313,14 +355,13 @@ static void nand_read_buf16(struct mtd_i * nand_block_bad - [DEFAULT] Read bad block marker from the chip * @mtd: MTD device structure * @ofs: offset from device start @@ -1825,7 +1825,7 @@ Signed-off-by: John Crispin u16 bad; if (chip->bbt_options & NAND_BBT_SCANLASTPAGE) -@@ -328,15 +369,6 @@ +@@ -328,15 +369,6 @@ static int nand_block_bad(struct mtd_inf page = (int)(ofs >> chip->page_shift) & chip->pagemask; @@ -1841,7 +1841,7 @@ Signed-off-by: John Crispin do { if (chip->options & NAND_BUSWIDTH_16) { chip->cmdfunc(mtd, NAND_CMD_READOOB, -@@ -361,11 +393,6 @@ +@@ -361,11 +393,6 @@ static int nand_block_bad(struct mtd_inf i++; } while (!res && i < 2 && (chip->bbt_options & NAND_BBT_SCAN2NDPAGE)); @@ -1853,7 +1853,7 @@ Signed-off-by: John Crispin return res; } -@@ -380,7 +407,7 @@ +@@ -380,7 +407,7 @@ static int nand_block_bad(struct mtd_inf */ static int nand_default_block_markbad(struct mtd_info *mtd, loff_t ofs) { @@ -1862,7 +1862,7 @@ Signed-off-by: John Crispin struct mtd_oob_ops ops; uint8_t buf[2] = { 0, 0 }; int ret = 0, res, i = 0; -@@ -430,7 +457,7 @@ +@@ -430,7 +457,7 @@ static int nand_default_block_markbad(st */ static int nand_block_markbad_lowlevel(struct mtd_info *mtd, loff_t ofs) { @@ -1871,7 +1871,7 @@ Signed-off-by: John Crispin int res, ret = 0; if (!(chip->bbt_options & NAND_BBT_NO_OOB_BBM)) { -@@ -471,7 +498,7 @@ +@@ -471,7 +498,7 @@ static int nand_block_markbad_lowlevel(s */ static int nand_check_wp(struct mtd_info *mtd) { @@ -1880,7 +1880,7 @@ Signed-off-by: John Crispin /* Broken xD cards report WP despite being writable */ if (chip->options & NAND_BROKEN_XD) -@@ -491,7 +518,7 @@ +@@ -491,7 +518,7 @@ static int nand_check_wp(struct mtd_info */ static int nand_block_isreserved(struct mtd_info *mtd, loff_t ofs) { @@ -1889,7 +1889,7 @@ Signed-off-by: John Crispin if (!chip->bbt) return 0; -@@ -503,19 +530,17 @@ +@@ -503,19 +530,17 @@ static int nand_block_isreserved(struct * nand_block_checkbad - [GENERIC] Check if a block is marked bad * @mtd: MTD device structure * @ofs: offset from device start @@ -1912,7 +1912,7 @@ Signed-off-by: John Crispin /* Return info from the table */ return nand_isbad_bbt(mtd, ofs, allowbbt); -@@ -531,7 +556,7 @@ +@@ -531,7 +556,7 @@ static int nand_block_checkbad(struct mt */ static void panic_nand_wait_ready(struct mtd_info *mtd, unsigned long timeo) { @@ -1921,7 +1921,7 @@ Signed-off-by: John Crispin int i; /* Wait for the device to get ready */ -@@ -551,7 +576,7 @@ +@@ -551,7 +576,7 @@ static void panic_nand_wait_ready(struct */ void nand_wait_ready(struct mtd_info *mtd) { @@ -1930,7 +1930,7 @@ Signed-off-by: John Crispin unsigned long timeo = 400; if (in_interrupt() || oops_in_progress) -@@ -566,8 +591,8 @@ +@@ -566,8 +591,8 @@ void nand_wait_ready(struct mtd_info *mt cond_resched(); } while (time_before(jiffies, timeo)); @@ -1941,7 +1941,7 @@ Signed-off-by: John Crispin out: led_trigger_event(nand_led_trigger, LED_OFF); } -@@ -582,7 +607,7 @@ +@@ -582,7 +607,7 @@ EXPORT_SYMBOL_GPL(nand_wait_ready); */ static void nand_wait_status_ready(struct mtd_info *mtd, unsigned long timeo) { @@ -1950,7 +1950,7 @@ Signed-off-by: John Crispin timeo = jiffies + msecs_to_jiffies(timeo); do { -@@ -605,7 +630,7 @@ +@@ -605,7 +630,7 @@ static void nand_wait_status_ready(struc static void nand_command(struct mtd_info *mtd, unsigned int command, int column, int page_addr) { @@ -1959,7 +1959,7 @@ Signed-off-by: John Crispin int ctrl = NAND_CTRL_CLE | NAND_CTRL_CHANGE; /* Write out the command to the device */ -@@ -708,7 +733,7 @@ +@@ -708,7 +733,7 @@ static void nand_command(struct mtd_info static void nand_command_lp(struct mtd_info *mtd, unsigned int command, int column, int page_addr) { @@ -1968,7 +1968,7 @@ Signed-off-by: John Crispin /* Emulate NAND_CMD_READOOB */ if (command == NAND_CMD_READOOB) { -@@ -832,7 +857,7 @@ +@@ -832,7 +857,7 @@ static void panic_nand_get_device(struct static int nand_get_device(struct mtd_info *mtd, int new_state) { @@ -1977,7 +1977,7 @@ Signed-off-by: John Crispin spinlock_t *lock = &chip->controller->lock; wait_queue_head_t *wq = &chip->controller->wq; DECLARE_WAITQUEUE(wait, current); -@@ -952,7 +977,7 @@ +@@ -952,7 +977,7 @@ static int __nand_unlock(struct mtd_info { int ret = 0; int status, page; @@ -1986,7 +1986,7 @@ Signed-off-by: John Crispin /* Submit address of first page to unlock */ page = ofs >> chip->page_shift; -@@ -987,7 +1012,7 @@ +@@ -987,7 +1012,7 @@ int nand_unlock(struct mtd_info *mtd, lo { int ret = 0; int chipnr; @@ -1995,7 +1995,7 @@ Signed-off-by: John Crispin pr_debug("%s: start = 0x%012llx, len = %llu\n", __func__, (unsigned long long)ofs, len); -@@ -1050,7 +1075,7 @@ +@@ -1050,7 +1075,7 @@ int nand_lock(struct mtd_info *mtd, loff { int ret = 0; int chipnr, status, page; @@ -2004,7 +2004,7 @@ Signed-off-by: John Crispin pr_debug("%s: start = 0x%012llx, len = %llu\n", __func__, (unsigned long long)ofs, len); -@@ -1309,13 +1334,12 @@ +@@ -1309,13 +1334,12 @@ static int nand_read_page_raw_syndrome(s static int nand_read_page_swecc(struct mtd_info *mtd, struct nand_chip *chip, uint8_t *buf, int oob_required, int page) { @@ -2019,7 +2019,7 @@ Signed-off-by: John Crispin unsigned int max_bitflips = 0; chip->ecc.read_page_raw(mtd, chip, buf, 1, page); -@@ -1323,8 +1347,10 @@ +@@ -1323,8 +1347,10 @@ static int nand_read_page_swecc(struct m for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) chip->ecc.calculate(mtd, p, &ecc_calc[i]); @@ -2032,7 +2032,7 @@ Signed-off-by: John Crispin eccsteps = chip->ecc.steps; p = buf; -@@ -1356,14 +1382,14 @@ +@@ -1356,14 +1382,14 @@ static int nand_read_subpage(struct mtd_ uint32_t data_offs, uint32_t readlen, uint8_t *bufpoi, int page) { @@ -2050,7 +2050,7 @@ Signed-off-by: John Crispin /* Column address within the page aligned to ECC size (256bytes) */ start_step = data_offs / chip->ecc.size; -@@ -1391,12 +1417,13 @@ +@@ -1391,12 +1417,13 @@ static int nand_read_subpage(struct mtd_ * The performance is faster if we position offsets according to * ecc.pos. Let's make sure that there are no gaps in ECC positions. */ @@ -2070,7 +2070,7 @@ Signed-off-by: John Crispin if (gaps) { chip->cmdfunc(mtd, NAND_CMD_RNDOUT, mtd->writesize, -1); chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); -@@ -1405,20 +1432,23 @@ +@@ -1405,20 +1432,23 @@ static int nand_read_subpage(struct mtd_ * Send the command to read the particular ECC bytes take care * about buswidth alignment in read_buf. */ @@ -2100,7 +2100,7 @@ Signed-off-by: John Crispin p = bufpoi + data_col_addr; for (i = 0; i < eccfrag_len ; i += chip->ecc.bytes, p += chip->ecc.size) { -@@ -1426,6 +1456,16 @@ +@@ -1426,6 +1456,16 @@ static int nand_read_subpage(struct mtd_ stat = chip->ecc.correct(mtd, p, &chip->buffers->ecccode[i], &chip->buffers->ecccalc[i]); @@ -2117,7 +2117,7 @@ Signed-off-by: John Crispin if (stat < 0) { mtd->ecc_stats.failed++; } else { -@@ -1449,13 +1489,12 @@ +@@ -1449,13 +1489,12 @@ static int nand_read_subpage(struct mtd_ static int nand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip, uint8_t *buf, int oob_required, int page) { @@ -2132,7 +2132,7 @@ Signed-off-by: John Crispin unsigned int max_bitflips = 0; for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) { -@@ -1465,8 +1504,10 @@ +@@ -1465,8 +1504,10 @@ static int nand_read_page_hwecc(struct m } chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); @@ -2145,7 +2145,7 @@ Signed-off-by: John Crispin eccsteps = chip->ecc.steps; p = buf; -@@ -1475,6 +1516,15 @@ +@@ -1475,6 +1516,15 @@ static int nand_read_page_hwecc(struct m int stat; stat = chip->ecc.correct(mtd, p, &ecc_code[i], &ecc_calc[i]); @@ -2161,7 +2161,7 @@ Signed-off-by: John Crispin if (stat < 0) { mtd->ecc_stats.failed++; } else { -@@ -1502,12 +1552,11 @@ +@@ -1502,12 +1552,11 @@ static int nand_read_page_hwecc(struct m static int nand_read_page_hwecc_oob_first(struct mtd_info *mtd, struct nand_chip *chip, uint8_t *buf, int oob_required, int page) { @@ -2175,7 +2175,7 @@ Signed-off-by: John Crispin uint8_t *ecc_calc = chip->buffers->ecccalc; unsigned int max_bitflips = 0; -@@ -1516,8 +1565,10 @@ +@@ -1516,8 +1565,10 @@ static int nand_read_page_hwecc_oob_firs chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); chip->cmdfunc(mtd, NAND_CMD_READ0, 0, page); @@ -2188,7 +2188,7 @@ Signed-off-by: John Crispin for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) { int stat; -@@ -1527,6 +1578,15 @@ +@@ -1527,6 +1578,15 @@ static int nand_read_page_hwecc_oob_firs chip->ecc.calculate(mtd, p, &ecc_calc[i]); stat = chip->ecc.correct(mtd, p, &ecc_code[i], NULL); @@ -2204,7 +2204,7 @@ Signed-off-by: John Crispin if (stat < 0) { mtd->ecc_stats.failed++; } else { -@@ -1554,6 +1614,7 @@ +@@ -1554,6 +1614,7 @@ static int nand_read_page_syndrome(struc int i, eccsize = chip->ecc.size; int eccbytes = chip->ecc.bytes; int eccsteps = chip->ecc.steps; @@ -2212,7 +2212,7 @@ Signed-off-by: John Crispin uint8_t *p = buf; uint8_t *oob = chip->oob_poi; unsigned int max_bitflips = 0; -@@ -1573,19 +1634,29 @@ +@@ -1573,19 +1634,29 @@ static int nand_read_page_syndrome(struc chip->read_buf(mtd, oob, eccbytes); stat = chip->ecc.correct(mtd, p, oob, NULL); @@ -2249,7 +2249,7 @@ Signed-off-by: John Crispin } /* Calculate remaining oob bytes */ -@@ -1598,14 +1669,17 @@ +@@ -1598,14 +1669,17 @@ static int nand_read_page_syndrome(struc /** * nand_transfer_oob - [INTERN] Transfer oob to client buffer @@ -2269,7 +2269,7 @@ Signed-off-by: John Crispin switch (ops->mode) { case MTD_OPS_PLACE_OOB: -@@ -1613,31 +1687,12 @@ +@@ -1613,31 +1687,12 @@ static uint8_t *nand_transfer_oob(struct memcpy(oob, chip->oob_poi + ops->ooboffs, len); return oob + len; @@ -2307,7 +2307,7 @@ Signed-off-by: John Crispin default: BUG(); } -@@ -1655,7 +1710,7 @@ +@@ -1655,7 +1710,7 @@ static uint8_t *nand_transfer_oob(struct */ static int nand_setup_read_retry(struct mtd_info *mtd, int retry_mode) { @@ -2316,7 +2316,7 @@ Signed-off-by: John Crispin pr_debug("setting READ RETRY mode %d\n", retry_mode); -@@ -1680,12 +1735,11 @@ +@@ -1680,12 +1735,11 @@ static int nand_do_read_ops(struct mtd_i struct mtd_oob_ops *ops) { int chipnr, page, realpage, col, bytes, aligned, oob_required; @@ -2331,7 +2331,7 @@ Signed-off-by: John Crispin uint8_t *bufpoi, *oob, *buf; int use_bufpoi; -@@ -1772,7 +1826,7 @@ +@@ -1772,7 +1826,7 @@ read_retry: int toread = min(oobreadlen, max_oobsize); if (toread) { @@ -2340,7 +2340,7 @@ Signed-off-by: John Crispin oob, ops, toread); oobreadlen -= toread; } -@@ -2024,7 +2078,7 @@ +@@ -2024,7 +2078,7 @@ static int nand_do_read_oob(struct mtd_i struct mtd_oob_ops *ops) { int page, realpage, chipnr; @@ -2349,7 +2349,7 @@ Signed-off-by: John Crispin struct mtd_ecc_stats stats; int readlen = ops->ooblen; int len; -@@ -2036,10 +2090,7 @@ +@@ -2036,10 +2090,7 @@ static int nand_do_read_oob(struct mtd_i stats = mtd->ecc_stats; @@ -2361,7 +2361,7 @@ Signed-off-by: John Crispin if (unlikely(ops->ooboffs >= len)) { pr_debug("%s: attempt to start read outside oob\n", -@@ -2073,7 +2124,7 @@ +@@ -2073,7 +2124,7 @@ static int nand_do_read_oob(struct mtd_i break; len = min(len, readlen); @@ -2370,7 +2370,7 @@ Signed-off-by: John Crispin if (chip->options & NAND_NEED_READRDY) { /* Apply delay or wait for ready/busy pin */ -@@ -2232,19 +2283,20 @@ +@@ -2232,19 +2283,20 @@ static int nand_write_page_swecc(struct const uint8_t *buf, int oob_required, int page) { @@ -2395,7 +2395,7 @@ Signed-off-by: John Crispin return chip->ecc.write_page_raw(mtd, chip, buf, 1, page); } -@@ -2261,12 +2313,11 @@ +@@ -2261,12 +2313,11 @@ static int nand_write_page_hwecc(struct const uint8_t *buf, int oob_required, int page) { @@ -2409,7 +2409,7 @@ Signed-off-by: John Crispin for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) { chip->ecc.hwctl(mtd, NAND_ECC_WRITE); -@@ -2274,8 +2325,10 @@ +@@ -2274,8 +2325,10 @@ static int nand_write_page_hwecc(struct chip->ecc.calculate(mtd, p, &ecc_calc[i]); } @@ -2422,7 +2422,7 @@ Signed-off-by: John Crispin chip->write_buf(mtd, chip->oob_poi, mtd->oobsize); -@@ -2303,11 +2356,10 @@ +@@ -2303,11 +2356,10 @@ static int nand_write_subpage_hwecc(stru int ecc_size = chip->ecc.size; int ecc_bytes = chip->ecc.bytes; int ecc_steps = chip->ecc.steps; @@ -2435,7 +2435,7 @@ Signed-off-by: John Crispin for (step = 0; step < ecc_steps; step++) { /* configure controller for WRITE access */ -@@ -2335,8 +2387,10 @@ +@@ -2335,8 +2387,10 @@ static int nand_write_subpage_hwecc(stru /* copy calculated ECC for whole page to chip->buffer->oob */ /* this include masked-value(0xFF) for unwritten subpages */ ecc_calc = chip->buffers->ecccalc; @@ -2448,7 +2448,7 @@ Signed-off-by: John Crispin /* write OOB buffer to NAND device */ chip->write_buf(mtd, chip->oob_poi, mtd->oobsize); -@@ -2472,7 +2526,8 @@ +@@ -2472,7 +2526,8 @@ static int nand_write_page(struct mtd_in static uint8_t *nand_fill_oob(struct mtd_info *mtd, uint8_t *oob, size_t len, struct mtd_oob_ops *ops) { @@ -2458,7 +2458,7 @@ Signed-off-by: John Crispin /* * Initialise to all 0xFF, to avoid the possibility of left over OOB -@@ -2487,31 +2542,12 @@ +@@ -2487,31 +2542,12 @@ static uint8_t *nand_fill_oob(struct mtd memcpy(chip->oob_poi + ops->ooboffs, oob, len); return oob + len; @@ -2496,7 +2496,7 @@ Signed-off-by: John Crispin default: BUG(); } -@@ -2532,12 +2568,11 @@ +@@ -2532,12 +2568,11 @@ static int nand_do_write_ops(struct mtd_ struct mtd_oob_ops *ops) { int chipnr, realpage, page, blockmask, column; @@ -2511,7 +2511,7 @@ Signed-off-by: John Crispin uint8_t *oob = ops->oobbuf; uint8_t *buf = ops->datbuf; -@@ -2662,7 +2697,7 @@ +@@ -2662,7 +2697,7 @@ err_out: static int panic_nand_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const uint8_t *buf) { @@ -2520,7 +2520,7 @@ Signed-off-by: John Crispin struct mtd_oob_ops ops; int ret; -@@ -2722,15 +2757,12 @@ +@@ -2722,15 +2757,12 @@ static int nand_do_write_oob(struct mtd_ struct mtd_oob_ops *ops) { int chipnr, page, status, len; @@ -2538,7 +2538,7 @@ Signed-off-by: John Crispin /* Do not allow write past end of page */ if ((ops->ooboffs + ops->ooblen) > len) { -@@ -2847,7 +2879,7 @@ +@@ -2847,7 +2879,7 @@ out: */ static int single_erase(struct mtd_info *mtd, int page) { @@ -2547,7 +2547,7 @@ Signed-off-by: John Crispin /* Send commands to erase a block */ chip->cmdfunc(mtd, NAND_CMD_ERASE1, -1, page); chip->cmdfunc(mtd, NAND_CMD_ERASE2, -1, -1); -@@ -2879,7 +2911,7 @@ +@@ -2879,7 +2911,7 @@ int nand_erase_nand(struct mtd_info *mtd int allowbbt) { int page, status, pages_per_block, ret, chipnr; @@ -2556,7 +2556,7 @@ Signed-off-by: John Crispin loff_t len; pr_debug("%s: start = 0x%012llx, len = %llu\n", -@@ -2918,7 +2950,7 @@ +@@ -2918,7 +2950,7 @@ int nand_erase_nand(struct mtd_info *mtd while (len) { /* Check if we have a bad block, we do not erase bad blocks! */ if (nand_block_checkbad(mtd, ((loff_t) page) << @@ -2565,7 +2565,7 @@ Signed-off-by: John Crispin pr_warn("%s: attempt to erase a bad block at page 0x%08x\n", __func__, page); instr->state = MTD_ERASE_FAILED; -@@ -3005,7 +3037,20 @@ +@@ -3005,7 +3037,20 @@ static void nand_sync(struct mtd_info *m */ static int nand_block_isbad(struct mtd_info *mtd, loff_t offs) { @@ -2587,7 +2587,7 @@ Signed-off-by: John Crispin } /** -@@ -3094,7 +3139,7 @@ +@@ -3094,7 +3139,7 @@ static int nand_suspend(struct mtd_info */ static void nand_resume(struct mtd_info *mtd) { @@ -2596,7 +2596,7 @@ Signed-off-by: John Crispin if (chip->state == FL_PM_SUSPENDED) nand_release_device(mtd); -@@ -3266,7 +3311,7 @@ +@@ -3266,7 +3311,7 @@ ext_out: static int nand_setup_read_retry_micron(struct mtd_info *mtd, int retry_mode) { @@ -2605,7 +2605,7 @@ Signed-off-by: John Crispin uint8_t feature[ONFI_SUBFEATURE_PARAM_LEN] = {retry_mode}; return chip->onfi_set_features(mtd, chip, ONFI_FEATURE_ADDR_READ_RETRY, -@@ -3937,10 +3982,13 @@ +@@ -3937,10 +3982,13 @@ ident_done: return type; } @@ -2622,7 +2622,7 @@ Signed-off-by: John Crispin if (of_get_nand_bus_width(dn) == 16) chip->options |= NAND_BUSWIDTH_16; -@@ -3949,6 +3997,7 @@ +@@ -3949,6 +3997,7 @@ static int nand_dt_init(struct mtd_info chip->bbt_options |= NAND_BBT_USE_FLASH; ecc_mode = of_get_nand_ecc_mode(dn); @@ -2630,7 +2630,7 @@ Signed-off-by: John Crispin ecc_strength = of_get_nand_ecc_strength(dn); ecc_step = of_get_nand_ecc_step_size(dn); -@@ -3961,6 +4010,9 @@ +@@ -3961,6 +4010,9 @@ static int nand_dt_init(struct mtd_info if (ecc_mode >= 0) chip->ecc.mode = ecc_mode; @@ -2640,7 +2640,7 @@ Signed-off-by: John Crispin if (ecc_strength >= 0) chip->ecc.strength = ecc_strength; -@@ -3984,15 +4036,16 @@ +@@ -3984,15 +4036,16 @@ int nand_scan_ident(struct mtd_info *mtd struct nand_flash_dev *table) { int i, nand_maf_id, nand_dev_id; @@ -2663,7 +2663,7 @@ Signed-off-by: John Crispin if (!mtd->name && mtd->dev.parent) mtd->name = dev_name(mtd->dev.parent); -@@ -4055,7 +4108,7 @@ +@@ -4055,7 +4108,7 @@ EXPORT_SYMBOL(nand_scan_ident); */ static bool nand_ecc_strength_good(struct mtd_info *mtd) { @@ -2672,7 +2672,7 @@ Signed-off-by: John Crispin struct nand_ecc_ctrl *ecc = &chip->ecc; int corr, ds_corr; -@@ -4083,10 +4136,10 @@ +@@ -4083,10 +4136,10 @@ static bool nand_ecc_strength_good(struc */ int nand_scan_tail(struct mtd_info *mtd) { @@ -2685,7 +2685,7 @@ Signed-off-by: John Crispin /* New bad blocks should be marked in OOB, flash-based BBT, or both */ BUG_ON((chip->bbt_options & NAND_BBT_NO_OOB_BBM) && -@@ -4113,19 +4166,15 @@ +@@ -4113,19 +4166,15 @@ int nand_scan_tail(struct mtd_info *mtd) /* * If no default placement scheme is given, select an appropriate one. */ @@ -2708,7 +2708,7 @@ Signed-off-by: John Crispin break; default: pr_warn("No oob scheme defined for oobsize %d\n", -@@ -4168,7 +4217,7 @@ +@@ -4168,7 +4217,7 @@ int nand_scan_tail(struct mtd_info *mtd) ecc->write_oob = nand_write_oob_std; if (!ecc->read_subpage) ecc->read_subpage = nand_read_subpage; @@ -2717,7 +2717,7 @@ Signed-off-by: John Crispin ecc->write_subpage = nand_write_subpage_hwecc; case NAND_ECC_HW_SYNDROME: -@@ -4246,10 +4295,8 @@ +@@ -4246,10 +4295,8 @@ int nand_scan_tail(struct mtd_info *mtd) } /* See nand_bch_init() for details. */ @@ -2730,7 +2730,7 @@ Signed-off-by: John Crispin if (!ecc->priv) { pr_warn("BCH ECC initialization failed!\n"); BUG(); -@@ -4280,20 +4327,9 @@ +@@ -4280,20 +4327,9 @@ int nand_scan_tail(struct mtd_info *mtd) if (!ecc->write_oob_raw) ecc->write_oob_raw = ecc->write_oob; @@ -2754,7 +2754,7 @@ Signed-off-by: John Crispin /* * Set the number of read / write steps for one page depending on ECC -@@ -4306,6 +4342,21 @@ +@@ -4306,6 +4342,21 @@ int nand_scan_tail(struct mtd_info *mtd) } ecc->total = ecc->steps * ecc->bytes; @@ -2776,7 +2776,7 @@ Signed-off-by: John Crispin /* Allow subpage writes up to ecc.steps. Not possible for MLC flash */ if (!(chip->options & NAND_NO_SUBPAGE_WRITE) && nand_is_slc(chip)) { switch (ecc->steps) { -@@ -4362,10 +4413,6 @@ +@@ -4362,10 +4413,6 @@ int nand_scan_tail(struct mtd_info *mtd) mtd->_block_markbad = nand_block_markbad; mtd->writebufsize = mtd->writesize; @@ -2787,7 +2787,7 @@ Signed-off-by: John Crispin /* * Initialize bitflip_threshold to its default prior scan_bbt() call. * scan_bbt() might invoke mtd_read(), thus bitflip_threshold must be -@@ -4421,7 +4468,7 @@ +@@ -4421,7 +4468,7 @@ EXPORT_SYMBOL(nand_scan); */ void nand_release(struct mtd_info *mtd) { @@ -2798,7 +2798,7 @@ Signed-off-by: John Crispin nand_bch_free((struct nand_bch_control *)chip->ecc.priv); --- a/drivers/mtd/nand/nand_bbt.c +++ b/drivers/mtd/nand/nand_bbt.c -@@ -172,7 +172,7 @@ +@@ -172,7 +172,7 @@ static int read_bbt(struct mtd_info *mtd struct nand_bbt_descr *td, int offs) { int res, ret = 0, i, j, act = 0; @@ -2807,7 +2807,7 @@ Signed-off-by: John Crispin size_t retlen, len, totlen; loff_t from; int bits = td->options & NAND_BBT_NRBITS_MSK; -@@ -263,7 +263,7 @@ +@@ -263,7 +263,7 @@ static int read_bbt(struct mtd_info *mtd */ static int read_abs_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr *td, int chip) { @@ -2816,7 +2816,7 @@ Signed-off-by: John Crispin int res = 0, i; if (td->options & NAND_BBT_PERCHIP) { -@@ -388,7 +388,7 @@ +@@ -388,7 +388,7 @@ static u32 bbt_get_ver_offs(struct mtd_i static void read_abs_bbts(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr *td, struct nand_bbt_descr *md) { @@ -2825,7 +2825,7 @@ Signed-off-by: John Crispin /* Read the primary version, if available */ if (td->options & NAND_BBT_VERSION) { -@@ -454,7 +454,7 @@ +@@ -454,7 +454,7 @@ static int scan_block_fast(struct mtd_in static int create_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr *bd, int chip) { @@ -2834,7 +2834,7 @@ Signed-off-by: John Crispin int i, numblocks, numpages; int startblock; loff_t from; -@@ -523,7 +523,7 @@ +@@ -523,7 +523,7 @@ static int create_bbt(struct mtd_info *m */ static int search_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr *td) { @@ -2843,7 +2843,7 @@ Signed-off-by: John Crispin int i, chips; int startblock, block, dir; int scanlen = mtd->writesize + mtd->oobsize; -@@ -618,7 +618,7 @@ +@@ -618,7 +618,7 @@ static int write_bbt(struct mtd_info *mt struct nand_bbt_descr *td, struct nand_bbt_descr *md, int chipsel) { @@ -2852,7 +2852,7 @@ Signed-off-by: John Crispin struct erase_info einfo; int i, res, chip = 0; int bits, startblock, dir, page, offs, numblocks, sft, sftmsk; -@@ -819,7 +819,7 @@ +@@ -819,7 +819,7 @@ static int write_bbt(struct mtd_info *mt */ static inline int nand_memory_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd) { @@ -2861,7 +2861,7 @@ Signed-off-by: John Crispin return create_bbt(mtd, this->buffers->databuf, bd, -1); } -@@ -838,7 +838,7 @@ +@@ -838,7 +838,7 @@ static inline int nand_memory_bbt(struct static int check_create(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr *bd) { int i, chips, writeops, create, chipsel, res, res2; @@ -2870,7 +2870,7 @@ Signed-off-by: John Crispin struct nand_bbt_descr *td = this->bbt_td; struct nand_bbt_descr *md = this->bbt_md; struct nand_bbt_descr *rd, *rd2; -@@ -962,7 +962,7 @@ +@@ -962,7 +962,7 @@ static int check_create(struct mtd_info */ static void mark_bbt_region(struct mtd_info *mtd, struct nand_bbt_descr *td) { @@ -2879,7 +2879,7 @@ Signed-off-by: John Crispin int i, j, chips, block, nrblocks, update; uint8_t oldval; -@@ -1022,7 +1022,7 @@ +@@ -1022,7 +1022,7 @@ static void mark_bbt_region(struct mtd_i */ static void verify_bbt_descr(struct mtd_info *mtd, struct nand_bbt_descr *bd) { @@ -2888,7 +2888,7 @@ Signed-off-by: John Crispin u32 pattern_len; u32 bits; u32 table_size; -@@ -1074,7 +1074,7 @@ +@@ -1074,7 +1074,7 @@ static void verify_bbt_descr(struct mtd_ */ static int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd) { @@ -2897,7 +2897,7 @@ Signed-off-by: John Crispin int len, res; uint8_t *buf; struct nand_bbt_descr *td = this->bbt_td; -@@ -1147,7 +1147,7 @@ +@@ -1147,7 +1147,7 @@ err: */ static int nand_update_bbt(struct mtd_info *mtd, loff_t offs) { @@ -2906,7 +2906,7 @@ Signed-off-by: John Crispin int len, res = 0; int chip, chipsel; uint8_t *buf; -@@ -1281,7 +1281,7 @@ +@@ -1281,7 +1281,7 @@ static int nand_create_badblock_pattern( */ int nand_default_bbt(struct mtd_info *mtd) { @@ -2915,7 +2915,7 @@ Signed-off-by: John Crispin int ret; /* Is a flash based bad block table requested? */ -@@ -1317,7 +1317,7 @@ +@@ -1317,7 +1317,7 @@ int nand_default_bbt(struct mtd_info *mt */ int nand_isreserved_bbt(struct mtd_info *mtd, loff_t offs) { @@ -2924,7 +2924,7 @@ Signed-off-by: John Crispin int block; block = (int)(offs >> this->bbt_erase_shift); -@@ -1332,7 +1332,7 @@ +@@ -1332,7 +1332,7 @@ int nand_isreserved_bbt(struct mtd_info */ int nand_isbad_bbt(struct mtd_info *mtd, loff_t offs, int allowbbt) { @@ -2933,7 +2933,7 @@ Signed-off-by: John Crispin int block, res; block = (int)(offs >> this->bbt_erase_shift); -@@ -1359,7 +1359,7 @@ +@@ -1359,7 +1359,7 @@ int nand_isbad_bbt(struct mtd_info *mtd, */ int nand_markbad_bbt(struct mtd_info *mtd, loff_t offs) { @@ -2942,7 +2942,7 @@ Signed-off-by: John Crispin int block, ret = 0; block = (int)(offs >> this->bbt_erase_shift); -@@ -1373,5 +1373,3 @@ +@@ -1373,5 +1373,3 @@ int nand_markbad_bbt(struct mtd_info *mt return ret; } @@ -2964,7 +2964,7 @@ Signed-off-by: John Crispin unsigned int *errloc; unsigned char *eccmask; }; -@@ -52,7 +50,7 @@ +@@ -52,7 +50,7 @@ struct nand_bch_control { int nand_bch_calculate_ecc(struct mtd_info *mtd, const unsigned char *buf, unsigned char *code) { @@ -2973,7 +2973,7 @@ Signed-off-by: John Crispin struct nand_bch_control *nbc = chip->ecc.priv; unsigned int i; -@@ -79,7 +77,7 @@ +@@ -79,7 +77,7 @@ EXPORT_SYMBOL(nand_bch_calculate_ecc); int nand_bch_correct_data(struct mtd_info *mtd, unsigned char *buf, unsigned char *read_ecc, unsigned char *calc_ecc) { @@ -2982,7 +2982,7 @@ Signed-off-by: John Crispin struct nand_bch_control *nbc = chip->ecc.priv; unsigned int *errloc = nbc->errloc; int i, count; -@@ -98,7 +96,7 @@ +@@ -98,7 +96,7 @@ int nand_bch_correct_data(struct mtd_inf } } else if (count < 0) { printk(KERN_ERR "ecc unrecoverable error\n"); @@ -2991,7 +2991,7 @@ Signed-off-by: John Crispin } return count; } -@@ -107,9 +105,6 @@ +@@ -107,9 +105,6 @@ EXPORT_SYMBOL(nand_bch_correct_data); /** * nand_bch_init - [NAND Interface] Initialize NAND BCH error correction * @mtd: MTD block structure @@ -3001,7 +3001,7 @@ Signed-off-by: John Crispin * * Returns: * a pointer to a new NAND BCH control structure, or NULL upon failure -@@ -123,14 +118,20 @@ +@@ -123,14 +118,20 @@ EXPORT_SYMBOL(nand_bch_correct_data); * @eccsize = 512 (thus, m=13 is the smallest integer such that 2^m-1 > 512*8) * @eccbytes = 7 (7 bytes are required to store m*t = 13*4 = 52 bits) */ @@ -3026,7 +3026,7 @@ Signed-off-by: John Crispin if (!eccsize || !eccbytes) { printk(KERN_WARNING "ecc parameters not supplied\n"); -@@ -158,7 +159,7 @@ +@@ -158,7 +159,7 @@ nand_bch_init(struct mtd_info *mtd, unsi eccsteps = mtd->writesize/eccsize; /* if no ecc placement scheme was provided, build one */ @@ -3035,7 +3035,7 @@ Signed-off-by: John Crispin /* handle large page devices only */ if (mtd->oobsize < 64) { -@@ -167,24 +168,7 @@ +@@ -167,24 +168,7 @@ nand_bch_init(struct mtd_info *mtd, unsi goto fail; } @@ -3061,7 +3061,7 @@ Signed-off-by: John Crispin } /* sanity checks */ -@@ -192,7 +176,8 @@ +@@ -192,7 +176,8 @@ nand_bch_init(struct mtd_info *mtd, unsi printk(KERN_WARNING "eccsize %u is too large\n", eccsize); goto fail; } @@ -3071,7 +3071,7 @@ Signed-off-by: John Crispin printk(KERN_WARNING "invalid ecc layout\n"); goto fail; } -@@ -216,6 +201,9 @@ +@@ -216,6 +201,9 @@ nand_bch_init(struct mtd_info *mtd, unsi for (i = 0; i < eccbytes; i++) nbc->eccmask[i] ^= 0xff; @@ -3083,7 +3083,7 @@ Signed-off-by: John Crispin nand_bch_free(nbc); --- a/drivers/mtd/nand/nand_ecc.c +++ b/drivers/mtd/nand/nand_ecc.c -@@ -424,7 +424,7 @@ +@@ -424,7 +424,7 @@ int nand_calculate_ecc(struct mtd_info * unsigned char *code) { __nand_calculate_ecc(buf, @@ -3092,7 +3092,7 @@ Signed-off-by: John Crispin return 0; } -@@ -524,7 +524,7 @@ +@@ -524,7 +524,7 @@ int nand_correct_data(struct mtd_info *m unsigned char *read_ecc, unsigned char *calc_ecc) { return __nand_correct_data(buf, read_ecc, calc_ecc, @@ -3103,7 +3103,7 @@ Signed-off-by: John Crispin --- a/drivers/mtd/nand/nand_ids.c +++ b/drivers/mtd/nand/nand_ids.c -@@ -50,8 +50,8 @@ +@@ -50,8 +50,8 @@ struct nand_flash_dev nand_flash_ids[] = SZ_16K, SZ_8K, SZ_4M, 0, 6, 1280, NAND_ECC_INFO(40, SZ_1K) }, {"H27UCG8T2ATR-BC 64G 3.3V 8-bit", { .id = {0xad, 0xde, 0x94, 0xda, 0x74, 0xc4} }, @@ -3116,7 +3116,7 @@ Signed-off-by: John Crispin LEGACY_ID_NAND("NAND 4MiB 3,3V 8-bit", 0xE3, 4, SZ_8K, SP_OPTIONS), --- a/drivers/mtd/nand/nandsim.c +++ b/drivers/mtd/nand/nandsim.c -@@ -666,8 +666,8 @@ +@@ -666,8 +666,8 @@ static char *get_partition_name(int i) */ static int init_nandsim(struct mtd_info *mtd) { @@ -3127,7 +3127,7 @@ Signed-off-by: John Crispin int i, ret = 0; uint64_t remains; uint64_t next_offset; -@@ -1908,7 +1908,8 @@ +@@ -1908,7 +1908,8 @@ static void switch_state(struct nandsim static u_char ns_nand_read_byte(struct mtd_info *mtd) { @@ -3137,7 +3137,7 @@ Signed-off-by: John Crispin u_char outb = 0x00; /* Sanity and correctness checks */ -@@ -1969,7 +1970,8 @@ +@@ -1969,7 +1970,8 @@ static u_char ns_nand_read_byte(struct m static void ns_nand_write_byte(struct mtd_info *mtd, u_char byte) { @@ -3147,7 +3147,7 @@ Signed-off-by: John Crispin /* Sanity and correctness checks */ if (!ns->lines.ce) { -@@ -2123,7 +2125,8 @@ +@@ -2123,7 +2125,8 @@ static void ns_nand_write_byte(struct mt static void ns_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int bitmask) { @@ -3157,7 +3157,7 @@ Signed-off-by: John Crispin ns->lines.cle = bitmask & NAND_CLE ? 1 : 0; ns->lines.ale = bitmask & NAND_ALE ? 1 : 0; -@@ -2141,7 +2144,7 @@ +@@ -2141,7 +2144,7 @@ static int ns_device_ready(struct mtd_in static uint16_t ns_nand_read_word(struct mtd_info *mtd) { @@ -3166,7 +3166,7 @@ Signed-off-by: John Crispin NS_DBG("read_word\n"); -@@ -2150,7 +2153,8 @@ +@@ -2150,7 +2153,8 @@ static uint16_t ns_nand_read_word(struct static void ns_nand_write_buf(struct mtd_info *mtd, const u_char *buf, int len) { @@ -3176,7 +3176,7 @@ Signed-off-by: John Crispin /* Check that chip is expecting data input */ if (!(ns->state & STATE_DATAIN_MASK)) { -@@ -2177,7 +2181,8 @@ +@@ -2177,7 +2181,8 @@ static void ns_nand_write_buf(struct mtd static void ns_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len) { @@ -3186,7 +3186,7 @@ Signed-off-by: John Crispin /* Sanity and correctness checks */ if (!ns->lines.ce) { -@@ -2198,7 +2203,7 @@ +@@ -2198,7 +2203,7 @@ static void ns_nand_read_buf(struct mtd_ int i; for (i = 0; i < len; i++) @@ -3195,7 +3195,7 @@ Signed-off-by: John Crispin return; } -@@ -2236,16 +2241,15 @@ +@@ -2236,16 +2241,15 @@ static int __init ns_init_module(void) } /* Allocate and initialize mtd_info, nand_chip and nandsim structures */ @@ -3217,7 +3217,7 @@ Signed-off-by: John Crispin /* * Register simulator's callbacks. -@@ -2257,6 +2261,7 @@ +@@ -2257,6 +2261,7 @@ static int __init ns_init_module(void) chip->read_buf = ns_nand_read_buf; chip->read_word = ns_nand_read_word; chip->ecc.mode = NAND_ECC_SOFT; @@ -3225,7 +3225,7 @@ Signed-off-by: John Crispin /* The NAND_SKIP_BBTSCAN option is necessary for 'overridesize' */ /* and 'badblocks' parameters to work */ chip->options |= NAND_SKIP_BBTSCAN; -@@ -2335,6 +2340,7 @@ +@@ -2335,6 +2340,7 @@ static int __init ns_init_module(void) goto error; } chip->ecc.mode = NAND_ECC_SOFT_BCH; @@ -3233,7 +3233,7 @@ Signed-off-by: John Crispin chip->ecc.size = 512; chip->ecc.strength = bch; chip->ecc.bytes = eccbytes; -@@ -2392,7 +2398,7 @@ +@@ -2392,7 +2398,7 @@ err_exit: for (i = 0;i < ARRAY_SIZE(nand->partitions); ++i) kfree(nand->partitions[i].name); error: @@ -3242,7 +3242,7 @@ Signed-off-by: John Crispin free_lists(); return retval; -@@ -2405,7 +2411,8 @@ +@@ -2405,7 +2411,8 @@ module_init(ns_init_module); */ static void __exit ns_cleanup_module(void) { @@ -3252,7 +3252,7 @@ Signed-off-by: John Crispin int i; nandsim_debugfs_remove(ns); -@@ -2413,7 +2420,7 @@ +@@ -2413,7 +2420,7 @@ static void __exit ns_cleanup_module(voi nand_release(nsmtd); /* Unregister driver */ for (i = 0;i < ARRAY_SIZE(ns->partitions); ++i) kfree(ns->partitions[i].name); @@ -3263,7 +3263,7 @@ Signed-off-by: John Crispin --- a/drivers/mtd/ofpart.c +++ b/drivers/mtd/ofpart.c -@@ -26,9 +26,10 @@ +@@ -26,9 +26,10 @@ static bool node_has_compatible(struct d } static int parse_ofpart_partitions(struct mtd_info *master, @@ -3275,7 +3275,7 @@ Signed-off-by: John Crispin struct device_node *mtd_node; struct device_node *ofpart_node; const char *partname; -@@ -37,10 +38,8 @@ +@@ -37,10 +38,8 @@ static int parse_ofpart_partitions(struc bool dedicated = true; @@ -3288,7 +3288,7 @@ Signed-off-by: John Crispin if (!mtd_node) return 0; -@@ -72,8 +71,8 @@ +@@ -72,8 +71,8 @@ static int parse_ofpart_partitions(struc if (nr_parts == 0) return 0; @@ -3299,7 +3299,7 @@ Signed-off-by: John Crispin return -ENOMEM; i = 0; -@@ -107,19 +106,19 @@ +@@ -107,19 +106,19 @@ static int parse_ofpart_partitions(struc goto ofpart_fail; } @@ -3324,7 +3324,7 @@ Signed-off-by: John Crispin i++; } -@@ -127,6 +126,7 @@ +@@ -127,6 +126,7 @@ static int parse_ofpart_partitions(struc if (!nr_parts) goto ofpart_none; @@ -3332,7 +3332,7 @@ Signed-off-by: John Crispin return nr_parts; ofpart_fail: -@@ -135,21 +135,20 @@ +@@ -135,21 +135,20 @@ ofpart_fail: ret = -EINVAL; ofpart_none: of_node_put(pp); @@ -3357,7 +3357,7 @@ Signed-off-by: John Crispin struct device_node *dp; int i, plen, nr_parts; const struct { -@@ -157,10 +156,8 @@ +@@ -157,10 +156,8 @@ static int parse_ofoldpart_partitions(st } *part; const char *names; @@ -3370,7 +3370,7 @@ Signed-off-by: John Crispin if (!dp) return 0; -@@ -173,37 +170,37 @@ +@@ -173,37 +170,37 @@ static int parse_ofoldpart_partitions(st nr_parts = plen / sizeof(part[0]); @@ -3418,7 +3418,7 @@ Signed-off-by: John Crispin }; --- a/drivers/mtd/spi-nor/Kconfig +++ b/drivers/mtd/spi-nor/Kconfig -@@ -7,6 +7,14 @@ +@@ -7,6 +7,14 @@ menuconfig MTD_SPI_NOR if MTD_SPI_NOR @@ -3433,7 +3433,7 @@ Signed-off-by: John Crispin config MTD_SPI_NOR_USE_4K_SECTORS bool "Use small 4096 B erase sectors" default y -@@ -23,7 +31,7 @@ +@@ -23,7 +31,7 @@ config MTD_SPI_NOR_USE_4K_SECTORS config SPI_FSL_QUADSPI tristate "Freescale Quad SPI controller" @@ -3947,7 +3947,7 @@ Signed-off-by: John Crispin struct flash_info { char *name; -@@ -60,14 +61,20 @@ +@@ -60,14 +61,20 @@ struct flash_info { u16 addr_width; u16 flags; @@ -3976,7 +3976,7 @@ Signed-off-by: John Crispin }; #define JEDEC_MFR(info) ((info)->id[0]) -@@ -313,6 +320,29 @@ +@@ -313,6 +320,29 @@ static void spi_nor_unlock_and_unprep(st } /* @@ -4006,7 +4006,7 @@ Signed-off-by: John Crispin * Erase an address range on the nor chip. The address range may extend * one or more erase sectors. Return an error is there is a problem erasing. */ -@@ -371,10 +401,9 @@ +@@ -371,10 +401,9 @@ static int spi_nor_erase(struct mtd_info while (len) { write_enable(nor); @@ -4019,7 +4019,7 @@ Signed-off-by: John Crispin addr += mtd->erasesize; len -= mtd->erasesize; -@@ -387,17 +416,13 @@ +@@ -387,17 +416,13 @@ static int spi_nor_erase(struct mtd_info write_disable(nor); @@ -4039,7 +4039,7 @@ Signed-off-by: John Crispin } static void stm_get_locked_range(struct spi_nor *nor, u8 sr, loff_t *ofs, -@@ -415,32 +440,58 @@ +@@ -415,32 +440,58 @@ static void stm_get_locked_range(struct } else { pow = ((sr & mask) ^ mask) >> shift; *len = mtd->size >> pow; @@ -4105,7 +4105,7 @@ Signed-off-by: John Crispin * Sample table portion for 8MB flash (Winbond w25q64fw): * * SEC | TB | BP2 | BP1 | BP0 | Prot Length | Protected Portion -@@ -453,26 +504,55 @@ +@@ -453,26 +504,55 @@ static int stm_is_locked_sr(struct spi_n * 0 | 0 | 1 | 0 | 1 | 2 MB | Upper 1/4 * 0 | 0 | 1 | 1 | 0 | 4 MB | Upper 1/2 * X | X | 1 | 1 | 1 | 8 MB | ALL @@ -4170,7 +4170,7 @@ Signed-off-by: John Crispin /* * Need smallest pow such that: -@@ -483,7 +563,7 @@ +@@ -483,7 +563,7 @@ static int stm_lock(struct spi_nor *nor, * * pow = ceil(log2(size / len)) = log2(size) - floor(log2(len)) */ @@ -4179,7 +4179,7 @@ Signed-off-by: John Crispin val = mask - (pow << shift); if (val & ~mask) return -EINVAL; -@@ -491,14 +571,27 @@ +@@ -491,14 +571,27 @@ static int stm_lock(struct spi_nor *nor, if (!(val & mask)) return -EINVAL; @@ -4210,7 +4210,7 @@ Signed-off-by: John Crispin } /* -@@ -509,17 +602,43 @@ +@@ -509,17 +602,43 @@ static int stm_lock(struct spi_nor *nor, static int stm_unlock(struct spi_nor *nor, loff_t ofs, uint64_t len) { struct mtd_info *mtd = &nor->mtd; @@ -4258,7 +4258,7 @@ Signed-off-by: John Crispin /* * Need largest pow such that: * -@@ -529,8 +648,8 @@ +@@ -529,8 +648,8 @@ static int stm_unlock(struct spi_nor *no * * pow = floor(log2(size / len)) = log2(size) - ceil(log2(len)) */ @@ -4269,7 +4269,7 @@ Signed-off-by: John Crispin val = 0; /* fully unlocked */ } else { val = mask - (pow << shift); -@@ -539,14 +658,28 @@ +@@ -539,14 +658,28 @@ static int stm_unlock(struct spi_nor *no return -EINVAL; } @@ -4301,7 +4301,7 @@ Signed-off-by: John Crispin } /* -@@ -715,9 +848,9 @@ +@@ -715,9 +848,9 @@ static const struct flash_info spi_nor_i { "mx25l4005a", INFO(0xc22013, 0, 64 * 1024, 8, SECT_4K) }, { "mx25l8005", INFO(0xc22014, 0, 64 * 1024, 16, 0) }, { "mx25l1606e", INFO(0xc22015, 0, 64 * 1024, 32, SECT_4K) }, @@ -4313,7 +4313,7 @@ Signed-off-by: John Crispin { "mx25u6435f", INFO(0xc22537, 0, 64 * 1024, 128, SECT_4K) }, { "mx25l12805d", INFO(0xc22018, 0, 64 * 1024, 256, 0) }, { "mx25l12855e", INFO(0xc22618, 0, 64 * 1024, 256, 0) }, -@@ -732,8 +865,8 @@ +@@ -732,8 +865,8 @@ static const struct flash_info spi_nor_i { "n25q032a", INFO(0x20bb16, 0, 64 * 1024, 64, SPI_NOR_QUAD_READ) }, { "n25q064", INFO(0x20ba17, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_QUAD_READ) }, { "n25q064a", INFO(0x20bb17, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_QUAD_READ) }, @@ -4324,7 +4324,7 @@ Signed-off-by: John Crispin { "n25q256a", INFO(0x20ba19, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_QUAD_READ) }, { "n25q512a", INFO(0x20bb20, 0, 64 * 1024, 1024, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ) }, { "n25q512ax3", INFO(0x20ba20, 0, 64 * 1024, 1024, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ) }, -@@ -767,6 +900,7 @@ +@@ -767,6 +900,7 @@ static const struct flash_info spi_nor_i { "s25fl008k", INFO(0xef4014, 0, 64 * 1024, 16, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, { "s25fl016k", INFO(0xef4015, 0, 64 * 1024, 32, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, { "s25fl064k", INFO(0xef4017, 0, 64 * 1024, 128, SECT_4K) }, @@ -4332,7 +4332,7 @@ Signed-off-by: John Crispin { "s25fl132k", INFO(0x014016, 0, 64 * 1024, 64, SECT_4K) }, { "s25fl164k", INFO(0x014017, 0, 64 * 1024, 128, SECT_4K) }, { "s25fl204k", INFO(0x014013, 0, 64 * 1024, 8, SECT_4K | SPI_NOR_DUAL_READ) }, -@@ -830,11 +964,23 @@ +@@ -830,11 +964,23 @@ static const struct flash_info spi_nor_i { "w25x16", INFO(0xef3015, 0, 64 * 1024, 32, SECT_4K) }, { "w25x32", INFO(0xef3016, 0, 64 * 1024, 64, SECT_4K) }, { "w25q32", INFO(0xef4016, 0, 64 * 1024, 64, SECT_4K) }, @@ -4359,7 +4359,7 @@ Signed-off-by: John Crispin { "w25q80", INFO(0xef5014, 0, 64 * 1024, 16, SECT_4K) }, { "w25q80bl", INFO(0xef4014, 0, 64 * 1024, 16, SECT_4K) }, { "w25q128", INFO(0xef4018, 0, 64 * 1024, 256, SECT_4K) }, -@@ -857,7 +1003,7 @@ +@@ -857,7 +1003,7 @@ static const struct flash_info *spi_nor_ tmp = nor->read_reg(nor, SPINOR_OP_RDID, id, SPI_NOR_MAX_ID_LEN); if (tmp < 0) { @@ -4368,7 +4368,7 @@ Signed-off-by: John Crispin return ERR_PTR(tmp); } -@@ -868,7 +1014,7 @@ +@@ -868,7 +1014,7 @@ static const struct flash_info *spi_nor_ return &spi_nor_ids[tmp]; } } @@ -4377,7 +4377,7 @@ Signed-off-by: John Crispin id[0], id[1], id[2]); return ERR_PTR(-ENODEV); } -@@ -1014,6 +1160,8 @@ +@@ -1014,6 +1160,8 @@ static int macronix_quad_enable(struct s int ret, val; val = read_sr(nor); @@ -4386,7 +4386,7 @@ Signed-off-by: John Crispin write_enable(nor); write_sr(nor, val | SR_QUAD_EN_MX); -@@ -1095,7 +1243,7 @@ +@@ -1095,7 +1243,7 @@ static int set_quad_mode(struct spi_nor static int spi_nor_check(struct spi_nor *nor) { if (!nor->dev || !nor->read || !nor->write || @@ -4395,7 +4395,7 @@ Signed-off-by: John Crispin pr_err("spi-nor: please fill all the necessary fields!\n"); return -EINVAL; } -@@ -1108,7 +1256,7 @@ +@@ -1108,7 +1256,7 @@ int spi_nor_scan(struct spi_nor *nor, co const struct flash_info *info = NULL; struct device *dev = nor->dev; struct mtd_info *mtd = &nor->mtd; @@ -4404,7 +4404,7 @@ Signed-off-by: John Crispin int ret; int i; -@@ -1158,9 +1306,11 @@ +@@ -1158,9 +1306,11 @@ int spi_nor_scan(struct spi_nor *nor, co if (JEDEC_MFR(info) == SNOR_MFR_ATMEL || JEDEC_MFR(info) == SNOR_MFR_INTEL || JEDEC_MFR(info) == SNOR_MFR_MACRONIX || @@ -4417,7 +4417,7 @@ Signed-off-by: John Crispin } if (!mtd->name) -@@ -1174,7 +1324,8 @@ +@@ -1174,7 +1324,8 @@ int spi_nor_scan(struct spi_nor *nor, co mtd->_read = spi_nor_read; /* NOR protection support for STmicro/Micron chips and similar */ @@ -4427,7 +4427,7 @@ Signed-off-by: John Crispin nor->flash_lock = stm_lock; nor->flash_unlock = stm_unlock; nor->flash_is_locked = stm_is_locked; -@@ -1194,6 +1345,8 @@ +@@ -1194,6 +1345,8 @@ int spi_nor_scan(struct spi_nor *nor, co if (info->flags & USE_FSR) nor->flags |= SNOR_F_USE_FSR; @@ -4436,7 +4436,7 @@ Signed-off-by: John Crispin #ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS /* prefer "small sector" erase if possible */ -@@ -1296,6 +1449,12 @@ +@@ -1296,6 +1449,12 @@ int spi_nor_scan(struct spi_nor *nor, co nor->addr_width = 3; } @@ -4451,7 +4451,7 @@ Signed-off-by: John Crispin dev_info(dev, "%s (%lld Kbytes)\n", info->name, --- a/drivers/mtd/tests/mtd_nandecctest.c +++ b/drivers/mtd/tests/mtd_nandecctest.c -@@ -187,7 +187,7 @@ +@@ -187,7 +187,7 @@ static int double_bit_error_detect(void __nand_calculate_ecc(error_data, size, calc_ecc); ret = __nand_correct_data(error_data, error_ecc, calc_ecc, size); @@ -4462,7 +4462,7 @@ Signed-off-by: John Crispin static const struct nand_ecc_test nand_ecc_test[] = { --- a/drivers/mtd/tests/oobtest.c +++ b/drivers/mtd/tests/oobtest.c -@@ -215,19 +215,19 @@ +@@ -215,19 +215,19 @@ static int verify_eraseblock(int ebnum) pr_info("ignoring error as within bitflip_limit\n"); } @@ -4485,7 +4485,7 @@ Signed-off-by: John Crispin pr_err("error: readoob failed at %#llx\n", (long long)addr); errcnt += 1; -@@ -244,7 +244,7 @@ +@@ -244,7 +244,7 @@ static int verify_eraseblock(int ebnum) /* verify post-(use_offset + use_len) area for 0xff */ k = use_offset + use_len; bitflips += memffshow(addr, k, readbuf + k, @@ -4494,7 +4494,7 @@ Signed-off-by: John Crispin if (bitflips > bitflip_limit) { pr_err("error: verify failed at %#llx\n", -@@ -269,8 +269,8 @@ +@@ -269,8 +269,8 @@ static int verify_eraseblock_in_one_go(i struct mtd_oob_ops ops; int err = 0; loff_t addr = (loff_t)ebnum * mtd->erasesize; @@ -4505,7 +4505,7 @@ Signed-off-by: John Crispin size_t bitflips; int i; -@@ -394,8 +394,8 @@ +@@ -394,8 +394,8 @@ static int __init mtd_oobtest_init(void) goto out; use_offset = 0; @@ -4516,7 +4516,7 @@ Signed-off-by: John Crispin vary_offset = 0; /* First test: write all OOB, read it back and verify */ -@@ -460,8 +460,8 @@ +@@ -460,8 +460,8 @@ static int __init mtd_oobtest_init(void) /* Write all eraseblocks */ use_offset = 0; @@ -4527,7 +4527,7 @@ Signed-off-by: John Crispin vary_offset = 1; prandom_seed_state(&rnd_state, 5); -@@ -471,8 +471,8 @@ +@@ -471,8 +471,8 @@ static int __init mtd_oobtest_init(void) /* Check all eraseblocks */ use_offset = 0; @@ -4538,7 +4538,7 @@ Signed-off-by: John Crispin vary_offset = 1; prandom_seed_state(&rnd_state, 5); err = verify_all_eraseblocks(); -@@ -480,8 +480,8 @@ +@@ -480,8 +480,8 @@ static int __init mtd_oobtest_init(void) goto out; use_offset = 0; @@ -4549,7 +4549,7 @@ Signed-off-by: John Crispin vary_offset = 0; /* Fourth test: try to write off end of device */ -@@ -501,7 +501,7 @@ +@@ -501,7 +501,7 @@ static int __init mtd_oobtest_init(void) ops.retlen = 0; ops.ooblen = 1; ops.oobretlen = 0; @@ -4558,7 +4558,7 @@ Signed-off-by: John Crispin ops.datbuf = NULL; ops.oobbuf = writebuf; pr_info("attempting to start write past end of OOB\n"); -@@ -521,7 +521,7 @@ +@@ -521,7 +521,7 @@ static int __init mtd_oobtest_init(void) ops.retlen = 0; ops.ooblen = 1; ops.oobretlen = 0; @@ -4567,7 +4567,7 @@ Signed-off-by: John Crispin ops.datbuf = NULL; ops.oobbuf = readbuf; pr_info("attempting to start read past end of OOB\n"); -@@ -543,7 +543,7 @@ +@@ -543,7 +543,7 @@ static int __init mtd_oobtest_init(void) ops.mode = MTD_OPS_AUTO_OOB; ops.len = 0; ops.retlen = 0; @@ -4576,7 +4576,7 @@ Signed-off-by: John Crispin ops.oobretlen = 0; ops.ooboffs = 0; ops.datbuf = NULL; -@@ -563,7 +563,7 @@ +@@ -563,7 +563,7 @@ static int __init mtd_oobtest_init(void) ops.mode = MTD_OPS_AUTO_OOB; ops.len = 0; ops.retlen = 0; @@ -4585,7 +4585,7 @@ Signed-off-by: John Crispin ops.oobretlen = 0; ops.ooboffs = 0; ops.datbuf = NULL; -@@ -587,7 +587,7 @@ +@@ -587,7 +587,7 @@ static int __init mtd_oobtest_init(void) ops.mode = MTD_OPS_AUTO_OOB; ops.len = 0; ops.retlen = 0; @@ -4594,7 +4594,7 @@ Signed-off-by: John Crispin ops.oobretlen = 0; ops.ooboffs = 1; ops.datbuf = NULL; -@@ -607,7 +607,7 @@ +@@ -607,7 +607,7 @@ static int __init mtd_oobtest_init(void) ops.mode = MTD_OPS_AUTO_OOB; ops.len = 0; ops.retlen = 0; @@ -4603,7 +4603,7 @@ Signed-off-by: John Crispin ops.oobretlen = 0; ops.ooboffs = 1; ops.datbuf = NULL; -@@ -638,7 +638,7 @@ +@@ -638,7 +638,7 @@ static int __init mtd_oobtest_init(void) for (i = 0; i < ebcnt - 1; ++i) { int cnt = 2; int pg; @@ -4612,7 +4612,7 @@ Signed-off-by: John Crispin if (bbt[i] || bbt[i + 1]) continue; addr = (loff_t)(i + 1) * mtd->erasesize - mtd->writesize; -@@ -673,13 +673,12 @@ +@@ -673,13 +673,12 @@ static int __init mtd_oobtest_init(void) for (i = 0; i < ebcnt - 1; ++i) { if (bbt[i] || bbt[i + 1]) continue; @@ -4628,7 +4628,7 @@ Signed-off-by: John Crispin ops.oobretlen = 0; ops.ooboffs = 0; ops.datbuf = NULL; -@@ -688,7 +687,7 @@ +@@ -688,7 +687,7 @@ static int __init mtd_oobtest_init(void) if (err) goto out; if (memcmpshow(addr, readbuf, writebuf, @@ -4639,7 +4639,7 @@ Signed-off-by: John Crispin errcnt += 1; --- a/drivers/mtd/tests/pagetest.c +++ b/drivers/mtd/tests/pagetest.c -@@ -127,13 +127,12 @@ +@@ -127,13 +127,12 @@ static int crosstest(void) unsigned char *pp1, *pp2, *pp3, *pp4; pr_info("crosstest\n"); @@ -4656,7 +4656,7 @@ Signed-off-by: John Crispin for (i = 0; i < ebcnt && bbt[i]; ++i) --- a/drivers/mtd/ubi/cdev.c +++ b/drivers/mtd/ubi/cdev.c -@@ -174,9 +174,9 @@ +@@ -174,9 +174,9 @@ static int vol_cdev_fsync(struct file *f struct ubi_device *ubi = desc->vol->ubi; struct inode *inode = file_inode(file); int err; @@ -4670,7 +4670,7 @@ Signed-off-by: John Crispin --- a/drivers/mtd/ubi/misc.c +++ b/drivers/mtd/ubi/misc.c -@@ -153,3 +153,52 @@ +@@ -153,3 +153,52 @@ int ubi_check_pattern(const void *buf, u return 0; return 1; } @@ -4753,7 +4753,7 @@ Signed-off-by: John Crispin #define UBI_BGT_NAME_PATTERN "ubi_bgt%dd" --- a/drivers/mtd/ubi/wl.c +++ b/drivers/mtd/ubi/wl.c -@@ -628,6 +628,7 @@ +@@ -628,6 +628,7 @@ static int do_sync_erase(struct ubi_devi return __erase_worker(ubi, &wl_wrk); } @@ -4761,7 +4761,7 @@ Signed-off-by: John Crispin /** * wear_leveling_worker - wear-leveling worker function. * @ubi: UBI device description object -@@ -649,6 +650,7 @@ +@@ -649,6 +650,7 @@ static int wear_leveling_worker(struct u #endif struct ubi_wl_entry *e1, *e2; struct ubi_vid_hdr *vid_hdr; @@ -4769,7 +4769,7 @@ Signed-off-by: John Crispin kfree(wrk); if (shutdown) -@@ -753,6 +755,7 @@ +@@ -753,6 +755,7 @@ static int wear_leveling_worker(struct u err = ubi_io_read_vid_hdr(ubi, e1->pnum, vid_hdr, 0); if (err && err != UBI_IO_BITFLIPS) { @@ -4777,7 +4777,7 @@ Signed-off-by: John Crispin if (err == UBI_IO_FF) { /* * We are trying to move PEB without a VID header. UBI -@@ -798,10 +801,12 @@ +@@ -798,10 +801,12 @@ static int wear_leveling_worker(struct u * protection queue. */ protect = 1; @@ -4790,7 +4790,7 @@ Signed-off-by: John Crispin goto out_not_moved; } if (err == MOVE_TARGET_BITFLIPS || err == MOVE_TARGET_WR_ERR || -@@ -827,6 +832,7 @@ +@@ -827,6 +832,7 @@ static int wear_leveling_worker(struct u ubi->erroneous_peb_count); goto out_error; } @@ -4798,7 +4798,7 @@ Signed-off-by: John Crispin erroneous = 1; goto out_not_moved; } -@@ -897,15 +903,24 @@ +@@ -897,15 +903,24 @@ out_not_moved: wl_tree_add(e1, &ubi->scrub); else wl_tree_add(e1, &ubi->used); @@ -4828,7 +4828,7 @@ Signed-off-by: John Crispin return 0; --- a/include/linux/mtd/bbm.h +++ b/include/linux/mtd/bbm.h -@@ -166,7 +166,6 @@ +@@ -166,7 +166,6 @@ struct bbm_info { }; /* OneNAND BBT interface */ @@ -4865,7 +4865,7 @@ Signed-off-by: John Crispin uint8_t tar; --- a/include/linux/mtd/inftl.h +++ b/include/linux/mtd/inftl.h -@@ -44,7 +44,6 @@ +@@ -44,7 +44,6 @@ struct INFTLrecord { unsigned int nb_blocks; /* number of physical blocks */ unsigned int nb_boot_blocks; /* number of blocks used by the bios */ struct erase_info instr; @@ -4885,7 +4885,7 @@ Signed-off-by: John Crispin static inline int map_bankwidth(void *map) { BUG(); -@@ -238,8 +240,11 @@ +@@ -238,8 +240,11 @@ struct map_info { If there is no cache to care about this can be set to NULL. */ void (*inval_cache)(struct map_info *, unsigned long, ssize_t); @@ -4901,7 +4901,7 @@ Signed-off-by: John Crispin unsigned long pfow_base; --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h -@@ -100,17 +100,35 @@ +@@ -100,17 +100,35 @@ struct mtd_oob_ops { #define MTD_MAX_OOBFREE_ENTRIES_LARGE 32 #define MTD_MAX_ECCPOS_ENTRIES_LARGE 640 @@ -4946,7 +4946,7 @@ Signed-off-by: John Crispin }; struct module; /* only needed for owner field in mtd_info */ -@@ -171,8 +189,8 @@ +@@ -171,8 +189,8 @@ struct mtd_info { const char *name; int index; @@ -4957,7 +4957,7 @@ Signed-off-by: John Crispin /* the ecc step size. */ unsigned int ecc_step_size; -@@ -258,6 +276,46 @@ +@@ -258,6 +276,46 @@ struct mtd_info { int usecount; }; @@ -5006,7 +5006,7 @@ Signed-off-by: John Crispin void **virt, resource_size_t *phys); --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h -@@ -119,6 +119,12 @@ +@@ -119,6 +119,12 @@ typedef enum { NAND_ECC_SOFT_BCH, } nand_ecc_modes_t; @@ -5019,7 +5019,7 @@ Signed-off-by: John Crispin /* * Constants for Hardware ECC */ -@@ -129,6 +135,14 @@ +@@ -129,6 +135,14 @@ typedef enum { /* Enable Hardware ECC before syndrome is read back from flash */ #define NAND_ECC_READSYN 2 @@ -5034,7 +5034,7 @@ Signed-off-by: John Crispin /* Bit mask for flags passed to do_nand_read_ecc */ #define NAND_GET_DEVICE 0x80 -@@ -160,6 +174,12 @@ +@@ -160,6 +174,12 @@ typedef enum { /* Device supports subpage reads */ #define NAND_SUBPAGE_READ 0x00001000 @@ -5047,7 +5047,7 @@ Signed-off-by: John Crispin /* Options valid for Samsung large page devices */ #define NAND_SAMSUNG_LP_OPTIONS NAND_CACHEPRG -@@ -276,15 +296,15 @@ +@@ -276,15 +296,15 @@ struct nand_onfi_params { __le16 t_r; __le16 t_ccs; __le16 src_sync_timing_mode; @@ -5066,7 +5066,7 @@ Signed-off-by: John Crispin /* vendor */ __le16 vendor_revision; -@@ -407,7 +427,7 @@ +@@ -407,7 +427,7 @@ struct nand_jedec_params { __le16 input_pin_capacitance_typ; __le16 clk_pin_capacitance_typ; u8 driver_strength_support; @@ -5075,7 +5075,7 @@ Signed-off-by: John Crispin u8 reserved4[36]; /* ECC and endurance block */ -@@ -444,6 +464,7 @@ +@@ -444,6 +464,7 @@ struct nand_hw_control { /** * struct nand_ecc_ctrl - Control structure for ECC * @mode: ECC mode @@ -5083,7 +5083,7 @@ Signed-off-by: John Crispin * @steps: number of ECC steps per page * @size: data bytes per ECC step * @bytes: ECC bytes per step -@@ -451,12 +472,18 @@ +@@ -451,12 +472,18 @@ struct nand_hw_control { * @total: total number of ECC bytes per page * @prepad: padding information for syndrome based ECC generators * @postpad: padding information for syndrome based ECC generators @@ -5104,7 +5104,7 @@ Signed-off-by: John Crispin * @read_page_raw: function to read a raw page without ECC. This function * should hide the specific layout used by the ECC * controller and always return contiguous in-band and -@@ -487,6 +514,7 @@ +@@ -487,6 +514,7 @@ struct nand_hw_control { */ struct nand_ecc_ctrl { nand_ecc_modes_t mode; @@ -5112,7 +5112,7 @@ Signed-off-by: John Crispin int steps; int size; int bytes; -@@ -494,7 +522,7 @@ +@@ -494,7 +522,7 @@ struct nand_ecc_ctrl { int strength; int prepad; int postpad; @@ -5121,7 +5121,7 @@ Signed-off-by: John Crispin void *priv; void (*hwctl)(struct mtd_info *mtd, int mode); int (*calculate)(struct mtd_info *mtd, const uint8_t *dat, -@@ -540,11 +568,11 @@ +@@ -540,11 +568,11 @@ struct nand_buffers { /** * struct nand_chip - NAND Private Flash Chip Data @@ -5134,7 +5134,7 @@ Signed-off-by: John Crispin * @read_byte: [REPLACEABLE] read one byte from the chip * @read_word: [REPLACEABLE] read one word from the chip * @write_byte: [REPLACEABLE] write a single byte to the chip on the -@@ -640,18 +668,17 @@ +@@ -640,18 +668,17 @@ struct nand_buffers { */ struct nand_chip { @@ -5155,7 +5155,7 @@ Signed-off-by: John Crispin int (*block_markbad)(struct mtd_info *mtd, loff_t ofs); void (*cmd_ctrl)(struct mtd_info *mtd, int dat, unsigned int ctrl); int (*dev_ready)(struct mtd_info *mtd); -@@ -719,6 +746,40 @@ +@@ -719,6 +746,40 @@ struct nand_chip { void *priv; }; @@ -5196,7 +5196,7 @@ Signed-off-by: John Crispin /* * NAND Flash Manufacturer ID Codes */ -@@ -850,7 +911,6 @@ +@@ -850,7 +911,6 @@ extern int nand_do_read(struct mtd_info * @chip_delay: R/B delay value in us * @options: Option flags, e.g. 16bit buswidth * @bbt_options: BBT option flags, e.g. NAND_BBT_USE_FLASH @@ -5204,7 +5204,7 @@ Signed-off-by: John Crispin * @part_probe_types: NULL-terminated array of probe types */ struct platform_nand_chip { -@@ -858,7 +918,6 @@ +@@ -858,7 +918,6 @@ struct platform_nand_chip { int chip_offset; int nr_partitions; struct mtd_partition *partitions; @@ -5212,7 +5212,7 @@ Signed-off-by: John Crispin int chip_delay; unsigned int options; unsigned int bbt_options; -@@ -908,15 +967,6 @@ +@@ -908,15 +967,6 @@ struct platform_nand_data { struct platform_nand_ctrl ctrl; }; @@ -5230,7 +5230,7 @@ Signed-off-by: John Crispin { --- a/include/linux/mtd/nand_bch.h +++ b/include/linux/mtd/nand_bch.h -@@ -32,9 +32,7 @@ +@@ -32,9 +32,7 @@ int nand_bch_correct_data(struct mtd_inf /* * Initialize BCH encoder/decoder */ @@ -5241,7 +5241,7 @@ Signed-off-by: John Crispin /* * Release BCH encoder/decoder resources */ -@@ -55,12 +53,10 @@ +@@ -55,12 +53,10 @@ static inline int nand_bch_correct_data(struct mtd_info *mtd, unsigned char *buf, unsigned char *read_ecc, unsigned char *calc_ecc) { @@ -5258,7 +5258,7 @@ Signed-off-by: John Crispin } --- a/include/linux/mtd/nftl.h +++ b/include/linux/mtd/nftl.h -@@ -50,7 +50,6 @@ +@@ -50,7 +50,6 @@ struct NFTLrecord { unsigned int nb_blocks; /* number of physical blocks */ unsigned int nb_boot_blocks; /* number of blocks used by the bios */ struct erase_info instr; @@ -5268,7 +5268,7 @@ Signed-off-by: John Crispin int NFTL_mount(struct NFTLrecord *s); --- a/include/linux/mtd/onenand.h +++ b/include/linux/mtd/onenand.h -@@ -80,7 +80,6 @@ +@@ -80,7 +80,6 @@ struct onenand_bufferram { * @page_buf: [INTERN] page main data buffer * @oob_buf: [INTERN] page oob data buffer * @subpagesize: [INTERN] holds the subpagesize @@ -5276,7 +5276,7 @@ Signed-off-by: John Crispin * @bbm: [REPLACEABLE] pointer to Bad Block Management * @priv: [OPTIONAL] pointer to private chip date */ -@@ -134,7 +133,6 @@ +@@ -134,7 +133,6 @@ struct onenand_chip { #endif int subpagesize; @@ -5286,7 +5286,7 @@ Signed-off-by: John Crispin --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h -@@ -42,7 +42,6 @@ +@@ -42,7 +42,6 @@ struct mtd_partition { uint64_t size; /* partition size */ uint64_t offset; /* offset within the master MTD space */ uint32_t mask_flags; /* master MTD flags to mask out for this partition */ @@ -5294,7 +5294,7 @@ Signed-off-by: John Crispin }; #define MTDPART_OFS_RETAIN (-3) -@@ -56,11 +55,9 @@ +@@ -56,11 +55,9 @@ struct device_node; /** * struct mtd_part_parser_data - used to pass data to MTD partition parsers. * @origin: for RedBoot, start address of MTD device @@ -5306,7 +5306,7 @@ Signed-off-by: John Crispin }; -@@ -78,14 +75,34 @@ +@@ -78,14 +75,34 @@ struct mtd_part_parser { struct list_head list; struct module *owner; const char *name; @@ -5345,7 +5345,7 @@ Signed-off-by: John Crispin long long offset, long long length); --- a/include/linux/mtd/sh_flctl.h +++ b/include/linux/mtd/sh_flctl.h -@@ -143,11 +143,11 @@ +@@ -143,11 +143,11 @@ enum flctl_ecc_res_t { struct dma_chan; struct sh_flctl { @@ -5358,7 +5358,7 @@ Signed-off-by: John Crispin uint8_t done_buff[2048 + 64]; /* max size 2048 + 64 */ int read_bytes; -@@ -186,7 +186,7 @@ +@@ -186,7 +186,7 @@ struct sh_flctl_platform_data { static inline struct sh_flctl *mtd_to_flctl(struct mtd_info *mtdinfo) { @@ -5380,7 +5380,7 @@ Signed-off-by: John Crispin }; --- a/include/uapi/mtd/mtd-abi.h +++ b/include/uapi/mtd/mtd-abi.h -@@ -228,7 +228,7 @@ +@@ -228,7 +228,7 @@ struct nand_oobfree { * complete set of ECC information. The ioctl truncates the larger internal * structure to retain binary compatibility with the static declaration of the * ioctl. Note that the "MTD_MAX_..._ENTRIES" macros represent the max size of @@ -5391,7 +5391,7 @@ Signed-off-by: John Crispin __u32 eccbytes; --- a/fs/jffs2/wbuf.c +++ b/fs/jffs2/wbuf.c -@@ -1153,7 +1153,7 @@ +@@ -1153,7 +1153,7 @@ static struct jffs2_sb_info *work_to_sb( { struct delayed_work *dwork; @@ -5400,7 +5400,7 @@ Signed-off-by: John Crispin return container_of(dwork, struct jffs2_sb_info, wbuf_dwork); } -@@ -1183,22 +1183,20 @@ +@@ -1183,22 +1183,20 @@ void jffs2_dirty_trigger(struct jffs2_sb int jffs2_nand_flash_setup(struct jffs2_sb_info *c) { @@ -5435,7 +5435,7 @@ Signed-off-by: John Crispin #define SR_SRWD BIT(7) /* SR write protect */ #define SR_QUAD_EN_MX BIT(6) /* Macronix Quad I/O */ -@@ -116,6 +117,7 @@ +@@ -116,6 +117,7 @@ enum spi_nor_ops { enum spi_nor_option_flags { SNOR_F_USE_FSR = BIT(0), @@ -5443,7 +5443,7 @@ Signed-off-by: John Crispin }; /** -@@ -123,7 +125,6 @@ +@@ -123,7 +125,6 @@ enum spi_nor_option_flags { * @mtd: point to a mtd_info structure * @lock: the lock for the read/write/erase/lock/unlock operations * @dev: point to a spi device, or a spi nor controller device. @@ -5451,7 +5451,7 @@ Signed-off-by: John Crispin * @page_size: the page size of the SPI NOR * @addr_width: number of address bytes * @erase_opcode: the opcode for erasing a sector -@@ -143,7 +144,8 @@ +@@ -143,7 +144,8 @@ enum spi_nor_option_flags { * @read: [DRIVER-SPECIFIC] read data from the SPI NOR * @write: [DRIVER-SPECIFIC] write data to the SPI NOR * @erase: [DRIVER-SPECIFIC] erase a sector of the SPI NOR @@ -5461,7 +5461,7 @@ Signed-off-by: John Crispin * @flash_lock: [FLASH-SPECIFIC] lock a region of the SPI NOR * @flash_unlock: [FLASH-SPECIFIC] unlock a region of the SPI NOR * @flash_is_locked: [FLASH-SPECIFIC] check if a region of the SPI NOR is -@@ -154,7 +156,6 @@ +@@ -154,7 +156,6 @@ struct spi_nor { struct mtd_info mtd; struct mutex lock; struct device *dev; @@ -5469,7 +5469,7 @@ Signed-off-by: John Crispin u32 page_size; u8 addr_width; u8 erase_opcode; -@@ -184,6 +185,17 @@ +@@ -184,6 +185,17 @@ struct spi_nor { void *priv; }; diff --git a/target/linux/mediatek/patches-4.4/0073-of-mtd-prepare-helper-reading-NAND-ECC-algo-from-DT.patch b/target/linux/mediatek/patches-4.4/0073-of-mtd-prepare-helper-reading-NAND-ECC-algo-from-DT.patch index 99eae20fef..aa45441afa 100644 --- a/target/linux/mediatek/patches-4.4/0073-of-mtd-prepare-helper-reading-NAND-ECC-algo-from-DT.patch +++ b/target/linux/mediatek/patches-4.4/0073-of-mtd-prepare-helper-reading-NAND-ECC-algo-from-DT.patch @@ -22,11 +22,9 @@ Signed-off-by: Boris Brezillon include/linux/of_mtd.h | 6 ++++++ 2 files changed, 42 insertions(+) -diff --git a/drivers/of/of_mtd.c b/drivers/of/of_mtd.c -index b7361ed..15d056e 100644 --- a/drivers/of/of_mtd.c +++ b/drivers/of/of_mtd.c -@@ -50,6 +50,42 @@ int of_get_nand_ecc_mode(struct device_node *np) +@@ -50,6 +50,42 @@ int of_get_nand_ecc_mode(struct device_n EXPORT_SYMBOL_GPL(of_get_nand_ecc_mode); /** @@ -69,8 +67,6 @@ index b7361ed..15d056e 100644 * of_get_nand_ecc_step_size - Get ECC step size associated to * the required ECC strength (see below). * @np: Pointer to the given device_node -diff --git a/include/linux/of_mtd.h b/include/linux/of_mtd.h -index e266caa..0f6aca5 100644 --- a/include/linux/of_mtd.h +++ b/include/linux/of_mtd.h @@ -13,6 +13,7 @@ @@ -81,18 +77,15 @@ index e266caa..0f6aca5 100644 int of_get_nand_ecc_step_size(struct device_node *np); int of_get_nand_ecc_strength(struct device_node *np); int of_get_nand_bus_width(struct device_node *np); -@@ -25,6 +26,11 @@ static inline int of_get_nand_ecc_mode(struct device_node *np) +@@ -24,6 +25,11 @@ static inline int of_get_nand_ecc_mode(s + { return -ENOSYS; } - ++ +static inline int of_get_nand_ecc_algo(struct device_node *np) +{ + return -ENOSYS; +} -+ + static inline int of_get_nand_ecc_step_size(struct device_node *np) { - return -ENOSYS; --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0074-mtd-mediatek-device-tree-docs-for-MTK-Smart-Device-G.patch b/target/linux/mediatek/patches-4.4/0074-mtd-mediatek-device-tree-docs-for-MTK-Smart-Device-G.patch index 27572c1e19..5f260e3e34 100644 --- a/target/linux/mediatek/patches-4.4/0074-mtd-mediatek-device-tree-docs-for-MTK-Smart-Device-G.patch +++ b/target/linux/mediatek/patches-4.4/0074-mtd-mediatek-device-tree-docs-for-MTK-Smart-Device-G.patch @@ -13,9 +13,6 @@ Signed-off-by: Jorge Ramirez-Ortiz 1 file changed, 161 insertions(+) create mode 100644 Documentation/devicetree/bindings/mtd/mtk-nand.txt -diff --git a/Documentation/devicetree/bindings/mtd/mtk-nand.txt b/Documentation/devicetree/bindings/mtd/mtk-nand.txt -new file mode 100644 -index 0000000..175767d --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/mtk-nand.txt @@ -0,0 +1,161 @@ @@ -180,6 +177,3 @@ index 0000000..175767d + clock-names = "nfiecc_clk"; + status = "disabled"; + }; --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0075-mtd-mediatek-driver-for-MTK-Smart-Device-Gen1-NAND.patch b/target/linux/mediatek/patches-4.4/0075-mtd-mediatek-driver-for-MTK-Smart-Device-Gen1-NAND.patch index a9c776bcfc..e5312eb08c 100644 --- a/target/linux/mediatek/patches-4.4/0075-mtd-mediatek-driver-for-MTK-Smart-Device-Gen1-NAND.patch +++ b/target/linux/mediatek/patches-4.4/0075-mtd-mediatek-driver-for-MTK-Smart-Device-Gen1-NAND.patch @@ -18,8 +18,6 @@ Signed-off-by: Jorge Ramirez-Ortiz create mode 100644 drivers/mtd/nand/mtk_ecc.h create mode 100644 drivers/mtd/nand/mtk_nand.c -diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig -index f05e0e9..3c26e89 100644 --- a/drivers/mtd/nand/Kconfig +++ b/drivers/mtd/nand/Kconfig @@ -563,4 +563,11 @@ config MTD_NAND_QCOM @@ -34,20 +32,15 @@ index f05e0e9..3c26e89 100644 + This controller is found on mt27xx, mt81xx, mt65xx SoCs. + endif # MTD_NAND -diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile -index f553353..cafde6f 100644 --- a/drivers/mtd/nand/Makefile +++ b/drivers/mtd/nand/Makefile -@@ -57,5 +57,6 @@ obj-$(CONFIG_MTD_NAND_SUNXI) += sunxi_nand.o +@@ -57,5 +57,6 @@ obj-$(CONFIG_MTD_NAND_SUNXI) += sunxi_n obj-$(CONFIG_MTD_NAND_HISI504) += hisi504_nand.o obj-$(CONFIG_MTD_NAND_BRCMNAND) += brcmnand/ obj-$(CONFIG_MTD_NAND_QCOM) += qcom_nandc.o +obj-$(CONFIG_MTD_NAND_MTK) += mtk_nand.o mtk_ecc.o nand-objs := nand_base.o nand_bbt.o nand_timings.o -diff --git a/drivers/mtd/nand/mtk_ecc.c b/drivers/mtd/nand/mtk_ecc.c -new file mode 100644 -index 0000000..28769f1 --- /dev/null +++ b/drivers/mtd/nand/mtk_ecc.c @@ -0,0 +1,527 @@ @@ -578,9 +571,6 @@ index 0000000..28769f1 +MODULE_AUTHOR("Jorge Ramirez-Ortiz "); +MODULE_DESCRIPTION("MTK Nand ECC Driver"); +MODULE_LICENSE("GPL"); -diff --git a/drivers/mtd/nand/mtk_ecc.h b/drivers/mtd/nand/mtk_ecc.h -new file mode 100644 -index 0000000..434826f --- /dev/null +++ b/drivers/mtd/nand/mtk_ecc.h @@ -0,0 +1,53 @@ @@ -637,9 +627,6 @@ index 0000000..434826f +void mtk_ecc_release(struct mtk_ecc *); + +#endif -diff --git a/drivers/mtd/nand/mtk_nand.c b/drivers/mtd/nand/mtk_nand.c -new file mode 100644 -index 0000000..907b90c --- /dev/null +++ b/drivers/mtd/nand/mtk_nand.c @@ -0,0 +1,1432 @@ @@ -2075,6 +2062,3 @@ index 0000000..907b90c +MODULE_AUTHOR("Xiaolei Li "); +MODULE_AUTHOR("Jorge Ramirez-Ortiz "); +MODULE_DESCRIPTION("MTK Nand Flash Controller Driver"); --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0076-mtd-nand-add-power-domains-to-the-mediatek-driver.patch b/target/linux/mediatek/patches-4.4/0076-mtd-nand-add-power-domains-to-the-mediatek-driver.patch index d0bc250f45..7702246a4c 100644 --- a/target/linux/mediatek/patches-4.4/0076-mtd-nand-add-power-domains-to-the-mediatek-driver.patch +++ b/target/linux/mediatek/patches-4.4/0076-mtd-nand-add-power-domains-to-the-mediatek-driver.patch @@ -8,8 +8,6 @@ Signed-off-by: John Crispin drivers/mtd/nand/mtk_nand.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) -diff --git a/drivers/mtd/nand/mtk_nand.c b/drivers/mtd/nand/mtk_nand.c -index 907b90c..bde1a1d 100644 --- a/drivers/mtd/nand/mtk_nand.c +++ b/drivers/mtd/nand/mtk_nand.c @@ -16,6 +16,7 @@ @@ -28,7 +26,7 @@ index 907b90c..bde1a1d 100644 #define MTK_NAME "mtk-nand" #define KB(x) ((x) * 1024UL) -@@ -539,6 +541,8 @@ static void mtk_nfc_bad_mark_swap(struct mtd_info *mtd, uint8_t *buf, int raw) +@@ -539,6 +541,8 @@ static void mtk_nfc_bad_mark_swap(struct struct mtk_nfc_nand_chip *nand = to_mtk_nand(chip); u32 bad_pos = nand->bad_mark.pos; @@ -37,7 +35,7 @@ index 907b90c..bde1a1d 100644 if (raw) bad_pos += nand->bad_mark.sec * mtk_data_len(chip); else -@@ -946,7 +950,8 @@ static int mtk_nfc_read_oob_std(struct mtd_info *mtd, struct nand_chip *chip, +@@ -946,7 +950,8 @@ static int mtk_nfc_read_oob_std(struct m static inline void mtk_nfc_hw_init(struct mtk_nfc *nfc) { @@ -47,7 +45,7 @@ index 907b90c..bde1a1d 100644 nfi_writew(nfc, 0xf1, NFI_CNRNB); nfi_writew(nfc, PAGEFMT_8K_16K, NFI_PAGEFMT); -@@ -1328,6 +1333,9 @@ static int mtk_nfc_probe(struct platform_device *pdev) +@@ -1328,6 +1333,9 @@ static int mtk_nfc_probe(struct platform goto clk_disable; } @@ -57,7 +55,7 @@ index 907b90c..bde1a1d 100644 platform_set_drvdata(pdev, nfc); ret = mtk_nfc_nand_chips_init(dev, nfc); -@@ -1362,6 +1370,9 @@ static int mtk_nfc_remove(struct platform_device *pdev) +@@ -1362,6 +1370,9 @@ static int mtk_nfc_remove(struct platfor mtk_ecc_release(nfc->ecc); mtk_nfc_disable_clk(&nfc->clk); @@ -67,6 +65,3 @@ index 907b90c..bde1a1d 100644 return 0; } --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0077-net-next-mediatek-use-mdiobus_free-in-favour-of-kfre.patch b/target/linux/mediatek/patches-4.4/0077-net-next-mediatek-use-mdiobus_free-in-favour-of-kfre.patch index a77cceeee0..c2fe21825c 100644 --- a/target/linux/mediatek/patches-4.4/0077-net-next-mediatek-use-mdiobus_free-in-favour-of-kfre.patch +++ b/target/linux/mediatek/patches-4.4/0077-net-next-mediatek-use-mdiobus_free-in-favour-of-kfre.patch @@ -14,11 +14,9 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index bab5d45..0c8d369 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -280,7 +280,7 @@ static int mtk_mdio_init(struct mtk_eth *eth) +@@ -280,7 +280,7 @@ static int mtk_mdio_init(struct mtk_eth return 0; err_free_bus: @@ -27,7 +25,7 @@ index bab5d45..0c8d369 100644 err_put_node: of_node_put(mii_np); -@@ -295,7 +295,7 @@ static void mtk_mdio_cleanup(struct mtk_eth *eth) +@@ -295,7 +295,7 @@ static void mtk_mdio_cleanup(struct mtk_ mdiobus_unregister(eth->mii_bus); of_node_put(eth->mii_bus->dev.of_node); @@ -36,6 +34,3 @@ index bab5d45..0c8d369 100644 } static inline void mtk_irq_disable(struct mtk_eth *eth, u32 mask) --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0078-net-next-mediatek-fix-gigabit-and-flow-control-adver.patch b/target/linux/mediatek/patches-4.4/0078-net-next-mediatek-fix-gigabit-and-flow-control-adver.patch index 244eb67750..42adb9e786 100644 --- a/target/linux/mediatek/patches-4.4/0078-net-next-mediatek-fix-gigabit-and-flow-control-adver.patch +++ b/target/linux/mediatek/patches-4.4/0078-net-next-mediatek-fix-gigabit-and-flow-control-adver.patch @@ -14,11 +14,9 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.c | 30 +++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index 0c8d369..3436c7b 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -133,6 +133,8 @@ static int mtk_mdio_read(struct mii_bus *bus, int phy_addr, int phy_reg) +@@ -133,6 +133,8 @@ static int mtk_mdio_read(struct mii_bus static void mtk_phy_link_adjust(struct net_device *dev) { struct mtk_mac *mac = netdev_priv(dev); @@ -27,7 +25,7 @@ index 0c8d369..3436c7b 100644 u32 mcr = MAC_MCR_MAX_RX_1536 | MAC_MCR_IPG_CFG | MAC_MCR_FORCE_MODE | MAC_MCR_TX_EN | MAC_MCR_RX_EN | MAC_MCR_BACKOFF_EN | -@@ -150,11 +152,30 @@ static void mtk_phy_link_adjust(struct net_device *dev) +@@ -150,11 +152,30 @@ static void mtk_phy_link_adjust(struct n if (mac->phy_dev->link) mcr |= MAC_MCR_FORCE_LINK; @@ -61,7 +59,7 @@ index 0c8d369..3436c7b 100644 mtk_w32(mac->hw, mcr, MTK_MAC_MCR(mac->id)); -@@ -236,7 +257,8 @@ static int mtk_phy_connect(struct mtk_mac *mac) +@@ -236,7 +257,8 @@ static int mtk_phy_connect(struct mtk_ma mac->phy_dev->autoneg = AUTONEG_ENABLE; mac->phy_dev->speed = 0; mac->phy_dev->duplex = 0; @@ -71,6 +69,3 @@ index 0c8d369..3436c7b 100644 mac->phy_dev->advertising = mac->phy_dev->supported | ADVERTISED_Autoneg; phy_start_aneg(mac->phy_dev); --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0079-net-next-mediatek-add-fixed-phy-support.patch b/target/linux/mediatek/patches-4.4/0079-net-next-mediatek-add-fixed-phy-support.patch index 6ebc1d275a..669febbdf1 100644 --- a/target/linux/mediatek/patches-4.4/0079-net-next-mediatek-add-fixed-phy-support.patch +++ b/target/linux/mediatek/patches-4.4/0079-net-next-mediatek-add-fixed-phy-support.patch @@ -14,11 +14,9 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.c | 6 ++++++ 1 file changed, 6 insertions(+) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index 3436c7b..ab61789 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -229,6 +229,9 @@ static int mtk_phy_connect(struct mtk_mac *mac) +@@ -229,6 +229,9 @@ static int mtk_phy_connect(struct mtk_ma u32 val, ge_mode; np = of_parse_phandle(mac->of_node, "phy-handle", 0); @@ -28,7 +26,7 @@ index 3436c7b..ab61789 100644 if (!np) return -ENODEV; -@@ -257,6 +260,9 @@ static int mtk_phy_connect(struct mtk_mac *mac) +@@ -257,6 +260,9 @@ static int mtk_phy_connect(struct mtk_ma mac->phy_dev->autoneg = AUTONEG_ENABLE; mac->phy_dev->speed = 0; mac->phy_dev->duplex = 0; @@ -38,6 +36,3 @@ index 3436c7b..ab61789 100644 mac->phy_dev->supported &= PHY_GBIT_FEATURES | SUPPORTED_Pause | SUPPORTED_Asym_Pause; mac->phy_dev->advertising = mac->phy_dev->supported | --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0080-net-next-mediatek-properly-handle-RGMII-modes.patch b/target/linux/mediatek/patches-4.4/0080-net-next-mediatek-properly-handle-RGMII-modes.patch index a7dea77750..1d176f2ece 100644 --- a/target/linux/mediatek/patches-4.4/0080-net-next-mediatek-properly-handle-RGMII-modes.patch +++ b/target/linux/mediatek/patches-4.4/0080-net-next-mediatek-properly-handle-RGMII-modes.patch @@ -17,11 +17,9 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.c | 3 +++ 1 file changed, 3 insertions(+) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index ab61789..76ecb1b 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -236,6 +236,9 @@ static int mtk_phy_connect(struct mtk_mac *mac) +@@ -236,6 +236,9 @@ static int mtk_phy_connect(struct mtk_ma return -ENODEV; switch (of_get_phy_mode(np)) { @@ -31,6 +29,3 @@ index ab61789..76ecb1b 100644 case PHY_INTERFACE_MODE_RGMII: ge_mode = 0; break; --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0081-net-next-mediatek-fix-DQL-support.patch b/target/linux/mediatek/patches-4.4/0081-net-next-mediatek-fix-DQL-support.patch index 4d6a689603..f1c7290aac 100644 --- a/target/linux/mediatek/patches-4.4/0081-net-next-mediatek-fix-DQL-support.patch +++ b/target/linux/mediatek/patches-4.4/0081-net-next-mediatek-fix-DQL-support.patch @@ -16,11 +16,9 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.c | 33 ++++++++++++++++----------- 1 file changed, 20 insertions(+), 13 deletions(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index 76ecb1b..feedd5a 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -656,7 +656,16 @@ static int mtk_tx_map(struct sk_buff *skb, struct net_device *dev, +@@ -656,7 +656,16 @@ static int mtk_tx_map(struct sk_buff *sk WRITE_ONCE(itxd->txd3, (TX_DMA_SWC | TX_DMA_PLEN0(skb_headlen(skb)) | (!nr_frags * TX_DMA_LS0))); @@ -38,7 +36,7 @@ index 76ecb1b..feedd5a 100644 skb_tx_timestamp(skb); ring->next_free = mtk_qdma_phys_to_virt(ring, txd->txd2); -@@ -884,21 +893,18 @@ static int mtk_poll_tx(struct mtk_eth *eth, int budget, bool *tx_again) +@@ -884,21 +893,18 @@ static int mtk_poll_tx(struct mtk_eth *e struct mtk_tx_dma *desc; struct sk_buff *skb; struct mtk_tx_buf *tx_buf; @@ -63,7 +61,7 @@ index 76ecb1b..feedd5a 100644 u32 next_cpu = desc->txd2; int mac; -@@ -918,9 +924,8 @@ static int mtk_poll_tx(struct mtk_eth *eth, int budget, bool *tx_again) +@@ -918,9 +924,8 @@ static int mtk_poll_tx(struct mtk_eth *e } if (skb != (struct sk_buff *)MTK_DMA_DUMMY_DESC) { @@ -75,7 +73,7 @@ index 76ecb1b..feedd5a 100644 } mtk_tx_unmap(eth->dev, tx_buf); -@@ -933,11 +938,13 @@ static int mtk_poll_tx(struct mtk_eth *eth, int budget, bool *tx_again) +@@ -933,11 +938,13 @@ static int mtk_poll_tx(struct mtk_eth *e mtk_w32(eth, cpu, MTK_QTX_CRX_PTR); @@ -92,6 +90,3 @@ index 76ecb1b..feedd5a 100644 } /* read hw index again make sure no new tx packet */ --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0082-net-next-mediatek-add-missing-return-code-check.patch b/target/linux/mediatek/patches-4.4/0082-net-next-mediatek-add-missing-return-code-check.patch index 529290a62b..19cdbf0d3e 100644 --- a/target/linux/mediatek/patches-4.4/0082-net-next-mediatek-add-missing-return-code-check.patch +++ b/target/linux/mediatek/patches-4.4/0082-net-next-mediatek-add-missing-return-code-check.patch @@ -12,11 +12,9 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.c | 3 +++ 1 file changed, 3 insertions(+) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index feedd5a..fefbf16 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -498,6 +498,9 @@ static int mtk_init_fq_dma(struct mtk_eth *eth) +@@ -498,6 +498,9 @@ static int mtk_init_fq_dma(struct mtk_et eth->scratch_head = kcalloc(cnt, MTK_QDMA_PAGE_SIZE, GFP_KERNEL); @@ -26,6 +24,3 @@ index feedd5a..fefbf16 100644 dma_addr = dma_map_single(eth->dev, eth->scratch_head, cnt * MTK_QDMA_PAGE_SIZE, DMA_FROM_DEVICE); --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0083-net-next-mediatek-fix-missing-free-of-scratch-memory.patch b/target/linux/mediatek/patches-4.4/0083-net-next-mediatek-fix-missing-free-of-scratch-memory.patch index b55950e13d..793875faf4 100644 --- a/target/linux/mediatek/patches-4.4/0083-net-next-mediatek-fix-missing-free-of-scratch-memory.patch +++ b/target/linux/mediatek/patches-4.4/0083-net-next-mediatek-fix-missing-free-of-scratch-memory.patch @@ -15,11 +15,9 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.h | 2 ++ 2 files changed, 15 insertions(+), 5 deletions(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index fefbf16..d9664e5 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -484,14 +484,14 @@ static inline void mtk_rx_get_desc(struct mtk_rx_dma *rxd, +@@ -484,14 +484,14 @@ static inline void mtk_rx_get_desc(struc /* the qdma core needs scratch memory to be setup */ static int mtk_init_fq_dma(struct mtk_eth *eth) { @@ -36,7 +34,7 @@ index fefbf16..d9664e5 100644 GFP_ATOMIC | __GFP_ZERO); if (unlikely(!eth->scratch_ring)) return -ENOMEM; -@@ -508,19 +508,19 @@ static int mtk_init_fq_dma(struct mtk_eth *eth) +@@ -508,19 +508,19 @@ static int mtk_init_fq_dma(struct mtk_et return -ENOMEM; memset(eth->scratch_ring, 0x0, sizeof(struct mtk_tx_dma) * cnt); @@ -59,7 +57,7 @@ index fefbf16..d9664e5 100644 mtk_w32(eth, phy_ring_tail, MTK_QDMA_FQ_TAIL); mtk_w32(eth, (cnt << 16) | cnt, MTK_QDMA_FQ_CNT); mtk_w32(eth, MTK_QDMA_PAGE_SIZE << 16, MTK_QDMA_FQ_BLEN); -@@ -1220,6 +1220,14 @@ static void mtk_dma_free(struct mtk_eth *eth) +@@ -1220,6 +1220,14 @@ static void mtk_dma_free(struct mtk_eth for (i = 0; i < MTK_MAC_COUNT; i++) if (eth->netdev[i]) netdev_reset_queue(eth->netdev[i]); @@ -74,8 +72,6 @@ index fefbf16..d9664e5 100644 mtk_tx_clean(eth); mtk_rx_clean(eth); kfree(eth->scratch_head); -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h -index eed626d..57f7e8a 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h @@ -357,6 +357,7 @@ struct mtk_rx_ring { @@ -94,6 +90,3 @@ index eed626d..57f7e8a 100644 void *scratch_head; struct clk *clk_ethif; struct clk *clk_esw; --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0084-net-next-mediatek-invalid-buffer-lookup-in-mtk_tx_ma.patch b/target/linux/mediatek/patches-4.4/0084-net-next-mediatek-invalid-buffer-lookup-in-mtk_tx_ma.patch index 31e2a1f782..eb44af6f89 100644 --- a/target/linux/mediatek/patches-4.4/0084-net-next-mediatek-invalid-buffer-lookup-in-mtk_tx_ma.patch +++ b/target/linux/mediatek/patches-4.4/0084-net-next-mediatek-invalid-buffer-lookup-in-mtk_tx_ma.patch @@ -14,11 +14,9 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index d9664e5..17ca1c1 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -686,7 +686,7 @@ static int mtk_tx_map(struct sk_buff *skb, struct net_device *dev, +@@ -686,7 +686,7 @@ static int mtk_tx_map(struct sk_buff *sk err_dma: do { @@ -27,6 +25,3 @@ index d9664e5..17ca1c1 100644 /* unmap dma */ mtk_tx_unmap(&dev->dev, tx_buf); --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0085-net-next-mediatek-dropped-rx-packets-are-not-being-c.patch b/target/linux/mediatek/patches-4.4/0085-net-next-mediatek-dropped-rx-packets-are-not-being-c.patch index 6eeaa67723..2b2a011b3d 100644 --- a/target/linux/mediatek/patches-4.4/0085-net-next-mediatek-dropped-rx-packets-are-not-being-c.patch +++ b/target/linux/mediatek/patches-4.4/0085-net-next-mediatek-dropped-rx-packets-are-not-being-c.patch @@ -14,11 +14,9 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 ++ 1 file changed, 2 insertions(+) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index 17ca1c1..aadd748 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -841,6 +841,7 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget, +@@ -841,6 +841,7 @@ static int mtk_poll_rx(struct napi_struc DMA_FROM_DEVICE); if (unlikely(dma_mapping_error(&netdev->dev, dma_addr))) { skb_free_frag(new_data); @@ -26,7 +24,7 @@ index 17ca1c1..aadd748 100644 goto release_desc; } -@@ -848,6 +849,7 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget, +@@ -848,6 +849,7 @@ static int mtk_poll_rx(struct napi_struc skb = build_skb(data, ring->frag_size); if (unlikely(!skb)) { put_page(virt_to_head_page(new_data)); @@ -34,6 +32,3 @@ index 17ca1c1..aadd748 100644 goto release_desc; } skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN); --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0086-net-next-mediatek-add-next-data-pointer-coherency-pr.patch b/target/linux/mediatek/patches-4.4/0086-net-next-mediatek-add-next-data-pointer-coherency-pr.patch index 0d2fc46167..cd4bdf8fa4 100644 --- a/target/linux/mediatek/patches-4.4/0086-net-next-mediatek-add-next-data-pointer-coherency-pr.patch +++ b/target/linux/mediatek/patches-4.4/0086-net-next-mediatek-add-next-data-pointer-coherency-pr.patch @@ -16,11 +16,9 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index aadd748..72908b2 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1292,7 +1292,7 @@ static int mtk_start_dma(struct mtk_eth *eth) +@@ -1292,7 +1292,7 @@ static int mtk_start_dma(struct mtk_eth mtk_w32(eth, MTK_TX_WB_DDONE | MTK_RX_DMA_EN | MTK_TX_DMA_EN | MTK_RX_2B_OFFSET | MTK_DMA_SIZE_16DWORDS | @@ -29,8 +27,6 @@ index aadd748..72908b2 100644 MTK_QDMA_GLO_CFG); return 0; -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h -index 57f7e8a..a5eb7c6 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h @@ -91,6 +91,7 @@ @@ -41,6 +37,3 @@ index 57f7e8a..a5eb7c6 100644 #define MTK_TX_WB_DDONE BIT(6) #define MTK_DMA_SIZE_16DWORDS (2 << 4) #define MTK_RX_DMA_BUSY BIT(3) --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0087-net-next-mediatek-disable-all-interrupts-during-prob.patch b/target/linux/mediatek/patches-4.4/0087-net-next-mediatek-disable-all-interrupts-during-prob.patch index 68b578a26f..6e809b9315 100644 --- a/target/linux/mediatek/patches-4.4/0087-net-next-mediatek-disable-all-interrupts-during-prob.patch +++ b/target/linux/mediatek/patches-4.4/0087-net-next-mediatek-disable-all-interrupts-during-prob.patch @@ -13,11 +13,9 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index 72908b2..ec6140f 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1406,7 +1406,7 @@ static int __init mtk_hw_init(struct mtk_eth *eth) +@@ -1406,7 +1406,7 @@ static int __init mtk_hw_init(struct mtk /* disable delay and normal interrupt */ mtk_w32(eth, 0, MTK_QDMA_DELAY_INT); @@ -26,6 +24,3 @@ index 72908b2..ec6140f 100644 mtk_w32(eth, RST_GL_PSE, MTK_RST_GL); mtk_w32(eth, 0, MTK_RST_GL); --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0088-net-next-mediatek-fix-threshold-value.patch b/target/linux/mediatek/patches-4.4/0088-net-next-mediatek-fix-threshold-value.patch index 2a8fc33fa2..c35975b072 100644 --- a/target/linux/mediatek/patches-4.4/0088-net-next-mediatek-fix-threshold-value.patch +++ b/target/linux/mediatek/patches-4.4/0088-net-next-mediatek-fix-threshold-value.patch @@ -16,11 +16,9 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index ec6140f..d03f339 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1043,8 +1043,7 @@ static int mtk_tx_alloc(struct mtk_eth *eth) +@@ -1043,8 +1043,7 @@ static int mtk_tx_alloc(struct mtk_eth * atomic_set(&ring->free_count, MTK_DMA_SIZE - 2); ring->next_free = &ring->dma[0]; ring->last_free = &ring->dma[MTK_DMA_SIZE - 2]; @@ -30,6 +28,3 @@ index ec6140f..d03f339 100644 /* make sure that all changes to the dma ring are flushed before we * continue --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0089-net-next-mediatek-increase-watchdog_timeo.patch b/target/linux/mediatek/patches-4.4/0089-net-next-mediatek-increase-watchdog_timeo.patch index 9632556d02..96928d232a 100644 --- a/target/linux/mediatek/patches-4.4/0089-net-next-mediatek-increase-watchdog_timeo.patch +++ b/target/linux/mediatek/patches-4.4/0089-net-next-mediatek-increase-watchdog_timeo.patch @@ -13,11 +13,9 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index d03f339..52cdb3a 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1720,7 +1720,7 @@ static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) +@@ -1720,7 +1720,7 @@ static int mtk_add_mac(struct mtk_eth *e mac->hw_stats->reg_offset = id * MTK_STAT_OFFSET; SET_NETDEV_DEV(eth->netdev[id], eth->dev); @@ -26,6 +24,3 @@ index d03f339..52cdb3a 100644 eth->netdev[id]->netdev_ops = &mtk_netdev_ops; eth->netdev[id]->base_addr = (unsigned long)eth->base; eth->netdev[id]->vlan_features = MTK_HW_FEATURES & --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0090-net-next-mediatek-fix-off-by-one-in-the-TX-ring-allo.patch b/target/linux/mediatek/patches-4.4/0090-net-next-mediatek-fix-off-by-one-in-the-TX-ring-allo.patch index 7a58bfb3e4..b6f32fc451 100644 --- a/target/linux/mediatek/patches-4.4/0090-net-next-mediatek-fix-off-by-one-in-the-TX-ring-allo.patch +++ b/target/linux/mediatek/patches-4.4/0090-net-next-mediatek-fix-off-by-one-in-the-TX-ring-allo.patch @@ -15,11 +15,9 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index 52cdb3a..87b48c0 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -934,7 +934,6 @@ static int mtk_poll_tx(struct mtk_eth *eth, int budget, bool *tx_again) +@@ -934,7 +934,6 @@ static int mtk_poll_tx(struct mtk_eth *e } mtk_tx_unmap(eth->dev, tx_buf); @@ -27,7 +25,7 @@ index 52cdb3a..87b48c0 100644 ring->last_free = desc; atomic_inc(&ring->free_count); -@@ -1042,7 +1041,7 @@ static int mtk_tx_alloc(struct mtk_eth *eth) +@@ -1042,7 +1041,7 @@ static int mtk_tx_alloc(struct mtk_eth * atomic_set(&ring->free_count, MTK_DMA_SIZE - 2); ring->next_free = &ring->dma[0]; @@ -36,6 +34,3 @@ index 52cdb3a..87b48c0 100644 ring->thresh = MAX_SKB_FRAGS; /* make sure that all changes to the dma ring are flushed before we --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0091-net-next-mediatek-only-wake-the-queue-if-it-is-stopp.patch b/target/linux/mediatek/patches-4.4/0091-net-next-mediatek-only-wake-the-queue-if-it-is-stopp.patch index c292ff9794..257634c4c3 100644 --- a/target/linux/mediatek/patches-4.4/0091-net-next-mediatek-only-wake-the-queue-if-it-is-stopp.patch +++ b/target/linux/mediatek/patches-4.4/0091-net-next-mediatek-only-wake-the-queue-if-it-is-stopp.patch @@ -13,11 +13,9 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index 87b48c0..9da533e 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -716,6 +716,20 @@ static inline int mtk_cal_txd_req(struct sk_buff *skb) +@@ -716,6 +716,20 @@ static inline int mtk_cal_txd_req(struct return nfrags; } @@ -38,7 +36,7 @@ index 87b48c0..9da533e 100644 static void mtk_wake_queue(struct mtk_eth *eth) { int i; -@@ -960,7 +974,8 @@ static int mtk_poll_tx(struct mtk_eth *eth, int budget, bool *tx_again) +@@ -960,7 +974,8 @@ static int mtk_poll_tx(struct mtk_eth *e if (!total) return 0; @@ -48,6 +46,3 @@ index 87b48c0..9da533e 100644 mtk_wake_queue(eth); return total; --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0092-net-next-mediatek-remove-superfluous-queue-wake-up-c.patch b/target/linux/mediatek/patches-4.4/0092-net-next-mediatek-remove-superfluous-queue-wake-up-c.patch index c330da9edb..fe08958b5c 100644 --- a/target/linux/mediatek/patches-4.4/0092-net-next-mediatek-remove-superfluous-queue-wake-up-c.patch +++ b/target/linux/mediatek/patches-4.4/0092-net-next-mediatek-remove-superfluous-queue-wake-up-c.patch @@ -17,11 +17,9 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index 9da533e..a569c32 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -795,12 +795,9 @@ static int mtk_start_xmit(struct sk_buff *skb, struct net_device *dev) +@@ -795,12 +795,9 @@ static int mtk_start_xmit(struct sk_buff if (mtk_tx_map(skb, dev, tx_num, ring, gso) < 0) goto drop; @@ -36,6 +34,3 @@ index 9da533e..a569c32 100644 spin_unlock_irqrestore(ð->page_lock, flags); return NETDEV_TX_OK; --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0093-net-next-mediatek-remove-superfluous-register-reads.patch b/target/linux/mediatek/patches-4.4/0093-net-next-mediatek-remove-superfluous-register-reads.patch index a83d71362e..3ddbbc6fd6 100644 --- a/target/linux/mediatek/patches-4.4/0093-net-next-mediatek-remove-superfluous-register-reads.patch +++ b/target/linux/mediatek/patches-4.4/0093-net-next-mediatek-remove-superfluous-register-reads.patch @@ -15,11 +15,9 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.c | 4 ---- 1 file changed, 4 deletions(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index a569c32..6a9fbde 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -335,8 +335,6 @@ static inline void mtk_irq_disable(struct mtk_eth *eth, u32 mask) +@@ -335,8 +335,6 @@ static inline void mtk_irq_disable(struc val = mtk_r32(eth, MTK_QDMA_INT_MASK); mtk_w32(eth, val & ~mask, MTK_QDMA_INT_MASK); @@ -28,7 +26,7 @@ index a569c32..6a9fbde 100644 } static inline void mtk_irq_enable(struct mtk_eth *eth, u32 mask) -@@ -345,8 +343,6 @@ static inline void mtk_irq_enable(struct mtk_eth *eth, u32 mask) +@@ -345,8 +343,6 @@ static inline void mtk_irq_enable(struct val = mtk_r32(eth, MTK_QDMA_INT_MASK); mtk_w32(eth, val | mask, MTK_QDMA_INT_MASK); @@ -37,6 +35,3 @@ index a569c32..6a9fbde 100644 } static int mtk_set_mac_address(struct net_device *dev, void *p) --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0094-net-next-mediatek-don-t-use-intermediate-variables-t.patch b/target/linux/mediatek/patches-4.4/0094-net-next-mediatek-don-t-use-intermediate-variables-t.patch index c45d7febb0..983d0c2712 100644 --- a/target/linux/mediatek/patches-4.4/0094-net-next-mediatek-don-t-use-intermediate-variables-t.patch +++ b/target/linux/mediatek/patches-4.4/0094-net-next-mediatek-don-t-use-intermediate-variables-t.patch @@ -15,8 +15,6 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index 6a9fbde..13ee15f 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -806,7 +806,7 @@ drop: @@ -37,7 +35,7 @@ index 6a9fbde..13ee15f 100644 return done; } -@@ -977,28 +977,26 @@ static int mtk_poll_tx(struct mtk_eth *eth, int budget, bool *tx_again) +@@ -977,28 +977,26 @@ static int mtk_poll_tx(struct mtk_eth *e static int mtk_poll(struct napi_struct *napi, int budget) { struct mtk_eth *eth = container_of(napi, struct mtk_eth, rx_napi); @@ -73,7 +71,7 @@ index 6a9fbde..13ee15f 100644 } if (unlikely(netif_msg_intr(eth))) { -@@ -1016,7 +1014,7 @@ static int mtk_poll(struct napi_struct *napi, int budget) +@@ -1016,7 +1014,7 @@ static int mtk_poll(struct napi_struct * return budget; napi_complete(napi); @@ -82,6 +80,3 @@ index 6a9fbde..13ee15f 100644 return rx_done; } --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0095-net-next-mediatek-add-IRQ-locking.patch b/target/linux/mediatek/patches-4.4/0095-net-next-mediatek-add-IRQ-locking.patch index ff21c09ac3..bf27aac15c 100644 --- a/target/linux/mediatek/patches-4.4/0095-net-next-mediatek-add-IRQ-locking.patch +++ b/target/linux/mediatek/patches-4.4/0095-net-next-mediatek-add-IRQ-locking.patch @@ -17,11 +17,9 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.h | 1 + 2 files changed, 8 insertions(+) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index 13ee15f..c869064 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -331,18 +331,24 @@ static void mtk_mdio_cleanup(struct mtk_eth *eth) +@@ -331,18 +331,24 @@ static void mtk_mdio_cleanup(struct mtk_ static inline void mtk_irq_disable(struct mtk_eth *eth, u32 mask) { @@ -46,7 +44,7 @@ index 13ee15f..c869064 100644 } static int mtk_set_mac_address(struct net_device *dev, void *p) -@@ -1771,6 +1777,7 @@ static int mtk_probe(struct platform_device *pdev) +@@ -1771,6 +1777,7 @@ static int mtk_probe(struct platform_dev return -EADDRNOTAVAIL; spin_lock_init(ð->page_lock); @@ -54,8 +52,6 @@ index 13ee15f..c869064 100644 eth->ethsys = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, "mediatek,ethsys"); -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h -index a5eb7c6..3159d2a 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h @@ -373,6 +373,7 @@ struct mtk_eth { @@ -66,6 +62,3 @@ index a5eb7c6..3159d2a 100644 struct net_device dummy_dev; struct net_device *netdev[MTK_MAX_DEVS]; struct mtk_mac *mac[MTK_MAX_DEVS]; --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0096-net-next-mediatek-add-support-for-IRQ-grouping.patch b/target/linux/mediatek/patches-4.4/0096-net-next-mediatek-add-support-for-IRQ-grouping.patch index 01fe771a1a..727073ebcd 100644 --- a/target/linux/mediatek/patches-4.4/0096-net-next-mediatek-add-support-for-IRQ-grouping.patch +++ b/target/linux/mediatek/patches-4.4/0096-net-next-mediatek-add-support-for-IRQ-grouping.patch @@ -15,8 +15,6 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.h | 15 ++- 2 files changed, 111 insertions(+), 60 deletions(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index c869064..718cbb2 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -905,14 +905,13 @@ release_desc: @@ -36,7 +34,7 @@ index c869064..718cbb2 100644 u32 cpu, dma; static int condition; int i; -@@ -964,63 +963,82 @@ static int mtk_poll_tx(struct mtk_eth *eth, int budget, bool *tx_again) +@@ -964,63 +963,82 @@ static int mtk_poll_tx(struct mtk_eth *e netdev_completed_queue(eth->netdev[i], done, bytes); } @@ -94,23 +92,29 @@ index c869064..718cbb2 100644 + mtk_handle_status_irq(eth); + mtk_w32(eth, MTK_TX_DONE_INT, MTK_QMTK_INT_STATUS); + tx_done = mtk_poll_tx(eth, budget); -+ -+ if (unlikely(netif_msg_intr(eth))) { + + if (unlikely(netif_msg_intr(eth))) { + status = mtk_r32(eth, MTK_QMTK_INT_STATUS); -+ mask = mtk_r32(eth, MTK_QDMA_INT_MASK); + mask = mtk_r32(eth, MTK_QDMA_INT_MASK); +- netdev_info(eth->netdev[0], +- "done tx %d, rx %d, intr 0x%08x/0x%x\n", +- tx_done, rx_done, status, mask); + dev_info(eth->dev, + "done tx %d, intr 0x%08x/0x%x\n", + tx_done, status, mask); -+ } -+ + } + +- if (tx_again || rx_done == budget) + if (tx_done == budget) -+ return budget; -+ -+ status = mtk_r32(eth, MTK_QMTK_INT_STATUS); + return budget; + + status = mtk_r32(eth, MTK_QMTK_INT_STATUS); +- if (status & (tx_intr | rx_intr)) + if (status & MTK_TX_DONE_INT) -+ return budget; -+ -+ napi_complete(napi); + return budget; + + napi_complete(napi); +- mtk_irq_enable(eth, MTK_RX_DONE_INT | MTK_RX_DONE_INT); + mtk_irq_enable(eth, MTK_TX_DONE_INT); + + return tx_done; @@ -125,34 +129,28 @@ index c869064..718cbb2 100644 + mtk_handle_status_irq(eth); + mtk_w32(eth, MTK_RX_DONE_INT, MTK_QMTK_INT_STATUS); + rx_done = mtk_poll_rx(napi, budget, eth); - - if (unlikely(netif_msg_intr(eth))) { ++ ++ if (unlikely(netif_msg_intr(eth))) { + status = mtk_r32(eth, MTK_QMTK_INT_STATUS); - mask = mtk_r32(eth, MTK_QDMA_INT_MASK); -- netdev_info(eth->netdev[0], -- "done tx %d, rx %d, intr 0x%08x/0x%x\n", -- tx_done, rx_done, status, mask); ++ mask = mtk_r32(eth, MTK_QDMA_INT_MASK); + dev_info(eth->dev, + "done rx %d, intr 0x%08x/0x%x\n", + rx_done, status, mask); - } - -- if (tx_again || rx_done == budget) ++ } ++ + if (rx_done == budget) - return budget; - - status = mtk_r32(eth, MTK_QMTK_INT_STATUS); -- if (status & (tx_intr | rx_intr)) ++ return budget; ++ ++ status = mtk_r32(eth, MTK_QMTK_INT_STATUS); + if (status & MTK_RX_DONE_INT) - return budget; - - napi_complete(napi); -- mtk_irq_enable(eth, MTK_RX_DONE_INT | MTK_RX_DONE_INT); ++ return budget; ++ ++ napi_complete(napi); + mtk_irq_enable(eth, MTK_RX_DONE_INT); return rx_done; } -@@ -1256,22 +1274,26 @@ static void mtk_tx_timeout(struct net_device *dev) +@@ -1256,22 +1274,26 @@ static void mtk_tx_timeout(struct net_de schedule_work(ð->pending_work); } @@ -190,7 +188,7 @@ index c869064..718cbb2 100644 return IRQ_HANDLED; } -@@ -1284,7 +1306,7 @@ static void mtk_poll_controller(struct net_device *dev) +@@ -1284,7 +1306,7 @@ static void mtk_poll_controller(struct n u32 int_mask = MTK_TX_DONE_INT | MTK_RX_DONE_INT; mtk_irq_disable(eth, int_mask); @@ -199,7 +197,7 @@ index c869064..718cbb2 100644 mtk_irq_enable(eth, int_mask); } #endif -@@ -1320,6 +1342,7 @@ static int mtk_open(struct net_device *dev) +@@ -1320,6 +1342,7 @@ static int mtk_open(struct net_device *d if (err) return err; @@ -207,7 +205,7 @@ index c869064..718cbb2 100644 napi_enable(ð->rx_napi); mtk_irq_enable(eth, MTK_TX_DONE_INT | MTK_RX_DONE_INT); } -@@ -1368,6 +1391,7 @@ static int mtk_stop(struct net_device *dev) +@@ -1368,6 +1391,7 @@ static int mtk_stop(struct net_device *d return 0; mtk_irq_disable(eth, MTK_TX_DONE_INT | MTK_RX_DONE_INT); @@ -215,7 +213,7 @@ index c869064..718cbb2 100644 napi_disable(ð->rx_napi); mtk_stop_dma(eth, MTK_QDMA_GLO_CFG); -@@ -1405,7 +1429,11 @@ static int __init mtk_hw_init(struct mtk_eth *eth) +@@ -1405,7 +1429,11 @@ static int __init mtk_hw_init(struct mtk /* Enable RX VLan Offloading */ mtk_w32(eth, 1, MTK_CDMP_EG_CTRL); @@ -228,7 +226,7 @@ index c869064..718cbb2 100644 dev_name(eth->dev), eth); if (err) return err; -@@ -1421,7 +1449,11 @@ static int __init mtk_hw_init(struct mtk_eth *eth) +@@ -1421,7 +1449,11 @@ static int __init mtk_hw_init(struct mtk mtk_w32(eth, 0, MTK_RST_GL); /* FE int grouping */ @@ -241,7 +239,7 @@ index c869064..718cbb2 100644 for (i = 0; i < 2; i++) { u32 val = mtk_r32(eth, MTK_GDMA_FWD_CFG(i)); -@@ -1469,7 +1501,9 @@ static void mtk_uninit(struct net_device *dev) +@@ -1469,7 +1501,9 @@ static void mtk_uninit(struct net_device phy_disconnect(mac->phy_dev); mtk_mdio_cleanup(eth); mtk_irq_disable(eth, ~0); @@ -252,7 +250,7 @@ index c869064..718cbb2 100644 } static int mtk_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) -@@ -1744,10 +1778,10 @@ static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) +@@ -1744,10 +1778,10 @@ static int mtk_add_mac(struct mtk_eth *e dev_err(eth->dev, "error bringing up device\n"); goto free_netdev; } @@ -265,7 +263,7 @@ index c869064..718cbb2 100644 return 0; -@@ -1764,6 +1798,7 @@ static int mtk_probe(struct platform_device *pdev) +@@ -1764,6 +1798,7 @@ static int mtk_probe(struct platform_dev struct mtk_soc_data *soc; struct mtk_eth *eth; int err; @@ -273,7 +271,7 @@ index c869064..718cbb2 100644 match = of_match_device(of_mtk_match, &pdev->dev); soc = (struct mtk_soc_data *)match->data; -@@ -1799,10 +1834,12 @@ static int mtk_probe(struct platform_device *pdev) +@@ -1799,10 +1834,12 @@ static int mtk_probe(struct platform_dev return PTR_ERR(eth->rstc); } @@ -290,7 +288,7 @@ index c869064..718cbb2 100644 } eth->clk_ethif = devm_clk_get(&pdev->dev, "ethif"); -@@ -1843,7 +1880,9 @@ static int mtk_probe(struct platform_device *pdev) +@@ -1843,7 +1880,9 @@ static int mtk_probe(struct platform_dev * for NAPI to work */ init_dummy_netdev(ð->dummy_dev); @@ -301,7 +299,7 @@ index c869064..718cbb2 100644 MTK_NAPI_WEIGHT); platform_set_drvdata(pdev, eth); -@@ -1864,6 +1903,7 @@ static int mtk_remove(struct platform_device *pdev) +@@ -1864,6 +1903,7 @@ static int mtk_remove(struct platform_de clk_disable_unprepare(eth->clk_gp1); clk_disable_unprepare(eth->clk_gp2); @@ -309,8 +307,6 @@ index c869064..718cbb2 100644 netif_napi_del(ð->rx_napi); mtk_cleanup(eth); platform_set_drvdata(pdev, NULL); -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h -index 3159d2a..f82e3ac 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h @@ -68,6 +68,10 @@ @@ -363,6 +359,3 @@ index 3159d2a..f82e3ac 100644 struct napi_struct rx_napi; struct mtk_tx_dma *scratch_ring; dma_addr_t phy_scratch_ring; --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0097-net-next-mediatek-change-my-email-address.patch b/target/linux/mediatek/patches-4.4/0097-net-next-mediatek-change-my-email-address.patch index 612fccbaaa..2646018976 100644 --- a/target/linux/mediatek/patches-4.4/0097-net-next-mediatek-change-my-email-address.patch +++ b/target/linux/mediatek/patches-4.4/0097-net-next-mediatek-change-my-email-address.patch @@ -10,8 +10,6 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index 718cbb2..bced659 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -7,7 +7,7 @@ @@ -23,13 +21,10 @@ index 718cbb2..bced659 100644 * Copyright (C) 2009-2016 Felix Fietkau * Copyright (C) 2013-2016 Michael Lee */ -@@ -1929,5 +1929,5 @@ static struct platform_driver mtk_driver = { +@@ -1929,5 +1929,5 @@ static struct platform_driver mtk_driver module_platform_driver(mtk_driver); MODULE_LICENSE("GPL"); -MODULE_AUTHOR("John Crispin "); +MODULE_AUTHOR("John Crispin "); MODULE_DESCRIPTION("Ethernet driver for MediaTek SoC"); --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0098-net-next-mediatek-only-trigger-the-tx-watchdog-reset.patch b/target/linux/mediatek/patches-4.4/0098-net-next-mediatek-only-trigger-the-tx-watchdog-reset.patch index bbcbc67937..cc18be53b4 100644 --- a/target/linux/mediatek/patches-4.4/0098-net-next-mediatek-only-trigger-the-tx-watchdog-reset.patch +++ b/target/linux/mediatek/patches-4.4/0098-net-next-mediatek-only-trigger-the-tx-watchdog-reset.patch @@ -11,11 +11,9 @@ Signed-off-by: John Crispin drivers/net/ethernet/mediatek/mtk_eth_soc.h | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index bced659..70e961c 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1267,11 +1267,21 @@ static void mtk_tx_timeout(struct net_device *dev) +@@ -1267,11 +1267,21 @@ static void mtk_tx_timeout(struct net_de { struct mtk_mac *mac = netdev_priv(dev); struct mtk_eth *eth = mac->hw; @@ -38,7 +36,7 @@ index bced659..70e961c 100644 } static irqreturn_t mtk_handle_irq_rx(int irq, void *_eth) -@@ -1765,7 +1775,7 @@ static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) +@@ -1765,7 +1775,7 @@ static int mtk_add_mac(struct mtk_eth *e mac->hw_stats->reg_offset = id * MTK_STAT_OFFSET; SET_NETDEV_DEV(eth->netdev[id], eth->dev); @@ -47,8 +45,6 @@ index bced659..70e961c 100644 eth->netdev[id]->netdev_ops = &mtk_netdev_ops; eth->netdev[id]->base_addr = (unsigned long)eth->base; eth->netdev[id]->vlan_features = MTK_HW_FEATURES & -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h -index f82e3ac..e39da72 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h @@ -15,6 +15,7 @@ @@ -59,6 +55,3 @@ index f82e3ac..e39da72 100644 #define MTK_QDMA_PAGE_SIZE 2048 #define MTK_MAX_RX_LENGTH 1536 #define MTK_TX_DMA_BUF_LEN 0x3fff --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0099-MAINTAINERS-change-my-email-address.patch b/target/linux/mediatek/patches-4.4/0099-MAINTAINERS-change-my-email-address.patch index abe7f5b7da..b23a55aa43 100644 --- a/target/linux/mediatek/patches-4.4/0099-MAINTAINERS-change-my-email-address.patch +++ b/target/linux/mediatek/patches-4.4/0099-MAINTAINERS-change-my-email-address.patch @@ -10,11 +10,9 @@ Signed-off-by: John Crispin MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/MAINTAINERS b/MAINTAINERS -index 73f0592..c044320 100644 --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -6904,7 +6904,7 @@ F: include/uapi/linux/uvcvideo.h +@@ -6909,7 +6909,7 @@ F: include/uapi/linux/uvcvideo.h MEDIATEK ETHERNET DRIVER M: Felix Fietkau @@ -23,6 +21,3 @@ index 73f0592..c044320 100644 L: netdev@vger.kernel.org S: Maintained F: drivers/net/ethernet/mediatek/ --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0100-MAINTAINERS-add-Sean-as-mediatek-ethernet-maintainer.patch b/target/linux/mediatek/patches-4.4/0100-MAINTAINERS-add-Sean-as-mediatek-ethernet-maintainer.patch index d4c0b7140c..9577060575 100644 --- a/target/linux/mediatek/patches-4.4/0100-MAINTAINERS-add-Sean-as-mediatek-ethernet-maintainer.patch +++ b/target/linux/mediatek/patches-4.4/0100-MAINTAINERS-add-Sean-as-mediatek-ethernet-maintainer.patch @@ -13,11 +13,9 @@ Signed-off-by: John Crispin MAINTAINERS | 1 + 1 file changed, 1 insertion(+) -diff --git a/MAINTAINERS b/MAINTAINERS -index c044320..6262e05 100644 --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -6905,6 +6905,7 @@ F: include/uapi/linux/uvcvideo.h +@@ -6910,6 +6910,7 @@ F: include/uapi/linux/uvcvideo.h MEDIATEK ETHERNET DRIVER M: Felix Fietkau M: John Crispin @@ -25,6 +23,3 @@ index c044320..6262e05 100644 L: netdev@vger.kernel.org S: Maintained F: drivers/net/ethernet/mediatek/ --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0101-net-mediatek-add-gsw-mt7530-driver.patch b/target/linux/mediatek/patches-4.4/0101-net-mediatek-add-gsw-mt7530-driver.patch index 79b5f90862..fb13f9e5ef 100644 --- a/target/linux/mediatek/patches-4.4/0101-net-mediatek-add-gsw-mt7530-driver.patch +++ b/target/linux/mediatek/patches-4.4/0101-net-mediatek-add-gsw-mt7530-driver.patch @@ -18,8 +18,6 @@ Signed-off-by: John Crispin create mode 100644 drivers/net/ethernet/mediatek/mt7530.c create mode 100644 drivers/net/ethernet/mediatek/mt7530.h -diff --git a/drivers/net/ethernet/mediatek/Makefile b/drivers/net/ethernet/mediatek/Makefile -index aa3f1c8..82001c4 100644 --- a/drivers/net/ethernet/mediatek/Makefile +++ b/drivers/net/ethernet/mediatek/Makefile @@ -2,4 +2,4 @@ @@ -28,9 +26,6 @@ index aa3f1c8..82001c4 100644 -obj-$(CONFIG_NET_MEDIATEK_SOC) += mtk_eth_soc.o +obj-$(CONFIG_NET_MEDIATEK_SOC) += mt7530.o gsw_mt7623.o mtk_eth_soc.o -diff --git a/drivers/net/ethernet/mediatek/gsw_mt7620.h b/drivers/net/ethernet/mediatek/gsw_mt7620.h -new file mode 100644 -index 0000000..6fca8f2 --- /dev/null +++ b/drivers/net/ethernet/mediatek/gsw_mt7620.h @@ -0,0 +1,251 @@ @@ -285,9 +280,6 @@ index 0000000..6fca8f2 +void mt7620_handle_carrier(struct mtk_eth *eth); + +#endif -diff --git a/drivers/net/ethernet/mediatek/gsw_mt7623.c b/drivers/net/ethernet/mediatek/gsw_mt7623.c -new file mode 100644 -index 0000000..0c6b8a6 --- /dev/null +++ b/drivers/net/ethernet/mediatek/gsw_mt7623.c @@ -0,0 +1,1084 @@ @@ -1375,9 +1367,6 @@ index 0000000..0c6b8a6 +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("John Crispin "); +MODULE_DESCRIPTION("GBit switch driver for Mediatek MT7623 SoC"); -diff --git a/drivers/net/ethernet/mediatek/mt7530.c b/drivers/net/ethernet/mediatek/mt7530.c -new file mode 100644 -index 0000000..2e9d280 --- /dev/null +++ b/drivers/net/ethernet/mediatek/mt7530.c @@ -0,0 +1,808 @@ @@ -2189,9 +2178,6 @@ index 0000000..2e9d280 + + return 0; +} -diff --git a/drivers/net/ethernet/mediatek/mt7530.h b/drivers/net/ethernet/mediatek/mt7530.h -new file mode 100644 -index 0000000..1fc8c62 --- /dev/null +++ b/drivers/net/ethernet/mediatek/mt7530.h @@ -0,0 +1,20 @@ @@ -2215,8 +2201,6 @@ index 0000000..1fc8c62 +int mt7530_probe(struct device *dev, void __iomem *base, struct mii_bus *bus, int vlan); + +#endif -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index 70e961c..7788ba6 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -24,6 +24,9 @@ @@ -2229,7 +2213,7 @@ index 70e961c..7788ba6 100644 static int mtk_msg_level = -1; module_param_named(msg_level, mtk_msg_level, int, 0); MODULE_PARM_DESC(msg_level, "Message level (-1=defaults,0=none,...,16=all)"); -@@ -69,7 +72,7 @@ static int mtk_mdio_busy_wait(struct mtk_eth *eth) +@@ -69,7 +72,7 @@ static int mtk_mdio_busy_wait(struct mtk return 0; if (time_after(jiffies, t_start + PHY_IAC_TIMEOUT)) break; @@ -2238,7 +2222,7 @@ index 70e961c..7788ba6 100644 } dev_err(eth->dev, "mdio: MDIO timeout\n"); -@@ -1421,15 +1424,6 @@ static int __init mtk_hw_init(struct mtk_eth *eth) +@@ -1421,15 +1424,6 @@ static int __init mtk_hw_init(struct mtk reset_control_deassert(eth->rstc); usleep_range(10, 20); @@ -2254,7 +2238,7 @@ index 70e961c..7788ba6 100644 /* GE1, Force 1000M/FD, FC ON */ mtk_w32(eth, MAC_MCR_FIXED_LINK, MTK_MAC_MCR(0)); -@@ -1452,6 +1446,8 @@ static int __init mtk_hw_init(struct mtk_eth *eth) +@@ -1452,6 +1446,8 @@ static int __init mtk_hw_init(struct mtk if (err) return err; @@ -2263,7 +2247,7 @@ index 70e961c..7788ba6 100644 /* disable delay and normal interrupt */ mtk_w32(eth, 0, MTK_QDMA_DELAY_INT); mtk_irq_disable(eth, ~0); -@@ -1479,6 +1475,8 @@ static int __init mtk_hw_init(struct mtk_eth *eth) +@@ -1479,6 +1475,8 @@ static int __init mtk_hw_init(struct mtk mtk_w32(eth, val, MTK_GDMA_FWD_CFG(i)); } @@ -2272,7 +2256,7 @@ index 70e961c..7788ba6 100644 return 0; } -@@ -1734,7 +1732,7 @@ static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) +@@ -1734,7 +1732,7 @@ static int mtk_add_mac(struct mtk_eth *e { struct mtk_mac *mac; const __be32 *_id = of_get_property(np, "reg", NULL); @@ -2281,7 +2265,7 @@ index 70e961c..7788ba6 100644 if (!_id) { dev_err(eth->dev, "missing mac id\n"); -@@ -1768,8 +1766,8 @@ static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) +@@ -1768,8 +1766,8 @@ static int mtk_add_mac(struct mtk_eth *e GFP_KERNEL); if (!mac->hw_stats) { dev_err(eth->dev, "failed to allocate counter memory\n"); @@ -2292,7 +2276,7 @@ index 70e961c..7788ba6 100644 } spin_lock_init(&mac->hw_stats->stats_lock); mac->hw_stats->reg_offset = id * MTK_STAT_OFFSET; -@@ -1783,21 +1781,9 @@ static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) +@@ -1783,21 +1781,9 @@ static int mtk_add_mac(struct mtk_eth *e eth->netdev[id]->features |= MTK_HW_FEATURES; eth->netdev[id]->ethtool_ops = &mtk_ethtool_ops; @@ -2314,7 +2298,7 @@ index 70e961c..7788ba6 100644 } static int mtk_probe(struct platform_device *pdev) -@@ -1865,14 +1851,13 @@ static int mtk_probe(struct platform_device *pdev) +@@ -1865,14 +1851,13 @@ static int mtk_probe(struct platform_dev clk_prepare_enable(eth->clk_gp1); clk_prepare_enable(eth->clk_gp2); @@ -2332,7 +2316,7 @@ index 70e961c..7788ba6 100644 for_each_child_of_node(pdev->dev.of_node, mac_np) { if (!of_device_is_compatible(mac_np, "mediatek,eth-mac")) -@@ -1886,6 +1871,22 @@ static int mtk_probe(struct platform_device *pdev) +@@ -1886,6 +1871,22 @@ static int mtk_probe(struct platform_dev goto err_free_dev; } @@ -2355,8 +2339,6 @@ index 70e961c..7788ba6 100644 /* we run 2 devices on the same DMA ring so we need a dummy device * for NAPI to work */ -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h -index e39da72..75692cc 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h @@ -407,6 +407,9 @@ struct mtk_eth { @@ -2369,13 +2351,10 @@ index e39da72..75692cc 100644 }; /* struct mtk_mac - the structure that holds the info about the MACs of the -@@ -434,4 +437,6 @@ void mtk_stats_update_mac(struct mtk_mac *mac); +@@ -434,4 +437,6 @@ void mtk_stats_update_mac(struct mtk_mac void mtk_w32(struct mtk_eth *eth, u32 val, unsigned reg); u32 mtk_r32(struct mtk_eth *eth, unsigned reg); +int mt7623_gsw_config(struct mtk_eth *eth); + #endif /* MTK_ETH_H */ --- -1.7.10.4 - diff --git a/target/linux/mediatek/patches-4.4/0102-net-mediatek-v4.4-backports.patch b/target/linux/mediatek/patches-4.4/0102-net-mediatek-v4.4-backports.patch index a6b423e6f8..3561b4020c 100644 --- a/target/linux/mediatek/patches-4.4/0102-net-mediatek-v4.4-backports.patch +++ b/target/linux/mediatek/patches-4.4/0102-net-mediatek-v4.4-backports.patch @@ -7,11 +7,9 @@ Subject: [PATCH 102/102] net: mediatek: v4.4 backports drivers/net/ethernet/mediatek/mtk_eth_soc.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index 7788ba6..22caad3 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -217,7 +217,7 @@ static int mtk_phy_connect_node(struct mtk_eth *eth, struct mtk_mac *mac, +@@ -217,7 +217,7 @@ static int mtk_phy_connect_node(struct m dev_info(eth->dev, "connected mac %d to PHY at %s [uid=%08x, driver=%s]\n", @@ -20,7 +18,7 @@ index 7788ba6..22caad3 100644 phydev->drv->name); mac->phy_dev = phydev; -@@ -1396,6 +1396,7 @@ static int mtk_stop(struct net_device *dev) +@@ -1396,6 +1396,7 @@ static int mtk_stop(struct net_device *d struct mtk_mac *mac = netdev_priv(dev); struct mtk_eth *eth = mac->hw; @@ -28,7 +26,7 @@ index 7788ba6..22caad3 100644 netif_tx_disable(dev); phy_stop(mac->phy_dev); -@@ -1595,11 +1596,13 @@ static int mtk_set_settings(struct net_device *dev, +@@ -1595,11 +1596,13 @@ static int mtk_set_settings(struct net_d { struct mtk_mac *mac = netdev_priv(dev); @@ -46,6 +44,3 @@ index 7788ba6..22caad3 100644 } return phy_ethtool_sset(mac->phy_dev, cmd); --- -1.7.10.4 - diff --git a/target/linux/oxnas/patches-4.4/320-oxnas-irqchip.patch b/target/linux/oxnas/patches-4.4/320-oxnas-irqchip.patch index 62224b63b1..37918d680b 100644 --- a/target/linux/oxnas/patches-4.4/320-oxnas-irqchip.patch +++ b/target/linux/oxnas/patches-4.4/320-oxnas-irqchip.patch @@ -24,7 +24,7 @@ obj-$(CONFIG_ARCH_VT8500) += irq-vt8500.o --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c -@@ -1245,6 +1245,7 @@ IRQCHIP_DECLARE(arm1176jzf_dc_gic, "arm, +@@ -1253,6 +1253,7 @@ IRQCHIP_DECLARE(arm1176jzf_dc_gic, "arm, IRQCHIP_DECLARE(cortex_a15_gic, "arm,cortex-a15-gic", gic_of_init); IRQCHIP_DECLARE(cortex_a9_gic, "arm,cortex-a9-gic", gic_of_init); IRQCHIP_DECLARE(cortex_a7_gic, "arm,cortex-a7-gic", gic_of_init); diff --git a/target/linux/ramips/patches-4.4/0054-mtd-add-chunked-read-io-to-m25p80.patch b/target/linux/ramips/patches-4.4/0054-mtd-add-chunked-read-io-to-m25p80.patch index 5962e0e668..281dd5eaa4 100644 --- a/target/linux/ramips/patches-4.4/0054-mtd-add-chunked-read-io-to-m25p80.patch +++ b/target/linux/ramips/patches-4.4/0054-mtd-add-chunked-read-io-to-m25p80.patch @@ -1,6 +1,6 @@ --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1008,6 +1008,66 @@ write_err: +@@ -1009,6 +1009,66 @@ write_err: return ret; } @@ -67,7 +67,7 @@ static int macronix_quad_enable(struct spi_nor *nor) { int ret, val; -@@ -1186,10 +1246,12 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -1187,10 +1247,12 @@ int spi_nor_scan(struct spi_nor *nor, co } /* sst nor chips use AAI word program */ @@ -82,7 +82,7 @@ if (info->flags & USE_FSR) nor->flags |= SNOR_F_USE_FSR; -@@ -1217,11 +1279,20 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -1218,11 +1280,20 @@ int spi_nor_scan(struct spi_nor *nor, co mtd->writebufsize = nor->page_size; if (np) {