Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp4901392imm; Tue, 26 Jun 2018 02:29:32 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIno2toNSGWXp8kecr0/Sx24xh6uHMkiBYMjGPInF4kreuepQBlChYpeiJcf7kbKzosRZoF X-Received: by 2002:a65:42c2:: with SMTP id l2-v6mr655831pgp.237.1530005372376; Tue, 26 Jun 2018 02:29:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530005372; cv=none; d=google.com; s=arc-20160816; b=iL16Zk1lvR83VALqijVo3DWybtaVu9jmhSWGR7AqzDFmh90Mdfo9bgu6A4HhhdQ4zh 7zM310fkl10E7ojMogIFqr0gvHdsA7DKwFZhuCVZiKn43SLtB2eXh7O7B0Ayox32ABIq 0gQmqJn15J0DpwjqUEJ2M41E/d3bM9lhlFvKN+NGTxH680I7+/eJVDq2jwpNwcD1RliF kHQhPjq0d5dXo5z+bBiWnNuBC8vif5qXP6McCClsbaZ5NorIlS/H8vU7uCp5Kizr0MkO vDT4Qrw5DJ6n75X1Au8+S4jxqgnmZeu/plDPoMLRUpZqrd7+L6IQaEP+J9P+fVXWpOfn ZcJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=xn0TQaIyLWB0HDP/8rvd9dfNDRKBIZ2xXAWWSdTqIuQ=; b=g9p+W/hZ1D9LT5tI7lg1WxQfb72ftRBFpj/qZ5bkekbzswy3PYImuFdC02nIVKJMW0 HM5kxNV6wrhN0Wo4yVHztE5TxFVbkCbzVo8C7pDeJkTAfSAE0ierh0UQIlckNs64oK0K 3XAdzDpEp6GzZb5vlGO2y/liid6tsXfrece0ifnqmMshBzLTB0p4sZoaze4pY5o+fA3N HPOu1I3qJ/P8AjDtvb7sLX/Xunzi9hOwKX7PvL8i3xX7hkpA1AaQU/5FWhqpJk/54mu4 bmg1AUAaKNLGIRSHVE84eBbwbjdGbCNVIvbDxt+8CHScqDdtpXM/fJwB3uoG7HscoXOt S58Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b="Mg/GUTML"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q18-v6si993117pgt.529.2018.06.26.02.29.18; Tue, 26 Jun 2018 02:29:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b="Mg/GUTML"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934471AbeFZJ00 (ORCPT + 99 others); Tue, 26 Jun 2018 05:26:26 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:56248 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934041AbeFZJZ4 (ORCPT ); Tue, 26 Jun 2018 05:25:56 -0400 Received: by mail-wm0-f68.google.com with SMTP id v16-v6so1045137wmv.5 for ; Tue, 26 Jun 2018 02:25:55 -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=xn0TQaIyLWB0HDP/8rvd9dfNDRKBIZ2xXAWWSdTqIuQ=; b=Mg/GUTML7xgHHaFwRyjTiq+9FxusLfdhUJSUavvhg/SiD0DoAAxZL4w1SN3RVfsS49 y79kb4zGgQvgF0mfHpI51mVDkxJ4Em9HN96M5OfWw1l086YyW/tdyGbRQepFb4BRKtqp YOXgp7m1YriQUKhyMUn1baIh/9vjfJ7S6Wbrp/90faebhRFR9nt3n0HZkOzlD1TuRXdC 6491Pf5PhEj0h/GJJ6iV2RmWc1WbtfT1Kqtw8UeT8gdaOYRTfT/LWB0DlAFPSz1UJyrY 6wrSVfAMiQZLa0ezzKGnD5O06yELhcRq3mDqbjnEp/xC6mTS3vJYX184hqyVeGfqkvoZ 372w== 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=xn0TQaIyLWB0HDP/8rvd9dfNDRKBIZ2xXAWWSdTqIuQ=; b=jfCfgTCYV8OtUqEgtMUWmo7Df7UN2hGbTcLqm04Qa7qgMlBx3M2rhKanmhzTgqVgCH yuNn3Q8PUWVi6TLAXGLklLpSZS5ss07qTs+IalhbbiBVg5PGatXMSfGsKYp71540C89d bbw+t/fslL2YcfDMXeLXjQ4zYN8dryq4XHFul+VLxPy726oCGlXo0y2WfVNGHH/npidB 43i2iwnmKxKLrx9fuR1NcBL5Entd+BIDHuxjVrRQOG4PKA8E0pJDBkIb1J++pCmJmQdC jJyprnyLaHZiAnFrlnmvVK8scNvmwSyRH/K2K3V5+jAPZ0tbixgrDvD1Q0gvtB/rAoTt kJRg== X-Gm-Message-State: APt69E2UDJItF/sZzBesiWlUl8/jiqfy0fJnitiGrf0tT6fmd+5rAN/c x/MurrC/FMMd7yJ1kGPXrHhO7w== X-Received: by 2002:a1c:d9d0:: with SMTP id q199-v6mr1000719wmg.78.1530005155070; Tue, 26 Jun 2018 02:25:55 -0700 (PDT) Received: from brgl-bgdev.lan (LFbn-NIC-1-55-10.w2-15.abo.wanadoo.fr. [2.15.147.10]) by smtp.gmail.com with ESMTPSA id a8-v6sm1528791wrn.50.2018.06.26.02.25.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jun 2018 02:25:54 -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 v2 12/13] ARM: davinci: mityomapl138: use aemif platform driver Date: Tue, 26 Jun 2018 11:25:36 +0200 Message-Id: <20180626092537.6737-13-brgl@bgdev.pl> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180626092537.6737-1-brgl@bgdev.pl> References: <20180626092537.6737-1-brgl@bgdev.pl> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bartosz Golaszewski We now support board files in the aemif driver. Register a platform device instead of using the handcrafted API in mityomapl138. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/board-mityomapl138.c | 55 ++++++++++++++++------ 1 file changed, 41 insertions(+), 14 deletions(-) diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c index 2cce0d7d2f2a..2933e0c87cfa 100644 --- a/arch/arm/mach-davinci/board-mityomapl138.c +++ b/arch/arm/mach-davinci/board-mityomapl138.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -422,27 +423,53 @@ static struct resource mityomapl138_nandflash_resource[] = { }, }; -static struct platform_device mityomapl138_nandflash_device = { - .name = "davinci_nand", - .id = 1, - .dev = { - .platform_data = &mityomapl138_nandflash_data, +static struct platform_device mityomapl138_aemif_devices[] = { + { + .name = "davinci_nand", + .id = 1, + .dev = { + .platform_data = &mityomapl138_nandflash_data, + }, + .num_resources = ARRAY_SIZE(mityomapl138_nandflash_resource), + .resource = mityomapl138_nandflash_resource, }, - .num_resources = ARRAY_SIZE(mityomapl138_nandflash_resource), - .resource = mityomapl138_nandflash_resource, }; -static struct platform_device *mityomapl138_devices[] __initdata = { - &mityomapl138_nandflash_device, +static struct resource mityomapl138_aemif_resources[] = { + { + .start = DA8XX_AEMIF_CTL_BASE, + .end = DA8XX_AEMIF_CTL_BASE + SZ_32K - 1, + .flags = IORESOURCE_MEM, + }, +}; + +static struct aemif_abus_data mityomapl138_aemif_abus_data[] = { + { + .cs = 1, + }, +}; + +static struct aemif_platform_data mityomapl138_aemif_pdata = { + .abus_data = mityomapl138_aemif_abus_data, + .num_abus_data = ARRAY_SIZE(mityomapl138_aemif_abus_data), + .sub_devices = mityomapl138_aemif_devices, + .num_sub_devices = ARRAY_SIZE(mityomapl138_aemif_devices), +}; + +static struct platform_device mityomapl138_aemif_device = { + .name = "ti-aemif", + .id = -1, + .dev = { + .platform_data = &mityomapl138_aemif_pdata, + }, + .resource = mityomapl138_aemif_resources, + .num_resources = ARRAY_SIZE(mityomapl138_aemif_resources), }; static void __init mityomapl138_setup_nand(void) { - platform_add_devices(mityomapl138_devices, - ARRAY_SIZE(mityomapl138_devices)); - - if (davinci_aemif_setup(&mityomapl138_nandflash_device)) - pr_warn("%s: Cannot configure AEMIF\n", __func__); + if (platform_device_register(&mityomapl138_aemif_device)) + pr_warn("%s: Cannot register AEMIF device\n", __func__); } static const short mityomap_mii_pins[] = { -- 2.17.1