* [PATCH 0/7 v2] Add basic support for Telechips TCC8xxx SoCs
@ 2010-03-25 20:04 Hans J. Koch
2010-03-25 20:07 ` [PATCH 1/7 v2] Introduce plat-tcc Hans J. Koch
` (6 more replies)
0 siblings, 7 replies; 20+ messages in thread
From: Hans J. Koch @ 2010-03-25 20:04 UTC (permalink / raw)
To: linux-arm-kernel
This is v2 of my patch series to introduce basic support for Telechips
TCC8xxx SoCs. It addresses the issues found after v1. They're all in
[PATCH 5/7] (mapping of DTCM and SDRAM). I threw out both mappings.
They've got no users right now, and the datasheet is not very clear
about the DTCM. I need to get more information from Telechips and run
my own tests.
Please review.
Thanks,
Hans
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 1/7 v2] Introduce plat-tcc
2010-03-25 20:04 [PATCH 0/7 v2] Add basic support for Telechips TCC8xxx SoCs Hans J. Koch
@ 2010-03-25 20:07 ` Hans J. Koch
2010-03-25 20:31 ` Russell King - ARM Linux
2010-03-25 20:09 ` [PATCH 2/7 v2] Add clock framework for plat-tcc Hans J. Koch
` (5 subsequent siblings)
6 siblings, 1 reply; 20+ messages in thread
From: Hans J. Koch @ 2010-03-25 20:07 UTC (permalink / raw)
To: linux-arm-kernel
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 2/7 v2] Add clock framework for plat-tcc
2010-03-25 20:04 [PATCH 0/7 v2] Add basic support for Telechips TCC8xxx SoCs Hans J. Koch
2010-03-25 20:07 ` [PATCH 1/7 v2] Introduce plat-tcc Hans J. Koch
@ 2010-03-25 20:09 ` Hans J. Koch
2010-03-25 20:32 ` Russell King - ARM Linux
2010-03-25 20:10 ` [PATCH 3/7 v2] Introduce plat-tcc irq framework Hans J. Koch
` (4 subsequent siblings)
6 siblings, 1 reply; 20+ messages in thread
From: Hans J. Koch @ 2010-03-25 20:09 UTC (permalink / raw)
To: linux-arm-kernel
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 3/7 v2] Introduce plat-tcc irq framework
2010-03-25 20:04 [PATCH 0/7 v2] Add basic support for Telechips TCC8xxx SoCs Hans J. Koch
2010-03-25 20:07 ` [PATCH 1/7 v2] Introduce plat-tcc Hans J. Koch
2010-03-25 20:09 ` [PATCH 2/7 v2] Add clock framework for plat-tcc Hans J. Koch
@ 2010-03-25 20:10 ` Hans J. Koch
2010-03-25 20:33 ` Russell King - ARM Linux
2010-03-25 20:12 ` [PATCH 4/7 v2] Add TCC8xxx system timer Hans J. Koch
` (3 subsequent siblings)
6 siblings, 1 reply; 20+ messages in thread
From: Hans J. Koch @ 2010-03-25 20:10 UTC (permalink / raw)
To: linux-arm-kernel
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 4/7 v2] Add TCC8xxx system timer
2010-03-25 20:04 [PATCH 0/7 v2] Add basic support for Telechips TCC8xxx SoCs Hans J. Koch
` (2 preceding siblings ...)
2010-03-25 20:10 ` [PATCH 3/7 v2] Introduce plat-tcc irq framework Hans J. Koch
@ 2010-03-25 20:12 ` Hans J. Koch
2010-03-25 20:35 ` Russell King - ARM Linux
2010-03-25 20:15 ` [PATCH 5/7 v2] Basic IO mappings for mach-tcc8k Hans J. Koch
` (2 subsequent siblings)
6 siblings, 1 reply; 20+ messages in thread
From: Hans J. Koch @ 2010-03-25 20:12 UTC (permalink / raw)
To: linux-arm-kernel
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 5/7 v2] Basic IO mappings for mach-tcc8k
2010-03-25 20:04 [PATCH 0/7 v2] Add basic support for Telechips TCC8xxx SoCs Hans J. Koch
` (3 preceding siblings ...)
2010-03-25 20:12 ` [PATCH 4/7 v2] Add TCC8xxx system timer Hans J. Koch
@ 2010-03-25 20:15 ` Hans J. Koch
2010-03-25 20:37 ` Russell King - ARM Linux
2010-03-25 20:16 ` [PATCH 6/7 v2] Add common platform devices for TCC8xxx SoCs Hans J. Koch
2010-03-25 20:18 ` [PATCH 7/7 v2] Add board support for Telechips TCC8000-SDK board Hans J. Koch
6 siblings, 1 reply; 20+ messages in thread
From: Hans J. Koch @ 2010-03-25 20:15 UTC (permalink / raw)
To: linux-arm-kernel
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 6/7 v2] Add common platform devices for TCC8xxx SoCs
2010-03-25 20:04 [PATCH 0/7 v2] Add basic support for Telechips TCC8xxx SoCs Hans J. Koch
` (4 preceding siblings ...)
2010-03-25 20:15 ` [PATCH 5/7 v2] Basic IO mappings for mach-tcc8k Hans J. Koch
@ 2010-03-25 20:16 ` Hans J. Koch
2010-03-25 20:38 ` Russell King - ARM Linux
2010-03-25 20:18 ` [PATCH 7/7 v2] Add board support for Telechips TCC8000-SDK board Hans J. Koch
6 siblings, 1 reply; 20+ messages in thread
From: Hans J. Koch @ 2010-03-25 20:16 UTC (permalink / raw)
To: linux-arm-kernel
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 7/7 v2] Add board support for Telechips TCC8000-SDK board
2010-03-25 20:04 [PATCH 0/7 v2] Add basic support for Telechips TCC8xxx SoCs Hans J. Koch
` (5 preceding siblings ...)
2010-03-25 20:16 ` [PATCH 6/7 v2] Add common platform devices for TCC8xxx SoCs Hans J. Koch
@ 2010-03-25 20:18 ` Hans J. Koch
6 siblings, 0 replies; 20+ messages in thread
From: Hans J. Koch @ 2010-03-25 20:18 UTC (permalink / raw)
To: linux-arm-kernel
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 1/7 v2] Introduce plat-tcc
2010-03-25 20:07 ` [PATCH 1/7 v2] Introduce plat-tcc Hans J. Koch
@ 2010-03-25 20:31 ` Russell King - ARM Linux
2010-03-27 16:02 ` Hans J. Koch
0 siblings, 1 reply; 20+ messages in thread
From: Russell King - ARM Linux @ 2010-03-25 20:31 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Mar 25, 2010 at 09:07:48PM +0100, Hans J. Koch wrote:
> +#define __virt_to_bus(x) __virt_to_phys(x)
> +#define __bus_to_virt(x) __phys_to_virt(x)
> +#define __pfn_to_bus(x) __pfn_to_phys(x)
> +#define __bus_to_pfn(x) __phys_to_pfn(x)
You don't need to define any of these.
> diff --git a/arch/arm/plat-tcc/include/mach/vmalloc.h b/arch/arm/plat-tcc/include/mach/vmalloc.h
> new file mode 100644
> index 0000000..9635303
> --- /dev/null
> +++ b/arch/arm/plat-tcc/include/mach/vmalloc.h
> @@ -0,0 +1,11 @@
> +/*
> + * Author: <linux@telechips.com>
> + * 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 (PAGE_OFFSET + 0x10000000)
Base address of IO rather than something dependent on PAGE_OFFSET?
> +
> diff --git a/arch/arm/plat-tcc/system.c b/arch/arm/plat-tcc/system.c
> new file mode 100644
> index 0000000..1a33ced
> --- /dev/null
> +++ b/arch/arm/plat-tcc/system.c
> @@ -0,0 +1,24 @@
> +/*
> + * System functions for Telechips TCCxxxx SoCs
> + *
> + * Copyright (C) Hans J. Koch <hjk@linutronix.de>
> + *
> + * Licensed under the terms of the GPL v2.
> + *
> + */
> +
> +#include <asm/io.h>
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();
> +}
> +
> --
> 1.6.3.3
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 2/7 v2] Add clock framework for plat-tcc
2010-03-25 20:09 ` [PATCH 2/7 v2] Add clock framework for plat-tcc Hans J. Koch
@ 2010-03-25 20:32 ` Russell King - ARM Linux
2010-03-27 16:20 ` Hans J. Koch
0 siblings, 1 reply; 20+ messages in thread
From: Russell King - ARM Linux @ 2010-03-25 20:32 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Mar 25, 2010 at 09:09:16PM +0100, Hans J. Koch wrote:
> +#define BCLKCTR0 (void __iomem *)(CKC_BASE + BCLKCTR0_OFFS)
> +#define BCLKCTR1 (void __iomem *)(CKC_BASE + BCLKCTR1_OFFS)
If you define CKC_BASE to have type 'void __iomem *' then all these
cases go away.
> + reg = __raw_readl(CKC_BASE + CLKCTRL_OFFS);
And this won't warn in the future.
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 3/7 v2] Introduce plat-tcc irq framework
2010-03-25 20:10 ` [PATCH 3/7 v2] Introduce plat-tcc irq framework Hans J. Koch
@ 2010-03-25 20:33 ` Russell King - ARM Linux
2010-03-27 16:33 ` Hans J. Koch
0 siblings, 1 reply; 20+ messages in thread
From: Russell King - ARM Linux @ 2010-03-25 20:33 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Mar 25, 2010 at 09:10:58PM +0100, Hans J. Koch wrote:
> +#include <linux/init.h>
> +#include <linux/module.h>
> +#include <linux/sched.h>
> +#include <linux/interrupt.h>
> +#include <linux/ptrace.h>
> +
> +#include <asm/irq.h>
> +#include <asm/mach/irq.h>
> +#include <asm/io.h>
linux/io.h
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 4/7 v2] Add TCC8xxx system timer
2010-03-25 20:12 ` [PATCH 4/7 v2] Add TCC8xxx system timer Hans J. Koch
@ 2010-03-25 20:35 ` Russell King - ARM Linux
2010-03-27 16:49 ` Hans J. Koch
0 siblings, 1 reply; 20+ messages in thread
From: Russell King - ARM Linux @ 2010-03-25 20:35 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Mar 25, 2010 at 09:12:48PM +0100, Hans J. Koch wrote:
> diff --git a/arch/arm/mach-tcc8k/time.c b/arch/arm/mach-tcc8k/time.c
> new file mode 100644
> index 0000000..db0a6da
> --- /dev/null
> +++ b/arch/arm/mach-tcc8k/time.c
> @@ -0,0 +1,150 @@
> +/*
> + * TCC8000 system timer setup
> + *
> + * (C) 2009 Hans J. Koch <hjk@linutronix.de>
> + *
> + * Licensed under the terms of the GPL version 2.
> + *
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/init.h>
> +#include <linux/interrupt.h>
> +#include <linux/spinlock.h>
> +#include <linux/irq.h>
> +#include <linux/clk.h>
> +#include <linux/clockchips.h>
> +
> +#include <asm/io.h>
linux/io.h
> +#include <asm/mach/time.h>
> +
> +#include <mach/tcc8k-regs.h>
> +#include <mach/irqs.h>
> +
> +static void __iomem *timer_base;
> +static struct clock_event_device clockevent_tcc;
You don't need this.
> +static enum clock_event_mode clockevent_mode = CLOCK_EVT_MODE_UNUSED;
Do you need to keep this state around?
> +
> +static cycle_t tcc_get_cycles(struct clocksource *cs)
> +{
> + return __raw_readl(timer_base + TC32MCNT_OFFS);
> +}
> +
> +static struct clocksource clocksource_tcc = {
> + .name = "tcc_tc32",
> + .rating = 200,
> + .read = tcc_get_cycles,
> + .mask = CLOCKSOURCE_MASK(32),
> + .shift = 28,
> + .flags = CLOCK_SOURCE_IS_CONTINUOUS,
> +};
> +
> +static int tcc_set_next_event(unsigned long evt,
> + struct clock_event_device *unused)
> +{
> + unsigned long reg = __raw_readl(timer_base + TC32MCNT_OFFS);
> +
> + __raw_writel(reg + evt, timer_base + TC32CMP0_OFFS);
> + return 0;
> +}
> +
> +static void tcc_set_mode(enum clock_event_mode mode,
> + struct clock_event_device *evt)
> +{
> + unsigned long tc32irq;
> +
> + clockevent_mode = mode;
> +
> + switch (mode) {
> + case CLOCK_EVT_MODE_ONESHOT:
> + tc32irq = __raw_readl(timer_base + TC32IRQ_OFFS);
> + tc32irq |= TC32IRQ_IRQEN0;
> + __raw_writel(tc32irq, timer_base + TC32IRQ_OFFS);
> + break;
> + case CLOCK_EVT_MODE_SHUTDOWN:
> + case CLOCK_EVT_MODE_UNUSED:
> + tc32irq = __raw_readl(timer_base + TC32IRQ_OFFS);
> + tc32irq &= ~TC32IRQ_IRQEN0;
> + __raw_writel(tc32irq, timer_base + TC32IRQ_OFFS);
> + break;
> + case CLOCK_EVT_MODE_PERIODIC:
> + case CLOCK_EVT_MODE_RESUME:
> + break;
> + }
> +}
> +
> +static irqreturn_t tcc8k_timer_interrupt(int irq, void *dev_id)
> +{
> + struct clock_event_device *evt = &clockevent_tcc;
Change this to:
struct clock_event_device *evt = dev_id;
> +
> + /* Acknowledge TC32 interrupt by reading TC32IRQ */
> + __raw_readl(timer_base + TC32IRQ_OFFS);
> +
> + evt->event_handler(evt);
> +
> + return IRQ_HANDLED;
> +}
> +
> +static struct irqaction tcc8k_timer_irq = {
> + .name = "TC32_timer",
> + .flags = IRQF_DISABLED | IRQF_TIMER,
> + .handler = tcc8k_timer_interrupt,
> +};
> +
> +static struct clock_event_device clockevent_tcc = {
> + .name = "tcc_timer1",
> + .features = CLOCK_EVT_FEAT_ONESHOT,
> + .shift = 32,
> + .set_mode = tcc_set_mode,
> + .set_next_event = tcc_set_next_event,
> + .rating = 200,
> +};
And add:
static struct irqaction tcc8k_timer_irq = {
.name = "TC32_timer",
.flags = IRQF_DISABLED | IRQF_TIMER,
.handler = tcc8k_timer_interrupt,
+ .dev_id = &clockevent_tcc,
};
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 5/7 v2] Basic IO mappings for mach-tcc8k
2010-03-25 20:15 ` [PATCH 5/7 v2] Basic IO mappings for mach-tcc8k Hans J. Koch
@ 2010-03-25 20:37 ` Russell King - ARM Linux
2010-03-27 17:08 ` Hans J. Koch
0 siblings, 1 reply; 20+ messages in thread
From: Russell King - ARM Linux @ 2010-03-25 20:37 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Mar 25, 2010 at 09:15:09PM +0100, Hans J. Koch wrote:
> +#include <linux/kernel.h>
> +#include <linux/init.h>
> +
> +#include <asm/tlb.h>
You don't need asm/tlb.h in this file.
> +#include <asm/mach/map.h>
> +#include <asm/io.h>
linux/io.h
> +
> +#include <mach/tcc8k-regs.h>
> +
> +/*
> + * The machine specific code may provide the extra mapping besides the
> + * default mapping provided here.
> + */
> +static struct map_desc tcc8k_io_desc[] __initdata = {
> + {
> + .virtual = CS1_BASE_VIRT, /* CS1 (CS8900) */
> + .pfn = __phys_to_pfn(CS1_BASE),
> + .length = CS1_SIZE,
> + .type = MT_DEVICE
> + },
> + {
}, {
is more conventional and avoids using up valuable vertical screen
realestate.
> + .virtual = AHB_PERI_BASE_VIRT, /* AHB peripherals */
> + .pfn = __phys_to_pfn(AHB_PERI_BASE),
> + .length = AHB_PERI_SIZE,
> + .type = MT_DEVICE
> + },
> + {
> + .virtual = APB0_PERI_BASE_VIRT, /* APB peripherals */
> + .pfn = __phys_to_pfn(APB0_PERI_BASE),
> + .length = APB0_PERI_SIZE,
> + .type = MT_DEVICE
> + },
> + {
> + .virtual = APB1_PERI_BASE_VIRT, /* APB peripherals */
> + .pfn = __phys_to_pfn(APB1_PERI_BASE),
> + .length = APB1_PERI_SIZE,
> + .type = MT_DEVICE
> + },
> + {
> + .virtual = EXT_MEM_CTRL_BASE_VIRT, /* Ext. mem.contr. */
> + .pfn = __phys_to_pfn(EXT_MEM_CTRL_BASE),
> + .length = EXT_MEM_CTRL_SIZE,
> + .type = MT_DEVICE
> + },
> +};
> +
> +/*
> + * Maps common IO regions for tcc8k.
> + *
> + */
> +void __init tcc8k_map_common_io(void)
> +{
> + iotable_init(tcc8k_io_desc, ARRAY_SIZE(tcc8k_io_desc));
> +}
> +
> diff --git a/arch/arm/plat-tcc/include/mach/io.h b/arch/arm/plat-tcc/include/mach/io.h
> new file mode 100644
> index 0000000..7d84370
> --- /dev/null
> +++ b/arch/arm/plat-tcc/include/mach/io.h
> @@ -0,0 +1,53 @@
> +/*
> + * Based on: linux/include/asm-arm/arch-sa1100/io.h
> + * Author : <linux@telechips.com>
> + * Created: June 10, 2008
> + * Description: IO definitions for TCC8300 processors and boards
> + *
> + * Copyright (C) 1997-1999 Russell King
> + * Copyright (C) 2008-2009 Telechips
> + *
> + * Modifications for mainline (C) 2009 Hans J. Koch <hjk@linutronix.de>
> + *
> + * 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) ((void __iomem *)(PCIO_BASE + (a)))
#define __io(a) __typesafe_io(a)
please.
> +#define __mem_pci(a) (a)
> +
> +/*
> + * ----------------------------------------------------------------------------
> + * I/O mapping
> + * ----------------------------------------------------------------------------
> + */
> +
> +#define PCIO_BASE 0
> +
> +/* Address Map of Internal Peripherials (Base 0x80000000) */
> +#define IO_PHYS_A 0x80000000
> +#define IO_OFFSET_A 0x70000000 /* Virtual IO = 0xF0000000 */
> +#define IO_SIZE_A 0x100000
> +#define IO_VIRT_A (IO_PHYS + IO_OFFSET)
> +#define IO_ADDRESS_A(pa) ((pa) + IO_OFFSET)
> +#define IO_P2V_A(pa) ((pa) + IO_OFFSET)
> +#define IO_V2P_A(va) ((va) - IO_OFFSET)
Where is IO_OFFSET defined?
> +
> +/* Address Map of Internal Peripherials (Base 0x90000000) */
> +#define IO_PHYS_B 0x90000000
> +#define IO_OFFSET_B 0x61000000 /* Virtual IO = 0xF1000000 */
> +#define IO_SIZE_B 0x100000
> +#define IO_VIRT_B (IO_PHYS + IO_OFFSET)
> +#define IO_ADDRESS_B(pa) ((pa) + IO_OFFSET)
> +#define IO_P2V_B(pa) ((pa) + IO_OFFSET)
> +#define IO_V2P_B(va) ((va) - IO_OFFSET)
Ditto. Would also be useful if they were typesafe.
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 6/7 v2] Add common platform devices for TCC8xxx SoCs
2010-03-25 20:16 ` [PATCH 6/7 v2] Add common platform devices for TCC8xxx SoCs Hans J. Koch
@ 2010-03-25 20:38 ` Russell King - ARM Linux
2010-03-27 17:41 ` Hans J. Koch
0 siblings, 1 reply; 20+ messages in thread
From: Russell King - ARM Linux @ 2010-03-25 20:38 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Mar 25, 2010 at 09:16:50PM +0100, Hans J. Koch wrote:
> +#include <linux/init.h>
> +#include <linux/dma-mapping.h>
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/platform_device.h>
> +
> +#include <asm/io.h>
linux/io.h
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 1/7 v2] Introduce plat-tcc
2010-03-25 20:31 ` Russell King - ARM Linux
@ 2010-03-27 16:02 ` Hans J. Koch
0 siblings, 0 replies; 20+ messages in thread
From: Hans J. Koch @ 2010-03-27 16:02 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Mar 25, 2010 at 08:31:07PM +0000, Russell King - ARM Linux wrote:
> On Thu, Mar 25, 2010 at 09:07:48PM +0100, Hans J. Koch wrote:
> > +#define __virt_to_bus(x) __virt_to_phys(x)
> > +#define __bus_to_virt(x) __phys_to_virt(x)
> > +#define __pfn_to_bus(x) __pfn_to_phys(x)
> > +#define __bus_to_pfn(x) __phys_to_pfn(x)
>
> You don't need to define any of these.
Right. Removed.
>
> > diff --git a/arch/arm/plat-tcc/include/mach/vmalloc.h b/arch/arm/plat-tcc/include/mach/vmalloc.h
> > new file mode 100644
> > index 0000000..9635303
> > --- /dev/null
> > +++ b/arch/arm/plat-tcc/include/mach/vmalloc.h
> > @@ -0,0 +1,11 @@
> > +/*
> > + * Author: <linux@telechips.com>
> > + * 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 (PAGE_OFFSET + 0x10000000)
>
> Base address of IO rather than something dependent on PAGE_OFFSET?
Fixed.
>
> > +
> > diff --git a/arch/arm/plat-tcc/system.c b/arch/arm/plat-tcc/system.c
> > new file mode 100644
> > index 0000000..1a33ced
> > --- /dev/null
> > +++ b/arch/arm/plat-tcc/system.c
> > @@ -0,0 +1,24 @@
> > +/*
> > + * System functions for Telechips TCCxxxx SoCs
> > + *
> > + * Copyright (C) Hans J. Koch <hjk@linutronix.de>
> > + *
> > + * Licensed under the terms of the GPL v2.
> > + *
> > + */
> > +
> > +#include <asm/io.h>
>
> linux/io.h ?
OK.
Thanks,
Hans
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 2/7 v2] Add clock framework for plat-tcc
2010-03-25 20:32 ` Russell King - ARM Linux
@ 2010-03-27 16:20 ` Hans J. Koch
0 siblings, 0 replies; 20+ messages in thread
From: Hans J. Koch @ 2010-03-27 16:20 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Mar 25, 2010 at 08:32:42PM +0000, Russell King - ARM Linux wrote:
> On Thu, Mar 25, 2010 at 09:09:16PM +0100, Hans J. Koch wrote:
> > +#define BCLKCTR0 (void __iomem *)(CKC_BASE + BCLKCTR0_OFFS)
> > +#define BCLKCTR1 (void __iomem *)(CKC_BASE + BCLKCTR1_OFFS)
>
> If you define CKC_BASE to have type 'void __iomem *' then all these
> cases go away.
Done.
>
> > + reg = __raw_readl(CKC_BASE + CLKCTRL_OFFS);
>
> And this won't warn in the future.
Right :)
Thanks,
Hans
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 3/7 v2] Introduce plat-tcc irq framework
2010-03-25 20:33 ` Russell King - ARM Linux
@ 2010-03-27 16:33 ` Hans J. Koch
0 siblings, 0 replies; 20+ messages in thread
From: Hans J. Koch @ 2010-03-27 16:33 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Mar 25, 2010 at 08:33:07PM +0000, Russell King - ARM Linux wrote:
> On Thu, Mar 25, 2010 at 09:10:58PM +0100, Hans J. Koch wrote:
> > +#include <linux/init.h>
> > +#include <linux/module.h>
> > +#include <linux/sched.h>
> > +#include <linux/interrupt.h>
> > +#include <linux/ptrace.h>
> > +
> > +#include <asm/irq.h>
> > +#include <asm/mach/irq.h>
> > +#include <asm/io.h>
>
> linux/io.h
Yep, and <linux/sched.h>, <linux/interrupt.h>, and <linux/ptrace.h> are not
needed at all. Fixed.
Thanks,
Hans
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 4/7 v2] Add TCC8xxx system timer
2010-03-25 20:35 ` Russell King - ARM Linux
@ 2010-03-27 16:49 ` Hans J. Koch
0 siblings, 0 replies; 20+ messages in thread
From: Hans J. Koch @ 2010-03-27 16:49 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Mar 25, 2010 at 08:35:15PM +0000, Russell King - ARM Linux wrote:
> On Thu, Mar 25, 2010 at 09:12:48PM +0100, Hans J. Koch wrote:
> > diff --git a/arch/arm/mach-tcc8k/time.c b/arch/arm/mach-tcc8k/time.c
> > new file mode 100644
> > index 0000000..db0a6da
> > --- /dev/null
> > +++ b/arch/arm/mach-tcc8k/time.c
> > @@ -0,0 +1,150 @@
> > +/*
> > + * TCC8000 system timer setup
> > + *
> > + * (C) 2009 Hans J. Koch <hjk@linutronix.de>
> > + *
> > + * Licensed under the terms of the GPL version 2.
> > + *
> > + */
> > +
> > +#include <linux/kernel.h>
> > +#include <linux/init.h>
> > +#include <linux/interrupt.h>
> > +#include <linux/spinlock.h>
> > +#include <linux/irq.h>
> > +#include <linux/clk.h>
> > +#include <linux/clockchips.h>
> > +
> > +#include <asm/io.h>
>
> linux/io.h
OK.
>
> > +#include <asm/mach/time.h>
> > +
> > +#include <mach/tcc8k-regs.h>
> > +#include <mach/irqs.h>
> > +
> > +static void __iomem *timer_base;
> > +static struct clock_event_device clockevent_tcc;
>
> You don't need this.
OK.
>
> > +static enum clock_event_mode clockevent_mode = CLOCK_EVT_MODE_UNUSED;
>
> Do you need to keep this state around?
Not really. Removed.
>
> > +
> > +static cycle_t tcc_get_cycles(struct clocksource *cs)
> > +{
> > + return __raw_readl(timer_base + TC32MCNT_OFFS);
> > +}
> > +
> > +static struct clocksource clocksource_tcc = {
> > + .name = "tcc_tc32",
> > + .rating = 200,
> > + .read = tcc_get_cycles,
> > + .mask = CLOCKSOURCE_MASK(32),
> > + .shift = 28,
> > + .flags = CLOCK_SOURCE_IS_CONTINUOUS,
> > +};
> > +
> > +static int tcc_set_next_event(unsigned long evt,
> > + struct clock_event_device *unused)
> > +{
> > + unsigned long reg = __raw_readl(timer_base + TC32MCNT_OFFS);
> > +
> > + __raw_writel(reg + evt, timer_base + TC32CMP0_OFFS);
> > + return 0;
> > +}
> > +
> > +static void tcc_set_mode(enum clock_event_mode mode,
> > + struct clock_event_device *evt)
> > +{
> > + unsigned long tc32irq;
> > +
> > + clockevent_mode = mode;
> > +
> > + switch (mode) {
> > + case CLOCK_EVT_MODE_ONESHOT:
> > + tc32irq = __raw_readl(timer_base + TC32IRQ_OFFS);
> > + tc32irq |= TC32IRQ_IRQEN0;
> > + __raw_writel(tc32irq, timer_base + TC32IRQ_OFFS);
> > + break;
> > + case CLOCK_EVT_MODE_SHUTDOWN:
> > + case CLOCK_EVT_MODE_UNUSED:
> > + tc32irq = __raw_readl(timer_base + TC32IRQ_OFFS);
> > + tc32irq &= ~TC32IRQ_IRQEN0;
> > + __raw_writel(tc32irq, timer_base + TC32IRQ_OFFS);
> > + break;
> > + case CLOCK_EVT_MODE_PERIODIC:
> > + case CLOCK_EVT_MODE_RESUME:
> > + break;
> > + }
> > +}
> > +
> > +static irqreturn_t tcc8k_timer_interrupt(int irq, void *dev_id)
> > +{
> > + struct clock_event_device *evt = &clockevent_tcc;
>
> Change this to:
> struct clock_event_device *evt = dev_id;
Done.
>
> > +
> > + /* Acknowledge TC32 interrupt by reading TC32IRQ */
> > + __raw_readl(timer_base + TC32IRQ_OFFS);
> > +
> > + evt->event_handler(evt);
> > +
> > + return IRQ_HANDLED;
> > +}
> > +
> > +static struct irqaction tcc8k_timer_irq = {
> > + .name = "TC32_timer",
> > + .flags = IRQF_DISABLED | IRQF_TIMER,
> > + .handler = tcc8k_timer_interrupt,
> > +};
> > +
> > +static struct clock_event_device clockevent_tcc = {
> > + .name = "tcc_timer1",
> > + .features = CLOCK_EVT_FEAT_ONESHOT,
> > + .shift = 32,
> > + .set_mode = tcc_set_mode,
> > + .set_next_event = tcc_set_next_event,
> > + .rating = 200,
> > +};
>
> And add:
> static struct irqaction tcc8k_timer_irq = {
> .name = "TC32_timer",
> .flags = IRQF_DISABLED | IRQF_TIMER,
> .handler = tcc8k_timer_interrupt,
> + .dev_id = &clockevent_tcc,
> };
OK, done.
Thanks,
Hans
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 5/7 v2] Basic IO mappings for mach-tcc8k
2010-03-25 20:37 ` Russell King - ARM Linux
@ 2010-03-27 17:08 ` Hans J. Koch
0 siblings, 0 replies; 20+ messages in thread
From: Hans J. Koch @ 2010-03-27 17:08 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Mar 25, 2010 at 08:37:58PM +0000, Russell King - ARM Linux wrote:
> On Thu, Mar 25, 2010 at 09:15:09PM +0100, Hans J. Koch wrote:
> > +#include <linux/kernel.h>
> > +#include <linux/init.h>
> > +
> > +#include <asm/tlb.h>
>
> You don't need asm/tlb.h in this file.
Removed.
>
> > +#include <asm/mach/map.h>
> > +#include <asm/io.h>
>
> linux/io.h
OK.
>
> > +
> > +#include <mach/tcc8k-regs.h>
> > +
> > +/*
> > + * The machine specific code may provide the extra mapping besides the
> > + * default mapping provided here.
> > + */
> > +static struct map_desc tcc8k_io_desc[] __initdata = {
> > + {
> > + .virtual = CS1_BASE_VIRT, /* CS1 (CS8900) */
> > + .pfn = __phys_to_pfn(CS1_BASE),
> > + .length = CS1_SIZE,
> > + .type = MT_DEVICE
> > + },
> > + {
>
> }, {
>
> is more conventional and avoids using up valuable vertical screen
> realestate.
Right, fixed.
>
> > + .virtual = AHB_PERI_BASE_VIRT, /* AHB peripherals */
> > + .pfn = __phys_to_pfn(AHB_PERI_BASE),
> > + .length = AHB_PERI_SIZE,
> > + .type = MT_DEVICE
> > + },
> > + {
> > + .virtual = APB0_PERI_BASE_VIRT, /* APB peripherals */
> > + .pfn = __phys_to_pfn(APB0_PERI_BASE),
> > + .length = APB0_PERI_SIZE,
> > + .type = MT_DEVICE
> > + },
> > + {
> > + .virtual = APB1_PERI_BASE_VIRT, /* APB peripherals */
> > + .pfn = __phys_to_pfn(APB1_PERI_BASE),
> > + .length = APB1_PERI_SIZE,
> > + .type = MT_DEVICE
> > + },
> > + {
> > + .virtual = EXT_MEM_CTRL_BASE_VIRT, /* Ext. mem.contr. */
> > + .pfn = __phys_to_pfn(EXT_MEM_CTRL_BASE),
> > + .length = EXT_MEM_CTRL_SIZE,
> > + .type = MT_DEVICE
> > + },
> > +};
> > +
> > +/*
> > + * Maps common IO regions for tcc8k.
> > + *
> > + */
> > +void __init tcc8k_map_common_io(void)
> > +{
> > + iotable_init(tcc8k_io_desc, ARRAY_SIZE(tcc8k_io_desc));
> > +}
> > +
> > diff --git a/arch/arm/plat-tcc/include/mach/io.h b/arch/arm/plat-tcc/include/mach/io.h
> > new file mode 100644
> > index 0000000..7d84370
> > --- /dev/null
> > +++ b/arch/arm/plat-tcc/include/mach/io.h
> > @@ -0,0 +1,53 @@
> > +/*
> > + * Based on: linux/include/asm-arm/arch-sa1100/io.h
> > + * Author : <linux@telechips.com>
> > + * Created: June 10, 2008
> > + * Description: IO definitions for TCC8300 processors and boards
> > + *
> > + * Copyright (C) 1997-1999 Russell King
> > + * Copyright (C) 2008-2009 Telechips
> > + *
> > + * Modifications for mainline (C) 2009 Hans J. Koch <hjk@linutronix.de>
> > + *
> > + * 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) ((void __iomem *)(PCIO_BASE + (a)))
>
> #define __io(a) __typesafe_io(a)
>
> please.
OK.
>
> > +#define __mem_pci(a) (a)
> > +
> > +/*
> > + * ----------------------------------------------------------------------------
> > + * I/O mapping
> > + * ----------------------------------------------------------------------------
> > + */
> > +
> > +#define PCIO_BASE 0
> > +
> > +/* Address Map of Internal Peripherials (Base 0x80000000) */
> > +#define IO_PHYS_A 0x80000000
> > +#define IO_OFFSET_A 0x70000000 /* Virtual IO = 0xF0000000 */
> > +#define IO_SIZE_A 0x100000
> > +#define IO_VIRT_A (IO_PHYS + IO_OFFSET)
> > +#define IO_ADDRESS_A(pa) ((pa) + IO_OFFSET)
> > +#define IO_P2V_A(pa) ((pa) + IO_OFFSET)
> > +#define IO_V2P_A(va) ((va) - IO_OFFSET)
>
> Where is IO_OFFSET defined?
Nowhere. Actually, none of these #define IO_* is needed at all. Removed.
Thanks,
Hans
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 6/7 v2] Add common platform devices for TCC8xxx SoCs
2010-03-25 20:38 ` Russell King - ARM Linux
@ 2010-03-27 17:41 ` Hans J. Koch
0 siblings, 0 replies; 20+ messages in thread
From: Hans J. Koch @ 2010-03-27 17:41 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Mar 25, 2010 at 08:38:45PM +0000, Russell King - ARM Linux wrote:
> On Thu, Mar 25, 2010 at 09:16:50PM +0100, Hans J. Koch wrote:
> > +#include <linux/init.h>
> > +#include <linux/dma-mapping.h>
> > +#include <linux/kernel.h>
> > +#include <linux/module.h>
> > +#include <linux/platform_device.h>
> > +
> > +#include <asm/io.h>
>
> linux/io.h
OK.
Thanks,
Hans
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2010-03-27 17:41 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-25 20:04 [PATCH 0/7 v2] Add basic support for Telechips TCC8xxx SoCs Hans J. Koch
2010-03-25 20:07 ` [PATCH 1/7 v2] Introduce plat-tcc Hans J. Koch
2010-03-25 20:31 ` Russell King - ARM Linux
2010-03-27 16:02 ` Hans J. Koch
2010-03-25 20:09 ` [PATCH 2/7 v2] Add clock framework for plat-tcc Hans J. Koch
2010-03-25 20:32 ` Russell King - ARM Linux
2010-03-27 16:20 ` Hans J. Koch
2010-03-25 20:10 ` [PATCH 3/7 v2] Introduce plat-tcc irq framework Hans J. Koch
2010-03-25 20:33 ` Russell King - ARM Linux
2010-03-27 16:33 ` Hans J. Koch
2010-03-25 20:12 ` [PATCH 4/7 v2] Add TCC8xxx system timer Hans J. Koch
2010-03-25 20:35 ` Russell King - ARM Linux
2010-03-27 16:49 ` Hans J. Koch
2010-03-25 20:15 ` [PATCH 5/7 v2] Basic IO mappings for mach-tcc8k Hans J. Koch
2010-03-25 20:37 ` Russell King - ARM Linux
2010-03-27 17:08 ` Hans J. Koch
2010-03-25 20:16 ` [PATCH 6/7 v2] Add common platform devices for TCC8xxx SoCs Hans J. Koch
2010-03-25 20:38 ` Russell King - ARM Linux
2010-03-27 17:41 ` Hans J. Koch
2010-03-25 20:18 ` [PATCH 7/7 v2] Add board support for Telechips TCC8000-SDK board Hans J. Koch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).