forked from luck/tmp_suning_uos_patched
DeviceTree fixes for 4.4-rc1:
- 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. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJWQ6lzAAoJEPr7XbWNvGHDjLUP/24TJ5Pv9oTvyu08MFDUl4K7 +DzIpy1+FcxCkx7JIvtpgxr6e8hQm0qSOvDY7/TiYL2EUZMaRTrm8AWnl5SKa4UH u1VJRBA9YbbBXwtpyUAqEQJGvEfjblfGnwmHP5FMTgV6RnrD9Tf9IHfBXrnel49P F8Kb30lO+Neye1NBKRxvjWTby6cjlusKTj+rtHRFBq7aW4Au9cLyuKJZFjE+4Ijz JEMtqh/BFklOM5j8bxByHEJv0my+S2bTbC57ZTO0nAtYJj0L1fWh/8i/x+2KL7qI dlXaIl1wz888loiXZG3jIFEz+XcCopQI0AEDd5wwIvaedqk3cxmgMgx2sLVJtJYU v87BFxw5sSqU44GSbCDRweN6fHhjotS+LDdz8Q4nWdkvFVYIFIEOeHZ1Vldmj3Xe 4b3E4oJDo8j6/G1M+09qk0LUsHUT8XK+cXJZJfPoE+FXbgDifxObgIZLHccv0jbD bny0JWUZSknt3d1E3ZDROSbRLBdUGd9qEa/ueLjkDrjFCDbMwz3Ie1gtcNw1td7A Y6S4NVIW9DdQ1eK4jugoleSKhUVRv462Ksd8aAPiQXms+KqOhjMWj1NgOikMBdVE pybk11lnwRyCTvXo6eXrMxFyTM+DjgAk8fk/4emUJwdyqCkmqUm5Yny0NOiA7WxM pQtDdSpK7ZEqbdLfHLpF =Q7M4 -----END PGP SIGNATURE----- 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:
commit
b4a237598a
@ -124,6 +124,10 @@ static int __init __reserved_mem_alloc_size(unsigned long node,
|
||||
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);
|
||||
if (prop) {
|
||||
|
||||
@ -226,10 +230,9 @@ static void __init __rmem_check_for_overlap(void)
|
||||
|
||||
this_end = this->base + this->size;
|
||||
next_end = next->base + next->size;
|
||||
WARN(1,
|
||||
"Reserved memory: OVERLAP DETECTED!\n%s (%pa--%pa) overlaps with %s (%pa--%pa)\n",
|
||||
this->name, &this->base, &this_end,
|
||||
next->name, &next->base, &next_end);
|
||||
pr_err("Reserved memory: OVERLAP DETECTED!\n%s (%pa--%pa) overlaps with %s (%pa--%pa)\n",
|
||||
this->name, &this->base, &this_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_BUS 4 /* of_platform_populate recursed to children of this node */
|
||||
|
||||
#define OF_BAD_ADDR ((u64)-1)
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
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_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)
|
||||
{
|
||||
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);
|
||||
extern bool of_dma_is_coherent(struct device_node *np);
|
||||
#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(
|
||||
struct device_node *from,
|
||||
const struct of_device_id *matches,
|
||||
|
Loading…
Reference in New Issue
Block a user