d36f13f7af
fix: initialize command mutexes correctly
2024-08-01 12:08:41 -04:00
0cbf662a9f
perf: use memcpyd instead of memcpy
2024-08-01 12:02:07 -04:00
7cc1601d90
add assertions to make sure submission and completion queue sizes are the same
2024-07-31 16:05:55 -04:00
e9f371d20b
fix: assign CDW10.QSIZE in create I/O queues to correct value
2024-07-31 15:48:38 -04:00
1463187a62
add debug message for showcasing CAP.MQES
2024-07-31 15:36:37 -04:00
edafe73367
rename: lib.asm -> lib.inc
2024-07-31 15:25:23 -04:00
e8a5910681
refactor: move NVMe commands to a separate file
2024-07-31 15:24:54 -04:00
534103061c
important bug fix and some micro optimizations
...
As for the fix, the submission queues weren't properly being zeroed out
due to a small typo. The other stuff has some commented out stuff that
I'm currently debugging and working on.
2024-07-31 15:11:21 -04:00
a88a44c627
initialize command entries
2024-07-30 17:22:28 -04:00
6a8ab65661
another bug fix (2)
2024-07-30 15:09:49 -04:00
25ee3eb491
another bug fix
2024-07-30 14:59:46 -04:00
c3901b163e
bug fixes
2024-07-30 14:38:53 -04:00
dd4db45869
fix: use correct NVMe disk parameter
2024-07-30 13:52:37 -04:00
362a97ab12
chore: remove useless constants
2024-07-30 13:49:27 -04:00
6262634324
feat: implement support for multiple NVMe drives
2024-07-30 13:48:50 -04:00
0d7f6b1c8f
misc: set vim syntax to fasm
2024-07-30 12:39:00 -04:00
d153c63abb
remove CNS byte check in nvme_identify
2024-07-30 11:31:51 -04:00
c9e138d89f
add verbose debug logs in nvme_init
2024-07-27 12:16:56 -04:00
bee583765f
disable MSI interrupts if present
2024-07-26 14:42:46 -04:00
3d78f22409
make sure interrupts are enabled in PCI header
2024-07-26 13:14:50 -04:00
18b76f70b2
fix(nvme_poll): jump after timeout
2024-07-26 06:14:45 -04:00
7c4626b5f1
fix: initialize NSINFO.nsid in nvme_init
2024-07-25 18:50:01 -04:00
4b9fe7f4c0
significant refactoring
...
* Removed useless `nvme_wait` call
* Remove phase tag bit check in favor of spinlock checking
* Added back in queue wrapping (though, it still needs work)
* Fix in `is_queue_full` which didn't pop bx off the stack when
returning in some circumstances
2024-07-25 18:34:54 -04:00
0a2b3bfe9d
remove useless phase_tag field
2024-07-25 18:31:15 -04:00
80e64d4d70
add LOCK_SPINLOCK macro
2024-07-25 18:30:28 -04:00
01fc77ba69
refactor: print controller version during initialization
2024-07-25 14:14:29 -04:00
6c120b8767
add TODO
2024-07-23 19:43:37 -04:00
a5c1920c0e
more bloat removal
2024-07-23 14:59:08 -04:00
835840231f
more code removal
2024-07-23 14:14:43 -04:00
39dcfd2edc
perf: remove some unneeded code bloat
2024-07-23 14:10:42 -04:00
1b88a4ff17
feat: add in write to disk functions and remove unnecessary div in nvme_init
2024-07-23 13:04:52 -04:00
e3241e35cc
perf(size): remove useless pow2 implementation
2024-07-22 14:19:54 -04:00
1ea8733a66
fix: PRP list creation bug
2024-07-21 17:08:51 -04:00
1599185ef4
fix(nvme_readwrite): free allocated PRP list after I/O command completion
2024-07-21 14:21:10 -04:00
7e71c33f3f
fix: nvme_readwrite and build_prp_list
...
This fixes the number of PRPs calculation before build_prp_list is
invoked. It also accounts for the fact that the NLB field in the NVMe
I/O read and write commands is a 0-based value, unlike numsectors.
start_sector is also converted into the appropriate LBA number as it
should be before sending the I/O command.
2024-07-21 14:14:04 -04:00
bb952838ca
fix: DiskAdd string
2024-07-20 17:20:32 -04:00
0eea7a6130
refactor: tweak some things
...
First of all, the driver will now abort initialization if it encounters
the first found namespace LBADS is not 512, since KolibriOS doesn't
support a LBADS greater than 512 as of now.
This commit also removes verbose debug logs and adds appropriate error
codes to nvme_readwrite
2024-07-20 16:38:12 -04:00
c21376dde4
add IOCTL error codes
2024-07-18 17:58:15 -04:00
9632b2841d
fix: apply PRP offset error fix
2024-07-18 17:24:28 -04:00
1e315791fb
fix: PRP list allocation
2024-07-18 17:01:26 -04:00
b88c5185a7
fix: get correct physical address of PRP2
2024-07-18 15:17:27 -04:00
a1639a3b9b
more fixes in alloc_dptr
2024-07-12 15:38:45 -04:00
48fef9b8d7
fix PRP2 alignment
2024-07-12 14:03:19 -04:00
a8aafb415f
fix: initialize prp_list before PRPs
2024-07-12 13:59:54 -04:00
e9de569036
apply some fixes
2024-07-12 13:55:44 -04:00
87fa0e0e3f
refactor build_prp_list and remove free_prp_list
2024-07-12 13:33:26 -04:00
52831db8f8
fix call to alloc_dptr
2024-07-11 17:03:39 -04:00
8eb5990c32
remove a lot of code, refactor alloc_dptr to use buf directly
2024-07-11 17:02:30 -04:00
becabd38b5
fix more stuff
2024-07-11 16:19:42 -04:00
7181653389
fix(build_prp_list): add correct return value
2024-07-11 13:39:05 -04:00
8101007350
perf: dont use recursion for build_prp_list + remove redundant calls
2024-07-11 13:37:05 -04:00
1f5815351c
fix(nvme_readwrite): make numsectors 0 if no sectors were written
2024-07-11 12:21:04 -04:00
b57c530854
feat: get reading from PRP2 entry working
2024-07-09 16:48:39 -04:00
f3a8ed0f6f
feat: get reading from single prp entry working
2024-07-09 15:43:45 -04:00
405dcb5155
more fixes to nvme_io_rw, alloc_dptr, write_prp_buf (2)
2024-07-09 14:51:48 -04:00
c9143ca99d
more fixes to nvme_io_rw and alloc_dptr
2024-07-09 13:38:55 -04:00
66d24f8e49
fix(nvme_readwrite): PRP2 checking
2024-07-08 16:30:29 -04:00
b21f83fef0
refactor: replace memset with memsetdz
2024-07-08 15:49:43 -04:00
87afd80486
fix writing to PRP entries
2024-07-08 14:49:43 -04:00
092c655593
another indentation fix
2024-07-05 17:30:22 -04:00
f93b16f3bd
style: fix indentation
2024-07-05 17:27:38 -04:00
14f01df0f7
style: fix indentation
2024-07-05 17:11:51 -04:00
f689eb5b2c
feat: add read functionality (to be tested)
2024-07-05 16:02:11 -04:00
b6e6a69de7
implement allocating and freeing PRP lists
2024-07-05 14:05:52 -04:00
d4bb46c00b
some refactoring and fixes
2024-07-04 14:42:06 -04:00
b011dae650
refactor: build PRP list in separate function
2024-07-03 16:44:23 -04:00
06c0abac6a
wip: implement code for allocating PRP entries and lists
2024-07-03 15:53:32 -04:00
038e994d48
refactor: replace jl/jg with jb/ja respectively
2024-07-03 12:36:31 -04:00
5f2adab1ab
wip: read command
2024-07-01 17:10:36 -04:00
383190e462
feat: implement I/O read command
2024-07-01 13:56:00 -04:00
2d1e0d4aa4
fix: write command and nvme_cmd_wait hanging
2024-07-01 13:34:12 -04:00
76f94d74e1
nvme_init: check MQES
2024-06-27 19:19:06 -04:00
274a5681a2
more I/O command fixes
2024-06-27 18:31:51 -04:00
1f4b25a309
more fixes
2024-06-27 17:10:25 -04:00
34ff6d786e
fix: initialize I/O queues correctly
2024-06-27 15:55:29 -04:00
5bc4a832f1
feat: add support for consuming completion queues entries from multiple queues
2024-06-27 15:19:32 -04:00
ef8087f2fd
fix: mask interrupts for I/O queue 1
2024-06-27 15:13:37 -04:00
6c82778503
tidyup IRQ handler, plus some other fixes
2024-06-27 15:12:52 -04:00
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