Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5401568imu; Tue, 13 Nov 2018 06:07:29 -0800 (PST) X-Google-Smtp-Source: AJdET5fZKbRc129niSmRmSeZcYpI0faAlCm0PF0EH1mJbvG5q1deHg3JvZ9WSepgEspDAGOCJUCj X-Received: by 2002:a17:902:ac8f:: with SMTP id h15mr134948plr.245.1542118049030; Tue, 13 Nov 2018 06:07:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542118049; cv=none; d=google.com; s=arc-20160816; b=lE0FnRURFhV8R6EhhCpeYiEbKFNI00+7+GIKP+GhXdhSQQ2f+rbUr4n2CpRFajUijV sJDy2BneiwHPcmi9OXPBDIhw3IccL5wEbSyzhSVm3c/jrW0iHdJMYk+0Uw26yPjsNNgc IIY++CStQ6T52siXsfKYSoA6/OTVLC6RndE5Fis1Z8IN8hxBaOcLYDZ0hiu8Evo+uB7q gRsbv3Yl1S+d74iK0hvMY7IR5Rms57Tn30cVagsVY2T6WygN3NhCKBq9plH104Vh8lgc UyRYWzVJjHdOwpf6CNjTIen4CgKfSnMlwJDbXmjrEepA7RtI7nZhxHFnTH5w5sR0TQ3F PXfw== 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=gfq4XRjjbAnhbxC0lgPGakIYrPJx0tENtiXKTaGI3BI=; b=SWL1tPL1V9kDo6FFza5OCANxk4poO//N7GmEpv3R8YUFYj0RVo51gSde2BoqT5swqk wOH7lEU5l05uyTBXuBGS9QUoK3YzCPb8Y1sgFJYOrx10JQxKND16du4hN+gTnOiPr0lR P5phwGEBZYvZU9T5XYJrspdm5dPF4dtN2Lfo06TSn6ZlXSvdG78nV+hSVXwUBvfZp7Zj 0AuLK+GUCsY5Ha+Q3MiwwM+dbu4Yrp6LRXV5FP7RPY7JwUkziAoWAb+qqbdaFmlspzt+ kpbmZc8xlKD7+1Q51TU0H0QhWtLDGAdH2iIqC7NdNmpk2Y7LMDD5DFv+tT7XbyuNCTL2 iWVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=flIOjd+6; 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 f1-v6si20375715pld.395.2018.11.13.06.06.56; Tue, 13 Nov 2018 06:07:28 -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=flIOjd+6; 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 S2387716AbeKNAAR (ORCPT + 99 others); Tue, 13 Nov 2018 19:00:17 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:55297 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387646AbeKNAAR (ORCPT ); Tue, 13 Nov 2018 19:00:17 -0500 Received: by mail-wm1-f66.google.com with SMTP id i73-v6so6743762wmd.5 for ; Tue, 13 Nov 2018 06:01:59 -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=gfq4XRjjbAnhbxC0lgPGakIYrPJx0tENtiXKTaGI3BI=; b=flIOjd+6kFlVvUssc1XI60NRDkppc7AOUcbQs8WkhSZGBtFjuBtU92y0kC3j5xhchk EipnF51qbtzluJ7dOwyp2IZKZnW0goqSf4MX/Em6jBiAZ4t4o9vhyxHZMfmAR5t+0HNB Ys3aiIuvhVa/+O3hF79UN7yh33qkyNEaBHuoHtVGfnGn5wbe9z2H+eo+f1Zc3FbVJmFH 8wnPA/EP0FnSaiP9QX43G6lCFSupgWHMp9SxOXaEZSK+jonH5iwJ7bJ9LqtGYSorTV7D +WVQzV15CLUc45vAnldhnf018i57oWUwEnopThjG6YXezJDiQrsT0rb0PF0ZQqXACH93 udbA== 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=gfq4XRjjbAnhbxC0lgPGakIYrPJx0tENtiXKTaGI3BI=; b=mxvqIWjFKEVOb/1imYxM5LDAwUSSnVW/rXsXOIsMXVc0qxNDynAglzszbr0jPTL6wm Lyj/4XsfyNtBLx343CjUMRwDb+kuTdz5nh18bhQmBfRgTvqfIN2hXNAkghQuFJwPeueN kSTfKpl19HpPE4+nnrbzQXm3QiNbwdfaLe2oV017iGpdXAKPHoHeAZBrsnVNDrmfX+85 c80PuPfUBNSbc6+UV1PIoOPhcO7rB6p/06bmJVkerre3EcwedBbFH3OlIwO3RHpS4zZA vWoGTtTzqIwYRpqrmm9VCxsgYrmrKKOaYFVPSH7YakzfzqzzD9U9IwIyItGi++bwqyT2 Jg3Q== X-Gm-Message-State: AGRZ1gLwPBNtAkd1pzxjAPSMkr/sq+XNDbrYcejytaE5kif71k9s0cjC /H/PVFTtCWoPajn0G0qovF7YJQ== X-Received: by 2002:a1c:58c5:: with SMTP id m188-v6mr3181760wmb.85.1542117718885; Tue, 13 Nov 2018 06:01:58 -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.01.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Nov 2018 06:01:58 -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 03/25] ARM: davinci: dm365-evm: use cell nvmem lookup for mac address Date: Tue, 13 Nov 2018 15:01:11 +0100 Message-Id: <20181113140133.17385-4-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-dm365-evm.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c index 8143756ff38b..8703fc18dd3b 100644 --- a/arch/arm/mach-davinci/board-dm365-evm.c +++ b/arch/arm/mach-davinci/board-dm365-evm.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -203,6 +204,27 @@ static struct platform_device davinci_aemif_device = { .num_resources = ARRAY_SIZE(davinci_aemif_resources), }; +static struct nvmem_cell_info davinci_nvmem_cells[] = { + { + .name = "macaddr", + .offset = 0x7f00, + .bytes = ETH_ALEN, + } +}; + +static struct nvmem_cell_table davinci_nvmem_cell_table = { + .nvmem_name = "1-00500", + .cells = davinci_nvmem_cells, + .ncells = ARRAY_SIZE(davinci_nvmem_cells), +}; + +static struct nvmem_cell_lookup davinci_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, @@ -781,6 +803,9 @@ static __init void dm365_evm_init(void) if (ret) pr_warn("%s: GPIO init failed: %d\n", __func__, ret); + nvmem_add_cell_table(&davinci_nvmem_cell_table); + nvmem_add_cell_lookups(&davinci_nvmem_cell_lookup, 1); + evm_init_i2c(); davinci_serial_init(dm365_serial_device); -- 2.19.1