Re: [U-Boot] [upstream-release] [PATCH v2 3/7] misc: fsl_portals: setup QMAN_BAR{E} also on ARM platforms

2018-07-03 Thread Laurentiu Tudor
Hi Bharat,

Thanks for the review! Comments inline.

On 03.07.2018 16:38, Bharat Bhushan wrote:
> 
> 
>> -Original Message-
>> From: upstream-release-boun...@linux.freescale.net [mailto:upstream-
>> release-boun...@linux.freescale.net] On Behalf Of Laurentiu Tudor
>> Sent: Tuesday, July 3, 2018 5:42 PM
>> To: York Sun ; Prabhakar Kushwaha
>> ; u-boot@lists.denx.de
>> Cc: Laurentiu Tudor 
>> Subject: [upstream-release] [PATCH v2 3/7] misc: fsl_portals: setup
>> QMAN_BAR{E} also on ARM platforms
>>
>> QMAN_BAR{E} register setup was disabled on ARM platforms,
>> however the register does need to be set. Add code that
>> sets it up on ARMs.
>>
>> Signed-off-by: Laurentiu Tudor 
>> ---
>>   drivers/misc/fsl_portals.c | 7 ++-
>>   1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/misc/fsl_portals.c b/drivers/misc/fsl_portals.c
>> index 7c22b8d209..5b1233740b 100644
>> --- a/drivers/misc/fsl_portals.c
>> +++ b/drivers/misc/fsl_portals.c
>> @@ -24,14 +24,19 @@ void setup_qbman_portals(void)
>>  CONFIG_SYS_BMAN_SWP_ISDR_REG;
>>  void __iomem *qpaddr = (void *)CONFIG_SYS_QMAN_CINH_BASE +
>>  CONFIG_SYS_QMAN_SWP_ISDR_REG;
>> -#ifdef CONFIG_PPC
>>  struct ccsr_qman *qman = (void *)CONFIG_SYS_FSL_QMAN_ADDR;
>>
>>  /* Set the Qman initiator BAR to match the LAW (for DQRR stashing)
>> */
>> +#ifdef CONFIG_PPC32
>>   #ifdef CONFIG_PHYS_64BIT
>>  out_be32(>qcsp_bare,
>> (u32)(CONFIG_SYS_QMAN_MEM_PHYS >> 32));
>>   #endif
>>  out_be32(>qcsp_bar,
>> (u32)CONFIG_SYS_QMAN_MEM_PHYS);
>> +#else
>> +#ifdef CONFIG_PHYS_64BIT
>> +out_be32(>qcsp_bare,
>> (u32)(CONFIG_SYS_QMAN_MEM_BASE >> 32));
>> +#endif
>> +out_be32(>qcsp_bar,
>> (u32)CONFIG_SYS_QMAN_MEM_BASE);
>>   #endif
> 
> Can we have same hash define name for PPC and non-PPC?
> We do not need then if-else

Hmm, good point. I could use CONFIG_SYS_QMAN_MEM_PHYS which is also 
defined on ls104x [1] but seems to be incorrectly set ... maybe 
copypaste error from powerpc? Another thing i noticed is that it's not 
actually used at all on ARMs.
I could rewrite the patch to fix the define and simplify the code above, 
if there aren't any objections.

[1]
  #define CONFIG_SYS_QMAN_MEM_PHYS (0xfull + 
CONFIG_SYS_QMAN_MEM_BASE)

---
Best Regards, Laurentiu

> 
>>   #ifdef CONFIG_FSL_CORENET
>>  int i;
>> --
>> 2.17.1
>>
>> ___
>> upstream-release mailing list
>> upstream-rele...@linux.freescale.net
>> https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flinu
>> x.freescale.net%2Fmailman%2Flistinfo%2Fupstream-
>> release=02%7C01%7Cbharat.bhushan%40nxp.com%7Ca0e936ecc69f40
>> 6be68208d5e0de4f7b%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7
>> C636662167788206253=WGcw1oH3ktggbybsoMllewQU5Uvbyv8OWa9
>> nBJipK70%3D=0
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [upstream-release] [PATCH v2 3/7] misc: fsl_portals: setup QMAN_BAR{E} also on ARM platforms

2018-07-03 Thread Bharat Bhushan


> -Original Message-
> From: upstream-release-boun...@linux.freescale.net [mailto:upstream-
> release-boun...@linux.freescale.net] On Behalf Of Laurentiu Tudor
> Sent: Tuesday, July 3, 2018 5:42 PM
> To: York Sun ; Prabhakar Kushwaha
> ; u-boot@lists.denx.de
> Cc: Laurentiu Tudor 
> Subject: [upstream-release] [PATCH v2 3/7] misc: fsl_portals: setup
> QMAN_BAR{E} also on ARM platforms
> 
> QMAN_BAR{E} register setup was disabled on ARM platforms,
> however the register does need to be set. Add code that
> sets it up on ARMs.
> 
> Signed-off-by: Laurentiu Tudor 
> ---
>  drivers/misc/fsl_portals.c | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/misc/fsl_portals.c b/drivers/misc/fsl_portals.c
> index 7c22b8d209..5b1233740b 100644
> --- a/drivers/misc/fsl_portals.c
> +++ b/drivers/misc/fsl_portals.c
> @@ -24,14 +24,19 @@ void setup_qbman_portals(void)
>   CONFIG_SYS_BMAN_SWP_ISDR_REG;
>   void __iomem *qpaddr = (void *)CONFIG_SYS_QMAN_CINH_BASE +
>   CONFIG_SYS_QMAN_SWP_ISDR_REG;
> -#ifdef CONFIG_PPC
>   struct ccsr_qman *qman = (void *)CONFIG_SYS_FSL_QMAN_ADDR;
> 
>   /* Set the Qman initiator BAR to match the LAW (for DQRR stashing)
> */
> +#ifdef CONFIG_PPC32
>  #ifdef CONFIG_PHYS_64BIT
>   out_be32(>qcsp_bare,
> (u32)(CONFIG_SYS_QMAN_MEM_PHYS >> 32));
>  #endif
>   out_be32(>qcsp_bar,
> (u32)CONFIG_SYS_QMAN_MEM_PHYS);
> +#else
> +#ifdef CONFIG_PHYS_64BIT
> + out_be32(>qcsp_bare,
> (u32)(CONFIG_SYS_QMAN_MEM_BASE >> 32));
> +#endif
> + out_be32(>qcsp_bar,
> (u32)CONFIG_SYS_QMAN_MEM_BASE);
>  #endif

Can we have same hash define name for PPC and non-PPC?
We do not need then if-else 

Thanks
-Bharat

>  #ifdef CONFIG_FSL_CORENET
>   int i;
> --
> 2.17.1
> 
> ___
> upstream-release mailing list
> upstream-rele...@linux.freescale.net
> https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flinu
> x.freescale.net%2Fmailman%2Flistinfo%2Fupstream-
> release=02%7C01%7Cbharat.bhushan%40nxp.com%7Ca0e936ecc69f40
> 6be68208d5e0de4f7b%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7
> C636662167788206253=WGcw1oH3ktggbybsoMllewQU5Uvbyv8OWa9
> nBJipK70%3D=0
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot