summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
...
* | | dm: Drop uclass_resolve_seq()Simon Glass2020-12-182-47/+0
| | | | | | | | | | | | | | | | | | This function is not needed anymore. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: Switch over to use new sequence number for dev_seq()Simon Glass2020-12-181-4/+2
| | | | | | | | | | | | | | | | | | | | | Update this function to use the new sequence number and fix up the test that deals with this. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | pinctrl: Update for new sequence numbersSimon Glass2020-12-181-1/+1
| | | | | | | | | | | | | | | | | | Use the dev_seq() sequence number in all cases. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | gpio: Update for new sequence numbersSimon Glass2020-12-185-5/+5
| | | | | | | | | | | | | | | | | | Use the dev_seq() sequence number in all cases. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | usb: Update for new sequence numbersSimon Glass2020-12-181-4/+2
| | | | | | | | | | | | | | | | | | | | | Use the new sequence number in all cases. Since all devices are assigned a number when bound, this hack should not be needed. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | usb: ehci-mx6: Drop assignment of sequence numberSimon Glass2020-12-181-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | This hack cannot work in the new sequence-numbering scheme. Remove it while we wait for the maintainer to complete DM conversion as noted in the existing comment. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | spi: Update for new sequence numbersSimon Glass2020-12-182-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | Use the new sequence number in all cases. Drop the rockchip case because the sequence number should be 0 anyway, and assigning to the sequence number is not permitted. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | pci: Update to use new sequence numbersSimon Glass2020-12-182-23/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we know the sequence number at bind time, there is no need for special-case code in dm_pci_hose_probe_bus(). Note: the PCI_CAP_ID_EA code may need a look, but there are no test failures so I have left it as is. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: core: Allow manual sequence numberingSimon Glass2020-12-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some buses have their own rules which require assigning sequence numbers with a bus-specific algorithm. For example, PCI requires that sub-buses are numbered higher than their parent buses, meaning effectively that parent buses must be numbered only after all of their child buses have been numbered. Add a uclass flag to indicate that driver model should not assign sequence numbers. In this case, the uclass must do it. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | net: Update to use new sequence numbersSimon Glass2020-12-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Checking for seq == -1 is effectively checking that the device is activated. The new sequence numbers are never -1 for a bound device, so update the check. Also drop the note about valid sequence numbers so it is accurate with the new approach. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | i2c: Update for new sequence numbersSimon Glass2020-12-186-80/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the new sequence number in all cases. Drop the logic to check for a valid number in designware_i2c, since it will always be valid. Also drop the numbering in the uclass, since we can rely on driver model giving us the right sequence numbers. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | octeon: Don't attempt to set the sequence numberSimon Glass2020-12-183-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | Several Octeon drivers operate by setting the sequence number of their device. This should not be needed with the new sequence number setup. Also it is not permitted. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: Fix return value in dev_read_alias_seq()Simon Glass2020-12-181-1/+3
| | | | | | | | | | | | | | | | | | This should return 0 on success but currently does not. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: core: Switch binding to use new sequence numbersSimon Glass2020-12-181-4/+1
| | | | | | | | | | | | | | | | | | | | | Update the core logic to use the new approach. For now the old code is left as is. Update one test so it still passes. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: core: Add a new sequence number for devicesSimon Glass2020-12-182-9/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present each device has two sequence numbers, with 'req_seq' being set up at bind time and 'seq' at probe time. The idea is that devices can 'request' a sequence number and then the conflicts are resolved when the device is probed. This makes things complicated in a few cases, since we don't really know what the sequence number will end up being. We want to honour the bind-time requests if at all possible, but in fact the only source of these at present is the devicetree aliases. Since we have the devicetree available at bind time, we may as well just use it, in the hope that the required processing will turn out to be useful later (i.e. the device actually gets used). Add a new 'sqq' member, the bind-time sequence number. It operates in parallel to the old values for now. All devices get a valid sqq value, i.e. it is never -1. Drop an #ifdef while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: core: Update uclass_find_next_free_req_seq() argsSimon Glass2020-12-183-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present this is passed a uclass ID and it has to do a lookup. The callers all have the uclass pointer, except for the I2C uclass where the code will soon be deleted. Update the argument to a uclass * instead of an ID since it is more efficient. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: Avoid accessing seq directlySimon Glass2020-12-1879-153/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present various drivers etc. access the device's 'seq' member directly. This makes it harder to change the meaning of that member. Change access to go through a function instead. The drivers/i2c/lpc32xx_i2c.c file is left unchanged for now. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: treewide: Rename ..._platdata variables to just ..._platSimon Glass2020-12-13250-1151/+1145
| | | | | | | | | | | | | | | | | | | | | Try to maintain some consistency between these variables by using _plat as a suffix for them. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: treewide: Update 'auto' declarations to be on one lineSimon Glass2020-12-139-18/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix up the code style for those declarations that should now fit onto one line, which is all of them that currently do not. This is needed for dtoc to detect the structs correctly, at present. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: treewide: Rename ofdata_to_platdata() to of_to_plat()Simon Glass2020-12-13335-708/+709
| | | | | | | | | | | | | | | | | | | | | This name is far too long. Rename it to remove the 'data' bits. This makes it consistent with the platdata->plat rename. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: treewide: Rename dev_get_platdata() to dev_get_plat()Simon Glass2020-12-13308-947/+947
| | | | | | | | | | | | | | | | | | Rename this to be consistent with the change from 'platdata'. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: Rename 'platdata_size' to 'plat_size'Simon Glass2020-12-131-8/+7
| | | | | | | | | | | | | | | | | | Rename this to be consistent with the change from 'platdata'. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: treewide: Rename 'platdata' variables to just 'plat'Simon Glass2020-12-13468-1278/+1267
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We use 'priv' for private data but often use 'platdata' for platform data. We can't really use 'pdata' since that is ambiguous (it could mean private or platform data). Rename some of the latter variables to end with 'plat' for consistency. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: treewide: Rename auto_alloc_size members to be shorterSimon Glass2020-12-13910-1255/+1251
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This construct is quite long-winded. In earlier days it made some sense since auto-allocation was a strange concept. But with driver model now used pretty universally, we can shorten this to 'auto'. This reduces verbosity and makes it easier to read. Coincidentally it also ensures that every declaration is on one line, thus making dtoc's job easier. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: core: Drop unused parameter from dm_extended_scan_fdt()Simon Glass2020-12-131-3/+3
| | | | | | | | | | | | | | | | | | | | | This doesn't need to be passed the devicetree anymore. Drop it. Also rename the function to drop the _fdt suffix. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: core: Drop unused parameter from dm_scan_fdt()Simon Glass2020-12-131-5/+4
| | | | | | | | | | | | | | | | | | This doesn't need to be passed the devicetree anymore. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: core: Combine the flattree and livetree binding codeSimon Glass2020-12-131-58/+16
| | | | | | | | | | | | | | | | | | | | | | | | At present there are two copies of this code. With ofnode we can combine them to reduce duplication. Update the dm_scan_fdt_node() function and adjust its callers. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: core: Add an ofnode function to get the devicetree rootSimon Glass2020-12-131-6/+2
| | | | | | | | | | | | | | | | | | | | | This is needed in at least one place. Avoid the conditional code in root.c by adding this inline function. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: core: Drop device_bind_offset()Simon Glass2020-12-131-8/+0
| | | | | | | | | | | | | | | | | | | | | This function is not needed since the standard device_bind() can be used instead. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: Drop uses of dev_set_of_offset()Simon Glass2020-12-136-13/+6
| | | | | | | | | | | | | | | | | | | | | The need for this can be avoided by passing the correct node to the device_bind() function. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: Remove uses of device_bind_offset()Simon Glass2020-12-1317-45/+42
| | | | | | | | | | | | | | | | | | | | | This function is not needed since the standard device_bind() can be used instead. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: core: Add a livetree function to check node statusSimon Glass2020-12-131-0/+10
| | | | | | | | | | | | | | | | | | | | | Add a way to find out if a node is enabled or not, based on its 'status' property. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: core: Rename device_bind_ofnode() to device_bind()Simon Glass2020-12-138-16/+16
| | | | | | | | | | | | | | | | | | | | | This is the standard function to use when binding devices. Drop the '_ofnode' suffix to make this clear. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: core: Rename device_bind() to device_bind_offset()Simon Glass2020-12-1317-31/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | This function is not necessary anymore, since device_bind_ofnode() does the same thing and works with both flattree and livetree. Rename it to indicate that it is special. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | sandbox: serial: Update to use membuffSimon Glass2020-12-131-29/+19
| | | | | | | | | | | | | | | | | | | | | Rather than implementing our own circular queue, use membuff. This allows us to read multiple bytes at once into the serial input. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | sandbox: serial: Convert to livetreeSimon Glass2020-12-131-3/+1
| | | | | | | | | | | | | | | | | | Use a livetree function to read the colour. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | serial: sandbox: Drop unnecessary #ifdefsSimon Glass2020-12-131-9/+2
| | | | | | | | | | | | | | | | | | | | | CONFIG_OF_CONTROL is always enabled for sandbox (as it should be for all boards), so we can drop it. Also use IS_ENABLED() for the SPL check. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | gpio: Convert to use APIs which support live DTPatrick Delaunay2020-12-011-3/+2
|/ / | | | | | | | | | | | | | | | | Use ofnode_ or dev_ APIs instead of fdt_ and fdtdec_ APIs so that the driver can support live DT. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
* | Merge tag 'mmc-2020-11-29' of ↵Tom Rini2020-11-292-94/+91
|\ \ | | | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-mmc - mmc minor update for better debug and error check - fsl_esdhc sysctl set and make sure delay check for HS400
| * | mmc: check a return value about regulator's always-onJaehoon Chung2020-11-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Regulator can be set to "always-on". It's not error about enable/disable. It needs to check about its condition. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
| * | mmc: display an error number to debugJaehoon Chung2020-11-281-5/+5
| | | | | | | | | | | | | | | | | | | | | It's useful to know an error number when it's debugging. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
| * | mmc: fsl_esdhc: make sure delay chain locked for HS400Yangbo Lu2020-11-281-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For eMMC HS400 mode, the DLL reset is a required step for mmc rescan. This step has not been documented in reference manual, but the RM will be fixed sooner or later. In previous commit to support eMMC HS400, db8f936 mmc: fsl_esdhc: support eMMC HS400 mode the steps to configure DLL could be found in commit message, 13. Set DLLCFG0[DLL_ENABLE] and DLLCFG0[DLL_FREQ_SEL]. 14. Wait for delay chain to lock. these would be fixed as, 13. Set DLLCFG0[DLL_ENABLE] and DLLCFG0[DLL_FREQ_SEL]. 13.1 Write DLLCFG0[DLL_RESET] to 1 and wait for 1us, then write DLLCFG0[DLL_RESET] 14. Wait for delay chain to lock. This patch is to add the step of DLL reset, and make sure delay chain locked for HS400. Fixes: db8f93672b42 ("mmc: fsl_esdhc: support eMMC HS400 mode") Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
| * | mmc: fsl_esdhc: set sysctl register for clock initializationYangbo Lu2020-11-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The initial clock setting should be through sysctl register only, while the mmc_set_clock() will call mmc_set_ios() introduce other configurations like bus width, mode, and so on. Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
| * | mmc: Add some helper functions for retrying on errorSean Anderson2020-11-281-83/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All of the existing quirks add retries to various calls of mmc_send_cmd. mmc_send_cmd_quirks is a helper function to do this retrying behavior. It checks if quirks mode is enabled, and if a specific quirk is activated it retries on error. This also adds mmc_send_cmd_retry, which retries on error every time (instead of if a quirk is activated). Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
* | | i2c: ocores: add i2c driver for OpenCores I2C controllerPragnesh Patel2020-11-283-0/+645
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for the OpenCores I2C controller IP core (See http://www.opencores.org/projects.cgi/web/i2c/overview). This driver implementation is inspired from the Linux OpenCores I2C driver available. Thanks to Peter Korsgaard <peter@korsgaard.com> for writing Linux OpenCores I2C driver. Signed-off-by: Pragnesh Patel <pragnesh.patel@sifive.com> Reviewed-by: Rick Chen <rick@andestech.com>
* | | i2c: designware_i2c: Don't warn if no reset controllerSimon Glass2020-11-281-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present if CONFIG_RESET is not enabled, this code shows a warning: designware_i2c_ofdata_to_platdata() i2c_designware_pci i2c2@16,0: Can't get reset: -524 Avoid this by checking if reset is supported, first. Fixes: 622597dee4f ("i2c: designware: add reset ctrl to driver") Signed-off-by: Simon Glass <sjg@chromium.org>
* | | i2c: mvtwsi: disable i2c slave also on Armada 8kBaruch Siach2020-11-281-1/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | The hidden I2C slave is also present on the Armada 8k AP806. Testing shows that this I2C slave causes the same issues as Armada 38x. Disabling that I2C slave fixes all these issues. I2C blocks on the Armada 8k CP110 are not affected. Extend the I2C slave disable to Armada 8k as well. Cc: Stefan Roese <sr@denx.de> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
* | phy: stm32: usbphyc: manage optional vbus regulator on phy_power_on/offPatrick Delaunay2020-11-251-10/+23
| | | | | | | | | | | | | | | | This patch adds support for optional vbus regulator. It is managed on phy_power_on/off calls and may be needed for host mode. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
* | pinctrl: stmfx: update pin namePatrick Delaunay2020-11-251-4/+4
| | | | | | | | | | | | | | | | | | | | Update pin name to avoid duplicated name with SOC GPIO gpio0...gpio15 / agpio0....agpio7: add a stmfx prefix. This pin name can be used in pinmux command. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
* | pinctrl: stmfx: update pincontrol and gpio device namePatrick Delaunay2020-11-251-1/+4
| | | | | | | | | | | | | | | | | | | | The device name is used in pinmux command and in log trace so it is better to use the parent parent name ("stmfx@42" for example) than a generic name ("pinctrl" or "stmfx-gpio") to identify the device instance. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>