| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
The Linux driver for the STM32 ADC has only minor differences to the
STM32MP15 driver. Add these changes to barebox, even if untested.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20231127064947.2207726-12-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This driver works with the ADC on i.MX6SLX, i.MX6UL and i.MX6ULL.
Port the Linux v6.4 driver of the peripheral to make them usable in
barebox.
Signed-off-by: Christian Eggers <ceggers@arri.de>
Link: https://lore.barebox.org/20230825100031.11647-1-ceggers@arri.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fsl,tempmon-data is a deprecated property that has been replaced
upstream by a NVMEM cell pointing at the calibration value and so
made it into barebox breaking the driver.
Switch to using the new property to fix the regression.
We do not keep support for the old binding around as it would be dead code:
barebox, unlike Linux, is always bundled with a device tree originating
from its build tree and so we only need to ensure the driver matches that
version.
Fixes: abef60363d8e ("dts: update to v5.8-rc1")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.barebox.org/20230911124808.2748160-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Syncing device trees with Linux upstream can lead to breakage, when
the device trees are switched to newer bindings, which are not yet
supported in barebox. To make it easier to spot such issues, we want to
start applying some heuristics to flag possibly problematic DT changes.
One step towards being able to do that is to know what nodes barebox
actually consumes. Most of the nodes have a compatible entry, which is
matched by an array of of_device_id, so let's have MODULE_DEVICE_TABLE
point at it for future extraction.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20230612125908.1087340-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
| |
Found by manual inspection of the results of:
rg '#include\s*<mach/[^/]+>' | rg -v 'arch/(powerpc|sandbox|mips|x86|kvx)'
Fixes: 68b778c24314 ("ARM: Drop mach dir include path")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20230411071436.1630752-13-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
| |
The '_d' suffix was originally meant to distinguish barebox struct
names from Linux struct names. struct driver doesn't exist in Linux,
so we can rename it and remove the meaningless suffix.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.barebox.org/20221214123512.189688-4-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The '_d' suffix was originally introduced in case we want to import
Linux struct device as a separate struct into barebox. Over time it
became clear that this won't happen, instead barebox struct device_d
is basically the same as Linux struct device. Rename the struct name
accordingly to make porting Linux code easier.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.barebox.org/20221214123512.189688-3-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Linux struct device has the member of_node for the device_node pointer.
Rename this in barebox accordingly to minimize the necessary changes
when porting Linux code. This was done with the semantic patch:
@@ struct device_d E; @@
- E.device_node
+ E.of_node
@@ struct device_d *E; @@
- E->device_node
+ E->of_node
Plus some manual adjustments.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.barebox.org/20221214123512.189688-2-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
| |
The i.MX7 has two ADCs of 4 logical channels each. Port the Linux v6.0
driver of the peripheral to make them usable in barebox. This can be useful
for board type/revision detection that employs voltage dividers.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20221024095612.1537704-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
| |
The L3GD0 is an on-board peripheral of the STM32F429-DISCOVERY and as
such a good target to test out SPI driver support. Add a simple aiodev
driver to interface with it. It can read the chip's angular rate in
three dimensions as well as the temperature sensor embedded in it.
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Link: https://lore.barebox.org/20220708055526.1177941-1-ahmad@a3f.at
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
of_find_node_by_name() has the same name as the corresponding kernel
function but a different semantics. A node name is comprised of the
nodes name and a unit address, separated with '@'. Linux
of_find_node_by_name() matches only the name before the '@' whereas the
barebox function compares the full name.
As several callers depend on the barebox semantics we can't just change
the semantics, so rename the barebox function to
of_find_node_by_name_address().
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
| |
Most peripheral driver are usable for both STM32 MPUs and MCUs, but so
far we they were only used for STM32MP1. In preparation for adding
MCU support, introduce a new ARCH_STM32 selected by ARCH_STM32MP and
migrate common drivers to it.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220131075725.1873026-12-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
| |
"GPL-2.0-only" was introduced in SPDX 2.0, and the old identifier
"GPL-2.0" is now considered deprecated; see <https://spdx.org/licenses>.
Fixes: 28f4a6a4df76f0f1581d (2021-10-30, "drivers: add missing SPDX-License-Identifier")
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
Link: https://lore.barebox.org/20211117113851.2022669-2-rhi@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This adds the suitable SPDX-License-Identifier to all files in drivers/
that previously lacked one.
To aid manual inspection, following heuristics can be used:
* No changes outside of comments/whitespace:
git show -U0 HEAD | rg -v '^(@@|diff|index)|[-+]([-+]|//|#|[\s/]\*)'
* -or-later come in pairs:
git show --inter-hunk-context=19 HEAD | \
perl -0777 -F'/^@/gm' -ne 'for (@F) { @m = /later/g; print if @m & 1 }'
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20211030175632.2276077-4-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
| |
Build with module support enabled rightfully complains about the
unknown symbol.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20211030175812.2276705-5-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
| |
This commit adds support for the Successive Approximation Register (SAR)
ADCs that can be found in Rockchip SoCs, such as the RK3568.
Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
Link: https://lore.barebox.org/20210624160915.21897-2-michael.riesch@wolfvision.net
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
| |
lm75 type unknown is not handled in the switch/case handling all types.
Handle it to avoid compiler warnings.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.barebox.org/20210517185424.32145-14-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This driver supports simple one-shot readings rather than continuous
sampling with DMA, etc. ADC channels should be configured via
device tree, using the kernel bindings.
Code is based on the stm32-adc drivers of Linux v5.11-rc1 and
U-Boot v2021.01-rc4.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is a simple driver for the ADC. It's designed to get single
readings. Possible uses would be temperature sensing a thermistor,
measuring a power rail, or a detecting multi-level board ID pin
strapping.
It's not designed to co-exist with a touch screen controller driver,
which uses the same hardware on the AM335x, as there is no barebox
touchscreen driver.
The device tree binding is compatible with the Linux IIO driver.
This is from the Linux driver:
The ADC clock is expected to run at target of 3MHz, and expected to
capture 12-bit data at a rate of 200 KSPS. The TSC_ADC_SS
controller design assumes the OCP clock is at least 6x faster than
the ADC clock.
The OCP clock is 100 MHz, from CORE_CLKOUTM4/2. The AM335x Reference
Manual §12.2.2 gives a max ADC clock of 24 MHz. There's nothing about
the factor of 6x OCP to ADC, a 3 MHz ADC target, nor 200 kSPS. In
§12.3.7 a limit of at least 15 ADC clock cycles per sample is given.
The AM335x Datasheet §5.10 provides more parameters for the ADC: An ADC
clock max of 3 MHz, a nominal conversion time of 13 cycles, min and max
acquisition time of 2 to 257 cycles, and a max sample rate (@ 3 MHz) of
200 kSPS.
A 3 MHz ADC clock at 15 cycles per sample provides for a 200 kSPS
sampling rate. The minimum open, sampling, and conversion times are 0,
1, and 13 clocks, respectively. This would seem to indicate the
sampling at 14 cyles per sample is possible. Perhaps the "Sample Delay"
in the reference manual is called "Acquisition Time" in the datasheet,
and the reference manual minimum of 1 cycle is incorrect and the minimum
is actually 2 cycles. Which would then produce a minimum of 15 cycles
per sample.
This driver assumes the external references will be used (as does the
Linux IIO driver). This would have been good to put into the device
tree bindings, but the Linux driver's bindings did not do that.
The Barebox driver will convert the ADC reading to mV, and assumes the
external refs are GND and 1.8V. This also would have been nice to put
into the device tree binding. It also doesn't allow for automatically
adjusting for an external divider, commonly to measure power rails above
1.8V, e.g. the BeagleBone Black ain7 measures the 3.3V rail divided by
2.
Signed-off-by: Trent Piepho <trent.piepho@synapse.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When dynamically assigning device names, an aiodev's name will be
"aiodev" and an index, not part of the name string itself, will be
allocated dynamically. These are combined to register a device with a
name like "aiodev0" or "aiodev1".
The shell environment variables use the device name, so one might use
"${aiodev0.in_value0_mV}" and "${aiodev1.in_value0_mV}".
However, the channel names that are used with aiochannel_get_by_name()
just use the aiodev's name and channel name. So channel 0 of the 1st
aiodev would be "aiodev.in_value0_mV" and the 2nd aiodev would use the
same name.
Change the channel naming to use the device instance name, e.g.
"aiodev0", rather than the aiodev's base name. This makes the names
used aiochannel_get_by_name() match the environment variable names and
also avoids duplicate names with more than one dynamically allocated
aiodev.
Rename aiochannel_get_by_name() to aiochannel_by_name() so that any out
of tree boards that use it will fail to compile, since they now need to
pass in a different name.
Signed-off-by: Trent Piepho <trent.piepho@synapse.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
| |
Probing the lm75 device driver on 64 bit systems invokes
undefined behavior, because of an errant cast. Fix this.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adapts all files that were identifed by licensecheck
(https://salsa.debian.org/build-common-team/licensecheck.git) as
licensed under the GPL and that have a (IMHO) clear copyright statement.
The advantage is that these specifiers are machine-parseable which helps
license conformance, e.g. for packaging barebox in Debian.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
The CREDITS file was removed from barebox in 2015 by commit 6570288f2d97
("Remove the CREDITS file"). Remove references to it from several files.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
| |
All of these drivers have a runtime dependency on SoC peripherals, but
can nevertheless be compile-tested. Add COMPILE_TEST as an alternate
dependency.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
Mark mc13xxx_adc_do_conversion() static because it is not used outside
the source file.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Introduce dev_set_name() in order to hide implementation details of
setting device's name so it'd be easier to change it.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| | |
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| | |
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Don't try to use DT node name as aiodev->name in aiodev_regster()
since, for some devices (e. g. tempmon) than name would already be
taken by parent platform device.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
| |
Add macro and dependency to avoid boilerplate code. Since now simple
i2c drivers only have to include the i2c.h header and call the
device_i2c_driver() macro to register a i2c device driver.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
This patch is a minimal port of the corresponding driver that can be
found in Linux kernel (drivers/thermal/qoriq_thermal.c).
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
The temperature sensor driver for Freescale i.MX SoCs use internaly the OCOTP character device. If the config IMX_THERMAL is selected the OCOTP config was not selected and comes up with an error during booting.
Signed-off-by: Eugen Wiens <eugen.wiens@jumo.net>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
| |
Replace whitespaces with tabs.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
| |
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
| |
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
This driver uses private includes from the imx6 architecture.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
This file doesn't hold any content any more, so there is no
need to include it.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
| |
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
Port TEMPMON driver from U-Boot
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
AIODEV/Aiodevice is a analog I/O framework that can be thought of as a
simplified hybrid between 'hwmon' and 'IIO' subsystems of Linux kernel
This commit is very heavily based on 'iodevice' framework proposal
written by Sascha Hauer.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|