aboutsummaryrefslogtreecommitdiff
path: root/sys/arm/mv/gpio.c
Commit message (Collapse)AuthorAgeFilesLines
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-271-1/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* arm mv: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-091-3/+1
|
* arm: Use __diagused for variables only used in KASSERT().John Baldwin2022-04-131-1/+1
|
* Remove the pre-ARMv6 and pre-INTRNG code.Michal Meloun2020-11-291-2/+0
| | | | | | | | ARM has required ARMV6+ and INTRNg for some time now, so remove always false #ifdefs and unconditionally do always true #ifdefs. Notes: svn path=/head/; revision=368141
* arm: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-1/+0
| | | | Notes: svn path=/head/; revision=365068
* Add specialized gpio driver for ARMADA 8k SoC.Michal Meloun2020-06-191-6/+0
| | | | | | | | | | Older marvell gpio blocks are to different for reusing/enhancing existing frivers. MFC after: 2 weeks Notes: svn path=/head/; revision=362385
* mv_gpio: Since it's also an interrupt controller, attach soonerEmmanuel Vadot2018-12-121-1/+2
| | | | | | | Sponsored by: Rubicon Communications, LLC ("Netgate") Notes: svn path=/head/; revision=342018
* arm64: mv_gpio: Add Marvell 8K supportEmmanuel Vadot2018-12-121-69/+101
| | | | | | | | | While here put the interrupts setup in it's own function Sponsored by: Rubicon Communications, LCC ("Netgate") Notes: svn path=/head/; revision=342013
* follow-up to r336635, update TAILQ to CK_SLIST for ie_handlersAndriy Gapon2018-07-231-1/+2
| | | | | | | arm, mips and sparc64 were affected. Notes: svn path=/head/; revision=336639
* Replace FDT tree parsing with gpio_map_gpios implementation in mv_gpio driverMarcin Wojtas2018-04-261-121/+25
| | | | | | | | | | | | | | | This patch replaces in-driver FDT parsing, which was needed for setting initial values on GPIO pins. Now FDT is parsed by generic kernel code, pins are set by invoking gpio_map_gpios method. Submitted by: Patryk Duda <pdk@semihalf.com> Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14757 Notes: svn path=/head/; revision=333032
* Update mv_gpio driver to new FreeBSD APIMarcin Wojtas2018-04-261-81/+238
| | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=333031
* Enable Marvell gpio driver to work with many controllersMarcin Wojtas2018-04-041-281/+302
| | | | | | | | | | | | | | | | This patch moves all global data structures into mv_gpio_softc, and puts device_t parameter to functions calls everywhere where needed. As a result, we can create multiple driver instances. Removed names in function declaration to keep style. Submitted by: Patryk Duda <pdk@semihalf.com> Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14755 Notes: svn path=/head/; revision=332024
* Improve interrupt and resource allocation in Marvell GPIO driverMarcin Wojtas2018-04-041-16/+86
| | | | | | | | | | | | | | | | | This patch adds support for more than one interrupts in GPIO controller. It reads necessary information (such as cell size) from FDT, so there are no magic numbers. Note that interrupts are still not working, but this patch makes one good step in correct direction Submitted by: Patryk Duda <pdk@semihalf.com> Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14754 Notes: svn path=/head/; revision=332021
* Introduce port debouncing mechanism in mv_gpio driverMarcin Wojtas2018-04-041-50/+425
| | | | | | | | | | | | | | | | | | This patch introduces gpio debouncing mechanism with fixed memory allocation in critical section. When you press button, value at gpio pin connected to button is changing many times which will cause in unexpected behaviour. Debouncing mechanism will prevent this phenomenon Submitted by: Patryk Duda <pdk@semihalf.com> Wojciech Macek <wma@semihalf.com> Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14753 Notes: svn path=/head/; revision=332020
* sys/arm: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326258
* Use the correct OF_getencprop over OF_getprop + fdt32_to_cpu to readAndrew Turner2016-11-141-12/+10
| | | | | | | | | integer data from the device tree. Sponsored by: ABT Systems Ltd Notes: svn path=/head/; revision=308640
* Use the modern spelling of ofw_bus_node_is_compatible in sys/arm.Andrew Turner2016-11-111-1/+1
| | | | | | | Sponsored by: ABT Systems Ltd Notes: svn path=/head/; revision=308531
* Stop using machine/fdt.h in the arm kernel code when we don't need it.Andrew Turner2015-04-041-1/+0
| | | | Notes: svn path=/head/; revision=281085
* Rename OF_xref_phandle() to OF_node_from_xref() and add a new functionIan Lepore2014-09-011-1/+1
| | | | | | | | | that provides the inverse translation, OF_xref_from_node(). Discussed with: nwhitehorn Notes: svn path=/head/; revision=270945
* Rename platform_gpio_init to be platform specific, and make it static asAndrew Turner2014-05-101-3/+4
| | | | | | | it's only used from this file. Notes: svn path=/head/; revision=265854
* Follow r261352 by updating all drivers which are children of simplebusIan Lepore2014-02-021-0/+3
| | | | | | | | | | | | | | | | to check the status property in their probe routines. Simplebus used to only instantiate its children whose status="okay" but that was improper behavior, fixed in r261352. Now that it doesn't check anymore and probes all its children; the children all have to do the check because really only the children know how to properly interpret their status property strings. Right now all existing drivers only understand "okay" versus something- that's-not-okay, so they all use the new ofw_bus_status_okay() helper. Notes: svn path=/head/; revision=261410
* Typo while reviewing diffs. Sorry for the breakage!Nathan Whitehorn2013-10-231-1/+1
| | | | Notes: svn path=/head/; revision=257015
* Remove OF_instance_to_package() hack for FDT and replace with use of theNathan Whitehorn2013-10-231-4/+1
| | | | | | | | generic OF_xref_phandle() API universally. Also replace some related explicit uses of fdt32_to_cpu() with OF_getencprop() calls. Notes: svn path=/head/; revision=256967
* Fix a bug that could fail to initialize GPIO pins specified in "gpios" becauseHiroki Sato2012-08-181-1/+1
| | | | | | | "gpio-controller" property at the controller node was always ignored. Notes: svn path=/head/; revision=239367
* Add support for Marvell 88F6282.Hiroki Sato2012-07-281-1/+2
| | | | | | | Sponsored by: Plat'Home, Co.,Ltd. Notes: svn path=/head/; revision=238873
* Do not call platform_gpio_init() early. It doesn't work because we doMarcel Moolenaar2011-07-151-20/+1
| | | | | | | | | not have enough information to reliably setup GPIO pins. Do it when we attach the gpio driver. This prevents hangs and the need to fake up a softc. Notes: svn path=/head/; revision=224051
* Fix mv_gpio_in() for pin numbers that occupy bits 8-31 in GPIO registers.Marcel Moolenaar2011-03-161-1/+1
| | | | | | | | | The compiler will truncate the 32-bit return value of mv_gpio_value_get() to match the 8-bit return value of mv_gpio_in(). A conditional expression is used to have mv_gpio_in() always return 0 or 1 instead. Notes: svn path=/head/; revision=219684
* Remove use_high from the softc and simply check the number of GPIOMarcel Moolenaar2011-02-071-7/+3
| | | | | | | | | pins to determine whether there's a high register set or not. This allows platform_gpio_init() to work without duplicating the work done in the attach method. Notes: svn path=/head/; revision=218388
* - Add a proper return value to mv_gpio_intr().John Baldwin2011-01-061-4/+5
| | | | | | | - Remove an obsolete use of INTR_FAST. Notes: svn path=/head/; revision=217069
* Convert Marvell ARM platforms to FDT convention.Rafal Jaworowski2010-06-131-28/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The following systems are involved: - DB-88F5182 - DB-88F5281 - DB-88F6281 - DB-78100 - SheevaPlug This overhaul covers the following major changes: - All integrated peripherals drivers for Marvell ARM SoC, which are currently in the FreeBSD source tree are reworked and adjusted so they derive config data out of the device tree blob (instead of hard coded / tabelarized values). - Since the common FDT infrastrucutre (fdtbus, simplebus) is used we say good by to obio / mbus drivers and numerous hard-coded config data. Note that world needs to be built WITH_FDT for the affected platforms. Reviewed by: imp Sponsored by: The FreeBSD Foundation. Notes: svn path=/head/; revision=209131
* Adjust Marvell Discovery (MV78xxx) support to recognize newest chip revisions,Rafal Jaworowski2009-04-161-3/+4
| | | | | | | | | handle Z0 revision (early silicon) explicitly due to its quirks. Obtained from: Marvell, Semihalf Notes: svn path=/head/; revision=191140
* Improve and extend Marvell SOCs platform code.Rafal Jaworowski2009-01-081-8/+20
| | | | | | | | | | | | | | | | | | - Allow for setting per platform MPP/GPIO configuration in the kernel, so that we can override all settings firmware might set. - Set decode windows for the remaining on-chip peripherals: CESA, SATA and XOR. - Improve handling of USB controllers so that all port are available on the given SOC/platform (e.g. up to three on DB-78xxx), this includes rework of USB decode windows set-up. - Other minor fixes and cosmetics. Obtained from: Semihalf Notes: svn path=/head/; revision=186909
* Minor style(9) corrections.Rafal Jaworowski2009-01-081-6/+6
| | | | Notes: svn path=/head/; revision=186901
* Introduce basic support for Marvell families of system-on-chip ARM devices:Rafal Jaworowski2008-10-131-0/+516
* Orion - 88F5181 - 88F5182 - 88F5281 * Kirkwood - 88F6281 * Discovery - MV78100 The above families of SOCs are built around CPU cores compliant with ARMv5TE instruction set architecture definition. They share a number of integrated peripherals. This commit brings support for the following basic elements: * GPIO * Interrupt controller * L1, L2 cache * Timers, watchdog, RTC * TWSI (I2C) * UART Other peripherals drivers will be introduced separately. Reviewed by: imp, marcel, stass (Thanks guys!) Obtained from: Marvell, Semihalf Notes: svn path=/head/; revision=183840