aboutsummaryrefslogtreecommitdiff
path: root/sys/arm/allwinner
Commit message (Collapse)AuthorAgeFilesLines
* aw_mmc: Reset cardTom Jones2026-02-092-0/+12
| | | | | | | | | | | | | | | On H616 (and I think H6, but this isn't verified) we need to reset the card to have a functioning device. With this commit all my pending patches for H616 are in tree. We run well on my test device (Orange Pi Zero3), however there is an uninvestigated issue with ethernet and graphics are an open question. Reviewed by: manu, adrian MFC After: 1 week Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D55097
* if_awg: Add H616 compat stringTom Jones2026-02-091-0/+2
| | | | | | Reviewed by: manu Sposored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54907
* aw_sid: Add H616 configuration and compat stringTom Jones2026-02-091-0/+27
| | | | | | Reviewed by: manu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54916
* aw_gpio: Add support for H616Tom Jones2026-02-093-0/+158
| | | | | | | | | This adds padconf files for the two gpio ranges on the H616 SOC and adds the SOC include. Reviewed by: manu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54915
* aw_wdog: Add support for H616Tom Jones2026-02-091-3/+27
| | | | | | Reviewed by: manu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54913
* aw_usbphy: Add H616 compat string and configurationTom Jones2026-02-091-0/+9
| | | | | | Reviewed by: manu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54912
* aw_rsb: Add H616 compat stringTom Jones2026-02-091-0/+3
| | | | | | Reviewed by: manu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54911
* aw_cir: Add H616 compat stringTom Jones2026-02-091-0/+3
| | | | | | Reviewed by: manu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54910
* aw_mmc: Add H616 mmc and emmc configTom Jones2026-02-091-0/+14
| | | | | | Reviewed by: manu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54909
* aw_rtc: Add H616 compat stringTom Jones2026-02-091-0/+1
| | | | | | Reviewed by: manu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54908
* aw_rtc: bump settime() delaysMitchell Horne2025-12-151-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | There are delay loops, checking the BUSY status bit, before writing to the date or time registers. Each iteration contains a 1usec delay, for a maximum of 70 iterations. This is frequently not enough on the D1 platform, where the message is emitted: rtc0: could not set date, RTC busy Bump the loop delay to 10usecs each, and the maximum number of iterations to 150, for a maximum delay of 1.5msecs between each write of the register. In my testing this seems to be adequate. The loop variable is renamed for clarity/simplicity. Reviewed by: manu MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54180
* sound: Retire snd_mtx* wrappersChristos Margiolis2025-11-211-5/+5
| | | | | | | | | | | | Do not create mutexes with snd_mtxcreate(). It doesn't provide any value, plus it first allocates the mutex with malloc(9). Allocate mutexes in the stack and use mtx_* functions directly instead of the snd_mtx* wrappers. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D53855
* sound: Get rid of useless sndbuf getters and settersChristos Margiolis2025-11-112-5/+5
| | | | | | | | No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53528
* style(9): white space after ; and around binary operatorsDavid E. O'Brien2025-10-161-1/+1
| | | | | | | in for() loops. Also, use 'while', where only the conditional test of 'for' was used. Reviewed by: sjg
* gpio: implement bus_setup_intr and bus_teardown_intrAhmad Khalifa2025-09-301-0/+4
| | | | | | | | | | | Implement bus_setup_intr and bus_teardown_intr as bus_generic_setup_intr and bus_generic_teardown_intr respectively for GPIO drivers that support interrupts. This allows children to setup interrupts. Reported by: Evgenii Ivanov <devivanov@proton.me> Reviewed by: imp MFC after: 1 day Differential Revision: https://reviews.freebsd.org/D52197
* gpio: remove gpiobus_attach_busAhmad Khalifa2025-08-133-4/+7
| | | | | | | | | | | | Since gpiobus_attach_bus can attach the gpiobus child along with its children in the same bus pass, the parent controller's reference to gpiobus might not be set by the time the children need it. Instead, drivers should use gpiobus_add_bus and explicitly call bus_attach_children. Reviewed by: mmel, imp (older version) Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D51578
* aw_mmc: changes for Allwinner D1Julien Cassette2025-07-221-7/+26
| | | | | | | | | | | | Necessary driver changes to run on the platform: - DMA descriptors need shifting - Add quirk for max-sized transfers - Add compatible string Co-authored-by: br Co-authored-by: mhorne MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D51197
* riscv: enable allwinner RTCMitchell Horne2025-07-041-8/+21
| | | | | | | | | | | | | | | | | | | | | (Second attempt.) For the Allwinner D1 (Nehza) SBC. This RTC driver is also a clock provider, which registers two fixed clocks. In all the devices we currently support, the names of the clocks are present in the "clock-output-names" property of the device tree. This is not the case for the D1 DTS, as this property does not appear in upstream. Therefore the clock definitions are statically assigned a name, which is overridden when specified. The driver also supports the older A10/A20 models, which don't export any clocks. Ensure this case is handled properly. Reviewed by: mmel Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50369
* gpio: attach gpiobus when the controller is readyAhmad Khalifa2025-07-041-4/+4
| | | | | | | | | | Only attach gpiobus when the controller is fully initialized. Children of gpiobus expect this to be the case. Reviewed by: mmel, imp, andrew Approved by: imp (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D51088
* mmc: Use bus_topo_lock and taskqueue_bus while adding/removing child devicesJohn Baldwin2025-03-101-7/+4
| | | | | | | | | | | Some drivers held regular mutexes across some new-bus calls; instead depend on bus_topo_lock to protect the relevant softc members. This also fixes the bus_topo_lock to be explicit in these drivers rather than relying on the implicit Giant from taskqueue_swi_giant. It avoids calling sleepable routines like device_probe_and_attach from an swi context. Differential Revision: https://reviews.freebsd.org/D49270
* Revert "riscv: enable allwinner RTC"Mitchell Horne2025-03-041-16/+8
| | | | | | | | | | It caused a regression on A10/A20 platforms. Revert until the proper fix can be determined. This reverts commit 9ddd516b886218af809dbf40eeda1ed388e2879c. PR: 285054 Reported by: mmel
* riscv: aw_timer enablement for D1Mitchell Horne2025-01-271-10/+29
| | | | | | | | | | | | | | The SBI timer functionality is partially broken on the Allwinner D1, so we require this driver to provide an eventtimer/system timer interrupts. The timecounter interface, on the other hand, is not required. The generic RISC-V timer driver uses the native rdtime instruction, and implements vdso, so this should be preferred. Reviewed by: manu, ganbold MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48672
* aw_timer: rename driver from a10_timerMitchell Horne2025-01-272-56/+56
| | | | | | | | | | | | | This reflects its expanded support for platforms other than the A10. Functions specific to A10/A13 retain the a10 prefix, but the majority of names in the driver are changed, e.g. a10_timer_softc becomes aw_timer_softc. Reviewed by: manu, ganbold MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48671
* a10_timer: some tidying/re-organizationMitchell Horne2025-01-271-39/+51
| | | | | | | | | | | | | In preparation for enabling the driver on the D1 platform (riscv). - Better isolate armv7-only portions of the driver - Move a10 timecounter setup into a helper function - Small style tweaks Reviewed by: manu, ganbold MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48670
* riscv: enable Allwinner D1 USB driversMitchell Horne2025-01-101-0/+9
| | | | | | | | | | | Add the generic USB drivers and FDT glue to the build. Make small tweaks to the aw_usbphy and aw_musb drivers for the Allwinner D1. Reviewed by: manu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48126
* Remove now-redundant calls to device_delete_childJohn Baldwin2025-01-021-4/+1
| | | | | | | | Deleting a child explicitly before calling bus_generic_detach is now redundant, so remove those calls and rely on bus_generic_detach to delete children instead. Differential Revision: https://reviews.freebsd.org/D47961
* Use device_delete_children instead of explicit calls to device_delete_childJohn Baldwin2025-01-021-7/+1
| | | | | | | | | This is simpler and more robust in the face of potential double-frees (e.g. if called after bus_generic_detach which will delete devices in a future commit). Reviewed by: manu, imp Differential Revision: https://reviews.freebsd.org/D47958
* aw_gpio: Add a missing commaZhenlei Huang2024-12-121-1/+1
| | | | | | This unbreaks arm build after commit 719245455853. Fixes: 719245455853 aw_gpio: support Allwinner D1 GPIO
* aw_gpio: support Allwinner D1 GPIOJulien Cassette2024-12-102-31/+109
| | | | | | | | | | | | | | | | | | | The GPIO controls the multiplexing of the D1 pins to its peripherals, so this adds the definitions needed by the aw_gpio driver to support the D1. Also, this modifies the aw_gpio driver to support the differences of the D1 controller: - pins can have up to 15 functions - each port is mapped with an alignment of 0x30 - CFG registers have 4 bits per pin - DRV registers have 4 bits per pin - the offset of PULL registers is 0x24 Signed-off-by: Julien Cassette <julien.cassette@gmail.com> Reviewed by: mhorne Differential Revision: https://reviews.freebsd.org/D35593
* riscv: enable Allwinner if_awgMitchell Horne2024-12-102-0/+29
| | | | | | | | | | | Enable the driver and dependencies (aw_sid, nvmem). Add compat strings, etc. Found on the Allwinner D1. Reviewed by: manu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47923
* Replace calls to bus_generic_attach with bus_attach_childrenJohn Baldwin2024-12-061-1/+1
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47675
* aw_wdog: disable timer on attachMitchell Horne2024-11-161-0/+3
| | | | | | | | | | | Otherwise it may cause system reset before the watchdog can be pat. This is consistent with other watchdog drivers. Tested on Allwinner D1. Reviewed by: manu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47517
* aw_syscon: enable for Allwinner D1 (riscv)Mitchell Horne2024-11-161-0/+1
| | | | | | | | | Add the relevant compatible string and build glue. Update the man page with relevant compat strings. Reviewed by: manu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47516
* riscv: enable allwinner RTCMitchell Horne2024-11-161-8/+16
| | | | | | | | | | | | | | | For the Allwinner D1 (Nehza) SBC. This RTC driver is also a clock provider, which registers two fixed clocks. In all the devices we currently support, the names of the clocks are present in the "clock-output-names" property of the device tree. This is not the case for the D1 DTS, as this property does not appear in upstream. Therefore the clock definitions are statically assigned a name, which is overridden when specified. Reviewed by: manu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47514
* sound: Make device registration more intuitiveChristos Margiolis2024-11-031-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | The way a sound driver currently registers to sound(4) is using the following sequence of function calls: 1. pcm_register() to initialize snddev_info. 2. pcm_addchan() calls to create the device's primary channels. 3. pcm_setstatus() to do the final setup. While using 3 different functions in a specific order might not be very elegant, this pattern cannot be easily avoided. However, pcm_register() and pcm_setstatus() are especially confusing, since one would intuitively expect: 1. pcm_register() to actually do the registration, as opposed to a basic initialization. 2. pcm_setstatus() to, as the name suggests, set some kind of status, as opposed to finalizing the registration. This patch renames pcm_register() to pcm_init(), and pcm_setstatus() to pcm_register(). Drivers are modified accordingly. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D47325
* intrng: Add support for multiple interrupt rootsAyrton Munoz2024-09-221-1/+1
| | | | | | | | | | | | | | Different types of interrupts may require using different exception vectors so this commit adds support multiple interrupt roots to handle these cases. Archs may opt-in to multiple interrupt roots by defining INTR_ROOT_NUM as the number of roots in their intr.h. Based off https://reviews.freebsd.org/D40161. Signed-off-by: Ayrton Munoz <a.munoz3327@gmail.com> Co-authored-by: Kyle Evans <kevans@FreeBSD.org> Co-authored-by: Andrew Turner <andrew@FreeBSD.org> Reviewed-by: imp,mmel,mhorne Pull-Request: https://github.com/freebsd/freebsd-src/pull/1363
* newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANYWarner Losh2024-07-252-2/+2
| | | | Sponsored by: Netflix
* net: Remove unneeded NULL check for the allocated ifnetZhenlei Huang2024-06-281-5/+0
| | | | | | | | | | | Change 4787572d0580 made if_alloc_domain() never fail, then also do the wrappers if_alloc(), if_alloc_dev(), and if_gethandle(). No functional change intended. Reviewed by: kp, imp, glebius, stevek MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D45740
* arm: Remove stray references to dev/sound/chip.hChristos Margiolis2024-05-061-1/+0
| | | | | | | Fixes: 923e0040a59a ("sound: Move chip.h contents to pcm/sound.h") Reported by: Jenkins CI Sponsored by: The FreeBSD Foundation MFC after: 1 week
* aw_gpio: temporarily switch to input function if read in eint modeAndriy Gapon2024-02-181-0/+12
| | | | | | | | This is needed for gpiokeys driver that needs to read input state after receiving an interrupt for either edge. PR: 248138 MFC after: 1 month
* intrng: Remove irq_root_ipicount and corresponding intr_pic_claim_root argJessica Clarke2024-01-241-1/+1
| | | | | | | | | | | | | The static irq_root_ipicount variable is only ever written to (with the value passed to irq_root_ipicount), never read. Moreover, the bcm2836 driver, as used by the Raspberry Pi 2B and 3A/B (but not 4, which uses a GIC-400, though does have the legacy interrupt controller present too) passes 0 as ipicount, despite implementing IPIs. It's thus inaccurate and serves no purpose, so should be removed. Reviewed by: mmel, imp, mhorne MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D35897
* syscon: Move syscon code in dev/sysconEmmanuel Vadot2024-01-102-3/+3
| | | | | | | | | | | We've removed kernel option EXT_RESOURCES almost two years ago. While it was ok to have some code under a common 'extres' subdirectory at first, we now have a lot of consumer of it and we made it mandatory so no need to have it under a cryptic name. Reviewed by: mhorne Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D43196
* phy: Move phy code in dev/phyEmmanuel Vadot2024-01-102-2/+2
| | | | | | | | | | | We've removed kernel option EXT_RESOURCES almost two years ago. While it was ok to have some code under a common 'extres' subdirectory at first, we now have a lot of consumer of it and we made it mandatory so no need to have it under a cryptic name. Reviewed by: emaste, imp Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D43195
* regulator: Move regulator code in dev/regulatorEmmanuel Vadot2024-01-109-9/+9
| | | | | | | | | | | We've removed kernel option EXT_RESOURCES almost two years ago. While it was ok to have some code under a common 'extres' subdirectory at first, we now have a lot of consumer of it and we made it mandatory so no need to have it under a cryptic name. Reviewed by: emaste, imp Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D43194
* nvmem: Move nvmem code in dev/nvmemEmmanuel Vadot2024-01-101-1/+1
| | | | | | | | | | | We've removed kernel option EXT_RESOURCES almost two years ago. While it was ok to have some code under a common 'extres' subdirectory at first, we now have a lot of consumer of it and we made it mandatory so no need to have it under a cryptic name. Reviewed by: dab, imp Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D43193
* hwreset: Move reset code in dev/hwresetEmmanuel Vadot2024-01-1014-14/+14
| | | | | | | | | | | We've removed kernel option EXT_RESOURCES almost two years ago. While it was ok to have some code under a common 'extres' subdirectory at first, we now have a lot of consumer of it and we made it mandatory so no need to have it under a cryptic name. Reviewed by: imp Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D43192
* clk: Move clock code in dev/clkEmmanuel Vadot2024-01-1019-20/+20
| | | | | | | | | | | We've removed kernel option EXT_RESOURCES almost two years ago. While it was ok to have some code under a common 'extres' subdirectory at first, we now have a lot of consumer of it and we made it mandatory so no need to have it under a cryptic name. Reviewed by: mhorne Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D43191
* usb: dwc3: Move driver under a subdirectoryEmmanuel Vadot2024-01-101-141/+0
| | | | | | | | | dwc3 is big enough to have its own subdirectory. While here only make it depend on kernel option dwc3 and rk_dwc3 without any SOC options. Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D43190
* clk: Move allwinner driver into the common directoryEmmanuel Vadot2024-01-1037-9880/+19
| | | | | | | | | No need to keep it under sys/arm/allwinner/clkng It's easier to find which controller we support by looking under one directory. It will also be shared with Allwinner RiscV SoC. Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D43188
* pwm: Move allwinner driver into the common directoryEmmanuel Vadot2024-01-101-398/+0
| | | | | | | | No need to keep it under sys/arm/allwinner It's easier to find which controller we support by looking under one directory. Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D43187