From patchwork Fri Mar 30 07:19:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping-Ke Shih X-Patchwork-Id: 10317163 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9603F602A7 for ; Fri, 30 Mar 2018 07:20:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 801062A49E for ; Fri, 30 Mar 2018 07:20:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 74E452A55C; Fri, 30 Mar 2018 07:20:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C64E72A49E for ; Fri, 30 Mar 2018 07:20:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751865AbeC3HUc (ORCPT ); Fri, 30 Mar 2018 03:20:32 -0400 Received: from rtits2.realtek.com ([211.75.126.72]:34469 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752665AbeC3HTl (ORCPT ); Fri, 30 Mar 2018 03:19:41 -0400 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.62 with qID w2U7JUKD012931, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtitcasv01.realtek.com.tw [172.21.6.18]) by rtits2.realtek.com.tw (8.15.2/2.57/5.78) with ESMTP id w2U7JUKD012931; Fri, 30 Mar 2018 15:19:30 +0800 Received: from localhost.localdomain (172.21.69.140) by RTITCASV01.realtek.com.tw (172.21.6.18) with Microsoft SMTP Server id 14.3.294.0; Fri, 30 Mar 2018 15:19:29 +0800 From: To: CC: , Subject: [PATCH 05/17] rtlwifi: halmac: describe number and size of chip functions Date: Fri, 30 Mar 2018 15:19:04 +0800 Message-ID: <20180330071916.23360-6-pkshih@realtek.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180330071916.23360-1-pkshih@realtek.com> References: <20180330071916.23360-1-pkshih@realtek.com> MIME-Version: 1.0 X-Originating-IP: [172.21.69.140] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ping-Ke Shih The number and size of chip fucntions are different, such as TX/RX FIFO size, efuse size, etc. So they are defined in an individual file. Signed-off-by: Ping-Ke Shih --- .../halmac_88xx/halmac_8822b/halmac_8822b_cfg.h | 68 ++++++++++++++++++++++ .../rtlwifi/halmac/halmac_88xx/halmac_88xx_cfg.h | 40 +++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 drivers/net/wireless/realtek/rtlwifi/halmac/halmac_88xx/halmac_8822b/halmac_8822b_cfg.h create mode 100644 drivers/net/wireless/realtek/rtlwifi/halmac/halmac_88xx/halmac_88xx_cfg.h diff --git a/drivers/net/wireless/realtek/rtlwifi/halmac/halmac_88xx/halmac_8822b/halmac_8822b_cfg.h b/drivers/net/wireless/realtek/rtlwifi/halmac/halmac_88xx/halmac_8822b/halmac_8822b_cfg.h new file mode 100644 index 000000000000..f6ed7b44549c --- /dev/null +++ b/drivers/net/wireless/realtek/rtlwifi/halmac/halmac_88xx/halmac_8822b/halmac_8822b_cfg.h @@ -0,0 +1,68 @@ +/****************************************************************************** + * + * Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + ******************************************************************************/ + +#ifndef _HALMAC_8822B_CFG_H_ +#define _HALMAC_8822B_CFG_H_ + +#include "../halmac_88xx_cfg.h" + +#define TX_FIFO_SIZE_8822B 262144 +#define RX_FIFO_SIZE_8822B 24576 +#define TRX_SHARE_SIZE_8822B 65536 + +#define RX_DESC_DUMMY_SIZE_8822B 72 /* 8 * 9 Bytes */ +#define RX_FIFO_EXPANDING_MODE_PKT_SIZE_MAX_8822B 80 /* 8 Byte alignment*/ + +/* should be 8 Byte alignment*/ +#if (HALMAC_RX_FIFO_EXPANDING_MODE_PKT_SIZE <= \ + RX_FIFO_EXPANDING_MODE_PKT_SIZE_MAX_8822B) +#define RX_FIFO_EXPANDING_UNIT_8822B (RX_DESC_SIZE_88XX + \ + RX_DESC_DUMMY_SIZE_8822B + HALMAC_RX_FIFO_EXPANDING_MODE_PKT_SIZE) +#else +#define RX_FIFO_EXPANDING_UNIT_8822B (RX_DESC_SIZE_88XX + \ + RX_DESC_DUMMY_SIZE_8822B + RX_FIFO_EXPANDING_MODE_PKT_SIZE_MAX_8822B) +#endif + +#define TX_FIFO_SIZE_LA_8822B (TX_FIFO_SIZE_8822B >> 1) +#define TX_FIFO_SIZE_RX_EXPAND_1BLK_8822B \ + (TX_FIFO_SIZE_8822B - TRX_SHARE_SIZE_8822B) +#define RX_FIFO_SIZE_RX_EXPAND_1BLK_8822B \ + ((((RX_FIFO_EXPANDING_UNIT_8822B << 8) - 1) >> 10) << 10) +#define TX_FIFO_SIZE_RX_EXPAND_2BLK_8822B \ + (TX_FIFO_SIZE_8822B - (2 * TRX_SHARE_SIZE_8822B)) +#define RX_FIFO_SIZE_RX_EXPAND_2BLK_8822B \ + (RX_FIFO_SIZE_8822B + (2 * TRX_SHARE_SIZE_8822B)) +#define TX_FIFO_SIZE_RX_EXPAND_3BLK_8822B \ + (TX_FIFO_SIZE_8822B - (3 * TRX_SHARE_SIZE_8822B)) +#define RX_FIFO_SIZE_RX_EXPAND_3BLK_8822B \ + (RX_FIFO_SIZE_8822B + (3 * TRX_SHARE_SIZE_8822B)) + +#define EFUSE_SIZE_8822B 1024 +#define EEPROM_SIZE_8822B 768 +#define BT_EFUSE_SIZE_8822B 128 + +#define SEC_CAM_NUM_8822B 64 + +#define OQT_ENTRY_AC_8822B 32 +#define OQT_ENTRY_NOAC_8822B 32 +#define MACID_MAX_8822B 128 + +#define WLAN_FW_IRAM_MAX_SIZE_8822B 196608 +#define WLAN_FW_DRAM_MAX_SIZE_8822B 49152 +#define WLAN_FW_ERAM_MAX_SIZE_8822B 0 +#define WLAN_FW_MAX_SIZE_8822B (WLAN_FW_IRAM_MAX_SIZE_8822B + \ + WLAN_FW_DRAM_MAX_SIZE_8822B + WLAN_FW_ERAM_MAX_SIZE_8822B) + +#endif diff --git a/drivers/net/wireless/realtek/rtlwifi/halmac/halmac_88xx/halmac_88xx_cfg.h b/drivers/net/wireless/realtek/rtlwifi/halmac/halmac_88xx/halmac_88xx_cfg.h new file mode 100644 index 000000000000..22514ef4680d --- /dev/null +++ b/drivers/net/wireless/realtek/rtlwifi/halmac/halmac_88xx/halmac_88xx_cfg.h @@ -0,0 +1,40 @@ +/****************************************************************************** + * + * Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + ******************************************************************************/ + +#ifndef _HALMAC_88XX_CFG_H_ +#define _HALMAC_88XX_CFG_H_ + +#include "../halmac_api.h" + +#define TX_PAGE_SIZE_88XX 128 +#define TX_PAGE_SIZE_SHIFT_88XX 7 /* 128 = 2^7 */ +#define TX_ALIGN_SIZE_88XX 8 +#define SDIO_TX_MAX_SIZE_88XX 31744 +#define RX_BUF_FW_88XX 12288 + +#define TX_DESC_SIZE_88XX 48 +#define RX_DESC_SIZE_88XX 24 + +#define H2C_PKT_SIZE_88XX 32 /* Only support 32 byte packet now */ +#define H2C_PKT_HDR_SIZE_88XX 8 +#define C2H_DATA_OFFSET_88XX 10 +#define C2H_PKT_BUF_88XX 256 + +/* HW memory address */ +#define OCPBASE_TXBUF_88XX 0x18780000 +#define OCPBASE_DMEM_88XX 0x00200000 +#define OCPBASE_EMEM_88XX 0x00100000 + +#endif