1. 13 Mar, 2007 5 commits
    • Scott Wood's avatar
      [POWERPC] bootwrapper: Add ft_root_node(). · 7c71c046
      Scott Wood authored
      Clean up some of the open-coded data structure references by providing a
      function to return a pointer to the tree's root node.  This is only used
      in high-level functions trying to access the root of the tree, not in
      low-level code that is actually manipulating the data structure.
      Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
      Acked-by: default avatarMark A. Greer <mgreer@mvista.com>
      Acked-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      7c71c046
    • Scott Wood's avatar
      [POWERPC] bootwrapper: Add stddef.h to ops.h · ce3edb30
      Scott Wood authored
      ops.h references NULL, so include stddef.h, so files including ops.h
      don't have to.
      Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
      Acked-by: default avatarMark A. Greer <mgreer@mvista.com>
      Acked-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      ce3edb30
    • David Gibson's avatar
      [POWERPC] zImage: Cleanup and improve zImage entry point · cd197ffc
      David Gibson authored
      This patch re-organises the way the zImage wrapper code is entered, to
      allow more flexibility on platforms with unusual entry conditions.
      After this patch, a platform .o file has two options:
      
      1) It can define a _zimage_start, in which case the platform code gets
         control from the very beginning of execution.  In this case the
         platform code is responsible for relocating the zImage if necessary,
         clearing the BSS, performing any platform specific initialization, and
         finally calling start() to load and enter the kernel.
      
      2) It can define platform_init().  In this case the generic crt0.S
         handles initial entry, and calls platform_init() before calling
         start().  The signature of platform_init() is changed, however, to
         take up to 5 parameters (in r3..r7) as they come from the platform's
         initial loader, instead of a fixed set of parameters based on OF's
         usage.
      
         When using the generic crt0.S, the platform .o can optionally
         supply a custom stack to use, using the BSS_STACK() macro.  If this
         is not supplied, the crt0.S will assume that the loader has
         supplied a usable stack.
      
      In either case, the platform code communicates information to the
      generic code (specifically, a PROM pointer for OF systems, and/or an
      initrd image address supplied by the bootloader) via a global
      structure "loader_info".
      
      In addition the wrapper script is rearranged to ensure that the
      platform .o is always linked first.  This means that platforms where
      the zImage entry point is at a fixed address or offset, rather than
      being encoded in the binary header can be supported using option (1).
      Signed-off-by: default avatarDavid Gibson <dwg@au1.ibm.com>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      cd197ffc
    • David Gibson's avatar
      [POWERPC] zImage: Cleanup and improve prep_kernel() · 79c85419
      David Gibson authored
      This patch rewrites prep_kernel() in the zImage wrapper code to be
      clearer and more flexible.  Notable changes:
      
      	- Handling of the initrd image from prep_kernel() has moved
      into a new prep_initrd() function.
      	- The address of the initrd image is now added as device tree
      properties, as the kernel expects.
      	- We only copy a packaged initrd image to a new location if it
      is in danger of being clobbered when the kernel moves to its final
      location, instead of always.
      	- By default we decompress the kernel directly to address 0,
      instead of requiring it to relocate itself.  Platforms (such as OF)
      where doing this could clobber still-live firmware data structures can
      override the vmlinux_alloc hook to provide an alternate place to
      decompress the kernel.
      	- We no longer pass lots of information between functions in
      global variables.
      Signed-off-by: default avatarDavid Gibson <dwg@au1.ibm.com>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      79c85419
    • David Gibson's avatar
      [POWERPC] zImage: Add more flexible gunzip convenience functions · ad9d2716
      David Gibson authored
      At present, arch/powerpc/boot/main.c includes a gunzip() function
      which is a convenient wrapper around zlib.  However, it doesn't
      conveniently allow decompressing part of an image to one location,
      then the remainder to a different address.
      
      This patch adds a new set of more flexible convenience wrappers around
      zlib, moving them to their own file, gunzip_util.c, in the process.
      These wrappers allow decompressing sections of the compressed image to
      different locations.  In addition, they transparently handle
      uncompressed data, avoiding special case code to handle uncompressed
      vmlinux images.
      
      The patch also converts main.c to use the new wrappers, using the new
      flexibility to avoid decompressing the vmlinux's ELF header twice as
      we did previously.  That in turn means we avoid extending our
      allocations for the vmlinux to allow space for the extra copy of the
      ELF header.
      Signed-off-by: default avatarDavid Gibson <dwg@au1.ibm.com>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      ad9d2716
  2. 09 Mar, 2007 17 commits
  3. 08 Mar, 2007 7 commits
    • Stephen Rothwell's avatar
      [POWERPC] Allocate syscall number for sys_getcpu · 02567c6c
      Stephen Rothwell authored
      I forgot to do this when wiring up the syscall.
      Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      02567c6c
    • David Gibson's avatar
      [POWERPC] Automatically lmb_reserve() initrd · 30437b3e
      David Gibson authored
      At present, when an initrd is passed to the kernel used flat device
      tree properties, the memory the initrd occupies must also be reserved
      in the flat tree's reserve map, or the kernel may overwrite it.  That
      makes life more complicated than it could be for the bootwrapper.
      
      This patch makes the kernel automatically reserve the initrd's space.
      That in turn requires parsing the initrd parameters earlier than they
      are currently, in early_init_dt_scan_chosen() instead of
      check_for_initrd().
      Signed-off-by: default avatarDavid Gibson <dwg@au1.ibm.com>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      30437b3e
    • David Gibson's avatar
      [POWERPC] Allow duplicate lmb_reserve() calls · eb6de286
      David Gibson authored
      At present calling lmb_reserve() (and hence lmb_add_region()) twice
      for exactly the same memory region will cause strange behaviour.
      
      This makes life difficult when booting from a flat device tree with
      memory reserve map.  Which regions are automatically reserved by the
      kernel has changed over time, so it's quite possible a newer kernel
      could attempt to auto-reserve a region which is also explicitly listed
      in the device tree's reserve map, leading to trouble.
      
      This patch avoids the problem by making lmb_reserve() ignore a call to
      reserve a previously reserved region.  It also removes a now redundant
      test designed to avoid one specific case of the problem noted above.
      
      At present, this patch deals only with duplicate reservations of an
      identical region.  Attempting to reserve two different, but
      overlapping regions will still cause problems.  I might post another
      patch later dealing with this case, but I'm avoiding it now since it
      is substantially more complicated to deal with, less likely to occur
      and more likely to indicate a genuine bug elsewhere if it does occur.
      Signed-off-by: default avatarDavid Gibson <dwg@au1.ibm.com>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      eb6de286
    • Adrian Bunk's avatar
      [POWERPC] Unexport mac_hid_mouse_emulate_buttons · 83ddcf5d
      Adrian Bunk authored
      This patch removes the unused
      EXPORT_SYMBOL(mac_hid_mouse_emulate_buttons).
      Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      83ddcf5d
    • Stuart Yoder's avatar
      [POWERPC] Remove interrupt-controller as a property under /chosen · d1bff9ed
      Stuart Yoder authored
       Remove interrupt-controller as a valid property under /chosen in
       the documentation.  There is a consensus that an
       interrupt-controller property does not belong under /chosen.
       /chosen is specifically for dynamic properties set at runtime.
      Signed-off-by: default avatarStuart Yoder <stuart.yoder@freescale.com>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      d1bff9ed
    • Paul Mackerras's avatar
      [POWERPC] Harden validate_sp against stack corruption · bb72c481
      Paul Mackerras authored
      If something has overflowed or corrupted the stack and causes an oops,
      and we try to print a stack trace, that will call validate_sp, which
      can itself cause an oops if the cpu field of the thread_info struct at
      the bottom of the stack has been corrupted (if CONFIG_IRQSTACKS is
      set).  This makes debugging harder.
      
      To avoid the second oops, this adds a check to make sure that the cpu
      number is reasonable before using it to check whether the stack is on
      the softirq or hardirq stack.
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      bb72c481
    • Andrew Morton's avatar
      [POWERPC] Fix compile error in prom.h · 99ddef9b
      Andrew Morton authored
      In file included from include/asm/pci.h:20,
                       from include/linux/pci.h:751,
                       from arch/powerpc/sysdev/dart_iommu.c:36:
      include/asm/prom.h: In function `of_irq_to_resource':
      include/asm/prom.h:341: warning: implicit declaration of function `irq_of_parse_and_map'
      include/asm/prom.h:345: error: `NO_IRQ' undeclared (first use in this function)
      include/asm/prom.h:345: error: (Each undeclared identifier is reported only once
      include/asm/prom.h:345: error: for each function it appears in.)
      
      Seems that prom.h has always wanted irq.h.
      
      Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      99ddef9b
  4. 07 Mar, 2007 11 commits