2 * Marvell BT-over-SDIO driver: SDIO interface related functions.
4 * Copyright (C) 2009, Marvell International Ltd.
6 * This software file (the "File") is distributed by Marvell International
7 * Ltd. under the terms of the GNU General Public License Version 2, June 1991
8 * (the "License"). You may use, redistribute and/or modify this File in
9 * accordance with the terms and conditions of the License, a copy of which
10 * is available by writing to the Free Software Foundation, Inc.,
11 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
12 * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
15 * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
17 * ARE EXPRESSLY DISCLAIMED. The License provides additional details about
18 * this warranty disclaimer.
21 #include <linux/firmware.h>
22 #include <linux/slab.h>
23 #include <linux/suspend.h>
25 #include <linux/mmc/sdio_ids.h>
26 #include <linux/mmc/sdio_func.h>
27 #include <linux/module.h>
28 #include <linux/devcoredump.h>
30 #include <net/bluetooth/bluetooth.h>
31 #include <net/bluetooth/hci_core.h>
33 #include "btmrvl_drv.h"
34 #include "btmrvl_sdio.h"
38 static struct memory_type_mapping mem_type_mapping_tbl[] = {
39 {"ITCM", NULL, 0, 0xF0},
40 {"DTCM", NULL, 0, 0xF1},
41 {"SQRAM", NULL, 0, 0xF2},
42 {"APU", NULL, 0, 0xF3},
43 {"CIU", NULL, 0, 0xF4},
44 {"ICU", NULL, 0, 0xF5},
45 {"MAC", NULL, 0, 0xF6},
46 {"EXT7", NULL, 0, 0xF7},
47 {"EXT8", NULL, 0, 0xF8},
48 {"EXT9", NULL, 0, 0xF9},
49 {"EXT10", NULL, 0, 0xFA},
50 {"EXT11", NULL, 0, 0xFB},
51 {"EXT12", NULL, 0, 0xFC},
52 {"EXT13", NULL, 0, 0xFD},
53 {"EXTLAST", NULL, 0, 0xFE},
56 static const struct of_device_id btmrvl_sdio_of_match_table[] = {
57 { .compatible = "marvell,sd8897-bt" },
58 { .compatible = "marvell,sd8997-bt" },
62 static irqreturn_t btmrvl_wake_irq_bt(int irq, void *priv)
64 struct btmrvl_sdio_card *card = priv;
65 struct device *dev = &card->func->dev;
66 struct btmrvl_plt_wake_cfg *cfg = card->plt_wake_cfg;
68 dev_info(dev, "wake by bt\n");
69 cfg->wake_by_bt = true;
70 disable_irq_nosync(irq);
72 pm_wakeup_event(dev, 0);
78 /* This function parses device tree node using mmc subnode devicetree API.
79 * The device node is saved in card->plt_of_node.
80 * If the device tree node exists and includes interrupts attributes, this
81 * function will request platform specific wakeup interrupt.
83 static int btmrvl_sdio_probe_of(struct device *dev,
84 struct btmrvl_sdio_card *card)
86 struct btmrvl_plt_wake_cfg *cfg;
90 !of_match_node(btmrvl_sdio_of_match_table, dev->of_node)) {
91 dev_info(dev, "sdio device tree data not available\n");
95 card->plt_of_node = dev->of_node;
97 card->plt_wake_cfg = devm_kzalloc(dev, sizeof(*card->plt_wake_cfg),
99 cfg = card->plt_wake_cfg;
100 if (cfg && card->plt_of_node) {
101 cfg->irq_bt = irq_of_parse_and_map(card->plt_of_node, 0);
103 dev_err(dev, "fail to parse irq_bt from device tree\n");
106 ret = devm_request_irq(dev, cfg->irq_bt,
111 "Failed to request irq_bt %d (%d)\n",
114 disable_irq(cfg->irq_bt);
121 /* The btmrvl_sdio_remove() callback function is called
122 * when user removes this module from kernel space or ejects
123 * the card from the slot. The driver handles these 2 cases
125 * If the user is removing the module, a MODULE_SHUTDOWN_REQ
126 * command is sent to firmware and interrupt will be disabled.
127 * If the card is removed, there is no need to send command
128 * or disable interrupt.
130 * The variable 'user_rmmod' is used to distinguish these two
131 * scenarios. This flag is initialized as FALSE in case the card
132 * is removed, and will be set to TRUE for module removal when
133 * module_exit function is called.
135 static u8 user_rmmod;
138 static const struct btmrvl_sdio_card_reg btmrvl_reg_8688 = {
140 .host_int_mask = 0x04,
141 .host_intstatus = 0x05,
143 .sq_read_base_addr_a0 = 0x10,
144 .sq_read_base_addr_a1 = 0x11,
145 .card_fw_status0 = 0x40,
146 .card_fw_status1 = 0x41,
148 .card_rx_unit = 0x43,
152 .int_read_to_clear = false,
154 static const struct btmrvl_sdio_card_reg btmrvl_reg_87xx = {
156 .host_int_mask = 0x02,
157 .host_intstatus = 0x03,
159 .sq_read_base_addr_a0 = 0x40,
160 .sq_read_base_addr_a1 = 0x41,
161 .card_revision = 0x5c,
162 .card_fw_status0 = 0x60,
163 .card_fw_status1 = 0x61,
165 .card_rx_unit = 0x63,
169 .int_read_to_clear = false,
172 static const struct btmrvl_sdio_card_reg btmrvl_reg_8887 = {
174 .host_int_mask = 0x08,
175 .host_intstatus = 0x0C,
177 .sq_read_base_addr_a0 = 0x6C,
178 .sq_read_base_addr_a1 = 0x6D,
179 .card_revision = 0xC8,
180 .card_fw_status0 = 0x88,
181 .card_fw_status1 = 0x89,
183 .card_rx_unit = 0x8B,
187 .int_read_to_clear = true,
188 .host_int_rsr = 0x04,
189 .card_misc_cfg = 0xD8,
192 static const struct btmrvl_sdio_card_reg btmrvl_reg_8897 = {
194 .host_int_mask = 0x02,
195 .host_intstatus = 0x03,
197 .sq_read_base_addr_a0 = 0x60,
198 .sq_read_base_addr_a1 = 0x61,
199 .card_revision = 0xbc,
200 .card_fw_status0 = 0xc0,
201 .card_fw_status1 = 0xc1,
203 .card_rx_unit = 0xc3,
207 .int_read_to_clear = true,
208 .host_int_rsr = 0x01,
209 .card_misc_cfg = 0xcc,
210 .fw_dump_ctrl = 0xe2,
211 .fw_dump_start = 0xe3,
215 static const struct btmrvl_sdio_card_reg btmrvl_reg_8977 = {
217 .host_int_mask = 0x08,
218 .host_intstatus = 0x0c,
220 .sq_read_base_addr_a0 = 0xf8,
221 .sq_read_base_addr_a1 = 0xf9,
222 .card_revision = 0xc8,
223 .card_fw_status0 = 0xe8,
224 .card_fw_status1 = 0xe9,
226 .card_rx_unit = 0xeb,
230 .int_read_to_clear = true,
231 .host_int_rsr = 0x04,
232 .card_misc_cfg = 0xD8,
233 .fw_dump_ctrl = 0xf0,
234 .fw_dump_start = 0xf1,
238 static const struct btmrvl_sdio_card_reg btmrvl_reg_8987 = {
240 .host_int_mask = 0x08,
241 .host_intstatus = 0x0c,
243 .sq_read_base_addr_a0 = 0xf8,
244 .sq_read_base_addr_a1 = 0xf9,
245 .card_revision = 0xc8,
246 .card_fw_status0 = 0xe8,
247 .card_fw_status1 = 0xe9,
249 .card_rx_unit = 0xeb,
253 .int_read_to_clear = true,
254 .host_int_rsr = 0x04,
255 .card_misc_cfg = 0xd8,
256 .fw_dump_ctrl = 0xf0,
257 .fw_dump_start = 0xf1,
261 static const struct btmrvl_sdio_card_reg btmrvl_reg_8997 = {
263 .host_int_mask = 0x08,
264 .host_intstatus = 0x0c,
266 .sq_read_base_addr_a0 = 0xf8,
267 .sq_read_base_addr_a1 = 0xf9,
268 .card_revision = 0xc8,
269 .card_fw_status0 = 0xe8,
270 .card_fw_status1 = 0xe9,
272 .card_rx_unit = 0xeb,
276 .int_read_to_clear = true,
277 .host_int_rsr = 0x04,
278 .card_misc_cfg = 0xD8,
279 .fw_dump_ctrl = 0xf0,
280 .fw_dump_start = 0xf1,
284 static const struct btmrvl_sdio_device btmrvl_sdio_sd8688 = {
285 .helper = "mrvl/sd8688_helper.bin",
286 .firmware = "mrvl/sd8688.bin",
287 .reg = &btmrvl_reg_8688,
288 .support_pscan_win_report = false,
289 .sd_blksz_fw_dl = 64,
290 .supports_fw_dump = false,
293 static const struct btmrvl_sdio_device btmrvl_sdio_sd8787 = {
295 .firmware = "mrvl/sd8787_uapsta.bin",
296 .reg = &btmrvl_reg_87xx,
297 .support_pscan_win_report = false,
298 .sd_blksz_fw_dl = 256,
299 .supports_fw_dump = false,
302 static const struct btmrvl_sdio_device btmrvl_sdio_sd8797 = {
304 .firmware = "mrvl/sd8797_uapsta.bin",
305 .reg = &btmrvl_reg_87xx,
306 .support_pscan_win_report = false,
307 .sd_blksz_fw_dl = 256,
308 .supports_fw_dump = false,
311 static const struct btmrvl_sdio_device btmrvl_sdio_sd8887 = {
313 .firmware = "mrvl/sd8887_uapsta.bin",
314 .reg = &btmrvl_reg_8887,
315 .support_pscan_win_report = true,
316 .sd_blksz_fw_dl = 256,
317 .supports_fw_dump = false,
320 static const struct btmrvl_sdio_device btmrvl_sdio_sd8897 = {
322 .firmware = "mrvl/sd8897_uapsta.bin",
323 .reg = &btmrvl_reg_8897,
324 .support_pscan_win_report = true,
325 .sd_blksz_fw_dl = 256,
326 .supports_fw_dump = true,
329 static const struct btmrvl_sdio_device btmrvl_sdio_sd8977 = {
331 .firmware = "mrvl/sd8977_uapsta.bin",
332 .reg = &btmrvl_reg_8977,
333 .support_pscan_win_report = true,
334 .sd_blksz_fw_dl = 256,
335 .supports_fw_dump = true,
338 static const struct btmrvl_sdio_device btmrvl_sdio_sd8987 = {
340 .firmware = "mrvl/sd8987_uapsta.bin",
341 .reg = &btmrvl_reg_8987,
342 .support_pscan_win_report = true,
343 .sd_blksz_fw_dl = 256,
344 .supports_fw_dump = true,
347 static const struct btmrvl_sdio_device btmrvl_sdio_sd8997 = {
349 .firmware = "mrvl/sd8997_uapsta.bin",
350 .reg = &btmrvl_reg_8997,
351 .support_pscan_win_report = true,
352 .sd_blksz_fw_dl = 256,
353 .supports_fw_dump = true,
356 static const struct sdio_device_id btmrvl_sdio_ids[] = {
357 /* Marvell SD8688 Bluetooth device */
358 { SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x9105),
359 .driver_data = (unsigned long)&btmrvl_sdio_sd8688 },
360 /* Marvell SD8787 Bluetooth device */
361 { SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x911A),
362 .driver_data = (unsigned long)&btmrvl_sdio_sd8787 },
363 /* Marvell SD8787 Bluetooth AMP device */
364 { SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x911B),
365 .driver_data = (unsigned long)&btmrvl_sdio_sd8787 },
366 /* Marvell SD8797 Bluetooth device */
367 { SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x912A),
368 .driver_data = (unsigned long)&btmrvl_sdio_sd8797 },
369 /* Marvell SD8887 Bluetooth device */
370 { SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x9136),
371 .driver_data = (unsigned long)&btmrvl_sdio_sd8887 },
372 /* Marvell SD8897 Bluetooth device */
373 { SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x912E),
374 .driver_data = (unsigned long)&btmrvl_sdio_sd8897 },
375 /* Marvell SD8977 Bluetooth device */
376 { SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x9146),
377 .driver_data = (unsigned long)&btmrvl_sdio_sd8977 },
378 /* Marvell SD8987 Bluetooth device */
379 { SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x914A),
380 .driver_data = (unsigned long)&btmrvl_sdio_sd8987 },
381 /* Marvell SD8997 Bluetooth device */
382 { SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x9142),
383 .driver_data = (unsigned long)&btmrvl_sdio_sd8997 },
385 { } /* Terminating entry */
388 MODULE_DEVICE_TABLE(sdio, btmrvl_sdio_ids);
390 static int btmrvl_sdio_get_rx_unit(struct btmrvl_sdio_card *card)
395 reg = sdio_readb(card->func, card->reg->card_rx_unit, &ret);
402 static int btmrvl_sdio_read_fw_status(struct btmrvl_sdio_card *card, u16 *dat)
409 fws0 = sdio_readb(card->func, card->reg->card_fw_status0, &ret);
413 fws1 = sdio_readb(card->func, card->reg->card_fw_status1, &ret);
417 *dat = (((u16) fws1) << 8) | fws0;
422 static int btmrvl_sdio_read_rx_len(struct btmrvl_sdio_card *card, u16 *dat)
427 reg = sdio_readb(card->func, card->reg->card_rx_len, &ret);
429 *dat = (u16) reg << card->rx_unit;
434 static int btmrvl_sdio_enable_host_int_mask(struct btmrvl_sdio_card *card,
439 sdio_writeb(card->func, mask, card->reg->host_int_mask, &ret);
441 BT_ERR("Unable to enable the host interrupt!");
448 static int btmrvl_sdio_disable_host_int_mask(struct btmrvl_sdio_card *card,
454 host_int_mask = sdio_readb(card->func, card->reg->host_int_mask, &ret);
458 host_int_mask &= ~mask;
460 sdio_writeb(card->func, host_int_mask, card->reg->host_int_mask, &ret);
462 BT_ERR("Unable to disable the host interrupt!");
469 static int btmrvl_sdio_poll_card_status(struct btmrvl_sdio_card *card, u8 bits)
475 for (tries = 0; tries < MAX_POLL_TRIES * 1000; tries++) {
476 status = sdio_readb(card->func, card->reg->card_status, &ret);
479 if ((status & bits) == bits)
488 BT_ERR("FAILED! ret=%d", ret);
493 static int btmrvl_sdio_verify_fw_download(struct btmrvl_sdio_card *card,
499 /* Wait for firmware to become ready */
500 for (tries = 0; tries < pollnum; tries++) {
501 sdio_claim_host(card->func);
502 ret = btmrvl_sdio_read_fw_status(card, &firmwarestat);
503 sdio_release_host(card->func);
507 if (firmwarestat == FIRMWARE_READY)
516 static int btmrvl_sdio_download_helper(struct btmrvl_sdio_card *card)
518 const struct firmware *fw_helper = NULL;
519 const u8 *helper = NULL;
521 void *tmphlprbuf = NULL;
522 int tmphlprbufsz, hlprblknow, helperlen;
526 ret = request_firmware(&fw_helper, card->helper,
528 if ((ret < 0) || !fw_helper) {
529 BT_ERR("request_firmware(helper) failed, error code = %d",
535 helper = fw_helper->data;
536 helperlen = fw_helper->size;
538 BT_DBG("Downloading helper image (%d bytes), block size %d bytes",
539 helperlen, SDIO_BLOCK_SIZE);
541 tmphlprbufsz = ALIGN_SZ(BTM_UPLD_SIZE, BTSDIO_DMA_ALIGN);
543 tmphlprbuf = kzalloc(tmphlprbufsz, GFP_KERNEL);
545 BT_ERR("Unable to allocate buffer for helper."
546 " Terminating download");
551 helperbuf = (u8 *) ALIGN_ADDR(tmphlprbuf, BTSDIO_DMA_ALIGN);
553 /* Perform helper data transfer */
554 tx_len = (FIRMWARE_TRANSFER_NBLOCK * SDIO_BLOCK_SIZE)
559 ret = btmrvl_sdio_poll_card_status(card,
560 CARD_IO_READY | DN_LD_CARD_RDY);
562 BT_ERR("Helper download poll status timeout @ %d",
567 /* Check if there is more data? */
568 if (hlprblknow >= helperlen)
571 if (helperlen - hlprblknow < tx_len)
572 tx_len = helperlen - hlprblknow;
575 helperbuf[0] = ((tx_len & 0x000000ff) >> 0);
576 helperbuf[1] = ((tx_len & 0x0000ff00) >> 8);
577 helperbuf[2] = ((tx_len & 0x00ff0000) >> 16);
578 helperbuf[3] = ((tx_len & 0xff000000) >> 24);
580 memcpy(&helperbuf[SDIO_HEADER_LEN], &helper[hlprblknow],
583 /* Now send the data */
584 ret = sdio_writesb(card->func, card->ioport, helperbuf,
585 FIRMWARE_TRANSFER_NBLOCK * SDIO_BLOCK_SIZE);
587 BT_ERR("IO error during helper download @ %d",
592 hlprblknow += tx_len;
595 BT_DBG("Transferring helper image EOF block");
597 memset(helperbuf, 0x0, SDIO_BLOCK_SIZE);
599 ret = sdio_writesb(card->func, card->ioport, helperbuf,
602 BT_ERR("IO error in writing helper image EOF block");
610 release_firmware(fw_helper);
614 static int btmrvl_sdio_download_fw_w_helper(struct btmrvl_sdio_card *card)
616 const struct firmware *fw_firmware = NULL;
617 const u8 *firmware = NULL;
618 int firmwarelen, tmpfwbufsz, ret;
619 unsigned int tries, offset;
621 void *tmpfwbuf = NULL;
623 u16 len, blksz_dl = card->sd_blksz_fw_dl;
624 int txlen = 0, tx_blocks = 0, count = 0;
626 ret = request_firmware(&fw_firmware, card->firmware,
628 if ((ret < 0) || !fw_firmware) {
629 BT_ERR("request_firmware(firmware) failed, error code = %d",
635 firmware = fw_firmware->data;
636 firmwarelen = fw_firmware->size;
638 BT_DBG("Downloading FW image (%d bytes)", firmwarelen);
640 tmpfwbufsz = ALIGN_SZ(BTM_UPLD_SIZE, BTSDIO_DMA_ALIGN);
641 tmpfwbuf = kzalloc(tmpfwbufsz, GFP_KERNEL);
643 BT_ERR("Unable to allocate buffer for firmware."
644 " Terminating download");
649 /* Ensure aligned firmware buffer */
650 fwbuf = (u8 *) ALIGN_ADDR(tmpfwbuf, BTSDIO_DMA_ALIGN);
652 /* Perform firmware data transfer */
655 ret = btmrvl_sdio_poll_card_status(card,
656 CARD_IO_READY | DN_LD_CARD_RDY);
658 BT_ERR("FW download with helper poll status"
659 " timeout @ %d", offset);
663 /* Check if there is more data ? */
664 if (offset >= firmwarelen)
667 for (tries = 0; tries < MAX_POLL_TRIES; tries++) {
668 base0 = sdio_readb(card->func,
669 card->reg->sq_read_base_addr_a0, &ret);
671 BT_ERR("BASE0 register read failed:"
672 " base0 = 0x%04X(%d)."
673 " Terminating download",
678 base1 = sdio_readb(card->func,
679 card->reg->sq_read_base_addr_a1, &ret);
681 BT_ERR("BASE1 register read failed:"
682 " base1 = 0x%04X(%d)."
683 " Terminating download",
689 len = (((u16) base1) << 8) | base0;
698 else if (len > BTM_UPLD_SIZE) {
699 BT_ERR("FW download failure @%d, invalid length %d",
709 if (count > MAX_WRITE_IOMEM_RETRY) {
710 BT_ERR("FW download failure @%d, "
711 "over max retry count", offset);
715 BT_ERR("FW CRC error indicated by the helper: "
716 "len = 0x%04X, txlen = %d", len, txlen);
718 /* Set txlen to 0 so as to resend from same offset */
724 if (firmwarelen - offset < txlen)
725 txlen = firmwarelen - offset;
727 tx_blocks = DIV_ROUND_UP(txlen, blksz_dl);
729 memcpy(fwbuf, &firmware[offset], txlen);
732 ret = sdio_writesb(card->func, card->ioport, fwbuf,
733 tx_blocks * blksz_dl);
736 BT_ERR("FW download, writesb(%d) failed @%d",
738 sdio_writeb(card->func, HOST_CMD53_FIN,
739 card->reg->cfg, &ret);
741 BT_ERR("writeb failed (CFG)");
747 BT_INFO("FW download over, size %d bytes", offset);
753 release_firmware(fw_firmware);
757 static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv)
760 int ret, num_blocks, blksz;
761 struct sk_buff *skb = NULL;
764 struct hci_dev *hdev = priv->btmrvl_dev.hcidev;
765 struct btmrvl_sdio_card *card = priv->btmrvl_dev.card;
767 if (!card || !card->func) {
768 BT_ERR("card or function is NULL!");
773 /* Read the length of data to be transferred */
774 ret = btmrvl_sdio_read_rx_len(card, &buf_len);
776 BT_ERR("read rx_len failed");
781 blksz = SDIO_BLOCK_SIZE;
782 num_blocks = DIV_ROUND_UP(buf_len, blksz);
784 if (buf_len <= SDIO_HEADER_LEN
785 || (num_blocks * blksz) > ALLOC_BUF_SIZE) {
786 BT_ERR("invalid packet length: %d", buf_len);
791 /* Allocate buffer */
792 skb = bt_skb_alloc(num_blocks * blksz + BTSDIO_DMA_ALIGN, GFP_KERNEL);
794 BT_ERR("No free skb");
799 if ((unsigned long) skb->data & (BTSDIO_DMA_ALIGN - 1)) {
800 skb_put(skb, (unsigned long) skb->data &
801 (BTSDIO_DMA_ALIGN - 1));
802 skb_pull(skb, (unsigned long) skb->data &
803 (BTSDIO_DMA_ALIGN - 1));
808 ret = sdio_readsb(card->func, payload, card->ioport,
811 BT_ERR("readsb failed: %d", ret);
816 /* This is SDIO specific header length: byte[2][1][0], type: byte[3]
817 * (HCI_COMMAND = 1, ACL_DATA = 2, SCO_DATA = 3, 0xFE = Vendor)
820 buf_len = payload[0];
821 buf_len |= payload[1] << 8;
822 buf_len |= payload[2] << 16;
824 if (buf_len > blksz * num_blocks) {
825 BT_ERR("Skip incorrect packet: hdrlen %d buffer %d",
826 buf_len, blksz * num_blocks);
834 case HCI_ACLDATA_PKT:
835 case HCI_SCODATA_PKT:
837 hci_skb_pkt_type(skb) = type;
838 skb_put(skb, buf_len);
839 skb_pull(skb, SDIO_HEADER_LEN);
841 if (type == HCI_EVENT_PKT) {
842 if (btmrvl_check_evtpkt(priv, skb))
843 hci_recv_frame(hdev, skb);
845 hci_recv_frame(hdev, skb);
848 hdev->stat.byte_rx += buf_len;
851 case MRVL_VENDOR_PKT:
852 hci_skb_pkt_type(skb) = HCI_VENDOR_PKT;
853 skb_put(skb, buf_len);
854 skb_pull(skb, SDIO_HEADER_LEN);
856 if (btmrvl_process_event(priv, skb))
857 hci_recv_frame(hdev, skb);
859 hdev->stat.byte_rx += buf_len;
863 BT_ERR("Unknown packet type:%d", type);
864 BT_ERR("hex: %*ph", blksz * num_blocks, payload);
880 static int btmrvl_sdio_process_int_status(struct btmrvl_private *priv)
884 struct btmrvl_sdio_card *card = priv->btmrvl_dev.card;
886 spin_lock_irqsave(&priv->driver_lock, flags);
889 spin_unlock_irqrestore(&priv->driver_lock, flags);
891 sdio_claim_host(card->func);
892 if (ireg & DN_LD_HOST_INT_STATUS) {
893 if (priv->btmrvl_dev.tx_dnld_rdy)
894 BT_DBG("tx_done already received: "
895 " int_status=0x%x", ireg);
897 priv->btmrvl_dev.tx_dnld_rdy = true;
900 if (ireg & UP_LD_HOST_INT_STATUS)
901 btmrvl_sdio_card_to_host(priv);
903 sdio_release_host(card->func);
908 static int btmrvl_sdio_read_to_clear(struct btmrvl_sdio_card *card, u8 *ireg)
910 struct btmrvl_adapter *adapter = card->priv->adapter;
913 ret = sdio_readsb(card->func, adapter->hw_regs, 0, SDIO_BLOCK_SIZE);
915 BT_ERR("sdio_readsb: read int hw_regs failed: %d", ret);
919 *ireg = adapter->hw_regs[card->reg->host_intstatus];
920 BT_DBG("hw_regs[%#x]=%#x", card->reg->host_intstatus, *ireg);
925 static int btmrvl_sdio_write_to_clear(struct btmrvl_sdio_card *card, u8 *ireg)
929 *ireg = sdio_readb(card->func, card->reg->host_intstatus, &ret);
931 BT_ERR("sdio_readb: read int status failed: %d", ret);
937 * DN_LD_HOST_INT_STATUS and/or UP_LD_HOST_INT_STATUS
938 * Clear the interrupt status register and re-enable the
941 BT_DBG("int_status = 0x%x", *ireg);
943 sdio_writeb(card->func, ~(*ireg) & (DN_LD_HOST_INT_STATUS |
944 UP_LD_HOST_INT_STATUS),
945 card->reg->host_intstatus, &ret);
947 BT_ERR("sdio_writeb: clear int status failed: %d", ret);
955 static void btmrvl_sdio_interrupt(struct sdio_func *func)
957 struct btmrvl_private *priv;
958 struct btmrvl_sdio_card *card;
963 card = sdio_get_drvdata(func);
964 if (!card || !card->priv) {
965 BT_ERR("sbi_interrupt(%p) card or priv is NULL, card=%p",
972 if (priv->surprise_removed)
975 if (card->reg->int_read_to_clear)
976 ret = btmrvl_sdio_read_to_clear(card, &ireg);
978 ret = btmrvl_sdio_write_to_clear(card, &ireg);
983 spin_lock_irqsave(&priv->driver_lock, flags);
985 spin_unlock_irqrestore(&priv->driver_lock, flags);
987 btmrvl_interrupt(priv);
990 static int btmrvl_sdio_register_dev(struct btmrvl_sdio_card *card)
992 struct sdio_func *func;
996 if (!card || !card->func) {
997 BT_ERR("Error: card or function is NULL!");
1004 sdio_claim_host(func);
1006 ret = sdio_enable_func(func);
1008 BT_ERR("sdio_enable_func() failed: ret=%d", ret);
1013 ret = sdio_claim_irq(func, btmrvl_sdio_interrupt);
1015 BT_ERR("sdio_claim_irq failed: ret=%d", ret);
1020 ret = sdio_set_block_size(card->func, SDIO_BLOCK_SIZE);
1022 BT_ERR("cannot set SDIO block size");
1027 reg = sdio_readb(func, card->reg->io_port_0, &ret);
1035 reg = sdio_readb(func, card->reg->io_port_1, &ret);
1041 card->ioport |= (reg << 8);
1043 reg = sdio_readb(func, card->reg->io_port_2, &ret);
1049 card->ioport |= (reg << 16);
1051 BT_DBG("SDIO FUNC%d IO port: 0x%x", func->num, card->ioport);
1053 if (card->reg->int_read_to_clear) {
1054 reg = sdio_readb(func, card->reg->host_int_rsr, &ret);
1059 sdio_writeb(func, reg | 0x3f, card->reg->host_int_rsr, &ret);
1065 reg = sdio_readb(func, card->reg->card_misc_cfg, &ret);
1070 sdio_writeb(func, reg | 0x10, card->reg->card_misc_cfg, &ret);
1077 sdio_set_drvdata(func, card);
1079 sdio_release_host(func);
1084 sdio_release_irq(func);
1087 sdio_disable_func(func);
1090 sdio_release_host(func);
1096 static int btmrvl_sdio_unregister_dev(struct btmrvl_sdio_card *card)
1098 if (card && card->func) {
1099 sdio_claim_host(card->func);
1100 sdio_release_irq(card->func);
1101 sdio_disable_func(card->func);
1102 sdio_release_host(card->func);
1103 sdio_set_drvdata(card->func, NULL);
1109 static int btmrvl_sdio_enable_host_int(struct btmrvl_sdio_card *card)
1113 if (!card || !card->func)
1116 sdio_claim_host(card->func);
1118 ret = btmrvl_sdio_enable_host_int_mask(card, HIM_ENABLE);
1120 btmrvl_sdio_get_rx_unit(card);
1122 sdio_release_host(card->func);
1127 static int btmrvl_sdio_disable_host_int(struct btmrvl_sdio_card *card)
1131 if (!card || !card->func)
1134 sdio_claim_host(card->func);
1136 ret = btmrvl_sdio_disable_host_int_mask(card, HIM_DISABLE);
1138 sdio_release_host(card->func);
1143 static int btmrvl_sdio_host_to_card(struct btmrvl_private *priv,
1144 u8 *payload, u16 nb)
1146 struct btmrvl_sdio_card *card = priv->btmrvl_dev.card;
1151 void *tmpbuf = NULL;
1154 if (!card || !card->func) {
1155 BT_ERR("card or function is NULL!");
1159 blksz = DIV_ROUND_UP(nb, SDIO_BLOCK_SIZE) * SDIO_BLOCK_SIZE;
1162 if ((unsigned long) payload & (BTSDIO_DMA_ALIGN - 1) ||
1164 tmpbufsz = ALIGN_SZ(blksz, BTSDIO_DMA_ALIGN) +
1166 tmpbuf = kzalloc(tmpbufsz, GFP_KERNEL);
1169 buf = (u8 *) ALIGN_ADDR(tmpbuf, BTSDIO_DMA_ALIGN);
1170 memcpy(buf, payload, nb);
1173 sdio_claim_host(card->func);
1176 /* Transfer data to card */
1177 ret = sdio_writesb(card->func, card->ioport, buf,
1181 BT_ERR("i=%d writesb failed: %d", i, ret);
1182 BT_ERR("hex: %*ph", nb, payload);
1184 if (i > MAX_WRITE_IOMEM_RETRY)
1189 priv->btmrvl_dev.tx_dnld_rdy = false;
1192 sdio_release_host(card->func);
1198 static int btmrvl_sdio_download_fw(struct btmrvl_sdio_card *card)
1202 int pollnum = MAX_POLL_TRIES;
1204 if (!card || !card->func) {
1205 BT_ERR("card or function is NULL!");
1209 if (!btmrvl_sdio_verify_fw_download(card, 1)) {
1210 BT_DBG("Firmware already downloaded!");
1214 sdio_claim_host(card->func);
1216 /* Check if other function driver is downloading the firmware */
1217 fws0 = sdio_readb(card->func, card->reg->card_fw_status0, &ret);
1219 BT_ERR("Failed to read FW downloading status!");
1224 BT_DBG("BT not the winner (%#x). Skip FW downloading", fws0);
1226 /* Give other function more time to download the firmware */
1230 ret = btmrvl_sdio_download_helper(card);
1232 BT_ERR("Failed to download helper!");
1238 if (btmrvl_sdio_download_fw_w_helper(card)) {
1239 BT_ERR("Failed to download firmware!");
1246 * winner or not, with this test the FW synchronizes when the
1247 * module can continue its initialization
1249 if (btmrvl_sdio_verify_fw_download(card, pollnum)) {
1250 BT_ERR("FW failed to be active in time!");
1255 sdio_release_host(card->func);
1260 sdio_release_host(card->func);
1264 static int btmrvl_sdio_wakeup_fw(struct btmrvl_private *priv)
1266 struct btmrvl_sdio_card *card = priv->btmrvl_dev.card;
1269 if (!card || !card->func) {
1270 BT_ERR("card or function is NULL!");
1274 sdio_claim_host(card->func);
1276 sdio_writeb(card->func, HOST_POWER_UP, card->reg->cfg, &ret);
1278 sdio_release_host(card->func);
1280 BT_DBG("wake up firmware");
1285 static void btmrvl_sdio_dump_regs(struct btmrvl_private *priv)
1287 struct btmrvl_sdio_card *card = priv->btmrvl_dev.card;
1289 unsigned int reg, reg_start, reg_end;
1290 char buf[256], *ptr;
1291 u8 loop, func, data;
1294 btmrvl_sdio_wakeup_fw(priv);
1295 sdio_claim_host(card->func);
1297 for (loop = 0; loop < MAX_LOOP; loop++) {
1298 memset(buf, 0, sizeof(buf));
1302 /* Read the registers of SDIO function0 */
1312 ptr += sprintf(ptr, "SDIO Func%d (%#x-%#x): ",
1313 func, reg_start, reg_end);
1314 for (reg = reg_start; reg <= reg_end; reg++) {
1316 data = sdio_f0_readb(card->func, reg, &ret);
1318 data = sdio_readb(card->func, reg, &ret);
1321 ptr += sprintf(ptr, "%02x ", data);
1323 ptr += sprintf(ptr, "ERR");
1331 sdio_release_host(card->func);
1334 /* This function read/write firmware */
1336 rdwr_status btmrvl_sdio_rdwr_firmware(struct btmrvl_private *priv,
1339 struct btmrvl_sdio_card *card = priv->btmrvl_dev.card;
1343 sdio_writeb(card->func, FW_DUMP_HOST_READY, card->reg->fw_dump_ctrl,
1347 BT_ERR("SDIO write err");
1348 return RDWR_STATUS_FAILURE;
1351 for (tries = 0; tries < MAX_POLL_TRIES; tries++) {
1352 ctrl_data = sdio_readb(card->func, card->reg->fw_dump_ctrl,
1356 BT_ERR("SDIO read err");
1357 return RDWR_STATUS_FAILURE;
1360 if (ctrl_data == FW_DUMP_DONE)
1362 if (doneflag && ctrl_data == doneflag)
1363 return RDWR_STATUS_DONE;
1364 if (ctrl_data != FW_DUMP_HOST_READY) {
1365 BT_INFO("The ctrl reg was changed, re-try again!");
1366 sdio_writeb(card->func, FW_DUMP_HOST_READY,
1367 card->reg->fw_dump_ctrl, &ret);
1369 BT_ERR("SDIO write err");
1370 return RDWR_STATUS_FAILURE;
1373 usleep_range(100, 200);
1376 if (ctrl_data == FW_DUMP_HOST_READY) {
1377 BT_ERR("Fail to pull ctrl_data");
1378 return RDWR_STATUS_FAILURE;
1381 return RDWR_STATUS_SUCCESS;
1384 /* This function dump sdio register and memory data */
1385 static void btmrvl_sdio_coredump(struct device *dev)
1387 struct sdio_func *func = dev_to_sdio_func(dev);
1388 struct btmrvl_sdio_card *card;
1389 struct btmrvl_private *priv;
1391 unsigned int reg, reg_start, reg_end;
1392 enum rdwr_status stat;
1393 u8 *dbg_ptr, *end_ptr, *fw_dump_data, *fw_dump_ptr;
1394 u8 dump_num = 0, idx, i, read_reg, doneflag = 0;
1395 u32 memory_size, fw_dump_len = 0;
1397 card = sdio_get_drvdata(func);
1400 /* dump sdio register first */
1401 btmrvl_sdio_dump_regs(priv);
1403 if (!card->supports_fw_dump) {
1404 BT_ERR("Firmware dump not supported for this card!");
1408 for (idx = 0; idx < ARRAY_SIZE(mem_type_mapping_tbl); idx++) {
1409 struct memory_type_mapping *entry = &mem_type_mapping_tbl[idx];
1411 if (entry->mem_ptr) {
1412 vfree(entry->mem_ptr);
1413 entry->mem_ptr = NULL;
1415 entry->mem_size = 0;
1418 btmrvl_sdio_wakeup_fw(priv);
1419 sdio_claim_host(card->func);
1421 BT_INFO("== btmrvl firmware dump start ==");
1423 stat = btmrvl_sdio_rdwr_firmware(priv, doneflag);
1424 if (stat == RDWR_STATUS_FAILURE)
1427 reg = card->reg->fw_dump_start;
1428 /* Read the number of the memories which will dump */
1429 dump_num = sdio_readb(card->func, reg, &ret);
1432 BT_ERR("SDIO read memory length err");
1436 /* Read the length of every memory which will dump */
1437 for (idx = 0; idx < dump_num; idx++) {
1438 struct memory_type_mapping *entry = &mem_type_mapping_tbl[idx];
1440 stat = btmrvl_sdio_rdwr_firmware(priv, doneflag);
1441 if (stat == RDWR_STATUS_FAILURE)
1445 reg = card->reg->fw_dump_start;
1446 for (i = 0; i < 4; i++) {
1447 read_reg = sdio_readb(card->func, reg, &ret);
1449 BT_ERR("SDIO read err");
1452 memory_size |= (read_reg << i*8);
1456 if (memory_size == 0) {
1457 BT_INFO("Firmware dump finished!");
1458 sdio_writeb(card->func, FW_DUMP_READ_DONE,
1459 card->reg->fw_dump_ctrl, &ret);
1461 BT_ERR("SDIO Write MEMDUMP_FINISH ERR");
1467 BT_INFO("%s_SIZE=0x%x", entry->mem_name, memory_size);
1468 entry->mem_ptr = vzalloc(memory_size + 1);
1469 entry->mem_size = memory_size;
1470 if (!entry->mem_ptr) {
1471 BT_ERR("Vzalloc %s failed", entry->mem_name);
1475 fw_dump_len += (strlen("========Start dump ") +
1476 strlen(entry->mem_name) +
1477 strlen("========\n") +
1479 strlen("\n========End dump========\n"));
1481 dbg_ptr = entry->mem_ptr;
1482 end_ptr = dbg_ptr + memory_size;
1484 doneflag = entry->done_flag;
1485 BT_INFO("Start %s output, please wait...",
1489 stat = btmrvl_sdio_rdwr_firmware(priv, doneflag);
1490 if (stat == RDWR_STATUS_FAILURE)
1493 reg_start = card->reg->fw_dump_start;
1494 reg_end = card->reg->fw_dump_end;
1495 for (reg = reg_start; reg <= reg_end; reg++) {
1496 *dbg_ptr = sdio_readb(card->func, reg, &ret);
1498 BT_ERR("SDIO read err");
1501 if (dbg_ptr < end_ptr)
1504 BT_ERR("Allocated buffer not enough");
1507 if (stat != RDWR_STATUS_DONE) {
1510 BT_INFO("%s done: size=0x%tx",
1512 dbg_ptr - entry->mem_ptr);
1518 BT_INFO("== btmrvl firmware dump end ==");
1521 sdio_release_host(card->func);
1523 if (fw_dump_len == 0)
1526 fw_dump_data = vzalloc(fw_dump_len+1);
1527 if (!fw_dump_data) {
1528 BT_ERR("Vzalloc fw_dump_data fail!");
1531 fw_dump_ptr = fw_dump_data;
1533 /* Dump all the memory data into single file, a userspace script will
1534 * be used to split all the memory data to multiple files
1536 BT_INFO("== btmrvl firmware dump to /sys/class/devcoredump start");
1537 for (idx = 0; idx < dump_num; idx++) {
1538 struct memory_type_mapping *entry = &mem_type_mapping_tbl[idx];
1540 if (entry->mem_ptr) {
1541 strcpy(fw_dump_ptr, "========Start dump ");
1542 fw_dump_ptr += strlen("========Start dump ");
1544 strcpy(fw_dump_ptr, entry->mem_name);
1545 fw_dump_ptr += strlen(entry->mem_name);
1547 strcpy(fw_dump_ptr, "========\n");
1548 fw_dump_ptr += strlen("========\n");
1550 memcpy(fw_dump_ptr, entry->mem_ptr, entry->mem_size);
1551 fw_dump_ptr += entry->mem_size;
1553 strcpy(fw_dump_ptr, "\n========End dump========\n");
1554 fw_dump_ptr += strlen("\n========End dump========\n");
1556 vfree(mem_type_mapping_tbl[idx].mem_ptr);
1557 mem_type_mapping_tbl[idx].mem_ptr = NULL;
1561 /* fw_dump_data will be free in device coredump release function
1564 dev_coredumpv(&card->func->dev, fw_dump_data, fw_dump_len, GFP_KERNEL);
1565 BT_INFO("== btmrvl firmware dump to /sys/class/devcoredump end");
1568 static int btmrvl_sdio_probe(struct sdio_func *func,
1569 const struct sdio_device_id *id)
1572 struct btmrvl_private *priv = NULL;
1573 struct btmrvl_sdio_card *card = NULL;
1575 BT_INFO("vendor=0x%x, device=0x%x, class=%d, fn=%d",
1576 id->vendor, id->device, id->class, func->num);
1578 card = devm_kzalloc(&func->dev, sizeof(*card), GFP_KERNEL);
1584 if (id->driver_data) {
1585 struct btmrvl_sdio_device *data = (void *) id->driver_data;
1586 card->helper = data->helper;
1587 card->firmware = data->firmware;
1588 card->reg = data->reg;
1589 card->sd_blksz_fw_dl = data->sd_blksz_fw_dl;
1590 card->support_pscan_win_report = data->support_pscan_win_report;
1591 card->supports_fw_dump = data->supports_fw_dump;
1594 if (btmrvl_sdio_register_dev(card) < 0) {
1595 BT_ERR("Failed to register BT device!");
1599 /* Disable the interrupts on the card */
1600 btmrvl_sdio_disable_host_int(card);
1602 if (btmrvl_sdio_download_fw(card)) {
1603 BT_ERR("Downloading firmware failed!");
1608 btmrvl_sdio_enable_host_int(card);
1610 /* Device tree node parsing and platform specific configuration*/
1611 btmrvl_sdio_probe_of(&func->dev, card);
1613 priv = btmrvl_add_card(card);
1615 BT_ERR("Initializing card failed!");
1617 goto disable_host_int;
1622 /* Initialize the interface specific function pointers */
1623 priv->hw_host_to_card = btmrvl_sdio_host_to_card;
1624 priv->hw_wakeup_firmware = btmrvl_sdio_wakeup_fw;
1625 priv->hw_process_int_status = btmrvl_sdio_process_int_status;
1627 if (btmrvl_register_hdev(priv)) {
1628 BT_ERR("Register hdev failed!");
1630 goto disable_host_int;
1636 btmrvl_sdio_disable_host_int(card);
1638 btmrvl_sdio_unregister_dev(card);
1642 static void btmrvl_sdio_remove(struct sdio_func *func)
1644 struct btmrvl_sdio_card *card;
1647 card = sdio_get_drvdata(func);
1649 /* Send SHUTDOWN command & disable interrupt
1650 * if user removes the module.
1653 btmrvl_send_module_cfg_cmd(card->priv,
1654 MODULE_SHUTDOWN_REQ);
1655 btmrvl_sdio_disable_host_int(card);
1657 BT_DBG("unregister dev");
1658 card->priv->surprise_removed = true;
1659 btmrvl_sdio_unregister_dev(card);
1660 btmrvl_remove_card(card->priv);
1665 static int btmrvl_sdio_suspend(struct device *dev)
1667 struct sdio_func *func = dev_to_sdio_func(dev);
1668 struct btmrvl_sdio_card *card;
1669 struct btmrvl_private *priv;
1670 mmc_pm_flag_t pm_flags;
1671 struct hci_dev *hcidev;
1674 pm_flags = sdio_get_host_pm_caps(func);
1675 BT_DBG("%s: suspend: PM flags = 0x%x", sdio_func_id(func),
1677 if (!(pm_flags & MMC_PM_KEEP_POWER)) {
1678 BT_ERR("%s: cannot remain alive while suspended",
1679 sdio_func_id(func));
1682 card = sdio_get_drvdata(func);
1683 if (!card || !card->priv) {
1684 BT_ERR("card or priv structure is not valid");
1688 BT_ERR("sdio_func is not specified");
1692 /* Enable platform specific wakeup interrupt */
1693 if (card->plt_wake_cfg && card->plt_wake_cfg->irq_bt >= 0) {
1694 card->plt_wake_cfg->wake_by_bt = false;
1695 enable_irq(card->plt_wake_cfg->irq_bt);
1696 enable_irq_wake(card->plt_wake_cfg->irq_bt);
1700 priv->adapter->is_suspending = true;
1701 hcidev = priv->btmrvl_dev.hcidev;
1702 BT_DBG("%s: SDIO suspend", hcidev->name);
1703 hci_suspend_dev(hcidev);
1705 if (priv->adapter->hs_state != HS_ACTIVATED) {
1706 if (btmrvl_enable_hs(priv)) {
1707 BT_ERR("HS not activated, suspend failed!");
1708 /* Disable platform specific wakeup interrupt */
1709 if (card->plt_wake_cfg &&
1710 card->plt_wake_cfg->irq_bt >= 0) {
1711 disable_irq_wake(card->plt_wake_cfg->irq_bt);
1712 disable_irq(card->plt_wake_cfg->irq_bt);
1715 priv->adapter->is_suspending = false;
1720 priv->adapter->is_suspending = false;
1721 priv->adapter->is_suspended = true;
1723 /* We will keep the power when hs enabled successfully */
1724 if (priv->adapter->hs_state == HS_ACTIVATED) {
1725 BT_DBG("suspend with MMC_PM_KEEP_POWER");
1726 return sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
1729 BT_DBG("suspend without MMC_PM_KEEP_POWER");
1733 static int btmrvl_sdio_resume(struct device *dev)
1735 struct sdio_func *func = dev_to_sdio_func(dev);
1736 struct btmrvl_sdio_card *card;
1737 struct btmrvl_private *priv;
1738 mmc_pm_flag_t pm_flags;
1739 struct hci_dev *hcidev;
1742 pm_flags = sdio_get_host_pm_caps(func);
1743 BT_DBG("%s: resume: PM flags = 0x%x", sdio_func_id(func),
1745 card = sdio_get_drvdata(func);
1746 if (!card || !card->priv) {
1747 BT_ERR("card or priv structure is not valid");
1751 BT_ERR("sdio_func is not specified");
1756 if (!priv->adapter->is_suspended) {
1757 BT_DBG("device already resumed");
1761 priv->hw_wakeup_firmware(priv);
1762 priv->adapter->hs_state = HS_DEACTIVATED;
1763 hcidev = priv->btmrvl_dev.hcidev;
1764 BT_DBG("%s: HS DEACTIVATED in resume!", hcidev->name);
1765 priv->adapter->is_suspended = false;
1766 BT_DBG("%s: SDIO resume", hcidev->name);
1767 hci_resume_dev(hcidev);
1769 /* Disable platform specific wakeup interrupt */
1770 if (card->plt_wake_cfg && card->plt_wake_cfg->irq_bt >= 0) {
1771 disable_irq_wake(card->plt_wake_cfg->irq_bt);
1772 disable_irq(card->plt_wake_cfg->irq_bt);
1773 if (card->plt_wake_cfg->wake_by_bt)
1774 /* Undo our disable, since interrupt handler already
1777 enable_irq(card->plt_wake_cfg->irq_bt);
1783 static const struct dev_pm_ops btmrvl_sdio_pm_ops = {
1784 .suspend = btmrvl_sdio_suspend,
1785 .resume = btmrvl_sdio_resume,
1788 static struct sdio_driver bt_mrvl_sdio = {
1789 .name = "btmrvl_sdio",
1790 .id_table = btmrvl_sdio_ids,
1791 .probe = btmrvl_sdio_probe,
1792 .remove = btmrvl_sdio_remove,
1794 .owner = THIS_MODULE,
1795 .coredump = btmrvl_sdio_coredump,
1796 .pm = &btmrvl_sdio_pm_ops,
1800 static int __init btmrvl_sdio_init_module(void)
1802 if (sdio_register_driver(&bt_mrvl_sdio) != 0) {
1803 BT_ERR("SDIO Driver Registration Failed");
1807 /* Clear the flag in case user removes the card. */
1813 static void __exit btmrvl_sdio_exit_module(void)
1815 /* Set the flag as user is removing this module. */
1818 sdio_unregister_driver(&bt_mrvl_sdio);
1821 module_init(btmrvl_sdio_init_module);
1822 module_exit(btmrvl_sdio_exit_module);
1824 MODULE_AUTHOR("Marvell International Ltd.");
1825 MODULE_DESCRIPTION("Marvell BT-over-SDIO driver ver " VERSION);
1826 MODULE_VERSION(VERSION);
1827 MODULE_LICENSE("GPL v2");
1828 MODULE_FIRMWARE("mrvl/sd8688_helper.bin");
1829 MODULE_FIRMWARE("mrvl/sd8688.bin");
1830 MODULE_FIRMWARE("mrvl/sd8787_uapsta.bin");
1831 MODULE_FIRMWARE("mrvl/sd8797_uapsta.bin");
1832 MODULE_FIRMWARE("mrvl/sd8887_uapsta.bin");
1833 MODULE_FIRMWARE("mrvl/sd8897_uapsta.bin");
1834 MODULE_FIRMWARE("mrvl/sd8977_uapsta.bin");
1835 MODULE_FIRMWARE("mrvl/sd8987_uapsta.bin");
1836 MODULE_FIRMWARE("mrvl/sd8997_uapsta.bin");