> Date: Fri, 8 Apr 2016 13:44:11 +0200
> From: Patrick Wildt <[email protected]>
> 
> Hi,
> 
> with the feedback received on the fdt bus, the fdt stuff will now be
> replacing the mainbus.  While doing that I noticed that the cortex
> bus matches every time on config_found, which is because it doesn't
> check the attach args.
> 
> ok?

ok kettenis@

> diff --git sys/arch/arm/cortex/cortex.c sys/arch/arm/cortex/cortex.c
> index 73aa315..db878b7 100644
> --- sys/arch/arm/cortex/cortex.c
> +++ sys/arch/arm/cortex/cortex.c
> @@ -51,6 +51,7 @@
>  #include <arm/cpufunc.h>
>  #include <arm/armv7/armv7var.h>
>  #include <arm/cortex/cortex.h>
> +#include <arm/mainbus/mainbus.h>
>  
>  struct arm32_bus_dma_tag cortex_bus_dma_tag = {
>       0,
> @@ -94,10 +95,15 @@ struct cfdriver cortex_cd = {
>   */
>  
>  int
> -cortexmatch(struct device *parent, void *cf, void *aux)
> +cortexmatch(struct device *parent, void *cfdata, void *aux)
>  {
> +     struct mainbus_attach_args *ma = aux;
> +     struct cfdata *cf = (struct cfdata *)cfdata;
>       int cputype = cpufunc_id();
>  
> +     if (strcmp(cf->cf_driver->cd_name, ma->ma_name) != 0)
> +             return (0);
> +
>       if ((cputype & CPU_ID_CORTEX_A7_MASK) == CPU_ID_CORTEX_A7 ||
>           (cputype & CPU_ID_CORTEX_A9_MASK) == CPU_ID_CORTEX_A9 ||
>           (cputype & CPU_ID_CORTEX_A15_MASK) == CPU_ID_CORTEX_A15 ||
> 
> 

Reply via email to