TP-Link TL-MR3020 v3 is a pocket-size router based on MediaTek MT7628N.
This PR is based on the work of @meyergru[1], with his permission.
Specification:
- MediaTek MT7628N/N (575 Mhz)
- 64 MB of RAM
- 8 MB of FLASH
- 2T2R 2.4 GHz
- 1x 10/100 Mbps Ethernet
Flash instruction:
The only way to flash the image in TL-MR3020 v3 is to use
tftp recovery mode in U-Boot:
1. Configure PC with static IP 192.168.0.225/24 and tftp server.
2. Rename "openwrt-ramips-mt76x8-tplink_tl-mr3020-v3-squashfs-tftp-recovery.bin"
to "tp_recovery.bin" and place it in tftp server directory.
3. Connect PC with the LAN port, press the reset button, power up
the router and keep button pressed for around 6-7 seconds, until
device starts downloading the file.
4. Router will download file from server, write it to flash and reboot.
[1] https://github.com/meyergru/lede-source/commits/TL-MR3020-V3
Signed-off-by: Carlo Nel <carlojnel@gmail.com>
Without "syscon" being present in an ag71xx ethernet DT node's
compatible property, a panic occurs at boot during probe citing
"Unhandled kernel unaligned access".
With this modification, the panic no longer occurs and instead the probe
simply fails, allowing the boot process to continue.
Signed-off-by: Matt Merhar <mattmerhar@protonmail.com>
This adds "syscon" to the compatible properties for the eth0/eth1 nodes
in ar7100.dtsi.
Without this, a kernel panic is encountered on boot with some ar7100
boards. This for some reason wasn't an issue for the WNDR3800, which
uses a Realtek switch chipset, but the panic was encountered on the
RouterStation Pro (using an AR8216 switch) and some other boards that
haven't yet been merged.
The panic message mentions an unaligned access and happens in
ag71xx_mdio_probe in drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c.
Even if the unaligned access is fixed, the ag71xx_mdio probe still fails
without the "syscon" property.
This was already being worked around in
ar7161_ubnt_routerstation-pro.dts by overriding the compatible property,
so this commit removes that as well.
All of the other ath79 .dtsi already have this property, so no changes
are needed elsewhere.
Signed-off-by: Matt Merhar <mattmerhar@protonmail.com>
The pinmux for all SoCs using this driver is now set via the pinmux. It
makes this code obsolete.
Some of the code targeting the mt76x8 SoCs is still required. The sd
card pins share the pads with the EPHY. These pads need to be switched
to digital mode if the pins are used for sd cards.
The eMMC 8-bit mode has to be enabled via pinmux instead of a kernel
option. The uart2 group need to be set to function "sdxc d5 d4", pwm1
to "sdxc d6" and pwm0 to "sdxc d7" to do so. It can't be done by as
part of a default pinmux, as it would break the normal operation of
uart2.
Signed-off-by: Mathias Kresin <dev@kresin.me>
Set the pins to the required mode via the pinmux driver. It allows to
get rid of the pinmux related code in the sd card driver.
Signed-off-by: Mathias Kresin <dev@kresin.me>
Drop the nd_sd gpio pinmux in case sdcard is used. They're mutually
exclusive and for most of the boards not even used as GPIOs.
If the pins are in sdcard mode, the pins ND_WE_N and ND_CS_N are still
GPIOs (#45 and #46).
Signed-off-by: Mathias Kresin <dev@kresin.me>
The rt3352 has a pin that can be used as second spi chip select,
watchdog reset or GPIO. The pinmux setup was missing the definition of
said pin but it is already used in the SoC dtsi.
Signed-off-by: Mathias Kresin <dev@kresin.me>
u-boot.mk checks for the Default profile to build images for all targets.
This brings the target default profile in sync with other targets
Signed-off-by: Felix Fietkau <nbd@nbd.name>
PCI paths of the WLAN devices have changed between kernel 4.4 and 4.9;
migrate config so existing wifi-iface definitions don't break.
This is implemented as a hotplug handler rather than a uci-defaults script
as the migration script must run before the 10-wifi-detect hotplug handler.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
A buffer is split into multiple descriptors if it exceeds 16 KB.
Apply the same split for the skb head as well (to deal with corner cases
on fraglist support)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
This reverts commit 3a8efaef00.
The change reportedly breaks UART2 on some boards. Furthermore it uses
bitwise logic on an uninitialized variable and fails to explain what it
is fixing exactly.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
The changed dictionary size leads to a different LZMA header which breaks
sysupgrade image magic checkibng on at least some RT288x boards.
Since the commit message only mentions testing on MT7621 and since the
change appears to break at least one other ramips subtarget, do not take
any chances and restrict the size limitation to only MT7621.
Fixes FS#1797
Fixes 09b6755946 ("ramips: limit dictionary size for lzma compression")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
The rt3883 doesn't have a pinmux group named spi_cs1. The cs1 is part
of the pci group. The function pci-func enables the second chip select.
Signed-off-by: Mathias Kresin <dev@kresin.me>
The PCI pins need to be set to "PCI Host support one device" to allow
the use of one PCI device and flash memory.
The pci-fnc function is intended to be used if no PCI is used but
flash, nand or the codec functionality is.
Signed-off-by: Mathias Kresin <dev@kresin.me>
This remedies an issue with the MBL Duo if both disks are inserted
and contain OpenWrt. kernel and dtb would be loaded from SATA 1:1
while rootfs (/dev/sda2) would be mounted on SATA 0:1.
Such a mix&match would obviously only work if both OpenWrt versions/
builds are identical, and especially fail after sysupgrade upgraded
the system disk on SATA 0:1.
The fallback to SATA 1:1 needs to be kept for MBL Single (only has
SATA 1:1) and MBL Duo with one disk inserted on SATA 1:1. To speed
up booting in those cases, the unneccesarily doubled "sata init"
will only be called once. (In theory it could be omitted completely
since the on-flash boot script already initializes SATA to load the
on-disk boot script.)
Tested on MBL Duo (all possible combination of disks) and MBL Single
Acked-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Freddy Leitner <hello@square.wf>
The LEDs should be triggered/lit by any kind of state change instead of
turned on/off unconditional.
If LEDs really need to be turned off by default, it should be done via
the default-state devicetree led property.
The handling of the wndr3700v5 and wt3020 power led is at least
strange. Something is for sure wrong with them. Either the leds are
misnamed, the default off trigger is a typo or the polarity of the
gpios is wrong. Drop the power led from userspace and wait for someone
with access to the hardware to fix it properly.
Signed-off-by: Mathias Kresin <dev@kresin.me>
Based on the userspace led configuration it's quite obvious that the
4g-0 led should be used for boot status indication.
Signed-off-by: Mathias Kresin <dev@kresin.me>
Use the default-state property to express the desired led handling in
the devicetree source file instead of the userspace.
Signed-off-by: Mathias Kresin <dev@kresin.me>
All the LEDs are turned on by diag.sh at the end of the boot process.
No need to do the same via userspace configuration again.
Signed-off-by: Mathias Kresin <dev@kresin.me>
All boards either have a multi colour led or a single lightpipe. It
makes it impossible to handle the LEDs individual. Change the LED
config for these boards to take it into account.
Signed-off-by: Mathias Kresin <dev@kresin.me>
Commit 7af1fb9faa ("kernel: add a RPS balancer") introduces a RPS balancer
for all targets.
In the past however, this patch was already introduced for target "mediatek"
in commit 7762c07c88 ("mediatek: bump to v4.14")
Remove the separate copy of the patch within the mediatek target,
which otherwise is applied twice and results in a build error.
Fixes: 7af1fb9faa ("kernel: add a RPS balancer")
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
By default the RPS delegation will happen by masking the last few bits of
skb->hash. This patch adds an inermediate hash bucket that maps the masked
hash to a RPS core. This makes RPS results much more deterministic on SMP
systems.
Signed-off-by: John Crispin <john@phrozen.org>
The current make-ras.sh image generation script for the ZyXEL NBG6617
has portability issues with bash. Because of this, factory images are
currently not built correctly by the OpenWRT buildbots.
This commit replaces the make-ras.sh by C-written mkrasimage.
The new mkrasimage is also compatible with other ZyXEL devices using
the ras image-format.
This is not tested with the NBG6616 but it correctly builds the
header for ZyXEL factory image.
Signed-off-by: David Bauer <mail@david-bauer.net>
Currently all PCI devices get the same IRQ that affects performance badly.
This commit adresses this problem and cleans the code.
ar7100 has a special PCI interrupt controller@18060018 that works exactly
the same way as misc interrupt controller.
This patch does the following:
1. Defines pci-intc interrupt controller@18060018 in dtsi.
2. Removes interrupt-controller property from PCI node.
3. Sets a correct interrupt mask for PCI devices.
4. Removes all IRQ handling code from the PCI driver.
"qca,ar7100-misc-intc" should be used as the compatible property, becuase on ar7100
the controlled status register is read-only and the ack method used in
"qca,ar7240-misc-intc" won't work properly.
There are two very minor downsides of this patch that don't affect perormance:
1. We allocate an IRQ domain of 32 IRQ, whan we need only 5. But ar7100 aren't tiny un terms of RAM
and that is not very important and can be tuned if we implement "nr-interrupts" property".
2. It reuses the same irg chip name "MISC" for both controllers.
Run tested on DIR-825 B1.
Signed-off-by: Dmitry Tunin <hanipouspilot@gmail.com>
We currently don't have any code configuring interface mode in ath79,
meaning that we relies on bootloader to set the correct interface mode.
This patch added code to set interface correctly so that everything works
even if bootloader configures it wrong.(e.g. on WNDR3800 u-boot set
the second GMAC mode to RMII but it should be RGMII.)
Introduced "qca,mac-idx" for the difference in MII_CTRL register value.
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
Netgear WNR612v2 flashed with recent OpenWrt builds suffers from kernel
panic at boot during wireless chip initialization, making device
unusable:
ath: phy0: Ignoring endianness difference in EEPROM magic bytes.
ath: phy0: Enable LNA combining
CPU 0 Unable to handle kernel paging request at virtual address 1000fee1, epc == 801d08f0, ra == 801d0d90
Oops[#1]:
CPU: 0 PID: 469 Comm: kmodloader Not tainted 4.9.120 #0
[ ... register dump etc ... ]
Kernel panic - not syncing: Fatal exception
Rebooting in 1 seconds..
This simple patch fixes above error. It keeps LED table in memory after
kernel init phase for ath9k driver to operate correctly (__initdata
removed).
Also, another bug is fixed - correct array size is provided to function
that adds platform LEDs (this device has only 1 connected to Wifi chip)
preventing code from going outside array bounds.
Fixes: 1f5ea4eae4 ("ar71xx: add correct named default wireless led by using platform leds")
Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
[trimmed commit message]
Signed-off-by: Mathias Kresin <dev@kresin.me>
The NBG6616 shares a config symbol with the NBG6716. It was accidentally
removed from the config when the ar71xx-tiny target was split off.
Fixes: 0cd5e85e7a ("ar71xx: create new ar71xx/tiny subtarget for 4MB flash devices")
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
This adds a shared ar7161_ubnt_routerstation.dtsi as well as two other
.dts files that utilize it, ar7161_ubnt_routerstation.dts and
ar7161_ubnt_routerstation-pro.dts.
The modifications to generic-ubnt.mk, config-default, and base-files
necessary for image generation, parsing RedBoot FIS partitions, network
configuration, and sysupgrade are also included.
This reintroduces vital bits from platform_do_upgrade_combined() and its
supporting functions to /lib/upgrade/platform.sh, which were previously
removed from ath79 in 3e9d9f6225 "ath79:
sysupgrade: drop unused platform checks". The new function is called
"routerstation_do_upgrade" and will *only* work for the RouterStation
series of boards. It does however retain the ability to downgrade (e.g.
from master -> 17.01.x using sysupgrade -F).
All hardware is functional including the AR8216 switch (for the Pro),
wireless via ath5k/ath9k using the miniPCI slots, flash, USB, button,
and LED.
Switch and LAN/WAN configuration is the same as it is with the
equivalent ar71xx targets. MAC addresses are assigned based upon the
content stored in the RedBoot config partition.
Flashing via both sysupgrade and TFTP has been confirmed to work. Also,
the initramfs images are now raw .bin files instead of being wrapped in
a uImage (as they currently are in ar71xx), which makes them bootable
with RedBoot.
One notable difference to ar71xx is the inclusion of the RedBoot
"fconfig" utility (analogous to U-Boot’s fw_printenv/fw_setenv) in
DEVICE_PACKAGES. The FIS partitions are probed using the RedBoot MTD
parser’s DT binding, whose proper usage is mutually exclusive to
defining a separate fixed-partitions node for "RedBoot config". This
config partition contains the board's base MAC address. The lack of a
hard-coded flash location means that the mtd-mac-address property cannot
be used in the .dts, so instead fconfig is used to read the MAC
addresses from flash in userspace during first boot.
Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
Signed-off-by: Matt Merhar <mattmerhar@protonmail.com>
- fix single spaces hidden by a tab
- replace indentation with spaces by tabs
- make empty lines empty
- drop trailing whitespace
- drop unnecessary blank lines
Signed-off-by: Mathias Kresin <dev@kresin.me>
Signed-off-by: Paul Wassi <p.wassi@gmx.at>
The mt7620 doesn't have a pinmux group named spi_cs1. The cs1 is part
of the "spi refclk" group. The function "spi refclk" enables the second
chip select.
On reset, the pins of the "spi refclk" group are used as reference
clock and GPIO.
Signed-off-by: Mathias Kresin <dev@kresin.me>
This adds a configuration options which is needed now.
Without this patch the geode build will fail.
Fixes: 4eda2fddf2 ("x86/geode: enable X86_INTEL_LPSS to select PINCTRL")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
WNDR3400v3 needs GPIO 21 pulled high to enable power to USB ports. Add a
kernel patch to do that.
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
- Specifications -
CuBox i1:
- SoC: i.MX6 Solo
- Cores: 1
- Memory Size: 512MB
- GPU: GC880
- Wifi/Bluetooth: Optional
- USB 2.0 ports: 2
- Ethernet: 10/100/1000 Mbps
CuBox i2 | i2eX:
- SoC: i.MX6 Dual Lite
- Cores: 2
- Memory Size: 1GB
- GPU: GC2000
- Wifi/Bluetooth: Optional
- USB 2.0 ports: 2
- Ethernet: 10/100/1000 Mbps
CuBox i4Pro | i4x4:
- SoC: i.MX6 Quad
- Cores: 4
- Memory Size: 2/4 GB
- GPU: GC2000
- Wifi/Bluetooth: Build In
- USB 2.0 ports: 2
- Ethernet: 10/100/1000 Mbps
Built-in u-boot requires SPL (secondary program loader) to be present on the SD-card regardless of the image type which will be loaded.
SPL is generated by the u-boot-mx6cuboxi package which is preselected by the target device and can be found in bin/u-boot-mx6cuboxi directory.
Flashing the SPL:
dd if=/dev/zero of=/dev/mmcblk0 bs=1M count=4
dd if=bin/targets/imx6/generic/u-boot-mx6cuboxi/SPL of=/dev/mmcblk0 bs=1K seek=1
Preparing the firmware on the SD-card:
(echo o; echo n; echo p; echo 1; echo ''; echo ''; echo w) | fdisk /dev/mmcblk0
mkfs.ext4 /dev/mmcblk0p1
mount /dev/mmcblk0p1 /mnt
tar -xzf bin/targets/imx6/generic/openwrt-imx6-device-cubox-i-rootfs.tar.gz -C /mnt/
mkdir -p /mnt/boot
cp bin/targets/imx6/generic/{*-uImage,*.dtb,*.scr} /mnt/boot/
Generated u-boot.img needs to be placed on the first partition:
cp bin/targets/imx6/generic/u-boot-mx6cuboxi/u-boot.img /mnt/
To boot from the SD card:
Boot script which sets mmc/dtb parameters and boots the board is automatically sourced.
If this does not work for any reason:
mmc dev 0; load mmc 0:1 $scriptaddr boot/boot.scr; source $scriptaddr
Currently imx6dl-cubox-i.dtb (Dual Lite) and imx6q-cubox-i.dtb (Quad) device trees are available.
Tested on i4Pro, MMC, USB (+ HiD), HDMI and ethernet ports are working.
Wireless and bluetooth are broken ATM. According to SolidRun forums, BCM4329/BCM4330 firmware is used which works fine on older kernels.
Signed-off-by: Vladimir Vid <vladimir.vid@sartura.hr>
Without UHCI a non-trivial number of machines will have no keyboard
without BIOS assistance.
Add XHCI as well in case there are chipsets which don't support legacy
interfaces, and support PCI OHCI controllers also.
Signed-off-by: Alex Maclean <monkeh@monkeh.net>