From patchwork Tue Jun 26 09:25:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10488461 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6440D602D8 for ; Tue, 26 Jun 2018 09:27:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F5902884E for ; Tue, 26 Jun 2018 09:27:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5442328857; Tue, 26 Jun 2018 09:27:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F251B2884E for ; Tue, 26 Jun 2018 09:27:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932629AbeFZJ0a (ORCPT ); Tue, 26 Jun 2018 05:26:30 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:52550 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934390AbeFZJZw (ORCPT ); Tue, 26 Jun 2018 05:25:52 -0400 Received: by mail-wm0-f65.google.com with SMTP id p126-v6so1053059wmb.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=UHpL7seIRKziiLLG4Je5zpYA000zx/vmPkSRamzz+5QjOTV01IvPyTkoOy8u/O28bc 4ZvOAtKVHSkPmtLLRT7FnVNe55A8s+CIgIFekbTI0MF9TUmR5voJkaprjziU+0gN4Ueb abZXzjhMj7uAwcTWM+xncZdiXQR+fW44NGOft5PPLWSerD60kNKO4aU6KJrWnqtYAi0p PSLVvL1/iu7CIKznQ4lB84DN9SW65A2LokbSrqh+cNzCuGOS6o/LxBAiznUYf1ANi/bD +xc8fauXo5Ubx9jvOC/FwXDkJ6p0MOsr9r7ouDpmGiQVrvv3YRF+DC3oTSnhriJQeMyP AvFA== X-Gm-Message-State: APt69E2hZ5ynf6i5nyNswsV7VOW6CEwBxpY4GSTvsQ5C6FMasgpTtcLx Hlj2rBMi4r0rXRyl9gA8h0dJQQ== X-Google-Smtp-Source: AAOMgpfMqBXCpsGq8UfqnCo7BKqMlWyhJjZMFq/3B54ysZGp2ThyQZwWsOp3VMolIVXoZVGQCgIoFQ== 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-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 */ }