Re: [OpenWrt-Devel] [PATCH 1/2] added board support for compex wpj558

2015-02-02 Thread Christian Mehlis

Am 30.01.2015 um 18:48 schrieb Christian Mehlis:


diff --git a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
index f7b8381..ecaa126 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -687,10 +687,13 @@ Image/Build/MyLoader/initramfs=$(call 
PatchKernel/initramfs,$(2),$(3))
  define Image/Build/MyLoader
$(eval fwsize=$(shell echo $$(($(4)-0x3-4*64*1024
$(eval fwimage=$(KDIR_TMP)/$(2)-$(5)-firmware.bin)
-   $(call 
CatFiles,$(KDIR_TMP)/vmlinux-$(2).bin.lzma,65536,$(KDIR)/root.$(1),$(fwsize),$(fwimage))
+   $(call 
CatFiles,$(KDIR_TMP)/vmlinux-$(2).uImage,65536,$(KDIR)/root.$(1),$(fwsize),$(fwimage))
if [ -e $(fwimage) ]; then \
$(STAGING_DIR_HOST)/bin/mkmylofw -B $(2) -s $(4) -v \
-   -p0x0003:0:al:0x8006:firmware:$(fwimage) \
+   
-p0x68:0x16:al:0x8006:firmware:$(KDIR_TMP)/vmlinux-$(2).uImage \
+   -p0x05:0x63:::rootfs:$(KDIR)/root.$(1) \
+   -p0x7e:0x01 \
+   -p0x7f:0x01 \
$(call imgname,$(1),$(2))-$(5)-factory.img; \
echo -n   $(KDIR_TMP)/empty.bin; \
sh $(TOPDIR)/scripts/combined-image.sh \


I think this breaks the other compex boards. This code is more a proof 
of concept for the wpj558.


I don't recommend to merge that now, until I found a way to make 
sysupgrade work and not interfere with other boards.


How does linux detect the partitions in the old code where linux and the 
rootfs are combined in one partition?


Best
Christian
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/2] added board support for compex wpj558

2015-01-30 Thread Christian Mehlis
Signed-off-by: Christian Mehlis christ...@m3hlis.de
---
 target/linux/ar71xx/base-files/etc/diag.sh |   3 +
 .../ar71xx/base-files/etc/uci-defaults/02_network  |   7 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   2 +
 target/linux/ar71xx/config-3.14|   1 +
 .../ar71xx/files/arch/mips/ath79/mach-wpj558.c | 187 +
 target/linux/ar71xx/generic/profiles/compex.mk |  13 ++
 target/linux/ar71xx/image/Makefile |  11 +-
 .../507-MIPS-ath79-prom-add-myloader-support.patch |   5 +-
 .../610-MIPS-ath79-openwrt-machines.patch  |  25 ++-
 .../linux/generic/files/include/linux/myloader.h   |   1 +
 tools/firmware-utils/src/mkmylofw.c|   3 +
 tools/firmware-utils/src/myloader.h|   2 +
 13 files changed, 254 insertions(+), 9 deletions(-)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-wpj558.c

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index af6107b..af53afd 100755
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -288,6 +288,9 @@ get_status_led() {
wp543)
status_led=wp543:green:diag
;;
+   wpj558)
+   status_led=wpj558:green:sig3
+   ;;
wrt400n)
status_led=wrt400n:blue:wps
;;
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 a223ae8..1d186de 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -359,6 +359,13 @@ wpe72)
ucidef_set_interfaces_lan_wan eth1 eth0
;;
 
+wpj558)
+   ucidef_set_interfaces_lan_wan eth0.1 eth0.2
+   ucidef_add_switch switch0 1 1
+   ucidef_add_switch_vlan switch0 1 5 6t
+   ucidef_add_switch_vlan switch0 2 1 6t
+   ;;
+
 ap121 |\
 ap121-mini |\
 ap96 |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 02872de..4c6594f 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -747,6 +747,9 @@ ar71xx_board_detect() {
*WP543)
name=wp543
;;
+   *WPJ558)
+   name=wpj558
+   ;;
*WPE72)
name=wpe72
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index bc6866d..0db1625 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -408,6 +408,7 @@ platform_check_image() {
ja76pf | \
ja76pf2 | \
jwap003 | \
+   wpj558 | \
wp543 | \
wpe72)
[ $magic != 4349 ]  {
@@ -456,6 +457,7 @@ platform_do_upgrade() {
jwap003)
platform_do_upgrade_combined $ARGV
;;
+   wpj558|\
wp543|\
wpe72)
platform_do_upgrade_compex $ARGV
diff --git a/target/linux/ar71xx/config-3.14 b/target/linux/ar71xx/config-3.14
index 82b2d13..2d9873c 100644
--- a/target/linux/ar71xx/config-3.14
+++ b/target/linux/ar71xx/config-3.14
@@ -130,6 +130,7 @@ CONFIG_ATH79_MACH_WNR2000_V4=y
 CONFIG_ATH79_MACH_WNR2200=y
 CONFIG_ATH79_MACH_WP543=y
 CONFIG_ATH79_MACH_WPE72=y
+CONFIG_ATH79_MACH_WPJ558=y
 CONFIG_ATH79_MACH_WRT160NL=y
 CONFIG_ATH79_MACH_WRT400N=y
 CONFIG_ATH79_MACH_WZR_450HP2=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj558.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj558.c
new file mode 100644
index 000..a8310a7
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj558.c
@@ -0,0 +1,187 @@
+/*
+ * Compex WPJ558 board support
+ *
+ * Copyright (c) 2012 Qualcomm Atheros
+ * Copyright (c) 2012 Gabor Juhos juh...@openwrt.org
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+#include linux/pci.h
+#include linux/phy.h
+#include linux/gpio.h
+#include linux/platform_device.h
+#include