]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branch 'dt-rh/for-next'
authorThierry Reding <treding@nvidia.com>
Thu, 24 Oct 2013 12:37:24 +0000 (14:37 +0200)
committerThierry Reding <treding@nvidia.com>
Thu, 24 Oct 2013 12:37:24 +0000 (14:37 +0200)
159 files changed:
arch/arc/include/asm/mach_desc.h
arch/arc/include/asm/prom.h [deleted file]
arch/arc/kernel/devtree.c
arch/arc/kernel/setup.c
arch/arc/mm/init.c
arch/arm/include/asm/prom.h
arch/arm/kernel/devtree.c
arch/arm/mach-keystone/platsmp.c
arch/arm/mm/init.c
arch/arm64/include/asm/prom.h [deleted file]
arch/arm64/kernel/setup.c
arch/arm64/mm/init.c
arch/c6x/include/asm/prom.h [deleted file]
arch/c6x/include/asm/setup.h
arch/c6x/kernel/devicetree.c
arch/c6x/kernel/setup.c
arch/c6x/kernel/vmlinux.lds.S
arch/hexagon/kernel/setup.c
arch/metag/include/asm/mach/arch.h
arch/metag/include/asm/prom.h [deleted file]
arch/metag/include/asm/setup.h
arch/metag/kernel/devtree.c
arch/metag/kernel/setup.c
arch/metag/mm/init.c
arch/microblaze/include/asm/prom.h
arch/microblaze/kernel/prom.c
arch/microblaze/kernel/setup.c
arch/microblaze/kernel/timer.c
arch/microblaze/pci/pci-common.c
arch/mips/include/asm/prom.h
arch/mips/kernel/prom.c
arch/mips/lantiq/prom.c
arch/mips/mti-sead3/sead3-setup.c
arch/mips/ralink/of.c
arch/openrisc/include/asm/prom.h [deleted file]
arch/openrisc/kernel/prom.c
arch/openrisc/kernel/setup.c
arch/powerpc/include/asm/prom.h
arch/powerpc/kernel/epapr_paravirt.c
arch/powerpc/kernel/prom.c
arch/powerpc/platforms/512x/clock.c
arch/powerpc/platforms/512x/pdm360ng.c
arch/powerpc/platforms/82xx/mpc8272_ads.c
arch/powerpc/platforms/82xx/pq2fads.c
arch/powerpc/platforms/83xx/suspend.c
arch/powerpc/platforms/85xx/c293pcie.c
arch/powerpc/platforms/85xx/common.c
arch/powerpc/platforms/85xx/socrates_fpga_pic.c
arch/powerpc/platforms/86xx/pic.c
arch/powerpc/platforms/8xx/ep88xc.c
arch/powerpc/platforms/8xx/mpc86xads_setup.c
arch/powerpc/platforms/8xx/mpc885ads_setup.c
arch/powerpc/platforms/8xx/tqm8xx_setup.c
arch/powerpc/platforms/embedded6xx/flipper-pic.c
arch/powerpc/platforms/embedded6xx/hlwd-pic.c
arch/powerpc/platforms/pasemi/gpio_mdio.c
arch/powerpc/platforms/powermac/pfunc_base.c
arch/powerpc/platforms/powernv/opal-lpc.c
arch/powerpc/platforms/powernv/opal.c
arch/powerpc/platforms/powernv/setup.c
arch/powerpc/platforms/pseries/hotplug-memory.c
arch/powerpc/sysdev/cpm_common.c
arch/powerpc/sysdev/fsl_gtm.c
arch/powerpc/sysdev/fsl_pmc.c
arch/powerpc/sysdev/fsl_rio.c
arch/powerpc/sysdev/fsl_rmu.c
arch/powerpc/sysdev/mpic.c
arch/powerpc/sysdev/mpic_timer.c
arch/powerpc/sysdev/of_rtc.c
arch/powerpc/sysdev/ppc4xx_soc.c
arch/powerpc/sysdev/xilinx_intc.c
arch/sparc/include/asm/prom.h
arch/x86/include/asm/prom.h
arch/x86/kernel/devicetree.c
arch/xtensa/include/asm/prom.h [deleted file]
arch/xtensa/kernel/setup.c
drivers/ata/sata_fsl.c
drivers/char/bsr.c
drivers/char/hw_random/pasemi-rng.c
drivers/cpufreq/pasemi-cpufreq.c
drivers/crypto/caam/ctrl.c
drivers/crypto/caam/jr.c
drivers/crypto/talitos.c
drivers/dma/bestcomm/sram.c
drivers/dma/fsldma.c
drivers/dma/mpc512x_dma.c
drivers/edac/cell_edac.c
drivers/gpio/gpio-mpc8xxx.c
drivers/i2c/busses/i2c-ibm_iic.c
drivers/i2c/busses/i2c-mpc.c
drivers/i2c/busses/i2c-powermac.c
drivers/input/serio/xilinx_ps2.c
drivers/macintosh/macio_asic.c
drivers/macintosh/rack-meter.c
drivers/macintosh/smu.c
drivers/macintosh/via-pmu.c
drivers/media/platform/fsl-viu.c
drivers/misc/carma/carma-fpga-program.c
drivers/misc/carma/carma-fpga.c
drivers/mtd/nand/fsl_elbc_nand.c
drivers/mtd/nand/fsl_ifc_nand.c
drivers/mtd/nand/fsl_upm.c
drivers/mtd/nand/mpc5121_nfc.c
drivers/mtd/nand/ndfc.c
drivers/mtd/nand/pasemi_nand.c
drivers/net/can/grcan.c
drivers/net/can/sja1000/sja1000_of_platform.c
drivers/net/ethernet/freescale/fs_enet/mac-fcc.c
drivers/net/ethernet/freescale/fs_enet/mac-fec.c
drivers/net/ethernet/freescale/fs_enet/mac-scc.c
drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c
drivers/net/ethernet/freescale/fs_enet/mii-fec.c
drivers/net/ethernet/freescale/gianfar.c
drivers/net/ethernet/freescale/ucc_geth.c
drivers/net/ethernet/freescale/xgmac_mdio.c
drivers/net/ethernet/ibm/emac/core.c
drivers/net/ethernet/ibm/emac/mal.c
drivers/net/ethernet/ibm/emac/rgmii.c
drivers/net/ethernet/ibm/emac/tah.c
drivers/net/ethernet/ibm/emac/zmii.c
drivers/net/ethernet/xilinx/ll_temac_main.c
drivers/of/address.c
drivers/of/base.c
drivers/of/fdt.c
drivers/of/of_pci.c
drivers/of/of_pci_irq.c
drivers/of/pdt.c
drivers/pcmcia/electra_cf.c
drivers/rtc/rtc-mpc5121.c
drivers/spi/spi-fsl-cpm.c
drivers/spi/spi-fsl-espi.c
drivers/spi/spi-mpc512x-psc.c
drivers/tty/ehv_bytechan.c
drivers/tty/serial/cpm_uart/cpm_uart_core.c
drivers/tty/serial/cpm_uart/cpm_uart_cpm1.c
drivers/tty/serial/pmac_zilog.c
drivers/tty/serial/ucc_uart.c
drivers/usb/gadget/fsl_qe_udc.c
drivers/usb/host/ehci-ppc-of.c
drivers/usb/host/fhci-hcd.c
drivers/usb/host/ohci-ppc-of.c
drivers/video/fsl-diu-fb.c
drivers/virt/fsl_hypervisor.c
drivers/watchdog/gef_wdt.c
drivers/watchdog/mpc8xxx_wdt.c
fs/proc/proc_devtree.c
include/linux/of.h
include/linux/of_address.h
include/linux/of_fdt.h
sound/aoa/core/gpio-feature.c
sound/aoa/soundbus/i2sbus/core.c
sound/ppc/pmac.c
sound/ppc/tumbler.c
sound/soc/fsl/fsl_dma.c
sound/soc/fsl/mpc5200_dma.c
sound/soc/fsl/mpc5200_psc_ac97.c
sound/soc/fsl/mpc8610_hpcd.c
sound/soc/fsl/p1022_ds.c
sound/soc/fsl/p1022_rdk.c

index 9998dc846ebb1b59944d32153e89e54e486c6423..e8993a2be6c238a11e557986249773148a6eef7d 100644 (file)
@@ -51,22 +51,12 @@ struct machine_desc {
 /*
  * Current machine - only accessible during boot.
  */
-extern struct machine_desc *machine_desc;
+extern const struct machine_desc *machine_desc;
 
 /*
  * Machine type table - also only accessible during boot
  */
-extern struct machine_desc __arch_info_begin[], __arch_info_end[];
-#define for_each_machine_desc(p)                       \
-       for (p = __arch_info_begin; p < __arch_info_end; p++)
-
-static inline struct machine_desc *default_machine_desc(void)
-{
-       /* the default machine is the last one linked in */
-       if (__arch_info_end - 1 < __arch_info_begin)
-               return NULL;
-       return __arch_info_end - 1;
-}
+extern const struct machine_desc __arch_info_begin[], __arch_info_end[];
 
 /*
  * Set of macros to define architecture features.
@@ -81,7 +71,6 @@ __attribute__((__section__(".arch.info.init"))) = {   \
 #define MACHINE_END                            \
 };
 
-extern struct machine_desc *setup_machine_fdt(void *dt);
-extern void __init copy_devtree(void);
+extern const struct machine_desc *setup_machine_fdt(void *dt);
 
 #endif
diff --git a/arch/arc/include/asm/prom.h b/arch/arc/include/asm/prom.h
deleted file mode 100644 (file)
index 692d0d0..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Copyright (C) 2012 Synopsys, Inc. (www.synopsys.com)
- *
- * 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.
- */
-
-#ifndef _ASM_ARC_PROM_H_
-#define _ASM_ARC_PROM_H_
-
-#define HAVE_ARCH_DEVTREE_FIXUPS
-
-#endif
index 2340af0e1d6f8c00b57b35a127bf73f673a244e2..b6dc4e21fd32e209b0e76de102e7873b32b5927e 100644 (file)
 #include <linux/memblock.h>
 #include <linux/of.h>
 #include <linux/of_fdt.h>
-#include <asm/prom.h>
 #include <asm/clk.h>
 #include <asm/mach_desc.h>
 
+static const void * __init arch_get_next_mach(const char *const **match)
+{
+       static const struct machine_desc *mdesc = __arch_info_begin;
+       const struct machine_desc *m = mdesc;
+
+       if (m >= __arch_info_end)
+               return NULL;
+
+       mdesc++;
+       *match = m->dt_compat;
+       return m;
+}
+
 /**
  * setup_machine_fdt - Machine setup when an dtb was passed to the kernel
  * @dt:                virtual address pointer to dt blob
  * If a dtb was passed to the kernel, then use it to choose the correct
  * machine_desc and to setup the system.
  */
-struct machine_desc * __init setup_machine_fdt(void *dt)
+const struct machine_desc * __init setup_machine_fdt(void *dt)
 {
-       struct boot_param_header *devtree = dt;
-       struct machine_desc *mdesc = NULL, *mdesc_best = NULL;
-       unsigned int score, mdesc_score = ~1;
+       const struct machine_desc *mdesc;
        unsigned long dt_root;
-       const char *model, *compat;
        void *clk;
-       char manufacturer[16];
        unsigned long len;
 
-       /* check device tree validity */
-       if (be32_to_cpu(devtree->magic) != OF_DT_HEADER)
+       if (!early_init_dt_scan(dt))
                return NULL;
 
-       initial_boot_params = devtree;
-       dt_root = of_get_flat_dt_root();
-
-       /*
-        * The kernel could be multi-platform enabled, thus could have many
-        * "baked-in" machine descriptors. Search thru all for the best
-        * "compatible" string match.
-        */
-       for_each_machine_desc(mdesc) {
-               score = of_flat_dt_match(dt_root, mdesc->dt_compat);
-               if (score > 0 && score < mdesc_score) {
-                       mdesc_best = mdesc;
-                       mdesc_score = score;
-               }
-       }
-       if (!mdesc_best) {
-               const char *prop;
-               long size;
-
-               pr_err("\n unrecognized device tree list:\n[ ");
-
-               prop = of_get_flat_dt_prop(dt_root, "compatible", &size);
-               if (prop) {
-                       while (size > 0) {
-                               printk("'%s' ", prop);
-                               size -= strlen(prop) + 1;
-                               prop += strlen(prop) + 1;
-                       }
-               }
-               printk("]\n\n");
-
+       mdesc = of_flat_dt_match_machine(NULL, arch_get_next_mach);
+       if (!mdesc)
                machine_halt();
-       }
-
-       /* compat = "<manufacturer>,<model>" */
-       compat =  mdesc_best->dt_compat[0];
-
-       model = strchr(compat, ',');
-       if (model)
-               model++;
-
-       strlcpy(manufacturer, compat, model ? model - compat : strlen(compat));
-
-       pr_info("Board \"%s\" from %s (Manufacturer)\n", model, manufacturer);
-
-       /* Retrieve various information from the /chosen node */
-       of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line);
-
-       /* Initialize {size,address}-cells info */
-       of_scan_flat_dt(early_init_dt_scan_root, NULL);
-
-       /* Setup memory, calling early_init_dt_add_memory_arch */
-       of_scan_flat_dt(early_init_dt_scan_memory, NULL);
 
+       dt_root = of_get_flat_dt_root();
        clk = of_get_flat_dt_prop(dt_root, "clock-frequency", &len);
        if (clk)
                arc_set_core_freq(of_read_ulong(clk, len/4));
 
-       return mdesc_best;
-}
-
-/*
- * Copy the flattened DT out of .init since unflattening doesn't copy strings
- * and the normal DT APIs refs them from orig flat DT
- */
-void __init copy_devtree(void)
-{
-       void *alloc = early_init_dt_alloc_memory_arch(
-                       be32_to_cpu(initial_boot_params->totalsize), 64);
-       if (alloc) {
-               memcpy(alloc, initial_boot_params,
-                               be32_to_cpu(initial_boot_params->totalsize));
-               initial_boot_params = alloc;
-       }
+       return mdesc;
 }
index 2c68bc7e6a784132a97d3ad6b04d8535cf546deb..f7d4a41d06299df6bd2f1b8e9194e9b9e166996b 100644 (file)
@@ -21,7 +21,6 @@
 #include <asm/setup.h>
 #include <asm/page.h>
 #include <asm/irq.h>
-#include <asm/prom.h>
 #include <asm/unwind.h>
 #include <asm/clk.h>
 #include <asm/mach_desc.h>
@@ -31,7 +30,7 @@
 int running_on_hw = 1; /* vs. on ISS */
 
 char __initdata command_line[COMMAND_LINE_SIZE];
-struct machine_desc *machine_desc;
+const struct machine_desc *machine_desc;
 
 struct task_struct *_current_task[NR_CPUS];    /* For stack switching */
 
@@ -346,8 +345,7 @@ void __init setup_arch(char **cmdline_p)
        setup_arch_memory();
 
        /* copy flat DT out of .init and then unflatten it */
-       copy_devtree();
-       unflatten_device_tree();
+       unflatten_and_copy_device_tree();
 
        /* Can be issue if someone passes cmd line arg "ro"
         * But that is unlikely so keeping it as it is
index 81279ec73a6a7873b4a10fc8ec4c3546413bfd05..55e0a85bea78050f2b8c1606995b14a2c4f5169a 100644 (file)
@@ -125,10 +125,3 @@ void __init free_initrd_mem(unsigned long start, unsigned long end)
        free_reserved_area((void *)start, (void *)end, -1, "initrd");
 }
 #endif
-
-#ifdef CONFIG_OF_FLATTREE
-void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
-{
-       pr_err("%s(%llx, %llx)\n", __func__, start, end);
-}
-#endif /* CONFIG_OF_FLATTREE */
index 4a2985e21969ab283889935c20ad44a486ed1dcd..b681575ad3de9c969a60d538e620a65665e940f3 100644 (file)
@@ -11,8 +11,6 @@
 #ifndef __ASMARM_PROM_H
 #define __ASMARM_PROM_H
 
-#define HAVE_ARCH_DEVTREE_FIXUPS
-
 #ifdef CONFIG_OF
 
 extern const struct machine_desc *setup_machine_fdt(unsigned int dt_phys);
index f35906b3d8c9eb5b7ebcb915c1d6ec77585aef3e..739c3dfc1da25c6145268809459c567aa80e543f 100644 (file)
@@ -174,6 +174,19 @@ bool arch_match_cpu_phys_id(int cpu, u64 phys_id)
        return (phys_id & MPIDR_HWID_BITMASK) == cpu_logical_map(cpu);
 }
 
+static const void * __init arch_get_next_mach(const char *const **match)
+{
+       static const struct machine_desc *mdesc = __arch_info_begin;
+       const struct machine_desc *m = mdesc;
+
+       if (m >= __arch_info_end)
+               return NULL;
+
+       mdesc++;
+       *match = m->dt_compat;
+       return m;
+}
+
 /**
  * setup_machine_fdt - Machine setup when an dtb was passed to the kernel
  * @dt_phys: physical address of dt blob
@@ -183,11 +196,7 @@ bool arch_match_cpu_phys_id(int cpu, u64 phys_id)
  */
 const struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys)
 {
-       struct boot_param_header *devtree;
        const struct machine_desc *mdesc, *mdesc_best = NULL;
-       unsigned int score, mdesc_score = ~1;
-       unsigned long dt_root;
-       const char *model;
 
 #ifdef CONFIG_ARCH_MULTIPLATFORM
        DT_MACHINE_START(GENERIC_DT, "Generic DT based system")
@@ -196,32 +205,20 @@ const struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys)
        mdesc_best = &__mach_desc_GENERIC_DT;
 #endif
 
-       if (!dt_phys)
+       if (!dt_phys || !early_init_dt_scan(phys_to_virt(dt_phys)))
                return NULL;
 
-       devtree = phys_to_virt(dt_phys);
+       mdesc = of_flat_dt_match_machine(mdesc_best, arch_get_next_mach);
 
-       /* check device tree validity */
-       if (be32_to_cpu(devtree->magic) != OF_DT_HEADER)
-               return NULL;
-
-       /* Search the mdescs for the 'best' compatible value match */
-       initial_boot_params = devtree;
-       dt_root = of_get_flat_dt_root();
-       for_each_machine_desc(mdesc) {
-               score = of_flat_dt_match(dt_root, mdesc->dt_compat);
-               if (score > 0 && score < mdesc_score) {
-                       mdesc_best = mdesc;
-                       mdesc_score = score;
-               }
-       }
-       if (!mdesc_best) {
+       if (!mdesc) {
                const char *prop;
                long size;
+               unsigned long dt_root;
 
                early_print("\nError: unrecognized/unsupported "
                            "device tree compatible list:\n[ ");
 
+               dt_root = of_get_flat_dt_root();
                prop = of_get_flat_dt_prop(dt_root, "compatible", &size);
                while (size > 0) {
                        early_print("'%s' ", prop);
@@ -233,22 +230,8 @@ const struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys)
                dump_machine_table(); /* does not return */
        }
 
-       model = of_get_flat_dt_prop(dt_root, "model", NULL);
-       if (!model)
-               model = of_get_flat_dt_prop(dt_root, "compatible", NULL);
-       if (!model)
-               model = "<unknown>";
-       pr_info("Machine: %s, model: %s\n", mdesc_best->name, model);
-
-       /* Retrieve various information from the /chosen node */
-       of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line);
-       /* Initialize {size,address}-cells info */
-       of_scan_flat_dt(early_init_dt_scan_root, NULL);
-       /* Setup memory, calling early_init_dt_add_memory_arch */
-       of_scan_flat_dt(early_init_dt_scan_memory, NULL);
-
        /* Change machine number to match the mdesc we're using */
-       __machine_arch_type = mdesc_best->nr;
+       __machine_arch_type = mdesc->nr;
 
-       return mdesc_best;
+       return mdesc;
 }
index c12296157d4a4bfab0a0b52de2e205b7701ebc60..5cf0683577ea83e54861b927a12cdf9b87d08bd6 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/io.h>
 
 #include <asm/smp_plat.h>
-#include <asm/prom.h>
 
 #include "keystone.h"
 
index 2a3fa425c52c4062addaf897951d3b8265819764..3e8f106ee5fe01855fe12f66b0c581822c0521da 100644 (file)
@@ -76,14 +76,6 @@ static int __init parse_tag_initrd2(const struct tag *tag)
 
 __tagtable(ATAG_INITRD2, parse_tag_initrd2);
 
-#ifdef CONFIG_OF_FLATTREE
-void __init early_init_dt_setup_initrd_arch(u64 start, u64 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
@@ -352,6 +344,11 @@ void __init arm_memblock_init(struct meminfo *mi,
        memblock_reserve(__pa(_stext), _end - _stext);
 #endif
 #ifdef CONFIG_BLK_DEV_INITRD
+       /* FDT scan will populate initrd_start */
+       if (initrd_start) {
+               phys_initrd_start = __virt_to_phys(initrd_start);
+               phys_initrd_size = initrd_end - initrd_start;
+       }
        if (phys_initrd_size &&
            !memblock_is_region_memory(phys_initrd_start, phys_initrd_size)) {
                pr_err("INITRD: 0x%08llx+0x%08lx is not a memory region - disabling initrd\n",
diff --git a/arch/arm64/include/asm/prom.h b/arch/arm64/include/asm/prom.h
deleted file mode 100644 (file)
index 68b90e6..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/* Empty for now */
index 055cfb80e05c5d8d352880cb6db85d2cdea38241..a4ed2d3e4de9e158ad66d44c370ed519355d3902 100644 (file)
@@ -124,70 +124,18 @@ static void __init setup_processor(void)
 
 static void __init setup_machine_fdt(phys_addr_t dt_phys)
 {
-       struct boot_param_header *devtree;
-       unsigned long dt_root;
-
-       /* Check we have a non-NULL DT pointer */
-       if (!dt_phys) {
-               early_print("\n"
-                       "Error: NULL or invalid device tree blob\n"
-                       "The dtb must be 8-byte aligned and passed in the first 512MB of memory\n"
-                       "\nPlease check your bootloader.\n");
-
-               while (true)
-                       cpu_relax();
-
-       }
-
-       devtree = phys_to_virt(dt_phys);
-
-       /* Check device tree validity */
-       if (be32_to_cpu(devtree->magic) != OF_DT_HEADER) {
+       if (!dt_phys || !early_init_dt_scan(phys_to_virt(dt_phys))) {
                early_print("\n"
                        "Error: invalid device tree blob at physical address 0x%p (virtual address 0x%p)\n"
-                       "Expected 0x%x, found 0x%x\n"
+                       "The dtb must be 8-byte aligned and passed in the first 512MB of memory\n"
                        "\nPlease check your bootloader.\n",
-                       dt_phys, devtree, OF_DT_HEADER,
-                       be32_to_cpu(devtree->magic));
+                       dt_phys, phys_to_virt(dt_phys));
 
                while (true)
                        cpu_relax();
        }
 
-       initial_boot_params = devtree;
-       dt_root = of_get_flat_dt_root();
-
-       machine_name = of_get_flat_dt_prop(dt_root, "model", NULL);
-       if (!machine_name)
-               machine_name = of_get_flat_dt_prop(dt_root, "compatible", NULL);
-       if (!machine_name)
-               machine_name = "<unknown>";
-       pr_info("Machine: %s\n", machine_name);
-
-       /* Retrieve various information from the /chosen node */
-       of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line);
-       /* Initialize {size,address}-cells info */
-       of_scan_flat_dt(early_init_dt_scan_root, NULL);
-       /* Setup memory, calling early_init_dt_add_memory_arch */
-       of_scan_flat_dt(early_init_dt_scan_memory, NULL);
-}
-
-void __init early_init_dt_add_memory_arch(u64 base, u64 size)
-{
-       base &= PAGE_MASK;
-       size &= PAGE_MASK;
-       if (base + size < PHYS_OFFSET) {
-               pr_warning("Ignoring memory block 0x%llx - 0x%llx\n",
-                          base, base + size);
-               return;
-       }
-       if (base < PHYS_OFFSET) {
-               pr_warning("Ignoring memory range 0x%llx - 0x%llx\n",
-                          base, PHYS_OFFSET);
-               size -= PHYS_OFFSET - base;
-               base = PHYS_OFFSET;
-       }
-       memblock_add(base, size);
+       machine_name = of_flat_dt_get_machine_name();
 }
 
 /*
index de2de5db628de2382e555b4256b9ad1f0f92ada5..0cb8742de4f2383afba4989ae592a914037f9500 100644 (file)
@@ -31,7 +31,6 @@
 #include <linux/sort.h>
 #include <linux/of_fdt.h>
 
-#include <asm/prom.h>
 #include <asm/sections.h>
 #include <asm/setup.h>
 #include <asm/sizes.h>
 
 #include "mm.h"
 
-static unsigned long phys_initrd_start __initdata = 0;
-static unsigned long phys_initrd_size __initdata = 0;
-
 phys_addr_t memstart_addr __read_mostly = 0;
 
-void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
-{
-       phys_initrd_start = start;
-       phys_initrd_size = end - start;
-}
-
+#ifdef CONFIG_BLK_DEV_INITRD
 static int __init early_initrd(char *p)
 {
        unsigned long start, size;
@@ -59,12 +50,13 @@ static int __init early_initrd(char *p)
        if (*endp == ',') {
                size = memparse(endp + 1, NULL);
 
-               phys_initrd_start = start;
-               phys_initrd_size = size;
+               initrd_start = (unsigned long)__va(start);
+               initrd_end = (unsigned long)__va(start + size);
        }
        return 0;
 }
 early_param("initrd", early_initrd);
+#endif
 
 #define MAX_DMA32_PFN ((4UL * 1024 * 1024 * 1024) >> PAGE_SHIFT)
 
@@ -137,13 +129,8 @@ void __init arm64_memblock_init(void)
        /* Register the kernel text, kernel data and initrd with memblock */
        memblock_reserve(__pa(_text), _end - _text);
 #ifdef CONFIG_BLK_DEV_INITRD
-       if (phys_initrd_size) {
-               memblock_reserve(phys_initrd_start, phys_initrd_size);
-
-               /* Now convert initrd to virtual addresses */
-               initrd_start = __phys_to_virt(phys_initrd_start);
-               initrd_end = initrd_start + phys_initrd_size;
-       }
+       if (initrd_start)
+               memblock_reserve(__virt_to_phys(initrd_start), initrd_end - initrd_start);
 #endif
 
        /*
diff --git a/arch/c6x/include/asm/prom.h b/arch/c6x/include/asm/prom.h
deleted file mode 100644 (file)
index b4ec95f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/* dummy prom.h; here to make linux/of.h's #includes happy */
index ecead15872a6b8af3ce97bec1d78e933f31bff0b..696804475f551034c48a81ca1e81b8c9d355d55a 100644 (file)
@@ -14,8 +14,6 @@
 #include <uapi/asm/setup.h>
 
 #ifndef __ASSEMBLY__
-extern char c6x_command_line[COMMAND_LINE_SIZE];
-
 extern int c6x_add_memory(phys_addr_t start, unsigned long size);
 
 extern unsigned long ram_start;
index 9e15ab9199b24fe234780941299757246b92b6cb..fa3e5741514e9ccfa97c97b2d3a646e63be5369d 100644 (file)
  *
  */
 #include <linux/init.h>
-#include <linux/of.h>
-#include <linux/of_fdt.h>
-#include <linux/initrd.h>
 #include <linux/memblock.h>
 
-void __init early_init_devtree(void *params)
-{
-       /* Setup flat device-tree pointer */
-       initial_boot_params = params;
-
-       /* Retrieve various informations from the /chosen node of the
-        * device-tree, including the platform type, initrd location and
-        * size and more ...
-        */
-       of_scan_flat_dt(early_init_dt_scan_chosen, c6x_command_line);
-
-       /* Scan memory nodes and rebuild MEMBLOCKs */
-       of_scan_flat_dt(early_init_dt_scan_root, NULL);
-       of_scan_flat_dt(early_init_dt_scan_memory, NULL);
-}
-
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
-{
-       initrd_start = (unsigned long)__va(start);
-       initrd_end = (unsigned long)__va(end);
-       initrd_below_start_ok = 1;
-}
-#endif
-
 void __init early_init_dt_add_memory_arch(u64 base, u64 size)
 {
        c6x_add_memory(base, size);
index f4e72bd8c10308ba1f6c26460992df11749017a7..731db4b9014dfab53eb50083a9a82dbabc8541ef 100644 (file)
@@ -68,13 +68,6 @@ unsigned long ram_end;
 static unsigned long dma_start __initdata;
 static unsigned long dma_size __initdata;
 
-char c6x_command_line[COMMAND_LINE_SIZE];
-
-#if defined(CONFIG_CMDLINE_BOOL)
-static const char default_command_line[COMMAND_LINE_SIZE] __section(.cmdline) =
-       CONFIG_CMDLINE;
-#endif
-
 struct cpuinfo_c6x {
        const char *cpu_name;
        const char *cpu_voltage;
@@ -294,10 +287,8 @@ notrace void __init machine_init(unsigned long dt_ptr)
                fdt = dtb;
 
        /* Do some early initialization based on the flat device tree */
-       early_init_devtree(fdt);
+       early_init_dt_scan(fdt);
 
-       /* parse_early_param needs a boot_command_line */
-       strlcpy(boot_command_line, c6x_command_line, COMMAND_LINE_SIZE);
        parse_early_param();
 }
 
@@ -309,7 +300,7 @@ void __init setup_arch(char **cmdline_p)
        printk(KERN_INFO "Initializing kernel\n");
 
        /* Initialize command line */
-       *cmdline_p = c6x_command_line;
+       *cmdline_p = boot_command_line;
 
        memory_end = ram_end;
        memory_end &= ~(PAGE_SIZE - 1);
index 279d80725128fa638f300fb3471de57a57c58630..5a6e141d1641bced3bcabc94e66849bd337cbe3d 100644 (file)
@@ -37,12 +37,6 @@ SECTIONS
                _vectors_end = .;
        }
 
-       . = ALIGN(0x1000);
-       .cmdline :
-       {
-               *(.cmdline)
-       }
-
        /*
         * This section contains data which may be shared with other
         * cores. It needs to be a fixed offset from PAGE_OFFSET
index 29d1f1b0001656376d1730020f6f27946ff067ff..0e7c1dbb37b2144f57432481ff7af9da560eb5cb 100644 (file)
@@ -32,9 +32,6 @@
 #include <asm/hexagon_vm.h>
 #include <asm/vm_mmu.h>
 #include <asm/time.h>
-#ifdef CONFIG_OF
-#include <asm/prom.h>
-#endif
 
 char cmd_line[COMMAND_LINE_SIZE];
 static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;
index 12c5664fea6ecf0a7f2638ba202b74f948731cec..433f94624fa25c7a7b913b13f9e5f5f1fd7474f1 100644 (file)
@@ -53,7 +53,7 @@ struct machine_desc {
 /*
  * Current machine - only accessible during boot.
  */
-extern struct machine_desc *machine_desc;
+extern const struct machine_desc *machine_desc;
 
 /*
  * Machine type table - also only accessible during boot
diff --git a/arch/metag/include/asm/prom.h b/arch/metag/include/asm/prom.h
deleted file mode 100644 (file)
index d2aa35d..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- *  arch/metag/include/asm/prom.h
- *
- *  Copyright (C) 2012 Imagination Technologies Ltd.
- *
- *  Based on ARM version:
- *  Copyright (C) 2009 Canonical Ltd. <jeremy.kerr@canonical.com>
- *
- * 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.
- *
- */
-#ifndef __ASM_METAG_PROM_H
-#define __ASM_METAG_PROM_H
-
-#include <asm/setup.h>
-#define HAVE_ARCH_DEVTREE_FIXUPS
-
-extern struct machine_desc *setup_machine_fdt(void *dt);
-extern void copy_fdt(void);
-
-#endif /* __ASM_METAG_PROM_H */
index e13083b15dd04b742ffd5c951cfa621db6d4df6c..e9fdee9452b1f17c90700e8b29db8fdccd543490 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <uapi/asm/setup.h>
 
+extern const struct machine_desc *setup_machine_fdt(void *dt);
 void per_cpu_trap_init(unsigned long);
 extern void __init dump_machine_table(void);
 #endif /* _ASM_METAG_SETUP_H */
index 7cd02529636e955bdc2db86f24d993892b6463ee..18dd7aea9fdc0399a6a84c36a47c102cf9326cda 100644 (file)
@@ -34,6 +34,19 @@ void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
        return alloc_bootmem_align(size, align);
 }
 
+static const void * __init arch_get_next_mach(const char *const **match)
+{
+       static const struct machine_desc *mdesc = __arch_info_begin;
+       const struct machine_desc *m = mdesc;
+
+       if (m >= __arch_info_end)
+               return NULL;
+
+       mdesc++;
+       *match = m->dt_compat;
+       return m;
+}
+
 /**
  * setup_machine_fdt - Machine setup when an dtb was passed to the kernel
  * @dt:                virtual address pointer to dt blob
@@ -41,74 +54,18 @@ void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
  * If a dtb was passed to the kernel, then use it to choose the correct
  * machine_desc and to setup the system.
  */
-struct machine_desc * __init setup_machine_fdt(void *dt)
+const struct machine_desc * __init setup_machine_fdt(void *dt)
 {
-       struct boot_param_header *devtree = dt;
-       struct machine_desc *mdesc, *mdesc_best = NULL;
-       unsigned int score, mdesc_score = ~1;
-       unsigned long dt_root;
-       const char *model;
+       const struct machine_desc *mdesc;
 
        /* check device tree validity */
-       if (be32_to_cpu(devtree->magic) != OF_DT_HEADER)
+       if (!early_init_dt_scan(dt))
                return NULL;
 
-       /* Search the mdescs for the 'best' compatible value match */
-       initial_boot_params = devtree;
-       dt_root = of_get_flat_dt_root();
-
-       for_each_machine_desc(mdesc) {
-               score = of_flat_dt_match(dt_root, mdesc->dt_compat);
-               if (score > 0 && score < mdesc_score) {
-                       mdesc_best = mdesc;
-                       mdesc_score = score;
-               }
-       }
-       if (!mdesc_best) {
-               const char *prop;
-               long size;
-
-               pr_err("\nError: unrecognized/unsupported device tree compatible list:\n[ ");
-
-               prop = of_get_flat_dt_prop(dt_root, "compatible", &size);
-               if (prop) {
-                       while (size > 0) {
-                               printk("'%s' ", prop);
-                               size -= strlen(prop) + 1;
-                               prop += strlen(prop) + 1;
-                       }
-               }
-               printk("]\n\n");
-
+       mdesc = of_flat_dt_match_machine(NULL, arch_get_next_mach);
+       if (!mdesc)
                dump_machine_table(); /* does not return */
-       }
-
-       model = of_get_flat_dt_prop(dt_root, "model", NULL);
-       if (!model)
-               model = of_get_flat_dt_prop(dt_root, "compatible", NULL);
-       if (!model)
-               model = "<unknown>";
-       pr_info("Machine: %s, model: %s\n", mdesc_best->name, model);
-
-       /* Retrieve various information from the /chosen node */
-       of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line);
-
-       return mdesc_best;
-}
+       pr_info("Machine name: %s\n", mdesc->name);
 
-/**
- * copy_fdt - Copy device tree into non-init memory.
- *
- * We must copy the flattened device tree blob into non-init memory because the
- * unflattened device tree will reference the strings in it directly.
- */
-void __init copy_fdt(void)
-{
-       void *alloc = early_init_dt_alloc_memory_arch(
-                       be32_to_cpu(initial_boot_params->totalsize), 0x40);
-       if (alloc) {
-               memcpy(alloc, initial_boot_params,
-                      be32_to_cpu(initial_boot_params->totalsize));
-               initial_boot_params = alloc;
-       }
+       return mdesc;
 }
index c396cd0b425f4ecc6739b2fcb831eda303b574fb..8c4b3976bebfe1c452147b8d58c85daa6689b718 100644 (file)
@@ -42,7 +42,6 @@
 #include <asm/mmu.h>
 #include <asm/mmzone.h>
 #include <asm/processor.h>
-#include <asm/prom.h>
 #include <asm/sections.h>
 #include <asm/setup.h>
 #include <asm/traps.h>
@@ -115,7 +114,7 @@ extern u32 __dtb_start[];
 extern struct console dash_console;
 #endif
 
-struct machine_desc *machine_desc __initdata;
+const struct machine_desc *machine_desc __initdata;
 
 /*
  * Map a Linux CPU number to a hardware thread ID
@@ -408,9 +407,7 @@ void __init setup_arch(char **cmdline_p)
        cpu_2_hwthread_id[smp_processor_id()] = hard_processor_id();
        hwthread_id_2_cpu[hard_processor_id()] = smp_processor_id();
 
-       /* Copy device tree blob into non-init memory before unflattening */
-       copy_fdt();
-       unflatten_device_tree();
+       unflatten_and_copy_device_tree();
 
 #ifdef CONFIG_SMP
        smp_init_cpus();
index 123919534b80fe3724612b61697441305d5b10a6..249fff66add37fb0c939241f8072163145e632a0 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/percpu.h>
 #include <linux/memblock.h>
 #include <linux/initrd.h>
-#include <linux/of_fdt.h>
 
 #include <asm/setup.h>
 #include <asm/page.h>
@@ -405,11 +404,3 @@ void free_initrd_mem(unsigned long start, unsigned long end)
                           "initrd");
 }
 #endif
-
-#ifdef CONFIG_OF_FLATTREE
-void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
-{
-       pr_err("%s(%llx, %llx)\n",
-              __func__, start, end);
-}
-#endif /* CONFIG_OF_FLATTREE */
index 9977816c5ad3bd75aac4780f6c8d3bbdf034b3c8..2f03ac8158511f49beab2074ef88c19c2838eadc 100644 (file)
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  */
-
-#include <linux/of.h>  /* linux/of.h gets to determine #include ordering */
-
 #ifndef _ASM_MICROBLAZE_PROM_H
 #define _ASM_MICROBLAZE_PROM_H
-#ifdef __KERNEL__
-#ifndef __ASSEMBLY__
-
-#include <linux/types.h>
-#include <asm/irq.h>
-#include <linux/atomic.h>
 
-#define HAVE_ARCH_DEVTREE_FIXUPS
+#include <linux/of.h>
 
 /* Other Prototypes */
 enum early_consoles {
@@ -33,32 +24,4 @@ enum early_consoles {
 
 extern int of_early_console(void *version);
 
-/*
- * OF address retreival & translation
- */
-
-#ifdef CONFIG_PCI
-extern unsigned long pci_address_to_pio(phys_addr_t address);
-#define pci_address_to_pio pci_address_to_pio
-#endif /* CONFIG_PCI */
-
-/* Parse the ibm,dma-window property of an OF node into the busno, phys and
- * size parameters.
- */
-void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop,
-               unsigned long *busno, unsigned long *phys, unsigned long *size);
-
-extern void kdump_move_device_tree(void);
-
-#endif /* __ASSEMBLY__ */
-#endif /* __KERNEL__ */
-
-/* These includes are put at the bottom because they may contain things
- * that are overridden by this file.  Ideally they shouldn't be included
- * by this file, but there are a bunch of .c files that currently depend
- * on it.  Eventually they will be cleaned up. */
-#include <linux/of_fdt.h>
-#include <linux/of_irq.h>
-#include <linux/platform_device.h>
-
 #endif /* _ASM_MICROBLAZE_PROM_H */
index 0c4453f134cbb7daf0f615002d8841ccd79957a0..abdfb10e7eca32334d630d45c8cec2cc06f548e9 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/debugfs.h>
 #include <linux/irq.h>
 #include <linux/memblock.h>
+#include <linux/of_fdt.h>
 
 #include <asm/prom.h>
 #include <asm/page.h>
 #include <asm/sections.h>
 #include <asm/pci-bridge.h>
 
-void __init early_init_dt_add_memory_arch(u64 base, u64 size)
-{
-       memblock_add(base, size);
-}
-
 #ifdef CONFIG_EARLY_PRINTK
 static char *stdout;
 
@@ -106,21 +102,10 @@ void __init early_init_devtree(void *params)
 {
        pr_debug(" -> early_init_devtree(%p)\n", params);
 
-       /* Setup flat device-tree pointer */
-       initial_boot_params = params;
-
-       /* Retrieve various informations from the /chosen node of the
-        * device-tree, including the platform type, initrd location and
-        * size, TCE reserve, and more ...
-        */
-       of_scan_flat_dt(early_init_dt_scan_chosen, cmd_line);
-
-       /* Scan memory nodes and rebuild MEMBLOCKs */
-       of_scan_flat_dt(early_init_dt_scan_root, NULL);
-       of_scan_flat_dt(early_init_dt_scan_memory, NULL);
+       early_init_dt_scan(params);
+       if (!strlen(boot_command_line))
+               strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE);
 
-       /* Save command line for /proc/cmdline and then parse parameters */
-       strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE);
        parse_early_param();
 
        memblock_allow_resize();
@@ -130,15 +115,6 @@ void __init early_init_devtree(void *params)
        pr_debug(" <- early_init_devtree()\n");
 }
 
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
-{
-       initrd_start = (unsigned long)__va(start);
-       initrd_end = (unsigned long)__va(end);
-       initrd_below_start_ok = 1;
-}
-#endif
-
 /*******
  *
  * New implementation of the OF "find" APIs, return a refcounted
index 0775e036c526532918be2d22babe6fa5df91e416..8de8ebc309f15b0ca080cdf6f7c93e54fd168d74 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/initrd.h>
 #include <linux/console.h>
 #include <linux/debugfs.h>
+#include <linux/of_fdt.h>
 
 #include <asm/setup.h>
 #include <asm/sections.h>
@@ -50,7 +51,7 @@ char cmd_line[COMMAND_LINE_SIZE] __attribute__ ((section(".data")));
 
 void __init setup_arch(char **cmdline_p)
 {
-       *cmdline_p = cmd_line;
+       *cmdline_p = boot_command_line;
 
        console_verbose();
 
index e4b3f33ef34cd348366e515aa02ea9efbd3d4a16..827df4d003c8ac00fc9bce10c294d776eb32df8b 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/clk.h>
 #include <linux/clockchips.h>
 #include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <asm/cpuinfo.h>
 #include <linux/cnt32_to_63.h>
 
index 1b93bf0892a0d5550418bed47f99f1dfa07e4305..7c8a35238f740bf2b61952cd067902a99584c7d5 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/slab.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_pci.h>
 #include <linux/export.h>
 
index 1e7e0961064bdcdbeba50f3fdce48b1c7cc9029d..ccd2b75f152cce2b1715d60df51af7b83020c1d1 100644 (file)
 #include <linux/types.h>
 #include <asm/bootinfo.h>
 
-extern int early_init_dt_scan_memory_arch(unsigned long node,
-       const char *uname, int depth, void *data);
-
 extern void device_tree_init(void);
 
-static inline unsigned long pci_address_to_pio(phys_addr_t address)
-{
-       /*
-        * The ioport address can be directly used by inX() / outX()
-        */
-       BUG_ON(address > IO_SPACE_LIMIT);
-
-       return (unsigned long) address;
-}
-#define pci_address_to_pio pci_address_to_pio
-
 struct boot_param_header;
 
 extern void __dt_setup_arch(struct boot_param_header *bph);
index 0fa0b69cdd53bcc7e7d7d0bf836d3e40c767b4a4..3c3b0df8f48d8916c184ffdb6d4c01e0a48aa666 100644 (file)
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/bootmem.h>
-#include <linux/initrd.h>
 #include <linux/debugfs.h>
 #include <linux/of.h>
 #include <linux/of_fdt.h>
-#include <linux/of_irq.h>
-#include <linux/of_platform.h>
 
 #include <asm/page.h>
 #include <asm/prom.h>
@@ -40,13 +37,6 @@ char *mips_get_machine_name(void)
 }
 
 #ifdef CONFIG_OF
-int __init early_init_dt_scan_memory_arch(unsigned long node,
-                                         const char *uname, int depth,
-                                         void *data)
-{
-       return early_init_dt_scan_memory(node, uname, depth, data);
-}
-
 void __init early_init_dt_add_memory_arch(u64 base, u64 size)
 {
        return add_memory_region(base, size, BOOT_MEM_RAM);
@@ -57,57 +47,11 @@ void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
        return __alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS));
 }
 
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
-{
-       initrd_start = (unsigned long)__va(start);
-       initrd_end = (unsigned long)__va(end);
-       initrd_below_start_ok = 1;
-}
-#endif
-
-int __init early_init_dt_scan_model(unsigned long node,        const char *uname,
-                                   int depth, void *data)
-{
-       if (!depth) {
-               char *model = of_get_flat_dt_prop(node, "model", NULL);
-
-               if (model)
-                       mips_set_machine_name(model);
-       }
-       return 0;
-}
-
-void __init early_init_devtree(void *params)
-{
-       /* Setup flat device-tree pointer */
-       initial_boot_params = params;
-
-       /* Retrieve various informations from the /chosen node of the
-        * device-tree, including the platform type, initrd location and
-        * size, and more ...
-        */
-       of_scan_flat_dt(early_init_dt_scan_chosen, arcs_cmdline);
-
-
-       /* Scan memory nodes */
-       of_scan_flat_dt(early_init_dt_scan_root, NULL);
-       of_scan_flat_dt(early_init_dt_scan_memory_arch, NULL);
-
-       /* try to load the mips machine name */
-       of_scan_flat_dt(early_init_dt_scan_model, NULL);
-}
-
 void __init __dt_setup_arch(struct boot_param_header *bph)
 {
-       if (be32_to_cpu(bph->magic) != OF_DT_HEADER) {
-               pr_err("DTB has bad magic, ignoring builtin OF DTB\n");
-
+       if (!early_init_dt_scan(bph))
                return;
-       }
-
-       initial_boot_params = bph;
 
-       early_init_devtree(initial_boot_params);
+       mips_set_machine_name(of_flat_dt_get_machine_name());
 }
 #endif
index 49c460370285900cf7abe9b788b5e346049b9753..19686c5bc5ed03686ef2a2791b7e360fdd68484d 100644 (file)
@@ -14,6 +14,7 @@
 
 #include <asm/bootinfo.h>
 #include <asm/time.h>
+#include <asm/prom.h>
 
 #include <lantiq.h>
 
index b5059dc899f44d2616a4c72c873fe82819474c09..928ba84c8a78590ff9839cf8be195532deb8f237 100644 (file)
@@ -10,6 +10,8 @@
 #include <linux/of_fdt.h>
 #include <linux/bootmem.h>
 
+#include <asm/prom.h>
+
 #include <asm/mips-boards/generic.h>
 
 const char *get_system_type(void)
index 15f21ea96121023b60d005045a3115bac48c5622..eccc5526155e1b776acc87b35563d89ef72d5ea5 100644 (file)
@@ -21,6 +21,7 @@
 #include <asm/reboot.h>
 #include <asm/bootinfo.h>
 #include <asm/addrspace.h>
+#include <asm/prom.h>
 
 #include "common.h"
 
diff --git a/arch/openrisc/include/asm/prom.h b/arch/openrisc/include/asm/prom.h
deleted file mode 100644 (file)
index 93c9980..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * OpenRISC Linux
- *
- * Linux architectural port borrowing liberally from similar works of
- * others.  All original copyrights apply as per the original source
- * declaration.
- *
- * OpenRISC implementation:
- * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
- * et al.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-#ifndef _ASM_OPENRISC_PROM_H
-#define _ASM_OPENRISC_PROM_H
-
-#define HAVE_ARCH_DEVTREE_FIXUPS
-
-#endif /* _ASM_OPENRISC_PROM_H */
index a63e76872f84da088c8d28105f55d3687807f2f5..6a44340d1b18f092168d1c12a66017b13fe03576 100644 (file)
  *
  */
 
-#include <stdarg.h>
-#include <linux/kernel.h>
-#include <linux/string.h>
 #include <linux/init.h>
-#include <linux/threads.h>
-#include <linux/spinlock.h>
 #include <linux/types.h>
-#include <linux/pci.h>
-#include <linux/stringify.h>
-#include <linux/delay.h>
-#include <linux/initrd.h>
-#include <linux/bitops.h>
-#include <linux/module.h>
-#include <linux/kexec.h>
-#include <linux/debugfs.h>
-#include <linux/irq.h>
 #include <linux/memblock.h>
 #include <linux/of_fdt.h>
 
-#include <asm/prom.h>
 #include <asm/page.h>
-#include <asm/processor.h>
-#include <asm/irq.h>
-#include <linux/io.h>
-#include <asm/mmu.h>
-#include <asm/pgtable.h>
-#include <asm/sections.h>
-#include <asm/setup.h>
-
-extern char cmd_line[COMMAND_LINE_SIZE];
-
-void __init early_init_dt_add_memory_arch(u64 base, u64 size)
-{
-       size &= PAGE_MASK;
-       memblock_add(base, size);
-}
 
 void __init early_init_devtree(void *params)
 {
-       void *alloc;
-
-       /* Setup flat device-tree pointer */
-       initial_boot_params = params;
-
-
-       /* Retrieve various informations from the /chosen node of the
-        * device-tree, including the platform type, initrd location and
-        * size, TCE reserve, and more ...
-        */
-       of_scan_flat_dt(early_init_dt_scan_chosen, cmd_line);
-
-       /* Scan memory nodes and rebuild MEMBLOCKs */
-       of_scan_flat_dt(early_init_dt_scan_root, NULL);
-       of_scan_flat_dt(early_init_dt_scan_memory, NULL);
-
-       /* Save command line for /proc/cmdline and then parse parameters */
-       strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE);
-
+       early_init_dt_scan(params);
        memblock_allow_resize();
-
-       /* We must copy the flattend device tree from init memory to regular
-        * memory because the device tree references the strings in it
-        * directly.
-        */
-
-       alloc = __va(memblock_alloc(initial_boot_params->totalsize, PAGE_SIZE));
-
-       memcpy(alloc, initial_boot_params, initial_boot_params->totalsize);
-
-       initial_boot_params = alloc;
-}
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
-{
-       initrd_start = (unsigned long)__va(start);
-       initrd_end = (unsigned long)__va(end);
-       initrd_below_start_ok = 1;
 }
-#endif
index d7359ffbcbdd325b32bebd1aed3aea02bdd5d8ef..09a769b695720909a52b409f9a49fe40b99f4fa0 100644 (file)
@@ -50,8 +50,6 @@
 
 #include "vmlinux.h"
 
-char __initdata cmd_line[COMMAND_LINE_SIZE] = CONFIG_CMDLINE;
-
 static unsigned long __init setup_memory(void)
 {
        unsigned long bootmap_size;
@@ -285,7 +283,7 @@ void __init setup_arch(char **cmdline_p)
 {
        unsigned long max_low_pfn;
 
-       unflatten_device_tree();
+       unflatten_and_copy_device_tree();
 
        setup_cpuinfo();
 
@@ -316,7 +314,7 @@ void __init setup_arch(char **cmdline_p)
                conswitchp = &dummy_con;
 #endif
 
-       *cmdline_p = cmd_line;
+       *cmdline_p = boot_command_line;
 
        printk(KERN_INFO "OpenRISC Linux -- http://openrisc.net\n");
 }
index 7d0c7f3a7171e98ce262ed4054c38af101032043..7687f82a3217e55f2ed6fcc8a11ef7ee90366ded 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/of.h>  /* linux/of.h gets to determine #include ordering */
 #ifndef _POWERPC_PROM_H
 #define _POWERPC_PROM_H
 #ifdef __KERNEL__
 #include <asm/irq.h>
 #include <linux/atomic.h>
 
-#define HAVE_ARCH_DEVTREE_FIXUPS
+/* These includes should be removed once implicit includes are cleaned up. */
+#include <linux/of.h>
+#include <linux/of_fdt.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
+#include <linux/platform_device.h>
 
 /*
  * OF address retreival & translation
  */
 
-/* Translate a DMA address from device space to CPU space */
-extern u64 of_translate_dma_address(struct device_node *dev,
-                                   const __be32 *in_addr);
-
-#ifdef CONFIG_PCI
-extern unsigned long pci_address_to_pio(phys_addr_t address);
-#define pci_address_to_pio pci_address_to_pio
-#endif /* CONFIG_PCI */
-
 /* Parse the ibm,dma-window property of an OF node into the busno, phys and
  * size parameters.
  */
@@ -47,13 +42,6 @@ extern void kdump_move_device_tree(void);
 /* cache lookup */
 struct device_node *of_find_next_cache_node(struct device_node *np);
 
-#ifdef CONFIG_NUMA
-extern int of_node_to_nid(struct device_node *device);
-#else
-static inline int of_node_to_nid(struct device_node *device) { return 0; }
-#endif
-#define of_node_to_nid of_node_to_nid
-
 extern void of_instantiate_rtc(void);
 
 extern int of_get_ibm_chip_id(struct device_node *np);
@@ -143,14 +131,5 @@ struct of_drconf_cell {
  */
 extern unsigned char ibm_architecture_vec[];
 
-/* These includes are put at the bottom because they may contain things
- * that are overridden by this file.  Ideally they shouldn't be included
- * by this file, but there are a bunch of .c files that currently depend
- * on it.  Eventually they will be cleaned up. */
-#include <linux/of_fdt.h>
-#include <linux/of_address.h>
-#include <linux/of_irq.h>
-#include <linux/platform_device.h>
-
 #endif /* __KERNEL__ */
 #endif /* _POWERPC_PROM_H */
index 6300c13bbde46da37cf9637f95711e1a544c94ba..7898be90f2dcd013ecec5d17dcb4897e9a1b62f7 100644 (file)
@@ -18,6 +18,7 @@
  */
 
 #include <linux/of.h>
+#include <linux/of_fdt.h>
 #include <asm/epapr_hcalls.h>
 #include <asm/cacheflush.h>
 #include <asm/code-patching.h>
index b7634ce41dbc92bd67cd5ed1c6c7cd584924ccc4..a0894688daefcf123b28b3d568ec0f90d95ca1c9 100644 (file)
@@ -546,15 +546,6 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)
        memblock_add(base, size);
 }
 
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
-{
-       initrd_start = (unsigned long)__va(start);
-       initrd_end = (unsigned long)__va(end);
-       initrd_below_start_ok = 1;
-}
-#endif
-
 static void __init early_reserve_mem_dt(void)
 {
        unsigned long i, len, dt_root;
index e504166e089aa3790c9be9e20313476b127985ff..fd8a3765341773a12ecb0e6d058c8f6fc1098f6e 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/mutex.h>
 #include <linux/io.h>
 
+#include <linux/of_address.h>
 #include <linux/of_platform.h>
 #include <asm/mpc5xxx.h>
 #include <asm/mpc5121.h>
index 24b314d7bd5f127d8c36da9ada186d69e3e0440c..116f2325b20b54e62c1ebe9517df24e546bb65d9 100644 (file)
@@ -14,6 +14,8 @@
 
 #include <linux/kernel.h>
 #include <linux/io.h>
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
 #include <linux/of_platform.h>
 
 #include <asm/machdep.h>
index 30394b409b3f98655074d4f55e9514912b3506a5..6a14cf50f4a27ec21409018f435c48361979321d 100644 (file)
@@ -16,6 +16,8 @@
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/fsl_devices.h>
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
 #include <linux/of_platform.h>
 #include <linux/io.h>
 
index e1dceeec49944aba3e07ecb967abe37e07c822bf..e5f82ec8df17b54d8b8bac693074c741207a649e 100644 (file)
@@ -15,6 +15,8 @@
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/fsl_devices.h>
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
 #include <linux/of_platform.h>
 
 #include <asm/io.h>
index 1d769a29249f846a444bee68819730b5d12496ea..3d9716ccd3274b2fa162e2137ced47883c9a27cd 100644 (file)
@@ -20,6 +20,8 @@
 #include <linux/freezer.h>
 #include <linux/suspend.h>
 #include <linux/fsl_devices.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/export.h>
 
index 6208e49142bfe8c1f5a87f196f07771c20bb235a..213d5b8158270058cc41ed6513a8d55d7028baf0 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <linux/stddef.h>
 #include <linux/kernel.h>
+#include <linux/of_fdt.h>
 #include <linux/of_platform.h>
 
 #include <asm/machdep.h>
index d0861a0d836067ff9c3897eb9e1101917ba78e06..eba78c85303f9f6ee27eb8d1d0c2f4221e056d65 100644 (file)
@@ -5,6 +5,8 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 
 #include <sysdev/cpm2_pic.h>
index 3bbbf74894872b140a1aef210315c4da10a4da48..55a9682b9529168a56e949779646ef8208693c89 100644 (file)
@@ -9,6 +9,8 @@
  */
 
 #include <linux/irq.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/io.h>
 
index 9982f57c98b98a0037777a8233247366f2a713bb..d5b98c0f958aed8c65a112b53f91effc329d5125 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 
 #include <asm/mpic.h>
index 7d9ac6040d631f7f4bc19edb37056999249e3c40..e62166681d0811113680965696944c8c23514db3 100644 (file)
@@ -10,6 +10,8 @@
  */
 
 #include <linux/init.h>
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
 #include <linux/of_platform.h>
 
 #include <asm/machdep.h>
index 866feff83c910aab87526bd661bd2fc08a4ac77f..63084640c5c5af872aba11a94979324cec02ccd6 100644 (file)
@@ -15,6 +15,8 @@
  */
 
 #include <linux/init.h>
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
 #include <linux/of_platform.h>
 
 #include <asm/io.h>
index 5d98398c2f5e4424cf8698f7f7498b0babaffd0c..c1262581b63c517ac836bce3d7ada126f0580c04 100644 (file)
@@ -25,6 +25,8 @@
 #include <linux/fs_uart_pd.h>
 #include <linux/fsl_devices.h>
 #include <linux/mii.h>
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
 #include <linux/of_platform.h>
 
 #include <asm/delay.h>
index ef0778a0ca8f996ef0b8d6c86a032c6eb05899f7..251aba8759e40bf11075add0ef43c232942763c8 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/fs_uart_pd.h>
 #include <linux/fsl_devices.h>
 #include <linux/mii.h>
+#include <linux/of_fdt.h>
 #include <linux/of_platform.h>
 
 #include <asm/delay.h>
index 53d6eee019639e965bb7306bc0ab75d7a7647f84..4cde8e7da4b8e0f9ec8afdd9fd1d0d0eb8f8090a 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
 #include <asm/io.h>
 
 #include "flipper-pic.h"
index 3006b5117ec6cab1c7737ae12c5aa8a59f5a8fd3..7cab21ded9d0ef84364cdd44492b11a1b8923180 100644 (file)
@@ -18,6 +18,8 @@
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <asm/io.h>
 
 #include "hlwd-pic.h"
index 0237ab782fb8ba45c3791e8df598f4b9147f1c3e..15adee544638b6c11fcea4f0a8c7d813403496c5 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/ioport.h>
 #include <linux/interrupt.h>
 #include <linux/phy.h>
+#include <linux/of_address.h>
 #include <linux/of_mdio.h>
 #include <linux/of_platform.h>
 
index f5e3cda6660e0751656018377a31cc47f8c33ec4..e49d07f3d54222a0f8ea37073bc7ea777285e374 100644 (file)
@@ -4,6 +4,7 @@
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
 #include <linux/spinlock.h>
+#include <linux/of_irq.h>
 
 #include <asm/pmac_feature.h>
 #include <asm/pmac_pfunc.h>
index a7614bb14e17b8f4e7772570c60da9e64b3ad37d..e7e59e4f9892deb85b8ff96b502a6c14fe989d19 100644 (file)
@@ -17,6 +17,7 @@
 #include <asm/firmware.h>
 #include <asm/xics.h>
 #include <asm/opal.h>
+#include <asm/prom.h>
 
 static int opal_lpc_chip_id = -1;
 
index 09336f0c54c56e12954b454f6d562aac64508c50..329924f76a7161be23d521459178f826636d6115 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <linux/types.h>
 #include <linux/of.h>
+#include <linux/of_fdt.h>
 #include <linux/of_platform.h>
 #include <linux/interrupt.h>
 #include <linux/notifier.h>
index e239dcfa224c2727bd6411aada2eb65120ad4a8a..19884b2a51b4743f78a9389f22e8588e228616d7 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/irq.h>
 #include <linux/seq_file.h>
 #include <linux/of.h>
+#include <linux/of_fdt.h>
 #include <linux/interrupt.h>
 #include <linux/bug.h>
 
index 9a432de363b8d081d0663f8795f28ff7354ce378..9590dbb756f2e1cafc6eb02f216b075f5db6087f 100644 (file)
  */
 
 #include <linux/of.h>
+#include <linux/of_address.h>
 #include <linux/memblock.h>
 #include <linux/vmalloc.h>
 #include <linux/memory.h>
 
 #include <asm/firmware.h>
 #include <asm/machdep.h>
+#include <asm/prom.h>
 #include <asm/sparsemem.h>
 
 static unsigned long get_memblock_size(void)
index 4dd534194ae8b889290ae9b62403aa05f41438c6..4f786957129040bc541bc8d9a8cfd8122e949e38 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/spinlock.h>
 #include <linux/export.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
 #include <linux/slab.h>
 
 #include <asm/udbg.h>
index 0eb871cc3437f9250372422f727f112a18f6b002..1b980eed235ae6dd32fa36d0dc85031d3f21a7fc 100644 (file)
@@ -19,6 +19,8 @@
 #include <linux/list.h>
 #include <linux/io.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/spinlock.h>
 #include <linux/bitops.h>
 #include <linux/slab.h>
index 592a0f8d527a10fdfb61aa9c407b94f4b0aa8168..8cf4aa0e3a2561a0bfffa0abd4a297b1a3c6d74e 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/suspend.h>
 #include <linux/delay.h>
 #include <linux/device.h>
+#include <linux/of_address.h>
 #include <linux/of_platform.h>
 
 struct pmc_regs {
index e2fb3171f41b80545a99043b5a222b84adb799ba..95dd892e99047dc3bb8b8967e54c380a783c781c 100644 (file)
@@ -28,6 +28,8 @@
 #include <linux/dma-mapping.h>
 #include <linux/interrupt.h>
 #include <linux/device.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/delay.h>
 #include <linux/slab.h>
index 14bd5221f28ad944c5faf01ecba83615a1e1a884..00e224a1048c9ed0a690ad694bdd0c8a84318eed 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/types.h>
 #include <linux/dma-mapping.h>
 #include <linux/interrupt.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/slab.h>
 
index bdcb8588e4926c42130935a0ef33d2d19cab4b99..0e166ed4cd16b7452f2656501de27c4f085e02da 100644 (file)
@@ -535,7 +535,7 @@ static void __init mpic_scan_ht_pic(struct mpic *mpic, u8 __iomem *devbase,
                mpic->fixups[irq].data = readl(base + 4) | 0x80000000;
        }
 }
+
 
 static void __init mpic_scan_ht_pics(struct mpic *mpic)
 {
@@ -1481,7 +1481,7 @@ struct mpic * __init mpic_alloc(struct device_node *node,
         * as a default instead of the value read from the HW.
         */
        last_irq = (greg_feature & MPIC_GREG_FEATURE_LAST_SRC_MASK)
-                               >> MPIC_GREG_FEATURE_LAST_SRC_SHIFT;    
+                               >> MPIC_GREG_FEATURE_LAST_SRC_SHIFT;
        if (isu_size)
                last_irq = isu_size  * MPIC_MAX_ISU - 1;
        of_property_read_u32(mpic->node, "last-interrupt-source", &last_irq);
@@ -1631,7 +1631,7 @@ void __init mpic_init(struct mpic *mpic)
                        /* start with vector = source number, and masked */
                        u32 vecpri = MPIC_VECPRI_MASK | i |
                                (8 << MPIC_VECPRI_PRIORITY_SHIFT);
-               
+
                        /* check if protected */
                        if (mpic->protected && test_bit(i, mpic->protected))
                                continue;
@@ -1640,7 +1640,7 @@ void __init mpic_init(struct mpic *mpic)
                        mpic_irq_write(i, MPIC_INFO(IRQ_DESTINATION), 1 << cpu);
                }
        }
-       
+
        /* Init spurious vector */
        mpic_write(mpic->gregs, MPIC_INFO(GREG_SPURIOUS), mpic->spurious_vec);
 
index c06db92a4fb1d224f274b0abf335b70ae9a59c07..22d7d57eead9d88fca57629de658a5629fd2d6bf 100644 (file)
@@ -19,7 +19,9 @@
 #include <linux/interrupt.h>
 #include <linux/slab.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
 #include <linux/of_device.h>
+#include <linux/of_irq.h>
 #include <linux/syscore_ops.h>
 #include <sysdev/fsl_soc.h>
 #include <asm/io.h>
index c9e803f3e267a1fba41f6f5d2285440ed758c0d7..6f54b54b13283f71af521f3bbda1c1a764781f4c 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/kernel.h>
 #include <linux/of.h>
 #include <linux/init.h>
+#include <linux/of_address.h>
 #include <linux/of_platform.h>
 #include <linux/slab.h>
 
index 0debcc31ad7005084cb952025ff6fe6d9960f528..5c77c9ba33aa1dc62fa1fbfd86d34f3bf7635728 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/errno.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 
 #include <asm/dcr.h>
index 8d73c3c0bee6a9062776e2820c8758eb96737a54..f4fdc94ad2c0a70953af6644c9920de5d204eb86 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/kernel.h>
 #include <linux/irq.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
 #include <asm/io.h>
 #include <asm/processor.h>
 #include <asm/i8259.h>
index 67c62578d17043bbff42e1880f1f7e8986cb971c..11ebd659e7b6ec2c6fee06e4327fa2caf49db537 100644 (file)
@@ -43,10 +43,6 @@ extern int of_getintprop_default(struct device_node *np,
                                 const char *name,
                                 int def);
 extern int of_find_in_proplist(const char *list, const char *match, int len);
-#ifdef CONFIG_NUMA
-extern int of_node_to_nid(struct device_node *dp);
-#define of_node_to_nid of_node_to_nid
-#endif
 
 extern void prom_build_devicetree(void);
 extern void of_populate_present_mask(void);
@@ -63,13 +59,5 @@ extern char *of_console_options;
 extern void irq_trans_init(struct device_node *dp);
 extern char *build_path_component(struct device_node *dp);
 
-/* SPARC has local implementations */
-extern int of_address_to_resource(struct device_node *dev, int index,
-                                 struct resource *r);
-#define of_address_to_resource of_address_to_resource
-
-void __iomem *of_iomap(struct device_node *node, int index);
-#define of_iomap of_iomap
-
 #endif /* __KERNEL__ */
 #endif /* _SPARC_PROM_H */
index bade6ac3b14fc881ee038f85a9fa3233c48f60b6..fbeb06ed0eaa7b1729e396fd6e45cd81782fb468 100644 (file)
@@ -39,10 +39,5 @@ static inline void x86_dtb_init(void) { }
 
 extern char cmd_line[COMMAND_LINE_SIZE];
 
-#define pci_address_to_pio pci_address_to_pio
-unsigned long pci_address_to_pio(phys_addr_t addr);
-
-#define HAVE_ARCH_DEVTREE_FIXUPS
-
 #endif /* __ASSEMBLY__ */
 #endif
index 376dc7873447c80e27b8b765e6ff41a8f737da8a..cffd0736854722d7da3ed179824d77181f64f47a 100644 (file)
 #include <asm/hpet.h>
 #include <asm/apic.h>
 #include <asm/pci_x86.h>
+#include <asm/setup.h>
 
 __initdata u64 initial_dtb;
 char __initdata cmd_line[COMMAND_LINE_SIZE];
 
 int __initdata of_ioapic;
 
-unsigned long pci_address_to_pio(phys_addr_t address)
-{
-       /*
-        * The ioport address can be directly used by inX / outX
-        */
-       BUG_ON(address >= (1 << 16));
-       return (unsigned long)address;
-}
-EXPORT_SYMBOL_GPL(pci_address_to_pio);
-
 void __init early_init_dt_scan_chosen_arch(unsigned long node)
 {
        BUG();
@@ -51,15 +42,6 @@ void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
        return __alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS));
 }
 
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
-{
-       initrd_start = (unsigned long)__va(start);
-       initrd_end = (unsigned long)__va(end);
-       initrd_below_start_ok = 1;
-}
-#endif
-
 void __init add_dtb(u64 data)
 {
        initial_dtb = data + offsetof(struct setup_data, data);
@@ -230,7 +212,7 @@ static void __init dtb_apic_setup(void)
 static void __init x86_flattree_get_config(void)
 {
        u32 size, map_len;
-       void *new_dtb;
+       struct boot_param_header *dt;
 
        if (!initial_dtb)
                return;
@@ -238,24 +220,17 @@ static void __init x86_flattree_get_config(void)
        map_len = max(PAGE_SIZE - (initial_dtb & ~PAGE_MASK),
                        (u64)sizeof(struct boot_param_header));
 
-       initial_boot_params = early_memremap(initial_dtb, map_len);
-       size = be32_to_cpu(initial_boot_params->totalsize);
+       dt = early_memremap(initial_dtb, map_len);
+       size = be32_to_cpu(dt->totalsize);
        if (map_len < size) {
-               early_iounmap(initial_boot_params, map_len);
-               initial_boot_params = early_memremap(initial_dtb, size);
+               early_iounmap(dt, map_len);
+               dt = early_memremap(initial_dtb, size);
                map_len = size;
        }
 
-       new_dtb = alloc_bootmem(size);
-       memcpy(new_dtb, initial_boot_params, size);
-       early_iounmap(initial_boot_params, map_len);
-
-       initial_boot_params = new_dtb;
-
-       /* root level address cells */
-       of_scan_flat_dt(early_init_dt_scan_root, NULL);
-
-       unflatten_device_tree();
+       initial_boot_params = dt;
+       unflatten_and_copy_device_tree();
+       early_iounmap(dt, map_len);
 }
 #else
 static inline void x86_flattree_get_config(void) { }
diff --git a/arch/xtensa/include/asm/prom.h b/arch/xtensa/include/asm/prom.h
deleted file mode 100644 (file)
index f3d7cd2..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _XTENSA_ASM_PROM_H
-#define _XTENSA_ASM_PROM_H
-
-#define HAVE_ARCH_DEVTREE_FIXUPS
-
-#endif /* _XTENSA_ASM_PROM_H */
index 946fb8d06c8b48479b021a0f2da7be06961a2d71..6e2b6638122de71374c99ac0be7df584b0cf7fd9 100644 (file)
 #include <linux/screen_info.h>
 #include <linux/bootmem.h>
 #include <linux/kernel.h>
-
-#ifdef CONFIG_OF
 #include <linux/of_fdt.h>
 #include <linux/of_platform.h>
-#endif
 
 #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE)
 # include <linux/console.h>
@@ -64,8 +61,8 @@ extern struct rtc_ops no_rtc_ops;
 struct rtc_ops *rtc_ops;
 
 #ifdef CONFIG_BLK_DEV_INITRD
-extern void *initrd_start;
-extern void *initrd_end;
+extern unsigned long initrd_start;
+extern unsigned long initrd_end;
 int initrd_is_mapped = 0;
 extern int initrd_below_start_ok;
 #endif
@@ -152,8 +149,8 @@ static int __init parse_tag_initrd(const bp_tag_t* tag)
 {
        meminfo_t* mi;
        mi = (meminfo_t*)(tag->data);
-       initrd_start = __va(mi->start);
-       initrd_end = __va(mi->end);
+       initrd_start = (unsigned long)__va(mi->start);
+       initrd_end = (unsigned long)__va(mi->end);
 
        return 0;
 }
@@ -170,13 +167,6 @@ static int __init parse_tag_fdt(const bp_tag_t *tag)
 
 __tagtable(BP_TAG_FDT, parse_tag_fdt);
 
-void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
-{
-       initrd_start = (void *)__va(start);
-       initrd_end = (void *)__va(end);
-       initrd_below_start_ok = 1;
-}
-
 #endif /* CONFIG_OF */
 
 #endif /* CONFIG_BLK_DEV_INITRD */
@@ -222,9 +212,13 @@ static int __init parse_bootparam(const bp_tag_t* tag)
 }
 
 #ifdef CONFIG_OF
+bool __initdata dt_memory_scan = false;
 
 void __init early_init_dt_add_memory_arch(u64 base, u64 size)
 {
+       if (!dt_memory_scan)
+               return;
+
        size &= PAGE_MASK;
        add_sysmem_bank(MEMORY_TYPE_CONVENTIONAL, base, base + size);
 }
@@ -236,31 +230,13 @@ void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
 
 void __init early_init_devtree(void *params)
 {
-       /* Setup flat device-tree pointer */
-       initial_boot_params = params;
-
-       /* Retrieve various informations from the /chosen node of the
-        * device-tree, including the platform type, initrd location and
-        * size, TCE reserve, and more ...
-        */
-       if (!command_line[0])
-               of_scan_flat_dt(early_init_dt_scan_chosen, command_line);
-
-       /* Scan memory nodes and rebuild MEMBLOCKs */
-       of_scan_flat_dt(early_init_dt_scan_root, NULL);
        if (sysmem.nr_banks == 0)
-               of_scan_flat_dt(early_init_dt_scan_memory, NULL);
-}
+               dt_memory_scan = true;
 
-static void __init copy_devtree(void)
-{
-       void *alloc = early_init_dt_alloc_memory_arch(
-                       be32_to_cpu(initial_boot_params->totalsize), 8);
-       if (alloc) {
-               memcpy(alloc, initial_boot_params,
-                               be32_to_cpu(initial_boot_params->totalsize));
-               initial_boot_params = alloc;
-       }
+       early_init_dt_scan(params);
+
+       if (!command_line[0])
+               strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
 }
 
 static int __init xtensa_device_probe(void)
@@ -525,10 +501,7 @@ void __init setup_arch(char **cmdline_p)
 
        bootmem_init();
 
-#ifdef CONFIG_OF
-       copy_devtree();
-       unflatten_device_tree();
-#endif
+       unflatten_and_copy_device_tree();
 
        platform_setup(cmdline_p);
 
index 851bd3f43ac63fc0f3631193f58aa3d94c0af39a..fb0b40a191c217e47202d252aff5a36d21cf6f6b 100644 (file)
@@ -24,6 +24,8 @@
 #include <scsi/scsi_cmnd.h>
 #include <linux/libata.h>
 #include <asm/io.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 
 static unsigned int intr_coalescing_count;
index 0671e45daa577c21efb817f843ece5b195c0e04c..8fedbc250414164ca0027af5afd5db2ab02b02ac 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <linux/kernel.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
 #include <linux/of_device.h>
 #include <linux/of_platform.h>
 #include <linux/fs.h>
index c6df5b29af08f7f7ba99f6439b0d5d6f120379c7..c66279bb6ef372823afea9a6d36be798c3cb744c 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/platform_device.h>
 #include <linux/hw_random.h>
 #include <linux/delay.h>
+#include <linux/of_address.h>
 #include <linux/of_platform.h>
 #include <asm/io.h>
 
index 1cca332728c3c36e2a40a5bc248f1cb39651c741..b05837730c3c82f399068e9675111817016e1637 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/cpufreq.h>
 #include <linux/timer.h>
 #include <linux/module.h>
+#include <linux/of_address.h>
 
 #include <asm/hw_irq.h>
 #include <asm/io.h>
index 26438cd126859e75638c893ad6e959c3baf9e9ef..5e7c7614c8fc1781301caa111a6d53dfd80159fd 100644 (file)
@@ -5,6 +5,9 @@
  * Copyright 2008-2012 Freescale Semiconductor, Inc.
  */
 
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
+
 #include "compat.h"
 #include "regs.h"
 #include "intern.h"
index 105ba4da618059b63a71a36747008e362a04233f..94b80a9376470120fe67643bd5ad4d05afe15e59 100644 (file)
@@ -5,6 +5,8 @@
  * Copyright 2008-2012 Freescale Semiconductor, Inc.
  */
 
+#include <linux/of_irq.h>
+
 #include "compat.h"
 #include "regs.h"
 #include "jr.h"
index f6f7c681073e8b9132afa81c70a7af58cf3f8360..905de4427e7c4d1630604db45ffa2ba158983918 100644 (file)
@@ -32,6 +32,8 @@
 #include <linux/interrupt.h>
 #include <linux/crypto.h>
 #include <linux/hw_random.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/dma-mapping.h>
 #include <linux/io.h>
index 5e2ed30ba2c447420291ea0d422c1ac809c97a23..2074e0e3fa21f8a23dd2179394d2b677c17a9934 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/string.h>
 #include <linux/ioport.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
 
 #include <asm/io.h>
 #include <asm/mmu.h>
index b3f3e90054f2ab956e8019dd8abe539b85fa0301..61517dd0d0b73b7077be4acc5cf075792a00d86e 100644 (file)
@@ -33,6 +33,8 @@
 #include <linux/delay.h>
 #include <linux/dma-mapping.h>
 #include <linux/dmapool.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 
 #include "dmaengine.h"
index 2fe4353773338234375df48855ec7c941798bb31..448750da4402fb4b68f7c9ebd540553a21cab55e 100644 (file)
@@ -39,7 +39,9 @@
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/slab.h>
+#include <linux/of_address.h>
 #include <linux/of_device.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 
 #include <linux/random.h>
index c2eaf334b90b0f4c2cff3cc4039c1c85577fbcaf..9ee1c76da7b9110cd7e9842ba571a18b371df37e 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/platform_device.h>
 #include <linux/stop_machine.h>
 #include <linux/io.h>
+#include <linux/of_address.h>
 #include <asm/machdep.h>
 #include <asm/cell-regs.h>
 
index a0b33a216d4a788f4983b71d700350b3fff76d51..de9630b08b99d9c87ba3b3cedd7d03110cd41983 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/io.h>
 #include <linux/of.h>
 #include <linux/of_gpio.h>
+#include <linux/of_irq.h>
 #include <linux/gpio.h>
 #include <linux/slab.h>
 #include <linux/irq.h>
index ff3caa0c28cdb171e8bace863f8357617485c79c..f7444100f397cc41baeeb117d790e449e567ed6f 100644 (file)
@@ -41,6 +41,8 @@
 #include <asm/irq.h>
 #include <linux/io.h>
 #include <linux/i2c.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 
 #include "i2c-ibm_iic.h"
index b80c76888cabe28c39954a96b53bb61d38d0a154..b6a741caf4f6566fcfe0c36be0189bbe185272aa 100644 (file)
@@ -17,6 +17,8 @@
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/init.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/slab.h>
 
index 37e8cfad625b9c87101d7dd9916d5cb7787d84ae..8c87f4a9793be22ef28b8de3c8c7ae3766b25bde 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/platform_device.h>
+#include <linux/of_irq.h>
 #include <asm/prom.h>
 #include <asm/pmac_low_i2c.h>
 
index 4b7662a17ae90226bce968651f0a084f3c90826f..b90eb4fb2b5be66a216d843b5ce61b33f7904c69 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/io.h>
 #include <linux/of_address.h>
 #include <linux/of_device.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 
 #define DRIVER_NAME            "xilinx_ps2"
index ac5c879398604a48da1c193c6b9936a072736c7d..4f12c6f01fe7d384d086321a09d73c1fb8fdd4a3 100644 (file)
@@ -24,6 +24,8 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 
 #include <asm/machdep.h>
 #include <asm/macio.h>
index cad0e19b47a285eb4b96ae9d9869f640f26e064e..4192901cab406ca42580c13c7af4c3fcdbdd8fe1 100644 (file)
@@ -25,6 +25,8 @@
 #include <linux/pci.h>
 #include <linux/dma-mapping.h>
 #include <linux/kernel_stat.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 
 #include <asm/io.h>
 #include <asm/prom.h>
index b3b2d36c009e042e25d5e50fe0aa4d29b04295b4..23b4a3b28dbcec0152f1f348c4e2f9ff634c0902 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/poll.h>
 #include <linux/mutex.h>
 #include <linux/of_device.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/slab.h>
 
index 283e1b53c6be4ef1d4b3dfbf381b68f5cf1cdbc2..dee88e59f0d34be1359661368799d8546668eda7 100644 (file)
@@ -46,6 +46,8 @@
 #include <linux/suspend.h>
 #include <linux/cpu.h>
 #include <linux/compat.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <asm/prom.h>
 #include <asm/machdep.h>
 #include <asm/io.h>
index fe9898ca3c84465aec0e345abdd1e2b9c5d0e55f..6a232239ee8c71f8c04d3c42c002af2c789fd9a8 100644 (file)
@@ -21,6 +21,8 @@
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/slab.h>
 #include <media/v4l2-common.h>
index c6bd7e84de2436236420e76da2d0aaa15d63de10..7be89832db19f90ca2e1182fe91b77fa08efcea1 100644 (file)
@@ -10,6 +10,8 @@
  */
 
 #include <linux/dma-mapping.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/completion.h>
 #include <linux/miscdevice.h>
index 7b56563f8b747dc87df208c5be260173c217153c..08b18f3f5264aa8052cea030143d5bc5c4b76cd0 100644 (file)
@@ -88,6 +88,8 @@
  * interrupt source to the GPIO pin. Tada, we hid the interrupt. :)
  */
 
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/dma-mapping.h>
 #include <linux/miscdevice.h>
index c6ef9f1c7a825f718a901139f4f56bc1c36d9e1d..c966fc7474ced5fc8423b9440340f1d9b5072bbc 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/ioport.h>
+#include <linux/of_address.h>
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
index c96e1e0943f56d1a852f043d8243fb515ec3a371..43355779cff583975721e5c7bd7770bc055aa1c3 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
+#include <linux/of_address.h>
 #include <linux/slab.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
index 04e07252d74b82684532ad713e5e9fcfbd4e04aa..4d203e84e8ca52f32de71edfb4076e67e4910313 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/mtd/nand_ecc.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/mtd.h>
+#include <linux/of_address.h>
 #include <linux/of_platform.h>
 #include <linux/of_gpio.h>
 #include <linux/io.h>
index 3c60a000b42614b199605ac1dff95e3d5e21d216..439bc389641841dc05f79ab638f7010e4a9cd053 100644 (file)
@@ -36,7 +36,9 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
+#include <linux/of_address.h>
 #include <linux/of_device.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 
 #include <asm/mpc5121.h>
index 8e148f1478fd2aa8d9c0d58655051c8fbfa528c2..69eaba690a99ff042460bb3d07d50ca55c11ebba 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/mtd/ndfc.h>
 #include <linux/slab.h>
 #include <linux/mtd/mtd.h>
+#include <linux/of_address.h>
 #include <linux/of_platform.h>
 #include <asm/io.h>
 
index 5a67082c07ee302119edc7e5fdd1658dfb8abc81..4d174366a0f09ec2ebecd99fc8241fc978a05caa 100644 (file)
@@ -28,6 +28,8 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/nand_ecc.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/pci.h>
index 6aa737a243931f2db7f18842e6d5386ab4f812ae..ab506d6cab37743a6e207e6bfc3899db749b5148 100644 (file)
 #include <linux/io.h>
 #include <linux/can/dev.h>
 #include <linux/spinlock.h>
-
 #include <linux/of_platform.h>
-#include <asm/prom.h>
-
 #include <linux/of_irq.h>
 
 #include <linux/dma-mapping.h>
index 31ad33911167058f06d1690ee62ca7b38e3eef1e..047accd4ede58bb5be9d5a1e49aa73745db245f6 100644 (file)
@@ -44,7 +44,6 @@
 #include <linux/of_platform.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
-#include <asm/prom.h>
 
 #include "sja1000.h"
 
index 7583a9572bcc5a55c1d4fc87378f0d1475bccc45..005c2e06b8c01d865cc79d3e9d378da6b88fcf59 100644 (file)
@@ -32,7 +32,9 @@
 #include <linux/fs.h>
 #include <linux/platform_device.h>
 #include <linux/phy.h>
+#include <linux/of_address.h>
 #include <linux/of_device.h>
+#include <linux/of_irq.h>
 #include <linux/gfp.h>
 
 #include <asm/immap_cpm2.h>
index 9ae6cdbcac2ea910c5b967bbc3ee2e6356b05f3b..8aac2316d0f3f9ed3d89f361f204d7e2ba6f1ab7 100644 (file)
@@ -31,7 +31,9 @@
 #include <linux/bitops.h>
 #include <linux/fs.h>
 #include <linux/platform_device.h>
+#include <linux/of_address.h>
 #include <linux/of_device.h>
+#include <linux/of_irq.h>
 #include <linux/gfp.h>
 
 #include <asm/irq.h>
index 22a02a76706933938c4b39f09404edaef2d763d7..e151784c5ebd3ebf303dc6c3f66af7db66c3014e 100644 (file)
@@ -31,6 +31,8 @@
 #include <linux/bitops.h>
 #include <linux/fs.h>
 #include <linux/platform_device.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 
 #include <asm/irq.h>
index 844ecfa84d175f9b2dbcec1e5c724ac22b4ac395..67caaacd19ec4af121c9652d47fe94183eadc8b2 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/mii.h>
 #include <linux/platform_device.h>
 #include <linux/mdio-bitbang.h>
+#include <linux/of_address.h>
 #include <linux/of_mdio.h>
 #include <linux/of_platform.h>
 
index 2f1c46a12f0516bbcd122d1ca70a7830ea2223dd..ac5d447ff8c43c7ae045165117765510f0f49d13 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/ethtool.h>
 #include <linux/bitops.h>
 #include <linux/platform_device.h>
+#include <linux/of_address.h>
 #include <linux/of_platform.h>
 
 #include <asm/pgtable.h>
index d6d810cb97c79b80da7991f2ee423406b89853af..b14d7904a075e69779e4a2847dee1bedaba791d2 100644 (file)
@@ -78,6 +78,8 @@
 #include <linux/if_vlan.h>
 #include <linux/spinlock.h>
 #include <linux/mm.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_mdio.h>
 #include <linux/of_platform.h>
 #include <linux/ip.h>
index d58a3dfc95c296086f3d729819e42bc758ef5f6f..5548b6d00c31fe6282f108aa48bdbf45fc0c5eba 100644 (file)
@@ -31,6 +31,8 @@
 #include <linux/mii.h>
 #include <linux/phy.h>
 #include <linux/workqueue.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_mdio.h>
 #include <linux/of_net.h>
 #include <linux/of_platform.h>
index c1b6e7e31aac4f258dd21049c4e29b7f006e933a..d449fcb901999cce522a0301a26692ff6df34b0f 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/module.h>
 #include <linux/phy.h>
 #include <linux/mdio.h>
+#include <linux/of_address.h>
 #include <linux/of_platform.h>
 #include <linux/of_mdio.h>
 
index ef21a2e10180c516a5ee3935b15af5fb52b506ab..ae342fdb42c8e79853507007ad2ea6c8d3681fad 100644 (file)
@@ -39,6 +39,8 @@
 #include <linux/bitops.h>
 #include <linux/workqueue.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_net.h>
 #include <linux/slab.h>
 
index dac564c25440cbb5c222a02a8488f8ad6c676e16..4742ba3909fb614b32661ab5cdae6db897d81ab4 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <linux/delay.h>
 #include <linux/slab.h>
+#include <linux/of_irq.h>
 
 #include "core.h"
 #include <asm/dcr-regs.h>
index c47e23d6eeaa0b57752d4ca047567178e1d37026..4fb2f96da23bb32f4709baddbff77cc7880e49d4 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/slab.h>
 #include <linux/kernel.h>
 #include <linux/ethtool.h>
+#include <linux/of_address.h>
 #include <asm/io.h>
 
 #include "emac.h"
index c231a4a32c4dc90d341b10c67c194c1025e4c686..9f24769ed82680d7c29e7dc6e22a26590c4f5d8d 100644 (file)
@@ -18,6 +18,7 @@
  * Free Software Foundation;  either version 2 of the  License, or (at your
  * option) any later version.
  */
+#include <linux/of_address.h>
 #include <asm/io.h>
 
 #include "emac.h"
index 4cdf286f7ee314dc55acb2494a74ede4468170e8..9ca67a38c06208868926b4ba59f6403be143ea5b 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/slab.h>
 #include <linux/kernel.h>
 #include <linux/ethtool.h>
+#include <linux/of_address.h>
 #include <asm/io.h>
 
 #include "emac.h"
index 0029148077a9805a288a42a9d8207a97ce6e8133..1f23641263232fce0255d237976cbf5470e22a6c 100644 (file)
@@ -36,6 +36,7 @@
 #include <linux/netdevice.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
+#include <linux/of_irq.h>
 #include <linux/of_mdio.h>
 #include <linux/of_platform.h>
 #include <linux/of_address.h>
index 71180b91bfbe7d9ef3167fe497cea72fb890f515..27224c0d80a6dd170c53f99c097d851f32395b26 100644 (file)
@@ -626,6 +626,14 @@ const __be32 *of_get_address(struct device_node *dev, int index, u64 *size,
 }
 EXPORT_SYMBOL(of_get_address);
 
+unsigned long __weak pci_address_to_pio(phys_addr_t address)
+{
+       if (address > IO_SPACE_LIMIT)
+               return (unsigned long)-1;
+
+       return (unsigned long) address;
+}
+
 static int __of_address_to_resource(struct device_node *dev,
                const __be32 *addrp, u64 size, unsigned int flags,
                const char *name, struct resource *r)
index 3ae106d8979149e57fb1bce2cab413191014da39..a96f8503afcddfdd452e4902b715253141086a3f 100644 (file)
@@ -74,6 +74,13 @@ int of_n_size_cells(struct device_node *np)
 }
 EXPORT_SYMBOL(of_n_size_cells);
 
+#ifdef CONFIG_NUMA
+int __weak of_node_to_nid(struct device_node *np)
+{
+       return numa_node_id();
+}
+#endif
+
 #if defined(CONFIG_OF_DYNAMIC)
 /**
  *     of_node_get - Increment refcount of a node
index a4fa9ad31b8f7cfb62f45abf47ada0649d87b867..2fa024b97c4350c680e384c645dc17d0fc5dc177 100644 (file)
@@ -618,12 +618,72 @@ int __init of_scan_flat_dt_by_path(const char *path,
                return ret;
 }
 
+const char * __init of_flat_dt_get_machine_name(void)
+{
+       const char *name;
+       unsigned long dt_root = of_get_flat_dt_root();
+
+       name = of_get_flat_dt_prop(dt_root, "model", NULL);
+       if (!name)
+               name = of_get_flat_dt_prop(dt_root, "compatible", NULL);
+       return name;
+}
+
+/**
+ * of_flat_dt_match_machine - Iterate match tables to find matching machine.
+ *
+ * @default_match: A machine specific ptr to return in case of no match.
+ * @get_next_compat: callback function to return next compatible match table.
+ *
+ * Iterate through machine match tables to find the best match for the machine
+ * compatible string in the FDT.
+ */
+const void * __init of_flat_dt_match_machine(const void *default_match,
+               const void * (*get_next_compat)(const char * const**))
+{
+       const void *data = NULL;
+       const void *best_data = default_match;
+       const char *const *compat;
+       unsigned long dt_root;
+       unsigned int best_score = ~1, score = 0;
+
+       dt_root = of_get_flat_dt_root();
+       while ((data = get_next_compat(&compat))) {
+               score = of_flat_dt_match(dt_root, compat);
+               if (score > 0 && score < best_score) {
+                       best_data = data;
+                       best_score = score;
+               }
+       }
+       if (!best_data) {
+               const char *prop;
+               long size;
+
+               pr_err("\n unrecognized device tree list:\n[ ");
+
+               prop = of_get_flat_dt_prop(dt_root, "compatible", &size);
+               if (prop) {
+                       while (size > 0) {
+                               printk("'%s' ", prop);
+                               size -= strlen(prop) + 1;
+                               prop += strlen(prop) + 1;
+                       }
+               }
+               printk("]\n\n");
+               return NULL;
+       }
+
+       pr_info("Machine model: %s\n", of_flat_dt_get_machine_name());
+
+       return best_data;
+}
+
 #ifdef CONFIG_BLK_DEV_INITRD
 /**
  * early_init_dt_check_for_initrd - Decode initrd location from flat tree
  * @node: reference to node containing initrd location ('chosen')
  */
-void __init early_init_dt_check_for_initrd(unsigned long node)
+static void __init early_init_dt_check_for_initrd(unsigned long node)
 {
        u64 start, end;
        unsigned long len;
@@ -641,12 +701,15 @@ void __init early_init_dt_check_for_initrd(unsigned long node)
                return;
        end = of_read_number(prop, len/4);
 
-       early_init_dt_setup_initrd_arch(start, end);
+       initrd_start = (unsigned long)__va(start);
+       initrd_end = (unsigned long)__va(end);
+       initrd_below_start_ok = 1;
+
        pr_debug("initrd_start=0x%llx  initrd_end=0x%llx\n",
                 (unsigned long long)start, (unsigned long long)end);
 }
 #else
-inline void early_init_dt_check_for_initrd(unsigned long node)
+static inline void early_init_dt_check_for_initrd(unsigned long node)
 {
 }
 #endif /* CONFIG_BLK_DEV_INITRD */
@@ -774,6 +837,25 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
 }
 
 #ifdef CONFIG_HAVE_MEMBLOCK
+void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size)
+{
+       const u64 phys_offset = __pa(PAGE_OFFSET);
+       base &= PAGE_MASK;
+       size &= PAGE_MASK;
+       if (base + size < phys_offset) {
+               pr_warning("Ignoring memory block 0x%llx - 0x%llx\n",
+                          base, base + size);
+               return;
+       }
+       if (base < phys_offset) {
+               pr_warning("Ignoring memory range 0x%llx - 0x%llx\n",
+                          base, phys_offset);
+               size -= phys_offset - base;
+               base = phys_offset;
+       }
+       memblock_add(base, size);
+}
+
 /*
  * called from unflatten_device_tree() to bootstrap devicetree itself
  * Architectures can override this definition if memblock isn't used
@@ -784,6 +866,32 @@ void * __init __weak early_init_dt_alloc_memory_arch(u64 size, u64 align)
 }
 #endif
 
+bool __init early_init_dt_scan(void *params)
+{
+       if (!params)
+               return false;
+
+       /* Setup flat device-tree pointer */
+       initial_boot_params = params;
+
+       /* check device tree validity */
+       if (be32_to_cpu(initial_boot_params->magic) != OF_DT_HEADER) {
+               initial_boot_params = NULL;
+               return false;
+       }
+
+       /* Retrieve various information from the /chosen node */
+       of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line);
+
+       /* Initialize {size,address}-cells info */
+       of_scan_flat_dt(early_init_dt_scan_root, NULL);
+
+       /* Setup memory, calling early_init_dt_add_memory_arch */
+       of_scan_flat_dt(early_init_dt_scan_memory, NULL);
+
+       return true;
+}
+
 /**
  * unflatten_device_tree - create tree of device_nodes from flat blob
  *
@@ -801,4 +909,28 @@ void __init unflatten_device_tree(void)
        of_alias_scan(early_init_dt_alloc_memory_arch);
 }
 
+/**
+ * unflatten_and_copy_device_tree - copy and create tree of device_nodes from flat blob
+ *
+ * Copies and unflattens the device-tree passed by the firmware, creating the
+ * tree of struct device_node. It also fills the "name" and "type"
+ * pointers of the nodes so the normal device-tree walking functions
+ * can be used. This should only be used when the FDT memory has not been
+ * reserved such is the case when the FDT is built-in to the kernel init
+ * section. If the FDT memory is reserved already then unflatten_device_tree
+ * should be used instead.
+ */
+void __init unflatten_and_copy_device_tree(void)
+{
+       int size = __be32_to_cpu(initial_boot_params->totalsize);
+       void *dt = early_init_dt_alloc_memory_arch(size,
+               __alignof__(struct boot_param_header));
+
+       if (dt) {
+               memcpy(dt, initial_boot_params, size);
+               initial_boot_params = dt;
+       }
+       unflatten_device_tree();
+}
+
 #endif /* CONFIG_OF_EARLY_FLATTREE */
index e5ca00893c0c300979aec82a5fd764d1bde87192..848199633798cd635030b398c54f93e173de057d 100644 (file)
@@ -2,7 +2,6 @@
 #include <linux/export.h>
 #include <linux/of.h>
 #include <linux/of_pci.h>
-#include <asm/prom.h>
 
 static inline int __of_pci_pci_compare(struct device_node *node,
                                       unsigned int data)
index 67705381321154546eb8b80a3280ae417a662c01..d86076431af668f34931cff162ebc698bc1f1b49 100644 (file)
@@ -2,7 +2,6 @@
 #include <linux/of_pci.h>
 #include <linux/of_irq.h>
 #include <linux/export.h>
-#include <asm/prom.h>
 
 /**
  * of_irq_map_pci - Resolve the interrupt for a PCI device
index 4ec19cbee57f7b57764947327797ef573880e260..7b666736c1681cf318c4392a53194b8c573ba7c5 100644 (file)
@@ -22,7 +22,6 @@
 #include <linux/slab.h>
 #include <linux/of.h>
 #include <linux/of_pdt.h>
-#include <asm/prom.h>
 
 static struct of_pdt_ops *of_pdt_prom_ops __initdata;
 
index a007321ad3145d3cbeda0defe22d8a713c23a11a..1b206eac5f93be86ffe61d07bf420d2234a79cae 100644 (file)
@@ -30,6 +30,8 @@
 #include <linux/interrupt.h>
 #include <linux/mm.h>
 #include <linux/vmalloc.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/slab.h>
 
index 9c8f6090379991b0ea4ec0643a7f97d763c2ed0a..dc4f14255cc36c755ca90658cdad4c501fda4f71 100644 (file)
@@ -14,7 +14,9 @@
 #include <linux/module.h>
 #include <linux/rtc.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
 #include <linux/of_device.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/io.h>
 #include <linux/slab.h>
index 07971e3fe58b63c23daab2bb7cea0a3350a6bb6a..bd5aaf42719ce0d735e02d62dfe1372558becaa0 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/spi/spi.h>
 #include <linux/fsl_devices.h>
 #include <linux/dma-mapping.h>
+#include <linux/of_address.h>
 #include <asm/cpm.h>
 #include <asm/qe.h>
 
index b8f1103fe28ee63a4d5209f5f88466fdc84255af..c1c936cf0ed4ec28f3f9ff7322805ebd6da6617b 100644 (file)
@@ -16,6 +16,8 @@
 #include <linux/fsl_devices.h>
 #include <linux/mm.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/interrupt.h>
 #include <linux/err.h>
index 6adf4e35816d76c1c7f120cd924420c4c8bf71a1..8dcc1432f1f51fba2505bad2c6d5ab6690182faf 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/errno.h>
 #include <linux/interrupt.h>
 #include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/completion.h>
 #include <linux/io.h>
index 9bffcec5ad82a4bcf0f05e3a89c73cf0b62433dc..0419b69e270fc7158613cbd78efbddb2e0d45d01 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/poll.h>
 #include <asm/epapr_hcalls.h>
 #include <linux/of.h>
+#include <linux/of_irq.h>
 #include <linux/platform_device.h>
 #include <linux/cdev.h>
 #include <linux/console.h>
index 1a535f70dc41b2886d9fa6d500a5f11f6556eab0..9f7ba6d8750a58ac0366d92170c5e2600611a656 100644 (file)
@@ -41,6 +41,8 @@
 #include <linux/bootmem.h>
 #include <linux/dma-mapping.h>
 #include <linux/fs_uart_pd.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/gpio.h>
 #include <linux/of_gpio.h>
index 18f79575894a2c036f8eace28a8aa8d70924ee56..527a969b095247b90867e17eb5b1ab9fcdcef44c 100644 (file)
@@ -45,6 +45,7 @@
 #include <linux/kernel.h>
 
 #include <linux/of.h>
+#include <linux/of_address.h>
 
 #include "cpm_uart.h"
 
index f87f1a0c8c6ee577860e37e7a95038e61776e1cb..246b4c327a543a3ec2d2a6742b9c051b2782887b 100644 (file)
@@ -57,6 +57,8 @@
 #include <linux/bitops.h>
 #include <linux/sysrq.h>
 #include <linux/mutex.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <asm/sections.h>
 #include <asm/io.h>
 #include <asm/irq.h>
index 88317482b81fce4929dc2556e1b19358c6156017..9de1da0c9d891fddf6eb155f897ba54f341a0591 100644 (file)
@@ -25,6 +25,8 @@
 #include <linux/tty.h>
 #include <linux/tty_flip.h>
 #include <linux/io.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/dma-mapping.h>
 
index f3bb363f1d4acffd04d028c7940f70ff594e4ab5..807127d56fa3d94b26c9206c48ff756086cf57df 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/io.h>
 #include <linux/moduleparam.h>
 #include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/dma-mapping.h>
 #include <linux/usb/ch9.h>
index 932293fa32de657de2e36ba091127e50009a6ff7..2b1694e6b4809b0fb0af261a140f3677952731a7 100644 (file)
@@ -16,6 +16,8 @@
 #include <linux/signal.h>
 
 #include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 
 
index 0b46542591fff62c2cedf38b1351b6b7c4db3331..0551c0af0fd14c9d05141af86a3b28f4fce0344a 100644 (file)
@@ -26,6 +26,8 @@
 #include <linux/io.h>
 #include <linux/usb.h>
 #include <linux/usb/hcd.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/of_gpio.h>
 #include <linux/slab.h>
index 75f5a1e2f01e70b4295b25008aec142480664856..81f3eba215c1224e3b7d1da64c7d1d31f12dfb15 100644 (file)
@@ -14,6 +14,8 @@
  */
 
 #include <linux/signal.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 
 #include <asm/prom.h>
index 6dd72250111e699952537702d3260603a76dcc0c..b047ec58ac3027e52f8516d39ea1a0c6df6e9758 100644 (file)
@@ -31,6 +31,8 @@
 #include <linux/uaccess.h>
 #include <linux/vmalloc.h>
 #include <linux/spinlock.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 
 #include <sysdev/fsl_soc.h>
 #include <linux/fsl-diu-fb.h>
index d294f67d6f84daa4ad1d208c4c5538b49dc954cc..32c8fc5f7a5c3762f7fc6486f34c7b061b26f1b1 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/slab.h>
 #include <linux/poll.h>
 #include <linux/of.h>
+#include <linux/of_irq.h>
 #include <linux/reboot.h>
 #include <linux/uaccess.h>
 #include <linux/notifier.h>
index 257cfbad21dac158e9ad5d2842a1d878ebadb22e..3755833430dc3d8146a3f515e68b0a897a400c60 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/watchdog.h>
 #include <linux/fs.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
 #include <linux/of_platform.h>
 #include <linux/io.h>
 #include <linux/uaccess.h>
index da2752063bb7b3b7a95b77ef45d5f66ea1612d63..d0ebebae607c847766b3e9cc7204dad7afad7cac 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/kernel.h>
 #include <linux/timer.h>
 #include <linux/miscdevice.h>
+#include <linux/of_address.h>
 #include <linux/of_platform.h>
 #include <linux/module.h>
 #include <linux/watchdog.h>
index 106a83570630d9048da7cd89546e4dd6c44009e2..70779b2fc2090b98b741d10f3f37c4a8c1379bf9 100644 (file)
 #include <linux/of.h>
 #include <linux/export.h>
 #include <linux/slab.h>
-#include <asm/prom.h>
 #include <asm/uaccess.h>
 #include "internal.h"
 
 static inline void set_node_proc_entry(struct device_node *np,
                                       struct proc_dir_entry *de)
 {
-#ifdef HAVE_ARCH_DEVTREE_FIXUPS
        np->pde = de;
-#endif
 }
 
 static struct proc_dir_entry *proc_device_tree;
index f95aee391e30fcb98eeec0f6569c0b4bc9b8ba31..54017b83650b0a52a3544cd1ddb020567c0db4d8 100644 (file)
@@ -136,7 +136,9 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size)
        return of_read_number(cell, size);
 }
 
+#if defined(CONFIG_SPARC)
 #include <asm/prom.h>
+#endif
 
 /* Default #address and #size cells.  Allow arch asm/prom.h to override */
 #if !defined(OF_ROOT_NODE_ADDR_CELLS_DEFAULT)
@@ -534,13 +536,10 @@ static inline const char *of_prop_next_string(struct property *prop,
 #define of_match_node(_matches, _node) NULL
 #endif /* CONFIG_OF */
 
-#ifndef of_node_to_nid
-static inline int of_node_to_nid(struct device_node *np)
-{
-       return numa_node_id();
-}
-
-#define of_node_to_nid of_node_to_nid
+#if defined(CONFIG_OF) && defined(CONFIG_NUMA)
+extern int of_node_to_nid(struct device_node *np);
+#else
+static inline int of_node_to_nid(struct device_node *device) { return 0; }
 #endif
 
 /**
index 4c2e6f26432cfe5b0260fecb0caa5a15601482e8..5f6ed6b182b8ef9c7e01930288330d324f7f57b1 100644 (file)
@@ -34,6 +34,10 @@ static inline void of_pci_range_to_resource(struct of_pci_range *range,
        res->name = np->full_name;
 }
 
+/* Translate a DMA address from device space to CPU space */
+extern u64 of_translate_dma_address(struct device_node *dev,
+                                   const __be32 *in_addr);
+
 #ifdef CONFIG_OF_ADDRESS
 extern u64 of_translate_address(struct device_node *np, const __be32 *addr);
 extern bool of_can_translate_address(struct device_node *dev);
@@ -52,10 +56,7 @@ extern void __iomem *of_iomap(struct device_node *device, int index);
 extern const __be32 *of_get_address(struct device_node *dev, int index,
                           u64 *size, unsigned int *flags);
 
-#ifndef pci_address_to_pio
-static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; }
-#define pci_address_to_pio pci_address_to_pio
-#endif
+extern unsigned long pci_address_to_pio(phys_addr_t addr);
 
 extern int of_pci_range_parser_init(struct of_pci_range_parser *parser,
                        struct device_node *node);
@@ -63,13 +64,6 @@ extern struct of_pci_range *of_pci_range_parser_one(
                                        struct of_pci_range_parser *parser,
                                        struct of_pci_range *range);
 #else /* CONFIG_OF_ADDRESS */
-#ifndef of_address_to_resource
-static inline int of_address_to_resource(struct device_node *dev, int index,
-                                        struct resource *r)
-{
-       return -EINVAL;
-}
-#endif
 static inline struct device_node *of_find_matching_node_by_address(
                                        struct device_node *from,
                                        const struct of_device_id *matches,
@@ -77,12 +71,7 @@ static inline struct device_node *of_find_matching_node_by_address(
 {
        return NULL;
 }
-#ifndef of_iomap
-static inline void __iomem *of_iomap(struct device_node *device, int index)
-{
-       return NULL;
-}
-#endif
+
 static inline const __be32 *of_get_address(struct device_node *dev, int index,
                                        u64 *size, unsigned int *flags)
 {
@@ -103,6 +92,22 @@ static inline struct of_pci_range *of_pci_range_parser_one(
 }
 #endif /* CONFIG_OF_ADDRESS */
 
+#ifdef CONFIG_OF
+extern int of_address_to_resource(struct device_node *dev, int index,
+                                 struct resource *r);
+void __iomem *of_iomap(struct device_node *node, int index);
+#else
+static inline int of_address_to_resource(struct device_node *dev, int index,
+                                        struct resource *r)
+{
+       return -EINVAL;
+}
+
+static inline void __iomem *of_iomap(struct device_node *device, int index)
+{
+       return NULL;
+}
+#endif
 
 #if defined(CONFIG_OF_ADDRESS) && defined(CONFIG_PCI)
 extern const __be32 *of_get_pci_address(struct device_node *dev, int bar_no,
index a478c62a2aabc4dc38f243e25b572bae62688fec..0beaee9dac1f1480a51c36ade2004d8b3a69cbce 100644 (file)
@@ -96,31 +96,30 @@ extern int of_scan_flat_dt_by_path(const char *path,
 
 extern int early_init_dt_scan_chosen(unsigned long node, const char *uname,
                                     int depth, void *data);
-extern void early_init_dt_check_for_initrd(unsigned long node);
 extern int early_init_dt_scan_memory(unsigned long node, const char *uname,
                                     int depth, void *data);
 extern void early_init_dt_add_memory_arch(u64 base, u64 size);
 extern void * early_init_dt_alloc_memory_arch(u64 size, u64 align);
 extern u64 dt_mem_next_cell(int s, __be32 **cellp);
 
-/*
- * If BLK_DEV_INITRD, the fdt early init code will call this function,
- * to be provided by the arch code. start and end are specified as
- * physical addresses.
- */
-#ifdef CONFIG_BLK_DEV_INITRD
-extern void early_init_dt_setup_initrd_arch(u64 start, u64 end);
-#endif
-
 /* Early flat tree scan hooks */
 extern int early_init_dt_scan_root(unsigned long node, const char *uname,
                                   int depth, void *data);
 
+extern bool early_init_dt_scan(void *params);
+
+extern const char *of_flat_dt_get_machine_name(void);
+extern const void *of_flat_dt_match_machine(const void *default_match,
+               const void * (*get_next_compat)(const char * const**));
+
 /* Other Prototypes */
 extern void unflatten_device_tree(void);
+extern void unflatten_and_copy_device_tree(void);
 extern void early_init_devtree(void *);
 #else /* CONFIG_OF_FLATTREE */
+static inline const char *of_flat_dt_get_machine_name(void) { return NULL; }
 static inline void unflatten_device_tree(void) {}
+static inline void unflatten_and_copy_device_tree(void) {}
 #endif /* CONFIG_OF_FLATTREE */
 
 #endif /* __ASSEMBLY__ */
index faa3174905458d85ece1bee693d27db95b789746..f34153962d07f185454f62964251444a5e5ac033 100644 (file)
@@ -10,8 +10,9 @@
  * registers.
  */
 
-#include <asm/pmac_feature.h>
+#include <linux/of_irq.h>
 #include <linux/interrupt.h>
+#include <asm/pmac_feature.h>
 #include "../aoa.h"
 
 /* TODO: these are lots of global variables
index 15e76131b5015dd88cccf93ea08837694b1f03c7..467836057ee5f4884e8ce381a60715514f212cb9 100644 (file)
@@ -11,6 +11,8 @@
 #include <linux/pci.h>
 #include <linux/interrupt.h>
 #include <linux/dma-mapping.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 
 #include <sound/core.h>
 
index c93fbbb201fed94645cf9819ec2fcf287b3389fe..7a43c0c38316c7879815cf42190cd64f51376373 100644 (file)
@@ -28,6 +28,8 @@
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/dma-mapping.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <sound/core.h>
 #include "pmac.h"
 #include <sound/pcm_params.h>
index b23354a4ceca7023d99cee8da266d0186c0dd208..b9ffc17a47996230b4c1a808a225c90005f33981 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/string.h>
+#include <linux/of_irq.h>
 #include <sound/core.h>
 #include <asm/io.h>
 #include <asm/irq.h>
index f73c7eff8b237b0d7786cd71005789af12b8c0a3..fb9bb9eb5ca38f56d7359b6c57af772ee941675c 100644 (file)
@@ -21,6 +21,8 @@
 #include <linux/interrupt.h>
 #include <linux/delay.h>
 #include <linux/gfp.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/list.h>
 #include <linux/slab.h>
index 8fcf2241674054a8d687ae94598a0b1beed26e8a..71bf2f248cd47be5fb025baa6535296b49d75bbd 100644 (file)
@@ -10,6 +10,8 @@
 #include <linux/of_device.h>
 #include <linux/dma-mapping.h>
 #include <linux/slab.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 
 #include <sound/soc.h>
index 3ef7a0c92efa07eb4719aadfefacf5c050a008cd..24eafa2cfbf4d78dac4aed28faa20d38ac352184 100644 (file)
@@ -291,7 +291,7 @@ static int psc_ac97_of_probe(struct platform_device *op)
 
        rc = snd_soc_set_ac97_ops(&psc_ac97_ops);
        if (rc != 0) {
-               dev_err(&op->dev, "Failed to set AC'97 ops: %d\n", ret);
+               dev_err(&op->dev, "Failed to set AC'97 ops: %d\n", rc);
                return rc;
        }
 
index 228c52e71440dde17f0a41b4d0e34d9a260718d5..fa756d05b2f716e671ce208b99867ae03cc384ea 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <linux/module.h>
 #include <linux/interrupt.h>
+#include <linux/of_address.h>
 #include <linux/of_device.h>
 #include <linux/slab.h>
 #include <sound/soc.h>
index ba59c23a137b3e4e19b1f03047b93fcd5f376301..f75c3cf0e6de9de5d4d0f34ded20cf6edbfa045b 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <linux/module.h>
 #include <linux/interrupt.h>
+#include <linux/of_address.h>
 #include <linux/of_device.h>
 #include <linux/slab.h>
 #include <sound/soc.h>
index f215519115339c1902e0a7c4f6e25a513d9639d3..9d89bb028621b12ba1f5df6c6036d9859e192323 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <linux/module.h>
 #include <linux/interrupt.h>
+#include <linux/of_address.h>
 #include <linux/of_device.h>
 #include <linux/slab.h>
 #include <sound/soc.h>