forked from Minki/linux
This pull request contains Broadcom ARM-based SoCs drivers changes:
- Justin adds a soc_dev driver to properly report to user-space the Broadcom STB SoC family, product and revision - Florian reworks how the brcmstb_gisb driver dependency is done to enable it on Broadcom STB MIPS-based SoCs and remove a select in arch/arm/mach-bcm/Kconfig -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJXG8wwAAoJEIfQlpxEBwcEO3IP/1kmk92qtFzqQJu2IgZcBReD tTLcjDigvJWA6fa4fsJ8kmtl3rT+cjSEblWSh9oELjbdzEhfk+n2j9ZkMKXRSQIw R57Db/RwIwuzSzUb9NMG3UWoeZ6ebKE+MIKS0pQlpD/uUDRHGYHrgNVFlAJZ7KTF v3Kqb3lUncxeYmCfRenqIPkLARyh6e2GnTk5j8D4fm7Rfrfbu7rVdCmxvJqMpDbg q6f3cWNUYQzbniieOkbw4xKab5PlAq69JXMVc3gNACRuTn8zzRBtBfe96Vf0KFZF +pboW3jzUf0/tr+pPwAkj5ccIVVqx/+5SUha75YShiVTmfSrn57AoZp4vtkxDg5s yEN/rb+fnyc0B5akCH8ukpABIzk60WOmmp4GY6hkR6Ibknxan5PNNaE2DE6fQa60 xSx4duYdNLlUmsfsEFMugbWVY1F8wlxtzHRs9ReZR+44/tH+zOUJWyGXb/GJEkhP 4L6KtGFVpWlTb77gWj42ZdAzMYTz1M8HtuqDmPXpf5ucVz6zPrzO5PmcAwarktLR fxtqztdjva2BphaboGLyZD+Xr8qeSISBncyogZQI9rI2C13v2Y8W5thw+IFR0VAk uoADTLthFEogidrLpqO8rdSyrPIl3wVdCvFb1XoUGdYa6c1ElWHEhlkhcdUDq6Vd zNuh2l+0UqWmp3jeE4cR =OJuu -----END PGP SIGNATURE----- Merge tag 'arm-soc/for-4.7/drivers' of http://github.com/Broadcom/stblinux into next/drivers Merge "Broadcom ARM-based SoCs drivers changes" from Florian Fainelli: - Justin adds a soc_dev driver to properly report to user-space the Broadcom STB SoC family, product and revision - Florian reworks how the brcmstb_gisb driver dependency is done to enable it on Broadcom STB MIPS-based SoCs and remove a select in arch/arm/mach-bcm/Kconfig * tag 'arm-soc/for-4.7/drivers' of http://github.com/Broadcom/stblinux: bus: brcmstb_gisb: Rework dependencies soc: brcmstb: add SoC driver to brcmstb
This commit is contained in:
commit
c6ba3f6932
@ -173,12 +173,12 @@ config ARCH_BRCMSTB
|
||||
select ARM_GIC
|
||||
select ARM_ERRATA_798181 if SMP
|
||||
select HAVE_ARM_ARCH_TIMER
|
||||
select BRCMSTB_GISB_ARB
|
||||
select BRCMSTB_L2_IRQ
|
||||
select BCM7120_L2_IRQ
|
||||
select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE
|
||||
select ARCH_WANT_OPTIONAL_GPIOLIB
|
||||
select SOC_BRCMSTB
|
||||
select SOC_BUS
|
||||
help
|
||||
Say Y if you intend to run the kernel on a Broadcom ARM-based STB
|
||||
chipset.
|
||||
|
@ -58,6 +58,7 @@ config ARM_CCN
|
||||
config BRCMSTB_GISB_ARB
|
||||
bool "Broadcom STB GISB bus arbiter"
|
||||
depends on ARM || MIPS
|
||||
default ARCH_BRCMSTB || BMIPS_GENERIC
|
||||
help
|
||||
Driver for the Broadcom Set Top Box System-on-a-chip internal bus
|
||||
arbiter. This driver provides timeout and target abort error handling
|
||||
|
@ -12,10 +12,18 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <linux/io.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_address.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/soc/brcmstb/brcmstb.h>
|
||||
#include <linux/sys_soc.h>
|
||||
|
||||
#include <soc/brcmstb/common.h>
|
||||
|
||||
static u32 family_id;
|
||||
static u32 product_id;
|
||||
|
||||
static const struct of_device_id brcmstb_machine_match[] = {
|
||||
{ .compatible = "brcm,brcmstb", },
|
||||
{ }
|
||||
@ -31,3 +39,53 @@ bool soc_is_brcmstb(void)
|
||||
|
||||
return of_match_node(brcmstb_machine_match, root) != NULL;
|
||||
}
|
||||
|
||||
static const struct of_device_id sun_top_ctrl_match[] = {
|
||||
{ .compatible = "brcm,brcmstb-sun-top-ctrl", },
|
||||
{ }
|
||||
};
|
||||
|
||||
static int __init brcmstb_soc_device_init(void)
|
||||
{
|
||||
struct soc_device_attribute *soc_dev_attr;
|
||||
struct soc_device *soc_dev;
|
||||
struct device_node *sun_top_ctrl;
|
||||
void __iomem *sun_top_ctrl_base;
|
||||
|
||||
sun_top_ctrl = of_find_matching_node(NULL, sun_top_ctrl_match);
|
||||
if (!sun_top_ctrl)
|
||||
return -ENODEV;
|
||||
|
||||
sun_top_ctrl_base = of_iomap(sun_top_ctrl, 0);
|
||||
if (!sun_top_ctrl_base)
|
||||
return -ENODEV;
|
||||
|
||||
family_id = readl(sun_top_ctrl_base);
|
||||
product_id = readl(sun_top_ctrl_base + 0x4);
|
||||
|
||||
soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
|
||||
if (!soc_dev_attr)
|
||||
return -ENOMEM;
|
||||
|
||||
soc_dev_attr->family = kasprintf(GFP_KERNEL, "%x",
|
||||
family_id >> 28 ?
|
||||
family_id >> 16 : family_id >> 8);
|
||||
soc_dev_attr->soc_id = kasprintf(GFP_KERNEL, "%x",
|
||||
product_id >> 28 ?
|
||||
product_id >> 16 : product_id >> 8);
|
||||
soc_dev_attr->revision = kasprintf(GFP_KERNEL, "%c%d",
|
||||
((product_id & 0xf0) >> 4) + 'A',
|
||||
product_id & 0xf);
|
||||
|
||||
soc_dev = soc_device_register(soc_dev_attr);
|
||||
if (IS_ERR(soc_dev)) {
|
||||
kfree(soc_dev_attr->family);
|
||||
kfree(soc_dev_attr->soc_id);
|
||||
kfree(soc_dev_attr->revision);
|
||||
kfree(soc_dev_attr);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
arch_initcall(brcmstb_soc_device_init);
|
||||
|
Loading…
Reference in New Issue
Block a user