Commit Graph

368 Commits

Author SHA1 Message Date
Emmanuel Vadot
00e84f52f0 arm: Rename hdmi_if.m to crtc_if.m
There is nothing hdmi related in this interface, it's just a generic interface
for crt controller so rename it.
This also remove the 'hdmi' device used in arm kernel config. 'vt' now controls
if we build this interface (sc(4) isn't supported on arm).

Sponsored by:	Beckhoff Automation GmbH & Co. KG
Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D39120
2023-03-17 13:34:57 +01:00
Emmanuel Vadot
8574d32f22 arm: imx: Rename video related devices
device 'hdmi' is too generic (and will be used later in a new device) so rename
the arm IMX devices to some proper name.

Sponsored by:	Beckhoff Automation GmbH & Co. KG
Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D39118
2023-03-17 13:34:46 +01:00
John Baldwin
f49fd63a6a kmem_malloc/free: Use void * instead of vm_offset_t for kernel pointers.
Reviewed by:	kib, markj
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D36549
2022-09-22 15:09:19 -07:00
John Baldwin
7ae99f80b6 pmap_unmapdev/bios: Accept a pointer instead of a vm_offset_t.
This matches the return type of pmap_mapdev/bios.

Reviewed by:	kib, markj
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D36548
2022-09-22 15:08:52 -07:00
John Baldwin
ea8f128c7c pmap_mapdev: Consistently use vm_paddr_t for the first argument.
The devmap variants used vm_offset_t for some reason, and a few places
explicitly cast bus addresses to vm_offset_t.  (Probably those casts
along with similar casts for vm_size_t should just be removed and
instead permit the compiler to DTRT.)

Reviewed by:	markj
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D35961
2022-07-28 15:55:10 -07:00
Gordon Bergling
f1334ab76b freescale: Fix a typo in a source code comment
- s/transistions/transitions/

MFC after:	3 days
2022-07-03 13:55:40 +02:00
John Baldwin
ea538dab84 arm/arm64 freescale: Remove unused devclass arguments to DRIVER_MODULE. 2022-05-09 14:26:44 -07:00
John Baldwin
5f31d14a92 Remove unused spibus_devclass and ofw_spibus_devclass. 2022-05-09 12:22:00 -07:00
John Baldwin
2287364e04 Remove pcm_devclass from DRIVER_MODULE invocations. 2022-05-06 15:46:56 -07:00
John Baldwin
85447c525b Remove unused ofw_iicbus_devclass. 2022-05-06 15:39:30 -07:00
John Baldwin
676ea8e177 Remove unused iicbus_devclass. 2022-05-06 15:39:30 -07:00
John Baldwin
23802d41fa Remove unused ahci_devclass. 2022-05-06 15:39:28 -07:00
John Baldwin
43629a8b18 arm freescale: Remove unused variables. 2022-04-13 16:08:22 -07:00
John Baldwin
09f2892eee arm vybrid: #if 0 variables only used under #if 0. 2022-04-13 16:08:22 -07:00
John Baldwin
69c595ed7f arm: Use __diagused for variables only used in KASSERT(). 2022-04-13 16:08:22 -07:00
John Baldwin
1624badace imx6_ssi: Remove unused variables, #if 0 variables only used under #if 0. 2022-04-08 18:31:29 -07:00
Emmanuel Vadot
4bcdfeb06f vf_i2c: Make ext_resources non-optional
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33832
2022-02-21 17:29:02 +01:00
Emmanuel Vadot
90a5fc326e imx_gpio: Make ext_resources non-optional
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33831
2022-02-21 17:29:00 +01:00
Emmanuel Vadot
774a4b6a51 imx_i2c: Make ext_resources non-optional
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33830
2022-02-21 17:28:58 +01:00
Mateusz Guzik
793c74e415 arm/freescale: remove FBIOSCURSOR
Unbreaks building EFIKA_MX

Fixes:	b9d3b253e2 ("fb: Remove unused cursors ioctls")
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-12-09 17:00:43 +00:00
Leandro Lupori
b9f3b63ab2 vt: export RGB offsets with FBIO_GETRGBOFFS
Add a new ioctl to vt to make it possible to export RGB offsets
set by vt drivers. This is needed to fix colors on X and Mesa
on some machines, especially on modern PowerPC64 BE ones.

With the appropriate changes in SCFB, to use this ioctl to find
out the correct RGB offsets, this fixes wrong colors on Talos II
and Blackbird, when used with their built-in video cards.

Reviewed by:		alfredo
Sponsored by:		Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D29000
2021-11-25 16:39:25 -03:00
Elyes HAOUAS
9097ac9af4 Fix typo on "Celsius"
"Celcius" --> "Celsius"

Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Pull Request: https://github.com/freebsd/freebsd-src/pull/551/files
2021-11-18 23:05:32 -07:00
Ed Maste
9feff969a0 Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights
These ones were unambiguous cases where the Foundation was the only
listed copyright holder (in the associated license block).

Sponsored by:	The FreeBSD Foundation
2021-08-08 10:42:24 -04:00
Warner Losh
ddfc9c4c59 newbus: Move from bus_child_{pnpinfo,location}_src to bus_child_{pnpinfo,location} with sbuf
Now that the upper layers all go through a layer to tie into these
information functions that translates an sbuf into char * and len. The
current interface suffers issues of what to do in cases of truncation,
etc. Instead, migrate all these functions to using struct sbuf and these
issues go away. The caller is also in charge of any memory allocation
and/or expansion that's needed during this process.

Create a bus_generic_child_{pnpinfo,location} and make it default. It
just returns success. This is for those busses that have no information
for these items. Migrate the now-empty routines to using this as
appropriate.

Document these new interfaces with man pages, and oversight from before.

Reviewed by:		jhb, bcr
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D29937
2021-06-22 20:52:06 -06:00
Emmanuel Vadot
0c80ad2dc6 arm: Add no-cftconvert for sdma-imx6 files
Fixes a warning when building kernel:
ctfconvert: file.c: Couldn't read ehdr: Invalid argument

MFC after:	3 days
2021-04-14 15:43:37 +02:00
Michal Meloun
6844eecfed Add basic support for Freescale LX2160A SoC.
All peripherals but the network processor are supported.
2020-12-05 12:08:37 +00:00
Michal Meloun
5c2967f66f Remove the pre-ARMv6 and pre-INTRNG code.
ARM has required ARMV6+ and INTRNg for some time now, so remove
always false #ifdefs and unconditionally do always true #ifdefs.
2020-11-29 08:40:12 +00:00
Ian Lepore
a7623790fb Add the firmware blob required to use the sdma hardware in the imx6
processor, and its associated license text (which is similar to a
bsd-3-clause, but with a prohibition against decompiling).  Install a copy
of the license in /usr/share/doc/legal/imx, to comply with the license terms
that requires a copy of the license to be delivered along with the firmware.

Obtained from:	https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/imx/sdma/sdma-imx6q.bin https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/LICENSE.sdma_firmware
2020-11-26 01:40:04 +00:00
Ian Lepore
2814e68675 Extend the imx6 gpc->gic interrupt controller fixup of fdt data at runtime
to work with the pmu and tempmon nodes as well as the soc node.  This allows
interrupts to work on the pmu and tempmon devices even though we don't have
a driver for the low-power gpc interrupt controller (which is not a problem
because we also don't have support for entering deep power-down modes where
it gets used).
2020-11-25 20:05:05 +00:00
Ian Lepore
0ffeeb414f Convert the imx6_snvs RTC driver to access registers via the syscon device.
This is required for it to work correctly in the GENERIC kernel.
2020-11-25 19:10:20 +00:00
Ian Lepore
4b7ae525a8 A couple small fixes for the imx6_sdma driver...
Attach after interrupt controllers, since the attach function tries to
set up an interrupt handler.

Check for the availability of the required firmware early in the attach
code (before allocating resources).  If the firmware is not available, set
a static var to remember that, so that if the device is re-probed on later
passes it won't repeatedly try to attach and then complain again about
missing firmware.
2020-11-25 18:09:01 +00:00
Mateusz Guzik
654548838b arm: clean up empty lines in .c and .h files 2020-09-01 21:17:24 +00:00
Oleksandr Tymoshenko
94bc2117b4 Add i.MX 8M Quad support
- Add CCM driver and clocks implementations for i.MX 8M
- Add GPC driver for iMX8
- Add clock tree for i.MX 8M Quad
- Add clocks support and new compat strings (where required) for existing i.MX 6 UART, I2C, and GPIO drivers
- Enable aarch64-compatible drivers form i.MX 6 in arm64 GENERIC kernel config
- Add dtb/imx8 kernel module with DTBs for Nitrogen8M and iMX8MQ EVK

With this patch both Nitrogen8M and iMX8MQ EVK boot with NFS root up to multiuser login prompt

Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D25274
2020-07-01 00:33:16 +00:00
Oleksandr Tymoshenko
da21a623dd Add mode selection to iMX6 IPU driver
- Configure ipu1_di0 tob e sourced from the VIDEO_PLL(PLL5) and hardcode
  frequency to (455000000/3)Mhz. This value, further divided, can yield
  frequencies close enough to support 1080p, 720p, 1024x768, and 640x480
  modes. This is not ideal but it's an improvement comparing to the only
  hardcoded 1024x768 mode.

- Fix memory leaks if attach method failed
- Print EDID when -v passed to the kernel
2020-06-10 22:00:31 +00:00
Andreas Tobler
c76b8bda0b Fix boot of wandquad after DTS update
In the recent dts sync the name of the aips-bus@ changed to bus@. Reflect
this change and add an additional OF_finddevice in fix_fdt_interrupt_data()
and in fix_fdt_iomuxc_data() with bus@ only. Iow, keep the old naming for
compatibility.

Discussed with:	ian@
2020-06-09 20:27:35 +00:00
Marcin Wojtas
1e6005d807 Introduce VF610 I2C controller support.
NXP LS1046A contains I2C controller compatible with Vybrid VF610.
Existing Vybrid MVF600 driver can be used to support it. For that purpose
declare driver as ofw_iicbus and add methods associated with ofw_iicbus.

For VF610 add dynamic clock prescaler calculation using clock information
from clock driver and clock frequency requested in device tree.

On the occasion add detach function and add additional error handling
in i2c_attach function.

Submitted by: Dawid Gorecki <dgr@semihalf.com>
Reviewed by: manu
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential Revision: https://reviews.freebsd.org/D24361
2020-05-25 15:21:38 +00:00
Pawel Biernacki
7029da5c36 Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)
r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked).
Use it in preparation for a general review of all nodes.

This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Mark all obvious cases as MPSAFE.  All entries that haven't been marked
as MPSAFE before are by default marked as NEEDGIANT

Approved by:	kib (mentor, blanket)
Commented by:	kib, gallatin, melifaro
Differential Revision:	https://reviews.freebsd.org/D23718
2020-02-26 14:26:36 +00:00
Kyle Evans
db41cd0e06 Kill off dummy kbd drivers
As far as I can tell, these are an artifact of times when linker sets
couldn't be empty, otherwise the kernel build would fail due to unresolved
symbols. hselasky fixed this in r268138, and I've audited the kbd portions
to make sure nothing would blow up due to the empty linker set and
successfully compiled+ran a kernel with no keyboard support at all.

Kill them off now since they're no longer required.

MFC after:	1 week
2019-12-20 16:22:14 +00:00
Ian Lepore
a856c60bdd Remove unnecessary MODULE_DEPEND() from imx_i2c.c, and also from rk_i2c
where it got copied to.
2019-12-17 17:03:03 +00:00
Warner Losh
b832a7e505 Create new wrapper function: bus_delayed_attach_children()
Delay the attachment of children, when requested, until after interrutps are
running. This is often needed to allow children to run transactions on i2c or
spi busses. It's a common enough idiom that it will be useful to have its own
wrapper.

Reviewed by: ian
Differential Revision: https://reviews.freebsd.org/D21465
2019-12-13 19:39:33 +00:00
Ian Lepore
ef4a351452 Implement the ofw_bus_get_node method in the imx_gpio driver so that
ofw_gpiobus can find its fdt metadata and instantiate child devices.
2019-11-28 21:50:34 +00:00
Ian Lepore
7887a5a140 Apply a runtime patch to the FDT data for imx6 to fix iomuxc problems.
The latest imported FDT data defines a node for an iomuxc-gpr device,
which we don't support (or need, right now) in addition to the usual
iomuxc device.  Unfortunately, the dts improperly assigns overlapping
ranges of mmio space to both devices.  The -gpr device is also a syscon
and simple_mfd device.

At runtime the simple_mfd driver attaches for the iomuxc-gpr node, then
when the real iomuxc driver comes along later, it fails to attach because
it tries to allocate its register space, and it's already partially in
use by the bogus instance of simple_mfd.

This change works around the problem by simply disabling the node for
the iomuxc-gpr device, since we don't need it for anything.
2019-09-15 19:38:15 +00:00
Warner Losh
f5a95d9a07 Remove NAND and NANDFS support
NANDFS has been broken for years. Remove it. The NAND drivers that
remain are for ancient parts that are no longer relevant. They are
polled, have terrible performance and just for ancient arm
hardware. NAND parts have evolved significantly from this early work
and little to none of it would be relevant should someone need to
update to support raw nand. This code has been off by default for
years and has violated the vnode protocol leading to panics since it
was committed.

Numerous posts to arch@ and other locations have found no actual users
for this software.

Relnotes:	Yes
No Objection From: arch@
Differential Revision: https://reviews.freebsd.org/D20745
2019-06-25 04:50:09 +00:00
Ian Lepore
ecb53c096d Release the bus-recovery gpio pins in detach(), so that unload then
reload of the module works without "pin already allocated" errors.
2019-05-23 14:21:23 +00:00
Ian Lepore
134399fcde Add pnp info to the imx_i2c driver. 2019-05-22 21:47:26 +00:00
Conrad Meyer
e12be3218a Include eventhandler.h in more compilation units
This was enumerated with exhaustive search for sys/eventhandler.h includes,
cross-referenced against EVENTHANDLER_* usage with the comm(1) utility.  Manual
checking was performed to avoid redundant includes in some drivers where a
common os_bsd.h (for example) included sys/eventhandler.h indirectly, but it is
possible some of these are redundant with driver-specific headers in ways I
didn't notice.

(These CUs did not show up as missing eventhandler.h in tinderbox.)

X-MFC-With:	r347984
2019-05-21 01:18:43 +00:00
Conrad Meyer
e2e050c8ef Extract eventfilter declarations to sys/_eventfilter.h
This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h"
in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header
pollution substantially.

EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c
files into appropriate headers (e.g., sys/proc.h, powernv/opal.h).

As a side effect of reduced header pollution, many .c files and headers no
longer contain needed definitions.  The remainder of the patch addresses
adding appropriate includes to fix those files.

LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by
sys/mutex.h since r326106 (but silently protected by header pollution prior
to this change).

No functional change (intended).  Of course, any out of tree modules that
relied on header pollution for sys/eventhandler.h, sys/lock.h, or
sys/mutex.h inclusion need to be fixed.  __FreeBSD_version has been bumped.
2019-05-20 00:38:23 +00:00
Emmanuel Vadot
dbfb4063ae arm: Add kern_clocksource.c directly in files.arm
This files is needed and included in all our config so move it to a common
location.

MFC after:	2 weeks
2019-04-16 20:04:22 +00:00
Ian Lepore
6daa4a4079 Mark the imx_spi device busy while transfers are in progress, so that the
module can't be unloaded while interrupts are pending.
2019-03-11 03:07:05 +00:00
Ian Lepore
256c1bca9e Add a compatible string to match recent changes in the upstream dts. 2019-02-18 19:50:53 +00:00