summaryrefslogtreecommitdiff
path: root/include/io.h
Commit message (Collapse)AuthorAgeFilesLines
* include: <io.h>: define (read|write)[bwlq]_relaxedAhmad Fatoum2021-06-111-0/+32
| | | | | | | | | | | | | | For Linux, It's always correct to substitute any of the read or write _relaxed functions with their non relaxed counterpart. Define functions that do this. Unlike with Linux, they doesn't per se affect performance: barebox writel doesn't imply memory barriers, instead it depends on the architecture support to map IO memory regions as non-bufferable. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20210611080155.3555976-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: generic: sync with upstream Linux gpio-mmio driverAhmad Fatoum2021-05-101-0/+2
| | | | | | | | | | | | | | | | | | | | The gpio-mmio driver in Linux v5.12 has evolved quite a bit since the last sync. It now supports big endian byte order, 64-bit registers as well as controllers that have both a dirin and dirout register. The latter is particularly interesting, because it's required for the SiFive GPIO controller ported in a later patch. This commit also touches gpio-mpc8xxx used on the LS1046A. Because bit and byte endianness can now be configured separately, the driver needs adjustment. We don't seem to support any boards that have the peripheral as little-endian, but this is fixed by this commit. Comparing other bgpio_init users with Linux shows no need for further fixups. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210427202309.32077-9-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* include: add SPDX GPL-2.0-only license tags for files without licensing ↵Roland Hieber2020-02-171-0/+1
| | | | | | | | | | | information According to our /README, GPL-2.0-only applies for the whole project except noted otherwise. Signed-off-by: Roland Hieber <rohieb@rohieb.name> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Abolish cpu_read* and cpu_write* accessorsMasahiro Yamada2015-05-201-8/+0
| | | | | | | | | | | | | | Commit 2e6a88f2101d (add cpu native ordered io accessors) introduced these macros and then commit be57f20cdd7d (Fix big endian MMIO primitives) figured out they are equivalent to __raw_{read,write}*. They turned out unnecessary after all. Anyway, most source files use __raw_read* and __raw_write*. Let's replace a few remaining references and abolish them. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Fix big endian MMIO primitives.Krzysztof Halasa2012-05-071-15/+6
| | | | | | | | | | | cpu_read*() and cpu_wrire*() are precisely equal to __raw_read*() and __raw_write*(). Striving for correctness we can replace all those __raw_*() with cpu_*() as that's exactly what the former ones do. Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add cpu native ordered io accessorsSascha Hauer2011-09-231-0/+17
| | | | | | | | | | | | | There are no generic native ordered io accessors. This sometimes leads to v = in_be32(a); v = readl(a); in generic drivers. Instead, use io accessors which are explicitely native ordered. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* introduce io.hSascha Hauer2011-09-221-0/+6
To allow for some generic io accessors introduce io.h and use this instead of asm/io.h throughout the tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>