From patchwork Wed Jan 21 15:15:03 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 3468 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 n0LFCGP4023131 for ; Wed, 21 Jan 2009 07:12:26 -0800 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754733AbZAUPRD (ORCPT ); Wed, 21 Jan 2009 10:17:03 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756123AbZAUPRB (ORCPT ); Wed, 21 Jan 2009 10:17:01 -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 S1754733AbZAUPRA (ORCPT ); Wed, 21 Jan 2009 10:17:00 -0500 Received: by rv-out-0506.google.com with SMTP id k40so3654714rvb.1 for ; Wed, 21 Jan 2009 07:16:59 -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=Akm4jiGxL4cparX/iNjSqSJuT34uVSwdqpNurkMmw48=; b=Gh4squzlBXZi4RFBpYd1fUSQOlB3Hl8oDq/i+YVSsH6rfxzPW9rjAyR4znGMrU+6Lg UiT2ncbykytCHlE7ZGxYF3bApOWym/ZCP0VsPFCz/Zns1e/SKy4kAsjU9oANaG8/RLCV EW9UWo3xyXkSOFZk9FAiFYNbCxwEYPGduswlc= 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=OsAgUOxr6XEztefPQ6kE7g/NbK200id4Q8hOXdSwXQME1pFhB+4SFlKO5VihVVJTjF K+nuYlrS6s7zyGOU6wI9c4zbdNHwer/qetTb3h2n/0sLSV2iHSQj3Efu+qRZ9nphAYek eLZQPwBakYGTkHVGCrISLzT2IVHtlya25cNNM= Received: by 10.140.207.2 with SMTP id e2mr2279666rvg.251.1232551019829; Wed, 21 Jan 2009 07:16:59 -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 b39sm6558528rvf.0.2009.01.21.07.16.57 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 21 Jan 2009 07:16:58 -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:03 +0900 Message-Id: <20090121151503.29269.174.sendpatchset@rx1.opensource.se> In-Reply-To: <20090121151334.29269.55519.sendpatchset@rx1.opensource.se> References: <20090121151334.29269.55519.sendpatchset@rx1.opensource.se> Subject: [PATCH 011/013] sh-sci: convert sh3 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 sh3 processors such as: sh770x, sh7705, sh7710 and sh7720 Signed-off-by: Magnus Damm --- arch/sh/kernel/cpu/sh3/setup-sh7705.c | 43 +++++++++++-------- arch/sh/kernel/cpu/sh3/setup-sh770x.c | 72 +++++++++++++++++++++------------ arch/sh/kernel/cpu/sh3/setup-sh7710.c | 42 +++++++++++-------- arch/sh/kernel/cpu/sh3/setup-sh7720.c | 42 +++++++++++-------- 4 files changed, 120 insertions(+), 79 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/sh3/setup-sh7705.c +++ work/arch/sh/kernel/cpu/sh3/setup-sh7705.c 2009-01-21 22:33:15.000000000 +0900 @@ -81,27 +81,33 @@ static struct intc_prio_reg prio_registe static DECLARE_INTC_DESC(intc_desc, "sh7705", vectors, groups, NULL, prio_registers, NULL); -static struct plat_sci_port sci_platform_data[] = { - { - .mapbase = 0xa4410000, - .flags = UPF_BOOT_AUTOCONF, - .type = PORT_SCIF, - .irqs = { 56, 57, 59 }, - }, { - .mapbase = 0xa4400000, - .flags = UPF_BOOT_AUTOCONF, - .type = PORT_SCIF, - .irqs = { 52, 53, 55 }, - }, { - .flags = 0, - } +static struct plat_sci_port scif0_platform_data = { + .mapbase = 0xa4410000, + .flags = UPF_BOOT_AUTOCONF, + .type = PORT_SCIF, + .irqs = { 56, 57, 59 }, }; -static struct platform_device sci_device = { +static struct platform_device scif0_device = { .name = "sh-sci", - .id = -1, + .id = 0, + .dev = { + .platform_data = &scif0_platform_data, + }, +}; + +static struct plat_sci_port scif1_platform_data = { + .mapbase = 0xa4400000, + .flags = UPF_BOOT_AUTOCONF, + .type = PORT_SCIF, + .irqs = { 52, 53, 55 }, +}; + +static struct platform_device scif1_device = { + .name = "sh-sci", + .id = 1, .dev = { - .platform_data = sci_platform_data, + .platform_data = &scif1_platform_data, }, }; @@ -140,7 +146,8 @@ static struct platform_device rtc_device }; static struct platform_device *sh7705_devices[] __initdata = { - &sci_device, + &scif0_device, + &scif1_device, &rtc_device, }; --- 0001/arch/sh/kernel/cpu/sh3/setup-sh770x.c +++ work/arch/sh/kernel/cpu/sh3/setup-sh770x.c 2009-01-21 22:31:46.000000000 +0900 @@ -131,47 +131,69 @@ static struct platform_device rtc_device .resource = rtc_resources, }; -static struct plat_sci_port sci_platform_data[] = { - { - .mapbase = 0xfffffe80, - .flags = UPF_BOOT_AUTOCONF, - .type = PORT_SCI, - .irqs = { 23, 24, 25, 0 }, +static struct plat_sci_port sci0_platform_data = { + .mapbase = 0xfffffe80, + .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, }, +}; + #if defined(CONFIG_CPU_SUBTYPE_SH7706) || \ defined(CONFIG_CPU_SUBTYPE_SH7707) || \ defined(CONFIG_CPU_SUBTYPE_SH7709) - { - .mapbase = 0xa4000150, - .flags = UPF_BOOT_AUTOCONF, - .type = PORT_SCIF, - .irqs = { 56, 57, 59, 58 }, +static struct plat_sci_port scif0_platform_data = { + .mapbase = 0xa4000150, + .flags = UPF_BOOT_AUTOCONF, + .type = PORT_SCIF, + .irqs = { 56, 57, 59, 58 }, +}; + +static struct platform_device scif0_device = { + .name = "sh-sci", + .id = 1, + .dev = { + .platform_data = &scif0_platform_data, }, +}; #endif + #if defined(CONFIG_CPU_SUBTYPE_SH7707) || \ defined(CONFIG_CPU_SUBTYPE_SH7709) - { - .mapbase = 0xa4000140, - .flags = UPF_BOOT_AUTOCONF, - .type = PORT_IRDA, - .irqs = { 52, 53, 55, 54 }, - }, -#endif - { - .flags = 0, - } +static struct plat_sci_port irda0_platform_data = { + .mapbase = 0xa4000140, + .flags = UPF_BOOT_AUTOCONF, + .type = PORT_IRDA, + .irqs = { 52, 53, 55, 54 }, }; -static struct platform_device sci_device = { +static struct platform_device irda0_device = { .name = "sh-sci", - .id = -1, + .id = 2, .dev = { - .platform_data = sci_platform_data, + .platform_data = &irda0_platform_data, }, }; +#endif static struct platform_device *sh770x_devices[] __initdata = { - &sci_device, + &sci0_device, +#if defined(CONFIG_CPU_SUBTYPE_SH7706) || \ + defined(CONFIG_CPU_SUBTYPE_SH7707) || \ + defined(CONFIG_CPU_SUBTYPE_SH7709) + &scif0_device, +#endif +#if defined(CONFIG_CPU_SUBTYPE_SH7707) || \ + defined(CONFIG_CPU_SUBTYPE_SH7709) + &irda0_device, +#endif &rtc_device, }; --- 0001/arch/sh/kernel/cpu/sh3/setup-sh7710.c +++ work/arch/sh/kernel/cpu/sh3/setup-sh7710.c 2009-01-21 22:35:11.000000000 +0900 @@ -122,33 +122,39 @@ static struct platform_device rtc_device }, }; -static struct plat_sci_port sci_platform_data[] = { - { - .mapbase = 0xa4400000, - .flags = UPF_BOOT_AUTOCONF, - .type = PORT_SCIF, - .irqs = { 52, 53, 55, 54 }, - }, { - .mapbase = 0xa4410000, - .flags = UPF_BOOT_AUTOCONF, - .type = PORT_SCIF, - .irqs = { 56, 57, 59, 58 }, - }, { +static struct plat_sci_port scif0_platform_data = { + .mapbase = 0xa4400000, + .flags = UPF_BOOT_AUTOCONF, + .type = PORT_SCIF, + .irqs = { 52, 53, 55, 54 }, +}; + +static struct platform_device scif0_device = { + .name = "sh-sci", + .id = 0, + .dev = { + .platform_data = &scif0_platform_data, + }, +}; - .flags = 0, - } +static struct plat_sci_port scif1_platform_data = { + .mapbase = 0xa4410000, + .flags = UPF_BOOT_AUTOCONF, + .type = PORT_SCIF, + .irqs = { 56, 57, 59, 58 }, }; -static struct platform_device sci_device = { +static struct platform_device scif1_device = { .name = "sh-sci", - .id = -1, + .id = 1, .dev = { - .platform_data = sci_platform_data, + .platform_data = &scif1_platform_data, }, }; static struct platform_device *sh7710_devices[] __initdata = { - &sci_device, + &scif0_device, + &scif1_device, &rtc_device, }; --- 0001/arch/sh/kernel/cpu/sh3/setup-sh7720.c +++ work/arch/sh/kernel/cpu/sh3/setup-sh7720.c 2009-01-21 22:35:56.000000000 +0900 @@ -56,28 +56,33 @@ static struct platform_device rtc_device }, }; -static struct plat_sci_port sci_platform_data[] = { - { - .mapbase = 0xa4430000, - .flags = UPF_BOOT_AUTOCONF, - .type = PORT_SCIF, - .irqs = { 80, 80, 80, 80 }, - }, { - .mapbase = 0xa4438000, - .flags = UPF_BOOT_AUTOCONF, - .type = PORT_SCIF, - .irqs = { 81, 81, 81, 81 }, - }, { +static struct plat_sci_port scif0_platform_data = { + .mapbase = 0xa4430000, + .flags = UPF_BOOT_AUTOCONF, + .type = PORT_SCIF, + .irqs = { 80, 80, 80, 80 }, +}; - .flags = 0, - } +static struct platform_device scif0_device = { + .name = "sh-sci", + .id = 0, + .dev = { + .platform_data = &scif0_platform_data, + }, }; -static struct platform_device sci_device = { +static struct plat_sci_port scif1_platform_data = { + .mapbase = 0xa4438000, + .flags = UPF_BOOT_AUTOCONF, + .type = PORT_SCIF, + .irqs = { 81, 81, 81, 81 }, +}; + +static struct platform_device scif1_device = { .name = "sh-sci", - .id = -1, + .id = 1, .dev = { - .platform_data = sci_platform_data, + .platform_data = &scif1_platform_data, }, }; @@ -134,7 +139,8 @@ static struct platform_device usbf_devic static struct platform_device *sh7720_devices[] __initdata = { &rtc_device, - &sci_device, + &scif0_device, + &scif1_device, &usb_ohci_device, &usbf_device, };