Microblaze patches for 6.6-rc1

- Cleanup DT headers
 - Remove unused zalloc_maybe_bootmem()
 - Make virt_to_pfn() a static inline
 -----BEGIN PGP SIGNATURE-----
 
 iF0EABECAB0WIQQbPNTMvXmYlBPRwx7KSWXLKUoMIQUCZPdATwAKCRDKSWXLKUoM
 IUa5AJoC23Jcvy56Hr4QvWeZs8m5KYtPqQCfVpytShXKI7F9x/0+9Eyp+qI3xw0=
 =jaOk
 -----END PGP SIGNATURE-----

Merge tag 'microblaze-v6.6' of git://git.monstr.eu/linux-2.6-microblaze

Pull microblaze updates from Michal Simek:

 - Cleanup DT headers

 - Remove unused zalloc_maybe_bootmem()

 - Make virt_to_pfn() a static inline

* tag 'microblaze-v6.6' of git://git.monstr.eu/linux-2.6-microblaze:
  microblaze: Make virt_to_pfn() a static inline
  microblaze: Remove zalloc_maybe_bootmem()
  microblaze: Explicitly include correct DT includes
This commit is contained in:
Linus Torvalds 2023-09-05 10:15:22 -07:00
commit 893a259caa
4 changed files with 19 additions and 27 deletions

View File

@ -99,9 +99,6 @@ extern int page_is_ram(unsigned long pfn);
# define phys_to_pfn(phys) (PFN_DOWN(phys))
# define pfn_to_phys(pfn) (PFN_PHYS(pfn))
# define virt_to_pfn(vaddr) (phys_to_pfn((__pa(vaddr))))
# define pfn_to_virt(pfn) __va(pfn_to_phys((pfn)))
# define virt_to_page(kaddr) (pfn_to_page(__pa(kaddr) >> PAGE_SHIFT))
# define page_to_virt(page) __va(page_to_pfn(page) << PAGE_SHIFT)
# define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
@ -109,11 +106,6 @@ extern int page_is_ram(unsigned long pfn);
# define ARCH_PFN_OFFSET (memory_start >> PAGE_SHIFT)
# endif /* __ASSEMBLY__ */
#define virt_addr_valid(vaddr) (pfn_valid(virt_to_pfn(vaddr)))
# define __pa(x) __virt_to_phys((unsigned long)(x))
# define __va(x) ((void *)__phys_to_virt((unsigned long)(x)))
/* Convert between virtual and physical address for MMU. */
/* Handle MicroBlaze processor with virtual memory. */
#define __virt_to_phys(addr) \
@ -125,6 +117,25 @@ extern int page_is_ram(unsigned long pfn);
#define tovirt(rd, rs) \
addik rd, rs, (CONFIG_KERNEL_START - CONFIG_KERNEL_BASE_ADDR)
#ifndef __ASSEMBLY__
# define __pa(x) __virt_to_phys((unsigned long)(x))
# define __va(x) ((void *)__phys_to_virt((unsigned long)(x)))
static inline unsigned long virt_to_pfn(const void *vaddr)
{
return phys_to_pfn(__pa(vaddr));
}
static inline const void *pfn_to_virt(unsigned long pfn)
{
return __va(pfn_to_phys((pfn)));
}
#define virt_addr_valid(vaddr) (pfn_valid(virt_to_pfn(vaddr)))
#endif /* __ASSEMBLY__ */
#define TOPHYS(addr) __virt_to_phys(addr)
#endif /* __KERNEL__ */

View File

@ -25,7 +25,5 @@ void machine_shutdown(void);
void machine_halt(void);
void machine_power_off(void);
extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
# endif /* __ASSEMBLY__ */
#endif /* _ASM_MICROBLAZE_SETUP_H */

View File

@ -9,7 +9,6 @@
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/of_platform.h>
#include <linux/reboot.h>
void machine_shutdown(void)

View File

@ -270,22 +270,6 @@ asmlinkage void __init mmu_init(void)
memblock_dump_all();
}
void * __ref zalloc_maybe_bootmem(size_t size, gfp_t mask)
{
void *p;
if (mem_init_done) {
p = kzalloc(size, mask);
} else {
p = memblock_alloc(size, SMP_CACHE_BYTES);
if (!p)
panic("%s: Failed to allocate %zu bytes\n",
__func__, size);
}
return p;
}
static const pgprot_t protection_map[16] = {
[VM_NONE] = PAGE_NONE,
[VM_READ] = PAGE_READONLY_X,