From patchwork Mon Jun 25 15:50:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10486867 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 2987660230 for ; Mon, 25 Jun 2018 15:55:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DDFE285A0 for ; Mon, 25 Jun 2018 15:55:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 00C1F285B9; Mon, 25 Jun 2018 15:55:13 +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 2BB1D285A0 for ; Mon, 25 Jun 2018 15:55:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755097AbeFYPy6 (ORCPT ); Mon, 25 Jun 2018 11:54:58 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:40455 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752732AbeFYPv1 (ORCPT ); Mon, 25 Jun 2018 11:51:27 -0400 Received: by mail-wm0-f44.google.com with SMTP id z13-v6so4404327wma.5 for ; Mon, 25 Jun 2018 08:51:26 -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=hdmPjDSvWgFzi/ui3xXp3ufbDxi9LLAFx2+8+VRHKfA=; b=bwWCLcDfCvvX5JyT6wqGGjNISoXDEep7EEKn7bUcBLNi52A0LCK93wsKpc72irDND2 U1L0gWd31ZCgST7bNJK/BwK+YbDVkQEsPlER5Dpvc89klAR1iDfIGUFHzlGoQ0/OCDXE 93KwP3JSSKAxpwkic+Z0+duUSCd+xfUKFOO3c8KfD4IItl4MLrHc58eQ62jwLpD1gmKE MNlbKLCuzshYDz0e3dEFUrMnpXwsb/f4R2yxmNTa7tJCREA3oluCxaWBowoGerzMEDv7 xWbsJ7o7fmy4DCQMymAdQ2Gimw4jgVUTl7UZFGaDqULbizoyQ2N5r4CjgIEAJSJ+NLJL JSfw== 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=hdmPjDSvWgFzi/ui3xXp3ufbDxi9LLAFx2+8+VRHKfA=; b=fiAk0FTD9nyb2KrsPjL5PxfW9mQ2ZDFSABh9VLtH8vAZdTmmDNoATvvsp8Oci++uTu dz6zytPIsZmVvh3lSXl75tL/F9rF/VdELIocVFW/1Ag8m0c53i6aPkOsUWFyMvF78HVh X7EREc8SLj981Yp6knjpIzUQ6sdTsZW9hKhRAw0hPYx8/eMubUH4QUaEsYgKzvqEop/s mphaH/fFtnrPDB+qzy07ZS72B9M5yqwQoRtGkGylPnAS5MfK7kzuvNWT+KqdL05txTKl hQvyolm7j20fDEBsDLkhKt6HqIF2XW0qYd5EvstrQHyPi2av9kZgHl6ZS+ZIPraIZ9Su tv8g== X-Gm-Message-State: APt69E0dftJJdpcWAj5uYA6a2iC2hTKD1L4kMVPEn4juR7VXkUDsUy0G 9SGEF3uNZ9HoAi5J9DC8Vr7dSA== X-Google-Smtp-Source: AAOMgpeNfj5J9PRxWw4Z2w3YYshvyfmZ9wWX10WwAghy5ZgvLn1cuzvY4+OyRW7hMsi2uNIfUH2nYg== X-Received: by 2002:a1c:be10:: with SMTP id o16-v6mr1369682wmf.132.1529941886304; Mon, 25 Jun 2018 08:51:26 -0700 (PDT) Received: from brgl-bgdev.home ([2a01:cb1d:af:5b00:e837:b8d5:48c1:571b]) by smtp.gmail.com with ESMTPSA id x16-v6sm3523737wro.13.2018.06.25.08.51.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 08:51:25 -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 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 06/14] ARM: davinci: mityomapl138: add nvmem cells lookup entries Date: Mon, 25 Jun 2018 17:50:17 +0200 Message-Id: <20180625155025.12567-7-brgl@bgdev.pl> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180625155025.12567-1-brgl@bgdev.pl> References: <20180625155025.12567-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..2ec31ff61dbd 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_register_lookup(mityomapl138_nvmem_cells, + ARRAY_SIZE(mityomapl138_nvmem_cells)); mityomapl138_config_emac(); ret = da8xx_register_rtc();