| Commit message (Collapse) | Author | Age | Files | Lines |
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We already have <scripts/compiler.h>, which offers endianness conversion
for non-Linux platforms like MacOS. Let's use that to reduce our
dependency on external implementation-defined headers.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20230411093844.1297004-2-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |\ \ |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
By this commit board files can request building FlexSPI compatible
images via the .imxcfg parameters:
- flexspi_fcfbofs,
- flexspi_ivtofs.
If specified imx-image will build one image which can be deployed to
eMMC/SD/QSPI using the appropriate update handlers.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.barebox.org/20230228-v2023-02-0-topic-flexspi-v2-15-3d33126d2434@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Make header_len a parameter which is required for later on i.MX8MM
FlexSPI image support.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.barebox.org/20230228-v2023-02-0-topic-flexspi-v2-14-3d33126d2434@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Make the offset variable a parameter to make it possible to write
multiple ivt headers on multiple offsets. While on it use uint32_t
to match the data.image_ivt_offset type.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.barebox.org/20230228-v2023-02-0-topic-flexspi-v2-13-3d33126d2434@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |/
| |
| |
| |
| |
| |
| |
| | |
Use 'bool' instead of 'int' for local true/false flag variables.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.barebox.org/20230228-v2023-02-0-topic-flexspi-v2-12-3d33126d2434@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |/
|
|
|
|
|
|
|
|
|
|
| |
The current behaviour treats semicolons the same as end of line.
This breaks when they are found inside quoted strings, as is the
case for PKCS#11 URIs for example.
Ignore newlines and semicolons in quotes when parsing commands.
Signed-off-by: Albert Schwarzkopf <a.schwarzkopf@phytec.de>
Link: https://lore.barebox.org/20230327084827.1854478-1-a.schwarzkopf@phytec.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently arch specific headers can be included with #include <mach/xxx.h>.
With upcoming multi-arch support this is no longer possible as there
won't be a single mach anymore.
Move all i.MX specific header files to include/mach/imx/ to prepare for
multi-arch support.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On platforms that don't have a 2nd stage (in my case i.MX25) it usually
happens the transfer limit for the first (and only) upload is bigger than
the actual file length. Then it's the right thing to load the complete
image (minus its header), but not more.
This fixes a failure to boot via USB on i.MX25 that ends in
dl_command err=-1, last_trans=0
Fixes: 3367ebc55ebe ("scripts: imx-usb-loader: simplify code flow for file size calculations")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.barebox.org/20230315183338.78433-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We do an initial do_status() every time, which fails for i.MX8MP and
i.MX8MN:
found i.MX8MP USB device [1fc9:0146]
4 in err=-9, last_trans=0 00 00 00 00
status failed
If we instead skip it for SDPS (i.e. hid_endpoint), upload works as
expected (tested on i.MX8M Nano).
Reported-by: Hans Christian Lønstad <hcl@datarespons.no>
Fixes: 23e2203150b6 ("imx-usb-loader: Add i.MX8MP support")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220927173101.1696673-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
|
|
|
|
|
|
|
|
| |
Add VID/PID for i.MX8MN imx-usb-loader support. Everything else is
equivalent to the i.MX8MP, which also speaks SDPS instead of the older
more complicated SDP.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220805080754.1622205-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
|
|
|
|
|
|
|
| |
Change the buffer pointer in transfer() to type void * to drop some
unnecessary type casting from the callers.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.barebox.org/20220714072722.2863571-13-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
|
|
|
|
|
|
|
| |
When verifying the uploaded file we may only check the already uploaded
part of the image, not the whole image.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.barebox.org/20220714072722.2863571-12-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
|
|
|
|
|
|
|
|
|
| |
In read_memory() we transfer at maximum 64 bytes, so the returned number
of actually sent bytes will never be greater than 64 and we can drop the
corresponding checks. Then it is checked if there are really 64 bytes
transferred. We don't do this elsewhere, so drop it here as well.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.barebox.org/20220714072722.2863571-11-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On most SoCs the IVT header is not at the beginning of the image but at
offset 0x400. As we skip the leading 0x400 bytes while uploading we can
substract that offset from the image size we upload. This shouldn't make
a difference now, but in future we might change the two-staged upload
process: Now we upload the PBL once and afterwards the full image
incuding the same PBL again. It would be more elegant to upload the PBL
only once and only the rest of the image afterwards. If we do so, it it
important to exactly upload the first stage so that barebox on the other
end receives exactly the second stage at the offset it expects it to be.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.barebox.org/20220714072722.2863571-10-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
|
|
|
|
|
|
|
| |
Instead of casting 'bd' to struct imx_boot_data * multiple times use
an extra variable for it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.barebox.org/20220714072722.2863571-9-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
|
|
|
|
|
|
|
| |
For the i.MX8MP NXP dropped the SDP protocol used on other SoCs.
Instead the image is just sent straight to the device.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.barebox.org/20220714072722.2863571-8-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
mxs_load_file() actually uploads a buffer, so rename accordingly.
mxs_work() doesn't have a meaningful name at all, so rename to what
it actually does, mxs_load_file().
While at it remove the unused libusb_device_handle * argument.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.barebox.org/20220714072722.2863571-7-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
|
|
|
|
|
|
|
| |
The code to send a buffer straight to an endpoint is implemented twice.
Factor out the code to an extra function.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.barebox.org/20220714072722.2863571-6-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change contains several changes that make the code flow easier to
understand (in my eyes at least):
- Rename max_length to firststage_len
In some cases the image is loaded in two stages: First the PBL which
is started after the PBL is loaded completely and then the whole
image. So the size of the first stage isn't about some maximum.
- Drop unintuitive total_size variable
This variable used to be 0 in the one stage case and the filesize
otherwise. Just use firststage_len for the first stage and use the
filesize for the second stage (if needed).
- Don't call the first stage size "fsize" in the debug output.
- Add offset for second stage to debug output.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.barebox.org/20220617082414.323238-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
|
|
|
|
|
|
|
|
| |
Only one of the two members of struct usb_id is actually used. So
replace struct usb_id by a struct mach_id.
Signed-off-by: Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
Tested-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20210813152245.15841-3-u.kleine-koenig@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
|
|
|
|
|
|
|
| |
Makes the files not appear when searching for files that lack
SPDX-License-Identifier.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220103120539.1730644-4-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To verify only Kconfig/Makefile is touched:
git show --numstat --format=oneline HEAD | grep -v 'Kconfig\|Makefile'
will print only arch/powerpc/Kbuild.
To verify nothing unexpected is added:
git show -U0 | grep '^-[^-]\|^+[^+]' | sort -u
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220103120539.1730644-3-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Several functions are duplicated in different host tools. This patch
starts collecting them in a single C file. We start with read_file()
and read_file_2(), others follow in separate commits.
It would be great to compile these functions in a separate library, but
I don't know how this can be archieved in Kbuild. Instead, the C file
is included where needed. Not nice, not beautiful, but at least enough
to get something going.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We currently build the USB loader tools only for the host (build) system,
but it can be useful to cross compile them as well for the target.
We already have some target tools, but support for those is easier,
because they don't link against libraries. We use pkg-config to get
cc and ld flags, but we always assume that pkg-config is for the host
system and there is no well-defined way to request pkg-config for the
target system.
Support this by introducing a new CROSS_PKG_CONFIG. This will be
consulted only for target tools and default to
$(CROSS_COMPILE)pkgconfig.
Users can override it as necessary, for example, with Yocto, pkg-config
will be for the cross environment, so target tools can now be built
with:
export ARCH=sandbox CROSS_COMPILE=aarch64-linux-gnu-
export CROSS_PKG_CONFIG=pkg-config scripts
make targettools_defconfig
make scripts
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20210917174127.23345-4-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
While soc imx8mm in the imxcfg would work too, it's less surprising to
just tell imx-image about the new SoC.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20211001100949.6891-8-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |/
|
|
|
|
|
|
|
| |
The Nano is basically a downsized mini. Add the necessary bits, so
driver and board support can be added.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20211001100949.6891-2-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
|
|
|
|
|
|
|
|
| |
It's set to 1 if the -b option is used, but is neither initialized nor
set to 0 if not. Since the barebox image building recipies only uses -b
with this tool, it wasn't noticed.
Signed-off-by: Trent Piepho <tpiepho@gmail.com>
Link: https://lore.barebox.org/20210526065856.368345-1-trent.piepho@igorinstitute.com
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
|
|
|
|
|
|
|
|
| |
On hosts with multiple USB devices connected, multiple "excluded by
device path option" messages can be observed. Add the USB VID/PID to
these messages to give them some additional value.
Signed-off-by: Bastian Krause <bst@pengutronix.de>
Link: https://lore.barebox.org/20210430115640.21011-2-bst@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
|
|
|
|
|
|
|
|
| |
If a USB device path is specified, it is expected that other devices will
be ignored. So print that message only on verbose > 0.
Signed-off-by: Bastian Krause <bst@pengutronix.de>
Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20210430115640.21011-1-bst@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows to specifiy additional signed blocks
in the format `offset+size@address` within the imximg.
It is needed by the uuu tool, which loads the image different to
the imx-usb-loader. It loads the DCD always to 0x910000 in the OCRAM.
So this area have to be signed as well.
In my case this needs `hab_blocks 0x42c+0x1f0@0x910000`.
It supports to remove quotes to support Kconfig variable here.
Signed-off-by: Denis Osterland-Heim <denis.osterland@diehl.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixes the following compiler warning:
scripts/imx/imx-image.c: In function ‘main’:
scripts/imx/imx-image.c:988:3: warning: ignoring return value of ‘pwrite’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
988 | pwrite(outfd, bb_header, sizeof_bb_header, 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |/
|
|
|
|
|
|
| |
Two header copies exist in the iMX35 image.
When writing the barebox_header, also write it to the second copy.
Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
|
|
|
|
|
|
|
| |
Convert the files that licensecheck can determine to be licensed under
GPL-2.0-only or GPL-2.0-or-later and also convert the copyright statements
to SPDX.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |\ |
|
| | |
| |
| |
| |
| | |
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| |
| |
| | |
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |\ \ |
|
| | |/
| |
| |
| |
| |
| |
| |
| |
| | |
To simplify automatic license and copyright determination use SPDX tags
and remove the license boiler plate.
Reviewed-by: Roland Hieber <rhi@pengutronix.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |\ \ |
|
| | |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Linux commit faabed295cccc2aba2b67f2e7b309f2892d55004
You can use:
hostprogs-always-y += foo
as a shorthand for:
hostprogs += foo
always-y += foo
Likewise,
userprogs-always-y += foo
as a shorthand for:
userprogs += foo
always-y += foo
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes:
scripts/imx/imx-usb-loader.c:42: warning: "ALIGN" redefined
#define ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1))
In file included from scripts/imx/imx-usb-loader.c:35:
scripts/include/linux/kernel.h:10: note: this is the location of the previous definition
#define ALIGN(x, a) __ALIGN_MASK(x, (typeof(x))(a) - 1)
Fixes: a876d16e6ad3 ("scripts: define ALIGN(x) in scripts' <linux/kernel.h>")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
|
|
|
|
|
|
|
| |
With dcdofs renamed to ivtofs, out-of-tree boards will start to fail.
Make the migration easier by suggesting what needs to be changed on
stderr.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
|
|
| |
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
|
|
|
|
|
|
|
| |
This renames the dcdofs config option in the imx-image tool to ivtofs. dcdofs
is a misnomer. The DCD (Device Configuration Data) is only one part of the data
linked into the IVT (Image Vector Table), but the meaning of the option is
really the latter, not the former.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
|
|
|
|
|
|
|
| |
image_dcd_offset is a misnomer, it should really be image_ivt_offset.
The DCD (Device Configuration Data) is only one part of the data linked
into the IVT (Image Vector Table), but the meaning of the variable is
really the latter, not the former.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|