Commit Graph

86 Commits

Author SHA1 Message Date
Russell King 0a52ac8d18 Merge branch 's3c-fixes-rc4' of git://aeryn.fluff.org.uk/bjdooks/linux 2009-07-30 10:47:55 +01:00
Mark Brown 9b71de49b0 S3C64XX: Fix ARMCLK configuration
The value of armclk_mask needs to be inverted for use as a mask on
the register value when updating ARM_RATIO.

This is critical for cpufreq support, without it attempts to scale
the frequency of the core trash pretty much the entire clock tree.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-07-29 23:47:14 +01:00
Mark Brown 1d91e1a296 S3C64XX: Fix get_rate() for ARMCLK
If the requested clock is faster than the parent clock then the
parent clock is the closest we can get to the request so we need
to return that instead of the requested clock.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-07-29 23:47:14 +01:00
Jaswinder Singh Rajput 2e6e2c143c ARM: includecheck fix: plat-s3c64xx/pm.c
fix the following 'make includecheck' warning:

  arch/arm/plat-s3c64xx/pm.c: plat/regs-gpio.h is included more than once.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-07-25 17:08:23 +01:00
Marek Szyprowski 0b495737f3 [ARM] S3C64XX: add to_irq() support for EINT() GPIO
N group

Add to_irq() function to onvert gpio to irq for external interrupt
group (GPN).

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-06-22 14:11:56 +01:00
Peter Korsgaard 386f43517f [ARM] S3C64XX: clock.c: fix typo in usb-host clock ctrlbit
The usb-host clock was using the wrong define (the SCLK enable for the
usb-host-bus) to change the HCLK register instead of the HCLK_UHOST bit.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-06-22 14:11:56 +01:00
Peter Korsgaard 6ade7fa7bb [ARM] S3C64XX: fix HCLK gate defines
A few typos seems to have sneaked into the HCLK gate defines, causing the
usb host clock to not get enabled. Fix them according to the reference
manual and throw in the 3d accel bit for good measure.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-06-22 14:11:56 +01:00
Mark Brown b3748ddd80 [ARM] S3C64XX: Initial support for DVFS
This patch provides initial support for CPU frequency scaling on the
Samsung S3C ARM processors. Currently only S3C6410 processors are
supported, though addition of another data table with supported clock
rates should be sufficient to enable support for further CPUs.

Use the regulator framework to provide optional support for DVFS in
the S3C cpufreq driver. When a software controllable regulator is
configured the driver will use it to lower the supply voltage when
running at a lower frequency, giving improved power savings.

When regulator support is disabled or no regulator can be obtained
for VDDARM the driver will fall back to scaling only the frequency.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-06-16 23:36:24 +01:00
Russell King 547c32aeb5 Merge branch for-rmk-devel of git://aeryn.fluff.org.uk/bjdooks/linux into devel 2009-06-10 22:41:06 +01:00
Ben Dooks bcb8a0d6f5 [ARM] S3C: Merge next-s3c64xx-dma2 into for-rmk-devel
Merge branch 'next-s3c64xx-dma2' into for-rmk-devel

Conflicts:

	arch/arm/plat-s3c64xx/Makefile
2009-05-18 16:32:29 +01:00
Mark Brown 0b13406a1f [ARM] S3C64XX: Lower severity of DMA logging
The message was missing a severity macro so pick pr_debug().

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-05-18 16:29:24 +01:00
Ben Dooks fa7a7883fe [ARM] S3C64XX: DMA support
Add support for the DMA blocks in the S3C64XX series of CPUS,
which are based on the ARM PL080 PrimeCell system.

Unfortunately, these DMA controllers diverge from the PL080
design by adding another DMA controller register and
configuration for OneNAND.

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-05-18 16:29:21 +01:00
Ben Dooks 543899f610 [ARM] S3C64XX: Use common watchdog reset for system reset.
Use the newly moved <plat/watchdog-reset.h> to perform the
arch_reset() call which has been unimplemented for a while.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-05-17 23:40:30 +01:00
Marek Szyprowski beb9f4ed22 [ARM] S3C64XX: fix GPIO debug
Fix compilation bug when debug was enabled

Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-05-15 15:13:18 +01:00
Marek Szyprowski f36dd6e7c0 [ARM] S3C64XX: GPIO include cleanup
Cleanup arm/plat-s3c64xx/include/plat/gpio-bank-h.h include file.
Using shift-left operation with value >32 is a bad habit.

Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-05-15 15:13:06 +01:00
Ben Dooks 496a3f0927 [ARM] S3C64XX: Add ARM clock
Add ARM clock to provide 'arm' from the APLL to the ARM core.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-05-07 11:46:41 +01:00
Mark Brown 8f1ecf1d96 [ARM] S3C64XX: Configure clocks for DMA controller
Add missing DMA controller block clocks.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-05-07 11:14:27 +01:00
Werner Almesberger a03f7daf6d [ARM] S3C64XX: Add HCLKx2
Add doubled HCLK to S3C64xx.

Signed-off-by: Werner Almesberger <werner@openmoko.org>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-05-07 11:14:27 +01:00
Werner Almesberger e2c977dca2 [ARM] S3C6410: Add CAMIF clock
Add camera interface clock to S3C6410.

Signed-off-by: Werner Almesberger <werner@openmoko.org>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-05-07 11:14:27 +01:00
Ben Dooks 4faf686763 [ARM] S3C64XX: Add S3C6400 SDHCI setup support
Add support for S3C6400 SDHCI channels 0 and 1, making
the GPIO code common to both S3C6400 and S3C6410.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-05-07 11:04:58 +01:00
Ben Dooks e074f98032 [ARM] S3C64XX: Add S3C6400 CPU detection.
Add detection support for the S3C6400 SoC which has it's
id register in a different place to the S3C6410.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-05-07 11:04:57 +01:00
Ben Dooks a6925c1c51 [ARM] S3C6400: Core support for S3C6400 SoC
Add the core support files for the Samsung S3C6400 SoC.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-05-07 11:04:57 +01:00
Ben Dooks c07f87f22e [ARM] VIC: Add power management device
Add power management support to the VIC by registering
each VIC as a system device to get suspend/resume
events going.

Since the VIC registeration is done early, we need to
record the VICs in a static array which is used to add
the system devices later once the initcalls are run. This
means there is now a configuration value for the number
of VICs in the system.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-05-07 11:04:57 +01:00
Ben Dooks d87964c460 [ARM] S3C: GPIO PM core GPIOlib integration
Move the GPIO suspend/resume support inline with the gpiolib support
so that it will work with both the S3C24XX and S3C64XX series.

The s3c_gpio_chip is extended to have a pm callback and a save block
to keep the state of the GPIO over suspend, and the code from the
s3c24xx implementation is added to a new common file.

The suspend process now uses the list of registered chips to go through
saving and restoring each one as appropriate, using the pm callback to
select the appropriate routine depending on the type of control register
present.

This change also means that any additional GPIO added should not require
changes to the PM.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-05-07 11:04:56 +01:00
Ben Dooks 966bcc1438 [ARM] S3C64XX: Add IRQ PM code
Add support for saving the state of the IRQ registers over suspend.

This requires moving the S3C64XX UART registers into <plat/regs-serial.h>
and adding irq-pm.c which saves the state of all the IRQ registers.

The irq-pm.c saves all the IRQ registers, including the IRQ_EINT and
IRQ_EINT_GROUP registers as it was easier than adding three different
files. Also ensuring that all the registers are restored to the same
state as before suspend is considered to be the best thing to do.

Note, we do not suspend the VIC here, this is done by the VIC driver
itself.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-05-07 11:04:56 +01:00
Ben Dooks 1deb507dc7 [ARM] S3C64XX: Add generic s3c64xx sys device.
Add an s3c64xx_sysclass and device for items that currently
want to bind to any s3c64xx processor. The first user of this
will be parts of the s3c64xx suspend support which need to
save device state over suspend/resume.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-05-07 11:04:56 +01:00
Ben Dooks bd117bd161 [ARM] S3C64XX: Initial support for PM (suspend to RAM)
Add the initial support for the S3C64XX based systems to use
suspend-to-RAM to sleep.

Includes basic debugging for use with the SMDK6410 usign the
LEDs on the baseboard.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-05-07 11:04:55 +01:00
Ben Dooks 67b3e542ab [ARM] S3C64XX: Add USB OHCI support
Add USB OHCI host definitions.

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-05-07 11:04:55 +01:00
Ben Dooks 1288b670e6 [ARM] S3C64XX: add AHB_CON and SPCON register address definitions
Add the address definitions for S3C64XX_AHB_CONx and
SPCON registers for use in the PM code.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-03-10 16:33:42 +00:00
Ben Dooks 36d543a3b5 [ARM] S3C64XX: Add definitions for the GPIO memory port configurations
Add defines for the registers that control the GPIO pins that are
run the memory interface.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-03-10 16:33:26 +00:00
Ben Dooks 2ae0b117a6 [ARM] S3C64XX: SYSCON power and sleep control register defines
Add the register defines for the sleep and power control
functions in the S3C64XX SYSCON register block.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-03-10 16:33:08 +00:00
Ben Dooks 2454e524bc [ARM] S3C64XX: Add S3C64XX_SPCON register bit definitions
Add the definitions for the SPCON register in the
GPIO block.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-03-10 16:30:44 +00:00
Ben Dooks e383707131 [ARM] S3C64XX: Add GPIO SPCONSLP and SLPEN register definitions
Add GPIO register definitions for SPCONSLP and SLPEN
for controlling the state of the pins over sleep.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-03-10 16:30:27 +00:00
Ben Dooks 333053733f [ARM] S3C64XX: Add EINT group regs and move IRQ_EINT to regs-gpio.h
Add definitions for the EINT group registers and move the EINT IRQ
register definitions out of arch/arm/plat-s3c64xx/irq-eint.c so that
they are available for re-use with PM and the other code.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-03-10 16:29:11 +00:00
Ben Dooks 5b3d515fcf [ARM] S3C64XX: Add modem registers and a virtual map
Add the modem registers and a virtual mapping for the
modem block. This is is required as there are registers
that control the LCD block that need to be saved over
suspend as well as interrupt controls.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-03-10 16:26:52 +00:00
Ben Dooks 1264fa6f8c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into s3c-fixes 2009-03-06 17:13:52 +00:00
Werner Almesberger efeff56867 [ARM] S3C64XX: Fix s3c64xx_setrate_clksrc
Some of the rate selection logic in s3c64xx_setrate_clksrc uses what
appears to be parent clock selection logic. This patch corrects it.

I also added a check for overly large dividers to prevent them from
changing unrelated clocks.

Signed-off-by: Werner Almesberger <werner@openmoko.org>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-02-27 11:34:01 +00:00
Ben Dooks fdca9bf2da [ARM] S3C64XX: sparse warnings in arch/arm/plat-s3c64xx/irq.c
Fix the following sparse warnings in arch/arm/plat-s3c64xx/irq.c

arch/arm/plat-s3c64xx/irq.c:210:23: warning: incorrect type in initializer (different address spaces)
arch/arm/plat-s3c64xx/irq.c:210:23:    expected void *reg_base
arch/arm/plat-s3c64xx/irq.c:210:23:    got void [noderef] <asn:2>*regs
arch/arm/plat-s3c64xx/irq.c:215:2: warning: incorrect type in argument 1 (different address spaces)
arch/arm/plat-s3c64xx/irq.c:215:2:    expected void const volatile [noderef] <asn:2>*<noident>
arch/arm/plat-s3c64xx/irq.c:215:2:    got void *

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-02-27 11:29:23 +00:00
Ben Dooks 3782d36055 [ARM] S3C64XX: sparse warnings in arch/arm/plat-s3c64xx/s3c6400-clock.c
Fix the following sparse warnings in s3c6400-clock.c:

39:12: warning: symbol 'clk_ext_xtal_mux' was not declared. Should it be static?
66:12: warning: symbol 'clk_fout_apll' was not declared. Should it be static?
81:19: warning: symbol 'clk_mout_apll' was not declared. Should it be static?
91:12: warning: symbol 'clk_fout_epll' was not declared. Should it be static?
106:19: warning: symbol 'clk_mout_epll' was not declared. Should it be static?
126:19: warning: symbol 'clk_mout_mpll' was not declared. Should it be static?
148:12: warning: symbol 'clk_dout_mpll' was not declared. Should it be static?

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-02-27 11:25:37 +00:00
Ben Dooks 41ba41d7c7 [ARM] S3C64XX: Fix USB host clock mux list
The clock list for the USB host bus clock was in the wrong order,
move clk_48m to position 0.

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-02-26 23:25:51 +00:00
Ben Dooks 19c5957081 [ARM] S3C64XX: Fix name of USB host clock.
The usb-host-bus clock should be named usb-bus-host.

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-02-26 23:25:51 +00:00
Ben Dooks 4271c3bd46 [ARM] S3C64XX: Rename IRQ_UHOST to IRQ_USBH
The USB OHCI host device expects the IRQ definition to be named
IRQ_USBH, so rename the S3C64XX IRQ header to match.

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-02-26 23:25:51 +00:00
Mark Brown 24d4076734 [ARM] S3C64XX: Do gpiolib configuration earlier
arch_initcall() runs after the machine init function which means that
any configuration of GPIO pins must currently be done later on, for
example in callbacks from drivers. Move the initialisation earlier in
order to allow machines to configure GPIOs directly in their init
functions rather than having to have a callback invoked later on.

Some other ARM platforms use this method. Other solutions for this
include providing a special interface for setting up GPIOs en masse,
adding callbacks to do the GPIO configuration from devices and doing
the GPIO configuration implicitly.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-02-26 23:21:50 +00:00
Mark Brown 8bd8dbdf37 [ARM] S3C64XX: Staticise s3c64xx_init_irq_eint()
It's an initcall and does not need to be exported.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-02-26 23:21:50 +00:00
Mark Brown 789b4ad36c [ARM] S3C64XX: Fix section mismatch for s3c64xx_register_clocks()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-02-26 23:16:38 +00:00
Ben Dooks 28fd2d397b [ARM] S3C64XX: Set GPIO pin when select IRQ_EINT type
Set the GPIO pin mode to external interrupt when configuring
an IRQ_EINT's IRQ type.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-02-26 23:08:59 +00:00
Mark Brown c8532db7f2 [ARM] 5411/1: S3C64XX: Fix EINT unmask
Currently the unmask function for EINT interrupts was setting the mask
bit rather than clearing it.  This was also previously reported and
fixed by Kyungmin Park <kyungmin.park@samsung.com> and others.

Acked-By: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-24 19:12:31 +00:00
Matt Hsu 43a55cdffc [ARM] S3C64XX: Fix EINT group macro definition
Fix IRQ_EINT_GROUP which has an extra _ in it and
an error in the IRQ offset.

Signed-off-by: Matt Hsu <matt_hsu@openmoko.org>
[ben-linux@fluff.org: rewrite description]
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-01-08 16:25:24 +00:00
Ben Dooks 7bb56d01f1 [ARM] S3C64XX: Ensure CPU_V6 is selected
Select CPU_V6 with the S3C64XX series.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2008-12-18 22:06:42 +00:00
Ben Dooks 6a148eaa20 [ARM] S3C: Remove unnecessary <linux/delay.h> includes
As per Russell King's last review comment, find and remove
all unnecessary includes of <linux/delay.h> in the files
that do not need them.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2008-12-18 16:36:02 +00:00