[LEDE-DEV] jtag on rt5350

2016-11-05 Thread Giuseppe Lippolis
Hi All,
In ordert o be able to flash properly lede on the DWR-512 most likly I need
to change the bootloader with u-boot (see
http://lists.infradead.org/pipermail/lede-dev/2016-October/003435.html).

Before to proceed I wold be sure that I'm able to control the target using
the jtag.
On internet I found some tips to create a .cfg file for openocd:

# FTDI C232HM - USB 2.0 Hi-Speed to MPSSE Cable
interface ftdi
ftdi_vid_pid 0x0403 0x6014
# 0x000f -> TMS, TCK, TDI, TDO
# 0x4000 -> ^LED
# 0x0010 -> GPIOL0 (grey)
# 0x0020 -> GPIOL1 (purpe)
# 0x0040 -> GPIOL2 (white)
# 0x0080 -> GPIOL3 (blue)
ftdi_layout_init 0x0008 0x400b
ftdi_layout_signal nTRST -data 0x0020 -oe 0x0020
jtag_ntrst_delay 100
adapter_khz 100
reset_config trst_only

set  _CHIPNAME rt5350
set  _ENDIAN little
set _CPUTAPID 0x1535024f

#daemon configuration
telnet_port 

#jtag scan chain
# format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)
jtag newtap $_CHIPNAME cpu -irlen 5  -ircapture 0x1 -irmask 0x3 -expected-id
$_CPUTAPID

set _TARGETNAME [format "%s.cpu" $_CHIPNAME]
target create $_TARGETNAME mips_m4k -endian $_ENDIAN -chain-position
$_TARGETNAME


When I run openocd I get:
Open On-Chip Debugger 0.9.0 (2015-09-02-10:43)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "jtag". To override
use 'transport select '.
jtag_ntrst_delay: 100
adapter speed: 100 kHz
trst_only separate trst_push_pull
Info : clock speed 100 kHz
Info : JTAG tap: rt5350.cpu tap/device found: 0x1535024f (mfg: 0x127, part:
0x5350, ver: 0x1)

And using the telnet connection:

Open On-Chip Debugger
> targets
TargetName Type   Endian TapNameState
--  -- -- -- -- 
 0* rt5350.cpu mips_m4k   little rt5350.cpu running
> init
> halt
Failed to enter Debug Mode!
Halt timed out, wake up GDB.
timed out while waiting for target halted

because the target is not halted I cannot send read/write command and thus I
cannot control the target.

Have someone some tips?

Thanks,
Bye.



___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH firewall3] iptables: fix loading standard target

2016-11-05 Thread Ralph Sennhauser
In case iptables is built with --disable-static xt_standard needs to be
loaded just like the other extensions.

Signed-off-by: Ralph Sennhauser 
---
 iptables.c | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/iptables.c b/iptables.c
index 95fc0d4..bbd2b00 100644
--- a/iptables.c
+++ b/iptables.c
@@ -630,8 +630,15 @@ find_target(struct fw3_ipt_rule *r, const char *name)
 {
struct xtables_target *t;
 
-   if (is_chain(r->h, name))
-   return xtables_find_target(XT_STANDARD_TARGET, 
XTF_LOAD_MUST_SUCCEED);
+   if (is_chain(r->h, name)) {
+   t = xtables_find_target(XT_STANDARD_TARGET, XTF_DONT_LOAD);
+   if (t) {
+   return t;
+   } else {
+   load_extension(r->h, "standard");
+   return xtables_find_target(XT_STANDARD_TARGET, 
XTF_LOAD_MUST_SUCCEED);
+   }
+   }
 
t = xtables_find_target(name, XTF_DONT_LOAD);
 
-- 
2.7.3


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH firewall3] iptables: fix loading standard target

2016-11-05 Thread Jo-Philipp Wich
Hi Ralph,

thanks - applied with minor code style change in 010723e.

~ Jo



signature.asc
Description: OpenPGP digital signature
___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH firewall3] iptables: fix loading standard target

2016-11-05 Thread Ralph Sennhauser
On Sat, 5 Nov 2016 17:58:49 +0100
Jo-Philipp Wich  wrote:

> Hi Ralph,
> 
> thanks - applied with minor code style change in 010723e.
> 
> ~ Jo
> 

Hi Jo,

fixup looks good.

Thanks

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] block: remove redundant "mnt" variable

2016-11-05 Thread Arkadiusz Drabczyk
Variable mnt is assigned a value and in the very next line it's assigned
to another variable and not used anymore which doesn't make sense.

Signed-off-by: Arkadiusz Drabczyk 
---
 block.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/block.c b/block.c
index 05f84aa..1d4f27d 100644
--- a/block.c
+++ b/block.c
@@ -1268,8 +1268,7 @@ static int check_extroot(char *path)
 static int mount_extroot(char *cfg)
 {
char overlay[] = "/tmp/extroot/overlay";
-   char mnt[] = "/tmp/extroot/mnt";
-   char *path = mnt;
+   char *path = "/tmp/extroot/mnt";
struct probe_info *pr;
struct mount *m;
int err = -1;
-- 
2.9.0


-- 
Arkadiusz Drabczyk 

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] block: remove redundant "mnt" variable

2016-11-05 Thread Arkadiusz Drabczyk
On Sat, Nov 05, 2016 at 09:12:14PM +0100, Arkadiusz Drabczyk wrote:
> Variable mnt is assigned a value and in the very next line it's assigned
> to another variable and not used anymore which doesn't make sense.
> 
> Signed-off-by: Arkadiusz Drabczyk 
> ---
>  block.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/block.c b/block.c
> index 05f84aa..1d4f27d 100644
> --- a/block.c
> +++ b/block.c
> @@ -1268,8 +1268,7 @@ static int check_extroot(char *path)
>  static int mount_extroot(char *cfg)
>  {
>   char overlay[] = "/tmp/extroot/overlay";
> - char mnt[] = "/tmp/extroot/mnt";
> - char *path = mnt;
> + char *path = "/tmp/extroot/mnt";
>   struct probe_info *pr;
>   struct mount *m;
>   int err = -1;

Sorry, this patch does not make any sense - I tested it before
submitting and block worked ok on my router but it would crash with
Segmentation Fault in mkdir_p() in line 1316 if this condition wasn't
met:

if (m->overlay)
path = overlay;

-- 
Arkadiusz Drabczyk 

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] Flashing AP148 ubi file?

2016-11-05 Thread Christian Mehlis

Hi,

I received a Compex WPQ864, which is almost a AP148 board.

Can someone document how to flash a dot ubi file (generated from lede 
build) to an AP148 (ipq8064)?


I'm optimistic that this will work for the WPQ, too.

I hope to provide lede board support for this "new" board.

Regards,
Christian

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev