Commit Graph

211193 Commits

Author SHA1 Message Date
Colin Cross
df982ed58c i2c: tegra: Remove reset during init 2010-10-06 16:26:49 -07:00
Colin Cross
105220b5a0 i2c: i2c-tegra: Fix warning
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:26:48 -07:00
Colin Cross
1cd4734b9c i2c: i2c-tegra: Fix checkpatch issues, remove debugging
Change-Id: Icba24ebb1753619fcb039cbcf98487627f274744
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:26:47 -07:00
Gary King
67b5a6542f i2c-tegra: add support for virtual busses with dynamic pinmuxing
this adds support for dynamically reprogramming the I2C controller's
pin mux on transaction boundaries to enable one controller to be
registered as multiple I2C bus adapters with the kernel. this allows
platform designers an additional tool to resolve clock rate, I/O
voltage and electrical loading restrictions between the platform's
peripherals.

the i2c-tegra platform data is extended to support this; platforms
which use this feature should pass in the number of busses which
should be created for each controller, the starting adapter number
to use and the clock rate and pin mux for each virtual bus.

Change-Id: I57a96deb7b7b793222ec3f8cc3a941917a023609
Signed-off-by: Gary King <gking@nvidia.com>
2010-10-06 16:26:46 -07:00
Colin Cross
1908b3377d i2c: tegra: Prevent i2c transactions after suspend
The cpufreq driver suspends very late, and may cause an i2c
transaction when the clk api calls the dvfs api, which calls
the regulator api, which calls i2c.  Return an error if an
i2c transaction is requested after suspend has been called.

Change-Id: I4d92eb9c1f558758097e2dafda6fc02addf4e185
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:26:45 -07:00
Colin Cross
80f33a8c5a i2c: busses: i2c-tegra: Set bus speed in platform data
Change-Id: Iebc1ad5cc56d09f1df99d09dd6456c24c93cdb0b
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:26:44 -07:00
Colin Cross
91e3654c23 i2c: busses: i2c-tegra: Fix bus clock rate
Change-Id: I186a7b7474c3d2504e2a4d7c1308706bb1b53004
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:26:43 -07:00
Colin Cross
b9f90a825e [ARM] tegra: i2c: Fix i2c driver behavior on timeout/nack
Change-Id: Ia0968df649fa56d93cf3522d983fde16413e854d
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:26:42 -07:00
Colin Cross
4f46fcca79 [ARM] tegra: i2c: Disable clock when idle, fix dvc
Change-Id: Idca4c392134640f611ccf10edfd28fea102742fb
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:26:41 -07:00
Colin Cross
cb07c1bf90 [ARM] tegra: Add i2c support
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:26:40 -07:00
Erik Gilling
9285c27155 usb: gadget: add utmip phy into to fsl_tegra_udc
Signed-off-by: Erik Gilling <konkers@android.com>
2010-10-06 16:26:39 -07:00
Colin Cross
a8ba61048e [ARM] tegra: HACK Enable uart and clocks in uncompress.h
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:26:38 -07:00
Erik Gilling
4bfc0da441 [ARM] tegra: add platform devices to harmony board file
Signed-off-by: Erik Gilling <konkers@android.com>
2010-10-06 16:26:38 -07:00
Colin Cross
2466e23b7e [ARM] tegra: harmony: Add sdhci devices
Change-Id: I29eab117c3fb237d5178d9fcf065563e656d46f2
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:26:37 -07:00
Colin Cross
8ce033fd1f usb: gadget: fsl_udc: wmb ep_td struct when submitting to controller
Since these get allocated dmacoherent instead of noncacheable in armv7, we need
to do wmb before handing them to hardware.

Change-Id: I413eeb6da3bfeb754c4b475b19fe5823d83d3d04
Signed-off-by: Colin Cross <ccross@android.com>
Cc: Erik Gilling <konkers@android.com>
2010-10-06 16:26:36 -07:00
Erik Gilling
fd9c8bc964 usb: gadget: add preliminary Tegra support to fsl driver
Based on work by Gary King.

Further abstraction of the chipidea core support needs to be done.

Signed-off-by: Colin Cross <ccross@android.com>
Cc: Erik Gilling <konkers@android.com>
Cc: Gary King <GKing@nvidia.com>
2010-10-06 16:26:35 -07:00
Colin Cross
67c83e26d0 [ARM] mtd: NVIDIA Tegra NAND controller driver.
Change-Id: I6f0b18c5621bcf8fb6cde8e7b05828075db72594
CC: Dima Zavin <dima@android.com>
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:26:34 -07:00
Gary King
1994d98dc3 [ARM] tegra: smp: add barrier before raising GIC IPI IRQ
since the GIC registers are device memory and the IPI data is
stored in normal memory, a simple dmb is insufficient to ensure
that the data will be visible to the IPI-receiving processor
prior to the IPI handler running

Change-Id: Idaddd9f225d00ebd3a8d656fa75c401323b80138
Signed-off-by: Gary King <gking@nvidia.com>
2010-10-06 16:26:33 -07:00
Catalin Marinas
0ec7f7e47c Add "nol2x0" early param to avoid initialisation of the L2 controller
Some development platforms may have issues with this controller, so
allow easy disabling from the kernel command line. The patch also adds
a check for l2x0_disabled in the realview_pbx.c code to avoid setting
additional L2x0 registers.

Change-Id: Icbbd3e054688811200a4c96bf7e0a81c9c0ab790
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2010-10-06 16:26:32 -07:00
Colin Cross
771f262864 [ARM] tegra: dma: Fix critical data corruption bugs
Sometimes, due to high interrupt latency in the continuous mode
of DMA transfer, the half buffer complete interrupt is handled
after DMA has transferred the full buffer.  When this is detected,
stop DMA immediately and restart with the next buffer if the next
buffer is ready.

originally fixed by Victor(Weiguo) Pan <wpan@nvidia.com>

In place of using the simple spin_lock()/spi_unlock() in the
interrupt thread, using the spin_lock_irqsave() and
spin_unlock_irqrestore(). The lock is shared between the normal
process context and interrupt context.

originally fixed by Laxman Dewangan (ldewangan@nvidia.com)

The use of shadow registers caused memory corruption at physical
address 0 because the enable bit was not shadowed, and assuming it
needed to be set would enable an unconfigured dma block.  Most of the
register accesses don't need to know the previous state of the
registers, and the few places that do need to modify only a few bits
in the registers are the same ones that were sometimes incorrectly
setting the enable bit.  This patch convert tegra_dma_update_hardware
to set the entire register, and the other users to read-modify-write,
and drops the shadow registers completely.

Also fixes missing locking in tegra_dma_allocate_channel

Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:26:31 -07:00
Colin Cross
087c9f50bf [ARM] tegra: Allow overriding arch_reset
Change-Id: Iba7ab5af149724dae8caab76f044e5b12d6b0436
Signed-off-by: Colin Cross <ccross@google.com>
2010-10-06 16:26:30 -07:00
Colin Cross
bd510a2ba3 [ARM] tegra: cpufreq: Disable cpufreq during suspend
Adds a SUSPEND_PREPARE notification hook to drop the frequency to
the lowest possible during suspend.  This prevents the cpufreq driver
from attempting regulator calls after suspend has started - the
regulator api can call into drivers that have already been suspended.
Also adds 216MHz (off of PLLP) as the lowest CPU frequency, which
allows PLLX to be turned off.

Change-Id: I46a7f88610ce35b6f761a557905861f79bc4df0b
Signed-off-by: Colin Cross <ccross@google.com>
2010-10-06 16:26:29 -07:00
Gary King
4f46b600bf [ARM] tegra: iomap: Add missing devices, fix use of SZ_8
Adds gart, hdmi, and pwm controllers to mach/iomap.h
SZ_* stops at SZ_16; just use a constant value of 8 for the timer
aperture sizes.

Change-Id: I4bbf1ca37b65698f707a277575054610ee6ca445
Signed-off-by: Gary King <gking@nvidia.com>
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:26:29 -07:00
Gary King
3b91a1c38b [ARM] tegra: add CPU_IDLE driver
supports clock-gated (LP3) SMP idle mode, and power-gated (LP2) idle
mode when all slave processors are off-line

latency for LP2 idle state is calculated as a 2-sample weighted moving
average, to allow for future variations due to (e.g.) CPU frequency
scaling.

when LP2 is an allowed state (i.e., slave CPUs have been taken off-line),
LP3 will perform an hrtimer peek-ahead; this avoids waiting for the
first processor tick following an LP2 in order to run expired hrtimers
(which was causing a 1 tick delay for most user-space sleeps)

LP2 wakeup time and latency uses a 2ms hard-coded offset to account for
the CPU powergood timeout; this is reasonable for Harmony but should be
un-hardcoded for other platforms.

Change-Id: I75e36dc14341200ba85da7ef2db8a59cc487ecec
Signed-off-by: Gary King <gking@nvidia.com>
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:26:28 -07:00
Colin Cross
4c053d2fc9 [ARM] tegra: gpio: Add support for waking from suspend
Change-Id: If692ff0e7de3d3d5a825a8b1e7989650ef9fb238
Signed-off-by: Colin Cross <ccross@google.com>
2010-10-06 16:26:27 -07:00
Colin Cross
23a6890fa8 [ARM] tegra: irq: Add set_wake and set_type support for suspend
Change-Id: Ic18e0c92462a590b759752662bd7d67aaf8a371a
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:26:26 -07:00
Gary King
75a8c9a008 [ARM] tegra: Add suspend and hotplug support
LP2 idle mode power-gates the main CPU complex, requiring a
full processor state save and restore from a reset vector

processor context area is allocated during platform initialization
from the kernel, and mapped into the hotplug page tables (which also
serve as the initial page tables for the LP2 main processor reset)

restoring the processor from LP2 requires calculation of a system-
and APB-clock-dependent CPU power good timer value. on Harmony,
2ms is a good baseline value for this, and the APB clock is running at
13.5MHz. these values need to be un-hardcoded for other platforms.

platform-specific data (power good times, PMU capabilities, etc.) must be
specified when registering the suspend operations to ensure that platform
power sequencing restrictions are maintained

since all device interrupts (except timers) are disabled in the suspend
path, the wakeup interrupts need to be manually unmasked before entering
into a suspend state or the processor will never wake up; these forced-unmask
interrupts are re-masked immediately in the resume path to prevent the
kernel from live-locking prior to driver resume.

in both LP0 and LP1, SDRAM is placed into self-refresh. in order to safely
perform this transition, the final shutdown procedure responsible for

  * turning off the MMU and L1 data cache
  * putting memory into self-refresh
  * setting the DDR pads to the lowest power state
  * and turning off PLLs

is copied into IRAM (at the address TEGRA_IRAM_BASE + SZ_4K) at the
start of the suspend process.

in LP1 mode (like LP2), the CPU is reset and executes the code specified
at the EVP reset vector. since SDRAM is in self-refresh, this code must
also be located in IRAM, and it must re-enable DRAM before restoring the
full context. in this implementation, it enables the CPU on PLLP, enables
PLLC and PLLM, restores the SCLK burst policy, and jumps to the LP2 reset
vector to restore the rest of the system (MMU, PLLX, coresite, etc.). the
LP2 reset vector is expected to be found in PMC_SCRATCH1, and is
initialized during system-bootup

in LP0 mode, the core voltage domain is also shutoff. as a result, all
of the volatile state in the core voltage domain (e.g., pinmux registers,
clock registers, etc.) must be saved to memory so that it can be restored
after the system resumes. a limited set of wakeups are available from LP0,
and the correct levels for the wakeups must be programmed into the PMC
wakepad configuration register prior to system shutdown. on resume, the
system resets into the boot ROM, and the boot ROM restores SDRAM and other
system state using values saved during kernel initialization in the PMC
scratch registers.

resuming from LP0 requires the boot ROM to supply a signed recovery codeblob
to the kernel; the kernel expects that the length and address of this blob
is supplied with the lp0_vec= command line argument; if not present, suspend-
to-LP0 will be disabled

for simplicity, the outer cache is shutdown for both LP0 and LP1; it
is possible to optimize the LP1 routine to bypass outer cache shutdown
and restart

to save power, SMP tegra SoCs place non-boot CPUs in reset when they
are removed from the scheduling cluster using CPU hotplug.

slave CPUs save their contexts (incl. CP15 and VFP state) out to a
reserved memory region, cancel SMP operation, and write to the SoC
reset controller to disable themselves. this is done with caches and
MMU enabled, so care is taken to ensure that all the dirty context cache
lines are cleaned out to the PoC before shutting down.

when re-enabled, slave CPUs execute a hotplug boot routine which mirrors
the initial configuration performed by secondary_startup, but after
enabling the MMU "return" to __cortex_a9_restore which restores the
saved state from the context area, and returns to platform_cpu_die.

a local page directory is maintained (initially a copy of init_mm) by
the tegra hotplug code, to ensure that all necessary context data and
text is properly mapped (including 1:1 virtual->physical mappings for
the code which re-enables the MMU); this page table will also be used
for the idle and suspend save and resume routines for the master CPU.

in pseudo-code, the hotplug startup routine is basically:

 * invalidate i-cache, BTAC, TLB, exclusive monitor
 * enable i-cache, branch prediction
 * invalidate d-cache
 * invalidate SCU tags
 * enable SMP
 * setup page tables to tegra_pgd
 * enable MMU & d-cache
 * restore CP15 from context area
 * change page table pointer to context from shutdown
 * restore stack registers
 * return to platform_cpu_die

Includes fixes from:
Scott Williams <scwilliams@nvidia.com>
Aleksandr Frid <afrid@nvidia.com>
Vik Kasivajhula <tkasivajhula@nvidia.com>
Bharat Nihalani (bnihalani@nvidia.com)

Change-Id: I50e6a524696342f946b6117a2d7f019f401c3bbd
Signed-off-by: Gary King <gking@nvidia.com>
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:26:25 -07:00
Gary King
6fe5b81eb2 [ARM] tegra: timer: Add suspend wakeup and 32khz timers
the LP2 idle state can not be woken by the internal ARM timers,
so reserve the last APB system timer for use as an LP2 wakeup
trigger

Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:26:24 -07:00
Gary King
28cd6a1e4f [ARM] tegra: irq: Add support for suspend wake sources
Change-Id: I863c6db6deedd6fce52dc1b912cfdbc8d16f8c55
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:26:23 -07:00
Colin Cross
affda11d6d [ARM] tegra: pinmux: Add missing drive pingroups and fix suspend
Adds missing drive pingroups, saves all drive pingroups in
suspend, and restores the pinmux registers in the proper order.

Change-Id: I17155d86de946f162aa35d369e265504b177624b
Signed-off-by: Gary King <gking@nvidia.com>
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:26:22 -07:00
Colin Cross
d1efad42f3 [ARM] tegra: clock: Suspend fixes, and add new clocks
Save and restore pll and osc state during suspend
Add digital audio clocks
Update clk dev associations
Correct max clock frequencies
Add pll_p as additional cpu clock state
Add values to plld table
Fix register offset for sdmmc4 clock
Add blink timer to tegra2_clocks

Change-Id: I7fa71452c4a6683b586abb0a3906e39e6549d1bc
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:26:21 -07:00
Colin Cross
a5ff370cd0 [ARM] tegra: Add prototypes for subsystem suspend functions
Change-Id: If14c826e8919f5de11331a5c45994fe7e451330a
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:26:20 -07:00
Colin Cross
b7ae0d91b7 [ARM] tegra: irqs: Update irq list
Fixes typo in INT_CPU1_PMU_INTR (original fix from Will Deacon)
Adds board irqs

Change-Id: I46c49ee4f6b8215242314622b59c9621321282f2
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:26:19 -07:00
Colin Cross
460287b77d [ARM] tegra: Add api to control internal powergating
Change-Id: Ibb233ed06ad7f045504822a1ffd57852e50216ee
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:26:18 -07:00
Colin Cross
fdbc75e624 [ARM] tegra: Centralize macros to define debug uart base
Signed-off-by: Colin Cross <ccross@google.com>
2010-10-06 16:26:17 -07:00
Colin Cross
48751f2908 [ARM] gic: Export irq chip functions
Some systems combine the GIC with an external interrupt controller.
On these systems it may be necessary to update both the GIC registers
and the external controller's registers to control IRQ behavior.
Export the irq chip functions so that these systems can define a
custom irq chip that calls into the GIC handlers.

Change-Id: I17fc4440fa2c91cc63004abf69c8e872b55c83c6
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:26:17 -07:00
Colin Cross
cd24a00ad7 [ARM] gic: Add functions to save and restore gic state
on systems with idle states which power-gate the logic including
the gic, such as tegra, the gic distributor needs to be shut down
and restored on entry and exit from the architecture idle code

Change-Id: I17603f5ac70d65c05587d0647cce3ba87675e117
Original-author: Gary King <gking@nvidia.com>
Signed-off-by: Gary King <gking@nvidia.com>
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:26:16 -07:00
Gary King
7fab6bf045 [ARM] cache_l2x0: add shutdown and restart functions
Add shutdown and restart functions to the L2X0 outer cache controller,
so that machines which need to flush and disable the outer cache
controller prior to executing the architecture reset or platform
suspend code can do so.

Change-Id: I042aae121e7ba75223ed502afb4d118b0441597e
Signed-off-by: Gary King <gking@nvidia.com>
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:26:15 -07:00
Gary King
5397d4e30b [ARM] l2x0: add declaration for PREFETCH_OFFSET register
Change-Id: I0fc2aba8b332697533e1396aab2e613bc7179c33
Signed-off-by: Gary King <gking@nvidia.com>
2010-10-04 09:57:24 -07:00
Catalin Marinas
4c8d736fa7 ARM: Improve the L2 cache performance when PL310 is used
With this L2 cache controller, the cache maintenance by PA and sync
operations are atomic and do not require a "wait" loop or spinlocks.
This patch conditionally defines the cache_wait() function and locking
primitives (rather than duplicating the functions or file).

Since L2x0 cache controllers do not work with ARMv7 CPUs, the patch
automatically enables CACHE_PL310 when CPU_V7 is defined.

Change-Id: I23e8fc326e6c42e7b36c7b67393fa91576692b48
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2010-10-03 23:08:58 -07:00
Gary King
1512cef470 ARM: enable CONFIG_CPU_IDLE support
add ARCH_HAS_CPU_IDLE_WAIT and ARCH_HAS_DEFAULT_IDLE configuration,
and expose default_idle and cpu_idle_wait

cpu_idle_wait implementation based on the implementation in the x86 tree

Signed-off-by: Gary King <gking@nvidia.com>
2010-10-03 23:08:57 -07:00
Erik Gilling
ea4fd77392 spi: add spi_tegra driver
v2 changes:
  from Thierry Reding:
    * add "select TEGRA_SYSTEM_DMA" to Kconfig
  from Grant Likely:
    * add oneline description to header
    * inline references to DRIVER_NAME
    * inline references to BUSY_TIMEOUT
    * open coded bytes_per_word()
    * spi_readl/writel -> spi_tegra_readl/writel
    * move transfer validation to spi_tegra_transfer
    * don't request_mem_region iomem as platform bus does that for us
    * __exit -> __devexit

v3 changes:
  from Russell King:
    * put request_mem_region back int
  from Grant Likely:
    * remove #undef DEBUG
    * add SLINK_ to register bit defines
    * remove unused bytes_per_word
    * make spi_tegra_readl/writel static linine
    * various refactoring for clarity
    * mark err if BSY bit is not cleared after 1000 retries
    * move spinlock to protect setting of RDY bit
    * subsys_initcall -> module_init

v3 changes:
  from Grant Likely:
    * update spi_tegra to use PTR_ERRless dma API

Signed-off-by: Erik Gilling <konkers@android.com>
Cc: Thierry Reding <thierry.reding@avionic-design.de>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Russell King <linux@arm.linux.org.uk>
2010-09-29 17:45:09 -07:00
Colin Cross
b4d068d281 [ARM] tegra: Add APB DMA support
The APB DMA block handles DMA transfers to and from some peripherals
in the Tegra SOC.  It reads from sequential addresses on the memory
bus, and writes repeatedly to the same address on the APB bus.

Two transfer modes are supported, oneshot for transferring a known
size to or from a peripheral, and continuous for streaming data.
In continuous mode, a callback occurs when the buffer is half full
to allow the existing data to be handled and a new request queued.x

v2 changes:
	dma API no longer uses PTR_ERR

Signed-off-by: Erik Gilling <konkers@android.com>
Signed-off-by: Colin Cross <ccross@android.com>
2010-09-29 17:45:09 -07:00
Colin Cross
ea6e497698 [ARM] tegra: Add tegra_defconfig
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Erik Gilling <konkers@android.com>
2010-09-29 17:45:08 -07:00
Colin Cross
3b6bfa3c30 [ARM] tegra: Add cpufreq support
Implement cpufreq support for the Tegra SOC.  DVFS is handled by the
core virtual cpu clock.  The frequencies of the two cores are tied
together, the highest frequency requested by either core determines
the actual frequency.

Signed-off-by: Colin Cross <ccross@android.com>
2010-09-29 17:45:08 -07:00
Colin Cross
373029eef9 [ARM] tegra: common: Update common clock init table
Renames clocks in the clock init table to match the datasheet names

Signed-off-by: Colin Cross <ccross@android.com>
2010-09-29 17:45:08 -07:00
Colin Cross
c409478768 [ARM] tegra: clock: Add dvfs support, bug fixes, and cleanups
- Add drivers to clock lookup table
- Add new pll_m entries
- Support I2C U16 divider
- Fix rate reporting on 32.768kHz clock
- Call propagate rate only if set_rate succeeds
- Add support for audio_sync clock
- Add 24MHz to PLLA frequency list
- Correct i2s1/2/spdifout mux
- Add suspend support
- Fix enable/disable parent clocks in set_parent
- Add max_rate parameter to all clocks
- DVFS support
- Add virtual cpu clock with dvfs
- Support clk_round_rate
- Fix requesting very high periph frequencies
- Add quirks for PLLU:
   PLLU is slightly different from the rest of the PLLs.  The
   lock enable bit is at bit 22 instead of 18 in the MISC
   register, and the post divider field is a single bit with
   reversed values from other PLLs.
- Simplify recalculating clock rates
- Fix UART divider flags
- Remove unused clock ops

Signed-off-by: Colin Cross <ccross@android.com>
2010-09-29 17:45:08 -07:00
Colin Cross
d096cc8aa1 [ARM] tegra: Add support for reading fuses
The Tegra SOC contains fuses to identify the CPU type and
bin, and a unique id.  The CPU info is required to determine
the correct voltages for each cpu and core frequency.

Signed-off-by: Colin Cross <ccross@android.com>
2010-09-29 17:45:08 -07:00
Colin Cross
86591f505d [ARM] tegra: gpio: Add suspend and wake support
Includes checkpatch fixes and TEGRA_NR_GPIOS changes from
Mike Rapoport <mike@compulab.co.il>

Signed-off-by: Colin Cross <ccross@android.com>
2010-09-29 17:45:08 -07:00
Colin Cross
076714e16b [ARM] tegra: pinmux: add safe values, move tegra2, add suspend
- the reset values for some pin groups in the tegra pin mux can result in
functional errors due to conflicting with actively-configured pin groups
muxing from the same controller. this change adds a known safe, non-
conflicting mux for every pin group, which can be used on platforms
where the pin group is not routed to any peripheral

- also add each pin group's I/O voltage rail, to enable platform code to
map from the pin groups used by each interface to the regulators used
for dynamic voltage control

- add routines to individually configure the tristate, pin mux and pull-
ups for a pingroup_config array, so that it is possible to program
individual values at run-time without modifying other values.
this allows driver power-management code to reprogram individual
interfaces into lower power states during idle / suspend, or to
reprogram the pin mux to support multiple physical busses per
internal controller (e.g., sharing a single I2C or SPI controller
across multiple pin groups)

- move chip-specific data like pingroups and drive-pingroups
out of the common code and into chip-specific code

- fix debug output for group with no pullups

- add a TEGRA_MUX_SAFE function.  Setting a pingroup to TEGRA_MUX_SAFE
will automatically select a mux setting that is guaranteed not to
conflict with any of the hardware blocks.

Signed-off-by: Gary King <gking@nvidia.com>
2010-09-29 17:45:07 -07:00