summaryrefslogtreecommitdiff
path: root/sys/arch/loongson
AgeCommit message (Collapse)Author
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.
2020-06-24kernel: use gettime(9)/getuptime(9) in lieu of time_second(9)/time_uptime(9)cheloha
time_second(9) and time_uptime(9) are widely used in the kernel to quickly get the system UTC or system uptime as a time_t. However, time_t is 64-bit everywhere, so it is not generally safe to use them on 32-bit platforms: you have a split-read problem if your hardware cannot perform atomic 64-bit reads. This patch replaces time_second(9) with gettime(9), a safer successor interface, throughout the kernel. Similarly, time_uptime(9) is replaced with getuptime(9). There is a performance cost on 32-bit platforms in exchange for eliminating the split-read problem: instead of two register reads you now have a lockless read loop to pull the values from the timehands. This is really not *too* bad in the grand scheme of things, but compared to what we were doing before it is several times slower. There is no performance cost on 64-bit (__LP64__) platforms. With input from visa@, dlg@, and tedu@. Several bugs squashed by visa@. ok kettenis@
2020-06-05cpu_rnd_messybits() for mips64Visa Hankala
Use CP0 Count as a basis. Also take noise from virtual memory activity by including BadVAddr. OK deraadt@ dlg@
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-27Retire <machine/varargs.h>.Visa Hankala
Nothing uses the header anymore. OK deraadt@ mpi@
2020-05-27Fix pmon_iostrategy()Visa Hankala
If rsize is NULL, do not update the variable. Otherwise the bootloader will crash when it invokes libsa's fchmod(). This lets the bootloader work again after the recent loadrandom() change. The fix should also improve the chances of sysupgrade(8) on loongson. Note that pmon_iostrategy() does not allow writing. fchmod() will fail but does not prevent boot.
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.
2020-05-26increment version numbers, due to recent RB_GOODSEED and fchmod +T changesTheo de Raadt
2020-05-25Use <dev/clock_subr.h> in mcclock(4).Visa Hankala
Tested on Yeeloong. Looks good to miod@
2020-05-25Use <dev/clock_subr.h> in mfokclock(4).Visa Hankala
Looks good to miod@
2009-12-25By 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.
2009-11-26By 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.
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-14Fix some of the more esoteric bus_space functions. TheMark Kettenis
bus_space_read_region_n, bus_space_write_region_n and bus_space_set_region_n functions were all broken. Same fix as arm64; Thanks to patrick@ for noting that mips64 had the same code. ok visa@
2020-04-07Abstract the head of knote lists. This allows extending the lists,Visa Hankala
for example, with locking assertions. OK mpi@, anton@
2020-04-06Update my email address.Paul Irofti
2020-03-03Allow loongson boot(8) to read from an ffs2 filesystem. ok deraadt@ visa@Otto Moerbeek
2020-02-20Replace field f_isfd with field f_flags in struct filterops to allowVisa Hankala
adding more filter properties without cluttering the struct. OK mpi@, anton@
2020-02-16Send a resume event to apmd(8), like done by apm(4) and acpi(4)Jeremie Courreges-Anglas
Test & ok visa@. Sadly his Lemote doesn't come back from sleep, with or without this change.