Fixed copyright

Fixed name in copyright
This commit is contained in:
2024-04-07 03:53:17 +05:00
parent 5b50bbcb90
commit 0dfa64d2b6
7 changed files with 37 additions and 76 deletions

View File

@@ -1,4 +1,4 @@
;; Copyright (C) 2022, Michael Frolov(aka Doczom)
;; Copyright (C) 2022-2024, Mikhail Frolov aka Doczom
;; SDHC commands
RESP_TYPE:
@@ -441,6 +441,7 @@ proc READ_MULTIPLE_BLOCK
ret
endp
;-----------------------------------------------------------------------------
; block write
;cmd24 -
@@ -496,6 +497,7 @@ proc LOCK_UNLOCK
ret
endp
;-----------------------------------------------------------------------------
; SDIO mode
; Îòëè÷èÿ îò SD memory:

View File

@@ -1,4 +1,4 @@
;; Copyright (C) 2022-2023, Michael Frolov aka Doczom
;; Copyright (C) 2022-2024, Mikhail Frolov aka Doczom
;; SD host controller driver.
;;
;; !!!!WARNING!!!!
@@ -23,7 +23,7 @@
;; - add ADMA2
;; - add SDUC support
format PE native
format PE native 0.05
entry START
use32
@@ -258,14 +258,6 @@ struct SDHCI_SLOT
ends
;struct SDHCI_SLOT
; reg_map rd 1; pointer to register map
; Capabilities rd 2 ; qword - save Capabilities
; divider400KHz rd 1 ; for SDCLK frequency Select
; divider25MHz rd 1
; divider50MHz rd 1
; max_slot_amper rd 2
;ends;
count_controller: dd 0
list_controllers:
.next: dd list_controllers ; pointer to first item list
@@ -403,8 +395,6 @@ proc sdhci_init
and edx, 111b
shr eax, 4
and eax, 111b
;cmp edx, 5 ; check bar, if bar > 5
;ja .err_first_bar
mov ecx, edx
add ecx, eax
cmp ecx, 5
@@ -523,6 +513,7 @@ endp
; eax - ptr base reg map
; out: eax - error code 0 - good; other - init error code
proc sdhci_slot_init
mov [esi + SDHCI_SLOT.type_card], 0
; save registers Capabiliti and Max Current Capabilities
mov ebx, [eax + SDHC_CAPABILITY]
mov [esi + SDHCI_SLOT.Capabilities], ebx
@@ -543,7 +534,7 @@ proc sdhci_slot_init
and eax, 11111111b ; 1111 1111
mov ebx, 25
xor edx, edx
div ebx ; 25 ìãö
div ebx ; 25 Mhz
bsr ecx, eax
xor edx, edx
bsf edx, eax
@@ -813,6 +804,7 @@ proc card_init
call SEND_RCA
call SELECT_CARD
; get CCCR data (SD, SDIO, CCCR version)
; set 4bit mode
; set hidn speed
@@ -841,6 +833,7 @@ proc card_init
DEBUGF 1,'SDHCI: Card init - SDIO card\n'
ret
.sdio_end_find:
mov eax, [esi + SDHCI_SLOT.base_reg_map]
DEBUGF 1,'SDHCI: SDIO card not supported. Power and clock stoped\n'
and dword[eax + SDHC_CTRL1], not 0x0100 ; stop power
and dword[eax + SDHC_CTRL2], not 0x04 ; stop SD clock
@@ -948,6 +941,7 @@ proc card_destruct
.no_sdio:
;TODO: î÷èùàåì âñå ðåãèñòðû ñâÿçàííûå ñ ýòèì ñëîòîì
mov [esi + SDHCI_SLOT.disk_hand], 0
mov [esi + SDHCI_SLOT.type_card], 0
;stop power and clock gen
and dword[eax + SDHC_CTRL1], not 0x0100 ; stop power
and dword[eax + SDHC_CTRL2], not 0x04 ; stop SD clock
@@ -1126,7 +1120,7 @@ proc service_proc stdcall, ioctl:dword
jz @f
cmp dword[eax + IOCTL.out_size], sizeof.SDHCI_DEVICE
jnz .err_exit
jb .err_exit
mov ecx, sizeof.SDHCI_DEVICE
rep movsb
@@ -1134,7 +1128,7 @@ proc service_proc stdcall, ioctl:dword
jmp .exit
@@:
cmp dword[eax + IOCTL.out_size], 8 ; for 2 ptr on root list
jnz .err_exit
jb .err_exit
movsd
movsd

BIN
sdhci.sys

Binary file not shown.

View File

@@ -1,4 +1,4 @@
;; Copyright (C) 2022, Michail Frolov(aka Doczom)
;; Copyright (C) 2022-2024, Mikhail Frolov aka Doczom
;; SDHC ADMA function
@@ -16,33 +16,6 @@ proc destruct_adma2_table
ret
endp
; for ADMA1
proc create_adma1_table
ret
endp
proc destruct_adma1_table
ret
endp
; for SDMA mode and for creating ADMA tables
; ecx = line address
; edx = length
; OUT: ecx = virtual addr on table phys addrs on blocks in 512 byte
; WARNING!!! buffer align 9
; 4096 = 0..4 sectors + 1022*4 sectors + 0..4 sectors
;proc create_mem_table
;
; ret
;endp
;proc destruct_mem_table
;
; ret
;endp
; SDMA
; send command

View File

@@ -1,18 +1,15 @@
format PE native
format PE native 0.05
entry START
use32
DEBUG = 1
__DEBUG__ = 1
__DEBUG_LEVEL__ = 1 ; 1 = verbose, 2 = errors only
section '.flat' code readable writable executable
include 'drivers/proc32.inc'
include 'drivers/struct.inc'
include 'drivers/macros.inc'
include 'drivers/peimport.inc'
include 'drivers/fdo.inc'
struct IMPORT_SDIO_FUNC
reg_sdio rd 1
unreg_sdio rd 1
@@ -20,70 +17,71 @@ struct IMPORT_SDIO_FUNC
cmd52 rd 1
cmd53 rd 1
ends
proc START c, state:dword, cmdline:dword
push esi ebx
cmp [state], DRV_ENTRY
jne .stop_drv
DEBUGF 1,"SDIO-TEST: Loading driver\n"
invoke GetService, sdhci_str
DEBUGF 1,"SDIO-TEST: Get service %x\n", eax
test eax, eax
jz .err
mov [sdhci_handle], eax
; get import sdio func
mov [sdhci_handle], eax ; get import sdio func
invoke ServiceHandler, ioctl_get_export
; reg sdio
test eax, eax
jnz .err
DEBUGF 1,"SDIO-TEST: import table %x\n", [ptr_import_table]
mov eax, [ptr_import_table]
mov eax, [ptr_import_table] ; reg sdio
stdcall [eax + IMPORT_SDIO_FUNC.reg_sdio], drv_table_func
DEBUGF 1,"SDIO-TEST: Reg sdio %x\n", eax
test eax, eax
jz .err
mov [sdio_hand], eax
; TODO: scan dev
; reg driver
invoke RegService, drv_name, 0
invoke RegService, drv_name, 0 ; reg driver
pop ebx esi
ret
.stop_drv:
; unreg
.err:
pop ebx esi
xor eax, eax
ret
endp
proc check_dev stdcall ptr_slot: dword
push esi ebx edi
; Âûâîä ñîîáùåíèÿ îá îáíàðóæåíèè SDIO óñòðîéñòâà
DEBUGF 1,"SDIO-TEST: Check SDIO dev\n"
mov esi, [ptr_slot]
mov edi, [ptr_import_table]
; âûâîä âåðñèè SDIO èíòåðôåéñà
mov ecx, 0
call [edi + IMPORT_SDIO_FUNC.cmd52]
mov ecx, eax
shr al, 4
and cl, 0x0F
and al, 0x0f
and cl, 0xfF
and al, 0xff
DEBUGF 1,"SDIO-TEST: SDIO ver= %d CCCR ver = %d\n", al, cl
; âûâîä êëàññà FBR1
mov ecx, (0x100 shl 9)
call [edi + IMPORT_SDIO_FUNC.cmd52]
and al, 0x0f
DEBUGF 1,"SDIO-TEST: FBR interface code= %d\n", cl
and al, 0xff
DEBUGF 1,"SDIO-TEST: FBR interface code= %d\n", al
mov ecx, (0x109 shl 9)
call [edi + IMPORT_SDIO_FUNC.cmd52]
and al, 0xff
DEBUGF 1,"SDIO-TEST: 0x109: %d\n", al
mov ecx, (0x10a shl 9)
call [edi + IMPORT_SDIO_FUNC.cmd52]
and al, 0xff
DEBUGF 1,"SDIO-TEST: 0x10a: %d\n", al
mov ecx, (0x10b shl 9)
call [edi + IMPORT_SDIO_FUNC.cmd52]
and al, 0xff
DEBUGF 1,"SDIO-TEST: 0x10b: %d\n", al
pop edi ebx esi
mov eax,[ptr_slot]
ret
endp
proc int_handle stdcall pdata: dword
ret
endp
proc close_dev stdcall pdata: dword
DEBUGF 1,"SDIO-TEST: Close sdio device\n"
ret
@@ -96,23 +94,17 @@ sdhci_handle: dd 0
dd 0
dd ptr_import_table
dd 4
ptr_import_table: dd 0
sdio_hand: dd 0
PDATA_STRUCT: dd 0
drv_table_func:
dd check_dev
dd int_handle
dd close_dev
sdhci_str: db 'SDHCI',0
drv_name: db 'SDIO-TEST',0
align 4
data fixups
end data
include_debug_strings

Binary file not shown.

View File

@@ -1,4 +1,4 @@
;; Copyright (C) 2022, Michael Frolov(aka Doczom)
;; Copyright (C) 2022-2024, Mikhail Frolov aka Doczom
;; SDIO subsystem SDHCI driver. Base functons for working.