Skip to contentSkip to conversation

Bluetooth: btmrvl: fix firmware dump issue

PATCH In review Amitkumar Karwar 2 participants 5 messages Sep 18, 2015 – Sep 21, 2015 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Bluetooth: btmrvl: fix firmware dump issue

From: Nachiket Kukade <[email protected]>

First firmware dump attempt from user works fine, but firmware goes into bad state after this. Subsequent attempts fails.

As required by the firmware dump implementation, this change writes FW_DUMP_READ_DONE value to dump ctrl register to address this issue.

---
 drivers/bluetooth/btmrvl_sdio.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/bluetooth/btmrvl_sdio.c +6 -0
index b9978a7..5f7c9be 100644
@@ -1278,6 +1278,12 @@ static void btmrvl_sdio_dump_firmware(struct btmrvl_private *priv)
 
 		if (memory_size == 0) {
 			BT_INFO("Firmware dump finished!");
+			sdio_writeb(card->func, FW_DUMP_READ_DONE,
+				    card->reg->fw_dump_ctrl, &ret);
+			if (ret) {
+				BT_ERR("SDIO Write MEMDUMP_FINISH ERR");
+				goto done;
+			}
 			break;
 		}
 
Signature · 1 line
1.8.1.4
#1 lore raw

PATCH 2/2 Bluetooth: btmrvl: add sd8997 chipset support

From: Zhaoyang Liu <[email protected]>

This patch adds support for Marvell's new chipset SD8997. Register offsets and supported feature flags are updated.

---
 drivers/bluetooth/Kconfig       |  4 ++--
 drivers/bluetooth/btmrvl_sdio.c | 36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+), 2 deletions(-)
drivers/bluetooth/Kconfig +2 -2
index 0bd88c9..3d480d8 100644
@@ -275,7 +275,7 @@ config BT_MRVL
 	  The core driver to support Marvell Bluetooth devices.
 
 	  This driver is required if you want to support
-	  Marvell Bluetooth devices, such as 8688/8787/8797/8887/8897.
+	  Marvell Bluetooth devices, such as 8688/8787/8797/8887/8897/8997.
 
 	  Say Y here to compile Marvell Bluetooth driver
 	  into the kernel or say M to compile it as module.
@@ -289,7 +289,7 @@ config BT_MRVL_SDIO
 	  The driver for Marvell Bluetooth chipsets with SDIO interface.
 
 	  This driver is required if you want to use Marvell Bluetooth
-	  devices with SDIO interface. Currently SD8688/SD8787/SD8797/SD8887/SD8897
+	  devices with SDIO interface. Currently SD8688/SD8787/SD8797/SD8887/SD8897/SD8997
 	  chipsets are supported.
 
 	  Say Y here to compile support for Marvell BT-over-SDIO driver
drivers/bluetooth/btmrvl_sdio.c +36 -0
index 5f7c9be..6e2c6d5 100644
@@ -146,6 +146,29 @@ static const struct btmrvl_sdio_card_reg btmrvl_reg_8897 = {
 	.fw_dump_end = 0xea,
 };
 
+static const struct btmrvl_sdio_card_reg btmrvl_reg_8997 = {
+	.cfg = 0x00,
+	.host_int_mask = 0x08,
+	.host_intstatus = 0x0c,
+	.card_status = 0x5c,
+	.sq_read_base_addr_a0 = 0xf8,
+	.sq_read_base_addr_a1 = 0xf9,
+	.card_revision = 0xc8,
+	.card_fw_status0 = 0xe8,
+	.card_fw_status1 = 0xe9,
+	.card_rx_len = 0xea,
+	.card_rx_unit = 0xeb,
+	.io_port_0 = 0xe4,
+	.io_port_1 = 0xe5,
+	.io_port_2 = 0xe6,
+	.int_read_to_clear = true,
+	.host_int_rsr = 0x04,
+	.card_misc_cfg = 0xD8,
+	.fw_dump_ctrl = 0xf0,
+	.fw_dump_start = 0xf1,
+	.fw_dump_end = 0xf8,
+};
+
 static const struct btmrvl_sdio_device btmrvl_sdio_sd8688 = {
 	.helper		= "mrvl/sd8688_helper.bin",
 	.firmware	= "mrvl/sd8688.bin",
@@ -191,6 +214,15 @@ static const struct btmrvl_sdio_device btmrvl_sdio_sd8897 = {
 	.supports_fw_dump = true,
 };
 
+static const struct btmrvl_sdio_device btmrvl_sdio_sd8997 = {
+	.helper         = NULL,
+	.firmware       = "mrvl/sdsd8997_combo.bin",
+	.reg            = &btmrvl_reg_8997,
+	.support_pscan_win_report = true,
+	.sd_blksz_fw_dl = 256,
+	.supports_fw_dump = true,
+};
+
 static const struct sdio_device_id btmrvl_sdio_ids[] = {
 	/* Marvell SD8688 Bluetooth device */
 	{ SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x9105),
@@ -210,6 +242,9 @@ static const struct sdio_device_id btmrvl_sdio_ids[] = {
 	/* Marvell SD8897 Bluetooth device */
 	{ SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x912E),
 			.driver_data = (unsigned long) &btmrvl_sdio_sd8897 },
+	/* Marvell SD8997 Bluetooth device */
+	{ SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x9142),
+			.driver_data = (unsigned long)&btmrvl_sdio_sd8997 },
 
 	{ }	/* Terminating entry */
 };
@@ -1622,3 +1657,4 @@ MODULE_FIRMWARE("mrvl/sd8787_uapsta.bin");
 MODULE_FIRMWARE("mrvl/sd8797_uapsta.bin");
 MODULE_FIRMWARE("mrvl/sd8887_uapsta.bin");
 MODULE_FIRMWARE("mrvl/sd8897_uapsta.bin");
+MODULE_FIRMWARE("mrvl/sdsd8997_combo.bin");
Signature · 1 line
1.8.1.4
maintainer
#2 lore raw

Re: [PATCH 2/2] Bluetooth: btmrvl: add sd8997 chipset support

Hi Amitkumar,

Quoted 84 lines

This patch adds support for Marvell's new chipset SD8997. Register offsets and supported feature flags are updated.

---
drivers/bluetooth/Kconfig | 4 ++--
drivers/bluetooth/btmrvl_sdio.c | 36 ++++++++++++++++++++++++++++++++++++

2 files changed, 38 insertions(+), 2 deletions(-)
drivers/bluetooth/Kconfig +2 -2
index 0bd88c9..3d480d8 100644
@@ -275,7 +275,7 @@ config BT_MRVL
 	  The core driver to support Marvell Bluetooth devices.
 
 	  This driver is required if you want to support
-	  Marvell Bluetooth devices, such as 8688/8787/8797/8887/8897.
+	  Marvell Bluetooth devices, such as 8688/8787/8797/8887/8897/8997.
 
 	  Say Y here to compile Marvell Bluetooth driver
 	  into the kernel or say M to compile it as module.
@@ -289,7 +289,7 @@ config BT_MRVL_SDIO
 	  The driver for Marvell Bluetooth chipsets with SDIO interface.
 
 	  This driver is required if you want to use Marvell Bluetooth
-	  devices with SDIO interface. Currently SD8688/SD8787/SD8797/SD8887/SD8897
+	  devices with SDIO interface. Currently SD8688/SD8787/SD8797/SD8887/SD8897/SD8997
 	  chipsets are supported.
 
 	  Say Y here to compile support for Marvell BT-over-SDIO driver
drivers/bluetooth/btmrvl_sdio.c +32 -0
index 5f7c9be..6e2c6d5 100644
@@ -146,6 +146,29 @@ static const struct btmrvl_sdio_card_reg btmrvl_reg_8897 = {
 	.fw_dump_end = 0xea,
 };
 
+static const struct btmrvl_sdio_card_reg btmrvl_reg_8997 = {
+	.cfg = 0x00,
+	.host_int_mask = 0x08,
+	.host_intstatus = 0x0c,
+	.card_status = 0x5c,
+	.sq_read_base_addr_a0 = 0xf8,
+	.sq_read_base_addr_a1 = 0xf9,
+	.card_revision = 0xc8,
+	.card_fw_status0 = 0xe8,
+	.card_fw_status1 = 0xe9,
+	.card_rx_len = 0xea,
+	.card_rx_unit = 0xeb,
+	.io_port_0 = 0xe4,
+	.io_port_1 = 0xe5,
+	.io_port_2 = 0xe6,
+	.int_read_to_clear = true,
+	.host_int_rsr = 0x04,
+	.card_misc_cfg = 0xD8,
+	.fw_dump_ctrl = 0xf0,
+	.fw_dump_start = 0xf1,
+	.fw_dump_end = 0xf8,
+};
+
 static const struct btmrvl_sdio_device btmrvl_sdio_sd8688 = {
 	.helper		= "mrvl/sd8688_helper.bin",
 	.firmware	= "mrvl/sd8688.bin",
@@ -191,6 +214,15 @@ static const struct btmrvl_sdio_device btmrvl_sdio_sd8897 = {
 	.supports_fw_dump = true,
 };
 
+static const struct btmrvl_sdio_device btmrvl_sdio_sd8997 = {
+	.helper         = NULL,
+	.firmware       = "mrvl/sdsd8997_combo.bin",
+	.reg            = &btmrvl_reg_8997,
+	.support_pscan_win_report = true,
+	.sd_blksz_fw_dl = 256,
+	.supports_fw_dump = true,
+};
+
 static const struct sdio_device_id btmrvl_sdio_ids[] = {
 	/* Marvell SD8688 Bluetooth device */
 	{ SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x9105),

drivers/bluetooth/btmrvl_sdio.c static const struct sdio_device_id btmrvl_sdio_ids[] = { · line 244

Quoted 3 lines
drivers/bluetooth/btmrvl_sdio.c +0 -0
@@ -210,6 +242,9 @@ static const struct sdio_device_id btmrvl_sdio_ids[] = {
 	/* Marvell SD8897 Bluetooth device */
 	{ SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x912E),
 			.driver_data = (unsigned long) &btmrvl_sdio_sd8897 },

please send a patch to fix the coding style for the extra space in the cast first. Lets make it all unique.

drivers/bluetooth/btmrvl_sdio.c MODULE_FIRMWARE("mrvl/sd8787_uapsta.bin"); · line 1660

Quoted 11 lines
drivers/bluetooth/btmrvl_sdio.c +4 -0
+	/* Marvell SD8997 Bluetooth device */
+	{ SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x9142),
+			.driver_data = (unsigned long)&btmrvl_sdio_sd8997 },
 
 	{ }	/* Terminating entry */
 };
@@ -1622,3 +1657,4 @@ MODULE_FIRMWARE("mrvl/sd8787_uapsta.bin");
 MODULE_FIRMWARE("mrvl/sd8797_uapsta.bin");
 MODULE_FIRMWARE("mrvl/sd8887_uapsta.bin");
 MODULE_FIRMWARE("mrvl/sd8897_uapsta.bin");
+MODULE_FIRMWARE("mrvl/sdsd8997_combo.bin");

Is the "sdsd" intentionally here. For me this looks like a typo.

Regards

Marcel

#3 lore raw

RE: [PATCH 2/2] Bluetooth: btmrvl: add sd8997 chipset support

Hi Marcel,

Quoted 98 lines

-----Original Message-----
From: Marcel Holtmann [mailto:[email protected]]
Sent: Friday, September 18, 2015 9:16 PM
To: Amitkumar Karwar
Cc: [email protected]; Cathy Luo; Zhaoyang Liu
Subject: Re: [PATCH 2/2] Bluetooth: btmrvl: add sd8997 chipset support =20
Hi Amitkumar,
=20

Quoted 17 lines

This patch adds support for Marvell's new chipset SD8997. Register offsets and supported feature flags are updated.

---
drivers/bluetooth/Kconfig | 4 ++--
drivers/bluetooth/btmrvl_sdio.c | 36
++++++++++++++++++++++++++++++++++++

2 files changed, 38 insertions(+), 2 deletions(-)
drivers/bluetooth/Kconfig +0 -0
index 0bd88c9..3d480d8 100644

drivers/bluetooth/Kconfig config BT_MRVL · line 278

Quoted 5 lines
drivers/bluetooth/Kconfig +1 -1
@@ -275,7 +275,7 @@ config BT_MRVL
 	  The core driver to support Marvell Bluetooth devices.
 
 	  This driver is required if you want to support
-	  Marvell Bluetooth devices, such as 8688/8787/8797/8887/8897.
+	  Marvell Bluetooth devices, such as

8688/8787/8797/8887/8897/8997.

drivers/bluetooth/Kconfig config BT_MRVL_SDIO · line 292

Quoted 8 lines
drivers/bluetooth/Kconfig +0 -1
 	  Say Y here to compile Marvell Bluetooth driver
 	  into the kernel or say M to compile it as module.
@@ -289,7 +289,7 @@ config BT_MRVL_SDIO
 	  The driver for Marvell Bluetooth chipsets with SDIO interface.
 
 	  This driver is required if you want to use Marvell Bluetooth
-	  devices with SDIO interface. Currently

SD8688/SD8787/SD8797/SD8887/SD8897

Quoted 5 lines
drivers/bluetooth/Kconfig +2 -0
+	  devices with SDIO interface. Currently
+SD8688/SD8787/SD8797/SD8887/SD8897/SD8997
 	  chipsets are supported.
 

Say Y here to compile support for Marvell BT-over-SDIO driver

diff

drivers/bluetooth/btmrvl_sdio.c static const struct btmrvl_sdio_card_reg

Quoted 5 lines

--git a/drivers/bluetooth/btmrvl_sdio.c b/drivers/bluetooth/btmrvl_sdio.c index 5f7c9be..6e2c6d5 100644

drivers/bluetooth/btmrvl_sdio.c +0 -0
@@ -146,6 +146,29 @@ static const struct btmrvl_sdio_card_reg

btmrvl_reg_8897 =3D {

drivers/bluetooth/btmrvl_sdio.c static const struct btmrvl_sdio_device

Quoted 30 lines
drivers/bluetooth/btmrvl_sdio.c +23 -0
 	.fw_dump_end =3D 0xea,
 };
 
+static const struct btmrvl_sdio_card_reg btmrvl_reg_8997 =3D {
+	.cfg =3D 0x00,
+	.host_int_mask =3D 0x08,
+	.host_intstatus =3D 0x0c,
+	.card_status =3D 0x5c,
+	.sq_read_base_addr_a0 =3D 0xf8,
+	.sq_read_base_addr_a1 =3D 0xf9,
+	.card_revision =3D 0xc8,
+	.card_fw_status0 =3D 0xe8,
+	.card_fw_status1 =3D 0xe9,
+	.card_rx_len =3D 0xea,
+	.card_rx_unit =3D 0xeb,
+	.io_port_0 =3D 0xe4,
+	.io_port_1 =3D 0xe5,
+	.io_port_2 =3D 0xe6,
+	.int_read_to_clear =3D true,
+	.host_int_rsr =3D 0x04,
+	.card_misc_cfg =3D 0xD8,
+	.fw_dump_ctrl =3D 0xf0,
+	.fw_dump_start =3D 0xf1,
+	.fw_dump_end =3D 0xf8,
+};
+
 static const struct btmrvl_sdio_device btmrvl_sdio_sd8688 =3D {
 	.helper		=3D "mrvl/sd8688_helper.bin",
 	.firmware	=3D "mrvl/sd8688.bin",
@@ -191,6 +214,15 @@ static const struct btmrvl_sdio_device

btmrvl_sdio_sd8897 =3D {

Quoted 14 lines
drivers/bluetooth/btmrvl_sdio.c +9 -0
 	.supports_fw_dump =3D true,
 };
 
+static const struct btmrvl_sdio_device btmrvl_sdio_sd8997 =3D {
+	.helper         =3D NULL,
+	.firmware       =3D "mrvl/sdsd8997_combo.bin",
+	.reg            =3D &btmrvl_reg_8997,
+	.support_pscan_win_report =3D true,
+	.sd_blksz_fw_dl =3D 256,
+	.supports_fw_dump =3D true,
+};
+
 static const struct sdio_device_id btmrvl_sdio_ids[] =3D {
 	/* Marvell SD8688 Bluetooth device */
Quoted 8 lines
Quoted 5 lines
drivers/bluetooth/btmrvl_sdio.c +0 -0
 	{ SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x9105), @@ -210,6 +242,9 @@
static const struct sdio_device_id btmrvl_sdio_ids[] =3D {
	/* Marvell SD8897 Bluetooth device */
	{ SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x912E),
			.driver_data =3D (unsigned long) &btmrvl_sdio_sd8897 },

=20
please send a patch to fix the coding style for the extra space in the cast first. Lets make it all unique.

Sure. I will send separate patch for this change.

Quoted 4 lines
Quoted 4 lines
drivers/bluetooth/btmrvl_sdio.c +3 -0
+	/* Marvell SD8997 Bluetooth device */
+	{ SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x9142),
+			.driver_data =3D (unsigned long)&btmrvl_sdio_sd8997 },
Quoted 10 lines

drivers/bluetooth/btmrvl_sdio.c MODULE_FIRMWARE("mrvl/sd8787_uapsta.bin"); · line 1660

Quoted 7 lines
	{ }	/* Terminating entry */
};
drivers/bluetooth/btmrvl_sdio.c +1 -0
@@ -1622,3 +1657,4 @@ MODULE_FIRMWARE("mrvl/sd8787_uapsta.bin");
 MODULE_FIRMWARE("mrvl/sd8797_uapsta.bin");
 MODULE_FIRMWARE("mrvl/sd8887_uapsta.bin");
 MODULE_FIRMWARE("mrvl/sd8897_uapsta.bin");
+MODULE_FIRMWARE("mrvl/sdsd8997_combo.bin");

=20
Is the "sdsd" intentionally here. For me this looks like a typo. =20

Thanks for pointing this out. I will correct this typo in updated version.

Regards,
Amitkumar

maintainer
#4 lore raw
In reply to Amitkumar Karwar

Hi Amitkumar,

Quoted 11 lines

First firmware dump attempt from user works fine, but firmware goes into bad state after this. Subsequent attempts fails.

As required by the firmware dump implementation, this change writes FW_DUMP_READ_DONE value to dump ctrl register to address this issue.

---
drivers/bluetooth/btmrvl_sdio.c | 6 ++++++

1 file changed, 6 insertions(+)

patch has been applied to bluetooth-next tree.

Regards

Marcel