From 3da298931bc5a20393d94d0d7f1dbf17b14cfa65 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 26 Feb 2019 22:12:35 +0800 Subject: [PATCH] kernel: bump 3.18.136, 4.9.160, 4.14.103, 4.19.25 --- include/kernel-version.mk | 16 +- package/lean/luci-app-nft-qos/Makefile | 14 + .../luasrc/controller/nft-qos.lua | 55 +++ .../luasrc/model/cbi/nft-qos/nft-qos.lua | 229 +++++++++++ .../luasrc/view/nft-qos/rate.htm | 167 ++++++++ .../luci-app-nft-qos/po/templates/nft-qos.pot | 230 +++++++++++ .../lean/luci-app-nft-qos/po/zh-cn/nft-qos.po | 244 ++++++++++++ .../lean/luci-app-nft-qos/po/zh-tw/nft-qos.po | 244 ++++++++++++ package/lean/nft-qos/Makefile | 58 +++ package/lean/nft-qos/files/lib/core.sh | 93 +++++ package/lean/nft-qos/files/lib/dynamic.sh | 89 +++++ package/lean/nft-qos/files/lib/monitor.sh | 39 ++ package/lean/nft-qos/files/lib/priority.sh | 90 +++++ package/lean/nft-qos/files/lib/static.sh | 73 ++++ .../nft-qos/files/nft-qos-dynamic.hotplug | 42 ++ .../nft-qos/files/nft-qos-monitor.hotplug | 23 ++ package/lean/nft-qos/files/nft-qos.config | 106 +++++ package/lean/nft-qos/files/nft-qos.init | 41 ++ .../140-GPIO-add-named-gpio-exports.patch | 4 +- ...vert-702b94bff3c50542a6e4ab9a4f4cef0.patch | 2 +- ...smsx95xx-fix-crimes-against-truesize.patch | 4 +- ...5-Load-driver-early-and-support-lega.patch | 8 +- .../950-0031-Update-vfpmodule.c.patch | 6 +- .../950-0037-Add-dwc_otg-driver.patch | 2 +- ...50-0056-fbdev-add-FBIOCOPYAREA-ioctl.patch | 8 +- ...o_user-and-__copy_from_user-performa.patch | 6 +- ...Fix-pitch-setup-for-T-format-scanout.patch | 2 +- ...-the-DRM_IOCTL_VC4_GEM_MADVISE-ioctl.patch | 2 +- ...el_order-instead-of-custom-.flip_cbc.patch | 2 +- ...-Set-premultiplied-for-alpha-formats.patch | 2 +- ...ck-if-plane-requires-background-fill.patch | 4 +- ...rtise-supported-modifiers-for-planes.patch | 8 +- ...ing-formats-to-vc4_format_mod_suppor.patch | 2 +- ...rm-vc4-Add-support-for-SAND-modifier.patch | 14 +- ...cm2835-Recover-from-MMC_SEND_EXT_CSD.patch | 50 --- target/linux/cns3xxx/config-4.14 | 4 +- target/linux/cns3xxx/config-4.19 | 370 ++++++++++++++++++ .../cns3xxx/patches-4.14/090-timers.patch | 6 +- .../000-cns3xxx_arch_include.patch | 9 + .../001-arm_openwrt_machtypes.patch | 10 + ...-arm_introduce-dma-fiq-irq-broadcast.patch | 80 ++++ .../patches-4.19/020-watchdog_support.patch | 184 +++++++++ .../patches-4.19/025-smp_support.patch | 30 ++ .../cns3xxx/patches-4.19/030-pcie_clock.patch | 11 + .../patches-4.19/040-fiq_support.patch | 40 ++ .../cns3xxx/patches-4.19/045-twd_base.patch | 43 ++ .../cns3xxx/patches-4.19/055-pcie_io.patch | 19 + .../cns3xxx/patches-4.19/060-pcie_abort.patch | 109 ++++++ .../patches-4.19/065-pcie_skip_inactive.patch | 11 + .../patches-4.19/070-i2c_support.patch | 31 ++ .../patches-4.19/075-spi_support.patch | 51 +++ .../patches-4.19/080-sata_support.patch | 26 ++ .../cns3xxx/patches-4.19/090-timers.patch | 105 +++++ .../093-add-virt-pci-io-mapping.patch | 41 ++ .../patches-4.19/095-gpio_support.patch | 67 ++++ .../097-l2x0_cmdline_disable.patch | 69 ++++ .../patches-4.19/100-laguna_support.patch | 46 +++ .../101-laguna_sdhci_card_detect.patch | 14 + .../110-pci_isolated_interrupts.patch | 95 +++++ ...-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch | 23 ++ .../200-broadcom_phy_reinit.patch | 15 + .../patches-4.19/210-dwc2_defaults.patch | 63 +++ ...TVE-TVC-and-ILI9322-panel-to-DIR-685.patch | 2 +- ...s-Add-the-FOTG210-USB-host-to-Gemini.patch | 2 +- ...s-gemini-dlink-dir-685-add-rtl8366rb.patch | 4 +- ...he-D-Link-DIR-685-MTD-partition-info.patch | 66 ---- ...prevent-redefinition-of-struct-ethhd.patch | 55 --- ...ulating-partition-boundaries-when-ch.patch | 4 +- ...kb_cow_head-to-deal-with-cloned-skbs.patch | 40 -- ...kb_cow_head-to-deal-with-cloned-skbs.patch | 38 -- ...kb_cow_head-to-deal-with-cloned-skbs.patch | 43 -- ...c_page_frag-to-page_frag_alloc-and-_.patch | 6 +- ...50-usb-dwc2-Remove-unnecessary-kfree.patch | 24 -- ...les-fix-mismatch-in-big-endian-syste.patch | 323 --------------- ...prevent-redefinition-of-struct-ethhd.patch | 55 --- .../generic/hack-4.14/204-module_strip.patch | 16 +- .../generic/hack-4.14/721-phy_packets.patch | 2 +- .../generic/hack-4.19/204-module_strip.patch | 16 +- .../generic/hack-4.19/721-phy_packets.patch | 2 +- .../generic/hack-4.9/204-module_strip.patch | 10 +- .../generic/hack-4.9/721-phy_packets.patch | 2 +- .../pending-3.18/204-module_strip.patch | 10 +- ...e_mem_map-with-ARCH_PFN_OFFSET-calcu.patch | 2 +- .../400-mtd-add-rootfs-split-support.patch | 6 +- ...for-different-partition-parser-types.patch | 4 +- ...arsers-for-rootfs-and-firmware-split.patch | 4 +- .../404-mtd-add-more-helper-functions.patch | 2 +- .../411-mtd-partial_eraseblock_write.patch | 2 +- .../pending-4.19/630-packet_socket_type.patch | 6 +- .../pending-4.19/834-ledtrig-libata.patch | 8 +- ...msm-fix-gpio-hog-related-boot-issues.patch | 32 -- ...ow-to-set-regulator-without-opp_list.patch | 2 +- ...rt-adjusting-OPP-voltages-at-runtime.patch | 2 +- ...e-voltage-tolerance-when-adjusting-t.patch | 4 +- ...e-scm_call-to-route-GPIO-irq-to-Apps.patch | 2 +- .../patches-4.9/160-delayed_uart_io.patch | 4 +- .../patches-4.9/600-skb_avoid_dmabounce.patch | 2 +- target/linux/kirkwood/config-4.19 | 345 ++++++++++++++++ .../kirkwood/patches-4.19/100-ib62x0.patch | 30 ++ .../kirkwood/patches-4.19/101-iconnect.patch | 50 +++ .../kirkwood/patches-4.19/102-dockstar.patch | 32 ++ .../patches-4.19/103-iomega-ix2-200.patch | 33 ++ .../kirkwood/patches-4.19/104-ea3500.patch | 259 ++++++++++++ .../kirkwood/patches-4.19/105-ea4500.patch | 126 ++++++ .../patches-4.19/105-goflexhome.patch | 130 ++++++ .../kirkwood/patches-4.19/106-goflexnet.patch | 23 ++ ...-zyxel-nsa3x0-common-nand-partitions.patch | 48 +++ .../patches-4.19/107-02-nsa310b.patch | 147 +++++++ .../kirkwood/patches-4.19/108-on100.patch | 171 ++++++++ .../patches-4.19/109-pogoplug_v4.patch | 59 +++ ...able-sata-port-specific-led-triggers.patch | 10 + .../202-linksys-find-active-root.patch | 62 +++ .../202-core-linux-support-layerscape.patch | 8 +- .../301-arch-support-layerscape.patch | 2 +- ...707-dpaa-ethernet-support-layerscape.patch | 8 +- .../807-usb-support-layerscape.patch | 6 +- .../812-flexspi-support-layerscape.patch | 4 +- .../819-sdhc-support-layerscape.patch | 10 +- .../821-smmu-support-layerscape.patch | 4 +- .../822-uart-support-layerscape.patch | 4 +- ...hc-add-voltage-switch-support-for-ls.patch | 2 +- .../patches-4.14/0033-dsa-multi-cpu.patch | 4 +- ...-usb-mtu3-support-36-bit-DMA-address.patch | 6 +- ...9-usb-mtu3-add-support-for-usb3.1-IP.patch | 4 +- ...erial-add-ugly-custom-baud-rate-hack.patch | 2 +- .../patches-4.14/0070-weak_reordering.patch | 2 +- .../patches-4.14/101-mt7621-timer.patch | 2 +- 127 files changed, 5072 insertions(+), 874 deletions(-) create mode 100644 package/lean/luci-app-nft-qos/Makefile create mode 100644 package/lean/luci-app-nft-qos/luasrc/controller/nft-qos.lua create mode 100644 package/lean/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua create mode 100644 package/lean/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm create mode 100644 package/lean/luci-app-nft-qos/po/templates/nft-qos.pot create mode 100644 package/lean/luci-app-nft-qos/po/zh-cn/nft-qos.po create mode 100644 package/lean/luci-app-nft-qos/po/zh-tw/nft-qos.po create mode 100644 package/lean/nft-qos/Makefile create mode 100644 package/lean/nft-qos/files/lib/core.sh create mode 100644 package/lean/nft-qos/files/lib/dynamic.sh create mode 100644 package/lean/nft-qos/files/lib/monitor.sh create mode 100644 package/lean/nft-qos/files/lib/priority.sh create mode 100644 package/lean/nft-qos/files/lib/static.sh create mode 100644 package/lean/nft-qos/files/nft-qos-dynamic.hotplug create mode 100644 package/lean/nft-qos/files/nft-qos-monitor.hotplug create mode 100644 package/lean/nft-qos/files/nft-qos.config create mode 100755 package/lean/nft-qos/files/nft-qos.init delete mode 100644 target/linux/brcm2708/patches-4.14/950-0434-mmc-bcm2835-Recover-from-MMC_SEND_EXT_CSD.patch create mode 100644 target/linux/cns3xxx/config-4.19 create mode 100644 target/linux/cns3xxx/patches-4.19/000-cns3xxx_arch_include.patch create mode 100644 target/linux/cns3xxx/patches-4.19/001-arm_openwrt_machtypes.patch create mode 100644 target/linux/cns3xxx/patches-4.19/010-arm_introduce-dma-fiq-irq-broadcast.patch create mode 100644 target/linux/cns3xxx/patches-4.19/020-watchdog_support.patch create mode 100644 target/linux/cns3xxx/patches-4.19/025-smp_support.patch create mode 100644 target/linux/cns3xxx/patches-4.19/030-pcie_clock.patch create mode 100644 target/linux/cns3xxx/patches-4.19/040-fiq_support.patch create mode 100644 target/linux/cns3xxx/patches-4.19/045-twd_base.patch create mode 100644 target/linux/cns3xxx/patches-4.19/055-pcie_io.patch create mode 100644 target/linux/cns3xxx/patches-4.19/060-pcie_abort.patch create mode 100644 target/linux/cns3xxx/patches-4.19/065-pcie_skip_inactive.patch create mode 100644 target/linux/cns3xxx/patches-4.19/070-i2c_support.patch create mode 100644 target/linux/cns3xxx/patches-4.19/075-spi_support.patch create mode 100644 target/linux/cns3xxx/patches-4.19/080-sata_support.patch create mode 100644 target/linux/cns3xxx/patches-4.19/090-timers.patch create mode 100644 target/linux/cns3xxx/patches-4.19/093-add-virt-pci-io-mapping.patch create mode 100644 target/linux/cns3xxx/patches-4.19/095-gpio_support.patch create mode 100644 target/linux/cns3xxx/patches-4.19/097-l2x0_cmdline_disable.patch create mode 100644 target/linux/cns3xxx/patches-4.19/100-laguna_support.patch create mode 100644 target/linux/cns3xxx/patches-4.19/101-laguna_sdhci_card_detect.patch create mode 100644 target/linux/cns3xxx/patches-4.19/110-pci_isolated_interrupts.patch create mode 100644 target/linux/cns3xxx/patches-4.19/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch create mode 100644 target/linux/cns3xxx/patches-4.19/200-broadcom_phy_reinit.patch create mode 100644 target/linux/cns3xxx/patches-4.19/210-dwc2_defaults.patch delete mode 100644 target/linux/gemini/patches-4.19/0007-ARM-dts-Fix-up-the-D-Link-DIR-685-MTD-partition-info.patch delete mode 100644 target/linux/generic/backport-4.14/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch delete mode 100644 target/linux/generic/backport-4.9/023-1-smsc95xx-Use-skb_cow_head-to-deal-with-cloned-skbs.patch delete mode 100644 target/linux/generic/backport-4.9/023-6-ch9200-use-skb_cow_head-to-deal-with-cloned-skbs.patch delete mode 100644 target/linux/generic/backport-4.9/023-7-kaweth-use-skb_cow_head-to-deal-with-cloned-skbs.patch delete mode 100644 target/linux/generic/backport-4.9/050-usb-dwc2-Remove-unnecessary-kfree.patch delete mode 100644 target/linux/generic/backport-4.9/092-netfilter-nf_tables-fix-mismatch-in-big-endian-syste.patch delete mode 100644 target/linux/generic/backport-4.9/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch create mode 100644 target/linux/kirkwood/config-4.19 create mode 100644 target/linux/kirkwood/patches-4.19/100-ib62x0.patch create mode 100644 target/linux/kirkwood/patches-4.19/101-iconnect.patch create mode 100644 target/linux/kirkwood/patches-4.19/102-dockstar.patch create mode 100644 target/linux/kirkwood/patches-4.19/103-iomega-ix2-200.patch create mode 100644 target/linux/kirkwood/patches-4.19/104-ea3500.patch create mode 100644 target/linux/kirkwood/patches-4.19/105-ea4500.patch create mode 100644 target/linux/kirkwood/patches-4.19/105-goflexhome.patch create mode 100644 target/linux/kirkwood/patches-4.19/106-goflexnet.patch create mode 100644 target/linux/kirkwood/patches-4.19/107-01-zyxel-nsa3x0-common-nand-partitions.patch create mode 100644 target/linux/kirkwood/patches-4.19/107-02-nsa310b.patch create mode 100644 target/linux/kirkwood/patches-4.19/108-on100.patch create mode 100644 target/linux/kirkwood/patches-4.19/109-pogoplug_v4.patch create mode 100644 target/linux/kirkwood/patches-4.19/201-enable-sata-port-specific-led-triggers.patch create mode 100644 target/linux/kirkwood/patches-4.19/202-linksys-find-active-root.patch diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 2edc5af21..5f3dbf23b 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -2,15 +2,15 @@ LINUX_RELEASE?=1 -LINUX_VERSION-3.18 = .134 -LINUX_VERSION-4.9 = .155 -LINUX_VERSION-4.14 = .98 -LINUX_VERSION-4.19 = .20 +LINUX_VERSION-3.18 = .136 +LINUX_VERSION-4.9 = .160 +LINUX_VERSION-4.14 = .103 +LINUX_VERSION-4.19 = .25 -LINUX_KERNEL_HASH-3.18.134 = 36bdd04cab3b6c824a4b7e32ae02503f437e0916d5a4ff04c90aa22da2749c2f -LINUX_KERNEL_HASH-4.9.155 = a52ac60be33c0fe312d99361f8e30211599956e958ba415d93194c6c9d073c9d -LINUX_KERNEL_HASH-4.14.98 = 8f021171b1b1efb41326e603116a45126fc030d06aaa9b0784ae612323010c5f -LINUX_KERNEL_HASH-4.19.20 = dc7d2776dad4bf738e741ed05e7d1bea685855cfb7a62d1706f5f7aeabfa04a4 +LINUX_KERNEL_HASH-3.18.136 = 48c8775013d23229462134f911bbb14c7935096fcccfb19ce28ecd5f7154f35c +LINUX_KERNEL_HASH-4.9.160 = c09af067af62d299f5e33c279968de58c88fb7c59bd05e8f3bb460f611f60515 +LINUX_KERNEL_HASH-4.14.103 = 7aa43e34e4c9e5965da29cef5ae196e06006f8c0d1d65fd755a2f197f0796a11 +LINUX_KERNEL_HASH-4.19.25 = 7ec71d90d6e96e6f741676d157ac06f30c75be4eaf1649143a3c8b7d4f919731 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/package/lean/luci-app-nft-qos/Makefile b/package/lean/luci-app-nft-qos/Makefile new file mode 100644 index 000000000..8349e775f --- /dev/null +++ b/package/lean/luci-app-nft-qos/Makefile @@ -0,0 +1,14 @@ +# +# Copyright (C) 2008-2014 The LuCI Team +# +# This is free software, licensed under the Apache License, Version 2.0 . +# + +include $(TOPDIR)/rules.mk + +LUCI_TITLE:=Qos over Nftables +LUCI_DEPENDS:=+nft-qos + +include $(TOPDIR)/feeds/luci/luci.mk + +# call BuildPackage - OpenWrt buildroot signature diff --git a/package/lean/luci-app-nft-qos/luasrc/controller/nft-qos.lua b/package/lean/luci-app-nft-qos/luasrc/controller/nft-qos.lua new file mode 100644 index 000000000..637eb1173 --- /dev/null +++ b/package/lean/luci-app-nft-qos/luasrc/controller/nft-qos.lua @@ -0,0 +1,55 @@ +-- Copyright 2018 Rosy Song +-- Licensed to the public under the Apache License 2.0. + +module("luci.controller.nft-qos", package.seeall) + +function index() + if not nixio.fs.access("/etc/config/nft-qos") then + return + end + + entry({"admin", "status", "realtime", "rate"}, + template("nft-qos/rate"), _("Rate"), 5).leaf = true + entry({"admin", "status", "realtime", "rate_status"}, + call("action_rate")).leaf = true + entry({"admin", "services", "nft-qos"}, cbi("nft-qos/nft-qos"), + _("Qos over Nftables"), 60) +end + +function _action_rate(rv, n) + local c = nixio.fs.access("/proc/net/ipv6_route") and + io.popen("nft list chain inet nft-qos-monitor " .. n .. " 2>/dev/null") or + io.popen("nft list chain ip nft-qos-monitor " .. n .. " 2>/dev/null") + + if c then + for l in c:lines() do + local _, i, p, b = l:match( + '^%s+ip ([^%s]+) ([^%s]+) counter packets (%d+) bytes (%d+)' + ) + if i and p and b then + -- handle expression + rv[#rv + 1] = { + rule = { + family = "inet", + table = "nft-qos-monitor", + chain = n, + handle = 0, + expr = { + { match = { right = i } }, + { counter = { packets = p, bytes = b } } + } + } + } + end + end + c:close() + end +end + +function action_rate() + luci.http.prepare_content("application/json") + local data = { nftables = {} } + _action_rate(data.nftables, "upload") + _action_rate(data.nftables, "download") + luci.http.write_json(data) +end diff --git a/package/lean/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua b/package/lean/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua new file mode 100644 index 000000000..61a6d76a7 --- /dev/null +++ b/package/lean/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua @@ -0,0 +1,229 @@ +-- Copyright 2018 Rosy Song +-- Licensed to the public under the Apache License 2.0. + +local uci = require("luci.model.uci").cursor() +local wa = require("luci.tools.webadmin") +local fs = require("nixio.fs") +local ipc = require("luci.ip") + +local def_rate_dl = uci:get("nft-qos", "default", "static_rate_dl") +local def_rate_ul = uci:get("nft-qos", "default", "static_rate_ul") +local def_unit_dl = uci:get("nft-qos", "default", "static_unit_dl") +local def_unit_ul = uci:get("nft-qos", "default", "static_unit_ul") + +local def_up = uci:get("nft-qos", "default", "dynamic_bw_up") +local def_down = uci:get("nft-qos", "default", "dynamic_bw_down") + +local limit_enable = uci:get("nft-qos", "default", "limit_enable") +local limit_type = uci:get("nft-qos", "default", "limit_type") +local enable_priority = uci:get("nft-qos", "default", "priority_enable") + +local has_ipv6 = fs.access("/proc/net/ipv6_route") + +m = Map("nft-qos", translate("Qos over Nftables")) + +-- +-- Taboptions +-- +s = m:section(TypedSection, "default", translate("NFT-QoS Settings")) +s.addremove = false +s.anonymous = true + +s:tab("limit", "Limit Rate") +s:tab("priority", "Traffic Priority") + +-- +-- Static +-- +o = s:taboption("limit", Flag, "limit_enable", translate("Limit Enable"), translate("Enable Limit Rate Feature")) +o.default = limit_enable or o.enabled +o.rmempty = false + +o = s:taboption("limit", ListValue, "limit_type", translate("Limit Type"), translate("Type of Limit Rate")) +o.default = limit_static or "static" +o:depends("limit_enable","1") +o:value("static", "Static") +o:value("dynamic", "Dynamic") + +o = s:taboption("limit", Value, "static_rate_dl", translate("Default Download Rate"), translate("Default value for download rate")) +o.datatype = "uinteger" +o.default = def_rate_dl or '50' +o:depends("limit_type","static") + +o = s:taboption("limit", ListValue, "static_unit_dl", translate("Default Download Unit"), translate("Default unit for download rate")) +o.default = def_unit_dl or "kbytes" +o:depends("limit_type","static") +o:value("bytes", "Bytes/s") +o:value("kbytes", "KBytes/s") +o:value("mbytes", "MBytes/s") + +o = s:taboption("limit", Value, "static_rate_ul", translate("Default Upload Rate"), translate("Default value for upload rate")) +o.datatype = "uinteger" +o.default = def_rate_ul or '50' +o:depends("limit_type","static") + +o = s:taboption("limit", ListValue, "static_unit_ul", translate("Default Upload Unit"), translate("Default unit for upload rate")) +o.default = def_unit_ul or "kbytes" +o:depends("limit_type","static") +o:value("bytes", "Bytes/s") +o:value("kbytes", "KBytes/s") +o:value("mbytes", "MBytes/s") + +-- +-- Dynamic +-- +o = s:taboption("limit", Value, "dynamic_bw_down", translate("Download Bandwidth (Mbps)"), translate("Default value for download bandwidth")) +o.default = def_up or '100' +o.datatype = "uinteger" +o:depends("limit_type","dynamic") + +o = s:taboption("limit", Value, "dynamic_bw_up", translate("Upload Bandwidth (Mbps)"), translate("Default value for upload bandwidth")) +o.default = def_down or '100' +o.datatype = "uinteger" +o:depends("limit_type","dynamic") + +o = s:taboption("limit", Value, "dynamic_cidr", translate("Target Network (IPv4/MASK)"), translate("Network to be apply, e.g. 192.168.1.0/24, 10.2.0.0/16, etc")) +o.datatype = "cidr4" +ipc.routes({ family = 4, type = 1 }, function(rt) o.default = rt.dest end) +o:depends("limit_type","dynamic") + +if has_ipv6 then + o = s:taboption("limit", Value, "dynamic_cidr6", translate("Target Network6 (IPv6/MASK)"), translate("Network to be apply, e.g. AAAA::BBBB/64, CCCC::1/128, etc")) + o.datatype = "cidr6" + o:depends("limit_type","dynamic") +end + +o = s:taboption("limit", DynamicList, "limit_whitelist", translate("White List for Limit Rate")) +o.datatype = "ipaddr" +o:depends("limit_enable","1") + +-- +-- Priority +-- +o = s:taboption("priority", Flag, "priority_enable", translate("Enable Traffic Priority"), translate("Enable this feature")) +o.default = enable_priority or o.enabled +o.rmempty = false + +o = s:taboption("priority", ListValue, "priority_netdev", translate("Default Network Interface"), translate("Network Interface for Traffic Shaping, e.g. br-lan, eth0.1, eth0, etc")) +o:depends("priority_enable", "1") +wa.cbi_add_networks(o) + +-- +-- Static Limit Rate - Download Rate +-- +if limit_enable == "1" and limit_type == "static" then + +x = m:section(TypedSection, "download", translate("Static QoS-Download Rate")) +x.anonymous = true +x.addremove = true +x.template = "cbi/tblsection" + +o = x:option(Value, "hostname", translate("Hostname")) +o.datatype = "hostname" +o.default = 'undefined' + +if has_ipv6 then + o = x:option(Value, "ipaddr", translate("IP Address(V4 / V6)")) +else + o = x:option(Value, "ipaddr", translate("IP Address(V4 Only)")) +end +o.datatype = "ipaddr" +if nixio.fs.access("/tmp/dhcp.leases") or nixio.fs.access("/var/dhcp6.leases") then + o.titleref = luci.dispatcher.build_url("admin", "status", "overview") +end + +o = x:option(Value, "macaddr", translate("MAC (optional)")) +o.rmempty = true +o.datatype = "macaddr" + +o = x:option(Value, "rate", translate("Rate")) +o.default = def_rate_dl or '50' +o.size = 4 +o.datatype = "uinteger" + +o = x:option(ListValue, "unit", translate("Unit")) +o.default = def_unit_dl or "kbytes" +o:value("bytes", "Bytes/s") +o:value("kbytes", "KBytes/s") +o:value("mbytes", "MBytes/s") + +-- +-- Static Limit Rate - Upload Rate +-- +y = m:section(TypedSection, "upload", translate("Static QoS-Upload Rate")) +y.anonymous = true +y.addremove = true +y.template = "cbi/tblsection" + +o = y:option(Value, "hostname", translate("Hostname")) +o.datatype = "hostname" +o.default = 'undefined' + +if has_ipv6 then + o = y:option(Value, "ipaddr", translate("IP Address(V4 / V6)")) +else + o = y:option(Value, "ipaddr", translate("IP Address(V4 Only)")) +end +o.datatype = "ipaddr" +if nixio.fs.access("/tmp/dhcp.leases") or nixio.fs.access("/var/dhcp6.leases") then + o.titleref = luci.dispatcher.build_url("admin", "status", "overview") +end + +o = y:option(Value, "macaddr", translate("MAC (optional)")) +o.rmempty = true +o.datatype = "macaddr" + +o = y:option(Value, "rate", translate("Rate")) +o.default = def_rate_ul or '50' +o.size = 4 +o.datatype = "uinteger" + +o = y:option(ListValue, "unit", translate("Unit")) +o.default = def_unit_ul or "kbytes" +o:value("bytes", "Bytes/s") +o:value("kbytes", "KBytes/s") +o:value("mbytes", "MBytes/s") + +end + +-- +-- Traffic Priority Settings +-- +if enable_priority == "1" then + +s = m:section(TypedSection, "priority", translate("Traffic Priority Settings")) +s.anonymous = true +s.addremove = true +s.template = "cbi/tblsection" + +o = s:option(ListValue, "protocol", translate("Protocol")) +o.default = "tcp" +o:value("tcp", "TCP") +o:value("udp", "UDP") +o:value("udplite", "UDP-Lite") +o:value("sctp", "SCTP") +o:value("dccp", "DCCP") + +o = s:option(ListValue, "priority", translate("Priority")) +o.default = "1" +o:value("-400", "1") +o:value("-300", "2") +o:value("-225", "3") +o:value("-200", "4") +o:value("-150", "5") +o:value("-100", "6") +o:value("0", "7") +o:value("50", "8") +o:value("100", "9") +o:value("225", "10") +o:value("300", "11") + +o = s:option(Value, "service", translate("Service"), translate("e.g. https, 23, (separator is comma)")) +o.default = '?' + +o = s:option(Value, "comment", translate("Comment")) +o.default = '?' + +end + +return m diff --git a/package/lean/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm b/package/lean/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm new file mode 100644 index 000000000..5f9cb57d2 --- /dev/null +++ b/package/lean/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm @@ -0,0 +1,167 @@ +<%# + Copyright 2018 Rosy Song + Licensed to the public under the Apache License 2.0. +-%> + +<%+header%> + + + +

<%:Realtime Rate%>

+ +
<%:This page gives an overview over currently download/upload rate.%>
+ +
+ <%:Realtime Download Rate%> +
+
+
+
<%:IP Address%>
+
<%:Download Rate%>
+
<%:Bytes Total%>
+
<%:Packets Total%>
+
+
+
+ <%:Collecting data...%> +
+
+
+
+
+ +
+ <%:Realtime Upload Rate%> +
+
+
+
<%:IP Address%>
+
<%:Upload Rate%>
+
<%:Bytes Total%>
+
<%:Packets Total%>
+
+
+
+ <%:Collecting data...%> +
+
+
+
+
+ +<%+footer%> diff --git a/package/lean/luci-app-nft-qos/po/templates/nft-qos.pot b/package/lean/luci-app-nft-qos/po/templates/nft-qos.pot new file mode 100644 index 000000000..8fecfa073 --- /dev/null +++ b/package/lean/luci-app-nft-qos/po/templates/nft-qos.pot @@ -0,0 +1,230 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:136 +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:155 +msgid "Bytes Total" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:141 +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:160 +msgid "Collecting data..." +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:224 +msgid "Comment" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:48 +msgid "Default Download Rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:53 +msgid "Default Download Unit" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:107 +msgid "Default Network Interface" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:60 +msgid "Default Upload Rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:65 +msgid "Default Upload Unit" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:53 +msgid "Default unit for download rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:65 +msgid "Default unit for upload rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:75 +msgid "Default value for download bandwidth" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:48 +msgid "Default value for download rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:80 +msgid "Default value for upload bandwidth" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:60 +msgid "Default value for upload rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:75 +msgid "Download Bandwidth (Mbps)" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:135 +msgid "Download Rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:38 +msgid "Enable Limit Rate Feature" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:103 +msgid "Enable Traffic Priority" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:103 +msgid "Enable this feature" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:121 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:158 +msgid "Hostname" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:134 +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:153 +msgid "IP Address" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:126 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:163 +msgid "IP Address(V4 / V6)" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:128 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:165 +msgid "IP Address(V4 Only)" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:38 +msgid "Limit Enable" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:42 +msgid "Limit Type" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:135 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:172 +msgid "MAC (optional)" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:48 +msgid "MB" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:28 +msgid "NFT-QoS Settings" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:107 +msgid "Network Interface for Traffic Shaping, e.g. br-lan, eth0.1, eth0, etc" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:85 +msgid "Network to be apply, e.g. 192.168.1.0/24, 10.2.0.0/16, etc" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:91 +msgid "Network to be apply, e.g. AAAA::BBBB/64, CCCC::1/128, etc" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:65 +msgid "No information available" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:137 +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:156 +msgid "Packets Total" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:207 +msgid "Priority" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:199 +msgid "Protocol" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/controller/nft-qos.lua:16 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:23 +msgid "Qos over Nftables" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/controller/nft-qos.lua:12 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:139 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:176 +msgid "Rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:130 +msgid "Realtime Download Rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:125 +msgid "Realtime Rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:149 +msgid "Realtime Upload Rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:221 +msgid "Service" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:116 +msgid "Static QoS-Download Rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:153 +msgid "Static QoS-Upload Rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:85 +msgid "Target Network (IPv4/MASK)" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:91 +msgid "Target Network6 (IPv6/MASK)" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:127 +msgid "This page gives an overview over currently download/upload rate." +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:194 +msgid "Traffic Priority Settings" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:42 +msgid "Type of Limit Rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:144 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:181 +msgid "Unit" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:80 +msgid "Upload Bandwidth (Mbps)" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:154 +msgid "Upload Rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:96 +msgid "White List for Limit Rate" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:221 +msgid "e.g. https, 23, (separator is comma)" +msgstr "" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:44 +msgid "kB" +msgstr "" diff --git a/package/lean/luci-app-nft-qos/po/zh-cn/nft-qos.po b/package/lean/luci-app-nft-qos/po/zh-cn/nft-qos.po new file mode 100644 index 000000000..73ce11f5d --- /dev/null +++ b/package/lean/luci-app-nft-qos/po/zh-cn/nft-qos.po @@ -0,0 +1,244 @@ +# +# Yangfl , 2019. +# +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: 2019-01-03 22:28+0800\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Gtranslator 3.30.1\n" +"Last-Translator: Yangfl \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"Language: zh_CN\n" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:136 +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:155 +msgid "Bytes Total" +msgstr "字节总数" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:141 +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:160 +msgid "Collecting data..." +msgstr "正在收集数据…" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:224 +msgid "Comment" +msgstr "注释" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:48 +msgid "Default Download Rate" +msgstr "默认下载速率" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:53 +msgid "Default Download Unit" +msgstr "默认下载速率单位" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:107 +msgid "Default Network Interface" +msgstr "默认网络接口" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:60 +msgid "Default Upload Rate" +msgstr "默认上传速率" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:65 +msgid "Default Upload Unit" +msgstr "默认上传速率单位" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:53 +msgid "Default unit for download rate" +msgstr "默认的下载速率单位" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:65 +msgid "Default unit for upload rate" +msgstr "默认的上传速率单位" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:75 +msgid "Default value for download bandwidth" +msgstr "下载带宽的默认值" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:48 +msgid "Default value for download rate" +msgstr "下载速率的默认值" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:80 +msgid "Default value for upload bandwidth" +msgstr "上传带宽的默认值" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:60 +msgid "Default value for upload rate" +msgstr "上传速率的默认值" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:75 +msgid "Download Bandwidth (Mbps)" +msgstr "下载带宽(Mbps)" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:135 +msgid "Download Rate" +msgstr "下载速率" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:38 +msgid "Enable Limit Rate Feature" +msgstr "开启速率限制功能" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:103 +msgid "Enable Traffic Priority" +msgstr "开启流量优先级" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:103 +msgid "Enable this feature" +msgstr "开启这个功能" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:121 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:158 +msgid "Hostname" +msgstr "主机名" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:134 +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:153 +msgid "IP Address" +msgstr "IP 地址" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:126 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:163 +msgid "IP Address(V4 / V6)" +msgstr "IP 地址(V4 / V6)" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:128 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:165 +msgid "IP Address(V4 Only)" +msgstr "IP 地址(仅 V4)" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:38 +msgid "Limit Enable" +msgstr "限速开启" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:42 +msgid "Limit Type" +msgstr "限速类型" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:135 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:172 +msgid "MAC (optional)" +msgstr "物理地址(可选)" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:48 +msgid "MB" +msgstr "MB" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:28 +msgid "NFT-QoS Settings" +msgstr "NFT-QoS 设置" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:107 +msgid "Network Interface for Traffic Shaping, e.g. br-lan, eth0.1, eth0, etc" +msgstr "流量整形的目标网络接口,例如br-lan、eth0.1、eth0等" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:85 +msgid "Network to be apply, e.g. 192.168.1.0/24, 10.2.0.0/16, etc" +msgstr "将要应用规则的网络,例如192.168.1.0/24、10.2.0.0/16等" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:91 +msgid "Network to be apply, e.g. AAAA::BBBB/64, CCCC::1/128, etc" +msgstr "将要应用规则的网络,例如AAAA::BBBB/64、CCCC::1/128等" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:65 +msgid "No information available" +msgstr "没有更多的信息" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:137 +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:156 +msgid "Packets Total" +msgstr "数据包总数" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:207 +msgid "Priority" +msgstr "优先级" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:199 +msgid "Protocol" +msgstr "协议" + +#: applications/luci-app-nft-qos/luasrc/controller/nft-qos.lua:16 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:23 +msgid "Qos over Nftables" +msgstr "QoS Nftables 版" + +#: applications/luci-app-nft-qos/luasrc/controller/nft-qos.lua:12 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:139 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:176 +msgid "Rate" +msgstr "速率" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:130 +msgid "Realtime Download Rate" +msgstr "实时下载速率" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:125 +msgid "Realtime Rate" +msgstr "实时速率显示" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:149 +msgid "Realtime Upload Rate" +msgstr "实时上传速率" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:221 +msgid "Service" +msgstr "服务" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:116 +msgid "Static QoS-Download Rate" +msgstr "静态 QoS-下载速率" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:153 +msgid "Static QoS-Upload Rate" +msgstr "静态 QoS-上传速率" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:85 +msgid "Target Network (IPv4/MASK)" +msgstr "目标网络(IPv4 地址/掩码)" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:91 +msgid "Target Network6 (IPv6/MASK)" +msgstr "目标网络 v6(IPv6 地址/掩码)" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:127 +msgid "This page gives an overview over currently download/upload rate." +msgstr "该页面提供了当前上传和下载速率的一个总览。" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:194 +msgid "Traffic Priority Settings" +msgstr "流量优先级设置" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:42 +msgid "Type of Limit Rate" +msgstr "限速的类型" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:144 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:181 +msgid "Unit" +msgstr "单位" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:80 +msgid "Upload Bandwidth (Mbps)" +msgstr "上传带宽(Mbps)" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:154 +msgid "Upload Rate" +msgstr "上传速率" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:96 +msgid "White List for Limit Rate" +msgstr "限速白名单" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:221 +msgid "e.g. https, 23, (separator is comma)" +msgstr "例如https, 23(用逗号分隔)" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:44 +msgid "kB" +msgstr "kB" diff --git a/package/lean/luci-app-nft-qos/po/zh-tw/nft-qos.po b/package/lean/luci-app-nft-qos/po/zh-tw/nft-qos.po new file mode 100644 index 000000000..5be9d8abf --- /dev/null +++ b/package/lean/luci-app-nft-qos/po/zh-tw/nft-qos.po @@ -0,0 +1,244 @@ +# +# Yangfl , 2019. +# +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: 2019-01-03 22:28+0800\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Gtranslator 3.30.1\n" +"Last-Translator: Yangfl \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"Language: zh_TW\n" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:136 +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:155 +msgid "Bytes Total" +msgstr "位元組總數" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:141 +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:160 +msgid "Collecting data..." +msgstr "正在收集資料…" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:224 +msgid "Comment" +msgstr "註釋" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:48 +msgid "Default Download Rate" +msgstr "預設下載速率" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:53 +msgid "Default Download Unit" +msgstr "預設下載速率單位" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:107 +msgid "Default Network Interface" +msgstr "預設網路介面" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:60 +msgid "Default Upload Rate" +msgstr "預設上傳速率" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:65 +msgid "Default Upload Unit" +msgstr "預設上傳速率單位" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:53 +msgid "Default unit for download rate" +msgstr "預設的下載速率單位" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:65 +msgid "Default unit for upload rate" +msgstr "預設的上傳速率單位" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:75 +msgid "Default value for download bandwidth" +msgstr "下載頻寬的預設值" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:48 +msgid "Default value for download rate" +msgstr "下載速率的預設值" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:80 +msgid "Default value for upload bandwidth" +msgstr "上傳頻寬的預設值" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:60 +msgid "Default value for upload rate" +msgstr "上傳速率的預設值" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:75 +msgid "Download Bandwidth (Mbps)" +msgstr "下載頻寬(Mbps)" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:135 +msgid "Download Rate" +msgstr "下載速率" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:38 +msgid "Enable Limit Rate Feature" +msgstr "開啟速率限制功能" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:103 +msgid "Enable Traffic Priority" +msgstr "開啟流量優先順序" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:103 +msgid "Enable this feature" +msgstr "開啟這個功能" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:121 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:158 +msgid "Hostname" +msgstr "主機名" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:134 +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:153 +msgid "IP Address" +msgstr "IP 位址" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:126 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:163 +msgid "IP Address(V4 / V6)" +msgstr "IP 位址(V4 / V6)" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:128 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:165 +msgid "IP Address(V4 Only)" +msgstr "IP 位址(僅 V4)" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:38 +msgid "Limit Enable" +msgstr "限速開啟" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:42 +msgid "Limit Type" +msgstr "限速型別" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:135 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:172 +msgid "MAC (optional)" +msgstr "實體位址(可選)" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:48 +msgid "MB" +msgstr "MB" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:28 +msgid "NFT-QoS Settings" +msgstr "NFT-QoS 設定" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:107 +msgid "Network Interface for Traffic Shaping, e.g. br-lan, eth0.1, eth0, etc" +msgstr "流量整形的目標網路介面,例如br-lan、eth0.1、eth0等" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:85 +msgid "Network to be apply, e.g. 192.168.1.0/24, 10.2.0.0/16, etc" +msgstr "將要應用規則的網路,例如192.168.1.0/24、10.2.0.0/16等" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:91 +msgid "Network to be apply, e.g. AAAA::BBBB/64, CCCC::1/128, etc" +msgstr "將要應用規則的網路,例如AAAA::BBBB/64、CCCC::1/128等" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:65 +msgid "No information available" +msgstr "沒有更多的資訊" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:137 +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:156 +msgid "Packets Total" +msgstr "資料包總數" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:207 +msgid "Priority" +msgstr "優先順序" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:199 +msgid "Protocol" +msgstr "協議" + +#: applications/luci-app-nft-qos/luasrc/controller/nft-qos.lua:16 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:23 +msgid "Qos over Nftables" +msgstr "QoS Nftables 版" + +#: applications/luci-app-nft-qos/luasrc/controller/nft-qos.lua:12 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:139 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:176 +msgid "Rate" +msgstr "速率" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:130 +msgid "Realtime Download Rate" +msgstr "實時下載速率" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:125 +msgid "Realtime Rate" +msgstr "實時速率顯示" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:149 +msgid "Realtime Upload Rate" +msgstr "實時上傳速率" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:221 +msgid "Service" +msgstr "服務" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:116 +msgid "Static QoS-Download Rate" +msgstr "靜態 QoS-下載速率" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:153 +msgid "Static QoS-Upload Rate" +msgstr "靜態 QoS-上傳速率" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:85 +msgid "Target Network (IPv4/MASK)" +msgstr "目標網路(IPv4 位址/掩碼)" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:91 +msgid "Target Network6 (IPv6/MASK)" +msgstr "目標網路 v6(IPv6 位址/掩碼)" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:127 +msgid "This page gives an overview over currently download/upload rate." +msgstr "該頁面提供了當前上傳和下載速率的一個總覽。" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:194 +msgid "Traffic Priority Settings" +msgstr "流量優先順序設定" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:42 +msgid "Type of Limit Rate" +msgstr "限速的型別" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:144 +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:181 +msgid "Unit" +msgstr "單位" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:80 +msgid "Upload Bandwidth (Mbps)" +msgstr "上傳頻寬(Mbps)" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:154 +msgid "Upload Rate" +msgstr "上傳速率" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:96 +msgid "White List for Limit Rate" +msgstr "限速白名單" + +#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:221 +msgid "e.g. https, 23, (separator is comma)" +msgstr "例如https, 23(用逗號分隔)" + +#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:44 +msgid "kB" +msgstr "kB" diff --git a/package/lean/nft-qos/Makefile b/package/lean/nft-qos/Makefile new file mode 100644 index 000000000..61361c154 --- /dev/null +++ b/package/lean/nft-qos/Makefile @@ -0,0 +1,58 @@ +# +# Copyright (C) 2018 rosysong@rosinson.com +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=nft-qos +PKG_VERSION:=1.0.4 +PKG_RELEASE:=1 +PKG_LICENSE:=GPL-2.0 + +PKG_MAINTAINER:=Rosy Song + +PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/nft-qos + SECTION:=utils + CATEGORY:=Base system + DEPENDS:=+nftables +kmod-nft-netdev +kmod-nft-bridge + TITLE:=QoS scripts over nftables +endef + +define Package/nft-qos/description + This package provides implementation for qos over nftables. + Currently, static/dynamic qos and traffic shaping are supported. +endef + +define Package/nft-qos/conffiles +/etc/config/nft-qos +endef + +define Build/Prepare +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/nft-qos/install + $(INSTALL_DIR) $(1)/lib/nft-qos + $(INSTALL_DATA) ./files/lib/* $(1)/lib/nft-qos/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/nft-qos.config $(1)/etc/config/nft-qos + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/nft-qos.init $(1)/etc/init.d/nft-qos + $(INSTALL_DIR) $(1)/etc/hotplug.d/dhcp + $(INSTALL_BIN) ./files/nft-qos-monitor.hotplug $(1)/etc/hotplug.d/dhcp/00-nft-qos-monitor + $(INSTALL_BIN) ./files/nft-qos-dynamic.hotplug $(1)/etc/hotplug.d/dhcp/01-nft-qos-dynamic +endef + +$(eval $(call BuildPackage,nft-qos)) diff --git a/package/lean/nft-qos/files/lib/core.sh b/package/lean/nft-qos/files/lib/core.sh new file mode 100644 index 000000000..d3c9d641f --- /dev/null +++ b/package/lean/nft-qos/files/lib/core.sh @@ -0,0 +1,93 @@ +#!/bin/sh +# +# Copyright (C) 2018 rosysong@rosinson.com +# + +# for uci_validate_section() +. /lib/functions/procd.sh + +NFT_QOS_HAS_BRIDGE= +NFT_QOS_INET_FAMILY=ip +NFT_QOS_SCRIPT_TEXT= +NFT_QOS_SCRIPT_FILE=/tmp/qos.nft + +qosdef_appendx() { # + NFT_QOS_SCRIPT_TEXT="$NFT_QOS_SCRIPT_TEXT""$1" +} + +qosdef_append_chain_def() { # + qosdef_appendx "\t\ttype $1 hook $2 priority $3; policy $4;\n" +} + +qosdef_append_chain_ingress() { # + qosdef_appendx "\t\ttype $1 hook ingress device $2 priority $3; policy $4;\n" +} + +# qosdef_append_rule_{MATCH}_{STATEMENT} +qosdef_append_rule_ip_limit() { # + local ipaddr=$1 + local operator=$2 + local unit=$3 + local rate=$4 + + qosdef_appendx \ + "\t\tip $operator $ipaddr limit rate over $rate $unit/second drop\n" +} + +# qosdef_append_rule_{MATCH}_{POLICY} +qosdef_append_rule_ip_policy() { # + qosdef_appendx "\t\tip $1 $2 $3\n" +} + +_handle_limit_whitelist() { # + local ipaddr=$1 + local operator + + [ -z "$ipaddr" ] && return + + case "$2" in + download) operator="daddr";; + upload) operator="saddr";; + esac + + qosdef_append_rule_ip_policy $operator $ipaddr accept +} + +qosdef_append_rule_limit_whitelist() { # + config_list_foreach default limit_whitelist _handle_limit_whitelist $1 +} + +qosdef_flush_table() { # + nft flush table $1 $2 2>/dev/null +} + +qosdef_remove_table() { #
+ nft delete table $1 $2 2>/dev/null +} + +qosdef_init_header() { # add header for nft script + qosdef_appendx "#!/usr/sbin/nft -f\n" + qosdef_appendx "# Copyright (C) 2018 rosysong@rosinson.com\n" + qosdef_appendx "#\n\n" +} + +qosdef_init_env() { + # check interface type of lan + local lt="$(uci_get "network.lan.type")" + [ "$lt" = "bridge" ] && export NFT_QOS_HAS_BRIDGE="y" + + # check if ipv6 support + [ -e /proc/sys/net/ipv6 ] && export NFT_QOS_INET_FAMILY="inet" +} + +qosdef_clean_cache() { + rm -f $NFT_QOS_SCRIPT_FILE +} + +qosdef_init_done() { + echo -e $NFT_QOS_SCRIPT_TEXT > $NFT_QOS_SCRIPT_FILE 2>/dev/null +} + +qosdef_start() { + nft -f $NFT_QOS_SCRIPT_FILE 2>/dev/null +} diff --git a/package/lean/nft-qos/files/lib/dynamic.sh b/package/lean/nft-qos/files/lib/dynamic.sh new file mode 100644 index 000000000..a3032086f --- /dev/null +++ b/package/lean/nft-qos/files/lib/dynamic.sh @@ -0,0 +1,89 @@ +#!/bin/sh +# +# Copyright (C) 2018 rosysong@rosinson.com +# + +. /lib/nft-qos/core.sh + +# return average rate for dhcp leases +qosdef_dynamic_rate() { # + local c=0 c6=0 + + [ ! -e /tmp/dhcp.leases -a \ + ! -e /var/dhcp6.leases ] && return + + [ -e /tmp/dhcp.leases ] && \ + c=$(wc -l < /tmp/dhcp.leases 2>/dev/null) + [ -e /var/dhcp6.leases ] && \ + c6=$(wc -l < /var/dhcp6.leases 2>/dev/null) + [ $c -eq 0 -a $c6 -eq 0 ] && \ + { echo 12500; return; } + + echo $(($1 / ($c + $c6))) +} + +qosdef_append_chain_dym() { # + local cidr cidr6 + local operator rate + local hook=$1 name=$2 bandwidth=$3 + + config_get cidr default 'dynamic_cidr' + config_get cidr6 default 'dynamic_cidr6' + + [ -z "$cidr" -a -z "$cidr6" ] && return + + case "$2" in + download) operator=daddr;; + upload) operator=saddr;; + esac + + rate=$(qosdef_dynamic_rate $bandwidth) + + qosdef_appendx "\tchain $name {\n" + qosdef_append_chain_def filter $hook 0 accept + qosdef_append_rule_limit_whitelist $name + [ -n "$cidr" ] && \ + qosdef_append_rule_ip_limit $cidr $operator kbytes $rate + [ -n "$cidr6" ] && \ + qosdef_append_rule_ip_limit $cidr6 $operator kbytes $rate + qosdef_appendx "\t}\n" +} + +qosdef_flush_dynamic() { + qosdef_flush_table "$NFT_QOS_INET_FAMILY" nft-qos-dynamic +} + +# init dynamic qos +qosdef_init_dynamic() { + local dynamic_bw_up dynamic_bw_down limit_enable limit_type + local hook_ul="prerouting" hook_dl="postrouting" + + uci_validate_section nft-qos default default \ + 'limit_enable:bool:0' \ + 'limit_type:maxlength(8)' \ + 'dynamic_bw_up:uinteger:100' \ + 'dynamic_bw_down:uinteger:100' + + [ $? -ne 0 ] && { + logger -t nft-qos-dynamic "validation failed" + return 1 + } + + [ $limit_enable -eq 0 -o \ + "$limit_type" = "static" ] && return 1 + + # Transfer mbits/s to mbytes/s + # e.g. 100,000 kbits == 12,500 kbytes + dynamic_bw_up=$(($dynamic_bw_up * 1000 / 8)) + dynamic_bw_down=$(($dynamic_bw_down * 1000 / 8)) + + [ -z "$NFT_QOS_HAS_BRIDGE" ] && { + hook_ul="postrouting" + hook_dl="prerouting" + } + + qosdef_appendx "table $NFT_QOS_INET_FAMILY nft-qos-dynamic {\n" + qosdef_append_chain_dym $hook_ul upload $dynamic_bw_up + qosdef_append_chain_dym $hook_dl download $dynamic_bw_down + qosdef_appendx "}\n" +} diff --git a/package/lean/nft-qos/files/lib/monitor.sh b/package/lean/nft-qos/files/lib/monitor.sh new file mode 100644 index 000000000..54de88eb3 --- /dev/null +++ b/package/lean/nft-qos/files/lib/monitor.sh @@ -0,0 +1,39 @@ +#!/bin/sh +# +# Copyright (C) 2018 rosysong@rosinson.com +# + +. /lib/nft-qos/core.sh + +qosdef_monitor_get_ip_handle() { # + echo $(nft list chain $1 nft-qos-monitor $2 -a 2>/dev/null | grep $3 | awk '{print $11}') +} + +qosdef_monitor_add() { # + handle_dl=$(qosdef_monitor_get_ip_handle $NFT_QOS_INET_FAMILY download $2) + [ -z "$handle_dl" ] && nft add rule $NFT_QOS_INET_FAMILY nft-qos-monitor download ip daddr $2 counter + handle_ul=$(qosdef_monitor_get_ip_handle $NFT_QOS_INET_FAMILY upload $2) + [ -z "$handle_ul" ] && nft add rule $NFT_QOS_INET_FAMILY nft-qos-monitor upload ip saddr $2 counter +} + +qosdef_monitor_del() { # + local handle_dl handle_ul + handle_dl=$(qosdef_monitor_get_ip_handle $NFT_QOS_INET_FAMILY download $2) + handle_ul=$(qosdef_monitor_get_ip_handle $NFT_QOS_INET_FAMILY upload $2) + [ -n "$handle_dl" ] && nft delete handle $handle_dl + [ -n "$handle_ul" ] && nft delete handle $handle_ul +} + +# init qos monitor +qosdef_init_monitor() { + local hook_ul="prerouting" hook_dl="postrouting" + + [ -z "$NFT_QOS_HAS_BRIDGE" ] && { + hook_ul="postrouting" + hook_dl="prerouting" + } + + nft add table $NFT_QOS_INET_FAMILY nft-qos-monitor + nft add chain $NFT_QOS_INET_FAMILY nft-qos-monitor upload { type filter hook $hook_ul priority 0\; } + nft add chain $NFT_QOS_INET_FAMILY nft-qos-monitor download { type filter hook $hook_dl priority 0\; } +} diff --git a/package/lean/nft-qos/files/lib/priority.sh b/package/lean/nft-qos/files/lib/priority.sh new file mode 100644 index 000000000..59288b85c --- /dev/null +++ b/package/lean/nft-qos/files/lib/priority.sh @@ -0,0 +1,90 @@ +#!/bin/sh +# +# Copyright (C) 2018 rosysong@rosinson.com +# + +. /lib/functions/network.sh +. /lib/nft-qos/core.sh + +P1=""; P2=""; P3=""; P4=""; P5=""; P6=""; +P7=""; P8=""; P9=""; P10=""; P11=""; + +_qosdef_handle_protox() { # + case "$1" in + -400) P1="$P1""$2";; + -300) P2="$P2""$2";; + -225) P3="$P3""$2";; + -200) P4="$P4""$2";; + -150) P5="$P5""$2";; + -100) P6="$P6""$2";; + 0) P7="$P7""$2";; + 50) P8="$P8""$2";; + 100) P9="$P9""$2";; + 225) P10="$P10""$2";; + 300) P11="$P11""$2";; + esac +} + +qosdef_handle_protox() { #
+ local proto prio srv + + config_get proto $1 'protocol' + config_get prio $1 'priority' + config_get srv $1 'service' + + [ -z "$proto" -o \ + -z "$prio" -o \ + -z "$srv" ] && return + + _qosdef_handle_protox $prio \ + "\t\t$proto dport { $srv } accept\n" +} + +qosdef_append_rule_protox() { #
+ config_foreach qosdef_handle_protox $1 + qosdef_appendx \ + "${P1}${P2}${P3}${P4}${P5}${P6}${P7}${P8}${P9}${P10}${P11}" +} + +qosdef_append_chain_priority() { #
+ local name=$1 device=$3 + + qosdef_appendx "\tchain $name {\n" + qosdef_append_chain_ingress filter $device 0 accept + qosdef_append_rule_protox $2 + qosdef_appendx "\t}\n" +} + +qosdef_remove_priority() { + qosdef_remove_table netdev nft-qos-priority +} + +# init traffic priority +qosdef_init_priority() { + local priority_enable priority_netdev ifname="br-lan" + + uci_validate_section nft-qos default default \ + 'priority_enable:bool:0' \ + 'priority_netdev:maxlength(8)' + + [ $? -ne 0 ] && { + logger -t nft-qos-priority "validation failed" + return 1 + } + + [ $priority_enable -eq 0 ] && return 1 + + case "$priority_netdev" in + lan) [ "$(uci_get network.lan.type)" != "bridge" ] && { + network_get_device ifname "$priority_netdev" || \ + ifname="$(uci_get network.lan.ifname)" + } + ;; + wan*) network_get_device ifname "$priority_netdev" || \ + ifname="$(uci_get network.$priority_netdev.ifname)" + esac + + qosdef_appendx "table netdev nft-qos-priority {\n" + qosdef_append_chain_priority filter priority $ifname + qosdef_appendx "}\n" +} diff --git a/package/lean/nft-qos/files/lib/static.sh b/package/lean/nft-qos/files/lib/static.sh new file mode 100644 index 000000000..95d3162b1 --- /dev/null +++ b/package/lean/nft-qos/files/lib/static.sh @@ -0,0 +1,73 @@ +#!/bin/sh +# +# Copyright (C) 2018 rosysong@rosinson.com +# + +. /lib/nft-qos/core.sh + +# append rule for static qos +qosdef_append_rule_sta() { #
+ local ipaddr unit rate + local operator=$2 + + config_get ipaddr $1 ipaddr + config_get unit $1 unit $3 + config_get rate $1 rate $4 + + [ -z "$ipaddr" ] && return + + qosdef_append_rule_ip_limit $ipaddr $operator $unit $rate +} + +# append chain for static qos +qosdef_append_chain_sta() { #
+ local hook=$1 name=$2 + local config=$3 operator + + case "$name" in + download) operator="daddr";; + upload) operator="saddr";; + esac + + qosdef_appendx "\tchain $name {\n" + qosdef_append_chain_def filter $hook 0 accept + qosdef_append_rule_limit_whitelist $name + config_foreach qosdef_append_rule_sta $config $operator $4 $5 + qosdef_appendx "\t}\n" +} + +qosdef_flush_static() { + qosdef_flush_table "$NFT_QOS_INET_FAMILY" nft-qos-static +} + +# static limit rate init +qosdef_init_static() { + local unit_dl unit_ul rate_dl rate_ul + local limit_enable limit_type hook_ul="prerouting" hook_dl="postrouting" + + uci_validate_section nft-qos default default \ + 'limit_enable:bool:0' \ + 'limit_type:maxlength(8)' \ + 'static_unit_dl:string:kbytes' \ + 'static_unit_ul:string:kbytes' \ + 'static_rate_dl:uinteger:50' \ + 'static_rate_ul:uinteger:50' + + [ $? -ne 0 ] && { + logger -t nft-qos-static "validation failed" + return 1 + } + + [ $limit_enable -eq 0 -o \ + $limit_type = "dynamic" ] && return 1 + + [ -z "$NFT_QOS_HAS_BRIDGE" ] && { + hook_ul="postrouting" + hook_dl="prerouting" + } + + qosdef_appendx "table $NFT_QOS_INET_FAMILY nft-qos-static {\n" + qosdef_append_chain_sta $hook_ul upload upload $unit_ul $rate_ul + qosdef_append_chain_sta $hook_dl download download $unit_dl $rate_dl + qosdef_appendx "}\n" +} diff --git a/package/lean/nft-qos/files/nft-qos-dynamic.hotplug b/package/lean/nft-qos/files/nft-qos-dynamic.hotplug new file mode 100644 index 000000000..598fc39e7 --- /dev/null +++ b/package/lean/nft-qos/files/nft-qos-dynamic.hotplug @@ -0,0 +1,42 @@ +#!/bin/sh +# +# Copyright 2018 rosysong@rosinson.com +# + +export initscript="nft-qos-dynamic" + +. /lib/functions.sh +. /lib/nft-qos/core.sh +. /lib/nft-qos/dynamic.sh + +NFT_QOS_DYNAMIC_ON= + +qosdef_validate_section_dynamic() { + local limit_enable limit_type + + uci_validate_section nft-qos default default \ + 'limit_enable:bool:0' \ + 'limit_type:maxlength(8)' + + [ $limit_enable -eq 1 -a \ + "$limit_type" = "dynamic" ] && \ + NFT_QOS_DYNAMIC_ON="y" +} + + +logger -t nft-qos-dynamic "ACTION=$ACTION, MACADDR=$MACADDR, IPADDR=$IPADDR, HOSTNAME=$HOSTNAME" + +case "$ACTION" in + add | update | remove) + qosdef_validate_section_dynamic + [ -z "$NFT_QOS_DYNAMIC_ON" ] && return + + qosdef_init_env + qosdef_flush_dynamic + + qosdef_init_header + qosdef_init_dynamic + qosdef_init_done + qosdef_start + ;; +esac diff --git a/package/lean/nft-qos/files/nft-qos-monitor.hotplug b/package/lean/nft-qos/files/nft-qos-monitor.hotplug new file mode 100644 index 000000000..5868bb1ea --- /dev/null +++ b/package/lean/nft-qos/files/nft-qos-monitor.hotplug @@ -0,0 +1,23 @@ +#!/bin/sh +# +# Copyright 2018 rosysong@rosinson.com +# + +export initscript="nft-qos-monitor" + +. /lib/nft-qos/monitor.sh + +logger -t nft-qos-monitor "ACTION=$ACTION, MACADDR=$MACADDR, IPADDR=$IPADDR, HOSTNAME=$HOSTNAME" + +case "$ACTION" in + add | update) + qosdef_init_env + qosdef_init_monitor + qosdef_monitor_add $MACADDR $IPADDR $HOSTNAME + ;; + remove) + qosdef_init_env + qosdef_init_monitor + qosdef_monitor_del $MACADDR $IPADDR $HOSTNAME + ;; +esac diff --git a/package/lean/nft-qos/files/nft-qos.config b/package/lean/nft-qos/files/nft-qos.config new file mode 100644 index 000000000..d18949007 --- /dev/null +++ b/package/lean/nft-qos/files/nft-qos.config @@ -0,0 +1,106 @@ +# +# Copyright (C) 2018 rosysong@rosinson.com +# +# This is the sample for nft-qos configuration file, +# which will generate a nftables script in /tmp/qos.nft +# + +# Getting Started +# Official site : +# https://netfilter.org/projects/nftables/index.html +# What is nftables : +# https://wiki.nftables.org/wiki-nftables/index.php/Main_Page +# + +# Basic Operations +# Configuring Tables : +# https://wiki.nftables.org/wiki-nftables/index.php/Configuring_tables +# Configuring Chains : +# https://wiki.nftables.org/wiki-nftables/index.php/Configuring_chains +# Configuring Rules : +# https://wiki.nftables.org/wiki-nftables/index.php/Simple_rule_management +# Quick Reference (recommended) : +# https://wiki.nftables.org/wiki-nftables/index.php/Quick_reference-nftables_in_10_minutes +# https://netfilter.org/projects/nftables/manpage.html +# + +config default default + # Enable Flag for limit rate + option limit_enable '1' + + # Options for enable Static QoS (rate limit) + option limit_type 'static' + # Options for Static QoS (rate limit) + option static_unit_dl 'kbytes' + option static_unit_ul 'kbytes' + option static_rate_dl '50' + option static_rate_ul '50' + + # Options for enable Dynamic QoS + # This option can not compatible with Static QoS + # option limit_type 'dynamic' + + # For Dynamic QoS Samples (unit of bandwidth is Mbps): + option dynamic_cidr '192.168.1.0/24' + option dynamic_cidr6 'AAAA:BBBB::1/64' + option dynamic_bw_up '100' + option dynamic_bw_down '100' + + # White list for static/dynamic limit + # list limit_whitelist '192.168.1.225' + # list limit_whitelist '192.168.1.0/24' + # list limit_whitelist 'ABCD:CDEF::1/64' + + # Options for Traffic Priority + option priority_enable '0' + option priority_netdev 'lan' + + +# +# For Static QoS Rate Limit Samples : +# +# For Download : +#config download +# option hostname 'My PC' +# option unit 'kbytes' +# option ipaddr '192.168.1.224' +# option rate '128' +# +# For Upload : +#config upload +# option hostname 'office-pc' +# option unit 'mbytes' +# option ipaddr 'ABCD:FFED::1/64' +# option rate '1024' +# +# +# Traffic Priority Samples : +# +# protocol : tcp, udp, udplite, sctp, dccp, tcp is default +# priority : integer between 1-11, 1 is default +# service : you can input a integer or service name, e.g. '22', '11-22', 'telnet', 'ssh, http, ftp', etc +# +#config priority +# option protocol 'tcp' +# option priority '-400' +# option service '23' +# option comment '?' +# +#config priority +# option protocol 'udp' +# option priority '-400' +# option service 'https' +# option comment '?' +# +#config priority +# option protocol 'dccp' +# option priority '0' +# option service '22-35' +# option comment '?' +# +#config priority +# option protocol 'dccp' +# option priority '300' +# option service 'ftp,ssh,http' +# option comment '?' +# diff --git a/package/lean/nft-qos/files/nft-qos.init b/package/lean/nft-qos/files/nft-qos.init new file mode 100755 index 000000000..e48418c75 --- /dev/null +++ b/package/lean/nft-qos/files/nft-qos.init @@ -0,0 +1,41 @@ +#!/bin/sh /etc/rc.common +# +# Copyright (C) 2018 rosysong@rosinson.com +# + +. /lib/nft-qos/core.sh +. /lib/nft-qos/monitor.sh +. /lib/nft-qos/dynamic.sh +. /lib/nft-qos/static.sh +. /lib/nft-qos/priority.sh + +START=99 +USE_PROCD=1 + +service_triggers() { + procd_add_reload_trigger nft-qos +} + +start_service() { + config_load nft-qos + + qosdef_init_env + qosdef_flush_static + qosdef_flush_dynamic + qosdef_remove_priority + + qosdef_init_header + qosdef_init_monitor + qosdef_init_dynamic + qosdef_init_static + qosdef_init_priority + qosdef_init_done + qosdef_start +} + +stop_service() { + qosdef_flush_dynamic + qosdef_flush_static + qosdef_remove_priority + qosdef_clean_cache +} diff --git a/target/linux/apm821xx/patches-4.19/140-GPIO-add-named-gpio-exports.patch b/target/linux/apm821xx/patches-4.19/140-GPIO-add-named-gpio-exports.patch index 5a05c6095..6b1f7fc1c 100644 --- a/target/linux/apm821xx/patches-4.19/140-GPIO-add-named-gpio-exports.patch +++ b/target/linux/apm821xx/patches-4.19/140-GPIO-add-named-gpio-exports.patch @@ -112,7 +112,7 @@ Signed-off-by: John Crispin { --- a/include/linux/gpio/consumer.h +++ b/include/linux/gpio/consumer.h -@@ -531,6 +531,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); -@@ -538,6 +539,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 */ diff --git a/target/linux/brcm2708/patches-4.14/950-0001-arm-partially-revert-702b94bff3c50542a6e4ab9a4f4cef0.patch b/target/linux/brcm2708/patches-4.14/950-0001-arm-partially-revert-702b94bff3c50542a6e4ab9a4f4cef0.patch index 7becfb3d9..7c728b22a 100644 --- a/target/linux/brcm2708/patches-4.14/950-0001-arm-partially-revert-702b94bff3c50542a6e4ab9a4f4cef0.patch +++ b/target/linux/brcm2708/patches-4.14/950-0001-arm-partially-revert-702b94bff3c50542a6e4ab9a4f4cef0.patch @@ -76,7 +76,7 @@ Subject: [PATCH 001/454] arm: partially revert --- a/arch/arm/mm/proc-macros.S +++ b/arch/arm/mm/proc-macros.S -@@ -325,6 +325,8 @@ ENTRY(\name\()_cache_fns) +@@ -335,6 +335,8 @@ ENTRY(\name\()_cache_fns) .long \name\()_flush_kern_dcache_area .long \name\()_dma_map_area .long \name\()_dma_unmap_area diff --git a/target/linux/brcm2708/patches-4.14/950-0002-smsx95xx-fix-crimes-against-truesize.patch b/target/linux/brcm2708/patches-4.14/950-0002-smsx95xx-fix-crimes-against-truesize.patch index 0dd2c7ce3..52999a9bd 100644 --- a/target/linux/brcm2708/patches-4.14/950-0002-smsx95xx-fix-crimes-against-truesize.patch +++ b/target/linux/brcm2708/patches-4.14/950-0002-smsx95xx-fix-crimes-against-truesize.patch @@ -25,7 +25,7 @@ Signed-off-by: Steve Glendinning static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index, u32 *data, int in_pm) { -@@ -1971,7 +1975,8 @@ static int smsc95xx_rx_fixup(struct usbn +@@ -1972,7 +1976,8 @@ static int smsc95xx_rx_fixup(struct usbn if (dev->net->features & NETIF_F_RXCSUM) smsc95xx_rx_csum_offload(skb); skb_trim(skb, skb->len - 4); /* remove fcs */ @@ -35,7 +35,7 @@ Signed-off-by: Steve Glendinning return 1; } -@@ -1989,7 +1994,8 @@ static int smsc95xx_rx_fixup(struct usbn +@@ -1990,7 +1995,8 @@ static int smsc95xx_rx_fixup(struct usbn if (dev->net->features & NETIF_F_RXCSUM) smsc95xx_rx_csum_offload(ax_skb); skb_trim(ax_skb, ax_skb->len - 4); /* remove fcs */ diff --git a/target/linux/brcm2708/patches-4.14/950-0016-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch b/target/linux/brcm2708/patches-4.14/950-0016-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch index bb14791ba..8c5821575 100644 --- a/target/linux/brcm2708/patches-4.14/950-0016-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch +++ b/target/linux/brcm2708/patches-4.14/950-0016-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch @@ -47,7 +47,7 @@ Signed-off-by: Noralf Trønnes struct bcm2835_dmadev { struct dma_device ddev; -@@ -925,6 +927,9 @@ static int bcm2835_dma_probe(struct plat +@@ -905,6 +907,9 @@ static int bcm2835_dma_probe(struct plat base = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(base)) return PTR_ERR(base); @@ -57,7 +57,7 @@ Signed-off-by: Noralf Trønnes od->base = base; -@@ -962,6 +967,9 @@ static int bcm2835_dma_probe(struct plat +@@ -942,6 +947,9 @@ static int bcm2835_dma_probe(struct plat goto err_no_dma; } @@ -67,7 +67,7 @@ Signed-off-by: Noralf Trønnes /* get irqs for each channel that we support */ for (i = 0; i <= BCM2835_DMA_MAX_DMA_CHAN_SUPPORTED; i++) { /* skip masked out channels */ -@@ -1036,6 +1044,7 @@ static int bcm2835_dma_remove(struct pla +@@ -1016,6 +1024,7 @@ static int bcm2835_dma_remove(struct pla { struct bcm2835_dmadev *od = platform_get_drvdata(pdev); @@ -75,7 +75,7 @@ Signed-off-by: Noralf Trønnes dma_async_device_unregister(&od->ddev); bcm2835_dma_free(od); -@@ -1051,7 +1060,22 @@ static struct platform_driver bcm2835_dm +@@ -1031,7 +1040,22 @@ static struct platform_driver bcm2835_dm }, }; diff --git a/target/linux/brcm2708/patches-4.14/950-0031-Update-vfpmodule.c.patch b/target/linux/brcm2708/patches-4.14/950-0031-Update-vfpmodule.c.patch index 6647e5a4f..3d8106d2a 100644 --- a/target/linux/brcm2708/patches-4.14/950-0031-Update-vfpmodule.c.patch +++ b/target/linux/brcm2708/patches-4.14/950-0031-Update-vfpmodule.c.patch @@ -102,7 +102,7 @@ Signed-off-by: Christopher Alexander Tobias Schulze vfp_save_state(&thread->vfpstate, fpexc | FPEXC_EN); fmxr(FPEXC, fpexc); } -@@ -602,6 +609,8 @@ int vfp_restore_user_hwstate(struct user +@@ -598,6 +605,8 @@ int vfp_restore_user_hwstate(struct user struct thread_info *thread = current_thread_info(); struct vfp_hard_struct *hwstate = &thread->vfpstate.hard; unsigned long fpexc; @@ -111,7 +111,7 @@ Signed-off-by: Christopher Alexander Tobias Schulze /* Disable VFP to avoid corrupting the new thread state. */ vfp_flush_hwstate(thread); -@@ -624,8 +633,12 @@ int vfp_restore_user_hwstate(struct user +@@ -620,8 +629,12 @@ int vfp_restore_user_hwstate(struct user /* Ensure the VFP is enabled. */ fpexc |= FPEXC_EN; @@ -126,7 +126,7 @@ Signed-off-by: Christopher Alexander Tobias Schulze hwstate->fpexc = fpexc; hwstate->fpinst = ufp_exc->fpinst; -@@ -695,7 +708,8 @@ void kernel_neon_begin(void) +@@ -691,7 +704,8 @@ void kernel_neon_begin(void) cpu = get_cpu(); fpexc = fmrx(FPEXC) | FPEXC_EN; diff --git a/target/linux/brcm2708/patches-4.14/950-0037-Add-dwc_otg-driver.patch b/target/linux/brcm2708/patches-4.14/950-0037-Add-dwc_otg-driver.patch index 49a291702..f11406ed5 100644 --- a/target/linux/brcm2708/patches-4.14/950-0037-Add-dwc_otg-driver.patch +++ b/target/linux/brcm2708/patches-4.14/950-0037-Add-dwc_otg-driver.patch @@ -841,7 +841,7 @@ Signed-off-by: Malik Olivier Boussejra } --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c -@@ -5084,7 +5084,7 @@ static void port_event(struct usb_hub *h +@@ -5094,7 +5094,7 @@ static void port_event(struct usb_hub *h if (portchange & USB_PORT_STAT_C_OVERCURRENT) { u16 status = 0, unused; diff --git a/target/linux/brcm2708/patches-4.14/950-0056-fbdev-add-FBIOCOPYAREA-ioctl.patch b/target/linux/brcm2708/patches-4.14/950-0056-fbdev-add-FBIOCOPYAREA-ioctl.patch index b01c2203e..dd41f5d44 100644 --- a/target/linux/brcm2708/patches-4.14/950-0056-fbdev-add-FBIOCOPYAREA-ioctl.patch +++ b/target/linux/brcm2708/patches-4.14/950-0056-fbdev-add-FBIOCOPYAREA-ioctl.patch @@ -170,7 +170,7 @@ bcm2708_fb: Add ioctl for reading gpu memory through dma platform_set_drvdata(dev, fb); --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c -@@ -1086,6 +1086,31 @@ fb_blank(struct fb_info *info, int blank +@@ -1090,6 +1090,31 @@ fb_blank(struct fb_info *info, int blank } EXPORT_SYMBOL(fb_blank); @@ -202,7 +202,7 @@ bcm2708_fb: Add ioctl for reading gpu memory through dma static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) { -@@ -1096,6 +1121,7 @@ static long do_fb_ioctl(struct fb_info * +@@ -1100,6 +1125,7 @@ static long do_fb_ioctl(struct fb_info * struct fb_cmap cmap_from; struct fb_cmap_user cmap; struct fb_event event; @@ -210,7 +210,7 @@ bcm2708_fb: Add ioctl for reading gpu memory through dma void __user *argp = (void __user *)arg; long ret = 0; -@@ -1213,6 +1239,15 @@ static long do_fb_ioctl(struct fb_info * +@@ -1217,6 +1243,15 @@ static long do_fb_ioctl(struct fb_info * unlock_fb_info(info); console_unlock(); break; @@ -226,7 +226,7 @@ bcm2708_fb: Add ioctl for reading gpu memory through dma default: if (!lock_fb_info(info)) return -ENODEV; -@@ -1358,6 +1393,7 @@ static long fb_compat_ioctl(struct file +@@ -1362,6 +1397,7 @@ static long fb_compat_ioctl(struct file case FBIOPAN_DISPLAY: case FBIOGET_CON2FBMAP: case FBIOPUT_CON2FBMAP: diff --git a/target/linux/brcm2708/patches-4.14/950-0061-Improve-__copy_to_user-and-__copy_from_user-performa.patch b/target/linux/brcm2708/patches-4.14/950-0061-Improve-__copy_to_user-and-__copy_from_user-performa.patch index 924fef4cb..157f76f15 100644 --- a/target/linux/brcm2708/patches-4.14/950-0061-Improve-__copy_to_user-and-__copy_from_user-performa.patch +++ b/target/linux/brcm2708/patches-4.14/950-0061-Improve-__copy_to_user-and-__copy_from_user-performa.patch @@ -58,7 +58,7 @@ Signed-off-by: Phil Elwell #define memset(p,v,n) \ --- a/arch/arm/include/asm/uaccess.h +++ b/arch/arm/include/asm/uaccess.h -@@ -459,6 +459,9 @@ do { \ +@@ -496,6 +496,9 @@ do { \ extern unsigned long __must_check arm_copy_from_user(void *to, const void __user *from, unsigned long n); @@ -273,7 +273,7 @@ Signed-off-by: Phil Elwell #ifdef CONFIG_CPU_SPECTRE get_thread_info r3 ldr r3, [r3, #TI_ADDR_LIMIT] -@@ -103,6 +104,7 @@ ENTRY(arm_copy_from_user) +@@ -99,6 +100,7 @@ ENTRY(arm_copy_from_user) #include "copy_template.S" ENDPROC(arm_copy_from_user) @@ -1507,7 +1507,7 @@ Signed-off-by: Phil Elwell unsigned long ua_flags = uaccess_save_and_enable(); n = __copy_to_user_std(to, from, n); uaccess_restore(ua_flags); -@@ -156,6 +252,26 @@ arm_copy_to_user(void __user *to, const +@@ -157,6 +253,26 @@ arm_copy_to_user(void __user *to, const } return n; } diff --git a/target/linux/brcm2708/patches-4.14/950-0131-drm-vc4-Fix-pitch-setup-for-T-format-scanout.patch b/target/linux/brcm2708/patches-4.14/950-0131-drm-vc4-Fix-pitch-setup-for-T-format-scanout.patch index 1b140f0a6..98b7ba287 100644 --- a/target/linux/brcm2708/patches-4.14/950-0131-drm-vc4-Fix-pitch-setup-for-T-format-scanout.patch +++ b/target/linux/brcm2708/patches-4.14/950-0131-drm-vc4-Fix-pitch-setup-for-T-format-scanout.patch @@ -16,7 +16,7 @@ Fixes: 98830d91da08 ("drm/vc4: Add T-format scanout support.") --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c -@@ -547,14 +547,24 @@ static int vc4_plane_mode_set(struct drm +@@ -549,14 +549,24 @@ static int vc4_plane_mode_set(struct drm tiling = SCALER_CTL0_TILING_LINEAR; pitch0 = VC4_SET_FIELD(fb->pitches[0], SCALER_SRC_PITCH); break; diff --git a/target/linux/brcm2708/patches-4.14/950-0174-drm-vc4-Add-the-DRM_IOCTL_VC4_GEM_MADVISE-ioctl.patch b/target/linux/brcm2708/patches-4.14/950-0174-drm-vc4-Add-the-DRM_IOCTL_VC4_GEM_MADVISE-ioctl.patch index 995c2c0db..0e410c484 100644 --- a/target/linux/brcm2708/patches-4.14/950-0174-drm-vc4-Add-the-DRM_IOCTL_VC4_GEM_MADVISE-ioctl.patch +++ b/target/linux/brcm2708/patches-4.14/950-0174-drm-vc4-Add-the-DRM_IOCTL_VC4_GEM_MADVISE-ioctl.patch @@ -778,7 +778,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20171019125748.3152-1-boris. #include "vc4_drv.h" #include "vc4_regs.h" -@@ -777,21 +778,40 @@ static int vc4_prepare_fb(struct drm_pla +@@ -779,21 +780,40 @@ static int vc4_prepare_fb(struct drm_pla { struct vc4_bo *bo; struct dma_fence *fence; diff --git a/target/linux/brcm2708/patches-4.14/950-0181-drm-vc4-Use-.pixel_order-instead-of-custom-.flip_cbc.patch b/target/linux/brcm2708/patches-4.14/950-0181-drm-vc4-Use-.pixel_order-instead-of-custom-.flip_cbc.patch index 9e067686b..d9f3e3deb 100644 --- a/target/linux/brcm2708/patches-4.14/950-0181-drm-vc4-Use-.pixel_order-instead-of-custom-.flip_cbc.patch +++ b/target/linux/brcm2708/patches-4.14/950-0181-drm-vc4-Use-.pixel_order-instead-of-custom-.flip_cbc.patch @@ -66,7 +66,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/563872b69c1e5df142cb15ebfca7 }, }; -@@ -625,15 +628,8 @@ static int vc4_plane_mode_set(struct drm +@@ -627,15 +630,8 @@ static int vc4_plane_mode_set(struct drm * The pointers may be any byte address. */ vc4_state->ptr0_offset = vc4_state->dlist_count; diff --git a/target/linux/brcm2708/patches-4.14/950-0344-drm-vc4-Set-premultiplied-for-alpha-formats.patch b/target/linux/brcm2708/patches-4.14/950-0344-drm-vc4-Set-premultiplied-for-alpha-formats.patch index 9abfa1461..af7396910 100644 --- a/target/linux/brcm2708/patches-4.14/950-0344-drm-vc4-Set-premultiplied-for-alpha-formats.patch +++ b/target/linux/brcm2708/patches-4.14/950-0344-drm-vc4-Set-premultiplied-for-alpha-formats.patch @@ -22,7 +22,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/1520556817-97297-2-git-send- --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c -@@ -619,13 +619,14 @@ static int vc4_plane_mode_set(struct drm +@@ -621,13 +621,14 @@ static int vc4_plane_mode_set(struct drm SCALER_POS1_SCL_HEIGHT)); } diff --git a/target/linux/brcm2708/patches-4.14/950-0345-drm-vc4-Check-if-plane-requires-background-fill.patch b/target/linux/brcm2708/patches-4.14/950-0345-drm-vc4-Check-if-plane-requires-background-fill.patch index 6eaae48b0..778fe6763 100644 --- a/target/linux/brcm2708/patches-4.14/950-0345-drm-vc4-Check-if-plane-requires-background-fill.patch +++ b/target/linux/brcm2708/patches-4.14/950-0345-drm-vc4-Check-if-plane-requires-background-fill.patch @@ -36,7 +36,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/1520556817-97297-3-git-send- }; static inline struct vc4_plane_state * -@@ -522,6 +528,7 @@ static int vc4_plane_mode_set(struct drm +@@ -524,6 +530,7 @@ static int vc4_plane_mode_set(struct drm u32 ctl0_offset = vc4_state->dlist_count; const struct hvs_format *format = vc4_get_hvs_format(fb->format->format); int num_planes = drm_format_num_planes(format->drm); @@ -44,7 +44,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/1520556817-97297-3-git-send- u32 scl0, scl1, pitch0; u32 lbm_size, tiling; unsigned long irqflags; -@@ -705,6 +712,16 @@ static int vc4_plane_mode_set(struct drm +@@ -707,6 +714,16 @@ static int vc4_plane_mode_set(struct drm vc4_state->dlist[ctl0_offset] |= VC4_SET_FIELD(vc4_state->dlist_count, SCALER_CTL0_SIZE); diff --git a/target/linux/brcm2708/patches-4.14/950-0354-drm-vc4-Advertise-supported-modifiers-for-planes.patch b/target/linux/brcm2708/patches-4.14/950-0354-drm-vc4-Advertise-supported-modifiers-for-planes.patch index 95d240249..c48c6124b 100644 --- a/target/linux/brcm2708/patches-4.14/950-0354-drm-vc4-Advertise-supported-modifiers-for-planes.patch +++ b/target/linux/brcm2708/patches-4.14/950-0354-drm-vc4-Advertise-supported-modifiers-for-planes.patch @@ -33,7 +33,7 @@ Link: https://patchwork.freedesktop.org/patch/170828/ --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c -@@ -868,6 +868,32 @@ out: +@@ -870,6 +870,32 @@ out: ctx); } @@ -66,7 +66,7 @@ Link: https://patchwork.freedesktop.org/patch/170828/ static const struct drm_plane_funcs vc4_plane_funcs = { .update_plane = vc4_update_plane, .disable_plane = drm_atomic_helper_disable_plane, -@@ -876,6 +902,7 @@ static const struct drm_plane_funcs vc4_ +@@ -878,6 +904,7 @@ static const struct drm_plane_funcs vc4_ .reset = vc4_plane_reset, .atomic_duplicate_state = vc4_plane_duplicate_state, .atomic_destroy_state = vc4_plane_destroy_state, @@ -74,7 +74,7 @@ Link: https://patchwork.freedesktop.org/patch/170828/ }; struct drm_plane *vc4_plane_init(struct drm_device *dev, -@@ -887,6 +914,11 @@ struct drm_plane *vc4_plane_init(struct +@@ -889,6 +916,11 @@ struct drm_plane *vc4_plane_init(struct u32 num_formats = 0; int ret = 0; unsigned i; @@ -86,7 +86,7 @@ Link: https://patchwork.freedesktop.org/patch/170828/ vc4_plane = devm_kzalloc(dev->dev, sizeof(*vc4_plane), GFP_KERNEL); -@@ -907,7 +939,7 @@ struct drm_plane *vc4_plane_init(struct +@@ -909,7 +941,7 @@ struct drm_plane *vc4_plane_init(struct ret = drm_universal_plane_init(dev, plane, 0, &vc4_plane_funcs, formats, num_formats, diff --git a/target/linux/brcm2708/patches-4.14/950-0356-drm-vc4-Add-missing-formats-to-vc4_format_mod_suppor.patch b/target/linux/brcm2708/patches-4.14/950-0356-drm-vc4-Add-missing-formats-to-vc4_format_mod_suppor.patch index 4bed2925a..36337d1fb 100644 --- a/target/linux/brcm2708/patches-4.14/950-0356-drm-vc4-Add-missing-formats-to-vc4_format_mod_suppor.patch +++ b/target/linux/brcm2708/patches-4.14/950-0356-drm-vc4-Add-missing-formats-to-vc4_format_mod_suppor.patch @@ -21,7 +21,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20180316220435.31416-2-eric@ --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c -@@ -888,7 +888,9 @@ static bool vc4_format_mod_supported(str +@@ -890,7 +890,9 @@ static bool vc4_format_mod_supported(str case DRM_FORMAT_YUV420: case DRM_FORMAT_YVU420: case DRM_FORMAT_NV12: diff --git a/target/linux/brcm2708/patches-4.14/950-0357-drm-vc4-Add-support-for-SAND-modifier.patch b/target/linux/brcm2708/patches-4.14/950-0357-drm-vc4-Add-support-for-SAND-modifier.patch index fbe726160..b4ab22c88 100644 --- a/target/linux/brcm2708/patches-4.14/950-0357-drm-vc4-Add-support-for-SAND-modifier.patch +++ b/target/linux/brcm2708/patches-4.14/950-0357-drm-vc4-Add-support-for-SAND-modifier.patch @@ -32,7 +32,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20180316220435.31416-3-eric@ --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c -@@ -467,11 +467,13 @@ static int vc4_plane_mode_set(struct drm +@@ -469,11 +469,13 @@ static int vc4_plane_mode_set(struct drm struct drm_framebuffer *fb = state->fb; u32 ctl0_offset = vc4_state->dlist_count; const struct hvs_format *format = vc4_get_hvs_format(fb->format->format); @@ -46,7 +46,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20180316220435.31416-3-eric@ int ret, i; ret = vc4_plane_setup_clipping_and_scaling(state); -@@ -511,7 +513,7 @@ static int vc4_plane_mode_set(struct drm +@@ -513,7 +515,7 @@ static int vc4_plane_mode_set(struct drm scl1 = vc4_get_scl_field(state, 0); } @@ -55,7 +55,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20180316220435.31416-3-eric@ case DRM_FORMAT_MOD_LINEAR: tiling = SCALER_CTL0_TILING_LINEAR; pitch0 = VC4_SET_FIELD(fb->pitches[0], SCALER_SRC_PITCH); -@@ -534,6 +536,49 @@ static int vc4_plane_mode_set(struct drm +@@ -536,6 +538,49 @@ static int vc4_plane_mode_set(struct drm break; } @@ -105,7 +105,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20180316220435.31416-3-eric@ default: DRM_DEBUG_KMS("Unsupported FB tiling flag 0x%16llx", (long long)fb->modifier); -@@ -544,7 +589,7 @@ static int vc4_plane_mode_set(struct drm +@@ -546,7 +591,7 @@ static int vc4_plane_mode_set(struct drm vc4_dlist_write(vc4_state, SCALER_CTL0_VALID | (format->pixel_order << SCALER_CTL0_ORDER_SHIFT) | @@ -114,7 +114,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20180316220435.31416-3-eric@ VC4_SET_FIELD(tiling, SCALER_CTL0_TILING) | (vc4_state->is_unity ? SCALER_CTL0_UNITY : 0) | VC4_SET_FIELD(scl0, SCALER_CTL0_SCL0) | -@@ -598,8 +643,13 @@ static int vc4_plane_mode_set(struct drm +@@ -600,8 +645,13 @@ static int vc4_plane_mode_set(struct drm /* Pitch word 1/2 */ for (i = 1; i < num_planes; i++) { @@ -130,7 +130,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20180316220435.31416-3-eric@ } /* Colorspace conversion words */ -@@ -882,13 +932,30 @@ static bool vc4_format_mod_supported(str +@@ -884,13 +934,30 @@ static bool vc4_format_mod_supported(str case DRM_FORMAT_BGR565: case DRM_FORMAT_ARGB1555: case DRM_FORMAT_XRGB1555: @@ -164,7 +164,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20180316220435.31416-3-eric@ case DRM_FORMAT_NV16: case DRM_FORMAT_NV61: default: -@@ -918,6 +985,9 @@ struct drm_plane *vc4_plane_init(struct +@@ -920,6 +987,9 @@ struct drm_plane *vc4_plane_init(struct unsigned i; static const uint64_t modifiers[] = { DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED, diff --git a/target/linux/brcm2708/patches-4.14/950-0434-mmc-bcm2835-Recover-from-MMC_SEND_EXT_CSD.patch b/target/linux/brcm2708/patches-4.14/950-0434-mmc-bcm2835-Recover-from-MMC_SEND_EXT_CSD.patch deleted file mode 100644 index 9a9e81103..000000000 --- a/target/linux/brcm2708/patches-4.14/950-0434-mmc-bcm2835-Recover-from-MMC_SEND_EXT_CSD.patch +++ /dev/null @@ -1,50 +0,0 @@ -From c2eae29f6503cf29ac6a204c51132cfed33d203e Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Fri, 26 Oct 2018 17:40:44 +0100 -Subject: [PATCH 434/454] mmc/bcm2835: Recover from MMC_SEND_EXT_CSD - -If the user issues an "mmc extcsd read", the SD controller receives -what it thinks is a SEND_IF_COND command with an unexpected data block. -The resulting operations leave the FSM stuck in READWAIT, a state which -persists until the MMC framework resets the controller, by which point -the root filesystem is likely to have been unmounted. - -A less heavyweight solution is to detect the condition and nudge the -FSM by asserting the (self-clearing) FORCE_DATA_MODE bit. - -N.B. This workaround was essentially discovered by accident and without -a full understanding the inner workings of the controller, so it is -fortunate that the "fix" only modifies error paths. - -See: https://github.com/raspberrypi/linux/issues/2728 - -Signed-off-by: Phil Elwell ---- - drivers/mmc/host/bcm2835.c | 9 +++++++++ - 1 file changed, 9 insertions(+) - ---- a/drivers/mmc/host/bcm2835.c -+++ b/drivers/mmc/host/bcm2835.c -@@ -772,6 +772,8 @@ static void bcm2835_finish_command(struc - - if (!(sdhsts & SDHSTS_CRC7_ERROR) || - (host->cmd->opcode != MMC_SEND_OP_COND)) { -+ u32 edm, fsm; -+ - if (sdhsts & SDHSTS_CMD_TIME_OUT) { - host->cmd->error = -ETIMEDOUT; - } else { -@@ -780,6 +782,13 @@ static void bcm2835_finish_command(struc - bcm2835_dumpregs(host); - host->cmd->error = -EILSEQ; - } -+ edm = readl(host->ioaddr + SDEDM); -+ fsm = edm & SDEDM_FSM_MASK; -+ if (fsm == SDEDM_FSM_READWAIT || -+ fsm == SDEDM_FSM_WRITESTART1) -+ /* Kick the FSM out of its wait */ -+ writel(edm | SDEDM_FORCE_DATA_MODE, -+ host->ioaddr + SDEDM); - bcm2835_finish_request(host); - return; - } diff --git a/target/linux/cns3xxx/config-4.14 b/target/linux/cns3xxx/config-4.14 index ba6d0caa0..a0c65fa5f 100644 --- a/target/linux/cns3xxx/config-4.14 +++ b/target/linux/cns3xxx/config-4.14 @@ -174,7 +174,6 @@ CONFIG_HAVE_SMP=y CONFIG_HAVE_SYSCALL_TRACEPOINTS=y CONFIG_HAVE_UID16=y CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y -# CONFIG_HNS3 is not set CONFIG_HWMON=y CONFIG_HZ_FIXED=0 CONFIG_HZ_PERIODIC=y @@ -219,6 +218,7 @@ CONFIG_MDIO_BUS=y CONFIG_MDIO_DEVICE=y CONFIG_MIGHT_HAVE_CACHE_L2X0=y CONFIG_MIGHT_HAVE_PCI=y +CONFIG_MIGRATION=y CONFIG_MMC=y CONFIG_MMC_BLOCK=y CONFIG_MMC_SDHCI=y @@ -297,7 +297,6 @@ CONFIG_PCI=y CONFIG_PCI_DISABLE_COMMON_QUIRKS=y CONFIG_PCI_DOMAINS=y CONFIG_PCI_DOMAINS_GENERIC=y -# CONFIG_PCI_FTPCI100 is not set CONFIG_PERF_USE_VMALLOC=y CONFIG_PGTABLE_LEVELS=2 CONFIG_PHYLIB=y @@ -310,7 +309,6 @@ CONFIG_PPPOE=m CONFIG_PPP_ASYNC=m CONFIG_PPS=y CONFIG_PPS_CLIENT_GPIO=y -CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13 CONFIG_PRINTK_TIME=y CONFIG_PROC_VMCORE=y CONFIG_RAID_ATTRS=y diff --git a/target/linux/cns3xxx/config-4.19 b/target/linux/cns3xxx/config-4.19 new file mode 100644 index 000000000..63fedc1be --- /dev/null +++ b/target/linux/cns3xxx/config-4.19 @@ -0,0 +1,370 @@ +# CONFIG_AIO is not set +CONFIG_ALIGNMENT_TRAP=y +CONFIG_ARCH_CLOCKSOURCE_DATA=y +CONFIG_ARCH_CNS3XXX=y +CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +CONFIG_ARCH_HAS_FORTIFY_SOURCE=y +CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y +CONFIG_ARCH_HAS_KCOV=y +CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y +CONFIG_ARCH_HAS_PHYS_TO_DMA=y +CONFIG_ARCH_HAS_SET_MEMORY=y +CONFIG_ARCH_HAS_SG_CHAIN=y +CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y +CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y +CONFIG_ARCH_HAS_TICK_BROADCAST=y +CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_MULTIPLATFORM=y +CONFIG_ARCH_MULTI_V6=y +CONFIG_ARCH_MULTI_V6_V7=y +CONFIG_ARCH_NR_GPIO=0 +CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y +CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y +CONFIG_ARCH_SUPPORTS_UPROBES=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_USE_BUILTIN_BSWAP=y +CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y +CONFIG_ARCH_WANT_GENERAL_HUGETLB=y +CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +CONFIG_ARM=y +CONFIG_ARM_GIC=y +CONFIG_ARM_HAS_SG_CHAIN=y +CONFIG_ARM_HEAVY_MB=y +CONFIG_ARM_L1_CACHE_SHIFT=5 +CONFIG_ARM_PATCH_PHYS_VIRT=y +CONFIG_ARM_THUMB=y +CONFIG_ATA=y +CONFIG_ATAGS=y +# CONFIG_ATA_SFF is not set +CONFIG_ATA_VERBOSE_ERROR=y +CONFIG_AUTO_ZRELADDR=y +CONFIG_BCM_NET_PHYLIB=y +CONFIG_BLK_DEV_SD=y +CONFIG_BLK_MQ_PCI=y +CONFIG_BLK_SCSI_REQUEST=y +CONFIG_BROADCOM_PHY=y +CONFIG_CACHE_L2X0=y +CONFIG_CLKDEV_LOOKUP=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_CMDLINE="console=ttyS0,115200" +CONFIG_CMDLINE_FORCE=y +CONFIG_CNS3XXX_ETH=y +CONFIG_COMMON_CLK=y +CONFIG_COREDUMP=y +CONFIG_CPU_32v6=y +CONFIG_CPU_32v6K=y +CONFIG_CPU_ABRT_EV6=y +# CONFIG_CPU_BPREDICT_DISABLE is not set +CONFIG_CPU_CACHE_V6=y +CONFIG_CPU_CACHE_VIPT=y +CONFIG_CPU_COPY_V6=y +CONFIG_CPU_CP15=y +CONFIG_CPU_CP15_MMU=y +CONFIG_CPU_HAS_ASID=y +# CONFIG_CPU_ICACHE_DISABLE is not set +CONFIG_CPU_PABRT_V6=y +CONFIG_CPU_RMAP=y +# CONFIG_CPU_SW_DOMAIN_PAN is not set +CONFIG_CPU_THUMB_CAPABLE=y +CONFIG_CPU_TLB_V6=y +CONFIG_CPU_V6K=y +CONFIG_CRASH_DUMP=y +CONFIG_CRC_CCITT=m +CONFIG_CRYPTO_AEAD=y +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +CONFIG_CRYPTO_NULL2=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_WORKQUEUE=y +CONFIG_DCACHE_WORD_ACCESS=y +CONFIG_DEBUG_ALIGN_RODATA=y +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" +# CONFIG_DEBUG_USER is not set +CONFIG_DMA_CACHE_FIQ_BROADCAST=y +CONFIG_DTC=y +CONFIG_EDAC_ATOMIC_SCRUB=y +CONFIG_EDAC_SUPPORT=y +CONFIG_EEPROM_AT24=y +CONFIG_ELF_CORE=y +CONFIG_FIQ=y +CONFIG_FIXED_PHY=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FRAME_POINTER=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y +CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IRQ_CHIP=y +CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y +CONFIG_GENERIC_IRQ_MULTI_HANDLER=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GLOB=y +CONFIG_GPIOLIB=y +CONFIG_GPIOLIB_IRQCHIP=y +CONFIG_GPIO_PCA953X=y +CONFIG_GPIO_PCA953X_IRQ=y +CONFIG_GPIO_SYSFS=y +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +CONFIG_HAVE_ARCH_AUDITSYSCALL=y +CONFIG_HAVE_ARCH_JUMP_LABEL=y +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_HAVE_ARCH_PFN_VALID=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +CONFIG_HAVE_ARM_SCU=y +CONFIG_HAVE_ARM_TWD=y +CONFIG_HAVE_CLK=y +CONFIG_HAVE_CLK_PREPARE=y +CONFIG_HAVE_CONTEXT_TRACKING=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_HAVE_DEBUG_KMEMLEAK=y +CONFIG_HAVE_DMA_CONTIGUOUS=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y +CONFIG_HAVE_EBPF_JIT=y +CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_IDE=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_LD_DEAD_CODE_DATA_ELIMINATION=y +CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_MOD_ARCH_SPECIFIC=y +CONFIG_HAVE_NET_DSA=y +CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_OPTPROBES=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_PERF_REGS=y +CONFIG_HAVE_PERF_USER_STACK_DUMP=y +CONFIG_HAVE_PROC_CPU=y +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y +CONFIG_HAVE_RSEQ=y +CONFIG_HAVE_SMP=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +CONFIG_HAVE_UID16=y +CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +CONFIG_HWMON=y +CONFIG_HZ_FIXED=0 +CONFIG_HZ_PERIODIC=y +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_CNS3XXX=y +# CONFIG_INITRAMFS_FORCE is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_IP6_NF_FILTER=m +CONFIG_IP6_NF_IPTABLES=m +CONFIG_IP6_NF_MANGLE=m +CONFIG_IP6_NF_TARGET_REJECT=m +CONFIG_IPV6=y +CONFIG_IPV6_MROUTE=y +CONFIG_IPV6_MULTIPLE_TABLES=y +# CONFIG_IPV6_PIMSM_V2 is not set +CONFIG_IPV6_SUBTREES=y +CONFIG_IP_MROUTE_COMMON=y +CONFIG_IP_NF_FILTER=m +CONFIG_IP_NF_IPTABLES=m +CONFIG_IP_NF_MANGLE=m +CONFIG_IP_NF_NAT=m +CONFIG_IP_NF_TARGET_MASQUERADE=m +CONFIG_IP_NF_TARGET_REDIRECT=m +CONFIG_IP_NF_TARGET_REJECT=m +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +CONFIG_KALLSYMS=y +CONFIG_KALLSYMS_UNCOMPRESSED=y +CONFIG_LEDS_GPIO=y +# CONFIG_LEDS_TRIGGER_NETDEV is not set +CONFIG_LIBFDT=y +CONFIG_LOCK_DEBUGGING_SUPPORT=y +CONFIG_LOCK_SPIN_ON_OWNER=y +# CONFIG_MACH_CNS3420VB is not set +CONFIG_MACH_GW2388=y +CONFIG_MAGIC_SYSRQ=y +CONFIG_MDIO_BUS=y +CONFIG_MDIO_DEVICE=y +CONFIG_MEMFD_CREATE=y +CONFIG_MIGHT_HAVE_CACHE_L2X0=y +CONFIG_MIGHT_HAVE_PCI=y +CONFIG_MIGRATION=y +CONFIG_MMC=y +CONFIG_MMC_BLOCK=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_CNS3XXX=y +# CONFIG_MMC_SDHCI_PCI is not set +CONFIG_MMC_SDHCI_PLTFM=y +# CONFIG_MMC_TIFM_SD is not set +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_MPCORE_WATCHDOG=y +CONFIG_MTD_M25P80=y +# CONFIG_MTD_OF_PARTS is not set +CONFIG_MTD_PHYSMAP=y +# CONFIG_MTD_PHYSMAP_OF is not set +CONFIG_MTD_SPI_NOR=y +CONFIG_MTD_SPLIT_FIRMWARE=y +CONFIG_MTD_SPLIT_UIMAGE_FW=y +CONFIG_MUTEX_SPIN_ON_OWNER=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NETFILTER=y +CONFIG_NETFILTER_ADVANCED=y +CONFIG_NETFILTER_XTABLES=m +CONFIG_NETFILTER_XT_MARK=m +CONFIG_NETFILTER_XT_MATCH_COMMENT=m +CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m +CONFIG_NETFILTER_XT_MATCH_LIMIT=m +CONFIG_NETFILTER_XT_MATCH_MAC=m +CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m +CONFIG_NETFILTER_XT_MATCH_STATE=m +CONFIG_NETFILTER_XT_MATCH_TIME=m +CONFIG_NETFILTER_XT_NAT=m +CONFIG_NETFILTER_XT_TARGET_LOG=m +CONFIG_NETFILTER_XT_TARGET_REDIRECT=m +CONFIG_NETFILTER_XT_TARGET_TCPMSS=m +CONFIG_NET_FLOW_LIMIT=y +CONFIG_NF_CONNTRACK=m +CONFIG_NF_CONNTRACK_RTCACHE=m +CONFIG_NF_DEFRAG_IPV4=m +CONFIG_NF_DEFRAG_IPV6=m +CONFIG_NF_LOG_COMMON=m +CONFIG_NF_LOG_IPV4=m +CONFIG_NF_LOG_IPV6=m +CONFIG_NF_NAT=m +CONFIG_NF_NAT_IPV4=m +CONFIG_NF_NAT_NEEDED=y +CONFIG_NF_NAT_REDIRECT=y +CONFIG_NF_REJECT_IPV4=m +CONFIG_NF_REJECT_IPV6=m +CONFIG_NLS=y +CONFIG_NO_BOOTMEM=y +CONFIG_NR_CPUS=2 +CONFIG_NTP_PPS=y +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_OF_RESERVED_MEM=y +CONFIG_OLD_SIGACTION=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_OUTER_CACHE=y +CONFIG_OUTER_CACHE_SYNC=y +CONFIG_PADATA=y +CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PCI=y +CONFIG_PCI_DISABLE_COMMON_QUIRKS=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_DOMAINS_GENERIC=y +# CONFIG_PCI_V3_SEMI is not set +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PHYLIB=y +CONFIG_PL310_ERRATA_588369=y +CONFIG_PL310_ERRATA_727915=y +CONFIG_PL310_ERRATA_753970=y +CONFIG_PL310_ERRATA_769419=y +CONFIG_PPP=m +CONFIG_PPPOE=m +CONFIG_PPP_ASYNC=m +CONFIG_PPS=y +CONFIG_PPS_CLIENT_GPIO=y +CONFIG_PRINTK_TIME=y +CONFIG_PROC_VMCORE=y +CONFIG_RAID_ATTRS=y +CONFIG_RATIONAL=y +CONFIG_RCU_NEED_SEGCBLIST=y +CONFIG_RCU_STALL_COMMON=y +CONFIG_REFCOUNT_FULL=y +CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y +CONFIG_REGMAP_SPI=y +CONFIG_RELAY=y +CONFIG_RFS_ACCEL=y +CONFIG_RPS=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_DS1672=y +CONFIG_RTC_I2C_AND_SPI=y +CONFIG_RTC_MC146818_LIB=y +CONFIG_RWSEM_SPIN_ON_OWNER=y +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_SATA_AHCI=y +CONFIG_SATA_AHCI_PLATFORM=y +CONFIG_SCSI=y +CONFIG_SENSORS_AD7418=y +CONFIG_SERIAL_8250_FSL=y +CONFIG_SERIAL_8250_NR_UARTS=3 +CONFIG_SERIAL_8250_RUNTIME_UARTS=3 +CONFIG_SG_POOL=y +CONFIG_SLHC=m +CONFIG_SMP=y +CONFIG_SMP_ON_UP=y +CONFIG_SPARSE_IRQ=y +CONFIG_SPI=y +CONFIG_SPI_BITBANG=y +CONFIG_SPI_CNS3XXX=y +CONFIG_SPI_MASTER=y +CONFIG_SPI_MEM=y +CONFIG_SRCU=y +# CONFIG_STAGING is not set +CONFIG_SWPHY=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TIMER_OF=y +CONFIG_TIMER_PROBE=y +CONFIG_TREE_RCU=y +CONFIG_TREE_SRCU=y +CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" +CONFIG_USB=y +CONFIG_USB_ANNOUNCE_NEW_DEVICES=y +CONFIG_USB_CNS3XXX_EHCI=y +CONFIG_USB_CNS3XXX_OHCI=y +CONFIG_USB_COMMON=y +CONFIG_USB_DWC2=y +CONFIG_USB_DWC2_HOST=y +# CONFIG_USB_DWC2_TRACK_MISSED_SOFS is not set +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_EHCI_HCD_PLATFORM=y +CONFIG_USB_GADGET=y +CONFIG_USB_OHCI_HCD=y +CONFIG_USB_OHCI_HCD_PLATFORM=y +# CONFIG_USB_ROLE_SWITCH is not set +CONFIG_USB_SUPPORT=y +CONFIG_USE_OF=y +CONFIG_VFP=y +CONFIG_WATCHDOG_CORE=y +CONFIG_WATCHDOG_NOWAYOUT=y +CONFIG_XPS=y +CONFIG_XZ_DEC_ARM=y +CONFIG_XZ_DEC_BCJ=y +CONFIG_ZBOOT_ROM_BSS=0 +CONFIG_ZBOOT_ROM_TEXT=0 diff --git a/target/linux/cns3xxx/patches-4.14/090-timers.patch b/target/linux/cns3xxx/patches-4.14/090-timers.patch index 34a4934d6..b3810f8c9 100644 --- a/target/linux/cns3xxx/patches-4.14/090-timers.patch +++ b/target/linux/cns3xxx/patches-4.14/090-timers.patch @@ -17,15 +17,17 @@ writel(reload, cns3xxx_tmr1 + TIMER1_AUTO_RELOAD_OFFSET); ctrl |= (1 << 0) | (1 << 2) | (1 << 9); writel(ctrl, cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET); -@@ -175,7 +176,7 @@ static struct clock_event_device cns3xxx +@@ -175,8 +176,8 @@ static struct clock_event_device cns3xxx .set_state_oneshot = cns3xxx_set_oneshot, .tick_resume = cns3xxx_shutdown, .set_next_event = cns3xxx_timer_set_next_event, - .rating = 350, +- .cpumask = cpu_all_mask, + .rating = 300, - .cpumask = cpu_all_mask, ++ .cpumask = cpu_possible_mask, }; + static void __init cns3xxx_clockevents_init(unsigned int timer_irq) @@ -220,6 +221,32 @@ static void __init cns3xxx_init_twd(void twd_local_timer_register(&cns3xx_twd_local_timer); } diff --git a/target/linux/cns3xxx/patches-4.19/000-cns3xxx_arch_include.patch b/target/linux/cns3xxx/patches-4.19/000-cns3xxx_arch_include.patch new file mode 100644 index 000000000..3ae759021 --- /dev/null +++ b/target/linux/cns3xxx/patches-4.19/000-cns3xxx_arch_include.patch @@ -0,0 +1,9 @@ +--- a/arch/arm/mach-cns3xxx/Makefile ++++ b/arch/arm/mach-cns3xxx/Makefile +@@ -1,4 +1,6 @@ + # SPDX-License-Identifier: GPL-2.0 ++ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include ++ + obj-$(CONFIG_ARCH_CNS3XXX) += cns3xxx.o + cns3xxx-y += core.o pm.o + cns3xxx-$(CONFIG_ATAGS) += devices.o diff --git a/target/linux/cns3xxx/patches-4.19/001-arm_openwrt_machtypes.patch b/target/linux/cns3xxx/patches-4.19/001-arm_openwrt_machtypes.patch new file mode 100644 index 000000000..f323deee4 --- /dev/null +++ b/target/linux/cns3xxx/patches-4.19/001-arm_openwrt_machtypes.patch @@ -0,0 +1,10 @@ +--- a/arch/arm/tools/mach-types ++++ b/arch/arm/tools/mach-types +@@ -449,6 +449,7 @@ gplugd MACH_GPLUGD GPLUGD 2625 + qsd8x50a_st1_5 MACH_QSD8X50A_ST1_5 QSD8X50A_ST1_5 2627 + mx23evk MACH_MX23EVK MX23EVK 2629 + ap4evb MACH_AP4EVB AP4EVB 2630 ++gw2388 MACH_GW2388 GW2388 2635 + mityomapl138 MACH_MITYOMAPL138 MITYOMAPL138 2650 + guruplug MACH_GURUPLUG GURUPLUG 2659 + spear310 MACH_SPEAR310 SPEAR310 2660 diff --git a/target/linux/cns3xxx/patches-4.19/010-arm_introduce-dma-fiq-irq-broadcast.patch b/target/linux/cns3xxx/patches-4.19/010-arm_introduce-dma-fiq-irq-broadcast.patch new file mode 100644 index 000000000..45f8feead --- /dev/null +++ b/target/linux/cns3xxx/patches-4.19/010-arm_introduce-dma-fiq-irq-broadcast.patch @@ -0,0 +1,80 @@ +--- a/arch/arm/include/asm/glue-cache.h ++++ b/arch/arm/include/asm/glue-cache.h +@@ -156,9 +156,15 @@ static inline void nop_dma_unmap_area(co + #define __cpuc_flush_user_range __glue(_CACHE,_flush_user_cache_range) + #define __cpuc_coherent_kern_range __glue(_CACHE,_coherent_kern_range) + #define __cpuc_coherent_user_range __glue(_CACHE,_coherent_user_range) +-#define __cpuc_flush_dcache_area __glue(_CACHE,_flush_kern_dcache_area) + +-#define dmac_flush_range __glue(_CACHE,_dma_flush_range) ++#ifndef CONFIG_DMA_CACHE_FIQ_BROADCAST ++# define __cpuc_flush_dcache_area __glue(_CACHE,_flush_kern_dcache_area) ++# define dmac_flush_range __glue(_CACHE,_dma_flush_range) ++#else ++# define __cpuc_flush_dcache_area __glue(fiq,_flush_kern_dcache_area) ++# define dmac_flush_range __glue(fiq,_dma_flush_range) ++#endif ++ + #endif + + #endif +--- a/arch/arm/mm/Kconfig ++++ b/arch/arm/mm/Kconfig +@@ -916,6 +916,17 @@ config DMA_CACHE_RWFO + in hardware, other workarounds are needed (e.g. cache + maintenance broadcasting in software via FIQ). + ++config DMA_CACHE_FIQ_BROADCAST ++ bool "Enable fiq broadcast DMA cache maintenance" ++ depends on CPU_V6K && SMP ++ select FIQ ++ help ++ The Snoop Control Unit on ARM11MPCore does not detect the ++ cache maintenance operations and the dma_{map,unmap}_area() ++ functions may leave stale cache entries on other CPUs. By ++ enabling this option, fiq broadcast in the ARMv6 ++ DMA cache maintenance functions is performed. ++ + config OUTER_CACHE + bool + +--- a/arch/arm/mm/flush.c ++++ b/arch/arm/mm/flush.c +@@ -319,6 +319,7 @@ void __sync_icache_dcache(pte_t pteval) + void flush_dcache_page(struct page *page) + { + struct address_space *mapping; ++ bool skip_broadcast = true; + + /* + * The zero page is never written to, so never has any dirty +@@ -335,7 +336,10 @@ void flush_dcache_page(struct page *page + + mapping = page_mapping_file(page); + +- if (!cache_ops_need_broadcast() && ++#ifndef CONFIG_DMA_CACHE_FIQ_BROADCAST ++ skip_broadcast = !cache_ops_need_broadcast(); ++#endif ++ if (skip_broadcast && + mapping && !page_mapcount(page)) + clear_bit(PG_dcache_clean, &page->flags); + else { +--- a/arch/arm/mm/dma.h ++++ b/arch/arm/mm/dma.h +@@ -5,8 +5,13 @@ + #include + + #ifndef MULTI_CACHE +-#define dmac_map_area __glue(_CACHE,_dma_map_area) +-#define dmac_unmap_area __glue(_CACHE,_dma_unmap_area) ++#ifndef CONFIG_DMA_CACHE_FIQ_BROADCAST ++# define dmac_map_area __glue(_CACHE,_dma_map_area) ++# define dmac_unmap_area __glue(_CACHE,_dma_unmap_area) ++#else ++# define dmac_map_area __glue(fiq,_dma_map_area) ++# define dmac_unmap_area __glue(fiq,_dma_unmap_area) ++#endif + + /* + * These are private to the dma-mapping API. Do not use directly. diff --git a/target/linux/cns3xxx/patches-4.19/020-watchdog_support.patch b/target/linux/cns3xxx/patches-4.19/020-watchdog_support.patch new file mode 100644 index 000000000..e626ff29b --- /dev/null +++ b/target/linux/cns3xxx/patches-4.19/020-watchdog_support.patch @@ -0,0 +1,184 @@ +Add a watchdog driver for ARM MPcore processors. + +Signed-off-by: Felix Fietkau +--- a/drivers/watchdog/Kconfig ++++ b/drivers/watchdog/Kconfig +@@ -375,6 +375,13 @@ config KS8695_WATCHDOG + Watchdog timer embedded into KS8695 processor. This will reboot your + system when the timeout is reached. + ++config MPCORE_WATCHDOG ++ tristate "MPcore watchdog" ++ depends on HAVE_ARM_TWD ++ select WATCHDOG_CORE ++ help ++ Watchdog timer embedded into the MPcore system ++ + config HAVE_S3C2410_WATCHDOG + bool + help +--- a/drivers/watchdog/Makefile ++++ b/drivers/watchdog/Makefile +@@ -49,6 +49,7 @@ obj-$(CONFIG_977_WATCHDOG) += wdt977.o + obj-$(CONFIG_FTWDT010_WATCHDOG) += ftwdt010_wdt.o + obj-$(CONFIG_IXP4XX_WATCHDOG) += ixp4xx_wdt.o + obj-$(CONFIG_KS8695_WATCHDOG) += ks8695_wdt.o ++obj-$(CONFIG_MPCORE_WATCHDOG) += mpcore_wdt.o + obj-$(CONFIG_S3C2410_WATCHDOG) += s3c2410_wdt.o + obj-$(CONFIG_SA1100_WATCHDOG) += sa1100_wdt.o + obj-$(CONFIG_SAMA5D4_WATCHDOG) += sama5d4_wdt.o +--- /dev/null ++++ b/drivers/watchdog/mpcore_wdt.c +@@ -0,0 +1,118 @@ ++/* ++ * Watchdog driver for ARM MPcore ++ * ++ * Copyright (C) 2017 Felix Fietkau ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static void __iomem *wdt_base; ++static int wdt_timeout = 60; ++ ++static int mpcore_wdt_keepalive(struct watchdog_device *wdd) ++{ ++ static int perturb; ++ u32 count; ++ ++ count = (twd_timer_get_rate() / 256) * wdt_timeout; ++ ++ /* Reload register needs a different value on each refresh */ ++ count += perturb; ++ perturb = !perturb; ++ ++ iowrite32(count, wdt_base + TWD_WDOG_LOAD); ++ ++ return 0; ++} ++ ++static int mpcore_wdt_start(struct watchdog_device *wdd) ++{ ++ mpcore_wdt_keepalive(wdd); ++ ++ /* prescale = 256, mode = 1, enable = 1 */ ++ iowrite32(0x0000FF09, wdt_base + TWD_WDOG_CONTROL); ++ ++ return 0; ++} ++ ++static int mpcore_wdt_stop(struct watchdog_device *wdd) ++{ ++ iowrite32(0x12345678, wdt_base + TWD_WDOG_DISABLE); ++ iowrite32(0x87654321, wdt_base + TWD_WDOG_DISABLE); ++ iowrite32(0x0, wdt_base + TWD_WDOG_CONTROL); ++ ++ return 0; ++} ++ ++static int mpcore_wdt_set_timeout(struct watchdog_device *wdd, ++ unsigned int timeout) ++{ ++ mpcore_wdt_stop(wdd); ++ wdt_timeout = timeout; ++ mpcore_wdt_start(wdd); ++ ++ return 0; ++} ++ ++static const struct watchdog_info mpcore_wdt_info = { ++ .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE, ++ .identity = "MPcore Watchdog", ++}; ++ ++static const struct watchdog_ops mpcore_wdt_ops = { ++ .owner = THIS_MODULE, ++ .start = mpcore_wdt_start, ++ .stop = mpcore_wdt_stop, ++ .ping = mpcore_wdt_keepalive, ++ .set_timeout = mpcore_wdt_set_timeout, ++}; ++ ++static struct watchdog_device mpcore_wdt = { ++ .info = &mpcore_wdt_info, ++ .ops = &mpcore_wdt_ops, ++ .min_timeout = 1, ++ .max_timeout = 65535, ++}; ++ ++static int mpcore_wdt_probe(struct platform_device *pdev) ++{ ++ struct resource *res; ++ unsigned long rate = twd_timer_get_rate(); ++ ++ pr_info("MPCore WD init. clockrate: %lu prescaler: %u countrate: %lu timeout: %us\n", rate, 256, rate / 256, wdt_timeout); ++ ++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ if (!res) ++ return -ENODEV; ++ ++ wdt_base = devm_ioremap_resource(&pdev->dev, res); ++ if (IS_ERR(wdt_base)) ++ return PTR_ERR(wdt_base); ++ ++ watchdog_register_device(&mpcore_wdt); ++ return 0; ++} ++ ++static int mpcore_wdt_remove(struct platform_device *dev) ++{ ++ watchdog_unregister_device(&mpcore_wdt); ++ return 0; ++} ++ ++static struct platform_driver mpcore_wdt_driver = { ++ .probe = mpcore_wdt_probe, ++ .remove = mpcore_wdt_remove, ++ .driver = { ++ .name = "mpcore_wdt", ++ }, ++}; ++ ++module_platform_driver(mpcore_wdt_driver); ++MODULE_AUTHOR("Felix Fietkau "); ++MODULE_LICENSE("GPL"); +--- a/arch/arm/include/asm/smp_twd.h ++++ b/arch/arm/include/asm/smp_twd.h +@@ -34,5 +34,6 @@ struct twd_local_timer name __initdata = + }; + + int twd_local_timer_register(struct twd_local_timer *); ++unsigned long twd_timer_get_rate(void); + + #endif +--- a/arch/arm/kernel/smp_twd.c ++++ b/arch/arm/kernel/smp_twd.c +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -380,6 +381,14 @@ int __init twd_local_timer_register(stru + return twd_local_timer_common_register(NULL); + } + ++/* Needed by mpcore_wdt */ ++unsigned long twd_timer_get_rate(void) ++{ ++ return twd_timer_rate; ++} ++EXPORT_SYMBOL_GPL(twd_timer_get_rate); ++ ++ + #ifdef CONFIG_OF + static int __init twd_local_timer_of_register(struct device_node *np) + { diff --git a/target/linux/cns3xxx/patches-4.19/025-smp_support.patch b/target/linux/cns3xxx/patches-4.19/025-smp_support.patch new file mode 100644 index 000000000..dc8e4b03c --- /dev/null +++ b/target/linux/cns3xxx/patches-4.19/025-smp_support.patch @@ -0,0 +1,30 @@ +--- a/arch/arm/mach-cns3xxx/Makefile ++++ b/arch/arm/mach-cns3xxx/Makefile +@@ -6,3 +6,5 @@ cns3xxx-y += core.o pm.o + cns3xxx-$(CONFIG_ATAGS) += devices.o + cns3xxx-$(CONFIG_PCI) += pcie.o + cns3xxx-$(CONFIG_MACH_CNS3420VB) += cns3420vb.o ++cns3xxx-$(CONFIG_SMP) += platsmp.o headsmp.o ++cns3xxx-$(CONFIG_HOTPLUG_CPU) += hotplug.o +--- a/arch/arm/mach-cns3xxx/Kconfig ++++ b/arch/arm/mach-cns3xxx/Kconfig +@@ -3,6 +3,9 @@ menuconfig ARCH_CNS3XXX + bool "Cavium Networks CNS3XXX family" + depends on ARCH_MULTI_V6 + select ARM_GIC ++ select HAVE_ARM_SCU if SMP ++ select HAVE_ARM_TWD ++ select HAVE_SMP + help + Support for Cavium Networks CNS3XXX platform. + +--- a/arch/arm/mach-cns3xxx/core.h ++++ b/arch/arm/mach-cns3xxx/core.h +@@ -13,6 +13,7 @@ + + #include + ++extern struct smp_operations cns3xxx_smp_ops; + extern void cns3xxx_timer_init(void); + + #ifdef CONFIG_CACHE_L2X0 diff --git a/target/linux/cns3xxx/patches-4.19/030-pcie_clock.patch b/target/linux/cns3xxx/patches-4.19/030-pcie_clock.patch new file mode 100644 index 000000000..66c3a99ae --- /dev/null +++ b/target/linux/cns3xxx/patches-4.19/030-pcie_clock.patch @@ -0,0 +1,11 @@ +--- a/arch/arm/mach-cns3xxx/pcie.c ++++ b/arch/arm/mach-cns3xxx/pcie.c +@@ -281,8 +281,6 @@ void __init cns3xxx_pcie_init_late(void) + "imprecise external abort"); + + for (i = 0; i < ARRAY_SIZE(cns3xxx_pcie); i++) { +- cns3xxx_pwr_clk_en(0x1 << PM_CLK_GATE_REG_OFFSET_PCIE(i)); +- cns3xxx_pwr_soft_rst(0x1 << PM_SOFT_RST_REG_OFFST_PCIE(i)); + cns3xxx_pcie_check_link(&cns3xxx_pcie[i]); + cns3xxx_pcie_hw_init(&cns3xxx_pcie[i]); + private_data = &cns3xxx_pcie[i]; diff --git a/target/linux/cns3xxx/patches-4.19/040-fiq_support.patch b/target/linux/cns3xxx/patches-4.19/040-fiq_support.patch new file mode 100644 index 000000000..bee8c1ef2 --- /dev/null +++ b/target/linux/cns3xxx/patches-4.19/040-fiq_support.patch @@ -0,0 +1,40 @@ +--- a/arch/arm/mach-cns3xxx/Kconfig ++++ b/arch/arm/mach-cns3xxx/Kconfig +@@ -6,6 +6,7 @@ menuconfig ARCH_CNS3XXX + select HAVE_ARM_SCU if SMP + select HAVE_ARM_TWD + select HAVE_SMP ++ select FIQ + help + Support for Cavium Networks CNS3XXX platform. + +--- a/arch/arm/mach-cns3xxx/Makefile ++++ b/arch/arm/mach-cns3xxx/Makefile +@@ -6,5 +6,5 @@ cns3xxx-y += core.o pm.o + cns3xxx-$(CONFIG_ATAGS) += devices.o + cns3xxx-$(CONFIG_PCI) += pcie.o + cns3xxx-$(CONFIG_MACH_CNS3420VB) += cns3420vb.o +-cns3xxx-$(CONFIG_SMP) += platsmp.o headsmp.o ++cns3xxx-$(CONFIG_SMP) += platsmp.o headsmp.o cns3xxx_fiq.o + cns3xxx-$(CONFIG_HOTPLUG_CPU) += hotplug.o +--- a/arch/arm/mach-cns3xxx/cns3xxx.h ++++ b/arch/arm/mach-cns3xxx/cns3xxx.h +@@ -261,6 +261,7 @@ + #define MISC_PCIE_INT_MASK(x) MISC_MEM_MAP(0x978 + (x) * 0x100) + #define MISC_PCIE_INT_STATUS(x) MISC_MEM_MAP(0x97C + (x) * 0x100) + ++#define MISC_FIQ_CPU(x) MISC_MEM_MAP(0xA58 - (x) * 0x4) + /* + * Power management and clock control + */ +--- a/arch/arm/mm/Kconfig ++++ b/arch/arm/mm/Kconfig +@@ -899,7 +899,7 @@ config VDSO + + config DMA_CACHE_RWFO + bool "Enable read/write for ownership DMA cache maintenance" +- depends on CPU_V6K && SMP ++ depends on CPU_V6K && SMP && !ARCH_CNS3XXX + default y + help + The Snoop Control Unit on ARM11MPCore does not detect the diff --git a/target/linux/cns3xxx/patches-4.19/045-twd_base.patch b/target/linux/cns3xxx/patches-4.19/045-twd_base.patch new file mode 100644 index 000000000..e722b01bb --- /dev/null +++ b/target/linux/cns3xxx/patches-4.19/045-twd_base.patch @@ -0,0 +1,43 @@ +--- a/arch/arm/mach-cns3xxx/core.c ++++ b/arch/arm/mach-cns3xxx/core.c +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -26,6 +27,8 @@ + #include "core.h" + #include "pm.h" + ++#define IRQ_LOCALTIMER 29 ++ + static struct map_desc cns3xxx_io_desc[] __initdata = { + { + .virtual = CNS3XXX_TC11MP_SCU_BASE_VIRT, +@@ -198,6 +201,15 @@ static struct irqaction cns3xxx_timer_ir + .handler = cns3xxx_timer_interrupt, + }; + ++static void __init cns3xxx_init_twd(void) ++{ ++ static DEFINE_TWD_LOCAL_TIMER(cns3xx_twd_local_timer, ++ CNS3XXX_TC11MP_TWD_BASE, ++ IRQ_LOCALTIMER); ++ ++ twd_local_timer_register(&cns3xx_twd_local_timer); ++} ++ + /* + * Set up the clock source and clock events devices + */ +@@ -251,6 +263,7 @@ static void __init __cns3xxx_timer_init( + setup_irq(timer_irq, &cns3xxx_timer_irq); + + cns3xxx_clockevents_init(timer_irq); ++ cns3xxx_init_twd(); + } + + void __init cns3xxx_timer_init(void) diff --git a/target/linux/cns3xxx/patches-4.19/055-pcie_io.patch b/target/linux/cns3xxx/patches-4.19/055-pcie_io.patch new file mode 100644 index 000000000..4680853e6 --- /dev/null +++ b/target/linux/cns3xxx/patches-4.19/055-pcie_io.patch @@ -0,0 +1,19 @@ +--- a/arch/arm/mach-cns3xxx/core.c ++++ b/arch/arm/mach-cns3xxx/core.c +@@ -81,6 +81,16 @@ static struct map_desc cns3xxx_io_desc[] + .pfn = __phys_to_pfn(CNS3XXX_PCIE1_CFG1_BASE), + .length = SZ_16M, + .type = MT_DEVICE, ++ }, { ++ .virtual = CNS3XXX_PCIE0_IO_BASE_VIRT, ++ .pfn = __phys_to_pfn(CNS3XXX_PCIE0_IO_BASE), ++ .length = SZ_16M, ++ .type = MT_DEVICE, ++ }, { ++ .virtual = CNS3XXX_PCIE1_IO_BASE_VIRT, ++ .pfn = __phys_to_pfn(CNS3XXX_PCIE1_IO_BASE), ++ .length = SZ_16M, ++ .type = MT_DEVICE, + #endif + }, + }; diff --git a/target/linux/cns3xxx/patches-4.19/060-pcie_abort.patch b/target/linux/cns3xxx/patches-4.19/060-pcie_abort.patch new file mode 100644 index 000000000..87b1526c3 --- /dev/null +++ b/target/linux/cns3xxx/patches-4.19/060-pcie_abort.patch @@ -0,0 +1,109 @@ +--- a/arch/arm/mach-cns3xxx/pcie.c ++++ b/arch/arm/mach-cns3xxx/pcie.c +@@ -86,6 +86,79 @@ static void __iomem *cns3xxx_pci_map_bus + return base + where + (devfn << 12); + } + ++static inline int check_master_abort(struct pci_bus *bus, unsigned int devfn, int where) ++{ ++ struct cns3xxx_pcie *cnspci = pbus_to_cnspci(bus); ++ ++ /* check PCI-compatible status register after access */ ++ if (cnspci->linked) { ++ void __iomem *host_base; ++ u32 sreg, ereg; ++ ++ host_base = (void __iomem *) cnspci->cfg_bases[CNS3XXX_HOST_TYPE].virtual; ++ sreg = __raw_readw(host_base + 0x6) & 0xF900; ++ ereg = __raw_readl(host_base + 0x104); // Uncorrectable Error Status Reg ++ ++ if (sreg | ereg) { ++ /* SREG: ++ * BIT15 - Detected Parity Error ++ * BIT14 - Signaled System Error ++ * BIT13 - Received Master Abort ++ * BIT12 - Received Target Abort ++ * BIT11 - Signaled Target Abort ++ * BIT08 - Master Data Parity Error ++ * ++ * EREG: ++ * BIT20 - Unsupported Request ++ * BIT19 - ECRC ++ * BIT18 - Malformed TLP ++ * BIT17 - Receiver Overflow ++ * BIT16 - Unexpected Completion ++ * BIT15 - Completer Abort ++ * BIT14 - Completion Timeout ++ * BIT13 - Flow Control Protocol Error ++ * BIT12 - Poisoned TLP ++ * BIT04 - Data Link Protocol Error ++ * ++ * TODO: see Documentation/pci-error-recovery.txt ++ * implement error_detected handler ++ */ ++/* ++ printk("pci error: %04d:%02x:%02x.%02x sreg=0x%04x ereg=0x%08x", pci_domain_nr(bus), bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn), sreg, ereg); ++ if (sreg & BIT(15)) printk(" SERR"); ++ if (sreg & BIT(13)) printk(" TABRT"); ++ if (sreg & BIT( 8)) printk(" MPERR"); ++ ++ if (ereg & BIT(20)) printk(" Unsup"); ++ if (ereg & BIT(19)) printk(" ECRC"); ++ if (ereg & BIT(18)) printk(" MTLP"); ++ if (ereg & BIT(17)) printk(" OFLOW"); ++ if (ereg & BIT(16)) printk(" Unex"); ++ if (ereg & BIT(15)) printk(" ABRT"); ++ if (ereg & BIT(14)) printk(" COMPTO"); ++ if (ereg & BIT(13)) printk(" FLOW"); ++ if (ereg & BIT(12)) printk(" PTLP"); ++ if (ereg & BIT( 4)) printk(" DLINK"); ++ printk("\n"); ++*/ ++ pr_debug("%s failed port%d sreg=0x%04x\n", __func__, ++ pci_domain_nr(bus), sreg); ++ ++ /* make sure the status bits are reset */ ++ __raw_writew(sreg, host_base + 6); ++ __raw_writel(ereg, host_base + 0x104); ++ return 1; ++ } ++ } ++ else ++ return 1; ++ ++ return 0; ++} ++ + static int cns3xxx_pci_read_config(struct pci_bus *bus, unsigned int devfn, + int where, int size, u32 *val) + { +@@ -95,6 +168,11 @@ static int cns3xxx_pci_read_config(struc + + ret = pci_generic_config_read(bus, devfn, where, size, val); + ++ if (check_master_abort(bus, devfn, where)) { ++ printk(KERN_ERR "pci error: %04d:%02x:%02x.%02x %02x(%d)= master_abort on read\n", pci_domain_nr(bus), bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn), where, size); ++ return PCIBIOS_DEVICE_NOT_FOUND; ++ } ++ + if (ret == PCIBIOS_SUCCESSFUL && !bus->number && !devfn && + (where & 0xffc) == PCI_CLASS_REVISION) + /* +@@ -257,8 +335,14 @@ static void __init cns3xxx_pcie_hw_init( + static int cns3xxx_pcie_abort_handler(unsigned long addr, unsigned int fsr, + struct pt_regs *regs) + { ++#if 0 ++/* R14_ABORT = PC+4 for XSCALE but not ARM11MPCORE ++ * ignore imprecise aborts and use PCI-compatible Status register to ++ * determine errors instead ++ */ + if (fsr & (1 << 10)) + regs->ARM_pc += 4; ++#endif + return 0; + } + diff --git a/target/linux/cns3xxx/patches-4.19/065-pcie_skip_inactive.patch b/target/linux/cns3xxx/patches-4.19/065-pcie_skip_inactive.patch new file mode 100644 index 000000000..b8b5f273a --- /dev/null +++ b/target/linux/cns3xxx/patches-4.19/065-pcie_skip_inactive.patch @@ -0,0 +1,11 @@ +--- a/arch/arm/mach-cns3xxx/pcie.c ++++ b/arch/arm/mach-cns3xxx/pcie.c +@@ -366,6 +366,8 @@ void __init cns3xxx_pcie_init_late(void) + + for (i = 0; i < ARRAY_SIZE(cns3xxx_pcie); i++) { + cns3xxx_pcie_check_link(&cns3xxx_pcie[i]); ++ if (!cns3xxx_pcie[i].linked) ++ continue; + cns3xxx_pcie_hw_init(&cns3xxx_pcie[i]); + private_data = &cns3xxx_pcie[i]; + pci_common_init(&hw_pci); diff --git a/target/linux/cns3xxx/patches-4.19/070-i2c_support.patch b/target/linux/cns3xxx/patches-4.19/070-i2c_support.patch new file mode 100644 index 000000000..e151bf90f --- /dev/null +++ b/target/linux/cns3xxx/patches-4.19/070-i2c_support.patch @@ -0,0 +1,31 @@ +--- a/drivers/i2c/busses/Kconfig ++++ b/drivers/i2c/busses/Kconfig +@@ -458,6 +458,18 @@ config I2C_CBUS_GPIO + This driver can also be built as a module. If so, the module + will be called i2c-cbus-gpio. + ++config I2C_CNS3XXX ++ tristate "Cavium CNS3xxx I2C driver" ++ depends on ARCH_CNS3XXX ++ help ++ Support for Cavium CNS3xxx I2C controller driver. ++ ++ This driver can also be built as a module. If so, the module ++ will be called i2c-cns3xxx. ++ ++ Please note that this driver might be needed to bring up other ++ devices such as Cavium CNS3xxx Ethernet. ++ + config I2C_CPM + tristate "Freescale CPM1 or CPM2 (MPC8xx/826x)" + depends on CPM1 || CPM2 +--- a/drivers/i2c/busses/Makefile ++++ b/drivers/i2c/busses/Makefile +@@ -131,6 +131,7 @@ obj-$(CONFIG_I2C_VIPERBOARD) += i2c-vipe + obj-$(CONFIG_I2C_ACORN) += i2c-acorn.o + obj-$(CONFIG_I2C_BCM_KONA) += i2c-bcm-kona.o + obj-$(CONFIG_I2C_BRCMSTB) += i2c-brcmstb.o ++obj-$(CONFIG_I2C_CNS3XXX) += i2c-cns3xxx.o + obj-$(CONFIG_I2C_CROS_EC_TUNNEL) += i2c-cros-ec-tunnel.o + obj-$(CONFIG_I2C_ELEKTOR) += i2c-elektor.o + obj-$(CONFIG_I2C_MLXCPLD) += i2c-mlxcpld.o diff --git a/target/linux/cns3xxx/patches-4.19/075-spi_support.patch b/target/linux/cns3xxx/patches-4.19/075-spi_support.patch new file mode 100644 index 000000000..e4bd12934 --- /dev/null +++ b/target/linux/cns3xxx/patches-4.19/075-spi_support.patch @@ -0,0 +1,51 @@ +--- a/drivers/spi/Kconfig ++++ b/drivers/spi/Kconfig +@@ -181,6 +181,13 @@ config SPI_CLPS711X + This enables dedicated general purpose SPI/Microwire1-compatible + master mode interface (SSI1) for CLPS711X-based CPUs. + ++config SPI_CNS3XXX ++ tristate "CNS3XXX SPI controller" ++ depends on ARCH_CNS3XXX && SPI_MASTER ++ select SPI_BITBANG ++ help ++ This enables using the CNS3XXX SPI controller in master mode. ++ + config SPI_COLDFIRE_QSPI + tristate "Freescale Coldfire QSPI controller" + depends on (M520x || M523x || M5249 || M525x || M527x || M528x || M532x) +--- a/drivers/spi/Makefile ++++ b/drivers/spi/Makefile +@@ -28,6 +28,7 @@ obj-$(CONFIG_SPI_BITBANG) += spi-bitban + obj-$(CONFIG_SPI_BUTTERFLY) += spi-butterfly.o + obj-$(CONFIG_SPI_CADENCE) += spi-cadence.o + obj-$(CONFIG_SPI_CLPS711X) += spi-clps711x.o ++obj-$(CONFIG_SPI_CNS3XXX) += spi-cns3xxx.o + obj-$(CONFIG_SPI_COLDFIRE_QSPI) += spi-coldfire-qspi.o + obj-$(CONFIG_SPI_DAVINCI) += spi-davinci.o + obj-$(CONFIG_SPI_DLN2) += spi-dln2.o +--- a/include/linux/spi/spi.h ++++ b/include/linux/spi/spi.h +@@ -795,6 +795,10 @@ struct spi_transfer { + u32 speed_hz; + + struct list_head transfer_list; ++ ++#ifdef CONFIG_ARCH_CNS3XXX ++ unsigned last_in_message_list; ++#endif + }; + + /** +--- a/drivers/spi/spi.c ++++ b/drivers/spi/spi.c +@@ -1018,6 +1018,9 @@ static int spi_transfer_one_message(stru + list_for_each_entry(xfer, &msg->transfers, transfer_list) { + trace_spi_transfer_start(msg, xfer); + ++ xfer->last_in_message_list = ++ list_is_last(&xfer->transfer_list, &msg->transfers); ++ + spi_statistics_add_transfer_stats(statm, xfer, ctlr); + spi_statistics_add_transfer_stats(stats, xfer, ctlr); + diff --git a/target/linux/cns3xxx/patches-4.19/080-sata_support.patch b/target/linux/cns3xxx/patches-4.19/080-sata_support.patch new file mode 100644 index 000000000..20871916f --- /dev/null +++ b/target/linux/cns3xxx/patches-4.19/080-sata_support.patch @@ -0,0 +1,26 @@ +--- a/drivers/ata/ahci_platform.c ++++ b/drivers/ata/ahci_platform.c +@@ -37,12 +37,23 @@ static struct scsi_host_template ahci_pl + AHCI_SHT(DRV_NAME), + }; + ++static const struct ata_port_info cns3xxx_port_info = { ++ .flags = AHCI_FLAG_COMMON, ++ .pio_mask = ATA_PIO4, ++ .udma_mask = ATA_UDMA6, ++ .port_ops = &ahci_pmp_retry_srst_ops, ++}; ++ + static int ahci_probe(struct platform_device *pdev) + { + struct device *dev = &pdev->dev; + struct ahci_host_priv *hpriv; ++ const struct ata_port_info *info = &ahci_port_info; + int rc; + ++ if (IS_ENABLED(CONFIG_ARCH_CNS3XXX)) ++ info = &cns3xxx_port_info; ++ + hpriv = ahci_platform_get_resources(pdev, + AHCI_PLATFORM_GET_RESETS); + if (IS_ERR(hpriv)) diff --git a/target/linux/cns3xxx/patches-4.19/090-timers.patch b/target/linux/cns3xxx/patches-4.19/090-timers.patch new file mode 100644 index 000000000..b3810f8c9 --- /dev/null +++ b/target/linux/cns3xxx/patches-4.19/090-timers.patch @@ -0,0 +1,105 @@ +--- a/arch/arm/mach-cns3xxx/core.c ++++ b/arch/arm/mach-cns3xxx/core.c +@@ -138,6 +138,7 @@ static int cns3xxx_set_oneshot(struct cl + + /* period set, and timer enabled in 'next_event' hook */ + ctrl |= (1 << 2) | (1 << 9); ++ writel(0, cns3xxx_tmr1 + TIMER1_AUTO_RELOAD_OFFSET); + writel(ctrl, cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET); + return 0; + } +@@ -148,7 +149,7 @@ static int cns3xxx_set_periodic(struct c + int pclk = cns3xxx_cpu_clock() / 8; + int reload; + +- reload = pclk * 20 / (3 * HZ) * 0x25000; ++ reload = pclk * 1000000 / HZ; + writel(reload, cns3xxx_tmr1 + TIMER1_AUTO_RELOAD_OFFSET); + ctrl |= (1 << 0) | (1 << 2) | (1 << 9); + writel(ctrl, cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET); +@@ -175,8 +176,8 @@ static struct clock_event_device cns3xxx + .set_state_oneshot = cns3xxx_set_oneshot, + .tick_resume = cns3xxx_shutdown, + .set_next_event = cns3xxx_timer_set_next_event, +- .rating = 350, +- .cpumask = cpu_all_mask, ++ .rating = 300, ++ .cpumask = cpu_possible_mask, + }; + + static void __init cns3xxx_clockevents_init(unsigned int timer_irq) +@@ -220,6 +221,32 @@ static void __init cns3xxx_init_twd(void + twd_local_timer_register(&cns3xx_twd_local_timer); + } + ++static u64 cns3xxx_get_cycles(struct clocksource *cs) ++{ ++ u64 val; ++ ++ val = readl(cns3xxx_tmr1 + TIMER_FREERUN_CONTROL_OFFSET); ++ val &= 0xffff; ++ ++ return ((val << 32) | readl(cns3xxx_tmr1 + TIMER_FREERUN_OFFSET)); ++} ++ ++static struct clocksource clocksource_cns3xxx = { ++ .name = "freerun", ++ .rating = 200, ++ .read = cns3xxx_get_cycles, ++ .mask = CLOCKSOURCE_MASK(48), ++ .flags = CLOCK_SOURCE_IS_CONTINUOUS, ++}; ++ ++static void __init cns3xxx_clocksource_init(void) ++{ ++ /* Reset the FreeRunning counter */ ++ writel((1 << 16), cns3xxx_tmr1 + TIMER_FREERUN_CONTROL_OFFSET); ++ ++ clocksource_register_khz(&clocksource_cns3xxx, 100); ++} ++ + /* + * Set up the clock source and clock events devices + */ +@@ -237,13 +264,12 @@ static void __init __cns3xxx_timer_init( + /* stop free running timer3 */ + writel(0, cns3xxx_tmr1 + TIMER_FREERUN_CONTROL_OFFSET); + +- /* timer1 */ +- writel(0x5C800, cns3xxx_tmr1 + TIMER1_COUNTER_OFFSET); +- writel(0x5C800, cns3xxx_tmr1 + TIMER1_AUTO_RELOAD_OFFSET); +- + writel(0, cns3xxx_tmr1 + TIMER1_MATCH_V1_OFFSET); + writel(0, cns3xxx_tmr1 + TIMER1_MATCH_V2_OFFSET); + ++ val = (cns3xxx_cpu_clock() >> 3) * 1000000 / HZ; ++ writel(val, cns3xxx_tmr1 + TIMER1_COUNTER_OFFSET); ++ + /* mask irq, non-mask timer1 overflow */ + irq_mask = readl(cns3xxx_tmr1 + TIMER1_2_INTERRUPT_MASK_OFFSET); + irq_mask &= ~(1 << 2); +@@ -255,23 +281,9 @@ static void __init __cns3xxx_timer_init( + val |= (1 << 9); + writel(val, cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET); + +- /* timer2 */ +- writel(0, cns3xxx_tmr1 + TIMER2_MATCH_V1_OFFSET); +- writel(0, cns3xxx_tmr1 + TIMER2_MATCH_V2_OFFSET); +- +- /* mask irq */ +- irq_mask = readl(cns3xxx_tmr1 + TIMER1_2_INTERRUPT_MASK_OFFSET); +- irq_mask |= ((1 << 3) | (1 << 4) | (1 << 5)); +- writel(irq_mask, cns3xxx_tmr1 + TIMER1_2_INTERRUPT_MASK_OFFSET); +- +- /* down counter */ +- val = readl(cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET); +- val |= (1 << 10); +- writel(val, cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET); +- +- /* Make irqs happen for the system timer */ + setup_irq(timer_irq, &cns3xxx_timer_irq); + ++ cns3xxx_clocksource_init(); + cns3xxx_clockevents_init(timer_irq); + cns3xxx_init_twd(); + } diff --git a/target/linux/cns3xxx/patches-4.19/093-add-virt-pci-io-mapping.patch b/target/linux/cns3xxx/patches-4.19/093-add-virt-pci-io-mapping.patch new file mode 100644 index 000000000..0fa7ed483 --- /dev/null +++ b/target/linux/cns3xxx/patches-4.19/093-add-virt-pci-io-mapping.patch @@ -0,0 +1,41 @@ +--- a/arch/arm/mach-cns3xxx/cns3xxx.h ++++ b/arch/arm/mach-cns3xxx/cns3xxx.h +@@ -162,11 +162,13 @@ + #define CNS3XXX_L2C_BASE 0x92000000 /* L2 Cache Control */ + + #define CNS3XXX_PCIE0_MEM_BASE 0xA0000000 /* PCIe Port 0 IO/Memory Space */ ++#define CNS3XXX_PCIE0_MEM_BASE_VIRT 0xE0000000 + + #define CNS3XXX_PCIE0_HOST_BASE 0xAB000000 /* PCIe Port 0 RC Base */ + #define CNS3XXX_PCIE0_HOST_BASE_VIRT 0xE1000000 + + #define CNS3XXX_PCIE0_IO_BASE 0xAC000000 /* PCIe Port 0 */ ++#define CNS3XXX_PCIE0_IO_BASE_VIRT 0xE2000000 + + #define CNS3XXX_PCIE0_CFG0_BASE 0xAD000000 /* PCIe Port 0 CFG Type 0 */ + #define CNS3XXX_PCIE0_CFG0_BASE_VIRT 0xE3000000 +@@ -175,13 +177,16 @@ + #define CNS3XXX_PCIE0_CFG1_BASE_VIRT 0xE4000000 + + #define CNS3XXX_PCIE0_MSG_BASE 0xAF000000 /* PCIe Port 0 Message Space */ ++#define CNS3XXX_PCIE0_MSG_BASE_VIRT 0xE5000000 + + #define CNS3XXX_PCIE1_MEM_BASE 0xB0000000 /* PCIe Port 1 IO/Memory Space */ ++#define CNS3XXX_PCIE1_MEM_BASE_VIRT 0xE8000000 + + #define CNS3XXX_PCIE1_HOST_BASE 0xBB000000 /* PCIe Port 1 RC Base */ + #define CNS3XXX_PCIE1_HOST_BASE_VIRT 0xE9000000 + + #define CNS3XXX_PCIE1_IO_BASE 0xBC000000 /* PCIe Port 1 */ ++#define CNS3XXX_PCIE1_IO_BASE_VIRT 0xEA000000 + + #define CNS3XXX_PCIE1_CFG0_BASE 0xBD000000 /* PCIe Port 1 CFG Type 0 */ + #define CNS3XXX_PCIE1_CFG0_BASE_VIRT 0xEB000000 +@@ -190,6 +195,7 @@ + #define CNS3XXX_PCIE1_CFG1_BASE_VIRT 0xEC000000 + + #define CNS3XXX_PCIE1_MSG_BASE 0xBF000000 /* PCIe Port 1 Message Space */ ++#define CNS3XXX_PCIE1_MSG_BASE_VIRT 0xED000000 + + /* + * Testchip peripheral and fpga gic regions diff --git a/target/linux/cns3xxx/patches-4.19/095-gpio_support.patch b/target/linux/cns3xxx/patches-4.19/095-gpio_support.patch new file mode 100644 index 000000000..8345f2f14 --- /dev/null +++ b/target/linux/cns3xxx/patches-4.19/095-gpio_support.patch @@ -0,0 +1,67 @@ +--- a/arch/arm/mach-cns3xxx/cns3420vb.c ++++ b/arch/arm/mach-cns3xxx/cns3420vb.c +@@ -223,6 +223,10 @@ static void __init cns3420_init(void) + + cns3xxx_ahci_init(); + cns3xxx_sdhci_init(); ++ cns3xxx_gpio_init( 0, 32, CNS3XXX_GPIOA_BASE_VIRT, IRQ_CNS3XXX_GPIOA, ++ NR_IRQS_CNS3XXX); ++ cns3xxx_gpio_init(32, 32, CNS3XXX_GPIOB_BASE_VIRT, IRQ_CNS3XXX_GPIOB, ++ NR_IRQS_CNS3XXX + 32); + + pm_power_off = cns3xxx_power_off; + } +--- a/arch/arm/mach-cns3xxx/Kconfig ++++ b/arch/arm/mach-cns3xxx/Kconfig +@@ -3,6 +3,8 @@ menuconfig ARCH_CNS3XXX + bool "Cavium Networks CNS3XXX family" + depends on ARCH_MULTI_V6 + select ARM_GIC ++ select ARCH_REQUIRE_GPIOLIB ++ select GENERIC_IRQ_CHIP + select HAVE_ARM_SCU if SMP + select HAVE_ARM_TWD + select HAVE_SMP +--- a/arch/arm/mach-cns3xxx/Makefile ++++ b/arch/arm/mach-cns3xxx/Makefile +@@ -2,7 +2,7 @@ + ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include + + obj-$(CONFIG_ARCH_CNS3XXX) += cns3xxx.o +-cns3xxx-y += core.o pm.o ++cns3xxx-y += core.o pm.o gpio.o + cns3xxx-$(CONFIG_ATAGS) += devices.o + cns3xxx-$(CONFIG_PCI) += pcie.o + cns3xxx-$(CONFIG_MACH_CNS3420VB) += cns3420vb.o +--- a/arch/arm/mach-cns3xxx/cns3xxx.h ++++ b/arch/arm/mach-cns3xxx/cns3xxx.h +@@ -68,8 +68,10 @@ + #define SMC_PCELL_ID_3_OFFSET 0xFFC + + #define CNS3XXX_GPIOA_BASE 0x74000000 /* GPIO port A */ ++#define CNS3XXX_GPIOA_BASE_VIRT 0xFB006000 + + #define CNS3XXX_GPIOB_BASE 0x74800000 /* GPIO port B */ ++#define CNS3XXX_GPIOB_BASE_VIRT 0xFB007000 + + #define CNS3XXX_RTC_BASE 0x75000000 /* Real Time Clock */ + +--- a/arch/arm/mach-cns3xxx/core.c ++++ b/arch/arm/mach-cns3xxx/core.c +@@ -50,6 +50,16 @@ static struct map_desc cns3xxx_io_desc[] + .pfn = __phys_to_pfn(CNS3XXX_PM_BASE), + .length = SZ_4K, + .type = MT_DEVICE, ++ }, { ++ .virtual = CNS3XXX_GPIOA_BASE_VIRT, ++ .pfn = __phys_to_pfn(CNS3XXX_GPIOA_BASE), ++ .length = SZ_4K, ++ .type = MT_DEVICE, ++ }, { ++ .virtual = CNS3XXX_GPIOB_BASE_VIRT, ++ .pfn = __phys_to_pfn(CNS3XXX_GPIOB_BASE), ++ .length = SZ_4K, ++ .type = MT_DEVICE, + #ifdef CONFIG_PCI + }, { + .virtual = CNS3XXX_PCIE0_HOST_BASE_VIRT, diff --git a/target/linux/cns3xxx/patches-4.19/097-l2x0_cmdline_disable.patch b/target/linux/cns3xxx/patches-4.19/097-l2x0_cmdline_disable.patch new file mode 100644 index 000000000..b4720b11d --- /dev/null +++ b/target/linux/cns3xxx/patches-4.19/097-l2x0_cmdline_disable.patch @@ -0,0 +1,69 @@ +--- a/arch/arm/mach-cns3xxx/core.c ++++ b/arch/arm/mach-cns3xxx/core.c +@@ -307,13 +307,26 @@ void __init cns3xxx_timer_init(void) + + #ifdef CONFIG_CACHE_L2X0 + +-void __init cns3xxx_l2x0_init(void) ++static int cns3xxx_l2x0_enable = 1; ++ ++static int __init cns3xxx_l2x0_disable(char *s) ++{ ++ cns3xxx_l2x0_enable = 0; ++ return 1; ++} ++__setup("nol2x0", cns3xxx_l2x0_disable); ++ ++static int __init cns3xxx_l2x0_init(void) + { +- void __iomem *base = ioremap(CNS3XXX_L2C_BASE, SZ_4K); ++ void __iomem *base; + u32 val; + ++ if (!cns3xxx_l2x0_enable) ++ return 0; ++ ++ base = ioremap(CNS3XXX_L2C_BASE, SZ_4K); + if (WARN_ON(!base)) +- return; ++ return 0; + + /* + * Tag RAM Control register +@@ -343,7 +356,10 @@ void __init cns3xxx_l2x0_init(void) + + /* 32 KiB, 8-way, parity disable */ + l2x0_init(base, 0x00500000, 0xfe0f0fff); ++ ++ return 0; + } ++arch_initcall(cns3xxx_l2x0_init); + + #endif /* CONFIG_CACHE_L2X0 */ + +--- a/arch/arm/mach-cns3xxx/cns3420vb.c ++++ b/arch/arm/mach-cns3xxx/cns3420vb.c +@@ -217,8 +217,6 @@ static struct platform_device *cns3420_p + + static void __init cns3420_init(void) + { +- cns3xxx_l2x0_init(); +- + platform_add_devices(cns3420_pdevs, ARRAY_SIZE(cns3420_pdevs)); + + cns3xxx_ahci_init(); +--- a/arch/arm/mach-cns3xxx/core.h ++++ b/arch/arm/mach-cns3xxx/core.h +@@ -16,12 +16,6 @@ + extern struct smp_operations cns3xxx_smp_ops; + extern void cns3xxx_timer_init(void); + +-#ifdef CONFIG_CACHE_L2X0 +-void __init cns3xxx_l2x0_init(void); +-#else +-static inline void cns3xxx_l2x0_init(void) {} +-#endif /* CONFIG_CACHE_L2X0 */ +- + #ifdef CONFIG_PCI + extern void __init cns3xxx_pcie_init_late(void); + #else diff --git a/target/linux/cns3xxx/patches-4.19/100-laguna_support.patch b/target/linux/cns3xxx/patches-4.19/100-laguna_support.patch new file mode 100644 index 000000000..c0160d8f1 --- /dev/null +++ b/target/linux/cns3xxx/patches-4.19/100-laguna_support.patch @@ -0,0 +1,46 @@ +--- a/arch/arm/mach-cns3xxx/Kconfig ++++ b/arch/arm/mach-cns3xxx/Kconfig +@@ -23,4 +23,12 @@ config MACH_CNS3420VB + This is a platform with an on-board ARM11 MPCore and has support + for USB, USB-OTG, MMC/SD/SDIO, SATA, PCI-E, etc. + ++config MACH_GW2388 ++ bool "Support for Gateworks Laguna Platform" ++ help ++ Include support for the Gateworks Laguna Platform ++ ++ This is a platform with an on-board ARM11 MPCore and has support ++ for USB, USB-OTG, MMC/SD/SDIO, SATA, PCI-E, I2C, GIG, etc. ++ + endif +--- a/arch/arm/mach-cns3xxx/Makefile ++++ b/arch/arm/mach-cns3xxx/Makefile +@@ -8,3 +8,5 @@ cns3xxx-$(CONFIG_PCI) += pcie.o + cns3xxx-$(CONFIG_MACH_CNS3420VB) += cns3420vb.o + cns3xxx-$(CONFIG_SMP) += platsmp.o headsmp.o cns3xxx_fiq.o + cns3xxx-$(CONFIG_HOTPLUG_CPU) += hotplug.o ++cns3xxx-$(CONFIG_MACH_GW2388) += laguna.o ++ +--- a/arch/arm/mach-cns3xxx/devices.c ++++ b/arch/arm/mach-cns3xxx/devices.c +@@ -16,6 +16,7 @@ + #include + #include + #include ++#include + #include "cns3xxx.h" + #include "pm.h" + #include "core.h" +@@ -101,7 +102,11 @@ void __init cns3xxx_sdhci_init(void) + u32 gpioa_pins = __raw_readl(gpioa); + + /* MMC/SD pins share with GPIOA */ +- gpioa_pins |= 0x1fff0004; ++ if (machine_is_gw2388()) { ++ gpioa_pins |= 0x1fff0000; ++ } else { ++ gpioa_pins |= 0x1fff0004; ++ } + __raw_writel(gpioa_pins, gpioa); + + cns3xxx_pwr_clk_en(CNS3XXX_PWR_CLK_EN(SDIO)); diff --git a/target/linux/cns3xxx/patches-4.19/101-laguna_sdhci_card_detect.patch b/target/linux/cns3xxx/patches-4.19/101-laguna_sdhci_card_detect.patch new file mode 100644 index 000000000..72648a5f9 --- /dev/null +++ b/target/linux/cns3xxx/patches-4.19/101-laguna_sdhci_card_detect.patch @@ -0,0 +1,14 @@ +--- a/drivers/mmc/host/sdhci-cns3xxx.c ++++ b/drivers/mmc/host/sdhci-cns3xxx.c +@@ -88,9 +88,9 @@ static const struct sdhci_pltfm_data sdh + .ops = &sdhci_cns3xxx_ops, + .quirks = SDHCI_QUIRK_BROKEN_DMA | + SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | +- SDHCI_QUIRK_INVERTED_WRITE_PROTECT | + SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN | +- SDHCI_QUIRK_BROKEN_TIMEOUT_VAL, ++ SDHCI_QUIRK_BROKEN_TIMEOUT_VAL | ++ SDHCI_QUIRK_BROKEN_CARD_DETECTION, + }; + + static int sdhci_cns3xxx_probe(struct platform_device *pdev) diff --git a/target/linux/cns3xxx/patches-4.19/110-pci_isolated_interrupts.patch b/target/linux/cns3xxx/patches-4.19/110-pci_isolated_interrupts.patch new file mode 100644 index 000000000..800be813b --- /dev/null +++ b/target/linux/cns3xxx/patches-4.19/110-pci_isolated_interrupts.patch @@ -0,0 +1,95 @@ +--- a/arch/arm/mach-cns3xxx/pcie.c ++++ b/arch/arm/mach-cns3xxx/pcie.c +@@ -18,6 +18,7 @@ + #include + #include + #include ++#include + #include + #include + #include "cns3xxx.h" +@@ -27,7 +28,7 @@ struct cns3xxx_pcie { + void __iomem *host_regs; /* PCI config registers for host bridge */ + void __iomem *cfg0_regs; /* PCI Type 0 config registers */ + void __iomem *cfg1_regs; /* PCI Type 1 config registers */ +- unsigned int irqs[2]; ++ unsigned int irqs[5]; + struct resource res_io; + struct resource res_mem; + int port; +@@ -95,7 +96,7 @@ static inline int check_master_abort(str + void __iomem *host_base; + u32 sreg, ereg; + +- host_base = (void __iomem *) cnspci->cfg_bases[CNS3XXX_HOST_TYPE].virtual; ++ host_base = (void __iomem *) cnspci->host_regs; + sreg = __raw_readw(host_base + 0x6) & 0xF900; + ereg = __raw_readl(host_base + 0x104); // Uncorrectable Error Status Reg + +@@ -209,7 +210,7 @@ static struct pci_ops cns3xxx_pcie_ops = + static int cns3xxx_pcie_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) + { + struct cns3xxx_pcie *cnspci = pdev_to_cnspci(dev); +- int irq = cnspci->irqs[!!dev->bus->number]; ++ int irq = cnspci->irqs[!!dev->bus->number + pin - 1]; + + pr_info("PCIe map irq: %04d:%02x:%02x.%02x slot %d, pin %d, irq: %d\n", + pci_domain_nr(dev->bus), dev->bus->number, PCI_SLOT(dev->devfn), +@@ -235,7 +236,13 @@ static struct cns3xxx_pcie cns3xxx_pcie[ + .end = CNS3XXX_PCIE0_HOST_BASE - 1, /* 176 MiB */ + .flags = IORESOURCE_MEM, + }, +- .irqs = { IRQ_CNS3XXX_PCIE0_RC, IRQ_CNS3XXX_PCIE0_DEVICE, }, ++ .irqs = { ++ IRQ_CNS3XXX_PCIE0_RC, ++ IRQ_CNS3XXX_PCIE0_DEVICE, ++ IRQ_CNS3XXX_PCIE0_DEVICE, ++ IRQ_CNS3XXX_PCIE0_DEVICE, ++ IRQ_CNS3XXX_PCIE0_DEVICE, ++ }, + .port = 0, + }, + [1] = { +@@ -254,7 +261,13 @@ static struct cns3xxx_pcie cns3xxx_pcie[ + .end = CNS3XXX_PCIE1_HOST_BASE - 1, /* 176 MiB */ + .flags = IORESOURCE_MEM, + }, +- .irqs = { IRQ_CNS3XXX_PCIE1_RC, IRQ_CNS3XXX_PCIE1_DEVICE, }, ++ .irqs = { ++ IRQ_CNS3XXX_PCIE1_RC, ++ IRQ_CNS3XXX_PCIE1_DEVICE, ++ IRQ_CNS3XXX_PCIE1_DEVICE, ++ IRQ_CNS3XXX_PCIE1_DEVICE, ++ IRQ_CNS3XXX_PCIE1_DEVICE, ++ }, + .port = 1, + }, + }; +@@ -346,6 +359,14 @@ static int cns3xxx_pcie_abort_handler(un + return 0; + } + ++void __init cns3xxx_pcie_set_irqs(int bus, int *irqs) ++{ ++ int i; ++ ++ for (i = 0; i < 4; i++) ++ cns3xxx_pcie[bus].irqs[i + 1] = irqs[i]; ++} ++ + void __init cns3xxx_pcie_init_late(void) + { + int i; +--- a/arch/arm/mach-cns3xxx/core.h ++++ b/arch/arm/mach-cns3xxx/core.h +@@ -18,8 +18,10 @@ extern void cns3xxx_timer_init(void); + + #ifdef CONFIG_PCI + extern void __init cns3xxx_pcie_init_late(void); ++extern void __init cns3xxx_pcie_set_irqs(int bus, int *irqs); + #else + static inline void __init cns3xxx_pcie_init_late(void) {} ++static inline void cns3xxx_pcie_set_irqs(int bus, int *irqs) {} + #endif + + void __init cns3xxx_map_io(void); diff --git a/target/linux/cns3xxx/patches-4.19/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch b/target/linux/cns3xxx/patches-4.19/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch new file mode 100644 index 000000000..4b4f0e4f0 --- /dev/null +++ b/target/linux/cns3xxx/patches-4.19/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch @@ -0,0 +1,23 @@ +--- a/drivers/pci/probe.c ++++ b/drivers/pci/probe.c +@@ -2619,7 +2619,8 @@ static void pcie_write_mrrs(struct pci_d + * In the "safe" case, do not configure the MRRS. There appear to be + * issues with setting MRRS to 0 on a number of devices. + */ +- if (pcie_bus_config != PCIE_BUS_PERFORMANCE) ++ if (pcie_bus_config != PCIE_BUS_PERFORMANCE && ++ pcie_bus_config != PCIE_BUS_PEER2PEER) + return; + + /* +--- a/include/linux/pci.h ++++ b/include/linux/pci.h +@@ -866,7 +866,7 @@ enum pcie_bus_config_types { + PCIE_BUS_DEFAULT, /* Ensure MPS matches upstream bridge */ + PCIE_BUS_SAFE, /* Use largest MPS boot-time devices support */ + PCIE_BUS_PERFORMANCE, /* Use MPS and MRRS for best performance */ +- PCIE_BUS_PEER2PEER, /* Set MPS = 128 for all devices */ ++ PCIE_BUS_PEER2PEER, /* set MPS and MRSS to 128 for all devices */ + }; + + extern enum pcie_bus_config_types pcie_bus_config; diff --git a/target/linux/cns3xxx/patches-4.19/200-broadcom_phy_reinit.patch b/target/linux/cns3xxx/patches-4.19/200-broadcom_phy_reinit.patch new file mode 100644 index 000000000..b0c3299d8 --- /dev/null +++ b/target/linux/cns3xxx/patches-4.19/200-broadcom_phy_reinit.patch @@ -0,0 +1,15 @@ +--- a/drivers/net/phy/broadcom.c ++++ b/drivers/net/phy/broadcom.c +@@ -429,7 +429,11 @@ static int bcm5481_config_aneg(struct ph + ret = genphy_config_aneg(phydev); + + /* Then we can set up the delay. */ +- bcm5481x_config(phydev); ++ //bcm5481x_config(phydev); ++ ++ phy_write(phydev, 0x18, 0xf1e7); ++ phy_write(phydev, 0x1c, 0x8e00); ++ phy_write(phydev, 0x1c, 0xa41f); + + if (of_property_read_bool(np, "enet-phy-lane-swap")) { + /* Lane Swap - Undocumented register...magic! */ diff --git a/target/linux/cns3xxx/patches-4.19/210-dwc2_defaults.patch b/target/linux/cns3xxx/patches-4.19/210-dwc2_defaults.patch new file mode 100644 index 000000000..5a5b17d0a --- /dev/null +++ b/target/linux/cns3xxx/patches-4.19/210-dwc2_defaults.patch @@ -0,0 +1,63 @@ +--- a/drivers/usb/dwc2/params.c ++++ b/drivers/usb/dwc2/params.c +@@ -151,6 +151,36 @@ static void dwc2_set_stm32f7_hsotg_param + p->host_perio_tx_fifo_size = 256; + } + ++static void dwc2_set_cns3xxx_params(struct dwc2_hsotg *hsotg) ++{ ++ struct dwc2_core_params *p = &hsotg->params; ++ ++ p->otg_cap = DWC2_CAP_PARAM_NO_HNP_SRP_CAPABLE; /* non-HNP/non-SRP capable */ ++ p->host_dma = 1; ++ p->dma_desc_enable = 0; ++ p->speed = DWC2_SPEED_PARAM_HIGH; /* High Speed */ ++ p->enable_dynamic_fifo = 1; ++ p->en_multiple_tx_fifo = 1; ++ p->host_rx_fifo_size = 658; /* 774 DWORDs */ ++ p->host_nperio_tx_fifo_size = 128; /* 256 DWORDs */ ++ p->host_perio_tx_fifo_size = 658; /* 512 DWORDs */ ++ p->max_transfer_size = 65535, ++ p->max_packet_count = 511; ++ p->host_channels = 16; ++ p->phy_type = DWC2_PHY_TYPE_PARAM_UTMI; /* UTMI */ ++ p->phy_utmi_width = 16; /* 8 bits */ ++ p->phy_ulpi_ddr = 0; /* Single */ ++ p->phy_ulpi_ext_vbus = 0; ++ p->i2c_enable = 0; ++ p->ulpi_fs_ls = 0; ++ p->host_support_fs_ls_low_power = 0; ++ p->host_ls_low_power_phy_clk = 0; /* 48 MHz */ ++ p->ts_dline = 0; ++ p->reload_ctl = 0; ++ p->ahbcfg = 0x10; ++ p->uframe_sched = false; ++} ++ + const struct of_device_id dwc2_of_match_table[] = { + { .compatible = "brcm,bcm2835-usb", .data = dwc2_set_bcm_params }, + { .compatible = "hisilicon,hi6220-usb", .data = dwc2_set_his_params }, +@@ -806,17 +836,23 @@ int dwc2_get_hwparams(struct dwc2_hsotg + + int dwc2_init_params(struct dwc2_hsotg *hsotg) + { ++ /* + const struct of_device_id *match; + void (*set_params)(void *data); ++ */ + + dwc2_set_default_params(hsotg); + dwc2_get_device_properties(hsotg); + ++ /* + match = of_match_device(dwc2_of_match_table, hsotg->dev); + if (match && match->data) { + set_params = match->data; + set_params(hsotg); + } ++ */ ++ ++ dwc2_set_cns3xxx_params(hsotg); + + dwc2_check_params(hsotg); + diff --git a/target/linux/gemini/patches-4.14/0016-ARM-dts-Add-TVE-TVC-and-ILI9322-panel-to-DIR-685.patch b/target/linux/gemini/patches-4.14/0016-ARM-dts-Add-TVE-TVC-and-ILI9322-panel-to-DIR-685.patch index e0cf267cc..b9779370b 100644 --- a/target/linux/gemini/patches-4.14/0016-ARM-dts-Add-TVE-TVC-and-ILI9322-panel-to-DIR-685.patch +++ b/target/linux/gemini/patches-4.14/0016-ARM-dts-Add-TVE-TVC-and-ILI9322-panel-to-DIR-685.patch @@ -94,7 +94,7 @@ Signed-off-by: Linus Walleij /* 32MB of flash */ reg = <0x30000000 0x02000000>; -@@ -242,5 +292,16 @@ +@@ -238,5 +288,16 @@ ata@63000000 { status = "okay"; }; diff --git a/target/linux/gemini/patches-4.14/0031-ARM-dts-Add-the-FOTG210-USB-host-to-Gemini.patch b/target/linux/gemini/patches-4.14/0031-ARM-dts-Add-the-FOTG210-USB-host-to-Gemini.patch index d5544a1cb..5b2c4139c 100644 --- a/target/linux/gemini/patches-4.14/0031-ARM-dts-Add-the-FOTG210-USB-host-to-Gemini.patch +++ b/target/linux/gemini/patches-4.14/0031-ARM-dts-Add-the-FOTG210-USB-host-to-Gemini.patch @@ -26,7 +26,7 @@ the patch is only included in the series for context. --- a/arch/arm/boot/dts/gemini-dlink-dir-685.dts +++ b/arch/arm/boot/dts/gemini-dlink-dir-685.dts -@@ -303,5 +303,13 @@ +@@ -299,5 +299,13 @@ }; }; }; diff --git a/target/linux/gemini/patches-4.14/0905-arm-dts-gemini-dlink-dir-685-add-rtl8366rb.patch b/target/linux/gemini/patches-4.14/0905-arm-dts-gemini-dlink-dir-685-add-rtl8366rb.patch index 288b0d878..8cab32200 100644 --- a/target/linux/gemini/patches-4.14/0905-arm-dts-gemini-dlink-dir-685-add-rtl8366rb.patch +++ b/target/linux/gemini/patches-4.14/0905-arm-dts-gemini-dlink-dir-685-add-rtl8366rb.patch @@ -13,7 +13,7 @@ leds { compatible = "gpio-leds"; led-wps { -@@ -249,6 +255,47 @@ +@@ -245,6 +251,47 @@ groups = "gpio1bgrp"; }; }; @@ -61,7 +61,7 @@ }; }; -@@ -290,6 +337,18 @@ +@@ -286,6 +333,18 @@ <0x6000 0 0 4 &pci_intc 2>; }; diff --git a/target/linux/gemini/patches-4.19/0007-ARM-dts-Fix-up-the-D-Link-DIR-685-MTD-partition-info.patch b/target/linux/gemini/patches-4.19/0007-ARM-dts-Fix-up-the-D-Link-DIR-685-MTD-partition-info.patch deleted file mode 100644 index f70ab262c..000000000 --- a/target/linux/gemini/patches-4.19/0007-ARM-dts-Fix-up-the-D-Link-DIR-685-MTD-partition-info.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 0f6c4817471faf572b5273cdf90160790b0c3b29 Mon Sep 17 00:00:00 2001 -From: Linus Walleij -Date: Thu, 17 May 2018 17:00:10 +0200 -Subject: [PATCH 07/18] ARM: dts: Fix up the D-Link DIR-685 MTD partition info - -The vendor firmware was analyzed to get the right idea about -this flash layout. /proc/mtd contains: - -dev: size erasesize name -mtd0: 01e7ff40 00020000 "rootfs" -mtd1: 01f40000 00020000 "upgrade" -mtd2: 00040000 00020000 "rgdb" -mtd3: 00020000 00020000 "nvram" -mtd4: 00040000 00020000 "RedBoot" -mtd5: 00020000 00020000 "LangPack" -mtd6: 02000000 00020000 "flash" - -Here "flash" is obviously the whole device and we know "rootfs" -is a bogus hack to point to a squashfs rootfs inside of the main -"upgrade partition". We know "RedBoot" is the first 0x40000 of -the flash and the "upgrade" partition follows from 0x40000 to -0x1f8000. So we have mtd0, 1, 4 and 6 covered. - -Remains: -mtd2: 00040000 00020000 "rgdb" -mtd3: 00020000 00020000 "nvram" -mtd5: 00020000 00020000 "LangPack" - -Inspecting the flash at 0x1f8000 and 0x1fa000 reveals each of -these starting with "RGCFG1" so we assume 0x1f8000-1fbfff is -"rgdb" of 0x40000. - -Signed-off-by: Linus Walleij ---- - arch/arm/boot/dts/gemini-dlink-dir-685.dts | 16 ++++++---------- - 1 file changed, 6 insertions(+), 10 deletions(-) - ---- a/arch/arm/boot/dts/gemini-dlink-dir-685.dts -+++ b/arch/arm/boot/dts/gemini-dlink-dir-685.dts -@@ -274,20 +274,16 @@ - read-only; - }; - /* -- * Between the boot loader and the rootfs is the kernel -- * in a custom Storlink format flashed from the boot -- * menu. The rootfs is in squashfs format. -+ * This firmware image contains the kernel catenated -+ * with the squashfs root filesystem. For some reason -+ * this is called "upgrade" on the vendor system. - */ -- partition@1800c0 { -- label = "rootfs"; -- reg = <0x001800c0 0x01dbff40>; -- read-only; -- }; -- partition@1f40000 { -+ partition@40000 { - label = "upgrade"; -- reg = <0x01f40000 0x00040000>; -+ reg = <0x00040000 0x01f40000>; - read-only; - }; -+ /* RGDB, Residental Gateway Database? */ - partition@1f80000 { - label = "rgdb"; - reg = <0x01f80000 0x00040000>; diff --git a/target/linux/generic/backport-4.14/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch b/target/linux/generic/backport-4.14/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch deleted file mode 100644 index 45039ce13..000000000 --- a/target/linux/generic/backport-4.14/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 649affd04813c43e0a72886517fcfccd63230981 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Mon, 29 Jun 2015 16:53:03 +0200 -Subject: uapi/if_ether.h: prevent redefinition of struct ethhdr - -Musl provides its own ethhdr struct definition. Add a guard to prevent -its definition of the appropriate musl header has already been included. - -glibc does not implement this header, but when glibc will implement this -they can just define __UAPI_DEF_ETHHDR 0 to make it work with the -kernel. - -Signed-off-by: Hauke Mehrtens ---- - include/uapi/linux/if_ether.h | 3 +++ - include/uapi/linux/libc-compat.h | 6 ++++++ - 2 files changed, 9 insertions(+) - ---- a/include/uapi/linux/if_ether.h -+++ b/include/uapi/linux/if_ether.h -@@ -23,6 +23,7 @@ - #define _UAPI_LINUX_IF_ETHER_H - - #include -+#include - - /* - * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble -@@ -150,11 +151,13 @@ - * This is an Ethernet frame header. - */ - -+#if __UAPI_DEF_ETHHDR - struct ethhdr { - unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ - unsigned char h_source[ETH_ALEN]; /* source ether addr */ - __be16 h_proto; /* packet type ID field */ - } __attribute__((packed)); -+#endif - - - #endif /* _UAPI_LINUX_IF_ETHER_H */ ---- a/include/uapi/linux/libc-compat.h -+++ b/include/uapi/linux/libc-compat.h -@@ -264,4 +264,10 @@ - - #endif /* __GLIBC__ */ - -+/* Definitions for if_ether.h */ -+/* allow libcs like musl to deactivate this, glibc does not implement this. */ -+#ifndef __UAPI_DEF_ETHHDR -+#define __UAPI_DEF_ETHHDR 1 -+#endif -+ - #endif /* _UAPI_LIBC_COMPAT_H */ diff --git a/target/linux/generic/backport-4.19/048-v4.21-mtd-improve-calculating-partition-boundaries-when-ch.patch b/target/linux/generic/backport-4.19/048-v4.21-mtd-improve-calculating-partition-boundaries-when-ch.patch index 9bd07186d..02296276b 100644 --- a/target/linux/generic/backport-4.19/048-v4.21-mtd-improve-calculating-partition-boundaries-when-ch.patch +++ b/target/linux/generic/backport-4.19/048-v4.21-mtd-improve-calculating-partition-boundaries-when-ch.patch @@ -35,7 +35,7 @@ Signed-off-by: Boris Brezillon /* * MTD methods which simply translate the effective address and pass through -@@ -514,7 +523,7 @@ static struct mtd_part *allocate_partiti +@@ -518,7 +527,7 @@ static struct mtd_part *allocate_partiti if (!(slave->mtd.flags & MTD_NO_ERASE)) wr_alignment = slave->mtd.erasesize; @@ -44,7 +44,7 @@ Signed-off-by: Boris Brezillon remainder = do_div(tmp, wr_alignment); if ((slave->mtd.flags & MTD_WRITEABLE) && remainder) { /* Doesn't start on a boundary of major erase size */ -@@ -525,7 +534,7 @@ static struct mtd_part *allocate_partiti +@@ -529,7 +538,7 @@ static struct mtd_part *allocate_partiti part->name); } diff --git a/target/linux/generic/backport-4.9/023-1-smsc95xx-Use-skb_cow_head-to-deal-with-cloned-skbs.patch b/target/linux/generic/backport-4.9/023-1-smsc95xx-Use-skb_cow_head-to-deal-with-cloned-skbs.patch deleted file mode 100644 index 9fbdfe4a0..000000000 --- a/target/linux/generic/backport-4.9/023-1-smsc95xx-Use-skb_cow_head-to-deal-with-cloned-skbs.patch +++ /dev/null @@ -1,40 +0,0 @@ -From e9156cd26a495a18706e796f02a81fee41ec14f4 Mon Sep 17 00:00:00 2001 -From: James Hughes -Date: Wed, 19 Apr 2017 11:13:40 +0100 -Subject: [PATCH] smsc95xx: Use skb_cow_head to deal with cloned skbs - -The driver was failing to check that the SKB wasn't cloned -before adding checksum data. -Replace existing handling to extend/copy the header buffer -with skb_cow_head. - -Signed-off-by: James Hughes -Acked-by: Eric Dumazet -Acked-by: Woojung Huh -Signed-off-by: David S. Miller ---- - drivers/net/usb/smsc95xx.c | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - ---- a/drivers/net/usb/smsc95xx.c -+++ b/drivers/net/usb/smsc95xx.c -@@ -2011,13 +2011,13 @@ static struct sk_buff *smsc95xx_tx_fixup - /* We do not advertise SG, so skbs should be already linearized */ - BUG_ON(skb_shinfo(skb)->nr_frags); - -- if (skb_headroom(skb) < overhead) { -- struct sk_buff *skb2 = skb_copy_expand(skb, -- overhead, 0, flags); -+ /* Make writable and expand header space by overhead if required */ -+ if (skb_cow_head(skb, overhead)) { -+ /* Must deallocate here as returning NULL to indicate error -+ * means the skb won't be deallocated in the caller. -+ */ - dev_kfree_skb_any(skb); -- skb = skb2; -- if (!skb) -- return NULL; -+ return NULL; - } - - if (csum) { diff --git a/target/linux/generic/backport-4.9/023-6-ch9200-use-skb_cow_head-to-deal-with-cloned-skbs.patch b/target/linux/generic/backport-4.9/023-6-ch9200-use-skb_cow_head-to-deal-with-cloned-skbs.patch deleted file mode 100644 index 83de38bf8..000000000 --- a/target/linux/generic/backport-4.9/023-6-ch9200-use-skb_cow_head-to-deal-with-cloned-skbs.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 6bc6895bdd6744e0136eaa4a11fbdb20a7db4e40 Mon Sep 17 00:00:00 2001 -From: Eric Dumazet -Date: Wed, 19 Apr 2017 09:59:25 -0700 -Subject: [PATCH] ch9200: use skb_cow_head() to deal with cloned skbs - -We need to ensure there is enough headroom to push extra header, -but we also need to check if we are allowed to change headers. - -skb_cow_head() is the proper helper to deal with this. - -Fixes: 4a476bd6d1d9 ("usbnet: New driver for QinHeng CH9200 devices") -Signed-off-by: Eric Dumazet -Cc: James Hughes -Cc: Matthew Garrett -Signed-off-by: David S. Miller ---- - drivers/net/usb/ch9200.c | 9 ++------- - 1 file changed, 2 insertions(+), 7 deletions(-) - ---- a/drivers/net/usb/ch9200.c -+++ b/drivers/net/usb/ch9200.c -@@ -254,14 +254,9 @@ static struct sk_buff *ch9200_tx_fixup(s - tx_overhead = 0x40; - - len = skb->len; -- if (skb_headroom(skb) < tx_overhead) { -- struct sk_buff *skb2; -- -- skb2 = skb_copy_expand(skb, tx_overhead, 0, flags); -+ if (skb_cow_head(skb, tx_overhead)) { - dev_kfree_skb_any(skb); -- skb = skb2; -- if (!skb) -- return NULL; -+ return NULL; - } - - __skb_push(skb, tx_overhead); diff --git a/target/linux/generic/backport-4.9/023-7-kaweth-use-skb_cow_head-to-deal-with-cloned-skbs.patch b/target/linux/generic/backport-4.9/023-7-kaweth-use-skb_cow_head-to-deal-with-cloned-skbs.patch deleted file mode 100644 index 597f25b21..000000000 --- a/target/linux/generic/backport-4.9/023-7-kaweth-use-skb_cow_head-to-deal-with-cloned-skbs.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 39fba7835aacda65284a86e611774cbba71dac20 Mon Sep 17 00:00:00 2001 -From: Eric Dumazet -Date: Wed, 19 Apr 2017 09:59:26 -0700 -Subject: [PATCH] kaweth: use skb_cow_head() to deal with cloned skbs - -We can use skb_cow_head() to properly deal with clones, -especially the ones coming from TCP stack that allow their head being -modified. This avoids a copy. - -Signed-off-by: Eric Dumazet -Cc: James Hughes -Signed-off-by: David S. Miller ---- - drivers/net/usb/kaweth.c | 18 ++++++------------ - 1 file changed, 6 insertions(+), 12 deletions(-) - ---- a/drivers/net/usb/kaweth.c -+++ b/drivers/net/usb/kaweth.c -@@ -803,18 +803,12 @@ static netdev_tx_t kaweth_start_xmit(str - } - - /* We now decide whether we can put our special header into the sk_buff */ -- if (skb_cloned(skb) || skb_headroom(skb) < 2) { -- /* no such luck - we make our own */ -- struct sk_buff *copied_skb; -- copied_skb = skb_copy_expand(skb, 2, 0, GFP_ATOMIC); -- dev_kfree_skb_irq(skb); -- skb = copied_skb; -- if (!copied_skb) { -- kaweth->stats.tx_errors++; -- netif_start_queue(net); -- spin_unlock_irq(&kaweth->device_lock); -- return NETDEV_TX_OK; -- } -+ if (skb_cow_head(skb, 2)) { -+ kaweth->stats.tx_errors++; -+ netif_start_queue(net); -+ spin_unlock_irq(&kaweth->device_lock); -+ dev_kfree_skb_any(skb); -+ return NETDEV_TX_OK; - } - - private_header = (__le16 *)__skb_push(skb, 2); diff --git a/target/linux/generic/backport-4.9/041-mm-rename-__alloc_page_frag-to-page_frag_alloc-and-_.patch b/target/linux/generic/backport-4.9/041-mm-rename-__alloc_page_frag-to-page_frag_alloc-and-_.patch index d1da94b4e..facc43004 100644 --- a/target/linux/generic/backport-4.9/041-mm-rename-__alloc_page_frag-to-page_frag_alloc-and-_.patch +++ b/target/linux/generic/backport-4.9/041-mm-rename-__alloc_page_frag-to-page_frag_alloc-and-_.patch @@ -108,7 +108,7 @@ Signed-off-by: Linus Torvalds local_irq_restore(flags); return data; } -@@ -391,7 +391,7 @@ static void *__napi_alloc_frag(unsigned +@@ -393,7 +393,7 @@ static void *__napi_alloc_frag(unsigned { struct napi_alloc_cache *nc = this_cpu_ptr(&napi_alloc_cache); @@ -117,7 +117,7 @@ Signed-off-by: Linus Torvalds } void *napi_alloc_frag(unsigned int fragsz) -@@ -441,7 +441,7 @@ struct sk_buff *__netdev_alloc_skb(struc +@@ -445,7 +445,7 @@ struct sk_buff *__netdev_alloc_skb(struc local_irq_save(flags); nc = this_cpu_ptr(&netdev_alloc_cache); @@ -126,7 +126,7 @@ Signed-off-by: Linus Torvalds pfmemalloc = nc->pfmemalloc; local_irq_restore(flags); -@@ -505,7 +505,7 @@ struct sk_buff *__napi_alloc_skb(struct +@@ -509,7 +509,7 @@ struct sk_buff *__napi_alloc_skb(struct if (sk_memalloc_socks()) gfp_mask |= __GFP_MEMALLOC; diff --git a/target/linux/generic/backport-4.9/050-usb-dwc2-Remove-unnecessary-kfree.patch b/target/linux/generic/backport-4.9/050-usb-dwc2-Remove-unnecessary-kfree.patch deleted file mode 100644 index 346eba922..000000000 --- a/target/linux/generic/backport-4.9/050-usb-dwc2-Remove-unnecessary-kfree.patch +++ /dev/null @@ -1,24 +0,0 @@ -From cd4b1e34655d46950c065d9284b596cd8d7b28cd Mon Sep 17 00:00:00 2001 -From: John Youn -Date: Thu, 3 Nov 2016 17:55:45 -0700 -Subject: [PATCH] usb: dwc2: Remove unnecessary kfree - -This shouldn't be freed by the HCD as it is owned by the core and -allocated with devm_kzalloc. - -Signed-off-by: John Youn -Signed-off-by: Felipe Balbi ---- - drivers/usb/dwc2/hcd.c | 1 - - 1 file changed, 1 deletion(-) - ---- a/drivers/usb/dwc2/hcd.c -+++ b/drivers/usb/dwc2/hcd.c -@@ -5202,7 +5202,6 @@ error3: - error2: - usb_put_hcd(hcd); - error1: -- kfree(hsotg->core_params); - - #ifdef CONFIG_USB_DWC2_TRACK_MISSED_SOFS - kfree(hsotg->last_frame_num_array); diff --git a/target/linux/generic/backport-4.9/092-netfilter-nf_tables-fix-mismatch-in-big-endian-syste.patch b/target/linux/generic/backport-4.9/092-netfilter-nf_tables-fix-mismatch-in-big-endian-syste.patch deleted file mode 100644 index 024983142..000000000 --- a/target/linux/generic/backport-4.9/092-netfilter-nf_tables-fix-mismatch-in-big-endian-syste.patch +++ /dev/null @@ -1,323 +0,0 @@ -From 0bc01df3df7a88258148518eb9ce7f88c16a6106 Mon Sep 17 00:00:00 2001 -From: Liping Zhang -Date: Wed, 8 Mar 2017 22:54:18 +0800 -Subject: netfilter: nf_tables: fix mismatch in big-endian system - -Currently, there are two different methods to store an u16 integer to -the u32 data register. For example: - u32 *dest = ®s->data[priv->dreg]; - 1. *dest = 0; *(u16 *) dest = val_u16; - 2. *dest = val_u16; - -For method 1, the u16 value will be stored like this, either in -big-endian or little-endian system: - 0 15 31 - +-+-+-+-+-+-+-+-+-+-+-+-+ - | Value | 0 | - +-+-+-+-+-+-+-+-+-+-+-+-+ - -For method 2, in little-endian system, the u16 value will be the same -as listed above. But in big-endian system, the u16 value will be stored -like this: - 0 15 31 - +-+-+-+-+-+-+-+-+-+-+-+-+ - | 0 | Value | - +-+-+-+-+-+-+-+-+-+-+-+-+ - -So later we use "memcmp(®s->data[priv->sreg], data, 2);" to do -compare in nft_cmp, nft_lookup expr ..., method 2 will get the wrong -result in big-endian system, as 0~15 bits will always be zero. - -For the similar reason, when loading an u16 value from the u32 data -register, we should use "*(u16 *) sreg;" instead of "(u16)*sreg;", -the 2nd method will get the wrong value in the big-endian system. - -So introduce some wrapper functions to store/load an u8 or u16 -integer to/from the u32 data register, and use them in the right -place. - -Signed-off-by: Liping Zhang -Signed-off-by: Pablo Neira Ayuso ---- - include/net/netfilter/nf_tables.h | 29 +++++++++++++++++++++++++ - net/ipv4/netfilter/nft_masq_ipv4.c | 8 +++---- - net/ipv4/netfilter/nft_redir_ipv4.c | 8 +++---- - net/ipv6/netfilter/nft_masq_ipv6.c | 8 +++---- - net/ipv6/netfilter/nft_redir_ipv6.c | 8 +++---- - net/netfilter/nft_ct.c | 10 ++++----- - net/netfilter/nft_meta.c | 42 +++++++++++++++++++------------------ - net/netfilter/nft_nat.c | 8 +++---- - 8 files changed, 76 insertions(+), 45 deletions(-) - ---- a/include/net/netfilter/nf_tables.h -+++ b/include/net/netfilter/nf_tables.h -@@ -87,6 +87,35 @@ struct nft_regs { - }; - }; - -+/* Store/load an u16 or u8 integer to/from the u32 data register. -+ * -+ * Note, when using concatenations, register allocation happens at 32-bit -+ * level. So for store instruction, pad the rest part with zero to avoid -+ * garbage values. -+ */ -+ -+static inline void nft_reg_store16(u32 *dreg, u16 val) -+{ -+ *dreg = 0; -+ *(u16 *)dreg = val; -+} -+ -+static inline void nft_reg_store8(u32 *dreg, u8 val) -+{ -+ *dreg = 0; -+ *(u8 *)dreg = val; -+} -+ -+static inline u16 nft_reg_load16(u32 *sreg) -+{ -+ return *(u16 *)sreg; -+} -+ -+static inline u8 nft_reg_load8(u32 *sreg) -+{ -+ return *(u8 *)sreg; -+} -+ - static inline void nft_data_copy(u32 *dst, const struct nft_data *src, - unsigned int len) - { ---- a/net/ipv4/netfilter/nft_masq_ipv4.c -+++ b/net/ipv4/netfilter/nft_masq_ipv4.c -@@ -26,10 +26,10 @@ static void nft_masq_ipv4_eval(const str - memset(&range, 0, sizeof(range)); - range.flags = priv->flags; - if (priv->sreg_proto_min) { -- range.min_proto.all = -- *(__be16 *)®s->data[priv->sreg_proto_min]; -- range.max_proto.all = -- *(__be16 *)®s->data[priv->sreg_proto_max]; -+ range.min_proto.all = (__force __be16)nft_reg_load16( -+ ®s->data[priv->sreg_proto_min]); -+ range.max_proto.all = (__force __be16)nft_reg_load16( -+ ®s->data[priv->sreg_proto_max]); - } - regs->verdict.code = nf_nat_masquerade_ipv4(pkt->skb, pkt->hook, - &range, pkt->out); ---- a/net/ipv4/netfilter/nft_redir_ipv4.c -+++ b/net/ipv4/netfilter/nft_redir_ipv4.c -@@ -26,10 +26,10 @@ static void nft_redir_ipv4_eval(const st - - memset(&mr, 0, sizeof(mr)); - if (priv->sreg_proto_min) { -- mr.range[0].min.all = -- *(__be16 *)®s->data[priv->sreg_proto_min]; -- mr.range[0].max.all = -- *(__be16 *)®s->data[priv->sreg_proto_max]; -+ mr.range[0].min.all = (__force __be16)nft_reg_load16( -+ ®s->data[priv->sreg_proto_min]); -+ mr.range[0].max.all = (__force __be16)nft_reg_load16( -+ ®s->data[priv->sreg_proto_max]); - mr.range[0].flags |= NF_NAT_RANGE_PROTO_SPECIFIED; - } - ---- a/net/ipv6/netfilter/nft_masq_ipv6.c -+++ b/net/ipv6/netfilter/nft_masq_ipv6.c -@@ -27,10 +27,10 @@ static void nft_masq_ipv6_eval(const str - memset(&range, 0, sizeof(range)); - range.flags = priv->flags; - if (priv->sreg_proto_min) { -- range.min_proto.all = -- *(__be16 *)®s->data[priv->sreg_proto_min]; -- range.max_proto.all = -- *(__be16 *)®s->data[priv->sreg_proto_max]; -+ range.min_proto.all = (__force __be16)nft_reg_load16( -+ ®s->data[priv->sreg_proto_min]); -+ range.max_proto.all = (__force __be16)nft_reg_load16( -+ ®s->data[priv->sreg_proto_max]); - } - regs->verdict.code = nf_nat_masquerade_ipv6(pkt->skb, &range, pkt->out); - } ---- a/net/ipv6/netfilter/nft_redir_ipv6.c -+++ b/net/ipv6/netfilter/nft_redir_ipv6.c -@@ -26,10 +26,10 @@ static void nft_redir_ipv6_eval(const st - - memset(&range, 0, sizeof(range)); - if (priv->sreg_proto_min) { -- range.min_proto.all = -- *(__be16 *)®s->data[priv->sreg_proto_min], -- range.max_proto.all = -- *(__be16 *)®s->data[priv->sreg_proto_max], -+ range.min_proto.all = (__force __be16)nft_reg_load16( -+ ®s->data[priv->sreg_proto_min]); -+ range.max_proto.all = (__force __be16)nft_reg_load16( -+ ®s->data[priv->sreg_proto_max]); - range.flags |= NF_NAT_RANGE_PROTO_SPECIFIED; - } - ---- a/net/netfilter/nft_ct.c -+++ b/net/netfilter/nft_ct.c -@@ -77,7 +77,7 @@ static void nft_ct_get_eval(const struct - - switch (priv->key) { - case NFT_CT_DIRECTION: -- *dest = CTINFO2DIR(ctinfo); -+ nft_reg_store8(dest, CTINFO2DIR(ctinfo)); - return; - case NFT_CT_STATUS: - *dest = ct->status; -@@ -129,10 +129,10 @@ static void nft_ct_get_eval(const struct - return; - } - case NFT_CT_L3PROTOCOL: -- *dest = nf_ct_l3num(ct); -+ nft_reg_store8(dest, nf_ct_l3num(ct)); - return; - case NFT_CT_PROTOCOL: -- *dest = nf_ct_protonum(ct); -+ nft_reg_store8(dest, nf_ct_protonum(ct)); - return; - default: - break; -@@ -149,10 +149,10 @@ static void nft_ct_get_eval(const struct - nf_ct_l3num(ct) == NFPROTO_IPV4 ? 4 : 16); - return; - case NFT_CT_PROTO_SRC: -- *dest = (__force __u16)tuple->src.u.all; -+ nft_reg_store16(dest, (__force u16)tuple->src.u.all); - return; - case NFT_CT_PROTO_DST: -- *dest = (__force __u16)tuple->dst.u.all; -+ nft_reg_store16(dest, (__force u16)tuple->dst.u.all); - return; - default: - break; ---- a/net/netfilter/nft_meta.c -+++ b/net/netfilter/nft_meta.c -@@ -45,16 +45,15 @@ void nft_meta_get_eval(const struct nft_ - *dest = skb->len; - break; - case NFT_META_PROTOCOL: -- *dest = 0; -- *(__be16 *)dest = skb->protocol; -+ nft_reg_store16(dest, (__force u16)skb->protocol); - break; - case NFT_META_NFPROTO: -- *dest = pkt->pf; -+ nft_reg_store8(dest, pkt->pf); - break; - case NFT_META_L4PROTO: - if (!pkt->tprot_set) - goto err; -- *dest = pkt->tprot; -+ nft_reg_store8(dest, pkt->tprot); - break; - case NFT_META_PRIORITY: - *dest = skb->priority; -@@ -85,14 +84,12 @@ void nft_meta_get_eval(const struct nft_ - case NFT_META_IIFTYPE: - if (in == NULL) - goto err; -- *dest = 0; -- *(u16 *)dest = in->type; -+ nft_reg_store16(dest, in->type); - break; - case NFT_META_OIFTYPE: - if (out == NULL) - goto err; -- *dest = 0; -- *(u16 *)dest = out->type; -+ nft_reg_store16(dest, out->type); - break; - case NFT_META_SKUID: - sk = skb_to_full_sk(skb); -@@ -142,22 +139,22 @@ void nft_meta_get_eval(const struct nft_ - #endif - case NFT_META_PKTTYPE: - if (skb->pkt_type != PACKET_LOOPBACK) { -- *dest = skb->pkt_type; -+ nft_reg_store8(dest, skb->pkt_type); - break; - } - - switch (pkt->pf) { - case NFPROTO_IPV4: - if (ipv4_is_multicast(ip_hdr(skb)->daddr)) -- *dest = PACKET_MULTICAST; -+ nft_reg_store8(dest, PACKET_MULTICAST); - else -- *dest = PACKET_BROADCAST; -+ nft_reg_store8(dest, PACKET_BROADCAST); - break; - case NFPROTO_IPV6: - if (ipv6_hdr(skb)->daddr.s6_addr[0] == 0xFF) -- *dest = PACKET_MULTICAST; -+ nft_reg_store8(dest, PACKET_MULTICAST); - else -- *dest = PACKET_BROADCAST; -+ nft_reg_store8(dest, PACKET_BROADCAST); - break; - case NFPROTO_NETDEV: - switch (skb->protocol) { -@@ -171,14 +168,14 @@ void nft_meta_get_eval(const struct nft_ - goto err; - - if (ipv4_is_multicast(iph->daddr)) -- *dest = PACKET_MULTICAST; -+ nft_reg_store8(dest, PACKET_MULTICAST); - else -- *dest = PACKET_BROADCAST; -+ nft_reg_store8(dest, PACKET_BROADCAST); - - break; - } - case htons(ETH_P_IPV6): -- *dest = PACKET_MULTICAST; -+ nft_reg_store8(dest, PACKET_MULTICAST); - break; - default: - WARN_ON_ONCE(1); -@@ -233,7 +230,9 @@ void nft_meta_set_eval(const struct nft_ - { - const struct nft_meta *meta = nft_expr_priv(expr); - struct sk_buff *skb = pkt->skb; -- u32 value = regs->data[meta->sreg]; -+ u32 *sreg = ®s->data[meta->sreg]; -+ u32 value = *sreg; -+ u8 pkt_type; - - switch (meta->key) { - case NFT_META_MARK: -@@ -243,9 +242,12 @@ void nft_meta_set_eval(const struct nft_ - skb->priority = value; - break; - case NFT_META_PKTTYPE: -- if (skb->pkt_type != value && -- skb_pkt_type_ok(value) && skb_pkt_type_ok(skb->pkt_type)) -- skb->pkt_type = value; -+ pkt_type = nft_reg_load8(sreg); -+ -+ if (skb->pkt_type != pkt_type && -+ skb_pkt_type_ok(pkt_type) && -+ skb_pkt_type_ok(skb->pkt_type)) -+ skb->pkt_type = pkt_type; - break; - case NFT_META_NFTRACE: - skb->nf_trace = !!value; ---- a/net/netfilter/nft_nat.c -+++ b/net/netfilter/nft_nat.c -@@ -65,10 +65,10 @@ static void nft_nat_eval(const struct nf - } - - if (priv->sreg_proto_min) { -- range.min_proto.all = -- *(__be16 *)®s->data[priv->sreg_proto_min]; -- range.max_proto.all = -- *(__be16 *)®s->data[priv->sreg_proto_max]; -+ range.min_proto.all = (__force __be16)nft_reg_load16( -+ ®s->data[priv->sreg_proto_min]); -+ range.max_proto.all = (__force __be16)nft_reg_load16( -+ ®s->data[priv->sreg_proto_max]); - range.flags |= NF_NAT_RANGE_PROTO_SPECIFIED; - } - diff --git a/target/linux/generic/backport-4.9/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch b/target/linux/generic/backport-4.9/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch deleted file mode 100644 index f20984955..000000000 --- a/target/linux/generic/backport-4.9/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 649affd04813c43e0a72886517fcfccd63230981 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Mon, 29 Jun 2015 16:53:03 +0200 -Subject: uapi/if_ether.h: prevent redefinition of struct ethhdr - -Musl provides its own ethhdr struct definition. Add a guard to prevent -its definition of the appropriate musl header has already been included. - -glibc does not implement this header, but when glibc will implement this -they can just define __UAPI_DEF_ETHHDR 0 to make it work with the -kernel. - -Signed-off-by: Hauke Mehrtens ---- - include/uapi/linux/if_ether.h | 3 +++ - include/uapi/linux/libc-compat.h | 6 ++++++ - 2 files changed, 9 insertions(+) - ---- a/include/uapi/linux/if_ether.h -+++ b/include/uapi/linux/if_ether.h -@@ -22,6 +22,7 @@ - #define _UAPI_LINUX_IF_ETHER_H - - #include -+#include - - /* - * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble -@@ -139,11 +140,13 @@ - * This is an Ethernet frame header. - */ - -+#if __UAPI_DEF_ETHHDR - struct ethhdr { - unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ - unsigned char h_source[ETH_ALEN]; /* source ether addr */ - __be16 h_proto; /* packet type ID field */ - } __attribute__((packed)); -+#endif - - - #endif /* _UAPI_LINUX_IF_ETHER_H */ ---- a/include/uapi/linux/libc-compat.h -+++ b/include/uapi/linux/libc-compat.h -@@ -263,4 +263,10 @@ - - #endif /* __GLIBC__ */ - -+/* Definitions for if_ether.h */ -+/* allow libcs like musl to deactivate this, glibc does not implement this. */ -+#ifndef __UAPI_DEF_ETHHDR -+#define __UAPI_DEF_ETHHDR 1 -+#endif -+ - #endif /* _UAPI_LIBC_COMPAT_H */ diff --git a/target/linux/generic/hack-4.14/204-module_strip.patch b/target/linux/generic/hack-4.14/204-module_strip.patch index db65062fc..dce9c4847 100644 --- a/target/linux/generic/hack-4.14/204-module_strip.patch +++ b/target/linux/generic/hack-4.14/204-module_strip.patch @@ -114,7 +114,7 @@ Signed-off-by: Felix Fietkau config MODULES_TREE_LOOKUP --- a/kernel/module.c +++ b/kernel/module.c -@@ -3006,9 +3006,11 @@ static struct module *setup_load_info(st +@@ -3008,9 +3008,11 @@ static struct module *setup_load_info(st static int check_modinfo(struct module *mod, struct load_info *info, int flags) { @@ -127,7 +127,7 @@ Signed-off-by: Felix Fietkau if (flags & MODULE_INIT_IGNORE_VERMAGIC) modmagic = NULL; -@@ -3029,6 +3031,7 @@ static int check_modinfo(struct module * +@@ -3031,6 +3033,7 @@ static int check_modinfo(struct module * mod->name); add_taint_module(mod, TAINT_OOT_MODULE, LOCKDEP_STILL_OK); } @@ -137,7 +137,7 @@ Signed-off-by: Felix Fietkau --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c -@@ -1982,7 +1982,9 @@ static void read_symbols(char *modname) +@@ -1984,7 +1984,9 @@ static void read_symbols(char *modname) symname = remove_dot(info.strtab + sym->st_name); handle_modversions(mod, &info, sym, symname); @@ -147,7 +147,7 @@ Signed-off-by: Felix Fietkau } if (!is_vmlinux(modname) || (is_vmlinux(modname) && vmlinux_section_warnings)) -@@ -2143,8 +2145,10 @@ static void add_header(struct buffer *b, +@@ -2145,8 +2147,10 @@ static void add_header(struct buffer *b, buf_printf(b, "#include \n"); buf_printf(b, "#include \n"); buf_printf(b, "\n"); @@ -158,7 +158,7 @@ Signed-off-by: Felix Fietkau buf_printf(b, "\n"); buf_printf(b, "__visible struct module __this_module\n"); buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n"); -@@ -2161,8 +2165,10 @@ static void add_header(struct buffer *b, +@@ -2163,8 +2167,10 @@ static void add_header(struct buffer *b, static void add_intree_flag(struct buffer *b, int is_intree) { @@ -169,7 +169,7 @@ Signed-off-by: Felix Fietkau } /* Cannot check for assembler */ -@@ -2175,10 +2181,12 @@ static void add_retpoline(struct buffer +@@ -2177,10 +2183,12 @@ static void add_retpoline(struct buffer static void add_staging_flag(struct buffer *b, const char *name) { @@ -182,7 +182,7 @@ Signed-off-by: Felix Fietkau } /** -@@ -2277,11 +2285,13 @@ static void add_depends(struct buffer *b +@@ -2279,11 +2287,13 @@ static void add_depends(struct buffer *b static void add_srcversion(struct buffer *b, struct module *mod) { @@ -196,7 +196,7 @@ Signed-off-by: Felix Fietkau } static void write_if_changed(struct buffer *b, const char *fname) -@@ -2518,7 +2528,9 @@ int main(int argc, char **argv) +@@ -2520,7 +2530,9 @@ int main(int argc, char **argv) add_staging_flag(&buf, mod->name); err |= add_versions(&buf, mod); add_depends(&buf, mod, modules); diff --git a/target/linux/generic/hack-4.14/721-phy_packets.patch b/target/linux/generic/hack-4.14/721-phy_packets.patch index fb977b10d..e3c1c34a4 100644 --- a/target/linux/generic/hack-4.14/721-phy_packets.patch +++ b/target/linux/generic/hack-4.14/721-phy_packets.patch @@ -136,7 +136,7 @@ Signed-off-by: Felix Fietkau #include #include -@@ -499,6 +500,22 @@ skb_fail: +@@ -503,6 +504,22 @@ skb_fail: } EXPORT_SYMBOL(__napi_alloc_skb); diff --git a/target/linux/generic/hack-4.19/204-module_strip.patch b/target/linux/generic/hack-4.19/204-module_strip.patch index 2630e45b6..7fa5d8ddb 100644 --- a/target/linux/generic/hack-4.19/204-module_strip.patch +++ b/target/linux/generic/hack-4.19/204-module_strip.patch @@ -114,7 +114,7 @@ Signed-off-by: Felix Fietkau config MODULES_TREE_LOOKUP --- a/kernel/module.c +++ b/kernel/module.c -@@ -3002,9 +3002,11 @@ static int setup_load_info(struct load_i +@@ -3004,9 +3004,11 @@ static int setup_load_info(struct load_i static int check_modinfo(struct module *mod, struct load_info *info, int flags) { @@ -127,7 +127,7 @@ Signed-off-by: Felix Fietkau if (flags & MODULE_INIT_IGNORE_VERMAGIC) modmagic = NULL; -@@ -3025,6 +3027,7 @@ static int check_modinfo(struct module * +@@ -3027,6 +3029,7 @@ static int check_modinfo(struct module * mod->name); add_taint_module(mod, TAINT_OOT_MODULE, LOCKDEP_STILL_OK); } @@ -137,7 +137,7 @@ Signed-off-by: Felix Fietkau --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c -@@ -1969,7 +1969,9 @@ static void read_symbols(const char *mod +@@ -1971,7 +1971,9 @@ static void read_symbols(const char *mod symname = remove_dot(info.strtab + sym->st_name); handle_modversions(mod, &info, sym, symname); @@ -147,7 +147,7 @@ Signed-off-by: Felix Fietkau } if (!is_vmlinux(modname) || vmlinux_section_warnings) check_sec_ref(mod, modname, &info); -@@ -2132,8 +2134,10 @@ static void add_header(struct buffer *b, +@@ -2134,8 +2136,10 @@ static void add_header(struct buffer *b, buf_printf(b, "\n"); buf_printf(b, "BUILD_SALT;\n"); buf_printf(b, "\n"); @@ -158,7 +158,7 @@ Signed-off-by: Felix Fietkau buf_printf(b, "\n"); buf_printf(b, "__visible struct module __this_module\n"); buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n"); -@@ -2150,8 +2154,10 @@ static void add_header(struct buffer *b, +@@ -2152,8 +2156,10 @@ static void add_header(struct buffer *b, static void add_intree_flag(struct buffer *b, int is_intree) { @@ -169,7 +169,7 @@ Signed-off-by: Felix Fietkau } /* Cannot check for assembler */ -@@ -2164,8 +2170,10 @@ static void add_retpoline(struct buffer +@@ -2166,8 +2172,10 @@ static void add_retpoline(struct buffer static void add_staging_flag(struct buffer *b, const char *name) { @@ -180,7 +180,7 @@ Signed-off-by: Felix Fietkau } /** -@@ -2264,11 +2272,13 @@ static void add_depends(struct buffer *b +@@ -2266,11 +2274,13 @@ static void add_depends(struct buffer *b static void add_srcversion(struct buffer *b, struct module *mod) { @@ -194,7 +194,7 @@ Signed-off-by: Felix Fietkau } static void write_if_changed(struct buffer *b, const char *fname) -@@ -2505,7 +2515,9 @@ int main(int argc, char **argv) +@@ -2507,7 +2517,9 @@ int main(int argc, char **argv) add_staging_flag(&buf, mod->name); err |= add_versions(&buf, mod); add_depends(&buf, mod, modules); diff --git a/target/linux/generic/hack-4.19/721-phy_packets.patch b/target/linux/generic/hack-4.19/721-phy_packets.patch index 8267eadac..421afbca1 100644 --- a/target/linux/generic/hack-4.19/721-phy_packets.patch +++ b/target/linux/generic/hack-4.19/721-phy_packets.patch @@ -136,7 +136,7 @@ Signed-off-by: Felix Fietkau #include #include -@@ -499,6 +500,22 @@ skb_fail: +@@ -503,6 +504,22 @@ skb_fail: } EXPORT_SYMBOL(__napi_alloc_skb); diff --git a/target/linux/generic/hack-4.9/204-module_strip.patch b/target/linux/generic/hack-4.9/204-module_strip.patch index c6484a8f9..fcca6bd02 100644 --- a/target/linux/generic/hack-4.9/204-module_strip.patch +++ b/target/linux/generic/hack-4.9/204-module_strip.patch @@ -137,7 +137,7 @@ Signed-off-by: Felix Fietkau --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c -@@ -1965,7 +1965,9 @@ static void read_symbols(char *modname) +@@ -1967,7 +1967,9 @@ static void read_symbols(char *modname) symname = remove_dot(info.strtab + sym->st_name); handle_modversions(mod, &info, sym, symname); @@ -147,7 +147,7 @@ Signed-off-by: Felix Fietkau } if (!is_vmlinux(modname) || (is_vmlinux(modname) && vmlinux_section_warnings)) -@@ -2109,7 +2111,9 @@ static void add_header(struct buffer *b, +@@ -2111,7 +2113,9 @@ static void add_header(struct buffer *b, buf_printf(b, "#include \n"); buf_printf(b, "#include \n"); buf_printf(b, "\n"); @@ -157,7 +157,7 @@ Signed-off-by: Felix Fietkau buf_printf(b, "\n"); buf_printf(b, "__visible struct module __this_module\n"); buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n"); -@@ -2126,24 +2130,30 @@ static void add_header(struct buffer *b, +@@ -2128,24 +2132,30 @@ static void add_header(struct buffer *b, static void add_intree_flag(struct buffer *b, int is_intree) { @@ -188,7 +188,7 @@ Signed-off-by: Felix Fietkau } /* In kernel, this size is defined in linux/module.h; -@@ -2247,11 +2257,13 @@ static void add_depends(struct buffer *b +@@ -2249,11 +2259,13 @@ static void add_depends(struct buffer *b static void add_srcversion(struct buffer *b, struct module *mod) { @@ -202,7 +202,7 @@ Signed-off-by: Felix Fietkau } static void write_if_changed(struct buffer *b, const char *fname) -@@ -2486,7 +2498,9 @@ int main(int argc, char **argv) +@@ -2488,7 +2500,9 @@ int main(int argc, char **argv) add_staging_flag(&buf, mod->name); err |= add_versions(&buf, mod); add_depends(&buf, mod, modules); diff --git a/target/linux/generic/hack-4.9/721-phy_packets.patch b/target/linux/generic/hack-4.9/721-phy_packets.patch index 9bc5b0177..d22c87303 100644 --- a/target/linux/generic/hack-4.9/721-phy_packets.patch +++ b/target/linux/generic/hack-4.9/721-phy_packets.patch @@ -136,7 +136,7 @@ Signed-off-by: Felix Fietkau #include #include -@@ -529,6 +530,22 @@ skb_fail: +@@ -533,6 +534,22 @@ skb_fail: } EXPORT_SYMBOL(__napi_alloc_skb); diff --git a/target/linux/generic/pending-3.18/204-module_strip.patch b/target/linux/generic/pending-3.18/204-module_strip.patch index 2df7ba013..dcad14879 100644 --- a/target/linux/generic/pending-3.18/204-module_strip.patch +++ b/target/linux/generic/pending-3.18/204-module_strip.patch @@ -123,7 +123,7 @@ Signed-off-by: Felix Fietkau set_license(mod, get_modinfo(info, "license")); --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c -@@ -1758,7 +1758,9 @@ static void read_symbols(char *modname) +@@ -1760,7 +1760,9 @@ static void read_symbols(char *modname) symname = remove_dot(info.strtab + sym->st_name); handle_modversions(mod, &info, sym, symname); @@ -133,7 +133,7 @@ Signed-off-by: Felix Fietkau } if (!is_vmlinux(modname) || (is_vmlinux(modname) && vmlinux_section_warnings)) -@@ -1902,7 +1904,9 @@ static void add_header(struct buffer *b, +@@ -1904,7 +1906,9 @@ static void add_header(struct buffer *b, buf_printf(b, "#include \n"); buf_printf(b, "#include \n"); buf_printf(b, "\n"); @@ -143,7 +143,7 @@ Signed-off-by: Felix Fietkau buf_printf(b, "\n"); buf_printf(b, "__visible struct module __this_module\n"); buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n"); -@@ -1919,16 +1923,20 @@ static void add_header(struct buffer *b, +@@ -1921,16 +1925,20 @@ static void add_header(struct buffer *b, static void add_intree_flag(struct buffer *b, int is_intree) { @@ -164,7 +164,7 @@ Signed-off-by: Felix Fietkau } /** -@@ -2021,11 +2029,13 @@ static void add_depends(struct buffer *b +@@ -2023,11 +2031,13 @@ static void add_depends(struct buffer *b static void add_srcversion(struct buffer *b, struct module *mod) { @@ -178,7 +178,7 @@ Signed-off-by: Felix Fietkau } static void write_if_changed(struct buffer *b, const char *fname) -@@ -2256,7 +2266,9 @@ int main(int argc, char **argv) +@@ -2258,7 +2268,9 @@ int main(int argc, char **argv) add_staging_flag(&buf, mod->name); err |= add_versions(&buf, mod); add_depends(&buf, mod, modules); diff --git a/target/linux/generic/pending-4.19/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch b/target/linux/generic/pending-4.19/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch index 869af0e64..3aca45766 100644 --- a/target/linux/generic/pending-4.19/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch +++ b/target/linux/generic/pending-4.19/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch @@ -71,7 +71,7 @@ Signed-off-by: Tobias Wolf --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -6372,7 +6372,7 @@ static void __ref alloc_node_mem_map(str +@@ -6393,7 +6393,7 @@ static void __ref alloc_node_mem_map(str mem_map = NODE_DATA(0)->node_mem_map; #if defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) || defined(CONFIG_FLATMEM) if (page_to_pfn(mem_map) != pgdat->node_start_pfn) diff --git a/target/linux/generic/pending-4.19/400-mtd-add-rootfs-split-support.patch b/target/linux/generic/pending-4.19/400-mtd-add-rootfs-split-support.patch index 6fdd0267c..e646224df 100644 --- a/target/linux/generic/pending-4.19/400-mtd-add-rootfs-split-support.patch +++ b/target/linux/generic/pending-4.19/400-mtd-add-rootfs-split-support.patch @@ -59,7 +59,7 @@ Signed-off-by: Felix Fietkau /* * Given a pointer to the MTD object in the mtd_part structure, we can retrieve * the pointer to that structure. -@@ -619,6 +623,7 @@ int mtd_add_partition(struct mtd_info *p +@@ -623,6 +627,7 @@ int mtd_add_partition(struct mtd_info *p mutex_unlock(&mtd_partitions_mutex); add_mtd_device(&new->mtd); @@ -67,7 +67,7 @@ Signed-off-by: Felix Fietkau mtd_add_partition_attrs(new); -@@ -697,6 +702,29 @@ int mtd_del_partition(struct mtd_info *m +@@ -701,6 +706,29 @@ int mtd_del_partition(struct mtd_info *m } EXPORT_SYMBOL_GPL(mtd_del_partition); @@ -97,7 +97,7 @@ Signed-off-by: Felix Fietkau /* * This function, given a master MTD object and a partition table, creates * and registers slave MTD objects which are bound to the master according to -@@ -728,6 +756,7 @@ int add_mtd_partitions(struct mtd_info * +@@ -732,6 +760,7 @@ int add_mtd_partitions(struct mtd_info * mutex_unlock(&mtd_partitions_mutex); add_mtd_device(&slave->mtd); diff --git a/target/linux/generic/pending-4.19/401-mtd-add-support-for-different-partition-parser-types.patch b/target/linux/generic/pending-4.19/401-mtd-add-support-for-different-partition-parser-types.patch index d48447fb9..4026a2050 100644 --- a/target/linux/generic/pending-4.19/401-mtd-add-support-for-different-partition-parser-types.patch +++ b/target/linux/generic/pending-4.19/401-mtd-add-support-for-different-partition-parser-types.patch @@ -20,7 +20,7 @@ Signed-off-by: Gabor Juhos /* * Given a pointer to the MTD object in the mtd_part structure, we can retrieve -@@ -702,6 +706,36 @@ int mtd_del_partition(struct mtd_info *m +@@ -706,6 +710,36 @@ int mtd_del_partition(struct mtd_info *m } EXPORT_SYMBOL_GPL(mtd_del_partition); @@ -57,7 +57,7 @@ Signed-off-by: Gabor Juhos #ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME #define SPLIT_FIRMWARE_NAME CONFIG_MTD_SPLIT_FIRMWARE_NAME #else -@@ -1037,6 +1071,61 @@ void mtd_part_parser_cleanup(struct mtd_ +@@ -1041,6 +1075,61 @@ void mtd_part_parser_cleanup(struct mtd_ } } diff --git a/target/linux/generic/pending-4.19/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch b/target/linux/generic/pending-4.19/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch index ca9b6c359..8a90ce6a8 100644 --- a/target/linux/generic/pending-4.19/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch +++ b/target/linux/generic/pending-4.19/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch @@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -744,6 +744,7 @@ run_parsers_by_type(struct mtd_part *sla +@@ -748,6 +748,7 @@ run_parsers_by_type(struct mtd_part *sla static void split_firmware(struct mtd_info *master, struct mtd_part *part) { @@ -18,7 +18,7 @@ Signed-off-by: Gabor Juhos } static void mtd_partition_split(struct mtd_info *master, struct mtd_part *part) -@@ -753,6 +754,12 @@ static void mtd_partition_split(struct m +@@ -757,6 +758,12 @@ static void mtd_partition_split(struct m if (rootfs_found) return; diff --git a/target/linux/generic/pending-4.19/404-mtd-add-more-helper-functions.patch b/target/linux/generic/pending-4.19/404-mtd-add-more-helper-functions.patch index 82c74e27a..2e95e99f6 100644 --- a/target/linux/generic/pending-4.19/404-mtd-add-more-helper-functions.patch +++ b/target/linux/generic/pending-4.19/404-mtd-add-more-helper-functions.patch @@ -11,7 +11,7 @@ Signed-off-by: Gabor Juhos --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -1150,6 +1150,24 @@ int mtd_is_partition(const struct mtd_in +@@ -1154,6 +1154,24 @@ int mtd_is_partition(const struct mtd_in } EXPORT_SYMBOL_GPL(mtd_is_partition); diff --git a/target/linux/generic/pending-4.19/411-mtd-partial_eraseblock_write.patch b/target/linux/generic/pending-4.19/411-mtd-partial_eraseblock_write.patch index 0b5e4005f..bf9822fda 100644 --- a/target/linux/generic/pending-4.19/411-mtd-partial_eraseblock_write.patch +++ b/target/linux/generic/pending-4.19/411-mtd-partial_eraseblock_write.patch @@ -98,7 +98,7 @@ Signed-off-by: Felix Fietkau return ret; } -@@ -535,19 +602,22 @@ static struct mtd_part *allocate_partiti +@@ -539,19 +606,22 @@ static struct mtd_part *allocate_partiti remainder = do_div(tmp, wr_alignment); if ((slave->mtd.flags & MTD_WRITEABLE) && remainder) { /* Doesn't start on a boundary of major erase size */ 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 273e7ff0a..a0d177586 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; -@@ -3232,6 +3234,7 @@ static int packet_create(struct net *net +@@ -3233,6 +3235,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; -@@ -3843,6 +3846,16 @@ packet_setsockopt(struct socket *sock, i +@@ -3844,6 +3847,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; } -@@ -3895,6 +3908,13 @@ static int packet_getsockopt(struct sock +@@ -3896,6 +3909,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR: val = po->has_vnet_hdr; break; diff --git a/target/linux/generic/pending-4.19/834-ledtrig-libata.patch b/target/linux/generic/pending-4.19/834-ledtrig-libata.patch index 16855201f..70d3de05d 100644 --- a/target/linux/generic/pending-4.19/834-ledtrig-libata.patch +++ b/target/linux/generic/pending-4.19/834-ledtrig-libata.patch @@ -65,7 +65,7 @@ Signed-off-by: Daniel Golle /** * ata_build_rw_tf - Build ATA taskfile for given read/write request * @tf: Target ATA taskfile -@@ -5130,6 +5143,9 @@ struct ata_queued_cmd *ata_qc_new_init(s +@@ -5131,6 +5144,9 @@ struct ata_queued_cmd *ata_qc_new_init(s if (tag < 0) return NULL; } @@ -75,7 +75,7 @@ Signed-off-by: Daniel Golle qc = __ata_qc_from_tag(ap, tag); qc->tag = qc->hw_tag = tag; -@@ -6040,6 +6056,9 @@ struct ata_port *ata_port_alloc(struct a +@@ -6041,6 +6057,9 @@ struct ata_port *ata_port_alloc(struct a ap->stats.unhandled_irq = 1; ap->stats.idle_irq = 1; #endif @@ -85,7 +85,7 @@ Signed-off-by: Daniel Golle ata_sff_port_init(ap); return ap; -@@ -6075,6 +6094,12 @@ static void ata_host_release(struct kref +@@ -6076,6 +6095,12 @@ static void ata_host_release(struct kref kfree(ap->pmp_link); kfree(ap->slave_link); @@ -98,7 +98,7 @@ Signed-off-by: Daniel Golle kfree(ap); host->ports[i] = NULL; } -@@ -6538,7 +6563,23 @@ int ata_host_register(struct ata_host *h +@@ -6539,7 +6564,23 @@ int ata_host_register(struct ata_host *h host->ports[i]->print_id = atomic_inc_return(&ata_print_id); host->ports[i]->local_port_no = i + 1; } diff --git a/target/linux/ipq40xx/patches-4.14/080-pinctrl-msm-fix-gpio-hog-related-boot-issues.patch b/target/linux/ipq40xx/patches-4.14/080-pinctrl-msm-fix-gpio-hog-related-boot-issues.patch index cffcd6c76..81b13e6b2 100644 --- a/target/linux/ipq40xx/patches-4.14/080-pinctrl-msm-fix-gpio-hog-related-boot-issues.patch +++ b/target/linux/ipq40xx/patches-4.14/080-pinctrl-msm-fix-gpio-hog-related-boot-issues.patch @@ -69,35 +69,3 @@ Origin: other, https://patchwork.kernel.org/patch/10339127/ #gpio-cells = <2>; interrupt-controller; #interrupt-cells = <2>; ---- a/drivers/pinctrl/qcom/pinctrl-msm.c -+++ b/drivers/pinctrl/qcom/pinctrl-msm.c -@@ -839,11 +839,24 @@ static int msm_gpio_init(struct msm_pinc - return ret; - } - -- ret = gpiochip_add_pin_range(&pctrl->chip, dev_name(pctrl->dev), 0, 0, chip->ngpio); -- if (ret) { -- dev_err(pctrl->dev, "Failed to add pin range\n"); -- gpiochip_remove(&pctrl->chip); -- return ret; -+ /* -+ * For DeviceTree-supported systems, the gpio core checks the -+ * pinctrl's device node for the "gpio-ranges" property. -+ * If it is present, it takes care of adding the pin ranges -+ * for the driver. In this case the driver can skip ahead. -+ * -+ * In order to remain compatible with older, existing DeviceTree -+ * files which don't set the "gpio-ranges" property or systems that -+ * utilize ACPI the driver has to call gpiochip_add_pin_range(). -+ */ -+ if (!of_property_read_bool(pctrl->dev->of_node, "gpio-ranges")) { -+ ret = gpiochip_add_pin_range(&pctrl->chip, -+ dev_name(pctrl->dev), 0, 0, chip->ngpio); -+ if (ret) { -+ dev_err(pctrl->dev, "Failed to add pin range\n"); -+ gpiochip_remove(&pctrl->chip); -+ return ret; -+ } - } - - ret = gpiochip_irqchip_add(chip, diff --git a/target/linux/ipq806x/patches-4.14/0048-PM-OPP-HACK-Allow-to-set-regulator-without-opp_list.patch b/target/linux/ipq806x/patches-4.14/0048-PM-OPP-HACK-Allow-to-set-regulator-without-opp_list.patch index 4cbb4422c..7c78d444f 100644 --- a/target/linux/ipq806x/patches-4.14/0048-PM-OPP-HACK-Allow-to-set-regulator-without-opp_list.patch +++ b/target/linux/ipq806x/patches-4.14/0048-PM-OPP-HACK-Allow-to-set-regulator-without-opp_list.patch @@ -10,7 +10,7 @@ Signed-off-by: Georgi Djakov --- a/drivers/base/power/opp/core.c +++ b/drivers/base/power/opp/core.c -@@ -1277,11 +1277,13 @@ struct opp_table *dev_pm_opp_set_regulat +@@ -1280,11 +1280,13 @@ struct opp_table *dev_pm_opp_set_regulat if (!opp_table) return ERR_PTR(-ENOMEM); diff --git a/target/linux/ipq806x/patches-4.14/0049-PM-OPP-Support-adjusting-OPP-voltages-at-runtime.patch b/target/linux/ipq806x/patches-4.14/0049-PM-OPP-Support-adjusting-OPP-voltages-at-runtime.patch index abcccb277..ef48e9f01 100644 --- a/target/linux/ipq806x/patches-4.14/0049-PM-OPP-Support-adjusting-OPP-voltages-at-runtime.patch +++ b/target/linux/ipq806x/patches-4.14/0049-PM-OPP-Support-adjusting-OPP-voltages-at-runtime.patch @@ -27,7 +27,7 @@ Signed-off-by: Georgi Djakov --- a/drivers/base/power/opp/core.c +++ b/drivers/base/power/opp/core.c -@@ -1605,6 +1605,83 @@ put_table: +@@ -1608,6 +1608,83 @@ put_table: } /** diff --git a/target/linux/ipq806x/patches-4.14/0052-PM-OPP-Update-the-voltage-tolerance-when-adjusting-t.patch b/target/linux/ipq806x/patches-4.14/0052-PM-OPP-Update-the-voltage-tolerance-when-adjusting-t.patch index 6299fcf25..7cde22be0 100644 --- a/target/linux/ipq806x/patches-4.14/0052-PM-OPP-Update-the-voltage-tolerance-when-adjusting-t.patch +++ b/target/linux/ipq806x/patches-4.14/0052-PM-OPP-Update-the-voltage-tolerance-when-adjusting-t.patch @@ -17,7 +17,7 @@ Signed-off-by: Georgi Djakov --- a/drivers/base/power/opp/core.c +++ b/drivers/base/power/opp/core.c -@@ -1649,6 +1649,7 @@ int dev_pm_opp_adjust_voltage(struct dev +@@ -1652,6 +1652,7 @@ int dev_pm_opp_adjust_voltage(struct dev struct opp_table *opp_table; struct dev_pm_opp *new_opp, *tmp_opp, *opp = ERR_PTR(-ENODEV); int r = 0; @@ -25,7 +25,7 @@ Signed-off-by: Georgi Djakov /* keep the node allocated */ new_opp = kmalloc(sizeof(*new_opp), GFP_KERNEL); -@@ -1685,6 +1686,10 @@ int dev_pm_opp_adjust_voltage(struct dev +@@ -1688,6 +1689,10 @@ int dev_pm_opp_adjust_voltage(struct dev /* plug in new node */ new_opp->supplies[0].u_volt = u_volt; diff --git a/target/linux/ipq806x/patches-4.14/0073-pinctrl-qom-use-scm_call-to-route-GPIO-irq-to-Apps.patch b/target/linux/ipq806x/patches-4.14/0073-pinctrl-qom-use-scm_call-to-route-GPIO-irq-to-Apps.patch index 4ecdf094e..150768645 100644 --- a/target/linux/ipq806x/patches-4.14/0073-pinctrl-qom-use-scm_call-to-route-GPIO-irq-to-Apps.patch +++ b/target/linux/ipq806x/patches-4.14/0073-pinctrl-qom-use-scm_call-to-route-GPIO-irq-to-Apps.patch @@ -157,7 +157,7 @@ Signed-off-by: Ajay Kishore /* Update configuration for gpio. * RAW_STATUS_EN is left on for all gpio irqs. Due to the -@@ -962,4 +985,3 @@ int msm_pinctrl_remove(struct platform_d +@@ -975,4 +998,3 @@ int msm_pinctrl_remove(struct platform_d return 0; } EXPORT_SYMBOL(msm_pinctrl_remove); 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 4e13ec950..00a5309dc 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 @@ -18,7 +18,7 @@ uart->capabilities = up->capabilities; --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c -@@ -2254,6 +2254,7 @@ uart_report_port(struct uart_driver *drv +@@ -2260,6 +2260,7 @@ uart_report_port(struct uart_driver *drv snprintf(address, sizeof(address), "I/O 0x%lx offset 0x%x", port->iobase, port->hub6); break; @@ -26,7 +26,7 @@ case UPIO_MEM: case UPIO_MEM16: case UPIO_MEM32: -@@ -2918,6 +2919,7 @@ int uart_match_port(struct uart_port *po +@@ -2924,6 +2925,7 @@ int uart_match_port(struct uart_port *po case UPIO_HUB6: return (port1->iobase == port2->iobase) && (port1->hub6 == port2->hub6); diff --git a/target/linux/ixp4xx/patches-4.9/600-skb_avoid_dmabounce.patch b/target/linux/ixp4xx/patches-4.9/600-skb_avoid_dmabounce.patch index 046ec4e8f..cdd9fde8f 100644 --- a/target/linux/ixp4xx/patches-4.9/600-skb_avoid_dmabounce.patch +++ b/target/linux/ixp4xx/patches-4.9/600-skb_avoid_dmabounce.patch @@ -10,7 +10,7 @@ /* Get the HEAD */ skb = kmem_cache_alloc_node(cache, gfp_mask & ~__GFP_DMA, node); -@@ -1224,6 +1227,10 @@ int pskb_expand_head(struct sk_buff *skb +@@ -1228,6 +1231,10 @@ int pskb_expand_head(struct sk_buff *skb if (skb_shared(skb)) BUG(); diff --git a/target/linux/kirkwood/config-4.19 b/target/linux/kirkwood/config-4.19 new file mode 100644 index 000000000..2cc45afb2 --- /dev/null +++ b/target/linux/kirkwood/config-4.19 @@ -0,0 +1,345 @@ +CONFIG_ALIGNMENT_TRAP=y +CONFIG_ARCH_CLOCKSOURCE_DATA=y +CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +CONFIG_ARCH_HAS_FORTIFY_SOURCE=y +CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y +CONFIG_ARCH_HAS_KCOV=y +CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y +CONFIG_ARCH_HAS_PHYS_TO_DMA=y +CONFIG_ARCH_HAS_SET_MEMORY=y +CONFIG_ARCH_HAS_SG_CHAIN=y +CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y +CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y +CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_MULTIPLATFORM=y +CONFIG_ARCH_MULTI_CPU_AUTO=y +# CONFIG_ARCH_MULTI_V4 is not set +# CONFIG_ARCH_MULTI_V4T is not set +CONFIG_ARCH_MULTI_V4_V5=y +CONFIG_ARCH_MULTI_V5=y +CONFIG_ARCH_MVEBU=y +CONFIG_ARCH_NR_GPIO=0 +CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y +CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y +CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y +CONFIG_ARCH_SUPPORTS_UPROBES=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_USE_BUILTIN_BSWAP=y +CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y +CONFIG_ARCH_WANT_GENERAL_HUGETLB=y +CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +CONFIG_ARCH_WANT_LIBATA_LEDS=y +CONFIG_ARM=y +# CONFIG_ARMADA_THERMAL is not set +CONFIG_ARM_APPENDED_DTB=y +CONFIG_ARM_ATAG_DTB_COMPAT=y +# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND is not set +CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y +CONFIG_ARM_HAS_SG_CHAIN=y +# CONFIG_ARM_KIRKWOOD_CPUIDLE is not set +CONFIG_ARM_L1_CACHE_SHIFT=5 +# CONFIG_ARM_MVEBU_V7_CPUIDLE is not set +CONFIG_ARM_PATCH_PHYS_VIRT=y +# CONFIG_ARM_THUMB is not set +CONFIG_ATA=y +CONFIG_ATAGS=y +CONFIG_ATA_LEDS=y +CONFIG_AUTO_ZRELADDR=y +CONFIG_BLK_DEV_SD=y +CONFIG_BLK_MQ_PCI=y +CONFIG_BLK_SCSI_REQUEST=y +CONFIG_CACHE_FEROCEON_L2=y +# CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH is not set +CONFIG_CLKDEV_LOOKUP=y +CONFIG_CLKSRC_MMIO=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_COMMON_CLK=y +CONFIG_CPU_32v5=y +CONFIG_CPU_ABRT_EV5T=y +# CONFIG_CPU_BIG_ENDIAN is not set +CONFIG_CPU_CACHE_VIVT=y +CONFIG_CPU_COPY_FEROCEON=y +CONFIG_CPU_CP15=y +CONFIG_CPU_CP15_MMU=y +CONFIG_CPU_FEROCEON=y +# CONFIG_CPU_FEROCEON_OLD_ID is not set +# CONFIG_CPU_ICACHE_DISABLE is not set +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_GOV_LADDER=y +CONFIG_CPU_PABRT_LEGACY=y +CONFIG_CPU_PM=y +CONFIG_CPU_THUMB_CAPABLE=y +CONFIG_CPU_TLB_FEROCEON=y +CONFIG_CPU_USE_DOMAINS=y +CONFIG_CRC16=y +# CONFIG_CRC32_SARWATE is not set +CONFIG_CRC32_SLICEBY8=y +CONFIG_CRYPTO_ACOMP2=y +CONFIG_CRYPTO_CRC32C=y +CONFIG_CRYPTO_DEFLATE=y +CONFIG_CRYPTO_DES=y +CONFIG_CRYPTO_DEV_MARVELL_CESA=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_HW=y +CONFIG_CRYPTO_LZO=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_WORKQUEUE=y +CONFIG_DEBUG_LL=y +CONFIG_DEBUG_LL_INCLUDE="debug/8250.S" +CONFIG_DEBUG_MVEBU_UART0_ALTERNATE=y +# CONFIG_DEBUG_MVEBU_UART1_ALTERNATE is not set +CONFIG_DEBUG_UART_8250=y +# CONFIG_DEBUG_UART_8250_FLOW_CONTROL is not set +CONFIG_DEBUG_UART_8250_SHIFT=2 +# CONFIG_DEBUG_UART_8250_WORD is not set +CONFIG_DEBUG_UART_PHYS=0xf1012000 +CONFIG_DEBUG_UART_VIRT=0xfed12000 +CONFIG_DEBUG_UNCOMPRESS=y +# CONFIG_DEBUG_USER is not set +# CONFIG_DLCI is not set +CONFIG_DNOTIFY=y +CONFIG_DTC=y +# CONFIG_EARLY_PRINTK is not set +CONFIG_EDAC_ATOMIC_SCRUB=y +CONFIG_EDAC_SUPPORT=y +CONFIG_EXT4_FS=y +CONFIG_FIXED_PHY=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FRAME_POINTER=y +CONFIG_FS_IOMAP=y +CONFIG_FS_MBCACHE=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_ATOMIC64=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IRQ_CHIP=y +CONFIG_GENERIC_IRQ_MULTI_HANDLER=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_PHY=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GLOB=y +CONFIG_GPIOLIB=y +CONFIG_GPIO_MVEBU=y +CONFIG_GPIO_SYSFS=y +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +CONFIG_HAVE_ARCH_AUDITSYSCALL=y +CONFIG_HAVE_ARCH_JUMP_LABEL=y +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_HAVE_ARCH_PFN_VALID=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +CONFIG_HAVE_CLK=y +CONFIG_HAVE_CLK_PREPARE=y +CONFIG_HAVE_CONTEXT_TRACKING=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_HAVE_DEBUG_KMEMLEAK=y +CONFIG_HAVE_DMA_CONTIGUOUS=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y +CONFIG_HAVE_EBPF_JIT=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_IDE=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_LD_DEAD_CODE_DATA_ELIMINATION=y +CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_MOD_ARCH_SPECIFIC=y +CONFIG_HAVE_NET_DSA=y +CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_OPTPROBES=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_PERF_REGS=y +CONFIG_HAVE_PERF_USER_STACK_DUMP=y +CONFIG_HAVE_PROC_CPU=y +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y +CONFIG_HAVE_RSEQ=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +CONFIG_HAVE_UID16=y +CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_OMAP=y +CONFIG_HZ_FIXED=0 +CONFIG_HZ_PERIODIC=y +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_MV64XXX=y +# CONFIG_I2C_PXA is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +CONFIG_JBD2=y +CONFIG_KIRKWOOD_CLK=y +CONFIG_KIRKWOOD_THERMAL=y +CONFIG_LEDS_GPIO=y +CONFIG_LEDS_NETXBIG=y +CONFIG_LEDS_NS2=y +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 +CONFIG_LIBFDT=y +CONFIG_LOCK_DEBUGGING_SUPPORT=y +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +CONFIG_MACH_KIRKWOOD=y +CONFIG_MACH_MVEBU_ANY=y +CONFIG_MANGLE_BOOTARGS=y +CONFIG_MDIO_BUS=y +CONFIG_MDIO_DEVICE=y +CONFIG_MEMFD_CREATE=y +CONFIG_MIGHT_HAVE_PCI=y +CONFIG_MIGRATION=y +CONFIG_MMC=y +CONFIG_MMC_BLOCK=y +CONFIG_MMC_MVSDIO=y +# CONFIG_MMC_TIFM_SD is not set +CONFIG_MODULES_USE_ELF_REL=y +# CONFIG_MTD_CFI is not set +CONFIG_MTD_CMDLINE_PARTS=y +CONFIG_MTD_NAND=y +CONFIG_MTD_NAND_ECC=y +# CONFIG_MTD_NAND_MARVELL is not set +CONFIG_MTD_NAND_ORION=y +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_BEB_LIMIT=20 +CONFIG_MTD_UBI_BLOCK=y +# CONFIG_MTD_UBI_FASTMAP is not set +# CONFIG_MTD_UBI_GLUEBI is not set +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MV643XX_ETH=y +CONFIG_MVEBU_CLK_COMMON=y +CONFIG_MVEBU_MBUS=y +CONFIG_MVMDIO=y +# CONFIG_MVNETA is not set +# CONFIG_MVPP2 is not set +CONFIG_MVSW61XX_PHY=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEED_KUSER_HELPERS=y +CONFIG_NEED_PER_CPU_KM=y +CONFIG_NLS=y +CONFIG_NO_BOOTMEM=y +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_OF_RESERVED_MEM=y +CONFIG_OLD_SIGACTION=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_ORION_IRQCHIP=y +CONFIG_ORION_TIMER=y +CONFIG_ORION_WATCHDOG=y +CONFIG_OUTER_CACHE=y +CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_DOMAINS_GENERIC=y +CONFIG_PCI_MVEBU=y +# CONFIG_PCI_V3_SEMI is not set +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PHYLIB=y +# CONFIG_PHY_MVEBU_CP110_COMPHY is not set +CONFIG_PHY_MVEBU_SATA=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_KIRKWOOD=y +CONFIG_PINCTRL_MVEBU=y +# CONFIG_PINCTRL_SINGLE is not set +CONFIG_PLAT_ORION=y +CONFIG_POWER_RESET=y +CONFIG_POWER_RESET_GPIO=y +# CONFIG_POWER_RESET_QNAP is not set +CONFIG_POWER_SUPPLY=y +CONFIG_RATIONAL=y +CONFIG_REFCOUNT_FULL=y +CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y +CONFIG_REGMAP_MMIO=y +CONFIG_REGMAP_SPI=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_MV=y +CONFIG_RTC_I2C_AND_SPI=y +CONFIG_RTC_MC146818_LIB=y +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_SATA_MV=y +CONFIG_SCSI=y +CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y +CONFIG_SERIAL_8250_FSL=y +# CONFIG_SERIAL_MVEBU_UART is not set +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_SGL_ALLOC=y +CONFIG_SG_POOL=y +CONFIG_SOC_BUS=y +CONFIG_SPARSE_IRQ=y +CONFIG_SPI=y +# CONFIG_SPI_ARMADA_3700 is not set +CONFIG_SPI_MASTER=y +CONFIG_SPI_ORION=y +CONFIG_SPLIT_PTLOCK_CPUS=999999 +CONFIG_SRAM=y +CONFIG_SRAM_EXEC=y +CONFIG_SRCU=y +CONFIG_SWCONFIG=y +CONFIG_SWPHY=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_THERMAL=y +CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y +CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 +CONFIG_THERMAL_GOV_STEP_WISE=y +CONFIG_THERMAL_OF=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TIMER_OF=y +CONFIG_TIMER_PROBE=y +CONFIG_TINY_SRCU=y +CONFIG_UBIFS_FS=y +CONFIG_UBIFS_FS_ADVANCED_COMPR=y +CONFIG_UBIFS_FS_LZO=y +CONFIG_UBIFS_FS_ZLIB=y +CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" +CONFIG_USB=y +CONFIG_USB_COMMON=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_EHCI_HCD_ORION=y +# CONFIG_USB_EHCI_HCD_PLATFORM is not set +CONFIG_USB_LED_TRIG=y +# CONFIG_USB_ROLE_SWITCH is not set +CONFIG_USB_STORAGE=y +CONFIG_USB_SUPPORT=y +CONFIG_USE_OF=y +# CONFIG_VFP is not set +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_WAN=y +CONFIG_WATCHDOG_CORE=y +CONFIG_XZ_DEC_ARM=y +CONFIG_XZ_DEC_BCJ=y +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZLIB_DEFLATE=y +CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/kirkwood/patches-4.19/100-ib62x0.patch b/target/linux/kirkwood/patches-4.19/100-ib62x0.patch new file mode 100644 index 000000000..d1a5aa7d3 --- /dev/null +++ b/target/linux/kirkwood/patches-4.19/100-ib62x0.patch @@ -0,0 +1,30 @@ +--- a/arch/arm/boot/dts/kirkwood-ib62x0.dts ++++ b/arch/arm/boot/dts/kirkwood-ib62x0.dts +@@ -6,7 +6,7 @@ + + / { + model = "RaidSonic ICY BOX IB-NAS62x0 (Rev B)"; +- compatible = "raidsonic,ib-nas6210-b", "raidsonic,ib-nas6220-b", "raidsonic,ib-nas6210", "raidsonic,ib-nas6220", "raidsonic,ib-nas62x0", "marvell,kirkwood-88f6281", "marvell,kirkwood"; ++ compatible = "raidsonic,ib-nas62x0", "marvell,kirkwood-88f6281", "marvell,kirkwood"; + + memory { + device_type = "memory"; +@@ -118,13 +118,13 @@ + }; + + partition@100000 { +- label = "uImage"; +- reg = <0x0100000 0x600000>; ++ label = "second stage u-boot"; ++ reg = <0x100000 0x200000>; + }; + +- partition@700000 { +- label = "root"; +- reg = <0x0700000 0xf900000>; ++ partition@200000 { ++ label = "ubi"; ++ reg = <0x200000 0xfe00000>; + }; + + }; diff --git a/target/linux/kirkwood/patches-4.19/101-iconnect.patch b/target/linux/kirkwood/patches-4.19/101-iconnect.patch new file mode 100644 index 000000000..ab47b5a72 --- /dev/null +++ b/target/linux/kirkwood/patches-4.19/101-iconnect.patch @@ -0,0 +1,50 @@ +--- a/arch/arm/boot/dts/kirkwood-iconnect.dts ++++ b/arch/arm/boot/dts/kirkwood-iconnect.dts +@@ -16,8 +16,6 @@ + chosen { + bootargs = "console=ttyS0,115200n8 earlyprintk"; + stdout-path = &uart0; +- linux,initrd-start = <0x4500040>; +- linux,initrd-end = <0x4800000>; + }; + + ocp@f1000000 { +@@ -146,28 +144,23 @@ + status = "okay"; + + partition@0 { +- label = "uboot"; +- reg = <0x0000000 0xc0000>; ++ label = "u-boot"; ++ reg = <0x0000000 0xe0000>; + }; + +- partition@a0000 { +- label = "env"; +- reg = <0xa0000 0x20000>; ++ partition@e0000 { ++ label = "u-boot environment"; ++ reg = <0xe0000 0x100000>; + }; + + partition@100000 { +- label = "zImage"; +- reg = <0x100000 0x300000>; ++ label = "second stage u-boot"; ++ reg = <0x100000 0x200000>; + }; + +- partition@540000 { +- label = "initrd"; +- reg = <0x540000 0x300000>; +- }; +- +- partition@980000 { +- label = "boot"; +- reg = <0x980000 0x1f400000>; ++ partition@200000 { ++ label = "ubi"; ++ reg = <0x200000 0x1fe00000>; + }; + }; + diff --git a/target/linux/kirkwood/patches-4.19/102-dockstar.patch b/target/linux/kirkwood/patches-4.19/102-dockstar.patch new file mode 100644 index 000000000..7462b93e0 --- /dev/null +++ b/target/linux/kirkwood/patches-4.19/102-dockstar.patch @@ -0,0 +1,32 @@ +--- a/arch/arm/boot/dts/kirkwood-dockstar.dts ++++ b/arch/arm/boot/dts/kirkwood-dockstar.dts +@@ -78,18 +78,22 @@ + + partition@0 { + label = "u-boot"; +- reg = <0x0000000 0x100000>; +- read-only; ++ reg = <0x0000000 0xe0000>; ++ }; ++ ++ partition@e0000 { ++ label = "u-boot environment"; ++ reg = <0xe0000 0x100000>; + }; + + partition@100000 { +- label = "uImage"; +- reg = <0x0100000 0x400000>; ++ label = "second stage u-boot"; ++ reg = <0x100000 0x200000>; + }; + +- partition@500000 { +- label = "data"; +- reg = <0x0500000 0xfb00000>; ++ partition@200000 { ++ label = "ubi"; ++ reg = <0x200000 0xfe00000>; + }; + }; + diff --git a/target/linux/kirkwood/patches-4.19/103-iomega-ix2-200.patch b/target/linux/kirkwood/patches-4.19/103-iomega-ix2-200.patch new file mode 100644 index 000000000..9036ead95 --- /dev/null +++ b/target/linux/kirkwood/patches-4.19/103-iomega-ix2-200.patch @@ -0,0 +1,33 @@ +--- a/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts ++++ b/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts +@@ -186,18 +186,18 @@ + }; + + partition@a0000 { +- label = "env"; ++ label = "u-boot environment"; + reg = <0xa0000 0x20000>; + read-only; + }; + + partition@100000 { +- label = "uImage"; ++ label = "kernel"; + reg = <0x100000 0x300000>; + }; + + partition@400000 { +- label = "rootfs"; ++ label = "ubi"; + reg = <0x400000 0x1C00000>; + }; + }; +@@ -211,7 +211,7 @@ + }; + + ð0 { +- status = "okay"; ++ status = "disabled"; + ethernet0-port@0 { + speed = <1000>; + duplex = <1>; diff --git a/target/linux/kirkwood/patches-4.19/104-ea3500.patch b/target/linux/kirkwood/patches-4.19/104-ea3500.patch new file mode 100644 index 000000000..45dc670eb --- /dev/null +++ b/target/linux/kirkwood/patches-4.19/104-ea3500.patch @@ -0,0 +1,259 @@ +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -269,6 +269,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \ + kirkwood-linkstation-lswsxl.dtb \ + kirkwood-linkstation-lswvl.dtb \ + kirkwood-linkstation-lswxl.dtb \ ++ kirkwood-linksys-audi.dtb \ + kirkwood-linksys-viper.dtb \ + kirkwood-lschlv2.dtb \ + kirkwood-lsxhl.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/kirkwood-linksys-audi.dts +@@ -0,0 +1,246 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * kirkwood-linksys-audi.dts - Device Tree file for Linksys EA3500 ++ * ++ * (c) 2013 Jonas Gorski ++ * (c) 2013 Deutsche Telekom Innovation Laboratories ++ * (c) 2014 Luka Perkov ++ * (c) 2014 Dan Walters ++ * ++ */ ++ ++/dts-v1/; ++ ++#include "kirkwood.dtsi" ++#include "kirkwood-6282.dtsi" ++ ++/ { ++ model = "Linksys Audi (EA3500)"; ++ compatible = "linksys,audi", "marvell,kirkwood-88f6282", "marvell,kirkwood"; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x00000000 0x4000000>; ++ }; ++ ++ aliases { ++ serial0 = &uart0; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ gpio_keys { ++ compatible = "gpio-keys"; ++ pinctrl-0 = < &pmx_btn_wps &pmx_btn_reset >; ++ pinctrl-names = "default"; ++ ++ wps { ++ label = "WPS Button"; ++ linux,code = ; ++ gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; ++ }; ++ ++ reset { ++ label = "Reset Button"; ++ linux,code = ; ++ gpios = <&gpio1 16 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ gpio-leds { ++ compatible = "gpio-leds"; ++ pinctrl-0 = < &pmx_led_green_power >; ++ pinctrl-names = "default"; ++ ++ green-power { ++ label = "audi:green:power"; ++ gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++ ++ switches { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ mvsw61xx@10 { ++ compatible = "marvell,88e6171"; ++ status = "okay"; ++ reg = <0x10>; ++ ++ mii-bus = <&mdio>; ++ cpu-port-0 = <5>; ++ cpu-port-1 = <6>; ++ is-indirect; ++ }; ++ }; ++ ++ dsa { ++ compatible = "marvell,dsa"; ++ #address-cells = <2>; ++ #size-cells = <0>; ++ ++ dsa,ethernet = <ð0port>; ++ dsa,mii-bus = <&mdio>; ++ ++ switch@16,0 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <16 0>; /* MDIO address 16, switch 0 in tree */ ++ ++ port@0 { ++ reg = <0>; ++ label = "ethernet1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "ethernet2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "ethernet3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "ethernet4"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "internet"; ++ }; ++ ++ port@5 { ++ reg = <5>; ++ label = "cpu"; ++ }; ++ }; ++ }; ++}; ++ ++&pinctrl { ++ pmx_led_green_power: pmx-led-green-power { ++ marvell,pins = "mpp7"; ++ marvell,function = "gpo"; ++ }; ++ pmx_btn_wps: pmx-btn-wps { ++ marvell,pins = "mpp47"; ++ marvell,function = "gpio"; ++ }; ++ pmx_btn_reset: pmx-btn-reset { ++ marvell,pins = "mpp48"; ++ marvell,function = "gpio"; ++ }; ++}; ++ ++&nand { ++ status = "okay"; ++ pinctrl-0 = <&pmx_nand>; ++ pinctrl-names = "default"; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "u-boot"; ++ reg = <0x0 0x80000>; ++ read-only; ++ }; ++ ++ partition@80000 { ++ label = "u_env"; ++ reg = <0x80000 0x4000>; ++ }; ++ ++ partition@84000 { ++ label = "s_env"; ++ reg = <0x84000 0x4000>; ++ }; ++ ++ partition@200000 { ++ label = "kernel1"; ++ reg = <0x200000 0x290000>; ++ }; ++ ++ partition@490000 { ++ label = "rootfs1"; ++ reg = <0x490000 0x1170000>; ++ }; ++ ++ partition@1600000 { ++ label = "kernel2"; ++ reg = <0x1600000 0x290000>; ++ }; ++ ++ partition@1890000 { ++ label = "rootfs2"; ++ reg = <0x1890000 0x1170000>; ++ }; ++ ++ partition@2a00000 { ++ label = "syscfg"; ++ reg = <0x2a00000 0x1600000>; ++ }; ++ ++ partition@88000 { ++ label = "unused"; ++ reg = <0x88000 0x178000>; ++ }; ++ ++ }; ++}; ++ ++&pciec { ++ status = "okay"; ++}; ++ ++&pcie0 { ++ status = "okay"; ++}; ++ ++&pcie1 { ++ status = "okay"; ++}; ++ ++&mdio { ++ status = "okay"; ++}; ++ ++&uart0 { ++ status = "okay"; ++}; ++ ++/* eth0 is connected to a Marvell 88E6171 switch, without a PHY. So set ++ * fixed speed and duplex. ++ */ ++ð0 { ++ status = "okay"; ++ ethernet0-port@0 { ++ speed = <1000>; ++ duplex = <1>; ++ }; ++}; ++ ++/* eth1 is connected to the switch at port 6. However DSA only supports a ++ * single CPU port. Upstream uses DSA so they disable this port to avoid confusion. ++ */ ++ð1 { ++ status = "okay"; ++ ethernet1-port@0 { ++ speed = <1000>; ++ duplex = <1>; ++ }; ++}; ++ ++/* There is no battery on the board, so the RTC does not keep ++ * time when there is no power, making it useless. ++ */ ++&rtc { ++ status = "disabled"; ++}; diff --git a/target/linux/kirkwood/patches-4.19/105-ea4500.patch b/target/linux/kirkwood/patches-4.19/105-ea4500.patch new file mode 100644 index 000000000..c7c8b38f9 --- /dev/null +++ b/target/linux/kirkwood/patches-4.19/105-ea4500.patch @@ -0,0 +1,126 @@ +--- a/arch/arm/boot/dts/kirkwood-linksys-viper.dts ++++ b/arch/arm/boot/dts/kirkwood-linksys-viper.dts +@@ -67,9 +67,23 @@ + }; + }; + +- dsa { +- status = "disabled"; ++ switches { ++ #address-cells = <1>; ++ #size-cells = <0>; + ++ mvsw61xx@10 { ++ compatible = "marvell,88e6171"; ++ status = "okay"; ++ reg = <0x10>; ++ ++ mii-bus = <&mdio>; ++ cpu-port-0 = <5>; ++ cpu-port-1 = <6>; ++ is-indirect; ++ }; ++ }; ++ ++ dsa { + compatible = "marvell,dsa"; + #address-cells = <2>; + #size-cells = <0>; +@@ -161,22 +175,22 @@ + }; + + partition@200000 { +- label = "kernel"; ++ label = "kernel1"; + reg = <0x200000 0x2A0000>; + }; + + partition@4a0000 { +- label = "rootfs"; ++ label = "rootfs1"; + reg = <0x4A0000 0x1760000>; + }; + + partition@1c00000 { +- label = "alt_kernel"; ++ label = "kernel2"; + reg = <0x1C00000 0x2A0000>; + }; + + partition@1ea0000 { +- label = "alt_rootfs"; ++ label = "rootfs2"; + reg = <0x1EA0000 0x1760000>; + }; + +@@ -207,53 +221,6 @@ + + &mdio { + status = "okay"; +- +- switch@10 { +- compatible = "marvell,mv88e6085"; +- #address-cells = <1>; +- #size-cells = <0>; +- reg = <16>; +- +- ports { +- #address-cells = <1>; +- #size-cells = <0>; +- +- port@0 { +- reg = <0>; +- label = "ethernet1"; +- }; +- +- port@1 { +- reg = <1>; +- label = "ethernet2"; +- }; +- +- port@2 { +- reg = <2>; +- label = "ethernet3"; +- }; +- +- port@3 { +- reg = <3>; +- label = "ethernet4"; +- }; +- +- port@4 { +- reg = <4>; +- label = "internet"; +- }; +- +- port@5 { +- reg = <5>; +- label = "cpu"; +- ethernet = <ð0port>; +- fixed-link { +- speed = <1000>; +- full-duplex; +- }; +- }; +- }; +- }; + }; + + &uart0 { +@@ -272,10 +239,14 @@ + }; + + /* eth1 is connected to the switch at port 6. However DSA only supports a +- * single CPU port. So leave this port disabled to avoid confusion. ++ * single CPU port. Upstream uses DSA so they disable this port to avoid confusion. + */ + ð1 { +- status = "disabled"; ++ status = "okay"; ++ ethernet1-port@0 { ++ speed = <1000>; ++ duplex = <1>; ++ }; + }; + + /* There is no battery on the board, so the RTC does not keep diff --git a/target/linux/kirkwood/patches-4.19/105-goflexhome.patch b/target/linux/kirkwood/patches-4.19/105-goflexhome.patch new file mode 100644 index 000000000..9ac30b6d3 --- /dev/null +++ b/target/linux/kirkwood/patches-4.19/105-goflexhome.patch @@ -0,0 +1,130 @@ +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -256,6 +256,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \ + kirkwood-ds411.dtb \ + kirkwood-ds411j.dtb \ + kirkwood-ds411slim.dtb \ ++ kirkwood-goflexhome.dtb \ + kirkwood-goflexnet.dtb \ + kirkwood-guruplug-server-plus.dtb \ + kirkwood-ib62x0.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/kirkwood-goflexhome.dts +@@ -0,0 +1,117 @@ ++/dts-v1/; ++ ++#include "kirkwood.dtsi" ++#include "kirkwood-6281.dtsi" ++ ++/ { ++ model = "Seagate GoFlex Home"; ++ compatible = "seagate,goflexhome", "marvell,kirkwood-88f6281", "marvell,kirkwood"; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x00000000 0x8000000>; ++ }; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200n8 earlyprintk root=/dev/sda1 rootdelay=10"; ++ stdout-path = &uart0; ++ }; ++ ++ ocp@f1000000 { ++ pinctrl: pin-controller@10000 { ++ pmx_usb_power_enable: pmx-usb-power-enable { ++ marvell,pins = "mpp29"; ++ marvell,function = "gpio"; ++ }; ++ pmx_led_white: pmx-led-white { ++ marvell,pins = "mpp40"; ++ marvell,function = "gpio"; ++ }; ++ pmx_led_green: pmx-led_green { ++ marvell,pins = "mpp46"; ++ marvell,function = "gpio"; ++ }; ++ pmx_led_orange: pmx-led-orange { ++ marvell,pins = "mpp47"; ++ marvell,function = "gpio"; ++ }; ++ }; ++ serial@12000 { ++ status = "ok"; ++ }; ++ ++ sata@80000 { ++ status = "okay"; ++ nr-ports = <2>; ++ }; ++ ++ }; ++ gpio-leds { ++ compatible = "gpio-leds"; ++ ++ health { ++ label = "status:green:health"; ++ gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "default-on"; ++ }; ++ fault { ++ label = "status:orange:fault"; ++ gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; ++ }; ++ misc { ++ label = "status:white:misc"; ++ gpios = <&gpio1 8 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "disk-activity"; ++ }; ++ }; ++ regulators { ++ compatible = "simple-bus"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ pinctrl-0 = <&pmx_usb_power_enable>; ++ pinctrl-names = "default"; ++ ++ usb_power: regulator@1 { ++ compatible = "regulator-fixed"; ++ reg = <1>; ++ regulator-name = "USB Power"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ enable-active-high; ++ regulator-always-on; ++ regulator-boot-on; ++ gpio = <&gpio0 29 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++}; ++ ++&nand { ++ chip-delay = <40>; ++ status = "okay"; ++ ++ partition@0 { ++ label = "u-boot"; ++ reg = <0x0000000 0x100000>; ++ read-only; ++ }; ++ ++ partition@100000 { ++ label = "ubi"; ++ reg = <0x100000 0x0ff00000>; ++ }; ++}; ++ ++&mdio { ++ status = "okay"; ++ ++ ethphy0: ethernet-phy@0 { ++ reg = <0>; ++ }; ++}; ++ ++ð0 { ++ status = "okay"; ++ ethernet0-port@0 { ++ phy-handle = <ðphy0>; ++ }; ++}; diff --git a/target/linux/kirkwood/patches-4.19/106-goflexnet.patch b/target/linux/kirkwood/patches-4.19/106-goflexnet.patch new file mode 100644 index 000000000..b22176880 --- /dev/null +++ b/target/linux/kirkwood/patches-4.19/106-goflexnet.patch @@ -0,0 +1,23 @@ +--- a/arch/arm/boot/dts/kirkwood-goflexnet.dts ++++ b/arch/arm/boot/dts/kirkwood-goflexnet.dts +@@ -159,18 +159,8 @@ + }; + + partition@100000 { +- label = "uImage"; +- reg = <0x0100000 0x400000>; +- }; +- +- partition@500000 { +- label = "pogoplug"; +- reg = <0x0500000 0x2000000>; +- }; +- +- partition@2500000 { +- label = "root"; +- reg = <0x02500000 0xd800000>; ++ label = "ubi"; ++ reg = <0x0100000 0x0ff00000>; + }; + }; + diff --git a/target/linux/kirkwood/patches-4.19/107-01-zyxel-nsa3x0-common-nand-partitions.patch b/target/linux/kirkwood/patches-4.19/107-01-zyxel-nsa3x0-common-nand-partitions.patch new file mode 100644 index 000000000..df654033f --- /dev/null +++ b/target/linux/kirkwood/patches-4.19/107-01-zyxel-nsa3x0-common-nand-partitions.patch @@ -0,0 +1,48 @@ +--- a/arch/arm/boot/dts/kirkwood-nsa3x0-common.dtsi ++++ b/arch/arm/boot/dts/kirkwood-nsa3x0-common.dtsi +@@ -112,40 +112,16 @@ + + partition@0 { + label = "uboot"; +- reg = <0x0000000 0x0100000>; ++ reg = <0x0000000 0x00c0000>; + read-only; + }; + partition@100000 { + label = "uboot_env"; +- reg = <0x0100000 0x0080000>; ++ reg = <0x00c0000 0x0080000>; + }; +- partition@180000 { +- label = "key_store"; +- reg = <0x0180000 0x0080000>; +- }; +- partition@200000 { +- label = "info"; +- reg = <0x0200000 0x0080000>; +- }; +- partition@280000 { +- label = "etc"; +- reg = <0x0280000 0x0a00000>; +- }; +- partition@c80000 { +- label = "kernel_1"; +- reg = <0x0c80000 0x0a00000>; +- }; +- partition@1680000 { +- label = "rootfs1"; +- reg = <0x1680000 0x2fc0000>; +- }; +- partition@4640000 { +- label = "kernel_2"; +- reg = <0x4640000 0x0a00000>; +- }; +- partition@5040000 { +- label = "rootfs2"; +- reg = <0x5040000 0x2fc0000>; ++ partition@140000 { ++ label = "ubi"; ++ reg = <0x0140000 0x7ec0000>; + }; + }; + diff --git a/target/linux/kirkwood/patches-4.19/107-02-nsa310b.patch b/target/linux/kirkwood/patches-4.19/107-02-nsa310b.patch new file mode 100644 index 000000000..f8b963e03 --- /dev/null +++ b/target/linux/kirkwood/patches-4.19/107-02-nsa310b.patch @@ -0,0 +1,147 @@ +kirkwood: add nsa310b dtb, a zyxel nsa310 variant + +add support to a nsa310 variant with red/green usb led +and lm85 temp/fan controller + +Signed-off-by: Alberto Bursi + +NOTE: this patch can be upstreamed as-is, LEDE-specific + nand partitions are set in another patch + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -287,6 +287,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \ + kirkwood-ns2mini.dtb \ + kirkwood-nsa310.dtb \ + kirkwood-nsa310a.dtb \ ++ kirkwood-nsa310b.dtb \ + kirkwood-nsa320.dtb \ + kirkwood-nsa325.dtb \ + kirkwood-openblocks_a6.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/kirkwood-nsa310b.dts +@@ -0,0 +1,124 @@ ++/dts-v1/; ++ ++#include "kirkwood-nsa3x0-common.dtsi" ++ ++/* ++ * There are at least two different NSA310 designs. This variant has ++ * a red/green USB Led (same as nsa310) and a lm85 temp/fan controller. ++ */ ++ ++/ { ++ model = "ZyXEL NSA310b"; ++ compatible = "zyxel,nsa310b", "zyxel,nsa310", "marvell,kirkwood-88f6281", "marvell,kirkwood"; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x00000000 0x10000000>; ++ }; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200"; ++ stdout-path = &uart0; ++ }; ++ ++ ocp@f1000000 { ++ pinctrl: pin-controller@10000 { ++ pinctrl-names = "default"; ++ ++ pmx_led_esata_green: pmx-led-esata-green { ++ marvell,pins = "mpp12"; ++ marvell,function = "gpio"; ++ }; ++ ++ pmx_led_esata_red: pmx-led-esata-red { ++ marvell,pins = "mpp13"; ++ marvell,function = "gpio"; ++ }; ++ ++ pmx_led_usb_green: pmx-led-usb-green { ++ marvell,pins = "mpp15"; ++ marvell,function = "gpio"; ++ }; ++ ++ pmx_led_usb_red: pmx-led-usb-red { ++ marvell,pins = "mpp16"; ++ marvell,function = "gpio"; ++ }; ++ ++ pmx_led_sys_green: pmx-led-sys-green { ++ marvell,pins = "mpp28"; ++ marvell,function = "gpio"; ++ }; ++ ++ pmx_led_sys_red: pmx-led-sys-red { ++ marvell,pins = "mpp29"; ++ marvell,function = "gpio"; ++ }; ++ ++ pmx_led_hdd_green: pmx-led-hdd-green { ++ marvell,pins = "mpp41"; ++ marvell,function = "gpio"; ++ }; ++ ++ pmx_led_hdd_red: pmx-led-hdd-red { ++ marvell,pins = "mpp42"; ++ marvell,function = "gpio"; ++ }; ++ ++ }; ++ ++ i2c@11000 { ++ status = "okay"; ++ ++ lm85: lm85@2e { ++ compatible = "national,lm85"; ++ reg = <0x2e>; ++ }; ++ }; ++ }; ++ ++ gpio-leds { ++ compatible = "gpio-leds"; ++ ++ green-sys { ++ label = "nsa310:green:sys"; ++ gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>; ++ }; ++ red-sys { ++ label = "nsa310:red:sys"; ++ gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; ++ }; ++ green-hdd { ++ label = "nsa310:green:hdd"; ++ gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; ++ }; ++ red-hdd { ++ label = "nsa310:red:hdd"; ++ gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; ++ }; ++ green-esata { ++ label = "nsa310:green:esata"; ++ gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; ++ }; ++ red-esata { ++ label = "nsa310:red:esata"; ++ gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; ++ }; ++ green-usb { ++ label = "nsa310:green:usb"; ++ gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; ++ }; ++ red-usb { ++ label = "nsa310:red:usb"; ++ gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>; ++ }; ++ green-copy { ++ label = "nsa310:green:copy"; ++ gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>; ++ }; ++ red-copy { ++ label = "nsa310:red:copy"; ++ gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++}; diff --git a/target/linux/kirkwood/patches-4.19/108-on100.patch b/target/linux/kirkwood/patches-4.19/108-on100.patch new file mode 100644 index 000000000..2f535955d --- /dev/null +++ b/target/linux/kirkwood/patches-4.19/108-on100.patch @@ -0,0 +1,171 @@ +--- /dev/null ++++ b/arch/arm/boot/dts/kirkwood-on100.dts +@@ -0,0 +1,158 @@ ++/dts-v1/; ++ ++#include "kirkwood.dtsi" ++#include "kirkwood-6282.dtsi" ++ ++/ { ++ model = "Cisco Systems ON100"; ++ compatible = "cisco,on100", "marvell,kirkwood-88f6282", "marvell,kirkwood"; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x00000000 0x20000000>; ++ }; ++ ++ aliases { ++ serial0 = &uart0; ++ }; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200n8 earlyprintk"; ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ gpio_keys { ++ compatible = "gpio-keys"; ++ pinctrl-0 = <&pmx_btn_reset>; ++ pinctrl-names = "default"; ++ ++ reset { ++ label = "Reset Button"; ++ linux,code = ; ++ gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ gpio-leds { ++ compatible = "gpio-leds"; ++ pinctrl-0 = < &pmx_led_health_r &pmx_led_health_g >; ++ pinctrl-names = "default"; ++ ++ health-g { ++ label = "on100:green:health"; ++ gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; ++ }; ++ ++ health-r { ++ label = "on100:red:health"; ++ gpios = <&gpio1 13 GPIO_ACTIVE_LOW>; ++ }; ++ ++ health2-g { ++ label = "on100:green:health2"; ++ gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; ++ }; ++ ++ health2-r { ++ label = "on100:red:health2"; ++ gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++}; ++ ++ð0 { ++ status = "okay"; ++ ++ ethernet0-port@0 { ++ phy-handle = <ðphy0>; ++ phy-connection-type = "rgmii-id"; ++ }; ++}; ++ ++ð1 { ++ status = "okay"; ++ ++ ethernet1-port@0 { ++ phy-handle = <ðphy1>; ++ phy-connection-type = "rgmii-id"; ++ }; ++}; ++ ++&mdio { ++ status = "okay"; ++ ++ ethphy0: ethernet-phy@0 { ++ /* Marvell 88E1121R */ ++ compatible = "ethernet-phy-id0141.0cb0", ++ "ethernet-phy-ieee802.3-c22"; ++ reg = <0>; ++ }; ++ ++ ethphy1: ethernet-phy@1 { ++ /* Marvell 88E1121R */ ++ compatible = "ethernet-phy-id0141.0cb0", ++ "ethernet-phy-ieee802.3-c22"; ++ reg = <1>; ++ }; ++}; ++ ++&nand { ++ status = "okay"; ++ ++ partition@0 { ++ label = "u-boot"; ++ reg = <0x00000000 0x000a0000>; ++ read-only; ++ }; ++ ++ partition@a0000 { ++ label = "u-boot environment"; ++ reg = <0x000a0000 0x00020000>; ++ read-only; ++ }; ++ ++ partition@c0000 { ++ label = "kernel"; ++ reg = <0x000c0000 0x00540000>; ++ }; ++ ++ partition@600000 { ++ label = "ubi"; ++ reg = <0x00600000 0x1fa00000>; ++ }; ++}; ++ ++&pinctrl { ++ pmx_led_health_r: pmx-led-health-r { ++ marvell,pins = "mpp45"; ++ marvell,function = "gpio"; ++ }; ++ ++ pmx_led_health_g: pmx-led-health-g { ++ marvell,pins = "mpp44"; ++ marvell,function = "gpio"; ++ }; ++ ++ pmx_led_health2_r: pmx-led-health2-r { ++ marvell,pins = "mpp47"; ++ marvell,function = "gpio"; ++ }; ++ ++ pmx_led_health2_g: pmx-led-health2-g { ++ marvell,pins = "mpp46"; ++ marvell,function = "gpio"; ++ }; ++ ++ pmx_btn_reset: pmx-led-reset { ++ marvell,pins = "mpp31"; ++ marvell,function = "gpio"; ++ }; ++}; ++ ++&sdio { ++ status = "okay"; ++}; ++ ++&uart0 { ++ status = "okay"; ++}; +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -290,6 +290,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \ + kirkwood-nsa310b.dtb \ + kirkwood-nsa320.dtb \ + kirkwood-nsa325.dtb \ ++ kirkwood-on100.dtb \ + kirkwood-openblocks_a6.dtb \ + kirkwood-openblocks_a7.dtb \ + kirkwood-openrd-base.dtb \ diff --git a/target/linux/kirkwood/patches-4.19/109-pogoplug_v4.patch b/target/linux/kirkwood/patches-4.19/109-pogoplug_v4.patch new file mode 100644 index 000000000..b54768290 --- /dev/null +++ b/target/linux/kirkwood/patches-4.19/109-pogoplug_v4.patch @@ -0,0 +1,59 @@ +--- a/arch/arm/boot/dts/kirkwood-pogoplug-series-4.dts ++++ b/arch/arm/boot/dts/kirkwood-pogoplug-series-4.dts +@@ -24,6 +24,7 @@ + }; + + chosen { ++ bootargs = "console=ttyS0,115200"; + stdout-path = "uart0:115200n8"; + }; + +@@ -37,8 +38,8 @@ + eject { + debounce-interval = <50>; + wakeup-source; +- linux,code = ; +- label = "Eject Button"; ++ linux,code = ; ++ label = "Reset"; + gpios = <&gpio0 29 GPIO_ACTIVE_LOW>; + }; + }; +@@ -137,29 +138,19 @@ + #size-cells = <1>; + + partition@0 { +- label = "u-boot"; +- reg = <0x00000000 0x200000>; ++ label = "uboot"; ++ reg = <0x00000000 0x1c0000>; + read-only; + }; + +- partition@200000 { +- label = "uImage"; +- reg = <0x00200000 0x300000>; +- }; +- +- partition@500000 { +- label = "uImage2"; +- reg = <0x00500000 0x300000>; ++ partition@1c0000 { ++ label = "uboot_env"; ++ reg = <0x001c0000 0x40000>; + }; + +- partition@800000 { +- label = "failsafe"; +- reg = <0x00800000 0x800000>; +- }; +- +- partition@1000000 { +- label = "root"; +- reg = <0x01000000 0x7000000>; ++ partition@200000 { ++ label = "ubi"; ++ reg = <0x00200000 0x7e00000>; + }; + }; + }; diff --git a/target/linux/kirkwood/patches-4.19/201-enable-sata-port-specific-led-triggers.patch b/target/linux/kirkwood/patches-4.19/201-enable-sata-port-specific-led-triggers.patch new file mode 100644 index 000000000..71d9bba3f --- /dev/null +++ b/target/linux/kirkwood/patches-4.19/201-enable-sata-port-specific-led-triggers.patch @@ -0,0 +1,10 @@ +--- a/arch/arm/mach-mvebu/Kconfig ++++ b/arch/arm/mach-mvebu/Kconfig +@@ -118,6 +118,7 @@ config MACH_DOVE + config MACH_KIRKWOOD + bool "Marvell Kirkwood boards" + depends on ARCH_MULTI_V5 ++ select ARCH_WANT_LIBATA_LEDS + select CPU_FEROCEON + select GPIOLIB + select KIRKWOOD_CLK diff --git a/target/linux/kirkwood/patches-4.19/202-linksys-find-active-root.patch b/target/linux/kirkwood/patches-4.19/202-linksys-find-active-root.patch new file mode 100644 index 000000000..860d7b072 --- /dev/null +++ b/target/linux/kirkwood/patches-4.19/202-linksys-find-active-root.patch @@ -0,0 +1,62 @@ +The WRT1900AC among other Linksys routers uses a dual-firmware layout. +Dynamically rename the active partition to "ubi". + +Signed-off-by: Imre Kaloz +--- +--- a/drivers/mtd/ofpart.c ++++ b/drivers/mtd/ofpart.c +@@ -25,6 +25,8 @@ static bool node_has_compatible(struct d + return of_get_property(pp, "compatible", NULL); + } + ++static int mangled_rootblock; ++ + static int parse_fixed_partitions(struct mtd_info *master, + const struct mtd_partition **pparts, + struct mtd_part_parser_data *data) +@@ -32,6 +34,7 @@ static int parse_fixed_partitions(struct + struct mtd_partition *parts; + struct device_node *mtd_node; + struct device_node *ofpart_node; ++ const char *owrtpart = "ubi"; + const char *partname; + struct device_node *pp; + int nr_parts, i, ret = 0; +@@ -110,9 +113,15 @@ static int parse_fixed_partitions(struct + parts[i].size = of_read_number(reg + a_cells, s_cells); + parts[i].of_node = pp; + +- partname = of_get_property(pp, "label", &len); +- if (!partname) +- partname = of_get_property(pp, "name", &len); ++ if (mangled_rootblock && (i == mangled_rootblock)) { ++ partname = owrtpart; ++ } else { ++ partname = of_get_property(pp, "label", &len); ++ ++ if (!partname) ++ partname = of_get_property(pp, "name", &len); ++ } ++ + parts[i].name = partname; + + if (of_get_property(pp, "read-only", &len)) +@@ -219,6 +228,18 @@ static int __init ofpart_parser_init(voi + return 0; + } + ++static int __init active_root(char *str) ++{ ++ get_option(&str, &mangled_rootblock); ++ ++ if (!mangled_rootblock) ++ return 1; ++ ++ return 1; ++} ++ ++__setup("mangled_rootblock=", active_root); ++ + static void __exit ofpart_parser_exit(void) + { + deregister_mtd_parser(&ofpart_parser); diff --git a/target/linux/layerscape/patches-4.14/202-core-linux-support-layerscape.patch b/target/linux/layerscape/patches-4.14/202-core-linux-support-layerscape.patch index 90bb6426e..c3e63003d 100644 --- a/target/linux/layerscape/patches-4.14/202-core-linux-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.14/202-core-linux-support-layerscape.patch @@ -263,7 +263,7 @@ Signed-off-by: Biwen Li int bond_set_carrier(struct bonding *bond); --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c -@@ -872,7 +872,8 @@ free_bat_counters: +@@ -874,7 +874,8 @@ free_bat_counters: * Return: 0 if successful or error otherwise. */ static int batadv_softif_slave_add(struct net_device *dev, @@ -522,7 +522,7 @@ Signed-off-by: Biwen Li } --- a/net/core/skbuff.c +++ b/net/core/skbuff.c -@@ -799,6 +799,32 @@ void napi_consume_skb(struct sk_buff *sk +@@ -803,6 +803,32 @@ void napi_consume_skb(struct sk_buff *sk } EXPORT_SYMBOL(napi_consume_skb); @@ -555,7 +555,7 @@ Signed-off-by: Biwen Li /* Make sure a field is enclosed inside headers_start/headers_end section */ #define CHECK_SKB_FIELD(field) \ BUILD_BUG_ON(offsetof(struct sk_buff, field) < \ -@@ -1318,7 +1344,7 @@ static void skb_headers_offset_update(st +@@ -1322,7 +1348,7 @@ static void skb_headers_offset_update(st skb->inner_mac_header += off; } @@ -564,7 +564,7 @@ Signed-off-by: Biwen Li { __copy_skb_header(new, old); -@@ -1326,6 +1352,7 @@ static void copy_skb_header(struct sk_bu +@@ -1330,6 +1356,7 @@ static void copy_skb_header(struct sk_bu skb_shinfo(new)->gso_segs = skb_shinfo(old)->gso_segs; skb_shinfo(new)->gso_type = skb_shinfo(old)->gso_type; } diff --git a/target/linux/layerscape/patches-4.14/301-arch-support-layerscape.patch b/target/linux/layerscape/patches-4.14/301-arch-support-layerscape.patch index faa02bffa..970e95cf3 100644 --- a/target/linux/layerscape/patches-4.14/301-arch-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.14/301-arch-support-layerscape.patch @@ -247,7 +247,7 @@ Signed-off-by: Biwen Li /* --- a/arch/arm64/include/asm/io.h +++ b/arch/arm64/include/asm/io.h -@@ -170,6 +170,7 @@ extern void __iomem *ioremap_cache(phys_ +@@ -186,6 +186,7 @@ extern void __iomem *ioremap_cache(phys_ #define ioremap_nocache(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE)) #define ioremap_wc(addr, size) __ioremap((addr), (size), __pgprot(PROT_NORMAL_NC)) #define ioremap_wt(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE)) diff --git a/target/linux/layerscape/patches-4.14/707-dpaa-ethernet-support-layerscape.patch b/target/linux/layerscape/patches-4.14/707-dpaa-ethernet-support-layerscape.patch index df96aa5c6..bd62bceca 100644 --- a/target/linux/layerscape/patches-4.14/707-dpaa-ethernet-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.14/707-dpaa-ethernet-support-layerscape.patch @@ -150624,7 +150624,7 @@ Signed-off-by: Biwen Li +#endif /* FSL_USDPAA_H */ --- a/include/linux/netdev_features.h +++ b/include/linux/netdev_features.h -@@ -77,6 +77,7 @@ enum { +@@ -79,6 +79,7 @@ enum { NETIF_F_HW_ESP_BIT, /* Hardware ESP transformation offload */ NETIF_F_HW_ESP_TX_CSUM_BIT, /* ESP with TX checksum offload */ NETIF_F_RX_UDP_TUNNEL_PORT_BIT, /* Offload of RX port for UDP tunnels */ @@ -150632,14 +150632,14 @@ Signed-off-by: Biwen Li /* * Add your fresh new feature above and remember to update -@@ -142,6 +143,7 @@ enum { +@@ -144,6 +145,7 @@ enum { #define NETIF_F_HW_ESP __NETIF_F(HW_ESP) #define NETIF_F_HW_ESP_TX_CSUM __NETIF_F(HW_ESP_TX_CSUM) #define NETIF_F_RX_UDP_TUNNEL_PORT __NETIF_F(RX_UDP_TUNNEL_PORT) +#define NETIF_F_HW_ACCEL_MQ __NETIF_F(HW_ACCEL_MQ) - #define for_each_netdev_feature(mask_addr, bit) \ - for_each_set_bit(bit, (unsigned long *)mask_addr, NETDEV_FEATURE_COUNT) + /* Finds the next feature with the highest number of the range of start till 0. + */ --- /dev/null +++ b/include/uapi/linux/fmd/Kbuild @@ -0,0 +1,5 @@ diff --git a/target/linux/layerscape/patches-4.14/807-usb-support-layerscape.patch b/target/linux/layerscape/patches-4.14/807-usb-support-layerscape.patch index 45ed8efa9..57df1c8b1 100644 --- a/target/linux/layerscape/patches-4.14/807-usb-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.14/807-usb-support-layerscape.patch @@ -62,7 +62,7 @@ Signed-off-by: Yangbo Lu - snps,hird-threshold: HIRD threshold --- a/arch/arm64/include/asm/io.h +++ b/arch/arm64/include/asm/io.h -@@ -194,6 +194,34 @@ extern void __iomem *ioremap_cache(phys_ +@@ -210,6 +210,34 @@ extern void __iomem *ioremap_cache(phys_ #define iowrite32be(v,p) ({ __iowmb(); __raw_writel((__force __u32)cpu_to_be32(v), p); }) #define iowrite64be(v,p) ({ __iowmb(); __raw_writeq((__force __u64)cpu_to_be64(v), p); }) @@ -432,7 +432,7 @@ Signed-off-by: Yangbo Lu reg &= ~DWC3_DCTL_INITU2ENA; --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c -@@ -3205,6 +3205,7 @@ int dwc3_gadget_init(struct dwc3 *dwc) +@@ -3209,6 +3209,7 @@ int dwc3_gadget_init(struct dwc3 *dwc) { int ret; int irq; @@ -440,7 +440,7 @@ Signed-off-by: Yangbo Lu irq = dwc3_gadget_get_irq(dwc); if (irq < 0) { -@@ -3281,6 +3282,12 @@ int dwc3_gadget_init(struct dwc3 *dwc) +@@ -3285,6 +3286,12 @@ int dwc3_gadget_init(struct dwc3 *dwc) goto err4; } diff --git a/target/linux/layerscape/patches-4.14/812-flexspi-support-layerscape.patch b/target/linux/layerscape/patches-4.14/812-flexspi-support-layerscape.patch index 1c8ae2578..0738fc7ad 100644 --- a/target/linux/layerscape/patches-4.14/812-flexspi-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.14/812-flexspi-support-layerscape.patch @@ -40,7 +40,7 @@ Signed-off-by: Biwen Li --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c -@@ -3645,6 +3645,19 @@ static int process_create_thin_mesg(unsi +@@ -3690,6 +3690,19 @@ static int process_create_thin_mesg(unsi return r; } @@ -78,7 +78,7 @@ Signed-off-by: Biwen Li DP_ERR(p_hwfn, --- a/drivers/net/phy/xilinx_gmii2rgmii.c +++ b/drivers/net/phy/xilinx_gmii2rgmii.c -@@ -89,6 +89,11 @@ static int xgmiitorgmii_probe(struct mdi +@@ -92,6 +92,11 @@ static int xgmiitorgmii_probe(struct mdi return -EPROBE_DEFER; } diff --git a/target/linux/layerscape/patches-4.14/819-sdhc-support-layerscape.patch b/target/linux/layerscape/patches-4.14/819-sdhc-support-layerscape.patch index 986db4c22..ed72f31e4 100644 --- a/target/linux/layerscape/patches-4.14/819-sdhc-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.14/819-sdhc-support-layerscape.patch @@ -69,7 +69,7 @@ Signed-off-by: Biwen Li }; /** -@@ -498,6 +543,7 @@ static void esdhc_of_set_clock(struct sd +@@ -502,6 +547,7 @@ static void esdhc_of_set_clock(struct sd int pre_div = 1; int div = 1; ktime_t timeout; @@ -77,7 +77,7 @@ Signed-off-by: Biwen Li u32 temp; host->mmc->actual_clock = 0; -@@ -511,27 +557,14 @@ static void esdhc_of_set_clock(struct sd +@@ -515,27 +561,14 @@ static void esdhc_of_set_clock(struct sd if (esdhc->vendor_ver < VENDOR_V_23) pre_div = 2; @@ -112,7 +112,7 @@ Signed-off-by: Biwen Li temp = sdhci_readl(host, ESDHC_SYSTEM_CONTROL); temp &= ~(ESDHC_CLOCK_SDCLKEN | ESDHC_CLOCK_IPGEN | ESDHC_CLOCK_HCKEN | -@@ -789,6 +822,7 @@ static struct soc_device_attribute soc_i +@@ -797,6 +830,7 @@ static struct soc_device_attribute soc_i static void esdhc_init(struct platform_device *pdev, struct sdhci_host *host) { @@ -120,7 +120,7 @@ Signed-off-by: Biwen Li struct sdhci_pltfm_host *pltfm_host; struct sdhci_esdhc *esdhc; struct device_node *np; -@@ -808,6 +842,9 @@ static void esdhc_init(struct platform_d +@@ -816,6 +850,9 @@ static void esdhc_init(struct platform_d else esdhc->quirk_incorrect_hostver = false; @@ -130,7 +130,7 @@ Signed-off-by: Biwen Li np = pdev->dev.of_node; clk = of_clk_get(np, 0); if (!IS_ERR(clk)) { -@@ -907,14 +944,6 @@ static int sdhci_esdhc_probe(struct plat +@@ -915,14 +952,6 @@ static int sdhci_esdhc_probe(struct plat return ret; } diff --git a/target/linux/layerscape/patches-4.14/821-smmu-support-layerscape.patch b/target/linux/layerscape/patches-4.14/821-smmu-support-layerscape.patch index e0daa4334..7c11e2c84 100644 --- a/target/linux/layerscape/patches-4.14/821-smmu-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.14/821-smmu-support-layerscape.patch @@ -93,7 +93,7 @@ Signed-off-by: Biwen Li #include "io-pgtable.h" #include "arm-smmu-regs.h" -@@ -1464,6 +1465,8 @@ static struct iommu_group *arm_smmu_devi +@@ -1465,6 +1466,8 @@ static struct iommu_group *arm_smmu_devi if (dev_is_pci(dev)) group = pci_device_group(dev); @@ -102,7 +102,7 @@ Signed-off-by: Biwen Li else group = generic_device_group(dev); -@@ -2040,6 +2043,10 @@ static void arm_smmu_bus_init(void) +@@ -2043,6 +2046,10 @@ static void arm_smmu_bus_init(void) bus_set_iommu(&pci_bus_type, &arm_smmu_ops); } #endif diff --git a/target/linux/layerscape/patches-4.14/822-uart-support-layerscape.patch b/target/linux/layerscape/patches-4.14/822-uart-support-layerscape.patch index fa6779caa..f8d893cee 100644 --- a/target/linux/layerscape/patches-4.14/822-uart-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.14/822-uart-support-layerscape.patch @@ -22,7 +22,7 @@ Signed-off-by: Biwen Li struct lpuart_port { struct uart_port port; struct clk *clk; -@@ -2149,13 +2151,13 @@ static int lpuart_probe(struct platform_ +@@ -2153,13 +2155,13 @@ static int lpuart_probe(struct platform_ ret = of_alias_get_id(np, "serial"); if (ret < 0) { @@ -42,7 +42,7 @@ Signed-off-by: Biwen Li sport->port.line = ret; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); sport->port.membase = devm_ioremap_resource(&pdev->dev, res); -@@ -2246,6 +2248,7 @@ static int lpuart_remove(struct platform +@@ -2250,6 +2252,7 @@ static int lpuart_remove(struct platform struct lpuart_port *sport = platform_get_drvdata(pdev); uart_remove_one_port(&lpuart_reg, &sport->port); diff --git a/target/linux/layerscape/patches-4.14/824-mmc-sdhci-of-esdhc-add-voltage-switch-support-for-ls.patch b/target/linux/layerscape/patches-4.14/824-mmc-sdhci-of-esdhc-add-voltage-switch-support-for-ls.patch index 944488221..7a276d8ab 100644 --- a/target/linux/layerscape/patches-4.14/824-mmc-sdhci-of-esdhc-add-voltage-switch-support-for-ls.patch +++ b/target/linux/layerscape/patches-4.14/824-mmc-sdhci-of-esdhc-add-voltage-switch-support-for-ls.patch @@ -13,7 +13,7 @@ Signed-off-by: Yangbo Lu --- a/drivers/mmc/host/sdhci-of-esdhc.c +++ b/drivers/mmc/host/sdhci-of-esdhc.c -@@ -650,6 +650,7 @@ static void esdhc_reset(struct sdhci_hos +@@ -658,6 +658,7 @@ static void esdhc_reset(struct sdhci_hos static const struct of_device_id scfg_device_ids[] = { { .compatible = "fsl,t1040-scfg", }, { .compatible = "fsl,ls1012a-scfg", }, diff --git a/target/linux/mediatek/patches-4.14/0033-dsa-multi-cpu.patch b/target/linux/mediatek/patches-4.14/0033-dsa-multi-cpu.patch index 926e0d842..044250697 100644 --- a/target/linux/mediatek/patches-4.14/0033-dsa-multi-cpu.patch +++ b/target/linux/mediatek/patches-4.14/0033-dsa-multi-cpu.patch @@ -249,7 +249,7 @@ --- a/net/dsa/slave.c +++ b/net/dsa/slave.c -@@ -1263,7 +1263,7 @@ int dsa_slave_create(struct dsa_port *po +@@ -1267,7 +1267,7 @@ int dsa_slave_create(struct dsa_port *po int ret; cpu_dp = ds->dst->cpu_dp; @@ -258,7 +258,7 @@ if (!ds->num_tx_queues) ds->num_tx_queues = 1; -@@ -1301,6 +1301,7 @@ int dsa_slave_create(struct dsa_port *po +@@ -1305,6 +1305,7 @@ int dsa_slave_create(struct dsa_port *po p->dp = port; INIT_LIST_HEAD(&p->mall_tc_list); p->xmit = dst->tag_ops->xmit; diff --git a/target/linux/mediatek/patches-4.14/0107-usb-mtu3-support-36-bit-DMA-address.patch b/target/linux/mediatek/patches-4.14/0107-usb-mtu3-support-36-bit-DMA-address.patch index d2633c1ca..88f52e6f2 100644 --- a/target/linux/mediatek/patches-4.14/0107-usb-mtu3-support-36-bit-DMA-address.patch +++ b/target/linux/mediatek/patches-4.14/0107-usb-mtu3-support-36-bit-DMA-address.patch @@ -74,7 +74,7 @@ Signed-off-by: Felipe Balbi #include #include #include -@@ -759,7 +760,31 @@ static void mtu3_hw_exit(struct mtu3 *mt +@@ -761,7 +762,31 @@ static void mtu3_hw_exit(struct mtu3 *mt mtu3_mem_free(mtu); } @@ -107,7 +107,7 @@ Signed-off-by: Felipe Balbi int ssusb_gadget_init(struct ssusb_mtk *ssusb) { -@@ -820,6 +845,12 @@ int ssusb_gadget_init(struct ssusb_mtk * +@@ -822,6 +847,12 @@ int ssusb_gadget_init(struct ssusb_mtk * return ret; } @@ -120,7 +120,7 @@ Signed-off-by: Felipe Balbi ret = devm_request_irq(dev, mtu->irq, mtu3_irq, 0, dev_name(dev), mtu); if (ret) { dev_err(dev, "request irq %d failed!\n", mtu->irq); -@@ -845,6 +876,7 @@ int ssusb_gadget_init(struct ssusb_mtk * +@@ -847,6 +878,7 @@ int ssusb_gadget_init(struct ssusb_mtk * gadget_err: device_init_wakeup(dev, false); diff --git a/target/linux/mediatek/patches-4.14/0109-usb-mtu3-add-support-for-usb3.1-IP.patch b/target/linux/mediatek/patches-4.14/0109-usb-mtu3-add-support-for-usb3.1-IP.patch index c17a77be5..f44ce4e15 100644 --- a/target/linux/mediatek/patches-4.14/0109-usb-mtu3-add-support-for-usb3.1-IP.patch +++ b/target/linux/mediatek/patches-4.14/0109-usb-mtu3-add-support-for-usb3.1-IP.patch @@ -46,7 +46,7 @@ Signed-off-by: Felipe Balbi } dev_info(mtu->dev, "max_speed: %s\n", -@@ -624,6 +627,10 @@ static irqreturn_t mtu3_link_isr(struct +@@ -626,6 +629,10 @@ static irqreturn_t mtu3_link_isr(struct udev_speed = USB_SPEED_SUPER; maxpkt = 512; break; @@ -57,7 +57,7 @@ Signed-off-by: Felipe Balbi default: udev_speed = USB_SPEED_UNKNOWN; break; -@@ -825,14 +832,15 @@ int ssusb_gadget_init(struct ssusb_mtk * +@@ -827,14 +834,15 @@ int ssusb_gadget_init(struct ssusb_mtk * case USB_SPEED_FULL: case USB_SPEED_HIGH: case USB_SPEED_SUPER: diff --git a/target/linux/ramips/patches-4.14/0051-serial-add-ugly-custom-baud-rate-hack.patch b/target/linux/ramips/patches-4.14/0051-serial-add-ugly-custom-baud-rate-hack.patch index 2ad1f6f9f..d238ed972 100644 --- a/target/linux/ramips/patches-4.14/0051-serial-add-ugly-custom-baud-rate-hack.patch +++ b/target/linux/ramips/patches-4.14/0051-serial-add-ugly-custom-baud-rate-hack.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c -@@ -428,6 +428,9 @@ uart_get_baud_rate(struct uart_port *por +@@ -431,6 +431,9 @@ uart_get_baud_rate(struct uart_port *por break; } diff --git a/target/linux/ramips/patches-4.14/0070-weak_reordering.patch b/target/linux/ramips/patches-4.14/0070-weak_reordering.patch index 8f8c42c47..52e664132 100644 --- a/target/linux/ramips/patches-4.14/0070-weak_reordering.patch +++ b/target/linux/ramips/patches-4.14/0070-weak_reordering.patch @@ -1,6 +1,6 @@ --- a/arch/mips/ralink/Kconfig +++ b/arch/mips/ralink/Kconfig -@@ -57,6 +57,7 @@ choice +@@ -58,6 +58,7 @@ choice select COMMON_CLK select CLKSRC_MIPS_GIC select HW_HAS_PCI diff --git a/target/linux/ramips/patches-4.14/101-mt7621-timer.patch b/target/linux/ramips/patches-4.14/101-mt7621-timer.patch index 3653c0f23..10edafd41 100644 --- a/target/linux/ramips/patches-4.14/101-mt7621-timer.patch +++ b/target/linux/ramips/patches-4.14/101-mt7621-timer.patch @@ -77,7 +77,7 @@ void __iomem *sysc = (void __iomem *) KSEG1ADDR(MT7621_SYSC_BASE); --- a/arch/mips/ralink/Kconfig +++ b/arch/mips/ralink/Kconfig -@@ -58,6 +58,7 @@ choice +@@ -59,6 +59,7 @@ choice select CLKSRC_MIPS_GIC select HW_HAS_PCI select WEAK_REORDERING_BEYOND_LLSC