Skip to contentSkip to conversation

kwboot: boot kirkwood SoCs over a serial link

PATCH RESEND Superseded Luka Perkov 3 participants 4 messages May 27, 2012 – Jun 8, 2012

lore
Share & tools
lore
#0 lore raw

PATCH RESEND v3 1/1 kwboot: boot kirkwood SoCs over a serial link

The kwboot program boots boards based on Marvell's Kirkwood platform via Xmodem over their integrated UART.

---

Changes from version 2:

* fix timeouts in kwboot_tty_recv
* revert indentation on manpage
* on manpage note that TTY isn't optional
* add David and Luka into the manpage

Changes from version v1:
* fix man page
* minor cosmetic fixes in tools/kwboot.c

I'm resending this patch because original version 3 was not following patch submission guidlines.

 doc/kwboot.1   |   84 +++++++
 tools/Makefile |    6 +
 tools/kwboot.c |  742 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 832 insertions(+)
doc/kwboot.1 new file +84 -0
new file mode 100644
index 0000000..ed08398
@@ -0,0 +1,84 @@
+.TH KWBOOT 1 "2012-05-19"
+
+.SH NAME
+kwboot \- Boot Marvell Kirkwood SoCs over a serial link.
+.SH SYNOPSIS
+.B kwboot
+.RB [ "-b \fIimage\fP" ]
+.RB [ "-p" ]
+.RB [ "-t" ]
+.RB [ "-B \fIbaudrate\fP" ]
+.RB \fITTY\fP
+.SH "DESCRIPTION"
+
+The \fBmkimage\fP program boots boards based on Marvell's Kirkwood
+platform over their integrated UART. Boot image files will typically
+contain a second stage boot loader, such as U-Boot. The image file
+must conform to Marvell's BootROM firmware image format
+(\fIkwbimage\fP), created using a tool such as \fBmkimage\fP.
+
+Following power-up or a system reset, system BootROM code polls the
+UART for a brief period of time, sensing a handshake message which
+initiates an image upload. This program sends this boot message until
+it receives a positive acknowledgement. The image is transfered using
+Xmodem.
+
+Additionally, this program implements a minimal terminal mode, which
+can be used either standalone, or entered immediately following boot
+image transfer completion. This is often useful to catch early boot
+messages, or to manually interrupt a default boot procedure performed
+by the second-stage loader.
+
+.SH "OPTIONS"
+
+.TP
+.BI "\-b \fIimage\fP"
+Handshake; then upload file \fIimage\fP over \fITTY\fP.
+
+Note that for the encapsulated boot code to be executed, \fIimage\fP
+must be of type "UART boot" (0x69). Boot images of different types,
+such as backup images of vendor firmware downloaded from flash memory
+(type 0x8B), will not work (or not as expected). See \fB-p\fP for a
+workaround.
+
+This mode writes handshake status and upload progress indication to
+stdout.
+
+.TP
+.BI "\-p"
+In combination with \fB-b\fP, patches the header in \fIimage\fP prior
+to upload, to "UART boot" type.
+
+This option attempts on-the-fly conversion of some none-UART image
+types, such as images which were originally formatted to be stored in
+flash memory.
+
+Conversion is performed in memory. The contents of \fIimage\fP will
+not be altered.
+
+.TP
+.BI "\-t"
+Run a terminal program, connecting standard input and output to
+.RB \fITTY\fP.
+
+If used in combination with \fB-b\fP, terminal mode is entered
+immediately following a successful image upload.
+
+If standard I/O streams connect to a console, this mode will terminate
+after receiving 'ctrl-\\' followed by 'c' from console input.
+
+.TP
+.BI "\-B \fIbaudrate\fP"
+Adjust the baud rate on \fITTY\fP. Default rate is 115200.
+
+.SH "SEE ALSO"
+.PP
+\fBmkimage\fP(1)
+
+.SH "AUTHORS"
+
+Daniel Stodden <[email protected]>
+.br
+Luka Perkov <[email protected]>
+.br
+David Purdy <[email protected]>
tools/Makefile +6 -0
index 8993fdd..8097d95 100644
@@ -72,6 +72,7 @@ BIN_FILES-$(CONFIG_SMDK5250) += mksmdk5250spl$(SFX)
 BIN_FILES-$(CONFIG_MX28) += mxsboot$(SFX)
 BIN_FILES-$(CONFIG_NETCONSOLE) += ncb$(SFX)
 BIN_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1$(SFX)
+BIN_FILES-$(CONFIG_KIRKWOOD) += kwboot$(SFX)
 
 # Source files which exist outside the tools directory
 EXT_OBJ_FILES-$(CONFIG_BUILD_ENVCRC) += common/env_embedded.o
@@ -101,6 +102,7 @@ OBJ_FILES-$(CONFIG_NETCONSOLE) += ncb.o
 NOPED_OBJ_FILES-y += os_support.o
 OBJ_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1.o
 NOPED_OBJ_FILES-y += ublimage.o
+OBJ_FILES-$(CONFIG_KIRKWOOD) += kwboot.o
 
 # Don't build by default
 #ifeq ($(ARCH),ppc)
@@ -234,6 +236,10 @@ $(obj)ncb$(SFX):	$(obj)ncb.o
 $(obj)ubsha1$(SFX):	$(obj)os_support.o $(obj)sha1.o $(obj)ubsha1.o
 	$(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
 
+$(obj)kwboot$(SFX): $(obj)kwboot.o
+	$(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
+	$(HOSTSTRIP) $@
+
 # Some of the tool objects need to be accessed from outside the tools directory
 $(obj)%.o: $(SRCTREE)/common/%.c
 	$(HOSTCC) -g $(HOSTCFLAGS_NOPED) -c -o $@ $<
tools/kwboot.c new file +742 -0

742 lines not on this page · raw message

#1 lore raw

PATCH RESEND v3 1/1 kwboot: boot kirkwood SoCs over a serial link

Hi all,

Quoted 21 lines · Luka Perkov

The kwboot program boots boards based on Marvell's Kirkwood platform via Xmodem over their integrated UART.

---

Changes from version 2:

* fix timeouts in kwboot_tty_recv
* revert indentation on manpage
* on manpage note that TTY isn't optional
* add David and Luka into the manpage

Changes from version v1:
* fix man page
* minor cosmetic fixes in tools/kwboot.c

Quoted 7 lines

I'm resending this patch because original version 3 was not following patch submission guidlines.

 doc/kwboot.1   |   84 +++++++
 tools/Makefile |    6 +
 tools/kwboot.c |  742 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 832 insertions(+)

If no one has objections to the code I would love to see it merged. Any NACK's or ACK's?

Regards,
Luka

#2 lore raw

PATCH RESEND v3 1/1 kwboot: boot kirkwood SoCs over a serial link

Quoted 27 lines · Luka Perkov

Hi all,

Quoted 24 lines · Luka Perkov

The kwboot program boots boards based on Marvell's Kirkwood platform via Xmodem over their integrated UART.

---

Changes from version 2:

* fix timeouts in kwboot_tty_recv
* revert indentation on manpage
* on manpage note that TTY isn't optional
* add David and Luka into the manpage

Changes from version v1:
* fix man page
* minor cosmetic fixes in tools/kwboot.c

I'm resending this patch because original version 3 was not following patch submission guidlines.

Quoted 8 lines
Quoted 4 lines
 doc/kwboot.1   |   84 +++++++
 tools/Makefile |    6 +
 tools/kwboot.c |  742 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 832 insertions(+)

If no one has objections to the code I would love to see it merged. Any NACK's or ACK's?

Certainly a thanks from me :)

Daniel

#3 lore raw

PATCH RESEND v3 1/1 kwboot: boot kirkwood SoCs over a serial link

In reply to Luka Perkov
Quoted 41 lines

-----Original Message-----
From: Luka Perkov [mailto:uboot at lukaperkov.net]
Sent: 07 June 2012 18:57
To: u-boot at lists.denx.de
Cc: Prafulla Wadaskar
Subject: Re: [U-Boot] [PATCH v3] [resend] kwboot: boot kirkwood SoCs over a serial link

Hi all,

Quoted 17 lines · Luka Perkov

The kwboot program boots boards based on Marvell's Kirkwood platform via Xmodem over their integrated UART.

---

Changes from version 2:

* fix timeouts in kwboot_tty_recv
* revert indentation on manpage
* on manpage note that TTY isn't optional
* add David and Luka into the manpage

Quoted 5 lines

Changes from version v1:
* fix man page
* minor cosmetic fixes in tools/kwboot.c

I'm resending this patch because original version 3 was not

following

Quoted 5 lines

patch submission guidlines.

 doc/kwboot.1   |   84 +++++++
 tools/Makefile |    6 +
 tools/kwboot.c |  742
Quoted 6 lines

++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Quoted 1 line
 3 files changed, 832 insertions(+)

If no one has objections to the code I would love to see it merged. Any
NACK's or ACK's?

Applied to u-boot-marvell.git master branch

Regards..
Prafulla . . .