diff mbox

[U-Boot,5/7] dm: x86: Add a driver for Intel PCH7

Message ID 1448943086-1079-6-git-send-email-sjg@chromium.org
State Superseded
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass Dec. 1, 2015, 4:11 a.m. UTC
At some point we may need to distinguish between different types of PCHs,
but for existing supported platforms we only need to worry about version 7
and version 9 bridges. Add a driver for the PCH7.

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

 drivers/pch/Makefile |  1 +
 drivers/pch/pch7.c   | 30 ++++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+)
 create mode 100644 drivers/pch/pch7.c

Comments

Bin Meng Dec. 8, 2015, 1:23 p.m. UTC | #1
Hi Simon,

On Tue, Dec 1, 2015 at 12:11 PM, Simon Glass <sjg@chromium.org> wrote:
> At some point we may need to distinguish between different types of PCHs,
> but for existing supported platforms we only need to worry about version 7
> and version 9 bridges. Add a driver for the PCH7.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>  drivers/pch/Makefile |  1 +
>  drivers/pch/pch7.c   | 30 ++++++++++++++++++++++++++++++
>  2 files changed, 31 insertions(+)
>  create mode 100644 drivers/pch/pch7.c
>
> diff --git a/drivers/pch/Makefile b/drivers/pch/Makefile
> index d69a99c..33aa727 100644
> --- a/drivers/pch/Makefile
> +++ b/drivers/pch/Makefile
> @@ -3,3 +3,4 @@
>  #
>
>  obj-y += pch-uclass.o
> +obj-y += pch7.o
> diff --git a/drivers/pch/pch7.c b/drivers/pch/pch7.c
> new file mode 100644
> index 0000000..f1c780c
> --- /dev/null
> +++ b/drivers/pch/pch7.c
> @@ -0,0 +1,30 @@
> +/*
> + * Copyright (C) 2014 Google, Inc
> + *
> + * SPDX-License-Identifier:    GPL-2.0+
> + */
> +
> +#include <common.h>
> +#include <dm.h>
> +#include <pch.h>
> +
> +static int queensbay_pch_get_version(struct udevice *dev)

Can we rename this to: pch7_get_version()?

> +{
> +       return 7;
> +}
> +
> +static const struct pch_ops queensbay_pch9_ops = {

pch7_ops?

> +       .get_version    = queensbay_pch_get_version,

no get_sbase() implementation for pch7?

> +};
> +
> +static const struct udevice_id queensbay_pch_ids[] = {

pch7_ids?

> +       { .compatible = "intel,pch7" },
> +       { }
> +};
> +
> +U_BOOT_DRIVER(queensbay_drv) = {

pch7_drv?

> +       .name           = "intel-pch",

"intel-pch7"?

> +       .id             = UCLASS_PCH,
> +       .of_match       = queensbay_pch_ids,
> +       .ops            = &queensbay_pch9_ops,
> +};
> --

Regards,
Bin
diff mbox

Patch

diff --git a/drivers/pch/Makefile b/drivers/pch/Makefile
index d69a99c..33aa727 100644
--- a/drivers/pch/Makefile
+++ b/drivers/pch/Makefile
@@ -3,3 +3,4 @@ 
 #
 
 obj-y += pch-uclass.o
+obj-y += pch7.o
diff --git a/drivers/pch/pch7.c b/drivers/pch/pch7.c
new file mode 100644
index 0000000..f1c780c
--- /dev/null
+++ b/drivers/pch/pch7.c
@@ -0,0 +1,30 @@ 
+/*
+ * Copyright (C) 2014 Google, Inc
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <pch.h>
+
+static int queensbay_pch_get_version(struct udevice *dev)
+{
+	return 7;
+}
+
+static const struct pch_ops queensbay_pch9_ops = {
+	.get_version	= queensbay_pch_get_version,
+};
+
+static const struct udevice_id queensbay_pch_ids[] = {
+	{ .compatible = "intel,pch7" },
+	{ }
+};
+
+U_BOOT_DRIVER(queensbay_drv) = {
+	.name		= "intel-pch",
+	.id		= UCLASS_PCH,
+	.of_match	= queensbay_pch_ids,
+	.ops		= &queensbay_pch9_ops,
+};