summaryrefslogtreecommitdiff
path: root/sys/arch/loongson
AgeCommit message (Collapse)Author
2022-08-22mips64, octeon, loonson: trigger deferred clock interrupts from splx(9)Scott Soule Cheloha
As with powerpc, powerpc64, and riscv64, on mips64 platforms we need to isolate the clock interrupt schedule from the MD clock interrupt code. To do this, we need to stop deferring clock interrupt work until the next tick and instead defer the work until we logically unmask the clock interrupt from splx(9). Add a boolean (ci_clock_deferred) to the cpu_info struct to note whether we need to trigger the clock interrupt by hand, and then do so from splx(9) by calling md_triggerclock(). Currently md_triggerclock is only ever set to cp0_trigger_int5(). The routine takes great care to ensure that INT5 has fired or will fire before returning. There are some loongson machines that use glxclk instead of CP0. They can be switched to use CP0 later. With input and advice from visa@ and miod@. Compiled and extensively tested by visa@ and miod@ on various octeon and loongson machines. No issues seen on octeon machines. miod@ saw some odd things on loongsoon, but suggests that all issues are probably unrelated to this patch. Link: https://marc.info/?l=openbsd-tech&m=165929192702632&w=2 ok visa@, miod@
2022-08-18Move recomputation of hz and stathz from glk to glkclk, lets a kernel withMiod Vallat
glkclk disabled keep correct values of those. NFC
2022-08-10Also attach spdmem on Gdium.Miod Vallat
2022-08-10Pass the "good random" flag from the bootblocks to the kernel when applicable.Miod Vallat
2022-08-10Add iic at glxpcib, to get spdmem to attach on 2F-based systems.Miod Vallat
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-07-02remove machine/lock.h where unusedJonathan Gray
Previously for __cpu_simple_lock parts. Now only hppa and m88k use __cpu_simple_lock (and hppa uses atomic.h for it). ok miod@ visa@
2009-07-31By popular demand and peer pressure, check-in work in progress work to supportMiod Vallat
the Yeelong Lemote mips-based netbook. Kernel bits only for now, needs polishing; most of this work done during h2k9 last month, although the porting effort started earlier this year.
2022-06-28Remove unused field d_poll from struct cdevsw.Visa Hankala
OK miod@ mpi@
2022-05-23Neither macppc nor the retired loongson have any remaining usefulKenneth R Westerback
information in /usr/mdec/mbr. Stop telling fdisk(8) that macppc and loongson HAS_MBR, and don't bother including the file in the base set. macppc build/install tests and ok gkoehler@ loongson is gone deraadt@
2022-04-06constify struct cfattachChristian Weisgerber
2022-02-21disatcher -> dispatcherJonathan Gray
2021-12-17Disable a few warning flags that were introduced and enabled by defaultPatrick Wildt
with LLVM 13.
2021-11-27stop building kernels with -Wno-uninitialized on clang archsJonathan Gray
this hides real problems that could be found at build time ok kettenis@ visa@, ok sashan@ on amd64/i386
2021-11-11Retire switch(4) it never really was production ready and the OpenFlowClaudio Jeker
API implemented is a deadend. OK akoshibe@ yasuoka@ deraadt@ kn@ patrick@ sthen@
2021-08-20Add ucc(4), a driver for USB HID Consumer Control keyboards. Suchanton
keyboard is a pseudo device which is used to expose audio and application launch keys. My prime motivation is to get the volume mute, increment and decrement keys to just work on my keyboard without the need to use usbhidaction(1). Looks reasonable to kettenis@ mpi@ and ok jcs@
2021-07-24Replace cpus_running with CPU_IS_RUNNING().Visa Hankala
2021-07-12Remember to set CPUF_RUNNING on secondary CPUs.Visa Hankala
2021-07-12Make hw_cpu_hatch() more similar on loongson and octeon.Visa Hankala
2021-05-16panic does not require a \n at the end. When one is provided, it looks wrong.Theo de Raadt
2021-03-11spellingJonathan Gray
2021-02-18Make kernel ld.script similar to octeon's on loongson and sgi.Visa Hankala
2021-02-17Skip gp initialization in loongson bootblocksVisa Hankala
The loongson bootblocks are compiled with -mno-abicalls and do not use gp-relative addressing. A similar change has been made to the mips64 kernels recently.
2021-02-11Leave out gp initialization from kernel entry on mips64Visa Hankala
On OpenBSD/mips64, the kernel is compiled with -mno-abicalls. This disables gp-relative addressing and essentially makes gp a spare register in the kernel. Hence it is unnecessary to initialize gp when entering the kernel. The _gp symbol is not needed either. Suggested by miod@
2021-02-04Add uhidpp(4), a driver for Logitech HID++ devices. Currently limited toanton
exposing battery sensors for HID++ 2.0 devices. Most of the code is derived from the hid-logitech-hidpp Linux driver. Thanks to Ville Valkonen <weezeldinga at gmail dot com> for testing. ok mglocker@
2021-01-28Again allow COPTS= to come from the environment again, and don't lose theTheo de Raadt
SMALL_KERNEL specific variations. ok espie jsg
2021-01-23introduce ujoy(4), a restricted subset of uhid(4) for gamecontrollers.thfr
This includes ujoy_hid_is_collection() to work around limitations of hid_is_collection() until this can be combined without fallout. input, testing with 8bitdo controller, and ok brynet@ PS4 controller testing, fix for hid_is_collection, and ok mglocker@
2021-01-02Use native display resolution 1368x768 with Lynloong all-in-one computers.Visa Hankala
From Yifei ZHAN on tech@
2021-01-02Make kernel recognize Lynloong LM9002/9003 and LM9013.Visa Hankala
LM9002/9003 is very similar to LM9001 since it works just fine on LM9002 with the codebase for LM9001. LM9013 on the other hand is fairly different from LM9001 and is more like Yeeloong 8089 when it comes to hardware design. More work might be needed to make it fully functional. From Yifei ZHAN on tech@
2020-12-25Refactor klist insertion and removalVisa Hankala
Rename klist_{insert,remove}() to klist_{insert,remove}_locked(). These functions assume that the caller has locked the klist. The current state of locking remains intact because the kernel lock is still used with all klists. Add new functions klist_insert() and klist_remove() that lock the klist internally. This allows some code simplification. OK mpi@
2020-12-22Make clang the default compiler on loongson.Visa Hankala
OK deraadt@
2020-12-09Use daddr_t and not daddr32_t in boot media.Kenneth R Westerback
At a minimum, amd64/i386 should now boot from 4TB GPT formatted disks. More daddr32_t terminations with extreme prejudice to follow. Tested by various, in snaps for a few days. ok deraadt@
2020-12-01Add option to build loongson kernels using clang.Visa Hankala
2020-11-17Avoid accidental truncation of large memory segments.Visa Hankala
2020-11-17Ensure proper alignment of memory map entries, needed with clang.Visa Hankala
gcc has generated unaligned loads with the original code.
2020-11-13Do not include ../Makefile.inc twice.Visa Hankala
System include file <bsd.lib.mk> includes ../Makefile.inc if it exists. This avoids repetition of certain compile options.
2020-11-13Fold -fno-builtin-* into -fno-builtin.Visa Hankala
2020-11-13Use BTB bug workaround also with assembly files.Visa Hankala
This might fix some boot-time hangs.
2020-10-20alpha, loongson, sh, sparc64: recompute tick, tick_nsec when hz(9) is resetcheloha
Normally we set hz(9) at compile-time in sys/conf/param.c to the value of HZ. HZ is one of the fundamental compilation options(4). However, sometimes we need to reset hz(9) at runtime. Whenever we reset hz(9) we need to recompute tick and tick_nsec. Otherwise a variety of "time stuff" in the kernel will not work correctly. For example, most timeouts will expire "too slow" or "too fast". There are a bunch of other places we use tick and tick_nsec that will exhibit similar problems. Test-compiled by deraadt@.
2020-09-30Move mfokclock(4) from loongson to sys/dev/i2c so that it be used by morePatrick Wildt
platforms than just loongson. Rename it to mfokrtc(4) for consistency with other RTC drivers. Make it match on st,m41t83, since that was the chip for which the driver was written for. More compatible strings can be added for each chip of the series verified to behave the same. Discussed with kettenis@ Compile tested on loongson by kn@ Tested on loongson by and ok visa@
2020-09-01Use sysctl_bounded_args for simple cases in cpu_sysctl on loongsongnezdo
deraadt@: looks fine
2020-08-26Declare hw_{prod,serial,uuid,vendor,ver} in <sys/systm.h>.Visa Hankala
OK deraadt@, mpi@
2020-07-21Do not bother masking IPIs in the Loongson 3A specific IPI routine.Visa Hankala
The interrupt dispatcher interrupt() keeps interrupts disabled anyway. Also, the IPI code should not allow nesting of interrupts.
2020-07-19Add GENERIC.MP kernel config for loongson.Visa Hankala
Not enabled for now. OK deraadt@
2020-07-18Remove an unused function.Visa Hankala
2020-07-18Userland timecounter implementation for octeonVisa Hankala
OK naddy@; no objections from kettenis@
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-06wire up kstat(4)David Gwynne
"looks right" deraadt@
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@
2009-07-31By popular demand and peer pressure, check-in work in progress work to supportMiod Vallat
the Yeelong Lemote mips-based netbook. Kernel bits only for now, needs polishing; most of this work done during h2k9 last month, although the porting effort started earlier this year.