From patchwork Tue Nov 13 14:01:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10680705 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6A38718F0 for ; Tue, 13 Nov 2018 14:02:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 599E72A99C for ; Tue, 13 Nov 2018 14:02:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5457B2A9B3; Tue, 13 Nov 2018 14:02:07 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham 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 ED0D02A9B4 for ; Tue, 13 Nov 2018 14:02:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387721AbeKNAAU (ORCPT ); Tue, 13 Nov 2018 19:00:20 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:37544 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387742AbeKNAAU (ORCPT ); Tue, 13 Nov 2018 19:00:20 -0500 Received: by mail-wm1-f67.google.com with SMTP id p2-v6so11484407wmc.2 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=fARghBEIEPsmlHHdfaPi4WDnPf7hGssZ8yGsG+/C1DyvRA1mp33oZyMgZiKe7n2LJY Jmq/Ysgcslby6VnTehUiBzdzL1ri2L1vuBTbcvnfIFqiivUU6hum0LSsfGUsf8TVumWX vn7VNVw9ZdjHgx5UB7IwE9QI8s7TeBptHJjyMgoBUhZHrad6XT5d5+7um/f0D7rjcu2t TgwkAHlRpxVvkXyyC6h/hSonVwb20lxzVv8n8cju01bCsFypsMImZ7cTjH2mpLZMAI61 g6D4kCpWeN0Wcep+zrkywBcyFW7dgXoJEKxM4CDSki8Kq5yTjK+9HQ5JvD0eyuRLO3SB yvfQ== X-Gm-Message-State: AGRZ1gLbPK9iTIiXY0/ju5y1YWkR42mI9P/ZNo4JHu2zIHBAyHSrf5eB ZCGd7CnvFmPBAAj7ZdexqP9ldg== X-Google-Smtp-Source: AJdET5eh9qS2xiVsYcwo2W/msU20vv4lzowJVug19BE2Xd2dwUU26CVKyFE+TK95TPRYawmJ6efSsg== 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 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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