All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Gerlach <d-gerlach@ti.com>
To: u-boot@lists.denx.de
Subject: [PATCH v2 1/9] doc: Add new doc for soc ID driver model
Date: Wed, 15 Jul 2020 23:39:56 -0500	[thread overview]
Message-ID: <20200716044004.6014-2-d-gerlach@ti.com> (raw)
In-Reply-To: <20200716044004.6014-1-d-gerlach@ti.com>

Add a new documentation file for UCLASS_SOC and its usage to describe
the SoC Device ID framework that allows SoC identification and device
data matching.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
---
 doc/driver-model/index.rst         |  1 +
 doc/driver-model/soc-framework.rst | 68 ++++++++++++++++++++++++++++++
 2 files changed, 69 insertions(+)
 create mode 100644 doc/driver-model/soc-framework.rst

diff --git a/doc/driver-model/index.rst b/doc/driver-model/index.rst
index b9df221627e2..f17c72ce69d8 100644
--- a/doc/driver-model/index.rst
+++ b/doc/driver-model/index.rst
@@ -19,5 +19,6 @@ Driver Model
    pmic-framework
    remoteproc-framework
    serial-howto
+   soc-framework
    spi-howto
    usb-info
diff --git a/doc/driver-model/soc-framework.rst b/doc/driver-model/soc-framework.rst
new file mode 100644
index 000000000000..2609fda64421
--- /dev/null
+++ b/doc/driver-model/soc-framework.rst
@@ -0,0 +1,68 @@
+.. SPDX-License-Identifier: GPL-2.0+
+.. (C) Copyright 2020
+.. Texas Instruments Incorporated - http://www.ti.com/
+
+SOC ID Framework
+================
+
+Introduction
+------------
+
+The driver-model SOC ID framework is able to provide identification
+information about a specific SoC in use at runtime, and also provide matching
+from a set of identification information from an array. This can be useful for
+enabling small quirks in drivers that exist between SoC variants that are
+impractical to implement using device tree flags. It is based on UCLASS_SOC.
+
+UCLASS_SOC:
+  - drivers/soc/soc-uclass.c
+  - include/soc.h
+
+Configuration:
+  - CONFIG_SOC_DEVICE is selected by drivers as needed.
+
+Implementing a UCLASS_SOC provider
+----------------------------------
+
+The purpose of this framework is to allow UCLASS_SOC provider drivers to supply
+identification information about the SoC in use at runtime. The framework
+allows drivers to define soc_ops that return identification strings.  All
+soc_ops need not be defined and can be left as NULL, in which case the
+framework will return -ENOSYS and not consider the value when doing an
+soc_device_match.
+
+It is left to the driver implementor to decide how the information returned is
+determined, but in general the same SOC should always return the same set of
+identifying information. Information returned must be in the form of a NULL
+terminated string.
+
+See include/soc.h for documentation of the available soc_ops and the intended
+meaning of the values that can be returned. See drivers/soc/soc_sandbox.c for
+an example UCLASS_SOC provider driver.
+
+Using a UCLASS_SOC driver
+-------------------------
+
+The framework provides the ability to retrieve and use the identification
+strings directly. It also has the ability to return a match from a list of
+different sets of SoC data using soc_device_match.
+
+An array of 'struct soc_attr' can be defined, each containing ID information
+for a specific SoC, and when passed to soc_device_match, the identifier values
+for each entry in the list will be compared against the values provided by the
+UCLASS_SOC driver that is in use. The first entry in the list that matches all
+non-null values will be returned by soc_device_match.
+
+An example of various uses of the framework can be found at test/dm/soc.c.
+
+Describing the device using device tree
+---------------------------------------
+
+.. code-block:: none
+
+   chipid: chipid {
+        compatible = "sandbox,soc";
+   };
+
+All that is required in a DT node is a compatible for a corresponding
+UCLASS_SOC driver.
-- 
2.20.1

  reply	other threads:[~2020-07-16  4:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-16  4:39 [PATCH v2 0/9] Introduce UCLASS_SOC Dave Gerlach
2020-07-16  4:39 ` Dave Gerlach [this message]
2020-07-17  1:58   ` [PATCH v2 1/9] doc: Add new doc for soc ID driver model Simon Glass
2020-07-16  4:39 ` [PATCH v2 2/9] dm: soc: Introduce UCLASS_SOC for SOC ID and attribute matching Dave Gerlach
2020-07-16  4:39 ` [PATCH v2 3/9] test: Add tests for SOC uclass Dave Gerlach
2020-07-16  4:39 ` [PATCH v2 4/9] dm: soc: Introduce soc_ti_k3 driver for TI K3 SoCs Dave Gerlach
2020-07-16  4:40 ` [PATCH v2 5/9] arm: dts: k3-am65-wakeup: Introduce chipid node Dave Gerlach
2020-07-16  4:40 ` [PATCH v2 6/9] arm: dts: k3-j721e-mcu-wakeup: " Dave Gerlach
2020-07-16  4:40 ` [PATCH v2 7/9] configs: am65x_evm: Enable CONFIG_SOC_DEVICE and CONFIG_SOC_DEVICE_TI_K3 Dave Gerlach
2020-07-16  4:40 ` [PATCH v2 8/9] configs: j721e_evm: " Dave Gerlach
2020-07-16  4:40 ` [PATCH v2 9/9] arm: mach-k3: Use SOC driver for device identification Dave Gerlach
2020-07-16 14:54 ` [PATCH v2 0/9] Introduce UCLASS_SOC Grygorii Strashko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200716044004.6014-2-d-gerlach@ti.com \
    --to=d-gerlach@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.