Skip to content

Commit

Permalink
Merge branch 'u300-cleanup' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/linusw/linux-stericsson into next/cleanup

From Linus Walleij <linus.walleij@linaro.org>

This patch set does a number of cleanups and a minor improvement
to U300, paving the way for single zImage and device tree:

- Deprecate ancient platforms to make the following patches easier to
  make...
- Move out one header to platform data and one to the mach-u300 proper
  to depopulate <mach/*>
- Consolidate core machine files
- Convert to sparse IRQs

* 'u300-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson:
  ARM: u300: convert to sparse IRQs
  ARM: u300: move DMA channel header into mach-u300
  ARM: u300: delete remnant clkdev.h file
  ARM: u300: merge u300.c into core.c and rid headers
  pinctrl/coh901: move header to platform data dir
  pinctrl/coh901: retire ancient GPIO block versions
  ARM: u300: retire ancient platforms

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
  • Loading branch information
Arnd Bergmann committed Aug 15, 2012
2 parents a4c75ba + a4fe292 commit 6348758
Show file tree
Hide file tree
Showing 18 changed files with 87 additions and 533 deletions.
1 change: 1 addition & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,7 @@ config ARCH_U300
select COMMON_CLK
select GENERIC_GPIO
select ARCH_REQUIRE_GPIOLIB
select SPARSE_IRQ
help
Support for ST-Ericsson U300 series mobile platforms.

Expand Down
43 changes: 2 additions & 41 deletions arch/arm/mach-u300/Kconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if ARCH_U300

menu "ST-Ericsson AB U300/U330/U335/U365 Platform"
menu "ST-Ericsson AB U300/U335 Platform"

comment "ST-Ericsson Mobile Platform Products"

Expand All @@ -10,46 +10,7 @@ config MACH_U300
select PINCTRL_U300
select PINCTRL_COH901

comment "ST-Ericsson U300/U330/U335/U365 Feature Selections"

choice
prompt "U300/U330/U335/U365 system type"
default MACH_U300_BS2X
---help---
You need to select the target system, i.e. the
U300/U330/U335/U365 board that you want to compile your kernel
for.

config MACH_U300_BS2X
bool "S26/S26/B25/B26 Test Products"
depends on MACH_U300
help
Select this if you're developing on the
S26/S25 test products. (Also works on
B26/B25 big boards.)

config MACH_U300_BS330
bool "S330/B330 Test Products"
depends on MACH_U300
help
Select this if you're developing on the
S330/B330 test products.

config MACH_U300_BS335
bool "S335/B335 Test Products"
depends on MACH_U300
help
Select this if you're developing on the
S335/B335 test products.

config MACH_U300_BS365
bool "S365/B365 Test Products"
depends on MACH_U300
help
Select this if you're developing on the
S365/B365 test products.

endchoice
comment "ST-Ericsson U300/U335 Feature Selections"

config U300_DEBUG
bool "Debug support for U300"
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-u300/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ obj-m :=
obj-n :=
obj- :=

obj-$(CONFIG_ARCH_U300) += u300.o
obj-$(CONFIG_SPI_PL022) += spi.o
obj-$(CONFIG_MACH_U300_SPIDUMMY) += dummyspichip.o
obj-$(CONFIG_I2C_STU300) += i2c.o
Expand Down
100 changes: 23 additions & 77 deletions arch/arm/mach-u300/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* arch/arm/mach-u300/core.c
*
*
* Copyright (C) 2007-2010 ST-Ericsson SA
* Copyright (C) 2007-2012 ST-Ericsson SA
* License terms: GNU General Public License (GPL) version 2
* Core platform support, IRQ handling and device definitions.
* Author: Linus Walleij <linus.walleij@stericsson.com>
Expand Down Expand Up @@ -31,23 +31,26 @@
#include <linux/pinctrl/pinconf-generic.h>
#include <linux/dma-mapping.h>
#include <linux/platform_data/clk-u300.h>
#include <linux/platform_data/pinctrl-coh901.h>

#include <asm/types.h>
#include <asm/setup.h>
#include <asm/memory.h>
#include <asm/hardware/vic.h>
#include <asm/mach/map.h>
#include <asm/mach/irq.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>

#include <mach/coh901318.h>
#include <mach/hardware.h>
#include <mach/syscon.h>
#include <mach/dma_channels.h>
#include <mach/gpio-u300.h>
#include <mach/irqs.h>

#include "timer.h"
#include "spi.h"
#include "i2c.h"
#include "u300-gpio.h"
#include "dma_channels.h"

/*
* Static I/O mappings that are needed for booting the U300 platforms. The
Expand Down Expand Up @@ -76,7 +79,7 @@ static struct map_desc u300_io_desc[] __initdata = {
},
};

void __init u300_map_io(void)
static void __init u300_map_io(void)
{
iotable_init(u300_io_desc, ARRAY_SIZE(u300_io_desc));
/* We enable a real big DMA buffer if need be. */
Expand All @@ -101,7 +104,6 @@ static AMBA_APB_DEVICE(uart0, "uart0", 0, U300_UART0_BASE,
{ IRQ_U300_UART0 }, &uart0_plat_data);

/* The U335 have an additional UART1 on the APP CPU */
#ifdef CONFIG_MACH_U300_BS335
static struct amba_pl011_data uart1_plat_data = {
#ifdef CONFIG_COH901318
.dma_filter = coh901318_filter_id,
Expand All @@ -113,7 +115,6 @@ static struct amba_pl011_data uart1_plat_data = {
/* Fast device at 0x7000 offset */
static AMBA_APB_DEVICE(uart1, "uart1", 0, U300_UART1_BASE,
{ IRQ_U300_UART1 }, &uart1_plat_data);
#endif

/* AHB device at 0x4000 offset */
static AMBA_APB_DEVICE(pl172, "pl172", 0, U300_EMIF_CFG_BASE, { }, NULL);
Expand Down Expand Up @@ -152,9 +153,7 @@ static AMBA_APB_DEVICE(mmcsd, "mmci", 0, U300_MMCSD_BASE,
*/
static struct amba_device *amba_devs[] __initdata = {
&uart0_device,
#ifdef CONFIG_MACH_U300_BS335
&uart1_device,
#endif
&pl022_device,
&pl172_device,
&mmcsd_device,
Expand Down Expand Up @@ -188,7 +187,6 @@ static struct resource gpio_resources[] = {
.end = IRQ_U300_GPIO_PORT2,
.flags = IORESOURCE_IRQ,
},
#if defined(CONFIG_MACH_U300_BS365) || defined(CONFIG_MACH_U300_BS335)
{
.name = "gpio3",
.start = IRQ_U300_GPIO_PORT3,
Expand All @@ -201,8 +199,6 @@ static struct resource gpio_resources[] = {
.end = IRQ_U300_GPIO_PORT4,
.flags = IORESOURCE_IRQ,
},
#endif
#ifdef CONFIG_MACH_U300_BS335
{
.name = "gpio5",
.start = IRQ_U300_GPIO_PORT5,
Expand All @@ -215,7 +211,6 @@ static struct resource gpio_resources[] = {
.end = IRQ_U300_GPIO_PORT6,
.flags = IORESOURCE_IRQ,
},
#endif /* CONFIG_MACH_U300_BS335 */
};

static struct resource keypad_resources[] = {
Expand Down Expand Up @@ -323,7 +318,6 @@ static struct resource dma_resource[] = {
}
};

#ifdef CONFIG_MACH_U300_BS335
/* points out all dma slave channels.
* Syntax is [A1, B1, A2, B2, .... ,-1,-1]
* Select all channels from A to B, end of list is marked with -1,-1
Expand All @@ -336,14 +330,6 @@ static int dma_slave_channels[] = {
static int dma_memcpy_channels[] = {
U300_DMA_GENERAL_PURPOSE_0, U300_DMA_GENERAL_PURPOSE_8, -1, -1};

#else /* CONFIG_MACH_U300_BS335 */

static int dma_slave_channels[] = {U300_DMA_MSL_TX_0, U300_DMA_SPI_RX, -1, -1};
static int dma_memcpy_channels[] = {
U300_DMA_GENERAL_PURPOSE_0, U300_DMA_GENERAL_PURPOSE_10, -1, -1};

#endif

/** register dma for memory access
*
* active 1 means dma intends to access memory
Expand Down Expand Up @@ -1395,7 +1381,6 @@ const struct coh_dma_channel chan_config[U300_DMA_CHANNELS] = {
.param.ctrl_lli = flags_memcpy_lli,
.param.ctrl_lli_last = flags_memcpy_lli_last,
},
#ifdef CONFIG_MACH_U300_BS335
{
.number = U300_DMA_UART1_TX,
.name = "UART1 TX",
Expand All @@ -1406,28 +1391,6 @@ const struct coh_dma_channel chan_config[U300_DMA_CHANNELS] = {
.name = "UART1 RX",
.priority_high = 0,
}
#else
{
.number = U300_DMA_GENERAL_PURPOSE_9,
.name = "GENERAL 09",
.priority_high = 0,

.param.config = flags_memcpy_config,
.param.ctrl_lli_chained = flags_memcpy_lli_chained,
.param.ctrl_lli = flags_memcpy_lli,
.param.ctrl_lli_last = flags_memcpy_lli_last,
},
{
.number = U300_DMA_GENERAL_PURPOSE_10,
.name = "GENERAL 10",
.priority_high = 0,

.param.config = flags_memcpy_config,
.param.ctrl_lli_chained = flags_memcpy_lli_chained,
.param.ctrl_lli = flags_memcpy_lli,
.param.ctrl_lli_last = flags_memcpy_lli_last,
}
#endif
};


Expand Down Expand Up @@ -1480,18 +1443,7 @@ static struct platform_device pinctrl_device = {
* GPIO block, with different number of ports.
*/
static struct u300_gpio_platform u300_gpio_plat = {
#if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330)
.variant = U300_GPIO_COH901335,
.ports = 3,
#endif
#ifdef CONFIG_MACH_U300_BS335
.variant = U300_GPIO_COH901571_3_BS335,
.ports = 7,
#endif
#ifdef CONFIG_MACH_U300_BS365
.variant = U300_GPIO_COH901571_3_BS365,
.ports = 5,
#endif
.gpio_base = 0,
.gpio_irq_base = IRQ_U300_GPIO_BASE,
.pinctrl_device = &pinctrl_device,
Expand Down Expand Up @@ -1651,7 +1603,7 @@ static struct platform_device *platform_devs[] __initdata = {
* together so some interrupts are connected to the first one and some
* to the second one.
*/
void __init u300_init_irq(void)
static void __init u300_init_irq(void)
{
u32 mask[2] = {0, 0};
struct clk *clk;
Expand Down Expand Up @@ -1756,29 +1708,11 @@ static void __init u300_init_check_chip(void)
printk(KERN_INFO "Initializing U300 system on %s baseband chip " \
"(chip ID 0x%04x)\n", chipname, val);

#ifdef CONFIG_MACH_U300_BS330
if ((val & 0xFF00U) != 0xd800) {
printk(KERN_ERR "Platform configured for BS330 " \
"with DB3200 but %s detected, expect problems!",
chipname);
}
#endif
#ifdef CONFIG_MACH_U300_BS335
if ((val & 0xFF00U) != 0xf000 && (val & 0xFF00U) != 0xf100) {
printk(KERN_ERR "Platform configured for BS335 " \
" with DB3350 but %s detected, expect problems!",
chipname);
}
#endif
#ifdef CONFIG_MACH_U300_BS365
if ((val & 0xFF00U) != 0xe800) {
printk(KERN_ERR "Platform configured for BS365 " \
"with DB3210 but %s detected, expect problems!",
chipname);
}
#endif


}

/*
Expand Down Expand Up @@ -1811,7 +1745,7 @@ static void __init u300_assign_physmem(void)
}
}

void __init u300_init_devices(void)
static void __init u300_init_machine(void)
{
int i;
u16 val;
Expand Down Expand Up @@ -1852,7 +1786,7 @@ void __init u300_init_devices(void)
/* Forward declare this function from the watchdog */
void coh901327_watchdog_reset(void);

void u300_restart(char mode, const char *cmd)
static void u300_restart(char mode, const char *cmd)
{
switch (mode) {
case 's':
Expand All @@ -1868,3 +1802,15 @@ void u300_restart(char mode, const char *cmd)
/* Wait for system do die/reset. */
while (1);
}

MACHINE_START(U300, "Ericsson AB U335 S335/B335 Prototype Board")
/* Maintainer: Linus Walleij <linus.walleij@stericsson.com> */
.atag_offset = 0x100,
.map_io = u300_map_io,
.nr_irqs = NR_IRQS_U300,
.init_irq = u300_init_irq,
.handle_irq = vic_handle_irq,
.timer = &u300_timer,
.init_machine = u300_init_machine,
.restart = u300_restart,
MACHINE_END
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* arch/arm/mach-u300/include/mach/dma_channels.h
*
*
* Copyright (C) 2007-2009 ST-Ericsson
* Copyright (C) 2007-2012 ST-Ericsson
* License terms: GNU General Public License (GPL) version 2
* Map file for the U300 dma driver.
* Author: Per Friden <per.friden@stericsson.com>
Expand Down Expand Up @@ -50,19 +50,10 @@
#define U300_DMA_GENERAL_PURPOSE_6 35
#define U300_DMA_GENERAL_PURPOSE_7 36
#define U300_DMA_GENERAL_PURPOSE_8 37
#ifdef CONFIG_MACH_U300_BS335
#define U300_DMA_UART1_TX 38
#define U300_DMA_UART1_RX 39
#else
#define U300_DMA_GENERAL_PURPOSE_9 38
#define U300_DMA_GENERAL_PURPOSE_10 39
#endif

#ifdef CONFIG_MACH_U300_BS335
#define U300_DMA_DEVICE_CHANNELS 32
#else
#define U300_DMA_DEVICE_CHANNELS 30
#endif
#define U300_DMA_CHANNELS 40


Expand Down
6 changes: 1 addition & 5 deletions arch/arm/mach-u300/i2c.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* arch/arm/mach-u300/i2c.c
*
* Copyright (C) 2009 ST-Ericsson AB
* Copyright (C) 2009-2012 ST-Ericsson AB
* License terms: GNU General Public License (GPL) version 2
*
* Register board i2c devices
Expand Down Expand Up @@ -261,7 +261,6 @@ static struct i2c_board_info __initdata bus0_i2c_board_info[] = {
};

static struct i2c_board_info __initdata bus1_i2c_board_info[] = {
#ifdef CONFIG_MACH_U300_BS335
{
.type = "fwcam",
.addr = 0x10,
Expand All @@ -270,9 +269,6 @@ static struct i2c_board_info __initdata bus1_i2c_board_info[] = {
.type = "fwcam",
.addr = 0x5d,
},
#else
{ },
#endif
};

void __init u300_i2c_register_board_devices(void)
Expand Down
7 changes: 0 additions & 7 deletions arch/arm/mach-u300/include/mach/clkdev.h

This file was deleted.

Loading

0 comments on commit 6348758

Please sign in to comment.