| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
NVMEM subsystem is now a mandatory dependecy for EEPROM_AT24.
Fixes: 815e7140de ("eeprom: at24: Convert the driver to NVMEM")
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
Ignore the new image files with .pimximg and .psimximg extensions and
the sha256 sum files.
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
The comments mention contents of register r0, this is outdated. We
base our decisions on the current EL. Update the comments.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
| |
We are running at MX8MQ_ATF_BL33_BASE_ADDR now, so we can't use
this as a temporary buffer. Add 32MiB to that address and use this
instead. Also copy the piggydata to the place where we expect it
later.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the TF-A finishes it jumps to a hardcoded address in DRAM. We used
to put a trampoline there which brings us back to our image in SRAM.
Instead of putting a trampoline into DRAM just copy the image there
which simplifies things a bit.
Note that currently imx8_esdhc_load_piggy() uses that very same address
as a temporary buffer. This is changed in the next patch. Currently the
board is broken anyway, so we don't break bisectability.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
|
|
|
|
|
|
|
| |
imx8mq_cpu_lowlevel_init() is called twice. Remove the second call.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
|
|
|
|
|
|
|
|
|
| |
various puthex_ll() printed values without any context are not helpful when
debugging unrelated stuff, so remove them. When they are really needed
they should be added with proper pr_debug() statements.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
|
|
|
|
|
|
|
|
| |
piggy verification is a direct prerequisite of uncompressing the
piggydata, so move the verification there.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
get_runtime_offset shall return the offset between the address we are
running at and the address we are linked at. This value obviously
changes when we relocate the binary. cf3b09737b tried to avoid using
R_AARCH64_RELATIVE relocations, but in fact this is exactly what the
function needs to work. Consider barebox starting at 0x10000000
when we are linked at 0x0 then get_runtime_offset() should return
0x10000000 before relocate_to_current_adr(), but afterwards it should
return 0x0.
This patch brings back the previously removed "a" flag. Since gcc5
doesn't put the values of R_AARCH64_RELATIVE fixup'd relocations
into the binary but zeroes instead, we help ourselves by basing
get_runtime_offset on an address which actually is zero. With
CONFIG_RELOCATABLE=y the binary is always linked to 0x0, so _text
is initially zero.
Tested with gcc-5.4.0 (which was "fixed" by cf3b09737b) and gcc-8.2.1.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
|
|
|
|
|
|
|
|
| |
In case we want to relocate the binary multiple times we have to
adjust the relocation table itself for any further relocations.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
| |
Autoboot is controlled by autoboot_timeout and autoboot_abort_key
variables which might be altered by init scripts, so we need to
register them before those scripts are run. Otherwise they are
set back to defaultenv values upon registration.
Fixes: 35266d7e583f ("startup: Factor out the autoboot counter...")
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
I forgot to increase the version in the Makefile for the last release.
Increase the version now.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Support for the SoC is still in progress, but lets document
what we have now.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Both STM32MP BootROM and TF-A first stage expect subsequent bootloader
stages to feature a specific STM32 file header. Generate this image
type by default.
If for some reason, the image without stm32 header is required, the
start_stm32mp157c_dk2.pblb can be used.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Both STM32MP BootROM and TF-A first stage expect subsequent bootloader
stages to feature a specific 256-byte long STM32 file header.
Add detection of the header to file_detect_type().
While there's only one version of the header so far, identify the new
header as v1 anyway, so new versions can be unambiguously added.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Both STM32MP BootROM and TF-A first stage expect subsequent bootloader
stages to feature a specific STM32 file header. Add a stm32image
utility to address this.
Signed-off-by: Marco Felsch <marco.felsch@gmail.com>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The arch was renamed to stm32mp, so it doesn't look out of place when
the stm32mp2 is released. Fix spotted comments/labels with the old
name. While at it, fix a typo about the SoC name on the DK2 board.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
On the STM32MP, reset of the I2C, SPI and USB IPs occurs over the RCC.
This driver adds support for the controller, so it may be reused by
other drivers.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The pinctrl-stm32 driver uses the alias id to infer the index of the
first GPIO supported by a controller. Because gpioz' identifiers
start at ('Z' - 'A') * 0x10, change the id to 25.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The STM32MP1 GPIO bindings uses the range [400; 415] for the gpioz
controller, which exceeds the barebox-wide ARCH_NR_GPIOS of 256.
Therefore have the stm32mp define a subarch-specific max of 416.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Some architectures have non-contiguous GPIO ranges where some GPIOs can
have identifiers exceeding the hardcoded ARCH_NR_GPIOs of 256.
One such example is the STM32MP, whose gpioz controller has identifiers
that go up to ('Z' - 'A' + 1) * 0x10 - 1 = 415.
Instead of increasing the array size for all architectures or doing
some sort of packing, allow architecture to define their own overriding
CONFIG_ARCH_NR_GPIO like the kernel does.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
According to the binding doc the mxs NAND driver supports the
"nand-ecc-strength" and "nand-ecc-step-size" options. This adds support
for these options to the driver. The "nand-ecc-step-size" is not
really configurable, the only accepted value is 512 so this is merely
to sanity check that there's nothing specified that we can't yet
support.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This adds nand_of_parse_node() which can be used to parse generic
NAND device properties. Not very complete yet, but it's a start.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
mxs_nand_ecc_size_in_bits() is used only once and is simple enough to
be inlined.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
struct mtd_info * contains everything mxs_nand_get_mark_offset() needs,
so pass this pointer rather than several integer arguments.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The imx-bbu-nand-fcb update handler code calls into the NAND driver
to get the ecc strength and bad block marker position. Change the
API so that only a single function is necessary and not three functions.
Also in future the ecc strength will be configurable via device tree.
This means static parameters like page size / oob size are no longer
enough to calculate the ecc strength and so we store a pointer to our
mtd_info struct in a static global variable.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
fake_ecc_layout is only used in the mxs nand driver, so make it static.
Also it's not necessary to zero the structure.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Instead of calculating the ecc strength multiple times with each page
read just do it once and store the result in chip->ecc.strength.
While at it also store the correct value in chip->ecc.bytes instead of
writing a bogus value into it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The struct nand_chip * is sometimes named "nand" and sometimes "chip".
For consistency name it "chip" throughout the driver.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
nor->write() simply adds the number of written bytes to the pointer
given. Thus retval is incremented in each loop cycle for each
spi_nor_write() call without ever resetting it. This leads to wrong page
offset/remains calculations and an incorrect number of bytes written to
retlen.
This becomes apparant only if the calling function actually compares len
and retlen (e.g. mtd_peb_write() ). Otherwise wrong data is written:
$ memcpy -s /dev/prng -d prng_data 0 0 10k
$ erase /dev/mtd0.mypart
$ cp prng_data /dev/mtd0.mypart
$ memcmp -s prng_data -d /dev/mtd0.mypart 0 0
memcmp returned "files differ" before, with this patch it returns "OK".
Fixes: c8516869c4 ("spi: Extend the core to ease integration of SPI memory controllers")
Signed-off-by: Bastian Krause <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The ecc strength/bytes/size values are useful informations sometimes,
add them as device parameters.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
GCC reports following use of an uninitialized variable:
./drivers/mtd/ubi/eba.c: In function 'try_write_vid_and_data':
./drivers/mtd/ubi/eba.c:904:9: warning:
'opnum' may be used uninitialized in this function [-Wmaybe-uninitialized]
err = ubi_wl_put_peb(ubi, vol_id, lnum, opnum, 0);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is incorrect, because it's only called when err == 0 and opnum
is always initialized if err == 0. Silence the warning by initializing
a variable.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Several tests in ubiformat test for a positive error code where a
negative error code is returned from the called functions. This
is because the original code used tested against errno which is a
positive value.
One place still tests against errno, but the test should be against
the return value from the last function call. Fix that aswell.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This is a barebox adoption of mtd-utils commit
d9cbf6a ("ubiformat: handle write errors correctly"):
| ubiformat: handle write errors correctly
|
| This issue was reported and analyzed by
| Anton Olofsson <anol.martinsson@gmail.com>:
|
| when ubiformat encounters a write error while flashing the UBI image (which may
| come from a file of from stdout), it correctly marks the faulty eraseblock as
| bad and skips it. However, it also incorrectly drops the data buffer which was
| supposed to be written, and reads next block of data.
|
| This patch fixes this issue - in case of a write error, we preserve the current
| data and write it to the next eraseblock, instead of dropping it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Both the Kernel and mtd-utils have peb torture functions and both
do not mark the block as bad automatically. Instead, the caller
must mark the block as bad when -EIO is returned from the torture
function. Do the same in barebox. This is necessary as the UBI code
otherwise may mark a block as bad twice: Once indirectly in
mtd_peb_torture() and then directly afterwards.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
70542a9c65 converted UBI to use mtd_peb_torture(). It was assumed that a
block was marked as bad when it didn't pass the torture test. However,
not all possibly bad blocks went through the torture test, so it could
happen that a block that could not be erased was still kept as good
block. This patch fixes this and explicitly calls ubi_io_mark_bad() when
a block cannot be erased.
Fixes: 70542a9c65 ("mtd: ubi: Use mtd_peb_torture")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The UBI ec_hdr has an image_seq field. During attaching UBI expects
that its value is the same for all eraseblocks. The value should be
changed with every ubiformat and is used to detect half written images.
In barebox we use a pseudo random number generated with rand() for this
value. The ubiformat command calls srand(get_time_ns()) to initialize
the pseudo random numbber generator. This is done in the option parser,
so when ubiformat() is called directly (from fastboot for example) the
pseudo random number generator is not initialized and we get the same
values after every barebox restart.
This patch moves the pseudo random number generator initialization
to the place where the numbers are generated. Also use random32()
rather than rand() to generate 32bit values rather than 15bit values
(0 - RAND_MAX).
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Convert AT24 driver to use NVMEM subsystem instead of explicitly
creating a dedicated cdev. This way it becomes possible to access the
contenst of EEPROM via NVMEM API, which could be usefull for things
like MAC-addresses and such.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Instead of exposing a dedictaed .protect() callback, mimic the
behaviour of corresponding driver in Linux and adjust the value of WP
pin in .write() callback as necessary. This is done in order to
convert this driver to NVMEM subsytem.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Add code to parse partition information that might be specified as a
part of the DT config.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
There's already a struct device_d * pointer variable. Use it.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Add struct cdev * helper variable to nvmem_register_cdev() in order to
avoid repeating &nvmem->cdev a bunch of times
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Linux commit a73619a845d5625079cc1b3b820f44c899618388
The __FILE__ macro is used everywhere in the kernel to locate the file
printing the log message, such as WARN_ON(), etc. If the kernel is
built out of tree, this can be a long absolute path, like this:
WARNING: CPU: 1 PID: 1 at /path/to/build/directory/arch/arm64/kernel/foo.c:...
This is because Kbuild runs in the objtree instead of the srctree,
then __FILE__ is expanded to a file path prefixed with $(srctree)/.
Commit 9da0763bdd82 ("kbuild: Use relative path when building in a
subdir of the source tree") improved this to some extent; $(srctree)
becomes ".." if the objtree is a child of the srctree.
For other cases of out-of-tree build, __FILE__ is still the absolute
path. It also means the kernel image depends on where it was built.
A brand-new option from GCC, -fmacro-prefix-map, solves this problem.
If your compiler supports it, __FILE__ is the relative path from the
srctree regardless of O= option. This provides more readable log and
more reproducible builds.
Please note __FILE__ is always an absolute path for external modules.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Linux highly depends on the fact that the 'long' and the pointer
have the same width, and so does barebox.
So, we can always use include/asm-generic/bitsperlong.h, which
determines BITS_PER_LONG depending on CONFIG_64BIT.
This is what Linux does (at least in the kernel-space), and barebox
can follow it.
It is true that MIPS Linux references _MIPS_SZLONG
(arch/mips/include/uaspi/asm/bitsperlong.h), but this is bacause
the user-space cannot reference CONFIG options. For the kernel-space,
it uses the generic definition from include/asm-generic/bitsperlong.h.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Linux highly depends on the fact that the 'long' and the pointer
have the same width, and so does barebox.
So, we can always use include/asm-generic/bitsperlong.h, which
determines BITS_PER_LONG depending on CONFIG_64BIT.
This is what Linux does (at least in the kernel-space), and barebox
can follow it.
Currently, barebox only supports 32-bit riscv, but this should work
when it supports 64-bit by adding CONFIG_64BIT to arch/riscv/Kconfig.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|