From patchwork Thu Mar 11 19:19:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 12132571 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ADA56C433DB for ; Thu, 11 Mar 2021 19:23:41 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 250F864F10 for ; Thu, 11 Mar 2021 19:23:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 250F864F10 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=/AmdZY2WCbcvUBtKCSXhWn7U2Mq1VzDTF+5/28YXP1A=; b=UrEtqZj/Cv7iVWCAAql/aRCjdf TVR9cc2tfmbqndIAsqylg1PeuyhPQzx+0xlD6YtVdOt9QUMsKNYi5FKuYaPZD7/hKmbFjTFHeZn8P AX8vYQGUaj4WYHo1peUj00I/y6oJJw6ma9PekY7DKGQ515SdxjMZ064uis3oPmvOQvTZKIQHw71mh Bi+Klm8gR6LVGzalgduWBvGa4QstHzbp+kJVV37gHP2fsbm3DSEsv/sRgZNaGtznSUR8wngGTT/LW ON/q5d4PGaSdItYWnu/uNS1DUtrhJyamgVkQgSlCmt40m+TiNKdTg54VvFYUrlJyQIBszOC4zQBvD Boz+L7HQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lKQsD-009ydG-Iz; Thu, 11 Mar 2021 19:21:32 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lKQqn-009yL0-S9; Thu, 11 Mar 2021 19:20:11 +0000 Received: by mail-ej1-x629.google.com with SMTP id jt13so48631559ejb.0; Thu, 11 Mar 2021 11:20:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BUYFIrTGJMKusXcgJwvfovMKgwYSZMXx3AEN+yMz7Qk=; b=WcnqMPzK+XTGfUGsUjlnD9OQybghAURdqf/frSvwBWLHpGOdMF4XjnpLtz/4ULwJGd lOfSQhBYQ94VMDfarRZRt960BHkfKykj9WBR2/RcxdA1mU3cF+Qehe3+fXia7hxwvH4V TbrBcdTCIdX1QoiLWTCQGOtKVmYfB64tBpKwd8wcTScwqRZYYJSpB/qBy4osawSGfhoL tnmfag7feQ7mLHa0lX7eAplXjEpttNA6oCIf0ynnb4epjSNIBgpU6gfLeVVRi1g8V8ea 0WdM/+kSdfXRXBWv5C+iK9K8WOflbMRJTIDcQgWrIPa1wPA73o/89k0SlN6vAqKAcX1h B0DQ== 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:mime-version :content-transfer-encoding; bh=BUYFIrTGJMKusXcgJwvfovMKgwYSZMXx3AEN+yMz7Qk=; b=aNAKWZsUa/2lai4GpwpDik2YXORvMUCN/29NTEdP/dY42EVvOEH1JkoPpQNPAdqmXt /WXy+JQnfiW1LHiIgInFV/B8dHcY3BP3t8MEn+PJ6ddUgC52Ydf6HMV8Wht2GfjfDwim KsT2u/+zpK4+WPWiw50wRzaq3vttnCzbFxRq5PNymssyt2CzKwZLgthTjoPMcrFUdvTr zfuHIBLhBn3abj5qqLJ3Zn0NR/95CzMbZ1F1Ut/Fu13RowY9I6wb+BFGbr4ig/eRJKnU bpcrHpsLvgDqjXkd72XleQedDu+QXYpCZWK3NGirrXPbTXKBouK4A2SAKgBDANpWl2Nl DrRg== X-Gm-Message-State: AOAM530ccZv0iW+baMZ8iDJIoB8uwymGsshGNonBYV2OvrpYilFRVkEF uwomRDin3rtPBW0O2bKfbud4+m5/7SY= X-Google-Smtp-Source: ABdhPJznKWGxhZhUv9aP47OwDsK9S7A5/tKm/oZ2WFq4Y54/WUpXeMkLgD2rNX303oG22Dx3WwfHaQ== X-Received: by 2002:a17:906:1386:: with SMTP id f6mr4540790ejc.45.1615490400651; Thu, 11 Mar 2021 11:20:00 -0800 (PST) Received: from localhost.localdomain ([81.18.95.223]) by smtp.gmail.com with ESMTPSA id u59sm1944143edc.73.2021.03.11.11.19.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 11:20:00 -0800 (PST) From: Cristian Ciocaltea To: =?utf-8?q?Andreas_F=C3=A4rber?= , Manivannan Sadhasivam , Russell King Cc: linux-arm-kernel@lists.infradead.org, linux-actions@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/1] ARM: owl: Add Actions Semi Owl S500 SoC machine Date: Thu, 11 Mar 2021 21:19:58 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210311_192003_867223_363B100A X-CRM114-Status: GOOD ( 14.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add machine entry for the S500 variant of the Actions Semi Owl SoCs family. For the moment the only purpose is to provide the system serial information which will be used by the Owl Ethernet MAC driver to generate a stable MAC address. Signed-off-by: Cristian Ciocaltea --- arch/arm/mach-actions/Makefile | 1 + arch/arm/mach-actions/actions.c | 44 +++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 arch/arm/mach-actions/actions.c diff --git a/arch/arm/mach-actions/Makefile b/arch/arm/mach-actions/Makefile index 8eae9587fe82..31865c958d92 100644 --- a/arch/arm/mach-actions/Makefile +++ b/arch/arm/mach-actions/Makefile @@ -1,2 +1,3 @@ # SPDX-License-Identifier: GPL-2.0-only +obj-${CONFIG_ARCH_ACTIONS} += actions.o obj-${CONFIG_SMP} += platsmp.o diff --git a/arch/arm/mach-actions/actions.c b/arch/arm/mach-actions/actions.c new file mode 100644 index 000000000000..306c6bb178fe --- /dev/null +++ b/arch/arm/mach-actions/actions.c @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Actions Semi Owl SoCs + * + * Copyright (c) 2012 Actions Semi Inc. + * Copyright (c) 2021 Cristian Ciocaltea + */ + +#include +#include + +#include +#include + +#define OWL_S500_SERIAL_LOW_PAGE_OFF 0x800 +#define OWL_S500_SERIAL_HIGH_PAGE_OFF 0x804 + +static const char *const owl_s500_dt_compat[] __initconst = { + "actions,s500", + NULL, +}; + +static void __init owl_s500_get_system_serial(void) +{ + char *vddr = kmap_local_page(pfn_to_page(PFN_DOWN(0))); + + memcpy(&system_serial_low, vddr + OWL_S500_SERIAL_LOW_PAGE_OFF, + sizeof(system_serial_low)); + memcpy(&system_serial_high, vddr + OWL_S500_SERIAL_HIGH_PAGE_OFF, + sizeof(system_serial_high)); + + kunmap_local(vddr); +} + +static void __init owl_s500_init_early(void) + +{ + owl_s500_get_system_serial(); +} + +DT_MACHINE_START(ACTIONS, "Actions Semi Owl S500 SoC") + .dt_compat = owl_s500_dt_compat, + .init_early = owl_s500_init_early, +MACHINE_END