devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: Jason Liu <jason.hui-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	linaro-dev-cunTk1MwBs8s++Sfvej+rw@public.gmane.org,
	patches-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org
Subject: Re: [PATCH V5 1/4] arm/dt: add basic mx51 device tree support
Date: Thu, 17 Mar 2011 10:37:32 -0600	[thread overview]
Message-ID: <20110317163732.GB9597@angua.secretlab.ca> (raw)
In-Reply-To: <1300290701-9433-2-git-send-email-jason.hui-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

On Wed, Mar 16, 2011 at 11:51:38PM +0800, Jason Liu wrote:
> Signed-off-by: Jason Liu <jason.hui-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> ---
>  arch/arm/mach-mx5/Kconfig               |    8 ++++
>  arch/arm/mach-mx5/Makefile              |    1 +
>  arch/arm/mach-mx5/board-dt.c            |   64 +++++++++++++++++++++++++++++++
>  arch/arm/mach-mx5/clock-dt.c            |   52 +++++++++++++++++++++++++
>  arch/arm/plat-mxc/include/mach/common.h |    1 +
>  5 files changed, 126 insertions(+), 0 deletions(-)

I've picked up this series into my devicetree/test branch.  I still
have comments, but it has come a long way and I'm happy enough with it
to start carrying it.  Future patches can either build on top of this
series, or completely replace it (your choice).

g.

> 
> diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig
> index de4fa99..6438f87 100644
> --- a/arch/arm/mach-mx5/Kconfig
> +++ b/arch/arm/mach-mx5/Kconfig
> @@ -47,6 +47,14 @@ config MACH_MX51_BABBAGE
>  	  u-boot. This includes specific configurations for the board and its
>  	  peripherals.
>  
> +config MACH_MX51_DT
> +	bool "Generic MX51 board (FDT support)"
> +	select USE_OF
> +	select SOC_IMX51
> +	help
> +	 Support for generic Freescale i.MX51 boards using Flattened Device
> +	 Tree.
> +
>  config MACH_MX51_3DS
>  	bool "Support MX51PDK (3DS)"
>  	select SOC_IMX51
> diff --git a/arch/arm/mach-mx5/Makefile b/arch/arm/mach-mx5/Makefile
> index 0d43be9..bd4542d 100644
> --- a/arch/arm/mach-mx5/Makefile
> +++ b/arch/arm/mach-mx5/Makefile
> @@ -18,3 +18,4 @@ obj-$(CONFIG_MACH_EUKREA_CPUIMX51SD) += board-cpuimx51sd.o
>  obj-$(CONFIG_MACH_EUKREA_MBIMXSD51_BASEBOARD) += eukrea_mbimxsd-baseboard.o
>  obj-$(CONFIG_MACH_MX51_EFIKAMX) += board-mx51_efikamx.o
>  obj-$(CONFIG_MACH_MX50_RDP) += board-mx50_rdp.o
> +obj-$(CONFIG_MACH_MX51_DT) += board-dt.o clock-dt.o
> diff --git a/arch/arm/mach-mx5/board-dt.c b/arch/arm/mach-mx5/board-dt.c
> new file mode 100644
> index 0000000..62ca693
> --- /dev/null
> +++ b/arch/arm/mach-mx5/board-dt.c
> @@ -0,0 +1,64 @@
> +/*
> + * Copyright 2011 Linaro Ltd.
> + * Copyright 2011 Freescale Semiconductor, Inc.
> + *
> + * The code contained herein is licensed under the GNU General Public
> + * License. You may obtain a copy of the GNU General Public License
> + * Version 2 or later at the following locations:
> + *
> + * http://www.opensource.org/licenses/gpl-license.html
> + * http://www.gnu.org/copyleft/gpl.html
> + */
> +
> +#include <linux/err.h>
> +#include <linux/init.h>
> +#include <linux/platform_device.h>
> +#include <linux/dma-mapping.h>
> +#include <linux/of_platform.h>
> +#include <linux/of_fdt.h>
> +
> +#include <mach/common.h>
> +#include <mach/hardware.h>
> +#include <mach/imx-uart.h>
> +#include <mach/iomux-mx51.h>
> +
> +#include <asm/irq.h>
> +#include <asm/setup.h>
> +#include <asm/mach-types.h>
> +#include <asm/mach/arch.h>
> +#include <asm/mach/time.h>
> +
> +#include "devices.h"
> +
> +static struct of_device_id mx51_dt_match_table[] __initdata = {
> +	{ .compatible = "simple-bus", },
> +	{}
> +};
> +
> +static void __init mx51_dt_board_init(void)
> +{
> +	of_platform_bus_probe(NULL, mx51_dt_match_table, NULL);
> +}
> +
> +static void __init mx51_dt_timer_init(void)
> +{
> +	mx51_clocks_init(32768, 24000000, 22579200, 0);
> +	mx5_clk_dt_init();
> +}
> +
> +static struct sys_timer mxc_timer = {
> +	.init = mx51_dt_timer_init,
> +};
> +
> +static const char *mx51_dt_board_compat[] = {
> +	"fsl,mx51-babbage",
> +	NULL
> +};
> +
> +DT_MACHINE_START(MX51_DT, "Freescale MX51 (Flattened Device Tree)")
> +	.map_io       = mx51_map_io,
> +	.init_irq     = mx51_init_irq,
> +	.init_machine = mx51_dt_board_init,
> +	.dt_compat    = mx51_dt_board_compat,
> +	.timer        = &mxc_timer,
> +MACHINE_END
> diff --git a/arch/arm/mach-mx5/clock-dt.c b/arch/arm/mach-mx5/clock-dt.c
> new file mode 100644
> index 0000000..9c04475
> --- /dev/null
> +++ b/arch/arm/mach-mx5/clock-dt.c
> @@ -0,0 +1,52 @@
> +
> +/*
> + * Copyright 2011 Linaro Ltd.
> + * Jason Liu <jason.hui-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> + *
> + * The code contained herein is licensed under the GNU General Public
> + * License. You may obtain a copy of the GNU General Public License
> + * Version 2 or later at the following locations:
> + *
> + * http://www.opensource.org/licenses/gpl-license.html
> + * http://www.gnu.org/copyleft/gpl.html
> + */
> +
> +#include <linux/err.h>
> +#include <linux/init.h>
> +#include <linux/clk.h>
> +#include <linux/of.h>
> +#include <linux/of_address.h>
> +#include <linux/of_clk.h>
> +
> +static struct clk *mx5_dt_clk_get(struct device_node *np,
> +					const char *output_id, void *data)
> +{
> +	return data;
> +}
> +
> +static __init void mx5_dt_scan_clks(void)
> +{
> +	struct device_node *node;
> +	struct clk *clk;
> +	const char *id;
> +	int rc;
> +
> +	for_each_compatible_node(node, NULL, "clock") {
> +		id = of_get_property(node, "clock-outputs", NULL);
> +		if (!id)
> +			continue;
> +
> +		clk = clk_get_sys(id, NULL);
> +		if (IS_ERR(clk))
> +			continue;
> +
> +		rc = of_clk_add_provider(node, mx5_dt_clk_get, clk);
> +		if (rc)
> +			pr_err("error adding fixed clk %s\n", node->name);
> +	}
> +}
> +
> +void __init mx5_clk_dt_init(void)
> +{
> +	mx5_dt_scan_clks();
> +}
> diff --git a/arch/arm/plat-mxc/include/mach/common.h b/arch/arm/plat-mxc/include/mach/common.h
> index aea2cd3..a28e84a 100644
> --- a/arch/arm/plat-mxc/include/mach/common.h
> +++ b/arch/arm/plat-mxc/include/mach/common.h
> @@ -58,4 +58,5 @@ extern void mxc91231_arch_reset(int, const char *);
>  extern void mxc91231_prepare_idle(void);
>  extern void mx51_efikamx_reset(void);
>  extern int mx53_revision(void);
> +extern void mx5_clk_dt_init(void);
>  #endif
> -- 
> 1.7.1
> 

  parent reply	other threads:[~2011-03-17 16:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-16 15:51 [PATCH V5 0/4] Add MX51 basic DT support Jason Liu
     [not found] ` <1300290701-9433-1-git-send-email-jason.hui-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2011-03-16 15:51   ` [PATCH V5 1/4] arm/dt: add basic mx51 device tree support Jason Liu
     [not found]     ` <1300290701-9433-2-git-send-email-jason.hui-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2011-03-17 16:37       ` Grant Likely [this message]
     [not found]         ` <20110317163732.GB9597-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2011-03-18  2:19           ` Shawn Guo
     [not found]             ` <20110318021918.GC26951-+NayF8gZjK2ctlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2011-03-18  5:05               ` Grant Likely
2011-03-16 15:51   ` [PATCH V5 2/4] arm/dt: add very basic dts file for babbage board Jason Liu
     [not found]     ` <1300290701-9433-3-git-send-email-jason.hui-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2011-03-17 16:42       ` Grant Likely
     [not found]         ` <20110317164238.GC9597-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2011-03-18  1:49           ` Shawn Guo
     [not found]             ` <20110318014917.GB26951-+NayF8gZjK2ctlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2011-03-18  5:43               ` Grant Likely
     [not found]                 ` <20110318054333.GH18545-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2011-03-18  7:54                   ` Shawn Guo
     [not found]                     ` <20110318075431.GD26951-+NayF8gZjK2ctlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2011-03-18 16:02                       ` Grant Likely
2011-03-16 15:51   ` [PATCH V5 3/4] serial/imx: parse from device tree support Jason Liu
     [not found]     ` <1300290701-9433-4-git-send-email-jason.hui-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2011-03-17 16:43       ` Grant Likely
2011-03-16 15:51   ` [PATCH V5 4/4] net/fec: add device tree matching support Jason Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110317163732.GB9597@angua.secretlab.ca \
    --to=grant.likely-s3s/wqlpoipyb63q8fvjnq@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=jason.hui-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linaro-dev-cunTk1MwBs8s++Sfvej+rw@public.gmane.org \
    --cc=patches-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).