Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5400911imu; Tue, 13 Nov 2018 06:07:00 -0800 (PST) X-Google-Smtp-Source: AJdET5d8/CBlUd6xA4OtJE2BlNffVpnI6Ou/cT9VI3DUHqaLrk+vCWCeLeexlhf0GRkcv7F7FZ/d X-Received: by 2002:a63:62c3:: with SMTP id w186mr4915778pgb.345.1542118020424; Tue, 13 Nov 2018 06:07:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542118020; cv=none; d=google.com; s=arc-20160816; b=Rk7bGZL5QoMs2g8xDvfMxHlkv0ze/XOpB0+HeoLhqbFV0luDy0kmfEm+IWUpKcCNSy J8781KJhlzZvC5Fc5ejNolGTIIRCERCjJ7ZFCbWzmfGI5zMWJ/ZUKqcFqR6aXApWrlmr uap7Ipzm6yO9fHtL57EoBt1sBAV0iQKrN6bHG82Ym/OTOVEyoeBQ+/gQgR6cvsZNpu1E 9wrde83j1ab8du61s5FwSidMunQ/XhLxqPVavkS2g//3iGCHrgkaQUwuUX0JS9BxCVSm +sOXzxN6DHnJpXE4adLHtZ0i3gzR2Xd17/Owtepzf5H8EClXZb1v2ndcabDf2KLZEbhU hdgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9klMrKm/3PJPsH9a0HqCufZa/6Vrvj6NDHHgs6SRwqk=; b=boNarw8bTf3swez74RvYPu6dJKMkeqUt+2TM5NBL9885wuzRvUMfOONdAsM6sWb8qB o9SE9JdaQZfnAA/iWOOxc0SvXQQfhgy9+GtkAFLcIMmpINkc7+g6cqEpqsdB/rK22U6w zvh5fWJTYpj3DwNCZbvoWx7+JemYQ+HRFJGyHN8CNybX5/jA/iLA2/Qv6jtfPP2vLZ37 U3wgVsHHfbl9GrJl+0XoZ5BkRCMP63W2z6HY7J3FqSNHfrxESnxspZZFfgdJ+m05UVt9 +Y2mxsHzvKXsOotKvF+Gp9dPOXM3DEWoBBbPhVPjCuWPZOP9uJEuyZt64LDrNB6nH/cj FKKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=jDdFw9kR; 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 o3-v6si22004300pld.329.2018.11.13.06.06.37; Tue, 13 Nov 2018 06:07:00 -0800 (PST) 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=jDdFw9kR; 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 S2387777AbeKNAAW (ORCPT + 99 others); Tue, 13 Nov 2018 19:00:22 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:55307 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387743AbeKNAAV (ORCPT ); Tue, 13 Nov 2018 19:00:21 -0500 Received: by mail-wm1-f66.google.com with SMTP id i73-v6so6744028wmd.5 for ; Tue, 13 Nov 2018 06:02:03 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=9klMrKm/3PJPsH9a0HqCufZa/6Vrvj6NDHHgs6SRwqk=; b=jDdFw9kRW9gcJvRRdAZyjHYhnvNLGzy+wQsmSewMZw3DgFsy0N44E2WjOqJg63UxgX 3Z7tsCFbJDX/A1LvBBFuQI7ansJBzUW3ylklFfSQDmxSjVvA5gYoOPZOtQr86pYHhn3b C6agZtyhqW6wai5t3iC9y1MVTAgU7XJLCDHokBZ0C8Xcg2D8ZF23aj4kDiyjyAoC1CuS fXrN48zjXbOe5evTX8KZwLoP9WuQT4+gM69XqzU8vucZ6Kf6NWOE6QzgnhQg7LXd05cQ UgKZEqOKo9bBDwcjVE93vxVDw3XSQ1UPjJg+nC0g8PCgbOcw38bnkfYgAWAH5G4tHsFP +4Jg== 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:mime-version:content-transfer-encoding; bh=9klMrKm/3PJPsH9a0HqCufZa/6Vrvj6NDHHgs6SRwqk=; b=Dtl2bViuodUElE+3559MdoMrgTuJQ4fgSWYZxi2567mPJlumHzBJZ7/PJYHiE2o75l FU+WPckcdz0iQi9GUgAYeocaFaylj3j0fXlyIYPRzvN2VpfgwEnw5frzxyGdCorrqIDV e1d+qIRTAiRb0LR3WglbtYyVUu+2q/doUBO9MJIW3xGZUsG55yFtdah3DVH9jAtB4t/a if/azkhHq0acwN+qpMzZrqM45Wwg1JwuAbBjdo/5xxNrNEfBrt3jYmWTQ26TrHkdJS+e P3IJSDLBaVqyo6sC4t0dqQnSvgrvsTpW9WiyHoEzaIFh0ZgxBoC5SNXYTavBDlRcmm/I 2kMw== X-Gm-Message-State: AGRZ1gKB61dvEUSF67qg9x8WZu/YOSODdFa1qgc+rx9wj+M2qX/bYAFC tyXBFuwII8Uq2pPyZMHkI03eFA== X-Received: by 2002:a1c:730b:: with SMTP id d11-v6mr3319072wmb.107.1542117722512; Tue, 13 Nov 2018 06:02:02 -0800 (PST) Received: from debian-brgl.home ([2a01:cb1d:af:5b00:6d6c:8493:1ab5:dad7]) by smtp.gmail.com with ESMTPSA id m69-v6sm16604122wmb.8.2018.11.13.06.02.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Nov 2018 06:02:01 -0800 (PST) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , Russell King , Arnd Bergmann , Greg Kroah-Hartman , David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , Nicolas Ferre , "David S . Miller" , Grygorii Strashko , Srinivas Kandagatla , Andrew Lunn , Florian Fainelli , Rob Herring , Frank Rowand , Wolfram Sang Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-mtd@lists.infradead.org, netdev@vger.kernel.org, linux-omap@vger.kernel.org, devicetree@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v2 05/25] ARM: davinci: dm646x-evm: use cell nvmem lookup for mac address Date: Tue, 13 Nov 2018 15:01:13 +0100 Message-Id: <20181113140133.17385-6-brgl@bgdev.pl> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181113140133.17385-1-brgl@bgdev.pl> References: <20181113140133.17385-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 nvmem lookups and cell definitions for machine code. Add relevant data structures for the mac-address stored in at24 EEPROM. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/board-dm646x-evm.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c index 3e5ee09ee717..8d5be6dd2019 100644 --- a/arch/arm/mach-davinci/board-dm646x-evm.c +++ b/arch/arm/mach-davinci/board-dm646x-evm.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -342,6 +343,27 @@ static struct pcf857x_platform_data pcf_data = { * - ... newer boards may have more */ +static struct nvmem_cell_info dm646x_evm_nvmem_cells[] = { + { + .name = "macaddr", + .offset = 0x7f00, + .bytes = ETH_ALEN, + } +}; + +static struct nvmem_cell_table dm646x_evm_nvmem_cell_table = { + .nvmem_name = "1-00500", + .cells = dm646x_evm_nvmem_cells, + .ncells = ARRAY_SIZE(dm646x_evm_nvmem_cells), +}; + +static struct nvmem_cell_lookup dm646x_evm_nvmem_cell_lookup = { + .nvmem_name = "1-00500", + .cell_name = "macaddr", + .dev_id = "davinci_emac.1", + .con_id = "mac-address", +}; + static struct at24_platform_data eeprom_info = { .byte_len = (256*1024) / 8, .page_size = 64, @@ -815,6 +837,8 @@ static __init void evm_init(void) pr_warn("%s: GPIO init failed: %d\n", __func__, ret); #ifdef CONFIG_I2C + nvmem_add_cell_table(&dm646x_evm_nvmem_cell_table); + nvmem_add_cell_lookups(&dm646x_evm_nvmem_cell_lookup, 1); evm_init_i2c(); #endif -- 2.19.1