Commit 9fe2cfb43aab2225a8c970a69341534b2488da8c

Authored by Tom Rini
Exists in master and in 57 other branches 8qm-imx_v2020.04_5.4.70_2.3.0, emb_lf-6.6.52-2.2.0, emb_lf_v2022.04, emb_lf_v2023.04, emb_lf_v2024.04, imx_v2015.04_4.1.15_1.0.0_ga, pitx_8mp_lf_v2020.04, smarc-8m-android-10.0.0_2.6.0, smarc-8m-android-11.0.0_2.0.0, smarc-8mp-android-11.0.0_2.0.0, smarc-emmc-imx_v2014.04_3.10.53_1.1.0_ga, smarc-emmc-imx_v2014.04_3.14.28_1.0.0_ga, smarc-imx-l5.0.0_1.0.0-ga, smarc-imx6_v2018.03_4.14.98_2.0.0_ga, smarc-imx7_v2017.03_4.9.11_1.0.0_ga, smarc-imx7_v2018.03_4.14.98_2.0.0_ga, smarc-imx_v2014.04_3.14.28_1.0.0_ga, smarc-imx_v2015.04_4.1.15_1.0.0_ga, smarc-imx_v2017.03_4.9.11_1.0.0_ga, smarc-imx_v2017.03_4.9.88_2.0.0_ga, smarc-imx_v2017.03_o8.1.0_1.3.0_8m, smarc-imx_v2018.03_4.14.78_1.0.0_ga, smarc-m6.0.1_2.1.0-ga, smarc-n7.1.2_2.0.0-ga, smarc-rel_imx_4.1.15_2.0.0_ga, smarc_8m-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8m-imx_v2019.04_4.19.35_1.1.0, smarc_8m_00d0-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8mm-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8mm-imx_v2019.04_4.19.35_1.1.0, smarc_8mm-imx_v2020.04_5.4.24_2.1.0, smarc_8mp_lf_v2020.04, smarc_8mq-imx_v2020.04_5.4.24_2.1.0, smarc_8mq_lf_v2020.04, ti-u-boot-2015.07, u-boot-2013.01.y, v2013.10, v2013.10-smarct33, v2013.10-smartmen, v2014.01, v2014.04, v2014.04-smarct33, v2014.04-smarct33-emmc, v2014.04-smartmen, v2014.07, v2014.07-smarct33, v2014.07-smartmen, v2015.07-smarct33, v2015.07-smarct33-emmc, v2015.07-smarct4x, v2016.05-dlt, v2016.05-smarct3x, v2016.05-smarct3x-emmc, v2016.05-smarct4x, v2017.01-smarct3x, v2017.01-smarct3x-emmc, v2017.01-smarct4x

Merge branch 'agust@denx.de' of git://git.denx.de/u-boot-staging

Showing 5 changed files Side-by-side Diff

... ... @@ -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
... ... @@ -89,7 +89,7 @@
89 89 struct pci_region *prefetch,
90 90 struct pci_region *io)
91 91 {
92   - pci_addr_t bar_response;
  92 + u32 bar_response;
93 93 pci_size_t bar_size;
94 94 u16 cmdstat = 0;
95 95 int bar, bar_nr = 0;
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_ */
... ... @@ -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
... ... @@ -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 }