Commit Graph

2055 Commits (master)

Author SHA1 Message Date
qwx 49b5319f76 audiohda: fix syntax error 2021-08-30 16:55:30 +00:00
Sigrid Solveig Haflínudóttir 7bdcdeafaf audiohda: add ztom z36*/z37* device id 2021-08-29 23:59:45 +00:00
Sigrid Solveig Haflínudóttir ec33d29cf6 ether8169: support rtl8402 variant 2021-08-29 23:12:33 +00:00
Ori Bernstein bcfee7b547 revert 8c228a123fa0c6062570964011854302bbf57242: accidental commit
was testing out the git/import tweaks and accidentally
pushed this commit. No comment on whether we want it,
but it definitely wasn't ready for merge.

Oops.
2021-08-22 17:47:38 +00:00
unobe@cpan.org 8c228a123f mk for only supported archs
http://fqa.9front.org/fqa1.html#1.2 states the supported archs.
However, clean and nuke also remove build files for 0 (spim) and q
(power).  'mk all' using those archs fails; 'mk kernels' also tries to
build all the kernels, even those which are not supported.  For
example, I tried to build the power arch (qc, qa, ql) and without
surprise it failed (when building dtracy): ...
mk dtracy
qc -FTVw dtracy.c
yacc -v -d -D1 parse.y
qc -FTVw cgen.c
qc -FTVw act.c
qc -FTVw type.c
 == regfree ==
REGISTER R0 <11> STRUCT DTAct cgen.c:302
 == regfree ==

REGISTER R0 <11> STRUCT DTAct act.c:266

 == regfree ==
qc -FTVw agg.c
cgen.c:299 unknown type in regalloc: STRUCT DTAct
cgen.c:299 bad opcode in gmove INT -> STRUCT DTAct
cgen.c:302 unknown type in regalloc: STRUCT DTAct
cgen.c:302 bad opcode in gmove INT -> STRUCT DTAct
cgen.c:302 error in regfree: 0 [0]
REGISTERmk: qc -FTVw cgen.c  : exit status=rc 387386: qc 387392: error R0
 <11> STRUCT DTAct act.c:269

act.c:250 unknown type in regalloc: STRUCT DTAct
act.c:250 bad opcode in gmove INT -> STRUCT DTAct
act.c:266 unknown type in regalloc: STRUCT DTAct
act.c:266 bad opcode in gmove INT -> STRUCT DTAct
act.c:266 error in regfree: 0 [0]
act.c:269 unknown type in regalloc: STRUCT DTAct
act.c:269 bad opcode in gmove INT -> STRUCT DTAct
act.c:269 error in regfree: 0 [0]
act.c:274 unknown type in regalloc: STRUCT DTAct
act.c:274 bad opcode in gmove INT -> STRUCT DTAct
act.c:274 error in regfree: 0 [0]
too many errors
mk: for(i in cc ...  : exit status=rc 382748: rc 387379: mk 387381: error
mk: date for (i ...  : exit status=rc 373781: rc 382226: mk 382227: error
cpu%

The patch below skips over non-supported architectures.  Is that
something we want?  This way, 'mk kernels' should work without a
problem (tested on amd64).  Then if someone works on getting those
architectures supported again in the future, they can be added back
in.
2021-08-17 14:00:47 +00:00
Sigrid Solveig Haflínudóttir 4e9f39a3ec ether82563: add 0x15bd i219-lm variant (thanks crab1) 2021-08-16 14:28:59 +00:00
Ori Bernstein a05d656054 qsort: ...forgot to include headers in the commit. 2021-08-11 13:10:14 +00:00
cinap_lenrek 5a15acc7f0 etheriwl: fix botched merge... 2021-08-06 10:05:23 +00:00
cinap_lenrek edfc72b500 [PATCH] Support for igfx on Celeron(R) 2957U (thanks Lorenzo Bivens)
> After some tinkering I managed to get igfx working on this device.
> hw cursor works.
> The only caveat is that I can only get video over hdmi...
> will revisit displayport later
2021-07-31 12:05:29 +00:00
cinap_lenrek 84b77568cd kernel: fix off by one for $cputype buffer (thanks anthony martin) 2021-07-28 22:55:17 +00:00
cinap_lenrek 37f5069426 kernel: increase bootfs.paq compression level and blocksize
With the intel wifi firmware, this saves around 3MB of the
kernel image size.
2021-07-28 00:38:00 +00:00
cinap_lenrek df04ea8d6c kernel: simplify /boot/boot: 28K down to less than 4K.
- avoid print() format routines (saves alot of code)
- avoid useless opens of /dev/cons (already done by initcode)
- avoid useless binds of /env and /dev (already done by initcode)
- do bind of /shr in bootrc, it is not needed by us
- we'r pid 1 so kernel will print the exit message for us
2021-07-27 18:21:08 +00:00
cinap_lenrek e4b5f170cf libc: change usize to 64-bit for amd64 and arm64, make memory(2) functions use usize 2021-07-25 15:54:22 +00:00
cinap_lenrek 8a8329ad95 bcm64: make the kernel use virtual timer counter register for cycles() 2021-07-25 14:12:17 +00:00
cinap_lenrek b7e67e9e36 kernel: page counts a ulong, not usize 2021-07-25 14:03:12 +00:00
cinap_lenrek c38fcb5dc3 arm64: use generic timer virtual counter for cycles()
We used to use performance cycle counter for cycles(),
but it is kind of useless in userspace as each core
has its own counter and hence not comparable between
cores. Also, the cycle counter stops counting when
the cores are idle.

Most callers expect cycles() to return a high resolution
timestamp instead, so do the best we can do here
and enable the userspace generic timer virtual counter.
2021-07-23 15:10:01 +00:00
cinap_lenrek 2c1727e55c /sys/src/9/mkfile: add bcm64 (thanks stuart morrow) 2021-07-22 18:30:38 +00:00
cinap_lenrek 006c4d7ffc archacpi: make *acpi=1 the default 2021-07-15 16:07:54 +00:00
cinap_lenrek 3b1c450cd5 ether82563: add pci id for i219-LM from ThinkPad P17 Gen1 Professional Mobile Workstation (thanks tschak909) 2021-07-15 07:50:56 +00:00
cinap_lenrek 4483500f62 pc, pc64: increase confmem slots to 64
Lenovo Thinkpad P17 Gen1 Professional Mobile Workstation
comes up with around 36 separate memory ranges.

ridiculous!
2021-07-14 17:06:28 +00:00
cinap_lenrek e8259861da virtio: set FeaturesOk flag after feature negotiation, and enable queues before DriverOk flag 2021-07-11 21:49:15 +00:00
cinap_lenrek f58d99aa7a virtio: add non-legacy virtio 1.0 drivers for disk and ethernet
The new interface uses pci capability structures to locate the
registers in a rather fine granular way making it more complicated
as they can be located anywhere in any pci bar at any offset.

As far as i can see, qemu (6.0.50) never uses i/o bars in
non-legacy mode, so only mmio is implemented for now.

The previous virtio drivers implemented the legacy interface only
which uses i/o ports for all register accesses. This is still
the preferred method (and also qemu default) as it is easier to
emulate and most likely faster.

However, some vps providers like vultr force the legacy interface
to disabled with qemu -device option "disable-legacy=on" resulting
on a system without a disk and ethernet.
2021-07-11 11:24:13 +00:00
cinap_lenrek c3589ef3cf kernel: export pcienumcaps() for custom capability enumeration in drivers (virtio)
This used to be a internal function, but virtio
uses multiple structures with the same cap type
to indicate the location of various register
blocks in the pci bars so export it.
2021-07-10 18:34:22 +00:00
cinap_lenrek c848ca6267 devmouse: default to no blanking instead of 30 minute blank timeout 2021-07-01 23:11:11 +00:00
Ori Bernstein c297482269 sdvirtio: accept multi-queue devices
Sdvirtio supports multiple queues per device.
We only use one queue, but we shouldn't skip the
devices because of that.
2021-05-31 10:59:45 -07:00
cinap_lenrek c2297ce5c1 kernel: use 64-bit virtual entry point for expanded header, document behaviour in a.out(6)
For 64-bit architectures, the a.out header has the HDR_MAGIC flag set
in the magic and is expanded by 8 bytes containing the 64-bit virtual
address of the programs entry point. While Exec.entry contains physical
address for kernel images.

Our sysexec() would always use Exec.entry, even for 64-bit a.out binaries,
which worked because PADDR(entry) == entry for userspace pointers.

This change fixes it, having the kernel use the 64-bit entry point
and document the behaviour in the manpage.
2021-05-29 14:18:35 +02:00
cinap_lenrek 15b903c4e1 pc64: avoid getcr3() in mmuflushtlb()
it turns out that calculating physical address of pml4 is faster
than reading the machine register, so pass it explicitely.
2021-05-12 22:40:51 +02:00
cinap_lenrek 18b3847aef devvmx: remove unncessary locking in gotcmd() sleep test function 2021-05-12 22:24:36 +02:00
cinap_lenrek c0d4498ab8 kernel: clean up Mach structure
Remove unused fields and factor common fields into a
new PMach struct in port/portdat.h.

The fields machno, splpc and proc are not moved to
PMach as they are part of the known offsets from
assembly (l.s).
2021-04-25 17:41:34 +02:00
cinap_lenrek 9f54c28317 bcm: try ATAGS/DTB pointer from R2 on entry 2021-04-25 17:36:11 +02:00
Sigrid 192c1fd73a nusbrc: rndis with csp 0104ef 2021-04-20 18:12:54 +02:00
cinap_lenrek 52a367f3ea devloopback: fix wrong device character (thanks romano)
devloopback was changed from using #X to #λ awhile ago; one bit was missed.
2021-04-18 16:20:04 +02:00
cinap_lenrek 777b1949b2 nusbrc: ignore rndis ethernet in /rc/bin/nusbed, handled by /sys/src/9/boot/nusbrc (thanks romano) 2021-04-08 21:57:24 +02:00
cinap_lenrek 295acd7e0d kernel: get rid of physical page bank array and use conf.mem[] instead
We can take advantage of the fact that xinit() allocates
kernel memory from conf.mem[] banks always at the beginning
of a bank, so the separate palloc.mem[] array can be eleminated
as we can calculate the amount of non-kernel memory like:

upages = cm->npage - (PGROUND(cm->klimit - cm->kbase)/BY2PG)

for the number of reserved kernel pages,
we provide the new function: ulong nkpages(Confmem*)

This eleminates the error case of running out of slots in
the array and avoids wasting memory in ports that have simple
memory configurations (compared to pc/pc64).
2021-04-02 20:23:25 +02:00
Romano a398a09783 [9front] [patch] nusb/ether -t rndis 2021-04-01 12:54:08 +02:00
cinap_lenrek a2ebe5c79a devfs: fix locking and ignore undocumented "fsdev:\n" configuration signature
The confstr was shared between readers so seprintconf() could
write concurrently to that buffer which is not safe.

This replaces the shared static confstr[Maxconf] buffer with a
pointer that is initially nil and a buffer that is alloced on
demand.

The new confstr pointer (and buffer) is now only updated while
wlock()ed from the new setconfstr() function.

This is now done by mconfig() / mdelctl() just before releasing
the wlock.

Now, rdconf() will check if confstr has been initialized, and
test for it again while wlock()ed; making sure the configuration
is read only once.

Also, rdconf() used to check for a undocumented "fsdev:\n" string
at the beginning of config data tho that was never documented.

This changes mconfig() to ignore that particular signature so
the example from the manpage will work as documented.
2021-03-31 17:49:10 +02:00
cinap_lenrek 3841a46421 kernel: remove ucalloc.c duplicates 2021-03-13 14:57:53 +01:00
cinap_lenrek 7c62c12701 kernel: use 64-bit mask to avoid compiler warning in port/pci.c 2021-03-13 14:20:00 +01:00
cinap_lenrek a0404ff582 devpccard, pci: fix pccard support and handle pci expansion roms
let pci.c deal with the special cardbus controller bar0 and
expansion roms.

handle apic interrupt routing for devices behind a cardbus slot.

do not free the pcidev on card removal, as the drivers
most certanly are not prepared to handle this yet.
instead, we provide a pcidevfree() function that just unlinks
the device from pcilist and the parent bridge.
2021-03-01 17:24:54 +01:00
cinap_lenrek be782ef435 bcm: change color chan to RGB24 (thanks p.kosyh)
p.kosyh writes:

Hello!  I finally bought rpi4 4Gb specially for 9front. It seems,
that default bpp of framebuffer is 16.  I changed it to 24 (via
cmdline.txt and config.txt) and found, that rendering is much faster!
(May be due removing overheads in 16->24 conversions?)

But on rpi4 r and b channels are swapped.  So, i changed BGR24 to
RGB24 in bcm/screen.c and now it works fine!
2021-02-28 13:31:49 +01:00
cinap_lenrek dab168e6bd ether82563: add pci id for i219-LM on thinkcenter (easypeasy, thanks hiro) 2021-02-20 19:06:59 +01:00
cinap_lenrek 8b817fd6c0 pc/devarch: use m->cpumhz instead of recalculatin it 2021-02-20 13:08:59 +01:00
cinap_lenrek d5f9514304 merge 2021-02-06 13:50:06 +01:00
cinap_lenrek efcfdd23d7 bcm64: get inbound and outbound pci window base address from device tree
On the pi400, the xhci reset firmware mailbox request
assumes that the pci windows match the ones specified
in the device tree. The inbound window (pcidmawin)
also varies now depending on the amount of memory
installed.

It is all pretty ridiculous, as the firmware could as
well just read the pci controllers hardware register
to determine the window configuration and the os could
keep a nice simple 1:1 mapping (with pci dma addresses
== physical addresses).
2021-02-06 13:47:45 +01:00
cinap_lenrek 0e381493bf pc: increase number of Conf.mem[] entries from 4 to 16 2021-02-06 13:33:58 +01:00
cinap_lenrek e9af397dc7 pc, pc64: warn when running out of conf.mem[] entries in meminit() 2021-02-06 13:33:27 +01:00
Michael Forney 49220af76e [9front] [PATCH] audiohda: add PCI ID for Intel C610/X99
---
Tested and seems to work fine.
2021-02-03 16:19:57 -08:00
cinap_lenrek 081f98de6c audiohda: Add AMD Starship/Matisse HD Audio Controller (thanks uramekus) 2021-01-18 00:51:20 +01:00
cinap_lenrek a05bab362f pc, pc64: add minimal HPET driver to measure LAPIC and TSC frequencies
This adds the new function pointer PCArch.clockinit(),
which is a timer dependent initialization routine.
It also takes over the job of guesscpuhz(). This way, the
architecture ident code can switch between different
timers (i8253, HPET and XEN timer).
2021-01-17 21:21:12 +01:00
cinap_lenrek 999e98b9b8 usbehci: use 64-bit base address, remove resetlck, simplify scanpci() 2021-01-17 11:55:39 +01:00