This commit is contained in:
Christian Obersteiner 2016-03-10 22:07:43 +01:00
commit 64337d0ead
60 changed files with 559 additions and 35191 deletions

View File

@ -16,7 +16,7 @@ our mailinglist to discuss it first.
Please refrain from using the `master` branch for anything else but development purposes! Please refrain from using the `master` branch for anything else but development purposes!
Use the most recent release instead. You can list all relaseses by running `git branch -a` Use the most recent release instead. You can list all relaseses by running `git branch -a`
and switch to one by running `git checkout v2016.1 && make update`. and switch to one by running `git checkout v2016.1.2 && make update`.
If you're using the autoupdater, do not autoupdate nodes with anything but releases. If you're using the autoupdater, do not autoupdate nodes with anything but releases.
If you upgrade using random master commits the nodes *will break* eventually. If you upgrade using random master commits the nodes *will break* eventually.

45
contrib/depdot.sh Executable file
View File

@ -0,0 +1,45 @@
#!/bin/bash
# Script to output the dependency graph of Gluon's packages
# Limitations:
# * Works only if directory names and package names are the same (true for all Gluon packages)
# * Doesn't show dependencies through virtual packages correctly
shopt -s nullglob
pushd "$(dirname "$0")/.." >/dev/null
escape_name() {
echo -n "_$1" | tr -c '[:alnum:]' _
}
print_node () {
echo "$(escape_name "$1") [label=\"$1\", shape=box];"
}
print_dep() {
echo "$(escape_name "$1") -> $(escape_name "$2");"
}
echo 'digraph G {'
for makefile in ./package/*/Makefile; do
dir="$(dirname "$makefile")"
package="$(basename "$dir")"
deps=$(grep -w DEPENDS "$makefile" | cut -d= -f2 | tr -d +)
print_node "$package"
for dep in $deps; do
print_node "$dep"
print_dep "$package" "$dep"
done
done | sort -u
popd >/dev/null
echo '}'

View File

@ -23,7 +23,7 @@ Best practices
This allows using the same code to create the initial configuration and upgrade configurations on upgrades. This allows using the same code to create the initial configuration and upgrade configurations on upgrades.
* If it is unavoidable to run different code during the initial installation, the ``sysconfig.gluon_version`` variable * If it is unavoidable to run different code during the initial installation, the ``sysconfig.gluon_version`` variable
can be checked. This variable in ``nil`` during the initial installation and contains the previously install Gluon can be checked. This variable is ``nil`` during the initial installation and contains the previously install Gluon
version otherwise. The package ``gluon-legacy`` (which is responsible for upgrades from the old firmwares of version otherwise. The package ``gluon-legacy`` (which is responsible for upgrades from the old firmwares of
Hamburg/Kiel/Lübeck) uses the special value ``legacy``; other packages should handle this value just as any other Hamburg/Kiel/Lübeck) uses the special value ``legacy``; other packages should handle this value just as any other
string. string.

View File

@ -8,7 +8,7 @@ If you select this package, add a list of authorized keys to ``site.conf`` like
{ {
authorized_keys = { 'ssh-rsa AAA.... user1@host', authorized_keys = { 'ssh-rsa AAA.... user1@host',
'ssh-rsa AAA.... user2@host }, 'ssh-rsa AAA.... user2@host' },
hostname_prefix = ... hostname_prefix = ...
... ...

View File

@ -24,3 +24,11 @@ existing configuration will also be set for the new configuration.
This allows upgrades to change from IBSS to 11s and vice-versa while retaining the This allows upgrades to change from IBSS to 11s and vice-versa while retaining the
"wireless meshing is enabled/disabled" property configured by the user regardless "wireless meshing is enabled/disabled" property configured by the user regardless
of the used mode. of the used mode.
During upgrades the wifi channel of the 2.4GHz and 5GHz radio will be restored to the channel
configured in the site.conf. If you need to preserve a user defined wifi channel during upgrades
you can configure this via the uci section ``gluon-core.wireless``::
uci set gluon-core.@wireless[0].preserve_channels='1'
Keep in mind that nodes running wifi interfaces on custom channels can't mesh with default nodes anymore!

View File

@ -60,6 +60,8 @@ Releases
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 1
releases/v2016.1.2
releases/v2016.1.1
releases/v2016.1 releases/v2016.1
releases/v2015.1.2 releases/v2015.1.2
releases/v2015.1.1 releases/v2015.1.1
@ -106,18 +108,24 @@ ar71xx-generic
- WNDR3800 - WNDR3800
- WNDRMAC (v2) - WNDRMAC (v2)
* Onion
- Omega
* TP-Link * TP-Link
- CPE210 (v1.0, v1.1) - CPE210 (v1.0, v1.1)
- CPE220 (v1.0, v1.1) - CPE220 (v1.0, v1.1)
- CPE510 (v1.0, v1.1) - CPE510 (v1.0, v1.1)
- CPE520 (v1.0, v1.1) - CPE520 (v1.0, v1.1)
- TL-MR13U (v1)
- TL-MR3020 (v1) - TL-MR3020 (v1)
- TL-MR3040 (v1, v2) - TL-MR3040 (v1, v2)
- TL-MR3220 (v1, v2) - TL-MR3220 (v1, v2)
- TL-MR3420 (v1, v2) - TL-MR3420 (v1, v2)
- TL-WA701N/ND (v1, v2) - TL-WA701N/ND (v1, v2)
- TL-WA750RE (v1) - TL-WA750RE (v1)
- TL-WA7510N (v1)
- TL-WA801N/ND (v1, v2) - TL-WA801N/ND (v1, v2)
- TL-WA830RE (v1, v2) - TL-WA830RE (v1, v2)
- TL-WA850RE (v1) - TL-WA850RE (v1)

View File

@ -0,0 +1,64 @@
Gluon 2016.1.1
==============
Added hardware support
~~~~~~~~~~~~~~~~~~~~~~
ar71xx-generic
^^^^^^^^^^^^^^
* Onion Omega
* TP-Link TL-MR13U v1
Bugfixes
~~~~~~~~
Build
^^^^^
Don't overwrite the opkg repository key on each build.
AirOS 5.6.x compatiblity
^^^^^^^^^^^^^^^^^^^^^^^^
Downgrading to AirOS 5.5.x before flashing Gluon on Airmax M XM/XW devices
(NanoStation, Bullet, ...) is not necessary anymore.
Status page
^^^^^^^^^^^
* Fix purging of disappered neighbours from the list
* Don't clear the signal graphs when scrolling in mobile browsers
* Improve browser compability (don't assume the Internationalization API is available,
fixes the display of numbers in Firefox for Android)
Config mode
^^^^^^^^^^^
* Strip trailing whitespace from number input fields (LuCI's validator doesn't catch this)
* Don't allow negative bandwidth limits
Failsafe mode
^^^^^^^^^^^^^
* Fix entering the failsafe mode on the TL-WDR4900.
Known Issues
~~~~~~~~~~~~
* Default TX power on many Ubiquiti devices is too high, correct offsets are unknown (`#94 <https://github.com/freifunk-gluon/gluon/issues/94>`_)
Reducing the TX power in the Expert Mode is recommended.
* The MAC address of the WAN interface is modified even when Mesh-on-WAN is disabled (`#496 <https://github.com/freifunk-gluon/gluon/issues/496>`_)
This may lead to issues in environments where a fixed MAC address is expected (like VMware when promicious mode is disallowed).
* Inconsistent respondd/announced API (`#522 <https://github.com/freifunk-gluon/gluon/issues/522>`_)
The current API is inconsistent and will be replaced eventually. The old API will still be supported for a while.
* Nondeterministic production of broken images for some (very old) hardware (`#669 <https://github.com/freifunk-gluon/gluon/issues/669>`_)
At the moment it seems like only the TL-WR841N v5 is affected.

View File

@ -0,0 +1,29 @@
Gluon 2016.1.2
==============
Added hardware support
~~~~~~~~~~~~~~~~~~~~~~
The *x86-generic* images now contain the ATIIXP PATA driver, adding support for
FUTRO Thin Clients.
Bugfixes
~~~~~~~~
A nondeterministic boot hang (`#669 <https://github.com/freifunk-gluon/gluon/issues/669>`_) has been fixed.
The TL-WR841N v5 seems to be affected in particular, but the kernel bug is not hardware-specific per se.
Known Issues
~~~~~~~~~~~~
* Default TX power on many Ubiquiti devices is too high, correct offsets are unknown (`#94 <https://github.com/freifunk-gluon/gluon/issues/94>`_)
Reducing the TX power in the Expert Mode is recommended.
* The MAC address of the WAN interface is modified even when Mesh-on-WAN is disabled (`#496 <https://github.com/freifunk-gluon/gluon/issues/496>`_)
This may lead to issues in environments where a fixed MAC address is expected (like VMware when promicious mode is disallowed).
* Inconsistent respondd API (`#522 <https://github.com/freifunk-gluon/gluon/issues/522>`_)
The current API is inconsistent and will be replaced eventually. The old API will still be supported for a while.

View File

@ -8,7 +8,7 @@ Gluon's releases are managed using `Git tags`_. If you are just getting
started with Gluon we recommend to use the latest stable release of Gluon. started with Gluon we recommend to use the latest stable release of Gluon.
Take a look at the `list of gluon releases`_ and notice the latest release, Take a look at the `list of gluon releases`_ and notice the latest release,
e.g. *v2016.1*. Always get Gluon using git and don't try to download it e.g. *v2016.1.2*. Always get Gluon using git and don't try to download it
as a Zip archive as the archive will be missing version information. as a Zip archive as the archive will be missing version information.
Please keep in mind that there is no "default Gluon" build; a site configuration Please keep in mind that there is no "default Gluon" build; a site configuration
@ -42,7 +42,7 @@ Building the images
------------------- -------------------
To build Gluon, first check out the repository. Replace *RELEASE* with the To build Gluon, first check out the repository. Replace *RELEASE* with the
version you'd like to checkout, e.g. *v2016.1*. version you'd like to checkout, e.g. *v2016.1.2*.
:: ::

View File

@ -1,14 +1,14 @@
GLUON_FEEDS='openwrt gluon routing luci' GLUON_FEEDS='openwrt gluon routing luci'
OPENWRT_REPO=git://git.openwrt.org/15.05/openwrt.git OPENWRT_REPO=git://git.openwrt.org/15.05/openwrt.git
OPENWRT_COMMIT=c698aa66043a151ac76d19849be9ee24dfd78b72 OPENWRT_COMMIT=efc26cc8e0513b3ec703ba540a554fde2c717cf6
PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git
PACKAGES_OPENWRT_COMMIT=9622fe984bba3a4547f48bc507ebaba7637eb2b0 PACKAGES_OPENWRT_COMMIT=9622fe984bba3a4547f48bc507ebaba7637eb2b0
PACKAGES_OPENWRT_BRANCH=for-15.05 PACKAGES_OPENWRT_BRANCH=for-15.05
PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git
PACKAGES_GLUON_COMMIT=06f2a62b97a25ddd1b9919d084c626d42cef5489 PACKAGES_GLUON_COMMIT=fea8f67d5d5cccac39b5020a69106f8665d41e58
PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git
PACKAGES_ROUTING_COMMIT=2a8338559de5c4b077cde7a83f43f4700a17d5cc PACKAGES_ROUTING_COMMIT=2a8338559de5c4b077cde7a83f43f4700a17d5cc

View File

@ -45,10 +45,10 @@ function M.handle(data)
uci:set("gluon-node-info", sname, "share_location", data._location) uci:set("gluon-node-info", sname, "share_location", data._location)
if data._location and data._latitude ~= nil and data._longitude ~= nil then if data._location and data._latitude ~= nil and data._longitude ~= nil then
uci:set("gluon-node-info", sname, "latitude", data._latitude) uci:set("gluon-node-info", sname, "latitude", data._latitude:trim())
uci:set("gluon-node-info", sname, "longitude", data._longitude) uci:set("gluon-node-info", sname, "longitude", data._longitude:trim())
if data._altitude ~= nil then if data._altitude ~= nil then
uci:set("gluon-node-info", sname, "altitude", data._altitude) uci:set("gluon-node-info", sname, "altitude", data._altitude:trim())
else else
uci:delete("gluon-node-info", sname, "altitude") uci:delete("gluon-node-info", sname, "altitude")
end end

View File

@ -28,13 +28,13 @@ function M.section(form)
o:depends("_limit_enabled", "1") o:depends("_limit_enabled", "1")
o.value = uci:get("simple-tc", "mesh_vpn", "limit_ingress") o.value = uci:get("simple-tc", "mesh_vpn", "limit_ingress")
o.rmempty = false o.rmempty = false
o.datatype = "integer" o.datatype = "uinteger"
o = s:option(cbi.Value, "_limit_egress", i18n.translate("Upstream (kbit/s)")) o = s:option(cbi.Value, "_limit_egress", i18n.translate("Upstream (kbit/s)"))
o:depends("_limit_enabled", "1") o:depends("_limit_enabled", "1")
o.value = uci:get("simple-tc", "mesh_vpn", "limit_egress") o.value = uci:get("simple-tc", "mesh_vpn", "limit_egress")
o.rmempty = false o.rmempty = false
o.datatype = "integer" o.datatype = "uinteger"
end end
function M.handle(data) function M.handle(data)
@ -49,11 +49,11 @@ function M.handle(data)
uci:set("simple-tc", "mesh_vpn", "ifname", "mesh-vpn") uci:set("simple-tc", "mesh_vpn", "ifname", "mesh-vpn")
if data._limit_ingress ~= nil then if data._limit_ingress ~= nil then
uci:set("simple-tc", "mesh_vpn", "limit_ingress", data._limit_ingress) uci:set("simple-tc", "mesh_vpn", "limit_ingress", data._limit_ingress:trim())
end end
if data._limit_egress ~= nil then if data._limit_egress ~= nil then
uci:set("simple-tc", "mesh_vpn", "limit_egress", data._limit_egress) uci:set("simple-tc", "mesh_vpn", "limit_egress", data._limit_egress:trim())
end end
uci:commit("simple-tc") uci:commit("simple-tc")

View File

@ -0,0 +1 @@
config wireless

View File

@ -10,11 +10,21 @@ if not sysconfig.gluon_version then
uci:delete_all('wireless', 'wifi-iface') uci:delete_all('wireless', 'wifi-iface')
end end
local function get_channel(radio, config)
if uci:get_first('gluon-core', 'wireless', 'preserve_channels') then
return uci:get('wireless', radio, 'channel') or config.channel
else
return config.channel
end
end
local function configure_radio(radio, index, config) local function configure_radio(radio, index, config)
if config then if config then
local channel = get_channel(radio, config)
uci:delete('wireless', radio, 'disabled') uci:delete('wireless', radio, 'disabled')
uci:set('wireless', radio, 'channel', config.channel) uci:set('wireless', radio, 'channel', channel)
uci:set('wireless', radio, 'htmode', 'HT20') uci:set('wireless', radio, 'htmode', 'HT20')
uci:set('wireless', radio, 'country', site.regdom) uci:set('wireless', radio, 'country', site.regdom)
end end

View File

@ -99,9 +99,9 @@ function f.handle(self, state, data)
if state == FORM_VALID then if state == FORM_VALID then
uci:set("network", "wan", "proto", data.ipv4) uci:set("network", "wan", "proto", data.ipv4)
if data.ipv4 == "static" then if data.ipv4 == "static" then
uci:set("network", "wan", "ipaddr", data.ipv4_addr) uci:set("network", "wan", "ipaddr", data.ipv4_addr:trim())
uci:set("network", "wan", "netmask", data.ipv4_netmask) uci:set("network", "wan", "netmask", data.ipv4_netmask:trim())
uci:set("network", "wan", "gateway", data.ipv4_gateway) uci:set("network", "wan", "gateway", data.ipv4_gateway:trim())
else else
uci:delete("network", "wan", "ipaddr") uci:delete("network", "wan", "ipaddr")
uci:delete("network", "wan", "netmask") uci:delete("network", "wan", "netmask")
@ -110,8 +110,8 @@ function f.handle(self, state, data)
uci:set("network", "wan6", "proto", data.ipv6) uci:set("network", "wan6", "proto", data.ipv6)
if data.ipv6 == "static" then if data.ipv6 == "static" then
uci:set("network", "wan6", "ip6addr", data.ipv6_addr) uci:set("network", "wan6", "ip6addr", data.ipv6_addr:trim())
uci:set("network", "wan6", "ip6gw", data.ipv6_gateway) uci:set("network", "wan6", "ip6gw", data.ipv6_gateway:trim())
else else
uci:delete("network", "wan6", "ip6addr") uci:delete("network", "wan6", "ip6addr")
uci:delete("network", "wan6", "ip6gw") uci:delete("network", "wan6", "ip6gw")

View File

@ -29,6 +29,7 @@
#include <iwinfo.h> #include <iwinfo.h>
#include <json-c/json.h> #include <json-c/json.h>
#include <libgluonutil.h> #include <libgluonutil.h>
#include <uci.h>
#include <alloca.h> #include <alloca.h>
#include <glob.h> #include <glob.h>

View File

@ -198,11 +198,11 @@ function (Helper, SignalGraph, Signal) {
notUpdated.delete(id) notUpdated.delete(id)
} }
for (id in notUpdated) { notUpdated.forEach(function (id) {
managedNeighbours[id].views.forEach( function (d) { d.destroy() }) managedNeighbours[id].views.forEach( function (d) { d.destroy() })
colors.push(managedNeighbours[id].color) colors.push(managedNeighbours[id].color)
delete managedNeighbours[id] delete managedNeighbours[id]
} })
} }

View File

@ -110,7 +110,7 @@ define(function () {
function resize() { function resize() {
var newWidth = canvas.parentNode.clientWidth var newWidth = canvas.parentNode.clientWidth
if (newWidth === 0) if (newWidth === 0 || newWidth === canvas.width)
return return
var lastImage = ctx.getImageData(0, 0, newWidth, canvas.height) var lastImage = ctx.getImageData(0, 0, newWidth, canvas.height)

View File

@ -171,28 +171,32 @@ define(["lib/helper"], function (Helper) {
} }
function prettyPackets(d) { function prettyPackets(d) {
var v = new Intl.NumberFormat("de-DE", {maximumFractionDigits: 0}).format(d) var v = Helper.formatNumberFixed(d, 0)
return v + " Pakete/s" return v + " Pakete/s"
} }
function prettyPrefix(prefixes, step, d) { function prettyPrefix(prefixes, step, d) {
var prefix = 0 var prefix = 0
while (d > step && prefix < 4) { while (d > step && prefix < prefixes.length - 1) {
d /= step d /= step
prefix++ prefix++
} }
d = new Intl.NumberFormat("de-DE", {maximumSignificantDigits: 3}).format(d) d = Helper.formatNumber(d, 3)
return d + " " + prefixes[prefix] return d + " " + prefixes[prefix]
} }
function prettySize(d) {
return prettyPrefix([ "", "k", "M", "G", "T" ], 1024, d)
}
function prettyBits(d) { function prettyBits(d) {
return prettyPrefix([ "bps", "kbps", "Mbps", "Gbps" ], 1024, d * 8) return prettySize(d * 8) + "bps"
} }
function prettyBytes(d) { function prettyBytes(d) {
return prettyPrefix([ "B", "kB", "MB", "GB", "TB" ], 1024, d) return prettySize(d) + "B"
} }
function prettyUptime(seconds) { function prettyUptime(seconds) {
@ -220,11 +224,11 @@ define(["lib/helper"], function (Helper) {
} }
function prettyNVRAM(usage) { function prettyNVRAM(usage) {
return new Intl.NumberFormat("de-DE", {maximumSignificantDigits: 3}).format(usage * 100) + "% belegt" return Helper.formatNumber(usage * 100, 3) + "% belegt"
} }
function prettyLoad(load) { function prettyLoad(load) {
return new Intl.NumberFormat("de-DE", {maximumSignificantDigits: 3}).format(load) return Helper.formatNumberFixed(load, 2)
} }
function prettyRAM(memory) { function prettyRAM(memory) {

View File

@ -51,6 +51,25 @@ define([ "bacon" ], function (Bacon) {
return dictGet(dict[k], key) return dictGet(dict[k], key)
} }
function localizeNumber(d) {
var sep = ','
return d.replace('.', sep)
}
function formatNumberFixed(d, digits) {
return localizeNumber(d.toFixed(digits))
}
function formatNumber(d, digits) {
digits--
for (var v = d; v >= 10 && digits > 0; v /= 10)
digits--
// avoid toPrecision as it might produce strings in exponential notation
return formatNumberFixed(d, digits)
}
function haversine() { function haversine() {
var radians = Array.prototype.map.call(arguments, function(deg) { return deg / 180.0 * Math.PI }) var radians = Array.prototype.map.call(arguments, function(deg) { return deg / 180.0 * Math.PI })
var lat1 = radians[0], lon1 = radians[1], lat2 = radians[2], lon2 = radians[3] var lat1 = radians[0], lon1 = radians[1], lat2 = radians[2], lon2 = radians[3]
@ -66,6 +85,8 @@ define([ "bacon" ], function (Bacon) {
, request: request , request: request
, getJSON: getJSON , getJSON: getJSON
, dictGet: dictGet , dictGet: dictGet
, formatNumber: formatNumber
, formatNumberFixed: formatNumberFixed
, haversine: haversine , haversine: haversine
} }
}) })

View File

@ -3,10 +3,10 @@ Date: Tue, 9 Feb 2016 18:22:29 +0100
Subject: ath10k-firmware: add Candela Technologies firmware for QCA988X Subject: ath10k-firmware: add Candela Technologies firmware for QCA988X
diff --git a/package/firmware/ath10k-firmware/Makefile b/package/firmware/ath10k-firmware/Makefile diff --git a/package/firmware/ath10k-firmware/Makefile b/package/firmware/ath10k-firmware/Makefile
index 882294c..c6e6f2d 100644 index b03d644..7d4d449 100644
--- a/package/firmware/ath10k-firmware/Makefile --- a/package/firmware/ath10k-firmware/Makefile
+++ b/package/firmware/ath10k-firmware/Makefile +++ b/package/firmware/ath10k-firmware/Makefile
@@ -46,6 +46,26 @@ define Download/ath10k-firmware-qca988x @@ -44,6 +44,26 @@ define Download/ath10k-firmware-qca988x
endef endef
$(eval $(call Download,ath10k-firmware-qca988x)) $(eval $(call Download,ath10k-firmware-qca988x))
@ -33,7 +33,7 @@ index 882294c..c6e6f2d 100644
define Package/ath10k-firmware-qca99x0 define Package/ath10k-firmware-qca99x0
$(Package/ath10k-firmware-default) $(Package/ath10k-firmware-default)
TITLE:=ath10k firmware for QCA99x0 devices TITLE:=ath10k firmware for QCA99x0 devices
@@ -81,6 +101,16 @@ define Package/ath10k-firmware-qca988x/install @@ -79,6 +99,16 @@ define Package/ath10k-firmware-qca988x/install
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin
endef endef
@ -50,10 +50,23 @@ index 882294c..c6e6f2d 100644
define Package/ath10k-firmware-qca6174/install define Package/ath10k-firmware-qca6174/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k $(INSTALL_DIR) $(1)/lib/firmware/ath10k
$(CP) $(PKG_BUILD_DIR)/QCA6174 $(1)/lib/firmware/ath10k/ $(CP) $(PKG_BUILD_DIR)/QCA6174 $(1)/lib/firmware/ath10k/
@@ -100,5 +130,6 @@ define Package/ath10k-firmware-qca99x0/install @@ -98,5 +128,6 @@ define Package/ath10k-firmware-qca99x0/install
endef endef
$(eval $(call BuildPackage,ath10k-firmware-qca988x)) $(eval $(call BuildPackage,ath10k-firmware-qca988x))
+$(eval $(call BuildPackage,ath10k-firmware-qca988x-ct)) +$(eval $(call BuildPackage,ath10k-firmware-qca988x-ct))
$(eval $(call BuildPackage,ath10k-firmware-qca99x0)) $(eval $(call BuildPackage,ath10k-firmware-qca99x0))
$(eval $(call BuildPackage,ath10k-firmware-qca6174)) $(eval $(call BuildPackage,ath10k-firmware-qca6174))
diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 30da1cf..cd8d670 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -247,7 +247,7 @@ define KernelPackage/ath10k
$(call KernelPackage/mac80211/Default)
TITLE:=Atheros 802.11ac wireless cards support
URL:=https://wireless.wiki.kernel.org/en/users/Drivers/ath10k
- DEPENDS+= @PCI_SUPPORT +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT +@KERNEL_RELAY +ath10k-firmware-qca988x
+ DEPENDS+= @PCI_SUPPORT +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT +@KERNEL_RELAY
FILES:= \
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_core.ko \
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_pci.ko

View File

@ -1,68 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Tue, 9 Feb 2016 13:49:01 +0100
Subject: build: add support for choosing a different url filename part than the output file
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Backport of r47591 and r48427
diff --git a/include/download.mk b/include/download.mk
index 937b5d3..e518cce 100644
--- a/include/download.mk
+++ b/include/download.mk
@@ -44,11 +44,11 @@ define DownloadMethod/unknown
endef
define DownloadMethod/default
- $(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(FILE)" "$(MD5SUM)" $(foreach url,$(URL),"$(url)")
+ $(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(FILE)" "$(MD5SUM)" "$(URL_FILE)" $(foreach url,$(URL),"$(url)")
endef
define wrap_mirror
- $(if $(if $(MIRROR),$(filter-out x,$(MIRROR_MD5SUM))),@$(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(FILE)" "$(MIRROR_MD5SUM)" || ( $(1) ),$(1))
+ $(if $(if $(MIRROR),$(filter-out x,$(MIRROR_MD5SUM))),@$(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(FILE)" "$(MIRROR_MD5SUM)" "" || ( $(1) ),$(1))
endef
define DownloadMethod/cvs
@@ -157,6 +157,7 @@ Validate/darcs=VERSION SUBDIR
define Download/Defaults
URL:=
FILE:=
+ URL_FILE:=
PROTO:=
MD5SUM:=
SUBDIR:=
diff --git a/scripts/download.pl b/scripts/download.pl
index cd68a7b..111d03c 100755
--- a/scripts/download.pl
+++ b/scripts/download.pl
@@ -11,15 +11,19 @@ use warnings;
use File::Basename;
use File::Copy;
-@ARGV > 2 or die "Syntax: $0 <target dir> <filename> <md5sum> [<mirror> ...]\n";
+@ARGV > 2 or die "Syntax: $0 <target dir> <filename> <md5sum> <url filename> [<mirror> ...]\n";
+my $url_filename;
my $target = shift @ARGV;
my $filename = shift @ARGV;
my $md5sum = shift @ARGV;
+$url_filename = shift @ARGV unless $ARGV[0] =~ /:\/\//;
my $scriptdir = dirname($0);
my @mirrors;
my $ok;
+$url_filename or $url_filename = $filename;
+
sub localmirrors {
my @mlist;
open LM, "$scriptdir/localmirrors" and do {
@@ -106,7 +110,7 @@ sub download
return;
}
} else {
- open WGET, "wget -t5 --timeout=20 --no-check-certificate $options -O- '$mirror/$filename' |" or die "Cannot launch wget.\n";
+ open WGET, "wget -t5 --timeout=20 --no-check-certificate $options -O- '$mirror/$url_filename' |" or die "Cannot launch wget.\n";
open MD5SUM, "| $md5cmd > '$target/$filename.md5sum'" or die "Cannot launch md5sum.\n";
open OUTPUT, "> $target/$filename.dl" or die "Cannot create file $target/$filename.dl: $!\n";
my $buffer;

File diff suppressed because it is too large Load Diff

View File

@ -1,39 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Sun, 21 Jun 2015 22:50:48 +0200
Subject: ar71xx: add support for tp-link wr740n v5.0 (EU)
TP-Link ships wr740n v5.0 to Romania (so probably everywhere except
China) with 4 MB flash and 32 MB memory (confirmed by their local
support). This patch adds support for the v5.0 clone of v4, i just
tested it on my own v5.0 router and it works.
Signed-off-by: Daniel Petre <daniel.petre@posteo.net>
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 4336697..1fe88d5 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -501,6 +501,14 @@ define Device/tl-wr740n-v4
CONSOLE := ttyATH0,115200
endef
+define Device/tl-wr740n-v5
+ $(Device/tplink-4mlzma)
+ BOARDNAME := TL-WR741ND-v4
+ DEVICE_PROFILE := TLWR740
+ TPLINK_HWID := 0x07400005
+ CONSOLE := ttyATH0,115200
+endef
+
define Device/tl-wr741nd-v1
$(Device/tplink-4m)
BOARDNAME := TL-WR741ND
@@ -530,7 +538,7 @@ define Device/tl-wr743nd-v2
TPLINK_HWID := 0x07430002
CONSOLE := ttyATH0,115200
endef
-TARGET_DEVICES += tl-wr740n-v4 tl-wr741nd-v1 tl-wr741nd-v2 tl-wr741nd-v4 tl-wr743nd-v2
+TARGET_DEVICES += tl-wr740n-v4 tl-wr740n-v5 tl-wr741nd-v1 tl-wr741nd-v2 tl-wr741nd-v4 tl-wr743nd-v2
define Device/tl-wr841n-v8
$(Device/tplink-4mlzma)

View File

@ -1,35 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Sun, 21 Jun 2015 22:48:04 +0200
Subject: ar71xx: add support for TL-WR741ND v5
This device is identical to the TL-WR740N v5, it even uses the same HWID (which
wasn't the case for older TL-WR741ND revisions).
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 1fe88d5..78d35e1 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -531,6 +531,14 @@ define Device/tl-wr741nd-v4
CONSOLE := ttyATH0,115200
endef
+define Device/tl-wr741nd-v5
+ $(Device/tplink-4mlzma)
+ BOARDNAME := TL-WR741ND-v4
+ DEVICE_PROFILE := TLWR741
+ TPLINK_HWID := 0x07400005
+ CONSOLE := ttyATH0,115200
+endef
+
define Device/tl-wr743nd-v2
$(Device/tplink-4mlzma)
BOARDNAME := TL-WR741ND-v4
@@ -538,7 +546,7 @@ define Device/tl-wr743nd-v2
TPLINK_HWID := 0x07430002
CONSOLE := ttyATH0,115200
endef
-TARGET_DEVICES += tl-wr740n-v4 tl-wr740n-v5 tl-wr741nd-v1 tl-wr741nd-v2 tl-wr741nd-v4 tl-wr743nd-v2
+TARGET_DEVICES += tl-wr740n-v4 tl-wr740n-v5 tl-wr741nd-v1 tl-wr741nd-v2 tl-wr741nd-v4 tl-wr741nd-v5 tl-wr743nd-v2
define Device/tl-wr841n-v8
$(Device/tplink-4mlzma)

View File

@ -1,131 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 16 Jul 2015 22:01:02 +0200
Subject: sunxi: fix uboot install location
Install uboot files to KERNEL_BUILD_DIR instead of BIN_DIR to fix the
ImageBuilder. Similar fixes are necessary for many (all?) other uboot
targets.
Also remove the DTS copy command, BIN_DIR was unnecessarily cluttered with
DTS files unrelated to the chosen profile.
diff --git a/package/boot/uboot-sunxi/Makefile b/package/boot/uboot-sunxi/Makefile
index 14ba922..9032600 100644
--- a/package/boot/uboot-sunxi/Makefile
+++ b/package/boot/uboot-sunxi/Makefile
@@ -6,6 +6,7 @@
#
include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=u-boot
PKG_VERSION:=2015.01
@@ -16,7 +17,7 @@ PKG_SOURCE_URL:= \
PKG_MD5SUM:=7f08dc9e98a71652bd6968888ed6ec95
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=GPL-2.0 GPL-2.0+
PKG_LICENSE_FILES:=Licenses/README
@@ -136,16 +137,16 @@ define Build/Compile
endef
define Package/uboot/install/default
- $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
$(CP) $(PKG_BUILD_DIR)/u-boot.bin \
- $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.bin
+ $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-u-boot.bin
$(CP) $(PKG_BUILD_DIR)/spl/sunxi-spl.bin \
- $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-spl.bin
+ $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-spl.bin
$(CP) $(PKG_BUILD_DIR)/u-boot-sunxi-with-spl.bin \
- $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot-with-spl.bin
+ $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-u-boot-with-spl.bin
$(CP) uEnv.txt \
- $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-uEnv.txt
- mkimage -C none -A arm -T script -d $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-uEnv.txt $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-boot.scr
+ $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-uEnv.txt
+ mkimage -C none -A arm -T script -d $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-uEnv.txt \
+ $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-boot.scr
endef
define Package/uboot/install/template
diff --git a/target/linux/sunxi/image/Makefile b/target/linux/sunxi/image/Makefile
index 6fcd61f..19ab935 100644
--- a/target/linux/sunxi/image/Makefile
+++ b/target/linux/sunxi/image/Makefile
@@ -11,28 +11,12 @@ include $(INCLUDE_DIR)/host.mk
FAT32_BLOCK_SIZE=1024
FAT32_BLOCKS=$(shell echo $$(($(CONFIG_SUNXI_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE))))
-BOARDS:= \
- sun4i-a10-cubieboard \
- sun4i-a10-olinuxino-lime \
- sun4i-a10-pcduino \
- sun5i-a13-olinuxino \
- sun6i-a31-colombus \
- sun6i-a31-m9 \
- sun7i-a20-bananapi \
- sun7i-a20-bananapro \
- sun7i-a20-cubieboard2 \
- sun7i-a20-cubietruck \
- sun7i-a20-olinuxino-lime \
- sun7i-a20-olinuxino-micro \
- sun7i-a20-pcduino3 \
- sun7i-a20-lamobo-r1
-
define Image/BuildKernel
mkimage -A arm -O linux -T kernel -C none \
-a 0x40008000 -e 0x40008000 \
-n 'ARM OpenWrt Linux-$(LINUX_VERSION)' \
-d $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
-
+
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
$(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
echo -ne '\x00\x00\x00\x00' >> $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
@@ -42,27 +26,23 @@ define Image/BuildKernel
$(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs \
)
endif
-
- $(foreach board,$(BOARDS),
- $(CP) $(DTS_DIR)/$(board).dtb $(BIN_DIR)/
- )
endef
define Image/Build/SDCard
rm -f $(KDIR)/boot.img
mkdosfs $(KDIR)/boot.img -C $(FAT32_BLOCKS)
-
- mcopy -i $(KDIR)/boot.img $(BIN_DIR)/uboot-sunxi-$(PROFILE)/$(IMG_PREFIX)-$(PROFILE)-boot.scr ::boot.scr
- mcopy -i $(KDIR)/boot.img $(BIN_DIR)/$(2).dtb ::dtb
+
+ mcopy -i $(KDIR)/boot.img $(KDIR)/uboot-sunxi-$(PROFILE)-boot.scr ::boot.scr
+ mcopy -i $(KDIR)/boot.img $(DTS_DIR)/$(2).dtb ::dtb
mcopy -i $(KDIR)/boot.img $(BIN_DIR)/$(IMG_PREFIX)-uImage ::uImage
-
+
./gen_sunxi_sdcard_img.sh \
$(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-sdcard-vfat-$(1).img \
$(KDIR)/boot.img \
$(KDIR)/root.$(1) \
$(CONFIG_SUNXI_SD_BOOT_PARTSIZE) \
$(CONFIG_TARGET_ROOTFS_PARTSIZE) \
- $(BIN_DIR)/uboot-sunxi-$(PROFILE)/$(IMG_PREFIX)-$(PROFILE)-u-boot-with-spl.bin
+ $(KDIR)/uboot-sunxi-$(PROFILE)-u-boot-with-spl.bin
endef
define Image/Build/Profile/A10-OLinuXino-Lime
@@ -124,7 +104,7 @@ endef
define Image/Build
$(call Image/Build/$(1),$(1))
$(call Image/Build/Profile/$(PROFILE),$(1))
-
+
dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
endef

View File

@ -0,0 +1,74 @@
From: Neal Oakey <neal.oakey@bingo-ev.de>
Date: Sun, 14 Feb 2016 20:58:20 +0100
Subject: fix UBNT XM model detection
Signed-off-by: Neal Oakey <neal.oakey@bingo-ev.de>
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index d0abf42..f345fae 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -64,6 +64,40 @@ wndr3700_board_detect() {
AR71XX_MODEL="$machine"
}
+ubnt_get_mtd_part_magic() {
+ ar71xx_get_mtd_offset_size_format EEPROM 4118 2 %02x
+}
+
+ubnt_xm_board_detect() {
+ local model
+ local magic
+
+ magic="$(ubnt_get_mtd_part_magic)"
+ case ${magic:0:3} in
+ "e00"|\
+ "e01"|\
+ "e80") # It seams that there are different Versions of the Nanostation
+ model="Ubiquiti NanoStation M"
+ ;;
+ "e0a")
+ model="Ubiquiti NanoStation loco M"
+ ;;
+ "e1b") # Note: the M5 has not been tested!
+ # and the Ti Versions are still missing
+ model="Ubiquiti Rocket M"
+ ;;
+ "e20"|\
+ "e2d") # Bullet Ti M
+ model="Ubiquiti Bullet M"
+ ;;
+ "e30")
+ model="Ubiquiti PicoStation M"
+ ;;
+ esac
+
+ [ ! -z "$model" ] && AR71XX_MODEL="${model}${magic:3:1}"
+}
+
cybertan_get_hw_magic() {
local part
@@ -472,12 +506,14 @@ ar71xx_board_detect() {
;;
*"Bullet M")
name="bullet-m"
+ ubnt_xm_board_detect
;;
*"Loco M XW")
name="loco-m-xw"
;;
*"Nanostation M")
name="nanostation-m"
+ ubnt_xm_board_detect
;;
*"Nanostation M XW")
name="nanostation-m-xw"
@@ -664,6 +700,7 @@ ar71xx_board_detect() {
;;
*"Rocket M")
name="rocket-m"
+ ubnt_xm_board_detect
;;
*"Rocket M XW")
name="rocket-m-xw"

View File

@ -1,21 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 16 Jul 2015 22:13:59 +0200
Subject: sunxi: respect CONFIG_TARGET_IMAGES_GZIP
The ext4 images are huge uncompressed.
diff --git a/target/linux/sunxi/image/Makefile b/target/linux/sunxi/image/Makefile
index 19ab935..d3f4409 100644
--- a/target/linux/sunxi/image/Makefile
+++ b/target/linux/sunxi/image/Makefile
@@ -43,6 +43,10 @@ define Image/Build/SDCard
$(CONFIG_SUNXI_SD_BOOT_PARTSIZE) \
$(CONFIG_TARGET_ROOTFS_PARTSIZE) \
$(KDIR)/uboot-sunxi-$(PROFILE)-u-boot-with-spl.bin
+
+ ifneq ($(CONFIG_TARGET_IMAGES_GZIP),)
+ gzip -f9n $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-sdcard-vfat-$(1).img
+ endif
endef
define Image/Build/Profile/A10-OLinuXino-Lime

View File

@ -0,0 +1,133 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Mon, 7 Mar 2016 06:07:21 +0100
Subject: base-files: implemented basic GPIO control
Internal GPIO pins are used for PoE passthrough setups in multi-port
routers. This patch implemnets control over this hardware feature for
Ubiquiti Nanostations and TP-Link CPE510.
Signed-off-by: Lars Kruse <lists@sumpfralle.de>
Backport of r46271
diff --git a/package/base-files/files/etc/init.d/gpio_switch b/package/base-files/files/etc/init.d/gpio_switch
new file mode 100755
index 0000000..1f1b44b
--- /dev/null
+++ b/package/base-files/files/etc/init.d/gpio_switch
@@ -0,0 +1,42 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2015 OpenWrt.org
+
+START=98
+STOP=10
+USE_PROCD=1
+
+
+load_gpio_switch()
+{
+ local name
+ local gpio_pin
+ local value
+
+ config_get gpio_pin "$1" gpio_pin
+ config_get name "$1" name
+ config_get value "$1" value 0
+
+ local gpio_path="/sys/class/gpio/gpio${gpio_pin}"
+ # export GPIO pin for access
+ [ -d "$gpio_path" ] || {
+ echo "$gpio_pin" >/sys/class/gpio/export
+ # we need to wait a bit until the GPIO appears
+ [ -d "$gpio_path" ] || sleep 1
+ echo out >"$gpio_path/direction"
+ }
+ # write 0 or 1 to the "value" field
+ { [ "$value" = "0" ] && echo "0" || echo "1"; } >"$gpio_path/value"
+}
+
+service_triggers()
+{
+ procd_add_reload_trigger "system"
+}
+
+start_service()
+{
+ [ -e /sys/class/gpio/ ] && {
+ config_load system
+ config_foreach load_gpio_switch gpio_switch
+ }
+}
diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh
index 5a8809d..6577ecd 100644
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -2,6 +2,7 @@
# Copyright (C) 2011 OpenWrt.org
UCIDEF_LEDS_CHANGED=0
+UCIDEF_GPIO_SWITCHES_CHANGED=0
ucidef_set_led_netdev() {
local cfg="led_$1"
@@ -180,6 +181,29 @@ ucidef_commit_leds()
[ "$UCIDEF_LEDS_CHANGED" = "1" ] && uci commit system
}
+ucidef_set_gpio_switch() {
+ local cfg="gpio_switch_$1"
+ local name="$2"
+ local gpio_pin="$3"
+ # use "0" as default value
+ local default="${4:-0}"
+
+ uci -q get "system.$cfg" && return 0
+
+ uci batch <<EOF
+set system.$cfg='gpio_switch'
+set system.$cfg.name='$name'
+set system.$cfg.gpio_pin='$gpio_pin'
+set system.$cfg.value='$default'
+EOF
+ UCIDEF_GPIO_SWITCHES_CHANGED=1
+}
+
+ucidef_commit_gpio_switches()
+{
+ [ "$UCIDEF_GPIO_SWITCHES_CHANGED" = "1" ] && uci commit system
+}
+
ucidef_set_interface_loopback() {
uci batch <<EOF
set network.loopback='interface'
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches b/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches
new file mode 100644
index 0000000..81d3982
--- /dev/null
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches
@@ -0,0 +1,25 @@
+#!/bin/sh
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+
+. /lib/functions/uci-defaults.sh
+. /lib/ar71xx.sh
+
+board=$(ar71xx_board_name)
+
+case "$board" in
+nanostation-m)
+ ucidef_set_gpio_switch "poe_passthrough" "PoE Passthrough" "2"
+ ;;
+nanostation-m-xw)
+ ucidef_set_gpio_switch "poe_passthrough" "PoE Passthrough" "8"
+ ;;
+cpe510)
+ ucidef_set_gpio_switch "poe_passthrough" "PoE Passthrough" "20"
+ ;;
+esac
+
+ucidef_commit_gpio_switches
+
+exit 0

View File

@ -1,62 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Sat, 18 Jul 2015 17:13:23 +0200
Subject: odhcp6c: add option "sourcefilter" to disable source filter
Signed-off-by: Steven Barth <steven@midlink.org>
diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile
index 5bf43bd..75de54c 100644
--- a/package/network/ipv6/odhcp6c/Makefile
+++ b/package/network/ipv6/odhcp6c/Makefile
@@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=odhcp6c
-PKG_VERSION:=2015-07-13
+PKG_VERSION:=2015-07-18
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.script b/package/network/ipv6/odhcp6c/files/dhcpv6.script
index b8cbddb..33f6d9b 100755
--- a/package/network/ipv6/odhcp6c/files/dhcpv6.script
+++ b/package/network/ipv6/odhcp6c/files/dhcpv6.script
@@ -76,7 +76,7 @@ setup_interface () {
done
for entry in $RA_ROUTES; do
- local duplicate=0
+ local duplicate=$NOSOURCEFILTER
local addr="${entry%%/*}"
entry="${entry#*/}"
local mask="${entry%%,*}"
diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.sh b/package/network/ipv6/odhcp6c/files/dhcpv6.sh
index adcb100..4a453fd 100755
--- a/package/network/ipv6/odhcp6c/files/dhcpv6.sh
+++ b/package/network/ipv6/odhcp6c/files/dhcpv6.sh
@@ -28,14 +28,15 @@ proto_dhcpv6_init_config() {
proto_config_add_boolean delegate
proto_config_add_int "soltimeout"
proto_config_add_boolean fakeroutes
+ proto_config_add_boolean sourcefilter
}
proto_dhcpv6_setup() {
local config="$1"
local iface="$2"
- local reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes
- json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes
+ local reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter
+ json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter
# Configure
@@ -76,6 +77,7 @@ proto_dhcpv6_setup() {
[ -n "$zone_464xlat" ] && proto_export "ZONE_464XLAT=$zone_464xlat"
[ -n "$zone" ] && proto_export "ZONE=$zone"
[ "$fakeroutes" != "0" ] && proto_export "FAKE_ROUTES=1"
+ [ "$sourcefilter" = "0" ] && proto_export "NOSOURCEFILTER=1"
proto_export "INTERFACE=$config"
proto_run_command "$config" odhcp6c \

View File

@ -0,0 +1,32 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Mon, 7 Mar 2016 06:07:59 +0100
Subject: ar71xx: assign proper GPIO pin for Ubiquiti Nanostation models
The GPIO pins for "POE passthrough" of Ubiquiti Nanostation models are the
following:
* Ubiquiti Nanostation M XM: Pin 8
* Ubiquiti Nanostation M XW: Pin 2
The previous definition of the pins was mixed up between XM and XW model.
Signed-off-by: Lars Kruse <lists@sumpfralle.de>
Backport of r46922
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches b/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches
index 81d3982..b41f275 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches
@@ -10,10 +10,10 @@ board=$(ar71xx_board_name)
case "$board" in
nanostation-m)
- ucidef_set_gpio_switch "poe_passthrough" "PoE Passthrough" "2"
+ ucidef_set_gpio_switch "poe_passthrough" "PoE Passthrough" "8"
;;
nanostation-m-xw)
- ucidef_set_gpio_switch "poe_passthrough" "PoE Passthrough" "8"
+ ucidef_set_gpio_switch "poe_passthrough" "PoE Passthrough" "2"
;;
cpe510)
ucidef_set_gpio_switch "poe_passthrough" "PoE Passthrough" "20"

View File

@ -1,57 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 6 Aug 2015 03:01:38 +0200
Subject: ar71xx: fix ethernet initialization on QCA953x-based boards (TP-Link TL-WR841N/ND v9, Compex WPJ531)
The initialization routines for these boards were relying on some (wrong)
defaults for the QCA953x ethernet. Make these defaults explicit to prevent
breaking them when the QCA953x defaults are fixed.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v9.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v9.c
index c28afc6..3e5c2a2 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v9.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v9.c
@@ -109,12 +109,18 @@ static void __init tl_ap143_setup(void)
ath79_register_mdio(0, 0x0);
/* LAN */
+ ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
+ ath79_eth1_data.duplex = DUPLEX_FULL;
+ ath79_switch_data.phy_poll_mask |= BIT(4);
ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);
ath79_register_eth(1);
/* WAN */
ath79_switch_data.phy4_mii_en = 1;
ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
+ ath79_eth0_data.duplex = DUPLEX_FULL;
+ ath79_eth0_data.speed = SPEED_100;
+ ath79_eth0_data.phy_mask = BIT(4);
ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);
ath79_register_eth(0);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c
index bc13d70..e665a2e 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj531.c
@@ -105,12 +105,19 @@ static void __init common_setup(void)
ath79_register_mdio(0, 0x0);
/* LAN */
+ ath79_eth0_data.duplex = DUPLEX_FULL;
+ ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
+ ath79_eth0_data.speed = SPEED_100;
+ ath79_eth0_data.phy_mask = BIT(4);
ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
ath79_register_eth(0);
/* WAN */
ath79_switch_data.phy4_mii_en = 1;
+ ath79_eth1_data.duplex = DUPLEX_FULL;
ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
+ ath79_eth1_data.speed = SPEED_100;
+ ath79_switch_data.phy_poll_mask |= BIT(4);
ath79_init_mac(ath79_eth1_data.mac_addr, mac, 1);
ath79_register_eth(1);

View File

@ -0,0 +1,55 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Wed, 9 Mar 2016 06:46:44 +0100
Subject: netifd: update to latest git master
diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile
index 619024b..f7563d5 100644
--- a/package/network/config/netifd/Makefile
+++ b/package/network/config/netifd/Makefile
@@ -1,13 +1,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=netifd
-PKG_VERSION:=2015-12-16
+PKG_VERSION:=2016-03-07
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=http://git.openwrt.org/project/netifd.git
+PKG_SOURCE_URL=$(OPENWRT_GIT)/project/netifd.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=245527193e90906451be35c2b8e972b8712ea6ab
+PKG_SOURCE_VERSION:=bd1ee3efb46ae013d81b1aec51668e7595274e69
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
# PKG_MIRROR_MD5SUM:=
diff --git a/package/network/config/netifd/files/etc/init.d/network b/package/network/config/netifd/files/etc/init.d/network
index 542fc08..bdadbbc 100755
--- a/package/network/config/netifd/files/etc/init.d/network
+++ b/package/network/config/netifd/files/etc/init.d/network
@@ -21,7 +21,6 @@ start_service() {
procd_set_param watch network.interface
[ -e /proc/sys/kernel/core_pattern ] && {
procd_set_param limits core="unlimited"
- echo '/tmp/%e.%p.%s.%t.core' > /proc/sys/kernel/core_pattern
}
procd_close_instance
}
diff --git a/package/network/config/netifd/files/sbin/ifup b/package/network/config/netifd/files/sbin/ifup
index af3aaa8..5515b91 100755
--- a/package/network/config/netifd/files/sbin/ifup
+++ b/package/network/config/netifd/files/sbin/ifup
@@ -67,12 +67,10 @@ if [ -n "$setup_wifi" ] && grep -sq config /etc/config/wireless; then
fi
}
- local radio_devs
- local network="$1"
+ network="$1"
config_load wireless
config_foreach find_related_radios wifi-iface
- local dev
for dev in $(echo "$radio_devs" | sort -u); do
/sbin/wifi up "$dev"
done

View File

@ -1,807 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 6 Aug 2015 03:01:47 +0200
Subject: ar71xx: rework patch for qca953x/956x
Patch cherry-picked from the following location:
https://www.codeaurora.org/cgit/quic/qsdk/oss/system/openwrt/commit/?h=release/coconut_ioe4531_2.0&id=5c357bf6c763e4140dddcc9a3bc5f005525a9c0e
Changelist,
- add more register defines
- add EHCI support
- fix GPIO pin count to 18
- fix chained irq disabled
- fix GMAC0/GMAC1 initial
- fix WMAC irq number to 47
- merge the changes of dev-eth.c from the patch to file.
Signed-off-by: Miaoqing Pan <miaoqing@codeaurora.org>
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
index ae3db4c..ff94e2e 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
@@ -198,6 +198,8 @@ void __init ath79_register_mdio(unsigned int id, u32 phy_mask)
case ATH79_SOC_AR9330:
case ATH79_SOC_AR9331:
case ATH79_SOC_QCA9533:
+ case ATH79_SOC_QCA9561:
+ case ATH79_SOC_TP9343:
mdio_dev = &ath79_mdio1_device;
mdio_data = &ath79_mdio1_data;
break;
@@ -256,6 +258,8 @@ void __init ath79_register_mdio(unsigned int id, u32 phy_mask)
break;
case ATH79_SOC_QCA9533:
+ case ATH79_SOC_QCA9561:
+ case ATH79_SOC_TP9343:
mdio_data->builtin_switch = 1;
break;
@@ -571,6 +575,8 @@ static void __init ath79_init_eth_pll_data(unsigned int id)
case ATH79_SOC_QCA9533:
case ATH79_SOC_QCA9556:
case ATH79_SOC_QCA9558:
+ case ATH79_SOC_QCA9561:
+ case ATH79_SOC_TP9343:
pll_10 = AR934X_PLL_VAL_10;
pll_100 = AR934X_PLL_VAL_100;
pll_1000 = AR934X_PLL_VAL_1000;
@@ -627,6 +633,8 @@ static int __init ath79_setup_phy_if_mode(unsigned int id,
case ATH79_SOC_AR9330:
case ATH79_SOC_AR9331:
case ATH79_SOC_QCA9533:
+ case ATH79_SOC_QCA9561:
+ case ATH79_SOC_TP9343:
pdata->phy_if_mode = PHY_INTERFACE_MODE_MII;
break;
@@ -687,7 +695,8 @@ static int __init ath79_setup_phy_if_mode(unsigned int id,
case ATH79_SOC_AR7241:
case ATH79_SOC_AR9330:
case ATH79_SOC_AR9331:
- case ATH79_SOC_QCA9533:
+ case ATH79_SOC_QCA9561:
+ case ATH79_SOC_TP9343:
pdata->phy_if_mode = PHY_INTERFACE_MODE_GMII;
break;
@@ -697,6 +706,7 @@ static int __init ath79_setup_phy_if_mode(unsigned int id,
case ATH79_SOC_AR9341:
case ATH79_SOC_AR9342:
case ATH79_SOC_AR9344:
+ case ATH79_SOC_QCA9533:
switch (pdata->phy_if_mode) {
case PHY_INTERFACE_MODE_MII:
case PHY_INTERFACE_MODE_GMII:
@@ -986,6 +996,7 @@ void __init ath79_register_eth(unsigned int id)
case ATH79_SOC_AR9341:
case ATH79_SOC_AR9342:
case ATH79_SOC_AR9344:
+ case ATH79_SOC_QCA9533:
if (id == 0) {
pdata->reset_bit = AR934X_RESET_GE0_MAC |
AR934X_RESET_GE0_MDIO;
@@ -1017,7 +1028,8 @@ void __init ath79_register_eth(unsigned int id)
pdata->fifo_cfg3 = 0x01f00140;
break;
- case ATH79_SOC_QCA9533:
+ case ATH79_SOC_QCA9561:
+ case ATH79_SOC_TP9343:
if (id == 0) {
pdata->reset_bit = AR933X_RESET_GE0_MAC |
AR933X_RESET_GE0_MDIO;
@@ -1123,6 +1135,8 @@ void __init ath79_register_eth(unsigned int id)
case ATH79_SOC_AR9330:
case ATH79_SOC_AR9331:
case ATH79_SOC_QCA9533:
+ case ATH79_SOC_QCA9561:
+ case ATH79_SOC_TP9343:
pdata->mii_bus_dev = &ath79_mdio1_device.dev;
break;
diff --git a/target/linux/ar71xx/patches-3.18/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch b/target/linux/ar71xx/patches-3.18/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch
index f3b4446..cf10af3 100644
--- a/target/linux/ar71xx/patches-3.18/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch
+++ b/target/linux/ar71xx/patches-3.18/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch
@@ -175,6 +175,48 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
soc_is_qca955x()) {
ath79_uart_data[0].uartclk = uart_clk_rate;
platform_device_register(&ath79_uart_device);
+--- a/arch/mips/ath79/dev-usb.c
++++ b/arch/mips/ath79/dev-usb.c
+@@ -236,6 +236,30 @@ static void __init ar934x_usb_setup(void
+ &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2));
+ }
+
++static void __init qca953x_usb_setup(void)
++{
++ u32 bootstrap;
++
++ bootstrap = ath79_reset_rr(QCA953X_RESET_REG_BOOTSTRAP);
++
++ ath79_device_reset_set(QCA953X_RESET_USBSUS_OVERRIDE);
++ udelay(1000);
++
++ ath79_device_reset_clear(QCA953X_RESET_USB_PHY);
++ udelay(1000);
++
++ ath79_device_reset_clear(QCA953X_RESET_USB_PHY_ANALOG);
++ udelay(1000);
++
++ ath79_device_reset_clear(QCA953X_RESET_USB_HOST);
++ udelay(1000);
++
++ ath79_usb_register("ehci-platform", -1,
++ QCA953X_EHCI_BASE, QCA953X_EHCI_SIZE,
++ ATH79_CPU_IRQ(3),
++ &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2));
++}
++
+ static void qca955x_usb_reset_notifier(struct platform_device *pdev)
+ {
+ u32 base;
+@@ -286,6 +310,8 @@ void __init ath79_register_usb(void)
+ ar933x_usb_setup();
+ else if (soc_is_ar934x())
+ ar934x_usb_setup();
++ else if (soc_is_qca953x())
++ qca953x_usb_setup();
+ else if (soc_is_qca955x())
+ qca955x_usb_setup();
+ else
--- a/arch/mips/ath79/dev-wmac.c
+++ b/arch/mips/ath79/dev-wmac.c
@@ -101,7 +101,7 @@ static int ar933x_wmac_reset(void)
@@ -207,8 +249,8 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
+
+ ath79_wmac_resources[0].start = QCA953X_WMAC_BASE;
+ ath79_wmac_resources[0].end = QCA953X_WMAC_BASE + QCA953X_WMAC_SIZE - 1;
-+ ath79_wmac_resources[1].start = ATH79_CPU_IRQ(2);
-+ ath79_wmac_resources[1].end = ATH79_CPU_IRQ(2);
++ ath79_wmac_resources[1].start = ATH79_IP2_IRQ(1);
++ ath79_wmac_resources[1].end = ATH79_IP2_IRQ(1);
+
+ t = ath79_reset_rr(QCA953X_RESET_REG_BOOTSTRAP);
+ if (t & QCA953X_BOOTSTRAP_REF_CLK_40)
@@ -244,6 +286,24 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
_prom_putchar = prom_putchar_ar71xx;
--- a/arch/mips/ath79/gpio.c
+++ b/arch/mips/ath79/gpio.c
+@@ -148,7 +148,7 @@ static void __iomem *ath79_gpio_get_func
+ soc_is_ar913x() ||
+ soc_is_ar933x())
+ reg = AR71XX_GPIO_REG_FUNC;
+- else if (soc_is_ar934x())
++ else if (soc_is_ar934x() || soc_is_qca953x())
+ reg = AR934X_GPIO_REG_FUNC;
+ else
+ BUG();
+@@ -187,7 +187,7 @@ void __init ath79_gpio_output_select(uns
+ unsigned int reg;
+ u32 t, s;
+
+- BUG_ON(!soc_is_ar934x());
++ BUG_ON(!soc_is_ar934x() && !soc_is_qca953x());
+
+ if (gpio >= AR934X_GPIO_COUNT)
+ return;
@@ -224,6 +224,8 @@ void __init ath79_gpio_init(void)
ath79_gpio_count = AR933X_GPIO_COUNT;
else if (soc_is_ar934x())
@@ -272,16 +332,77 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
soc_is_qca955x())
ath79_misc_irq_chip.irq_ack = ar724x_misc_irq_ack;
else
-@@ -352,6 +353,9 @@ void __init arch_init_irq(void)
+@@ -153,6 +154,38 @@ static void ar934x_ip2_irq_init(void)
+ irq_set_chained_handler(ATH79_CPU_IRQ(2), ar934x_ip2_irq_dispatch);
+ }
+
++static void qca953x_ip2_irq_dispatch(unsigned int irq, struct irq_desc *desc)
++{
++ u32 status;
++
++ disable_irq_nosync(irq);
++
++ status = ath79_reset_rr(QCA953X_RESET_REG_PCIE_WMAC_INT_STATUS);
++
++ if (status & QCA953X_PCIE_WMAC_INT_PCIE_ALL) {
++ ath79_ddr_wb_flush(QCA953X_DDR_REG_FLUSH_PCIE);
++ generic_handle_irq(ATH79_IP2_IRQ(0));
++ } else if (status & QCA953X_PCIE_WMAC_INT_WMAC_ALL) {
++ ath79_ddr_wb_flush(QCA953X_DDR_REG_FLUSH_WMAC);
++ generic_handle_irq(ATH79_IP2_IRQ(1));
++ } else {
++ spurious_interrupt();
++ }
++
++ enable_irq(irq);
++}
++
++static void qca953x_irq_init(void)
++{
++ int i;
++
++ for (i = ATH79_IP2_IRQ_BASE;
++ i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++)
++ irq_set_chip_and_handler(i, &dummy_irq_chip, handle_level_irq);
++
++ irq_set_chained_handler(ATH79_CPU_IRQ(2), qca953x_ip2_irq_dispatch);
++}
++
+ static void qca955x_ip2_irq_dispatch(unsigned int irq, struct irq_desc *desc)
+ {
+ u32 status;
+@@ -335,6 +368,12 @@ static void ar934x_ip3_handler(void)
+ do_IRQ(ATH79_CPU_IRQ(3));
+ }
+
++static void qca953x_ip3_handler(void)
++{
++ ath79_ddr_wb_flush(QCA953X_DDR_REG_FLUSH_USB);
++ do_IRQ(ATH79_CPU_IRQ(3));
++}
++
+ void __init arch_init_irq(void)
+ {
+ if (soc_is_ar71xx()) {
+@@ -352,6 +391,9 @@ void __init arch_init_irq(void)
} else if (soc_is_ar934x()) {
ath79_ip2_handler = ath79_default_ip2_handler;
ath79_ip3_handler = ar934x_ip3_handler;
+ } else if (soc_is_qca953x()) {
+ ath79_ip2_handler = ath79_default_ip2_handler;
-+ ath79_ip3_handler = ath79_default_ip3_handler;
++ ath79_ip3_handler = qca953x_ip3_handler;
} else if (soc_is_qca955x()) {
ath79_ip2_handler = ath79_default_ip2_handler;
ath79_ip3_handler = ath79_default_ip3_handler;
+@@ -365,6 +407,8 @@ void __init arch_init_irq(void)
+
+ if (soc_is_ar934x())
+ ar934x_ip2_irq_init();
++ else if (soc_is_qca953x())
++ qca953x_irq_init();
+ else if (soc_is_qca955x())
+ qca955x_irq_init();
+ }
--- a/arch/mips/ath79/setup.c
+++ b/arch/mips/ath79/setup.c
@@ -59,6 +59,7 @@ static void __init ath79_detect_sys_type
@@ -329,23 +450,49 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
pr_info("SoC: %s\n", ath79_sys_type);
--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
+++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
-@@ -105,6 +105,9 @@
+@@ -105,6 +105,21 @@
#define AR934X_SRIF_BASE (AR71XX_APB_BASE + 0x00116000)
#define AR934X_SRIF_SIZE 0x1000
++#define QCA953X_GMAC_BASE (AR71XX_APB_BASE + 0x00070000)
++#define QCA953X_GMAC_SIZE 0x14
+#define QCA953X_WMAC_BASE (AR71XX_APB_BASE + 0x00100000)
+#define QCA953X_WMAC_SIZE 0x20000
++#define QCA953X_EHCI_BASE 0x1b000000
++#define QCA953X_EHCI_SIZE 0x200
++#define QCA953X_SRIF_BASE (AR71XX_APB_BASE + 0x00116000)
++#define QCA953X_SRIF_SIZE 0x1000
++
++#define QCA953X_PCI_CFG_BASE0 0x14000000
++#define QCA953X_PCI_CTRL_BASE0 (AR71XX_APB_BASE + 0x000f0000)
++#define QCA953X_PCI_CRP_BASE0 (AR71XX_APB_BASE + 0x000c0000)
++#define QCA953X_PCI_MEM_BASE0 0x10000000
++#define QCA953X_PCI_MEM_SIZE 0x02000000
+
#define QCA955X_PCI_MEM_BASE0 0x10000000
#define QCA955X_PCI_MEM_BASE1 0x12000000
#define QCA955X_PCI_MEM_SIZE 0x02000000
-@@ -279,6 +282,43 @@
+@@ -173,6 +188,12 @@
+ #define AR934X_DDR_REG_FLUSH_PCIE 0xa8
+ #define AR934X_DDR_REG_FLUSH_WMAC 0xac
+
++#define QCA953X_DDR_REG_FLUSH_GE0 0x9c
++#define QCA953X_DDR_REG_FLUSH_GE1 0xa0
++#define QCA953X_DDR_REG_FLUSH_USB 0xa4
++#define QCA953X_DDR_REG_FLUSH_PCIE 0xa8
++#define QCA953X_DDR_REG_FLUSH_WMAC 0xac
++
+ /*
+ * PLL block
+ */
+@@ -279,6 +300,44 @@
#define AR934X_PLL_SWITCH_CLOCK_CONTROL_MDIO_CLK_SEL BIT(6)
+#define QCA953X_PLL_CPU_CONFIG_REG 0x00
+#define QCA953X_PLL_DDR_CONFIG_REG 0x04
+#define QCA953X_PLL_CLK_CTRL_REG 0x08
++#define QCA953X_PLL_SWITCH_CLOCK_CONTROL_REG 0x24
+#define QCA953X_PLL_ETH_XMII_CONTROL_REG 0x2c
+#define QCA953X_PLL_ETH_SGMII_CONTROL_REG 0x48
+
@@ -356,7 +503,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
+#define QCA953X_PLL_CPU_CONFIG_REFDIV_SHIFT 12
+#define QCA953X_PLL_CPU_CONFIG_REFDIV_MASK 0x1f
+#define QCA953X_PLL_CPU_CONFIG_OUTDIV_SHIFT 19
-+#define QCA953X_PLL_CPU_CONFIG_OUTDIV_MASK 0x3
++#define QCA953X_PLL_CPU_CONFIG_OUTDIV_MASK 0x7
+
+#define QCA953X_PLL_DDR_CONFIG_NFRAC_SHIFT 0
+#define QCA953X_PLL_DDR_CONFIG_NFRAC_MASK 0x3ff
@@ -383,27 +530,85 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
#define QCA955X_PLL_CPU_CONFIG_REG 0x00
#define QCA955X_PLL_DDR_CONFIG_REG 0x04
#define QCA955X_PLL_CLK_CTRL_REG 0x08
-@@ -355,6 +395,10 @@
+@@ -355,6 +414,10 @@
#define AR934X_RESET_REG_BOOTSTRAP 0xb0
#define AR934X_RESET_REG_PCIE_WMAC_INT_STATUS 0xac
+#define QCA953X_RESET_REG_RESET_MODULE 0x1c
+#define QCA953X_RESET_REG_BOOTSTRAP 0xb0
-+#define QCA953X_RESET_REG_EXT_INT_STATUS 0xac
++#define QCA953X_RESET_REG_PCIE_WMAC_INT_STATUS 0xac
+
#define QCA955X_RESET_REG_RESET_MODULE 0x1c
#define QCA955X_RESET_REG_BOOTSTRAP 0xb0
#define QCA955X_RESET_REG_EXT_INT_STATUS 0xac
-@@ -503,6 +547,8 @@
+@@ -450,6 +513,27 @@
+ #define AR934X_RESET_MBOX BIT(1)
+ #define AR934X_RESET_I2S BIT(0)
+
++#define QCA953X_RESET_USB_EXT_PWR BIT(29)
++#define QCA953X_RESET_EXTERNAL BIT(28)
++#define QCA953X_RESET_RTC BIT(27)
++#define QCA953X_RESET_FULL_CHIP BIT(24)
++#define QCA953X_RESET_GE1_MDIO BIT(23)
++#define QCA953X_RESET_GE0_MDIO BIT(22)
++#define QCA953X_RESET_CPU_NMI BIT(21)
++#define QCA953X_RESET_CPU_COLD BIT(20)
++#define QCA953X_RESET_DDR BIT(16)
++#define QCA953X_RESET_USB_PHY_PLL_PWD_EXT BIT(15)
++#define QCA953X_RESET_GE1_MAC BIT(13)
++#define QCA953X_RESET_ETH_SWITCH_ANALOG BIT(12)
++#define QCA953X_RESET_USB_PHY_ANALOG BIT(11)
++#define QCA953X_RESET_GE0_MAC BIT(9)
++#define QCA953X_RESET_ETH_SWITCH BIT(8)
++#define QCA953X_RESET_PCIE_PHY BIT(7)
++#define QCA953X_RESET_PCIE BIT(6)
++#define QCA953X_RESET_USB_HOST BIT(5)
++#define QCA953X_RESET_USB_PHY BIT(4)
++#define QCA953X_RESET_USBSUS_OVERRIDE BIT(3)
++
+ #define QCA955X_RESET_HOST BIT(31)
+ #define QCA955X_RESET_SLIC BIT(30)
+ #define QCA955X_RESET_HDMA BIT(29)
+@@ -503,6 +587,13 @@
#define AR934X_BOOTSTRAP_SDRAM_DISABLED BIT(1)
#define AR934X_BOOTSTRAP_DDR1 BIT(0)
++#define QCA953X_BOOTSTRAP_SW_OPTION2 BIT(12)
++#define QCA953X_BOOTSTRAP_SW_OPTION1 BIT(11)
++#define QCA953X_BOOTSTRAP_EJTAG_MODE BIT(5)
+#define QCA953X_BOOTSTRAP_REF_CLK_40 BIT(4)
++#define QCA953X_BOOTSTRAP_SDRAM_DISABLED BIT(1)
++#define QCA953X_BOOTSTRAP_DDR1 BIT(0)
+
#define QCA955X_BOOTSTRAP_REF_CLK_40 BIT(4)
#define AR934X_PCIE_WMAC_INT_WMAC_MISC BIT(0)
-@@ -565,6 +611,8 @@
+@@ -523,6 +614,24 @@
+ AR934X_PCIE_WMAC_INT_PCIE_RC1 | AR934X_PCIE_WMAC_INT_PCIE_RC2 | \
+ AR934X_PCIE_WMAC_INT_PCIE_RC3)
+
++#define QCA953X_PCIE_WMAC_INT_WMAC_MISC BIT(0)
++#define QCA953X_PCIE_WMAC_INT_WMAC_TX BIT(1)
++#define QCA953X_PCIE_WMAC_INT_WMAC_RXLP BIT(2)
++#define QCA953X_PCIE_WMAC_INT_WMAC_RXHP BIT(3)
++#define QCA953X_PCIE_WMAC_INT_PCIE_RC BIT(4)
++#define QCA953X_PCIE_WMAC_INT_PCIE_RC0 BIT(5)
++#define QCA953X_PCIE_WMAC_INT_PCIE_RC1 BIT(6)
++#define QCA953X_PCIE_WMAC_INT_PCIE_RC2 BIT(7)
++#define QCA953X_PCIE_WMAC_INT_PCIE_RC3 BIT(8)
++#define QCA953X_PCIE_WMAC_INT_WMAC_ALL \
++ (QCA953X_PCIE_WMAC_INT_WMAC_MISC | QCA953X_PCIE_WMAC_INT_WMAC_TX | \
++ QCA953X_PCIE_WMAC_INT_WMAC_RXLP | QCA953X_PCIE_WMAC_INT_WMAC_RXHP)
++
++#define QCA953X_PCIE_WMAC_INT_PCIE_ALL \
++ (QCA953X_PCIE_WMAC_INT_PCIE_RC | QCA953X_PCIE_WMAC_INT_PCIE_RC0 | \
++ QCA953X_PCIE_WMAC_INT_PCIE_RC1 | QCA953X_PCIE_WMAC_INT_PCIE_RC2 | \
++ QCA953X_PCIE_WMAC_INT_PCIE_RC3)
++
+ #define QCA955X_EXT_INT_WMAC_MISC BIT(0)
+ #define QCA955X_EXT_INT_WMAC_TX BIT(1)
+ #define QCA955X_EXT_INT_WMAC_RXLP BIT(2)
+@@ -565,6 +674,8 @@
#define REV_ID_MAJOR_AR9341 0x0120
#define REV_ID_MAJOR_AR9342 0x1120
#define REV_ID_MAJOR_AR9344 0x2120
@@ -412,7 +617,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
#define REV_ID_MAJOR_QCA9556 0x0130
#define REV_ID_MAJOR_QCA9558 0x1130
-@@ -587,6 +635,8 @@
+@@ -587,6 +698,8 @@
#define AR934X_REV_ID_REVISION_MASK 0xf
@@ -421,14 +626,81 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
#define QCA955X_REV_ID_REVISION_MASK 0xf
/*
-@@ -640,6 +690,7 @@
+@@ -634,12 +747,32 @@
+ #define AR934X_GPIO_REG_OUT_FUNC5 0x40
+ #define AR934X_GPIO_REG_FUNC 0x6c
+
++#define QCA953X_GPIO_REG_OUT_FUNC0 0x2c
++#define QCA953X_GPIO_REG_OUT_FUNC1 0x30
++#define QCA953X_GPIO_REG_OUT_FUNC2 0x34
++#define QCA953X_GPIO_REG_OUT_FUNC3 0x38
++#define QCA953X_GPIO_REG_OUT_FUNC4 0x3c
++#define QCA953X_GPIO_REG_IN_ENABLE0 0x44
++#define QCA953X_GPIO_REG_FUNC 0x6c
++
++#define QCA953X_GPIO_OUT_MUX_SPI_CS1 10
++#define QCA953X_GPIO_OUT_MUX_SPI_CS2 11
++#define QCA953X_GPIO_OUT_MUX_SPI_CS0 9
++#define QCA953X_GPIO_OUT_MUX_SPI_CLK 8
++#define QCA953X_GPIO_OUT_MUX_SPI_MOSI 12
++#define QCA953X_GPIO_OUT_MUX_LED_LINK1 41
++#define QCA953X_GPIO_OUT_MUX_LED_LINK2 42
++#define QCA953X_GPIO_OUT_MUX_LED_LINK3 43
++#define QCA953X_GPIO_OUT_MUX_LED_LINK4 44
++#define QCA953X_GPIO_OUT_MUX_LED_LINK5 45
++
+ #define AR71XX_GPIO_COUNT 16
+ #define AR7240_GPIO_COUNT 18
+ #define AR7241_GPIO_COUNT 20
#define AR913X_GPIO_COUNT 22
#define AR933X_GPIO_COUNT 30
#define AR934X_GPIO_COUNT 23
-+#define QCA953X_GPIO_COUNT 24
++#define QCA953X_GPIO_COUNT 18
#define QCA955X_GPIO_COUNT 24
/*
+@@ -663,6 +796,24 @@
+ #define AR934X_SRIF_DPLL2_OUTDIV_SHIFT 13
+ #define AR934X_SRIF_DPLL2_OUTDIV_MASK 0x7
+
++#define QCA953X_SRIF_CPU_DPLL1_REG 0x1c0
++#define QCA953X_SRIF_CPU_DPLL2_REG 0x1c4
++#define QCA953X_SRIF_CPU_DPLL3_REG 0x1c8
++
++#define QCA953X_SRIF_DDR_DPLL1_REG 0x240
++#define QCA953X_SRIF_DDR_DPLL2_REG 0x244
++#define QCA953X_SRIF_DDR_DPLL3_REG 0x248
++
++#define QCA953X_SRIF_DPLL1_REFDIV_SHIFT 27
++#define QCA953X_SRIF_DPLL1_REFDIV_MASK 0x1f
++#define QCA953X_SRIF_DPLL1_NINT_SHIFT 18
++#define QCA953X_SRIF_DPLL1_NINT_MASK 0x1ff
++#define QCA953X_SRIF_DPLL1_NFRAC_MASK 0x0003ffff
++
++#define QCA953X_SRIF_DPLL2_LOCAL_PLL BIT(30)
++#define QCA953X_SRIF_DPLL2_OUTDIV_SHIFT 13
++#define QCA953X_SRIF_DPLL2_OUTDIV_MASK 0x7
++
+ #define AR71XX_GPIO_FUNC_STEREO_EN BIT(17)
+ #define AR71XX_GPIO_FUNC_SLIC_EN BIT(16)
+ #define AR71XX_GPIO_FUNC_SPI_CS2_EN BIT(13)
+@@ -804,6 +955,16 @@
+ #define AR934X_ETH_CFG_RDV_DELAY_SHIFT 16
+
+ /*
++ * QCA953X GMAC Interface
++ */
++#define QCA953X_GMAC_REG_ETH_CFG 0x00
++
++#define QCA953X_ETH_CFG_SW_ONLY_MODE BIT(6)
++#define QCA953X_ETH_CFG_SW_PHY_SWAP BIT(7)
++#define QCA953X_ETH_CFG_SW_APB_ACCESS BIT(9)
++#define QCA953X_ETH_CFG_SW_ACC_MSB_FIRST BIT(13)
++
++/*
+ * QCA955X GMAC Interface
+ */
+
--- a/arch/mips/include/asm/mach-ath79/ath79.h
+++ b/arch/mips/include/asm/mach-ath79/ath79.h
@@ -32,6 +32,7 @@ enum ath79_soc_type {
diff --git a/target/linux/ar71xx/patches-3.18/735-MIPS-ath79-add-support-for-QCA956x-SoC.patch b/target/linux/ar71xx/patches-3.18/735-MIPS-ath79-add-support-for-QCA956x-SoC.patch
index ab2bc38..eecccdc 100644
--- a/target/linux/ar71xx/patches-3.18/735-MIPS-ath79-add-support-for-QCA956x-SoC.patch
+++ b/target/linux/ar71xx/patches-3.18/735-MIPS-ath79-add-support-for-QCA956x-SoC.patch
@@ -142,74 +142,9 @@
ath79_uart_data[0].uartclk = uart_clk_rate;
platform_device_register(&ath79_uart_device);
} else if (soc_is_ar933x()) {
---- a/arch/mips/ath79/dev-eth.c
-+++ b/arch/mips/ath79/dev-eth.c
-@@ -198,6 +198,8 @@ void __init ath79_register_mdio(unsigned
- case ATH79_SOC_AR9330:
- case ATH79_SOC_AR9331:
- case ATH79_SOC_QCA9533:
-+ case ATH79_SOC_QCA9561:
-+ case ATH79_SOC_TP9343:
- mdio_dev = &ath79_mdio1_device;
- mdio_data = &ath79_mdio1_data;
- break;
-@@ -256,6 +258,8 @@ void __init ath79_register_mdio(unsigned
- break;
-
- case ATH79_SOC_QCA9533:
-+ case ATH79_SOC_QCA9561:
-+ case ATH79_SOC_TP9343:
- mdio_data->builtin_switch = 1;
- break;
-
-@@ -571,6 +575,8 @@ static void __init ath79_init_eth_pll_da
- case ATH79_SOC_QCA9533:
- case ATH79_SOC_QCA9556:
- case ATH79_SOC_QCA9558:
-+ case ATH79_SOC_QCA9561:
-+ case ATH79_SOC_TP9343:
- pll_10 = AR934X_PLL_VAL_10;
- pll_100 = AR934X_PLL_VAL_100;
- pll_1000 = AR934X_PLL_VAL_1000;
-@@ -627,6 +633,8 @@ static int __init ath79_setup_phy_if_mod
- case ATH79_SOC_AR9330:
- case ATH79_SOC_AR9331:
- case ATH79_SOC_QCA9533:
-+ case ATH79_SOC_QCA9561:
-+ case ATH79_SOC_TP9343:
- pdata->phy_if_mode = PHY_INTERFACE_MODE_MII;
- break;
-
-@@ -688,6 +696,8 @@ static int __init ath79_setup_phy_if_mod
- case ATH79_SOC_AR9330:
- case ATH79_SOC_AR9331:
- case ATH79_SOC_QCA9533:
-+ case ATH79_SOC_QCA9561:
-+ case ATH79_SOC_TP9343:
- pdata->phy_if_mode = PHY_INTERFACE_MODE_GMII;
- break;
-
-@@ -1018,6 +1028,8 @@ void __init ath79_register_eth(unsigned
- break;
-
- case ATH79_SOC_QCA9533:
-+ case ATH79_SOC_QCA9561:
-+ case ATH79_SOC_TP9343:
- if (id == 0) {
- pdata->reset_bit = AR933X_RESET_GE0_MAC |
- AR933X_RESET_GE0_MDIO;
-@@ -1123,6 +1135,8 @@ void __init ath79_register_eth(unsigned
- case ATH79_SOC_AR9330:
- case ATH79_SOC_AR9331:
- case ATH79_SOC_QCA9533:
-+ case ATH79_SOC_QCA9561:
-+ case ATH79_SOC_TP9343:
- pdata->mii_bus_dev = &ath79_mdio1_device.dev;
- break;
-
--- a/arch/mips/ath79/dev-usb.c
+++ b/arch/mips/ath79/dev-usb.c
-@@ -272,6 +272,19 @@ static void __init qca955x_usb_setup(voi
+@@ -296,6 +296,19 @@ static void __init qca955x_usb_setup(voi
&ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2));
}
@@ -229,8 +164,8 @@
void __init ath79_register_usb(void)
{
if (soc_is_ar71xx())
-@@ -288,6 +301,8 @@ void __init ath79_register_usb(void)
- ar934x_usb_setup();
+@@ -314,6 +327,8 @@ void __init ath79_register_usb(void)
+ qca953x_usb_setup();
else if (soc_is_qca955x())
qca955x_usb_setup();
+ else if (soc_is_qca9561())
@@ -291,9 +226,9 @@
soc_is_ar913x() ||
soc_is_ar933x())
reg = AR71XX_GPIO_REG_FUNC;
-- else if (soc_is_ar934x())
+- else if (soc_is_ar934x() || soc_is_qca953x())
+ else if (soc_is_ar934x() ||
-+ soc_is_qca956x())
++ soc_is_qca953x() || soc_is_qca956x())
reg = AR934X_GPIO_REG_FUNC;
else
BUG();
@@ -326,7 +261,7 @@
ath79_misc_irq_chip.irq_ack = ar724x_misc_irq_ack;
else
BUG();
-@@ -236,6 +237,99 @@ static void qca955x_irq_init(void)
+@@ -268,6 +269,97 @@ static void qca955x_irq_init(void)
irq_set_chained_handler(ATH79_CPU_IRQ(3), qca955x_ip3_irq_dispatch);
}
@@ -406,15 +341,13 @@
+
+ for (i = ATH79_IP2_IRQ_BASE;
+ i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++)
-+ irq_set_chip_and_handler(i, &dummy_irq_chip,
-+ handle_level_irq);
++ irq_set_chip_and_handler(i, &dummy_irq_chip, handle_level_irq);
+
+ irq_set_chained_handler(ATH79_CPU_IRQ(2), qca956x_ip2_irq_dispatch);
+
+ for (i = ATH79_IP3_IRQ_BASE;
+ i < ATH79_IP3_IRQ_BASE + ATH79_IP3_IRQ_COUNT; i++)
-+ irq_set_chip_and_handler(i, &dummy_irq_chip,
-+ handle_level_irq);
++ irq_set_chip_and_handler(i, &dummy_irq_chip, handle_level_irq);
+
+ irq_set_chained_handler(ATH79_CPU_IRQ(3), qca956x_ip3_irq_dispatch);
+
@@ -426,7 +359,7 @@
asmlinkage void plat_irq_dispatch(void)
{
unsigned long pending;
-@@ -359,6 +453,9 @@ void __init arch_init_irq(void)
+@@ -397,6 +489,9 @@ void __init arch_init_irq(void)
} else if (soc_is_qca955x()) {
ath79_ip2_handler = ath79_default_ip2_handler;
ath79_ip3_handler = ath79_default_ip3_handler;
@@ -436,8 +369,8 @@
} else {
BUG();
}
-@@ -371,4 +468,6 @@ void __init arch_init_irq(void)
- ar934x_ip2_irq_init();
+@@ -411,4 +506,6 @@ void __init arch_init_irq(void)
+ qca953x_irq_init();
else if (soc_is_qca955x())
qca955x_irq_init();
+ else if (soc_is_qca956x())
@@ -554,7 +487,7 @@
pr_info("SoC: %s\n", ath79_sys_type);
--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
+++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
-@@ -131,6 +131,23 @@
+@@ -143,6 +143,23 @@
#define QCA955X_NFC_BASE 0x1b800200
#define QCA955X_NFC_SIZE 0xb8
@@ -578,7 +511,7 @@
#define AR9300_OTP_BASE 0x14000
#define AR9300_OTP_STATUS 0x15f18
#define AR9300_OTP_STATUS_TYPE 0x7
-@@ -356,6 +373,49 @@
+@@ -375,6 +392,49 @@
#define QCA955X_PLL_CLK_CTRL_DDRCLK_FROM_DDRPLL BIT(21)
#define QCA955X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24)
@@ -628,7 +561,7 @@
/*
* USB_CONFIG block
*/
-@@ -403,6 +463,11 @@
+@@ -422,6 +482,11 @@
#define QCA955X_RESET_REG_BOOTSTRAP 0xb0
#define QCA955X_RESET_REG_EXT_INT_STATUS 0xac
@@ -640,7 +573,7 @@
#define MISC_INT_ETHSW BIT(12)
#define MISC_INT_TIMER4 BIT(10)
#define MISC_INT_TIMER3 BIT(9)
-@@ -551,6 +616,8 @@
+@@ -596,6 +661,8 @@
#define QCA955X_BOOTSTRAP_REF_CLK_40 BIT(4)
@@ -649,7 +582,7 @@
#define AR934X_PCIE_WMAC_INT_WMAC_MISC BIT(0)
#define AR934X_PCIE_WMAC_INT_WMAC_TX BIT(1)
#define AR934X_PCIE_WMAC_INT_WMAC_RXLP BIT(2)
-@@ -600,6 +667,37 @@
+@@ -663,6 +730,37 @@
QCA955X_EXT_INT_PCIE_RC2_INT1 | QCA955X_EXT_INT_PCIE_RC2_INT2 | \
QCA955X_EXT_INT_PCIE_RC2_INT3)
@@ -687,7 +620,7 @@
#define REV_ID_MAJOR_MASK 0xfff0
#define REV_ID_MAJOR_AR71XX 0x00a0
#define REV_ID_MAJOR_AR913X 0x00b0
-@@ -615,6 +713,8 @@
+@@ -678,6 +776,8 @@
#define REV_ID_MAJOR_QCA9533_V2 0x0160
#define REV_ID_MAJOR_QCA9556 0x0130
#define REV_ID_MAJOR_QCA9558 0x1130
@@ -696,7 +629,7 @@
#define AR71XX_REV_ID_MINOR_MASK 0x3
#define AR71XX_REV_ID_MINOR_AR7130 0x0
-@@ -639,6 +739,8 @@
+@@ -702,6 +802,8 @@
#define QCA955X_REV_ID_REVISION_MASK 0xf
@@ -705,9 +638,9 @@
/*
* SPI block
*/
-@@ -684,6 +786,19 @@
- #define AR934X_GPIO_REG_OUT_FUNC5 0x40
- #define AR934X_GPIO_REG_FUNC 0x6c
+@@ -766,6 +868,19 @@
+ #define QCA953X_GPIO_OUT_MUX_LED_LINK4 44
+ #define QCA953X_GPIO_OUT_MUX_LED_LINK5 45
+#define QCA956X_GPIO_REG_OUT_FUNC0 0x2c
+#define QCA956X_GPIO_REG_OUT_FUNC1 0x30
@@ -725,9 +658,9 @@
#define AR71XX_GPIO_COUNT 16
#define AR7240_GPIO_COUNT 18
#define AR7241_GPIO_COUNT 20
-@@ -692,6 +807,7 @@
+@@ -774,6 +889,7 @@
#define AR934X_GPIO_COUNT 23
- #define QCA953X_GPIO_COUNT 24
+ #define QCA953X_GPIO_COUNT 18
#define QCA955X_GPIO_COUNT 24
+#define QCA956X_GPIO_COUNT 23
diff --git a/target/linux/ar71xx/patches-3.18/736-MIPS-ath79-fix-chained-irq-disable.patch b/target/linux/ar71xx/patches-3.18/736-MIPS-ath79-fix-chained-irq-disable.patch
index 8cb38d3..8c0cc95 100644
--- a/target/linux/ar71xx/patches-3.18/736-MIPS-ath79-fix-chained-irq-disable.patch
+++ b/target/linux/ar71xx/patches-3.18/736-MIPS-ath79-fix-chained-irq-disable.patch
@@ -19,7 +19,16 @@
irq_set_chained_handler(ATH79_CPU_IRQ(2), ar934x_ip2_irq_dispatch);
}
-@@ -224,15 +225,13 @@ static void qca955x_irq_init(void)
+@@ -182,7 +183,7 @@ static void qca953x_irq_init(void)
+
+ for (i = ATH79_IP2_IRQ_BASE;
+ i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++)
+- irq_set_chip_and_handler(i, &dummy_irq_chip, handle_level_irq);
++ irq_set_chip_and_handler(i, &ip2_chip, handle_level_irq);
+
+ irq_set_chained_handler(ATH79_CPU_IRQ(2), qca953x_ip2_irq_dispatch);
+ }
+@@ -256,15 +257,13 @@ static void qca955x_irq_init(void)
for (i = ATH79_IP2_IRQ_BASE;
i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++)
@@ -37,25 +46,23 @@
irq_set_chained_handler(ATH79_CPU_IRQ(3), qca955x_ip3_irq_dispatch);
}
-@@ -313,15 +312,13 @@ static void qca956x_irq_init(void)
+@@ -345,13 +344,13 @@ static void qca956x_irq_init(void)
for (i = ATH79_IP2_IRQ_BASE;
i < ATH79_IP2_IRQ_BASE + ATH79_IP2_IRQ_COUNT; i++)
-- irq_set_chip_and_handler(i, &dummy_irq_chip,
-- handle_level_irq);
+- irq_set_chip_and_handler(i, &dummy_irq_chip, handle_level_irq);
+ irq_set_chip_and_handler(i, &ip2_chip, handle_level_irq);
irq_set_chained_handler(ATH79_CPU_IRQ(2), qca956x_ip2_irq_dispatch);
for (i = ATH79_IP3_IRQ_BASE;
i < ATH79_IP3_IRQ_BASE + ATH79_IP3_IRQ_COUNT; i++)
-- irq_set_chip_and_handler(i, &dummy_irq_chip,
-- handle_level_irq);
+- irq_set_chip_and_handler(i, &dummy_irq_chip, handle_level_irq);
+ irq_set_chip_and_handler(i, &ip3_chip, handle_level_irq);
irq_set_chained_handler(ATH79_CPU_IRQ(3), qca956x_ip3_irq_dispatch);
-@@ -430,8 +427,35 @@ static void ar934x_ip3_handler(void)
+@@ -466,8 +465,35 @@ static void qca953x_ip3_handler(void)
do_IRQ(ATH79_CPU_IRQ(3));
}

View File

@ -1,44 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Fri, 7 Aug 2015 18:45:42 +0200
Subject: base-files: default_postinst: propagate the real postinst return code
Using the postinst script for sanity checks and expecting opkg to fail
if the postinst didn't return 0 was possible in Barrier Breaker, propagate
the real postinst return code through default_postinst to restore this
behaviour.
diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh
index 8d045fa..2f78d67 100755
--- a/package/base-files/files/lib/functions.sh
+++ b/package/base-files/files/lib/functions.sh
@@ -174,7 +174,8 @@ default_prerm() {
}
default_postinst() {
- local pkgname rusers
+ local pkgname rusers ret
+ ret=0
pkgname=$(basename ${1%.*})
rusers=$(grep "Require-User:" ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.control)
[ -n "$rusers" ] && {
@@ -215,7 +216,10 @@ default_postinst() {
done
}
- [ -f ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.postinst-pkg ] && ( . ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.postinst-pkg )
+ if [ -f ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.postinst-pkg ]; then
+ ( . ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.postinst-pkg )
+ ret=$?
+ fi
[ -n "${IPKG_INSTROOT}" ] || rm -f /tmp/luci-indexcache 2>/dev/null
[ "$PKG_UPGRADE" = "1" ] || for i in `cat ${IPKG_INSTROOT}/usr/lib/opkg/info/${pkgname}.list | grep "^/etc/init.d/"`; do
@@ -225,7 +229,7 @@ default_postinst() {
$i start
}
done
- return 0
+ return $ret
}
include() {

View File

@ -1,22 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Fri, 28 Aug 2015 10:43:55 +0200
Subject: opkg: work around unconditional libopenssl build dependency
As the OpenWrt build system only resolves build dependencies per directory,
all opkg variants were causing libopenssl to be downloaded and built,
not only opkg-smime. Fix this by applying the same workaround as in
ustream-ssl.
diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile
index 76688f5..3e39cf8 100644
--- a/package/system/opkg/Makefile
+++ b/package/system/opkg/Makefile
@@ -72,7 +72,7 @@ endef
define Package/opkg-smime
$(call Package/opkg/Default)
TITLE+= (with S/MIME signature support)
- DEPENDS+=+libopenssl
+ DEPENDS+=+PACKAGE_opkg-smime:libopenssl
VARIANT:=smime
endef

View File

@ -1,22 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Fri, 28 Aug 2015 10:46:11 +0200
Subject: hostapd: work around unconditional libopenssl build dependency
As the OpenWrt build system only resolves build dependencies per directory,
all hostapd variants were causing libopenssl to be downloaded and built,
not only wpad-mesh. Fix this by applying the same workaround as in
ustream-ssl.
diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile
index c16cb11..c39b6b4 100644
--- a/package/network/services/hostapd/Makefile
+++ b/package/network/services/hostapd/Makefile
@@ -177,7 +177,7 @@ endef
define Package/wpad-mesh
$(call Package/wpad/Default)
TITLE+= (with 802.11s mesh and SAE support)
- DEPENDS:=$(DRV_DEPENDS) +libubus +libopenssl +@CONFIG_WPA_SUPPLICANT_OPENSSL @(!TARGET_uml||BROKEN)
+ DEPENDS:=$(DRV_DEPENDS) +libubus +PACKAGE_wpad-mesh:libopenssl +@CONFIG_WPA_SUPPLICANT_OPENSSL @(!TARGET_uml||BROKEN)
CONFLICTS:=@WPA_SUPPLICANT_INTERNAL
VARIANT:=wpad-mesh
endef

View File

@ -1,77 +0,0 @@
From: Nils Schneider <nils@nilsschneider.net>
Date: Thu, 3 Sep 2015 18:07:17 +0200
Subject: odhcp6c: minor fixes
Better synchronize RA & DHCPv6 events
Accumulate some events to avoid flooding
Restart softwires for address and prefix changes
Signed-off-by: Steven Barth <steven@midlink.org>
diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile
index 75de54c..aa81e02 100644
--- a/package/network/ipv6/odhcp6c/Makefile
+++ b/package/network/ipv6/odhcp6c/Makefile
@@ -8,14 +8,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=odhcp6c
-PKG_VERSION:=2015-07-18
+PKG_VERSION:=2015-07-29
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/sbyx/odhcp6c.git
PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=024525798c5f6aba3af9b2ef7b3af2f3c14f1db8
+PKG_SOURCE_VERSION:=dc186d6d2b0dd4ad23ca5fc69c00e81f796ff6d9
PKG_MAINTAINER:=Steven Barth <steven@midlink.org>
PKG_LICENSE:=GPL-2.0
diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.script b/package/network/ipv6/odhcp6c/files/dhcpv6.script
index 33f6d9b..677d35f 100755
--- a/package/network/ipv6/odhcp6c/files/dhcpv6.script
+++ b/package/network/ipv6/odhcp6c/files/dhcpv6.script
@@ -5,6 +5,8 @@
setup_interface () {
local device="$1"
+ local prefsig=""
+ local addrsig=""
proto_init_update "*" 1
# Merge RA-DNS
@@ -34,6 +36,7 @@ setup_interface () {
for prefix in $PREFIXES; do
proto_add_ipv6_prefix "$prefix"
+ prefsig="$prefsig ${prefix%%,*}"
local entry="${prefix#*/}"
entry="${entry#*,}"
entry="${entry#*,}"
@@ -68,6 +71,7 @@ setup_interface () {
local valid="${entry%%,*}"
proto_add_ipv6_address "$addr" "$mask" "$preferred" "$valid" 1
+ addrsig="$addrsig $addr/$mask"
if [ -z "$RA_ADDRESSES" -a -z "$RA_ROUTES" -a \
-z "$RA_DNS" -a "$FAKE_ROUTES" = 1 ]; then
@@ -136,6 +140,8 @@ setup_interface () {
json_add_string ifname "@$INTERFACE"
json_add_string proto map
json_add_string type "$MAPTYPE"
+ json_add_string _prefsig "$prefsig"
+ [ "$MAPTYPE" = lw4o6 ] && json_add_string _addrsig "$addrsig"
json_add_string rule "$MAPRULE"
json_add_string tunlink "$INTERFACE"
[ -n "$ZONE_MAP" ] || ZONE_MAP=$ZONE
@@ -163,6 +169,7 @@ setup_interface () {
json_add_string ifname "@$INTERFACE"
json_add_string proto "464xlat"
json_add_string tunlink "$INTERFACE"
+ json_add_string _addrsig "$addrsig"
[ -n "$ZONE_464XLAT" ] || ZONE_464XLAT=$ZONE
[ -n "$ZONE_464XLAT" ] && json_add_string zone "$ZONE_464XLAT"
[ -n "$IFACE_464XLAT_DELEGATE" ] && json_add_boolean delegate "$IFACE_464XLAT_DELEGATE"

View File

@ -1,40 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Sun, 11 Oct 2015 18:13:35 +0200
Subject: base-files: add /etc/profile.d support
OpenWrt should support an optional /etc/profile.d directory like
most other Linux distributions. This allows packages to install
their own scripts into /etc/profile.d/ directory.
The file suffix should make clear, that these scripts
are (sourced) shell-snippets. If the user needs e.g. php or lua,
one must make sure that the interpreter is called.
The reverse failsafe test makes sure, that the effective returncode is 0.
A typcal usecase is the inclusion of private helpers,
special variables or aliases, which at the moment needs
patching the sourcecode and is not well maintainable.
Now the builder can simply add there files.
v1 initial work of Hendrik Lüth <hendrik@linux-nerds.de>
v2 changes regarding RFC (e.g. thomas.langer@lantiq.com)
v3 changes regarding RFC (e.g. mschiffer@universe-factory.net)
v4 keep it simple and mimic OpenWrt style
Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com>
diff --git a/package/base-files/files/etc/profile b/package/base-files/files/etc/profile
index 170f487..bd008a8 100644
--- a/package/base-files/files/etc/profile
+++ b/package/base-files/files/etc/profile
@@ -14,3 +14,10 @@ export PS1='\u@\h:\w\$ '
[ -x /usr/bin/arp ] || arp() { cat /proc/net/arp; }
[ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
+
+[ -n "$FAILSAFE" ] || {
+ for FILE in /etc/profile.d/*.sh; do
+ [ -e "$FILE" ] && . "$FILE"
+ done
+ unset FILE
+}

View File

@ -1,49 +0,0 @@
From: Andre Kasper <andre.kasper@gmx.de>
Date: Mon, 12 Oct 2015 02:31:05 +0200
Subject: Kernel: Realtek 8150 and Realtek 8152 based USB-to-Ethernet converters
This patch adds the kernel modules to for the very common Realtek RTL8150 and Realtek 8152 based USB-to-Ethernet converters.
After this patch the following packages can be added to targets (or site.mk):
kmod-usb-net-rtl8150
kmod-usb-net-rtl8152
The modules are already available in openwrt trunk, but not in Chaos Calmer. This patch is just a temporary backport.
The modules are needed for Futros with additional USB-Ethernet-Interface and VMs with dedicated USB-NIC
diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk
index d1ff455..86f452e 100644
--- a/package/kernel/linux/modules/usb.mk
+++ b/package/kernel/linux/modules/usb.mk
@@ -1554,3 +1554,32 @@ define KernelPackage/usb3/description
endef
$(eval $(call KernelPackage,usb3))
+
+define KernelPackage/usb-net-rtl8150
+ TITLE:=Kernel module for USB-to-Ethernet Realtek convertors
+ KCONFIG:=CONFIG_USB_RTL8150
+ FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/rtl8150.ko
+ AUTOLOAD:=$(call AutoProbe,rtl8150)
+ $(call AddDepends/usb-net)
+endef
+
+define KernelPackage/usb-net-rtl8150/description
+ Kernel module for USB-to-Ethernet Realtek 8150 convertors
+endef
+
+$(eval $(call KernelPackage,usb-net-rtl8150))
+
+
+define KernelPackage/usb-net-rtl8152
+ TITLE:=Kernel module for USB-to-Ethernet Realtek convertors
+ KCONFIG:=CONFIG_USB_RTL8152
+ FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/r8152.ko
+ AUTOLOAD:=$(call AutoProbe,r8152)
+ $(call AddDepends/usb-net)
+endef
+
+define KernelPackage/usb-net-rtl8152/description
+ Kernel module for USB-to-Ethernet Realtek 8152 USB2.0/3.0 convertors
+endef
+
+$(eval $(call KernelPackage,usb-net-rtl8152))

View File

@ -1,107 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 15 Oct 2015 20:03:51 +0200
Subject: tools/firmware-utils: tplink-safeloader: clean up code
There is no reason for the internal functions not to be static.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c
index 9c5bb54..4607a1d 100644
--- a/tools/firmware-utils/src/tplink-safeloader.c
+++ b/tools/firmware-utils/src/tplink-safeloader.c
@@ -152,7 +152,7 @@ static const unsigned char cpe510_support_list[] =
/** Allocates a new image partition */
-struct image_partition_entry alloc_image_partition(const char *name, size_t len) {
+static struct image_partition_entry alloc_image_partition(const char *name, size_t len) {
struct image_partition_entry entry = {name, len, malloc(len)};
if (!entry.data)
error(1, errno, "malloc");
@@ -161,12 +161,12 @@ struct image_partition_entry alloc_image_partition(const char *name, size_t len)
}
/** Frees an image partition */
-void free_image_partition(struct image_partition_entry entry) {
+static void free_image_partition(struct image_partition_entry entry) {
free(entry.data);
}
/** Generates the partition-table partition */
-struct image_partition_entry make_partition_table(const struct flash_partition_entry *p) {
+static struct image_partition_entry make_partition_table(const struct flash_partition_entry *p) {
struct image_partition_entry entry = alloc_image_partition("partition-table", 0x800);
char *s = (char *)entry.data, *end = (char *)(s+entry.size);
@@ -202,7 +202,7 @@ static inline uint8_t bcd(uint8_t v) {
/** Generates the soft-version partition */
-struct image_partition_entry make_soft_version(uint32_t rev) {
+static struct image_partition_entry make_soft_version(uint32_t rev) {
struct image_partition_entry entry = alloc_image_partition("soft-version", sizeof(struct soft_version));
struct soft_version *s = (struct soft_version *)entry.data;
@@ -233,14 +233,14 @@ struct image_partition_entry make_soft_version(uint32_t rev) {
}
/** Generates the support-list partition */
-struct image_partition_entry make_support_list(const unsigned char *support_list, size_t len) {
+static struct image_partition_entry make_support_list(const unsigned char *support_list, size_t len) {
struct image_partition_entry entry = alloc_image_partition("support-list", len);
memcpy(entry.data, support_list, len);
return entry;
}
/** Creates a new image partition with an arbitrary name from a file */
-struct image_partition_entry read_file(const char *part_name, const char *filename, bool add_jffs2_eof) {
+static struct image_partition_entry read_file(const char *part_name, const char *filename, bool add_jffs2_eof) {
struct stat statbuf;
if (stat(filename, &statbuf) < 0)
@@ -300,7 +300,7 @@ struct image_partition_entry read_file(const char *part_name, const char *filena
I think partition-table must be the first partition in the firmware image.
*/
-void put_partitions(uint8_t *buffer, const struct image_partition_entry *parts) {
+static void put_partitions(uint8_t *buffer, const struct image_partition_entry *parts) {
size_t i;
char *image_pt = (char *)buffer, *end = image_pt + 0x800;
@@ -325,7 +325,7 @@ void put_partitions(uint8_t *buffer, const struct image_partition_entry *parts)
}
/** Generates and writes the image MD5 checksum */
-void put_md5(uint8_t *md5, uint8_t *buffer, unsigned int len) {
+static void put_md5(uint8_t *md5, uint8_t *buffer, unsigned int len) {
MD5_CTX ctx;
MD5_Init(&ctx);
@@ -349,7 +349,7 @@ void put_md5(uint8_t *md5, uint8_t *buffer, unsigned int len) {
1014-1813 Image partition table (2048 bytes, padded with 0xff)
1814-xxxx Firmware partitions
*/
-void * generate_factory_image(const unsigned char *vendor, size_t vendor_len, const struct image_partition_entry *parts, size_t *len) {
+static void * generate_factory_image(const unsigned char *vendor, size_t vendor_len, const struct image_partition_entry *parts, size_t *len) {
*len = 0x1814;
size_t i;
@@ -381,7 +381,7 @@ void * generate_factory_image(const unsigned char *vendor, size_t vendor_len, co
should be generalized when TP-LINK starts building its safeloader into hardware with
different flash layouts.
*/
-void * generate_sysupgrade_image(const struct flash_partition_entry *flash_parts, const struct image_partition_entry *image_parts, size_t *len) {
+static void * generate_sysupgrade_image(const struct flash_partition_entry *flash_parts, const struct image_partition_entry *image_parts, size_t *len) {
const struct flash_partition_entry *flash_os_image = &flash_parts[5];
const struct flash_partition_entry *flash_soft_version = &flash_parts[6];
const struct flash_partition_entry *flash_support_list = &flash_parts[7];
@@ -459,7 +459,7 @@ static void do_cpe510(const char *output, const char *kernel_image, const char *
/** Usage output */
-void usage(const char *argv0) {
+static void usage(const char *argv0) {
fprintf(stderr,
"Usage: %s [OPTIONS...]\n"
"\n"

View File

@ -1,126 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 15 Oct 2015 21:01:25 +0200
Subject: tools/firmware-utils: tplink-safeloader: fix support-list format, clean up vendor information
The first 4 bytes of the support list and the vendor information are
supposed to contain the length of these fields.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c
index 4607a1d..66658aa 100644
--- a/tools/firmware-utils/src/tplink-safeloader.c
+++ b/tools/firmware-utils/src/tplink-safeloader.c
@@ -103,7 +103,7 @@ static const uint8_t md5_salt[16] = {
/** Vendor information for CPE210/220/510/520 */
-static const unsigned char cpe510_vendor[] = "\x00\x00\x00\x1f""CPE510(TP-LINK|UN|N300-5):1.0\r\n";
+static const char cpe510_vendor[] = "CPE510(TP-LINK|UN|N300-5):1.0\r\n";
/**
@@ -133,14 +133,13 @@ static const struct flash_partition_entry cpe510_partitions[] = {
The stock images also contain strings for two more devices: BS510 and BS210.
At the moment, there exists no public information about these devices.
*/
-static const unsigned char cpe510_support_list[] =
- "\x00\x00\x00\xc8\x00\x00\x00\x00"
+static const char cpe510_support_list[] =
"SupportList:\r\n"
"CPE510(TP-LINK|UN|N300-5):1.0\r\n"
"CPE520(TP-LINK|UN|N300-5):1.0\r\n"
"CPE210(TP-LINK|UN|N300-2):1.0\r\n"
"CPE220(TP-LINK|UN|N300-2):1.0\r\n"
- "\r\n\xff";
+ "\r\n";
#define error(_ret, _errno, _str, ...) \
do { \
@@ -151,6 +150,14 @@ static const unsigned char cpe510_support_list[] =
} while (0)
+/** Stores a uint32 as big endian */
+static inline void put32(uint8_t *buf, uint32_t val) {
+ buf[0] = val >> 24;
+ buf[1] = val >> 16;
+ buf[2] = val >> 8;
+ buf[3] = val;
+}
+
/** Allocates a new image partition */
static struct image_partition_entry alloc_image_partition(const char *name, size_t len) {
struct image_partition_entry entry = {name, len, malloc(len)};
@@ -233,9 +240,15 @@ static struct image_partition_entry make_soft_version(uint32_t rev) {
}
/** Generates the support-list partition */
-static struct image_partition_entry make_support_list(const unsigned char *support_list, size_t len) {
- struct image_partition_entry entry = alloc_image_partition("support-list", len);
- memcpy(entry.data, support_list, len);
+static struct image_partition_entry make_support_list(const char *support_list) {
+ size_t len = strlen(support_list);
+ struct image_partition_entry entry = alloc_image_partition("support-list", len + 9);
+
+ put32(entry.data, len);
+ memset(entry.data+4, 0, 4);
+ memcpy(entry.data+8, support_list, len);
+ entry.data[len+8] = '\xff';
+
return entry;
}
@@ -344,12 +357,13 @@ static void put_md5(uint8_t *md5, uint8_t *buffer, unsigned int len) {
----------- -----
0000-0003 Image size (4 bytes, big endian)
0004-0013 MD5 hash (hash of a 16 byte salt and the image data starting with byte 0x14)
- 0014-1013 Vendor information (4096 bytes, padded with 0xff; there seem to be older
+ 0014-0017 Vendor information length (without padding) (4 bytes, big endian)
+ 0018-1013 Vendor information (4092 bytes, padded with 0xff; there seem to be older
(VxWorks-based) TP-LINK devices which use a smaller vendor information block)
1014-1813 Image partition table (2048 bytes, padded with 0xff)
1814-xxxx Firmware partitions
*/
-static void * generate_factory_image(const unsigned char *vendor, size_t vendor_len, const struct image_partition_entry *parts, size_t *len) {
+static void * generate_factory_image(const char *vendor, const struct image_partition_entry *parts, size_t *len) {
*len = 0x1814;
size_t i;
@@ -360,13 +374,12 @@ static void * generate_factory_image(const unsigned char *vendor, size_t vendor_
if (!image)
error(1, errno, "malloc");
- image[0] = *len >> 24;
- image[1] = *len >> 16;
- image[2] = *len >> 8;
- image[3] = *len;
+ put32(image, *len);
- memcpy(image+0x14, vendor, vendor_len);
- memset(image+0x14+vendor_len, 0xff, 4096-vendor_len);
+ size_t vendor_len = strlen(vendor);
+ put32(image+0x14, vendor_len);
+ memcpy(image+0x18, vendor, vendor_len);
+ memset(image+0x18+vendor_len, 0xff, 4092-vendor_len);
put_partitions(image + 0x1014, parts);
put_md5(image+0x04, image+0x14, *len-0x14);
@@ -430,7 +443,7 @@ static void do_cpe510(const char *output, const char *kernel_image, const char *
parts[0] = make_partition_table(cpe510_partitions);
parts[1] = make_soft_version(rev);
- parts[2] = make_support_list(cpe510_support_list, sizeof(cpe510_support_list)-1);
+ parts[2] = make_support_list(cpe510_support_list);
parts[3] = read_file("os-image", kernel_image, false);
parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof);
@@ -439,7 +452,7 @@ static void do_cpe510(const char *output, const char *kernel_image, const char *
if (sysupgrade)
image = generate_sysupgrade_image(cpe510_partitions, parts, &len);
else
- image = generate_factory_image(cpe510_vendor, sizeof(cpe510_vendor)-1, parts, &len);
+ image = generate_factory_image(cpe510_vendor, parts, &len);
FILE *file = fopen(output, "wb");
if (!file)

View File

@ -1,38 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 15 Oct 2015 21:56:40 +0200
Subject: tools/firmware-utils: tplink-safeloader: add version 1.1 support to CPE210/220/510/520
The hardware is identical to version 1.0, add the new models to the support
list.
Also remove the empty line at the end of the support list, the current
stock images don't have it either.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c
index 66658aa..77a894b 100644
--- a/tools/firmware-utils/src/tplink-safeloader.c
+++ b/tools/firmware-utils/src/tplink-safeloader.c
@@ -129,17 +129,17 @@ static const struct flash_partition_entry cpe510_partitions[] = {
/**
The support list for CPE210/220/510/520
-
- The stock images also contain strings for two more devices: BS510 and BS210.
- At the moment, there exists no public information about these devices.
*/
static const char cpe510_support_list[] =
"SupportList:\r\n"
"CPE510(TP-LINK|UN|N300-5):1.0\r\n"
+ "CPE510(TP-LINK|UN|N300-5):1.1\r\n"
"CPE520(TP-LINK|UN|N300-5):1.0\r\n"
+ "CPE520(TP-LINK|UN|N300-5):1.1\r\n"
"CPE210(TP-LINK|UN|N300-2):1.0\r\n"
+ "CPE210(TP-LINK|UN|N300-2):1.1\r\n"
"CPE220(TP-LINK|UN|N300-2):1.0\r\n"
- "\r\n";
+ "CPE220(TP-LINK|UN|N300-2):1.1\r\n";
#define error(_ret, _errno, _str, ...) \
do { \

View File

@ -1,330 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Mon, 2 Nov 2015 19:21:20 +0100
Subject: ar71xx: add support for TP-LINK TL-WR941ND v6 (international version)
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 89fe53c..3e80c32 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -279,7 +279,8 @@ get_status_led() {
tl-wdr4300 | \
tl-wr703n | \
tl-wr710n | \
- tl-wr720n-v3)
+ tl-wr720n-v3 | \
+ tl-wr941nd-v6)
status_led="tp-link:blue:system"
;;
tl-wr841n-v9)
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
index 5241db2..11b3fa0 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -460,6 +460,15 @@ tl-wr941nd-v5)
ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
;;
+tl-wr941nd-v6)
+ ucidef_set_led_netdev "wan" "WAN" "tp-link:blue:wan" "eth0"
+ ucidef_set_led_switch "lan1" "LAN1" "tp-link:blue:lan1" "switch0" "0x10"
+ ucidef_set_led_switch "lan2" "LAN2" "tp-link:blue:lan2" "switch0" "0x08"
+ ucidef_set_led_switch "lan3" "LAN3" "tp-link:blue:lan3" "switch0" "0x04"
+ ucidef_set_led_switch "lan4" "LAN4" "tp-link:blue:lan4" "switch0" "0x02"
+ ucidef_set_led_wlan "wlan" "WLAN" "tp-link:blue:wlan" "phy0tpt"
+ ;;
+
tl-wa830re-v2)
ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
index 8143d2d..5a74461 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -226,6 +226,7 @@ tl-mr3420-v2 |\
tl-wr841n-v8 |\
tl-wr842n-v2 |\
tl-wr941nd-v5 |\
+tl-wr941nd-v6 |\
wnr2000-v3 |\
wnr2000-v4 |\
wnr2200 |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 0b2857d..46af69a 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -800,6 +800,9 @@ ar71xx_board_detect() {
*"TL-WR941N/ND v5")
name="tl-wr941nd-v5"
;;
+ *"TL-WR941N/ND v6")
+ name="tl-wr941nd-v6"
+ ;;
*"TL-WR703N v1")
name="tl-wr703n"
;;
diff --git a/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx b/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx
index f11ea8c..fd337e1 100644
--- a/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx
+++ b/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx
@@ -35,6 +35,7 @@ set_preinit_iface() {
tl-wr720n-v3 |\
tl-wr841n-v8 |\
tl-wr842n-v2 |\
+ tl-wr941nd-v6 |\
wnr2000-v3 |\
wnr2200 |\
wnr612-v2 |\
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 8dea48f..2fc1d10 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -354,6 +354,7 @@ platform_check_image() {
tl-wr842n-v2 | \
tl-wr941nd | \
tl-wr941nd-v5 | \
+ tl-wr941nd-v6 | \
tl-wr1041n-v2 | \
tl-wr1043nd | \
tl-wr1043nd-v2 | \
diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18
index e9b3c7c..84b5844 100644
--- a/target/linux/ar71xx/config-3.18
+++ b/target/linux/ar71xx/config-3.18
@@ -132,6 +132,7 @@ CONFIG_ATH79_MACH_TL_WR841N_V1=y
CONFIG_ATH79_MACH_TL_WR841N_V8=y
CONFIG_ATH79_MACH_TL_WR841N_V9=y
CONFIG_ATH79_MACH_TL_WR941ND=y
+CONFIG_ATH79_MACH_TL_WR941ND_V6=y
CONFIG_ATH79_MACH_TUBE2H=y
CONFIG_ATH79_MACH_UBNT=y
CONFIG_ATH79_MACH_UBNT_XM=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c
new file mode 100644
index 0000000..8c788e2
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941nd-v6.c
@@ -0,0 +1,149 @@
+/*
+ * TP-LINK TL-WR941N/ND v6 board support
+ *
+ * Copyright (C) 2015 Matthias Schiffer <mschiffer@universe-factory.net>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ */
+
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+
+#include <asm/mach-ath79/ath79.h>
+#include <asm/mach-ath79/ar71xx_regs.h>
+
+#include "common.h"
+#include "dev-eth.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+
+
+#define TL_WR941ND_V6_GPIO_LED_QSS 3
+#define TL_WR941ND_V6_GPIO_LED_WAN 14
+#define TL_WR941ND_V6_GPIO_LED_WAN_RED 15
+#define TL_WR941ND_V6_GPIO_LED_LAN1 7
+#define TL_WR941ND_V6_GPIO_LED_LAN2 6
+#define TL_WR941ND_V6_GPIO_LED_LAN3 5
+#define TL_WR941ND_V6_GPIO_LED_LAN4 4
+#define TL_WR941ND_V6_GPIO_LED_WLAN 8
+#define TL_WR941ND_V6_GPIO_LED_SYSTEM 18
+
+#define TL_WR941ND_V6_GPIO_BTN_RESET 1
+#define TL_WR941ND_V6_GPIO_BTN_RFKILL 2
+
+#define TL_WR941ND_V6_KEYS_POLL_INTERVAL 20
+#define TL_WR941ND_V6_KEYS_DEBOUNCE_INTERVAL (3 * TL_WR941ND_V6_KEYS_POLL_INTERVAL)
+
+
+static struct gpio_led tl_wr941nd_v6_leds_gpio[] __initdata = {
+ {
+ .name = "tp-link:blue:qss",
+ .gpio = TL_WR941ND_V6_GPIO_LED_QSS,
+ .active_low = 1,
+ },
+ {
+ .name = "tp-link:blue:wan",
+ .gpio = TL_WR941ND_V6_GPIO_LED_WAN,
+ .active_low = 1,
+ },
+ {
+ .name = "tp-link:red:wan",
+ .gpio = TL_WR941ND_V6_GPIO_LED_WAN_RED,
+ .active_low = 0,
+ },
+ {
+ .name = "tp-link:blue:lan1",
+ .gpio = TL_WR941ND_V6_GPIO_LED_LAN1,
+ .active_low = 1,
+ },
+ {
+ .name = "tp-link:blue:lan2",
+ .gpio = TL_WR941ND_V6_GPIO_LED_LAN2,
+ .active_low = 1,
+ },
+ {
+ .name = "tp-link:blue:lan3",
+ .gpio = TL_WR941ND_V6_GPIO_LED_LAN3,
+ .active_low = 1,
+ },
+ {
+ .name = "tp-link:blue:lan4",
+ .gpio = TL_WR941ND_V6_GPIO_LED_LAN4,
+ .active_low = 1,
+ },
+ {
+ .name = "tp-link:blue:wlan",
+ .gpio = TL_WR941ND_V6_GPIO_LED_WLAN,
+ .active_low = 1,
+ },
+ {
+ .name = "tp-link:blue:system",
+ .gpio = TL_WR941ND_V6_GPIO_LED_SYSTEM,
+ .active_low = 1,
+ },
+};
+
+static struct gpio_keys_button tl_wr941nd_v6_gpio_keys[] __initdata = {
+ {
+ .desc = "Reset button",
+ .type = EV_KEY,
+ .code = KEY_RESTART,
+ .debounce_interval = TL_WR941ND_V6_KEYS_DEBOUNCE_INTERVAL,
+ .gpio = TL_WR941ND_V6_GPIO_BTN_RESET,
+ .active_low = 1,
+ }, {
+ .desc = "RFKILL button",
+ .type = EV_KEY,
+ .code = KEY_RFKILL,
+ .debounce_interval = TL_WR941ND_V6_KEYS_DEBOUNCE_INTERVAL,
+ .gpio = TL_WR941ND_V6_GPIO_BTN_RFKILL,
+ .active_low = 1,
+ }
+};
+
+
+static const char *tl_wr941n_v6_part_probes[] = {
+ "tp-link",
+ NULL,
+};
+
+static struct flash_platform_data tl_wr941n_v6_flash_data = {
+ .part_probes = tl_wr941n_v6_part_probes,
+};
+
+
+static void __init tl_wr941nd_v6_setup(void)
+{
+ u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
+ u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
+
+ ath79_register_m25p80(&tl_wr941n_v6_flash_data);
+
+ ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr941nd_v6_leds_gpio),
+ tl_wr941nd_v6_leds_gpio);
+
+ ath79_register_gpio_keys_polled(-1, TL_WR941ND_V6_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(tl_wr941nd_v6_gpio_keys),
+ tl_wr941nd_v6_gpio_keys);
+
+ ath79_register_mdio(0, 0x0);
+
+ ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);
+ ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1);
+
+ ath79_switch_data.phy4_mii_en = 1;
+
+ ath79_register_eth(0);
+ ath79_register_eth(1);
+
+ ath79_register_wmac(ee, mac);
+
+}
+
+MIPS_MACHINE(ATH79_MACH_TL_WR941ND_V6, "TL-WR941ND-v6", "TP-LINK TL-WR941N/ND v6",
+ tl_wr941nd_v6_setup);
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 78d35e1..11fb568 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -600,7 +600,7 @@ endef
define Device/tl-wr941nd-v6
$(Device/tplink-4mlzma)
- BOARDNAME := TL-WDR3500
+ BOARDNAME := TL-WR941ND-v6
DEVICE_PROFILE := TLWR941
TPLINK_HWID := 0x09410006
endef
diff --git a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch
index 2fa041b..185cb9c 100644
--- a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch
+++ b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch
@@ -1,6 +1,6 @@
--- a/arch/mips/ath79/machtypes.h
+++ b/arch/mips/ath79/machtypes.h
-@@ -16,22 +16,197 @@
+@@ -16,22 +16,198 @@
enum ath79_mach_type {
ATH79_MACH_GENERIC = 0,
@@ -148,6 +148,7 @@
+ ATH79_MACH_TL_WR842N_V2, /* TP-LINK TL-WR842N/ND v2 */
+ ATH79_MACH_TL_WR941ND, /* TP-LINK TL-WR941ND */
+ ATH79_MACH_TL_WR941ND_V5, /* TP-LINK TL-WR941ND v5 */
++ ATH79_MACH_TL_WR941ND_V6, /* TP-LINK TL-WR941ND v6 */
+ ATH79_MACH_TUBE2H, /* Alfa Network Tube2H */
+ ATH79_MACH_UBNT_AIRGW, /* Ubiquiti AirGateway */
ATH79_MACH_UBNT_AIRROUTER, /* Ubiquiti AirRouter */
@@ -271,7 +272,7 @@
config ATH79_MACH_AP121
bool "Atheros AP121 reference board"
select SOC_AR933X
-@@ -11,62 +75,1041 @@ config ATH79_MACH_AP121
+@@ -11,62 +75,1050 @@ config ATH79_MACH_AP121
select ATH79_DEV_M25P80
select ATH79_DEV_USB
select ATH79_DEV_WMAC
@@ -1246,6 +1247,15 @@
+ select ATH79_DEV_M25P80
+ select ATH79_DEV_WMAC
+
++config ATH79_MACH_TL_WR941ND_V6
++ bool "TP-LINK TL-WR941ND v6 support"
++ select SOC_QCA956X
++ select ATH79_DEV_ETH
++ select ATH79_DEV_GPIO_BUTTONS
++ select ATH79_DEV_LEDS_GPIO
++ select ATH79_DEV_M25P80
++ select ATH79_DEV_WMAC
++
+config ATH79_MACH_TL_WR1041N_V2
+ bool "TP-LINK TL-WR1041N v2 support"
+ select SOC_AR934X
@@ -1474,7 +1484,7 @@
endif
--- a/arch/mips/ath79/Makefile
+++ b/arch/mips/ath79/Makefile
-@@ -38,9 +38,126 @@ obj-$(CONFIG_ATH79_ROUTERBOOT) += route
+@@ -38,9 +38,127 @@ obj-$(CONFIG_ATH79_ROUTERBOOT) += route
#
# Machines
#
@@ -1566,6 +1576,7 @@
+obj-$(CONFIG_ATH79_MACH_TL_WR841N_V8) += mach-tl-wr841n-v8.o
+obj-$(CONFIG_ATH79_MACH_TL_WR841N_V9) += mach-tl-wr841n-v9.o
+obj-$(CONFIG_ATH79_MACH_TL_WR941ND) += mach-tl-wr941nd.o
++obj-$(CONFIG_ATH79_MACH_TL_WR941ND_V6) += mach-tl-wr941nd-v6.o
+obj-$(CONFIG_ATH79_MACH_TL_WR1041N_V2) += mach-tl-wr1041n-v2.o
+obj-$(CONFIG_ATH79_MACH_TL_WR1043ND) += mach-tl-wr1043nd.o
+obj-$(CONFIG_ATH79_MACH_TL_WR1043ND_V2) += mach-tl-wr1043nd-v2.o

View File

@ -1,25 +0,0 @@
From: Andreas Ziegler <github@andreas-ziegler.de>
Date: Thu, 5 Nov 2015 15:48:09 +0100
Subject: ar71xx: add support for TP-Link TL-WR1043ND v3
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 11fb568..dd224d4 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -2023,6 +2023,7 @@ $(eval $(call SingleProfile,TPLINK,64kraw,TLWR941NV4,tl-wr941nd-v4,TL-WR741ND,tt
$(eval $(call SingleProfile,TPLINK,64kraw,TLWR1043V1,tl-wr1043nd-v1,TL-WR1043ND,ttyS0,115200,0x10430001,1,8M))
$(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR1043V2,tl-wr1043nd-v2,TL-WR1043ND-v2,ttyS0,115200,0x10430002,1,8M))
+$(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR1043V3,tl-wr1043nd-v3,TL-WR1043ND-v2,ttyS0,115200,0x10430003,1,8M))
$(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR2543,tl-wr2543-v1,TL-WR2543N,ttyS0,115200,0x25430001,1,8Mlzma,-v 3.13.99))
$(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE510,cpe210-220-510-520,CPE510,ttyS0,115200,$$(cpe510_mtdlayout),CPE510))
@@ -2087,7 +2088,7 @@ $(eval $(call MultiProfile,TLWR743,TLWR743NV1))
$(eval $(call MultiProfile,TLWR841,TLWR841NV15 TLWR841NV3 TLWR841NV5 TLWR841NV7))
$(eval $(call MultiProfile,TLWR842,TLWR842V1))
$(eval $(call MultiProfile,TLWR941,TLWR941NV2 TLWR941NV3 TLWR941NV4))
-$(eval $(call MultiProfile,TLWR1043,TLWR1043V1 TLWR1043V2))
+$(eval $(call MultiProfile,TLWR1043,TLWR1043V1 TLWR1043V2 TLWR1043V3))
$(eval $(call MultiProfile,TLWDR4300,TLWDR3500V1 TLWDR3600V1 TLWDR4300V1 TLWDR4300V1IL TLWDR4310V1 MW4530RV1))
$(eval $(call MultiProfile,TUBE2H,TUBE2H8M TUBE2H16M))
$(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTROCKETMXW UBNTNANOM UBNTNANOMXW UBNTLOCOXW UBNTUNIFI UBNTUNIFIOUTDOOR UBNTUNIFIOUTDOORPLUS UAPPRO UBNTAIRGW))

View File

@ -1,197 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Wed, 18 Nov 2015 02:01:55 +0100
Subject: ar71xx: backport ath10k calibration data load changes
The mac80211 update makes is necessary to backport this change as well for
ath10k to load.
diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index dd3f546..7111630 100644
--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -8,50 +8,83 @@ ath10kcal_die() {
ath10kcal_from_file() {
local source=$1
local offset=$2
- local target=$3
+ local count=$3
- dd if=$source of=$target bs=1 skip=$offset count=2116 2>/dev/null || \
+ dd if=$source of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \
ath10kcal_die "failed to extract calibration data from $source"
}
+ath10kcal_extract() {
+ local part=$1
+ local offset=$2
+ local count=$3
+ local mtd
+
+ mtd=$(find_mtd_chardev $part)
+ [ -n "$mtd" ] || \
+ ath10kcal_die "no mtd device found for partition $part"
+
+ dd if=$mtd of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \
+ ath10kcal_die "failed to extract calibration data from $mtd"
+}
+
+ath10kcal_patch_mac() {
+ local mac=$1
+
+ [ -z "$mac" ] && return
+
+ macaddr_2bin $mac | dd of=/lib/firmware/$FIRMWARE conv=notrunc bs=1 seek=6 count=6
+}
+
[ -e /lib/firmware/$FIRMWARE ] && exit 0
. /lib/ar71xx.sh
. /lib/functions.sh
. /lib/functions/system.sh
-ath10kcal_mac=""
-ath10kcal_tmp="/tmp/ath10k-caldata.bin"
-
board=$(ar71xx_board_name)
case "$FIRMWARE" in
-"ath10k/cal-pci-0000:01:00.0.bin")
- case $board in
- rb-911g-5hpacd)
- ath10kcal_from_file "/sys/firmware/routerboot/ext_wlan_data" 20480 $ath10kcal_tmp
- ;;
- esac
- ;;
-
"ath10k/cal-pci-0000:00:00.0.bin")
case $board in
dlan-pro-1200-ac)
- ath10kcal_from_file $(find_mtd_part "art") 20480 $ath10kcal_tmp
+ ath10kcal_extract "art" 20480 2116
+ ;;
+ mc-mac1200r)
+ ath10kcal_extract "art" 20480 2116
+ ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) -1)
+ ;;
+ r6100)
+ ath10kcal_extract "caldata" 20480 2116
+ ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) +2)
+ ;;
+ qihoo-c301)
+ ath10kcal_extract "radiocfg" 20480 2116
+ ath10kcal_patch_mac $(mtd_get_mac_ascii devdata wlan5mac)
;;
esr1750 | \
epg5000)
- ath10kcal_from_file $(find_mtd_part "caldata") 20480 $ath10kcal_tmp
+ ath10kcal_extract "caldata" 20480 2116
+ ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1)
+ ;;
+ esac
+ ;;
+"ath10k/cal-pci-0000:01:00.0.bin")
+ case $board in
+ archer-c5 | \
+ archer-c7)
+ ath10kcal_extract "art" 20480 2116
+ ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) -2)
+ ;;
+ nbg6716)
+ ath10kcal_extract "RFdata" 20480 2116
+ ;;
+ rb-911g-5hpacd)
+ ath10kcal_from_file "/sys/firmware/routerboot/ext_wlan_data" 20480 2116
;;
esac
;;
-
*)
exit 1
;;
esac
-
-[ -f $ath10kcal_tmp ] && {
- cp $ath10kcal_tmp /lib/firmware/$FIRMWARE
- rm -f $ath10kcal_tmp
-}
diff --git a/target/linux/ar71xx/base-files/lib/preinit/81_load_ath10k_board_bin b/target/linux/ar71xx/base-files/lib/preinit/81_load_ath10k_board_bin
deleted file mode 100644
index 9a32dfc..0000000
--- a/target/linux/ar71xx/base-files/lib/preinit/81_load_ath10k_board_bin
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/bin/sh
-
-. /lib/functions/system.sh
-. /lib/ar71xx.sh
-
-do_load_ath10k_board_bin() {
- # load board.bin
- case $(ar71xx_board_name) in
- nbg6716)
- dd if=/dev/mtdblock2 \
- bs=1 skip=20480 count=2116 \
- of=/tmp/ath10k-board.bin
- ;;
- archer-c5 | \
- archer-c7)
- local mac
- mac=$(macaddr_add $(cat /sys/class/net/eth1/address) -2)
-
- dd if=/dev/mtdblock4 \
- bs=1 skip=20480 count=6 \
- of=/tmp/ath10k-board.bin
- macaddr_2bin $mac >> /tmp/ath10k-board.bin
- dd if=/dev/mtdblock4 \
- bs=1 skip=20492 count=2104 >> /tmp/ath10k-board.bin
- ;;
- mc-mac1200r)
- local mac
- mac=$(macaddr_add $(cat /sys/class/net/eth1/address) -1)
-
- dd if=/dev/mtdblock4 \
- bs=1 skip=20480 count=6 \
- of=/tmp/ath10k-board.bin
- macaddr_2bin $mac >> /tmp/ath10k-board.bin
- dd if=/dev/mtdblock4 \
- bs=1 skip=20492 count=2104 >> /tmp/ath10k-board.bin
- ;;
- r6100)
- local mac
- mac=$(macaddr_add $(cat /sys/class/net/eth1/address) +2)
-
- dd if=/dev/mtdblock2 \
- bs=1 skip=20480 count=6 \
- of=/tmp/ath10k-board.bin
- macaddr_2bin $mac >> /tmp/ath10k-board.bin
- dd if=/dev/mtdblock2 \
- bs=1 skip=20492 count=2104 >> /tmp/ath10k-board.bin
- ;;
- qihoo-c301)
- local mac
-
- mac=$(mtd_get_mac_ascii devdata wlan5mac)
-
- if [ -z "$mac" ]; then
- mac=$(macaddr_add $(cat /sys/class/net/eth0/address) -2)
- fi
-
- dd if=/dev/mtdblock10 \
- bs=1 skip=20480 count=6 \
- of=/tmp/ath10k-board.bin
- macaddr_2bin $mac >> /tmp/ath10k-board.bin
- dd if=/dev/mtdblock10 \
- bs=1 skip=20492 count=2104 >> /tmp/ath10k-board.bin
-
- ;;
- esac
- [ -f /tmp/ath10k-board.bin ] || {
- return
- }
- cmp -s /tmp/ath10k-board.bin /lib/firmware/ath10k/QCA988X/hw2.0/board.bin || {
- cp /tmp/ath10k-board.bin /lib/firmware/ath10k/QCA988X/hw2.0/board.bin
- rm /tmp/ath10k-board.bin
- }
-}
-
-boot_hook_add preinit_main do_load_ath10k_board_bin

View File

@ -1,20 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 19 Nov 2015 23:29:17 +0100
Subject: ar71xx: fix AR71XX_MODEL on TP-Link TL-WR703N
The hwid check was wrong, causing the AR71XX_MODEL value to end with a
space (as $hwver was unset).
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 46af69a..d0abf42 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -123,7 +123,7 @@ tplink_board_detect() {
"3C0002"*)
model="MINIBOX_V1"
;;
- "070300"*)
+ "070301"*)
model="TP-Link TL-WR703N"
;;
"071000"*)

View File

@ -1,24 +0,0 @@
From: Ranlvor <ranlvor@starletp9.de>
Date: Sun, 6 Dec 2015 16:12:55 +0100
Subject: OpenSSL: Added source/old to PKG_SOURCE_URL
OpenSSL moves old versions of the library from http://www.openssl.org/source/
to http://www.openssl.org/source/old/1.0.2/ breaking the old links. That
behavior breaks the OpenWRT-build every time OpenSSL releases a new version.
This patch adds http://www.openssl.org/source/old/1.0.2/ to the PKG_SOURCE_URL
of OpenSSL to avoid breaking the build whenever OpenSSL releases a new
version.
diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile
index ad93678..9a16599 100644
--- a/package/libs/openssl/Makefile
+++ b/package/libs/openssl/Makefile
@@ -16,6 +16,7 @@ PKG_BUILD_PARALLEL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.openssl.org/source/ \
+ http://www.openssl.org/source/old/1.0.2/ \
ftp://ftp.funet.fi/pub/crypt/mirrors/ftp.openssl.org/source \
ftp://ftp.sunet.se/pub/security/tools/net/openssl/source/
PKG_MD5SUM:=b3bf73f507172be9292ea2a8c28b659d

View File

@ -1,48 +0,0 @@
From: Felix Kaechele <felix@kaechele.ca>
Date: Tue, 17 Nov 2015 05:00:02 +0100
Subject: x86/generic: refresh kernel config
Signed-off-by: Felix Kaechele <felix@kaechele.ca>
diff --git a/target/linux/x86/generic/config-default b/target/linux/x86/generic/config-default
index eb4b357..e077ebd 100644
--- a/target/linux/x86/generic/config-default
+++ b/target/linux/x86/generic/config-default
@@ -17,7 +17,6 @@ CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y
CONFIG_ACPI_PROCESSOR=y
# CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set
# CONFIG_ACPI_PROCFS_POWER is not set
-# CONFIG_ACPI_REDUCED_HARDWARE_ONLY is not set
# CONFIG_ACPI_SBS is not set
CONFIG_ACPI_THERMAL=y
CONFIG_ACPI_VIDEO=y
@@ -46,7 +45,6 @@ CONFIG_BACKLIGHT_LCD_SUPPORT=y
CONFIG_BLK_DEV_SR=y
# CONFIG_BLK_DEV_SR_VENDOR is not set
CONFIG_CPU_IDLE_GOV_MENU=y
-# CONFIG_DELL_SMO8800 is not set
CONFIG_DMA_SHARED_BUFFER=y
CONFIG_DMI=y
# CONFIG_DMIID is not set
@@ -120,7 +118,6 @@ CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
-# CONFIG_INT340X_THERMAL is not set
CONFIG_INTEL_GTT=y
CONFIG_INTEL_IDLE=y
# CONFIG_INTEL_IPS is not set
@@ -173,13 +170,10 @@ CONFIG_PNP_DEBUG_MESSAGES=y
CONFIG_RAS=y
# CONFIG_SAMSUNG_Q10 is not set
CONFIG_SATA_AHCI=y
-# CONFIG_SCx200_ACB is not set
-# CONFIG_SERIAL_8250_FINTEK is not set
CONFIG_SERIAL_8250_PNP=y
# CONFIG_THINKPAD_ACPI is not set
# CONFIG_TOPSTAR_LAPTOP is not set
# CONFIG_TOSHIBA_BT_RFKILL is not set
-# CONFIG_TOSHIBA_HAPS is not set
CONFIG_USB=y
CONFIG_USB_COMMON=y
CONFIG_USB_EHCI_HCD=y

View File

@ -1,22 +0,0 @@
From: Felix Kaechele <felix@kaechele.ca>
Date: Tue, 17 Nov 2015 05:00:51 +0100
Subject: x86/generic: enable pata_atiixp driver
This enables booting from devices that use an ATI PATA controller for
the boot device, such as the embedded CF cards in Fujitsu-Siemens Futro
thin-clients.
Signed-off-by: Felix Kaechele <felix@kaechele.ca>
diff --git a/target/linux/x86/generic/config-default b/target/linux/x86/generic/config-default
index e077ebd..666a985 100644
--- a/target/linux/x86/generic/config-default
+++ b/target/linux/x86/generic/config-default
@@ -150,6 +150,7 @@ CONFIG_NLS=y
CONFIG_NO_HZ=y
# CONFIG_PANASONIC_LAPTOP is not set
CONFIG_PATA_AMD=y
+CONFIG_PATA_ATIIXP=y
CONFIG_PATA_LEGACY=y
CONFIG_PATA_MPIIX=y
CONFIG_PATA_OLDPIIX=y

View File

@ -10,7 +10,7 @@ for module in $GLUON_MODULES; do
git checkout -B patching base git checkout -B patching base
for patch in "$GLUONDIR"/patches/$module/*.patch; do for patch in "$GLUONDIR"/patches/$module/*.patch; do
if ! git -c user.name='Gluon Patch Manager' -c user.email='gluon@void.example.com' am --whitespace=nowarn "$patch"; then if ! git -c user.name='Gluon Patch Manager' -c user.email='gluon@void.example.com' am --whitespace=nowarn --committer-date-is-author-date "$patch"; then
git am --abort git am --abort
git checkout patched git checkout patched
git branch -D patching git branch -D patching

View File

@ -16,4 +16,5 @@ for module in $GLUON_MODULES; do
git checkout $commit 2>/dev/null || git fetch $repo $branch git checkout $commit 2>/dev/null || git fetch $repo $branch
git checkout -B base $commit git checkout -B base $commit
git submodule update --init --recursive
done done

View File

@ -19,6 +19,10 @@ $(eval $(call GluonProfile,TLWA701))
$(eval $(call GluonModel,TLWA701,tl-wa701n-v1,tp-link-tl-wa701n-nd-v1)) $(eval $(call GluonModel,TLWA701,tl-wa701n-v1,tp-link-tl-wa701n-nd-v1))
$(eval $(call GluonModel,TLWA701,tl-wa701nd-v2,tp-link-tl-wa701n-nd-v2)) $(eval $(call GluonModel,TLWA701,tl-wa701nd-v2,tp-link-tl-wa701n-nd-v2))
# TL-WA7510 v1
$(eval $(call GluonProfile,TLWA7510))
$(eval $(call GluonModel,TLWA7510,tl-wa7510n,tp-link-tl-wa7510n-v1))
# TL-WR703N v1 # TL-WR703N v1
$(eval $(call GluonProfile,TLWR703)) $(eval $(call GluonProfile,TLWR703))
$(eval $(call GluonModel,TLWR703,tl-wr703n-v1,tp-link-tl-wr703n-v1)) $(eval $(call GluonModel,TLWR703,tl-wr703n-v1,tp-link-tl-wr703n-v1))
@ -117,6 +121,10 @@ $(eval $(call GluonModel,TLWA901,tl-wa901nd-v1,tp-link-tl-wa901n-nd-v1))
$(eval $(call GluonModel,TLWA901,tl-wa901nd-v2,tp-link-tl-wa901n-nd-v2)) $(eval $(call GluonModel,TLWA901,tl-wa901nd-v2,tp-link-tl-wa901n-nd-v2))
$(eval $(call GluonModel,TLWA901,tl-wa901nd-v3,tp-link-tl-wa901n-nd-v3)) $(eval $(call GluonModel,TLWA901,tl-wa901nd-v3,tp-link-tl-wa901n-nd-v3))
# TL-MR13U v1
$(eval $(call GluonProfile,TLMR13U))
$(eval $(call GluonModel,TLMR13U,tl-mr13u-v1,tp-link-tl-mr13u-v1))
# TL-MR3020 v1 # TL-MR3020 v1
$(eval $(call GluonProfile,TLMR3020)) $(eval $(call GluonProfile,TLMR3020))
$(eval $(call GluonModel,TLMR3020,tl-mr3020-v1,tp-link-tl-mr3020-v1)) $(eval $(call GluonModel,TLMR3020,tl-mr3020-v1,tp-link-tl-mr3020-v1))
@ -153,12 +161,19 @@ $(eval $(call GluonModel,UBNT,ubnt-air-gateway,ubiquiti-airgateway))
$(eval $(call GluonModel,UBNT,ubnt-airrouter,ubiquiti-airrouter)) $(eval $(call GluonModel,UBNT,ubnt-airrouter,ubiquiti-airrouter))
$(eval $(call GluonModel,UBNT,ubnt-bullet-m,ubiquiti-bullet-m)) $(eval $(call GluonModel,UBNT,ubnt-bullet-m,ubiquiti-bullet-m))
$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-loco-m)) $(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-nanostation-loco-m2))
$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-picostation-m)) $(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-nanostation-loco-m5))
$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-rocket-m)) $(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-rocket-m2))
$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-rocket-m5))
$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-bullet-m2))
$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-bullet-m5))
$(eval $(call GluonModelAlias,UBNT,ubiquiti-bullet-m,ubiquiti-picostation-m2))
$(eval $(call GluonModel,UBNT,ubnt-nano-m,ubiquiti-nanostation-m))
$(eval $(call GluonModelAlias,UBNT,ubiquiti-nanostation-m,ubiquiti-nanostation-m2))
$(eval $(call GluonModelAlias,UBNT,ubiquiti-nanostation-m,ubiquiti-nanostation-m5))
$(eval $(call GluonModel,UBNT,ubnt-loco-m-xw,ubiquiti-loco-m-xw)) $(eval $(call GluonModel,UBNT,ubnt-loco-m-xw,ubiquiti-loco-m-xw))
$(eval $(call GluonModel,UBNT,ubnt-nano-m,ubiquiti-nanostation-m))
$(eval $(call GluonModel,UBNT,ubnt-nano-m-xw,ubiquiti-nanostation-m-xw)) $(eval $(call GluonModel,UBNT,ubnt-nano-m-xw,ubiquiti-nanostation-m-xw))
$(eval $(call GluonModel,UBNT,ubnt-uap-pro,ubiquiti-unifi-ap-pro)) $(eval $(call GluonModel,UBNT,ubnt-uap-pro,ubiquiti-unifi-ap-pro))
$(eval $(call GluonModel,UBNT,ubnt-unifi,ubiquiti-unifi)) $(eval $(call GluonModel,UBNT,ubnt-unifi,ubiquiti-unifi))
@ -257,3 +272,9 @@ $(eval $(call GluonModel,MYNETN600,mynet-n600,wd-my-net-n600))
# WD MyNet N750 # WD MyNet N750
$(eval $(call GluonProfile,MYNETN750)) $(eval $(call GluonProfile,MYNETN750))
$(eval $(call GluonModel,MYNETN750,mynet-n750,wd-my-net-n750)) $(eval $(call GluonModel,MYNETN750,mynet-n750,wd-my-net-n750))
## Onion
# Omega
$(eval $(call GluonProfile,OMEGA))
$(eval $(call GluonModel,OMEGA,onion-omega,onion-omega))