;
; Installation inf for the Micron PCIe NVMe Controller Storport Miniport 
; Copyright (c) 2014, Micron Technology, Inc.
; All rights reserved.
;
[Version]
Signature="$Windows NT$"
Class=SCSIAdapter
ClassGUID={4D36E97B-E325-11CE-BFC1-08002BE10318}
Provider=%Micron%
DriverVer = 03/02/2021,2.1.18.0
CatalogFile=mtinvme.cat

[SourceDisksNames]
1 = %DiskId1%,,,""

[SourceDisksFiles]
mtinvme.sys = 1,,

[DestinationDirs]
DefaultDestDir   = 12

[Manufacturer]
%Micron% = mtinvme, ntamd64 ; Models section = mtinvme

[mtinvme.ntamd64] ; per manufacturer model section
; 9100 (1FPD)
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_5180
; 9100 (3FPD)
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_5181
; 7100 (0.3FPD)
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_5188
; 7100 (3FPD)
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_5189
; Adenridge
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_5190
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_5191
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_5192
; Falcon + Pro & Max
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_51a1
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_51a2
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_51a3
; 2100 Micron/Crucial Apollo
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_5402
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_C0A9&DEV_5402
; Micron/Crucial Cassandra
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_5410
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_C0A9&DEV_5410
; (Crucial) Frampton
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_C0A9&DEV_2263
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_5403
; (Crucial) Frampton2
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_C0A9&DEV_5403
; Micron Cobain
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_5404
; Micron Santana
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_5405
; Micron SantanaP5
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_C0A9&DEV_5409
; Micron SantanaV
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_5406
; Nitro
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_2263
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_6001
; Papaya
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1C5F&DEV_0557
; Hawk + Pro & Max
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_51B0
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_51B1
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_51B2
; Micron Raptor Pro
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_51C0
; Micron Raptor Max
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_51C1
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_51C2
; (Crucial) Nick P2
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_C0A9&DEV_540A
; Micron Talon
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_51C2
; Micron Hendrix
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_5407
; Micron HendrixV
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_5411
; Micron Quicksilver
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_6002
; Micron Slash
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_5408
; Micron SlashP5
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_C0A9&DEV_5412
; Micron Raven Pro
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_51C3
; Micron Raven Max
%MicronSSD.DeviceDesc% = mtinvme_Inst, PCI\VEN_1344&DEV_51C4

[mtinvme_Inst.ntamd64] ; what to install to support the models
CopyFiles=@mtinvme.sys

[mtinvme_Inst.ntamd64.HW] ; device specific registry entries
AddReg = mtinvme_Hw_AddReg

[mtinvme_Inst.ntamd64.Services]
AddService = mtinvme, %SPSVCINST_ASSOCSERVICE%, mtinvme_Service_Inst, Miniport_EventLog_Inst

[mtinvme_Service_Inst]
DisplayName    = %MicronSSD.DeviceDesc%
ServiceType    = %SERVICE_KERNEL_DRIVER%
StartType      = %SERVICE_BOOT_START%
ErrorControl   = %SERVICE_ERROR_NORMAL%
ServiceBinary  = %12%\mtinvme.sys
LoadOrderGroup = SCSI miniport
AddReg         = mtinvme_Service_AddReg
AddReg         = bus_type_nvme
AddReg         = pnpsafe_pci_addreg
AddReg         = kb2468345

[mtinvme_Service_AddReg]
HKR, , Tag, %REG_DWORD%, 1
HKR, , DeviceType, %REG_DWORD%, 0x0000002D
HKR, , Security, , "D:P(A;;GA;;;SY)(A;;GRGWGX;;;BA)(A;;GRGWGX;;;WD)(A;;GRGWGX;;;RC)"
;
; PCI workaround to allow Windows to handle SRSI in Win8+
HKLM , "SYSTEM\CurrentControlSet\services\pci\Parameters", "13445180", 0x00000001,0,0,0,40,0,0,0,0
HKLM , "SYSTEM\CurrentControlSet\services\pci\Parameters", "13445181", 0x00000001,0,0,0,40,0,0,0,0
HKLM , "SYSTEM\CurrentControlSet\services\pci\Parameters", "13445188", 0x00000001,0,0,0,40,0,0,0,0
HKLM , "SYSTEM\CurrentControlSet\services\pci\Parameters", "13445189", 0x00000001,0,0,0,40,0,0,0,0
HKLM , "SYSTEM\CurrentControlSet\services\pci\Parameters", "13445402", 0x00000001,0,0,0,40,0,0,0,0
HKLM , "SYSTEM\CurrentControlSet\services\pci\Parameters", "C0A95402", 0x00000001,0,0,0,40,0,0,0,0

;*************************************************************
; This section should be used when installing services to indicate
; which interface types are safe for PNP and which are not.  
; INTERFACE_TYPE is defined in NTDDK.H
[pnpsafe_pci_addreg]
HKR, "Parameters\PnpInterface", "5", %REG_DWORD%, 0x00000001
HKR, "Parameters", "Supports64BitAddressing", %REG_DWORD%, 0x00000001

;*************************************************************
;This section should be used for non-SCSI miniports
;to indicate what STORAGE_BUS_TYPE they actually do support.
[bus_type_nvme]
HKR, "Parameters\PnpInterface", "5", %REG_DWORD%, 0x00000001
HKR, "Parameters", "BusType", %REG_DWORD%, 0x00000011

; Default DMAR settings 2, where 2 = opt in, but only for external hot-plug devices
HKR, "Parameters", "DmaRemappingCompatible", %REG_DWORD%, 0
HKR, "Parameters", "DmaRemappingOnHiberPath", %REG_DWORD%, 1

;*************************************************************
;This addreg section should be used for KB2468345 
;to indicate support for 64 bit addresses
;user MUST install KB2468345 fix
[kb2468345]
HKR, "Parameters", "Supports64BitAddressing", %REG_DWORD%, 0x00000001

;
; per device instance registry settings
;
;
; add the device instance settings for the controller
;
[mtinvme_Hw_AddReg]
HKR,"ScsiPort","NeedsSystemShutdownNotification",0x00010001,1
HKR, "StorPort", "TotalSenseDataBytes", %REG_DWORD%, 255
; The MSISupported entry determines whether the device supports MSI and MSI-X.
; Set it to 1 to enable MSI and MSI-X support.
; The MessageNumberLimit entry specifies the maximum number of MSIs to allocate. 
; For PCI 2.2, MessageNumberLimit must be 1, 2, 4, 8, or 16. 
; For PCI 3.0, MessageNumberLimit can be any number up to 2,048.
HKR,Interrupt Management, 0x00000010
HKR,Interrupt Management\MessageSignaledInterruptProperties, 0x00000010
HKR,Interrupt Management\MessageSignaledInterruptProperties, MSISupported, %REG_DWORD%, 1
HKR,Interrupt Management\MessageSignaledInterruptProperties, MessageNumberLimit, %REG_DWORD%, 65 
HKR,Interrupt Management\Affinity Policy, 0x00000010
HKR,Interrupt Management\Affinity Policy, DevicePolicy, %REG_DWORD%, 5
HKR,Interrupt Management\Affinity Policy, DevicePriority, %REG_DWORD%, 3
HKR,Interrupt Management\Affinity Policy, GroupPolicy, %REG_DWORD%, 1
; DevicePolicy values:
; IrqPolicyMachineDefault == 0 
;   use default policy for the computer
; IrqPolicyAllCloseProcessors == 1 
;   connect interrupts to all processors of the near NUMA node
; IrqPolicyOneCloseProcessor == 2 
;   connect interrupts to one processor
; IrqPolicyAllProcessorsInMachine = 3 
;   connect interrupts to all processors in the machine
; IrqPolicySpecifiedProcessors == 4 
;   connects interrupts according to AssignmentSetOverride
; IrqPolicySpreadMessagesAcrossAllProcessors == 5 
;   assign different message-based interrupts to different processors
;   TODO: is this constrained by processor group or will it use ALL
;         processors across ALL NUMA nodes?
;
; Make sure all processor in group are used to serve interrupt from this device. 
HKR,Interrupt Management\Affinity Policy, DevicePolicy, %REG_DWORD%, 0x00000005
; DevicePriority values:
; IrqArbPriorityUndefined == 0 
;   no interrupt priority policy. 
; IrqArbPriorityLow == 1
;   device can tolerate low IRQL
; IrqArbPriorityNormal == 2 
;   device expects normal interrupt latencies
; IrqArbPriorityHigh == 3 
;   device requires the lowest possible interrupt latency
;
; Specifies that the device interrupts are of high priority 
; This setting is appropriate for devices that require lowlatency IrqPriorityHigh 3
; Allow interrrupts to happen on processors beyond group 0. 
; (e.g. might be in a single group other than 0)
; TODO: no explanation of side effects?  What really happens when this 
;       setting is used?
HKR, Interrupt Management\Affinity Policy, GroupPolicy, %REG_DWORD%, 1


[Miniport_EventLog_Inst]
AddReg = Miniport_EventLog_AddReg

[Miniport_EventLog_AddReg]
HKR,,EventMessageFile,%REG_EXPAND_SZ%,"%%SystemRoot%%\System32\IoLogMsg.dll;%%SystemRoot%%\System32\drivers\mtinvme.sys"
HKR,,TypesSupported,%REG_DWORD%,7

[Strings]
;
; Localizable Strings
;
diskId1 = "Micron NVMe Storage Controller Installation Disk"
MicronSSD.DeviceDesc = "Micron NVMe Storage Controller"
Micron = "Micron Technology, Inc."

;*******************************************
;Handy macro substitutions (non-localizable)
SPSVCINST_ASSOCSERVICE = 0x00000002
SERVICE_KERNEL_DRIVER  = 1
SERVICE_BOOT_START     = 0
SERVICE_ERROR_NORMAL   = 1
SERVICE_ERROR_CRITICAL = 3
REG_EXPAND_SZ          = 0x00020000
REG_DWORD              = 0x00010001
REG_MULTI_SZ           = 0x00010000
