Commit bf976b51 authored by viresh kumar's avatar viresh kumar Committed by Russell King
Browse files

ARM: 6012/1: ST SPEAr: Added basic header files for SPEAr platform

parent e024c3d5
Loading
Loading
Loading
Loading
+38 −0
Original line number Diff line number Diff line
/*
 * arch/arm/plat-spear/include/plat/debug-macro.S
 *
 * Debugging macro include header for spear platform
 *
 * Copyright (C) 2009 ST Microelectronics
 * Viresh Kumar<viresh.kumar@st.com>
 *
 * This file is licensed under the terms of the GNU General Public
 * License version 2. This program is licensed "as is" without any
 * warranty of any kind, whether express or implied.
 */

#include <linux/amba/serial.h>
#include <mach/spear.h>

		.macro	addruart, rx
		mrc	p15, 0, \rx, c1, c0
		tst	\rx, #1					@ MMU enabled?
		moveq	\rx, =SPEAR_DBG_UART_BASE		@ Physical base
		movne	\rx, =VA_SPEAR_DBG_UART_BASE		@ Virtual base
		.endm

		.macro	senduart, rd, rx
		strb	\rd, [\rx, #UART01x_DR]			@ ASC_TX_BUFFER
		.endm

		.macro	waituart, rd, rx
1001:		ldr	\rd, [\rx, #UART01x_FR]			@ FLAG REGISTER
		tst	\rd, #UART01x_FR_TXFF			@ TX_FULL
		bne	1001b
		.endm

		.macro	busyuart, rd, rx
1002:		ldr	\rd, [\rx, #UART01x_FR]			@ FLAG REGISTER
		tst	\rd, #UART011_FR_TXFE			@ TX_EMPTY
		beq	1002b
		.endm
+24 −0
Original line number Diff line number Diff line
/*
 * arch/arm/plat-spear/include/plat/gpio.h
 *
 * GPIO macros for SPEAr platform
 *
 * Copyright (C) 2009 ST Microelectronics
 * Viresh Kumar<viresh.kumar@st.com>
 *
 * This file is licensed under the terms of the GNU General Public
 * License version 2. This program is licensed "as is" without any
 * warranty of any kind, whether express or implied.
 */

#ifndef __PLAT_GPIO_H
#define __PLAT_GPIO_H

#include <asm-generic/gpio.h>

#define gpio_get_value	__gpio_get_value
#define gpio_set_value	__gpio_set_value
#define gpio_cansleep	__gpio_cansleep
#define gpio_to_irq	__gpio_to_irq

#endif /* __PLAT_GPIO_H */
+22 −0
Original line number Diff line number Diff line
/*
 * arch/arm/plat-spear/include/plat/io.h
 *
 * IO definitions for SPEAr platform
 *
 * Copyright (C) 2009 ST Microelectronics
 * Viresh Kumar<viresh.kumar@st.com>
 *
 * This file is licensed under the terms of the GNU General Public
 * License version 2. This program is licensed "as is" without any
 * warranty of any kind, whether express or implied.
 */

#ifndef __PLAT_IO_H
#define __PLAT_IO_H

#define IO_SPACE_LIMIT		0xFFFFFFFF

#define __io(a)			__typesafe_io(a)
#define __mem_pci(a)		(a)

#endif /* __PLAT_IO_H */
+20 −0
Original line number Diff line number Diff line
/*
 * arch/arm/plat-spear/include/plat/memory.h
 *
 * Memory map for SPEAr platform
 *
 * Copyright (C) 2009 ST Microelectronics
 * Viresh Kumar<viresh.kumar@st.com>
 *
 * This file is licensed under the terms of the GNU General Public
 * License version 2. This program is licensed "as is" without any
 * warranty of any kind, whether express or implied.
 */

#ifndef __PLAT_MEMORY_H
#define __PLAT_MEMORY_H

/* Physical DRAM offset */
#define PHYS_OFFSET		UL(0x00000000)

#endif /* __PLAT_MEMORY_H */
+41 −0
Original line number Diff line number Diff line
/*
 * arch/arm/plat-spear/include/plat/system.h
 *
 * SPEAr platform specific architecture functions
 *
 * Copyright (C) 2009 ST Microelectronics
 * Viresh Kumar<viresh.kumar@st.com>
 *
 * This file is licensed under the terms of the GNU General Public
 * License version 2. This program is licensed "as is" without any
 * warranty of any kind, whether express or implied.
 */

#ifndef __PLAT_SYSTEM_H
#define __PLAT_SYSTEM_H

#include <asm/hardware/sp810.h>
#include <linux/io.h>
#include <mach/spear.h>

static inline void arch_idle(void)
{
	/*
	 * This should do all the clock switching
	 * and wait for interrupt tricks
	 */
	cpu_do_idle();
}

static inline void arch_reset(char mode, const char *cmd)
{
	if (mode == 's') {
		/* software reset, Jump into ROM at address 0 */
		cpu_reset(0);
	} else {
		/* hardware reset, Use on-chip reset capability */
		sysctl_soft_reset((void __iomem *)VA_SPEAR_SYS_CTRL_BASE);
	}
}

#endif /* __PLAT_SYSTEM_H */
Loading