Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2)  * This file is provided under a dual BSD/GPLv2 license.  When using or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * redistributing this file, you may do so under either license.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * GPL LICENSE SUMMARY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  * This program is free software; you can redistribute it and/or modify
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10)  * it under the terms of version 2 of the GNU General Public License as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11)  * published by the Free Software Foundation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13)  * This program is distributed in the hope that it will be useful, but
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14)  * WITHOUT ANY WARRANTY; without even the implied warranty of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15)  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16)  * General Public License for more details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18)  * You should have received a copy of the GNU General Public License
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19)  * along with this program; if not, write to the Free Software
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20)  * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21)  * The full GNU General Public License is included in this distribution
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22)  * in the file called LICENSE.GPL.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) /* probe_roms - scan for oem parameters */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) #include <linux/firmware.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) #include <linux/uaccess.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) #include <linux/efi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) #include <asm/probe_roms.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) #include "isci.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) #include "task.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) #include "probe_roms.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) static efi_char16_t isci_efivar_name[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 	'R', 's', 't', 'S', 'c', 'u', 'O'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) struct isci_orom *isci_request_oprom(struct pci_dev *pdev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 	void __iomem *oprom = pci_map_biosrom(pdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 	struct isci_orom *rom = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	size_t len, i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	int j;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	char oem_sig[4];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	struct isci_oem_hdr oem_hdr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	u8 *tmp, sum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	if (!oprom)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 		return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	len = pci_biosrom_size(pdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	rom = devm_kzalloc(&pdev->dev, sizeof(*rom), GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	if (!rom) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 		pci_unmap_biosrom(oprom);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 		dev_warn(&pdev->dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 			 "Unable to allocate memory for orom\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 		return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	for (i = 0; i < len && rom; i += ISCI_OEM_SIG_SIZE) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 		memcpy_fromio(oem_sig, oprom + i, ISCI_OEM_SIG_SIZE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 		/* we think we found the OEM table */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 		if (memcmp(oem_sig, ISCI_OEM_SIG, ISCI_OEM_SIG_SIZE) == 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 			size_t copy_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 			memcpy_fromio(&oem_hdr, oprom + i, sizeof(oem_hdr));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 			copy_len = min(oem_hdr.len - sizeof(oem_hdr),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 				       sizeof(*rom));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 			memcpy_fromio(rom,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 				      oprom + i + sizeof(oem_hdr),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 				      copy_len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 			/* calculate checksum */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 			tmp = (u8 *)&oem_hdr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 			for (j = 0, sum = 0; j < sizeof(oem_hdr); j++, tmp++)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 				sum += *tmp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 			tmp = (u8 *)rom;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 			for (j = 0; j < sizeof(*rom); j++, tmp++)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 				sum += *tmp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 			if (sum != 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 				dev_warn(&pdev->dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 					 "OEM table checksum failed\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 				continue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 			/* keep going if that's not the oem param table */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 			if (memcmp(rom->hdr.signature,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 				   ISCI_ROM_SIG,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 				   ISCI_ROM_SIG_SIZE) != 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 				continue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 			dev_info(&pdev->dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 				 "OEM parameter table found in OROM\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	if (i >= len) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 		dev_err(&pdev->dev, "oprom parse error\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 		rom = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	pci_unmap_biosrom(oprom);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	return rom;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) struct isci_orom *isci_request_firmware(struct pci_dev *pdev, const struct firmware *fw)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	struct isci_orom *orom = NULL, *data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	int i, j;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 	if (request_firmware(&fw, ISCI_FW_NAME, &pdev->dev) != 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 		return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	if (fw->size < sizeof(*orom))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 		goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	data = (struct isci_orom *)fw->data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 	if (strncmp(ISCI_ROM_SIG, data->hdr.signature,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 		    strlen(ISCI_ROM_SIG)) != 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 		goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	orom = devm_kzalloc(&pdev->dev, fw->size, GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 	if (!orom)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 		goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	memcpy(orom, fw->data, fw->size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 	if (is_c0(pdev) || is_c1(pdev))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 		goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	 * deprecated: override default amp_control for pre-preproduction
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 	 * silicon revisions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	for (i = 0; i < ARRAY_SIZE(orom->ctrl); i++)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 		for (j = 0; j < ARRAY_SIZE(orom->ctrl[i].phys); j++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 			orom->ctrl[i].phys[j].afe_tx_amp_control0 = 0xe7c03;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 			orom->ctrl[i].phys[j].afe_tx_amp_control1 = 0xe7c03;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 			orom->ctrl[i].phys[j].afe_tx_amp_control2 = 0xe7c03;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 			orom->ctrl[i].phys[j].afe_tx_amp_control3 = 0xe7c03;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152)  out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	release_firmware(fw);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 	return orom;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) static struct efi *get_efi(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) #ifdef CONFIG_EFI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 	return &efi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) struct isci_orom *isci_get_efi_var(struct pci_dev *pdev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	efi_status_t status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	struct isci_orom *rom;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	struct isci_oem_hdr *oem_hdr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	u8 *tmp, sum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	int j;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	unsigned long data_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	u8 *efi_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	u32 efi_attrib = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	data_len = 1024;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	efi_data = devm_kzalloc(&pdev->dev, data_len, GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	if (!efi_data) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 		dev_warn(&pdev->dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 			 "Unable to allocate memory for EFI data\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 		return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	rom = (struct isci_orom *)(efi_data + sizeof(struct isci_oem_hdr));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	if (get_efi())
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 		status = get_efi()->get_variable(isci_efivar_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 						 &ISCI_EFI_VENDOR_GUID,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 						 &efi_attrib,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 						 &data_len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 						 efi_data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 		status = EFI_NOT_FOUND;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	if (status != EFI_SUCCESS) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 		dev_warn(&pdev->dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 			 "Unable to obtain EFI var data for OEM parms\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 		return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 	oem_hdr = (struct isci_oem_hdr *)efi_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	if (memcmp(oem_hdr->sig, ISCI_OEM_SIG, ISCI_OEM_SIG_SIZE) != 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 		dev_warn(&pdev->dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 			 "Invalid OEM header signature\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 		return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 	/* calculate checksum */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 	tmp = (u8 *)efi_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	for (j = 0, sum = 0; j < (sizeof(*oem_hdr) + sizeof(*rom)); j++, tmp++)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 		sum += *tmp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 	if (sum != 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 		dev_warn(&pdev->dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 			 "OEM table checksum failed\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 		return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 	if (memcmp(rom->hdr.signature,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 		   ISCI_ROM_SIG,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 		   ISCI_ROM_SIG_SIZE) != 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 		dev_warn(&pdev->dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 			 "Invalid OEM table signature\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 		return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 	return rom;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) }