diff mbox series

[v1,3/3] net: wireless: brcmfmac: Add support for AP6275P

Message ID 20240620020015.4021696-4-jacobe.zang@wesion.com (mailing list archive)
State New, archived
Headers show
Series Add AP6275P wireless support | expand

Commit Message

Jacobe Zang June 20, 2024, 2 a.m. UTC
This module features BCM43752A2 chipset. The firmware requires
randomness seeding, so enabled it.

Signed-off-by: Jacobe Zang <jacobe.zang@wesion.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c      | 5 ++++-
 .../net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h    | 2 ++
 2 files changed, 6 insertions(+), 1 deletion(-)

Comments

Ondřej Jirman June 22, 2024, 12:22 a.m. UTC | #1
On Thu, Jun 20, 2024 at 10:00:15AM GMT, Jacobe Zang wrote:
> This module features BCM43752A2 chipset. The firmware requires
> randomness seeding, so enabled it.

Any reason to strip info about origin of the patch, my SoB and
present this work as your own?

Original patch here https://megous.com/git/linux/commit/?h=ap6275p-6.10&id=1a99573bc8ed412e60e1969c0b29d53a0e5782e0

regards,
	o.

> Signed-off-by: Jacobe Zang <jacobe.zang@wesion.com>
> ---
>  drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c      | 5 ++++-
>  .../net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h    | 2 ++
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
> index f241e1757d7e3..add317731126c 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
> @@ -71,6 +71,7 @@ BRCMF_FW_CLM_DEF(4377B3, "brcmfmac4377b3-pcie");
>  BRCMF_FW_CLM_DEF(4378B1, "brcmfmac4378b1-pcie");
>  BRCMF_FW_CLM_DEF(4378B3, "brcmfmac4378b3-pcie");
>  BRCMF_FW_CLM_DEF(4387C2, "brcmfmac4387c2-pcie");
> +BRCMF_FW_CLM_DEF(43752, "brcmfmac43752-pcie");
>  
>  /* firmware config files */
>  MODULE_FIRMWARE(BRCMF_FW_DEFAULT_PATH "brcmfmac*-pcie.txt");
> @@ -105,6 +106,7 @@ static const struct brcmf_firmware_mapping brcmf_pcie_fwnames[] = {
>  	BRCMF_FW_ENTRY(BRCM_CC_43664_CHIP_ID, 0xFFFFFFF0, 4366C),
>  	BRCMF_FW_ENTRY(BRCM_CC_43666_CHIP_ID, 0xFFFFFFF0, 4366C),
>  	BRCMF_FW_ENTRY(BRCM_CC_4371_CHIP_ID, 0xFFFFFFFF, 4371),
> +	BRCMF_FW_ENTRY(BRCM_CC_43752_CHIP_ID, 0xFFFFFFFF, 43752),
>  	BRCMF_FW_ENTRY(BRCM_CC_4377_CHIP_ID, 0xFFFFFFFF, 4377B3), /* revision ID 4 */
>  	BRCMF_FW_ENTRY(BRCM_CC_4378_CHIP_ID, 0x0000000F, 4378B1), /* revision ID 3 */
>  	BRCMF_FW_ENTRY(BRCM_CC_4378_CHIP_ID, 0xFFFFFFE0, 4378B3), /* revision ID 5 */
> @@ -1721,7 +1723,7 @@ static int brcmf_pcie_download_fw_nvram(struct brcmf_pciedev_info *devinfo,
>  		memcpy_toio(devinfo->tcm + address, nvram, nvram_len);
>  		brcmf_fw_nvram_free(nvram);
>  
> -		if (devinfo->otp.valid) {
> +		if (devinfo->otp.valid || devinfo->ci->chip == BRCM_CC_43752_CHIP_ID) {
>  			size_t rand_len = BRCMF_RANDOM_SEED_LENGTH;
>  			struct brcmf_random_seed_footer footer = {
>  				.length = cpu_to_le32(rand_len),
> @@ -2710,6 +2712,7 @@ static const struct pci_device_id brcmf_pcie_devid_table[] = {
>  	BRCMF_PCIE_DEVICE(BRCM_PCIE_4366_5G_DEVICE_ID, BCA),
>  	BRCMF_PCIE_DEVICE(BRCM_PCIE_4371_DEVICE_ID, WCC),
>  	BRCMF_PCIE_DEVICE(BRCM_PCIE_43596_DEVICE_ID, CYW),
> +	BRCMF_PCIE_DEVICE(BRCM_PCIE_43752_DEVICE_ID, WCC),
>  	BRCMF_PCIE_DEVICE(BRCM_PCIE_4377_DEVICE_ID, WCC),
>  	BRCMF_PCIE_DEVICE(BRCM_PCIE_4378_DEVICE_ID, WCC),
>  	BRCMF_PCIE_DEVICE(BRCM_PCIE_4387_DEVICE_ID, WCC),
> diff --git a/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h b/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h
> index 44684bf1b9acc..c1e22c589d85e 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h
> +++ b/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h
> @@ -52,6 +52,7 @@
>  #define BRCM_CC_43664_CHIP_ID		43664
>  #define BRCM_CC_43666_CHIP_ID		43666
>  #define BRCM_CC_4371_CHIP_ID		0x4371
> +#define BRCM_CC_43752_CHIP_ID		43752
>  #define BRCM_CC_4377_CHIP_ID		0x4377
>  #define BRCM_CC_4378_CHIP_ID		0x4378
>  #define BRCM_CC_4387_CHIP_ID		0x4387
> @@ -94,6 +95,7 @@
>  #define BRCM_PCIE_4366_5G_DEVICE_ID	0x43c5
>  #define BRCM_PCIE_4371_DEVICE_ID	0x440d
>  #define BRCM_PCIE_43596_DEVICE_ID	0x4415
> +#define BRCM_PCIE_43752_DEVICE_ID	0x449d
>  #define BRCM_PCIE_4377_DEVICE_ID	0x4488
>  #define BRCM_PCIE_4378_DEVICE_ID	0x4425
>  #define BRCM_PCIE_4387_DEVICE_ID	0x4433
> -- 
> 2.34.1
>
Arend van Spriel June 22, 2024, 10:59 a.m. UTC | #2
On 6/22/2024 2:22 AM, Ondřej Jirman wrote:
> On Thu, Jun 20, 2024 at 10:00:15AM GMT, Jacobe Zang wrote:
>> This module features BCM43752A2 chipset. The firmware requires
>> randomness seeding, so enabled it.
> 
> Any reason to strip info about origin of the patch, my SoB and
> present this work as your own?
> 
> Original patch here https://megous.com/git/linux/commit/?h=ap6275p-6.10&id=1a99573bc8ed412e60e1969c0b29d53a0e5782e0
> 
> regards,
> 	o.
> 
>> Signed-off-by: Jacobe Zang <jacobe.zang@wesion.com>

I sincerely hope this is just a rookie mistake so please carefully read 
the URL below:

https://www.kernel.org/doc/html/latest/process/submitting-patches.html

Hope it helps.

Regards,
Arend

>> ---
>>   drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c      | 5 ++++-
>>   .../net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h    | 2 ++
>>   2 files changed, 6 insertions(+), 1 deletion(-)
Jacobe Zang June 23, 2024, 2:21 a.m. UTC | #3
> Any reason to strip info about origin of the patch, my SoB and
> present this work as your own?

Sincerely express my apology to Ondrej. It's really my mistake. After getting your permission if I could submit the patches. I jsut think if the author and submitter is not the same person is strange so I changed it. Next tiem I will avoid this mistake. Apologize again.


> I sincerely hope this is just a rookie mistake so please carefully read
the URL below:

> https://www.kernel.org/doc/html/latest/process/submitting-patches.html

Thanks for the guidance Arend. After reading the document I realized what a stupid mistake I made.

BTW I have another question, except the SoB of the real author, should I also post the original link in commit message?

---
Best Regards
Jacobe
Arend van Spriel June 23, 2024, 5:34 a.m. UTC | #4
On June 23, 2024 4:21:46 AM Jacobe Zang <jacobe.zang@wesion.com> wrote:

>> Any reason to strip info about origin of the patch, my SoB and
>> present this work as your own?
>
> Sincerely express my apology to Ondrej. It's really my mistake. After 
> getting your permission if I could submit the patches. I jsut think if the 
> author and submitter is not the same person is strange so I changed it. 
> Next tiem I will avoid this mistake. Apologize again.
>
>
>> I sincerely hope this is just a rookie mistake so please carefully read
> the URL below:
>
>> https://www.kernel.org/doc/html/latest/process/submitting-patches.html
>
> Thanks for the guidance Arend. After reading the document I realized what a 
> stupid mistake I made.
>
> BTW I have another question, except the SoB of the real author, should I 
> also post the original link in commit message?

Not really necessary. You may if you think that it's useful. Always add 
your SoB and keep SoB tags present untouched.

Regards,
Arend
Ondřej Jirman June 23, 2024, 8:01 a.m. UTC | #5
Hi Jacobe,

On Sun, Jun 23, 2024 at 02:21:39AM GMT, Jacobe Zang wrote:
> > Any reason to strip info about origin of the patch, my SoB and
> > present this work as your own?
> 
> Sincerely express my apology to Ondrej. It's really my mistake. After getting
> your permission if I could submit the patches. I jsut think if the author and
> submitter is not the same person is strange so I changed it. Next tiem I will
> avoid this mistake. Apologize again.
> 
> 
> > I sincerely hope this is just a rookie mistake so please carefully read
> the URL below:
> 
> > https://www.kernel.org/doc/html/latest/process/submitting-patches.html
> 
> Thanks for the guidance Arend. After reading the document I realized what a stupid mistake I made.
> 
> BTW I have another question, except the SoB of the real author, should I also post the original link in commit message?

I suggest keeping at least this part:

> Partially copied from https://lore.kernel.org/all/c7b331edd65b66521a6605177d654e55051568a3.camel@toradex.com/
> 
> (No Signed-off-by provided in the email. The code looks like some
> data copied probably from a vendor driver and adapted for the upstream
> one.)

I'm not the complete author of the patch either. I just figured out why
just adding device/chip IDs was not enough compared to what Marcel Ziswiler
tried and expanded the patch from his email, to make it work.

People using baords with AP6275P (eg. I did my debugging on QuartzPro64) will
also be interested in how to get the firmware for AP6275P, and there are some
hints for that in the above link, too. (FW filename that is in the patch for the
driver doesn't match FW name as distributed by eg. SparkLAN, which makes it
harder to find it just based on FW name from the code)

Although it would be nice to have the firmware available in linux-firmware.

Kind regards,
	o.

> ---
> Best Regards
> Jacobe
Jacobe Zang June 23, 2024, 10:11 a.m. UTC | #6
> Although it would be nice to have the firmware available in linux-firmware.

I think this is a better idea. If we get details from what linux-firmware installed we can found that it has already include the brcm firmware. Only different models from AP6275P. 


---
Best Regards
Jacobe
diff mbox series

Patch

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
index f241e1757d7e3..add317731126c 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
@@ -71,6 +71,7 @@  BRCMF_FW_CLM_DEF(4377B3, "brcmfmac4377b3-pcie");
 BRCMF_FW_CLM_DEF(4378B1, "brcmfmac4378b1-pcie");
 BRCMF_FW_CLM_DEF(4378B3, "brcmfmac4378b3-pcie");
 BRCMF_FW_CLM_DEF(4387C2, "brcmfmac4387c2-pcie");
+BRCMF_FW_CLM_DEF(43752, "brcmfmac43752-pcie");
 
 /* firmware config files */
 MODULE_FIRMWARE(BRCMF_FW_DEFAULT_PATH "brcmfmac*-pcie.txt");
@@ -105,6 +106,7 @@  static const struct brcmf_firmware_mapping brcmf_pcie_fwnames[] = {
 	BRCMF_FW_ENTRY(BRCM_CC_43664_CHIP_ID, 0xFFFFFFF0, 4366C),
 	BRCMF_FW_ENTRY(BRCM_CC_43666_CHIP_ID, 0xFFFFFFF0, 4366C),
 	BRCMF_FW_ENTRY(BRCM_CC_4371_CHIP_ID, 0xFFFFFFFF, 4371),
+	BRCMF_FW_ENTRY(BRCM_CC_43752_CHIP_ID, 0xFFFFFFFF, 43752),
 	BRCMF_FW_ENTRY(BRCM_CC_4377_CHIP_ID, 0xFFFFFFFF, 4377B3), /* revision ID 4 */
 	BRCMF_FW_ENTRY(BRCM_CC_4378_CHIP_ID, 0x0000000F, 4378B1), /* revision ID 3 */
 	BRCMF_FW_ENTRY(BRCM_CC_4378_CHIP_ID, 0xFFFFFFE0, 4378B3), /* revision ID 5 */
@@ -1721,7 +1723,7 @@  static int brcmf_pcie_download_fw_nvram(struct brcmf_pciedev_info *devinfo,
 		memcpy_toio(devinfo->tcm + address, nvram, nvram_len);
 		brcmf_fw_nvram_free(nvram);
 
-		if (devinfo->otp.valid) {
+		if (devinfo->otp.valid || devinfo->ci->chip == BRCM_CC_43752_CHIP_ID) {
 			size_t rand_len = BRCMF_RANDOM_SEED_LENGTH;
 			struct brcmf_random_seed_footer footer = {
 				.length = cpu_to_le32(rand_len),
@@ -2710,6 +2712,7 @@  static const struct pci_device_id brcmf_pcie_devid_table[] = {
 	BRCMF_PCIE_DEVICE(BRCM_PCIE_4366_5G_DEVICE_ID, BCA),
 	BRCMF_PCIE_DEVICE(BRCM_PCIE_4371_DEVICE_ID, WCC),
 	BRCMF_PCIE_DEVICE(BRCM_PCIE_43596_DEVICE_ID, CYW),
+	BRCMF_PCIE_DEVICE(BRCM_PCIE_43752_DEVICE_ID, WCC),
 	BRCMF_PCIE_DEVICE(BRCM_PCIE_4377_DEVICE_ID, WCC),
 	BRCMF_PCIE_DEVICE(BRCM_PCIE_4378_DEVICE_ID, WCC),
 	BRCMF_PCIE_DEVICE(BRCM_PCIE_4387_DEVICE_ID, WCC),
diff --git a/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h b/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h
index 44684bf1b9acc..c1e22c589d85e 100644
--- a/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h
+++ b/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h
@@ -52,6 +52,7 @@ 
 #define BRCM_CC_43664_CHIP_ID		43664
 #define BRCM_CC_43666_CHIP_ID		43666
 #define BRCM_CC_4371_CHIP_ID		0x4371
+#define BRCM_CC_43752_CHIP_ID		43752
 #define BRCM_CC_4377_CHIP_ID		0x4377
 #define BRCM_CC_4378_CHIP_ID		0x4378
 #define BRCM_CC_4387_CHIP_ID		0x4387
@@ -94,6 +95,7 @@ 
 #define BRCM_PCIE_4366_5G_DEVICE_ID	0x43c5
 #define BRCM_PCIE_4371_DEVICE_ID	0x440d
 #define BRCM_PCIE_43596_DEVICE_ID	0x4415
+#define BRCM_PCIE_43752_DEVICE_ID	0x449d
 #define BRCM_PCIE_4377_DEVICE_ID	0x4488
 #define BRCM_PCIE_4378_DEVICE_ID	0x4425
 #define BRCM_PCIE_4387_DEVICE_ID	0x4433