All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 04/17] dm: x86: Add a uclass for an Low Pin Count (LPC) device
Date: Thu, 26 Mar 2015 09:29:28 -0600	[thread overview]
Message-ID: <1427383781-7151-5-git-send-email-sjg@chromium.org> (raw)
In-Reply-To: <1427383781-7151-1-git-send-email-sjg@chromium.org>

On x86 systems this device is commonly used to provide legacy port access.
It is sort-of a replacement for the old ISA bus.

Add a uclass for this, and allow it to have child devices.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 arch/x86/lib/Makefile     |  1 +
 arch/x86/lib/lpc-uclass.c | 28 ++++++++++++++++++++++++++++
 include/dm/uclass-id.h    |  1 +
 3 files changed, 30 insertions(+)
 create mode 100644 arch/x86/lib/lpc-uclass.c

diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index fe022f6..6c571dd 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -14,6 +14,7 @@ obj-$(CONFIG_HAVE_FSP) += cmd_hob.o
 obj-y	+= gcc.o
 obj-y	+= init_helpers.o
 obj-y	+= interrupts.o
+obj-y	+= lpc-uclass.o
 obj-y += cmd_mtrr.o
 obj-$(CONFIG_SYS_PCAT_INTERRUPTS) += pcat_interrupts.o
 obj-$(CONFIG_SYS_PCAT_TIMER) += pcat_timer.o
diff --git a/arch/x86/lib/lpc-uclass.c b/arch/x86/lib/lpc-uclass.c
new file mode 100644
index 0000000..6aeb4d4
--- /dev/null
+++ b/arch/x86/lib/lpc-uclass.c
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2015 Google, Inc
+ * Written by Simon Glass <sjg@chromium.org>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <dm/root.h>
+
+static int lpc_uclass_post_bind(struct udevice *bus)
+{
+	/*
+	 * Scan the device tree for devices
+	 *
+	 * Before relocation, only bind devices marked for pre-relocation
+	 * use.
+	 */
+	return dm_scan_fdt_node(bus, gd->fdt_blob, bus->of_offset,
+				gd->flags & GD_FLG_RELOC ? false : true);
+}
+
+UCLASS_DRIVER(lpc) = {
+	.id		= UCLASS_LPC,
+	.name		= "lpc",
+	.post_bind	= lpc_uclass_post_bind,
+};
diff --git a/include/dm/uclass-id.h b/include/dm/uclass-id.h
index 84a6955..79b51d3 100644
--- a/include/dm/uclass-id.h
+++ b/include/dm/uclass-id.h
@@ -39,6 +39,7 @@ enum uclass_id {
 	UCLASS_PCI_GENERIC,	/* Generic PCI bus device */
 	UCLASS_PCH,		/* x86 platform controller hub */
 	UCLASS_ETH,		/* Ethernet device */
+	UCLASS_LPC,		/* x86 'low pin count' interface */
 
 	UCLASS_COUNT,
 	UCLASS_INVALID = -1,
-- 
2.2.0.rc0.207.ga3a616c

  parent reply	other threads:[~2015-03-26 15:29 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-26 15:29 [U-Boot] [PATCH v2 0/17] dm: x86: Convert x86 to use driver model more fully Simon Glass
2015-03-26 15:29 ` [U-Boot] [PATCH v2 01/17] dm: sf: Add driver model read/write/erase methods Simon Glass
2015-04-01  3:14   ` Simon Glass
2015-03-26 15:29 ` [U-Boot] [PATCH v2 02/17] dm: x86: spi: Convert ICH SPI driver to driver model Simon Glass
2015-04-01  3:14   ` Simon Glass
2015-03-26 15:29 ` [U-Boot] [PATCH v2 03/17] dm: x86: Add a uclass for a Platform Controller Hub Simon Glass
2015-04-01  3:14   ` Simon Glass
2015-03-26 15:29 ` Simon Glass [this message]
2015-04-01  3:15   ` [U-Boot] [PATCH v2 04/17] dm: x86: Add a uclass for an Low Pin Count (LPC) device Simon Glass
2015-03-26 15:29 ` [U-Boot] [PATCH v2 05/17] x86: chromebook_link: dts: Add PCH and LPC devices Simon Glass
2015-04-01  3:15   ` Simon Glass
2015-03-26 15:29 ` [U-Boot] [PATCH v2 06/17] dm: cros_ec: Convert cros_ec LPC driver to driver model Simon Glass
2015-04-01  3:15   ` Simon Glass
2015-03-26 15:29 ` [U-Boot] [PATCH v2 07/17] cros_ec: Reinit the cros_ec device when 'crosec init' is used Simon Glass
2015-04-01  3:15   ` Simon Glass
2015-03-26 15:29 ` [U-Boot] [PATCH v2 08/17] cros_ec: Drop unused CONFIG_DM_CROS_EC Simon Glass
2015-04-01  3:15   ` Simon Glass
2015-03-26 15:29 ` [U-Boot] [PATCH v2 09/17] sandbox: cros_ec: Drop unnecessary init Simon Glass
2015-04-01  3:16   ` Simon Glass
2015-03-26 15:29 ` [U-Boot] [PATCH v2 10/17] x86: " Simon Glass
2015-04-01  3:16   ` Simon Glass
2015-03-26 15:29 ` [U-Boot] [PATCH v2 11/17] exynos: " Simon Glass
2015-04-01  3:16   ` Simon Glass
2015-03-26 15:29 ` [U-Boot] [PATCH v2 12/17] cros_ec: Remove unused cros_ec_board_init() function Simon Glass
2015-04-01  3:16   ` Simon Glass
2015-03-26 15:29 ` [U-Boot] [PATCH v2 13/17] fdt: cros_ec: Drop compatible string in fdtdec Simon Glass
2015-04-01  3:16   ` Simon Glass
2015-03-26 15:29 ` [U-Boot] [PATCH v2 14/17] fdt: Drop LPC " Simon Glass
2015-04-01  3:16   ` Simon Glass
2015-03-26 15:29 ` [U-Boot] [PATCH v2 15/17] cros_ec: exynos: Match up device tree with kernel version Simon Glass
2015-04-01  3:16   ` Simon Glass
2015-03-26 15:29 ` [U-Boot] [PATCH v2 16/17] sandbox: cros_ec: Add Kconfig for sandbox EC config Simon Glass
2015-04-01  3:16   ` Simon Glass
2015-03-26 15:29 ` [U-Boot] [PATCH v2 17/17] i8042: Add keyboard enable logic in kbd_reset() Simon Glass
2015-04-01  3:16   ` Simon Glass
2015-04-01  1:27 ` [U-Boot] [PATCH v2 0/17] dm: x86: Convert x86 to use driver model more fully Simon Glass

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=1427383781-7151-5-git-send-email-sjg@chromium.org \
    --to=sjg@chromium.org \
    --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.