Skip to content

Commit

Permalink
Merge branch 'for-torvalds' 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

* 'for-torvalds' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson:
  ux500: allow 5500 and 8500 to be built together
  ux500: modem_irq is only for 5500
  ux500: dynamic SOC detection
  ux500: rename MOP board Kconfig
  ux500: remove build-time changing macros
  • Loading branch information
torvalds committed Jan 10, 2011
2 parents abf8792 + d2a4097 commit e773202
Show file tree
Hide file tree
Showing 16 changed files with 354 additions and 261 deletions.
4 changes: 4 additions & 0 deletions arch/arm/configs/u8500_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ CONFIG_MODULE_UNLOAD=y
# CONFIG_LBDAF is not set
# CONFIG_BLK_DEV_BSG is not set
CONFIG_ARCH_U8500=y
CONFIG_UX500_SOC_DB5500=y
CONFIG_UX500_SOC_DB8500=y
CONFIG_MACH_U8500=y
CONFIG_MACH_U5500=y
CONFIG_SMP=y
CONFIG_NR_CPUS=2
CONFIG_PREEMPT=y
Expand Down
26 changes: 14 additions & 12 deletions arch/arm/mach-ux500/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,30 @@ config UX500_SOC_COMMON
select HAS_MTU
select NOMADIK_GPIO

config UX500_SOC_DB8500
bool
menu "Ux500 SoC"

config UX500_SOC_DB5500
bool
bool "DB5500"

config UX500_SOC_DB8500
bool "DB8500"

endmenu

choice
prompt "Ux500 target platform"
default MACH_U8500_MOP
menu "Ux500 target platform"

config MACH_U8500_MOP
config MACH_U8500
bool "U8500 Development platform"
select UX500_SOC_DB8500
depends on UX500_SOC_DB8500
help
Include support for the mop500 development platform.

config MACH_U5500
bool "U5500 Development platform"
select UX500_SOC_DB5500
depends on UX500_SOC_DB5500
help
Include support for the U5500 development platform.
endchoice
endmenu

config UX500_DEBUG_UART
int "Ux500 UART to use for low-level debug"
Expand All @@ -39,14 +41,14 @@ config UX500_DEBUG_UART

config U5500_MODEM_IRQ
bool "Modem IRQ support"
depends on MACH_U5500
depends on UX500_SOC_DB5500
default y
help
Add support for handling IRQ:s from modem side

config U5500_MBOX
bool "Mailbox support"
depends on MACH_U5500 && U5500_MODEM_IRQ
depends on U5500_MODEM_IRQ
default y
help
Add support for U5500 mailbox communication with modem side
Expand Down
5 changes: 3 additions & 2 deletions arch/arm/mach-ux500/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
# Makefile for the linux kernel, U8500 machine.
#

obj-y := clock.o cpu.o devices.o devices-common.o
obj-y := clock.o cpu.o devices.o devices-common.o \
id.o
obj-$(CONFIG_UX500_SOC_DB5500) += cpu-db5500.o dma-db5500.o
obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o devices-db8500.o prcmu.o
obj-$(CONFIG_MACH_U8500_MOP) += board-mop500.o board-mop500-sdi.o \
obj-$(CONFIG_MACH_U8500) += board-mop500.o board-mop500-sdi.o \
board-mop500-keypads.o
obj-$(CONFIG_MACH_U5500) += board-u5500.o board-u5500-sdi.o
obj-$(CONFIG_SMP) += platsmp.o headsmp.o
Expand Down
14 changes: 10 additions & 4 deletions arch/arm/mach-ux500/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@ EXPORT_SYMBOL(clk_disable);
*/
static unsigned long clk_mtu_get_rate(struct clk *clk)
{
void __iomem *addr = __io_address(UX500_PRCMU_BASE)
+ PRCM_TCR;
void __iomem *addr;
u32 tcr;
int mtu = (int) clk->data;
/*
Expand All @@ -149,13 +148,20 @@ static unsigned long clk_mtu_get_rate(struct clk *clk)
unsigned long mturate;
unsigned long retclk;

if (cpu_is_u5500())
addr = __io_address(U5500_PRCMU_BASE);
else if (cpu_is_u8500())
addr = __io_address(U8500_PRCMU_BASE);
else
ux500_unknown_soc();

/*
* On a startup, always conifgure the TCR to the doze mode;
* bootloaders do it for us. Do this in the kernel too.
*/
writel(PRCM_TCR_DOZE_MODE, addr);
writel(PRCM_TCR_DOZE_MODE, addr + PRCM_TCR);

tcr = readl(addr);
tcr = readl(addr + PRCM_TCR);

/* Get the rate from the parent as a default */
if (clk->parent_periph)
Expand Down
18 changes: 18 additions & 0 deletions arch/arm/mach-ux500/cpu-db5500.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,20 @@

#include "devices-db5500.h"

static struct map_desc u5500_uart_io_desc[] __initdata = {
__IO_DEV_DESC(U5500_UART0_BASE, SZ_4K),
__IO_DEV_DESC(U5500_UART2_BASE, SZ_4K),
};

static struct map_desc u5500_io_desc[] __initdata = {
__IO_DEV_DESC(U5500_GIC_CPU_BASE, SZ_4K),
__IO_DEV_DESC(U5500_GIC_DIST_BASE, SZ_4K),
__IO_DEV_DESC(U5500_L2CC_BASE, SZ_4K),
__IO_DEV_DESC(U5500_TWD_BASE, SZ_4K),
__IO_DEV_DESC(U5500_MTU0_BASE, SZ_4K),
__IO_DEV_DESC(U5500_SCU_BASE, SZ_4K),
__IO_DEV_DESC(U5500_BACKUPRAM0_BASE, SZ_8K),

__IO_DEV_DESC(U5500_GPIO0_BASE, SZ_4K),
__IO_DEV_DESC(U5500_GPIO1_BASE, SZ_4K),
__IO_DEV_DESC(U5500_GPIO2_BASE, SZ_4K),
Expand Down Expand Up @@ -143,6 +156,11 @@ static void __init db5500_add_gpios(void)

void __init u5500_map_io(void)
{
/*
* Map the UARTs early so that the DEBUG_LL stuff continues to work.
*/
iotable_init(u5500_uart_io_desc, ARRAY_SIZE(u5500_uart_io_desc));

ux500_map_io();

iotable_init(u5500_io_desc, ARRAY_SIZE(u5500_io_desc));
Expand Down
105 changes: 24 additions & 81 deletions arch/arm/mach-ux500/cpu-db8500.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,31 @@ static struct platform_device *platform_devs[] __initdata = {
};

/* minimum static i/o mapping required to boot U8500 platforms */
static struct map_desc u8500_uart_io_desc[] __initdata = {
__IO_DEV_DESC(U8500_UART0_BASE, SZ_4K),
__IO_DEV_DESC(U8500_UART2_BASE, SZ_4K),
};

static struct map_desc u8500_io_desc[] __initdata = {
__IO_DEV_DESC(U8500_GIC_CPU_BASE, SZ_4K),
__IO_DEV_DESC(U8500_GIC_DIST_BASE, SZ_4K),
__IO_DEV_DESC(U8500_L2CC_BASE, SZ_4K),
__IO_DEV_DESC(U8500_TWD_BASE, SZ_4K),
__IO_DEV_DESC(U8500_MTU0_BASE, SZ_4K),
__IO_DEV_DESC(U8500_SCU_BASE, SZ_4K),
__IO_DEV_DESC(U8500_BACKUPRAM0_BASE, SZ_8K),

__IO_DEV_DESC(U8500_CLKRST1_BASE, SZ_4K),
__IO_DEV_DESC(U8500_CLKRST2_BASE, SZ_4K),
__IO_DEV_DESC(U8500_CLKRST3_BASE, SZ_4K),
__IO_DEV_DESC(U8500_CLKRST5_BASE, SZ_4K),
__IO_DEV_DESC(U8500_CLKRST6_BASE, SZ_4K),

__IO_DEV_DESC(U8500_PRCMU_BASE, SZ_4K),
__IO_DEV_DESC(U8500_GPIO0_BASE, SZ_4K),
__IO_DEV_DESC(U8500_GPIO1_BASE, SZ_4K),
__IO_DEV_DESC(U8500_GPIO2_BASE, SZ_4K),
__IO_DEV_DESC(U8500_GPIO3_BASE, SZ_4K),
__MEM_DEV_DESC(U8500_BOOT_ROM_BASE, SZ_1M),
};

static struct map_desc u8500_ed_io_desc[] __initdata = {
Expand All @@ -52,71 +70,13 @@ static struct map_desc u8500_v2_io_desc[] __initdata = {
__IO_DEV_DESC(U8500_PRCMU_TCDM_BASE, SZ_4K),
};

/*
* Functions to differentiate between later ASICs
* We look into the end of the ROM to locate the hardcoded ASIC ID.
* This is only needed to differentiate between minor revisions and
* process variants of an ASIC, the major revisions are encoded in
* the cpuid.
*/
#define U8500_ASIC_ID_LOC_ED_V1 (U8500_BOOT_ROM_BASE + 0x1FFF4)
#define U8500_ASIC_ID_LOC_V2 (U8500_BOOT_ROM_BASE + 0x1DBF4)
#define U8500_ASIC_REV_ED 0x01
#define U8500_ASIC_REV_V10 0xA0
#define U8500_ASIC_REV_V11 0xA1
#define U8500_ASIC_REV_V20 0xB0

/**
* struct db8500_asic_id - fields of the ASIC ID
* @process: the manufacturing process, 0x40 is 40 nm
* 0x00 is "standard"
* @partnumber: hithereto 0x8500 for DB8500
* @revision: version code in the series
* This field definion is not formally defined but makes
* sense.
*/
struct db8500_asic_id {
u8 process;
u16 partnumber;
u8 revision;
};

/* This isn't going to change at runtime */
static struct db8500_asic_id db8500_id;

static void __init get_db8500_asic_id(void)
{
u32 asicid;

if (cpu_is_u8500v1() || cpu_is_u8500ed())
asicid = readl(__io_address(U8500_ASIC_ID_LOC_ED_V1));
else if (cpu_is_u8500v2())
asicid = readl(__io_address(U8500_ASIC_ID_LOC_V2));
else
BUG();

db8500_id.process = (asicid >> 24);
db8500_id.partnumber = (asicid >> 16) & 0xFFFFU;
db8500_id.revision = asicid & 0xFFU;
}

bool cpu_is_u8500v10(void)
{
return (db8500_id.revision == U8500_ASIC_REV_V10);
}

bool cpu_is_u8500v11(void)
{
return (db8500_id.revision == U8500_ASIC_REV_V11);
}

bool cpu_is_u8500v20(void)
{
return (db8500_id.revision == U8500_ASIC_REV_V20);
}

void __init u8500_map_io(void)
{
/*
* Map the UARTs early so that the DEBUG_LL stuff continues to work.
*/
iotable_init(u8500_uart_io_desc, ARRAY_SIZE(u8500_uart_io_desc));

ux500_map_io();

iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc));
Expand All @@ -127,9 +87,6 @@ void __init u8500_map_io(void)
iotable_init(u8500_v1_io_desc, ARRAY_SIZE(u8500_v1_io_desc));
else if (cpu_is_u8500v2())
iotable_init(u8500_v2_io_desc, ARRAY_SIZE(u8500_v2_io_desc));

/* Read out the ASIC ID as early as we can */
get_db8500_asic_id();
}

static resource_size_t __initdata db8500_gpio_base[] = {
Expand Down Expand Up @@ -159,20 +116,6 @@ static void __init db8500_add_gpios(void)
*/
void __init u8500_init_devices(void)
{
/* Display some ASIC boilerplate */
pr_info("DB8500: process: %02x, revision ID: 0x%02x\n",
db8500_id.process, db8500_id.revision);
if (cpu_is_u8500ed())
pr_info("DB8500: Early Drop (ED)\n");
else if (cpu_is_u8500v10())
pr_info("DB8500: version 1.0\n");
else if (cpu_is_u8500v11())
pr_info("DB8500: version 1.1\n");
else if (cpu_is_u8500v20())
pr_info("DB8500: version 2.0\n");
else
pr_warning("ASIC: UNKNOWN SILICON VERSION!\n");

if (cpu_is_u8500ed())
dma40_u8500ed_fixup();

Expand Down
Loading

0 comments on commit e773202

Please sign in to comment.