From 3d4fb9ced30fbc6b03af2b02809fc034d96aff29 Mon Sep 17 00:00:00 2001 From: Alexandros Couloumbis Date: Fri, 29 May 2020 13:10:04 +0300 Subject: [PATCH] linux/adm5120: refresh linux-4.14 patches --- target/linux/adm5120/config-4.14 | 12 +- .../arch/mips/adm5120/common/platform.c | 2 +- .../adm5120/patches-4.14/001-adm5120.patch | 8 +- .../patches-4.14/002-adm5120_flash.patch | 4 +- .../patches-4.14/003-adm5120_switch.patch | 6 +- .../patches-4.14/005-adm5120_usb.patch | 8 +- .../patches-4.14/007-adm5120_pci.patch | 4 +- .../101-cfi_fixup_macronix_bootloc.patch | 6 +- .../patches-4.14/310-adm5120_wdt.patch | 4 +- .../patches-4.14/312-adm5120_nand.patch | 4 +- .../patches-4.14/313-adm5120sw-4_9.patch | 4 +- ...-to-use-platform-specific-chip-fixup.patch | 10 +- .../500-yaffs-Kbuild-integration.patch | 4 +- .../502-yaffs-fix-compat-tags-handling.patch | 10 +- ...3-yaffs-add-tags-9bytes-mount-option.patch | 18 +- .../patches-4.14/600-4_14-irq_map-fixup.patch | 33 ++++ .../patches-4.14/700-irq_upd_napi_poll.patch | 51 ++++++ .../710-gfp_atomic_to_kernel.patch | 20 +++ .../patches-4.14/720-napi_complete_done.patch | 20 +++ .../730-struct_device_DMA_API.patch | 163 ++++++++++++++++++ 20 files changed, 340 insertions(+), 51 deletions(-) create mode 100644 target/linux/adm5120/patches-4.14/600-4_14-irq_map-fixup.patch create mode 100644 target/linux/adm5120/patches-4.14/700-irq_upd_napi_poll.patch create mode 100644 target/linux/adm5120/patches-4.14/710-gfp_atomic_to_kernel.patch create mode 100644 target/linux/adm5120/patches-4.14/720-napi_complete_done.patch create mode 100644 target/linux/adm5120/patches-4.14/730-struct_device_DMA_API.patch diff --git a/target/linux/adm5120/config-4.14 b/target/linux/adm5120/config-4.14 index a1f9734503..a76d3fe99a 100644 --- a/target/linux/adm5120/config-4.14 +++ b/target/linux/adm5120/config-4.14 @@ -31,7 +31,6 @@ CONFIG_ADM5120_OEM_MIKROTIK=y # CONFIG_ADM5120_OEM_OSBRIDGE is not set # CONFIG_ADM5120_OEM_ZYXEL is not set CONFIG_ADM5120_SOC_BGA=y -# CONFIG_AIO is not set # CONFIG_ALLOW_DEV_COREDUMP is not set CONFIG_ARCH_BINFMT_ELF_STATE=y CONFIG_ARCH_CLOCKSOURCE_DATA=y @@ -59,6 +58,7 @@ CONFIG_ARM_AMBA=y # CONFIG_BLK_DEV_INITRD is not set CONFIG_BLK_MQ_PCI=y # CONFIG_BPF_JIT is not set +# CONFIG_BPF_SYSCALL is not set # CONFIG_BRIDGE is not set # CONFIG_BUG is not set CONFIG_CEVT_R4K=y @@ -177,15 +177,16 @@ CONFIG_IRQ_FORCED_THREADING=y CONFIG_IRQ_MIPS_CPU=y CONFIG_IRQ_WORK=y # CONFIG_ISDN is not set +CONFIG_JUMP_LABEL=y # CONFIG_LBDAF is not set # CONFIG_LDISC_AUTOLOAD is not set CONFIG_LIB80211=m -CONFIG_LIB80211_CRYPT_CCMP=m -CONFIG_LIB80211_CRYPT_TKIP=m -CONFIG_LIB80211_CRYPT_WEP=m CONFIG_LOG_BUF_SHIFT=15 +CONFIG_LZO_DECOMPRESS=y # CONFIG_MDIO_BUS is not set # CONFIG_MEMBARRIER is not set +CONFIG_MIKROTIK=y +# CONFIG_MIKROTIK_RB_SYSFS is not set CONFIG_MIPS=y CONFIG_MIPS_ASID_BITS=8 CONFIG_MIPS_ASID_SHIFT=0 @@ -205,6 +206,7 @@ CONFIG_MTD_JEDECPROBE=y CONFIG_MTD_NAND=y CONFIG_MTD_NAND_ECC=y CONFIG_MTD_PHYSMAP=y +# CONFIG_MTD_SPLIT_BCM_WFI_FW is not set CONFIG_MTD_SPLIT_FIRMWARE=y CONFIG_MTD_SPLIT_LZMA_FW=y # CONFIG_MTD_SPLIT_SQUASHFS_ROOT is not set @@ -275,9 +277,9 @@ CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y CONFIG_PANIC_ON_OOPS_VALUE=0 # CONFIG_PARTITION_ADVANCED is not set CONFIG_PCI=y +CONFIG_PCI_DISABLE_COMMON_QUIRKS=y CONFIG_PCI_DOMAINS=y CONFIG_PCI_DRIVERS_LEGACY=y -# CONFIG_PCI_QUIRKS is not set CONFIG_PERF_USE_VMALLOC=y CONFIG_PGTABLE_LEVELS=2 # CONFIG_RCU_NEED_SEGCBLIST is not set diff --git a/target/linux/adm5120/files-4.14/arch/mips/adm5120/common/platform.c b/target/linux/adm5120/files-4.14/arch/mips/adm5120/common/platform.c index bdbfbcbae5..b622a2aeb7 100644 --- a/target/linux/adm5120/files-4.14/arch/mips/adm5120/common/platform.c +++ b/target/linux/adm5120/files-4.14/arch/mips/adm5120/common/platform.c @@ -47,7 +47,7 @@ unsigned char adm5120_eth_macs[6][6] = { EXPORT_SYMBOL_GPL(adm5120_eth_macs); unsigned char adm5120_eth_vlans[6] = { - 0x41, 0x42, 0x44, 0x48, 0x50, 0x60 + 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00 }; EXPORT_SYMBOL_GPL(adm5120_eth_vlans); #endif diff --git a/target/linux/adm5120/patches-4.14/001-adm5120.patch b/target/linux/adm5120/patches-4.14/001-adm5120.patch index 1306eefd13..b211b894f4 100644 --- a/target/linux/adm5120/patches-4.14/001-adm5120.patch +++ b/target/linux/adm5120/patches-4.14/001-adm5120.patch @@ -1,8 +1,8 @@ --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -71,6 +71,24 @@ choice - prompt "System type" - default SGI_IP22 +@@ -134,6 +134,24 @@ config MIPS_GENERIC + using the boot protocol defined in the UHI (Unified Hosting + Interface) specification. +config ADM5120 + bool "Infineon/ADMtek ADM5120 SoC based machines" @@ -25,7 +25,7 @@ config MIPS_ALCHEMY bool "Alchemy processor based machines" select ARCH_PHYS_ADDR_T_64BIT -@@ -971,6 +989,7 @@ config MIPS_PARAVIRT +@@ -1015,6 +1033,7 @@ config MIPS_PARAVIRT endchoice diff --git a/target/linux/adm5120/patches-4.14/002-adm5120_flash.patch b/target/linux/adm5120/patches-4.14/002-adm5120_flash.patch index 8936af13e2..b0b6d523fd 100644 --- a/target/linux/adm5120/patches-4.14/002-adm5120_flash.patch +++ b/target/linux/adm5120/patches-4.14/002-adm5120_flash.patch @@ -1,6 +1,6 @@ --- a/drivers/mtd/maps/Kconfig +++ b/drivers/mtd/maps/Kconfig -@@ -399,4 +399,8 @@ config MTD_LATCH_ADDR +@@ -419,4 +419,8 @@ config MTD_LATCH_ADDR If compiled as a module, it will be called latch-addr-flash. @@ -11,7 +11,7 @@ endmenu --- a/drivers/mtd/maps/Makefile +++ b/drivers/mtd/maps/Makefile -@@ -30,6 +30,7 @@ obj-$(CONFIG_MTD_SUN_UFLASH) += sun_ufla +@@ -35,6 +35,7 @@ obj-$(CONFIG_MTD_SUN_UFLASH) += sun_ufla obj-$(CONFIG_MTD_SCx200_DOCFLASH)+= scx200_docflash.o obj-$(CONFIG_MTD_SOLUTIONENGINE)+= solutionengine.o obj-$(CONFIG_MTD_PCI) += pci.o diff --git a/target/linux/adm5120/patches-4.14/003-adm5120_switch.patch b/target/linux/adm5120/patches-4.14/003-adm5120_switch.patch index b1a32bf2a8..1ca85bc9c0 100644 --- a/target/linux/adm5120/patches-4.14/003-adm5120_switch.patch +++ b/target/linux/adm5120/patches-4.14/003-adm5120_switch.patch @@ -1,6 +1,6 @@ --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig -@@ -321,6 +321,10 @@ source "drivers/net/dsa/Kconfig" +@@ -378,6 +378,10 @@ source "drivers/net/dsa/Kconfig" source "drivers/net/ethernet/Kconfig" @@ -13,9 +13,9 @@ source "drivers/net/hippi/Kconfig" --- a/drivers/net/Makefile +++ b/drivers/net/Makefile -@@ -37,6 +37,7 @@ obj-$(CONFIG_CAN) += can/ +@@ -43,6 +43,7 @@ obj-$(CONFIG_CAN) += can/ obj-$(CONFIG_ETRAX_ETHERNET) += cris/ - obj-$(CONFIG_NET_DSA) += dsa/ + obj-y += dsa/ obj-$(CONFIG_ETHERNET) += ethernet/ +obj-$(CONFIG_ADM5120_ENET) += adm5120sw.o obj-$(CONFIG_FDDI) += fddi/ diff --git a/target/linux/adm5120/patches-4.14/005-adm5120_usb.patch b/target/linux/adm5120/patches-4.14/005-adm5120_usb.patch index 28410747ea..bf13d05580 100644 --- a/target/linux/adm5120/patches-4.14/005-adm5120_usb.patch +++ b/target/linux/adm5120/patches-4.14/005-adm5120_usb.patch @@ -20,12 +20,12 @@ + config USB_C67X00_HCD tristate "Cypress C67x00 HCD support" - help + depends on HAS_IOMEM --- a/drivers/usb/host/Makefile +++ b/drivers/usb/host/Makefile -@@ -28,6 +28,7 @@ ifneq ($(CONFIG_USB), ) - obj-$(CONFIG_PCI) += pci-quirks.o - endif +@@ -30,6 +30,7 @@ obj-$(CONFIG_USB_WHCI_HCD) += whci/ + + obj-$(CONFIG_USB_PCI) += pci-quirks.o +obj-$(CONFIG_USB_ADM5120_HCD) += adm5120-hcd.o obj-$(CONFIG_USB_EHCI_HCD) += ehci-hcd.o diff --git a/target/linux/adm5120/patches-4.14/007-adm5120_pci.patch b/target/linux/adm5120/patches-4.14/007-adm5120_pci.patch index 6b151182b8..1b486a539d 100644 --- a/target/linux/adm5120/patches-4.14/007-adm5120_pci.patch +++ b/target/linux/adm5120/patches-4.14/007-adm5120_pci.patch @@ -1,6 +1,6 @@ --- a/arch/mips/pci/Makefile +++ b/arch/mips/pci/Makefile -@@ -18,6 +18,7 @@ obj-$(CONFIG_PCI_TX4927) += ops-tx4927.o +@@ -21,6 +21,7 @@ obj-$(CONFIG_PCI_TX4927) += ops-tx4927.o obj-$(CONFIG_BCM47XX) += pci-bcm47xx.o obj-$(CONFIG_BCM63XX) += pci-bcm63xx.o fixup-bcm63xx.o \ ops-bcm63xx.o @@ -10,7 +10,7 @@ obj-$(CONFIG_SOC_AR71XX) += pci-ar71xx.o --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h -@@ -1824,6 +1824,9 @@ +@@ -1833,6 +1833,9 @@ #define PCI_VENDOR_ID_CB 0x1307 /* Measurement Computing */ diff --git a/target/linux/adm5120/patches-4.14/101-cfi_fixup_macronix_bootloc.patch b/target/linux/adm5120/patches-4.14/101-cfi_fixup_macronix_bootloc.patch index 92937fce14..85d7b344ce 100644 --- a/target/linux/adm5120/patches-4.14/101-cfi_fixup_macronix_bootloc.patch +++ b/target/linux/adm5120/patches-4.14/101-cfi_fixup_macronix_bootloc.patch @@ -13,7 +13,7 @@ static int cfi_amdstd_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *); static int cfi_amdstd_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); static int cfi_amdstd_write_buffers(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); -@@ -374,6 +380,41 @@ static struct cfi_fixup cfi_nopri_fixup_ +@@ -378,6 +384,41 @@ static struct cfi_fixup cfi_nopri_fixup_ { 0, 0, NULL } }; @@ -55,7 +55,7 @@ static struct cfi_fixup cfi_fixup_table[] = { { CFI_MFR_ATMEL, CFI_ID_ANY, fixup_convert_atmel_pri }, #ifdef AMD_BOOTLOC_BUG -@@ -416,6 +457,9 @@ static struct cfi_fixup fixup_table[] = +@@ -420,6 +461,9 @@ static struct cfi_fixup fixup_table[] = */ { CFI_MFR_ANY, CFI_ID_ANY, fixup_use_erase_chip }, { CFI_MFR_ATMEL, AT49BV6416, fixup_use_atmel_lock }, @@ -67,7 +67,7 @@ --- a/drivers/mtd/chips/Kconfig +++ b/drivers/mtd/chips/Kconfig -@@ -189,6 +189,14 @@ config MTD_CFI_AMDSTD +@@ -194,6 +194,14 @@ config MTD_CFI_AMDSTD provides support for command set 0002, used on chips including the AMD Am29LV320. diff --git a/target/linux/adm5120/patches-4.14/310-adm5120_wdt.patch b/target/linux/adm5120/patches-4.14/310-adm5120_wdt.patch index 920806963d..f375261ccc 100644 --- a/target/linux/adm5120/patches-4.14/310-adm5120_wdt.patch +++ b/target/linux/adm5120/patches-4.14/310-adm5120_wdt.patch @@ -1,6 +1,6 @@ --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig -@@ -1193,6 +1193,18 @@ config RC32434_WDT +@@ -1450,6 +1450,18 @@ config RC32434_WDT To compile this driver as a module, choose M here: the module will be called rc32434_wdt. @@ -21,7 +21,7 @@ depends on SGI_HAS_INDYDOG --- a/drivers/watchdog/Makefile +++ b/drivers/watchdog/Makefile -@@ -137,6 +137,7 @@ obj-$(CONFIG_ATH79_WDT) += ath79_wdt.o +@@ -160,6 +160,7 @@ obj-$(CONFIG_ATH79_WDT) += ath79_wdt.o obj-$(CONFIG_BCM47XX_WDT) += bcm47xx_wdt.o obj-$(CONFIG_BCM63XX_WDT) += bcm63xx_wdt.o obj-$(CONFIG_RC32434_WDT) += rc32434_wdt.o diff --git a/target/linux/adm5120/patches-4.14/312-adm5120_nand.patch b/target/linux/adm5120/patches-4.14/312-adm5120_nand.patch index 75506ed1a6..06612bcaf7 100644 --- a/target/linux/adm5120/patches-4.14/312-adm5120_nand.patch +++ b/target/linux/adm5120/patches-4.14/312-adm5120_nand.patch @@ -1,5 +1,5 @@ ---- a/arch/mips/adm5120/mikrotik/rb-1xx.c 2017-05-28 11:08:18.936619297 +0300 -+++ b/arch/mips/adm5120/mikrotik/rb-1xx.c 2017-05-28 11:08:59.352619930 +0300 +--- a/arch/mips/adm5120/mikrotik/rb-1xx.c ++++ b/arch/mips/adm5120/mikrotik/rb-1xx.c @@ -58,21 +58,67 @@ static struct mtd_partition rb1xx_nand_p * will not be able to find the kernel that we load. So set the oobinfo * when creating the partitions diff --git a/target/linux/adm5120/patches-4.14/313-adm5120sw-4_9.patch b/target/linux/adm5120/patches-4.14/313-adm5120sw-4_9.patch index 979988b9a7..3e4562ff3b 100644 --- a/target/linux/adm5120/patches-4.14/313-adm5120sw-4_9.patch +++ b/target/linux/adm5120/patches-4.14/313-adm5120sw-4_9.patch @@ -1,5 +1,5 @@ ---- a/drivers/net/adm5120sw.c 2017-05-28 08:33:29.585473819 +0300 -+++ b/drivers/net/adm5120sw.c 2017-05-28 09:00:07.584498845 +0300 +--- a/drivers/net/adm5120sw.c ++++ b/drivers/net/adm5120sw.c @@ -679,7 +679,7 @@ static int adm5120_if_hard_start_xmit(st } } diff --git a/target/linux/adm5120/patches-4.14/450-mtd-nand-allow-to-use-platform-specific-chip-fixup.patch b/target/linux/adm5120/patches-4.14/450-mtd-nand-allow-to-use-platform-specific-chip-fixup.patch index bef53af4b9..55e9e12f71 100644 --- a/target/linux/adm5120/patches-4.14/450-mtd-nand-allow-to-use-platform-specific-chip-fixup.patch +++ b/target/linux/adm5120/patches-4.14/450-mtd-nand-allow-to-use-platform-specific-chip-fixup.patch @@ -1,6 +1,6 @@ ---- a/include/linux/mtd/rawnand.h 2017-05-25 16:45:05.000000000 +0300 -+++ b/include/linux/mtd/rawnand.h 2017-05-28 09:45:05.016541089 +0300 -@@ -1053,6 +1053,7 @@ struct platform_nand_chip { +--- a/include/linux/mtd/rawnand.h ++++ b/include/linux/mtd/rawnand.h +@@ -1156,6 +1156,7 @@ struct platform_nand_chip { unsigned int options; unsigned int bbt_options; const char **part_probe_types; @@ -8,8 +8,8 @@ }; /* Keep gcc happy */ ---- a/drivers/mtd/nand/plat_nand.c 2017-05-25 16:45:05.000000000 +0300 -+++ b/drivers/mtd/nand/plat_nand.c 2017-05-28 10:01:49.235556815 +0300 +--- a/drivers/mtd/nand/plat_nand.c ++++ b/drivers/mtd/nand/plat_nand.c @@ -86,10 +86,21 @@ static int plat_nand_probe(struct platfo } diff --git a/target/linux/adm5120/patches-4.14/500-yaffs-Kbuild-integration.patch b/target/linux/adm5120/patches-4.14/500-yaffs-Kbuild-integration.patch index fe1a612945..0d6f284f89 100644 --- a/target/linux/adm5120/patches-4.14/500-yaffs-Kbuild-integration.patch +++ b/target/linux/adm5120/patches-4.14/500-yaffs-Kbuild-integration.patch @@ -1,6 +1,6 @@ --- a/fs/Kconfig +++ b/fs/Kconfig -@@ -30,6 +30,7 @@ source "fs/ocfs2/Kconfig" +@@ -33,6 +33,7 @@ source "fs/ocfs2/Kconfig" source "fs/btrfs/Kconfig" source "fs/nilfs2/Kconfig" source "fs/f2fs/Kconfig" @@ -10,7 +10,7 @@ bool "Direct Access (DAX) support" --- a/fs/Makefile +++ b/fs/Makefile -@@ -126,3 +126,5 @@ obj-y += exofs/ # Multiple modules +@@ -129,3 +129,5 @@ obj-y += exofs/ # Multiple modules obj-$(CONFIG_CEPH_FS) += ceph/ obj-$(CONFIG_PSTORE) += pstore/ obj-$(CONFIG_EFIVAR_FS) += efivarfs/ diff --git a/target/linux/adm5120/patches-4.14/502-yaffs-fix-compat-tags-handling.patch b/target/linux/adm5120/patches-4.14/502-yaffs-fix-compat-tags-handling.patch index a18cf6fd7b..16ffa19a42 100644 --- a/target/linux/adm5120/patches-4.14/502-yaffs-fix-compat-tags-handling.patch +++ b/target/linux/adm5120/patches-4.14/502-yaffs-fix-compat-tags-handling.patch @@ -4,9 +4,9 @@ Signed-off-by: Gabor Juhos --- --- a/fs/yaffs2/yaffs_tagscompat.c +++ b/fs/yaffs2/yaffs_tagscompat.c -@@ -17,7 +17,9 @@ - #include "yaffs_getblockinfo.h" +@@ -20,7 +20,9 @@ #include "yaffs_trace.h" + #include "yaffs_endian.h" +#if 0 static void yaffs_handle_rd_data_error(struct yaffs_dev *dev, int nand_chunk); @@ -14,15 +14,15 @@ Signed-off-by: Gabor Juhos /********** Tags ECC calculations *********/ -@@ -71,6 +73,7 @@ int yaffs_check_tags_ecc(struct yaffs_ta +@@ -73,6 +75,7 @@ int yaffs_check_tags_ecc(struct yaffs_ta return 0; } +#if 0 /********** Tags **********/ - static void yaffs_load_tags_to_spare(struct yaffs_spare *spare_ptr, -@@ -379,3 +382,214 @@ void yaffs_tags_compat_install(struct ya + /* +@@ -397,3 +400,214 @@ void yaffs_tags_compat_install(struct ya if(!dev->tagger.mark_bad_fn) dev->tagger.mark_bad_fn = yaffs_tags_compat_mark_bad; } diff --git a/target/linux/adm5120/patches-4.14/503-yaffs-add-tags-9bytes-mount-option.patch b/target/linux/adm5120/patches-4.14/503-yaffs-add-tags-9bytes-mount-option.patch index 3f51bafc11..3c4cca1a32 100644 --- a/target/linux/adm5120/patches-4.14/503-yaffs-add-tags-9bytes-mount-option.patch +++ b/target/linux/adm5120/patches-4.14/503-yaffs-add-tags-9bytes-mount-option.patch @@ -4,7 +4,7 @@ Signed-off-by: Gabor Juhos --- --- a/fs/yaffs2/yaffs_vfs.c +++ b/fs/yaffs2/yaffs_vfs.c -@@ -2644,6 +2644,7 @@ static const struct super_operations yaf +@@ -2777,6 +2777,7 @@ static const struct super_operations yaf struct yaffs_options { int inband_tags; @@ -12,7 +12,7 @@ Signed-off-by: Gabor Juhos int skip_checkpoint_read; int skip_checkpoint_write; int no_cache; -@@ -2683,6 +2684,8 @@ static int yaffs_parse_options(struct ya +@@ -2816,6 +2817,8 @@ static int yaffs_parse_options(struct ya if (!strcmp(cur_opt, "inband-tags")) { options->inband_tags = 1; @@ -21,7 +21,7 @@ Signed-off-by: Gabor Juhos } else if (!strcmp(cur_opt, "tags-ecc-off")) { options->tags_ecc_on = 0; options->tags_ecc_overridden = 1; -@@ -2756,7 +2759,6 @@ static struct super_block *yaffs_interna +@@ -2889,7 +2892,6 @@ static struct super_block *yaffs_interna struct yaffs_param *param; int read_only = 0; @@ -29,7 +29,7 @@ Signed-off-by: Gabor Juhos struct yaffs_options options; -@@ -2796,6 +2798,9 @@ static struct super_block *yaffs_interna +@@ -2929,6 +2931,9 @@ static struct super_block *yaffs_interna memset(&options, 0, sizeof(options)); @@ -39,7 +39,7 @@ Signed-off-by: Gabor Juhos if (yaffs_parse_options(&options, data_str)) { /* Option parsing failed */ return NULL; -@@ -2829,17 +2834,22 @@ static struct super_block *yaffs_interna +@@ -2962,17 +2967,22 @@ static struct super_block *yaffs_interna } /* Added NCB 26/5/2006 for completeness */ @@ -68,7 +68,7 @@ Signed-off-by: Gabor Juhos return NULL; /* OK, so if we got here, we have an MTD that's NAND and looks -@@ -2896,7 +2906,8 @@ static struct super_block *yaffs_interna +@@ -3029,7 +3039,8 @@ static struct super_block *yaffs_interna param->n_reserved_blocks = 5; param->n_caches = (options.no_cache) ? 0 : 10; @@ -80,7 +80,7 @@ Signed-off-by: Gabor Juhos if (options.lazy_loading_overridden) --- a/fs/yaffs2/yaffs_mtdif.c +++ b/fs/yaffs2/yaffs_mtdif.c -@@ -278,7 +278,8 @@ struct mtd_info * yaffs_get_mtd_device(d +@@ -282,7 +282,8 @@ struct mtd_info * yaffs_get_mtd_device(d return mtd; } @@ -90,7 +90,7 @@ Signed-off-by: Gabor Juhos { if (yaffs_version == 2) { if ((WRITE_SIZE(mtd) < YAFFS_MIN_YAFFS2_CHUNK_SIZE || -@@ -297,6 +298,12 @@ int yaffs_verify_mtd(struct mtd_info *mt +@@ -301,6 +302,12 @@ int yaffs_verify_mtd(struct mtd_info *mt ); return -1; } @@ -105,7 +105,7 @@ Signed-off-by: Gabor Juhos return 0; --- a/fs/yaffs2/yaffs_mtdif.h +++ b/fs/yaffs2/yaffs_mtdif.h -@@ -21,5 +21,6 @@ +@@ -20,5 +20,6 @@ void yaffs_mtd_drv_install(struct yaffs_dev *dev); struct mtd_info * yaffs_get_mtd_device(dev_t sdev); void yaffs_put_mtd_device(struct mtd_info *mtd); diff --git a/target/linux/adm5120/patches-4.14/600-4_14-irq_map-fixup.patch b/target/linux/adm5120/patches-4.14/600-4_14-irq_map-fixup.patch new file mode 100644 index 0000000000..f64af96cc4 --- /dev/null +++ b/target/linux/adm5120/patches-4.14/600-4_14-irq_map-fixup.patch @@ -0,0 +1,33 @@ +--- a/arch/mips/adm5120/mikrotik/rb-1xx.c ++++ b/arch/mips/adm5120/mikrotik/rb-1xx.c +@@ -22,7 +22,7 @@ + #define RB1XX_KEYS_POLL_INTERVAL 20 + #define RB1XX_KEYS_DEBOUNCE_INTERVAL (3 * RB1XX_KEYS_POLL_INTERVAL) + +-static struct adm5120_pci_irq rb1xx_pci_irqs[] __initdata = { ++static struct adm5120_pci_irq rb1xx_pci_irqs[] = { + PCIIRQ(1, 0, 1, ADM5120_IRQ_PCI0), + PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI1), + PCIIRQ(3, 0, 1, ADM5120_IRQ_PCI2) +--- a/arch/mips/pci/pci-adm5120.c ++++ b/arch/mips/pci/pci-adm5120.c +@@ -46,8 +46,8 @@ + + /* -------------------------------------------------------------------------*/ + +-static unsigned int adm5120_pci_nr_irqs __initdata; +-static struct adm5120_pci_irq *adm5120_pci_irq_map __initdata; ++static unsigned int adm5120_pci_nr_irqs; ++static struct adm5120_pci_irq *adm5120_pci_irq_map; + + static DEFINE_SPINLOCK(pci_lock); + +@@ -262,7 +262,7 @@ static struct pci_controller adm5120_con + .mem_resource = &pci_mem_resource, + }; + +-static int __init adm5120_pci_setup(void) ++static int adm5120_pci_setup(void) + { + void __iomem *io_map_base; + diff --git a/target/linux/adm5120/patches-4.14/700-irq_upd_napi_poll.patch b/target/linux/adm5120/patches-4.14/700-irq_upd_napi_poll.patch new file mode 100644 index 0000000000..5f08d469f7 --- /dev/null +++ b/target/linux/adm5120/patches-4.14/700-irq_upd_napi_poll.patch @@ -0,0 +1,51 @@ +--- a/drivers/net/adm5120sw.c ++++ b/drivers/net/adm5120sw.c +@@ -333,7 +333,7 @@ static void adm5120_switch_tx(void) + skb->dev->stats.tx_packets++; + } + +- dev_kfree_skb_irq(skb); ++ dev_consume_skb_irq(skb); + txl_skbuff[entry] = NULL; + entry = (++dirty_txl) % TX_RING_SIZE; + } +@@ -639,10 +639,11 @@ static int adm5120_if_hard_start_xmit(st + struct adm5120_if_priv *priv = netdev_priv(dev); + unsigned int entry; + unsigned long data; ++ unsigned long flags; + int i; + + /* lock switch irq */ +- spin_lock_irq(&tx_lock); ++ spin_lock_irqsave(&tx_lock, flags); + + /* calculate the next TX descriptor entry. */ + entry = cur_txl % TX_RING_SIZE; +@@ -651,7 +652,7 @@ static int adm5120_if_hard_start_xmit(st + if (desc->buf1 & DESC_OWN) { + /* We want to write a packet but the TX queue is still + * occupied by the DMA. We are faster than the DMA... */ +- dev_kfree_skb(skb); ++ dev_consume_skb_irq(skb); + dev->stats.tx_dropped++; + return 0; + } +@@ -680,7 +681,7 @@ static int adm5120_if_hard_start_xmit(st + + netif_trans_update(dev); + +- spin_unlock_irq(&tx_lock); ++ spin_unlock_irqrestore(&tx_lock, flags); + + return 0; + } +@@ -818,7 +819,7 @@ static struct net_device *adm5120_if_all + dev->netdev_ops = &adm5120sw_netdev_ops; + dev->watchdog_timeo = TX_TIMEOUT; + +- netif_napi_add(dev, &priv->napi, adm5120_if_poll, 64); ++ netif_napi_add(dev, &priv->napi, adm5120_if_poll, NAPI_POLL_WEIGHT); + + return dev; + } diff --git a/target/linux/adm5120/patches-4.14/710-gfp_atomic_to_kernel.patch b/target/linux/adm5120/patches-4.14/710-gfp_atomic_to_kernel.patch new file mode 100644 index 0000000000..8831e3c763 --- /dev/null +++ b/target/linux/adm5120/patches-4.14/710-gfp_atomic_to_kernel.patch @@ -0,0 +1,20 @@ +--- a/drivers/net/adm5120sw.c ++++ b/drivers/net/adm5120sw.c +@@ -433,7 +433,7 @@ static int adm5120_switch_tx_ring_alloc( + int err; + + txl_descs = dma_alloc_coherent(NULL, TX_DESCS_SIZE, &txl_descs_dma, +- GFP_ATOMIC); ++ GFP_DMA | GFP_KERNEL); + if (!txl_descs) { + err = -ENOMEM; + goto err; +@@ -474,7 +474,7 @@ static int adm5120_switch_rx_ring_alloc( + + /* init RX ring */ + rxl_descs = dma_alloc_coherent(NULL, RX_DESCS_SIZE, &rxl_descs_dma, +- GFP_ATOMIC); ++ GFP_DMA | GFP_KERNEL); + if (!rxl_descs) { + err = -ENOMEM; + goto err; diff --git a/target/linux/adm5120/patches-4.14/720-napi_complete_done.patch b/target/linux/adm5120/patches-4.14/720-napi_complete_done.patch new file mode 100644 index 0000000000..ce0c29dbda --- /dev/null +++ b/target/linux/adm5120/patches-4.14/720-napi_complete_done.patch @@ -0,0 +1,20 @@ +--- a/drivers/net/adm5120sw.c ++++ b/drivers/net/adm5120sw.c +@@ -231,7 +231,7 @@ static void adm5120_switch_rx_refill(voi + desc = &rxl_descs[entry]; + + skb = rxl_skbuff[entry]; +- if (skb == NULL) { ++ if (!skb) { + skb = alloc_skb(SKB_ALLOC_LEN, GFP_ATOMIC); + if (skb) { + skb_reserve(skb, SKB_RESERVE_LEN); +@@ -367,7 +367,7 @@ static int adm5120_if_poll(struct napi_s + + status = sw_int_status() & SWITCH_INTS_POLL; + if ((done < limit) && (!status)) { +- napi_complete(napi); ++ napi_complete_done(napi, done); + sw_int_unmask(SWITCH_INTS_POLL); + break; + } diff --git a/target/linux/adm5120/patches-4.14/730-struct_device_DMA_API.patch b/target/linux/adm5120/patches-4.14/730-struct_device_DMA_API.patch new file mode 100644 index 0000000000..4c04c46cf8 --- /dev/null +++ b/target/linux/adm5120/patches-4.14/730-struct_device_DMA_API.patch @@ -0,0 +1,163 @@ +diff --git a/drivers/net/adm5120sw.c b/drivers/net/adm5120sw.c +index eb17a0d..024551f 100644 +--- a/drivers/net/adm5120sw.c ++++ b/drivers/net/adm5120sw.c +@@ -428,11 +428,12 @@ static void adm5120_switch_rx_ring_reset(struct dma_desc *desc, + dirty_rxl = 0; + } + +-static int adm5120_switch_tx_ring_alloc(void) ++static int adm5120_switch_tx_ring_alloc(struct net_device *dev) + { ++ struct adm5120_if_priv *priv = netdev_priv(dev); + int err; + +- txl_descs = dma_alloc_coherent(NULL, TX_DESCS_SIZE, &txl_descs_dma, ++ txl_descs = dma_alloc_coherent(&priv->dev->dev, TX_DESCS_SIZE, &txl_descs_dma, + GFP_DMA | GFP_KERNEL); + if (!txl_descs) { + err = -ENOMEM; +@@ -451,8 +452,9 @@ static int adm5120_switch_tx_ring_alloc(void) + return err; + } + +-static void adm5120_switch_tx_ring_free(void) ++static void adm5120_switch_tx_ring_free(struct net_device *dev) + { ++ struct adm5120_if_priv *priv = netdev_priv(dev); + int i; + + if (txl_skbuff) { +@@ -463,17 +465,18 @@ static void adm5120_switch_tx_ring_free(void) + } + + if (txl_descs) +- dma_free_coherent(NULL, TX_DESCS_SIZE, txl_descs, ++ dma_free_coherent(&priv->dev->dev, TX_DESCS_SIZE, txl_descs, + txl_descs_dma); + } + +-static int adm5120_switch_rx_ring_alloc(void) ++static int adm5120_switch_rx_ring_alloc(struct net_device *dev) + { ++ struct adm5120_if_priv *priv = netdev_priv(dev); + int err; + int i; + + /* init RX ring */ +- rxl_descs = dma_alloc_coherent(NULL, RX_DESCS_SIZE, &rxl_descs_dma, ++ rxl_descs = dma_alloc_coherent(&priv->dev->dev, RX_DESCS_SIZE, &rxl_descs_dma, + GFP_DMA | GFP_KERNEL); + if (!rxl_descs) { + err = -ENOMEM; +@@ -503,8 +506,9 @@ static int adm5120_switch_rx_ring_alloc(void) + return err; + } + +-static void adm5120_switch_rx_ring_free(void) ++static void adm5120_switch_rx_ring_free(struct net_device *dev) + { ++ struct adm5120_if_priv *priv = netdev_priv(dev); + int i; + + if (rxl_skbuff) { +@@ -515,7 +519,7 @@ static void adm5120_switch_rx_ring_free(void) + } + + if (rxl_descs) +- dma_free_coherent(NULL, RX_DESCS_SIZE, rxl_descs, ++ dma_free_coherent(&priv->dev->dev, RX_DESCS_SIZE, rxl_descs, + rxl_descs_dma); + } + +@@ -809,8 +813,10 @@ static struct net_device *adm5120_if_alloc(void) + struct adm5120_if_priv *priv; + + dev = alloc_etherdev(sizeof(*priv)); +- if (!dev) ++ if (!dev) { ++ SW_ERR("alloc_etherdev failed\n"); + return NULL; ++ } + + priv = netdev_priv(dev); + priv->dev = dev; +@@ -824,7 +830,7 @@ static struct net_device *adm5120_if_alloc(void) + return dev; + } + +-static void adm5120_switch_cleanup(void) ++static void adm5120_switch_cleanup(struct net_device *dev) + { + int i; + +@@ -839,12 +845,13 @@ static void adm5120_switch_cleanup(void) + } + } + +- adm5120_switch_tx_ring_free(); +- adm5120_switch_rx_ring_free(); ++ adm5120_switch_tx_ring_free(dev); ++ adm5120_switch_rx_ring_free(dev); + } + + static int adm5120_switch_probe(struct platform_device *pdev) + { ++ struct net_device *dev; + u32 t; + int i, err; + +@@ -879,11 +886,17 @@ static int adm5120_switch_probe(struct platform_device *pdev) + sw_int_mask(SWITCH_INTS_ALL); + sw_int_ack(SWITCH_INTS_ALL); + +- err = adm5120_switch_rx_ring_alloc(); ++ dev = platform_get_drvdata(pdev); ++ if (!dev) { ++ err = -ENOMEM; ++ return err; ++ } ++ ++ err = adm5120_switch_rx_ring_alloc(dev); + if (err) + goto err; + +- err = adm5120_switch_tx_ring_alloc(); ++ err = adm5120_switch_tx_ring_alloc(dev); + if (err) + goto err; + +@@ -933,16 +946,29 @@ static int adm5120_switch_probe(struct platform_device *pdev) + return 0; + + err: +- adm5120_switch_cleanup(); ++ adm5120_switch_cleanup(dev); + +- SW_ERR("init failed\n"); ++ SW_ERR("probe_init failed\n"); + return err; + } + + static int adm5120_switch_remove(struct platform_device *pdev) + { +- adm5120_switch_cleanup(); +- return 0; ++ struct net_device *dev; ++ int err; ++ ++ dev = platform_get_drvdata(pdev); ++ if (!dev) { ++ err = -ENOMEM; ++ ++ adm5120_switch_cleanup(dev); ++ SW_ERR("remove_init failed\n"); ++ ++ return err; ++ } else { ++ adm5120_switch_cleanup(dev); ++ return 0; ++ } + } + + static struct platform_driver adm5120_switch_driver = { -- 2.35.1