summaryrefslogtreecommitdiff
path: root/sys/arch/armv7
AgeCommit message (Collapse)Author
2020-07-17Re-work intr_barrier(9) on arm64 to remove layer violation. So far wePatrick Wildt
have stored the struct cpu_info * in the wrapper around the interrupt handler cookie, but since we can have a few layers inbetween, this does not seem very nice. Instead have each and every interrupt controller provide a barrier function. This means that intr_barrier(9) will in the end be executed by the interrupt controller that actually wired the pin to a core. And that's the only place where the information is stored. ok kettenis@
2020-07-14Implement pci_intr_establish_cpu() on arm64 and armv7. The function pointerPatrick Wildt
in the chipset tag for establishing interrupts now takes a struct cpu_info *. The normal pci_intr_establish() macro passes NULL as ci, which indicates that the primary CPU is to be used. The PCI controller drivers can then simply pass the ci on to our arm64/armv7 interrupt establish "framework". Prompted by dlg@ ok 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-30Remove obsolete <machine/stdarg.h> header. Nowadays the varargVisa Hankala
functionality is provided by <sys/stdarg.h> using compiler builtins. Tested in a ports bulk build on amd64 by naddy@ OK naddy@ mpi@
2020-06-23Enable virtual consoles on armv7, the same way it is done on arm64.Frederic Cambus
Tested on a Cubieboard2. OK patrick@
2020-06-18Enable bwfm(4) on armv7 RAMDISK for SD/MMC and USB devices.Frederic Cambus
OK patrick@
2020-06-02use correct node when enabling phyJonathan Gray
ok kettenis@
2020-05-31introduce "cpu_rnd_messybits" for use instead of nanotime in dev/rnd.c.David Gwynne
rnd.c uses nanotime to get access to some bits that change quickly between events that it can mix into the entropy pool. it doesn't use nanotime to get a monotonically increasing set or ordered and accurate timestamps, it just wants something with bits that change. there's been discussions for years about letting rnd use a clock that's super fast to read, but not necessarily accurate, but it wasn't until recently that i figured out it wasn't interested in time at all, so things like keeping a fast clock coherent between cpu cores or correct according to ntp is unecessary. this means we can just let rnd read the cycle counters on cpus and things will be fine. cpus with cycle counters that vary in their speed and arent kept consistent between cores may even be desirable in this context. so this is the first step in converting rnd.c to reading cycle counter. it copies the nanotime backend to each arch, and they can replace it with something MD as a second step later on. djm@ suggested rnd_messybytes, but we landed on cpu_rnd_messybits. thanks to visa for his eyes. ok deraadt@ visa@ deraadt@ says he will help handle any MD fallout that occurs.
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-26increment version numbers, due to recent RB_GOODSEED and fchmod +T changesTheo de Raadt
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-05-23Look at the openbsd,boothowto property and bring the bootarg parsingMark Kettenis
code in line with arm64. ok deraadt@
2020-05-18Our check to see if the EFI services support Mtftp() doesn't workPatrick Wildt
on U-Boot anymore, since we checked if the method is provided, but now U-Boot provides a simple stub that only returns EFI_UNSUPPORTED. A proper UEFI would throw EFI_INVALID_PARAMETER if we pass NULL as first parameter, but U-Boot doesn't. This way we can see if the method is actually provided and not just a stub. ok kettenis@
2020-05-17Remove board ID support. 6.7 shipped with a kernel that doesn't needMark Kettenis
it anymore. jsg@
2020-05-14The dwctwo(4) FDT glue is now identical on armv7 and arm64. Move it toMark Kettenis
/dev/fdt. ok patrick@, visa@
2020-05-10Pass boothowto from the bootloader to the kernel by adding aMark Kettenis
openbsd,boothowto property under /chosen. ok patrick@
2020-04-29Enable a bunch of drivers needed for full Raspberry Pi 2/3 support.Mark Kettenis
2020-04-29Let the armv7 bus_dma layer and simplebus(4) implementation deal withMark Kettenis
DMA remapping in the same way as arm64. This relies on the dma-ranges property in the device tree and allows us to get rid of the hack for the Raspberry Pi in the dwctwo(4) driver. Note that this does not include the hack in simplebus(4) that we have on arm64 since firmware that has the dma-ranges is in widespread use now. ok patrick@
2020-04-27Add bcmclock(4) and bcmmbox(4). Fixes a hang because the clock for sdhc(4)Mark Kettenis
can't be enabled.
2020-04-27Remove reset hack; these days the U-Boot we ship for the CuBox-i isMark Kettenis
perfectly happy without it. ok patrick@
2020-04-27Bring inittodr()/resettodr() in line with arm64 and move it toMark Kettenis
arrm32_machdep.c. ok mpi@
2020-04-27fix SDHC_DEBUG build, remove procname printf'sians
ok kettenis@
2020-04-23Move imxehci(4) to sys/dev/fdt.Patrick Wildt
ok kettenis@
2020-04-23Recent changes in usr/mdec require (substantial) growth of the ramdisk.Theo de Raadt
ok jsg kettenis, testing by kmos also
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-07Kill board_id variable; its last consumer is gone now.Mark Kettenis
ok jsg@
2020-04-07Kill unused extern declaration.Mark Kettenis
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@
2020-04-06Register controller with the gpio "framework".Mark Kettenis
ok jsg@
2020-04-05Use OF_is_compatible() to simplify the initialization for the "mdio" node.Mark Kettenis
Add code to enable the clock which is present in new device trees. ok jsg@
2020-04-05Add omrng(4), a driver for te random number generator found on TI OMAP SoCs.Mark Kettenis
ok jsg@
2020-04-03increase rdroot sizeJonathan Gray
ok kettenis@ deraadt@
2020-03-31Remove leftover that should have been removed in the previous commit.Mark Kettenis
2020-03-31Newer device trees no longer put the full physical address in the "reg"Mark Kettenis
property; it contains on offset in the parent's address space instead. Since the driver needs the address of the CPPI RAM to program the descriptors, use bus_space_vaddr(9) and pmap_extract(9) to get it. ok jsg@
2020-03-31Remove unused code. The padconf code has been replaced with theMark Kettenis
generic pinctrl(4) driver and intc(4) now attaches using the device tree. ok jsg@
2020-03-30Port "mach dtb" code from arm64.Mark Kettenis
ok patrick@
2020-03-22Make efi_device_path_depth() return the full device path depth if we don'tMark Kettenis
find a media device path node. Fixes booting OpenBSD on some older U-Boot versions that are in wide circulation such as 2017.09 and 2017.11. ok patrick@
2020-03-01Allow armv7 efiboot(8) to read from an ffs2 filesystem. ok kettenis@Otto Moerbeek
2020-02-18Cleanup <sys/kthread.h> and <sys/proc.h> includes.Martin Pieuchot
Do not include <sys/kthread.h> where it is not needed and stop including <sys/proc.h> in it. ok visa@, anton@
2020-01-13Convert to tsleep_nsec(9), while here fix a bug where the value specifiedMartin Pieuchot
in ticks was meant to be in msecs. Pointed out by and ok patrick@
2020-01-13Timeouts are all specified in multiple of `hz' so define them in term ofMartin Pieuchot
seconds and use tsleep_nsec(9). ok patrick@
2020-01-13Kill dead code.Martin Pieuchot
ok patrick@