From patchwork Fri Mar 19 18:27:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 12151703 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 5C3BEC433C1 for ; Fri, 19 Mar 2021 18:30:02 +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 E5ED661977 for ; Fri, 19 Mar 2021 18:30:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E5ED661977 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:References:In-Reply-To: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:List-Owner; bh=Ou94SlG9LEU1CZrCD4m+DTO8sNwZrvDK5ZbK4AMUnwM=; b=nVVxXFLpDy8c7L/dJ8kJ98FzL eQkAoVNLSmf6PgjCB5M6ear9PqErCbni85JIFhBcal5ZZrGkoC6/q/VuzlRvjbVNQA6mGxIEKWvli dzvz2363rhKD9PKr6/4hh9bGu0n8jucdWry3vgOSWWRtH6bifmF2/vXuli2WiL7pDDMJ8+emQh3N4 0bzAHVIWSxCyJvxwW60LKgzSwySy3jyC8fN+BkVfqEY5EirQE+ACBWHBDXxFXwezPrfABO3Yovy++ zRRGzoaWhcGYGnEkLDdim0ocGqSjQZ9wqjciKcnroMq3VEqUtDFRYEpFl8hN0nqWNUJMel3qZg5rD pKDer5kiA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNJr8-007wT2-0p; Fri, 19 Mar 2021 18:28:18 +0000 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNJqw-007wP1-K6; Fri, 19 Mar 2021 18:28:08 +0000 Received: by mail-ed1-x536.google.com with SMTP id e7so11845883edu.10; Fri, 19 Mar 2021 11:28:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pHQeL+zKucmwsz2xyFaNwYWj4QdkKVqhrqUT1DhydgM=; b=KeO5TNpkPYjcPmBEX/8uLaa84tKmzd1CeVAO3DG7993Op7PiXHLH3qn/5mVu9xmxPe f2/GD/SUQxAviYKLCrFbSI1Q3EJ3xgvKWWvp0jgDAMID0/82MOji/JlhJH1qFsh58M+R wK/+uFn7pcRLyGEhU5u5jc+uZt7OrFPOaUjKlpglGeJ84VGqwq2PJr8mH8mu4mlVf2TR 69sUPY+6jb9UP7lvXryh6nlk0QCApxxWffSmCZ5GcDpNIim7KOO8u8JCVd+1+1VZv38H 8cmJzXpP22qgqoRmuTLSZ09TTXssDWMwujIj240bo+KyXvBgu5q1Al6M0VBf3H7a/zwu lp6Q== 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=pHQeL+zKucmwsz2xyFaNwYWj4QdkKVqhrqUT1DhydgM=; b=ducaRJxFyPKKm0USfmdJtKMSkzz5pOf/v+U5TVdrKXcmh19PspngkzlpdxL5qTvYNr pf81AlyHSLyUZ1d6zkYotIEWPh8P9vHFG4OkUqza7SY8GNKHAWegSwWD5YLtNoKOu3nx 62uVnrAFUhk0t+0rVbyIKlrJo8uRvovv68EZ8WRTMEVM3os9pXOxG3FJnHRfO0RBWByb FuSz9VHgYK6kJEMkMAndaED/E3YdCr/0HEkLNkV3JRMWdsdKQmYtIYDa9szhtrvnkvhU UcNMpoR3/5esHBwaWVp5Oa7S5CsmNAXsX97XkPfV5c1J3ABLAjQomWxSgpZYczAyGPOq +tCg== X-Gm-Message-State: AOAM533u4N2qrCg3agA9gwI2+U8a28rDkYMtpvByTFim54jU7qZV7Z17 13nquu3pRDIaO/YwHOWaHnXEYrijR9Q= X-Google-Smtp-Source: ABdhPJwYbZdKc3KwdQ9V6TCPfF8E2WubTksv/nE+ZJSAcAm7tsEBQkSFPX/FwkmG4T6Qk6sLD1yNaQ== X-Received: by 2002:a05:6402:5252:: with SMTP id t18mr11515330edd.258.1616178485541; Fri, 19 Mar 2021 11:28:05 -0700 (PDT) Received: from localhost.localdomain ([188.24.140.160]) by smtp.gmail.com with ESMTPSA id gb22sm3951070ejc.78.2021.03.19.11.28.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 11:28:05 -0700 (PDT) From: Cristian Ciocaltea To: Rob Herring , =?utf-8?q?Andreas_F=C3=A4rber?= , Manivannan Sadhasivam Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-actions@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] dt-bindings: soc: actions: Add Actions Semi Owl socinfo binding Date: Fri, 19 Mar 2021 20:27:59 +0200 Message-Id: <95105518f61408743d17783099ed9c373a3dfe18.1616178258.git.cristian.ciocaltea@gmail.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210319_182806_765501_CD7163B5 X-CRM114-Status: GOOD ( 13.90 ) 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 devicetree binding for the Actions Semi Owl SoCs info module. Signed-off-by: Cristian Ciocaltea --- .../bindings/soc/actions/owl-socinfo.yaml | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml diff --git a/Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml b/Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml new file mode 100644 index 000000000000..3fcb1f584fdf --- /dev/null +++ b/Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml @@ -0,0 +1,71 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/actions/owl-socinfo.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Actions Semi Owl SoC info module + +maintainers: + - Cristian Ciocaltea + +description: | + Actions Semi Owl SoC info module provides access to various information + about the S500, S700 and S900 SoC variants, such as serial number or id. + +patternProperties: + "^soc(@[0-9a-f]+)?$": + type: object + properties: + compatible: + items: + - enum: + - actions,s500-soc + - actions,s700-soc + - actions,s900-soc + - const: simple-bus + + "#address-cells": + enum: [1, 2] + + "#size-cells": + enum: [1, 2] + + ranges: true + + actions,serial-number-addrs: + description: | + Contains the physical addresses in DDR memory where the two parts + of the serial number (low & high) can be read from. + This is currently supported only on the S500 SoC variant. + $ref: /schemas/types.yaml#/definitions/uint32-array + minItems: 2 + maxItems: 2 + + required: + - compatible + + additionalProperties: + type: object + +additionalProperties: true + +examples: + - | + / { + compatible = "roseapplepi,roseapplepi", "actions,s500"; + model = "Roseapple Pi"; + #address-cells = <1>; + #size-cells = <1>; + + soc { + compatible = "actions,s500-soc", "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + actions,serial-number-addrs = <0x800>, /* S/N Low */ + <0x804>; /* S/N High */ + }; + }; + +... From patchwork Fri Mar 19 18:28:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 12151705 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 0045DC433C1 for ; Fri, 19 Mar 2021 18:30:18 +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 76A6661977 for ; Fri, 19 Mar 2021 18:30:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 76A6661977 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:References:In-Reply-To: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:List-Owner; bh=MKFgBwZa00eJZKwhPNWDLXE+bu3Zj9R4onxXLZn4y2Y=; b=WNy+iW6IV1E7+lt2RBwGB8jOY xj8KojRYvjgawHOLoZahyQCuKLR06t3kOOed8Ju/FS4KOCriu2p+waUykaxTrTVPwCwWU9rftEvmf Mz4VGPabsqqf714/jWtze0yFsaxmp06zJJiV19Cqm6VT/fuCVvDb+Rm3n5TdcSPgsOzEE5rciJK4g LmtYfmCjZwIQGALRsc1lRN59dSFuGSW01ZUNfwo/FcSi4xoDW3FJ6jcXU83xMuLhvHg2Opwqwi1hP L+MzfhK//2ltqSRUc5+wURMAI6wfflngDah5ZO0gmVMOAQBnvFo7x0iTxVfEK6y6yB96pue9EQj8S suCvE28hA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNJrI-007wU2-BK; Fri, 19 Mar 2021 18:28:28 +0000 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNJqx-007wPY-63; Fri, 19 Mar 2021 18:28:10 +0000 Received: by mail-ej1-x630.google.com with SMTP id r12so11255194ejr.5; Fri, 19 Mar 2021 11:28:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cZBBDJ1FYBuLzTfmz7EUovF4qIbRheJGENzZ7NQocvg=; b=ukK++JiWXUeKWcS2kFG9nVTaLPu7x6pZ3UMq0svLLaS+3FTyrzKqCnndHIFRZxuadi VNpUN4CkKHOAm+bBgDjr455s8OcA3LQuDCoYcoWo4m959nfn2za9EibFgNf5bCWUFgNs mP6X3Ft3KI8UdhrKi6wZFJW/WIpqezbx6PUyZVqLIpOlawoos9y/p3b40KMvZ0vV5kJd 7raxRDa7mndvET+r18p+wv2GKO+g0ko6qZfR8gTrtGa6CJEhTm5InASv4i4xHM/87ZkV W779FZo7pHH/lDGZBe3ONgxvyKD9DbcxG26BJdoWrxqqdMj+UVoQMI9MNhMzXZ/8IjaM uZmQ== 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=cZBBDJ1FYBuLzTfmz7EUovF4qIbRheJGENzZ7NQocvg=; b=cdcAAilGUy+/urAQfp/lRRuytB0JuLV3f+LO22ucFse8+Yx8Utu1x31pZC/q3ZB6R5 r12/xs9Xfh1VGAY4FNGwJV9A/vsKSS6xV9kXqysHyeTZuWz7ef6jv8Y2kaTcU02jT6Yg EecRHD7vPaIUbGHfyedTTRo/waTEYPdG0kNwpmyB/Cm3ritFvW7MROVEZ/6+X+1k32JI M/xGi+/cj6OoorLZT1A+TudA2mXZA0r+UFu4N4J79nHZVYuR8heRLSN+dXIhZbUwIzAK w+uapI4nl9OPDlcfbT5rPOHg39bRhWWIpdXpH7PPc1ZsRqS1kpRVCDYNvD0xq9XF1oIf wzqg== X-Gm-Message-State: AOAM530xJ1dfXksyRb3IK+YHnqZn0b2JMqQLTGqFqgx/9mefXytduVjb I549omMSYfLJjYFw8uv2BaU= X-Google-Smtp-Source: ABdhPJxZ+DjF+mjHOyt66qKD6psO9+8MEQ9Ru6wJZz8I1fGYNb2USAhzAjmAHky8vbU7LvVpzoVluQ== X-Received: by 2002:a17:907:76ed:: with SMTP id kg13mr5581385ejc.99.1616178486624; Fri, 19 Mar 2021 11:28:06 -0700 (PDT) Received: from localhost.localdomain ([188.24.140.160]) by smtp.gmail.com with ESMTPSA id gb22sm3951070ejc.78.2021.03.19.11.28.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 11:28:06 -0700 (PDT) From: Cristian Ciocaltea To: Rob Herring , =?utf-8?q?Andreas_F=C3=A4rber?= , Manivannan Sadhasivam Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-actions@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] soc: actions: Add Actions Semi Owl socinfo driver Date: Fri, 19 Mar 2021 20:28:00 +0200 Message-Id: <76e07f19e60c037a6ff24a34f5704809cdbfd368.1616178258.git.cristian.ciocaltea@gmail.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210319_182807_305089_5C325F2A X-CRM114-Status: GOOD ( 20.70 ) 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 The driver provides information about the Action Semi Owl family of SoCs (S500, S700 and S900) to user space via sysfs: machine, family, soc_id, serial_number. Note the serial number is currently provided only for the S500 SoC variant. Signed-off-by: Cristian Ciocaltea --- drivers/soc/actions/Kconfig | 8 ++ drivers/soc/actions/Makefile | 1 + drivers/soc/actions/owl-socinfo.c | 133 ++++++++++++++++++++++++++++++ 3 files changed, 142 insertions(+) create mode 100644 drivers/soc/actions/owl-socinfo.c diff --git a/drivers/soc/actions/Kconfig b/drivers/soc/actions/Kconfig index 1aca2058a40c..15faade9282d 100644 --- a/drivers/soc/actions/Kconfig +++ b/drivers/soc/actions/Kconfig @@ -14,4 +14,12 @@ config OWL_PM_DOMAINS power-gating on Actions Semiconductor S500, S700 and S900 SoCs. If unsure, say 'n'. +config OWL_SOCINFO + bool "Actions Semi Owl SoC info driver" + default ARCH_ACTIONS + select SOC_BUS + help + Say 'y' here to support the Action Semiconductor Owl socinfo + driver, providing information about the SoC to user space. + endif diff --git a/drivers/soc/actions/Makefile b/drivers/soc/actions/Makefile index 4db9e7b050e5..4b2591d3089f 100644 --- a/drivers/soc/actions/Makefile +++ b/drivers/soc/actions/Makefile @@ -2,3 +2,4 @@ obj-$(CONFIG_OWL_PM_DOMAINS_HELPER) += owl-sps-helper.o obj-$(CONFIG_OWL_PM_DOMAINS) += owl-sps.o +obj-$(CONFIG_OWL_SOCINFO) += owl-socinfo.o diff --git a/drivers/soc/actions/owl-socinfo.c b/drivers/soc/actions/owl-socinfo.c new file mode 100644 index 000000000000..2786c4fd261c --- /dev/null +++ b/drivers/soc/actions/owl-socinfo.c @@ -0,0 +1,133 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Actions Semi Owl SoC information driver + * + * Copyright (c) 2021 Cristian Ciocaltea + */ + +#include +#include +#include +#include +#include + +#include + +struct owl_soc_info { + char *name; + int (*get_system_serial)(struct device *dev); +}; + +static int __init owl_read_sn_from_mem(struct device *dev) +{ + int paddrs[2] = {0}; + char *vaddr; + int ret; + + ret = device_property_read_u32_array(dev, + "actions,serial-number-addrs", + paddrs, 2); + if (ret) { + dev_err(dev, "failed to read SoC S/N addresses: %d\n", ret); + return ret; + } + + if (PHYS_PFN(paddrs[0]) != PHYS_PFN(paddrs[1])) { + dev_err(dev, "invalid SoC S/N addresses\n"); + return -EINVAL; + } + + vaddr = kmap_local_pfn(PHYS_PFN(paddrs[0])); + + memcpy(&system_serial_low, vaddr + (paddrs[0] & (PAGE_SIZE - 1)), + sizeof(system_serial_low)); + memcpy(&system_serial_high, vaddr + (paddrs[1] & (PAGE_SIZE - 1)), + sizeof(system_serial_high)); + + kunmap_local(vaddr); + + return 0; +} + +static int owl_socinfo_probe(struct platform_device *pdev) +{ + const struct owl_soc_info *soc_info; + struct soc_device_attribute *soc_dev_attr; + struct soc_device *soc_dev; + int ret; + + soc_info = of_device_get_match_data(&pdev->dev); + if (!soc_info) + return -ENODEV; + + soc_dev_attr = devm_kzalloc(&pdev->dev, sizeof(*soc_dev_attr), + GFP_KERNEL); + if (!soc_dev_attr) + return -ENOMEM; + + ret = of_property_read_string(of_root, "model", &soc_dev_attr->machine); + if (ret) + return ret; + + soc_dev_attr->family = "Actions Semi Owl"; + soc_dev_attr->soc_id = soc_info->name; + + if (soc_info->get_system_serial) { + ret = soc_info->get_system_serial(&pdev->dev); + if (!ret) { + soc_dev_attr->serial_number = devm_kasprintf(&pdev->dev, + GFP_KERNEL, "%08x%08x", + system_serial_high, + system_serial_low); + /* Feed the SoC unique data into entropy pool. */ + add_device_randomness(soc_dev_attr->serial_number, 16); + } + } + + soc_dev = soc_device_register(soc_dev_attr); + if (IS_ERR(soc_dev)) + return dev_err_probe(&pdev->dev, PTR_ERR(soc_dev), + "failed to register soc device"); + + dev_info(soc_device_to_device(soc_dev), + "SoC: %s %s\n", + soc_dev_attr->family, soc_dev_attr->soc_id); + + return 0; +} + +static const struct owl_soc_info s500_soc_info = { + .name = "S500", + .get_system_serial = owl_read_sn_from_mem, +}; + +static const struct owl_soc_info s700_soc_info = { + .name = "S700", + /* FIXME: provide get_system_serial */ +}; + +static const struct owl_soc_info s900_soc_info = { + .name = "S900", + /* FIXME: provide get_system_serial */ +}; + +static const struct of_device_id owl_soc_of_match[] = { + { .compatible = "actions,s500-soc", .data = &s500_soc_info, }, + { .compatible = "actions,s700-soc", .data = &s700_soc_info, }, + { .compatible = "actions,s900-soc", .data = &s900_soc_info, }, + { } +}; + +static struct platform_driver owl_socinfo_platform_driver = { + .probe = owl_socinfo_probe, + .driver = { + .name = "owl-socinfo", + .of_match_table = owl_soc_of_match, + }, +}; + +static int __init owl_socinfo_init(void) +{ + return platform_driver_register(&owl_socinfo_platform_driver); +} +subsys_initcall(owl_socinfo_init); From patchwork Fri Mar 19 18:28:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 12151707 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=ham 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 B237BC433DB for ; Fri, 19 Mar 2021 18:30:33 +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 2A50761976 for ; Fri, 19 Mar 2021 18:30:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2A50761976 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:References:In-Reply-To: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:List-Owner; bh=CBLOkHWNK/BmdFwaUbGRqjftqfki95TEXrb65sLQh30=; b=F4hrq3O44EBd/nQp1yEwgcu4t x17NisSdHG+B1V6tD0J3BymqKnkehSTmxzPeLYA0WS1F/GnnudfJEuxEH/d35BX5K9aKYnQJ/Ax3R W7OVe3SKrafTrhE73+NK0wMt66XHXh9I/XAj5dxSFUzOrlWtGWuUqreR3IcBH7Indqu6xFwXh6ELv tay5CtwKzcBI0GGPwBxop5w6mYGP8wy7U+uIhaw3KQo0rgadN0ctfHps95+y+PSBEzbLutbpqjJ4w 0ZFt3l//RfntTtOP9vq3RbCTwiLV3vN/bWsa0sDFrozLHCQqrWcHsqv5BA3USmzgpkGv+yVEshpZR 0k8hw/mNg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNJrU-007wVi-Nw; Fri, 19 Mar 2021 18:28:40 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNJqy-007wQ0-Cb; Fri, 19 Mar 2021 18:28:10 +0000 Received: by mail-ej1-x62c.google.com with SMTP id u9so11248869ejj.7; Fri, 19 Mar 2021 11:28:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WbocOIYFKZ4s51qTLHlOis8DS7PgY5j879tJa2zPPWo=; b=HuT9ioPgW+mrCx4LICorFZeKwk5nnNLbNvHIFTwP5mnI2d+H9MX+MsxDPknGce0KGZ jiWyw07OaHcwdR8rMgv6mKUSYs0Ju+nUJ9xaZI6xmWU9t5TW4I0HyhYzAy1DIMEm6gIC Pjx7XqvpbA0VI2sRuGNKoJaYbzG88u9wiAS6Ls8ubDT0eODNb4poWAezuYBzCAiIVXCQ bATRqvdNWyyXF40CDxf+k06yoiI+ICVxEHsXnOosyxeDXfeIc5+VVzjDsVE5/97YGlEu m2W3sKlQZ2RpfiTXXB9shbN046f8EfSw6UmPwG13BOHv6sxzpsE+c8FH3ejxx+8GlVbp dh+g== 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=WbocOIYFKZ4s51qTLHlOis8DS7PgY5j879tJa2zPPWo=; b=NZdSOPF6maZMOcWyzYFdSwy5+bA0rE1T5z6ajChLG1eWJgvj/Oa28j7HkexqZD4H3y /fPrdhUyGY1psD44YSJ7xywvOIGWFiuFynmmhQsQsOElgRpC3RMIQkbHTZTUXrzzIoou zWgtVyoXDsy0rQ85YV7dHojFgFEWyVwxG0l6upjbuPzgjMUrdy4U6JamusNxZqqCguz/ 1bX/lqOHZaySk7aiwLVTDIzFrdEsNLQlnsmWRiXNwyAz1RalhcfzSOnVWRijtTBkvQUX 9yjLWXjaaQsfANDWquFe21rvKk+4pr3tsRRAKIsNkEU/nCBOxgNR0OGv2/qCVf2ifeDX xirw== X-Gm-Message-State: AOAM531ZAjgDcJpfreYRlfqhugFkyb+H3hG5TPhGHuVp258qHHvN/UqM 0SiHcMOaUyyL/y1PylXcQYk= X-Google-Smtp-Source: ABdhPJzbjakCSA5i4Y+kAcoVeHb9tjXO4DiiCmwAE/6VREAEIkRlc1hHrj6imR4cgUipXbIiRizfgA== X-Received: by 2002:a17:906:489:: with SMTP id f9mr5772812eja.428.1616178487869; Fri, 19 Mar 2021 11:28:07 -0700 (PDT) Received: from localhost.localdomain ([188.24.140.160]) by smtp.gmail.com with ESMTPSA id gb22sm3951070ejc.78.2021.03.19.11.28.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 11:28:07 -0700 (PDT) From: Cristian Ciocaltea To: Rob Herring , =?utf-8?q?Andreas_F=C3=A4rber?= , Manivannan Sadhasivam Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-actions@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] arm: dts: owl-s500: Add socinfo support Date: Fri, 19 Mar 2021 20:28:01 +0200 Message-Id: X-Mailer: git-send-email 2.31.0 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210319_182809_403792_AB1709AB X-CRM114-Status: GOOD ( 11.83 ) 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 Update soc node compatible property to enable support for the Actions Semi Owl soc info driver. Additionally provide memory addresses where the serial number parts are accessible. Signed-off-by: Cristian Ciocaltea --- arch/arm/boot/dts/owl-s500.dtsi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/owl-s500.dtsi b/arch/arm/boot/dts/owl-s500.dtsi index 739b4b9cec8c..07a165918de9 100644 --- a/arch/arm/boot/dts/owl-s500.dtsi +++ b/arch/arm/boot/dts/owl-s500.dtsi @@ -80,10 +80,12 @@ losc: losc { }; soc { - compatible = "simple-bus"; + compatible = "actions,s500-soc", "simple-bus"; #address-cells = <1>; #size-cells = <1>; ranges; + actions,serial-number-addrs = <0x800>, /* S/N Low */ + <0x804>; /* S/N High */ scu: scu@b0020000 { compatible = "arm,cortex-a9-scu"; From patchwork Fri Mar 19 18:28:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 12151709 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=ham 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 A3E7EC433C1 for ; Fri, 19 Mar 2021 18:30:38 +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 36A6961976 for ; Fri, 19 Mar 2021 18:30:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 36A6961976 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:References:In-Reply-To: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:List-Owner; bh=J+oOPB2fcNeKqNWwmEcABnDBbcpebBr0jpauoJiXUw4=; b=TK/Nv9PGn/YdIH7DuQTYas3+4 4tQylR4gY7TFT/Xyg5P1gtdG5wEoUQ5ASuOnHJzDgbtuAdcIxkCk9IRvdL9GLqasxMbSUQyhbkXF9 1n046jqYPvhFEaDrFYd5XUjD6oLL3DIaH3OVMvuw5f0o2Q2+iopH4I0Oo3jjaLNdNxTAht3rBqyFt z4Dakf+roohWCYjuSO+HqvZ5kfbwCTdSMgIw9sV+eHft/NmEnvQj/H1METvzbNZnl0H7QY0WAecdR TdacsPNbRndHnZ66HnTqUUHst/GLfe80Cph4hCAFaWSOjphjck8y+CB2u/5ZdCueAk8VX/frzFtHm HesHZE02A==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNJrf-007wZJ-4f; Fri, 19 Mar 2021 18:28:51 +0000 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNJqz-007wQ4-KQ; Fri, 19 Mar 2021 18:28:11 +0000 Received: by mail-ed1-x529.google.com with SMTP id j3so11861760edp.11; Fri, 19 Mar 2021 11:28:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EM7JC43IVWcp3nEFu0gDCR5Wo09NKYkxznZ0QTA4BIY=; b=g0HxaZGZUz9eHQydmGhhhOzkdd7x7QGLC7lotAXvH6DCDD4me7BBoYKHvOdgUxntbp 4YFgXEBoXjzy/J7wHtYznj0jTRQF19gwHhDf8NTP2jrlOYs1IrsZMRDaiClK0V+XBtFF 5/WzixxeK0xIRqup/gczpB37jdDnVeUqIJ/BoOAcL6xZJ+eBeCAacE3OFKJB9cfcbjuj tBUY+2yxAg1K8eogQCmqPyFonGIKdpO0HOcODXPEM9Azudlt1zocMCDCEIem81koMhVT bZ6MNJl6xAGxmUri4gzHQnHdA8YLzJ0+ZNzDbeI/jxsSlBkTT2Rq848jKFRDt0s/dF2T zvTg== 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=EM7JC43IVWcp3nEFu0gDCR5Wo09NKYkxznZ0QTA4BIY=; b=MV/trMo/6uvhrrLh3LCIkrZI/28jSM7v6GoQQMu7EnGSOkJsSgHB/k15CNK2cpnYpL TXWcROfnf0uauaeHjMCeDzHt0PfiwUQ/8ZBoz8I6R6m1AsVCZ649kSYrdJeG/S6tfeHR XRKi+sunn98BbOgBL6tbHKzLrc2A7to0D1J/k7uSNiVCb6sBHJ/V+QQILymDGWLRzlVT JwefYhXucRImCJGB9hkkm5nTv4/xknYgt0nbSKSkvRnvzzxNZO79bxJFnc0clpqlRHe5 STj8iNfFV6OHKpLuof16WIUoXgO5l71GYGZnbSvM9aKTG4dbABzNSvoS/s43VqwE38P9 IMeA== X-Gm-Message-State: AOAM532aj0eXXWcfwDEZHw6BujHefDajD6675tdhldGzpP3GxUELGw6J EO7E2vUu8fGJtV65UAYblTQ= X-Google-Smtp-Source: ABdhPJyDuDcix29yDHCqJv0NQ+RcQSRulZQgDhDYfs8irdBW4RY58iYdVJTBb+sJ3W526dqEMYt+yw== X-Received: by 2002:aa7:da46:: with SMTP id w6mr11341879eds.40.1616178489040; Fri, 19 Mar 2021 11:28:09 -0700 (PDT) Received: from localhost.localdomain ([188.24.140.160]) by smtp.gmail.com with ESMTPSA id gb22sm3951070ejc.78.2021.03.19.11.28.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 11:28:08 -0700 (PDT) From: Cristian Ciocaltea To: Rob Herring , =?utf-8?q?Andreas_F=C3=A4rber?= , Manivannan Sadhasivam Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-actions@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] MAINTAINERS: Add entry for Actions Semi Owl socinfo binding Date: Fri, 19 Mar 2021 20:28:02 +0200 Message-Id: X-Mailer: git-send-email 2.31.0 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210319_182809_710510_2F70E0B0 X-CRM114-Status: UNSURE ( 9.48 ) X-CRM114-Notice: Please train this message. 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 an entry for the Actions Semi Owl socinfo binding. Signed-off-by: Cristian Ciocaltea --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 20b8e37ea34c..21d54ddcceb4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1533,6 +1533,7 @@ F: Documentation/devicetree/bindings/mmc/owl-mmc.yaml F: Documentation/devicetree/bindings/net/actions,owl-emac.yaml F: Documentation/devicetree/bindings/pinctrl/actions,* F: Documentation/devicetree/bindings/power/actions,owl-sps.txt +F: Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml F: Documentation/devicetree/bindings/timer/actions,owl-timer.txt F: arch/arm/boot/dts/owl-* F: arch/arm/mach-actions/