| 3ddecfc7 | 02-Apr-2012 |
Simon Glass <sjg@chromium.org> |
fdt: Add function to return next compatible subnode
We need to iterate through subnodes of a parent, looking only at compatible nodes. Add a utility function to do this for us.
Signed-off-by: Simon
fdt: Add function to return next compatible subnode
We need to iterate through subnodes of a parent, looking only at compatible nodes. Add a utility function to do this for us.
Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
show more ...
|
| e3ed0575 | 09-Apr-2012 |
Mike Frysinger <vapier@gentoo.org> |
gunzip: rename z{alloc, free} to gz{alloc, free}
This allows us to add a proper zalloc() func (one that does a zeroing alloc), and removes duplicate prototypes.
Signed-off-by: Mike Frysinger <vapie
gunzip: rename z{alloc, free} to gz{alloc, free}
This allows us to add a proper zalloc() func (one that does a zeroing alloc), and removes duplicate prototypes.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
show more ...
|
| 9a263e55 | 28-Mar-2012 |
Simon Glass <sjg@chromium.org> |
fdt: Avoid early panic() when there is no FDT present
CONFIG_OF_CONTROL requires a valid device tree. However, we cannot call panic() before the console is set up since the message does not appear,
fdt: Avoid early panic() when there is no FDT present
CONFIG_OF_CONTROL requires a valid device tree. However, we cannot call panic() before the console is set up since the message does not appear, and we get a silent failure.
Remove the panic from fdtdec_check_fdt() and provide a new function to prepare the fdt for use. This will be called after the console is ready.
Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
show more ...
|
| ed3ee5cd | 27-Feb-2012 |
Simon Glass <sjg@chromium.org> |
fdt: Add basic support for decoding GPIO definitions
This adds some support into fdtdec for reading GPIO definitions from the fdt. We permit up to FDT_GPIO_MAX GPIOs in the system. Each GPIO is of t
fdt: Add basic support for decoding GPIO definitions
This adds some support into fdtdec for reading GPIO definitions from the fdt. We permit up to FDT_GPIO_MAX GPIOs in the system. Each GPIO is of the form:
gpio-function-name = <phandle gpio_num flags>;
where:
phandle is a pointer to the GPIO node gpio_num is the number of the GPIO (0 to 223) flags is a flag, as follows:
bit meaning 0 0=polarity normal, 1=active low (inverted)
An example is:
enable-propounder-gpios = <&gpio 43 0>;
which means that GPIO 43 is used to enable the propounder (setting the GPIO high), or that you can detect that the propounder is enabled by checking if the GPIO is high (the fdt does not indicate input/output).
Two main functions are provided:
fdtdec_decode_gpio() reads a GPIO property from an fdt node and decodes it into a structure.
fdtdec_setup_gpio() sets up the GPIO by calling gpio_request for you.
Both functions can cope with the property being missing, which is taken to mean that that GPIO function is not available or is not needed.
[For reference, from Stephen Warren <swarren@nvidia.com>. It may be that we add this extra complexity later if needed:
The correct way to parse such a GPIO property in general is:
* Read the first cell. * Find the node referenced by the phandle (the controller). * Ensure property gpio-controller is present in the controller node. * Read property #gpio-cells from the controller node. * Extract #gpio-cells from the original property. * Keep processing more cells from the original property; there may be multiple GPIOs listed.
According to the binding documentation in the Linux kernel, Samsung Exynos4 doesn't use this format, and while all other chips do have a flags cell, about 50% of the controllers indicate the cell is unused. ]
Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
show more ...
|
| d17da655 | 27-Feb-2012 |
Simon Glass <sjg@chromium.org> |
fdt: Add functions to access phandles, arrays and bools
Add a function to look up a property which is a phandle in a node, and another to read a fixed-length integer array from an fdt property. Also
fdt: Add functions to access phandles, arrays and bools
Add a function to look up a property which is a phandle in a node, and another to read a fixed-length integer array from an fdt property. Also add a function to read boolean properties, although there is no actual boolean type in U-Boot.
Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Gerald Van Baren <vanbaren@cideas.com> Acked-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
show more ...
|
| f88fe2de | 27-Feb-2012 |
Simon Glass <sjg@chromium.org> |
fdt: Tidy up a few fdtdec problems
This fixes five trivial issues in fdtdec.c: 1. fdtdec_get_is_enabled() doesn't really need a default value 2. The fdt must be word-aligned, since otherwise it will
fdt: Tidy up a few fdtdec problems
This fixes five trivial issues in fdtdec.c: 1. fdtdec_get_is_enabled() doesn't really need a default value 2. The fdt must be word-aligned, since otherwise it will fail on ARM 3. The compat_names[] array is missing its first element. This is needed only because the first fdt_compat_id is defined to be invalid. 4. Added a header prototype for fdtdec_next_compatible() 5. Change fdtdec_next_alias() to only increment its 'upto' parameter on success, to make the display error messages in the caller easier.
Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Gerald Van Baren <vanbaren@cideas.com> Acked-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
show more ...
|
| dc254f38 | 17-Jan-2012 |
Simon Glass <sjg@chromium.org> |
fdt: Add tests for fdtdec
The fdtdec_find_aliases_for_id() function is complicated enough that it really should have some tests. This does not necessarily need to be committed to U-Boot, but it migh
fdt: Add tests for fdtdec
The fdtdec_find_aliases_for_id() function is complicated enough that it really should have some tests. This does not necessarily need to be committed to U-Boot, but it might be useful.
(note there are a few minor inconsistencies with this patch which will be cleaned up when the USB series is applied)
Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
show more ...
|
| 71ec92b6 | 02-Nov-2011 |
Simon Glass <sjg@chromium.org> |
vsprintf: Move function documentation into header file
Now that this is not in common.h, perhaps it is acceptable to move this documentation into the header file.
Signed-off-by: Simon Glass <sjg@ch
vsprintf: Move function documentation into header file
Now that this is not in common.h, perhaps it is acceptable to move this documentation into the header file.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|