X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fopenwrt.git;a=blobdiff_plain;f=target%2Flinux%2Fbcm53xx%2Fpatches-3.10%2F111-bcma-register-bcma-as-device-tree-driver.patch;h=fe44827082a8f2f0f625a340bb9ebbc7794b696f;hp=0077f90379c96f00ad9e913f7190e24193cf793a;hb=b75a9b04dfd077a5b57ba2785cc3bab7a5a79b80;hpb=f491623c3771b47fca0a53bd5776730bea741890 diff --git a/target/linux/bcm53xx/patches-3.10/111-bcma-register-bcma-as-device-tree-driver.patch b/target/linux/bcm53xx/patches-3.10/111-bcma-register-bcma-as-device-tree-driver.patch index 0077f90379..fe44827082 100644 --- a/target/linux/bcm53xx/patches-3.10/111-bcma-register-bcma-as-device-tree-driver.patch +++ b/target/linux/bcm53xx/patches-3.10/111-bcma-register-bcma-as-device-tree-driver.patch @@ -1,12 +1,16 @@ -bcma: register bcma as device tree driver +From c046c19fc8f1af7cf253fea5b0253143c159948a Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Mon, 6 Jan 2014 23:29:15 +0100 +Subject: [PATCH 6/8] bcma: register bcma as device tree driver This driver is used by the bcm53xx ARM SoC code.Now it is possible to give the address of the chipcommon core in device tree. Signed-off-by: Hauke Mehrtens --- - drivers/bcma/host_soc.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 73 insertions(+) + drivers/bcma/host_soc.c | 70 +++++++++++++++++++++++++++++++++++++++++++++ + include/linux/bcma/bcma.h | 2 ++ + 2 files changed, 72 insertions(+) --- a/drivers/bcma/host_soc.c +++ b/drivers/bcma/host_soc.c @@ -20,7 +24,15 @@ Signed-off-by: Hauke Mehrtens #include #include -@@ -181,3 +184,73 @@ int __init bcma_host_soc_register(struct +@@ -173,6 +176,7 @@ int __init bcma_host_soc_register(struct + /* Host specific */ + bus->hosttype = BCMA_HOSTTYPE_SOC; + bus->ops = &bcma_host_soc_ops; ++ bus->host_pdev = NULL; + + /* Register */ + err = bcma_bus_early_register(bus, &soc->core_cc, &soc->core_mips); +@@ -181,3 +185,69 @@ int __init bcma_host_soc_register(struct return err; } @@ -34,20 +46,19 @@ Signed-off-by: Hauke Mehrtens + int err; + + /* Alloc */ -+ bus = kzalloc(sizeof(*bus), GFP_KERNEL); ++ bus = devm_kzalloc(dev, sizeof(*bus), GFP_KERNEL); + if (!bus) + return -ENOMEM; + + /* Map MMIO */ -+ err = -ENOMEM; + bus->mmio = of_iomap(np, 0); + if (!bus->mmio) -+ goto err_kfree_bus; ++ return -ENOMEM; + + /* Host specific */ + bus->hosttype = BCMA_HOSTTYPE_SOC; + bus->ops = &bcma_host_soc_ops; -+ ++ bus->host_pdev = pdev; + + /* Register */ + err = bcma_bus_register(bus); @@ -60,8 +71,6 @@ Signed-off-by: Hauke Mehrtens + +err_unmap_mmio: + iounmap(bus->mmio); -+err_kfree_bus: -+ kfree(bus); + return err; +} + @@ -71,7 +80,6 @@ Signed-off-by: Hauke Mehrtens + + bcma_bus_unregister(bus); + iounmap(bus->mmio); -+ kfree(bus); + platform_set_drvdata(pdev, NULL); + + return 0; @@ -94,3 +102,14 @@ Signed-off-by: Hauke Mehrtens +}; +module_platform_driver(bcma_host_soc_driver); +#endif /* CONFIG_OF */ +--- a/include/linux/bcma/bcma.h ++++ b/include/linux/bcma/bcma.h +@@ -319,6 +319,8 @@ struct bcma_bus { + struct pci_dev *host_pci; + /* Pointer to the SDIO device (only for BCMA_HOSTTYPE_SDIO) */ + struct sdio_func *host_sdio; ++ /* Pointer to platform device (only for BCMA_HOSTTYPE_SOC) */ ++ struct platform_device *host_pdev; + }; + + struct bcma_chipinfo chipinfo;