Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp4026242imm; Mon, 25 Jun 2018 08:31:29 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKWk/5ik6uXua+M78rcAcsQrpbrfbhFZjUuU/lPvAVafBY36CBEJ868BdYH+R7pi7Ly+82I X-Received: by 2002:a62:1c43:: with SMTP id c64-v6mr13501292pfc.176.1529940689116; Mon, 25 Jun 2018 08:31:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529940689; cv=none; d=google.com; s=arc-20160816; b=RX9WFCLy+EP2ZFZJaqFp6JmO7hOd+EI/j3U9VQRN7XbwsHG3Se33v7MMywHUDuaI/9 3OBtaEyTyuH0gbg9BvRxgbOKI76V3r+TDRx6geqfLCLxbs0qXjelvmieYyNlIymkwy4M /AldYqscS3Y+3AMMA+sSriMz2GGzOen5DVayuIcAXPT2aL//2j7TaSk0Pq09YP6pbDwI MG05U3O9uzRsM/SxxgKQWOFJyHZ1k78/w6HgCyj1xXUFfSobAsa/FBohN2SMGmnduSrS 38CJzaQlRa5HWow3pEBmsud6Bc3bdt7KWe0SXxkRJWt1FgaNCsQJOaOx0P4c39nOq/Ip XbOg== 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=WiqV9M76Gh7uIiyGVv/zVGJ/wBPqBjAK4YHV4jg0FP4=; b=jqm0UabaV2eyiWTL6vXttx+sLD5ppsZx5+cEHZA495VpxPZJ3uzoQcaY3xCUd+tLGE gojrru0jw8yDrN7DTrY2DM32RLRVBSuvCBpgweqin4158F4EXUWuQHnh/SutzoGHWqil 5eugZHAjdmn1wchV7xDBpBCR2FgpeSVRDihIioaY7tuCq4yPGxM8WIqISGbk9VXMOUV4 lpPynjUVOzeblfgRQmx4gg+8aVo6LxQdZnhbHvaMo6DgYmlRbfwOdIOBBPHXAfKSaKaX uDr8qIbYoC++N7LpNUlfefGeROQFh5GhTs2deT3nd+BIC3KCaEFPGcaesyyWwzwM1H+a rztw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=M3kqkFCS; 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 u10-v6si11605752pgc.261.2018.06.25.08.31.14; Mon, 25 Jun 2018 08:31:29 -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=M3kqkFCS; 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 S1752695AbeFYPaC (ORCPT + 99 others); Mon, 25 Jun 2018 11:30:02 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:37359 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752248AbeFYP34 (ORCPT ); Mon, 25 Jun 2018 11:29:56 -0400 Received: by mail-wm0-f65.google.com with SMTP id r125-v6so10493451wmg.2 for ; Mon, 25 Jun 2018 08:29:56 -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=WiqV9M76Gh7uIiyGVv/zVGJ/wBPqBjAK4YHV4jg0FP4=; b=M3kqkFCSe6bRY/PbE20zNLP/1xem3I5D+YfzQShygp9W1urnnmrH7V+VudIzwNHvaN 8TZRNM6BesGBKYECkmGq8ctjeIQspnDFmalHE6sk7oUu4gS6wjVB5XaH+nRmBI6OCdKZ NL9QjtmHXsUHjGaVo2iOB5tcamErzT4Xb70aAGJG0VwBxouzYdCDuuzybvsqFSff8cWT ezMRqFL2jdRKkq1Ey0e5rd5xGIwWx8ACBhfrIR6smx+CYIeVJFxarxufRdVlBfryglnC Qqwq6bZGt8JN9d8AWn7rLxci4rDpACjvgjldFHPNnosquaY1HYfppuVdPCINAjsQ760k xR9g== 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=WiqV9M76Gh7uIiyGVv/zVGJ/wBPqBjAK4YHV4jg0FP4=; b=rtlm2iYkUFfc3RruxMgEAXvtouWJTKxUcWDkbPo5r17GofpN0bGRQifNuwbMImn52U +WoXSKtnGA0UTkZO1MoTXTE0NgT8n2fqOhmTM/X5myp/kMyt6qIszSqv8k3HOzHKKrUb u/hPWD7ZXW7NbGNKL1KjfSqmvHEYtGPmLhQw5BnhBKgLFL3PJjvG3UEEgFL5wj3u20KW 6vXRbRiptmxtqeZdbN1cK0WPRPHDMIL0VXB1PYRUjHAVAreJ1Rw8y7B7ALIbzxKG1DdM f70dYH8wlhTIlut5CJD+DwDKAZ0EZa1M5xwlcLJxVY1zLfa3ZK90HT/IdR5taFq3J7nS RwUw== X-Gm-Message-State: APt69E0Xunb44+bynDomIMDED7FItvqTFODJ0toz2kS//DTDcpRO0mdo ikql9y0TUMh5tZFzhFOTjPsMnw== X-Received: by 2002:a1c:b80a:: with SMTP id i10-v6mr1442182wmf.123.1529940595526; Mon, 25 Jun 2018 08:29:55 -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.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 08:29: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 5/9] ARM: davinci: dm644x-evm: use aemif platform driver Date: Mon, 25 Jun 2018 17:29:16 +0200 Message-Id: <20180625152920.11549-6-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-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 dm644x-evm. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/board-dm644x-evm.c | 55 ++++++++++++++++++------ 1 file changed, 42 insertions(+), 13 deletions(-) diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c index 738e443ab15f..e3556708c71b 100644 --- a/arch/arm/mach-davinci/board-dm644x-evm.c +++ b/arch/arm/mach-davinci/board-dm644x-evm.c @@ -42,6 +42,7 @@ #include #include #include +#include #include "davinci.h" @@ -174,14 +175,47 @@ static struct resource davinci_evm_nandflash_resource[] = { }, }; -static struct platform_device davinci_evm_nandflash_device = { - .name = "davinci_nand", - .id = 0, - .dev = { - .platform_data = &davinci_evm_nandflash_data, +static struct resource davinci_evm_aemif_resource[] = { + { + .start = DM644X_ASYNC_EMIF_CONTROL_BASE, + .end = DM644X_ASYNC_EMIF_CONTROL_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, }, - .num_resources = ARRAY_SIZE(davinci_evm_nandflash_resource), - .resource = davinci_evm_nandflash_resource, +}; + +static struct aemif_abus_data davinci_evm_aemif_abus_data[] = { + { + .cs = 1, + }, +}; + +static struct platform_device davinci_evm_nandflash_devices[] = { + { + .name = "davinci_nand", + .id = 0, + .dev = { + .platform_data = &davinci_evm_nandflash_data, + }, + .num_resources = ARRAY_SIZE(davinci_evm_nandflash_resource), + .resource = davinci_evm_nandflash_resource, + }, +}; + +static struct aemif_platform_data davinci_evm_aemif_pdata = { + .abus_data = davinci_evm_aemif_abus_data, + .num_abus_data = ARRAY_SIZE(davinci_evm_aemif_abus_data), + .sub_devices = davinci_evm_nandflash_devices, + .num_sub_devices = ARRAY_SIZE(davinci_evm_nandflash_devices), +}; + +static struct platform_device davinci_evm_aemif_device = { + .name = "ti-aemif", + .dev = { + .platform_data = &davinci_evm_aemif_pdata, + }, + .resource = davinci_evm_aemif_resource, + .num_resources = ARRAY_SIZE(davinci_evm_aemif_resource), + .id = -1, }; static u64 davinci_fb_dma_mask = DMA_BIT_MASK(32); @@ -795,12 +829,7 @@ static __init void davinci_evm_init(void) /* only one device will be jumpered and detected */ if (HAS_NAND) { - platform_device_register(&davinci_evm_nandflash_device); - - if (davinci_aemif_setup(&davinci_evm_nandflash_device)) - pr_warn("%s: Cannot configure AEMIF\n", - __func__); - + platform_device_register(&davinci_evm_aemif_device); #ifdef CONFIG_I2C evm_leds[7].default_trigger = "nand-disk"; #endif -- 2.17.1