diff mbox

dt/arm: Add basic device tree support for smdkv310 board

Message ID 1301298888-3414-1-git-send-email-thomas.abraham@linaro.org
State New
Headers show

Commit Message

thomas.abraham@linaro.org March 28, 2011, 7:54 a.m. UTC
Enable basic device tree support for Exynos4 smdkv310 board.

Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
---
 arch/arm/boot/dts/exynos4-smdkv310.dts |   31 +++++++++++++++++++++++++++++++
 arch/arm/mach-exynos4/Kconfig          |    1 +
 arch/arm/mach-exynos4/mach-smdkv310.c  |    6 ++++++
 3 files changed, 38 insertions(+), 0 deletions(-)
 create mode 100755 arch/arm/boot/dts/exynos4-smdkv310.dts

Comments

Grant Likely March 28, 2011, 3:05 p.m. UTC | #1
On Mon, Mar 28, 2011 at 01:24:48PM +0530, Thomas Abraham wrote:
> Enable basic device tree support for Exynos4 smdkv310 board.
> 
> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>

Looks good.  A few minor comments below, but I've picked it up into my
arm-linaro-2.6.38 branch.  Thanks!

g.

> ---
>  arch/arm/boot/dts/exynos4-smdkv310.dts |   31 +++++++++++++++++++++++++++++++
>  arch/arm/mach-exynos4/Kconfig          |    1 +
>  arch/arm/mach-exynos4/mach-smdkv310.c  |    6 ++++++
>  3 files changed, 38 insertions(+), 0 deletions(-)
>  create mode 100755 arch/arm/boot/dts/exynos4-smdkv310.dts
> 
> diff --git a/arch/arm/boot/dts/exynos4-smdkv310.dts b/arch/arm/boot/dts/exynos4-smdkv310.dts
> new file mode 100755
> index 0000000..9f27664
> --- /dev/null
> +++ b/arch/arm/boot/dts/exynos4-smdkv310.dts
> @@ -0,0 +1,31 @@
> +/dts-v1/;
> +
> +/ {
> +	model = "Samsung Exynos4 SMDKV310 eval board";
> +	compatible = "samsung,smdkv310","samsung,s5pv310";

Can you please add documentation for these two compatible values to
Documentation/devicetree/bindings?  I good location is probably 
Documentation/devicetree/bindings/arm/samsung.txt.

> +	#address-cells = <1>;
> +	#size-cells = <1>;
> +
> +	cpus {
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		cpu@0{
> +			compatible = "arm,cortex-a9";
> +			reg = <0x0>;
> +		};
> +
> +		cpu@1 {
> +			compatible = "arm,cortex-a9";
> +			reg = <0x1>;
> +		};
> +	};
> +
> +	memory {
> +		device_type = "memory";
> +		reg = <0x40000000 0x08000000>;
> +	};
> +
> +	chosen {
> +	};
> +};
> diff --git a/arch/arm/mach-exynos4/Kconfig b/arch/arm/mach-exynos4/Kconfig
> index a021b52..78f5924 100644
> --- a/arch/arm/mach-exynos4/Kconfig
> +++ b/arch/arm/mach-exynos4/Kconfig
> @@ -123,6 +123,7 @@ config MACH_SMDKV310
>  	select EXYNOS4_SETUP_I2C1
>  	select EXYNOS4_SETUP_KEYPAD
>  	select EXYNOS4_SETUP_SDHCI
> +	select USE_OF

I would drop this bit (I dropped it from my branch when I applied the
patch).  Device tree support remains an optional feature.  Instead it
can be enabled by default in the defconfig (or however the config is
managed for the kernel package)

>  	help
>  	  Machine support for Samsung SMDKV310
>  
> diff --git a/arch/arm/mach-exynos4/mach-smdkv310.c b/arch/arm/mach-exynos4/mach-smdkv310.c
> index 88e0275..f6dc8df 100644
> --- a/arch/arm/mach-exynos4/mach-smdkv310.c
> +++ b/arch/arm/mach-exynos4/mach-smdkv310.c
> @@ -237,6 +237,11 @@ static void __init smdkv310_machine_init(void)
>  	platform_add_devices(smdkv310_devices, ARRAY_SIZE(smdkv310_devices));
>  }
>  
> +static char const *smdkv310_dt_compat[] = {
> +	"samsung,smdkv310",
> +	NULL
> +};
> +
>  MACHINE_START(SMDKV310, "SMDKV310")
>  	/* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
>  	/* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */
> @@ -245,4 +250,5 @@ MACHINE_START(SMDKV310, "SMDKV310")
>  	.map_io		= smdkv310_map_io,
>  	.init_machine	= smdkv310_machine_init,
>  	.timer		= &exynos4_timer,
> +	.dt_compat	= smdkv310_dt_compat,
>  MACHINE_END
> -- 
> 1.6.6.rc2
>
Shawn Guo March 29, 2011, 7 a.m. UTC | #2
One minor comment ...

On Mon, Mar 28, 2011 at 01:24:48PM +0530, Thomas Abraham wrote:
> Enable basic device tree support for Exynos4 smdkv310 board.
> 
> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
> ---
[...]
> diff --git a/arch/arm/mach-exynos4/mach-smdkv310.c b/arch/arm/mach-exynos4/mach-smdkv310.c
> index 88e0275..f6dc8df 100644
> --- a/arch/arm/mach-exynos4/mach-smdkv310.c
> +++ b/arch/arm/mach-exynos4/mach-smdkv310.c
> @@ -237,6 +237,11 @@ static void __init smdkv310_machine_init(void)
>  	platform_add_devices(smdkv310_devices, ARRAY_SIZE(smdkv310_devices));
>  }
>  
> +static char const *smdkv310_dt_compat[] = {

__initdata?  I'm seeing Grant's guide has this and expecting all the
platforms coming later will have this.

> +	"samsung,smdkv310",
> +	NULL
> +};
> +
>  MACHINE_START(SMDKV310, "SMDKV310")
>  	/* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
>  	/* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */
> @@ -245,4 +250,5 @@ MACHINE_START(SMDKV310, "SMDKV310")
>  	.map_io		= smdkv310_map_io,
>  	.init_machine	= smdkv310_machine_init,
>  	.timer		= &exynos4_timer,
> +	.dt_compat	= smdkv310_dt_compat,
>  MACHINE_END
> --
Shawn Guo March 29, 2011, 7:28 a.m. UTC | #3
On Mon, Mar 28, 2011 at 01:24:48PM +0530, Thomas Abraham wrote:
> Enable basic device tree support for Exynos4 smdkv310 board.
> 
> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
> ---
>  arch/arm/boot/dts/exynos4-smdkv310.dts |   31 +++++++++++++++++++++++++++++++
>  arch/arm/mach-exynos4/Kconfig          |    1 +
>  arch/arm/mach-exynos4/mach-smdkv310.c  |    6 ++++++
>  3 files changed, 38 insertions(+), 0 deletions(-)
>  create mode 100755 arch/arm/boot/dts/exynos4-smdkv310.dts
> 
The 'x' attribute on exynos4-smdkv310.dts is not necessary.
thomas.abraham@linaro.org March 29, 2011, 12:07 p.m. UTC | #4
Hi Grant, Shawn,

On 29 March 2011 12:58, Shawn Guo <shawn.guo@freescale.com> wrote:
> On Mon, Mar 28, 2011 at 01:24:48PM +0530, Thomas Abraham wrote:
>> Enable basic device tree support for Exynos4 smdkv310 board.
>>
>> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
>> ---
>>  arch/arm/boot/dts/exynos4-smdkv310.dts |   31 +++++++++++++++++++++++++++++++
>>  arch/arm/mach-exynos4/Kconfig          |    1 +
>>  arch/arm/mach-exynos4/mach-smdkv310.c  |    6 ++++++
>>  3 files changed, 38 insertions(+), 0 deletions(-)
>>  create mode 100755 arch/arm/boot/dts/exynos4-smdkv310.dts
>>
> The 'x' attribute on exynos4-smdkv310.dts is not necessary.


Thanks for your comments. I have updated the patch and resubmitted.

Regards,
Thomas.

>
> --
> Regards,
> Shawn
>
>
diff mbox

Patch

diff --git a/arch/arm/boot/dts/exynos4-smdkv310.dts b/arch/arm/boot/dts/exynos4-smdkv310.dts
new file mode 100755
index 0000000..9f27664
--- /dev/null
+++ b/arch/arm/boot/dts/exynos4-smdkv310.dts
@@ -0,0 +1,31 @@ 
+/dts-v1/;
+
+/ {
+	model = "Samsung Exynos4 SMDKV310 eval board";
+	compatible = "samsung,smdkv310","samsung,s5pv310";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu@0{
+			compatible = "arm,cortex-a9";
+			reg = <0x0>;
+		};
+
+		cpu@1 {
+			compatible = "arm,cortex-a9";
+			reg = <0x1>;
+		};
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0x40000000 0x08000000>;
+	};
+
+	chosen {
+	};
+};
diff --git a/arch/arm/mach-exynos4/Kconfig b/arch/arm/mach-exynos4/Kconfig
index a021b52..78f5924 100644
--- a/arch/arm/mach-exynos4/Kconfig
+++ b/arch/arm/mach-exynos4/Kconfig
@@ -123,6 +123,7 @@  config MACH_SMDKV310
 	select EXYNOS4_SETUP_I2C1
 	select EXYNOS4_SETUP_KEYPAD
 	select EXYNOS4_SETUP_SDHCI
+	select USE_OF
 	help
 	  Machine support for Samsung SMDKV310
 
diff --git a/arch/arm/mach-exynos4/mach-smdkv310.c b/arch/arm/mach-exynos4/mach-smdkv310.c
index 88e0275..f6dc8df 100644
--- a/arch/arm/mach-exynos4/mach-smdkv310.c
+++ b/arch/arm/mach-exynos4/mach-smdkv310.c
@@ -237,6 +237,11 @@  static void __init smdkv310_machine_init(void)
 	platform_add_devices(smdkv310_devices, ARRAY_SIZE(smdkv310_devices));
 }
 
+static char const *smdkv310_dt_compat[] = {
+	"samsung,smdkv310",
+	NULL
+};
+
 MACHINE_START(SMDKV310, "SMDKV310")
 	/* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
 	/* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */
@@ -245,4 +250,5 @@  MACHINE_START(SMDKV310, "SMDKV310")
 	.map_io		= smdkv310_map_io,
 	.init_machine	= smdkv310_machine_init,
 	.timer		= &exynos4_timer,
+	.dt_compat	= smdkv310_dt_compat,
 MACHINE_END