From patchwork Wed Jan 21 15:15:12 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 3469 X-Patchwork-Delegate: lethal@linux-sh.org 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 n0LFCGP5023131 for ; Wed, 21 Jan 2009 07:12:33 -0800 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756123AbZAUPRK (ORCPT ); Wed, 21 Jan 2009 10:17:10 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756194AbZAUPRK (ORCPT ); Wed, 21 Jan 2009 10:17:10 -0500 Received: from rv-out-0506.google.com ([209.85.198.232]:37964 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756123AbZAUPRI (ORCPT ); Wed, 21 Jan 2009 10:17:08 -0500 Received: by rv-out-0506.google.com with SMTP id k40so3654714rvb.1 for ; Wed, 21 Jan 2009 07:17:08 -0800 (PST) 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 :in-reply-to:references:subject; bh=4MR8uux7m7Jo1wuxavBwtROXzA60bV3RA3eg3+Ze8Fc=; b=AdwbCHY22dngqfcSyeHgqBDOLt1YVBoNnAL6MwXJE2SVoZhUeE8UQ/5DKu8SStCcq8 pQnJjVlW5cZi5dQM3xeQbaI9uM0jXIopqeaoU2XpB1Lgc+Do5ANySbvqaTWL+J76pCmX X+vvxKWfPb3JMuP9cfvphPHsjGYp/g8IgoJvQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:in-reply-to:references:subject; b=K8w5DcwYF1ESxglHRCY4eAr6plJFGTtX8LwKmY2j4vtL6WGy2EJS9hLDQKe7DGPAVw COF/zk6qKMbiV/QHeOxRC+r+nf6tkvkcrt9iWAxLmLVcP4DRoNFYUJOyrYrhiAIgEPTW gLdT7NTG91ZA/MKwXVGzw6Esw62Rq82s7jZbo= Received: by 10.140.147.5 with SMTP id u5mr2147919rvd.292.1232551028195; Wed, 21 Jan 2009 07:17:08 -0800 (PST) Received: from rx1.opensource.se (114.8.221.202.ts.2iij.net [202.221.8.114]) by mx.google.com with ESMTPS id f21sm15630065rvb.7.2009.01.21.07.17.06 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 21 Jan 2009 07:17:07 -0800 (PST) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Thu, 22 Jan 2009 00:15:12 +0900 Message-Id: <20090121151512.29269.85170.sendpatchset@rx1.opensource.se> In-Reply-To: <20090121151334.29269.55519.sendpatchset@rx1.opensource.se> References: <20090121151334.29269.55519.sendpatchset@rx1.opensource.se> Subject: [PATCH 012/013] sh-sci: convert sh4 cpus to single port devices Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Magnus Damm Rework sh-sci platform data for sh4 processors such as: sh775x, sh776x, sh4-202 Signed-off-by: Magnus Damm --- arch/sh/kernel/cpu/sh4/setup-sh4-202.c | 22 +++----- arch/sh/kernel/cpu/sh4/setup-sh7750.c | 51 ++++++++++++------- arch/sh/kernel/cpu/sh4/setup-sh7760.c | 84 +++++++++++++++++++++----------- 3 files changed, 97 insertions(+), 60 deletions(-) -- 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 --- 0001/arch/sh/kernel/cpu/sh4/setup-sh4-202.c +++ work/arch/sh/kernel/cpu/sh4/setup-sh4-202.c 2009-01-21 22:11:39.000000000 +0900 @@ -12,27 +12,23 @@ #include #include -static struct plat_sci_port sci_platform_data[] = { - { - .mapbase = 0xffe80000, - .flags = UPF_BOOT_AUTOCONF, - .type = PORT_SCIF, - .irqs = { 40, 41, 43, 42 }, - }, { - .flags = 0, - } +static struct plat_sci_port scif0_platform_data = { + .mapbase = 0xffe80000, + .flags = UPF_BOOT_AUTOCONF, + .type = PORT_SCIF, + .irqs = { 40, 41, 43, 42 }, }; -static struct platform_device sci_device = { +static struct platform_device scif0_device = { .name = "sh-sci", - .id = -1, + .id = 0, .dev = { - .platform_data = sci_platform_data, + .platform_data = &scif0_platform_data, }, }; static struct platform_device *sh4202_devices[] __initdata = { - &sci_device, + &scif0_device, }; static int __init sh4202_devices_setup(void) --- 0001/arch/sh/kernel/cpu/sh4/setup-sh7750.c +++ work/arch/sh/kernel/cpu/sh4/setup-sh7750.c 2009-01-21 22:08:36.000000000 +0900 @@ -44,35 +44,48 @@ static struct platform_device rtc_device .resource = rtc_resources, }; -static struct plat_sci_port sci_platform_data[] = { - { #ifndef CONFIG_SH_RTS7751R2D - .mapbase = 0xffe00000, - .flags = UPF_BOOT_AUTOCONF, - .type = PORT_SCI, - .irqs = { 23, 24, 25, 0 }, - }, { -#endif - .mapbase = 0xffe80000, - .flags = UPF_BOOT_AUTOCONF, - .type = PORT_SCIF, - .irqs = { 40, 41, 43, 42 }, - }, { - .flags = 0, - } +static struct plat_sci_port sci0_platform_data = { + .mapbase = 0xffe00000, + .flags = UPF_BOOT_AUTOCONF, + .type = PORT_SCI, + .irqs = { 23, 24, 25, 0 }, +}; + +static struct platform_device sci0_device = { + .name = "sh-sci", + .id = 0, + .dev = { + .platform_data = &sci0_platform_data, + }, +}; +#endif + +static struct plat_sci_port scif0_platform_data = { + .mapbase = 0xffe80000, + .flags = UPF_BOOT_AUTOCONF, + .type = PORT_SCIF, + .irqs = { 40, 41, 43, 42 }, }; -static struct platform_device sci_device = { +static struct platform_device scif0_device = { .name = "sh-sci", - .id = -1, +#ifdef CONFIG_SH_RTS7751R2D + .id = 0, +#else + .id = 1, +#endif .dev = { - .platform_data = sci_platform_data, + .platform_data = &scif0_platform_data, }, }; static struct platform_device *sh7750_devices[] __initdata = { &rtc_device, - &sci_device, +#ifndef CONFIG_SH_RTS7751R2D + &sci0_device, +#endif + &scif0_device, }; static int __init sh7750_devices_setup(void) --- 0001/arch/sh/kernel/cpu/sh4/setup-sh7760.c +++ work/arch/sh/kernel/cpu/sh4/setup-sh7760.c 2009-01-21 22:10:33.000000000 +0900 @@ -134,42 +134,70 @@ static struct intc_vect vectors_irq[] __ static DECLARE_INTC_DESC(intc_desc_irq, "sh7760-irq", vectors_irq, groups, mask_registers, prio_registers, NULL); -static struct plat_sci_port sci_platform_data[] = { - { - .mapbase = 0xfe600000, - .flags = UPF_BOOT_AUTOCONF, - .type = PORT_SCIF, - .irqs = { 52, 53, 55, 54 }, - }, { - .mapbase = 0xfe610000, - .flags = UPF_BOOT_AUTOCONF, - .type = PORT_SCIF, - .irqs = { 72, 73, 75, 74 }, - }, { - .mapbase = 0xfe620000, - .flags = UPF_BOOT_AUTOCONF, - .type = PORT_SCIF, - .irqs = { 76, 77, 79, 78 }, - }, { - .mapbase = 0xfe480000, - .flags = UPF_BOOT_AUTOCONF, - .type = PORT_SCI, - .irqs = { 80, 81, 82, 0 }, - }, { - .flags = 0, - } +static struct plat_sci_port scif0_platform_data = { + .mapbase = 0xfe600000, + .flags = UPF_BOOT_AUTOCONF, + .type = PORT_SCIF, + .irqs = { 52, 53, 55, 54 }, }; -static struct platform_device sci_device = { +static struct platform_device scif0_device = { .name = "sh-sci", - .id = -1, + .id = 0, .dev = { - .platform_data = sci_platform_data, + .platform_data = &scif0_platform_data, }, }; +static struct plat_sci_port scif1_platform_data = { + .mapbase = 0xfe610000, + .flags = UPF_BOOT_AUTOCONF, + .type = PORT_SCIF, + .irqs = { 72, 73, 75, 74 }, +}; + +static struct platform_device scif1_device = { + .name = "sh-sci", + .id = 1, + .dev = { + .platform_data = &scif1_platform_data, + }, +}; + +static struct plat_sci_port scif2_platform_data = { + .mapbase = 0xfe620000, + .flags = UPF_BOOT_AUTOCONF, + .type = PORT_SCIF, + .irqs = { 76, 77, 79, 78 }, +}; + +static struct platform_device scif2_device = { + .name = "sh-sci", + .id = 2, + .dev = { + .platform_data = &scif2_platform_data, + }, +}; + +static struct plat_sci_port sci0_platform_data = { + .mapbase = 0xfe480000, + .flags = UPF_BOOT_AUTOCONF, + .type = PORT_SCI, + .irqs = { 80, 81, 82, 0 }, +}; + +static struct platform_device sci0_device = { + .name = "sh-sci", + .id = 3, + .dev = { + .platform_data = &sci0_platform_data, + }, +}; static struct platform_device *sh7760_devices[] __initdata = { - &sci_device, + &scif0_device, + &scif1_device, + &scif2_device, + &sci0_device, }; static int __init sh7760_devices_setup(void)