Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3022689imm; Fri, 10 Aug 2018 02:21:06 -0700 (PDT) X-Google-Smtp-Source: AA+uWPweRXuUt+RHqXUYnh9bXoCDrtbwlsg46AlPvBnbDnyhbQJEoRKXEBVvu+JpLEJGlfhJnOca X-Received: by 2002:a62:8186:: with SMTP id t128-v6mr6256324pfd.192.1533892865952; Fri, 10 Aug 2018 02:21:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533892865; cv=none; d=google.com; s=arc-20160816; b=YVDQqYdJp6Wkcx3MFBHM/Ge2NB0hsXuHDB7Ax3X1E4Yh4lAUhGtRxmsKH8GlWXLrwm /HHAKxNoJqorvYMBN9cUX1ygjDK2xI1bZXP6jQZmhZJLcN55f72BZRuGXesdHvmiDoj5 v2Y4rLAFMiMdmbtah6ymHpx6XEsMemzcZ7BIiwcPFPxQaccxHOthRqDhIG9gxZqz/w6f Z8WxhfG6JTvreRbbf6aKzqPpD17fieqktiHcvfiCQUtjnZ7j1FnKND0epYTrInoRaHx7 E1Rq6XP4Frq7Fy8s+8xXUNj3M7A4e6gVRWo9T684bmUBmmkvNbd5OMwjJi4qAejoQCOs NR2Q== 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=sGOzUdYoefHsqeEVpETOZKTrsiIrdDWkhYzQ4MVNoLM=; b=CPjgjZbrAGJQix8N9DO744AT+d9Hck7u5pPc70okj4a+BIe6bOIcEXwIK+Rf5eFp9Q 62OP9dV4n/Zh3Hn3ZWXtBLuqre9yrkMdWlYoHwdhhtcbWFaOzCjTlE0+LixwARq4bB2e E3+lOYwHdGzZMw0bZYRryF9xtAdxjv5LKySlrP7K9D1YDqI7fwudWmjfcKa+FojgvBVC BitOJ/E47lY4rd5s7wQtQN0RJL3Dz3mX+tQhB6GiP1LQplg3KCrdPs92eHySqCzxPh2A hPlvUslZWes+bdUnyeftyzoG33/6YznnkqBIf4o+yp/HOf9ib30pFf4I4K87beSmmbtI 6MYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=yjBx+zay; 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 137-v6si10449967pfx.155.2018.08.10.02.20.49; Fri, 10 Aug 2018 02:21:05 -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=yjBx+zay; 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 S1728229AbeHJKeo (ORCPT + 99 others); Fri, 10 Aug 2018 06:34:44 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:52126 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728180AbeHJKem (ORCPT ); Fri, 10 Aug 2018 06:34:42 -0400 Received: by mail-wm0-f68.google.com with SMTP id y2-v6so935361wma.1 for ; Fri, 10 Aug 2018 01:05:56 -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=sGOzUdYoefHsqeEVpETOZKTrsiIrdDWkhYzQ4MVNoLM=; b=yjBx+zayQEOO94lbibSVMCOe8LuflnszJtTjXhxHxnNAfEX0Xojae3oYWgqq5tkr4d g3vCgx5kKCd3HlMGta/hSDM4hlMZeDKGze9JbxPuf/PDDu8UUkis04ZdQelg1yVeUtFi vk4sUINL4U61Sk9zgsAXBTlIpBRDXknHB8QEQ/fI8sd89ekAa34atOrHYtNajWFOdEH9 HmU/tx9YSxn0rar21U6iq197pLsU+1iYvjlJ9u0elZR2Cq543/JKhyfrkrda/dCICIM4 yE69m7ez2k7oT2VXpmM5FwqHfzFhc9rJkrK9OMEWcJGq6d8d++Po3ma+Qw27WEGDjbkg bVNQ== 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=sGOzUdYoefHsqeEVpETOZKTrsiIrdDWkhYzQ4MVNoLM=; b=k2YN2aOBl5BxzPpYUsjK24wQF1x754PbunnUPkp3l39pypXJ3uncI6w/xsv9h8BvWg g8FTPWqJGMJ1A1PB0pjWr4uCYkOSlyTr4uT+BgLL/FY5nxCAW2RWfLxF30mNx8ZcZ7eo zwH8rmeO7LgJzaXPHFU1QNnqb2Q3zgCJt5c/JKQW+H/byBGGsEAwLRfuUmZ91Wrm90xQ 56kyfMSz6uka5VB4sslq+oD6FefejmGXTIrcFaydue5ubmwfbd01fYFdRefjxCI6QExR 5yKm1jU4B4f36VFHyr9nBbwsxjzXaNISyPbFg6Uj43qA3Ugp73qdrDEcSIPDuuYe43tn 410A== X-Gm-Message-State: AOUpUlHWFigXXzxyCNBmdwqZbQ1wW+yjx93oS2SdwwxadHlstZqsB22z Y2CDTzkH3iGgltruXHQN3E6++A== X-Received: by 2002:a1c:2094:: with SMTP id g142-v6mr731584wmg.144.1533888355605; Fri, 10 Aug 2018 01:05:55 -0700 (PDT) Received: from brgl-bgdev.lan (LFbn-MAR-1-609-89.w90-118.abo.wanadoo.fr. [90.118.185.89]) by smtp.gmail.com with ESMTPSA id h7-v6sm9546405wrs.8.2018.08.10.01.05.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:05:54 -0700 (PDT) From: Bartosz Golaszewski To: Jonathan Corbet , Sekhar Nori , Kevin Hilman , Russell King , Arnd Bergmann , Greg Kroah-Hartman , David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , Grygorii Strashko , "David S . Miller" , Srinivas Kandagatla , Naren , Mauro Carvalho Chehab , Andrew Morton , Lukas Wunner , Dan Carpenter , Florian Fainelli , Ivan Khoronzhuk , Sven Van Asbroeck , Paolo Abeni , Alban Bedel , Rob Herring , David Lechner , Andrew Lunn Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, netdev@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v2 12/29] ARM: davinci: da850-evm: use nvmem lookup for mac address Date: Fri, 10 Aug 2018 10:05:09 +0200 Message-Id: <20180810080526.27207-13-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-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 nvmem lookups for machine code. Add a lookup for mac-address. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/board-da850-evm.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index 6d5beb11bd96..5a634a04ec69 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -99,6 +100,19 @@ static struct mtd_partition da850evm_spiflash_part[] = { }, }; +static struct nvmem_cell_lookup da850evm_mac_address_cell = { + .info = { + .name = "mac-address", + .offset = 0x0, + .bytes = ETH_ALEN, + }, + /* + * The nvmem name differs from the partition name because of the + * internal works of the nvmem framework. + */ + .nvmem_name = "MAC-Address0", +}; + static struct flash_platform_data da850evm_spiflash_data = { .name = "m25p80", .parts = da850evm_spiflash_part, @@ -1447,6 +1461,8 @@ static __init void da850_evm_init(void) pr_warn("%s: spi info registration failed: %d\n", __func__, ret); + nvmem_add_lookup_table(&da850evm_mac_address_cell, 1); + ret = da8xx_register_spi_bus(1, ARRAY_SIZE(da850evm_spi_info)); if (ret) pr_warn("%s: SPI 1 registration failed: %d\n", __func__, ret); -- 2.18.0