From d2c241955095b129459985a8c02d85b70984b945 Mon Sep 17 00:00:00 2001 From: wanzongshun Date: Tue, 14 Jul 2009 15:09:54 +0100 Subject: [ARM] 5601/1: Add HAVE_CLK depends on for w90p910 platform Add HAVE_CLK depends on for w90p910 platform. Signed-off-by: Wan ZongShun Signed-off-by: Russell King --- arch/arm/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/arm/Kconfig') diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index aef63c8e3d2d..c3fed1ee7304 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -493,6 +493,7 @@ config ARCH_W90X900 select CPU_ARM926T select ARCH_REQUIRE_GPIOLIB select GENERIC_GPIO + select HAVE_CLK select COMMON_CLKDEV help Support for Nuvoton (Winbond logic dept.) ARM9 processor,You -- cgit v1.2.3-58-ga151 From 58b5369e6eb6c889b540a99aa95562a66b25acf1 Mon Sep 17 00:00:00 2001 From: wanzongshun Date: Fri, 14 Aug 2009 15:36:44 +0100 Subject: ARM: 5674/1: Add clocksource/clockevent support for w90p910 platform Add clocksource/clockevent support for w90p910 platform. Signed-off-by: Wan ZongShun Signed-off-by: Russell King --- arch/arm/Kconfig | 2 + arch/arm/mach-w90x900/clock.c | 6 ++ arch/arm/mach-w90x900/time.c | 151 +++++++++++++++++++++++++++++++++------- arch/arm/mach-w90x900/w90p910.c | 2 + 4 files changed, 137 insertions(+), 24 deletions(-) (limited to 'arch/arm/Kconfig') diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index c3fed1ee7304..8c4f03d34124 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -495,6 +495,8 @@ config ARCH_W90X900 select GENERIC_GPIO select HAVE_CLK select COMMON_CLKDEV + select GENERIC_TIME + select GENERIC_CLOCKEVENTS help Support for Nuvoton (Winbond logic dept.) ARM9 processor,You can login www.mcuos.com or www.nuvoton.com to know more. diff --git a/arch/arm/mach-w90x900/clock.c b/arch/arm/mach-w90x900/clock.c index 49cf1fbc14eb..70b671096377 100644 --- a/arch/arm/mach-w90x900/clock.c +++ b/arch/arm/mach-w90x900/clock.c @@ -55,6 +55,12 @@ void clk_disable(struct clk *clk) } EXPORT_SYMBOL(clk_disable); +unsigned long clk_get_rate(struct clk *clk) +{ + return 15000000; +} +EXPORT_SYMBOL(clk_get_rate); + void w90x900_clk_enable(struct clk *clk, int enable) { unsigned int clocks = clk->cken; diff --git a/arch/arm/mach-w90x900/time.c b/arch/arm/mach-w90x900/time.c index bcc838f6b393..5e06770e6014 100644 --- a/arch/arm/mach-w90x900/time.c +++ b/arch/arm/mach-w90x900/time.c @@ -3,7 +3,7 @@ * * Based on linux/arch/arm/plat-s3c24xx/time.c by Ben Dooks * - * Copyright (c) 2008 Nuvoton technology corporation + * Copyright (c) 2009 Nuvoton technology corporation * All rights reserved. * * Wan ZongShun @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include #include @@ -31,49 +33,150 @@ #include #include -static unsigned long w90x900_gettimeoffset(void) +#define RESETINT 0x1f +#define PERIOD (0x01 << 27) +#define ONESHOT (0x00 << 27) +#define COUNTEN (0x01 << 30) +#define INTEN (0x01 << 29) + +#define TICKS_PER_SEC 100 +#define PRESCALE 0x63 /* Divider = prescale + 1 */ + +unsigned int timer0_load; + +static void w90p910_clockevent_setmode(enum clock_event_mode mode, + struct clock_event_device *clk) { + unsigned int val; + + val = __raw_readl(REG_TCSR0); + val &= ~(0x03 << 27); + + switch (mode) { + case CLOCK_EVT_MODE_PERIODIC: + __raw_writel(timer0_load, REG_TICR0); + val |= (PERIOD | COUNTEN | INTEN | PRESCALE); + break; + + case CLOCK_EVT_MODE_ONESHOT: + val |= (ONESHOT | COUNTEN | INTEN | PRESCALE); + break; + + case CLOCK_EVT_MODE_UNUSED: + case CLOCK_EVT_MODE_SHUTDOWN: + case CLOCK_EVT_MODE_RESUME: + break; + } + + __raw_writel(val, REG_TCSR0); +} + +static int w90p910_clockevent_setnextevent(unsigned long evt, + struct clock_event_device *clk) +{ + unsigned int val; + + __raw_writel(evt, REG_TICR0); + + val = __raw_readl(REG_TCSR0); + val |= (COUNTEN | INTEN | PRESCALE); + __raw_writel(val, REG_TCSR0); + return 0; } +static struct clock_event_device w90p910_clockevent_device = { + .name = "w90p910-timer0", + .shift = 32, + .features = CLOCK_EVT_MODE_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, + .set_mode = w90p910_clockevent_setmode, + .set_next_event = w90p910_clockevent_setnextevent, + .rating = 300, +}; + /*IRQ handler for the timer*/ -static irqreturn_t -w90x900_timer_interrupt(int irq, void *dev_id) +static irqreturn_t w90p910_timer0_interrupt(int irq, void *dev_id) { - timer_tick(); + struct clock_event_device *evt = &w90p910_clockevent_device; + __raw_writel(0x01, REG_TISR); /* clear TIF0 */ + + evt->event_handler(evt); return IRQ_HANDLED; } -static struct irqaction w90x900_timer_irq = { - .name = "w90x900 Timer Tick", +static struct irqaction w90p910_timer0_irq = { + .name = "w90p910-timer0", .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, - .handler = w90x900_timer_interrupt, + .handler = w90p910_timer0_interrupt, }; -/*Set up timer reg.*/ +static void __init w90p910_clockevents_init(unsigned int rate) +{ + w90p910_clockevent_device.mult = div_sc(rate, NSEC_PER_SEC, + w90p910_clockevent_device.shift); + w90p910_clockevent_device.max_delta_ns = clockevent_delta2ns(0xffffffff, + &w90p910_clockevent_device); + w90p910_clockevent_device.min_delta_ns = clockevent_delta2ns(0xf, + &w90p910_clockevent_device); + w90p910_clockevent_device.cpumask = cpumask_of(0); -static void w90x900_timer_setup(void) + clockevents_register_device(&w90p910_clockevent_device); +} + +static cycle_t w90p910_get_cycles(struct clocksource *cs) { - __raw_writel(0, REG_TCSR0); - __raw_writel(0, REG_TCSR1); - __raw_writel(0, REG_TCSR2); - __raw_writel(0, REG_TCSR3); - __raw_writel(0, REG_TCSR4); - __raw_writel(0x1F, REG_TISR); - __raw_writel(15000000/(100 * 100), REG_TICR0); - __raw_writel(0x68000063, REG_TCSR0); + return ~__raw_readl(REG_TDR1); } -static void __init w90x900_timer_init(void) +static struct clocksource clocksource_w90p910 = { + .name = "w90p910-timer1", + .rating = 200, + .read = w90p910_get_cycles, + .mask = CLOCKSOURCE_MASK(32), + .shift = 20, + .flags = CLOCK_SOURCE_IS_CONTINUOUS, +}; + +static void __init w90p910_clocksource_init(unsigned int rate) { - w90x900_timer_setup(); - setup_irq(IRQ_TIMER0, &w90x900_timer_irq); + unsigned int val; + + __raw_writel(0xffffffff, REG_TICR1); + + val = __raw_readl(REG_TCSR1); + val |= (COUNTEN | PERIOD); + __raw_writel(val, REG_TCSR1); + + clocksource_w90p910.mult = + clocksource_khz2mult((rate / 1000), clocksource_w90p910.shift); + clocksource_register(&clocksource_w90p910); +} + +static void __init w90p910_timer_init(void) +{ + struct clk *ck_ext = clk_get(NULL, "ext"); + unsigned int rate; + + BUG_ON(IS_ERR(ck_ext)); + + rate = clk_get_rate(ck_ext); + clk_put(ck_ext); + rate = rate / (PRESCALE + 0x01); + + /* set a known state */ + __raw_writel(0x00, REG_TCSR0); + __raw_writel(0x00, REG_TCSR1); + __raw_writel(RESETINT, REG_TISR); + timer0_load = (rate / TICKS_PER_SEC); + + setup_irq(IRQ_TIMER0, &w90p910_timer0_irq); + + w90p910_clocksource_init(rate); + w90p910_clockevents_init(rate); } struct sys_timer w90x900_timer = { - .init = w90x900_timer_init, - .offset = w90x900_gettimeoffset, - .resume = w90x900_timer_setup + .init = w90p910_timer_init, }; diff --git a/arch/arm/mach-w90x900/w90p910.c b/arch/arm/mach-w90x900/w90p910.c index 8444eababaab..d33723b69d14 100644 --- a/arch/arm/mach-w90x900/w90p910.c +++ b/arch/arm/mach-w90x900/w90p910.c @@ -76,6 +76,7 @@ static DEFINE_CLK(wdt, 26); static DEFINE_CLK(gdma, 27); static DEFINE_CLK(adc, 28); static DEFINE_CLK(usi, 29); +static DEFINE_CLK(ext, 0); static struct clk_lookup w90p910_clkregs[] = { DEF_CLKLOOK(&clk_lcd, "w90p910-lcd", NULL), @@ -97,6 +98,7 @@ static struct clk_lookup w90p910_clkregs[] = { DEF_CLKLOOK(&clk_gdma, "w90p910-gdma", NULL), DEF_CLKLOOK(&clk_adc, "w90p910-adc", NULL), DEF_CLKLOOK(&clk_usi, "w90p910-spi", NULL), + DEF_CLKLOOK(&clk_ext, NULL, "ext"), }; /* Initial serial platform data */ -- cgit v1.2.3-58-ga151 From a8bc4eadd936bbad9e99b89fe692679451ad75c9 Mon Sep 17 00:00:00 2001 From: wanzongshun Date: Fri, 14 Aug 2009 15:38:29 +0100 Subject: ARM: 5676/1: Provide more useful introduction for w90x900 Provide more useful introduction for w90x900 Signed-off-by: Wan ZongShun Signed-off-by: Russell King --- arch/arm/Kconfig | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'arch/arm/Kconfig') diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 8c4f03d34124..aad0add99a5e 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -498,8 +498,13 @@ config ARCH_W90X900 select GENERIC_TIME select GENERIC_CLOCKEVENTS help - Support for Nuvoton (Winbond logic dept.) ARM9 processor,You - can login www.mcuos.com or www.nuvoton.com to know more. + Support for Nuvoton (Winbond logic dept.) ARM9 processor, + At present, the w90x900 has been renamed nuc900, regarding + the ARM series product line, you can login the following + link address to know more. + + config ARCH_PNX4008 bool "Philips Nexperia PNX4008 Mobile" -- cgit v1.2.3-58-ga151 From 6288e28dce9bae24068b7341ebd72a7d176a3539 Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Fri, 7 Aug 2009 19:46:15 +0100 Subject: ARM: 5641/1: bcmring: add Kconfig and Makefile entries in arch/arm add bcmring option in Kconfig and add entry in Makefile in arch/arm directory Signed-off-by: Leo Chen Signed-off-by: Russell King --- arch/arm/Kconfig | 14 ++++++++++++++ arch/arm/Makefile | 1 + 2 files changed, 15 insertions(+) (limited to 'arch/arm/Kconfig') diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index aef63c8e3d2d..c6d2b1988757 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -637,6 +637,18 @@ config ARCH_OMAP help Support for TI's OMAP platform (OMAP1 and OMAP2). +config ARCH_BCMRING + bool "Broadcom BCMRING" + depends on MMU + select CPU_V6 + select ARM_AMBA + select COMMON_CLKDEV + select GENERIC_TIME + select GENERIC_CLOCKEVENTS + select ARCH_WANT_OPTIONAL_GPIOLIB + help + Support for Broadcom's BCMRing platform. + endchoice source "arch/arm/mach-clps711x/Kconfig" @@ -730,6 +742,8 @@ source "arch/arm/mach-u300/Kconfig" source "arch/arm/mach-w90x900/Kconfig" +source "arch/arm/mach-bcmring/Kconfig" + # Definitions to make life easier config ARCH_ACORN bool diff --git a/arch/arm/Makefile b/arch/arm/Makefile index c877d6df23d1..b9ae98b88a7e 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -112,6 +112,7 @@ endif # by CONFIG_* macro name. machine-$(CONFIG_ARCH_AAEC2000) := aaec2000 machine-$(CONFIG_ARCH_AT91) := at91 +machine-$(CONFIG_ARCH_BCMRING) := bcmring machine-$(CONFIG_ARCH_CLPS711X) := clps711x machine-$(CONFIG_ARCH_DAVINCI) := davinci machine-$(CONFIG_ARCH_EBSA110) := ebsa110 -- cgit v1.2.3-58-ga151 From 65cec8e3db606608fd1f8dfc4a1c7c37bfba9173 Mon Sep 17 00:00:00 2001 From: Russell King Date: Mon, 17 Aug 2009 20:02:06 +0100 Subject: ARM: implement highpte Add the ARM implementation of highpte, which allows PTE tables to be placed in highmem. Unfortunately, we do not offer highpte support when support for L2 cache is enabled. Signed-off-by: Russell King --- arch/arm/Kconfig | 5 +++++ arch/arm/include/asm/pgalloc.h | 16 ++++++++++++---- arch/arm/include/asm/pgtable.h | 17 +++++++++++++---- arch/arm/mm/fault.c | 1 + 4 files changed, 31 insertions(+), 8 deletions(-) (limited to 'arch/arm/Kconfig') diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index aef63c8e3d2d..370f47787122 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1054,6 +1054,11 @@ config HIGHMEM If unsure, say n. +config HIGHPTE + bool "Allocate 2nd-level pagetables from highmem" + depends on HIGHMEM + depends on !OUTER_CACHE + source "mm/Kconfig" config LEDS diff --git a/arch/arm/include/asm/pgalloc.h b/arch/arm/include/asm/pgalloc.h index 3dcd64bf1824..b12cc98bbe04 100644 --- a/arch/arm/include/asm/pgalloc.h +++ b/arch/arm/include/asm/pgalloc.h @@ -36,6 +36,8 @@ extern void free_pgd_slow(struct mm_struct *mm, pgd_t *pgd); #define pgd_alloc(mm) get_pgd_slow(mm) #define pgd_free(mm, pgd) free_pgd_slow(mm, pgd) +#define PGALLOC_GFP (GFP_KERNEL | __GFP_NOTRACK | __GFP_REPEAT | __GFP_ZERO) + /* * Allocate one PTE table. * @@ -57,7 +59,7 @@ pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr) { pte_t *pte; - pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); + pte = (pte_t *)__get_free_page(PGALLOC_GFP); if (pte) { clean_dcache_area(pte, sizeof(pte_t) * PTRS_PER_PTE); pte += PTRS_PER_PTE; @@ -71,10 +73,16 @@ pte_alloc_one(struct mm_struct *mm, unsigned long addr) { struct page *pte; - pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0); +#ifdef CONFIG_HIGHPTE + pte = alloc_pages(PGALLOC_GFP | __GFP_HIGHMEM, 0); +#else + pte = alloc_pages(PGALLOC_GFP, 0); +#endif if (pte) { - void *page = page_address(pte); - clean_dcache_area(page, sizeof(pte_t) * PTRS_PER_PTE); + if (!PageHighMem(pte)) { + void *page = page_address(pte); + clean_dcache_area(page, sizeof(pte_t) * PTRS_PER_PTE); + } pgtable_page_ctor(pte); } diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h index 9655bce3d345..201ccaa11f61 100644 --- a/arch/arm/include/asm/pgtable.h +++ b/arch/arm/include/asm/pgtable.h @@ -262,10 +262,19 @@ extern struct page *empty_zero_page; #define pte_clear(mm,addr,ptep) set_pte_ext(ptep, __pte(0), 0) #define pte_page(pte) (pfn_to_page(pte_pfn(pte))) #define pte_offset_kernel(dir,addr) (pmd_page_vaddr(*(dir)) + __pte_index(addr)) -#define pte_offset_map(dir,addr) (pmd_page_vaddr(*(dir)) + __pte_index(addr)) -#define pte_offset_map_nested(dir,addr) (pmd_page_vaddr(*(dir)) + __pte_index(addr)) -#define pte_unmap(pte) do { } while (0) -#define pte_unmap_nested(pte) do { } while (0) + +#define pte_offset_map(dir,addr) (__pte_map(dir, KM_PTE0) + __pte_index(addr)) +#define pte_offset_map_nested(dir,addr) (__pte_map(dir, KM_PTE1) + __pte_index(addr)) +#define pte_unmap(pte) __pte_unmap(pte, KM_PTE0) +#define pte_unmap_nested(pte) __pte_unmap(pte, KM_PTE1) + +#ifndef CONFIG_HIGHPTE +#define __pte_map(dir,km) pmd_page_vaddr(*(dir)) +#define __pte_unmap(pte,km) do { } while (0) +#else +#define __pte_map(dir,km) ((pte_t *)kmap_atomic(pmd_page(*(dir)), km) + PTRS_PER_PTE) +#define __pte_unmap(pte,km) kunmap_atomic((pte - PTRS_PER_PTE), km) +#endif #define set_pte_ext(ptep,pte,ext) cpu_set_pte_ext(ptep,pte,ext) diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index 6fdcbb709827..5fa8dea5a371 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include -- cgit v1.2.3-58-ga151