2
0
mirror of https://git.missingno.dev/kolibrios-nvme-driver/ synced 2024-12-22 13:58:47 +01:00
Commit Graph

223 Commits

Author SHA1 Message Date
7bba4781fb feat: implement disk registering code 2024-06-25 18:37:04 -04:00
43f29c791a add num field to each detected NVMe device 2024-06-25 15:44:04 -04:00
f612befee6 implement reporting on namespace info 2024-06-25 15:24:52 -04:00
3db664b53e feat: add function table and fix determine_active_nsids 2024-06-25 14:37:19 -04:00
b4d3c82480 fix: comment out excessive debug lines
Printing too many messages to the screen much causes KolibriOS to crash,
so we have to remove them for now
2024-06-25 14:29:09 -04:00
603a48e351 refactor: change NVM_ASQS to 63 2024-06-25 14:28:29 -04:00
85bab62280 feat: implement is_queue_full 2024-06-24 17:37:56 -04:00
8f806cfb6f lots of refactoring 2024-06-24 16:55:29 -04:00
7782f762ef add IRQ completion queue head pointer wraparound and NSID identification 2024-06-24 14:53:15 -04:00
20b7315829 small changes to determine_active_nsids 2024-06-22 16:58:41 -04:00
0b16efacd3 separate determine_active_nsids and is_active_namespace 2024-06-22 15:18:43 -04:00
1c69e25c2b chore: add comments + save value of IDENTC.nn 2024-06-22 14:43:08 -04:00
bb59692ca4 add nn field to pcidev struct 2024-06-22 14:42:30 -04:00
43deaa0e59 feat: implement determine_active_nsids 2024-06-22 14:32:54 -04:00
d6f62cc4f3 add nsids field to pcidev struct 2024-06-22 14:32:40 -04:00
7e30ce5065 chore: check if nvme_init returns an error 2024-06-21 18:33:24 -04:00
bd69938eb8 refactor: put nvme_cmd_wait directly in sqytdbl_write instead
This also fixes the strange crashing (I think... I have not been able to
replicate it) when creating the I/O queues, as I think what happens is
since I didn't wait for the I/O completion queue to be created, the CQID
may not be valid when creating the I/O submission queue which is why the
system weirded out like that.
2024-06-21 16:59:10 -04:00
2fc8e7f34e perf: remove unneeded timeout code in controller reset/startup
Due to a misunderstanding, I thought the spec stated that you have to
wait for a specified duration after CSTS.RDY changes, but in reality
it's just the timeout value. I've included the timeout on debug builds
anyway just so you can see the messages it prints to the board without
dissapearing instantly.
2024-06-21 14:22:22 -04:00
5b1f690ef2 refactor: allocate ring buffers for submission/completion queues 2024-06-21 14:17:18 -04:00
a1a24073c3 chore: remove write_admin_cmd 2024-06-21 13:54:40 -04:00
38b93a8240 refactor: fix sqytdbl_write and dont use write_admin_cmd for admin command submissions anymore 2024-06-21 13:49:05 -04:00
c6c6aea5ea feat: implement nvme_write and sqytdbl_write + add TODOS 2024-06-21 13:33:32 -04:00
6360db0733 fix: remove long delay after set features cmd
This also fixes the `nvme_cmd_wait` function.
2024-06-20 18:31:31 -04:00
ca5ccaa86b refactor(nvme_init): use separately allocated queue pointers instead of using dptr 2024-06-20 18:14:28 -04:00
0cb86ee2ab refactor(nvme_init): pass nullptr as parameter to set_features
Getting number of queues doesn't involve DPTR field in any way at all,
so no point in having it there.
2024-06-20 16:29:52 -04:00
528d469ab0 refactor: allocate sq_ptr/cq_ptr for each queue 2024-06-20 16:27:09 -04:00
2f07187623 fix fatal bugs in write_admin_cmd and dont handle IRQs if they dont belong to the NVMe device 2024-06-20 15:55:32 -04:00
b0f9e47c9b remove some debug messages 2024-06-19 13:50:54 -04:00
5974fc7fb0 feat: create I/O queues and fix other admin commands 2024-06-18 18:21:32 -04:00
abeaf82e38 feat: get set_features working and improve IRQ handler 2024-06-14 20:26:41 -04:00
f1caae2a8c refactor 2024-06-14 16:12:53 -04:00
2eb22ef14b fix IRQ, set_features, abort command bugs 2024-06-13 14:09:13 -04:00
3b1028b5dd add code for freeing cid slots 2024-06-13 13:53:59 -04:00
9c1147b31d fix admin commands and auto assign CIDS 2024-06-13 12:46:34 -04:00
544565bde9 wip: controller initialization 2024-06-12 18:03:01 -04:00
5f43171b7e add new fields and constants 2024-06-12 18:02:46 -04:00
569a11e64f add lib.asm 2024-06-12 18:02:32 -04:00
8f67604ddf lots of fixes 2024-06-12 15:47:32 -04:00
cc3e3f6ec4 refactor some stuff 2024-06-11 19:57:02 -04:00
4e9a9cc8c2 more refactoring and fixes 2024-06-09 18:13:01 -04:00
83004aca87 add NVM_QUEUE struct 2024-06-09 18:12:45 -04:00
34bfcf8719 fix nvme_identify and irq_handler 2024-06-09 14:57:42 -04:00
dd3ebb1716 wip: add interrupt handling code 2024-06-09 13:07:01 -04:00
482d186c1a change pcidev.dstrd to byte 2024-06-09 13:06:40 -04:00
bc3435ad09 add new fields to pcidev struct 2024-06-08 14:32:36 -04:00
c177893309 apply some fixes for submitting admin commands 2024-06-08 14:32:25 -04:00
81a102ad6a chore: set to filetype to asm in vim 2024-06-08 12:25:46 -04:00
cec15b9114 add get_log_page (incomplete) 2024-06-08 12:25:29 -04:00
04f89899de rename: LPI to LID 2024-06-06 14:25:24 -04:00
1444ffc605 add log page identifier constants 2024-06-06 14:22:32 -04:00
d5a4850be7 style: rename pcidev.mmio_ptr to pcidev.io_addr 2024-06-06 14:00:10 -04:00
654b095d6f add assertions for nvme_identify and wip implementation of create_namespace 2024-06-06 13:28:31 -04:00
8b8dca1c05 add NSGRANLS struct and controller version constants 2024-06-06 13:28:02 -04:00
f4ded13c9a feat: implement set_features and abort 2024-06-06 12:43:57 -04:00
a693301a4c fix: set SQ_ENTRY.CDW0 to valid value in commands 2024-06-04 16:12:19 -04:00
c74cff54cb add set_cdw0 proc 2024-06-04 16:06:32 -04:00
721fe6582f add constants 2024-06-04 15:59:25 -04:00
786f696de8 feat: implement get_features 2024-06-04 15:43:12 -04:00
ee43919267 feat: implement delete_io_submission_queue and delete_io_completion_queue 2024-06-04 15:09:39 -04:00
021012d350 feat: implement create_io_submission_queue 2024-06-04 15:02:44 -04:00
2b9f8d7f37 feat: implement create_io_completion_queue 2024-06-04 14:44:06 -04:00
80eac9303c remove unused code and fix sqytdbl_write 2024-06-04 13:47:08 -04:00
4041563623 fix embarassing bugs 2024-06-03 16:49:42 -04:00
09aa423d8d fix: irq_handler 2024-06-03 14:28:35 -04:00
356350e593 wip: implement IRQ 2024-06-03 14:14:59 -04:00
0da7af8254 change NVM_ASQS size 2024-06-03 14:14:36 -04:00
7393da0eb5 wip: submit command support 2024-06-03 12:02:36 -04:00
a0cc2ec6a5 add sqytdbl_write and cqyhdbl_write 2024-05-30 17:11:24 -04:00
1197535b9c attach interrupt handler 2024-05-30 16:06:50 -04:00
c462215a17 add ipin and iline fields to pcidev struct 2024-05-30 16:06:27 -04:00
685d2c3f1f map ACQ and ASQ 2024-05-30 14:21:45 -04:00
f5534dbdcf remap entire MMIO 2024-05-29 19:29:01 -04:00
97d9fc0c76 perf: add padding in pcidev 2024-05-29 19:28:41 -04:00
cbae10b5be fix(pow2): add label 2024-05-29 15:57:45 -04:00
cde3e5b9f8 perf(pow2): remove loop 2024-05-29 15:56:56 -04:00
8620d5f2a0 remove: proc get_dstrd 2024-05-29 15:45:07 -04:00
e25a3cd92a wip: remap entire MMIO 2024-05-29 15:43:14 -04:00
dd16f8428a add dstrd field to pcidev struct 2024-05-29 15:42:03 -04:00
87983602bb fix: field padding in structs 2024-05-29 13:49:49 -04:00
182f82e20d add IDENTN data structure 2024-05-29 13:16:26 -04:00
739fa59206 fix: SQ_ENTRY field padding 2024-05-28 21:46:07 -04:00
b15fb4d9a2 fix IDENTC struct 2024-05-28 20:24:57 -04:00
139e201f3e fix: NVME_MMIO field padding 2024-05-28 18:02:46 -04:00
ff1ebbc7c6 add more struct fields and change NVM_ASQS value 2024-05-28 17:55:06 -04:00
3124682b45 fix(nvme_identify): error 2024-05-28 15:02:24 -04:00
f372a0c9dd minor tweaks 2024-05-28 15:01:25 -04:00
a181eccd9c fix: allocate appropriate number of pages 2024-05-28 12:26:27 -04:00
e7e5ac98f0 minor performance tweaks and fixes 2024-05-26 17:19:25 -04:00
ae943e89d7 feat: implement nvme_controller_start 2024-05-26 17:02:56 -04:00
a57d980846 finish controller configuration 2024-05-26 16:54:59 -04:00
46076ba2f0 fix: indentation 2024-05-26 13:24:34 -04:00
d172666be2 wip: setup controller configuration 2024-05-25 20:37:42 -04:00
a940d7e963 add more debug messages 2024-05-25 19:26:51 -04:00
78af4fb996 fix lots of nasty bugs! 2024-05-25 18:56:58 -04:00
e2e1e50490 implement more stuff 2024-05-23 19:15:34 -04:00
e400cfa66c refactor: remove controller version compatability check 2024-05-13 12:08:05 -04:00
652c024779 add some more constants and rename some CQ_ENTRY fields 2024-05-06 14:07:29 -04:00
0dd5162d23 add CQ_ENTRY struct 2024-05-06 12:55:50 -04:00
d86aebd9b9 style: remove reserved field in NVME_IDENT_CONTROLLER 2024-05-03 18:08:18 -04:00
34e7c9a535 chore: only include debug strings on debug builds 2024-05-03 18:07:31 -04:00
74c5edd315 lots of refactoring and fixes 2024-04-28 21:06:13 -04:00
7a2af2dca9 refactor: update pcidev struct and add NVM_SUPPORTED_CONTROLLER_VERSION 2024-04-28 21:03:10 -04:00
9bf84c4953 fix PDEBUGF macro
note to self: be very careful when using registers in macros ;)
2024-04-28 21:02:04 -04:00
69445bb20f fix some stuff 2024-04-28 13:50:40 -04:00
3142d5bda8 update pcidev struct and edit variables 2024-04-27 20:12:16 -04:00
481fd087bd chore: fix some bugs 2024-04-27 20:11:57 -04:00
41f9a71103 update PDEBUGF 2024-04-27 20:10:53 -04:00
ea51f45bc6 refactor: have debug logs show PCI device info as well 2024-04-21 17:10:09 -04:00
a4a57c3b44 rename PCI_DEBUGF macro to PDEBUGF 2024-04-21 17:05:47 -04:00
376e133db7 PCI_DEBUGF: add variadic argument to DEBUGF 2024-04-20 20:32:41 -04:00
f1f44c1357 add PCI_DEBUGF macro 2024-04-20 20:29:06 -04:00
fd468c5bda add macros.inc 2024-04-20 20:28:43 -04:00
634a199176 fix nvme.sys dependencies 2024-04-20 20:28:06 -04:00
06cfd44233 add more PCI device initialization code 2024-04-19 23:39:34 -04:00
f652c5f362 refactor: remove some fields from pci_dev and add some constants 2024-04-19 23:37:14 -04:00
c74460ded2 ocd: adjust spacing properly 2024-04-17 16:04:49 -04:00
99dc68851a update license header 2024-04-17 15:44:10 -04:00
d0ddd1233d refactor: organize code into proper components 2024-04-17 15:35:01 -04:00
bc11bcfa37 more refactoring 2024-04-01 19:47:14 -04:00
43a3db6f1e fix errors 2024-03-31 16:13:17 -04:00
ab0e73b2b5 add more stuff 2024-03-31 15:43:38 -04:00
62c9ec7946 huge driver revamp 2024-03-29 23:42:01 -04:00
50addb6fd2 first commit 2024-03-28 18:43:18 -04:00