Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5401004imu; Tue, 13 Nov 2018 06:07:05 -0800 (PST) X-Google-Smtp-Source: AJdET5dQCu4fxrbGgBYlrRbiCoSMqGr7EnHqJMMfE5aANx2/WHZ9dDQgYcKM5TeReTHUQwJvPZXP X-Received: by 2002:a63:5a57:: with SMTP id k23mr4836844pgm.5.1542118024938; Tue, 13 Nov 2018 06:07:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542118024; cv=none; d=google.com; s=arc-20160816; b=BnHhaaqIoQ7uDgFszou1AeVfC9j0i1YM0aUCJ2TkPwDUcclMNRtDVyUo3FaQo/+ooi fESPAN13Pmv6EFQr9KQZoEo3Tvfue5nRKpJijOacCNkeV5uX85MEJyNrdb1esJKFIkX2 VkrIhLjXDD8zTgcAYRpJrveTnx22UwfAMk80x+lHm/z8rKkvxAlFTvUqMSo9zv6+zZTY H8AZU+1SmS4I/sTS1vWVDyrZ7dlWQdWnC24OcNvlt9yEsg8OwXzA83VhmUBPvEJioRGn N4wBOxi/jC2uaeNvZPCRX4hi8eTRqKRGDy8wPdLgW7ZbEzENzgJ8lWPIDOWycYFb5Kg7 H2LQ== 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=MBcgf2nPd9qfbo4Sweh/oy//ofcxfsuOB7x8NJzIAM8=; b=sG1kI0StMH2ERpbaJjWF2ZEdCSbhAwux7/sEVl2fl00uTdxZDamNPPeN6vjxDtmThX TUIZStkNKAP/uTtDe5wohWu3ZGGXAqfoJCSTihDquWKAwyt/RcuInbP2h80HJLRvs8PK Xp7Gz6fBs8J8FiT3byQdtIV75onpH1lHVnOFA+ACeYE4em2sgy83J6IauKrVr5qdZhWs 1M0BybOZIT8kglRXDTlL7btDgfdFNENEfiwcr+jwTp5XEr3bj+Jnkc2Me+m9mMPbBkgt 5yGjf7uuStuH/F54eUck4ip4z+/qfnySTAvwwI38GTG+mGbQBXgt7vANeemS0FBzY7Gc dpug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=s82lrLNE; 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 w5-v6si23329811pfl.241.2018.11.13.06.06.33; Tue, 13 Nov 2018 06:07:04 -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=s82lrLNE; 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 S2388173AbeKNADa (ORCPT + 99 others); Tue, 13 Nov 2018 19:03:30 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:50839 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387763AbeKNAAW (ORCPT ); Tue, 13 Nov 2018 19:00:22 -0500 Received: by mail-wm1-f67.google.com with SMTP id 124-v6so12120157wmw.0 for ; Tue, 13 Nov 2018 06:02:05 -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=MBcgf2nPd9qfbo4Sweh/oy//ofcxfsuOB7x8NJzIAM8=; b=s82lrLNEYvwtPScP0erBPVI689DjeHX8K4Z2YOKi/1SbNbd5eo7CfaNHSJrgMzuut8 zO9Bk5ivNlOydFEoQPPxnbcqLp/U4mY2k4zRm7qjZMBma4vcA71t7SDjzF2DoXfqwRUk laP2HhyYakJMGwV8sacGOq2A3J7+j4hCQKw5rnguQdLzm4fWk1zrLnNZVbaPz6T8yl+D GEjGlToCDSuoQyN/7vRoBRg59OXWmif238qYqlvAuxVy+dukgnvPQqlnJBwOp3e6FNF0 5ax3cKWrCE+n/67huJiBalkiyMjGD5PL/H+thxMH3HmaxR5DpbPPGcTbx+wXAjfqxZ+I I6fg== 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=MBcgf2nPd9qfbo4Sweh/oy//ofcxfsuOB7x8NJzIAM8=; b=FJPhtBsvPiw/ICu2lsrE5D0ZRLWU1l7ClrecFFKqBt6kilPcPkGzHXrk07Mw2d+iiY R3BKMGK6D0tmK+Ve0Zpk9Ar+JOcUKM66LbrcEA1/Jqo/P7xgTgaxt6LVTpXYzb9ozriH u1C2S1+vXpmgjl0U/Erne2SJ3NN3aPDVXJNlBVbGS6HBkOqHpd/5zD+/u3N0JcZPAO7I 8PF+wi0hKH1Ba6431FdzGHWWwogzNno2CJmBBOr6CI1GGi305qP9kQDHxcWFToZRXjoH DD/g08HqMK3F0hjDEvop5qj0mOvmXGkyEwl0i7MarqJOsReWeV2nRT4aOsv2chXSu8eJ b6ig== X-Gm-Message-State: AGRZ1gIo+r/xKN1zLpvNsvaczjfAMLqvveLBjV5UG6LvudQ5G9WwvIKc PIDn++Hq2sYkrGTFfLgFZ6MWmg== X-Received: by 2002:a7b:c7d3:: with SMTP id z19-v6mr3147764wmk.151.1542117724688; Tue, 13 Nov 2018 06:02:04 -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.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Nov 2018 06:02:03 -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 06/25] ARM: davinci: da830-evm: use cell nvmem lookup for mac address Date: Tue, 13 Nov 2018 15:01:14 +0100 Message-Id: <20181113140133.17385-7-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-da830-evm.c | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c index 7d8ab36ff83d..e52ec1619b70 100644 --- a/arch/arm/mach-davinci/board-da830-evm.c +++ b/arch/arm/mach-davinci/board-da830-evm.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -435,6 +436,27 @@ static inline void da830_evm_init_lcdc(int mux_mode) static inline void da830_evm_init_lcdc(int mux_mode) { } #endif +static struct nvmem_cell_info da830_evm_nvmem_cells[] = { + { + .name = "macaddr", + .offset = 0x7f00, + .bytes = ETH_ALEN, + } +}; + +static struct nvmem_cell_table da830_evm_nvmem_cell_table = { + .nvmem_name = "1-00500", + .cells = da830_evm_nvmem_cells, + .ncells = ARRAY_SIZE(da830_evm_nvmem_cells), +}; + +static struct nvmem_cell_lookup da830_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 da830_evm_i2c_eeprom_info = { .byte_len = SZ_256K / 8, .page_size = 64, @@ -620,6 +642,10 @@ static __init void da830_evm_init(void) __func__, ret); davinci_serial_init(da8xx_serial_device); + + nvmem_add_cell_table(&da830_evm_nvmem_cell_table); + nvmem_add_cell_lookups(&da830_evm_nvmem_cell_lookup, 1); + i2c_register_board_info(1, da830_evm_i2c_devices, ARRAY_SIZE(da830_evm_i2c_devices)); -- 2.19.1