prom.c (976e3645923bdd2fe7893aae33fd7a21098bfb28) prom.c (e96d904ede6756641563d27daa746875b478a6c8)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Procedures for creating, accessing and interpreting the device tree.
4 *
5 * Paul Mackerras August 1996.
6 * Copyright (C) 1996-2005 Paul Mackerras.
7 *
8 * Adapted for 64bit PowerPC by Dave Engebretsen and Peter Bergner.

--- 82 unchanged lines hidden (view full) ---

91 * initrd.
92 */
93static inline int overlaps_initrd(unsigned long start, unsigned long size)
94{
95#ifdef CONFIG_BLK_DEV_INITRD
96 if (!initrd_start)
97 return 0;
98
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Procedures for creating, accessing and interpreting the device tree.
4 *
5 * Paul Mackerras August 1996.
6 * Copyright (C) 1996-2005 Paul Mackerras.
7 *
8 * Adapted for 64bit PowerPC by Dave Engebretsen and Peter Bergner.

--- 82 unchanged lines hidden (view full) ---

91 * initrd.
92 */
93static inline int overlaps_initrd(unsigned long start, unsigned long size)
94{
95#ifdef CONFIG_BLK_DEV_INITRD
96 if (!initrd_start)
97 return 0;
98
99 return (start + size) > _ALIGN_DOWN(initrd_start, PAGE_SIZE) &&
99 return (start + size) > ALIGN_DOWN(initrd_start, PAGE_SIZE) &&
100 start <= _ALIGN_UP(initrd_end, PAGE_SIZE);
101#else
102 return 0;
103#endif
104}
105
106/**
107 * move_device_tree - move tree to an unused area, if needed.

--- 510 unchanged lines hidden (view full) ---

618 fdt_off_mem_rsvmap(initial_boot_params));
619
620 /* Look for the new "reserved-regions" property in the DT */
621 early_reserve_mem_dt();
622
623#ifdef CONFIG_BLK_DEV_INITRD
624 /* Then reserve the initrd, if any */
625 if (initrd_start && (initrd_end > initrd_start)) {
100 start <= _ALIGN_UP(initrd_end, PAGE_SIZE);
101#else
102 return 0;
103#endif
104}
105
106/**
107 * move_device_tree - move tree to an unused area, if needed.

--- 510 unchanged lines hidden (view full) ---

618 fdt_off_mem_rsvmap(initial_boot_params));
619
620 /* Look for the new "reserved-regions" property in the DT */
621 early_reserve_mem_dt();
622
623#ifdef CONFIG_BLK_DEV_INITRD
624 /* Then reserve the initrd, if any */
625 if (initrd_start && (initrd_end > initrd_start)) {
626 memblock_reserve(_ALIGN_DOWN(__pa(initrd_start), PAGE_SIZE),
626 memblock_reserve(ALIGN_DOWN(__pa(initrd_start), PAGE_SIZE),
627 _ALIGN_UP(initrd_end, PAGE_SIZE) -
627 _ALIGN_UP(initrd_end, PAGE_SIZE) -
628 _ALIGN_DOWN(initrd_start, PAGE_SIZE));
628 ALIGN_DOWN(initrd_start, PAGE_SIZE));
629 }
630#endif /* CONFIG_BLK_DEV_INITRD */
631
632#ifdef CONFIG_PPC32
633 /*
634 * Handle the case where we might be booting from an old kexec
635 * image that setup the mem_rsvmap as pairs of 32-bit values
636 */

--- 266 unchanged lines hidden ---
629 }
630#endif /* CONFIG_BLK_DEV_INITRD */
631
632#ifdef CONFIG_PPC32
633 /*
634 * Handle the case where we might be booting from an old kexec
635 * image that setup the mem_rsvmap as pairs of 32-bit values
636 */

--- 266 unchanged lines hidden ---