diff mbox series

[V2,5/8] brcmfmac: allow GCI core enumuration

Message ID 1542007730-47284-6-git-send-email-chi-hsien.lin@cypress.com (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show
Series brcmfmac: chip related changes | expand

Commit Message

Chi-Hsien Lin Nov. 12, 2018, 7:29 a.m. UTC
GCI core is needed for ULP operation. Allow GCI core enumuration with
below changes:
 - Allow GCI to be added to core list even when it doesn't have a wrapper.
 - Allow 8K address space size.
 - Don't overwrite the address value when an additional size descriptor
   is in place.

Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

Comments

Arend van Spriel Nov. 12, 2018, 10:16 a.m. UTC | #1
On 11/12/2018 8:29 AM, Chi-Hsien Lin wrote:
> GCI core is needed for ULP operation. Allow GCI core enumuration with
> below changes:
>  - Allow GCI to be added to core list even when it doesn't have a wrapper.
>  - Allow 8K address space size.
>  - Don't overwrite the address value when an additional size descriptor
>    is in place.

One question. This only assures the GCI core is listed. So does the 
driver need to access it for ULP operation?

Regards,
Arend

> Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
> Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
> ---
>  drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
> index a3c857721446..a8d3b96b727f 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
> @@ -786,7 +786,7 @@ static int brcmf_chip_dmp_get_regaddr(struct brcmf_chip_priv *ci, u32 *eromaddr,
>  				      u32 *regbase, u32 *wrapbase)
>  {
>  	u8 desc;
> -	u32 val;
> +	u32 val, szdesc;
>  	u8 mpnum = 0;
>  	u8 stype, sztype, wraptype;
>
> @@ -832,14 +832,15 @@ static int brcmf_chip_dmp_get_regaddr(struct brcmf_chip_priv *ci, u32 *eromaddr,
>
>  		/* next size descriptor can be skipped */
>  		if (sztype == DMP_SLAVE_SIZE_DESC) {
> -			val = brcmf_chip_dmp_get_desc(ci, eromaddr, NULL);
> +			szdesc = brcmf_chip_dmp_get_desc(ci, eromaddr, NULL);
>  			/* skip upper size descriptor if present */
> -			if (val & DMP_DESC_ADDRSIZE_GT32)
> +			if (szdesc & DMP_DESC_ADDRSIZE_GT32)
>  				brcmf_chip_dmp_get_desc(ci, eromaddr, NULL);
>  		}
>
> -		/* only look for 4K register regions */
> -		if (sztype != DMP_SLAVE_SIZE_4K)
> +		/* look for 4K or 8K register regions */
> +		if (sztype != DMP_SLAVE_SIZE_4K &&
> +		    sztype != DMP_SLAVE_SIZE_8K)
>  			continue;
>
>  		stype = (val & DMP_SLAVE_TYPE) >> DMP_SLAVE_TYPE_S;
> @@ -896,7 +897,8 @@ int brcmf_chip_dmp_erom_scan(struct brcmf_chip_priv *ci)
>
>  		/* need core with ports */
>  		if (nmw + nsw == 0 &&
> -		    id != BCMA_CORE_PMU)
> +		    id != BCMA_CORE_PMU &&
> +		    id != BCMA_CORE_GCI)
>  			continue;
>
>  		/* try to obtain register address info */
>
Chi-Hsien Lin Nov. 12, 2018, 10:24 a.m. UTC | #2
On 11/12/2018 6:16, Arend van Spriel wrote:
> On 11/12/2018 8:29 AM, Chi-Hsien Lin wrote:
>> GCI core is needed for ULP operation. Allow GCI core enumuration with
>> below changes:
>>  - Allow GCI to be added to core list even when it doesn't have a 
>> wrapper.
>>  - Allow 8K address space size.
>>  - Don't overwrite the address value when an additional size descriptor
>>    is in place.
> 
> One question. This only assures the GCI core is listed. So does the
> driver need to access it for ULP operation?

Yes, the GCI core registers are accessed when entering/exiting ULP sleep 
modes. There will be other patches for the ULP support.

Regards,
Chi-hsien Lin

> 
> Regards,
> Arend
> 
>> Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
>> Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
>> ---
>>  drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 14 
>> ++++++++------
>>  1 file changed, 8 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c 
>> b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
>> index a3c857721446..a8d3b96b727f 100644
>> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
>> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
>> @@ -786,7 +786,7 @@ static int brcmf_chip_dmp_get_regaddr(struct 
>> brcmf_chip_priv *ci, u32 *eromaddr,
>>                                     u32 *regbase, u32 *wrapbase)
>>  {
>>       u8 desc;
>> -     u32 val;
>> +     u32 val, szdesc;
>>       u8 mpnum = 0;
>>       u8 stype, sztype, wraptype;
>>
>> @@ -832,14 +832,15 @@ static int brcmf_chip_dmp_get_regaddr(struct 
>> brcmf_chip_priv *ci, u32 *eromaddr,
>>
>>               /* next size descriptor can be skipped */
>>               if (sztype == DMP_SLAVE_SIZE_DESC) {
>> -                     val = brcmf_chip_dmp_get_desc(ci, eromaddr, NULL);
>> +                     szdesc = brcmf_chip_dmp_get_desc(ci, eromaddr, 
>> NULL);
>>                       /* skip upper size descriptor if present */
>> -                     if (val & DMP_DESC_ADDRSIZE_GT32)
>> +                     if (szdesc & DMP_DESC_ADDRSIZE_GT32)
>>                               brcmf_chip_dmp_get_desc(ci, eromaddr, 
>> NULL);
>>               }
>>
>> -             /* only look for 4K register regions */
>> -             if (sztype != DMP_SLAVE_SIZE_4K)
>> +             /* look for 4K or 8K register regions */
>> +             if (sztype != DMP_SLAVE_SIZE_4K &&
>> +                 sztype != DMP_SLAVE_SIZE_8K)
>>                       continue;
>>
>>               stype = (val & DMP_SLAVE_TYPE) >> DMP_SLAVE_TYPE_S;
>> @@ -896,7 +897,8 @@ int brcmf_chip_dmp_erom_scan(struct 
>> brcmf_chip_priv *ci)
>>
>>               /* need core with ports */
>>               if (nmw + nsw == 0 &&
>> -                 id != BCMA_CORE_PMU)
>> +                 id != BCMA_CORE_PMU &&
>> +                 id != BCMA_CORE_GCI)
>>                       continue;
>>
>>               /* try to obtain register address info */
>>
> 
> 
> 
> ----------
> 
> You're receiving this message because you're a member of the 
> brcm80211-dev-list group.
> .
>
Arend van Spriel Nov. 12, 2018, 10:27 a.m. UTC | #3
On 11/12/2018 11:24 AM, Chi-Hsien Lin wrote:
>
>
> On 11/12/2018 6:16, Arend van Spriel wrote:
>> On 11/12/2018 8:29 AM, Chi-Hsien Lin wrote:
>>> GCI core is needed for ULP operation. Allow GCI core enumuration with
>>> below changes:
>>>  - Allow GCI to be added to core list even when it doesn't have a
>>> wrapper.
>>>  - Allow 8K address space size.
>>>  - Don't overwrite the address value when an additional size descriptor
>>>    is in place.
>>
>> One question. This only assures the GCI core is listed. So does the
>> driver need to access it for ULP operation?
>
> Yes, the GCI core registers are accessed when entering/exiting ULP sleep
> modes. There will be other patches for the ULP support.

Yeah. I suspected such. It would have been better to send this patch 
with that ULP series, but let's not make it an issue now. The patch is fine.

Regards,
Arend
Chi-Hsien Lin Nov. 12, 2018, 10:29 a.m. UTC | #4
On 11/12/2018 6:27, Arend van Spriel wrote:
> On 11/12/2018 11:24 AM, Chi-Hsien Lin wrote:
>>
>>
>> On 11/12/2018 6:16, Arend van Spriel wrote:
>>> On 11/12/2018 8:29 AM, Chi-Hsien Lin wrote:
>>>> GCI core is needed for ULP operation. Allow GCI core enumuration with
>>>> below changes:
>>>>  - Allow GCI to be added to core list even when it doesn't have a
>>>> wrapper.
>>>>  - Allow 8K address space size.
>>>>  - Don't overwrite the address value when an additional size descriptor
>>>>    is in place.
>>>
>>> One question. This only assures the GCI core is listed. So does the
>>> driver need to access it for ULP operation?
>>
>> Yes, the GCI core registers are accessed when entering/exiting ULP sleep
>> modes. There will be other patches for the ULP support.
> 
> Yeah. I suspected such. It would have been better to send this patch 
> with that ULP series, but let's not make it an issue now. The patch is 
> fine.

Thanks a lot.  :)

> 
> Regards,
> Arend
> 
> .
>
diff mbox series

Patch

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
index a3c857721446..a8d3b96b727f 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
@@ -786,7 +786,7 @@  static int brcmf_chip_dmp_get_regaddr(struct brcmf_chip_priv *ci, u32 *eromaddr,
 				      u32 *regbase, u32 *wrapbase)
 {
 	u8 desc;
-	u32 val;
+	u32 val, szdesc;
 	u8 mpnum = 0;
 	u8 stype, sztype, wraptype;
 
@@ -832,14 +832,15 @@  static int brcmf_chip_dmp_get_regaddr(struct brcmf_chip_priv *ci, u32 *eromaddr,
 
 		/* next size descriptor can be skipped */
 		if (sztype == DMP_SLAVE_SIZE_DESC) {
-			val = brcmf_chip_dmp_get_desc(ci, eromaddr, NULL);
+			szdesc = brcmf_chip_dmp_get_desc(ci, eromaddr, NULL);
 			/* skip upper size descriptor if present */
-			if (val & DMP_DESC_ADDRSIZE_GT32)
+			if (szdesc & DMP_DESC_ADDRSIZE_GT32)
 				brcmf_chip_dmp_get_desc(ci, eromaddr, NULL);
 		}
 
-		/* only look for 4K register regions */
-		if (sztype != DMP_SLAVE_SIZE_4K)
+		/* look for 4K or 8K register regions */
+		if (sztype != DMP_SLAVE_SIZE_4K &&
+		    sztype != DMP_SLAVE_SIZE_8K)
 			continue;
 
 		stype = (val & DMP_SLAVE_TYPE) >> DMP_SLAVE_TYPE_S;
@@ -896,7 +897,8 @@  int brcmf_chip_dmp_erom_scan(struct brcmf_chip_priv *ci)
 
 		/* need core with ports */
 		if (nmw + nsw == 0 &&
-		    id != BCMA_CORE_PMU)
+		    id != BCMA_CORE_PMU &&
+		    id != BCMA_CORE_GCI)
 			continue;
 
 		/* try to obtain register address info */