* Add device tree enabled Exynos4 machine @ 2011-08-01 16:20 Thomas Abraham 2011-08-01 16:20 ` [PATCH 1/2] arm: exynos4: Add a new Exynos4 device tree enabled machine Thomas Abraham 2011-08-01 16:20 ` [PATCH 2/2] arm: dt: Add device tree source file for Exynos4 and let boards include it Thomas Abraham 0 siblings, 2 replies; 4+ messages in thread From: Thomas Abraham @ 2011-08-01 16:20 UTC (permalink / raw) To: linux-arm-kernel This patchset adds a basic device tree enabled machine for Samsung's Exynos4 processor. This enables further development of device tree coverge for Exynos4. A basic device tree source file for Exynos4 processor and the smdkv310 board is also included. The device tree enabled machine has been boot tested till serial console. The watchdog driver is probed with information from dtb. Notes: A. The interrupt controller device tree bindings are not documented yet. That is because, it will be replaced with a new irq_domain support soon. Thomas Abraham (2): arm: exynos4: Add a new Exynos4 device tree enabled machine arm: dt: Add device tree source file for Exynos4 and let boards include it Documentation/devicetree/bindings/arm/samsung.txt | 8 ++ arch/arm/boot/dts/exynos4-smdkv310.dts | 31 ++++++ arch/arm/boot/dts/exynos4.dtsi | 44 ++++++++ arch/arm/mach-exynos4/Kconfig | 10 ++ arch/arm/mach-exynos4/Makefile | 1 + arch/arm/mach-exynos4/mach-exynos4-dt.c | 118 +++++++++++++++++++++ 6 files changed, 212 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/samsung.txt create mode 100644 arch/arm/boot/dts/exynos4-smdkv310.dts create mode 100644 arch/arm/boot/dts/exynos4.dtsi create mode 100644 arch/arm/mach-exynos4/mach-exynos4-dt.c ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] arm: exynos4: Add a new Exynos4 device tree enabled machine 2011-08-01 16:20 Add device tree enabled Exynos4 machine Thomas Abraham @ 2011-08-01 16:20 ` Thomas Abraham 2011-08-01 16:54 ` Grant Likely 2011-08-01 16:20 ` [PATCH 2/2] arm: dt: Add device tree source file for Exynos4 and let boards include it Thomas Abraham 1 sibling, 1 reply; 4+ messages in thread From: Thomas Abraham @ 2011-08-01 16:20 UTC (permalink / raw) To: linux-arm-kernel Add a new basic Exynos4 machine with device tree support that can boot on a Exynos4 processor based board and bring up the console. This acts as a stating point to add device tree support for Exynos4 architecture. Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org> --- arch/arm/mach-exynos4/Kconfig | 10 +++ arch/arm/mach-exynos4/Makefile | 1 + arch/arm/mach-exynos4/mach-exynos4-dt.c | 118 +++++++++++++++++++++++++++++++ 3 files changed, 129 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-exynos4/mach-exynos4-dt.c diff --git a/arch/arm/mach-exynos4/Kconfig b/arch/arm/mach-exynos4/Kconfig index 0c77ab9..c29de4e 100644 --- a/arch/arm/mach-exynos4/Kconfig +++ b/arch/arm/mach-exynos4/Kconfig @@ -218,6 +218,16 @@ config MACH_NURI help Machine support for Samsung Mobile NURI Board. +config MACH_EXYNOS4_DT + bool "Samsung Exynos4 Machine using device tree" + select CPU_EXYNOS4210 + select USE_OF + select S3C_DEV_HSMMC + select S3C_DEV_HSMMC2 + select EXYNOS4_SETUP_SDHCI + help + Machine support for Samsung Exynos4 machine with device tree enabled. + endmenu comment "Configuration for HSMMC bus width" diff --git a/arch/arm/mach-exynos4/Makefile b/arch/arm/mach-exynos4/Makefile index b7fe1d7..d2bf5bf 100644 --- a/arch/arm/mach-exynos4/Makefile +++ b/arch/arm/mach-exynos4/Makefile @@ -30,6 +30,7 @@ obj-$(CONFIG_MACH_SMDKV310) += mach-smdkv310.o obj-$(CONFIG_MACH_ARMLEX4210) += mach-armlex4210.o obj-$(CONFIG_MACH_UNIVERSAL_C210) += mach-universal_c210.o obj-$(CONFIG_MACH_NURI) += mach-nuri.o +obj-$(CONFIG_MACH_EXYNOS4_DT) += mach-exynos4-dt.o # device support diff --git a/arch/arm/mach-exynos4/mach-exynos4-dt.c b/arch/arm/mach-exynos4/mach-exynos4-dt.c new file mode 100644 index 0000000..8e9d2d7 --- /dev/null +++ b/arch/arm/mach-exynos4/mach-exynos4-dt.c @@ -0,0 +1,118 @@ +/* + * Samsung's Exynos4 device tree enabled machine. + * + * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * Copyright (c) 2010-2011 Linaro Ltd. + * www.linaro.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. +*/ + +#include <linux/serial_core.h> +#include <linux/platform_device.h> +#include <linux/io.h> +#include <linux/of_platform.h> +#include <linux/irq.h> +#include <linux/irqdomain.h> + +#include <asm/mach/arch.h> +#include <asm/mach-types.h> + +#include <plat/regs-serial.h> +#include <plat/exynos4.h> +#include <plat/cpu.h> +#include <plat/sdhci.h> + +#include <mach/map.h> + +/* Following are default values for UCON, ULCON and UFCON UART registers */ +#define SMDKV310_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ + S3C2410_UCON_RXILEVEL | \ + S3C2410_UCON_TXIRQMODE | \ + S3C2410_UCON_RXIRQMODE | \ + S3C2410_UCON_RXFIFO_TOI | \ + S3C2443_UCON_RXERR_IRQEN) + +#define SMDKV310_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \ + S5PV210_UFCON_TXTRIG4 | \ + S5PV210_UFCON_RXTRIG4) + +static struct s3c2410_uartcfg smdkv310_uartcfgs[] __initdata = { + [0] = { + .hwport = 0, + .ucon = SMDKV310_UCON_DEFAULT, + .ufcon = SMDKV310_UFCON_DEFAULT, + }, + [1] = { + .hwport = 1, + .ucon = SMDKV310_UCON_DEFAULT, + .ufcon = SMDKV310_UFCON_DEFAULT, + }, + [2] = { + .hwport = 2, + .ucon = SMDKV310_UCON_DEFAULT, + .ufcon = SMDKV310_UFCON_DEFAULT, + }, + [3] = { + .hwport = 3, + .ucon = SMDKV310_UCON_DEFAULT, + .ufcon = SMDKV310_UFCON_DEFAULT, + }, +}; + +/* + * The following lookup table is used to override device names when devices + * are registered from device tree. This is temporarily added to enable + * device tree support addition for the Exynos4 architecture. + * + * For drivers that require platform data to be provided from the machine + * file, a platform data pointer can also be supplied along with the + * devices names. Usually, the platform data elements that cannot be parsed + * from the device tree by the drivers (example: function pointers) are + * supplied. But it should be noted that this is a temporary mechanism and + * at some point, the drivers should be capable of parsing all the platform + * data from the device tree. + */ +static const struct of_dev_auxdata exynos4_auxdata_lookup[] __initconst = { + OF_DEV_AUXDATA("samsung,s3c6410-sdhci", EXYNOS4_PA_HSMMC(2), + "s3c-sdhci.2", &s3c_hsmmc2_def_platdata), + OF_DEV_AUXDATA("samsung,s3c6410-sdhci", EXYNOS4_PA_HSMMC(0), + "s3c-sdhci.0", &s3c_hsmmc0_def_platdata), + {}, +}; + +static void __init exynos4_dt_map_io(void) +{ + s5p_init_io(NULL, 0, S5P_VA_CHIPID); + s3c24xx_init_clocks(24000000); + s3c24xx_init_uarts(smdkv310_uartcfgs, ARRAY_SIZE(smdkv310_uartcfgs)); +} + +static const struct of_device_id intc_of_match[] __initconst = { + { .compatible = "samsung,exynos4-gic", }, + {}, +}; + +static void __init exynos4_dt_machine_init(void) +{ + irq_domain_generate_simple(intc_of_match, EXYNOS4_PA_GIC_DIST, 0); + of_platform_populate(NULL, of_default_bus_match_table, + exynos4_auxdata_lookup, NULL); +} + +static char const *exynos4_dt_compat[] __initdata = { + "samsung,exynos4", + NULL +}; + +DT_MACHINE_START(SMDKV310, "Samsung Exynos4 DT") + /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ + .init_irq = exynos4_init_irq, + .map_io = exynos4_dt_map_io, + .init_machine = exynos4_dt_machine_init, + .timer = &exynos4_timer, + .dt_compat = exynos4_dt_compat, +MACHINE_END -- 1.7.4.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 1/2] arm: exynos4: Add a new Exynos4 device tree enabled machine 2011-08-01 16:20 ` [PATCH 1/2] arm: exynos4: Add a new Exynos4 device tree enabled machine Thomas Abraham @ 2011-08-01 16:54 ` Grant Likely 0 siblings, 0 replies; 4+ messages in thread From: Grant Likely @ 2011-08-01 16:54 UTC (permalink / raw) To: linux-arm-kernel On Mon, Aug 01, 2011 at 05:20:36PM +0100, Thomas Abraham wrote: > Add a new basic Exynos4 machine with device tree support that can boot > on a Exynos4 processor based board and bring up the console. This acts > as a stating point to add device tree support for Exynos4 architecture. > > Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org> Hi Thomas, As discussed f2f at Linaro Connect, we'll defer this board support patch to v3.2, and use this week to eliminate the 'special' uart handling code. g. > --- > arch/arm/mach-exynos4/Kconfig | 10 +++ > arch/arm/mach-exynos4/Makefile | 1 + > arch/arm/mach-exynos4/mach-exynos4-dt.c | 118 +++++++++++++++++++++++++++++++ > 3 files changed, 129 insertions(+), 0 deletions(-) > create mode 100644 arch/arm/mach-exynos4/mach-exynos4-dt.c > > diff --git a/arch/arm/mach-exynos4/Kconfig b/arch/arm/mach-exynos4/Kconfig > index 0c77ab9..c29de4e 100644 > --- a/arch/arm/mach-exynos4/Kconfig > +++ b/arch/arm/mach-exynos4/Kconfig > @@ -218,6 +218,16 @@ config MACH_NURI > help > Machine support for Samsung Mobile NURI Board. > > +config MACH_EXYNOS4_DT > + bool "Samsung Exynos4 Machine using device tree" > + select CPU_EXYNOS4210 > + select USE_OF > + select S3C_DEV_HSMMC > + select S3C_DEV_HSMMC2 > + select EXYNOS4_SETUP_SDHCI > + help > + Machine support for Samsung Exynos4 machine with device tree enabled. > + > endmenu > > comment "Configuration for HSMMC bus width" > diff --git a/arch/arm/mach-exynos4/Makefile b/arch/arm/mach-exynos4/Makefile > index b7fe1d7..d2bf5bf 100644 > --- a/arch/arm/mach-exynos4/Makefile > +++ b/arch/arm/mach-exynos4/Makefile > @@ -30,6 +30,7 @@ obj-$(CONFIG_MACH_SMDKV310) += mach-smdkv310.o > obj-$(CONFIG_MACH_ARMLEX4210) += mach-armlex4210.o > obj-$(CONFIG_MACH_UNIVERSAL_C210) += mach-universal_c210.o > obj-$(CONFIG_MACH_NURI) += mach-nuri.o > +obj-$(CONFIG_MACH_EXYNOS4_DT) += mach-exynos4-dt.o > > # device support > > diff --git a/arch/arm/mach-exynos4/mach-exynos4-dt.c b/arch/arm/mach-exynos4/mach-exynos4-dt.c > new file mode 100644 > index 0000000..8e9d2d7 > --- /dev/null > +++ b/arch/arm/mach-exynos4/mach-exynos4-dt.c > @@ -0,0 +1,118 @@ > +/* > + * Samsung's Exynos4 device tree enabled machine. > + * > + * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. > + * http://www.samsung.com > + * Copyright (c) 2010-2011 Linaro Ltd. > + * www.linaro.org > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as > + * published by the Free Software Foundation. > +*/ > + > +#include <linux/serial_core.h> > +#include <linux/platform_device.h> > +#include <linux/io.h> > +#include <linux/of_platform.h> > +#include <linux/irq.h> > +#include <linux/irqdomain.h> > + > +#include <asm/mach/arch.h> > +#include <asm/mach-types.h> > + > +#include <plat/regs-serial.h> > +#include <plat/exynos4.h> > +#include <plat/cpu.h> > +#include <plat/sdhci.h> > + > +#include <mach/map.h> > + > +/* Following are default values for UCON, ULCON and UFCON UART registers */ > +#define SMDKV310_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ > + S3C2410_UCON_RXILEVEL | \ > + S3C2410_UCON_TXIRQMODE | \ > + S3C2410_UCON_RXIRQMODE | \ > + S3C2410_UCON_RXFIFO_TOI | \ > + S3C2443_UCON_RXERR_IRQEN) > + > +#define SMDKV310_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \ > + S5PV210_UFCON_TXTRIG4 | \ > + S5PV210_UFCON_RXTRIG4) > + > +static struct s3c2410_uartcfg smdkv310_uartcfgs[] __initdata = { > + [0] = { > + .hwport = 0, > + .ucon = SMDKV310_UCON_DEFAULT, > + .ufcon = SMDKV310_UFCON_DEFAULT, > + }, > + [1] = { > + .hwport = 1, > + .ucon = SMDKV310_UCON_DEFAULT, > + .ufcon = SMDKV310_UFCON_DEFAULT, > + }, > + [2] = { > + .hwport = 2, > + .ucon = SMDKV310_UCON_DEFAULT, > + .ufcon = SMDKV310_UFCON_DEFAULT, > + }, > + [3] = { > + .hwport = 3, > + .ucon = SMDKV310_UCON_DEFAULT, > + .ufcon = SMDKV310_UFCON_DEFAULT, > + }, > +}; > + > +/* > + * The following lookup table is used to override device names when devices > + * are registered from device tree. This is temporarily added to enable > + * device tree support addition for the Exynos4 architecture. > + * > + * For drivers that require platform data to be provided from the machine > + * file, a platform data pointer can also be supplied along with the > + * devices names. Usually, the platform data elements that cannot be parsed > + * from the device tree by the drivers (example: function pointers) are > + * supplied. But it should be noted that this is a temporary mechanism and > + * at some point, the drivers should be capable of parsing all the platform > + * data from the device tree. > + */ > +static const struct of_dev_auxdata exynos4_auxdata_lookup[] __initconst = { > + OF_DEV_AUXDATA("samsung,s3c6410-sdhci", EXYNOS4_PA_HSMMC(2), > + "s3c-sdhci.2", &s3c_hsmmc2_def_platdata), > + OF_DEV_AUXDATA("samsung,s3c6410-sdhci", EXYNOS4_PA_HSMMC(0), > + "s3c-sdhci.0", &s3c_hsmmc0_def_platdata), > + {}, > +}; > + > +static void __init exynos4_dt_map_io(void) > +{ > + s5p_init_io(NULL, 0, S5P_VA_CHIPID); > + s3c24xx_init_clocks(24000000); > + s3c24xx_init_uarts(smdkv310_uartcfgs, ARRAY_SIZE(smdkv310_uartcfgs)); > +} > + > +static const struct of_device_id intc_of_match[] __initconst = { > + { .compatible = "samsung,exynos4-gic", }, > + {}, > +}; > + > +static void __init exynos4_dt_machine_init(void) > +{ > + irq_domain_generate_simple(intc_of_match, EXYNOS4_PA_GIC_DIST, 0); > + of_platform_populate(NULL, of_default_bus_match_table, > + exynos4_auxdata_lookup, NULL); > +} > + > +static char const *exynos4_dt_compat[] __initdata = { > + "samsung,exynos4", > + NULL > +}; > + > +DT_MACHINE_START(SMDKV310, "Samsung Exynos4 DT") > + /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ > + .init_irq = exynos4_init_irq, > + .map_io = exynos4_dt_map_io, > + .init_machine = exynos4_dt_machine_init, > + .timer = &exynos4_timer, > + .dt_compat = exynos4_dt_compat, > +MACHINE_END > -- > 1.7.4.1 > ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/2] arm: dt: Add device tree source file for Exynos4 and let boards include it 2011-08-01 16:20 Add device tree enabled Exynos4 machine Thomas Abraham 2011-08-01 16:20 ` [PATCH 1/2] arm: exynos4: Add a new Exynos4 device tree enabled machine Thomas Abraham @ 2011-08-01 16:20 ` Thomas Abraham 1 sibling, 0 replies; 4+ messages in thread From: Thomas Abraham @ 2011-08-01 16:20 UTC (permalink / raw) To: linux-arm-kernel Create a new device tree source file for Samsung's Exynos4 architecture and let Exynos4 based boards include it. We start with a almost empty device tree source file and incrementally add nodes as we improve the device tree coverage for Exynos4 architecture and related boards. Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org> --- Documentation/devicetree/bindings/arm/samsung.txt | 8 ++++ arch/arm/boot/dts/exynos4-smdkv310.dts | 31 ++++++++++++++ arch/arm/boot/dts/exynos4.dtsi | 44 +++++++++++++++++++++ 3 files changed, 83 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/samsung.txt create mode 100644 arch/arm/boot/dts/exynos4-smdkv310.dts create mode 100644 arch/arm/boot/dts/exynos4.dtsi diff --git a/Documentation/devicetree/bindings/arm/samsung.txt b/Documentation/devicetree/bindings/arm/samsung.txt new file mode 100644 index 0000000..ce4a1aa --- /dev/null +++ b/Documentation/devicetree/bindings/arm/samsung.txt @@ -0,0 +1,8 @@ +Samsung Exynos4 based SMDKV310 eval board + + SMDKV310 eval board is based on Samsung's Exynos4 processor architecture. + +Required root node properties: + - compatible = "samsung,smdkv310","samsung,exynos4" + (a) "samsung,smdkv310" - for Samsung's SMDKV310 eval board. + (b) "samsung,exynos4" - for boards based on Exynos4 architecture. diff --git a/arch/arm/boot/dts/exynos4-smdkv310.dts b/arch/arm/boot/dts/exynos4-smdkv310.dts new file mode 100644 index 0000000..526f137 --- /dev/null +++ b/arch/arm/boot/dts/exynos4-smdkv310.dts @@ -0,0 +1,31 @@ +/* + * Samsung's Exynos4 based SMDKV310 board device tree source. + * + * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * Copyright (c) 2010-2011 Linaro Ltd. + * www.linaro.org + * + * Device tree source file for Samsung's SMDKV310 board which is based on + * Samsung's Exynos4 architecture. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. +*/ + +/dts-v1/; +/include/ "exynos4.dtsi" + +/ { + model = "Samsung Exynos4 smdkv310 eval board"; + compatible = "samsung,smdkv310", "samsung,exynos4"; + + memory { + reg = <0x40000000 0x80000000>; + }; + + chosen { + bootargs ="root=/dev/mmcblk0p1 rootfstype=ext2 rootwait console=ttySAC1,115200"; + }; +}; diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi new file mode 100644 index 0000000..232b911 --- /dev/null +++ b/arch/arm/boot/dts/exynos4.dtsi @@ -0,0 +1,44 @@ +/* + * Samsung's Exynos4 Architecture device tree source. + * + * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * Copyright (c) 2010-2011 Linaro Ltd. + * www.linaro.org + * + * This file acts as the core device tree for Samsung's Exynos4 based board + * device tree files. The Exynos4 architecture related device tree nodes + * will be listed in this file and Exynos4 based board device tree files + * should include this file. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. +*/ + +/include/ "skeleton.dtsi" + +/ { + compatible = "samsung,exynos4"; + + soc { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-bus"; + interrupt-parent = <&intc>; + ranges; + + intc:interrupt-controller at 10490000 { + compatible = "samsung,exynos4-gic","arm,cortex-a9-gic"; + #interrupt-cells = <1>; + interrupt-controller; + reg = <0x10490000 0x1000>, <0x10480000 0x100>; + }; + + watchdog at 10060000 { + compatible = "samsung,s3c2410-wdt"; + reg = <0x10060000 0x100>; + interrupts = <107>; + }; + }; +}; -- 1.7.4.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-08-01 16:54 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-08-01 16:20 Add device tree enabled Exynos4 machine Thomas Abraham 2011-08-01 16:20 ` [PATCH 1/2] arm: exynos4: Add a new Exynos4 device tree enabled machine Thomas Abraham 2011-08-01 16:54 ` Grant Likely 2011-08-01 16:20 ` [PATCH 2/2] arm: dt: Add device tree source file for Exynos4 and let boards include it Thomas Abraham
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).