Re: [PATCH RFCv1 2/6] ARM: mvebu: add a coherency_available() call

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




All,

Including the MLs.

On Thu, Dec 26, 2013 at 03:12:22PM +0100, Thomas Petazzoni wrote:
> This commit extends the coherency fabric code to provide a
> coherency_available()function that the SoC code can call to be told
> whether coherency support is available or not. On Armada 370/XP,
> coherency support is available as soon as the relevant DT node is
> present. On some upcoming SoCs, the DT node needs to be present *and*
> the system running with CONFIG_SMP enabled.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@xxxxxxxxxxxxxxxxxx>
> ---
>  arch/arm/mach-mvebu/coherency.c | 30 +++++++++++++++++++++++-------
>  arch/arm/mach-mvebu/coherency.h |  1 +
>  2 files changed, 24 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherency.c
> index a8209ae..70db4e9 100644
> --- a/arch/arm/mach-mvebu/coherency.c
> +++ b/arch/arm/mach-mvebu/coherency.c
> @@ -38,6 +38,7 @@ static void __iomem *coherency_cpu_base;
>  #define IO_SYNC_BARRIER_CTL_OFFSET		   0x0
>  
>  enum {
> +	COHERENCY_FABRIC_TYPE_NONE,
>  	COHERENCY_FABRIC_TYPE_ARMADA_370_XP,
>  };
>  
> @@ -149,7 +150,7 @@ static void __init armada_370_coherency_init(struct device_node *np)
>  	set_cpu_coherent(cpu_logical_map(smp_processor_id()), 0);
>  }
>  
> -int __init coherency_init(void)
> +static int coherency_type(void)
>  {
>  	struct device_node *np;
>  
> @@ -160,27 +161,42 @@ int __init coherency_init(void)
>  		int type;
>  
>  		type = (int) match->data;
> +
>  		pr_info("Initializing Coherency fabric\n");

This seems to no longer be true at this point.  Perhaps once moved to
the correct location, it could report the type of coherency fabric?

thx,

Jason.

>  
> +		/* Armada 370/XP coherency works in both UP and SMP */
>  		if (type == COHERENCY_FABRIC_TYPE_ARMADA_370_XP)
> -			armada_370_coherency_init(np);
> +			return type;
>  
>  		of_node_put(np);
>  	}
>  
> -	return 0;
> +	return COHERENCY_FABRIC_TYPE_NONE;
>  }
>  
> -static int __init coherency_late_init(void)
> +int coherency_available(void)
>  {
> +	return coherency_type() != COHERENCY_FABRIC_TYPE_NONE;
> +}
> +
> +int __init coherency_init(void)
> +{
> +	int type = coherency_type();
>  	struct device_node *np;
>  
>  	np = of_find_matching_node(NULL, of_coherency_table);
> -	if (np) {
> +
> +	if (type == COHERENCY_FABRIC_TYPE_ARMADA_370_XP)
> +		armada_370_coherency_init(np);
> +
> +	return 0;
> +}
> +
> +static int __init coherency_late_init(void)
> +{
> +	if (coherency_available())
>  		bus_register_notifier(&platform_bus_type,
>  				      &mvebu_hwcc_platform_nb);
> -		of_node_put(np);
> -	}
>  	return 0;
>  }
>  
> diff --git a/arch/arm/mach-mvebu/coherency.h b/arch/arm/mach-mvebu/coherency.h
> index df33ad8..2a05b6e 100644
> --- a/arch/arm/mach-mvebu/coherency.h
> +++ b/arch/arm/mach-mvebu/coherency.h
> @@ -16,5 +16,6 @@
>  
>  int set_cpu_coherent(int cpu_id, int smp_group_id);
>  int coherency_init(void);
> +int coherency_available(void);
>  
>  #endif	/* __MACH_370_XP_COHERENCY_H */
> -- 
> 1.8.3.2
> 
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux