soc: add stubs for brcmstb SoC's
authorBrian Norris <computersforpeace@gmail.com>
Fri, 19 Jun 2015 00:11:32 +0000 (17:11 -0700)
committerFlorian Fainelli <f.fainelli@gmail.com>
Mon, 14 Sep 2015 22:44:18 +0000 (15:44 -0700)
Used on BCM7xxx Set-Top Box chips (e.g., BCM7445).

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
arch/arm/mach-bcm/Kconfig
drivers/soc/Kconfig
drivers/soc/Makefile
drivers/soc/brcmstb/Kconfig [new file with mode: 0644]
drivers/soc/brcmstb/Makefile [new file with mode: 0644]
drivers/soc/brcmstb/common.c [new file with mode: 0644]
include/soc/brcmstb/common.h [new file with mode: 0644]

index 1679fa4fb700df1435ee9b44dbfb5f0b65ee5a34..0be09af9dec724aec2ed818959753cebf84f85fe 100644 (file)
@@ -161,6 +161,7 @@ config ARCH_BRCMSTB
        select BCM7120_L2_IRQ
        select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE
        select ARCH_WANT_OPTIONAL_GPIOLIB
+       select SOC_BRCMSTB
        help
          Say Y if you intend to run the kernel on a Broadcom ARM-based STB
          chipset.
index 96ddecb922545e9294040e05950e6c695e01b3c6..c9c0fcce98a7627da16e6f41be04dae5bfe619d5 100644 (file)
@@ -1,5 +1,6 @@
 menu "SOC (System On Chip) specific Drivers"
 
+source "drivers/soc/brcmstb/Kconfig"
 source "drivers/soc/mediatek/Kconfig"
 source "drivers/soc/qcom/Kconfig"
 source "drivers/soc/sunxi/Kconfig"
index 0b12d777d3c4a9114fa80911b27fbb496c0ae307..4e27f10367f0f6effb7991beb5111d983692ce5b 100644 (file)
@@ -2,6 +2,7 @@
 # Makefile for the Linux Kernel SOC specific device drivers.
 #
 
+obj-$(CONFIG_SOC_BRCMSTB)      += brcmstb/
 obj-$(CONFIG_MACH_DOVE)                += dove/
 obj-$(CONFIG_ARCH_MEDIATEK)    += mediatek/
 obj-$(CONFIG_ARCH_QCOM)                += qcom/
diff --git a/drivers/soc/brcmstb/Kconfig b/drivers/soc/brcmstb/Kconfig
new file mode 100644 (file)
index 0000000..39cab3b
--- /dev/null
@@ -0,0 +1,9 @@
+menuconfig SOC_BRCMSTB
+       bool "Broadcom STB SoC drivers"
+       depends on ARM
+       help
+         Enables drivers for the Broadcom Set-Top Box (STB) series of chips.
+         This option alone enables only some support code, while the drivers
+         can be enabled individually within this menu.
+
+         If unsure, say N.
diff --git a/drivers/soc/brcmstb/Makefile b/drivers/soc/brcmstb/Makefile
new file mode 100644 (file)
index 0000000..183280e
--- /dev/null
@@ -0,0 +1 @@
+obj-y                          += common.o
diff --git a/drivers/soc/brcmstb/common.c b/drivers/soc/brcmstb/common.c
new file mode 100644 (file)
index 0000000..c262c02
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright © 2014 NVIDIA Corporation
+ * Copyright © 2015 Broadcom Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/of.h>
+
+#include <soc/brcmstb/common.h>
+
+static const struct of_device_id brcmstb_machine_match[] = {
+       { .compatible = "brcm,brcmstb", },
+       { }
+};
+
+bool soc_is_brcmstb(void)
+{
+       struct device_node *root;
+
+       root = of_find_node_by_path("/");
+       if (!root)
+               return false;
+
+       return of_match_node(brcmstb_machine_match, root) != NULL;
+}
diff --git a/include/soc/brcmstb/common.h b/include/soc/brcmstb/common.h
new file mode 100644 (file)
index 0000000..cfb5335
--- /dev/null
@@ -0,0 +1,15 @@
+/*
+ * Copyright © 2014 NVIDIA Corporation
+ * Copyright © 2015 Broadcom Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __SOC_BRCMSTB_COMMON_H__
+#define __SOC_BRCMSTB_COMMON_H__
+
+bool soc_is_brcmstb(void);
+
+#endif /* __SOC_BRCMSTB_COMMON_H__ */