summaryrefslogtreecommitdiffstats
path: root/sys/arm
Commit message (Collapse)AuthorAgeFilesLines
* Improve ARM debug_monitor for SMP machineszbb2016-05-293-53/+65
| | | | | | | | | | | - Reset debug architecture and enable monitor for secondary CPUs in init_secondary() rather than when configuring watchpoint, etc. - Disable HW debugging capabilities when one of the CPU cores fails to set up. - Use dbg_capable() in a more atomic manner to avoid any mismatch between CPUs. Differential Revision: https://reviews.freebsd.org/D6009
* Fix debug_monitor code for older ARMs (ARM11)zbb2016-05-291-75/+29
| | | | | | | | | | | | | - Enable monitor mode prior to accessing watchpoint registers for v6, v6.1 architectures. - Fix configuration scheme for v6, v6.1 and v7 Debug Archs - Enable monitor unconditionally and for good instead of enabling and disabling it (needed for single stepping on on v6/v6.1) Tested on RPI-B and Arndale Differential Revision: https://reviews.freebsd.org/D6008
* ARM GIC: Allow to setup interrupt without configuration data.mmel2016-05-291-2/+5
| | | | | In some cases, like for PCI devices, only interrupt numbers are enumerated from HW. In this case, use INTR_foo_CONFORM as level and trigger values.
* Add support for triggering interrupts on both rising and falling edges.ian2016-05-261-39/+67
| | | | Also, EOI a gpio interrupt in the post_ithread routine before re-enabling.
* Add support for interrupts, sensors and GPIO for AXP209 PMIC.manu2016-05-262-44/+694
| | | | | | | | | | | | | | | | | Pressing the PEK (power enable key) will shutdown the board. Some events are reported to devd via system "PMU" and subsystem "Battery", "AC" and "USB" such as connected/disconnected. Some sensors values (power source voltage/current) are reported via sysctl (dev.axp209_pmu.X.) It also expose a gpioc node usable in kernel and userland. Only 3 of the 4 GPIO are exposed (The GPIO3 is different and mostly unused on boards). Most popular boards uses GPIO1 as a sense pin for OTG power. Add a dtsi file that adds gpio-controller capability to the device as upstream doesn't defined it and include it in our custom DTS. Reviewed by: jmcneill Approved by: cognet (mentor) Differential Revision: https://reviews.freebsd.org/D6135
* Only do the touch screen setup when the 'ti,wires' property is present.loos2016-05-261-2/+2
| | | | While here fix a typo in a debug message.
* Enable USB PHY regulators when requested by the host controller driver.jmcneill2016-05-262-13/+115
| | | | | | Previously the USB PHY driver would enable all regulators at attach time. This prevented boards from booting when powered by the USB OTG port, as it didn't take VBUS presence into consideration.
* Another round of changes to add compatibility with the older ESHDC varietyian2016-05-261-82/+160
| | | | | | | | | | | | | | | | | of hardware. Mostly this focuses on the big changes needed for setting the bus clock, because ESDHC is SDHCI v2.0 and USDHC is 3.0, and the number, location, and interpretation of clock divisor bits is vastly different between the two. This doesn't get the device all the way to functioning on ESDHC hardware yet, but it's much closer, now getting through all the card detection and negotiation of capabilties and speed (but it eventually hangs on what appears to be a missing interrupt). Another missing chunk of code for handling ESDHC's 32 bit command-and-mode register using sdhci's pair of 16 bit writes is added. This also does some leading whitespace cleanups and sorts some softc struct members by size, and adds some comments (because when do I ever touch code without adding comments?).
* Disable alignment faults on armv6, adjust various alignment-related macrosian2016-05-264-2/+18
| | | | | | | | | to match the new state of affairs. The hardware we support has always been able to do unaligned accesses, we've just never enabled it until now. This brings FreeBSD into line with all the other major OSes, and should help with the growing volume of 3rd-party software that assumes unaligned access will just work on armv6 and armv7.
* Include machine/acle-compat.h in cdefs.h on arm if the compiler doesn'tian2016-05-2539-48/+0
| | | | | | | | | | | | | | | | | | | | | | have ACLE support built in. The ACLE (ARM C Language Extensions) defines a set of standardized symbols which indicate the architecture version and features available. ACLE support is built in to modern compilers (both clang and gcc), but absent from gcc prior to 4.4. ARM (the company) provides the acle-compat.h header file to define the right symbols for older versions of gcc. Basically, acle-compat.h does for arm about the same thing cdefs.h does for freebsd: defines standardized macros that work no matter which compiler you use. If ARM hadn't provided this file we would have ended up with a big #ifdef __arm__ section in cdefs.h with our own compatibility shims. Remove #include <machine/acle-compat.h> from the zillion other places (an ever-growing list) that it appears. Since style(9) requires sys/types.h or sys/param.h early in the include list, and both of those lead to including cdefs.h, only a couple special cases still need to include acle-compat.h directly. Loves it: imp
* Add more info about the issue fixed in r298460. Rephrase some sentencesskra2016-05-251-8/+15
| | | | | | | | | and fix grammar. No functional change. Suggested by: alc Reviewed by: alc
* Spaces->tab in comment.ian2016-05-231-1/+1
|
* Oops, fix a paste-o commited in r300533.ian2016-05-231-1/+1
|
* Use the new(-ish) CP15_SCTLR macro to generate system control reg accessesian2016-05-2310-43/+41
| | | | | | | | | where possible. In the places that doesn't work (multi-line inline asm, and places where the old armv4 cpufuncs mechanism is used), annotate the accesses with a comment that includes SCTLR. Now a grep -i sctlr can find all the system control register manipulations. No functional changes.
* INTRNG - support new interrupt mapping type INTR_MAP_DATA_GPIOskra2016-05-231-25/+65
| | | | | | introduced in r298738. Reviewed by: ian
* INTRNG - use gpio generic interrupt modes definitions added in r298738.skra2016-05-231-47/+31
| | | | Reviewed by: ian
* Fix the deciKelvin to Celsius conversion in kernel.loos2016-05-224-4/+4
| | | | | | | | | | | After r285994, sysctl(8) was fixed to use 273.15 instead of 273.20 as 0C reference and as result, the temperature read in sysctl(8) now exibits a +0.1C difference. This commit fix the kernel references to match the reference value used in sysctl(8) after r285994. Sponsored by: Rubicon Communications (Netgate)
* INTRNG - implement pic_post_filter method. This method is fundamentalskra2016-05-221-0/+6
| | | | | one and must always be implemented for a PIC. There is no default for it intentionally.
* Fix some format strings to make them either correct or uniform.skra2016-05-221-3/+3
| | | | No functional change.
* Adjust _ALIGNBYTES to the proper value for arm and armv6 arches. Modernian2016-05-211-4/+4
| | | | | | | | | | | | | | | | | | | | | | | compilers can emit arm instructions that require 8-byte alignment. The alignment-sensitive instructions were added in armv5, which has to be supported by our combined v4/v5 kernels, so the value is set uncoditionally for all arm architecture versions. Also adjust the comment to explain in more detail why the macros have the form and values they do. Per advice from bde@, maintain the unsignedness of the value of _ALIGNBYTES (but do so using his second choice of allowing sizeof() to supply the unsignedness, rather than just hardcoding '8U', which in my mind would require an even more verbose comment to explain why it's right). Also explain in the comment that the resulting type of _ALIGN() is equivelent to uinptr_t on arm (32-bit unsigned int), but it's purposely spelled as "unsigned" to avoid problems with including other header files. Even including machine/_types.h to allow use of __uintptr_t causes compilation failures because of this header being included (indirectly) in asm code. The discussion that led to this change (albeit at a glacial pace) is at https://lists.freebsd.org/pipermail/svn-src-head/2014-November/064593.html
* Remove hf appending code from param.h for machine arch name.imp2016-05-201-7/+1
| | | | Submitted by: ian@ andyt@
* Use OF_prop_free instead of direct call to free(9)gonzo2016-05-186-17/+17
| | | | Reviewed by: ganbold
* Return the struct intr_pic pointer from intr_pic_register. This will beandrew2016-05-1812-21/+36
| | | | | | | | needed in later changes where we may not be able to lock the pic list lock to perform a lookup, e.g. from within interrupt context. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation
* Implement atomic_cmpset_acq_64 and atomic_cmpset_rel_64 on arm and armeb.andrew2016-05-181-0/+2
| | | | | | This should allow r300113 to build there. Sponsored by: ABT Systems Ltd
* Add driver for "generic-ohci" as defined by FDT.manu2016-05-173-2/+4
| | | | | | | | | | | | If platform support EXT_RESOURCES, clocks and resets are handled out of the box. If not driver can be subclassed using the generic_usb interface. generic_usb name was choosed because at one point I'll add generic-ehci FDT driver. Reviewed by: jmcneill, hselasky Approved by: andrew (mentor) Differential Revision: https://reviews.freebsd.org/D5481
* The GIC (v2 at least) has a bit in the TYPER register to indicate whether ↵bz2016-05-171-5/+11
| | | | | | | | | | | | | | | the GIC supports the Security Extensions or not. This bit is not the same as the CPU one. Currently we are not checking for either before trying to write to the special registers. This can lead to problems on hardware or simulators that do not provide the security extensions. Add the missing checks. Their interactions with the CPU flag is not entirely clear to me but using a macro will make it easier to quickly adjust the condition once the CPU bits are sorted as well. Reviewed by: br Sponsored by: DARPA/AFRL Differential Revision: https://reviews.freebsd.org/D6397
* Don't repeat the the word 'the'eadler2016-05-173-3/+3
| | | | | | | (one manual change to fix grammar) Confirmed With: db Approved by: secteam (not really, but this is a comment typo fix)
* Add HWPMC_HOOKS to std.armv6 to make them availablebz2016-05-162-1/+1
| | | | | | | | | so the module could be loaded. Discussed with: andrew Reviewed by: andrew Sponsored by: DARPA/AFRL Differential Revision: https://reviews.freebsd.org/D6359
* Introduce MSI and MSI-X support to intrng. This adds a new msi deviceandrew2016-05-161-20/+246
| | | | | | | | | | | | interface with 5 methods to mirror the 5 MSI/MSI-X methods in the pcib interface. The pcib driver will need to perform a device specific lookup to find the MSI controller and pass this to intrng as the xref. Intrng will finally find the controller and have it handle the requested operation. Obtained from: ABT Systems Ltd MFH: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5985
* Add Allwinner A83T thermal sensor controller support.jmcneill2016-05-154-0/+403
| | | | | | | | | | | The A83T thermal sensor controller has three sensors. Sensor 0 corresponds to CPU cluster 0, sensor 1 to CPU cluster 1, and sensor 2 to the GPU. This driver exports the temperature sensor readings via sysctl. Calibration data is obtained from SRAM found in the Secure ID module. Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D6378
* Reduce complexity of RSB by always using polling mode. Unfortunatelyjmcneill2016-05-152-66/+13
| | | | | | gpiobus methods can be called with non-sleepable locks held. Reviewed by: mmel
* Add support for the AXP813/AXP818 power key and GPIO pins.jmcneill2016-05-151-1/+351
|
* Allow RSB to be used from interrupt handlers.jmcneill2016-05-151-3/+16
| | | | | The driver uses polling mode if cold or !THREAD_CAN_SLEEP() and now implements the bus_* interface.
* TEGRA: Also attach gpioc to tegra_gpio driver. Forgotten in r299854.mmel2016-05-151-1/+4
|
* TEGRA: Don't use common name 'iicb' for tegra specific IIC driver.mmel2016-05-151-2/+6
| | | | Using commn name for different drivers breaks generic kernel creation.
* TEGRA: Don't use common name 'gpio' for tegra specific GPIO driver.mmel2016-05-151-1/+6
| | | | Using commn name for different drivers breaks generic kernel creation.
* Allow arm generic_timer code to be included even if not present in themanu2016-05-151-1/+2
| | | | | | | | SoC. Reviewed by: andrew Approved by: cognet (mentor) Differential Revision: https://reviews.freebsd.org/D6372
* Add and enable Allwinner RSB and AXP81x power management IC drivers.jmcneill2016-05-142-0/+4
|
* Add a basic driver for X-Powers AXP813 and AXP818 power management ICs.jmcneill2016-05-141-0/+180
| | | | | This driver simply installs a shutdown event handler for handling RB_POWEROFF at shutdown. Tested on a Sinovoip BananaPi BPI-M3.
* Add a driver for the Allwinner Reduced Serial Bus (RSB).jmcneill2016-05-141-0/+506
| | | | | | | | | | The RSB controller speaks a simplified two wire protocol at speeds up to 20MHz. It is used on sun8i and sun9i family SoCs to communicate with power management ICs. RSB isn't really I2C or SMBus, but the driver exposes an iicbus interface to simplify power management IC drivers (which may need to support both RSB and I2C connectivity).
* Update comment at top of file to mention all currently supported Allwinnerjmcneill2016-05-141-1/+2
| | | | SoCs. Previously mentioned A20 and A31, added A31S, A83T, and H3.
* Use OF_prop_free instead of direct call to free(9)gonzo2016-05-145-9/+9
| | | | Reviewed by: mmel@
* Use OF_prop_free instead of direct call to free(9)gonzo2016-05-136-12/+12
| | | | Approved by: jmcneill
* Use OF_prop_free instead of direct call to free(9)gonzo2016-05-133-5/+5
|
* Add support for Allwinner H3 SoC.manu2016-05-1315-0/+306
| | | | | | | | | For now clocks, GPIO, Pinmux, UART, MMC, EHCI is supported. Tested on OrangePi-One Reviewed by: jmcneill Approved by: cognet (mentor) Differential Revision: https://reviews.freebsd.org/D6311
* Add OF_prop_free function as a counterpart for OF_*prop_allocgonzo2016-05-115-12/+12
| | | | | | | | | | | | | | | | - Introduce new OF API function OF_prop_free to free memory allocated by OF_getprop_alloc and OF_getencprop_alloc. Current code just calls free(9) with M_OFWPROP memory class which assumes knowledge about OF_*prop_alloc functions' internals and leads to unneccessary code coupling - Convert some of the free(..., M_OFWPROP) instances to OF_prop_free Files affected by this commit are the ones I was able to test on real hardware. The rest of free(..., M_OFWPROP) instances will be handled with idividual maintainers Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D6315
* Pass device tree node as a part of gpio_pin_get_by_ofw_XXX APIgonzo2016-05-101-3/+3
| | | | | | | | | | | Current API assumes that "gpios" property belongs to the device's node but for some binding it's not true: gpiokeys has set of child nodes with this property. Patch adds new argument instead of replacing device_t because device_t will be used to track ownership for allocated pins Reviewed by: mmel Differential Revision: https://reviews.freebsd.org/D6277
* When PLATFORM_SMP is enabled, check if tunable hw.ncpu is set and validmanu2016-05-101-0/+8
| | | | | | | (>= 1 and <= real ncores) and set mp_ncpus to it. Approved by: andrew (mentor) Differential Revision: https://reviews.freebsd.org/D6151
* Merge a20_mp_start_ap and a31_mp_start_ap into one function.manu2016-05-103-43/+27
| | | | | | | This function works with all smp non-multicluster allwinner SoC (A20, A31, A31S and H3). Approved by: cognet (mentor) Differential Revision: https://reviews.freebsd.org/D6269
* INTRNG - update gpio pin capabilities according to r299198.skra2016-05-081-0/+8
|
OpenPOWER on IntegriCloud