From patchwork Mon Feb 24 07:52:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 3706931 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 482D59F2F7 for ; Mon, 24 Feb 2014 07:52:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 714962015A for ; Mon, 24 Feb 2014 07:52:20 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7452320154 for ; Mon, 24 Feb 2014 07:52:19 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WHqJz-0001Pk-J1; Mon, 24 Feb 2014 07:51:28 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WHqJp-00028l-2m; Mon, 24 Feb 2014 07:51:17 +0000 Received: from mail-pa0-x231.google.com ([2607:f8b0:400e:c03::231]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WHqJj-000272-1A for linux-arm-kernel@lists.infradead.org; Mon, 24 Feb 2014 07:51:12 +0000 Received: by mail-pa0-f49.google.com with SMTP id hz1so6192460pad.36 for ; Sun, 23 Feb 2014 23:50:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:date:message-id:in-reply-to:references:subject; bh=3O4/XHQ/2mqdAh6+hKnaHIGSAe9YumJnarxlFeVpjj4=; b=uubZ6sgS+arspWVlTnVT5v3B/HLOBaDO6rLNFDc3+tBNHkgUZbCHZ5CvapAoWt4I7K gaTcIYI1QyyxN34ZVAwgwTxcg8OXp1XqFXmW95GTT4aPpzy0eLaHr0cA42eT2gyqSKsu znQYOnDm5HAKRZPPg5Leq4ZzkboOh3aYsyy/zIVMwNAcVBVkUdffTMeJmuERon7l6ww0 kIZahvMAP5z6ef4ZZwsrUuphzJByqI7sybk3Gt2tF5N1zVjZmCq/9260EuXRA2q+cOUg pKsaWZ9nbGXd5YQJbv25dRttyssi4kC9W2rCpTzhjkbqP1fUP7UGrJjIcsdQtNnzzxWy Nlbw== X-Received: by 10.66.49.74 with SMTP id s10mr23844088pan.0.1393228249303; Sun, 23 Feb 2014 23:50:49 -0800 (PST) Received: from [127.0.0.1] (s214090.ppp.asahi-net.or.jp. [220.157.214.90]) by mx.google.com with ESMTPSA id e6sm47256712pbg.4.2014.02.23.23.50.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Feb 2014 23:50:48 -0800 (PST) From: Magnus Damm To: linux-sh@vger.kernel.org Date: Mon, 24 Feb 2014 16:52:03 +0900 Message-Id: <20140224075203.20255.88334.sendpatchset@w520> In-Reply-To: <20140224075144.20255.59443.sendpatchset@w520> References: <20140224075144.20255.59443.sendpatchset@w520> Subject: [PATCH 02/02] ARM: shmobile: Lager DT USB PCI platform devices X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140224_025111_216613_49DA11C5 X-CRM114-Status: GOOD ( 12.91 ) X-Spam-Score: -2.0 (--) Cc: horms@verge.net.au, Magnus Damm , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Magnus Damm Add USB1 and USB2 as PCI USB platform devices to the Lager DT Reference board code. For this to work the PFC needs to be configured separately via board specific DT code. The Lager legacy code supports USB1 and USB2 already, and this patch is moving us one step closer to being able to have equal software support level for legacy Lager and DT reference Lager. The goal is to be able to retire the legacy Lager code and to use DT to describe all devices including these PCI USB devices. Plenty of complex bining work is however needed for 4 different interconnected pieces of USB hardware, so in the mean time use platform devices to allow us to retire legacy code sooner. Signed-off-by: Magnus Damm --- Depends on "[PATCH 00/03] ARM: shmobile: Break out and extend clock workaround" arch/arm/mach-shmobile/board-lager-reference.c | 46 ++++++++++++++++++++++++ 1 file changed, 46 insertions(+) --- 0018/arch/arm/mach-shmobile/board-lager-reference.c +++ work/arch/arm/mach-shmobile/board-lager-reference.c 2014-02-24 16:35:28.000000000 +0900 @@ -85,6 +85,44 @@ static void __init lager_add_du_device(v platform_device_register_full(&info); } +/* Internal PCI1 */ +static const struct resource pci1_resources[] __initconst = { + DEFINE_RES_MEM(0xee0b0000, 0x10000), /* CFG */ + DEFINE_RES_MEM(0xee0a0000, 0x10000), /* MEM */ + DEFINE_RES_IRQ(gic_spi(112)), +}; + +static const struct platform_device_info pci1_info __initconst = { + .parent = &platform_bus, + .name = "pci-rcar-gen2", + .id = 1, + .res = pci1_resources, + .num_res = ARRAY_SIZE(pci1_resources), + .dma_mask = DMA_BIT_MASK(32), +}; + +/* Internal PCI2 */ +static const struct resource pci2_resources[] __initconst = { + DEFINE_RES_MEM(0xee0d0000, 0x10000), /* CFG */ + DEFINE_RES_MEM(0xee0c0000, 0x10000), /* MEM */ + DEFINE_RES_IRQ(gic_spi(113)), +}; + +static const struct platform_device_info pci2_info __initconst = { + .parent = &platform_bus, + .name = "pci-rcar-gen2", + .id = 2, + .res = pci2_resources, + .num_res = ARRAY_SIZE(pci2_resources), + .dma_mask = DMA_BIT_MASK(32), +}; + +static void __init lager_add_usb1_usb2_devices(void) +{ + platform_device_register_full(&pci1_info); + platform_device_register_full(&pci2_info); +} + /* * This is a really crude hack to provide clkdev support to platform * devices until they get moved to DT. @@ -108,6 +146,11 @@ static const struct clk_name clk_names[] { "lvds1", "lvds.1", "rcar-du-r8a7790" }, }; +static const struct clk_name clk_ena_names[] = { + { "ehci", NULL, "pci-rcar-gen2.1" }, + { "ehci", NULL, "pci-rcar-gen2.2" }, +}; + static void __init lager_add_standard_devices(void) { shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false); @@ -115,6 +158,9 @@ static void __init lager_add_standard_de of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); lager_add_du_device(); + + shmobile_clk_workaround(clk_ena_names, ARRAY_SIZE(clk_ena_names), true); + lager_add_usb1_usb2_devices(); } static const char *lager_boards_compat_dt[] __initdata = {