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

Commit e1120187 authored by Matti Gottlieb's avatar Matti Gottlieb Committed by Emmanuel Grumbach
Browse files

iwlwifi: mvm: Add FW paging mechanism for the UMAC on SDIO



Family 8000 products has 2 embedded processors, the first
known as LMAC (lower MAC) and implements the functionality from
previous products, the second one is known as UMAC (upper MAC)
and is used mainly for driver offloads as well as new features.
The UMAC is typically “less” real-time than the LMAC and is used
for higher level controls.
The UMAC's code/data size is estimated to be in the mega-byte arena,
taking into account the code it needs to replace in the driver and
the set of new features.

In order to allow the UMAC to execute code that is bigger than its code
memory, we allow the UMAC embedded processor to page out code pages on
DRAM.

When the device is slave on the bus(SDIO) the driver saves the UMAC's
image pages in blocks of 32K in the DRAM and sends the layout of the
pages to the FW. When the FW wants load / unload pages, it creates an
interrupt,	and the driver uploads / downloads the page to an address in
the a specific address on the device's memory.

The driver can support up to 1 MB of pages.

Add paging mechanism for the UMAC on SDIO in order to allow the program to
use a larger virtual space while using less physical memory on the device
itself.

Signed-off-by: default avatarMatti Gottlieb <matti.gottlieb@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent 26d535ae
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -200,6 +200,7 @@
#define CSR_INT_BIT_FH_TX        (1 << 27) /* Tx DMA FH_INT[1:0] */
#define CSR_INT_BIT_SCD          (1 << 26) /* TXQ pointer advanced */
#define CSR_INT_BIT_SW_ERR       (1 << 25) /* uCode error */
#define CSR_INT_BIT_PAGING       (1 << 24) /* SDIO PAGING */
#define CSR_INT_BIT_RF_KILL      (1 << 7)  /* HW RFKILL switch GP_CNTRL[27] toggled */
#define CSR_INT_BIT_CT_KILL      (1 << 6)  /* Critical temp (chip too hot) rfkill */
#define CSR_INT_BIT_SW_RX        (1 << 3)  /* Rx, command responses */
@@ -210,6 +211,7 @@
				 CSR_INT_BIT_HW_ERR  | \
				 CSR_INT_BIT_FH_TX   | \
				 CSR_INT_BIT_SW_ERR  | \
				 CSR_INT_BIT_PAGING  | \
				 CSR_INT_BIT_RF_KILL | \
				 CSR_INT_BIT_SW_RX   | \
				 CSR_INT_BIT_WAKEUP  | \
+3 −0
Original line number Diff line number Diff line
@@ -163,6 +163,9 @@ struct iwl_sf_region {
/* maximum image size 1024KB */
#define MAX_PAGING_IMAGE_SIZE (NUM_OF_BLOCK_PER_IMAGE * PAGING_BLOCK_SIZE)

/* Virtual address signature */
#define PAGING_ADDR_SIG 0xAA000000

#define PAGING_CMD_IS_SECURED BIT(9)
#define PAGING_CMD_IS_ENABLED BIT(8)
#define PAGING_CMD_NUM_OF_PAGES_IN_LAST_GRP_POS	0
+6 −0
Original line number Diff line number Diff line
@@ -392,4 +392,10 @@ enum {
	LMPM_CHICK_EXTENDED_ADDR_SPACE = BIT(0),
};

/* FW chicken bits */
#define LMPM_PAGE_PASS_NOTIF			0xA03824
enum {
	LMPM_PAGE_PASS_NOTIF_POS = BIT(20),
};

#endif				/* __iwl_prph_h__ */
+14 −0
Original line number Diff line number Diff line
@@ -668,6 +668,12 @@ enum iwl_d0i3_mode {
 * @dbg_conf_tlv: array of pointers to configuration TLVs for debug
 * @dbg_trigger_tlv: array of pointers to triggers TLVs for debug
 * @dbg_dest_reg_num: num of reg_ops in %dbg_dest_tlv
 * @paging_req_addr: The location were the FW will upload / download the pages
 *	from. The address is set by the opmode
 * @paging_db: Pointer to the opmode paging data base, the pointer is set by
 *	the opmode.
 * @paging_download_buf: Buffer used for copying all of the pages before
 *	downloading them to the FW. The buffer is allocated in the opmode
 */
struct iwl_trans {
	const struct iwl_trans_ops *ops;
@@ -705,6 +711,14 @@ struct iwl_trans {
	struct iwl_fw_dbg_trigger_tlv * const *dbg_trigger_tlv;
	u8 dbg_dest_reg_num;

	/*
	 * Paging parameters - All of the parameters should be set by the
	 * opmode when paging is enabled
	 */
	u32 paging_req_addr;
	struct iwl_fw_paging *paging_db;
	void *paging_download_buf;

	enum iwl_d0i3_mode d0i3_mode;

	bool wowlan_d0i3;
+26 −0
Original line number Diff line number Diff line
@@ -120,6 +120,9 @@ enum {
	ADD_STA = 0x18,
	REMOVE_STA = 0x19,

	/* paging get item */
	FW_GET_ITEM_CMD = 0x1a,

	/* TX */
	TX_CMD = 0x1c,
	TXPATH_FLUSH = 0x1e,
@@ -394,6 +397,29 @@ struct iwl_fw_paging_cmd {
	__le32 device_phy_addr[NUM_OF_FW_PAGING_BLOCKS];
} __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_1 */

/*
 * Fw items ID's
 *
 * @IWL_FW_ITEM_ID_PAGING: Address of the pages that the FW will upload
 *	download
 */
enum iwl_fw_item_id {
	IWL_FW_ITEM_ID_PAGING = 3,
};

/*
 * struct iwl_fw_get_item_cmd - get an item from the fw
 */
struct iwl_fw_get_item_cmd {
	__le32 item_id;
} __packed; /* FW_GET_ITEM_CMD_API_S_VER_1 */

struct iwl_fw_get_item_resp {
	__le32 item_id;
	__le32 item_byte_cnt;
	__le32 item_val;
} __packed; /* FW_GET_ITEM_RSP_S_VER_1 */

/**
 * struct iwl_nvm_access_resp_ver2 - response to NVM_ACCESS_CMD
 * @offset: offset in bytes into the section
Loading