From patchwork Fri May 1 06:58:52 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 21398 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4171gqh015888 for ; Fri, 1 May 2009 07:01:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751104AbZEAHBl (ORCPT ); Fri, 1 May 2009 03:01:41 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751190AbZEAHBl (ORCPT ); Fri, 1 May 2009 03:01:41 -0400 Received: from rv-out-0506.google.com ([209.85.198.237]:50443 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751104AbZEAHBk (ORCPT ); Fri, 1 May 2009 03:01:40 -0400 Received: by rv-out-0506.google.com with SMTP id f9so1784793rvb.1 for ; Fri, 01 May 2009 00:01:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=dxLh+NplxjvnqaNogbZseOmgEgI1NqsAaKr5M+oYdUc=; b=AyGyHm9hLnjuFOePezKrKEqA1nV0R6dE9vq2WE6Py13fsSAYL6BPxyACDhCcUIcUYT KD/00JgDPB7op/Otfvb58cW0QsPonBbdU8GnTyKQERud6ObFgS0VKUnehhwRCWkOVWr+ jJzX+JGMLwJ/uK2k/0zBMCi8ItbqXj4cBRjos= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=S5G9t3+hDuhiyPQZj/g//6dOU9hv1WErWXvFP4sppQG04cQ9m0u9ewsZL7EMwWOxDf ZMivDDRDECa38m9LuOFAlK29pFDVPRZAt4cRnODxNAKeB7LgaJJBs9TjAgAVOBpVuDu6 XAGrgN8bbnAis2MxIu6OP12NMcz7bjQqcsVbw= Received: by 10.141.137.16 with SMTP id p16mr762007rvn.180.1241161300062; Fri, 01 May 2009 00:01:40 -0700 (PDT) Received: from rx1.opensource.se (mailhost.igel.co.jp [219.106.231.130]) by mx.google.com with ESMTPS id c20sm6840770rvf.40.2009.05.01.00.01.38 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 01 May 2009 00:01:39 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Fri, 01 May 2009 15:58:52 +0900 Message-Id: <20090501065852.8861.19090.sendpatchset@rx1.opensource.se> Subject: [PATCH] sh: TMU platform data for sh7722 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Magnus Damm This patch adds TMU platform data for sh7722. Only clockevent mode is enabled for now, clocksource requires this patch: "clocksource: setup mult_orig in clocksource_enable()" Signed-off-by: Magnus Damm --- arch/sh/Kconfig | 1 arch/sh/kernel/cpu/sh4a/setup-sh7722.c | 99 ++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0007/arch/sh/Kconfig +++ work/arch/sh/Kconfig 2009-05-01 13:22:50.000000000 +0900 @@ -423,6 +423,7 @@ config CPU_SUBTYPE_SH7722 select ARCH_SPARSEMEM_ENABLE select SYS_SUPPORTS_NUMA select SYS_SUPPORTS_CMT + select SYS_SUPPORTS_TMU config CPU_SUBTYPE_SH7366 bool "Support SH7366 processor" --- 0001/arch/sh/kernel/cpu/sh4a/setup-sh7722.c +++ work/arch/sh/kernel/cpu/sh4a/setup-sh7722.c 2009-05-01 13:32:49.000000000 +0900 @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -209,6 +210,98 @@ static struct platform_device cmt_device .num_resources = ARRAY_SIZE(cmt_resources), }; +static struct sh_tmu_config tmu0_platform_data = { + .name = "TMU0", + .channel_offset = 0x04, + .timer_bit = 0, + .clk = "tmu0", + .clockevent_rating = 200, +}; + +static struct resource tmu0_resources[] = { + [0] = { + .name = "TMU0", + .start = 0xffd80008, + .end = 0xffd80013, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = 16, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device tmu0_device = { + .name = "sh_tmu", + .id = 0, + .dev = { + .platform_data = &tmu0_platform_data, + }, + .resource = tmu0_resources, + .num_resources = ARRAY_SIZE(tmu0_resources), +}; + +static struct sh_tmu_config tmu1_platform_data = { + .name = "TMU1", + .channel_offset = 0x10, + .timer_bit = 1, + .clk = "tmu0", + .clocksource_rating = 0, /* disabled for now */ +}; + +static struct resource tmu1_resources[] = { + [0] = { + .name = "TMU1", + .start = 0xffd80014, + .end = 0xffd8001f, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = 17, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device tmu1_device = { + .name = "sh_tmu", + .id = 1, + .dev = { + .platform_data = &tmu1_platform_data, + }, + .resource = tmu1_resources, + .num_resources = ARRAY_SIZE(tmu1_resources), +}; + +static struct sh_tmu_config tmu2_platform_data = { + .name = "TMU2", + .channel_offset = 0x1c, + .timer_bit = 2, + .clk = "tmu0", +}; + +static struct resource tmu2_resources[] = { + [0] = { + .name = "TMU2", + .start = 0xffd80020, + .end = 0xffd8002b, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = 18, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device tmu2_device = { + .name = "sh_tmu", + .id = 2, + .dev = { + .platform_data = &tmu2_platform_data, + }, + .resource = tmu2_resources, + .num_resources = ARRAY_SIZE(tmu2_resources), +}; + static struct plat_sci_port sci_platform_data[] = { { .mapbase = 0xffe00000, @@ -243,6 +336,9 @@ static struct platform_device sci_device static struct platform_device *sh7722_devices[] __initdata = { &cmt_device, + &tmu0_device, + &tmu1_device, + &tmu2_device, &rtc_device, &usbf_device, &iic_device, @@ -271,6 +367,9 @@ __initcall(sh7722_devices_setup); static struct platform_device *sh7722_early_devices[] __initdata = { &cmt_device, + &tmu0_device, + &tmu1_device, + &tmu2_device, }; void __init plat_early_device_setup(void)