[RFC PATCHv2 2/2] ARM: socfpga: Add board support for Altera's SOCFPGA Cyclone 5 HW

Arnd Bergmann arnd at arndb.de
Tue Jul 17 11:56:27 EDT 2012


On Thursday 12 July 2012, dinguyen at altera.com wrote:

> diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig
> new file mode 100644
> index 0000000..133fc89
> --- /dev/null
> +++ b/arch/arm/mach-socfpga/Kconfig
> @@ -0,0 +1,7 @@
> +config MACH_SOCFPGA_CYCLONE5
> +       bool "SOCFPGA Cyclone5 platform"
> +       select COMMON_CLK
> +       select HAVE_SMP
> +       select PLAT_SOCFPGA_ETH
> +       help
> +         Include support for the Altera(R) Cyclone5 development platform.

Ah, so you actually select COMMON_CLK already. I wonder why that works,
since you are also defining your own "struct clk" that gets passed into
the clk_lookup table. I guess there is a bug somewhere.

> diff --git a/arch/arm/mach-socfpga/common.h b/arch/arm/mach-socfpga/common.h
> index e66587f..ba90e7a 100644
> --- a/arch/arm/mach-socfpga/common.h
> +++ b/arch/arm/mach-socfpga/common.h
> @@ -18,6 +18,6 @@
>  #ifndef __MACH_SOCFPGA_COMMON_H
>  #define __MACH_SOCFPGA_COMMON_H
>  
> -extern struct sys_timer socfpga_timer;
> +extern struct sys_timer dw_apb_timer;
>  
>  #endif

This should get folded into the first patch.

> +static const char *altera_dt_match[] = {
> +	"altr,socfpga-cyclone5",
> +	NULL
> +};
> +
> +DT_MACHINE_START(SOCFPGA_CYCLONE5, "Altera SOCFPGA Cyclone V")
> +	.init_irq	= gic_init_irq,
> +	.handle_irq     = gic_handle_irq,
> +	.timer		= &dw_apb_timer,
> +	.init_machine	= socfpga_cyclone5_init,
> +	.restart	= socfpga_cyclone5_restart,
> +	.dt_compat	= altera_dt_match,
> +MACHINE_END

I think you should not require more than one such file per platform,
so I would either name the entire platform cyclone5 instead of socfpga,
or if you expect this to all stay compatible with future products,
remove the cyclone5 name here and just call it all socfpga. The dt_match
array can still list multiple compatible strings, one for each family
or so.

	Arnd



More information about the linux-arm-kernel mailing list