| a7b82502 | 20-Apr-2015 |
Przemyslaw Marczak <p.marczak@samsung.com> |
dm: core: precise comments for get/find device by name
The functions: - uclass_find_device_by_name() - uclass_get_device_by_name() searches the required device for the exactly given name. This patch
dm: core: precise comments for get/find device by name
The functions: - uclass_find_device_by_name() - uclass_get_device_by_name() searches the required device for the exactly given name. This patch, presice this fact for both function's comments.
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Cc: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 794d5219 | 20-Apr-2015 |
Przemyslaw Marczak <p.marczak@samsung.com> |
dm: core: remove type 'static' of function uclass_get_device_tail()
Uclass API provides a few functions for get/find the device. To provide a complete function set of uclass-internal functions, for
dm: core: remove type 'static' of function uclass_get_device_tail()
Uclass API provides a few functions for get/find the device. To provide a complete function set of uclass-internal functions, for use by the drivers, the function uclass_get_device_tail() should be non-static.
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Cc: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| f9c370dc | 15-Apr-2015 |
Przemyslaw Marczak <p.marczak@samsung.com> |
dm: core: device: add function: dev_get_uclass_name()
This commit extends the driver model device's API by function: - dev_get_uclass_name()
And this function returns the device's uclass driver nam
dm: core: device: add function: dev_get_uclass_name()
This commit extends the driver model device's API by function: - dev_get_uclass_name()
And this function returns the device's uclass driver name if: - given dev pointer, is non_NULL otherwise, the NULL pointer is returned.
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Cc: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| cc73d37b | 15-Apr-2015 |
Przemyslaw Marczak <p.marczak@samsung.com> |
dm: core: device: add function: dev_get_driver_ops()
This commit extends the driver model device's API by function: - dev_get_driver_ops()
And this function returns the device's driver's operations
dm: core: device: add function: dev_get_driver_ops()
This commit extends the driver model device's API by function: - dev_get_driver_ops()
And this function returns the device's driver's operations if given: - dev pointer, is non-NULL - dev->driver->ops pointer, is non-NULL in other case the, the NULL pointer is returned.
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Cc: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| b7af1a2d | 15-Apr-2015 |
Przemyslaw Marczak <p.marczak@samsung.com> |
dm: core: uclass: add function: uclass_get_device_by_name()
This commit extends the driver model uclass's API by function: - uclass_get_device_by_name()
And this function returns the device if: - u
dm: core: uclass: add function: uclass_get_device_by_name()
This commit extends the driver model uclass's API by function: - uclass_get_device_by_name()
And this function returns the device if: - uclass with given ID, exists, - device with exactly given name(dev->name), exists, - device probe, doesn't return an error.
The returned device is activated and ready to use.
Note: This function returns the first device, which name is equal to the given one. This means, that using this function you must assume, that the device name is unique in the given uclass's ID device list.
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Cc: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| e0735a4c | 15-Apr-2015 |
Przemyslaw Marczak <p.marczak@samsung.com> |
dm: core: uclass: add function: uclass_find_device_by_name()
This commit extends the driver model uclass's API by function: - uclass_find_device_by_name()
And this function returns the device if: -
dm: core: uclass: add function: uclass_find_device_by_name()
This commit extends the driver model uclass's API by function: - uclass_find_device_by_name()
And this function returns the device if: - uclass with given ID, exists, - device with exactly given name(dev->name), exists.
The returned device is not activated - need to be probed before use.
Note: This function returns the first device, which name is equal to the given one. This means, that using this function you must assume, that the device name is unique in the given uclass's ID device list.
uclass-internal.h: cleanup - move the uclass_find_device_by_seq() declaration and description, near the other uclass_find*() functions.
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Cc: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 754e71e8 | 15-Apr-2015 |
Przemyslaw Marczak <p.marczak@samsung.com> |
dm: test: Add tests for device's uclass platform data
This test introduces new test structure type:dm_test_perdev_uc_pdata. The structure consists of three int values only. For the test purposes, th
dm: test: Add tests for device's uclass platform data
This test introduces new test structure type:dm_test_perdev_uc_pdata. The structure consists of three int values only. For the test purposes, three pattern values are defined by enum, starting with TEST_UC_PDATA_INTVAL1.
This commit adds two test cases for uclass platform data: - Test: dm_test_autobind_uclass_pdata_alloc - this tests if: * uclass driver sets: .per_device_platdata_auto_alloc_size field * the devices's: dev->uclass_platdata is non-NULL
- Test: dm_test_autobind_uclass_pdata_valid - this tests: * if the devices's: dev->uclass_platdata is non-NULL * the structure of type 'dm_test_perdev_uc_pdata' allocated at address pointed by dev->uclass_platdata. Each structure field, should be equal to proper pattern data, starting from .intval1 == TEST_UC_PDATA_INTVAL1.
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Cc: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 5eaed880 | 15-Apr-2015 |
Przemyslaw Marczak <p.marczak@samsung.com> |
dm: core: Extend struct udevice by '.uclass_platdata' field.
This commit adds 'uclass_platdata' field to 'struct udevice', which can be automatically allocated at bind. The allocation size is define
dm: core: Extend struct udevice by '.uclass_platdata' field.
This commit adds 'uclass_platdata' field to 'struct udevice', which can be automatically allocated at bind. The allocation size is defined in 'struct uclass_driver' as 'per_device_platdata_auto_alloc_size'.
New device's flag is added: DM_FLAG_ALLOC_UCLASS_PDATA, which is used for memory freeing at device unbind method.
As for other udevice's fields, a complementary function is added: - dev_get_uclass_platdata()
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Cc: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| c1d6f919 | 15-Apr-2015 |
Przemyslaw Marczak <p.marczak@samsung.com> |
dm: core: add internal functions for getting the device without probe
This commit extends the uclass-internal functions by: - uclass_find_first_device() - uclass_find_next_device() For both function
dm: core: add internal functions for getting the device without probe
This commit extends the uclass-internal functions by: - uclass_find_first_device() - uclass_find_next_device() For both functions, the returned device is not probed.
After some cleanup, the above functions are called by: - uclass_first_device() - uclass_next_device() for which, the returned device is probed.
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Cc: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 57f54d55 | 25-Mar-2015 |
Simon Glass <sjg@chromium.org> |
dm: test: Allow 'dm test' to select a particular test to run
As well as running all tests, it is useful to be able to run a selected test.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by:
dm: test: Allow 'dm test' to select a particular test to run
As well as running all tests, it is useful to be able to run a selected test.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
show more ...
|
| f4f71536 | 25-Mar-2015 |
Simon Glass <sjg@chromium.org> |
dm: usb: sandbox: Add an emulator for USB flash devices
This emulator supports USB enumeration and allows a local file to be provided as the contents of the emulated flash stick. U-Boot can then use
dm: usb: sandbox: Add an emulator for USB flash devices
This emulator supports USB enumeration and allows a local file to be provided as the contents of the emulated flash stick. U-Boot can then use the file as it would a normal device, with all access passing through the usb_stor layer and the USB stack.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
show more ...
|
| 019808f9 | 25-Mar-2015 |
Simon Glass <sjg@chromium.org> |
dm: usb: sandbox: Add a uclass for USB device emulation
With sandbox we want to be able to emulate USB devices so that we can test the USB stack. Add a uclass to support this. It implements the same
dm: usb: sandbox: Add a uclass for USB device emulation
With sandbox we want to be able to emulate USB devices so that we can test the USB stack. Add a uclass to support this. It implements the same operations as a normal USB device driver, but in this case passes them on to an emulation driver.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
show more ...
|
| 449230f0 | 25-Mar-2015 |
Simon Glass <sjg@chromium.org> |
dm: usb: Bind generic USB devices when there is no driver
At present USB devices with no driver model driver cannot be seen in the device list, and we fail to set them up correctly. This means they
dm: usb: Bind generic USB devices when there is no driver
At present USB devices with no driver model driver cannot be seen in the device list, and we fail to set them up correctly. This means they cannot be used.
While having real drivers that support driver model for all USB devices is the eventual goal, we are not there yet.
As a stop-gap, add a generic USB driver which is bound when we do not have a real driver. This allows the device to be set up and shown on the bus. It also allows ad-hoc code (such as usb_ether) to find these devices and set them up.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
show more ...
|
| 054fe48e | 25-Mar-2015 |
Simon Glass <sjg@chromium.org> |
dm: usb: Add driver model support for hubs
Adjust the existing hub code to support driver model, and add a USB driver for hubs.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasu
dm: usb: Add driver model support for hubs
Adjust the existing hub code to support driver model, and add a USB driver for hubs.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
show more ...
|
| de31213f | 25-Mar-2015 |
Simon Glass <sjg@chromium.org> |
dm: usb: Add a uclass for USB controllers
Add a uclass that can represent a USB controller. For now we do not create devices for things attached to the controller. This will be added later.
Signed-
dm: usb: Add a uclass for USB controllers
Add a uclass that can represent a USB controller. For now we do not create devices for things attached to the controller. This will be added later.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
show more ...
|
| c5785673 | 25-Mar-2015 |
Simon Glass <sjg@chromium.org> |
dm: core: Add device children and sibling functions
Add some utility functions to check for children and for the last sibling in a device's parent.
Signed-off-by: Simon Glass <sjg@chromium.org> Rev
dm: core: Add device children and sibling functions
Add some utility functions to check for children and for the last sibling in a device's parent.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
show more ...
|
| 39de8433 | 25-Mar-2015 |
Simon Glass <sjg@chromium.org> |
dm: core: Rename driver data function to dev_get_driver_data()
The existing get_get_of_data() function provides access to both the driver's compatible string and its driver data. However only the la
dm: core: Rename driver data function to dev_get_driver_data()
The existing get_get_of_data() function provides access to both the driver's compatible string and its driver data. However only the latter is actually useful. Update the interface to reflect this and fix up existing users.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
show more ...
|
| 3479253d | 25-Mar-2015 |
Simon Glass <sjg@chromium.org> |
dm: core: Convert driver_bind() to use const
The driver is not modified by driver model, so update driver_bind() to recognise that.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek
dm: core: Convert driver_bind() to use const
The driver is not modified by driver model, so update driver_bind() to recognise that.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
show more ...
|
| 2c03c463 | 25-Mar-2015 |
Simon Glass <sjg@chromium.org> |
dm: core: Support allocating driver-private data for DMA
Some driver want to put DMA buffers in their private data. Add a flag to tell driver model to align driver-private data to a cache boundary s
dm: core: Support allocating driver-private data for DMA
Some driver want to put DMA buffers in their private data. Add a flag to tell driver model to align driver-private data to a cache boundary so that DMA will work correctly in this case.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
show more ...
|
| a274e9ca | 26-Mar-2015 |
Simon Glass <sjg@chromium.org> |
dm: x86: Add a uclass for an Low Pin Count (LPC) device
On x86 systems this device is commonly used to provide legacy port access. It is sort-of a replacement for the old ISA bus.
Add a uclass for
dm: x86: Add a uclass for an Low Pin Count (LPC) device
On x86 systems this device is commonly used to provide legacy port access. It is sort-of a replacement for the old ISA bus.
Add a uclass for this, and allow it to have child devices.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 05c3e68f | 22-Mar-2015 |
Joe Hershberger <joe.hershberger@ni.com> |
dm: eth: Add basic driver model support to Ethernet stack
First just add support for MAC drivers.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org> |
| 801f4f1b | 05-Mar-2015 |
Simon Glass <sjg@chromium.org> |
dm: x86: pci: Convert coreboot to use driver model for pci
Move coreboot-x86 over to driver model for PCI.
Signed-off-by: Simon Glass <sjg@chromium.org> |
| 36d0d3b4 | 05-Mar-2015 |
Simon Glass <sjg@chromium.org> |
dm: sandbox: pci: Add a PCI emulation uclass
Since sandbox does not have real devices (unless it borrows those from the host) it must use emulations. Provide a uclass which permits PCI operations to
dm: sandbox: pci: Add a PCI emulation uclass
Since sandbox does not have real devices (unless it borrows those from the host) it must use emulations. Provide a uclass which permits PCI operations to be passed through to an emulation device.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| ff3e077b | 05-Mar-2015 |
Simon Glass <sjg@chromium.org> |
dm: pci: Add a uclass for PCI
Add a uclass for PCI controllers and a generic one for PCI devices. Adjust the 'pci' command and the existing PCI support to work with this new uclass. Keep most of the
dm: pci: Add a uclass for PCI
Add a uclass for PCI controllers and a generic one for PCI devices. Adjust the 'pci' command and the existing PCI support to work with this new uclass. Keep most of the compatibility code in a separate file so that it can be removed one day.
TODO: Add more header file comments to the new parts of pci.h
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 02c07b37 | 05-Mar-2015 |
Simon Glass <sjg@chromium.org> |
dm: core: Add a uclass pre_probe() method for devices
Some uclasses want to set up a device before it is probed. Add a method for this.
An example is with PCI, where a PCI uclass wants to set up it
dm: core: Add a uclass pre_probe() method for devices
Some uclasses want to set up a device before it is probed. Add a method for this.
An example is with PCI, where a PCI uclass wants to set up its private data for later use. This allows the device's uclass() method to make calls whcih use that data (for example, read PCI memory regions from device tree, set up bus numbers).
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|