Merge tag 'devicetree-fixes-for-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
Pull DeviceTree fixes from Rob Herring: - Add empty of_translate_address needed for HiSilicon network driver. - Fix alignment requirements for CMA regions in DT. - Fix booting on PPC systems which can't do WARN() early. - Rename ak4554 binding doc from .c to .txt. * tag 'devicetree-fixes-for-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: of: Provide static inline function for of_translate_address if needed drivers: of: of_reserved_mem: fixup the alignment with CMA setup of: Print rather than WARN'ing when overlap check fails dt-bindings: ak4554: extension should be .txt
This commit is contained in:
@ -124,6 +124,10 @@ static int __init __reserved_mem_alloc_size(unsigned long node,
|
|||||||
align = dt_mem_next_cell(dt_root_addr_cells, &prop);
|
align = dt_mem_next_cell(dt_root_addr_cells, &prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Need adjust the alignment to satisfy the CMA requirement */
|
||||||
|
if (IS_ENABLED(CONFIG_CMA) && of_flat_dt_is_compatible(node, "shared-dma-pool"))
|
||||||
|
align = max(align, (phys_addr_t)PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order));
|
||||||
|
|
||||||
prop = of_get_flat_dt_prop(node, "alloc-ranges", &len);
|
prop = of_get_flat_dt_prop(node, "alloc-ranges", &len);
|
||||||
if (prop) {
|
if (prop) {
|
||||||
|
|
||||||
@ -226,10 +230,9 @@ static void __init __rmem_check_for_overlap(void)
|
|||||||
|
|
||||||
this_end = this->base + this->size;
|
this_end = this->base + this->size;
|
||||||
next_end = next->base + next->size;
|
next_end = next->base + next->size;
|
||||||
WARN(1,
|
pr_err("Reserved memory: OVERLAP DETECTED!\n%s (%pa--%pa) overlaps with %s (%pa--%pa)\n",
|
||||||
"Reserved memory: OVERLAP DETECTED!\n%s (%pa--%pa) overlaps with %s (%pa--%pa)\n",
|
this->name, &this->base, &this_end,
|
||||||
this->name, &this->base, &this_end,
|
next->name, &next->base, &next_end);
|
||||||
next->name, &next->base, &next_end);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -126,6 +126,8 @@ extern raw_spinlock_t devtree_lock;
|
|||||||
#define OF_POPULATED 3 /* device already created for the node */
|
#define OF_POPULATED 3 /* device already created for the node */
|
||||||
#define OF_POPULATED_BUS 4 /* of_platform_populate recursed to children of this node */
|
#define OF_POPULATED_BUS 4 /* of_platform_populate recursed to children of this node */
|
||||||
|
|
||||||
|
#define OF_BAD_ADDR ((u64)-1)
|
||||||
|
|
||||||
#ifdef CONFIG_OF
|
#ifdef CONFIG_OF
|
||||||
void of_core_init(void);
|
void of_core_init(void);
|
||||||
|
|
||||||
@ -229,8 +231,6 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size)
|
|||||||
#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags)
|
#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags)
|
||||||
#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)
|
#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)
|
||||||
|
|
||||||
#define OF_BAD_ADDR ((u64)-1)
|
|
||||||
|
|
||||||
static inline const char *of_node_full_name(const struct device_node *np)
|
static inline const char *of_node_full_name(const struct device_node *np)
|
||||||
{
|
{
|
||||||
return np ? np->full_name : "<no-node>";
|
return np ? np->full_name : "<no-node>";
|
||||||
|
@ -57,6 +57,13 @@ extern int of_dma_get_range(struct device_node *np, u64 *dma_addr,
|
|||||||
u64 *paddr, u64 *size);
|
u64 *paddr, u64 *size);
|
||||||
extern bool of_dma_is_coherent(struct device_node *np);
|
extern bool of_dma_is_coherent(struct device_node *np);
|
||||||
#else /* CONFIG_OF_ADDRESS */
|
#else /* CONFIG_OF_ADDRESS */
|
||||||
|
|
||||||
|
static inline u64 of_translate_address(struct device_node *np,
|
||||||
|
const __be32 *addr)
|
||||||
|
{
|
||||||
|
return OF_BAD_ADDR;
|
||||||
|
}
|
||||||
|
|
||||||
static inline struct device_node *of_find_matching_node_by_address(
|
static inline struct device_node *of_find_matching_node_by_address(
|
||||||
struct device_node *from,
|
struct device_node *from,
|
||||||
const struct of_device_id *matches,
|
const struct of_device_id *matches,
|
||||||
|
Reference in New Issue
Block a user