aboutsummaryrefslogtreecommitdiff
path: root/sys/arm
Commit message (Collapse)AuthorAgeFilesLines
* sys: Declare 'end' as an extern char[]John Baldwin7 days2-3/+1
| | | | | | | | While here, remove an unused declaration. Reviewed by: jrtc27 Sponsored by: AFRL, DARPA Differential Revision: https://reviews.freebsd.org/D53898
* arm bcm2835: Appease a warning from GCCJohn Baldwin2026-02-171-1/+1
| | | | | | | No code currently uses the vc_audio_msg_type_names array of strings. Reported by: -Wunused-variable Differential Revision: https://reviews.freebsd.org/D55162
* bus: Document special ranges of IVARsJohn Baldwin2026-02-171-4/+6
| | | | | | | | | | | | | Some IVAR indices are special in that they have global meaning across multiple buses where as other IVARs are always private to the local bus. Try to document this a bit and add constants for the various ranges to avoid future conflicts. This is a no-op, but IVAR indices are now generally defined as enums as that makes it easier to define them in terms of ranges. Reviewed by: imp, royger, andrew Differential Revision: https://reviews.freebsd.org/D54159
* Revert "pcb.h: mark struct pcb to be preserved"Konstantin Belousov2026-02-091-4/+0
| | | | | | | kgdb only uses the marked fields from dumppcb for initial frame reconstruction. This reverts commit 8f23665fed2fbaf4481359b4d2fcdd7b9feb40e3.
* arm64: Assume get_kernel_reg returns trueAndrew Turner2026-02-091-4/+3
| | | | | | | | It now only returns true so this can be assumed and doesn't need to be checked. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D55105
* 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
* pcb.h: mark struct pcb to be preservedMinsoo Choo2026-02-091-0/+4
| | | | | | | | | | There are programs that depend on this structure (e.g. kernel debuggers) that breaks when the ABI changes. Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me> Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D55149
* arm/broadcom: Fix a typo in a source code commentGordon Bergling2026-02-081-1/+1
| | | | | | - s/preceeded/preceded/ MFC after: 3 days
* STACKALIGN: Reimplement in terms of __align_downJohn Baldwin2026-02-064-5/+4
| | | | | | | | | | This changes STACKALIGN to be type-preserving when operating on pointers. Reviewed by: brooks, kib Effort: CHERI upstreaming Sponsored by: AFRL, DARPA Differential Revision: https://reviews.freebsd.org/D54920
* arm: Implement kernel ifuncMichal Meloun2026-02-013-7/+30
| | | | | | | | Add kernel ifunc support on arm. MFC after : 3 weeks Reviewed by: kib (previous version) Differential Revision: https://reviews.freebsd.org/D54970
* cpu_switch(): unconditionally wait on the blocked mutex transientKonstantin Belousov2026-01-291-6/+1
| | | | | | | | | | It is nop for 4BSD. Reviewed by: olce Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54831
* kern/sched_shim.c: Provide a scheduler selection machineryKonstantin Belousov2026-01-291-0/+3
| | | | | | | | Reviewed by: olce Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54831
* arm, riscv: add a preprocessor symbol indicating missed support of ifuncKonstantin Belousov2026-01-291-0/+10
| | | | | | | | | in kernel. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54831
* arm: Make init_proc0 staticJohn Baldwin2026-01-272-2/+1
| | | | | | | | | | This function is not used outside of machdep.c and is already static on arm64 and riscv. Reviewed by: imp Effort: CHERI upstreaming Sponsored by: AFRL, DARPA Differential Revision: https://reviews.freebsd.org/D54838
* arm/gic: Detect broken configurationsAndrew Turner2026-01-231-1/+14
| | | | | | | | | | | | | Some virtualization platforms provide broken configurations. There is a GIC interrupt controller, however accessing the CPU interface registers leads to an external data abort. As these are needed to handle interrupts we are unable to boot further. Detect this misconfiguration and panic to tell the user the issue. Reviewed by: emaste Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D54832
* vchiq: fix build with clang 21Dimitry Andric2026-01-161-1/+1
| | | | | | | | | | | | | | | | | | When compiling vchiq with clang 21, the following -Werror warning is produced: sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c:728:27: error: default initialization of an object of type 'VCHIQ_QUEUE_MESSAGE32_T' with const member leaves the object uninitialized [-Werror,-Wdefault-const-init-field-unsafe] 728 | VCHIQ_QUEUE_MESSAGE32_T args32; | ^ sys/contrib/vchiq/interface/vchiq_arm/vchiq_ioctl.h:151:40: note: member 'elements' declared 'const' here 151 | const /*VCHIQ_ELEMENT_T * */ uint32_t elements; | ^ While the warning is formally correct, the 'args32' object is immediately initialized after its declaration. Therefore, suppress the warning. MFC after: 3 days
* 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
* Add sys/_align.h replacing machine/_align.hBrooks Davis2025-12-102-52/+1
| | | | | | | | | | | | | | | | Define _ALIGNBYTES using sizeof(void *) (no functional change on any existing architecture) which will allow it to work with CHERI were we must align things up to capability alignment. In _ALIGN, replace integer manipulation which does not preserve pointer provenance with a type and provenance preserving builtin. This requires modest changes in code which assumes _ALIGN returns an integer, but those are relatively rare. Reviewed by: kib, markj Effort: CHERI upstreaming Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D53947
* bus_alloc_resource: Pass rid by value to BUS_ALLOC_RESOURCE DEVMETHODJohn Baldwin2025-12-093-8/+8
| | | | | | | | | The wrapper functions such as bus_alloc_resource_any() still support passing the rid by value or pointer, but the underlying implementation now passes by value. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53402
* sys: Remove/update references to the swapper process in various commentsJohn Baldwin2025-12-041-1/+1
| | | | | Reviewed by: olce, markj Differential Revision: https://reviews.freebsd.org/D54051
* armv7: Tweak some armv6 removalsWarner Losh2025-12-032-1/+2
| | | | | | Fixes: 42421307b115 (sys: remove armv6/6.1 support from debug monitor) Suggested by: jhb Sponsored by: Netflix
* sys/stdint.h: add C23 _WIDTH macrosRobert Clausecker2025-11-301-0/+23
| | | | | | | | | | | | | | The platform-dependent macros are added to the various _stdint.h headers, those that are always the same are added directly to _stdint.h. We may want to move the definitions for WCHAR_* and WINT_* out of the platform header files as those are always the same. Approved by: markj (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D53830
* sys/limits.h: add C23 _WIDTH macrosRobert Clausecker2025-11-301-0/+3
| | | | | | | | | | | | For compliance with IOS/IEC 9899:2024 ("C23"). These macros define the width in bits of the basic integer types. Another new macro, BITINT_MAXWIDTH, is not yet included as I do not understand what it should be set to. Perhaps it is compiler-specific. Approved by: markj (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D53825
* arm: Remove unused variable in dbg_arch_supportedWarner Losh2025-11-291-3/+1
| | | | | | | | | Removed unused dbg_didr which had been used prior to f42421307b11 to detect qemu unsupported debugger. I'm unsure how this slipped through my testing. Fixes: f42421307b11 Sponsored by: Netflix
* sys: update comment for removal of armv6Minsoo Choo2025-11-291-1/+1
| | | | | | Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1903
* sys: remove armv6/6.1 support from debug monitorMinsoo Choo2025-11-291-30/+0
| | | | | | Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1903
* sys: remove comment for armv5/6Minsoo Choo2025-11-292-6/+1
| | | | | | Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1903
* sys: RealTek -> Realtekykla2025-11-272-3/+3
| | | | | | | | | | | Realtek changed how it styled its name 25 or so years ago, but the old style persisted in many places. These products use the new styling in their datasheets. Signed-off-by: ykla yklaxds@gmail.com Sponsored by: Chinese FreeBSD Community Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1901
* arm: Add missing argument in mtx_init() callsChristos Margiolis2025-11-242-10/+2
| | | | | | | Fixes: 9d18115ca0ab ("sound: Retire snd_mtx* wrappers") Reported by: CI Sponsored by: The FreeBSD Foundation MFC after: 4 days
* sound: Retire snd_mtx* wrappersChristos Margiolis2025-11-213-25/+25
| | | | | | | | | | | | 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
* arm/gic: Make GICV3_IVAR_SUPPORT_LPIS genericAndrew Turner2025-11-182-0/+5
| | | | | | | GICv5 will need this too, so move to the GIC_IVAR namespace. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D53663
* arm: Handle GIC_IVAR_VGIC in the gic driverAndrew Turner2025-11-181-0/+3
| | | | | | | We don't have a GICv2 vgic so can just return 0. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D53662
* arm64: Add support to vchiq and bcm2835_audio (plus some fixes)Marco Devesas Campos2025-11-152-19/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add 64 bit support to vchiq: * update fields to the appropriate fixed bit-size variants (everywhere [cf. e.g., ref:sizes and ref:sizes2]) * refer to event semaphores (that go into the very 32 bit VC) by offset instead of pointers [ref:sems] * dsb() is dsb(sy) in arm64 (vchiq_{core.c,core.h,kmod.c}) [ref:dsb] * comment out some unneeded code in parse_rx_slots around VCHIQ_MSG_BULK_RX (cf. [ref:deadcode]) * adapt remote_event_signal to arm64 caching behaviours (vchiq_kmod.c) * refactor synchronization around remote_event_signal, forcing a wmb to be on the safe side; thereby make it look more like what linux does [ref:sync] (vchiq_{core,kmod}.c); and make a comment in vchiq_core.c true (wasn't before) * add a few more syncs to be on the safe side (vchiq_2835_arm.c) * use arm64 dcache invalidation mechanisms (vchiq_2835_arm.c) * explicitly invalidate pages on arm64 post bulk-read (vchiq_2835_arm.c) * support bulk transfers on rpi-4 (aka "long address space" transfers), by hard-coding their vc offset (0) and different bit-shift [ref:longbulk] (vchiq_2835_arm.c) * refactor a loop-of-constant-test (vchiq_2835_arm.c) * use the correct (hard-coded) cache-line size on arm64 * rework the handling of chipset "features" to account for the extra behaviours with 64 bit chipsets. (vchiq_kmod.c) * add sysctl-s (log, arm_log) to control debug (vchiq_kmod.c) * add example kernel config (GENERIC-VCHIQ) Fixes: * Rework error handling in create_pagelist, avoiding a potential panic when freeing memory that had been dmamem_alloc, a potential null dereference, and a leak when having problems pinning pages (vchiq_2835_arm.c) * fix a confusion about the behaviour cv_wait_sig that lead to uninterruptible looping (vchiq_bsd.c) * implement detection of fatal signals (vchiq_bsd.c) * fix a confusion with the name of a variable introduced by #a0b8746 that could lead to a panic when closing the cdev file (vchiq_arm.c) * release user connection when destructing cdevpriv and avoid user processes sharing connection data, which lead to stalls and data corruption. (vchiq_arm.c) Update bcm2835_audio to work on 64bit systems: * update VC audio fields (vc_vchi_audioserv_defs.h, bcm2835_audio.c) * repurpose the hitherto unused callback field to help push a 64 bit pointer in (bcm2835_audio.c) * increase (hopefully) the robustness of the code that shifts data to VC (bcm2835_audio.c) * add a sysctl to control the amount of debugging info output by bcm2835_audio.c Tested on zero, zero2 and 4+ with ping, functional, bulk and control vchiq_test-s, and omxplayer [ref:dsb]: https://github.com/raspberrypi/linux/commit/35b7ebda57affcfd3616d39d5a727a4495b31123 [ref:sems]: https://github.com/raspberrypi/linux/commit/24a4262afb10907fce3cdbc3ae336fcf4cdaece5 [ref:sizes]: https://github.com/raspberrypi/linux/commit/e64568b8ea6c04e747e432c17ce2452652075216 [ref:sizes2]: https://github.com/raspberrypi/linux/commit/f9bee6dd24addfa00c2c8d50c25b73efbfbb28ba [ref:deadcode]: https://github.com/raspberrypi/linux/commit/14f4d72fb799a9b3170a45ab80d4a3ddad541960 [ref:sync]: https://github.com/raspberrypi/linux/commit/51c071265079319583e4c6e8c61e09660300d0bf [ref:longbulk]: https://github.com/raspberrypi/linux/commit/37f6f19a83722c9b866cecb5e455b2e16e5bbc6b Differential Revision: https://reviews.freebsd.org/D37878 Submitted by: Marco Devesas Campos <devesas.campos@gmail.com>
* sound: Get rid of useless sndbuf getters and settersChristos Margiolis2025-11-115-15/+16
| | | | | | | | No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53528
* random: allow disabling of entropy harvesting from keyboard & miceDavid E. O'Brien2025-11-111-0/+2
| | | | | | Reviewed by: jmg Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D53390
* random: TPM_HARVEST should have been named RANDOM_ENABLE_TPMDavid E. O'Brien2025-11-101-0/+4
| | | | | | | | | | | * Enable RANDOM_ENABLE_TPM by default * The commit of TPM_HARVEST failed to add it to NOTES so that the LINT kernel would build the code. Fixes: 4ee7d3b0118c82e651712bb65da53d08e78cd7b1 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53460
* vchiq: fix another logging format string for 32/64 bitMarco Devesas Campos2025-10-301-2/+3
| | | | | | | This is from work from https://reviews.freebsd.org/D37878. Submitted by: Marco Devesas Campos <devesas.campos@gmail.com> Differential Revision: https://reviews.freebsd.org/D53372
* vchiq: logging/tracing refactoringMarco Devesas Campos2025-10-301-12/+54
| | | | | | | | | | | * Create macros for error, info, warn, trace / debug * Migrate existing printf() logging to use the above macros * Add a sysctl knob to control it at runtime This is based on work done in https://reviews.freebsd.org/D37878 . Submitted by: Marco Devesas Campos <devesas.campos@gmail.com> Differential Revision: https://reviews.freebsd.org/D53371
* arm/ti: Fix typo in a KASSERT messageGordon Bergling2025-10-291-1/+1
| | | | | | - s/patcket/packet/ MFC after: 5 days
* arm/mv: Fix typo in a kernel error messageGordon Bergling2025-10-291-1/+1
| | | | | | - s/Unkown/Unknown/ MFC after: 5 days
* arm/nvidia/tegra: Fix a couple of typos in kernel messagesGordon Bergling2025-10-284-6/+6
| | | | | | | | | - s/intialization/initialization/ - s/Cannott/Cannot/ - s/ivalid/invalid/ - s/wating/waiting/ MFC after: 1 week