summaryrefslogtreecommitdiffstats
path: root/drivers/bus
Commit message (Collapse)AuthorAgeFilesLines
* mtd: nand: omap_gpmc: Remove BCH4 supportTeresa Remmet2016-04-121-3/+0
| | | | | | | This has no users and seems to be untested. Removed it. Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* driver: replace dev_request_mem_region with dev_request_mem_resourceSascha Hauer2016-03-071-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dev_request_mem_region doesn't work properly one some SoCs on which PTR_ERR() values clash with valid return values from dev_request_mem_region. Replace them with dev_request_mem_resource where possible. This patch has been generated with the following semantic patch: // <smpl> @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) { ... - return PTR_ERR(io); -} + return PTR_ERR(iores); +} +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) - return PTR_ERR(io); -} + return PTR_ERR(iores); +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { - ret = PTR_ERR(io); +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) { + ret = PTR_ERR(iores); ... } +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) + return PTR_ERR(iores); +io = IOMEM(iores->start); ...+> } @@ identifier func; @@ func(...) { <+... struct resource *iores; -struct resource *iores; ...+> } // </smpl> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bus: omap-gpmc: Add Generic device supportSascha Hauer2015-07-021-0/+142
| | | | | | | This adds support for generic devices like NOR flash and ethernet to the gpmc bus driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bus: omap-gpmc: fix wrong bit settingSascha Hauer2015-07-021-1/+1
| | | | | | | GPMC_CONFIG4_WEEXTRADELAY should be set depending on we_extra_delay, not on oe_extra_delay. This seems to be copy-pasted from two lines above. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/of-device-id'Sascha Hauer2015-05-062-15/+15
|\
| * of: use 'const void *' for struct of_device_id.dataAntony Pavlov2015-04-302-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since 2011 barebox' of_device_id struct uses unsigned long type for data field: struct of_device_id { char *compatible; unsigned long data; }; Almost always struct of_device_id.data field are used as pointer and need 'unsigned long' casting. E.g. see 'git grep -A 4 of_device_id drivers/' output: drivers/ata/sata-imx.c:static __maybe_unused struct of_device_id imx_sata_dt_ids[] = { drivers/ata/sata-imx.c- { drivers/ata/sata-imx.c- .compatible = "fsl,imx6q-ahci", drivers/ata/sata-imx.c- .data = (unsigned long)&data_imx6, drivers/ata/sata-imx.c- }, { Here is of_device_id struct in linux kernel v4.0: struct of_device_id { char name[32]; char type[32]; char compatible[128]; const void *data; }; Changing of_device_id.data type to 'const void *data' will increase barebox' linux kernel compatibility and decrease number of 'unsigned long' casts. Part of the patch was done using the 'coccinelle' tool with the following semantic patch: @rule1@ identifier dev; identifier type; identifier func; @@ func(...) { <... - dev_get_drvdata(dev, (unsigned long *)&type) + dev_get_drvdata(dev, (const void **)&type) ...> } @rule2@ identifier dev; identifier type; identifier func; identifier data; @@ func(...) { <... - dev_get_drvdata(dev, (unsigned long *)&type->data) + dev_get_drvdata(dev, (const void **)&type->data) ...> } Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | bus: mvebu-mbus: Convert mbus platform driver to direct driverSebastian Hesselbarth2015-04-271-13/+1
| | | | | | | | | | | | | | | | | | | | Registering mbus driver as platform driver is a little late for some register accesses to work. We have to make sure boot-up mbus windows are disabled early, so call mbus driver directly from SoC init. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | bus: mvebu-mbus: Drop device referenceSebastian Hesselbarth2015-04-271-14/+14
| | | | | | | | | | | | | | | | | | Prior converting mbus driver from a platform device back to directly called SoC driver, drop the device_d reference and covert dev_foo to pr_foo. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | bus: mvebu-mbus: Remove coherency attributeSebastian Hesselbarth2015-04-271-6/+0
|/ | | | | | | | Marvell Armada 370 and XP have some coherency fabric. We are not interested in using it, so remove checking for it in mbus driver. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sizes.h: move include/sizes.h to include/linux/sizes.hMasahiro Yamada2015-01-081-1/+1
| | | | | | | | | | | | | | This file originates in Linux. Linux has it under include/linux/ directory since commit dccd2304cc90. Let's move it to the same place as well in barebox. This commit was generated by the following commands: find -name '*.[chS]' | xargs sed -i -e 's:<sizes.h>:<linux/sizes.h>:' git mv include/sizes.h include/linux/ Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/resource-err-ptr'Sascha Hauer2014-10-022-4/+6
|\
| * resource: Let dev_request_mem_region return an error pointerSascha Hauer2014-09-161-2/+3
| | | | | | | | | | | | For all users fix or add the error check. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * resource: Let dev_get_mem_region return an error pointerSascha Hauer2014-09-161-2/+3
| | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
* | ARM: mvebu: Add machine compatible to mbus rangesSebastian Hesselbarth2014-09-191-1/+5
|/ | | | | | | | | | Multi-SoC support for MVEBU will add mbus ranges for all compiled SoCs. To protect the mbus node of the SoC barebox is executed on from others ranges, pass machine's compatible to mvebu_mbus_add_range and check before applying the fixup. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/marvell'Sascha Hauer2014-08-071-5/+92
|\
| * bus: mvebu: fix ranges fixupEzequiel Garcia2014-08-041-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current fixup code is slightly wrong, and only works when the root address cell number is one. However, Armada XP has a root address cell number of two. In this case we are currently applying the fixup on the child high base address, while it should be applied on the child low base address. Fix it and add some detailed explanation to avoid having to figure this out each time. Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * bus: mvebu: fix resource size handlingSebastian Hesselbarth2014-07-311-4/+4
| | | | | | | | | | | | | | | | | | | | A resource_size is defined as res->end - res->start + 1. Marvell MBUS driver gets some ranges from DT as start and size but mis-calculates end of range. This fixes 4 occurences of those mistakes. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Acked-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: mvebu: allow to fixup mbus rangesSebastian Hesselbarth2014-07-251-1/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Marvell MVEBU SoCs internal registers are usually remapped from reset default. While Dove and Kirkwood always had their registers remapped, some Armada 370 and XP where shipped with bootloaders that did not remap them. On Barebox these registers are remapped early and on all MVEBU SoCs, so provided DTs should always reflect that in their mbus ranges property. This patch registers a fixup for DTBs and allows individual SoCs to add specific remap ranges to the fixup list. The fixup is registered on pure_initcall to even allow to fixup pbl or appended DTBs. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mtd: omap gpmc: fix bch8 nand-ecc-opt propertySascha Hauer2014-08-011-3/+0
|/ | | | | | | | | We interpret the ECC option "bch8" as OMAP_ECC_BCH8_CODE_HW, but the Kernel uses OMAP_ECC_BCH8_CODE_HW_ROMCODE in this case instead. To make the interpretation of the ti,nand-ecc-opt property compatible to the Kernel we have to use OMAP_ECC_BCH8_CODE_HW_ROMCODE for "bch8" Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bus: mvebu: add mbus driverSebastian Hesselbarth2014-02-103-6/+757
| | | | | | | | | | | | This imports the Marvell mbus driver from Linux. The mbus is the main downstream bus found on all Marvell Orion SoCs. The driver deals with re-configurable address windows which are currently parsed from DT. Also enable the driver as default on all MVEBU SoCs. While at it, also reorder drivers/bus/{Kconfig,Makefile} alphabetically. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bus: Add omap gpmc driverSascha Hauer2013-11-273-0/+530
| | | | | | | This adds a devicetree-only driver for to configure the gpmc and its child devices from dt. Currently only NAND is supported. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bus: Add imx-weim supportSascha Hauer2013-07-163-0/+179
Mostly taken from the kernel with support for other SoCs from Alexander Shiyan. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Cc: Alexander Shiyan <shc_work@mail.ru>