Re: [OpenWrt-Devel] Build error for IPQ806X

2016-02-09 Thread Tathagata Das
I am still facing same issue whenever compiling latest trunk with D7800 is
selected. When this issue will be fixed?

Regards,
Tathagata


-Original Message-
From: Tathagata Das [mailto:tathag...@alumnux.com] 
Sent: 28 January 2016 15:51
To: openwrt-devel@lists.openwrt.org
Subject: RE: Build error for IPQ806X

I have further debugged it and noticed that if CONFIG_PACKAGE_kmod-ath10k is
selected then only I am getting this error.
Also selecting D7800 doesn't select wireless drivers automatically.

Regards,
Tathagata


-Original Message-
From: Tathagata Das [mailto:tathag...@alumnux.com] 
Sent: 28 January 2016 12:29
To: openwrt-devel@lists.openwrt.org
Subject: Build error for IPQ806X

Hello,

I am getting build error while compiling latest OpenWRT trunk for IPQ806x.
Below is the error message.

Inconsistent kallsyms data
Try make KALLSYMS_EXTRA_PASS=1 as a workaround
make[4]: *** [vmlinux] Error 1

Regards,
Tathagata
---
Alumnus Software Ltd
Infinity, Tower-II, 2nd Floor,
Plot A3, Block GP, Sector V
Salt Lake City
Kolkata 700091
Phone : +91-33-23575626, +91-33-23575627, +91-33-23575628
 +91-33-23571036,+91-33-23571037, +91-33-23571038,
 +91-33-23571039 
Fax : +91-33-23575268
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Build error for IPQ806X

2016-01-28 Thread Tathagata Das
I have further debugged it and noticed that if CONFIG_PACKAGE_kmod-ath10k is
selected then only I am getting this error.
Also selecting D7800 doesn't select wireless drivers automatically.

Regards,
Tathagata


-Original Message-
From: Tathagata Das [mailto:tathag...@alumnux.com] 
Sent: 28 January 2016 12:29
To: openwrt-devel@lists.openwrt.org
Subject: Build error for IPQ806X

Hello,

I am getting build error while compiling latest OpenWRT trunk for IPQ806x.
Below is the error message.

Inconsistent kallsyms data
Try make KALLSYMS_EXTRA_PASS=1 as a workaround
make[4]: *** [vmlinux] Error 1

Regards,
Tathagata
---
Alumnus Software Ltd
Infinity, Tower-II, 2nd Floor,
Plot A3, Block GP, Sector V
Salt Lake City
Kolkata 700091
Phone : +91-33-23575626, +91-33-23575627, +91-33-23575628
 +91-33-23571036,+91-33-23571037, +91-33-23571038,
 +91-33-23571039 
Fax : +91-33-23575268
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Build error for IPQ806X

2016-01-27 Thread Tathagata Das
Hello,

I am getting build error while compiling latest OpenWRT trunk for IPQ806x.
Below is the error message.

Inconsistent kallsyms data
Try make KALLSYMS_EXTRA_PASS=1 as a workaround
make[4]: *** [vmlinux] Error 1

Regards,
Tathagata
---
Alumnus Software Ltd
Infinity, Tower-II, 2nd Floor,
Plot A3, Block GP, Sector V
Salt Lake City
Kolkata 700091
Phone : +91-33-23575626, +91-33-23575627, +91-33-23575628
 +91-33-23571036,+91-33-23571037, +91-33-23571038,
 +91-33-23571039 
Fax : +91-33-23575268
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Add support for Netgear D7800

2016-01-19 Thread Tathagata Das
Hi John,

Thank you for your help.

Please let me know your changes so that next time I can do that myself.

Regards,
Tathagata


-Original Message-
From: John Crispin [mailto:blo...@openwrt.org] 
Sent: 19 January 2016 14:31
To: Tathagata Das; openwrt-devel@lists.openwrt.org
Subject: Re: [OpenWrt-Devel] [PATCH] Add support for Netgear D7800

Hi,

i applied this now and made some formal changes. next time please add a
proper subject prefix and description.

John

On 19/01/2016 09:57, Tathagata Das wrote:
> Signed-off-by: Tathagata Das 
> ---
>  .../linux/ipq806x/base-files/etc/board.d/01_leds   |   1 +
>  .../ipq806x/base-files/etc/board.d/02_network  |   1 +
>  target/linux/ipq806x/base-files/lib/ipq806x.sh |   3 +
>  .../ipq806x/base-files/lib/upgrade/platform.sh |   2 +
>  target/linux/ipq806x/image/Makefile|  13 +-
>  ...dd-Netgear-Nighthawk-X4-D7800-device-tree.patch | 381
+
>  target/linux/ipq806x/profiles/netgear.mk   |  13 +
>  7 files changed, 413 insertions(+), 1 deletion(-)  create mode 100644 
> target/linux/ipq806x/patches-3.18/801-ARM-qcom-add-Netgear-Nighthawk-X
> 4-D7800-device-tree.patch
> 
> diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds 
> b/target/linux/ipq806x/base-files/etc/board.d/01_leds
> index 07b5b06..b32c1cc 100755
> --- a/target/linux/ipq806x/base-files/etc/board.d/01_leds
> +++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds
> @@ -11,6 +11,7 @@ board_config_update
>  board=$(ipq806x_board_name)
>  
>  case "$board" in
> +d7800 |\
>  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"
> diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network 
> b/target/linux/ipq806x/base-files/etc/board.d/02_network
> index 1302a55..6e18297 100755
> --- a/target/linux/ipq806x/base-files/etc/board.d/02_network
> +++ b/target/linux/ipq806x/base-files/etc/board.d/02_network
> @@ -13,6 +13,7 @@ board=$(ipq806x_board_name)
>  
>  case "$board" in
>  ap148 |\
> +d7800 |\
>  r7500)
>   ucidef_add_switch "switch0" \
>   "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
> diff --git a/target/linux/ipq806x/base-files/lib/ipq806x.sh 
> b/target/linux/ipq806x/base-files/lib/ipq806x.sh
> index 5b27bde..db22708 100644
> --- a/target/linux/ipq806x/base-files/lib/ipq806x.sh
> +++ b/target/linux/ipq806x/base-files/lib/ipq806x.sh
> @@ -17,6 +17,9 @@ ipq806x_board_detect() {
>   *"AP148")
>   name="ap148"
>   ;;
> + *"D7800")
> + name="d7800"
> + ;;
>   *"DB149")
>   name="db149"
>   ;;
> diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh 
> b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
> index 7fcf246..542b5ce 100644
> --- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
> @@ -7,6 +7,7 @@ platform_check_image() {
>  
>   case "$board" in
>   ap148 |\
> + d7800 |\
>   r7500)
>   nand_do_platform_check $board $1
>   return $?;
> @@ -21,6 +22,7 @@ platform_pre_upgrade() {
>  
>   case "$board" in
>   ap148 |\
> + d7800 |\
>   r7500)
>   nand_do_upgrade "$1"
>   ;;
> diff --git a/target/linux/ipq806x/image/Makefile 
> b/target/linux/ipq806x/image/Makefile
> index 58c4e1e..ff8b2c7 100644
> --- a/target/linux/ipq806x/image/Makefile
> +++ b/target/linux/ipq806x/image/Makefile
> @@ -104,6 +104,17 @@ define Device/AP148-legacy
>   BOARD_NAME := ap148
>  endef
>  
> +define Device/D7800
> + $(call Device/DniImage)
> + DEVICE_DTS := qcom-ipq8064-d7800
> + KERNEL_SIZE := 2097152
> + NETGEAR_BOARD_ID := D7800
> + NETGEAR_HW_ID := 29764958+0+128+512+4x4+4x4
> + BLOCKSIZE := 128KiB
> + PAGESIZE := 2048
> + BOARD_NAME := d7800
> +endef
> +
>  define Device/DB149
>   $(call Device/FitImage)
>   DEVICE_DTS := qcom-ipq8064-db149
> @@ -122,6 +133,6 @@ define Device/R7500
>   BOARD_NAME := r7500
>  endef
>  
> -TARGET_DEVICES += AP148 AP148-legacy DB149 R7500
> +TARGET_DEVICES += AP148 AP148-legacy D7800 DB149 R7500
>  
>  $(eval $(call BuildImage))
> diff --git 
> a/target/linux/ipq806x/patches-3.18/801-ARM-

Re: [OpenWrt-Devel] [PATCH] Add support for Netgear D7800

2016-01-19 Thread Tathagata Das
Done -- just prepared and sent it again.

Regards,
Tathagata


-Original Message-
From: John Crispin [mailto:blo...@openwrt.org] 
Sent: 19 January 2016 14:13
To: Tathagata Das; openwrt-devel@lists.openwrt.org
Subject: Re: [OpenWrt-Devel] [PATCH] Add support for Netgear D7800

please do that.

On 19/01/2016 09:38, Tathagata Das wrote:
> Do you mean to say that I have to prepare the patch against latest 
> code of trunk and send that it again?
> 
> Regards,
> Tathagata
> 
> 
> -Original Message-
> From: John Crispin [mailto:blo...@openwrt.org]
> Sent: 19 January 2016 14:07
> To: Tathagata Das; openwrt-devel@lists.openwrt.org
> Subject: Re: [OpenWrt-Devel] [PATCH] Add support for Netgear D7800
> 
> you patch collides with f177c2c2f956c938045bd53943e3f1c090b5db2b so 
> you will have to rebase/send it.
> 
> 
> 
> On 19/01/2016 09:26, Tathagata Das wrote:
>> Hi John,
>>
>> I sent the patch last time using git command and I even received an 
>> email from OpenWRT on 12th January 2016.
>>
>> Regards,
>> Tathagata
>>
>>
>> -Original Message-
>> From: John Crispin [mailto:blo...@openwrt.org]
>> Sent: 19 January 2016 13:45
>> To: Tathagata Das; openwrt-devel@lists.openwrt.org
>> Subject: Re: [OpenWrt-Devel] [PATCH] Add support for Netgear D7800
>>
>> same as before, we are waiting on you to send a version that applies.
>>
>>
>> patchwork 566597
>> --2016-01-17 06:23:22--
>> http://patchwork.ozlabs.org/patch/566597/mbox/
>> Resolving patchwork.ozlabs.org (patchwork.ozlabs.org)... 
>> 103.22.144.67 Connecting to patchwork.ozlabs.org 
>> (patchwork.ozlabs.org)|103.22.144.67|:80... connected.
>> HTTP request sent, awaiting response... 200 OK
>> Length: unspecified [text/plain]
>> Saving to: `566597.patch'
>>
>> [ <=>
>>] 12,864  --.-K/s   in 0s
>>
>> 2016-01-17 06:23:24 (115 MB/s) - `566597.patch' saved [12864]
>>
>> Applying: Add support for Netgear D7800 Using index info to 
>> reconstruct a base tree...
>> :109: space before tab in indent.
>>  qcom-ipq8064-ap148.dtb \
>> :110: space before tab in indent.
>>  qcom-ipq8064-db149.dtb \
>> :111: space before tab in indent.
>>  qcom-ipq8064-r7500.dtb \
>> :113: space before tab in indent.
>>  qcom-msm8660-surf.dtb \
>> :114: space before tab in indent.
>>  qcom-msm8960-cdp.dtb \
>> warning: squelched 1 whitespace error
>> warning: 6 lines add whitespace errors.
>> Falling back to patching base and 3-way merge...
>> Auto-merging target/linux/ipq806x/image/Makefile
>> Auto-merging target/linux/ipq806x/base-files/lib/upgrade/platform.sh
>> CONFLICT (content): Merge conflict in 
>> target/linux/ipq806x/base-files/lib/upgrade/platform.sh
>> Failed to merge in the changes.
>> Patch failed at 0001 Add support for Netgear D7800 When you have 
>> resolved this problem run "git am --resolved".
>> If you would prefer to skip this patch, instead run "git am --skip".
>> To restore the original branch and stop patching run "git am --abort".
>> Unstaged changes after reset:
>> Mtarget/linux/ipq806x/base-files/etc/board.d/01_leds
>> Mtarget/linux/ipq806x/base-files/etc/board.d/02_network
>> Mtarget/linux/ipq806x/base-files/lib/ipq806x.sh
>> Mtarget/linux/ipq806x/base-files/lib/upgrade/platform.sh
>> Mtarget/linux/ipq806x/image/Makefile
>> Mtarget/linux/ipq806x/profiles/netgear.mk
>> applying 566597 FAILED
>>
>>
>> patchwork 569813
>> --2016-01-17 06:22:13--
>> http://patchwork.ozlabs.org/patch/569813/mbox/
>> Resolving patchwork.ozlabs.org (patchwork.ozlabs.org)... 
>> 103.22.144.67 Connecting to patchwork.ozlabs.org 
>> (patchwork.ozlabs.org)|103.22.144.67|:80... connected.
>> HTTP request sent, awaiting response... 200 OK
>> Length: unspecified [text/plain]
>> Saving to: `569813.patch'
>>
>> [ <=>
>>] 13,088  --.-K/s   in 0s
>>
>> 2016-01-17 06:22:14 (172 MB/s) - `569813.patch' saved [13088]
>>
>> Applying: Add support for Netgear D7800
>> fatal: patch fragment without header at line 130: @@ -0,0 +1,381 @@ 
>> Repository lacks necessary blobs to fall back on 3-way merge.
>> Cannot fall back to three-way merge.
>> Patch failed at 0001 Add support for Netgear D7800 When you have 
>> resolved this problem run "git am --resolved".
>> If you would prefer to skip this patch, instead run "git am --skip".

[OpenWrt-Devel] [PATCH] Add support for Netgear D7800

2016-01-19 Thread Tathagata Das
Signed-off-by: Tathagata Das 
---
 .../linux/ipq806x/base-files/etc/board.d/01_leds   |   1 +
 .../ipq806x/base-files/etc/board.d/02_network  |   1 +
 target/linux/ipq806x/base-files/lib/ipq806x.sh |   3 +
 .../ipq806x/base-files/lib/upgrade/platform.sh |   2 +
 target/linux/ipq806x/image/Makefile|  13 +-
 ...dd-Netgear-Nighthawk-X4-D7800-device-tree.patch | 381 +
 target/linux/ipq806x/profiles/netgear.mk   |  13 +
 7 files changed, 413 insertions(+), 1 deletion(-)
 create mode 100644 
target/linux/ipq806x/patches-3.18/801-ARM-qcom-add-Netgear-Nighthawk-X4-D7800-device-tree.patch

diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds 
b/target/linux/ipq806x/base-files/etc/board.d/01_leds
index 07b5b06..b32c1cc 100755
--- a/target/linux/ipq806x/base-files/etc/board.d/01_leds
+++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds
@@ -11,6 +11,7 @@ board_config_update
 board=$(ipq806x_board_name)
 
 case "$board" in
+d7800 |\
 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"
diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network 
b/target/linux/ipq806x/base-files/etc/board.d/02_network
index 1302a55..6e18297 100755
--- a/target/linux/ipq806x/base-files/etc/board.d/02_network
+++ b/target/linux/ipq806x/base-files/etc/board.d/02_network
@@ -13,6 +13,7 @@ board=$(ipq806x_board_name)
 
 case "$board" in
 ap148 |\
+d7800 |\
 r7500)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
diff --git a/target/linux/ipq806x/base-files/lib/ipq806x.sh 
b/target/linux/ipq806x/base-files/lib/ipq806x.sh
index 5b27bde..db22708 100644
--- a/target/linux/ipq806x/base-files/lib/ipq806x.sh
+++ b/target/linux/ipq806x/base-files/lib/ipq806x.sh
@@ -17,6 +17,9 @@ ipq806x_board_detect() {
*"AP148")
name="ap148"
;;
+   *"D7800")
+   name="d7800"
+   ;;
*"DB149")
name="db149"
;;
diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh 
b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
index 7fcf246..542b5ce 100644
--- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
@@ -7,6 +7,7 @@ platform_check_image() {
 
case "$board" in
ap148 |\
+   d7800 |\
r7500)
nand_do_platform_check $board $1
return $?;
@@ -21,6 +22,7 @@ platform_pre_upgrade() {
 
case "$board" in
ap148 |\
+   d7800 |\
r7500)
nand_do_upgrade "$1"
;;
diff --git a/target/linux/ipq806x/image/Makefile 
b/target/linux/ipq806x/image/Makefile
index 58c4e1e..ff8b2c7 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -104,6 +104,17 @@ define Device/AP148-legacy
BOARD_NAME := ap148
 endef
 
+define Device/D7800
+   $(call Device/DniImage)
+   DEVICE_DTS := qcom-ipq8064-d7800
+   KERNEL_SIZE := 2097152
+   NETGEAR_BOARD_ID := D7800
+   NETGEAR_HW_ID := 29764958+0+128+512+4x4+4x4
+   BLOCKSIZE := 128KiB
+   PAGESIZE := 2048
+   BOARD_NAME := d7800
+endef
+
 define Device/DB149
$(call Device/FitImage)
DEVICE_DTS := qcom-ipq8064-db149
@@ -122,6 +133,6 @@ define Device/R7500
BOARD_NAME := r7500
 endef
 
-TARGET_DEVICES += AP148 AP148-legacy DB149 R7500
+TARGET_DEVICES += AP148 AP148-legacy D7800 DB149 R7500
 
 $(eval $(call BuildImage))
diff --git 
a/target/linux/ipq806x/patches-3.18/801-ARM-qcom-add-Netgear-Nighthawk-X4-D7800-device-tree.patch
 
b/target/linux/ipq806x/patches-3.18/801-ARM-qcom-add-Netgear-Nighthawk-X4-D7800-device-tree.patch
new file mode 100644
index 000..ecc1cff
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-3.18/801-ARM-qcom-add-Netgear-Nighthawk-X4-D7800-device-tree.patch
@@ -0,0 +1,381 @@
+--- a/arch/arm/boot/dts/Makefile   2015-09-22 18:30:09.033530282 +0530
 b/arch/arm/boot/dts/Makefile   2015-09-23 17:06:44.892947581 +0530
+@@ -362,6 +362,7 @@
+   qcom-ipq8064-ap148.dtb \
+   qcom-ipq8064-db149.dtb \
+   qcom-ipq8064-r7500.dtb \
++  qcom-ipq8064-d7800.dtb \
+   qcom-msm8660-surf.dtb \
+   qcom-msm8960-cdp.dtb \
+   qcom-msm8974-sony-xperia-honami.dtb
+--- a/arch/arm/boot/dts/qcom-ipq8064-d7800.dts 1970-01-01 05:30:00.0 
+0530
 b/arch/arm/boot/dts/qcom-ipq8064-d7800.dts 2015-09-23 17:06:45.336947567 
+0530
+@@ -0,0 +1,368 @@
++#include "qcom-ipq8064-v1.0.dtsi"
++
++#include 
+

Re: [OpenWrt-Devel] [PATCH] Add support for Netgear D7800

2016-01-19 Thread Tathagata Das
Do you mean to say that I have to prepare the patch against latest code of
trunk and send that it again?

Regards,
Tathagata


-Original Message-
From: John Crispin [mailto:blo...@openwrt.org] 
Sent: 19 January 2016 14:07
To: Tathagata Das; openwrt-devel@lists.openwrt.org
Subject: Re: [OpenWrt-Devel] [PATCH] Add support for Netgear D7800

you patch collides with f177c2c2f956c938045bd53943e3f1c090b5db2b so you will
have to rebase/send it.



On 19/01/2016 09:26, Tathagata Das wrote:
> Hi John,
> 
> I sent the patch last time using git command and I even received an 
> email from OpenWRT on 12th January 2016.
> 
> Regards,
> Tathagata
> 
> 
> -Original Message-
> From: John Crispin [mailto:blo...@openwrt.org]
> Sent: 19 January 2016 13:45
> To: Tathagata Das; openwrt-devel@lists.openwrt.org
> Subject: Re: [OpenWrt-Devel] [PATCH] Add support for Netgear D7800
> 
> same as before, we are waiting on you to send a version that applies.
> 
> 
> patchwork 566597
> --2016-01-17 06:23:22--  
> http://patchwork.ozlabs.org/patch/566597/mbox/
> Resolving patchwork.ozlabs.org (patchwork.ozlabs.org)... 103.22.144.67 
> Connecting to patchwork.ozlabs.org 
> (patchwork.ozlabs.org)|103.22.144.67|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: unspecified [text/plain]
> Saving to: `566597.patch'
> 
> [ <=>
>] 12,864  --.-K/s   in 0s
> 
> 2016-01-17 06:23:24 (115 MB/s) - `566597.patch' saved [12864]
> 
> Applying: Add support for Netgear D7800 Using index info to 
> reconstruct a base tree...
> :109: space before tab in indent.
>   qcom-ipq8064-ap148.dtb \
> :110: space before tab in indent.
>   qcom-ipq8064-db149.dtb \
> :111: space before tab in indent.
>   qcom-ipq8064-r7500.dtb \
> :113: space before tab in indent.
>   qcom-msm8660-surf.dtb \
> :114: space before tab in indent.
>   qcom-msm8960-cdp.dtb \
> warning: squelched 1 whitespace error
> warning: 6 lines add whitespace errors.
> Falling back to patching base and 3-way merge...
> Auto-merging target/linux/ipq806x/image/Makefile
> Auto-merging target/linux/ipq806x/base-files/lib/upgrade/platform.sh
> CONFLICT (content): Merge conflict in
> target/linux/ipq806x/base-files/lib/upgrade/platform.sh
> Failed to merge in the changes.
> Patch failed at 0001 Add support for Netgear D7800 When you have 
> resolved this problem run "git am --resolved".
> If you would prefer to skip this patch, instead run "git am --skip".
> To restore the original branch and stop patching run "git am --abort".
> Unstaged changes after reset:
> M target/linux/ipq806x/base-files/etc/board.d/01_leds
> M target/linux/ipq806x/base-files/etc/board.d/02_network
> M target/linux/ipq806x/base-files/lib/ipq806x.sh
> M target/linux/ipq806x/base-files/lib/upgrade/platform.sh
> M target/linux/ipq806x/image/Makefile
> M target/linux/ipq806x/profiles/netgear.mk
> applying 566597 FAILED
> 
> 
> patchwork 569813
> --2016-01-17 06:22:13--  
> http://patchwork.ozlabs.org/patch/569813/mbox/
> Resolving patchwork.ozlabs.org (patchwork.ozlabs.org)... 103.22.144.67 
> Connecting to patchwork.ozlabs.org 
> (patchwork.ozlabs.org)|103.22.144.67|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: unspecified [text/plain]
> Saving to: `569813.patch'
> 
> [ <=>
>] 13,088  --.-K/s   in 0s
> 
> 2016-01-17 06:22:14 (172 MB/s) - `569813.patch' saved [13088]
> 
> Applying: Add support for Netgear D7800
> fatal: patch fragment without header at line 130: @@ -0,0 +1,381 @@ 
> Repository lacks necessary blobs to fall back on 3-way merge.
> Cannot fall back to three-way merge.
> Patch failed at 0001 Add support for Netgear D7800 When you have 
> resolved this problem run "git am --resolved".
> If you would prefer to skip this patch, instead run "git am --skip".
> To restore the original branch and stop patching run "git am --abort".
> applying 569813 FAILED
> 
> 
> 
> 
> On 19/01/2016 07:19, Tathagata Das wrote:
>> Any update about the patch?
>>
>> Regards,
>> Tathagata
>>
>>
>> -Original Message-
>> From: Tathagata Das [mailto:tathag...@alumnux.com]
>> Sent: 12 January 2016 20:47
>> To: openwrt-devel@lists.openwrt.org
>> Cc: Tathagata Das
>> Subject: [PATCH] Add support for Netgear D7800
>>
>> Signed-off-by: Tathagata Das 
>> ---
>>  .../linux/ipq806x/base-files/etc/board.d/01_leds   |   1 +
>>  .../ipq806x/base-files/etc/board.d/02_network  |   1 +
>>  target/linux/

Re: [OpenWrt-Devel] [PATCH] Add support for Netgear D7800

2016-01-19 Thread Tathagata Das
Hi John,

I sent the patch last time using git command and I even received an email
from OpenWRT on 12th January 2016.

Regards,
Tathagata


-Original Message-
From: John Crispin [mailto:blo...@openwrt.org] 
Sent: 19 January 2016 13:45
To: Tathagata Das; openwrt-devel@lists.openwrt.org
Subject: Re: [OpenWrt-Devel] [PATCH] Add support for Netgear D7800

same as before, we are waiting on you to send a version that applies.


patchwork 566597
--2016-01-17 06:23:22--  http://patchwork.ozlabs.org/patch/566597/mbox/
Resolving patchwork.ozlabs.org (patchwork.ozlabs.org)... 103.22.144.67
Connecting to patchwork.ozlabs.org
(patchwork.ozlabs.org)|103.22.144.67|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]
Saving to: `566597.patch'

[ <=>
   ] 12,864  --.-K/s   in 0s

2016-01-17 06:23:24 (115 MB/s) - `566597.patch' saved [12864]

Applying: Add support for Netgear D7800
Using index info to reconstruct a base tree...
:109: space before tab in indent.
qcom-ipq8064-ap148.dtb \
:110: space before tab in indent.
qcom-ipq8064-db149.dtb \
:111: space before tab in indent.
qcom-ipq8064-r7500.dtb \
:113: space before tab in indent.
qcom-msm8660-surf.dtb \
:114: space before tab in indent.
qcom-msm8960-cdp.dtb \
warning: squelched 1 whitespace error
warning: 6 lines add whitespace errors.
Falling back to patching base and 3-way merge...
Auto-merging target/linux/ipq806x/image/Makefile
Auto-merging target/linux/ipq806x/base-files/lib/upgrade/platform.sh
CONFLICT (content): Merge conflict in
target/linux/ipq806x/base-files/lib/upgrade/platform.sh
Failed to merge in the changes.
Patch failed at 0001 Add support for Netgear D7800 When you have resolved
this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".
Unstaged changes after reset:
M   target/linux/ipq806x/base-files/etc/board.d/01_leds
M   target/linux/ipq806x/base-files/etc/board.d/02_network
M   target/linux/ipq806x/base-files/lib/ipq806x.sh
M   target/linux/ipq806x/base-files/lib/upgrade/platform.sh
M   target/linux/ipq806x/image/Makefile
M   target/linux/ipq806x/profiles/netgear.mk
applying 566597 FAILED


patchwork 569813
--2016-01-17 06:22:13--  http://patchwork.ozlabs.org/patch/569813/mbox/
Resolving patchwork.ozlabs.org (patchwork.ozlabs.org)... 103.22.144.67
Connecting to patchwork.ozlabs.org
(patchwork.ozlabs.org)|103.22.144.67|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]
Saving to: `569813.patch'

[ <=>
   ] 13,088  --.-K/s   in 0s

2016-01-17 06:22:14 (172 MB/s) - `569813.patch' saved [13088]

Applying: Add support for Netgear D7800
fatal: patch fragment without header at line 130: @@ -0,0 +1,381 @@
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 Add support for Netgear D7800 When you have resolved
this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".
applying 569813 FAILED




On 19/01/2016 07:19, Tathagata Das wrote:
> Any update about the patch?
> 
> Regards,
> Tathagata
> 
> 
> -Original Message-
> From: Tathagata Das [mailto:tathag...@alumnux.com]
> Sent: 12 January 2016 20:47
> To: openwrt-devel@lists.openwrt.org
> Cc: Tathagata Das
> Subject: [PATCH] Add support for Netgear D7800
> 
> Signed-off-by: Tathagata Das 
> ---
>  .../linux/ipq806x/base-files/etc/board.d/01_leds   |   1 +
>  .../ipq806x/base-files/etc/board.d/02_network  |   1 +
>  target/linux/ipq806x/base-files/lib/ipq806x.sh |   3 +
>  .../ipq806x/base-files/lib/upgrade/platform.sh |   2 +
>  target/linux/ipq806x/image/Makefile|  13 +-
>  ...dd-Netgear-Nighthawk-X4-D7800-device-tree.patch | 381
> +
>  target/linux/ipq806x/profiles/netgear.mk   |  13 +
>  7 files changed, 413 insertions(+), 1 deletion(-)  create mode 100644
> target/linux/ipq806x/patches-3.18/801-ARM-qcom-add-Netgear-Nighthawk-X
> 4-D780
> 0-device-tree.patch
> 
> diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds
> b/target/linux/ipq806x/base-files/etc/board.d/01_leds
> index 07b5b06..b32c1cc 100755
> --- a/target/linux/ipq806x/base-files/etc/board.d/01_leds
> +++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds
> @@ -11,6 +11,7 @@ board_config_update
>  board=$(ipq806x_board_name)
>  
>  case "$board" in
> +d7800 |\
>  r7500)
>   ucidef_set_led_usbdev "usb1" "USB 1&quo

Re: [OpenWrt-Devel] [PATCH] Add support for Netgear D7800

2016-01-18 Thread Tathagata Das
Any update about the patch?

Regards,
Tathagata


-Original Message-
From: Tathagata Das [mailto:tathag...@alumnux.com] 
Sent: 12 January 2016 20:47
To: openwrt-devel@lists.openwrt.org
Cc: Tathagata Das
Subject: [PATCH] Add support for Netgear D7800

Signed-off-by: Tathagata Das 
---
 .../linux/ipq806x/base-files/etc/board.d/01_leds   |   1 +
 .../ipq806x/base-files/etc/board.d/02_network  |   1 +
 target/linux/ipq806x/base-files/lib/ipq806x.sh |   3 +
 .../ipq806x/base-files/lib/upgrade/platform.sh |   2 +
 target/linux/ipq806x/image/Makefile|  13 +-
 ...dd-Netgear-Nighthawk-X4-D7800-device-tree.patch | 381
+
 target/linux/ipq806x/profiles/netgear.mk   |  13 +
 7 files changed, 413 insertions(+), 1 deletion(-)  create mode 100644
target/linux/ipq806x/patches-3.18/801-ARM-qcom-add-Netgear-Nighthawk-X4-D780
0-device-tree.patch

diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds
b/target/linux/ipq806x/base-files/etc/board.d/01_leds
index 07b5b06..b32c1cc 100755
--- a/target/linux/ipq806x/base-files/etc/board.d/01_leds
+++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds
@@ -11,6 +11,7 @@ board_config_update
 board=$(ipq806x_board_name)
 
 case "$board" in
+d7800 |\
 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"
diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network
b/target/linux/ipq806x/base-files/etc/board.d/02_network
index 1302a55..6e18297 100755
--- a/target/linux/ipq806x/base-files/etc/board.d/02_network
+++ b/target/linux/ipq806x/base-files/etc/board.d/02_network
@@ -13,6 +13,7 @@ board=$(ipq806x_board_name)
 
 case "$board" in
 ap148 |\
+d7800 |\
 r7500)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
diff --git a/target/linux/ipq806x/base-files/lib/ipq806x.sh
b/target/linux/ipq806x/base-files/lib/ipq806x.sh
index 5b27bde..db22708 100644
--- a/target/linux/ipq806x/base-files/lib/ipq806x.sh
+++ b/target/linux/ipq806x/base-files/lib/ipq806x.sh
@@ -17,6 +17,9 @@ ipq806x_board_detect() {
*"AP148")
name="ap148"
;;
+   *"D7800")
+   name="d7800"
+   ;;
*"DB149")
name="db149"
;;
diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
index c0e19a1..2400376 100644
--- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
@@ -7,6 +7,7 @@ platform_check_image() {
 
case "$board" in
AP148 |\
+   d7800 |\
r7500)
nand_do_platform_check $board $1
return $?;
@@ -21,6 +22,7 @@ platform_pre_upgrade() {
 
case "$board" in
AP148 |\
+   d7800 |\
r7500)
nand_do_upgrade "$1"
;;
diff --git a/target/linux/ipq806x/image/Makefile
b/target/linux/ipq806x/image/Makefile
index 14cf442..b880a1b 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -103,6 +103,17 @@ define Device/AP148-legacy
BOARD_NAME := ap148
 endef
 
+define Device/D7800
+   $(call Device/DniImage)
+   DEVICE_DTS := qcom-ipq8064-d7800
+   KERNEL_SIZE := 2097152
+   NETGEAR_BOARD_ID := D7800
+   NETGEAR_HW_ID := 29764958+0+128+512+4x4+4x4
+   BLOCKSIZE := 128KiB
+   PAGESIZE := 2048
+   BOARD_NAME := d7800
+endef
+
 define Device/DB149
$(call Device/FitImage)
DEVICE_DTS := qcom-ipq8064-db149
@@ -121,6 +132,6 @@ define Device/R7500
BOARD_NAME := r7500
 endef
 
-TARGET_DEVICES += AP148 AP148-legacy DB149 R7500
+TARGET_DEVICES += AP148 AP148-legacy D7800 DB149 R7500
 
 $(eval $(call BuildImage))
diff --git
a/target/linux/ipq806x/patches-3.18/801-ARM-qcom-add-Netgear-Nighthawk-X4-D7
800-device-tree.patch
b/target/linux/ipq806x/patches-3.18/801-ARM-qcom-add-Netgear-Nighthawk-X4-D7
800-device-tree.patch
new file mode 100644
index 000..ecc1cff
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/801-ARM-qcom-add-Netgear-Nightha
+++ wk-X4-D7800-device-tree.patch
@@ -0,0 +1,381 @@
+--- a/arch/arm/boot/dts/Makefile   2015-09-22 18:30:09.033530282 +0530
 b/arch/arm/boot/dts/Makefile   2015-09-23 17:06:44.892947581 +0530
+@@ -362,6 +362,7 @@
+   qcom-ipq8064-ap148.dtb \
+   qcom-ipq8064-db149.dtb \
+   qcom-ipq8064-r7500.dtb \
++  qcom-ipq8064-d7800.dtb \
+   qcom-msm8660-surf.dtb \
+   qcom-msm8960-cdp.dtb \
+   qcom-msm8974-sony-xperia-h

[OpenWrt-Devel] [PATCH] Add support for Netgear D7800

2016-01-12 Thread Tathagata Das
Signed-off-by: Tathagata Das 
---
 .../linux/ipq806x/base-files/etc/board.d/01_leds   |   1 +
 .../ipq806x/base-files/etc/board.d/02_network  |   1 +
 target/linux/ipq806x/base-files/lib/ipq806x.sh |   3 +
 .../ipq806x/base-files/lib/upgrade/platform.sh |   2 +
 target/linux/ipq806x/image/Makefile|  13 +-
 ...dd-Netgear-Nighthawk-X4-D7800-device-tree.patch | 381 +
 target/linux/ipq806x/profiles/netgear.mk   |  13 +
 7 files changed, 413 insertions(+), 1 deletion(-)
 create mode 100644 
target/linux/ipq806x/patches-3.18/801-ARM-qcom-add-Netgear-Nighthawk-X4-D7800-device-tree.patch

diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds 
b/target/linux/ipq806x/base-files/etc/board.d/01_leds
index 07b5b06..b32c1cc 100755
--- a/target/linux/ipq806x/base-files/etc/board.d/01_leds
+++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds
@@ -11,6 +11,7 @@ board_config_update
 board=$(ipq806x_board_name)
 
 case "$board" in
+d7800 |\
 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"
diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network 
b/target/linux/ipq806x/base-files/etc/board.d/02_network
index 1302a55..6e18297 100755
--- a/target/linux/ipq806x/base-files/etc/board.d/02_network
+++ b/target/linux/ipq806x/base-files/etc/board.d/02_network
@@ -13,6 +13,7 @@ board=$(ipq806x_board_name)
 
 case "$board" in
 ap148 |\
+d7800 |\
 r7500)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
diff --git a/target/linux/ipq806x/base-files/lib/ipq806x.sh 
b/target/linux/ipq806x/base-files/lib/ipq806x.sh
index 5b27bde..db22708 100644
--- a/target/linux/ipq806x/base-files/lib/ipq806x.sh
+++ b/target/linux/ipq806x/base-files/lib/ipq806x.sh
@@ -17,6 +17,9 @@ ipq806x_board_detect() {
*"AP148")
name="ap148"
;;
+   *"D7800")
+   name="d7800"
+   ;;
*"DB149")
name="db149"
;;
diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh 
b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
index c0e19a1..2400376 100644
--- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
@@ -7,6 +7,7 @@ platform_check_image() {
 
case "$board" in
AP148 |\
+   d7800 |\
r7500)
nand_do_platform_check $board $1
return $?;
@@ -21,6 +22,7 @@ platform_pre_upgrade() {
 
case "$board" in
AP148 |\
+   d7800 |\
r7500)
nand_do_upgrade "$1"
;;
diff --git a/target/linux/ipq806x/image/Makefile 
b/target/linux/ipq806x/image/Makefile
index 14cf442..b880a1b 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -103,6 +103,17 @@ define Device/AP148-legacy
BOARD_NAME := ap148
 endef
 
+define Device/D7800
+   $(call Device/DniImage)
+   DEVICE_DTS := qcom-ipq8064-d7800
+   KERNEL_SIZE := 2097152
+   NETGEAR_BOARD_ID := D7800
+   NETGEAR_HW_ID := 29764958+0+128+512+4x4+4x4
+   BLOCKSIZE := 128KiB
+   PAGESIZE := 2048
+   BOARD_NAME := d7800
+endef
+
 define Device/DB149
$(call Device/FitImage)
DEVICE_DTS := qcom-ipq8064-db149
@@ -121,6 +132,6 @@ define Device/R7500
BOARD_NAME := r7500
 endef
 
-TARGET_DEVICES += AP148 AP148-legacy DB149 R7500
+TARGET_DEVICES += AP148 AP148-legacy D7800 DB149 R7500
 
 $(eval $(call BuildImage))
diff --git 
a/target/linux/ipq806x/patches-3.18/801-ARM-qcom-add-Netgear-Nighthawk-X4-D7800-device-tree.patch
 
b/target/linux/ipq806x/patches-3.18/801-ARM-qcom-add-Netgear-Nighthawk-X4-D7800-device-tree.patch
new file mode 100644
index 000..ecc1cff
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-3.18/801-ARM-qcom-add-Netgear-Nighthawk-X4-D7800-device-tree.patch
@@ -0,0 +1,381 @@
+--- a/arch/arm/boot/dts/Makefile   2015-09-22 18:30:09.033530282 +0530
 b/arch/arm/boot/dts/Makefile   2015-09-23 17:06:44.892947581 +0530
+@@ -362,6 +362,7 @@
+   qcom-ipq8064-ap148.dtb \
+   qcom-ipq8064-db149.dtb \
+   qcom-ipq8064-r7500.dtb \
++  qcom-ipq8064-d7800.dtb \
+   qcom-msm8660-surf.dtb \
+   qcom-msm8960-cdp.dtb \
+   qcom-msm8974-sony-xperia-honami.dtb
+--- a/arch/arm/boot/dts/qcom-ipq8064-d7800.dts 1970-01-01 05:30:00.0 
+0530
 b/arch/arm/boot/dts/qcom-ipq8064-d7800.dts 2015-09-23 17:06:45.336947567 
+0530
+@@ -0,0 +1,368 @@
++#include "qcom-ipq8064-v1.0.dtsi"
++
++#include 
+

Re: [OpenWrt-Devel] [PATCH] Add support for Netgear D7800

2016-01-12 Thread Tathagata Das
 

Hi Felix, 

Sorry for my late reply. I have again sent that patch using git command.


"git send-email -to openwrt-devel@lists.openwrt.org
0001-Add-support-for-Netgear-D7800.patch" 

Please check it. 

Regards, 

Tatha 

On 04-01-2016 02:18, Felix Fietkau wrote: 

> On 2015-12-25 12:46, Tathagata Das wrote: 
> 
>> Add support for the Netgear D7800 and build appropriate sysupgrade and 
>> factory images.
>> 
>> Known issues:
>> . USB ports are not working
>> . DSL is not added
>> 
>> Signed-off-by: Tathagata Das 
>> ---
>> .../linux/ipq806x/base-files/etc/board.d/01_leds | 1 +
>> .../ipq806x/base-files/etc/board.d/02_network | 1 +
>> target/linux/ipq806x/base-files/lib/ipq806x.sh | 3 +
>> .../ipq806x/base-files/lib/upgrade/platform.sh | 2 +
>> target/linux/ipq806x/image/Makefile | 13 +-
>> ...dd-Netgear-Nighthawk-X4-D7800-device-tree.patch | 381 
>> +
>> target/linux/ipq806x/profiles/netgear.mk | 13 +
>> 7 files changed, 413 insertions(+), 1 deletion(-)
>> create mode 100644 
>> target/linux/ipq806x/patches-3.18/801-ARM-qcom-add-Netgear-Nighthawk-X4-D7800-device-tree.patch
> This patch is badly damaged by line wrapping. Please fix and resend.
> 
> - Felix
 ___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Add support for Netgear D7800

2015-12-26 Thread Tathagata Das
 

Hi Hauke, 

I have plan to add support for DSL part as well. Currently I am working
on USB. I hope my last patch (Adding support for Netgear D7800) would be
accepted. Later I will provide patch for both USB and DSL. Those two are
essential for D7800. 

Do you have any idea/suggestion? 

Regards, 

Tathagata 

On 25-12-2015 21:43, Hauke Mehrtens wrote: 

> On 12/25/2015 12:46 PM, Tathagata Das wrote: 
> 
>> Add support for the Netgear D7800 and build appropriate sysupgrade and
>> factory images.
>> 
>> Known issues:
>> . USB ports are not working
>> . DSL is not added
> 
> Do you plan to add support for the DSL part?
> 
> Hauke
 ___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] Add support for Netgear D7800

2015-12-25 Thread Tathagata Das
Add support for the Netgear D7800 and build appropriate sysupgrade and 
factory images.


Known issues:
. USB ports are not working
. DSL is not added

Signed-off-by: Tathagata Das 
---
 .../linux/ipq806x/base-files/etc/board.d/01_leds   |   1 +
 .../ipq806x/base-files/etc/board.d/02_network  |   1 +
 target/linux/ipq806x/base-files/lib/ipq806x.sh |   3 +
 .../ipq806x/base-files/lib/upgrade/platform.sh |   2 +
 target/linux/ipq806x/image/Makefile|  13 +-
 ...dd-Netgear-Nighthawk-X4-D7800-device-tree.patch | 381 
+

 target/linux/ipq806x/profiles/netgear.mk   |  13 +
 7 files changed, 413 insertions(+), 1 deletion(-)
 create mode 100644 
target/linux/ipq806x/patches-3.18/801-ARM-qcom-add-Netgear-Nighthawk-X4-D7800-device-tree.patch


diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds 
b/target/linux/ipq806x/base-files/etc/board.d/01_leds

index 07b5b06..b32c1cc 100755
--- a/target/linux/ipq806x/base-files/etc/board.d/01_leds
+++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds
@@ -11,6 +11,7 @@ board_config_update
 board=$(ipq806x_board_name)

 case "$board" in
+d7800 |\
 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"
diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network 
b/target/linux/ipq806x/base-files/etc/board.d/02_network

index 1302a55..6e18297 100755
--- a/target/linux/ipq806x/base-files/etc/board.d/02_network
+++ b/target/linux/ipq806x/base-files/etc/board.d/02_network
@@ -13,6 +13,7 @@ board=$(ipq806x_board_name)

 case "$board" in
 ap148 |\
+d7800 |\
 r7500)
 ucidef_add_switch "switch0" \
 "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
diff --git a/target/linux/ipq806x/base-files/lib/ipq806x.sh 
b/target/linux/ipq806x/base-files/lib/ipq806x.sh

index 5b27bde..db22708 100644
--- a/target/linux/ipq806x/base-files/lib/ipq806x.sh
+++ b/target/linux/ipq806x/base-files/lib/ipq806x.sh
@@ -17,6 +17,9 @@ ipq806x_board_detect() {
 *"AP148")
 name="ap148"
 ;;
+*"D7800")
+name="d7800"
+;;
 *"DB149")
 name="db149"
 ;;
diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh 
b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh

index c0e19a1..2400376 100644
--- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
@@ -7,6 +7,7 @@ platform_check_image() {

 case "$board" in
 AP148 |\
+d7800 |\
 r7500)
 nand_do_platform_check $board $1
 return $?;
@@ -21,6 +22,7 @@ platform_pre_upgrade() {

 case "$board" in
 AP148 |\
+d7800 |\
 r7500)
 nand_do_upgrade "$1"
 ;;
diff --git a/target/linux/ipq806x/image/Makefile 
b/target/linux/ipq806x/image/Makefile

index 14cf442..b880a1b 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -103,6 +103,17 @@ define Device/AP148-legacy
 BOARD_NAME := ap148
 endef

+define Device/D7800
+$(call Device/DniImage)
+DEVICE_DTS := qcom-ipq8064-d7800
+KERNEL_SIZE := 2097152
+NETGEAR_BOARD_ID := D7800
+NETGEAR_HW_ID := 29764958+0+128+512+4x4+4x4
+BLOCKSIZE := 128KiB
+PAGESIZE := 2048
+BOARD_NAME := d7800
+endef
+
 define Device/DB149
 $(call Device/FitImage)
 DEVICE_DTS := qcom-ipq8064-db149
@@ -121,6 +132,6 @@ define Device/R7500
 BOARD_NAME := r7500
 endef

-TARGET_DEVICES += AP148 AP148-legacy DB149 R7500
+TARGET_DEVICES += AP148 AP148-legacy D7800 DB149 R7500

 $(eval $(call BuildImage))
diff --git 
a/target/linux/ipq806x/patches-3.18/801-ARM-qcom-add-Netgear-Nighthawk-X4-D7800-device-tree.patch 
b/target/linux/ipq806x/patches-3.18/801-ARM-qcom-add-Netgear-Nighthawk-X4-D7800-device-tree.patch

new file mode 100644
index 000..ecc1cff
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-3.18/801-ARM-qcom-add-Netgear-Nighthawk-X4-D7800-device-tree.patch

@@ -0,0 +1,381 @@
+--- a/arch/arm/boot/dts/Makefile2015-09-22 18:30:09.033530282 +0530
 b/arch/arm/boot/dts/Makefile2015-09-23 17:06:44.892947581 +0530
+@@ -362,6 +362,7 @@
+ qcom-ipq8064-ap148.dtb \
+ qcom-ipq8064-db149.dtb \
+ qcom-ipq8064-r7500.dtb \
++qcom-ipq8064-d7800.dtb \
+ qcom-msm8660-surf.dtb \
+ qcom-msm8960-cdp.dtb \
+ qcom-msm8974-sony-xperia-honami.dtb
+--- a/arch/arm/boot/dts/qcom-ipq8064-d7800.dts1970-01-01 
05:30:00.0 +0530
 b/arch/arm/boot/dts/qcom-ipq8064-d7800.dts2015-09-23 
17:06:45.336947567 +0530

+@@ -0,0 +1,368 @@
++#include "qcom-ipq8064-v1.0.dtsi"
++
++#include 
++
++/ {
++  

Re: [OpenWrt-Devel] [Patch] ipq806x: add support for Netgear D7800

2015-12-25 Thread Tathagata Das
 

Hi John, 

I don't why it did't reach. I sent it using git command and I got a copy
that of email. I also kept you in cc list. 

Regards, 

Tatha 

On 25-12-2015 13:19, John Crispin wrote: 

> On 24/12/2015 17:55, Tathagata Das wrote: 
> 
>> Thank you for help John.
>> 
>> I have followed those step and send the patch again. Please check.
> 
> well, we never received that mail i am afraid.
> 
> John
> 
> On 24-12-2015 21:24, John Crispin wrote:
> 
> hi
> 
> first format the patch
> 
> git format-patch HEAD~1
> 
> this will give you your patch as 0001-$some_name.patch
> 
> then call this command to send the patch
> 
> git send-email --to openwrt-devel@lists.openwrt.org
> <mailto:openwrt-devel@lists.openwrt.org> 0001-my_fix.patch
> 
> John
> 
> On 24/12/2015 14:31, Tathagata Das wrote: 
> 
> I have tried with git -send-email option. But it says command not
> supported. Could you send me the command?
> 
> On 24-12-2015 18:48, John Crispin wrote:
> 
> Hi,
> 
> your mail client replaced all tabs with spaces.
> 
> please consider using git to send patches. it will save you a lot of
> time.
> 
> John
> 
> On 24/12/2015 11:21, Tathagata Das wrote: Add support for the Netgear D7800 
> and build appropriate sysupgrade and
> factory images.
> 
> Known issues:
> . USB ports are not working
> . DSL is not added
> 
> Signed-off-by: Tathagata Das  <mailto:tathag...@alumnux.com>
> <mailto:tathag...@alumnux.com <mailto:tathag...@alumnux.com>>>
> 
> 
> 
> From 41487fc5f03abbd24c1a979c1c0e59a5f7da2898 Mon Sep 17 00:00:00 2001 From: 
> Tathagata Das  <mailto:tathag...@alumnux.com>
> <mailto:tathag...@alumnux.com <mailto:tathag...@alumnux.com>>>
> Date: Thu, 24 Dec 2015 09:44:01 +0530
> Subject: [PATCH] Added support for Netgear D7800
> Signed-off-by: Tathagata Das  <mailto:tathag...@alumnux.com>
> <mailto:tathag...@alumnux.com <mailto:tathag...@alumnux.com>>>
> 
> ---
> .../linux/ipq806x/base-files/etc/board.d/01_leds | 1 +
> .../ipq806x/base-files/etc/board.d/02_network | 1 +
> target/linux/ipq806x/base-files/lib/ipq806x.sh | 3 +
> .../ipq806x/base-files/lib/upgrade/platform.sh | 2 +
> target/linux/ipq806x/image/Makefile | 13 +-
> ...dd-Netgear-Nighthawk-X4-D7800-device-tree.patch | 381
> 
> target/linux/ipq806x/profiles/netgear.mk | 14 +
> 7 files changed, 414 insertions(+), 1 deletions(-)
> create mode 100644
> target/linux/ipq806x/patches-3.18/801-ARM-qcom-add-Netgear-Nighthawk-X4-D7800-device-tree.patch
> 
> diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds
> b/target/linux/ipq806x/base-files/etc/board.d/01_leds
> index 07b5b06..b32c1cc 100755
> --- a/target/linux/ipq806x/base-files/etc/board.d/01_leds
> +++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds
> @@ -11,6 +11,7 @@ board_config_update
> board=$(ipq806x_board_name)
> 
> case "$board" in
> +d7800 |\
> 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"
> diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network
> b/target/linux/ipq806x/base-files/etc/board.d/02_network
> index 1302a55..6e18297 100755
> --- a/target/linux/ipq806x/base-files/etc/board.d/02_network
> +++ b/target/linux/ipq806x/base-files/etc/board.d/02_network
> @@ -13,6 +13,7 @@ board=$(ipq806x_board_name)
> 
> case "$board" in
> ap148 |\
> +d7800 |\
> r7500)
> ucidef_add_switch "switch0" \
> "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1 <mailto:6@eth1>
> <mailto:6@eth1 <mailto:6@eth1>>"
> "5:wan" "0@eth0 <mailto:0@eth0> <mailto:0@eth0 <mailto:0@eth0>>"
> diff --git a/target/linux/ipq806x/base-files/lib/ipq806x.sh
> b/target/linux/ipq806x/base-files/lib/ipq806x.sh
> index 5b27bde..be48b9f 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"
> ;;
> + *"D7800")
> + name="d7800"
> + ;;
> *"R7500")
> name="r7500"
> ;;
> diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
> b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
> index c0e19a1..2400376 100644
> --- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ipq806x/base-files/lib/upgrade/

Re: [OpenWrt-Devel] [Patch] ipq806x: add support for Netgear D7800

2015-12-24 Thread Tathagata Das
 

Thank you for help John. 

I have followed those step and send the patch again. Please check. 

On 24-12-2015 21:24, John Crispin wrote: 

> hi
> 
> first format the patch
> 
> git format-patch HEAD~1
> 
> this will give you your patch as 0001-$some_name.patch
> 
> then call this command to send the patch
> 
> git send-email --to openwrt-devel@lists.openwrt.org 0001-my_fix.patch
> 
> John
> 
> On 24/12/2015 14:31, Tathagata Das wrote: 
> 
> I have tried with git -send-email option. But it says command not
> supported. Could you send me the command?
> 
> On 24-12-2015 18:48, John Crispin wrote:
> 
> Hi,
> 
> your mail client replaced all tabs with spaces.
> 
> please consider using git to send patches. it will save you a lot of time.
> 
> John
> 
> On 24/12/2015 11:21, Tathagata Das wrote: Add support for the Netgear D7800 
> and build appropriate sysupgrade and
> factory images.
> 
> Known issues:
> . USB ports are not working
> . DSL is not added
> 
> Signed-off-by: Tathagata Das  <mailto:tathag...@alumnux.com>>
> 
> 
> 
> From 41487fc5f03abbd24c1a979c1c0e59a5f7da2898 Mon Sep 17 00:00:00 2001 From: 
> Tathagata Das  <mailto:tathag...@alumnux.com>>
> Date: Thu, 24 Dec 2015 09:44:01 +0530
> Subject: [PATCH] Added support for Netgear D7800
> Signed-off-by: Tathagata Das  <mailto:tathag...@alumnux.com>>
> 
> ---
> .../linux/ipq806x/base-files/etc/board.d/01_leds | 1 +
> .../ipq806x/base-files/etc/board.d/02_network | 1 +
> target/linux/ipq806x/base-files/lib/ipq806x.sh | 3 +
> .../ipq806x/base-files/lib/upgrade/platform.sh | 2 +
> target/linux/ipq806x/image/Makefile | 13 +-
> ...dd-Netgear-Nighthawk-X4-D7800-device-tree.patch | 381
> 
> target/linux/ipq806x/profiles/netgear.mk | 14 +
> 7 files changed, 414 insertions(+), 1 deletions(-)
> create mode 100644
> target/linux/ipq806x/patches-3.18/801-ARM-qcom-add-Netgear-Nighthawk-X4-D7800-device-tree.patch
> 
> diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds
> b/target/linux/ipq806x/base-files/etc/board.d/01_leds
> index 07b5b06..b32c1cc 100755
> --- a/target/linux/ipq806x/base-files/etc/board.d/01_leds
> +++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds
> @@ -11,6 +11,7 @@ board_config_update
> board=$(ipq806x_board_name)
> 
> case "$board" in
> +d7800 |\
> 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"
> diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network
> b/target/linux/ipq806x/base-files/etc/board.d/02_network
> index 1302a55..6e18297 100755
> --- a/target/linux/ipq806x/base-files/etc/board.d/02_network
> +++ b/target/linux/ipq806x/base-files/etc/board.d/02_network
> @@ -13,6 +13,7 @@ board=$(ipq806x_board_name)
> 
> case "$board" in
> ap148 |\
> +d7800 |\
> r7500)
> ucidef_add_switch "switch0" \
> "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1 <mailto:6@eth1>"
> "5:wan" "0@eth0 <mailto:0@eth0>"
> diff --git a/target/linux/ipq806x/base-files/lib/ipq806x.sh
> b/target/linux/ipq806x/base-files/lib/ipq806x.sh
> index 5b27bde..be48b9f 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"
> ;;
> + *"D7800")
> + name="d7800"
> + ;;
> *"R7500")
> name="r7500"
> ;;
> diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
> b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
> index c0e19a1..2400376 100644
> --- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
> @@ -7,6 +7,7 @@ platform_check_image() {
> 
> case "$board" in
> AP148 |\
> + d7800 |\
> r7500)
> nand_do_platform_check $board $1
> return $?;
> @@ -21,6 +22,7 @@ platform_pre_upgrade() {
> 
> case "$board" in
> AP148 |\
> + d7800 |\
> r7500)
> nand_do_upgrade "$1"
> ;;
> diff --git a/target/linux/ipq806x/image/Makefile
> b/target/linux/ipq806x/image/Makefile
> index 14cf442..8f46af8 100644
> --- a/target/linux/ipq806x/image/Makefile
> +++ b/target/linux/ipq806x/image/Makefile
> @@ -121,6 +121,17 @@ define Device/R7500
> BOARD_NAME := r7500
> endef
> 
> -TARGET_DEVICES += AP148 AP148-legacy DB149 R7500
> +define Device/D7800
> 

[OpenWrt-Devel] [Patch] ipq806x: add support for Netgear D7800

2015-12-24 Thread Tathagata Das
Add support for the Netgear D7800 and build appropriate sysupgrade and 
factory images.


Known issues:
. USB ports are not working
. DSL is not added

Signed-off-by: Tathagata Das 




From 41487fc5f03abbd24c1a979c1c0e59a5f7da2898 Mon Sep 17 00:00:00 2001

From: Tathagata Das 
Date: Thu, 24 Dec 2015 09:44:01 +0530
Subject: [PATCH] Added support for Netgear D7800
 Signed-off-by: Tathagata Das 

---
 .../linux/ipq806x/base-files/etc/board.d/01_leds   |1 +
 .../ipq806x/base-files/etc/board.d/02_network  |1 +
 target/linux/ipq806x/base-files/lib/ipq806x.sh |3 +
 .../ipq806x/base-files/lib/upgrade/platform.sh |2 +
 target/linux/ipq806x/image/Makefile|   13 +-
 ...dd-Netgear-Nighthawk-X4-D7800-device-tree.patch |  381 


 target/linux/ipq806x/profiles/netgear.mk   |   14 +
 7 files changed, 414 insertions(+), 1 deletions(-)
 create mode 100644 
target/linux/ipq806x/patches-3.18/801-ARM-qcom-add-Netgear-Nighthawk-X4-D7800-device-tree.patch


diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds 
b/target/linux/ipq806x/base-files/etc/board.d/01_leds

index 07b5b06..b32c1cc 100755
--- a/target/linux/ipq806x/base-files/etc/board.d/01_leds
+++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds
@@ -11,6 +11,7 @@ board_config_update
 board=$(ipq806x_board_name)

 case "$board" in
+d7800 |\
 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"
diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network 
b/target/linux/ipq806x/base-files/etc/board.d/02_network

index 1302a55..6e18297 100755
--- a/target/linux/ipq806x/base-files/etc/board.d/02_network
+++ b/target/linux/ipq806x/base-files/etc/board.d/02_network
@@ -13,6 +13,7 @@ board=$(ipq806x_board_name)

 case "$board" in
 ap148 |\
+d7800 |\
 r7500)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
diff --git a/target/linux/ipq806x/base-files/lib/ipq806x.sh 
b/target/linux/ipq806x/base-files/lib/ipq806x.sh

index 5b27bde..be48b9f 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"
;;
+   *"D7800")
+   name="d7800"
+   ;;
*"R7500")
name="r7500"
;;
diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh 
b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh

index c0e19a1..2400376 100644
--- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
@@ -7,6 +7,7 @@ platform_check_image() {

case "$board" in
AP148 |\
+   d7800 |\
r7500)
nand_do_platform_check $board $1
return $?;
@@ -21,6 +22,7 @@ platform_pre_upgrade() {

case "$board" in
AP148 |\
+   d7800 |\
r7500)
nand_do_upgrade "$1"
;;
diff --git a/target/linux/ipq806x/image/Makefile 
b/target/linux/ipq806x/image/Makefile

index 14cf442..8f46af8 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -121,6 +121,17 @@ define Device/R7500
BOARD_NAME := r7500
 endef

-TARGET_DEVICES += AP148 AP148-legacy DB149 R7500
+define Device/D7800
+   $(call Device/DniImage)
+   DEVICE_DTS := qcom-ipq8064-d7800
+   KERNEL_SIZE := 2097152
+   NETGEAR_BOARD_ID := D7800
+   NETGEAR_HW_ID := 29764958+0+128+512+4x4+4x4
+   BLOCKSIZE := 128KiB
+   PAGESIZE := 2048
+   BOARD_NAME := d7800
+endef
+
+TARGET_DEVICES += AP148 AP148-legacy DB149 R7500 D7800

 $(eval $(call BuildImage))
diff --git 
a/target/linux/ipq806x/patches-3.18/801-ARM-qcom-add-Netgear-Nighthawk-X4-D7800-device-tree.patch 
b/target/linux/ipq806x/patches-3.18/801-ARM-qcom-add-Netgear-Nighthawk-X4-D7800-device-tree.patch

new file mode 100644
index 000..ecc1cff
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-3.18/801-ARM-qcom-add-Netgear-Nighthawk-X4-D7800-device-tree.patch

@@ -0,0 +1,381 @@
+--- a/arch/arm/boot/dts/Makefile   2015-09-22 18:30:09.033530282 +0530
 b/arch/arm/boot/dts/Makefile   2015-09-23 17:06:44.892947581 +0530
+@@ -362,6 +362,7 @@
+   qcom-ipq8064-ap148.dtb \
+   qcom-ipq8064-db149.dtb \
+   qcom-ipq8064-r7500.dtb \
++  qcom-ipq8064-d7800.dtb \
+   qcom-msm8660-surf.dtb \
+   qcom-msm8960-cdp.dtb \
+   qcom-msm8974-sony-xperia-honami.dtb
+--- a/arch/arm/boot/dts/qcom-ipq8064-d7800.

Re: [OpenWrt-Devel] [Patch] ipq806x: add support for Netgear D7800

2015-12-23 Thread Tathagata Das
#address-cells = <1>;
++  #size-cells = <0>;
++  gpios = <&qcom_pinmux 1 0 &qcom_pinmux 0 0>;
++  pinctrl-0 = <&mdio0_pins>;
++  pinctrl-names = "default";
++
++  phy0: ethernet-phy@0 {
++  device_type = "ethernet-phy";
++  reg = <0>;
++  qca,ar8327-initvals = <
++  0x4 0x760   /* PAD0_MODE */
++  0x8 0x100   /* PAD5_MODE */
++  0xc 0x80/* PAD6_MODE */
++  0x000e4 0xaa545 /* MAC_POWER_SEL
*/
++  0x000e0 0xc74164de  /* SGMII_CTRL */
++  0x0007c 0x4e/* PORT0_STATUS
*/
++  0x00094 0x4e/* PORT6_STATUS
*/
++  >;
++  };
++
++  phy4: ethernet-phy@4 {
++  device_type = "ethernet-phy";
++  reg = <4>;
++  };
++  };
++
++  gmac1: ethernet@3720 {
++  status = "ok";
++  phy-mode = "rgmii";
++  phy-handle = <&phy4>;
++  qcom,id = <1>;
++
++  pinctrl-0 = <&rgmii2_pins>;
++  pinctrl-names = "default";
++
++  mtd-mac-address = <&art 6>;
++  };
++
++  gmac2: ethernet@3740 {
++  status = "ok";
++  phy-mode = "sgmii";
++  qcom,id = <2>;
++
++  mtd-mac-address = <&art 0>;
++
++  fixed-link {
++  speed = <1000>;
++  full-duplex;
++  };
++  };
++  };
++
++  gpio-keys {
++  compatible = "gpio-keys";
++
++  wifi {
++  label = "wifi";
++  gpios = <&qcom_pinmux 6 1>;
++  linux,code = ;
++  };
++
++  reset {
++  label = "reset";
++  gpios = <&qcom_pinmux 54 1>;
++  linux,code = ;
++  };
++
++  wps {
++  label = "wps";
++  gpios = <&qcom_pinmux 65 1>;
++  linux,code = ;
++  };
++  };
++
++  gpio-leds {
++  compatible = "gpio-leds";
++
++  usb1 {
++  label = "d7800:amber:usb1";
++  gpios = <&qcom_pinmux 7 0>;
++  };
++
++  usb3 {
++      label = "d7800:amber:usb3";
++  gpios = <&qcom_pinmux 8 0>;
++  };
++
++  status {
++  label = "d7800:amber:status";
++  gpios = <&qcom_pinmux 9 0>;
++  };
++
++  internet {
++  label = "d7800:white:internet";
++  gpios = <&qcom_pinmux 22 0>;
++  };
++
++  wan {
++  label = "d7800:white:wan";
++  gpios = <&qcom_pinmux 23 0>;
++  };
++
++  wps {
++  label = "d7800:white:wps";
++  gpios = <&qcom_pinmux 24 0>;
++  };
++
++  esata {
++  label = "d7800:white:esata";
++  gpios = <&qcom_pinmux 26 0>;
++  };
++
++  power {
++  label = "d7800:white:power";
++  gpios = <&qcom_pinmux 53 0>;
++  default-state = "on";
++  };
++
++  rfkill {
++  label = "d7800:white:rfkill";
++  gpios = <&qcom_pinmux 64 0>;
++  };
++
++  wifi5g {
++  label = "d7800:white:wifi5g";
++  gpios = <&qcom_pinmux 67 0>;
++  };
++  };
++};
++
++&adm_dma {
++  status = "ok";
++};

Regards,
Tathagata


-Original Message-
From: John Crispin [mailto:blo...@openwrt.org] 
Sent: 23 December 2015 18:34
To: openwrt-devel@lists.openwrt.org; Tathagata Das
Subject: Re: [OpenWrt-Devel] [Patch] ipq806x: add support for Netgear D7800

Hi,

you sent the patch as an attachment. because of this patchwork did not pick
it up. could you please resend with the patch inline rather than attached.

John

On 14/12/2015 10:37, Tathagata Das wrote:
> Add support for the Netgear D7800 and build appropariate sysupgrade 
> and factory images.
> 
> Known issues:
> . USB ports are not working
> . DSL is not added
> 
> Signed-off-by: Tathagata Das 
> 
> 
> 
> ___
> 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] ipq806x: add support for Netgear D7800

2015-12-17 Thread Tathagata Das

Thanks John.

Please let me know once it is merged into trunk.

Regards,
Tathagata

On 2015-12-17 16:10, John Crispin wrote:

On 17/12/2015 10:51, Tathagata Das wrote:
I am not sure if this patch is under verification or not. Please let 
me know

if any modification is required in this patch.

Regards,
Tathagata



Hi,

still pending, i'll try to do more merging later today

John



-Original Message-
From: Tathagata Das [mailto:tathag...@alumnux.com]
Sent: Monday, December 14, 2015 3:07 PM
To: 'OpenWrt Development List'
Subject: [Patch] ipq806x: add support for Netgear D7800

Add support for the Netgear D7800 and build appropariate sysupgrade 
and

factory images.

Known issues:
. USB ports are not working
. DSL is not added

Signed-off-by: Tathagata Das 
___
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] ipq806x: add support for Netgear D7800

2015-12-17 Thread Tathagata Das
I am not sure if this patch is under verification or not. Please let me know
if any modification is required in this patch.

Regards,
Tathagata


-Original Message-
From: Tathagata Das [mailto:tathag...@alumnux.com] 
Sent: Monday, December 14, 2015 3:07 PM
To: 'OpenWrt Development List'
Subject: [Patch] ipq806x: add support for Netgear D7800

Add support for the Netgear D7800 and build appropariate sysupgrade and
factory images.

Known issues:
. USB ports are not working 
. DSL is not added

Signed-off-by: Tathagata Das 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [Patch] ipq806x: add support for Netgear D7800

2015-12-14 Thread Tathagata Das
Add support for the Netgear D7800 and build appropariate sysupgrade and
factory images.

Known issues:
. USB ports are not working 
. DSL is not added

Signed-off-by: Tathagata Das 


d7800_support.patch
Description: Binary data
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Netifd and ubus

2012-08-06 Thread Tathagata Das
Hi,
 First of all thanks all who designed netifd and ubus.

I would like to use netifd in my OpenWRT based router. So I am looking into the 
source code of netifd and ubus. But I didn't find much information about ubus. 
Is there any documents on how they interact ?
I heard that Luci uses netifd for network configuration. Is there any document 
for that ?

Also I didn't understand the meaning of below line which I found at 
http://wiki.openwrt.org/doc/techref/netifd#what.s.the.difference.between.ubus.and.dbus

"ubus is tiny and has the advantage of being easy to use from regular C code, 
as well as automatically making all exported API functionality also available 
to shell scripts with no extra effort." -- How shell script can use C API?

Thanks in advance.

Regards,
Tatha



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


[OpenWrt-Devel] [PATCH] Updated patch to check multiple instances in subfolder in local repository

2012-04-10 Thread Tathagata Das
Hi,
 I have modified the patch. This patch will only copy a single file from local 
repository. If more than one instance of the same file exists in the subfolders 
then it will throw an error.

Signed-off-by: Tathagata Das 

---

diff -Naur a/scripts/download.pl b/scripts/download.pl
--- a/scripts/download.pl   2012-04-05 18:59:13.0 +0530
+++ b/scripts/download.pl   2012-04-06 11:27:12.0 +0530
@@ -9,6 +9,7 @@
 use strict;
 use warnings;
 use File::Basename;
+use File::Copy;
 
 @ARGV > 2 or die "Syntax: $0[ 
...]\n";
 
@@ -65,6 +66,7 @@
$mirror =~ s/\/$//;
if( $mirror =~ /^file:\/\// ) {
my $cache = $mirror;
+   my $mylink="";
$cache =~ s/file:\/\///g;
if(system("test -d $cache")) {
print STDERR "Wrong local cache directory -$cache-.\n";
@@ -74,7 +76,32 @@
if(! -d $target) {
system("mkdir -p $target/");
}
-   system("cp -vf $cache/$filename $target/$filename.dl") == 0 or 
return;
+   if (open TMPDLS, "find $cache -follow -name $filename 
2>/dev/null |"){
+   my $i = 0;
+   my $link = "";
+   while (defined($link = readline TMPDLS)){
+   chomp $link;
+   $mylink=$link;
+   $i++;
+   if ($i > 1) { 
+   print("$i or more instances of 
$filename in $cache found . Only one instance allowed.\n");
+   return;
+   }
+   }
+   close TMPDLS;
+   if ($i < 1) {
+   print("No instances of $filename found in 
$cache.\n");
+   return;
+   }
+   if ($i == 1){
+   print("Copying $filename from $mylink\n");
+   copy($mylink, "$target/$filename.dl");
+   }
+   }
+   else {
+   print("Failed to search for $filename in $cache\n");
+   return;
+   }
system("$md5cmd $target/$filename.dl > 
\"$target/$filename.md5sum\" ") == 0 or return;
} else {
open WGET, "wget -t5 --timeout=20 --no-check-certificate 
$options -O- \"$mirror/$filename\" |" or die "Cannot launch wget.\n";


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


[OpenWrt-Devel] [PATCH] Use build suffix on build_dir paths

2012-04-09 Thread Tathagata Das
Hi, 
 This patch helps to use build suffix on build_dir paths if it is defined else 
use subtarget. Defining model names on build suffix helps in building one or 
more pre-defined configurations (.config) of same platform in same build path 
without doing a clean. This preserves each models target build and Linux build 
in separate directories.

Signed-off-by: Tathagata Das 

---

diff -Naur a/include/kernel.mk b/include/kernel.mk
--- a/include/kernel.mk 2012-04-05 13:10:50.0 +0530
+++ b/include/kernel.mk 2012-04-06 16:09:18.0 +0530
@@ -33,7 +33,7 @@
 PATCH_DIR ?= ./patches$(if $(wildcard 
./patches-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER))
 FILES_DIR ?= $(foreach dir,$(wildcard ./files 
./files-$(KERNEL_PATCHVER)),"$(dir)")
   endif
-  KERNEL_BUILD_DIR ?= $(BUILD_DIR_BASE)/linux-$(BOARD)$(if 
$(SUBTARGET),_$(SUBTARGET))$(if $(BUILD_SUFFIX),_$(BUILD_SUFFIX))
+  KERNEL_BUILD_DIR ?= $(BUILD_DIR_BASE)/linux-$(BOARD)$(if 
$(BUILD_SUFFIX),_$(BUILD_SUFFIX),$(if $(SUBTARGET),_$(SUBTARGET)))
   LINUX_DIR ?= $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)
 
   LINUX_VERMAGIC:=$(strip $(shell cat $(LINUX_DIR)/.vermagic 2>/dev/null))
diff -Naur a/rules.mk b/rules.mk
--- a/rules.mk  2012-04-05 13:10:50.0 +0530
+++ b/rules.mk  2012-04-06 16:09:07.0 +0530
@@ -82,7 +82,7 @@
   GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-openwrt-linux
   DIR_SUFFIX:=_$(LIBC)-$(LIBCV)$(if $(CONFIG_arm),_eabi)
   BUILD_DIR:=$(BUILD_DIR_BASE)/target-$(ARCH)$(ARCH_SUFFIX)$(DIR_SUFFIX)$(if 
$(BUILD_SUFFIX),_$(BUILD_SUFFIX))
-  STAGING_DIR:=$(TOPDIR)/staging_dir/target-$(ARCH)$(ARCH_SUFFIX)$(DIR_SUFFIX)
+  
STAGING_DIR:=$(TOPDIR)/staging_dir/target-$(ARCH)$(ARCH_SUFFIX)$(DIR_SUFFIX)$(if
 $(BUILD_SUFFIX),_$(BUILD_SUFFIX))
   
BUILD_DIR_TOOLCHAIN:=$(BUILD_DIR_BASE)/toolchain-$(ARCH)$(ARCH_SUFFIX)_gcc-$(GCCV)$(DIR_SUFFIX)
   
TOOLCHAIN_DIR:=$(TOPDIR)/staging_dir/toolchain-$(ARCH)$(ARCH_SUFFIX)_gcc-$(GCCV)$(DIR_SUFFIX)
   PACKAGE_DIR:=$(BIN_DIR)/packages
@@ -94,7 +94,7 @@
   endif
   REAL_GNU_TARGET_NAME=$(GNU_TARGET_NAME)
   BUILD_DIR:=$(BUILD_DIR_BASE)/target-$(GNU_TARGET_NAME)$(if 
$(BUILD_SUFFIX),_$(BUILD_SUFFIX))
-  STAGING_DIR:=$(TOPDIR)/staging_dir/target-$(GNU_TARGET_NAME)
+  STAGING_DIR:=$(TOPDIR)/staging_dir/target-$(GNU_TARGET_NAME)$(if 
$(BUILD_SUFFIX),_$(BUILD_SUFFIX))
   BUILD_DIR_TOOLCHAIN:=$(BUILD_DIR_BASE)/toolchain-$(GNU_TARGET_NAME)
   TOOLCHAIN_DIR:=$(TOPDIR)/staging_dir/toolchain-$(GNU_TARGET_NAME)
   PACKAGE_DIR:=$(BIN_DIR)/packages


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


Re: [OpenWrt-Devel] [PATCH] Updated patch to check multiple instances in subfolders in local repository

2012-04-05 Thread Tathagata Das
Hi,
 I have updated the patch as Philip and Jo-Philipp suggested.

Signed-off-by: Tathagata Das 

---

diff -Naur a/scripts/download.pl b/scripts/download.pl
--- a/scripts/download.pl   2012-04-05 18:59:13.0 +0530
+++ b/scripts/download.pl   2012-04-06 11:27:12.0 +0530
@@ -9,6 +9,7 @@
 use strict;
 use warnings;
 use File::Basename;
+use File::Copy;
 
 @ARGV > 2 or die "Syntax: $0[ 
...]\n";
 
@@ -65,6 +66,7 @@
$mirror =~ s/\/$//;
if( $mirror =~ /^file:\/\// ) {
my $cache = $mirror;
+   my $mylink="";
$cache =~ s/file:\/\///g;
if(system("test -d $cache")) {
print STDERR "Wrong local cache directory -$cache-.\n";
@@ -74,7 +76,32 @@
if(! -d $target) {
system("mkdir -p $target/");
}
-   system("cp -vf $cache/$filename $target/$filename.dl") == 0 or 
return;
+   if (open TMPDLS, "find $cache -follow -name $filename 
2>/dev/null |"){
+   my $i = 0;
+   my $link = "";
+   while (defined($link = readline TMPDLS)){
+   chomp $link;
+   $mylink=$link;
+   $i++;
+   if ($i > 1) { 
+   print("$i or more instances of 
$filename in $cache found . Only one instance allowed.\n");
+   return;
+   }
+   }
+   close TMPDLS;
+   if ($i < 1) {
+   print("No instances of $filename found in 
$cache.\n");
+   return;
+   }
+   if ($i == 1){
+   print("Copying $filename from $mylink\n");
+   copy($mylink, "$target/$filename.dl");
+   }
+   }
+   else {
+   print("Failed to search for $filename in $cache\n");
+   return;
+   }
system("$md5cmd $target/$filename.dl > 
\"$target/$filename.md5sum\" ") == 0 or return;
} else {
open WGET, "wget -t5 --timeout=20 --no-check-certificate 
$options -O- \"$mirror/$filename\" |" or die "Cannot launch wget.\n";


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


Re: [OpenWrt-Devel] [PATCH] Updated patch to check multiple instances in subfolders in local repository

2012-04-04 Thread Tathagata Das
Hi,
 I have updated the patch as Philip and Jo-Philipp suggested.

Thanks Philip and Jo-Philipp for your feedback.

Signed-off-by: Tathagata Das 

---

diff -Naur a/scripts/download.pl b/scripts/download.pl
--- a/scripts/download.pl   2012-04-04 13:19:27.0 +0530
+++ b/scripts/download.pl   2012-04-04 13:20:34.0 +0530
@@ -9,6 +9,7 @@
 use strict;
 use warnings;
 use File::Basename;
+use File::Copy;
 
 @ARGV > 2 or die "Syntax: $0[ 
...]\n";
 
@@ -74,7 +75,29 @@
if(! -d $target) {
system("mkdir -p $target/");
}
-   system("cp -vf $cache/$filename $target/$filename.dl") == 0 or 
return;
+   system("find $cache -follow -name $filename 2>/dev/null >> 
temp.dls");
+   open TMPDLS,"temp.dls"  and do {
+   my $i = 0;
+   my $link = "";
+   while () {
+   $link = $_;
+   chomp $link;
+   $i++;
+   if ($i > 1) { 
+   print("$i or more instances of 
$filename in $cache found . Only one instance allowed.\n");
+   last;
+   }
+   }
+   if ($i < 1) {
+   print("No instances of $filename found in 
$cache.\n");
+   }
+   if ($i == 1){
+   print("Copying $link.\n");
+   copy($link, "$target/$filename.dl");
+   }
+   unlink("temp.dls") or print("Falied to delete the 
temporary file\n");
+   close TMPDLS;
+   };
system("$md5cmd $target/$filename.dl > 
\"$target/$filename.md5sum\" ") == 0 or return;
} else {
open WGET, "wget -t5 --timeout=20 --no-check-certificate 
$options -O- \"$mirror/$filename\" |" or die "Cannot launch wget.\n";


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


[OpenWrt-Devel] [PATCH] Updated patch to check multiple instances in subfolders in local repository

2012-04-02 Thread Tathagata Das
Hi,
 I have modified the patch as John suggested. This patch will only copy a 
single file from local repository. If more than one instance of the same file 
exists in the subfolders then it will throw an error. I have used latest trunk 
(revision 31050) to test this patch.

Thanks John for your feedback.

Signed-off-by: Tathagata Das 

---

diff -Naur a/scripts/download.pl b/scripts/download.pl
--- a/scripts/download.pl   2012-03-05 10:44:02.0 +0530
+++ b/scripts/download.pl   2012-04-02 17:31:28.0 +0530
@@ -74,7 +74,18 @@
if(! -d $target) {
system("mkdir -p $target/");
}
-   system("cp -vf $cache/$filename $target/$filename.dl") == 0 or 
return;
+   system("find $cache -follow -name $filename 2>/dev/null 1>> 
temp.dls");
+   my $lines = `cat temp.dls | wc -l`;
+   if ($lines != 1 ) {
+   system("echo Error : Number of instances of $filename 
in $cache is $lines");
+   system("echo Only one instance allowed.");
+   system("rm -f temp.dls");
+   return;
+   }
+   else {
+   system("cat temp.dls | xargs -i cp -vf {} 
$target/$filename.dl");
+   system("rm -f temp.dls");
+   }
system("$md5cmd $target/$filename.dl > 
\"$target/$filename.md5sum\" ") == 0 or return;
} else {
open WGET, "wget -t5 --timeout=20 --no-check-certificate 
$options -O- \"$mirror/$filename\" |" or die "Cannot launch wget.\n";


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


[OpenWrt-Devel] +AFs-PATCH+AF0- Patch to maintain path of each compiled package

2012-03-30 Thread Tathagata Das
Hi,
 This patch maintains path of each compiled package (both application and 
kernel module) in a file called ".package-builddir-info" under tmp directory to 
provide a ready reference to the PKG_BUILD_DIR for each package. It may also be 
convenient in referring binaries through that path. 
I have used latest trunk code (revision number 31050) to create this patch.

Signed-off-by: Tathagata Das 

---

diff -Naur a/include/package-dumpinfo.mk b/include/package-dumpinfo.mk
--- a/include/package-dumpinfo.mk   2012-03-20 13:12:11.0 +0530
+++ b/include/package-dumpinfo.mk   2012-03-20 13:08:36.0 +0530
@@ -5,6 +5,16 @@
 # See /LICENSE for more information.
 #
 
+PKG_BUILDDIR_INFO:=$(TMP_DIR)/.package-builddir-info
+
+define DumpBuildDirInfo
+   $(shell if [ -f $(PKG_BUILDDIR_INFO) ]; then \
+   sed -i 's|^$(PKG_NAME):.*|$(PKG_NAME): $(PKG_BUILD_DIR)|g' 
$(PKG_BUILDDIR_INFO); \
+   if [ -z "`grep -w ^$(PKG_NAME): $(PKG_BUILDDIR_INFO)`" ]; then \
+   echo "$(PKG_NAME): $(PKG_BUILD_DIR)" >> $(PKG_BUILDDIR_INFO); 
fi; \
+   else echo "$(PKG_NAME): $(PKG_BUILD_DIR)" >> $(PKG_BUILDDIR_INFO); fi)
+endef
+
 ifneq ($(DUMP),)
 
 dumpinfo: FORCE
diff -Naur a/include/package.mk b/include/package.mk
--- a/include/package.mk2012-03-20 13:09:38.0 +0530
+++ b/include/package.mk2012-03-20 13:17:19.0 +0530
@@ -122,6 +122,7 @@
   $(STAMP_PREPARED):
@-rm -rf $(PKG_BUILD_DIR)
@mkdir -p $(PKG_BUILD_DIR)
+   $(call DumpBuildDirInfo)
$(foreach hook,$(Hooks/Prepare/Pre),$(call $(hook))$(sep))
$(Build/Prepare)
$(foreach hook,$(Hooks/Prepare/Post),$(call $(hook))$(sep))


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


Re: [OpenWrt-Devel] [PATCH] Patch to use local repository and follow symbolic links

2012-03-29 Thread Tathagata Das
Hi,
 Please let me know your feedback on the submitted patch.

Regards,
Tatha

-Original Message-
From: Tathagata Das [mailto:tathag...@alumnux.com] 
Sent: 22 March 2012 17:53
To: 'OpenWrt Development List'
Subject: [PATCH] Patch to use local repository and follow symbolic links

Hi,
  Attached is OpenWRT general purpose patch. Through this patch, OpenWRT 
developers can add local repository paths to refer for a tarball download 
(scripts/localmirrors.default). Changes are done also to follow symbolic links. 
I have used latest trunk source code (revision number 31050) to create this 
patch.

Regards,
Tathagata 


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


Re: [OpenWrt-Devel] +AFs-Patch+AF0- Resubmitting of patch to use external sources of rootfs

2012-03-28 Thread Tathagata Das
Hi,
 May I know whether this patch will be accepted or not ?

Regards,
Tatha

-Original Message-
From: Tathagata Das [mailto:tathag...@alumnux.com] 
Sent: 26 March 2012 12:02
To: 'OpenWrt Development List'
Subject: [Patch] Resubmitting of patch to use external sources of rootfs

Hi,
 This changes allow developers to use external (mentioned) sources of 
rootfs. I have used latest trunk source code (revision number 31050) to 
create this patch.
If the patch submission format is okay then I will resubmit my other 
patches.

Signed-off-by: Tathagata Das 

---

diff -Naur a/Config.in b/Config.in
--- a/Config.in 2012-03-22 11:48:31.0 +0530
+++ b/Config.in 2012-03-22 11:57:07.0 +0530
@@ -63,6 +63,14 @@
help
  Build a compressed tar archive of the the root filesystem

+   config EXTERNAL_CPIO
+   string
+   prompt "Use external cpio" if TARGET_ROOTFS_INITRAMFS
+   default ""
+   help
+ Kernel uses specified external cpio as INITRAMFS_SOURCE
+
+
comment "Root filesystem images"

config TARGET_ROOTFS_EXT4FS
diff -Naur a/include/kernel-defaults.mk b/include/kernel-defaults.mk
--- a/include/kernel-defaults.mk2012-03-22 11:48:04.0 +0530
+++ b/include/kernel-defaults.mk2012-03-22 11:55:37.0 +0530
@@ -55,6 +55,7 @@
 endif

 ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
+  ifeq ($(strip $(CONFIG_EXTERNAL_CPIO)),"")
 define Kernel/SetInitramfs
mv $(LINUX_DIR)/.config $(LINUX_DIR)/.config.old
grep -v -e INITRAMFS -e CONFIG_RD_ -e CONFIG_BLK_DEV_INITRD 
$(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config
@@ -70,6 +71,21 @@
echo -e "$(if 
$(CONFIG_TARGET_INITRAMFS_COMPRESSION_XZ),CONFIG_INITRAMFS_COMPRESSION_XZ=y\nCONFIG_RD_XZ=y,#
 
CONFIG_INITRAMFS_COMPRESSION_XZ is not set\n# CONFIG_RD_XZ is not set)" >> 
$(LINUX_DIR)/.config
 endef
   else
+  define Kernel/SetInitramfs
+   mv $(LINUX_DIR)/.config $(LINUX_DIR)/.config.old
+   grep -v INITRAMFS $(LINUX_DIR)/.config.old > 
$(LINUX_DIR)/.config
+   echo 'CONFIG_INITRAMFS_SOURCE="$(call 
qstrip,$(CONFIG_EXTERNAL_CPIO))"' 
 >> $(LINUX_DIR)/.config
+   echo 'CONFIG_INITRAMFS_ROOT_UID=$(shell id -u)' >> 
$(LINUX_DIR)/.config
+   echo 'CONFIG_INITRAMFS_ROOT_GID=$(shell id -g)' >> 
$(LINUX_DIR)/.config
+   echo "$(if 
$(CONFIG_TARGET_INITRAMFS_COMPRESSION_NONE),CONFIG_INITRAMFS_COMPRESSION_NONE=y,#
 
CONFIG_INITRAMFS_COMPRESSION_NONE is not set)" >> $(LINUX_DIR)/.config
+   echo -e "$(if 
$(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),CONFIG_INITRAMFS_COMPRESSION_GZIP=y\nCONFIG_RD_GZIP=y,#
 
CONFIG_INITRAMFS_COMPRESSION_GZIP is not set\n# CONFIG_RD_GZIP is not set)" 
 >> $(LINUX_DIR)/.config
+   echo -e "$(if 
$(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),CONFIG_INITRAMFS_COMPRESSION_BZIP2=y\nCONFIG_RD_BZIP2=y,#
 
CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set\n# CONFIG_RD_BZIP2 is not 
set)" >> $(LINUX_DIR)/.config
+   echo -e "$(if 
$(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZMA),CONFIG_INITRAMFS_COMPRESSION_LZMA=y\nCONFIG_RD_LZMA=y,#
 
CONFIG_INITRAMFS_COMPRESSION_LZMA is not set\n# CONFIG_RD_LZMA is not set)" 
 >> $(LINUX_DIR)/.config
+   echo -e "$(if 
$(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZO),CONFIG_INITRAMFS_COMPRESSION_LZO=y\nCONFIG_RD_LZO=y,#
 
CONFIG_INITRAMFS_COMPRESSION_LZO is not set\n# CONFIG_RD_LZO is not set)" >> 
$(LINUX_DIR)/.config
+   echo -e "$(if 
$(CONFIG_TARGET_INITRAMFS_COMPRESSION_XZ),CONFIG_INITRAMFS_COMPRESSION_XZ=y\nCONFIG_RD_XZ=y,#
 
CONFIG_INITRAMFS_COMPRESSION_XZ is not set\n# CONFIG_RD_XZ is not set)" >> 
$(LINUX_DIR)/.config
+  endef
+endif
+  else
 define Kernel/SetInitramfs
mv $(LINUX_DIR)/.config $(LINUX_DIR)/.config.old
grep -v INITRAMFS $(LINUX_DIR)/.config.old > 
$(LINUX_DIR)/.config


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


[OpenWrt-Devel] +AFs-Patch+AF0- Resubmitting of patch to use external sources of rootfs

2012-03-25 Thread Tathagata Das
Hi,
 This changes allow developers to use external (mentioned) sources of rootfs. I 
have used latest trunk source code (revision number 31050) to create this patch.
If the patch submission format is okay then I will resubmit my other patches.

Signed-off-by: Tathagata Das 

---

diff -Naur a/Config.in b/Config.in
--- a/Config.in 2012-03-22 11:48:31.0 +0530
+++ b/Config.in 2012-03-22 11:57:07.0 +0530
@@ -63,6 +63,14 @@
help
  Build a compressed tar archive of the the root filesystem
 
+   config EXTERNAL_CPIO
+   string
+   prompt "Use external cpio" if TARGET_ROOTFS_INITRAMFS
+   default ""
+   help
+ Kernel uses specified external cpio as INITRAMFS_SOURCE
+
+
comment "Root filesystem images"
 
config TARGET_ROOTFS_EXT4FS
diff -Naur a/include/kernel-defaults.mk b/include/kernel-defaults.mk
--- a/include/kernel-defaults.mk2012-03-22 11:48:04.0 +0530
+++ b/include/kernel-defaults.mk2012-03-22 11:55:37.0 +0530
@@ -55,6 +55,7 @@
 endif
 
 ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
+  ifeq ($(strip $(CONFIG_EXTERNAL_CPIO)),"")
 define Kernel/SetInitramfs
mv $(LINUX_DIR)/.config $(LINUX_DIR)/.config.old
grep -v -e INITRAMFS -e CONFIG_RD_ -e CONFIG_BLK_DEV_INITRD 
$(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config
@@ -70,6 +71,21 @@
echo -e "$(if 
$(CONFIG_TARGET_INITRAMFS_COMPRESSION_XZ),CONFIG_INITRAMFS_COMPRESSION_XZ=y\nCONFIG_RD_XZ=y,#
 CONFIG_INITRAMFS_COMPRESSION_XZ is not set\n# CONFIG_RD_XZ is not set)" >> 
$(LINUX_DIR)/.config
 endef
   else
+  define Kernel/SetInitramfs
+   mv $(LINUX_DIR)/.config $(LINUX_DIR)/.config.old
+   grep -v INITRAMFS $(LINUX_DIR)/.config.old > 
$(LINUX_DIR)/.config
+   echo 'CONFIG_INITRAMFS_SOURCE="$(call 
qstrip,$(CONFIG_EXTERNAL_CPIO))"' >> $(LINUX_DIR)/.config
+   echo 'CONFIG_INITRAMFS_ROOT_UID=$(shell id -u)' >> 
$(LINUX_DIR)/.config
+   echo 'CONFIG_INITRAMFS_ROOT_GID=$(shell id -g)' >> 
$(LINUX_DIR)/.config
+   echo "$(if 
$(CONFIG_TARGET_INITRAMFS_COMPRESSION_NONE),CONFIG_INITRAMFS_COMPRESSION_NONE=y,#
 CONFIG_INITRAMFS_COMPRESSION_NONE is not set)" >> $(LINUX_DIR)/.config
+   echo -e "$(if 
$(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),CONFIG_INITRAMFS_COMPRESSION_GZIP=y\nCONFIG_RD_GZIP=y,#
 CONFIG_INITRAMFS_COMPRESSION_GZIP is not set\n# CONFIG_RD_GZIP is not set)" >> 
$(LINUX_DIR)/.config
+   echo -e "$(if 
$(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),CONFIG_INITRAMFS_COMPRESSION_BZIP2=y\nCONFIG_RD_BZIP2=y,#
 CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set\n# CONFIG_RD_BZIP2 is not set)" 
>> $(LINUX_DIR)/.config
+   echo -e "$(if 
$(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZMA),CONFIG_INITRAMFS_COMPRESSION_LZMA=y\nCONFIG_RD_LZMA=y,#
 CONFIG_INITRAMFS_COMPRESSION_LZMA is not set\n# CONFIG_RD_LZMA is not set)" >> 
$(LINUX_DIR)/.config
+   echo -e "$(if 
$(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZO),CONFIG_INITRAMFS_COMPRESSION_LZO=y\nCONFIG_RD_LZO=y,#
 CONFIG_INITRAMFS_COMPRESSION_LZO is not set\n# CONFIG_RD_LZO is not set)" >> 
$(LINUX_DIR)/.config
+   echo -e "$(if 
$(CONFIG_TARGET_INITRAMFS_COMPRESSION_XZ),CONFIG_INITRAMFS_COMPRESSION_XZ=y\nCONFIG_RD_XZ=y,#
 CONFIG_INITRAMFS_COMPRESSION_XZ is not set\n# CONFIG_RD_XZ is not set)" >> 
$(LINUX_DIR)/.config
+  endef
+endif
+  else
 define Kernel/SetInitramfs
mv $(LINUX_DIR)/.config $(LINUX_DIR)/.config.old
grep -v INITRAMFS $(LINUX_DIR)/.config.old > 
$(LINUX_DIR)/.config


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


[OpenWrt-Devel] [PATCH] Patch to unset LPATH flag

2012-03-23 Thread Tathagata Das
Hi,
 Attach patch unsets LPATH flag (found configured in some custom host 
distributions) to make OpenWRT compile its toolchain without any issues. I have 
used latest trunk source code (revision number 31050) to create this patch.

Regards,
Tathagata 


env-fix-unset-lpath
Description: Binary data
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] Patch to add uClibc configuration

2012-03-23 Thread Tathagata Das
Hi,
 Attached file adds uClibc configuration specification for external toolchain. 
Instead of having to configure specifications via make menuconfig for external 
toolchain, one may select the package libuClibc, which additionally will copy 
./lib/ld-uClibc* and ./lib/libuClibc*. I have used latest trunk source code 
(revision number 31050) to create this patch.

Regards,
Tathagata 



add-external-uClibc-support
Description: Binary data
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] Patch to use local repository and follow symbolic links

2012-03-22 Thread Tathagata Das
Hi,
  Attached is OpenWRT general purpose patch. Through this patch, OpenWRT 
developers can add local repository paths to refer for a tarball download 
(scripts/localmirrors.default). Changes are done also to follow symbolic links. 
I have used latest trunk source code (revision number 31050) to create this 
patch.

Regards,
Tathagata 



localmirrors-default-support.patch
Description: Binary data
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] Patch to use external sources of rootfs

2012-03-21 Thread Tathagata Das
Hi,
  Attached is OpenWRT general purpose patch. Through this patch, OpenWRT 
developers may use external (mentioned) sources of rootfs. I have used latest 
trunk source code (revision number 31050) to create this patch.

Regards,
Tathagata 




external-cpio-support.patch
Description: Binary data
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Updated kernel patch in trunk to support brcm47xx BCMA NAND flash

2012-03-15 Thread Tathagata Das
Hi Hauke,
 Thanks for adding that patch. I tested it and it worked on my device.

Regards,
Tatha

-Original Message-
From: Hauke Mehrtens [mailto:ha...@hauke-m.de] 
Sent: 15 March 2012 05:02
To: Tathagata Das
Cc: 'OpenWrt Development List'; 'Florian Fainelli'
Subject: Re: [PATCH] Updated kernel patch in trunk to support brcm47xx BCMA 
NAND flash

On 03/12/2012 08:31 AM, Tathagata Das wrote:
> Hi Hauke,
>  That code works on my device as well. Attached is the updated kernel patch 
> to support brcm47xx BCMA NAND flash.
> 
> Regards,
> Tatha
> 
> -Original Message-
> From: Hauke Mehrtens [mailto:ha...@hauke-m.de] 
> Sent: 10 March 2012 05:01
> To: Tathagata Das
> Cc: 'OpenWrt Development List'; 'Florian Fainelli'
> Subject: Re: [PATCH] Updated kernel patch in trunk to support brcm47xx BCMA 
> NAND flash
> 
> Hi Tatha,
> 
> sorry for answering so late I am currently very busy.
> 
> If I set CONFIG_BCMA_SFLASH=y and CONFIG_BCMA_NFLASH=y in the kernel
> config, which I want to do for the default image in OpenWrt the image
> will not work on by device with serial flash any more because
> bus->drv_cc.flash_type will contain BCMA_NFLASH and not BCMA_SFLASH. The
> patch in the mail I linked does not work as is with the current version
> of your patch but you should be able to modify it. ;-)
> The code in the linked mail should be able to detect nand flash at
> runtime. Without this modification it does not work on my device, which
> uses serial flash, but I do not know if it works on your device with
> nand flash.
> 

Hi Tatha,

the patch was finally added with some small modifications in commit
r30943. Could you please try if current trunk is working on your device.

Hauke





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


Re: [OpenWrt-Devel] [PATCH] Updated kernel patch in trunk to support brcm47xx BCMA NAND flash

2012-02-29 Thread Tathagata Das
Hi Hauke,
 Changes mentioned in 
https://lists.openwrt.org/pipermail/openwrt-devel/2012-January/013481.html will 
not work now as there is no such bcma_nflash_init() function anymore. Now flash 
detection is done only once and that is in NAND flash section using generic 
function nand_scan_ident.

Regards,
Tatha

-Original Message-
From: Hauke Mehrtens [mailto:ha...@hauke-m.de] 
Sent: 01 March 2012 04:39
To: Tathagata Das
Cc: 'OpenWrt Development List'; 'Florian Fainelli'
Subject: Re: [PATCH] Updated kernel patch in trunk to support brcm47xx BCMA 
NAND flash

On 02/27/2012 09:44 AM, Tathagata Das wrote:
> Hi Hauke,
>  I have modified my patch according to your comments except in two cases.
> 
> "We want to build one image supporting devices with serial and with nand 
> flash. This makes it just possible to support one flash type at a time."
> Right now flash type can be either NAND or SERIAL. If we want to have two 
> flash simultaneously then I think we need to have another parameter similar 
> to "bcma_flash_type flash_type" What is your opinion ?
I want to build one image which can be flashed onto a device which uses
NAND flash or a device using serial flash. I have never seen any device
with two (different) flash chips, so this does not have to be supported.
In the last patch it is only possible to build an image which will use
NAND flash or an image which will support serial flash, they are
exclusive or. I want to have it like it is for parallel and serial flash
where you are able to build an image with support for both and it auto
detects it when booting and loads the correct driver.

What about using this code, it work correctly on my device with serial
flash, but I do not know if it correctly detects nand flash?
https://lists.openwrt.org/pipermail/openwrt-devel/2012-January/013481.html

> "cpu_relax();
>  Why is this needed?"
> Above change was done according to Florian's comment. 

using cpu_relax() is correct there, I just read some documentations
about it.

> 
> Florian,
>  Can you clarify it ?
> 
> Once these above cases resolve I will provide you the updated patch.
> 
> Regards,
> Tatha
> 
> -Original Message-
> From: Hauke Mehrtens [mailto:ha...@hauke-m.de] 
> Sent: 25 February 2012 19:08
> To: Tathagata Das
> Cc: 'OpenWrt Development List'; 'Florian Fainelli'
> Subject: Re: [PATCH] Updated kernel patch in trunk to support brcm47xx BCMA 
> NAND flash
> 
> Hi Tathagata Das,
> 
> I had a look at bthe patch and added some comments, if bcma_nflash_init
> is not needed any more where is struct bcma_nflash initilized?
> 
> Hauke
> 
> On 02/23/2012 02:27 PM, Tathagata Das wrote:
>> Hi,
>>   Attached is the updated kernel patch to support brcm47xx BCMA NAND flash. 
>> I have used latest trunk source code to create this patch.
>> Thanks to Florian and Hauke for their comments.
>>
>> Regards,
>> Tathagata 
>>
>> diff -Naur a/arch/mips/bcm47xx/bus.c b/arch/mips/bcm47xx/bus.c
>> --- a/arch/mips/bcm47xx/bus.c2012-02-17 16:34:21.0 +0530
>> +++ b/arch/mips/bcm47xx/bus.c2012-02-23 18:22:17.0 +0530
>> @@ -2,6 +2,7 @@
>>   * BCM947xx nvram variable access
>>   *
>>   * Copyright (C) 2011 Hauke Mehrtens 
>> + * Copyright (C) 2011-2012 Tathagata Das 
>>   *
>>   * This program is free software; you can redistribute  it and/or modify it
>>   * under  the terms of  the GNU General  Public License as published by the
>> @@ -92,3 +93,9 @@
>>  sflash->numblocks = scc->sflash.numblocks;
>>  sflash->size = scc->sflash.size;
>>  }
>> +
>> +void bcm47xx_nflash_struct_bcma_init(struct bcm47xx_nflash *nflash, struct 
>> bcma_drv_cc *bcc)
>> +{
>> +nflash->nflash_type = BCM47XX_BUS_TYPE_BCMA;
>> +nflash->bcc = bcc;
>> +}
>> diff -Naur a/arch/mips/bcm47xx/nvram.c b/arch/mips/bcm47xx/nvram.c
>> --- a/arch/mips/bcm47xx/nvram.c  2012-02-17 16:34:22.0 +0530
>> +++ b/arch/mips/bcm47xx/nvram.c  2012-02-23 18:20:57.0 +0530
>> @@ -4,6 +4,7 @@
>>   * Copyright (C) 2005 Broadcom Corporation
>>   * Copyright (C) 2006 Felix Fietkau 
>>   * Copyright (C) 2010-2011 Hauke Mehrtens 
>> + * Copyright (C) 2011-2012 Tathagata Das 
>>   *
>>   * This program is free software; you can redistribute  it and/or modify it
>>   * under  the terms of  the GNU General  Public License as published by the
>> @@ -21,6 +22,7 @@
>>  #include 
>>  #include 
>>  #include 
>> +#include 
>>  
>>  char nvram_buf[NVRAM_SPACE];
>>  EXPORT_SYMBOL(nvram_buf);
>> @@ -159,6 +161

[OpenWrt-Devel] [PATCH] Updated kernel patch in trunk to support brcm47xx BCMA NAND flash

2012-02-29 Thread Tathagata Das
Hi,
  Attached is the updated kernel patch to support brcm47xx BCMA NAND flash. It 
contains fix of issue in write small length.
I have used latest trunk source code to create this patch. I have tested it on 
Netgear WNR3500Lv2.

Thanks all who gave comments.

Regards,
Tathagata 


9991-bcm47xx-bcma-nandflash.patch
Description: Binary data
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Updated kernel patch in trunk to support brcm47xx BCMA NAND flash

2012-02-28 Thread Tathagata Das
Hi Florian,
  Please find my inline comments.

Regards,
Tatha

-Original Message-
From: Florian Fainelli [mailto:f.faine...@gmail.com] On Behalf Of Florian 
Fainelli
Sent: 28 February 2012 14:54
To: Tathagata Das
Cc: 'OpenWrt Development List'; 'Hauke Mehrtens'
Subject: Re: [PATCH] Updated kernel patch in trunk to support brcm47xx BCMA 
NAND flash

Hello Tatha,

Le 02/28/12 07:50, Tathagata Das a écrit :
> Hi,
>Attached is the updated kernel patch to support brcm47xx BCMA NAND flash.
> I have used latest trunk source code to create this patch. I have tested it 
> on Netgear WNR3500Lv2.
>
> Thanks to Florian and Hauke for their comments.

And thank you for your efforts on this, I am sorry, but I found a couple 
of small issues in your patch, which I attached inline for easier 
commenting:

9991-bcm47xx-bcma-nandflash.patch


diff -Naur a/arch/mips/bcm47xx/bus.c b/arch/mips/bcm47xx/bus.c
--- a/arch/mips/bcm47xx/bus.c   2012-02-17 16:34:21.0 +0530
+++ b/arch/mips/bcm47xx/bus.c   2012-02-23 18:22:17.0 +0530
@@ -2,6 +2,7 @@
   * BCM947xx nvram variable access
   *
   * Copyright (C) 2011 Hauke Mehrtens
+ * Copyright (C) 2011-2012 Tathagata Das
   *
   * This program is free software; you can redistribute  it and/or modify it
   * under  the terms of  the GNU General  Public License as published by the
@@ -92,3 +93,9 @@
sflash->numblocks = scc->sflash.numblocks;
sflash->size = scc->sflash.size;
  }
+
+void bcm47xx_nflash_struct_bcma_init(struct bcm47xx_nflash *nflash, struct 
bcma_drv_cc *bcc)
+{
+   nflash->nflash_type = BCM47XX_BUS_TYPE_BCMA;
+   nflash->bcc = bcc;
+}
diff -Naur a/arch/mips/bcm47xx/nvram.c b/arch/mips/bcm47xx/nvram.c
--- a/arch/mips/bcm47xx/nvram.c 2012-02-17 16:34:22.0 +0530
+++ b/arch/mips/bcm47xx/nvram.c 2012-02-23 18:20:57.0 +0530
@@ -4,6 +4,7 @@
   * Copyright (C) 2005 Broadcom Corporation
   * Copyright (C) 2006 Felix Fietkau
   * Copyright (C) 2010-2011 Hauke Mehrtens
+ * Copyright (C) 2011-2012 Tathagata Das
   *
   * This program is free software; you can redistribute  it and/or modify it
   * under  the terms of  the GNU General  Public License as published by the
@@ -21,6 +22,7 @@
  #include
  #include
  #include
+#include

  char nvram_buf[NVRAM_SPACE];
  EXPORT_SYMBOL(nvram_buf);
@@ -159,6 +161,53 @@
return 0;
  }

+static int early_nvram_init_nflash(void)
+{
+   struct nvram_header *header;
+   u32 off;
+   int ret;
+   int len;
+   u32 flash_size = bcm47xx_nflash.size;
+   u8 tmpbuf[NFL_SECTOR_SIZE];
+   int i;
+   u32 *src, *dst;
+
+   /* check if the struct is already initilized */
+   if (!flash_size)
+   return -1;
+   
+   cfe_env = 0;
+
+   off = FLASH_MIN;
+   while (off<= flash_size) {
+   ret = bcma_nflash_read(bcm47xx_nflash.bcc, off, 
NFL_SECTOR_SIZE, tmpbuf);
+   if (ret != NFL_SECTOR_SIZE) {
+   goto done;
+   }

The brackets here are not required.

[Tatha]: Done.

  + header = (struct nvram_header *)tmpbuf;
+   if (header->magic == NVRAM_HEADER) {
+   goto found;
+   }

They are not required here too.

[Tatha]: Done.

  + off<<= 1;
+   }
+
+   ret = -1;
+   goto done;
+
+found:
+   len = header->len;
+   header = (struct nvram_header *) KSEG1ADDR(NAND_FLASH1 + off);
+   src = (u32 *) header;
+   dst = (u32 *) nvram_buf;
+   for (i = 0; i<  sizeof(struct nvram_header); i += 4)
+   *dst++ = *src++;
+   for (; i<  len&&  i<  NVRAM_SPACE; i += 4)
+   *dst++ = *src++;

Did you have to do this because memcpy() did not work, due to byte access 
instead of word access?

[Tatha]: Yes, you are right.

  + ret = 0;
+done:
+   return ret;
+}
+
[snip]

+
+/* Issue a nand flash command */
+static inline void bcma_nflash_cmd(struct bcma_drv_cc *cc, u32 opcode)
+{
+   bcma_cc_write32(cc, NAND_CMD_START, opcode);
+   bcma_cc_read32(cc,  NAND_CMD_START);
+}
+
+/* Check offset and length */
+static int bcma_nflash_offset_is_valid(struct bcma_drv_cc *cc, u32 offset, u32 
len, u32 mask)
+{
+   if ((offset&  mask) != 0 || (len&  mask) != 0) {
+   pr_err("%s(): Address is not aligned. offset: %x, len: %x, 
mask: %x\n", __func__, offset, len, mask);
+   BUG_ON(1);
+   return 1;
+   }

a BUG_ON() here is a little hard, just the printk should be sufficient in case 
someone is doing unaligned accesses.

[Tatha]: Done.

  +
+   if offset + len)>>  20)>  cc->nflash.size) ||
+   offset + len)>>  20) == cc->nflash.size)&&

these two lines are equal to:

((offset + len)>>  20)>= cc->nflash.size

[Tatha]: Done. 

  + (((offset + 

Re: [OpenWrt-Devel] [PATCH] Updated kernel patch in trunk to support brcm47xx BCMA NAND flash

2012-02-28 Thread Tathagata Das
I have found one issue in write function.
If the length of writing data is smaller than pagesize then it fails to write. 
I am now solving this issue.

Regards,
Tathagata

-Original Message-
From: Tathagata Das [mailto:tathag...@alumnux.com] 
Sent: 28 February 2012 12:20
To: 'OpenWrt Development List'
Cc: 'Florian Fainelli'; 'Hauke Mehrtens'
Subject: [PATCH] Updated kernel patch in trunk to support brcm47xx BCMA NAND 
flash

Hi,
  Attached is the updated kernel patch to support brcm47xx BCMA NAND flash.
I have used latest trunk source code to create this patch. I have tested it on 
Netgear WNR3500Lv2.

Thanks to Florian and Hauke for their comments.

Regards,
Tathagata 

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


[OpenWrt-Devel] [PATCH] Updated kernel patch in trunk to support brcm47xx BCMA NAND flash

2012-02-27 Thread Tathagata Das
Hi,
  Attached is the updated kernel patch to support brcm47xx BCMA NAND flash. 
I have used latest trunk source code to create this patch. I have tested it on 
Netgear WNR3500Lv2.

Thanks to Florian and Hauke for their comments.

Regards,
Tathagata 


9991-bcm47xx-bcma-nandflash.patch
Description: Binary data
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Updated kernel patch in trunk to support brcm47xx BCMA NAND flash

2012-02-27 Thread Tathagata Das
Hi Hauke,
 I have modified my patch according to your comments except in two cases.

"We want to build one image supporting devices with serial and with nand flash. 
This makes it just possible to support one flash type at a time."
Right now flash type can be either NAND or SERIAL. If we want to have two flash 
simultaneously then I think we need to have another parameter similar to 
"bcma_flash_type flash_type" What is your opinion ?

"cpu_relax();
 Why is this needed?"
Above change was done according to Florian's comment. 

Florian,
 Can you clarify it ?

Once these above cases resolve I will provide you the updated patch.

Regards,
Tatha

-Original Message-
From: Hauke Mehrtens [mailto:ha...@hauke-m.de] 
Sent: 25 February 2012 19:08
To: Tathagata Das
Cc: 'OpenWrt Development List'; 'Florian Fainelli'
Subject: Re: [PATCH] Updated kernel patch in trunk to support brcm47xx BCMA 
NAND flash

Hi Tathagata Das,

I had a look at bthe patch and added some comments, if bcma_nflash_init
is not needed any more where is struct bcma_nflash initilized?

Hauke

On 02/23/2012 02:27 PM, Tathagata Das wrote:
> Hi,
>   Attached is the updated kernel patch to support brcm47xx BCMA NAND flash. I 
> have used latest trunk source code to create this patch.
> Thanks to Florian and Hauke for their comments.
> 
> Regards,
> Tathagata 
> 
> diff -Naur a/arch/mips/bcm47xx/bus.c b/arch/mips/bcm47xx/bus.c
> --- a/arch/mips/bcm47xx/bus.c 2012-02-17 16:34:21.0 +0530
> +++ b/arch/mips/bcm47xx/bus.c 2012-02-23 18:22:17.0 +0530
> @@ -2,6 +2,7 @@
>   * BCM947xx nvram variable access
>   *
>   * Copyright (C) 2011 Hauke Mehrtens 
> + * Copyright (C) 2011-2012 Tathagata Das 
>   *
>   * This program is free software; you can redistribute  it and/or modify it
>   * under  the terms of  the GNU General  Public License as published by the
> @@ -92,3 +93,9 @@
>   sflash->numblocks = scc->sflash.numblocks;
>   sflash->size = scc->sflash.size;
>  }
> +
> +void bcm47xx_nflash_struct_bcma_init(struct bcm47xx_nflash *nflash, struct 
> bcma_drv_cc *bcc)
> +{
> + nflash->nflash_type = BCM47XX_BUS_TYPE_BCMA;
> + nflash->bcc = bcc;
> +}
> diff -Naur a/arch/mips/bcm47xx/nvram.c b/arch/mips/bcm47xx/nvram.c
> --- a/arch/mips/bcm47xx/nvram.c   2012-02-17 16:34:22.0 +0530
> +++ b/arch/mips/bcm47xx/nvram.c   2012-02-23 18:20:57.0 +0530
> @@ -4,6 +4,7 @@
>   * Copyright (C) 2005 Broadcom Corporation
>   * Copyright (C) 2006 Felix Fietkau 
>   * Copyright (C) 2010-2011 Hauke Mehrtens 
> + * Copyright (C) 2011-2012 Tathagata Das 
>   *
>   * This program is free software; you can redistribute  it and/or modify it
>   * under  the terms of  the GNU General  Public License as published by the
> @@ -21,6 +22,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  char nvram_buf[NVRAM_SPACE];
>  EXPORT_SYMBOL(nvram_buf);
> @@ -159,6 +161,53 @@
>   return 0;
>  }
>  
> +static int early_nvram_init_nflash(void)
> +{
> + struct nvram_header *header;
> + u32 off;
> + int ret;
> + int len;
> + u32 flash_size = bcm47xx_nflash.size;
> + u8 tmpbuf[NFL_SECTOR_SIZE];
> + int i;
> + u32 *src, *dst;
> +
> + /* check if the struct is already initilized */
> + if (!flash_size)
> + return -1;
> + 
> + cfe_env = 0;
> +
> + off = FLASH_MIN;
> + while (off <= flash_size) {
> + ret = bcma_nflash_read(bcm47xx_nflash.bcc, off, 
> NFL_SECTOR_SIZE, tmpbuf);
> + if (ret != NFL_SECTOR_SIZE) {
> + goto done;
> + }
> + header = (struct nvram_header *)tmpbuf;
> + if (header->magic == NVRAM_HEADER) {
> + goto found;
> + }
> + off <<= 1;
> + }
> +
> + ret = -1;
> + goto done;
> +
> +found:
> + len = header->len;
> + header = (struct nvram_header *) KSEG1ADDR(NAND_FLASH1 + off);
> + src = (u32 *) header;
> + dst = (u32 *) nvram_buf;
> + for (i = 0; i < sizeof(struct nvram_header); i += 4)
> + *dst++ = *src++;
> + for (; i < len && i < NVRAM_SPACE; i += 4)
> + *dst++ = *src++;
> + ret = 0;
> +done:
> + return ret;
> +}
> +
>  static void early_nvram_init(void)
>  {
>   int err = 0;
> @@ -185,6 +234,10 @@
>   err = early_nvram_init_sflash();
>   if (err < 0)
>   printk(KERN_WARNING "can not read from flash: 
> %i\n", err);
> + } else if (bcm4

[OpenWrt-Devel] [PATCH] Updated kernel patch in trunk to support brcm47xx BCMA NAND flash

2012-02-23 Thread Tathagata Das
Hi,
  Attached is the updated kernel patch to support brcm47xx BCMA NAND flash. I 
have used latest trunk source code to create this patch.
Thanks to Florian and Hauke for their comments.

Regards,
Tathagata 


9991-bcm47xx-bcma-nandflash.patch
Description: Binary data
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Updated kernel patch in trunk to support brcm47xx BCMA NAND flash

2012-02-15 Thread Tathagata Das
Hi Hauke,
 Yes, I am still working on that patch. I am now integrating Florian
comments. Also I found couple of issues in write and erase functions. I have
solved them too.
I will submit my patch quickly.

Regards,
Tathagata

-Original Message-
From: Hauke Mehrtens [mailto:ha...@hauke-m.de] 
Sent: 14 February 2012 15:16
To: tathag...@alumnux.com; OpenWrt Development List
Cc: Florian Fainelli
Subject: Re: [OpenWrt-Devel] [PATCH] Updated kernel patch in trunk to
support brcm47xx BCMA NAND flash

On 01/12/2012 02:48 PM, Tathagata Das wrote:
> Hi Florian,
>  Thanks a lot for your comment. I will update the patch accordingly.
> 
> Regards,
> Tathagata
> 
Hi Tathagata,

are you still working on this patch? I would relay like to see NAND
flash support in OpenWrt. When you integrated Florian comments into the
patch it should be good enough to be integrated.

Hauke


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


Re: [OpenWrt-Devel] [PATCH] Updated kernel patch in trunk to support brcm47xx BCMA NAND flash

2012-01-12 Thread Tathagata Das

Hi Florian,
 Thanks a lot for your comment. I will update the patch accordingly.

Regards,
Tathagata

On 01/12/2012 06:40 PM, Florian Fainelli wrote:

Hello Tathagata,

On 01/10/12 13:00, Tathagata Das wrote:

Hi,
  Attached is the updated kernel patch to support brcm47xx BCMA NAND
flash. This patch uses driver/mtd/nand/nand_base.c. I have used latest
trunk source code to create this patch.


I have inlined some comments, how much throughput do you get out of 
the driver in read/write?




Regards,
Tathagata 

9991-bcm47xx-bcma-nandflash.patch


diff -Naur a/arch/mips/bcm47xx/bus.c b/arch/mips/bcm47xx/bus.c
--- a/arch/mips/bcm47xx/bus.c2011-12-26 13:09:35.028170411 +0530
+++ b/arch/mips/bcm47xx/bus.c2012-01-05 11:41:55.781832993 +0530
@@ -92,3 +92,46 @@
  sflash->numblocks = scc->sflash.numblocks;
  sflash->size = scc->sflash.size;
  }
+
+#ifdef CONFIG_BCMA_NFLASH
+static int bcm47xx_nflash_bcma_read(struct bcm47xx_nflash *dev, u32 
offset, u32 len, u8 *buf)

+{
+return bcma_nflash_read(dev->bcc, offset, len, buf);
+}
+
+static int bcm47xx_nflash_bcma_poll(struct bcm47xx_nflash *dev, u32 
offset)

+{
+return bcma_nflash_poll(dev->bcc);
+}
+
+static int bcm47xx_nflash_bcma_write(struct bcm47xx_nflash *dev, u32 
offset, u32 len, const u8 *buf)

+{
+return bcma_nflash_write(dev->bcc, offset, len, buf);
+}
+
+static int bcm47xx_nflash_bcma_erase(struct bcm47xx_nflash *dev, u32 
offset)

+{
+return bcma_nflash_erase(dev->bcc, offset);
+}
+
+void bcm47xx_nflash_struct_bcma_init(struct bcm47xx_nflash *nflash, 
struct bcma_drv_cc *bcc)

+{
+int i;
+
+nflash->nflash_type = BCM47XX_BUS_TYPE_BCMA;
+nflash->bcc = bcc;
+
+nflash->read = bcm47xx_nflash_bcma_read;
+nflash->poll = bcm47xx_nflash_bcma_poll;
+nflash->write = bcm47xx_nflash_bcma_write;
+nflash->erase = bcm47xx_nflash_bcma_erase;
+
+nflash->blocksize = bcc->nflash.blocksize;
+nflash->numblocks = bcc->nflash.numblocks;
+nflash->pagesize = bcc->nflash.pagesize;
+nflash->size = bcc->nflash.size;
+
+for (i=0; i<5; i++)
+nflash->id[i] = bcc->nflash.id[i];


Do you really need to read the flash id that early?


+}
+#endif /* CONFIG_BCMA_NFLASH */
diff -Naur a/arch/mips/bcm47xx/nvram.c b/arch/mips/bcm47xx/nvram.c
--- a/arch/mips/bcm47xx/nvram.c2011-12-26 13:09:36.274170411 +0530
+++ b/arch/mips/bcm47xx/nvram.c2012-01-10 14:48:15.981647409 +0530
@@ -21,6 +21,7 @@
  #include
  #include
  #include
+#include

  char nvram_buf[NVRAM_SPACE];
  EXPORT_SYMBOL(nvram_buf);
@@ -159,6 +160,55 @@
  return 0;
  }

+static int early_nvram_init_nflash(void)
+{
+struct nvram_header *header;
+u32 off;
+int ret;
+int len;
+u32 flash_size = bcm47xx_nflash.size * 1024 * 1024;
+u8 *tmpbuf = NULL;
+int i;
+   u32 *src, *dst;
+
+/* check if the struct is already initilized */
+if (!flash_size)
+return -1;
+
+cfe_env = 0;
+
+tmpbuf = (u8 *)kmalloc(NFL_SECTOR_SIZE, GFP_KERNEL);


Is not that a little early for using kmalloc? NFL_SECTOR_SIZE is only 
512 bytes, so either using a buffer marked with __initdata or 
allocating it on the stack should be okay.



+off = FLASH_MIN;
+while (off<= flash_size) {
+ret = bcm47xx_nflash.read(&bcm47xx_nflash, off, 
NFL_SECTOR_SIZE, tmpbuf);

+if (ret != NFL_SECTOR_SIZE) {
+goto done;
+}
+header = (struct nvram_header *)tmpbuf;
+if (header->magic == NVRAM_HEADER) {
+goto found;
+}
+off<<= 1;
+}
+
+ret = -1;
+goto done;
+
+found:
+len = header->len;
+header = (struct nvram_header *) KSEG1ADDR(NAND_FLASH1 + off);
+   src = (u32 *) header;
+   dst = (u32 *) nvram_buf;
+   for (i = 0; i<  sizeof(struct nvram_header); i += 4)
+  *dst++ = *src++;
+   for (; i<  len&&  i<  NVRAM_SPACE; i += 4)
+  *dst++ = *src++;
+ret = 0;
+done:
+kfree(tmpbuf);
+return ret;
+}


The identation of these lines is not coherent with the rest.


+
  static void early_nvram_init(void)
  {
  int err = 0;
@@ -185,6 +235,10 @@
  err = early_nvram_init_sflash();
  if (err<  0)
  printk(KERN_WARNING "can not read from flash: 
%i\n", err);
+} else if (bcm47xx_bus.bcma.bus.drv_cc.flash_type == 
BCMA_NFLASH) {

+err = early_nvram_init_nflash();
+if (err<  0)
+printk(KERN_WARNING "can not read from nflash: 
%i\n", err);

  } else {
  printk(KERN_WARNING "unknow flash type\n");


Consider using a switch() case() statement here, two cases to handle 
is enough to start using it.



  }
diff -Naur a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c
--- a/arch/mips/bcm47xx/setup.c2011-12-26 13:09:36.247170411 +0530
+++ b/arch/mips/bcm47xx/setup.c201

Re: [OpenWrt-Devel] [PATCH] Updated kernel patch in trunk to support brcm47xx BCMA NAND flash

2012-01-12 Thread Tathagata Das

Hi Hauke,
 I guess some NAND flash specific code are not under NAND flash tag.

Regards,
Tatha

On 01/12/2012 04:51 PM, Hauke Mehrtens wrote:

On 01/12/2012 04:13 AM, tathagata wrote:

Hi Hauke,
  I will modify it and send updated patch.
Which hardware are you using ?

Regards,
Tathagata

Hi Tathagata,

I am using a Netgear WNDR3400 with an BCM4716 with Serial flash. In the
evening I will look where exactly it fails.

Hauke


On 12.01.2012 03:41, Hauke Mehrtens wrote:

On 01/10/2012 01:00 PM, Tathagata Das wrote:

Hi,
  Attached is the updated kernel patch to support brcm47xx BCMA NAND
flash. This patch uses driver/mtd/nand/nand_base.c. I have used latest
trunk source code to create this patch.

Regards,
Tathagata

Hi Tathagata,

your patch causes my system to not boot any more. These are the last
lines I see:
[0.00] bcma: IRQ reconfiguration done
[0.00] bcma: core 0x0800, irq : 2(S)* 3  4  5  6  D  I
[0.00] bcma: core 0x082c, irq : 2(S)* 3  4  5  6  D  I
[0.00] BUS Capability: 184801c9

Some additional points I have:
* The KConfig option MTD_NAND_BCM47XX should select BCMA_NFLASH.
* brcm47xx does not build without MTD_NAND_BCM47XX set.
* In some places your patch is wrongly formated, it should use tabs
instead of spaces.

Could you please post the patch inlined into the mail next time it makes
reviewing a loot easier.

Hauke



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


Re: [OpenWrt-Devel] [PATCH] Kernel patch in trunk to support brcm47xx BCMA USB

2012-01-03 Thread Tathagata Das

Hi Hauke,
 I built from scratch with your patch. I hope your changes were applied 
because I used revision 29611.

I did not see any of those message as you mentioned.
If I am able to fix this issue I will send you the patch for new device.

Regards,
Tathagata

On 01/04/2012 12:38 AM, Hauke Mehrtens wrote:

On 12/26/2011 09:14 AM, Tathagata Das wrote:

Hi Hauke,
USB is still not working. I have used trunk with version number 29611.
Did you test USB ?

Regards,
Tathagata

Hi Tathagata,

Sorry for the delay.
I tried the USB patch on my bcm4716 based device, but you have a newer
device and I have never tried it on such a device.

Do you get a message like "Timeout waiting for bitmask..." or "Failed to
enable mi..." or "USB20H mdio_rddata..." ?
Was the change I did in r29605 applied to your build? OpenWrt does not
build the hole kernel from scratch when a patch was changed, you
probably have to delete build_dir/linux-brcm47xx/ at first and build again.

Hauke

On 12/24/2011 03:31 AM, Hauke Mehrtens wrote:

Hi Tathagata,

I found an error in my initialization code for usb cores with rev>= 5
like yours. Could you please try a version with my fix in r29605.

Hauke

On 12/23/2011 08:37 AM, Tathagata Das wrote:

I tested USB with latest trunk (revision number 29600) and it did not
work. When I attached my USB drive to the board I received below error
messages.

[  410.408000] usb 1-1: new high speed USB device number 2 using
ehci-platform
[  410.584000] usb 1-1: unable to read config index 0
descriptor/start: -71
[  410.588000] usb 1-1: chopping to 0 config(s)
[  410.604000] usb 1-1: string descriptor 0 read error: -71
[  410.608000] usb 1-1: no configuration chosen from 0 choices

However with my USB patch I can mount the same USB drive.

Regards,
Tathagata

On 12/23/2011 02:26 AM, Hauke Mehrtens wrote:

On 12/14/2011 06:19 AM, Tathagata Das wrote:

Hi,
Attached is the kernel patch to support brcm47xx BCMA USB (both
OHCI and
EHCI).
I have used latest trunk source code to create this patch.

Regards,
Tathagata

Hi Tathagata,

I added my USB Host driver for bcma in commit r29575. The hole
architecture with the ohci driver starting the ehci driver was crap and
would never be accepted in mainline kernel. I will try to push this
into
mainline kernel.

Your patch for USB support is rejected then.

Please try recent trunk and report a problem if USB does not work as
expected.

Hauke




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


Re: [OpenWrt-Devel] [PATCH] Kernel patch in trunk to support brcm47xx BCMA USB

2011-12-26 Thread Tathagata Das

Hi Hauke,
USB is still not working. I have used trunk with version number 29611.
Did you test USB ?

Regards,
Tathagata

On 12/24/2011 03:31 AM, Hauke Mehrtens wrote:

Hi Tathagata,

I found an error in my initialization code for usb cores with rev>= 5
like yours. Could you please try a version with my fix in r29605.

Hauke

On 12/23/2011 08:37 AM, Tathagata Das wrote:

I tested USB with latest trunk (revision number 29600) and it did not
work. When I attached my USB drive to the board I received below error
messages.

[  410.408000] usb 1-1: new high speed USB device number 2 using
ehci-platform
[  410.584000] usb 1-1: unable to read config index 0 descriptor/start: -71
[  410.588000] usb 1-1: chopping to 0 config(s)
[  410.604000] usb 1-1: string descriptor 0 read error: -71
[  410.608000] usb 1-1: no configuration chosen from 0 choices

However with my USB patch I can mount the same USB drive.

Regards,
Tathagata

On 12/23/2011 02:26 AM, Hauke Mehrtens wrote:

On 12/14/2011 06:19 AM, Tathagata Das wrote:

Hi,
Attached is the kernel patch to support brcm47xx BCMA USB (both OHCI and
EHCI).
I have used latest trunk source code to create this patch.

Regards,
Tathagata

Hi Tathagata,

I added my USB Host driver for bcma in commit r29575. The hole
architecture with the ohci driver starting the ehci driver was crap and
would never be accepted in mainline kernel. I will try to push this into
mainline kernel.

Your patch for USB support is rejected then.

Please try recent trunk and report a problem if USB does not work as
expected.

Hauke




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


Re: [OpenWrt-Devel] [PATCH] Kernel patch in trunk to support brcm47xx BCMA USB

2011-12-22 Thread Tathagata Das
I tested USB with latest trunk (revision number 29600) and it did not 
work. When I attached my USB drive to the board I received below error 
messages.


[  410.408000] usb 1-1: new high speed USB device number 2 using 
ehci-platform

[  410.584000] usb 1-1: unable to read config index 0 descriptor/start: -71
[  410.588000] usb 1-1: chopping to 0 config(s)
[  410.604000] usb 1-1: string descriptor 0 read error: -71
[  410.608000] usb 1-1: no configuration chosen from 0 choices

However with my USB patch I can mount the same USB drive.

Regards,
Tathagata

On 12/23/2011 02:26 AM, Hauke Mehrtens wrote:

On 12/14/2011 06:19 AM, Tathagata Das wrote:

Hi,
Attached is the kernel patch to support brcm47xx BCMA USB (both OHCI and
EHCI).
I have used latest trunk source code to create this patch.

Regards,
Tathagata

Hi Tathagata,

I added my USB Host driver for bcma in commit r29575. The hole
architecture with the ohci driver starting the ehci driver was crap and
would never be accepted in mainline kernel. I will try to push this into
mainline kernel.

Your patch for USB support is rejected then.

Please try recent trunk and report a problem if USB does not work as
expected.

Hauke


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


Re: [OpenWrt-Devel] [PATCH] Updated kernel patch in trunk to support brcm47xx BCMA NAND flash

2011-12-22 Thread Tathagata Das

Hi,
 Thanks for your feedback.
I will modify the patch. Also I am trying to use 
driver/mtd/nand/nand_base.c as much as possible. I will submit modify 
patch quickly.


Regards,
Tathagata

On 12/23/2011 03:28 AM, Hauke Mehrtens wrote:

On 12/14/2011 05:51 AM, Tathagata Das wrote:

Hi,
  Attached is the updated kernel patch to support brcm47xx BCMA NAND
flash. I have removed SSB related code from this patch and I have used
latest trunk source code to create this patch.

Regards,
Tathagata

Hi Tathagata,

--- a/drivers/bcma/driver_mips.c2011-12-12 10:48:59.651424561 +0530
+++ b/drivers/bcma/driver_mips.c2011-12-12 12:41:58.806423452 +0530
@@ -186,9 +186,15 @@
case BCMA_CC_FLASHT_STSER:
case BCMA_CC_FLASHT_ATSER:
  #ifdef CONFIG_BCMA_SFLASH
+#ifdef CONFIG_BCMA_NFLASH
+   printk("found nand flash.\n");
+   bus->drv_cc.flash_type = BCMA_NFLASH;
+   bcma_nflash_init(&bus->drv_cc);
+#else
pr_info("found serial flash.\n");
bus->drv_cc.flash_type = BCMA_SFLASH;
bcma_sflash_init(&bus->drv_cc);
+#endif

This is not nice, with this we could only build images supporting sflash
or nflash.
This could finds your nflash chip? It is strage because this should just
find sflash chips.

Could you instaed try this and report what condition found your nflash chip:

--- a/drivers/bcma/driver_mips.c
+++ b/drivers/bcma/driver_mips.c
@@ -182,6 +182,15 @@ static void bcma_core_mips_flash_detect(struct
bcma_drv_mips *mcore)
  {
struct bcma_bus *bus = mcore->core->bus;

+#ifdef CONFIG_BCMA_NFLASH
+   if (bus->drv_cc.capabilities&  BCMA_CC_CAP_NFLASH) {
+   printk("found nand flash.\n");
+   bus->drv_cc.flash_type = BCMA_NFLASH;
+   bcma_nflash_init(&bus->drv_cc);
+   return;
+   }
+#endif /* CONFIG_BCMA_NFLASH */
+
switch (bus->drv_cc.capabilities&  BCMA_CC_CAP_FLASHT) {
case BCMA_CC_FLASHT_STSER:
case BCMA_CC_FLASHT_ATSER:
@@ -193,6 +202,15 @@ static void bcma_core_mips_flash_detect(struct
bcma_drv_mips *mcore)
pr_info("serial flash not supported.\n");
  #endif /* CONFIG_BCMA_SFLASH */
break;
+   case BCMA_CC_FLASHT_NFLASH:
+#ifdef CONFIG_BCMA_NFLASH
+   printk("found nand flash.\n");
+   bus->drv_cc.flash_type = BCMA_NFLASH;
+   bcma_nflash_init(&bus->drv_cc);
+#else
+   pr_info("nand flash not supported.\n");
+#endif /* CONFIG_BCMA_NFLASH */
+   break;
case BCMA_CC_FLASHT_PARA:
pr_info("found parallel flash.\n");
bus->drv_cc.flash_type = BCMA_PFLASH;
--- a/include/linux/bcma/bcma_driver_chipcommon.h
+++ b/include/linux/bcma/bcma_driver_chipcommon.h
@@ -24,7 +24,7 @@
  #define   BCMA_CC_FLASHT_NONE 0x  /* No flash */
  #define   BCMA_CC_FLASHT_STSER0x0100  /* ST serial 
flash */
  #define   BCMA_CC_FLASHT_ATSER0x0200  /* Atmel serial 
flash */
-#define   BCMA_CC_FLASHT_NFLASH0x0200
+#define   BCMA_CC_FLASHT_NFLASH0x0300  /* NAND flash */
  #define BCMA_CC_FLASHT_PARA   0x0700  /* Parallel 
flash */
  #define  BCMA_CC_CAP_PLLT 0x00038000  /* PLL Type */
  #define   BCMA_PLLTYPE_NONE   0x
@@ -44,7 +44,8 @@
  #define  BCMA_CC_CAP_64BIT0x0800  /* 64-bit Backplane */
  #define  BCMA_CC_CAP_PMU  0x1000  /* PMU available (rev>= 
20) */
  #define  BCMA_CC_CAP_ECI  0x2000  /* ECI available (rev>= 
20) */
-#define  BCMA_CC_CAP_SPROM 0x4000  /* SPROM present */
+#define  BCMA_CC_CAP_SROM  0x4000  /* Srom Present (rev>= 
32) */
+#define  BCMA_CC_CAP_NFLASH0x8000  /* Nand flash present 
(rev>=
35) */
  #define BCMA_CC_CORECTL   0x0008
  #define  BCMA_CC_CORECTL_UARTCLK0 0x0001  /* Drive UART with
internal clock */
  #defineBCMA_CC_CORECTL_SE 0x0002  /* sync clk out 
enable (corerev

= 3) */



The bus abstraction in arch/mips/bcm47xx/bus.c is not needed. I made it
for sflash devices to use one code for bcma and ssb based devices but
sflash is just available on very recent bcma devices.

Hauke


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


[OpenWrt-Devel] [PATCH] Kernel patch in trunk to support brcm47xx BCMA USB

2011-12-13 Thread Tathagata Das

Hi,
Attached is the kernel patch to support brcm47xx BCMA USB (both OHCI and 
EHCI).

I have used latest trunk source code to create this patch.

Regards,
Tathagata 
diff -Naur a/drivers/bcma/Kconfig b/drivers/bcma/Kconfig
--- a/drivers/bcma/Kconfig  2011-12-12 13:06:36.728423218 +0530
+++ b/drivers/bcma/Kconfig  2011-12-13 13:08:53.234014399 +0530
@@ -48,6 +48,13 @@
depends on BCMA_DRIVER_MIPS
default y
 
+config BCMA_EMBEDDED 
+   bool
+   depends on BCMA_DRIVER_MIPS
+   select USB_EHCI_HCD_BCMA if USB_EHCI_HCD
+   select USB_OHCI_HCD_BCMA if USB_OHCI_HCD
+   default y
+
 config BCMA_DRIVER_MIPS
bool "BCMA Broadcom MIPS core driver"
depends on BCMA && MIPS
diff -Naur a/drivers/bcma/scan.c b/drivers/bcma/scan.c
--- a/drivers/bcma/scan.c   2011-12-12 13:06:36.728423218 +0530
+++ b/drivers/bcma/scan.c   2011-12-13 13:08:53.234014399 +0530
@@ -168,9 +168,9 @@
 }
 
 static s32 bcma_erom_get_addr_desc(struct bcma_bus *bus, u32 **eromptr,
- u32 type, u8 port)
+ u32 type, u8 port, u32 *sizel)
 {
-   u32 addrl, addrh, sizel, sizeh = 0;
+   u32 addrl, addrh, sizeh = 0;
u32 size;
 
u32 ent = bcma_erom_get_ent(bus, eromptr);
@@ -190,11 +190,11 @@
 
if ((ent & SCAN_ADDR_SZ) == SCAN_ADDR_SZ_SZD) {
size = bcma_erom_get_ent(bus, eromptr);
-   sizel = size & SCAN_SIZE_SZ;
+   *sizel = size & SCAN_SIZE_SZ;
if (size & SCAN_SIZE_SG32)
sizeh = bcma_erom_get_ent(bus, eromptr);
} else
-   sizel = SCAN_ADDR_SZ_BASE <<
+   *sizel = SCAN_ADDR_SZ_BASE <<
((ent & SCAN_ADDR_SZ) >> SCAN_ADDR_SZ_SHIFT);
 
return addrl;
@@ -216,7 +216,7 @@
  struct bcma_device_id *match, int core_num,
  struct bcma_device *core)
 {
-   s32 tmp;
+   s32 tmp, size;
u8 i, j;
s32 cia, cib;
u8 ports[2], wrappers[2];
@@ -290,15 +290,21 @@
for (i = 0; i < ports[1]; i++) {
for (j = 0; ; j++) {
tmp = bcma_erom_get_addr_desc(bus, eromptr,
-   SCAN_ADDR_TYPE_SLAVE, i);
+   SCAN_ADDR_TYPE_SLAVE, i, &size);
if (tmp < 0) {
/* no more entries for port _i_ */
/* pr_debug("erom: slave port %d "
 * "has %d descriptors\n", i, j); */
break;
} else {
-   if (i == 0 && j == 0)
+   if (i == 0 && j == 0) {
core->addr = tmp;
+   core->size = size;
+   }
+   else {
+   core->addr2 = tmp;
+   core->size2 = size;
+   }
}
}
}
@@ -307,7 +313,7 @@
for (i = 0; i < wrappers[0]; i++) {
for (j = 0; ; j++) {
tmp = bcma_erom_get_addr_desc(bus, eromptr,
-   SCAN_ADDR_TYPE_MWRAP, i);
+   SCAN_ADDR_TYPE_MWRAP, i, &size);
if (tmp < 0) {
/* no more entries for port _i_ */
/* pr_debug("erom: master wrapper %d "
@@ -325,7 +331,7 @@
u8 hack = (ports[1] == 1) ? 0 : 1;
for (j = 0; ; j++) {
tmp = bcma_erom_get_addr_desc(bus, eromptr,
-   SCAN_ADDR_TYPE_SWRAP, i + hack);
+   SCAN_ADDR_TYPE_SWRAP, i + hack, &size);
if (tmp < 0) {
/* no more entries for port _i_ */
/* pr_debug("erom: master wrapper %d "
diff -Naur a/drivers/usb/host/ehci-bcma.c b/drivers/usb/host/ehci-bcma.c
--- a/drivers/usb/host/ehci-bcma.c  1970-01-01 05:30:00.0 +0530
+++ b/drivers/usb/host/ehci-bcma.c  2011-12-13 13:22:44.404014256 +0530
@@ -0,0 +1,298 @@
+/*
+ * BCMA USB-core EHCI driver
+ *
+ * Copyright 2011 Tathagata Das 
+ *
+ * Derived from the EHCI-SSB driver
+ *
+ * Derived from the USBcore related parts of Broadcom-SB
+ * Copyright 2005 Broadcom Corporation
+ *
+ * Licensed under the GNU/GPL. See COPYING for details.
+ */
+#include 
+
+struct bcma_ehci_device {
+   struct ehci_hcd ehci; /* _must_ be at the beginning. */
+};
+
+static inline
+struct bcma_ehci_device *h

[OpenWrt-Devel] [PATCH] Updated kernel patch in trunk to support brcm47xx BCMA NAND flash

2011-12-13 Thread Tathagata Das

Hi,
 Attached is the updated kernel patch to support brcm47xx BCMA NAND 
flash. I have removed SSB related code from this patch and I have used 
latest trunk source code to create this patch.


Regards,
Tathagata
diff -Naur a/arch/mips/bcm47xx/bus.c b/arch/mips/bcm47xx/bus.c
--- a/arch/mips/bcm47xx/bus.c   2011-12-12 10:48:59.748424561 +0530
+++ b/arch/mips/bcm47xx/bus.c   2011-12-12 12:41:47.23453 +0530
@@ -92,3 +92,40 @@
sflash->numblocks = scc->sflash.numblocks;
sflash->size = scc->sflash.size;
 }
+
+#ifdef CONFIG_BCMA_NFLASH
+static int bcm47xx_nflash_bcma_read(struct bcm47xx_nflash *dev, u32 offset, 
u32 len, u8 *buf)
+{
+   return bcma_nflash_read(dev->bcc, offset, len, buf);
+}
+
+static int bcm47xx_nflash_bcma_poll(struct bcm47xx_nflash *dev, u32 offset)
+{
+   return bcma_nflash_poll(dev->bcc);
+}
+
+static int bcm47xx_nflash_bcma_write(struct bcm47xx_nflash *dev, u32 offset, 
u32 len, const u8 *buf)
+{
+   return bcma_nflash_write(dev->bcc, offset, len, buf);
+}
+
+static int bcm47xx_nflash_bcma_erase(struct bcm47xx_nflash *dev, u32 offset)
+{
+   return bcma_nflash_erase(dev->bcc, offset);
+}
+
+void bcm47xx_nflash_struct_bcma_init(struct bcm47xx_nflash *nflash, struct 
bcma_drv_cc *bcc)
+{
+   nflash->nflash_type = BCM47XX_BUS_TYPE_BCMA;
+   nflash->bcc = bcc;
+
+   nflash->read = bcm47xx_nflash_bcma_read;
+   nflash->poll = bcm47xx_nflash_bcma_poll;
+   nflash->write = bcm47xx_nflash_bcma_write;
+   nflash->erase = bcm47xx_nflash_bcma_erase;
+
+   nflash->blocksize = bcc->nflash.blocksize;
+   nflash->numblocks = bcc->nflash.numblocks;
+   nflash->size = bcc->nflash.size;
+}
+#endif /* CONFIG_BCMA_NFLASH */
diff -Naur a/arch/mips/bcm47xx/nvram.c b/arch/mips/bcm47xx/nvram.c
--- a/arch/mips/bcm47xx/nvram.c 2011-12-12 10:49:00.974424559 +0530
+++ b/arch/mips/bcm47xx/nvram.c 2011-12-12 12:41:47.23453 +0530
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 char nvram_buf[NVRAM_SPACE];
 EXPORT_SYMBOL(nvram_buf);
@@ -159,6 +160,64 @@
return 0;
 }
 
+static int early_nvram_init_nflash(void)
+{
+   struct nvram_header *header;
+   u32 off;
+   int ret;
+   char *dst;
+   int len;
+   u32 flash_size = bcm47xx_nflash.size * 1024 * 1024;
+   u8 *tmpbuf = NULL;
+
+   /* check if the struct is already initilized */
+   if (!flash_size)
+   return -1;
+
+   tmpbuf = (u8 *)kmalloc(NFL_SECTOR_SIZE, GFP_KERNEL);
+   off = FLASH_MIN;
+   while (off <= flash_size) {
+   ret = bcm47xx_nflash.read(&bcm47xx_nflash, off - NVRAM_SPACE, 
NFL_SECTOR_SIZE, tmpbuf);
+   if (ret != NFL_SECTOR_SIZE) {
+   goto done;
+   }
+   header = (struct nvram_header *)tmpbuf;
+   if (header->magic == NVRAM_HEADER)
+   goto found;
+   off <<= 1;
+   }
+
+   off = FLASH_MIN;
+   while (off <= flash_size) {
+   ret = bcm47xx_nflash.read(&bcm47xx_nflash, off - (2 * 
NVRAM_SPACE), NFL_SECTOR_SIZE, tmpbuf);
+   if (ret != NFL_SECTOR_SIZE)
+   goto done;
+   header = (struct nvram_header *)tmpbuf;
+   if (header->magic == NVRAM_HEADER)
+   goto found;
+   off <<= 1;
+   }
+   
+   ret = -1;
+   goto done;
+
+found:
+   len = NVRAM_SPACE;
+   dst = nvram_buf;
+   while (len) {
+   ret = bcm47xx_nflash.read(&bcm47xx_nflash, off - (2 * 
NVRAM_SPACE), len, dst);
+   if (ret < 0)
+   goto done;
+   off += ret;
+   len -= ret;
+   dst += ret;
+   }
+   ret = 0;
+done:
+   kfree(tmpbuf);
+   return ret;
+}
+
 static void early_nvram_init(void)
 {
int err = 0;
@@ -185,6 +244,10 @@
err = early_nvram_init_sflash();
if (err < 0)
printk(KERN_WARNING "can not read from flash: 
%i\n", err);
+   } else if (bcm47xx_bus.bcma.bus.drv_cc.flash_type == 
BCMA_NFLASH) {
+   err = early_nvram_init_nflash();
+   if (err < 0)
+   printk(KERN_WARNING "can not read from nflash: 
%i\n", err);
} else {
printk(KERN_WARNING "unknow flash type\n");
}
diff -Naur a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c
--- a/arch/mips/bcm47xx/setup.c 2011-12-12 10:49:00.947424559 +0530
+++ b/arch/mips/bcm47xx/setup.c 2011-12-12 12:41:47.443423454 +0530
@@ -4,6 +4,7 @@
  *  Copyright (C) 2006 Michael Buesch 
  *  Copyright (C) 2010 Waldemar Brodkorb 
  *  Copyright (C) 2010-2011 Hauke Mehrtens 
+ *  Copyright (C) 2010-

Re: [OpenWrt-Devel] [PATCH] Kernel patch in trunk to support brcm47xx NAND flash

2011-12-11 Thread Tathagata Das

Hi Hauke,
 WNR3500Lv2 is BCM5357 based. I did not see any SSB based NAND flash. 
So I will remove that section from my patch and repost it. Also I will 
try to use functions provided in drivers/mtd/nand/nand_base.c if 
possible. I w ill repost the patch before next weekend so that you can 
look closely into it.


I have made some progress in USB section for the same device and 
currently I am getting probe. However it will be really helpful I can 
use your patch. I have seen a list patches available at 
https://github.com/hauke/openwrt/tree/linux-3.2/target/linux/brcm47xx/patches-3.2. 
Could you please tell me the exact name of the patch ?


I will also submit bootlog, vendor firmware and OpenWRT firmware along 
with my modified patch.


Regards,
Tathagata

On 12/11/2011 10:56 PM, Hauke Mehrtens wrote:

Hi Tathagata,

in general this patch looks good and it could be accepted. I will look
closely into it next weekend, I do not have time for now.

I just saw your post regarding usb:
https://forum.openwrt.org/viewtopic.php?pid=148104 I have patches to add
a usb driver for bcma devices:
https://github.com/hauke/openwrt/tree/linux-3.2 I will try to add it to
OpenWrt trunk next weekend or so, but you could try it now.

Using drivers/mtd/nand/nand_base.c, if it provides some of the functions
needed, it would be nice to use them.

Is the WNR3500L V2.0 BCM5357 based? I saw that there are some
enhancements in the NAND driver needed to get support for the BCM4706
used on the WNDR4500.
If you have not seen any and I do not think there will be any SSB based
device with NAND flash out there, we do not need to add support for it
to ssb.
A boot log with the vendor firmware and OpenWrt would be nice, also to
see what other chips and cores are in that device.

Hauke

On 12/11/2011 05:49 PM, tathagata wrote:

Hi Hauke,
  Thanks.
Netgear WNR3500Lv2 hardware uses this flash type. I tested this patch on
this particular platform. It uses BCMA based devices. I will send you
kernel .config file and boot log message if you want.
I shall look into drivers/mtd/nand/nand_base.c file and give you my
analysis.

Can this patch be accepted ?

Regards,
Tathagata

On 11.12.2011 05:48, Hauke Mehrtens wrote:

On 12/09/2011 08:16 AM, Tathagata Das wrote:

Hi,
Attached is the kernel patch to support brcm47xx NAND flash.
I have used latest trunk source code to create this patch.

Regards,
Tathagata

Hi Tathagata,

nice patch.
I had a quick look over your big patch. I did not know that there is a
third flash type used on brcm43xx Broadcom devices, on what device did
you found it? I did a search in the source code on my hard disk and the
WNDR4500 source code was the only containing a driver for this NAND
chips. Is is really used on SSB and BCMA based devices?

Sometimes there is "serial flash" in the header and not "NAND flash".
When finding a SSB NAND flash it will try to initialize serial flash
instead. Why are you using your own partition parser? Do Braodcom chips
using NAND do something different from other chips?
Is it possible to use drivers/mtd/nand/nand_base.c?

Hauke



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


Re: [OpenWrt-Devel] [PATCH] patch in trunk to support serial flash driver of Netgear WNR3500L

2010-07-26 Thread Tathagata Das

Hi,
I am still waiting for the response. Is that serial flash patch 
accepted or there are some issues to be solved ?


Regards,
Tathagata

Tathagata Das wrote:

Hi,
Is that patch accepted or do I need to modify something ?

Regards,
Tathagata

Tathagata Das wrote:

Hi,
Attached patch is for supporting serial flash of Netgear WNR3500L.

Regards,
Tathagata 




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


Re: [OpenWrt-Devel] [PATCH] patch in trunk to support serial flash driver of Netgear WNR3500L

2010-05-31 Thread Tathagata Das

Hi,
Is that patch accepted or do I need to modify something ?

Regards,
Tathagata

Tathagata Das wrote:

Hi,
Attached patch is for supporting serial flash of Netgear WNR3500L.

Regards,
Tathagata 


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


Re: [OpenWrt-Devel] [PATCH] Kernel patch in trunk (version 21251) to support Netgear WNR3500L

2010-05-26 Thread Tathagata Das

I have already submitted one separate patch for sflash.
Below is the link of the same.

http://www.mail-archive.com/openwrt-devel@lists.openwrt.org/msg05976.html

Regards,
Tathagata

Per Åstrand wrote:

On 2010-05-26 12:10 AM, Per ?strand wrote:


Hi!

I've updated the patch for wnr3500l to build against @21567.
I don't have access to the router for a couple of more days, so it's
untested so far.
  

Please remove all #ifdef CONFIG_WNR3500L
It makes the code harder to read and it's not acceptable for upstream.
- Felix



I'll try to go over the patch removed them and also break out the
sflash into a separate patch.
Is that ok with you also Tathagata?

/Per

  

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


[OpenWrt-Devel] [PATCH] patch in trunk to support serial flash driver of Netgear WNR3500L

2010-05-26 Thread Tathagata Das

Hi,
Attached patch is for supporting serial flash of Netgear WNR3500L.

Regards,
Tathagata 

diff -Naur a/arch/mips/Kconfig b/arch/mips/Kconfig
--- a/arch/mips/Kconfig 2010-05-13 18:22:35.0 +0530
+++ b/arch/mips/Kconfig 2010-05-13 18:19:37.0 +0530
@@ -9,6 +9,10 @@
select EMBEDDED
select RTC_LIB if !LEMOTE_FULOONG2E
 
+config WNR3500L
+   bool "Netgear WNR3500L"
+   default y
+
 mainmenu "Linux/MIPS Kernel Configuration"
 
 menu "Machine selection"
diff -Naur a/drivers/mtd/devices/Kconfig b/drivers/mtd/devices/Kconfig
--- a/drivers/mtd/devices/Kconfig   2010-05-13 18:23:09.0 +0530
+++ b/drivers/mtd/devices/Kconfig   2010-05-13 18:20:36.0 +0530
@@ -3,6 +3,9 @@
 menu "Self-contained MTD device drivers"
depends on MTD!=n
 
+config MTD_SFLASH
+   bool "Broadcom Chipcommon Serial Flash support"
+
 config MTD_PMC551
tristate "Ramix PMC551 PCI Mezzanine RAM card support"
depends on PCI
diff -Naur a/drivers/mtd/devices/Makefile b/drivers/mtd/devices/Makefile
--- a/drivers/mtd/devices/Makefile  2010-05-13 18:23:09.0 +0530
+++ b/drivers/mtd/devices/Makefile  2010-05-13 18:20:36.0 +0530
@@ -2,6 +2,7 @@
 # linux/drivers/devices/Makefile
 #
 
+obj-$(CONFIG_MTD_SFLASH)   += sflash.o
 obj-$(CONFIG_MTD_DOC2000)  += doc2000.o
 obj-$(CONFIG_MTD_DOC2001)  += doc2001.o
 obj-$(CONFIG_MTD_DOC2001PLUS)  += doc2001plus.o
diff -Naur a/drivers/mtd/devices/sflash.c b/drivers/mtd/devices/sflash.c
--- a/drivers/mtd/devices/sflash.c  1970-01-01 05:30:00.0 +0530
+++ b/drivers/mtd/devices/sflash.c  2010-05-26 15:38:38.0 +0530
@@ -0,0 +1,769 @@
+/*
+ * Broadcom SiliconBackplane chipcommon serial flash interface
+ *
+ * Copyright 2007, Broadcom Corporation
+ * All Rights Reserved.
+ * 
+ * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
+ * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
+ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define BCM4712_CHIP_ID 0x4712  /* 4712 chipcommon chipid */
+
+/* flashcontrol action+opcodes for ST flashes */
+#define SFLASH_ST_CSA   0x1000  /* Keep chip select asserted */
+
+#ifndef MIN
+#define MIN(a, b)   (((a) < (b))?(a):(b))
+#endif /* MIN */
+
+void osl_delay(uint usec);
+/*
+ *  * Spin at most 'us' microseconds while 'exp' is true.
+ *   * Caller should explicitly test 'exp' when this completes
+ ** and take appropriate error action if 'exp' is still true.
+ * */
+#define SPINWAIT(exp, us) { \
+uint countdown = (us) + 9; \
+while ((exp) && (countdown >= 10)) {\
+osl_delay(10); \
+countdown -= 10; \
+} \
+}
+
+/* Write len bytes starting at offset into buf. Returns number of bytes
+ * written. Caller should poll for completion.
+ */
+#defineST_RETRIES  3
+
+#defineGET_BYTE(ptr)   (*(u8 *)((u32)(ptr) ^ 7))
+
+extern struct ssb_bus ssb_bcm47xx;
+#ifdef CONFIG_MTD_PARTITIONS
+extern struct mtd_partition * init_mtd_partitions(struct mtd_info *mtd, size_t 
size);
+#endif
+
+struct sflash_mtd {
+   struct semaphore lock;
+   struct mtd_info mtd;
+   struct mtd_erase_region_info region;
+};
+
+struct sflash {
+   u32 blocksize;  /* Block size */
+   u32 numblocks;  /* Number of blocks */
+   u32 type;  /* Type */
+   u32 size; /* Total size in bytes */
+};
+
+static struct sflash wnr3500l_sflash;
+
+/* Private global state */
+static struct sflash_mtd sflash;
+
+#define  OSL_UNCACHED(va)  ((void *)KSEG1ADDR(va))
+#define  OSL_CACHED(va)((void *)KSEG0ADDR(va))
+
+typedef unsigned long long int uintptr;
+
+/* Issue a serial flash command */
+static inline void sflash_cmd(u32 opcode)
+{
+   chipco_write32(&ssb_bcm47xx.chipco, SSB_CHIPCO_FLASHCTL, 
SSB_CHIPCO_FLASHCTL_START | opcode);
+   while ((chipco_read32(&ssb_bcm47xx.chipco, SSB_CHIPCO_FLASHCTL) & 
SSB_CHIPCO_FLASHCTL_BUSY));
+}
+
+int sflash_read(u32 offset, u32 len, unsigned char *buf)
+{
+   u8 *from, *to;
+   int cnt, i;
+
+   if (!len)
+   return 0;
+
+   if ((offset + len) > wnr3500l_sflash.size)
+   return -22;
+
+   if ((len >= 4) && (offset & 3))
+   cnt = 4 - (offset & 3);
+   else if ((len >= 4) && ((uintptr)buf & 3))
+   cnt = 4 - ((uintptr)buf & 3);
+   else
+   cnt = len;
+
+   if (ssb_bcm47xx.chipco.dev->id.revision == 12)
+   from = (u8 *)OSL_UNCACHED(SSB_FLASH2 + offset);
+   else
+   from = (u8 *)OSL_CACHED(SSB_FLASH2 + offset);
+   to = (u8 *)buf;
+
+   if (cnt < 4) {
+   

Re: [OpenWrt-Devel] [PATCH] Kernel patch in trunk (version 21251) to support Netgear WNR3500L

2010-05-20 Thread Tathagata Das
Fine, I will clean up this serial flash driver as much as possible and 
submit it again.


Regards,
Tathagata

Bernhard Loos wrote:

Your patch contains a driver for the serial flash chip on the
wnr3500l, but it's kinda ugly (excessive ioremaps, duplicated defines,
global statics, ...).
If you could clean this up, it would have a chance of getting accepted.

Bernhard

2010/5/20 Tathagata Das :
  

What do you mean to say "clean up the flash driver you have" ?

Regards,
Tathagata


Bernhard Loos wrote:
    

2010/5/17 Tathagata Das :

  

Okay, so I will start working on those drivers (serial and wired). Does
current version of OpenWRT trunk supports WNR3500L ? Otherwise I need to
download latest trunk, modify it to run on WNR3500L and then concentrate
on
drivers.



I doesn't but the difference from your version to latest trunk is pretty
small.


  

If you elaborate the idea of spi master driver then it would help me to
proceed faster.



I checked out the flash controller code and it isn't plain spi, the
chipcommon core seems to have some control logic for the flash.
So if you clean up the flash driver you have, it should be enough.
Having a proper bus driver for the serial flash code would be nice,
but it's probably overkill.


  

Regards,
Tathagata

Bernhard Loos wrote:

    

2010/5/17 Tathagata Das :


  

Hi,
I have used source code of version 21251. It might be possible that
some
fixes has been made after that version which is not reflected in my
code.
So
if I use latest code then that issue will be resolved.




The bugs are in the patch, not in the code already in openwrt, so it
won't.



  

You said that kernel patch should not contain any code under #ifdef.
But
it
may happen that those changes are specific to WNR3500L. Then what
should
be
the porting process ?




Something like this isn't wnr3500l speific:
+#ifndef CONFIG_WNR3500L
 void plat_irq_dispatch(void)
+#else
+void asmlinkage plat_irq_dispatch(void)
+#endif

If there is stuff specific to the wnr, you should wrap it in an
#ifdef-#endif, not #ifdef-#else-#endif, because it has to be possible
to build a kernel which supports both the old and socs.



  

If you tell how to move this patch into a proper form, I can do this.
However I have also one WNR3500L, nothing else.




Those are the worst problems, but you will spend a lot of time and
effort duplicating work I already did. I really suggest you spend your
time on some other area, as for example proper serial flash support (a
spi master driver) or network (both wired and wireless).



  

Regards,
Tathagata

Bernhard Loos wrote:




Hello
Thanks for you work, but as I already told you in the mail for your
last patch, this is not really useable as it is right now.
You can't simply go around and wrap everything you want to add in an
#ifdef, especially not things like that:
+#ifndef CONFIG_WNR3500L
 void plat_irq_dispatch(void)
+#else
+void asmlinkage plat_irq_dispatch(void)
+#endif
This is ugly as hell and unneeded. Such a thing will never get
accepted into mainline.
Those ifdefs also make it impossible to build a kernel supporting both
the new and the old bus type. And this is even besides all the bugs
still present in this code.
I am working on getting this patch into a proper form, but it's a slow
process, partly because I don't have that much time and partially
because I only have an 4716 device and nothing older.
If you could turn you serial driver into a proper spi master driver
and hook the flash up to, this would be very helpful. Changing the
flash map shouldn't be necessary, the rootfs_data partition is created
automatically.

Bernhard


2010/5/14 Tathagata Das :



  

Hi,
Attached is the kernel patch to support Netgear WNR3500L. All changes
are
made under CONFIG_WNR3500L.
I have used trunk source code of version number 21251 to create this
kernel
patch.

Regards,
Tathagata 




  
  


  

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


Re: [OpenWrt-Devel] [PATCH] Kernel patch in trunk (version 21251) to support Netgear WNR3500L

2010-05-20 Thread Tathagata Das

What do you mean to say "clean up the flash driver you have" ?

Regards,
Tathagata


Bernhard Loos wrote:

2010/5/17 Tathagata Das :
  

Okay, so I will start working on those drivers (serial and wired). Does
current version of OpenWRT trunk supports WNR3500L ? Otherwise I need to
download latest trunk, modify it to run on WNR3500L and then concentrate on
drivers.



I doesn't but the difference from your version to latest trunk is pretty small.

  

If you elaborate the idea of spi master driver then it would help me to
proceed faster.



I checked out the flash controller code and it isn't plain spi, the
chipcommon core seems to have some control logic for the flash.
So if you clean up the flash driver you have, it should be enough.
Having a proper bus driver for the serial flash code would be nice,
but it's probably overkill.

  

Regards,
Tathagata

Bernhard Loos wrote:
    

2010/5/17 Tathagata Das :

  

Hi,
I have used source code of version 21251. It might be possible that some
fixes has been made after that version which is not reflected in my code.
So
if I use latest code then that issue will be resolved.



The bugs are in the patch, not in the code already in openwrt, so it
won't.


  

You said that kernel patch should not contain any code under #ifdef. But
it
may happen that those changes are specific to WNR3500L. Then what should
be
the porting process ?



Something like this isn't wnr3500l speific:
+#ifndef CONFIG_WNR3500L
 void plat_irq_dispatch(void)
+#else
+void asmlinkage plat_irq_dispatch(void)
+#endif

If there is stuff specific to the wnr, you should wrap it in an
#ifdef-#endif, not #ifdef-#else-#endif, because it has to be possible
to build a kernel which supports both the old and socs.


  

If you tell how to move this patch into a proper form, I can do this.
However I have also one WNR3500L, nothing else.



Those are the worst problems, but you will spend a lot of time and
effort duplicating work I already did. I really suggest you spend your
time on some other area, as for example proper serial flash support (a
spi master driver) or network (both wired and wireless).


  

Regards,
Tathagata

Bernhard Loos wrote:



Hello
Thanks for you work, but as I already told you in the mail for your
last patch, this is not really useable as it is right now.
You can't simply go around and wrap everything you want to add in an
#ifdef, especially not things like that:
+#ifndef CONFIG_WNR3500L
 void plat_irq_dispatch(void)
+#else
+void asmlinkage plat_irq_dispatch(void)
+#endif
This is ugly as hell and unneeded. Such a thing will never get
accepted into mainline.
Those ifdefs also make it impossible to build a kernel supporting both
the new and the old bus type. And this is even besides all the bugs
still present in this code.
I am working on getting this patch into a proper form, but it's a slow
process, partly because I don't have that much time and partially
because I only have an 4716 device and nothing older.
If you could turn you serial driver into a proper spi master driver
and hook the flash up to, this would be very helpful. Changing the
flash map shouldn't be necessary, the rootfs_data partition is created
automatically.

 Bernhard


2010/5/14 Tathagata Das :


  

Hi,
Attached is the kernel patch to support Netgear WNR3500L. All changes
are
made under CONFIG_WNR3500L.
I have used trunk source code of version number 21251 to create this
kernel
patch.

Regards,
Tathagata 



  


  

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


Re: [OpenWrt-Devel] [PATCH] Kernel patch in trunk (version 21251) to support Netgear WNR3500L

2010-05-17 Thread Tathagata Das
Okay, so I will start working on those drivers (serial and wired). Does 
current version of OpenWRT trunk supports WNR3500L ? Otherwise I need to 
download latest trunk, modify it to run on WNR3500L and then concentrate 
on drivers.
If you elaborate the idea of spi master driver then it would help me to 
proceed faster.


Regards,
Tathagata

Bernhard Loos wrote:

2010/5/17 Tathagata Das :
  

Hi,
I have used source code of version 21251. It might be possible that some
fixes has been made after that version which is not reflected in my code. So
if I use latest code then that issue will be resolved.



The bugs are in the patch, not in the code already in openwrt, so it won't.

  

You said that kernel patch should not contain any code under #ifdef. But it
may happen that those changes are specific to WNR3500L. Then what should be
the porting process ?



Something like this isn't wnr3500l speific:
+#ifndef CONFIG_WNR3500L
 void plat_irq_dispatch(void)
+#else
+void asmlinkage plat_irq_dispatch(void)
+#endif

If there is stuff specific to the wnr, you should wrap it in an
#ifdef-#endif, not #ifdef-#else-#endif, because it has to be possible
to build a kernel which supports both the old and socs.

  

If you tell how to move this patch into a proper form, I can do this.
However I have also one WNR3500L, nothing else.



Those are the worst problems, but you will spend a lot of time and
effort duplicating work I already did. I really suggest you spend your
time on some other area, as for example proper serial flash support (a
spi master driver) or network (both wired and wireless).

  

Regards,
Tathagata

Bernhard Loos wrote:


Hello
Thanks for you work, but as I already told you in the mail for your
last patch, this is not really useable as it is right now.
You can't simply go around and wrap everything you want to add in an
#ifdef, especially not things like that:
+#ifndef CONFIG_WNR3500L
 void plat_irq_dispatch(void)
+#else
+void asmlinkage plat_irq_dispatch(void)
+#endif
This is ugly as hell and unneeded. Such a thing will never get
accepted into mainline.
Those ifdefs also make it impossible to build a kernel supporting both
the new and the old bus type. And this is even besides all the bugs
still present in this code.
I am working on getting this patch into a proper form, but it's a slow
process, partly because I don't have that much time and partially
because I only have an 4716 device and nothing older.
If you could turn you serial driver into a proper spi master driver
and hook the flash up to, this would be very helpful. Changing the
flash map shouldn't be necessary, the rootfs_data partition is created
automatically.

  Bernhard


2010/5/14 Tathagata Das :

  

Hi,
Attached is the kernel patch to support Netgear WNR3500L. All changes are
made under CONFIG_WNR3500L.
I have used trunk source code of version number 21251 to create this
kernel
patch.

Regards,
Tathagata 




  

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


Re: [OpenWrt-Devel] [PATCH] Kernel patch in trunk (version 21251) to support Netgear WNR3500L

2010-05-16 Thread Tathagata Das

Hi,
I have not done anything specific to 3300.

Regards,
Tathagata

Weedy wrote:

On Fri, May 14, 2010 at 4:22 AM, Tathagata Das  wrote:
  

Hi,
Attached is the kernel patch to support Netgear WNR3500L. All changes are
made under CONFIG_WNR3500L.
I have used trunk source code of version number 21251 to create this kernel
patch.

Regards,
Tathagata 



Would this cover the 3300 as well?

  

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


[OpenWrt-Devel] [PATCH] Kernel patch in trunk (version 21251) to support Netgear WNR3500L

2010-05-14 Thread Tathagata Das

Hi,
Attached is the kernel patch to support Netgear WNR3500L. All changes 
are made under CONFIG_WNR3500L.
I have used trunk source code of version number 21251 to create this 
kernel patch.


Regards,
Tathagata 


diff -Naur a/arch/mips/bcm47xx/irq.c b/arch/mips/bcm47xx/irq.c
--- a/arch/mips/bcm47xx/irq.c   2010-05-13 18:22:34.0 +0530
+++ b/arch/mips/bcm47xx/irq.c   2010-05-13 18:19:35.0 +0530
@@ -30,6 +30,9 @@
 #include 
 #include 
 #include 
+#ifdef CONFIG_WNR3500L
+#include 
+#endif
 
 #include 
 
@@ -37,7 +40,11 @@
 extern struct ssb_bus ssb_bcm47xx;
 
 
+#ifndef CONFIG_WNR3500L
 void plat_irq_dispatch(void)
+#else
+void asmlinkage plat_irq_dispatch(void)
+#endif
 {
u32 cause;
 
@@ -61,5 +68,12 @@
 
 void __init arch_init_irq(void)
 {
+#ifdef CONFIG_WNR3500L
+   if (ssb_bcm47xx.mipscore.dev->id.coreid == SSB_DEV_MIPS_74K) { 
+   ssb_write32(ssb_bcm47xx.mipscore.dev, 
SSB_MIPS74K_INT_CONTROL(5), 1 << 31); 
+   } 
+   /* the kernel reads the timer irq from some register and beleave it's 
#5, but we route it to #7 */ 
+   cp0_compare_irq = 7; 
+#endif
mips_cpu_irq_init();
 }
diff -Naur a/arch/mips/include/asm/r4kcache.h b/arch/mips/include/asm/r4kcache.h
--- a/arch/mips/include/asm/r4kcache.h  2010-05-13 18:22:34.0 +0530
+++ b/arch/mips/include/asm/r4kcache.h  2010-05-13 18:19:36.0 +0530
@@ -22,9 +22,15 @@
 #include 
 #define BCM4710_DUMMY_RREG() bcm4710_dummy_rreg()
 
+#ifndef CONFIG_WNR3500L
 static inline unsigned long bcm4710_dummy_rreg(void) {
   return (*(volatile unsigned long *)(KSEG1ADDR(SSB_ENUM_BASE + 
SSB_IMSTATE)));
 }
+#else
+static inline unsigned long bcm4710_dummy_rreg(void) {
+  return (*(volatile unsigned long *)(KSEG1ADDR(SSB_ENUM_BASE)));
+}
+#endif
 
 #define BCM4710_FILL_TLB(addr) bcm4710_fill_tlb((void*)(addr))
 
diff -Naur a/arch/mips/Kconfig b/arch/mips/Kconfig
--- a/arch/mips/Kconfig 2010-05-13 18:22:35.0 +0530
+++ b/arch/mips/Kconfig 2010-05-13 18:19:37.0 +0530
@@ -9,6 +9,10 @@
select EMBEDDED
select RTC_LIB if !LEMOTE_FULOONG2E
 
+config WNR3500L
+   bool "Netgear WNR3500L"
+   default y
+
 mainmenu "Linux/MIPS Kernel Configuration"
 
 menu "Machine selection"
diff -Naur a/drivers/mtd/devices/Kconfig b/drivers/mtd/devices/Kconfig
--- a/drivers/mtd/devices/Kconfig   2010-05-13 18:23:09.0 +0530
+++ b/drivers/mtd/devices/Kconfig   2010-05-13 18:20:36.0 +0530
@@ -3,6 +3,9 @@
 menu "Self-contained MTD device drivers"
depends on MTD!=n
 
+config MTD_SFLASH
+   bool "Broadcom Chipcommon Serial Flash support"
+
 config MTD_PMC551
tristate "Ramix PMC551 PCI Mezzanine RAM card support"
depends on PCI
diff -Naur a/drivers/mtd/devices/Makefile b/drivers/mtd/devices/Makefile
--- a/drivers/mtd/devices/Makefile  2010-05-13 18:23:09.0 +0530
+++ b/drivers/mtd/devices/Makefile  2010-05-13 18:20:36.0 +0530
@@ -2,6 +2,7 @@
 # linux/drivers/devices/Makefile
 #
 
+obj-$(CONFIG_MTD_SFLASH)   += sflash.o
 obj-$(CONFIG_MTD_DOC2000)  += doc2000.o
 obj-$(CONFIG_MTD_DOC2001)  += doc2001.o
 obj-$(CONFIG_MTD_DOC2001PLUS)  += doc2001plus.o
diff -Naur a/drivers/mtd/devices/sflash.c b/drivers/mtd/devices/sflash.c
--- a/drivers/mtd/devices/sflash.c  1970-01-01 05:30:00.0 +0530
+++ b/drivers/mtd/devices/sflash.c  2010-05-13 18:20:36.0 +0530
@@ -0,0 +1,925 @@
+/*
+ * Broadcom SiliconBackplane chipcommon serial flash interface
+ *
+ * Copyright 2007, Broadcom Corporation
+ * All Rights Reserved.
+ * 
+ * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
+ * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
+ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+extern struct ssb_bus ssb_bcm47xx;
+#ifdef CONFIG_MTD_PARTITIONS
+extern struct mtd_partition * init_mtd_partitions(struct mtd_info *mtd, size_t 
size);
+#endif
+
+struct sflash_mtd {
+   u32 *base_regs;
+   struct semaphore lock;
+   struct mtd_info mtd;
+   struct mtd_erase_region_info region;
+};
+
+struct sflash {
+   u32 blocksize;  /* Block size */
+   u32 numblocks;  /* Number of blocks */
+   u32 type;  /* Type */
+   u32 size; /* Total size in bytes */
+};
+
+static struct sflash wnr3500l_sflash;
+
+/* Private global state */
+static struct sflash_mtd sflash;
+
+//extern unsigned long volatile __jiffy_data jiffies;
+
+#define CC_CORE_ID   0x800/* chipcommon core */
+#define SB_FLASH2  0x1c00  /* Flash Region 2 (region 1 shadowed here) 
*/
+#define CC_CAP_FLASH_MASK 0x0700  /* Type of flash */
+#define SFLASH_START0x8000
+#define SFLASH_BUSY SFLASH_S

Re: [OpenWrt-Devel] [PATCH] Kernel patch in Kamikaze-8.09.2 to support Netgear WNR3500L

2010-04-29 Thread Tathagata Das

Hi,
Sorry I do not understand the meaning of "eol". I think you mean to say 
no further development is going on with 8.09.
I can create patch against trunk. I do not know but if linux code is 
getting changed continuously in trunk then I am afraid we need to apply 
this patch manually. Is it okay ?


"Also, it would have been nice to mention the source for this patch and 
keep the copyright notice intact."  -- Do you mean to say that next time 
when I submit this patch I should mention the code version against which 
I prepare the patch ?


I have introduced copyright in one file only, sflash.c. Please let me 
know what would be the Copyright content. I will put that into that file.
Thank you for showing interest in my kernel patch. I would definitely 
try to find out the corresponding wired driver.


Thanks & Regards,
Tathagata



Bernhard Loos wrote:

2010/4/29 Tathagata Das :
  

Hi,
This is my first kernel patch submission. Please let me know if I do any
mistake.
All changes are made either under CONFIG_WNR3500L tag or "Tatha" tag.

Regards,
Tathagata 



Hello
Thanks for the patch, but there are a number of problems with it:
Firstly, 8.09 is eol, so if you submit patches, do it agains trunk.
Then, this #ifdef mess is really ugly. It's ok to create a config
symbol for the wnr3500l support, but the number of #ifdefs should be
kept to the absolutely needed minimum and it should be possible to
build a kernel which supports both the older broadcom socs and the new
one.
Also, it would have been nice to mention the source for this patch and
keep the copyright notice intact.
There is already work underway to add basic platform support for this
soc into openwrt, it would be really helpful, if you could find the
wired network driver and get it up and running.

  Bernhard

  

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


Re: [OpenWrt-Devel] Porting WNR3500L into Kamikaze-8.09.1

2009-12-10 Thread Tathagata Das
I am still waiting any response. Any help regarding this is appreciated.

Tathagata

On Wed, Dec 9, 2009 at 3:46 PM, Tathagata Das wrote:

> Hi All,
>  I want to port WNR3500L onto Kamikaze-8.09.1 with kernel-2.6.25 which has
> ssb driver. But in WNR3500L, ssb has been changes. So to port WNR3500L I
> need to modify the ssb driver in the kernel along with some files under
> arch/mips/bcm47xx directory.
> Hence before modifying anything I just want to check that is there anybody
> who is already working on it ? If no work has been done then could somebody
> please tell what should be the approach of porting this ?
>
> Thanks in advance.
>
> Tathagata
>
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Porting WNR3500L into Kamikaze-8.09.1

2009-12-09 Thread Tathagata Das
Hi All,
 I want to port WNR3500L onto Kamikaze-8.09.1 with kernel-2.6.25 which has
ssb driver. But in WNR3500L, ssb has been changes. So to port WNR3500L I
need to modify the ssb driver in the kernel along with some files under
arch/mips/bcm47xx directory.
Hence before modifying anything I just want to check that is there anybody
who is already working on it ? If no work has been done then could somebody
please tell what should be the approach of porting this ?

Thanks in advance.

Tathagata
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel