Commit Graph

819 Commits (cda61c9420028ddd251b60f1445c9eed756991c7)

Author SHA1 Message Date
Paul Walmsley 63c8523841 OMAP2/3/4: create omap_hwmod layer
OMAP SoCs can be considered a collection of hardware IP blocks
connected by various interconnects.  The bus topology and device
integration data is somewhat more complex than platform_device can
encode.  This patch creates code and structures to manage information
about OMAP on-chip devices ("hardware modules") and their integration
to the rest of the chip.  Hardware module data is intended to be
generated dynamically from the TI hardware database for the OMAP4
chips and beyond, easing Linux support for new chip variants.

This code currently:

- resets and configures all hardware modules upon startup, reducing bootloader
  dependencies;

- provides hooks for Linux driver model code to enable, idle, and shutdown
  hardware modules (forthcoming patch);

- waits for hardware modules to leave idle once their clocks
  are enabled and OCP_SYSCONFIG bits are set appropriately.

- provides a means to pass arbitrary IP block configuration data (e.g.,
  FIFO size) to the device driver (via the dev_attr void pointer)

In the future this code is intended to:

- estimate interconnect bandwidth and latency characteristics to
  ensure constraints are satisfied during DVFS

- provide *GRPSEL bit data to the powerdomain code

- handle pin/ball muxing for devices

- generate IO mapping information dynamically

- supply device firewall configuration data

- provide hardware module data to other on-chip coprocessor software

- allow the removal of the "disable unused clocks" code in the OMAP2/3
  clock code

This patch represents a collaborative effort involving many people from TI,
Nokia, and the Linux-OMAP community.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Benoit Cousson <b-cousson@ti.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Rajendra Nayak <rnayak@ti.com>
Cc: Vikram Pandita <vikram.pandita@ti.com>
Cc: Sakari Poussa <sakari.poussa@nokia.com>
Cc: Anand Sawant <sawant@ti.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Eric Thomas <ethomas@ti.com>
Cc: Richard Woodruff <r-woodruff2@ti.com>
2009-09-03 20:14:03 +03:00
Paul Walmsley b3c6df3ab2 OMAP2/3 board-*.c files: read bootloader configuration earlier
Most board-*.c files read configuration data from the bootloader in
their .init_machine() function.  This needs to happen earlier, at some
point before omap2_init_common_hw() is called.  This is because a
future patch will use the bootloader serial console port information
to enable the UART clocks earlier, immediately after omap2_clk_init().
This is in turn necessary since otherwise clock tree usecounts on
clocks like dpll4_m2x2_ck will be bogus, which can cause the
currently-active console UART clock to be disabled during boot.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
2009-09-03 20:14:02 +03:00
Paul Walmsley c0407a96d0 OMAP2/3 PM: create the OMAP PM interface and add a default OMAP PM no-op layer
The interface provides device drivers, CPUFreq, and DSPBridge with a
means of controlling OMAP power management parameters that are not yet
supported by the Linux PM PMQoS interface.  Copious documentation is
in the patch in Documentation/arm/OMAP/omap_pm and the interface
header file, arch/arm/plat-omap/include/mach/omap-pm.h.

Thanks to Rajendra Nayak <rnayak@ti.com> for adding CORE (VDD2) OPP
support and moving the OPP table initialization earlier in the event
that the clock code needs them.  Thanks to Tero Kristo
<tero.kristo@nokia.com> for fixing the parameter check in
omap_pm_set_min_bus_tput().  Jouni signed off on Tero's patch.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
Signed-off-by: Jouni Högander <jouni.hogander@nokia.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Igor Stoppa <igor.stoppa@nokia.com>
Cc: Richard Woodruff <r-woodruff2@ti.com>
Cc: Anand Sawant <sawant@ti.com>
Cc: Sakari Poussa <sakari.poussa@nokia.com>
Cc: Veeramanikandan Raju <veera@ti.com>
Cc: Karthik Dasu <karthik-dp@ti.com>
2009-09-03 20:14:01 +03:00
Tero Kristo 6dda2d4b13 OMAP: SDRC: Add several new register definitions
Add missing SDRC register offset macros.

Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
[paul@pwsan.com: added commit message]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
2009-09-03 20:13:56 +03:00
Tony Lindgren 5567fa1f54 Merge branch 'pm-upstream/debug' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into for-next 2009-09-02 15:23:05 -07:00
Peter 'p2' De Schrijver 331b93f41d OMAP: PM: Add pm-debug counters
This patch provides the debugfs entries and a function which will be
called by the PM code to register the time spent per domain per
state. Also some new fields are added to the powerdomain struct to
keep the time information.

NOTE: As of v2.6.29, using getnstimeofday() after drivers are
suspended is no longer safe since the timekeeping subsystem is also
suspended as part of the suspend process.  Instead use sched_clock()
which on OMAP returns the 32k SYNC timer in nanoseconds.

Also, do not print out status for meta powerdomains (dpll*)

Signed-off-by: Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com>
Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
2009-09-02 15:08:24 -07:00
Peter 'p2' De Schrijver a23456e9b0 OMAP: PM: Add closures to clkdm_for_each and pwrdm_for_each.
Add some infrastructure to easily iterate over clock and power
domains.

Signed-off-by: Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
2009-09-02 15:08:23 -07:00
Peter 'p2' De Schrijver ba20bb1269 OMAP: PM counter infrastructure.
This patch provides the infrastructure to count how many times a
powerdomain entered a given power state (on, inactive, retention,
off). A number of functions are provided which will be called by the
chip specific powerdomain and clockdomain code whenever a transition
might have happened.

Signed-off-by: Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
2009-09-02 15:08:23 -07:00
Reddy, Teerth 5110b2980a OMAP3: PM: add T2 interrupt line mux setting, and enable on 3430SDP
This patch changes for setting the padconf value for sys_nirq line
which is connected to T2 INTR1.  This will fix the T2 keypad wakeup
issue on OMAP3 SDP.

Signed-off-by: Teerth Reddy <teerth@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
2009-09-02 15:07:56 -07:00
Vikram Pandita 57b9daa0e1 OMAP3: MMC: Add mux for pins
For OMAP3 add MMC1 MMC2 pin mux MMC3 mux is not added as there are
multiple configurations possible, so the muxing is left to be done
in board file.

Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Chikkature Rajashekar <madhu.cr@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-08-28 11:24:11 -07:00
Hiroshi DOYU 14e0e6796a OMAP: iommu: add initial debugfs support
This enables to peek the following data.

$ /debug/iommu/isp# ls
mem             nr_tlb_entries  regs
mmap            pagetable       tlb
$ /debug/iommu/isp# head pagetable
L:      da:      pa:
-----------------------------------------
2: 00001000 8ae4a002
2: 00002000 8e7bb002
2: 00003000 8ae49002
2: 00004000 8ae65002
.....

Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-08-28 10:54:41 -07:00
Hiroshi DOYU 613f77696e OMAP: iommu: fix wrong argument in flush_cache_vmap()
The second argument should be the end address, not the
length. Actually there will not be any effect on the behavior of this
driver since flush_cache_vmap() calls flush_cache_all() in the end.

Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-08-28 10:54:40 -07:00
Eero Nurkkala 82dbb9d39f OMAP: GPIO: Avoid generating extra IRQs
It is possible for GPIO IRQ lines configured with
falling edge triggering only to get IRQs at the
rising edge upon the exit of offmode. And vice
versa. Prevent such IRQs to arrive by generating
the IRQ obeying the detection scheme.

Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-08-28 10:51:36 -07:00
Roger Quadros 79e44c952c OMAP: Remove omap boot parsing code
Remove left over code for parsing omap boot tags. This is
no longer used.
see commit fc0ef1bfa1

Signed-off-by: Roger Quadros <ext-roger.quadros@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-08-28 10:51:35 -07:00
Kalle Valo 15ac408ee5 OMAP: UART: drop OMAP_TAG_UART, enable all UARTs, auto-disabled on idle
OMAP tags are deprecrated so drop them.

Drop UART config data which decides which UARTs to enable during boot.
This is no longer necessary since serial core code disables clocks
after inactivity.

Background: with new UART idle code, all on-chip UARTs are idled using
a configurable inactivity timer (default 5 seconds.)  After the
inactivity timer, UART clocks are disabled automatically.

Signed-off-by: Kalle Valo <kalle.valo@iki.fi>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-08-28 10:51:31 -07:00
Kalle Valo 987cadcf3c OMAP: remove OMAP_TAG_SERIAL_CONSOLE
Omap tags are deprecated and remove OMAP_TAG_SERIAL_CONSOLE. Console must be
enabled with the console boot parameter instead.

Signed-off-by: Kalle Valo <kalle.valo@iki.fi>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-08-28 10:51:29 -07:00
Tony Lindgren db326be1bc OMAP: Remove ifdefs for io.h
Remove ifdefs for io.h

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-08-28 10:50:37 -07:00
Tony Lindgren 6175556fdc OMAP: Rename OMAP_MPUIO_BASE to OMAP1_MPUIO_BASE
Rename OMAP_MPUIO_BASE to OMAP1_MPUIO_BASE

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-08-28 10:50:34 -07:00
Tony Lindgren 941132606c OMAP: Remove OMAP_IO_ADDRESS, use OMAP1_IO_ADDRESS and OMAP2_IO_ADDRESS instead
Search and replace OMAP_IO_ADDRESS with OMAP1_IO_ADDRESS and OMAP2_IO_ADDRESS,
and convert omap_read/write into a functions instead of a macros.

Also rename OMAP_MPUIO_VBASE to OMAP1_MPUIO_VBASE.

In the long run, most code should use ioremap + __raw_read/write instead.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-08-28 10:50:33 -07:00
Jarkko Nikula d09a2afc93 ARM: OMAP: McBSP: Merge two functions into omap_mcbsp_start/_stop
Functionality of functions omap_mcbsp_xmit_enable and omap_mcbsp_recv_enable
can be merged into omap_mcbsp_start and omap_mcbsp_stop since API of
those omap_mcbsp_start and omap_mcbsp_stop was changed recently allowing
to start and stop individually the transmitter and receiver.

This cleans up the code in arch/arm/plat-omap/mcbsp.c and in
sound/soc/omap/omap-mcbsp.c which was the only user for those removed
functions.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Cc: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-25 10:20:48 +01:00
Jarkko Nikula 9b30050908 OMAP: McBSP: Use textual values in DMA operating mode sysfs files
Use more descriptive than numerical value when showing and storing the
McBSP DMA operating mode. Show function is using similar syntax than e.g.
the led triggers so that all possible values for store function are
printed but with current value surrounded with square brackets.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Cc: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Eduardo Valentin <eduardo.valentin@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-25 10:14:37 +01:00
Janusz Krzysztofik 9f0f4ae570 ARM: OMAP: DMA: Add support for DMA channel self linking on OMAP1510
Implement DMA channel self linking on OMAP1510 using AUTO_INIT and REPEAT
flags of the DMA CCR register.

Created against linux-2.6.31-rc5.

Tested on Amstrad Delta.

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-24 23:05:25 +01:00
Eero Nurkkala 72cc6d715d OMAP: McBSP: Let element DMA mode hit retention also
The device no longer hits retention if element DMA
mode is taken for at least the duration of the
serial console timeout. Force element DMA mode to
shut down through smartidle.

Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Acked-by: Eduardo Valentin <eduardo.valentin@nokia.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-20 20:10:28 +01:00
Eero Nurkkala fa3935ba34 OMAP: McBSP: Do not enable wakeups for no-idle mode
When no-idle mode is taken, wakeups need not to be enabled.
Moreover, CLOCKACTIVITY bits are unnecessary with this mode
also.

Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Acked-by: Eduardo Valentin <eduardo.valentin@nokia.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-20 20:10:28 +01:00
Eduardo Valentin d99a7454e5 OMAP: McBSP: Configure NO IDLE mode for DMA mode different of threshold
Use dma mode property to configure NO IDLE or SMART IDLE of McBSPs.

Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-20 20:10:27 +01:00
Eero Nurkkala 2ba93f8fa7 OMAP: McBSP: Retain McBSP FCLK clockactivity
FCLK may get autogated so that it prevents the McBSP
to work properly. It is the bit 9 that must be set
for maintaining the McBSP FCLK.

Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
Acked-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-20 20:10:27 +01:00
Eduardo Valentin d9a9b3f5f7 OMAP: McBSP: Change wakeup signals
Configure only XRDYEN and RRDYEN wakeup signals
in order to get better power consumption.

Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-20 20:10:27 +01:00
Eero Nurkkala 2122fdc629 OMAP: McBSP: Wakeups utilized
This patch enables the smart idle mode while
McBPS is being utilized. Once it's done,
force idle mode is taken instead. Apart of it,
it also configures what signals will wake mcbsp up.

Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-20 20:10:27 +01:00
Peter Ujfalusi 98cb20e889 OMAP: McBSP: Add link DMA mode selection
It adds a new sysfs file, where the user can configure the mcbsp mode to use.
If the mcbsp channel is in use, it does not allow the change.
Than in omap_pcm_open we can call the omap_mcbsp_get_opmode to get the mode,
store it, than use it to implement the different modes.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-20 20:10:27 +01:00
Eduardo Valentin 4c8200aeb0 OMAP: McBSP: Rename thres sysfs symbols
This patch renames the symbols that handles threshold
sysfs properties. This way we can add more sysfs properties
to them.

Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-20 20:10:26 +01:00
Eduardo Valentin a1a56f5faa OMAP: McBSP: Create and export max_(r|t)x_thres property
This patch export through sysfs two properties to configure
maximum threshold for transmission and reception on each
mcbsp instance. Also, it exports two helper functions to
allow mcbsp users to read this values.

Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-20 20:10:26 +01:00
Eduardo Valentin 7aa9ff56ca OMAP: McBSP: Add transmit/receive threshold handler
This patch adds a way to handle transmit/receive threshold.
It export to mcbsp users a callback registration procedure.

Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-20 20:10:26 +01:00
Eduardo Valentin 44a6311c0a OMAP: McBSP: Use appropriate value for startup delay
Increasing startup delay value as worst case:
 CLKSRG*2 = 8000khz: (1/8000) * 2 * 2 usec

Although, 100us may give enough time for two CLKSRG,
due to some unknown PM related, clock gating etc. reason,
this patch increases it to 500us.

Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-20 20:10:25 +01:00
Eduardo Valentin 946a49a95d OMAP: McBSP: Add IRQEN, IRQSTATUS, THRESHOLD2 and THRESHOLD1 registers.
Adding McBSP register definition for IRQEN, IRQSTATUS, THRESHOLD2 and THRESHOLD1 registers.

Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-20 20:10:25 +01:00
Eero Nurkkala 9abea08e43 OMAP: McBSP: Provide functions for ASoC frame syncronization
ASoC has an annoying bug letting either L or R channel to be
played on L channel. In other words, L and R channels can
switch at random. This provides McBSP funtionality that may
be used to fix this feature.

Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-20 20:10:25 +01:00
Rafael J. Wysocki af15c1addf Merge branch 'master' into for-linus 2009-08-18 23:37:37 +02:00
Martin Schwidefsky 0a54419836 timekeeping: Move NTP adjusted clock multiplier to struct timekeeper
The clocksource structure has two multipliers, the unmodified multiplier
clock->mult_orig and the NTP corrected multiplier clock->mult. The NTP
multiplier is misplaced in the struct clocksource, this is private
information of the timekeeping code. Add the mult field to the struct
timekeeper to contain the NTP corrected value, keep the unmodifed
multiplier in clock->mult and remove clock->mult_orig.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Acked-by: John Stultz <johnstul@us.ibm.com>
Cc: Daniel Walker <dwalker@fifo99.com>
LKML-Reference: <20090814134810.149047645@de.ibm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2009-08-15 10:55:46 +02:00
Russell King 96a4d1e234 Merge branch 'pm-upstream/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm 2009-08-10 15:50:27 +01:00
Russell King f40aac940a Merge branch 'omap_fixes_31' of git://git.pwsan.com/linux-2.6 2009-08-10 14:24:18 +01:00
Janboe Ye 370bc1fdef OMAP3: Fix omap3 sram virtual addres overlap vmalloc space after increasing vmalloc size
commit e85c205ac1 increase vmalloc size.
vmalloc space will overlap with OMAP3 sram virtual address.

Signed-off-by: Li Hong Mei <hong-mei.li@motorola.com>
Signed-off-by: Janboe Ye <yuan-bo.ye@motorola.com>
Reviewed-by: Paul Walmsley <paul@pwsan.com>
2009-08-10 14:49:50 +03:00
Vikram Pandita 284119c48f OMAP2/3: DMA errata correction
This errata is valid for:
OMAP2420 Errata 1.85 Impacts all 2420 ES rev
OMAP2430 Errata 1.10 Impacts only ES1.0
Description: DMA may hang when several channels are used in parallel
OMAP3430: Not impacted, so remove the errata fix for omap3

Fixed issue reported on cpu_is_omap24xx check reported by Nishant Kamat

Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Reviewed-by: Nishant Kamat <nskamat@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-08-10 14:49:50 +03:00
Tony Lindgren cd92204924 OMAP: Fix testing of cpu defines for mach-omap1
There's no need to keep these defines limited in the ifdef block
for mach-omap2. It will just cause problems testing for the CPU
revision in the common code, like the next patch does for the DMA
errata.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-08-10 14:49:50 +03:00
Jarkko Nikula c12abc012e ARM: OMAP: McBSP: Fix ASoC on OMAP1510 by fixing API of omap_mcbsp_start/stop
Simultaneous audio playback and capture on OMAP1510 can cause that second
stream is stalled if there is enough delay between startup of the audio
streams.

Current implementation of the omap_mcbsp_start is starting both transmitter
and receiver at the same time and it is called only for firstly started
audio stream from the OMAP McBSP based ASoC DAI driver.

Since DMA request lines on OMAP1510 are edge sensitive, the DMA request is
missed if there is no DMA transfer set up at that time when the first word
after McBSP startup is transmitted. The problem hasn't noted before since
later OMAPs are using level sensitive DMA request lines.

Fix the problem by changing API of omap_mcbsp_start and omap_mcbsp_stop by
allowing to start and stop individually McBSP transmitter and receiver
logics. Then call those functions individually for both audio playback
and capture streams. This ensures that DMA transfer is setup before
transmitter or receiver is started.

Thanks to Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> for detailed problem
analysis and Peter Ujfalusi <peter.ujfalusi@nokia.com> for info about DMA
request line behavior differences between the OMAP generations.

Reported-and-tested-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-07 10:57:42 +01:00
Russell King 13efdbecc6 Merge branch 'pm-upstream/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into devel-stable 2009-08-05 22:10:52 +01:00
Kevin Hilman 55b6019ae2 OMAP: GPIO: clear/restore level/edge detect settings on mask/unmask
If IRQ triggering is enabled, it can trigger a pending interrupt
even for masked interrupts.  Any pending GPIO interrupts can
prevent the powerdomain from hitting retention.

Problem found, reported and additional review and testing by Chunquiu
Wang.

Tested-by: Chunquiu Wang <cqwang@motorola.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
2009-08-05 09:10:54 -07:00
Eero Nurkkala 60c45ae110 OMAP: PM: CPUfreq: obey min/max settings of policy
Use the min/max settings from CPUfreq policy rather than
processor defined min/max settings.

Without this patch, it's possible to scale frequency outside
the current policy range.

Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
2009-08-05 09:10:54 -07:00
Tero Kristo 2466211e5d OMAP3: Fixed crash bug with serial + suspend
It was possible for an unhandled interrupt to occur if there was incoming
serial traffic during wakeup from suspend. This was caused by the code
in arch-arm/mach-omap2/serial.c keeping interrupt enabled all the time,
but not acking its interrupts. Applies on top of PM branch.

Use the PM begin/end hooks to ensure that the "serial idle" interrupts
are disabled during the suspend path.  Also, since begin/end hooks are
now used, use the suspend_state that is passed in the begin hook instead
of the enter hook as per the platform_suspend_ops docs.

Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
2009-08-05 09:10:53 -07:00
Roger Quadros b37c45b8c2 OMAP: GPIO: Fix incorrect gpio_get logic for output GPIOs
gpio_get() should return DATAIN register value when the GPIO
is configured as input whereas it should return DATAOUT register
value when the GPIO is configured as output.
Now /sys/kernel/debug/gpio shows proper values for output GPIOs

Signed-off-by: Roger Quadros <ext-roger.quadros@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-08-05 16:53:24 +03:00
Syed Rafiuddin 78a1a6d341 ARM: OMAP4: Update the GPIO support
This patch adds GPIO support on OMAP4430 development platform.

Signed-off-by: Syed Rafiuddin <rafiuddin.syed@ti.com>
2009-07-28 18:57:30 +05:30
Syed Rafiuddin a5b92cc348 ARM: OMAP4: Add McBSP support
This patch creates McBSP support on OMAP4430 development platform. This patch
includes corresponding base address changes for OMAP4.

Signed-off-by: Syed Rafiuddin <rafiuddin.syed@ti.com>
2009-07-28 18:57:10 +05:30
Paul Walmsley 72350b29a4 OMAP2/3 clock: split, rename omap2_wait_clock_ready()
Some OMAP2/3 hardware modules have CM_IDLEST attributes that are not
handled by the current omap2_wait_clock_ready() code.  In preparation
for patches that fix the unusual devices, rename the function
omap2_wait_clock_ready() to omap2_wait_module_ready() and split it
into three parts:

1. A clkops-specific companion clock return function (by default,
   omap2_clk_dflt_find_companion())

2. A clkops-specific CM_IDLEST register address and bit shift return
   function (by default, omap2_clk_dflt_find_idlest())

3. Code to wait for the CM to indicate that the module is ready
   (omap2_cm_wait_idlest())

Clocks can now specify their own custom find_companion() and find_idlest()
functions; used in subsequent patches.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
2009-07-24 20:10:35 -06:00
Jean Pihet 9fb97412c3 OMAP3: Setup MUX settings for SDRC CKE signals
This patches ensures the MUX settings are correct for the SDRC
CKE signals to SDRAM. This allows the self-refresh to work when
2 chip-selects are in use.

A warning is thrown away in case the initial muxing is incorrect,
in order to track faulty or old-dated bootloaders.
Note: The CONFIG_OMAP_MUX and CONFIG_OMAP_MUX_WARNINGS options
must be enabled for the mux code to have effect.

Signed-off-by: Jean Pihet <jpihet@mvista.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
2009-07-24 19:43:25 -06:00
Jean Pihet 58cda884ec OMAP3 SDRC: add support for 2 SDRAM chip selects
Some OMAP3 boards (Beagle Cx, Overo, RX51, Pandora) have 2
SDRAM parts connected to the SDRC.

This patch adds the following:
- add a new argument of type omap_sdrc_params struct*
to omap2_init_common_hw and omap2_sdrc_init for the 2nd CS params
- adapted the OMAP boards files to the new prototype of
omap2_init_common_hw
- add the SDRC 2nd CS registers offsets defines
- adapt the sram sleep code to configure the SDRC for the 2nd CS

Note: If the 2nd param to omap2_init_common_hw is NULL, then the
parameters are not programmed into the SDRC CS1 registers

Tested on 3430 SDP and Beagleboard rev C2 and B5, with
suspend/resume and frequency changes (cpufreq).

Signed-off-by: Jean Pihet <jpihet@mvista.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
2009-07-24 19:43:25 -06:00
Santosh Shilimkar 4fef5f90ed OMAP4: sDMA: Update the request lines and new registers.
This patch updates the platform dma.h with new dma request lines
for OMAP4 peripherals. Also additional hardware register of OMAP4
sDMA module are included.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-07-24 10:52:24 +05:30
Magnus Damm 79ee031ff6 ARM: Rework omap suspend_late()/resume_early()
This patch reworks platform driver power management code
for omap drivers using late/early legacy callbacks.

The callbacks are converted for CONFIG_SUSPEND like this:
  suspend_late() -> suspend_noirq()
  resume_early() -> resume_noirq()

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2009-07-22 00:28:38 +02:00
Tony Lindgren 503dcbeba5 OMAP: Fix IOMEM macro for assembly
Otherwise IOMEM calculations can fail.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-06-23 16:56:05 +03:00
janboe cb5793db5e OMAP2/3: Initialize gpio debounce register
Some bootloader may initialize debounce register and this will make
dbclk not consist with the debounce register after linux kernel boot
up.

Signed-off-by: janboe <janboe.ye@gmail.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-06-23 13:30:25 +03:00
Fernando Guzman Lugo f48ef99ca1 OMAP: IOMMU: function flush_iotlb_page is not flushing correct entry
The function flush_iotlb_page is not loading the CAM register with
the correct entry to be flushed, so it is flushing other entry

Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-06-23 13:30:25 +03:00
Kalle Jokiniemi aecedb94b3 OMAP3: DMA: Enable idlemodes for DMA OCP
This patch enables MStandby smart-idle mode, autoidle smartidle mode,
and the autoidle bit for DMA4_OCP_SYSCONFIG.

Signed-off-by: Kalle Jokiniemi <ext-kalle.jokiniemi@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kevin Hilman <khilman@ti.deeprootsystems.com>
2009-06-23 13:30:24 +03:00
Tero Kristo 5b0acc59d1 OMAP3: SRAM size fix for HS/EMU devices
SRAM size fix for HS/EMU devices

Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-06-23 13:30:23 +03:00
Kevin Hilman 8e25ad964a OMAP2/3: Add omap_type() for determining GP/EMU/HS
The omap_type() function is added and returns the DEVICETYPE field of
the CONTROL_STATUS register.  The result can be used for conditional
code based on whether device is GP (general purpose), EMU or
HS (high security). Also move the type defines so omap1 code
compile does not require ifdefs for sections using these defines.

This code is needed for the following fix to set the SRAM
size correctly for HS omaps.  Also at least PM and watchdog
code will need this function.

Signed-off-by: Kevin Hilman <khilman@ti.deeprootsystems.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-06-23 13:30:23 +03:00
Russell King 312cec5d09 Merge branch 'omap-clock-for-next' of git://git.pwsan.com/linux-2.6 into devel 2009-06-20 10:57:40 +01:00
Tero Kristo 3afec6332e OMAP3: Add support for DPLL3 divisor values higher than 2
Previously only 1 and 2 was supported. This is needed for DVFS VDD2 control.

Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
2009-06-19 19:09:32 -06:00
Paul Walmsley d0ba3922ae OMAP3 clock/SDRC: program SDRC_MR register during SDRC clock change
Program the SDRC_MR_0 register as well during SDRC clock changes.
This register allows selection of the memory CAS latency.  Some SDRAM
chips, such as the Qimonda HYB18M512160AF6, have a lower CAS latency
at lower clock rates.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
2009-06-19 19:09:31 -06:00
Paul Walmsley c9812d042a OMAP3 clock: add a short delay when lowering CORE clk rate
When changing the SDRAM clock from 166MHz to 83MHz via the CORE DPLL M2
divider, add a short delay before returning to SDRAM to allow the SDRC
time to stabilize.  Without this delay, the system is prone to random
panics upon re-entering SDRAM.

This time delay varies based on MPU frequency.  At 500MHz MPU frequency at
room temperature, 64 loops seems to work okay; so add another 32 loops for
environmental and process variation.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
2009-06-19 19:09:31 -06:00
Linus Torvalds 2cf4d4514d Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (417 commits)
  MAINTAINERS: EB110ATX is not ebsa110
  MAINTAINERS: update Eric Miao's email address and status
  fb: add support of LCD display controller on pxa168/910 (base layer)
  [ARM] 5552/1: ep93xx get_uart_rate(): use EP93XX_SYSCON_PWRCNT and EP93XX_SYSCON_PWRCN
  [ARM] pxa/sharpsl_pm: zaurus needs generic pxa suspend/resume routines
  [ARM] 5544/1: Trust PrimeCell resource sizes
  [ARM] pxa/sharpsl_pm: cleanup of gpio-related code.
  [ARM] pxa/sharpsl_pm: drop set_irq_type calls
  [ARM] pxa/sharpsl_pm: merge pxa-specific code into generic one
  [ARM] pxa/sharpsl_pm: merge the two sharpsl_pm.c since it's now pxa specific
  [ARM] sa1100: remove unused collie_pm.c
  [ARM] pxa: fix the conflicting non-static declarations of global_gpios[]
  [ARM] 5550/1: Add default configure file for w90p910 platform
  [ARM] 5549/1: Add clock api for w90p910 platform.
  [ARM] 5548/1: Add gpio api for w90p910 platform
  [ARM] 5551/1: Add multi-function pin api for w90p910 platform.
  [ARM] Make ARM_VIC_NR depend on ARM_VIC
  [ARM] 5546/1: ARM PL022 SSP/SPI driver v3
  ARM: OMAP4: SMP: Update defconfig for OMAP4430
  ARM: OMAP4: SMP: Enable SMP support for OMAP4430
  ...
2009-06-14 13:42:43 -07:00
Santosh Shilimkar 39e1d4c18f ARM: OMAP4: SMP: Add mpu timer support for OMAP4430
This patch adds SMP platform specific parts for local(mpu) timer support
for OMAP4430 platform. Each Cortex-a9 core has it's own local timer in the
MPU domain. These timers are not in wakeup domain.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
2009-06-09 13:03:59 +05:30
Santosh Shilimkar 367cd31ee0 ARM: OMAP4: SMP: Add OMAP4430 SMP board files
This patch adds SMP platform files support for OMAP4430SDP. TI's OMAP4430
SOC is based on ARM Cortex-A9 SMP architecture. It's a dual core SOC
with GIC used for interrupt handling and SCU for cache coherency.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
2009-06-09 13:03:50 +05:30
Russell King a22f277bba [ARM] Kconfig: remove 'default n'
Kconfig entries default to n, so there's no need for this to be
explicitly specified.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-05-31 15:12:25 +01:00
Russell King 949abd84cd Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 into devel
Conflicts:
	arch/arm/Makefile
2009-05-29 20:03:43 +01:00
Russell King 42f1d2e06a Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci into devel 2009-05-29 10:04:24 +01:00
Tony Lindgren cd07ecc828 Merge branch 'omap4' into for-next 2009-05-28 15:45:14 -07:00
Tony Lindgren 970a724d91 Merge branch 'omap3-upstream' into for-next
Conflicts:
	arch/arm/mach-omap2/serial.c
2009-05-28 15:44:54 -07:00
Tony Lindgren c81592ba1b Merge branch 'omap-upstream' into for-next
Conflicts:
	arch/arm/mach-omap2/Makefile
2009-05-28 15:41:03 -07:00
Santosh Shilimkar 46ba0abfe1 ARM: OMAP4: Add support for 4430 SDP
This patch updates the Makefile and Kconfig entries for OMAP4. The OMAP4430 SDP
board file supports only minimal set of drivers.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-28 14:16:05 -07:00
Santosh Shilimkar 748303850d ARM: OMAP4: Clock stubs since CLKDEV not in yet.
This patch update the common clock.c file for OMAP4. The clk_get() and
clk_put() functions are moved to  common place in arch/arm/common/clkdev.c
Since on current OMAP4 platform clk management is still not supported, the
platform file is stubbed with those functions.

Once the framework is ready, this WILL be replaced with a full
clkdev implementation.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-28 14:16:04 -07:00
Santosh Shilimkar 44169075e6 ARM: OMAP4: Add minimal support for omap4
This patch adds the support for OMAP4. The platform and machine specific
headers and sources updated for OMAP4430 SDP platform.

OMAP4430 is Texas Instrument's SOC based on ARM Cortex-A9 SMP architecture.
It's a dual core SOC with GIC used for interrupt handling and SCU for cache
coherency.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-28 14:16:04 -07:00
Tony Lindgren 4a899d5e93 ARM: OMAP3: Initialize more devices for LDP
Based on an earlier patches by Stanley.Miao <stanley.miao@windriver.com>
and Nishant Kamat <nskamat@ti.com>.

Note that at the ads7846 support still needs support for vaux_control
for the touchscreen to work.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-28 14:04:00 -07:00
Tony Lindgren f247de346f ARM: OMAP2/3: Remove L4_WK_OMAP_BASE, L4_PER_OMAP_BASE, L4_EMU_BASE, L3_OMAP_BASE
These are not being used right now, and the processor specific
defines should be used instead by any code accessing these registers.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-28 14:03:58 -07:00
Andrew de Quincey 088962c243 ARM: OMAP1: Make 770 LCD work
Make 770 LCD work by adding clk_add_alias().
Also remove the old unused functions.

Note that the clk_add_alias() could probably be moved
to arch/arm/clkdev.c later on.

Cc: linux-fbdev-devel@lists.sourceforge.net
Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com
2009-05-28 14:03:31 -07:00
Tony Lindgren 1a48e15751 ARM: OMAP2/3: Add generic smc91x support when connected to GPMC
Convert the board-rx51 smc91x code to be generic and make
the boards to use it. This allows future recalculation of the
timings when the source clock gets scaled.

Also correct the rx51 interrupt to be IORESOURCE_IRQ_HIGHLEVEL.

Thanks to Paul Walmsley <paul@pwsan.com> for better GPMC timing
calculations.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-28 13:23:52 -07:00
Juha Yrjola aa62e90fe0 ARM: OMAP2/3: Add generic onenand support when connected to GPMC
Add generic onenand support when connected to GPMC and make the
boards to use it.

The patch has been modified to make it more generic to support all
the boards with GPMC. The patch also remove unused prototype for
omap2_onenand_rephase(void).

Note that board-apollon.c is currently using the MTD_ONENAND_GENERIC
and setting the GPMC timings in the bootloader. Setting the GPMC
timings in the bootloader will not allow supporting frequency
scaling for the onenand source clock.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-28 13:23:52 -07:00
Santosh Shilimkar 279b918d72 ARM: OMAP2/3: sDMA: Correct omap_request_dma_chain(), v2
Original OMAP DMA chaining design had chain_id as one of the callback
parameters. Patch 538528de0c changed it
to use logical channel instead.

Correct the naming for callback to also use logical channel number
instead of the chain_id.

More details are on this email thread:

http://marc.info/?l=linux-omap&m=122961071931459&w=2

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-28 13:23:52 -07:00
Tomi Valkeinen 0815f8eaae ARM: OMAP2/3: DMA: implement trans copy and const fill
Implement transparent copy and constant fill features for OMAP2/3.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-28 13:23:51 -07:00
Peter 'p2' De Schrijver 94a3ef6f28 OMAP3: PM: Ensure MUSB block can idle when driver not loaded
Otherwise, bootloaders may leave MUSB in a state which prevents
retention.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
2009-05-28 10:59:09 -07:00
Kevin Hilman 8111b221a2 OMAP3: PM: Add D2D clocks and auto-idle setup to PRCM init
Add D2D clocks (modem_fck, sad2d_ick, mad2d_ick) to clock framework
and ensure that auto-idle bits are set for these clocks during PRCM
init.

Also add omap3_d2d_idle() function called durint PRCM setup which
ensures D2D pins are MUX'd correctly to enable retention for
standalone (no-modem) devices.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
2009-05-28 10:59:07 -07:00
Kevin Hilman 4af4016c53 OMAP3: PM: UART: disable clocks when idle and off-mode support
This patch allows the UART clocks to be disabled when the OMAP UARTs
are inactive, thus permitting the chip to hit retention in idle.
After the expiration of an activity timer, each UART is allowed to
disable its clocks so the system can enter retention.  The activity
timer is (re)activated on any UART interrupt, UART wake event or any
IO pad wakeup.  The actual disable of the UART clocks is done in the
'prepare_idle' hook called from the OMAP idle loop.

While the activity timer is active, the smart-idle mode of the UART is
also disabled.  This is due to a "feature" of the UART module that
after a UART wakeup, the smart-idle mode may be entered before the
UART has communicated the interrupt, or upon TX, an idle mode may be
entered before the TX FIFOs are emptied.

Upon suspend, the 'prepare_suspend' hook cancels any pending activity
timers and allows the clocks to be disabled immediately.

In addition, upon disabling clocks the UART state is saved in case
of an off-mode transition while clocks are off.

Special thanks to Tero Kristo for the initial ideas and first versions
of UART idle support, and to Jouni Hogander for extra testing and
bugfixes.

Tested on OMAP3 (Beagle, RX51, SDP, EVM) and OMAP2 (n810)

Cc: Tero Kristo <tero.kristo@nokia.com>
Cc: Jouni Hogander <jouni.hogander@nokia.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
2009-05-28 10:59:06 -07:00
Kevin Hilman 5a1a5abdb2 OMAP3: PM: Add wake-up bit defintiions for CONTROL_PADCONF_X
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
2009-05-28 10:59:06 -07:00
Kevin Hilman 1155e426b7 OMAP3: PM: Force IVA2 into idle during bootup
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
2009-05-28 10:59:05 -07:00
Jouni Hogander 94434535bd OMAP: Add new function to check wether there is irq pending
Add common omap2/3 function to check wether there is irq pending.
Switch to use it in omap2 pm code instead of its own.

Signed-off-by: Jouni Hogander <jouni.hogander@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
2009-05-28 10:59:04 -07:00
Kevin Hilman 8bd2294922 OMAP2/3: PM: push core PM code from linux-omap
This patch is to sync the core linux-omap PM code with mainline.  This
code has evolved and been used for a while the linux-omap tree, but
the attempt here is to finally get this into mainline.

Following this will be a series of patches from the 'PM branch' of the
linux-omap tree to add full PM hardware support from the linux-omap
tree.

Much of this PM core code was written by Jouni Hogander with
significant contributions from Paul Walmsley as well as many others
from Nokia, Texas Instruments and linux-omap community.

Signed-off-by: Jouni Hogander <jouni.hogander@nokia.com>
Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
2009-05-28 10:58:50 -07:00
Tony Lindgren 88b6f7eb9b Merge branch 'omap-clock-upstream' of git://git.pwsan.com/linux-2.6 into for-next 2009-05-26 14:41:35 -07:00
Santosh Shilimkar 8f9ccfeeb2 ARM: OMAP: Remove unnecessary omap2_globals.
This patch removes unnecessary omap2_globals and pass the global structures
directly as function argument.

The proposed cleanup was suggested by Russell King <rmk+kernel@arm.linux.org.uk>

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-25 11:26:48 -07:00
Santosh Shilimkar da7a0649bc ARM: OMAP: Remove useless omap_sram_error function.
This patch removes fixes omap_sram_error() function and replace the
error paths with BUG_ON.

The proposed fix was suggested by Russell King <rmk+kernel@arm.linux.org.uk>

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-25 11:26:48 -07:00
Santosh Shilimkar ce8a17fd3f ARM: OMAP: Remove unwanted type casts and fix the compiler warning.
This patch fixes the compiler warning "assignment from incompatible
pointer type"  in dmtimer.c and removes the tye casts. These warnings
were suppressed by type catsing.

The proposed fix was suggested by Russell King <rmk+kernel@arm.linux.org.uk>

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-25 11:26:47 -07:00
Tony Lindgren ef6685a6de ARM: OMAP2/3: Remove OMAP_CM_REGADDR
Processor specific macros should be used instead.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-25 11:26:46 -07:00
Tony Lindgren 07b95d000d ARM: OMAP2/3: Remove OMAP2_PRCM_BASE
It's currently unused, and processor specific defines should
be used instead.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-25 11:26:46 -07:00
Tony Lindgren 2e693f841f ARM: OMAP2/3: Move define of OMAP2_VA_IC_BASE to be local to entry-macro.S
Move define of OMAP2_VA_IC_BASE to be local to entry-macro.S

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-25 11:26:45 -07:00
Tony Lindgren 8e3bd351d1 ARM: OMAP2/3: Remove OMAP_PRM_REGADDR and OMAP2_PRM_BASE
Remove OMAP_PRM_REGADDR and use processor specific defines instead.

Also fold in a patch from Kevin Hilman to add _OFFSET #defines
for the PRCM registers to be used with the prm_[read|write]_* macros.
These are used extensively in the forthcoming OMAP PM support.

Also remove now unused OMAP2_PRM_BASE.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-25 11:26:42 -07:00
Tony Lindgren a4ab0d836b ARM: OMAP2/3: Remove OMAP2_32KSYNCT_BASE
Use processor specific defines instead.

As an extra bonus, this patch fixes the problem of CONFIG_DEBUG_SPINLOCK
calling sched_clock before we have things initialized:

http://patchwork.kernel.org/patch/15810/

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-25 11:26:41 -07:00
Jarkko Nikula ddf25dfe3a ARM: OMAP: Update contact address of I2C registration helper
This email address is going to expire soon so update it.

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-25 11:08:43 -07:00
Eero Nurkkala d6d834b010 ARM: OMAP: McBSP: Fix legacy interrupts to clear their status
If XSYNCERR or RSYNCERR interrupts are enabled, they are never
cleared causing the IRQ handler to be continuously called.
This patch clears the IRQs in question in the event they are
enabled and taken.

Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-25 11:08:42 -07:00
Mans Rullgard e85c205ac1 ARM: OMAP: Increase VMALLOC_END to allow 256MB RAM
This increases VMALLOC_END to 0x18000000, making room for 256MB
RAM with the default 128MB vmalloc region.

Note that after this patch there's no longer a hole between vmalloc
space and the beginning of IO space on omap2 as the first virtual
mapping starts at 0xd8000000.

Also fold in a related change from Paul Walmsley <paul@pwsan.com>
to change the OMAP2_SRAM addresses accordingly.

Signed-off-by: Mans Rullgard <mans@mansr.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-25 11:08:41 -07:00
Santosh Shilimkar 00aeeffffa ARM: OMAP: Remove unnecessary omap2_globals.
This patch removes unnecessary omap2_globals and pass the global structures
directly as function argument.

The proposed cleanup was suggested by Russell King <rmk+kernel@arm.linux.org.uk>

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-25 11:08:37 -07:00
Santosh Shilimkar af5703f2be ARM: OMAP: Remove useless omap_sram_error function.
This patch removes fixes omap_sram_error() function and replace the
error paths with BUG_ON.

The proposed fix was suggested by Russell King <rmk+kernel@arm.linux.org.uk>

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-25 11:08:37 -07:00
Santosh Shilimkar aea2a5b03c ARM: OMAP: Remove unwanted type casts and fix the compiler warning.
This patch fixes the compiler warning "assignment from incompatible
pointer type"  in dmtimer.c and removes the tye casts. These warnings
were suppressed by type catsing.

The proposed fix was suggested by Russell King <rmk+kernel@arm.linux.org.uk>

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-25 11:08:36 -07:00
Tony Lindgren eb0d0ee1c2 ARM: OMAP2/3: Remove OMAP_CM_REGADDR
Processor specific macros should be used instead.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-25 11:08:36 -07:00
Tony Lindgren c28150ee68 ARM: OMAP2/3: Remove OMAP2_PRCM_BASE
It's currently unused, and processor specific defines should
be used instead.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-25 11:08:35 -07:00
Tony Lindgren 8a424bb3c9 ARM: OMAP2/3: Move define of OMAP2_VA_IC_BASE to be local to entry-macro.S
Move define of OMAP2_VA_IC_BASE to be local to entry-macro.S

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-25 11:08:35 -07:00
Tony Lindgren 23b7dd3166 ARM: OMAP2/3: Remove OMAP_PRM_REGADDR and OMAP2_PRM_BASE
Remove OMAP_PRM_REGADDR and use processor specific defines instead.

Also fold in a patch from Kevin Hilman to add _OFFSET #defines
for the PRCM registers to be used with the prm_[read|write]_* macros.
These are used extensively in the forthcoming OMAP PM support.

Also remove now unused OMAP2_PRM_BASE.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-25 11:08:34 -07:00
Tony Lindgren bed8b97d88 ARM: OMAP2/3: Remove OMAP2_32KSYNCT_BASE
Use processor specific defines instead.

As an extra bonus, this patch fixes the problem of CONFIG_DEBUG_SPINLOCK
calling sched_clock before we have things initialized:

http://patchwork.kernel.org/patch/15810/

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-25 11:08:33 -07:00
Russell King 56a459314a Merge branch 'iommu' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git into devel 2009-05-25 10:20:21 +01:00
Jens Axboe 9bd7de51ee Merge branch 'master' into for-2.6.31
Conflicts:
	drivers/ide/ide-io.c

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-05-22 20:28:35 +02:00
Jens Axboe e4b636366c Merge branch 'master' into for-2.6.31
Conflicts:
	drivers/block/hd.c
	drivers/block/mg_disk.c

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-05-22 20:25:34 +02:00
Hiroshi DOYU e769421de2 omap iommu: entries for Kconfig and Makefile
Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
2009-05-22 10:16:36 +03:00
Hiroshi DOYU 69d3a84a64 omap iommu: simple virtual address space management
This patch provides a device drivers, which has a omap iommu, with
address mapping APIs between device virtual address(iommu), physical
address and MPU virtual address.

There are 4 possible patterns for iommu virtual address(iova/da) mapping.

    |iova/			  mapping		iommu_		page
    | da	pa	va	(d)-(p)-(v)		function	type
  ---------------------------------------------------------------------------
  1 | c		c	c	 1 - 1 - 1	  _kmap() / _kunmap()	s
  2 | c		c,a	c	 1 - 1 - 1	_kmalloc()/ _kfree()	s
  3 | c		d	c	 1 - n - 1	  _vmap() / _vunmap()	s
  4 | c		d,a	c	 1 - n - 1	_vmalloc()/ _vfree()	n*

    'iova':	device iommu virtual address
    'da':	alias of 'iova'
    'pa':	physical address
    'va':	mpu virtual address

    'c':	contiguous memory area
    'd':	dicontiguous memory area
    'a':	anonymous memory allocation
    '()':	optional feature

    'n':	a normal page(4KB) size is used.
    's':	multiple iommu superpage(16MB, 1MB, 64KB, 4KB) size is used.

    '*':	not yet, but feasible.

Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
2009-05-19 08:23:49 +03:00
Vikram Pandita e102657ed1 ARM: OMAP3: Fix number of GPIO lines for 34xx
As per 3430 TRM, there are 6 banks [0 to 191]

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-16 08:28:16 -07:00
Paul Walmsley 7971687094 OMAP2xxx clock: rename clk_init_one() to clk_preinit()
Rename clk_init_one() to clk_preinit() to distinguish its function
from clk_init() and the individual struct clk init functions.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
2009-05-12 17:50:30 -06:00
Paul Walmsley 4519c2bf43 OMAP3 clock: only unlock SDRC DLL if SDRC clk < 83MHz
According to the 34xx TRM Rev. K section 11.2.4.4.11.1 "Purpose of the
DLL/CDL Module," the SDRC delay-locked-loop can be locked at any SDRC
clock frequency from 83MHz to 166MHz.  CDP code unconditionally
unlocked the DLL whenever shifting to a lower SDRC speed, but this
seems unnecessary and error-prone, as the DLL is no longer able to
compensate for process, voltage, and temperature variations.  Instead,
only unlock the DLL when the SDRC clock rate would be less than 83MHz.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
2009-05-12 17:27:10 -06:00
Paul Walmsley d9295746c0 OMAP3 SRAM: mark OCM RAM as Non-cacheable Normal memory
Mark the SRAM (aka OCM RAM) as Non-cacheable Normal memory[1].  This
is to prevent the ARM from evicting existing cache lines to SDRAM
while code is executing from the SRAM.  Necessary since one of the
primary uses for the SRAM is to hold the code and data for the CORE
DPLL M2 divider reprogramming code, which must execute while the SDRC
is idled.  If the ARM attempts to write cache lines back to the while
the SRAM code is running, the ARM will stall[2].

TI deals with this problem in the CDP kernel by marking the SRAM as
Strongly-ordered memory.

Tero Kristo <tero.kristo@nokia.com> caught a bug in an earlier version of
this patch - thanks Tero.

...

1. ARMv7 ARM (DDI 0406A) pp. A3-30, A3-31, B3-32.

2. Private communication with Richard Woodruff <r-woodruff2@ti.com>

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Tero Kristo <tero.kristo@nokia.com>
Cc: Richard Woodruff <r-woodruff2@ti.com>
2009-05-12 17:27:09 -06:00
Tomi Valkeinen 72af2b3631 ARM: OMAP: Fix printing of reserved memory for frambuffer
Print reserved memory only if it was actually reserved.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-05-11 09:58:19 -07:00
Tejun Heo 9934c8c045 block: implement and enforce request peek/start/fetch
Till now block layer allowed two separate modes of request execution.
A request is always acquired from the request queue via
elv_next_request().  After that, drivers are free to either dequeue it
or process it without dequeueing.  Dequeue allows elv_next_request()
to return the next request so that multiple requests can be in flight.

Executing requests without dequeueing has its merits mostly in
allowing drivers for simpler devices which can't do sg to deal with
segments only without considering request boundary.  However, the
benefit this brings is dubious and declining while the cost of the API
ambiguity is increasing.  Segment based drivers are usually for very
old or limited devices and as converting to dequeueing model isn't
difficult, it doesn't justify the API overhead it puts on block layer
and its more modern users.

Previous patches converted all block low level drivers to dequeueing
model.  This patch completes the API transition by...

* renaming elv_next_request() to blk_peek_request()

* renaming blkdev_dequeue_request() to blk_start_request()

* adding blk_fetch_request() which is combination of peek and start

* disallowing completion of queued (not started) requests

* applying new API to all LLDs

Renamings are for consistency and to break out of tree code so that
it's apparent that out of tree drivers need updating.

[ Impact: block request issue API cleanup, no functional change ]

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Mike Miller <mike.miller@hp.com>
Cc: unsik Kim <donari75@gmail.com>
Cc: Paul Clements <paul.clements@steeleye.com>
Cc: Tim Waugh <tim@cyberelk.net>
Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Laurent Vivier <Laurent@lvivier.info>
Cc: Jeff Garzik <jgarzik@pobox.com>
Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Adrian McMenamin <adrian@mcmen.demon.co.uk>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: Borislav Petkov <petkovbb@googlemail.com>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Alex Dubov <oakad@yahoo.com>
Cc: Pierre Ossman <drzeus@drzeus.cx>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Markus Lidel <Markus.Lidel@shadowconnect.com>
Cc: Stefan Weinhuber <wein@de.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-05-11 09:52:18 +02:00
Tejun Heo 296b2f6ae6 block: convert to dequeueing model (easy ones)
plat-omap/mailbox, floppy, viocd, mspro_block, i2o_block and
mmc/card/queue are already pretty close to dequeueing model and can be
converted with simple changes.  Convert them.

While at it,

* xen-blkfront: !fs check moved downwards to share dequeue call with
  normal path.

* mspro_block: __blk_end_request(..., blk_rq_cur_byte()) converted to
  __blk_end_request_cur()

* mmc/card/queue: loop of __blk_end_request() converted to
  __blk_end_request_all()

[ Impact: dequeue in-flight request ]

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Alex Dubov <oakad@yahoo.com>
Cc: Markus Lidel <Markus.Lidel@shadowconnect.com>
Cc: Pierre Ossman <drzeus@drzeus.cx>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-05-11 09:52:17 +02:00
Hiroshi DOYU 2bcb573343 omap iommu: omap2 architecture specific functions
The structure 'arch_mmu' accommodates the difference between omap1 and
omap2/3.

This patch provides omap2/3 specific functions

Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
2009-05-05 14:52:39 +03:00
Hiroshi DOYU a9dcad5e37 omap iommu: tlb and pagetable primitives
This patch provides:

- iotlb_*()     : iommu tlb operations
- iopgtable_*() : iommu pagetable(twl) operations
- iommu_*()     : the other generic operations

and the entry points to register and acquire iommu object.

Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
2009-05-05 14:52:39 +03:00
Tejun Heo ec24751a6b arm-omap: don't abuse rq->data
omap mailbox uses rq->data as the second opaque pointer to carry
mbox_msg_t and rq->special message argument which is needed only for
tx.  Add and use omap_msg_tx_data struct for tx and use rq->special
for mbox_msg_t for rx such that only rq->special is used as opaque
pointer.

[ Impact: cleanup rq->data usage, extra kmalloc in msg_send ]

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Russell King <rmk@arm.linux.org.uk>
2009-04-28 07:37:36 +02:00
Tejun Heo 40cbbb781d block: implement and use [__]blk_end_request_all()
There are many [__]blk_end_request() call sites which call it with
full request length and expect full completion.  Many of them ensure
that the request actually completes by doing BUG_ON() the return
value, which is awkward and error-prone.

This patch adds [__]blk_end_request_all() which takes @rq and @error
and fully completes the request.  BUG_ON() is added to to ensure that
this actually happens.

Most conversions are simple but there are a few noteworthy ones.

* cdrom/viocd: viocd_end_request() replaced with direct calls to
  __blk_end_request_all().

* s390/block/dasd: dasd_end_request() replaced with direct calls to
  __blk_end_request_all().

* s390/char/tape_block: tapeblock_end_request() replaced with direct
  calls to blk_end_request_all().

[ Impact: cleanup ]

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Mike Miller <mike.miller@hp.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Jeff Garzik <jgarzik@pobox.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Alex Dubov <oakad@yahoo.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-04-28 07:37:35 +02:00
Tony Lindgren 535ff672e3 Merge branch 'omap-clock-fixes' into omap-fixes 2009-04-24 09:56:16 -07:00
Paul Walmsley f248076c0d OMAP2/3 GPTIMER: allow system tick GPTIMER to be changed in board-*.c files
Add a function omap2_gp_clockevent_set_gptimer() for board-*.c files
to use in .init_irq functions to configure the system tick GPTIMER.
Practical choices at this point are GPTIMER1 or GPTIMER12.  Both of
these timers are in the WKUP powerdomain, and so are unaffected by
chip power management.  GPTIMER1 can use sys_clk as a source, for
applications where a high-resolution timer is more important than
power management.  GPTIMER12 has the special property that it has the
secure 32kHz oscillator as its source clock, which may be less prone
to glitches than the off-chip 32kHz oscillator.  But on HS devices, it
may not be available for Linux use.

It appears that most boards are fine with GPTIMER1, but BeagleBoard
should use GPTIMER12 when using a 32KiHz timer source, due to hardware bugs
in revisions B4 and below.  Modify board-omap3beagle.c to use GPTIMER12.

This patch originally used a Kbuild config option to select the GPTIMER,
but was changed to allow this to be specified in board-*.c files, per
Tony's request.

Kalle Vallo <kalle.valo@nokia.com> found a bug in an earlier version of
this patch - thanks Kalle.

Tested on Beagle rev B4 ES2.1, with and without CONFIG_OMAP_32K_TIMER, and
3430SDP.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Cc: Kalle Valo <kalle.valo@nokia.com>
2009-04-23 21:11:10 -06:00
Kevin Hilman 219c5b98d5 OMAP: dmtimer: enable all timers to be wakeup events
All GP timers on OMAP2/3 can generate wakeup events.  The wakeup status is
cleared in the PRCM interrupt handler.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
2009-04-23 21:11:08 -06:00
Paul Walmsley 9198a40620 OMAP3 GPTIMER: fix GPTIMER12 IRQ
GPTIMER12 IRQ is at IRQ 95 on OMAP3, unlike OMAP2.  (ref: OMAP34xx
Multimedia High Security (HS) Device Silicon Revision 3.0 Security
Addendum Rev. B, SWPU119B)

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-04-23 21:11:08 -06:00
Roger Quadros bedfd15410 ARM: OMAP3: Fixed spurious IRQ issue for GPIO interrupts
Flush posted write to IRQSTATUS register in GPIO IRQ handler.
This eliminates the below error for all peripherals that use GPIO interrupts.

<4>Spurious irq 95: 0xffffffdf, please flush posted write for irq 31

Signed-off-by: Roger Quadros <ext-roger.quadros@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-04-23 11:10:50 -07:00
Kevin Hilman b3bb4f688c ARM: OMAP2/3: GPIO: do not attempt to wake-enable
The GPIO IRQ enable/disable path attempts to also enable IRQ wake
support for the parent GPIO bank IRQ as well.  However, since there is
no 'set_wake' hook for the bank IRQs, these calls will always fail.
Also, since the enable will fail on the suspend path, the disable on
the resume path will trigger unbalanced enable/disable warnings.

This was discovered in the suspend/resume path on OMAP3/Beagle using
the gpio-keys driver which disables/re-enables GPIO IRQ wakeups in the
suspend/resume path.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-04-23 11:10:49 -07:00
Jarkko Nikula 6b7bff3169 ARM: OMAP2: Remove defines and resource init for OMAP24XX EAC
There is no anymore legacy driver for OMAP24XX Enhanced Audio Controller
in linux-omap and it was newer in mainline so cleanup these unneeded
defines and initialization code.

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-04-23 11:10:48 -07:00
Ladislav Michl 1748ae0e95 ARM: OMAP: MMC: Remove unused power_pin
Remove unused power_pin

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-04-23 11:10:44 -07:00
Tony Lindgren ba16ec7cab ARM: OMAP: Remove old dead gpio expander code
This should be done with GPIO calls. Patches against the
mainline tree welcome to add the necessary working functionality
back.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-04-23 11:10:40 -07:00
Santosh Shilimkar da1b94e6a6 ARM: OMAP: Fix for possible race condition in omap_free_dma()
Fix the possible race condition in omap_free_dma(). Function omap_free_dma()
sets the dev_id = -1 and then accesses the channel afterwards to clear it.
But setting the dev_id=-1 makes the channel available for allocation again.
So it is possible someone else can grab it and results are unpredictable.
To avod this DMA channle is cleared first and then the dev_id = -1 is set.

Thanks to McNeil, Sean <sean.mcneil@ti.com> for ointing out this issue.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-04-23 11:10:40 -07:00
Paul Walmsley c8088112fd OMAP2xxx clock: pre-initialize struct clks early
Commit 3f0a820c4c breaks OMAP2xxx boot
during initial propagate_rate() on osc_ck and sys_ck.  Fix by
pre-initializing all struct clks before running any other clock init
code.  Incorporates review comments from Russell King
<rmk+kernel@arm.linux.org.uk>.

Resolves

<1>Unable to handle kernel NULL pointer dereference at virtual address 00000000
<1>pgd = c0004000
<1>[00000000] *pgd=00000000
Internal error: Oops: 5 [#1]
Modules linked in:
CPU: 0    Not tainted  (2.6.29-omap1 #37)
PC is at propagate_rate+0x10/0x60
LR is at omap2_clk_init+0x30/0x218
...

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Tested-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
2009-04-22 19:48:53 -06:00
Magnus Damm 8e19608e8b clocksource: pass clocksource to read() callback
Pass clocksource pointer to the read() callback for clocksources.  This
allows us to share the callback between multiple instances.

[hugh@veritas.com: fix powerpc build of clocksource pass clocksource mods]
[akpm@linux-foundation.org: cleanup]
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: John Stultz <johnstul@us.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-21 13:41:47 -07:00
Tony Lindgren 9e495834e5 [ARM] 5434/1: ARM: OMAP: Fix mailbox compile for 24xx
OMAP34XX_MAILBOX_BASE must be defined both for 24xx and 34xx.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-03-28 19:35:02 +00:00
Russell King 8937b7349c Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 into devel 2009-03-25 18:31:35 +00:00
Russell King fbf2b1f9cf Merge branch 'highmem' into devel 2009-03-24 22:47:45 +00:00
Felipe Balbi 18cb7aca6f ARM: OMAP3: MUSB initialization for omap hw, v2
Create a generic board-file for initializing usb
on omap2430 and omap3 boards.

Patch modified by Tony to build the module based on
CONFIG_USB_MUSB_SOC. Also merged in a patch adding
the nop xceiv from Ajay Kumar Gupta <ajay.gupta@ti.com>.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-23 18:51:24 -07:00
Tony Lindgren 828c707e6d ARM: OMAP3: Add base address definitions and resources for OMAP 3 IS, v2
This replaces earlier patch from Sergio Aguirre titled "[REVIEW PATCH 03/14]
OMAP34XX: CAM: Resources fixes".

Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-23 18:51:23 -07:00
David Brownell 01971f65ff ARM: OMAP3: mmc-twl4030 init passes device nodes back, v2
When setting up HSMMC devices, pass the device nodes back so
board code can linking them to their power supply regulators.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-23 18:51:22 -07:00
Tony Lindgren b9d766c767 ARM: OMAP3: Add more GPIO mux options
This patch adds several new GPIO pins and updates
the pin naming comments.

The patch is based on earlier patches on linux-omap
list by Manikandan Pillai <mani.pillai@ti.com>,
Vaibhav Hiremath <hvaibhav@ti.com> and
David Brownell <dbrownell@users.sourceforge.net>.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-23 18:51:21 -07:00
Felipe Balbi b0b5aa3f4c ARM: OMAP: get rid of OMAP_TAG_USB, v2
OMAP_TAGS should vanish soon since they're not generic arm tags.
Most of them can be converted to a platform_data or parsed
from a command line like e.g. serial tag.

For OMAP_TAG_USB we just let boards call omap_usb_init()
passing a pointer to omap_usb_config.

Patch updated by Tony for mainline, basically make
n770 and h4 compile. Also folded in a fix for OSK
by David Brownell <dbrownell@users.sourceforge.net>.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-23 18:51:20 -07:00
Santosh Shilimkar 52176e7083 ARM: OMAP: Dispatch only relevant DMA interrupts
This fixes the spurious interrupt issue on a DMA channel.

In OMAP sDMA, contrast to the SDMA.DMA4_CSRi registers, the
SDMA.DMA4_IRQSTATUS_Lj registers are updated regardless of
the corresponding bits in the SDMA.DMA4_IRQENABLE_Lj registers.
Since there are four sDMA interrupt lines and if more than one
line is actively used by two concurrently running sDMA softwares
modules,then the spurious interrupt can be observed on the other
lines.

Fix in this patch will only dispatch the relevant and enabled
interrupts on a particular line thus perevting spurious IRQ.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Nishant Kamat <nskamat@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-23 18:51:20 -07:00
Santosh Shilimkar 2263f0222e ARM: OMAP: Get available DMA channels from cmdline
This patch set up a cmdline option for omap dma for masking the
available channels. It is needed since the OMAP DMA is a system wide
resource and can be used by another software apart from the kernel.

To reserve the omap SDMA channels for kernel dma usage, use cmdline
bootarg "omap_dma_reserve_ch=". The valid range is 1 to 32.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Nishant Kamat <nskamat@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-23 18:51:20 -07:00
Jarkko Nikula 7954763bb9 ARM: OMAP: Add method to register additional I2C busses on the command line, v2
This patch extends command line option "i2c_bus=bus_id,clkrate" so that
it allow to register additional I2C busses that are not registered with
omap_register_i2c_bus from board initialization code.

Purpose of this is to register additional board busses which are routed
to external connectors only without any on board I2C devices.

Cc: linux-i2c@vger.kernel.org
Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-23 18:51:20 -07:00
Jarkko Nikula 3a853fb933 ARM: OMAP: Add command line option for I2C bus speed, v2
This patch adds a new command line option "i2c_bus=bus_id,clkrate" into
I2C bus registration helper. Purpose of the option is to override the
default board specific bus speed which is supplied by the
omap_register_i2c_bus.

The default bus speed is typically set to speed of slowest I2C chip on the
bus and overriding allow to use some experimental configurations or updated
chip versions without any kernel modifications.

Cc: linux-i2c@vger.kernel.org
Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-23 18:51:20 -07:00
Jarkko Nikula d4c58bf45a ARM: OMAP: Add documentation for function omap_register_i2c_bus
Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-23 18:51:19 -07:00
Timo Kokkonen 6c366e3299 ARM: OMAP: Export dmtimer functions
Make the dmtimer function symbols available so modules can take use of
them.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-23 18:51:19 -07:00
Zebediah C. McClure 59185eeeaa [OMAP850] IRQ related changes
IRQ related changes.

Signed-off-by: Zebediah C. McClure <zmc@lurian.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-23 18:51:19 -07:00
Zebediah C. McClure 557096fe28 [OMAP850] Changes to memory subsystem
Changes to memory subsystem.

Signed-off-by: Zebediah C. McClure <zmc@lurian.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-23 18:51:19 -07:00
Zebediah C. McClure 56739a6929 [OMAP850] Changes to base IO subsystem, v2
Changes to base IO subsystem.

Signed-off-by: Zebediah C. McClure <zmc@lurian.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-23 18:07:40 -07:00
Zebediah C. McClure ae302f4006 [OMAP850] Add base support for omap850 cpu
Add base support for omap850 cpu.

Signed-off-by: Zebediah C. McClure <zmc@lurian.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-23 18:07:39 -07:00
Tony Lindgren 6b0147cda6 ARM: OMAP: Remove remaining board-*.h includes from hardware.h
Also remove board-omap3beagle.h that is not included anywhere,
and move protoype for voiceblue_reset() from board-voiceblue.h
to system.h.

After this patch there are still board-ams-delta.h, board-sx1.h
and board-voiceblue.h that export some functions. These could
be removed if the functions were moved under drivers.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-23 18:07:39 -07:00
Tony Lindgren d40cdf080d ARM: OMAP: No need to include board-nokia.h from hardware.h
Move the defines to the associated board file and remove
the now unnecessary header file.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-23 18:07:38 -07:00
Tony Lindgren 0d4d9ab08a ARM: OMAP: No need to include board-overo.h from hardware.h
Move the defines to the associated board file and remove
the now unnecessary header file.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-23 18:07:38 -07:00
Tony Lindgren ec7558a62d ARM: OMAP: No need to include board-ldp.h from hardware.h
Move the defines to the associated board file and remove
the now unnecessary header file. Also rename
OMAP34XX_ETHR_START to LDP_ETHR_START.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-23 18:07:37 -07:00
Tony Lindgren 40662d7731 ARM: OMAP: No need to include board-h4.h from hardware.h
Move the defines to the associated board file and remove
the now unnecessary header file. Also rename
OMAP24XX_ETHR_GPIO_IRQ to H4_ETHR_GPIO_IRQ.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-23 18:07:36 -07:00
Tony Lindgren 7055477558 ARM: OMAP: No need to include board-apollon.h from hardware.h
Move the defines to the associated board file and remove
the now unnecessary header file.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-23 18:07:35 -07:00
Tony Lindgren a362fdbddb ARM: OMAP: No need to include board-omap2430sdp.h from hardware.h
Move the defines to the associated board file and remove
the now unnecessary header file. Also rename
SDP2430_ETHR_GPIO_IRQ to SDP2430_ETHR_GPIO_IRQ.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-23 18:07:35 -07:00
Tony Lindgren b2830810fd ARM: OMAP: No need to include board-palm*.h from hardware.h
Move the defines to the associated board file and remove
the now unnecessary header files.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-23 18:07:35 -07:00
Tony Lindgren 3a0110cdae ARM: OMAP: No need to include board-osk.h from hardware.h
Move the defines to the board file and remove the now unnecessary
header file.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-23 18:07:34 -07:00
Tony Lindgren 278267be38 ARM: OMAP: No need to include board-innovator.h from hardware.h
Move the defines to the board file and remove the now unnecessary
header file.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-23 18:07:34 -07:00
Tony Lindgren 228fe42e5e ARM: OMAP: No need to include board-h3.h from hardware.h
Also move board-h3.h to mach-omap1.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-23 18:07:33 -07:00
Tony Lindgren eb6b0b1832 ARM: OMAP: No need to include board-h2.h from hardware.h
Also move board-h2.h to mach-omap1.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-23 18:07:33 -07:00
Tony Lindgren d9558b19f2 ARM: OMAP: No need to include board-perseus2.h or board-fsample.h from hardware.h
Move defines to the board file and remove the now
unnecessary headers.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-23 18:07:32 -07:00
Hiroshi DOYU 8dff0fa55d omap mailbox: remove unnecessary header file inclusion
Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
2009-03-23 18:07:32 -07:00
Hiroshi DOYU 7a781afde6 omap mailbox: convert sequence bit checking to module paramter
Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
2009-03-23 18:07:31 -07:00
Hiroshi DOYU 9ae0ee0076 omap mailbox: move mailbox.h into mailbox.c
no need to keep mailbox.h separately.

Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
2009-03-23 18:07:26 -07:00
Hiroshi DOYU c75ee7520b omap mailbox: add save_/restore_ctx() for PM
To preserve the registers during off-mode

Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
2009-03-23 18:07:26 -07:00
Hiroshi DOYU f48cca8770 omap mailbox: fix empty struct device for omap_mbox
Since "mbox->dev" doesn't exist and isn't created either at
registration, this patch will create "struct device", which belongs to
"omap-mailbox" class and set this pointer for the member of
"struct omap_mbox".

Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
2009-03-23 18:07:24 -07:00
Hiroshi DOYU 6c20a68372 omap mailbox: add initial omap3 support
Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
2009-03-23 18:07:23 -07:00
Russell King 7d83f8fca5 Merge branch 'master' of git://git.marvell.com/orion into devel
Conflicts:

	arch/arm/mach-mx1/devices.c
2009-03-19 23:10:40 +00:00
Russell King be093beb60 [ARM] pass reboot command line to arch_reset()
OMAP wishes to pass state to the boot loader upon reboot in order to
instruct it whether to wait for USB-based reflashing or not.  There is
already a facility to do this via the reboot() syscall, except we ignore
the string passed to machine_restart().

This patch fixes things to pass this string to arch_reset().  This means
that we keep the reboot mode limited to telling the kernel _how_ to
perform the reboot which should be independent of what we request the
boot loader to do.

Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-03-19 16:20:24 +00:00
Nicolas Pitre 58edb51572 [ARM] make page_to_dma() highmem aware
If a machine class has a custom __virt_to_bus() implementation then it
must provide a __arch_page_to_dma() implementation as well which is
_not_ based on page_address() to support highmem.

This patch fixes existing __arch_page_to_dma() and provide a default
implementation otherwise.  The default implementation for highmem is
based on __pfn_to_bus() which is defined only when no custom
__virt_to_bus() is provided by the machine class.

That leaves only ebsa110 and footbridge which cannot support highmem
until they provide their own __arch_page_to_dma() implementation.
But highmem support on those legacy platforms with limited memory is
certainly not a priority.

Signed-off-by: Nicolas Pitre <nico@marvell.com>
2009-03-15 21:01:21 -04:00
Aaro Koskinen e951651657 ARM: OMAP: Allow I2C bus driver to be compiled as a module
Fixes a linker error when OMAP I2C bus driver is compiled as a module:

   ERROR: "i2c_register_board_info" [arch/arm/plat-omap/i2c.ko] undefined!

The I2C utility functions used for board initialization should be always
built-in.

Signed-off-by: Aaro Koskinen <Aaro.Koskinen@nokia.com>
Acked-by: Jarkko Nikula  <jarkko.nikula@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-04 10:07:41 -08:00
Aaro Koskinen 80ea3bac3a ARM: OMAP: sched_clock() corrected
After my OMAP3 board has been running for a while, I'm seeing weird
latency traces like this:

      sh-1574    0d.h2  153us : do_timer (tick_do_update_jiffies64)
      sh-1574    0d.h2  153us : update_wall_time (do_timer)
      sh-1574    0d.h2  153us!: omap_32k_read (update_wall_time)
      sh-1574    0d.h2 1883us : update_xtime_cache (update_wall_time)
      sh-1574    0d.h2 1883us : clocksource_get_next (update_wall_time)
      sh-1574    0d.h2 1883us+: _spin_lock_irqsave (clocksource_get_next)

and after a while:

      sh-17818   0d.h3  153us : do_timer (tick_do_update_jiffies64)
      sh-17818   0d.h3  153us : update_wall_time (do_timer)
      sh-17818   0d.h3  153us!: omap_32k_read (update_wall_time)
      sh-17818   0d.h3 1915us : update_xtime_cache (update_wall_time)
      sh-17818   0d.h3 1915us+: clocksource_get_next (update_wall_time)
      sh-17818   0d.h3 1945us : _spin_lock_irqsave (clocksource_get_next)

Turns out that sched_clock() is using cyc2ns(), which returns NTP
adjusted time. The sched_clock() frequency should not be adjusted. The
patch deletes omap_32k_ticks_to_nsecs() and rewrites sched_clock()
to do the conversion using the constant multiplier.

Signed-off-by: Aaro Koskinen <Aaro.Koskinen@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-04 10:07:41 -08:00
David Brownell 87d99d6f7e ARM: OMAP: Fix compile error if pm.h is included
Change the error to a warning.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-03-04 10:07:40 -08:00
Russell King 4da3782151 [ARM] omap: clk_set_parent: deny changing parent if clock is enabled
Richard Woodruff writes:
| The historic usage of this has been against single use leaf clocks
| (1st instance of gptimer).  When it was used it did:
|       clk_get()
|       clk_set_parent()
|       clk_enable()
|
| This usage was ok for that. Use on a disabled clock is needed.
|
| If there are multiple users on the clock or it is enabled there are
| problems.
|
| The call can still be unfriendly if 2 different drivers are using the
| clock with their own clock get/enable. It might be the function should
| return an error if usecount != 0 to stop surprises.  It is all around
| better if the parenting is done when the clock is off.

This is a good reason to ensure that the clock is not enabled when
clk_set_parent() is called.

Acked-by: Richard Woodruff <r-woodruff2@ti.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-03-03 13:08:18 +00:00
Paul Walmsley d41ad52040 [ARM] OMAP3: update ES level flags to discriminate between post-ES2 revisions
Some OMAP3 chip behaviors change in ES levels after ES2.  Modify the
existing omap_chip flags to add options for ES3.0 and ES3.1.

Add a new macro, CHIP_GE_OMAP3430ES2, to cover ES levels from ES2
onwards - a common pattern for OMAP3 features.  Update all current
users of the omap_chip macros to use this new macro.

Also add CHIP_GE_OMAP3430ES3_1 to cover the USBTLL SAR errata case
(described and fixed in the following patch)

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-23 14:52:51 +00:00
Russell King c0bf31320d [ARM] omap: add support for bypassing DPLLs
This roughly corresponds with OMAP commits: 7d06c48, 3241b19,
88b5d9b, 18a5500, 9c909ac, 5c6497b, 8b1f0bd, 2ac1da8.

For both OMAP2 and OMAP3, we note the reference and bypass clocks in
the DPLL data structure.  Whenever we modify the DPLL rate, we first
ensure that both the reference and bypass clocks are enabled.  Then,
we decide whether to use the reference and DPLL, or the bypass clock
if the desired rate is identical to the bypass rate, and program the
DPLL appropriately.  Finally, we update the clock's parent, and then
disable the unused clocks.

This keeps the parents correctly balanced, and more importantly ensures
that the bypass clock is running whenever we reprogram the DPLL.  This
is especially important because the procedure for reprogramming the DPLL
involves switching to the bypass clock.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-19 17:28:30 +00:00
Russell King 8b9dbc16d4 [ARM] omap: arrange for clock recalc methods to return the rate
linux-omap source commit 33d000c99e
introduces a way to "dry run" clock changes before they're committed.
However, this involves putting logic to handle this into each and
every recalc function, and unfortunately due to the caching, led to
some bugs.

Solve both of issues by making the recalc methods always return the
clock rate for the clock, which the caller decides what to do with.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-14 09:59:21 +00:00
Paul Walmsley be5f34b773 [ARM] OMAP clock: drop clk_get_usecount()
This function is race-prone and mistakenly conveys the impression to
drivers that it is part of the clock interface.  Get rid of it: core
code that absolutely needs this can just check clk->usecount.  Drivers
should not use it at all.

linux-omap source commit is 5df9e4adc2.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 17:50:45 +00:00
Russell King 3f0a820c4c [ARM] omap: create a proper tree of clocks
Traditionally, we've tracked the parent/child relationships between
clk structures by setting the child's parent member to point at the
upstream clock.  As a result, when decending the tree, we have had
to scan all clocks to find the children.

Avoid this wasteful scanning by keeping a list of the clock's children.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 17:50:42 +00:00
Russell King b5088c0d90 [ARM] omap: clks: call recalc after any rate change
This implements the remainder of:
  OMAP clock: move rate recalc, propagation code up to plat-omap/clock.c
from Paul Walmsley which is not covered by the previous:
  [ARM] omap: move clock propagation into core omap clock code
  [ARM] omap: remove unnecessary calls to propagate_rate()
  [ARM] omap: move propagate_rate() calls into generic omap clock code
commits.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 17:50:41 +00:00
Paul Walmsley 87246b7567 [ARM] OMAP2 SDRC: add SDRAM timing parameter infrastructure
For a given SDRAM clock rate, SDRAM chips require memory controllers
to use a specific set of timing minimums and maximums to transfer data
reliably.  These parameters can be different for different memory chips
and can also potentially vary by board.

This patch adds the infrastructure for board-*.c files to pass this
timing data to the SDRAM controller init function.  The timing data is
specified in an 'omap_sdrc_params' structure, in terms of SDRC
controller register values.  An array of these structs, one per SDRC
target clock rate, is passed by the board-*.c file to
omap2_init_common_hw().

This patch does not define the values for different memory chips, nor
does it use the values for anything; those will come in subsequent patches.

linux-omap source commit is bc84ecfc79.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 17:50:39 +00:00
Paul Walmsley f2ab99778a [ARM] OMAP2 SDRC: separate common OMAP2/3 code from OMAP2xxx code
Separate SDRC code common to OMAP2/3 from mach-omap2/sdrc2xxx.c to
mach-omap2/sdrc.c.  Rename the OMAP2xxx-specific functions to use an
'omap2xxx' prefix rather than an 'omap2' prefix, and use "sdrc" in the
function names rather than "memory."  Mark several functions
as static that should not be used outside the sdrc2xxx.c file.

linux-omap source commit is bf1612b9d8.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 17:50:39 +00:00
Paul Walmsley f8de9b2c45 [ARM] OMAP2 SDRC: move mach-omap2/memory.h into mach/sdrc.h
Move the contents of the arch/arm/mach-omap2/memory.h file to the
existing mach/sdrc.h file, and remove memory.h.  Modify files which
include memory.h to include asm/arch/sdrc.h instead.

linux-omap source commit is e7ae2d8992.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 17:50:38 +00:00
Tony Lindgren fed415e48f [ARM] omap: Fix omap1 clock issues
This fixes booting, and is a step toward fixing things properly:

- Make enable_reg u32 instead of u16
  [rmk: virtual addresses are void __iomem *, not u32]
- Get rid of VIRTUAL_IO_ADDRESS for clocks
- Use __raw_read/write instead of omap_read/write for clock registers

This patch adds a bunch of compile warnings until omap1 clock
also uses offsets.

linux-omap source commit is 9d1dff8638.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 17:50:37 +00:00
Paul Walmsley 95f538ac37 [ARM] OMAP3 clock: avoid invalid FREQSEL values during DPLL rate rounding
The DPLL FREQSEL jitter correction bits are set based on a table in
the 34xx TRM, Table 4-38, according to the DPLL's internal clock
frequency "Fint."  Several Fint frequency ranges are missing from this
table.  Previously, we allowed these Fint frequency ranges to be
selected in the rate rounding code, but did not change the FREQSEL bits.
Correspondence with the OMAP hardware team indicates that Fint values
not in the table should not be used.  So, prevent them from being
selected during DPLL rate rounding.  This removes warnings and also
can prevent the chip from locking up.

The first pass through the rate rounding code will update the DPLL max
and min dividers appropriately, so later rate rounding passes will run
faster than the first.

Peter de Schrijver <peter.de-schrijver@nokia.com> put up with several
test cycles of this patch - thanks Peter.

linux-omap source commit is f9c1b82f55.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Peter de Schrijver <peter.de-schrijver@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 17:50:35 +00:00
Paul Walmsley c1bd7aaf67 [ARM] OMAP3 clock: convert dpll_data.idlest_bit to idlest_mask
Convert struct dpll_data.idlest_bit field to idlest_mask.  Needed since
OMAP2 uses two bits for DPLL IDLEST rather than one.

While here, add the missing idlest_* fields for DPLL3.

linux-omap source commits are 25bab0f176
and b0f7fd17db.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 17:50:33 +00:00
Paul Walmsley d37f1a1367 [ARM] OMAP2/3 clockdomains: add CM and PRM clkdms
Add clockdomains for the CM and PRM.  These will ultimately replace the
"wkup_clkdm", which appears to not actually exist on the hardware.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 17:50:29 +00:00
Paul Walmsley 5b74c67660 [ARM] OMAP2/3 clockdomains: combine pwrdm, pwrdm_name into union in struct clockdomain
struct clockdomain contains a struct powerdomain *pwrdm and const char
*pwrdm_name.  The pwrdm_name is only used at initialization to look up
the appropriate pwrdm pointer.  Combining these into a union saves
about 100 bytes on 3430SDP.  This patch should not cause any change in
kernel function.

Updated to gracefully handle autodeps that contain invalid powerdomains,
per Russell King's review comments.

Boot-tested on BeagleBoard ES2.1.

linux-omap source commit is 718fc6cd4d.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 17:50:28 +00:00
Kevin Hilman aeec299011 [ARM] OMAP2: Implement CPUfreq frequency table based on PRCM table
This patch adds a CPUfreq frequency-table implementation for OMAP2 by
walking the PRCM rate-table for available entries and adding them to a
CPUfreq table.

CPUfreq can then be used to manage switching between all the available
entries in the PRCM rate table.  Either use the CPUfreq sysfs
interface directly, (see Section 3 of Documentation/cpu-freq/user-guide.txt)
or use the cpufrequtils package:
http://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html

Signed-off-by: Kevin Hilman <khilman@mvista.com>

Updated to try to use cpufreq_table if it exists.

linux-omap source commit is 77ce544fa4.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 17:50:28 +00:00
Paul Walmsley fecb494bee [ARM] OMAP: Fix sparse, checkpatch warnings in OMAP2/3 PRCM/PM code
Fix sparse & checkpatch warnings in OMAP2/3 PRCM & PM code.  This mostly
consists of:

- converting pointer comparisons to integers in form similar to
  (ptr == 0) to the standard idiom (!ptr)

- labeling a few non-static private functions as static

- adding prototypes for *_init() functions in the appropriate header
  files, and getting rid of the corresponding open-coded extern
  prototypes in other C files

- renaming the variable 'sclk' in mach-omap2/clock.c:omap2_get_apll_clkin
  to avoid shadowing an earlier declaration

Clean up checkpatch issues.  This mostly involves:

- converting some asm/ includes to linux/ includes

- cleaning up some whitespace

- getting rid of braces for conditionals with single following statements

Also take care of a few odds and ends, including:

- getting rid of unlikely() and likely() - none of this code is particularly
  fast-path code, so the performance impact seems slim; and some of those
  likely() and unlikely() indicators are probably not as accurate as the
  ARM's branch predictor

- removing some superfluous casts

linux-omap source commit is 347df59f5d.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 17:50:24 +00:00
Paul Walmsley 16c90f0200 [ARM] OMAP2/3: Add non-CORE DPLL rate set code and M, N programming
Add non-CORE DPLL rate set code and M,N programming for OMAP3.
Connect it to OMAP34xx DPLLs 1, 2, 4, 5 via the clock framework.

You may see some warnings on rate sets from the freqsel code.  The
table that TI presented in the 3430 TRM Rev F does not cover Fint <
750000, which definitely occurs in practice.  However, the lack of this
freqsel case does not appear to impair the DPLL rate change.

linux-omap source commit is 689fe67c6d.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 17:50:24 +00:00
Russell King b820ce4e67 [ARM] omap: mcbsp: convert to use fck/ick clocks directly
Rather than introducing a special 'mcbsp_clk' with code behind it in
mach-omap*/mcbsp.c to handle the SoC specifics, arrange for the mcbsp
driver to be like any other driver.  mcbsp requests its fck and ick
clocks directly, and the SoC specific code deals with selecting the
correct clock.

There is one oddity to deal with - OMAP1 fiddles with the DSP clocks
and DSP reset, so we move this to the two callback functions.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 17:50:19 +00:00
Russell King 2b811bb56a [ARM] omap: remove pre-CLKDEV clk_get/clk_put
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 17:50:15 +00:00
Russell King 44dc9d027f [ARM] omap: convert OMAP3 to use clkdev
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 17:50:15 +00:00
Russell King 8ad8ff6548 [ARM] omap: convert OMAP2 to use clkdev
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 17:50:14 +00:00
Russell King d7e8f1f9d6 [ARM] omap: convert OMAP1 to use clkdev
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 17:50:13 +00:00
Russell King dbb674d57b [ARM] omap: allow double-registering of clocks
This stops things blowing up if a 'struct clk' to be passed more
than once to clk_register(), which will be required when we decouple
struct clk's from their names.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 17:50:12 +00:00
Russell King d5e6072b75 [ARM] omap: handle RATE_CKCTL via .set_rate/.round_rate methods
It makes no sense to have the CKCTL rate selection implemented as a flag
and a special exception in the top level set_rate/round_rate methods.
Provide CKCTL set_rate/round_rate methods, and use these for where ever
RATE_CKCTL is used and they're not already overridden.  This allows us
to remove the RATE_CKCTL flag.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 17:50:11 +00:00
Russell King 9a5fedac18 [ARM] omap: move propagate_rate() calls into generic omap clock code
propagate_rate() is recursive, so it makes sense to minimise the
amount of stack which is used for each recursion.  So, rather than
recursing back into it from the ->recalc functions if RATE_PROPAGATES
is set, do that test at the higher level.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 17:50:11 +00:00
Russell King c6af450852 [ARM] omap: move clock propagation into core omap clock code
Move the clock propagation calls for set_parent and set_rate into
the core omap clock code, rather than having these calls scattered
throughout the OMAP1 and OMAP2 implementations.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 17:50:10 +00:00
Russell King 2e777bf1f2 [ARM] omap: provide a standard clk_get_parent() implementation
which only has to return clk->parent.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 17:49:22 +00:00
Russell King ae8fce5c3b [ARM] omap: remove clk_deny_idle and clk_allow_idle
Nothing makes any use of these functions, so there's little point in
providing them.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 17:46:15 +00:00
Russell King ebb8dca295 [ARM] omap: rearrange clock.h structure order
... to eliminate unnecessary padding.  We have rather a lot of these
structures, so eliminating unnecessary padding results in a saving of
1488 bytes.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 11:38:42 +00:00
Russell King eee5b19119 [ARM] omap: remove clk->owner
clk->owner is always NULL, so its existence doesn't serve any useful
function other than bloating the kernel by 992 bytes.  Remove it.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 11:38:41 +00:00
Russell King 57137181e3 [ARM] omap: kill PARENT_CONTROLS_CLOCK
PARENT_CONTROLS_CLOCK just makes enable/disable no-op, and is
functionally an alias for ALWAYS_ENABLED.  This can be handled
in the same way, using clkops_null.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 11:38:39 +00:00
Russell King 897dcded6f [ARM] omap: provide a NULL clock operations structure
... and use it for clocks which are ALWAYS_ENABLED.  These clocks
use a non-NULL enable_reg pointer for other purposes (such as
selecting clock rates.)

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-08 11:38:39 +00:00
Russell King 548d849574 [ARM] omap: introduce clock operations structure
Collect up all the common enable/disable clock operation functions
into a separate operations structure.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-02 14:52:18 +00:00
Russell King db8ac47cfc [ARM] omap: remove VIRTUAL_CLOCK
Nothing tests the clock flags for this bit, so it serves no purpose.
Remove it.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-02 14:49:08 +00:00
Tony Lindgren 0dffb5c57a ARM: OMAP: Fix hsmmc init, v2
The naming accidentally broke while changing the name for the
driver to not to conflict with the other mmc driver.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-01-29 08:57:16 -08:00
Tony Lindgren 187e688d23 ARM: OMAP: Fix omap34xx revision detection for ES3.1
Fix omap34xx revision detection for ES3.1

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-01-29 08:57:16 -08:00
Jarkko Nikula a92fda194d ARM: OMAP: DMA: Fix uninitialized channel flags
This has similar symptoms than 66c23551b1
where just omap_request_dma, omap_dma_link_lch and omap_dma_unlink_lch
can cause incorrect dump_stack(). Here it can happen if channel has been
used before and the channel flags variable holds old status.

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-01-29 08:57:12 -08:00
Juha Yrjola 320ce6f6fb ARM: OMAP: Fix race in OMAP2/3 DMA IRQ handling
CSR must be cleared before invoking the callback.

If the callback function starts a new, fast DMA transfer on the same
channel, the completion status might lost if CSR is cleared after
the callback invocation.

Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-01-29 08:57:12 -08:00
Stanley.Miao 06151158f2 ARM: OMAP: Fix McBSP spin_lock deadlock
A spin_lock deadlock will occur when omap_mcbsp_request() is invoked.

omap_mcbsp_request()
\- clk_enable(mcbsp->clk)         [takes and holds clockfw_lock]
    \- omap2_clk_enable()
       \- _omap2_clk_enable()
           \- omap_mcbsp_clk_enable()
              \- clk_enable(child clock)   [tries for clockfw_lock again]

mcbsp_clk is a virtual clock and it comprises several child clocks. when
enable mcbsp_clk in omap_mcbsp_request(), the enable function of mcbsp_clk
will enable its child clocks, then the deadlock occurs.

The solution is to remove the virtual clock and enable these child clocks in
omap_mcbsp_request() directly.

Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-01-29 08:57:12 -08:00
Russell King 0b23a0efec [ARM] omap: usb: thou shalt not provide empty release functions
... for devices.  Doing so is a bug, plain and simple, and drives
GregKH round the bend.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-01-24 17:00:45 +00:00
Tony Lindgren 1639058ed1 ARM: OMAP: Fix compile for h3 MMC
Fix compile for h3 MMC

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-01-15 15:06:59 +02:00
Tony Lindgren e999bbe7f1 ARM: OMAP: Remove unused platform devices, v3
This patch removes old platform devices. Alsa should now
be using the ASoC driver. For boards not yet using ASoC,
please see sound/soc/omap/osk5912.c.

Add dummy aic23_power_up and aic23_power_down functions for 770
to keep things compiling.

Remove references to omap_gpio_switch, and unused h2_nand_dev_ready
function.

This patch is based on an earlier patch by Arun KS.

Cc: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Arun KS <arunks@mistralsolutions.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-01-15 14:07:48 +02:00
Tony Lindgren 3127f8f859 ARM: OMAP: Fix ASoC by enabling writes to XCCR and RCCR McBSP registers, v3
This patch enables writing to McBSP Transmit Configuration Control
Register (XCCR) and Receive Configuration Control Register (RCCR)
for 2430/34xx platforms. It also adds XCCR, RCCR entries in McBSP
register configuration structure and bit definitions for both
registers.

If we enable the writing to CCR registers for 2430/34xx and don't
set the default values (setting 0 as a consequence) in ASoC driver,
the Transmit/Receive DMA mode gets disabled and the the
transmission/reception doesn't happen, ending with a
"write error: Input/Output error" when playing with 'aplay'.

Also define dummy CCR registers for omap1.

Cc: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Misael Lopez Cruz <x0052729@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-01-15 13:09:54 +02:00
Anand Gadiyar 4b3cf44846 ARM: OMAP: Fix DMA CCR programming for request line > 63, v3
Bug in existing code causes synchro control to be set +32 if request
line greater than 63 is used.

Also clean up the function a bit by removing extra parens and
clearing the bits at before write.

Reported by Wenbiao Wang.

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-01-15 13:09:53 +02:00
Tony Lindgren 3a26e3318b ARM: OMAP: Fix gpio.c compile on 15xx with CONFIG_DEBUGFS
There are no wakeup registers on 15xx, and suspend_wakeup
does not exist in the struct gpio_bank.

Without this fix we'll get "arch/arm/plat-omap/gpio.c:1792:
error: 'struct gpio_bank' has no member named 'suspend_wakeup'"
as noted by Russell King.

Note that the ifdefs will be cleaned up once the omap gpio
code gets split into omap1 and omap2 specific parts.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-01-15 13:09:53 +02:00
Jarkko Nikula 73069e388d ARM: OMAP: Fix gpio by switching to generic gpio calls, v2
Fix compile by removing remaining omap specific gpio
calls. Based on earlier patches by Jarkko Nikula.

Also remove old GPIO key code, there is already a patch
to do this with gpio_keys.

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2009-01-15 13:09:52 +02:00
Russell King 80b02c172b [ARM] fix AT91, davinci, h720x, ks8695, msm, mx2, mx3, netx, omap1, omap2, pxa, s3c
arch/arm/mach-at91/at91cap9.c:337: error: 'NR_AIC_IRQS' undeclared here (not in a function)
arch/arm/mach-at91/at91rm9200.c:301: error: 'NR_AIC_IRQS' undeclared here (not in a function)
arch/arm/mach-at91/at91sam9260.c:351: error: 'NR_AIC_IRQS' undeclared here (not in a function)
arch/arm/mach-at91/at91sam9261.c:287: error: 'NR_AIC_IRQS' undeclared here (not in a function)
arch/arm/mach-at91/at91sam9263.c:312: error: 'NR_AIC_IRQS' undeclared here (not in a function)
arch/arm/mach-at91/at91sam9rl.c:304: error: 'NR_AIC_IRQS' undeclared here (not in a function)
arch/arm/mach-h720x/h7202-eval.c:38: error: implicit declaration of function 'IRQ_CHAINED_GPIOB'
arch/arm/mach-ks8695/devices.c:46: error: 'KS8695_IRQ_WAN_RX_STATUS' undeclared here (not in a function)
arch/arm/mach-msm/devices.c:28: error: 'INT_UART1' undeclared here (not in a function)
arch/arm/mach-mx2/devices.c:233: error: 'MXC_GPIO_IRQ_START' undeclared here (not in a function)
arch/arm/mach-mx3/devices.c:128: error: 'MXC_GPIO_IRQ_START' undeclared here (not in a function)
arch/arm/mach-omap1/mcbsp.c:140: error: 'INT_730_McBSP1RX' undeclared here (not in a function)
arch/arm/mach-omap1/mcbsp.c:165: error: 'INT_McBSP1RX' undeclared here (not in a function)
arch/arm/mach-omap1/mcbsp.c:200: error: 'INT_McBSP1RX' undeclared here (not in a function)
arch/arm/mach-omap2/board-apollon.c:286: error: implicit declaration of function 'omap_set_gpio_direction'
arch/arm/mach-omap2/mcbsp.c:154: error: 'INT_24XX_MCBSP1_IRQ_RX' undeclared here (not in a function)
arch/arm/mach-omap2/mcbsp.c:181: error: 'INT_24XX_MCBSP1_IRQ_RX' undeclared here (not in a function)
arch/arm/mach-pxa/e350.c:36: error: 'IRQ_BOARD_START' undeclared here (not in a function)
arch/arm/plat-s3c/dev-i2c0.c:32: error: 'IRQ_IIC' undeclared here (not in a function)
...

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-01-08 16:29:42 +00:00
Tony Lindgren 3cb22d6586 USB: otg: sharable otg transceiver ops
Move otg_get/set/put_transceiver() from omap specific code
to common otg.c so other upcoming drivers can share them.

[ dbrownell@users.sourceforge.net: move to drivers/usb/otg, dox ]

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Felipe Balbi <me@felipebalbi.com>
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:03 -08:00
Philipp Zabel 68144e0cc9 USB: otg: add otg_put_transceiver()
As Russell King points out, calling put_device(otg_transceiver->dev)
directly in driver cleanup paths makes assumptions about otg_transceiver
internals.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:02 -08:00
Kay Sievers 1d559e2913 arm: struct device - replace bus_id with dev_name(), dev_set_name()
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-06 10:44:43 -08:00
Russell King cd4348339c Merge branch 'hsmmc-init' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 into devel 2008-12-17 20:03:39 +00:00
Russell King 7e1548a597 Merge branch 'omap3-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 into devel 2008-12-15 22:13:26 +00:00
Tony Lindgren 90c62bf08f omap mmc: Add low-level initialization for hsmmc controller
Add low-level initialization for hsmmc controller. Merged into
this patch patch are various improvments and board support by
Grazvydas Ignotas and David Brownell.

Also change wire4 to be wires, as some newer controllers support
8 data lines.

Cc: Pierre Ossman <drzeus-mmc@drzeus.cx>
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-12-10 17:37:17 -08:00
Tony Lindgren d88746652b omap mmc: Add better MMC low-level init
This will simplify the MMC low-level init, and make it more
flexible to add support for a newer MMC controller in the
following patches.

The patch rearranges platform data and gets rid of slot vs
controller confusion in the old data structures. Also fix
device id numbering in the clock code.

Some code snippets are based on an earlier patch by
Russell King <linux@arm.linux.org.uk>.

Cc: Pierre Ossman <drzeus-mmc@drzeus.cx>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-12-10 17:37:16 -08:00
Arun KS 2619bc3274 ARM: OMAP3: Pin multiplexing updates for 24xx and 34xx
This patch adds some new pin multiplexing options
for McBSP and McSPI from Arun KS. Also add two more
GPIOs from David Brownell.

Also mark omap24xx_cfg_reg() static.

Signed-off-by: Arun KS <arunks@mistralsolutions.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-12-10 17:36:54 -08:00
Santosh Shilimkar a50f18c700 ARM: OMAP3: DMA: Fix for sDMA Errata 1.113
SDMA channel is not disabled after transaction error. So explicitly disable it.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked By : Nishant kamat <nskamat@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-12-10 17:36:53 -08:00
Stanley.Miao b1c056d20c ARM: OMAP3: LDP: Add Ethernet device support to make ldp boot succeess
Add Ethernet device support in board-ldp.c to make ldp can boot and mount
nfs successfully.

Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
2008-12-10 17:36:53 -08:00
Jarkko Nikula ad636ad84e ARM: OMAP3: Add OMAP34xx pin multiplexing into I2C bus registration helper
- Simplify function omap_i2c_mux_pins
- Add OMAP34xx pin multiplexing for busses 1 - 3

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-12-10 17:36:52 -08:00
Paul Walmsley 64ce2907b1 ARM: OMAP2: skip unnecessary TLDR write during non-autoreload for gptimer
The GPTIMER TLDR register does not need to be written if the GPTIMER
is not in autoreload mode.  This is the usual case for dynamic tick-enabled
kernels.

Simulation data indicate that skipping the read that occurs as part of
the write should save at least 300-320 ns for each GPTIMER1 timer
reprogram.  (This assumes L4-Wakeup is at 19MHz and GPTIMER write
posting is enabled.)  Skipping the write itself probably won't have
much impact since it should be posted on the OCP interconnect.

Tested on 2430SDP and 3430SDP.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Richard Woodruff <r-woodruff2@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-12-10 17:36:34 -08:00
Paul Walmsley a94b9e5a81 ARM: OMAP2: drop redundant pending write check for gptimer
omap_dm_timer_write_reg() already waits for pending writes to complete,
so the extra wait in omap_dm_timer_set_load() is superfluous.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Richard Woodruff <r-woodruff2@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-12-10 17:36:33 -08:00
Lauri Leukkunen 84a34344ea ARM: OMAP2: Use omap_rev() instead of system_rev
system_rev is meant for board revision, this patch changes
all relevant instances to use the new omap_rev() function
liberating system_rev to be used with ATAG_REVISION as it
has been designed.

Signed-off-by: Lauri Leukkunen <lauri.leukkunen@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-12-10 17:36:31 -08:00
Tony Lindgren a882314303 ARM: OMAP2: Fix cpu detection
At some point omap2 changed the bits for GET_OMAP_CLASS, which
broke 15xx detection on 730 as noticed by Russell King.

This patch fixes omap2 cpu detection to respect the original
GET_OMAP_CLASS, and simplifies the detection for 34xx.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-12-10 17:36:30 -08:00
Jarkko Nikula f2d18fea8b ARM: OMAP: Switch to gpio_request/free calls
Switch to gpio_request/free calls

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-12-10 17:35:30 -08:00
David Brownell e031ab23de ARM: OMAP: minor gpio bugfixes
Minor GPIO fixes:

 - If get_gpio_bank() fails, then BUG() out.

 - In omap_set_gpio_debounce():
    * protect the read/modify/write with the relevant spinlock
    * make the omap3 clock ops pass "sparse" checking

Except for the spinlock problem, these were reported through "make".

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-12-10 17:35:27 -08:00
Jarkko Nikula 3ff164e155 ARM: OMAP: make legacy gpio request/free calls superfluous
Clean up OMAP GPIO request/free functions

 - Rename and declare static OMAP specific GPIO request/free functions
 - Register them into gpiolib as chip-specific hooks
 - Add omap_request_gpio/omap_free_gpio wrappers for existing code not
   converted yet to use gpiolib

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
[ dbrownell@users.sourceforge.net: remove needless check_gpio() calls ]
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-12-10 17:35:27 -08:00
David Brownell 15f74b0335 ARM: OMAP: use gpio_to_irq
Have most uses of OMAP_GPIO_IRQ() use gpio_to_irq() instead.
Calls used for table initialization are left alone, at least
this time around.

(This patch is for code in both the OMAP tree and mainline.)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-12-10 17:35:26 -08:00
David Brownell e918edf7c2 ARM: OMAP: switch to gpio_direction_output
More conversion to the standard GPIO interfaces:  stop using
omap_set_gpio_direction() entirely, and switch over to the
gpio_direction_output() call.

Note that because gpio_direction_output() includes the initial
value, this change isn't quite transparent.

 - For the call sites which defined an initial value either
   before or after setting the direction, that value was used.

   When that value was previously assigned afterwards, this
   could eliminate a brief output glitch ... and possibly
   change behavior.  In a few cases (LCDs) several values
   were assigned together ... those were re-arranged to match
   the explicit sequence provided.

 - Some call sites didn't define such a value; so I chose an
   initial "off/reset" value that seemed to default to "off".

In short, files touched by this patch might notice some small
changes in startup behavior (with trivial fixes).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-12-10 17:35:26 -08:00
David Brownell 40e3925ba1 ARM: OMAP: switch to gpio_direction_input
More switchover to the cross-platform GPIO interface:
use gpio_direction_input(), not an OMAP-specific call.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-12-10 17:35:26 -08:00
David Brownell 0b84b5ca43 ARM: OMAP: switch to standard gpio get/set calls
This patch replaces some legacy OMAP GPIO calls with the "new" (not
really, any more!) calls that work on most platforms.

The calls addressed by this patch are the simple ones to get and set
values ... for code that's in mainline, including the implementations
of those calls.

Except for the declarations and definitions of those calls, all of
these changes were performed by a simple SED script.  Plus, a few
"if() set() else set()" branches were merged by hand.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-12-10 17:35:25 -08:00
David Brownell a007b7096f ARM: OMAP: gpios implement new to_irq()
Make OMAP use the new __gpio_to_irq() hook, to make it easier to
support IRQs coming in from off-chip gpio controllers like the
TWL4030/TPS65930 chip used on OMAP3 boads like Beagleboard.org and
the Gumstix Overo.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-12-10 17:35:25 -08:00
Jarkko Nikula 21c867f1de ARM: OMAP: Extend gpio label column width in omap_gpio debugfs file
There are already various drivers having bigger label than 10 bytes. Most
of them fit well under 20 bytes but make column width exact so that
oversized labels don't mess up output alignment.

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-12-10 17:35:24 -08:00
Jouni Hogander 89db948254 ARM: OMAP: Enable GPIO debounce clock only when debounce is enabled v3
This patch changes gpio "driver" to enable debounce clock for
gpio-bank only when debounce is enabled for some gpio in that bank.

Gpio functional clocks are also renamed in clock tree, gpioX_fck ->
gpioX_dbck.

This patch triggers problem with gpio wake-up and Omap3. Gpios in PER
domain aren't capable to generate wake-up if PER domain is in sleep
state. For this iopad wake-up should be used and needed pad
configuration should be done. Enabling iopad wake-up for gpio pads is
left for bootloader or omap mux configuration in kernel.

Signed-off-by: Jouni Hogander <jouni.hogander@nokia.com>
Acked-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-12-10 17:35:24 -08:00
Russell King 020f97063d [ARM] omap: fix a pile of issues
This patch fixes a number of sillies, from missing 'const' to using
'return' in void functions, to functions with no arguments not even
'void' and a cast which isn't required.

Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-12-01 17:40:54 +00:00
Russell King 0560cf5aa5 [ARM] Add a common typesafe __io implementation
As Al did for Versatile in 2ad4f86b60,
add a typesafe __io implementation for platforms to use.  Convert
platforms to use this new simple typesafe implementation.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-11-30 11:45:54 +00:00
Russell King dcea83adc6 [ARM] Hide ISA DMA API when ISA_DMA_API is unset
When ISA_DMA_API is unset, we're not implementing the ISA DMA API,
so there's no point in publishing the prototypes via asm/dma.h, nor
including the machine dependent parts of that API.

This allows us to remove a lot of mach/dma.h files which don't contain
any useful code.  Unfortunately though, some platforms put their own
private non-ISA definitions into mach/dma.h, so we leave these behind
and fix the appropriate #include statments.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-11-29 18:42:40 +00:00
Russell King 7ef4de17cc Merge branch 'highmem' into devel
Conflicts:

	arch/arm/mach-clps7500/include/mach/memory.h
2008-11-28 15:39:02 +00:00
Nicolas Pitre b5ee900258 [ARM] remove a common set of __virt_to_bus definitions
Let's provide an overridable default instead of having every machine
class define __virt_to_bus and __bus_to_virt to the same thing.  What
most platforms are using is bus_addr == phys_addr so such is the default.

One exception is ebsa110 which has no DMA what so ever, so the actual
definition is not important except only for proper compilation.  Also
added a comment about the special footbridge bus translation.

Let's also remove comments alluding to set_dma_addr which is not
(and should not) be commonly used.

Signed-off-by: Nicolas Pitre <nico@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-11-28 15:36:49 +00:00
Russell King c750815e2d [ARM] Arrange for platforms to select appropriate CPU support
Rather than:

	config CPU_BLAH
		bool
		depends on ARCH_FOO || MACH_BAR
		default y if ARCH_FOO || MACH_BAR

arrange for ARCH_FOO and MACH_BAR to select CPU_BLAH directly.

Acked-by: Nicolas Pitre <nico@marvell.com>
Acked-by: Andrew Victor <linux@maxim.org.za>
Acked-by: Brian Swetland <swetland@google.com>
Acked-by: Eric Miao <eric.miao@marvell.com>
Acked-by: Nicolas Bellido <ml@acolin.be>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-11-27 12:38:00 +00:00
Tero Kristo 723fdb781a ARM: OMAP: Fixes for suspend / resume GPIO wake-up handling
Use the correct wake-up enable register, and make it
work with 34xx also.

Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-11-26 14:35:16 -08:00
Amit Kucheria 147dcf5489 ARM: OMAP: Typo fix for clock_allow_idle
The second clk_deny_idle instance should be clk_allow_idle instead.

Signed-off-by: Amit Kucheria <amit.kucheria@verdurent.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-11-25 15:11:12 -08:00
Tony Lindgren 5c32f62b97 ARM: OMAP: Fix define for twl4030 irqs
Otherwise twl4030 gpios won't work.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-11-04 13:35:08 -08:00
Tony Lindgren 52414739ca ARM: OMAP: Fix get_irqnr_and_base to clear spurious interrupt bits
On omap24xx, INTCPS_SIR_IRQ_OFFSET bits [6:0] contains the current
active interrupt number.

However, on 34xx INTCPS_SIR_IRQ_OFFSET bits [31:7] also contains the
SPURIOUSIRQFLAG, which gets set if the interrupt sorting information
is invalid.

If the SPURIOUSIRQFLAG bits are not ignored, the interrupt code will
occasionally produce a bunch of confusing errors:

irq -33, desc: c02ddcc8, depth: 0, count: 0, unhandled: 0
->handle_irq():  c006f23c, handle_bad_irq+0x0/0x22c
->chip(): 00000000, 0x0
->action(): 00000000

Fix this by masking out only the ACTIVEIRQ bits. Also fix a
confusing comment.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-11-04 13:35:07 -08:00
Zhaolei e621f266d4 ARM: OMAP: Fix debugfs_create_*'s error checking method for arm/plat-omap
debugfs_create_*() returns NULL if an error occurs, returns -ENODEV
when debugfs is not enabled in the kernel.

Comparing to PATCH v1, because clk_debugfs_init is included in
"#if defined CONFIG_DEBUG_FS", we only need to check NULL return.
Thanks Li Zefan <lizf@cn.fujitsu.com>

debugfs_create_u8() and other function's return value's checking method are
also fixed in this patch.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-11-04 13:35:07 -08:00
Linus Torvalds 2be508d847 Merge git://git.infradead.org/mtd-2.6
* git://git.infradead.org/mtd-2.6: (69 commits)
  Revert "[MTD] m25p80.c code cleanup"
  [MTD] [NAND] GPIO driver depends on ARM... for now.
  [MTD] [NAND] sh_flctl: fix compile error
  [MTD] [NOR] AT49BV6416 has swapped erase regions
  [MTD] [NAND] GPIO NAND flash driver
  [MTD] cmdlineparts documentation change - explain where mtd-id comes from
  [MTD] cfi_cmdset_0002.c: Add Macronix CFI V1.0 TopBottom detection
  [MTD] [NAND] Fix compilation warnings in drivers/mtd/nand/cs553x_nand.c
  [JFFS2] Write buffer offset adjustment for NOR-ECC (Sibley) flash
  [MTD] mtdoops: Fix a bug where block may not be erased
  [MTD] mtdoops: Add a magic number to logged kernel oops
  [MTD] mtdoops: Fix an off by one error
  [JFFS2] Correct parameter names of jffs2_compress() in comments
  [MTD] [NAND] sh_flctl: add support for Renesas SuperH FLCTL
  [MTD] [NAND] Bug on atmel_nand HW ECC : OOB info not correctly written
  [MTD] [MAPS] Remove unused variable after ROM API cleanup.
  [MTD] m25p80.c extended jedec support (v2)
  [MTD] remove unused mtd parameter in of_mtd_parse_partitions()
  [MTD] [NAND] remove dead Kconfig associated with !CONFIG_PPC_MERGE
  [MTD] [NAND] driver extension to support NAND on TQM85xx modules
  ...
2008-10-20 09:03:12 -07:00
Russell King 2502991560 Merge branch 'fixes' into for-linus
Conflicts:

	arch/arm/mach-versatile/core.c
2008-10-15 23:16:07 +01:00
Russell King 7e69a8c4d0 Merge branch 's3c-move' into devel
Conflicts:

	arch/arm/mach-versatile/core.c
2008-10-14 22:24:51 +01:00
Russell King b6825d2df5 Merge branch 'omap-all' into devel
Conflicts:

	arch/arm/mach-omap2/gpmc.c
	arch/arm/mach-omap2/irq.c
2008-10-14 22:24:42 +01:00
Tony Lindgren aa59e19d05 [ARM] 5302/1: ARM: OMAP: Revert omap3 WDT changes to avoid merge conflict
With the upcoming WDT patches OMAP_WDT_BASE is no longer needed
in devices.c. Revert some earlier omap3 changes to avoid merge
conflicts with the WDT patches.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-10-14 22:24:14 +01:00
Tony Lindgren a5a5b8c527 [ARM] 5305/1: ARM: OMAP: Fix compile of McBSP by removing unnecessary check
Recent McBSP patches changed to allocating devices dynamically
and the check for OMAP_MAX_MCBSP_COUNT became unnecessary.

The check for OMAP_MAX_MCBSP_COUNT should have been removed with
the earlier McBSP patches in devices.c but was accidentally left
out.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-10-14 22:24:13 +01:00
Tony Lindgren a468b6484f [ARM] 5301/1: ARM: OMAP: Add missing irq defines
Some McBSP irq defines were missing that should have been added
with the earlier McBSP patches.

Add the missing McBSP irqs, and a few other missing irqs as
defined in linux-omap tree. Also add a blank line to separate
irq defines from the irq line calculations.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-10-14 19:32:45 +01:00
Linus Torvalds 94a9f8ad33 Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
* git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog:
  [WATCHDOG] orion5x_wdt.c: add spinlocking
  [WATCHDOG] Orion: add hardware watchdog support
  [WATCHDOG] omap_wdt.c: cleanup a bit omap_wdt.c
  [WATCHDOG] omap_wdt.c: another ioremap() fix
  [WATCHDOG] omap_wdt.c: sync linux-omap changes
  [WATCHDOG] Add AT91SAM9X watchdog
  [WATCHDOG] Add driver for winbond w83697ug/uf watchdog feature
  [WATCHDOG] add watchdog driver IT8716 IT8726 IT8712J/K
2008-10-12 11:51:32 -07:00
Linus Torvalds 7cc4e87f91 Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (236 commits)
  [ARM] 5300/1: fixup spitz reset during boot
  [ARM] 5295/1: make ZONE_DMA optional
  [ARM] 5239/1: Palm Zire 72 power management support
  [ARM] 5298/1: Drop desc_handle_irq()
  [ARM] 5297/1: [KS8695] Fix two compile-time warnings
  [ARM] 5296/1: [KS8695] Replace macro's with trailing underscores.
  [ARM] pxa: allow multi-machine PCMCIA builds
  [ARM] pxa: add preliminary CPUFREQ support for PXA3xx
  [ARM] pxa: add missing ACCR bit definitions to pxa3xx-regs.h
  [ARM] pxa: rename cpu-pxa.c to cpufreq-pxa2xx.c
  [ARM] pxa/zylonite: add support for USB OHCI
  [ARM] ohci-pxa27x: use ioremap() and offset for register access
  [ARM] ohci-pxa27x: introduce pxa27x_clear_otgph()
  [ARM] ohci-pxa27x: use platform_get_{irq,resource} for the resource
  [ARM] ohci-pxa27x: move OHCI controller specific registers into the driver
  [ARM] ohci-pxa27x: introduce flags to avoid direct access to OHCI registers
  [ARM] pxa: move I2S register and bit definitions into pxa2xx-i2s.c
  [ARM] pxa: simplify DMA register definitions
  [ARM] pxa: make additional DCSR bits valid for PXA3xx
  [ARM] pxa: move i2c register and bit definitions into i2c-pxa.c
  ...

Fixed up conflicts in
	arch/arm/mach-versatile/core.c
	sound/soc/pxa/pxa2xx-ac97.c
	sound/soc/pxa/pxa2xx-i2s.c
manually.
2008-10-11 10:09:45 -07:00
Russell King 59aaade725 Merge branch 'omap3-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 into omap-all 2008-10-10 23:10:10 +01:00
Felipe Balbi 2817142f31 [WATCHDOG] omap_wdt.c: sync linux-omap changes
These are changes that have been sitting in linux-omap
and were never sent upstream.

Hopefully, it'll never happen again at least for this
driver.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2008-10-10 13:11:10 +00:00
Vladimir Barinov d6b52039c9 ALSA: Correct Vladimir Barinov's e-mail address
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-10-10 13:41:45 +02:00
Nishant Kamat 492656511b ARM: OMAP3: Add basic board support for OMAP LDP
This adds minimal board support for the OMAP3430 LDP development platform.

Signed-off-by: Nishant Kamat <nskamat@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-10-10 12:06:43 +03:00
Russell King c97f68145e Merge branch 'for-rmk' of git://source.mvista.com/git/linux-davinci-2.6.git
Merge branch 'davinci' into devel
2008-10-09 21:33:05 +01:00
Russell King 3f30a09a61 Merge branch 'pxa-all' into devel
Conflicts:

	arch/arm/mach-pxa/Kconfig
	arch/arm/mach-pxa/corgi.c
	arch/arm/mach-pxa/include/mach/hardware.h
	arch/arm/mach-pxa/spitz.c
2008-10-09 21:33:02 +01:00
Russell King 6a4690c22f Merge branch 'ptebits' into devel
Conflicts:

	arch/arm/Kconfig
2008-10-09 21:31:56 +01:00
Russell King 8e5bdc44ba Merge branch 'omap2-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 into omap-all 2008-10-09 17:21:34 +01:00
Steve Sakoman eba2645aeb ARM: OMAP3: Add support for the Gumstix Overo board (rev 3)
This patch adds minimal overo support.

Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-10-09 17:51:43 +03:00
Syed Mohammed, Khasim 2885f00049 ARM: OMAP3: Add minimal Beagle board support
Add minimal Beagle board support. Based on earlier patches
by Syed Mohammed Khasim with some fixes from linux-omap tree.

Signed-off-by: Syed Mohammed Khasim <khasim@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-10-09 17:51:42 +03:00
Syed Mohammed, Khasim cc26b3b01b ARM: OMAP3: Add minimal omap3430 support
Add minimal omap3430 support based on earlier patches from
Syed Mohammed Khasim. Also merge in omap34xx SRAM support
from Karthik Dasu and use consistent naming for sram init
functions.

Also do following changes that make 34xx support usable:

- Remove unused sram.c functions for 34xx

- Rename IRQ_SIR_IRQ to INTCPS_SIR_IRQ and define it locally
  in entry-macro.S

- Update mach-omap2/io.c to support 2420, 2430, and 34xx

- Also merge in 34xx GPMC changes to add fields wr_access and
  wr_data_mux_bus from Adrian Hunter

- Remove memory initialization call omap2_init_memory() until
  until more generic memory initialization patches are posted.
  It's OK to rely on bootloader initialization until then.

Signed-off-by: Syed Mohammed, Khasim <khasim@ti.com>
Signed-off-by: Karthik Dasu<karthik-dp@ti.com>
Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-10-09 17:51:41 +03:00
Dmitry Baryshkov d8aa0251f1 [ARM] 5298/1: Drop desc_handle_irq()
desc_handle_irq() was declared as obsolete since long ago.
Replace it with generic_handle_irq()

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-10-09 15:00:36 +01:00
Jarkko Nikula 5a07055a38 ARM: OMAP: Fixes to omap_mcbsp_request function
Bootloader may let McBSP logic running so make sure that block is idle
before requesting IRQs. Also make sure that TX and RX waitqueues are
initialized before request_irq.

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-10-08 10:01:41 +03:00
Jarkko Nikula 05228c35c6 ARM: OMAP: Add support for OMAP2430 in McBSP
Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-10-08 10:01:40 +03:00
Chandra Shekhar 9c8e3a0fac ARM: OMAP: Add support for McBSP devices 3 - 5 on 34xx
Based on Chandra's earlier patches in linux-omap tree.

Signed-off-by: Chandra Shekhar <x0044955@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-10-08 10:01:40 +03:00
Chandra Shekhar b4b58f5834 ARM: OMAP: Allocate McBSP devices dynamically
Based on Chandra's earlier patches in linux-omap tree.

Note that omap1_mcbsp_check and omap2_mcbsp_check are no longer
needed as there's now omap_mcbsp_check_valid_id() defined.

Also some functions can now be marked __init.

Signed-off-by: Chandra Shekhar <x0044955@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-10-08 10:01:39 +03:00
Uwe Kleine-König 25cef22514 Fix sections for omap-mcbsp platform driver
Don't use __init but __devinit to define probe function.  A pointer to
omap_mcbsp_probe is passed to the core via platform_driver_register and
so the function must not disappear when the init code is freed.  Using
__init and having HOTPLUG=y the following probably oopses:

	echo -n omap-mcbsp.1 > /sys/bus/platform/driver/omap-mcbsp/unbind
	echo -n omap-mcbsp.1 > /sys/bus/platform/driver/omap-mcbsp/bind

While at it move the remove function to the .devexit.text section.

Signed-off-by: Uwe Kleine-König <ukleinek@strlen.de>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-10-08 10:01:39 +03:00
Tony Lindgren 646e3ed1a3 ARM: OMAP2: Misc updates from linux-omap tree
Misc updates from linux-omap tree, mostly to update common
device initialization and add missing defines from linux-omap
tree. Also some changes to make room for adding 34xx in
following patches.

Note that the I2C resources are now set up in
arch/arm/plat-omap/i2c.c helper, and can be removed
from devices.c.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-10-06 15:49:36 +03:00
Paul Walmsley fd1dc87ded ARM: OMAP2: Fix sparse, checkpatch warnings fro GPMC code, use ioremap
Fix sparse, checkpatch warnings fro GPMC code.

Also change to use ioremap, and add missing function prototypes
to gpmc.h.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-10-06 15:49:17 +03:00
Vikram Pandita 2351872c44 ARM: OMAP2: Add pinmux support for omap34xx
This patch adds pinmux support for OMAP3. Incorporated review comments
from Tony to make mux_value as bit mask. Tested on 3430SDP.

Also merge in adding of I2C pins from Jarkko Nikula.

Acked-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-10-06 15:49:16 +03:00
Tony Lindgren 0e56484869 ARM: OMAP2: Use omap_globals for CPU detection for multi-omap
This allows to get rid of the ifdefs and will allow simpler
CPU detection in the future.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-10-06 15:49:16 +03:00
Tony Lindgren 1835f1d720 ARM: OMAP2: Move sleep.S into sleep24xx.S
Some register offsets are different for 242x and 243x. This
will allow compiling sleep code for both chips into the same
kernel. Pass the addresses for SDRC_DDLA_CTRL and SDRC_POWER to the
omap24xx_cpu_suspend instead of loading the values since the only.

Also fix a bug to call omap2_sram_suspend with the value of SDRC_DLLA_CTRL
instead of the address as that's what omap24xx_cpu_suspend expects to
determine between DDR and SDR. This bug has not been noticed as
the boards seem to have DDR instead of SDR.

Note that some PM patches are still missing. The PM patches will
be added later on once the base files are in sync with linux-omap
tree.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-10-06 15:49:15 +03:00
Jouni Hogander 6e81176dc8 ARM: OMAP2 Provide function to enable/disable uart clocks
This patch adds common function to enable/disable omap2/3 uart
clocks. Enabled uarts are passed by bootloader in atags and clocks for
these enabled uarts are touched.

Signed-off-by: Jouni Hogander <jouni.hogander@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-10-06 15:49:15 +03:00
Russell King 56f68556d7 Merge unstable branch 'omap-rmk'
Merge branch 'omap-rmk' into omap-all
2008-10-03 11:52:33 +01:00
Russell King fd9470ce3a Merge branch 'omap2-clock' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git
Merge branch 'omap2-clock' into omap-all
2008-10-03 11:52:30 +01:00
Russell King 7e8bc3c6db [ARM] omap: back out 'internal_clock' support
The structures weren't ready for this change:

arch/arm/plat-omap/devices.c:320: error: 'struct omap_mmc_conf' has no member named 'internal_clock'
arch/arm/plat-omap/devices.c:326: error: implicit declaration of function 'omap_ctrl_readl'
arch/arm/plat-omap/devices.c:326: error: 'OMAP2_CONTROL_DEVCONF0' undeclared (first use in this function)
arch/arm/plat-omap/devices.c:328: error: implicit declaration of function 'omap_ctrl_writel'

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-09-17 21:01:55 +01:00
Russell King 7736c09c6c [ARM] OMAP: Fix MMC device data
OMAPs MMC device data was passing the wrong structure via the platform
device.  Moreover, a missing function means that both sx1_defconfig
and omap_h2_1610_defconfig builds failed with

	undefined reference to `omap_set_mmc_info'

errors.  Fix this by updating the MMC support from the omapzoom tree.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-09-11 10:28:38 +01:00
Russell King fced80c735 [ARM] Convert asm/io.h to linux/io.h
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-09-06 12:10:45 +01:00
Russell King c0fc18c5bf [ARM] omap: fix lots of 'Using plain integer as NULL pointer'
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-09-05 17:02:33 +01:00
Russell King 7c7095aa42 [ARM] omap: fix inappropriate casting in gpio.c
gpio.c wilfully casts physical addresses to void __iomem * and then
fixes them up at runtime using:

	bank->base = IO_ADDRESS(bank->base);

where accesses prior to this fixup are via omap_read/omap_write, and
after are by __raw_read/__raw_write.  This doesn't lend itself to
static checking, nor to easy understanding of the code.

And so, OMAP_MPUIO_BASE gets to be the right type - integer like since
it's a physical address, not a MMIO pointer.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-09-05 17:02:33 +01:00
Russell King 0062f1048b [ARM] omap: make sure virtual mmio addresses are __iomem pointer-like
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-09-05 17:02:32 +01:00
Russell King e8a91c953f [ARM] omap: Fix IO_ADDRESS() macros
OMAP1_IO_ADDRESS(), OMAP2_IO_ADDRESS() and IO_ADDRESS() returns cookies
for use with __raw_{read|write}* for accessing registers.  Therefore,
these macros should return (void __iomem *) cookies, not integer values.

Doing this improves typechecking, and means we can find those places
where, eg, DMA controllers are incorrectly given virtual addresses to
DMA to, or physical addresses are thrown through a virtual to physical
address translation.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-09-05 17:02:31 +01:00
Russell King d592dd1adc [ARM] omap: convert mcbsp to use ioremap()
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-09-05 17:02:30 +01:00
Russell King 690b5a13b2 [ARM] omap: allow ioremap() to use our fixed IO mappings
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-09-05 17:02:29 +01:00
Russell King 5668545a08 [ARM] omap: improve is_omap_port()
Make is_omap_port() take the uart_8250_port structure so it can do
whatever test it desires.  Convert the test to compare the physical
addresses rather than virtual addresses.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-09-05 17:02:28 +01:00
Russell King 65846909d6 [ARM] omap: fix virtual vs physical address space confusions
mcbsp is confused as to what takes a physical or virtual address.
Fix the two instances where it gets it wrong.

Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-09-04 22:21:19 +01:00
Russell King 69114a47af [ARM] omap: fix gpio.c build error
arch/arm/plat-omap/gpio.c: In function '_omap_gpio_init':
arch/arm/plat-omap/gpio.c:1492: error: 'omap_mpuio_device' undeclared (first use in this function)

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-09-03 10:15:26 +01:00
Jean PIHET d7ac4e28cc [ARM] 5195/1: ARMv7 Oprofile support
Add Oprofile kernel support for ARMv7.
Tested on OMAP3430 and OMAP3530 chipsets (Cortex-A8).

Signed-off-by: Jean Pihet <jpihet@mvista.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-09-01 12:06:25 +01:00
David Woodhouse 9d7548d4ca Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2008-09-01 11:32:13 +01:00
Adrian Bunk 7a8fc9b248 removed unused #include <linux/version.h>'s
This patch lets the files using linux/version.h match the files that
#include it.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-08-23 12:14:12 -07:00
Paul Walmsley 0b7cbfb5e1 [ARM] OMAP3 pwrdm: add hardware save-and-restore (SAR) support
OMAP3430ES2+ introduces a new feature: optional powerdomain context
hardware save-and-restore (SAR).  Currently, this feature only applies
to USBHOST and USBTLL module context when the USBHOST or CORE
powerdomains enter a low-power sleep state[1].  This feature avoids
re-enumeration of USB devices when the powerdomains return from idle,
which is potentially time-consuming.

This patch adds support for enabling and disabling hardware
save-and-restore to the powerdomain code.  Three new functions are
added, pwrdm_enable_hdwr_sar(), pwrdm_disable_hdwr_sar(), and
pwrdm_can_hdwr_sar().  A new struct powerdomain "flags" field is
added, with a PWRDM_HAS_HDWR_SAR flag to indicate powerdomains with
SAR support.

Thanks to Jouni Högander <jouni.hogander@nokia.com> for reviewing an
earlier version of these patches, and Richard Woodruff <r-woodruff2@ti.com>
for clarifying the purpose of these bits.

1.  For the USBHOST controller module, context loss occurs when the
    USBHOST powerdomain enters off-idle.  For USBTLL, context loss
    occurs either if CORE enters off-idle, or if the CORE logic is
    configured to turn off when CORE enters retention-idle (OSWR).
    34xx ES2 TRM 4.8.6.1.1, 4.8.6.1.2

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-08-21 21:26:39 +01:00
Paul Walmsley d1b03f615a ARM: OMAP2: Clockdomain: Associate clocks with clockdomains
Associate each OMAP24xx clock in arch/arm/mach-omap2/clock24xx.h
with a clockdomain.

Also move the L4 clock up higher in the file in preparation to
define the SSI L4 iclk.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-08-19 11:08:44 +03:00
Paul Walmsley 8420bb1363 ARM: OMAP2: Clockdomain: Connect clockdomain code to powerdomain code
Thie patch adds code to the powerdomain layer to track the
clockdomains associated with each powerdomain.

It also modifies the clockdomain code to register clockdomains
with their corresponding powerdomain when the clockdomain is registered.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-08-19 11:08:44 +03:00
Paul Walmsley d459bfe01f ARM: OMAP2: Clockdomain: Add base OMAP2/3 clockdomain code
This patch creates an interface to the clockdomain registers in the
PRM/CM modules on OMAP2/3.  This interface is intended to be used by
PM code, e.g., pm.c; not by device drivers directly.

The patch also adds clockdomain usecount tracking.  This is intended
to be called whenever the first clock in a clockdomain is enabled, or
when the last enabled clock in a clockdomain is disabled.  If the
clockdomain is in software-supervised mode, the code will force-wakeup
or force-sleep the clockdomain.  If the clockdomain is in
hardware-supervised mode, the first clock enable will add sleep and
wakeup dependencies on a user-selectable set of parent domains (usually
MPU & IVA2), and the disable will remove them.

Each clockdomain will be defined in later patches as static
structures.  The clockdomain structures are linked into a list at boot
by clkdm_register(), similar to the OMAP clock code.

The patch adds a Kconfig option, CONFIG_OMAP_DEBUG_CLOCKDOMAIN, which
when enabled will emit verbose debug messages via pr_debug().

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-08-19 11:08:43 +03:00
Paul Walmsley ad67ef6848 ARM: OMAP2: Powerdomain: Add base OMAP2/3 powerdomain code
This patch creates an interface to the powerdomain registers in the
PRM/CM modules on OMAP2/3.  This interface is intended to be used by
PM code, e.g., pm.c; not by device drivers directly.

Each powerdomain will be defined in later patches as static
structures.  Also defined are dependencies between powerdomains,
used for adding and removing PM_WKDEP and CM_SLEEPDEP bits.  The
powerdomain structures are linked into a list at boot by
pwrdm_register(), similar to the OMAP clock code.

The patch adds a Kconfig option, CONFIG_OMAP_DEBUG_POWERDOMAIN, which
when enabled will emit verbose debug messages via pr_debug().

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-08-19 11:08:40 +03:00
David Woodhouse 742c52533b Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:

	include/asm-arm/arch-omap/onenand.h
2008-08-12 11:28:00 +01:00
Russell King 98ed7d4b1a [ARM] dma-mapping: improve type-safeness of DMA translations
OMAP at least gets the return type(s) for the DMA translation functions
wrong, which can lead to subtle errors.  Avoid this by moving the DMA
translation functions to asm/dma-mapping.h, and converting them to
inline functions.

Fix the OMAP DMA translation macros to use the correct argument and
result types.

Also, remove the unnecessary casts in dmabounce.c.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-08-10 12:10:49 +01:00
Russell King a09e64fbc0 [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach
This just leaves include/asm-arm/plat-* to deal with.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-08-07 09:55:48 +01:00
Russell King be50972935 [ARM] Remove asm/hardware.h, use asm/arch/hardware.h instead
Remove includes of asm/hardware.h in addition to asm/arch/hardware.h.
Then, since asm/hardware.h only exists to include asm/arch/hardware.h,
update everything to directly include asm/arch/hardware.h and remove
asm/hardware.h.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-08-07 09:40:08 +01:00
Russell King 0f8469a54f [ARM] Eliminate useless includes of asm/mach-types.h
There are 43 includes of asm/mach-types.h by files that don't
reference anything from that file.  Remove these unnecessary
includes.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-08-07 09:40:04 +01:00
Dmitry Baryshkov 6cab486029 [ARM] 5179/1: Replace obsolete IRQT_* and __IRQT_* values with IRQ_TYPE_*
IRQT_* and __IRQT_* were obsoleted long ago by patch [3692/1].
Remove them completely. Sed script for the reference:

s/__IRQT_RISEDGE/IRQ_TYPE_EDGE_RISING/g
s/__IRQT_FALEDGE/IRQ_TYPE_EDGE_FALLING/g
s/__IRQT_LOWLVL/IRQ_TYPE_LEVEL_LOW/g
s/__IRQT_HIGHLVL/IRQ_TYPE_LEVEL_HIGH/g
s/IRQT_RISING/IRQ_TYPE_EDGE_RISING/g
s/IRQT_FALLING/IRQ_TYPE_EDGE_FALLING/g
s/IRQT_BOTHEDGE/IRQ_TYPE_EDGE_BOTH/g
s/IRQT_LOW/IRQ_TYPE_LEVEL_LOW/g
s/IRQT_HIGH/IRQ_TYPE_LEVEL_HIGH/g
s/IRQT_PROBE/IRQ_TYPE_PROBE/g
s/IRQT_NOEDGE/IRQ_TYPE_NONE/g

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-07-27 09:46:18 +01:00
David Brownell d8f388d8dc gpio: sysfs interface
This adds a simple sysfs interface for GPIOs.

    /sys/class/gpio
    	/export ... asks the kernel to export a GPIO to userspace
    	/unexport ... to return a GPIO to the kernel
        /gpioN ... for each exported GPIO #N
	    /value ... always readable, writes fail for input GPIOs
	    /direction ... r/w as: in, out (default low); write high, low
	/gpiochipN ... for each gpiochip; #N is its first GPIO
	    /base ... (r/o) same as N
	    /label ... (r/o) descriptive, not necessarily unique
	    /ngpio ... (r/o) number of GPIOs; numbered N .. N+(ngpio - 1)

GPIOs claimed by kernel code may be exported by its owner using a new
gpio_export() call, which should be most useful for driver debugging.
Such exports may optionally be done without a "direction" attribute.

Userspace may ask to take over a GPIO by writing to a sysfs control file,
helping to cope with incomplete board support or other "one-off"
requirements that don't merit full kernel support:

  echo 23 > /sys/class/gpio/export
	... will gpio_request(23, "sysfs") and gpio_export(23);
	use /sys/class/gpio/gpio-23/direction to (re)configure it,
	when that GPIO can be used as both input and output.
  echo 23 > /sys/class/gpio/unexport
	... will gpio_free(23), when it was exported as above

The extra D-space footprint is a few hundred bytes, except for the sysfs
resources associated with each exported GPIO.  The additional I-space
footprint is about two thirds of the current size of gpiolib (!).  Since
no /dev node creation is involved, no "udev" support is needed.

Related changes:

  * This adds a device pointer to "struct gpio_chip".  When GPIO
    providers initialize that, sysfs gpio class devices become children of
    that device instead of being "virtual" devices.

  * The (few) gpio_chip providers which have such a device node have
    been updated.

  * Some gpio_chip drivers also needed to update their module "owner"
    field ...  for which missing kerneldoc was added.

  * Some gpio_chips don't support input GPIOs.  Those GPIOs are now
    flagged appropriately when the chip is registered.

Based on previous patches, and discussion both on and off LKML.

A Documentation/ABI/testing/sysfs-gpio update is ready to submit once this
merges to mainline.

[akpm@linux-foundation.org: a few maintenance build fixes]
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de>
Cc: Greg KH <greg@kroah.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-25 10:53:30 -07:00
Andrea Righi 27ac792ca0 PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures
On 32-bit architectures PAGE_ALIGN() truncates 64-bit values to the 32-bit
boundary. For example:

	u64 val = PAGE_ALIGN(size);

always returns a value < 4GB even if size is greater than 4GB.

The problem resides in PAGE_MASK definition (from include/asm-x86/page.h for
example):

#define PAGE_SHIFT      12
#define PAGE_SIZE       (_AC(1,UL) << PAGE_SHIFT)
#define PAGE_MASK       (~(PAGE_SIZE-1))
...
#define PAGE_ALIGN(addr)       (((addr)+PAGE_SIZE-1)&PAGE_MASK)

The "~" is performed on a 32-bit value, so everything in "and" with
PAGE_MASK greater than 4GB will be truncated to the 32-bit boundary.
Using the ALIGN() macro seems to be the right way, because it uses
typeof(addr) for the mask.

Also move the PAGE_ALIGN() definitions out of include/asm-*/page.h in
include/linux/mm.h.

See also lkml discussion: http://lkml.org/lkml/2008/6/11/237

[akpm@linux-foundation.org: fix drivers/media/video/uvc/uvc_queue.c]
[akpm@linux-foundation.org: fix v850]
[akpm@linux-foundation.org: fix powerpc]
[akpm@linux-foundation.org: fix arm]
[akpm@linux-foundation.org: fix mips]
[akpm@linux-foundation.org: fix drivers/media/video/pvrusb2/pvrusb2-dvb.c]
[akpm@linux-foundation.org: fix drivers/mtd/maps/uclinux.c]
[akpm@linux-foundation.org: fix powerpc]
Signed-off-by: Andrea Righi <righi.andrea@gmail.com>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:21 -07:00
Johannes Weiner 3560e249ab bootmem: replace node_boot_start in struct bootmem_data
Almost all users of this field need a PFN instead of a physical address,
so replace node_boot_start with node_min_pfn.

[Lee.Schermerhorn@hp.com: fix spurious BUG_ON() in mark_bootmem()]
Signed-off-by: Johannes Weiner <hannes@saeureba.de>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:20 -07:00
Kay Sievers 3f9787046e arm: bus_id -> dev_name() and dev_set_name() conversions
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-07-21 21:55:03 -07:00
Kay Sievers aab0de2451 driver core: remove KOBJ_NAME_LEN define
Kobjects do not have a limit in name size since a while, so stop
pretending that they do.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-07-21 21:54:52 -07:00
Tony Lindgren a58caad113 ARM: OMAP: Introduce omap_globals and prcm access functions for multi-omap
New struct omap_globals contains the omap processor specific
module bases. Use omap_globals to set the various base addresses
to make detecting omap chip type simpler.

Also introduce OMAP1_IO_ADDRESS and OMAP2_IO_ADDRESS for future multi-omap
patches.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-07-03 12:24:44 +03:00
Tony Lindgren f35ae63468 ARM: OMAP: USB: Change omap USB code to use omap_read/write instead of __REG
Change omap USB code to use omap_read/write instead of __REG for multi-omap

Cc: David Brownell <david-b@pacbell.net>
Cc: linux-usb@vger.kernel.org
Cc: i2c@lm-sensors.org
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-07-03 12:24:43 +03:00
Hiroshi DOYU 137b3ee27a ARM: OMAP: CLKFW: Initial debugfs support for omap clock framework
debugfs can provide the infrastructure to trace the dependencies of
clock tree hierarchy quite visibly. This patch enables to keep track
of clock tree hierarchy and expose their attributes under each clock
directry as below:

	omap:~# tree -d -L 2 /debug/clock/omap_32k_fck/
	/debug/clock/omap_32k_fck/
	|-- gpt10_fck
	|-- gpt11_fck
	|-- gpt1_fck
	|-- per_32k_alwon_fck
	|   |-- gpio2_fck
	|   |-- gpio3_fck
	|   |-- gpio4_fck
	|   |-- gpio5_fck
	|   |-- gpio6_fck
	|   `-- wdt3_fck
	|-- ts_fck
	`-- wkup_32k_fck
	    |-- gpio1_fck
	    `-- wdt2_fck

	14 directories
	omap:~# tree  /debug/clock/omap_32k_fck/gpt10_fck/
	/debug/clock/omap_32k_fck/gpt10_fck/
	|-- flags
	|-- rate
	`-- usecount

	0 directories, 3 files

Although, compared with David Brownell's small patch, this may look
bit overkilling, I expect that this debugfs can deal with other PRCM
complexities at the same time. For example, powerdomain dependencies
can be expressed by using symbolic links of these clocks if
powerdomain supports dubgfs as well.

Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-07-03 12:24:41 +03:00
Eduardo Valentin bc5d0c89c8 ARM: OMAP: McBSP: Prepare for splitting into omap1 and omap2 code
This patch transform mcbsp code to use platform data
from arch/arm/plat-omap/devices.c

It also gets ride of ifdefs on mcbsp.c code.
To do it, a platform data structure was defined.

Signed-off-by: Eduardo Valentin <eduardo.valentin@indt.org.br>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-07-03 12:24:39 +03:00
Eduardo Valentin fb78d80808 ARM: OMAP: McBSP: Coding style cleanup on arch/arm/plat-omap/mcbsp.c
This patch fix lots of warnings and errors reported by
scripts/checkpatch.pl on arch/arm/plat-omap/mcbsp.c.

Signed-off-by: Eduardo Valentin <eduardo.valentin@indt.org.br>
Acked-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-07-03 12:24:39 +03:00
Tony Lindgren c2d43e39c7 ARM: OMAP: SRAM: Split sram24xx.S into sram242x.S and sram243x.S
Split sram24xx.S into sram242x.S and sram243x.S

Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-07-03 12:24:38 +03:00
Tony Lindgren 99f143b316 ARM: OMAP: SRAM: Move sram-fn.S from plat-omap to mach-omap1
This file is omap1 specific.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-07-03 12:24:38 +03:00
Tony Lindgren 97b7f71558 ARM: OMAP: DMA: Clean-up code
DMA clean-up, mostly checkpatch.pl fixes.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-07-03 12:24:37 +03:00
Tony Lindgren 0499bdeb1d ARM: OMAP: DMA: Remove __REG access
Remove __REG access in DMA code, use dma_read/write instead:

- dynamically set the omap_dma_base based on the omap type
- omap_read/write becomes dma_read/write
- dma channel registers are read with dma_ch_read/write

Cc: David Brownell <david-b@pacbell.net>
Cc: linux-usb@vger.kernel.org
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-07-03 12:24:36 +03:00
Tony Lindgren 4d96372e6d ARM: OMAP: DMA: Make channels dynamic for multi-boot
Make DMA channels dynamic for multi-boot

Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-07-03 12:24:31 +03:00
Richard Woodruff 3fddd09e59 ARM: OMAP: DMTimer: Optimize by adding load and start
This patch optimizes the timer load and start sequence.  By combining the
load and start a needless posted wait can be removed from the system timer
execution path.

* Before patch register writes are taking up .078% @ 500MHz during idle.

 Address                 |total  |min  |max      |avr     |count|ratio%
 old\process\default_idle|7.369s |0.0us|999.902ms|14.477ms|509. |62.661%
 ld\Global\cpu_v7_do_idle|4.265s |0.0us|375.786ms|24.374ms|175. |36.270%
                (UNKNOWN)|17.503ms|0.us|531.080us|5.119us|3419. |0.148%
 r\omap_dm_timer_set_load|8.135ms|0.0us|79.887us|15.065us|540.  |0.069% <--
 \vmlinux-old\Global\_end|2.023ms|0.0us|4.000us|0.560us|3613.   |0.017%
 -old\Global\__raw_readsw|1.962ms|0.0us|108.610us|9.167us|214.  |0.016%
 old\smc91x\smc_interrupt|1.353ms|0.0us|10.212us|2.348us|576.   |0.011%
 s/namei\__link_path_walk|1.161ms|0.0us|4.310us|0.762us|  1524. |0.009%
 \omap_dm_timer_write_reg|1.085ms|0.0us|126.150us|2.153us|504.  |0.009% <--

* After patch timer functions do not show up in top listings for long captures.

Signed-off-by: Richard Woodruff <r-woodruff2@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-07-03 12:24:30 +03:00
Richard Woodruff 0f0d080709 ARM: OMAP: DMTimer: Use posted mode
This patch adds the use of write posting for the timer.  Previously, every
write could lock the requestor for almost 3x32KHz cycles.  This patch only
synchronizes before writes and reads instead of after them and it does
it on per register basis.  Doing it this way there is some chance to hide
some of the sync latency.  It also removes some needless reads when
non-posted mode is there.  With out this fix the read/writes take almost
2% CPU load @500MHz just waiting on tick timer registers.

Also define new 34xx only registers.

Signed-off-by: Richard Woodruff <r-woodruff2@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-07-03 12:24:30 +03:00
Jarkko Nikula 66c23551b1 ARM: OMAP: DMA: Don't mark channel active in omap_enable_channel_irq
Channel should be marked active only when DMA is really started. Otherwise
just omap_request_dma, omap_dma_link_lch and omap_dma_unlink_lch will cause
incorrect dump_stack().

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-06-05 14:30:15 -07:00
Russell King b851cb289d [ARM] omap: fix omap clk support build errors
arch/arm/plat-omap/clock.c:397: warning: "struct cpufreq_frequency_table" declared inside parameter list
arch/arm/plat-omap/clock.c:397: warning: its scope is only this definition or declaration, which is probably not what you want
arch/arm/plat-omap/clock.c: In function `clk_init_cpufreq_table':
arch/arm/plat-omap/clock.c:402: error: structure has no member named `clk_init_cpufreq_table'
arch/arm/plat-omap/clock.c:403: error: structure has no member named `clk_init_cpufreq_table'

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-05-22 16:38:50 +01:00
Hiroshi DOYU bfbdcf8a14 ARM: OMAP: Fix Unbalanced enable for IRQ in omap mailbox
Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-05-09 10:25:03 -07:00
Jarkko Nikula 0692f05dff ARM: OMAP: DMA: Fix incorrect channel linking
Function enable_lnk does incorrect channel link on non-omap1 builds if chain
is created manually with omap_request_dma and omap_dma_link_lch functions.

Fix this by making sure that next_linked_ch field is initialized to -1 just
in omap_request_dma.

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-05-09 10:25:03 -07:00
Tony Lindgren 7cf9577419 ARM: OMAP: Warn on disabling clocks with no users
Instead of BUG(), warn on disabling clocks with no users.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-05-09 10:25:02 -07:00
Linus Torvalds 429f731dea Merge branch 'semaphore' of git://git.kernel.org/pub/scm/linux/kernel/git/willy/misc
* 'semaphore' of git://git.kernel.org/pub/scm/linux/kernel/git/willy/misc:
  Deprecate the asm/semaphore.h files in feature-removal-schedule.
  Convert asm/semaphore.h users to linux/semaphore.h
  security: Remove unnecessary inclusions of asm/semaphore.h
  lib: Remove unnecessary inclusions of asm/semaphore.h
  kernel: Remove unnecessary inclusions of asm/semaphore.h
  include: Remove unnecessary inclusions of asm/semaphore.h
  fs: Remove unnecessary inclusions of asm/semaphore.h
  drivers: Remove unnecessary inclusions of asm/semaphore.h
  net: Remove unnecessary inclusions of asm/semaphore.h
  arch: Remove unnecessary inclusions of asm/semaphore.h
2008-04-21 15:41:27 -07:00
Matthew Wilcox 950e4da324 arch: Remove unnecessary inclusions of asm/semaphore.h
None of these files use any of the functionality promised by
asm/semaphore.h.  It's possible that they rely on it dragging in some
unrelated header file, but I can't build all these files, so we'll have
fix any build failures as they come up.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
2008-04-18 22:14:49 -04:00