Commit Graph

50 Commits (5a8e9846af689be7bc3b1fb4a356c3e3c711b94a)

Author SHA1 Message Date
Hauke Mehrtens 253a299604 Revert "brcm47xx: Fix sysupgrade with E1200v1"
This reverts commit 31e9445b7e.

"Linksys E1200 V1" is not a valid board name, as the brcm47xx arch code
can not detect this device. Stefan Lippers-Hollmann also found a typo in
this patch "cybetran" instead of "cybertan".

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Rosen Penev 31e9445b7e brcm47xx: Fix sysupgrade with E1200v1
Entry was missing for some reason.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
7 years ago
Mathias Kresin f12a32630f treewide: use the generic board_name function
Use the generic function instead ot the target specific ones.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin 78cf5eed6e treewide: do board detection during preinit
Do the board detection during preinit to unify it across all targets.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Jo-Philipp Wich 833c500cb2 brcm47xx: remove target specific network preinit config
The generic preinit code is now able to setup network and switch vlan settings
from the /etc/board.json file, therefor drop the target specific code.

Fixes FS#790.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Rafał Miłecki db7f2d9531 brcm47xx: add Netgear WN2500RP support
We generate V1 image only for now. We lack buttons support for V2.

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

SVN-Revision: 47682
9 years ago
Rafał Miłecki 46bc3ed25a brcm47xx: sysupgrade: drop useless shift in platform.sh
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45913
9 years ago
John Crispin 0da6f8a52b brcm47xx: extract TRX from image on the fly
Extracting TRX to separated file in /tmp/ requires extra RAM which may
not be available on some chepaer devices. Instead of that lets pass a
proper extracting command to the default_do_upgrade.

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

SVN-Revision: 45901
9 years ago
Rafał Miłecki b12e85a451 brcm47xx: fix handling absolute paths in sysupgrade (for vendor formats)
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45472
9 years ago
Rafał Miłecki e85294a957 brcm47xx: rework vendor fw handling to don't duplicate upgrade calls
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45470
9 years ago
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
9 years ago
Rafał Miłecki a8b0e75291 brcm47xx: verify also standard TRX images during sysupgrade
It allows detecting data corruption for plain TRX as well.

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

SVN-Revision: 45318
9 years ago
Rafał Miłecki 3fad95446a brcm47xx: fix WRT300N devices magics for sysupgrade check
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45317
9 years ago
Rafał Miłecki 44b128b0aa brcm47xx: 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: 45316
9 years ago
Rafał Miłecki 9c5aa7c528 brcm47xx: image: share function checking TRX in provided firmware
This will allow us to calculate crc32 in a shared code.

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

SVN-Revision: 45202
9 years ago
Rafał Miłecki 8ec31f25e3 brcm47xx: fix checking cross-vendors firmware images
This change won't allow installing e.g. Netgear firmware on Linksys
device.

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

SVN-Revision: 45174
9 years ago
Rafał Miłecki a445846305 brcm47xx: display all errors (not just the 1st one) when checking image
This way people forcing upgrade will know what may go wrong.

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

SVN-Revision: 45172
9 years ago
Rafał Miłecki 44dfe17576 brcm47xx: recognize more device specific firmwares
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45171
9 years ago
Rafał Miłecki b34040f990 brcm47xx: compare provided firmware magic with device magic
This makes sysupgrade reject firmware images for different devices.
Right now only support for 2 sample devices is implemented.

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

SVN-Revision: 45170
9 years ago
Rafał Miłecki 81b8d95f2c brcm47xx: support for flashing CHK and CyberTAN images
This will allow simple sysupgrade-s including simpler reverting to the
original firmware.

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

SVN-Revision: 43799
10 years ago
Rafał Miłecki cca3990b16 brcm47xx: verify if CHK/CyberTAN contains valid TRX
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 43798
10 years ago
Rafał Miłecki c3e9796cd5 brcm47xx: extract magics from specific upgrade images (and still reject them)
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 43718
10 years ago
Rafał Miłecki a5b6b7e419 brcm47xx: detect (and still reject for now) CyberTAN fw format
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 43714
10 years ago
Rafał Miłecki b5b4bdc066 brcm47xx: use separated function in upgrade to detect file type
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 43708
10 years ago
John Crispin 20940138ac scripts: fix wrong usage of '==' operator
[base-files] shell-scripting: fix wrong usage of '==' operator

normally the '==' is used for invoking a regex parser and is a bashism.
all of the fixes just want to compare a string. the used busybox-ash
will silently "ignore" this mistake, but make it portable/clean at least.

this patch does not change the behavior/logic of the scripts.

Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com>

SVN-Revision: 42911
10 years ago
John Crispin f933a741a9 target/linux/*/base-files/lib/upgrade/platform.sh - wrong check for ARGC
ARGC is a 'C-ism', but not known/valid in shell-syntax - insert the correct
var $# (=number of args) here. under normal conditions this had no impact,
but we should at least correct it. the error was observable like this:

root@box:~ [ -e "/etc/functions.sh" ] && . /etc/functions.sh
root@box:~ [ -e "/lib/functions.sh" ] && . /lib/functions.sh
root@box:~ . /lib/upgrade/platform.sh
root@box:~ . /lib/upgrade/common.sh
root@box:~ platform_check_image /tmp/myfirmware.bin
ash: bad number
root@box:~ echo $?
0

Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com>

SVN-Revision: 40915
10 years ago
Hauke Mehrtens edab966e45 brcm47xx: fix network failsafe indication
Remove the code used on the old switch driver.
The Ethernet drive is loaded as a module and needs some time to get up
therefor we added some wait function.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

SVN-Revision: 39254
11 years ago
Hauke Mehrtens d7ebbd0ac7 brcm47xx: use "firmware" partition name
Some time ago, after switching to the mainline bcm47xxpart driver
following patch has been applied:

commit 03cef8725d2062335ffc3de50fc037b294fd458c
Author: hauke <hauke@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Date:   Sat Apr 6 22:22:26 2013 +0000

    brcm47xx: use old partition names again for kernel 3.8

    This fixes sysupgrade. The partition names are used all over the Internet in various howtos.

    Thank you russell for spotting this problem.

I propose to revert this change and make sysupgrade use "firmware"
instead. This makes brcm47xx compatible with widely used ar71xx and
after all "firmware" sounds like a much better name for... the firmware.

This change doesn't affect "sysupgrade" usage, because it never takes a
partition name as a parameter. This change only affects users using mtd
tool directly. Hopefully there are not many howtos using "mtd" command.

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

SVN-Revision: 38973
11 years ago
Hauke Mehrtens 3bc90a4d23 brcm47xx: fix switch handling
This fixes some problems with the switch handling

 * It now send the messages again to indicate a button for failsafe mode should be pressed
 * it does not leak packages between wan and lan any more
 * the switch works again in normal mode

The Ethernet connection has to be up when the switch driver switch-robo
is insmoded therefor we just do it again.
Explicitly set enable_vlan to prevent leaking packages.

This should close #13869, #13868 and #13716

SVN-Revision: 37286
11 years ago
Hauke Mehrtens ef0b9be95e brcm47xx: do not load the kernel modules needed for Ethernet manually
add the boot flag to make the kernel modules needed for Ethernet and
diag load on startup.

SVN-Revision: 37284
11 years ago
Hauke Mehrtens e800436de3 brcm47xx: do not change nvram without user interaction
SVN-Revision: 37281
11 years ago
Hauke Mehrtens e041d370a7 brcm47xx: proc gets mounted without this patch
SVN-Revision: 37272
11 years ago
Hauke Mehrtens 8dabd7a26b brcm47xx: remove obsolete hotplug stuff
SVN-Revision: 37271
11 years ago
John Crispin 39df8d1a45 brcm47xx: dont manually insmod switch drivers
Signed-off-by: John Crispin <bloic@openwrt.org>

SVN-Revision: 36993
11 years ago
Hauke Mehrtens 9afdb046d3 brcm47xx: do not use vlan0 any more.
The Broadcom switch driver says that vlan0 should not be used with any switch other than bcm5325.

This makes OpenWrt always use vlan1 and vlan2 instead.

SVN-Revision: 35704
11 years ago
Hauke Mehrtens 9de704a03b brcm47xx: improve cpuport detection for filesafe
Do not try to load bcm57xx.ko any more this is not needed for kernel 2.6 and 3.X
Ask the switch driver where the CPU port is.

SVN-Revision: 35624
11 years ago
Hauke Mehrtens a1e3c0ca46 Add Failsafe support for Linksys E3000V1 / WRT610NV2
Adds specification of the correct cpu_port for Linksys E3000V1 and WRT610NV2
in /lib/preinit/05_init_interfaces_brcm.  The list of devices will need to
be expanded.  Is there a way to determine the correct cpu_port to use in a
generic sense; for instance, if "/proc/switch/eth0/port/8" exists, or if
"/sys/class/net/eth0/device/driver/module/drivers/bcma:bgmac" exists?  Could
a similar method be used in "/etc/init.d/netconfig"?

Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>

SVN-Revision: 35491
12 years ago
Hauke Mehrtens 68aeb7af8e brcm47xx: load pps_core and ptp before tg3 to make the interface available for failsafe.
SVN-Revision: 35341
12 years ago
Hauke Mehrtens 4443997fd8 brcm47xx: add bgmac driver
This Ethernet driver is in early development stage and still has some problems.
This was working on my bcm4716 based device.

Thanks to Rafał Miłecki <zajec5@gmail.com> for writing this driver.

SVN-Revision: 34995
12 years ago
Hauke Mehrtens 8f6bdcffa1 brcm47xx: build b44 as a module
SVN-Revision: 34994
12 years ago
Hauke Mehrtens 22d62d311a brcm47xx: run ifup before starting the switch
In addition check_module is not needed, nobody checks the return value.

SVN-Revision: 34993
12 years ago
Mirko Vogt e34a4e0c7b Do not use deprecated path to functions.sh (/etc/functions.sh -> /lib/functions.sh)
SVN-Revision: 34793
12 years ago
Mirko Vogt 439a869090 Do not overload mount-call - trying to reduce confusion
The behaviour of calling 'mount' differed depending on whether it called
the busybox-mount, the mount of util-linux, the mount defined in
/lib/functions.sh and /lib/functions/boot.sh

/etc/preinit even included /lib/functions.sh and /lib/functions/boot.sh,
both re-defining 'mount'.

SVN-Revision: 34792
12 years ago
Hauke Mehrtens 4901ac8225 brcm47xx: improve suppressing printing if a module was found in preinit function.
Thank you Bastian Bittorf

SVN-Revision: 34680
12 years ago
Hauke Mehrtens 235c065e12 brcm47xx: suppress printing if a module was found in preinit function.
SVN-Revision: 34653
12 years ago
Hauke Mehrtens 3a4a6cfd64 kernel: in kernel 3.6.8 and later tg3 depends on hwmon.ko
SVN-Revision: 34652
12 years ago
Hauke Mehrtens aa8e887a46 brcm47xx: whitespace cleanups
SVN-Revision: 34329
12 years ago
Hauke Mehrtens 0818180715 activate failsafe on all ports of the switch and not just port 0.
Sometimes the port 0 was the WAN port or there could be some device
where the port 0 is not wired to an actual Ethernet port. Now telnet in
failsafe will listen on all ports of the switch so user do not have to
search for the correct port any more. This change will make the switch
leak traffic between the WAN and the LAN port, but you should not use
failsafe while connected to a untrusted network.

SVN-Revision: 33544
12 years ago
Daniel Dickinson 17ba48cd90 target (base-files): Fixed failsafe mode by adding back insmod diag
SVN-Revision: 22186
14 years ago
Felix Fietkau 812f026323 add back the base-files/image code from brcm-2.4 to brcm47xx
SVN-Revision: 21945
14 years ago