- 30 1月, 2015 7 次提交
-
-
由 Simon Glass 提交于
This is useful to check which uclass a device is in. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NMasahiro Yamada <yamada.m@jp.panasonic.com>
-
由 Simon Glass 提交于
Allow parent drivers to be called when a new child is bound to them. This allows a bus to set up information it needs for that child. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NMasahiro Yamada <yamada.m@jp.panasonic.com>
-
由 Simon Glass 提交于
In many cases the child platform data for a device's children is defined by the uclass rather than the individual devices. For example, a SPI bus needs to know the chip select and speed for each of its children. It makes sense to allow this information to be defined the SPI uclass rather than each individual driver. If the device provides a size value for its child platdata, then use it. Failng that, fall back to that provided by the uclass. Reviewed-by: NMasahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
For buses it is common for parents to need to know the address of the child on the bus, the bus speed to use for that child, and other information. This can be provided in platform data attached to each child. Add driver model support for this, including auto-allocation which can be requested using a new property to specify the size of the data. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NMasahiro Yamada <yamada.m@jp.panasonic.com>
-
由 Simon Glass 提交于
When using allocated platform data, allocate it when we bind the device. This makes it possible to fill in this information before the device is probed. This fits with the platform data model (when not using device tree), since platform data exists at bind-time. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NMasahiro Yamada <yamada.m@jp.panasonic.com>
-
由 Simon Glass 提交于
Make the error handling more standard to make it easier to build on top of it. Also correct a bug in the error path where there is no parent. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NMasahiro Yamada <yamada.m@jp.panasonic.com>
-
由 Simon Glass 提交于
The root device corresponds to the root device tree node, so set this up. Also add a few notes to the documentation. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 12 12月, 2014 1 次提交
-
-
由 Simon Glass 提交于
Some of these are missing a newline. Add it. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 22 11月, 2014 7 次提交
-
-
由 Masahiro Yamada 提交于
These conditions never happen. - There is no real uclass with UCLASS_INVALID id. - uclass never becomes NULL because ll_entry_start() always returns a valid pointer. Signed-off-by: NMasahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: NSimon Glass <sjg@chromium.org>
-
由 Masahiro Yamada 提交于
The variable "drv" never becomes NULL because ll_entry_start() always returns a valid pointer even if there are no entries. The case "n_ents == 0" is covered by the following "for" loop. Signed-off-by: NMasahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: NSimon Glass <sjg@chromium.org>
-
由 Masahiro Yamada 提交于
If the variable "ret" is equal to "-ENOENT", it is trapped at [1] and never reaches [2]. At [3], the condition "ret != -ENOENT" is always true. if (ret == -ENOENT) { <------------------ [1] continue; } else if (ret == -ENODEV) { dm_dbg("Device '%s' has no compatible string\n", name); break; } else if (ret) { <------------------ [2] dm_warn("Device tree error at offset %d\n", offset); if (!result || ret != -ENOENT) <------------------ [3] result = ret; break; } Signed-off-by: NMasahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: NSimon Glass <sjg@chromium.org>
-
由 Masahiro Yamada 提交于
Signed-off-by: NMasahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
In some cases we need to manually bind a device to a particular driver. Add a function to do this. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NJagannadha Sutradharudu Teki <jagannadh.teki@gmail.com> Acked-by: NHeiko Schocher <hs@denx.de>
-
由 Simon Glass 提交于
Add dev_get_parent() as a convenience to obtain the parent of a device. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NTom Rini <trini@ti.com> Acked-by: NHeiko Schocher <hs@denx.de>
-
由 Simon Glass 提交于
When the device is created from a device tree node, it matches a compatible string. Allow access to that string and the associated data. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NTom Rini <trini@ti.com> Acked-by: NHeiko Schocher <hs@denx.de>
-
- 21 11月, 2014 1 次提交
-
-
由 Simon Glass 提交于
For SPL we don't expect to need to remove a device. Save some code space by dropping this feature. The board config can define CONFIG_DM_DEVICE_REMOVE if this is in fact needed. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NTom Rini <trini@ti.com>
-
- 24 10月, 2014 1 次提交
-
-
由 Masahiro Yamada 提交于
Create entries of CONFIG_DM, CONFIG_DM_SERIAL, CONFIG_DM_GPIO and CONFIG_DM_SPI. Signed-off-by: NMasahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: NSimon Glass <sjg@chromium.org>
-
- 23 10月, 2014 5 次提交
-
-
由 Simon Glass 提交于
Add a driver for the simple-bus nodes, which allows devices within these nodes to be bound. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Buses sometimes want to pass data to their children when they are probed. For example, a SPI bus may want to tell the slave device about the chip select it is connected to. Add a new function to permit the parent data to be supplied to the child. Signed-off-by: NSimon Glass <sjg@chromium.org> Acked-by: NJagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
-
由 Simon Glass 提交于
Buses need to iterate through their children in some situations. Add a few functions to make this easy. Signed-off-by: NSimon Glass <sjg@chromium.org> Acked-by: NJagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
-
由 Masahiro Yamada 提交于
if (strncmp(name, entry->name, len)) continue; /* Full match */ if (len == strlen(entry->name)) return entry; is equivalent to: if (!strcmp(name, entry->name)) return entry; The latter is simpler. Signed-off-by: NMasahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: NSimon Glass <sjg@chromium.org> Acked-by: NIgor Grinberg <grinberg@compulab.co.il>
-
由 Masahiro Yamada 提交于
The function uclass_add() checks uc_drv->ops as follows: if (uc_drv->ops) { dm_warn("No ops for uclass id %d\n", id); return -EINVAL; } It seems odd because it warns "No ops" when uc_drv->ops has non-NULL pointer. (Looks opposite.) Anyway, most of UCLASS_DRIVER entries have no .ops member. This check makes no sense. Signed-off-by: NMasahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: NSimon Glass <sjg@chromium.org>
-
- 25 9月, 2014 2 次提交
-
-
由 Masahiro Yamada 提交于
[1] Move driver/core/, driver/input/ and drivers/input/ entries from the top Makefile to drivers/Makefile [2] Remove the conditional by CONFIG_DM in drivers/core/Makefile because the whole drivers/core directory is already selected by CONFIG_DM in the upper level [3] Likewise for CONFIG_DM_DEMO in drivers/demo/Makefile [4] Simplify common/Makefile - both CONFIG_DDR_SPD and CONFIG_SPD_EEPROM are boolean macros so they can directly select objects Signed-off-by: NMasahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: NMarek Vasut <marex@denx.de>
-
由 Masahiro Yamada 提交于
This would be useful to start moving various config options. Signed-off-by: NMasahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: NSimon Glass <sjg@chromium.org> Tested-by: NSimon Glass <sjg@chromium.org>
-
- 24 9月, 2014 2 次提交
-
-
由 Robert Baldyga 提交于
Since dev->req_seq value is initialized from "reg" property of fdt node, there is posibility, that address value contained in fdt is greater than INT_MAX, and then value in dev->req_seq is negative which led to probe() fail. This patch fix this problem by ensuring that req_seq is positive, unless it's one of errno codes. Signed-off-by: NRobert Baldyga <r.baldyga@samsung.com> Acked-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
The sequence number support in driver model requires device tree control. It should be skipped if CONFIG_OF_CONTROL is not defined, and should not require functions from fdtdec. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 11 9月, 2014 1 次提交
-
-
由 Simon Glass 提交于
Allow the caller to find out the device that was bound in response to this call. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 23 7月, 2014 13 次提交
-
-
由 Simon Glass 提交于
Some boards will have devices which are not in the device tree and do not have platform data. They may be programnatically created, for example. Add a hook which boards can use to bind those devices early in boot. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Add a debug message for when a device tree node has no driver. Also reword the warning when a device fails to bind, which was misleading. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Some devices (particularly bus devices) must track their children, knowing when a new child is added so that it can be set up for communication on the bus. Add a child_pre_probe() method to provide this feature, and a corresponding child_post_remove() method. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Some device types can have child devices and want to store information about them. For example a USB flash stick attached to a USB host controller would likely use this space. The controller can hold information about the USB state of each of its children. The data is stored attached to the child device in the 'parent_priv' member. It can be auto-allocated by dm when the child is probed. To do this, add a per_child_auto_alloc_size value to the parent driver. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Devices can have childen that can be addressed by a simple index, the sequence number or a device tree offset. Add functions to access a child in each of these ways. The index is typically used as a fallback when the sequence number is not available. For example we may use a serial UART with sequence number 0 as the console, but if no UART has sequence number 0, then we can fall back to just using the first UART (index 0). The device tree offset function is useful for buses, where they want to locate one of their children. The device tree can be scanned to find the offset of each child, and that offset can then find the device. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
At present only root nodes in the device tree are scanned for devices. But some devices can have children. For example a SPI bus may have several children for each of its chip selects. Add a function which scans subnodes and binds devices for each one. This can be used for the root node scan also, so change it. A device can call this function in its bind() or probe() methods to bind its children. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Don't allow access to uclasses before they have been initialised. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Each device that was bound from a device tree has an node that caused it to be bound. Add functions that find and return a device based on a device tree offset. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
In U-Boot it is pretty common to number devices from 0 and access them on the command line using this numbering. While it may come to pass that we will move away from this numbering, the possibility seems remote at present. Given that devices within a uclass will have an implied numbering, it makes sense to build this into driver model as a core feature. The cost is fairly small in terms of code and data space. With each uclass having numbered devices we can ask for SPI port 0 or serial port 1 and receive a single device. Devices typically request a sequence number using aliases in the device tree. These are resolved when the device is probed, to deal with conflicts. Sequence numbers need not be sequential and holes are permitted. At present there is no support for sequence numbers using static platform data. It could easily be added to 'struct driver_info' if needed, but it seems better to add features as we find a use for them, and the use of -1 to mean 'no sequence' makes the default value somewhat painful. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Several functions will use this same pattern, so bring it into a function. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Initialise devices marked 'pre-reloc' and make them available prior to relocation. Note that this requires pre-reloc malloc() to be available. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Driver model currently only operates after relocation is complete. In this state U-Boot typically has a small amount of memory available. In adding support for driver model prior to relocation we must try to use as little memory as possible. In addition, on some machines the memory has not be inited and/or the CPU is not running at full speed or the data cache is off. These can reduce execution performance, so the less initialisation that is done before relocation the better. An immediately-obvious improvement is to only initialise drivers which are actually going to be used before relocation. On many boards the only such driver is a serial UART, so this provides a very large potential benefit. Allow drivers to mark themselves as 'pre-reloc' which means that they will be initialised prior to relocation. This can be done either with a driver flag or with a 'dm,pre-reloc' device tree property. To support this, the various dm scanning function now take a 'pre_reloc_only' parameter which indicates that only drivers marked pre-reloc should be bound. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Add a new method which removes and unbinds all drivers. Signed-off-by: NSimon Glass <sjg@chromium.org> Acked-by: NMarek Vasut <marex@denx.de>
-