2014-10-31 11:14:05 +01:00
|
|
|
/*
|
2021-05-24 06:24:56 +09:00
|
|
|
* Copyright 2020-2021, Haiku, Inc. All rights reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
2014-10-31 11:14:05 +01:00
|
|
|
*/
|
|
|
|
#ifndef _DRIVERS_BUS_FDT_H
|
|
|
|
#define _DRIVERS_BUS_FDT_H
|
|
|
|
|
|
|
|
|
2021-05-24 06:24:56 +09:00
|
|
|
#include <device_manager.h>
|
2014-10-31 11:14:05 +01:00
|
|
|
|
|
|
|
|
2021-05-24 06:24:56 +09:00
|
|
|
struct fdt_bus;
|
|
|
|
struct fdt_device;
|
2022-08-17 21:42:27 +02:00
|
|
|
struct fdt_interrupt_map;
|
2014-10-31 11:14:05 +01:00
|
|
|
|
2021-11-09 12:39:16 -06:00
|
|
|
typedef struct fdt_bus_module_info {
|
2021-05-24 06:24:56 +09:00
|
|
|
driver_module_info info;
|
2021-11-09 12:39:16 -06:00
|
|
|
device_node* (*node_by_phandle)(struct fdt_bus* bus, int phandle);
|
|
|
|
} fdt_bus_module_info;
|
2014-10-31 11:14:05 +01:00
|
|
|
|
2021-11-09 12:39:16 -06:00
|
|
|
typedef struct fdt_device_module_info {
|
2021-05-24 06:24:56 +09:00
|
|
|
driver_module_info info;
|
2021-11-09 12:39:16 -06:00
|
|
|
device_node* (*get_bus)(struct fdt_device* dev);
|
|
|
|
const char* (*get_name)(struct fdt_device* dev);
|
|
|
|
const void* (*get_prop)(struct fdt_device* dev, const char* name, int* len);
|
|
|
|
bool (*get_reg)(struct fdt_device* dev, uint32 ord, uint64* regs, uint64* len);
|
|
|
|
bool (*get_interrupt)(struct fdt_device* dev, uint32 ord,
|
2021-05-24 06:24:56 +09:00
|
|
|
device_node** interruptController, uint64* interrupt);
|
2022-08-17 21:42:27 +02:00
|
|
|
struct fdt_interrupt_map* (*get_interrupt_map)(struct fdt_device* dev);
|
|
|
|
void (*print_interrupt_map)(struct fdt_interrupt_map* interruptMap);
|
|
|
|
uint32 (*lookup_interrupt_map)(struct fdt_interrupt_map* interruptMap, uint32 childAddr, uint32 childIrq);
|
2021-11-09 12:39:16 -06:00
|
|
|
} fdt_device_module_info;
|
2014-10-31 11:14:05 +01:00
|
|
|
|
|
|
|
|
|
|
|
#endif // _DRIVERS_BUS_FDT_H
|