]> Git Repo - linux.git/commitdiff
Merge branch 'devicetree/arm-next' of git://git.secretlab.ca/git/linux-2.6 into devel...
authorRussell King <[email protected]>
Tue, 24 May 2011 23:08:17 +0000 (00:08 +0100)
committerRussell King <[email protected]>
Tue, 24 May 2011 23:08:17 +0000 (00:08 +0100)
1  2 
arch/arm/Kconfig
arch/arm/kernel/setup.c
arch/arm/mm/init.c
arch/powerpc/kernel/prom.c

diff --combined arch/arm/Kconfig
index 7275009686e64a9336ff6fb902d57c6363f1d4fd,efc7f3c87f1d9840bfc811da58811e10028a8c16..3bc1a58cc7d89ceba1f50600915d8d880d28d9da
@@@ -197,21 -197,15 +197,21 @@@ config ARM_PATCH_PHYS_VIR
        depends on !XIP_KERNEL && MMU
        depends on !ARCH_REALVIEW || !SPARSEMEM
        help
 -        Patch phys-to-virt translation functions at runtime according to
 -        the position of the kernel in system memory.
 +        Patch phys-to-virt and virt-to-phys translation functions at
 +        boot and module load time according to the position of the
 +        kernel in system memory.
  
 -        This can only be used with non-XIP with MMU kernels where
 -        the base of physical memory is at a 16MB boundary.
 +        This can only be used with non-XIP MMU kernels where the base
 +        of physical memory is at a 16MB boundary, or theoretically 64K
 +        for the MSM machine class.
  
  config ARM_PATCH_PHYS_VIRT_16BIT
        def_bool y
        depends on ARM_PATCH_PHYS_VIRT && ARCH_MSM
 +      help
 +        This option extends the physical to virtual translation patching
 +        to allow physical memory down to a theoretical minimum of 64K
 +        boundaries.
  
  source "init/Kconfig"
  
@@@ -303,7 -297,6 +303,7 @@@ config ARCH_BCMRIN
        depends on MMU
        select CPU_V6
        select ARM_AMBA
 +      select ARM_TIMER_SP804
        select CLKDEV_LOOKUP
        select GENERIC_CLOCKEVENTS
        select ARCH_WANT_OPTIONAL_GPIOLIB
@@@ -373,7 -366,6 +373,7 @@@ config ARCH_MX
        select GENERIC_CLOCKEVENTS
        select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
 +      select CLKSRC_MMIO
        select HAVE_SCHED_CLOCK
        help
          Support for Freescale MXC/iMX-based family of processors
@@@ -383,13 -375,21 +383,13 @@@ config ARCH_MX
        select GENERIC_CLOCKEVENTS
        select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
 +      select CLKSRC_MMIO
        help
          Support for Freescale MXS-based family of processors
  
 -config ARCH_STMP3XXX
 -      bool "Freescale STMP3xxx"
 -      select CPU_ARM926T
 -      select CLKDEV_LOOKUP
 -      select ARCH_REQUIRE_GPIOLIB
 -      select GENERIC_CLOCKEVENTS
 -      select USB_ARCH_HAS_EHCI
 -      help
 -        Support for systems based on the Freescale 3xxx CPUs.
 -
  config ARCH_NETX
        bool "Hilscher NetX based"
 +      select CLKSRC_MMIO
        select CPU_ARM926T
        select ARM_VIC
        select GENERIC_CLOCKEVENTS
@@@ -457,7 -457,6 +457,7 @@@ config ARCH_IXP200
  config ARCH_IXP4XX
        bool "IXP4xx-based"
        depends on MMU
 +      select CLKSRC_MMIO
        select CPU_XSCALE
        select GENERIC_GPIO
        select GENERIC_CLOCKEVENTS
  
  config ARCH_DOVE
        bool "Marvell Dove"
 -      select CPU_V6K
 +      select CPU_V7
        select PCI
        select ARCH_REQUIRE_GPIOLIB
        select GENERIC_CLOCKEVENTS
@@@ -498,7 -497,6 +498,7 @@@ config ARCH_LOK
  
  config ARCH_LPC32XX
        bool "NXP LPC32XX"
 +      select CLKSRC_MMIO
        select CPU_ARM926T
        select ARCH_REQUIRE_GPIOLIB
        select HAVE_IDE
@@@ -556,12 -554,23 +556,12 @@@ config ARCH_KS869
          Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based
          System-on-Chip devices.
  
 -config ARCH_NS9XXX
 -      bool "NetSilicon NS9xxx"
 -      select CPU_ARM926T
 -      select GENERIC_GPIO
 -      select GENERIC_CLOCKEVENTS
 -      select HAVE_CLK
 -      help
 -        Say Y here if you intend to run this kernel on a NetSilicon NS9xxx
 -        System.
 -
 -        <http://www.digi.com/products/microprocessors/index.jsp>
 -
  config ARCH_W90X900
        bool "Nuvoton W90X900 CPU"
        select CPU_ARM926T
        select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
 +      select CLKSRC_MMIO
        select GENERIC_CLOCKEVENTS
        help
          Support for Nuvoton (Winbond logic dept.) ARM9 processor,
@@@ -583,7 -592,6 +583,7 @@@ config ARCH_NUC93
  config ARCH_TEGRA
        bool "NVIDIA Tegra"
        select CLKDEV_LOOKUP
 +      select CLKSRC_MMIO
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
        select GENERIC_GPIO
@@@ -609,7 -617,6 +609,7 @@@ config ARCH_PX
        select ARCH_MTD_XIP
        select ARCH_HAS_CPUFREQ
        select CLKDEV_LOOKUP
 +      select CLKSRC_MMIO
        select ARCH_REQUIRE_GPIOLIB
        select GENERIC_CLOCKEVENTS
        select HAVE_SCHED_CLOCK
@@@ -660,7 -667,6 +660,7 @@@ config ARCH_RP
  
  config ARCH_SA1100
        bool "SA1100-based"
 +      select CLKSRC_MMIO
        select CPU_SA1100
        select ISA
        select ARCH_SPARSEMEM_ENABLE
@@@ -797,7 -803,6 +797,7 @@@ config ARCH_SHAR
  
  config ARCH_TCC_926
        bool "Telechips TCC ARM926-based systems"
 +      select CLKSRC_MMIO
        select CPU_ARM926T
        select HAVE_CLK
        select CLKDEV_LOOKUP
  config ARCH_U300
        bool "ST-Ericsson U300 Series"
        depends on MMU
 +      select CLKSRC_MMIO
        select CPU_ARM926T
        select HAVE_SCHED_CLOCK
        select HAVE_TCM
@@@ -850,7 -854,6 +850,7 @@@ config ARCH_DAVINC
        select HAVE_IDE
        select CLKDEV_LOOKUP
        select GENERIC_ALLOCATOR
 +      select GENERIC_IRQ_CHIP
        select ARCH_HAS_HOLES_MEMORYMODEL
        help
          Support for TI's DaVinci platform.
@@@ -871,7 -874,6 +871,7 @@@ config PLAT_SPEA
        select ARM_AMBA
        select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
 +      select CLKSRC_MMIO
        select GENERIC_CLOCKEVENTS
        select HAVE_CLK
        help
@@@ -949,6 -951,8 +949,6 @@@ source "arch/arm/mach-netx/Kconfig
  source "arch/arm/mach-nomadik/Kconfig"
  source "arch/arm/plat-nomadik/Kconfig"
  
 -source "arch/arm/mach-ns9xxx/Kconfig"
 -
  source "arch/arm/mach-nuc93x/Kconfig"
  
  source "arch/arm/plat-omap/Kconfig"
@@@ -1001,6 -1005,8 +1001,6 @@@ source "arch/arm/mach-exynos4/Kconfig
  
  source "arch/arm/mach-shmobile/Kconfig"
  
 -source "arch/arm/plat-stmp3xxx/Kconfig"
 -
  source "arch/arm/mach-tegra/Kconfig"
  
  source "arch/arm/mach-u300/Kconfig"
@@@ -1027,8 -1033,6 +1027,8 @@@ config PLAT_IO
  
  config PLAT_ORION
        bool
 +      select CLKSRC_MMIO
 +      select GENERIC_IRQ_CHIP
        select HAVE_SCHED_CLOCK
  
  config PLAT_PXA
@@@ -1039,7 -1043,6 +1039,7 @@@ config PLAT_VERSATIL
  
  config ARM_TIMER_SP804
        bool
 +      select CLKSRC_MMIO
  
  source arch/arm/mm/Kconfig
  
@@@ -1315,7 -1318,8 +1315,7 @@@ menu "Kernel Features
  source "kernel/time/Kconfig"
  
  config SMP
 -      bool "Symmetric Multi-Processing (EXPERIMENTAL)"
 -      depends on EXPERIMENTAL
 +      bool "Symmetric Multi-Processing"
        depends on CPU_V6K || CPU_V7
        depends on GENERIC_CLOCKEVENTS
        depends on REALVIEW_EB_ARM11MP || REALVIEW_EB_A9MP || \
@@@ -1517,8 -1521,8 +1517,8 @@@ config ARCH_SELECT_MEMORY_MODE
        def_bool ARCH_SPARSEMEM_ENABLE
  
  config HIGHMEM
 -      bool "High Memory Support (EXPERIMENTAL)"
 -      depends on MMU && EXPERIMENTAL
 +      bool "High Memory Support"
 +      depends on MMU
        help
          The address space of ARM processors is only 4 Gigabytes large
          and it has to accommodate user address space, kernel address
@@@ -1683,6 -1687,13 +1683,13 @@@ endmen
  
  menu "Boot options"
  
+ config USE_OF
+       bool "Flattened Device Tree support"
+       select OF
+       select OF_EARLY_FLATTREE
+       help
+         Include support for flattened device tree machine descriptions.
  # Compressed boot loader in ROM.  Yes, we really want to ask about
  # TEXT and BSS so we preserve their values in the config files.
  config ZBOOT_ROM_TEXT
@@@ -1738,31 -1749,16 +1745,31 @@@ config CMDLIN
          time by entering them here. As a minimum, you should specify the
          memory size and the root device (e.g., mem=64M root=/dev/nfs).
  
 +choice
 +      prompt "Kernel command line type" if CMDLINE != ""
 +      default CMDLINE_FROM_BOOTLOADER
 +
 +config CMDLINE_FROM_BOOTLOADER
 +      bool "Use bootloader kernel arguments if available"
 +      help
 +        Uses the command-line options passed by the boot loader. If
 +        the boot loader doesn't provide any, the default kernel command
 +        string provided in CMDLINE will be used.
 +
 +config CMDLINE_EXTEND
 +      bool "Extend bootloader kernel arguments"
 +      help
 +        The command-line arguments provided by the boot loader will be
 +        appended to the default kernel command string.
 +
  config CMDLINE_FORCE
        bool "Always use the default kernel command string"
 -      depends on CMDLINE != ""
        help
          Always use the default kernel command string, even if the boot
          loader passes other arguments to the kernel.
          This is useful if you cannot or don't want to change the
          command-line options your boot loader passes to the kernel.
 -
 -        If unsure, say N.
 +endchoice
  
  config XIP_KERNEL
        bool "Kernel Execute-In-Place from ROM"
@@@ -2021,7 -2017,7 +2028,7 @@@ menu "Power management options
  source "kernel/power/Kconfig"
  
  config ARCH_SUSPEND_POSSIBLE
 -      depends on !ARCH_S5P64X0 && !ARCH_S5P6442
 +      depends on !ARCH_S5P64X0 && !ARCH_S5P6442 && !ARCH_S5PC100
        depends on CPU_ARM920T || CPU_ARM926T || CPU_SA1100 || \
                CPU_V6 || CPU_V6K || CPU_V7 || CPU_XSC3 || CPU_XSCALE
        def_bool y
diff --combined arch/arm/kernel/setup.c
index 6dce209a623b2a0bee4fc3665c1f1ca8dd559d5a,05db25ef3dd5f4b7432888e27a2344300c1e758e..ed11fb08b05a5b2d3fd022d981970c01c9fdc088
@@@ -20,6 -20,7 +20,7 @@@
  #include <linux/screen_info.h>
  #include <linux/init.h>
  #include <linux/kexec.h>
+ #include <linux/of_fdt.h>
  #include <linux/crash_dump.h>
  #include <linux/root_dev.h>
  #include <linux/cpu.h>
@@@ -42,6 -43,7 +43,7 @@@
  #include <asm/cachetype.h>
  #include <asm/tlbflush.h>
  
+ #include <asm/prom.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/irq.h>
  #include <asm/mach/time.h>
@@@ -309,7 -311,7 +311,7 @@@ static void __init cacheid_init(void
   */
  extern struct proc_info_list *lookup_processor_type(unsigned int);
  
static void __init early_print(const char *str, ...)
+ void __init early_print(const char *str, ...)
  {
        extern void printascii(const char *);
        char buf[256];
@@@ -439,25 -441,12 +441,12 @@@ void cpu_init(void
            : "r14");
  }
  
static struct machine_desc * __init setup_machine(unsigned int nr)
void __init dump_machine_table(void)
  {
-       extern struct machine_desc __arch_info_begin[], __arch_info_end[];
        struct machine_desc *p;
  
-       /*
-        * locate machine in the list of supported machines.
-        */
-       for (p = __arch_info_begin; p < __arch_info_end; p++)
-               if (nr == p->nr) {
-                       printk("Machine: %s\n", p->name);
-                       return p;
-               }
-       early_print("\n"
-               "Error: unrecognized/unsupported machine ID (r1 = 0x%08x).\n\n"
-               "Available machine support:\n\nID (hex)\tNAME\n", nr);
-       for (p = __arch_info_begin; p < __arch_info_end; p++)
+       early_print("Available machine support:\n\nID (hex)\tNAME\n");
+       for_each_machine_desc(p)
                early_print("%08x\t%s\n", p->nr, p->name);
  
        early_print("\nPlease check your kernel config and/or bootloader.\n");
                /* can't use cpu_relax() here as it may require MMU setup */;
  }
  
static int __init arm_add_memory(phys_addr_t start, unsigned long size)
+ int __init arm_add_memory(phys_addr_t start, unsigned long size)
  {
        struct membank *bank = &meminfo.bank[meminfo.nr_banks];
  
@@@ -672,16 -661,11 +661,16 @@@ __tagtable(ATAG_REVISION, parse_tag_rev
  
  static int __init parse_tag_cmdline(const struct tag *tag)
  {
 -#ifndef CONFIG_CMDLINE_FORCE
 -      strlcpy(default_command_line, tag->u.cmdline.cmdline, COMMAND_LINE_SIZE);
 -#else
 +#if defined(CONFIG_CMDLINE_EXTEND)
 +      strlcat(default_command_line, " ", COMMAND_LINE_SIZE);
 +      strlcat(default_command_line, tag->u.cmdline.cmdline,
 +              COMMAND_LINE_SIZE);
 +#elif defined(CONFIG_CMDLINE_FORCE)
        pr_warning("Ignoring tag cmdline (using the default kernel command line)\n");
 -#endif /* CONFIG_CMDLINE_FORCE */
 +#else
 +      strlcpy(default_command_line, tag->u.cmdline.cmdline,
 +              COMMAND_LINE_SIZE);
 +#endif
        return 0;
  }
  
@@@ -801,23 -785,29 +790,29 @@@ static void __init squash_mem_tags(stru
                        tag->hdr.tag = ATAG_NONE;
  }
  
void __init setup_arch(char **cmdline_p)
static struct machine_desc * __init setup_machine_tags(unsigned int nr)
  {
        struct tag *tags = (struct tag *)&init_tags;
-       struct machine_desc *mdesc;
+       struct machine_desc *mdesc = NULL, *p;
        char *from = default_command_line;
  
        init_tags.mem.start = PHYS_OFFSET;
  
-       unwind_init();
-       setup_processor();
-       mdesc = setup_machine(machine_arch_type);
-       machine_desc = mdesc;
-       machine_name = mdesc->name;
+       /*
+        * locate machine in the list of supported machines.
+        */
+       for_each_machine_desc(p)
+               if (nr == p->nr) {
+                       printk("Machine: %s\n", p->name);
+                       mdesc = p;
+                       break;
+               }
  
-       if (mdesc->soft_reboot)
-               reboot_setup("s");
+       if (!mdesc) {
+               early_print("\nError: unrecognized/unsupported machine ID"
+                       " (r1 = 0x%08x).\n\n", nr);
+               dump_machine_table(); /* does not return */
+       }
  
        if (__atags_pointer)
                tags = phys_to_virt(__atags_pointer);
        if (tags->hdr.tag != ATAG_CORE)
                convert_to_tag_list(tags);
  #endif
-       if (tags->hdr.tag != ATAG_CORE)
+       if (tags->hdr.tag != ATAG_CORE) {
+ #if defined(CONFIG_OF)
+               /*
+                * If CONFIG_OF is set, then assume this is a reasonably
+                * modern system that should pass boot parameters
+                */
+               early_print("Warning: Neither atags nor dtb found\n");
+ #endif
                tags = (struct tag *)&init_tags;
+       }
  
        if (mdesc->fixup)
                mdesc->fixup(mdesc, tags, &from, &meminfo);
                parse_tags(tags);
        }
  
+       /* parse_early_param needs a boot_command_line */
+       strlcpy(boot_command_line, from, COMMAND_LINE_SIZE);
+       return mdesc;
+ }
+ void __init setup_arch(char **cmdline_p)
+ {
+       struct machine_desc *mdesc;
+       unwind_init();
+       setup_processor();
+       mdesc = setup_machine_fdt(__atags_pointer);
+       if (!mdesc)
+               mdesc = setup_machine_tags(machine_arch_type);
+       machine_desc = mdesc;
+       machine_name = mdesc->name;
+       if (mdesc->soft_reboot)
+               reboot_setup("s");
        init_mm.start_code = (unsigned long) _text;
        init_mm.end_code   = (unsigned long) _etext;
        init_mm.end_data   = (unsigned long) _edata;
        init_mm.brk        = (unsigned long) _end;
  
-       /* parse_early_param needs a boot_command_line */
-       strlcpy(boot_command_line, from, COMMAND_LINE_SIZE);
        /* populate cmd_line too for later use, preserving boot_command_line */
        strlcpy(cmd_line, boot_command_line, COMMAND_LINE_SIZE);
        *cmdline_p = cmd_line;
        paging_init(mdesc);
        request_standard_resources(mdesc);
  
+       unflatten_device_tree();
  #ifdef CONFIG_SMP
        if (is_smp())
                smp_init_cpus();
diff --combined arch/arm/mm/init.c
index 76f82ae44efb177ae925cc998b9c3ce2c8470bb3,b26597552ebce626f18f2394b23bf8ff226386c2..751767279b3e36843882fb15126f00d5996dfd74
  #include <linux/mman.h>
  #include <linux/nodemask.h>
  #include <linux/initrd.h>
+ #include <linux/of_fdt.h>
  #include <linux/highmem.h>
  #include <linux/gfp.h>
  #include <linux/memblock.h>
  #include <linux/sort.h>
  
  #include <asm/mach-types.h>
+ #include <asm/prom.h>
  #include <asm/sections.h>
  #include <asm/setup.h>
  #include <asm/sizes.h>
@@@ -71,6 -73,14 +73,14 @@@ static int __init parse_tag_initrd2(con
  
  __tagtable(ATAG_INITRD2, parse_tag_initrd2);
  
+ #ifdef CONFIG_OF_FLATTREE
+ void __init early_init_dt_setup_initrd_arch(unsigned long start, unsigned long end)
+ {
+       phys_initrd_start = start;
+       phys_initrd_size = end - start;
+ }
+ #endif /* CONFIG_OF_FLATTREE */
  /*
   * This keeps memory configuration data used by a couple memory
   * initialization functions, as well as show_mem() for the skipping
@@@ -201,20 -211,6 +211,20 @@@ static void __init arm_bootmem_init(uns
        }
  }
  
 +#ifdef CONFIG_ZONE_DMA
 +static void __init arm_adjust_dma_zone(unsigned long *size, unsigned long *hole,
 +      unsigned long dma_size)
 +{
 +      if (size[0] <= dma_size)
 +              return;
 +
 +      size[ZONE_NORMAL] = size[0] - dma_size;
 +      size[ZONE_DMA] = dma_size;
 +      hole[ZONE_NORMAL] = hole[0];
 +      hole[ZONE_DMA] = 0;
 +}
 +#endif
 +
  static void __init arm_bootmem_free(unsigned long min, unsigned long max_low,
        unsigned long max_high)
  {
  #endif
        }
  
 +#ifdef ARM_DMA_ZONE_SIZE
 +#ifndef CONFIG_ZONE_DMA
 +#error ARM_DMA_ZONE_SIZE set but no DMA zone to limit allocations
 +#endif
 +
        /*
         * Adjust the sizes according to any special requirements for
         * this machine type.
         */
 -      arch_adjust_zones(zone_size, zhole_size);
 +      arm_adjust_dma_zone(zone_size, zhole_size,
 +              ARM_DMA_ZONE_SIZE >> PAGE_SHIFT);
 +#endif
  
        free_area_init_node(0, zone_size, min, zhole_size);
  }
@@@ -334,6 -323,7 +344,7 @@@ void __init arm_memblock_init(struct me
  #endif
  
        arm_mm_memblock_reserve();
+       arm_dt_memblock_reserve();
  
        /* reserve any platform specific memblock areas */
        if (mdesc->reserve)
@@@ -413,7 -403,7 +424,7 @@@ free_memmap(unsigned long start_pfn, un
         * Convert start_pfn/end_pfn to a struct page pointer.
         */
        start_pg = pfn_to_page(start_pfn - 1) + 1;
 -      end_pg = pfn_to_page(end_pfn);
 +      end_pg = pfn_to_page(end_pfn - 1) + 1;
  
        /*
         * Convert to physical addresses, and
@@@ -447,14 -437,6 +458,14 @@@ static void __init free_unused_memmap(s
  
                bank_start = bank_pfn_start(bank);
  
 +#ifdef CONFIG_SPARSEMEM
 +              /*
 +               * Take care not to free memmap entries that don't exist
 +               * due to SPARSEMEM sections which aren't present.
 +               */
 +              bank_start = min(bank_start,
 +                               ALIGN(prev_bank_end, PAGES_PER_SECTION));
 +#endif
                /*
                 * If we had a previous bank, and there is a space
                 * between the current bank and the previous, free it.
                 */
                prev_bank_end = ALIGN(bank_pfn_end(bank), MAX_ORDER_NR_PAGES);
        }
 +
 +#ifdef CONFIG_SPARSEMEM
 +      if (!IS_ALIGNED(prev_bank_end, PAGES_PER_SECTION))
 +              free_memmap(prev_bank_end,
 +                          ALIGN(prev_bank_end, PAGES_PER_SECTION));
 +#endif
  }
  
  static void __init free_highpages(void)
index 48aeb55faae9b806363317493800521ad8e2ec57,c173bee09cee739564cf68e576e795aa41ca58d0..f2c906b1d8d3f77158d44f40d7bedec4be253cfc
@@@ -68,7 -68,6 +68,7 @@@ int __initdata iommu_force_on
  unsigned long tce_alloc_start, tce_alloc_end;
  u64 ppc64_rma_size;
  #endif
 +static phys_addr_t first_memblock_size;
  
  static int __init early_parse_mem(char *p)
  {
@@@ -124,19 -123,18 +124,19 @@@ static void __init move_device_tree(voi
   */
  static struct ibm_pa_feature {
        unsigned long   cpu_features;   /* CPU_FTR_xxx bit */
 +      unsigned long   mmu_features;   /* MMU_FTR_xxx bit */
        unsigned int    cpu_user_ftrs;  /* PPC_FEATURE_xxx bit */
        unsigned char   pabyte;         /* byte number in ibm,pa-features */
        unsigned char   pabit;          /* bit number (big-endian) */
        unsigned char   invert;         /* if 1, pa bit set => clear feature */
  } ibm_pa_features[] __initdata = {
 -      {0, PPC_FEATURE_HAS_MMU,        0, 0, 0},
 -      {0, PPC_FEATURE_HAS_FPU,        0, 1, 0},
 -      {CPU_FTR_SLB, 0,                0, 2, 0},
 -      {CPU_FTR_CTRL, 0,               0, 3, 0},
 -      {CPU_FTR_NOEXECUTE, 0,          0, 6, 0},
 -      {CPU_FTR_NODSISRALIGN, 0,       1, 1, 1},
 -      {CPU_FTR_CI_LARGE_PAGE, 0,      1, 2, 0},
 +      {0, 0, PPC_FEATURE_HAS_MMU,     0, 0, 0},
 +      {0, 0, PPC_FEATURE_HAS_FPU,     0, 1, 0},
 +      {0, MMU_FTR_SLB, 0,             0, 2, 0},
 +      {CPU_FTR_CTRL, 0, 0,            0, 3, 0},
 +      {CPU_FTR_NOEXECUTE, 0, 0,       0, 6, 0},
 +      {CPU_FTR_NODSISRALIGN, 0, 0,    1, 1, 1},
 +      {0, MMU_FTR_CI_LARGE_PAGE, 0,   1, 2, 0},
        {CPU_FTR_REAL_LE, PPC_FEATURE_TRUE_LE, 5, 0, 0},
  };
  
@@@ -168,11 -166,9 +168,11 @@@ static void __init scan_features(unsign
                if (bit ^ fp->invert) {
                        cur_cpu_spec->cpu_features |= fp->cpu_features;
                        cur_cpu_spec->cpu_user_features |= fp->cpu_user_ftrs;
 +                      cur_cpu_spec->mmu_features |= fp->mmu_features;
                } else {
                        cur_cpu_spec->cpu_features &= ~fp->cpu_features;
                        cur_cpu_spec->cpu_user_features &= ~fp->cpu_user_ftrs;
 +                      cur_cpu_spec->mmu_features &= ~fp->mmu_features;
                }
        }
  }
@@@ -272,13 -268,13 +272,13 @@@ static int __init early_init_dt_scan_cp
                                          const char *uname, int depth,
                                          void *data)
  {
 -      static int logical_cpuid = 0;
        char *type = of_get_flat_dt_prop(node, "device_type", NULL);
        const u32 *prop;
        const u32 *intserv;
        int i, nthreads;
        unsigned long len;
 -      int found = 0;
 +      int found = -1;
 +      int found_thread = 0;
  
        /* We are scanning "cpu" nodes only */
        if (type == NULL || strcmp(type, "cpu") != 0)
                 * version 2 of the kexec param format adds the phys cpuid of
                 * booted proc.
                 */
 -              if (initial_boot_params && initial_boot_params->version >= 2) {
 -                      if (intserv[i] ==
 -                                      initial_boot_params->boot_cpuid_phys) {
 -                              found = 1;
 -                              break;
 +              if (initial_boot_params->version >= 2) {
 +                      if (intserv[i] == initial_boot_params->boot_cpuid_phys) {
 +                              found = boot_cpu_count;
 +                              found_thread = i;
                        }
                } else {
                        /*
                         * off secondary threads.
                         */
                        if (of_get_flat_dt_prop(node,
 -                                      "linux,boot-cpu", NULL) != NULL) {
 -                              found = 1;
 -                              break;
 -                      }
 +                                      "linux,boot-cpu", NULL) != NULL)
 +                              found = boot_cpu_count;
                }
 -
  #ifdef CONFIG_SMP
                /* logical cpu id is always 0 on UP kernels */
 -              logical_cpuid++;
 +              boot_cpu_count++;
  #endif
        }
  
 -      if (found) {
 -              DBG("boot cpu: logical %d physical %d\n", logical_cpuid,
 -                      intserv[i]);
 -              boot_cpuid = logical_cpuid;
 -              set_hard_smp_processor_id(boot_cpuid, intserv[i]);
 +      if (found >= 0) {
 +              DBG("boot cpu: logical %d physical %d\n", found,
 +                      intserv[found_thread]);
 +              boot_cpuid = found;
 +              set_hard_smp_processor_id(found, intserv[found_thread]);
  
                /*
                 * PAPR defines "logical" PVR values for cpus that
@@@ -509,14 -509,11 +509,14 @@@ void __init early_init_dt_add_memory_ar
                        size = 0x80000000ul - base;
        }
  #endif
 -
 -      /* First MEMBLOCK added, do some special initializations */
 -      if (memstart_addr == ~(phys_addr_t)0)
 -              setup_initial_memory_limit(base, size);
 -      memstart_addr = min((u64)memstart_addr, base);
 +      /* Keep track of the beginning of memory -and- the size of
 +       * the very first block in the device-tree as it represents
 +       * the RMA on ppc64 server
 +       */
 +      if (base < memstart_addr) {
 +              memstart_addr = base;
 +              first_memblock_size = size;
 +      }
  
        /* Add the chunk to the MEMBLOCK list */
        memblock_add(base, size);
@@@ -694,14 -691,13 +694,14 @@@ void __init early_init_devtree(void *pa
         * device-tree, including the platform type, initrd location and
         * size, TCE reserve, and more ...
         */
-       of_scan_flat_dt(early_init_dt_scan_chosen_ppc, NULL);
+       of_scan_flat_dt(early_init_dt_scan_chosen_ppc, cmd_line);
  
        /* Scan memory nodes and rebuild MEMBLOCKs */
        memblock_init();
  
        of_scan_flat_dt(early_init_dt_scan_root, NULL);
        of_scan_flat_dt(early_init_dt_scan_memory_ppc, NULL);
 +      setup_initial_memory_limit(memstart_addr, first_memblock_size);
  
        /* Save command line for /proc/cmdline and then parse parameters */
        strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE);
This page took 0.101339 seconds and 4 git commands to generate.