Commit Graph

4103 Commits

Author SHA1 Message Date
Andrew Turner
222102cfca Move including fdt_pinctrl.h after openfirm.h to get th edefinition of
phandle_t and remove the need for including fdt_common.h.

Sponsored by:	ABT Systems Ltd
2016-11-14 11:52:22 +00:00
Andrew Turner
df7675353e Stop including fdt_common.h from the arm code when it's unneeded.
Sponsored by:	ABT Systems Ltd
2016-11-14 11:41:22 +00:00
Svatopluk Kraus
06a9e29e75 The return type of is_managed() was changed from boolean_t to bool type
in r308569. Now, propagate this change further for consistency sake.

MFC after:	2 weeks
2016-11-12 17:24:41 +00:00
Svatopluk Kraus
b75f7c6cfb Always call PHYS_TO_VM_PAGE() in is_managed(). Fast road for addresses
under first_page cannot be taken as this variable is connected only to
vm_page_array segment. There could be more segments in system like
the ones for various fictitious page ranges. These can be situated
under vm_page_array segment and so, they could be skipped before this
fix. However, as far as I know, there is no report associated with it.

While here, the return type of this function is changed from boolean_t
to bool type.

Reviewed by:	kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D8502
2016-11-12 17:03:21 +00:00
Andrew Turner
87acb7f815 Use the modern spelling of ofw_bus_node_is_compatible in sys/arm.
Sponsored by:	ABT Systems Ltd
2016-11-11 15:13:30 +00:00
Andrew Turner
30add35afa Fix ata_at91_alloc_resource to use rman_res_t.
Sponsored by:	ABT Systems Ltd
2016-11-11 14:30:09 +00:00
Andrew Turner
639e990770 Remove more unneeded users of the fdt_pic_decode_t table.
Sponsored by:	ABT Systems Ltd
2016-11-11 14:22:35 +00:00
Bryan Drewery
28323add09 Fix improper use of "its".
Sponsored by:	Dell EMC Isilon
2016-11-08 23:59:41 +00:00
Andrew Turner
feabce61dc Start to remove the old pre-INTRNG code from the arm platforms. These have
all moved to use INTRNG.

Reviewed by:	manu, mmel
Sponsored by:	ABT Systems Ltd
Differential Revision:	https://reviews.freebsd.org/D8469
2016-11-08 12:15:57 +00:00
Emmanuel Vadot
328dd395ba Do not fail to attach the clock if we cannot set the assigned parents as this
property isn't mandatory.

MFC after:	2 weeks
2016-11-08 10:06:43 +00:00
Oleksandr Tymoshenko
69cab2d1bf Fix locking in bcm2835_audio driver
- Move all VCHI activity to worker thread: channel methods are called with
    non-sleepable lock held and VCHI uses sleepable lock.

- In worker thread use sx(9) lock instead of mutex(9) for the same reason.

PR:		213801, 205979
2016-11-07 17:38:39 +00:00
Andrew Turner
95d34803f7 Fix the order of includes so machine/asm.h is first.
MFC after:	1 week
Sponsored by:	ABT Systems Ltd
2016-11-07 11:56:18 +00:00
Stanislav Galabov
c1bc87b161 Generate an error if machine/armreg.h is included without sys/cdefs.h
machine/armreg.h requires access to the __ARM_ARCH macro, which is not
always properly defined (especially by gcc 4.2.1). We should include
sys/cdefs.h in order to get the definitions in machine/acle-compat.h,
which would properly define the __ARM_ARCH macro in these cases.

So, in cases where machine/armreg.h is included without _SYS_CDEFS_H_
being defined - generate an #error.

Reviewed by:	andrew
Sponsored by:	Smartcom - Bulgaria AD
Differential Revision:	https://reviews.freebsd.org/D8460
2016-11-07 11:35:14 +00:00
Andrew Turner
fe06608404 Include machine/armreg.h after machine/asm.h to ensure __ARM_ARCH is
defined.

MFC after:	1 week
Sponsored by:	ABT Systems Ltd
2016-11-07 11:01:09 +00:00
Stanislav Galabov
921081191d Only include sys/boot.h if LINUX_BOOT_ABI is defined
Only include sys/boot.h if LINUX_BOOT_ABI is defined in
sys/arm/arm/machdep.c

Not doing this prevents kernels that do not define LINUX_BOOT_ABI from
being build with gcc (at least 4.2.1).

Reviewed by:	mmel
Sponsored by:	Smartcom - Bulgaria AD
Differential Revision:	https://reviews.freebsd.org/D8459
2016-11-07 10:54:56 +00:00
Andrew Turner
cb1b0068a1 Start to deorbit the kernel configs in GENERIC by marking them with
NO_UNIVERSE. This stops them from being built with the universe,
tinderbox, and related targets.

Sponsored by:	ABT Systems Ltd
2016-11-07 10:26:44 +00:00
Michal Meloun
ccf5e68e5b Add NVIDIA Tegra XHCI driver and coresponding firmware blob.
MFC after: 3 weeks
Approved by: core@ (NVIDIA license)
2016-11-07 05:37:10 +00:00
Michal Meloun
59b591b1b1 Rework NVIDIA Tegra124 XUSBPAD driver.
- Adapt it for new, incompatible, DT bindings introduced by r306197.
 - Add support for USB super speed pads/ports.

MFC after: 3 weeks
2016-11-07 05:34:44 +00:00
Emmanuel Vadot
6988dd5e61 Add support for AXP221 Power Management Unit.
AXP221 is used on board with A31/A31S and is mostly compatible with AXP209.
Regulators, GPIO and Sensors are supported.

MFC after:	2 weeks
2016-11-04 20:02:52 +00:00
Emmanuel Vadot
73e62e8c5c Fix r308306 by spelling variable correctly. 2016-11-04 19:23:52 +00:00
Emmanuel Vadot
1ca819f642 Set rst_apb to NULL to avoid panic when release. 2016-11-04 19:21:11 +00:00
Emmanuel Vadot
e3454ae8b3 For AHB clock we need to set the assigned parents for cpufreq(4) to work.
MFC after:	2 weeks
2016-11-04 17:13:47 +00:00
Michal Meloun
7961a970c7 TEGRA: Fix numerous issues in clock code.
Define and export clocks related to XUSB driver.
2016-11-04 11:40:11 +00:00
Michal Meloun
47a232c660 TEGRA: Add basic driver for memory controller.
For now, it only reports memory and SMMU access errors.
2016-11-04 11:39:19 +00:00
Emmanuel Vadot
bccf798278 Add Allwinner UP SoC support to GENERIC on armv6
Relnotes:	yes
2016-11-04 04:47:08 +00:00
Jared McNeill
16025c357f Add support for Allwinner H3 audio codec.
The audio controller in the H3 is more or less the same as A10/A20 except
some registers are shuffled around. The mixer interface, however, is
completely different between SoCs. Separate a10_mixer_class and
h3_mixer_class implementations are now made available. This will also make
adding support for other SoCs easier in the future.

Reviewed by:		andrew, ganbold
Relnotes:		yes
Differential Revision:	https://reviews.freebsd.org/D8425
2016-11-03 23:22:04 +00:00
Jared McNeill
e1ca1a284c Add support for the integrated DMA controller found in the Allwinner A31,
A64, A83T, and H3 SoCs.

Relnotes:	yes
2016-11-02 23:58:10 +00:00
Jared McNeill
ddfb3d5aa7 Register the device's xref handle at attach time. 2016-11-02 23:53:47 +00:00
Jared McNeill
5f7cfb6035 Add support for H3 PLL2 (PLL_Audio). 2016-11-02 23:49:57 +00:00
Jared McNeill
8c07f7653a The DTS may report fewer than 4 parents for a module clock. Avoid setting
the module clock parent to an out-of-range index in these cases.
2016-11-02 23:46:23 +00:00
Andrew Turner
5c73dd07a6 Add BeagleBone Black support to GENERIC on armv6.
Reviewed by:	mmel, imp
Relnotes:	yes
Sponsored by:	ABT Systems Ltd
Differential Revision:	https://reviews.freebsd.org/D8335
2016-11-02 13:11:19 +00:00
Andrew Turner
e9524a3c2f Allow an SMP kernel to boot on Cortex-A8:
* Rename ARM_HAVE_MP_EXTENSIONS to ARM_USE_MP_EXTENSIONS and extend it to
   handle more cases, including when SMP is not enabled.
 * Check ARM_USE_MP_EXTENSIONS when building for ARMv7+, even if no SMP.
 * Use ARM_USE_MP_EXTENSIONS in pmap-v6.c to detect when to set PRRR_NS1.

With this we should be able to boot on all ARMv7+ Cortex-A cores with
32-bit support.

Reviewed by:	mmel, imp (earlier version)
Relnotes:	yes
Sponsored by:	ABT Systems Ltd
Differential Revision:	https://reviews.freebsd.org/D8335
2016-11-02 13:10:08 +00:00
Justin Hibbits
3d9df07abf Move imx_sdhci driver over to a dev/sdhci in preparation for QorIQ support.
Freescale uses eSDHC in both i.MX (ARM) and QorIQ (PowerPC), with slight
differences.  This is part one in unifying the drivers.

Reviewed by:	imp
2016-11-02 00:51:09 +00:00
Jared McNeill
bd95d8610a Fix H3 temperature reporting. The formula in for V1.0 of the H3 datasheet
seems to be incorrect, so use the same method of conversion as the H3 BSP
instead.
2016-10-30 14:39:33 +00:00
Ganbold Tsagaankhuu
a6e9118bf4 Add support for Allwinner Consumer IR interface.
RX is supported now and the driver is using evdev framework.
It was tested on Cubieboard2 (A20 SoC) using lirc
with dfrobot's IR remote controller.
2016-10-27 04:26:33 +00:00
Andrew Turner
f1ae17fb50 Use the new fdt_intr.h constants in the Allwinner NMI driver.
Sponsored by:	DARPA, AFRL
2016-10-26 16:03:26 +00:00
Andrew Turner
0c5434ae58 Pull the common FDT interrupt values into a new header rather than be magic
numbers.

Sponsored by:	DARPA, AFRL
2016-10-26 15:18:08 +00:00
Andrew Turner
87e1355ba5 Define the Allwinner PLL FDT constants in the file that uses them rather
than including a file from under sys/gnu.

Sponsored by:	DARPA, AFRL
2016-10-26 14:09:30 +00:00
Emmanuel Vadot
1535414c25 The only consumer of pll1 is the CPU clock, we don't need to set it glitch free.
Reported by:	jmcneill
MFC after:	1 week
2016-10-26 08:47:35 +00:00
Andrew Turner
8fcbb32311 Add MULTIDELAY support to the am335x dmtimer. This will be useful for
testing Cortex-A8 support in GENERIC.

Sponsored by:	ABT Systems Ltd
2016-10-25 18:01:19 +00:00
Andrew Turner
12f7add9f7 Remove the need for the delay to be zero when MULTIDELAY is undefined,
it may be useful to only enable this in some configs.

Sponsored by:	ABT Systems Ltd
2016-10-25 17:57:31 +00:00
Andrew Turner
bf715082c3 Remove armadaxp_idcache_wbinv_all, it's a static function in the ELF
trampoline and not used outside this.

Sponsored by:	ABT Systems Ltd
2016-10-25 16:33:05 +00:00
Andrew Turner
ff300d2316 Remove arm11x6_setttb and armv7_setttb as they are unused. While here
remove unneeded code from the ARMv7 cpu assembly code.

Sponsored by:	ABT Systems Ltd
2016-10-25 16:25:06 +00:00
Emmanuel Vadot
6a9f23793d allwinner A10 Pll1 allow changing freq
PLL1 is used by the cpu core, allowing changing freq is needed for cpufreq.
The factors table contains all the frequencies in the operating point table
present in the DTS.

MFC after:	1 week
2016-10-25 15:21:08 +00:00
Andrew Turner
ce9fa35b35 Update the armv6 tlb handling functions to detect if it is running on
hardware that supports the mp extensions. If so it should use the broadcast
tlb invalidate instructions as other CPUs or devices may need to know about
the invalidation.

To simplify the code have the compiler optimise out the else case when not
builing for Cortex-A8.

Sponsored by:	ABT Systems Ltd
Differential Revision:	https://reviews.freebsd.org/D8092
2016-10-25 13:45:59 +00:00
Jared McNeill
51fefb0418 Enable driver for SY8106A Buck Regulator. 2016-10-24 22:35:45 +00:00
Jared McNeill
2e4f934752 Defer cpufreq updates from intr handler to the taskqueue_thread queue. 2016-10-24 22:35:12 +00:00
Emmanuel Vadot
cd2b868b5d allwinner: Add support for P2WI in RSB driver
Push-Pull Two Wire interface is a almost compatible iic like bus used
in sun6i SoC. It's only use is to communicate with the power management IC.

Reviewed by:	jmcneill
MFC after:	1 week
Relnotes:	yes
2016-10-24 20:33:42 +00:00
Emmanuel Vadot
2c3b1e3c42 Revert 307822
P2WI is almost compatible with RSB which we already support.
I'll add support for P2WI in aw_rsb instead.

Discussed with:	 jmcneill
2016-10-24 14:24:12 +00:00
Jared McNeill
5a7f20b4d0 Add device cpufreq. 2016-10-23 19:02:19 +00:00
Jared McNeill
3c2b90f1d1 Throttle CPU frequency when hot temperature threshold has been reached to
prevent overheating.

When sensor 0's alarm interrupt is fired, set a throttle flag. Further
requests to set CPU frequency will be rejected until sensor 0's temperature
returns to a level below the hot temperature threshold.

Relnotes:	yes
2016-10-23 17:48:34 +00:00
Emmanuel Vadot
0b194aca21 allwinner: Add support for P2WI bus
P2WI (Push-Pull Two Wire Interface) is an I2C-like bus used in sun6i SoC
for talking to power management unit IC.
2016-10-23 12:48:09 +00:00
Wojciech Macek
7902c8dca8 Driver for PCI Ethernet NIC on Alpine V1 and V2.
Obtained from:         Semihalf
Submitted by:          Michal Stanek <mst@semihalf.com>
Sponsored by:          Annapurna Labs
Reviewed by:           wma
Differential Revision: https://reviews.freebsd.org/D7814
2016-10-20 11:31:11 +00:00
Wojciech Macek
246d07a7a3 Support for Alpine Serializer/Deserializer.
The exported functions will be used by
Alpine Ethernet driver.

Obtained from:         Semihalf
Submitted by:          Michal Stanek <mst@semihalf.com>
Sponsored by:          Annapurna Labs
Reviewed by:           wma
Differential Revision: https://reviews.freebsd.org/D7763
2016-10-20 11:26:51 +00:00
Wojciech Macek
be48125bbf Support for MSI-X on Annapurna Alpine
This patch adds support for MSI-X interrupts
on Annapurna Alpine platform. MSI-X on Alpine
work similarly to GICv2m, i.e. some range of
SPI interrupts is reserved in GIC and individual
SPIs can be triggered by MSI-X messages.
This SPI range is defined in FDT.

Obtained from:         Semihalf
Submitted by:          Michal Stanek <mst@semihalf.com>
Sponsored by:          Annapurna Labs
Reviewed by:           nwhitehorn, wma
Differential Revision: https://reviews.freebsd.org/D7579
2016-10-20 11:23:59 +00:00
Michal Meloun
99746e4658 TEGRA: Raise minimum voltage for CPU, original 0.9 V was too optimistic.
While I'm in, remove duplicated line from CPU frequency table.

MFC after: 2 weeks
2016-10-19 14:28:51 +00:00
Warner Losh
44637964ef Use MODULES_EXTRA rather than MODULES_OVERRIDE for dtb.
Submitted by: Oleksandr Tymoshenko
2016-10-19 05:53:43 +00:00
Michal Meloun
fd02931841 REGULATOR: Move functions for handling with regulator ranges to
common file. They can be useful for other PMICs.

MFC after: 2 weeks
2016-10-18 12:27:46 +00:00
Michal Meloun
4d517b66a0 TEGRA: Attach cpufreq and coretemp drivers only on tegra124 SoC.
It's needed by GENERIC kernel.

MFC after: 2 weeks
2016-10-18 12:26:22 +00:00
Michal Meloun
69c48a2805 TEGRA: Really implement early printf. The original version
was cut&pasted from another SoC.

Pointy-hat to: mmel

MFC after: 2 weeks
2016-10-18 12:21:45 +00:00
Warner Losh
c6b36952ec Also include the DTBs in /boot/dtb for omap4 systems. 2016-10-18 04:01:58 +00:00
Hans Petter Selasky
d3bf5efc1f Fix device delete child function.
When detaching device trees parent devices must be detached prior to
detaching its children. This is because parent devices can have
pointers to the child devices in their softcs which are not
invalidated by device_delete_child(). This can cause use after free
issues and panic().

Device drivers implementing trees, must ensure its detach function
detaches or deletes all its children before returning.

While at it remove now redundant device_detach() calls before
device_delete_child() and device_delete_children(), mostly in
the USB controller drivers.

Tested by:		Jan Henrik Sylvester <me@janh.de>
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D8070
MFC after:		2 weeks
2016-10-17 10:20:38 +00:00
Jared McNeill
63f6b1a75a aw_ccu on H3 needs access to PRCM space. The r_pio controller works now. 2016-10-16 12:55:31 +00:00
Jared McNeill
72f1cf0446 Add driver for GPIO controlled regulator.
Reviewed by:		gonzo, manu, mmel
Differential Revision:	https://reviews.freebsd.org/D8257
2016-10-15 20:04:14 +00:00
Emmanuel Vadot
b3d4851e86 axp209: Add support for regulators
Except for LDO4, all regulators are supported.

MFC after:	1 week
2016-10-15 17:49:41 +00:00
Jared McNeill
3c6a684c11 Match "allwinner,sun8i-h3-apb0-gates-clk" compatible string. 2016-10-15 13:27:01 +00:00
Jared McNeill
2ee32f3c7f Provide a complete A23 PLL1 factor table, from 60MHz to 1872MHz. 2016-10-15 12:23:54 +00:00
Oleksandr Tymoshenko
745c4aa5e8 Make BRCM2837 port conform FreeBSD/ARM64 guidelines
- Rename SOC_BCM2837 to SOC_BRCM_BCM2837, put it to opt_soc.h
- do not use files.XXX files, just move required sources to
    conf/files.arm64 and make them depend on soc_brcm_bcm2837

Suggested by: andrew
2016-10-14 22:23:03 +00:00
John Baldwin
31dc1e9681 Drop support for using mmap() with /dev/kmem.
Using the device pager with /dev/kmem is not stable since KVA mappings
are transient, but the device pager caches the PA associated with a
given offset forever.  Interestingly, mips' implementation of
memmap() already refused requests for /dev/kmem.

Note that kvm_read/kvm_write do not use mmap, but use read and write on
/dev/kmem, so this should not affect libkvm users.

Reviewed by:	kib
MFC after:	2 months
2016-10-14 20:01:07 +00:00
Oleksandr Tymoshenko
563193fd0c Add initial Raspberry Pi 3 support
RPI3 kernel config builds kernel compatible with latest upstream device
tree and firmware: https://github.com/raspberrypi/firmware/tree/master/boot
As of today it's 597c662a613df1144a6bc43e5f4505d83bd748ca

Default console is PL01x, so pi3-disable-bt dt overlay should be configured
in config.txt and stock U-Boot should be patched to use proper serial port.

Yet unsupported: SMP, VCHIQ, RNG driver. RNG requires some work due to
upstream device tree incompatibility.

Multiple people contributed to this work over time: db@, loos@, manu@
2016-10-14 03:37:35 +00:00
Oleksandr Tymoshenko
eea6ab027a Make bcm2835_machdep.c optional
bcm2835_machdep.c contains only bits enabled by "options PLATFORM", this
option available only on ARM, not ARM64
2016-10-14 03:00:53 +00:00
Oleksandr Tymoshenko
16bacb8a2d Do not set FB_FLAG_MEMATTR if VM_MEMATTR_WRITE_COMBINING is not available
Pintyhat to: gonzo
Spotted by: jmallett
2016-10-14 01:23:21 +00:00
Oleksandr Tymoshenko
be4b107168 Fix BCM238x framebuffer driver build for ARM64
VM_MEMATTR_WRITE_COMBINING can be undefined for some platforms, use it only
if it's defined
2016-10-14 00:42:08 +00:00
Oleksandr Tymoshenko
8ff1636c1a Fix BCM283x(Raspberry Pi) SDHCI driver for ARM64 build
- Revert BUS_SPACE_PHYSADDR back to rman_get_start. BUS_SPACE_PHYSADDR was
    introduced in 2013 as temporary wrapper until proper solution appears.
    It's ARM only and since we need this file for ARM64 build and no proper
    API has been introduced - just revert the change and make sure it's
    going to appear when people grep for BUS_SPACE_PHYSADDR in sources.

- Fix printf format for size_t variables
2016-10-13 23:29:24 +00:00
Warner Losh
b2a7ac4802 Fix building on i386 and arm. But 'public domain' headers on the files
with no creative content. Include "lost" changes from git:
o Use /dev/efi instead of /dev/efidev
o Remove redundant NULL checks.

Submitted by: kib@, dim@, zbb@, emaste@
2016-10-13 06:56:23 +00:00
Oleksandr Tymoshenko
c38fb7809f INTRNG: Propagate IRQ activation error to API consumer
Keep resource state consistent with INTRNG state - if intr_activate_irq
fails - deactivate resource and propagate error to calling function

Reviewed by:	mmel
2016-10-12 17:10:59 +00:00
Oleksandr Tymoshenko
0e3cfd98fc Fix typo in comment
Spotted by: loos
2016-10-12 05:35:57 +00:00
Oleksandr Tymoshenko
43be86e31b Make BCM283x USB driver compatible with upstream DT
- Make resource allocation logic depend on compatibility string
    to check what format of DTS node should be used - FreeBSD's or upstream
2016-10-12 03:07:49 +00:00
Oleksandr Tymoshenko
aa2959bae5 Make BCM2835 GPIO driver compatible with upstream DT
- Add compatibility string
- Make reserverd and read-only properties optional
2016-10-12 03:06:05 +00:00
Oleksandr Tymoshenko
38e62ae597 Add compatibility string from upstream DT 2016-10-12 03:03:55 +00:00
Oleksandr Tymoshenko
5a715e8aa2 Make framebuffer driver compatible with upstream DT
- Add compatibility string
- Add simplebus as possible parent bus
2016-10-12 03:03:05 +00:00
Oleksandr Tymoshenko
9d6eb8bb3d Add compatible strings used in upstream dts files 2016-10-12 03:00:42 +00:00
Oleksandr Tymoshenko
511bc527ff Make sure intc is attached before interrupt consumers
If pass order is not specified devices are attached in the order they are
defined in dts. Some interrupt consumers may be defined before intc. Also
make sure intc interrupt-parent local_intc is attached before intc itself.
2016-10-12 02:58:27 +00:00
Jonathan T. Looney
bd79708dbf In the TCP stack, the hhook(9) framework provides hooks for kernel modules
to add actions that run when a TCP frame is sent or received on a TCP
session in the ESTABLISHED state. In the base tree, this functionality is
only used for the h_ertt module, which is used by the cc_cdg, cc_chd, cc_hd,
and cc_vegas congestion control modules.

Presently, we incur overhead to check for hooks each time a TCP frame is
sent or received on an ESTABLISHED TCP session.

This change adds a new compile-time option (TCP_HHOOK) to determine whether
to include the hhook(9) framework for TCP. To retain backwards
compatibility, I added the TCP_HHOOK option to every configuration file that
already defined "options INET". (Therefore, this patch introduces no
functional change. In order to see a functional difference, you need to
compile a custom kernel without the TCP_HHOOK option.) This change will
allow users to easily exclude this functionality from their kernel, should
they wish to do so.

Note that any users who use a custom kernel configuration and use one of the
congestion control modules listed above will need to add the TCP_HHOOK
option to their kernel configuration.

Reviewed by:	rrs, lstewart, hiren (previous version), sjg (makefiles only)
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D8185
2016-10-12 02:16:42 +00:00
Oleksandr Tymoshenko
58a3e50de6 Make Rapsberry Pi watchdog driver compatible with upstream DTS
- Fix compatibility strings
- Compensate the difference in base address for our custom DTS and
    upstream one (for backward compatibility)
2016-10-11 21:40:15 +00:00
Oleksandr Tymoshenko
98884a9ea9 Make intc driver compatible with upstream DTS
- Fix compatibility strings
- Properly decode upstream's two-cell interrupt specs. Our home-made dts
    does not have two-cell interrupts so no need to preserve backward
    compatibility
2016-10-11 21:37:34 +00:00
Michal Meloun
c7264b2dfa ARM: Remove unused includes.
MFC after: 1 week
2016-10-09 10:25:47 +00:00
Michal Meloun
ba0bb20635 ARM: Split identify_arm_cpu() into ARMv4 and ARMv6 variant.
On ARMv6, be more verbose about supported CPU features and/or
optional instructions.
2016-10-09 10:24:10 +00:00
Oleksandr Tymoshenko
6dcc1178c4 Fix release MSI method for ARM GIC 2016-10-09 04:37:21 +00:00
Oleksandr Tymoshenko
5031b2a018 Fix release MSI method for NVidia Tegra PCI controller 2016-10-09 04:36:40 +00:00
Oleksandr Tymoshenko
de2929fff0 Fix MSI allocation for NVidia Tegra
- Fix range check
- Due to checking found value in for(;;) condition irq after loop was
    always + 1 from actually found slot and wrong entry was marked as
    used which lead to returning slot 0 for all requests.
2016-10-09 04:29:42 +00:00
Oleksandr Tymoshenko
b5e34627d8 Add multitouch support for RPi's FT5406
- Add multitouch support (protocol B)
- Report physical size of the screen
- Switch from using busy loop to callbacks
- Enable callbacks only when there is active listener on /dev/input/eventX

Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
2016-10-08 18:19:52 +00:00
Michal Meloun
fd3d8ea51a ARM: Remove ARMv4 #defines from busdma_machdep-v6.c, it's ARMv6
specific file. Consistently use BUSDMA_DCACHE_ALIGN for cache
line alignment.

MFC after: 1 week
2016-10-06 13:53:17 +00:00
Michal Meloun
7cc70732a3 ARM: SEV/WFE instructions are implemented starting from ARMv6K,
use it directly.

MFC after: 1 week
2016-10-06 13:18:18 +00:00
Michal Meloun
55e447c98c ARM: Add identifiers for ARM Cortex v8 and Marvell Sheeva v7 cores.
Not a functional change.

MFC after: 3 days
2016-10-06 12:01:10 +00:00
Michal Meloun
4f18c103db ARM: Remove unused variable.
Not a functional change.

MFC after: 3 days
2016-10-06 11:54:42 +00:00
Luiz Otavio O Souza
ba14258f32 if_cpsw overhaul:
- Fix RX and TX teardown:
  . TX teardown would not reclaim the abandoned descriptors;
  . Interrupt storms in RX teardown;
  . Fixed the acknowledge of the teardown completion interrupt.

- Remove temporary lists for the descriptors;

- Simplified the descriptor handling (less writes and reads from
  descriptors where possible);

- Better debug;

- Add support for the RX threshold interrupts:
  With interrupt moderation only, an RX overrun is likely to happen.  The
  RX threshold is set to trigger a non paced interrupt everytime your RX
  free buffers are under the minimum threshold, helping to prevent the rx
  overrun.

The NIC now survive when pushed over its limits (where previously it would
lock up in a few seconds).

uFW (600MHz SoC) can now forward up to 560Mb/s of UDP traffic (netmap
pkt-gen as source and sink).  TCP forwarding rate is over 350Mb/s.

No difference (other than CPU use) was seen on Beaglebone black (1GHz SoC)
for his fast ethernet.

Tested on:	uFW, BBB
Sponsored by:	Rubicon Communications, LLC (Netgate)
2016-10-05 19:09:27 +00:00
Andrew Turner
c5bf621b7a We don't use cpu_control on armv6, remove the macro there. 2016-10-05 14:00:05 +00:00
Michal Meloun
9567acca41 ARM: Remove next bunch of unused cpu_functions from ARMv6. 2016-10-05 12:19:09 +00:00
Andrew Turner
1834282de6 Split CPU_CORTEXA into CPU_CORTEXA8, for the Cortex-A8, and CPU_CORTEXA_MP,
for later Cortex-A CPUs that support the Multiprocessor Extensions. This
will be needed to support both in a single GENERIC kernel while still
being able to only build for a single SoC.

Reviewed by:	mmel
Relnotes:	yes
Sponsored by:	ABT Systems Ltd
Differential Revision:	https://reviews.freebsd.org/D8138
2016-10-04 12:25:44 +00:00
Andrew Turner
d029cb6152 Read the Multiprocessing Extensions bit from the Multiprocessor Affinity
register.

Sponsored by:	ABT Systems Ltd
X-Differential Revision:	https://reviews.freebsd.org/D8092
2016-10-04 12:01:08 +00:00
Michal Meloun
fe8151a0e3 ARM: Add mising early clobber modifier in atomic_swap_32().
MFC after: 2 weeks
2016-10-04 09:59:37 +00:00
Michal Meloun
6542d1a4e7 ARM: Add atomic_swap_64(). It's need by linuxkpi and drm-next-4.7.
MFC after: 2 weeks
2016-10-04 09:51:54 +00:00
Michal Meloun
c7533311be TEGRA: Fix PCIe link timeout.
MFC after: 2 weeks
2016-10-04 09:14:48 +00:00
Jared McNeill
1ef15cafa0 Clear GT_CTRL_ENABLE to stop the timer.
Reviewed by:	andrew
2016-10-03 21:42:05 +00:00
Andrew Turner
c6b8d2a2a3 Use the cortex functions when booting on one of the Cortex-A ARMv8 CPUs.
This list is incomplete, however we don't have the ID values for the
missing Cortex-A32 or A35.

Submitted by:	loos (Cortex-A53)
Sponsored by:	ABT Systems Ltd
2016-10-03 20:05:33 +00:00
Luiz Otavio O Souza
430d5eb47d Enable the TX completion interrupt for the cpsw NIC to assure the free tx
descriptors are reclaimed as soon as possible.

Without this the free buffers are reclaimed only on watchdog runs or after
trying to enqueue more packets.

Sponsored by:	Rubicon Communications, LLC (Netgte)
2016-10-03 19:48:56 +00:00
Oleksandr Tymoshenko
82e4e00f18 Add Tegra TK1 DTBs to GENERIC kernel
Approved by:	andrew
2016-10-03 19:34:32 +00:00
Andrew Turner
905339874b Add the Cortex-A{53,57,72} ID register values. These can all run 32-bit
code so could run a 32-bit kernel.

Sponsored by:	ABT Systems Ltd
2016-10-03 18:00:10 +00:00
Andrew Turner
18f555023a Remove the old Allwinner std.* files, these are not part of the common
Allwinner kernel configs.

Sponsored by:	ABT Systems Ltd
2016-10-03 16:47:46 +00:00
Andrew Turner
0e484d95ca Remove unused functions on armv6. Some of the cache handling code is still
used in the elf trampoline so add a macro to handle this.

Sponsored by:	ABT Systems Ltd
2016-10-03 16:10:38 +00:00
Andrew Turner
610d93d80a Remove the parts of cpu_functions from armv6 that are unused on that
architecture.

Sponsored by:	ABT Systems Ltd
2016-10-03 14:43:57 +00:00
Andrew Turner
d15a8db5ad Only define the CF_* macros on ARMv4/v5. They are unused on armv6.
Sponsored by:	ABT Systems Ltd
2016-10-03 14:26:55 +00:00
Andrew Turner
037a0903ee Use C99 designated initializers to create the armv6 cpu_functions structs.
This will help with a later cleanup of what functions we implement.

Sponsored by:	ABT Systems Ltd
2016-10-03 11:57:10 +00:00
Oleksandr Tymoshenko
2abb9b42a5 Add rpi_ft5406 module and add it to extra modules in Raspberry Pi configs 2016-10-03 01:08:34 +00:00
Oleksandr Tymoshenko
19de549b41 Fix attach/detach methods
- Initialize lock before starting worker process
- Do not hold lock when destroying evdev. By that time ther should be no
    other active code pathes that can access softc
2016-10-03 01:07:06 +00:00
Oleksandr Tymoshenko
a6b15a3429 Modularize evdev
- Convert "options EVDEV" to "device evdev" and "device uinput", add
    modules for both new devices. They are isolated subsystems and do not
    require any compile-time changes to general kernel subsytems
- For hybrid drivers that have evdev as an optional way to deliver input
    events add option EVDEV_SUPPORT. Update all existing hybrid drivers
    to use it instead of EVDEV
- Remove no-op DECLARE_MODULE in evdev, it's not required, MODULE_VERSION
    is enough
- Add evdev module dependency to uinput

Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
2016-10-02 03:20:31 +00:00
Oleksandr Tymoshenko
8ee7716721 Use VM_MEMATTR_WRITE_COMBINING memattr for mmap(2) on framebuffer
VM_MEMATTR_WRITE_COMBINING sets write-through cache flag for framebuffer
memory that prevents pixel data from being stuck in cache until evicition
happens
2016-10-01 17:57:32 +00:00
Michal Meloun
a7b380d7d6 TEGRA: Fix bindings for cpufreq and coretemp drivers,
it was broken in r306477.
Correct a description for coretemp driver.
2016-10-01 06:50:16 +00:00
Michal Meloun
a27852480c TEGRA: Extend timeout for PLLs lock to 5 ms. Real lock time for PLLA
has been very near to old limit.
2016-10-01 03:35:03 +00:00
Oleksandr Tymoshenko
76a46b2918 Add dependency to evdev module 2016-09-30 21:14:42 +00:00
Oleksandr Tymoshenko
15eefa5b12 Add dependency to evdev module (if required) 2016-09-30 21:13:19 +00:00
Luiz Otavio O Souza
848a049b71 Remove the GLOBAL queue lock which just adds unnecessary complexity to code
(when used together with the individual tx and rx locks).

Sponsored by:	Rubicon Communications, LLC (Netgate)
2016-09-30 17:30:39 +00:00
Luiz Otavio O Souza
5a9c270ab6 Fix a typo in CPSW_DEBUG MACRO and then replace all the CPSWP_DEBUG() calls
with CPSW_DEBUG().

Sponsored by:	Rubicon Communications, LLC (Netgate)
2016-09-30 17:19:43 +00:00
Luiz Otavio O Souza
c933457038 Sort and remove unnecessary includes.
No functional changes.

Sponsored by:	Rubicon Communications, LLC (Netgate)
2016-09-30 17:16:02 +00:00
Andrew Turner
7efd943a95 Revert an accedintal commit. 2016-09-30 14:00:23 +00:00
Andrew Turner
968e30efd5 Fix the spelling of Cortex. 2016-09-30 13:47:52 +00:00
Emmanuel Vadot
e540b12f31 Add support for RPI2 to the armv6 GENERIC kernel. 2016-09-30 10:46:27 +00:00
Andrew Turner
75ea4d5245 Remove the duplicate ukbd device from the armv6 GENERIC
Sponsored by:	ABT Systems Ltd
2016-09-30 10:22:50 +00:00
Emmanuel Vadot
d654c8053d RPI2: Add support for MULTIDELAY, this is needed for inclusion into GENERIC. 2016-09-30 10:21:04 +00:00
Andrew Turner
65be9c9af9 Add support for Tegra to the armv6 GENERIC kernel.
Reviewed by:	imp, mmel
Sponsored by:	ABT Systems Ltd
Differential Revision:	https://reviews.freebsd.org/D8084
2016-09-30 10:20:53 +00:00
Emmanuel Vadot
e374c33592 bcm2835_cpufreq: Only attach driver if we correcly match on the machine
compatible string.
2016-09-30 10:00:57 +00:00
Michal Meloun
b58616d5d7 ALLWINNER: ahci_devclass is local variable, don't export it. 2016-09-30 05:30:16 +00:00
Michal Meloun
4bda238a9b TEGRA: Prepare Tegra subtree for inclusion into ARM generic kernel.
- use DEFINE_CLASS_0() for driver classes
 - unify driver names
 - cleanup driver definitions and bindings
2016-09-30 05:25:15 +00:00
Andrew Turner
caa1c435de Use SV_ABI_ERRNO to set the syscall return value. The Linuxulator will
need this.

Submitted by:	Grégory Soutadé <soutade@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D7976
2016-09-29 17:13:17 +00:00
Michal Meloun
1d59a5bb1b TEGRA: Rename (cut & pasted) genahci to tegra_ahci. Make device class definition static. 2016-09-29 13:54:09 +00:00
Michal Meloun
114abe7615 TEGRA: Return back kern_clocksource.c into tegra config file. It was removed in r306444 by mistake. 2016-09-29 12:54:27 +00:00
Michal Meloun
ef3639e852 TEGRA: Don't include files already included by system or arch configs. 2016-09-29 12:25:04 +00:00
Michal Meloun
92fa5c23d9 TEGRA: Add support for MULTIDELAY option. 2016-09-29 11:13:51 +00:00
Andrew Turner
6c78e95a80 Remove struct platform_data, it was never used.
Sponsored by:	ABT Systems Ltd
2016-09-29 08:49:12 +00:00
Emmanuel Vadot
10912ba837 RPI2: Add support for PLATFORM_SMP so we can later add it to GENERIC.
Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D8063
2016-09-29 06:54:02 +00:00
Emmanuel Vadot
0c051204d7 RPI-B: Add support for MULTIDELAY
100 cycles per us seems accurate enough, at least it's better than the 200 value
that was used before.

Reviewed by:	andrew, imp
Differential Revision:	https://reviews.freebsd.org/D8062
2016-09-29 06:49:59 +00:00
Oleksandr Tymoshenko
32cb200f78 Add touchscreen support for the official 7" RPi touch display
Technically touchscreen chip is FT5406 but all hardware
communication is performed by VideCore and only final results
are presented to ARM part through memory region shared between
VC and ARM.

evdev is used as userland interface. FT5406 supports up to
10 touchpoints, but for now driver emulates single touch device
because I do not have GUI bits to test this functionality.

Driver is not enabled in default config for RPI and RPI2

Tested with: evdev-dump, tslib
2016-09-29 02:14:08 +00:00
Luiz Otavio O Souza
5de11ef951 Fix a typo.
Pointy hat to:	loos
2016-09-28 04:22:06 +00:00
Luiz Otavio O Souza
feeb22f34a Add a sysctl to control the interrupt pacing on AM335x integrated switch.
The hardware can be set to limit the number of interrupts from 2 to 63
interrupts per ms.

To keep the compatibility with the TI documentation the sysctl take the
interval between the interrupts pulses: 16~500 us.

Sponsored by:	Rubicon Communications, LLC (Netgate)
2016-09-27 18:19:29 +00:00
Oleksandr Tymoshenko
ee484d5bd3 Update PCI driver to match new dts tree
In new dts tree phy is a property of port, not the controller node, also
the name was changed from "pcie" to "pcie-0"
2016-09-25 23:48:15 +00:00
Oleksandr Tymoshenko
23ea1f2b1d Update AHCI driver to match new dts tree
phy name parameter was changed from "sata-phy" to "sata-0" in new dts tree
introduced in r306197
2016-09-25 23:45:49 +00:00
Andrew Turner
b9413b5512 Add the start of a GENERIC armv6 kernel config. This supports the Allwinner
SMP SoCs and qemu virt. Further SoCs can be supported if they support the
PLATFORM, PLATFORM_SMP, and MULTIDELAY options.

Tested by:	manu
Sponsored by:	ABT Systems Ltd
2016-09-25 07:48:08 +00:00
Andrew Turner
eb2035b562 Also implement platform_cpu_reset on bcm2836 2016-09-23 15:28:15 +00:00
Andrew Turner
0a4c0732a9 Restrict where we need to define fdt_fixup_table to just PowerPC and
Marvell.

Sponsored by:	ABT Systems Ltd
2016-09-23 14:11:23 +00:00