diff options
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-config.h | 10 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-drv.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-fw.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/pcie/trans.c | 10 |
4 files changed, 14 insertions, 10 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-config.h b/drivers/net/wireless/iwlwifi/iwl-config.h index 76d363d1a497..f8aa9cf08279 100644 --- a/drivers/net/wireless/iwlwifi/iwl-config.h +++ b/drivers/net/wireless/iwlwifi/iwl-config.h | |||
@@ -87,6 +87,16 @@ enum iwl_device_family { | |||
87 | IWL_DEVICE_FAMILY_8000, | 87 | IWL_DEVICE_FAMILY_8000, |
88 | }; | 88 | }; |
89 | 89 | ||
90 | static inline bool iwl_has_secure_boot(u32 hw_rev, | ||
91 | enum iwl_device_family family) | ||
92 | { | ||
93 | /* return 1 only for family 8000 B0 */ | ||
94 | if ((family == IWL_DEVICE_FAMILY_8000) && (hw_rev & 0xC)) | ||
95 | return 1; | ||
96 | |||
97 | return 0; | ||
98 | } | ||
99 | |||
90 | /* | 100 | /* |
91 | * LED mode | 101 | * LED mode |
92 | * IWL_LED_DEFAULT: use device default | 102 | * IWL_LED_DEFAULT: use device default |
diff --git a/drivers/net/wireless/iwlwifi/iwl-drv.c b/drivers/net/wireless/iwlwifi/iwl-drv.c index 0f1084f09caa..d9fa8e034da2 100644 --- a/drivers/net/wireless/iwlwifi/iwl-drv.c +++ b/drivers/net/wireless/iwlwifi/iwl-drv.c | |||
@@ -807,19 +807,16 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv, | |||
807 | iwl_store_ucode_sec(pieces, tlv_data, IWL_UCODE_REGULAR, | 807 | iwl_store_ucode_sec(pieces, tlv_data, IWL_UCODE_REGULAR, |
808 | tlv_len); | 808 | tlv_len); |
809 | drv->fw.mvm_fw = true; | 809 | drv->fw.mvm_fw = true; |
810 | drv->fw.img[IWL_UCODE_REGULAR].is_secure = true; | ||
811 | break; | 810 | break; |
812 | case IWL_UCODE_TLV_SECURE_SEC_INIT: | 811 | case IWL_UCODE_TLV_SECURE_SEC_INIT: |
813 | iwl_store_ucode_sec(pieces, tlv_data, IWL_UCODE_INIT, | 812 | iwl_store_ucode_sec(pieces, tlv_data, IWL_UCODE_INIT, |
814 | tlv_len); | 813 | tlv_len); |
815 | drv->fw.mvm_fw = true; | 814 | drv->fw.mvm_fw = true; |
816 | drv->fw.img[IWL_UCODE_INIT].is_secure = true; | ||
817 | break; | 815 | break; |
818 | case IWL_UCODE_TLV_SECURE_SEC_WOWLAN: | 816 | case IWL_UCODE_TLV_SECURE_SEC_WOWLAN: |
819 | iwl_store_ucode_sec(pieces, tlv_data, IWL_UCODE_WOWLAN, | 817 | iwl_store_ucode_sec(pieces, tlv_data, IWL_UCODE_WOWLAN, |
820 | tlv_len); | 818 | tlv_len); |
821 | drv->fw.mvm_fw = true; | 819 | drv->fw.mvm_fw = true; |
822 | drv->fw.img[IWL_UCODE_WOWLAN].is_secure = true; | ||
823 | break; | 820 | break; |
824 | case IWL_UCODE_TLV_NUM_OF_CPU: | 821 | case IWL_UCODE_TLV_NUM_OF_CPU: |
825 | if (tlv_len != sizeof(u32)) | 822 | if (tlv_len != sizeof(u32)) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-fw.h b/drivers/net/wireless/iwlwifi/iwl-fw.h index 4f6e66892acc..6f7ae5f7bdae 100644 --- a/drivers/net/wireless/iwlwifi/iwl-fw.h +++ b/drivers/net/wireless/iwlwifi/iwl-fw.h | |||
@@ -227,7 +227,6 @@ struct fw_desc { | |||
227 | 227 | ||
228 | struct fw_img { | 228 | struct fw_img { |
229 | struct fw_desc sec[IWL_UCODE_SECTION_MAX]; | 229 | struct fw_desc sec[IWL_UCODE_SECTION_MAX]; |
230 | bool is_secure; | ||
231 | bool is_dual_cpus; | 230 | bool is_dual_cpus; |
232 | }; | 231 | }; |
233 | 232 | ||
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c index aea0fe9d1779..8027138c47e9 100644 --- a/drivers/net/wireless/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/iwlwifi/pcie/trans.c | |||
@@ -747,14 +747,11 @@ static int iwl_pcie_load_given_ucode(struct iwl_trans *trans, | |||
747 | int first_ucode_section; | 747 | int first_ucode_section; |
748 | 748 | ||
749 | IWL_DEBUG_FW(trans, | 749 | IWL_DEBUG_FW(trans, |
750 | "working with %s image\n", | ||
751 | image->is_secure ? "Secured" : "Non Secured"); | ||
752 | IWL_DEBUG_FW(trans, | ||
753 | "working with %s CPU\n", | 750 | "working with %s CPU\n", |
754 | image->is_dual_cpus ? "Dual" : "Single"); | 751 | image->is_dual_cpus ? "Dual" : "Single"); |
755 | 752 | ||
756 | /* configure the ucode to be ready to get the secured image */ | 753 | /* configure the ucode to be ready to get the secured image */ |
757 | if (image->is_secure) { | 754 | if (iwl_has_secure_boot(trans->hw_rev, trans->cfg->device_family)) { |
758 | /* set secure boot inspector addresses */ | 755 | /* set secure boot inspector addresses */ |
759 | iwl_write_prph(trans, | 756 | iwl_write_prph(trans, |
760 | LMPM_SECURE_INSPECTOR_CODE_ADDR, | 757 | LMPM_SECURE_INSPECTOR_CODE_ADDR, |
@@ -790,7 +787,8 @@ static int iwl_pcie_load_given_ucode(struct iwl_trans *trans, | |||
790 | LMPM_SECURE_CPU2_HDR_MEM_SPACE); | 787 | LMPM_SECURE_CPU2_HDR_MEM_SPACE); |
791 | 788 | ||
792 | /* load to FW the binary sections of CPU2 */ | 789 | /* load to FW the binary sections of CPU2 */ |
793 | if (image->is_secure) | 790 | if (iwl_has_secure_boot(trans->hw_rev, |
791 | trans->cfg->device_family)) | ||
794 | ret = iwl_pcie_load_cpu_secured_sections( | 792 | ret = iwl_pcie_load_cpu_secured_sections( |
795 | trans, image, 2, | 793 | trans, image, 2, |
796 | &first_ucode_section); | 794 | &first_ucode_section); |
@@ -821,7 +819,7 @@ static int iwl_pcie_load_given_ucode(struct iwl_trans *trans, | |||
821 | else | 819 | else |
822 | iwl_write32(trans, CSR_RESET, 0); | 820 | iwl_write32(trans, CSR_RESET, 0); |
823 | 821 | ||
824 | if (image->is_secure) { | 822 | if (iwl_has_secure_boot(trans->hw_rev, trans->cfg->device_family)) { |
825 | /* wait for image verification to complete */ | 823 | /* wait for image verification to complete */ |
826 | ret = iwl_poll_prph_bit(trans, | 824 | ret = iwl_poll_prph_bit(trans, |
827 | LMPM_SECURE_BOOT_CPU1_STATUS_ADDR, | 825 | LMPM_SECURE_BOOT_CPU1_STATUS_ADDR, |