Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a1c23ce2 authored by Mohammed Siddiq's avatar Mohammed Siddiq Committed by Gerrit - the friendly Code Review server
Browse files

cnss2: Update bound checks for sbl reg dumps to SRAM mem range



Add code to update the bound checks for sbl reg dumps to SRAM mem
range. Due to a firmware update, the sbl start address was moved
and the bound checks to dumps sbl reg failed. Update the bound
checks to SRAM mem range, so that any future update in firmware
would not impact SRAM dumps.

Change-Id: I28026f03fe1f44f2ba6ff7f903dcb98543f8847c
Signed-off-by: default avatarMohammed Siddiq <msiddiq@codeaurora.org>
parent 611fe630
Loading
Loading
Loading
Loading
+8 −14
Original line number Diff line number Diff line
@@ -1885,9 +1885,9 @@ static void cnss_pci_dump_qca6390_sram_mem(struct cnss_pci_data *pci_priv)
	sbl_log_size = (sbl_log_size > QCA6390_DEBUG_SBL_LOG_SRAM_MAX_SIZE ?
			QCA6390_DEBUG_SBL_LOG_SRAM_MAX_SIZE : sbl_log_size);

	if (sbl_log_start < QCA6390_V2_SBL_DATA_START ||
	    sbl_log_start > QCA6390_V2_SBL_DATA_END ||
	    (sbl_log_start + sbl_log_size) > QCA6390_V2_SBL_DATA_END)
	if (sbl_log_start < SRAM_START ||
	    sbl_log_start > SRAM_END ||
	    (sbl_log_start + sbl_log_size) > SRAM_END)
		goto out;

	cnss_pr_dbg("Dumping SBL log data\n");
@@ -1955,17 +1955,11 @@ static void cnss_pci_dump_bl_sram_mem(struct cnss_pci_data *pci_priv)

	sbl_log_size = (sbl_log_size > QCA6490_DEBUG_SBL_LOG_SRAM_MAX_SIZE ?
			QCA6490_DEBUG_SBL_LOG_SRAM_MAX_SIZE : sbl_log_size);
	if (plat_priv->device_version.major_version == FW_V2_NUMBER) {
		if (sbl_log_start < QCA6490_V2_SBL_DATA_START ||
		    sbl_log_start > QCA6490_V2_SBL_DATA_END ||
		    (sbl_log_start + sbl_log_size) > QCA6490_V2_SBL_DATA_END)
			goto out;
	} else {
		if (sbl_log_start < QCA6490_V1_SBL_DATA_START ||
		    sbl_log_start > QCA6490_V1_SBL_DATA_END ||
		    (sbl_log_start + sbl_log_size) > QCA6490_V1_SBL_DATA_END)

	if (sbl_log_start < SRAM_START ||
	    sbl_log_start > SRAM_END ||
	    (sbl_log_start + sbl_log_size) > SRAM_END)
		goto out;
	}

	cnss_pr_dbg("Dumping SBL log data");
	for (i = 0; i < sbl_log_size; i += sizeof(val)) {
+3 −6
Original line number Diff line number Diff line
@@ -269,10 +269,6 @@

#define QCA6490_DEBUG_PBL_LOG_SRAM_START 0x01403DA0
#define QCA6490_DEBUG_PBL_LOG_SRAM_MAX_SIZE 40
#define QCA6490_V1_SBL_DATA_START 0x143b000
#define QCA6490_V1_SBL_DATA_END (0x143b000 + 0x00011000)
#define QCA6490_V2_SBL_DATA_START 0x1435000
#define QCA6490_V2_SBL_DATA_END (0x1435000 + 0x00011000)
#define QCA6490_DEBUG_SBL_LOG_SRAM_MAX_SIZE 48
#define QCA6490_TCSR_PBL_LOGGING_REG 0x01B000F8
#define QCA6490_PCIE_BHI_ERRDBG2_REG 0x01E0E238
@@ -282,12 +278,13 @@

#define QCA6390_DEBUG_PBL_LOG_SRAM_START 0x01403D58
#define QCA6390_DEBUG_PBL_LOG_SRAM_MAX_SIZE 80
#define QCA6390_V2_SBL_DATA_START 0x016c8580
#define QCA6390_V2_SBL_DATA_END (0x016c8580 + 0x00011000)
#define QCA6390_DEBUG_SBL_LOG_SRAM_MAX_SIZE 44
#define QCA6390_TCSR_PBL_LOGGING_REG 0x01B000F8
#define QCA6390_PCIE_BHI_ERRDBG2_REG 0x01E0E238
#define QCA6390_PCIE_BHI_ERRDBG3_REG 0x01E0E23C
#define QCA6390_PBL_WLAN_BOOT_CFG    0x01E22B34
#define QCA6390_PBL_BOOTSTRAP_STATUS 0x01910008

#define SRAM_START		0x01400000
#define SRAM_END		0x01800000
#endif