Re: [OpenWrt-Devel] [PATCH] Enable ATIIXP on x64
On 15/01/16 03:25, Lucian Cristian wrote: > Also support ATI PATA on x64 target > > Signed-off-by: Lucian CristianHas already been NACKd before: https://lists.openwrt.org/pipermail/openwrt-devel/2015-September/036155.html Not entirely sure the situation has changed since then. Regards, Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 1/2] mktplinkfw: add missing exceeding bytes info to logs
Add the info on exceeding bytes also to the remaining log messages. Signed-off-by: Felix Kaechele <fe...@kaechele.ca> --- tools/firmware-utils/src/mktplinkfw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/firmware-utils/src/mktplinkfw.c b/tools/firmware-utils/src/mktplinkfw.c index 4922afb..085eb4c 100644 --- a/tools/firmware-utils/src/mktplinkfw.c +++ b/tools/firmware-utils/src/mktplinkfw.c @@ -709,13 +709,13 @@ static int check_options(void) } else { exceed_bytes = kernel_info.file_size - (rootfs_ofs - sizeof(struct fw_header)); if (exceed_bytes > 0) { - ERR("kernel image is too big"); + ERR("kernel image is too big by %i bytes", exceed_bytes); return -1; } exceed_bytes = rootfs_info.file_size - (fw_max_len - rootfs_ofs); if (exceed_bytes > 0) { - ERR("rootfs image is too big"); + ERR("rootfs image is too big by %i bytes", exceed_bytes); return -1; } } -- 2.4.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 0/2] firmware-utils various fixes
Fix some compiler warnings and missing info on log messages. Felix Kaechele (2): mktplinkfw: add missing exceeding bytes info to logs firmware-utils: fix various compiler warnings tools/firmware-utils/src/dgfirmware.c | 1 + tools/firmware-utils/src/lzma2eva.c | 2 +- tools/firmware-utils/src/mkhilinkfw.c | 1 + tools/firmware-utils/src/mktplinkfw.c | 4 ++-- tools/firmware-utils/src/spw303v.c| 1 + tools/firmware-utils/src/srec2bin.c | 2 +- tools/firmware-utils/src/wrt400n.c| 2 ++ tools/firmware-utils/src/zyxbcm.c | 1 + 8 files changed, 10 insertions(+), 4 deletions(-) -- 2.4.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 2/2] firmware-utils: fix various compiler warnings
mostly implicit defines due to missing includes plus one const that shouldn't be one. Signed-off-by: Felix Kaechele <fe...@kaechele.ca> --- tools/firmware-utils/src/dgfirmware.c | 1 + tools/firmware-utils/src/lzma2eva.c | 2 +- tools/firmware-utils/src/mkhilinkfw.c | 1 + tools/firmware-utils/src/spw303v.c| 1 + tools/firmware-utils/src/srec2bin.c | 2 +- tools/firmware-utils/src/wrt400n.c| 2 ++ tools/firmware-utils/src/zyxbcm.c | 1 + 7 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/firmware-utils/src/dgfirmware.c b/tools/firmware-utils/src/dgfirmware.c index 5ff3b69..e3257f1 100644 --- a/tools/firmware-utils/src/dgfirmware.c +++ b/tools/firmware-utils/src/dgfirmware.c @@ -1,5 +1,6 @@ #include #include +#include #define IMG_SIZE 0x3e diff --git a/tools/firmware-utils/src/lzma2eva.c b/tools/firmware-utils/src/lzma2eva.c index 0bc13fa..1d7e364 100644 --- a/tools/firmware-utils/src/lzma2eva.c +++ b/tools/firmware-utils/src/lzma2eva.c @@ -48,7 +48,7 @@ main(int argc, char *argv[]) const char *infile, *outfile; FILE *in, *out; - static const uint8_t buf[4096]; + static uint8_t buf[4096]; size_t elems; uint8_t properties; diff --git a/tools/firmware-utils/src/mkhilinkfw.c b/tools/firmware-utils/src/mkhilinkfw.c index 99322d4..55908e5 100644 --- a/tools/firmware-utils/src/mkhilinkfw.c +++ b/tools/firmware-utils/src/mkhilinkfw.c @@ -22,6 +22,7 @@ * gcc -lcrypto hlkcrypt.c -o hlkcrypt */ +#include #include #include #include diff --git a/tools/firmware-utils/src/spw303v.c b/tools/firmware-utils/src/spw303v.c index ae34a1e..654d68d 100644 --- a/tools/firmware-utils/src/spw303v.c +++ b/tools/firmware-utils/src/spw303v.c @@ -18,6 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include diff --git a/tools/firmware-utils/src/srec2bin.c b/tools/firmware-utils/src/srec2bin.c index 1cffbae..5cc71bd 100644 --- a/tools/firmware-utils/src/srec2bin.c +++ b/tools/firmware-utils/src/srec2bin.c @@ -513,7 +513,7 @@ int srec2bin(int argc,char *argv[],int verbose) return(1); } -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { debug = TRUE; debug = FALSE; diff --git a/tools/firmware-utils/src/wrt400n.c b/tools/firmware-utils/src/wrt400n.c index a9a4908..1cf1deb 100644 --- a/tools/firmware-utils/src/wrt400n.c +++ b/tools/firmware-utils/src/wrt400n.c @@ -7,12 +7,14 @@ * * Author: Sandeep Mistry */ +#include #include #include #include #include #include #include +#include #include "cyg_crc.h" diff --git a/tools/firmware-utils/src/zyxbcm.c b/tools/firmware-utils/src/zyxbcm.c index cfd00d3..ffeb7cc 100644 --- a/tools/firmware-utils/src/zyxbcm.c +++ b/tools/firmware-utils/src/zyxbcm.c @@ -18,6 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include -- 2.4.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Broadcom Wireless AC Driver
On 25/10/15 23:27, openwr...@ruggedinbox.com wrote: > I came across the source code for the broadcom > wireless AC driver in a GPL release(I won't say from where so that they > don't get in trouble). I've attached the driver to this email. This is not helpful. If at all this will make developing an open source driver even harder and more time consuming since this creates a similar situation to what ReactOS developers got into after the Windows source code leak happened: They had to have their code audited that no code from the illegally leaked proprietary Windows code made it into the open source React OS code (google for Clean room design if you want to know more about that). Furthermore you created a situation in which the OpenWrt community as well as other providers donating capacity to the community for carrying the mailing list involuntarily distribute or mirror this proprietary code. This is where your good intentions likely will yield bad results. Regards, Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 1/2] ar71xx: fix ath79_soc_rev value for QCA9531 ver. 2
Tested-by: Felix Kaechele <fe...@kaechele.ca> ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 2/2] x86/64: 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 <hef...@fedoraproject.org> --- target/linux/x86/64/config-default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/x86/64/config-default b/target/linux/x86/64/config-default index 0c5297d..4432408 100644 --- a/target/linux/x86/64/config-default +++ b/target/linux/x86/64/config-default @@ -31,7 +31,6 @@ CONFIG_ARCH_SUPPORTS_INT128=y CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y # CONFIG_ASUS_LAPTOP is not set -# CONFIG_ATA_SFF is not set CONFIG_AUDIT_ARCH=y CONFIG_AVERAGE=y CONFIG_BLK_DEV_INTEGRITY=y @@ -134,6 +133,7 @@ CONFIG_PARAVIRT_CLOCK=y # CONFIG_PARAVIRT_DEBUG is not set # CONFIG_PARAVIRT_SPINLOCKS is not set # CONFIG_PARAVIRT_TIME_ACCOUNTING is not set +CONFIG_PATA_ATIIXP=y CONFIG_PCIEAER=y CONFIG_PCIEPORTBUS=y # CONFIG_PCI_IOAPIC is not set -- 2.4.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 2/3] 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 <hef...@fedoraproject.org> --- target/linux/x86/generic/config-default | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/x86/generic/config-default b/target/linux/x86/generic/config-default index c434a59..29e5845 100644 --- a/target/linux/x86/generic/config-default +++ b/target/linux/x86/generic/config-default @@ -152,6 +152,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 -- 2.4.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 1/3] x86/generic: refresh subtarget kernel config
Signed-off-by: Felix Kaechele <hef...@fedoraproject.org> --- target/linux/x86/generic/config-default | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/target/linux/x86/generic/config-default b/target/linux/x86/generic/config-default index eb4b357..c434a59 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,8 @@ 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_CRYPTO_RNG2=y +CONFIG_CRYPTO_WORKQUEUE=y CONFIG_DMA_SHARED_BUFFER=y CONFIG_DMI=y # CONFIG_DMIID is not set @@ -120,7 +120,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 +172,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 -- 2.4.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 0/3] x86/generic: add bits to support Futro thin-clients
Hi list, As suggested I transferred my patches to support the Futro thin-clients to the x86-generic target to keep x86-64 legacy free. Additionally I enabled the DRM driver for the graphics chip to have modesetting available. Regards, Felix Felix Kaechele (3): x86/generic: refresh subtarget kernel config x86/generic: enable pata_atiixp driver x86/generic: enable radeon drm driver target/linux/x86/generic/config-default | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) -- 2.4.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] scripts: fix getver git dir check
Git internals are referenced by .git which isn't necessarily a directory. It may also be a file that references the actual .git directory using the gitdir directive. If .git is assumed to be a directory the build will not be able to get the correct version when openwrt is included as a git submodule because when used as a submodule .git will actually be a file referencing to a subdirectory in the parent's git dir. When the correct version is not detected some image generation tools will fail because the OpenWrt string will be 'OpenWrtunknown' which is too long for some header formats. Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- scripts/getver.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/getver.sh b/scripts/getver.sh index 8bb384b..4643ca6 100755 --- a/scripts/getver.sh +++ b/scripts/getver.sh @@ -17,7 +17,7 @@ try_svn() { } try_git() { - [ -d .git ] || return 1 + [ -e .git ] || return 1 REV=$(git log | grep -m 1 git-svn-id | awk '{ gsub(/.*@/, , $0); print $1 }') REV=${REV:+r$REV} [ -n $REV ] -- 2.1.0 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] OpenWRT support for MPR-A1
Am 04.10.2014 um 03:43 schrieb Stefan Monnier: AFAICT OpenWRT comes with some support for the Hame MPR-A1 thingy (although its 16MB of RAM and 4MB of flash probably prevent it from being fully supported). Yes, the MPR-A1 is supported. Also fully so, but it's pretty much impossible to get LuCI to work on it with acceptable performance at just 16MB of RAM. The page for MPR-A2 (whose hardware and firmware seem very similar) says that the image can be installed via the factory web UI. Does someone know if that would work for the MPR-A1 as well? Probably not. As far as I remember at least some MPR-A1 use a kind of XOR obfuscation to encrypt their firmware image. We implemented a tool to create or extract these kind of images called mkporayfw (hint: it's in tools/firmware-utils, if you successfully completed a build already you should find binaries for it in build_dir/host/firmware-utils/bin). You use it like this to create a factory image for the MPR-A1: ./mkporayfw -B MPR-A1 -f path to your MPR-A1 squashfs-sysupgrade.bin -o output-filename.bin I wonder why no one got around to implementing the automatic generation of obfuscated images in target/linux/ramips/image/Makefile like we did for the Poray boards. And if it doesn't work, would it just immediately fail, leaving the factory firmware untouched, or would it result in an unbootable machine (and if so would it be recoverable via the serial console)? That I don't know. I never owned a MPR-A1. But what these devices have in common is that they all use Ralink's u-boot. That means you will be able to recover from a bad flash using the console for input and TFTP for file transfer (unless you overwrite the bootloader in flash on purpose or by accident, although I never had that happen to me while heavily fiddling around with all the other RT5350 boards I have.) My guess would be it will fail if obfuscation is active on your board's factory firmware and the image has the incorrect checksum after obfuscation or wasn't obfuscated at all. If the checksum is correct it will probably flash whatever you throw at it. That means that you might very well render your board unbootable (also in the extended sense of board does boot but no network connection to it is possible) but not unrecoverable. However, the images built through the OpenWrt build system should generally boot okay. Regards, Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] [tools] firmware-utils: add NEXX factory image support
This patch adds support to encode and decode images for certain types of NEXX routers. --- tools/firmware-utils/src/mkporayfw.c | 16 1 file changed, 16 insertions(+) diff --git a/tools/firmware-utils/src/mkporayfw.c b/tools/firmware-utils/src/mkporayfw.c index b4d5d78..8e0cf24 100644 --- a/tools/firmware-utils/src/mkporayfw.c +++ b/tools/firmware-utils/src/mkporayfw.c @@ -58,6 +58,8 @@ #define HWID_PORAY_X5_X6 0x35353335 #define HWID_PORAY_X8 0x36353335 #define HWID_PORAY_X1 0x38353335 +#define HWID_NEXX_WT15XXX 0x30353332 +#define HWID_NEXX_WT3020A 0x30323033 /* Recognized XOR obfuscation keys */ #define KEY_HAME 0 @@ -65,6 +67,8 @@ #define KEY_PORAY_22 #define KEY_PORAY_33 #define KEY_PORAY_44 +#define KEY_NEXX_1 5 +#define KEY_NEXX_2 6 /* XOR key length */ #define KEY_LEN15 @@ -117,6 +121,8 @@ static uint8_t key[][KEY_LEN] = { {0xC9, 0x1C, 0x3A, 0x93, 0x92, 0x95, 0xC3, 0x63, 0xD0, 0xA3, 0x9C, 0x92, 0x2E, 0xE6, 0xC7}, {0x19, 0x1B, 0x3A, 0x93, 0x92, 0x95, 0xC3, 0x63, 0xD0, 0xA3, 0x9C, 0x92, 0x2E, 0xE6, 0xC7}, {0x79, 0x7B, 0x7A, 0x93, 0x92, 0x95, 0xC3, 0x63, 0xD0, 0xA3, 0x9C, 0x92, 0x2E, 0xE6, 0xC7}, + {0x19, 0x1C, 0x4A, 0x93, 0x96, 0x95, 0xC3, 0x63, 0xD0, 0xA3, 0x9C, 0x92, 0x2E, 0x16, 0xC6}, + {0x39, 0x1C, 0x4A, 0x93, 0x96, 0x95, 0xC3, 0x63, 0xD0, 0xA3, 0x9C, 0x92, 0x2E, 0x16, 0xC6}, }; static struct flash_layout layouts[] = { @@ -198,6 +204,16 @@ static struct board_info boards[] = { .layout_id = 8M, .key= KEY_PORAY_1, }, { + .id = WT15XXX, + .hw_id = HWID_NEXX_WT15XXX, + .layout_id = 4M, + .key= KEY_NEXX_1, + }, { + .id = WT3020A, + .hw_id = HWID_NEXX_WT3020A, + .layout_id = 4M, + .key= KEY_NEXX_2, + }, { /* terminating entry */ } }; -- 1.9.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] kirkwood / missing kernel-module?
Hi Bastian, On 20.08.2014 12:05 Bastian Bittorf wrote: during boot i see in a long loop these messages, which kernel module is missing or which symbol must be active? (kernel 3.14.17) That is very strange. I ran a make dirclean and built r42230 today for my Pogoplug E02. Both u-boot and OpenWrt run without any hitches. Have you tried running a dirclean and building with a clean buildroot? Regards, Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] kirkwood / howto make bootloader
On 19.08.2014 16:42 Bastian Bittorf wrote: under http://downloads.openwrt.org/barrier_breaker/14.07-rc3/kirkwood/generic/uboot-kirkwood-goflexhome/ i can see the kwb-files, but how can i build them? (when building generic or a subtarget they will not show up) In menuconfig: - Select Marvell Kirkwood as Target System. - Go to Boot Loaders - select the correct bootloader for your target. Regards, Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 3/3] package: uboot-envtools: add Pogoplug E02 support
The settings require that the OpenWrt provided u-boot is used as either first or second stage bootloader as it modifies the partitioning scheme to move the u-boot environment to a separate mtd partition. Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- package/boot/uboot-envtools/files/kirkwood | 1 + 1 file changed, 1 insertion(+) diff --git a/package/boot/uboot-envtools/files/kirkwood b/package/boot/uboot-envtools/files/kirkwood index f665d2d..017b543 100644 --- a/package/boot/uboot-envtools/files/kirkwood +++ b/package/boot/uboot-envtools/files/kirkwood @@ -11,6 +11,7 @@ touch /etc/config/ubootenv . /lib/functions.sh case `cat /proc/device-tree/model` in +Cloud Engines Pogoplug E02 | \ RaidSonic ICY BOX IB-NAS62x0 (Rev B)) ubootenv_add_uci_config /dev/mtd1 0x0 0x2 0x2 ;; -- 1.9.0 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 2/3] package: uboot-kirkwood: re-add Pogoplug E02 support
This patch modifies the u-boot config for the Pogoplug E02 to work with OpenWRT. It also enables building a second stage bootloader image. Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- package/boot/uboot-kirkwood/Makefile | 6 ++- .../uboot-kirkwood/patches/140-pogoplug_e02.patch | 58 ++ .../patches/200-openwrt-config.patch | 2 +- 3 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch diff --git a/package/boot/uboot-kirkwood/Makefile b/package/boot/uboot-kirkwood/Makefile index 4504669..0f03143 100644 --- a/package/boot/uboot-kirkwood/Makefile +++ b/package/boot/uboot-kirkwood/Makefile @@ -61,6 +61,10 @@ define uboot/pogo_e02 TITLE:=U-Boot for Cloud Engines Pogoplug E02 endef +define uboot/pogo_e02_second_stage + TITLE:=second stage U-Boot for Cloud Engines Pogoplug E02 +endef + define uboot/sheevaplug TITLE:=U-Boot for SheevaPlug endef @@ -70,7 +74,7 @@ UBOOTS:= \ goflexhome \ ib62x0 ib62x0_second_stage \ iconnect iconnect_second_stage \ - pogo_e02 \ + pogo_e02 pogo_e02_second_stage \ sheevaplug define Package/uboot/template diff --git a/package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch b/package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch new file mode 100644 index 000..b8c9c12 --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch @@ -0,0 +1,58 @@ +--- a/boards.cfg b/boards.cfg +@@ -168,6 +168,7 @@ Active arm arm926ejs davin + Active arm arm926ejs kirkwoodbuffalo lsxl lschlv2 lsxl:LSCHLV2 Michael Walle mich...@walle.cc + Active arm arm926ejs kirkwoodbuffalo lsxl lsxhllsxl:LSXHL Michael Walle mich...@walle.cc + Active arm arm926ejs kirkwoodcloudengines- pogo_e02 - Dave Purdy david.c.pu...@gmail.com ++Active arm arm926ejs kirkwoodcloudenginespogo_e02 pogo_e02_second_stagepogo_e02:SECOND_STAGE Felix Kaechele fe...@fetzig.org + Active arm arm926ejs kirkwoodd-link - dns325 - Stefan Herbrechtsmeier ste...@code.herbrechtsmeier.net + Active arm arm926ejs kirkwoodiomega - iconnect - Luka Perkov l...@openwrt.org + Active arm arm926ejs kirkwoodiomega iconnect iconnect_second_stageiconnect:SECOND_STAGE Luka Perkov l...@openwrt.org +--- a/include/configs/pogo_e02.h b/include/configs/pogo_e02.h +@@ -62,23 +62,35 @@ + #endif + + #define CONFIG_ENV_SIZE 0x2 /* 128k */ +-#define CONFIG_ENV_OFFSET 0x6 /* env starts here */ ++#define CONFIG_ENV_OFFSET 0xe /* env starts here */ + + /* + * Default environment variables + */ + #define CONFIG_BOOTCOMMAND \ +- setenv bootargs $(bootargs_console); \ +- run bootcmd_usb; \ +- bootm 0x0080 0x0110 ++ setenv bootargs ${console} ${mtdparts} ${bootargs_root}; \ ++ ubi part root; \ ++ ubifsmount ubi:rootfs; \ ++ ubifsload 0x80 ${kernel}; \ ++ ubifsload 0x70 ${fdt}; \ ++ ubifsumount; \ ++ fdt addr 0x70; fdt resize; fdt chosen; \ ++ bootz 0x80 - 0x70 ++ ++#define CONFIG_MTDPARTS \ ++ mtdparts=orion_nand: \ ++ 0xe@0x0(uboot), \ ++ 0x2@0xe(uboot_env), \ ++ 0x10@0x10(second_stage_uboot), \ ++ -@0x20(root)\0 + + #define CONFIG_EXTRA_ENV_SETTINGS \ +- mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage), \ +- 32M(rootfs),-(data)\0\ +- mtdids=nand0=orion_nand\0\ +- bootargs_console=console=ttyS0,115200\0 \ +- bootcmd_usb=usb start; ext2load usb 0:1 0x0080 /uImage; \ +- ext2load usb 0:1 0x0110
[OpenWrt-Devel] [PATCH 0/3] Pogoplug E02 support for kernel 3.14
This patchset brings the support for the Cloud Engines Pogoplug E02 up to speed for kernel 3.14 and u-boot 2014.04. The intention is to also upstream the kernel specific patches separately. Running u-boot in both first and second stage configuration, as well as flashing the ubifs image to the device was tested on actual hardware. Felix Kaechele (3): kirkwood: Pogoplug E02 kernel support for 3.14 package: uboot-kirkwood: re-add Pogoplug E02 support package: uboot-envtools: add Pogoplug E02 support package/boot/uboot-envtools/files/kirkwood | 1 + package/boot/uboot-kirkwood/Makefile | 6 +- .../uboot-kirkwood/patches/140-pogoplug_e02.patch | 58 ++ .../patches/200-openwrt-config.patch | 2 +- .../kirkwood/patches-3.14/150-pogoplug_e02.patch | 127 + target/linux/kirkwood/profiles/120-pogoplug.mk | 2 +- 6 files changed, 193 insertions(+), 3 deletions(-) create mode 100644 package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch create mode 100644 target/linux/kirkwood/patches-3.14/150-pogoplug_e02.patch -- 1.9.0 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 1/3] kirkwood: Pogoplug E02 kernel support for 3.14
this also fixes a typo in the UBIFS_OPTS Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- .../kirkwood/patches-3.14/150-pogoplug_e02.patch | 127 + target/linux/kirkwood/profiles/120-pogoplug.mk | 2 +- 2 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 target/linux/kirkwood/patches-3.14/150-pogoplug_e02.patch diff --git a/target/linux/kirkwood/patches-3.14/150-pogoplug_e02.patch b/target/linux/kirkwood/patches-3.14/150-pogoplug_e02.patch new file mode 100644 index 000..44b4c52 --- /dev/null +++ b/target/linux/kirkwood/patches-3.14/150-pogoplug_e02.patch @@ -0,0 +1,127 @@ +--- a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile +@@ -112,6 +112,7 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood- + kirkwood-nsa310a.dtb \ + kirkwood-openblocks_a6.dtb \ + kirkwood-openblocks_a7.dtb \ ++ kirkwood-pogo_e02.dtb \ + kirkwood-sheevaplug.dtb \ + kirkwood-sheevaplug-esata.dtb \ + kirkwood-topkick.dtb \ +--- /dev/null b/arch/arm/boot/dts/kirkwood-pogo_e02.dts +@@ -0,0 +1,114 @@ ++/dts-v1/; ++ ++#include kirkwood.dtsi ++#include kirkwood-6281.dtsi ++ ++/ { ++ model = Cloud Engines Pogoplug E02; ++ compatible = cloudengines,pogoe02, marvell,kirkwood-88f6281, marvell,kirkwood; ++ ++ memory { ++ device_type = memory; ++ reg = 0x 0x1000; ++ }; ++ ++ chosen { ++ bootargs = console=ttyS0,115200n8 earlyprintk; ++ }; ++ ++ ocp@f100 { ++ pinctrl: pinctrl@1 { ++ pmx_usb_power_enable: pmx-usb-power-enable { ++ marvell,pins = mpp29; ++ marvell,function = gpio; ++ }; ++ pmx_led_green: pmx-led_green { ++ marvell,pins = mpp48; ++ marvell,function = gpio; ++ }; ++ pmx_led_orange: pmx-led_orange { ++ marvell,pins = mpp49; ++ marvell,function = gpio; ++ }; ++ }; ++ serial@12000 { ++ status = ok; ++ }; ++ }; ++ gpio-leds { ++ compatible = gpio-leds; ++ pinctrl-0 = pmx_usb_power_enable pmx_led_orange ++pmx_led_green ; ++ pinctrl-names = default; ++ ++ health { ++ label = status:green:health; ++ gpios = gpio1 16 GPIO_ACTIVE_LOW; ++ default-state = keep; ++ }; ++ fault { ++ label = status:orange:fault; ++ gpios = gpio1 17 GPIO_ACTIVE_LOW; ++ }; ++ }; ++ regulators { ++ compatible = simple-bus; ++ #address-cells = 1; ++ #size-cells = 0; ++ pinctrl-0 = pmx_usb_power_enable; ++ pinctrl-names = default; ++ ++ usb_power: regulator@1 { ++ compatible = regulator-fixed; ++ reg = 1; ++ regulator-name = USB Power; ++ regulator-min-microvolt = 500; ++ regulator-max-microvolt = 500; ++ enable-active-high; ++ regulator-always-on; ++ regulator-boot-on; ++ gpio = gpio0 29 GPIO_ACTIVE_HIGH; ++ }; ++ }; ++}; ++ ++nand { ++ chip-delay = 40; ++ status = okay; ++ ++ partition@0 { ++ label = u-boot; ++ reg = 0x000 0x10; ++ read-only; ++ }; ++ ++ partition@10 { ++ label = uImage; ++ reg = 0x010 0x40; ++ }; ++ ++ partition@50 { ++ label = pogoplug; ++ reg = 0x050 0x200; ++ }; ++ ++ partition@250 { ++ label = root; ++ reg = 0x0250 0x5b0; ++ }; ++}; ++ ++mdio { ++ status = okay; ++ ++ ethphy0: ethernet-phy@0 { ++ reg = 0; ++ }; ++}; ++ ++eth0 { ++ status = okay; ++ ethernet0-port@0 { ++ phy-handle = ethphy0; ++ }; ++}; diff --git a/target/linux/kirkwood/profiles/120-pogoplug.mk b/target/linux/kirkwood/profiles/120-pogoplug.mk index 47672f1..d712dcb 100644 --- a/target/linux/kirkwood/profiles/120-pogoplug.mk +++ b/target/linux/kirkwood/profiles/120-pogoplug.mk @@ -15,7 +15,7 @@ define Profile/POGOE02/Description Package set compatible with Cloud Engines Pogoplug E02 board. endef -POGOE02_UBIFS_OPTS:=-m 2048 -e 128KiB -c 4096 +POGOE02_UBIFS_OPTS:=-m 2048 -e 126KiB -c 4096 POGOE02_UBI_OPTS:=-m 2048 -p 128KiB -s 512 $(eval $(call Profile,POGOE02)) -- 1.9.0
Re: [OpenWrt-Devel] About upstream advanced features for AR8337N switch
I can only guess as to what specifically he is talking about but CAF stands for Code Aurora Forum (codeaurora.org). See their About page for what this exactly is. QCA maintains their own version of OpenWrt. It's quite a good source for information on new QCA hardware and how to interface with it. So there might be some code there that QCA officially contributed that supports the advanced features of the AR8337N. For example, see this commit regarding AR8337N support: https://www.codeaurora.org/cgit/quic/qsdk/oss/system/openwrt/commit/target/linux/generic/files/drivers/net/phy/ar8216.c?h=release/banana_ed3id=c8d3b9f0326252f65f7724dab0eab7cf529f2712 Regards, Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 1/2] ar71xx: add rssileds for Ubiquiti XM boards
Adds support for the received signal strength indicator LEDs of the Bullet M, Nanostation M and Rocket M devices. Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- target/linux/ar71xx/base-files/etc/uci-defaults/01_leds | 9 + 1 file changed, 9 insertions(+) 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 a986dbc..4376f72 100755 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds @@ -32,6 +32,15 @@ ap113) ucidef_set_led_usbdev usb USB ap113:green:usb 1-1 ;; +bullet-m | \ +nanostation-m | \ +rocket-m) + ucidef_set_led_rssi rssilow RSSILOW ubnt:red:link1 wlan0 1 100 0 13 + ucidef_set_led_rssi rssimediumlow RSSIMEDIUMLOW ubnt:orange:link2 wlan0 26 100 -25 13 + ucidef_set_led_rssi rssimediumhigh RSSIMEDIUMHIGH ubnt:green:link3 wlan0 51 100 -50 13 + ucidef_set_led_rssi rssihigh RSSIHIGH ubnt:green:link4 wlan0 76 100 -75 13 + ;; + bxu2000n-2-a1) ucidef_set_led_wlan wlan WLAN bhu:green:wlan phy0tpt ;; -- 1.9.0 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 2/2] ar71xx: fix typos in TP-Link rssileds definition
Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- target/linux/ar71xx/base-files/etc/uci-defaults/01_leds | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 4376f72..e22abb2 100755 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds @@ -201,7 +201,7 @@ tl-wa750re) ucidef_set_led_wlan wlan WLAN tp-link:orange:wlan phy0tpt ucidef_set_rssimon wlan0 4 1 ucidef_set_led_rssi rssilow RSSILOW tp-link:orange:signal1 wlan0 1 100 0 13 - ucidef_set_led_rssi rssimediumlow RSSIMEDIUMHIGH tp-link:orange:signal2 wlan0 20 100 -19 13 + ucidef_set_led_rssi rssimediumlow RSSIMEDIUMLOW tp-link:orange:signal2 wlan0 20 100 -19 13 ucidef_set_led_rssi rssimedium RSSIMEDIUM tp-link:orange:signal3 wlan0 40 100 -39 13 ucidef_set_led_rssi rssimediumhigh RSSIMEDIUMHIGH tp-link:orange:signal4 wlan0 60 100 -59 13 ucidef_set_led_rssi rssihigh RSSIHIGH tp-link:orange:signal5 wlan0 80 100 -79 13 @@ -212,7 +212,7 @@ tl-wa850re) ucidef_set_led_wlan wlan WLAN tp-link:blue:wlan phy0tpt ucidef_set_rssimon wlan0 4 1 ucidef_set_led_rssi rssilow RSSILOW tp-link:blue:signal1 wlan0 1 100 0 13 - ucidef_set_led_rssi rssimediumlow RSSIMEDIUMHIGH tp-link:blue:signal2 wlan0 20 100 -19 13 + ucidef_set_led_rssi rssimediumlow RSSIMEDIUMLOW tp-link:blue:signal2 wlan0 20 100 -19 13 ucidef_set_led_rssi rssimedium RSSIMEDIUM tp-link:blue:signal3 wlan0 40 100 -39 13 ucidef_set_led_rssi rssimediumhigh RSSIMEDIUMHIGH tp-link:blue:signal4 wlan0 60 100 -59 13 ucidef_set_led_rssi rssihigh RSSIHIGH tp-link:blue:signal5 wlan0 80 100 -79 13 -- 1.9.0 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Found the issue with the N750
I cannot reproduce the issue. To test this it would be great if you could send me the output of iw dev wlan0 station dump from the device for both versions (i.e. with fix applied, without fix applied). Check that there is at least one station connected to the 2.4 GHz wmac and also make sure that you don't move this station between the two tests so we can get a direct comparison of signal strength. For me the signal strength to a Jolla phone from about 4m distance is about -44 dBm with LNAs enabled and below -68 dBm with LNAs disabled. The former is what I currently get with running trunk without any further patches applied. By the way: The 5 GHz band should be totally unaffected by this as it doesn't control it's LNAs via GPIO lines. Regards, Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Found the issue with the N750
Luis E. Garcia wrote: Felix, Do you know of a way to check the status of the GPIOs from the command line? cat /sys/kernel/debug/gpio Regards, Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Found the issue with the N750
Luis E. Garcia wrote: Felix, Do you know of a way to check the status of the GPIOs from the command line? cat /sys/kernel/debug/gpio Regards, Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] MyNET N750 - Actually turn the LNA on.
I guess you got that piece of code wrong. The first argument to the ath79_wmac_set_ext_lna_gpio function refers to the TX chain, not the value to be written to the GPIO. So everything is fine here. Regards, Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] ar71xx: mynet-n750: define LEDs connected to the AR8327 switch
Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- .../linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c index a8335cc..9d69dc5 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c @@ -98,6 +98,19 @@ static struct gpio_keys_button mynet_n750_gpio_keys[] __initdata = { }, }; +static const struct ar8327_led_info mynet_n750_leds_ar8327[] __initconst = { + AR8327_LED_INFO(PHY0_0, HW, wd:green:lan1), + AR8327_LED_INFO(PHY1_0, HW, wd:green:lan2), + AR8327_LED_INFO(PHY2_0, HW, wd:green:lan3), + AR8327_LED_INFO(PHY3_0, HW, wd:green:lan4), + AR8327_LED_INFO(PHY4_0, HW, wd:green:wan), + AR8327_LED_INFO(PHY0_1, HW, wd:yellow:lan1), + AR8327_LED_INFO(PHY1_1, HW, wd:yellow:lan2), + AR8327_LED_INFO(PHY2_1, HW, wd:yellow:lan3), + AR8327_LED_INFO(PHY3_1, HW, wd:yellow:lan4), + AR8327_LED_INFO(PHY4_1, HW, wd:yellow:wan), +}; + static struct ar8327_pad_cfg mynet_n750_ar8327_pad0_cfg = { .mode = AR8327_PAD_MAC_RGMII, .txclk_delay_en = true, @@ -124,6 +137,8 @@ static struct ar8327_platform_data mynet_n750_ar8327_data = { .rxpause = 1, }, .led_cfg = mynet_n750_ar8327_led_cfg, + .num_leds = ARRAY_SIZE(mynet_n750_leds_ar8327), + .leds = mynet_n750_leds_ar8327, }; static struct mdio_board_info mynet_n750_mdio0_info[] = { -- 1.8.4.2 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 2/2] ar71xx: Fix WD My Net N750 weak signal issue
The LNAs need to be enabled by setting their respective GPIO to high even though the original firmware's setting sets them to low on initialization. Obviously the LNAs are then later initialized by the driver on the OEM firmware. Without this fix the device is mostly deaf. Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c index a44a7e0..737bec2 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c @@ -179,10 +179,10 @@ static void __init mynet_n750_setup(void) * board/ar7240/db12x/alpha_gpio.c */ gpio_request_one(MYNET_N750_GPIO_EXTERNAL_LNA0, -GPIOF_OUT_INIT_LOW | GPIOF_EXPORT_DIR_FIXED, +GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED, External LNA0); gpio_request_one(MYNET_N750_GPIO_EXTERNAL_LNA1, -GPIOF_OUT_INIT_LOW | GPIOF_EXPORT_DIR_FIXED, +GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED, External LNA1); mynet_n750_get_mac(wlan24mac=, tmpmac); -- 1.8.4.2 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] weak signal MyNet n600
Please test these two patches. They should fix the weak signal problem. I'd be especially interested in having the N600 one tested as I don't own a N600 and I changed the GPIO code a bit. Please check if all LEDs light up correctly (I added the yellow LAN LEDs also). Felix Kaechele (2): ar71xx: Fix WD My Net N600 GPIO definitions ar71xx: Fix WD My Net N750 weak signal issue .../ar71xx/files/arch/mips/ath79/mach-mynet-n600.c | 66 -- .../ar71xx/files/arch/mips/ath79/mach-mynet-n750.c | 4 +- 2 files changed, 50 insertions(+), 20 deletions(-) -- 1.8.4.2 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 1/2] ar71xx: Fix WD My Net N600 GPIO definitions
This also fixes the weak signal that can be observed on the router Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- .../ar71xx/files/arch/mips/ath79/mach-mynet-n600.c | 66 -- 1 file changed, 48 insertions(+), 18 deletions(-) diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n600.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n600.c index 476cff8..861528e 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n600.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n600.c @@ -34,14 +34,22 @@ #define MYNET_N600_GPIO_LED_INTERNET 12 #define MYNET_N600_GPIO_LED_WPS13 -#define MYNET_N600_GPIO_LED_LAN1 4 -#define MYNET_N600_GPIO_LED_LAN2 3 -#define MYNET_N600_GPIO_LED_LAN3 2 -#define MYNET_N600_GPIO_LED_LAN4 1 +#define MYNET_N600_GPIO_LED_LAN1_GREEN 4 +#define MYNET_N600_GPIO_LED_LAN2_GREEN 3 +#define MYNET_N600_GPIO_LED_LAN3_GREEN 2 +#define MYNET_N600_GPIO_LED_LAN4_GREEN 1 + +#define MYNET_N600_GPIO_LED_LAN1_YELLOW22 +#define MYNET_N600_GPIO_LED_LAN2_YELLOW21 +#define MYNET_N600_GPIO_LED_LAN3_YELLOW20 +#define MYNET_N600_GPIO_LED_LAN4_YELLOW19 #define MYNET_N600_GPIO_BTN_RESET 16 #define MYNET_N600_GPIO_BTN_WPS17 +#define MYNET_N600_GPIO_EXTERNAL_LNA0 14 +#define MYNET_N600_GPIO_EXTERNAL_LNA1 15 + #define MYNET_N600_KEYS_POLL_INTERVAL 20 /* msecs */ #define MYNET_N600_KEYS_DEBOUNCE_INTERVAL (3 * MYNET_N600_KEYS_POLL_INTERVAL) @@ -76,22 +84,42 @@ static struct gpio_led mynet_n600_leds_gpio[] __initdata = { }, { .name = wd:green:lan1, - .gpio = MYNET_N600_GPIO_LED_LAN1, + .gpio = MYNET_N600_GPIO_LED_LAN1_GREEN, .active_low = 1, }, { .name = wd:green:lan2, - .gpio = MYNET_N600_GPIO_LED_LAN2, + .gpio = MYNET_N600_GPIO_LED_LAN2_GREEN, .active_low = 1, }, { .name = wd:green:lan3, - .gpio = MYNET_N600_GPIO_LED_LAN3, + .gpio = MYNET_N600_GPIO_LED_LAN3_GREEN, .active_low = 1, }, { .name = wd:green:lan4, - .gpio = MYNET_N600_GPIO_LED_LAN4, + .gpio = MYNET_N600_GPIO_LED_LAN4_GREEN, + .active_low = 1, + }, + { + .name = wd:yellow:lan1, + .gpio = MYNET_N600_GPIO_LED_LAN1_YELLOW, + .active_low = 1, + }, + { + .name = wd:yellow:lan2, + .gpio = MYNET_N600_GPIO_LED_LAN2_YELLOW, + .active_low = 1, + }, + { + .name = wd:yellow:lan3, + .gpio = MYNET_N600_GPIO_LED_LAN3_YELLOW, + .active_low = 1, + }, + { + .name = wd:yellow:lan4, + .gpio = MYNET_N600_GPIO_LED_LAN4_YELLOW, .active_low = 1, }, }; @@ -135,16 +163,6 @@ static void __init mynet_n600_setup(void) ath79_register_m25p80(NULL); - ath79_gpio_output_select(MYNET_N600_GPIO_LED_LAN1, -AR934X_GPIO_OUT_GPIO); - ath79_gpio_output_select(MYNET_N600_GPIO_LED_LAN2, -AR934X_GPIO_OUT_GPIO); - ath79_gpio_output_select(MYNET_N600_GPIO_LED_LAN3, -AR934X_GPIO_OUT_GPIO); - ath79_gpio_output_select(MYNET_N600_GPIO_LED_LAN4, -AR934X_GPIO_OUT_GPIO); - ath79_gpio_output_select(MYNET_N600_GPIO_LED_INTERNET, -AR934X_GPIO_OUT_GPIO); ath79_register_leds_gpio(-1, ARRAY_SIZE(mynet_n600_leds_gpio), mynet_n600_leds_gpio); @@ -152,6 +170,18 @@ static void __init mynet_n600_setup(void) ARRAY_SIZE(mynet_n600_gpio_keys), mynet_n600_gpio_keys); + /* +* Control signal for external LNAs 0 and 1 +* Taken from GPL bootloader source: +* board/ar7240/db12x/alpha_gpio.c +*/ + gpio_request_one(MYNET_N600_GPIO_EXTERNAL_LNA0, +GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED, +External LNA0); + gpio_request_one(MYNET_N600_GPIO_EXTERNAL_LNA1, +GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED, +External LNA1); + mynet_n600_get_mac(wlan24mac=, tmpmac); ath79_register_wmac(art + MYNET_N600_WMAC_CALDATA_OFFSET, tmpmac); -- 1.8.4.2 ___ openwrt-devel mailing list
[OpenWrt-Devel] [PATCH v2 0/5] Enable switch on WD My Net N750
Now the mdio reset fixup is implemented as a callback from the board specific code. Felix Kaechele (5): ar71xx: make ag71xx_mdio_platform_data visible ar71xx: implement callback in mdio reset ar71xx: implement switch fix for WD My Net N750 ar71xx: fix WD My Net N750 switch led cfg ar71xx: enable images for WD My Net N750 .../linux/ar71xx/files/arch/mips/ath79/dev-eth.c | 4 ++-- .../linux/ar71xx/files/arch/mips/ath79/dev-eth.h | 2 ++ .../ar71xx/files/arch/mips/ath79/mach-mynet-n750.c | 25 ++ .../mips/include/asm/mach-ath79/ag71xx_platform.h | 1 + .../net/ethernet/atheros/ag71xx/ag71xx_mdio.c | 3 +++ target/linux/ar71xx/generic/profiles/wd.mk | 9 target/linux/ar71xx/image/Makefile | 1 + 7 files changed, 39 insertions(+), 6 deletions(-) -- 1.8.4.2 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 3/4] ar71xx: fix WD My Net N750 switch led cfg
Now that the switch is working correctly I had the chance to actually test the LED config. Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c index f1635a4..0db371a 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c @@ -106,10 +106,10 @@ static struct ar8327_pad_cfg mynet_n750_ar8327_pad0_cfg = { }; static struct ar8327_led_cfg mynet_n750_ar8327_led_cfg = { - .led_ctrl0 = 0xc737c737, - .led_ctrl1 = 0x, - .led_ctrl2 = 0x, - .led_ctrl3 = 0x0030c300, + .led_ctrl0 = 0xcc35cc35, + .led_ctrl1 = 0xca35ca35, + .led_ctrl2 = 0xc935c935, + .led_ctrl3 = 0x0300, .open_drain = false, }; -- 1.8.4.2 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 2/4] ar71xx: enable switch fixup for WD My Net N750
Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c index 60f68cd..f1635a4 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c @@ -178,6 +178,7 @@ static void __init mynet_n750_setup(void) mdiobus_register_board_info(mynet_n750_mdio0_info, ARRAY_SIZE(mynet_n750_mdio0_info)); + ath79_mdio0_data.wake_phys = 1; ath79_register_mdio(0, 0x0); mynet_n750_get_mac(lanmac=, ath79_eth0_data.mac_addr); -- 1.8.4.2 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 1/4] ar71xx: add option to wake up phys on mdio reset
The bootloader on the WD My Net N750 disables the ports on it's internal AR8327N switch by powering them down. The stock firmware then brings the ports back up again by starting the auto negotiation process on each port. There is one big disadvantage of this approach: In tests I noticed that PHYs on this platform that are powered down can be written but not read. As a result the scan on the mdio bus fails to detect the ports on the switch. This workaround adds an option to the mdio bus platform data that enables toggling of an early reset of all available PHYs before the mdio bus scan is performed. On the test platform this brings the PHYs back to life in time to be detected by the mdio bus scan. Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- .../linux/ar71xx/files/arch/mips/ath79/dev-eth.c | 4 +-- .../linux/ar71xx/files/arch/mips/ath79/dev-eth.h | 2 ++ .../mips/include/asm/mach-ath79/ag71xx_platform.h | 1 + .../net/ethernet/atheros/ag71xx/ag71xx_mdio.c | 30 ++ 4 files changed, 24 insertions(+), 13 deletions(-) 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 4a2b1db..742218b 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c @@ -39,7 +39,7 @@ static struct resource ath79_mdio0_resources[] = { } }; -static struct ag71xx_mdio_platform_data ath79_mdio0_data; +struct ag71xx_mdio_platform_data ath79_mdio0_data; struct platform_device ath79_mdio0_device = { .name = ag71xx-mdio, @@ -60,7 +60,7 @@ static struct resource ath79_mdio1_resources[] = { } }; -static struct ag71xx_mdio_platform_data ath79_mdio1_data; +struct ag71xx_mdio_platform_data ath79_mdio1_data; struct platform_device ath79_mdio1_device = { .name = ag71xx-mdio, diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.h b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.h index bc608da..08a59ef 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.h +++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.h @@ -39,6 +39,8 @@ void ath79_register_eth(unsigned int id); extern struct ag71xx_switch_platform_data ath79_switch_data; +extern struct ag71xx_mdio_platform_data ath79_mdio0_data; +extern struct ag71xx_mdio_platform_data ath79_mdio0_data; extern struct platform_device ath79_mdio0_device; extern struct platform_device ath79_mdio1_device; void ath79_register_mdio(unsigned int id, u32 phy_mask); diff --git a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h index 656a6ef..333daa9 100644 --- a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h +++ b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h @@ -53,6 +53,7 @@ struct ag71xx_mdio_platform_data { u8 is_ar7240:1; u8 is_ar9330:1; u8 is_ar934x:1; + u8 wake_phys:1; unsigned long mdio_clock; unsigned long ref_clock; }; diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c index ec88233..0f3ed63 100644 --- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c +++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c @@ -156,10 +156,22 @@ static int ag71xx_mdio_get_divider(struct ag71xx_mdio *am, u32 *div) return -ENOENT; } +static int ag71xx_mdio_write(struct mii_bus *bus, int addr, int reg, u16 val) +{ + struct ag71xx_mdio *am = bus-priv; + + if (am-pdata-builtin_switch) + ar7240sw_phy_write(bus, addr, reg, val); + else + ag71xx_mdio_mii_write(am, addr, reg, val); + return 0; +} + static int ag71xx_mdio_reset(struct mii_bus *bus) { struct ag71xx_mdio *am = bus-priv; u32 t; + int i; int err; err = ag71xx_mdio_get_divider(am, t); @@ -181,6 +193,13 @@ static int ag71xx_mdio_reset(struct mii_bus *bus) ag71xx_mdio_wr(am, AG71XX_REG_MII_CFG, t); udelay(100); + if(am-pdata-wake_phys) { + for (i = 0; i PHY_MAX_ADDR; i++) + ag71xx_mdio_write(bus, i, MII_BMCR, (BMCR_RESET | + BMCR_ANENABLE | BMCR_SPEED1000)); + msleep(1000); + } + return 0; } @@ -194,17 +213,6 @@ static int ag71xx_mdio_read(struct mii_bus *bus, int addr, int reg) return ag71xx_mdio_mii_read(am, addr, reg); } -static int ag71xx_mdio_write(struct mii_bus *bus, int addr, int reg, u16 val) -{ - struct ag71xx_mdio *am = bus-priv; - - if (am-pdata-builtin_switch
Re: [OpenWrt-Devel] [PATCH 3/4] kirkwood: new profile Seagate GoFlexNet
John Crispin wrote: On 14/12/13 06:46, Alexander Couzens wrote: +define Profile/GOFLEXNET + NAME:=Seagate GoFlexNet + PACKAGES:= \ +kmod-ata-core kmod-ata-marvell-sata \ +kmod-rtc-marvell kmod-usb2 kmod-usb-storage \ +uboot-envtools +endef + looks quirky ... i doubt that kmod-rtc-marvell is GOFLEXNET specific While the kirkwood platform has an RTC integrated into the CPU some boards either don't use it (Pogoplug / GoFlex; in fact they also lack the required electronics to use it) or use an external RTC (QNAP TS-219). Adding this driver to boards that don't need it will either a. produce an error message in dmesg b. initialize a wrong / additional RTC which then is unusable Therefor kmod-rtc-marvell isn't in the default config for kirkwood based boards. - Felix Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 3/4] ar71xx: add option to wake up phys on mdio reset
Felix Kaechele wrote: diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c index ec88233..e99c172 100644 --- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c +++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c @@ -181,6 +193,12 @@ static int ag71xx_mdio_reset(struct mii_bus *bus) ag71xx_mdio_wr(am, AG71XX_REG_MII_CFG, t); udelay(100); + if(am-pdata-wake_phys) { + for (i = 0; i PHY_MAX_ADDR; i++) + ag71xx_mdio_write(bus, i, 0x0, BIT(12)); + udelay(600); + } + return 0; } Did some more testing today. Looks like this is not it. The switch port only negotiates 10 Mbps Half Duplex. I observed, the more I replicate what the ar8327_hw_init function from the ar8216 phy driver does, the closer to the desired result I get. If I just plainly reset each PHY on the switch it then get's detected by the mdio bus scan but obviously isn't initialized correctly. However, I end up with everything looking good but I'm still unable to actually transfer data (i.e. ping) to other hosts connected to the switch. So I guess the initialization isn't done correctly, but I can't seem to figure out where. Any ideas? - Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 3/4] ar71xx: add option to wake up phys on mdio reset
The bootloader on the WD My Net N750 disables the ports on it's internal AR8327N switch by powering them down. The stock firmware then brings the ports back up again by starting the auto negotiation process on each port. There is one big disadvantage of this approach: In tests I noticed that PHYs on this platform that are powered down can be written but not read. As a result the scan on the mdio bus fails to detect the ports on the switch. This workaround adds an option to the mdio bus platform data that enables toggling of an early reset of all available PHYs before the mdio bus scan is performed. On the test platform this brings the PHYs back to life in time to be detected by the mdio bus scan. Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- .../linux/ar71xx/files/arch/mips/ath79/dev-eth.c | 4 +-- .../linux/ar71xx/files/arch/mips/ath79/dev-eth.h | 2 ++ .../mips/include/asm/mach-ath79/ag71xx_platform.h | 1 + .../net/ethernet/atheros/ag71xx/ag71xx_mdio.c | 29 ++ 4 files changed, 23 insertions(+), 13 deletions(-) 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 4a2b1db..742218b 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c @@ -39,7 +39,7 @@ static struct resource ath79_mdio0_resources[] = { } }; -static struct ag71xx_mdio_platform_data ath79_mdio0_data; +struct ag71xx_mdio_platform_data ath79_mdio0_data; struct platform_device ath79_mdio0_device = { .name = ag71xx-mdio, @@ -60,7 +60,7 @@ static struct resource ath79_mdio1_resources[] = { } }; -static struct ag71xx_mdio_platform_data ath79_mdio1_data; +struct ag71xx_mdio_platform_data ath79_mdio1_data; struct platform_device ath79_mdio1_device = { .name = ag71xx-mdio, diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.h b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.h index bc608da..08a59ef 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.h +++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.h @@ -39,6 +39,8 @@ void ath79_register_eth(unsigned int id); extern struct ag71xx_switch_platform_data ath79_switch_data; +extern struct ag71xx_mdio_platform_data ath79_mdio0_data; +extern struct ag71xx_mdio_platform_data ath79_mdio0_data; extern struct platform_device ath79_mdio0_device; extern struct platform_device ath79_mdio1_device; void ath79_register_mdio(unsigned int id, u32 phy_mask); diff --git a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h index 656a6ef..333daa9 100644 --- a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h +++ b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h @@ -53,6 +53,7 @@ struct ag71xx_mdio_platform_data { u8 is_ar7240:1; u8 is_ar9330:1; u8 is_ar934x:1; + u8 wake_phys:1; unsigned long mdio_clock; unsigned long ref_clock; }; diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c index ec88233..e99c172 100644 --- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c +++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c @@ -156,10 +156,22 @@ static int ag71xx_mdio_get_divider(struct ag71xx_mdio *am, u32 *div) return -ENOENT; } +static int ag71xx_mdio_write(struct mii_bus *bus, int addr, int reg, u16 val) +{ + struct ag71xx_mdio *am = bus-priv; + + if (am-pdata-builtin_switch) + ar7240sw_phy_write(bus, addr, reg, val); + else + ag71xx_mdio_mii_write(am, addr, reg, val); + return 0; +} + static int ag71xx_mdio_reset(struct mii_bus *bus) { struct ag71xx_mdio *am = bus-priv; u32 t; + int i; int err; err = ag71xx_mdio_get_divider(am, t); @@ -181,6 +193,12 @@ static int ag71xx_mdio_reset(struct mii_bus *bus) ag71xx_mdio_wr(am, AG71XX_REG_MII_CFG, t); udelay(100); + if(am-pdata-wake_phys) { + for (i = 0; i PHY_MAX_ADDR; i++) + ag71xx_mdio_write(bus, i, 0x0, BIT(12)); + udelay(600); + } + return 0; } @@ -194,17 +212,6 @@ static int ag71xx_mdio_read(struct mii_bus *bus, int addr, int reg) return ag71xx_mdio_mii_read(am, addr, reg); } -static int ag71xx_mdio_write(struct mii_bus *bus, int addr, int reg, u16 val) -{ - struct ag71xx_mdio *am = bus-priv; - - if (am-pdata-builtin_switch) - ar7240sw_phy_write(bus, addr, reg, val); - else
[OpenWrt-Devel] [PATCH 2/4] ar71xx: add kernel support for WD My Net N750
Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- target/linux/ar71xx/config-3.10| 1 + .../ar71xx/files/arch/mips/ath79/mach-mynet-n750.c | 196 + .../610-MIPS-ath79-openwrt-machines.patch | 85 + 3 files changed, 245 insertions(+), 37 deletions(-) create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c diff --git a/target/linux/ar71xx/config-3.10 b/target/linux/ar71xx/config-3.10 index f832323..2d6f404 100644 --- a/target/linux/ar71xx/config-3.10 +++ b/target/linux/ar71xx/config-3.10 @@ -52,6 +52,7 @@ CONFIG_ATH79_MACH_JA76PF=y CONFIG_ATH79_MACH_JWAP003=y CONFIG_ATH79_MACH_MR600=y CONFIG_ATH79_MACH_MYNET_N600=y +CONFIG_ATH79_MACH_MYNET_N750=y CONFIG_ATH79_MACH_MYNET_REXT=y CONFIG_ATH79_MACH_MZK_W04NU=y CONFIG_ATH79_MACH_MZK_W300NH=y diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c new file mode 100644 index 000..60f68cd --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c @@ -0,0 +1,196 @@ +/* + * WD My Net N750 board support + * + * Copyright (C) 2013 Felix Kaechele fe...@fetzig.org + * Copyright (C) 2013 Gabor Juhos juh...@openwrt.org + * + * 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/pci.h +#include linux/phy.h +#include linux/gpio.h +#include linux/platform_device.h +#include linux/ath9k_platform.h +#include linux/ar8216_platform.h + +#include asm/mach-ath79/ar71xx_regs.h + +#include common.h +#include dev-ap9x-pci.h +#include dev-eth.h +#include dev-gpio-buttons.h +#include dev-leds-gpio.h +#include dev-m25p80.h +#include dev-spi.h +#include dev-usb.h +#include dev-wmac.h +#include machtypes.h +#include nvram.h + + +/* + * Taken from GPL bootloader source: + * board/ar7240/db12x/alpha_gpio.c + */ +#define MYNET_N750_GPIO_LED_WIFI 11 +#define MYNET_N750_GPIO_LED_INTERNET 12 +#define MYNET_N750_GPIO_LED_WPS13 +#define MYNET_N750_GPIO_LED_POWER 14 + +#define MYNET_N750_GPIO_BTN_RESET 17 +#define MYNET_N750_GPIO_BTN_WPS19 + +#define MYNET_N750_GPIO_EXTERNAL_LNA0 15 +#define MYNET_N750_GPIO_EXTERNAL_LNA1 18 + +#define MYNET_N750_KEYS_POLL_INTERVAL 20 /* msecs */ +#define MYNET_N750_KEYS_DEBOUNCE_INTERVAL (3 * MYNET_N750_KEYS_POLL_INTERVAL) + +#define MYNET_N750_WMAC_CALDATA_OFFSET 0x1000 +#define MYNET_N750_PCIE_CALDATA_OFFSET 0x5000 + +#define MYNET_N750_NVRAM_ADDR 0x1f058010 +#define MYNET_N750_NVRAM_SIZE 0x7ff0 + +static struct gpio_led mynet_n750_leds_gpio[] __initdata = { + { + .name = wd:blue:power, + .gpio = MYNET_N750_GPIO_LED_POWER, + .active_low = 0, + }, + { + .name = wd:blue:wps, + .gpio = MYNET_N750_GPIO_LED_WPS, + .active_low = 0, + }, + { + .name = wd:blue:wireless, + .gpio = MYNET_N750_GPIO_LED_WIFI, + .active_low = 0, + }, + { + .name = wd:blue:internet, + .gpio = MYNET_N750_GPIO_LED_INTERNET, + .active_low = 0, + }, +}; + +static struct gpio_keys_button mynet_n750_gpio_keys[] __initdata = { + { + .desc = Reset button, + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = MYNET_N750_KEYS_DEBOUNCE_INTERVAL, + .gpio = MYNET_N750_GPIO_BTN_RESET, + .active_low = 1, + }, + { + .desc = WPS button, + .type = EV_KEY, + .code = KEY_WPS_BUTTON, + .debounce_interval = MYNET_N750_KEYS_DEBOUNCE_INTERVAL, + .gpio = MYNET_N750_GPIO_BTN_WPS, + .active_low = 1, + }, +}; + +static struct ar8327_pad_cfg mynet_n750_ar8327_pad0_cfg = { + .mode = AR8327_PAD_MAC_RGMII, + .txclk_delay_en = true, + .rxclk_delay_en = true, + .txclk_delay_sel = AR8327_CLK_DELAY_SEL1, + .rxclk_delay_sel = AR8327_CLK_DELAY_SEL2, +}; + +static struct ar8327_led_cfg mynet_n750_ar8327_led_cfg = { + .led_ctrl0 = 0xc737c737, + .led_ctrl1 = 0x, + .led_ctrl2 = 0x, + .led_ctrl3 = 0x0030c300, + .open_drain = false, +}; + +static struct ar8327_platform_data mynet_n750_ar8327_data = { + .pad0_cfg = mynet_n750_ar8327_pad0_cfg, + .port0_cfg = { + .force_link = 1, + .speed = AR8327_PORT_SPEED_1000, + .duplex = 1, + .txpause = 1, + .rxpause
[OpenWrt-Devel] [PATCH 1/4] ar71xx: add userspace support for WD My Net N750
Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- target/linux/ar71xx/base-files/etc/diag.sh | 3 ++- target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 10 ++ .../ar71xx/base-files/etc/uci-defaults/09_fix-seama-header | 3 ++- target/linux/ar71xx/base-files/lib/ar71xx.sh | 3 +++ target/linux/ar71xx/base-files/lib/upgrade/platform.sh | 3 ++- target/linux/ar71xx/generic/profiles/wd.mk | 9 + target/linux/ar71xx/image/Makefile | 1 + 7 files changed, 29 insertions(+), 3 deletions(-) diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index 216100b..cd51f90 100755 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -80,7 +80,8 @@ get_status_led() { mr600v2) status_led=mr600:blue:power ;; - mynet-n600) + mynet-n600 | \ + mynet-n750) status_led=wd:blue:power ;; mynet-rext) 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 5ef4938..d54f382 100755 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network @@ -207,6 +207,16 @@ dir-825-c1) [ -n $mac ] ucidef_set_interface_macaddr wan $mac ;; +mynet-n750) + local mac + ucidef_set_interfaces_lan_wan eth0.1 eth0.2 + ucidef_add_switch switch0 1 1 + ucidef_add_switch_vlan switch0 1 0t 1 2 3 4 + ucidef_add_switch_vlan switch0 2 0t 5 + mac=$(mtd_get_mac_ascii devdata wanmac) + [ -n $mac ] ucidef_set_interface_macaddr wan $mac + ;; + dir-835-a1 |\ wndr4300) ucidef_set_interfaces_lan_wan eth0.1 eth0.2 diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/09_fix-seama-header b/target/linux/ar71xx/base-files/etc/uci-defaults/09_fix-seama-header index 8114ed4..000b773 100755 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/09_fix-seama-header +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/09_fix-seama-header @@ -14,7 +14,8 @@ fix_seama_header() { board=$(ar71xx_board_name) case $board in -mynet-n600) +mynet-n600 | \ +mynet-n750) fix_seama_header kernel ;; esac diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index 0b18d0c..5c31701 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -321,6 +321,9 @@ ar71xx_board_detect() { *My Net N600) name=mynet-n600 ;; + *My Net N750) + name=mynet-n750 + ;; *WD My Net Wi-Fi Range Extender) name=mynet-rext ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index b5a7da7..cff80af 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -177,7 +177,8 @@ platform_check_image() { return 1 ;; - mynet-n600) + mynet-n600 | \ + mynet-n750) [ $magic_long != 5ea3a417 ] { echo Invalid image, bad magic: $magic_long return 1 diff --git a/target/linux/ar71xx/generic/profiles/wd.mk b/target/linux/ar71xx/generic/profiles/wd.mk index badee44..b8cb99b 100644 --- a/target/linux/ar71xx/generic/profiles/wd.mk +++ b/target/linux/ar71xx/generic/profiles/wd.mk @@ -15,6 +15,15 @@ define Profile/MYNETN600/Description endef $(eval $(call Profile,MYNETN600)) +define Profile/MYNETN750 + NAME:=WD My Net N750 + PACKAGES:=kmod-usb-core kmod-usb2 +endef +define Profile/MYNETN750/Description + Package set optimized for the WD My Net N750 device. +endef + +$(eval $(call Profile,MYNETN750)) define Profile/MYNETREXT NAME:=WD My Net Wi-Fi Range Extender diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile index 0f2a2bb..4827563 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -955,6 +955,7 @@ $(eval $(call SingleProfile,Planex,64kraw,MZKW04NU,mzk-w04nu,MZK-W04NU,ttyS0,115 $(eval $(call SingleProfile,Planex,64kraw,MZKW300NH,mzk-w300nh,MZK-W300NH,ttyS0,115200)) $(eval $(call SingleProfile,Seama,64k,MYNETN600,mynet-n600,MYNET-N600,ttyS0,115200,$$(mynet_n600_mtdlayout),wrgnd16_wd_db600,1310720,16187392)) +$(eval $(call SingleProfile,Seama,64k,MYNETN750,mynet-n750,MYNET-N750,ttyS0,115200,$$(mynet_n600_mtdlayout),wrgnd13_wd_av,1310720,16187392)) $(eval $(call SingleProfile,TPLINKOLD,squashfs-only,TLWR841NV15,tl-wr841nd-v1.5,TL-WR841N-v1.5
[OpenWrt-Devel] [PATCH 0/4] Support for WD My Net N750
Frankly, figuring out the switch issue on the WD My Net N750 was a pain. Details to what the exact problem was is in one of the patches in this patchset. WD was more cooperative than I thought by publishing the u-boot source code after I requested it. From my POV there are only minor cosmetic issues left. However, this is basically my first time working on the ar71xx platform, so please bear with me. Any comments and hints are appreciated! TODOs: * WiFi LED: The device has only one WiFi LED on a GPIO but two radios. Figure out a way how to display the status in a sane way. * WAN LED: WAN is only a VLAN interface on eth0.2. Figure out how to toggle the WAN LED based on the connectivity of this virtual interface. Felix Kaechele (4): ar71xx: add userspace support for WD My Net N750 ar71xx: add kernel support for WD My Net N750 ar71xx: add option to wake up phys on mdio reset ar71xx: enable wake_phys option for WD My Net N750 target/linux/ar71xx/base-files/etc/diag.sh | 3 +- .../ar71xx/base-files/etc/uci-defaults/02_network | 10 ++ .../etc/uci-defaults/09_fix-seama-header | 3 +- target/linux/ar71xx/base-files/lib/ar71xx.sh | 3 + .../ar71xx/base-files/lib/upgrade/platform.sh | 3 +- target/linux/ar71xx/config-3.10| 1 + .../linux/ar71xx/files/arch/mips/ath79/dev-eth.c | 4 +- .../linux/ar71xx/files/arch/mips/ath79/dev-eth.h | 2 + .../ar71xx/files/arch/mips/ath79/mach-mynet-n750.c | 197 + .../mips/include/asm/mach-ath79/ag71xx_platform.h | 1 + .../net/ethernet/atheros/ag71xx/ag71xx_mdio.c | 29 +-- target/linux/ar71xx/generic/profiles/wd.mk | 9 + target/linux/ar71xx/image/Makefile | 1 + .../610-MIPS-ath79-openwrt-machines.patch | 85 + 14 files changed, 298 insertions(+), 53 deletions(-) create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c -- 1.8.4.2 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 4/4] ar71xx: enable wake_phys option for WD My Net N750
This makes the AR8327N switch on this board functional. Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c index 60f68cd..f1635a4 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c @@ -178,6 +178,7 @@ static void __init mynet_n750_setup(void) mdiobus_register_board_info(mynet_n750_mdio0_info, ARRAY_SIZE(mynet_n750_mdio0_info)); + ath79_mdio0_data.wake_phys = 1; ath79_register_mdio(0, 0x0); mynet_n750_get_mac(lanmac=, ath79_eth0_data.mac_addr); -- 1.8.4.2 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] AR71xx question: Writing to MDIO bus before mdio_register to power up PHYs
Hi there, I'm currently trying to figure out a way how to solve the following issue elegantly (i.e. from the mach file): Target Device: WD My Net N750 (AR9344 based, with AR8327N switch) Problem: The device powers down all the PHYs from within the bootloader (possibly to prevent early LAN - WAN leakage, as the ports are on the same switch and separated by VLANs only). The PHYs are powered down by writing 0x800 (Set Bit 11 (POWER_DOWN) to 1) to register 0x0 of each PHY from within the bootloader. The PHYs cannot be read while powered down (but can be written). This results in mdiobus_scan (drivers/net/phy/mdio_bus.c) reading bogus PHY IDs. Solution: Power all PHYs back up by writing 0x1000 (Set Bit 12 (AUTO_ NEGOTIATION) to 1) to register 0x0 of each PHY _before_ scanning the MDIO bus for PHY IDs but _after_ resetting/initializing the bus. I have attached a patch that works (but is a nasty hack). So now I have the question how to handle this in a way that would also be acceptable for upstream. I was hoping for some input from the ar71xx gurus on how to do this :) Thanks, Felix --- drivers/net/phy/mdio_bus.c.orig 2013-12-09 14:11:13.693202164 +0100 +++ drivers/net/phy/mdio_bus.c 2013-12-09 14:12:23.922744357 +0100 @@ -164,6 +164,10 @@ if (bus-reset) bus-reset(bus); + for (i = 0; i PHY_MAX_ADDR; i++) + mdiobus_write(bus, i, MII_BMCR, BMCR_RESET | BMCR_ANENABLE); + msleep(1000); + for (i = 0; i PHY_MAX_ADDR; i++) { if ((bus-phy_mask (1 i)) == 0) { struct phy_device *phydev; ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] AR71xx question: Writing to MDIO bus before mdio_register to power up PHYs
Florian Fainelli wrote: Did you confirm that it does not respond with its correct PHY ID1ID3 values? This is the output I get for the PHY IDs on the mdio bus when the PHYs are in power down state (this is the default state in which the device comes up): root@OpenWrt:/sys/devices/platform/ag71xx-mdio.0# for phy in ag71xx-mdio.0\:*; do echo -n ${phy}: ; cat ${phy}/phy_id; done ag71xx-mdio.0:10: 0x0760 ag71xx-mdio.0:11: 0x ag71xx-mdio.0:12: 0x1280 ag71xx-mdio.0:13: 0x ag71xx-mdio.0:14: 0x ag71xx-mdio.0:15: 0x ag71xx-mdio.0:16: 0x ag71xx-mdio.0:17: 0x ag71xx-mdio.0:18: 0x0760 This results in: ag71xx.0: no PHY found with phy_mask=0001 And this is the output for powered up PHYs (powered up in the bootloader by interrupting automatic booting): root@OpenWrt:/sys/devices/platform/ag71xx-mdio.0# for phy in ag71xx-mdio.0\:*; do echo -n ${phy}: ; cat ${phy}/phy_id; done ag71xx-mdio.0:00: 0x004dd033 ag71xx-mdio.0:01: 0x004dd033 ag71xx-mdio.0:02: 0x004dd033 ag71xx-mdio.0:03: 0x004dd033 ag71xx-mdio.0:04: 0x004dd033 ag71xx-mdio.0:10: 0x ag71xx-mdio.0:11: 0x10411084 ag71xx-mdio.0:12: 0x ag71xx-mdio.0:13: 0x7fff7fff ag71xx-mdio.0:14: 0x7fff7fff ag71xx-mdio.0:15: 0x7fff7fff ag71xx-mdio.0:16: 0x00c2 ag71xx-mdio.0:17: 0x004a003a ag71xx-mdio.0:18: 0x This results in: ag71xx.0: connected to PHY at ag71xx-mdio.0:00 [uid=004dd033, driver=Atheros AR8216/AR8236/AR8316] Is this a real PHY or is this a specific port from a switch? These are the 5 Ports of the AR8327N switch which is connected to GMAC0 of the AR9344 in RGMII mode. Obviously the PHYs cannot be found when in powered down state. This is the reason why the probing of the switch fails. All the mdio bus scan sees is PHY ID garbage because the relevant PHYs aren't responding. This is why I'm trying to perform a PHY reset / auto negotiation start even before having the mdiobus_register function perform the mdio bus scan. You can find the files/patches I use for this board here: http://heffer.fedorapeople.org/openwrt/mynet-n750/ Thanks for your help so far! Regards, Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] WD MyNet N750: ar9344 + ar8327 switch, unclear on phy/mdio/mac wiring
Bootloader code has been published as per my request. You can find it here: http://support.wdc.com/product/download.asp?groupid=1702sid=178lang=en Now we just need to find where they broke it :) - Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 0/2] [package] uboot-kirkwood updates
Update U-Boot to Version 2013.10 and enable FDT support. Felix Kaechele (2): [package] uboot-kirkwood: update to 2013.10 [package] uboot-kirkwood: enable FDT support package/boot/uboot-kirkwood/Makefile | 10 +++--- package/boot/uboot-kirkwood/patches/110-dockstar.patch | 4 ++-- .../patches/120-enable-device-tree-support.patch | 9 + 3 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 package/boot/uboot-kirkwood/patches/120-enable-device-tree-support.patch -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 1/2] [package] uboot-kirkwood: update to 2013.10
This was tested on a Cloud Engines Pogoplug E02. Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- package/boot/uboot-kirkwood/Makefile | 10 +++--- package/boot/uboot-kirkwood/patches/110-dockstar.patch | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/package/boot/uboot-kirkwood/Makefile b/package/boot/uboot-kirkwood/Makefile index 375d115..d8bf984 100644 --- a/package/boot/uboot-kirkwood/Makefile +++ b/package/boot/uboot-kirkwood/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=u-boot -PKG_VERSION:=2012.10 +PKG_VERSION:=2013.10 PKG_RELEASE:=1 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) @@ -16,7 +16,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ http://mirror2.openwrt.org/sources \ ftp://ftp.denx.de/pub/u-boot -PKG_MD5SUM:=8655f63b1e5c4647295ac9ce44660be3 +PKG_MD5SUM:=a076a044b64371edc52f7e562b13f6b2 PKG_TARGETS:=bin include $(INCLUDE_DIR)/package.mk @@ -43,7 +43,11 @@ define uboot/ib62x0 TITLE:=U-Boot for the RaidSonic ICY BOX NAS6210 and NAS6220 endef -UBOOTS:=sheevaplug dockstar iconnect ib62x0 +define uboot/pogo_e02 + TITLE:=U-Boot for the Cloud Engines Pogoplug E02 +endef + +UBOOTS:=sheevaplug dockstar iconnect ib62x0 pogo_e02 define Package/uboot/template define Package/uboot-kirkwood-$(1) diff --git a/package/boot/uboot-kirkwood/patches/110-dockstar.patch b/package/boot/uboot-kirkwood/patches/110-dockstar.patch index 4ff7e57..b3a6271 100644 --- a/package/boot/uboot-kirkwood/patches/110-dockstar.patch +++ b/package/boot/uboot-kirkwood/patches/110-dockstar.patch @@ -1,12 +1,12 @@ --- a/include/configs/dockstar.h +++ b/include/configs/dockstar.h -@@ -83,22 +83,19 @@ +@@ -67,22 +67,19 @@ * Default environment variables */ #define CONFIG_BOOTCOMMAND \ - setenv bootargs ${console} ${mtdparts} ${bootargs_root}; \ - ubi part root; \ -- ubifsmount root; \ +- ubifsmount ubi:root; \ - ubifsload 0x80 ${kernel}; \ - ubifsload 0x110 ${initrd}; \ - bootm 0x80 0x110 -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 2/2] [package] uboot-kirkwood: enable FDT support
Enables Flattened Device Tree support in U-Boot for kirkwood. Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- .../uboot-kirkwood/patches/120-enable-device-tree-support.patch | 9 + 1 file changed, 9 insertions(+) create mode 100644 package/boot/uboot-kirkwood/patches/120-enable-device-tree-support.patch diff --git a/package/boot/uboot-kirkwood/patches/120-enable-device-tree-support.patch b/package/boot/uboot-kirkwood/patches/120-enable-device-tree-support.patch new file mode 100644 index 000..8ea8bf1 --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/120-enable-device-tree-support.patch @@ -0,0 +1,9 @@ +--- a/include/configs/mv-common.h b/include/configs/mv-common.h +@@ -152,4 +152,6 @@ + #define CONFIG_LZO + #endif + ++#define CONFIG_OF_LIBFDT ++ + #endif /* _MV_COMMON_H */ -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 0/4] kirkwood: Add support for the Pogoplug E02
This adds u-boot/kernel/userspace support for the Pogoplug E02. TODO: sysupgrade support. Felix Kaechele (4): [package] uboot-kirkwood: fix pogo_e02 config [package] uboot-envtools: add Pogoplug E02 support kirkwood: add Pogoplug E02 Kernel support kirkwood: Add userland support for Pogoplug E02 package/boot/uboot-envtools/files/kirkwood | 3 + .../patches/130-fix-pogo_e02-config.patch | 48 .../kirkwood/base-files/etc/uci-defaults/01_leds | 4 + .../base-files/etc/uci-defaults/02_network | 3 + target/linux/kirkwood/image/Makefile | 3 + .../kirkwood/patches-3.10/120-pogoplug_e02.patch | 130 + target/linux/kirkwood/profiles/120-pogoplug.mk | 21 7 files changed, 212 insertions(+) create mode 100644 package/boot/uboot-kirkwood/patches/130-fix-pogo_e02-config.patch create mode 100644 target/linux/kirkwood/patches-3.10/120-pogoplug_e02.patch create mode 100644 target/linux/kirkwood/profiles/120-pogoplug.mk -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 3/4] kirkwood: add Pogoplug E02 Kernel support
This patch adds a DTS file for the Pogoplug E02 by Cloud Engines, Inc. Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- .../kirkwood/patches-3.10/120-pogoplug_e02.patch | 130 + 1 file changed, 130 insertions(+) create mode 100644 target/linux/kirkwood/patches-3.10/120-pogoplug_e02.patch diff --git a/target/linux/kirkwood/patches-3.10/120-pogoplug_e02.patch b/target/linux/kirkwood/patches-3.10/120-pogoplug_e02.patch new file mode 100644 index 000..5cff4a3 --- /dev/null +++ b/target/linux/kirkwood/patches-3.10/120-pogoplug_e02.patch @@ -0,0 +1,130 @@ +--- /dev/null b/arch/arm/boot/dts/kirkwood-pogo_e02.dts +@@ -0,0 +1,117 @@ ++/dts-v1/; ++ ++/include/ kirkwood.dtsi ++/include/ kirkwood-6281.dtsi ++ ++/ { ++ model = Cloud Engines Pogoplug E02; ++ compatible = cloudengines,pogoe02, marvell,kirkwood-88f6281, marvell,kirkwood; ++ ++ memory { ++ device_type = memory; ++ reg = 0x 0x1000; ++ }; ++ ++ chosen { ++ bootargs = console=ttyS0,115200n8 earlyprintk; ++ }; ++ ++ ocp@f100 { ++ pinctrl: pinctrl@1 { ++ ++ pinctrl-0 = pmx_usb_power_enable pmx_led_orange ++pmx_led_green ; ++ pinctrl-names = default; ++ ++ pmx_usb_power_enable: pmx-usb-power-enable { ++ marvell,pins = mpp29; ++ marvell,function = gpio; ++ }; ++ pmx_led_green: pmx-led_green { ++ marvell,pins = mpp48; ++ marvell,function = gpio; ++ }; ++ pmx_led_orange: pmx-led_orange { ++ marvell,pins = mpp49; ++ marvell,function = gpio; ++ }; ++ }; ++ ++ serial@12000 { ++ status = okay; ++ }; ++ ++ nand@300 { ++ status = okay; ++ ++ partition@0 { ++ label = u-boot; ++ reg = 0x000 0x10; ++ }; ++ ++ partition@10 { ++ label = uImage; ++ reg = 0x010 0x40; ++ }; ++ ++ partition@50 { ++ label = rootfs; ++ reg = 0x050 0x200; ++ }; ++ ++ partition@250 { ++ label = data; ++ reg = 0x250 0x5b0; ++ }; ++ }; ++ }; ++ ++ gpio-leds { ++ compatible = gpio-leds; ++ ++ health { ++ label = status:green:health; ++ gpios = gpio1 16 1; ++ linux,default-trigger = default-on; ++ }; ++ fault { ++ label = status:orange:fault; ++ gpios = gpio1 17 1; ++ }; ++ }; ++ ++ regulators { ++ compatible = simple-bus; ++ #address-cells = 1; ++ #size-cells = 0; ++ ++ usb_power: regulator@1 { ++ compatible = regulator-fixed; ++ reg = 1; ++ regulator-name = USB Power; ++ regulator-min-microvolt = 500; ++ regulator-max-microvolt = 500; ++ enable-active-high; ++ regulator-always-on; ++ regulator-boot-on; ++ gpio = gpio0 29 0; ++ }; ++ }; ++}; ++ ++mdio { ++ status = okay; ++ ++ ethphy0: ethernet-phy@0 { ++ device_type = ethernet-phy; ++ reg = 0; ++ }; ++}; ++ ++eth0 { ++ status = okay; ++ ++ ethernet0-port@0 { ++ phy-handle = ethphy0; ++ }; ++}; +--- a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile +@@ -86,6 +86,7 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood- + kirkwood-ns2max.dtb \ + kirkwood-ns2mini.dtb \ + kirkwood-nsa310.dtb \ ++ kirkwood-pogo_e02.dtb \ + kirkwood-topkick.dtb \ + kirkwood-ts219-6281.dtb \ + kirkwood-ts219-6282.dtb \ -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] kirkwood: fix some typos
This fixes a typo in the image/Makefile and the profile for the RaidSonic ICY BOX IB-NAS62x0 board. Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- target/linux/kirkwood/image/Makefile | 2 +- target/linux/kirkwood/profiles/110-nas.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile index 01a26b5..91b8f3b 100644 --- a/target/linux/kirkwood/image/Makefile +++ b/target/linux/kirkwood/image/Makefile @@ -44,7 +44,7 @@ define Image/BuildKernel/Template $(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage-initramfs cat $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage-initramfs $(call Image/BuildKernel/MkuImage, \ - none, 0x8000, 0x8000, + none, 0x8000, 0x8000, \ $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage-initramfs, \ $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-uImage-initramfs \ ) diff --git a/target/linux/kirkwood/profiles/110-nas.mk b/target/linux/kirkwood/profiles/110-nas.mk index 28b1802..402053e 100644 --- a/target/linux/kirkwood/profiles/110-nas.mk +++ b/target/linux/kirkwood/profiles/110-nas.mk @@ -17,7 +17,7 @@ define Profile/IB62X0/Description Package set compatible with RaidSonic ICY BOX IB-NAS62x0 board. endef -IB62X0_UBIFS_OPTS:=-m 2048 -e 126KiB -c 4096 -U +IB62X0_UBIFS_OPTS:=-m 2048 -e 128KiB -c 4096 -U IB62X0_UBI_OPTS:=-m 2048 -p 128KiB -s 512 $(eval $(call Profile,IB62X0)) -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 4/4] kirkwood: Add userland support for Pogoplug E02
This patch adds the userland support for the Pogoplug E02 by Cloud Engines, Inc. Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- .../kirkwood/base-files/etc/uci-defaults/01_leds| 4 .../kirkwood/base-files/etc/uci-defaults/02_network | 3 +++ target/linux/kirkwood/image/Makefile| 3 +++ target/linux/kirkwood/profiles/120-pogoplug.mk | 21 + 4 files changed, 31 insertions(+) create mode 100644 target/linux/kirkwood/profiles/120-pogoplug.mk diff --git a/target/linux/kirkwood/base-files/etc/uci-defaults/01_leds b/target/linux/kirkwood/base-files/etc/uci-defaults/01_leds index 7e20188..5c34cd6 100644 --- a/target/linux/kirkwood/base-files/etc/uci-defaults/01_leds +++ b/target/linux/kirkwood/base-files/etc/uci-defaults/01_leds @@ -10,6 +10,10 @@ case `cat /proc/device-tree/model` in ucidef_set_led_netdev eth0 dockstar:orange:misc eth0 ucidef_set_led_default health dockstar:green:health 1 ;; +Cloud Engines Pogoplug E02) + ucidef_set_led_default health status:green:health 1 + ucidef_set_led_default fault status:orange:fault 1 + ;; *) ;; esac diff --git a/target/linux/kirkwood/base-files/etc/uci-defaults/02_network b/target/linux/kirkwood/base-files/etc/uci-defaults/02_network index 42724ef..bf95f72 100644 --- a/target/linux/kirkwood/base-files/etc/uci-defaults/02_network +++ b/target/linux/kirkwood/base-files/etc/uci-defaults/02_network @@ -32,6 +32,9 @@ case `cat /proc/device-tree/model` in RaidSonic ICY BOX IB-NAS62x0 (Rev B)) set_lan_dhcp eth0 ;; +Cloud Engines Pogoplug E02) + set_lan_dhcp eth0 + ;; *) ucidef_set_interface_lan eth0 ;; diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile index 94e7bb9..01a26b5 100644 --- a/target/linux/kirkwood/image/Makefile +++ b/target/linux/kirkwood/image/Makefile @@ -100,6 +100,9 @@ Image/InstallKernel/Template/Generic=$(call Image/InstallKernel/Template) Image/BuildKernel/Template/IB62X0=$(call Image/BuildKernel/Template,ib62x0) Image/InstallKernel/Template/IB62X0=$(call Image/InstallKernel/Template,ib62x0) +Image/BuildKernel/Template/POGOE02=$(call Image/BuildKernel/Template,pogo_e02) +Image/InstallKernel/Template/POGOE02=$(call Image/InstallKernel/Template,pogo_e02) + define Image/BuildKernel $(call Image/BuildKernel/Template/$(PROFILE)) endef diff --git a/target/linux/kirkwood/profiles/120-pogoplug.mk b/target/linux/kirkwood/profiles/120-pogoplug.mk new file mode 100644 index 000..0f84249 --- /dev/null +++ b/target/linux/kirkwood/profiles/120-pogoplug.mk @@ -0,0 +1,21 @@ +# +# Copyright (C) 2013 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Profile/POGOE02 + NAME:=Cloud Engines Pogoplug E02 + PACKAGES:= \ + kmod-usb2 kmod-usb-storage uboot-envtools +endef + +define Profile/POGOE02/Description + Package set compatible with Cloud Engines Pogoplug E02 board. +endef + +POGOE02_UBIFS_OPTS:=-m 2048 -e 128KiB -c 4096 -U +POGOE02_UBI_OPTS:=-m 2048 -p 128KiB -s 512 + +$(eval $(call Profile,POGOE02)) -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 1/4] [package] uboot-kirkwood: fix pogo_e02 config
Fixes the upstream config of the Pogoplug E02 in U-Boot. This removes some unneeded config options, moves the env offset so that the original env is kept intact and will not be overwritten as well as changes the default env options to boot OpenWRT out of the box. Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- .../patches/130-fix-pogo_e02-config.patch | 48 ++ 1 file changed, 48 insertions(+) create mode 100644 package/boot/uboot-kirkwood/patches/130-fix-pogo_e02-config.patch diff --git a/package/boot/uboot-kirkwood/patches/130-fix-pogo_e02-config.patch b/package/boot/uboot-kirkwood/patches/130-fix-pogo_e02-config.patch new file mode 100644 index 000..d8378fd --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/130-fix-pogo_e02-config.patch @@ -0,0 +1,48 @@ +--- a/include/configs/pogo_e02.h b/include/configs/pogo_e02.h +@@ -32,7 +32,6 @@ + * Commands configuration + */ + #define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */ +-#define CONFIG_SYS_MVFS + #include config_cmd_default.h + #define CONFIG_CMD_DHCP + #define CONFIG_CMD_ENV +@@ -62,23 +61,27 @@ + #endif + + #define CONFIG_ENV_SIZE 0x2 /* 128k */ +-#define CONFIG_ENV_OFFSET 0x6 /* env starts here */ ++#define CONFIG_ENV_ADDR 0xC ++#define CONFIG_ENV_OFFSET 0xC /* env starts here */ + + /* + * Default environment variables + */ + #define CONFIG_BOOTCOMMAND \ +- setenv bootargs $(bootargs_console); \ +- run bootcmd_usb; \ +- bootm 0x0080 0x0110 ++ ${x_bootcmd_kernel}; \ ++ setenv bootargs ${x_bootargs} ${x_bootargs_root}; \ ++ ${x_bootcmd_usb}; bootm 0x80; ++ ++#define CONFIG_MTDPARTS \ ++ mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)\0 + + #define CONFIG_EXTRA_ENV_SETTINGS \ +- mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage), \ +- 32M(rootfs),-(data)\0\ +- mtdids=nand0=orion_nand\0\ +- bootargs_console=console=ttyS0,115200\0 \ +- bootcmd_usb=usb start; ext2load usb 0:1 0x0080 /uImage; \ +- ext2load usb 0:1 0x0110 /uInitrd\0 ++ mtdids=nand0=orion_nand\0 \ ++ mtdparts=CONFIG_MTDPARTS \ ++ x_bootargs=console=ttyS0,115200\0 \ ++ x_bootcmd_kernel=nand read 0x80 0x10 0x40\0 \ ++ x_bootargs_root=root=/dev/mtdblock2 rw rootfstype=jffs2\0 \ ++ x_bootcmd_usb=usb start\0 + + /* + * Ethernet Driver configuration -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 2/4] [package] uboot-envtools: add Pogoplug E02 support
Add support for the Pogoplug E02 by Cloud Engines, Inc. Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- package/boot/uboot-envtools/files/kirkwood | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package/boot/uboot-envtools/files/kirkwood b/package/boot/uboot-envtools/files/kirkwood index f665d2d..782a5a4 100644 --- a/package/boot/uboot-envtools/files/kirkwood +++ b/package/boot/uboot-envtools/files/kirkwood @@ -11,6 +11,9 @@ touch /etc/config/ubootenv . /lib/functions.sh case `cat /proc/device-tree/model` in +Cloud Engines Pogoplug E02) + ubootenv_add_uci_config /dev/mtd0 0xc 0x2 0x2 + ;; RaidSonic ICY BOX IB-NAS62x0 (Rev B)) ubootenv_add_uci_config /dev/mtd1 0x0 0x2 0x2 ;; -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] WD MyNet N750: ar9344 + ar8327 switch, unclear on phy/mdio/mac wiring
Okay. I did some more research on this. Good news is: I got the switch working. Also the network setup with separate VLANs for LAN/WAN is working. Bad news: It's a manual process and requires serial access. Here's how it works: - Install OpenWRT image (for example through the emergency HTTP interface) - During boot interrupt the bootloader (before it reaches the timeout) (note how the LEDs on the Switch turn back on) - Enter boot to boot OpenWRT from flash The switch should now be in a working state. Unfortunately I was not yet able to determine what it takes to bring the switch back to life after the bootloader disabled it and before the driver tries to probe it. I requested the u-boot source code (that obviously can enable and disable the switch) from both WD (the vendor) and Alpha Networks (the producer). I hope something turns up from there. I disassembled the athrs_gmac.ko module from the GPL code drop of WD. It seems that the function ar934x_gmac_attach is calling ath_gpio_config_output. Interestingly this is not found in the code drops of the Fritz!Box 7270, which has the source for this module. So I believe it has something to do with GPIOs at some point. I noticed that GPIO4 toggles itself all the time. But I have no idea what this is. In the meantime I'm hopeful that someone else might have another idea on how to get this working. - Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] WD MyNet N750: ar9344 + ar8327 switch, unclear on phy/mdio/mac wiring
Oh, I forgot to attach the patch I use for testing. Here it is! - Felix diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index 3962aa2..3f9deb6 100755 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -77,7 +77,8 @@ get_status_led() { mr600v2) status_led=mr600:blue:power ;; - mynet-n600) + mynet-n600 | \ + mynet-n750) status_led=wd:blue:power ;; mzk-w04nu | \ 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 3d6ab29..d2510c8 100755 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network @@ -205,6 +205,7 @@ dir-825-c1) ;; dir-835-a1 |\ +mynet-n750 |\ wndr4300) ucidef_set_interfaces_lan_wan eth0.1 eth0.2 ucidef_add_switch switch0 1 1 diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/09_fix-seama-header b/target/linux/ar71xx/base-files/etc/uci-defaults/09_fix-seama-header index 8114ed4..000b773 100755 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/09_fix-seama-header +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/09_fix-seama-header @@ -14,7 +14,8 @@ fix_seama_header() { board=$(ar71xx_board_name) case $board in -mynet-n600) +mynet-n600 | \ +mynet-n750) fix_seama_header kernel ;; esac diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index 06786e7..31b61a1 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -306,6 +306,9 @@ ar71xx_board_detect() { *My Net N600) name=mynet-n600 ;; + *My Net N750) + name=mynet-n750 + ;; *MZK-W04NU) name=mzk-w04nu ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index 28e4a91..cc5933a 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -154,7 +154,8 @@ platform_check_image() { dir825b_check_image $1 return 0 ;; - mynet-n600) + mynet-n600 | \ + mynet-n750) [ $magic_long != 5ea3a417 ] { echo Invalid image, bad magic: $magic_long return 1 diff --git a/target/linux/ar71xx/config-3.10 b/target/linux/ar71xx/config-3.10 index f88d008..d7931be 100644 --- a/target/linux/ar71xx/config-3.10 +++ b/target/linux/ar71xx/config-3.10 @@ -50,6 +50,7 @@ CONFIG_ATH79_MACH_JA76PF=y CONFIG_ATH79_MACH_JWAP003=y CONFIG_ATH79_MACH_MR600=y CONFIG_ATH79_MACH_MYNET_N600=y +CONFIG_ATH79_MACH_MYNET_N750=y CONFIG_ATH79_MACH_MZK_W04NU=y CONFIG_ATH79_MACH_MZK_W300NH=y CONFIG_ATH79_MACH_NBG460N=y diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c new file mode 100644 index 000..81d6ae6 --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mynet-n750.c @@ -0,0 +1,178 @@ +/* + * WD My Net N750 board support + * + * Copyright (C) 2013 Felix Kaechele fe...@fetzig.org + * + * 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/pci.h +#include linux/phy.h +#include linux/gpio.h +#include linux/platform_device.h +#include linux/ath9k_platform.h +#include linux/ar8216_platform.h + +#include asm/mach-ath79/ar71xx_regs.h + +#include common.h +#include dev-ap9x-pci.h +#include dev-eth.h +#include dev-gpio-buttons.h +#include dev-leds-gpio.h +#include dev-m25p80.h +#include dev-spi.h +#include dev-usb.h +#include dev-wmac.h +#include machtypes.h +#include nvram.h + +#define MYNET_N750_GPIO_LED_WIFI 11 +#define MYNET_N750_GPIO_LED_POWER 14 +#define MYNET_N750_GPIO_LED_INTERNET 12 +#define MYNET_N750_GPIO_LED_WPS 13 + +#define MYNET_N750_GPIO_BTN_RESET 17 +#define MYNET_N750_GPIO_BTN_WPS 19 + +#define MYNET_N750_KEYS_POLL_INTERVAL 20 /* msecs */ +#define MYNET_N750_KEYS_DEBOUNCE_INTERVAL (3 * MYNET_N750_KEYS_POLL_INTERVAL) + +#define MYNET_N750_MAC0_OFFSET 0 +#define MYNET_N750_MAC1_OFFSET 6 +#define MYNET_N750_WMAC_CALDATA_OFFSET 0x1000 +#define MYNET_N750_PCIE_CALDATA_OFFSET 0x5000 + +#define MYNET_N750_NVRAM_ADDR 0x1f058010 +#define MYNET_N750_NVRAM_SIZE 0x7ff0 + +static struct gpio_led mynet_n750_leds_gpio[] __initdata = { + { + .name = wd:blue:power, + .gpio = MYNET_N750_GPIO_LED_POWER, + .active_low = 0, + }, + { + .name = wd:blue:wps, + .gpio = MYNET_N750_GPIO_LED_WPS, + .active_low = 0, + }, + { + .name = wd:blue:wireless, + .gpio = MYNET_N750_GPIO_LED_WIFI, + .active_low = 0, + }, + { + .name = wd:blue:internet, + .gpio = MYNET_N750_GPIO_LED_INTERNET, + .active_low = 0, + }, +}; + +static struct gpio_keys_button mynet_n750_gpio_keys[] __initdata = { + { + .desc = Reset button, + .type = EV_KEY
[OpenWrt-Devel] [PATCH 1/4] [package] uboot-kirkwood: update to 2013.10
This was tested on a Cloud Engines Pogoplug E02. Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- package/boot/uboot-kirkwood/Makefile | 4 ++-- package/boot/uboot-kirkwood/patches/110-dockstar.patch | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package/boot/uboot-kirkwood/Makefile b/package/boot/uboot-kirkwood/Makefile index dc66450..7868914 100644 --- a/package/boot/uboot-kirkwood/Makefile +++ b/package/boot/uboot-kirkwood/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=u-boot -PKG_VERSION:=2012.10 +PKG_VERSION:=2013.10 PKG_RELEASE:=1 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=ftp://ftp.denx.de/pub/u-boot -PKG_MD5SUM:=8655f63b1e5c4647295ac9ce44660be3 +PKG_MD5SUM:=a076a044b64371edc52f7e562b13f6b2 PKG_TARGETS:=bin include $(INCLUDE_DIR)/package.mk diff --git a/package/boot/uboot-kirkwood/patches/110-dockstar.patch b/package/boot/uboot-kirkwood/patches/110-dockstar.patch index 4ff7e57..b3a6271 100644 --- a/package/boot/uboot-kirkwood/patches/110-dockstar.patch +++ b/package/boot/uboot-kirkwood/patches/110-dockstar.patch @@ -1,12 +1,12 @@ --- a/include/configs/dockstar.h +++ b/include/configs/dockstar.h -@@ -83,22 +83,19 @@ +@@ -67,22 +67,19 @@ * Default environment variables */ #define CONFIG_BOOTCOMMAND \ - setenv bootargs ${console} ${mtdparts} ${bootargs_root}; \ - ubi part root; \ -- ubifsmount root; \ +- ubifsmount ubi:root; \ - ubifsload 0x80 ${kernel}; \ - ubifsload 0x110 ${initrd}; \ - bootm 0x80 0x110 -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 2/4] [package] uboot-kirkwood: enable FDT support
This was tested on a Cloud Engines Pogoplug E02. Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- .../uboot-kirkwood/patches/120-enable-device-tree-support.patch | 9 + 1 file changed, 9 insertions(+) create mode 100644 package/boot/uboot-kirkwood/patches/120-enable-device-tree-support.patch diff --git a/package/boot/uboot-kirkwood/patches/120-enable-device-tree-support.patch b/package/boot/uboot-kirkwood/patches/120-enable-device-tree-support.patch new file mode 100644 index 000..8ea8bf1 --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/120-enable-device-tree-support.patch @@ -0,0 +1,9 @@ +--- a/include/configs/mv-common.h b/include/configs/mv-common.h +@@ -152,4 +152,6 @@ + #define CONFIG_LZO + #endif + ++#define CONFIG_OF_LIBFDT ++ + #endif /* _MV_COMMON_H */ -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 4/4] [package] uboot-envtools: add Pogoplug E02 support
Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- package/boot/uboot-envtools/files/kirkwood | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package/boot/uboot-envtools/files/kirkwood b/package/boot/uboot-envtools/files/kirkwood index f665d2d..3dbfb1e 100644 --- a/package/boot/uboot-envtools/files/kirkwood +++ b/package/boot/uboot-envtools/files/kirkwood @@ -11,6 +11,9 @@ touch /etc/config/ubootenv . /lib/functions.sh case `cat /proc/device-tree/model` in +Cloud Engines Pogoplug E02) + ubootenv_add_uci_config /dev/mtd0 0xc 0x2 0x2 + ;; RaidSonic ICY BOX IB-NAS62x0 (Rev B)) ubootenv_add_uci_config /dev/mtd1 0x0 0x2 0x2 ;; -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 0/4] Changes to u-boot for kirkwood
This patchset updates u-boot for the kirkwood platform and adds support for the Cloud Engines Pogoplug E02 device. The patchset was tested on actual hardware. Felix Kaechele (4): [package] uboot-kirkwood: update to 2013.10 [package] uboot-kirkwood: enable FDT support [package] uboot-kirkwood: fix pogo_e02 config [package] uboot-envtools: add Pogoplug E02 support package/boot/uboot-envtools/files/kirkwood | 3 ++ package/boot/uboot-kirkwood/Makefile | 4 +- .../boot/uboot-kirkwood/patches/110-dockstar.patch | 4 +- .../patches/120-enable-device-tree-support.patch | 9 + .../patches/130-fix-pogo_e02-config.patch | 45 ++ 5 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 package/boot/uboot-kirkwood/patches/120-enable-device-tree-support.patch create mode 100644 package/boot/uboot-kirkwood/patches/130-fix-pogo_e02-config.patch -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] WD MyNet N750: ar9344 + ar8327 switch, unclear on phy/mdio/mac wiring
As I ordered 10 of these devices for a project I'm definitely interested in getting this to work. Will probably also look into this as soon as I have my devices. - Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] ramips: add script to ignore bogus failsafe button
This script helps prevent unwanted boots into failsafe mode when the board generates bogus button presses during bootup that cannot be fixed by debouncing the offending button/GPIO. The Poray X5/X6 is such a case. Signed-off-by: Felix Kaechele fe...@fetzig.org --- .../lib/preinit/31_failsafe_ignore_button | 34 ++ 1 file changed, 34 insertions(+) create mode 100644 target/linux/ramips/base-files/lib/preinit/31_failsafe_ignore_button diff --git a/target/linux/ramips/base-files/lib/preinit/31_failsafe_ignore_button b/target/linux/ramips/base-files/lib/preinit/31_failsafe_ignore_button new file mode 100644 index 000..3b2be9d --- /dev/null +++ b/target/linux/ramips/base-files/lib/preinit/31_failsafe_ignore_button @@ -0,0 +1,34 @@ +#!/bin/sh +# Here you can define boards that have faulty buttons that generate +# unwanted boots into failsafe during preinit +# You can specify one or more buttons like this: +# ignore_button btn1 btn2 .. + +. /lib/functions.sh +. /lib/ramips.sh + +ignore_button() { +if [ -f /tmp/failsafe_button ] +then +FS_BTN=`cat /tmp/failsafe_button` +for IGN_BTN in $@ +do +if [ $FS_BTN = $IGN_BTN ] +then +rm /tmp/failsafe /tmp/failsafe_button +unset FAILSAFE +echo - ignoring ${IGN_BTN} button failsafe event on $(ramips_board_name) - +fi +done +fi +} + +fs_ignore_button() { +case $(ramips_board_name) in +x5) +ignore_button wps +;; +esac +} + +boot_hook_add preinit_main fs_ignore_button -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] ramips: add script to ignore bogus failsafe button
I have the problem that one button on the Poray X5 generates bogus keypresses during boot up. This, in most cases, leads to the device booting into failsafe mode although this has not been requested by the user. This patch offers a generic way to fix this for other boards also. I still need to test the other Poray boards, whether they exhibit the same behaviour. The script in this patch was designed so that requesting failsafe boot using other buttons is still possible. I haven't been able to diagnose why this is but I've sent a device to blogic so maybe he can find out. I currently don't have the gear. So I'd prefer adding this script until we can come up with the correct fix. Felix Kaechele (1): ramips: add script to ignore bogus failsafe button .../lib/preinit/31_failsafe_ignore_button | 34 ++ 1 file changed, 34 insertions(+) create mode 100644 target/linux/ramips/base-files/lib/preinit/31_failsafe_ignore_button -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Few questions about Ralink support
Flávio Silveira wrote: 1- Wireless LED is defined as rt2800pci-phy0::radio, but in this router it lights up when it detects phy0, when wireless is up it turns off, is there a way to change LED polarity? Maybe in dts file?! Add ralink,led-polarity = 1; to the wmac section in your DTS. 2- My dts file doesn't have wmac@1018 section, although wireless works regardless. I've talked to John Crispin on IRC and he said it is not mandatory, can someone explain when it is needed or what it does? I've seen it being used with status = okay, but it seems to have another options. For the WSoCs the wmac is now automatically enabled, I guess just because every WSoC has a wmac. That means that you only need this section in your DTS file when you need to change the defaults. Also I was worried about rt2800_wmac 1018.wmac: failed to load eeprom property, which I thought was caused by lack of ralink,mtd-eeprom definition in wmac@1018 section, just for testing purposes, what's the correct why to define it? I can ignore it as John advised, but I'm curious :-) Syntax seems to be ralink,mtd-eeprom = partition containing eeprom size; Almost: ralink,mtd-eeprom = name of partition containing eeprom offset; Think of the in front of the partition name as a pointer (like in C) that corresponds to the name of the partition given earlier in the DTS. That's why some partitions have a descriptor in front of them (i.e. factory:) The eeprom size itself is defined in the rt2x00 driver. I'm using devdata in 10-rt2x00-eeprom for my device, I just don't know what to put in size, I've seen mostly 0, so ralink,mtd-eeprom = devdata 0; should work, right? If your partition containing the eeprom is named devdata and the eeprom data starts at byte offset 0 then yes. 10-rt2x00-eeprom should become obsolete for most boards as they move towards defining this information in the DTS. The script is still useful if more sophisticated means of extracting the firmware is needed. 3- I've seen not all Ralink routers are defined in 02_network, because I assume default configuration works for most of them. I've defined mine, but my question is: How do I know I have to define it? It seems to work regardless. Mostly you can tell by either looking how the network interfaces on the original firmware are organized or how the ports are arranged on the device. Mostly you need this when the LAN and WAN port are on the same switch and are only seperated by VLANs. 4- How do I discover magic of this router, to setup it properly in platform_check_image() in platform.sh? The magic you need depends on the bootloader. Most Ralink based boards use u-boot so 0x27051956 would be the correct magic. Sometimes vendors feel they need to change this. Then you can usually look at the vendor's original firmware image header. Regards, Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Few questions about Ralink support
Flávio Silveira wrote: The offset defined in 10-rt2x00-eeprom is 16384, so I've put: ralink,mtd-eeprom = devdata 16384; That should work, yes. 10-rt2x00-eeprom should become obsolete for most boards as they move towards defining this information in the DTS. The script is still useful if more sophisticated means of extracting the firmware is needed. Good to know, so it's good to update my dts file already, right? Yeah, makes sense. 4- How do I discover magic of this router, to setup it properly in platform_check_image() in platform.sh? The magic you need depends on the bootloader. Most Ralink based boards use u-boot so 0x27051956 would be the correct magic. Sometimes vendors feel they need to change this. Then you can usually look at the vendor's original firmware image header. Do you mean for me to check the first 32 bytes of original firmware and it should contain 27051956? Is there an offset to look at? Best case is that the magic is right at offset 0. It's quite common that vendors modify their images to contain custom header information (that's why there are so many tools to generate vendor specific images). This header information is then usually stripped out by the vendor's firmware update routine. So you might be lucky to find the uImage magic at some other offset. As always, binwalk is your friend here. Worst case is that the image is obfuscated or otherwise encrypted. Then it is down to reverse engineering the vendor's update mechanism to find out how they modified that image. That's what we needed to do for the devices manufactured by Poray (see the mkporayfw tool). But when decrypted and custom headers stripped it clearly shows the uImage magic at offset 0. Here is stock firmware boot log, if it helps: http://codepad.org/stXQWQSQ This log looks like your board expects a SEAMA image header rather than uImage. So you're looking at a magic of 0x5ea3a417. Also, judging from the MAC Adress it's also a D-Link device. Refer to the DIR-645 on how to use/generate SEAMA images as it has been done there before. Regards, Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v3 0/6] rampis: Add support for various Poray devices
Hopefully the last deluge of patches on this topic ;-) Thanks to everyone helping with this! Made last little changes to the mkporayfw tool as suggested by Yousong Zhou Felix Kaechele (6): ramips: add basics for Poray devices ramips: add Poray M3 support ramips: add Poray M4 4M/8M support ramips: add Poray X5/X6 Support ramips: add Poray X8 support ramips: add Poray IP2202 support target/linux/ramips/base-files/etc/diag.sh | 15 + .../ramips/base-files/etc/uci-defaults/02_network | 9 + .../ramips/base-files/lib/preinit/06_set_iface_mac | 9 + target/linux/ramips/base-files/lib/ramips.sh | 15 + .../ramips/base-files/lib/upgrade/platform.sh | 7 +- target/linux/ramips/dts/IP2202.dts | 97 +++ target/linux/ramips/dts/M3.dts | 106 +++ target/linux/ramips/dts/M4-4M.dts | 99 +++ target/linux/ramips/dts/M4-8M.dts | 99 +++ target/linux/ramips/dts/X5.dts | 133 target/linux/ramips/dts/X8.dts | 100 +++ target/linux/ramips/image/Makefile | 51 ++ target/linux/ramips/rt305x/profiles/poray.mk | 59 ++ tools/firmware-utils/Makefile | 1 + tools/firmware-utils/src/mkporayfw.c | 753 + 15 files changed, 1552 insertions(+), 1 deletion(-) create mode 100644 target/linux/ramips/dts/IP2202.dts create mode 100644 target/linux/ramips/dts/M3.dts create mode 100644 target/linux/ramips/dts/M4-4M.dts create mode 100644 target/linux/ramips/dts/M4-8M.dts create mode 100644 target/linux/ramips/dts/X5.dts create mode 100644 target/linux/ramips/dts/X8.dts create mode 100644 target/linux/ramips/rt305x/profiles/poray.mk create mode 100644 tools/firmware-utils/src/mkporayfw.c -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v3 3/6] ramips: add Poray M4 4M/8M support
Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- target/linux/ramips/base-files/etc/diag.sh | 3 + .../ramips/base-files/etc/uci-defaults/02_network | 3 +- .../ramips/base-files/lib/preinit/06_set_iface_mac | 3 +- target/linux/ramips/base-files/lib/ramips.sh | 3 + .../ramips/base-files/lib/upgrade/platform.sh | 1 + target/linux/ramips/dts/M4-4M.dts | 99 ++ target/linux/ramips/dts/M4-8M.dts | 99 ++ target/linux/ramips/image/Makefile | 3 + target/linux/ramips/rt305x/profiles/poray.mk | 10 +++ 9 files changed, 222 insertions(+), 2 deletions(-) create mode 100644 target/linux/ramips/dts/M4-4M.dts create mode 100644 target/linux/ramips/dts/M4-8M.dts diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index a68538b..57c8beb 100755 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -55,6 +55,9 @@ get_status_led() { m3) status_led=m3:blue:status ;; + m4) + status_led=m4:blue:status + ;; mofi3500-3gn) status_led=mofi3500-3gn:green:status ;; diff --git a/target/linux/ramips/base-files/etc/uci-defaults/02_network b/target/linux/ramips/base-files/etc/uci-defaults/02_network index 307330b..133c2de 100755 --- a/target/linux/ramips/base-files/etc/uci-defaults/02_network +++ b/target/linux/ramips/base-files/etc/uci-defaults/02_network @@ -226,7 +226,8 @@ ramips_setup_macs() wan_mac=$(macaddr_add $lan_mac 1) ;; - m3) + m3 |\ + m4) lan_mac=$(mtd_get_mac_binary factory 4) lan_mac=$(macaddr_add $lan_mac -1) ;; diff --git a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac index 86c19b0..f9aabd5 100644 --- a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac +++ b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac @@ -75,7 +75,8 @@ preinit_set_mac_address() { mac=$(mtd_get_mac_binary factory 40) ifconfig eth0 hw ether $mac 2/dev/null ;; - m3) + m3 |\ + m4) mac=$(mtd_get_mac_binary factory 4) mac=$(macaddr_add $mac -1) ifconfig eth0 hw ether $mac 2/dev/null diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index 7afa707..e3776f1 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -151,6 +151,9 @@ ramips_board_detect() { *Poray M3) name=m3 ;; + *Poray M4) + name=m4 + ;; *PWH2004) name=pwh2004 ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index 4ac86e9..5e1a7a5 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -45,6 +45,7 @@ platform_check_image() { hw550-3g | \ hg255d | \ m3 | \ + m4 | \ mofi3500-3gn | \ mpr-a1 | \ mpr-a2 | \ diff --git a/target/linux/ramips/dts/M4-4M.dts b/target/linux/ramips/dts/M4-4M.dts new file mode 100644 index 000..86bd832 --- /dev/null +++ b/target/linux/ramips/dts/M4-4M.dts @@ -0,0 +1,99 @@ +/dts-v1/; + +/include/ rt5350.dtsi + +/ { + compatible = M4, ralink,rt5350-soc; + model = Poray M4; + + palmbus@1000 { + sysc@0 { + ralink,pinmux = i2c, spi, uartlite, jtag, mdio, sdram, rgmii; + ralink,uartmux = gpio; + ralink,wdtmux = 1; + }; + + gpio0: gpio@600 { + status = okay; + }; + + spi@b00 { + status = okay; + m25p80@0 { + #address-cells = 1; + #size-cells = 1; + compatible = pm25lq032; + reg = 0 0; + linux,modalias = m25p80, pm25lq032; + spi-max-frequency = 1000; + + partition@0 { + label = u-boot; + reg = 0x0 0x3; + read-only; + }; + + partition@3 { + label = u-boot-env; + reg = 0x3 0x1
[OpenWrt-Devel] [PATCH v3 1/6] ramips: add basics for Poray devices
This commit adds the basic elements to support Poray brand routers. It contains a tool to do the encryption/obfuscation that is used in Poray routers. Support for Poray devices was worked on by: Felix Kaechele hef...@fedoraproject.org Luis Soltero lsolt...@globalmarinenet.com Michel Stempin michel.stem...@wanadoo.fr Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- target/linux/ramips/image/Makefile | 36 ++ target/linux/ramips/rt305x/profiles/poray.mk | 7 + tools/firmware-utils/Makefile| 1 + tools/firmware-utils/src/mkporayfw.c | 753 +++ 4 files changed, 797 insertions(+) create mode 100644 target/linux/ramips/rt305x/profiles/poray.mk create mode 100644 tools/firmware-utils/src/mkporayfw.c diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index 04d68fe..847eed4 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -215,6 +215,42 @@ define BuildFirmware/dap1350/squashfs endef BuildFirmware/dap1350/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3)) +# Sign Poray images +define BuildFirmware/Poray4M/squashfs + $(call BuildFirmware/Default4M/$(1),$(1),$(2),$(3)) + if [ -e $(call sysupname,$(1),$(2)) ]; then \ + mkporayfw -B $(3) -F 4M \ + -f $(call sysupname,$(1),$(2)) \ + -o $(call imgname,$(1),$(2))-factory.bin; \ + fi +endef +BuildFirmware/Poray4M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3)) + +define BuildFirmware/Poray8M/squashfs + $(call BuildFirmware/Default8M/$(1),$(1),$(2),$(3)) + if [ -e $(call sysupname,$(1),$(2)) ]; then \ + mkporayfw -B $(3) -F 8M \ + -f $(call sysupname,$(1),$(2)) \ + -o $(call imgname,$(1),$(2))-factory.bin; \ + fi +endef +BuildFirmware/Poray8M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3)) + +define BuildFirmware/PorayDualSize/squashfs + $(call BuildFirmware/DefaultDualSize/$(1),$(1),$(2),$(3)) + if [ -e $(call sysupname,$(1),$(2)-4M) ]; then \ + mkporayfw -B $(3) -F 4M \ + -f $(call sysupname,$(1),$(2)-4M) \ + -o $(call imgname,$(1),$(2))-4M-factory.bin; \ + fi + if [ -e $(call sysupname,$(1),$(2)-8M) ]; then \ + mkporayfw -B $(3) -F 8M \ + -f $(call sysupname,$(1),$(2)-8M) \ + -o $(call imgname,$(1),$(2))-8M-factory.bin; \ + fi +endef +BuildFirmware/PorayDualSize/initramfs=$(call BuildFirmware/DefaultDualSize/initramfs,$(1),$(2),$(3)) + # # RT288X Profiles # diff --git a/target/linux/ramips/rt305x/profiles/poray.mk b/target/linux/ramips/rt305x/profiles/poray.mk new file mode 100644 index 000..2122ca1 --- /dev/null +++ b/target/linux/ramips/rt305x/profiles/poray.mk @@ -0,0 +1,7 @@ +# +# Copyright (C) 2013 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index 70edd48..c0d577e 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -63,6 +63,7 @@ define Host/Compile $(call cc,seama md5) $(call cc,fix-u-media-header cyg_crc32,-Wall) $(call cc,hcsmakeimage bcmalgo) + $(call cc,mkporayfw, -Wall) endef define Host/Install diff --git a/tools/firmware-utils/src/mkporayfw.c b/tools/firmware-utils/src/mkporayfw.c new file mode 100644 index 000..b4d5d78 --- /dev/null +++ b/tools/firmware-utils/src/mkporayfw.c @@ -0,0 +1,753 @@ +/* + * Builder/viewer/extractor utility for Poray firmware image files + * + * Copyright (C) 2013 Michel Stempin michel.stem...@wanadoo.fr + * Copyright (C) 2013 Felix Kaechele fe...@fetzig.org + * Copyright (C) 2013 ad...@openschemes.com + * + * This tool is based on: + * TP-Link firmware upgrade tool. + * Copyright (C) 2009 Gabor Juhos juh...@openwrt.org + * + * Itself based on: + * TP-Link WR941 V2 firmware checksum fixing tool. + * Copyright (C) 2008,2009 Wang Jian l...@linux.net.cn + * + * 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 stdio.h +#include stdlib.h +#include stdint.h +#include string.h +#include unistd.h +#include libgen.h +#include getopt.h +#include stdarg.h +#include errno.h +#include sys/stat.h +#include arpa/inet.h +#include netinet/in.h + +#if (__BYTE_ORDER == __BIG_ENDIAN) +# define HOST_TO_BE32(x) (x) +# define BE32_TO_HOST(x) (x) +# define HOST_TO_LE32(x) bswap_32(x) +# define LE32_TO_HOST(x) bswap_32(x) +#else +# define HOST_TO_BE32(x) bswap_32(x) +# define BE32_TO_HOST(x) bswap_32(x) +# define HOST_TO_LE32(x
[OpenWrt-Devel] [PATCH v3 6/6] ramips: add Poray IP2202 support
Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- target/linux/ramips/base-files/etc/diag.sh | 3 + .../ramips/base-files/etc/uci-defaults/02_network | 1 + .../ramips/base-files/lib/preinit/06_set_iface_mac | 1 + target/linux/ramips/base-files/lib/ramips.sh | 3 + .../ramips/base-files/lib/upgrade/platform.sh | 1 + target/linux/ramips/dts/IP2202.dts | 97 ++ target/linux/ramips/image/Makefile | 3 + target/linux/ramips/rt305x/profiles/poray.mk | 12 +++ 8 files changed, 121 insertions(+) create mode 100644 target/linux/ramips/dts/IP2202.dts diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index 689fee7..6ecb133 100755 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -45,6 +45,9 @@ get_status_led() { fonera20n) status_led=fonera20n:green:power ;; + ip2202) + status_led=ip2202:green:run + ;; rt-n13u) status_led=rt-n13u:power ;; diff --git a/target/linux/ramips/base-files/etc/uci-defaults/02_network b/target/linux/ramips/base-files/etc/uci-defaults/02_network index 2df7b08..ef13e36 100755 --- a/target/linux/ramips/base-files/etc/uci-defaults/02_network +++ b/target/linux/ramips/base-files/etc/uci-defaults/02_network @@ -173,6 +173,7 @@ ramips_setup_macs() broadway | \ dir-620-d1 | \ f5d8235-v1 | \ + ip2202 | \ mpr-a1 | \ mpr-a2 | \ mzk-w300nh2 | \ diff --git a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac index 6712154..a0d9b61 100644 --- a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac +++ b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac @@ -60,6 +60,7 @@ preinit_set_mac_address() { carambola |\ dir-615-h1 |\ fonera20n |\ + ip2202 |\ rt-n13u |\ hw550-3g |\ nbg-419n |\ diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index 6960c6d..858a809 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -148,6 +148,9 @@ ramips_board_detect() { *Planex MZK-W300NH2*) name=mzk-w300nh2 ;; + *Poray IP2202) + name=ip2202 + ;; *Poray M3) name=m3 ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index df3b324..e85bead 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -44,6 +44,7 @@ platform_check_image() { freestation5 | \ hw550-3g | \ hg255d | \ + ip2202 | \ m3 | \ m4 | \ mofi3500-3gn | \ diff --git a/target/linux/ramips/dts/IP2202.dts b/target/linux/ramips/dts/IP2202.dts new file mode 100644 index 000..ea9f170 --- /dev/null +++ b/target/linux/ramips/dts/IP2202.dts @@ -0,0 +1,97 @@ +/dts-v1/; + +/include/ rt3050.dtsi + +/ { + compatible = IP2202, ralink,rt3052-soc; + model = Poray IP2202; + + palmbus@1000 { + sysc@0 { + ralink,pinmux = i2c, spi, uartlite, jtag, sdram, rgmii; + ralink,gpiomux = mdio; + ralink,uartmux = gpio; + ralink,wdtmux = 1; + }; + + gpio0: gpio@600 { + status = okay; + }; + + }; + + cfi@1f00 { + compatible = cfi-flash; + reg = 0x1f00 0x80; + + bank-width = 2; + device-width = 2; + #address-cells = 1; + #size-cells = 1; + + partition@0 { + label = u-boot; + reg = 0x0 0x3; + read-only; + }; + + partition@3 { + label = u-boot-env; + reg = 0x3 0x1; + read-only; + }; + + factory: partition@4 { + label = factory; + reg = 0x4 0x1; + read-only; + }; + + partition@5 { + label = firmware; + reg = 0x5 0x7b; + }; + }; + + ethernet@1010 { + status = okay; + }; + + esw@1011 { + status = okay; + ralink,portmap = 0x2f; + }; + + gpio-leds { + compatible = gpio-leds; + run
[OpenWrt-Devel] [PATCH v3 5/6] ramips: add Poray X8 support
Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- target/linux/ramips/base-files/etc/diag.sh | 3 + .../ramips/base-files/etc/uci-defaults/02_network | 3 +- .../ramips/base-files/lib/preinit/06_set_iface_mac | 3 +- target/linux/ramips/base-files/lib/ramips.sh | 3 + .../ramips/base-files/lib/upgrade/platform.sh | 3 +- target/linux/ramips/dts/X8.dts | 100 + target/linux/ramips/image/Makefile | 3 + target/linux/ramips/rt305x/profiles/poray.mk | 10 +++ 8 files changed, 125 insertions(+), 3 deletions(-) create mode 100644 target/linux/ramips/dts/X8.dts diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index d04d990..689fee7 100755 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -141,6 +141,9 @@ get_status_led() { x5) status_led=x5:green:power ;; + x8) + status_led=x8:green:power + ;; xdxrn502j) status_led=xdxrn502j:green:power ;; diff --git a/target/linux/ramips/base-files/etc/uci-defaults/02_network b/target/linux/ramips/base-files/etc/uci-defaults/02_network index fa5b28e..2df7b08 100755 --- a/target/linux/ramips/base-files/etc/uci-defaults/02_network +++ b/target/linux/ramips/base-files/etc/uci-defaults/02_network @@ -228,7 +228,8 @@ ramips_setup_macs() m3 |\ m4 |\ - x5) + x5 |\ + x8) lan_mac=$(mtd_get_mac_binary factory 4) lan_mac=$(macaddr_add $lan_mac -1) ;; diff --git a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac index 3073233..6712154 100644 --- a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac +++ b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac @@ -77,7 +77,8 @@ preinit_set_mac_address() { ;; m3 |\ m4 |\ - x5) + x5 |\ + x8) mac=$(mtd_get_mac_binary factory 4) mac=$(macaddr_add $mac -1) ifconfig eth0 hw ether $mac 2/dev/null diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index 1bf93e3..6960c6d 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -157,6 +157,9 @@ ramips_board_detect() { *Poray X5) name=x5 ;; + *Poray X8) + name=x8 + ;; *PWH2004) name=pwh2004 ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index 4b80afa..df3b324 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -76,7 +76,8 @@ platform_check_image() { ur-326n4g |\ ur-336un |\ wr512-3gn |\ - x5) + x5 |\ + x8) [ $magic != 27051956 ] { echo Invalid image type. return 1 diff --git a/target/linux/ramips/dts/X8.dts b/target/linux/ramips/dts/X8.dts new file mode 100644 index 000..e7b13ca --- /dev/null +++ b/target/linux/ramips/dts/X8.dts @@ -0,0 +1,100 @@ +/dts-v1/; + +/include/ rt5350.dtsi + +/ { + compatible = X8, ralink,rt5350-soc; + model = Poray X8; + + palmbus@1000 { + sysc@0 { + ralink,pinmux = i2c, spi, uartlite, mdio, sdram, rgmii; + ralink,gpiomux = jtag; + ralink,uartmux = gpio; + ralink,wdtmux = 1; + }; + + gpio0: gpio@600 { + status = okay; + }; + + spi@b00 { + status = okay; + m25p80@0 { + #address-cells = 1; + #size-cells = 1; + compatible = gd25q64; + reg = 0 0; + linux,modalias = m25p80, gd25q64; + spi-max-frequency = 1000; + + partition@0 { + label = u-boot; + reg = 0x0 0x3; + read-only; + }; + + partition@3 { + label = u-boot-env; + reg = 0x3 0x1; + read-only; + }; + + factory: partition@4
[OpenWrt-Devel] [PATCH v3 4/6] ramips: add Poray X5/X6 Support
Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- target/linux/ramips/base-files/etc/diag.sh | 3 + .../ramips/base-files/etc/uci-defaults/02_network | 3 +- .../ramips/base-files/lib/preinit/06_set_iface_mac | 3 +- target/linux/ramips/base-files/lib/ramips.sh | 3 + .../ramips/base-files/lib/upgrade/platform.sh | 3 +- target/linux/ramips/dts/X5.dts | 133 + target/linux/ramips/image/Makefile | 3 + target/linux/ramips/rt305x/profiles/poray.mk | 10 ++ 8 files changed, 158 insertions(+), 3 deletions(-) create mode 100644 target/linux/ramips/dts/X5.dts diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index 57c8beb..d04d990 100755 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -138,6 +138,9 @@ get_status_led() { ur-336un) status_led=ur336:green:wps ;; + x5) + status_led=x5:green:power + ;; xdxrn502j) status_led=xdxrn502j:green:power ;; diff --git a/target/linux/ramips/base-files/etc/uci-defaults/02_network b/target/linux/ramips/base-files/etc/uci-defaults/02_network index 133c2de..fa5b28e 100755 --- a/target/linux/ramips/base-files/etc/uci-defaults/02_network +++ b/target/linux/ramips/base-files/etc/uci-defaults/02_network @@ -227,7 +227,8 @@ ramips_setup_macs() ;; m3 |\ - m4) + m4 |\ + x5) lan_mac=$(mtd_get_mac_binary factory 4) lan_mac=$(macaddr_add $lan_mac -1) ;; diff --git a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac index f9aabd5..3073233 100644 --- a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac +++ b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac @@ -76,7 +76,8 @@ preinit_set_mac_address() { ifconfig eth0 hw ether $mac 2/dev/null ;; m3 |\ - m4) + m4 |\ + x5) mac=$(mtd_get_mac_binary factory 4) mac=$(macaddr_add $mac -1) ifconfig eth0 hw ether $mac 2/dev/null diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index e3776f1..1bf93e3 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -154,6 +154,9 @@ ramips_board_detect() { *Poray M4) name=m4 ;; + *Poray X5) + name=x5 + ;; *PWH2004) name=pwh2004 ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index 5e1a7a5..4b80afa 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -75,7 +75,8 @@ platform_check_image() { whr-g300n |\ ur-326n4g |\ ur-336un |\ - wr512-3gn) + wr512-3gn |\ + x5) [ $magic != 27051956 ] { echo Invalid image type. return 1 diff --git a/target/linux/ramips/dts/X5.dts b/target/linux/ramips/dts/X5.dts new file mode 100644 index 000..d9e9632 --- /dev/null +++ b/target/linux/ramips/dts/X5.dts @@ -0,0 +1,133 @@ +/dts-v1/; + +/include/ rt5350.dtsi + +/ { + compatible = X5, ralink,rt5350-soc; + model = Poray X5; + + palmbus@1000 { + sysc@0 { + ralink,pinmux = i2c, spi, uartlite, mdio, sdram, rgmii; + ralink,gpiomux = jtag; + ralink,uartmux = gpio; + ralink,wdtmux = 1; + }; + + gpio0: gpio@600 { + status = okay; + }; + + spi@b00 { + status = okay; + m25p80@0 { + #address-cells = 1; + #size-cells = 1; + compatible = gd25q64; + reg = 0 0; + linux,modalias = m25p80, gd25q64; + spi-max-frequency = 1000; + + partition@0 { + label = u-boot; + reg = 0x0 0x3; + read-only; + }; + + partition@3 { + label = u-boot-env; + reg = 0x3 0x1; + read-only
[OpenWrt-Devel] [PATCH v2 0/6] rampis: Add support for various Poray devices
This is a reworked version of the last patchset I sent recently: * I've edited the mkporayfw tool to reflect the suggestions made by Yousong Zhou (thanks for the review!). Reviews done on the new version of the code are much appreciated! For your convenience I uploaded a diff of the changes here: https://gist.github.com/kaechele/c159233e3299ad4158fa * Furthermore I fixed the indentation on the DTS files as was done with the other ramips DTS files. Felix Kaechele (6): ramips: add basics for Poray devices ramips: add Poray M3 support ramips: add Poray M4 4M/8M support ramips: add Poray X5/X6 Support ramips: add Poray X8 support ramips: add Poray IP2202 support target/linux/ramips/base-files/etc/diag.sh | 15 + .../ramips/base-files/etc/uci-defaults/02_network | 9 + .../ramips/base-files/lib/preinit/06_set_iface_mac | 9 + target/linux/ramips/base-files/lib/ramips.sh | 15 + .../ramips/base-files/lib/upgrade/platform.sh | 7 +- target/linux/ramips/dts/IP2202.dts | 97 +++ target/linux/ramips/dts/M3.dts | 106 +++ target/linux/ramips/dts/M4-4M.dts | 99 +++ target/linux/ramips/dts/M4-8M.dts | 99 +++ target/linux/ramips/dts/X5.dts | 133 target/linux/ramips/dts/X8.dts | 100 +++ target/linux/ramips/image/Makefile | 51 ++ target/linux/ramips/rt305x/profiles/poray.mk | 59 ++ tools/firmware-utils/Makefile | 1 + tools/firmware-utils/src/mkporayfw.c | 757 + 15 files changed, 1556 insertions(+), 1 deletion(-) create mode 100644 target/linux/ramips/dts/IP2202.dts create mode 100644 target/linux/ramips/dts/M3.dts create mode 100644 target/linux/ramips/dts/M4-4M.dts create mode 100644 target/linux/ramips/dts/M4-8M.dts create mode 100644 target/linux/ramips/dts/X5.dts create mode 100644 target/linux/ramips/dts/X8.dts create mode 100644 target/linux/ramips/rt305x/profiles/poray.mk create mode 100644 tools/firmware-utils/src/mkporayfw.c -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v2 2/6] ramips: add Poray M3 support
Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- target/linux/ramips/base-files/etc/diag.sh | 3 + .../ramips/base-files/etc/uci-defaults/02_network | 5 + .../ramips/base-files/lib/preinit/06_set_iface_mac | 5 + target/linux/ramips/base-files/lib/ramips.sh | 3 + .../ramips/base-files/lib/upgrade/platform.sh | 1 + target/linux/ramips/dts/M3.dts | 106 + target/linux/ramips/image/Makefile | 3 + target/linux/ramips/rt305x/profiles/poray.mk | 10 ++ 8 files changed, 136 insertions(+) create mode 100644 target/linux/ramips/dts/M3.dts diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index f8e9787..a68538b 100755 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -52,6 +52,9 @@ get_status_led() { hw550-3g) status_led=hw550-3g:green:status ;; + m3) + status_led=m3:blue:status + ;; mofi3500-3gn) status_led=mofi3500-3gn:green:status ;; diff --git a/target/linux/ramips/base-files/etc/uci-defaults/02_network b/target/linux/ramips/base-files/etc/uci-defaults/02_network index 6877588..307330b 100755 --- a/target/linux/ramips/base-files/etc/uci-defaults/02_network +++ b/target/linux/ramips/base-files/etc/uci-defaults/02_network @@ -226,6 +226,11 @@ ramips_setup_macs() wan_mac=$(macaddr_add $lan_mac 1) ;; + m3) + lan_mac=$(mtd_get_mac_binary factory 4) + lan_mac=$(macaddr_add $lan_mac -1) + ;; + nbg-419n | \ wcr-150gn) lan_mac=$(mtd_get_mac_binary factory 4) diff --git a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac index aacec25..86c19b0 100644 --- a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac +++ b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac @@ -75,6 +75,11 @@ preinit_set_mac_address() { mac=$(mtd_get_mac_binary factory 40) ifconfig eth0 hw ether $mac 2/dev/null ;; + m3) + mac=$(mtd_get_mac_binary factory 4) + mac=$(macaddr_add $mac -1) + ifconfig eth0 hw ether $mac 2/dev/null + ;; wl341v3) mac=$(mtd_get_mac_binary board-nvram 65440) ifconfig eth0 hw ether $mac 2/dev/null diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index b1ecc8d..7afa707 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -148,6 +148,9 @@ ramips_board_detect() { *Planex MZK-W300NH2*) name=mzk-w300nh2 ;; + *Poray M3) + name=m3 + ;; *PWH2004) name=pwh2004 ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index 1d867a7..4ac86e9 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -44,6 +44,7 @@ platform_check_image() { freestation5 | \ hw550-3g | \ hg255d | \ + m3 | \ mofi3500-3gn | \ mpr-a1 | \ mpr-a2 | \ diff --git a/target/linux/ramips/dts/M3.dts b/target/linux/ramips/dts/M3.dts new file mode 100644 index 000..3e391b3 --- /dev/null +++ b/target/linux/ramips/dts/M3.dts @@ -0,0 +1,106 @@ +/dts-v1/; + +/include/ rt5350.dtsi + +/ { + compatible = M3, ralink,rt5350-soc; + model = Poray M3; + + palmbus@1000 { + sysc@0 { + ralink,pinmux = i2c, spi, uartlite, mdio, sdram, rgmii; + ralink,gpiomux = jtag; + ralink,uartmux = gpio; + ralink,wdtmux = 1; + }; + + gpio0: gpio@600 { + status = okay; + }; + + spi@b00 { + status = okay; + m25p80@0 { + #address-cells = 1; + #size-cells = 1; + compatible = w25q32; + reg = 0 0; + linux,modalias = m25p80, w25q32; + spi-max-frequency = 1000; + + partition@0 { + label = u-boot; + reg = 0x0 0x3; + read-only; + }; + + partition@3
[OpenWrt-Devel] [PATCH v2 3/6] ramips: add Poray M4 4M/8M support
Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- target/linux/ramips/base-files/etc/diag.sh | 3 + .../ramips/base-files/etc/uci-defaults/02_network | 3 +- .../ramips/base-files/lib/preinit/06_set_iface_mac | 3 +- target/linux/ramips/base-files/lib/ramips.sh | 3 + .../ramips/base-files/lib/upgrade/platform.sh | 1 + target/linux/ramips/dts/M4-4M.dts | 99 ++ target/linux/ramips/dts/M4-8M.dts | 99 ++ target/linux/ramips/image/Makefile | 3 + target/linux/ramips/rt305x/profiles/poray.mk | 10 +++ 9 files changed, 222 insertions(+), 2 deletions(-) create mode 100644 target/linux/ramips/dts/M4-4M.dts create mode 100644 target/linux/ramips/dts/M4-8M.dts diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index a68538b..57c8beb 100755 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -55,6 +55,9 @@ get_status_led() { m3) status_led=m3:blue:status ;; + m4) + status_led=m4:blue:status + ;; mofi3500-3gn) status_led=mofi3500-3gn:green:status ;; diff --git a/target/linux/ramips/base-files/etc/uci-defaults/02_network b/target/linux/ramips/base-files/etc/uci-defaults/02_network index 307330b..133c2de 100755 --- a/target/linux/ramips/base-files/etc/uci-defaults/02_network +++ b/target/linux/ramips/base-files/etc/uci-defaults/02_network @@ -226,7 +226,8 @@ ramips_setup_macs() wan_mac=$(macaddr_add $lan_mac 1) ;; - m3) + m3 |\ + m4) lan_mac=$(mtd_get_mac_binary factory 4) lan_mac=$(macaddr_add $lan_mac -1) ;; diff --git a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac index 86c19b0..f9aabd5 100644 --- a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac +++ b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac @@ -75,7 +75,8 @@ preinit_set_mac_address() { mac=$(mtd_get_mac_binary factory 40) ifconfig eth0 hw ether $mac 2/dev/null ;; - m3) + m3 |\ + m4) mac=$(mtd_get_mac_binary factory 4) mac=$(macaddr_add $mac -1) ifconfig eth0 hw ether $mac 2/dev/null diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index 7afa707..e3776f1 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -151,6 +151,9 @@ ramips_board_detect() { *Poray M3) name=m3 ;; + *Poray M4) + name=m4 + ;; *PWH2004) name=pwh2004 ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index 4ac86e9..5e1a7a5 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -45,6 +45,7 @@ platform_check_image() { hw550-3g | \ hg255d | \ m3 | \ + m4 | \ mofi3500-3gn | \ mpr-a1 | \ mpr-a2 | \ diff --git a/target/linux/ramips/dts/M4-4M.dts b/target/linux/ramips/dts/M4-4M.dts new file mode 100644 index 000..86bd832 --- /dev/null +++ b/target/linux/ramips/dts/M4-4M.dts @@ -0,0 +1,99 @@ +/dts-v1/; + +/include/ rt5350.dtsi + +/ { + compatible = M4, ralink,rt5350-soc; + model = Poray M4; + + palmbus@1000 { + sysc@0 { + ralink,pinmux = i2c, spi, uartlite, jtag, mdio, sdram, rgmii; + ralink,uartmux = gpio; + ralink,wdtmux = 1; + }; + + gpio0: gpio@600 { + status = okay; + }; + + spi@b00 { + status = okay; + m25p80@0 { + #address-cells = 1; + #size-cells = 1; + compatible = pm25lq032; + reg = 0 0; + linux,modalias = m25p80, pm25lq032; + spi-max-frequency = 1000; + + partition@0 { + label = u-boot; + reg = 0x0 0x3; + read-only; + }; + + partition@3 { + label = u-boot-env; + reg = 0x3 0x1
[OpenWrt-Devel] [PATCH v2 6/6] ramips: add Poray IP2202 support
Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- target/linux/ramips/base-files/etc/diag.sh | 3 + .../ramips/base-files/etc/uci-defaults/02_network | 1 + .../ramips/base-files/lib/preinit/06_set_iface_mac | 1 + target/linux/ramips/base-files/lib/ramips.sh | 3 + .../ramips/base-files/lib/upgrade/platform.sh | 1 + target/linux/ramips/dts/IP2202.dts | 97 ++ target/linux/ramips/image/Makefile | 3 + target/linux/ramips/rt305x/profiles/poray.mk | 12 +++ 8 files changed, 121 insertions(+) create mode 100644 target/linux/ramips/dts/IP2202.dts diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index 689fee7..6ecb133 100755 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -45,6 +45,9 @@ get_status_led() { fonera20n) status_led=fonera20n:green:power ;; + ip2202) + status_led=ip2202:green:run + ;; rt-n13u) status_led=rt-n13u:power ;; diff --git a/target/linux/ramips/base-files/etc/uci-defaults/02_network b/target/linux/ramips/base-files/etc/uci-defaults/02_network index 2df7b08..ef13e36 100755 --- a/target/linux/ramips/base-files/etc/uci-defaults/02_network +++ b/target/linux/ramips/base-files/etc/uci-defaults/02_network @@ -173,6 +173,7 @@ ramips_setup_macs() broadway | \ dir-620-d1 | \ f5d8235-v1 | \ + ip2202 | \ mpr-a1 | \ mpr-a2 | \ mzk-w300nh2 | \ diff --git a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac index 6712154..a0d9b61 100644 --- a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac +++ b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac @@ -60,6 +60,7 @@ preinit_set_mac_address() { carambola |\ dir-615-h1 |\ fonera20n |\ + ip2202 |\ rt-n13u |\ hw550-3g |\ nbg-419n |\ diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index 6960c6d..858a809 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -148,6 +148,9 @@ ramips_board_detect() { *Planex MZK-W300NH2*) name=mzk-w300nh2 ;; + *Poray IP2202) + name=ip2202 + ;; *Poray M3) name=m3 ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index df3b324..e85bead 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -44,6 +44,7 @@ platform_check_image() { freestation5 | \ hw550-3g | \ hg255d | \ + ip2202 | \ m3 | \ m4 | \ mofi3500-3gn | \ diff --git a/target/linux/ramips/dts/IP2202.dts b/target/linux/ramips/dts/IP2202.dts new file mode 100644 index 000..ea9f170 --- /dev/null +++ b/target/linux/ramips/dts/IP2202.dts @@ -0,0 +1,97 @@ +/dts-v1/; + +/include/ rt3050.dtsi + +/ { + compatible = IP2202, ralink,rt3052-soc; + model = Poray IP2202; + + palmbus@1000 { + sysc@0 { + ralink,pinmux = i2c, spi, uartlite, jtag, sdram, rgmii; + ralink,gpiomux = mdio; + ralink,uartmux = gpio; + ralink,wdtmux = 1; + }; + + gpio0: gpio@600 { + status = okay; + }; + + }; + + cfi@1f00 { + compatible = cfi-flash; + reg = 0x1f00 0x80; + + bank-width = 2; + device-width = 2; + #address-cells = 1; + #size-cells = 1; + + partition@0 { + label = u-boot; + reg = 0x0 0x3; + read-only; + }; + + partition@3 { + label = u-boot-env; + reg = 0x3 0x1; + read-only; + }; + + factory: partition@4 { + label = factory; + reg = 0x4 0x1; + read-only; + }; + + partition@5 { + label = firmware; + reg = 0x5 0x7b; + }; + }; + + ethernet@1010 { + status = okay; + }; + + esw@1011 { + status = okay; + ralink,portmap = 0x2f; + }; + + gpio-leds { + compatible = gpio-leds; + run
[OpenWrt-Devel] [PATCH v2 5/6] ramips: add Poray X8 support
Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- target/linux/ramips/base-files/etc/diag.sh | 3 + .../ramips/base-files/etc/uci-defaults/02_network | 3 +- .../ramips/base-files/lib/preinit/06_set_iface_mac | 3 +- target/linux/ramips/base-files/lib/ramips.sh | 3 + .../ramips/base-files/lib/upgrade/platform.sh | 3 +- target/linux/ramips/dts/X8.dts | 100 + target/linux/ramips/image/Makefile | 3 + target/linux/ramips/rt305x/profiles/poray.mk | 10 +++ 8 files changed, 125 insertions(+), 3 deletions(-) create mode 100644 target/linux/ramips/dts/X8.dts diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index d04d990..689fee7 100755 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -141,6 +141,9 @@ get_status_led() { x5) status_led=x5:green:power ;; + x8) + status_led=x8:green:power + ;; xdxrn502j) status_led=xdxrn502j:green:power ;; diff --git a/target/linux/ramips/base-files/etc/uci-defaults/02_network b/target/linux/ramips/base-files/etc/uci-defaults/02_network index fa5b28e..2df7b08 100755 --- a/target/linux/ramips/base-files/etc/uci-defaults/02_network +++ b/target/linux/ramips/base-files/etc/uci-defaults/02_network @@ -228,7 +228,8 @@ ramips_setup_macs() m3 |\ m4 |\ - x5) + x5 |\ + x8) lan_mac=$(mtd_get_mac_binary factory 4) lan_mac=$(macaddr_add $lan_mac -1) ;; diff --git a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac index 3073233..6712154 100644 --- a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac +++ b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac @@ -77,7 +77,8 @@ preinit_set_mac_address() { ;; m3 |\ m4 |\ - x5) + x5 |\ + x8) mac=$(mtd_get_mac_binary factory 4) mac=$(macaddr_add $mac -1) ifconfig eth0 hw ether $mac 2/dev/null diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index 1bf93e3..6960c6d 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -157,6 +157,9 @@ ramips_board_detect() { *Poray X5) name=x5 ;; + *Poray X8) + name=x8 + ;; *PWH2004) name=pwh2004 ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index 4b80afa..df3b324 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -76,7 +76,8 @@ platform_check_image() { ur-326n4g |\ ur-336un |\ wr512-3gn |\ - x5) + x5 |\ + x8) [ $magic != 27051956 ] { echo Invalid image type. return 1 diff --git a/target/linux/ramips/dts/X8.dts b/target/linux/ramips/dts/X8.dts new file mode 100644 index 000..e7b13ca --- /dev/null +++ b/target/linux/ramips/dts/X8.dts @@ -0,0 +1,100 @@ +/dts-v1/; + +/include/ rt5350.dtsi + +/ { + compatible = X8, ralink,rt5350-soc; + model = Poray X8; + + palmbus@1000 { + sysc@0 { + ralink,pinmux = i2c, spi, uartlite, mdio, sdram, rgmii; + ralink,gpiomux = jtag; + ralink,uartmux = gpio; + ralink,wdtmux = 1; + }; + + gpio0: gpio@600 { + status = okay; + }; + + spi@b00 { + status = okay; + m25p80@0 { + #address-cells = 1; + #size-cells = 1; + compatible = gd25q64; + reg = 0 0; + linux,modalias = m25p80, gd25q64; + spi-max-frequency = 1000; + + partition@0 { + label = u-boot; + reg = 0x0 0x3; + read-only; + }; + + partition@3 { + label = u-boot-env; + reg = 0x3 0x1; + read-only; + }; + + factory: partition@4
[OpenWrt-Devel] [PATCH v2 4/6] ramips: add Poray X5/X6 Support
Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- target/linux/ramips/base-files/etc/diag.sh | 3 + .../ramips/base-files/etc/uci-defaults/02_network | 3 +- .../ramips/base-files/lib/preinit/06_set_iface_mac | 3 +- target/linux/ramips/base-files/lib/ramips.sh | 3 + .../ramips/base-files/lib/upgrade/platform.sh | 3 +- target/linux/ramips/dts/X5.dts | 133 + target/linux/ramips/image/Makefile | 3 + target/linux/ramips/rt305x/profiles/poray.mk | 10 ++ 8 files changed, 158 insertions(+), 3 deletions(-) create mode 100644 target/linux/ramips/dts/X5.dts diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index 57c8beb..d04d990 100755 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -138,6 +138,9 @@ get_status_led() { ur-336un) status_led=ur336:green:wps ;; + x5) + status_led=x5:green:power + ;; xdxrn502j) status_led=xdxrn502j:green:power ;; diff --git a/target/linux/ramips/base-files/etc/uci-defaults/02_network b/target/linux/ramips/base-files/etc/uci-defaults/02_network index 133c2de..fa5b28e 100755 --- a/target/linux/ramips/base-files/etc/uci-defaults/02_network +++ b/target/linux/ramips/base-files/etc/uci-defaults/02_network @@ -227,7 +227,8 @@ ramips_setup_macs() ;; m3 |\ - m4) + m4 |\ + x5) lan_mac=$(mtd_get_mac_binary factory 4) lan_mac=$(macaddr_add $lan_mac -1) ;; diff --git a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac index f9aabd5..3073233 100644 --- a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac +++ b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac @@ -76,7 +76,8 @@ preinit_set_mac_address() { ifconfig eth0 hw ether $mac 2/dev/null ;; m3 |\ - m4) + m4 |\ + x5) mac=$(mtd_get_mac_binary factory 4) mac=$(macaddr_add $mac -1) ifconfig eth0 hw ether $mac 2/dev/null diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index e3776f1..1bf93e3 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -154,6 +154,9 @@ ramips_board_detect() { *Poray M4) name=m4 ;; + *Poray X5) + name=x5 + ;; *PWH2004) name=pwh2004 ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index 5e1a7a5..4b80afa 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -75,7 +75,8 @@ platform_check_image() { whr-g300n |\ ur-326n4g |\ ur-336un |\ - wr512-3gn) + wr512-3gn |\ + x5) [ $magic != 27051956 ] { echo Invalid image type. return 1 diff --git a/target/linux/ramips/dts/X5.dts b/target/linux/ramips/dts/X5.dts new file mode 100644 index 000..d9e9632 --- /dev/null +++ b/target/linux/ramips/dts/X5.dts @@ -0,0 +1,133 @@ +/dts-v1/; + +/include/ rt5350.dtsi + +/ { + compatible = X5, ralink,rt5350-soc; + model = Poray X5; + + palmbus@1000 { + sysc@0 { + ralink,pinmux = i2c, spi, uartlite, mdio, sdram, rgmii; + ralink,gpiomux = jtag; + ralink,uartmux = gpio; + ralink,wdtmux = 1; + }; + + gpio0: gpio@600 { + status = okay; + }; + + spi@b00 { + status = okay; + m25p80@0 { + #address-cells = 1; + #size-cells = 1; + compatible = gd25q64; + reg = 0 0; + linux,modalias = m25p80, gd25q64; + spi-max-frequency = 1000; + + partition@0 { + label = u-boot; + reg = 0x0 0x3; + read-only; + }; + + partition@3 { + label = u-boot-env; + reg = 0x3 0x1; + read-only
[OpenWrt-Devel] [PATCH v2 1/6] ramips: add basics for Poray devices
This commit adds the basic elements to support Poray brand routers. It contains a tool to do the encryption/obfuscation that is used in Poray routers. Support for Poray devices was worked on by: Felix Kaechele hef...@fedoraproject.org Luis Soltero lsolt...@globalmarinenet.com Michel Stempin michel.stem...@wanadoo.fr Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- target/linux/ramips/image/Makefile | 36 ++ target/linux/ramips/rt305x/profiles/poray.mk | 7 + tools/firmware-utils/Makefile| 1 + tools/firmware-utils/src/mkporayfw.c | 757 +++ 4 files changed, 801 insertions(+) create mode 100644 target/linux/ramips/rt305x/profiles/poray.mk create mode 100644 tools/firmware-utils/src/mkporayfw.c diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index 04d68fe..847eed4 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -215,6 +215,42 @@ define BuildFirmware/dap1350/squashfs endef BuildFirmware/dap1350/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3)) +# Sign Poray images +define BuildFirmware/Poray4M/squashfs + $(call BuildFirmware/Default4M/$(1),$(1),$(2),$(3)) + if [ -e $(call sysupname,$(1),$(2)) ]; then \ + mkporayfw -B $(3) -F 4M \ + -f $(call sysupname,$(1),$(2)) \ + -o $(call imgname,$(1),$(2))-factory.bin; \ + fi +endef +BuildFirmware/Poray4M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3)) + +define BuildFirmware/Poray8M/squashfs + $(call BuildFirmware/Default8M/$(1),$(1),$(2),$(3)) + if [ -e $(call sysupname,$(1),$(2)) ]; then \ + mkporayfw -B $(3) -F 8M \ + -f $(call sysupname,$(1),$(2)) \ + -o $(call imgname,$(1),$(2))-factory.bin; \ + fi +endef +BuildFirmware/Poray8M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3)) + +define BuildFirmware/PorayDualSize/squashfs + $(call BuildFirmware/DefaultDualSize/$(1),$(1),$(2),$(3)) + if [ -e $(call sysupname,$(1),$(2)-4M) ]; then \ + mkporayfw -B $(3) -F 4M \ + -f $(call sysupname,$(1),$(2)-4M) \ + -o $(call imgname,$(1),$(2))-4M-factory.bin; \ + fi + if [ -e $(call sysupname,$(1),$(2)-8M) ]; then \ + mkporayfw -B $(3) -F 8M \ + -f $(call sysupname,$(1),$(2)-8M) \ + -o $(call imgname,$(1),$(2))-8M-factory.bin; \ + fi +endef +BuildFirmware/PorayDualSize/initramfs=$(call BuildFirmware/DefaultDualSize/initramfs,$(1),$(2),$(3)) + # # RT288X Profiles # diff --git a/target/linux/ramips/rt305x/profiles/poray.mk b/target/linux/ramips/rt305x/profiles/poray.mk new file mode 100644 index 000..2122ca1 --- /dev/null +++ b/target/linux/ramips/rt305x/profiles/poray.mk @@ -0,0 +1,7 @@ +# +# Copyright (C) 2013 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index 70edd48..c0d577e 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -63,6 +63,7 @@ define Host/Compile $(call cc,seama md5) $(call cc,fix-u-media-header cyg_crc32,-Wall) $(call cc,hcsmakeimage bcmalgo) + $(call cc,mkporayfw, -Wall) endef define Host/Install diff --git a/tools/firmware-utils/src/mkporayfw.c b/tools/firmware-utils/src/mkporayfw.c new file mode 100644 index 000..80e48c0 --- /dev/null +++ b/tools/firmware-utils/src/mkporayfw.c @@ -0,0 +1,757 @@ +/* + * Builder/viewer/extractor utility for Poray firmware image files + * + * Copyright (C) 2013 Michel Stempin michel.stem...@wanadoo.fr + * Copyright (C) 2013 Felix Kaechele fe...@fetzig.org + * Copyright (C) 2013 ad...@openschemes.com + * + * This tool is based on: + * TP-Link firmware upgrade tool. + * Copyright (C) 2009 Gabor Juhos juh...@openwrt.org + * + * Itself based on: + * TP-Link WR941 V2 firmware checksum fixing tool. + * Copyright (C) 2008,2009 Wang Jian l...@linux.net.cn + * + * 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 stdio.h +#include stdlib.h +#include stdint.h +#include string.h +#include unistd.h +#include libgen.h +#include getopt.h +#include stdarg.h +#include errno.h +#include sys/stat.h +#include arpa/inet.h +#include netinet/in.h + +#if (__BYTE_ORDER == __BIG_ENDIAN) +# define HOST_TO_BE32(x) (x) +# define BE32_TO_HOST(x) (x) +# define HOST_TO_LE32(x) bswap_32(x) +# define LE32_TO_HOST(x) bswap_32(x) +#else +# define HOST_TO_BE32(x) bswap_32(x) +# define BE32_TO_HOST(x) bswap_32(x) +# define HOST_TO_LE32(x
[OpenWrt-Devel] [PATCH] [package] mac80211: rt2x00: add missing of.h header
Signed-off-by: Felix Kaechele hef...@fedoraproject.org --- .../patches/619-rt2x00-change-led-polarity-from-OF.patch | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/package/kernel/mac80211/patches/619-rt2x00-change-led-polarity-from-OF.patch b/package/kernel/mac80211/patches/619-rt2x00-change-led-polarity-from-OF.patch index f4c86fd..bf0572e 100644 --- a/package/kernel/mac80211/patches/619-rt2x00-change-led-polarity-from-OF.patch +++ b/package/kernel/mac80211/patches/619-rt2x00-change-led-polarity-from-OF.patch @@ -1,6 +1,14 @@ --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -5965,6 +5965,13 @@ static int rt2800_init_eeprom(struct rt2 +@@ -39,6 +39,7 @@ + #include linux/module.h + #include linux/slab.h + #include linux/clk.h ++#include linux/of.h + + #include rt2x00.h + #include rt2800lib.h +@@ -5966,6 +5967,13 @@ static int rt2800_init_eeprom(struct rt2 rt2800_init_led(rt2x00dev, rt2x00dev-led_assoc, LED_TYPE_ASSOC); rt2800_init_led(rt2x00dev, rt2x00dev-led_qual, LED_TYPE_QUALITY); -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 0/6] rampis: Add support for various Poray devices
This patchset adds support for various Poray router models. Furthermore it adds the firmware obfuscation tool needed to produce factory images that can be installed from the stock webinterface. The obfuscation method is also used by other OEMs and most likely originated from a company called Shenzhen Bococom Technology Co., Ltd. This patchset has been created by the following persons: * Felix Kaechele hef...@fedoraproject.org * Luis Soltero lsolt...@globalmarinenet.com * Michel Stempin michel.stem...@wanadoo.fr The patches have been tested on actual hardware. Felix Kaechele (6): ramips: add basics for Poray devices ramips: add Poray M3 support ramips: add Poray M4 4M/8M support ramips: add Poray X5/X6 Support ramips: add Poray X8 support ramips: add Poray IP2202 support target/linux/ramips/base-files/etc/diag.sh | 15 + .../ramips/base-files/etc/uci-defaults/02_network | 9 + .../ramips/base-files/lib/preinit/06_set_iface_mac | 9 + target/linux/ramips/base-files/lib/ramips.sh | 15 + .../ramips/base-files/lib/upgrade/platform.sh | 7 +- target/linux/ramips/dts/IP2202.dts | 97 +++ target/linux/ramips/dts/M3.dts | 106 +++ target/linux/ramips/dts/M4-4M.dts | 99 +++ target/linux/ramips/dts/M4-8M.dts | 99 +++ target/linux/ramips/dts/X5.dts | 133 target/linux/ramips/dts/X8.dts | 100 +++ target/linux/ramips/image/Makefile | 51 ++ target/linux/ramips/rt305x/profiles/poray.mk | 59 ++ tools/firmware-utils/Makefile | 1 + tools/firmware-utils/src/mkporayfw.c | 764 + 15 files changed, 1563 insertions(+), 1 deletion(-) create mode 100644 target/linux/ramips/dts/IP2202.dts create mode 100644 target/linux/ramips/dts/M3.dts create mode 100644 target/linux/ramips/dts/M4-4M.dts create mode 100644 target/linux/ramips/dts/M4-8M.dts create mode 100644 target/linux/ramips/dts/X5.dts create mode 100644 target/linux/ramips/dts/X8.dts create mode 100644 target/linux/ramips/rt305x/profiles/poray.mk create mode 100644 tools/firmware-utils/src/mkporayfw.c -- 1.8.3.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 1/6] ramips: add basics for Poray devices
This commit adds the basic elements to support Poray brand routers. It contains a tool to do the encryption/obfuscation that is used in Poray routers. Signed-off-by: Felix Kaechele hef...@fedoraproject.org Signed-off-by: Luis Soltero lsolt...@globalmarinenet.com Signed-off-by: Michel Stempin michel.stem...@wanadoo.fr --- target/linux/ramips/image/Makefile | 36 ++ target/linux/ramips/rt305x/profiles/poray.mk | 7 + tools/firmware-utils/Makefile| 1 + tools/firmware-utils/src/mkporayfw.c | 764 +++ 4 files changed, 808 insertions(+) create mode 100644 target/linux/ramips/rt305x/profiles/poray.mk create mode 100644 tools/firmware-utils/src/mkporayfw.c diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index 04d68fe..847eed4 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -215,6 +215,42 @@ define BuildFirmware/dap1350/squashfs endef BuildFirmware/dap1350/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3)) +# Sign Poray images +define BuildFirmware/Poray4M/squashfs + $(call BuildFirmware/Default4M/$(1),$(1),$(2),$(3)) + if [ -e $(call sysupname,$(1),$(2)) ]; then \ + mkporayfw -B $(3) -F 4M \ + -f $(call sysupname,$(1),$(2)) \ + -o $(call imgname,$(1),$(2))-factory.bin; \ + fi +endef +BuildFirmware/Poray4M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3)) + +define BuildFirmware/Poray8M/squashfs + $(call BuildFirmware/Default8M/$(1),$(1),$(2),$(3)) + if [ -e $(call sysupname,$(1),$(2)) ]; then \ + mkporayfw -B $(3) -F 8M \ + -f $(call sysupname,$(1),$(2)) \ + -o $(call imgname,$(1),$(2))-factory.bin; \ + fi +endef +BuildFirmware/Poray8M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3)) + +define BuildFirmware/PorayDualSize/squashfs + $(call BuildFirmware/DefaultDualSize/$(1),$(1),$(2),$(3)) + if [ -e $(call sysupname,$(1),$(2)-4M) ]; then \ + mkporayfw -B $(3) -F 4M \ + -f $(call sysupname,$(1),$(2)-4M) \ + -o $(call imgname,$(1),$(2))-4M-factory.bin; \ + fi + if [ -e $(call sysupname,$(1),$(2)-8M) ]; then \ + mkporayfw -B $(3) -F 8M \ + -f $(call sysupname,$(1),$(2)-8M) \ + -o $(call imgname,$(1),$(2))-8M-factory.bin; \ + fi +endef +BuildFirmware/PorayDualSize/initramfs=$(call BuildFirmware/DefaultDualSize/initramfs,$(1),$(2),$(3)) + # # RT288X Profiles # diff --git a/target/linux/ramips/rt305x/profiles/poray.mk b/target/linux/ramips/rt305x/profiles/poray.mk new file mode 100644 index 000..2122ca1 --- /dev/null +++ b/target/linux/ramips/rt305x/profiles/poray.mk @@ -0,0 +1,7 @@ +# +# Copyright (C) 2013 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index 70edd48..c0d577e 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -63,6 +63,7 @@ define Host/Compile $(call cc,seama md5) $(call cc,fix-u-media-header cyg_crc32,-Wall) $(call cc,hcsmakeimage bcmalgo) + $(call cc,mkporayfw, -Wall) endef define Host/Install diff --git a/tools/firmware-utils/src/mkporayfw.c b/tools/firmware-utils/src/mkporayfw.c new file mode 100644 index 000..5af6871 --- /dev/null +++ b/tools/firmware-utils/src/mkporayfw.c @@ -0,0 +1,764 @@ +/* + * Builder/viewer/extractor utility for Poray firmware image files + * + * Copyright (C) 2013 Michel Stempin michel.stem...@wanadoo.fr + * Copyright (C) 2013 Felix Kaechele fe...@fetzig.org + * Copyright (C) 2103 ad...@openschemes.com + * + * This tool is based on: + * TP-Link firmware upgrade tool. + * Copyright (C) 2009 Gabor Juhos juh...@openwrt.org + * + * Itself based on: + * TP-Link WR941 V2 firmware checksum fixing tool. + * Copyright (C) 2008,2009 Wang Jian l...@linux.net.cn + * + * 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 stdio.h +#include stdlib.h +#include stdint.h +#include string.h +#include unistd.h +#include libgen.h +#include getopt.h +#include stdarg.h +#include errno.h +#include sys/stat.h +#include arpa/inet.h +#include netinet/in.h + +#if (__BYTE_ORDER == __BIG_ENDIAN) +# define HOST_TO_BE32(x) (x) +# define BE32_TO_HOST(x) (x) +# define HOST_TO_LE32(x) bswap_32(x) +# define LE32_TO_HOST(x) bswap_32(x) +#else +# define HOST_TO_BE32(x) bswap_32(x) +# define BE32_TO_HOST(x) bswap_32(x) +# define HOST_TO_LE32(x) (x) +# define LE32_TO_HOST(x) (x) +#endif
[OpenWrt-Devel] [PATCH 4/6] ramips: add Poray X5/X6 Support
Signed-off-by: Felix Kaechele hef...@fedoraproject.org Signed-off-by: Luis Soltero lsolt...@globalmarinenet.com Signed-off-by: Michel Stempin michel.stem...@wanadoo.fr --- target/linux/ramips/base-files/etc/diag.sh | 3 + .../ramips/base-files/etc/uci-defaults/02_network | 3 +- .../ramips/base-files/lib/preinit/06_set_iface_mac | 3 +- target/linux/ramips/base-files/lib/ramips.sh | 3 + .../ramips/base-files/lib/upgrade/platform.sh | 3 +- target/linux/ramips/dts/X5.dts | 133 + target/linux/ramips/image/Makefile | 3 + target/linux/ramips/rt305x/profiles/poray.mk | 10 ++ 8 files changed, 158 insertions(+), 3 deletions(-) create mode 100644 target/linux/ramips/dts/X5.dts diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index 57c8beb..d04d990 100755 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -138,6 +138,9 @@ get_status_led() { ur-336un) status_led=ur336:green:wps ;; + x5) + status_led=x5:green:power + ;; xdxrn502j) status_led=xdxrn502j:green:power ;; diff --git a/target/linux/ramips/base-files/etc/uci-defaults/02_network b/target/linux/ramips/base-files/etc/uci-defaults/02_network index 133c2de..fa5b28e 100755 --- a/target/linux/ramips/base-files/etc/uci-defaults/02_network +++ b/target/linux/ramips/base-files/etc/uci-defaults/02_network @@ -227,7 +227,8 @@ ramips_setup_macs() ;; m3 |\ - m4) + m4 |\ + x5) lan_mac=$(mtd_get_mac_binary factory 4) lan_mac=$(macaddr_add $lan_mac -1) ;; diff --git a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac index f9aabd5..3073233 100644 --- a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac +++ b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac @@ -76,7 +76,8 @@ preinit_set_mac_address() { ifconfig eth0 hw ether $mac 2/dev/null ;; m3 |\ - m4) + m4 |\ + x5) mac=$(mtd_get_mac_binary factory 4) mac=$(macaddr_add $mac -1) ifconfig eth0 hw ether $mac 2/dev/null diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index e3776f1..1bf93e3 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -154,6 +154,9 @@ ramips_board_detect() { *Poray M4) name=m4 ;; + *Poray X5) + name=x5 + ;; *PWH2004) name=pwh2004 ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index 5e1a7a5..4b80afa 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -75,7 +75,8 @@ platform_check_image() { whr-g300n |\ ur-326n4g |\ ur-336un |\ - wr512-3gn) + wr512-3gn |\ + x5) [ $magic != 27051956 ] { echo Invalid image type. return 1 diff --git a/target/linux/ramips/dts/X5.dts b/target/linux/ramips/dts/X5.dts new file mode 100644 index 000..ca29aa9 --- /dev/null +++ b/target/linux/ramips/dts/X5.dts @@ -0,0 +1,133 @@ +/dts-v1/; + +/include/ rt5350.dtsi + +/ { + compatible = X5, ralink,rt5350-soc; + model = Poray X5; + + palmbus@1000 { + sysc@0 { + ralink,pinmux = i2c, spi, uartlite, mdio, sdram, rgmii; + ralink,gpiomux = jtag; + ralink,uartmux = gpio; + ralink,wdtmux = 1; + }; + + gpio0: gpio@600 { + status = okay; + }; + + spi@b00 { + status = okay; + m25p80@0 { + #address-cells = 1; + #size-cells = 1; + compatible = gd25q64; + reg = 0 0; + linux,modalias = m25p80, gd25q64; + spi-max-frequency = 1000; + + partition@0 { + label = u-boot; + reg = 0x0 0x3; + read-only; + }; + + partition@3 { + label = u-boot-env; + reg = 0x3 0x1; + read-only; + }; + + factory: partition@4
[OpenWrt-Devel] [PATCH 2/6] ramips: add Poray M3 support
Signed-off-by: Felix Kaechele hef...@fedoraproject.org Signed-off-by: Luis Soltero lsolt...@globalmarinenet.com Signed-off-by: Michel Stempin michel.stem...@wanadoo.fr --- target/linux/ramips/base-files/etc/diag.sh | 3 + .../ramips/base-files/etc/uci-defaults/02_network | 5 + .../ramips/base-files/lib/preinit/06_set_iface_mac | 5 + target/linux/ramips/base-files/lib/ramips.sh | 3 + .../ramips/base-files/lib/upgrade/platform.sh | 1 + target/linux/ramips/dts/M3.dts | 106 + target/linux/ramips/image/Makefile | 3 + target/linux/ramips/rt305x/profiles/poray.mk | 10 ++ 8 files changed, 136 insertions(+) create mode 100644 target/linux/ramips/dts/M3.dts diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index f8e9787..a68538b 100755 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -52,6 +52,9 @@ get_status_led() { hw550-3g) status_led=hw550-3g:green:status ;; + m3) + status_led=m3:blue:status + ;; mofi3500-3gn) status_led=mofi3500-3gn:green:status ;; diff --git a/target/linux/ramips/base-files/etc/uci-defaults/02_network b/target/linux/ramips/base-files/etc/uci-defaults/02_network index 6877588..307330b 100755 --- a/target/linux/ramips/base-files/etc/uci-defaults/02_network +++ b/target/linux/ramips/base-files/etc/uci-defaults/02_network @@ -226,6 +226,11 @@ ramips_setup_macs() wan_mac=$(macaddr_add $lan_mac 1) ;; + m3) + lan_mac=$(mtd_get_mac_binary factory 4) + lan_mac=$(macaddr_add $lan_mac -1) + ;; + nbg-419n | \ wcr-150gn) lan_mac=$(mtd_get_mac_binary factory 4) diff --git a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac index aacec25..86c19b0 100644 --- a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac +++ b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac @@ -75,6 +75,11 @@ preinit_set_mac_address() { mac=$(mtd_get_mac_binary factory 40) ifconfig eth0 hw ether $mac 2/dev/null ;; + m3) + mac=$(mtd_get_mac_binary factory 4) + mac=$(macaddr_add $mac -1) + ifconfig eth0 hw ether $mac 2/dev/null + ;; wl341v3) mac=$(mtd_get_mac_binary board-nvram 65440) ifconfig eth0 hw ether $mac 2/dev/null diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index b1ecc8d..7afa707 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -148,6 +148,9 @@ ramips_board_detect() { *Planex MZK-W300NH2*) name=mzk-w300nh2 ;; + *Poray M3) + name=m3 + ;; *PWH2004) name=pwh2004 ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index 1d867a7..4ac86e9 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -44,6 +44,7 @@ platform_check_image() { freestation5 | \ hw550-3g | \ hg255d | \ + m3 | \ mofi3500-3gn | \ mpr-a1 | \ mpr-a2 | \ diff --git a/target/linux/ramips/dts/M3.dts b/target/linux/ramips/dts/M3.dts new file mode 100644 index 000..d8ccce7 --- /dev/null +++ b/target/linux/ramips/dts/M3.dts @@ -0,0 +1,106 @@ +/dts-v1/; + +/include/ rt5350.dtsi + +/ { + compatible = M3, ralink,rt5350-soc; + model = Poray M3; + + palmbus@1000 { + sysc@0 { + ralink,pinmux = i2c, spi, uartlite, mdio, sdram, rgmii; + ralink,gpiomux = jtag; + ralink,uartmux = gpio; + ralink,wdtmux = 1; + }; + + gpio0: gpio@600 { + status = okay; + }; + + spi@b00 { + status = okay; + m25p80@0 { + #address-cells = 1; + #size-cells = 1; + compatible = w25q32; + reg = 0 0; + linux,modalias = m25p80, w25q32; + spi-max-frequency = 1000; + + partition@0 { + label = u-boot; + reg = 0x0 0x3; + read-only; + }; + + partition@3
[OpenWrt-Devel] [PATCH 3/6] ramips: add Poray M4 4M/8M support
Signed-off-by: Felix Kaechele hef...@fedoraproject.org Signed-off-by: Luis Soltero lsolt...@globalmarinenet.com Signed-off-by: Michel Stempin michel.stem...@wanadoo.fr --- target/linux/ramips/base-files/etc/diag.sh | 3 + .../ramips/base-files/etc/uci-defaults/02_network | 3 +- .../ramips/base-files/lib/preinit/06_set_iface_mac | 3 +- target/linux/ramips/base-files/lib/ramips.sh | 3 + .../ramips/base-files/lib/upgrade/platform.sh | 1 + target/linux/ramips/dts/M4-4M.dts | 99 ++ target/linux/ramips/dts/M4-8M.dts | 99 ++ target/linux/ramips/image/Makefile | 3 + target/linux/ramips/rt305x/profiles/poray.mk | 10 +++ 9 files changed, 222 insertions(+), 2 deletions(-) create mode 100644 target/linux/ramips/dts/M4-4M.dts create mode 100644 target/linux/ramips/dts/M4-8M.dts diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index a68538b..57c8beb 100755 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -55,6 +55,9 @@ get_status_led() { m3) status_led=m3:blue:status ;; + m4) + status_led=m4:blue:status + ;; mofi3500-3gn) status_led=mofi3500-3gn:green:status ;; diff --git a/target/linux/ramips/base-files/etc/uci-defaults/02_network b/target/linux/ramips/base-files/etc/uci-defaults/02_network index 307330b..133c2de 100755 --- a/target/linux/ramips/base-files/etc/uci-defaults/02_network +++ b/target/linux/ramips/base-files/etc/uci-defaults/02_network @@ -226,7 +226,8 @@ ramips_setup_macs() wan_mac=$(macaddr_add $lan_mac 1) ;; - m3) + m3 |\ + m4) lan_mac=$(mtd_get_mac_binary factory 4) lan_mac=$(macaddr_add $lan_mac -1) ;; diff --git a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac index 86c19b0..f9aabd5 100644 --- a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac +++ b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac @@ -75,7 +75,8 @@ preinit_set_mac_address() { mac=$(mtd_get_mac_binary factory 40) ifconfig eth0 hw ether $mac 2/dev/null ;; - m3) + m3 |\ + m4) mac=$(mtd_get_mac_binary factory 4) mac=$(macaddr_add $mac -1) ifconfig eth0 hw ether $mac 2/dev/null diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index 7afa707..e3776f1 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -151,6 +151,9 @@ ramips_board_detect() { *Poray M3) name=m3 ;; + *Poray M4) + name=m4 + ;; *PWH2004) name=pwh2004 ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index 4ac86e9..5e1a7a5 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -45,6 +45,7 @@ platform_check_image() { hw550-3g | \ hg255d | \ m3 | \ + m4 | \ mofi3500-3gn | \ mpr-a1 | \ mpr-a2 | \ diff --git a/target/linux/ramips/dts/M4-4M.dts b/target/linux/ramips/dts/M4-4M.dts new file mode 100644 index 000..ef77332 --- /dev/null +++ b/target/linux/ramips/dts/M4-4M.dts @@ -0,0 +1,99 @@ +/dts-v1/; + +/include/ rt5350.dtsi + +/ { + compatible = M4, ralink,rt5350-soc; + model = Poray M4; + + palmbus@1000 { + sysc@0 { + ralink,pinmux = i2c, spi, uartlite, jtag, mdio, sdram, rgmii; + ralink,uartmux = gpio; + ralink,wdtmux = 1; + }; + + gpio0: gpio@600 { + status = okay; + }; + + spi@b00 { + status = okay; + m25p80@0 { + #address-cells = 1; + #size-cells = 1; + compatible = pm25lq032; + reg = 0 0; + linux,modalias = m25p80, pm25lq032; + spi-max-frequency = 1000; + + partition@0 { + label = u-boot; + reg = 0x0 0x3; + read-only; + }; + + partition@3 { + label = u-boot-env; + reg = 0x3 0x1; + read-only
[OpenWrt-Devel] [PATCH 5/6] ramips: add Poray X8 support
Signed-off-by: Felix Kaechele hef...@fedoraproject.org Signed-off-by: Luis Soltero lsolt...@globalmarinenet.com Signed-off-by: Michel Stempin michel.stem...@wanadoo.fr --- target/linux/ramips/base-files/etc/diag.sh | 3 + .../ramips/base-files/etc/uci-defaults/02_network | 3 +- .../ramips/base-files/lib/preinit/06_set_iface_mac | 3 +- target/linux/ramips/base-files/lib/ramips.sh | 3 + .../ramips/base-files/lib/upgrade/platform.sh | 3 +- target/linux/ramips/dts/X8.dts | 100 + target/linux/ramips/image/Makefile | 3 + target/linux/ramips/rt305x/profiles/poray.mk | 10 +++ 8 files changed, 125 insertions(+), 3 deletions(-) create mode 100644 target/linux/ramips/dts/X8.dts diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index d04d990..689fee7 100755 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -141,6 +141,9 @@ get_status_led() { x5) status_led=x5:green:power ;; + x8) + status_led=x8:green:power + ;; xdxrn502j) status_led=xdxrn502j:green:power ;; diff --git a/target/linux/ramips/base-files/etc/uci-defaults/02_network b/target/linux/ramips/base-files/etc/uci-defaults/02_network index fa5b28e..2df7b08 100755 --- a/target/linux/ramips/base-files/etc/uci-defaults/02_network +++ b/target/linux/ramips/base-files/etc/uci-defaults/02_network @@ -228,7 +228,8 @@ ramips_setup_macs() m3 |\ m4 |\ - x5) + x5 |\ + x8) lan_mac=$(mtd_get_mac_binary factory 4) lan_mac=$(macaddr_add $lan_mac -1) ;; diff --git a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac index 3073233..6712154 100644 --- a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac +++ b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac @@ -77,7 +77,8 @@ preinit_set_mac_address() { ;; m3 |\ m4 |\ - x5) + x5 |\ + x8) mac=$(mtd_get_mac_binary factory 4) mac=$(macaddr_add $mac -1) ifconfig eth0 hw ether $mac 2/dev/null diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index 1bf93e3..6960c6d 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -157,6 +157,9 @@ ramips_board_detect() { *Poray X5) name=x5 ;; + *Poray X8) + name=x8 + ;; *PWH2004) name=pwh2004 ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index 4b80afa..df3b324 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -76,7 +76,8 @@ platform_check_image() { ur-326n4g |\ ur-336un |\ wr512-3gn |\ - x5) + x5 |\ + x8) [ $magic != 27051956 ] { echo Invalid image type. return 1 diff --git a/target/linux/ramips/dts/X8.dts b/target/linux/ramips/dts/X8.dts new file mode 100644 index 000..3cb120b --- /dev/null +++ b/target/linux/ramips/dts/X8.dts @@ -0,0 +1,100 @@ +/dts-v1/; + +/include/ rt5350.dtsi + +/ { + compatible = X8, ralink,rt5350-soc; + model = Poray X8; + + palmbus@1000 { + sysc@0 { + ralink,pinmux = i2c, spi, uartlite, mdio, sdram, rgmii; + ralink,gpiomux = jtag; + ralink,uartmux = gpio; + ralink,wdtmux = 1; + }; + + gpio0: gpio@600 { + status = okay; + }; + + spi@b00 { + status = okay; + m25p80@0 { + #address-cells = 1; + #size-cells = 1; + compatible = gd25q64; + reg = 0 0; + linux,modalias = m25p80, gd25q64; + spi-max-frequency = 1000; + + partition@0 { + label = u-boot; + reg = 0x0 0x3; + read-only; + }; + + partition@3 { + label = u-boot-env; + reg = 0x3 0x1; + read-only; + }; + + factory: partition@4 { + label = factory; + reg = 0x4
[OpenWrt-Devel] [PATCH 6/6] ramips: add Poray IP2202 support
Signed-off-by: Felix Kaechele hef...@fedoraproject.org Signed-off-by: Luis Soltero lsolt...@globalmarinenet.com Signed-off-by: Michel Stempin michel.stem...@wanadoo.fr --- target/linux/ramips/base-files/etc/diag.sh | 3 + .../ramips/base-files/etc/uci-defaults/02_network | 1 + .../ramips/base-files/lib/preinit/06_set_iface_mac | 1 + target/linux/ramips/base-files/lib/ramips.sh | 3 + .../ramips/base-files/lib/upgrade/platform.sh | 1 + target/linux/ramips/dts/IP2202.dts | 97 ++ target/linux/ramips/image/Makefile | 3 + target/linux/ramips/rt305x/profiles/poray.mk | 12 +++ 8 files changed, 121 insertions(+) create mode 100644 target/linux/ramips/dts/IP2202.dts diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index 689fee7..6ecb133 100755 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -45,6 +45,9 @@ get_status_led() { fonera20n) status_led=fonera20n:green:power ;; + ip2202) + status_led=ip2202:green:run + ;; rt-n13u) status_led=rt-n13u:power ;; diff --git a/target/linux/ramips/base-files/etc/uci-defaults/02_network b/target/linux/ramips/base-files/etc/uci-defaults/02_network index 2df7b08..ef13e36 100755 --- a/target/linux/ramips/base-files/etc/uci-defaults/02_network +++ b/target/linux/ramips/base-files/etc/uci-defaults/02_network @@ -173,6 +173,7 @@ ramips_setup_macs() broadway | \ dir-620-d1 | \ f5d8235-v1 | \ + ip2202 | \ mpr-a1 | \ mpr-a2 | \ mzk-w300nh2 | \ diff --git a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac index 6712154..a0d9b61 100644 --- a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac +++ b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac @@ -60,6 +60,7 @@ preinit_set_mac_address() { carambola |\ dir-615-h1 |\ fonera20n |\ + ip2202 |\ rt-n13u |\ hw550-3g |\ nbg-419n |\ diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index 6960c6d..858a809 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -148,6 +148,9 @@ ramips_board_detect() { *Planex MZK-W300NH2*) name=mzk-w300nh2 ;; + *Poray IP2202) + name=ip2202 + ;; *Poray M3) name=m3 ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index df3b324..e85bead 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -44,6 +44,7 @@ platform_check_image() { freestation5 | \ hw550-3g | \ hg255d | \ + ip2202 | \ m3 | \ m4 | \ mofi3500-3gn | \ diff --git a/target/linux/ramips/dts/IP2202.dts b/target/linux/ramips/dts/IP2202.dts new file mode 100644 index 000..ea9f170 --- /dev/null +++ b/target/linux/ramips/dts/IP2202.dts @@ -0,0 +1,97 @@ +/dts-v1/; + +/include/ rt3050.dtsi + +/ { + compatible = IP2202, ralink,rt3052-soc; + model = Poray IP2202; + + palmbus@1000 { + sysc@0 { + ralink,pinmux = i2c, spi, uartlite, jtag, sdram, rgmii; + ralink,gpiomux = mdio; + ralink,uartmux = gpio; + ralink,wdtmux = 1; + }; + + gpio0: gpio@600 { + status = okay; + }; + + }; + + cfi@1f00 { + compatible = cfi-flash; + reg = 0x1f00 0x80; + + bank-width = 2; + device-width = 2; + #address-cells = 1; + #size-cells = 1; + + partition@0 { + label = u-boot; + reg = 0x0 0x3; + read-only; + }; + + partition@3 { + label = u-boot-env; + reg = 0x3 0x1; + read-only; + }; + + factory: partition@4 { + label = factory; + reg = 0x4 0x1; + read-only; + }; + + partition@5 { + label = firmware; + reg = 0x5 0x7b; + }; + }; + + ethernet@1010 { + status = okay; + }; + + esw@1011 { + status = okay
Re: [OpenWrt-Devel] [OpenWrt-Devel, rt305x] Changes to control led polarity on rt5350-based boards, control led blink frequency, transmit bad/good counter and broadcast storm protection to rt305x swit
Interesting patches! Would you mind porting these to the 3.8 kernel and enabling setting the LED Polarity from Device Tree Source (dts) files? - Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] target profile for Dlink DIR-615 H1
Daniel Petre wrote: any hints please? thanks! Create a profile for it in target/linux/ramips/rt305x/profiles Then remove tmp and rerun make menuconfig - Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] rt2x00: add rt5350 wlan support
Michel Stempin wrote: Still no news from Mediatek? I asked for help on the rt2x00 mailing list and received a reply from Peter Stuge who suggested we might be able to clarify this situation with the help of D-Link. Working on this with him at the moment. I'll report back when there's any news on that. We could then submit this patch for inclusion in the upstream rt2x00 driver as well. Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] rt2x00: add rt5350 wlan support
Am 06.01.2013 11:33, schrieb John Crispin: Although I'm not a lawyer, but in my understanding, this does not allows to use that code as a basis for GPL licensed driver. -Gabor 1. https://forum.openwrt.org/viewtopic.php?pid=186188#p186188 i have sent an email to MTK to ask ;) John Any news on this from MediaTek? Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel