| 415 | } |
| 416 | |
| 417 | uint32_t |
| 418 | of_n_addr_cells(const struct device_node *dev_node) |
| 419 | { |
| 420 | const struct dt_dir *d; |
| 421 | |
| 422 | DPAAX_HWWARN(!alive, "Device-tree driver not initialised"); |
| 423 | if (!dev_node) |
| 424 | return OF_DEFAULT_NA; |
| 425 | d = node2dir(dev_node); |
| 426 | while ((d = d->parent)) |
| 427 | if (d->a_cells) { |
| 428 | unsigned char *buf = |
| 429 | (unsigned char *)&d->a_cells->buf[0]; |
| 430 | assert(d->a_cells->len == 4); |
| 431 | return ((uint32_t)buf[0] << 24) | |
| 432 | ((uint32_t)buf[1] << 16) | |
| 433 | ((uint32_t)buf[2] << 8) | |
| 434 | (uint32_t)buf[3]; |
| 435 | } |
| 436 | return OF_DEFAULT_NA; |
| 437 | } |
| 438 | |
| 439 | uint32_t |
| 440 | of_n_size_cells(const struct device_node *dev_node) |
no test coverage detected