Re: [OpenWrt-Devel] [PATCH v3] Add Minibox v1.0 support

2015-08-21 Thread John Crispin
Hi,

Patch looks fine now, however the subject is missing the "ar71xx:" prefix

John

On 18/08/2015 21:44, Stijn Segers wrote:
> This patch adds Gainstrong Minibox v1.0 into trunk. I have addressed the
> following issues:
> - all caps prefix
> - added vendor
> 
> I have built images and asked for testing on the forums, the image has
> been confirmed working but the LED is off during normal operation (I assume
> this is the possible LED polarity issue Karl Palsson was talking about?)
> 
> Questions:
> 
> - Can I simply set gpio_led minibox_v1_leds_gpio to active.low = 1 or isn't
>   that how it works?
> - Should I give the 799 minibox kernel support patch a number that follows
>   the existing patches more closely (e.g. 750) or doesn't that matter?
> 
> Thanks
> 
> Signed-off by: Stijn Segers 
> 
> ---
>  target/linux/ar71xx/base-files/etc/diag.sh |  3 +
>  .../ar71xx/base-files/etc/uci-defaults/02_network  |  1 +
>  target/linux/ar71xx/base-files/lib/ar71xx.sh   |  6 ++
>  .../ar71xx/base-files/lib/upgrade/platform.sh  |  1 +
>  target/linux/ar71xx/config-4.1 |  1 +
>  .../ar71xx/files/arch/mips/ath79/mach-minibox-v1.c | 84 
> ++
>  target/linux/ar71xx/generic/profiles/minibox-v1.mk | 17 +
>  target/linux/ar71xx/image/Makefile |  9 +++
>  .../799-MIPS-ath79-add-minibox-v1-support.patch| 39 ++
>  9 files changed, 161 insertions(+)
>  create mode 100644 
> target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
>  create mode 100644 target/linux/ar71xx/generic/profiles/minibox-v1.mk
>  create mode 100644 
> target/linux/ar71xx/patches-4.1/799-MIPS-ath79-add-minibox-v1-support.patch
> 
> diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
> b/target/linux/ar71xx/base-files/etc/diag.sh
> index 36de775..342c68c 100644
> --- a/target/linux/ar71xx/base-files/etc/diag.sh
> +++ b/target/linux/ar71xx/base-files/etc/diag.sh
> @@ -219,6 +219,9 @@ get_status_led() {
>   smart-300)
>   status_led="nc-link:green:system"
>   ;;
> + minibox-v1)
> + status_led="minibox-v1:green:system"
> + ;;
>   oolite)
>   status_led="oolite:red:system"
>   ;;
> 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 686fce9..49f6b55 100644
> --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> @@ -425,6 +425,7 @@ dir-615-e4 |\
>  hiwifi-hc6361 |\
>  ja76pf |\
>  mc-mac1200r|\
> +minibox-v1 |\
>  mynet-n600 |\
>  oolite |\
>  qihoo-c301 |\
> diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
> b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> index e1f345e..4f9735f 100755
> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> @@ -119,6 +119,9 @@ tplink_board_detect() {
>   "3C0001"*)
>   model="OOLITE"
>   ;;
> + "3C0002"*)
> + model="Minibox_v1"
> + ;;
>   "070300"*)
>   model="TP-Link TL-WR703N"
>   ;;
> @@ -502,6 +505,9 @@ ar71xx_board_detect() {
>   *"MAC1200R")
>   name="mc-mac1200r"
>   ;;
> + *"Minibox v1.0")
> + name="minibox-v1"
> + ;;
>   *MR12)
>   name="mr12"
>   ;;
> diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
> b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> index c1962e4..0b7b84c 100755
> --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> @@ -314,6 +314,7 @@ platform_check_image() {
>   el-mini | \
>   gl-inet | \
>   mc-mac1200r | \
> + minibox-v1 |\
>   onion-omega | \
>   oolite | \
>   smart-300 | \
> diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
> index 21c4601..49f2ac1 100644
> --- a/target/linux/ar71xx/config-4.1
> +++ b/target/linux/ar71xx/config-4.1
> @@ -79,6 +79,7 @@ CONFIG_ATH79_MACH_HORNET_UB=y
>  CONFIG_ATH79_MACH_JA76PF=y
>  CONFIG_ATH79_MACH_JWAP003=y
>  CONFIG_ATH79_MACH_MC_MAC1200R=y
> +CONFIG_ATH79_MACH_MINIBOX_V1=y
>  CONFIG_ATH79_MACH_MR12=y
>  CONFIG_ATH79_MACH_MR16=y
>  CONFIG_ATH79_MACH_MR600=y
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c 
> b/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
> new file mode 100644
> index 000..7c26cab
> --- /dev/null
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-minibox-v1.c
> @@ -0,0 +1,84 @@
> +/*
> + *  Minibox v1.0 board support
> + *
> + *
> + *  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 
> +
> +#i

[OpenWrt-Devel] [netifd][PATCH] proto-shell: add hostname validation check for netifd dhcp script

2015-08-21 Thread tymon.huang
Signed-off-by: tymon.huang 
---
 package/network/config/netifd/files/lib/netifd/proto/dhcp.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh 
b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
index 0e88af9..bf91c29 100755
--- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
+++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
@@ -47,6 +47,7 @@ proto_dhcp_setup() {
[ -n "$mtu6rd" ] && proto_export "MTU6RD=$mtu6rd"
[ -n "$customroutes" ] && proto_export "CUSTOMROUTES=$customroutes"
[ "$delegate" = "0" ] && proto_export "IFACE6RD_DELEGATE=0"
+   [ -z "$hostname" ] && hostname="$(uci_get system @system[0] hostname 
OpenWrt)"
 
proto_export "INTERFACE=$config"
proto_run_command "$config" udhcpc \
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [netifd][PATCH v3] proto-shell: add hostname validation check for netifd dhcp script

2015-08-21 Thread tymon.huang
This patch can fix the issue that luci web shows '?' sign when WAN port work on 
DHCP-client mode without
setting hostname. After adding the hostname check, the udhcpc can work with 
'-H' parameter correctly and
send hostname to dhcp server.

Signed-off-by: tymon.huang 
---
 package/network/config/netifd/files/lib/netifd/proto/dhcp.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh 
b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
index 0e88af9..bf91c29 100755
--- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
+++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
@@ -47,6 +47,7 @@ proto_dhcp_setup() {
[ -n "$mtu6rd" ] && proto_export "MTU6RD=$mtu6rd"
[ -n "$customroutes" ] && proto_export "CUSTOMROUTES=$customroutes"
[ "$delegate" = "0" ] && proto_export "IFACE6RD_DELEGATE=0"
+   [ -z "$hostname" ] && hostname="$(uci_get system @system[0] hostname 
OpenWrt)"
 
proto_export "INTERFACE=$config"
proto_run_command "$config" udhcpc \
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2] ar71xx: Add UBNT airGateway Pro support

2015-08-21 Thread Matthew Reeve
This patch adds kernel and userspace support for the Ubiquiti Networks 
airGateway Pro.

v2: Modify file bases so that git apply will apply it.

Signed-off-by: Matthew Reeve 

--- /dev/null   2015-08-07 21:02:55.557188068 -0600
+++ 
b/target/linux/ar71xx/patches-4.1/610-MIPS-ath79-UBNT-add-airGateway-pro-support.patch
  2015-08-20 17:20:09.149209987 -0600
@@ -0,0 +1,62 @@ 
+--- a/arch/mips/ath79/mach-ubnt-xm.c   2015-08-19 21:26:47.694157530 -0600
 b/arch/mips/ath79/mach-ubnt-xm.c   2015-08-20 16:24:06.908537535 -0600
+@@ -642,3 +642,59 @@ static void __init ubnt_airgateway_setup
+ MIPS_MACHINE(ATH79_MACH_UBNT_AIRGW, "UBNT-AGW", "Ubiquiti AirGateway",
+ubnt_airgateway_setup);
+ 
++static struct gpio_led ubnt_airgateway_pro_gpio_leds[] __initdata = {
++  {
++  .name  = "ubnt:blue:wlan",
++  .gpio  = 13,
++  }, {
++  .name  = "ubnt:white:status",
++  .gpio  = 17,
++  },
++};
++
++
++static struct gpio_keys_button airgateway_pro_gpio_keys[] __initdata = {
++  {
++  .desc   = "reset",
++  .type   = EV_KEY,
++  .code   = KEY_RESTART,
++  .debounce_interval  = UBNT_XM_KEYS_DEBOUNCE_INTERVAL,
++  .gpio   = 12,
++  .active_low = 1,
++  }
++};
++
++static void __init ubnt_airgateway_pro_setup(void)
++{
++  u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff);
++  u8 *mac0 = (u8 *) KSEG1ADDR(0x1fff);
++
++  ath79_register_m25p80(NULL);
++  ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_airgateway_pro_gpio_leds),
++   ubnt_airgateway_pro_gpio_leds);
++
++  ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
++  ARRAY_SIZE(airgateway_pro_gpio_keys),
++  airgateway_pro_gpio_keys);
++
++  ath79_register_wmac(eeprom + UAP_PRO_WMAC_CALDATA_OFFSET, NULL);
++  ap91_pci_init(eeprom + UAP_PRO_PCI_CALDATA_OFFSET, NULL);
++
++
++  ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_ONLY_MODE);
++
++  ath79_register_mdio(1, 0x0);
++
++  /* GMAC0 is left unused in this configuration */
++
++  /* GMAC1 is connected to MAC0 on the internal switch */
++  /* The PoE/WAN port connects to port 5 on the internal switch */
++  /* The LAN port connects to port 4 on the internal switch */
++  ath79_init_mac(ath79_eth1_data.mac_addr, mac0, 0);
++  ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
++  ath79_register_eth(1);
++
++}
++
++MIPS_MACHINE(ATH79_MACH_UBNT_AIRGWP, "UBNT-AGWP", "Ubiquiti AirGateway Pro",
++   ubnt_airgateway_pro_setup);
--- a/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch 
2015-08-19 21:57:36.415324864 -0600
+++ b/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch 
2015-08-20 17:36:24.402046004 -0600
@@ -1,6 +1,6 @@ 
 --- a/arch/mips/ath79/machtypes.h
 +++ b/arch/mips/ath79/machtypes.h
-@@ -16,24 +16,207 @@
+@@ -16,24 +16,208 @@
  
  enum ath79_mach_type {
ATH79_MACH_GENERIC = 0,
@@ -159,6 +159,7 @@ 
 +  ATH79_MACH_TL_WR941ND_V5,   /* TP-LINK TL-WR941ND v5 */
 +  ATH79_MACH_TUBE2H,  /* Alfa Network Tube2H */
 +  ATH79_MACH_UBNT_AIRGW,  /* Ubiquiti AirGateway */
++  ATH79_MACH_UBNT_AIRGWP, /* Ubiquiti AirGateway Pro */
ATH79_MACH_UBNT_AIRROUTER,  /* Ubiquiti AirRouter */
ATH79_MACH_UBNT_BULLET_M,   /* Ubiquiti Bullet M */
 +  ATH79_MACH_UBNT_LOCO_M_XW,  /* Ubiquiti Loco M XW */
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh  2015-08-19 
22:04:31.601383634 -0600
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh  2015-08-20 
17:21:07.789500768 -0600
@@ -326,6 +326,9 @@  ar71xx_board_detect() {
*"AirGateway")
name="airgateway"
;;
+   *"AirGateway Pro")
+   name="airgatewaypro"
+   ;;
*"AirRouter")
name="airrouter"
;;
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh2015-08-19 
22:06:58.438111803 -0600
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh2015-08-20 
17:21:21.997571222 -0600
@@ -226,6 +226,7 @@  platform_check_image() {
tew-732br | \
wrt400n | \
airgateway | \
+   airgatewaypro | \
airrouter | \
bullet-m | \
loco-m-xw | \
--- a/target/linux/ar71xx/image/Makefile2015-08-19 22:07:52.094377841 
-0600
+++ b/target/linux/ar71xx/image/Makefile2015-08-20 17:22:34.965933053 
-0600
@@ -840,6 +840,15 @@  define Device/ubnt-air-gateway
 endef
 TARGET_DEVICES += ubnt-air-gateway
 
+define Device/ubnt-air-gateway-pro
+  $(Device/ubnt-xm)
+  BOARDNAME := UBNT-AGWP
+  UBNT_TYPE := AirGWP
+  UBNT_CHIP := ar934x
+  CONSOLE = ttyS0,115200
+endef
+TARGET_DEVICES += ubnt-air-gateway-pro
+
 define De

Re: [OpenWrt-Devel] [PATCH] Added WIZnet WizFi630A Platform based on Ralink RT5350

2015-08-21 Thread Piotr Dymacz
Hello Tobias,

I saw on patchwork that your patch is already marked as accepted, but
I have a lot of comments, please see them inline, below.

PS. Sorry for being so pedantic, but it took me lot of time to clean
ramips target few weeks ago.

2015-08-17 22:47 GMT+02:00 Tobias Welz :
> From: Tobias Welz 

Your patch message should have "ramips:" prefix.
It would be also nice to place a small description about the hardware
you are adding support for and this is the right place for it.

>
>
> Signed-off-by: Tobias Welz 
> ---
>  .../linux/ramips/base-files/etc/board.d/02_network |5 +
>  target/linux/ramips/base-files/etc/diag.sh |3 +
>  target/linux/ramips/base-files/lib/ramips.sh   |3 +
>  .../ramips/base-files/lib/upgrade/platform.sh  |1 +
>  target/linux/ramips/dts/WIZFI630A.dts  |  294
> 
>  target/linux/ramips/image/Makefile |4 +-
>  target/linux/ramips/rt305x/profiles/wizfi630a.mk   |   18 ++
>  7 files changed, 327 insertions(+), 1 deletion(-)
>  create mode 100644 target/linux/ramips/dts/WIZFI630A.dts
>  create mode 100644 target/linux/ramips/rt305x/profiles/wizfi630a.mk
>
> diff --git a/target/linux/ramips/base-files/etc/board.d/02_network
> b/target/linux/ramips/base-files/etc/board.d/02_network
> index 6a2f042..cfd0b26 100755
> --- a/target/linux/ramips/base-files/etc/board.d/02_network
> +++ b/target/linux/ramips/base-files/etc/board.d/02_network
> @@ -217,6 +217,7 @@ ramips_setup_interfaces()
> ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 6t"
> ucidef_add_switch_vlan "switch0" "2" "5 6t"
> ;;
> +   wizfi630a | \

Please, follow the general convention in this file and use "|\"
instead of " | \".

> y1s)
> ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
> ucidef_add_switch "switch0" "1" "1"
> @@ -320,6 +321,10 @@ ramips_setup_macs()
> wcr-150gn)
> wan_mac=$(mtd_get_mac_binary factory 40)
> ;;
> +   wizfi630a)
> +   lan_mac=$(mtd_get_mac_binary factory 4)
> +   wan_mac=$(mtd_get_mac_binary factory 40)
> +   ;;

Please, follow the general convention and keep boards in alphabetical
order (board are sorted in two passes: in file and in common blocks):

[...]
wcr-150gn)
[...]
whr-1166d|\
whr-300hp2|\
whr-600d|\
wsr-600)
[...]

--> this is the right place for your board

wsr-1166)
[...]

> whr-1166d|\
> whr-300hp2|\
> whr-600d|\
> diff --git a/target/linux/ramips/base-files/etc/diag.sh
> b/target/linux/ramips/base-files/etc/diag.sh
> index a4911b0..54b84e5 100644
> --- a/target/linux/ramips/base-files/etc/diag.sh
> +++ b/target/linux/ramips/base-files/etc/diag.sh
> @@ -143,6 +143,9 @@ get_status_led() {
> whr-600d)
> status_led="$board:orange:wifi"
> ;;
> +   wizfi630a)
> +   status_led="wizfi630a::run"
> +   ;;

Same as above, please keep boards in alphabetical order:

[...]
wcr-150gn|\
wl-351)
[...]
whr-g300n|\
wzr-agl300nh)
[...]

--> this is the right place for your board

wsr-1166|\
wsr-600)

> rt-n10-plus|\
> tew-691gr|\
> tew-692gr|\
> diff --git a/target/linux/ramips/base-files/lib/ramips.sh
> b/target/linux/ramips/base-files/lib/ramips.sh
> index 5cafd45..b6d1023 100755
> --- a/target/linux/ramips/base-files/lib/ramips.sh
> +++ b/target/linux/ramips/base-files/lib/ramips.sh
> @@ -367,6 +367,9 @@ ramips_board_detect() {
> *"WIZARD 8800")
> name="wizard8800"
> ;;
> +   *"WIZnet WizFi630A")
> +   name="wizfi630a"
> +   ;;

I don't see any reason here to use whole name of the device, including
manufacturer name (WIZnet WizFi630A) - there are no other similar
models on the list and as you can see we use here *"..." pattern.
Please, follow the general convention in this file and use only
board/model (WizFi630A) name and keep boards in alphabetical order.

> *"WL-330N")
> name="wl-330n"
> ;;
> diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh
> b/target/linux/ramips/base-files/lib/upgrade/platform.sh
> index 53e7070..947a328 100755
> --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
> @@ -107,6 +107,7 @@ platform_check_image() {
> whr-300hp2|\
> whr-600d|\
> whr-g300n|\
> +   wizfi630a |\

Please, follow the general convention in this file and use "|\"
instead of " |\".

> wl-330n|\
> wl-330n3g|\
> wl-341v3|\
> diff --git a/target/linux/ramips/dts/WIZFI630A.dts
> b/target/linux/ramips/dts/WIZFI630A.dts
> new file mode 100644
> index 000..0d44c71
> --- /dev/null
> +++ b/target/linux/ramips/dts/WIZFI630A.dts
> @@ -0,0 +1,294 @@
>
> +/dts-v1/;
> +
> +/include/ "rt5350.dtsi"
> +
> +/ {
> + 

Re: [OpenWrt-Devel] [PATCH 1/2] include: add a new ubinize-image build target

2015-08-21 Thread Jonas Gorski
On Fri, Aug 21, 2015 at 3:34 AM, Mathieu Olivari  wrote:
> This new build target can be used to generate a ubinized.bin file,
> including the kernel and the FS specified as an argument.
>
> Signed-off-by: Mathieu Olivari 

I have a slightly different approach in my queue that uses
scripts/ubinize-image.sh which allows using per device block- and
pagesizes, and control whether the kernel should be included on a per
device basis. E.g. the Netgear R7500 has the kernel raw on the flash,
so the kernel should not be included there. I plan to push it today,
if that approach is okay with you.

I also have a buildstep for wrapping the ubi in a itb file so
qsdk-sysupgrade accepts it, but when I did this it seemed to flashed
correctly, and u-boot was able to load the kenrel, but openwrt then
failed to mount the on flash ubi. Unfortunately I forgot to backup the
original firmware, so I will need to free up some space for qsdk to
reproduce it. Sysupgrade from within OpenWrt is working fine though.


Jonas

> ---
>  include/image.mk | 6 ++
>  1 file changed, 6 insertions(+)
>
> diff --git a/include/image.mk b/include/image.mk
> index 73fc805..f98d871 100644
> --- a/include/image.mk
> +++ b/include/image.mk
> @@ -380,6 +380,12 @@ define Build/combined-image
> @mv $@.new $@
>  endef
>
> +define Build/ubinize-image
> +   $(if $(filter $(1),$(TARGET_FILESYSTEMS)), \
> +   $(call Image/Build/UbinizeImage,$(DEVICE_NAME),--kernel 
> $(word 1,$^),$(1),$(UBINIZE_OPTS)); \
> +   cp $(KDIR)/$(IMG_PREFIX)-$(DEVICE_NAME)-$(1)-ubinized.bin $@)
> +endef
> +
>  define Device/Init
>PROFILES := $(PROFILE)
>DEVICE_NAME := $(1)
> --
> 2.1.4
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
___
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] include: add a new ubinize-image build target

2015-08-21 Thread John Crispin


On 21/08/2015 11:49, Jonas Gorski wrote:
> On Fri, Aug 21, 2015 at 3:34 AM, Mathieu Olivari  
> wrote:
>> This new build target can be used to generate a ubinized.bin file,
>> including the kernel and the FS specified as an argument.
>>
>> Signed-off-by: Mathieu Olivari 
> 
> I have a slightly different approach in my queue that uses
> scripts/ubinize-image.sh which allows using per device block- and
> pagesizes, and control whether the kernel should be included on a per
> device basis. E.g. the Netgear R7500 has the kernel raw on the flash,
> so the kernel should not be included there. I plan to push it today,
> if that approach is okay with you.
> 
> I also have a buildstep for wrapping the ubi in a itb file so
> qsdk-sysupgrade accepts it, but when I did this it seemed to flashed
> correctly, and u-boot was able to load the kenrel, but openwrt then
> failed to mount the on flash ubi. Unfortunately I forgot to backup the
> original firmware, so I will need to free up some space for qsdk to
> reproduce it. Sysupgrade from within OpenWrt is working fine though.
> 
> 

can you post your patches please ? i had already pulled these 2 into my
queue but am happy to drop them again in favour of a different solution

John


> Jonas
> 
>> ---
>>  include/image.mk | 6 ++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/include/image.mk b/include/image.mk
>> index 73fc805..f98d871 100644
>> --- a/include/image.mk
>> +++ b/include/image.mk
>> @@ -380,6 +380,12 @@ define Build/combined-image
>> @mv $@.new $@
>>  endef
>>
>> +define Build/ubinize-image
>> +   $(if $(filter $(1),$(TARGET_FILESYSTEMS)), \
>> +   $(call Image/Build/UbinizeImage,$(DEVICE_NAME),--kernel 
>> $(word 1,$^),$(1),$(UBINIZE_OPTS)); \
>> +   cp $(KDIR)/$(IMG_PREFIX)-$(DEVICE_NAME)-$(1)-ubinized.bin $@)
>> +endef
>> +
>>  define Device/Init
>>PROFILES := $(PROFILE)
>>DEVICE_NAME := $(1)
>> --
>> 2.1.4
>> ___
>> openwrt-devel mailing list
>> openwrt-devel@lists.openwrt.org
>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Broken GCC 4.9 (and 5.2) on ARM - asking for review/test

2015-08-21 Thread John Szakmeister
On Thu, Aug 20, 2015 at 6:57 AM, Jonas Gorski  wrote:
> Hi,
>
> On Thu, Aug 20, 2015 at 11:40 AM, Dirk Neukirchen  
> wrote:
>> GCC 4.9 was marked BROKEN with r46089. Recently GCC 5.2 was added (marked as 
>> broken too)
>>
>> commit msg: " toolchain: mark gcc 4.9 as broken, it miscompiles some code 
>> especially on ARM"
>>
>> Looking through some GCC 5 serious regressions I found:
>>
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65932
>>
>> I cannot replicate the ARM issue because of missing details and I dont have 
>> ARM hw where it occurs (arch: malta seems fine)
>>  - but there was an open ticket from a dev on github regarding the boot 
>> problem, which might be a symptom of code miscompile
>>
>> https://github.com/wongsyrone/openwrt-1/issues/44
>>
>> According to his tests GCC4.9 and GCC5.2 now work with this 2 changes:
>>
>> adding -fno-ipa-sra to Kernel/CPU CFLAGS
>>
>> https://github.com/wongsyrone/openwrt-1/commit/35308f2435ec75192324d68817e7702e3b257e71
>> https://github.com/wongsyrone/openwrt-1/commit/93c0a5173414cfa7684547de3c3a1f3dc4240383
>
> Readin the bug ticket, it seems that
>
> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35775&action=diff
>
> should fix the issue at the root cause, but with the "disadvantage" of
> breaking some testcases relying on the (mis-?)behaviour, which sounds
> like the "blocker" for this change.
>
> So I wonder if adding that wouldn't be a better solution.

I don't think that's the only bug affecting ARM.  At least for us,
against an ARM11, we found that there is some other optimization that
results in broken code generation (numbers where being converted to
unsigned, and the optimization failed to convert them back to signed
correctly).  We reported it several months ago, but haven't heard
anything.  I'm not sure what else it broke, but the kernel logging was
the most noticeable.

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


[OpenWrt-Devel] [PATCH 01/10] ipq806x: enable ubiblock support

2015-08-21 Thread Jonas Gorski
To allow squashfs on ubi, enable ubiblock support in the kernel.

Signed-off-by: Jonas Gorski 
---
 target/linux/ipq806x/config-3.18 | 2 +-
 target/linux/ipq806x/config-4.1  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/ipq806x/config-3.18 b/target/linux/ipq806x/config-3.18
index 3d4f8bb..7b4c2d3 100644
--- a/target/linux/ipq806x/config-3.18
+++ b/target/linux/ipq806x/config-3.18
@@ -267,7 +267,7 @@ CONFIG_MTD_SPLIT_FIRMWARE=y
 CONFIG_MTD_SPLIT_FIT_FW=y
 CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_BEB_LIMIT=20
-# CONFIG_MTD_UBI_BLOCK is not set
+CONFIG_MTD_UBI_BLOCK=y
 # CONFIG_MTD_UBI_FASTMAP is not set
 # CONFIG_MTD_UBI_GLUEBI is not set
 CONFIG_MTD_UBI_WL_THRESHOLD=4096
diff --git a/target/linux/ipq806x/config-4.1 b/target/linux/ipq806x/config-4.1
index d48943c..6fff6d2 100644
--- a/target/linux/ipq806x/config-4.1
+++ b/target/linux/ipq806x/config-4.1
@@ -274,7 +274,7 @@ CONFIG_MTD_SPLIT_FIRMWARE=y
 CONFIG_MTD_SPLIT_FIT_FW=y
 CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_BEB_LIMIT=20
-# CONFIG_MTD_UBI_BLOCK is not set
+CONFIG_MTD_UBI_BLOCK=y
 # CONFIG_MTD_UBI_FASTMAP is not set
 # CONFIG_MTD_UBI_GLUEBI is not set
 CONFIG_MTD_UBI_WL_THRESHOLD=4096
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 02/10] image: add a build step for building and appending an ubinized rootfs

2015-08-21 Thread Jonas Gorski
Signed-off-by: Jonas Gorski 
---
 include/image.mk | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/include/image.mk b/include/image.mk
index 73fc805..fb89ed1 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -345,6 +345,16 @@ define Build/append-rootfs
dd if=$(word 2,$^) $(if $(1),bs=$(1) conv=sync) >> $@
 endef
 
+define Build/append-ubi
+   sh $(TOPDIR)/scripts/ubinize-image.sh \
+   $(if $(KERNEL_IN_UBI),--kernel $(word 1,$^)) \
+   $(word 2,$^) \
+   $@.tmp \
+   -p $(BLOCKSIZE) -m $(PAGESIZE) -E 5
+   cat $@.tmp >> $@
+   rm $@.tmp
+endef
+
 define Build/pad-to
dd if=$@ of=$@.new bs=$(1) conv=sync
mv $@.new $@
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 00/10] ipq806x: implement sysupgrade for AP148

2015-08-21 Thread Jonas Gorski
This patchset adds sysupgrade support and and builds images for AP148.

This has been tested on AP148.

sysupgrade from original QSDK should work in theory, but in practice
either ubiformat or something else in QSDK writes the ubi image in a way
that makes OpenWrt fail to mount the image. U-Boot is able to read from
it.

Therefore the last two patches that create an "sysupgradeable" image are
marked as RFC.

Jonas Gorski (10):
  ipq806x: enable ubiblock support
  image: add a build step for building and appending an ubinized rootfs
  build: add a build step for generic sysupgrade nand image
  ipq806x: enable smem-parser for nand on AP148
  ipq806x: rename "rootfs" to "ubi" on nand
  ipq806x: wrap legacy image in uImage
  ipq806x: clear IMAGES for devices
  ipq806x: build images and add sysupgrade support for AP148
  image: add a build recipe to wrap an ubi image in a itb file
  ipq806x: wrap ubi in itb

 include/image.mk   | 25 +++
 scripts/mkits-ubi.sh   | 79 ++
 scripts/sysupgrade-nand.sh | 68 +++
 .../ipq806x/base-files/lib/upgrade/platform.sh | 18 +
 target/linux/ipq806x/config-3.18   |  2 +-
 target/linux/ipq806x/config-4.1|  2 +-
 target/linux/ipq806x/image/Makefile| 25 +--
 ...h-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch | 11 +++
 .../302-mtd-qcom-smem-rename-rootfs-ubi.patch  | 13 
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |  6 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |  2 +-
 ...h-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch | 11 +++
 .../302-mtd-qcom-smem-rename-rootfs-ubi.patch  | 13 
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |  6 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |  2 +-
 15 files changed, 268 insertions(+), 15 deletions(-)
 create mode 100755 scripts/mkits-ubi.sh
 create mode 100755 scripts/sysupgrade-nand.sh
 create mode 100644 target/linux/ipq806x/base-files/lib/upgrade/platform.sh
 create mode 100644 
target/linux/ipq806x/patches-3.18/166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/302-mtd-qcom-smem-rename-rootfs-ubi.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/302-mtd-qcom-smem-rename-rootfs-ubi.patch

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


[OpenWrt-Devel] [PATCH 03/10] build: add a build step for generic sysupgrade nand image

2015-08-21 Thread Jonas Gorski
Signed-off-by: Jonas Gorski 
---
 include/image.mk   |  8 ++
 scripts/sysupgrade-nand.sh | 68 ++
 2 files changed, 76 insertions(+)
 create mode 100755 scripts/sysupgrade-nand.sh

diff --git a/include/image.mk b/include/image.mk
index fb89ed1..8ac3593 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -390,6 +390,14 @@ define Build/combined-image
@mv $@.new $@
 endef
 
+define Build/sysupgrade-nand
+   sh $(TOPDIR)/scripts/sysupgrade-nand.sh \
+   --board $(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)) \
+   --kernel $(word 1,$^) \
+   --rootfs $(word 2,$^) \
+   $@
+endef
+
 define Device/Init
   PROFILES := $(PROFILE)
   DEVICE_NAME := $(1)
diff --git a/scripts/sysupgrade-nand.sh b/scripts/sysupgrade-nand.sh
new file mode 100755
index 000..92b326c
--- /dev/null
+++ b/scripts/sysupgrade-nand.sh
@@ -0,0 +1,68 @@
+#!/bin/sh
+
+board=""
+kernel=""
+rootfs=""
+outfile=""
+err=""
+
+while [ "$1" ]; do
+   case "$1" in
+   "--board")
+   board="$2"
+   shift
+   shift
+   continue
+   ;;
+   "--kernel")
+   kernel="$2"
+   shift
+   shift
+   continue
+   ;;
+   "--rootfs")
+   rootfs="$2"
+   shift
+   shift
+   continue
+   ;;
+   *)
+   if [ ! "$outfile" ]; then
+   outfile=$1
+   shift
+   continue
+   fi
+   ;;
+   esac
+done
+
+if [ ! -n "$board" -o ! -r "$kernel" -a  ! -r "$rootfs" -o ! "$outfile" ]; then
+   echo "syntax: $0 [--board boardname] [--kernel kernelimage] [--rootfs 
rootfs] out"
+   exit 1
+fi
+
+tmpdir="$( mktemp -d 2> /dev/null )"
+if [ -z "$tmpdir" ]; then
+   # try OSX signature
+   tmpdir="$( mktemp -t 'ubitmp' -d )"
+fi
+
+if [ -z "$tmpdir" ]; then
+   exit 1
+fi
+
+mkdir -p "${tmpdir}/sysupgrade-${board}"
+echo "BOARD=${board}" > "${tmpdir}/sysupgrade-${board}/CONTROL"
+[ -z "${rootfs}" ] || cp "${rootfs}" "${tmpdir}/sysupgrade-${board}/root"
+[ -z "${kernel}" ] || cp "${kernel}" "${tmpdir}/sysupgrade-${board}/kernel"
+
+(cd "$tmpdir"; tar cvf sysupgrade.tar sysupgrade-${board})
+err="$?"
+if [ -e "$tmpdir/sysupgrade.tar" ]; then
+   cp "$tmpdir/sysupgrade.tar" "$outfile"
+else
+   err=2
+fi
+rm -rf "$tmpdir"
+
+exit $err
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 05/10] ipq806x: rename "rootfs" to "ubi" on nand

2015-08-21 Thread Jonas Gorski
OpenWrt expects the ubi paritition to be named "ubi", not "rootfs".

Signed-off-by: Jonas Gorski 
---
 .../patches-3.18/302-mtd-qcom-smem-rename-rootfs-ubi.patch  | 13 +
 .../patches-4.1/302-mtd-qcom-smem-rename-rootfs-ubi.patch   | 13 +
 2 files changed, 26 insertions(+)
 create mode 100644 
target/linux/ipq806x/patches-3.18/302-mtd-qcom-smem-rename-rootfs-ubi.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/302-mtd-qcom-smem-rename-rootfs-ubi.patch

diff --git 
a/target/linux/ipq806x/patches-3.18/302-mtd-qcom-smem-rename-rootfs-ubi.patch 
b/target/linux/ipq806x/patches-3.18/302-mtd-qcom-smem-rename-rootfs-ubi.patch
new file mode 100644
index 000..471a87b
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-3.18/302-mtd-qcom-smem-rename-rootfs-ubi.patch
@@ -0,0 +1,13 @@
+--- a/drivers/mtd/qcom_smem_part.c
 b/drivers/mtd/qcom_smem_part.c
+@@ -192,6 +192,10 @@ static int parse_qcom_smem_partitions(st
+   m_part->size = le32_to_cpu(s_part->size) * (*smem_blksz);
+   m_part->offset = le32_to_cpu(s_part->start) * (*smem_blksz);
+ 
++  /* "rootfs" conflicts with OpenWrt auto mounting */
++  if (mtd_type_is_nand(master) && !strcmp(m_part->name, "rootfs"))
++  m_part->name = "ubi";
++
+   /*
+* The last SMEM partition may have its size marked as
+* something like 0x, which means "until the end of the
diff --git 
a/target/linux/ipq806x/patches-4.1/302-mtd-qcom-smem-rename-rootfs-ubi.patch 
b/target/linux/ipq806x/patches-4.1/302-mtd-qcom-smem-rename-rootfs-ubi.patch
new file mode 100644
index 000..471a87b
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/302-mtd-qcom-smem-rename-rootfs-ubi.patch
@@ -0,0 +1,13 @@
+--- a/drivers/mtd/qcom_smem_part.c
 b/drivers/mtd/qcom_smem_part.c
+@@ -192,6 +192,10 @@ static int parse_qcom_smem_partitions(st
+   m_part->size = le32_to_cpu(s_part->size) * (*smem_blksz);
+   m_part->offset = le32_to_cpu(s_part->start) * (*smem_blksz);
+ 
++  /* "rootfs" conflicts with OpenWrt auto mounting */
++  if (mtd_type_is_nand(master) && !strcmp(m_part->name, "rootfs"))
++  m_part->name = "ubi";
++
+   /*
+* The last SMEM partition may have its size marked as
+* something like 0x, which means "until the end of the
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 04/10] ipq806x: enable smem-parser for nand on AP148

2015-08-21 Thread Jonas Gorski
Signed-off-by: Jonas Gorski 
---
 .../166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch| 11 +++
 .../707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch  |  6 +++---
 ...708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |  2 +-
 .../166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch| 11 +++
 .../707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch  |  6 +++---
 ...708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |  2 +-
 6 files changed, 30 insertions(+), 8 deletions(-)
 create mode 100644 
target/linux/ipq806x/patches-3.18/166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch

diff --git 
a/target/linux/ipq806x/patches-3.18/166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch
 
b/target/linux/ipq806x/patches-3.18/166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch
new file mode 100644
index 000..cae7f15
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-3.18/166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch
@@ -0,0 +1,11 @@
+--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+@@ -181,6 +181,8 @@
+ 
+   nand-ecc-strength = <4>;
+   nand-bus-width = <8>;
++
++  linux,part-probe = "qcom-smem";
+   };
+   };
+ };
diff --git 
a/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
 
b/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
index a4a6a60..fe28942 100644
--- 
a/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
+++ 
b/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
@@ -38,9 +38,9 @@ Signed-off-by: Mathieu Olivari 
};
  
gsbi@1630 {
-@@ -182,6 +192,34 @@
-   nand-ecc-strength = <4>;
-   nand-bus-width = <8>;
+@@ -184,6 +194,34 @@
+ 
+   linux,part-probe = "qcom-smem";
};
 +
 +  mdio0: mdio {
diff --git 
a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
 
b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
index fda1b86..3455d45 100644
--- 
a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
+++ 
b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
@@ -29,7 +29,7 @@ Signed-off-by: Mathieu Olivari 
};
  
gsbi@1630 {
-@@ -220,6 +230,27 @@
+@@ -222,6 +232,27 @@
reg = <4>;
};
};
diff --git 
a/target/linux/ipq806x/patches-4.1/166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch
 
b/target/linux/ipq806x/patches-4.1/166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch
new file mode 100644
index 000..16df418
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-4.1/166-arch-qcom-dts-enable-qcom-smem-on-AP148-NAND.patch
@@ -0,0 +1,11 @@
+--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+@@ -154,6 +154,8 @@
+ 
+   nand-ecc-strength = <4>;
+   nand-bus-width = <8>;
++
++  linux,part-probe = "qcom-smem";
+   };
+   };
+ };
diff --git 
a/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
 
b/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
index 394f378..0e2b305 100644
--- 
a/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
+++ 
b/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
@@ -38,9 +38,9 @@ Signed-off-by: Mathieu Olivari 
};
  
gsbi@1630 {
-@@ -155,6 +165,34 @@
-   nand-ecc-strength = <4>;
-   nand-bus-width = <8>;
+@@ -157,6 +167,34 @@
+ 
+   linux,part-probe = "qcom-smem";
};
 +
 +  mdio0: mdio {
diff --git 
a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
 
b/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
index 9b7eacb..0918634 100644
--- 
a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
+++ 
b/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
@@ -29,7 +29,7 @@ Signed-off-by: Mathieu Olivari 
};
  
gsbi@1630 {
-@@ -193,6 +203,27 @@
+@@ -195,6 +205,27 @@
reg = <4>;
};
};
-- 
2.1.4
__

[OpenWrt-Devel] [PATCH 07/10] ipq806x: clear IMAGES for devices

2015-08-21 Thread Jonas Gorski
Ensure that IMAGE-less devices won't keep the IMAGES of any previous
devices.

Signed-off-by: Jonas Gorski 
---
 target/linux/ipq806x/image/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ipq806x/image/Makefile 
b/target/linux/ipq806x/image/Makefile
index 2369762..dad6ee3 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -34,6 +34,7 @@ define Device/Default
KERNEL_INITRAMFS_PREFIX := $$(IMG_PREFIX)-$(1)-initramfs
DEVICE_DTS :=
KERNEL_PREFIX := $$(IMAGE_PREFIX)
+   IMAGES :=
 endef
 DEVICE_VARS += DEVICE_DTS
 
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 06/10] ipq806x: wrap legacy image in uImage

2015-08-21 Thread Jonas Gorski
Wrap the zImage in a uImage header so we can easily boot it from legacy
u-boots.

Signed-off-by: Jonas Gorski 
---
 target/linux/ipq806x/image/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/ipq806x/image/Makefile 
b/target/linux/ipq806x/image/Makefile
index b64d629..2369762 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -38,8 +38,8 @@ endef
 DEVICE_VARS += DEVICE_DTS
 
 define Device/LegacyImage
-   KERNEL_SUFFIX := -zImage
-   KERNEL = kernel-bin | append-dtb
+   KERNEL_SUFFIX := -uImage
+   KERNEL = kernel-bin | append-dtb | uImage none
KERNEL_NAME := zImage
KERNEL_INSTALL := 1
 endef
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 08/10] ipq806x: build images and add sysupgrade support for AP148

2015-08-21 Thread Jonas Gorski
Add full ubi and sysupgrade images for AP148 and add sysupgrade support
for ipq806x to allow updating the current installation.

Signed-off-by: Jonas Gorski 
---
 .../linux/ipq806x/base-files/lib/upgrade/platform.sh | 18 ++
 target/linux/ipq806x/image/Makefile  | 20 +---
 2 files changed, 35 insertions(+), 3 deletions(-)
 create mode 100644 target/linux/ipq806x/base-files/lib/upgrade/platform.sh

diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh 
b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
new file mode 100644
index 000..e834ead
--- /dev/null
+++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
@@ -0,0 +1,18 @@
+. /lib/ipq806x.sh
+
+PART_NAME=firmware
+
+platform_check_image() {
+   local board=$(ipq806x_board_name)
+
+   case "$board" in
+   AP148)
+   nand_do_platform_check $board $1
+   return $?;
+   ;;
+   *)
+   return 1;
+   esac
+}
+
+# use default for platform_do_upgrade()
diff --git a/target/linux/ipq806x/image/Makefile 
b/target/linux/ipq806x/image/Makefile
index dad6ee3..ac0fc84 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -35,36 +35,50 @@ define Device/Default
DEVICE_DTS :=
KERNEL_PREFIX := $$(IMAGE_PREFIX)
IMAGES :=
+   KERNEL_IN_UBI :=
 endef
-DEVICE_VARS += DEVICE_DTS
+DEVICE_VARS += DEVICE_DTS KERNEL_IN_UBI
 
 define Device/LegacyImage
KERNEL_SUFFIX := -uImage
KERNEL = kernel-bin | append-dtb | uImage none
KERNEL_NAME := zImage
-   KERNEL_INSTALL := 1
 endef
 
 define Device/FitImage
KERNEL_SUFFIX := -fit-uImage.itb
KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
KERNEL_NAME := Image
-   KERNEL_INSTALL := 1
+endef
+
+define Device/UbiFit
+   KERNEL_IN_UBI := 1
+   IMAGES := nand-factory.ubi nand-sysupgrade.tar
+   IMAGE/nand-factory.ubi := append-ubi
+   IMAGE/nand-sysupgrade.tar := sysupgrade-nand
 endef
 
 define Device/AP148
$(call Device/FitImage)
+   $(call Device/UbiFit)
DEVICE_DTS := qcom-ipq8064-ap148
+   BLOCKSIZE := 128KiB
+   PAGESIZE := 2048
 endef
 
 define Device/AP148-legacy
$(call Device/LegacyImage)
+   $(call Device/UbiFit)
DEVICE_DTS := qcom-ipq8064-ap148
+   BLOCKSIZE := 128KiB
+   PAGESIZE := 2048
+   BOARD_NAME := AP148
 endef
 
 define Device/DB149
$(call Device/FitImage)
DEVICE_DTS := qcom-ipq8064-db149
+   KERNEL_INSTALL := 1
 endef
 
 TARGET_DEVICES += AP148 AP148-legacy DB149
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH RFC 10/10] ipq806x: wrap ubi in itb

2015-08-21 Thread Jonas Gorski
The stock QSDK expects the ubi to be wrapped in an itb image, so
provide one for easy sysupgrade from QSDK.

FIXME: currently does not work? Seems to flash fine, but ubi cannot
be mounted by OpenWrt and needs to be flashed a second time.

Signed-off-by: Jonas Gorski 
---
 target/linux/ipq806x/image/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/ipq806x/image/Makefile 
b/target/linux/ipq806x/image/Makefile
index ac0fc84..2fdaab5 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -53,8 +53,8 @@ endef
 
 define Device/UbiFit
KERNEL_IN_UBI := 1
-   IMAGES := nand-factory.ubi nand-sysupgrade.tar
-   IMAGE/nand-factory.ubi := append-ubi
+   IMAGES := nand-factory.itb nand-sysupgrade.tar
+   IMAGE/nand-factory.itb := append-ubi | ubi-fit
IMAGE/nand-sysupgrade.tar := sysupgrade-nand
 endef
 
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH RFC 10/10] ipq806x: wrap ubi in itb

2015-08-21 Thread John Crispin


On 21/08/2015 13:17, Jonas Gorski wrote:
> The stock QSDK expects the ubi to be wrapped in an itb image, so
> provide one for easy sysupgrade from QSDK.
> 
> FIXME: currently does not work? Seems to flash fine, but ubi cannot
> be mounted by OpenWrt and needs to be flashed a second time.

how do you flash it the second time ? using the same process ?

> 
> Signed-off-by: Jonas Gorski 
> ---
>  target/linux/ipq806x/image/Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/linux/ipq806x/image/Makefile 
> b/target/linux/ipq806x/image/Makefile
> index ac0fc84..2fdaab5 100644
> --- a/target/linux/ipq806x/image/Makefile
> +++ b/target/linux/ipq806x/image/Makefile
> @@ -53,8 +53,8 @@ endef
>  
>  define Device/UbiFit
>   KERNEL_IN_UBI := 1
> - IMAGES := nand-factory.ubi nand-sysupgrade.tar
> - IMAGE/nand-factory.ubi := append-ubi
> + IMAGES := nand-factory.itb nand-sysupgrade.tar
> + IMAGE/nand-factory.itb := append-ubi | ubi-fit
>   IMAGE/nand-sysupgrade.tar := sysupgrade-nand
>  endef
>  
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH RFC 09/10] image: add a build recipe to wrap an ubi image in a itb file

2015-08-21 Thread Jonas Gorski
Signed-off-by: Jonas Gorski 
---
 include/image.mk |  7 +
 scripts/mkits-ubi.sh | 79 
 2 files changed, 86 insertions(+)
 create mode 100755 scripts/mkits-ubi.sh

diff --git a/include/image.mk b/include/image.mk
index 8ac3593..261cbb2 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -318,6 +318,13 @@ define Build/fit
@mv $@.new $@
 endef
 
+define Build/ubi-fit
+   $(TOPDIR)/scripts/mkits-ubi.sh \
+   -D $(DEVICE_NAME) -o $@.its -u $@ -A $(ARCH)
+   PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
+   @mv $@.new $@
+endef
+
 define Build/lzma
$(STAGING_DIR_HOST)/bin/lzma e $@ -lc1 -lp2 -pb2 $(1) $@.new
@mv $@.new $@
diff --git a/scripts/mkits-ubi.sh b/scripts/mkits-ubi.sh
new file mode 100755
index 000..e84a3fa
--- /dev/null
+++ b/scripts/mkits-ubi.sh
@@ -0,0 +1,79 @@
+#!/bin/bash
+#
+# Licensed under the terms of the GNU GPL License version 2 or later.
+#
+# Author: Peter Tyser 
+#
+# U-Boot firmware supports the booting of images in the Flattened Image
+# Tree (FIT) format.  The FIT format uses a device tree structure to
+# describe a kernel image, device tree blob, ramdisk, etc.  This script
+# creates an Image Tree Source (.its file) which can be passed to the
+# 'mkimage' utility to generate an Image Tree Blob (.itb file).  The .itb
+# file can then be booted by U-Boot (or other bootloaders which support
+# FIT images).  See doc/uImage.FIT/howto.txt in U-Boot source code for
+# additional information on FIT images.
+#
+
+usage() {
+   echo "Usage: `basename $0` -A arch -D name -u ubi -o its_file"
+   echo -e "\t-A ==> set architecture to 'arch'"
+   echo -e "\t-u ==> include ubi image 'kernel'"
+   echo -e "\t-D ==> human friendly UBI 'name'"
+   echo -e "\t-o ==> create output file 'its_file'"
+   exit 1
+}
+
+while getopts ":A:D:o:u:v:" OPTION
+do
+   case $OPTION in
+   A ) ARCH=$OPTARG;;
+   D ) DEVICE=$OPTARG;;
+   u ) UBI=$OPTARG;;
+   o ) OUTPUT=$OPTARG;;
+   * ) echo "Invalid option passed to '$0' (options:$@)"
+   usage;;
+   esac
+done
+
+# Make sure user entered all required parameters
+if [ -z "${ARCH}" ] || [ -z "${UBI}" ] || [ -z "${OUTPUT}" ]; then
+   usage
+fi
+
+ARCH_UPPER=`echo $ARCH | tr '[:lower:]' '[:upper:]'`
+
+# Create a default, fully populated DTS file
+DATA="/dts-v1/;
+
+/ {
+   description = \"${ARCH_UPPER} OpenWrt FIT (Flattened Image Tree)\";
+   #address-cells = <1>;
+
+   images {
+   ubi@1 {
+   description = \"${ARCH_UPPER} OpenWrt ${DEVICE} ubi 
rootfs\";
+   data = /incbin/(\"${UBI}\");
+   type = \"firmware\";
+   arch = \"${ARCH}\";
+   compression = \"none\";
+   hash@1 {
+   algo = \"crc32\";
+   };
+   hash@2 {
+   algo = \"sha1\";
+   };
+   };
+
+   };
+
+   configurations {
+   default = \"config@1\";
+   config@1 {
+   description = \"OpenWrt\";
+   ubi = \"ubi@1\";
+   };
+   };
+};"
+
+# Write .its file to disk
+echo "$DATA" > ${OUTPUT}
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH RFC 10/10] ipq806x: wrap ubi in itb

2015-08-21 Thread Jonas Gorski
On 21.08.2015 13:24, John Crispin wrote:
> 
> 
> On 21/08/2015 13:17, Jonas Gorski wrote:
>> The stock QSDK expects the ubi to be wrapped in an itb image, so
>> provide one for easy sysupgrade from QSDK.
>>
>> FIXME: currently does not work? Seems to flash fine, but ubi cannot
>> be mounted by OpenWrt and needs to be flashed a second time.
> 
> how do you flash it the second time ? using the same process ?

Booted a ramdisk OpenWrt kernel, then flashed the ubi with ubiformat. Which 
didn't seem to differ from what the preinstalled QSDK did, but somehow works.

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


Re: [OpenWrt-Devel] [PATCH RFC 10/10] ipq806x: wrap ubi in itb

2015-08-21 Thread John Crispin


On 21/08/2015 13:28, Jonas Gorski wrote:
> On 21.08.2015 13:24, John Crispin wrote:
>>
>>
>> On 21/08/2015 13:17, Jonas Gorski wrote:
>>> The stock QSDK expects the ubi to be wrapped in an itb image, so
>>> provide one for easy sysupgrade from QSDK.
>>>
>>> FIXME: currently does not work? Seems to flash fine, but ubi cannot
>>> be mounted by OpenWrt and needs to be flashed a second time.
>>
>> how do you flash it the second time ? using the same process ?
> 
> Booted a ramdisk OpenWrt kernel, then flashed the ubi with ubiformat. Which 
> didn't seem to differ from what the preinstalled QSDK did, but somehow works.
> 
> Jonas
> 

does sysupgrade work from owrt->owrt ?
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH RFC 10/10] ipq806x: wrap ubi in itb

2015-08-21 Thread Jonas Gorski
On 21.08.2015 13:39, John Crispin wrote:
> 
> 
> On 21/08/2015 13:28, Jonas Gorski wrote:
>> On 21.08.2015 13:24, John Crispin wrote:
>>>
>>>
>>> On 21/08/2015 13:17, Jonas Gorski wrote:
 The stock QSDK expects the ubi to be wrapped in an itb image, so
 provide one for easy sysupgrade from QSDK.

 FIXME: currently does not work? Seems to flash fine, but ubi cannot
 be mounted by OpenWrt and needs to be flashed a second time.
>>>
>>> how do you flash it the second time ? using the same process ?
>>
>> Booted a ramdisk OpenWrt kernel, then flashed the ubi with ubiformat. Which 
>> didn't seem to differ from what the preinstalled QSDK did, but somehow works.
>>
>> Jonas
>>
> 
> does sysupgrade work from owrt->owrt ?

Yes, even without the last two patches. The last two are only for "easy" 
sysupgrade from QSDK (in theory). Therefore also as RFC.


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


[OpenWrt-Devel] [PATCH 1/7] ar71xx: rename NETGEAR_ variables to their netgear names

2015-08-21 Thread Jonas Gorski
Netgear names them BOARD_ID and HW_ID, so we should do the same.

Signed-off-by: Jonas Gorski 
---
 target/linux/ar71xx/image/Makefile | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
index 8f609de..04597f2 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -14,7 +14,7 @@ IMAGE_PROFILE:=$(if $(PROFILE),$(PROFILE),Default)
 
 KERNEL_LOADADDR = 0x8006
 
-DEVICE_VARS += NETGEAR_KERNEL_MAGIC NETGEAR_BOARD NETGEAR_ID CMDLINE CONSOLE 
IMAGE_SIZE BOARDNAME LOADER_FLASH_OFFS
+DEVICE_VARS += NETGEAR_KERNEL_MAGIC NETGEAR_BOARD_ID NETGEAR_HW_ID CMDLINE 
CONSOLE IMAGE_SIZE BOARDNAME LOADER_FLASH_OFFS
 
 define Build/netgear-squashfs
rm -rf $@.fs $@.squashfs
@@ -39,8 +39,8 @@ endef
 
 define Build/netgear-image
$(STAGING_DIR_HOST)/bin/mkdniimg \
-   -B $(NETGEAR_BOARD) -v OpenWrt.$(REVISION) \
-   $(if $(NETGEAR_ID),-H $(NETGEAR_ID)) \
+   -B $(NETGEAR_BOARD_ID) -v OpenWrt.$(REVISION) \
+   $(if $(NETGEAR_HW_ID),-H $(NETGEAR_HW_ID)) \
-r "$(1)" \
-i $@ -o $@.new
mv $@.new $@
@@ -191,7 +191,7 @@ TARGET_DEVICES += carambola2
 define Device/wndr3700
   BOARDNAME = WNDR3700
   NETGEAR_KERNEL_MAGIC = 0x33373030
-  NETGEAR_BOARD = WNDR3700
+  NETGEAR_BOARD_ID = WNDR3700
   IMAGE_SIZE = 7680k
   MTDPARTS = 
spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,7680k(firmware),64k(art)ro
   IMAGES := sysupgrade.bin factory.img factory-NA.img
@@ -204,9 +204,9 @@ endef
 
 define Device/wndr3700v2
 $(Device/wndr3700)
-  NETGEAR_BOARD = WNDR3700v2
+  NETGEAR_BOARD_ID = WNDR3700v2
   NETGEAR_KERNEL_MAGIC = 0x33373031
-  NETGEAR_ID = 29763654+16+64
+  NETGEAR_HW_ID = 29763654+16+64
   IMAGE_SIZE = 15872k
   MTDPARTS = 
spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,15872k(firmware),64k(art)ro
   IMAGES := sysupgrade.bin factory.img
@@ -214,23 +214,23 @@ endef
 
 define Device/wndr3800
 $(Device/wndr3700v2)
-  NETGEAR_BOARD = WNDR3800
-  NETGEAR_ID = 29763654+16+128
+  NETGEAR_BOARD_ID = WNDR3800
+  NETGEAR_HW_ID = 29763654+16+128
 endef
 
 define Device/wndr3800ch
 $(Device/wndr3800)
-  NETGEAR_BOARD = WNDR3800CH
+  NETGEAR_BOARD_ID = WNDR3800CH
 endef
 
 define Device/wndrmac
 $(Device/wndr3700v2)
-  NETGEAR_BOARD = WNDRMAC
+  NETGEAR_BOARD_ID = WNDRMAC
 endef
 
 define Device/wndrmacv2
 $(Device/wndr3800)
-  NETGEAR_BOARD = WNDRMACv2
+  NETGEAR_BOARD_ID = WNDRMACv2
 endef
 
 TARGET_DEVICES += wndr3700 wndr3700v2 wndr3800 wndr3800ch wndrmac wndrmacv2
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 0/7] ipq806x: add support for Netgear Nighthawk X4 R7500

2015-08-21 Thread Jonas Gorski
This patchset adds support for the Netgear Nighthawk X4 R7500.

This patchset depends on patches 1 to 8 from "ipq806x: implement
sysupgrade for AP148".

Most things are working, except for the following:

* One of the usb ports is non functional. This is also the case on AP148,
  so likely driver related.
* 5 GHz wifi is not available. This uses a Quantenna wifi for 5 GHz, for
  which there is no driver in mainline linux or OpenWrt.

What does work is:

* Flashing from original webui using the factory image
* Sysupgrading from within OpenWrt.
* Using the 2.4 GHz wifi.
* Using the working usb port.

Untested is:

* Using the esata port.

Special shout-out to Delta Networks for thinking having both kernel and
a squashfs rootfs raw on NAND flash is a good idea, without *any* wear
leveling or even working bad block handling.

Luckily we can make u-boot think the rootfs has a length of 0, so it's
only the kernel that is affected.



Jonas Gorski (7):
  ar71xx: rename NETGEAR_ variables to their netgear names
  image: move netgear-image to top and rename to -dni
  image: allow exactly KERNEL_SIZE sized kernels
  ipq806x: add support for retrieving macs from mtd
  base-files: allow setting ide-disk led trigger
  ipq806x: enable ide led trigger
  ipq806x: add support for Netgear Nighthawk X4 R7500

 include/image.mk   |  13 +-
 .../base-files/files/lib/functions/uci-defaults.sh |  16 +
 target/linux/ar71xx/image/Makefile |  31 +-
 .../linux/ipq806x/base-files/etc/uci-defaults/leds |  26 ++
 .../ipq806x/base-files/etc/uci-defaults/network|   3 +-
 target/linux/ipq806x/base-files/lib/ipq806x.sh |   3 +
 .../ipq806x/base-files/lib/upgrade/platform.sh |   3 +-
 target/linux/ipq806x/config-3.18   |   1 +
 target/linux/ipq806x/config-4.1|   1 +
 target/linux/ipq806x/image/Makefile|  40 ++-
 ...dd-Netgear-Nighthawk-X4-R7500-device-tree.patch | 387 +
 ...orm-add-support-for-retreiving-mac-from-m.patch |  35 ++
 ...dd-Netgear-Nighthawk-X4-R7500-device-tree.patch | 387 +
 ...orm-add-support-for-retreiving-mac-from-m.patch |  35 ++
 target/linux/ipq806x/profiles/netgear.mk   |  20 ++
 15 files changed, 976 insertions(+), 25 deletions(-)
 create mode 100644 target/linux/ipq806x/base-files/etc/uci-defaults/leds
 create mode 100644 
target/linux/ipq806x/patches-3.18/301-ARM-qcom-add-Netgear-Nighthawk-X4-R7500-device-tree.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/301-ARM-qcom-add-Netgear-Nighthawk-X4-R7500-device-tree.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch
 create mode 100644 target/linux/ipq806x/profiles/netgear.mk

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


[OpenWrt-Devel] [PATCH 2/7] image: move netgear-image to top and rename to -dni

2015-08-21 Thread Jonas Gorski
Use the same naming as netgear-chk.

Signed-off-by: Jonas Gorski 
---
 include/image.mk   |  9 +
 target/linux/ar71xx/image/Makefile | 13 ++---
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/include/image.mk b/include/image.mk
index 261cbb2..d4ebdef 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -308,6 +308,15 @@ define Build/netgear-chk
mv $@.new $@
 endef
 
+define Build/netgear-dni
+   $(STAGING_DIR_HOST)/bin/mkdniimg \
+   -B $(NETGEAR_BOARD_ID) -v OpenWrt.$(REVISION) \
+   $(if $(NETGEAR_HW_ID),-H $(NETGEAR_HW_ID)) \
+   -r "$(1)" \
+   -i $@ -o $@.new
+   mv $@.new $@
+endef
+
 define Build/fit
$(TOPDIR)/scripts/mkits.sh \
-D $(DEVICE_NAME) -o $@.its -k $@ \
diff --git a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
index 04597f2..e6fe36a 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -37,15 +37,6 @@ define Build/netgear-uImage
$(call Build/uImage,$(1) -M $(NETGEAR_KERNEL_MAGIC))
 endef
 
-define Build/netgear-image
-   $(STAGING_DIR_HOST)/bin/mkdniimg \
-   -B $(NETGEAR_BOARD_ID) -v OpenWrt.$(REVISION) \
-   $(if $(NETGEAR_HW_ID),-H $(NETGEAR_HW_ID)) \
-   -r "$(1)" \
-   -i $@ -o $@.new
-   mv $@.new $@
-endef
-
 # combine kernel and rootfs into one image
 # -a align the rootfs start on an  bytes boundary
 # -j add jffs2 end-of-filesystem markers
@@ -198,8 +189,8 @@ define Device/wndr3700
   KERNEL := kernel-bin | patch-cmdline | lzma -d20 | netgear-uImage lzma
   IMAGE/default = append-kernel (BLOCKSIZE) | netgear-squashfs | 
append-rootfs | pad-rootfs
   IMAGE/sysupgrade.bin = $$(IMAGE/default) | check-size (IMAGE_SIZE)
-  IMAGE/factory.img = $$(IMAGE/default) | netgear-image | check-size 
(IMAGE_SIZE)
-  IMAGE/factory-NA.img = $$(IMAGE/default) | netgear-image NA | check-size 
(IMAGE_SIZE)
+  IMAGE/factory.img = $$(IMAGE/default) | netgear-dni | check-size 
(IMAGE_SIZE)
+  IMAGE/factory-NA.img = $$(IMAGE/default) | netgear-dni NA | check-size 
(IMAGE_SIZE)
 endef
 
 define Device/wndr3700v2
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/7] image: allow exactly KERNEL_SIZE sized kernels

2015-08-21 Thread Jonas Gorski
The KERNEL_SIZE should be the maximum size, inclusive, so we need to
check for greater equal, not just greater.

Signed-off-by: Jonas Gorski 
---
 include/image.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/image.mk b/include/image.mk
index d4ebdef..400dce8 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -392,7 +392,7 @@ define Build/pad-offset
 endef
 
 define Build/check-size
-   @[ $$(($(subst k,* 1024,$(subst m, * 1024k,$(1) -gt "$$(stat -c%s 
$@)" ] || { \
+   @[ $$(($(subst k,* 1024,$(subst m, * 1024k,$(1) -ge "$$(stat -c%s 
$@)" ] || { \
echo "WARNING: Image file $@ is too big" >&2; \
rm -f $@; \
}
@@ -466,7 +466,7 @@ endef
 endif
 
 define Device/Build/check_size
-   @[ $$(($(subst k,* 1024,$(subst m, * 1024k,$(1) -gt "$$(stat -c%s 
$@)" ] || { \
+   @[ $$(($(subst k,* 1024,$(subst m, * 1024k,$(1) -ge "$$(stat -c%s 
$@)" ] || { \
echo "WARNING: Image file $@ is too big" >&2; \
rm -f $@; \
}
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 4/7] ipq806x: add support for retrieving macs from mtd

2015-08-21 Thread Jonas Gorski
Add support for mtd-mac-address for stmac.

Signed-off-by: Jonas Gorski 
---
 ...orm-add-support-for-retreiving-mac-from-m.patch | 35 ++
 ...orm-add-support-for-retreiving-mac-from-m.patch | 35 ++
 2 files changed, 70 insertions(+)
 create mode 100644 
target/linux/ipq806x/patches-3.18/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch

diff --git 
a/target/linux/ipq806x/patches-3.18/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch
 
b/target/linux/ipq806x/patches-3.18/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch
new file mode 100644
index 000..68222ce
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-3.18/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch
@@ -0,0 +1,35 @@
+From 5bf2dabde1fa3af0c9082b42b6847ef3fd198b13 Mon Sep 17 00:00:00 2001
+From: Jonas Gorski 
+Date: Sun, 9 Aug 2015 12:53:55 +0200
+Subject: [PATCH] stmac: platform: add support for retreiving mac from mtd
+
+---
+ drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 10 ++
+ 1 file changed, 10 insertions(+)
+
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
 b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+@@ -284,6 +284,7 @@ static int stmmac_pltfr_probe(struct pla
+   struct stmmac_priv *priv = NULL;
+   struct plat_stmmacenet_data *plat_dat = NULL;
+   const char *mac = NULL;
++  u8 mtd_mac[ETH_ALEN] = { };
+ 
+   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+   addr = devm_ioremap_resource(dev, res);
+@@ -313,6 +314,15 @@ static int stmmac_pltfr_probe(struct pla
+   pr_err("%s: main dt probe failed", __func__);
+   return ret;
+   }
++
++  if (!mac) {
++  ret = of_get_mac_address_mtd(dev->of_node, &mtd_mac);
++  if (ret == -EPROBE_DEFER)
++  return ret;
++
++  if (is_valid_ether_addr(&mtd_mac))
++  mac = mtd_mac;
++  }
+   }
+ 
+   /* Custom setup (if needed) */
diff --git 
a/target/linux/ipq806x/patches-4.1/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch
 
b/target/linux/ipq806x/patches-4.1/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch
new file mode 100644
index 000..84c15c7
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-4.1/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch
@@ -0,0 +1,35 @@
+From 5bf2dabde1fa3af0c9082b42b6847ef3fd198b13 Mon Sep 17 00:00:00 2001
+From: Jonas Gorski 
+Date: Sun, 9 Aug 2015 12:53:55 +0200
+Subject: [PATCH] stmac: platform: add support for retreiving mac from mtd
+
+---
+ drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 10 ++
+ 1 file changed, 10 insertions(+)
+
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
 b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+@@ -302,6 +302,7 @@ static int stmmac_pltfr_probe(struct pla
+   struct stmmac_priv *priv = NULL;
+   struct plat_stmmacenet_data *plat_dat = NULL;
+   const char *mac = NULL;
++  u8 mtd_mac[ETH_ALEN] = { };
+   int irq, wol_irq, lpi_irq;
+ 
+   /* Get IRQ information early to have an ability to ask for deferred
+@@ -362,6 +363,15 @@ static int stmmac_pltfr_probe(struct pla
+   pr_err("%s: main dt probe failed", __func__);
+   return ret;
+   }
++
++  if (!mac) {
++  ret = of_get_mac_address_mtd(dev->of_node, &mtd_mac);
++  if (ret == -EPROBE_DEFER)
++  return ret;
++
++  if (is_valid_ether_addr(&mtd_mac))
++  mac = mtd_mac;
++  }
+   }
+ 
+   /* Custom setup (if needed) */
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 5/7] base-files: allow setting ide-disk led trigger

2015-08-21 Thread Jonas Gorski
Signed-off-by: Jonas Gorski 
---
 package/base-files/files/lib/functions/uci-defaults.sh | 16 
 1 file changed, 16 insertions(+)

diff --git a/package/base-files/files/lib/functions/uci-defaults.sh 
b/package/base-files/files/lib/functions/uci-defaults.sh
index 8ba95a2..2658d43 100644
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -178,6 +178,22 @@ EOF
UCIDEF_LEDS_CHANGED=1
 }
 
+ucidef_set_led_ide_disk() {
+   local cfg="led_$1"
+   local name=$2
+   local sysfs=$3
+
+   uci -q get system.$cfg && return 0
+
+   uci batch 

[OpenWrt-Devel] [PATCH 7/7] ipq806x: add support for Netgear Nighthawk X4 R7500

2015-08-21 Thread Jonas Gorski
Add support for the Netgear Nighthawk X4 R7500 and build
appropariate sysupgrade and factory images.

Known issues:
 * 5 GHz wifi not working - there is no quantenna driver
 * One of the USB ports is not working

Signed-off-by: Jonas Gorski 
---
 .../linux/ipq806x/base-files/etc/uci-defaults/leds |  26 ++
 .../ipq806x/base-files/etc/uci-defaults/network|   3 +-
 target/linux/ipq806x/base-files/lib/ipq806x.sh |   3 +
 .../ipq806x/base-files/lib/upgrade/platform.sh |   3 +-
 target/linux/ipq806x/image/Makefile|  40 ++-
 ...dd-Netgear-Nighthawk-X4-R7500-device-tree.patch | 387 +
 ...dd-Netgear-Nighthawk-X4-R7500-device-tree.patch | 387 +
 target/linux/ipq806x/profiles/netgear.mk   |  20 ++
 8 files changed, 866 insertions(+), 3 deletions(-)
 create mode 100644 target/linux/ipq806x/base-files/etc/uci-defaults/leds
 create mode 100644 
target/linux/ipq806x/patches-3.18/301-ARM-qcom-add-Netgear-Nighthawk-X4-R7500-device-tree.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/301-ARM-qcom-add-Netgear-Nighthawk-X4-R7500-device-tree.patch
 create mode 100644 target/linux/ipq806x/profiles/netgear.mk

diff --git a/target/linux/ipq806x/base-files/etc/uci-defaults/leds 
b/target/linux/ipq806x/base-files/etc/uci-defaults/leds
new file mode 100644
index 000..362c5b6
--- /dev/null
+++ b/target/linux/ipq806x/base-files/etc/uci-defaults/leds
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+
+. /lib/functions/uci-defaults.sh
+. /lib/ipq806x.sh
+
+board=$(ipq806x_board_name)
+
+case "$board" in
+r7500)
+   ucidef_set_led_usbdev "usb1" "USB 1" "r7500:white:usb1" "1-1"
+   ucidef_set_led_usbdev "usb2" "USB 2" "r7500:white:usb3" "3-1"
+   ucidef_set_led_netdev "wan" "WAN" "r7500:white:wan" "eth0"
+   ucidef_set_led_ide_disk "esata" "eSATA" "r7500:amber:esata"
+   ucidef_set_led_default "wps" "WPS" "r7500:white:wps" "0"
+   ucidef_set_led_default "rfkill" "rfkill" "r7500:white:rfkill" "0"
+   ;;
+*)
+   ;;
+esac
+
+ucidef_commit_leds
+
+exit 0
diff --git a/target/linux/ipq806x/base-files/etc/uci-defaults/network 
b/target/linux/ipq806x/base-files/etc/uci-defaults/network
index 354cea9..7742b73 100755
--- a/target/linux/ipq806x/base-files/etc/uci-defaults/network
+++ b/target/linux/ipq806x/base-files/etc/uci-defaults/network
@@ -16,7 +16,8 @@ ucidef_set_interface_loopback
 board=$(ipq806x_board_name)
 
 case "$board" in
-ap148)
+ap148 |\
+r7500)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
ucidef_add_switch "switch0" "1" "1"
ucidef_add_switch_vlan "switch0" "1" "6 1 2 3 4"
diff --git a/target/linux/ipq806x/base-files/lib/ipq806x.sh 
b/target/linux/ipq806x/base-files/lib/ipq806x.sh
index 2790f3f..5b27bde 100644
--- a/target/linux/ipq806x/base-files/lib/ipq806x.sh
+++ b/target/linux/ipq806x/base-files/lib/ipq806x.sh
@@ -20,6 +20,9 @@ ipq806x_board_detect() {
*"DB149")
name="db149"
;;
+   *"R7500")
+   name="r7500"
+   ;;
esac
 
[ -z "$name" ] && name="unknown"
diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh 
b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
index e834ead..75a01b7 100644
--- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
@@ -6,7 +6,8 @@ platform_check_image() {
local board=$(ipq806x_board_name)
 
case "$board" in
-   AP148)
+   AP148 |\
+   r7500)
nand_do_platform_check $board $1
return $?;
;;
diff --git a/target/linux/ipq806x/image/Makefile 
b/target/linux/ipq806x/image/Makefile
index 2fdaab5..8c17bbc 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -10,6 +10,12 @@ KERNEL_LOADADDR := 0x42208000
 
 define Image/Prepare
$(CP) $(LINUX_DIR)/vmlinux $(KDIR)/$(IMG_PREFIX)-vmlinux.elf
+   mkimage -A arm -O linux -T filesystem -C none \
+   -a $(KERNEL_LOADADDR) -e $(KERNEL_LOADADDR) \
+   -n 'ARM OpenWrt fakeroot' \
+   -s $(KDIR_TMP)/root.dummy-uImage.tmp
+   echo -ne '\xff' > $(KDIR_TMP)/root.dummy
+   cat $(KDIR_TMP)/root.dummy $(KDIR_TMP)/root.dummy-uImage.tmp > 
$(KDIR)/root.dummy
 endef
 
 define Image/BuildKernel
@@ -17,6 +23,7 @@ define Image/BuildKernel
 endef
 
 define Image/Build/squashfs
+   cp $(KDIR)/root.squashfs $(KDIR)/root.squashfs-raw
$(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
 endef
 
@@ -29,6 +36,10 @@ define Build/append-dtb
cat $(DTS_DIR)/$(DEVICE_DTS).dtb >> $@
 endef
 
+define Build/append-file
+   cat $(1) >> $@
+endef
+
 define Device/Default
PROFILES := Default
KERNEL_INITRAMFS_PREFIX := $$(IMG_PREFIX)-$(1)-initramfs
@@ -58,6 +69,22 @@ define Device/UbiFit
IMAGE/nand-sysupgrade.tar := sysupgrade-nand
 endef
 
+define De

[OpenWrt-Devel] [PATCH 6/7] ipq806x: enable ide led trigger

2015-08-21 Thread Jonas Gorski
To use gpio leds as ide leds, we need to enable the trigger to be
included in the kernel.

Signed-off-by: Jonas Gorski 
---
 target/linux/ipq806x/config-3.18 | 1 +
 target/linux/ipq806x/config-4.1  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/target/linux/ipq806x/config-3.18 b/target/linux/ipq806x/config-3.18
index 7b4c2d3..cb3dcfc 100644
--- a/target/linux/ipq806x/config-3.18
+++ b/target/linux/ipq806x/config-3.18
@@ -234,6 +234,7 @@ CONFIG_KRAITCC=y
 CONFIG_KRAIT_CLOCKS=y
 CONFIG_KRAIT_L2_ACCESSORS=y
 # CONFIG_LEDS_REGULATOR is not set
+CONFIG_LEDS_TRIGGER_IDE_DISK=y
 CONFIG_LIBFDT=y
 CONFIG_LOCKUP_DETECTOR=y
 CONFIG_LZO_COMPRESS=y
diff --git a/target/linux/ipq806x/config-4.1 b/target/linux/ipq806x/config-4.1
index 6fff6d2..4ead455 100644
--- a/target/linux/ipq806x/config-4.1
+++ b/target/linux/ipq806x/config-4.1
@@ -241,6 +241,7 @@ CONFIG_KPSS_XCC=y
 CONFIG_KRAITCC=y
 CONFIG_KRAIT_CLOCKS=y
 CONFIG_KRAIT_L2_ACCESSORS=y
+CONFIG_LEDS_TRIGGER_IDE_DISK=y
 CONFIG_LIBFDT=y
 CONFIG_LOCKUP_DETECTOR=y
 CONFIG_LOCK_SPIN_ON_OWNER=y
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 2/7] modules: move libahci to kmod-ata-core

2015-08-21 Thread wigyori

2015-07-31 21:32 időpontban Zoltan HERPAI ezt írta:

Daniel Golle wrote:
Newer kernels make use of libahci in ahci-platform, ie. also on 
non-PCI

platforms.
As there is no single config symbol deciding whether libahci.ko is
being built or not it seems the most sensitive thing to package it in
kmod-ata-core.

Signed-off-by: Daniel Golle 
---
  [snip]


We'll discuss this with blogic/Kaloz if they're OK with it.


Hi Daniel,

I've added this in r46701, thanks,

Regards,
-w-
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [musl] SuperH conflict of arch/sh/__set_thread_area vs thread/__set_thread_area

2015-08-21 Thread Christian Lamparter
(Added Openwrt-dev - since this isn't a musl issue)

On Thursday, August 20, 2015 12:21:55 PM Christian Lamparter wrote:
> On Wednesday, August 19, 2015 11:04:02 PM Rich Felker wrote:
> > On Thu, Aug 20, 2015 at 02:44:11AM +0200, Christian Lamparter wrote:
> > > I'm trying to add a port for a SH4-like ARCH to OpenWRT, which uses the 
> > > latest
> > > musl-1.1.10 as the default libc. I'm having the following problem when 
> > > building
> > > the toolchain:
> > > 
> > > During the final linker-step, the symbol "__set_thread_area"  declared 
> > > twice.
> > > This is because the SH architecture provides a separate __set_thread_area 
> > > [0],
> > > (other archs use the standard syscall wrapper from [1]).
> > > 
> > > Obviously, I want this issue fixed. However I'm new to SuperH and musl, 
> > > that's
> > > why I need advise :-D. For now, I defined the 
> > > src/thread/__set_thread_area as
> > > a weak symbol. Now, that's just a crude hack, what would be better 
> > > solution?
> > > (I can make and post the patch if necessary - But sadly, I can't test it 
> > > on the
> > > hardware yet)?
> > 
> > Bobby Bingham's reply explains what the issue is. Did you make a new
> > arch name rather than using the existing sh arch for your port? 
> Initially, yes I did. I had the ARCH at "sh4". This was because OpenWRT 
> already had infrastructure for some sh-(sub)targets (sh3, sh3eb, sh4, sh4eb)
> in place. But they seem to be unused and untested. The only target which has
> support for SuperH is UserModeLinux. However, it will probably run into the
> same issue.
> 
> Now, I've changed ARCH to "sh" and set the CPU_TYPE to sh4 [toolchain
> dir changed to toolchain-sh_sh4_gcc-5.2.0_musl-1.1.10]. But still no 
> luck, the original error code remains the same.
> 
> src/thread/__set_thread_area.lo: In function `__set_thread_area':
> __set_thread_area.c:(.text+0x0): multiple definition of `__set_thread_area'
> arch/sh/src/__set_thread_area.lo:__set_thread_area.c:(.text+0x0): first 
> defined here
> collect2: error: ld returned 1 exit status
> Makefile:142: recipe for target 'lib/libc.so' failed

Ok, I have a update and I fixed this issue with __set_thread_area.s.
The reason why this didn't work and was harder to debug than usual is
because of the involvement of the "patch" utility with the -E flag
(--remove-empty-files).

Openwrt adds a number of patches to the musl-1.1.10.tar.gz [0] (actually
they seem to be cherry-picked from musl git). Now, one of the patches 
"001-git-2015-07-22.patch" contains:

commit f9d84554bae0fa17c9a1d724549c440808a5 [1]
Author: Rich Felker 
Date:   Tue Jun 16 14:28:30 2015 +

add support for sh2 interrupt-masking-based atomics to sh port
 
This commit reduces the "src/thread/sh/__set_thread_area.s" to an empty
file (but it doesn't remove it). But due to bad luck, the script that
patches the file [2] (it's called patch-kernel.sh, but it's used to patch
the toolchain as well) uses the pesky "-E" flag (line 40):
 [...] ${PATCH:-patch} -f -p1 -E -d ${targetdir} 
  ^^

==> And that's why the __set_thread_area.s file disappears.

I came up with two possible fixes for OpenWRT, unless you want to
fix this in musl (via non-empty __set_thread_area) instead: 

1. have some content in __set_thread_area.s to prevent it from being
   removed.

---

--- a/src/thread/sh/__set_thread_area.s
+++ b/src/thread/sh/__set_thread_area.s
@@ -0,0 +1,1 @@
+/* the patch utility might remove empty files */

---


2. patch patch-kernel.sh

---
--- a/scripts/patch-kernel.sh
+++ b/scripts/patch-kernel.sh
@@ -37,7 +37,7 @@ for i in ${patchdir}/${patchpattern} ; do
 [ -d "${i}" ] && echo "Ignoring subdirectory ${i}" && continue 
 echo ""
 echo "Applying ${i} using ${type}: " 
-${uncomp} ${i} | ${PATCH:-patch} -f -p1 -E -d ${targetdir} 
+${uncomp} ${i} | ${PATCH:-patch} -f -p1 -d ${targetdir}
 if [ $? != 0 ] ; then
 echo "Patch failed!  Please fix $i!"
exit 1

---

Does anyone have any preferences? I'm opting for "patch patch-kernel"
(and I will send a proper patch next week to OpenWRT even if no one
cares now :-D ) 

Regards,
Christian

[0] 
[1] 

[2] 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 1/1] [kernel] Fix kmod-v4l2 modules have missing symbols due to lack of clk support

2015-08-21 Thread Hauke Mehrtens


On 08/20/2015 01:30 AM, Daniel Dickinson wrote:
> Your patch resolves the issue of compiling - I have not yet tested the
> functionality of the resulting v4l module.  I suspect the disadvantage
> of this patch is that it will silently fail to work for the types of
> devices (DV primarily) that depend on clock support whereas my patch
> omits building code/modules for devices that depend on clock support a
> kernel config option that prevents building useless modules (although I
> realized the DV_SUPPORT should depend on CLK_COMMON since that's the
> whole reason for making that a config option) and (and of course
> #ifdef's out the code and dependencies on clk support when it's not
> present).
> 
> Regards,
> 
> Daniel

Hi Daniel,

I do not know if they will still work, but if some driver has to change
some clock of the SoC and the SoC does not support this it should fail.
The problem not only exist with ar71xx, but with all SoC in the mainline
kernel, so I assume that this is already handled. If we return the wrong
number in the ar71xx code it should be changed, different SoC code
returned different values in the same cases so I was unsure.

Have you experienced any runtime problems with the clocks with the
current trunk version?

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


Re: [OpenWrt-Devel] [PATCH 1/1] [kernel] Fix kmod-v4l2 modules have missing symbols due to lack of clk support

2015-08-21 Thread Hauke Mehrtens


On 08/20/2015 01:30 AM, Daniel Dickinson wrote:
> Your patch resolves the issue of compiling - I have not yet tested the
> functionality of the resulting v4l module.  I suspect the disadvantage
> of this patch is that it will silently fail to work for the types of
> devices (DV primarily) that depend on clock support whereas my patch
> omits building code/modules for devices that depend on clock support a
> kernel config option that prevents building useless modules (although I
> realized the DV_SUPPORT should depend on CLK_COMMON since that's the
> whole reason for making that a config option) and (and of course
> #ifdef's out the code and dependencies on clk support when it's not
> present).
> 
> Regards,
> 
> Daniel

Hi Daniel,

I do not know if they will still work, but if some driver has to change
some clock of the SoC and the SoC does not support this it should fail.
The problem not only exist with ar71xx, but with all SoC in the mainline
kernel, so I assume that this is already handled. If we return the wrong
number in the ar71xx code it should be changed, different SoC code
returned different values in the same cases so I was unsure.

Have you experienced any runtime problems with the clocks with the
current trunk version?

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


Re: [OpenWrt-Devel] [PATCH 6/6] bcm53xx: R8000 handle PEX8603 switch

2015-08-21 Thread Hauke Mehrtens


On 08/16/2015 06:19 AM, Ian Kent wrote:
> On Tue, 2015-06-23 at 07:58 +0800, Ian Kent wrote:
>> On Mon, 2015-06-22 at 18:42 +0200, Hauke Mehrtens wrote:
>>>
>>> On 03/10/2015 04:30 AM, Ian Kent wrote:
 The Netgear R8000 has a PEX8603 connected to the BCM53012 and if
 it isn't configured during the bus scan the PCI layer goes crazy
 trying to configure phantom devices.
>>>
>>> Could you provide some diagram how this is connected?
>>
>> I could try, when I get a chance, ascii art isn't my strong suit.
>>
>>>
>>> My current assumption is that on one of the 3 PCIe ports is this switch,
>>> so the scan will find this switch as a PCIe device, bu how does it go
>>> from there?
>>
>> I can only infer from looking at sysfs, which is what I have done.
>>
>> Perhaps I'm not correct but it looks to me that there are is a BCM53012
>> connected with two legs, one has one wireless device, and the other has
>> a PEX8603 bridge which has two legs, each with a wireless device.
>>
>>> From the vendor driver I would assume that that the two devices behind
>>> the switch are device function 0x08 and 0x10 on the switch device.
>>
>> I'll have to reacquaint myself with the code before I respond to the
>> comments below, its been a while.
>>  
>>>
>>> Can you also post the output of lspci on your device?
>>
>> Don't think I have lspci in the build I was using, I'll need to add it
>> and rebuild. That probably won't be until the weekend.
> 
> OK, I've been able get a build.

I think we do not get this into OpenWrt CC any more. You should probably
base your work on top of the new PCIe host driver in the trunk used with
kernel 4.1.

Will you send a new Version or should I look into this?

> My updated patch doesn't yet function so I've used the driver we're
> discussing here to get info.
> 
> TBH, looking at this, I'm not so sure the patch is wrong now.
> 
> lspci gives:
> :00:00.0 PCI bridge: Broadcom Corporation Device 8012 (rev 01)
> :01:00.0 Network controller: Broadcom Corporation Device aa52 (rev 01)
> 0001:00:00.0 PCI bridge: Broadcom Corporation Device 8012 (rev 01)
> 0001:01:00.0 PCI bridge: PLX Technology, Inc. Device 8603 (rev ab)
> 0001:02:01.0 PCI bridge: PLX Technology, Inc. Device 8603 (rev ab)
> 0001:02:02.0 PCI bridge: PLX Technology, Inc. Device 8603 (rev ab)
> 0001:03:00.0 Network controller: Broadcom Corporation Device aa52 (rev 01)
> 0001:04:00.0 Network controller: Broadcom Corporation Device aa52 (rev 01)
> 
> and a list of /sys/bus/pci/devices on a Vendor firmware install gives:
> :00:00.0  :00:06.0  :00:0b.1  :00:11.0  0002:01:00.0
> :00:01.0  :00:07.0  :00:0c.0  :00:12.0  0002:02:01.0
> :00:02.0  :00:08.0  :00:0d.0  :00:13.0  0002:02:02.0
> :00:03.0  :00:09.0  :00:0e.0  0001:00:00.0  0002:03:00.0
> :00:04.0  :00:0a.0  :00:0f.0  0001:01:00.0  0002:04:00.0
> :00:05.0  :00:0b.0  :00:10.0  0002:00:00.0

Thanks for these information.
Without your patch the PCI subsystem will find lots of strange devices
and will report broken data and does not only show nothing, is that
correct?

> which looks like the topology is the same.
> 
> So, possibly, my description of how I believe the devices are connected
> is accurate.
> 
>   bcm8012
>
>|  |
>   aa52 pex8603
>---
>| |
>   aa52  aa52
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel