Skip to contentSkip to conversation

Add basic support for Telechips TCC8xxx SoCs

PATCH Superseded Hans J. Koch 2 participants 11 messages Mar 31, 2010 – Apr 16, 2010

Subsystems (2)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v4 cover Add basic support for Telechips TCC8xxx SoCs

I'll reply to this mail with a series of 7 patches that add basic support for Telechips TCC8xxx SoCs. It also adds support for Telechips' TCC8000-SDK board. Drivers for UART, MMC, USB host + gadget, and NAND are also available. I'll post these in a second step.

This is version 4 of this patch series. There were no more issues found in the review of the last version. Anyway, I made the following changes:

- Removed the lines disabled with #if 0 I accidentally had left in the last version.
- Some minor coding style changes to make checkpatch.pl happy.
- One minor change in a commit message.
- Rebased against 2.6.34-rc3.

Russell, I can set up a for-rmk branch in a git repository. Simply tell me to do so if you prefer to pull from git (and you consider the review process finished, of course).

Thanks,
Hans

#1 lore raw

PATCH v4 1/7 Introduce plat-tcc

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.

---
 arch/arm/Kconfig                             |   11 +
 arch/arm/Makefile                            |    2 +
 arch/arm/mach-tcc8k/Kconfig                  |    5 +
 arch/arm/plat-tcc/Kconfig                    |   20 +
 arch/arm/plat-tcc/Makefile                   |    3 +
 arch/arm/plat-tcc/include/mach/debug-macro.S |   33 +
 arch/arm/plat-tcc/include/mach/entry-macro.S |   69 ++
 arch/arm/plat-tcc/include/mach/hardware.h    |   43 ++
 arch/arm/plat-tcc/include/mach/memory.h      |   19 +
 arch/arm/plat-tcc/include/mach/system.h      |   31 +
 arch/arm/plat-tcc/include/mach/tcc8k-regs.h  |  855 ++++++++++++++++++++++++++
 arch/arm/plat-tcc/include/mach/uncompress.h  |   32 +
 arch/arm/plat-tcc/include/mach/vmalloc.h     |   11 +
 arch/arm/plat-tcc/system.c                   |   25 +
 14 files changed, 1159 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-tcc8k/Kconfig
 create mode 100644 arch/arm/plat-tcc/Kconfig
 create mode 100644 arch/arm/plat-tcc/Makefile
 create mode 100644 arch/arm/plat-tcc/include/mach/debug-macro.S
 create mode 100644 arch/arm/plat-tcc/include/mach/entry-macro.S
 create mode 100644 arch/arm/plat-tcc/include/mach/hardware.h
 create mode 100644 arch/arm/plat-tcc/include/mach/memory.h
 create mode 100644 arch/arm/plat-tcc/include/mach/system.h
 create mode 100644 arch/arm/plat-tcc/include/mach/tcc8k-regs.h
 create mode 100644 arch/arm/plat-tcc/include/mach/uncompress.h
 create mode 100644 arch/arm/plat-tcc/include/mach/vmalloc.h
 create mode 100644 arch/arm/plat-tcc/system.c
arch/arm/Kconfig +11 -0
index c5408bf..8b9429c 100644
@@ -723,6 +723,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
@@ -887,6 +896,8 @@ source "arch/arm/plat-s3c24xx/Kconfig"
 source "arch/arm/plat-s5p/Kconfig"
 source "arch/arm/plat-s5pc1xx/Kconfig"
 
+source "arch/arm/plat-tcc/Kconfig"
+
 if ARCH_S3C2410
 source "arch/arm/mach-s3c2400/Kconfig"
 source "arch/arm/mach-s3c2410/Kconfig"
arch/arm/Makefile +2 -0
index ed820e7..9656799 100644
@@ -172,6 +172,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_U300)		:= u300
 machine-$(CONFIG_ARCH_U8500)		:= ux500
 machine-$(CONFIG_ARCH_VERSATILE)	:= versatile
@@ -192,6 +193,7 @@ plat-$(CONFIG_PLAT_PXA)		:= pxa
 plat-$(CONFIG_PLAT_S3C24XX)	:= s3c24xx samsung
 plat-$(CONFIG_PLAT_S5PC1XX)	:= s5pc1xx samsung
 plat-$(CONFIG_PLAT_S5P)		:= s5p samsung
+plat-$(CONFIG_ARCH_TCC_926)	:= tcc
 
 ifeq ($(CONFIG_ARCH_EBSA110),y)
 # This is what happens if you forget the IOCS16 line.
arch/arm/mach-tcc8k/Kconfig new file +5 -0
new file mode 100644
index 0000000..ec7f71b
@@ -0,0 +1,5 @@
+if ARCH_TCC8K
+
+comment "TCC8000 systems:"
+
+endif
arch/arm/plat-tcc/Kconfig new file +20 -0
new file mode 100644
index 0000000..1bf4995
@@ -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
arch/arm/plat-tcc/Makefile new file +3 -0
new file mode 100644
index 0000000..3f2e4fe
@@ -0,0 +1,3 @@
+# "Telechips Platform Common Modules"
+
+obj-y := system.o
arch/arm/plat-tcc/include/mach/debug-macro.S new file +33 -0
new file mode 100644
index 0000000..9753784
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 1994-1999 Russell King
+ * Copyright (C) 2008-2009 Telechips
+ * Copyright (C) 2009 Hans J. Koch <[email protected]>
+ *
+ * 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
arch/arm/plat-tcc/include/mach/entry-macro.S new file +69 -0

69 lines not on this page · raw message

arch/arm/plat-tcc/include/mach/hardware.h new file +43 -0

43 lines not on this page · raw message

arch/arm/plat-tcc/include/mach/memory.h new file +19 -0
new file mode 100644
index 0000000..1c3478d
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 1999 ARM Limited
+ * Copyright (C) 2000 RidgeRun, Inc.
+ * Copyright (C) 2008-2009 Telechips
+ * Copyright (C) 2010 Hans J. Koch <[email protected]>
+ *
+ * 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
+
arch/arm/plat-tcc/include/mach/system.h new file +31 -0
new file mode 100644
index 0000000..909e603
@@ -0,0 +1,31 @@
+/*
+ * Author: <[email protected]>
+ * 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
arch/arm/plat-tcc/include/mach/tcc8k-regs.h new file +855 -0

855 lines not on this page · raw message

arch/arm/plat-tcc/include/mach/uncompress.h new file +32 -0
new file mode 100644
index 0000000..8e0294d
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2009 Hans J. Koch <[email protected]>
+ *
+ * This file is licensed under the terms of the GPL version 2.
+ */
+
+#include <linux/types.h>
+#include <mach/tcc8k-regs.h>
+
+unsigned int system_rev;
+
+#define ID_MASK			0x7fff
+
+static void putc(int c)
+{
+	u32 *uart_lsr = (u32 *)(UART_BASE_PHYS + UART_LSR_OFFS);
+	u32 *uart_thr = (u32 *)(UART_BASE_PHYS + UART_THR_OFFS);
+
+	while (!(*uart_lsr & UART_LSR_THRE))
+		barrier();
+	*uart_thr = c;
+}
+
+static inline void flush(void)
+{
+}
+
+/*
+ * nothing to do
+ */
+#define arch_decomp_setup()
+#define arch_decomp_wdog()
arch/arm/plat-tcc/include/mach/vmalloc.h new file +11 -0
new file mode 100644
index 0000000..7eb4b3d
@@ -0,0 +1,11 @@
+/*
+ * Author: <[email protected]>
+ * Created: June 10, 2008
+ *
+ * Copyright (C) 2000 Russell King.
+ * Copyright (C) 2008-2009 Telechips
+ *
+ * Licensed under the terms of the GPL v2.
+ */
+#define VMALLOC_END	0xf0000000UL
+
arch/arm/plat-tcc/system.c new file +25 -0
new file mode 100644
index 0000000..79b6ecd
@@ -0,0 +1,25 @@
+/*
+ * System functions for Telechips TCCxxxx SoCs
+ *
+ * Copyright (C) Hans J. Koch <[email protected]>
+ *
+ * Licensed under the terms of the GPL v2.
+ *
+ */
+
+#include <linux/io.h>
+
+#include <mach/tcc8k-regs.h>
+
+/* System reboot */
+void plat_tcc_reboot(void)
+{
+	/* Make sure clocks are on */
+	__raw_writel(0xffffffff, CKC_BASE + BCLKCTR0_OFFS);
+
+	/* Enable watchdog reset */
+	__raw_writel(0x49, TIMER_BASE + TWDCFG_OFFS);
+	/* Wait for reset */
+	unreachable();
+}
+
Signature · 1 line
1.6.3.3
#2 lore raw

PATCH v4 2/7 Add the clock framework for Telechips TCC8xxx processors.

In reply to Hans J. Koch

This adds definitions and low-level functions to handle clocks in TCC8xxx processors.

---
 arch/arm/mach-tcc8k/Makefile                |    6 +
 arch/arm/mach-tcc8k/clock.c                 |  592 +++++++++++++++++++++++++++
 arch/arm/plat-tcc/Makefile                  |    2 +-
 arch/arm/plat-tcc/clock.c                   |  170 ++++++++
 arch/arm/plat-tcc/include/mach/clkdev.h     |    7 +
 arch/arm/plat-tcc/include/mach/clock.h      |   48 +++
 arch/arm/plat-tcc/include/mach/tcc8k-regs.h |   17 +-
 7 files changed, 832 insertions(+), 10 deletions(-)
 create mode 100644 arch/arm/mach-tcc8k/Makefile
 create mode 100644 arch/arm/mach-tcc8k/clock.c
 create mode 100644 arch/arm/plat-tcc/clock.c
 create mode 100644 arch/arm/plat-tcc/include/mach/clkdev.h
 create mode 100644 arch/arm/plat-tcc/include/mach/clock.h
arch/arm/mach-tcc8k/Makefile new file +6 -0
new file mode 100644
index 0000000..805d850
@@ -0,0 +1,6 @@
+#
+# Makefile for TCC8K boards and common files.
+#
+
+# Common support
+obj-y += clock.o
arch/arm/mach-tcc8k/clock.c new file +592 -0

592 lines not on this page · raw message

arch/arm/plat-tcc/Makefile +1 -1
index 3f2e4fe..eceabc8 100644
@@ -1,3 +1,3 @@
 # "Telechips Platform Common Modules"
 
-obj-y := system.o
+obj-y := clock.o system.o
arch/arm/plat-tcc/clock.c new file +170 -0

170 lines not on this page · raw message

arch/arm/plat-tcc/include/mach/clkdev.h new file +7 -0
new file mode 100644
index 0000000..04b37a8
@@ -0,0 +1,7 @@
+#ifndef __ASM_MACH_CLKDEV_H
+#define __ASM_MACH_CLKDEV_H
+
+#define __clk_get(clk) ({ 1; })
+#define __clk_put(clk) do { } while (0)
+
+#endif
arch/arm/plat-tcc/include/mach/clock.h new file +48 -0

48 lines not on this page · raw message

arch/arm/plat-tcc/include/mach/tcc8k-regs.h +8 -9
index 67f866c..4f19283 100644
@@ -30,13 +30,13 @@
 #define EXT_MEM_CTRL_BASE	0xf0000000
 #define EXT_MEM_CTRL_SIZE	SZ_4K
 
-#define CS1_BASE_VIRT		0xf7000000
-#define AHB_PERI_BASE_VIRT	0xf4000000
-#define APB0_PERI_BASE_VIRT	0xf1000000
-#define APB1_PERI_BASE_VIRT	0xf2000000
-#define EXT_MEM_CTRL_BASE_VIRT	0xf3000000
-#define INT_SRAM_BASE_VIRT	0xf5000000
-#define DATA_TCM_BASE_VIRT	0xf6000000
+#define CS1_BASE_VIRT		(void __iomem *)0xf7000000
+#define AHB_PERI_BASE_VIRT	(void __iomem *)0xf4000000
+#define APB0_PERI_BASE_VIRT	(void __iomem *)0xf1000000
+#define APB1_PERI_BASE_VIRT	(void __iomem *)0xf2000000
+#define EXT_MEM_CTRL_BASE_VIRT	(void __iomem *)0xf3000000
+#define INT_SRAM_BASE_VIRT	(void __iomem *)0xf5000000
+#define DATA_TCM_BASE_VIRT	(void __iomem *)0xf6000000
 
 #define __REG(x)     (*((volatile u32 *)(x)))
 
@@ -708,8 +708,7 @@
 #define PMGPIO_APB_OFFS		0x800
 
 /* Clock controller registers */
-#define CKC_BASE		(APB1_PERI_BASE_VIRT + 0x6000)
-#define CKC_BASE_PHYS		(APB1_PERI_BASE + 0x6000)
+#define CKC_BASE	(void __iomem *)(APB1_PERI_BASE_VIRT + 0x6000)
 
 #define CLKCTRL_OFFS		0x00
 #define PLL0CFG_OFFS		0x04
Signature · 1 line
1.6.3.3
#3 lore raw

PATCH v4 2/7 Add the clock framework for Telechips TCC8xxx processors.

Quoted 8 lines · Hans J. Koch
arch/arm/plat-tcc/clock.c new file +8 -0
+static void __clk_disable(struct clk *clk)
+{
+	if (!clk)
+		return;
+
+	BUG_ON(clk->refcount == 0);
+
+	if (!(--clk->refcount) && clk->disable)

arch/arm/plat-tcc/clock.c line 48

Quoted 10 lines
arch/arm/plat-tcc/clock.c new file +10 -0
+		clk->disable(clk);
+	__clk_disable(clk->parent);
+}
+
+static int __clk_enable(struct clk *clk)
+{
+	if (!clk)
+		return -EINVAL;
+
+	__clk_enable(clk->parent);

Here, every enable of the child clock causes the parent to be enabled one more time. This is a bad idea in conjunction with...

Quoted 11 lines
arch/arm/plat-tcc/clock.c new file +10 -0
+
+	if (clk->refcount++ == 0 && clk->enable)
+		clk->enable(clk);
+
+	return 0;
+}
 
+/* Set the clock's parent to another clock source */
+int clk_set_parent(struct clk *clk, struct clk *parent)
+{
+	int ret = -EINVAL;

arch/arm/plat-tcc/clock.c line 154

Quoted 10 lines
arch/arm/plat-tcc/clock.c new file +10 -0
+
+	if (!clk)
+		return ret;
+	if (!clk->set_parent || !parent)
+		return ret;
+
+	mutex_lock(&clocks_mutex);
+	ret = clk->set_parent(clk, parent);
+	if (ret == 0)
+		clk->parent = parent;

... reparenting of clocks.

Reparenting is much easier to deal with if you only enable/disable the parent clock on the first enable and last disable of the child clock. Then you can do:

	if (clk->refcount)
		__clk_enable(parent);
	ret = clk->set_parent(clk, parent);
	if (ret == 0) {
		old = clk->parent;
		clk->parent = parent;
	} else {
		old = parent;
	}
	if (clk->refcount)
		__clk_disable(old);

here, which will keep the refcounts straight.

arch/arm/plat-tcc/clock.c

Quoted 10 lines
arch/arm/plat-tcc/clock.c new file +6 -2
+	mutex_unlock(&clocks_mutex);
+
+	return ret;
+}
+EXPORT_SYMBOL_GPL(clk_set_parent);
 
 /* Clock controller registers */
-#define CKC_BASE		(APB1_PERI_BASE_VIRT + 0x6000)
-#define CKC_BASE_PHYS		(APB1_PERI_BASE + 0x6000)
+#define CKC_BASE	(void __iomem *)(APB1_PERI_BASE_VIRT + 0x6000)

This has the possibility of causing unexpected side effects. With any macro which is more than just a number, it's always worth adding a set of parens around it to ensure that evaluation happens in the order you expect.

#4 lore raw

PATCH v4 2/7 Add the clock framework for Telechips TCC8xxx processors.

Quoted 14 lines · Russell King - ARM Linux
Quoted 13 lines · Hans J. Koch
arch/arm/plat-tcc/clock.c new file +13 -0
+static void __clk_disable(struct clk *clk)
+{
+	if (!clk)
+		return;
+
+	BUG_ON(clk->refcount == 0);
+
+	if (!(--clk->refcount) && clk->disable)
+		clk->disable(clk);
+	__clk_disable(clk->parent);
+}
+
+static int __clk_enable(struct clk *clk)
Quoted 8 lines

arch/arm/plat-tcc/clock.c line 48

Quoted 5 lines
arch/arm/plat-tcc/clock.c new file +5 -0
+{
+	if (!clk)
+		return -EINVAL;
+
+	__clk_enable(clk->parent);

Here, every enable of the child clock causes the parent to be enabled one more time. This is a bad idea in conjunction with...

Something went completely wrong here. These functions should recursively enable/disable the parents when their refcount changes from/to zero. It's mentioned in the comments, but not implemented.

Quoted 41 lines
Quoted 12 lines
arch/arm/plat-tcc/clock.c new file +10 -0
+
+	if (clk->refcount++ == 0 && clk->enable)
+		clk->enable(clk);
+
+	return 0;
+}
 
+/* Set the clock's parent to another clock source */
+int clk_set_parent(struct clk *clk, struct clk *parent)
+{
+	int ret = -EINVAL;

arch/arm/plat-tcc/clock.c line 154

Quoted 10 lines
arch/arm/plat-tcc/clock.c new file +10 -0
+
+	if (!clk)
+		return ret;
+	if (!clk->set_parent || !parent)
+		return ret;
+
+	mutex_lock(&clocks_mutex);
+	ret = clk->set_parent(clk, parent);
+	if (ret == 0)
+		clk->parent = parent;

... reparenting of clocks.

Reparenting is much easier to deal with if you only enable/disable the parent clock on the first enable and last disable of the child clock. Then you can do:

	if (clk->refcount)
		__clk_enable(parent);
	ret = clk->set_parent(clk, parent);
	if (ret == 0) {
		old = clk->parent;
		clk->parent = parent;
	} else {
		old = parent;
	}
	if (clk->refcount)
		__clk_disable(old);
Quoted 1 line

here, which will keep the refcounts straight.

Yep, you're right. With __clk_enable and __clk_disable fixed as mentioned above, it looks a bit different. I hope I got it right this time...

Quoted 7 lines
Quoted 6 lines
arch/arm/plat-tcc/clock.c new file +5 -0
+	mutex_unlock(&clocks_mutex);
+
+	return ret;
+}
+EXPORT_SYMBOL_GPL(clk_set_parent);
Quoted 9 lines

arch/arm/plat-tcc/include/mach/tcc8k-regs.h line 711

Quoted 4 lines

/* Clock controller registers */

arch/arm/plat-tcc/include/mach/tcc8k-regs.h +1 -2
-#define CKC_BASE		(APB1_PERI_BASE_VIRT + 0x6000)
-#define CKC_BASE_PHYS		(APB1_PERI_BASE + 0x6000)
+#define CKC_BASE	(void __iomem *)(APB1_PERI_BASE_VIRT + 0x6000)

This has the possibility of causing unexpected side effects. With any macro which is more than just a number, it's always worth adding a set of parens around it to ensure that evaluation happens in the order you expect.

Fixed.

Thanks a lot for your review. I'll reply to this mail with the fixed version of this patch. If it looks OK to you, I'll rebase the whole series to current mainline (it's still -rc3 now) and submit v5 of the whole lot.

Thanks,
Hans

#5 lore raw

PATCH v4 2/7 Add the clock framework for Telechips TCC8xxx processors.

This adds definitions and low-level functions to handle clocks in TCC8xxx processors.

---
 arch/arm/mach-tcc8k/Makefile                |    6 +
 arch/arm/mach-tcc8k/clock.c                 |  592 +++++++++++++++++++++++++++
 arch/arm/plat-tcc/Makefile                  |    2 +-
 arch/arm/plat-tcc/clock.c                   |  180 ++++++++
 arch/arm/plat-tcc/include/mach/clkdev.h     |    7 +
 arch/arm/plat-tcc/include/mach/clock.h      |   48 +++
 arch/arm/plat-tcc/include/mach/tcc8k-regs.h |   17 +-
 7 files changed, 842 insertions(+), 10 deletions(-)
 create mode 100644 arch/arm/mach-tcc8k/Makefile
 create mode 100644 arch/arm/mach-tcc8k/clock.c
 create mode 100644 arch/arm/plat-tcc/clock.c
 create mode 100644 arch/arm/plat-tcc/include/mach/clkdev.h
 create mode 100644 arch/arm/plat-tcc/include/mach/clock.h
arch/arm/mach-tcc8k/Makefile new file +6 -0
new file mode 100644
index 0000000..805d850
@@ -0,0 +1,6 @@
+#
+# Makefile for TCC8K boards and common files.
+#
+
+# Common support
+obj-y += clock.o
arch/arm/mach-tcc8k/clock.c new file +592 -0

592 lines not on this page · raw message

arch/arm/plat-tcc/Makefile +1 -1
index 3f2e4fe..eceabc8 100644
@@ -1,3 +1,3 @@
 # "Telechips Platform Common Modules"
 
-obj-y := system.o
+obj-y := clock.o system.o
arch/arm/plat-tcc/clock.c new file +180 -0

180 lines not on this page · raw message

arch/arm/plat-tcc/include/mach/clkdev.h new file +7 -0
new file mode 100644
index 0000000..04b37a8
@@ -0,0 +1,7 @@
+#ifndef __ASM_MACH_CLKDEV_H
+#define __ASM_MACH_CLKDEV_H
+
+#define __clk_get(clk) ({ 1; })
+#define __clk_put(clk) do { } while (0)
+
+#endif
arch/arm/plat-tcc/include/mach/clock.h new file +48 -0

48 lines not on this page · raw message

arch/arm/plat-tcc/include/mach/tcc8k-regs.h +8 -9
index 67f866c..9142b44 100644
@@ -30,13 +30,13 @@
 #define EXT_MEM_CTRL_BASE	0xf0000000
 #define EXT_MEM_CTRL_SIZE	SZ_4K
 
-#define CS1_BASE_VIRT		0xf7000000
-#define AHB_PERI_BASE_VIRT	0xf4000000
-#define APB0_PERI_BASE_VIRT	0xf1000000
-#define APB1_PERI_BASE_VIRT	0xf2000000
-#define EXT_MEM_CTRL_BASE_VIRT	0xf3000000
-#define INT_SRAM_BASE_VIRT	0xf5000000
-#define DATA_TCM_BASE_VIRT	0xf6000000
+#define CS1_BASE_VIRT		(void __iomem *)0xf7000000
+#define AHB_PERI_BASE_VIRT	(void __iomem *)0xf4000000
+#define APB0_PERI_BASE_VIRT	(void __iomem *)0xf1000000
+#define APB1_PERI_BASE_VIRT	(void __iomem *)0xf2000000
+#define EXT_MEM_CTRL_BASE_VIRT	(void __iomem *)0xf3000000
+#define INT_SRAM_BASE_VIRT	(void __iomem *)0xf5000000
+#define DATA_TCM_BASE_VIRT	(void __iomem *)0xf6000000
 
 #define __REG(x)     (*((volatile u32 *)(x)))
 
@@ -708,8 +708,7 @@
 #define PMGPIO_APB_OFFS		0x800
 
 /* Clock controller registers */
-#define CKC_BASE		(APB1_PERI_BASE_VIRT + 0x6000)
-#define CKC_BASE_PHYS		(APB1_PERI_BASE + 0x6000)
+#define CKC_BASE	((void __iomem *)(APB1_PERI_BASE_VIRT + 0x6000))
 
 #define CLKCTRL_OFFS		0x00
 #define PLL0CFG_OFFS		0x04
Signature · 1 line
1.6.3.3
#6 lore raw

PATCH v4 3/7 Introduce plat-tcc irq framework

In reply to Hans J. Koch

Introduce lowlevel interrupt routines.

---
 arch/arm/mach-tcc8k/Makefile          |    3 +-
 arch/arm/mach-tcc8k/irq.c             |  110 +++++++++++++++++++++++++++++++++
 arch/arm/plat-tcc/include/mach/irqs.h |   84 +++++++++++++++++++++++++
 3 files changed, 196 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-tcc8k/irq.c
 create mode 100644 arch/arm/plat-tcc/include/mach/irqs.h
arch/arm/mach-tcc8k/Makefile +2 -1
index 805d850..24356e9 100644
@@ -3,4 +3,5 @@
 #
 
 # Common support
-obj-y += clock.o
+obj-y += clock.o irq.o
+
arch/arm/mach-tcc8k/irq.c new file +110 -0

110 lines not on this page · raw message

arch/arm/plat-tcc/include/mach/irqs.h new file +84 -0

84 lines not on this page · raw message

Signature · 1 line
1.6.3.3
#7 lore raw

PATCH v4 4/7 Add TCC8xxx system timer

In reply to Hans J. Koch

Add the system timer using clockevents with the internal TC32 timer. This also adds a clocksource using the same timer.

---
 arch/arm/Kconfig                       |    1 +
 arch/arm/mach-tcc8k/Makefile           |    2 +-
 arch/arm/mach-tcc8k/time.c             |  147 ++++++++++++++++++++++++++++++++
 arch/arm/plat-tcc/include/mach/timex.h |    5 +
 4 files changed, 154 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-tcc8k/time.c
 create mode 100644 arch/arm/plat-tcc/include/mach/timex.h
arch/arm/Kconfig +1 -0
index 8b9429c..7c6e731 100644
@@ -728,6 +728,7 @@ config ARCH_TCC_926
 	select CPU_ARM926T
 	select HAVE_CLK
 	select COMMON_CLKDEV
+	select GENERIC_TIME
 	select GENERIC_CLOCKEVENTS
 	help
 	  Support for Telechips TCC ARM926-based systems.
arch/arm/mach-tcc8k/Makefile +1 -1
index 24356e9..5673868 100644
@@ -3,5 +3,5 @@
 #
 
 # Common support
-obj-y += clock.o irq.o
+obj-y += clock.o irq.o time.o
 
arch/arm/mach-tcc8k/time.c new file +147 -0

147 lines not on this page · raw message

arch/arm/plat-tcc/include/mach/timex.h new file +5 -0
new file mode 100644
index 0000000..057acbe
@@ -0,0 +1,5 @@
+/*
+ * A definition needed by arch core code.
+ *
+ */
+#define CLOCK_TICK_RATE		(HZ * 100000UL)
Signature · 1 line
1.6.3.3
#8 lore raw

PATCH v4 5/7 Basic IO mappings for mach-tcc8k

In reply to Hans J. Koch

Map the IO ranges of TCC8xxx peripherals.

---
 arch/arm/mach-tcc8k/Makefile        |    2 +-
 arch/arm/mach-tcc8k/io.c            |   63 +++++++++++++++++++++++++++++++++++
 arch/arm/plat-tcc/include/mach/io.h |   23 +++++++++++++
 3 files changed, 87 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-tcc8k/io.c
 create mode 100644 arch/arm/plat-tcc/include/mach/io.h
arch/arm/mach-tcc8k/Makefile +1 -1
index 5673868..09552e2 100644
@@ -3,5 +3,5 @@
 #
 
 # Common support
-obj-y += clock.o irq.o time.o
+obj-y += clock.o irq.o time.o io.o
 
arch/arm/mach-tcc8k/io.c new file +63 -0

63 lines not on this page · raw message

arch/arm/plat-tcc/include/mach/io.h new file +23 -0
new file mode 100644
index 0000000..3e911d3
@@ -0,0 +1,23 @@
+/*
+ * IO definitions for TCC8000 processors and boards
+ *
+ * Copyright (C) 1997-1999 Russell King
+ * Copyright (C) 2008-2009 Telechips
+ * Copyright (C) 2010 Hans J. Koch <[email protected]>
+ *
+ * Licensed under the terms of the GNU Public License version 2.
+ */
+
+#ifndef __ASM_ARM_ARCH_IO_H
+#define __ASM_ARM_ARCH_IO_H
+
+#define IO_SPACE_LIMIT 0xffffffff
+
+/*
+ * We don't actually have real ISA nor PCI buses, but there is so many
+ * drivers out there that might just work if we fake them...
+ */
+#define __io(a)			__typesafe_io(a)
+#define __mem_pci(a)		(a)
+
+#endif
Signature · 1 line
1.6.3.3
#9 lore raw

PATCH v4 6/7 Add common platform devices for TCC8xxx SoCs

In reply to Hans J. Koch

This patch introduces a first set of platform devices for integrated peripherals of TCC8xxx processors. Drivers for these devices are available and will be posted in a second step.

---
 arch/arm/mach-tcc8k/Makefile  |    2 +-
 arch/arm/mach-tcc8k/devices.c |  274 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 275 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-tcc8k/devices.c
arch/arm/mach-tcc8k/Makefile +1 -1
index 09552e2..e8a1134 100644
@@ -3,5 +3,5 @@
 #
 
 # Common support
-obj-y += clock.o irq.o time.o io.o
+obj-y += clock.o irq.o time.o io.o devices.o
 
arch/arm/mach-tcc8k/devices.c new file +274 -0

274 lines not on this page · raw message

Signature · 1 line
1.6.3.3
#10 lore raw

PATCH v4 7/7 Add board support for Telechips TCC8000-SDK board

In reply to Hans J. Koch

Add support for the Telechips TCC8000-SDK development board.

---
 arch/arm/mach-tcc8k/Kconfig             |    6 +++
 arch/arm/mach-tcc8k/Makefile            |    3 ++
 arch/arm/mach-tcc8k/Makefile.boot       |    3 ++
 arch/arm/mach-tcc8k/board-tcc8000-sdk.c |   59 +++++++++++++++++++++++++++++++
 arch/arm/mach-tcc8k/board-tcc8000-sdk.h |   18 +++++++++
 5 files changed, 89 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-tcc8k/Makefile.boot
 create mode 100644 arch/arm/mach-tcc8k/board-tcc8000-sdk.c
 create mode 100644 arch/arm/mach-tcc8k/board-tcc8000-sdk.h
arch/arm/mach-tcc8k/Kconfig +6 -0
index ec7f71b..ad86415 100644
@@ -2,4 +2,10 @@ if ARCH_TCC8K
 
 comment "TCC8000 systems:"
 
+config MACH_TCC8000_SDK
+	bool "Telechips TCC8000-SDK development kit"
+	default y
+	help
+	  Support for the Telechips TCC8000-SDK board.
+
 endif
arch/arm/mach-tcc8k/Makefile +3 -0
index e8a1134..cd92cde 100644
@@ -5,3 +5,6 @@
 # Common support
 obj-y += clock.o irq.o time.o io.o devices.o
 
+# Specific board support
+obj-$(CONFIG_MACH_TCC8000_SDK) += board-tcc8000-sdk.o
+
arch/arm/mach-tcc8k/Makefile.boot new file +3 -0
new file mode 100644
index 0000000..f135c9d
@@ -0,0 +1,3 @@
+   zreladdr-y		:= 0x20008000
+params_phys-y		:= 0x20000100
+initrd_phys-y		:= 0x20800000
arch/arm/mach-tcc8k/board-tcc8000-sdk.c new file +59 -0

59 lines not on this page · raw message

arch/arm/mach-tcc8k/board-tcc8000-sdk.h new file +18 -0
new file mode 100644
index 0000000..1d4e791
@@ -0,0 +1,18 @@
+/*
+ * Some defines for arch/arm/mach-tcc8k/board-tcc8000-sdk.c
+ *
+ */
+
+#ifndef _BOARD_TCC_8000_SDK_H_
+#define _BOARD_TCC_8000_SDK_H_
+
+extern void __init tcc8k_init_irq(void);
+extern void __init tcc8k_map_common_io(void);
+extern int __init tcc_clocks_init(unsigned long xi_freq,
+					unsigned long xti_freq);
+extern struct platform_device tcc_nand_device;
+
+#define XI_FREQUENCY	12000000
+#define XTI_FREQUENCY	32768
+
+#endif
Signature · 1 line
1.6.3.3