Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
address.c File Reference
#include <linux/device.h>
#include <linux/io.h>
#include <linux/ioport.h>
#include <linux/module.h>
#include <linux/of_address.h>
#include <linux/pci_regs.h>
#include <linux/string.h>

Go to the source code of this file.

Data Structures

struct  of_bus
 

Macros

#define OF_MAX_ADDR_CELLS   4
 
#define OF_CHECK_ADDR_COUNT(na)   ((na) > 0 && (na) <= OF_MAX_ADDR_CELLS)
 
#define OF_CHECK_COUNTS(na, ns)   (OF_CHECK_ADDR_COUNT(na) && (ns) > 0)
 

Functions

u64 of_translate_address (struct device_node *dev, const __be32 *in_addr)
 
 EXPORT_SYMBOL (of_translate_address)
 
u64 of_translate_dma_address (struct device_node *dev, const __be32 *in_addr)
 
 EXPORT_SYMBOL (of_translate_dma_address)
 
bool of_can_translate_address (struct device_node *dev)
 
 EXPORT_SYMBOL (of_can_translate_address)
 
const __be32of_get_address (struct device_node *dev, int index, u64 *size, unsigned int *flags)
 
 EXPORT_SYMBOL (of_get_address)
 
int of_address_to_resource (struct device_node *dev, int index, struct resource *r)
 
 EXPORT_SYMBOL_GPL (of_address_to_resource)
 
struct device_nodeof_find_matching_node_by_address (struct device_node *from, const struct of_device_id *matches, u64 base_address)
 
void __iomemof_iomap (struct device_node *np, int index)
 
 EXPORT_SYMBOL (of_iomap)
 

Macro Definition Documentation

#define OF_CHECK_ADDR_COUNT (   na)    ((na) > 0 && (na) <= OF_MAX_ADDR_CELLS)

Definition at line 12 of file address.c.

#define OF_CHECK_COUNTS (   na,
  ns 
)    (OF_CHECK_ADDR_COUNT(na) && (ns) > 0)

Definition at line 13 of file address.c.

#define OF_MAX_ADDR_CELLS   4

Definition at line 11 of file address.c.

Function Documentation

EXPORT_SYMBOL ( of_translate_address  )
EXPORT_SYMBOL ( of_translate_dma_address  )
EXPORT_SYMBOL ( of_can_translate_address  )
EXPORT_SYMBOL ( of_get_address  )
EXPORT_SYMBOL ( of_iomap  )
EXPORT_SYMBOL_GPL ( of_address_to_resource  )
int of_address_to_resource ( struct device_node dev,
int  index,
struct resource r 
)

of_address_to_resource - Translate device tree address and return as resource

Note that if your address is a PIO address, the conversion will fail if the physical address can't be internally converted to an IO token with pci_address_to_pio(), that is because it's either called to early or it can't be matched to any host bridge IO space

Definition at line 595 of file address.c.

bool of_can_translate_address ( struct device_node dev)

Definition at line 501 of file address.c.

struct device_node* of_find_matching_node_by_address ( struct device_node from,
const struct of_device_id matches,
u64  base_address 
)
read

Definition at line 614 of file address.c.

const __be32* of_get_address ( struct device_node dev,
int  index,
u64 size,
unsigned int flags 
)

Definition at line 520 of file address.c.

void __iomem* of_iomap ( struct device_node np,
int  index 
)

of_iomap - Maps the memory mapped IO for a given device_node : the device whose io range will be mapped : index of the io range

Returns a pointer to the mapped memory

Definition at line 640 of file address.c.

u64 of_translate_address ( struct device_node dev,
const __be32 in_addr 
)

Definition at line 489 of file address.c.

u64 of_translate_dma_address ( struct device_node dev,
const __be32 in_addr 
)

Definition at line 495 of file address.c.