62 DBGC ( dt,
"DT %s could not get region cell sizes: %s\n",
70 DBGC ( dt,
"DT %s could not read region %d address: %s\n",
77 if (
regs.size_cells &&
80 DBGC ( dt,
"DT %s could not read region %d size: %s\n",
88 DBGC ( dt,
"DT %s region %d at %#08llx+%#04llx\n",
90 ( (
unsigned long long )
size ) );
94 DBGC ( dt,
"DT %s region %d is too small (%#llx/%#zx bytes)\n",
102 DBGC ( dt,
"DT %s could not map region %d\n",
133 for ( i = 0 ; i < driver->
id_count ; i++ ) {
134 if (
strcmp (
id, driver->
ids[i] ) == 0 ) {
135 DBGC ( dt,
"DT %s has %s driver %s\n",
144 return &dt_node_driver;
165 if ( driver != &dt_node_driver ) {
166 DBGC ( dt,
"DT %s could not probe: %s\n",
185 if ( driver != &dt_node_driver )
186 DBGC ( dt,
"DT %s removed\n", dt->
name );
207 dt =
zalloc (
sizeof ( *dt ) );
274 DBGC ( &
sysfdt,
"DT %s has malformed node: %s\n",
280 if ( (
depth == 0 ) && (
desc.depth < 0 ) )
294 goto err_no_children;
static void dt_remove(struct dt_device *dt)
Remove devicetree device.
struct arbelprm_rc_send_wqe rc
static unsigned int unsigned int size_t uint8_t * ids
void(* remove)(struct dt_device *dt)
Remove device.
void dt_remove_children(struct dt_device *parent)
Remove devicetree children.
const char ** ids
Compatible programming model identifiers.
uint64_t address
Base address.
uint16_t size
Buffer size.
int fdt_describe(struct fdt *fdt, unsigned int offset, struct fdt_descriptor *desc)
Describe device tree token.
A device tree region cell size specification.
const char * fdt_strings(struct fdt *fdt, unsigned int offset, const char *name, unsigned int *count)
Find strings property.
unsigned long long uint64_t
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
struct device dev
Device chain.
#define list_last_entry(list, type, member)
Get the container of the last entry in a list.
struct device * parent
Bus device.
struct device dev
Generic device.
#define list_empty(list)
Test whether a list is empty.
#define list_del(list)
Delete an entry from a list.
struct ena_llq_option desc
Descriptor counts.
int(* probe)(struct dt_device *dt, unsigned int offset)
Probe device.
#define ENOMEM
Not enough space.
uint32_t fdt_phandle(struct fdt *fdt, unsigned int offset)
Get package handle (phandle) property.
void dt_remove_node(struct device *parent)
Remove devicetree node.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
#define list_add_tail(new, head)
Add a new entry to the tail of a list.
struct dt_driver * driver
Driver for this device.
static unsigned int count
Number of entries.
static void dt_remove_all(struct root_device *rootdev)
Remove devicetree bus.
const char * driver_name
Driver name.
unsigned int location
Location.
uint8_t id
Request identifier.
#define DT_DRIVERS
Devicetree driver table.
unsigned int id_count
Number of compatible programming model identifiers.
char * strerror(int errno)
Retrieve string representation of error number.
static void(* free)(struct refcnt *refcnt))
void * zalloc(size_t size)
Allocate cleared memory.
struct list_head siblings
Devices on the same bus.
static struct dt_driver * dt_find_driver(struct dt_device *dt, unsigned int offset)
Find devicetree driver.
#define for_each_table_entry(pointer, table)
Iterate through all entries within a linker table.
#define ENODEV
No such device.
size_t strlen(const char *src)
Get length of string.
int fdt_reg_address(struct fdt *fdt, unsigned int offset, struct fdt_reg_cells *regs, unsigned int index, uint64_t *address)
Get region address.
static int dt_probe(struct dt_device *dt, unsigned int offset)
Probe devicetree device.
int dt_probe_children(struct dt_device *parent, unsigned int offset)
Probe devicetree children.
int dt_probe_node(struct device *parent, unsigned int offset)
Probe devicetree node.
#define BUS_TYPE_DT
Devicetree bus type.
int(* probe)(struct root_device *rootdev)
Add root device.
static struct root_driver dt_root_driver
Devicetree bus root device driver.
const char * name
Device name.
#define INIT_LIST_HEAD(list)
Initialise a list head.
unsigned int bus_type
Bus type.
const char * name
Driver name.
struct root_device dt_root_device __root_device
Devicetree bus root device.
int strcmp(const char *first, const char *second)
Compare strings.
struct list_head children
Devices attached to this device.
void * dt_ioremap(struct dt_device *dt, unsigned int offset, unsigned int index, size_t len)
Map devicetree range.
struct device_description desc
Device description.
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
int fdt_parent_reg_cells(struct fdt *fdt, unsigned int offset, struct fdt_reg_cells *regs)
Get parent region cell size specification.
A device tree token descriptor.
uint16_t offset
Offset to command line.
void * ioremap(unsigned long bus_addr, size_t len)
Map bus address as an I/O address.
static int dt_probe_all(struct root_device *rootdev)
Probe devicetree bus.
int fdt_reg_size(struct fdt *fdt, unsigned int offset, struct fdt_reg_cells *regs, unsigned int index, uint64_t *size)
Get region size.
#define NULL
NULL pointer (VOID *)
static struct dt_driver dt_node_driver __dt_driver
Generic node driver.
struct fdt sysfdt
The system flattened device tree (if present)