[PATCH 09/10] ratp: new reset command

2018-02-02 Thread Aleksander Morgado
Signed-off-by: Aleksander Morgado 
---
 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/reset.c
+++ b/commands/reset.c
@@ -19,10 +19,26 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 
+static int common_reset (int shutdown_flag)
+{
+   debug("running reset %s\n", shutdown_flag ? "" : "(forced)");
+
+   if (shutdown_flag)
+   shutdown_barebox();
+
+   restart_machine();
+
+   /* Not reached */
+   return 1;
+}
+
+/* Console command */
+
 static int cmd_reset(int argc, char *argv[])
 {
int opt, shutdown_flag;
@@ -39,13 +55,7 @@ static int cmd_reset(int argc, char *argv[])
}
}
 
-   if (shutdown_flag)
-   shutdown_barebox();
-
-   restart_machine();
-
-   /* Not reached */
-   return 1;
+   return common_reset (shutdown_flag);
 }
 
 BAREBOX_CMD_HELP_START(reset)
@@ -61,3 +71,27 @@ BAREBOX_CMD_START(reset)
BAREBOX_CMD_HELP(cmd_reset_help)
BAREBOX_CMD_COMPLETE(empty_complete)
 BAREBOX_CMD_END
+
+/* RATP command */
+
+struct ratp_bb_reset {
+   struct ratp_bb header;
+   uint8_tforce;
+} __attribute__((packed));
+
+static int ratp_cmd_reset(const struct ratp_bb *req, int req_len,
+ struct ratp_bb **rsp, int *rsp_len)
+{
+   struct ratp_bb_reset *reset_req = (struct ratp_bb_reset *)req;
+
+   if (req_len < sizeof (*reset_req)) {
+   printf ("ratp reset ignored: size mismatch (%d < %zu)\n", 
req_len, sizeof (*reset_req));
+   return 2;
+   }
+
+   return common_reset (reset_req->force);
+}
+
+BAREBOX_RATP_CMD_START(RESET)
+   .cmd = ratp_cmd_reset
+BAREBOX_RATP_CMD_END
-- 
2.15.1


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH 10/10] ratp: new md and mw commands

2018-02-02 Thread Aleksander Morgado
This commit introduces support for running the md and mw commands
using the binary interface provided by RAPT. This allows clients to
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 fixed-sized
   variables (e.g. integers), as well as the size and offset of the
   variable-length variables.

 * After the initial fixed-sized section, the buffer is given, which
   contains the variable-length variables in the offsets previously
   defined and with the size previously defined.

The message also defines separately the offset of the buffer
w.r.t. the start of the message. The endpoint reading the message will
use this information to decide where the buffer starts. This allows to
extend the message format in the future without needing to break the
message API, as new fields can be appended to the fixed-sized section
as long as the buffer offset is also updated to report the new
position of the buffer.

E.g. testing with ratp-barebox-cli:

  $ ratp-barebox-cli -t /dev/ttyUSB2 --md "/dev/pic_eeprom_rdu,0x107,5" 
--timeout 1000
  Sending md request: read '/dev/pic_eeprom_rdu': 0x0107 (+5 bytes)
  00:00:00:00:00

  $ ratp-barebox-cli -t /dev/ttyUSB2 --mw 
"/dev/pic_eeprom_rdu,0x107,01:02:03:04:05" --timeout 1000
  Sending mw request: write '/dev/pic_eeprom_rdu': 0x0107 (+5 bytes)
  5/5 bytes written

  $ ratp-barebox-cli -t /dev/ttyUSB2 --md "/dev/pic_eeprom_rdu,0x107,5" 
--timeout 1000
  Sending md request: read '/dev/pic_eeprom_rdu': 0x0107 (+5 bytes)
  01:02:03:04:05

  $ ratp-barebox-cli -t /dev/ttyUSB2 --mw 
"/dev/pic_eeprom_rdu,0x107,00:00:00:00:00" --timeout 1000
  Sending mw request: write '/dev/pic_eeprom_rdu': 0x0107 (+5 bytes)
  5/5 bytes written

  $ ratp-barebox-cli -t /dev/ttyUSB2 --md "/dev/pic_eeprom_rdu,0x107,5" 
--timeout 1000
  Sending md request: read '/dev/pic_eeprom_rdu': 0x0107 (+5 bytes)
  00:00:00:00:00

Signed-off-by: Aleksander Morgado 
---
 commands/md.c | 209 ++
 commands/mw.c | 150 ++-
 include/ratp_bb.h |   2 +
 3 files changed, 330 insertions(+), 31 deletions(-)

diff --git a/commands/md.c b/commands/md.c
index 3e83c723a..6cd3b9bcf 100644
--- a/commands/md.c
+++ b/commands/md.c
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2011 Sascha Hauer , Pengutronix
+ * Copyright (c) 2011-2018 Sascha Hauer , Pengutronix
+ * Copyright (c) 2018 Zodiac Inflight Innovations
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -23,6 +24,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -36,66 +38,84 @@
 
 extern char *mem_rw_buf;
 
-static int do_mem_md(int argc, char *argv[])
+static int common_mem_md(const char *filename,
+loff_t start,
+loff_t size,
+int swab,
+int mode,
+uint8_t *output)
 {
-   loff_t  start = 0, size = 0x100;
-   int r, now;
-   int ret = 0;
+   int r, now, t;
+   int ret = 0;
int fd;
-   char *filename = "/dev/mem";
-   int mode = O_RWSIZE_4;
-   int swab = 0;
void *map;
 
-   if (argc < 2)
-   return COMMAND_ERROR_USAGE;
-
-   if (mem_parse_options(argc, argv, "bwlqs:x", &mode, &filename, NULL,
-   &swab) < 0)
-   return 1;
-
-   if (optind < argc) {
-   if (parse_area_spec(argv[optind], &start, &size)) {
-   printf("could not parse: %s\n", argv[optind]);
-   return 1;
-   }
-   if (size == ~0)
-   size = 0x100;
-   }
-
fd = open_and_lseek(filename, mode | O_RDONLY, start);
if (fd < 0)
return 1;
 
map = memmap(fd, PROT_READ);
if (map != (void *)-1) {
-   ret = memory_display(map + start, start, size,
-   mode >> O_RWSIZE_SHIFT, swab);
+   if (output)
+   memcpy(output, (uint8_t *)(map + start), size);
+else
+   ret = memory_display(map + start, start, size,
+mode >> O_RWSIZE_SHIFT, swab);
goto out;
}
 
+   t = 0;
do {
now = min(size, (loff_t)RW_BUF_SIZE);
r = read(fd, mem_rw_buf, now);
if (r < 0) {
+   ret = -errno;
perror("read");
goto out;
}
if (!r)
goto out;
 
-   if ((ret = memory_display(mem_rw_buf, start, r,
-   mode >> O_RWSIZE_SHIFT, sw

[PATCH 04/10] ratp: port getenv operation to req/rsp format

2018-02-02 Thread Aleksander Morgado
The getenv operation executed via RATP is processed in the following
way:

 * The client sends a 'getenv' packet to barebox specifying the name
   of the variable to read.
 * Barebox replies with a 'getenv_result' packet including the value
   of the variable read.

We now consolidate this process using the request and response
packet flags, and making them part of the same 'getenv' packet type.

Signed-off-by: Aleksander Morgado 
---
 common/ratp.c| 10 ++
 scripts/remote/controller.py | 13 -
 scripts/remote/messages.py   | 19 ++-
 3 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/common/ratp.c b/common/ratp.c
index 222bf624a..2423c0651 100644
--- a/common/ratp.c
+++ b/common/ratp.c
@@ -33,8 +33,7 @@
 
 #define BB_RATP_TYPE_CONSOLE   1
 #define BB_RATP_TYPE_PING  2
-#define BB_RATP_TYPE_GETENV6
-#define BB_RATP_TYPE_GETENV_RETURN 7
+#define BB_RATP_TYPE_GETENV3
 #define BB_RATP_TYPE_FS8
 #define BB_RATP_TYPE_FS_RETURN 9
 
@@ -192,7 +191,8 @@ static int ratp_bb_send_getenv_return(struct ratp_ctx *ctx, 
const char *val)
rbb = buf;
strcpy(rbb->data, val);
 
-   rbb->type = cpu_to_be16(BB_RATP_TYPE_GETENV_RETURN);
+   rbb->type = cpu_to_be16(BB_RATP_TYPE_GETENV);
+   rbb->flags = cpu_to_be16(BB_RATP_FLAG_RESPONSE);
 
ret = ratp_send(&ctx->ratp, buf, len);
 
@@ -239,8 +239,10 @@ static int ratp_bb_dispatch(struct ratp_ctx *ctx, const 
void *buf, int len)
break;
 
case BB_RATP_TYPE_GETENV:
-   varname = xmemdup_add_zero(&rbb->data, dlen);
+   if (flags & BB_RATP_FLAG_RESPONSE)
+   break;
 
+   varname = xmemdup_add_zero(&rbb->data, dlen);
ret = ratp_bb_send_getenv_return(ctx, getenv(varname));
break;
 
diff --git a/scripts/remote/controller.py b/scripts/remote/controller.py
index 518973038..29aa42ad9 100644
--- a/scripts/remote/controller.py
+++ b/scripts/remote/controller.py
@@ -37,9 +37,12 @@ def unpack(data):
 return BBPacketPingResponse(raw=data)
 logging.debug("received: ping")
 return BBPacketPingRequest(raw=data)
-elif p_type == BBType.getenv_return:
-logging.debug("received: getenv_return")
-return BBPacketGetenvReturn(raw=data)
+elif p_type == BBType.getenv:
+if p_flag & BBFlag.response:
+logging.debug("received: getenv response")
+return BBPacketGetenvResponse(raw=data)
+logging.debug("received: getenv")
+return BBPacketGetenvRequest(raw=data)
 elif p_type == BBType.fs:
 logging.debug("received: fs")
 return BBPacketFS(raw=data)
@@ -108,8 +111,8 @@ class Controller(Thread):
 return r.exit_code
 
 def getenv(self, varname):
-self._send(BBPacketGetenv(varname=varname))
-r = self._expect(BBPacketGetenvReturn)
+self._send(BBPacketGetenvRequest(varname=varname))
+r = self._expect(BBPacketGetenvResponse)
 return r.text
 
 def close(self):
diff --git a/scripts/remote/messages.py b/scripts/remote/messages.py
index 6c5601d78..88841f4f6 100644
--- a/scripts/remote/messages.py
+++ b/scripts/remote/messages.py
@@ -14,8 +14,7 @@ class BBFlag(object):
 class BBType(object):
 console = 1
 ping = 2
-getenv = 6
-getenv_return = 7
+getenv = 3
 fs = 8
 fs_return = 9
 
@@ -116,13 +115,14 @@ class BBPacketPingResponse(BBPacket):
 return "BBPacketPingResponse()"
 
 
-class BBPacketGetenv(BBPacket):
+class BBPacketGetenvRequest(BBPacket):
 def __init__(self, raw=None, varname=None):
 self.varname = varname
-super(BBPacketGetenv, self).__init__(BBType.getenv, raw=raw)
+super(BBPacketGetenvRequest, self).__init__(BBType.getenv,
+raw=raw)
 
 def __repr__(self):
-return "BBPacketGetenv(varname=%r)" % self.varname
+return "BBPacketGetenvRequest(varname=%r)" % self.varname
 
 def _unpack_payload(self, payload):
 self.varname = payload
@@ -131,14 +131,15 @@ class BBPacketGetenv(BBPacket):
 return self.varname
 
 
-class BBPacketGetenvReturn(BBPacket):
+class BBPacketGetenvResponse(BBPacket):
 def __init__(self, raw=None, text=None):
 self.text = text
-super(BBPacketGetenvReturn, self).__init__(BBType.getenv_return,
-   raw=raw)
+super(BBPacketGetenvResponse, self).__init__(BBType.getenv,
+ BBFlag.response,
+ raw=raw)
 
 def __repr__(self):
-return "BBPacketGetenvReturn(varvalue=%s)" % self.text
+return "BBPacketGetenvResponse(varvalue=%s)" % self.text
 
 def _unpack_payload(self, payload):
 self.text = payloa

[PATCH 05/10] ratp: port filesystem operation to req/rsp format

2018-02-02 Thread Aleksander Morgado
The filesystem operation executed via RATP is processed in the
following way:

 * The barebox RATP endpoint sends 'fs' packets to the client, with
   the specific filesystem operations to execute.
 * The client replies with 'fs_result' packets to barebox, containing
   the result of the filesystem 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 
---
 common/ratp.c|  9 ++---
 scripts/remote/controller.py | 12 ++--
 scripts/remote/messages.py   | 20 
 scripts/remote/ratpfs.py |  6 +++---
 4 files changed, 27 insertions(+), 20 deletions(-)

diff --git a/common/ratp.c b/common/ratp.c
index 2423c0651..79b0a9906 100644
--- a/common/ratp.c
+++ b/common/ratp.c
@@ -34,8 +34,7 @@
 #define BB_RATP_TYPE_CONSOLE   1
 #define BB_RATP_TYPE_PING  2
 #define BB_RATP_TYPE_GETENV3
-#define BB_RATP_TYPE_FS8
-#define BB_RATP_TYPE_FS_RETURN 9
+#define BB_RATP_TYPE_FS4
 
 #define BB_RATP_FLAG_NONE  0
 #define BB_RATP_FLAG_RESPONSE  (1 << 0) /* Packet is a response */
@@ -246,7 +245,11 @@ static int ratp_bb_dispatch(struct ratp_ctx *ctx, const 
void *buf, int len)
ret = ratp_bb_send_getenv_return(ctx, getenv(varname));
break;
 
-   case BB_RATP_TYPE_FS_RETURN:
+   case BB_RATP_TYPE_FS:
+   /* Only responses expected */
+   if (!(flags & BB_RATP_FLAG_RESPONSE))
+   break;
+
pkt = xzalloc(sizeof(*pkt) + dlen);
pkt->len = dlen;
memcpy(pkt->data, &rbb->data, dlen);
diff --git a/scripts/remote/controller.py b/scripts/remote/controller.py
index 29aa42ad9..db4af3120 100644
--- a/scripts/remote/controller.py
+++ b/scripts/remote/controller.py
@@ -44,11 +44,11 @@ def unpack(data):
 logging.debug("received: getenv")
 return BBPacketGetenvRequest(raw=data)
 elif p_type == BBType.fs:
-logging.debug("received: fs")
-return BBPacketFS(raw=data)
-elif p_type == BBType.fs_return:
-logging.debug("received: fs_return")
-return BBPacketFSReturn(raw=data)
+if p_flag & BBFlag.response:
+logging.debug("received: fs response")
+return BBPacketFsResponse(raw=data)
+logging.debug("received: fs request")
+return BBPacketFsRequest(raw=data)
 else:
 logging.debug("received: UNKNOWN")
 return BBPacket(raw=data)
@@ -74,7 +74,7 @@ class Controller(Thread):
 os.write(sys.stdout.fileno(), bbpkt.text)
 elif isinstance(bbpkt, BBPacketPong):
 print("pong",)
-elif isinstance(bbpkt, BBPacketFS):
+elif isinstance(bbpkt, BBPacketFsRequest):
 if self.fsserver != None:
 self._send(self.fsserver.handle(bbpkt))
 
diff --git a/scripts/remote/messages.py b/scripts/remote/messages.py
index 88841f4f6..98dda8b79 100644
--- a/scripts/remote/messages.py
+++ b/scripts/remote/messages.py
@@ -15,8 +15,7 @@ class BBType(object):
 console = 1
 ping = 2
 getenv = 3
-fs = 8
-fs_return = 9
+fs = 4
 
 
 class BBPacket(object):
@@ -148,17 +147,22 @@ class BBPacketGetenvResponse(BBPacket):
 return self.text
 
 
-class BBPacketFS(BBPacket):
+class BBPacketFsRequest(BBPacket):
 def __init__(self, raw=None, payload=None):
-super(BBPacketFS, self).__init__(BBType.fs, payload=payload, raw=raw)
+super(BBPacketFsRequest, self).__init__(BBType.fs,
+payload=payload,
+raw=raw)
 
 def __repr__(self):
-return "BBPacketFS(payload=%r)" % self.payload
+return "BBPacketFsRequest(payload=%r)" % self.payload
 
 
-class BBPacketFSReturn(BBPacket):
+class BBPacketFsResponse(BBPacket):
 def __init__(self, raw=None, payload=None):
-super(BBPacketFSReturn, self).__init__(BBType.fs_return, 
payload=payload, raw=raw)
+super(BBPacketFsResponse, self).__init__(BBType.fs,
+ BBFlag.response,
+ payload=payload,
+ raw=raw)
 
 def __repr__(self):
-return "BBPacketFSReturn(payload=%r)" % self.payload
+return "BBPacketFsResponse(payload=%r)" % self.payload
diff --git a/scripts/remote/ratpfs.py b/scripts/remote/ratpfs.py
index 91ca04454..9e88b03a6 100644
--- a/scripts/remote/ratpfs.py
+++ b/scripts/remote/ratpfs.py
@@ -9,7 +9,7 @@ import stat
 import struct
 from enum import IntEnum
 
-from .messages import BBPacketFS, BBPacketFSReturn
+from .messages import BBPacketFsRequest, BBPacketFsResponse
 
 class RatpFSType(IntEnum):
 invalid = 0
@@ -138,7 +138,7 @@ class RatpF

[PATCH 07/10] ratp: implement ping as a standard ratp command

2018-02-02 Thread Aleksander Morgado
Signed-off-by: Aleksander Morgado 
---
 commands/Makefile|  1 +
 commands/ratp-ping.c | 38 ++
 common/ratp.c| 27 ---
 3 files changed, 39 insertions(+), 27 deletions(-)
 create mode 100644 commands/ratp-ping.c

diff --git a/commands/Makefile b/commands/Makefile
index 00a863919..012a3ad68 100644
--- a/commands/Makefile
+++ b/commands/Makefile
@@ -126,3 +126,4 @@ obj-$(CONFIG_CMD_SEED)  += seed.o
 obj-$(CONFIG_CMD_ZODIAC_PIC)   += pic.o zii-pic-esb.o \
zii-pic-mezz.o zii-pic-niu.o \
zii-pic-rdu.o zii-pic-rdu2.o
+obj-$(CONFIG_RATP) += ratp-ping.o
diff --git a/commands/ratp-ping.c b/commands/ratp-ping.c
new file mode 100644
index 0..837c56762
--- /dev/null
+++ b/commands/ratp-ping.c
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2018 Sascha Hauer , Pengutronix
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+/*
+ * RATP ping
+ */
+
+#include 
+#include 
+#include 
+
+static int ratp_cmd_ping(const struct ratp_bb *req, int req_len,
+struct ratp_bb **rsp, int *rsp_len)
+{
+   *rsp_len = sizeof(struct ratp_bb);
+   *rsp = xzalloc(*rsp_len);
+   (*rsp)->type = cpu_to_be16(BB_RATP_TYPE_PING);
+   (*rsp)->flags = cpu_to_be16(BB_RATP_FLAG_RESPONSE);
+   return 0;
+}
+
+BAREBOX_RATP_CMD_START(PING)
+   .cmd = ratp_cmd_ping
+BAREBOX_RATP_CMD_END
diff --git a/common/ratp.c b/common/ratp.c
index 2cdb1cd89..a880e8e03 100644
--- a/common/ratp.c
+++ b/common/ratp.c
@@ -146,26 +146,6 @@ static int ratp_bb_send_command_return(struct ratp_ctx 
*ctx, uint32_t errno)
return ret;
 }
 
-static int ratp_bb_send_pong(struct ratp_ctx *ctx)
-{
-   void *buf;
-   struct ratp_bb *rbb;
-   int len = sizeof(*rbb);
-   int ret;
-
-   buf = xzalloc(len);
-   rbb = buf;
-
-   rbb->type = cpu_to_be16(BB_RATP_TYPE_PING);
-   rbb->flags = cpu_to_be16(BB_RATP_FLAG_RESPONSE);
-
-   ret = ratp_send(&ctx->ratp, buf, len);
-
-   free(buf);
-
-   return ret;
-}
-
 static int ratp_bb_send_getenv_return(struct ratp_ctx *ctx, const char *val)
 {
void *buf;
@@ -414,13 +394,6 @@ static int dispatch_ratp_message(struct ratp_ctx *ctx, 
const void *buf, int len)
pr_debug("got command: %s\n", ratp_command);
break;
 
-   case BB_RATP_TYPE_PING:
-   if (flags & BB_RATP_FLAG_RESPONSE)
-   break;
-
-   ret = ratp_bb_send_pong(ctx);
-   break;
-
case BB_RATP_TYPE_GETENV:
if (flags & BB_RATP_FLAG_RESPONSE)
break;
-- 
2.15.1


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH 02/10] ratp: port command operation to req/rsp/ind format

2018-02-02 Thread Aleksander Morgado
The commands executed by the client via RATP are processed in the
following way:

 * The client sends a 'command' packet to the barebox console.
 * The result (errno) of the command is returned to the client via a
   'command_return' message.
 * The standard output of the command executed is sent to the client
   via 'consolemsg' packets.

If the client doesn't need any explicit response to the command sent
(e.g. when simulating a console in the client side), it may also just
do the following:

 * The client sends 'consolemsg' packets to the barebox console.

We now consolidate this process 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 
---
 common/ratp.c| 28 +++-
 scripts/remote/controller.py | 32 
 scripts/remote/messages.py   | 28 +++-
 3 files changed, 46 insertions(+), 42 deletions(-)

diff --git a/common/ratp.c b/common/ratp.c
index a1fa6fd5f..7d7fb5fcd 100644
--- a/common/ratp.c
+++ b/common/ratp.c
@@ -31,9 +31,7 @@
 #include 
 #include 
 
-#define BB_RATP_TYPE_COMMAND   1
-#define BB_RATP_TYPE_COMMAND_RETURN2
-#define BB_RATP_TYPE_CONSOLEMSG3
+#define BB_RATP_TYPE_CONSOLE   1
 #define BB_RATP_TYPE_PING  4
 #define BB_RATP_TYPE_PONG  5
 #define BB_RATP_TYPE_GETENV6
@@ -120,7 +118,8 @@ static void ratp_queue_console_tx(struct ratp_ctx *ctx)
unsigned int now, maxlen = 255 - sizeof(*rbb);
int ret;
 
-   rbb->type = cpu_to_be16(BB_RATP_TYPE_CONSOLEMSG);
+   rbb->type = cpu_to_be16(BB_RATP_TYPE_CONSOLE);
+   rbb->flags = cpu_to_be16(BB_RATP_FLAG_INDICATION);
 
while (1) {
now = min(maxlen, kfifo_len(ctx->console_transmit_fifo));
@@ -149,7 +148,8 @@ static int ratp_bb_send_command_return(struct ratp_ctx 
*ctx, uint32_t errno)
rbb = buf;
rbb_ret = buf + sizeof(*rbb);
 
-   rbb->type = cpu_to_be16(BB_RATP_TYPE_COMMAND_RETURN);
+   rbb->type = cpu_to_be16(BB_RATP_TYPE_CONSOLE);
+   rbb->flags = cpu_to_be16(BB_RATP_FLAG_RESPONSE);
rbb_ret->errno = cpu_to_be32(errno);
 
ret = ratp_send(&ctx->ratp, buf, len);
@@ -211,27 +211,29 @@ static int ratp_bb_dispatch(struct ratp_ctx *ctx, const 
void *buf, int len)
int dlen = len - sizeof(struct ratp_bb);
char *varname;
int ret = 0;
+   uint16_t flags = be16_to_cpu(rbb->flags);
 
switch (be16_to_cpu(rbb->type)) {
-   case BB_RATP_TYPE_COMMAND:
+   case BB_RATP_TYPE_CONSOLE:
+   if (flags & BB_RATP_FLAG_RESPONSE)
+   break;
+
+   if (flags & BB_RATP_FLAG_INDICATION) {
+   kfifo_put(ctx->console_recv_fifo, rbb->data, dlen);
+   break;
+   }
+
if (ratp_command)
return 0;
 
ratp_command = xmemdup_add_zero(&rbb->data, dlen);
ratp_ctx = ctx;
pr_debug("got command: %s\n", ratp_command);
-
break;
 
-   case BB_RATP_TYPE_COMMAND_RETURN:
case BB_RATP_TYPE_PONG:
break;
 
-   case BB_RATP_TYPE_CONSOLEMSG:
-
-   kfifo_put(ctx->console_recv_fifo, rbb->data, dlen);
-   break;
-
case BB_RATP_TYPE_PING:
ret = ratp_bb_send_pong(ctx);
break;
diff --git a/scripts/remote/controller.py b/scripts/remote/controller.py
index a7257ecc9..c3f29334a 100644
--- a/scripts/remote/controller.py
+++ b/scripts/remote/controller.py
@@ -20,17 +20,17 @@ except:
 
 
 def unpack(data):
-p_type, = struct.unpack("!H", data[:2])
-logging.debug("unpack: %r data=%r", p_type, repr(data))
-if p_type == BBType.command:
-logging.debug("received: command")
-return BBPacketCommand(raw=data)
-elif p_type == BBType.command_return:
-logging.debug("received: command_return")
-return BBPacketCommandReturn(raw=data)
-elif p_type == BBType.consolemsg:
-logging.debug("received: consolemsg")
-return BBPacketConsoleMsg(raw=data)
+p_type, p_flag = struct.unpack("!HH", data[:4])
+logging.debug("unpack: type %r flag %r data=%r", p_type, p_flag, 
repr(data))
+if p_type == BBType.console:
+if p_flag & BBFlag.response:
+logging.debug("received: console response")
+return BBPacketConsoleResponse(raw=data)
+if p_flag & BBFlag.indication:
+logging.debug("received: console indication")
+return BBPacketConsoleIndication(raw=data)
+logging.debug("received: console request")
+return BBPacketConsoleRequest(raw=data)
 elif p_type == BBType.ping:
 logging.debug("received: ping")
 return BBPacketPing(raw

[PATCH 03/10] ratp: port ping operation to req/rsp format

2018-02-02 Thread Aleksander Morgado
The ping operation executed via RATP is processed in the following way:

 * The client sends a 'ping' packet to barebox.
 * Barebox replies with a 'pong' packet.

We now consolidate this process using the request and response
packet flags, and making them part of the same 'ping' packet type.

Signed-off-by: Aleksander Morgado 
---
 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/ratp.c b/common/ratp.c
index 7d7fb5fcd..222bf624a 100644
--- a/common/ratp.c
+++ b/common/ratp.c
@@ -32,8 +32,7 @@
 #include 
 
 #define BB_RATP_TYPE_CONSOLE   1
-#define BB_RATP_TYPE_PING  4
-#define BB_RATP_TYPE_PONG  5
+#define BB_RATP_TYPE_PING  2
 #define BB_RATP_TYPE_GETENV6
 #define BB_RATP_TYPE_GETENV_RETURN 7
 #define BB_RATP_TYPE_FS8
@@ -169,7 +168,8 @@ static int ratp_bb_send_pong(struct ratp_ctx *ctx)
buf = xzalloc(len);
rbb = buf;
 
-   rbb->type = cpu_to_be16(BB_RATP_TYPE_PONG);
+   rbb->type = cpu_to_be16(BB_RATP_TYPE_PING);
+   rbb->flags = cpu_to_be16(BB_RATP_FLAG_RESPONSE);
 
ret = ratp_send(&ctx->ratp, buf, len);
 
@@ -231,10 +231,10 @@ static int ratp_bb_dispatch(struct ratp_ctx *ctx, const 
void *buf, int len)
pr_debug("got command: %s\n", ratp_command);
break;
 
-   case BB_RATP_TYPE_PONG:
-   break;
-
case BB_RATP_TYPE_PING:
+   if (flags & BB_RATP_FLAG_RESPONSE)
+   break;
+
ret = ratp_bb_send_pong(ctx);
break;
 
diff --git a/scripts/remote/controller.py b/scripts/remote/controller.py
index c3f29334a..518973038 100644
--- a/scripts/remote/controller.py
+++ b/scripts/remote/controller.py
@@ -32,11 +32,11 @@ def unpack(data):
 logging.debug("received: console request")
 return BBPacketConsoleRequest(raw=data)
 elif p_type == BBType.ping:
+if p_flag & BBFlag.response:
+logging.debug("received: pong")
+return BBPacketPingResponse(raw=data)
 logging.debug("received: ping")
-return BBPacketPing(raw=data)
-elif p_type == BBType.pong:
-logging.debug("received: pong")
-return BBPacketPong(raw=data)
+return BBPacketPingRequest(raw=data)
 elif p_type == BBType.getenv_return:
 logging.debug("received: getenv_return")
 return BBPacketGetenvReturn(raw=data)
@@ -92,8 +92,8 @@ class Controller(Thread):
 self.fsserver = RatpFSServer(path)
 
 def ping(self):
-self._send(BBPacketPing())
-r = self._expect(BBPacketPong)
+self._send(BBPacketPingRequest())
+r = self._expect(BBPacketPingResponse)
 logging.info("Ping: %r", r)
 if not r:
 return 1
@@ -157,7 +157,7 @@ class Controller(Thread):
 self._txq.put(BBPacketConsoleIndication(text=text))
 
 def send_async_ping(self):
-self._txq.put(BBPacketPing())
+self._txq.put(BBPacketPingRequest())
 
 
 def main():
diff --git a/scripts/remote/messages.py b/scripts/remote/messages.py
index 2f63f1831..6c5601d78 100644
--- a/scripts/remote/messages.py
+++ b/scripts/remote/messages.py
@@ -13,8 +13,7 @@ class BBFlag(object):
 
 class BBType(object):
 console = 1
-ping = 4
-pong = 5
+ping = 2
 getenv = 6
 getenv_return = 7
 fs = 8
@@ -98,20 +97,23 @@ class BBPacketConsoleIndication(BBPacket):
 return self.text
 
 
-class BBPacketPing(BBPacket):
+class BBPacketPingRequest(BBPacket):
 def __init__(self, raw=None):
-super(BBPacketPing, self).__init__(BBType.ping, raw=raw)
+super(BBPacketPingRequest, self).__init__(BBType.ping,
+  raw=raw)
 
 def __repr__(self):
-return "BBPacketPing()"
+return "BBPacketPingRequest()"
 
 
-class BBPacketPong(BBPacket):
+class BBPacketPingResponse(BBPacket):
 def __init__(self, raw=None):
-super(BBPacketPong, self).__init__(BBType.pong, raw=raw)
+super(BBPacketPingResponse, self).__init__(BBType.ping,
+   BBFlag.response,
+   raw=raw)
 
 def __repr__(self):
-return "BBPacketPong()"
+return "BBPacketPingResponse()"
 
 
 class BBPacketGetenv(BBPacket):
-- 
2.15.1


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH 01/10] ratp: define message type flags

2018-02-02 Thread Aleksander Morgado
Split message types in 3 different groups:

  * Requests: messages generated by one RATP endpoint and sent to the
the other endpoint to be processed.

  * Responses: messages generated by the RATP endpoint as a result of
having received and processed a specific request message.

  * 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 
---
 common/ratp.c  | 4 
 scripts/remote/messages.py | 5 +
 2 files changed, 9 insertions(+)

diff --git a/common/ratp.c b/common/ratp.c
index 80863f81f..a1fa6fd5f 100644
--- a/common/ratp.c
+++ b/common/ratp.c
@@ -41,6 +41,10 @@
 #define BB_RATP_TYPE_FS8
 #define BB_RATP_TYPE_FS_RETURN 9
 
+#define BB_RATP_FLAG_NONE  0
+#define BB_RATP_FLAG_RESPONSE  (1 << 0) /* Packet is a response */
+#define BB_RATP_FLAG_INDICATION(1 << 1) /* Packet is an 
indication */
+
 struct ratp_bb {
uint16_t type;
uint16_t flags;
diff --git a/scripts/remote/messages.py b/scripts/remote/messages.py
index 8e8495b12..7a597bc9d 100644
--- a/scripts/remote/messages.py
+++ b/scripts/remote/messages.py
@@ -5,6 +5,11 @@ from __future__ import absolute_import, division, 
print_function
 
 import struct
 
+class BBFlag(object):
+none = 0
+response = 1 << 0
+indication = 1 << 1
+
 
 class BBType(object):
 command = 1
-- 
2.15.1


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH 08/10] ratp: implement getenv as a standard ratp command

2018-02-02 Thread Aleksander Morgado
Also, use xstrndup() instead of the custom xmemdup_add_zero() as we're
working with strings anyway.

Signed-off-by: Aleksander Morgado 
---
 commands/Makefile  |  1 +
 commands/ratp-getenv.c | 50 ++
 common/ratp.c  | 34 --
 3 files changed, 51 insertions(+), 34 deletions(-)
 create mode 100644 commands/ratp-getenv.c

diff --git a/commands/Makefile b/commands/Makefile
index 012a3ad68..5e5464ec3 100644
--- a/commands/Makefile
+++ b/commands/Makefile
@@ -127,3 +127,4 @@ obj-$(CONFIG_CMD_ZODIAC_PIC)+= pic.o zii-pic-esb.o \
zii-pic-mezz.o zii-pic-niu.o \
zii-pic-rdu.o zii-pic-rdu2.o
 obj-$(CONFIG_RATP) += ratp-ping.o
+obj-$(CONFIG_RATP) += ratp-getenv.o
diff --git a/commands/ratp-getenv.c b/commands/ratp-getenv.c
new file mode 100644
index 0..2daaa63d8
--- /dev/null
+++ b/commands/ratp-getenv.c
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2018 Sascha Hauer , Pengutronix
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+/*
+ * RATP getenv
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+static int ratp_cmd_getenv(const struct ratp_bb *req, int req_len,
+  struct ratp_bb **rsp, int *rsp_len)
+{
+   int dlen = req_len - sizeof (struct ratp_bb);
+   char *varname;
+   const char *value;
+
+   varname = xstrndup ((const char *)req->data, dlen);
+   value = getenv (varname);
+   free (varname);
+
+   dlen = strlen (value);
+
+   *rsp_len = sizeof(struct ratp_bb) + dlen;
+   *rsp = xzalloc(*rsp_len);
+   (*rsp)->type = cpu_to_be16(BB_RATP_TYPE_GETENV);
+   (*rsp)->flags = cpu_to_be16(BB_RATP_FLAG_RESPONSE);
+   memcpy ((*rsp)->data, value, dlen);
+   return 0;
+}
+
+BAREBOX_RATP_CMD_START(GETENV)
+   .cmd = ratp_cmd_getenv
+BAREBOX_RATP_CMD_END
diff --git a/common/ratp.c b/common/ratp.c
index a880e8e03..e1ecb314c 100644
--- a/common/ratp.c
+++ b/common/ratp.c
@@ -24,7 +24,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -146,30 +145,6 @@ static int ratp_bb_send_command_return(struct ratp_ctx 
*ctx, uint32_t errno)
return ret;
 }
 
-static int ratp_bb_send_getenv_return(struct ratp_ctx *ctx, const char *val)
-{
-   void *buf;
-   struct ratp_bb *rbb;
-   int len, ret;
-
-   if (!val)
-   val = "";
-
-   len = sizeof(*rbb) + strlen(val);
-   buf = xzalloc(len);
-   rbb = buf;
-   strcpy(rbb->data, val);
-
-   rbb->type = cpu_to_be16(BB_RATP_TYPE_GETENV);
-   rbb->flags = cpu_to_be16(BB_RATP_FLAG_RESPONSE);
-
-   ret = ratp_send(&ctx->ratp, buf, len);
-
-   free(buf);
-
-   return ret;
-}
-
 static char *ratp_command;
 static struct ratp_ctx *ratp_ctx;
 
@@ -355,7 +330,6 @@ static int dispatch_ratp_message(struct ratp_ctx *ctx, 
const void *buf, int len)
const struct ratp_bb *rbb = buf;
struct ratp_bb_pkt *pkt;
int dlen = len - sizeof(struct ratp_bb);
-   char *varname;
int ret = 0;
uint16_t flags;
uint16_t type = be16_to_cpu(rbb->type);
@@ -394,14 +368,6 @@ static int dispatch_ratp_message(struct ratp_ctx *ctx, 
const void *buf, int len)
pr_debug("got command: %s\n", ratp_command);
break;
 
-   case BB_RATP_TYPE_GETENV:
-   if (flags & BB_RATP_FLAG_RESPONSE)
-   break;
-
-   varname = xmemdup_add_zero(&rbb->data, dlen);
-   ret = ratp_bb_send_getenv_return(ctx, getenv(varname));
-   break;
-
case BB_RATP_TYPE_FS:
/* Only responses expected */
if (!(flags & BB_RATP_FLAG_RESPONSE))
-- 
2.15.1


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH 06/10] ratp: implement generic command support

2018-02-02 Thread Aleksander Morgado
The RATP implementation now allows executing generic commands with a
binary interface: binary requests are received and binary responses
are returned.

Each command can define its own RATP request contents (e.g. to specify
command-specific options) as well as its own RATP response contents
(if any data is to be returned).

Each command is associated with a numeric unique command ID, and for
easy reference these IDs are maintained in the common ratp_bb header.
Modules may override generic implemented commands or include their own
new ones (as long as the numeric IDs introduced are unique).

Signed-off-by: Aleksander Morgado 
---
 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.lds.S  |   5 +-
 arch/openrisc/cpu/barebox.lds.S   |   4 +
 arch/ppc/boards/pcm030/barebox.lds.S  |   4 +
 arch/ppc/mach-mpc85xx/barebox.lds.S   |   4 +
 arch/sandbox/board/barebox.lds.S  |   5 +
 arch/x86/lib/barebox.lds.S|   7 +
 arch/x86/mach-efi/elf_ia32_efi.lds.S  |   5 +
 arch/x86/mach-efi/elf_x86_64_efi.lds.S|   5 +
 common/module.lds.S   |   2 +
 common/ratp.c | 255 ++
 include/asm-generic/barebox.lds.h |   2 +
 include/ratp_bb.h |  47 ++
 16 files changed, 258 insertions(+), 104 deletions(-)

diff --git a/arch/arm/lib32/barebox.lds.S b/arch/arm/lib32/barebox.lds.S
index e7b87b7cd..6fadc2a35 100644
--- a/arch/arm/lib32/barebox.lds.S
+++ b/arch/arm/lib32/barebox.lds.S
@@ -85,6 +85,10 @@ SECTIONS
.barebox_cmd : { BAREBOX_CMDS }
__barebox_cmd_end = .;
 
+   __barebox_ratp_cmd_start = .;
+   .barebox_ratp_cmd : { BAREBOX_RATP_CMDS }
+   __barebox_ratp_cmd_end = .;
+
__barebox_magicvar_start = .;
.barebox_magicvar : { BAREBOX_MAGICVARS }
__barebox_magicvar_end = .;
diff --git a/arch/arm/lib64/barebox.lds.S b/arch/arm/lib64/barebox.lds.S
index 240699f1a..a53b933bb 100644
--- a/arch/arm/lib64/barebox.lds.S
+++ b/arch/arm/lib64/barebox.lds.S
@@ -82,6 +82,10 @@ SECTIONS
.barebox_cmd : { BAREBOX_CMDS }
__barebox_cmd_end = .;
 
+   __barebox_ratp_cmd_start = .;
+   .barebox_ratp_cmd : { BAREBOX_RATP_CMDS }
+   __barebox_ratp_cmd_end = .;
+
__barebox_magicvar_start = .;
.barebox_magicvar : { BAREBOX_MAGICVARS }
__barebox_magicvar_end = .;
diff --git a/arch/blackfin/boards/ipe337/barebox.lds.S 
b/arch/blackfin/boards/ipe337/barebox.lds.S
index 51a586af2..7e82a1bd7 100644
--- a/arch/blackfin/boards/ipe337/barebox.lds.S
+++ b/arch/blackfin/boards/ipe337/barebox.lds.S
@@ -68,6 +68,10 @@ SECTIONS
.barebox_cmd : { BAREBOX_CMDS }
___barebox_cmd_end = .;
 
+   ___barebox_ratp_cmd_start = .;
+   .barebox_ratp_cmd : { BAREBOX_RATP_CMDS }
+   ___barebox_ratp_cmd_end = .;
+
___barebox_magicvar_start = .;
.barebox_magicvar : { BAREBOX_MAGICVARS }
___barebox_magicvar_end = .;
@@ -91,4 +95,3 @@ SECTIONS
___bss_stop = .;
_end = .;
 }
-
diff --git a/arch/mips/lib/barebox.lds.S b/arch/mips/lib/barebox.lds.S
index 899f62b96..660d4be85 100644
--- a/arch/mips/lib/barebox.lds.S
+++ b/arch/mips/lib/barebox.lds.S
@@ -55,6 +55,10 @@ SECTIONS
.barebox_cmd : { BAREBOX_CMDS }
__barebox_cmd_end = .;
 
+   __barebox_ratp_cmd_start = .;
+   .barebox_ratp_cmd : { BAREBOX_RATP_CMDS }
+   __barebox_ratp_cmd_end = .;
+
__barebox_magicvar_start = .;
.barebox_magicvar : { BAREBOX_MAGICVARS }
__barebox_magicvar_end = .;
diff --git a/arch/nios2/cpu/barebox.lds.S b/arch/nios2/cpu/barebox.lds.S
index a2d7fa8cd..fbcd1cd3f 100644
--- a/arch/nios2/cpu/barebox.lds.S
+++ b/arch/nios2/cpu/barebox.lds.S
@@ -55,6 +55,10 @@ SECTIONS
.barebox_cmd : { BAREBOX_CMDS }
__barebox_cmd_end = .;
 
+   __barebox_ratp_cmd_start = .;
+   .barebox_ratp_cmd : { BAREBOX_RATP_CMDS }
+   __barebox_ratp_cmd_end = .;
+
__barebox_magicvar_start = .;
.barebox_magicvar : { BAREBOX_MAGICVARS }
__barebox_magicvar_end = .;
@@ -129,4 +133,3 @@ SECTIONS
_end = .;
PROVIDE (end = .);
 }
-
diff --git a/arch/openrisc/cpu/barebox.lds.S b/arch/openrisc/cpu/barebox.lds.S
index b819ca099..c6807aec3 100644
--- a/arch/openrisc/cpu/barebox.lds.S
+++ b/arch/openrisc/cpu/barebox.lds.S
@@ -57,6 +57,10 @@ SECTIONS
.barebox_cmd : { BAREBOX_CMDS } > ram
__barebox_cmd_end = .;
 
+   __barebox_ratp_cmd_start = .;
+   .barebox_ratp_cmd : { BAREBOX_RATP_CMDS } > ram
+   __barebox_ratp_cmd_end = .;
+
__barebox_magicvar_start = .;
.barebox_magicvar : { BAREBOX_MAGICVARS } > ram
__barebox_magicvar_end = .;
diff --git a/arch/ppc/boards/pcm030/barebox.lds.S

[RFC PATCH 00/10] ratp: new generic RATP command support

2018-02-02 Thread Aleksander Morgado
Until now, the barebox-specific RATP commands were all defined and
implemented in common/ratp.c. This series of patches allow ratp
commands to be defined in a similar way to console commands.

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 another which
   are not expected to be replied.

The current RATP operations are reformatted using this approach, by
specifying the message type in the until now unused 'flags' field of
the RATP barebox message, and making all messages of the same
operation share the same command id.

The next patches (6-8) add support to specifying RATP commands in
separate implementation files, defined with some new helper
BAREBOX_RATP_CMD_START/BAREBOX_RATP_CMD_END macros. The getenv and
ping commands are updated to use this new approach.

The last patches (9-10) implement three new commands via RATP: reset,
md and mw. Both md and mw operations are defined by a binary API, and
allow reading/writing memory without needing to do any kind of
parsing (as it was the case when e.g. running the md or mw console
commands).

The new commands were tested with the libratp-barebox library
(wip/md-mw branch) in https://github.com/aleksander0m/libratp-barebox

What do you think of these changes? The initial RATP API break is bad
but not sure 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: port getenv operation to req/rsp format
  ratp: port filesystem operation to req/rsp format
  ratp: implement generic command support
  ratp: implement ping as a standard ratp command
  ratp: implement getenv as a standard ratp command
  ratp: new reset command
  ratp: new md and mw commands

 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.lds.S  |   5 +-
 arch/openrisc/cpu/barebox.lds.S   |   4 +
 arch/ppc/boards/pcm030/barebox.lds.S  |   4 +
 arch/ppc/mach-mpc85xx/barebox.lds.S   |   4 +
 arch/sandbox/board/barebox.lds.S  |   5 +
 arch/x86/lib/barebox.lds.S|   7 +
 arch/x86/mach-efi/elf_ia32_efi.lds.S  |   5 +
 arch/x86/mach-efi/elf_x86_64_efi.lds.S|   5 +
 commands/Makefile |   2 +
 commands/md.c | 209 ++
 commands/mw.c | 150 +++-
 commands/ratp-getenv.c|  50 ++
 commands/ratp-ping.c  |  38 
 commands/reset.c  |  48 -
 common/module.lds.S   |   2 +
 common/ratp.c | 283 +++---
 include/asm-generic/barebox.lds.h |   2 +
 include/ratp_bb.h |  49 ++
 scripts/remote/controller.py  |  71 
 scripts/remote/messages.py|  90 ++
 scripts/remote/ratpfs.py  |   6 +-
 25 files changed, 800 insertions(+), 256 deletions(-)
 create mode 100644 commands/ratp-getenv.c
 create mode 100644 commands/ratp-ping.c

-- 
2.15.1


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox