From patchwork Mon Jun 25 15:29:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10486755 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 489EC6038C for ; Mon, 25 Jun 2018 15:31:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38AE42862C for ; Mon, 25 Jun 2018 15:31:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D6C528610; Mon, 25 Jun 2018 15:31:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF1FA285EE for ; Mon, 25 Jun 2018 15:31:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934811AbeFYPbO (ORCPT ); Mon, 25 Jun 2018 11:31:14 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:55112 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752306AbeFYP36 (ORCPT ); Mon, 25 Jun 2018 11:29:58 -0400 Received: by mail-wm0-f68.google.com with SMTP id i139-v6so2803445wmf.4 for ; Mon, 25 Jun 2018 08:29:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4HAy4CFX12smc0TnD2wG3IULi/54eoKnvvMUZ/d29ys=; b=yy90DSrTj2fc+se71/phGT+Bi0iqLgeH+47AgNXRMDFRo5nlsZlI6V8D2BglJlPof0 ZmR6LNIyizmB3QB5s88o1EFfLY76gtgqr1TXU0r3PTmAtsdRnH0Mie39TjiSB5AWuLUk gEdza/vO0zlxoOt2baADuQMKbxtnBhwRG8iM2YwnrqsRQwpDSXmBfqmnRgU3HfTgtq5G twfziKYa6rPaoVJ3BUwW4wnvyICn+9ag8d4nSuYzLZ600o7eYomLzidHnSNw89yAAOtq /jJjrObJUlmw+unZ8LtfhDA2ue3A6hfz0rFMXEW/izzPlU8rwxnfUhIX8vOj5znMvRqu 0Rxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4HAy4CFX12smc0TnD2wG3IULi/54eoKnvvMUZ/d29ys=; b=VwGVQwflIgSVKR3WbPG4BOO0gNSdnOvMaWECdUJLUOdvPHZufM21M9yQ/48GF7Vhsg 58zTV7M03N/EILqNExDIF9Lla6/IMzufQhtKD8vFT3VRwavoJh9bTBHab8HxO/mDZHBj ikhvVFhMOkoJ+4XCpoksIoLpSoRmHK0F6Xl3o8C3SoeckOGJ8uOm+DM6NnNxf7N/8tXE wSaeJqLr1q8xy/LfBa4uLLqJ4cuduW0z1RaGom6ysFlRaiOa1oIAwgGUiyOZ//eHxPAz rDYQcw5rjIUZiXMnwGl8Xy3nMVT+kGF+AsTVwv+M2UuLqRRmUXAaXjJ+T1MXkbyceghQ +BGA== X-Gm-Message-State: APt69E1fu0QSUGJL0Aaq7RxWKrL3E3rZySm5N9bxGdRqV6XUwbYa4Rpd ChJK0NrRLcvU+77yhv8nQ11gVg== X-Google-Smtp-Source: AAOMgpedQ5dk47B4slfXXD4+Fsl+JjrfVb01jcZ7D6Sl4FLyy1cEs/SEZaGjSqff3xkNf8V5h6AdIA== X-Received: by 2002:a1c:ea4a:: with SMTP id i71-v6mr1302968wmh.158.1529940597620; Mon, 25 Jun 2018 08:29:57 -0700 (PDT) Received: from brgl-bgdev.home ([2a01:cb1d:af:5b00:e837:b8d5:48c1:571b]) by smtp.gmail.com with ESMTPSA id l15-v6sm18829174wrs.95.2018.06.25.08.29.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 08:29:57 -0700 (PDT) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , Russell King , David Lechner , Michael Turquette , Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 7/9] ARM: davinci: dm646x-evm: use aemif platform driver Date: Mon, 25 Jun 2018 17:29:18 +0200 Message-Id: <20180625152920.11549-8-brgl@bgdev.pl> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180625152920.11549-1-brgl@bgdev.pl> References: <20180625152920.11549-1-brgl@bgdev.pl> Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski We now support board files in the aemif driver. Register a platform device instead of using the handcrafted API in dm646x-evm. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/board-dm646x-evm.c | 52 +++++++++++++++++++----- 1 file changed, 41 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c index 867ab2fa6cfd..99297e0612ba 100644 --- a/arch/arm/mach-davinci/board-dm646x-evm.c +++ b/arch/arm/mach-davinci/board-dm646x-evm.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -106,16 +107,47 @@ static struct resource davinci_nand_resources[] = { }, }; -static struct platform_device davinci_nand_device = { - .name = "davinci_nand", - .id = 0, +static struct platform_device davinci_aemif_devices[] = { + { + .name = "davinci_nand", + .id = 0, + .num_resources = ARRAY_SIZE(davinci_nand_resources), + .resource = davinci_nand_resources, + .dev = { + .platform_data = &davinci_nand_data, + }, + }, +}; + +static struct resource davinci_aemif_resources[] = { + { + .start = DM646X_ASYNC_EMIF_CONTROL_BASE, + .end = DM646X_ASYNC_EMIF_CONTROL_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, +}; - .num_resources = ARRAY_SIZE(davinci_nand_resources), - .resource = davinci_nand_resources, +static struct aemif_abus_data davinci_aemif_abus_data[] = { + { + .cs = 1, + }, +}; - .dev = { - .platform_data = &davinci_nand_data, +static struct aemif_platform_data davinci_aemif_pdata = { + .abus_data = davinci_aemif_abus_data, + .num_abus_data = ARRAY_SIZE(davinci_aemif_abus_data), + .sub_devices = davinci_aemif_devices, + .num_sub_devices = ARRAY_SIZE(davinci_aemif_devices), +}; + +static struct platform_device davinci_aemif_device = { + .name = "ti-aemif", + .dev = { + .platform_data = &davinci_aemif_pdata, }, + .resource = davinci_aemif_resources, + .num_resources = ARRAY_SIZE(davinci_aemif_resources), + .id = -1, }; #define HAS_ATA (IS_ENABLED(CONFIG_BLK_DEV_PALMCHIP_BK3710) || \ @@ -793,10 +825,8 @@ static __init void evm_init(void) if (machine_is_davinci_dm6467tevm()) davinci_nand_data.timing = &dm6467tevm_nandflash_timing; - platform_device_register(&davinci_nand_device); - - if (davinci_aemif_setup(&davinci_nand_device)) - pr_warn("%s: Cannot configure AEMIF.\n", __func__); + if (platform_device_register(&davinci_aemif_device)) + pr_warn("%s: Cannot register AEMIF device.\n", __func__); dm646x_init_edma(dm646x_edma_rsv);