Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5403384imu; Tue, 13 Nov 2018 06:08:56 -0800 (PST) X-Google-Smtp-Source: AJdET5e0zNS5u8uqSvNnCq8QulDQ3ocVjzxk+meU40KsKV40JeOIhBqVr0gQ2W8LpUjetmJaVAKz X-Received: by 2002:a63:6a42:: with SMTP id f63-v6mr5022797pgc.48.1542118136142; Tue, 13 Nov 2018 06:08:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542118136; cv=none; d=google.com; s=arc-20160816; b=jyKr5qzBV4Kca+hVsLSp4O3hoEFOsWp+Jvcl2kvlRY0cohht4MEzf+Oi9nkYN1IwWd AI4w747ARyDMrf5VNHickGD3tkZZuFfzxExB7ug7ktf/f2+hNtf5B49TYq2Aj6tYAmPc WMTeF7pO12l+ySFCN/PPn7Sy2/FO+DFbzn+2ibYrYMPvz9cy4epb+uH2uGb7WMbToktF 4ryvnrfBByevVJyOAqnfi6v1iIaedsMVhePPgtNTXyg0dic1ApOEWOxE2Ve/8a5VzMhg 6ZMQiezKuwP/NUfxdzWoM4YTP3yN+oVvXH+87t1Vj7EaHOqIjYLawahKKrFqtg+EDZY0 60AA== 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=H8x7i2Y0NQGhPOwYVcZG4ieMSrsXoI3OcuJ/XVYngLQ=; b=rauSHASCFvSsWE5jdJVuj1kwB5qECvFXFhhERx2bxX0+NETlHzJM7tiQBfE7/QkgYx Lfgx98wT+ru1LvTWD01Isq1/goiJ2J0B4TtLHAOP++1MNdRQkxnsVbOVJ0Ga6Ax9mj5a H3DnkWrjjLEIiogaPF0wTF4We1+HmlFku/Djk34DVm0HGwQc0RnU0BvvVR8Tx5/JpPnI ZGU14v1ePuuqjsZgq570459lv4cDeb4hNYQVK6519R2k+lPfJCDC8XoRELl2vrX1zP3i 1n5mJb2ZFo86LSFCOR1Lso6bQpmjlDN53WuAxLhcCygDVmMgP6IHIW9CFmCUHYnp9nHk Gwwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=hPfwQE70; 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 v141-v6si22662884pfc.193.2018.11.13.06.08.14; Tue, 13 Nov 2018 06:08:56 -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=hPfwQE70; 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 S2387757AbeKNAAT (ORCPT + 99 others); Tue, 13 Nov 2018 19:00:19 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:54631 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387721AbeKNAAS (ORCPT ); Tue, 13 Nov 2018 19:00:18 -0500 Received: by mail-wm1-f68.google.com with SMTP id r63-v6so12089027wma.4 for ; Tue, 13 Nov 2018 06:02:01 -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=H8x7i2Y0NQGhPOwYVcZG4ieMSrsXoI3OcuJ/XVYngLQ=; b=hPfwQE70p7pPEvw9+TUWD5NNH4b9dL17YrJaEUNEtZ7KYndN9V+FdRwV5aYAMttn0v QXve1XUIFOuEJJRuCd1VqaBj5QqxVpR9PMgABcgvfqvwoSl0undeasFfaTHFdE4oMd99 NcpL+1vyCCTTCfw1FOPmuveSOihp2RQpm3badhB9t273Qfu75hsUKkZx6PVqGP2zSMAJ M26MNR9rMwfRrVJYb4xVlmgb06t1aAnvUvPlHJ0ObUd95oNDAVMKAyVLecHO/OHTS9yf ejOGxnb6Vpp0Gmee1NYG2V4oHSrfk/ZF1Xcg9k9Z4EcjX+pATrJuI8AN4Lo8A7xNiw/7 /eNw== 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=H8x7i2Y0NQGhPOwYVcZG4ieMSrsXoI3OcuJ/XVYngLQ=; b=O7oIpJ+8eH38eMaCXV36XTj6O7/Cp4qxOyjns72pbLnI1jw+E1wOSyI3KNSWBRfDFt vNoX0Ruh2A0R6foOsDoha8innXs9jRj75B7JRZNIl4ysdNHmQRu9mizlf71rA55eQk7l th5XuRCo53Ioty9OYUoeewpGe4VDsYavXWjlrBwYU7XXwNDf8lqPxJAOeghWQAAVZZhP 8pFLBXq71ZFpnREvLTjHfttPgaYoWR9zX/NDkIOgji+Jy7Cuecs/vZkg8G5JTg5gYW2g yTmSvJUuum5vE33nMXhKh4beJznk8PQY1eIzFe57s53wZ0zufkYmlVuEESC98dWzsOw1 tfXw== X-Gm-Message-State: AGRZ1gLOFLh5h5OlVo24eK70JcheLyR04GRZPh/gEXnXH5M7jEJBS0op FFYfY62dS5toiHHwDbP4xLCNjA== X-Received: by 2002:a1c:bc82:: with SMTP id m124-v6mr3337326wmf.76.1542117720757; Tue, 13 Nov 2018 06:02:00 -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.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Nov 2018 06:02:00 -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 04/25] ARM: davinci: dm644x-evm: use cell nvmem lookup for mac address Date: Tue, 13 Nov 2018 15:01:12 +0100 Message-Id: <20181113140133.17385-5-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-dm644x-evm.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c index e4a8f9225d16..e1428115067f 100644 --- a/arch/arm/mach-davinci/board-dm644x-evm.c +++ b/arch/arm/mach-davinci/board-dm644x-evm.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -510,6 +511,27 @@ static struct pcf857x_platform_data pcf_data_u35 = { * - ... newer boards may have more */ +static struct nvmem_cell_info dm644evm_nvmem_cells[] = { + { + .name = "macaddr", + .offset = 0x7f00, + .bytes = ETH_ALEN, + } +}; + +static struct nvmem_cell_table dm644evm_nvmem_cell_table = { + .nvmem_name = "1-00500", + .cells = dm644evm_nvmem_cells, + .ncells = ARRAY_SIZE(dm644evm_nvmem_cells), +}; + +static struct nvmem_cell_lookup dm644evm_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, @@ -842,6 +864,8 @@ static __init void davinci_evm_init(void) platform_add_devices(davinci_evm_devices, ARRAY_SIZE(davinci_evm_devices)); #ifdef CONFIG_I2C + nvmem_add_cell_table(&dm644evm_nvmem_cell_table); + nvmem_add_cell_lookups(&dm644evm_nvmem_cell_lookup, 1); evm_init_i2c(); davinci_setup_mmc(0, &dm6446evm_mmc_config); #endif -- 2.19.1