| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
Linux v5.6-rc1 contains 168 references to regultor_bulk_get, which
allows getting multiple regulators to set at once. Instead of open
coding them when porting code, port over the helpers to barebox.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The watchdog driver will remain unprobed if the driver or the OF node
is disabled, but the reset reason is useful even then.
System reset and reset source determination is achieved with the RCC
peripheral for which we have a reset controller driver.
Move the code over there, so reset reason and reset are available
always.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
| |
Whether reset_source_name() returns the just set reset_source is
dependent on probe order and the priorities of prior reset sources
in relation to the current one. Make this more robust by using the new
reset_source_to_string.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
| |
On most resets, a "reset reason: unknown" would clutter the console,
because the watchdog doesn't support differentiating between POR and
RST. Reduce the clutter by only printing the message when we have
something interesting to say (i.e. watchdog reset).
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The upstream device tree no longer lists "syscfg-clk" and the syscon node
contains a clocks property that the barebox syscon driver now
automatically clocks before access.
Thus drop the requirement that "syscfg-clk" is specified.
Fixes: 4aaceef58 ("dts: update to v5.6-rc1")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
| |
Linux supports a clocks property in syscon nodes to indicate that access
should only occur with the clock active.
Attach the clock to the regmap if found.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
| |
Linux supports a clocks property in syscon nodes to indicate that access
should only occur with the clock active. The new regmap-mmio supports
this, thus port syscon over, so it can make use of it in a later commit.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
regmap-mmio is used in Linux for clocked memory mapped I/O regions.
Port it over, so we can more easily port drivers using it.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
Follow up commit will add a new user for "internal.h".
Prepare the header for this.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
C99 specifies the 't' length modifier type for pointer difference.
barebox vsnprintf supports it, thus use it.
We are guaranteed sizeof(long) == sizeof(void *) in barebox, so this
doesn't make a difference in practice except that it silences
following GCC warning:
./drivers/gpio/gpiolib.c: In function 'gpioinfo_request':
./include/printk.h:77:43: warning: format '%ld' expects argument of
type 'long int', but argument 3 has type 'int' [-Wformat=]
...
./barebox-stm32/drivers/gpio/gpiolib.c:89:3: note: in expansion of macro 'pr_err'
89 | pr_err("_gpio_request: gpio-%ld (%s) status %d\n",
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
| |
mx1_clocks_init() is only used in one file, make it static.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
active-low is an optional property to describe PWMs where the LED is wired
to supply rather than ground. Add barebox support for it.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If we leave max_value at the default value of zero led_pwm_set above
will divide by zero in do_div. The binding makes max-brightness
a mandatory property, so have the driver treat it as such as well.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
of_pwm_request returns either the valid or an error pointer.
Revise the error check to reflect this.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
pwm_backlight->period is assigned pwm_get_period(pwm), which is the same
value just a few lines earlier. Remove the superfluous reassignment.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Even when the processor runs in big-endian mode, the peripheral is
little-endian and is used as such in Linux. Do here likewise.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| | |
Both duty_ns and period_ns are stored to, but never read. Drop them.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
After adding the parameter, the pointer isn't required anymore.
Signed-off-by: Christian Eggers <ceggers@arri.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
So far we passed an uninitialized timing member in the ios to the
->set_ios of the host controller drivers.
To allow extension for new modes that need MCI host support beyond
the usual clock rate change, make the member useful:
- populate is with the correct value
- add some type safety by using an enum
- print it in the devinfo output
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The SDMMC2 doesn't need any special setup for High-Speed modes, except
for the clock changes. Thus set the cap flags if the max clock would
allow for the higher speed mode.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ \ \ |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
reset_control_get returns NULL when the controller reset is missing.
The error pointer is used for malformed reset controller specification.
Correct the message accordingly.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The wd command already warns that "Watchdog cannot be disabled",
when the stop operation returns -ENOSYS. We do that now, so telling the
user that it will not stop is superfluous. Remove it.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The driver has an error message on probe and one on each watchdog stop
attempt that warns the user if the reset line is missing.
Missing reset line (because the "reset"-property is missing) is
indicated by a NULL pointer though, so these warnings were only
triggered when the reset controller specification is malformed.
Fix this by propagating malformed reset pointer specification and
continuing only if it's either valid or completely missing.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
In cases where the reset controller specification in the device tree is
malformed, we get an error pointer back from reset_control_get. This
compares unequal to NULL and would cause an access violation when passed
to reset_control_(de)?assert.
Fix this by propagating the error. When the reset controller is missing,
reset_control_(de)?assert will be passed NULL pointers, rendering them
no-ops.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
reset_control_get returns a NULL pointer when no resets were specified
via device tree properties. If there's a malformed "resets"-property, we
get an error pointer. This error should be propagated, only the NULL
returns are the ones we can safely ignore.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Apparently, somewhere between v2017.01.0 and v2020.01.0, barebox became
dependent on drivers having a name as having this driver enabled in
v2020.01.0 has barebox crash due to a null pointer dereference in the
device_match's second strcmp.
A previous commit introduced a palatable warning for this case.
Now in order to be able to use the driver again, give it a name.
Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Currently, we expect each driver to have a name. If a driver doesn't,
we run into a NULL pointer dereference. Make this error scenario more
pleasant by checking if a name is set and failing otherwise.
The only in-tree driver affected by this is drivers/watchdog/dw_wdt.c,
which will be fixed in the follow-up commit.
Affected drivers can be determined with following pipeline, which should
return all driver_d structure instantiations that don't contain a name:
ack --A 4 'struct driver_d.*' | perl -pe 's/^--$/\n/' | \
perl -000 -ne 'print if /=.*\{.*\}/s && !/name/s'
With this change, these drivers should now give a more pleasant message:
ERROR: initcall dw_wdt_driver_register+0x1/0xc failed: Invalid argument
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The driver matches against both "arm,armv7-timer" and "arm,armv8-timer"
compatibles, thus rename it to better reflect that it's not only ARMv8
specific.
Only functional change intended is name changes. The symbol is default
y, so the rename shouldn't cause it to get lost with olddefconfig.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
There are regulators which are turned on by default (hw-design) and
shouldn't be disabled during the boot. Upstream uses the
regulator-boot-on dt-property for it:
8<--------------------------------------------------
regulator-boot-on:
description: bootloader/firmware enabled regulator
type: boolean
8<--------------------------------------------------
The difference between boot-on and always-on is the linux suspend
handling. Regulators marked as boot-on can be disabled during suspend.
This case isn't interesting for barebox so we can mark those as
always-on too.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
gpioinfo_*() assume their gpio_info pointer parameter to be valid and
don't ensure the gpio to be requested.
This drops several checks for being requested and allows further
extensions to work with unrequested gpios.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
gpio_request_one() and gpio_request_array() make use of
gpio_direction_*, so it is natural to define the former them further low
in the file. It doesn't matter for the compiler here as all functions
are declared in a header, but the next commit adds a few more functions
and it benefits from this reordering by not needing forward
declarations.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
bootm_data::os_file is not required to be a copied string. It isn't
freed anywhere.
Signed-off-by: Christian Eggers <ceggers@arri.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
For FRAM devices the page size is usually equal to the device size. Some
available devices are greater than 64kB, so a 32 bit variable must be
used.
The same change has to be done for the Linux driver. I'll try to
upstream this as soon as possible.
Signed-off-by: Christian Eggers <ceggers@arri.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
In case of an error (e.g. dev_add_param_tristate_ro() returns -ENOSYS),
device registration must be reverted.
Signed-off-by: Christian Eggers <ceggers@arri.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Implement linux behavior regarding "pinctrl-single,function-mask" and
"pinctrl-single,bits".
It allows multiple pins control per register.
(linux sha1: 4e7e8017a80e1810100c9b416b86e3baef900285)
Signed-off-by: Simeon Marijon <simeon@marijon.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ \ \ |
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Normally every device gets its own stream_id. The stream_ids are
communicated to the kernel in the device tree and are also configured
in the controllers LUT table.
This only works when all PCI devices are known in the bootloader
which may not always be the case. For example, when a PCI device
is a FPGA and its firmware is only loaded under Linux, then the
device is not known to barebox and thus not assigned a stream_id.
With global.layerscape_pcie.share_stream_ids set to true all devices
on a host controller get the same stream_id assigned. This setup is
completely device agnostic and thus also works when not all devices
are known to barebox.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ \ \ |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
When we create a new BBT we write it to the flash, but the currently
running barebox doesn't use it yet, only after a reboot the BBT is
actually used. Call nand_default_bbt() to make sure the current barebox
also used the newly created BBT.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Due to the differences of the logical page format and the raw page
format on NAND the generic nand support can't read the bad block
marker on the NAND. For this reason we have the imx_nand_bbm command
which knows about these specialities and creates a BBT. The problem
with this command is that one has to call it and experience shows
this is often forgotten. Linux will then create a BBT based on wrong
informations and the real bad blocks may be lost.
With this patch we automatically create a BBT when none is found and
make the command unnecssary.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Due to the differences of the logical page format and the raw page
format on NAND the generic nand support can't read the bad block marker
on the NAND. For this reason we cleared the NAND_BBT_CREATE flag and
have the imx_nand_bbm command to create a BBT if none is found in the
flash. We have also cleared the NAND_BBT_WRITE flag which causes
problems. Normally a BBT occupies two blocks in NAND, but to have some
space for the BBT when one of these becomes bad we normally reserve 4
blocks for the BBT. In case we want to write the BBT to flash we have to
reserve them from being written to by general NAND operations. In case
we don't ever write to the BBT, as indicated by a cleared NAND_BBT_WRITE
flag, the reserved blocks can be used by the general NAND operations.
This way it happens that barebox uses the reserved blocks for data
storage, but Linux (which has NAND_BBT_WRITE set) can't read any data
from it. This results in corrupted UBI images.
It's not necessary to clear the NAND_BBT_WRITE flag, all we really have
to do is to prevent the BBT layer from creating a new BBT. For this it's
enough to clear the NAND_BBT_CREATE flag.
Fixes: 545453ddae ("mtd: nand: Add command to generate a flash BBT")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ \ \ \ |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
fsl_build_dtd() returns the length of the dTD, but it is never used.
Remove the length argument from the function.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The timeout when waiting for a command to complete is expected in
some cases, so do not bark loudly. This used to be dev_dbg() earlier
already.
Fixes: 4a7d7b16e2 ("mci: imx-esdhc: Share code for esdhc_send_cmd()")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Currently the pfuze driver is build dependent to ARCH_IMX6. To make it
possible to work with ARCH_IMX8 we move the imx6_poweroff call to an own
poweroff handler.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|