From 95d74fb479c9cd0706ac0d67d2f1c4d18b091867 Mon Sep 17 00:00:00 2001 From: LEAN-ESX Date: Sun, 4 Aug 2019 22:11:18 -0700 Subject: [PATCH] kernel bump to 4.9.186, 4.14.134, 4.19.62 --- include/kernel-version.mk | 12 +- .../etc/hotplug.d/firmware/10-ath9k-eeprom | 4 +- .../apm821xx/base-files/etc/rc.button/BTN_1 | 18 - .../base-files/lib/upgrade/platform.sh | 4 +- .../apm821xx/base-files/lib/upgrade/wdbook.sh | 11 +- target/linux/apm821xx/config-4.14 | 5 +- target/linux/apm821xx/config-4.19 | 2 + target/linux/apm821xx/dts/apm82181.dtsi | 2 - target/linux/apm821xx/dts/meraki-mr24.dts | 16 +- target/linux/apm821xx/dts/meraki-mx60.dts | 18 +- .../linux/apm821xx/dts/netgear-wndap6x0.dtsi | 17 +- .../linux/apm821xx/dts/netgear-wndr4700.dts | 35 +- target/linux/apm821xx/dts/wd-mybooklive.dts | 14 +- target/linux/apm821xx/image/Makefile | 3 +- .../023-0001-treewide-kzalloc-kcalloc.patch | 447 ++++ ...remove-useless-setting-of-type-flags.patch | 84 + ...-CRYPTO_ALG_ASYNC-from-cipher-tfm-al.patch | 34 + ...4xx_core-don-t-abuse-__dma_sync_page.patch | 30 + ...s-tree-phase-out-dma_zalloc_coherent.patch | 40 + ...to-crypto4xx-add-prng-crypto-support.patch | 199 ++ ...-Fix-wrong-ppc4xx_trng_probe-ppc4xx_.patch | 39 + ...rypto4xx-fix-AES-CTR-blocksize-value.patch | 60 + ...pto4xx-fix-blocksize-for-cfb-and-ofb.patch | 44 + ...-block-ciphers-should-only-accept-co.patch | 172 ++ ...clear-pending-interrupt-after-irq-ty.patch | 30 + ...mware-loader-for-uPD720201-and-uPD72.patch | 2 +- ...-CRYPTO_ALG_ASYNC-from-cipher-tfm-al.patch | 34 + ...4xx_core-don-t-abuse-__dma_sync_page.patch | 30 + ...s-tree-phase-out-dma_zalloc_coherent.patch | 40 + ...to-crypto4xx-add-prng-crypto-support.patch | 199 ++ ...-Fix-wrong-ppc4xx_trng_probe-ppc4xx_.patch | 39 + ...-get-rid-of-redundant-using_sd-varia.patch | 63 + ...clear-pending-interrupt-after-irq-ty.patch | 30 + ...mware-loader-for-uPD720201-and-uPD72.patch | 2 +- .../patches-4.9/300-add-ac49x-platform.patch | 4 +- ...2515-Use-DT-supplied-interrupt-flags.patch | 2 +- ...dget-ethernet-Re-enable-Jumbo-frames.patch | 2 +- .../950-0040-Add-dwc_otg-driver.patch | 2 +- ...2515-Use-DT-supplied-interrupt-flags.patch | 2 +- ...-t-prevent-IRQ-usage-of-output-GPIOs.patch | 2 +- ...-driver-for-BigBen-Interactive-PS3OF.patch | 2 +- ...5-camera-Move-module-info-to-the-end.patch | 2 +- ...camera-Provide-more-specific-probe-e.patch | 20 +- ...camera-Add-hint-about-possible-fault.patch | 2 +- ...Don-t-probe-if-no-camera-is-detected.patch | 4 +- ...camera-Do-not-bulk-receive-from-serv.patch | 22 +- ...camera-Ensure-H264-header-bytes-get-.patch | 6 +- ...camera-Correctly-denote-key-frames-i.patch | 2 +- ...cm2835-camera-Return-early-on-errors.patch | 10 +- ...5-camera-Reduce-length-of-enum-names.patch | 48 +- ...camera-Fix-multiple-line-dereference.patch | 16 +- ...cm2835-camera-Fix-brace-style-issues.patch | 4 +- ...camera-Fix-logical-continuation-spli.patch | 6 +- ...camera-Fix-open-parenthesis-alignmen.patch | 14 +- ...camera-Ensure-all-buffers-are-return.patch | 95 - ...camera-Remove-check-of-the-number-of.patch | 39 - ...camera-Handle-empty-EOS-buffers-whil.patch | 84 - ...vices-Split-vchiq-mmal-into-a-module.patch | 1916 +---------------- ...iq-Allocate-and-free-components-as-r.patch | 14 +- ...chiq-Avoid-use-of-bool-in-structures.patch | 12 +- ...hiq-Make-timeout-a-defined-parameter.patch | 2 +- ...iq-Make-a-mmal_buf-struct-for-passin.patch | 4 +- ...chiq-Add-support-for-event-callbacks.patch | 24 +- ...vices-Support-sending-data-to-MMAL-p.patch | 2 +- ...vices-Use-vc-sm-cma-to-support-zero-.patch | 10 +- ...2-Allow-exporting-of-a-struct-dmabuf.patch | 4 +- ...w-reqbufs-0-with-in-use-MMAP-buffers.patch | 4 +- ...iq-Fix-client_component-for-64-bit-k.patch | 6 +- ...a-Use-a-void-pointer-as-the-handle-w.patch | 2 +- ...iq-Always-return-the-param-size-from.patch | 2 +- ...iq-If-the-VPU-returns-an-error-don-t.patch | 2 +- ...codec-Fix-handling-of-VB2_MEMORY_DMA.patch | 4 +- ...iq-Free-the-event-context-for-contro.patch | 2 +- ...iq-Replace-spinlock-protecting-conte.patch | 67 - ...Better-coalescing-parameter-defaults.patch | 2 +- ...-Allow-reqbufs-0-with-in-use-MMAP-bu.patch | 4 +- ...w-reqbufs-0-with-in-use-MMAP-buffers.patch | 2 +- .../brcm47xx/patches-4.14/159-cpu_fixes.patch | 10 +- .../brcm47xx/patches-4.19/159-cpu_fixes.patch | 10 +- target/linux/gemini/Makefile | 2 +- .../etc/uci-defaults/09_fix-checksum | 20 + .../lib/preinit/05_set_ether_mac_gemini | 65 +- .../gemini/base-files/lib/upgrade/platform.sh | 25 + target/linux/gemini/config-4.14 | 7 - target/linux/gemini/config-4.19 | 9 - .../gemini/image/ImageInfo-storlink_sl93512r | 18 + target/linux/gemini/image/Makefile | 29 +- ...-basic-devicetree-for-D-Link-DNS-313.patch | 2 +- ...-DIR-685-partition-table-for-OpenWrt.patch | 14 +- ...tcp-allow-drivers-to-tweak-TSQ-logic.patch | 2 +- ...ption-fix-dwm-158-3g-modem-interface.patch | 2 +- ...ddress-assignment-via-ifconfig-ioctl.patch | 4 +- ...ow_offload-handle-netdevice-events-f.patch | 2 +- ...w_table-clean-up-and-fix-dst-handlin.patch | 10 +- ...-for-controlling-warnings-to-linux-c.patch | 4 +- target/linux/generic/config-4.19 | 2 +- ...etfilter-connmark-introduce-savedscp.patch | 100 + .../hack-4.14/901-debloat_sock_diag.patch | 2 +- .../generic/hack-4.14/902-debloat_proc.patch | 2 +- .../hack-4.19/259-regmap_dynamic.patch | 2 +- .../640-bridge-only-accept-EAP-locally.patch | 2 +- .../hack-4.19/647-netfilter-flow-acct.patch | 4 +- .../661-use_fq_codel_by_default.patch | 4 +- .../702-phy_add_aneg_done_function.patch | 2 +- .../hack-4.19/901-debloat_sock_diag.patch | 2 +- .../generic/hack-4.19/902-debloat_proc.patch | 4 +- .../hack-4.19/904-debloat_dma_buf.patch | 2 +- .../generic/hack-4.9/220-gc_sections.patch | 6 +- .../301-mips_image_cmdline_hack.patch | 2 +- .../pending-4.14/630-packet_socket_type.patch | 8 +- ...00-MIPS-fix-build-on-non-linux-hosts.patch | 55 - ...ge_allow_receiption_on_disabled_port.patch | 10 +- .../302-mips_no_branch_likely.patch | 2 +- .../pending-4.19/304-mips_disable_fpu.patch | 2 +- .../pending-4.19/305-mips_module_reloc.patch | 2 +- .../pending-4.19/308-mips32r2_tune.patch | 2 +- .../pending-4.19/630-packet_socket_type.patch | 8 +- ...w_table-add-hardware-offload-support.patch | 2 +- ...detach-callback-to-struct-phy_driver.patch | 2 +- .../pending-4.9/201-extra_optimization.patch | 2 +- .../300-mips_expose_boot_raw.patch | 4 +- .../pending-4.9/304-mips_disable_fpu.patch | 2 +- ...ove-no-op-dma_map_ops-where-possible.patch | 12 +- .../pending-4.9/630-packet_socket_type.patch | 8 +- ...T-skip-GRO-for-foreign-MAC-addresses.patch | 8 +- .../700-net-add-qualcomm-mdio-and-phy.patch | 2 +- .../patches-4.9/160-delayed_uart_io.patch | 4 +- target/linux/lantiq/Makefile | 2 +- .../lantiq/ase/{config-4.14 => config-4.19} | 0 .../lantiq/base-files/etc/board.d/02_network | 16 + .../base-files/etc/hotplug.d/dsl/led_dsl.sh | 4 +- .../etc/hotplug.d/firmware/12-ath9k-eeprom | 6 +- .../lantiq/base-files/lib/upgrade/platform.sh | 4 +- .../linux/lantiq/{config-4.14 => config-4.19} | 44 +- .../falcon/{config-4.14 => config-4.19} | 0 .../arch/mips/boot/dts/EASY98000NOR.dts | 38 - .../arch/mips/boot/dts/falcon-sflash-16M.dtsi | 37 - .../arch/mips/boot/dts/ACMP252.dts | 7 +- .../arch/mips/boot/dts/ALL0333CJ.dts | 7 +- .../arch/mips/boot/dts/ARV4510PW.dts | 11 +- .../arch/mips/boot/dts/ARV4518PWR01.dts | 0 .../arch/mips/boot/dts/ARV4518PWR01.dtsi | 26 +- .../arch/mips/boot/dts/ARV4518PWR01A.dts | 0 .../arch/mips/boot/dts/ARV4519PW.dts | 26 +- .../arch/mips/boot/dts/ARV4520PW.dts | 26 +- .../arch/mips/boot/dts/ARV4525PW.dts | 11 +- .../arch/mips/boot/dts/ARV452CQW.dts | 26 +- .../arch/mips/boot/dts/ARV7506PW11.dts | 9 +- .../arch/mips/boot/dts/ARV7510PW22.dts | 11 +- .../arch/mips/boot/dts/ARV7518PW.dts | 26 +- .../arch/mips/boot/dts/ARV7519PW.dts | 11 +- .../arch/mips/boot/dts/ARV7519RW22.dts | 14 +- .../arch/mips/boot/dts/ARV7525PW.dts | 11 +- .../arch/mips/boot/dts/ARV752DPW.dts | 26 +- .../arch/mips/boot/dts/ARV752DPW22.dts | 27 +- .../arch/mips/boot/dts/ARV8539PW22.dts | 17 +- .../arch/mips/boot/dts/ASL56026.dts | 14 +- .../arch/mips/boot/dts/BTHOMEHUBV2B.dts | 17 +- .../arch/mips/boot/dts/BTHOMEHUBV3A.dts | 13 +- .../arch/mips/boot/dts/BTHOMEHUBV5A.dts | 16 +- .../arch/mips/boot/dts/DGN1000B.dts | 13 +- .../arch/mips/boot/dts/DGN3500.dts | 0 .../arch/mips/boot/dts/DGN3500.dtsi | 23 +- .../arch/mips/boot/dts/DGN3500B.dts | 0 .../arch/mips/boot/dts/DM200.dts | 18 +- .../arch/mips/boot/dts/EASY50712.dts | 5 +- .../arch/mips/boot/dts/EASY50810.dts | 5 +- .../arch/mips/boot/dts/EASY80920.dtsi | 16 +- .../arch/mips/boot/dts/EASY80920NAND.dts | 4 +- .../arch/mips/boot/dts/EASY80920NOR.dts | 4 +- .../arch/mips/boot/dts/EASY88388.dts | 4 +- .../arch/mips/boot/dts/EASY88444.dts | 4 +- .../arch/mips/boot/dts/EASY98000-base.dtsi | 6 +- .../arch/mips/boot/dts/EASY98000NAND.dts | 2 +- .../files/arch/mips/boot/dts/EASY98000NOR.dts | 42 + .../arch/mips/boot/dts/EASY98000SFLASH.dts | 0 .../arch/mips/boot/dts/EASY98020.dts | 12 +- .../arch/mips/boot/dts/EASY98020V18.dts | 4 +- .../arch/mips/boot/dts/EASY98021.dts | 4 +- .../arch/mips/boot/dts/EASY98035SYNCE.dts | 0 .../arch/mips/boot/dts/EASY98035SYNCE1588.dts | 0 .../arch/mips/boot/dts/FALCON-MDU.dts | 2 +- .../arch/mips/boot/dts/FALCON-SFP.dts | 0 .../mips/boot/dts/FRITZ3370-REV2-HYNIX.dts | 6 +- .../mips/boot/dts/FRITZ3370-REV2-MICRON.dts | 6 +- .../arch/mips/boot/dts/FRITZ3370-REV2.dtsi | 52 +- .../arch/mips/boot/dts/FRITZ7312.dts | 14 +- .../arch/mips/boot/dts/FRITZ7320.dts | 21 +- .../files/arch/mips/boot/dts/FRITZ7360SL.dts | 81 + .../files/arch/mips/boot/dts/FRITZ7362SL.dts | 133 ++ .../arch/mips/boot/dts/FRITZ736X.dtsi} | 91 +- .../files/arch/mips/boot/dts/FRITZ7412.dts | 228 ++ .../arch/mips/boot/dts/GIGASX76X.dts | 25 +- .../arch/mips/boot/dts/H201L.dts | 11 +- .../arch/mips/boot/dts/P2601HNFX.dts | 12 +- .../arch/mips/boot/dts/P2812HNUF1.dts | 12 +- .../arch/mips/boot/dts/P2812HNUF3.dts | 6 +- .../arch/mips/boot/dts/P2812HNUFX.dtsi | 10 +- .../arch/mips/boot/dts/TDW8970.dts | 0 .../arch/mips/boot/dts/TDW8980.dts | 0 .../arch/mips/boot/dts/TDW89X0.dtsi | 15 +- .../arch/mips/boot/dts/VG3503J.dts | 14 +- .../arch/mips/boot/dts/VGV7510KW22.dtsi | 14 +- .../arch/mips/boot/dts/VGV7510KW22BRN.dts | 2 +- .../arch/mips/boot/dts/VGV7510KW22NOR.dts | 2 +- .../arch/mips/boot/dts/VGV7519.dtsi | 15 +- .../arch/mips/boot/dts/VGV7519BRN.dts | 2 +- .../arch/mips/boot/dts/VGV7519NOR.dts | 2 +- .../arch/mips/boot/dts/VR200.dts | 6 +- .../arch/mips/boot/dts/VR200.dtsi | 10 +- .../arch/mips/boot/dts/VR200v.dts | 6 +- .../arch/mips/boot/dts/WBMR.dts | 11 +- .../arch/mips/boot/dts/WBMR300.dts | 83 +- .../arch/mips/boot/dts/amazonse.dtsi | 27 +- .../arch/mips/boot/dts/ar9.dtsi | 27 +- .../arch/mips/boot/dts/danube.dtsi | 37 +- .../arch/mips/boot/dts/falcon-sflash-16M.dtsi | 41 + .../arch/mips/boot/dts/falcon.dtsi | 98 +- .../arch/mips/boot/dts/vr9.dtsi | 40 +- target/linux/lantiq/image/Makefile | 38 +- ...gpio-stp-xway-Implement-get-callback.patch | 47 - ...hy-intel-xway-add-VR9-version-number.patch | 62 - ...-phy-intel-xway-add-VR9-v1.1-phy-ids.patch | 69 - .../0001-MIPS-lantiq-add-pcie-driver.patch | 12 +- ...onger-core-rest-timeout-in-dwc2_core.patch | 29 + .../0004-MIPS-lantiq-add-atm-hack.patch | 4 +- ...s-struct-device-to-DMA-API-functions.patch | 43 + ...s-struct-device-to-DMA-API-functions.patch | 50 + ...-MIPS-lantiq-backport-old-timer-code.patch | 0 .../0018-MTD-nand-lots-of-xrx200-fixes.patch | 6 +- ...antiq-handle-NO_XIP-on-cfi0001-flash.patch | 0 ...25p80-allow-loading-mtd-name-from-OF.patch | 10 +- ...T-PHY-add-led-support-for-intel-xway.patch | 8 +- ...antiq-autoselect-soc-rev-matching-fw.patch | 0 ...0025-NET-MIPS-lantiq-adds-xrx200-net.patch | 18 +- .../0028-NET-lantiq-various-etop-fixes.patch | 82 +- .../0030-GPIO-add-named-gpio-exports.patch | 12 +- ...PS-lantiq-add-FALC-ON-i2c-bus-master.patch | 4 +- ...iq-wifi-and-ethernet-eeprom-handling.patch | 2 +- ...42-arch-mips-increase-io_space_limit.patch | 2 +- ...e-lantiq-settings-match-vendor-drive.patch | 10 +- ...PS-lantiq-improve-USB-initialization.patch | 2 +- .../0101-find_active_root.patch | 4 +- .../0151-lantiq-ifxmips_pcie-use-of.patch | 33 +- .../0152-lantiq-VPE.patch | 4 +- .../0154-lantiq-pci-bar11mask-fix.patch | 0 .../0155-lantiq-VPE-nosmp.patch | 0 .../0160-owrt-lantiq-multiple-flash.patch | 0 ...-cmdset-0001-disable-buffered-writes.patch | 0 ...add-gphy-clk-src-device-tree-binding.patch | 2 +- .../0701-NET-lantiq-etop-of-mido.patch | 4 +- .../xrx200/{config-4.14 => config-4.19} | 8 +- target/linux/lantiq/xrx200/target.mk | 2 +- .../lantiq/xway/{config-4.14 => config-4.19} | 0 .../xway_legacy/{config-4.14 => config-4.19} | 0 .../406-sfp-add-sfp-compatible.patch | 2 +- ...7-sfp-display-SFP-module-information.patch | 6 +- .../408-sfp-more-cotsworks-fixes.patch | 4 +- .../patches-4.19/450-reprobe_sfp_phy.patch | 10 +- 259 files changed, 3517 insertions(+), 3663 deletions(-) delete mode 100755 target/linux/apm821xx/base-files/etc/rc.button/BTN_1 create mode 100644 target/linux/apm821xx/patches-4.14/023-0001-treewide-kzalloc-kcalloc.patch create mode 100644 target/linux/apm821xx/patches-4.14/023-0002-crypto-skcipher-remove-useless-setting-of-type-flags.patch create mode 100644 target/linux/apm821xx/patches-4.14/023-0003-crypto-drop-mask-CRYPTO_ALG_ASYNC-from-cipher-tfm-al.patch create mode 100644 target/linux/apm821xx/patches-4.14/023-0004-crypto4xx_core-don-t-abuse-__dma_sync_page.patch create mode 100644 target/linux/apm821xx/patches-4.14/023-0005-cross-tree-phase-out-dma_zalloc_coherent.patch create mode 100644 target/linux/apm821xx/patches-4.14/023-0006-crypto-crypto4xx-add-prng-crypto-support.patch create mode 100644 target/linux/apm821xx/patches-4.14/023-0007-crypto-crypto4xx-Fix-wrong-ppc4xx_trng_probe-ppc4xx_.patch create mode 100644 target/linux/apm821xx/patches-4.14/023-0013-crypto-crypto4xx-fix-AES-CTR-blocksize-value.patch create mode 100644 target/linux/apm821xx/patches-4.14/023-0014-crypto-crypto4xx-fix-blocksize-for-cfb-and-ofb.patch create mode 100644 target/linux/apm821xx/patches-4.14/023-0015-crypto-crypto4xx-block-ciphers-should-only-accept-co.patch create mode 100644 target/linux/apm821xx/patches-4.14/100-powerpc-4xx-uic-clear-pending-interrupt-after-irq-ty.patch create mode 100644 target/linux/apm821xx/patches-4.19/023-0003-crypto-drop-mask-CRYPTO_ALG_ASYNC-from-cipher-tfm-al.patch create mode 100644 target/linux/apm821xx/patches-4.19/023-0004-crypto4xx_core-don-t-abuse-__dma_sync_page.patch create mode 100644 target/linux/apm821xx/patches-4.19/023-0005-cross-tree-phase-out-dma_zalloc_coherent.patch create mode 100644 target/linux/apm821xx/patches-4.19/023-0006-crypto-crypto4xx-add-prng-crypto-support.patch create mode 100644 target/linux/apm821xx/patches-4.19/023-0007-crypto-crypto4xx-Fix-wrong-ppc4xx_trng_probe-ppc4xx_.patch create mode 100644 target/linux/apm821xx/patches-4.19/023-0012-crypto-crypto4xx-get-rid-of-redundant-using_sd-varia.patch create mode 100644 target/linux/apm821xx/patches-4.19/100-powerpc-4xx-uic-clear-pending-interrupt-after-irq-ty.patch delete mode 100644 target/linux/brcm2708/patches-4.19/950-0252-staging-bcm2835_camera-Ensure-all-buffers-are-return.patch delete mode 100644 target/linux/brcm2708/patches-4.19/950-0253-staging-bcm2835-camera-Remove-check-of-the-number-of.patch delete mode 100644 target/linux/brcm2708/patches-4.19/950-0254-staging-bcm2835-camera-Handle-empty-EOS-buffers-whil.patch delete mode 100644 target/linux/brcm2708/patches-4.19/950-0489-staging-mmal-vchiq-Replace-spinlock-protecting-conte.patch create mode 100644 target/linux/gemini/base-files/etc/uci-defaults/09_fix-checksum create mode 100644 target/linux/gemini/base-files/lib/upgrade/platform.sh create mode 100644 target/linux/gemini/image/ImageInfo-storlink_sl93512r create mode 100644 target/linux/generic/hack-4.14/645-netfilter-connmark-introduce-savedscp.patch delete mode 100644 target/linux/generic/pending-4.19/100-MIPS-fix-build-on-non-linux-hosts.patch rename target/linux/lantiq/ase/{config-4.14 => config-4.19} (100%) rename target/linux/lantiq/{config-4.14 => config-4.19} (85%) rename target/linux/lantiq/falcon/{config-4.14 => config-4.19} (100%) delete mode 100644 target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY98000NOR.dts delete mode 100644 target/linux/lantiq/files-4.14/arch/mips/boot/dts/falcon-sflash-16M.dtsi rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/ACMP252.dts (95%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/ALL0333CJ.dts (96%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/ARV4510PW.dts (96%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/ARV4518PWR01.dts (100%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/ARV4518PWR01.dtsi (94%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/ARV4518PWR01A.dts (100%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/ARV4519PW.dts (94%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/ARV4520PW.dts (95%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/ARV4525PW.dts (95%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/ARV452CQW.dts (95%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/ARV7506PW11.dts (97%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/ARV7510PW22.dts (96%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/ARV7518PW.dts (95%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/ARV7519PW.dts (96%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/ARV7519RW22.dts (96%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/ARV7525PW.dts (95%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/ARV752DPW.dts (95%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/ARV752DPW22.dts (96%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/ARV8539PW22.dts (92%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/ASL56026.dts (94%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/BTHOMEHUBV2B.dts (93%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/BTHOMEHUBV3A.dts (95%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/BTHOMEHUBV5A.dts (96%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/DGN1000B.dts (94%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/DGN3500.dts (100%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/DGN3500.dtsi (93%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/DGN3500B.dts (100%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/DM200.dts (95%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/EASY50712.dts (95%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/EASY50810.dts (96%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/EASY80920.dtsi (97%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/EASY80920NAND.dts (95%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/EASY80920NOR.dts (91%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/EASY88388.dts (98%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/EASY88444.dts (97%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/EASY98000-base.dtsi (97%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/EASY98000NAND.dts (97%) create mode 100644 target/linux/lantiq/files/arch/mips/boot/dts/EASY98000NOR.dts rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/EASY98000SFLASH.dts (100%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/EASY98020.dts (90%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/EASY98020V18.dts (97%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/EASY98021.dts (98%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/EASY98035SYNCE.dts (100%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/EASY98035SYNCE1588.dts (100%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/FALCON-MDU.dts (98%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/FALCON-SFP.dts (100%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/FRITZ3370-REV2-HYNIX.dts (84%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/FRITZ3370-REV2-MICRON.dts (82%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/FRITZ3370-REV2.dtsi (90%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/FRITZ7312.dts (94%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/FRITZ7320.dts (94%) create mode 100644 target/linux/lantiq/files/arch/mips/boot/dts/FRITZ7360SL.dts create mode 100644 target/linux/lantiq/files/arch/mips/boot/dts/FRITZ7362SL.dts rename target/linux/lantiq/{files-4.14/arch/mips/boot/dts/FRITZ7360SL.dts => files/arch/mips/boot/dts/FRITZ736X.dtsi} (73%) create mode 100644 target/linux/lantiq/files/arch/mips/boot/dts/FRITZ7412.dts rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/GIGASX76X.dts (90%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/H201L.dts (95%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/P2601HNFX.dts (96%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/P2812HNUF1.dts (87%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/P2812HNUF3.dts (94%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/P2812HNUFX.dtsi (98%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/TDW8970.dts (100%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/TDW8980.dts (100%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/TDW89X0.dtsi (97%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/VG3503J.dts (94%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/VGV7510KW22.dtsi (96%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/VGV7510KW22BRN.dts (98%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/VGV7510KW22NOR.dts (97%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/VGV7519.dtsi (97%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/VGV7519BRN.dts (99%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/VGV7519NOR.dts (97%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/VR200.dts (95%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/VR200.dtsi (97%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/VR200v.dts (96%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/WBMR.dts (96%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/WBMR300.dts (86%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/amazonse.dtsi (93%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/ar9.dtsi (95%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/danube.dtsi (92%) create mode 100644 target/linux/lantiq/files/arch/mips/boot/dts/falcon-sflash-16M.dtsi rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/falcon.dtsi (82%) rename target/linux/lantiq/{files-4.14 => files}/arch/mips/boot/dts/vr9.dtsi (93%) delete mode 100644 target/linux/lantiq/patches-4.14/0002-gpio-stp-xway-Implement-get-callback.patch delete mode 100644 target/linux/lantiq/patches-4.14/0027-01-net-phy-intel-xway-add-VR9-version-number.patch delete mode 100644 target/linux/lantiq/patches-4.14/0027-02-net-phy-intel-xway-add-VR9-v1.1-phy-ids.patch rename target/linux/lantiq/{patches-4.14 => patches-4.19}/0001-MIPS-lantiq-add-pcie-driver.patch (99%) create mode 100644 target/linux/lantiq/patches-4.19/0003-usb-dwc2-use-a-longer-core-rest-timeout-in-dwc2_core.patch rename target/linux/lantiq/{patches-4.14 => patches-4.19}/0004-MIPS-lantiq-add-atm-hack.patch (99%) create mode 100644 target/linux/lantiq/patches-4.19/0005-lantiq_etop-pass-struct-device-to-DMA-API-functions.patch create mode 100644 target/linux/lantiq/patches-4.19/0006-MIPS-lantiq-pass-struct-device-to-DMA-API-functions.patch rename target/linux/lantiq/{patches-4.14 => patches-4.19}/0008-MIPS-lantiq-backport-old-timer-code.patch (100%) rename target/linux/lantiq/{patches-4.14 => patches-4.19}/0018-MTD-nand-lots-of-xrx200-fixes.patch (95%) rename target/linux/lantiq/{patches-4.14 => patches-4.19}/0020-MTD-lantiq-handle-NO_XIP-on-cfi0001-flash.patch (100%) rename target/linux/lantiq/{patches-4.14 => patches-4.19}/0022-MTD-m25p80-allow-loading-mtd-name-from-OF.patch (77%) rename target/linux/lantiq/{patches-4.14 => patches-4.19}/0023-NET-PHY-add-led-support-for-intel-xway.patch (98%) rename target/linux/lantiq/{patches-4.14 => patches-4.19}/0024-MIPS-lantiq-autoselect-soc-rev-matching-fw.patch (100%) rename target/linux/lantiq/{patches-4.14 => patches-4.19}/0025-NET-MIPS-lantiq-adds-xrx200-net.patch (99%) rename target/linux/lantiq/{patches-4.14 => patches-4.19}/0028-NET-lantiq-various-etop-fixes.patch (92%) rename target/linux/lantiq/{patches-4.14 => patches-4.19}/0030-GPIO-add-named-gpio-exports.patch (93%) rename target/linux/lantiq/{patches-4.14 => patches-4.19}/0031-I2C-MIPS-lantiq-add-FALC-ON-i2c-bus-master.patch (99%) rename target/linux/lantiq/{patches-4.14 => patches-4.19}/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch (99%) rename target/linux/lantiq/{patches-4.14 => patches-4.19}/0042-arch-mips-increase-io_space_limit.patch (97%) rename target/linux/lantiq/{patches-4.14 => patches-4.19}/0050-USB-DWC2-make-the-lantiq-settings-match-vendor-drive.patch (91%) rename target/linux/lantiq/{patches-4.14 => patches-4.19}/0051-MIPS-lantiq-improve-USB-initialization.patch (96%) rename target/linux/lantiq/{patches-4.14 => patches-4.19}/0101-find_active_root.patch (94%) rename target/linux/lantiq/{patches-4.14 => patches-4.19}/0151-lantiq-ifxmips_pcie-use-of.patch (82%) rename target/linux/lantiq/{patches-4.14 => patches-4.19}/0152-lantiq-VPE.patch (97%) rename target/linux/lantiq/{patches-4.14 => patches-4.19}/0154-lantiq-pci-bar11mask-fix.patch (100%) rename target/linux/lantiq/{patches-4.14 => patches-4.19}/0155-lantiq-VPE-nosmp.patch (100%) rename target/linux/lantiq/{patches-4.14 => patches-4.19}/0160-owrt-lantiq-multiple-flash.patch (100%) rename target/linux/lantiq/{patches-4.14 => patches-4.19}/0300-MTD-cfi-cmdset-0001-disable-buffered-writes.patch (100%) rename target/linux/lantiq/{patches-4.14 => patches-4.19}/0301-xrx200-add-gphy-clk-src-device-tree-binding.patch (92%) rename target/linux/lantiq/{patches-4.14 => patches-4.19}/0701-NET-lantiq-etop-of-mido.patch (90%) rename target/linux/lantiq/xrx200/{config-4.14 => config-4.19} (95%) rename target/linux/lantiq/xway/{config-4.14 => config-4.19} (100%) rename target/linux/lantiq/xway_legacy/{config-4.14 => config-4.19} (100%) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index ad4966352..9aaeb834d 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -6,13 +6,13 @@ ifdef CONFIG_TESTING_KERNEL KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER) endif -LINUX_VERSION-4.9 = .184 -LINUX_VERSION-4.14 = .131 -LINUX_VERSION-4.19 = .56 +LINUX_VERSION-4.9 = .186 +LINUX_VERSION-4.14 = .134 +LINUX_VERSION-4.19 = .62 -LINUX_KERNEL_HASH-4.9.184 = 033114d5350525dede995d31b596c31b0e26db8d77a0a1c53d36cdc36ead9faf -LINUX_KERNEL_HASH-4.14.131 = 19f6404c30f4a9a1fe3315b902676b6d63a470be5d55cf2a0e47983c643c8ff5 -LINUX_KERNEL_HASH-4.19.56 = 7326943215b9496f302e95892457a63d9a77e0446e99dd7bade6b425bc966bdf +LINUX_KERNEL_HASH-4.9.186 = 242484430d0729791d8efd92181b7d34b4021050646c6e00cf459866eab94b6a +LINUX_KERNEL_HASH-4.14.134 = 0b21e7b5effd92303a551b5be2380c9703d6fb87cfe5189fe0d795cc73903d2d +LINUX_KERNEL_HASH-4.19.62 = 07be647189ced7eb8ba5ee769906e67919975772184842cc517f609df50cdadc remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 7a13a0afa..6d2d18658 100644 --- a/target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -20,7 +20,7 @@ ath9k_eeprom_extract() { [ -n "$mtd" ] || \ ath9k_eeprom_die "no mtd device found for partition $part" - dd if=$mtd of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \ + dd if=$mtd of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \ ath9k_eeprom_die "failed to extract from $mtd" } @@ -35,7 +35,7 @@ ath9k_ubi_eeprom_extract() { [ -n "$ubi" ] || \ ath9k_eeprom_die "no UBI volume found for $part" - dd if=/dev/$ubi of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \ + dd if=/dev/$ubi of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \ ath9k_eeprom_die "failed to extract from $ubi" } diff --git a/target/linux/apm821xx/base-files/etc/rc.button/BTN_1 b/target/linux/apm821xx/base-files/etc/rc.button/BTN_1 deleted file mode 100755 index 5ecf346b5..000000000 --- a/target/linux/apm821xx/base-files/etc/rc.button/BTN_1 +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -. /lib/functions.sh - -BOARD=$(board_name) - -if [ $BOARD == "netgear,wndr4700" ]; then - case "$ACTION" in - released) - rmmod dwc2 - ;; - pressed) - modprobe dwc2 - ;; - esac -fi - -return 0 diff --git a/target/linux/apm821xx/base-files/lib/upgrade/platform.sh b/target/linux/apm821xx/base-files/lib/upgrade/platform.sh index 02c750130..32e87513f 100755 --- a/target/linux/apm821xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/apm821xx/base-files/lib/upgrade/platform.sh @@ -22,7 +22,7 @@ platform_do_upgrade() { case "$board" in wd,mybooklive) - mbl_do_upgrade "$ARGV" + mbl_do_upgrade "$1" ;; meraki,mr24|\ meraki,mx60|\ @@ -32,7 +32,7 @@ platform_do_upgrade() { nand_do_upgrade "$1" ;; *) - default_do_upgrade "$ARGV" + default_do_upgrade "$1" ;; esac } diff --git a/target/linux/apm821xx/base-files/lib/upgrade/wdbook.sh b/target/linux/apm821xx/base-files/lib/upgrade/wdbook.sh index 2287e0619..c19127114 100644 --- a/target/linux/apm821xx/base-files/lib/upgrade/wdbook.sh +++ b/target/linux/apm821xx/base-files/lib/upgrade/wdbook.sh @@ -7,7 +7,7 @@ mbl_do_platform_check() { [ "$#" -gt 1 ] && return 1 - export_bootdevice && export_partdevice diskdev -2 || { + export_bootdevice && export_partdevice diskdev 0 || { echo "Unable to determine upgrade device" return 1 } @@ -36,7 +36,7 @@ mbl_do_platform_check() { mbl_do_upgrade() { local diskdev partdev diff - export_bootdevice && export_partdevice diskdev -2 || { + export_bootdevice && export_partdevice diskdev 0 || { echo "Unable to determine upgrade device" return 1 } @@ -70,10 +70,6 @@ mbl_do_upgrade() { #iterate over each partition from the image and write it to the boot disk while read part start size; do - # root is /dev/sd[a|b]2 and not /dev/sd[a|b] this causes some problem - # one of which is this offset, I'm not sure what's the best fix, so - # here's a WA. - let part=$((part - 2)) if export_partdevice partdev $part; then echo "Writing image to /dev/$partdev..." get_image "$@" | dd of="/dev/$partdev" ibs="512" obs=1M skip="$start" count="$size" conv=fsync @@ -90,8 +86,7 @@ mbl_do_upgrade() { mbl_copy_config() { local partdev - # Same as above /dev/sd[a|b]2 is root, so /boot is -1 - if export_partdevice partdev -1; then + if export_partdevice partdev 1; then mount -t ext4 -o rw,noatime "/dev/$partdev" /mnt cp -af "$CONF_TAR" /mnt/ umount /mnt diff --git a/target/linux/apm821xx/config-4.14 b/target/linux/apm821xx/config-4.14 index c756c8a4f..ccc59b294 100644 --- a/target/linux/apm821xx/config-4.14 +++ b/target/linux/apm821xx/config-4.14 @@ -54,9 +54,10 @@ CONFIG_CLONE_BACKWARDS=y CONFIG_CMDLINE="rootfstype=squashfs noinitrd" CONFIG_CMDLINE_BOOL=y CONFIG_CONSISTENT_SIZE=0x00200000 -CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7 CONFIG_CPU_BIG_ENDIAN=y CONFIG_CRC16=y +# CONFIG_CRC32_SARWATE is not set +CONFIG_CRC32_SLICEBY8=y CONFIG_CRYPTO_ACOMP2=y CONFIG_CRYPTO_AEAD=y CONFIG_CRYPTO_AEAD2=y @@ -212,6 +213,7 @@ CONFIG_LZO_DECOMPRESS=y # CONFIG_MATH_EMULATION is not set CONFIG_MDIO_BUS=y CONFIG_MDIO_DEVICE=y +CONFIG_MIGRATION=y # CONFIG_MMIO_NVRAM is not set CONFIG_MODULES_USE_ELF_RELA=y # CONFIG_MPIC is not set @@ -321,7 +323,6 @@ CONFIG_PPC_WERROR=y # CONFIG_PPC_XIVE is not set # CONFIG_PPC_XIVE_SPAPR is not set # CONFIG_PQ2ADS is not set -CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13 CONFIG_PTE_64BIT=y # CONFIG_RAINIER is not set CONFIG_RAS=y diff --git a/target/linux/apm821xx/config-4.19 b/target/linux/apm821xx/config-4.19 index 3f57ec6b8..358eb3c71 100644 --- a/target/linux/apm821xx/config-4.19 +++ b/target/linux/apm821xx/config-4.19 @@ -60,6 +60,8 @@ CONFIG_CONSISTENT_SIZE=0x00200000 CONFIG_CONSOLE_LOGLEVEL_QUIET=4 CONFIG_CPU_BIG_ENDIAN=y CONFIG_CRC16=y +# CONFIG_CRC32_SARWATE is not set +CONFIG_CRC32_SLICEBY8=y CONFIG_CRYPTO_ACOMP2=y CONFIG_CRYPTO_AEAD=y CONFIG_CRYPTO_AEAD2=y diff --git a/target/linux/apm821xx/dts/apm82181.dtsi b/target/linux/apm821xx/dts/apm82181.dtsi index 45d4eac17..65032ba21 100644 --- a/target/linux/apm821xx/dts/apm82181.dtsi +++ b/target/linux/apm821xx/dts/apm82181.dtsi @@ -253,8 +253,6 @@ reg = <00000003 00000000 00002000>; ccr = <0x00001000>; bank-settings = <0x80002222>; - #address-cells = <1>; - #size-cells = <1>; status = "disabled"; nand { diff --git a/target/linux/apm821xx/dts/meraki-mr24.dts b/target/linux/apm821xx/dts/meraki-mr24.dts index 3b05d9c24..8fdef7c17 100644 --- a/target/linux/apm821xx/dts/meraki-mr24.dts +++ b/target/linux/apm821xx/dts/meraki-mr24.dts @@ -50,9 +50,6 @@ status = "okay"; /* 32 MiB NAND Flash */ nand { - #address-cells = <1>; - #size-cells = <1>; - partition@0 { label = "u-boot"; reg = <0x00000000 0x00150000>; @@ -129,7 +126,7 @@ }; &POB0 { - gpio-leds { + leds { compatible = "gpio-leds"; status: power-green { @@ -168,18 +165,17 @@ }; }; - gpio_keys_polled { - compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; - poll-interval = <60>; /* 3 * 20 = 60ms */ - autorepeat; + keys { + compatible = "gpio-keys"; reset { /* Label as per Meraki's "MR24 Installation Guide" */ label = "Factory Reset Button"; linux,code = ; + interrupt-parent = <&UIC1>; + interrupts = <0x15 IRQ_TYPE_EDGE_FALLING>; gpios = <&GPIO0 16 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; }; }; }; diff --git a/target/linux/apm821xx/dts/meraki-mx60.dts b/target/linux/apm821xx/dts/meraki-mx60.dts index 80b82e4ff..3620005e4 100644 --- a/target/linux/apm821xx/dts/meraki-mx60.dts +++ b/target/linux/apm821xx/dts/meraki-mx60.dts @@ -53,9 +53,6 @@ ndfc@1,0 { status = "okay"; nand { - #address-cells = <1>; - #size-cells = <1>; - partition@0 { label = "u-boot"; reg = <0x00000000 0x00100000>; @@ -103,6 +100,8 @@ phy0: ethernet-phy@0 { compatible = "ethernet-phy-id004d.d034"; reg = <0>; + qca,mib-poll-interval = <500>; + qca,ar8327-initvals = < 0x0010 0x40000000 0x0624 0x007f7f7f @@ -115,7 +114,7 @@ }; &POB0 { - gpio-leds { + leds { compatible = "gpio-leds"; status: power-green { @@ -159,17 +158,16 @@ }; }; - gpio_keys_polled { - compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; - poll-interval = <60>; /* 3 * 20 = 60ms */ - autorepeat; + keys { + compatible = "gpio-keys"; reset { label = "Reset button"; linux,code = ; gpios = <&GPIO0 16 GPIO_ACTIVE_LOW>; + interrupt-parent = <&UIC1>; + interrupts = <0x15 IRQ_TYPE_EDGE_FALLING>; + debounce-interval = <60>; }; }; }; diff --git a/target/linux/apm821xx/dts/netgear-wndap6x0.dtsi b/target/linux/apm821xx/dts/netgear-wndap6x0.dtsi index a163b1d82..2d135d64d 100644 --- a/target/linux/apm821xx/dts/netgear-wndap6x0.dtsi +++ b/target/linux/apm821xx/dts/netgear-wndap6x0.dtsi @@ -39,9 +39,6 @@ status = "okay"; /* 32 MiB SLC NAND Flash */ nand { - #address-cells = <1>; - #size-cells = <1>; - partition@0 { label = "u-boot"; reg = <0x00000000 0x00100000>; @@ -125,24 +122,20 @@ }; &POB0 { - gpio_keys_polled { - compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; - #interrupt-cells = <2>; - poll-interval = <60>; /* 3 * 20 = 60ms */ - autorepeat; + keys { + compatible = "gpio-keys"; reset { label = "Reset Button"; - gpios = <&GPIO0 16 GPIO_ACTIVE_HIGH>; + gpios = <&GPIO0 16 GPIO_ACTIVE_LOW>; linux,code = ; interrupt-parent = <&UIC1>; interrupts = <0x15 IRQ_TYPE_EDGE_FALLING>; + debounce-interval = <60>; }; }; - LEDS: gpio-leds { + LEDS: leds { compatible = "gpio-leds"; status: power { diff --git a/target/linux/apm821xx/dts/netgear-wndr4700.dts b/target/linux/apm821xx/dts/netgear-wndr4700.dts index 313de3fe3..a9ec36ada 100644 --- a/target/linux/apm821xx/dts/netgear-wndr4700.dts +++ b/target/linux/apm821xx/dts/netgear-wndr4700.dts @@ -157,9 +157,6 @@ status = "okay"; /* 128 MiB Nand Flash */ nand { - #address-cells = <1>; - #size-cells = <1>; - partition0,0@0 { label = "NAND 128MiB 3,3V 8-bit"; reg = <0x00000000 0x08000000>; @@ -296,6 +293,8 @@ phy0: ethernet-phy@0 { device_type = "ethernet-phy"; reg = <0>; + qca,mib-poll-interval = <500>; + qca,ar8327-initvals = < 0x0010 0x40000000 0x0624 0x007f7f7f @@ -308,54 +307,48 @@ }; &POB0 { - gpio_keys_polled { - compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; - #interrupt-cells = <2>; - autorepeat; - poll-interval = <60>; /* 3 * 20 = 60ms */ + + keys { + compatible = "gpio-keys"; reset { label = "Reset button"; + gpios = <&GPIO0 15 GPIO_ACTIVE_LOW>; linux,code = ; - gpios = <&GPIO0 15 GPIO_ACTIVE_HIGH>; interrupt-parent = <&UIC1>; interrupts = <0x14 IRQ_TYPE_EDGE_FALLING>; + debounce-interval = <60>; }; backup_hd { label = "Backup HD button"; - gpios = <&GPIO0 19 GPIO_ACTIVE_HIGH>; + gpios = <&GPIO0 19 GPIO_ACTIVE_LOW>; linux,code = ; interrupt-parent = <&UIC1>; interrupts = <0x1e IRQ_TYPE_EDGE_FALLING>; + debounce-interval = <60>; }; rfkill { label = "RFKILL button"; - gpios = <&GPIO0 20 GPIO_ACTIVE_HIGH>; + gpios = <&GPIO0 20 GPIO_ACTIVE_LOW>; linux,code = ; interrupt-parent = <&UIC1>; interrupts = <0x1f IRQ_TYPE_EDGE_FALLING>; + debounce-interval = <60>; }; wps { label = "WPS button"; - gpios = <&GPIO0 23 GPIO_ACTIVE_HIGH>; + gpios = <&GPIO0 23 GPIO_ACTIVE_LOW>; linux,code = ; interrupt-parent = <&UIC2>; interrupts = <0x19 IRQ_TYPE_EDGE_FALLING>; - }; - - sdcard { - label = "SDCard inserted"; - gpios = <&GPIO0 7 GPIO_ACTIVE_LOW>; - linux,code = ; + debounce-interval = <60>; }; }; - gpio-leds { + leds { compatible = "gpio-leds"; status: power-green { label = "wndr4700:green:power"; diff --git a/target/linux/apm821xx/dts/wd-mybooklive.dts b/target/linux/apm821xx/dts/wd-mybooklive.dts index 9412f38d4..6cba7d2f2 100644 --- a/target/linux/apm821xx/dts/wd-mybooklive.dts +++ b/target/linux/apm821xx/dts/wd-mybooklive.dts @@ -40,19 +40,19 @@ reg = <0x00000000 0x0001e000>; }; - partition@1 { + partition@1e000 { label = "env"; reg = <0x0001e000 0x00002000>; }; - partition@2 { + partition@20000 { label = "uboot"; reg = <0x00020000 0x00050000>; }; }; }; - GPIO1: gpio1@e0000000 { + GPIO1: gpio@e0000000 { compatible = "wd,mbl-gpio", "ti,74273"; reg-names = "dat"; reg = <0xe0000000 0x1>; @@ -77,7 +77,7 @@ }; }; - GPIO2: gpio2@e0100000 { + GPIO2: gpio@e0100000 { compatible = "wd,mbl-gpio", "ti,74244"; reg-names = "dat"; reg = <0xe0100000 0x1>; @@ -86,7 +86,7 @@ no-output; }; - gpio-leds { + leds { compatible = "gpio-leds"; failsafe: power-red { @@ -107,10 +107,8 @@ }; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <60>; /* 3 * 20 = 60ms */ autorepeat; diff --git a/target/linux/apm821xx/image/Makefile b/target/linux/apm821xx/image/Makefile index 60b1f78a3..277b2a1fc 100644 --- a/target/linux/apm821xx/image/Makefile +++ b/target/linux/apm821xx/image/Makefile @@ -226,6 +226,7 @@ ifeq ($(SUBTARGET),sata) define Device/wd_mybooklive DEVICE_TITLE := Western Digital My Book Live Series (Single + Duo) DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-usb-storage kmod-fs-vfat wpad-basic + DEVICE_TYPE := nas DEVICE_DTS := wd-mybooklive SUPPORTED_DEVICES += mbl wd,mybooklive-duo BLOCKSIZE := 1k @@ -233,7 +234,7 @@ define Device/wd_mybooklive KERNEL := kernel-bin | dtb | gzip | uImage gzip KERNEL_INITRAMFS := kernel-bin | gzip | dtb | MuImage-initramfs gzip IMAGES := factory.img.gz kernel.dtb sysupgrade.img.gz - ARTIFACTS := kernel.dtb + ARTIFACTS := apollo3g.dtb DEVICE_DTB := apollo3g.dtb FILESYSTEMS := ext4 squashfs IMAGE/factory.img.gz := boot-script | boot-img | hdd-img | gzip diff --git a/target/linux/apm821xx/patches-4.14/023-0001-treewide-kzalloc-kcalloc.patch b/target/linux/apm821xx/patches-4.14/023-0001-treewide-kzalloc-kcalloc.patch new file mode 100644 index 000000000..09206f505 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/023-0001-treewide-kzalloc-kcalloc.patch @@ -0,0 +1,447 @@ +From 6396bb221514d2876fd6dc0aa2a1f240d99b37bb Mon Sep 17 00:00:00 2001 +From: Kees Cook +Date: Tue, 12 Jun 2018 14:03:40 -0700 +Subject: [PATCH 01/15] treewide: kzalloc() -> kcalloc() + +The kzalloc() function has a 2-factor argument form, kcalloc(). This +patch replaces cases of: + + kzalloc(a * b, gfp) + +with: + kcalloc(a * b, gfp) + +as well as handling cases of: + + kzalloc(a * b * c, gfp) + +with: + + kzalloc(array3_size(a, b, c), gfp) + +as it's slightly less ugly than: + + kzalloc_array(array_size(a, b), c, gfp) + +This does, however, attempt to ignore constant size factors like: + + kzalloc(4 * 1024, gfp) + +though any constants defined via macros get caught up in the conversion. + +Any factors with a sizeof() of "unsigned char", "char", and "u8" were +dropped, since they're redundant. + +The Coccinelle script used for this was: + +// Fix redundant parens around sizeof(). +@@ +type TYPE; +expression THING, E; +@@ + +( + kzalloc( +- (sizeof(TYPE)) * E ++ sizeof(TYPE) * E + , ...) +| + kzalloc( +- (sizeof(THING)) * E ++ sizeof(THING) * E + , ...) +) + +// Drop single-byte sizes and redundant parens. +@@ +expression COUNT; +typedef u8; +typedef __u8; +@@ + +( + kzalloc( +- sizeof(u8) * (COUNT) ++ COUNT + , ...) +| + kzalloc( +- sizeof(__u8) * (COUNT) ++ COUNT + , ...) +| + kzalloc( +- sizeof(char) * (COUNT) ++ COUNT + , ...) +| + kzalloc( +- sizeof(unsigned char) * (COUNT) ++ COUNT + , ...) +| + kzalloc( +- sizeof(u8) * COUNT ++ COUNT + , ...) +| + kzalloc( +- sizeof(__u8) * COUNT ++ COUNT + , ...) +| + kzalloc( +- sizeof(char) * COUNT ++ COUNT + , ...) +| + kzalloc( +- sizeof(unsigned char) * COUNT ++ COUNT + , ...) +) + +// 2-factor product with sizeof(type/expression) and identifier or constant. +@@ +type TYPE; +expression THING; +identifier COUNT_ID; +constant COUNT_CONST; +@@ + +( +- kzalloc ++ kcalloc + ( +- sizeof(TYPE) * (COUNT_ID) ++ COUNT_ID, sizeof(TYPE) + , ...) +| +- kzalloc ++ kcalloc + ( +- sizeof(TYPE) * COUNT_ID ++ COUNT_ID, sizeof(TYPE) + , ...) +| +- kzalloc ++ kcalloc + ( +- sizeof(TYPE) * (COUNT_CONST) ++ COUNT_CONST, sizeof(TYPE) + , ...) +| +- kzalloc ++ kcalloc + ( +- sizeof(TYPE) * COUNT_CONST ++ COUNT_CONST, sizeof(TYPE) + , ...) +| +- kzalloc ++ kcalloc + ( +- sizeof(THING) * (COUNT_ID) ++ COUNT_ID, sizeof(THING) + , ...) +| +- kzalloc ++ kcalloc + ( +- sizeof(THING) * COUNT_ID ++ COUNT_ID, sizeof(THING) + , ...) +| +- kzalloc ++ kcalloc + ( +- sizeof(THING) * (COUNT_CONST) ++ COUNT_CONST, sizeof(THING) + , ...) +| +- kzalloc ++ kcalloc + ( +- sizeof(THING) * COUNT_CONST ++ COUNT_CONST, sizeof(THING) + , ...) +) + +// 2-factor product, only identifiers. +@@ +identifier SIZE, COUNT; +@@ + +- kzalloc ++ kcalloc + ( +- SIZE * COUNT ++ COUNT, SIZE + , ...) + +// 3-factor product with 1 sizeof(type) or sizeof(expression), with +// redundant parens removed. +@@ +expression THING; +identifier STRIDE, COUNT; +type TYPE; +@@ + +( + kzalloc( +- sizeof(TYPE) * (COUNT) * (STRIDE) ++ array3_size(COUNT, STRIDE, sizeof(TYPE)) + , ...) +| + kzalloc( +- sizeof(TYPE) * (COUNT) * STRIDE ++ array3_size(COUNT, STRIDE, sizeof(TYPE)) + , ...) +| + kzalloc( +- sizeof(TYPE) * COUNT * (STRIDE) ++ array3_size(COUNT, STRIDE, sizeof(TYPE)) + , ...) +| + kzalloc( +- sizeof(TYPE) * COUNT * STRIDE ++ array3_size(COUNT, STRIDE, sizeof(TYPE)) + , ...) +| + kzalloc( +- sizeof(THING) * (COUNT) * (STRIDE) ++ array3_size(COUNT, STRIDE, sizeof(THING)) + , ...) +| + kzalloc( +- sizeof(THING) * (COUNT) * STRIDE ++ array3_size(COUNT, STRIDE, sizeof(THING)) + , ...) +| + kzalloc( +- sizeof(THING) * COUNT * (STRIDE) ++ array3_size(COUNT, STRIDE, sizeof(THING)) + , ...) +| + kzalloc( +- sizeof(THING) * COUNT * STRIDE ++ array3_size(COUNT, STRIDE, sizeof(THING)) + , ...) +) + +// 3-factor product with 2 sizeof(variable), with redundant parens removed. +@@ +expression THING1, THING2; +identifier COUNT; +type TYPE1, TYPE2; +@@ + +( + kzalloc( +- sizeof(TYPE1) * sizeof(TYPE2) * COUNT ++ array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2)) + , ...) +| + kzalloc( +- sizeof(TYPE1) * sizeof(THING2) * (COUNT) ++ array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2)) + , ...) +| + kzalloc( +- sizeof(THING1) * sizeof(THING2) * COUNT ++ array3_size(COUNT, sizeof(THING1), sizeof(THING2)) + , ...) +| + kzalloc( +- sizeof(THING1) * sizeof(THING2) * (COUNT) ++ array3_size(COUNT, sizeof(THING1), sizeof(THING2)) + , ...) +| + kzalloc( +- sizeof(TYPE1) * sizeof(THING2) * COUNT ++ array3_size(COUNT, sizeof(TYPE1), sizeof(THING2)) + , ...) +| + kzalloc( +- sizeof(TYPE1) * sizeof(THING2) * (COUNT) ++ array3_size(COUNT, sizeof(TYPE1), sizeof(THING2)) + , ...) +) + +// 3-factor product, only identifiers, with redundant parens removed. +@@ +identifier STRIDE, SIZE, COUNT; +@@ + +( + kzalloc( +- (COUNT) * STRIDE * SIZE ++ array3_size(COUNT, STRIDE, SIZE) + , ...) +| + kzalloc( +- COUNT * (STRIDE) * SIZE ++ array3_size(COUNT, STRIDE, SIZE) + , ...) +| + kzalloc( +- COUNT * STRIDE * (SIZE) ++ array3_size(COUNT, STRIDE, SIZE) + , ...) +| + kzalloc( +- (COUNT) * (STRIDE) * SIZE ++ array3_size(COUNT, STRIDE, SIZE) + , ...) +| + kzalloc( +- COUNT * (STRIDE) * (SIZE) ++ array3_size(COUNT, STRIDE, SIZE) + , ...) +| + kzalloc( +- (COUNT) * STRIDE * (SIZE) ++ array3_size(COUNT, STRIDE, SIZE) + , ...) +| + kzalloc( +- (COUNT) * (STRIDE) * (SIZE) ++ array3_size(COUNT, STRIDE, SIZE) + , ...) +| + kzalloc( +- COUNT * STRIDE * SIZE ++ array3_size(COUNT, STRIDE, SIZE) + , ...) +) + +// Any remaining multi-factor products, first at least 3-factor products, +// when they're not all constants... +@@ +expression E1, E2, E3; +constant C1, C2, C3; +@@ + +( + kzalloc(C1 * C2 * C3, ...) +| + kzalloc( +- (E1) * E2 * E3 ++ array3_size(E1, E2, E3) + , ...) +| + kzalloc( +- (E1) * (E2) * E3 ++ array3_size(E1, E2, E3) + , ...) +| + kzalloc( +- (E1) * (E2) * (E3) ++ array3_size(E1, E2, E3) + , ...) +| + kzalloc( +- E1 * E2 * E3 ++ array3_size(E1, E2, E3) + , ...) +) + +// And then all remaining 2 factors products when they're not all constants, +// keeping sizeof() as the second factor argument. +@@ +expression THING, E1, E2; +type TYPE; +constant C1, C2, C3; +@@ + +( + kzalloc(sizeof(THING) * C2, ...) +| + kzalloc(sizeof(TYPE) * C2, ...) +| + kzalloc(C1 * C2 * C3, ...) +| + kzalloc(C1 * C2, ...) +| +- kzalloc ++ kcalloc + ( +- sizeof(TYPE) * (E2) ++ E2, sizeof(TYPE) + , ...) +| +- kzalloc ++ kcalloc + ( +- sizeof(TYPE) * E2 ++ E2, sizeof(TYPE) + , ...) +| +- kzalloc ++ kcalloc + ( +- sizeof(THING) * (E2) ++ E2, sizeof(THING) + , ...) +| +- kzalloc ++ kcalloc + ( +- sizeof(THING) * E2 ++ E2, sizeof(THING) + , ...) +| +- kzalloc ++ kcalloc + ( +- (E1) * E2 ++ E1, E2 + , ...) +| +- kzalloc ++ kcalloc + ( +- (E1) * (E2) ++ E1, E2 + , ...) +| +- kzalloc ++ kcalloc + ( +- E1 * E2 ++ E1, E2 + , ...) +) + +Signed-off-by: Kees Cook +--- + drivers/crypto/amcc/crypto4xx_core.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -141,11 +141,11 @@ static void crypto4xx_hw_init(struct cry + + int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size) + { +- ctx->sa_in = kzalloc(size * 4, GFP_ATOMIC); ++ ctx->sa_in = kcalloc(size, 4, GFP_ATOMIC); + if (ctx->sa_in == NULL) + return -ENOMEM; + +- ctx->sa_out = kzalloc(size * 4, GFP_ATOMIC); ++ ctx->sa_out = kcalloc(size, 4, GFP_ATOMIC); + if (ctx->sa_out == NULL) { + kfree(ctx->sa_in); + ctx->sa_in = NULL; +@@ -180,8 +180,8 @@ static u32 crypto4xx_build_pdr(struct cr + if (!dev->pdr) + return -ENOMEM; + +- dev->pdr_uinfo = kzalloc(sizeof(struct pd_uinfo) * PPC4XX_NUM_PD, +- GFP_KERNEL); ++ dev->pdr_uinfo = kcalloc(PPC4XX_NUM_PD, sizeof(struct pd_uinfo), ++ GFP_KERNEL); + if (!dev->pdr_uinfo) { + dma_free_coherent(dev->core_dev->device, + sizeof(struct ce_pd) * PPC4XX_NUM_PD, diff --git a/target/linux/apm821xx/patches-4.14/023-0002-crypto-skcipher-remove-useless-setting-of-type-flags.patch b/target/linux/apm821xx/patches-4.14/023-0002-crypto-skcipher-remove-useless-setting-of-type-flags.patch new file mode 100644 index 000000000..75f0db239 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/023-0002-crypto-skcipher-remove-useless-setting-of-type-flags.patch @@ -0,0 +1,84 @@ +From 2c95e6d97892235b5b98cd4805e47fac87c2226f Mon Sep 17 00:00:00 2001 +From: Eric Biggers +Date: Sat, 30 Jun 2018 15:16:15 -0700 +Subject: [PATCH 02/15] crypto: skcipher - remove useless setting of type flags + +Some skcipher algorithms set .cra_flags = CRYPTO_ALG_TYPE_SKCIPHER. But +this is redundant with the C structure type ('struct skcipher_alg'), and +crypto_register_skcipher() already sets the type flag automatically, +clearing any type flag that was already there. Apparently the useless +assignment has just been copy+pasted around. + +So, remove the useless assignment from all the skcipher algorithms. + +This patch shouldn't change any actual behavior. + +Signed-off-by: Eric Biggers +Acked-by: Gilad Ben-Yossef +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_core.c | 18 ++++++------------ + 1 file changed, 6 insertions(+), 12 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -1132,8 +1132,7 @@ static struct crypto4xx_alg_common crypt + .cra_name = "cbc(aes)", + .cra_driver_name = "cbc-aes-ppc4xx", + .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, +- .cra_flags = CRYPTO_ALG_TYPE_SKCIPHER | +- CRYPTO_ALG_ASYNC | ++ .cra_flags = CRYPTO_ALG_ASYNC | + CRYPTO_ALG_KERN_DRIVER_ONLY, + .cra_blocksize = AES_BLOCK_SIZE, + .cra_ctxsize = sizeof(struct crypto4xx_ctx), +@@ -1153,8 +1152,7 @@ static struct crypto4xx_alg_common crypt + .cra_name = "cfb(aes)", + .cra_driver_name = "cfb-aes-ppc4xx", + .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, +- .cra_flags = CRYPTO_ALG_TYPE_SKCIPHER | +- CRYPTO_ALG_ASYNC | ++ .cra_flags = CRYPTO_ALG_ASYNC | + CRYPTO_ALG_KERN_DRIVER_ONLY, + .cra_blocksize = AES_BLOCK_SIZE, + .cra_ctxsize = sizeof(struct crypto4xx_ctx), +@@ -1174,8 +1172,7 @@ static struct crypto4xx_alg_common crypt + .cra_name = "ctr(aes)", + .cra_driver_name = "ctr-aes-ppc4xx", + .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, +- .cra_flags = CRYPTO_ALG_TYPE_SKCIPHER | +- CRYPTO_ALG_NEED_FALLBACK | ++ .cra_flags = CRYPTO_ALG_NEED_FALLBACK | + CRYPTO_ALG_ASYNC | + CRYPTO_ALG_KERN_DRIVER_ONLY, + .cra_blocksize = AES_BLOCK_SIZE, +@@ -1196,8 +1193,7 @@ static struct crypto4xx_alg_common crypt + .cra_name = "rfc3686(ctr(aes))", + .cra_driver_name = "rfc3686-ctr-aes-ppc4xx", + .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, +- .cra_flags = CRYPTO_ALG_TYPE_SKCIPHER | +- CRYPTO_ALG_ASYNC | ++ .cra_flags = CRYPTO_ALG_ASYNC | + CRYPTO_ALG_KERN_DRIVER_ONLY, + .cra_blocksize = AES_BLOCK_SIZE, + .cra_ctxsize = sizeof(struct crypto4xx_ctx), +@@ -1217,8 +1213,7 @@ static struct crypto4xx_alg_common crypt + .cra_name = "ecb(aes)", + .cra_driver_name = "ecb-aes-ppc4xx", + .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, +- .cra_flags = CRYPTO_ALG_TYPE_SKCIPHER | +- CRYPTO_ALG_ASYNC | ++ .cra_flags = CRYPTO_ALG_ASYNC | + CRYPTO_ALG_KERN_DRIVER_ONLY, + .cra_blocksize = AES_BLOCK_SIZE, + .cra_ctxsize = sizeof(struct crypto4xx_ctx), +@@ -1237,8 +1232,7 @@ static struct crypto4xx_alg_common crypt + .cra_name = "ofb(aes)", + .cra_driver_name = "ofb-aes-ppc4xx", + .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, +- .cra_flags = CRYPTO_ALG_TYPE_SKCIPHER | +- CRYPTO_ALG_ASYNC | ++ .cra_flags = CRYPTO_ALG_ASYNC | + CRYPTO_ALG_KERN_DRIVER_ONLY, + .cra_blocksize = AES_BLOCK_SIZE, + .cra_ctxsize = sizeof(struct crypto4xx_ctx), diff --git a/target/linux/apm821xx/patches-4.14/023-0003-crypto-drop-mask-CRYPTO_ALG_ASYNC-from-cipher-tfm-al.patch b/target/linux/apm821xx/patches-4.14/023-0003-crypto-drop-mask-CRYPTO_ALG_ASYNC-from-cipher-tfm-al.patch new file mode 100644 index 000000000..0c2871f37 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/023-0003-crypto-drop-mask-CRYPTO_ALG_ASYNC-from-cipher-tfm-al.patch @@ -0,0 +1,34 @@ +From 1ad0f1603a6b2afb62a1c065409aaa4e43ca7627 Mon Sep 17 00:00:00 2001 +From: Eric Biggers +Date: Wed, 14 Nov 2018 12:19:39 -0800 +Subject: [PATCH 03/15] crypto: drop mask=CRYPTO_ALG_ASYNC from 'cipher' tfm + allocations + +'cipher' algorithms (single block ciphers) are always synchronous, so +passing CRYPTO_ALG_ASYNC in the mask to crypto_alloc_cipher() has no +effect. Many users therefore already don't pass it, but some still do. +This inconsistency can cause confusion, especially since the way the +'mask' argument works is somewhat counterintuitive. + +Thus, just remove the unneeded CRYPTO_ALG_ASYNC flags. + +This patch shouldn't change any actual behavior. + +Signed-off-by: Eric Biggers +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_alg.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -520,8 +520,7 @@ static int crypto4xx_compute_gcm_hash_ke + uint8_t src[16] = { 0 }; + int rc = 0; + +- aes_tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC | +- CRYPTO_ALG_NEED_FALLBACK); ++ aes_tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_NEED_FALLBACK); + if (IS_ERR(aes_tfm)) { + rc = PTR_ERR(aes_tfm); + pr_warn("could not load aes cipher driver: %d\n", rc); diff --git a/target/linux/apm821xx/patches-4.14/023-0004-crypto4xx_core-don-t-abuse-__dma_sync_page.patch b/target/linux/apm821xx/patches-4.14/023-0004-crypto4xx_core-don-t-abuse-__dma_sync_page.patch new file mode 100644 index 000000000..635ab0037 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/023-0004-crypto4xx_core-don-t-abuse-__dma_sync_page.patch @@ -0,0 +1,30 @@ +From 67d8208fba1324fa0198f9fc58a9edbe09596947 Mon Sep 17 00:00:00 2001 +From: Christoph Hellwig +Date: Sun, 16 Dec 2018 18:19:46 +0100 +Subject: [PATCH 04/15] crypto4xx_core: don't abuse __dma_sync_page + +This function is internal to the DMA API implementation. Instead use +the DMA API to properly unmap. Note that the DMA API usage in this +driver is a disaster and urgently needs some work - it is missing all +the unmaps, seems to do a secondary map where it looks like it should +to a unmap in one place to work around cache coherency and the +directions passed in seem to be partially wrong. + +Signed-off-by: Christoph Hellwig +Tested-by: Christian Lamparter +Signed-off-by: Michael Ellerman +--- + drivers/crypto/amcc/crypto4xx_core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -596,7 +596,7 @@ static void crypto4xx_aead_done(struct c + pd->pd_ctl_len.bf.pkt_len, + dst); + } else { +- __dma_sync_page(sg_page(dst), dst->offset, dst->length, ++ dma_unmap_page(dev->core_dev->device, pd->dest, dst->length, + DMA_FROM_DEVICE); + } + diff --git a/target/linux/apm821xx/patches-4.14/023-0005-cross-tree-phase-out-dma_zalloc_coherent.patch b/target/linux/apm821xx/patches-4.14/023-0005-cross-tree-phase-out-dma_zalloc_coherent.patch new file mode 100644 index 000000000..857578bb9 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/023-0005-cross-tree-phase-out-dma_zalloc_coherent.patch @@ -0,0 +1,40 @@ +From 750afb08ca71310fcf0c4e2cb1565c63b8235b60 Mon Sep 17 00:00:00 2001 +From: Luis Chamberlain +Date: Fri, 4 Jan 2019 09:23:09 +0100 +Subject: [PATCH 05/15] cross-tree: phase out dma_zalloc_coherent() + +We already need to zero out memory for dma_alloc_coherent(), as such +using dma_zalloc_coherent() is superflous. Phase it out. + +This change was generated with the following Coccinelle SmPL patch: + +@ replace_dma_zalloc_coherent @ +expression dev, size, data, handle, flags; +@@ + +-dma_zalloc_coherent(dev, size, handle, flags) ++dma_alloc_coherent(dev, size, handle, flags) + +Suggested-by: Christoph Hellwig +Signed-off-by: Luis Chamberlain +[hch: re-ran the script on the latest tree] +Signed-off-by: Christoph Hellwig +--- + drivers/crypto/amcc/crypto4xx_core.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -283,9 +283,9 @@ static u32 crypto4xx_put_pd_to_pdr(struc + */ + static u32 crypto4xx_build_gdr(struct crypto4xx_device *dev) + { +- dev->gdr = dma_zalloc_coherent(dev->core_dev->device, +- sizeof(struct ce_gd) * PPC4XX_NUM_GD, +- &dev->gdr_pa, GFP_ATOMIC); ++ dev->gdr = dma_alloc_coherent(dev->core_dev->device, ++ sizeof(struct ce_gd) * PPC4XX_NUM_GD, ++ &dev->gdr_pa, GFP_ATOMIC); + if (!dev->gdr) + return -ENOMEM; + diff --git a/target/linux/apm821xx/patches-4.14/023-0006-crypto-crypto4xx-add-prng-crypto-support.patch b/target/linux/apm821xx/patches-4.14/023-0006-crypto-crypto4xx-add-prng-crypto-support.patch new file mode 100644 index 000000000..b20049c83 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/023-0006-crypto-crypto4xx-add-prng-crypto-support.patch @@ -0,0 +1,199 @@ +From d072bfa4885354fff86aa1fb1dbc4f1533c9e0bf Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Sun, 23 Dec 2018 02:16:13 +0100 +Subject: [PATCH 06/15] crypto: crypto4xx - add prng crypto support + +This patch adds support for crypto4xx's ANSI X9.17 Annex C compliant +pseudo random number generator which provides a pseudo random source +for the purpose of generating Initialization Vectors (IV's) for AES +algorithms to the Packet Engine and other pseudo random number +requirements. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_core.c | 87 +++++++++++++++++++++++++ + drivers/crypto/amcc/crypto4xx_core.h | 4 ++ + drivers/crypto/amcc/crypto4xx_reg_def.h | 1 + + 3 files changed, 92 insertions(+) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -40,9 +40,11 @@ + #include + #include + #include ++#include + #include + #include + #include ++#include + #include + #include "crypto4xx_reg_def.h" + #include "crypto4xx_core.h" +@@ -1035,6 +1037,10 @@ static int crypto4xx_register_alg(struct + rc = crypto_register_ahash(&alg->alg.u.hash); + break; + ++ case CRYPTO_ALG_TYPE_RNG: ++ rc = crypto_register_rng(&alg->alg.u.rng); ++ break; ++ + default: + rc = crypto_register_skcipher(&alg->alg.u.cipher); + break; +@@ -1064,6 +1070,10 @@ static void crypto4xx_unregister_alg(str + crypto_unregister_aead(&alg->alg.u.aead); + break; + ++ case CRYPTO_ALG_TYPE_RNG: ++ crypto_unregister_rng(&alg->alg.u.rng); ++ break; ++ + default: + crypto_unregister_skcipher(&alg->alg.u.cipher); + } +@@ -1122,6 +1132,69 @@ static irqreturn_t crypto4xx_ce_interrup + PPC4XX_TMO_ERR_INT); + } + ++static int ppc4xx_prng_data_read(struct crypto4xx_device *dev, ++ u8 *data, unsigned int max) ++{ ++ unsigned int i, curr = 0; ++ u32 val[2]; ++ ++ do { ++ /* trigger PRN generation */ ++ writel(PPC4XX_PRNG_CTRL_AUTO_EN, ++ dev->ce_base + CRYPTO4XX_PRNG_CTRL); ++ ++ for (i = 0; i < 1024; i++) { ++ /* usually 19 iterations are enough */ ++ if ((readl(dev->ce_base + CRYPTO4XX_PRNG_STAT) & ++ CRYPTO4XX_PRNG_STAT_BUSY)) ++ continue; ++ ++ val[0] = readl_be(dev->ce_base + CRYPTO4XX_PRNG_RES_0); ++ val[1] = readl_be(dev->ce_base + CRYPTO4XX_PRNG_RES_1); ++ break; ++ } ++ if (i == 1024) ++ return -ETIMEDOUT; ++ ++ if ((max - curr) >= 8) { ++ memcpy(data, &val, 8); ++ data += 8; ++ curr += 8; ++ } else { ++ /* copy only remaining bytes */ ++ memcpy(data, &val, max - curr); ++ break; ++ } ++ } while (curr < max); ++ ++ return curr; ++} ++ ++static int crypto4xx_prng_generate(struct crypto_rng *tfm, ++ const u8 *src, unsigned int slen, ++ u8 *dstn, unsigned int dlen) ++{ ++ struct rng_alg *alg = crypto_rng_alg(tfm); ++ struct crypto4xx_alg *amcc_alg; ++ struct crypto4xx_device *dev; ++ int ret; ++ ++ amcc_alg = container_of(alg, struct crypto4xx_alg, alg.u.rng); ++ dev = amcc_alg->dev; ++ ++ mutex_lock(&dev->core_dev->rng_lock); ++ ret = ppc4xx_prng_data_read(dev, dstn, dlen); ++ mutex_unlock(&dev->core_dev->rng_lock); ++ return ret; ++} ++ ++ ++static int crypto4xx_prng_seed(struct crypto_rng *tfm, const u8 *seed, ++ unsigned int slen) ++{ ++ return 0; ++} ++ + /** + * Supported Crypto Algorithms + */ +@@ -1291,6 +1364,18 @@ static struct crypto4xx_alg_common crypt + .cra_module = THIS_MODULE, + }, + } }, ++ { .type = CRYPTO_ALG_TYPE_RNG, .u.rng = { ++ .base = { ++ .cra_name = "stdrng", ++ .cra_driver_name = "crypto4xx_rng", ++ .cra_priority = 300, ++ .cra_ctxsize = 0, ++ .cra_module = THIS_MODULE, ++ }, ++ .generate = crypto4xx_prng_generate, ++ .seed = crypto4xx_prng_seed, ++ .seedsize = 0, ++ } }, + }; + + /** +@@ -1360,6 +1445,7 @@ static int crypto4xx_probe(struct platfo + core_dev->dev->core_dev = core_dev; + core_dev->dev->is_revb = is_revb; + core_dev->device = dev; ++ mutex_init(&core_dev->rng_lock); + spin_lock_init(&core_dev->lock); + INIT_LIST_HEAD(&core_dev->dev->alg_list); + ratelimit_default_init(&core_dev->dev->aead_ratelimit); +@@ -1439,6 +1525,7 @@ static int crypto4xx_remove(struct platf + tasklet_kill(&core_dev->tasklet); + /* Un-register with Linux CryptoAPI */ + crypto4xx_unregister_alg(core_dev->dev); ++ mutex_destroy(&core_dev->rng_lock); + /* Free all allocated memory */ + crypto4xx_stop_all(core_dev); + +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -23,8 +23,10 @@ + #define __CRYPTO4XX_CORE_H__ + + #include ++#include + #include + #include ++#include + #include + #include "crypto4xx_reg_def.h" + #include "crypto4xx_sa.h" +@@ -119,6 +121,7 @@ struct crypto4xx_core_device { + u32 irq; + struct tasklet_struct tasklet; + spinlock_t lock; ++ struct mutex rng_lock; + }; + + struct crypto4xx_ctx { +@@ -143,6 +146,7 @@ struct crypto4xx_alg_common { + struct skcipher_alg cipher; + struct ahash_alg hash; + struct aead_alg aead; ++ struct rng_alg rng; + } u; + }; + +--- a/drivers/crypto/amcc/crypto4xx_reg_def.h ++++ b/drivers/crypto/amcc/crypto4xx_reg_def.h +@@ -100,6 +100,7 @@ + #define CRYPTO4XX_ENDIAN_CFG 0x000600d8 + + #define CRYPTO4XX_PRNG_STAT 0x00070000 ++#define CRYPTO4XX_PRNG_STAT_BUSY 0x1 + #define CRYPTO4XX_PRNG_CTRL 0x00070004 + #define CRYPTO4XX_PRNG_SEED_L 0x00070008 + #define CRYPTO4XX_PRNG_SEED_H 0x0007000c diff --git a/target/linux/apm821xx/patches-4.14/023-0007-crypto-crypto4xx-Fix-wrong-ppc4xx_trng_probe-ppc4xx_.patch b/target/linux/apm821xx/patches-4.14/023-0007-crypto-crypto4xx-Fix-wrong-ppc4xx_trng_probe-ppc4xx_.patch new file mode 100644 index 000000000..d2c384882 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/023-0007-crypto-crypto4xx-Fix-wrong-ppc4xx_trng_probe-ppc4xx_.patch @@ -0,0 +1,39 @@ +From 6e88098ca43a3d80ae86908f7badba683c8a0d84 Mon Sep 17 00:00:00 2001 +From: Corentin Labbe +Date: Wed, 23 Jan 2019 11:24:18 +0000 +Subject: [PATCH 07/15] crypto: crypto4xx - Fix wrong + ppc4xx_trng_probe()/ppc4xx_trng_remove() arguments + +When building without CONFIG_HW_RANDOM_PPC4XX, I hit the following build failure: +drivers/crypto/amcc/crypto4xx_core.c: In function 'crypto4xx_probe': +drivers/crypto/amcc/crypto4xx_core.c:1407:20: error: passing argument 1 of 'ppc4xx_trng_probe' from incompatible pointer type [-Werror=incompatible-pointer-types] +In file included from drivers/crypto/amcc/crypto4xx_core.c:50:0: +drivers/crypto/amcc/crypto4xx_trng.h:28:20: note: expected 'struct crypto4xx_device *' but argument is of type 'struct crypto4xx_core_device *' +drivers/crypto/amcc/crypto4xx_core.c: In function 'crypto4xx_remove': +drivers/crypto/amcc/crypto4xx_core.c:1434:21: error: passing argument 1 of 'ppc4xx_trng_remove' from incompatible pointer type [-Werror=incompatible-pointer-types] +In file included from drivers/crypto/amcc/crypto4xx_core.c:50:0: +drivers/crypto/amcc/crypto4xx_trng.h:30:20: note: expected 'struct crypto4xx_device *' but argument is of type 'struct crypto4xx_core_device *' + +This patch fix the needed argument of ppc4xx_trng_probe()/ppc4xx_trng_remove() in that case. + +Fixes: 5343e674f32f ("crypto4xx: integrate ppc4xx-rng into crypto4xx") +Signed-off-by: Corentin Labbe +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_trng.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_trng.h ++++ b/drivers/crypto/amcc/crypto4xx_trng.h +@@ -26,9 +26,9 @@ void ppc4xx_trng_probe(struct crypto4xx_ + void ppc4xx_trng_remove(struct crypto4xx_core_device *core_dev); + #else + static inline void ppc4xx_trng_probe( +- struct crypto4xx_device *dev __maybe_unused) { } ++ struct crypto4xx_core_device *dev __maybe_unused) { } + static inline void ppc4xx_trng_remove( +- struct crypto4xx_device *dev __maybe_unused) { } ++ struct crypto4xx_core_device *dev __maybe_unused) { } + #endif + + #endif diff --git a/target/linux/apm821xx/patches-4.14/023-0013-crypto-crypto4xx-fix-AES-CTR-blocksize-value.patch b/target/linux/apm821xx/patches-4.14/023-0013-crypto-crypto4xx-fix-AES-CTR-blocksize-value.patch new file mode 100644 index 000000000..eebcd0067 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/023-0013-crypto-crypto4xx-fix-AES-CTR-blocksize-value.patch @@ -0,0 +1,60 @@ +From bfa2ba7d9e6b20aca82b99e6842fe18842ae3a0f Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 17 May 2019 23:15:57 +0200 +Subject: [PATCH 13/15] crypto: crypto4xx - fix AES CTR blocksize value + +This patch fixes a issue with crypto4xx's ctr(aes) that was +discovered by libcapi's kcapi-enc-test.sh test. + +The some of the ctr(aes) encryptions test were failing on the +non-power-of-two test: + +kcapi-enc - Error: encryption failed with error 0 +kcapi-enc - Error: decryption failed with error 0 +[FAILED: 32-bit - 5.1.0-rc1+] 15 bytes: STDIN / STDOUT enc test (128 bits): +original file (1d100e..cc96184c) and generated file (e3b0c442..1b7852b855) +[FAILED: 32-bit - 5.1.0-rc1+] 15 bytes: STDIN / STDOUT enc test (128 bits) +(openssl generated CT): original file (e3b0..5) and generated file (3..8e) +[PASSED: 32-bit - 5.1.0-rc1+] 15 bytes: STDIN / STDOUT enc test (128 bits) +(openssl generated PT) +[FAILED: 32-bit - 5.1.0-rc1+] 15 bytes: STDIN / STDOUT enc test (password): +original file (1d1..84c) and generated file (e3b..852b855) + +But the 16, 32, 512, 65536 tests always worked. + +Thankfully, this isn't a hidden hardware problem like previously, +instead this turned out to be a copy and paste issue. + +With this patch, all the tests are passing with and +kcapi-enc-test.sh gives crypto4xx's a clean bill of health: + "Number of failures: 0" :). + +Cc: stable@vger.kernel.org +Fixes: 98e87e3d933b ("crypto: crypto4xx - add aes-ctr support") +Fixes: f2a13e7cba9e ("crypto: crypto4xx - enable AES RFC3686, ECB, CFB and OFB offloads") +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_core.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -1248,7 +1248,7 @@ static struct crypto4xx_alg_common crypt + .cra_flags = CRYPTO_ALG_NEED_FALLBACK | + CRYPTO_ALG_ASYNC | + CRYPTO_ALG_KERN_DRIVER_ONLY, +- .cra_blocksize = AES_BLOCK_SIZE, ++ .cra_blocksize = 1, + .cra_ctxsize = sizeof(struct crypto4xx_ctx), + .cra_module = THIS_MODULE, + }, +@@ -1268,7 +1268,7 @@ static struct crypto4xx_alg_common crypt + .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, + .cra_flags = CRYPTO_ALG_ASYNC | + CRYPTO_ALG_KERN_DRIVER_ONLY, +- .cra_blocksize = AES_BLOCK_SIZE, ++ .cra_blocksize = 1, + .cra_ctxsize = sizeof(struct crypto4xx_ctx), + .cra_module = THIS_MODULE, + }, diff --git a/target/linux/apm821xx/patches-4.14/023-0014-crypto-crypto4xx-fix-blocksize-for-cfb-and-ofb.patch b/target/linux/apm821xx/patches-4.14/023-0014-crypto-crypto4xx-fix-blocksize-for-cfb-and-ofb.patch new file mode 100644 index 000000000..046fa6702 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/023-0014-crypto-crypto4xx-fix-blocksize-for-cfb-and-ofb.patch @@ -0,0 +1,44 @@ +From 70c4997f34b6c6888b3ac157adec49e01d0df2d5 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Sat, 18 May 2019 23:28:11 +0200 +Subject: [PATCH 14/15] crypto: crypto4xx - fix blocksize for cfb and ofb + +While the hardware consider them to be blockciphers, the +reference implementation defines them as streamciphers. + +Do the right thing and set the blocksize to 1. This +was found by CONFIG_CRYPTO_MANAGER_EXTRA_TESTS. + +This fixes the following issues: +skcipher: blocksize for ofb-aes-ppc4xx (16) doesn't match generic impl (1) +skcipher: blocksize for cfb-aes-ppc4xx (16) doesn't match generic impl (1) + +Cc: Eric Biggers +Cc: stable@vger.kernel.org +Fixes: f2a13e7cba9e ("crypto: crypto4xx - enable AES RFC3686, ECB, CFB and OFB offloads") +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_core.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -1227,7 +1227,7 @@ static struct crypto4xx_alg_common crypt + .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, + .cra_flags = CRYPTO_ALG_ASYNC | + CRYPTO_ALG_KERN_DRIVER_ONLY, +- .cra_blocksize = AES_BLOCK_SIZE, ++ .cra_blocksize = 1, + .cra_ctxsize = sizeof(struct crypto4xx_ctx), + .cra_module = THIS_MODULE, + }, +@@ -1307,7 +1307,7 @@ static struct crypto4xx_alg_common crypt + .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, + .cra_flags = CRYPTO_ALG_ASYNC | + CRYPTO_ALG_KERN_DRIVER_ONLY, +- .cra_blocksize = AES_BLOCK_SIZE, ++ .cra_blocksize = 1, + .cra_ctxsize = sizeof(struct crypto4xx_ctx), + .cra_module = THIS_MODULE, + }, diff --git a/target/linux/apm821xx/patches-4.14/023-0015-crypto-crypto4xx-block-ciphers-should-only-accept-co.patch b/target/linux/apm821xx/patches-4.14/023-0015-crypto-crypto4xx-block-ciphers-should-only-accept-co.patch new file mode 100644 index 000000000..2bb4741ef --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/023-0015-crypto-crypto4xx-block-ciphers-should-only-accept-co.patch @@ -0,0 +1,172 @@ +From 0f7a81374060828280fcfdfbaa162cb559017f9f Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Sat, 18 May 2019 23:28:12 +0200 +Subject: [PATCH 15/15] crypto: crypto4xx - block ciphers should only accept + complete blocks + +The hardware automatically zero pads incomplete block ciphers +blocks without raising any errors. This is a screw-up. This +was noticed by CONFIG_CRYPTO_MANAGER_EXTRA_TESTS tests that +sent a incomplete blocks and expect them to fail. + +This fixes: +cbc-aes-ppc4xx encryption unexpectedly succeeded on test vector +"random: len=2409 klen=32"; expected_error=-22, cfg="random: +may_sleep use_digest src_divs=[96.90%@+2295, 2.34%@+4066, +0.32%@alignmask+12, 0.34%@+4087, 0.9%@alignmask+1787, 0.1%@+3767] +iv_offset=6" + +ecb-aes-ppc4xx encryption unexpectedly succeeded on test vector +"random: len=1011 klen=32"; expected_error=-22, cfg="random: +may_sleep use_digest src_divs=[100.0%@alignmask+20] +dst_divs=[3.12%@+3001, 96.88%@+4070]" + +Cc: Eric Biggers +Cc: stable@vger.kernel.org [4.19, 5.0 and 5.1] +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_alg.c | 36 +++++++++++++++++++--------- + drivers/crypto/amcc/crypto4xx_core.c | 16 ++++++------- + drivers/crypto/amcc/crypto4xx_core.h | 10 ++++---- + 3 files changed, 39 insertions(+), 23 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -76,12 +76,16 @@ static void set_dynamic_sa_command_1(str + } + + static inline int crypto4xx_crypt(struct skcipher_request *req, +- const unsigned int ivlen, bool decrypt) ++ const unsigned int ivlen, bool decrypt, ++ bool check_blocksize) + { + struct crypto_skcipher *cipher = crypto_skcipher_reqtfm(req); + struct crypto4xx_ctx *ctx = crypto_skcipher_ctx(cipher); + __le32 iv[AES_IV_SIZE]; + ++ if (check_blocksize && !IS_ALIGNED(req->cryptlen, AES_BLOCK_SIZE)) ++ return -EINVAL; ++ + if (ivlen) + crypto4xx_memcpy_to_le32(iv, req->iv, ivlen); + +@@ -90,24 +94,34 @@ static inline int crypto4xx_crypt(struct + ctx->sa_len, 0, NULL); + } + +-int crypto4xx_encrypt_noiv(struct skcipher_request *req) ++int crypto4xx_encrypt_noiv_block(struct skcipher_request *req) ++{ ++ return crypto4xx_crypt(req, 0, false, true); ++} ++ ++int crypto4xx_encrypt_iv_stream(struct skcipher_request *req) ++{ ++ return crypto4xx_crypt(req, AES_IV_SIZE, false, false); ++} ++ ++int crypto4xx_decrypt_noiv_block(struct skcipher_request *req) + { +- return crypto4xx_crypt(req, 0, false); ++ return crypto4xx_crypt(req, 0, true, true); + } + +-int crypto4xx_encrypt_iv(struct skcipher_request *req) ++int crypto4xx_decrypt_iv_stream(struct skcipher_request *req) + { +- return crypto4xx_crypt(req, AES_IV_SIZE, false); ++ return crypto4xx_crypt(req, AES_IV_SIZE, true, false); + } + +-int crypto4xx_decrypt_noiv(struct skcipher_request *req) ++int crypto4xx_encrypt_iv_block(struct skcipher_request *req) + { +- return crypto4xx_crypt(req, 0, true); ++ return crypto4xx_crypt(req, AES_IV_SIZE, false, true); + } + +-int crypto4xx_decrypt_iv(struct skcipher_request *req) ++int crypto4xx_decrypt_iv_block(struct skcipher_request *req) + { +- return crypto4xx_crypt(req, AES_IV_SIZE, true); ++ return crypto4xx_crypt(req, AES_IV_SIZE, true, true); + } + + /** +@@ -272,8 +286,8 @@ crypto4xx_ctr_crypt(struct skcipher_requ + return ret; + } + +- return encrypt ? crypto4xx_encrypt_iv(req) +- : crypto4xx_decrypt_iv(req); ++ return encrypt ? crypto4xx_encrypt_iv_stream(req) ++ : crypto4xx_decrypt_iv_stream(req); + } + + static int crypto4xx_sk_setup_fallback(struct crypto4xx_ctx *ctx, +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -1215,8 +1215,8 @@ static struct crypto4xx_alg_common crypt + .max_keysize = AES_MAX_KEY_SIZE, + .ivsize = AES_IV_SIZE, + .setkey = crypto4xx_setkey_aes_cbc, +- .encrypt = crypto4xx_encrypt_iv, +- .decrypt = crypto4xx_decrypt_iv, ++ .encrypt = crypto4xx_encrypt_iv_block, ++ .decrypt = crypto4xx_decrypt_iv_block, + .init = crypto4xx_sk_init, + .exit = crypto4xx_sk_exit, + } }, +@@ -1235,8 +1235,8 @@ static struct crypto4xx_alg_common crypt + .max_keysize = AES_MAX_KEY_SIZE, + .ivsize = AES_IV_SIZE, + .setkey = crypto4xx_setkey_aes_cfb, +- .encrypt = crypto4xx_encrypt_iv, +- .decrypt = crypto4xx_decrypt_iv, ++ .encrypt = crypto4xx_encrypt_iv_stream, ++ .decrypt = crypto4xx_decrypt_iv_stream, + .init = crypto4xx_sk_init, + .exit = crypto4xx_sk_exit, + } }, +@@ -1295,8 +1295,8 @@ static struct crypto4xx_alg_common crypt + .min_keysize = AES_MIN_KEY_SIZE, + .max_keysize = AES_MAX_KEY_SIZE, + .setkey = crypto4xx_setkey_aes_ecb, +- .encrypt = crypto4xx_encrypt_noiv, +- .decrypt = crypto4xx_decrypt_noiv, ++ .encrypt = crypto4xx_encrypt_noiv_block, ++ .decrypt = crypto4xx_decrypt_noiv_block, + .init = crypto4xx_sk_init, + .exit = crypto4xx_sk_exit, + } }, +@@ -1315,8 +1315,8 @@ static struct crypto4xx_alg_common crypt + .max_keysize = AES_MAX_KEY_SIZE, + .ivsize = AES_IV_SIZE, + .setkey = crypto4xx_setkey_aes_ofb, +- .encrypt = crypto4xx_encrypt_iv, +- .decrypt = crypto4xx_decrypt_iv, ++ .encrypt = crypto4xx_encrypt_iv_stream, ++ .decrypt = crypto4xx_decrypt_iv_stream, + .init = crypto4xx_sk_init, + .exit = crypto4xx_sk_exit, + } }, +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -183,10 +183,12 @@ int crypto4xx_setkey_rfc3686(struct cryp + const u8 *key, unsigned int keylen); + int crypto4xx_encrypt_ctr(struct skcipher_request *req); + int crypto4xx_decrypt_ctr(struct skcipher_request *req); +-int crypto4xx_encrypt_iv(struct skcipher_request *req); +-int crypto4xx_decrypt_iv(struct skcipher_request *req); +-int crypto4xx_encrypt_noiv(struct skcipher_request *req); +-int crypto4xx_decrypt_noiv(struct skcipher_request *req); ++int crypto4xx_encrypt_iv_stream(struct skcipher_request *req); ++int crypto4xx_decrypt_iv_stream(struct skcipher_request *req); ++int crypto4xx_encrypt_iv_block(struct skcipher_request *req); ++int crypto4xx_decrypt_iv_block(struct skcipher_request *req); ++int crypto4xx_encrypt_noiv_block(struct skcipher_request *req); ++int crypto4xx_decrypt_noiv_block(struct skcipher_request *req); + int crypto4xx_rfc3686_encrypt(struct skcipher_request *req); + int crypto4xx_rfc3686_decrypt(struct skcipher_request *req); + int crypto4xx_sha1_alg_init(struct crypto_tfm *tfm); diff --git a/target/linux/apm821xx/patches-4.14/100-powerpc-4xx-uic-clear-pending-interrupt-after-irq-ty.patch b/target/linux/apm821xx/patches-4.14/100-powerpc-4xx-uic-clear-pending-interrupt-after-irq-ty.patch new file mode 100644 index 000000000..ee4eeb696 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/100-powerpc-4xx-uic-clear-pending-interrupt-after-irq-ty.patch @@ -0,0 +1,30 @@ +From 9b84ad676e248a3e3c81db7f5d39e1739b3780aa Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Sat, 15 Jun 2019 16:35:26 +0200 +Subject: [PATCH] powerpc/4xx/uic: clear pending interrupt after irq type/pol + change + +When testing out gpio-keys with a button, a spurious +interrupt (and therefore a key press or release event) +gets triggered as soon as the driver enables the irq +line for the first time. + +This patch clears any potential bogus generated interrupt +that was caused by the switching of the associated irq's +type and polarity. + +Signed-off-by: Christian Lamparter +--- + arch/powerpc/platforms/4xx/uic.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/powerpc/platforms/4xx/uic.c ++++ b/arch/powerpc/platforms/4xx/uic.c +@@ -158,6 +158,7 @@ static int uic_set_irq_type(struct irq_d + + mtdcr(uic->dcrbase + UIC_PR, pr); + mtdcr(uic->dcrbase + UIC_TR, tr); ++ mtdcr(uic->dcrbase + UIC_SR, ~mask); + + raw_spin_unlock_irqrestore(&uic->lock, flags); + diff --git a/target/linux/apm821xx/patches-4.14/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch b/target/linux/apm821xx/patches-4.14/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch index 41f9c8ac7..ca7ae3bbd 100644 --- a/target/linux/apm821xx/patches-4.14/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch +++ b/target/linux/apm821xx/patches-4.14/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch @@ -521,7 +521,7 @@ Signed-off-by: Christian Lamparter + + default: + return retval; -+ }; ++ } + driver = (struct hc_driver *)id->driver_data; diff --git a/target/linux/apm821xx/patches-4.19/023-0003-crypto-drop-mask-CRYPTO_ALG_ASYNC-from-cipher-tfm-al.patch b/target/linux/apm821xx/patches-4.19/023-0003-crypto-drop-mask-CRYPTO_ALG_ASYNC-from-cipher-tfm-al.patch new file mode 100644 index 000000000..36aeb33d5 --- /dev/null +++ b/target/linux/apm821xx/patches-4.19/023-0003-crypto-drop-mask-CRYPTO_ALG_ASYNC-from-cipher-tfm-al.patch @@ -0,0 +1,34 @@ +From 1ad0f1603a6b2afb62a1c065409aaa4e43ca7627 Mon Sep 17 00:00:00 2001 +From: Eric Biggers +Date: Wed, 14 Nov 2018 12:19:39 -0800 +Subject: [PATCH 03/15] crypto: drop mask=CRYPTO_ALG_ASYNC from 'cipher' tfm + allocations + +'cipher' algorithms (single block ciphers) are always synchronous, so +passing CRYPTO_ALG_ASYNC in the mask to crypto_alloc_cipher() has no +effect. Many users therefore already don't pass it, but some still do. +This inconsistency can cause confusion, especially since the way the +'mask' argument works is somewhat counterintuitive. + +Thus, just remove the unneeded CRYPTO_ALG_ASYNC flags. + +This patch shouldn't change any actual behavior. + +Signed-off-by: Eric Biggers +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_alg.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -540,8 +540,7 @@ static int crypto4xx_compute_gcm_hash_ke + uint8_t src[16] = { 0 }; + int rc = 0; + +- aes_tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC | +- CRYPTO_ALG_NEED_FALLBACK); ++ aes_tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_NEED_FALLBACK); + if (IS_ERR(aes_tfm)) { + rc = PTR_ERR(aes_tfm); + pr_warn("could not load aes cipher driver: %d\n", rc); diff --git a/target/linux/apm821xx/patches-4.19/023-0004-crypto4xx_core-don-t-abuse-__dma_sync_page.patch b/target/linux/apm821xx/patches-4.19/023-0004-crypto4xx_core-don-t-abuse-__dma_sync_page.patch new file mode 100644 index 000000000..635ab0037 --- /dev/null +++ b/target/linux/apm821xx/patches-4.19/023-0004-crypto4xx_core-don-t-abuse-__dma_sync_page.patch @@ -0,0 +1,30 @@ +From 67d8208fba1324fa0198f9fc58a9edbe09596947 Mon Sep 17 00:00:00 2001 +From: Christoph Hellwig +Date: Sun, 16 Dec 2018 18:19:46 +0100 +Subject: [PATCH 04/15] crypto4xx_core: don't abuse __dma_sync_page + +This function is internal to the DMA API implementation. Instead use +the DMA API to properly unmap. Note that the DMA API usage in this +driver is a disaster and urgently needs some work - it is missing all +the unmaps, seems to do a secondary map where it looks like it should +to a unmap in one place to work around cache coherency and the +directions passed in seem to be partially wrong. + +Signed-off-by: Christoph Hellwig +Tested-by: Christian Lamparter +Signed-off-by: Michael Ellerman +--- + drivers/crypto/amcc/crypto4xx_core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -596,7 +596,7 @@ static void crypto4xx_aead_done(struct c + pd->pd_ctl_len.bf.pkt_len, + dst); + } else { +- __dma_sync_page(sg_page(dst), dst->offset, dst->length, ++ dma_unmap_page(dev->core_dev->device, pd->dest, dst->length, + DMA_FROM_DEVICE); + } + diff --git a/target/linux/apm821xx/patches-4.19/023-0005-cross-tree-phase-out-dma_zalloc_coherent.patch b/target/linux/apm821xx/patches-4.19/023-0005-cross-tree-phase-out-dma_zalloc_coherent.patch new file mode 100644 index 000000000..857578bb9 --- /dev/null +++ b/target/linux/apm821xx/patches-4.19/023-0005-cross-tree-phase-out-dma_zalloc_coherent.patch @@ -0,0 +1,40 @@ +From 750afb08ca71310fcf0c4e2cb1565c63b8235b60 Mon Sep 17 00:00:00 2001 +From: Luis Chamberlain +Date: Fri, 4 Jan 2019 09:23:09 +0100 +Subject: [PATCH 05/15] cross-tree: phase out dma_zalloc_coherent() + +We already need to zero out memory for dma_alloc_coherent(), as such +using dma_zalloc_coherent() is superflous. Phase it out. + +This change was generated with the following Coccinelle SmPL patch: + +@ replace_dma_zalloc_coherent @ +expression dev, size, data, handle, flags; +@@ + +-dma_zalloc_coherent(dev, size, handle, flags) ++dma_alloc_coherent(dev, size, handle, flags) + +Suggested-by: Christoph Hellwig +Signed-off-by: Luis Chamberlain +[hch: re-ran the script on the latest tree] +Signed-off-by: Christoph Hellwig +--- + drivers/crypto/amcc/crypto4xx_core.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -283,9 +283,9 @@ static u32 crypto4xx_put_pd_to_pdr(struc + */ + static u32 crypto4xx_build_gdr(struct crypto4xx_device *dev) + { +- dev->gdr = dma_zalloc_coherent(dev->core_dev->device, +- sizeof(struct ce_gd) * PPC4XX_NUM_GD, +- &dev->gdr_pa, GFP_ATOMIC); ++ dev->gdr = dma_alloc_coherent(dev->core_dev->device, ++ sizeof(struct ce_gd) * PPC4XX_NUM_GD, ++ &dev->gdr_pa, GFP_ATOMIC); + if (!dev->gdr) + return -ENOMEM; + diff --git a/target/linux/apm821xx/patches-4.19/023-0006-crypto-crypto4xx-add-prng-crypto-support.patch b/target/linux/apm821xx/patches-4.19/023-0006-crypto-crypto4xx-add-prng-crypto-support.patch new file mode 100644 index 000000000..ba4419787 --- /dev/null +++ b/target/linux/apm821xx/patches-4.19/023-0006-crypto-crypto4xx-add-prng-crypto-support.patch @@ -0,0 +1,199 @@ +From d072bfa4885354fff86aa1fb1dbc4f1533c9e0bf Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Sun, 23 Dec 2018 02:16:13 +0100 +Subject: [PATCH 06/15] crypto: crypto4xx - add prng crypto support + +This patch adds support for crypto4xx's ANSI X9.17 Annex C compliant +pseudo random number generator which provides a pseudo random source +for the purpose of generating Initialization Vectors (IV's) for AES +algorithms to the Packet Engine and other pseudo random number +requirements. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_core.c | 87 +++++++++++++++++++++++++ + drivers/crypto/amcc/crypto4xx_core.h | 4 ++ + drivers/crypto/amcc/crypto4xx_reg_def.h | 1 + + 3 files changed, 92 insertions(+) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -40,9 +40,11 @@ + #include + #include + #include ++#include + #include + #include + #include ++#include + #include + #include "crypto4xx_reg_def.h" + #include "crypto4xx_core.h" +@@ -1046,6 +1048,10 @@ static int crypto4xx_register_alg(struct + rc = crypto_register_ahash(&alg->alg.u.hash); + break; + ++ case CRYPTO_ALG_TYPE_RNG: ++ rc = crypto_register_rng(&alg->alg.u.rng); ++ break; ++ + default: + rc = crypto_register_skcipher(&alg->alg.u.cipher); + break; +@@ -1075,6 +1081,10 @@ static void crypto4xx_unregister_alg(str + crypto_unregister_aead(&alg->alg.u.aead); + break; + ++ case CRYPTO_ALG_TYPE_RNG: ++ crypto_unregister_rng(&alg->alg.u.rng); ++ break; ++ + default: + crypto_unregister_skcipher(&alg->alg.u.cipher); + } +@@ -1133,6 +1143,69 @@ static irqreturn_t crypto4xx_ce_interrup + PPC4XX_TMO_ERR_INT); + } + ++static int ppc4xx_prng_data_read(struct crypto4xx_device *dev, ++ u8 *data, unsigned int max) ++{ ++ unsigned int i, curr = 0; ++ u32 val[2]; ++ ++ do { ++ /* trigger PRN generation */ ++ writel(PPC4XX_PRNG_CTRL_AUTO_EN, ++ dev->ce_base + CRYPTO4XX_PRNG_CTRL); ++ ++ for (i = 0; i < 1024; i++) { ++ /* usually 19 iterations are enough */ ++ if ((readl(dev->ce_base + CRYPTO4XX_PRNG_STAT) & ++ CRYPTO4XX_PRNG_STAT_BUSY)) ++ continue; ++ ++ val[0] = readl_be(dev->ce_base + CRYPTO4XX_PRNG_RES_0); ++ val[1] = readl_be(dev->ce_base + CRYPTO4XX_PRNG_RES_1); ++ break; ++ } ++ if (i == 1024) ++ return -ETIMEDOUT; ++ ++ if ((max - curr) >= 8) { ++ memcpy(data, &val, 8); ++ data += 8; ++ curr += 8; ++ } else { ++ /* copy only remaining bytes */ ++ memcpy(data, &val, max - curr); ++ break; ++ } ++ } while (curr < max); ++ ++ return curr; ++} ++ ++static int crypto4xx_prng_generate(struct crypto_rng *tfm, ++ const u8 *src, unsigned int slen, ++ u8 *dstn, unsigned int dlen) ++{ ++ struct rng_alg *alg = crypto_rng_alg(tfm); ++ struct crypto4xx_alg *amcc_alg; ++ struct crypto4xx_device *dev; ++ int ret; ++ ++ amcc_alg = container_of(alg, struct crypto4xx_alg, alg.u.rng); ++ dev = amcc_alg->dev; ++ ++ mutex_lock(&dev->core_dev->rng_lock); ++ ret = ppc4xx_prng_data_read(dev, dstn, dlen); ++ mutex_unlock(&dev->core_dev->rng_lock); ++ return ret; ++} ++ ++ ++static int crypto4xx_prng_seed(struct crypto_rng *tfm, const u8 *seed, ++ unsigned int slen) ++{ ++ return 0; ++} ++ + /** + * Supported Crypto Algorithms + */ +@@ -1302,6 +1375,18 @@ static struct crypto4xx_alg_common crypt + .cra_module = THIS_MODULE, + }, + } }, ++ { .type = CRYPTO_ALG_TYPE_RNG, .u.rng = { ++ .base = { ++ .cra_name = "stdrng", ++ .cra_driver_name = "crypto4xx_rng", ++ .cra_priority = 300, ++ .cra_ctxsize = 0, ++ .cra_module = THIS_MODULE, ++ }, ++ .generate = crypto4xx_prng_generate, ++ .seed = crypto4xx_prng_seed, ++ .seedsize = 0, ++ } }, + }; + + /** +@@ -1371,6 +1456,7 @@ static int crypto4xx_probe(struct platfo + core_dev->dev->core_dev = core_dev; + core_dev->dev->is_revb = is_revb; + core_dev->device = dev; ++ mutex_init(&core_dev->rng_lock); + spin_lock_init(&core_dev->lock); + INIT_LIST_HEAD(&core_dev->dev->alg_list); + ratelimit_default_init(&core_dev->dev->aead_ratelimit); +@@ -1450,6 +1536,7 @@ static int crypto4xx_remove(struct platf + tasklet_kill(&core_dev->tasklet); + /* Un-register with Linux CryptoAPI */ + crypto4xx_unregister_alg(core_dev->dev); ++ mutex_destroy(&core_dev->rng_lock); + /* Free all allocated memory */ + crypto4xx_stop_all(core_dev); + +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -23,8 +23,10 @@ + #define __CRYPTO4XX_CORE_H__ + + #include ++#include + #include + #include ++#include + #include + #include "crypto4xx_reg_def.h" + #include "crypto4xx_sa.h" +@@ -119,6 +121,7 @@ struct crypto4xx_core_device { + u32 irq; + struct tasklet_struct tasklet; + spinlock_t lock; ++ struct mutex rng_lock; + }; + + struct crypto4xx_ctx { +@@ -143,6 +146,7 @@ struct crypto4xx_alg_common { + struct skcipher_alg cipher; + struct ahash_alg hash; + struct aead_alg aead; ++ struct rng_alg rng; + } u; + }; + +--- a/drivers/crypto/amcc/crypto4xx_reg_def.h ++++ b/drivers/crypto/amcc/crypto4xx_reg_def.h +@@ -100,6 +100,7 @@ + #define CRYPTO4XX_ENDIAN_CFG 0x000600d8 + + #define CRYPTO4XX_PRNG_STAT 0x00070000 ++#define CRYPTO4XX_PRNG_STAT_BUSY 0x1 + #define CRYPTO4XX_PRNG_CTRL 0x00070004 + #define CRYPTO4XX_PRNG_SEED_L 0x00070008 + #define CRYPTO4XX_PRNG_SEED_H 0x0007000c diff --git a/target/linux/apm821xx/patches-4.19/023-0007-crypto-crypto4xx-Fix-wrong-ppc4xx_trng_probe-ppc4xx_.patch b/target/linux/apm821xx/patches-4.19/023-0007-crypto-crypto4xx-Fix-wrong-ppc4xx_trng_probe-ppc4xx_.patch new file mode 100644 index 000000000..d2c384882 --- /dev/null +++ b/target/linux/apm821xx/patches-4.19/023-0007-crypto-crypto4xx-Fix-wrong-ppc4xx_trng_probe-ppc4xx_.patch @@ -0,0 +1,39 @@ +From 6e88098ca43a3d80ae86908f7badba683c8a0d84 Mon Sep 17 00:00:00 2001 +From: Corentin Labbe +Date: Wed, 23 Jan 2019 11:24:18 +0000 +Subject: [PATCH 07/15] crypto: crypto4xx - Fix wrong + ppc4xx_trng_probe()/ppc4xx_trng_remove() arguments + +When building without CONFIG_HW_RANDOM_PPC4XX, I hit the following build failure: +drivers/crypto/amcc/crypto4xx_core.c: In function 'crypto4xx_probe': +drivers/crypto/amcc/crypto4xx_core.c:1407:20: error: passing argument 1 of 'ppc4xx_trng_probe' from incompatible pointer type [-Werror=incompatible-pointer-types] +In file included from drivers/crypto/amcc/crypto4xx_core.c:50:0: +drivers/crypto/amcc/crypto4xx_trng.h:28:20: note: expected 'struct crypto4xx_device *' but argument is of type 'struct crypto4xx_core_device *' +drivers/crypto/amcc/crypto4xx_core.c: In function 'crypto4xx_remove': +drivers/crypto/amcc/crypto4xx_core.c:1434:21: error: passing argument 1 of 'ppc4xx_trng_remove' from incompatible pointer type [-Werror=incompatible-pointer-types] +In file included from drivers/crypto/amcc/crypto4xx_core.c:50:0: +drivers/crypto/amcc/crypto4xx_trng.h:30:20: note: expected 'struct crypto4xx_device *' but argument is of type 'struct crypto4xx_core_device *' + +This patch fix the needed argument of ppc4xx_trng_probe()/ppc4xx_trng_remove() in that case. + +Fixes: 5343e674f32f ("crypto4xx: integrate ppc4xx-rng into crypto4xx") +Signed-off-by: Corentin Labbe +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_trng.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_trng.h ++++ b/drivers/crypto/amcc/crypto4xx_trng.h +@@ -26,9 +26,9 @@ void ppc4xx_trng_probe(struct crypto4xx_ + void ppc4xx_trng_remove(struct crypto4xx_core_device *core_dev); + #else + static inline void ppc4xx_trng_probe( +- struct crypto4xx_device *dev __maybe_unused) { } ++ struct crypto4xx_core_device *dev __maybe_unused) { } + static inline void ppc4xx_trng_remove( +- struct crypto4xx_device *dev __maybe_unused) { } ++ struct crypto4xx_core_device *dev __maybe_unused) { } + #endif + + #endif diff --git a/target/linux/apm821xx/patches-4.19/023-0012-crypto-crypto4xx-get-rid-of-redundant-using_sd-varia.patch b/target/linux/apm821xx/patches-4.19/023-0012-crypto-crypto4xx-get-rid-of-redundant-using_sd-varia.patch new file mode 100644 index 000000000..4b246a793 --- /dev/null +++ b/target/linux/apm821xx/patches-4.19/023-0012-crypto-crypto4xx-get-rid-of-redundant-using_sd-varia.patch @@ -0,0 +1,63 @@ +From 38cf5533d7a876f75088bacc1277046f30005f28 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Mon, 22 Apr 2019 13:26:01 +0200 +Subject: [PATCH 12/15] crypto: crypto4xx - get rid of redundant using_sd + variable + +using_sd is used as a stand-in for sa_command_0.bf.scatter +that we need to set anyway, so we might as well just prevent +double-accounting. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_core.c | 6 ++---- + drivers/crypto/amcc/crypto4xx_core.h | 1 - + 2 files changed, 2 insertions(+), 5 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -539,7 +539,7 @@ static void crypto4xx_cipher_done(struct + + req = skcipher_request_cast(pd_uinfo->async_req); + +- if (pd_uinfo->using_sd) { ++ if (pd_uinfo->sa_va->sa_command_0.bf.scatter) { + crypto4xx_copy_pkt_to_dst(dev, pd, pd_uinfo, + req->cryptlen, req->dst); + } else { +@@ -593,7 +593,7 @@ static void crypto4xx_aead_done(struct c + u32 icv[AES_BLOCK_SIZE]; + int err = 0; + +- if (pd_uinfo->using_sd) { ++ if (pd_uinfo->sa_va->sa_command_0.bf.scatter) { + crypto4xx_copy_pkt_to_dst(dev, pd, pd_uinfo, + pd->pd_ctl_len.bf.pkt_len, + dst); +@@ -887,7 +887,6 @@ int crypto4xx_build_pd(struct crypto_asy + * we know application give us dst a whole piece of memory + * no need to use scatter ring. + */ +- pd_uinfo->using_sd = 0; + pd_uinfo->first_sd = 0xffffffff; + sa->sa_command_0.bf.scatter = 0; + pd->dest = (u32)dma_map_page(dev->core_dev->device, +@@ -901,7 +900,6 @@ int crypto4xx_build_pd(struct crypto_asy + u32 sd_idx = fst_sd; + nbytes = datalen; + sa->sa_command_0.bf.scatter = 1; +- pd_uinfo->using_sd = 1; + pd_uinfo->first_sd = fst_sd; + sd = crypto4xx_get_sdp(dev, &sd_dma, sd_idx); + pd->dest = sd_dma; +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -64,7 +64,6 @@ union shadow_sa_buf { + struct pd_uinfo { + struct crypto4xx_device *dev; + u32 state; +- u32 using_sd; + u32 first_gd; /* first gather discriptor + used by this packet */ + u32 num_gd; /* number of gather discriptor diff --git a/target/linux/apm821xx/patches-4.19/100-powerpc-4xx-uic-clear-pending-interrupt-after-irq-ty.patch b/target/linux/apm821xx/patches-4.19/100-powerpc-4xx-uic-clear-pending-interrupt-after-irq-ty.patch new file mode 100644 index 000000000..ee4eeb696 --- /dev/null +++ b/target/linux/apm821xx/patches-4.19/100-powerpc-4xx-uic-clear-pending-interrupt-after-irq-ty.patch @@ -0,0 +1,30 @@ +From 9b84ad676e248a3e3c81db7f5d39e1739b3780aa Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Sat, 15 Jun 2019 16:35:26 +0200 +Subject: [PATCH] powerpc/4xx/uic: clear pending interrupt after irq type/pol + change + +When testing out gpio-keys with a button, a spurious +interrupt (and therefore a key press or release event) +gets triggered as soon as the driver enables the irq +line for the first time. + +This patch clears any potential bogus generated interrupt +that was caused by the switching of the associated irq's +type and polarity. + +Signed-off-by: Christian Lamparter +--- + arch/powerpc/platforms/4xx/uic.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/powerpc/platforms/4xx/uic.c ++++ b/arch/powerpc/platforms/4xx/uic.c +@@ -158,6 +158,7 @@ static int uic_set_irq_type(struct irq_d + + mtdcr(uic->dcrbase + UIC_PR, pr); + mtdcr(uic->dcrbase + UIC_TR, tr); ++ mtdcr(uic->dcrbase + UIC_SR, ~mask); + + raw_spin_unlock_irqrestore(&uic->lock, flags); + diff --git a/target/linux/apm821xx/patches-4.19/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch b/target/linux/apm821xx/patches-4.19/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch index 2c4996278..6db2f2ec2 100644 --- a/target/linux/apm821xx/patches-4.19/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch +++ b/target/linux/apm821xx/patches-4.19/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch @@ -521,7 +521,7 @@ Signed-off-by: Christian Lamparter + + default: + return retval; -+ }; ++ } + driver = (struct hc_driver *)id->driver_data; diff --git a/target/linux/ar7/patches-4.9/300-add-ac49x-platform.patch b/target/linux/ar7/patches-4.9/300-add-ac49x-platform.patch index 583f6bcca..ed1a81424 100644 --- a/target/linux/ar7/patches-4.9/300-add-ac49x-platform.patch +++ b/target/linux/ar7/patches-4.9/300-add-ac49x-platform.patch @@ -37,7 +37,7 @@ #define AR7_IRQ_UART0 15 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -161,7 +161,7 @@ config AR7 +@@ -162,7 +162,7 @@ config AR7 select HAVE_CLK help Support for the Texas Instruments AR7 System-on-a-Chip @@ -46,7 +46,7 @@ config ATH25 bool "Atheros AR231x/AR531x SoC support" -@@ -1008,6 +1008,7 @@ config MIPS_PARAVIRT +@@ -1009,6 +1009,7 @@ config MIPS_PARAVIRT endchoice source "arch/mips/alchemy/Kconfig" diff --git a/target/linux/brcm2708/patches-4.14/950-0132-mcp2515-Use-DT-supplied-interrupt-flags.patch b/target/linux/brcm2708/patches-4.14/950-0132-mcp2515-Use-DT-supplied-interrupt-flags.patch index 31942750c..bb87c97c6 100644 --- a/target/linux/brcm2708/patches-4.14/950-0132-mcp2515-Use-DT-supplied-interrupt-flags.patch +++ b/target/linux/brcm2708/patches-4.14/950-0132-mcp2515-Use-DT-supplied-interrupt-flags.patch @@ -24,7 +24,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/can/spi/mcp251x.c +++ b/drivers/net/can/spi/mcp251x.c -@@ -952,6 +952,9 @@ static int mcp251x_open(struct net_devic +@@ -951,6 +951,9 @@ static int mcp251x_open(struct net_devic priv->tx_skb = NULL; priv->tx_len = 0; diff --git a/target/linux/brcm2708/patches-4.14/950-0315-usb-gadget-ethernet-Re-enable-Jumbo-frames.patch b/target/linux/brcm2708/patches-4.14/950-0315-usb-gadget-ethernet-Re-enable-Jumbo-frames.patch index 6442338a6..8875a8ac3 100644 --- a/target/linux/brcm2708/patches-4.14/950-0315-usb-gadget-ethernet-Re-enable-Jumbo-frames.patch +++ b/target/linux/brcm2708/patches-4.14/950-0315-usb-gadget-ethernet-Re-enable-Jumbo-frames.patch @@ -18,7 +18,7 @@ Signed-off-by: Felipe Balbi --- a/drivers/usb/gadget/function/u_ether.c +++ b/drivers/usb/gadget/function/u_ether.c -@@ -848,6 +848,10 @@ struct net_device *gether_setup_name_def +@@ -850,6 +850,10 @@ struct net_device *gether_setup_name_def net->ethtool_ops = &ops; SET_NETDEV_DEVTYPE(net, &gadget_type); diff --git a/target/linux/brcm2708/patches-4.19/950-0040-Add-dwc_otg-driver.patch b/target/linux/brcm2708/patches-4.19/950-0040-Add-dwc_otg-driver.patch index 8f0fe5596..d32a187b8 100644 --- a/target/linux/brcm2708/patches-4.19/950-0040-Add-dwc_otg-driver.patch +++ b/target/linux/brcm2708/patches-4.19/950-0040-Add-dwc_otg-driver.patch @@ -917,7 +917,7 @@ Fixes https://github.com/raspberrypi/linux/issues/2408 } --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c -@@ -5207,7 +5207,7 @@ static void port_event(struct usb_hub *h +@@ -5210,7 +5210,7 @@ static void port_event(struct usb_hub *h u16 status = 0, unused; port_dev->over_current_count++; diff --git a/target/linux/brcm2708/patches-4.19/950-0104-mcp2515-Use-DT-supplied-interrupt-flags.patch b/target/linux/brcm2708/patches-4.19/950-0104-mcp2515-Use-DT-supplied-interrupt-flags.patch index 14fe56797..51add3163 100644 --- a/target/linux/brcm2708/patches-4.19/950-0104-mcp2515-Use-DT-supplied-interrupt-flags.patch +++ b/target/linux/brcm2708/patches-4.19/950-0104-mcp2515-Use-DT-supplied-interrupt-flags.patch @@ -24,7 +24,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/can/spi/mcp251x.c +++ b/drivers/net/can/spi/mcp251x.c -@@ -951,6 +951,9 @@ static int mcp251x_open(struct net_devic +@@ -950,6 +950,9 @@ static int mcp251x_open(struct net_devic priv->tx_skb = NULL; priv->tx_len = 0; diff --git a/target/linux/brcm2708/patches-4.19/950-0129-gpiolib-Don-t-prevent-IRQ-usage-of-output-GPIOs.patch b/target/linux/brcm2708/patches-4.19/950-0129-gpiolib-Don-t-prevent-IRQ-usage-of-output-GPIOs.patch index 56d83405a..08c38d743 100644 --- a/target/linux/brcm2708/patches-4.19/950-0129-gpiolib-Don-t-prevent-IRQ-usage-of-output-GPIOs.patch +++ b/target/linux/brcm2708/patches-4.19/950-0129-gpiolib-Don-t-prevent-IRQ-usage-of-output-GPIOs.patch @@ -35,7 +35,7 @@ Signed-off-by: Phil Elwell gpiod_err(desc, "%s: tried to set a GPIO tied to an IRQ as output\n", __func__); -@@ -3311,7 +3313,7 @@ int gpiochip_lock_as_irq(struct gpio_chi +@@ -3312,7 +3314,7 @@ int gpiochip_lock_as_irq(struct gpio_chi } } diff --git a/target/linux/brcm2708/patches-4.19/950-0168-HID-hid-bigbenff-driver-for-BigBen-Interactive-PS3OF.patch b/target/linux/brcm2708/patches-4.19/950-0168-HID-hid-bigbenff-driver-for-BigBen-Interactive-PS3OF.patch index f24990970..840969667 100644 --- a/target/linux/brcm2708/patches-4.19/950-0168-HID-hid-bigbenff-driver-for-BigBen-Interactive-PS3OF.patch +++ b/target/linux/brcm2708/patches-4.19/950-0168-HID-hid-bigbenff-driver-for-BigBen-Interactive-PS3OF.patch @@ -472,7 +472,7 @@ Signed-off-by: Jiri Kosina +MODULE_LICENSE("GPL"); --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h -@@ -232,6 +232,9 @@ +@@ -233,6 +233,9 @@ #define USB_VENDOR_ID_BETOP_2185V2PC 0x8380 #define USB_VENDOR_ID_BETOP_2185V2BFM 0x20bc diff --git a/target/linux/brcm2708/patches-4.19/950-0228-staging-bcm2835-camera-Move-module-info-to-the-end.patch b/target/linux/brcm2708/patches-4.19/950-0228-staging-bcm2835-camera-Move-module-info-to-the-end.patch index d743c6a99..d3212a006 100644 --- a/target/linux/brcm2708/patches-4.19/950-0228-staging-bcm2835-camera-Move-module-info-to-the-end.patch +++ b/target/linux/brcm2708/patches-4.19/950-0228-staging-bcm2835-camera-Move-module-info-to-the-end.patch @@ -26,7 +26,7 @@ Signed-off-by: Stefan Wahren int bcm2835_v4l2_debug; module_param_named(debug, bcm2835_v4l2_debug, int, 0644); MODULE_PARM_DESC(bcm2835_v4l2_debug, "Debug level 0-2"); -@@ -1967,3 +1961,9 @@ static struct platform_driver bcm2835_ca +@@ -1980,3 +1974,9 @@ static struct platform_driver bcm2835_ca }; module_platform_driver(bcm2835_camera_driver) diff --git a/target/linux/brcm2708/patches-4.19/950-0235-staging-bcm2835-camera-Provide-more-specific-probe-e.patch b/target/linux/brcm2708/patches-4.19/950-0235-staging-bcm2835-camera-Provide-more-specific-probe-e.patch index e8e3c311e..c346816db 100644 --- a/target/linux/brcm2708/patches-4.19/950-0235-staging-bcm2835-camera-Provide-more-specific-probe-e.patch +++ b/target/linux/brcm2708/patches-4.19/950-0235-staging-bcm2835-camera-Provide-more-specific-probe-e.patch @@ -15,7 +15,7 @@ Signed-off-by: Stefan Wahren --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c -@@ -1539,8 +1539,11 @@ static int mmal_init(struct bm2835_mmal_ +@@ -1552,8 +1552,11 @@ static int mmal_init(struct bm2835_mmal_ struct vchiq_mmal_component *camera; ret = vchiq_mmal_init(&dev->instance); @@ -28,7 +28,7 @@ Signed-off-by: Stefan Wahren /* get the camera component ready */ ret = vchiq_mmal_component_init(dev->instance, "ril.camera", -@@ -1549,7 +1552,9 @@ static int mmal_init(struct bm2835_mmal_ +@@ -1562,7 +1565,9 @@ static int mmal_init(struct bm2835_mmal_ goto unreg_mmal; camera = dev->component[MMAL_COMPONENT_CAMERA]; @@ -39,7 +39,7 @@ Signed-off-by: Stefan Wahren ret = -EINVAL; goto unreg_camera; } -@@ -1557,8 +1562,11 @@ static int mmal_init(struct bm2835_mmal_ +@@ -1570,8 +1575,11 @@ static int mmal_init(struct bm2835_mmal_ ret = set_camera_parameters(dev->instance, camera, dev); @@ -52,7 +52,7 @@ Signed-off-by: Stefan Wahren /* There was an error in the firmware that meant the camera component * produced BGR instead of RGB. -@@ -1647,8 +1655,8 @@ static int mmal_init(struct bm2835_mmal_ +@@ -1660,8 +1668,8 @@ static int mmal_init(struct bm2835_mmal_ if (dev->component[MMAL_COMPONENT_PREVIEW]->inputs < 1) { ret = -EINVAL; @@ -63,7 +63,7 @@ Signed-off-by: Stefan Wahren goto unreg_preview; } -@@ -1661,8 +1669,8 @@ static int mmal_init(struct bm2835_mmal_ +@@ -1674,8 +1682,8 @@ static int mmal_init(struct bm2835_mmal_ if (dev->component[MMAL_COMPONENT_IMAGE_ENCODE]->inputs < 1) { ret = -EINVAL; @@ -74,7 +74,7 @@ Signed-off-by: Stefan Wahren 1); goto unreg_image_encoder; } -@@ -1676,8 +1684,8 @@ static int mmal_init(struct bm2835_mmal_ +@@ -1689,8 +1697,8 @@ static int mmal_init(struct bm2835_mmal_ if (dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->inputs < 1) { ret = -EINVAL; @@ -85,7 +85,7 @@ Signed-off-by: Stefan Wahren 1); goto unreg_vid_encoder; } -@@ -1706,8 +1714,11 @@ static int mmal_init(struct bm2835_mmal_ +@@ -1719,8 +1727,11 @@ static int mmal_init(struct bm2835_mmal_ sizeof(enable)); } ret = bm2835_mmal_set_all_camera_controls(dev); @@ -98,7 +98,7 @@ Signed-off-by: Stefan Wahren return 0; -@@ -1867,21 +1878,29 @@ static int bcm2835_mmal_probe(struct pla +@@ -1880,21 +1891,29 @@ static int bcm2835_mmal_probe(struct pla snprintf(dev->v4l2_dev.name, sizeof(dev->v4l2_dev.name), "%s", BM2835_MMAL_MODULE_NAME); ret = v4l2_device_register(NULL, &dev->v4l2_dev); @@ -132,7 +132,7 @@ Signed-off-by: Stefan Wahren /* initialize queue */ q = &dev->capture.vb_vidq; memset(q, 0, sizeof(*q)); -@@ -1899,16 +1918,19 @@ static int bcm2835_mmal_probe(struct pla +@@ -1912,16 +1931,19 @@ static int bcm2835_mmal_probe(struct pla /* initialise video devices */ ret = bm2835_mmal_init_device(dev, &dev->vdev); @@ -155,7 +155,7 @@ Signed-off-by: Stefan Wahren goto unreg_dev; } -@@ -1932,8 +1954,6 @@ cleanup_gdev: +@@ -1945,8 +1967,6 @@ cleanup_gdev: bcm2835_cleanup_instance(gdev[i]); gdev[i] = NULL; } diff --git a/target/linux/brcm2708/patches-4.19/950-0236-staging-bcm2835-camera-Add-hint-about-possible-fault.patch b/target/linux/brcm2708/patches-4.19/950-0236-staging-bcm2835-camera-Add-hint-about-possible-fault.patch index 8091ea01d..4cf38bcf2 100644 --- a/target/linux/brcm2708/patches-4.19/950-0236-staging-bcm2835-camera-Add-hint-about-possible-fault.patch +++ b/target/linux/brcm2708/patches-4.19/950-0236-staging-bcm2835-camera-Add-hint-about-possible-fault.patch @@ -16,7 +16,7 @@ Signed-off-by: Stefan Wahren --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c -@@ -1624,8 +1624,11 @@ int vchiq_mmal_component_init(struct vch +@@ -1620,8 +1620,11 @@ int vchiq_mmal_component_init(struct vch component = &instance->component[instance->component_idx]; ret = create_component(instance, component, name); diff --git a/target/linux/brcm2708/patches-4.19/950-0237-staging-bcm2835-Don-t-probe-if-no-camera-is-detected.patch b/target/linux/brcm2708/patches-4.19/950-0237-staging-bcm2835-Don-t-probe-if-no-camera-is-detected.patch index 0b8f0dcfa..4e13404f5 100644 --- a/target/linux/brcm2708/patches-4.19/950-0237-staging-bcm2835-Don-t-probe-if-no-camera-is-detected.patch +++ b/target/linux/brcm2708/patches-4.19/950-0237-staging-bcm2835-Don-t-probe-if-no-camera-is-detected.patch @@ -16,7 +16,7 @@ Signed-off-by: Stefan Wahren --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c -@@ -1847,6 +1847,12 @@ static int bcm2835_mmal_probe(struct pla +@@ -1860,6 +1860,12 @@ static int bcm2835_mmal_probe(struct pla num_cameras = get_num_cameras(instance, resolutions, MAX_BCM2835_CAMERAS); @@ -29,7 +29,7 @@ Signed-off-by: Stefan Wahren if (num_cameras > MAX_BCM2835_CAMERAS) num_cameras = MAX_BCM2835_CAMERAS; -@@ -1955,6 +1961,9 @@ cleanup_gdev: +@@ -1968,6 +1974,9 @@ cleanup_gdev: gdev[i] = NULL; } diff --git a/target/linux/brcm2708/patches-4.19/950-0239-staging-bcm2835-camera-Do-not-bulk-receive-from-serv.patch b/target/linux/brcm2708/patches-4.19/950-0239-staging-bcm2835-camera-Do-not-bulk-receive-from-serv.patch index 99a960215..0df004ca9 100644 --- a/target/linux/brcm2708/patches-4.19/950-0239-staging-bcm2835-camera-Do-not-bulk-receive-from-serv.patch +++ b/target/linux/brcm2708/patches-4.19/950-0239-staging-bcm2835-camera-Do-not-bulk-receive-from-serv.patch @@ -32,7 +32,7 @@ Signed-off-by: Dave Stevenson /* mmal instance */ struct vchiq_mmal_instance *instance; /* mmal port */ -@@ -167,6 +169,9 @@ struct vchiq_mmal_instance { +@@ -168,6 +170,9 @@ struct vchiq_mmal_instance { /* component to use next */ int component_idx; struct vchiq_mmal_component component[VCHIQ_MMAL_MAX_COMPONENTS]; @@ -42,7 +42,7 @@ Signed-off-by: Dave Stevenson }; static struct mmal_msg_context * -@@ -248,7 +253,44 @@ static void buffer_work_cb(struct work_s +@@ -251,7 +256,44 @@ static void buffer_work_cb(struct work_s msg_context->u.bulk.mmal_flags, msg_context->u.bulk.dts, msg_context->u.bulk.pts); @@ -87,7 +87,7 @@ Signed-off-by: Dave Stevenson } /* enqueue a bulk receive for a given message context */ -@@ -257,7 +299,6 @@ static int bulk_receive(struct vchiq_mma +@@ -260,7 +302,6 @@ static int bulk_receive(struct vchiq_mma struct mmal_msg_context *msg_context) { unsigned long rd_len; @@ -95,7 +95,7 @@ Signed-off-by: Dave Stevenson rd_len = msg->u.buffer_from_host.buffer_header.length; -@@ -293,45 +334,10 @@ static int bulk_receive(struct vchiq_mma +@@ -294,45 +335,10 @@ static int bulk_receive(struct vchiq_mma msg_context->u.bulk.dts = msg->u.buffer_from_host.buffer_header.dts; msg_context->u.bulk.pts = msg->u.buffer_from_host.buffer_header.pts; @@ -144,16 +144,16 @@ Signed-off-by: Dave Stevenson } /* data in message, memcpy from packet into output buffer */ -@@ -379,6 +385,8 @@ buffer_from_host(struct vchiq_mmal_insta +@@ -380,6 +386,8 @@ buffer_from_host(struct vchiq_mmal_insta /* initialise work structure ready to schedule callback */ INIT_WORK(&msg_context->u.bulk.work, buffer_work_cb); + INIT_WORK(&msg_context->u.bulk.buffer_to_host_work, + buffer_to_host_work_cb); - /* prep the buffer from host message */ - memset(&m, 0xbc, sizeof(m)); /* just to make debug clearer */ -@@ -459,7 +467,7 @@ static void buffer_to_host_cb(struct vch + atomic_inc(&port->buffers_with_vpu); + +@@ -465,7 +473,7 @@ static void buffer_to_host_cb(struct vch if (msg->u.buffer_from_host.buffer_header.flags & MMAL_BUFFER_HEADER_FLAG_EOS) { msg_context->u.bulk.status = @@ -162,7 +162,7 @@ Signed-off-by: Dave Stevenson if (msg_context->u.bulk.status == 0) return; /* successful bulk submission, bulk * completion will trigger callback -@@ -1793,6 +1801,9 @@ int vchiq_mmal_finalise(struct vchiq_mma +@@ -1789,6 +1797,9 @@ int vchiq_mmal_finalise(struct vchiq_mma mutex_unlock(&instance->vchiq_mutex); @@ -172,7 +172,7 @@ Signed-off-by: Dave Stevenson vfree(instance->bulk_scratch); idr_destroy(&instance->context_map); -@@ -1862,6 +1873,11 @@ int vchiq_mmal_init(struct vchiq_mmal_in +@@ -1858,6 +1869,11 @@ int vchiq_mmal_init(struct vchiq_mmal_in params.callback_param = instance; @@ -184,7 +184,7 @@ Signed-off-by: Dave Stevenson status = vchi_service_open(vchi_instance, ¶ms, &instance->handle); if (status) { pr_err("Failed to open VCHI service connection (status=%d)\n", -@@ -1876,8 +1892,9 @@ int vchiq_mmal_init(struct vchiq_mmal_in +@@ -1872,8 +1888,9 @@ int vchiq_mmal_init(struct vchiq_mmal_in return 0; err_close_services: diff --git a/target/linux/brcm2708/patches-4.19/950-0240-staging-bcm2835-camera-Ensure-H264-header-bytes-get-.patch b/target/linux/brcm2708/patches-4.19/950-0240-staging-bcm2835-camera-Ensure-H264-header-bytes-get-.patch index 1cf56b22d..3322a7ba5 100644 --- a/target/linux/brcm2708/patches-4.19/950-0240-staging-bcm2835-camera-Ensure-H264-header-bytes-get-.patch +++ b/target/linux/brcm2708/patches-4.19/950-0240-staging-bcm2835-camera-Ensure-H264-header-bytes-get-.patch @@ -20,7 +20,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c -@@ -360,8 +360,13 @@ static void buffer_cb(struct vchiq_mmal_ +@@ -363,8 +363,13 @@ static void buffer_cb(struct vchiq_mmal_ } } else { if (dev->capture.frame_count) { @@ -36,7 +36,7 @@ Signed-off-by: Dave Stevenson ktime_t timestamp; s64 runtime_us = pts - dev->capture.vc_start_timestamp; -@@ -374,10 +379,28 @@ static void buffer_cb(struct vchiq_mmal_ +@@ -377,10 +382,28 @@ static void buffer_cb(struct vchiq_mmal_ ktime_to_ns(timestamp)); buf->vb.vb2_buf.timestamp = ktime_to_ns(timestamp); } else { @@ -66,7 +66,7 @@ Signed-off-by: Dave Stevenson vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE); if (mmal_flags & MMAL_BUFFER_HEADER_FLAG_EOS && -@@ -543,6 +566,7 @@ static int start_streaming(struct vb2_qu +@@ -546,6 +569,7 @@ static int start_streaming(struct vb2_qu dev->capture.vc_start_timestamp, parameter_size); dev->capture.kernel_start_ts = ktime_get(); diff --git a/target/linux/brcm2708/patches-4.19/950-0241-staging-bcm2835-camera-Correctly-denote-key-frames-i.patch b/target/linux/brcm2708/patches-4.19/950-0241-staging-bcm2835-camera-Correctly-denote-key-frames-i.patch index 4e2269a66..df19dd3f8 100644 --- a/target/linux/brcm2708/patches-4.19/950-0241-staging-bcm2835-camera-Correctly-denote-key-frames-i.patch +++ b/target/linux/brcm2708/patches-4.19/950-0241-staging-bcm2835-camera-Correctly-denote-key-frames-i.patch @@ -13,7 +13,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c -@@ -398,6 +398,9 @@ static void buffer_cb(struct vchiq_mmal_ +@@ -401,6 +401,9 @@ static void buffer_cb(struct vchiq_mmal_ dev->capture.last_timestamp = buf->vb.vb2_buf.timestamp; vb2_set_plane_payload(&buf->vb.vb2_buf, 0, length); diff --git a/target/linux/brcm2708/patches-4.19/950-0242-staging-bcm2835-camera-Return-early-on-errors.patch b/target/linux/brcm2708/patches-4.19/950-0242-staging-bcm2835-camera-Return-early-on-errors.patch index 5dc558a7e..5ccb2850d 100644 --- a/target/linux/brcm2708/patches-4.19/950-0242-staging-bcm2835-camera-Return-early-on-errors.patch +++ b/target/linux/brcm2708/patches-4.19/950-0242-staging-bcm2835-camera-Return-early-on-errors.patch @@ -24,10 +24,10 @@ Signed-off-by: Dave Stevenson + + if (length == 0) { /* stream ended */ - if (buf) { - /* this should only ever happen if the port is -@@ -358,71 +360,72 @@ static void buffer_cb(struct vchiq_mmal_ - /* signal frame completion */ + if (dev->capture.frame_count) { + /* empty buffer whilst capturing - expected to be an +@@ -361,71 +363,72 @@ static void buffer_cb(struct vchiq_mmal_ + vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR); complete(&dev->capture.frame_cmplt); } - } else { @@ -158,7 +158,7 @@ Signed-off-by: Dave Stevenson } static int enable_camera(struct bm2835_mmal_dev *dev) -@@ -802,27 +805,29 @@ static int vidioc_overlay(struct file *f +@@ -815,27 +818,29 @@ static int vidioc_overlay(struct file *f ret = vchiq_mmal_port_set_format(dev->instance, src); if (ret < 0) diff --git a/target/linux/brcm2708/patches-4.19/950-0246-staging-bcm2835-camera-Reduce-length-of-enum-names.patch b/target/linux/brcm2708/patches-4.19/950-0246-staging-bcm2835-camera-Reduce-length-of-enum-names.patch index 033086e56..b480aa442 100644 --- a/target/linux/brcm2708/patches-4.19/950-0246-staging-bcm2835-camera-Reduce-length-of-enum-names.patch +++ b/target/linux/brcm2708/patches-4.19/950-0246-staging-bcm2835-camera-Reduce-length-of-enum-names.patch @@ -152,7 +152,7 @@ Signed-off-by: Dave Stevenson } static void buffer_cb(struct vchiq_mmal_instance *instance, -@@ -436,7 +436,7 @@ static int enable_camera(struct bm2835_m +@@ -439,7 +439,7 @@ static int enable_camera(struct bm2835_m if (!dev->camera_use_count) { ret = vchiq_mmal_port_parameter_set( dev->instance, @@ -161,7 +161,7 @@ Signed-off-by: Dave Stevenson MMAL_PARAMETER_CAMERA_NUM, &dev->camera_num, sizeof(dev->camera_num)); if (ret < 0) { -@@ -447,7 +447,7 @@ static int enable_camera(struct bm2835_m +@@ -450,7 +450,7 @@ static int enable_camera(struct bm2835_m ret = vchiq_mmal_component_enable( dev->instance, @@ -170,7 +170,7 @@ Signed-off-by: Dave Stevenson if (ret < 0) { v4l2_err(&dev->v4l2_dev, "Failed enabling camera, ret %d\n", ret); -@@ -479,7 +479,7 @@ static int disable_camera(struct bm2835_ +@@ -482,7 +482,7 @@ static int disable_camera(struct bm2835_ ret = vchiq_mmal_component_disable( dev->instance, @@ -179,7 +179,7 @@ Signed-off-by: Dave Stevenson if (ret < 0) { v4l2_err(&dev->v4l2_dev, "Failed disabling camera, ret %d\n", ret); -@@ -487,7 +487,7 @@ static int disable_camera(struct bm2835_ +@@ -490,7 +490,7 @@ static int disable_camera(struct bm2835_ } vchiq_mmal_port_parameter_set( dev->instance, @@ -188,7 +188,7 @@ Signed-off-by: Dave Stevenson MMAL_PARAMETER_CAMERA_NUM, &i, sizeof(i)); } -@@ -539,7 +539,7 @@ static int start_streaming(struct vb2_qu +@@ -542,7 +542,7 @@ static int start_streaming(struct vb2_qu /* if the preview is not already running, wait for a few frames for AGC * to settle down. */ @@ -197,7 +197,7 @@ Signed-off-by: Dave Stevenson msleep(300); /* enable the connection from camera to encoder (if applicable) */ -@@ -762,9 +762,9 @@ static int vidioc_s_fmt_vid_overlay(stru +@@ -775,9 +775,9 @@ static int vidioc_s_fmt_vid_overlay(stru vidioc_try_fmt_vid_overlay(file, priv, f); dev->overlay = f->fmt.win; @@ -209,7 +209,7 @@ Signed-off-by: Dave Stevenson } return 0; -@@ -777,13 +777,13 @@ static int vidioc_overlay(struct file *f +@@ -790,13 +790,13 @@ static int vidioc_overlay(struct file *f struct vchiq_mmal_port *src; struct vchiq_mmal_port *dst; @@ -227,7 +227,7 @@ Signed-off-by: Dave Stevenson if (!on) { /* disconnect preview ports and disable component */ -@@ -795,14 +795,14 @@ static int vidioc_overlay(struct file *f +@@ -808,14 +808,14 @@ static int vidioc_overlay(struct file *f if (ret >= 0) ret = vchiq_mmal_component_disable( dev->instance, @@ -244,7 +244,7 @@ Signed-off-by: Dave Stevenson ret = vchiq_mmal_port_set_format(dev->instance, src); if (ret < 0) -@@ -819,7 +819,7 @@ static int vidioc_overlay(struct file *f +@@ -832,7 +832,7 @@ static int vidioc_overlay(struct file *f ret = vchiq_mmal_component_enable( dev->instance, @@ -253,7 +253,7 @@ Signed-off-by: Dave Stevenson if (ret < 0) return ret; -@@ -840,8 +840,8 @@ static int vidioc_g_fbuf(struct file *fi +@@ -853,8 +853,8 @@ static int vidioc_g_fbuf(struct file *fi */ struct bm2835_mmal_dev *dev = video_drvdata(file); struct vchiq_mmal_port *preview_port = @@ -264,7 +264,7 @@ Signed-off-by: Dave Stevenson a->capability = V4L2_FBUF_CAP_EXTERNOVERLAY | V4L2_FBUF_CAP_GLOBAL_ALPHA; -@@ -1044,31 +1044,31 @@ static int mmal_setup_components(struct +@@ -1057,31 +1057,31 @@ static int mmal_setup_components(struct } /* format dependent port setup */ switch (mfmt->mmal_component) { @@ -311,7 +311,7 @@ Signed-off-by: Dave Stevenson break; default: break; -@@ -1110,13 +1110,12 @@ static int mmal_setup_components(struct +@@ -1123,13 +1123,12 @@ static int mmal_setup_components(struct if (!ret && camera_port == @@ -329,7 +329,7 @@ Signed-off-by: Dave Stevenson /* Preview and encode ports need to match on resolution */ if (overlay_enabled) { /* Need to disable the overlay before we can update -@@ -1147,7 +1146,7 @@ static int mmal_setup_components(struct +@@ -1160,7 +1159,7 @@ static int mmal_setup_components(struct ret = vchiq_mmal_port_connect_tunnel( dev->instance, preview_port, @@ -338,7 +338,7 @@ Signed-off-by: Dave Stevenson if (!ret) ret = vchiq_mmal_port_enable(dev->instance, preview_port, -@@ -1201,11 +1200,11 @@ static int mmal_setup_components(struct +@@ -1214,11 +1213,11 @@ static int mmal_setup_components(struct port->format.encoding_variant = 0; /* Set any encoding specific parameters */ switch (mfmt->mmal_component) { @@ -352,7 +352,7 @@ Signed-off-by: Dave Stevenson /* Could set EXIF parameters here */ break; default: -@@ -1580,14 +1579,14 @@ static int mmal_init(struct bm2835_mmal_ +@@ -1593,14 +1592,14 @@ static int mmal_init(struct bm2835_mmal_ /* get the camera component ready */ ret = vchiq_mmal_component_init(dev->instance, "ril.camera", @@ -371,7 +371,7 @@ Signed-off-by: Dave Stevenson ret = -EINVAL; goto unreg_camera; } -@@ -1609,7 +1608,7 @@ static int mmal_init(struct bm2835_mmal_ +@@ -1622,7 +1621,7 @@ static int mmal_init(struct bm2835_mmal_ dev->rgb_bgr_swapped = true; param_size = sizeof(supported_encodings); ret = vchiq_mmal_port_parameter_get(dev->instance, @@ -380,7 +380,7 @@ Signed-off-by: Dave Stevenson MMAL_PARAMETER_SUPPORTED_ENCODINGS, &supported_encodings, ¶m_size); -@@ -1630,7 +1629,7 @@ static int mmal_init(struct bm2835_mmal_ +@@ -1643,7 +1642,7 @@ static int mmal_init(struct bm2835_mmal_ } } } @@ -389,7 +389,7 @@ Signed-off-by: Dave Stevenson format->encoding = MMAL_ENCODING_OPAQUE; format->encoding_variant = MMAL_ENCODING_I420; -@@ -1644,7 +1643,7 @@ static int mmal_init(struct bm2835_mmal_ +@@ -1657,7 +1656,7 @@ static int mmal_init(struct bm2835_mmal_ format->es->video.frame_rate.num = 0; /* Rely on fps_range */ format->es->video.frame_rate.den = 1; @@ -398,7 +398,7 @@ Signed-off-by: Dave Stevenson format->encoding = MMAL_ENCODING_OPAQUE; format->encoding_variant = MMAL_ENCODING_I420; -@@ -1658,7 +1657,7 @@ static int mmal_init(struct bm2835_mmal_ +@@ -1671,7 +1670,7 @@ static int mmal_init(struct bm2835_mmal_ format->es->video.frame_rate.num = 0; /* Rely on fps_range */ format->es->video.frame_rate.den = 1; @@ -407,7 +407,7 @@ Signed-off-by: Dave Stevenson format->encoding = MMAL_ENCODING_OPAQUE; -@@ -1682,28 +1681,28 @@ static int mmal_init(struct bm2835_mmal_ +@@ -1695,28 +1694,28 @@ static int mmal_init(struct bm2835_mmal_ /* get the preview component ready */ ret = vchiq_mmal_component_init( dev->instance, "ril.video_render", @@ -442,7 +442,7 @@ Signed-off-by: Dave Stevenson 1); goto unreg_image_encoder; } -@@ -1711,21 +1710,21 @@ static int mmal_init(struct bm2835_mmal_ +@@ -1724,21 +1723,21 @@ static int mmal_init(struct bm2835_mmal_ /* get the video encoder component ready */ ret = vchiq_mmal_component_init(dev->instance, "ril.video_encode", &dev-> @@ -468,7 +468,7 @@ Signed-off-by: Dave Stevenson encoder_port->format.encoding = MMAL_ENCODING_H264; ret = vchiq_mmal_port_set_format(dev->instance, encoder_port); -@@ -1736,12 +1735,12 @@ static int mmal_init(struct bm2835_mmal_ +@@ -1749,12 +1748,12 @@ static int mmal_init(struct bm2835_mmal_ vchiq_mmal_port_parameter_set( dev->instance, @@ -483,7 +483,7 @@ Signed-off-by: Dave Stevenson MMAL_PARAMETER_MINIMISE_FRAGMENTATION, &enable, sizeof(enable)); -@@ -1759,23 +1758,23 @@ unreg_vid_encoder: +@@ -1772,23 +1771,23 @@ unreg_vid_encoder: pr_err("Cleanup: Destroy video encoder\n"); vchiq_mmal_component_finalise( dev->instance, @@ -511,7 +511,7 @@ Signed-off-by: Dave Stevenson unreg_mmal: vchiq_mmal_finalise(dev->instance); -@@ -1831,21 +1830,21 @@ static void bcm2835_cleanup_instance(str +@@ -1844,21 +1843,21 @@ static void bcm2835_cleanup_instance(str dev->capture.encode_component); } vchiq_mmal_component_disable(dev->instance, diff --git a/target/linux/brcm2708/patches-4.19/950-0247-staging-bcm2835-camera-Fix-multiple-line-dereference.patch b/target/linux/brcm2708/patches-4.19/950-0247-staging-bcm2835-camera-Fix-multiple-line-dereference.patch index 217cce879..8a34daa0b 100644 --- a/target/linux/brcm2708/patches-4.19/950-0247-staging-bcm2835-camera-Fix-multiple-line-dereference.patch +++ b/target/linux/brcm2708/patches-4.19/950-0247-staging-bcm2835-camera-Fix-multiple-line-dereference.patch @@ -23,7 +23,7 @@ Signed-off-by: Dave Stevenson } static void buffer_cb(struct vchiq_mmal_instance *instance, -@@ -782,8 +781,7 @@ static int vidioc_overlay(struct file *f +@@ -795,8 +794,7 @@ static int vidioc_overlay(struct file *f return 0; /* already in requested state */ src = @@ -33,7 +33,7 @@ Signed-off-by: Dave Stevenson if (!on) { /* disconnect preview ports and disable component */ -@@ -840,8 +838,7 @@ static int vidioc_g_fbuf(struct file *fi +@@ -853,8 +851,7 @@ static int vidioc_g_fbuf(struct file *fi */ struct bm2835_mmal_dev *dev = video_drvdata(file); struct vchiq_mmal_port *preview_port = @@ -43,7 +43,7 @@ Signed-off-by: Dave Stevenson a->capability = V4L2_FBUF_CAP_EXTERNOVERLAY | V4L2_FBUF_CAP_GLOBAL_ALPHA; -@@ -1033,8 +1030,7 @@ static int mmal_setup_components(struct +@@ -1046,8 +1043,7 @@ static int mmal_setup_components(struct dev->capture.camera_port, NULL); dev->capture.camera_port = NULL; ret = vchiq_mmal_component_disable(dev->instance, @@ -53,7 +53,7 @@ Signed-off-by: Dave Stevenson if (ret) v4l2_err(&dev->v4l2_dev, "Failed to disable encode component %d\n", -@@ -1049,26 +1045,22 @@ static int mmal_setup_components(struct +@@ -1062,26 +1058,22 @@ static int mmal_setup_components(struct if (f->fmt.pix.width <= max_video_width && f->fmt.pix.height <= max_video_height) camera_port = port = @@ -84,7 +84,7 @@ Signed-off-by: Dave Stevenson break; default: break; -@@ -1110,8 +1102,7 @@ static int mmal_setup_components(struct +@@ -1123,8 +1115,7 @@ static int mmal_setup_components(struct if (!ret && camera_port == @@ -94,7 +94,7 @@ Signed-off-by: Dave Stevenson bool overlay_enabled = !!dev->component[COMP_PREVIEW]->enabled; struct vchiq_mmal_port *preview_port = -@@ -1248,9 +1239,8 @@ static int mmal_setup_components(struct +@@ -1261,9 +1252,8 @@ static int mmal_setup_components(struct port->current_buffer.size); port->current_buffer.size = (f->fmt.pix.sizeimage < @@ -106,7 +106,7 @@ Signed-off-by: Dave Stevenson } v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, -@@ -1709,8 +1699,7 @@ static int mmal_init(struct bm2835_mmal_ +@@ -1722,8 +1712,7 @@ static int mmal_init(struct bm2835_mmal_ /* get the video encoder component ready */ ret = vchiq_mmal_component_init(dev->instance, "ril.video_encode", @@ -116,7 +116,7 @@ Signed-off-by: Dave Stevenson if (ret < 0) goto unreg_image_encoder; -@@ -1833,12 +1822,10 @@ static void bcm2835_cleanup_instance(str +@@ -1846,12 +1835,10 @@ static void bcm2835_cleanup_instance(str dev->component[COMP_CAMERA]); vchiq_mmal_component_finalise(dev->instance, diff --git a/target/linux/brcm2708/patches-4.19/950-0248-staging-bcm2835-camera-Fix-brace-style-issues.patch b/target/linux/brcm2708/patches-4.19/950-0248-staging-bcm2835-camera-Fix-brace-style-issues.patch index 4b0a49906..748e2a6a6 100644 --- a/target/linux/brcm2708/patches-4.19/950-0248-staging-bcm2835-camera-Fix-brace-style-issues.patch +++ b/target/linux/brcm2708/patches-4.19/950-0248-staging-bcm2835-camera-Fix-brace-style-issues.patch @@ -14,7 +14,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c -@@ -566,10 +566,11 @@ static int start_streaming(struct vb2_qu +@@ -569,10 +569,11 @@ static int start_streaming(struct vb2_qu /* Flag to indicate just to rely on kernel timestamps */ dev->capture.vc_start_timestamp = -1; @@ -42,7 +42,7 @@ Signed-off-by: Dave Stevenson static int ctrl_set_flicker_avoidance(struct bm2835_mmal_dev *dev, --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c -@@ -1262,9 +1262,10 @@ static int port_parameter_get(struct vch +@@ -1268,9 +1268,10 @@ static int port_parameter_get(struct vch memcpy(value, &rmsg->u.port_parameter_get_reply.value, *value_size); *value_size = rmsg->u.port_parameter_get_reply.size; diff --git a/target/linux/brcm2708/patches-4.19/950-0250-staging-bcm2835-camera-Fix-logical-continuation-spli.patch b/target/linux/brcm2708/patches-4.19/950-0250-staging-bcm2835-camera-Fix-logical-continuation-spli.patch index a04ebef3b..6d4526d1b 100644 --- a/target/linux/brcm2708/patches-4.19/950-0250-staging-bcm2835-camera-Fix-logical-continuation-spli.patch +++ b/target/linux/brcm2708/patches-4.19/950-0250-staging-bcm2835-camera-Fix-logical-continuation-spli.patch @@ -14,7 +14,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c -@@ -542,8 +542,8 @@ static int start_streaming(struct vb2_qu +@@ -545,8 +545,8 @@ static int start_streaming(struct vb2_qu msleep(300); /* enable the connection from camera to encoder (if applicable) */ @@ -25,7 +25,7 @@ Signed-off-by: Dave Stevenson ret = vchiq_mmal_port_enable(dev->instance, dev->capture.camera_port, NULL); if (ret) { -@@ -1043,8 +1043,8 @@ static int mmal_setup_components(struct +@@ -1056,8 +1056,8 @@ static int mmal_setup_components(struct switch (mfmt->mmal_component) { case COMP_CAMERA: /* Make a further decision on port based on resolution */ @@ -36,7 +36,7 @@ Signed-off-by: Dave Stevenson camera_port = port = &dev->component[COMP_CAMERA]->output[CAM_PORT_VIDEO]; else -@@ -1101,8 +1101,8 @@ static int mmal_setup_components(struct +@@ -1114,8 +1114,8 @@ static int mmal_setup_components(struct ret = vchiq_mmal_port_set_format(dev->instance, camera_port); diff --git a/target/linux/brcm2708/patches-4.19/950-0251-staging-bcm2835-camera-Fix-open-parenthesis-alignmen.patch b/target/linux/brcm2708/patches-4.19/950-0251-staging-bcm2835-camera-Fix-open-parenthesis-alignmen.patch index 965261fd0..133184945 100644 --- a/target/linux/brcm2708/patches-4.19/950-0251-staging-bcm2835-camera-Fix-open-parenthesis-alignmen.patch +++ b/target/linux/brcm2708/patches-4.19/950-0251-staging-bcm2835-camera-Fix-open-parenthesis-alignmen.patch @@ -17,7 +17,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c -@@ -412,8 +412,7 @@ static void buffer_cb(struct vchiq_mmal_ +@@ -415,8 +415,7 @@ static void buffer_cb(struct vchiq_mmal_ buf->vb.flags |= V4L2_BUF_FLAG_KEYFRAME; v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, @@ -27,7 +27,7 @@ Signed-off-by: Dave Stevenson vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE); if (mmal_flags & MMAL_BUFFER_HEADER_FLAG_EOS && -@@ -581,8 +580,8 @@ static int start_streaming(struct vb2_qu +@@ -584,8 +583,8 @@ static int start_streaming(struct vb2_qu vchiq_mmal_port_enable(dev->instance, dev->capture.port, buffer_cb); if (ret) { v4l2_err(&dev->v4l2_dev, @@ -38,7 +38,7 @@ Signed-off-by: Dave Stevenson vchiq_mmal_port_disable(dev->instance, dev->capture.camera_port); -@@ -978,8 +977,7 @@ static int vidioc_try_fmt_vid_cap(struct +@@ -991,8 +990,7 @@ static int vidioc_try_fmt_vid_cap(struct f->fmt.pix.bytesperline = (f->fmt.pix.bytesperline + align_mask) & ~align_mask; v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, @@ -48,7 +48,7 @@ Signed-off-by: Dave Stevenson f->fmt.pix.bytesperline, align_mask); } -@@ -1325,7 +1323,7 @@ static int vidioc_s_fmt_vid_cap(struct f +@@ -1338,7 +1336,7 @@ static int vidioc_s_fmt_vid_cap(struct f } static int vidioc_enum_framesizes(struct file *file, void *fh, @@ -104,7 +104,7 @@ Signed-off-by: Dave Stevenson case MMAL_CONTROL_TYPE_CLUSTER: --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c -@@ -645,7 +645,7 @@ static int send_synchronous_mmal_msg(str +@@ -651,7 +651,7 @@ static int send_synchronous_mmal_msg(str if (payload_len > (MMAL_MSG_MAX_SIZE - sizeof(struct mmal_msg_header))) { pr_err("payload length %d exceeds max:%d\n", payload_len, @@ -115,7 +115,7 @@ Signed-off-by: Dave Stevenson } --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h -@@ -128,7 +128,7 @@ int vchiq_mmal_port_enable( +@@ -131,7 +131,7 @@ int vchiq_mmal_port_enable( * disable a port will dequeue any pending buffers */ int vchiq_mmal_port_disable(struct vchiq_mmal_instance *instance, @@ -124,7 +124,7 @@ Signed-off-by: Dave Stevenson int vchiq_mmal_port_parameter_set(struct vchiq_mmal_instance *instance, struct vchiq_mmal_port *port, -@@ -146,8 +146,8 @@ int vchiq_mmal_port_set_format(struct vc +@@ -149,8 +149,8 @@ int vchiq_mmal_port_set_format(struct vc struct vchiq_mmal_port *port); int vchiq_mmal_port_connect_tunnel(struct vchiq_mmal_instance *instance, diff --git a/target/linux/brcm2708/patches-4.19/950-0252-staging-bcm2835_camera-Ensure-all-buffers-are-return.patch b/target/linux/brcm2708/patches-4.19/950-0252-staging-bcm2835_camera-Ensure-all-buffers-are-return.patch deleted file mode 100644 index b5fbceba2..000000000 --- a/target/linux/brcm2708/patches-4.19/950-0252-staging-bcm2835_camera-Ensure-all-buffers-are-return.patch +++ /dev/null @@ -1,95 +0,0 @@ -From 754a5ed1aa42ce9d5be5f84a5a0888f850b15e00 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Thu, 28 Jun 2018 15:57:25 +0100 -Subject: [PATCH 252/703] staging: bcm2835_camera: Ensure all buffers are - returned on disable - -With the recent change to match MMAL and V4L2 buffers there -is a need to wait for all MMAL buffers to be returned during -stop_streaming. - -Fixes: 9384167 "staging: bcm2835-camera: Remove V4L2/MMAL buffer remapping" -Signed-off-by: Dave Stevenson ---- - .../bcm2835-camera/bcm2835-camera.c | 22 ++++++++++++++----- - .../vc04_services/bcm2835-camera/mmal-vchiq.c | 4 ++++ - .../vc04_services/bcm2835-camera/mmal-vchiq.h | 3 +++ - 3 files changed, 23 insertions(+), 6 deletions(-) - ---- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c -+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c -@@ -607,6 +607,7 @@ static void stop_streaming(struct vb2_qu - int ret; - unsigned long timeout; - struct bm2835_mmal_dev *dev = vb2_get_drv_priv(vq); -+ struct vchiq_mmal_port *port = dev->capture.port; - - v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, "%s: dev:%p\n", - __func__, dev); -@@ -630,12 +631,6 @@ static void stop_streaming(struct vb2_qu - &dev->capture.frame_count, - sizeof(dev->capture.frame_count)); - -- /* wait for last frame to complete */ -- timeout = wait_for_completion_timeout(&dev->capture.frame_cmplt, HZ); -- if (timeout == 0) -- v4l2_err(&dev->v4l2_dev, -- "timed out waiting for frame completion\n"); -- - v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, - "disabling connection\n"); - -@@ -650,6 +645,21 @@ static void stop_streaming(struct vb2_qu - ret); - } - -+ /* wait for all buffers to be returned */ -+ while (atomic_read(&port->buffers_with_vpu)) { -+ v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, -+ "%s: Waiting for buffers to be returned - %d outstanding\n", -+ __func__, atomic_read(&port->buffers_with_vpu)); -+ timeout = wait_for_completion_timeout(&dev->capture.frame_cmplt, -+ HZ); -+ if (timeout == 0) { -+ v4l2_err(&dev->v4l2_dev, "%s: Timeout waiting for buffers to be returned - %d outstanding\n", -+ __func__, -+ atomic_read(&port->buffers_with_vpu)); -+ break; -+ } -+ } -+ - if (disable_camera(dev) < 0) - v4l2_err(&dev->v4l2_dev, "Failed to disable camera\n"); - } ---- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c -+++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c -@@ -246,6 +246,8 @@ static void buffer_work_cb(struct work_s - struct mmal_msg_context *msg_context = - container_of(work, struct mmal_msg_context, u.bulk.work); - -+ atomic_dec(&msg_context->u.bulk.port->buffers_with_vpu); -+ - msg_context->u.bulk.port->buffer_cb(msg_context->u.bulk.instance, - msg_context->u.bulk.port, - msg_context->u.bulk.status, -@@ -389,6 +391,8 @@ buffer_from_host(struct vchiq_mmal_insta - INIT_WORK(&msg_context->u.bulk.buffer_to_host_work, - buffer_to_host_work_cb); - -+ atomic_inc(&port->buffers_with_vpu); -+ - /* prep the buffer from host message */ - memset(&m, 0xbc, sizeof(m)); /* just to make debug clearer */ - ---- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h -+++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h -@@ -72,6 +72,9 @@ struct vchiq_mmal_port { - struct list_head buffers; - /* lock to serialise adding and removing buffers from list */ - spinlock_t slock; -+ -+ /* Count of buffers the VPU has yet to return */ -+ atomic_t buffers_with_vpu; - /* callback on buffer completion */ - vchiq_mmal_buffer_cb buffer_cb; - /* callback context */ diff --git a/target/linux/brcm2708/patches-4.19/950-0253-staging-bcm2835-camera-Remove-check-of-the-number-of.patch b/target/linux/brcm2708/patches-4.19/950-0253-staging-bcm2835-camera-Remove-check-of-the-number-of.patch deleted file mode 100644 index f916ae183..000000000 --- a/target/linux/brcm2708/patches-4.19/950-0253-staging-bcm2835-camera-Remove-check-of-the-number-of.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 98457a5263c83026cf1d451d44d8b028b8423b87 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Wed, 4 Jul 2018 17:01:15 +0100 -Subject: [PATCH 253/703] staging: bcm2835-camera: Remove check of the number - of buffers supplied - -Before 9384167 there was a need to ensure that there were sufficient -buffers supplied from the user to cover those being sent to the VPU -(always 1). -With 9384167 the buffers are linked 1:1 between MMAL and V4L2, -therefore there is no need for that check, and indeed it is wrong -as there is no need to submit all the buffers before starting streaming. - -Fixes: 9384167 "staging: bcm2835-camera: Remove V4L2/MMAL buffer remapping" - -Signed-off-by: Dave Stevenson ---- - .../staging/vc04_services/bcm2835-camera/mmal-vchiq.c | 10 ---------- - 1 file changed, 10 deletions(-) - ---- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c -+++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c -@@ -1338,16 +1338,6 @@ static int port_enable(struct vchiq_mmal - if (port->enabled) - return 0; - -- /* ensure there are enough buffers queued to cover the buffer headers */ -- if (port->buffer_cb) { -- hdr_count = 0; -- list_for_each(buf_head, &port->buffers) { -- hdr_count++; -- } -- if (hdr_count < port->current_buffer.num) -- return -ENOSPC; -- } -- - ret = port_action_port(instance, port, - MMAL_MSG_PORT_ACTION_TYPE_ENABLE); - if (ret) diff --git a/target/linux/brcm2708/patches-4.19/950-0254-staging-bcm2835-camera-Handle-empty-EOS-buffers-whil.patch b/target/linux/brcm2708/patches-4.19/950-0254-staging-bcm2835-camera-Handle-empty-EOS-buffers-whil.patch deleted file mode 100644 index 81153c9ff..000000000 --- a/target/linux/brcm2708/patches-4.19/950-0254-staging-bcm2835-camera-Handle-empty-EOS-buffers-whil.patch +++ /dev/null @@ -1,84 +0,0 @@ -From 1da35962d95cdb8648cb85c4b6f3d3367be88601 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Thu, 5 Jul 2018 16:17:03 +0100 -Subject: [PATCH 254/703] staging: bcm2835-camera: Handle empty EOS buffers - whilst streaming - -The change to mapping V4L2 to MMAL buffers 1:1 didn't handle -the condition we get with raw pixel buffers (eg YUV and RGB) -direct from the camera's stills port. That sends the pixel buffer -and then an empty buffer with the EOS flag set. The EOS buffer -wasn't handled and returned an error up the stack. - -Handle the condition correctly by returning it to the component -if streaming, or returning with an error if stopping streaming. - -Fixes: 9384167 "staging: bcm2835-camera: Remove V4L2/MMAL buffer remapping" - -Signed-off-by: Dave Stevenson ---- - .../bcm2835-camera/bcm2835-camera.c | 21 +++++++++++-------- - .../vc04_services/bcm2835-camera/mmal-vchiq.c | 5 +++-- - 2 files changed, 15 insertions(+), 11 deletions(-) - ---- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c -+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c -@@ -339,16 +339,13 @@ static void buffer_cb(struct vchiq_mmal_ - - if (length == 0) { - /* stream ended */ -- if (buf) { -- /* this should only ever happen if the port is -- * disabled and there are buffers still queued -+ if (dev->capture.frame_count) { -+ /* empty buffer whilst capturing - expected to be an -+ * EOS, so grab another frame - */ -- vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR); -- pr_debug("Empty buffer"); -- } else if (dev->capture.frame_count) { -- /* grab another frame */ - if (is_capturing(dev)) { -- pr_debug("Grab another frame"); -+ v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, -+ "Grab another frame"); - vchiq_mmal_port_parameter_set( - instance, - dev->capture.camera_port, -@@ -356,8 +353,14 @@ static void buffer_cb(struct vchiq_mmal_ - &dev->capture.frame_count, - sizeof(dev->capture.frame_count)); - } -+ if (vchiq_mmal_submit_buffer(instance, port, buf)) -+ v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, -+ "Failed to return EOS buffer"); - } else { -- /* signal frame completion */ -+ /* stopping streaming. -+ * return buffer, and signal frame completion -+ */ -+ vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR); - complete(&dev->capture.frame_cmplt); - } - return; ---- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c -+++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c -@@ -332,8 +332,6 @@ static int bulk_receive(struct vchiq_mma - - /* store length */ - msg_context->u.bulk.buffer_used = rd_len; -- msg_context->u.bulk.mmal_flags = -- msg->u.buffer_from_host.buffer_header.flags; - msg_context->u.bulk.dts = msg->u.buffer_from_host.buffer_header.dts; - msg_context->u.bulk.pts = msg->u.buffer_from_host.buffer_header.pts; - -@@ -461,6 +459,9 @@ static void buffer_to_host_cb(struct vch - return; - } - -+ msg_context->u.bulk.mmal_flags = -+ msg->u.buffer_from_host.buffer_header.flags; -+ - if (msg->h.status != MMAL_MSG_STATUS_SUCCESS) { - /* message reception had an error */ - pr_warn("error %d in reply\n", msg->h.status); diff --git a/target/linux/brcm2708/patches-4.19/950-0267-staging-vc04_services-Split-vchiq-mmal-into-a-module.patch b/target/linux/brcm2708/patches-4.19/950-0267-staging-vc04_services-Split-vchiq-mmal-into-a-module.patch index 5ba783d11..13ee7ba19 100644 --- a/target/linux/brcm2708/patches-4.19/950-0267-staging-vc04_services-Split-vchiq-mmal-into-a-module.patch +++ b/target/linux/brcm2708/patches-4.19/950-0267-staging-vc04_services-Split-vchiq-mmal-into-a-module.patch @@ -109,1910 +109,9 @@ Signed-off-by: Dave Stevenson +ccflags-y += \ + -Idrivers/staging/vc04_services \ + -D__VCCOREVER__=0x04000000 ---- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c -+++ /dev/null -@@ -1,1898 +0,0 @@ --// SPDX-License-Identifier: GPL-2.0 --/* -- * Broadcom BM2835 V4L2 driver -- * -- * Copyright © 2013 Raspberry Pi (Trading) Ltd. -- * -- * Authors: Vincent Sanders @ Collabora -- * Dave Stevenson @ Broadcom -- * (now dave.stevenson@raspberrypi.org) -- * Simon Mellor @ Broadcom -- * Luke Diamand @ Broadcom -- * -- * V4L2 driver MMAL vchiq interface code -- */ -- --#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -- --#include --#include --#include --#include --#include --#include --#include --#include --#include -- --#include "mmal-common.h" --#include "mmal-vchiq.h" --#include "mmal-msg.h" -- --#define USE_VCHIQ_ARM --#include "interface/vchi/vchi.h" -- --/* maximum number of components supported */ --#define VCHIQ_MMAL_MAX_COMPONENTS 4 -- --/*#define FULL_MSG_DUMP 1*/ -- --#ifdef DEBUG --static const char *const msg_type_names[] = { -- "UNKNOWN", -- "QUIT", -- "SERVICE_CLOSED", -- "GET_VERSION", -- "COMPONENT_CREATE", -- "COMPONENT_DESTROY", -- "COMPONENT_ENABLE", -- "COMPONENT_DISABLE", -- "PORT_INFO_GET", -- "PORT_INFO_SET", -- "PORT_ACTION", -- "BUFFER_FROM_HOST", -- "BUFFER_TO_HOST", -- "GET_STATS", -- "PORT_PARAMETER_SET", -- "PORT_PARAMETER_GET", -- "EVENT_TO_HOST", -- "GET_CORE_STATS_FOR_PORT", -- "OPAQUE_ALLOCATOR", -- "CONSUME_MEM", -- "LMK", -- "OPAQUE_ALLOCATOR_DESC", -- "DRM_GET_LHS32", -- "DRM_GET_TIME", -- "BUFFER_FROM_HOST_ZEROLEN", -- "PORT_FLUSH", -- "HOST_LOG", --}; --#endif -- --static const char *const port_action_type_names[] = { -- "UNKNOWN", -- "ENABLE", -- "DISABLE", -- "FLUSH", -- "CONNECT", -- "DISCONNECT", -- "SET_REQUIREMENTS", --}; -- --#if defined(DEBUG) --#if defined(FULL_MSG_DUMP) --#define DBG_DUMP_MSG(MSG, MSG_LEN, TITLE) \ -- do { \ -- pr_debug(TITLE" type:%s(%d) length:%d\n", \ -- msg_type_names[(MSG)->h.type], \ -- (MSG)->h.type, (MSG_LEN)); \ -- print_hex_dump(KERN_DEBUG, "<h.type], \ -- (MSG)->h.type, (MSG_LEN)); \ -- } --#endif --#else --#define DBG_DUMP_MSG(MSG, MSG_LEN, TITLE) --#endif -- --struct vchiq_mmal_instance; -- --/* normal message context */ --struct mmal_msg_context { -- struct vchiq_mmal_instance *instance; -- -- /* Index in the context_map idr so that we can find the -- * mmal_msg_context again when servicing the VCHI reply. -- */ -- int handle; -- -- union { -- struct { -- /* work struct for buffer_cb callback */ -- struct work_struct work; -- /* work struct for deferred callback */ -- struct work_struct buffer_to_host_work; -- /* mmal instance */ -- struct vchiq_mmal_instance *instance; -- /* mmal port */ -- struct vchiq_mmal_port *port; -- /* actual buffer used to store bulk reply */ -- struct mmal_buffer *buffer; -- /* amount of buffer used */ -- unsigned long buffer_used; -- /* MMAL buffer flags */ -- u32 mmal_flags; -- /* Presentation and Decode timestamps */ -- s64 pts; -- s64 dts; -- -- int status; /* context status */ -- -- } bulk; /* bulk data */ -- -- struct { -- /* message handle to release */ -- VCHI_HELD_MSG_T msg_handle; -- /* pointer to received message */ -- struct mmal_msg *msg; -- /* received message length */ -- u32 msg_len; -- /* completion upon reply */ -- struct completion cmplt; -- } sync; /* synchronous response */ -- } u; -- --}; -- --struct vchiq_mmal_instance { -- VCHI_SERVICE_HANDLE_T handle; -- -- /* ensure serialised access to service */ -- struct mutex vchiq_mutex; -- -- /* vmalloc page to receive scratch bulk xfers into */ -- void *bulk_scratch; -- -- struct idr context_map; -- spinlock_t context_map_lock; -- -- /* component to use next */ -- int component_idx; -- struct vchiq_mmal_component component[VCHIQ_MMAL_MAX_COMPONENTS]; -- -- /* ordered workqueue to process all bulk operations */ -- struct workqueue_struct *bulk_wq; --}; -- --static struct mmal_msg_context * --get_msg_context(struct vchiq_mmal_instance *instance) --{ -- struct mmal_msg_context *msg_context; -- int handle; -- -- /* todo: should this be allocated from a pool to avoid kzalloc */ -- msg_context = kzalloc(sizeof(*msg_context), GFP_KERNEL); -- -- if (!msg_context) -- return ERR_PTR(-ENOMEM); -- -- /* Create an ID that will be passed along with our message so -- * that when we service the VCHI reply, we can look up what -- * message is being replied to. -- */ -- spin_lock(&instance->context_map_lock); -- handle = idr_alloc(&instance->context_map, msg_context, -- 0, 0, GFP_KERNEL); -- spin_unlock(&instance->context_map_lock); -- -- if (handle < 0) { -- kfree(msg_context); -- return ERR_PTR(handle); -- } -- -- msg_context->instance = instance; -- msg_context->handle = handle; -- -- return msg_context; --} -- --static struct mmal_msg_context * --lookup_msg_context(struct vchiq_mmal_instance *instance, int handle) --{ -- return idr_find(&instance->context_map, handle); --} -- --static void --release_msg_context(struct mmal_msg_context *msg_context) --{ -- struct vchiq_mmal_instance *instance = msg_context->instance; -- -- spin_lock(&instance->context_map_lock); -- idr_remove(&instance->context_map, msg_context->handle); -- spin_unlock(&instance->context_map_lock); -- kfree(msg_context); --} -- --/* deals with receipt of event to host message */ --static void event_to_host_cb(struct vchiq_mmal_instance *instance, -- struct mmal_msg *msg, u32 msg_len) --{ -- pr_debug("unhandled event\n"); -- pr_debug("component:%u port type:%d num:%d cmd:0x%x length:%d\n", -- msg->u.event_to_host.client_component, -- msg->u.event_to_host.port_type, -- msg->u.event_to_host.port_num, -- msg->u.event_to_host.cmd, msg->u.event_to_host.length); --} -- --/* workqueue scheduled callback -- * -- * we do this because it is important we do not call any other vchiq -- * sync calls from witin the message delivery thread -- */ --static void buffer_work_cb(struct work_struct *work) --{ -- struct mmal_msg_context *msg_context = -- container_of(work, struct mmal_msg_context, u.bulk.work); -- -- atomic_dec(&msg_context->u.bulk.port->buffers_with_vpu); -- -- msg_context->u.bulk.port->buffer_cb(msg_context->u.bulk.instance, -- msg_context->u.bulk.port, -- msg_context->u.bulk.status, -- msg_context->u.bulk.buffer, -- msg_context->u.bulk.buffer_used, -- msg_context->u.bulk.mmal_flags, -- msg_context->u.bulk.dts, -- msg_context->u.bulk.pts); --} -- --/* workqueue scheduled callback to handle receiving buffers -- * -- * VCHI will allow up to 4 bulk receives to be scheduled before blocking. -- * If we block in the service_callback context then we can't process the -- * VCHI_CALLBACK_BULK_RECEIVED message that would otherwise allow the blocked -- * vchi_bulk_queue_receive() call to complete. -- */ --static void buffer_to_host_work_cb(struct work_struct *work) --{ -- struct mmal_msg_context *msg_context = -- container_of(work, struct mmal_msg_context, -- u.bulk.buffer_to_host_work); -- struct vchiq_mmal_instance *instance = msg_context->instance; -- unsigned long len = msg_context->u.bulk.buffer_used; -- int ret; -- -- if (!len) -- /* Dummy receive to ensure the buffers remain in order */ -- len = 8; -- /* queue the bulk submission */ -- vchi_service_use(instance->handle); -- ret = vchi_bulk_queue_receive(instance->handle, -- msg_context->u.bulk.buffer->buffer, -- /* Actual receive needs to be a multiple -- * of 4 bytes -- */ -- (len + 3) & ~3, -- VCHI_FLAGS_CALLBACK_WHEN_OP_COMPLETE | -- VCHI_FLAGS_BLOCK_UNTIL_QUEUED, -- msg_context); -- -- vchi_service_release(instance->handle); -- -- if (ret != 0) -- pr_err("%s: ctx: %p, vchi_bulk_queue_receive failed %d\n", -- __func__, msg_context, ret); --} -- --/* enqueue a bulk receive for a given message context */ --static int bulk_receive(struct vchiq_mmal_instance *instance, -- struct mmal_msg *msg, -- struct mmal_msg_context *msg_context) --{ -- unsigned long rd_len; -- -- rd_len = msg->u.buffer_from_host.buffer_header.length; -- -- if (!msg_context->u.bulk.buffer) { -- pr_err("bulk.buffer not configured - error in buffer_from_host\n"); -- -- /* todo: this is a serious error, we should never have -- * committed a buffer_to_host operation to the mmal -- * port without the buffer to back it up (underflow -- * handling) and there is no obvious way to deal with -- * this - how is the mmal servie going to react when -- * we fail to do the xfer and reschedule a buffer when -- * it arrives? perhaps a starved flag to indicate a -- * waiting bulk receive? -- */ -- -- return -EINVAL; -- } -- -- /* ensure we do not overrun the available buffer */ -- if (rd_len > msg_context->u.bulk.buffer->buffer_size) { -- rd_len = msg_context->u.bulk.buffer->buffer_size; -- pr_warn("short read as not enough receive buffer space\n"); -- /* todo: is this the correct response, what happens to -- * the rest of the message data? -- */ -- } -- -- /* store length */ -- msg_context->u.bulk.buffer_used = rd_len; -- msg_context->u.bulk.dts = msg->u.buffer_from_host.buffer_header.dts; -- msg_context->u.bulk.pts = msg->u.buffer_from_host.buffer_header.pts; -- -- queue_work(msg_context->instance->bulk_wq, -- &msg_context->u.bulk.buffer_to_host_work); -- -- return 0; --} -- --/* data in message, memcpy from packet into output buffer */ --static int inline_receive(struct vchiq_mmal_instance *instance, -- struct mmal_msg *msg, -- struct mmal_msg_context *msg_context) --{ -- memcpy(msg_context->u.bulk.buffer->buffer, -- msg->u.buffer_from_host.short_data, -- msg->u.buffer_from_host.payload_in_message); -- -- msg_context->u.bulk.buffer_used = -- msg->u.buffer_from_host.payload_in_message; -- -- return 0; --} -- --/* queue the buffer availability with MMAL_MSG_TYPE_BUFFER_FROM_HOST */ --static int --buffer_from_host(struct vchiq_mmal_instance *instance, -- struct vchiq_mmal_port *port, struct mmal_buffer *buf) --{ -- struct mmal_msg_context *msg_context; -- struct mmal_msg m; -- int ret; -- -- if (!port->enabled) -- return -EINVAL; -- -- pr_debug("instance:%p buffer:%p\n", instance->handle, buf); -- -- /* get context */ -- if (!buf->msg_context) { -- pr_err("%s: msg_context not allocated, buf %p\n", __func__, -- buf); -- return -EINVAL; -- } -- msg_context = buf->msg_context; -- -- /* store bulk message context for when data arrives */ -- msg_context->u.bulk.instance = instance; -- msg_context->u.bulk.port = port; -- msg_context->u.bulk.buffer = buf; -- msg_context->u.bulk.buffer_used = 0; -- -- /* initialise work structure ready to schedule callback */ -- INIT_WORK(&msg_context->u.bulk.work, buffer_work_cb); -- INIT_WORK(&msg_context->u.bulk.buffer_to_host_work, -- buffer_to_host_work_cb); -- -- atomic_inc(&port->buffers_with_vpu); -- -- /* prep the buffer from host message */ -- memset(&m, 0xbc, sizeof(m)); /* just to make debug clearer */ -- -- m.h.type = MMAL_MSG_TYPE_BUFFER_FROM_HOST; -- m.h.magic = MMAL_MAGIC; -- m.h.context = msg_context->handle; -- m.h.status = 0; -- -- /* drvbuf is our private data passed back */ -- m.u.buffer_from_host.drvbuf.magic = MMAL_MAGIC; -- m.u.buffer_from_host.drvbuf.component_handle = port->component->handle; -- m.u.buffer_from_host.drvbuf.port_handle = port->handle; -- m.u.buffer_from_host.drvbuf.client_context = msg_context->handle; -- -- /* buffer header */ -- m.u.buffer_from_host.buffer_header.cmd = 0; -- m.u.buffer_from_host.buffer_header.data = -- (u32)(unsigned long)buf->buffer; -- m.u.buffer_from_host.buffer_header.alloc_size = buf->buffer_size; -- m.u.buffer_from_host.buffer_header.length = 0; /* nothing used yet */ -- m.u.buffer_from_host.buffer_header.offset = 0; /* no offset */ -- m.u.buffer_from_host.buffer_header.flags = 0; /* no flags */ -- m.u.buffer_from_host.buffer_header.pts = MMAL_TIME_UNKNOWN; -- m.u.buffer_from_host.buffer_header.dts = MMAL_TIME_UNKNOWN; -- -- /* clear buffer type sepecific data */ -- memset(&m.u.buffer_from_host.buffer_header_type_specific, 0, -- sizeof(m.u.buffer_from_host.buffer_header_type_specific)); -- -- /* no payload in message */ -- m.u.buffer_from_host.payload_in_message = 0; -- -- vchi_service_use(instance->handle); -- -- ret = vchi_queue_kernel_message(instance->handle, -- &m, -- sizeof(struct mmal_msg_header) + -- sizeof(m.u.buffer_from_host)); -- -- vchi_service_release(instance->handle); -- -- return ret; --} -- --/* deals with receipt of buffer to host message */ --static void buffer_to_host_cb(struct vchiq_mmal_instance *instance, -- struct mmal_msg *msg, u32 msg_len) --{ -- struct mmal_msg_context *msg_context; -- u32 handle; -- -- pr_debug("%s: instance:%p msg:%p msg_len:%d\n", -- __func__, instance, msg, msg_len); -- -- if (msg->u.buffer_from_host.drvbuf.magic == MMAL_MAGIC) { -- handle = msg->u.buffer_from_host.drvbuf.client_context; -- msg_context = lookup_msg_context(instance, handle); -- -- if (!msg_context) { -- pr_err("drvbuf.client_context(%u) is invalid\n", -- handle); -- return; -- } -- } else { -- pr_err("MMAL_MSG_TYPE_BUFFER_TO_HOST with bad magic\n"); -- return; -- } -- -- msg_context->u.bulk.mmal_flags = -- msg->u.buffer_from_host.buffer_header.flags; -- -- if (msg->h.status != MMAL_MSG_STATUS_SUCCESS) { -- /* message reception had an error */ -- pr_warn("error %d in reply\n", msg->h.status); -- -- msg_context->u.bulk.status = msg->h.status; -- -- } else if (msg->u.buffer_from_host.buffer_header.length == 0) { -- /* empty buffer */ -- if (msg->u.buffer_from_host.buffer_header.flags & -- MMAL_BUFFER_HEADER_FLAG_EOS) { -- msg_context->u.bulk.status = -- bulk_receive(instance, msg, msg_context); -- if (msg_context->u.bulk.status == 0) -- return; /* successful bulk submission, bulk -- * completion will trigger callback -- */ -- } else { -- /* do callback with empty buffer - not EOS though */ -- msg_context->u.bulk.status = 0; -- msg_context->u.bulk.buffer_used = 0; -- } -- } else if (msg->u.buffer_from_host.payload_in_message == 0) { -- /* data is not in message, queue a bulk receive */ -- msg_context->u.bulk.status = -- bulk_receive(instance, msg, msg_context); -- if (msg_context->u.bulk.status == 0) -- return; /* successful bulk submission, bulk -- * completion will trigger callback -- */ -- -- /* failed to submit buffer, this will end badly */ -- pr_err("error %d on bulk submission\n", -- msg_context->u.bulk.status); -- -- } else if (msg->u.buffer_from_host.payload_in_message <= -- MMAL_VC_SHORT_DATA) { -- /* data payload within message */ -- msg_context->u.bulk.status = inline_receive(instance, msg, -- msg_context); -- } else { -- pr_err("message with invalid short payload\n"); -- -- /* signal error */ -- msg_context->u.bulk.status = -EINVAL; -- msg_context->u.bulk.buffer_used = -- msg->u.buffer_from_host.payload_in_message; -- } -- -- /* schedule the port callback */ -- schedule_work(&msg_context->u.bulk.work); --} -- --static void bulk_receive_cb(struct vchiq_mmal_instance *instance, -- struct mmal_msg_context *msg_context) --{ -- msg_context->u.bulk.status = 0; -- -- /* schedule the port callback */ -- schedule_work(&msg_context->u.bulk.work); --} -- --static void bulk_abort_cb(struct vchiq_mmal_instance *instance, -- struct mmal_msg_context *msg_context) --{ -- pr_err("%s: bulk ABORTED msg_context:%p\n", __func__, msg_context); -- -- msg_context->u.bulk.status = -EINTR; -- -- schedule_work(&msg_context->u.bulk.work); --} -- --/* incoming event service callback */ --static void service_callback(void *param, -- const VCHI_CALLBACK_REASON_T reason, -- void *bulk_ctx) --{ -- struct vchiq_mmal_instance *instance = param; -- int status; -- u32 msg_len; -- struct mmal_msg *msg; -- VCHI_HELD_MSG_T msg_handle; -- struct mmal_msg_context *msg_context; -- -- if (!instance) { -- pr_err("Message callback passed NULL instance\n"); -- return; -- } -- -- switch (reason) { -- case VCHI_CALLBACK_MSG_AVAILABLE: -- status = vchi_msg_hold(instance->handle, (void **)&msg, -- &msg_len, VCHI_FLAGS_NONE, &msg_handle); -- if (status) { -- pr_err("Unable to dequeue a message (%d)\n", status); -- break; -- } -- -- DBG_DUMP_MSG(msg, msg_len, "<<< reply message"); -- -- /* handling is different for buffer messages */ -- switch (msg->h.type) { -- case MMAL_MSG_TYPE_BUFFER_FROM_HOST: -- vchi_held_msg_release(&msg_handle); -- break; -- -- case MMAL_MSG_TYPE_EVENT_TO_HOST: -- event_to_host_cb(instance, msg, msg_len); -- vchi_held_msg_release(&msg_handle); -- -- break; -- -- case MMAL_MSG_TYPE_BUFFER_TO_HOST: -- buffer_to_host_cb(instance, msg, msg_len); -- vchi_held_msg_release(&msg_handle); -- break; -- -- default: -- /* messages dependent on header context to complete */ -- if (!msg->h.context) { -- pr_err("received message context was null!\n"); -- vchi_held_msg_release(&msg_handle); -- break; -- } -- -- msg_context = lookup_msg_context(instance, -- msg->h.context); -- if (!msg_context) { -- pr_err("received invalid message context %u!\n", -- msg->h.context); -- vchi_held_msg_release(&msg_handle); -- break; -- } -- -- /* fill in context values */ -- msg_context->u.sync.msg_handle = msg_handle; -- msg_context->u.sync.msg = msg; -- msg_context->u.sync.msg_len = msg_len; -- -- /* todo: should this check (completion_done() -- * == 1) for no one waiting? or do we need a -- * flag to tell us the completion has been -- * interrupted so we can free the message and -- * its context. This probably also solves the -- * message arriving after interruption todo -- * below -- */ -- -- /* complete message so caller knows it happened */ -- complete(&msg_context->u.sync.cmplt); -- break; -- } -- -- break; -- -- case VCHI_CALLBACK_BULK_RECEIVED: -- bulk_receive_cb(instance, bulk_ctx); -- break; -- -- case VCHI_CALLBACK_BULK_RECEIVE_ABORTED: -- bulk_abort_cb(instance, bulk_ctx); -- break; -- -- case VCHI_CALLBACK_SERVICE_CLOSED: -- /* TODO: consider if this requires action if received when -- * driver is not explicitly closing the service -- */ -- break; -- -- default: -- pr_err("Received unhandled message reason %d\n", reason); -- break; -- } --} -- --static int send_synchronous_mmal_msg(struct vchiq_mmal_instance *instance, -- struct mmal_msg *msg, -- unsigned int payload_len, -- struct mmal_msg **msg_out, -- VCHI_HELD_MSG_T *msg_handle_out) --{ -- struct mmal_msg_context *msg_context; -- int ret; -- unsigned long timeout; -- -- /* payload size must not cause message to exceed max size */ -- if (payload_len > -- (MMAL_MSG_MAX_SIZE - sizeof(struct mmal_msg_header))) { -- pr_err("payload length %d exceeds max:%d\n", payload_len, -- (int)(MMAL_MSG_MAX_SIZE - -- sizeof(struct mmal_msg_header))); -- return -EINVAL; -- } -- -- msg_context = get_msg_context(instance); -- if (IS_ERR(msg_context)) -- return PTR_ERR(msg_context); -- -- init_completion(&msg_context->u.sync.cmplt); -- -- msg->h.magic = MMAL_MAGIC; -- msg->h.context = msg_context->handle; -- msg->h.status = 0; -- -- DBG_DUMP_MSG(msg, (sizeof(struct mmal_msg_header) + payload_len), -- ">>> sync message"); -- -- vchi_service_use(instance->handle); -- -- ret = vchi_queue_kernel_message(instance->handle, -- msg, -- sizeof(struct mmal_msg_header) + -- payload_len); -- -- vchi_service_release(instance->handle); -- -- if (ret) { -- pr_err("error %d queuing message\n", ret); -- release_msg_context(msg_context); -- return ret; -- } -- -- timeout = wait_for_completion_timeout(&msg_context->u.sync.cmplt, -- 3 * HZ); -- if (timeout == 0) { -- pr_err("timed out waiting for sync completion\n"); -- ret = -ETIME; -- /* todo: what happens if the message arrives after aborting */ -- release_msg_context(msg_context); -- return ret; -- } -- -- *msg_out = msg_context->u.sync.msg; -- *msg_handle_out = msg_context->u.sync.msg_handle; -- release_msg_context(msg_context); -- -- return 0; --} -- --static void dump_port_info(struct vchiq_mmal_port *port) --{ -- pr_debug("port handle:0x%x enabled:%d\n", port->handle, port->enabled); -- -- pr_debug("buffer minimum num:%d size:%d align:%d\n", -- port->minimum_buffer.num, -- port->minimum_buffer.size, port->minimum_buffer.alignment); -- -- pr_debug("buffer recommended num:%d size:%d align:%d\n", -- port->recommended_buffer.num, -- port->recommended_buffer.size, -- port->recommended_buffer.alignment); -- -- pr_debug("buffer current values num:%d size:%d align:%d\n", -- port->current_buffer.num, -- port->current_buffer.size, port->current_buffer.alignment); -- -- pr_debug("elementary stream: type:%d encoding:0x%x variant:0x%x\n", -- port->format.type, -- port->format.encoding, port->format.encoding_variant); -- -- pr_debug(" bitrate:%d flags:0x%x\n", -- port->format.bitrate, port->format.flags); -- -- if (port->format.type == MMAL_ES_TYPE_VIDEO) { -- pr_debug -- ("es video format: width:%d height:%d colourspace:0x%x\n", -- port->es.video.width, port->es.video.height, -- port->es.video.color_space); -- -- pr_debug(" : crop xywh %d,%d,%d,%d\n", -- port->es.video.crop.x, -- port->es.video.crop.y, -- port->es.video.crop.width, port->es.video.crop.height); -- pr_debug(" : framerate %d/%d aspect %d/%d\n", -- port->es.video.frame_rate.num, -- port->es.video.frame_rate.den, -- port->es.video.par.num, port->es.video.par.den); -- } --} -- --static void port_to_mmal_msg(struct vchiq_mmal_port *port, struct mmal_port *p) --{ -- /* todo do readonly fields need setting at all? */ -- p->type = port->type; -- p->index = port->index; -- p->index_all = 0; -- p->is_enabled = port->enabled; -- p->buffer_num_min = port->minimum_buffer.num; -- p->buffer_size_min = port->minimum_buffer.size; -- p->buffer_alignment_min = port->minimum_buffer.alignment; -- p->buffer_num_recommended = port->recommended_buffer.num; -- p->buffer_size_recommended = port->recommended_buffer.size; -- -- /* only three writable fields in a port */ -- p->buffer_num = port->current_buffer.num; -- p->buffer_size = port->current_buffer.size; -- p->userdata = (u32)(unsigned long)port; --} -- --static int port_info_set(struct vchiq_mmal_instance *instance, -- struct vchiq_mmal_port *port) --{ -- int ret; -- struct mmal_msg m; -- struct mmal_msg *rmsg; -- VCHI_HELD_MSG_T rmsg_handle; -- -- pr_debug("setting port info port %p\n", port); -- if (!port) -- return -1; -- dump_port_info(port); -- -- m.h.type = MMAL_MSG_TYPE_PORT_INFO_SET; -- -- m.u.port_info_set.component_handle = port->component->handle; -- m.u.port_info_set.port_type = port->type; -- m.u.port_info_set.port_index = port->index; -- -- port_to_mmal_msg(port, &m.u.port_info_set.port); -- -- /* elementary stream format setup */ -- m.u.port_info_set.format.type = port->format.type; -- m.u.port_info_set.format.encoding = port->format.encoding; -- m.u.port_info_set.format.encoding_variant = -- port->format.encoding_variant; -- m.u.port_info_set.format.bitrate = port->format.bitrate; -- m.u.port_info_set.format.flags = port->format.flags; -- -- memcpy(&m.u.port_info_set.es, &port->es, -- sizeof(union mmal_es_specific_format)); -- -- m.u.port_info_set.format.extradata_size = port->format.extradata_size; -- memcpy(&m.u.port_info_set.extradata, port->format.extradata, -- port->format.extradata_size); -- -- ret = send_synchronous_mmal_msg(instance, &m, -- sizeof(m.u.port_info_set), -- &rmsg, &rmsg_handle); -- if (ret) -- return ret; -- -- if (rmsg->h.type != MMAL_MSG_TYPE_PORT_INFO_SET) { -- /* got an unexpected message type in reply */ -- ret = -EINVAL; -- goto release_msg; -- } -- -- /* return operation status */ -- ret = -rmsg->u.port_info_get_reply.status; -- -- pr_debug("%s:result:%d component:0x%x port:%d\n", __func__, ret, -- port->component->handle, port->handle); -- --release_msg: -- vchi_held_msg_release(&rmsg_handle); -- -- return ret; --} -- --/* use port info get message to retrieve port information */ --static int port_info_get(struct vchiq_mmal_instance *instance, -- struct vchiq_mmal_port *port) --{ -- int ret; -- struct mmal_msg m; -- struct mmal_msg *rmsg; -- VCHI_HELD_MSG_T rmsg_handle; -- -- /* port info time */ -- m.h.type = MMAL_MSG_TYPE_PORT_INFO_GET; -- m.u.port_info_get.component_handle = port->component->handle; -- m.u.port_info_get.port_type = port->type; -- m.u.port_info_get.index = port->index; -- -- ret = send_synchronous_mmal_msg(instance, &m, -- sizeof(m.u.port_info_get), -- &rmsg, &rmsg_handle); -- if (ret) -- return ret; -- -- if (rmsg->h.type != MMAL_MSG_TYPE_PORT_INFO_GET) { -- /* got an unexpected message type in reply */ -- ret = -EINVAL; -- goto release_msg; -- } -- -- /* return operation status */ -- ret = -rmsg->u.port_info_get_reply.status; -- if (ret != MMAL_MSG_STATUS_SUCCESS) -- goto release_msg; -- -- if (rmsg->u.port_info_get_reply.port.is_enabled == 0) -- port->enabled = false; -- else -- port->enabled = true; -- -- /* copy the values out of the message */ -- port->handle = rmsg->u.port_info_get_reply.port_handle; -- -- /* port type and index cached to use on port info set because -- * it does not use a port handle -- */ -- port->type = rmsg->u.port_info_get_reply.port_type; -- port->index = rmsg->u.port_info_get_reply.port_index; -- -- port->minimum_buffer.num = -- rmsg->u.port_info_get_reply.port.buffer_num_min; -- port->minimum_buffer.size = -- rmsg->u.port_info_get_reply.port.buffer_size_min; -- port->minimum_buffer.alignment = -- rmsg->u.port_info_get_reply.port.buffer_alignment_min; -- -- port->recommended_buffer.alignment = -- rmsg->u.port_info_get_reply.port.buffer_alignment_min; -- port->recommended_buffer.num = -- rmsg->u.port_info_get_reply.port.buffer_num_recommended; -- -- port->current_buffer.num = rmsg->u.port_info_get_reply.port.buffer_num; -- port->current_buffer.size = -- rmsg->u.port_info_get_reply.port.buffer_size; -- -- /* stream format */ -- port->format.type = rmsg->u.port_info_get_reply.format.type; -- port->format.encoding = rmsg->u.port_info_get_reply.format.encoding; -- port->format.encoding_variant = -- rmsg->u.port_info_get_reply.format.encoding_variant; -- port->format.bitrate = rmsg->u.port_info_get_reply.format.bitrate; -- port->format.flags = rmsg->u.port_info_get_reply.format.flags; -- -- /* elementary stream format */ -- memcpy(&port->es, -- &rmsg->u.port_info_get_reply.es, -- sizeof(union mmal_es_specific_format)); -- port->format.es = &port->es; -- -- port->format.extradata_size = -- rmsg->u.port_info_get_reply.format.extradata_size; -- memcpy(port->format.extradata, -- rmsg->u.port_info_get_reply.extradata, -- port->format.extradata_size); -- -- pr_debug("received port info\n"); -- dump_port_info(port); -- --release_msg: -- -- pr_debug("%s:result:%d component:0x%x port:%d\n", -- __func__, ret, port->component->handle, port->handle); -- -- vchi_held_msg_release(&rmsg_handle); -- -- return ret; --} -- --/* create comonent on vc */ --static int create_component(struct vchiq_mmal_instance *instance, -- struct vchiq_mmal_component *component, -- const char *name) --{ -- int ret; -- struct mmal_msg m; -- struct mmal_msg *rmsg; -- VCHI_HELD_MSG_T rmsg_handle; -- -- /* build component create message */ -- m.h.type = MMAL_MSG_TYPE_COMPONENT_CREATE; -- m.u.component_create.client_component = (u32)(unsigned long)component; -- strncpy(m.u.component_create.name, name, -- sizeof(m.u.component_create.name)); -- -- ret = send_synchronous_mmal_msg(instance, &m, -- sizeof(m.u.component_create), -- &rmsg, &rmsg_handle); -- if (ret) -- return ret; -- -- if (rmsg->h.type != m.h.type) { -- /* got an unexpected message type in reply */ -- ret = -EINVAL; -- goto release_msg; -- } -- -- ret = -rmsg->u.component_create_reply.status; -- if (ret != MMAL_MSG_STATUS_SUCCESS) -- goto release_msg; -- -- /* a valid component response received */ -- component->handle = rmsg->u.component_create_reply.component_handle; -- component->inputs = rmsg->u.component_create_reply.input_num; -- component->outputs = rmsg->u.component_create_reply.output_num; -- component->clocks = rmsg->u.component_create_reply.clock_num; -- -- pr_debug("Component handle:0x%x in:%d out:%d clock:%d\n", -- component->handle, -- component->inputs, component->outputs, component->clocks); -- --release_msg: -- vchi_held_msg_release(&rmsg_handle); -- -- return ret; --} -- --/* destroys a component on vc */ --static int destroy_component(struct vchiq_mmal_instance *instance, -- struct vchiq_mmal_component *component) --{ -- int ret; -- struct mmal_msg m; -- struct mmal_msg *rmsg; -- VCHI_HELD_MSG_T rmsg_handle; -- -- m.h.type = MMAL_MSG_TYPE_COMPONENT_DESTROY; -- m.u.component_destroy.component_handle = component->handle; -- -- ret = send_synchronous_mmal_msg(instance, &m, -- sizeof(m.u.component_destroy), -- &rmsg, &rmsg_handle); -- if (ret) -- return ret; -- -- if (rmsg->h.type != m.h.type) { -- /* got an unexpected message type in reply */ -- ret = -EINVAL; -- goto release_msg; -- } -- -- ret = -rmsg->u.component_destroy_reply.status; -- --release_msg: -- -- vchi_held_msg_release(&rmsg_handle); -- -- return ret; --} -- --/* enable a component on vc */ --static int enable_component(struct vchiq_mmal_instance *instance, -- struct vchiq_mmal_component *component) --{ -- int ret; -- struct mmal_msg m; -- struct mmal_msg *rmsg; -- VCHI_HELD_MSG_T rmsg_handle; -- -- m.h.type = MMAL_MSG_TYPE_COMPONENT_ENABLE; -- m.u.component_enable.component_handle = component->handle; -- -- ret = send_synchronous_mmal_msg(instance, &m, -- sizeof(m.u.component_enable), -- &rmsg, &rmsg_handle); -- if (ret) -- return ret; -- -- if (rmsg->h.type != m.h.type) { -- /* got an unexpected message type in reply */ -- ret = -EINVAL; -- goto release_msg; -- } -- -- ret = -rmsg->u.component_enable_reply.status; -- --release_msg: -- vchi_held_msg_release(&rmsg_handle); -- -- return ret; --} -- --/* disable a component on vc */ --static int disable_component(struct vchiq_mmal_instance *instance, -- struct vchiq_mmal_component *component) --{ -- int ret; -- struct mmal_msg m; -- struct mmal_msg *rmsg; -- VCHI_HELD_MSG_T rmsg_handle; -- -- m.h.type = MMAL_MSG_TYPE_COMPONENT_DISABLE; -- m.u.component_disable.component_handle = component->handle; -- -- ret = send_synchronous_mmal_msg(instance, &m, -- sizeof(m.u.component_disable), -- &rmsg, &rmsg_handle); -- if (ret) -- return ret; -- -- if (rmsg->h.type != m.h.type) { -- /* got an unexpected message type in reply */ -- ret = -EINVAL; -- goto release_msg; -- } -- -- ret = -rmsg->u.component_disable_reply.status; -- --release_msg: -- -- vchi_held_msg_release(&rmsg_handle); -- -- return ret; --} -- --/* get version of mmal implementation */ --static int get_version(struct vchiq_mmal_instance *instance, -- u32 *major_out, u32 *minor_out) --{ -- int ret; -- struct mmal_msg m; -- struct mmal_msg *rmsg; -- VCHI_HELD_MSG_T rmsg_handle; -- -- m.h.type = MMAL_MSG_TYPE_GET_VERSION; -- -- ret = send_synchronous_mmal_msg(instance, &m, -- sizeof(m.u.version), -- &rmsg, &rmsg_handle); -- if (ret) -- return ret; -- -- if (rmsg->h.type != m.h.type) { -- /* got an unexpected message type in reply */ -- ret = -EINVAL; -- goto release_msg; -- } -- -- *major_out = rmsg->u.version.major; -- *minor_out = rmsg->u.version.minor; -- --release_msg: -- vchi_held_msg_release(&rmsg_handle); -- -- return ret; --} -- --/* do a port action with a port as a parameter */ --static int port_action_port(struct vchiq_mmal_instance *instance, -- struct vchiq_mmal_port *port, -- enum mmal_msg_port_action_type action_type) --{ -- int ret; -- struct mmal_msg m; -- struct mmal_msg *rmsg; -- VCHI_HELD_MSG_T rmsg_handle; -- -- m.h.type = MMAL_MSG_TYPE_PORT_ACTION; -- m.u.port_action_port.component_handle = port->component->handle; -- m.u.port_action_port.port_handle = port->handle; -- m.u.port_action_port.action = action_type; -- -- port_to_mmal_msg(port, &m.u.port_action_port.port); -- -- ret = send_synchronous_mmal_msg(instance, &m, -- sizeof(m.u.port_action_port), -- &rmsg, &rmsg_handle); -- if (ret) -- return ret; -- -- if (rmsg->h.type != MMAL_MSG_TYPE_PORT_ACTION) { -- /* got an unexpected message type in reply */ -- ret = -EINVAL; -- goto release_msg; -- } -- -- ret = -rmsg->u.port_action_reply.status; -- -- pr_debug("%s:result:%d component:0x%x port:%d action:%s(%d)\n", -- __func__, -- ret, port->component->handle, port->handle, -- port_action_type_names[action_type], action_type); -- --release_msg: -- vchi_held_msg_release(&rmsg_handle); -- -- return ret; --} -- --/* do a port action with handles as parameters */ --static int port_action_handle(struct vchiq_mmal_instance *instance, -- struct vchiq_mmal_port *port, -- enum mmal_msg_port_action_type action_type, -- u32 connect_component_handle, -- u32 connect_port_handle) --{ -- int ret; -- struct mmal_msg m; -- struct mmal_msg *rmsg; -- VCHI_HELD_MSG_T rmsg_handle; -- -- m.h.type = MMAL_MSG_TYPE_PORT_ACTION; -- -- m.u.port_action_handle.component_handle = port->component->handle; -- m.u.port_action_handle.port_handle = port->handle; -- m.u.port_action_handle.action = action_type; -- -- m.u.port_action_handle.connect_component_handle = -- connect_component_handle; -- m.u.port_action_handle.connect_port_handle = connect_port_handle; -- -- ret = send_synchronous_mmal_msg(instance, &m, -- sizeof(m.u.port_action_handle), -- &rmsg, &rmsg_handle); -- if (ret) -- return ret; -- -- if (rmsg->h.type != MMAL_MSG_TYPE_PORT_ACTION) { -- /* got an unexpected message type in reply */ -- ret = -EINVAL; -- goto release_msg; -- } -- -- ret = -rmsg->u.port_action_reply.status; -- -- pr_debug("%s:result:%d component:0x%x port:%d action:%s(%d) connect component:0x%x connect port:%d\n", -- __func__, -- ret, port->component->handle, port->handle, -- port_action_type_names[action_type], -- action_type, connect_component_handle, connect_port_handle); -- --release_msg: -- vchi_held_msg_release(&rmsg_handle); -- -- return ret; --} -- --static int port_parameter_set(struct vchiq_mmal_instance *instance, -- struct vchiq_mmal_port *port, -- u32 parameter_id, void *value, u32 value_size) --{ -- int ret; -- struct mmal_msg m; -- struct mmal_msg *rmsg; -- VCHI_HELD_MSG_T rmsg_handle; -- -- m.h.type = MMAL_MSG_TYPE_PORT_PARAMETER_SET; -- -- m.u.port_parameter_set.component_handle = port->component->handle; -- m.u.port_parameter_set.port_handle = port->handle; -- m.u.port_parameter_set.id = parameter_id; -- m.u.port_parameter_set.size = (2 * sizeof(u32)) + value_size; -- memcpy(&m.u.port_parameter_set.value, value, value_size); -- -- ret = send_synchronous_mmal_msg(instance, &m, -- (4 * sizeof(u32)) + value_size, -- &rmsg, &rmsg_handle); -- if (ret) -- return ret; -- -- if (rmsg->h.type != MMAL_MSG_TYPE_PORT_PARAMETER_SET) { -- /* got an unexpected message type in reply */ -- ret = -EINVAL; -- goto release_msg; -- } -- -- ret = -rmsg->u.port_parameter_set_reply.status; -- -- pr_debug("%s:result:%d component:0x%x port:%d parameter:%d\n", -- __func__, -- ret, port->component->handle, port->handle, parameter_id); -- --release_msg: -- vchi_held_msg_release(&rmsg_handle); -- -- return ret; --} -- --static int port_parameter_get(struct vchiq_mmal_instance *instance, -- struct vchiq_mmal_port *port, -- u32 parameter_id, void *value, u32 *value_size) --{ -- int ret; -- struct mmal_msg m; -- struct mmal_msg *rmsg; -- VCHI_HELD_MSG_T rmsg_handle; -- -- m.h.type = MMAL_MSG_TYPE_PORT_PARAMETER_GET; -- -- m.u.port_parameter_get.component_handle = port->component->handle; -- m.u.port_parameter_get.port_handle = port->handle; -- m.u.port_parameter_get.id = parameter_id; -- m.u.port_parameter_get.size = (2 * sizeof(u32)) + *value_size; -- -- ret = send_synchronous_mmal_msg(instance, &m, -- sizeof(struct -- mmal_msg_port_parameter_get), -- &rmsg, &rmsg_handle); -- if (ret) -- return ret; -- -- if (rmsg->h.type != MMAL_MSG_TYPE_PORT_PARAMETER_GET) { -- /* got an unexpected message type in reply */ -- pr_err("Incorrect reply type %d\n", rmsg->h.type); -- ret = -EINVAL; -- goto release_msg; -- } -- -- ret = -rmsg->u.port_parameter_get_reply.status; -- /* port_parameter_get_reply.size includes the header, -- * whilst *value_size doesn't. -- */ -- rmsg->u.port_parameter_get_reply.size -= (2 * sizeof(u32)); -- -- if (ret || rmsg->u.port_parameter_get_reply.size > *value_size) { -- /* Copy only as much as we have space for -- * but report true size of parameter -- */ -- memcpy(value, &rmsg->u.port_parameter_get_reply.value, -- *value_size); -- *value_size = rmsg->u.port_parameter_get_reply.size; -- } else { -- memcpy(value, &rmsg->u.port_parameter_get_reply.value, -- rmsg->u.port_parameter_get_reply.size); -- } -- -- pr_debug("%s:result:%d component:0x%x port:%d parameter:%d\n", __func__, -- ret, port->component->handle, port->handle, parameter_id); -- --release_msg: -- vchi_held_msg_release(&rmsg_handle); -- -- return ret; --} -- --/* disables a port and drains buffers from it */ --static int port_disable(struct vchiq_mmal_instance *instance, -- struct vchiq_mmal_port *port) --{ -- int ret; -- struct list_head *q, *buf_head; -- unsigned long flags = 0; -- -- if (!port->enabled) -- return 0; -- -- port->enabled = false; -- -- ret = port_action_port(instance, port, -- MMAL_MSG_PORT_ACTION_TYPE_DISABLE); -- if (ret == 0) { -- /* -- * Drain all queued buffers on port. This should only -- * apply to buffers that have been queued before the port -- * has been enabled. If the port has been enabled and buffers -- * passed, then the buffers should have been removed from this -- * list, and we should get the relevant callbacks via VCHIQ -- * to release the buffers. -- */ -- spin_lock_irqsave(&port->slock, flags); -- -- list_for_each_safe(buf_head, q, &port->buffers) { -- struct mmal_buffer *mmalbuf; -- -- mmalbuf = list_entry(buf_head, struct mmal_buffer, -- list); -- list_del(buf_head); -- if (port->buffer_cb) -- port->buffer_cb(instance, -- port, 0, mmalbuf, 0, 0, -- MMAL_TIME_UNKNOWN, -- MMAL_TIME_UNKNOWN); -- } -- -- spin_unlock_irqrestore(&port->slock, flags); -- -- ret = port_info_get(instance, port); -- } -- -- return ret; --} -- --/* enable a port */ --static int port_enable(struct vchiq_mmal_instance *instance, -- struct vchiq_mmal_port *port) --{ -- unsigned int hdr_count; -- struct list_head *q, *buf_head; -- int ret; -- -- if (port->enabled) -- return 0; -- -- ret = port_action_port(instance, port, -- MMAL_MSG_PORT_ACTION_TYPE_ENABLE); -- if (ret) -- goto done; -- -- port->enabled = true; -- -- if (port->buffer_cb) { -- /* send buffer headers to videocore */ -- hdr_count = 1; -- list_for_each_safe(buf_head, q, &port->buffers) { -- struct mmal_buffer *mmalbuf; -- -- mmalbuf = list_entry(buf_head, struct mmal_buffer, -- list); -- ret = buffer_from_host(instance, port, mmalbuf); -- if (ret) -- goto done; -- -- list_del(buf_head); -- hdr_count++; -- if (hdr_count > port->current_buffer.num) -- break; -- } -- } -- -- ret = port_info_get(instance, port); -- --done: -- return ret; --} -- --/* ------------------------------------------------------------------ -- * Exported API -- *------------------------------------------------------------------ -- */ -- --int vchiq_mmal_port_set_format(struct vchiq_mmal_instance *instance, -- struct vchiq_mmal_port *port) --{ -- int ret; -- -- if (mutex_lock_interruptible(&instance->vchiq_mutex)) -- return -EINTR; -- -- ret = port_info_set(instance, port); -- if (ret) -- goto release_unlock; -- -- /* read what has actually been set */ -- ret = port_info_get(instance, port); -- --release_unlock: -- mutex_unlock(&instance->vchiq_mutex); -- -- return ret; --} -- --int vchiq_mmal_port_parameter_set(struct vchiq_mmal_instance *instance, -- struct vchiq_mmal_port *port, -- u32 parameter, void *value, u32 value_size) --{ -- int ret; -- -- if (mutex_lock_interruptible(&instance->vchiq_mutex)) -- return -EINTR; -- -- ret = port_parameter_set(instance, port, parameter, value, value_size); -- -- mutex_unlock(&instance->vchiq_mutex); -- -- return ret; --} -- --int vchiq_mmal_port_parameter_get(struct vchiq_mmal_instance *instance, -- struct vchiq_mmal_port *port, -- u32 parameter, void *value, u32 *value_size) --{ -- int ret; -- -- if (mutex_lock_interruptible(&instance->vchiq_mutex)) -- return -EINTR; -- -- ret = port_parameter_get(instance, port, parameter, value, value_size); -- -- mutex_unlock(&instance->vchiq_mutex); -- -- return ret; --} -- --/* enable a port -- * -- * enables a port and queues buffers for satisfying callbacks if we -- * provide a callback handler -- */ --int vchiq_mmal_port_enable(struct vchiq_mmal_instance *instance, -- struct vchiq_mmal_port *port, -- vchiq_mmal_buffer_cb buffer_cb) --{ -- int ret; -- -- if (mutex_lock_interruptible(&instance->vchiq_mutex)) -- return -EINTR; -- -- /* already enabled - noop */ -- if (port->enabled) { -- ret = 0; -- goto unlock; -- } -- -- port->buffer_cb = buffer_cb; -- -- ret = port_enable(instance, port); -- --unlock: -- mutex_unlock(&instance->vchiq_mutex); -- -- return ret; --} -- --int vchiq_mmal_port_disable(struct vchiq_mmal_instance *instance, -- struct vchiq_mmal_port *port) --{ -- int ret; -- -- if (mutex_lock_interruptible(&instance->vchiq_mutex)) -- return -EINTR; -- -- if (!port->enabled) { -- mutex_unlock(&instance->vchiq_mutex); -- return 0; -- } -- -- ret = port_disable(instance, port); -- -- mutex_unlock(&instance->vchiq_mutex); -- -- return ret; --} -- --/* ports will be connected in a tunneled manner so data buffers -- * are not handled by client. -- */ --int vchiq_mmal_port_connect_tunnel(struct vchiq_mmal_instance *instance, -- struct vchiq_mmal_port *src, -- struct vchiq_mmal_port *dst) --{ -- int ret; -- -- if (mutex_lock_interruptible(&instance->vchiq_mutex)) -- return -EINTR; -- -- /* disconnect ports if connected */ -- if (src->connected) { -- ret = port_disable(instance, src); -- if (ret) { -- pr_err("failed disabling src port(%d)\n", ret); -- goto release_unlock; -- } -- -- /* do not need to disable the destination port as they -- * are connected and it is done automatically -- */ -- -- ret = port_action_handle(instance, src, -- MMAL_MSG_PORT_ACTION_TYPE_DISCONNECT, -- src->connected->component->handle, -- src->connected->handle); -- if (ret < 0) { -- pr_err("failed disconnecting src port\n"); -- goto release_unlock; -- } -- src->connected->enabled = false; -- src->connected = NULL; -- } -- -- if (!dst) { -- /* do not make new connection */ -- ret = 0; -- pr_debug("not making new connection\n"); -- goto release_unlock; -- } -- -- /* copy src port format to dst */ -- dst->format.encoding = src->format.encoding; -- dst->es.video.width = src->es.video.width; -- dst->es.video.height = src->es.video.height; -- dst->es.video.crop.x = src->es.video.crop.x; -- dst->es.video.crop.y = src->es.video.crop.y; -- dst->es.video.crop.width = src->es.video.crop.width; -- dst->es.video.crop.height = src->es.video.crop.height; -- dst->es.video.frame_rate.num = src->es.video.frame_rate.num; -- dst->es.video.frame_rate.den = src->es.video.frame_rate.den; -- -- /* set new format */ -- ret = port_info_set(instance, dst); -- if (ret) { -- pr_debug("setting port info failed\n"); -- goto release_unlock; -- } -- -- /* read what has actually been set */ -- ret = port_info_get(instance, dst); -- if (ret) { -- pr_debug("read back port info failed\n"); -- goto release_unlock; -- } -- -- /* connect two ports together */ -- ret = port_action_handle(instance, src, -- MMAL_MSG_PORT_ACTION_TYPE_CONNECT, -- dst->component->handle, dst->handle); -- if (ret < 0) { -- pr_debug("connecting port %d:%d to %d:%d failed\n", -- src->component->handle, src->handle, -- dst->component->handle, dst->handle); -- goto release_unlock; -- } -- src->connected = dst; -- --release_unlock: -- -- mutex_unlock(&instance->vchiq_mutex); -- -- return ret; --} -- --int vchiq_mmal_submit_buffer(struct vchiq_mmal_instance *instance, -- struct vchiq_mmal_port *port, -- struct mmal_buffer *buffer) --{ -- unsigned long flags = 0; -- int ret; -- -- ret = buffer_from_host(instance, port, buffer); -- if (ret == -EINVAL) { -- /* Port is disabled. Queue for when it is enabled. */ -- spin_lock_irqsave(&port->slock, flags); -- list_add_tail(&buffer->list, &port->buffers); -- spin_unlock_irqrestore(&port->slock, flags); -- } -- -- return 0; --} -- --int mmal_vchi_buffer_init(struct vchiq_mmal_instance *instance, -- struct mmal_buffer *buf) --{ -- struct mmal_msg_context *msg_context = get_msg_context(instance); -- -- if (IS_ERR(msg_context)) -- return (PTR_ERR(msg_context)); -- -- buf->msg_context = msg_context; -- return 0; --} -- --int mmal_vchi_buffer_cleanup(struct mmal_buffer *buf) --{ -- struct mmal_msg_context *msg_context = buf->msg_context; -- -- if (msg_context) -- release_msg_context(msg_context); -- buf->msg_context = NULL; -- -- return 0; --} -- --/* Initialise a mmal component and its ports -- * -- */ --int vchiq_mmal_component_init(struct vchiq_mmal_instance *instance, -- const char *name, -- struct vchiq_mmal_component **component_out) --{ -- int ret; -- int idx; /* port index */ -- struct vchiq_mmal_component *component; -- -- if (mutex_lock_interruptible(&instance->vchiq_mutex)) -- return -EINTR; -- -- if (instance->component_idx == VCHIQ_MMAL_MAX_COMPONENTS) { -- ret = -EINVAL; /* todo is this correct error? */ -- goto unlock; -- } -- -- component = &instance->component[instance->component_idx]; -- -- ret = create_component(instance, component, name); -- if (ret < 0) { -- pr_err("%s: failed to create component %d (Not enough GPU mem?)\n", -- __func__, ret); -- goto unlock; -- } -- -- /* ports info needs gathering */ -- component->control.type = MMAL_PORT_TYPE_CONTROL; -- component->control.index = 0; -- component->control.component = component; -- spin_lock_init(&component->control.slock); -- INIT_LIST_HEAD(&component->control.buffers); -- ret = port_info_get(instance, &component->control); -- if (ret < 0) -- goto release_component; -- -- for (idx = 0; idx < component->inputs; idx++) { -- component->input[idx].type = MMAL_PORT_TYPE_INPUT; -- component->input[idx].index = idx; -- component->input[idx].component = component; -- spin_lock_init(&component->input[idx].slock); -- INIT_LIST_HEAD(&component->input[idx].buffers); -- ret = port_info_get(instance, &component->input[idx]); -- if (ret < 0) -- goto release_component; -- } -- -- for (idx = 0; idx < component->outputs; idx++) { -- component->output[idx].type = MMAL_PORT_TYPE_OUTPUT; -- component->output[idx].index = idx; -- component->output[idx].component = component; -- spin_lock_init(&component->output[idx].slock); -- INIT_LIST_HEAD(&component->output[idx].buffers); -- ret = port_info_get(instance, &component->output[idx]); -- if (ret < 0) -- goto release_component; -- } -- -- for (idx = 0; idx < component->clocks; idx++) { -- component->clock[idx].type = MMAL_PORT_TYPE_CLOCK; -- component->clock[idx].index = idx; -- component->clock[idx].component = component; -- spin_lock_init(&component->clock[idx].slock); -- INIT_LIST_HEAD(&component->clock[idx].buffers); -- ret = port_info_get(instance, &component->clock[idx]); -- if (ret < 0) -- goto release_component; -- } -- -- instance->component_idx++; -- -- *component_out = component; -- -- mutex_unlock(&instance->vchiq_mutex); -- -- return 0; -- --release_component: -- destroy_component(instance, component); --unlock: -- mutex_unlock(&instance->vchiq_mutex); -- -- return ret; --} -- --/* -- * cause a mmal component to be destroyed -- */ --int vchiq_mmal_component_finalise(struct vchiq_mmal_instance *instance, -- struct vchiq_mmal_component *component) --{ -- int ret; -- -- if (mutex_lock_interruptible(&instance->vchiq_mutex)) -- return -EINTR; -- -- if (component->enabled) -- ret = disable_component(instance, component); -- -- ret = destroy_component(instance, component); -- -- mutex_unlock(&instance->vchiq_mutex); -- -- return ret; --} -- --/* -- * cause a mmal component to be enabled -- */ --int vchiq_mmal_component_enable(struct vchiq_mmal_instance *instance, -- struct vchiq_mmal_component *component) --{ -- int ret; -- -- if (mutex_lock_interruptible(&instance->vchiq_mutex)) -- return -EINTR; -- -- if (component->enabled) { -- mutex_unlock(&instance->vchiq_mutex); -- return 0; -- } -- -- ret = enable_component(instance, component); -- if (ret == 0) -- component->enabled = true; -- -- mutex_unlock(&instance->vchiq_mutex); -- -- return ret; --} -- --/* -- * cause a mmal component to be enabled -- */ --int vchiq_mmal_component_disable(struct vchiq_mmal_instance *instance, -- struct vchiq_mmal_component *component) --{ -- int ret; -- -- if (mutex_lock_interruptible(&instance->vchiq_mutex)) -- return -EINTR; -- -- if (!component->enabled) { -- mutex_unlock(&instance->vchiq_mutex); -- return 0; -- } -- -- ret = disable_component(instance, component); -- if (ret == 0) -- component->enabled = false; -- -- mutex_unlock(&instance->vchiq_mutex); -- -- return ret; --} -- --int vchiq_mmal_version(struct vchiq_mmal_instance *instance, -- u32 *major_out, u32 *minor_out) --{ -- int ret; -- -- if (mutex_lock_interruptible(&instance->vchiq_mutex)) -- return -EINTR; -- -- ret = get_version(instance, major_out, minor_out); -- -- mutex_unlock(&instance->vchiq_mutex); -- -- return ret; --} -- --int vchiq_mmal_finalise(struct vchiq_mmal_instance *instance) --{ -- int status = 0; -- -- if (!instance) -- return -EINVAL; -- -- if (mutex_lock_interruptible(&instance->vchiq_mutex)) -- return -EINTR; -- -- vchi_service_use(instance->handle); -- -- status = vchi_service_close(instance->handle); -- if (status != 0) -- pr_err("mmal-vchiq: VCHIQ close failed\n"); -- -- mutex_unlock(&instance->vchiq_mutex); -- -- flush_workqueue(instance->bulk_wq); -- destroy_workqueue(instance->bulk_wq); -- -- vfree(instance->bulk_scratch); -- -- idr_destroy(&instance->context_map); -- -- kfree(instance); -- -- return status; --} -- --int vchiq_mmal_init(struct vchiq_mmal_instance **out_instance) --{ -- int status; -- struct vchiq_mmal_instance *instance; -- static VCHI_CONNECTION_T *vchi_connection; -- static VCHI_INSTANCE_T vchi_instance; -- SERVICE_CREATION_T params = { -- .version = VCHI_VERSION_EX(VC_MMAL_VER, VC_MMAL_MIN_VER), -- .service_id = VC_MMAL_SERVER_NAME, -- .connection = vchi_connection, -- .rx_fifo_size = 0, -- .tx_fifo_size = 0, -- .callback = service_callback, -- .callback_param = NULL, -- .want_unaligned_bulk_rx = 1, -- .want_unaligned_bulk_tx = 1, -- .want_crc = 0 -- }; -- -- /* compile time checks to ensure structure size as they are -- * directly (de)serialised from memory. -- */ -- -- /* ensure the header structure has packed to the correct size */ -- BUILD_BUG_ON(sizeof(struct mmal_msg_header) != 24); -- -- /* ensure message structure does not exceed maximum length */ -- BUILD_BUG_ON(sizeof(struct mmal_msg) > MMAL_MSG_MAX_SIZE); -- -- /* mmal port struct is correct size */ -- BUILD_BUG_ON(sizeof(struct mmal_port) != 64); -- -- /* create a vchi instance */ -- status = vchi_initialise(&vchi_instance); -- if (status) { -- pr_err("Failed to initialise VCHI instance (status=%d)\n", -- status); -- return -EIO; -- } -- -- status = vchi_connect(NULL, 0, vchi_instance); -- if (status) { -- pr_err("Failed to connect VCHI instance (status=%d)\n", status); -- return -EIO; -- } -- -- instance = kzalloc(sizeof(*instance), GFP_KERNEL); -- -- if (!instance) -- return -ENOMEM; -- -- mutex_init(&instance->vchiq_mutex); -- -- instance->bulk_scratch = vmalloc(PAGE_SIZE); -- -- spin_lock_init(&instance->context_map_lock); -- idr_init_base(&instance->context_map, 1); -- -- params.callback_param = instance; -- -- instance->bulk_wq = alloc_ordered_workqueue("mmal-vchiq", -- WQ_MEM_RECLAIM); -- if (!instance->bulk_wq) -- goto err_free; -- -- status = vchi_service_open(vchi_instance, ¶ms, &instance->handle); -- if (status) { -- pr_err("Failed to open VCHI service connection (status=%d)\n", -- status); -- goto err_close_services; -- } -- -- vchi_service_release(instance->handle); -- -- *out_instance = instance; -- -- return 0; -- --err_close_services: -- vchi_service_close(instance->handle); -- destroy_workqueue(instance->bulk_wq); --err_free: -- vfree(instance->bulk_scratch); -- kfree(instance); -- return -ENODEV; --} --- /dev/null +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c -@@ -0,0 +1,1920 @@ +@@ -0,0 +1,1921 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Broadcom BM2835 V4L2 driver @@ -2186,7 +285,8 @@ Signed-off-by: Dave Stevenson + void *bulk_scratch; + + struct idr context_map; -+ spinlock_t context_map_lock; ++ /* protect accesses to context_map */ ++ struct mutex context_map_lock; + + /* component to use next */ + int component_idx; @@ -2212,10 +312,10 @@ Signed-off-by: Dave Stevenson + * that when we service the VCHI reply, we can look up what + * message is being replied to. + */ -+ spin_lock(&instance->context_map_lock); ++ mutex_lock(&instance->context_map_lock); + handle = idr_alloc(&instance->context_map, msg_context, + 0, 0, GFP_KERNEL); -+ spin_unlock(&instance->context_map_lock); ++ mutex_unlock(&instance->context_map_lock); + + if (handle < 0) { + kfree(msg_context); @@ -2239,9 +339,9 @@ Signed-off-by: Dave Stevenson +{ + struct vchiq_mmal_instance *instance = msg_context->instance; + -+ spin_lock(&instance->context_map_lock); ++ mutex_lock(&instance->context_map_lock); + idr_remove(&instance->context_map, msg_context->handle); -+ spin_unlock(&instance->context_map_lock); ++ mutex_unlock(&instance->context_map_lock); + kfree(msg_context); +} + @@ -3901,7 +2001,7 @@ Signed-off-by: Dave Stevenson + + instance->bulk_scratch = vmalloc(PAGE_SIZE); + -+ spin_lock_init(&instance->context_map_lock); ++ mutex_init(&instance->context_map_lock); + idr_init_base(&instance->context_map, 1); + + params.callback_param = instance; diff --git a/target/linux/brcm2708/patches-4.19/950-0268-staging-mmal-vchiq-Allocate-and-free-components-as-r.patch b/target/linux/brcm2708/patches-4.19/950-0268-staging-mmal-vchiq-Allocate-and-free-components-as-r.patch index fefea5d9b..4764ae297 100644 --- a/target/linux/brcm2708/patches-4.19/950-0268-staging-mmal-vchiq-Allocate-and-free-components-as-r.patch +++ b/target/linux/brcm2708/patches-4.19/950-0268-staging-mmal-vchiq-Allocate-and-free-components-as-r.patch @@ -30,16 +30,16 @@ Signed-off-by: Dave Stevenson /*#define FULL_MSG_DUMP 1*/ -@@ -173,8 +176,6 @@ struct vchiq_mmal_instance { - struct idr context_map; - spinlock_t context_map_lock; +@@ -174,8 +177,6 @@ struct vchiq_mmal_instance { + /* protect accesses to context_map */ + struct mutex context_map_lock; - /* component to use next */ - int component_idx; struct vchiq_mmal_component component[VCHIQ_MMAL_MAX_COMPONENTS]; /* ordered workqueue to process all bulk operations */ -@@ -1631,18 +1632,24 @@ int vchiq_mmal_component_init(struct vch +@@ -1632,18 +1633,24 @@ int vchiq_mmal_component_init(struct vch { int ret; int idx; /* port index */ @@ -68,7 +68,7 @@ Signed-off-by: Dave Stevenson ret = create_component(instance, component, name); if (ret < 0) { pr_err("%s: failed to create component %d (Not enough GPU mem?)\n", -@@ -1693,8 +1700,6 @@ int vchiq_mmal_component_init(struct vch +@@ -1694,8 +1701,6 @@ int vchiq_mmal_component_init(struct vch goto release_component; } @@ -77,7 +77,7 @@ Signed-off-by: Dave Stevenson *component_out = component; mutex_unlock(&instance->vchiq_mutex); -@@ -1704,6 +1709,8 @@ int vchiq_mmal_component_init(struct vch +@@ -1705,6 +1710,8 @@ int vchiq_mmal_component_init(struct vch release_component: destroy_component(instance, component); unlock: @@ -86,7 +86,7 @@ Signed-off-by: Dave Stevenson mutex_unlock(&instance->vchiq_mutex); return ret; -@@ -1726,6 +1733,8 @@ int vchiq_mmal_component_finalise(struct +@@ -1727,6 +1734,8 @@ int vchiq_mmal_component_finalise(struct ret = destroy_component(instance, component); diff --git a/target/linux/brcm2708/patches-4.19/950-0269-staging-mmal-vchiq-Avoid-use-of-bool-in-structures.patch b/target/linux/brcm2708/patches-4.19/950-0269-staging-mmal-vchiq-Avoid-use-of-bool-in-structures.patch index 9a2d44312..48cc89eec 100644 --- a/target/linux/brcm2708/patches-4.19/950-0269-staging-mmal-vchiq-Avoid-use-of-bool-in-structures.patch +++ b/target/linux/brcm2708/patches-4.19/950-0269-staging-mmal-vchiq-Avoid-use-of-bool-in-structures.patch @@ -14,7 +14,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c -@@ -860,9 +860,9 @@ static int port_info_get(struct vchiq_mm +@@ -861,9 +861,9 @@ static int port_info_get(struct vchiq_mm goto release_msg; if (rmsg->u.port_info_get_reply.port.is_enabled == 0) @@ -26,7 +26,7 @@ Signed-off-by: Dave Stevenson /* copy the values out of the message */ port->handle = rmsg->u.port_info_get_reply.port_handle; -@@ -1299,7 +1299,7 @@ static int port_disable(struct vchiq_mma +@@ -1300,7 +1300,7 @@ static int port_disable(struct vchiq_mma if (!port->enabled) return 0; @@ -35,7 +35,7 @@ Signed-off-by: Dave Stevenson ret = port_action_port(instance, port, MMAL_MSG_PORT_ACTION_TYPE_DISABLE); -@@ -1351,7 +1351,7 @@ static int port_enable(struct vchiq_mmal +@@ -1352,7 +1352,7 @@ static int port_enable(struct vchiq_mmal if (ret) goto done; @@ -44,7 +44,7 @@ Signed-off-by: Dave Stevenson if (port->buffer_cb) { /* send buffer headers to videocore */ -@@ -1523,7 +1523,7 @@ int vchiq_mmal_port_connect_tunnel(struc +@@ -1524,7 +1524,7 @@ int vchiq_mmal_port_connect_tunnel(struc pr_err("failed disconnecting src port\n"); goto release_unlock; } @@ -53,7 +53,7 @@ Signed-off-by: Dave Stevenson src->connected = NULL; } -@@ -1759,7 +1759,7 @@ int vchiq_mmal_component_enable(struct v +@@ -1760,7 +1760,7 @@ int vchiq_mmal_component_enable(struct v ret = enable_component(instance, component); if (ret == 0) @@ -62,7 +62,7 @@ Signed-off-by: Dave Stevenson mutex_unlock(&instance->vchiq_mutex); -@@ -1785,7 +1785,7 @@ int vchiq_mmal_component_disable(struct +@@ -1786,7 +1786,7 @@ int vchiq_mmal_component_disable(struct ret = disable_component(instance, component); if (ret == 0) diff --git a/target/linux/brcm2708/patches-4.19/950-0270-staging-mmal-vchiq-Make-timeout-a-defined-parameter.patch b/target/linux/brcm2708/patches-4.19/950-0270-staging-mmal-vchiq-Make-timeout-a-defined-parameter.patch index 6168d078f..bcccde74d 100644 --- a/target/linux/brcm2708/patches-4.19/950-0270-staging-mmal-vchiq-Make-timeout-a-defined-parameter.patch +++ b/target/linux/brcm2708/patches-4.19/950-0270-staging-mmal-vchiq-Make-timeout-a-defined-parameter.patch @@ -27,7 +27,7 @@ Signed-off-by: Dave Stevenson /*#define FULL_MSG_DUMP 1*/ #ifdef DEBUG -@@ -691,7 +697,7 @@ static int send_synchronous_mmal_msg(str +@@ -692,7 +698,7 @@ static int send_synchronous_mmal_msg(str } timeout = wait_for_completion_timeout(&msg_context->u.sync.cmplt, diff --git a/target/linux/brcm2708/patches-4.19/950-0271-staging-mmal-vchiq-Make-a-mmal_buf-struct-for-passin.patch b/target/linux/brcm2708/patches-4.19/950-0271-staging-mmal-vchiq-Make-a-mmal_buf-struct-for-passin.patch index daf73061f..d32aa8544 100644 --- a/target/linux/brcm2708/patches-4.19/950-0271-staging-mmal-vchiq-Make-a-mmal_buf-struct-for-passin.patch +++ b/target/linux/brcm2708/patches-4.19/950-0271-staging-mmal-vchiq-Make-a-mmal_buf-struct-for-passin.patch @@ -216,7 +216,7 @@ Signed-off-by: Dave Stevenson /* */ --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c -@@ -258,17 +258,25 @@ static void buffer_work_cb(struct work_s +@@ -259,17 +259,25 @@ static void buffer_work_cb(struct work_s { struct mmal_msg_context *msg_context = container_of(work, struct mmal_msg_context, u.bulk.work); @@ -247,7 +247,7 @@ Signed-off-by: Dave Stevenson } /* workqueue scheduled callback to handle receiving buffers -@@ -1326,11 +1334,14 @@ static int port_disable(struct vchiq_mma +@@ -1327,11 +1335,14 @@ static int port_disable(struct vchiq_mma mmalbuf = list_entry(buf_head, struct mmal_buffer, list); list_del(buf_head); diff --git a/target/linux/brcm2708/patches-4.19/950-0272-staging-mmal-vchiq-Add-support-for-event-callbacks.patch b/target/linux/brcm2708/patches-4.19/950-0272-staging-mmal-vchiq-Add-support-for-event-callbacks.patch index 4744405a4..34006c537 100644 --- a/target/linux/brcm2708/patches-4.19/950-0272-staging-mmal-vchiq-Add-support-for-event-callbacks.patch +++ b/target/linux/brcm2708/patches-4.19/950-0272-staging-mmal-vchiq-Add-support-for-event-callbacks.patch @@ -83,7 +83,7 @@ Signed-off-by: Dave Stevenson int status; /* context status */ -@@ -237,18 +239,6 @@ release_msg_context(struct mmal_msg_cont +@@ -238,18 +240,6 @@ release_msg_context(struct mmal_msg_cont kfree(msg_context); } @@ -102,7 +102,7 @@ Signed-off-by: Dave Stevenson /* workqueue scheduled callback * * we do this because it is important we do not call any other vchiq -@@ -270,13 +260,18 @@ static void buffer_work_cb(struct work_s +@@ -271,13 +261,18 @@ static void buffer_work_cb(struct work_s buffer->mmal_flags = msg_context->u.bulk.mmal_flags; buffer->dts = msg_context->u.bulk.dts; buffer->pts = msg_context->u.bulk.pts; @@ -122,7 +122,7 @@ Signed-off-by: Dave Stevenson } /* workqueue scheduled callback to handle receiving buffers -@@ -355,6 +350,7 @@ static int bulk_receive(struct vchiq_mma +@@ -356,6 +351,7 @@ static int bulk_receive(struct vchiq_mma msg_context->u.bulk.buffer_used = rd_len; msg_context->u.bulk.dts = msg->u.buffer_from_host.buffer_header.dts; msg_context->u.bulk.pts = msg->u.buffer_from_host.buffer_header.pts; @@ -130,7 +130,7 @@ Signed-off-by: Dave Stevenson queue_work(msg_context->instance->bulk_wq, &msg_context->u.bulk.buffer_to_host_work); -@@ -456,6 +452,103 @@ buffer_from_host(struct vchiq_mmal_insta +@@ -457,6 +453,103 @@ buffer_from_host(struct vchiq_mmal_insta return ret; } @@ -234,7 +234,7 @@ Signed-off-by: Dave Stevenson /* deals with receipt of buffer to host message */ static void buffer_to_host_cb(struct vchiq_mmal_instance *instance, struct mmal_msg *msg, u32 msg_len) -@@ -1339,6 +1432,7 @@ static int port_disable(struct vchiq_mma +@@ -1340,6 +1433,7 @@ static int port_disable(struct vchiq_mma mmalbuf->mmal_flags = 0; mmalbuf->dts = MMAL_TIME_UNKNOWN; mmalbuf->pts = MMAL_TIME_UNKNOWN; @@ -242,7 +242,7 @@ Signed-off-by: Dave Stevenson port->buffer_cb(instance, port, 0, mmalbuf); } -@@ -1640,6 +1734,43 @@ int mmal_vchi_buffer_cleanup(struct mmal +@@ -1641,6 +1735,43 @@ int mmal_vchi_buffer_cleanup(struct mmal } EXPORT_SYMBOL_GPL(mmal_vchi_buffer_cleanup); @@ -286,7 +286,7 @@ Signed-off-by: Dave Stevenson /* Initialise a mmal component and its ports * */ -@@ -1683,6 +1814,7 @@ int vchiq_mmal_component_init(struct vch +@@ -1684,6 +1815,7 @@ int vchiq_mmal_component_init(struct vch ret = port_info_get(instance, &component->control); if (ret < 0) goto release_component; @@ -294,7 +294,7 @@ Signed-off-by: Dave Stevenson for (idx = 0; idx < component->inputs; idx++) { component->input[idx].type = MMAL_PORT_TYPE_INPUT; -@@ -1693,6 +1825,7 @@ int vchiq_mmal_component_init(struct vch +@@ -1694,6 +1826,7 @@ int vchiq_mmal_component_init(struct vch ret = port_info_get(instance, &component->input[idx]); if (ret < 0) goto release_component; @@ -302,7 +302,7 @@ Signed-off-by: Dave Stevenson } for (idx = 0; idx < component->outputs; idx++) { -@@ -1704,6 +1837,7 @@ int vchiq_mmal_component_init(struct vch +@@ -1705,6 +1838,7 @@ int vchiq_mmal_component_init(struct vch ret = port_info_get(instance, &component->output[idx]); if (ret < 0) goto release_component; @@ -310,7 +310,7 @@ Signed-off-by: Dave Stevenson } for (idx = 0; idx < component->clocks; idx++) { -@@ -1715,6 +1849,7 @@ int vchiq_mmal_component_init(struct vch +@@ -1716,6 +1850,7 @@ int vchiq_mmal_component_init(struct vch ret = port_info_get(instance, &component->clock[idx]); if (ret < 0) goto release_component; @@ -318,7 +318,7 @@ Signed-off-by: Dave Stevenson } *component_out = component; -@@ -1740,7 +1875,7 @@ EXPORT_SYMBOL_GPL(vchiq_mmal_component_i +@@ -1741,7 +1876,7 @@ EXPORT_SYMBOL_GPL(vchiq_mmal_component_i int vchiq_mmal_component_finalise(struct vchiq_mmal_instance *instance, struct vchiq_mmal_component *component) { @@ -327,7 +327,7 @@ Signed-off-by: Dave Stevenson if (mutex_lock_interruptible(&instance->vchiq_mutex)) return -EINTR; -@@ -1752,6 +1887,13 @@ int vchiq_mmal_component_finalise(struct +@@ -1753,6 +1888,13 @@ int vchiq_mmal_component_finalise(struct component->in_use = 0; diff --git a/target/linux/brcm2708/patches-4.19/950-0273-staging-vc04_services-Support-sending-data-to-MMAL-p.patch b/target/linux/brcm2708/patches-4.19/950-0273-staging-vc04_services-Support-sending-data-to-MMAL-p.patch index 735ef4a4f..4d2a20fa5 100644 --- a/target/linux/brcm2708/patches-4.19/950-0273-staging-vc04_services-Support-sending-data-to-MMAL-p.patch +++ b/target/linux/brcm2708/patches-4.19/950-0273-staging-vc04_services-Support-sending-data-to-MMAL-p.patch @@ -15,7 +15,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c -@@ -427,11 +427,19 @@ buffer_from_host(struct vchiq_mmal_insta +@@ -428,11 +428,19 @@ buffer_from_host(struct vchiq_mmal_insta m.u.buffer_from_host.buffer_header.data = (u32)(unsigned long)buf->buffer; m.u.buffer_from_host.buffer_header.alloc_size = buf->buffer_size; diff --git a/target/linux/brcm2708/patches-4.19/950-0277-staging-vc04_services-Use-vc-sm-cma-to-support-zero-.patch b/target/linux/brcm2708/patches-4.19/950-0277-staging-vc04_services-Use-vc-sm-cma-to-support-zero-.patch index 93dbba1cc..5d4c7a53c 100644 --- a/target/linux/brcm2708/patches-4.19/950-0277-staging-vc04_services-Use-vc-sm-cma-to-support-zero-.patch +++ b/target/linux/brcm2708/patches-4.19/950-0277-staging-vc04_services-Use-vc-sm-cma-to-support-zero-.patch @@ -53,7 +53,7 @@ Signed-off-by: Dave Stevenson #define USE_VCHIQ_ARM #include "interface/vchi/vchi.h" -@@ -424,8 +427,13 @@ buffer_from_host(struct vchiq_mmal_insta +@@ -425,8 +428,13 @@ buffer_from_host(struct vchiq_mmal_insta /* buffer header */ m.u.buffer_from_host.buffer_header.cmd = 0; @@ -69,7 +69,7 @@ Signed-off-by: Dave Stevenson m.u.buffer_from_host.buffer_header.alloc_size = buf->buffer_size; if (port->type == MMAL_PORT_TYPE_OUTPUT) { m.u.buffer_from_host.buffer_header.length = 0; -@@ -590,6 +598,22 @@ static void buffer_to_host_cb(struct vch +@@ -591,6 +599,22 @@ static void buffer_to_host_cb(struct vch msg_context->u.bulk.status = msg->h.status; @@ -92,7 +92,7 @@ Signed-off-by: Dave Stevenson } else if (msg->u.buffer_from_host.buffer_header.length == 0) { /* empty buffer */ if (msg->u.buffer_from_host.buffer_header.flags & -@@ -1537,6 +1561,9 @@ int vchiq_mmal_port_parameter_set(struct +@@ -1538,6 +1562,9 @@ int vchiq_mmal_port_parameter_set(struct mutex_unlock(&instance->vchiq_mutex); @@ -102,7 +102,7 @@ Signed-off-by: Dave Stevenson return ret; } EXPORT_SYMBOL_GPL(vchiq_mmal_port_parameter_set); -@@ -1705,6 +1732,31 @@ int vchiq_mmal_submit_buffer(struct vchi +@@ -1706,6 +1733,31 @@ int vchiq_mmal_submit_buffer(struct vchi unsigned long flags = 0; int ret; @@ -134,7 +134,7 @@ Signed-off-by: Dave Stevenson ret = buffer_from_host(instance, port, buffer); if (ret == -EINVAL) { /* Port is disabled. Queue for when it is enabled. */ -@@ -1738,6 +1790,16 @@ int mmal_vchi_buffer_cleanup(struct mmal +@@ -1739,6 +1791,16 @@ int mmal_vchi_buffer_cleanup(struct mmal release_msg_context(msg_context); buf->msg_context = NULL; diff --git a/target/linux/brcm2708/patches-4.19/950-0278-media-videobuf2-Allow-exporting-of-a-struct-dmabuf.patch b/target/linux/brcm2708/patches-4.19/950-0278-media-videobuf2-Allow-exporting-of-a-struct-dmabuf.patch index 3972c0b6a..743faa2c3 100644 --- a/target/linux/brcm2708/patches-4.19/950-0278-media-videobuf2-Allow-exporting-of-a-struct-dmabuf.patch +++ b/target/linux/brcm2708/patches-4.19/950-0278-media-videobuf2-Allow-exporting-of-a-struct-dmabuf.patch @@ -19,7 +19,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/media/common/videobuf2/videobuf2-core.c +++ b/drivers/media/common/videobuf2/videobuf2-core.c -@@ -1847,12 +1847,12 @@ static int __find_plane_by_offset(struct +@@ -1851,12 +1851,12 @@ static int __find_plane_by_offset(struct return -EINVAL; } @@ -35,7 +35,7 @@ Signed-off-by: Dave Stevenson struct dma_buf *dbuf; if (q->memory != VB2_MEMORY_MMAP) { -@@ -1902,6 +1902,21 @@ int vb2_core_expbuf(struct vb2_queue *q, +@@ -1906,6 +1906,21 @@ int vb2_core_expbuf(struct vb2_queue *q, return -EINVAL; } diff --git a/target/linux/brcm2708/patches-4.19/950-0285-media-vb2-Allow-reqbufs-0-with-in-use-MMAP-buffers.patch b/target/linux/brcm2708/patches-4.19/950-0285-media-vb2-Allow-reqbufs-0-with-in-use-MMAP-buffers.patch index df13c3b87..33c3242c9 100644 --- a/target/linux/brcm2708/patches-4.19/950-0285-media-vb2-Allow-reqbufs-0-with-in-use-MMAP-buffers.patch +++ b/target/linux/brcm2708/patches-4.19/950-0285-media-vb2-Allow-reqbufs-0-with-in-use-MMAP-buffers.patch @@ -36,7 +36,7 @@ Signed-off-by: Tomasz Figa --- a/drivers/media/common/videobuf2/videobuf2-core.c +++ b/drivers/media/common/videobuf2/videobuf2-core.c -@@ -550,20 +550,6 @@ bool vb2_buffer_in_use(struct vb2_queue +@@ -554,20 +554,6 @@ bool vb2_buffer_in_use(struct vb2_queue } EXPORT_SYMBOL(vb2_buffer_in_use); @@ -57,7 +57,7 @@ Signed-off-by: Tomasz Figa void vb2_core_querybuf(struct vb2_queue *q, unsigned int index, void *pb) { call_void_bufop(q, fill_user_buffer, q->bufs[index], pb); -@@ -675,16 +661,7 @@ int vb2_core_reqbufs(struct vb2_queue *q +@@ -679,16 +665,7 @@ int vb2_core_reqbufs(struct vb2_queue *q if (*count == 0 || q->num_buffers != 0 || (q->memory != VB2_MEMORY_UNKNOWN && q->memory != memory)) { diff --git a/target/linux/brcm2708/patches-4.19/950-0319-staging-mmal-vchiq-Fix-client_component-for-64-bit-k.patch b/target/linux/brcm2708/patches-4.19/950-0319-staging-mmal-vchiq-Fix-client_component-for-64-bit-k.patch index 098362baf..f06f3034e 100644 --- a/target/linux/brcm2708/patches-4.19/950-0319-staging-mmal-vchiq-Fix-client_component-for-64-bit-k.patch +++ b/target/linux/brcm2708/patches-4.19/950-0319-staging-mmal-vchiq-Fix-client_component-for-64-bit-k.patch @@ -22,7 +22,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c -@@ -472,9 +472,9 @@ buffer_from_host(struct vchiq_mmal_insta +@@ -473,9 +473,9 @@ buffer_from_host(struct vchiq_mmal_insta static void event_to_host_cb(struct vchiq_mmal_instance *instance, struct mmal_msg *msg, u32 msg_len) { @@ -34,7 +34,7 @@ Signed-off-by: Dave Stevenson struct vchiq_mmal_port *port = NULL; struct mmal_msg_context *msg_context; u32 port_num = msg->u.event_to_host.port_num; -@@ -1073,7 +1073,7 @@ static int create_component(struct vchiq +@@ -1074,7 +1074,7 @@ static int create_component(struct vchiq /* build component create message */ m.h.type = MMAL_MSG_TYPE_COMPONENT_CREATE; @@ -43,7 +43,7 @@ Signed-off-by: Dave Stevenson strncpy(m.u.component_create.name, name, sizeof(m.u.component_create.name)); -@@ -1868,6 +1868,12 @@ int vchiq_mmal_component_init(struct vch +@@ -1869,6 +1869,12 @@ int vchiq_mmal_component_init(struct vch goto unlock; } diff --git a/target/linux/brcm2708/patches-4.19/950-0346-staging-vc-sm-cma-Use-a-void-pointer-as-the-handle-w.patch b/target/linux/brcm2708/patches-4.19/950-0346-staging-vc-sm-cma-Use-a-void-pointer-as-the-handle-w.patch index a9205fbff..c26366353 100644 --- a/target/linux/brcm2708/patches-4.19/950-0346-staging-vc-sm-cma-Use-a-void-pointer-as-the-handle-w.patch +++ b/target/linux/brcm2708/patches-4.19/950-0346-staging-vc-sm-cma-Use-a-void-pointer-as-the-handle-w.patch @@ -100,7 +100,7 @@ Signed-off-by: Dave Stevenson u32 cmd; /* MMAL command. 0=data. */ --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c -@@ -1793,7 +1793,7 @@ int mmal_vchi_buffer_cleanup(struct mmal +@@ -1794,7 +1794,7 @@ int mmal_vchi_buffer_cleanup(struct mmal if (buf->vcsm_handle) { int ret; diff --git a/target/linux/brcm2708/patches-4.19/950-0359-staging-mmal-vchiq-Always-return-the-param-size-from.patch b/target/linux/brcm2708/patches-4.19/950-0359-staging-mmal-vchiq-Always-return-the-param-size-from.patch index 5e8b8e9b5..f43d5c441 100644 --- a/target/linux/brcm2708/patches-4.19/950-0359-staging-mmal-vchiq-Always-return-the-param-size-from.patch +++ b/target/linux/brcm2708/patches-4.19/950-0359-staging-mmal-vchiq-Always-return-the-param-size-from.patch @@ -22,7 +22,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c -@@ -1412,11 +1412,12 @@ static int port_parameter_get(struct vch +@@ -1413,11 +1413,12 @@ static int port_parameter_get(struct vch */ memcpy(value, &rmsg->u.port_parameter_get_reply.value, *value_size); diff --git a/target/linux/brcm2708/patches-4.19/950-0360-staging-mmal-vchiq-If-the-VPU-returns-an-error-don-t.patch b/target/linux/brcm2708/patches-4.19/950-0360-staging-mmal-vchiq-If-the-VPU-returns-an-error-don-t.patch index f79e49993..d9b3d7e77 100644 --- a/target/linux/brcm2708/patches-4.19/950-0360-staging-mmal-vchiq-If-the-VPU-returns-an-error-don-t.patch +++ b/target/linux/brcm2708/patches-4.19/950-0360-staging-mmal-vchiq-If-the-VPU-returns-an-error-don-t.patch @@ -17,7 +17,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c -@@ -1400,7 +1400,8 @@ static int port_parameter_get(struct vch +@@ -1401,7 +1401,8 @@ static int port_parameter_get(struct vch goto release_msg; } diff --git a/target/linux/brcm2708/patches-4.19/950-0364-staging-bcm2835_codec-Fix-handling-of-VB2_MEMORY_DMA.patch b/target/linux/brcm2708/patches-4.19/950-0364-staging-bcm2835_codec-Fix-handling-of-VB2_MEMORY_DMA.patch index 8e6e69356..5bd32d118 100644 --- a/target/linux/brcm2708/patches-4.19/950-0364-staging-bcm2835_codec-Fix-handling-of-VB2_MEMORY_DMA.patch +++ b/target/linux/brcm2708/patches-4.19/950-0364-staging-bcm2835_codec-Fix-handling-of-VB2_MEMORY_DMA.patch @@ -137,7 +137,7 @@ Signed-off-by: Dave Stevenson /* If both ports disabled, then disable the component */ --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c -@@ -1784,13 +1784,9 @@ int mmal_vchi_buffer_init(struct vchiq_m +@@ -1785,13 +1785,9 @@ int mmal_vchi_buffer_init(struct vchiq_m } EXPORT_SYMBOL_GPL(mmal_vchi_buffer_init); @@ -153,7 +153,7 @@ Signed-off-by: Dave Stevenson if (buf->vcsm_handle) { int ret; -@@ -1802,6 +1798,19 @@ int mmal_vchi_buffer_cleanup(struct mmal +@@ -1803,6 +1799,19 @@ int mmal_vchi_buffer_cleanup(struct mmal pr_err("%s: vcsm_free failed, ret %d\n", __func__, ret); buf->vcsm_handle = 0; } diff --git a/target/linux/brcm2708/patches-4.19/950-0488-staging-mmal-vchiq-Free-the-event-context-for-contro.patch b/target/linux/brcm2708/patches-4.19/950-0488-staging-mmal-vchiq-Free-the-event-context-for-contro.patch index 046ea7a1d..e5489018a 100644 --- a/target/linux/brcm2708/patches-4.19/950-0488-staging-mmal-vchiq-Free-the-event-context-for-contro.patch +++ b/target/linux/brcm2708/patches-4.19/950-0488-staging-mmal-vchiq-Free-the-event-context-for-contro.patch @@ -17,7 +17,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c -@@ -1981,6 +1981,8 @@ int vchiq_mmal_component_finalise(struct +@@ -1982,6 +1982,8 @@ int vchiq_mmal_component_finalise(struct for (idx = 0; idx < component->clocks; idx++) free_event_context(&component->clock[idx]); diff --git a/target/linux/brcm2708/patches-4.19/950-0489-staging-mmal-vchiq-Replace-spinlock-protecting-conte.patch b/target/linux/brcm2708/patches-4.19/950-0489-staging-mmal-vchiq-Replace-spinlock-protecting-conte.patch deleted file mode 100644 index 7b2744d74..000000000 --- a/target/linux/brcm2708/patches-4.19/950-0489-staging-mmal-vchiq-Replace-spinlock-protecting-conte.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 39464cbb618af3ddf6427d77b0c0be0042bcaaf9 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Wed, 1 May 2019 15:17:00 +0100 -Subject: [PATCH 489/703] staging: mmal-vchiq: Replace spinlock protecting - context_map with mutex - -950fd86 staging: bcm2835-camera: Replace open-coded idr with a struct idr. -replaced an internal implementation of an idr with the standard functions -and a spinlock. -idr_alloc(GFP_KERNEL) can sleep whilst calling kmem_cache_alloc to allocate -the new node, but this is not valid whilst in an atomic context due to the -spinlock. - -There is no need for this to be a spinlock as a standard mutex is -sufficient. - -Signed-off-by: Dave Stevenson ---- - .../staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 13 +++++++------ - 1 file changed, 7 insertions(+), 6 deletions(-) - ---- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c -+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c -@@ -185,7 +185,8 @@ struct vchiq_mmal_instance { - void *bulk_scratch; - - struct idr context_map; -- spinlock_t context_map_lock; -+ /* protect accesses to context_map */ -+ struct mutex context_map_lock; - - struct vchiq_mmal_component component[VCHIQ_MMAL_MAX_COMPONENTS]; - -@@ -209,10 +210,10 @@ get_msg_context(struct vchiq_mmal_instan - * that when we service the VCHI reply, we can look up what - * message is being replied to. - */ -- spin_lock(&instance->context_map_lock); -+ mutex_lock(&instance->context_map_lock); - handle = idr_alloc(&instance->context_map, msg_context, - 0, 0, GFP_KERNEL); -- spin_unlock(&instance->context_map_lock); -+ mutex_unlock(&instance->context_map_lock); - - if (handle < 0) { - kfree(msg_context); -@@ -236,9 +237,9 @@ release_msg_context(struct mmal_msg_cont - { - struct vchiq_mmal_instance *instance = msg_context->instance; - -- spin_lock(&instance->context_map_lock); -+ mutex_lock(&instance->context_map_lock); - idr_remove(&instance->context_map, msg_context->handle); -- spin_unlock(&instance->context_map_lock); -+ mutex_unlock(&instance->context_map_lock); - kfree(msg_context); - } - -@@ -2143,7 +2144,7 @@ int vchiq_mmal_init(struct vchiq_mmal_in - - instance->bulk_scratch = vmalloc(PAGE_SIZE); - -- spin_lock_init(&instance->context_map_lock); -+ mutex_init(&instance->context_map_lock); - idr_init_base(&instance->context_map, 1); - - params.callback_param = instance; diff --git a/target/linux/brcm2708/patches-4.19/950-0548-bcmgenet-Better-coalescing-parameter-defaults.patch b/target/linux/brcm2708/patches-4.19/950-0548-bcmgenet-Better-coalescing-parameter-defaults.patch index 939c8cde0..3577fcdb5 100644 --- a/target/linux/brcm2708/patches-4.19/950-0548-bcmgenet-Better-coalescing-parameter-defaults.patch +++ b/target/linux/brcm2708/patches-4.19/950-0548-bcmgenet-Better-coalescing-parameter-defaults.patch @@ -27,7 +27,7 @@ Signed-off-by: Phil Elwell /* Disable rate control for now */ bcmgenet_tdma_ring_writel(priv, index, flow_period_val, TDMA_FLOW_PERIOD); -@@ -3576,9 +3576,12 @@ static int bcmgenet_probe(struct platfor +@@ -3571,9 +3571,12 @@ static int bcmgenet_probe(struct platfor netif_set_real_num_rx_queues(priv->dev, priv->hw_params->rx_queues + 1); /* Set default coalescing parameters */ diff --git a/target/linux/brcm2708/patches-4.19/950-0696-Revert-media-vb2-Allow-reqbufs-0-with-in-use-MMAP-bu.patch b/target/linux/brcm2708/patches-4.19/950-0696-Revert-media-vb2-Allow-reqbufs-0-with-in-use-MMAP-bu.patch index 5bc0e98c8..2731d4613 100644 --- a/target/linux/brcm2708/patches-4.19/950-0696-Revert-media-vb2-Allow-reqbufs-0-with-in-use-MMAP-bu.patch +++ b/target/linux/brcm2708/patches-4.19/950-0696-Revert-media-vb2-Allow-reqbufs-0-with-in-use-MMAP-bu.patch @@ -15,7 +15,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/media/common/videobuf2/videobuf2-core.c +++ b/drivers/media/common/videobuf2/videobuf2-core.c -@@ -550,6 +550,20 @@ bool vb2_buffer_in_use(struct vb2_queue +@@ -554,6 +554,20 @@ bool vb2_buffer_in_use(struct vb2_queue } EXPORT_SYMBOL(vb2_buffer_in_use); @@ -36,7 +36,7 @@ Signed-off-by: Dave Stevenson void vb2_core_querybuf(struct vb2_queue *q, unsigned int index, void *pb) { call_void_bufop(q, fill_user_buffer, q->bufs[index], pb); -@@ -661,7 +675,16 @@ int vb2_core_reqbufs(struct vb2_queue *q +@@ -665,7 +679,16 @@ int vb2_core_reqbufs(struct vb2_queue *q if (*count == 0 || q->num_buffers != 0 || (q->memory != VB2_MEMORY_UNKNOWN && q->memory != memory)) { diff --git a/target/linux/brcm2708/patches-4.19/950-0699-media-vb2-Allow-reqbufs-0-with-in-use-MMAP-buffers.patch b/target/linux/brcm2708/patches-4.19/950-0699-media-vb2-Allow-reqbufs-0-with-in-use-MMAP-buffers.patch index 0ee04e6c2..145fd71a0 100644 --- a/target/linux/brcm2708/patches-4.19/950-0699-media-vb2-Allow-reqbufs-0-with-in-use-MMAP-buffers.patch +++ b/target/linux/brcm2708/patches-4.19/950-0699-media-vb2-Allow-reqbufs-0-with-in-use-MMAP-buffers.patch @@ -92,7 +92,7 @@ Signed-off-by: Mauro Carvalho Chehab ============ --- a/drivers/media/common/videobuf2/videobuf2-core.c +++ b/drivers/media/common/videobuf2/videobuf2-core.c -@@ -680,11 +680,9 @@ int vb2_core_reqbufs(struct vb2_queue *q +@@ -684,11 +684,9 @@ int vb2_core_reqbufs(struct vb2_queue *q * are not in use and can be freed. */ mutex_lock(&q->mmap_lock); diff --git a/target/linux/brcm47xx/patches-4.14/159-cpu_fixes.patch b/target/linux/brcm47xx/patches-4.14/159-cpu_fixes.patch index 3de77b1af..8dc8664c9 100644 --- a/target/linux/brcm47xx/patches-4.14/159-cpu_fixes.patch +++ b/target/linux/brcm47xx/patches-4.14/159-cpu_fixes.patch @@ -458,7 +458,7 @@ /* --- a/arch/mips/mm/tlbex.c +++ b/arch/mips/mm/tlbex.c -@@ -971,6 +971,9 @@ void build_get_pgde32(u32 **p, unsigned +@@ -976,6 +976,9 @@ void build_get_pgde32(u32 **p, unsigned uasm_i_srl(p, ptr, ptr, SMP_CPUID_PTRSHIFT); uasm_i_addu(p, ptr, tmp, ptr); #else @@ -468,7 +468,7 @@ UASM_i_LA_mostly(p, ptr, pgdc); #endif uasm_i_mfc0(p, tmp, C0_BADVADDR); /* get faulting address */ -@@ -1331,6 +1334,9 @@ static void build_r4000_tlb_refill_handl +@@ -1337,6 +1340,9 @@ static void build_r4000_tlb_refill_handl #ifdef CONFIG_64BIT build_get_pmde64(&p, &l, &r, K0, K1); /* get pmd in K1 */ #else @@ -478,7 +478,7 @@ build_get_pgde32(&p, K0, K1); /* get pgd in K1 */ #endif -@@ -1342,6 +1348,9 @@ static void build_r4000_tlb_refill_handl +@@ -1348,6 +1354,9 @@ static void build_r4000_tlb_refill_handl build_update_entries(&p, K0, K1); build_tlb_write_entry(&p, &l, &r, tlb_random); uasm_l_leave(&l, p); @@ -488,7 +488,7 @@ uasm_i_eret(&p); /* return from trap */ } #ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT -@@ -2046,6 +2055,9 @@ build_r4000_tlbchange_handler_head(u32 * +@@ -2057,6 +2066,9 @@ build_r4000_tlbchange_handler_head(u32 * #ifdef CONFIG_64BIT build_get_pmde64(p, l, r, wr.r1, wr.r2); /* get pmd in ptr */ #else @@ -498,7 +498,7 @@ build_get_pgde32(p, wr.r1, wr.r2); /* get pgd in ptr */ #endif -@@ -2092,6 +2104,9 @@ build_r4000_tlbchange_handler_tail(u32 * +@@ -2103,6 +2115,9 @@ build_r4000_tlbchange_handler_tail(u32 * build_tlb_write_entry(p, l, r, tlb_indexed); uasm_l_leave(l, *p); build_restore_work_registers(p); diff --git a/target/linux/brcm47xx/patches-4.19/159-cpu_fixes.patch b/target/linux/brcm47xx/patches-4.19/159-cpu_fixes.patch index 68fdc5066..0207029dd 100644 --- a/target/linux/brcm47xx/patches-4.19/159-cpu_fixes.patch +++ b/target/linux/brcm47xx/patches-4.19/159-cpu_fixes.patch @@ -458,7 +458,7 @@ /* --- a/arch/mips/mm/tlbex.c +++ b/arch/mips/mm/tlbex.c -@@ -967,6 +967,9 @@ void build_get_pgde32(u32 **p, unsigned +@@ -972,6 +972,9 @@ void build_get_pgde32(u32 **p, unsigned uasm_i_srl(p, ptr, ptr, SMP_CPUID_PTRSHIFT); uasm_i_addu(p, ptr, tmp, ptr); #else @@ -468,7 +468,7 @@ UASM_i_LA_mostly(p, ptr, pgdc); #endif uasm_i_mfc0(p, tmp, C0_BADVADDR); /* get faulting address */ -@@ -1327,6 +1330,9 @@ static void build_r4000_tlb_refill_handl +@@ -1333,6 +1336,9 @@ static void build_r4000_tlb_refill_handl #ifdef CONFIG_64BIT build_get_pmde64(&p, &l, &r, K0, K1); /* get pmd in K1 */ #else @@ -478,7 +478,7 @@ build_get_pgde32(&p, K0, K1); /* get pgd in K1 */ #endif -@@ -1338,6 +1344,9 @@ static void build_r4000_tlb_refill_handl +@@ -1344,6 +1350,9 @@ static void build_r4000_tlb_refill_handl build_update_entries(&p, K0, K1); build_tlb_write_entry(&p, &l, &r, tlb_random); uasm_l_leave(&l, p); @@ -488,7 +488,7 @@ uasm_i_eret(&p); /* return from trap */ } #ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT -@@ -2028,6 +2037,9 @@ build_r4000_tlbchange_handler_head(u32 * +@@ -2039,6 +2048,9 @@ build_r4000_tlbchange_handler_head(u32 * #ifdef CONFIG_64BIT build_get_pmde64(p, l, r, wr.r1, wr.r2); /* get pmd in ptr */ #else @@ -498,7 +498,7 @@ build_get_pgde32(p, wr.r1, wr.r2); /* get pgd in ptr */ #endif -@@ -2074,6 +2086,9 @@ build_r4000_tlbchange_handler_tail(u32 * +@@ -2085,6 +2097,9 @@ build_r4000_tlbchange_handler_tail(u32 * build_tlb_write_entry(p, l, r, tlb_indexed); uasm_l_leave(l, *p); build_restore_work_registers(p); diff --git a/target/linux/gemini/Makefile b/target/linux/gemini/Makefile index 304e51598..3afc64302 100644 --- a/target/linux/gemini/Makefile +++ b/target/linux/gemini/Makefile @@ -13,7 +13,7 @@ FEATURES:=squashfs pci rtc usb dt gpio display ext4 rootfs-part boot-part CPU_TYPE:=fa526 MAINTAINER:=Roman Yeryomin -KERNEL_PATCHVER:=4.14 +KERNEL_PATCHVER:=4.19 define Target/Description Build firmware images for the StorLink/Cortina Gemini CS351x ARM FA526 CPU diff --git a/target/linux/gemini/base-files/etc/uci-defaults/09_fix-checksum b/target/linux/gemini/base-files/etc/uci-defaults/09_fix-checksum new file mode 100644 index 000000000..5f79d1a65 --- /dev/null +++ b/target/linux/gemini/base-files/etc/uci-defaults/09_fix-checksum @@ -0,0 +1,20 @@ +#!/bin/sh +# +# Copyright (C) 2019 OpenWrt.org +# + +. /lib/functions.sh + +board=$(board_name) + +fixwrgg() { + local kernel_size=$(sed -n 's/mtd[0-9]*: \([0-9a-f]*\).*"kernel".*/\1/p' /proc/mtd) + + [ "$kernel_size" ] && mtd -c 0x$kernel_size fixwrgg firmware +} + +case "$board" in +dlink,dir-685) + fixwrgg + ;; +esac diff --git a/target/linux/gemini/base-files/lib/preinit/05_set_ether_mac_gemini b/target/linux/gemini/base-files/lib/preinit/05_set_ether_mac_gemini index 1ce5c8067..e387b3c72 100644 --- a/target/linux/gemini/base-files/lib/preinit/05_set_ether_mac_gemini +++ b/target/linux/gemini/base-files/lib/preinit/05_set_ether_mac_gemini @@ -1,27 +1,54 @@ #!/bin/sh +. /lib/functions.sh +. /lib/functions/system.sh + set_ether_mac() { - # Most devices have a standard "VCTL" partition - CONFIG_PARTITION="$(grep "VCTL" /proc/mtd | cut -d: -f1)" - if [ ! -z $CONFIG_PARTITION ] ; then - MAC1="$(strings /dev/$CONFIG_PARTITION |grep MAC|cut -d: -f2|cut -c3-14|sed -e 's,\(..\),:\1,g' -e 's,^:,,')" - MAC2="$(strings /dev/$CONFIG_PARTITION |grep MAC|cut -d: -f8|cut -c3-14|sed -e 's,\(..\),:\1,g' -e 's,^:,,')" + local part + local DEVID + local MAC1 + local MAC2 - ifconfig eth0 hw ether $MAC1 2>/dev/null - ifconfig eth1 hw ether $MAC2 2>/dev/null - return 0 - fi - - # The DNS-313 has a special field in its RedBoot - # binary that we need to check - CONFIG_PARTITION="$(grep "RedBoot" /proc/mtd | cut -d: -f1)" - if [ ! -z $CONFIG_PARTITION ] ; then - DEVID="$(dd if=/dev/mtdblock0 bs=1 skip=119508 count=7 2>/dev/null)" - if [ "x$DEVID" = "xdns-313" ] ; then - MAC1="$(dd if=/dev/mtdblock0 bs=1 skip=119540 count=6 2>/dev/null | hexdump -n6 -e '/1 ":%02X"' | sed s/^://g)" - ifconfig eth0 hw ether $MAC1 2>/dev/null - return 0 + case "$(board_name)" in + dlink,dns-313) + # The DNS-313 has a special field in its RedBoot + # binary that we need to check + part="$(find_mtd_part RedBoot)" + if [ -n "$part" ]; then + DEVID="$(dd if=$part bs=1 skip=119508 count=7 2>/dev/null)" + if [ "$DEVID" = "dns-313" ]; then + MAC1="$(mtd_get_mac_binary RedBoot 119540)" + ip link set eth0 address "$MAC1" 2>/dev/null + return 0 + fi fi + ;; + dlink,dir-685) + # The DIR-685 has a special field in its RedBoot + # binary that we need to check + part=$(find_mtd_part RedBoot) + if [ -n "$part" ] ; then + DEVID="$(dd if=$part bs=1 skip=81516 count=7 2>/dev/null)" + if [ "$DEVID" = "ILI9322" ] ; then + MAC1=$(mtd_get_mac_binary RedBoot 95040) + MAC2=$(mtd_get_mac_binary RedBoot 95046) + ip link set eth0 address "$MAC1" 2>/dev/null + ip link set eth1 address "$MAC2" 2>/dev/null + return 0 + fi + fi + ;; + esac + + # Most devices have a standard "VCTL" partition + part="$(find_mtd_part VCTL)" + if [ -n "$part" ]; then + MAC1="$(strings $part |grep MAC|cut -d: -f2|cut -c3-14|sed -e 's,\(..\),:\1,g' -e 's,^:,,')" + MAC2="$(strings $part |grep MAC|cut -d: -f8|cut -c3-14|sed -e 's,\(..\),:\1,g' -e 's,^:,,')" + + ip link set eth0 address "$MAC1" 2>/dev/null + ip link set eth1 address "$MAC2" 2>/dev/null + return 0 fi } diff --git a/target/linux/gemini/base-files/lib/upgrade/platform.sh b/target/linux/gemini/base-files/lib/upgrade/platform.sh new file mode 100644 index 000000000..bab2f9878 --- /dev/null +++ b/target/linux/gemini/base-files/lib/upgrade/platform.sh @@ -0,0 +1,25 @@ +REQUIRE_IMAGE_METADATA=1 + +platform_check_image() { + local board=$(board_name) + + case "$board" in + dlink,dir-685) + return 0 + ;; + esac + + echo "Sysupgrade is not yet supported on $board." + return 1 +} + +platform_do_upgrade() { + local board=$(board_name) + + case "$board" in + dlink,dir-685) + PART_NAME=firmware + default_do_upgrade "$1" + ;; + esac +} diff --git a/target/linux/gemini/config-4.14 b/target/linux/gemini/config-4.14 index ef5900771..fb96aa78c 100644 --- a/target/linux/gemini/config-4.14 +++ b/target/linux/gemini/config-4.14 @@ -44,7 +44,6 @@ CONFIG_ATA=y CONFIG_ATAGS=y CONFIG_ATA_VERBOSE_ERROR=y CONFIG_AUTO_ZRELADDR=y -CONFIG_BINFMT_MISC=y CONFIG_BLK_DEV_SD=y CONFIG_BLK_MQ_PCI=y CONFIG_BLK_SCSI_REQUEST=y @@ -56,8 +55,6 @@ CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y CONFIG_CLKDEV_LOOKUP=y CONFIG_CLKSRC_MMIO=y CONFIG_CLONE_BACKWARDS=y -CONFIG_CMDLINE="console=ttyS0,19200n8" -CONFIG_CMDLINE_FROM_BOOTLOADER=y CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK_GEMINI=y CONFIG_CONSOLE_TRANSLATIONS=y @@ -309,7 +306,6 @@ CONFIG_OF_PCI_IRQ=y CONFIG_OF_RESERVED_MEM=y CONFIG_OLD_SIGACTION=y CONFIG_OLD_SIGSUSPEND3=y -# CONFIG_PACKET is not set CONFIG_PAGE_OFFSET=0xC0000000 # CONFIG_PANIC_ON_OOPS is not set CONFIG_PANIC_ON_OOPS_VALUE=0 @@ -392,13 +388,10 @@ CONFIG_SPI_MASTER=y CONFIG_SPLIT_PTLOCK_CPUS=999999 CONFIG_SRCU=y # CONFIG_STAGING is not set -# CONFIG_STRICT_KERNEL_RWX is not set -# CONFIG_STRICT_MODULE_RWX is not set # CONFIG_STRIP_ASM_SYMS is not set CONFIG_SWIOTLB=y CONFIG_SWPHY=y CONFIG_SYNC_FILE=y -# CONFIG_SYN_COOKIES is not set CONFIG_SYSFS_SYSCALL=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y CONFIG_TASKS_RCU=y diff --git a/target/linux/gemini/config-4.19 b/target/linux/gemini/config-4.19 index 014175ea1..a817303ec 100644 --- a/target/linux/gemini/config-4.19 +++ b/target/linux/gemini/config-4.19 @@ -44,7 +44,6 @@ CONFIG_ATA=y CONFIG_ATAGS=y CONFIG_ATA_VERBOSE_ERROR=y CONFIG_AUTO_ZRELADDR=y -CONFIG_BINFMT_MISC=y CONFIG_BLK_DEV_SD=y CONFIG_BLK_MQ_PCI=y CONFIG_BLK_SCSI_REQUEST=y @@ -63,8 +62,6 @@ CONFIG_CMA_SIZE_MBYTES=16 CONFIG_CMA_SIZE_SEL_MBYTES=y # CONFIG_CMA_SIZE_SEL_MIN is not set # CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set -CONFIG_CMDLINE="console=ttyS0,19200n8" -CONFIG_CMDLINE_FROM_BOOTLOADER=y CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK_GEMINI=y CONFIG_CONSOLE_TRANSLATIONS=y @@ -323,7 +320,6 @@ CONFIG_MODULES_USE_ELF_REL=y # CONFIG_MODULE_UNLOAD is not set CONFIG_MQ_IOSCHED_DEADLINE=y CONFIG_MQ_IOSCHED_KYBER=y -# CONFIG_MSCC_OCELOT_SWITCH is not set CONFIG_MTD_CFI_STAA=y # CONFIG_MTD_IMPA7 is not set CONFIG_MTD_JEDECPROBE=y @@ -337,7 +333,6 @@ CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_KUSER_HELPERS=y CONFIG_NEED_PER_CPU_KM=y CONFIG_NET_DSA=y -# CONFIG_NET_DSA_LEGACY is not set CONFIG_NET_DSA_REALTEK_SMI=y CONFIG_NET_DSA_VITESSE_VSC73XX=y CONFIG_NET_NS=y @@ -360,7 +355,6 @@ CONFIG_OF_NET=y CONFIG_OF_RESERVED_MEM=y CONFIG_OLD_SIGACTION=y CONFIG_OLD_SIGSUSPEND3=y -# CONFIG_PACKET is not set CONFIG_PAGE_OFFSET=0xC0000000 # CONFIG_PANIC_ON_OOPS is not set CONFIG_PANIC_ON_OOPS_VALUE=0 @@ -447,12 +441,9 @@ CONFIG_SPI_MASTER=y CONFIG_SPLIT_PTLOCK_CPUS=999999 CONFIG_SRCU=y # CONFIG_STAGING is not set -# CONFIG_STRICT_KERNEL_RWX is not set -# CONFIG_STRICT_MODULE_RWX is not set # CONFIG_STRIP_ASM_SYMS is not set CONFIG_SWPHY=y CONFIG_SYNC_FILE=y -# CONFIG_SYN_COOKIES is not set CONFIG_SYSFS_SYSCALL=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y CONFIG_TASKS_RCU=y diff --git a/target/linux/gemini/image/ImageInfo-storlink_sl93512r b/target/linux/gemini/image/ImageInfo-storlink_sl93512r new file mode 100644 index 000000000..722e9b407 --- /dev/null +++ b/target/linux/gemini/image/ImageInfo-storlink_sl93512r @@ -0,0 +1,18 @@ +UpgradeImages="zImage rd.gz hddapp.tgz" +Procduction="SL3516" +BOOT_VER="1.0.5" +FIRMWARE_VER="firmware-openwrt-DATESTR" +INTERNAL_FIRMWARE_VER="firmware-openwrt-DATESTR" +CONFIGURATION_VER="firmware-openwrt" +DESCRIPTION="Storlink SL93512r Reference Design" +TSS="enabled" +DIRECT_MODE="disabled" +DEFAULT_LAN_IPADDR="192.168.1.1" +DEFAULT_LAN_NETMASK="255.255.255.0" +DEFAULT_LAN_BOOTPROTO="none" +DEFAULT_WAN_BOOTPROTO="dhcp" +DEFAULT_WAN_ENABLED="yes" +DEFAULT_WLAN_DEVICENAME="eth0" +VER_zImage="DATESTR" +VER_Ramdisk="DATESTR" +VER_hddapp="DATESTR" diff --git a/target/linux/gemini/image/Makefile b/target/linux/gemini/image/Makefile index 8fec250f1..ebcff633e 100644 --- a/target/linux/gemini/image/Makefile +++ b/target/linux/gemini/image/Makefile @@ -74,14 +74,15 @@ define Build/wiligear-image mv $@.new $@ endef -# Create the special NAS4220B and Itian Square One SQ201 image -# format with the squashfs and overlay inside the "rd.gz" file. +# Create the default image format used by the StorLink reference design +# SL93512r, Raidsonic NAS4220B and Itian Square One SQ201 +# with the squashfs and overlay inside the "rd.gz" file. # We pad it out to 6144K which is the size of the initramfs partition. # # The "application" partition is just blank. You can put anything # there when using OpenWRT. We just use that to create the # "sysupgrade" firmware image. -define Build/nas4220b-sq201-images +define Build/storlink-default-images mkdir -p $@.tmp mv $@ $@.tmp/rd.gz @@ -115,6 +116,7 @@ define Device/Default KERNEL_NAME := zImage KERNEL := kernel-bin | append-dtb BLOCKSIZE := 128k + SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) endef # A reasonable set of default packages handling the NAS type @@ -141,11 +143,11 @@ define Device/dlink_dir-685 DEVICE_TITLE := D-Link DIR-685 Xtreme N Storage Router DEVICE_DTS := gemini-dlink-dir-685 DEVICE_PACKAGES := $(GEMINI_NAS_PACKAGES) \ - kmod-switch-rtl8366rb swconfig \ kmod-rt2800-pci - IMAGES := factory.bin + IMAGES := factory.bin sysupgrade.bin # Pad to 128k erase blocks with 160 bytes WRGG header IMAGE/factory.bin := append-kernel | pad-offset 128k 160 | append-rootfs | dir685-pad-rootfs | dir685-image + IMAGE/sysupgrade.bin := append-kernel | pad-offset 128k 160 | dir685-image | append-rootfs | dir685-pad-rootfs | append-metadata endef TARGET_DEVICES += dlink_dir-685 @@ -161,15 +163,16 @@ define Device/dlink_dns-313 endef TARGET_DEVICES += dlink_dns-313 -define Device/itian-raidsonic +# Default images setup used by the StorLink reference designs +define Device/storlink-reference IMAGES := factory.bin IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 6144k | \ - nas4220b-sq201-images $(1) + storlink-default-images $(1) DEVICE_PACKAGES := $(GEMINI_NAS_PACKAGES) endef define Device/itian_sq201 - $(Device/itian-raidsonic) + $(Device/storlink-reference) DEVICE_TITLE := ITian Square One SQ201 DEVICE_DTS := gemini-sq201 DEVICE_PACKAGES += kmod-rt61-pci kmod-usb2-pci @@ -177,13 +180,21 @@ endef TARGET_DEVICES += itian_sq201 define Device/raidsonic_ib-4220-b - $(Device/itian-raidsonic) + $(Device/storlink-reference) DEVICE_TITLE := Raidsonic NAS IB-4220-B DEVICE_DTS := gemini-nas4220b DEVICE_TYPE := nas endef TARGET_DEVICES += raidsonic_ib-4220-b +define Device/storlink_sl93512r + $(Device/storlink-reference) + DEVICE_TITLE := StorLink SL93512r + DEVICE_DTS := gemini-sl93512r +endef +TARGET_DEVICES += storlink_sl93512r + + # The wiliboard images need some changes to be functional and buildable. # # The dts would need to use the ecoscentric,redboot-fis-partitions partition diff --git a/target/linux/gemini/patches-4.14/0013-ARM-dts-Add-basic-devicetree-for-D-Link-DNS-313.patch b/target/linux/gemini/patches-4.14/0013-ARM-dts-Add-basic-devicetree-for-D-Link-DNS-313.patch index cdf25a925..3d2f4ed8a 100644 --- a/target/linux/gemini/patches-4.14/0013-ARM-dts-Add-basic-devicetree-for-D-Link-DNS-313.patch +++ b/target/linux/gemini/patches-4.14/0013-ARM-dts-Add-basic-devicetree-for-D-Link-DNS-313.patch @@ -42,7 +42,7 @@ Signed-off-by: Linus Walleij + +/ { + model = "D-Link DNS-313 1-Bay Network Storage Enclosure"; -+ compatible = "dlink,dir-313", "cortina,gemini"; ++ compatible = "dlink,dns-313", "cortina,gemini"; + #address-cells = <1>; + #size-cells = <1>; + diff --git a/target/linux/gemini/patches-4.19/0020-ARM-dts-Augment-DIR-685-partition-table-for-OpenWrt.patch b/target/linux/gemini/patches-4.19/0020-ARM-dts-Augment-DIR-685-partition-table-for-OpenWrt.patch index bb4076558..6ef931c16 100644 --- a/target/linux/gemini/patches-4.19/0020-ARM-dts-Augment-DIR-685-partition-table-for-OpenWrt.patch +++ b/target/linux/gemini/patches-4.19/0020-ARM-dts-Augment-DIR-685-partition-table-for-OpenWrt.patch @@ -1,7 +1,7 @@ -From 854934b0ce8e758ce581f5ddbc30e618ab46fbdb Mon Sep 17 00:00:00 2001 +From ea99e7570882df53478f9b5fa5886a6e92fc2c7f Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Mon, 11 Mar 2019 15:44:29 +0100 -Subject: [PATCH 2/2] ARM: dts: Augment DIR-685 partition table for OpenWrt +Subject: [PATCH] ARM: dts: Augment DIR-685 partition table for OpenWrt Rename the firmware partition so that the firmware MTD splitter will do its job, drop the rootfs arguments as @@ -9,8 +9,8 @@ the MTD splitter will set this up automatically. Signed-off-by: Linus Walleij --- - arch/arm/boot/dts/gemini-dlink-dir-685.dts | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) + arch/arm/boot/dts/gemini-dlink-dir-685.dts | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) --- a/arch/arm/boot/dts/gemini-dlink-dir-685.dts +++ b/arch/arm/boot/dts/gemini-dlink-dir-685.dts @@ -23,7 +23,7 @@ Signed-off-by: Linus Walleij stdout-path = "uart0:19200n8"; }; -@@ -286,7 +286,8 @@ +@@ -286,9 +286,9 @@ * this is called "upgrade" on the vendor system. */ partition@40000 { @@ -31,5 +31,7 @@ Signed-off-by: Linus Walleij + compatible = "wrg"; + label = "firmware"; reg = <0x00040000 0x01f40000>; - read-only; +- read-only; }; + /* RGDB, Residental Gateway Database? */ + partition@1f80000 { diff --git a/target/linux/generic/backport-4.14/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch b/target/linux/generic/backport-4.14/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch index 86d101be2..fd90ad743 100644 --- a/target/linux/generic/backport-4.14/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch +++ b/target/linux/generic/backport-4.14/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch @@ -55,7 +55,7 @@ Cc: Kir Kolyshkin rwlock_t sk_callback_lock; --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -2743,6 +2743,7 @@ void sock_init_data(struct socket *sock, +@@ -2740,6 +2740,7 @@ void sock_init_data(struct socket *sock, sk->sk_max_pacing_rate = ~0U; sk->sk_pacing_rate = ~0U; diff --git a/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch b/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch index b60e9d323..a61a4ec17 100644 --- a/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch +++ b/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch @@ -30,7 +30,7 @@ Signed-off-by: Johan Hovold --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c -@@ -1947,7 +1947,8 @@ static const struct usb_device_id option +@@ -1948,7 +1948,8 @@ static const struct usb_device_id option { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d01, 0xff) }, /* D-Link DWM-156 (variant) */ { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d02, 0xff) }, { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d03, 0xff) }, diff --git a/target/linux/generic/backport-4.19/095-Allow-class-e-address-assignment-via-ifconfig-ioctl.patch b/target/linux/generic/backport-4.19/095-Allow-class-e-address-assignment-via-ifconfig-ioctl.patch index 5d49a406c..bf6d9aca3 100644 --- a/target/linux/generic/backport-4.19/095-Allow-class-e-address-assignment-via-ifconfig-ioctl.patch +++ b/target/linux/generic/backport-4.19/095-Allow-class-e-address-assignment-via-ifconfig-ioctl.patch @@ -48,7 +48,7 @@ Reviewed-by: John Gilmore #define INADDR_ANY ((unsigned long int) 0x00000000) --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c -@@ -941,7 +941,7 @@ static int inet_abc_len(__be32 addr) +@@ -949,7 +949,7 @@ static int inet_abc_len(__be32 addr) { int rc = -1; /* Something else, probably a multicast. */ @@ -57,7 +57,7 @@ Reviewed-by: John Gilmore rc = 0; else { __u32 haddr = ntohl(addr); -@@ -952,6 +952,8 @@ static int inet_abc_len(__be32 addr) +@@ -960,6 +960,8 @@ static int inet_abc_len(__be32 addr) rc = 16; else if (IN_CLASSC(haddr)) rc = 24; diff --git a/target/linux/generic/backport-4.19/343-netfilter-nft_flow_offload-handle-netdevice-events-f.patch b/target/linux/generic/backport-4.19/343-netfilter-nft_flow_offload-handle-netdevice-events-f.patch index 17133d552..0ef2f4880 100644 --- a/target/linux/generic/backport-4.19/343-netfilter-nft_flow_offload-handle-netdevice-events-f.patch +++ b/target/linux/generic/backport-4.19/343-netfilter-nft_flow_offload-handle-netdevice-events-f.patch @@ -48,7 +48,7 @@ Signed-off-by: Pablo Neira Ayuso MODULE_AUTHOR("Pablo Neira Ayuso "); --- a/net/netfilter/nft_flow_offload.c +++ b/net/netfilter/nft_flow_offload.c -@@ -197,47 +197,14 @@ static struct nft_expr_type nft_flow_off +@@ -208,47 +208,14 @@ static struct nft_expr_type nft_flow_off .owner = THIS_MODULE, }; diff --git a/target/linux/generic/backport-4.19/366-netfilter-nf_flow_table-clean-up-and-fix-dst-handlin.patch b/target/linux/generic/backport-4.19/366-netfilter-nf_flow_table-clean-up-and-fix-dst-handlin.patch index 23156b521..f63e081b6 100644 --- a/target/linux/generic/backport-4.19/366-netfilter-nf_flow_table-clean-up-and-fix-dst-handlin.patch +++ b/target/linux/generic/backport-4.19/366-netfilter-nf_flow_table-clean-up-and-fix-dst-handlin.patch @@ -25,9 +25,9 @@ Signed-off-by: Felix Fietkau - rt = (struct rtable *)flow->tuplehash[dir].tuple.dst_cache; + rt = (struct rtable *)flow->tuplehash[!dir].tuple.dst_cache; - if (unlikely(nf_flow_exceeds_mtu(skb, flow->tuplehash[dir].tuple.mtu)) && - (ip_hdr(skb)->frag_off & htons(IP_DF)) != 0) -@@ -465,7 +465,7 @@ nf_flow_offload_ipv6_hook(void *priv, st + if (unlikely(nf_flow_exceeds_mtu(skb, flow->tuplehash[dir].tuple.mtu))) + return NF_ACCEPT; +@@ -464,7 +464,7 @@ nf_flow_offload_ipv6_hook(void *priv, st dir = tuplehash->tuple.dir; flow = container_of(tuplehash, struct flow_offload, tuplehash[dir]); @@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau return NF_ACCEPT; --- a/net/netfilter/nft_flow_offload.c +++ b/net/netfilter/nft_flow_offload.c -@@ -18,13 +18,11 @@ struct nft_flow_offload { +@@ -17,13 +17,11 @@ struct nft_flow_offload { struct nft_flowtable *flowtable; }; @@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau struct flowi fl; memset(&fl, 0, sizeof(fl)); -@@ -39,8 +37,21 @@ static int nft_flow_route(const struct n +@@ -38,8 +36,21 @@ static int nft_flow_route(const struct n break; } diff --git a/target/linux/generic/backport-4.9/012-kbuild-add-macro-for-controlling-warnings-to-linux-c.patch b/target/linux/generic/backport-4.9/012-kbuild-add-macro-for-controlling-warnings-to-linux-c.patch index 4b22ca0e3..dc0eaa7b7 100644 --- a/target/linux/generic/backport-4.9/012-kbuild-add-macro-for-controlling-warnings-to-linux-c.patch +++ b/target/linux/generic/backport-4.9/012-kbuild-add-macro-for-controlling-warnings-to-linux-c.patch @@ -84,7 +84,7 @@ Signed-off-by: Masahiro Yamada --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h -@@ -338,3 +338,30 @@ +@@ -351,3 +351,30 @@ #if GCC_VERSION >= 50100 #define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1 #endif @@ -117,7 +117,7 @@ Signed-off-by: Masahiro Yamada + --- a/include/linux/compiler.h +++ b/include/linux/compiler.h -@@ -578,4 +578,23 @@ static __always_inline void __write_once +@@ -583,4 +583,23 @@ static __always_inline void __write_once # define __kprobes # define nokprobe_inline inline #endif diff --git a/target/linux/generic/config-4.19 b/target/linux/generic/config-4.19 index cd22a65d5..2dcd14a2f 100644 --- a/target/linux/generic/config-4.19 +++ b/target/linux/generic/config-4.19 @@ -351,7 +351,6 @@ CONFIG_ARM_GIC_MAX_NR=1 # CONFIG_ARM_UNWIND is not set # CONFIG_ARM_VIRT_EXT is not set # CONFIG_AS3935 is not set -# CONFIG_ASIX_PHY is not set # CONFIG_ASM9260_TIMER is not set # CONFIG_ASUS_LAPTOP is not set # CONFIG_ASUS_WIRELESS is not set @@ -425,6 +424,7 @@ CONFIG_ATM_CLIP_NO_ICMP=y # CONFIG_AX25 is not set # CONFIG_AX25_DAMA_SLAVE is not set # CONFIG_AX88796 is not set +# CONFIG_AX88796B_PHY is not set # CONFIG_AXP20X_ADC is not set # CONFIG_AXP20X_POWER is not set # CONFIG_AXP288_ADC is not set diff --git a/target/linux/generic/hack-4.14/645-netfilter-connmark-introduce-savedscp.patch b/target/linux/generic/hack-4.14/645-netfilter-connmark-introduce-savedscp.patch new file mode 100644 index 000000000..5217eca58 --- /dev/null +++ b/target/linux/generic/hack-4.14/645-netfilter-connmark-introduce-savedscp.patch @@ -0,0 +1,100 @@ +From 5a4d7714faa28c03e85d696fba82716fbda5c432 Mon Sep 17 00:00:00 2001 +From: Kevin Darbyshire-Bryant +Date: Sat, 23 Mar 2019 09:29:49 +0000 +Subject: [PATCH] netfilter: connmark: introduce savedscp + +savedscp is a method of storing the DSCP of an ip packet into conntrack +mark. In combination with a suitable tc filter action (conndscp but may +end up being integrated into connmark) DSCP values are able to be stored +on egress and restored on ingress across links that otherwise alter or +bleach DSCP. + +This is useful for qdiscs such as CAKE which are able to shape according +to policies based on DSCP. + +Ingress classification is traditionally a challenging task since +iptables rules haven't yet run and tc filter/eBPF programs are pre-NAT +lookups, hence are unable to see internal IPv4 addresses as used on the +typical home masquerading gateway. + +The ingress problem is solved by the tc filter, but the tc people didn't +like the idea of tc setting conntrack mark values, though they are ok +with reading conntrack values and hence restoring DSCP from conntrack +marks. + +x_tables CONNMARK with the new savedscp action solves the problem of +storing the DSCP to the conntrack mark. + +It accepts 2 parameters. The mark is a 32bit value with usually one 1 +bit set. This bit is set when savedscp saves the DSCP to the mark. +This is useful to implement a 'one shot' +iptables based classification where the 'complicated' iptables rules are +only run once to classify the connection on initial (egress) packet and +subsequent packets are all marked/restored with the same DSCP. A mark +of zero disables the setting of a status bit/s. + +The mask is a 32bit value of at least 6 contiguous bits and represents +the area where the DSCP will be stored. + +e.g. + +iptables -A QOS_MARK_eth0 -t mangle -j CONNMARK --savedscp-mark 0xfc000000/0x01000000 + +Would store the DSCP in the top 6 bits of the 32bit mark field, and use +the LSB of the top byte as the 'DSCP has been stored' marker. + +Signed-off-by: Kevin Darbyshire-Bryant +--- + include/uapi/linux/netfilter/xt_connmark.h | 3 ++- + net/netfilter/xt_connmark.c | 21 ++++++++++++++++++++- + 2 files changed, 22 insertions(+), 2 deletions(-) + +--- a/include/uapi/linux/netfilter/xt_connmark.h ++++ b/include/uapi/linux/netfilter/xt_connmark.h +@@ -16,7 +16,8 @@ + enum { + XT_CONNMARK_SET = 0, + XT_CONNMARK_SAVE, +- XT_CONNMARK_RESTORE ++ XT_CONNMARK_RESTORE, ++ XT_CONNMARK_SAVEDSCP + }; + + struct xt_connmark_tginfo1 { +--- a/net/netfilter/xt_connmark.c ++++ b/net/netfilter/xt_connmark.c +@@ -42,6 +42,7 @@ connmark_tg(struct sk_buff *skb, const s + enum ip_conntrack_info ctinfo; + struct nf_conn *ct; + u_int32_t newmark; ++ u_int8_t dscp, maskshift; + + ct = nf_ct_get(skb, &ctinfo); + if (ct == NULL) +@@ -57,7 +58,25 @@ connmark_tg(struct sk_buff *skb, const s + break; + case XT_CONNMARK_SAVE: + newmark = (ct->mark & ~info->ctmask) ^ +- (skb->mark & info->nfmask); ++ (skb->mark & info->nfmask); ++ if (ct->mark != newmark) { ++ ct->mark = newmark; ++ nf_conntrack_event_cache(IPCT_MARK, ct); ++ } ++ break; ++ case XT_CONNMARK_SAVEDSCP: ++ if (skb->protocol == htons(ETH_P_IP)) ++ dscp = ipv4_get_dsfield(ip_hdr(skb)) >> 2; ++ else if (skb->protocol == htons(ETH_P_IPV6)) ++ dscp = ipv6_get_dsfield(ipv6_hdr(skb)) >> 2; ++ else /* protocol doesn't have diffserv */ ++ break; ++ ++ /* nfmask contains the mask shift value */ ++ maskshift = info->nfmask & 0x1f; ++ newmark = (ct->mark & ~info->ctmark) | ++ (info->ctmask | (dscp << maskshift)); ++ + if (ct->mark != newmark) { + ct->mark = newmark; + nf_conntrack_event_cache(IPCT_MARK, ct); diff --git a/target/linux/generic/hack-4.14/901-debloat_sock_diag.patch b/target/linux/generic/hack-4.14/901-debloat_sock_diag.patch index 36d69c1df..118b1a79c 100644 --- a/target/linux/generic/hack-4.14/901-debloat_sock_diag.patch +++ b/target/linux/generic/hack-4.14/901-debloat_sock_diag.patch @@ -61,7 +61,7 @@ Signed-off-by: Felix Fietkau struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie) { struct dst_entry *dst = __sk_dst_get(sk); -@@ -1596,9 +1608,11 @@ void sk_destruct(struct sock *sk) +@@ -1593,9 +1605,11 @@ void sk_destruct(struct sock *sk) static void __sk_free(struct sock *sk) { diff --git a/target/linux/generic/hack-4.14/902-debloat_proc.patch b/target/linux/generic/hack-4.14/902-debloat_proc.patch index 8e7d6ac9f..12809bb1b 100644 --- a/target/linux/generic/hack-4.14/902-debloat_proc.patch +++ b/target/linux/generic/hack-4.14/902-debloat_proc.patch @@ -327,7 +327,7 @@ Signed-off-by: Felix Fietkau --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -3382,6 +3382,8 @@ static __net_initdata struct pernet_oper +@@ -3379,6 +3379,8 @@ static __net_initdata struct pernet_oper static int __init proto_init(void) { diff --git a/target/linux/generic/hack-4.19/259-regmap_dynamic.patch b/target/linux/generic/hack-4.19/259-regmap_dynamic.patch index 335ec4afc..ec4636dbe 100644 --- a/target/linux/generic/hack-4.19/259-regmap_dynamic.patch +++ b/target/linux/generic/hack-4.19/259-regmap_dynamic.patch @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau #include #include #include -@@ -3037,3 +3038,5 @@ static int __init regmap_initcall(void) +@@ -3039,3 +3040,5 @@ static int __init regmap_initcall(void) return 0; } postcore_initcall(regmap_initcall); diff --git a/target/linux/generic/hack-4.19/640-bridge-only-accept-EAP-locally.patch b/target/linux/generic/hack-4.19/640-bridge-only-accept-EAP-locally.patch index 981d49b9c..3de404807 100644 --- a/target/linux/generic/hack-4.19/640-bridge-only-accept-EAP-locally.patch +++ b/target/linux/generic/hack-4.19/640-bridge-only-accept-EAP-locally.patch @@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau --- a/net/bridge/br_input.c +++ b/net/bridge/br_input.c -@@ -110,10 +110,14 @@ int br_handle_frame_finish(struct net *n +@@ -108,10 +108,14 @@ int br_handle_frame_finish(struct net *n } } diff --git a/target/linux/generic/hack-4.19/647-netfilter-flow-acct.patch b/target/linux/generic/hack-4.19/647-netfilter-flow-acct.patch index aa842015f..fd8a87111 100644 --- a/target/linux/generic/hack-4.19/647-netfilter-flow-acct.patch +++ b/target/linux/generic/hack-4.19/647-netfilter-flow-acct.patch @@ -52,7 +52,7 @@ /* For layer 4 checksum field offset. */ #include #include -@@ -268,6 +269,7 @@ nf_flow_offload_ip_hook(void *priv, stru +@@ -267,6 +268,7 @@ nf_flow_offload_ip_hook(void *priv, stru skb->dev = outdev; nexthop = rt_nexthop(rt, flow->tuplehash[!dir].tuple.src_v4.s_addr); skb_dst_set_noref(skb, &rt->dst); @@ -60,7 +60,7 @@ neigh_xmit(NEIGH_ARP_TABLE, outdev, &nexthop, skb); return NF_STOLEN; -@@ -488,6 +490,7 @@ nf_flow_offload_ipv6_hook(void *priv, st +@@ -487,6 +489,7 @@ nf_flow_offload_ipv6_hook(void *priv, st skb->dev = outdev; nexthop = rt6_nexthop(rt, &flow->tuplehash[!dir].tuple.src_v6); skb_dst_set_noref(skb, &rt->dst); diff --git a/target/linux/generic/hack-4.19/661-use_fq_codel_by_default.patch b/target/linux/generic/hack-4.19/661-use_fq_codel_by_default.patch index 817c41801..74adfa0c4 100644 --- a/target/linux/generic/hack-4.19/661-use_fq_codel_by_default.patch +++ b/target/linux/generic/hack-4.19/661-use_fq_codel_by_default.patch @@ -55,7 +55,7 @@ Signed-off-by: Felix Fietkau register_qdisc(&pfifo_head_drop_qdisc_ops); --- a/net/sched/sch_fq_codel.c +++ b/net/sched/sch_fq_codel.c -@@ -716,7 +716,7 @@ static const struct Qdisc_class_ops fq_c +@@ -714,7 +714,7 @@ static const struct Qdisc_class_ops fq_c .walk = fq_codel_walk, }; @@ -64,7 +64,7 @@ Signed-off-by: Felix Fietkau .cl_ops = &fq_codel_class_ops, .id = "fq_codel", .priv_size = sizeof(struct fq_codel_sched_data), -@@ -731,6 +731,7 @@ static struct Qdisc_ops fq_codel_qdisc_o +@@ -729,6 +729,7 @@ static struct Qdisc_ops fq_codel_qdisc_o .dump_stats = fq_codel_dump_stats, .owner = THIS_MODULE, }; diff --git a/target/linux/generic/hack-4.19/702-phy_add_aneg_done_function.patch b/target/linux/generic/hack-4.19/702-phy_add_aneg_done_function.patch index 6fbcd43d6..9a9097d91 100644 --- a/target/linux/generic/hack-4.19/702-phy_add_aneg_done_function.patch +++ b/target/linux/generic/hack-4.19/702-phy_add_aneg_done_function.patch @@ -15,7 +15,7 @@ --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c -@@ -1506,6 +1506,9 @@ int genphy_update_link(struct phy_device +@@ -1512,6 +1512,9 @@ int genphy_update_link(struct phy_device { int status; diff --git a/target/linux/generic/hack-4.19/901-debloat_sock_diag.patch b/target/linux/generic/hack-4.19/901-debloat_sock_diag.patch index 33c8b7231..9f7ead6b1 100644 --- a/target/linux/generic/hack-4.19/901-debloat_sock_diag.patch +++ b/target/linux/generic/hack-4.19/901-debloat_sock_diag.patch @@ -61,7 +61,7 @@ Signed-off-by: Felix Fietkau struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie) { struct dst_entry *dst = __sk_dst_get(sk); -@@ -1601,9 +1613,11 @@ static void __sk_free(struct sock *sk) +@@ -1598,9 +1610,11 @@ static void __sk_free(struct sock *sk) if (likely(sk->sk_net_refcnt)) sock_inuse_add(sock_net(sk), -1); diff --git a/target/linux/generic/hack-4.19/902-debloat_proc.patch b/target/linux/generic/hack-4.19/902-debloat_proc.patch index ef272f171..a396ad0d1 100644 --- a/target/linux/generic/hack-4.19/902-debloat_proc.patch +++ b/target/linux/generic/hack-4.19/902-debloat_proc.patch @@ -221,7 +221,7 @@ Signed-off-by: Felix Fietkau if (!root_irq_dir) --- a/kernel/time/timer_list.c +++ b/kernel/time/timer_list.c -@@ -374,6 +374,8 @@ static int __init init_timer_list_procfs +@@ -375,6 +375,8 @@ static int __init init_timer_list_procfs { struct proc_dir_entry *pe; @@ -327,7 +327,7 @@ Signed-off-by: Felix Fietkau --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -3483,6 +3483,8 @@ static __net_initdata struct pernet_oper +@@ -3480,6 +3480,8 @@ static __net_initdata struct pernet_oper static int __init proto_init(void) { diff --git a/target/linux/generic/hack-4.19/904-debloat_dma_buf.patch b/target/linux/generic/hack-4.19/904-debloat_dma_buf.patch index a4b6e36d0..3cbafc701 100644 --- a/target/linux/generic/hack-4.19/904-debloat_dma_buf.patch +++ b/target/linux/generic/hack-4.19/904-debloat_dma_buf.patch @@ -45,7 +45,7 @@ Signed-off-by: Felix Fietkau #include -@@ -1158,4 +1159,5 @@ static void __exit dma_buf_deinit(void) +@@ -1159,4 +1160,5 @@ static void __exit dma_buf_deinit(void) { dma_buf_uninit_debugfs(); } diff --git a/target/linux/generic/hack-4.9/220-gc_sections.patch b/target/linux/generic/hack-4.9/220-gc_sections.patch index 945220ea0..c68342fe6 100644 --- a/target/linux/generic/hack-4.9/220-gc_sections.patch +++ b/target/linux/generic/hack-4.9/220-gc_sections.patch @@ -33,8 +33,8 @@ Signed-off-by: Gabor Juhos # Read KERNELRELEASE from include/config/kernel.release (if it exists) KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) -@@ -649,11 +654,6 @@ KBUILD_CFLAGS += $(call cc-disable-warni - KBUILD_CFLAGS += $(call cc-disable-warning, int-in-bool-context) +@@ -650,11 +655,6 @@ KBUILD_CFLAGS += $(call cc-disable-warni + KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) KBUILD_CFLAGS += $(call cc-disable-warning, attribute-alias) -ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION @@ -171,7 +171,7 @@ Signed-off-by: Gabor Juhos .init.data : { --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -55,6 +55,7 @@ config MIPS +@@ -56,6 +56,7 @@ config MIPS select CLONE_BACKWARDS select HAVE_DEBUG_STACKOVERFLOW select HAVE_CC_STACKPROTECTOR diff --git a/target/linux/generic/hack-4.9/301-mips_image_cmdline_hack.patch b/target/linux/generic/hack-4.9/301-mips_image_cmdline_hack.patch index 9bcd2a440..4d90c0782 100644 --- a/target/linux/generic/hack-4.9/301-mips_image_cmdline_hack.patch +++ b/target/linux/generic/hack-4.9/301-mips_image_cmdline_hack.patch @@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -1159,6 +1159,10 @@ config SYNC_R4K +@@ -1160,6 +1160,10 @@ config SYNC_R4K config MIPS_MACHINE def_bool n diff --git a/target/linux/generic/pending-4.14/630-packet_socket_type.patch b/target/linux/generic/pending-4.14/630-packet_socket_type.patch index 0b9addc36..57b076c55 100644 --- a/target/linux/generic/pending-4.14/630-packet_socket_type.patch +++ b/target/linux/generic/pending-4.14/630-packet_socket_type.patch @@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -3273,6 +3275,7 @@ static int packet_create(struct net *net +@@ -3287,6 +3289,7 @@ static int packet_create(struct net *net mutex_init(&po->pg_vec_lock); po->rollover = NULL; po->prot_hook.func = packet_rcv; @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; -@@ -3886,6 +3889,16 @@ packet_setsockopt(struct socket *sock, i +@@ -3900,6 +3903,16 @@ packet_setsockopt(struct socket *sock, i po->xmit = val ? packet_direct_xmit : dev_queue_xmit; return 0; } @@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau default: return -ENOPROTOOPT; } -@@ -3938,6 +3951,13 @@ static int packet_getsockopt(struct sock +@@ -3952,6 +3965,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR: val = po->has_vnet_hdr; break; @@ -128,7 +128,7 @@ Signed-off-by: Felix Fietkau break; --- a/net/packet/internal.h +++ b/net/packet/internal.h -@@ -131,6 +131,7 @@ struct packet_sock { +@@ -132,6 +132,7 @@ struct packet_sock { struct net_device __rcu *cached_dev; int (*xmit)(struct sk_buff *skb); struct packet_type prot_hook ____cacheline_aligned_in_smp; diff --git a/target/linux/generic/pending-4.19/100-MIPS-fix-build-on-non-linux-hosts.patch b/target/linux/generic/pending-4.19/100-MIPS-fix-build-on-non-linux-hosts.patch deleted file mode 100644 index 5d34df428..000000000 --- a/target/linux/generic/pending-4.19/100-MIPS-fix-build-on-non-linux-hosts.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 4ee213d8c2afeab9a68f8530317260298b4b6b82 Mon Sep 17 00:00:00 2001 -From: Kevin Darbyshire-Bryant -Date: Wed, 19 Jun 2019 08:16:33 +0100 -Subject: [PATCH] MIPS: fix build on non-linux hosts -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -calc_vmlinuz_load_addr.c requires SZ_64K to be defined for alignment -purposes. It included "../../../../include/linux/sizes.h" to define -that size, however "sizes.h" tries to include which -assumes linux system headers. These may not exist eg. the following -error was encountered when building Linux for OpenWrt under macOS: - -In file included from arch/mips/boot/compressed/calc_vmlinuz_load_addr.c:16: -arch/mips/boot/compressed/../../../../include/linux/sizes.h:11:10: fatal error: 'linux/const.h' file not found - ^~~~~~~~~~ - -Change makefile to force building on local linux headers instead of -system headers. Also change eye-watering relative reference in include -file spec. - -Thanks to Jo-Philip Wich & Petr Å tetiar for assistance in tracking this -down & fixing. - -Suggested-by: Jo-Philipp Wich -Signed-off-by: Petr Å tetiar -Signed-off-by: Kevin Darbyshire-Bryant ---- - arch/mips/boot/compressed/Makefile | 2 ++ - arch/mips/boot/compressed/calc_vmlinuz_load_addr.c | 2 +- - 2 files changed, 3 insertions(+), 1 deletion(-) - ---- a/arch/mips/boot/compressed/Makefile -+++ b/arch/mips/boot/compressed/Makefile -@@ -78,6 +78,8 @@ OBJCOPYFLAGS_piggy.o := --add-section=.i - $(obj)/piggy.o: $(obj)/dummy.o $(obj)/vmlinux.bin.z FORCE - $(call if_changed,objcopy) - -+HOSTCFLAGS_calc_vmlinuz_load_addr.o += $(LINUXINCLUDE) -+ - # Calculate the load address of the compressed kernel image - hostprogs-y := calc_vmlinuz_load_addr - ---- a/arch/mips/boot/compressed/calc_vmlinuz_load_addr.c -+++ b/arch/mips/boot/compressed/calc_vmlinuz_load_addr.c -@@ -13,7 +13,7 @@ - #include - #include - #include --#include "../../../../include/linux/sizes.h" -+#include - - int main(int argc, char *argv[]) - { diff --git a/target/linux/generic/pending-4.19/150-bridge_allow_receiption_on_disabled_port.patch b/target/linux/generic/pending-4.19/150-bridge_allow_receiption_on_disabled_port.patch index 9d9e3a05c..583c34a44 100644 --- a/target/linux/generic/pending-4.19/150-bridge_allow_receiption_on_disabled_port.patch +++ b/target/linux/generic/pending-4.19/150-bridge_allow_receiption_on_disabled_port.patch @@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau --- a/net/bridge/br_input.c +++ b/net/bridge/br_input.c -@@ -195,6 +195,9 @@ static void __br_handle_local_finish(str +@@ -193,6 +193,9 @@ static void __br_handle_local_finish(str /* note: already called with rcu_read_lock */ static int br_handle_local_finish(struct net *net, struct sock *sk, struct sk_buff *skb) { @@ -25,7 +25,7 @@ Signed-off-by: Felix Fietkau __br_handle_local_finish(skb); /* return 1 to signal the okfn() was called so it's ok to use the skb */ -@@ -291,6 +294,15 @@ rx_handler_result_t br_handle_frame(stru +@@ -289,6 +292,17 @@ rx_handler_result_t br_handle_frame(stru forward: switch (p->state) { @@ -33,9 +33,11 @@ Signed-off-by: Felix Fietkau + if (ether_addr_equal(p->br->dev->dev_addr, dest)) + skb->pkt_type = PACKET_HOST; + -+ NF_HOOK(NFPROTO_BRIDGE, NF_BR_PRE_ROUTING, ++ if (NF_HOOK(NFPROTO_BRIDGE, NF_BR_PRE_ROUTING, + dev_net(skb->dev), NULL, skb, skb->dev, NULL, -+ br_handle_local_finish); ++ br_handle_local_finish) == 1) { ++ return RX_HANDLER_PASS; ++ } + break; + case BR_STATE_FORWARDING: diff --git a/target/linux/generic/pending-4.19/302-mips_no_branch_likely.patch b/target/linux/generic/pending-4.19/302-mips_no_branch_likely.patch index 0e4600237..6192c417d 100644 --- a/target/linux/generic/pending-4.19/302-mips_no_branch_likely.patch +++ b/target/linux/generic/pending-4.19/302-mips_no_branch_likely.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/arch/mips/Makefile +++ b/arch/mips/Makefile -@@ -90,7 +90,7 @@ all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlin +@@ -91,7 +91,7 @@ all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlin # machines may also. Since BFD is incredibly buggy with respect to # crossformat linking we rely on the elf2ecoff tool for format conversion. # diff --git a/target/linux/generic/pending-4.19/304-mips_disable_fpu.patch b/target/linux/generic/pending-4.19/304-mips_disable_fpu.patch index 6e71c68dc..2278576d2 100644 --- a/target/linux/generic/pending-4.19/304-mips_disable_fpu.patch +++ b/target/linux/generic/pending-4.19/304-mips_disable_fpu.patch @@ -47,7 +47,7 @@ v2: incorporated changes suggested by Jonas Gorski select OF --- a/arch/mips/Makefile +++ b/arch/mips/Makefile -@@ -322,7 +322,7 @@ OBJCOPYFLAGS += --remove-section=.regin +@@ -323,7 +323,7 @@ OBJCOPYFLAGS += --remove-section=.regin head-y := arch/mips/kernel/head.o libs-y += arch/mips/lib/ diff --git a/target/linux/generic/pending-4.19/305-mips_module_reloc.patch b/target/linux/generic/pending-4.19/305-mips_module_reloc.patch index 609a96db4..a8e4e78c9 100644 --- a/target/linux/generic/pending-4.19/305-mips_module_reloc.patch +++ b/target/linux/generic/pending-4.19/305-mips_module_reloc.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/arch/mips/Makefile +++ b/arch/mips/Makefile -@@ -93,8 +93,18 @@ all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlin +@@ -94,8 +94,18 @@ all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlin cflags-y += -G 0 -mno-abicalls -fno-pic -pipe -mno-branch-likely cflags-y += -msoft-float LDFLAGS_vmlinux += -G 0 -static -n -nostdlib diff --git a/target/linux/generic/pending-4.19/308-mips32r2_tune.patch b/target/linux/generic/pending-4.19/308-mips32r2_tune.patch index d9a2a92f5..863651146 100644 --- a/target/linux/generic/pending-4.19/308-mips32r2_tune.patch +++ b/target/linux/generic/pending-4.19/308-mips32r2_tune.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/arch/mips/Makefile +++ b/arch/mips/Makefile -@@ -176,7 +176,7 @@ cflags-$(CONFIG_CPU_VR41XX) += -march=r4 +@@ -177,7 +177,7 @@ cflags-$(CONFIG_CPU_VR41XX) += -march=r4 cflags-$(CONFIG_CPU_R4X00) += -march=r4600 -Wa,--trap cflags-$(CONFIG_CPU_TX49XX) += -march=r4600 -Wa,--trap cflags-$(CONFIG_CPU_MIPS32_R1) += -march=mips32 -Wa,--trap diff --git a/target/linux/generic/pending-4.19/630-packet_socket_type.patch b/target/linux/generic/pending-4.19/630-packet_socket_type.patch index 333d4f573..1e4b075e8 100644 --- a/target/linux/generic/pending-4.19/630-packet_socket_type.patch +++ b/target/linux/generic/pending-4.19/630-packet_socket_type.patch @@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -3237,6 +3239,7 @@ static int packet_create(struct net *net +@@ -3251,6 +3253,7 @@ static int packet_create(struct net *net mutex_init(&po->pg_vec_lock); po->rollover = NULL; po->prot_hook.func = packet_rcv; @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; -@@ -3848,6 +3851,16 @@ packet_setsockopt(struct socket *sock, i +@@ -3862,6 +3865,16 @@ packet_setsockopt(struct socket *sock, i po->xmit = val ? packet_direct_xmit : dev_queue_xmit; return 0; } @@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau default: return -ENOPROTOOPT; } -@@ -3900,6 +3913,13 @@ static int packet_getsockopt(struct sock +@@ -3914,6 +3927,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR: val = po->has_vnet_hdr; break; @@ -128,7 +128,7 @@ Signed-off-by: Felix Fietkau break; --- a/net/packet/internal.h +++ b/net/packet/internal.h -@@ -131,6 +131,7 @@ struct packet_sock { +@@ -132,6 +132,7 @@ struct packet_sock { struct net_device __rcu *cached_dev; int (*xmit)(struct sk_buff *skb); struct packet_type prot_hook ____cacheline_aligned_in_smp; diff --git a/target/linux/generic/pending-4.19/640-netfilter-nf_flow_table-add-hardware-offload-support.patch b/target/linux/generic/pending-4.19/640-netfilter-nf_flow_table-add-hardware-offload-support.patch index afe5d32b3..693221482 100644 --- a/target/linux/generic/pending-4.19/640-netfilter-nf_flow_table-add-hardware-offload-support.patch +++ b/target/linux/generic/pending-4.19/640-netfilter-nf_flow_table-add-hardware-offload-support.patch @@ -552,7 +552,7 @@ Signed-off-by: Pablo Neira Ayuso nest = nla_nest_start(skb, NFTA_FLOWTABLE_HOOK); --- a/net/netfilter/nft_flow_offload.c +++ b/net/netfilter/nft_flow_offload.c -@@ -124,6 +124,9 @@ static void nft_flow_offload_eval(const +@@ -135,6 +135,9 @@ static void nft_flow_offload_eval(const if (ret < 0) goto err_flow_add; diff --git a/target/linux/generic/pending-4.19/703-phy-add-detach-callback-to-struct-phy_driver.patch b/target/linux/generic/pending-4.19/703-phy-add-detach-callback-to-struct-phy_driver.patch index 0cf187a49..f86323820 100644 --- a/target/linux/generic/pending-4.19/703-phy-add-detach-callback-to-struct-phy_driver.patch +++ b/target/linux/generic/pending-4.19/703-phy-add-detach-callback-to-struct-phy_driver.patch @@ -11,7 +11,7 @@ Signed-off-by: Gabor Juhos --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c -@@ -1130,6 +1130,9 @@ void phy_detach(struct phy_device *phyde +@@ -1136,6 +1136,9 @@ void phy_detach(struct phy_device *phyde struct module *ndev_owner = dev->dev.parent->driver->owner; struct mii_bus *bus; diff --git a/target/linux/generic/pending-4.9/201-extra_optimization.patch b/target/linux/generic/pending-4.9/201-extra_optimization.patch index 3d0fc822b..bce7a911d 100644 --- a/target/linux/generic/pending-4.9/201-extra_optimization.patch +++ b/target/linux/generic/pending-4.9/201-extra_optimization.patch @@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -655,12 +655,12 @@ KBUILD_CFLAGS += $(call cc-option,-fdata +@@ -656,12 +656,12 @@ KBUILD_CFLAGS += $(call cc-option,-fdata endif ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE diff --git a/target/linux/generic/pending-4.9/300-mips_expose_boot_raw.patch b/target/linux/generic/pending-4.9/300-mips_expose_boot_raw.patch index 68a083358..5c4c6dacf 100644 --- a/target/linux/generic/pending-4.9/300-mips_expose_boot_raw.patch +++ b/target/linux/generic/pending-4.9/300-mips_expose_boot_raw.patch @@ -9,7 +9,7 @@ Acked-by: Rob Landley --- --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -1068,9 +1068,6 @@ config FW_ARC +@@ -1069,9 +1069,6 @@ config FW_ARC config ARCH_MAY_HAVE_PC_FDC bool @@ -19,7 +19,7 @@ Acked-by: Rob Landley config CEVT_BCM1480 bool -@@ -2967,6 +2964,18 @@ choice +@@ -2968,6 +2965,18 @@ choice bool "Extend builtin kernel arguments with bootloader arguments" endchoice diff --git a/target/linux/generic/pending-4.9/304-mips_disable_fpu.patch b/target/linux/generic/pending-4.9/304-mips_disable_fpu.patch index 889c79ad9..aac9c79da 100644 --- a/target/linux/generic/pending-4.9/304-mips_disable_fpu.patch +++ b/target/linux/generic/pending-4.9/304-mips_disable_fpu.patch @@ -24,7 +24,7 @@ v2: incorporated changes suggested by Jonas Gorski --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -2891,6 +2891,20 @@ config MIPS_O32_FP64_SUPPORT +@@ -2892,6 +2892,20 @@ config MIPS_O32_FP64_SUPPORT If unsure, say N. diff --git a/target/linux/generic/pending-4.9/341-MIPS-mm-remove-no-op-dma_map_ops-where-possible.patch b/target/linux/generic/pending-4.9/341-MIPS-mm-remove-no-op-dma_map_ops-where-possible.patch index 15788c786..0393b4a22 100644 --- a/target/linux/generic/pending-4.9/341-MIPS-mm-remove-no-op-dma_map_ops-where-possible.patch +++ b/target/linux/generic/pending-4.9/341-MIPS-mm-remove-no-op-dma_map_ops-where-possible.patch @@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -214,6 +214,7 @@ config BMIPS_GENERIC +@@ -215,6 +215,7 @@ config BMIPS_GENERIC select BRCMSTB_L2_IRQ select IRQ_MIPS_CPU select DMA_NONCOHERENT @@ -22,7 +22,7 @@ Signed-off-by: Felix Fietkau select SYS_SUPPORTS_32BIT_KERNEL select SYS_SUPPORTS_LITTLE_ENDIAN select SYS_SUPPORTS_BIG_ENDIAN -@@ -339,6 +340,7 @@ config MACH_JAZZ +@@ -340,6 +341,7 @@ config MACH_JAZZ select CSRC_R4K select DEFAULT_SGI_PARTITION if CPU_BIG_ENDIAN select GENERIC_ISA_DMA @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau select HAVE_PCSPKR_PLATFORM select IRQ_MIPS_CPU select I8253 -@@ -1129,6 +1131,9 @@ config DMA_NONCOHERENT +@@ -1130,6 +1132,9 @@ config DMA_NONCOHERENT bool select NEED_DMA_MAP_STATE @@ -40,7 +40,7 @@ Signed-off-by: Felix Fietkau config NEED_DMA_MAP_STATE bool -@@ -1653,6 +1658,7 @@ config CPU_R10000 +@@ -1654,6 +1659,7 @@ config CPU_R10000 select CPU_SUPPORTS_64BIT_KERNEL select CPU_SUPPORTS_HIGHMEM select CPU_SUPPORTS_HUGEPAGES @@ -48,7 +48,7 @@ Signed-off-by: Felix Fietkau help MIPS Technologies R10000-series processors. -@@ -1898,9 +1904,11 @@ config SYS_HAS_CPU_MIPS32_R3_5 +@@ -1899,9 +1905,11 @@ config SYS_HAS_CPU_MIPS32_R3_5 bool config SYS_HAS_CPU_MIPS32_R5 @@ -60,7 +60,7 @@ Signed-off-by: Felix Fietkau bool config SYS_HAS_CPU_MIPS64_R1 -@@ -1910,6 +1918,7 @@ config SYS_HAS_CPU_MIPS64_R2 +@@ -1911,6 +1919,7 @@ config SYS_HAS_CPU_MIPS64_R2 bool config SYS_HAS_CPU_MIPS64_R6 diff --git a/target/linux/generic/pending-4.9/630-packet_socket_type.patch b/target/linux/generic/pending-4.9/630-packet_socket_type.patch index 018d00692..86fcf0c57 100644 --- a/target/linux/generic/pending-4.9/630-packet_socket_type.patch +++ b/target/linux/generic/pending-4.9/630-packet_socket_type.patch @@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -3270,6 +3272,7 @@ static int packet_create(struct net *net +@@ -3284,6 +3286,7 @@ static int packet_create(struct net *net mutex_init(&po->pg_vec_lock); po->rollover = NULL; po->prot_hook.func = packet_rcv; @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; -@@ -3883,6 +3886,16 @@ packet_setsockopt(struct socket *sock, i +@@ -3897,6 +3900,16 @@ packet_setsockopt(struct socket *sock, i po->xmit = val ? packet_direct_xmit : dev_queue_xmit; return 0; } @@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau default: return -ENOPROTOOPT; } -@@ -3935,6 +3948,13 @@ static int packet_getsockopt(struct sock +@@ -3949,6 +3962,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR: val = po->has_vnet_hdr; break; @@ -128,7 +128,7 @@ Signed-off-by: Felix Fietkau break; --- a/net/packet/internal.h +++ b/net/packet/internal.h -@@ -128,6 +128,7 @@ struct packet_sock { +@@ -129,6 +129,7 @@ struct packet_sock { struct net_device __rcu *cached_dev; int (*xmit)(struct sk_buff *skb); struct packet_type prot_hook ____cacheline_aligned_in_smp; diff --git a/target/linux/generic/pending-4.9/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-4.9/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index d113be643..cccd364f6 100644 --- a/target/linux/generic/pending-4.9/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-4.9/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau if (!(skb->dev->features & NETIF_F_GRO)) goto normal; -@@ -5864,6 +5867,48 @@ static void __netdev_adjacent_dev_unlink +@@ -5867,6 +5870,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -93,7 +93,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *upper_priv, void *upper_info) -@@ -5936,6 +5981,7 @@ static int __netdev_upper_dev_link(struc +@@ -5939,6 +5984,7 @@ static int __netdev_upper_dev_link(struc goto rollback_lower_mesh; } @@ -101,7 +101,7 @@ Signed-off-by: Felix Fietkau ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev, &changeupper_info.info); ret = notifier_to_errno(ret); -@@ -6062,6 +6108,7 @@ void netdev_upper_dev_unlink(struct net_ +@@ -6065,6 +6111,7 @@ void netdev_upper_dev_unlink(struct net_ list_for_each_entry(i, &upper_dev->all_adj_list.upper, list) __netdev_adjacent_dev_unlink(dev, i->dev, i->ref_nr); @@ -109,7 +109,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev, &changeupper_info.info); } -@@ -6664,6 +6711,7 @@ int dev_set_mac_address(struct net_devic +@@ -6667,6 +6714,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; diff --git a/target/linux/ipq40xx/patches-4.19/700-net-add-qualcomm-mdio-and-phy.patch b/target/linux/ipq40xx/patches-4.19/700-net-add-qualcomm-mdio-and-phy.patch index bad8b797f..37b88bb8a 100644 --- a/target/linux/ipq40xx/patches-4.19/700-net-add-qualcomm-mdio-and-phy.patch +++ b/target/linux/ipq40xx/patches-4.19/700-net-add-qualcomm-mdio-and-phy.patch @@ -46,7 +46,7 @@ Subject: [PATCH 30/38] NET: add qualcomm mdio and PHY obj-$(CONFIG_AMD_PHY) += amd.o obj-$(CONFIG_AQUANTIA_PHY) += aquantia.o +obj-$(CONFIG_AR40XX_PHY) += ar40xx.o - obj-$(CONFIG_ASIX_PHY) += asix.o + obj-$(CONFIG_AX88796B_PHY) += ax88796b.o obj-$(CONFIG_AT803X_PHY) += at803x.o obj-$(CONFIG_BCM63XX_PHY) += bcm63xx.o --- /dev/null diff --git a/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch b/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch index ed3a40de9..5f9f5a4b6 100644 --- a/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch +++ b/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch @@ -105,7 +105,7 @@ case UPIO_AU: p->serial_out(p, offset, value); p->serial_in(p, UART_LCR); /* safe, no side-effects */ -@@ -2759,6 +2779,7 @@ static int serial8250_request_std_resour +@@ -2758,6 +2778,7 @@ static int serial8250_request_std_resour case UPIO_MEM32BE: case UPIO_MEM16: case UPIO_MEM: @@ -113,7 +113,7 @@ if (!port->mapbase) break; -@@ -2797,6 +2818,7 @@ static void serial8250_release_std_resou +@@ -2796,6 +2817,7 @@ static void serial8250_release_std_resou case UPIO_MEM32BE: case UPIO_MEM16: case UPIO_MEM: diff --git a/target/linux/lantiq/Makefile b/target/linux/lantiq/Makefile index 2180b8394..ee3e42bcb 100644 --- a/target/linux/lantiq/Makefile +++ b/target/linux/lantiq/Makefile @@ -12,7 +12,7 @@ FEATURES:=squashfs SUBTARGETS:=xrx200 xway xway_legacy falcon ase MAINTAINER:=John Crispin -KERNEL_PATCHVER:=4.14 +KERNEL_PATCHVER:=4.19 define Target/Description Build firmware images for Lantiq SoC diff --git a/target/linux/lantiq/ase/config-4.14 b/target/linux/lantiq/ase/config-4.19 similarity index 100% rename from target/linux/lantiq/ase/config-4.14 rename to target/linux/lantiq/ase/config-4.19 diff --git a/target/linux/lantiq/base-files/etc/board.d/02_network b/target/linux/lantiq/base-files/etc/board.d/02_network index 86894403d..a6a9e4d29 100755 --- a/target/linux/lantiq/base-files/etc/board.d/02_network +++ b/target/linux/lantiq/base-files/etc/board.d/02_network @@ -158,6 +158,22 @@ avm,fritz7360sl) "0:lan:3" "1:lan:4" "2:lan:2" "4:lan:1" "6t@eth0" ;; +avm,fritz7362sl) + annex="b" + lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)")) + wan_mac=$(fritz_tffs -n macdsl -i $(find_mtd_part "tffs (1)")) + ucidef_add_switch "switch0" \ + "0:lan:3" "1:lan:4" "2:lan:2" "4:lan:1" "6t@eth0" + ;; + +avm,fritz7412) + tffsdev=$(find_mtd_chardev "nand-tffs") + annex="b" + lan_mac=$(/usr/bin/fritz_tffs_nand -d $tffsdev -n maca -o) + wan_mac=$(/usr/bin/fritz_tffs_nand -d $tffsdev -n macdsl -o) + ucidef_set_interface_lan 'eth0' + ;; + siemens,gigaset-sx76x) annex="b" ucidef_add_switch "switch0" \ diff --git a/target/linux/lantiq/base-files/etc/hotplug.d/dsl/led_dsl.sh b/target/linux/lantiq/base-files/etc/hotplug.d/dsl/led_dsl.sh index 0bf749c56..dd8e84a1a 100755 --- a/target/linux/lantiq/base-files/etc/hotplug.d/dsl/led_dsl.sh +++ b/target/linux/lantiq/base-files/etc/hotplug.d/dsl/led_dsl.sh @@ -10,7 +10,9 @@ led_dsl_up() { "netdev") led_set_attr $1 "trigger" "netdev" led_set_attr $1 "device_name" "$(config_get led_dsl dev)" - led_set_attr $1 "mode" "$(config_get led_dsl mode)" + for m in $(config_get led_dsl mode); do + led_set_attr $1 "$m" "1" + done ;; *) led_on $1 diff --git a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom index 40642e580..6ae5e3cfe 100644 --- a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom +++ b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom @@ -157,12 +157,16 @@ case "$FIRMWARE" in ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_ascii uboot-env ethaddr) +2) 524 ;; avm,fritz3370-rev2-hynix|\ - avm,fritz3370-rev2-micron) + avm,fritz3370-rev2-micron|\ + avm,fritz7362sl) ath9k_eeprom_extract_reverse "urlader" 5441 1088 ;; avm,fritz7312|avm,fritz7320|avm,fritz7360sl) ath9k_eeprom_extract "urlader" 2437 0 ;; + avm,fritz7412) + /usr/bin/fritz_cal_extract -i 1 -s 0x1e000 -e 0x207 -l 4096 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader") + ;; tplink,tdw8970|tplink,tdw8980) ath9k_eeprom_extract "boardconfig" 135168 0 ;; diff --git a/target/linux/lantiq/base-files/lib/upgrade/platform.sh b/target/linux/lantiq/base-files/lib/upgrade/platform.sh index ecbb939e3..c47ff78fb 100755 --- a/target/linux/lantiq/base-files/lib/upgrade/platform.sh +++ b/target/linux/lantiq/base-files/lib/upgrade/platform.sh @@ -11,6 +11,8 @@ platform_do_upgrade() { case "$board" in avm,fritz3370-rev2-hynix|\ avm,fritz3370-rev2-micron|\ + avm,fritz7362sl|\ + avm,fritz7412|\ bt,homehub-v2b|\ bt,homehub-v3a|\ bt,homehub-v5a|\ @@ -19,7 +21,7 @@ platform_do_upgrade() { nand_do_upgrade $1 ;; *) - default_do_upgrade "$ARGV" + default_do_upgrade "$1" ;; esac } diff --git a/target/linux/lantiq/config-4.14 b/target/linux/lantiq/config-4.19 similarity index 85% rename from target/linux/lantiq/config-4.14 rename to target/linux/lantiq/config-4.19 index aec0efa40..560e8474d 100644 --- a/target/linux/lantiq/config-4.14 +++ b/target/linux/lantiq/config-4.19 @@ -2,18 +2,11 @@ CONFIG_ARCH_BINFMT_ELF_STATE=y CONFIG_ARCH_CLOCKSOURCE_DATA=y CONFIG_ARCH_DISCARD_MEMBLOCK=y CONFIG_ARCH_HAS_ELF_RANDOMIZE=y -# CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set CONFIG_ARCH_HAS_RESET_CONTROLLER=y -# CONFIG_ARCH_HAS_SG_CHAIN is not set -# CONFIG_ARCH_HAS_STRICT_KERNEL_RWX is not set -# CONFIG_ARCH_HAS_STRICT_MODULE_RWX is not set +CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y -CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y -CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y CONFIG_ARCH_MMAP_RND_BITS_MAX=15 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15 -# CONFIG_ARCH_OPTIONAL_KERNEL_RWX is not set -# CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT is not set CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARCH_USE_BUILTIN_BSWAP=y @@ -43,7 +36,11 @@ CONFIG_CRYPTO_HASH2=y CONFIG_CRYPTO_RNG2=y CONFIG_CRYPTO_WORKQUEUE=y CONFIG_CSRC_R4K=y +CONFIG_DMA_DIRECT_OPS=y CONFIG_DMA_NONCOHERENT=y +CONFIG_DMA_NONCOHERENT_CACHE_SYNC=y +CONFIG_DMA_NONCOHERENT_MMAP=y +CONFIG_DMA_NONCOHERENT_OPS=y CONFIG_DTC=y # CONFIG_DT_EASY50712 is not set CONFIG_EARLY_PRINTK=y @@ -53,11 +50,15 @@ CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CMOS_UPDATE=y CONFIG_GENERIC_CPU_AUTOPROBE=y -CONFIG_GENERIC_IO=y CONFIG_GENERIC_IRQ_CHIP=y CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y CONFIG_GENERIC_IRQ_IPI=y CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_LIB_ASHLDI3=y +CONFIG_GENERIC_LIB_ASHRDI3=y +CONFIG_GENERIC_LIB_CMPDI2=y +CONFIG_GENERIC_LIB_LSHRDI3=y +CONFIG_GENERIC_LIB_UCMPDI2=y CONFIG_GENERIC_PCI_IOMAP=y CONFIG_GENERIC_PHY=y CONFIG_GENERIC_SCHED_CLOCK=y @@ -67,28 +68,23 @@ CONFIG_GPIOLIB=y CONFIG_GPIO_MM_LANTIQ=y CONFIG_GPIO_STP_XWAY=y CONFIG_GPIO_SYSFS=y -# CONFIG_GRO_CELLS is not set CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDWARE_WATCHPOINTS=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT_MAP=y -# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set -# CONFIG_HAVE_ARCH_BITREVERSE is not set +CONFIG_HAVE_ARCH_COMPILER_H=y CONFIG_HAVE_ARCH_JUMP_LABEL=y CONFIG_HAVE_ARCH_KGDB=y CONFIG_HAVE_ARCH_SECCOMP_FILTER=y CONFIG_HAVE_ARCH_TRACEHOOK=y -# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set CONFIG_HAVE_CBPF_JIT=y -CONFIG_HAVE_CC_STACKPROTECTOR=y CONFIG_HAVE_CLK=y CONFIG_HAVE_CONTEXT_TRACKING=y CONFIG_HAVE_COPY_THREAD_TLS=y CONFIG_HAVE_C_RECORDMCOUNT=y CONFIG_HAVE_DEBUG_KMEMLEAK=y CONFIG_HAVE_DEBUG_STACKOVERFLOW=y -CONFIG_HAVE_DMA_API_DEBUG=y CONFIG_HAVE_DMA_CONTIGUOUS=y CONFIG_HAVE_DYNAMIC_FTRACE=y CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y @@ -100,6 +96,7 @@ CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y CONFIG_HAVE_KVM=y CONFIG_HAVE_LATENCYTOP_SUPPORT=y +CONFIG_HAVE_LD_DEAD_CODE_DATA_ELIMINATION=y CONFIG_HAVE_MEMBLOCK=y CONFIG_HAVE_MEMBLOCK_NODE_MAP=y CONFIG_HAVE_MOD_ARCH_SPECIFIC=y @@ -107,6 +104,7 @@ CONFIG_HAVE_NET_DSA=y CONFIG_HAVE_OPROFILE=y CONFIG_HAVE_PERF_EVENTS=y CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y +CONFIG_HAVE_RSEQ=y CONFIG_HAVE_SYSCALL_TRACEPOINTS=y CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y CONFIG_HW_HAS_PCI=y @@ -129,21 +127,23 @@ CONFIG_LANTIQ_WDT=y # CONFIG_LANTIQ_XRX200 is not set CONFIG_LEDS_GPIO=y CONFIG_LIBFDT=y +CONFIG_LOCK_DEBUGGING_SUPPORT=y CONFIG_MDIO_BUS=y CONFIG_MDIO_DEVICE=y +CONFIG_MEMFD_CREATE=y CONFIG_MFD_CORE=y CONFIG_MFD_SYSCON=y +CONFIG_MIGRATION=y CONFIG_MIPS=y CONFIG_MIPS_ASID_BITS=8 CONFIG_MIPS_ASID_SHIFT=0 +CONFIG_MIPS_CBPF_JIT=y CONFIG_MIPS_CLOCK_VSYSCALL=y # CONFIG_MIPS_CMDLINE_DTB_EXTEND is not set # CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER is not set CONFIG_MIPS_CMDLINE_FROM_DTB=y # CONFIG_MIPS_ELF_APPENDED_DTB is not set -# CONFIG_MIPS_HUGE_TLB_SUPPORT is not set CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_MIPS_MACHINE is not set # CONFIG_MIPS_MT_SMP is not set # CONFIG_MIPS_NO_APPENDED_DTB is not set CONFIG_MIPS_RAW_APPENDED_DTB=y @@ -165,13 +165,14 @@ CONFIG_MTD_SPLIT_UIMAGE_FW=y CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_PER_CPU_KM=y CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y -# CONFIG_NO_IOPORT_MAP is not set +CONFIG_NVMEM=y CONFIG_OF=y CONFIG_OF_ADDRESS=y CONFIG_OF_EARLY_FLATTREE=y CONFIG_OF_FLATTREE=y CONFIG_OF_GPIO=y CONFIG_OF_IRQ=y +CONFIG_OF_KOBJ=y CONFIG_OF_MDIO=y CONFIG_OF_NET=y CONFIG_PCI_DRIVERS_LEGACY=y @@ -186,17 +187,12 @@ CONFIG_PINCTRL_XWAY=y CONFIG_POWER_RESET=y CONFIG_POWER_RESET_SYSCON=y CONFIG_PSB6970_PHY=y -# CONFIG_RCU_NEED_SEGCBLIST is not set -# CONFIG_RCU_STALL_COMMON is not set CONFIG_REGMAP=y CONFIG_REGMAP_MMIO=y CONFIG_RESET_CONTROLLER=y CONFIG_RESET_LANTIQ=y CONFIG_RTL8366RB_PHY=y CONFIG_RTL8366_SMI=y -# CONFIG_SCHED_INFO is not set -# CONFIG_SCSI_DMA is not set -# CONFIG_SENSORS_LTQ_CPUTEMP is not set # CONFIG_SERIAL_8250 is not set CONFIG_SERIAL_LANTIQ=y # CONFIG_SOC_AMAZON_SE is not set @@ -206,6 +202,7 @@ CONFIG_SOC_XWAY=y CONFIG_SPI=y CONFIG_SPI_LANTIQ_SSC=y CONFIG_SPI_MASTER=y +CONFIG_SPI_MEM=y CONFIG_SRCU=y CONFIG_SWAP_IO_SPACE=y CONFIG_SWCONFIG=y @@ -219,6 +216,7 @@ CONFIG_SYS_SUPPORTS_ARBIT_HZ=y CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y CONFIG_SYS_SUPPORTS_MIPS16=y CONFIG_SYS_SUPPORTS_MULTITHREADING=y +CONFIG_SYS_SUPPORTS_VPE_LOADER=y CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_TINY_SRCU=y CONFIG_USE_OF=y diff --git a/target/linux/lantiq/falcon/config-4.14 b/target/linux/lantiq/falcon/config-4.19 similarity index 100% rename from target/linux/lantiq/falcon/config-4.14 rename to target/linux/lantiq/falcon/config-4.19 diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY98000NOR.dts b/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY98000NOR.dts deleted file mode 100644 index ad53bf96e..000000000 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY98000NOR.dts +++ /dev/null @@ -1,38 +0,0 @@ -/dts-v1/; - -#include "falcon.dtsi" -#include "EASY98000-base.dtsi" - -/ { - model = "Lantiq Falcon (NOR)"; - compatible = "lantiq,easy98000-nor", "lantiq,easy98000", "lantiq,falcon"; - - aliases { - spi0 = &spi; - }; -}; - -&ebu_cs0 { - cfi@0 { - compatible = "lantiq,nor"; - bank-width = <2>; - reg = <0x0 0x4000000>; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "uboot"; - reg = <0x00000 0x40000>; - }; - - partition@10000 { - label = "uboot_env"; - reg = <0x40000 0x40000>; - }; - - partition@20000 { - label = "linux"; - reg = <0x80000 0x3d0000>; - }; - }; -}; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/falcon-sflash-16M.dtsi b/target/linux/lantiq/files-4.14/arch/mips/boot/dts/falcon-sflash-16M.dtsi deleted file mode 100644 index d95acc21e..000000000 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/falcon-sflash-16M.dtsi +++ /dev/null @@ -1,37 +0,0 @@ - -&ebu_cs0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "lantiq,sflash-falcon", "simple-bus"; - - flash@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "spansion,s25fl129p0", "spansion,s25fl129p1"; - reg = <0 0>; - linux,mtd-name = "sflash"; - spi-max-frequency = <80000000>; - m25p,fast-read; - - partition@0 { - reg = <0x0 0x40000>; - label = "uboot"; - read-only; - }; - - partition@40000 { - reg = <0x40000 0x80000>; - label = "uboot_env"; - }; - - partition@C0000 { - reg = <0xC0000 0x740000>; - label = "image0"; - }; - - partition@800000 { - reg = <0x800000 0x800000>; - label = "image1"; - }; - }; -}; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ACMP252.dts b/target/linux/lantiq/files/arch/mips/boot/dts/ACMP252.dts similarity index 95% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/ACMP252.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/ACMP252.dts index 5a2d86719..794253594 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ACMP252.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/ACMP252.dts @@ -11,6 +11,7 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x4000000>; }; @@ -48,12 +49,10 @@ }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x2000000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; @@ -87,7 +86,7 @@ reg = <0xfc0000 0x40000>; }; - partition@0x1000000 { + partition@1000000 { label = "rootfs_data"; reg = <0x1000000 0x1000000>; }; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ALL0333CJ.dts b/target/linux/lantiq/files/arch/mips/boot/dts/ALL0333CJ.dts similarity index 96% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/ALL0333CJ.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/ALL0333CJ.dts index df62ac2d9..ef57b2f06 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ALL0333CJ.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/ALL0333CJ.dts @@ -21,10 +21,11 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x1000000>; }; - gpio-leds { + leds { compatible = "gpio-leds"; /* power led: red=off, green=on */ @@ -77,12 +78,10 @@ }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x400000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV4510PW.dts b/target/linux/lantiq/files/arch/mips/boot/dts/ARV4510PW.dts similarity index 96% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV4510PW.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/ARV4510PW.dts index 6598a60f5..e15eb66b0 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV4510PW.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/ARV4510PW.dts @@ -26,13 +26,12 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x2000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; wps { @@ -47,7 +46,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; power: power { label = "power"; @@ -178,12 +177,10 @@ }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x1000000>; - #address-cells = <1>; - #size-cells = <1>; lantiq,noxip; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV4518PWR01.dts b/target/linux/lantiq/files/arch/mips/boot/dts/ARV4518PWR01.dts similarity index 100% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV4518PWR01.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/ARV4518PWR01.dts diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV4518PWR01.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/ARV4518PWR01.dtsi similarity index 94% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV4518PWR01.dtsi rename to target/linux/lantiq/files/arch/mips/boot/dts/ARV4518PWR01.dtsi index f29c416c0..f5dec312f 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV4518PWR01.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/ARV4518PWR01.dtsi @@ -20,6 +20,7 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x4000000>; }; @@ -31,10 +32,8 @@ ath,eep-swap; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; rfkill { @@ -49,7 +48,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; power: power { label = "power"; @@ -136,23 +135,16 @@ }; }; -&gpiomm { - status = "okay"; - lantiq,shadow = <0x0>; -}; - &gsw { phy-mode = "mii"; mtd-mac-address = <&boardconfig 0x16>; }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x2000000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; @@ -183,6 +175,16 @@ }; }; }; + + gpiomm: gpio@1 { + compatible = "lantiq,gpio-mm"; + reg = <1 0x0 0x10 >; + #address-cells = <1>; + #size-cells = <1>; + #gpio-cells = <2>; + gpio-controller; + lantiq,shadow = <0x0>; + }; }; &pci0 { diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV4518PWR01A.dts b/target/linux/lantiq/files/arch/mips/boot/dts/ARV4518PWR01A.dts similarity index 100% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV4518PWR01A.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/ARV4518PWR01A.dts diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV4519PW.dts b/target/linux/lantiq/files/arch/mips/boot/dts/ARV4519PW.dts similarity index 94% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV4519PW.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/ARV4519PW.dts index e307b381a..8e5301ddc 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV4519PW.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/ARV4519PW.dts @@ -25,13 +25,12 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x2000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; rfkill { @@ -46,7 +45,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; power_green: power { @@ -133,23 +132,16 @@ }; }; -&gpiomm { - status = "okay"; - lantiq,shadow = <0x400>; -}; - &gsw { phy-mode = "mii"; mtd-mac-address = <&boardconfig 0x16>; }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x2000000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; @@ -179,6 +171,16 @@ }; }; }; + + gpiomm: gpio@1 { + compatible = "lantiq,gpio-mm"; + reg = <1 0x0 0x10 >; + #address-cells = <1>; + #size-cells = <1>; + #gpio-cells = <2>; + gpio-controller; + lantiq,shadow = <0x400>; + }; }; &pci0 { diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV4520PW.dts b/target/linux/lantiq/files/arch/mips/boot/dts/ARV4520PW.dts similarity index 95% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV4520PW.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/ARV4520PW.dts index cd76bf579..95944d9cf 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV4520PW.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/ARV4520PW.dts @@ -25,13 +25,12 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x2000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; rfkill { @@ -46,7 +45,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; power_blue: power { @@ -156,11 +155,6 @@ }; }; -&gpiomm { - status = "okay"; - lantiq,shadow = <0x400>; -}; - &gsw { /* gpiomm 10 - switch */ phy-mode = "rmii"; @@ -168,12 +162,10 @@ }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x800000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; @@ -204,6 +196,16 @@ }; }; }; + + gpiomm: gpio@1 { + compatible = "lantiq,gpio-mm"; + reg = <1 0x0 0x10 >; + #address-cells = <1>; + #size-cells = <1>; + #gpio-cells = <2>; + gpio-controller; + lantiq,shadow = <0x400>; + }; }; &pci0 { diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV4525PW.dts b/target/linux/lantiq/files/arch/mips/boot/dts/ARV4525PW.dts similarity index 95% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV4525PW.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/ARV4525PW.dts index b3904d37d..d55613a02 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV4525PW.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/ARV4525PW.dts @@ -23,6 +23,7 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x2000000>; }; @@ -33,10 +34,8 @@ ath,eep-swap; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; wps { @@ -51,7 +50,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; fxo { label = "arv4525pw:green:festnetz"; @@ -112,12 +111,10 @@ }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x2000000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV452CQW.dts b/target/linux/lantiq/files/arch/mips/boot/dts/ARV452CQW.dts similarity index 95% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV452CQW.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/ARV452CQW.dts index 203a30df5..4ff0f67ca 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV452CQW.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/ARV452CQW.dts @@ -24,6 +24,7 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x2000000>; }; @@ -34,10 +35,8 @@ ath,eep-swap; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; rfkill { @@ -57,7 +56,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; power_blue: power0 { label = "arv452cqw:blue:power"; @@ -172,11 +171,6 @@ }; }; -&gpiomm { - status = "okay"; - lantiq,shadow = <0x77f>; -}; - /* #define ARV452CPW_SWITCH_RESET 110 */ @@ -186,12 +180,10 @@ }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x400000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; @@ -222,6 +214,16 @@ }; }; }; + + gpiomm: gpio@1 { + compatible = "lantiq,gpio-mm"; + reg = <1 0x0 0x10 >; + #address-cells = <1>; + #size-cells = <1>; + #gpio-cells = <2>; + gpio-controller; + lantiq,shadow = <0x77f>; + }; }; &pci0 { diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV7506PW11.dts b/target/linux/lantiq/files/arch/mips/boot/dts/ARV7506PW11.dts similarity index 97% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV7506PW11.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/ARV7506PW11.dts index 8fe22e9a4..c0bca8403 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV7506PW11.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/ARV7506PW11.dts @@ -24,13 +24,12 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x4000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; rfkill { @@ -45,7 +44,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; wlan: wlan { label = "arv7506pw11:green:wlan"; @@ -112,7 +111,7 @@ }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x800000>; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV7510PW22.dts b/target/linux/lantiq/files/arch/mips/boot/dts/ARV7510PW22.dts similarity index 96% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV7510PW22.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/ARV7510PW22.dts index 92d01b4dc..5c4a41e95 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV7510PW22.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/ARV7510PW22.dts @@ -24,13 +24,12 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x4000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; rfkill { @@ -50,7 +49,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; power: power { label = "power"; @@ -136,12 +135,10 @@ }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x1000000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV7518PW.dts b/target/linux/lantiq/files/arch/mips/boot/dts/ARV7518PW.dts similarity index 95% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV7518PW.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/ARV7518PW.dts index 72f3a686b..458fd6549 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV7518PW.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/ARV7518PW.dts @@ -25,13 +25,12 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x4000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; rfkill { @@ -46,7 +45,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; power_green: power { label = "arv7518pw:green:power"; @@ -160,11 +159,6 @@ }; }; -&gpiomm { - status = "okay"; - lantiq,shadow = <0x0>; -}; - /* #define SWITCH_RESET 13 */ @@ -174,12 +168,10 @@ }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x2000000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; @@ -209,6 +201,16 @@ }; }; }; + + gpiomm: gpio@1 { + compatible = "lantiq,gpio-mm"; + reg = <1 0x0 0x10 >; + #address-cells = <1>; + #size-cells = <1>; + #gpio-cells = <2>; + gpio-controller; + lantiq,shadow = <0x0>; + }; }; &pci0 { diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV7519PW.dts b/target/linux/lantiq/files/arch/mips/boot/dts/ARV7519PW.dts similarity index 96% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV7519PW.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/ARV7519PW.dts index bcb3b502a..e9c418e48 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV7519PW.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/ARV7519PW.dts @@ -24,13 +24,12 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x4000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; rfkill { @@ -45,7 +44,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; power: power { label = "power"; @@ -164,12 +163,10 @@ }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x2000000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV7519RW22.dts b/target/linux/lantiq/files/arch/mips/boot/dts/ARV7519RW22.dts similarity index 96% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV7519RW22.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/ARV7519RW22.dts index baa9adcc9..f245fe370 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV7519RW22.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/ARV7519RW22.dts @@ -23,13 +23,12 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x8000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; reset { @@ -49,7 +48,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; lan_green { @@ -137,11 +136,10 @@ }; }; - mdio@0 { + mdio { #address-cells = <1>; #size-cells = <0>; compatible = "lantiq,xrx200-mdio"; - reg = <0>; phy0: ethernet-phy@0 { reg = <0x0>; @@ -192,12 +190,10 @@ }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x2000000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV7525PW.dts b/target/linux/lantiq/files/arch/mips/boot/dts/ARV7525PW.dts similarity index 95% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV7525PW.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/ARV7525PW.dts index a395d4ff4..bcdc2249f 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV7525PW.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/ARV7525PW.dts @@ -24,13 +24,12 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x2000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; wps { @@ -45,7 +44,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; power_green: power { label = "arv7525pw:green:power"; @@ -97,12 +96,10 @@ }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x2000000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV752DPW.dts b/target/linux/lantiq/files/arch/mips/boot/dts/ARV752DPW.dts similarity index 95% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV752DPW.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/ARV752DPW.dts index 5f877723f..dbec1eb6a 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV752DPW.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/ARV752DPW.dts @@ -24,13 +24,12 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x4000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; wps { @@ -55,7 +54,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; power_blue: power1 { label = "arv752dpw:blue:power"; @@ -167,23 +166,16 @@ }; }; -&gpiomm { - status = "okay"; - lantiq,shadow = <0x3>; -}; - &gsw { phy-mode = "rmii"; mtd-mac-address = <&boardconfig 0x16>; }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x800000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; @@ -214,6 +206,16 @@ }; }; }; + + gpiomm: gpio@1 { + compatible = "lantiq,gpio-mm"; + reg = <1 0x0 0x10 >; + #address-cells = <1>; + #size-cells = <1>; + #gpio-cells = <2>; + gpio-controller; + lantiq,shadow = <0x3>; + }; }; &pci0 { diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV752DPW22.dts b/target/linux/lantiq/files/arch/mips/boot/dts/ARV752DPW22.dts similarity index 96% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV752DPW22.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/ARV752DPW22.dts index 1d4d662ab..de996d10c 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV752DPW22.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/ARV752DPW22.dts @@ -24,13 +24,12 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x4000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; wps { @@ -55,7 +54,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; power_blue: power1 { label = "arv752dpw22:blue:power"; @@ -182,24 +181,16 @@ }; }; - -&gpiomm { - status = "okay"; - lantiq,shadow = <3>; -}; - &gsw { phy-mode = "mii"; mtd-mac-address = <&boardconfig 0x16>; }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x800000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; @@ -230,6 +221,16 @@ }; }; }; + + gpiomm: gpio@1 { + compatible = "lantiq,gpio-mm"; + reg = <1 0x0 0x10 >; + #address-cells = <1>; + #size-cells = <1>; + #gpio-cells = <2>; + gpio-controller; + lantiq,shadow = <3>; + }; }; &pci0 { diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV8539PW22.dts b/target/linux/lantiq/files/arch/mips/boot/dts/ARV8539PW22.dts similarity index 92% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV8539PW22.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/ARV8539PW22.dts index 1e55d8159..00131f929 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ARV8539PW22.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/ARV8539PW22.dts @@ -24,13 +24,12 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x4000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; wlan { @@ -46,7 +45,7 @@ /* key DECT is missing */ }; - gpio-leds { + leds { compatible = "gpio-leds"; power_green: power-green { @@ -126,12 +125,10 @@ }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x800000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; @@ -152,12 +149,12 @@ partition@40000 { label = "firmware"; - reg = <0x40000 0x7B0000>; /* 7872 KiB */ + reg = <0x40000 0x7b0000>; /* 7872 KiB */ }; - art: partition@7F0000 { + art: partition@7f0000 { label = "art"; - reg = <0x7F0000 0x10000>; /* 64 KiB*/ + reg = <0x7f0000 0x10000>; /* 64 KiB*/ read-only; }; }; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ASL56026.dts b/target/linux/lantiq/files/arch/mips/boot/dts/ASL56026.dts similarity index 94% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/ASL56026.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/ASL56026.dts index 90bfcabcb..1c7f03c35 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ASL56026.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/ASL56026.dts @@ -23,13 +23,12 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x2000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; reset { @@ -39,7 +38,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; dsl: dsl { @@ -95,11 +94,10 @@ }; }; - mdio@0 { + mdio { #address-cells = <1>; #size-cells = <0>; compatible = "lantiq,xrx200-mdio"; - reg = <0>; phy11: ethernet-phy@11 { reg = <0x11>; @@ -134,12 +132,10 @@ }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x0800000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/BTHOMEHUBV2B.dts b/target/linux/lantiq/files/arch/mips/boot/dts/BTHOMEHUBV2B.dts similarity index 93% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/BTHOMEHUBV2B.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/BTHOMEHUBV2B.dts index e126065ea..2b3afb229 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/BTHOMEHUBV2B.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/BTHOMEHUBV2B.dts @@ -23,13 +23,12 @@ }; memory@0 { /* RAM: Samsung K4H511638F-LC 64MB */ + device_type = "memory"; reg = <0x0 0x4000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; reset { @@ -49,7 +48,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; upgrading-orange { @@ -165,13 +164,11 @@ }; &localbus { - nor@0 { /* NOR Flash: Spansion S29AL004D 512KB */ + flash@0 { /* NOR Flash: Spansion S29AL004D 512KB */ compatible = "lantiq,nor"; /* "AMD AM29LV400BB" compatible on 3.3.8 */ lantiq,cs = <0>; bank-width = <2>; reg = <0 0x0 0x80000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; @@ -205,13 +202,11 @@ }; }; - nand@1 { /* NAND Flash: Samsung K9F5608U0D-JIB0 32MB */ + flash@1 { /* NAND Flash: Samsung K9F5608U0D-JIB0 32MB */ compatible = "lantiq,nand-xway"; lantiq,cs = <1>; bank-width = <2>; reg = <1 0x0 0x2000000 >; - #address-cells = <1>; - #size-cells = <1>; req-mask = <0x1>; /* PCI request lines to mask during NAND access */ partitions { @@ -232,7 +227,7 @@ partition@164000 { label = "ubi"; - reg = <0x204000 0x1DFC000>; + reg = <0x204000 0x1dfc000>; }; }; }; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/BTHOMEHUBV3A.dts b/target/linux/lantiq/files/arch/mips/boot/dts/BTHOMEHUBV3A.dts similarity index 95% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/BTHOMEHUBV3A.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/BTHOMEHUBV3A.dts index b854ac0a9..823a158fb 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/BTHOMEHUBV3A.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/BTHOMEHUBV3A.dts @@ -23,13 +23,12 @@ }; memory@0 { /* RAM: Samsung K4H511638F-LC 64MB */ + device_type = "memory"; reg = <0x0 0x4000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; reset { label = "reset"; @@ -48,7 +47,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; wireless-red { @@ -152,13 +151,11 @@ }; &localbus { - nand@1 { /* NAND Flash: Samsung K9F5608U0D-JIB0 32MB */ + flash@1 { /* NAND Flash: Samsung K9F5608U0D-JIB0 32MB */ compatible = "lantiq,nand-xway"; lantiq,cs = <1>; bank-width = <2>; reg = <1 0x0 0x2000000 >; - #address-cells = <1>; - #size-cells = <1>; req-mask = <0x1>; /* PCI request lines to mask during NAND access */ partitions { @@ -200,7 +197,7 @@ status = "okay"; gpio-reset = <&gpio 21 GPIO_ACTIVE_HIGH>; - ath9k@7000 { + wifi@7000 { reg = <0x7000 0 0 0 0>; qca,no-eeprom; /* load from ath9k-eeprom-pci-0000:00:0e.0.bin */ }; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/BTHOMEHUBV5A.dts b/target/linux/lantiq/files/arch/mips/boot/dts/BTHOMEHUBV5A.dts similarity index 96% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/BTHOMEHUBV5A.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/BTHOMEHUBV5A.dts index c251fc3fc..c105f0a9a 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/BTHOMEHUBV5A.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/BTHOMEHUBV5A.dts @@ -24,13 +24,12 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x8000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; reset { @@ -48,11 +47,11 @@ restart { label = "restart"; gpios = <&gpio 39 GPIO_ACTIVE_LOW>; - linux,code = ; + linux,code = ; }; }; - gpio-leds { + leds { compatible = "gpio-leds"; /* broadband-* is a single RGB led */ @@ -157,11 +156,10 @@ }; }; - mdio@0 { + mdio { #address-cells = <1>; #size-cells = <0>; compatible = "lantiq,xrx200-mdio"; - reg = <0>; phy0: ethernet-phy@0 { reg = <0x0>; @@ -237,13 +235,11 @@ }; &localbus { - nand@1 { + flash@1 { compatible = "lantiq,nand-xway"; lantiq,cs = <1>; bank-width = <2>; reg = <0x1 0x0 0x2000000>; - #address-cells = <1>; - #size-cells = <1>; nand-on-flash-bbt; nand-ecc-strength = <3>; nand-ecc-step-size = <256>; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/DGN1000B.dts b/target/linux/lantiq/files/arch/mips/boot/dts/DGN1000B.dts similarity index 94% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/DGN1000B.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/DGN1000B.dts index 8c61e1b74..b4eee73b7 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/DGN1000B.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/DGN1000B.dts @@ -23,13 +23,12 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x1000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; reset { @@ -49,7 +48,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; dsl: dsl { label = "dgn1000b:green:dsl"; @@ -121,11 +120,9 @@ pinctrl-names = "default"; pinctrl-0 = <&pins_spi_default>; - m25p80@1 { - #address-cells = <1>; - #size-cells = <1>; + flash@1 { compatible = "jedec,spi-nor"; - reg = <1 0>; + reg = <1>; spi-max-frequency = <5000000>; partitions { diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/DGN3500.dts b/target/linux/lantiq/files/arch/mips/boot/dts/DGN3500.dts similarity index 100% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/DGN3500.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/DGN3500.dts diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/DGN3500.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/DGN3500.dtsi similarity index 93% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/DGN3500.dtsi rename to target/linux/lantiq/files/arch/mips/boot/dts/DGN3500.dtsi index b0facb410..4a20dcefd 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/DGN3500.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/DGN3500.dtsi @@ -20,6 +20,7 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x4000000>; }; @@ -31,21 +32,19 @@ realtek,initvals = < 0x0000 0x0830 0x0400 0x8130 - 0x000A 0x83ED - 0x0F51 0x0017 - 0x02F5 0x0048 - 0x02FA 0xFFDF - 0x02FB 0xFFE0 + 0x000a 0x83ed + 0x0f51 0x0017 + 0x02f5 0x0048 + 0x02fa 0xffdf + 0x02fb 0xffe0 0x0450 0x0000 0x0401 0x0000 0x0431 0x0960 >; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; rfkill { @@ -65,7 +64,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; internet: internet { label = "dgn3500:green:internet"; @@ -167,11 +166,9 @@ pinctrl-names = "default"; pinctrl-0 = <&pins_spi_default>; - m25p80@4 { - #address-cells = <1>; - #size-cells = <1>; + flash@4 { compatible = "jedec,spi-nor"; - reg = <4 0>; + reg = <4>; spi-max-frequency = <20000000>; partitions { diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/DGN3500B.dts b/target/linux/lantiq/files/arch/mips/boot/dts/DGN3500B.dts similarity index 100% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/DGN3500B.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/DGN3500B.dts diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/DM200.dts b/target/linux/lantiq/files/arch/mips/boot/dts/DM200.dts similarity index 95% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/DM200.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/DM200.dts index 8cf3456ee..4796123c2 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/DM200.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/DM200.dts @@ -23,13 +23,12 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x4000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; reset { label = "reset"; @@ -54,7 +53,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; power_amber: power_amber { @@ -103,11 +102,10 @@ }; }; - mdio@0 { + mdio { #address-cells = <1>; #size-cells = <0>; compatible = "lantiq,xrx200-mdio"; - reg = <0>; phy13: ethernet-phy@13 { reg = <0x13>; @@ -154,17 +152,15 @@ pinctrl-names = "default"; pinctrl-0 = <&pins_spi_default>; - m25p80@4 { - #address-cells = <1>; - #size-cells = <1>; + flash@4 { compatible = "jedec,spi-nor"; - reg = <4 0>; + reg = <4>; spi-max-frequency = <10000000>; partitions { - compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; + compatible = "fixed-partitions"; partition@0 { reg = <0x0 0x20000>; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY50712.dts b/target/linux/lantiq/files/arch/mips/boot/dts/EASY50712.dts similarity index 95% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY50712.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/EASY50712.dts index ec287ab40..ba7f302c2 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY50712.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/EASY50712.dts @@ -11,6 +11,7 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x2000000>; }; }; @@ -45,12 +46,10 @@ }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x2000000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY50810.dts b/target/linux/lantiq/files/arch/mips/boot/dts/EASY50810.dts similarity index 96% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY50810.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/EASY50810.dts index 21562dce2..4f101151d 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY50810.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/EASY50810.dts @@ -11,6 +11,7 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x2000000>; }; }; @@ -45,12 +46,10 @@ }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x2000000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY80920.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/EASY80920.dtsi similarity index 97% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY80920.dtsi rename to target/linux/lantiq/files/arch/mips/boot/dts/EASY80920.dtsi index 781cdfdb5..b7ccb4ed5 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY80920.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/EASY80920.dtsi @@ -21,13 +21,12 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x4000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; /* reset { label = "reset"; @@ -41,7 +40,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; power: power { @@ -145,11 +144,10 @@ }; }; - mdio@0 { + mdio { #address-cells = <1>; #size-cells = <0>; compatible = "lantiq,xrx200-mdio"; - reg = <0>; phy0: ethernet-phy@0 { reg = <0x0>; @@ -248,11 +246,9 @@ status = "okay"; - m25p80@4 { - #address-cells = <1>; - #size-cells = <1>; + flash@4 { compatible = "jedec,spi-nor"; - reg = <4 0>; + reg = <4>; spi-max-frequency = <1000000>; partitions { diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY80920NAND.dts b/target/linux/lantiq/files/arch/mips/boot/dts/EASY80920NAND.dts similarity index 95% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY80920NAND.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/EASY80920NAND.dts index 0134a7c17..f687edf54 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY80920NAND.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/EASY80920NAND.dts @@ -13,13 +13,11 @@ }; &localbus { - nand@0 { + flash@0 { compatible = "lantiq,nand-xway"; lantiq,cs = <1>; bank-width = <2>; reg = <0 0x0 0x2000000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY80920NOR.dts b/target/linux/lantiq/files/arch/mips/boot/dts/EASY80920NOR.dts similarity index 91% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY80920NOR.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/EASY80920NOR.dts index 9adc0b4f9..6ed6c5d42 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY80920NOR.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/EASY80920NOR.dts @@ -8,12 +8,10 @@ }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x2000000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY88388.dts b/target/linux/lantiq/files/arch/mips/boot/dts/EASY88388.dts similarity index 98% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY88388.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/EASY88388.dts index 86f3b47c6..12c448c2e 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY88388.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/EASY88388.dts @@ -17,7 +17,7 @@ reg = <0x0 0x4000000>; // 64M at 0x0 }; - gpio-keys { + keys { compatible = "gpio-keys"; reset { label = "reset"; @@ -34,7 +34,7 @@ }; }; - easy88388-leds { + leds { compatible = "gpio-leds"; pinctrl-names = "default"; pinctrl-0 = <&led_pins &bootled_pins>; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY88444.dts b/target/linux/lantiq/files/arch/mips/boot/dts/EASY88444.dts similarity index 97% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY88444.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/EASY88444.dts index e1a934fc4..3f29d319c 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY88444.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/EASY88444.dts @@ -17,7 +17,7 @@ reg = <0x0 0x4000000>; // 64M at 0x0 }; - gpio-keys { + keys { compatible = "gpio-keys"; reset { label = "reset"; @@ -33,7 +33,7 @@ }; }; - easy88444-leds { + leds { compatible = "gpio-leds"; pinctrl-names = "default"; pinctrl-0 = <&led_pins &bootled_pins>; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY98000-base.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/EASY98000-base.dtsi similarity index 97% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY98000-base.dtsi rename to target/linux/lantiq/files/arch/mips/boot/dts/EASY98000-base.dtsi index cfe1140ac..fa8c0b4b0 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY98000-base.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/EASY98000-base.dtsi @@ -10,7 +10,7 @@ reg = <0x0 0x4000000>; }; - easy98000-leds { + leds { compatible = "gpio-leds"; pinctrl-names = "default"; pinctrl-0 = <&bootled_pins>; @@ -49,7 +49,7 @@ }; &ebu_cs1 { - eth0: ethernet@0000000 { + eth0: ethernet@3 { compatible = "davicom,dm9000"; device_type = "network"; reg = <0x0000003 0x1>, <0x0000001 0x1>; @@ -79,7 +79,7 @@ &spi { status = "okay"; - eeprom@1 { + eeprom@2 { compatible = "atmel,at25", "atmel,at25160n"; reg = <2>; spi-max-frequency = <1000000>; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY98000NAND.dts b/target/linux/lantiq/files/arch/mips/boot/dts/EASY98000NAND.dts similarity index 97% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY98000NAND.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/EASY98000NAND.dts index a40cef393..2155f0cb1 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY98000NAND.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/EASY98000NAND.dts @@ -13,7 +13,7 @@ }; &ebu_cs0 { - gen_nand@0 { + flash@0 { compatible = "gen_nand", "lantiq,nand-falcon"; bank-width = <1>; reg = <0x0 0x40000>; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/EASY98000NOR.dts b/target/linux/lantiq/files/arch/mips/boot/dts/EASY98000NOR.dts new file mode 100644 index 000000000..3cb00343f --- /dev/null +++ b/target/linux/lantiq/files/arch/mips/boot/dts/EASY98000NOR.dts @@ -0,0 +1,42 @@ +/dts-v1/; + +#include "falcon.dtsi" +#include "EASY98000-base.dtsi" + +/ { + model = "Lantiq Falcon (NOR)"; + compatible = "lantiq,easy98000-nor", "lantiq,easy98000", "lantiq,falcon"; + + aliases { + spi0 = &spi; + }; +}; + +&ebu_cs0 { + flash@0 { + compatible = "lantiq,nor"; + bank-width = <2>; + reg = <0x0 0x4000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "uboot"; + reg = <0x00000 0x40000>; + }; + + partition@10000 { + label = "uboot_env"; + reg = <0x40000 0x40000>; + }; + + partition@20000 { + label = "linux"; + reg = <0x80000 0x3d0000>; + }; + }; + }; +}; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY98000SFLASH.dts b/target/linux/lantiq/files/arch/mips/boot/dts/EASY98000SFLASH.dts similarity index 100% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY98000SFLASH.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/EASY98000SFLASH.dts diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY98020.dts b/target/linux/lantiq/files/arch/mips/boot/dts/EASY98020.dts similarity index 90% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY98020.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/EASY98020.dts index b66786a2c..7a3ef418d 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY98020.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/EASY98020.dts @@ -18,7 +18,7 @@ reg = <0x0 0x4000000>; // 64M at 0x0 }; - gpio-keys { + keys { compatible = "gpio-keys"; reset { label = "reset"; @@ -34,10 +34,10 @@ }; }; - easy98020-leds { + leds { compatible = "gpio-leds"; pinctrl-names = "default"; - pinctrl-0 = <&bootled_pins>; + pinctrl-0 = <&bootled_pins>, <&led_pins>; GPON { label = "easy98020:green:gpon"; @@ -64,12 +64,6 @@ gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; default-state = "keep"; }; - }; - - easy98020-phy-leds { - compatible = "gpio-leds"; - pinctrl-names = "default"; - pinctrl-0 = <&led_pins>; GE0_ACT { label = "easy98020:ge0_act"; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY98020V18.dts b/target/linux/lantiq/files/arch/mips/boot/dts/EASY98020V18.dts similarity index 97% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY98020V18.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/EASY98020V18.dts index 9aa1be91e..571e23454 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY98020V18.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/EASY98020V18.dts @@ -18,7 +18,7 @@ reg = <0x0 0x4000000>; // 64M at 0x0 }; - gpio-keys { + keys { compatible = "gpio-keys"; reset { label = "reset"; @@ -34,7 +34,7 @@ }; }; - easy98020-leds { + leds { compatible = "gpio-leds"; pinctrl-names = "default"; pinctrl-0 = <&led_pins &bootled_pins>; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY98021.dts b/target/linux/lantiq/files/arch/mips/boot/dts/EASY98021.dts similarity index 98% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY98021.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/EASY98021.dts index 38154d6f1..7eb40bde2 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY98021.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/EASY98021.dts @@ -18,7 +18,7 @@ reg = <0x0 0x4000000>; // 64M at 0x0 }; - gpio-keys { + keys { compatible = "gpio-keys"; reset { label = "reset"; @@ -46,7 +46,7 @@ }; }; - easy98021-leds { + leds { compatible = "gpio-leds"; pinctrl-names = "default"; pinctrl-0 = <&led_pins &bootled_pins>; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY98035SYNCE.dts b/target/linux/lantiq/files/arch/mips/boot/dts/EASY98035SYNCE.dts similarity index 100% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY98035SYNCE.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/EASY98035SYNCE.dts diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY98035SYNCE1588.dts b/target/linux/lantiq/files/arch/mips/boot/dts/EASY98035SYNCE1588.dts similarity index 100% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/EASY98035SYNCE1588.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/EASY98035SYNCE1588.dts diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/FALCON-MDU.dts b/target/linux/lantiq/files/arch/mips/boot/dts/FALCON-MDU.dts similarity index 98% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/FALCON-MDU.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/FALCON-MDU.dts index 6710bbe98..c5da8b564 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/FALCON-MDU.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/FALCON-MDU.dts @@ -18,7 +18,7 @@ reg = <0x0 0x4000000>; // 64M at 0x0 }; - mdu-leds { + leds { compatible = "gpio-leds"; pinctrl-names = "default"; pinctrl-0 = <&bootled_pins>; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/FALCON-SFP.dts b/target/linux/lantiq/files/arch/mips/boot/dts/FALCON-SFP.dts similarity index 100% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/FALCON-SFP.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/FALCON-SFP.dts diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/FRITZ3370-REV2-HYNIX.dts b/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ3370-REV2-HYNIX.dts similarity index 84% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/FRITZ3370-REV2-HYNIX.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/FRITZ3370-REV2-HYNIX.dts index 3cb7d7d72..c70f124db 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/FRITZ3370-REV2-HYNIX.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ3370-REV2-HYNIX.dts @@ -4,16 +4,14 @@ / { compatible = "avm,fritz3370-rev2-hynix", "avm,fritz3370-rev2", "lantiq,xway", "lantiq,vr9"; - model = "AVM Fritz!Box WLAN 3370 Rev. 2 (Hynix NAND)"; + model = "AVM FRITZ!Box 3370 Rev. 2 (Hynix NAND)"; }; &localbus { - nand@1 { + flash@1 { compatible = "lantiq,nand-xway"; bank-width = <2>; reg = <1 0x0 0x2000000>; - #address-cells = <1>; - #size-cells = <1>; nand-ecc-mode = "soft"; nand-ecc-strength = <3>; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/FRITZ3370-REV2-MICRON.dts b/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ3370-REV2-MICRON.dts similarity index 82% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/FRITZ3370-REV2-MICRON.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/FRITZ3370-REV2-MICRON.dts index 1a1be6fd3..3aaea4cb6 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/FRITZ3370-REV2-MICRON.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ3370-REV2-MICRON.dts @@ -4,16 +4,14 @@ / { compatible = "avm,fritz3370-rev2-micron", "avm,fritz3370-rev2", "lantiq,xway", "lantiq,vr9"; - model = "AVM Fritz!Box WLAN 3370 Rev. 2 (Micron NAND)"; + model = "AVM FRITZ!Box 3370 Rev. 2 (Micron NAND)"; }; &localbus { - nand@1 { + flash@1 { compatible = "lantiq,nand-xway"; bank-width = <2>; reg = <1 0x0 0x2000000>; - #address-cells = <1>; - #size-cells = <1>; nand-ecc-mode = "on-die"; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/FRITZ3370-REV2.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ3370-REV2.dtsi similarity index 90% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/FRITZ3370-REV2.dtsi rename to target/linux/lantiq/files/arch/mips/boot/dts/FRITZ3370-REV2.dtsi index a7e0c7191..f23d2d2cf 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/FRITZ3370-REV2.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ3370-REV2.dtsi @@ -5,7 +5,7 @@ / { compatible = "avm,fritz3370-rev2", "lantiq,xway", "lantiq,vr9"; - model = "AVM Fritz!Box WLAN 3370 Rev. 2"; + model = "AVM FRITZ!Box 3370 Rev. 2"; chosen { bootargs = "console=ttyLTQ0,115200"; @@ -23,6 +23,7 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x8000000>; }; @@ -31,10 +32,8 @@ gpios = <&gpio 45 GPIO_ACTIVE_HIGH>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; power { @@ -50,7 +49,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; power_green: power { @@ -154,11 +153,10 @@ }; }; - mdio@0 { + mdio { #address-cells = <1>; #size-cells = <0>; compatible = "lantiq,xrx200-mdio"; - reg = <0>; phy0: ethernet-phy@0 { reg = <0x0>; @@ -260,29 +258,33 @@ pinctrl-names = "default"; pinctrl-0 = <&pins_spi_default>; - m25p80@4 { - #address-cells = <1>; - #size-cells = <1>; + flash@4 { compatible = "jedec,spi-nor"; - reg = <4 0>; + reg = <4>; spi-max-frequency = <1000000>; - urlader: partition@0 { - reg = <0x0 0x20000>; - label = "urlader"; - read-only; - }; + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; - partition@20000 { - reg = <0x20000 0x10000>; - label = "tffs (1)"; - read-only; - }; + urlader: partition@0 { + reg = <0x0 0x20000>; + label = "urlader"; + read-only; + }; - partition@30000 { - reg = <0x30000 0x10000>; - label = "tffs (2)"; - read-only; + partition@20000 { + reg = <0x20000 0x10000>; + label = "tffs (1)"; + read-only; + }; + + partition@30000 { + reg = <0x30000 0x10000>; + label = "tffs (2)"; + read-only; + }; }; }; }; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/FRITZ7312.dts b/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ7312.dts similarity index 94% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/FRITZ7312.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/FRITZ7312.dts index c14695413..811f78f93 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/FRITZ7312.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ7312.dts @@ -6,7 +6,7 @@ / { compatible = "avm,fritz7312", "lantiq,xway", "lantiq,ar9"; - model = "FritzBox 7312 (1&1 WLAN-MODEM)"; + model = "AVM FRITZ!Box 7312"; chosen { bootargs = "console=ttyLTQ0,115200"; @@ -24,13 +24,12 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x4000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; wlan { @@ -45,7 +44,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; power: power { @@ -121,7 +120,6 @@ mdio-bus { #address-cells = <1>; #size-cells = <0>; - reg = <0>; phy0: ethernet-phy@0 { reg = <0>; @@ -131,12 +129,10 @@ }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x1000000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/FRITZ7320.dts b/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ7320.dts similarity index 94% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/FRITZ7320.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/FRITZ7320.dts index 45a59c012..40348b1d5 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/FRITZ7320.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ7320.dts @@ -6,7 +6,7 @@ / { compatible = "avm,fritz7320", "lantiq,xway", "lantiq,ar9"; - model = "1&1 HomeServer"; + model = "AVM FRITZ!Box 7320"; chosen { bootargs = "console=ttyLTQ0,115200"; @@ -24,13 +24,12 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x4000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; rfkill { @@ -45,7 +44,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; power: power { label = "fritz7320:green:power"; @@ -105,12 +104,10 @@ }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x1000000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; @@ -159,6 +156,14 @@ status = "okay"; }; +&usb_phy1 { + status = "okay"; +}; + &usb0 { status = "okay"; }; + +&usb1 { + status = "okay"; +}; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ7360SL.dts b/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ7360SL.dts new file mode 100644 index 000000000..0fbe6396a --- /dev/null +++ b/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ7360SL.dts @@ -0,0 +1,81 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "FRITZ736X.dtsi" + +#include +#include + +/ { + compatible = "avm,fritz7360sl", "avm,fritz736x", "lantiq,xway", "lantiq,vr9"; + model = "AVM FRITZ!Box 7360 SL"; +}; + +&power_green { + label = "fritz7360sl:green:power"; +}; + +&power_red { + label = "fritz7360sl:red:power"; +}; + +&info_green { + label = "fritz7360sl:green:info"; +}; + +&wifi { + label = "fritz7360sl:green:wlan"; +}; + +&info_red { + label = "fritz7360sl:red:info"; +}; + +&dect { + label = "fritz7360sl:green:dect"; +}; + +&state_default { + pcie-rst { + lantiq,pins = "io38"; + lantiq,pull = <0>; + lantiq,output = <1>; + }; +}; + +&localbus { + flash@0 { + compatible = "lantiq,nor"; + bank-width = <2>; + reg = <0 0x0 0x1000000>; + + partitions { + #address-cells = <1>; + #size-cells = <1>; + compatible = "fixed-partitions"; + + urlader: partition@0 { + label = "urlader"; + reg = <0x00000 0x20000>; + read-only; + }; + + partition@20000 { + label = "firmware"; + reg = <0x20000 0xf60000>; + }; + + partition@f80000 { + label = "tffs (1)"; + reg = <0xf80000 0x40000>; + read-only; + }; + + partition@fc0000 { + label = "tffs (2)"; + reg = <0xfc0000 0x40000>; + read-only; + }; + }; + }; +}; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ7362SL.dts b/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ7362SL.dts new file mode 100644 index 000000000..cca79c926 --- /dev/null +++ b/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ7362SL.dts @@ -0,0 +1,133 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "FRITZ736X.dtsi" + +#include +#include + +/ { + compatible = "avm,fritz7362sl", "avm,fritz736x", "lantiq,xway", "lantiq,vr9"; + model = "AVM FRITZ!Box 7362 SL"; +}; + +&power_green { + label = "fritz7362sl:green:power"; +}; + +&power_red { + label = "fritz7362sl:red:power"; +}; + +&info_green { + label = "fritz7362sl:green:info"; +}; + +&wifi { + label = "fritz7362sl:green:wlan"; +}; + +&info_red { + label = "fritz7362sl:red:info"; +}; + +&dect { + label = "fritz7362sl:green:dect"; +}; + +&gpio { + pins_spi_default: pins_spi_default { + spi_in { + lantiq,groups = "spi_di"; + lantiq,function = "spi"; + }; + + spi_out { + lantiq,groups = "spi_do", "spi_clk", + "spi_cs4"; + lantiq,function = "spi"; + lantiq,output = <1>; + }; + }; +}; + +&state_default { + nand { + lantiq,groups = "nand ale", "nand cle", + "nand cs1", "nand rd", "nand rdy"; + lantiq,function = "ebu"; + }; + + pcie-rst { + lantiq,pins = "io21"; + lantiq,open-drain = <1>; + lantiq,output = <1>; + }; +}; + +&spi { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pins_spi_default>; + + flash@4 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <4 0>; + spi-max-frequency = <1000000>; + + urlader: partition@0 { + reg = <0x0 0x40000>; + label = "urlader"; + read-only; + }; + + partition@40000 { + reg = <0x40000 0x60000>; + label = "tffs (1)"; + read-only; + }; + + partition@A0000 { + reg = <0xA0000 0x60000>; + label = "tffs (2)"; + read-only; + }; + }; +}; + +&localbus { + flash@1 { + compatible = "lantiq,nand-xway"; + lantiq,cs1 = <1>; + bank-width = <1>; + reg = <1 0x0 0x2000000>; + nand-ecc-mode = "on-die"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "kernel"; + reg = <0x0 0x400000>; + }; + + partition@400000 { + label = "ubi"; + reg = <0x400000 0x7c00000>; + }; + }; + }; +}; + +&pcie0 { + gpio-reset = <&gpio 21 GPIO_ACTIVE_LOW>; + + pcie@0 { + #size-cells = <1>; + #address-cells = <2>; + }; +}; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/FRITZ7360SL.dts b/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ736X.dtsi similarity index 73% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/FRITZ7360SL.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/FRITZ736X.dtsi index 91520c813..82546a357 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/FRITZ7360SL.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ736X.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; #include "vr9.dtsi" @@ -6,8 +7,7 @@ #include / { - compatible = "avm,fritz7360sl", "lantiq,xway", "lantiq,vr9"; - model = "1&1 HomeServer"; + compatible = "avm,fritz736x", "lantiq,xway", "lantiq,vr9"; chosen { bootargs = "console=ttyLTQ0,115200"; @@ -18,25 +18,25 @@ led-failsafe = &power_red; led-running = &power_green; led-upgrade = &power_green; - led-dsl = &info_green; led-wifi = &wifi; }; memory@0 { + device_type = "memory"; reg = <0x0 0x8000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; + dect { label = "dect"; gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; linux,code = ; }; + wifi { label = "wifi"; gpios = <&gpio 29 GPIO_ACTIVE_HIGH>; @@ -44,32 +44,31 @@ }; }; - gpio-leds { + leds: leds { compatible = "gpio-leds"; power_green: power { - label = "fritz7360sl:green:power"; gpios = <&gpio 32 GPIO_ACTIVE_LOW>; default-state = "keep"; }; + power_red: power2 { - label = "fritz7360sl:red:power"; gpios = <&gpio 33 GPIO_ACTIVE_LOW>; }; - info_red { - label = "fritz7360sl:red:info"; - gpios = <&gpio 34 GPIO_ACTIVE_LOW>; - }; + info_green: info_green { - label = "fritz7360sl:green:info"; gpios = <&gpio 47 GPIO_ACTIVE_LOW>; }; + wifi: wifi { - label = "fritz7360sl:green:wlan"; gpios = <&gpio 36 GPIO_ACTIVE_LOW>; }; - dect { - label = "fritz7360sl:green:dect"; + + info_red: info_red { + gpios = <&gpio 34 GPIO_ACTIVE_LOW>; + }; + + dect: dect { gpios = <&gpio 35 GPIO_ACTIVE_LOW>; }; }; @@ -91,18 +90,21 @@ phy-mode = "rmii"; phy-handle = <&phy0>; }; + ethernet@1 { compatible = "lantiq,xrx200-pdi-port"; reg = <1>; phy-mode = "rmii"; phy-handle = <&phy1>; }; + ethernet@2 { compatible = "lantiq,xrx200-pdi-port"; reg = <2>; phy-mode = "gmii"; phy-handle = <&phy11>; }; + ethernet@3 { compatible = "lantiq,xrx200-pdi-port"; reg = <4>; @@ -111,26 +113,28 @@ }; }; - mdio@0 { + mdio { #address-cells = <1>; #size-cells = <0>; compatible = "lantiq,xrx200-mdio"; - reg = <0>; phy0: ethernet-phy@0 { reg = <0x00>; compatible = "ethernet-phy-ieee802.3-c22"; reset-gpios = <&gpio 37 GPIO_ACTIVE_LOW>; }; + phy1: ethernet-phy@1 { reg = <0x01>; compatible = "ethernet-phy-ieee802.3-c22"; reset-gpios = <&gpio 44 GPIO_ACTIVE_LOW>; }; + phy11: ethernet-phy@11 { reg = <0x11>; compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22"; }; + phy13: ethernet-phy@13 { reg = <0x13>; compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22"; @@ -155,64 +159,25 @@ lantiq,groups = "mdio"; lantiq,function = "mdio"; }; + phy-rst { lantiq,pins = "io37", "io44"; lantiq,pull = <0>; lantiq,open-drain; lantiq,output = <1>; }; - pcie-rst { - lantiq,pins = "io38"; - lantiq,pull = <0>; - lantiq,output = <1>; - }; }; -}; -&localbus { - nor@0 { - compatible = "lantiq,nor"; - bank-width = <2>; - reg = <0 0x0 0x1000000>; - #address-cells = <1>; - #size-cells = <1>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - urlader: partition@0 { - label = "urlader"; - reg = <0x00000 0x20000>; - read-only; - }; - - partition@20000 { - label = "firmware"; - reg = <0x20000 0xf60000>; - }; - - partition@f80000 { - label = "tffs (1)"; - reg = <0xf80000 0x40000>; - read-only; - }; - - partition@fc0000 { - label = "tffs (2)"; - reg = <0xfc0000 0x40000>; - read-only; - }; - }; - }; }; &pcie0 { + status = "okay"; + pcie@0 { reg = <0 0 0 0 0>; #interrupt-cells = <1>; - #size-cells = <2>; - #address-cells = <3>; + #size-cells = <1>; + #address-cells = <2>; device_type = "pci"; wifi@168c,002e { diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ7412.dts b/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ7412.dts new file mode 100644 index 000000000..baf3d69fb --- /dev/null +++ b/target/linux/lantiq/files/arch/mips/boot/dts/FRITZ7412.dts @@ -0,0 +1,228 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "vr9.dtsi" + +#include +#include + +/ { + compatible = "avm,fritz7412", "lantiq,xway", "lantiq,vr9"; + model = "AVM FRITZ!Box 7412"; + + chosen { + bootargs = "console=ttyLTQ0,115200 mem=126M vpe1_load_addr=0x87e00000 vpe1_mem=2M maxvpes=1 maxtcs=1 nosmp"; + }; + + aliases { + led-boot = &power_green; + led-failsafe = &power_red; + led-running = &power_green; + + led-dsl = &info; + led-wifi = &wifi; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x8000000>; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <100>; + + wps { + label = "wps"; + gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; + linux,code = ; + }; + + dect { + label = "dect"; + gpios = <&gpio 2 GPIO_ACTIVE_HIGH>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + power_green: power_green { + label = "fritz7412:green:power"; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + default-state = "keep"; + }; + + power_red: power_red { + label = "fritz7412:red:power"; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + }; + + fon { + label = "fritz7412:green:fon"; + gpios = <&gpio 34 GPIO_ACTIVE_LOW>; + }; + + dect { + label = "fritz7412:green:dect"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + wifi: wifi { + label = "fritz7412:green:wifi"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + }; + + info: info { + label = "fritz7412:green:info"; + gpios = <&gpio 35 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&localbus { + flash@0 { + compatible = "lantiq,nand-xway"; + bank-width = <2>; + reg = <0 0x0 0x2000000>; + lantiq,cs = <1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "urlader"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "nand-tffs"; + reg = <0x40000 0x400000>; + read-only; + }; + + partition@440000 { + label = "kernel"; + reg = <0x440000 0x400000>; + }; + + partition@840000 { + label = "ubi"; + reg = <0x840000 0x3000000>; + }; + + partition@3840000 { + label = "reserved-kernel"; + reg = <0x3840000 0x400000>; + read-only; + }; + + partition@3c40000 { + label = "reserved-filesystem"; + reg = <0x3c40000 0x3000000>; + read-only; + }; + + partition@6c40000 { + label = "config"; + reg = <0x6c40000 0x400000>; + read-only; + }; + + partition@6e40000 { + label = "nand-filesystem"; + reg = <0x6e40000 0x400000>; + read-only; + }; + }; + }; +}; + +&pcie0 { + status = "okay"; + gpio-reset = <&gpio 11 GPIO_ACTIVE_HIGH>; + + pcie@0 { + reg = <0 0 0 0 0>; + #interrupt-cells = <1>; + #size-cells = <2>; + #address-cells = <3>; + device_type = "pci"; + + wifi@168c,002e { + compatible = "pci168c,002e"; + reg = <0 0 0 0 0>; + qca,no-eeprom; /* load from ath9k-eeprom-pci-0000:01:00.0.bin */ + }; + }; +}; + +&gpio { + pinctrl-names = "default"; + pinctrl-0 = <&state_default>; + + state_default: pinmux { + mdio { + lantiq,groups = "mdio"; + lantiq,function = "mdio"; + }; + pcie-rst { + lantiq,pins = "io11"; + lantiq,open-drain = <1>; + lantiq,output = <1>; + }; + nand-mux { + lantiq,groups = "nand cle", "nand ale", + "nand rd", "nand cs1", + "nand rdy"; + lantiq,function = "ebu"; + }; + nand-pins { + lantiq,pins = "io13", "io24", "io49"; + lantiq,pull = <1>; + }; + }; +}; + +&gphy0 { + lantiq,gphy-mode = ; +}; + +ð0 { + lantiq,phys = <&gphy0>; + + interface@0 { + compatible = "lantiq,xrx200-pdi"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + mac-address = [ 00 11 22 33 44 55 ]; + lantiq,switch; + + ethernet@2 { + compatible = "lantiq,xrx200-pdi-port"; + reg = <2>; + phy-mode = "gmii"; + phy-handle = <&phy11>; + }; + }; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + compatible = "lantiq,xrx200-mdio"; + + phy11: ethernet-phy@11 { + reg = <0x11>; + compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22"; + }; + }; +}; + +&vmmc { + status = "okay"; +}; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/GIGASX76X.dts b/target/linux/lantiq/files/arch/mips/boot/dts/GIGASX76X.dts similarity index 90% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/GIGASX76X.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/GIGASX76X.dts index 36b82515d..a9a5cbae2 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/GIGASX76X.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/GIGASX76X.dts @@ -13,13 +13,12 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x2000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; reset { @@ -65,12 +64,6 @@ }; }; - -&gpiomm { - status = "okay"; - lantiq,shadow = <0x3>; -}; - &gpios { status = "okay"; }; @@ -80,12 +73,10 @@ }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x2000000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; @@ -108,6 +99,16 @@ }; }; }; + + gpiomm: gpio@1 { + compatible = "lantiq,gpio-mm"; + reg = <1 0x0 0x10 >; + #address-cells = <1>; + #size-cells = <1>; + #gpio-cells = <2>; + gpio-controller; + lantiq,shadow = <0x3>; + }; }; &pci0 { diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/H201L.dts b/target/linux/lantiq/files/arch/mips/boot/dts/H201L.dts similarity index 95% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/H201L.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/H201L.dts index 46cae21a5..9b640e032 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/H201L.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/H201L.dts @@ -25,13 +25,12 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x2000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; reset { @@ -51,7 +50,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; power_green: power { @@ -132,12 +131,10 @@ }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x2000000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/P2601HNFX.dts b/target/linux/lantiq/files/arch/mips/boot/dts/P2601HNFX.dts similarity index 96% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/P2601HNFX.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/P2601HNFX.dts index 6e01068ed..62e5e7016 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/P2601HNFX.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/P2601HNFX.dts @@ -24,13 +24,12 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x4000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; reset { @@ -45,7 +44,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; power_green: power { @@ -148,12 +147,10 @@ }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x2000000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; @@ -181,6 +178,7 @@ }; &stp { + status = "okay"; lantiq,shadow = <0xfff>; lantiq,groups = <0x3>; }; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/P2812HNUF1.dts b/target/linux/lantiq/files/arch/mips/boot/dts/P2812HNUF1.dts similarity index 87% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/P2812HNUF1.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/P2812HNUF1.dts index 911a2d6af..3159a5a24 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/P2812HNUF1.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/P2812HNUF1.dts @@ -11,7 +11,7 @@ led-usb2 = &led_usb2; }; - gpio-leds { + leds { led_usb1: usb1 { label = "p2812hnuf1:green:usb1"; gpios = <&gpio 38 GPIO_ACTIVE_LOW>; @@ -24,13 +24,11 @@ }; &localbus { - nand@0 { + flash@0 { compatible = "lantiq,nand-xway"; lantiq,cs = <1>; bank-width = <2>; reg = <0 0x0 0x2000000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; @@ -47,11 +45,11 @@ }; partition@60000 { label = "kernel"; - reg = <0x60000 0x200000>; + reg = <0x60000 0x300000>; }; - partition@260000 { + partition@360000 { label = "ubi"; - reg = <0x260000 0x7da0000>; + reg = <0x360000 0x7ca0000>; }; }; }; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/P2812HNUF3.dts b/target/linux/lantiq/files/arch/mips/boot/dts/P2812HNUF3.dts similarity index 94% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/P2812HNUF3.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/P2812HNUF3.dts index 202226aa8..f6e8fd8c8 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/P2812HNUF3.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/P2812HNUF3.dts @@ -16,12 +16,10 @@ }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x800000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; @@ -44,7 +42,7 @@ }; }; - nand@1 { + flash@1 { compatible = "lantiq,nand-xway"; lantiq,cs = <1>; bank-width = <2>; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/P2812HNUFX.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/P2812HNUFX.dtsi similarity index 98% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/P2812HNUFX.dtsi rename to target/linux/lantiq/files/arch/mips/boot/dts/P2812HNUFX.dtsi index 65424e3ef..9956a5b89 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/P2812HNUFX.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/P2812HNUFX.dtsi @@ -22,13 +22,12 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x8000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; reset { @@ -44,7 +43,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; internet_red { @@ -152,11 +151,10 @@ }; }; - mdio@0 { + mdio { #address-cells = <1>; #size-cells = <0>; compatible = "lantiq,xrx200-mdio"; - reg = <0>; phy0: ethernet-phy@0 { reg = <0x0>; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/TDW8970.dts b/target/linux/lantiq/files/arch/mips/boot/dts/TDW8970.dts similarity index 100% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/TDW8970.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/TDW8970.dts diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/TDW8980.dts b/target/linux/lantiq/files/arch/mips/boot/dts/TDW8980.dts similarity index 100% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/TDW8980.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/TDW8980.dts diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/TDW89X0.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/TDW89X0.dtsi similarity index 97% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/TDW89X0.dtsi rename to target/linux/lantiq/files/arch/mips/boot/dts/TDW89X0.dtsi index 233b7e333..1a7d90a5b 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/TDW89X0.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/TDW89X0.dtsi @@ -23,13 +23,12 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x4000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; reset { label = "reset"; @@ -85,6 +84,7 @@ wifi: wifi { label = "tdw89x0:green:wifi"; gpios = <&ath9k 0 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; }; }; @@ -138,11 +138,10 @@ }; }; - mdio@0 { + mdio { #address-cells = <1>; #size-cells = <0>; compatible = "lantiq,xrx200-mdio"; - reg = <0>; phy0: ethernet-phy@0 { reg = <0x0>; @@ -240,11 +239,9 @@ pinctrl-names = "default"; pinctrl-0 = <&pins_spi_default>; - m25p80@4 { - #address-cells = <1>; - #size-cells = <1>; + flash@4 { compatible = "jedec,spi-nor"; - reg = <4 0>; + reg = <4>; spi-max-frequency = <33250000>; m25p,fast-read; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/VG3503J.dts b/target/linux/lantiq/files/arch/mips/boot/dts/VG3503J.dts similarity index 94% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/VG3503J.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/VG3503J.dts index 9735b2e01..2d5217643 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/VG3503J.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/VG3503J.dts @@ -23,13 +23,12 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x2000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; reset { label = "reset"; @@ -38,7 +37,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; power_red: power2 { @@ -79,11 +78,10 @@ }; }; - mdio@0 { + mdio { #address-cells = <1>; #size-cells = <0>; compatible = "lantiq,xrx200-mdio"; - reg = <0>; phy11: ethernet-phy@11 { reg = <0x11>; @@ -134,12 +132,10 @@ }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x2000000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/VGV7510KW22.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/VGV7510KW22.dtsi similarity index 96% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/VGV7510KW22.dtsi rename to target/linux/lantiq/files/arch/mips/boot/dts/VGV7510KW22.dtsi index 811f39d08..f10a9dd8e 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/VGV7510KW22.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/VGV7510KW22.dtsi @@ -22,13 +22,12 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x4000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; reset { @@ -44,7 +43,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; dsl: dsl { @@ -148,11 +147,10 @@ }; }; - mdio@0 { + mdio { #address-cells = <1>; #size-cells = <0>; compatible = "lantiq,xrx200-mdio"; - reg = <0>; phy1: ethernet-phy@1 { reg = <0x1>; @@ -213,12 +211,10 @@ }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x1000000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/VGV7510KW22BRN.dts b/target/linux/lantiq/files/arch/mips/boot/dts/VGV7510KW22BRN.dts similarity index 98% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/VGV7510KW22BRN.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/VGV7510KW22BRN.dts index 94b96d74d..5a33121d7 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/VGV7510KW22BRN.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/VGV7510KW22BRN.dts @@ -14,7 +14,7 @@ }; &localbus { - nor@0 { + flash@0 { partitions { partition@0 { label = "Boot"; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/VGV7510KW22NOR.dts b/target/linux/lantiq/files/arch/mips/boot/dts/VGV7510KW22NOR.dts similarity index 97% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/VGV7510KW22NOR.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/VGV7510KW22NOR.dts index cc84c63f2..2accffaed 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/VGV7510KW22NOR.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/VGV7510KW22NOR.dts @@ -8,7 +8,7 @@ }; &localbus { - nor@0 { + flash@0 { partitions { partition@0 { label = "uboot"; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/VGV7519.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/VGV7519.dtsi similarity index 97% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/VGV7519.dtsi rename to target/linux/lantiq/files/arch/mips/boot/dts/VGV7519.dtsi index 8ffa9146d..0b3e72d3a 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/VGV7519.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/VGV7519.dtsi @@ -22,13 +22,12 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x4000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; reset { label = "reset"; @@ -52,7 +51,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; eco { @@ -169,11 +168,10 @@ }; }; - mdio@0 { + mdio { #address-cells = <1>; #size-cells = <0>; compatible = "lantiq,xrx200-mdio"; - reg = <0>; phy0: ethernet-phy@0 { reg = <0x0>; @@ -239,12 +237,10 @@ }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x800000>, <1 0x800000 0x800000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; @@ -279,6 +275,7 @@ }; &stp { + status = "okay"; lantiq,shadow = <0xffff>; lantiq,groups = <0x3>; lantiq,dsl = <0x0>; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/VGV7519BRN.dts b/target/linux/lantiq/files/arch/mips/boot/dts/VGV7519BRN.dts similarity index 99% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/VGV7519BRN.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/VGV7519BRN.dts index 1e6a65ebb..c51a44bb3 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/VGV7519BRN.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/VGV7519BRN.dts @@ -8,7 +8,7 @@ }; &localbus { - nor@0 { + flash@0 { partitions { partition@0 { label = "Boot"; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/VGV7519NOR.dts b/target/linux/lantiq/files/arch/mips/boot/dts/VGV7519NOR.dts similarity index 97% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/VGV7519NOR.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/VGV7519NOR.dts index 4bdf0bc75..aa6a96156 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/VGV7519NOR.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/VGV7519NOR.dts @@ -8,7 +8,7 @@ }; &localbus { - nor@0 { + flash@0 { partitions { partition@0 { label = "uboot"; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/VR200.dts b/target/linux/lantiq/files/arch/mips/boot/dts/VR200.dts similarity index 95% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/VR200.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/VR200.dts index 74f666ddf..8724e37b4 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/VR200.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/VR200.dts @@ -24,10 +24,8 @@ led-usb2 = &led_usb; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; reset { label = "reset"; @@ -55,7 +53,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; power: power { label = "vr200:blue:power"; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/VR200.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/VR200.dtsi similarity index 97% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/VR200.dtsi rename to target/linux/lantiq/files/arch/mips/boot/dts/VR200.dtsi index dcfa86125..3c0478531 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/VR200.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/VR200.dtsi @@ -5,6 +5,7 @@ / { memory@0 { + device_type = "memory"; reg = <0x0 0x7f00000>; }; @@ -57,11 +58,10 @@ }; }; - mdio@0 { + mdio { #address-cells = <1>; #size-cells = <0>; compatible = "lantiq,xrx200-mdio"; - reg = <0>; phy0: ethernet-phy@0 { reg = <0x0>; @@ -143,11 +143,9 @@ pinctrl-names = "default"; pinctrl-0 = <&pins_spi_default>; - m25p80@4 { - #address-cells = <1>; - #size-cells = <1>; + flash@4 { compatible = "jedec,spi-nor"; - reg = <4 0>; + reg = <4>; spi-max-frequency = <33250000>; m25p,fast-read; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/VR200v.dts b/target/linux/lantiq/files/arch/mips/boot/dts/VR200v.dts similarity index 96% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/VR200v.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/VR200v.dts index dc65dbfc3..34805bb9f 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/VR200v.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/VR200v.dts @@ -24,10 +24,8 @@ led-usb2 = &led_usb; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; reset { label = "reset"; @@ -55,7 +53,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; power: power { label = "vr200v:blue:power"; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/WBMR.dts b/target/linux/lantiq/files/arch/mips/boot/dts/WBMR.dts similarity index 96% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/WBMR.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/WBMR.dts index 9759b311b..5419215dc 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/WBMR.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/WBMR.dts @@ -25,13 +25,12 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x4000000>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; wps { @@ -56,7 +55,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; power_green: power { @@ -146,12 +145,10 @@ }; &localbus { - nor@0 { + flash@0 { compatible = "lantiq,nor"; bank-width = <2>; reg = <0 0x0 0x2000000>; - #address-cells = <1>; - #size-cells = <1>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/WBMR300.dts b/target/linux/lantiq/files/arch/mips/boot/dts/WBMR300.dts similarity index 86% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/WBMR300.dts rename to target/linux/lantiq/files/arch/mips/boot/dts/WBMR300.dts index 5dcf13912..48f6dc71a 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/WBMR300.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/WBMR300.dts @@ -25,6 +25,7 @@ }; memory@0 { + device_type = "memory"; reg = <0x0 0x4000000>; }; @@ -33,10 +34,8 @@ gpios = <&gpio 6 GPIO_ACTIVE_LOW>; }; - gpio-keys-polled { + keys { compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <100>; power { @@ -72,7 +71,7 @@ }; }; - gpio-leds { + leds { compatible = "gpio-leds"; diag_r: diag_r { @@ -189,11 +188,10 @@ }; }; - mdio@0 { + mdio { #address-cells = <1>; #size-cells = <0>; compatible = "lantiq,xrx200-mdio"; - reg = <0>; phy11: ethernet-phy@11 { reg = <0x11>; @@ -263,50 +261,53 @@ pinctrl-names = "default"; pinctrl-0 = <&pins_spi_default>; - m25p80@4 { - #address-cells = <1>; - #size-cells = <1>; + flash@4 { compatible = "jedec,spi-nor"; - reg = <4 0>; + reg = <4>; spi-max-frequency = <20000000>; - partition@0 { - reg = <0x0 0x10000>; - label = "u-boot"; - read-only; - }; + partitions { + #address-cells = <1>; + #size-cells = <1>; - partition@10000 { - reg = <0x10000 0x10000>; - label = "gphyfirmware"; - read-only; - }; + partition@0 { + reg = <0x0 0x10000>; + label = "u-boot"; + read-only; + }; - partition@20000 { - reg = <0x20000 0x80000>; - label = "dsl_fw"; - }; + partition@10000 { + reg = <0x10000 0x10000>; + label = "gphyfirmware"; + read-only; + }; - partition@de0000 { - reg = <0xa0000 0xf40000>; - label = "firmware"; - }; + partition@20000 { + reg = <0x20000 0x80000>; + label = "dsl_fw"; + }; - partition@fe0000 { - reg = <0xfe0000 0x10000>; - label = "sysconfig"; - read-only; - }; + partition@de0000 { + reg = <0xa0000 0xf40000>; + label = "firmware"; + }; - partition@ff0000 { - reg = <0xff0000 0x2000>; - label = "ubootconfig"; - }; + partition@fe0000 { + reg = <0xfe0000 0x10000>; + label = "sysconfig"; + read-only; + }; - partition@ff3000 { - reg = <0xff3000 0x2000>; - label = "board_config"; - read-only; + partition@ff0000 { + reg = <0xff0000 0x2000>; + label = "ubootconfig"; + }; + + partition@ff3000 { + reg = <0xff3000 0x2000>; + label = "board_config"; + read-only; + }; }; }; }; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/amazonse.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/amazonse.dtsi similarity index 93% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/amazonse.dtsi rename to target/linux/lantiq/files/arch/mips/boot/dts/amazonse.dtsi index f216adf36..feb4cd529 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/amazonse.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/amazonse.dtsi @@ -14,13 +14,21 @@ }; cpus { + #address-cells = <1>; + #size-cells = <0>; + cpu@0 { compatible = "mips,mips4Kc"; + reg = <0>; }; }; - memory@0 { - device_type = "memory"; + reboot { + compatible = "syscon-reboot"; + + regmap = <&rcu0>; + offset = <0x10>; + mask = <0x40000000>; }; biu@1f800000 { @@ -75,6 +83,8 @@ }; rcu0: rcu@203000 { + #address-cells = <1>; + #size-cells = <1>; compatible = "lantiq,ase-rcu", "simple-mfd", "syscon"; reg = <0x203000 0x1000>; ranges = <0x0 0x203000 0x100>; @@ -96,15 +106,6 @@ reset-names = "ctrl"; #phy-cells = <0>; }; - - reboot@10 { - compatible = "syscon-reboot"; - reg = <0x10 4>; - - regmap = <&rcu0>; - offset = <0x10>; - mask = <0x40000000>; - }; }; }; @@ -131,7 +132,7 @@ interrupt-names = "spi_rx", "spi_tx", "spi_err", "spi_frm"; #address-cells = <1>; - #size-cells = <1>; + #size-cells = <0>; status = "disabled"; }; @@ -158,6 +159,7 @@ mei@e116000 { compatible = "lantiq,mei-xway"; + reg = <0xe116000 0x400>; interrupt-parent = <&icu0>; interrupts = <81>; }; @@ -186,6 +188,7 @@ ppe@e234000 { compatible = "lantiq,ppe-ase"; + reg = <0xe234000 0x40000>; interrupt-parent = <&icu0>; interrupts = <85>; }; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ar9.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/ar9.dtsi similarity index 95% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/ar9.dtsi rename to target/linux/lantiq/files/arch/mips/boot/dts/ar9.dtsi index 48e0d95d6..37b44aecd 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/ar9.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/ar9.dtsi @@ -14,13 +14,21 @@ }; cpus { + #address-cells = <1>; + #size-cells = <0>; + cpu@0 { compatible = "mips,mips34K"; + reg = <0>; }; }; - memory@0 { - device_type = "memory"; + reboot { + compatible = "syscon-reboot"; + + regmap = <&rcu0>; + offset = <0x10>; + mask = <0x40000000>; }; biu@1f800000 { @@ -77,6 +85,8 @@ }; rcu0: rcu@203000 { + #address-cells = <1>; + #size-cells = <1>; compatible = "lantiq,xrx100-rcu", "simple-mfd", "syscon"; reg = <0x203000 0x1000>; ranges = <0x0 0x203000 0x100>; @@ -108,15 +118,6 @@ reset-names = "ctrl"; #phy-cells = <0>; }; - - reboot@10 { - compatible = "syscon-reboot"; - reg = <0x10 4>; - - regmap = <&rcu0>; - offset = <0x10>; - mask = <0x40000000>; - }; }; }; @@ -158,7 +159,7 @@ interrupt-names = "spi_rx", "spi_tx", "spi_err", "spi_frm"; #address-cells = <1>; - #size-cells = <1>; + #size-cells = <0>; status = "disabled"; }; @@ -225,6 +226,7 @@ mei@e116000 { compatible = "lantiq,mei-xway"; + reg = <0xe116000 0x9c>; interrupt-parent = <&icu0>; interrupts = <63>; }; @@ -240,6 +242,7 @@ ppe@e234000 { compatible = "lantiq,ppe-arx100"; + reg = <0xe234000 0x3ffd>; interrupt-parent = <&icu0>; interrupts = <96>; }; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/danube.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/danube.dtsi similarity index 92% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/danube.dtsi rename to target/linux/lantiq/files/arch/mips/boot/dts/danube.dtsi index af4c795af..cadfb8075 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/danube.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/danube.dtsi @@ -14,13 +14,21 @@ }; cpus { + #address-cells = <1>; + #size-cells = <0>; + cpu@0 { compatible = "mips,mips24Kc"; + reg = <0>; }; }; - memory@0 { - device_type = "memory"; + reboot { + compatible = "syscon-reboot"; + + regmap = <&rcu0>; + offset = <0x10>; + mask = <0x40000000>; }; biu@1f800000 { @@ -77,12 +85,14 @@ vmmc: vmmc@107000 { status = "disabled"; compatible = "lantiq,vmmc-xway"; - reg = <0x103000 0x400>; + reg = <0x107000 0x400>; interrupt-parent = <&icu0>; interrupts = <150 151 152 153 154 155>; }; rcu0: rcu@203000 { + #address-cells = <1>; + #size-cells = <1>; compatible = "lantiq,danube-rcu", "simple-mfd", "syscon"; reg = <0x203000 0x1000>; ranges = <0x0 0x203000 0x100>; @@ -104,15 +114,6 @@ reset-names = "ctrl"; #phy-cells = <0>; }; - - reboot@10 { - compatible = "syscon-reboot"; - reg = <0x10 4>; - - regmap = <&rcu0>; - offset = <0x10>; - mask = <0x40000000>; - }; }; }; @@ -129,16 +130,6 @@ ranges = <0 0 0x0 0x3ffffff /* addrsel0 */ 1 0 0x4000000 0x4000010>; /* addsel1 */ compatible = "lantiq,localbus", "simple-bus"; - - gpiomm: gpiomm@1 { - compatible = "lantiq,gpio-mm"; - reg = <1 0x0 0x10 >; - #address-cells = <1>; - #size-cells = <1>; - #gpio-cells = <2>; - gpio-controller; - status = "disabled"; - }; }; gptu@e100a00 { @@ -209,6 +200,7 @@ mei@e116000 { compatible = "lantiq,mei-xway"; + reg = <0xe116000 0x400>; interrupt-parent = <&icu0>; interrupts = <63>; }; @@ -223,6 +215,7 @@ ppe@e234000 { compatible = "lantiq,ppe-danube"; + reg = <0xe234000 0x40000>; interrupt-parent = <&icu0>; interrupts = <96>; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/falcon-sflash-16M.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/falcon-sflash-16M.dtsi new file mode 100644 index 000000000..b35f70b64 --- /dev/null +++ b/target/linux/lantiq/files/arch/mips/boot/dts/falcon-sflash-16M.dtsi @@ -0,0 +1,41 @@ + +&ebu_cs0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "lantiq,sflash-falcon", "simple-bus"; + + flash@0 { + compatible = "spansion,s25fl129p0", "spansion,s25fl129p1"; + reg = <0 0>; + linux,mtd-name = "sflash"; + spi-max-frequency = <80000000>; + m25p,fast-read; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x0 0x40000>; + label = "uboot"; + read-only; + }; + + partition@40000 { + reg = <0x40000 0x80000>; + label = "uboot_env"; + }; + + partition@c0000 { + reg = <0xc0000 0x740000>; + label = "image0"; + }; + + partition@800000 { + reg = <0x800000 0x800000>; + label = "image1"; + }; + }; + }; +}; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/falcon.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/falcon.dtsi similarity index 82% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/falcon.dtsi rename to target/linux/lantiq/files/arch/mips/boot/dts/falcon.dtsi index 98f71819a..dada3bcff 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/falcon.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/falcon.dtsi @@ -4,8 +4,12 @@ compatible = "lantiq,falcon"; cpus { + #address-cells = <1>; + #size-cells = <0>; + cpu@0 { compatible = "mips,mips34kc"; + reg = <0>; }; }; @@ -23,31 +27,6 @@ stdout-path = "serial0:115200n8"; }; - clocks { - compatible = "simple-bus"; - - cpu_clk: cpu { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <400000000>; - clock-output-names = "cpu"; - }; - - io_clk: io { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <200000000>; - clock-output-names = "io"; - }; - - fpi_clk: fpi { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <100000000>; - clock-output-names = "fpi"; - }; - }; - ebu_cs0: localbus@10000000 { #address-cells = <1>; #size-cells = <1>; @@ -68,12 +47,12 @@ reg = <0x18000000 0x100>; }; - sbs2@1D000000 { + sbs2@1d000000 { #address-cells = <1>; #size-cells = <1>; compatible = "lantiq,sysb2", "simple-bus"; - reg = <0x1D000000 0x1000000>; - ranges = <0x0 0x1D000000 0x1000000>; + reg = <0x1d000000 0x1000000>; + ranges = <0x0 0x1d000000 0x1000000>; clock_sysgpe: clock-controller@700000 { compatible = "lantiq,sysgpe-falcon"; @@ -113,38 +92,38 @@ clocks = <&clock_syseth 17>; }; - clock_syseth: clock-controller@B00000 { + clock_syseth: clock-controller@b00000 { compatible = "lantiq,syseth-falcon"; - reg = <0xB00000 0x100>; + reg = <0xb00000 0x100>; #clock-cells = <1>; }; - pad@B01000 { + pad@b01000 { compatible = "lantiq,pad-falcon"; - reg = <0xB01000 0x100>; + reg = <0xb01000 0x100>; lantiq,bank = <0>; clocks = <&clock_syseth 20>; }; - pad@B02000 { + pad@b02000 { compatible = "lantiq,pad-falcon"; - reg = <0xB02000 0x100>; + reg = <0xb02000 0x100>; lantiq,bank = <2>; clocks = <&clock_syseth 21>; }; }; - fpi@1E000000 { + fpi@1e000000 { #address-cells = <1>; #size-cells = <1>; compatible = "lantiq,fpi", "simple-bus"; - reg = <0x1E000000 0x1000000>; - ranges = <0x0 0x1E000000 0x1000000>; + reg = <0x1e000000 0x1000000>; + ranges = <0x0 0x1e000000 0x1000000>; - serial1: serial@100B00 { + serial1: serial@100b00 { status = "disabled"; compatible = "lantiq,asc"; - reg = <0x100B00 0x100>; + reg = <0x100b00 0x100>; interrupt-parent = <&icu0>; interrupts = <112 113 114>; line = <1>; @@ -153,9 +132,9 @@ clocks = <&clock_sys1 11>; }; - serial0: serial@100C00 { + serial0: serial@100c00 { compatible = "lantiq,asc"; - reg = <0x100C00 0x100>; + reg = <0x100c00 0x100>; interrupt-parent = <&icu0>; interrupts = <104 105 106>; line = <0>; @@ -164,23 +143,23 @@ clocks = <&clock_sys1 12>; }; - spi: spi@100D00 { + spi: spi@100d00 { status = "disabled"; compatible = "lantiq,falcon-spi", "lantiq,xrx100-spi", "lantiq,spi-lantiq-ssc"; interrupts = <22 23 24 25>; interrupt-names = "spi_tx", "spi_rx", "spi_err", "spi_frm"; #address-cells = <1>; #size-cells = <0>; - reg = <0x100D00 0x100>; + reg = <0x100d00 0x100>; interrupt-parent = <&icu0>; clocks = <&clock_sys1 13>; base_cs = <1>; num_cs = <2>; }; - gptc@100E00 { + gptc@100e00 { compatible = "lantiq,gptc-falcon"; - reg = <0x100E00 0x100>; + reg = <0x100e00 0x100>; }; i2c: i2c@200000 { @@ -259,35 +238,31 @@ reg = <0x802000 0x80>; }; - clock_sys1: clock-controller@F00000 { + clock_sys1: clock-controller@f00000 { compatible = "lantiq,sys1-falcon"; - reg = <0xF00000 0x100>; + reg = <0xf00000 0x100>; #clock-cells = <1>; }; }; - sbs0@1F000000 { + sbs0@1f000000 { #address-cells = <1>; #size-cells = <1>; compatible = "simple-bus"; - reg = <0x1F000000 0x400000>; - ranges = <0x0 0x1F000000 0x400000>; + reg = <0x1f000000 0x400000>; + ranges = <0x0 0x1f000000 0x400000>; mpsmbx: mpsmbx@200000 { reg = <0x200000 0x200>; }; }; - sbs1@1F700000 { - - }; - - biu@1F800000 { + biu@1f800000 { #address-cells = <1>; #size-cells = <1>; compatible = "lantiq,biu", "simple-bus"; - reg = <0x1F800000 0x800000>; - ranges = <0x0 0x1F800000 0x800000>; + reg = <0x1f800000 0x800000>; + ranges = <0x0 0x1f800000 0x800000>; icu0: icu@80200 { #interrupt-cells = <1>; @@ -300,10 +275,9 @@ 0x802a0 0x28>; }; - watchdog@803F0 { + watchdog@803f0 { compatible = "lantiq,wdt"; - reg = <0x803F0 0x10>; - clocks = <&io_clk>; /* currently no effect */ + reg = <0x803f0 0x10>; }; }; @@ -335,8 +309,8 @@ lantiq,function = "asc"; }; }; - i2c_pins: i2c { - i2c { + i2c_pins: i2c_pins { + i2c_pins { lantiq,groups = "i2c"; lantiq,function = "i2c"; }; diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/vr9.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/vr9.dtsi similarity index 93% rename from target/linux/lantiq/files-4.14/arch/mips/boot/dts/vr9.dtsi rename to target/linux/lantiq/files/arch/mips/boot/dts/vr9.dtsi index 1bc1d608b..e8b87dbcc 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/vr9.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/vr9.dtsi @@ -14,17 +14,25 @@ }; cpus { + #address-cells = <1>; + #size-cells = <0>; + cpu@0 { compatible = "mips,mips34Kc"; + reg = <0>; }; }; - memory@0 { - device_type = "memory"; + cputemp { + compatible = "lantiq,cputemp"; }; - cputemp@0 { - compatible = "lantiq,cputemp"; + reboot { + compatible = "syscon-reboot"; + + regmap = <&rcu0>; + offset = <0x10>; + mask = <0xe0000000>; }; biu@1f800000 { @@ -84,15 +92,17 @@ reg = <0x106a00 0x200>; }; - vmmc: vmmc@103000 { + vmmc: vmmc@107000 { status = "disabled"; compatible = "lantiq,vmmc-xway"; - reg = <0x103000 0x400>; + reg = <0x107000 0x300>; interrupt-parent = <&icu0>; interrupts = <150 151 152 153 154 155>; }; rcu0: rcu@203000 { + #address-cells = <1>; + #size-cells = <1>; compatible = "lantiq,xrx200-rcu", "simple-mfd", "syscon"; reg = <0x203000 0x100>; ranges = <0x0 0x203000 0x100>; @@ -143,19 +153,10 @@ reg = <0x34 4>, <0x3c 4>; status = "disabled"; - resets = <&reset1 5 4>, <&reset0 4 4>; + resets = <&reset1 5 5>, <&reset0 4 4>; reset-names = "phy", "ctrl"; #phy-cells = <0>; }; - - reboot@10 { - compatible = "syscon-reboot"; - reg = <0x10 4>; - - regmap = <&rcu0>; - offset = <0x10>; - mask = <0xe0000000>; - }; }; }; @@ -200,7 +201,7 @@ interrupt-names = "spi_rx", "spi_tx", "spi_err", "spi_frm"; #address-cells = <1>; - #size-cells = <1>; + #size-cells = <0>; status = "disabled"; }; @@ -295,8 +296,11 @@ ppe@e234000 { compatible = "lantiq,ppe-xrx200"; + reg = <0xe234000 0x3ffd>; interrupt-parent = <&icu0>; interrupts = <96>; + resets = <&reset0 3 3>, <&reset0 11 11>, <&reset0 23 23>; + reset-names = "dsp", "dfe", "tc"; }; pcie0: pcie@d900000 { @@ -306,6 +310,8 @@ #size-cells = <2>; #address-cells = <3>; + reg = <0xd900000 0x1000>; + interrupt-parent = <&icu0>; interrupts = <161 144>; diff --git a/target/linux/lantiq/image/Makefile b/target/linux/lantiq/image/Makefile index e9d9e4202..2352cb6b5 100644 --- a/target/linux/lantiq/image/Makefile +++ b/target/linux/lantiq/image/Makefile @@ -489,8 +489,8 @@ define Device/avm_fritz7312 $(Device/AVM) DEVICE_DTS := FRITZ7312 IMAGE_SIZE := 15744k - DEVICE_TITLE := 1&1 WLAN-MODEM - FRITZ7312 - DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-mini \ + DEVICE_TITLE := AVM FRITZ!Box 7312 + DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic \ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoa \ @@ -502,7 +502,7 @@ define Device/avm_fritz7320 $(Device/AVM) DEVICE_DTS := FRITZ7320 IMAGE_SIZE := 15744k - DEVICE_TITLE := 1&1 HomeServer - FRITZ7320 + DEVICE_TITLE := AVM FRITZ!Box 7320 DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic \ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \ @@ -553,6 +553,7 @@ define Device/zyxel_p-2812hnu-f1 DEVICE_DTS := P2812HNUF1 DEVICE_TITLE := ZyXEL P-2812HNU-F1 DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic kmod-usb-dwc2 kmod-usb-ledtrig-usbport + KERNEL_SIZE := 3072k SUPPORTED_DEVICES += P2812HNUF1 endef TARGET_DEVICES += zyxel_p-2812hnu-f1 @@ -631,7 +632,7 @@ define Device/avm_fritz3370 $(Device/AVM) $(Device/NAND) DEVICE_DTS := FRITZ3370 - DEVICE_TITLE := AVM Fritz!Box WLan 3370 Rev. 2 + DEVICE_TITLE := AVM FRITZ!Box 3370 Rev. 2 KERNEL_SIZE := 4096k UBINIZE_OPTS := -E 5 IMAGES += eva-kernel.bin eva-filesystem.bin @@ -643,14 +644,14 @@ endef define Device/avm_fritz3370-rev2-hynix $(Device/avm_fritz3370) DEVICE_DTS := FRITZ3370-REV2-HYNIX - DEVICE_TITLE := AVM Fritz!Box WLan 3370 Rev. 2 (Hynix NAND) + DEVICE_TITLE := AVM FRITZ!Box 3370 Rev. 2 (Hynix NAND) endef TARGET_DEVICES += avm_fritz3370-rev2-hynix define Device/avm_fritz3370-rev2-micron $(Device/avm_fritz3370) DEVICE_DTS := FRITZ3370-REV2-MICRON - DEVICE_TITLE := AVM Fritz!Box WLan 3370 Rev. 2 (Micron NAND) + DEVICE_TITLE := AVM FRITZ!Box 3370 Rev. 2 (Micron NAND) endef TARGET_DEVICES += avm_fritz3370-rev2-micron @@ -658,12 +659,35 @@ define Device/avm_fritz7360sl $(Device/AVM) IMAGE_SIZE := 15744k DEVICE_DTS := FRITZ7360SL - DEVICE_TITLE := 1&1 HomeServer - FRITZ7360SL + DEVICE_TITLE := AVM FRITZ!Box 7360 SL DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic kmod-usb-dwc2 SUPPORTED_DEVICES += FRITZ7360SL endef TARGET_DEVICES += avm_fritz7360sl +define Device/avm_fritz7412 + $(Device/AVM) + $(Device/NAND) + BOARD_NAME := FRITZ7412 + DEVICE_DTS := FRITZ7412 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 49152k + DEVICE_TITLE := AVM FRITZ!Box 7412 + DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic kmod-ltq-tapi kmod-ltq-vmmc fritz-tffs-nand fritz-caldata +endef +TARGET_DEVICES += avm_fritz7412 + +define Device/avm_fritz7362sl + $(Device/AVM) + $(Device/NAND) + KERNEL_SIZE := 4096k + IMAGE_SIZE := 49152k + DEVICE_DTS := FRITZ7362SL + DEVICE_TITLE := AVM FRITZ!Box 7362 SL + DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic kmod-usb-dwc2 fritz-tffs +endef +TARGET_DEVICES += avm_fritz7362sl + define Device/arcadyan_vg3503j IMAGE_SIZE := 8000k DEVICE_DTS := VG3503J diff --git a/target/linux/lantiq/patches-4.14/0002-gpio-stp-xway-Implement-get-callback.patch b/target/linux/lantiq/patches-4.14/0002-gpio-stp-xway-Implement-get-callback.patch deleted file mode 100644 index c32b3d6bb..000000000 --- a/target/linux/lantiq/patches-4.14/0002-gpio-stp-xway-Implement-get-callback.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 5b9b2b5284f81941972105b13337c58489ea8fca Mon Sep 17 00:00:00 2001 -From: Mathias Kresin -Date: Thu, 28 Jun 2018 21:57:40 +0200 -Subject: [PATCH] gpio: stp-xway: Implement get callback - -Add an implementation to get the current GPIO state. - -The callback is used by the leds-gpio driver for example, in case the -current LED/GPIO state should be kept during driver load. - -Signed-off-by: Mathias Kresin -Signed-off-by: Linus Walleij ---- - drivers/gpio/gpio-stp-xway.c | 15 +++++++++++++++ - 1 file changed, 15 insertions(+) - ---- a/drivers/gpio/gpio-stp-xway.c -+++ b/drivers/gpio/gpio-stp-xway.c -@@ -91,6 +91,20 @@ struct xway_stp { - }; - - /** -+ * xway_stp_get() - gpio_chip->get - get gpios. -+ * @gc: Pointer to gpio_chip device structure. -+ * @gpio: GPIO signal number. -+ * -+ * Gets the shadow value. -+ */ -+static int xway_stp_get(struct gpio_chip *gc, unsigned int gpio) -+{ -+ struct xway_stp *chip = gpiochip_get_data(gc); -+ -+ return (xway_stp_r32(chip->virt, XWAY_STP_CPU0) & BIT(gpio)); -+} -+ -+/** - * xway_stp_set() - gpio_chip->set - set gpios. - * @gc: Pointer to gpio_chip device structure. - * @gpio: GPIO signal number. -@@ -215,6 +229,7 @@ static int xway_stp_probe(struct platfor - chip->gc.parent = &pdev->dev; - chip->gc.label = "stp-xway"; - chip->gc.direction_output = xway_stp_dir_out; -+ chip->gc.get = xway_stp_get; - chip->gc.set = xway_stp_set; - chip->gc.request = xway_stp_request; - chip->gc.base = -1; diff --git a/target/linux/lantiq/patches-4.14/0027-01-net-phy-intel-xway-add-VR9-version-number.patch b/target/linux/lantiq/patches-4.14/0027-01-net-phy-intel-xway-add-VR9-version-number.patch deleted file mode 100644 index b02b3fbd2..000000000 --- a/target/linux/lantiq/patches-4.14/0027-01-net-phy-intel-xway-add-VR9-version-number.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 5b73d9955fb4b0e3c37f8f6c71910293246c89dc Mon Sep 17 00:00:00 2001 -From: Mathias Kresin -Date: Thu, 22 Mar 2018 23:31:38 +0100 -Subject: [PATCH 1/2] net: phy: intel-xway: add VR9 version number - -The VR9 phy ids are matching only for the SoC version 1.2. Rename the -macros and change the names to take this into account. - -Signed-off-by: Mathias Kresin -Signed-off-by: David S. Miller ---- - drivers/net/phy/intel-xway.c | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) - ---- a/drivers/net/phy/intel-xway.c -+++ b/drivers/net/phy/intel-xway.c -@@ -149,8 +149,8 @@ - #define PHY_ID_PHY22F_1_4 0xD565A410 - #define PHY_ID_PHY11G_1_5 0xD565A401 - #define PHY_ID_PHY22F_1_5 0xD565A411 --#define PHY_ID_PHY11G_VR9 0xD565A409 --#define PHY_ID_PHY22F_VR9 0xD565A419 -+#define PHY_ID_PHY11G_VR9_1_2 0xD565A409 -+#define PHY_ID_PHY22F_VR9_1_2 0xD565A419 - - #if IS_ENABLED(CONFIG_OF_MDIO) - static int vr9_gphy_of_reg_init(struct phy_device *phydev) -@@ -366,9 +366,9 @@ static struct phy_driver xway_gphy[] = { - .suspend = genphy_suspend, - .resume = genphy_resume, - }, { -- .phy_id = PHY_ID_PHY11G_VR9, -+ .phy_id = PHY_ID_PHY11G_VR9_1_2, - .phy_id_mask = 0xffffffff, -- .name = "Intel XWAY PHY11G (xRX integrated)", -+ .name = "Intel XWAY PHY11G (xRX v1.2 integrated)", - .features = PHY_GBIT_FEATURES, - .flags = PHY_HAS_INTERRUPT, - .config_init = xway_gphy_config_init, -@@ -380,9 +380,9 @@ static struct phy_driver xway_gphy[] = { - .suspend = genphy_suspend, - .resume = genphy_resume, - }, { -- .phy_id = PHY_ID_PHY22F_VR9, -+ .phy_id = PHY_ID_PHY22F_VR9_1_2, - .phy_id_mask = 0xffffffff, -- .name = "Intel XWAY PHY22F (xRX integrated)", -+ .name = "Intel XWAY PHY22F (xRX v1.2 integrated)", - .features = PHY_BASIC_FEATURES, - .flags = PHY_HAS_INTERRUPT, - .config_init = xway_gphy_config_init, -@@ -404,8 +404,8 @@ static struct mdio_device_id __maybe_unu - { PHY_ID_PHY22F_1_4, 0xffffffff }, - { PHY_ID_PHY11G_1_5, 0xffffffff }, - { PHY_ID_PHY22F_1_5, 0xffffffff }, -- { PHY_ID_PHY11G_VR9, 0xffffffff }, -- { PHY_ID_PHY22F_VR9, 0xffffffff }, -+ { PHY_ID_PHY11G_VR9_1_2, 0xffffffff }, -+ { PHY_ID_PHY22F_VR9_1_2, 0xffffffff }, - { } - }; - MODULE_DEVICE_TABLE(mdio, xway_gphy_tbl); diff --git a/target/linux/lantiq/patches-4.14/0027-02-net-phy-intel-xway-add-VR9-v1.1-phy-ids.patch b/target/linux/lantiq/patches-4.14/0027-02-net-phy-intel-xway-add-VR9-v1.1-phy-ids.patch deleted file mode 100644 index c9229b3ae..000000000 --- a/target/linux/lantiq/patches-4.14/0027-02-net-phy-intel-xway-add-VR9-v1.1-phy-ids.patch +++ /dev/null @@ -1,69 +0,0 @@ -From f452518c982e57538e6d49da0a2c80eef22087ab Mon Sep 17 00:00:00 2001 -From: Mathias Kresin -Date: Thu, 22 Mar 2018 23:31:39 +0100 -Subject: [PATCH 2/2] net: phy: intel-xway: add VR9 v1.1 phy ids - -The phys embedded into the v1.1 of the VR9 SoC are using different phy -ids. Add the phy ids to use the driver for this VR9 version as well. - -Signed-off-by: Mathias Kresin -Signed-off-by: David S. Miller ---- - drivers/net/phy/intel-xway.c | 28 ++++++++++++++++++++++++++++ - 1 file changed, 28 insertions(+) - ---- a/drivers/net/phy/intel-xway.c -+++ b/drivers/net/phy/intel-xway.c -@@ -149,6 +149,8 @@ - #define PHY_ID_PHY22F_1_4 0xD565A410 - #define PHY_ID_PHY11G_1_5 0xD565A401 - #define PHY_ID_PHY22F_1_5 0xD565A411 -+#define PHY_ID_PHY11G_VR9_1_1 0xD565A408 -+#define PHY_ID_PHY22F_VR9_1_1 0xD565A418 - #define PHY_ID_PHY11G_VR9_1_2 0xD565A409 - #define PHY_ID_PHY22F_VR9_1_2 0xD565A419 - -@@ -366,6 +368,34 @@ static struct phy_driver xway_gphy[] = { - .suspend = genphy_suspend, - .resume = genphy_resume, - }, { -+ .phy_id = PHY_ID_PHY11G_VR9_1_1, -+ .phy_id_mask = 0xffffffff, -+ .name = "Intel XWAY PHY11G (xRX v1.1 integrated)", -+ .features = PHY_GBIT_FEATURES, -+ .flags = PHY_HAS_INTERRUPT, -+ .config_init = xway_gphy_config_init, -+ .config_aneg = genphy_config_aneg, -+ .read_status = genphy_read_status, -+ .ack_interrupt = xway_gphy_ack_interrupt, -+ .did_interrupt = xway_gphy_did_interrupt, -+ .config_intr = xway_gphy_config_intr, -+ .suspend = genphy_suspend, -+ .resume = genphy_resume, -+ }, { -+ .phy_id = PHY_ID_PHY22F_VR9_1_1, -+ .phy_id_mask = 0xffffffff, -+ .name = "Intel XWAY PHY22F (xRX v1.1 integrated)", -+ .features = PHY_BASIC_FEATURES, -+ .flags = PHY_HAS_INTERRUPT, -+ .config_init = xway_gphy_config_init, -+ .config_aneg = genphy_config_aneg, -+ .read_status = genphy_read_status, -+ .ack_interrupt = xway_gphy_ack_interrupt, -+ .did_interrupt = xway_gphy_did_interrupt, -+ .config_intr = xway_gphy_config_intr, -+ .suspend = genphy_suspend, -+ .resume = genphy_resume, -+ }, { - .phy_id = PHY_ID_PHY11G_VR9_1_2, - .phy_id_mask = 0xffffffff, - .name = "Intel XWAY PHY11G (xRX v1.2 integrated)", -@@ -404,6 +434,8 @@ static struct mdio_device_id __maybe_unu - { PHY_ID_PHY22F_1_4, 0xffffffff }, - { PHY_ID_PHY11G_1_5, 0xffffffff }, - { PHY_ID_PHY22F_1_5, 0xffffffff }, -+ { PHY_ID_PHY11G_VR9_1_1, 0xffffffff }, -+ { PHY_ID_PHY22F_VR9_1_1, 0xffffffff }, - { PHY_ID_PHY11G_VR9_1_2, 0xffffffff }, - { PHY_ID_PHY22F_VR9_1_2, 0xffffffff }, - { } diff --git a/target/linux/lantiq/patches-4.14/0001-MIPS-lantiq-add-pcie-driver.patch b/target/linux/lantiq/patches-4.19/0001-MIPS-lantiq-add-pcie-driver.patch similarity index 99% rename from target/linux/lantiq/patches-4.14/0001-MIPS-lantiq-add-pcie-driver.patch rename to target/linux/lantiq/patches-4.19/0001-MIPS-lantiq-add-pcie-driver.patch index 9564577a0..4cea5547c 100644 --- a/target/linux/lantiq/patches-4.14/0001-MIPS-lantiq-add-pcie-driver.patch +++ b/target/linux/lantiq/patches-4.19/0001-MIPS-lantiq-add-pcie-driver.patch @@ -4143,7 +4143,7 @@ Signed-off-by: John Crispin + --- a/arch/mips/pci/pci-legacy.c +++ b/arch/mips/pci/pci-legacy.c -@@ -313,3 +313,30 @@ char *__init pcibios_setup(char *str) +@@ -311,3 +311,30 @@ char *__init pcibios_setup(char *str) return pcibios_plat_setup(str); return str; } @@ -5482,9 +5482,9 @@ Signed-off-by: John Crispin + +#endif /* IFXMIPS_PCIE_VR9_H */ + ---- a/drivers/pci/pcie/aer/Kconfig -+++ b/drivers/pci/pcie/aer/Kconfig -@@ -19,6 +19,7 @@ config PCIEAER +--- a/drivers/pci/pcie/Kconfig ++++ b/drivers/pci/pcie/Kconfig +@@ -54,6 +54,7 @@ config PCIEAER_INJECT config PCIE_ECRC bool "PCI Express ECRC settings control" depends on PCIEAER @@ -5494,7 +5494,7 @@ Signed-off-by: John Crispin (transaction layer end-to-end CRC checking). --- a/include/linux/pci.h +++ b/include/linux/pci.h -@@ -1304,6 +1304,8 @@ void pci_walk_bus(struct pci_bus *top, i +@@ -1325,6 +1325,8 @@ void pci_walk_bus(struct pci_bus *top, i void *userdata); int pci_cfg_space_size(struct pci_dev *dev); unsigned char pci_bus_max_busnr(struct pci_bus *bus); @@ -5505,7 +5505,7 @@ Signed-off-by: John Crispin unsigned long type); --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h -@@ -1061,6 +1061,12 @@ +@@ -1065,6 +1065,12 @@ #define PCI_DEVICE_ID_SGI_LITHIUM 0x1002 #define PCI_DEVICE_ID_SGI_IOC4 0x100a diff --git a/target/linux/lantiq/patches-4.19/0003-usb-dwc2-use-a-longer-core-rest-timeout-in-dwc2_core.patch b/target/linux/lantiq/patches-4.19/0003-usb-dwc2-use-a-longer-core-rest-timeout-in-dwc2_core.patch new file mode 100644 index 000000000..dde7b3f23 --- /dev/null +++ b/target/linux/lantiq/patches-4.19/0003-usb-dwc2-use-a-longer-core-rest-timeout-in-dwc2_core.patch @@ -0,0 +1,29 @@ +From 09bbf8c732e7a6ce290fc7c2d5a3e79ec6c3e8d2 Mon Sep 17 00:00:00 2001 +From: Mathias Kresin +Date: Wed, 3 Jul 2019 17:03:02 +0200 +Subject: [PATCH] usb: dwc2: use a longer core rest timeout in + dwc2_core_reset() + +Testing on different generations of Lantiq MIPS SoC based boards, showed +that it takes up to 1500 us until the core reset bit is cleared. + +The driver from the vendor SDK (ifxhcd) uses a 1 second timeout. Use the +same timeout to fix wrong hang detections and make the driver work for +Lantiq MIPS SoCs. + +Signed-off-by: Mathias Kresin +--- + drivers/usb/dwc2/core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/dwc2/core.c ++++ b/drivers/usb/dwc2/core.c +@@ -524,7 +524,7 @@ int dwc2_core_reset(struct dwc2_hsotg *h + greset |= GRSTCTL_CSFTRST; + dwc2_writel(hsotg, greset, GRSTCTL); + +- if (dwc2_hsotg_wait_bit_clear(hsotg, GRSTCTL, GRSTCTL_CSFTRST, 50)) { ++ if (dwc2_hsotg_wait_bit_clear(hsotg, GRSTCTL, GRSTCTL_CSFTRST, 10000)) { + dev_warn(hsotg->dev, "%s: HANG! Soft Reset timeout GRSTCTL GRSTCTL_CSFTRST\n", + __func__); + return -EBUSY; diff --git a/target/linux/lantiq/patches-4.14/0004-MIPS-lantiq-add-atm-hack.patch b/target/linux/lantiq/patches-4.19/0004-MIPS-lantiq-add-atm-hack.patch similarity index 99% rename from target/linux/lantiq/patches-4.14/0004-MIPS-lantiq-add-atm-hack.patch rename to target/linux/lantiq/patches-4.19/0004-MIPS-lantiq-add-atm-hack.patch index 66ca2fd5a..b74642af1 100644 --- a/target/linux/lantiq/patches-4.14/0004-MIPS-lantiq-add-atm-hack.patch +++ b/target/linux/lantiq/patches-4.19/0004-MIPS-lantiq-add-atm-hack.patch @@ -448,7 +448,7 @@ Signed-off-by: John Crispin +EXPORT_SYMBOL(_dma_cache_wback); +EXPORT_SYMBOL(_dma_cache_inv); - #endif /* CONFIG_DMA_NONCOHERENT || CONFIG_DMA_MAYBE_COHERENT */ + #endif /* CONFIG_DMA_NONCOHERENT */ --- a/include/uapi/linux/atm.h +++ b/include/uapi/linux/atm.h @@ -469,7 +469,7 @@ Signed-off-by: John Crispin int max_pcr; /* maximum PCR in cells per second */ --- a/net/atm/proc.c +++ b/net/atm/proc.c -@@ -155,7 +155,7 @@ static void *vcc_seq_next(struct seq_fil +@@ -141,7 +141,7 @@ static void *vcc_seq_next(struct seq_fil static void pvc_info(struct seq_file *seq, struct atm_vcc *vcc) { static const char *const class_name[] = { diff --git a/target/linux/lantiq/patches-4.19/0005-lantiq_etop-pass-struct-device-to-DMA-API-functions.patch b/target/linux/lantiq/patches-4.19/0005-lantiq_etop-pass-struct-device-to-DMA-API-functions.patch new file mode 100644 index 000000000..ccde787d2 --- /dev/null +++ b/target/linux/lantiq/patches-4.19/0005-lantiq_etop-pass-struct-device-to-DMA-API-functions.patch @@ -0,0 +1,43 @@ +From 74e0deb89a8ba27c132b1f0e08643e215b5c1f92 Mon Sep 17 00:00:00 2001 +From: Christoph Hellwig +Date: Mon, 11 Feb 2019 14:20:00 +0100 +Subject: [PATCH] lantiq_etop: pass struct device to DMA API functions + +The DMA API generally relies on a struct device to work properly, and +only barely works without one for legacy reasons. Pass the easily +available struct device from the platform_device to remedy this. + +Note this driver seems to lack dma_unmap_* calls entirely, but fixing +that is left for another time. + +Signed-off-by: Christoph Hellwig +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/lantiq_etop.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/lantiq_etop.c ++++ b/drivers/net/ethernet/lantiq_etop.c +@@ -112,10 +112,12 @@ struct ltq_etop_priv { + static int + ltq_etop_alloc_skb(struct ltq_etop_chan *ch) + { ++ struct ltq_etop_priv *priv = netdev_priv(ch->netdev); ++ + ch->skb[ch->dma.desc] = netdev_alloc_skb(ch->netdev, MAX_DMA_DATA_LEN); + if (!ch->skb[ch->dma.desc]) + return -ENOMEM; +- ch->dma.desc_base[ch->dma.desc].addr = dma_map_single(NULL, ++ ch->dma.desc_base[ch->dma.desc].addr = dma_map_single(&priv->pdev->dev, + ch->skb[ch->dma.desc]->data, MAX_DMA_DATA_LEN, + DMA_FROM_DEVICE); + ch->dma.desc_base[ch->dma.desc].addr = +@@ -493,7 +495,7 @@ ltq_etop_tx(struct sk_buff *skb, struct + netif_trans_update(dev); + + spin_lock_irqsave(&priv->lock, flags); +- desc->addr = ((unsigned int) dma_map_single(NULL, skb->data, len, ++ desc->addr = ((unsigned int) dma_map_single(&priv->pdev->dev, skb->data, len, + DMA_TO_DEVICE)) - byte_offset; + wmb(); + desc->ctl = LTQ_DMA_OWN | LTQ_DMA_SOP | LTQ_DMA_EOP | diff --git a/target/linux/lantiq/patches-4.19/0006-MIPS-lantiq-pass-struct-device-to-DMA-API-functions.patch b/target/linux/lantiq/patches-4.19/0006-MIPS-lantiq-pass-struct-device-to-DMA-API-functions.patch new file mode 100644 index 000000000..412dd6205 --- /dev/null +++ b/target/linux/lantiq/patches-4.19/0006-MIPS-lantiq-pass-struct-device-to-DMA-API-functions.patch @@ -0,0 +1,50 @@ +From 74f03104ed465ff71b11076ef620e4eaa53dbf74 Mon Sep 17 00:00:00 2001 +From: Christoph Hellwig +Date: Fri, 1 Feb 2019 09:47:44 +0100 +Subject: [PATCH] MIPS: lantiq: pass struct device to DMA API functions + +The DMA API generally relies on a struct device to work properly, and +only barely works without one for legacy reasons. Pass the easily +available struct device from the platform_device to remedy this. + +Also use GFP_KERNEL instead of GFP_ATOMIC as the gfp_t for the memory +allocation, as we aren't in interrupt context or under a lock. + +Note that this whole function looks somewhat bogus given that we never +even look at the returned dma address, and the CPHYSADDR magic on +a returned noncached mapping looks "interesting". But I'll leave +that to people more familiar with the code to sort out. + +Signed-off-by: Christoph Hellwig +Signed-off-by: Paul Burton +Cc: John Crispin +Cc: Vinod Koul +Cc: Dmitry Tarnyagin +Cc: Nicolas Ferre +Cc: Sudip Mukherjee +Cc: Felipe Balbi +Cc: linux-mips@vger.kernel.org +Cc: linux-kernel@vger.kernel.org +Cc: dmaengine@vger.kernel.org +Cc: netdev@vger.kernel.org +Cc: linux-usb@vger.kernel.org +Cc: linux-fbdev@vger.kernel.org +Cc: alsa-devel@alsa-project.org +Cc: iommu@lists.linux-foundation.org +--- + arch/mips/lantiq/xway/vmmc.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/mips/lantiq/xway/vmmc.c ++++ b/arch/mips/lantiq/xway/vmmc.c +@@ -31,8 +31,8 @@ static int vmmc_probe(struct platform_de + dma_addr_t dma; + + cp1_base = +- (void *) CPHYSADDR(dma_alloc_coherent(NULL, CP1_SIZE, +- &dma, GFP_ATOMIC)); ++ (void *) CPHYSADDR(dma_alloc_coherent(&pdev->dev, CP1_SIZE, ++ &dma, GFP_KERNEL)); + + gpio_count = of_gpio_count(pdev->dev.of_node); + while (gpio_count > 0) { diff --git a/target/linux/lantiq/patches-4.14/0008-MIPS-lantiq-backport-old-timer-code.patch b/target/linux/lantiq/patches-4.19/0008-MIPS-lantiq-backport-old-timer-code.patch similarity index 100% rename from target/linux/lantiq/patches-4.14/0008-MIPS-lantiq-backport-old-timer-code.patch rename to target/linux/lantiq/patches-4.19/0008-MIPS-lantiq-backport-old-timer-code.patch diff --git a/target/linux/lantiq/patches-4.14/0018-MTD-nand-lots-of-xrx200-fixes.patch b/target/linux/lantiq/patches-4.19/0018-MTD-nand-lots-of-xrx200-fixes.patch similarity index 95% rename from target/linux/lantiq/patches-4.14/0018-MTD-nand-lots-of-xrx200-fixes.patch rename to target/linux/lantiq/patches-4.19/0018-MTD-nand-lots-of-xrx200-fixes.patch index b97967d20..4e34580ef 100644 --- a/target/linux/lantiq/patches-4.14/0018-MTD-nand-lots-of-xrx200-fixes.patch +++ b/target/linux/lantiq/patches-4.19/0018-MTD-nand-lots-of-xrx200-fixes.patch @@ -5,11 +5,11 @@ Subject: [PATCH 18/36] MTD: nand: lots of xrx200 fixes Signed-off-by: John Crispin --- - drivers/mtd/nand/xway_nand.c | 63 ++++++++++++++++++++++++++++++++++++++++++ + drivers/mtd/nand/raw/xway_nand.c | 63 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) ---- a/drivers/mtd/nand/xway_nand.c -+++ b/drivers/mtd/nand/xway_nand.c +--- a/drivers/mtd/nand/raw/xway_nand.c ++++ b/drivers/mtd/nand/raw/xway_nand.c @@ -63,6 +63,24 @@ #define NAND_CON_CSMUX (1 << 1) #define NAND_CON_NANDM 1 diff --git a/target/linux/lantiq/patches-4.14/0020-MTD-lantiq-handle-NO_XIP-on-cfi0001-flash.patch b/target/linux/lantiq/patches-4.19/0020-MTD-lantiq-handle-NO_XIP-on-cfi0001-flash.patch similarity index 100% rename from target/linux/lantiq/patches-4.14/0020-MTD-lantiq-handle-NO_XIP-on-cfi0001-flash.patch rename to target/linux/lantiq/patches-4.19/0020-MTD-lantiq-handle-NO_XIP-on-cfi0001-flash.patch diff --git a/target/linux/lantiq/patches-4.14/0022-MTD-m25p80-allow-loading-mtd-name-from-OF.patch b/target/linux/lantiq/patches-4.19/0022-MTD-m25p80-allow-loading-mtd-name-from-OF.patch similarity index 77% rename from target/linux/lantiq/patches-4.14/0022-MTD-m25p80-allow-loading-mtd-name-from-OF.patch rename to target/linux/lantiq/patches-4.19/0022-MTD-m25p80-allow-loading-mtd-name-from-OF.patch index 415c8579b..90dc20b90 100644 --- a/target/linux/lantiq/patches-4.14/0022-MTD-m25p80-allow-loading-mtd-name-from-OF.patch +++ b/target/linux/lantiq/patches-4.19/0022-MTD-m25p80-allow-loading-mtd-name-from-OF.patch @@ -22,7 +22,7 @@ Signed-off-by: John Crispin #include #include -@@ -245,6 +246,10 @@ static int m25p_probe(struct spi_device +@@ -180,6 +181,10 @@ static int m25p_probe(struct spi_mem *sp }; char *flash_name; int ret; @@ -31,14 +31,14 @@ Signed-off-by: John Crispin + of_property_read_string(spi->dev.of_node, + "linux,mtd-name", &of_mtd_name); - data = dev_get_platdata(&spi->dev); + data = dev_get_platdata(&spimem->spi->dev); -@@ -283,6 +288,8 @@ static int m25p_probe(struct spi_device +@@ -218,6 +223,8 @@ static int m25p_probe(struct spi_mem *sp if (data && data->name) nor->mtd.name = data->name; + else if (of_mtd_name) + nor->mtd.name = of_mtd_name; - /* For some (historical?) reason many platforms provide two different - * names in flash_platform_data: "name" and "type". Quite often name is + if (!nor->mtd.name) + nor->mtd.name = spi_mem_get_name(spimem); diff --git a/target/linux/lantiq/patches-4.14/0023-NET-PHY-add-led-support-for-intel-xway.patch b/target/linux/lantiq/patches-4.19/0023-NET-PHY-add-led-support-for-intel-xway.patch similarity index 98% rename from target/linux/lantiq/patches-4.14/0023-NET-PHY-add-led-support-for-intel-xway.patch rename to target/linux/lantiq/patches-4.19/0023-NET-PHY-add-led-support-for-intel-xway.patch index 068684282..60a6dbafd 100644 --- a/target/linux/lantiq/patches-4.14/0023-NET-PHY-add-led-support-for-intel-xway.patch +++ b/target/linux/lantiq/patches-4.19/0023-NET-PHY-add-led-support-for-intel-xway.patch @@ -13,9 +13,9 @@ Signed-off-by: John Crispin --- a/drivers/net/phy/intel-xway.c +++ b/drivers/net/phy/intel-xway.c -@@ -152,6 +152,51 @@ - #define PHY_ID_PHY11G_VR9 0xD565A409 - #define PHY_ID_PHY22F_VR9 0xD565A419 +@@ -154,6 +154,51 @@ + #define PHY_ID_PHY11G_VR9_1_2 0xD565A409 + #define PHY_ID_PHY22F_VR9_1_2 0xD565A419 +#if IS_ENABLED(CONFIG_OF_MDIO) +static int vr9_gphy_of_reg_init(struct phy_device *phydev) @@ -65,7 +65,7 @@ Signed-off-by: John Crispin static int xway_gphy_config_init(struct phy_device *phydev) { int err; -@@ -190,6 +235,7 @@ static int xway_gphy_config_init(struct +@@ -192,6 +237,7 @@ static int xway_gphy_config_init(struct phy_write_mmd(phydev, MDIO_MMD_VEND2, XWAY_MMD_LED2H, ledxh); phy_write_mmd(phydev, MDIO_MMD_VEND2, XWAY_MMD_LED2L, ledxl); diff --git a/target/linux/lantiq/patches-4.14/0024-MIPS-lantiq-autoselect-soc-rev-matching-fw.patch b/target/linux/lantiq/patches-4.19/0024-MIPS-lantiq-autoselect-soc-rev-matching-fw.patch similarity index 100% rename from target/linux/lantiq/patches-4.14/0024-MIPS-lantiq-autoselect-soc-rev-matching-fw.patch rename to target/linux/lantiq/patches-4.19/0024-MIPS-lantiq-autoselect-soc-rev-matching-fw.patch diff --git a/target/linux/lantiq/patches-4.14/0025-NET-MIPS-lantiq-adds-xrx200-net.patch b/target/linux/lantiq/patches-4.19/0025-NET-MIPS-lantiq-adds-xrx200-net.patch similarity index 99% rename from target/linux/lantiq/patches-4.14/0025-NET-MIPS-lantiq-adds-xrx200-net.patch rename to target/linux/lantiq/patches-4.19/0025-NET-MIPS-lantiq-adds-xrx200-net.patch index 7eaf0b7b7..b2de5ac51 100644 --- a/target/linux/lantiq/patches-4.14/0025-NET-MIPS-lantiq-adds-xrx200-net.patch +++ b/target/linux/lantiq/patches-4.19/0025-NET-MIPS-lantiq-adds-xrx200-net.patch @@ -16,7 +16,7 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net --- a/drivers/net/ethernet/Kconfig +++ b/drivers/net/ethernet/Kconfig -@@ -107,7 +107,13 @@ config LANTIQ_ETOP +@@ -106,7 +106,13 @@ config LANTIQ_ETOP tristate "Lantiq SoC ETOP driver" depends on SOC_TYPE_XWAY ---help--- @@ -33,7 +33,7 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net source "drivers/net/ethernet/mediatek/Kconfig" --- a/drivers/net/ethernet/Makefile +++ b/drivers/net/ethernet/Makefile -@@ -50,6 +50,7 @@ obj-$(CONFIG_NET_VENDOR_XSCALE) += xscal +@@ -49,6 +49,7 @@ obj-$(CONFIG_NET_VENDOR_XSCALE) += xscal obj-$(CONFIG_JME) += jme.o obj-$(CONFIG_KORINA) += korina.o obj-$(CONFIG_LANTIQ_ETOP) += lantiq_etop.o @@ -209,7 +209,7 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net +}; --- /dev/null +++ b/drivers/net/ethernet/lantiq_xrx200.c -@@ -0,0 +1,1887 @@ +@@ -0,0 +1,1889 @@ +/* + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published @@ -1133,7 +1133,7 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net + goto skip; + + skb_reserve(ch->skb[ch->dma.desc], NET_SKB_PAD); -+ ch->dma.desc_base[ch->dma.desc].addr = dma_map_single(NULL, ++ ch->dma.desc_base[ch->dma.desc].addr = dma_map_single(ch->dma.dev, + ch->skb[ch->dma.desc]->data, XRX200_DMA_DATA_LEN, + DMA_FROM_DEVICE); + ch->dma.desc_base[ch->dma.desc].addr = @@ -1328,7 +1328,7 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net + + netif_trans_update(dev); + -+ desc->addr = ((unsigned int) dma_map_single(NULL, skb->data, len, ++ desc->addr = ((unsigned int) dma_map_single(ch->dma.dev, skb->data, len, + DMA_TO_DEVICE)) - byte_offset; + wmb(); + desc->ctl = LTQ_DMA_OWN | LTQ_DMA_SOP | LTQ_DMA_EOP | @@ -1365,7 +1365,7 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net + return IRQ_HANDLED; +} + -+static int xrx200_dma_init(struct xrx200_hw *hw) ++static int xrx200_dma_init(struct device *dev, struct xrx200_hw *hw) +{ + int i, err = 0; + @@ -1378,6 +1378,7 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net + spin_lock_init(&ch->lock); + + ch->idx = ch->dma.nr = i; ++ ch->dma.dev = dev; + + if (i == XRX200_DMA_TX) { + ltq_dma_alloc_tx(&ch->dma); @@ -1540,11 +1541,12 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net +{ + struct net_device *netdev = phydev->attached_dev; + -+ if (do_carrier) ++ if (do_carrier) { + if (up) + netif_carrier_on(netdev); + else if (!xrx200_phy_has_link(netdev)) + netif_carrier_off(netdev); ++ } + + phydev->adjust_link(netdev); +} @@ -2002,7 +2004,7 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net + } + + /* bring up the dma engine and IP core */ -+ xrx200_dma_init(&xrx200_hw); ++ xrx200_dma_init(&pdev->dev, &xrx200_hw); + xrx200_hw_init(&xrx200_hw); + tasklet_init(&xrx200_hw.chan[XRX200_DMA_TX].tasklet, xrx200_tx_housekeeping, (u32) &xrx200_hw.chan[XRX200_DMA_TX]); + tasklet_init(&xrx200_hw.chan[XRX200_DMA_TX_2].tasklet, xrx200_tx_housekeeping, (u32) &xrx200_hw.chan[XRX200_DMA_TX_2]); diff --git a/target/linux/lantiq/patches-4.14/0028-NET-lantiq-various-etop-fixes.patch b/target/linux/lantiq/patches-4.19/0028-NET-lantiq-various-etop-fixes.patch similarity index 92% rename from target/linux/lantiq/patches-4.14/0028-NET-lantiq-various-etop-fixes.patch rename to target/linux/lantiq/patches-4.19/0028-NET-lantiq-various-etop-fixes.patch index 83aef78ca..a336af8a3 100644 --- a/target/linux/lantiq/patches-4.14/0028-NET-lantiq-various-etop-fixes.patch +++ b/target/linux/lantiq/patches-4.19/0028-NET-lantiq-various-etop-fixes.patch @@ -152,7 +152,7 @@ Signed-off-by: John Crispin struct net_device *netdev; struct napi_struct napi; struct ltq_dma_channel dma; -@@ -98,21 +150,34 @@ struct ltq_etop_chan { +@@ -98,23 +150,36 @@ struct ltq_etop_chan { struct ltq_etop_priv { struct net_device *netdev; struct platform_device *pdev; @@ -165,14 +165,15 @@ Signed-off-by: John Crispin - int tx_free[MAX_DMA_CHAN >> 1]; + struct ltq_etop_chan txch; + struct ltq_etop_chan rxch; -+ + +- spinlock_t lock; + int tx_irq; + int rx_irq; + + unsigned char mac[6]; + int mii_mode; - - spinlock_t lock; ++ ++ spinlock_t lock; + + struct clk *clk_ppe; + struct clk *clk_switch; @@ -186,12 +187,14 @@ Signed-off-by: John Crispin static int ltq_etop_alloc_skb(struct ltq_etop_chan *ch) { + struct ltq_etop_priv *priv = netdev_priv(ch->netdev); + - ch->skb[ch->dma.desc] = netdev_alloc_skb(ch->netdev, MAX_DMA_DATA_LEN); + ch->skb[ch->dma.desc] = dev_alloc_skb(MAX_DMA_DATA_LEN); if (!ch->skb[ch->dma.desc]) return -ENOMEM; - ch->dma.desc_base[ch->dma.desc].addr = dma_map_single(NULL, -@@ -147,8 +212,11 @@ ltq_etop_hw_receive(struct ltq_etop_chan + ch->dma.desc_base[ch->dma.desc].addr = dma_map_single(&priv->pdev->dev, +@@ -149,8 +214,11 @@ ltq_etop_hw_receive(struct ltq_etop_chan spin_unlock_irqrestore(&priv->lock, flags); skb_put(skb, len); @@ -203,7 +206,7 @@ Signed-off-by: John Crispin } static int -@@ -156,7 +224,9 @@ ltq_etop_poll_rx(struct napi_struct *nap +@@ -158,7 +226,9 @@ ltq_etop_poll_rx(struct napi_struct *nap { struct ltq_etop_chan *ch = container_of(napi, struct ltq_etop_chan, napi); @@ -213,7 +216,7 @@ Signed-off-by: John Crispin while (work_done < budget) { struct ltq_dma_desc *desc = &ch->dma.desc_base[ch->dma.desc]; -@@ -168,7 +238,9 @@ ltq_etop_poll_rx(struct napi_struct *nap +@@ -170,7 +240,9 @@ ltq_etop_poll_rx(struct napi_struct *nap } if (work_done < budget) { napi_complete_done(&ch->napi, work_done); @@ -223,7 +226,7 @@ Signed-off-by: John Crispin } return work_done; } -@@ -180,12 +252,14 @@ ltq_etop_poll_tx(struct napi_struct *nap +@@ -182,12 +254,14 @@ ltq_etop_poll_tx(struct napi_struct *nap container_of(napi, struct ltq_etop_chan, napi); struct ltq_etop_priv *priv = netdev_priv(ch->netdev); struct netdev_queue *txq = @@ -239,7 +242,7 @@ Signed-off-by: John Crispin dev_kfree_skb_any(ch->skb[ch->tx_free]); ch->skb[ch->tx_free] = NULL; memset(&ch->dma.desc_base[ch->tx_free], 0, -@@ -198,7 +272,9 @@ ltq_etop_poll_tx(struct napi_struct *nap +@@ -200,7 +274,9 @@ ltq_etop_poll_tx(struct napi_struct *nap if (netif_tx_queue_stopped(txq)) netif_tx_start_queue(txq); napi_complete(&ch->napi); @@ -249,7 +252,7 @@ Signed-off-by: John Crispin return 1; } -@@ -206,9 +282,10 @@ static irqreturn_t +@@ -208,9 +284,10 @@ static irqreturn_t ltq_etop_dma_irq(int irq, void *_priv) { struct ltq_etop_priv *priv = _priv; @@ -263,7 +266,7 @@ Signed-off-by: John Crispin return IRQ_HANDLED; } -@@ -220,7 +297,7 @@ ltq_etop_free_channel(struct net_device +@@ -222,7 +299,7 @@ ltq_etop_free_channel(struct net_device ltq_dma_free(&ch->dma); if (ch->dma.irq) free_irq(ch->dma.irq, priv); @@ -272,7 +275,7 @@ Signed-off-by: John Crispin int desc; for (desc = 0; desc < LTQ_DESC_NUM; desc++) dev_kfree_skb_any(ch->skb[ch->dma.desc]); -@@ -231,65 +308,133 @@ static void +@@ -233,66 +310,135 @@ static void ltq_etop_hw_exit(struct net_device *dev) { struct ltq_etop_priv *priv = netdev_priv(dev); @@ -328,11 +331,10 @@ Signed-off-by: John Crispin struct ltq_etop_priv *priv = netdev_priv(dev); - int i; + int mii_mode = priv->mii_mode; - -- ltq_pmu_enable(PMU_PPE); ++ + clk_enable(priv->clk_ppe); -- switch (priv->pldata->mii_mode) { +- ltq_pmu_enable(PMU_PPE); + if (of_machine_is_compatible("lantiq,ar9")) { + ltq_etop_gbit_init(dev); + /* force the etops link to the gbit to MII */ @@ -341,7 +343,8 @@ Signed-off-by: John Crispin + ltq_etop_w32_mask(MDIO_CFG_MASK, 0, LTQ_ETOP_MDIO_CFG); + ltq_etop_w32_mask(MAC_CFG_MASK, MAC_CFG_CGEN | MAC_CFG_DUPLEX | + MAC_CFG_SPEED | MAC_CFG_LINK, LTQ_ETOP_MAC_CFG); -+ + +- switch (priv->pldata->mii_mode) { + switch (mii_mode) { case PHY_INTERFACE_MODE_RMII: - ltq_etop_w32_mask(ETOP_MII_MASK, @@ -396,6 +399,7 @@ Signed-off-by: John Crispin - struct ltq_etop_chan *ch = &priv->ch[i]; - - ch->idx = ch->dma.nr = i; +- ch->dma.dev = &priv->pdev->dev; - - if (IS_TX(i)) { - ltq_dma_alloc_tx(&ch->dma); @@ -409,6 +413,7 @@ Signed-off-by: John Crispin - ch->dma.desc = 0; - request_irq(irq, ltq_etop_dma_irq, 0, "etop_rx", priv); + priv->txch.dma.nr = tx; ++ priv->txch.dma.dev = &priv->pdev->dev; + ltq_dma_alloc_tx(&priv->txch.dma); + err = request_irq(priv->tx_irq, ltq_etop_dma_irq, 0, "eth_tx", priv); + if (err) { @@ -418,6 +423,7 @@ Signed-off-by: John Crispin + priv->txch.dma.irq = priv->tx_irq; + + priv->rxch.dma.nr = rx; ++ priv->rxch.dma.dev = &priv->pdev->dev; + ltq_dma_alloc_rx(&priv->rxch.dma); + for (priv->rxch.dma.desc = 0; priv->rxch.dma.desc < LTQ_DESC_NUM; + priv->rxch.dma.desc++) { @@ -440,7 +446,7 @@ Signed-off-by: John Crispin } static void -@@ -308,6 +453,39 @@ static const struct ethtool_ops ltq_etop +@@ -311,6 +457,39 @@ static const struct ethtool_ops ltq_etop }; static int @@ -480,7 +486,7 @@ Signed-off-by: John Crispin ltq_etop_mdio_wr(struct mii_bus *bus, int phy_addr, int phy_reg, u16 phy_data) { u32 val = MDIO_REQUEST | -@@ -315,9 +493,9 @@ ltq_etop_mdio_wr(struct mii_bus *bus, in +@@ -318,9 +497,9 @@ ltq_etop_mdio_wr(struct mii_bus *bus, in ((phy_reg & MDIO_REG_MASK) << MDIO_REG_OFFSET) | phy_data; @@ -492,7 +498,7 @@ Signed-off-by: John Crispin return 0; } -@@ -328,12 +506,12 @@ ltq_etop_mdio_rd(struct mii_bus *bus, in +@@ -331,12 +510,12 @@ ltq_etop_mdio_rd(struct mii_bus *bus, in ((phy_addr & MDIO_ADDR_MASK) << MDIO_ADDR_OFFSET) | ((phy_reg & MDIO_REG_MASK) << MDIO_REG_OFFSET); @@ -509,7 +515,7 @@ Signed-off-by: John Crispin return val; } -@@ -348,8 +526,18 @@ ltq_etop_mdio_probe(struct net_device *d +@@ -351,8 +530,18 @@ ltq_etop_mdio_probe(struct net_device *d { struct ltq_etop_priv *priv = netdev_priv(dev); struct phy_device *phydev; @@ -529,7 +535,7 @@ Signed-off-by: John Crispin if (!phydev) { netdev_err(dev, "no PHY found\n"); -@@ -357,21 +545,18 @@ ltq_etop_mdio_probe(struct net_device *d +@@ -360,21 +549,18 @@ ltq_etop_mdio_probe(struct net_device *d } phydev = phy_connect(dev, phydev_name(phydev), @@ -556,7 +562,7 @@ Signed-off-by: John Crispin phydev->advertising = phydev->supported; phy_attached_info(phydev); -@@ -392,8 +577,13 @@ ltq_etop_mdio_init(struct net_device *de +@@ -395,8 +581,13 @@ ltq_etop_mdio_init(struct net_device *de } priv->mii_bus->priv = dev; @@ -572,7 +578,7 @@ Signed-off-by: John Crispin priv->mii_bus->name = "ltq_mii"; snprintf(priv->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x", priv->pdev->name, priv->pdev->id); -@@ -430,17 +620,19 @@ static int +@@ -433,17 +624,19 @@ static int ltq_etop_open(struct net_device *dev) { struct ltq_etop_priv *priv = netdev_priv(dev); @@ -601,7 +607,7 @@ Signed-off-by: John Crispin netif_tx_start_all_queues(dev); return 0; } -@@ -449,18 +641,19 @@ static int +@@ -452,18 +645,19 @@ static int ltq_etop_stop(struct net_device *dev) { struct ltq_etop_priv *priv = netdev_priv(dev); @@ -631,7 +637,7 @@ Signed-off-by: John Crispin return 0; } -@@ -470,16 +663,16 @@ ltq_etop_tx(struct sk_buff *skb, struct +@@ -473,16 +667,16 @@ ltq_etop_tx(struct sk_buff *skb, struct int queue = skb_get_queue_mapping(skb); struct netdev_queue *txq = netdev_get_tx_queue(dev, queue); struct ltq_etop_priv *priv = netdev_priv(dev); @@ -653,7 +659,7 @@ Signed-off-by: John Crispin netdev_err(dev, "tx ring full\n"); netif_tx_stop_queue(txq); return NETDEV_TX_BUSY; -@@ -487,7 +680,7 @@ ltq_etop_tx(struct sk_buff *skb, struct +@@ -490,7 +684,7 @@ ltq_etop_tx(struct sk_buff *skb, struct /* dma needs to start on a 16 byte aligned address */ byte_offset = CPHYSADDR(skb->data) % 16; @@ -662,7 +668,7 @@ Signed-off-by: John Crispin netif_trans_update(dev); -@@ -497,11 +690,11 @@ ltq_etop_tx(struct sk_buff *skb, struct +@@ -500,11 +694,11 @@ ltq_etop_tx(struct sk_buff *skb, struct wmb(); desc->ctl = LTQ_DMA_OWN | LTQ_DMA_SOP | LTQ_DMA_EOP | LTQ_DMA_TX_OFFSET(byte_offset) | (len & LTQ_DMA_SIZE_MASK); @@ -677,11 +683,15 @@ Signed-off-by: John Crispin netif_tx_stop_queue(txq); return NETDEV_TX_OK; -@@ -515,8 +708,10 @@ ltq_etop_change_mtu(struct net_device *d +@@ -515,11 +709,14 @@ ltq_etop_change_mtu(struct net_device *d + { + struct ltq_etop_priv *priv = netdev_priv(dev); + unsigned long flags; ++ int max; dev->mtu = new_mtu; -+ int max = ETH_HLEN + VLAN_HLEN + new_mtu + ETH_FCS_LEN; ++ max = ETH_HLEN + VLAN_HLEN + new_mtu + ETH_FCS_LEN; + spin_lock_irqsave(&priv->lock, flags); - ltq_etop_w32((ETOP_PLEN_UNDER << 16) | new_mtu, LTQ_ETOP_IGPLEN); @@ -689,7 +699,7 @@ Signed-off-by: John Crispin spin_unlock_irqrestore(&priv->lock, flags); return 0; -@@ -584,6 +779,9 @@ ltq_etop_init(struct net_device *dev) +@@ -579,6 +776,9 @@ ltq_etop_init(struct net_device *dev) if (err) goto err_hw; ltq_etop_change_mtu(dev, 1500); @@ -699,7 +709,7 @@ Signed-off-by: John Crispin memcpy(&mac, &priv->pldata->mac, sizeof(struct sockaddr)); if (!is_valid_ether_addr(mac.sa_data)) { -@@ -601,9 +799,10 @@ ltq_etop_init(struct net_device *dev) +@@ -596,9 +796,10 @@ ltq_etop_init(struct net_device *dev) dev->addr_assign_type = NET_ADDR_RANDOM; ltq_etop_set_multicast_list(dev); @@ -713,7 +723,7 @@ Signed-off-by: John Crispin return 0; err_netdev: -@@ -623,6 +822,9 @@ ltq_etop_tx_timeout(struct net_device *d +@@ -618,6 +819,9 @@ ltq_etop_tx_timeout(struct net_device *d err = ltq_etop_hw_init(dev); if (err) goto err_hw; @@ -723,7 +733,7 @@ Signed-off-by: John Crispin netif_trans_update(dev); netif_wake_queue(dev); return; -@@ -646,14 +848,19 @@ static const struct net_device_ops ltq_e +@@ -641,14 +845,19 @@ static const struct net_device_ops ltq_e .ndo_tx_timeout = ltq_etop_tx_timeout, }; @@ -747,7 +757,7 @@ Signed-off-by: John Crispin res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { -@@ -679,31 +886,62 @@ ltq_etop_probe(struct platform_device *p +@@ -674,31 +883,62 @@ ltq_etop_probe(struct platform_device *p goto err_out; } @@ -825,7 +835,7 @@ Signed-off-by: John Crispin err = register_netdev(dev); if (err) -@@ -732,31 +970,22 @@ ltq_etop_remove(struct platform_device * +@@ -727,31 +967,22 @@ ltq_etop_remove(struct platform_device * return 0; } diff --git a/target/linux/lantiq/patches-4.14/0030-GPIO-add-named-gpio-exports.patch b/target/linux/lantiq/patches-4.19/0030-GPIO-add-named-gpio-exports.patch similarity index 93% rename from target/linux/lantiq/patches-4.14/0030-GPIO-add-named-gpio-exports.patch rename to target/linux/lantiq/patches-4.19/0030-GPIO-add-named-gpio-exports.patch index 8f0ac8d0f..8e3060d76 100644 --- a/target/linux/lantiq/patches-4.14/0030-GPIO-add-named-gpio-exports.patch +++ b/target/linux/lantiq/patches-4.19/0030-GPIO-add-named-gpio-exports.patch @@ -22,7 +22,7 @@ Signed-off-by: John Crispin #include "gpiolib.h" -@@ -513,3 +515,72 @@ void of_gpiochip_remove(struct gpio_chip +@@ -660,3 +662,72 @@ void of_gpiochip_remove(struct gpio_chip gpiochip_remove_pin_ranges(chip); of_node_put(chip->of_node); } @@ -112,7 +112,7 @@ Signed-off-by: John Crispin { --- a/include/linux/gpio/consumer.h +++ b/include/linux/gpio/consumer.h -@@ -451,6 +451,7 @@ struct gpio_desc *devm_fwnode_get_gpiod_ +@@ -533,6 +533,7 @@ struct gpio_desc *devm_fwnode_get_gpiod_ #if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_GPIO_SYSFS) @@ -120,7 +120,7 @@ Signed-off-by: John Crispin int gpiod_export(struct gpio_desc *desc, bool direction_may_change); int gpiod_export_link(struct device *dev, const char *name, struct gpio_desc *desc); -@@ -458,6 +459,13 @@ void gpiod_unexport(struct gpio_desc *de +@@ -540,6 +541,13 @@ void gpiod_unexport(struct gpio_desc *de #else /* CONFIG_GPIOLIB && CONFIG_GPIO_SYSFS */ @@ -136,7 +136,7 @@ Signed-off-by: John Crispin { --- a/drivers/gpio/gpiolib-sysfs.c +++ b/drivers/gpio/gpiolib-sysfs.c -@@ -553,7 +553,7 @@ static struct class gpio_class = { +@@ -568,7 +568,7 @@ static struct class gpio_class = { * * Returns zero on success, else an error. */ @@ -145,7 +145,7 @@ Signed-off-by: John Crispin { struct gpio_chip *chip; struct gpio_device *gdev; -@@ -615,6 +615,8 @@ int gpiod_export(struct gpio_desc *desc, +@@ -630,6 +630,8 @@ int gpiod_export(struct gpio_desc *desc, offset = gpio_chip_hwgpio(desc); if (chip->names && chip->names[offset]) ioname = chip->names[offset]; @@ -154,7 +154,7 @@ Signed-off-by: John Crispin dev = device_create_with_groups(&gpio_class, &gdev->dev, MKDEV(0, 0), data, gpio_groups, -@@ -636,6 +638,12 @@ err_unlock: +@@ -651,6 +653,12 @@ err_unlock: gpiod_dbg(desc, "%s: status %d\n", __func__, status); return status; } diff --git a/target/linux/lantiq/patches-4.14/0031-I2C-MIPS-lantiq-add-FALC-ON-i2c-bus-master.patch b/target/linux/lantiq/patches-4.19/0031-I2C-MIPS-lantiq-add-FALC-ON-i2c-bus-master.patch similarity index 99% rename from target/linux/lantiq/patches-4.14/0031-I2C-MIPS-lantiq-add-FALC-ON-i2c-bus-master.patch rename to target/linux/lantiq/patches-4.19/0031-I2C-MIPS-lantiq-add-FALC-ON-i2c-bus-master.patch index a1e1ccedd..90238e35b 100644 --- a/target/linux/lantiq/patches-4.14/0031-I2C-MIPS-lantiq-add-FALC-ON-i2c-bus-master.patch +++ b/target/linux/lantiq/patches-4.19/0031-I2C-MIPS-lantiq-add-FALC-ON-i2c-bus-master.patch @@ -18,7 +18,7 @@ Signed-off-by: John Crispin --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig -@@ -696,6 +696,16 @@ config I2C_MESON +@@ -690,6 +690,16 @@ config I2C_MESON If you say yes to this option, support will be included for the I2C interface on the Amlogic Meson family of SoCs. @@ -37,7 +37,7 @@ Signed-off-by: John Crispin depends on PPC --- a/drivers/i2c/busses/Makefile +++ b/drivers/i2c/busses/Makefile -@@ -68,6 +68,7 @@ obj-$(CONFIG_I2C_IMX_LPI2C) += i2c-imx-l +@@ -67,6 +67,7 @@ obj-$(CONFIG_I2C_IMX_LPI2C) += i2c-imx-l obj-$(CONFIG_I2C_IOP3XX) += i2c-iop3xx.o obj-$(CONFIG_I2C_JZ4780) += i2c-jz4780.o obj-$(CONFIG_I2C_KEMPLD) += i2c-kempld.o diff --git a/target/linux/lantiq/patches-4.14/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch b/target/linux/lantiq/patches-4.19/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch similarity index 99% rename from target/linux/lantiq/patches-4.14/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch rename to target/linux/lantiq/patches-4.19/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch index 2e0ce468f..a382b9117 100644 --- a/target/linux/lantiq/patches-4.14/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch +++ b/target/linux/lantiq/patches-4.19/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch @@ -203,7 +203,7 @@ Signed-off-by: John Crispin +early_param("ethaddr", setup_ethaddr); --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c -@@ -783,7 +783,11 @@ ltq_etop_init(struct net_device *dev) +@@ -780,7 +780,11 @@ ltq_etop_init(struct net_device *dev) if (err) goto err_hw; diff --git a/target/linux/lantiq/patches-4.14/0042-arch-mips-increase-io_space_limit.patch b/target/linux/lantiq/patches-4.19/0042-arch-mips-increase-io_space_limit.patch similarity index 97% rename from target/linux/lantiq/patches-4.14/0042-arch-mips-increase-io_space_limit.patch rename to target/linux/lantiq/patches-4.19/0042-arch-mips-increase-io_space_limit.patch index 14b417e69..7165dd007 100644 --- a/target/linux/lantiq/patches-4.14/0042-arch-mips-increase-io_space_limit.patch +++ b/target/linux/lantiq/patches-4.19/0042-arch-mips-increase-io_space_limit.patch @@ -12,7 +12,7 @@ Signed-off-by: John Crispin --- a/arch/mips/include/asm/io.h +++ b/arch/mips/include/asm/io.h -@@ -50,7 +50,7 @@ +@@ -52,7 +52,7 @@ /* ioswab[bwlq], __mem_ioswab[bwlq] are defined in mangle-port.h */ diff --git a/target/linux/lantiq/patches-4.14/0050-USB-DWC2-make-the-lantiq-settings-match-vendor-drive.patch b/target/linux/lantiq/patches-4.19/0050-USB-DWC2-make-the-lantiq-settings-match-vendor-drive.patch similarity index 91% rename from target/linux/lantiq/patches-4.14/0050-USB-DWC2-make-the-lantiq-settings-match-vendor-drive.patch rename to target/linux/lantiq/patches-4.19/0050-USB-DWC2-make-the-lantiq-settings-match-vendor-drive.patch index 37894244e..81d46c3d1 100644 --- a/target/linux/lantiq/patches-4.14/0050-USB-DWC2-make-the-lantiq-settings-match-vendor-drive.patch +++ b/target/linux/lantiq/patches-4.19/0050-USB-DWC2-make-the-lantiq-settings-match-vendor-drive.patch @@ -23,7 +23,7 @@ Signed-off-by: Hauke Mehrtens --- a/drivers/usb/dwc2/params.c +++ b/drivers/usb/dwc2/params.c -@@ -83,7 +83,14 @@ static void dwc2_set_rk_params(struct dw +@@ -90,7 +90,14 @@ static void dwc2_set_rk_params(struct dw GAHBCFG_HBSTLEN_SHIFT; } @@ -39,7 +39,7 @@ Signed-off-by: Hauke Mehrtens { struct dwc2_core_params *p = &hsotg->params; -@@ -91,12 +98,20 @@ static void dwc2_set_ltq_params(struct d +@@ -98,12 +105,20 @@ static void dwc2_set_ltq_params(struct d p->host_rx_fifo_size = 288; p->host_nperio_tx_fifo_size = 128; p->host_perio_tx_fifo_size = 96; @@ -62,7 +62,7 @@ Signed-off-by: Hauke Mehrtens static void dwc2_set_amlogic_params(struct dwc2_hsotg *hsotg) { struct dwc2_core_params *p = &hsotg->params; -@@ -140,8 +155,11 @@ const struct of_device_id dwc2_of_match_ +@@ -155,8 +170,11 @@ const struct of_device_id dwc2_of_match_ { .compatible = "brcm,bcm2835-usb", .data = dwc2_set_bcm_params }, { .compatible = "hisilicon,hi6220-usb", .data = dwc2_set_his_params }, { .compatible = "rockchip,rk3066-usb", .data = dwc2_set_rk_params }, @@ -74,5 +74,5 @@ Signed-off-by: Hauke Mehrtens + { .compatible = "lantiq,xrx200-usb", .data = &dwc2_set_ltq_xrx200_params }, + { .compatible = "lantiq,xrx300-usb", .data = &dwc2_set_ltq_xrx200_params }, { .compatible = "snps,dwc2" }, - { .compatible = "samsung,s3c6400-hsotg" }, - { .compatible = "amlogic,meson8-usb", + { .compatible = "samsung,s3c6400-hsotg", + .data = dwc2_set_s3c6400_params }, diff --git a/target/linux/lantiq/patches-4.14/0051-MIPS-lantiq-improve-USB-initialization.patch b/target/linux/lantiq/patches-4.19/0051-MIPS-lantiq-improve-USB-initialization.patch similarity index 96% rename from target/linux/lantiq/patches-4.14/0051-MIPS-lantiq-improve-USB-initialization.patch rename to target/linux/lantiq/patches-4.19/0051-MIPS-lantiq-improve-USB-initialization.patch index 5030bbf3d..a7bdafd70 100644 --- a/target/linux/lantiq/patches-4.14/0051-MIPS-lantiq-improve-USB-initialization.patch +++ b/target/linux/lantiq/patches-4.19/0051-MIPS-lantiq-improve-USB-initialization.patch @@ -41,7 +41,7 @@ Signed-off-by: Hauke Mehrtens /* the pci enable helper */ static int pci_enable(struct clk *clk) { -@@ -569,4 +588,5 @@ void __init ltq_soc_init(void) +@@ -567,4 +586,5 @@ void __init ltq_soc_init(void) clkdev_add_pmu("1e116000.mei", "dfe", 1, 0, PMU_DFE); clkdev_add_pmu("1e100400.serial", NULL, 1, 0, PMU_ASC0); } diff --git a/target/linux/lantiq/patches-4.14/0101-find_active_root.patch b/target/linux/lantiq/patches-4.19/0101-find_active_root.patch similarity index 94% rename from target/linux/lantiq/patches-4.14/0101-find_active_root.patch rename to target/linux/lantiq/patches-4.19/0101-find_active_root.patch index 73361c87f..f48b5b7c6 100644 --- a/target/linux/lantiq/patches-4.14/0101-find_active_root.patch +++ b/target/linux/lantiq/patches-4.19/0101-find_active_root.patch @@ -52,9 +52,9 @@ @@ -72,7 +105,9 @@ static int parse_fixed_partitions(struct return 0; - parts = kzalloc(nr_parts * sizeof(*parts), GFP_KERNEL); + parts = kcalloc(nr_parts, sizeof(*parts), GFP_KERNEL); - if (!parts) -+ part_nodes = kzalloc(nr_parts * sizeof(*part_nodes), GFP_KERNEL); ++ part_nodes = kcalloc(nr_parts, sizeof(*part_nodes), GFP_KERNEL); + + if (!parts || !part_nodes) return -ENOMEM; diff --git a/target/linux/lantiq/patches-4.14/0151-lantiq-ifxmips_pcie-use-of.patch b/target/linux/lantiq/patches-4.19/0151-lantiq-ifxmips_pcie-use-of.patch similarity index 82% rename from target/linux/lantiq/patches-4.14/0151-lantiq-ifxmips_pcie-use-of.patch rename to target/linux/lantiq/patches-4.19/0151-lantiq-ifxmips_pcie-use-of.patch index 03d43c241..b08187119 100644 --- a/target/linux/lantiq/patches-4.14/0151-lantiq-ifxmips_pcie-use-of.patch +++ b/target/linux/lantiq/patches-4.19/0151-lantiq-ifxmips_pcie-use-of.patch @@ -41,7 +41,7 @@ static inline int pcie_ltssm_enable(int pcie_port) { -@@ -1045,8 +1065,9 @@ pcie_rc_initialize(int pcie_port) +@@ -1045,17 +1065,52 @@ pcie_rc_initialize(int pcie_port) return 0; } @@ -52,7 +52,32 @@ void __iomem *io_map_base; int pcie_port; int startup_port; -@@ -1055,7 +1076,17 @@ static int __init ifx_pcie_bios_init(voi + ++ struct device_node *np; ++ struct pci_bus *bus; ++ ++ /* ++ * In case a PCI device is physical present, the Lantiq PCI driver need ++ * to be loaded prior to the Lantiq PCIe driver. Otherwise none of them ++ * will work. ++ * ++ * In case the lantiq PCI driver is enabled in the device tree, check if ++ * a PCI bus (hopefully the one of the Lantiq PCI driver one) is already ++ * registered. ++ * ++ * It will fail if there is another PCI controller, this controller is ++ * registered before the Lantiq PCIe driver is probe and the lantiq PCI ++ */ ++ np = of_find_compatible_node(NULL, NULL, "lantiq,pci-xway"); ++ ++ if (of_device_is_available(np)) { ++ bus = pci_find_next_bus(bus); ++ ++ if (!bus) ++ return -EPROBE_DEFER; ++ } ++ + /* Enable AHB Master/ Slave */ pcie_ahb_pmu_setup(); startup_port = IFX_PCIE_PORT0; @@ -71,7 +96,7 @@ for (pcie_port = startup_port; pcie_port < IFX_PCIE_CORE_NR; pcie_port++){ if (pcie_rc_initialize(pcie_port) == 0) { IFX_PCIE_PRINT(PCIE_MSG_INIT, "%s: ifx_pcie_cfg_base 0x%p\n", -@@ -1067,6 +1098,7 @@ static int __init ifx_pcie_bios_init(voi +@@ -1067,6 +1122,7 @@ static int __init ifx_pcie_bios_init(voi return -ENOMEM; } ifx_pcie_controller[pcie_port].pcic.io_map_base = (unsigned long)io_map_base; @@ -79,7 +104,7 @@ register_pci_controller(&ifx_pcie_controller[pcie_port].pcic); /* XXX, clear error status */ -@@ -1083,6 +1115,30 @@ static int __init ifx_pcie_bios_init(voi +@@ -1083,6 +1139,30 @@ static int __init ifx_pcie_bios_init(voi return 0; } diff --git a/target/linux/lantiq/patches-4.14/0152-lantiq-VPE.patch b/target/linux/lantiq/patches-4.19/0152-lantiq-VPE.patch similarity index 97% rename from target/linux/lantiq/patches-4.14/0152-lantiq-VPE.patch rename to target/linux/lantiq/patches-4.19/0152-lantiq-VPE.patch index b0b5bd3a5..d40dcef50 100644 --- a/target/linux/lantiq/patches-4.14/0152-lantiq-VPE.patch +++ b/target/linux/lantiq/patches-4.19/0152-lantiq-VPE.patch @@ -1,6 +1,6 @@ --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -2327,6 +2327,12 @@ config MIPS_VPE_LOADER +@@ -2317,6 +2317,12 @@ config MIPS_VPE_LOADER Includes a loader for loading an elf relocatable object onto another VPE and running it. @@ -142,7 +142,7 @@ { --- a/arch/mips/lantiq/prom.c +++ b/arch/mips/lantiq/prom.c -@@ -37,10 +37,14 @@ unsigned long physical_memsize = 0L; +@@ -36,10 +36,14 @@ unsigned long physical_memsize = 0L; */ static struct ltq_soc_info soc_info; diff --git a/target/linux/lantiq/patches-4.14/0154-lantiq-pci-bar11mask-fix.patch b/target/linux/lantiq/patches-4.19/0154-lantiq-pci-bar11mask-fix.patch similarity index 100% rename from target/linux/lantiq/patches-4.14/0154-lantiq-pci-bar11mask-fix.patch rename to target/linux/lantiq/patches-4.19/0154-lantiq-pci-bar11mask-fix.patch diff --git a/target/linux/lantiq/patches-4.14/0155-lantiq-VPE-nosmp.patch b/target/linux/lantiq/patches-4.19/0155-lantiq-VPE-nosmp.patch similarity index 100% rename from target/linux/lantiq/patches-4.14/0155-lantiq-VPE-nosmp.patch rename to target/linux/lantiq/patches-4.19/0155-lantiq-VPE-nosmp.patch diff --git a/target/linux/lantiq/patches-4.14/0160-owrt-lantiq-multiple-flash.patch b/target/linux/lantiq/patches-4.19/0160-owrt-lantiq-multiple-flash.patch similarity index 100% rename from target/linux/lantiq/patches-4.14/0160-owrt-lantiq-multiple-flash.patch rename to target/linux/lantiq/patches-4.19/0160-owrt-lantiq-multiple-flash.patch diff --git a/target/linux/lantiq/patches-4.14/0300-MTD-cfi-cmdset-0001-disable-buffered-writes.patch b/target/linux/lantiq/patches-4.19/0300-MTD-cfi-cmdset-0001-disable-buffered-writes.patch similarity index 100% rename from target/linux/lantiq/patches-4.14/0300-MTD-cfi-cmdset-0001-disable-buffered-writes.patch rename to target/linux/lantiq/patches-4.19/0300-MTD-cfi-cmdset-0001-disable-buffered-writes.patch diff --git a/target/linux/lantiq/patches-4.14/0301-xrx200-add-gphy-clk-src-device-tree-binding.patch b/target/linux/lantiq/patches-4.19/0301-xrx200-add-gphy-clk-src-device-tree-binding.patch similarity index 92% rename from target/linux/lantiq/patches-4.14/0301-xrx200-add-gphy-clk-src-device-tree-binding.patch rename to target/linux/lantiq/patches-4.19/0301-xrx200-add-gphy-clk-src-device-tree-binding.patch index ae8efcfdc..b98abe8b4 100644 --- a/target/linux/lantiq/patches-4.14/0301-xrx200-add-gphy-clk-src-device-tree-binding.patch +++ b/target/linux/lantiq/patches-4.19/0301-xrx200-add-gphy-clk-src-device-tree-binding.patch @@ -21,7 +21,7 @@ /* bring up all register ranges that we need for basic system control */ void __init ltq_soc_init(void) { -@@ -589,4 +603,6 @@ void __init ltq_soc_init(void) +@@ -587,4 +601,6 @@ void __init ltq_soc_init(void) clkdev_add_pmu("1e100400.serial", NULL, 1, 0, PMU_ASC0); } usb_set_clock(); diff --git a/target/linux/lantiq/patches-4.14/0701-NET-lantiq-etop-of-mido.patch b/target/linux/lantiq/patches-4.19/0701-NET-lantiq-etop-of-mido.patch similarity index 90% rename from target/linux/lantiq/patches-4.14/0701-NET-lantiq-etop-of-mido.patch rename to target/linux/lantiq/patches-4.19/0701-NET-lantiq-etop-of-mido.patch index 5dc4b8152..05e4ec832 100644 --- a/target/linux/lantiq/patches-4.14/0701-NET-lantiq-etop-of-mido.patch +++ b/target/linux/lantiq/patches-4.19/0701-NET-lantiq-etop-of-mido.patch @@ -8,7 +8,7 @@ #include -@@ -567,7 +568,8 @@ static int +@@ -571,7 +572,8 @@ static int ltq_etop_mdio_init(struct net_device *dev) { struct ltq_etop_priv *priv = netdev_priv(dev); @@ -18,7 +18,7 @@ priv->mii_bus = mdiobus_alloc(); if (!priv->mii_bus) { -@@ -587,7 +589,15 @@ ltq_etop_mdio_init(struct net_device *de +@@ -591,7 +593,15 @@ ltq_etop_mdio_init(struct net_device *de priv->mii_bus->name = "ltq_mii"; snprintf(priv->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x", priv->pdev->name, priv->pdev->id); diff --git a/target/linux/lantiq/xrx200/config-4.14 b/target/linux/lantiq/xrx200/config-4.19 similarity index 95% rename from target/linux/lantiq/xrx200/config-4.14 rename to target/linux/lantiq/xrx200/config-4.19 index 7b15d4283..0c14f3dad 100644 --- a/target/linux/lantiq/xrx200/config-4.14 +++ b/target/linux/lantiq/xrx200/config-4.19 @@ -16,7 +16,6 @@ CONFIG_CRYPTO_MANAGER2=y CONFIG_CRYPTO_NULL2=y CONFIG_EXTRA_FIRMWARE="lantiq/xrx200_phy11g_a14.bin lantiq/xrx200_phy11g_a22.bin lantiq/xrx200_phy22f_a14.bin lantiq/xrx200_phy22f_a22.bin" CONFIG_EXTRA_FIRMWARE_DIR="firmware" -CONFIG_FIRMWARE_IN_KERNEL=y CONFIG_HWMON=y CONFIG_ICPLUS_PHY=y CONFIG_IFX_VPE_EXT=y @@ -32,6 +31,7 @@ CONFIG_LZO_DECOMPRESS=y CONFIG_MIPS_MT=y # CONFIG_MIPS_MT_FPAFF is not set CONFIG_MIPS_MT_SMP=y +CONFIG_MIPS_NR_CPU_NR_MAP=2 CONFIG_MIPS_PERF_SHARED_TC_COUNTERS=y CONFIG_MIPS_VPE_APSP_API=y CONFIG_MIPS_VPE_APSP_API_MT=y @@ -52,11 +52,10 @@ CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_NET_FLOW_LIMIT=y CONFIG_NLS=y CONFIG_NR_CPUS=2 -CONFIG_OF_ADDRESS_PCI=y -CONFIG_OF_PCI=y -CONFIG_OF_PCI_IRQ=y CONFIG_PADATA=y CONFIG_PCI=y +# CONFIG_PCIEAER is not set +CONFIG_PCIEPORTBUS=y CONFIG_PCIE_LANTIQ=y CONFIG_PCI_DOMAINS=y CONFIG_PCI_LANTIQ=y @@ -75,6 +74,7 @@ CONFIG_RTL8366S_PHY=y CONFIG_RTL8367B_PHY=y CONFIG_RTL8367_PHY=y CONFIG_SENSORS_LTQ_CPUTEMP=y +CONFIG_SGL_ALLOC=y CONFIG_SMP=y CONFIG_SMP_UP=y CONFIG_SWCONFIG_LEDS=y diff --git a/target/linux/lantiq/xrx200/target.mk b/target/linux/lantiq/xrx200/target.mk index 4f682bf48..4d92b25bc 100644 --- a/target/linux/lantiq/xrx200/target.mk +++ b/target/linux/lantiq/xrx200/target.mk @@ -1,7 +1,7 @@ ARCH:=mips SUBTARGET:=xrx200 BOARDNAME:=XRX200 -FEATURES:=squashfs atm nand +FEATURES:=squashfs atm nand ramdisk CPU_TYPE:=24kc DEFAULT_PACKAGES+=kmod-leds-gpio \ diff --git a/target/linux/lantiq/xway/config-4.14 b/target/linux/lantiq/xway/config-4.19 similarity index 100% rename from target/linux/lantiq/xway/config-4.14 rename to target/linux/lantiq/xway/config-4.19 diff --git a/target/linux/lantiq/xway_legacy/config-4.14 b/target/linux/lantiq/xway_legacy/config-4.19 similarity index 100% rename from target/linux/lantiq/xway_legacy/config-4.14 rename to target/linux/lantiq/xway_legacy/config-4.19 diff --git a/target/linux/mvebu/patches-4.19/406-sfp-add-sfp-compatible.patch b/target/linux/mvebu/patches-4.19/406-sfp-add-sfp-compatible.patch index f800e0a49..0c6cb72cb 100644 --- a/target/linux/mvebu/patches-4.19/406-sfp-add-sfp-compatible.patch +++ b/target/linux/mvebu/patches-4.19/406-sfp-add-sfp-compatible.patch @@ -14,7 +14,7 @@ Signed-off-by: Russell King --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c -@@ -229,6 +229,7 @@ static const struct sff_data sfp_data = +@@ -230,6 +230,7 @@ static const struct sff_data sfp_data = static const struct of_device_id sfp_of_match[] = { { .compatible = "sff,sff", .data = &sff_data, }, { .compatible = "sff,sfp", .data = &sfp_data, }, diff --git a/target/linux/mvebu/patches-4.19/407-sfp-display-SFP-module-information.patch b/target/linux/mvebu/patches-4.19/407-sfp-display-SFP-module-information.patch index b78c6d8e3..854ac6876 100644 --- a/target/linux/mvebu/patches-4.19/407-sfp-display-SFP-module-information.patch +++ b/target/linux/mvebu/patches-4.19/407-sfp-display-SFP-module-information.patch @@ -10,7 +10,7 @@ Signed-off-by: Russell King --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c -@@ -1131,6 +1131,184 @@ static void sfp_hwmon_remove(struct sfp +@@ -1132,6 +1132,184 @@ static void sfp_hwmon_remove(struct sfp } #endif @@ -195,7 +195,7 @@ Signed-off-by: Russell King /* Helpers */ static void sfp_module_tx_disable(struct sfp *sfp) { -@@ -1375,6 +1553,8 @@ static int sfp_sm_mod_probe(struct sfp * +@@ -1376,6 +1554,8 @@ static int sfp_sm_mod_probe(struct sfp * { /* SFP module inserted - read I2C data */ struct sfp_eeprom_id id; @@ -204,7 +204,7 @@ Signed-off-by: Russell King bool cotsworks; u8 check; int ret; -@@ -1431,12 +1611,87 @@ static int sfp_sm_mod_probe(struct sfp * +@@ -1432,12 +1612,87 @@ static int sfp_sm_mod_probe(struct sfp * sfp->id = id; diff --git a/target/linux/mvebu/patches-4.19/408-sfp-more-cotsworks-fixes.patch b/target/linux/mvebu/patches-4.19/408-sfp-more-cotsworks-fixes.patch index f9f7aba2b..69a31cb9f 100644 --- a/target/linux/mvebu/patches-4.19/408-sfp-more-cotsworks-fixes.patch +++ b/target/linux/mvebu/patches-4.19/408-sfp-more-cotsworks-fixes.patch @@ -12,7 +12,7 @@ Signed-off-by: Russell King --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c -@@ -1570,9 +1570,9 @@ static int sfp_sm_mod_probe(struct sfp * +@@ -1571,9 +1571,9 @@ static int sfp_sm_mod_probe(struct sfp * return -EAGAIN; } @@ -25,7 +25,7 @@ Signed-off-by: Russell King */ cotsworks = !memcmp(id.base.vendor_name, "COTSWORKS ", 16); -@@ -1611,11 +1611,12 @@ static int sfp_sm_mod_probe(struct sfp * +@@ -1612,11 +1612,12 @@ static int sfp_sm_mod_probe(struct sfp * sfp->id = id; diff --git a/target/linux/mvebu/patches-4.19/450-reprobe_sfp_phy.patch b/target/linux/mvebu/patches-4.19/450-reprobe_sfp_phy.patch index bec8b4c1e..833c515a1 100644 --- a/target/linux/mvebu/patches-4.19/450-reprobe_sfp_phy.patch +++ b/target/linux/mvebu/patches-4.19/450-reprobe_sfp_phy.patch @@ -13,7 +13,7 @@ Signed-off-by: Jonas Gorski --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c -@@ -1373,7 +1373,7 @@ static void sfp_sm_phy_detach(struct sfp +@@ -1374,7 +1374,7 @@ static void sfp_sm_phy_detach(struct sfp sfp->mod_phy = NULL; } @@ -22,7 +22,7 @@ Signed-off-by: Jonas Gorski { struct phy_device *phy; int err; -@@ -1383,11 +1383,11 @@ static void sfp_sm_probe_phy(struct sfp +@@ -1384,11 +1384,11 @@ static void sfp_sm_probe_phy(struct sfp phy = mdiobus_scan(sfp->i2c_mii, SFP_PHY_ADDR); if (phy == ERR_PTR(-ENODEV)) { dev_info(sfp->dev, "no PHY detected\n"); @@ -36,7 +36,7 @@ Signed-off-by: Jonas Gorski } err = sfp_add_phy(sfp->sfp_bus, phy); -@@ -1395,11 +1395,13 @@ static void sfp_sm_probe_phy(struct sfp +@@ -1396,11 +1396,13 @@ static void sfp_sm_probe_phy(struct sfp phy_device_remove(phy); phy_device_free(phy); dev_err(sfp->dev, "sfp_add_phy failed: %d\n", err); @@ -51,7 +51,7 @@ Signed-off-by: Jonas Gorski } static void sfp_sm_link_up(struct sfp *sfp) -@@ -1463,14 +1465,9 @@ static void sfp_sm_fault(struct sfp *sfp +@@ -1464,14 +1466,9 @@ static void sfp_sm_fault(struct sfp *sfp static void sfp_sm_mod_init(struct sfp *sfp) { @@ -68,7 +68,7 @@ Signed-off-by: Jonas Gorski /* Setting the serdes link mode is guesswork: there's no * field in the EEPROM which indicates what mode should -@@ -1484,7 +1481,22 @@ static void sfp_sm_mod_init(struct sfp * +@@ -1485,7 +1482,22 @@ static void sfp_sm_mod_init(struct sfp * if (sfp->id.base.e1000_base_t || sfp->id.base.e100_base_lx || sfp->id.base.e100_base_fx)