; BHTSDDR.INF, BHT Integrated MMC/SD Controller INF file
; Copyright (c) BHT Corp. 
; For Win10/Win11

[Version]
Signature   = "$Windows NT$"
Class       = SCSIAdapter
ClassGuid   = {4D36E97B-E325-11CE-BFC1-08002BE10318}
Provider    = %BayHubTech%
DriverVer = 10/19/2023,2.1.106.10020
Catalogfile = bhtsddr.cat

[SourceDisksNames]
1 = %bhtsddr.DriverDisk%

[SourceDisksFiles]
bhtsddr.sys = 1
bhtv5Icon.dll = 1

[DestinationDirs]
DefaultDestDir = 12
Copybhtv5Icon = 11
Copybhtv5Icon_WoW64 = 10, sysWoW64

[ControlFlags]
ExcludeFromSelect = *

[Manufacturer]
%BayHubTech% = bhtsddr,NTamd64.6.1


[bhtsddr.NTamd64.6.1]
%bhtsddr.Generic_DeviceDesc% = DriverInstallx64, PCI\VEN_1217&DEV_8520		;Default for Fujin2
%bhtsddr.Generic_DeviceDesc% = DriverInstallx64, PCI\VEN_1217&DEV_8420		;Default for SDS0
%bhtsddr.Generic_DeviceDesc% = DriverInstallx64, PCI\VEN_1217&DEV_8421		;Default for SDS1
%bhtsddr.Generic_DeviceDesc% = DriverInstallx64, PCI\VEN_1217&DEV_8620		;Default for Seabird
%bhtsddr.Generic_DeviceDesc% = DriverInstallx64, PCI\VEN_1217&DEV_8621		;Default for Seabird
%bhtsddr.Generic_DeviceDesc% = DriverInstallx64, PCI\VEN_1217&DEV_8720		;Default for SeaEagle2
%bhtsddr.Generic_DeviceDesc% = DriverInstallx64, PCI\VEN_1217&DEV_8721		;Default for SeaEagle2
%bhtsddr.Generic_DeviceDesc% = DriverInstallx64, PCI\VEN_1217&DEV_8722		;Default for SeaEagle2
%bhtsddr.Generic_DeviceDesc% = DriverInstallx64, PCI\VEN_1217&DEV_8723		;Default for SeaEagle2
%bhtsddr.Generic_DeviceDesc% = DriverInstallx64, PCI\VEN_1217&DEV_9860		;Default for GG8
%bhtsddr.Generic_DeviceDesc% = DriverInstallx64, PCI\VEN_1217&DEV_9861		;Default for GG8
%bhtsddr.Generic_DeviceDesc% = DriverInstallx64, PCI\VEN_1217&DEV_9862		;Default for GG8
%bhtsddr.Generic_DeviceDesc% = DriverInstallx64, PCI\VEN_1217&DEV_9863		;Default for GG8
%bhtsddr.Generic_DeviceDesc% = DriverInstallx64, PCI\VEN_1217&DEV_9960		;Default for Albatross
%bhtsddr.Generic_DeviceDesc% = DriverInstallx64, PCI\VEN_1217&DEV_9961		;Default for Albatross
%bhtsddr.Generic_DeviceDesc% = DriverInstallx64, PCI\VEN_1217&DEV_9962		;Default for Albatross
%bhtsddr.Generic_DeviceDesc% = DriverInstallx64, PCI\VEN_1217&DEV_9963		;Default for Albatross

%bhtsddr.DeviceDesc% = DriverInstallx64_001, PCI\VEN_1217&DEV_9863&SUBSYS_1E63000B   ;idx 1 for iNet-tek U356


[DriverInstallx64.NT]
CopyFiles = @bhtsddr.sys
CopyFiles = Copybhtv5Icon,Copybhtv5Icon_WoW64

[DriverInstallx64.NT.HW]
;Support Runtime D3 in Win8
Include = machine.inf
Needs = PciD3ColdSupported.HW
;Add MSI support
AddReg = InterruptMgmtValues
DelReg         = cfg_DelReg 
AddReg         = default_cfg_sb_pcr
AddReg         = default_cfg_sb_dmdn
AddReg         = default_cfg_se_pcr
AddReg         = default_cfg_se_dmdn
AddReg         = default_cfg_GG8_pcr
AddReg         = default_cfg_GG8_dmdn
AddReg         = default_cfg_Albatross_pcr
AddReg         = default_cfg_Albatross_dmdn

[DriverInstallx64.NT.Services]
AddService = bhtsddr, 0x00000002 , DriverServicex64;, EventLogService

[DriverServicex64]
ServiceType    = 1                  ; SERVICE_KERNEL_DRIVER
StartType      = 0                  ; SERVICE_DEMAND_START
ErrorControl   = 1                  
LoadOrderGroup = SCSI Miniport
ServiceBinary  = %12%\bhtsddr.sys
DelReg         = cfg_DelDiskReg 
;AddReg         = pnpsafe_pci_addreg
DelReg         = cfg_DelReg 
AddReg         = default_cfg_se
AddReg         = default_cfg_sb
AddReg         = default_cfg_fj2
AddReg         = default_cfg_GG8
AddReg         = default_cfg_Albatross
AddReg         = bus_type
AddReg         = autorun_addreg


;cfg idx1
[DriverInstallx64_001.NT]
CopyFiles = @bhtsddr.sys
CopyFiles = Copybhtv5Icon,Copybhtv5Icon_WoW64

[DriverInstallx64_001.NT.HW]
;Support Runtime D3 in Win8
Include = machine.inf
;Needs = PciD3ColdSupported.HW
;Add MSI support
AddReg = InterruptMgmtValues
DelReg         = cfg_DelReg 
AddReg         = 001_cfg_GG8_pcr
;AddReg         = 001_cfg_GG8_dmdn


[DriverInstallx64_001.NT.Services]
AddService = bhtsddr, 0x00000002 , DriverServicex64_001;, EventLogService

[DriverServicex64_001]
ServiceType    = 1                  ; SERVICE_KERNEL_DRIVER
StartType      = 0                  ; SERVICE_DEMAND_START
ErrorControl   = 1                  
LoadOrderGroup = SCSI Miniport
ServiceBinary  = %12%\bhtsddr.sys
DelReg         = cfg_DelDiskReg 
;AddReg         = pnpsafe_pci_addreg
DelReg         = cfg_DelReg 
AddReg         = 001_cfg
AddReg         = bus_type
AddReg         = autorun_addreg

[001_cfg]
HKR,"GG8", "PSD_MODE", 0x00010001, 0x80040a0a
HKR,"GG8", "vdd_power_source_item", 0x00010001, 0x00090a0c
HKR,"GG8", "output_tuning_item", 0x00010001, 0xc01f27ab
HKR,"GG8", "driver_item",0x00010001, 0x8000000a
HKR,"GG8", "mmc_mode_dis",0x00010001, 0x80000000
HKR,"GG8", "pcie_wake_setting",0x00010001, 0x00000000
HKR,"GG8", "sd_card_mode_dis",0x00010001, 0x80000021
HKR,"GG8", "hsmux_vcme_enable",0x00010001, 0x00000000
HKR,"GG8", "test_max_access_mode",0x00010001, 0x80000005
HKR,"GG8", "test_voltage_switch_method_choose",0x00010001, 0x00000000
HKR,"GG8", "host_drive_strength",0x00010001, 0x80002249
HKR,"GG8", "sd7_sdmode_switch_control",0x00010001, 0x00000000
HKR,"GG8", "auto_detect_refclk_counter_range_ctl",0x00010001, 0x80640000
HKR,"GG8", "refclk_stable_detection_counter1",0x00010001, 0x00000003
HKR,"GG8", "refclk_stable_detection_counter2",0x00010001, 0x001e044c
HKR,"GG8", "refclk_stable_detection_counter3",0x00010001, 0x04b024b0
HKR,"GG8", "l1_enter_exit_logic_ctl",0x00010001, 0x00000000
HKR,"GG8", "pcie_phy_amplitude_adjust",0x00010001, 0x0000006a

[001_cfg_GG8_pcr]
HKR,"GG8\pcr", "pcr_value", 1, 00,00,03,00,00,ff,00,33

;[001_cfg_GG8_dmdn]


;Common cfg
[Copybhtv5Icon]
bhtv5Icon.dll

[Copybhtv5Icon_WoW64]
bhtv5Icon.dll

[InterruptMgmtValues]
HKR, "Interrupt Management",0x00000010
HKR, "Interrupt Management\MessageSignaledInterruptProperties",0x00000010
HKR, "Interrupt Management\MessageSignaledInterruptProperties",MSISupported,0x00010001,1

[EventLogService]
AddReg = EventLogService_AddReg

[EventLogService_AddReg]
HKR,,EventMessageFile, 0x00020000, "%%SystemRoot%%\System32\IoLogMsg.dll"
HKR,,TypesSupported,   0x00010001, 7

[pnpsafe_pci_addreg]
HKR, "Parameters\PnpInterface", "5", 0x00010001, 0x00000001

[bus_type]
HKR,"Parameters", "BusType", 0x00010001, 0x0000000C

[cfg_DelReg]
HKR,"seaeagle"
HKR,"seabird"
HKR,"fj2"
HKR,"GG8"
HKR,"Albatross"

[cfg_DelDiskReg]
HKLM,"System\CurrentControlSet\Services\disk","AutoRunAlwaysDisable"

[default_cfg_se]
HKR,"seaeagle", "PSD_MODE", 0x00010001, 0x80000000
HKR,"seaeagle", "uhs2_setting", 0x00010001, 0xF7080112

[default_cfg_se_pcr]
HKR,"seaeagle\pcr", "pcr_value", 1, 00,00,03,00,f0,ff,60,55,00,00,03,04,77,7e,22,4a,00,00,03,0a,00,c0,00,c0

[default_cfg_se_dmdn]
HKR,"seaeagle\dmdn", "dmdn_value", 1,00,00,00,00,2c,28,00,02,00,00,00,01,27,14,00,02,00,00,00,02,2B,1C,00,02,00,00,00,03,2C,1A,00,02,\
                                     00,00,00,04,2c,28,00,00,00,00,00,05,27,14,00,00,00,00,00,06,2B,1C,00,00,00,00,00,07,2C,1A,00,00,\
                                     00,00,00,08,25,10,00,01,00,00,00,09,27,14,00,01,00,00,00,0A,2B,1C,00,01,00,00,00,0B,2C,1A,00,01,\
                                     00,00,00,0C,25,0C,00,01,00,00,00,0D,25,10,00,02,\
                                     00,00,00,0E,25,10,00,02,00,00,00,0F,25,10,00,04,00,00,00,10,25,10,00,FA,00,00,00,11,35,10,00,01,\
                                     00,00,00,12,25,10,00,00,00,00,00,13,27,14,00,00,00,00,00,14,2B,1C,00,00,00,00,00,15,2C,1A,00,00,\
                                     00,00,00,16,25,10,00,02,00,00,00,17,25,10,00,02,00,00,00,18,25,10,00,04,00,00,00,19,25,10,00,FA

[default_cfg_sb]
HKR,"seabird", "driver_item", 0x00010001, 0x8000001a
HKR,"seabird", "SD_CARD_MODE_DIS", 0x00010001, 0x80000001
HKR,"seabird", "PSD_MODE", 0x00010001, 0x80040a3C
;HKR,"seabird", "MS_SDIO_CTRL", 0x00010001, 0x0

[default_cfg_sb_pcr]
HKR,"seabird\pcr", "pcr_value", 1, 00,00,03,00,f0,ff,60,55,00,00,03,04,77,7e,22,4a,00,00,03,0a,00,c0,00,c0

[default_cfg_sb_dmdn]
HKR,"seabird\dmdn", "dmdn_value", 1,00,00,00,00,2c,28,00,02,00,00,00,01,27,14,00,02,00,00,00,02,2B,1C,00,02,00,00,00,03,2C,1A,00,02,\
                                    00,00,00,04,2c,28,00,00,00,00,00,05,27,14,00,00,00,00,00,06,2B,1C,00,00,00,00,00,07,2C,1A,00,00,\
                                    00,00,00,08,25,10,00,01,00,00,00,09,27,14,00,01,00,00,00,0A,2B,1C,00,01,00,00,00,0B,2C,1A,00,01,\
                                    00,00,00,0C,25,0C,00,01,00,00,00,0D,25,10,00,02,\
                                    00,00,00,0E,25,10,00,02,00,00,00,0F,25,10,00,04,00,00,00,10,25,10,00,FA,00,00,00,11,35,10,00,01,\
                                    00,00,00,12,25,10,00,00,00,00,00,13,27,14,00,00,00,00,00,14,2B,1C,00,00,00,00,00,15,2C,1A,00,00,\
                                    00,00,00,16,25,10,00,02,00,00,00,17,25,10,00,02,00,00,00,18,25,10,00,04,00,00,00,19,25,10,00,FA
                  

[default_cfg_fj2]
HKR,"fj2", "psd_mode", 0x00010001, 0x80040a01

[default_cfg_GG8]
HKR,"GG8", "PSD_MODE", 0x00010001, 0x80040a0a
HKR,"GG8", "vdd_power_source_item", 0x00010001, 0x00090a0c
HKR,"GG8", "output_tuning_item", 0x00010001, 0xc01f27ab
HKR,"GG8", "driver_item",0x00010001, 0x8000000a
HKR,"GG8", "mmc_mode_dis",0x00010001, 0x80000000
HKR,"GG8", "pcie_wake_setting",0x00010001, 0x00000000
HKR,"GG8", "sd_card_mode_dis",0x00010001, 0x80000021
HKR,"GG8", "hsmux_vcme_enable",0x00010001, 0x00000000
HKR,"GG8", "test_max_access_mode",0x00010001, 0x80000005
HKR,"GG8", "test_voltage_switch_method_choose",0x00010001, 0x00000000
HKR,"GG8", "host_drive_strength",0x00010001, 0x80002249
HKR,"GG8", "sd7_sdmode_switch_control",0x00010001, 0x00000000
HKR,"GG8", "auto_detect_refclk_counter_range_ctl",0x00010001, 0x80640000
HKR,"GG8", "refclk_stable_detection_counter1",0x00010001, 0x00000003
HKR,"GG8", "refclk_stable_detection_counter2",0x00010001, 0x001e044c
HKR,"GG8", "refclk_stable_detection_counter3",0x00010001, 0x04b024b0
HKR,"GG8", "l1_enter_exit_logic_ctl",0x00010001, 0x00000000
HKR,"GG8", "pcie_phy_amplitude_adjust",0x00010001, 0x0000006a

[default_cfg_GG8_pcr]
HKR,"GG8\pcr", "pcr_value", 1, 00,00,03,00,00,ff,00,33

[default_cfg_GG8_dmdn]
;HKR,"GG8\dmdn", "dmdn_value", 1, 00,00,00,04,08,05,00,01

[default_cfg_Albatross]
HKR,"Albatross", "driver_item", 0x00010001, 0x8000800a

[default_cfg_Albatross_pcr]
;HKR,"Albatross\pcr", "pcr_value", 1, 00,00,03,00,00,f0,00,10

[default_cfg_Albatross_dmdn]
;HKR,"Albatross\dmdn", "dmdn_value", 1, 00,00,00,04,08,05,00,01

[autorun_addreg] 
;Support ModernStandby
HKLM,"System\CurrentControlSet\Services\disk","AutoRunAlwaysDisable", 0x00010008,"SDHC"
HKLM,"System\CurrentControlSet\Services\disk","AutoRunAlwaysDisable", 0x00010008,"SDXC"
HKLM,"System\CurrentControlSet\Services\disk","AutoRunAlwaysDisable", 0x00010008,"SD"
HKLM,"System\CurrentControlSet\Services\disk","AutoRunAlwaysDisable", 0x00010008,"MMC"
;HKLM,"System\CurrentControlSet\Services\disk","AutoRunAlwaysDisable", 0x00010000,"Brother RemovableDisk(U)"

[Strings]
REG_SZ        = 0x00000000
REG_MULTI_SZ  = 0x00010000
REG_EXPAND_SZ = 0x00020000
REG_BINARY    = 0x00000001
REG_DWORD     = 0x00010001
SERVICEROOT   = "System\CurrentControlSet\Services"

BayHubTech          = "BayHubTech"
bhtsddr.DeviceDesc = "BayHubTech Integrated MMC/SD controller"
bhtsddr.DriverDisk = "BayHubTech Integrated MMC/SD controller Driver Disk"
;bhtsddr.DeviceDesc_SD = "BayHubTech SD Host controller"
bhtsddr.Generic_DeviceDesc = "BayHubTech Integrated MMC/SD controller(Generic)"