Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp4900557imm; Tue, 26 Jun 2018 02:28:21 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcowmfkUKddR1jPtSaonO1OOyMBYvpbXU+RkV2S99VwTsLYaIVhnHLLvBmAWFlWkqh3lUId X-Received: by 2002:a62:4a51:: with SMTP id x78-v6mr681869pfa.45.1530005301536; Tue, 26 Jun 2018 02:28:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530005301; cv=none; d=google.com; s=arc-20160816; b=cmUN8MtYRxabtrSSpzxCKdDky8c+efkAMn7EdIVPcukwmpDDilh7WOTfjkUcSohnpG g9pjUOLcpshGMM5kKeV9+lSck7JTmcO0bIASuIjk80uQ3SbkhgfOq+0MSTFMcWO5hvAq U2a8R5zaFe2Y19ZVaA+K3aaZvhEXQYdH2FZrH9nPhXSh28KR3bC/0u4HwOnYegGzW++P qPUVG2Q0cnD/4l3AXpFfMPdHqUlz9Zz7LvlG3/Lsa5A5Z5ZSJnMvTb39CY+RAsHnlE1i 8rUjxloRSzzMOgxsNGZJShit/EymrrUdFFVlb2DM2ToKa2FZHNBvKXfLq9rGgMhcFm5R T7RQ== 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=aAipzPKBO632NJ0duDUioMPfNkzJ+t1E0zp4HTn+o8Y=; b=ApIhBH7x2d5CJHcqFG/xiYHNsSIlw8A42m5ITkuxwkZ/98C/ZLp8P9rT8z86Uw8hCK CVKXF+E6iJVGbRjCABrj1TOPMZk9VKcn/AD6bIgIHw82Hdcav09YlvGinShoTTR0sFY5 oofu4ZJCWNYTdZ7WB0T9Ak2jzhQk+cUuYQLjRYq9REbeuygmbXG1LiohRG9SAZtgHSPA zcxEHMjhrcVmL2pwloZaDJYiNEKfwHsgTYZXwMnoQlmDe5R2kN+9haIALe3oq1QjWPV9 KV8uaSpveX+a+7F/B3nzDDJL8fPzz/UVeomnJTsTalYsYftqjpzkvaN6Ks2RZworQg4V jJRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=XWnKCzAl; 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-v6si1023650pge.576.2018.06.26.02.28.07; Tue, 26 Jun 2018 02:28:21 -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=XWnKCzAl; 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 S964777AbeFZJ0e (ORCPT + 99 others); Tue, 26 Jun 2018 05:26:34 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:52551 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934389AbeFZJZw (ORCPT ); Tue, 26 Jun 2018 05:25:52 -0400 Received: by mail-wm0-f66.google.com with SMTP id p126-v6so1053061wmb.2 for ; Tue, 26 Jun 2018 02:25:51 -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=aAipzPKBO632NJ0duDUioMPfNkzJ+t1E0zp4HTn+o8Y=; b=XWnKCzAlHQrtDGa8f6Jf9MbUczaMRZ8F1q9LPiHjhUXj/Yf2F4o0kiQASvzBh9ayl5 DIbfarLqLplZD66kO2JjeQ+j6/SeNPv/zKsu8iGQEdyl88eUT76l0ec3KMbHp5NWM8NZ MiUPM7WO6VX5CxehIWMJtwY7+C2P4VIuhpbhC379/ybVnGdPUBgVCelCtEn8xgBOgYFY OoyAQBNzIRDM5xXzTife5WumtA7Bj6wW5bqwj2G5S8XcKhVulIVj0Fgcc/mw3UMOIjF/ 5tHxTZVv4Ou2RIwA2v0VWpDoXiTxVdyuyg8DyOiaH8cdSAK2Z1+ErSsNIuyyTdO77Wvs LDhw== 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=aAipzPKBO632NJ0duDUioMPfNkzJ+t1E0zp4HTn+o8Y=; b=eErgQUS5WEr7dyC71jxxB/PchQBLUQ/9FMdGJ5LWdoMnD9gdjuEKDWRBNVRca2Ubgj gbptU44uJ8f2Lv/6wcIqDuxBLMT0HNRFg+U8dclsmdvFGQ6cx+IxdwFkvpUqzF9mlR3p S1zOGeNj1UpiteD+yRaHPiUxOY80Ybkz41QSq5YueVCTI7LzSUZHvDzDXevn+wMMyrti yTTBaYkX2AGB9IJ1QjeN8juxSaPuS5FqX0egR8Rv2i4xXsj9VCevEJXCq7mqhhiak4E5 EkIfG5EvGwRvCYjd+DOFHqkSMRNKyNGbYNG0YfG8XlBaHlnU45kgZTKYIu8FxvQ9ZD6c wkBw== X-Gm-Message-State: APt69E2Qki/Vr/hspfcphOlPZjH3z9396nJD0qCRA0PsAYVCv5xxsH/i GxixJv+VU21PtTRl6UuG97ICVHXcf+U= X-Received: by 2002:a1c:bc3:: with SMTP id 186-v6mr1011439wml.39.1530005150656; Tue, 26 Jun 2018 02:25:50 -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.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jun 2018 02:25:50 -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 08/13] ARM: davinci: dm365-evm: use the ti-aemif soc driver Date: Tue, 26 Jun 2018 11:25:32 +0200 Message-Id: <20180626092537.6737-9-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 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..8143756ff38b 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", + .id = -1, + .dev = { + .platform_data = &davinci_aemif_pdata, }, + .resource = davinci_aemif_resources, + .num_resources = ARRAY_SIZE(davinci_aemif_resources), }; 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