diff mbox

[6/7] OMAP3: board-dt: Add generic board file for DT support

Message ID 1314897912-18178-7-git-send-email-b-cousson@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Benoit Cousson Sept. 1, 2011, 5:25 p.m. UTC
Create an OMAP3 generic board to start the DT migration.

This file is doing the minimal initialization needed to boot
properly on a RAMDISK filesystem.

As soon as the OMAP3 specifics will be removed, that board will
be converted to an even more generic board-dt.c that will support
every OMAP2+ platforms.

Based on original patch from Manju:
http://www.spinics.net/lists/linux-omap/msg55832.html

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: G, Manjunath Kondaiah <manjugk@ti.com>
---
 arch/arm/mach-omap2/Kconfig          |   10 +++++
 arch/arm/mach-omap2/Makefile         |    1 +
 arch/arm/mach-omap2/board-omap3-dt.c |   74 ++++++++++++++++++++++++++++++++++
 3 files changed, 85 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-omap3-dt.c

Comments

Tony Lindgren Sept. 2, 2011, 8:09 a.m. UTC | #1
Hi,

* Benoit Cousson <b-cousson@ti.com> [110901 19:52]:
> Create an OMAP3 generic board to start the DT migration.

I don't think this needs to be SoC specific, we can add multiple
DT_MACHINE_START entries into a single file. So it should be
just board-omap-dt.c.
 
> +#include "mux.h"
> +#include "common-board-devices.h"
> +#include "sdram-micron-mt46h32m32lf-6.h"
> +
> +
> +static void __init omap3_init_early(void)
> +{
> +	omap2_init_common_infrastructure();
> +	omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
> +				  mt46h32m32lf6_sdrc_params);
> +}

This has changed, see the cleanup branch. Also, let's just leave
out the sdram timings for now as we can work with bootloader
timings until those come from DT too.

> +static void __init omap3_init(void)
> +{
> +	struct device_node *node;
> +
> +	node = of_find_matching_node(NULL, omap_dt_intc_match);
> +	if (node)
> +		irq_domain_add_simple(node, 0);
> +
> +	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
> +	omap_serial_init();
> +
> +	of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
> +}
> +
> +static const char *omap3_dt_match[] __initdata = {
> +	"ti,omap3",
> +	NULL
> +};

Most likely we just need SoC specific init functions in this file
now until the mux data comes from DT also.

> +DT_MACHINE_START(OMAP3_DT, "TI OMAP3 (Flattened Device Tree)")
> +	.reserve	= omap_reserve,
> +	.map_io		= omap3_map_io,
> +	.init_early	= omap3_init_early,
> +	.init_irq	= omap3_init_irq,
> +	.init_machine	= omap3_init,
> +	.timer		= &omap3_timer,
> +	.dt_compat	= omap3_dt_match,
> +MACHINE_END

Here omap3_init_early is now generic in the cleanup branch.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Benoit Cousson Sept. 2, 2011, 8:46 a.m. UTC | #2
Hi Tony,

On 9/2/2011 10:09 AM, Tony Lindgren wrote:
> Hi,
>
> * Benoit Cousson<b-cousson@ti.com>  [110901 19:52]:
>> Create an OMAP3 generic board to start the DT migration.
>
> I don't think this needs to be SoC specific, we can add multiple
> DT_MACHINE_START entries into a single file. So it should be
> just board-omap-dt.c.

I do agree, it should not, I made that comment into the 
board-omap4-dt.c, but for the moment we still have dedicated OMAP 
specifics stuff at board level, like the map_io.

I have an other series that make the map_io DT aware to get rid of that, 
but it still not finalized.

My goal was have a single DT_MACHINE_START for every OMAPs.
But, meanwhile, if you prefer one file with many board descriptors, 
that's fine.

>> +#include "mux.h"
>> +#include "common-board-devices.h"
>> +#include "sdram-micron-mt46h32m32lf-6.h"
>> +
>> +
>> +static void __init omap3_init_early(void)
>> +{
>> +	omap2_init_common_infrastructure();
>> +	omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
>> +				  mt46h32m32lf6_sdrc_params);
>> +}
>
> This has changed, see the cleanup branch. Also, let's just leave
> out the sdram timings for now as we can work with bootloader
> timings until those come from DT too.

Yep, I know, but since that series is based on my previous series that 
is based on mainline rc-3, I missed these.

Now, that kernel.org is back, I'll pull you branches :-).

Which one do you recommend in that case, master or cleanup?

>> +static void __init omap3_init(void)
>> +{
>> +	struct device_node *node;
>> +
>> +	node = of_find_matching_node(NULL, omap_dt_intc_match);
>> +	if (node)
>> +		irq_domain_add_simple(node, 0);
>> +
>> +	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
>> +	omap_serial_init();
>> +
>> +	of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
>> +}
>> +
>> +static const char *omap3_dt_match[] __initdata = {
>> +	"ti,omap3",
>> +	NULL
>> +};
>
> Most likely we just need SoC specific init functions in this file
> now until the mux data comes from DT also.

OK, I can get rid of mux stuff then.

>> +DT_MACHINE_START(OMAP3_DT, "TI OMAP3 (Flattened Device Tree)")
>> +	.reserve	= omap_reserve,
>> +	.map_io		= omap3_map_io,
>> +	.init_early	= omap3_init_early,
>> +	.init_irq	= omap3_init_irq,
>> +	.init_machine	= omap3_init,
>> +	.timer		=&omap3_timer,
>> +	.dt_compat	= omap3_dt_match,
>> +MACHINE_END
>
> Here omap3_init_early is now generic in the cleanup branch.

Cool, I'll update the whole series, including the OMAP4 ones.

Benoit

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Russell King - ARM Linux Sept. 2, 2011, 9:08 a.m. UTC | #3
On Fri, Sep 02, 2011 at 10:46:56AM +0200, Cousson, Benoit wrote:
> Now, that kernel.org is back, I'll pull you branches :-).

Umm.  Are you sure?  What are you checking - that some kernel.org
servers are reachable or that master.kernel.org is reachable (it
isn't.)
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Benoit Cousson Sept. 2, 2011, 9:13 a.m. UTC | #4
On 9/2/2011 11:08 AM, Russell King - ARM Linux wrote:
> On Fri, Sep 02, 2011 at 10:46:56AM +0200, Cousson, Benoit wrote:
>> Now, that kernel.org is back, I'll pull you branches :-).
>
> Umm.  Are you sure?  What are you checking - that some kernel.org
> servers are reachable or that master.kernel.org is reachable (it
> isn't.)

I was not about to fetch 
git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git 
yesterday, but it works today.

Benoit


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Russell King - ARM Linux Sept. 2, 2011, 9:21 a.m. UTC | #5
On Fri, Sep 02, 2011 at 11:13:03AM +0200, Cousson, Benoit wrote:
> On 9/2/2011 11:08 AM, Russell King - ARM Linux wrote:
>> On Fri, Sep 02, 2011 at 10:46:56AM +0200, Cousson, Benoit wrote:
>>> Now, that kernel.org is back, I'll pull you branches :-).
>>
>> Umm.  Are you sure?  What are you checking - that some kernel.org
>> servers are reachable or that master.kernel.org is reachable (it
>> isn't.)
>
> I was not about to fetch  
> git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git  
> yesterday, but it works today.

git.kernel.org != master.kernel.org.

git.kernel.org is an alias for a set of servers which are selected
depending on your geographical location, whereas master.kernel.org
a single machine to which we upload our trees and which has been down
since Wednesday.  I don't believe master.kernel.org is part of the
public serving infrastructure (it certainly never used to be.)

So, I suspect your non-reachability of git.kernel.org yesterday was
due to some other problem.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Benoit Cousson Sept. 2, 2011, 9:34 a.m. UTC | #6
On 9/2/2011 11:21 AM, Russell King - ARM Linux wrote:
> On Fri, Sep 02, 2011 at 11:13:03AM +0200, Cousson, Benoit wrote:
>> On 9/2/2011 11:08 AM, Russell King - ARM Linux wrote:
>>> On Fri, Sep 02, 2011 at 10:46:56AM +0200, Cousson, Benoit wrote:
>>>> Now, that kernel.org is back, I'll pull you branches :-).
>>>
>>> Umm.  Are you sure?  What are you checking - that some kernel.org
>>> servers are reachable or that master.kernel.org is reachable (it
>>> isn't.)
>>
>> I was not about to fetch
>> git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git
>> yesterday, but it works today.
>
> git.kernel.org != master.kernel.org.
>
> git.kernel.org is an alias for a set of servers which are selected
> depending on your geographical location, whereas master.kernel.org
> a single machine to which we upload our trees and which has been down
> since Wednesday.  I don't believe master.kernel.org is part of the
> public serving infrastructure (it certainly never used to be.)

Interesting, thanks for the explanations.

> So, I suspect your non-reachability of git.kernel.org yesterday was
> due to some other problem.

OK, maybe. The good point is that now it works :-)

The bad point is that Kevin cannot push his updated branches, so I still 
do not have the latest :-(

Thanks,
Benoit


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tony Lindgren Sept. 2, 2011, 10:43 a.m. UTC | #7
* Cousson, Benoit <b-cousson@ti.com> [110902 11:13]:
> Hi Tony,
> 
> On 9/2/2011 10:09 AM, Tony Lindgren wrote:
> >Hi,
> >
> >* Benoit Cousson<b-cousson@ti.com>  [110901 19:52]:
> >>Create an OMAP3 generic board to start the DT migration.
> >
> >I don't think this needs to be SoC specific, we can add multiple
> >DT_MACHINE_START entries into a single file. So it should be
> >just board-omap-dt.c.
> 
> I do agree, it should not, I made that comment into the
> board-omap4-dt.c, but for the moment we still have dedicated OMAP
> specifics stuff at board level, like the map_io.

Well map_io can also be set in DT_MACHINE_START. For most part
it already is generic like omap3_map_io and omap4_map_io.
So that should not stop anything.
 
> I have an other series that make the map_io DT aware to get rid of
> that, but it still not finalized.

Hmm maybe take a look again? We've already sorted out quite a bit
of the init stuff over past few merge windows. If there's still
something blocking that, let's clear it out ASAP.
 
> My goal was have a single DT_MACHINE_START for every OMAPs.
> But, meanwhile, if you prefer one file with many board descriptors,
> that's fine.

Yes that's better. We should only need a separate DT_MACHINE_START
for major SoC variants.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
manjugk manjugk Sept. 5, 2011, 12:09 p.m. UTC | #8
Minor comments:

On Thu, Sep 01, 2011 at 07:25:11PM +0200, Benoit Cousson wrote:
> Create an OMAP3 generic board to start the DT migration.
> 
> This file is doing the minimal initialization needed to boot
> properly on a RAMDISK filesystem.
> 
> As soon as the OMAP3 specifics will be removed, that board will
> be converted to an even more generic board-dt.c that will support
> every OMAP2+ platforms.
> 
> Based on original patch from Manju:
> http://www.spinics.net/lists/linux-omap/msg55832.html
> 
> Signed-off-by: Benoit Cousson <b-cousson@ti.com>
> Cc: Tony Lindgren <tony@atomide.com>
> Cc: G, Manjunath Kondaiah <manjugk@ti.com>
> ---
>  arch/arm/mach-omap2/Kconfig          |   10 +++++
>  arch/arm/mach-omap2/Makefile         |    1 +
>  arch/arm/mach-omap2/board-omap3-dt.c |   74 ++++++++++++++++++++++++++++++++++
>  3 files changed, 85 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/mach-omap2/board-omap3-dt.c
> 
> diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
> index 5d501d2..82f0df2 100644
> --- a/arch/arm/mach-omap2/Kconfig
> +++ b/arch/arm/mach-omap2/Kconfig
> @@ -305,6 +305,16 @@ config MACH_OMAP_3630SDP
>  	default y
>  	select OMAP_PACKAGE_CBP
>  
> +config MACH_OMAP3_DT
> +	bool "Generic OMAP3 board (FDT support)"
> +	depends on ARCH_OMAP3
> +	select OMAP_PACKAGE_CBB
> +	select USE_OF
> +	help
> +	  Support for generic TI OMAP3 boards using Flattened Device Tree.
> +	  Say Y here to enable OMAP3 device tree support
> +	  More information at Documentation/devicetree
> +
>  config MACH_TI8168EVM
>  	bool "TI8168 Evaluation Module"
>  	depends on SOC_OMAPTI816X
> diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
> index 6ab9116..5144c17 100644
> --- a/arch/arm/mach-omap2/Makefile
> +++ b/arch/arm/mach-omap2/Makefile
> @@ -197,6 +197,7 @@ obj-$(CONFIG_MACH_OVERO)		+= board-overo.o
>  obj-$(CONFIG_MACH_OMAP3EVM)		+= board-omap3evm.o
>  obj-$(CONFIG_MACH_OMAP3_PANDORA)	+= board-omap3pandora.o
>  obj-$(CONFIG_MACH_OMAP_3430SDP)		+= board-3430sdp.o
> +obj-$(CONFIG_MACH_OMAP3_DT)		+= board-omap3-dt.o
>  obj-$(CONFIG_MACH_NOKIA_N8X0)		+= board-n8x0.o
>  obj-$(CONFIG_MACH_NOKIA_RM680)		+= board-rm680.o \
>  					   sdram-nokia.o
> diff --git a/arch/arm/mach-omap2/board-omap3-dt.c b/arch/arm/mach-omap2/board-omap3-dt.c
> new file mode 100644
> index 0000000..6eb56c6
> --- /dev/null
> +++ b/arch/arm/mach-omap2/board-omap3-dt.c
> @@ -0,0 +1,74 @@
> +/*
> + * OMAP3 Device tree boards support
> + *
> + * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
> + *
> + * 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/irqdomain.h>
> +#include <linux/of_platform.h>
> +#include <linux/i2c/twl.h>
this header is redundant
> +
> +#include <asm/mach/arch.h>
> +#include <plat/common.h>
> +
> +#include "mux.h"
> +#include "common-board-devices.h"
> +#include "sdram-micron-mt46h32m32lf-6.h"
> +
> +
extra blank line

-M
> +static void __init omap3_init_early(void)
> +{
> +	omap2_init_common_infrastructure();
> +	omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
> +				  mt46h32m32lf6_sdrc_params);
> +}
> +
> +#ifdef CONFIG_OMAP_MUX
> +static struct omap_board_mux board_mux[] __initdata = {
> +	{ .reg_offset = OMAP_MUX_TERMINATOR },
> +};
> +#endif
> +
> +static struct of_device_id omap_dt_match_table[] __initdata = {
> +	{ .compatible = "simple-bus", },
> +	{ .compatible = "ti,omap-infra", },
> +	{}
> +};
> +
> +static struct of_device_id omap_dt_intc_match[] __initdata = {
> +	{ .compatible = "ti,omap3-intc", },
> +	{}
> +};
> +
> +static void __init omap3_init(void)
> +{
> +	struct device_node *node;
> +
> +	node = of_find_matching_node(NULL, omap_dt_intc_match);
> +	if (node)
> +		irq_domain_add_simple(node, 0);
> +
> +	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
> +	omap_serial_init();
> +
> +	of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
> +}
> +
> +static const char *omap3_dt_match[] __initdata = {
> +	"ti,omap3",
> +	NULL
> +};
> +
> +DT_MACHINE_START(OMAP3_DT, "TI OMAP3 (Flattened Device Tree)")
> +	.reserve	= omap_reserve,
> +	.map_io		= omap3_map_io,
> +	.init_early	= omap3_init_early,
> +	.init_irq	= omap3_init_irq,
> +	.init_machine	= omap3_init,
> +	.timer		= &omap3_timer,
> +	.dt_compat	= omap3_dt_match,
> +MACHINE_END
> -- 
> 1.7.0.4
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 5d501d2..82f0df2 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -305,6 +305,16 @@  config MACH_OMAP_3630SDP
 	default y
 	select OMAP_PACKAGE_CBP
 
+config MACH_OMAP3_DT
+	bool "Generic OMAP3 board (FDT support)"
+	depends on ARCH_OMAP3
+	select OMAP_PACKAGE_CBB
+	select USE_OF
+	help
+	  Support for generic TI OMAP3 boards using Flattened Device Tree.
+	  Say Y here to enable OMAP3 device tree support
+	  More information at Documentation/devicetree
+
 config MACH_TI8168EVM
 	bool "TI8168 Evaluation Module"
 	depends on SOC_OMAPTI816X
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 6ab9116..5144c17 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -197,6 +197,7 @@  obj-$(CONFIG_MACH_OVERO)		+= board-overo.o
 obj-$(CONFIG_MACH_OMAP3EVM)		+= board-omap3evm.o
 obj-$(CONFIG_MACH_OMAP3_PANDORA)	+= board-omap3pandora.o
 obj-$(CONFIG_MACH_OMAP_3430SDP)		+= board-3430sdp.o
+obj-$(CONFIG_MACH_OMAP3_DT)		+= board-omap3-dt.o
 obj-$(CONFIG_MACH_NOKIA_N8X0)		+= board-n8x0.o
 obj-$(CONFIG_MACH_NOKIA_RM680)		+= board-rm680.o \
 					   sdram-nokia.o
diff --git a/arch/arm/mach-omap2/board-omap3-dt.c b/arch/arm/mach-omap2/board-omap3-dt.c
new file mode 100644
index 0000000..6eb56c6
--- /dev/null
+++ b/arch/arm/mach-omap2/board-omap3-dt.c
@@ -0,0 +1,74 @@ 
+/*
+ * OMAP3 Device tree boards support
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * 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/irqdomain.h>
+#include <linux/of_platform.h>
+#include <linux/i2c/twl.h>
+
+#include <asm/mach/arch.h>
+#include <plat/common.h>
+
+#include "mux.h"
+#include "common-board-devices.h"
+#include "sdram-micron-mt46h32m32lf-6.h"
+
+
+static void __init omap3_init_early(void)
+{
+	omap2_init_common_infrastructure();
+	omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
+				  mt46h32m32lf6_sdrc_params);
+}
+
+#ifdef CONFIG_OMAP_MUX
+static struct omap_board_mux board_mux[] __initdata = {
+	{ .reg_offset = OMAP_MUX_TERMINATOR },
+};
+#endif
+
+static struct of_device_id omap_dt_match_table[] __initdata = {
+	{ .compatible = "simple-bus", },
+	{ .compatible = "ti,omap-infra", },
+	{}
+};
+
+static struct of_device_id omap_dt_intc_match[] __initdata = {
+	{ .compatible = "ti,omap3-intc", },
+	{}
+};
+
+static void __init omap3_init(void)
+{
+	struct device_node *node;
+
+	node = of_find_matching_node(NULL, omap_dt_intc_match);
+	if (node)
+		irq_domain_add_simple(node, 0);
+
+	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
+	omap_serial_init();
+
+	of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
+}
+
+static const char *omap3_dt_match[] __initdata = {
+	"ti,omap3",
+	NULL
+};
+
+DT_MACHINE_START(OMAP3_DT, "TI OMAP3 (Flattened Device Tree)")
+	.reserve	= omap_reserve,
+	.map_io		= omap3_map_io,
+	.init_early	= omap3_init_early,
+	.init_irq	= omap3_init_irq,
+	.init_machine	= omap3_init,
+	.timer		= &omap3_timer,
+	.dt_compat	= omap3_dt_match,
+MACHINE_END