1. 22 8月, 2016 1 次提交
    • C
      powerpc: sysdev: cpm: fix gpio save_regs functions · 41017a75
      Christophe Leroy 提交于
      of_mm_gpiochip_add_data() calls mm_gc->save_regs() before
      setting the data. Therefore ->save_regs() cannot use
      gpiochip_get_data()
      
      [    0.275940] Unable to handle kernel paging request for data at address 0x00000130
      [    0.283120] Faulting instruction address: 0xc01b44cc
      [    0.288175] Oops: Kernel access of bad area, sig: 11 [#1]
      [    0.293343] PREEMPT CMPC885
      [    0.296141] CPU: 0 PID: 1 Comm: swapper Not tainted 4.7.0-g65124df-dirty #68
      [    0.304131] task: c6074000 ti: c6080000 task.ti: c6080000
      [    0.309459] NIP: c01b44cc LR: c0011720 CTR: c0011708
      [    0.314372] REGS: c6081d90 TRAP: 0300   Not tainted  (4.7.0-g65124df-dirty)
      [    0.322267] MSR: 00009032 <EE,ME,IR,DR,RI>  CR: 24000028  XER: 20000000
      [    0.328813] DAR: 00000130 DSISR: c0000000
      GPR00: c01b6d0c c6081e40 c6074000 c6017000 c9028000 c601d028 c6081dd8 00000000
      GPR08: c601d028 00000000 ffffffff 00000001 24000044 00000000 c0002790 00000000
      GPR16: 00000000 00000000 00000000 00000000 00000000 00000000 c05643b0 00000083
      GPR24: c04a1a6c c0560000 c04a8308 c04c6480 c0012498 c6017000 c7ffcc78 c6017000
      [    0.360806] NIP [c01b44cc] gpiochip_get_data+0x4/0xc
      [    0.365684] LR [c0011720] cpm1_gpio16_save_regs+0x18/0x44
      [    0.370972] Call Trace:
      [    0.373451] [c6081e50] [c01b6d0c] of_mm_gpiochip_add_data+0x70/0xdc
      [    0.379624] [c6081e70] [c00124c0] cpm_init_par_io+0x28/0x118
      [    0.385238] [c6081e80] [c04a8ac0] do_one_initcall+0xb0/0x17c
      [    0.390819] [c6081ef0] [c04a8cbc] kernel_init_freeable+0x130/0x1dc
      [    0.396924] [c6081f30] [c00027a4] kernel_init+0x14/0x110
      [    0.402177] [c6081f40] [c000b424] ret_from_kernel_thread+0x5c/0x64
      [    0.408233] Instruction dump:
      [    0.411168] 4182fafc 3f80c040 48234c6d 3bc0fff0 3b9c5ed0 4bfffaf4 81290020 712a0004
      [    0.418825] 4182fb34 48234c51 4bfffb2c 81230004 <80690130> 4e800020 7c0802a6 9421ffe0
      [    0.426763] ---[ end trace fe4113ee21d72ffa ]---
      
      fixes: e65078f1 ("powerpc: sysdev: cpm1: use gpiochip data pointer")
      fixes: a14a2d48 ("powerpc: cpm_common: use gpiochip data pointer")
      Cc: stable@vger.kernel.org
      Signed-off-by: NChristophe Leroy <christophe.leroy@c-s.fr>
      Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      41017a75
  2. 09 7月, 2016 1 次提交
    • C
      powerpc/8xx: Fix vaddr for IMMR early remap · f86ef74e
      Christophe Leroy 提交于
      Memory: 124428K/131072K available (3748K kernel code, 188K rwdata,
      648K rodata, 508K init, 290K bss, 6644K reserved)
      Kernel virtual memory layout:
        * 0xfffdf000..0xfffff000  : fixmap
        * 0xfde00000..0xfe000000  : consistent mem
        * 0xfddf6000..0xfde00000  : early ioremap
        * 0xc9000000..0xfddf6000  : vmalloc & ioremap
      SLUB: HWalign=16, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
      
      Today, IMMR is mapped 1:1 at startup
      
      Mapping IMMR 1:1 is just wrong because it may overlap with another
      area. On most mpc8xx boards it is OK as IMMR is set to 0xff000000
      but for instance on EP88xC board, IMMR is at 0xfa200000 which
      overlaps with VM ioremap area
      
      This patch fixes the virtual address for remapping IMMR with the fixmap
      regardless of the value of IMMR.
      
      The size of IMMR area is 256kbytes (CPM at offset 0, security engine
      at offset 128k) so a 512k page is enough
      Signed-off-by: NChristophe Leroy <christophe.leroy@c-s.fr>
      Signed-off-by: NScott Wood <oss@buserror.net>
      f86ef74e
  3. 30 3月, 2016 1 次提交
    • L
      powerpc: cpm_common: use gpiochip data pointer · a14a2d48
      Linus Walleij 提交于
      This makes the driver use the data pointer added to the gpio_chip
      to store a pointer to the state container instead of relying on
      container_of().
      
      Cc: Anatolij Gustschin <agust@denx.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      a14a2d48
  4. 23 12月, 2015 3 次提交
  5. 28 10月, 2015 1 次提交
  6. 08 8月, 2015 1 次提交
  7. 10 10月, 2013 1 次提交
    • R
      powerpc: add explicit OF includes · 26a2056e
      Rob Herring 提交于
      When removing prom.h include by of.h, several OF headers will no longer
      be implicitly included. Add explicit includes of of_*.h as needed.
      Signed-off-by: NRob Herring <rob.herring@calxeda.com>
      Acked-by: NGrant Likely <grant.likely@linaro.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Anatolij Gustschin <agust@denx.de>
      Cc: Kumar Gala <galak@kernel.crashing.org>
      Cc: Olof Johansson <olof@lixom.net>
      Cc: linuxppc-dev@lists.ozlabs.org
      26a2056e
  8. 29 3月, 2012 1 次提交
  9. 01 11月, 2011 1 次提交
  10. 23 10月, 2011 1 次提交
  11. 10 6月, 2011 1 次提交
  12. 06 7月, 2010 2 次提交
    • A
      of/gpio: add default of_xlate function if device has a node pointer · 391c970c
      Anton Vorontsov 提交于
      Implement generic OF gpio hooks and thus make device-enabled GPIO chips
      (i.e.  the ones that have gpio_chip->dev specified) automatically attach
      to the OpenFirmware subsystem.  Which means that now we can handle I2C and
      SPI GPIO chips almost* transparently.
      
      * "Almost" because some chips still require platform data, and for these
        chips OF-glue is still needed, though with this change the glue will
        be much smaller.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: Bill Gatliff <bgat@billgatliff.com>
      Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Jean Delvare <khali@linux-fr.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      CC: linux-kernel@vger.kernel.org
      CC: devicetree-discuss@lists.ozlabs.org
      391c970c
    • A
      of/gpio: Kill of_gpio_chip and add members directly to gpio_chip · a19e3da5
      Anton Vorontsov 提交于
      The OF gpio infrastructure is great for describing GPIO connections within
      the device tree.  However, using a GPIO binding still requires changes to
      the gpio controller just to add an of_gpio structure.  In most cases, the
      gpio controller doesn't actually need any special support and the simple
      OF gpio mapping function is more than sufficient.  Additional, the current
      scheme of using of_gpio_chip requires a convoluted scheme to maintain
      1:1 mappings between of_gpio_chip and gpio_chip instances.
      
      If the struct of_gpio_chip data members were moved into struct gpio_chip,
      then it would simplify the processing of OF gpio bindings, and it would
      make it trivial to use device tree OF connections on existing gpiolib
      controller drivers.
      
      This patch eliminates the of_gpio_chip structure and moves the relevant
      fields into struct gpio_chip (conditional on CONFIG_OF_GPIO).  This move
      simplifies the existing code and prepares for adding automatic device tree
      support to existing drivers.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Anton Vorontsov <avorontsov@ru.mvista.com>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: Bill Gatliff <bgat@billgatliff.com>
      Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Jean Delvare <khali@linux-fr.org>
      a19e3da5
  13. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  14. 12 11月, 2009 1 次提交
  15. 24 3月, 2009 1 次提交
    • B
      powerpc/mm: Tweak PTE bit combination definitions · 8d1cf34e
      Benjamin Herrenschmidt 提交于
      This patch tweaks the way some PTE bit combinations are defined, in such a
      way that the 32 and 64-bit variant become almost identical and that will
      make it easier to bring in a new common pte-* file for the new variant
      of the Book3-E support.
      
      The combination of bits defining access to kernel pages are now clearly
      separated from the combination used by userspace and the core VM. The
      resulting generated code should remain identical unless I made a mistake.
      
      Note: While at it, I removed a non-sensical statement related to CONFIG_KGDB
      in ppc_mmu_32.c which could cause kernel mappings to be user accessible when
      that option is enabled. Probably something that bitrot.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      8d1cf34e
  16. 21 8月, 2008 1 次提交
  17. 28 7月, 2008 1 次提交
  18. 14 7月, 2008 1 次提交
  19. 11 6月, 2008 1 次提交
    • A
      powerpc/QE: switch to the cpm_muram implementation · 5093bb96
      Anton Vorontsov 提交于
      This is very trivial patch. We're transitioning to the cpm_muram_*
      calls. That's it.
      
      Less trivial changes:
      - BD_SC_* defines were defined in the cpm.h and qe.h, so to avoid redefines
        we remove BD_SC from the qe.h and use cpm.h along with cpm_muram_*
        prototypes;
      - qe_muram_dump was unused and thus removed;
      - added some code to the cpm_common.c to support legacy QE bindings
        (data-only node name).
      - For convenience, define qe_* calls to cpm_*. So drivers need not to be
        changed.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      5093bb96
  20. 17 4月, 2008 1 次提交
  21. 09 11月, 2007 1 次提交
  22. 05 10月, 2007 1 次提交
    • S
      [POWERPC] cpm: Describe multi-user ram in its own device node. · 15f8c604
      Scott Wood 提交于
      The way the current CPM binding describes available multi-user (a.k.a.
      dual-ported) RAM doesn't work well when there are multiple free regions,
      and it doesn't work at all if the region doesn't begin at the start of
      the muram area (as the hardware needs to be programmed with offsets into
      this area).  The latter situation can happen with SMC UARTs on CPM2, as its
      parameter RAM is relocatable, u-boot puts it at zero, and the kernel doesn't
      support moving it.
      
      It is now described with a muram node, similar to QE.  The current CPM
      binding is sufficiently recent (i.e. never appeared in an official release)
      that compatibility with existing device trees is not an issue.
      
      The code supporting the new binding is shared between cpm1 and cpm2, rather
      than remain separated.  QE should be able to use this code as well, once
      minor fixes are made to its device trees.
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      15f8c604
  23. 04 10月, 2007 1 次提交