Ben Dooks [Tue, 26 Jan 2010 06:49:15 +0000 (15:49 +0900)]
ARM: S3C64XX: Remove plat-s3c64xx Kconfig and PLAT_S3C64XX
Remove the Kconfig and PLAT_S3C64XX defines for the previous S3C64XX
directory structure now that the code is moved into mach-s3c64xx.
Note, we cannot currently remove plat-s3c64xx directory as we have a
pair of include files used within plat-s3c and plat-samsung that need
to find a new home.
Ben Dooks [Tue, 26 Jan 2010 05:32:09 +0000 (14:32 +0900)]
ARM: S3C64XX: Merge s3c6400-init.c into cpu.c
Since this file is small, and is compiled for both systems in this
architecture merge it into the cpu support file and remove the original
instead of moving it.
Ben Dooks [Tue, 26 Jan 2010 01:45:40 +0000 (10:45 +0900)]
ARM: S3C64XX: Move headers into machine include directory
Move the register and GPIO definition files from plat-s3c64xx into the
machine include direcotry as they are unlikely to be reused outside
mach-s3c64xx.
This move includes removing the empty <mach/regs-clock.h> and replacing
it with the <plat/regs-clock.h> implementation.
Ben Dooks [Tue, 26 Jan 2010 01:11:04 +0000 (10:11 +0900)]
ARM: S3C64XX: Merge mach-s3c6400 and mach-s3c6410
As per discussions with Russell King on linux-arm-kernel, it appears that
both mach-s3c6400 and mach-s3c6410 are so close together that they should
simply be merged into mach-s3c64xx.
Note, this patch does not eliminate any of the bits that are still common,
it is simply a move of the two directories together, any further common
code will be eliminated or moved in further patches.
Ben Dooks [Thu, 21 Jan 2010 04:31:38 +0000 (13:31 +0900)]
ARM: S3C64XX: Tidy up common code in s3c64xx_spi_set_info()
The s3c64xx_spi_set_info() sets one of two platform data structures depending
on which controller is being specified. Change to taking a pointer to the
relevant platform data structure and then having one set of code to place
the data into the area being pointed to.
Cc: Jassi Brar <jassi.brar@samsung.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Mark Brown [Wed, 20 Jan 2010 12:05:55 +0000 (12:05 +0000)]
ARM: S3C64XX: Fix dev-audio build
As reported when the patch was posted commit 71269364 ("ARM: S3C64XX:
Add I2S resources in platform code") uses pin names for the IISv4
data output pins which are not present in mainline, causing dev-audio
to fail to build. Fix this by using the defines which are actually
present in the kernel source.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Ben Dooks [Mon, 18 Jan 2010 02:22:38 +0000 (11:22 +0900)]
ARM: SAMSUNG: Move gpiolib support in gpio.c to plat-samsung
Move the gpio.c code containing the core gpiolib and GPIO support to
plat-samsung from plat-s3c as it is used by all current Samsung SoCs.
Note, we didn't move this to gpiolib.c as it contains code that is not
strictly for gpiolib support and the 4bit code is already called gpiolib.c
so make the change easier by not renaming both files in one go.
Kukjin Kim [Tue, 19 Jan 2010 06:30:54 +0000 (15:30 +0900)]
ARM: SAMSUNG: Move GPIO common functions to plat-samsung
This patch moves GPIO common functions (from plat-s3c64xx) into plat-samsung.
and adds the config option to build the plat-samsung/gpiolib for Samsung SoCs.
Signed-off-by: Adityapratap Sharma <aditya.ps@samsung.com> Signed-off-by: Atul Dahiya <atul.dahiya@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
This patch modifies s3c24xx_serial_initconsole function to accept multiple
platform UART information structures. This is required on platforms that have
differences among the instances of UART ports. As an example, the FIFO sizes
could be different for each UART instance and hence multiple platform UART
information structures would be needed.
This patch also modifies the s3c24xx_console_init macro since it wraps the
call to the s3c24xx_serial_initconsole function.
Signed-off-by: Thomas Abraham <thomas.ab@samsung.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Ben Dooks [Mon, 18 Jan 2010 07:24:22 +0000 (16:24 +0900)]
ARM: S3C24XX: Add mci platform data set call s3c24xx_mci_set_platdata().
Add a s3c24xx_mci_set_platdata() call for all the machine files that have
platform data for the MCI driver. This brings the MCI device into line with
the other devices with __initdata and a specific call to ensure the right
structure type is being passed.
Ben Dooks [Tue, 12 Jan 2010 06:15:28 +0000 (15:15 +0900)]
ARM: SAMSUNG: Make UART device code common
Move s3c24xx_uart_devs, s3c24xx_uart_src and the platform devices to a
common entry in plat-samsung since they are the same in all the current
implementations.
Jassi Brar [Mon, 18 Jan 2010 08:32:02 +0000 (17:32 +0900)]
ARM: S3C64XX: SPI: Define SPI controller devices
Platform devices for SPI Controller of S3C64XX are defined and exported for
machines to include. Also, controller setup helper functions are defined for
machine code to set runtime configuration of the controller and the bus.
Signed-off-by: Jassi Brar <jassi.brar@samsung.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Jassi Brar [Mon, 18 Jan 2010 08:45:52 +0000 (17:45 +0900)]
ARM: S3C64XX: SPI: Header for passing platform data
We need a way to pass controller specific information to the SPI driver.
For that purpose new headers are made.
SPI Controller is assumed 'type-s3c64xx' and can be defined for newer SoCs.
Hence, that part is placed under plat-samsung to be shared across newer SoCs.
SoC specific part - spi source clocks, will be placed
under plat-<soc>/include/plat/
Signed-off-by: Jassi Brar <jassi.brar@samsung.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Ben Dooks [Mon, 18 Jan 2010 06:57:42 +0000 (15:57 +0900)]
ARM: SAMSUNG: Fix bug in clksrc-clk round_rate call.
The call has been assuming all clksrc-clks' divider size is 4 bits, but
this may not be the case anymore. Use the reg_div.size parameter to
calculate the maximum value it can take and check against that.
Ben Dooks [Mon, 18 Jan 2010 06:37:25 +0000 (15:37 +0900)]
ARM: SAMSUNG: Fix clksrc-clk's checks for bad register settings
The WARN_ON() was only checking the first clock in the array, instead of
being executed for each clksrc clock being registered.
Since this is an array of clocks, WARN_ON() does not provide a lot of
useful information about the problem, so change to using printk(KERN_ERR)
to report the problem to the console.
As a note, we still try and register the clock even if these problems are
present just in case and to avoid changing the behaviour of the registration
process.
Thomas Abraham [Mon, 18 Jan 2010 05:30:16 +0000 (14:30 +0900)]
ARM: SAMSUNG: Add check to ensure that clksrc_clk does have multiple clock sources
Adds a additional check in s3c_set_clksrc function to ensure that the clksrc_clk
does have a choice of multiple clock sources. In addition to this, a check is
added to ensure that a parent is assigned to the clksrc_clk in case it does not
have a choice of parent clocks.
Signed-off-by: Thomas Abraham <thomas.ab@samsung.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Ben Dooks [Mon, 18 Jan 2010 04:24:01 +0000 (13:24 +0900)]
ARM: S5PC1XX: Register pd0 and hd0 clocks, remove unecessary dummy_enable
The clk_hd0 and clk_pd0 where given a local dummy_enable call due to
not being registered with the clock code, which they really should have
been. Register these two clocks and remove the clk_dummy_enable as this
is done by the default clock registration code.
Andy Green [Tue, 29 Dec 2009 14:40:36 +0000 (14:40 +0000)]
ARM: SMDK6410: Add nC1 chipselect SROM setup
Since the mach-smdk6410.c file claims it can start up the
smsc9115 ethernet device on the board, it should take care
about configuring the necessary chip select nCS1 so it can
see the chip. The select defaults to 8-bit mode so without
config the Ethernet doesn't work.
This patch uses the new SROM definitions to set nCS1 to the
state found in the Samsung U-Boot port for 6410. It may be
more conservative that it needs to be since those settings
were marked as for CS8900A also using this chip select.
But this change is enough to get the ethernet working when
booted with Qi.
Signed-off-by: Andy Green <andy@warmcat.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Kukjin Kim [Wed, 13 Jan 2010 23:19:36 +0000 (08:19 +0900)]
ARM: S5P6440: Add new Kconfig and Makefiles
This patch adds the Kconfig and Makefile for the new S5P6440 machine
and platform directories. It also updates arch/arm Kconfig and Makefiles
to include the support for the new S5P6440 CPU.
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Ben Dooks [Tue, 12 Jan 2010 04:10:59 +0000 (13:10 +0900)]
ARM: S5PC1XX: Remove definitions deleted by previous clksrc changes
Remove the definitions we've deleted in the previous updates to the
clksrc_clk for arch/arm/plat-s5pc1xx/include/plat/regs-clock.h.
Added comments about the removal to the clock header since we only need
these defines in one place (and they've now been removed there) we get
rid of them from the header.
Ben Dooks [Tue, 12 Jan 2010 03:52:43 +0000 (12:52 +0900)]
ARM: SAMSUNG: Add script to change old clksrc_clk to new register defs
This script is used to change the old style clksrc_clk as originally
found in plat-s3c64xx to the new style. It is here for reference if needed
for future code merges.
Ben Dooks [Tue, 12 Jan 2010 03:19:28 +0000 (12:19 +0900)]
ARM: S5PC1XX: Move to using generic clksrc_clk for clock code
Remove the copy of the old s3c64xx struct clksrc_clk and use the new one
in plat-samsung. This eliminates a bug in the set_parent() call where it
failed to set the clk->parent after sucesfully updating the clock.
The script that was used to automate much of the process will be supplied
seperately.
Ben Dooks [Wed, 6 Jan 2010 23:59:26 +0000 (08:59 +0900)]
ARM: Add common entry code for system with two VICs
Add a common entry-macro-vic2.S for systems where there are two VICs
so that the machine or platform directories just need to setup the
correct information before including <asm/entry-macro-vic2.S> into
their own entry-macro.S file.
Since this code is from the S3C64XX project, we update the S3C64XX
machine entry code to use this new header.
Ben Dooks [Wed, 6 Jan 2010 02:18:44 +0000 (11:18 +0900)]
ARM: SAMSUNG: Move IRQ UART handling for newer devices to plat-samsung
Move the handling for the UART interrupts out of the s3c64xx specific
code and into plat-samsung so that it can be used by all implementations
that need it.
Ben Dooks [Wed, 6 Jan 2010 01:14:51 +0000 (10:14 +0900)]
ARM: SAMSUNG: Move IRQ VIC timer handling out to common header files
Move the VIC based timer interrupt handling out of plat-s3c64xx and
into plat-samsung to be re-used for other systems. This also reduces
the code size as we now have a common init routine and use the irq_desc
to store the interrupt number of the timer.
Ben Dooks [Tue, 5 Jan 2010 16:21:38 +0000 (01:21 +0900)]
ARM: SAMSUNG: Add call to register array of clocks
Add s3c_register_clocks() to register an array of clocks, printing
an error message if there is a problem. Replace all points in the code
where this could be used.
Ben Dooks [Wed, 23 Dec 2009 18:43:48 +0000 (18:43 +0000)]
ARM: SAMSUNG: Move clock.c to arch/arm/plat-samsung
This is the core implementation of the clock code for all Samsung based
SoCs, so move it to arch/arm/plat-samsung (the clock.h file has already
been moved).
Since the file is built for every Samsung SoC, no changes are needed to the
Kconfig system.
The new code calls the clock setup code on registration which
can be before the clock system has been fully initialised. The
following code re-does this setup at the end of the clock
registration and thus we get two printings.
Update the calls to only print on the last pass or when doing
the necessary resume work.
Ben Dooks [Tue, 1 Dec 2009 01:24:37 +0000 (01:24 +0000)]
ARM: SAMSUNG: Reduce size of struct clk.
Reduce the size of struct clk by 12 bytes and make defining clocks with
common implementation functions easier by moving the set_rate, get_rate,
round_rate and set_parent calls into a new structure called 'struct clk_ops'
and using that instead.
This change does make a few clocks larger as they need their own clk_ops,
but this is outweighed by the number of clocks with either no ops or having
a common set of ops.
Harald Welte [Tue, 1 Dec 2009 01:24:36 +0000 (01:24 +0000)]
ARM: S3C64XX: Remove unused clock definitions from clock header
Clean out the definitions we are no longer using after the new clock
code updates.
Signed-off-by: Harald Welte <laforge@gnumonks.org>
[ben-linux@fluff.org: split from initial patch provided] Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Harald Welte [Tue, 1 Dec 2009 01:24:34 +0000 (01:24 +0000)]
ARM: SAMSUNG: Add core clock implementation for clksrc based clocks
Add a core for the clksrc clock implementation, which is found in many of
the newer Samsung SoCs into plat-samsung.
Signed-off-by: Harald Welte <laforge@gnumonks.org>
[ben-linux@fluff.org: split from original patch to make change smaller]
[ben-linux@fluff.org: split clk and clksrc changes]
[ben-linux@fluff.org: moved to plat-samsung from plat-s3c]
[ben-linux@fluff.org: re-wrote headers after splits]
[ben-linux@fluff.org: added better documentation to headers] Signed-off-by: Ben Dooks <ben-linux@fluff.org>