Skip to content

Commit

Permalink
ARM: Introduce plat-tcc
Browse files Browse the repository at this point in the history
This patch introduces support for the tcc platform by creating an
arch/arm/plat-tcc and arch/arm/mach-tcc8k directories and adding
basic include files plus Kconfig and Makefile.

Signed-off-by: "Hans J. Koch" <hjk@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Hans J. Koch authored and Thomas Gleixner committed Sep 17, 2010
1 parent 509344b commit 83ef333
Show file tree
Hide file tree
Showing 14 changed files with 1,099 additions and 0 deletions.
11 changes: 11 additions & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,15 @@ config ARCH_SHARK
Support for the StrongARM based Digital DNARD machine, also known
as "Shark" (<http://www.shark-linux.de/shark.html>).

config ARCH_TCC_926
bool "Telechips TCC ARM926-based systems"
select CPU_ARM926T
select HAVE_CLK
select COMMON_CLKDEV
select GENERIC_CLOCKEVENTS
help
Support for Telechips TCC ARM926-based systems.

config ARCH_LH7A40X
bool "Sharp LH7A40X"
select CPU_ARM922T
Expand Down Expand Up @@ -916,6 +925,8 @@ source "arch/arm/plat-s5p/Kconfig"

source "arch/arm/plat-spear/Kconfig"

source "arch/arm/plat-tcc/Kconfig"

if ARCH_S3C2410
source "arch/arm/mach-s3c2400/Kconfig"
source "arch/arm/mach-s3c2410/Kconfig"
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ machine-$(CONFIG_ARCH_SHARK) := shark
machine-$(CONFIG_ARCH_SHMOBILE) := shmobile
machine-$(CONFIG_ARCH_STMP378X) := stmp378x
machine-$(CONFIG_ARCH_STMP37XX) := stmp37xx
machine-$(CONFIG_ARCH_TCC8K) := tcc8k
machine-$(CONFIG_ARCH_TEGRA) := tegra
machine-$(CONFIG_ARCH_U300) := u300
machine-$(CONFIG_ARCH_U8500) := ux500
Expand All @@ -202,6 +203,7 @@ plat-$(CONFIG_ARCH_MXC) := mxc
plat-$(CONFIG_ARCH_OMAP) := omap
plat-$(CONFIG_ARCH_S3C64XX) := samsung
plat-$(CONFIG_ARCH_STMP3XXX) := stmp3xxx
plat-$(CONFIG_ARCH_TCC_926) := tcc
plat-$(CONFIG_PLAT_IOP) := iop
plat-$(CONFIG_PLAT_NOMADIK) := nomadik
plat-$(CONFIG_PLAT_ORION) := orion
Expand Down
5 changes: 5 additions & 0 deletions arch/arm/mach-tcc8k/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if ARCH_TCC8K

comment "TCC8000 systems:"

endif
20 changes: 20 additions & 0 deletions arch/arm/plat-tcc/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
if ARCH_TCC_926

menu "Telechips ARM926-based CPUs"

choice
prompt "Telechips CPU type:"
default ARCH_TCC8K

config ARCH_TCC8K
bool TCC8000
select USB_ARCH_HAS_OHCI
help
Support for Telechips TCC8000 systems

endchoice

source "arch/arm/mach-tcc8k/Kconfig"

endmenu
endif
3 changes: 3 additions & 0 deletions arch/arm/plat-tcc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# "Telechips Platform Common Modules"

obj-y := system.o
33 changes: 33 additions & 0 deletions arch/arm/plat-tcc/include/mach/debug-macro.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright (C) 1994-1999 Russell King
* Copyright (C) 2008-2009 Telechips
* Copyright (C) 2009 Hans J. Koch <hjk@linutronix.de>
*
* 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,tmp
mrc p15, 0, \rx, c1, c0
tst \rx, #1 @ MMU enabled?
moveq \rx, #0x90000000 @ physical base address
movne \rx, #0xF1000000 @ virtual base
orr \rx, \rx, #0x00007000 @ UART0
.endm

.macro senduart,rd,rx
strb \rd, [\rx, #0x44]
.endm

.macro waituart,rd,rx
.endm

.macro busyuart,rd,rx
1001:
ldr \rd, [\rx, #0x14]
tst \rd, #0x20

beq 1001b
.endm
68 changes: 68 additions & 0 deletions arch/arm/plat-tcc/include/mach/entry-macro.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* include/asm-arm/arch-tcc83x/entry-macro.S
*
* Author : <linux@telechips.com>
* Created: June 10, 2008
* Description: Low-level IRQ helper macros for Telechips-based platforms
*
* Copyright (C) 2008-2009 Telechips
*
* 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 <mach/hardware.h>
#include <mach/irqs.h>

.macro disable_fiq
.endm

.macro get_irqnr_preamble, base, tmp
.endm

.macro arch_ret_to_user, tmp1, tmp2
.endm

.macro get_irqnr_and_base, irqnr, irqstat, base, tmp

ldr \base, =0xF2003000 @ base address of PIC registers

@@ read MREQ register of PIC0

mov \irqnr, #0
ldr \irqstat, [\base, #0x00000014 ] @ lower 32 interrupts
cmp \irqstat, #0
bne 1001f

@@ read MREQ register of PIC1

ldr \irqstat, [\base, #0x00000094] @ upper 32 interrupts
cmp \irqstat, #0
beq 1002f
mov \irqnr, #0x20

1001:
movs \tmp, \irqstat, lsl #16
movne \irqstat, \tmp
addeq \irqnr, \irqnr, #16

movs \tmp, \irqstat, lsl #8
movne \irqstat, \tmp
addeq \irqnr, \irqnr, #8

movs \tmp, \irqstat, lsl #4
movne \irqstat, \tmp
addeq \irqnr, \irqnr, #4

movs \tmp, \irqstat, lsl #2
movne \irqstat, \tmp
addeq \irqnr, \irqnr, #2

movs \tmp, \irqstat, lsl #1
addeq \irqnr, \irqnr, #1
orrs \base, \base, #1
1002:
@@ exit here, Z flag unset if IRQ

.endm
43 changes: 43 additions & 0 deletions arch/arm/plat-tcc/include/mach/hardware.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Author: RidgeRun, Inc. Greg Lonnon <glonnon@ridgerun.com>
* Reorganized for Linux-2.6 by Tony Lindgren <tony@atomide.com>
* and Dirk Behme <dirk.behme@de.bosch.com>
* Rewritten by: <linux@telechips.com>
* Description: Hardware definitions for TCC8300 processors and boards
*
* Copyright (C) 2001 RidgeRun, Inc.
* Copyright (C) 2008-2009 Telechips
*
* Modifications for mainline (C) 2009 Hans J. Koch <hjk@linutronix.de>
*
* Licensed under the terms of the GNU Pulic License version 2.
*/

#ifndef __ASM_ARCH_TCC_HARDWARE_H
#define __ASM_ARCH_TCC_HARDWARE_H

#include <asm/sizes.h>
#ifndef __ASSEMBLER__
#include <asm/types.h>
#endif
#include <mach/io.h>

/*
* ----------------------------------------------------------------------------
* Clocks
* ----------------------------------------------------------------------------
*/
#define CLKGEN_REG_BASE 0xfffece00
#define ARM_CKCTL (CLKGEN_REG_BASE + 0x0)
#define ARM_IDLECT1 (CLKGEN_REG_BASE + 0x4)
#define ARM_IDLECT2 (CLKGEN_REG_BASE + 0x8)
#define ARM_EWUPCT (CLKGEN_REG_BASE + 0xC)
#define ARM_RSTCT1 (CLKGEN_REG_BASE + 0x10)
#define ARM_RSTCT2 (CLKGEN_REG_BASE + 0x14)
#define ARM_SYSST (CLKGEN_REG_BASE + 0x18)
#define ARM_IDLECT3 (CLKGEN_REG_BASE + 0x24)

/* DPLL control registers */
#define DPLL_CTL 0xfffecf00

#endif /* __ASM_ARCH_TCC_HARDWARE_H */
18 changes: 18 additions & 0 deletions arch/arm/plat-tcc/include/mach/memory.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright (C) 1999 ARM Limited
* Copyright (C) 2000 RidgeRun, Inc.
* Copyright (C) 2008-2009 Telechips
* Copyright (C) 2010 Hans J. Koch <hjk@linutronix.de>
*
* Licensed under the terms of the GPL v2.
*/

#ifndef __ASM_ARCH_MEMORY_H
#define __ASM_ARCH_MEMORY_H

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

#endif
31 changes: 31 additions & 0 deletions arch/arm/plat-tcc/include/mach/system.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Author: <linux@telechips.com>
* Created: June 10, 2008
* Description: LINUX SYSTEM FUNCTIONS for TCC83x
*
* Copyright (C) 2008-2009 Telechips
*
* Licensed under the terms of the GPL v2.
*
*/

#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
#include <linux/clk.h>

#include <asm/mach-types.h>
#include <mach/hardware.h>

extern void plat_tcc_reboot(void);

static inline void arch_idle(void)
{
cpu_do_idle();
}

static inline void arch_reset(char mode, const char *cmd)
{
plat_tcc_reboot();
}

#endif
Loading

0 comments on commit 83ef333

Please sign in to comment.