From patchwork Fri Jun 29 09:40:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10496017 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3FC686016C for ; Fri, 29 Jun 2018 09:45:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2773129991 for ; Fri, 29 Jun 2018 09:45:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1BA88299A8; Fri, 29 Jun 2018 09:45:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB42029991 for ; Fri, 29 Jun 2018 09:45:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933673AbeF2JpV (ORCPT ); Fri, 29 Jun 2018 05:45:21 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:32878 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754807AbeF2Jky (ORCPT ); Fri, 29 Jun 2018 05:40:54 -0400 Received: by mail-wm0-f50.google.com with SMTP id z6-v6so1516551wma.0 for ; Fri, 29 Jun 2018 02:40:53 -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=uc9DsLvuo9YkRZ27l37cWzXamU3JMdrZofUpXwWBSEI=; b=Jb1VdHddxa2cEaIYOj+354E/9cRqqwGGzz1zmS8ndA3iU1XHbliWlMd5Ew96AoHjwI PRgenGAuhMMTupbBxxpSMRa4BLXvYFF1dMuL1Zvd45JIEL2/qkzbvWTr4yp63vIZbeZY k5kxmP098Jo0QfYeWmram+1QR5FVZAsv31K5/BHaDm1HE+dMdG0gt4BiIHpfk/n+J3Pj 33WbBUoE4KmPFMfW6LwRQsKkQrwQvkFkhurZ1Bs/0qS2fw8bSd0rYuXn8JMa3oWPdAMF mPjH9euUXR3GV+Di15FsuOfkIiuEOySohGmxqzl8yrvMoF8QRjnfsBfQob9ZhgYLPeiU 5Isw== 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=uc9DsLvuo9YkRZ27l37cWzXamU3JMdrZofUpXwWBSEI=; b=DbYHn547DOR0IovPa83t/Jl9iURejnJT3NFV065FJdMEyfUk/ka3/qPUvpOcBBd9kI kt5Fw6C00Zz5t5L39K2zJW3sJWyjceiBICZrlNN7LDb7G2n9YsI8mZ4LQg6ii3gGRs3S 0665J2h0Oqmqaz5tdGk+eDr0A5mbR+Ozbm1t57nsoamGcSivOk7H9hbSJ0gL/7kJiEA4 Ev0GihSPm00+sFOlMMpPPnH1Ktd9f+fCMsWwxlCg1k9JJof3sRQoF2qTX2bqHsNM8A+2 2EvIZPNPm0wsDDWFLEly3EwhdzgIpNDftLMlihLPyHSIKViDPua5iPPi0/Mkm2Qr2kLL Zw3A== X-Gm-Message-State: APt69E3TSauEdYXEmHVXb2G6EguGY0Uw4lJoco24gZ3eDpmJ7ffzoL7t wwO97JOE7013GPRoDQTn7uvC0A== X-Google-Smtp-Source: AAOMgpfW2hmhcGYENZ8B4489qIEu0SEMYxQgn55Jm7Dej495LeRm+ZCN/scIfvtqvCwqYrs0yWrFbQ== X-Received: by 2002:a1c:8893:: with SMTP id k141-v6mr1221248wmd.133.1530265253213; Fri, 29 Jun 2018 02:40:53 -0700 (PDT) Received: from brgl-bgdev.lan (LFbn-NIC-1-55-10.w2-15.abo.wanadoo.fr. [2.15.147.10]) by smtp.gmail.com with ESMTPSA id d102-v6sm1386394wma.10.2018.06.29.02.40.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Jun 2018 02:40:52 -0700 (PDT) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , Russell King , Grygorii Strashko , "David S . Miller" , Srinivas Kandagatla , Lukas Wunner , Rob Herring , Florian Fainelli , Dan Carpenter , Ivan Khoronzhuk , David Lechner , Greg Kroah-Hartman , Andrew Lunn , Jonathan Corbet Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, netdev@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v4 07/18] ARM: davinci: mityomapl138: add nvmem cells lookup entries Date: Fri, 29 Jun 2018 11:40:28 +0200 Message-Id: <20180629094039.7543-8-brgl@bgdev.pl> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180629094039.7543-1-brgl@bgdev.pl> References: <20180629094039.7543-1-brgl@bgdev.pl> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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-mityomapl138.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c index 37b3e48a21d1..b5be51c0451e 100644 --- a/arch/arm/mach-davinci/board-mityomapl138.c +++ b/arch/arm/mach-davinci/board-mityomapl138.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -160,6 +161,25 @@ static void read_factory_config(struct nvmem_device *nvmem, void *context) mityomapl138_cpufreq_init(partnum); } +static struct nvmem_cell_lookup mityomapl138_nvmem_cells[] = { + { + .info = { + .name = "factory-config", + .offset = 0x0, + .bytes = sizeof(struct factory_config), + }, + .nvmem_name = "1-00500", + }, + { + .info = { + .name = "mac-address", + .offset = 0x64, + .bytes = ETH_ALEN, + }, + .nvmem_name = "1-00500", + } +}; + static struct at24_platform_data mityomapl138_fd_chip = { .byte_len = 256, .page_size = 8, @@ -534,6 +554,8 @@ static void __init mityomapl138_init(void) if (ret) pr_warn("spi 1 registration failed: %d\n", ret); + nvmem_add_lookup_table(mityomapl138_nvmem_cells, + ARRAY_SIZE(mityomapl138_nvmem_cells)); mityomapl138_config_emac(); ret = da8xx_register_rtc();