1. 28 9月, 2016 27 次提交
    • S
      ARM: tegra: flush caches via SMC call · 8e5d804f
      Stephen Warren 提交于
      On Tegra186, it is necessary to perform an SMC to fully flush all caches;
      flushing/cleaning by set/way is not enough. Implement the required hook
      to make this happen.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      Signed-off-by: NTom Warren <twarren@nvidia.com>
      8e5d804f
    • S
      ARM: tegra: fix ULPI PHY on Ventana and Seaboard · 6dca554f
      Stephen Warren 提交于
      Commit ce02a71c "tegra: dts: Sync tegra20 device tree files with
      Linux" enabled the ULPI USB port on Ventana, but made no attempt to ensure
      that U-Boot code could handle this. In practice, various code is missing,
      and various configuration options are not enabled, which causes U-Boot to
      hang when attempting to initialize this USB port. This patch enables ULPI
      PHY support on Ventana, and adds the required pinmux setup for the port to
      operate. Note that Ventana is so similar to Seaboard that this change is
      made in the Seaboard board file, which is shared with Ventana.
      
      Seaboard also has the ULPI USB port wired up in hardware, although to an
      internal port that often doesn't have anything attached to it. However,
      the DT nodes for the USB controller and PHY had different status property
      values, so the port was not initialized by U-Boot. Fix this inconsistency,
      and enable the ULPI port, just like in the Linux kernel DT. This likewise
      requires enabling ULPI support in the Seaboard defconfig.
      
      Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      Signed-off-by: NTom Warren <twarren@nvidia.com>
      6dca554f
    • S
      ARM: tegra: fix USB controller aliases · 002ddbff
      Stephen Warren 提交于
      Some boards have a different set of USB controllers enabled in DT than
      the set referenced by /alias entries. This patch fixes that. For
      example, this avoids the following message while booting on Ventana,
      which is caused by the fact that the USB0 controller had no alias, and
      defaulted to wanting a sequence number of 0, which was later explicitly
      requested by the alias for USB controller 2.
      
      USB2:   Device 'usb@c5008000': seq 0 is in use by 'usb@c5000000'
      
      This didn't affect USB operation in any way though.
      
      Related, there's no need for the USB controller aliases to have an order
      that's different from the HW order, so re-order any aliases to match the
      HW ordering. This has the benefit that since USB controller 0 is the only
      one that supports device-mode in HW, and U-Boot only supports enabling
      device move on controller 0, there's now good synergy in the ordering! For
      Tegra20, that's not relevant at present since USB device mode doesn't work
      correctly on that SoC, but it will save some head-scratching later.
      
      This patch doesn't fix the colibri_t20 board, even though it has the same
      issue, since Marcel already sent a patch for that.
      
      Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      Signed-off-by: NTom Warren <twarren@nvidia.com>
      Tested-by: NMarcel Ziswiler <marcel.ziswiler@toradex.com>
      Tested-on: Harmony and Ventana
      002ddbff
    • S
      ARM: tegra: fix USB ULPI PHY reset signal inversion confusion · 2f6a7e8c
      Stephen Warren 提交于
      USB ULPI PHY reset signals are typically active low. Consequently, they
      should be marked as GPIO_ACTIVE_LOW in device tree, and indeed they are in
      the Linux kernel DTs, and in DT properties that U-Boot doesn't yet use.
      However, in DT properties that U-Boot does use, the value has been set to
      0 (== GPIO_ACTIVE_HIGH) to work around a bug in U-Boot.
      
      This change fixes the DT to correctly represent the HW, and fixes the
      Tegra USB driver to cope with the fact that dm_gpio_set_value() internally
      handles any inversions implied by the DT value GPIO_ACTIVE_LOW.
      
      Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      Signed-off-by: NTom Warren <twarren@nvidia.com>
      2f6a7e8c
    • S
      i2c: tegra: only use new clock/reset APIs · fc607d9a
      Stephen Warren 提交于
      Now that the standard clock/reset APIs are available for all Tegra SoCs,
      convert the I2C driver to use them exclusively, and remove any references
      to the custom Tegra-specific APIs.
      
      Cc: Heiko Schocher <hs@denx.de>
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NTom Warren <twarren@nvidia.com>
      fc607d9a
    • S
      mmc: tegra: only use new clock/reset APIs · e8adca9e
      Stephen Warren 提交于
      Now that the standard clock/reset APIs are available for all Tegra SoCs,
      convert the MMC driver to use them exclusively, and remove any references
      to the custom Tegra-specific APIs.
      
      Cc: Jaehoon Chung <jh80.chung@samsung.com>
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NTom Warren <twarren@nvidia.com>
      e8adca9e
    • S
      ARM: tegra: enable standard clock/reset APIs everywhere · 140a9eaf
      Stephen Warren 提交于
      Implementations of the standard clock and reset APIs are available on all
      Tegra SoCs now, so enable compilation of those uclasses.
      
      Enable the Tegra CAR drivers for all SoCs prior to the BPMP being
      available. This provides an implementation of those APIs everywhere.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NTom Warren <twarren@nvidia.com>
      140a9eaf
    • S
      ARM: tegra: fix clock_get_periph_rate() for UART clocks · 74686766
      Stephen Warren 提交于
      Make clock_get_periph_rate() return the correct value for UART clocks.
      
      This change needs to be applied before the patches that enable CONFIG_CLK
      for Tegra SoCs before Tegra186, since enabling that option causes
      ns16550_serial_ofdata_to_platdata() to rely on clk_get_rate() for UART
      clocks, and clk_get_rate() eventually calls clock_get_periph_rate().
      
      This change is a rather horrible hack, as explained in the comment added
      to the clock driver. I've tried fixing this correctly for all clocks as
      described in that comment, but there's too much fallout elsewhere. I
      believe the clock driver has a number of bugs which all cancel each-other
      out, and unravelling that chain is too complex at present. This change is
      the smallest change that fixes clock_get_periph_rate() for UART clocks
      while guaranteeing no change in behaviour for any other clock, which
      avoids other regressions.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      Signed-off-by: NTom Warren <twarren@nvidia.com>
      74686766
    • S
      clock: implement a driver for the Tegra CAR · 4a332d3e
      Stephen Warren 提交于
      Implement a clock uclass driver for the Tegra CAR. This allows clients to
      use standard clock APIs on Tegra. This device is intended to be
      instantiated by the core Tegra CAR driver, rather than being instantiated
      directly from DT. The implementation uses the existing custom Tegra-
      specific clock APIs to avoid coupling the series with significant
      refactoring of the existing Tegra clock/clock code. The driver currently
      only supports peripheral clocks, and avoids support for other clocks such
      as PLLs and external clocks. This should be sufficient to convert over all
      Tegra peripheral drivers, and avoids a complex implementation which calls
      different Tegra-specific clock APIs based on the type of clock being
      manipulated.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NTom Warren <twarren@nvidia.com>
      4a332d3e
    • S
      reset: implement a driver for the Tegra CAR · fe60f06d
      Stephen Warren 提交于
      Implement a reset uclass driver for the Tegra CAR. This allows clients to
      use standard reset APIs on Tegra. This device is intended to be
      instantiated by the core Tegra CAR driver, rather than being instantiated
      directly from DT. The implementation uses the existing custom Tegra-
      specific reset APIs to avoid coupling the series with significant
      refactoring of the existing Tegra clock/reset code.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NTom Warren <twarren@nvidia.com>
      fe60f06d
    • S
      misc: implement Tegra CAR core driver · bd3ee84a
      Stephen Warren 提交于
      The Tegra CAR (Clock And Reset) module provides control of most clocks
      and reset signals within the Tegra SoC. This change implements a driver
      for this module. However, since the module implements multiple kinds of
      services (clocks, resets, perhaps more), all this driver does is bind
      various sub-devices, which in turn provide the real services. This driver
      is essentially an "MFD" (Multi-Function Device) in Linux kernel speak.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NTom Warren <twarren@nvidia.com>
      bd3ee84a
    • S
      ARM: tegra: add APIs the clock uclass driver will need · d0ad8a5c
      Stephen Warren 提交于
      A future patch will implement a clock uclass driver for Tegra. That driver
      will call into Tegra's existing clock code to simplify the transition;
      this avoids tieing the clock uclass patches into significant refactoring
      of the existing custom clock API implementation.
      
      Some of the Tegra clock APIs that manipulate peripheral clocks require
      both the peripheral clock ID and parent clock ID to be passed in together.
      However, the clock uclass API does not require any such "parent"
      parameter, so the clock driver must determine this information itself.
      This patch implements new Tegra- specific clock API
      clock_get_periph_parent() for this purpose.
      
      The new API is implemented in the core Tegra clock code rather than SoC-
      specific clock code. The implementation uses various SoC-/clock-specific
      data. That data is only available in SoC-specific clock code.
      Consequently, two new internal APIs are added that enable the core clock
      code to retrieve this information from the SoC-specific clock code. Due to
      the structure of the Tegra clock code, this leads to some unfortunate code
      duplication. However, this situation predates this patch.
      
      Ideally, future work will de-duplicate the Tegra clock code, and migrate
      it into drivers/clk/tegra. However, such refactoring is kept separate from
      this series.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NTom Warren <twarren@nvidia.com>
      d0ad8a5c
    • S
      ARM: tegra: add peripheral clock init table · 6dbcc962
      Stephen Warren 提交于
      Currently, Tegra peripheral drivers control two aspects of their HW module
      clock(s):
      
      1) The clock enable/rate for the peripheral clock itself.
      
      2) The system-level clock tree setup, i.e. the clock parent.
      
      Aspect 1 is reasonable, but aspect 2 is a system-level decision, not
      something that an individual peripheral driver should in general know
      about or influence. Such system-level knowledge ties the driver to a
      specific SoC implementation, even when they use generic APIs for clock
      manipulation, since they must have SoC-specific knowledge such as parent
      clock IDs. Limited exceptions exist, such as where peripheral HW is
      expected to dynamically switch between clock sources at run-time, such
      as CPU clock scaling or display clock conflict management in a multi-head
      scenario.
      
      This patch enhances the Tegra core code to perform system-level clock
      tree setup, in a similar fashion to the Linux kernel Tegra clock driver.
      This will allow future patches to simplify peripheral drivers by removing
      the clock parent setup logic.
      
      This change is required prior to converting peripheral drivers to use the
      standard clock APIs, since:
      
      1) The clock uclass doesn't currently support a set_parent() operation.
      Adding one is possible, but not necessary at the moment.
      
      2) The clock APIs retrieve all clock IDs from device tree, and the DT
      bindings for almost all peripherals only includes information about the
      relevant peripheral clocks, and not any potential parent clocks.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NTom Warren <twarren@nvidia.com>
      6dbcc962
    • S
      ARM: tegra: pull Tegra210 SoC DT from Linux v4.7 · ee562dc3
      Stephen Warren 提交于
      The primary benefit of this change is that it adds all missing clocks and
      resets properties to peripherals. This will allow peripheral drivers to
      migrate to the standard clock and reset APIs in the future.
      
      Main changes:
      * Brought in the correct Tegra210 CAR binding; the old file in U-Boot
        appears to be a renamed version of the Tegra124 bindings rather than
        the real Tegra210 version.
      * Conversion of SPI and UART nodes to standard DMA bindings. U-Boot
        doesn't use DMA so isn't affected.
      * Split of EHCI and USB PHY nodes. The EHCI nodes continue to contain all
        information required by U-Boot, so U-Boot is not affected.
      * Conversion of many magic numbers to named defines.
      * Addition of many nodes not used by U-Boot, including separation of the
        Tegra LIC (Legacy IRQ controller) and GIC.
      * Node sort order fixes.
      
      Remaining deltas relative to the Linux DT:
      * U-Boot has enabled PCIe for Tegra210, but the kernel hasn't yet.
      * The GPIO node compatible value in the kernel explicitly includes
        Tegra124 values whereas U-Boot does not. I'll send a kernel patch to
        correct this.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NTom Warren <twarren@nvidia.com>
      ee562dc3
    • S
      ARM: tegra: pull Tegra124 SoC DT from Linux v4.7 · 3b8c1b3b
      Stephen Warren 提交于
      The primary benefit of this change is that it adds all missing clocks and
      resets properties to peripherals. This will allow peripheral drivers to
      migrate to the standard clock and reset APIs in the future.
      
      Main changes:
      * USB phy_type property is aligned with the kernel, so board files are
        updated so the final DT content doesn't change. I'm not convinved that
        Nyan uses HSIC phy_type. However, I'd rather this change be a no-op,
        and any DT bug-fixes be separate.
      * Sync misc changes from the kernel: missing DT content, minor compatible
        value fixes, typos.
      
      Remaining deltas relative to the Linux DT:
      * U-Boot uses #address-cells/#size-cells of 1 whereas the kernel uses 2.
        I believe U-Boot's DT parsing currently assumes that these values match
        the physical address size, so I didn't synchronize this part of the DT.
      * U-Boot uses the original XUSB PHY DT binding, wherease the kernel DT
        has moved to a newer version. Thus, XUSB client nodes include properties
        names phys and phy-names that do not appear in the kernel, and don't
        include pad definitions in the padctl node.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NTom Warren <twarren@nvidia.com>
      3b8c1b3b
    • S
      ARM: tegra: pull Tegra114 SoC DT from Linux v4.7 · 5c31e7ab
      Stephen Warren 提交于
      The primary benefit of this change is that it adds all missing clocks and
      resets properties to peripherals. This will allow peripheral drivers to
      migrate to the standard clock and reset APIs in the future.
      
      Main changes:
      * Conversion of SPI nodes to standard DMA bindings. U-Boot doesn't use
        DMA so isn't affected.
      * Split of EHCI and USB PHY nodes. The EHCI nodes continue to contain all
        information required by U-Boot, so U-Boot is not affected.
      * Boards need to define the clk32k_in clock that feeds the Tegra PMC.
      * Addition of tegra114-mc.h since tegra114.dtsi now includes it.
      * Conversion of many magic numbers to named defines.
      * Addition of many nodes not used by U-Boot.
      * Node sort order fixes.
      
      Remaining deltas relative to the Linux DT:
      * USB node compatible values in U-Boot explicitly list Tegra114 values
        whereas the kernel does not. I'll send a kernel patch to correct this.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NTom Warren <twarren@nvidia.com>
      5c31e7ab
    • S
      ARM: tegra: pull Tegra30 SoC DT from Linux v4.7 · ce2f2d2a
      Stephen Warren 提交于
      The primary benefit of this change is that it adds all missing clocks and
      resets properties to peripherals. This will allow peripheral drivers to
      migrate to the standard clock and reset APIs in the future.
      
      Main changes:
      * Modification of PCIe memory region addresses. The HW memory layout is
        programmable, so this should work fine, and Beaver PCIe was tested
        without issue.
      * Removal of pcie_xclk from the PCIe node and clock binding header. This
        clock doesn't exist and isn't used; only a reset with this ID exists.
      * Conversion of SPI nodes to standard DMA bindings. U-Boot doesn't use
        DMA so isn't affected.
      * Split of EHCI and USB PHY nodes. The EHCI nodes continue to contain all
        information required by U-Boot, so U-Boot is not affected.
      * Changed the phy_type value for the second USB port. This required board
        DTs to be updated to keep the same configuration.
      * Boards need to define the clk32k_in clock that feeds the Tegra PMC.
      * Addition of tegra30-mc.h since tegra30.dtsi now includes it.
      * Conversion of many magic numbers to named defines.
      * Addition of many nodes not used by U-Boot.
      * Node sort order fixes.
      
      Remaining deltas relative to the Linux DT:
      * None.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NTom Warren <twarren@nvidia.com>
      ce2f2d2a
    • S
      ARM: tegra: pull Tegra20 SoC DT from Linux v4.7 · 50a303bd
      Stephen Warren 提交于
      This brings in a few minor fixes since the last sync. The largest change
      is the removal of the definition for TEGRA20_CLK_PCIE_XCLK. This clock
      doesn't actually exist.
      
      Remaining deltas:
      * Addition of u-boot,dm-pre-reloc property to a couple of nodes.
      * Addition of the NAND controller, which Linux doesn't yet support.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NTom Warren <twarren@nvidia.com>
      50a303bd
    • S
      ARM: tegra: remove "0, " from DT unit addresses · eb631d7f
      Stephen Warren 提交于
      Apparently the unit address in a DT node name is now supposed to be a
      single integer value, rather than a comma-separated list of individual
      cell values. Fix the U-Boot DTs to comply with this naming convention.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NTom Warren <twarren@nvidia.com>
      eb631d7f
    • T
      mmc: tegra: Add DM_MMC support to Tegra MMC driver · 6a474db4
      Tom Warren 提交于
      Convert the Tegra MMC driver to DM_MMC. Support for non-DM is removed
      to avoid ifdefs in the code. DM_MMC is now enabled for all Tegra builds.
      
      Cc: Jaehoon Chung <jh80.chung@samsung.com>
      Signed-off-by: NTom Warren <twarren@nvidia.com>
      (swarren, fixed some NULL pointer dereferences, removed extraneous
      changes, rebased on various other changes, removed non-DM support etc.)
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      6a474db4
    • S
      ARM: tegra: set MMC pin mux in board_init() · c0be77db
      Stephen Warren 提交于
      Most other pin mux is configured in this function. This removes the
      need to do it in an MMC-specific initialization function, which is good
      since that function is going away later in this series.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NTom Warren <twarren@nvidia.com>
      c0be77db
    • S
      mmc: tegra: priv struct and naming cleanup · f53c4e4b
      Stephen Warren 提交于
      struct mmc_host is a Tegra-specific structure, but the name implies it's
      something defined by core MMC code, which is confusing. Rename it to
      struct tegra_mmc_priv to make its purpose more obvious. The new name is
      also more appropriate for a DM driver private data structure, which will
      be relevant later in this series.
      
      Nothing needs access to this type except the MMC driver itself. Move the
      definition into the driver C file.
      
      Make sure all Tegra MMC functions are named tegra_mmc_*. Even though
      they're all static, it's useful to have good naming so that symbol tables
      are easy to interpret. A few functions aren't renamed by this patch since
      they'll be deleted by a subsequent patch in this series.
      
      Cc: Jaehoon Chung <jh80.chung@samsung.com>
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NTom Warren <twarren@nvidia.com>
      f53c4e4b
    • S
      mmc: tegra: don't use periph_id in pad_init_mmc() · 6138d5b6
      Stephen Warren 提交于
      The MMC driver will soon be converted to use standard clock/reset APIs,
      and so the periph_id field in the MMC device priv struct will disappear.
      Rework the implementation of pad_init_mmc() to rely on this; using the
      device register address is a much more direct test anyway.
      
      Cc: Jaehoon Chung <jh80.chung@samsung.com>
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NTom Warren <twarren@nvidia.com>
      6138d5b6
    • S
      mmc: tegra: move pad_init_mmc() into MMC driver · 6b83588e
      Stephen Warren 提交于
      pad_init_mmc() is performing an SoC-specific operation, using registers
      within the MMC controller. There's no reason to implement this code
      outside the MMC driver, so move it inside the driver.
      
      Cc: Jaehoon Chung <jh80.chung@samsung.com>
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NTom Warren <twarren@nvidia.com>
      6b83588e
    • S
      mmc: tegra: use correct alias for SDHCI/MMC nodes · 67748a73
      Stephen Warren 提交于
      The Tegra MMC driver currently honors "sdhci" entries in /aliases. The
      MMC core however uses "mmc" entries in /aliases. This difference will be
      relevant once the Tegra MMC driver is converted to DM, and the MMC core
      handles alias lookups. To avoid issues during that conversion, fix the
      Tegra MMC driver and all Tegra DTs to use the same alias name as the MMC
      core does.
      
      Cc: Jaehoon Chung <jh80.chung@samsung.com>
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      Reviewed-by: NJaehoon Chung <jh80.chung@samsung.com>
      Signed-off-by: NTom Warren <twarren@nvidia.com>
      67748a73
    • T
      ARM: tegra: fdt: Add 'non-removable' property to all eMMC nodes · 9a06a1a3
      Tom Warren 提交于
      During debug of the DM_MMC changes to the Tegra MMC driver, I
      noticed that the 'removable' property wasn't being set correctly
      for the eMMC parts on most Tegra boards. Since the kernel DTS has
      this property set correctly, it should be in U-Boot's Tegra DT too.
      Signed-off-by: NTom Warren <twarren@nvidia.com>
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      9a06a1a3
    • B
      ARM: tegra: increase console buffer size and sys args num · 64a4fe74
      Bryan Wu 提交于
      The Linux-for-Tegra kernel uses a very long command line.
      
      The default value of CONFIG_SYS_CBSIZE is too small to printf out the
      long command line and causes a message like:
        bootarg overflow 602+0+0+1 > 512
      on the console, and the board refuses to boot.
      
      The default value of CONFIG_SYS_MAXARGS is too small to add a long
      long command line, and the kernel won't boot without the complete
      bootargs.
      
      Increasing these two config options solves this problem.
      Signed-off-by: NBryan Wu <pengw@nvidia.com>
      Signed-off-by: NPeter Chubb <Peter.Chubb@data61.csiro.au>
      Acked-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NTom Warren <twarren@nvidia.com>
      64a4fe74
  2. 27 9月, 2016 2 次提交
  3. 26 9月, 2016 11 次提交