Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 172429
b: refs/heads/master
c: aa44ef4
h: refs/heads/master
i:
  172427: b3cffd8
v: v3
  • Loading branch information
Srinidhi Kasagar authored and Russell King committed Nov 28, 2009
1 parent 16a5e73 commit a01d429
Show file tree
Hide file tree
Showing 17 changed files with 777 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c6b503caef9abefb2e90ac83f672b75dc14bacd0
refs/heads/master: aa44ef4d43b200c0e318ade2a3c24d00a6fd942a
15 changes: 15 additions & 0 deletions trunk/arch/arm/mach-ux500/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
menu "ST-Ericsson platform type"
depends on ARCH_U8500

comment "ST-Ericsson Multicore Mobile Platforms"

config MACH_U8500_MOP
bool "U8500 Early Development platform"
default y
select ARM_GIC
select HAS_MTU
help
Include support for mop500 development platform
based on U8500 architecture. The platform is based
on early drop silicon version of 8500.
endmenu
8 changes: 8 additions & 0 deletions trunk/arch/arm/mach-ux500/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# Makefile for the linux kernel, U8500 machine.
#

obj-y := clock.o
obj-$(CONFIG_ARCH_U8500) += cpu-u8500.o
obj-$(CONFIG_MACH_U8500_MOP) += board-mop500.o
obj-$(CONFIG_SMP) += platsmp.o headsmp.o localtimer.o
158 changes: 158 additions & 0 deletions trunk/arch/arm/mach-ux500/board-mop500.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
/*
* Copyright (C) 2008-2009 ST-Ericsson
*
* Author: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2, as
* published by the Free Software Foundation.
*
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/amba/bus.h>
#include <linux/amba/pl022.h>
#include <linux/spi/spi.h>

#include <asm/localtimer.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>

#include <plat/mtu.h>

#include <mach/hardware.h>
#include <mach/setup.h>

#define __MEM_4K_RESOURCE(x) \
.res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM}

/* These are active devices on this board */
static struct amba_device uart0_device = {
.dev = { .init_name = "uart0" },
__MEM_4K_RESOURCE(U8500_UART0_BASE),
.irq = {IRQ_UART0, NO_IRQ},
};

static struct amba_device uart1_device = {
.dev = { .init_name = "uart1" },
__MEM_4K_RESOURCE(U8500_UART1_BASE),
.irq = {IRQ_UART1, NO_IRQ},
};

static struct amba_device uart2_device = {
.dev = { .init_name = "uart2" },
__MEM_4K_RESOURCE(U8500_UART2_BASE),
.irq = {IRQ_UART2, NO_IRQ},
};

static void ab4500_spi_cs_control(u32 command)
{
/* set the FRM signal, which is CS - TODO */
}

struct pl022_config_chip ab4500_chip_info = {
.lbm = LOOPBACK_DISABLED,
.com_mode = INTERRUPT_TRANSFER,
.iface = SSP_INTERFACE_MOTOROLA_SPI,
/* we can act as master only */
.hierarchy = SSP_MASTER,
.slave_tx_disable = 0,
.endian_rx = SSP_RX_MSB,
.endian_tx = SSP_TX_MSB,
.data_size = SSP_DATA_BITS_24,
.rx_lev_trig = SSP_RX_1_OR_MORE_ELEM,
.tx_lev_trig = SSP_TX_1_OR_MORE_EMPTY_LOC,
.clk_phase = SSP_CLK_SECOND_EDGE,
.clk_pol = SSP_CLK_POL_IDLE_HIGH,
.cs_control = ab4500_spi_cs_control,
};

static struct spi_board_info u8500_spi_devices[] = {
{
.modalias = "ab4500",
.controller_data = &ab4500_chip_info,
.max_speed_hz = 12000000,
.bus_num = 0,
.chip_select = 0,
.mode = SPI_MODE_0,
.irq = IRQ_AB4500,
},
};

static struct pl022_ssp_controller ssp0_platform_data = {
.bus_id = 0,
/* pl022 not yet supports dma */
.enable_dma = 0,
/* on this platform, gpio 31,142,144,214 &
* 224 are connected as chip selects
*/
.num_chipselect = 5,
};

static struct amba_device pl022_device = {
.dev = {
.coherent_dma_mask = ~0,
.init_name = "pl022",
.platform_data = &ssp0_platform_data,
},
.res = {
.start = U8500_SSP0_BASE,
.end = U8500_SSP0_BASE + SZ_4K - 1,
.flags = IORESOURCE_MEM,
},
.irq = {IRQ_SSP0, NO_IRQ },
/* ST-Ericsson modified id */
.periphid = SSP_PER_ID,
};

static struct amba_device *amba_devs[] __initdata = {
&uart0_device,
&uart1_device,
&uart2_device,
&pl022_device,
};

static void __init u8500_timer_init(void)
{
#ifdef CONFIG_LOCAL_TIMERS
/* Setup the local timer base */
twd_base = __io_address(U8500_TWD_BASE);
#endif
/* Setup the MTU base */
mtu_base = __io_address(U8500_MTU0_BASE);

nmdk_timer_init();
}

static struct sys_timer u8500_timer = {
.init = u8500_timer_init,
};

static void __init u8500_init_machine(void)
{
int i;

/* Register the active AMBA devices on this board */
for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
amba_device_register(amba_devs[i], &iomem_resource);

spi_register_board_info(u8500_spi_devices,
ARRAY_SIZE(u8500_spi_devices));

u8500_init_devices();
}

MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
/* Maintainer: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> */
.phys_io = U8500_UART2_BASE,
.io_pg_offst = (IO_ADDRESS(U8500_UART2_BASE) >> 18) & 0xfffc,
.boot_params = 0x100,
.map_io = u8500_map_io,
.init_irq = u8500_init_irq,
/* we re-use nomadik timer here */
.timer = &u8500_timer,
.init_machine = u8500_init_machine,
MACHINE_END
64 changes: 64 additions & 0 deletions trunk/arch/arm/mach-ux500/cpu-u8500.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Copyright (C) 2008-2009 ST-Ericsson
*
* Author: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2, as
* published by the Free Software Foundation.
*
*/
#include <linux/types.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/amba/bus.h>
#include <linux/irq.h>
#include <linux/platform_device.h>

#include <asm/hardware/gic.h>
#include <asm/mach/map.h>
#include <mach/hardware.h>

/* add any platform devices here - TODO */
static struct platform_device *platform_devs[] __initdata = {
/* yet to be added, add i2c0, gpio.. */
};

#define __IO_DEV_DESC(x, sz) { \
.virtual = IO_ADDRESS(x), \
.pfn = __phys_to_pfn(x), \
.length = sz, \
.type = MT_DEVICE, \
}

/* minimum static i/o mapping required to boot U8500 platforms */
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_MTU0_BASE, SZ_4K),
__IO_DEV_DESC(U8500_TWD_BASE, SZ_4K),
__IO_DEV_DESC(U8500_SCU_BASE, SZ_4K),
__IO_DEV_DESC(U8500_BACKUPRAM0_BASE, SZ_8K),
};

void __init u8500_map_io(void)
{
iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc));
}

void __init u8500_init_irq(void)
{
gic_dist_init(0, __io_address(U8500_GIC_DIST_BASE), 29);
gic_cpu_init(0, __io_address(U8500_GIC_CPU_BASE));
}

/*
* This function is called from the board init
*/
void __init u8500_init_devices(void)
{
/* Register the platform devices */
platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs));

return ;
}
38 changes: 38 additions & 0 deletions trunk/arch/arm/mach-ux500/headsmp.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright (c) 2009 ST-Ericsson
* This file is based ARM Realview platform
* Copyright (c) 2003 ARM Limited
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/linkage.h>
#include <linux/init.h>

__INIT

/*
* U8500 specific entry point for secondary CPUs.
*/
ENTRY(u8500_secondary_startup)
mrc p15, 0, r0, c0, c0, 5
and r0, r0, #15
adr r4, 1f
ldmia r4, {r5, r6}
sub r4, r4, r5
add r6, r6, r4
dsb
pen: ldr r7, [r6]
cmp r7, r0
bne pen

/*
* we've been released from the holding pen: secondary_stack
* should now contain the SVC stack for this core
*/
b secondary_startup

1: .long .
.long pen_release
19 changes: 19 additions & 0 deletions trunk/arch/arm/mach-ux500/include/mach/debug-macro.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Debugging macro include header
*
* Copyright (C) 2009 ST-Ericsson
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
*/
.macro addruart,rx
mrc p15, 0, \rx, c1, c0
tst \rx, #1 @MMU enabled?
moveq \rx, #0x80000000 @MMU off, Physical address
movne \rx, #0xF0000000 @MMU on, Virtual address
orr \rx, \rx, #0x7000
.endm

#include <asm/hardware/debug-pl01x.S>
Loading

0 comments on commit a01d429

Please sign in to comment.