summaryrefslogtreecommitdiffstats
path: root/drivers/mci/omap_hsmmc.c
Commit message (Collapse)AuthorAgeFilesLines
* treewide: add MODULE_DEVICE_TABLE markersAhmad Fatoum2023-06-131-0/+1
| | | | | | | | | | | | | | | | Syncing device trees with Linux upstream can lead to breakage, when the device trees are switched to newer bindings, which are not yet supported in barebox. To make it easier to spot such issues, we want to start applying some heuristics to flag possibly problematic DT changes. One step towards being able to do that is to know what nodes barebox actually consumes. Most of the nodes have a compatible entry, which is matched by an array of of_device_id, so let's have MODULE_DEVICE_TABLE point at it for future extraction. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230612125908.1087340-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: omap: Move mach header files to include/mach/omapSascha Hauer2023-03-061-2/+2
| | | | | | | | | | Currently arch specific headers can be included with longer possible as there won't be a single mach anymore. Move all omap specific header files to include/mach/omap/ to prepare for multi-arch support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Rename struct driver_d to driverSascha Hauer2023-01-101-1/+1
| | | | | | | | | | | The '_d' suffix was originally meant to distinguish barebox struct names from Linux struct names. struct driver doesn't exist in Linux, so we can rename it and remove the meaningless suffix. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-4-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Rename struct device_d to deviceSascha Hauer2023-01-101-3/+3
| | | | | | | | | | | | | The '_d' suffix was originally introduced in case we want to import Linux struct device as a separate struct into barebox. Over time it became clear that this won't happen, instead barebox struct device_d is basically the same as Linux struct device. Rename the struct name accordingly to make porting Linux code easier. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-3-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: Replace license and copyright boilerplate by SPDX identifiersUwe Kleine-König2020-12-071-16/+3
| | | | | | | | | Converts the files that licensecheck can determine to be licensed under GPL-2.0-only or GPL-2.0-or-later and also convert the copyright statements to SPDX. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: omap: add new am335x and am437x SDHCI specific compatiblesAhmad Fatoum2020-07-111-0/+6
| | | | | | | | | | | | | | For a while now, Linux has had a sdhci-omap driver for TI's OMAP SoCs making use of the SDHCI core library. This was in addition to the older omap-hsmmc driver, which didn't. Linux commit 0b4edf11187 ("ARM: dts: Move am33xx and am43xx mmc nodes to sdhci-omap driver") changes the device tree compatible of the mmc nodes on the am33xx and am43xx SoCs away from the omap-hsmmc to the SDHCI driver. Add the new compatibles, so we aren't broken by the change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: remove now-duplicate dev->detect implementations in host driversAhmad Fatoum2020-06-031-10/+0
| | | | | | | | | Previous commit introduced a fall-back MCI hw_dev->detect implementation. All drivers touched in this commit populate hw_dev, so lets drop their now-superfluous detect implementations. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: remove references to CREDITSUwe Kleine-König2020-04-271-3/+0
| | | | | | | | The CREDITS file was removed from barebox in 2015 by commit 6570288f2d97 ("Remove the CREDITS file"). Remove references to it from several files. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mmc'Sascha Hauer2019-01-151-6/+0
|\
| * mci: omap_hsmmc: Drop explicit devname setup codeAndrey Smirnov2018-12-101-6/+0
| | | | | | | | | | | | | | | | Drop explicit devname setup code. Same setup will be done by mci_of_parse(). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: omap: use IS_ENABLED() rather than #ifdefSascha Hauer2018-12-141-9/+12
| | | | | | | | | | | | | | While touching it propagate the errors from read/write functions instead of silently ignoring them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mci: omap: Improve error handlingSascha Hauer2018-12-141-5/+11
|/ | | | | | | | Return proper error code from read/write functions rather than '1'. Also add messages printing the status register to give a glue what went wrong. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: omap: Add devicetree options parsing by MCI core.Alexander Shiyan2017-01-101-0/+2
| | | | | | | | This patch adds a callback to parsing devicetree options for MMC: bus-width, etc.. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> 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>
* of: use 'const void *' for struct of_device_id.dataAntony Pavlov2015-04-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* resource: Let dev_request_mem_region return an error pointerSascha Hauer2014-09-161-0/+3
| | | | | | For all users fix or add the error check. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/omap-drivers'Sascha Hauer2013-12-061-0/+13
|\
| * mmc: omap: Add devicetree supportSascha Hauer2013-11-271-0/+13
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mmc: omap: name mmc device after devicetree aliasSascha Hauer2013-11-251-0/+6
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: omap: Fix default value of mci.f_maxTeresa Gámez2013-10-021-3/+1
| | | | | | | | | | | With commit c2ef47887 mci.f_max default value is only set when pdata is available. Fix this with always setting the mci.f_max default value and overrite it when pdata available. Signed-off-by: Teresa Gámez <t.gamez@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: omap: Allow to set mmc devname via platformdataSascha Hauer2013-08-271-4/+10
| | | | | | To be able to get persistent names for the sd/mmc devices. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: omap: implement device detect callbackSascha Hauer2013-08-271-0/+10
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: omap: advertise 8 bit supportSascha Hauer2013-08-271-1/+1
| | | | | | | The driver is already capable of 8 bit buswidth support, so advertise it to actually make use of it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: rename capabilities flagsSascha Hauer2013-06-031-1/+2
| | | | | | | | | | Use MMC_CAP_ names instead of MMC_MODE_. This makes it more clear that these are capabilities of host/card and do not refer to the current mode. These are in line with the Linux Kernel except for MMC_CAP_MMC_HIGHSPEED_52MHZ which could be fixed later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mfd: Using MFD_xx prefix for symbolsAlexander Shiyan2013-02-181-2/+2
| | | | | | | | This patch provides rename MFD-related symbols for using MFD-prefix. Additionally, sorting mfd/Kconfig and mfd/Makefile records. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Use new device_platform_driver() macro for driversAlexander Shiyan2013-02-131-8/+1
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM omap / mci: Fix register offsetsSascha Hauer2013-01-081-1/+33
| | | | | | | | Only the OMAP4 has a register offset of 0x100 in the register space. Fix this by using the device id mechanism. This became broken when the device register convenience functions were introduced. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci omap_hsmmc: Fix whitespacesSascha Hauer2013-01-071-5/+4
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM omap hsmmc: Fix register offsetSascha Hauer2012-12-191-1/+3
| | | | | | | | | The hsmmc module has a 0x100 offset in its register space. The real register space size for the module is 4K, so when we register the device with the size 4k, we have to account for the offset in the driver, not in the resource allocation. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* switch all platform_bus device/driver registering to ↵Jean-Christophe PLAGNIOL-VILLARD2012-10-041-1/+1
| | | | | | | | platform_driver/device_register now register_driver and register_device are for bus only usage. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Merge branch 'for-next/remove-fsf-address'Sascha Hauer2012-10-031-4/+0
|\ | | | | | | | | | | Conflicts: drivers/net/miidev.c include/miidev.h
| * Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-4/+0
| | | | | | | | | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mmc_omap: improve error messagevicencb@gmail.com2012-10-021-1/+1
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: remove unused device argument from set_iosSascha Hauer2012-02-091-2/+1
| | | | | | This argmuent is unused in all drivers, so remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci core: replace discrete ios values with struct iosSascha Hauer2012-02-091-9/+10
| | | | | | | As we'll need more arguments to set_ios over time put them in a struct mci_ios like the kernel does. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* omap_hsmmc: setup mmc voltage on twl6030Alexander Aring2011-12-211-0/+17
| | | | | | | | Support the setup of the mmc voltage, when booting OMAP4 with twl6030 from nand. Signed-off-by: Alexander Aring <a.aring@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci omap: do not fail on nonexistent pdataSascha Hauer2011-10-131-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* introduce io.hSascha Hauer2011-09-221-1/+1
| | | | | | | To allow for some generic io accessors introduce io.h and use this instead of asm/io.h throughout the tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add omap_hsmmc platform data.Juergen Kilb2011-09-121-1/+9
| | | | | | | | Add platform data to specify maximum frequency of hsmmc interface which can be restricted due to external level shifters. Signed-off-by: Juergen Kilb <J.Kilb@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: parent fixupsSascha Hauer2011-08-171-0/+1
| | | | | | | Make the mci host a child of the hardware device and the disk a child of the mci host. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: switch to "struct resource"Jean-Christophe PLAGNIOL-VILLARD2011-07-231-1/+1
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* mci omap: make write support optionalSascha Hauer2011-04-121-1/+4
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci omap: rename functions from mxc to omapSascha Hauer2011-04-121-6/+6
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: Add omap hsmmc driverSascha Hauer2011-04-041-0/+582
This driver is based on the U-Boot omap hsmmc driver by Sukumar Ghorai <s-ghorai@ti.com>. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>