Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5400728imu; Tue, 13 Nov 2018 06:06:51 -0800 (PST) X-Google-Smtp-Source: AJdET5ekT6RNAL2PCPRbKkgxVCxeroG8UnmJYPzdtob0ESvRdffbOPzcfMb0ACTEEnPMU07ji2KY X-Received: by 2002:a65:42c2:: with SMTP id l2-v6mr4629409pgp.139.1542118011835; Tue, 13 Nov 2018 06:06:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542118011; cv=none; d=google.com; s=arc-20160816; b=E/Icvb7Mlw1GksLL3jnIAXSVEuskCGiTRSHHCMsi5IcfPZ0EuwqL4/27Ng+hmMavoM KPbiM5EgFusjLOodzoNRRa2uj5KCccc950Qiz7lRl2QEhf2ZdgUXTndJeMeCwihTwJYF oFQgzkUfz+tmonA/SlA2Wc3+PRpTcwgIlKnjlq7TcIRS9+z/XZWVtKqtqD0XGOZq50MH ln3wmnd45ZndSSGpoWRrc94c/XnOx227VJn58N/kiB/8k8QI0m3YCtShbF5bZbVF9+NN tCAXO+6STO6y4Bd3anPLEUhdNPD/AHRXVXyazzSxLxassibm7krW0Igorp6oyLKj0Ezx UFIg== 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=2dGXQZPFaTjyJ9mbBpSbIbBRV6cQuE8HcUaZBf8FEvM=; b=NyI7GYSM/V078FjftMH4WZ4GR/IZxqYv5Ia4EnHAnYZD1SztKol6Im/HZHKenMZi1s nZH4Wrtte1jlNVlS2GSUoMrFmCZ+jhrzx+JdYx5ArMwZW1OGVkQiUwyXLft3wIDjbz52 WEpiZcAfPNgjawEFciU93M22jpS6Jjb/piPWIYyPiZchdu4sikHUWbXwBnseFEcD0INY UdijEDG7T0+NUesDli67VH4R+CCIvIThrBAsttOljrNxa6C1hTTAlPfEPm1trPB/aABQ C4xd0cbpr4COje0ow/WV9dHac/D4QY7V1HcwDcj6vMi1GEiRtHX4OmsGZXp3jLJkK3pT he2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b="vO//26UF"; 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 f4-v6si23780733plm.393.2018.11.13.06.06.20; Tue, 13 Nov 2018 06:06:51 -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="vO//26UF"; 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 S2387840AbeKNAA1 (ORCPT + 99 others); Tue, 13 Nov 2018 19:00:27 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:36207 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387798AbeKNAA0 (ORCPT ); Tue, 13 Nov 2018 19:00:26 -0500 Received: by mail-wr1-f68.google.com with SMTP id z13-v6so13445544wrs.3 for ; Tue, 13 Nov 2018 06:02:08 -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=2dGXQZPFaTjyJ9mbBpSbIbBRV6cQuE8HcUaZBf8FEvM=; b=vO//26UF3txJxtF/2FCpjLmGd2dVHLNEN4upAAl6DlwQOZBtNjhOd7m652wyigewuB vM70iRUYi0eXzIuma6nuWHxed3jdh3GzpMtfIPEC4if70duX2MOLSrKqeyCb4B1NkQFd S4Iw7UqriQGMsUqkEUlNPbXVL67xhSoRsr/VUXn9jIrZDbuYqXqBRjFJ3oxg4wQI0UYt ZGeBxHJVDGPjsSvBiBB5fXl876Km+cBW4QVdOqGUEd3PKnd4TqpXzW/aOoHVuhZenq/2 jYbvQYQCdWm0F/1iiDJXRnO4wC0gN7YNSNaulIS4pX7pw3JCdligOFr9VfFpSXGs9MM7 T1Ig== 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=2dGXQZPFaTjyJ9mbBpSbIbBRV6cQuE8HcUaZBf8FEvM=; b=USdiiDKHmZjyIE/DiHd3jjGRUTEkR8mRygdiQ/l4htDd6v8iiK42WakOr4epXO3bTQ 40MFeV/aWjP8xXCXfkHEHplux+JgbvubGFEHrJXG6ouIp/+6OW2f/4DtGicSnJ9bjf9D 3Eur/bR/TZ3CIZSSECeG2th6aRtK+hTaEmtQY+aB9brZpZCcgXXwL7Dc9OKaF/60tjGu iIfigECnu4jAj24t5UDLVNQgKYrahGz2cF2RAdA0PdKYvAPyJ365UnpDSK1iiGFyzYBn 3VgXbjNODRslM2gycFwrIL9/4BAtDkgoODInhq3OYO5mXN0jNT58dDe1aIkkPUJJNQyi Ds8w== X-Gm-Message-State: AGRZ1gLOzU+Rpo24HZn3I0IJTCnjWOPyhLUt5lKHkb2ovQbXj49TzEfj lv4BId2m4ZpaE9tpXPsnpZV7McJG1uQ= X-Received: by 2002:adf:eb0b:: with SMTP id s11-v6mr5037323wrn.102.1542117728193; Tue, 13 Nov 2018 06:02:08 -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.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Nov 2018 06:02:07 -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 08/25] ARM: davinci: dm850-evm: use cell nvmem lookup for mac address Date: Tue, 13 Nov 2018 15:01:16 +0100 Message-Id: <20181113140133.17385-9-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-da850-evm.c | 29 +++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index e1a949b47306..bac2162e2153 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -100,6 +101,31 @@ static struct mtd_partition da850evm_spiflash_part[] = { }, }; +static struct nvmem_cell_info da850evm_nvmem_cells[] = { + { + .name = "macaddr", + .offset = 0x0, + .bytes = ETH_ALEN, + } +}; + +static struct nvmem_cell_table da850evm_nvmem_cell_table = { + /* + * The nvmem name differs from the partition name because of the + * internal works of the nvmem framework. + */ + .nvmem_name = "MAC-Address0", + .cells = da850evm_nvmem_cells, + .ncells = ARRAY_SIZE(da850evm_nvmem_cells), +}; + +static struct nvmem_cell_lookup da850evm_nvmem_cell_lookup = { + .nvmem_name = "MAC-Address0", + .cell_name = "macaddr", + .dev_id = "davinci_emac.1", + .con_id = "mac-address", +}; + static struct flash_platform_data da850evm_spiflash_data = { .name = "m25p80", .parts = da850evm_spiflash_part, @@ -1395,6 +1421,9 @@ static __init void da850_evm_init(void) davinci_serial_init(da8xx_serial_device); + nvmem_add_cell_table(&da850evm_nvmem_cell_table); + nvmem_add_cell_lookups(&da850evm_nvmem_cell_lookup, 1); + i2c_register_board_info(1, da850_evm_i2c_devices, ARRAY_SIZE(da850_evm_i2c_devices)); -- 2.19.1