The reference says:
If SYN was set we assume that the other end crashed and has
attempted to open a new connection. We respond by sending a
legal reset:
The reference says:
If the ACK flag was set then send:
but the cat stdout
messages via RATP go byte by byte...). After that, the additional read
operations above offset 1024 end up timing out. I believe I'm going to have to
work with RATFS in the near future, so I'll likely spend some time looking at
those issues soon anyway.
Aleksander Morgado (16):
.
This commit fixed a segfault in barebox when an unexpected SYN packet
was sent in the middle of a connection; barebox thought the packet had
data because the "data length" in the SYN packet was different than 0.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
lib/
one had RST set.
This commit fixes an infinite loop of messages sent and received
between both ends during the connection close procedure, found when
testing barebox against a third party ratp implementation.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
lib/ratp.c | 3
ommand specific header).
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
lib/ratp.c | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/lib/ratp.c b/lib/ratp.c
index c946bea1a..846f8130c 100644
--- a/lib/ratp.c
+++ b/lib/ratp.c
@@ -384,6 +384,7 @
The reference says:
If the SYN flag was set but the ACK was not set then the other
end of the connection has executed an active open also.
Acknowledge the SYN, choose your MDL, and send:
All ACKs without data must be built in the same way from the input
message:
This is no code change in ratp_sn_expected(), it's just rewritten in
the same way as ratp_an_expected(), which follows the RFC916 approach.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
lib/ratp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/ra
one.
These two fixes are a cleanup to follow the protocol correctly.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
lib/ratp.c | 8 +---
scripts/remote/ratp.py | 16 +---
2 files changed, 6 insertions(+), 18 deletions(-)
diff --git a/lib/ratp.c
This is just a cleanup; the variables are completely initialized later
on so the initial values are totally discarded anyway.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
lib/ratp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/ratp.c
is desired, and also
hide the computation of the actual flag value within the macro, so the
previous example would now look like:
ratp_set_next_an(ratp_sn(hdr));
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
lib/ratp.c | 30 --
1 file chang
letely established, but it allows third party ratp implementations
to do that.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
lib/ratp.c | 8 +++-
scripts/remote/ratp.py | 14 ++
2 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/lib/
close.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
lib/ratp.c | 2 +-
scripts/remote/ratp.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/ratp.c b/lib/ratp.c
index 46a82c69a..e7fbf640a 100644
--- a/lib/ratp.c
+++ b/lib/
Section 3.4 in the RFC916 shows a packet flow for the connection close
where the initial packet sent by the endpoint starting the close has
just the FIN flag set, without an ACK:
-->
Instead of manually constructing an ACK, use the ratp_send_ack()
method, which already does that properly.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
lib/ratp.c | 12 +++-
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/lib/ratp.c b/lib/ratp.c
And also, use ratp_send_ack() instead of manually constructing an ACK
if no data is pending to be sent.
The current barebox implementation doesn't allow any queueing of data
until the connection is established, so this is probably not a case
that would get run anyway.
Signed-off-by: Aleksander
Correctly reference `--port` instead of `--baudrate` when explaining
how to specify the port.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
Documentation/user/remote-control.rst | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/Documentatio
think?
Aleksander Morgado (2):
sandbox: fix registering multiple consoles
sandbox: --stdin and --stdout allow max one bidirectional console
arch/sandbox/board/console.c | 5 ++-
arch/sandbox/mach-sandbox/include/mach/linux.h | 2 +-
arch/sandbox/os/common.c
tivated (CONFIG_CONSOLE_ACTIVATE_ALL=n), the
default stdin/stdout console will be preferred instead of the new
FIFO/file based, which would need to be activated explicitly later on.
e.g.:
barebox@barebox sandbox:/ cs1.active=ioe
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
ar
so that a new unique device id is given to each newly registered
console device.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
arch/sandbox/board/console.c | 5 ++---
arch/sandbox/mach-sandbox/include/mach/linux.h | 2 +-
arch/sandbox/os/common.c
In addition to allowing read-only and write-only consoles with --stdin
and --stdout, we now allow bidirectional read/write consoles with FIFO
files. This is e.g. to allow doing RATP over the FIFO based consoles.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
arch/sand
If ratp_establish() fails we would be accessing the ratp_internal
struct after having disposed it.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
lib/ratp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/ratp.c b/lib/ratp.c
index d59
Hey,
I've been playing a bit with the possibility of having a C library to
talk RATP with barebox, totally equivalent to what bbremote does in
python, but as a general C lib with a stable API that may be
integrated in other C/C++ applications.
>From my POV I see two options to try:
a) build a
On Thu, Jun 1, 2017 at 2:31 PM, Sascha Hauer <s.ha...@pengutronix.de> wrote:
>> >> Correctly reference `--port` instead of `--baudrate` when explaining
>> >> how to specify the port.
>> >>
>> >> Signed-off-by: Aleksander Morgado <alek
On Thu, Jun 1, 2017 at 9:30 AM, Sascha Hauer <s.ha...@pengutronix.de> wrote:
> On Tue, May 30, 2017 at 11:46:34PM +0200, Aleksander Morgado wrote:
>> Correctly reference `--port` instead of `--baudrate` when explaining
>> how to specify the port.
>>
>>
the FIFO based consoles.
>>
>> Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
>> ---
>> arch/sandbox/os/common.c | 53
>> ++--
>> 1 file changed, 42 insertions(+), 11 deletions(-)
>
> Appli
=active@entry=false, timeout_ms=timeout_ms@entry=100) at lib/ratp.c:1645
#6 0x0040b888 in barebox_ratp (cdev=cdev@entry=0x77212bd0) at
common/ratp.c:470
#7 0x004046c3 in getc_raw () at common/console.c:416
...
Signed-off-by: Aleksander Morgado <alek
ve data.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
lib/ratp.c | 4 ++--
scripts/remote/ratp.py | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/ratp.c b/lib/ratp.c
index d3c252047..c946bea1a 100644
--- a/lib/ratp.c
+++ b/lib/ratp.c
@@ -1
The reference says:
If SYN was set we assume that the other end crashed and has
attempted to open a new connection. We respond by sending a
legal reset:
one had RST set.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
lib/ratp.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/ratp.c b/lib/ratp.c
index 43b8b04dc..d3c252047 100644
--- a/lib/ratp.c
+++ b/lib/ratp.c
@@ -1033,6 +1033,9 @@ static int ratp_behaviour_g(
The reference says:
If the ACK flag was set then send:
Hey Sascha,
I went through the RFC916 and ended up preparing a set of fixes and
improvements for the RATP logic in barebox.
Let me know what you think.
Cheers!
Aleksander Morgado (16):
ratp: add missing transition to SYN-RECEIVED in behavior B
ratp: avoid unnecessary variable
Hey,
For anyone interested, I ended up preparing a pair of C libraries and
a CLI tool that allow controlling barebox remotely using RATP, in the
same way as bbremote does it. The libraries would allow easy
integration on C applications that may want to remotely control
barebox.
Repositories:
The reference says:
5.2.3. SYN-RECEIVED
...
Departures
- A CLOSE request is made by the user. Create a packet with
FIN set. Send it and go to the FIN-WAIT state.
Add this missing step.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
lib/
and execute procedure I1 to process
any data which might be in this packet.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
lib/ratp.c | 8 +++-
scripts/remote/ratp.py | 14 ++
2 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/lib/
is desired, and also
hide the computation of the actual flag value within the macro, so the
previous example would now look like:
ratp_set_next_an(ratp_sn(hdr));
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
lib/ratp.c | 30 --
1 file chang
All ACKs without data must be built in the same way from the input
message:
one.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
lib/ratp.c | 8 +---
scripts/remote/ratp.py | 16 +---
2 files changed, 6 insertions(+), 18 deletions(-)
diff --git a/lib/ratp.c b/lib/ratp.c
index 846f8130c..321721ab7 100644
--- a/lib/ratp.c
This is no code change in ratp_sn_expected(), it's just rewritten in
the same way as ratp_an_expected(), which follows the RFC916 approach.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
lib/ratp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/ra
The reference says:
If the SYN flag was set but the ACK was not set then the other
end of the connection has executed an active open also.
Acknowledge the SYN, choose your MDL, and send:
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
lib/ratp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/ratp.c b/lib/ratp.c
index 0d384aa4e..e9536499e 100644
--- a/lib/ratp.c
+++ b/lib/ratp.c
@@ -382,7 +382,7 @@ static int ratp_send_ack(
When a single data byte is sent, it is flagged as SO and the actual
data goes in the length byte within the header.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
lib/ratp.c | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/lib/ratp.c b/lib/
Section 3.4 in the RFC916 shows a packet flow for the connection close
where the initial packet sent by the endpoint starting the close has
just the FIN flag set, without an ACK:
-->
Instead of manually constructing an ACK, use the ratp_send_ack()
method, which already does that properly.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
lib/ratp.c | 12 +++-
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/lib/ratp.c b/lib/ratp.c
Hey,
On 19/06/17 08:46, Sascha Hauer wrote:
>> I went through the RFC916 and ended up preparing a set of fixes and
>> improvements for the RATP logic in barebox.
>> Let me know what you think.
> As far as I can say the patches look good. It's quite a while since I
> last looked at the RATP code,
interfering with the countdown and menu just
when switching one of the consoles to RATP mode.
As a hint, this is what the standard console was printing due to this
issue when the RATP console was activated:
Hit m for menu or any other key to stop autoboot: [: missing `]'
Signed-off-by: Aleksander
The ratp_run_command() is really an implementation detail of the
barebox ratp 'command' operation support. Move it to the barebox
specific header and rename it with the correct prefix.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
common/ratp.c | 2 +-
include/
This struct type is used in the RATP FS implementation, but was never
used as a list element anywhere.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
include/ratp_bb.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/include/ratp_bb.h b/include/ratp_bb.h
index 70f
).
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
arch/arm/lib32/barebox.lds.S | 4 +
arch/arm/lib64/barebox.lds.S | 4 +
arch/blackfin/boards/ipe337/barebox.lds.S | 5 +-
arch/mips/lib/barebox.lds.S | 4 +
arch/nios2/cpu/barebox
how many other RATP API users are around except for
bbremote (ported along with the changes) and the libratp-barebox I'm
writing.
Aleksander Morgado (10):
ratp: define message type flags
ratp: port command operation to req/rsp/ind format
ratp: port ping operation to req/rsp format
ratp
u': 0x0107 (+5 bytes)
00:00:00:00:00
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
commands/md.c | 209 ++
commands/mw.c | 150 ++-
include/ratp_bb.h | 2 +
3 files changed, 3
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
commands/reset.c | 48 +---
1 file changed, 41 insertions(+), 7 deletions(-)
diff --git a/commands/reset.c b/commands/reset.c
index 6eac53262..7971b9f2f 100644
--- a/commands/r
using the request, response and
indication packet flags, and making them part of the same 'console'
packet type. In this specific message type, indications may be sent in
both directions.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
common/ratp.c
.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
common/ratp.c| 12 ++--
scripts/remote/controller.py | 14 +++---
scripts/remote/messages.py | 18 ++
3 files changed, 23 insertions(+), 21 deletions(-)
diff --git a/common/ra
.
* Indications: messages generated by one RATP endpoint for which
there is no need to generate an explicit response message.
These message types are identified by new command flags.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
common/ratp.c | 4
scripts/
using the request and response
packet flags, and making them part of the same 'getenv' packet type.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
common/ratp.c| 10 ++
scripts/remote/controller.py | 13 -
scripts/remote/messages.py
operation.
We now consolidate this process using the request and response
packet flags, and making them part of the same 'fs' packet type.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
common/ratp.c| 9 ++---
scripts/remote/controller.p
Also, use xstrndup() instead of the custom xmemdup_add_zero() as we're
working with strings anyway.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
commands/Makefile | 1 +
commands/ratp-getenv.c | 50 ++
common/
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
commands/Makefile| 1 +
commands/ratp-ping.c | 38 ++
common/ratp.c| 27 ---
3 files changed, 39 insertions(+), 27 deletions(-)
create mode 100644 co
The 'ratp_command_ctx' seems to specify that this variable is only
used to process command operations, but it really is used in every
async operation (e.g. also in FS), so just rename it to a more generic
name for clarity.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
Don't reuse unrelated subparser variables for new command subparsers,
make each subparser have its own variable.
Just for consistency really, not a bugfix.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
scripts/remote/main.py | 14 +++---
1 file changed, 7 inse
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
common/ratp.c | 6 --
1 file changed, 6 deletions(-)
diff --git a/common/ratp.c b/common/ratp.c
index 6db4df870..80863f81f 100644
--- a/common/ratp.c
+++ b/common/ratp.c
@@ -54,14 +54,8 @@ struct ratp_bb_command_
()
(gdb) fr 1
#1 0x5556fd91 in of_get_machine_compatible () at
drivers/of/base.c:2380
2380 p = strchr(name, ',');
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
drivers/of/base.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/of/
On Tue, Feb 6, 2018 at 10:33 AM, Sascha Hauer <s.ha...@pengutronix.de> wrote:
> On Fri, Feb 02, 2018 at 12:14:39PM +0100, Aleksander Morgado wrote:
>> Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
>> ---
>> commands/Makefile|
>>
>> The first patches (1-5) break the current RATP API, by introducing
>> the concept of requests, responses and indications:
>> * Requests sent to one endpoint are expected to be replied with
>>a response by the peer endpoint.
>> * Indications are messages sent from one endpoint to
>> +
>> +#define BAREBOX_RATP_CMD_START(_name)
>> \
>> +extern const struct ratp_command __barebox_cmd_##_name;
>> \
>
> You shouldn't use the same name as the existing barebox commands,
> otherwise there
u': 0x0107 (+5 bytes)
00:00:00:00:00
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
common/ratp/Makefile | 2 +
common/ratp/md.c | 202 +++
common/ratp/mw.c | 173 +++
inclu
Also, use xstrndup() instead of the custom xmemdup_add_zero() as we're
working with strings anyway.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
common/ratp/Makefile | 1 +
common/ratp/getenv.c | 51 +++
common/ratp/
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
common/ratp/Makefile | 1 +
common/ratp/ping.c | 40
common/ratp/ratp.c | 24
3 files changed, 41 insertions(+), 24 deletions(-)
create mode 100644 commo
We are going to add new RATP command implementations in separate files
within this subdirectory.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
common/Kconfig | 13 +
common/Makefile | 4 ++--
common/ratp/Kconfig | 14 ++
introduced are unique).
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
arch/arm/lib32/barebox.lds.S | 4 ++
arch/arm/lib64/barebox.lds.S | 4 ++
arch/blackfin/boards/ipe337/barebox.lds.S | 5 +-
arch/mips/lib/barebox.lds.S | 4 ++
The console operations done via RATP expect strings, so just use
xstrndup() instead of defining a custom method.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
common/ratp/ratp.c | 13 +
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/commo
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
common/ratp/Makefile | 1 +
common/ratp/reset.c | 55
include/ratp_bb.h| 1 +
3 files changed, 57 insertions(+)
create mode 100644 common/ratp/reset.c
diff --git a/
branch) in https://github.com/aleksander0m/libratp-barebox
Aleksander Morgado (8):
ratp: implement generic command support
ratp: moved logic to its own subdirectory
ratp: allow building without full console support
ratp: implement ping as a standard ratp command
ratp: implement getenv
-by: Aleksander Morgado <aleksan...@aleksander.es>
---
common/Makefile| 1 -
common/ratp/ratp.c | 7 +--
fs/Kconfig | 2 +-
lib/Kconfig| 2 +-
lib/readline.c | 2 +-
5 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/common/Makefile b/common/Makefile
bytes written
$ ./bbremote --port /dev/ttyUSB2 md /dev/pic_eeprom_rdu 0x107 5
00
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
common/ratp/Makefile | 2 +
common/ratp/md.c | 202 +++
common/rat
E.g.:
$ ./bbremote -v --port /dev/ttyUSB2 reset
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
common/ratp/Makefile | 1 +
common/ratp/reset.c | 55
include/ratp_bb.h| 1 +
scripts/
Also, use xstrndup() instead of the custom xmemdup_add_zero() as we're
working with strings anyway.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
common/ratp/Makefile | 1 +
common/ratp/getenv.c | 51 +++
common/ratp/
The console operations done via RATP expect strings, so just use
xstrndup() instead of defining a custom method.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
common/ratp/ratp.c | 13 +
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/commo
-by: Aleksander Morgado <aleksan...@aleksander.es>
---
common/Makefile| 1 -
common/ratp/ratp.c | 7 +--
fs/Kconfig | 2 +-
lib/Kconfig| 2 +-
lib/readline.c | 2 +-
5 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/common/Makefile b/common/Makefile
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
Documentation/user/remote-control.rst | 7 +++
1 file changed, 7 insertions(+)
diff --git a/Documentation/user/remote-control.rst
b/Documentation/user/remote-control.rst
index 217251429..c8b7442f1 100644
--- a/Documen
We are going to add new RATP command implementations in separate files
within this subdirectory.
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
common/Kconfig | 13 +
common/Makefile | 4 ++--
common/ratp/Kconfig | 14 ++
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
common/ratp/Makefile | 1 +
common/ratp/ping.c | 40
common/ratp/ratp.c | 24
3 files changed, 41 insertions(+), 24 deletions(-)
create mode 100644 commo
-barebox-cli tools.
Aleksander Morgado (9):
ratp: implement generic command support
ratp: moved logic to its own subdirectory
ratp: allow building without full console support
ratp: implement ping as a standard ratp command
ratp: implement getenv as a standard ratp command
ratp: use
introduced are unique).
Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
arch/arm/lib32/barebox.lds.S | 4 ++
arch/arm/lib64/barebox.lds.S | 4 ++
arch/blackfin/boards/ipe337/barebox.lds.S | 5 +-
arch/mips/lib/barebox.lds.S | 4 ++
>> read and write memory files without needing to do custom string
>> parsing on the data returned by the console 'md' and 'mw' operations.
>>
>> The request and response messages used for these new operations are
>> structured in the same way:
>>
>> * An initial fixed-sized section includes the
Hey,
>
> This topic could be ignored. GPIO set/get value functions from
> barebox are working fine BUT gpioinfo function has some bug it reports
> unchanged status for gpios value.
>
Not that I got into much detail, but when I saw that same issue (I
have some WIP patches to manage GPIOs via
Signed-off-by: Aleksander Morgado
---
scripts/remote/controller.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/scripts/remote/controller.py b/scripts/remote/controller.py
index 2ed834613..1a8390904 100644
--- a/scripts/remote/controller.py
+++ b/scripts/remote/controller.py
@@ -46,6
If no start register is explicitly given, receive data in master
receive mode.
Signed-off-by: Aleksander Morgado
---
commands/i2c.c | 21 +++--
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/commands/i2c.c b/commands/i2c.c
index 57dc092c2..2f7f820d4 100644
i2c-write 0x00 0x68 0x06A0 0x01
"8f30"
4 bytes written
$ ./scripts/bbremote --port /dev/ttyUSB2 i2c-read 0x00 0x68 0x06A0 0x01 4
8f300000
Signed-off-by: Aleksander Morgado
---
scripts/remote/controller.py | 24 ++
scripts/remote/main.py | 37
Introduce three new RATP commands that allow getting and setting GPIO
values as well as configuring the direction of the GPIO pins.
Signed-off-by: Aleksander Morgado
---
common/ratp/Makefile | 1 +
common/ratp/gpio.c | 148 +++
include/ratp_bb.h
When no explicit start register is given, the i2c message is emitted
in master send mode.
Signed-off-by: Aleksander Morgado
---
commands/i2c.c | 10 +++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/commands/i2c.c b/commands/i2c.c
index f0d16af0c..57dc092c2 100644
The i2c master send support was already implemented in the i2c_write command,
but it was not properly documented. The first patch in the series addresses
that.
In the second patch, the i2c master receive mode is implemented in the i2c_read
command.
[PATCH 1/2] i2c_write: document master send
in the message flags field. If this flag is unset, the start
register address is assumed 8-bit long.
If the message includes the I2C_FLAG_MASTER_MODE flag, the start
register field is ignored and a i2c master send/receive operation is
performed.
Signed-off-by: Aleksander Morgado
---
common/ratp
This patch series implements support for i2c and GPIO operations via RATP.
[PATCH 1/4] ratp: implement i2c read/write support
[PATCH 2/4] bbremote: implement i2c read/write support
[PATCH 3/4] ratp: implement support for GPIO commands
[PATCH 4/4] bbremote: implement support for GPIO
1 0
$ ./scripts/bbremote --port /dev/ttyUSB2 gpio-set-value 200 1
Signed-off-by: Aleksander Morgado
---
scripts/remote/controller.py | 36 ++
scripts/remote/main.py | 37 ++
scripts/remote/messages.py | 93
3 files changed
>> +struct ratp_bb_i2c_read_request {
>> + struct ratp_bb header;
>> + uint16_t buffer_offset;
>> + uint8_t bus;
>> + uint8_t addr;
>
> I wonder how we see the RATP support. If it's for adhoc debugging then
> bus/addr is fine. The caller should have no expectations that the bus
>
We need to advance the input buffer used to create messages when the
data doesn't fit in a single RATP packet.
Signed-off-by: Aleksander Morgado
---
include/ratp.h | 2 +-
lib/ratp.c | 6 --
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/include/ratp.h b/include/ratp.h
This is a simple coding style fix to avoid the whitespace before the
open-parenthesis in method calls.
Signed-off-by: Aleksander Morgado
---
common/ratp/getenv.c | 12 ++--
common/ratp/md.c | 8
common/ratp/mw.c | 6 +++---
common/ratp/reset.c | 4 ++--
4 files
1 - 100 of 108 matches
Mail list logo