From: Arik Nemtsov <arik@wizery.com>
To: <linux-wireless@vger.kernel.org>
Cc: Luciano Coelho <coelho@ti.com>, Arik Nemtsov <arik@wizery.com>
Subject: [PATCH 21/78] wl18xx: add hw_init operation
Date: Thu, 10 May 2012 12:13:26 +0300 [thread overview]
Message-ID: <1336641263-5761-22-git-send-email-arik@wizery.com> (raw)
In-Reply-To: <1336641263-5761-1-git-send-email-arik@wizery.com>
From: Luciano Coelho <coelho@ti.com>
Add wl18xx-specific HW initialization operation and create acx.[ch]
files to support that.
Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
---
drivers/net/wireless/ti/wl18xx/Makefile | 2 +-
drivers/net/wireless/ti/wl18xx/acx.c | 57 +++++++++++++++++++++++++++++++
drivers/net/wireless/ti/wl18xx/acx.h | 52 ++++++++++++++++++++++++++++
drivers/net/wireless/ti/wl18xx/main.c | 32 +++++++++++++++++
drivers/net/wireless/ti/wlcore/acx.h | 2 ++
5 files changed, 144 insertions(+), 1 deletion(-)
create mode 100644 drivers/net/wireless/ti/wl18xx/acx.c
create mode 100644 drivers/net/wireless/ti/wl18xx/acx.h
diff --git a/drivers/net/wireless/ti/wl18xx/Makefile b/drivers/net/wireless/ti/wl18xx/Makefile
index dd3b4c1..764d598 100644
--- a/drivers/net/wireless/ti/wl18xx/Makefile
+++ b/drivers/net/wireless/ti/wl18xx/Makefile
@@ -1,3 +1,3 @@
-wl18xx-objs = main.o tx.o
+wl18xx-objs = main.o acx.o tx.o
obj-$(CONFIG_WL18XX) += wl18xx.o
diff --git a/drivers/net/wireless/ti/wl18xx/acx.c b/drivers/net/wireless/ti/wl18xx/acx.c
new file mode 100644
index 0000000..aed8d0d
--- /dev/null
+++ b/drivers/net/wireless/ti/wl18xx/acx.c
@@ -0,0 +1,57 @@
+/*
+ * This file is part of wl18xx
+ *
+ * Copyright (C) 2011 Texas Instruments Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include "../wlcore/cmd.h"
+#include "../wlcore/debug.h"
+#include "../wlcore/acx.h"
+
+#include "acx.h"
+
+int wl18xx_acx_host_if_cfg_bitmap(struct wl1271 *wl, u32 host_cfg_bitmap,
+ u32 sdio_blk_size, u32 extra_mem_blks,
+ u32 len_field_size)
+{
+ struct wl18xx_acx_host_config_bitmap *bitmap_conf;
+ int ret;
+
+ bitmap_conf = kzalloc(sizeof(*bitmap_conf), GFP_KERNEL);
+ if (!bitmap_conf) {
+ ret = -ENOMEM;
+ goto out;
+ }
+
+ bitmap_conf->host_cfg_bitmap = cpu_to_le32(host_cfg_bitmap);
+ bitmap_conf->host_sdio_block_size = cpu_to_le32(sdio_blk_size);
+ bitmap_conf->extra_mem_blocks = cpu_to_le32(extra_mem_blks);
+ bitmap_conf->length_field_size = cpu_to_le32(len_field_size);
+
+ ret = wl1271_cmd_configure(wl, ACX_HOST_IF_CFG_BITMAP,
+ bitmap_conf, sizeof(*bitmap_conf));
+ if (ret < 0) {
+ wl1271_warning("wl1271 bitmap config opt failed: %d", ret);
+ goto out;
+ }
+
+out:
+ kfree(bitmap_conf);
+
+ return ret;
+}
diff --git a/drivers/net/wireless/ti/wl18xx/acx.h b/drivers/net/wireless/ti/wl18xx/acx.h
new file mode 100644
index 0000000..c8eebd8
--- /dev/null
+++ b/drivers/net/wireless/ti/wl18xx/acx.h
@@ -0,0 +1,52 @@
+/*
+ * This file is part of wl18xx
+ *
+ * Copyright (C) 2011 Texas Instruments. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#ifndef __WL18XX_ACX_H__
+#define __WL18XX_ACX_H__
+
+#include "../wlcore/wlcore.h"
+
+/* numbers of bits the length field takes (add 1 for the actual number) */
+#define WL18XX_HOST_IF_LEN_SIZE_FIELD 15
+
+struct wl18xx_acx_host_config_bitmap {
+ struct acx_header header;
+
+ __le32 host_cfg_bitmap;
+
+ __le32 host_sdio_block_size;
+
+ /* extra mem blocks per frame in TX. */
+ __le32 extra_mem_blocks;
+
+ /*
+ * number of bits of the length field in the first TX word
+ * (up to 15 - for using the entire 16 bits).
+ */
+ __le32 length_field_size;
+
+} __packed;
+
+int wl18xx_acx_host_if_cfg_bitmap(struct wl1271 *wl, u32 host_cfg_bitmap,
+ u32 sdio_blk_size, u32 extra_mem_blks,
+ u32 len_field_size);
+
+#endif /* __WL12XX_ACX_H__ */
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
index ae71131..1e0719c 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -33,6 +33,7 @@
#include "reg.h"
#include "conf.h"
+#include "acx.h"
#include "tx.h"
#include "wl18xx.h"
@@ -473,6 +474,36 @@ static void wl18xx_tx_immediate_completion(struct wl1271 *wl)
wl18xx_tx_immediate_complete(wl);
}
+static int wl18xx_hw_init(struct wl1271 *wl)
+{
+ int ret;
+ u32 host_cfg_bitmap = HOST_IF_CFG_RX_FIFO_ENABLE |
+ HOST_IF_CFG_ADD_RX_ALIGNMENT;
+
+ u32 sdio_align_size = 0;
+
+ /* Enable Tx SDIO padding */
+ if (wl->quirks & WLCORE_QUIRK_TX_BLOCKSIZE_ALIGN) {
+ host_cfg_bitmap |= HOST_IF_CFG_TX_PAD_TO_SDIO_BLK;
+ sdio_align_size = WL12XX_BUS_BLOCK_SIZE;
+ }
+
+ /* Enable Rx SDIO padding */
+ if (wl->quirks & WLCORE_QUIRK_RX_BLOCKSIZE_ALIGN) {
+ host_cfg_bitmap |= HOST_IF_CFG_RX_PAD_TO_SDIO_BLK;
+ sdio_align_size = WL12XX_BUS_BLOCK_SIZE;
+ }
+
+ ret = wl18xx_acx_host_if_cfg_bitmap(wl, host_cfg_bitmap,
+ sdio_align_size,
+ WL18XX_TX_HW_BLOCK_SPARE,
+ WL18XX_HOST_IF_LEN_SIZE_FIELD);
+ if (ret < 0)
+ return ret;
+
+ return ret;
+}
+
static struct wlcore_ops wl18xx_ops = {
.identify_chip = wl18xx_identify_chip,
.boot = wl18xx_boot,
@@ -485,6 +516,7 @@ static struct wlcore_ops wl18xx_ops = {
.get_rx_packet_len = wl18xx_get_rx_packet_len,
.tx_immediate_compl = wl18xx_tx_immediate_completion,
.tx_delayed_compl = NULL,
+ .hw_init = wl18xx_hw_init,
};
int __devinit wl18xx_probe(struct platform_device *pdev)
diff --git a/drivers/net/wireless/ti/wlcore/acx.h b/drivers/net/wireless/ti/wlcore/acx.h
index 8106b2e..7a8dfba 100644
--- a/drivers/net/wireless/ti/wlcore/acx.h
+++ b/drivers/net/wireless/ti/wlcore/acx.h
@@ -828,6 +828,8 @@ struct wl1271_acx_keep_alive_config {
#define HOST_IF_CFG_RX_FIFO_ENABLE BIT(0)
#define HOST_IF_CFG_TX_EXTRA_BLKS_SWAP BIT(1)
#define HOST_IF_CFG_TX_PAD_TO_SDIO_BLK BIT(3)
+#define HOST_IF_CFG_RX_PAD_TO_SDIO_BLK BIT(4)
+#define HOST_IF_CFG_ADD_RX_ALIGNMENT BIT(6)
enum {
WL1271_ACX_TRIG_TYPE_LEVEL = 0,
--
1.7.9.5
next prev parent reply other threads:[~2012-05-10 9:15 UTC|newest]
Thread overview: 86+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-10 9:13 [PATCH 00/78] 18xx chip support Arik Nemtsov
2012-05-10 9:13 ` [PATCH 01/78] wl18xx: add new module Arik Nemtsov
2012-05-10 9:13 ` [PATCH 02/78] wlcore_sdio/wl18xx: use SDIO revision number to identify wl18xx chips Arik Nemtsov
2012-05-10 9:13 ` [PATCH 03/78] wl18xx: add empty operations struct Arik Nemtsov
2012-05-10 9:13 ` [PATCH 04/78] wl18xx: add partition table Arik Nemtsov
2012-05-10 9:13 ` [PATCH 05/78] wl18xx: add register table Arik Nemtsov
2012-05-10 9:13 ` [PATCH 06/78] wl18xx: add identify chip operation Arik Nemtsov
2012-05-10 9:13 ` [PATCH 07/78] wl18xx: add some boot operations and hw-specific configurations Arik Nemtsov
2012-05-10 9:13 ` [PATCH 08/78] wl18xx: add trigger command and ack event operations Arik Nemtsov
2012-05-10 9:13 ` [PATCH 09/78] wl18xx: create per-chip-family private storage Arik Nemtsov
2012-05-10 9:13 ` [PATCH 10/78] wl18xx: set the number of Tx descriptors Arik Nemtsov
2012-05-10 9:13 ` [PATCH 11/78] wl18xx: set normal/GEM Tx spare block counts Arik Nemtsov
2012-05-10 9:13 ` [PATCH 12/78] wl18xx: implement hw op for calculating hw block count per packet Arik Nemtsov
2012-05-10 9:13 ` [PATCH 13/78] wl18xx: implement hw op for setting blocks in hw_tx_desc Arik Nemtsov
2012-05-10 9:13 ` [PATCH 14/78] wl18xx: implement hw op for setting frame length in tx_hw_desc Arik Nemtsov
2012-05-10 9:13 ` [PATCH 15/78] wl18xx: define HW-rate translation elements/tables Arik Nemtsov
2012-05-10 9:13 ` [PATCH 16/78] wl18xx: add fw_status private data Arik Nemtsov
2012-05-10 9:13 ` [PATCH 17/78] wl18xx: set Rx block-size alignment quirk Arik Nemtsov
2012-05-10 9:13 ` [PATCH 18/78] wl18xx: implement hw op for getting rx buffer data alignment Arik Nemtsov
2012-05-10 9:13 ` [PATCH 19/78] wl18xx: implement hw op for getting rx packet data length Arik Nemtsov
2012-05-10 9:13 ` [PATCH 20/78] wl18xx: implement immediate Tx completion Arik Nemtsov
2012-05-10 9:13 ` Arik Nemtsov [this message]
2012-05-10 9:13 ` [PATCH 22/78] wlcore/wl18xx: add hw op for setting Tx HW checksum Arik Nemtsov
2012-05-10 9:13 ` [PATCH 23/78] wlcore/wl18xx: add hw op for Rx " Arik Nemtsov
2012-05-10 9:13 ` [PATCH 24/78] wl18xx: add runtime configuration parameters Arik Nemtsov
2012-05-10 9:13 ` [PATCH 25/78] wlcore: track current channel type per vif Arik Nemtsov
2012-05-10 9:13 ` [PATCH 26/78] wl18xx: send channel type to FW on role start Arik Nemtsov
2012-05-10 9:13 ` [PATCH 27/78] wl18xx: ipmlement ap_rate_mask hw op Arik Nemtsov
2012-05-10 9:13 ` [PATCH 28/78] wlcore: support peer MIMO rates Arik Nemtsov
2012-05-10 9:13 ` [PATCH 29/78] wlcore/wl18xx: enable MIMO/wide-chan rates in AP-mode rate config Arik Nemtsov
2012-05-10 9:13 ` [PATCH 30/78] wl18xx: set HT capabilities Arik Nemtsov
2012-05-10 9:13 ` [PATCH 31/78] wl18xx: add module param for overriding HT caps Arik Nemtsov
2012-05-10 9:13 ` [PATCH 32/78] wl18xx: add board type module argument Arik Nemtsov
2012-05-10 9:13 ` [PATCH 33/78] wl18xx: translate and write the board type to SCR_PAD2 Arik Nemtsov
2012-05-10 9:13 ` [PATCH 34/78] wl18xx: read FW pc on recovery Arik Nemtsov
2012-05-10 9:13 ` [PATCH 35/78] wl18xx: disable FW log functionality Arik Nemtsov
2012-05-10 9:13 ` [PATCH 36/78] wl18xx: read clock frequency and do top init accordingly Arik Nemtsov
2012-05-10 9:13 ` [PATCH 37/78] wlcore: rename wl12xx.h to wlcore_i.h Arik Nemtsov
2012-05-10 9:13 ` [PATCH 38/78] wlcore/wl12xx: move ref_clock and tcxo_clock elements to wl12xx Arik Nemtsov
2012-05-10 9:13 ` [PATCH 39/78] wl18xx: implement hw op to read PG version Arik Nemtsov
2012-05-10 9:13 ` [PATCH 40/78] wlcore/wl12xx: move rx_mem_pool_addr element to wl12xx Arik Nemtsov
2012-05-10 9:13 ` [PATCH 41/78] wl18xx: init Tx-released index to 0 on HW init Arik Nemtsov
2012-05-10 9:13 ` [PATCH 42/78] wl18xx: don't upload NVS to FW Arik Nemtsov
2012-05-10 9:13 ` [PATCH 43/78] wl18xx: change board type enum according to new FW Arik Nemtsov
2012-05-10 9:13 ` [PATCH 44/78] wlcore/wl12xx: add plt_init op and move the code to wl12xx Arik Nemtsov
2012-05-10 9:13 ` [PATCH 45/78] wl18xx: add plt_init operation Arik Nemtsov
2012-05-10 9:13 ` [PATCH 46/78] wl18xx: change the low_band_component_type for HDK boards Arik Nemtsov
2012-05-10 9:13 ` [PATCH 47/78] wl18xx: add number of antennas and dc2dc type as module params Arik Nemtsov
2012-05-10 9:13 ` [PATCH 48/78] wl18xx: add module parameter to disable TCP checksum Arik Nemtsov
2012-05-10 9:13 ` [PATCH 49/78] wlcore/wl12xx/18xx: split fw_status struct into two Arik Nemtsov
2012-05-10 9:13 ` [PATCH 50/78] wl18xx: derive the MAC address from the BD_ADDR in fuse ROM Arik Nemtsov
2012-05-10 9:13 ` [PATCH 51/78] wl18xx: add a module parameter to control 11a support Arik Nemtsov
2012-05-10 9:13 ` [PATCH 52/78] wlcore: add module parameter to dump SDIO reads and writes Arik Nemtsov
2012-05-10 9:13 ` [PATCH 53/78] wl18xx: copy the default configuration before checking the board_type Arik Nemtsov
2012-05-10 9:13 ` [PATCH 54/78] wl18xx: changed default board_type to HDK Arik Nemtsov
2012-05-10 9:14 ` [PATCH 55/78] wlcore: add space for private area when allocating fw_status Arik Nemtsov
2012-05-10 9:14 ` [PATCH 56/78] wl18xx: change low_band_component_type value for COM8 Arik Nemtsov
2012-05-10 9:14 ` [PATCH 57/78] wlcore: reorder identify_chip and get_hw_info Arik Nemtsov
2012-05-10 9:14 ` [PATCH 58/78] wl18xx: disable MCS_13 for wl18xx PG 1.0 Arik Nemtsov
2012-05-10 9:14 ` [PATCH 59/78] wlcore: update beacon and probe_resp templates when rates change Arik Nemtsov
2012-05-10 9:14 ` [PATCH 60/78] wlcore: use all AP basic rates as default Arik Nemtsov
2012-05-10 9:14 ` [PATCH 61/78] wlcore: abstract debugfs fw_stats to be handled by the lower drivers Arik Nemtsov
2012-05-10 9:14 ` [PATCH 62/78] wlcore: add debugfs macro to help print fw statistics arrays Arik Nemtsov
2012-05-10 9:14 ` [PATCH 63/78] wl12xx: implement fw status debugfs entries Arik Nemtsov
2012-05-10 9:14 ` [PATCH 64/78] wl18xx: " Arik Nemtsov
2012-05-10 9:14 ` [PATCH 65/78] wlcore: create private static_data area and add operation to parse it Arik Nemtsov
2012-05-10 9:14 ` [PATCH 66/78] wl18xx: print the PHY firmware version from the private static data Arik Nemtsov
2012-05-10 9:14 ` [PATCH 67/78] wlcore: print the interrupt status when recovery is triggered Arik Nemtsov
2012-05-10 9:14 ` [PATCH 68/78] wl18xx: don't use MIMO when ht_mode is set to wide Arik Nemtsov
2012-05-10 9:14 ` [PATCH 69/78] wlcore: use proper values for supported local rates Arik Nemtsov
2012-05-10 9:14 ` [PATCH 70/78] wl18xx: add module parameter to force SISO 20MHz Arik Nemtsov
2012-05-10 9:14 ` [PATCH 71/78] wl18xx: add power limit reference value to mac_and_phy settings Arik Nemtsov
2012-05-10 9:14 ` [PATCH 72/78] wl18xx: export low/high band component values as module params Arik Nemtsov
2012-05-10 9:14 ` [PATCH 73/78] wl18xx: export pwr_limit_reference_11_abg value as a module parameter Arik Nemtsov
2012-05-10 9:14 ` [PATCH 74/78] wlcore/wl12xx/wl18xx: move lower driver debugfs to a subdir Arik Nemtsov
2012-05-10 9:14 ` [PATCH 75/78] wlcore: increase aggregation buffer size by one page Arik Nemtsov
2012-05-10 9:14 ` [PATCH 76/78] wl18xx: increase tx_ba_win_size to 64 Arik Nemtsov
2012-05-10 9:14 ` [PATCH 77/78] wl18xx: use new fw stats structures Arik Nemtsov
2012-05-10 9:14 ` [PATCH 78/78] wl18xx: change default tcp_checksum to false Arik Nemtsov
2012-05-10 9:50 ` [PATCH 00/78] 18xx chip support Kalle Valo
2012-05-10 10:11 ` Arik Nemtsov
2012-05-10 10:15 ` Kalle Valo
2012-05-10 10:25 ` Arik Nemtsov
2012-05-11 5:57 ` Luciano Coelho
2012-05-11 9:03 ` Kalle Valo
2012-06-05 14:04 ` Luciano Coelho
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1336641263-5761-22-git-send-email-arik@wizery.com \
--to=arik@wizery.com \
--cc=coelho@ti.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).