Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp7722536imm; Thu, 28 Jun 2018 08:20:49 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdy7RzDEabbFwtdETVbRDmq+8b2i3tooB1N54LwDBIxHCLviN5oOkFqEMOhSdmy9DISoGv/ X-Received: by 2002:a62:6303:: with SMTP id x3-v6mr10550760pfb.91.1530199249016; Thu, 28 Jun 2018 08:20:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530199248; cv=none; d=google.com; s=arc-20160816; b=EDzbYFNL+zPcO5qXOHWKQAVB8Z6Z+yNaOYJOxZkryKCeWoCPfRlvoHnfTOEtsB9Hd7 mcMqJZ7suIILIzpv7Un7NfaSbA8K43LFqcwIwp4fFPk/UpwMbzSww+BIvChnDVzE0+cX qoyCOrwOef6rsLQxUbkbr875JGkXB75TnqwN2q0d/mfUT+YWn8cZM5KyKDBI9z0G8hPR 8ZTIOB0MMleoOEtTLPNgzH11H7OU1Xcx/88cpN+UJ9AzjEXYQ1SbNaB3GHoEfw5r+oZT ddSzgPWiXJRlwu7fVGfLMtns0jzTAPTGVWoyFrx6jC1TvWzQQW7epoUPehT5ALhYM+xW mOOw== 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=DD+tegRkL77MXGQNOF6Vh7wMcrPvGgbRls6E01LtcQY=; b=axBb929CnTg9pBclOOMaq4B7mN4+vwHFxkWutkNQB3Z1KPvfzg4/GmklXZep90cWRI XTarxwTXl/h0s07LeC8MGYJCNIhjbwGqANx1luQ1TvSj7azt6TLa9oWgR2iZ9SIFvM3d NMEYaGmU7DwoV7pKAttAatpxMUJzvrbFgEGii7oiZvcLbeQA9Kf/kUT7w0hddMSU4Ntm sfybupQhmNmhEkGlroT446UNmodb+Lnt8MUKdisCgdAb+dIYFcUmh9WVhSuDbhR9zbSF qAqyekRPR5dmOiJoY1B7GsGnmnfJHN/utUtQWnEceqLpVl3wg+TxHKNugP6DX2I5eK1t CNzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=KAUxG9nV; 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 s4-v6si6250212pfb.208.2018.06.28.08.20.32; Thu, 28 Jun 2018 08:20:48 -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=KAUxG9nV; 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 S935311AbeF1J7N (ORCPT + 99 others); Thu, 28 Jun 2018 05:59:13 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:35440 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935258AbeF1J6H (ORCPT ); Thu, 28 Jun 2018 05:58:07 -0400 Received: by mail-wr0-f196.google.com with SMTP id c13-v6so4860395wrq.2 for ; Thu, 28 Jun 2018 02:58:07 -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=DD+tegRkL77MXGQNOF6Vh7wMcrPvGgbRls6E01LtcQY=; b=KAUxG9nVhpwOE6npDohIvKeIU9uaX0YQAD3Qnbf9S7LrKUyum7JrLlpZAbZ0FJZBqG LhZEj+cBnLqtFw/byt7jUHcxCcDzY/t8iUDz/Ffkj/GiNTGhEM48CvNwJDHwFi08j/5I /Ujg81yIV8PytUVHyCQ2lnCYRO169vkpHBmF+21fjOv1xJLdECciK0m/fjM75xBC30nX UPlRL1992Oy9BQ6wMoNfqjxjBjGQO68l7SrwMCoe30/RSqaRwdzs3MTbn//AeMnXlZfX SmGvNpN5HH73pW69nMewkqCnKNGj38YiYqjzKexO3VmZwrzRnLAD1Ms0VfQuhqY5Ssch Nbvg== 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=DD+tegRkL77MXGQNOF6Vh7wMcrPvGgbRls6E01LtcQY=; b=l5y+c6dKUISZ18AREtWhGMUz4Hq3iSK/7b0ugMY97Dnuwyi6GPEQYGGzqpJy5viSYG /hV36XyePxwAObkmK1e+90dGTUJQOIex27zbF4USw9uV1IYMQc2rPanzBkhS1RZDNrIo Cg5r2QmBl4Ls85Q84IeNUCWRX4vX9cBN54TCZcy0Tq74sE4nUMgycsuaQA9rgUcw99w3 bWXj49KThBU8p7Go8PHbthr5mUUN2kULBrjkv3W7AzDyzp3OAmK22vKg/Z45onwioYv0 pY1yLMH/wjomZ7hitHCLc3teUaGsYe8jmAPkTL5RyC5jMQa8ftoMJC1cO41ntnqkdQxq ZiKg== X-Gm-Message-State: APt69E2Yrd9jgIHp4Lr5dlDAjgc7xhVoL9GYqlS2nITr2oIsMuEs2AoK HPKG+T7Zj6bJ8bm8occ7uSIQwQ== X-Received: by 2002:adf:a14a:: with SMTP id r10-v6mr7952775wrr.104.1530179886538; Thu, 28 Jun 2018 02:58:06 -0700 (PDT) Received: from brgl-bgdev.baylibre.local (AStLambert-681-1-87-41.w90-86.abo.wanadoo.fr. [90.86.29.41]) by smtp.gmail.com with ESMTPSA id s8-v6sm1550352wrm.84.2018.06.28.02.58.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 02:58:06 -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 v3 10/13] ARM: davinci: da830-evm: use aemif platform driver Date: Thu, 28 Jun 2018 11:57:45 +0200 Message-Id: <20180628095748.4462-11-brgl@bgdev.pl> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180628095748.4462-1-brgl@bgdev.pl> References: <20180628095748.4462-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 da830-evm. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/board-da830-evm.c | 56 +++++++++++++++++++------ 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c index b2470141dba3..7d8ab36ff83d 100644 --- a/arch/arm/mach-davinci/board-da830-evm.c +++ b/arch/arm/mach-davinci/board-da830-evm.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -333,14 +334,48 @@ static struct resource da830_evm_nand_resources[] = { }, }; -static struct platform_device da830_evm_nand_device = { - .name = "davinci_nand", - .id = 1, - .dev = { - .platform_data = &da830_evm_nand_pdata, +static struct platform_device da830_evm_aemif_devices[] = { + { + .name = "davinci_nand", + .id = 1, + .dev = { + .platform_data = &da830_evm_nand_pdata, + }, + .num_resources = ARRAY_SIZE(da830_evm_nand_resources), + .resource = da830_evm_nand_resources, + }, +}; + +static struct resource da830_evm_aemif_resource[] = { + { + .start = DA8XX_AEMIF_CTL_BASE, + .end = DA8XX_AEMIF_CTL_BASE + SZ_32K - 1, + .flags = IORESOURCE_MEM, + }, +}; + +static struct aemif_abus_data da830_evm_aemif_abus_data[] = { + { + .cs = 3, }, - .num_resources = ARRAY_SIZE(da830_evm_nand_resources), - .resource = da830_evm_nand_resources, +}; + +static struct aemif_platform_data da830_evm_aemif_pdata = { + .abus_data = da830_evm_aemif_abus_data, + .num_abus_data = ARRAY_SIZE(da830_evm_aemif_abus_data), + .sub_devices = da830_evm_aemif_devices, + .num_sub_devices = ARRAY_SIZE(da830_evm_aemif_devices), + .cs_offset = 2, +}; + +static struct platform_device da830_evm_aemif_device = { + .name = "ti-aemif", + .id = -1, + .dev = { + .platform_data = &da830_evm_aemif_pdata, + }, + .resource = da830_evm_aemif_resource, + .num_resources = ARRAY_SIZE(da830_evm_aemif_resource), }; /* @@ -371,12 +406,9 @@ static inline void da830_evm_init_nand(int mux_mode) if (ret) pr_warn("%s: emif25 mux setup failed: %d\n", __func__, ret); - ret = platform_device_register(&da830_evm_nand_device); + ret = platform_device_register(&da830_evm_aemif_device); if (ret) - pr_warn("%s: NAND device not registered\n", __func__); - - if (davinci_aemif_setup(&da830_evm_nand_device)) - pr_warn("%s: Cannot configure AEMIF\n", __func__); + pr_warn("%s: AEMIF device not registered\n", __func__); gpio_direction_output(mux_mode, 1); } -- 2.17.1