Commit graph

54 commits

Author SHA1 Message Date
Rafał Miłecki
eaf0d22421 bcm53xx: calculate Seama MD5 using content of kernel partition
We don't want checksum to cover any part of UBI as even its part with
SquashFS may be changed due to e.g. flash wearing.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
2016-07-04 12:32:12 +02:00
Rafał Miłecki
776b24d9aa bcm53xx: properly support sysupgrade using Seama on NAND devices
It updates kernel and then formats UBI without loosing erase counters.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
2016-06-20 08:02:32 +02:00
Rafał Miłecki
cb0de9a68e bcm53xx: sysupgrade: move TRX specific code to separated function
This will allow adding support for other formats (e.g. Seama) in a clean
way.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
2016-06-13 22:52:04 +02:00
Rafał Miłecki
1f86257c2f bcm53xx: pass datasize to mtd in hexadecimal format
This avoids extra calculation in bash script.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
2016-06-11 01:38:00 +02:00
Rafał Miłecki
c40e96d133 bcm53xx: fix partition typos in 09_fix_crc
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
2016-06-11 01:37:41 +02:00
Rafał Miłecki
95d8568cb8 bcm53xx: calculate TRX CRC32 using whole kernel partition
This provides better protection of flash data.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
2016-06-10 12:58:19 +02:00
Rafał Miłecki
01714243b9 bcm53xx: drop Copyright header from two of my bash scripts
Both scripts modified by this patch were added by me. First of all I
incorrectly added OpenWrt as Copyright holder. It was wrong because:
1) I simply can't transfer my moral rights according to the Polish law
2) Transfering copyrights (economic rights) requires an agreement which
   I didn't sign with OpenWrt(.org).
Other than that I don't find these trivial scripts important enough to
put info about *my* copyrights in a header so this patch just drops them
completely.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
2016-05-18 08:35:00 +02:00
Rafał Miłecki
93550152ed bcm53xx: add switch config workaround for R8500 and DIR-885L
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 49160
2016-04-09 13:23:25 +00:00
Rafał Miłecki
e2893fa8c3 bcm53xx: fix regression in generating network config
Syntax error was added in r49122.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 49159
2016-04-09 13:20:19 +00:00
Rafał Miłecki
997a3cb41c bcm53xx: add basic support for Netgear R7900
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 49122
2016-04-09 09:59:21 +00:00
Rafał Miłecki
3b76c7cf0b bcm53xx: start working on Netgear R8500
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 48625
2016-02-03 22:32:07 +00:00
Rafał Miłecki
9a69e00baa bcm53xx: support Netgear R8500 in sysupgrade
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 48572
2016-01-30 16:57:35 +00:00
Rafał Miłecki
926c8dfc7b bcm53xx: specify magic expected in sysupgrade for D-Link DIR-885L
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 48553
2016-01-29 22:31:43 +00:00
Rafał Miłecki
c0edf30bdc bcm53xx: basic support for Seama format in sysupgrade
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 48535
2016-01-28 22:38:37 +00:00
Rafał Miłecki
518ad4763a bcm53xx: fix MD5 in Seama format on flash after installing OpenWrt
We need to fix Seama just like we fix TRX due to the rootfs mark.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 48522
2016-01-28 08:51:58 +00:00
Rafał Miłecki
1dfa8f37db bcm53xx: detect Seama sysupgrade format
It's used e.g. by D-Link devices. We don't support it yet.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 48509
2016-01-27 10:40:58 +00:00
Jo-Philipp Wich
67e1c87012 all: drop old uci-defaults.sh
Replace former uci-defaults.sh implementation with the uci-defaults-new.sh one
and update all users accordingly.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47867
2015-12-11 15:26:06 +00:00
Jo-Philipp Wich
527ec2af59 all: remove dummy ucidef_set_interface_loopback() from board.d
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47744
2015-12-03 23:13:00 +00:00
Jo-Philipp Wich
8f8b702f85 board.d: remove redundant ucidef_set_interfaces_lan_wan() calls
This removes calls to ucidef_set_interfaces_lan_wan() and
ucidef_set_interfaces_lan() on boards where all relevant info can be
inferred from the switch definition.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47722
2015-12-03 17:30:56 +00:00
Jo-Philipp Wich
9b02e73188 board.d: merge ucidef_add_switch() and ucidef_add_switch_ports()
This changes uci-defaults-new.sh, config_generate and all relevant board.d
files in order combine ucidef_add_switch() and ucidef_add_switch_ports() into
a single function.

Also removes now superfluous enable and reset arguments.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47721
2015-12-03 17:30:24 +00:00
Jo-Philipp Wich
c4ea02cc69 bcm53xx: switch to ucidef_add_switch_ports()
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47692
2015-12-02 18:51:12 +00:00
Rafał Miłecki
e6944a3490 bcm53xx: add workaround for Netgear R8000 network
According to the info from NVRAM we should use port 8 for the CPU (and
interface eth2). Unfortunately it doesn't work right now, so lets switch
to the port 5.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

Forwardport of r46586 from 15.05

SVN-Revision: 47281
2015-10-30 12:55:37 +00:00
Rafał Miłecki
f87990840d bcm53xx: support sysupgrade with Netgear R7000 original firmware
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 46732
2015-08-26 15:21:14 +00:00
Rafał Miłecki
46a25c6e8a bcm53xx: fallback to default_do_upgrade if NAND upgrade fails
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45915
2015-06-06 17:52:53 +00:00
Rafał Miłecki
3d4f163df1 bcm53xx: sysupgrade: drop useless shift in platform.sh
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45914
2015-06-06 17:26:05 +00:00
Rafał Miłecki
54fb91f0cf bcm53xx: extract TRX from image on the fly
Extracting TRX to separated file in /tmp/ just wastes some RAM while we
can just pass a proper extracting command to the default_do_upgrade.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45912
2015-06-06 17:23:03 +00:00
Rafał Miłecki
5e90144aec bcm53xx: sysupgrade: extract TRX partitions directly from vendor image
Extracting full TRX out of vendor format is not needed as otrx supports
passing TRX offset. This saves some RAM during sysupgrade.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45911
2015-06-06 17:05:31 +00:00
Rafał Miłecki
75b8e247e3 bcm53xx: try to fix network on Asus RT-AC87U
This device seems to have switch port 7 connected to the CPU:
vlan1ports=1 2 3 5 7*
vlan2ports=0 7u
it should be handled by eth1 and NVRAM seems to confirm that (no
et0macaddr entry, existing et1macaddr & et1phyaddr entries).

One of the remaining ports (4/8?) may be connected to the Quantenna SoC.
Original firmware boot log contains following messages:
(0x00,0x5d)Port 5 States Override: 0xfb
(0x00,0x5f)Port 7 States Override: 0xfb
(0x00,0x0e)Port 8 States Override: 0x0a
(why does it force port 5 state?!)

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45692
2015-05-16 17:14:25 +00:00
Rafał Miłecki
2d3aaa2d2f bcm53xx: fix default network interface on Netgear R8000
It has 3 Ethernet interfaces, each of them connected to separated switch
port. Default NVRAM uses switch port 8 as CPU which is connected to the
3rd interface (eth2).

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45681
2015-05-13 13:11:04 +00:00
Rafał Miłecki
33e597b241 bcm53xx: sort ports from NVRAM entries before matching them
Some devices have unsorted ports which may lead to broken config.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45575
2015-04-24 07:47:25 +00:00
Rafał Miłecki
866fe3895d bcm53xx: sysupgrade: check if new kernel fits partition size
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45547
2015-04-21 11:21:34 +00:00
Rafał Miłecki
457d9caf4d bcm53xx: sysupgrade: improve NAND warnings
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45546
2015-04-21 11:04:38 +00:00
Rafał Miłecki
a86e7330dc bcm53xx: sysupgrade: drop some debugging message
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45544
2015-04-21 08:34:25 +00:00
Rafał Miłecki
688c1d74b9 bcm53xx: sysupgrade: allow flashing NAND devices without --force
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45543
2015-04-21 08:32:59 +00:00
Rafał Miłecki
d263c8e1a9 bcm53xx: sysupgrade: support flashing TRX with UBI image
Signed-off-by: Dan Haab <dhaab@luxul.com>

SVN-Revision: 45542
2015-04-21 08:20:06 +00:00
Rafał Miłecki
9e03c36259 bcm53xx: fix handling absolute paths in sysupgrade (for vendor formats)
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45473
2015-04-17 06:03:00 +00:00
Felix Fietkau
c64fdadea7 bcm53xx: make use of the new board detection layer
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 45458
2015-04-16 12:18:34 +00:00
Rafał Miłecki
3edb55143d bcm53xx: add (disabled) support for upgrading kernel during sysupgrade
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45445
2015-04-14 20:50:59 +00:00
Rafał Miłecki
3cb8bf44e6 otrx: change command line API to start with a mode
This will allow adding more modes without options conflict.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45443
2015-04-14 20:50:46 +00:00
Rafał Miłecki
77c75e6fa3 bcm53xx: try to handle Netgear R8000 VLANs config
It seems to have few ports connected to CPU (only for CPU sending data?)
as part of "SMP dual core 3 GMAC setup" feature.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45403
2015-04-12 20:11:25 +00:00
Rafał Miłecki
95ef64a779 bcm53xx: allow sysupgrade firmwares without UBI containing rootfs
In most cases it allows reverting back to the vendor firmware (as they
usually don't use UBI). If users wants to do that we can't do anything
anyway. Erease counters will be just lost. The only thing we do is warn:
"Flashing firmware without UBI for rootfs. All erase counters will be
lost."
It still requires forcing sysupgrade.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45392
2015-04-12 12:04:13 +00:00
Rafał Miłecki
24d40980b0 bcm53xx: add platform_pre_upgrade to prepare for kernel+UBI sysupgrade
We can now detect that provided firmware contains kernel and UBI image
partitions. Flashing it in a sane way (keeping erase counters) still
needs to be implemented.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45391
2015-04-12 11:46:16 +00:00
Rafał Miłecki
a04b71d330 bcm53xx: rework vendor fw handling to don't duplicate upgrade calls
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45389
2015-04-12 10:42:27 +00:00
Rafał Miłecki
2198db252c bcm53xx: switch to the otrx for verifying TRX images
This adds checking CRC32 of provided firmware image.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45320
2015-04-09 06:33:56 +00:00
Rafał Miłecki
b6e8da2e14 bcm53xx: image: share function checking TRX in provided firmware
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45292
2015-04-07 14:14:08 +00:00
Rafał Miłecki
7abd779730 bcm53xx: display all errors (not just the 1st one) when checking image
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45291
2015-04-07 14:14:02 +00:00
Rafał Miłecki
a19b69a717 bcm53xx: compare provided firmware magic with device magic
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45290
2015-04-07 14:13:56 +00:00
Rafał Miłecki
d1a28cfbb2 bcm53xx: support flashing CHK and CyberTAN images
SVN-Revision: 43800
2014-12-30 17:45:53 +00:00
Rafał Miłecki
e7d7f59171 bcm53xx: support WAN connected to switch port 0
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 43754
2014-12-20 15:09:01 +00:00
Rafał Miłecki
dd9ca05249 bcm53xx: sysupgrade support for devices with serial flash
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 43719
2014-12-15 15:43:46 +00:00