Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 272697
b: refs/heads/master
c: eed1e57
h: refs/heads/master
i:
  272695: f6ea734
v: v3
  • Loading branch information
Arnd Bergmann committed Oct 31, 2011
1 parent 6e2ab0b commit 83e23a9
Show file tree
Hide file tree
Showing 11 changed files with 271 additions and 197 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 65af7c4608f7b7019e2faa220fb9624988965873
refs/heads/master: eed1e576507b52e03e549e0c9e0c747978122403
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-ux500/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

obj-y := clock.o cpu.o devices.o devices-common.o \
id.o usb.o timer.o
obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o
obj-$(CONFIG_UX500_SOC_DB5500) += cpu-db5500.o dma-db5500.o
obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o devices-db8500.o
obj-$(CONFIG_MACH_U8500) += board-mop500.o board-mop500-sdi.o \
Expand Down
34 changes: 23 additions & 11 deletions trunk/arch/arm/mach-ux500/board-mop500-pins.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ static pin_cfg_t mop500_pins_default[] = {
GPIO7_U1_RTSn | PIN_OUTPUT_HIGH,
};

static pin_cfg_t mop500_pins_hrefv60[] = {
static pin_cfg_t hrefv60_pins[] = {
/* WLAN */
GPIO4_GPIO | PIN_INPUT_PULLUP,/* WLAN_IRQ */
GPIO85_GPIO | PIN_OUTPUT_LOW,/* WLAN_ENA */
Expand Down Expand Up @@ -279,14 +279,26 @@ static pin_cfg_t snowball_pins[] = {
void __init mop500_pins_init(void)
{
nmk_config_pins(mop500_pins_common,
ARRAY_SIZE(mop500_pins_common));
if (machine_is_hrefv60())
nmk_config_pins(mop500_pins_hrefv60,
ARRAY_SIZE(mop500_pins_hrefv60));
else if (machine_is_snowball())
nmk_config_pins(snowball_pins,
ARRAY_SIZE(snowball_pins));
else
nmk_config_pins(mop500_pins_default,
ARRAY_SIZE(mop500_pins_default));
ARRAY_SIZE(mop500_pins_common));

nmk_config_pins(mop500_pins_default,
ARRAY_SIZE(mop500_pins_default));
}

void __init snowball_pins_init(void)
{
nmk_config_pins(mop500_pins_common,
ARRAY_SIZE(mop500_pins_common));

nmk_config_pins(snowball_pins,
ARRAY_SIZE(snowball_pins));
}

void __init hrefv60_pins_init(void)
{
nmk_config_pins(mop500_pins_common,
ARRAY_SIZE(mop500_pins_common));

nmk_config_pins(hrefv60_pins,
ARRAY_SIZE(hrefv60_pins));
}
52 changes: 35 additions & 17 deletions trunk/arch/arm/mach-ux500/board-mop500-sdi.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,30 +216,48 @@ void __init mop500_sdi_init(void)
/* PoP:ed eMMC on top of DB8500 v1.0 has problems with high speed */
if (!cpu_is_u8500v10())
mop500_sdi2_data.capabilities |= MMC_CAP_MMC_HIGHSPEED;
/* sdi2 on snowball is in ATL_B mode for FSMC (LAN) */
if (!machine_is_snowball())
db8500_add_sdi2(&mop500_sdi2_data, periphid);

db8500_add_sdi2(&mop500_sdi2_data, periphid);

/* On-board eMMC */
db8500_add_sdi4(&mop500_sdi4_data, periphid);

if (machine_is_hrefv60() || machine_is_snowball()) {
if (machine_is_hrefv60()) {
mop500_sdi0_data.gpio_cd = HREFV60_SDMMC_CD_GPIO;
sdi0_en = HREFV60_SDMMC_EN_GPIO;
sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO;
} else if (machine_is_snowball()) {
mop500_sdi0_data.gpio_cd = SNOWBALL_SDMMC_CD_GPIO;
mop500_sdi0_data.cd_invert = true;
sdi0_en = SNOWBALL_SDMMC_EN_GPIO;
sdi0_vsel = SNOWBALL_SDMMC_1V8_3V_GPIO;
}
sdi0_configure();
}

/*
* On boards with the TC35892 GPIO expander, sdi0 will finally
* be added when the TC35892 initializes and calls
* mop500_sdi_tc35892_init() above.
*/
}

void __init snowball_sdi_init(void)
{
u32 periphid = 0x10480180;

mop500_sdi2_data.capabilities |= MMC_CAP_MMC_HIGHSPEED;

/* On-board eMMC */
db8500_add_sdi4(&mop500_sdi4_data, periphid);

mop500_sdi0_data.gpio_cd = SNOWBALL_SDMMC_CD_GPIO;
mop500_sdi0_data.cd_invert = true;
sdi0_en = SNOWBALL_SDMMC_EN_GPIO;
sdi0_vsel = SNOWBALL_SDMMC_1V8_3V_GPIO;
sdi0_configure();
}

void __init hrefv60_sdi_init(void)
{
u32 periphid = 0x10480180;

mop500_sdi2_data.capabilities |= MMC_CAP_MMC_HIGHSPEED;

db8500_add_sdi2(&mop500_sdi2_data, periphid);

/* On-board eMMC */
db8500_add_sdi4(&mop500_sdi4_data, periphid);

mop500_sdi0_data.gpio_cd = HREFV60_SDMMC_CD_GPIO;
sdi0_en = HREFV60_SDMMC_EN_GPIO;
sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO;
sdi0_configure();
}
78 changes: 61 additions & 17 deletions trunk/arch/arm/mach-ux500/board-mop500.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,37 +603,81 @@ static void __init mop500_init_machine(void)
{
int i2c0_devs;

mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;

u8500_init_devices();

mop500_pins_init();

platform_add_devices(mop500_platform_devs,
ARRAY_SIZE(mop500_platform_devs));

mop500_i2c_init();
mop500_sdi_init();
mop500_spi_init();
mop500_uart_init();

i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);

i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
i2c_register_board_info(2, mop500_i2c2_devices,
ARRAY_SIZE(mop500_i2c2_devices));

/* This board has full regulator constraints */
regulator_has_full_constraints();
}

static void __init snowball_init_machine(void)
{
int i2c0_devs;

u8500_init_devices();

snowball_pins_init();

platform_add_devices(snowball_platform_devs,
ARRAY_SIZE(snowball_platform_devs));

mop500_i2c_init();
snowball_sdi_init();
mop500_spi_init();
mop500_uart_init();

i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
i2c_register_board_info(2, mop500_i2c2_devices,
ARRAY_SIZE(mop500_i2c2_devices));

/* This board has full regulator constraints */
regulator_has_full_constraints();
}

static void __init hrefv60_init_machine(void)
{
int i2c0_devs;

/*
* The HREFv60 board removed a GPIO expander and routed
* all these GPIO pins to the internal GPIO controller
* instead.
*/
if (!machine_is_snowball()) {
if (machine_is_hrefv60())
mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
else
mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
}
mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;

u8500_init_devices();

mop500_pins_init();
hrefv60_pins_init();

if (machine_is_snowball())
platform_add_devices(snowball_platform_devs,
ARRAY_SIZE(snowball_platform_devs));
else
platform_add_devices(mop500_platform_devs,
ARRAY_SIZE(mop500_platform_devs));
platform_add_devices(mop500_platform_devs,
ARRAY_SIZE(mop500_platform_devs));

mop500_i2c_init();
mop500_sdi_init();
mop500_spi_init();
mop500_uart_init();

i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
if (machine_is_hrefv60())
i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES;

i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES;

i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
i2c_register_board_info(2, mop500_i2c2_devices,
Expand All @@ -658,7 +702,7 @@ MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
.map_io = u8500_map_io,
.init_irq = ux500_init_irq,
.timer = &ux500_timer,
.init_machine = mop500_init_machine,
.init_machine = hrefv60_init_machine,
MACHINE_END

MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
Expand All @@ -667,5 +711,5 @@ MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
.init_irq = ux500_init_irq,
/* we re-use nomadik timer here */
.timer = &ux500_timer,
.init_machine = mop500_init_machine,
.init_machine = snowball_init_machine,
MACHINE_END
3 changes: 3 additions & 0 deletions trunk/arch/arm/mach-ux500/board-mop500.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,13 @@
struct i2c_board_info;

extern void mop500_sdi_init(void);
extern void snowball_sdi_init(void);
extern void mop500_sdi_tc35892_init(void);
void __init mop500_u8500uib_init(void);
void __init mop500_stuib_init(void);
void __init mop500_pins_init(void);
void __init hrefv60_pins_init(void);
void __init snowball_pins_init(void);

void mop500_uib_i2c_add(int busnum, struct i2c_board_info *info,
unsigned n);
Expand Down
72 changes: 72 additions & 0 deletions trunk/arch/arm/mach-ux500/cache-l2x0.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*
* Copyright (C) ST-Ericsson SA 2011
*
* License terms: GNU General Public License (GPL) version 2
*/

#include <linux/io.h>
#include <asm/cacheflush.h>
#include <asm/hardware/cache-l2x0.h>
#include <mach/hardware.h>
#include <mach/id.h>

static void __iomem *l2x0_base;

static inline void ux500_cache_wait(void __iomem *reg, unsigned long mask)
{
/* wait for the operation to complete */
while (readl_relaxed(reg) & mask)
cpu_relax();
}

static inline void ux500_cache_sync(void)
{
writel_relaxed(0, l2x0_base + L2X0_CACHE_SYNC);
ux500_cache_wait(l2x0_base + L2X0_CACHE_SYNC, 1);
}

/*
* The L2 cache cannot be turned off in the non-secure world.
* Dummy until a secure service is in place.
*/
static void ux500_l2x0_disable(void)
{
}

/*
* This is only called when doing a kexec, just after turning off the L2
* and L1 cache, and it is surrounded by a spinlock in the generic version.
* However, we're not really turning off the L2 cache right now and the
* PL310 does not support exclusive accesses (used to implement the spinlock).
* So, the invalidation needs to be done without the spinlock.
*/
static void ux500_l2x0_inv_all(void)
{
uint32_t l2x0_way_mask = (1<<16) - 1; /* Bitmask of active ways */

/* invalidate all ways */
writel_relaxed(l2x0_way_mask, l2x0_base + L2X0_INV_WAY);
ux500_cache_wait(l2x0_base + L2X0_INV_WAY, l2x0_way_mask);
ux500_cache_sync();
}

static int ux500_l2x0_init(void)
{
if (cpu_is_u5500())
l2x0_base = __io_address(U5500_L2CC_BASE);
else if (cpu_is_u8500())
l2x0_base = __io_address(U8500_L2CC_BASE);
else
ux500_unknown_soc();

/* 64KB way size, 8 way associativity, force WA */
l2x0_init(l2x0_base, 0x3e060000, 0xc0000fff);

/* Override invalidate function */
outer_cache.disable = ux500_l2x0_disable;
outer_cache.inv_all = ux500_l2x0_inv_all;

return 0;
}

early_initcall(ux500_l2x0_init);
Loading

0 comments on commit 83e23a9

Please sign in to comment.