Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp970918imm; Wed, 8 Aug 2018 08:38:53 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwY0Z3vre4TiX7EcRGV5NLGtPjq1ZzogCsz5q4saEZmDbLdrEVJHK+UWC9kK1wS1S9S0C2v X-Received: by 2002:a65:4c41:: with SMTP id l1-v6mr3124242pgr.310.1533742733185; Wed, 08 Aug 2018 08:38:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533742733; cv=none; d=google.com; s=arc-20160816; b=Wrj+8ITE+rDWJdBG3jps0zE3/g2C8M7gEbqOssWkNEQ3Jy/Ltcx4LDifUA80ELOeCl 7Lrkj8a5TwCqLQ6bse/zRgGTHTVK7D6nZlQwu0X5UPh4tmOIqorSEI4yKOXxRfBbJ/j6 tvYXMV2ZkcdOZO3ZFv93CyY9nf8M9mRw8JtjX+0EjsiiKwG4rokdDyqqhJSOiuL+gxRu IkmpgZAYcRDJdLrx9TJnywIqcT7cVl9967cuNGzcSElm1nrQqhAVXcQAaW4/BkNto0BU TfnqRFLyNx5vXXzqo9vXFNJxv1dmiqcPc/owCL0uKkvLTMeHY2Y1SXxels5AkRm7gmOu pXyg== 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=M1Y0k8yg6LkE42kBgEu8z4hZ3QzPjKDqtPQtWaHz3vfAitMg8/tRo84kJzpzpbYbLA e7X/h5QikfpG6IiVyX7Bwr4TRug3xCwQg6IAbicsmjiJXTmpbUSdqYNTcpAuIKOHqcAQ dI43rTj5R58OWyyjGbAYjDVDedRTYxX61VabZHQNavzvP3+TmYSnUy1difeSeaFjpRf5 RvJUmMccbtVKDvYC6jq9A7HLtF8MbERe2ex4KihGP6fFFK4GTWQvoK0R4ad20a4HQKdI 8Wgb5ULMT6qIGjiXBj3sFLWcgX4CqXvprlBDuQSjekpPceOcw55yCLNiEjomkYwseD+Z eSYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b="cggQzO/9"; 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 s29-v6si4992665pfj.43.2018.08.08.08.38.38; Wed, 08 Aug 2018 08:38:53 -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="cggQzO/9"; 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 S1729199AbeHHRyC (ORCPT + 99 others); Wed, 8 Aug 2018 13:54:02 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:53272 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728747AbeHHRyC (ORCPT ); Wed, 8 Aug 2018 13:54:02 -0400 Received: by mail-wm0-f66.google.com with SMTP id s9-v6so3185327wmh.3 for ; Wed, 08 Aug 2018 08:33: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=sGOzUdYoefHsqeEVpETOZKTrsiIrdDWkhYzQ4MVNoLM=; b=cggQzO/93LG4Ij5L8Kjw5OtZD4R+Xn3/ud7uGfm7stR4t8PLMuetQby1uNWl5BKucN QMOLDiJ4WpC+U2Oc3FdrskC6mzJf1HtRqbVHEj5/5PVTWEXYXj3Yvk7NNnePH2DEtMuE +2wpkQL3LNoeXXs4tJD7yhDN2tow7d8UMWQpexy4kW4It+dSr7gKyHDkdNOcRhGoLw4W IDdkLta2tMmDtN3uV+mB8/W7LTT8kaQxqvPlD7p3WIQQFOTAs3pbF+mbSOmF/wXmexrL ZdTgaH9cgz182EEdjbpP+Pg95mtV1DZ6B0SXyt1fTm9cTCgR6o4Ezihybw0cR9NSkEf/ 143w== 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=IALYEphaZ48MX2mqtvgXzEi1vttTJ1LC1gFyEkdMFLEIQMYk28CYFFKTm8Qi3V7sYd pTLrGnAiKBzowyCWlEU0ZKhpc6RgK0mY8tSa7WtAssvJTfnfQM1IFzVA4r96/MxX/usX Mu3RMEP1hT4eMePUd/qVN+lKGXnhBdNjPGGccJ/y+uSAVXB1zasCOh6Ir+TVaKifoWxV zaw4+pYX13qHisnDlZ2ar6I2v1xUQJcMxIuzPkEeX8KkdG2psrq8U/qV+nqesNOUVLsy XRAFK7dWZx4iVfjTVPkYqHNTIL4L18k+NfvmjJtkZYUOYk1Qjfc2O95CFL66i+BTmhba H76Q== X-Gm-Message-State: AOUpUlEHpBqiHddKFoYr2XHTww/tXTngW9kU+MyoYSsRiStp1JaMwArN YT4rUKlVhTD/eCbOeD1GXIJn6w== X-Received: by 2002:a1c:ed1a:: with SMTP id l26-v6mr2298030wmh.61.1533742430519; Wed, 08 Aug 2018 08:33:50 -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 s2-v6sm5240915wrw.52.2018.08.08.08.33.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Aug 2018 08:33:49 -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 12/28] ARM: davinci: da850-evm: use nvmem lookup for mac address Date: Wed, 8 Aug 2018 17:31:34 +0200 Message-Id: <20180808153150.23444-13-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180808153150.23444-1-brgl@bgdev.pl> References: <20180808153150.23444-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