summaryrefslogtreecommitdiff
path: root/sys/arch/armv7/omap
AgeCommit message (Collapse)Author
2024-11-06Make edid_parse() take a device name as extra argument so that the fewMiod Vallat
messages it may print are tied to the particular device it concerns.
2024-11-02Move edid_print() behind defined(EDID_DEBUG).Miod Vallat
2024-08-20match the config_activate_children() sequences found in other usb hostTheo de Raadt
controller drivers.
2024-06-26return type on a dedicated line when declaring functionsJonathan Gray
ok mglocker@
2024-05-22remove prototypes with no matching function and externs with no varJonathan Gray
2024-05-13remove prototypes with no matching functionJonathan Gray
ok mpi@
2024-04-29remove unused armv7 specific find_first_bit()Jonathan Gray
2024-04-29remove unused intc_intr_bootstrap()Jonathan Gray
2024-04-29remove unused global varsJonathan Gray
2024-04-29remove prototypes for removed functionsJonathan Gray
2023-11-10Make ifq and ifiq interface MP safe.Alexander Bluhm
Rename ifq_set_maxlen() to ifq_init_maxlen(). This function neither uses WRITE_ONCE() nor a mutex and is called before the ifq mutex is initialized. The new name expresses that it should be used only during interface attach when there is no concurrency. Protect ifq_len(), ifq_empty(), ifiq_len(), and ifiq_empty() with READ_ONCE(). They can be used without lock as they only read a single integer. OK dlg@
2023-09-22move simplebusvar.h so it can be used without ifdefJonathan Gray
ok kettenis@ phessler@
2023-09-17clockintr: remove clockintr_init(), clockintr_flagsScott Soule Cheloha
All the state initialization once done in clockintr_init() has been moved to other parts of the kernel. It's a dead function. Remove it. Likewise, the clockintr_flags variable no longer sports any meaningful flags. Remove it. This frees up the CL_* flag namespace, which might be useful to the clockintr frontend if we ever need to add behavior flags to any of those functions.
2023-09-14clockintr: replace CL_RNDSTAT with global variable statclock_is_randomizedScott Soule Cheloha
In order to separate the statclock from the clock interrupt subsystem we need to move all statclock state out into the broader kernel. Start by replacing the CL_RNDSTAT flag with a new global variable, "statclock_is_randomized", in kern_clock.c. Update all clockintr_init() callers to set the boolean instead of passing the flag. Thread: https://marc.info/?l=openbsd-tech&m=169428749720476&w=2
2023-08-23all platforms: separate cpu_initclocks() from cpu_startclock()Scott Soule Cheloha
To give the primary CPU an opportunity to perform clock interrupt preparation in a machine-independent manner we need to separate the "initialization" parts of cpu_initclocks() from the "start the clock interrupt" parts. Currently, cpu_initclocks() does everything all at once, so there is no space for this MI setup. Many platforms have more-or-less already done this separation by implementing a separate routine named "cpu_startclock()". This patch promotes cpu_startclock() from de facto standard to mandatory API. - Prototype cpu_startclock() in sys/systm.h alongside cpu_initclocks(). The separation of responsibility between the two routines is a bit fuzzy but the basic guidelines are as follows: + cpu_initclocks() must initialize hz, stathz, and profhz, and call clockintr_init(). + cpu_startclock() must call clockintr_cpu_init() and start the clock interrupt cycle on the calling CPU. These guidelines will shift in the future, but that's the way things stand as of *this* commit. - In initclocks(): first call cpu_initclocks(), then do MI setup, and last call cpu_startclock(). - On platforms where cpu_startclock() already exists: don't call cpu_startclock() from cpu_initclocks() anymore. - On platforms where cpu_startclock() doesn't yet exist: implement it. Usually this is as simple as dividing cpu_initclocks() in two. Tested on amd64 (i8254, lapic), arm64, i386 (i8254, lapic), macppc, mips64/octeon, and sparc64. Tested on arm/armv7 (agtimer(4)) by phessler@ and jmatthew@. Tested on m88k/luna88k by aoyama@. Tested on powerpc64 by gkoehler@ and mlarkin@. Tested on riscv64 by jmatthew@. Thread: https://marc.info/?l=openbsd-tech&m=169195251322149&w=2
2023-07-25statclock: move profil(2), GPROF code to profclock(), gmonclock()Scott Soule Cheloha
This patch isolates profil(2) and GPROF from statclock(). Currently, statclock() implements both profil(2) and GPROF through a complex mechanism involving both platform code (setstatclockrate) and the scheduler (pscnt, psdiv, and psratio). We have a machine-independent interface to the clock interrupt hardware now, so we no longer need to do it this way. - Move profil(2)-specific code from statclock() to a new clock interrupt callback, profclock(), in subr_prof.c. Each schedstate_percpu has its own profclock handle. The profclock is enabled/disabled for a given CPU when it is needed by the running thread during mi_switch() and sched_exit(). - Move GPROF-specific code from statclock() to a new clock interrupt callback, gmonclock(), in subr_prof.c. Where available, each cpu_info has its own gmonclock handle . The gmonclock is enabled/disabled for a given CPU via sysctl(2) in prof_state_toggle(). - Both profclock() and gmonclock() have a fixed period, profclock_period, that is initialized during initclocks(). - Export clockintr_advance(), clockintr_cancel(), clockintr_establish(), and clockintr_stagger() via <sys/clockintr.h>. They have external callers now. - Delete pscnt, psdiv, psratio. From schedstate_percpu, also delete spc_pscnt and spc_psdiv. The statclock frequency is not dynamic anymore so these variables are now useless. - Delete code/state related to the dynamic statclock frequency from kern_clockintr.c. The statclock frequency can still be pseudo-random, so move the contents of clockintr_statvar_init() into clockintr_init(). With input from miod@, deraadt@, and claudio@. Early revisions cleaned up by claudio. Early revisions tested by claudio@. Tested by cheloha@ on amd64, arm64, macppc, octeon, and sparc64 (sun4v). Compile- and boot- tested on i386 by mlarkin@. riscv64 compilation bugs found by mlarkin@. Tested on riscv64 by jca@. Tested on powerpc64 by gkoehler@.
2023-03-05Mask off IPL flags before storing the IPL for an interrupt.Patrick Wildt
ok kettenis@ jmatthew@
2023-02-04timecounting: remove incomplete PPS supportScott Soule Cheloha
The timecounting code has had stubs for pulse-per-second (PPS) polling since it was imported in 2004. At this point it seems unlikely that anyone is going to finish adding PPS support, so let's remove the stubs: - Delete the dead tc_poll_pps() call from tc_windup(). - Remove all tc_poll_pps symbols from the kernel. Link: https://marc.info/?l=openbsd-tech&m=167519035723210&w=2 ok miod@
2023-01-27dmtimer(4): initialize stathz, profhz as other drivers, platforms doScott Soule Cheloha
Don't hardcode stathz to 100 and profhz to 1000. Instead, set stathz to hz and profhz to (stathz * 10). This is what we do in all other armv7 clock interrupt drivers and most other platforms. Link: https://marc.info/?l=openbsd-tech&m=167479021815637&w=2 ok kettenis@
2023-01-25gptimer(4): switch to clockintrScott Soule Cheloha
- Remove custom clock interrupt scheduling code. - Remove local evcount structs. - Wire up gptimer_intrclock. - Switch stathz from 128 to hz - Switch profhz from 1024 to (stathz * 10). This change is untested. Nobody seems to have hardware that actually uses the gptimer(4) as an interrupt clock. If this patch doesn't work, the driver is probably not too distant from a working state. Compile-tested by jca@. Discussed with kettenis@, jca@, drahn@, patrick@, jsg@, and uwe@. Link: https://marc.info/?l=openbsd-tech&m=167451333419815&w=2 ok patrick@ kettenis@
2023-01-22gptimer(4): remove dead MD microtime(9) implementationScott Soule Cheloha
2023-01-17dmtimer(4): switch to clockintrScott Soule Cheloha
- Strip out custom hardclock/statclock scheduling code. - Wire up dmtimer_intrclock. - For convenience, add dmtimer_reset_tisr(); we do the "clear interrupt bits" dance in multiple places, may as well put it in a function. - For parity with other platforms, change stathz from 128 to 100 and profhz from 1024 to 1000. Testing by stuge@ and jsg@. v1: https://marc.info/?l=openbsd-tech&m=167060320326851&w=2 v2: https://marc.info/?l=openbsd-tech&m=167340009006972&w=2 ok mlarkin@ kettenis@
2022-07-15Implement support for framebuffers that don't start on a page boundary.Mark Kettenis
This happens on the new 14" and 16" Macbook Pro where we deliberately use a framebuffer that skips the first few lines to avoid "the notch". The offset of the first pixel is added to struct wsdisplay_fbinfo. The stride is added as well, mirroring the value returned by the WSDISPLAYIO_LINEBYTES ioctl, such that we can retire that one in the future. A compat ioctl is implemented to help the transition. The compat code will be removed after OpenBSD 7.3 has been released. ok miod@
2022-04-06constify struct cfattachChristian Weisgerber
2022-02-21initializion -> initializationJonathan Gray
2022-01-03Don't use != 0 to check whether a pointer is non-NULL.Jonathan Gray
2021-10-24Constify struct cfattach.Martin Pieuchot
ok visa@ a long time ago, ok patrick@
2021-05-16panic does not require a \n at the end. When one is provided, it looks wrong.Theo de Raadt
2021-05-16ansiJonathan Gray
2021-04-02Fix Dale's email addressTheo Buehler
ok drahn
2021-03-25remove uneeded includes in md armv7 filesJonathan Gray
based on include-what-you-use suggestions
2021-03-11spellingJonathan Gray
2021-02-23timecounting: use C99-style initialization for all timecounter structscheloha
The timecounter struct is large and I think it may change in the future. Changing it later will be easier if we use C99-style initialization for all timecounter structs. It also makes reading the code a bit easier. For reasons I cannot explain, switching to C99-style initialization sometimes changes the hash of the resulting object file, even though the resulting struct should be the same. So there is a binary change here, but only sometimes. No behavior should change in either case. I can't compile-test this everywhere but I have been staring at the diff for days now and I'm relatively confident this will not break compilation. Fingers crossed. ok gnezdo@
2021-01-19s/KHZ/kHz/ and reduce dmesg spam a bitMark Kettenis
ok tb@, deraadt@
2021-01-19Remove some unused #defines and remove some commented-out variables.Mark Kettenis
2020-07-14Extend the interrupt API on arm64 and armv7 to be able to pass aroundPatrick Wildt
a struct cpu_info *. From a driver point of view the fdt_intr_establish_* API now also exist same functions with a *_cpu suffix. Internally the "old" functions now call their *_cpu counterparts, passing NULL as ci. NULL will be interpreted as primary CPU in the interrupt controller code. The internal framework for interrupt controllers has been changed so that the establish methods provided by an interrupt controller function always takes a struct cpu_info *. Some drivers, like imxgpio(4) and rkgpio(4), only have a single interrupt line for multiple pins. On those we simply disallow trying to establish an interrupt on a non-primary CPU, returning NULL. Since we do not have MP yet on armv7, all armv7 interrupt controllers do return NULL if an attempt is made to establish an interrupt on a different CPU. That said, so far there's no way this can happen. If we ever gain MP support, this is a reminder that the interrupt controller drivers have to be adjusted. Prompted by dlg@ ok kettenis@
2020-07-12Use the full 32 bits for the miscellaneous armv7 timecounters.Christian Weisgerber
Checked against * ARM Architecture Reference Manual (agtimer) * ARM Cortex-A9 MPCore Technical Reference Manual (amptimer) * OMAP35x Applications Processor Technical Reference Manual (gptimer) Artturi Alm had independently suggested this in the past.
2020-07-10Change users of IFQ_SET_MAXLEN() and IFQ_IS_EMPTY() to use the "new" API.Patrick Wildt
ok dlg@ tobhe@
2020-07-10Change users of IFQ_DEQUEUE(), IFQ_ENQUEUE() and IFQ_LEN() to use thePatrick Wildt
"new" API. ok dlg@ tobhe@
2020-07-06Add support for timeconting in userland.Paul Irofti
This diff exposes parts of clock_gettime(2) and gettimeofday(2) to userland via libc eliberating processes from the need for a context switch everytime they want to count the passage of time. If a timecounter clock can be exposed to userland than it needs to set its tc_user member to a non-zero value. Tested with one or multiple counters per architecture. The timing data is shared through a pointer found in the new ELF auxiliary vector AUX_openbsd_timekeep containing timehands information that is frequently updated by the kernel. Timing differences between the last kernel update and the current time are adjusted in userland by the tc_get_timecount() function inside the MD usertc.c file. This permits a much more responsive environment, quite visible in browsers, office programs and gaming (apparently one is are able to fly in Minecraft now). Tested by robert@, sthen@, naddy@, kmos@, phessler@, and many others! OK from at least kettenis@, cheloha@, naddy@, sthen@
2020-07-05match on "ti,am335-sdhci" used since linux 5.8-rc3Jonathan Gray
2020-06-02use correct node when enabling phyJonathan Gray
ok kettenis@
2020-05-29dev/rndvar.h no longer has statistical interfaces (removed during variousTheo de Raadt
conversion steps). it only contains kernel prototypes for 4 interfaces, all of which legitimately belong in sys/systm.h, which are already included by all enqueue_randomness() users.
2020-05-25change wsdisplay attribute type from long to uint32_tJonathan Gray
miod explained it was initially a long as it was thought drivers may need to allocate storage but in practice they don't need more than 32 bits for an attribute. suggested and reviewed by miod@
2020-05-25rename wsdisplay alloc_attr() to pack_attr()Jonathan Gray
Suggested by John Carmack. miod agrees a rename would make sense and explained it was initially thought drivers may need to allocate storage but in practice they don't need more than 32 bits for an attribute. ok mpi@
2020-04-27fix SDHC_DEBUG build, remove procname printf'sians
ok kettenis@
2020-04-10Add omcm(4), omclock(4) and omsysc(4) drivers that support the new busMark Kettenis
structure that is used in current mainline Linux device trees. ok jsg@
2020-04-07Use PHY framework to replace hardcoded board-specific GPIO poking.Mark Kettenis
ok jsg@
2020-04-07Remove entry that is no longer needed.Mark Kettenis
ok jsg@
2020-04-06Add support for the cd-gpios property.Mark Kettenis
ok jsg@