From patchwork Wed Aug 8 15:31:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10560243 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 102711057 for ; Wed, 8 Aug 2018 15:36:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0BF829F05 for ; Wed, 8 Aug 2018 15:36:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2B192AD3F; Wed, 8 Aug 2018 15:36:44 +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 7DF8629F05 for ; Wed, 8 Aug 2018 15:36:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728835AbeHHRyB (ORCPT ); Wed, 8 Aug 2018 13:54:01 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33493 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728691AbeHHRyA (ORCPT ); Wed, 8 Aug 2018 13:54:00 -0400 Received: by mail-wm0-f67.google.com with SMTP id r24-v6so957088wmh.0 for ; Wed, 08 Aug 2018 08:33:49 -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=5gXeisQUg9CT/e0TVeNKIqgvnnNtiYjxB6KBG0kRtOg=; b=QkqXrrSRt28avbRFzep8u9o6/pMPtCVFMth9MyQLeywkgPV8oV+NTVwVkzumsndxpi +VAvWKHMtM7vT4ZLp4l8fD4uW2WE6UMRN959AV0jA9BfDTAdocYUEmP5NIb+CVd3xCk7 2wjDVsIsY6gnK5vhsesri/PIO7HQbFuIWSqA2pFEDEgPJG5zVQptJYr8gxWvl6IUZGi8 3lpfQf6lmDMldihqejMTRbykRmG586A70Ol2XxJzuOwp02fwNCDjn8NXJH5hNMnXvqvJ gDWabQGU2oLKuOKuBhWjGw7ihf4UhS1zrOaty2BXAEXbVDOUnB64vNb61+mwLutOjIIP n2lA== 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=5gXeisQUg9CT/e0TVeNKIqgvnnNtiYjxB6KBG0kRtOg=; b=ZlNRc8przvt1gratsqmL2kFee3zMgfAhaC3ZuSLlD69VnQzW7VAmIOoyKT+AHgOM7S X1RCFQisWdRwAEk6mAUlm9K29vddjQ+WErSt1QhrA5UhLUrWEkj2J6h6GOig8U6by5Li XQ9BmQZ76fEoyInvWewJHq1mTd7dtdwLZn3MeJQMBrpo7+/W/s/0h65l6OqHo6+8qies ntk6Kb9ZsmwemVHfRVDv3ZNUDyuF1RLcNwA1JIDl9DyudCuhEFmBcYvsgpq/rFB4JbUm GBP00a2D9rT+rFvugP2uoUefmP2ojENy8983z7xmKRxK76hZ08oLQkU9GiSesvLrjDQG RdVw== X-Gm-Message-State: AOUpUlHHlondI3PnonFA7x1YRvoTRGMQ7xCWu5tV1C18/p4qfFLQ+zE1 A5/USP/d5xOp+VWqa9/UuKoVXg== X-Google-Smtp-Source: AA+uWPyvPIzatEonKFWgeZF7rzsjDFKGwKfCcqafIbk0zTDsLtnA7s8uZUy6D5jEhIepXbTZODtf5Q== X-Received: by 2002:a7b:c013:: with SMTP id c19-v6mr1901158wmb.53.1533742428438; Wed, 08 Aug 2018 08:33:48 -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.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Aug 2018 08:33:47 -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 11/28] ARM: davinci: mityomapl138: add nvmem cells lookup entries Date: Wed, 8 Aug 2018 17:31:33 +0200 Message-Id: <20180808153150.23444-12-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-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();