Commit Graph

33 Commits

Author SHA1 Message Date
Emmanuel Vadot
fc6ebb297b arm64: allwinner: Add 792Mhz frequency to sun50i-a64-opp
This is the frequency of the cpu on the Pinebook so add it to make
cpufreq find the current setting.
Note that this dtbo on the Pinebook doesn't work right now as u-boot
dtb doesn't have symbols and so it fails to apply. Linux 4.20 have
the dts and will be imported once taggued.

MFC after:	1 month
X-MFC with:	r341268
2018-11-30 10:31:30 +00:00
Emmanuel Vadot
a69c1d42cc arm64: allwinner: Add a dtbo to have cpu operating points
This enables cpufreq on A64 boards.

MFC after:	1 month
2018-11-29 22:35:23 +00:00
Kyle Evans
851f1a1121 Fix test-dts{,o} targets
There were two main problems here:

1.) sys/dts/Makefile.inc is not included from various */overlays directories
    by default, only ../Makefile.inc
2.) When shelling out for DTS/DTSO, cwd != .CURDIR, so enumeration always
    failed

These changes allow make test-dts and make test-dtso to function in their
respective directories.

Reviewed by:	manu
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D17961
2018-11-12 22:18:11 +00:00
Ruslan Bukin
3c8efd61f5 Revert r339421 due to unintended files included to commit.
Reported by:	ian
Approved by:	re (gjb)
Sponsored by:	DARPA, AFRL
2018-10-18 15:17:58 +00:00
Ruslan Bukin
53c6ad1d62 Support RISC-V implementations that do not manage the A and D bits
(e.g. RocketChip, lowRISC and derivatives).

RISC-V page table entries support A (accessed) and D (dirty) bits. The
spec makes hardware support for these bits optional. Implementations that
do not manage these bits in hardware raise page faults for accesses to a
valid page without A set and writes to a writable page without D set.
Check for these types of faults when handling a page fault and fixup the
PTE without calling vm_fault if they occur.

Reviewed by:	jhb, markj
Approved by:	re (gjb)
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D17424
2018-10-18 15:08:14 +00:00
Emmanuel Vadot
a9e5047fa6 arm64: Add DTS overlays for A64
- sun50i-a64-sid.dtso registers the Security ID node, needed for thermal
 - sun50i-a64-ths.dtso registers the thermal node, for which we already have a
driver
 - sun50i-a64-timer.dtso registers the timer node, needed as the generic timer
 glitch on A64 SoC.

Approved by:    re (gjb)
2018-08-24 15:00:36 +00:00
Warner Losh
58d5c51106 Remove Atmel AT91RM9200 and AT91SAM9 support.
The last known robust version of this code base was FreeBSD 8.2. There
are no users of this on current, and all users of it have abandoned
this platform or are in legacy mode with a prior version of FreeBSD.

All known users on arm@ approved this removal, and there were no
objections.

Differential Revision: https://reviews.freebsd.org/D16312
2018-07-27 18:28:22 +00:00
Ian Lepore
95e390b666 Add spi-max-frequency properties to all spigen nodes. This is a required
property for spi devices, although in the spigen case it's expected that
the speed will be overridden at runtime via the ioctl interface.  A very
conservative 500khz speed is used (I've never seen a spi device that
couldn't run at 1mhz).
2018-06-23 22:55:22 +00:00
Ian Lepore
ce0b0df7ab Add spigen(4) fdt data overlays for RPI-B, RPI-2.
By adding spigen-rpi{2,-b}.dtso to fdt_overlays= in loader.conf, the fdt data
will set up the correct pinmux and device nodes to create a spigen(4) device
for each available chipselect pin.

Submitted by:	Bob Frazier
Differential Revision:	https://reviews.freebsd.org/D15067
2018-06-22 20:45:40 +00:00
Kyle Evans
6d5127daf4 arm: overlays: Update to new path-based sugar format 2018-05-04 14:38:48 +00:00
Kyle Evans
903da53796 Garbage collect the a83t emac overlays
The 4.16 DTS import brought in emac support for the a83t. Since these
boards' DTS is pulled from /boot and I forgot to hook these up to the build,
they should be fairly safe to go away.

The a83t-sid and h3-sid overlays are still relevant. a83t-sid will likely
come in with 4.18 DTS.
2018-05-03 19:49:40 +00:00
Marcin Wojtas
ded9da6832 Update mv_gpio driver to new FreeBSD API
This patch implements and exports functions described
in gpio_if.m file. It also uses new gpiobus_attach_bus function
instead of adding gpioc and gpiobus as children. It removes
ulgy reading SoC ID and related if..else, so it depends only on
data read from FDT.

Submitted by: Patryk Duda <pdk@semihalf.com>
Reviewed by: manu
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D14756
2018-04-26 19:00:48 +00:00
Ruslan Bukin
05439eb571 Enable ARM PL330 DMA engine and Cadence Quad SPI flash controller on
Intel Arria 10 SoC boards.

Tested on Intel Arria 10 SoC Development Kit.

Sponsored by:	DARPA, AFRL
2018-04-23 12:23:05 +00:00
Ruslan Bukin
b8f915ab24 Convert atse(4) driver for Altera Triple-Speed Ethernet MegaCore to use
xdma(4) interface.

This allows us to switch between Altera mSGDMA or SoftDMA engines used by
atse(4) device.

This also makes atse(4) driver become 25% smaller.

Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D9618
2018-04-13 15:59:24 +00:00
Ruslan Bukin
36f5f2fb30 Add beripic1, msgdma and softdma instances.
Sponsored by:	DARPA, AFRL
2018-04-13 15:18:06 +00:00
Marcin Wojtas
391f888277 Remove deprecated DT sources of Armada 38x SoCs
Now, as all platform code and drivers support Linux
DT binding, safely remove deprecated sources and rely
on sys/gnu/dts from now on.

Obtained from: Semihalf
Sponsored by: Stormshield
2018-04-10 13:25:42 +00:00
Oleksandr Tymoshenko
91cc58af37 [rpi] Add fdt_pinctrl(4) support to Raspberry Pi GPIO driver
On Raspberry Pi platform GPIO controller also responsible for pins
multiplexing. Pi code predates proper FDT support in FreeBSD so a
lot of pinmux info is hardcoded. This patch:

- Implements pinctl methods in bcm2835_gpio
- Converts all devices with ad-hoc pinmux info to proper pin control
  mechanisms and adds pinmux info in FreeBSD's custom dts files.
- Adds fdt_pinctrl option to RPI2 and RPI-B kernels
- Adds SPI pinmux config to FreeBSD's customization of GNU DTS.

Reviewed by:	imp, manu
Differential Revision:	https://reviews.freebsd.org/D14104
2018-04-08 00:56:19 +00:00
Kyle Evans
1e14d6eb3d Add a83t overlays for sid and emac
The sun8i-a83t-bananapi-m3-emac overlay technically doesn't match what will
be coming from upstream. The tx-delay and rx-delay should be specified in
terms of allwinner,tx-delay-ps and allwinner,rx-delay-ps respectively. The
values are still technically correct for what we write in if_awg, and
support for the new bindings will be coming soon.
2018-04-07 22:28:43 +00:00
Marcin Wojtas
46db728392 Match Marvell Armada38X PCIE ranges in dts with Linux
If driver cannot determine ranges based on fdt, it will calculate
them based on number and type of current port.

Submitted by: Rafal Kozik <rk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D14752
2018-04-04 13:01:14 +00:00
Marcin Wojtas
13d464bf71 Change reg in Marvell Armada38X pcie FDT
Ranges in pcie-controller are unused, so could be changed to match Linux
device tree represntation. Same with interrupt-cells and interrupt-parent.
In PCI controller driver ocd_data are used for matching driver and
choose proper resources acquisition function.
fdt_win_process_child have new argument which provide information
about fdt node containing addresses of MMIO registers.

Submitted by: Rafal Kozik <rk@semihalf.com>
Reviewed by: manu [DT part]
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D14751
2018-04-04 12:54:18 +00:00
Marcin Wojtas
c7dbc00c34 Match Marvell Armada38X PCI compatible with Linux
In Linux FDT pcie does not have compatible string.
Configuration of windows in mv_common was based on fdt compatible.
Now pcie windows are configured by their parent: pcie_controller.
Processing is moved to fdt_win_process_child. fdt_win_process now
only walk through the tree. SOC_NODE_PCI is position of pcie function in
soc_node_spec array.

PCIe probe cannot use ofw_bus_search_compatible, because it needs to
check also device type and parents compatible.

Submitted by: Rafal Kozik <rk@semihalf.com>
Reviewed by: manu [DT part]
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D14749
2018-04-04 12:41:42 +00:00
Marcin Wojtas
72dbc3aca8 Make Marvell AmadaXP timer driver more generic
Store pointers to SoC specific functions in mv_timer_config structure
and determine proper config in runtime based on compatible string from FDT.
Compatible string for ArmadaXP timers is changed to match Linux FDT.
Armada 38x uses generic Cortex-A9 timer and separate watchdog drivers, so
it does not need to be supported by timer driver.

Submitted by: Rafal Kozik <rk@semihalf.com>
Reviewed by: manu
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D14741
2018-04-03 22:21:12 +00:00
Emmanuel Vadot
c2f5940db3 Add dtb overlays support
DTB Overlays are useful to change/add nodes to a dtb without the need to
modify it.
Add support for building dtbo during buildkernel.
The goal of DTBO present in the FreeBSD source tree is to fill a gap in
time when we submit changes upstream (Linux). Instead of waiting 2 to 4 months
we can add a DTBO in tree in the meantime.
This is not for adding DTBO for capes/hat/addon boards, those will be
better to put in a ports.
This is also not for enabling a i2c/spi/pwm controller on certain pins,
each user have a different use case for those (which pins to use etc ...)
and we cannot have all possible configuration.

Add a dtbo for sun8i-h3-sid which add the SID node missing in upstream dts.

Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D14782
2018-03-24 21:30:24 +00:00
Emmanuel Vadot
d9d3a08ed4 sys/dts: Remove arm64 from subdir as it no longer exists.
r325987 removed the arm64 directory, remove it from SUBDIR too.
2018-03-19 15:35:26 +00:00
Oleksandr Tymoshenko
8e6a67d5be [rpi] remove IRQ support for BCM233x RNG
Upstream DTBs don't provide IRQ lines for the RNG. Moreover, harvesting
bytes as often as the RNG interrupt is triggered (87 times per sec) is an
overkill.

For these reasons, get rid of the interrupt mode and make callout mode the
default, with random bits harvested every 4 seconds.

Submitted by:	Sylvain Garrigues <sylgar@gmail.com>
Reviewed by:	ian, imp, manu, mmel
Approved by:	emaste
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D14541
2018-03-10 02:49:58 +00:00
Michal Meloun
81cb170fea Switch to mainstream DTS for Raspberry Pi-B and Pi-2.
This is first step in attempt to make FreeBSD compatible with all variants of
RPi boards.

Reviewed by:	gonzo
MFC after:	3 weeks
2018-02-27 15:01:17 +00:00
Poul-Henning Kamp
fc62b7e5de Add a skeleton Clock Manager for RPi2/3, and use that from pwm
instead of frobbing the registers directly.

As a hack the bcm2835_pwm kmod presently ignores the 'status="disabled"'
in the RPI3 DTB, assuming that if you load the kld you probably
want the PWM to work.
2018-01-22 07:10:30 +00:00
Poul-Henning Kamp
9eec64c0aa Add a rudimentary PWM driver for the RaspberryPi.
Control is through sysctl, only GPIO12 supported.

bootverbose creates sysctls for direct mangling of relevant registers.

Only tested on RPI2
2018-01-14 20:36:21 +00:00
Emmanuel Vadot
aabe1bb37a dts: arm: Remove imx6 related dts
Everything should work with dts from sys/gnu/dts

Discussed with:	ian
2017-12-04 13:28:56 +00:00
Emmanuel Vadot
dab900583d dts: arm64: allwinner: Remove unused dts for pine64
Latest u-boot port provide the dts for pine64, remove our custom
and outdated dts for this board.
2017-11-18 21:39:54 +00:00
Emmanuel Vadot
7847756781 dts: Allwinner: Remove our last custom DTS
All Allwinner boards should use the upstream DTS so remove our
remaining custom ones.
2017-11-18 16:07:53 +00:00
Warner Losh
9e45a31607 Fix SYSDIR path. After the move, we need to chop off a couple ../ from
the prior definition. But a safer definition is SRCTOP/sys, so use
that.

Sponsored by: Netflix
2017-11-15 03:46:59 +00:00
Warner Losh
2e36db147e Move sys/boot/fdt/dts to sys/dts and adjust scripts.
Sponsored by: Netflix
2017-11-14 21:03:57 +00:00