Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp4028996imm; Mon, 25 Jun 2018 08:33:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKS9ktAwLH6hhwN2CHlMDQmBZoiM2ylh0sFa/iOSIWV+jP7J2t8TJu7pxdvScTUpTYciPqe X-Received: by 2002:a62:5582:: with SMTP id j124-v6mr1299361pfb.20.1529940837665; Mon, 25 Jun 2018 08:33:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529940837; cv=none; d=google.com; s=arc-20160816; b=zc5zZ6D+N6y/OowZjdzbisp7ngqPw24BJg5AEwiemhT7B2/4rDQuuSOI4lfqf7TaTe h8sZVmXvlSJg4cd/tzZUMAOWuxC5QA2qQsBFIR/hpubqvvkJIwk/19ME1zAGEgBw18dF g+vyDfgr5vFeXFv22dfGIh7ffMVnWlxhKWZtYcNstWPWpNk0hbiD1zehXZUqlsNlXEa2 rygU7aPtma/L0FuTX+QLEgzzmlaf+HNatMyM/lNuEGUU7/YSGw9suY4J6ov7rbXP+qDq dW1ax/zpdQ1aKxHL+euJtBE9tRg9wIXiabAcGuUsD9HlaLVBa5QXlzG+sO6+k/ysMG/k RNfw== 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=ms5Z6SLZQlg5xNASHReMwsM7T1SdKNsJ9oPGqZasbmk=; b=SEgn1ILX9aCknRWBv6L1iSt2JxO0KqYs74IYtmRhThBtbFGrhLdLG/uYJafH8hOOS3 Tl9RVuXT3H7s06ecPXBclY0iTPX6YgbbSlrkK4uV4lm0lvpj5KaR/VPGMi0tpWLjXPLf E3DIIETo4YoCUbuQaTHTfuQom+MNNaPDzSPeq3br1M+BtLolDwv4i12aJKykJBIrLHvi UldGc9lLUd572bbMf30rYp6sCbA4i7nKJrKwPO6QZ0iwpH+bCSJuR55sQpOTs6tm76LX bu0+etcoUEvhJIJ2hITEqKccml7sKOvQ4hlerAwj9Ziu7ljyXh2Vi269X1FN2WiDc3cW O8zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=oMn7VjZ3; 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 k2-v6si12491241pgr.206.2018.06.25.08.33.42; Mon, 25 Jun 2018 08:33:57 -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=oMn7VjZ3; 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 S934891AbeFYPbV (ORCPT + 99 others); Mon, 25 Jun 2018 11:31:21 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34870 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752211AbeFYP3z (ORCPT ); Mon, 25 Jun 2018 11:29:55 -0400 Received: by mail-wm0-f68.google.com with SMTP id z137-v6so4794703wmc.0 for ; Mon, 25 Jun 2018 08:29: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=ms5Z6SLZQlg5xNASHReMwsM7T1SdKNsJ9oPGqZasbmk=; b=oMn7VjZ3gZtu3aRfQTLmdTiJO7t95bnlY+D0sOIxiATZTIHa7u4IqP09C9kr52PDnD POGpDebZLFolim6ybyxSsWCVDLCV1OXPaWZ7VJpGmge2i5kPcQ+NNjlJ020CjSWb7vDk //9FcUHy9omuwX8+aDruZn31xgUOWVj6eEn5OiiNsLP/Wp+cZIgs7IjSRySvlAPcEqsR cOEI0F/bDvTGlQKcGwEP/7/MmHwPsxYck/OoIv7rUenfNsWmuXtUPc52tOsR3s8T4a2b lShPLHNoRs4gDd0DNdqx2sCPEE33WM6UrweG3RB1uy5zd+8hMgLeqnYZBOlQGcN5T5P9 nOUw== 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=ms5Z6SLZQlg5xNASHReMwsM7T1SdKNsJ9oPGqZasbmk=; b=RugYb3fymXErqGTBeWJY7oMjjJvk9oZePR5Ww4iRehEItZ3xqbVN/ZfI7ndDUc8TsC wR0MF9BC2qhnNs3CgnRLb9UCzTDVx/Nb5Y1GkTyGflil3ggJPi2DzrfJABxL4dHcUkDc OLt9vhLYF4B/3ZKptfH4o/KTKg2xMThtLvYgPPlP+xjxFdDH5L7I4qw3KegMZGWTQQPa 2YnhzrahBQGgnRXujJV1ucPBs3vvpnOY/GmDxUrK0DGLXa4ff9DFh+ClusvSA/rxQcb2 MSqq2gI84cWXye7fsblHd//40uy7vRLA33eG7r5YNk8SWbaCdpGAmaSzs+tkYdsTXL5A +L+g== X-Gm-Message-State: APt69E08fxN//CwzZj0E/6coYOHh3ay6EZs9mmILyOEHZrZRm0Su0MEv ydD1zvW0C8tHgLBplLIrl+M73Q== X-Received: by 2002:a1c:8b52:: with SMTP id n79-v6mr1391436wmd.148.1529940594421; Mon, 25 Jun 2018 08:29:54 -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.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 08:29:53 -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 4/9] ARM: davinci: dm365-evm: use the ti-aemif soc driver Date: Mon, 25 Jun 2018 17:29:15 +0200 Message-Id: <20180625152920.11549-5-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 dm365-evm. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/board-dm365-evm.c | 59 +++++++++++++++++++------ 1 file changed, 46 insertions(+), 13 deletions(-) diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c index 307e88d99dd3..12b8d7b8c6b8 100644 --- a/arch/arm/mach-davinci/board-dm365-evm.c +++ b/arch/arm/mach-davinci/board-dm365-evm.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -159,14 +160,47 @@ static struct resource davinci_nand_resources[] = { }, }; -static struct platform_device davinci_nand_device = { - .name = "davinci_nand", - .id = 0, - .num_resources = ARRAY_SIZE(davinci_nand_resources), - .resource = davinci_nand_resources, - .dev = { - .platform_data = &davinci_nand_data, +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 = DM365_ASYNC_EMIF_CONTROL_BASE, + .end = DM365_ASYNC_EMIF_CONTROL_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, +}; + +static struct aemif_abus_data da850_evm_aemif_abus_data[] = { + { + .cs = 1, + }, +}; + +static struct aemif_platform_data davinci_aemif_pdata = { + .abus_data = da850_evm_aemif_abus_data, + .num_abus_data = ARRAY_SIZE(da850_evm_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, }; static struct at24_platform_data eeprom_info = { @@ -537,10 +571,6 @@ static void __init evm_init_i2c(void) i2c_register_board_info(1, i2c_info, ARRAY_SIZE(i2c_info)); } -static struct platform_device *dm365_evm_nand_devices[] __initdata = { - &davinci_nand_device, -}; - static inline int have_leds(void) { #ifdef CONFIG_LEDS_CLASS @@ -628,6 +658,7 @@ static void __init evm_init_cpld(void) u8 mux, resets; const char *label; struct clk *aemif_clk; + int rc; /* Make sure we can configure the CPLD through CS1. Then * leave it on for later access to MMC and LED registers. @@ -660,8 +691,10 @@ static void __init evm_init_cpld(void) /* external keypad mux */ mux |= BIT(7); - platform_add_devices(dm365_evm_nand_devices, - ARRAY_SIZE(dm365_evm_nand_devices)); + rc = platform_device_register(&davinci_aemif_device); + if (rc) + pr_warn("%s(): error registering the aemif device: %d\n", + __func__, rc); } else { /* no OneNAND support yet */ } -- 2.17.1