Commit 9fe2cfb43aab2225a8c970a69341534b2488da8c
Exists in
master
and in
57 other branches
Merge branch 'agust@denx.de' of git://git.denx.de/u-boot-staging
Showing 5 changed files Side-by-side Diff
drivers/pci/pci.c
| ... | ... | @@ -118,11 +118,11 @@ |
| 118 | 118 | void *pci_map_bar(pci_dev_t pdev, int bar, int flags) |
| 119 | 119 | { |
| 120 | 120 | pci_addr_t pci_bus_addr; |
| 121 | - pci_addr_t bar_response; | |
| 121 | + u32 bar_response; | |
| 122 | 122 | |
| 123 | 123 | /* read BAR address */ |
| 124 | 124 | pci_read_config_dword(pdev, bar, &bar_response); |
| 125 | - pci_bus_addr = bar_response & ~0xf; | |
| 125 | + pci_bus_addr = (pci_addr_t)(bar_response & ~0xf); | |
| 126 | 126 | |
| 127 | 127 | /* |
| 128 | 128 | * Pass "0" as the length argument to pci_bus_to_virt. The arg |
| ... | ... | @@ -389,7 +389,7 @@ |
| 389 | 389 | pci_addr_t mem, |
| 390 | 390 | unsigned long command) |
| 391 | 391 | { |
| 392 | - pci_addr_t bar_response; | |
| 392 | + u32 bar_response; | |
| 393 | 393 | unsigned int old_command; |
| 394 | 394 | pci_addr_t bar_value; |
| 395 | 395 | pci_size_t bar_size; |
drivers/pci/pci_auto.c
include/asm-generic/gpio.h
| ... | ... | @@ -94,5 +94,14 @@ |
| 94 | 94 | */ |
| 95 | 95 | int gpio_set_value(unsigned gpio, int value); |
| 96 | 96 | |
| 97 | +/** | |
| 98 | + * Request a gpio. This should be called before any of the other functions | |
| 99 | + * are used on this gpio. | |
| 100 | + * | |
| 101 | + * @param gp GPIO number | |
| 102 | + * @param label User label for this GPIO | |
| 103 | + * @return 0 if ok, -1 on error | |
| 104 | + */ | |
| 105 | +int gpio_request(unsigned gpio, const char *label); | |
| 97 | 106 | #endif /* _ASM_GENERIC_GPIO_H_ */ |
include/fdtdec.h
| ... | ... | @@ -19,6 +19,8 @@ |
| 19 | 19 | * MA 02111-1307 USA |
| 20 | 20 | */ |
| 21 | 21 | |
| 22 | +#ifndef __fdtdec_h | |
| 23 | +#define __fdtdec_h | |
| 22 | 24 | |
| 23 | 25 | /* |
| 24 | 26 | * This file contains convenience functions for decoding useful and |
| ... | ... | @@ -383,4 +385,5 @@ |
| 383 | 385 | */ |
| 384 | 386 | const u8 *fdtdec_locate_byte_array(const void *blob, int node, |
| 385 | 387 | const char *prop_name, int count); |
| 388 | +#endif |
lib/fdtdec.c
| ... | ... | @@ -80,11 +80,16 @@ |
| 80 | 80 | const fdt_addr_t *cell; |
| 81 | 81 | int len; |
| 82 | 82 | |
| 83 | - debug("get_addr: %s\n", prop_name); | |
| 83 | + debug("%s: %s: ", __func__, prop_name); | |
| 84 | 84 | cell = fdt_getprop(blob, node, prop_name, &len); |
| 85 | 85 | if (cell && (len == sizeof(fdt_addr_t) || |
| 86 | - len == sizeof(fdt_addr_t) * 2)) | |
| 87 | - return fdt_addr_to_cpu(*cell); | |
| 86 | + len == sizeof(fdt_addr_t) * 2)) { | |
| 87 | + fdt_addr_t addr = fdt_addr_to_cpu(*cell); | |
| 88 | + | |
| 89 | + debug("%p\n", (void *)addr); | |
| 90 | + return addr; | |
| 91 | + } | |
| 92 | + debug("(not found)\n"); | |
| 88 | 93 | return FDT_ADDR_T_NONE; |
| 89 | 94 | } |
| 90 | 95 | |
| 91 | 96 | |
| ... | ... | @@ -94,10 +99,15 @@ |
| 94 | 99 | const s32 *cell; |
| 95 | 100 | int len; |
| 96 | 101 | |
| 97 | - debug("get_size: %s\n", prop_name); | |
| 102 | + debug("%s: %s: ", __func__, prop_name); | |
| 98 | 103 | cell = fdt_getprop(blob, node, prop_name, &len); |
| 99 | - if (cell && len >= sizeof(s32)) | |
| 100 | - return fdt32_to_cpu(cell[0]); | |
| 104 | + if (cell && len >= sizeof(s32)) { | |
| 105 | + s32 val = fdt32_to_cpu(cell[0]); | |
| 106 | + | |
| 107 | + debug("%#x (%d)\n", val, val); | |
| 108 | + return val; | |
| 109 | + } | |
| 110 | + debug("(not found)\n"); | |
| 101 | 111 | return default_val; |
| 102 | 112 | } |
| 103 | 113 | |
| ... | ... | @@ -329,6 +339,7 @@ |
| 329 | 339 | const u32 *phandle; |
| 330 | 340 | int lookup; |
| 331 | 341 | |
| 342 | + debug("%s: %s\n", __func__, prop_name); | |
| 332 | 343 | phandle = fdt_getprop(blob, node, prop_name, NULL); |
| 333 | 344 | if (!phandle) |
| 334 | 345 | return -FDT_ERR_NOTFOUND; |
| ... | ... | @@ -428,7 +439,7 @@ |
| 428 | 439 | assert(max_count > 0); |
| 429 | 440 | prop = fdt_get_property(blob, node, prop_name, &len); |
| 430 | 441 | if (!prop) { |
| 431 | - debug("FDT: %s: property '%s' missing\n", __func__, prop_name); | |
| 442 | + debug("%s: property '%s' missing\n", __func__, prop_name); | |
| 432 | 443 | return -FDT_ERR_NOTFOUND; |
| 433 | 444 | } |
| 434 | 445 | |
| ... | ... | @@ -437,7 +448,7 @@ |
| 437 | 448 | cell = (u32 *)prop->data; |
| 438 | 449 | len /= sizeof(u32) * 3; /* 3 cells per GPIO record */ |
| 439 | 450 | if (len > max_count) { |
| 440 | - debug("FDT: %s: too many GPIOs / cells for " | |
| 451 | + debug(" %s: too many GPIOs / cells for " | |
| 441 | 452 | "property '%s'\n", __func__, prop_name); |
| 442 | 453 | return -FDT_ERR_BADLAYOUT; |
| 443 | 454 | } |