mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Michael Riesch <michael.riesch@wolfvision.net>
To: Sascha Hauer <sha@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 5/5] scripts: Add rk-usb-loader tool
Date: Mon, 11 Oct 2021 11:46:12 +0200	[thread overview]
Message-ID: <9ffdc27e-1e8a-9e92-a982-f1c140f2bee1@wolfvision.net> (raw)
In-Reply-To: <20211011071812.GW28453@pengutronix.de>

Hello Sascha,

On 10/11/21 9:18 AM, Sascha Hauer wrote:
> On Fri, Oct 08, 2021 at 04:25:58PM +0200, Michael Riesch wrote:
>> Hello Sascha,
>>
>> On 10/6/21 4:22 PM, Sascha Hauer wrote:
>>> This adds a tool suitable for bootstrapping barebox on Rockchip RK3568
>>> SoCs. It has been tested on this SoC only. It might or might not work
>>> with minor adjustments on other SoCs.
>>>
>>> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
>>> ---
>>>  scripts/Kconfig         |   8 +
>>>  scripts/Makefile        |   3 +
>>>  scripts/rk-usb-loader.c | 324 ++++++++++++++++++++++++++++++++++++++++
>>>  scripts/rkimage.c       |  32 +---
>>>  scripts/rockchip.h      |  35 +++++
>>>  5 files changed, 371 insertions(+), 31 deletions(-)
>>>  create mode 100644 scripts/rk-usb-loader.c
>>>  create mode 100644 scripts/rockchip.h
>>>
>>> diff --git a/scripts/Kconfig b/scripts/Kconfig
>>> index 5cba520f4b..5118269c2d 100644
>>> --- a/scripts/Kconfig
>>> +++ b/scripts/Kconfig
>>> @@ -102,4 +102,12 @@ config OMAP4_HOSTTOOL_USBBOOT
>>>  
>>>  	  You need libusb-1.0 to compile this tool.
>>>  
>>> +config RK_USB_LOADER
>>> +	bool "Rockchip USB loader"
>>> +	depends on ARCH_ROCKCHIP || COMPILE_HOST_TOOLS
>>> +	help
>>> +	  Say Y here to build the rockchip usb loader tool.
>>> +
>>> +	  You need libusb-1.0 to compile this tool.
>>> +
>>>  endmenu
>>> diff --git a/scripts/Makefile b/scripts/Makefile
>>> index 53568573a3..db2168bfab 100644
>>> --- a/scripts/Makefile
>>> +++ b/scripts/Makefile
>>> @@ -36,6 +36,9 @@ hostprogs-always-$(CONFIG_OMAP3_USB_LOADER)		+= omap3-usb-loader
>>>  HOSTCFLAGS_omap4_usbboot.o = `pkg-config --cflags libusb-1.0`
>>>  HOSTLDLIBS_omap4_usbboot = -lpthread `pkg-config --libs libusb-1.0`
>>>  hostprogs-always-$(CONFIG_OMAP4_HOSTTOOL_USBBOOT)	+= omap4_usbboot
>>> +HOSTCFLAGS_rk-usb-loader.o = `pkg-config --cflags libusb-1.0`
>>> +HOSTLDLIBS_rk-usb-loader  = `pkg-config --libs libusb-1.0`
>>> +hostprogs-always-$(CONFIG_RK_USB_LOADER)		+= rk-usb-loader
>>>  
>>>  userprogs-always-$(CONFIG_BAREBOXENV_TARGET)		+= bareboxenv-target
>>>  userprogs-always-$(CONFIG_KERNEL_INSTALL_TARGET)	+= kernel-install-target
>>> diff --git a/scripts/rk-usb-loader.c b/scripts/rk-usb-loader.c
>>> new file mode 100644
>>> index 0000000000..87bc7b94a9
>>> --- /dev/null
>>> +++ b/scripts/rk-usb-loader.c
>>> @@ -0,0 +1,324 @@
>>> +// SPDX-License-Identifier: GPL-2.0-or-later
>>> +
>>> +/*
>>> + * rk-usb-loader: A tool to USB Bootstrap RK3568 SoCs
>>> + *
>>> + * This tool bootstraps Rockchip RK3568 SoCs via USB. It currently
>>> + * works for this SoC only. It takes the barebox images the barebox
>>> + * build process generates as input. The upload protocol has been
>>> + * taken from the rkdevelop tool, but it's not a full replacement
>>> + * of that tool.
>>> + */
>>
>> very nice! I was able to load barebox images into the RAM of the RK3568
>> EVB1 as well as of the Pine64 Quartz64A boards. So it works for the
>> RK3566 as well, maybe this should be reflected in the comments and the
>> commit message.
>>
>> Also, if it is not too much to ask, a short hint to this tool in the
>> documentation would be nice.
> 
> I added a text to the documentation and also a note about the RK3566 to
> the top of the tool's sourcecode.
> 
>>> +	dev = rk_usb_open(ctx, 0x2207, 0x350a);
> 
> I hardcoded the vid/pid of the RK3568 here. Is it the same for the
> RK3566 or did you have to change it?

The RK3566 has the same VID/PID:

ID 2207:350a Fuzhou Rockchip Electronics Company

and I guess the IDs can remain hardcoded for now.

Best regards,
Michael

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


      reply	other threads:[~2021-10-11  9:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-06 14:22 [PATCH 0/5] scripts: Common functions for host tools and rk-usb-loader Sascha Hauer
2021-10-06 14:22 ` [PATCH 1/5] scripts: Add Kconfig option for most host tools Sascha Hauer
2021-10-06 14:22 ` [PATCH 2/5] scripts: Add common library functions Sascha Hauer
2021-10-11 14:37   ` Masahiro Yamada
2021-10-11 14:52     ` Sascha Hauer
2021-10-11 16:38       ` Masahiro Yamada
2021-10-06 14:22 ` [PATCH 3/5] scripts/common: Add write_file() Sascha Hauer
2021-10-06 14:22 ` [PATCH 4/5] scripts/common: Add write_full() and read_full() Sascha Hauer
2021-10-06 14:22 ` [PATCH 5/5] scripts: Add rk-usb-loader tool Sascha Hauer
2021-10-08 14:25   ` Michael Riesch
2021-10-11  7:18     ` Sascha Hauer
2021-10-11  9:46       ` Michael Riesch [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9ffdc27e-1e8a-9e92-a982-f1c140f2bee1@wolfvision.net \
    --to=michael.riesch@wolfvision.net \
    --cc=barebox@lists.infradead.org \
    --cc=sha@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox