1. 19 8月, 2015 1 次提交
    • G
      powerpc/512x: silence a USB Kconfig dependency warning · acf6cec8
      Gerhard Sittig 提交于
      the PPC_MPC512x config automatically selected USB_EHCI_BIG_ENDIAN_*
      switches, which made Kconfig warn about "unmet direct dependencies":
      
        scripts/kconfig/conf --silentoldconfig Kconfig
        warning: (PPC_MPC512x && 440EPX) selects USB_EHCI_BIG_ENDIAN_DESC which has unmet direct dependencies (USB_SUPPORT && USB && USB_EHCI_HCD)
        warning: (PPC_MPC512x && PPC_PS3 && PPC_CELLEB && 440EPX) selects USB_EHCI_BIG_ENDIAN_MMIO which has unmet direct dependencies (USB_SUPPORT && USB && USB_EHCI_HCD)
        warning: (PPC_MPC512x && 440EPX) selects USB_EHCI_BIG_ENDIAN_DESC which has unmet direct dependencies (USB_SUPPORT && USB && USB_EHCI_HCD)
        warning: (PPC_MPC512x && PPC_PS3 && PPC_CELLEB && 440EPX) selects USB_EHCI_BIG_ENDIAN_MMIO which has unmet direct dependencies (USB_SUPPORT && USB && USB_EHCI_HCD)
      
      make the selected entries additionally depend on USB_EHCI_HCD which
      silences the warning
      Signed-off-by: NGerhard Sittig <gsi@denx.de>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      acf6cec8
  2. 21 1月, 2015 1 次提交
  3. 10 11月, 2014 1 次提交
  4. 25 9月, 2014 1 次提交
  5. 13 1月, 2014 8 次提交
    • G
      powerpc/512x: clk: support MPC5121/5123/5125 SoC variants · 319bbe0e
      Gerhard Sittig 提交于
      improve the common clock support code for MPC512x
      
      - expand the CCM register set declaration with MPC5125 related registers
        (which reside in the previously "reserved" area)
      - tell the MPC5121, MPC5123, and MPC5125 SoC variants apart, and derive
        the availability of components and their clocks from the detected SoC
        (MBX, AXE, VIU, SPDIF, PATA, SATA, PCI, second FEC, second SDHC,
        number of PSC components, type of NAND flash controller,
        interpretation of the CPMF bitfield, PSC/CAN mux0 stage input clocks,
        output clocks on SoC pins)
      - add backwards compatibility (allow operation against a device tree
        which lacks clock related specs) for MPC5125 FECs, too
      
      telling SoC variants apart and adjusting the clock tree's generation
      occurs at runtime, a common generic binary supports all of the chips
      
      the MPC5125 approach to the NFC clock (one register with two counters
      for the high and low periods of the clock) is not implemented, as there
      are no users and there is no common implementation which supports this
      kind of clock -- the new implementation would be unused and could not
      get verified, so it shall wait until there is demand
      Signed-off-by: NGerhard Sittig <gsi@denx.de>
      Acked-by: NMike Turquette <mturquette@linaro.org>
      Signed-off-by: NAnatolij Gustschin <agust@denx.de>
      319bbe0e
    • G
      powerpc/512x: clk: enforce even SDHC divider values · 76922ebb
      Gerhard Sittig 提交于
      the SDHC clock is derived from CSB with a fractional divider which can
      address "quarters"; the implementation multiplies CSB by 4 and divides
      it by the (integer) divider value
      
      a bug in the clock domain synchronisation requires that only even
      divider values get setup; we achieve this by
      - multiplying CSB by 2 only instead of 4
      - registering with CCF the divider's bit field without bit0
      - the divider's lowest bit remains clear as this is the reset value
        and later operations won't touch it
      
      this change keeps fully utilizing common clock primitives (needs no
      additional support logic, and avoids an excessive divider table) and
      satisfies the hardware's constraint of only supporting even divider
      values
      Signed-off-by: NGerhard Sittig <gsi@denx.de>
      Acked-by: NMike Turquette <mturquette@linaro.org>
      Signed-off-by: NAnatolij Gustschin <agust@denx.de>
      76922ebb
    • G
      powerpc/512x: clk: minor comment updates · 2a2b9ff8
      Gerhard Sittig 提交于
      adjust (expand on or move) a few comments,
      add markers for easier navigation around helpers
      Signed-off-by: NGerhard Sittig <gsi@denx.de>
      Acked-by: NMike Turquette <mturquette@linaro.org>
      Signed-off-by: NAnatolij Gustschin <agust@denx.de>
      2a2b9ff8
    • G
      clk: mpc512x: remove migration support workarounds · 20755f85
      Gerhard Sittig 提交于
      this change removes workarounds which have become obsolete after
      migration to common clock support has completed
      - remove clkdev registration calls (compatibility clock item aliases)
        after all peripheral drivers were adjusted for device tree based
        clock lookup
      - remove pre-enable workarounds after all peripheral drivers were
        adjusted to acquire their respective clock items
      
      workarounds for these clock items get removed:  FEC (ethernet), I2C,
      PSC (UART, SPI), PSC FIFO, USB, NFC (NAND flash), VIU (video capture),
      BDLC (CAN), CAN MCLK, DIU (video output)
      
      these clkdev registered names won't be provided any longer by the
      MPC512x platform's clock driver:  "psc%d_mclk", "mscan%d_mclk",
      "usb%d_clk", "nfc_clk", "viu_clk", "sys_clk", "ref_clk"
      
      the pre-enable workaround for PCI remains, but depends on the presence
      of PCI related device tree nodes (disables the PCI clock in the absence
      of PCI nodes, keeps the PCI clock enabled in the presence of nodes) --
      moving clock acquisition into the peripheral driver isn't possible for
      PCI because its initialization takes place before the platform clock
      driver gets initialized, thus the clock provider isn't available then
      
      Cc: Mike Turquette <mturquette@linaro.org>
      Cc: Anatolij Gustschin <agust@denx.de>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Signed-off-by: NGerhard Sittig <gsi@denx.de>
      Signed-off-by: NAnatolij Gustschin <agust@denx.de>
      20755f85
    • G
      powerpc/mpc512x: improve DIU related clock setup · ba218127
      Gerhard Sittig 提交于
      adapt the DIU clock initialization to the COMMON_CLK approach:
      device tree based clock lookup, prepare and unprepare for clocks,
      work with frequencies not dividers, call the appropriate clk_*()
      routines and don't access CCM registers
      
      the "best clock" determination now completely relies on the
      platform's clock driver to pick a frequency close to what the
      caller requests, and merely checks whether the desired frequency
      was met (fits the tolerance of the monitor)
      
      this approach shall succeed upon first try in the usual case,
      will test a few less desirable yet acceptable frequencies in
      edge cases, and will fallback to "best effort" if none of the
      previously tried frequencies pass the test
      
      provide a fallback clock lookup approach in case the OF based clock
      lookup for the DIU fails, this allows for successful operation in
      the presence of an outdated device tree which lacks clock specs
      
      Cc: Anatolij Gustschin <agust@denx.de>
      Cc: linuxppc-dev@lists.ozlabs.org
      Signed-off-by: NGerhard Sittig <gsi@denx.de>
      Signed-off-by: NAnatolij Gustschin <agust@denx.de>
      ba218127
    • G
      clk: mpc5xxx: switch to COMMON_CLK, retire PPC_CLOCK · 7d71d5b2
      Gerhard Sittig 提交于
      the setup before the change was
      - arch/powerpc/Kconfig had the PPC_CLOCK option, off by default
      - depending on the PPC_CLOCK option the arch/powerpc/kernel/clock.c file
        was built, which implements the clk.h API but always returns -ENOSYS
        unless a platform registers specific callbacks
      - the MPC52xx platform selected PPC_CLOCK but did not register any
        callbacks, thus all clk.h API calls keep resulting in -ENOSYS errors
        (which is OK, all peripheral drivers deal with the situation)
      - the MPC512x platform selected PPC_CLOCK and registered specific
        callbacks implemented in arch/powerpc/platforms/512x/clock.c, thus
        provided real support for the clock API
      - no other powerpc platform did select PPC_CLOCK
      
      the situation after the change is
      - the MPC512x platform implements the COMMON_CLK interface, and thus the
        PPC_CLOCK approach in arch/powerpc/platforms/512x/clock.c has become
        obsolete
      - the MPC52xx platform still lacks genuine support for the clk.h API
        while this is not a change against the previous situation (the error
        code returned from COMMON_CLK stubs differs but every call still
        results in an error)
      - with all references gone, the arch/powerpc/kernel/clock.c wrapper and
        the PPC_CLOCK option have become obsolete, as did the clk_interface.h
        header file
      
      the switch from PPC_CLOCK to COMMON_CLK is done for all platforms within
      the same commit such that multiplatform kernels (the combination of 512x
      and 52xx within one executable) keep working
      
      Cc: Mike Turquette <mturquette@linaro.org>
      Cc: Anatolij Gustschin <agust@denx.de>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Signed-off-by: NGerhard Sittig <gsi@denx.de>
      Signed-off-by: NAnatolij Gustschin <agust@denx.de>
      7d71d5b2
    • G
      clk: mpc512x: add backwards compat to the CCF code · 01f25c37
      Gerhard Sittig 提交于
      extend the recently added COMMON_CLK platform support for MPC512x such
      that it works with incomplete device tree data which lacks clock specs
      
      Cc: Mike Turquette <mturquette@linaro.org>
      Cc: Anatolij Gustschin <agust@denx.de>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Signed-off-by: NGerhard Sittig <gsi@denx.de>
      [agust@denx.de: moved node macro definitions out of the function body]
      Signed-off-by: NAnatolij Gustschin <agust@denx.de>
      01f25c37
    • G
      clk: mpc512x: introduce COMMON_CLK for MPC512x (disabled) · 6d8cdb68
      Gerhard Sittig 提交于
      this change implements a clock driver for the MPC512x PowerPC platform
      which follows the COMMON_CLK approach and uses common clock drivers
      shared with other platforms
      
      this driver implements the publicly announced set of clocks (those
      listed in the dt-bindings header file), as well as generates additional
      'struct clk' items where the SoC hardware cannot easily get mapped to
      the common primitives (shared code) of the clock API, or requires
      "intermediate clock nodes" to represent clocks that have both gates and
      dividers
      
      the previous PPC_CLOCK implementation is kept in place and remains
      active for the moment, the newly introduced CCF clock driver will
      receive additional support for backwards compatibility in a subsequent
      patch before it gets enabled and will replace the PPC_CLOCK approach
      
      some of the clock items get pre-enabled in the clock driver to not have
      them automatically disabled by the underlying clock subsystem because of
      their being unused -- this approach is desirable because
      - some of the clocks are useful to have for diagnostics and information
        despite their not getting claimed by any drivers (CPU, internal and
        external RAM, internal busses, boot media)
      - some of the clocks aren't claimed by their peripheral drivers yet,
        either because of missing driver support or because device tree specs
        aren't available yet (but the workarounds will get removed as the
        drivers get adjusted and the device tree provides the clock specs)
      
      clkdev registration provides "alias names" for few clock items
      - to not break those peripheral drivers which encode their component
        index into the name that is used for clock lookup (UART, SPI, USB)
      - to not break those drivers which use names for the clock lookup which
        were encoded in the previous PPC_CLOCK implementation (NFC, VIU, CAN)
      this workaround will get removed as these drivers get adjusted after
      device tree based clock lookup has become available
      
      the COMMON_CLK implementation copes with device trees which lack an
      oscillator node (backwards compat), the REF clock is then derived from
      the IPS bus frequency and multiplier values fetched from hardware
      
      Cc: Mike Turquette <mturquette@linaro.org>
      Cc: Anatolij Gustschin <agust@denx.de>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Signed-off-by: NGerhard Sittig <gsi@denx.de>
      Signed-off-by: NAnatolij Gustschin <agust@denx.de>
      6d8cdb68
  6. 31 10月, 2013 2 次提交
    • B
      powerpc/mpc512x: remove unnecessary #if · 7e198197
      Brian Norris 提交于
      Several functions are only ever referenced locally, so make them static.
      Of those functions, many of them are protected by an #if. However, the
      code which can compile fine in either case.
      
      Now that (1) the unneeded code is marked 'static' and (2) the code is
      only used under a C 'if (IS_ENABLED(CONFIG_FB_FSL_DIU))', the compiler
      can automatically remove the unneeded code, and we don't need the #if or
      the empty stub functions.
      Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
      Signed-off-by: NAnatolij Gustschin <agust@denx.de>
      7e198197
    • G
      powerpc/mpc512x: silence build warning upon disabled DIU · 45d20e83
      Gerhard Sittig 提交于
      a disabled Kconfig option results in a reference to a not implemented
      routine when the IS_ENABLED() macro is used for both conditional
      implementation of the routine as well as a C language source code test
      at the call site -- the "if (0) func();" construct only gets eliminated
      later by the optimizer, while the compiler already has emitted its
      warning about "func()" being undeclared
      
      provide an empty implementation for the mpc512x_setup_diu() and
      mpc512x_init_diu() routines in case of the disabled option, to avoid the
      compiler warning which is considered fatal and breaks compilation
      
      the bug appeared with commit 2abbbb63
      "powerpc/mpc512x: move common code to shared.c file", how to reproduce:
      
        make mpc512x_defconfig
        echo CONFIG_FB_FSL_DIU=n >> .config && make olddefconfig
        make
      
          CC      arch/powerpc/platforms/512x/mpc512x_shared.o
        .../arch/powerpc/platforms/512x/mpc512x_shared.c: In function 'mpc512x_init_early':
        .../arch/powerpc/platforms/512x/mpc512x_shared.c:456:3: error: implicit declaration of function 'mpc512x_init_diu' [-Werror=implicit-function-declaration]
        .../arch/powerpc/platforms/512x/mpc512x_shared.c: In function 'mpc512x_setup_arch':
        .../arch/powerpc/platforms/512x/mpc512x_shared.c:469:3: error: implicit declaration of function 'mpc512x_setup_diu' [-Werror=implicit-function-declaration]
        cc1: all warnings being treated as errors
        make[4]: *** [arch/powerpc/platforms/512x/mpc512x_shared.o] Error 1
      Signed-off-by: NGerhard Sittig <gsi@denx.de>
      CC: <stable@vger.kernel.org> # v3.11
      Signed-off-by: NAnatolij Gustschin <agust@denx.de>
      45d20e83
  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. 25 6月, 2013 1 次提交
  9. 21 5月, 2013 2 次提交
    • G
      powerpc/mpc512x: initialize board restart earlier · a4f4124c
      Gerhard Sittig 提交于
      move the MPC512x restart initialization from the shared init routine
      to the shared init_early routine
      
      recent problems in the proc(5) filesystem initialization led to the
      situation where the platform's restart routine was invoked yet the
      registers required for software reset were not yet available, which
      made the board hang instead of reboot
      Signed-off-by: NGerhard Sittig <gsi@denx.de>
      Signed-off-by: NAnatolij Gustschin <agust@denx.de>
      a4f4124c
    • G
      powerpc/mpc512x: move common code to shared.c file · 2abbbb63
      Gerhard Sittig 提交于
      - implement all of the init, init early, and setup arch routines in the
        shared source file for the MPC512x PowerPC platform, and make all
        MPC512x based boards (ADS, PDM, generic) use those common routines
      - remove declarations from header files for routines which aren't
        referenced from external callers any longer
      
      this modification concentrates knowledge about the optional FSL DIU
      support in one spot within the shared code, and makes all boards benefit
      transparently from future improvements in the shared platform code
      
      the change does not modify any behaviour but preserves all code paths
      Signed-off-by: NGerhard Sittig <gsi@denx.de>
      Signed-off-by: NAnatolij Gustschin <agust@denx.de>
      2abbbb63
  10. 30 4月, 2013 1 次提交
  11. 11 4月, 2013 2 次提交
  12. 10 4月, 2013 1 次提交
  13. 01 4月, 2013 2 次提交
  14. 16 2月, 2013 1 次提交
  15. 05 2月, 2013 3 次提交
  16. 29 1月, 2013 1 次提交
  17. 16 1月, 2013 2 次提交
  18. 04 12月, 2012 1 次提交
  19. 06 10月, 2012 1 次提交
  20. 10 9月, 2012 2 次提交
    • P
      powerpc: Option FB_FSL_DIU is not really optional for mpc512x · 12e36309
      Paul Gortmaker 提交于
      In powerpc randconfig builds, this keeps showing up:
      
        CC      arch/powerpc/platforms/512x/mpc512x_shared.o
      arch/powerpc/platforms/512x/mpc512x_shared.c:70:9: warning: 'enum fsl_diu_monitor_port' declared inside parameter list
      arch/powerpc/platforms/512x/mpc512x_shared.c:70:9: warning: its scope is only this definition or declaration, which is probably not what you want
      arch/powerpc/platforms/512x/mpc512x_shared.c:69:56: error: parameter 1 ('port') has incomplete type
      arch/powerpc/platforms/512x/mpc512x_shared.c:69:5: warning: function declaration isn't a prototype
      arch/powerpc/platforms/512x/mpc512x_shared.c:84:9: warning: 'enum fsl_diu_monitor_port' declared inside parameter list
      arch/powerpc/platforms/512x/mpc512x_shared.c:83:56: error: parameter 1 ('port') has incomplete type
      arch/powerpc/platforms/512x/mpc512x_shared.c:83:6: warning: function declaration isn't a prototype
      arch/powerpc/platforms/512x/mpc512x_shared.c:88:36: warning: 'enum fsl_diu_monitor_port' declared inside parameter list
      arch/powerpc/platforms/512x/mpc512x_shared.c:88:57: error: parameter 1 ('port') has incomplete type
      arch/powerpc/platforms/512x/mpc512x_shared.c:88:6: warning: function declaration isn't a prototype
      arch/powerpc/platforms/512x/mpc512x_shared.c:187:54: error: parameter 1 ('port') has incomplete type
      arch/powerpc/platforms/512x/mpc512x_shared.c:187:1: error: return type is an incomplete type
      arch/powerpc/platforms/512x/mpc512x_shared.c:187:1: warning: function declaration isn't a prototype
      arch/powerpc/platforms/512x/mpc512x_shared.c: In function 'mpc512x_valid_monitor_port':
      arch/powerpc/platforms/512x/mpc512x_shared.c:189:9: error: 'FSL_DIU_PORT_DVI' undeclared (first use in this function)
      arch/powerpc/platforms/512x/mpc512x_shared.c:189:9: note: each undeclared identifier is reported only once for each function it appears in
      arch/powerpc/platforms/512x/mpc512x_shared.c:189:2: warning: 'return' with a value, in function returning void
      make[2]: *** [arch/powerpc/platforms/512x/mpc512x_shared.o] Error 1
      
      The reason is that mpc512x_shared.c has a couple token #ifdef
      on FB_FSL_DIU/FB_FSL_DIU_MODULE, but they don't come close to
      masking all the DIU dependencies, as the above fail shows.
      
      Rather than sprinkle more pointless #ifdef in this file, just
      remove the existing two, and make FB_FSL_DIU part of the
      dependency.  The mpc512x_defconfig already has the line
      "CONFIG_FB_FSL_DIU=y" so this change should be zero impact
      on real world configs.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NAnatolij Gustschin <agust@denx.de>
      12e36309
    • R
      powerpc: 512x: Fix mpc5121_clk_get() · fca82646
      Richard Weinberger 提交于
      If try_module_get() fails, mpc5121_clk_get() might return
      a wrong clock.
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      Signed-off-by: NAnatolij Gustschin <agust@denx.de>
      fca82646
  21. 16 2月, 2012 2 次提交
    • G
      irq_domain/powerpc: constify irq_domain_ops · 9f70b8eb
      Grant Likely 提交于
      Make all the irq_domain_ops structures in powerpc 'static const'
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Milton Miller <miltonm@bga.com>
      Tested-by: NOlof Johansson <olof@lixom.net>
      9f70b8eb
    • G
      irq_domain: Replace irq_alloc_host() with revmap-specific initializers · a8db8cf0
      Grant Likely 提交于
      Each revmap type has different arguments for setting up the revmap.
      This patch splits up the generator functions so that each revmap type
      can do its own setup and the user doesn't need to keep track of how
      each revmap type handles the arguments.
      
      This patch also adds a host_data argument to the generators.  There are
      cases where the host_data pointer will be needed before the function returns.
      ie. the legacy map calls the .map callback for each irq before returning.
      
      v2: - Add void *host_data argument to irq_domain_add_*() functions
          - fixed failure to compile
          - Moved IRQ_DOMAIN_MAP_* defines into irqdomain.c
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Milton Miller <miltonm@bga.com>
      Tested-by: NOlof Johansson <olof@lixom.net>
      a8db8cf0
  22. 15 2月, 2012 1 次提交
    • G
      irq_domain/powerpc: Use common irq_domain structure instead of irq_host · bae1d8f1
      Grant Likely 提交于
      This patch drops the powerpc-specific irq_host structures and uses the common
      irq_domain strucutres defined in linux/irqdomain.h.  It also fixes all
      the users to use the new structure names.
      
      Renaming irq_host to irq_domain has been discussed for a long time, and this
      patch is a step in the process of generalizing the powerpc virq code to be
      usable by all architecture.
      
      An astute reader will notice that this patch actually removes the irq_host
      structure instead of renaming it.  This is because the irq_domain structure
      already exists in include/linux/irqdomain.h and has the needed data members.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Milton Miller <miltonm@bga.com>
      Tested-by: NOlof Johansson <olof@lixom.net>
      bae1d8f1
  23. 14 11月, 2011 1 次提交
  24. 01 11月, 2011 1 次提交