Skip to content
Snippets Groups Projects
Select Git revision
  • c75343972b79ef5bd44c498a63b326e37470bbfc
  • master default
  • android-container
  • nanopc-t4
  • for-kernelci
  • WIP-syscall
  • v4.16-rc5
  • v4.16-rc4
  • v4.16-rc3
  • v4.16-rc2
  • v4.16-rc1
  • v4.15
  • v4.15-rc9
  • v4.15-rc8
  • v4.15-rc7
  • v4.15-rc6
  • v4.15-rc5
  • v4.15-rc4
  • v4.15-rc3
  • v4.15-rc2
  • v4.15-rc1
  • v4.14
  • v4.14-rc8
  • v4.14-rc7
  • v4.14-rc6
  • v4.14-rc5
26 results

arm-init.c

Blame
  • arm-init.c 6.71 KiB
    /*
     * Extensible Firmware Interface
     *
     * Based on Extensible Firmware Interface Specification version 2.4
     *
     * Copyright (C) 2013 - 2015 Linaro Ltd.
     *
     * This program is free software; you can redistribute it and/or modify
     * it under the terms of the GNU General Public License version 2 as
     * published by the Free Software Foundation.
     *
     */
    
    #define pr_fmt(fmt)	"efi: " fmt
    
    #include <linux/efi.h>
    #include <linux/init.h>
    #include <linux/memblock.h>
    #include <linux/mm_types.h>
    #include <linux/of.h>
    #include <linux/of_fdt.h>
    #include <linux/platform_device.h>
    #include <linux/screen_info.h>
    
    #include <asm/efi.h>
    
    u64 efi_system_table;
    
    static int __init is_normal_ram(efi_memory_desc_t *md)
    {
    	if (md->attribute & EFI_MEMORY_WB)
    		return 1;
    	return 0;
    }
    
    /*
     * Translate a EFI virtual address into a physical address: this is necessary,
     * as some data members of the EFI system table are virtually remapped after
     * SetVirtualAddressMap() has been called.
     */
    static phys_addr_t efi_to_phys(unsigned long addr)
    {
    	efi_memory_desc_t *md;
    
    	for_each_efi_memory_desc(md) {
    		if (!(md->attribute & EFI_MEMORY_RUNTIME))
    			continue;
    		if (md->virt_addr == 0)
    			/* no virtual mapping has been installed by the stub */
    			break;
    		if (md->virt_addr <= addr &&
    		    (addr - md->virt_addr) < (md->num_pages << EFI_PAGE_SHIFT))
    			return md->phys_addr + addr - md->virt_addr;
    	}
    	return addr;
    }
    
    static __initdata unsigned long screen_info_table = EFI_INVALID_TABLE_ADDR;
    
    static __initdata efi_config_table_type_t arch_tables[] = {
    	{LINUX_EFI_ARM_SCREEN_INFO_TABLE_GUID, NULL, &screen_info_table},
    	{NULL_GUID, NULL, NULL}
    };
    
    static void __init init_screen_info(void)
    {
    	struct screen_info *si;
    
    	if (screen_info_table != EFI_INVALID_TABLE_ADDR) {
    		si = early_memremap_ro(screen_info_table, sizeof(*si));