From dffc9efc562b8a2180e86df9f733cb113ba94b33 Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Wed, 28 Jan 2009 17:07:19 +1000 Subject: m68knommu: mark all RAM as ZONE_DMA There is no reason not to put all RAM in ZONE_DMA for these simple m68k varients (same as the standard MMU m68k code does). With this in place the usual dma_alloc_coherent() work as expected. Signed-off-by: Greg Ungerer --- arch/m68knommu/mm/init.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'arch/m68knommu') diff --git a/arch/m68knommu/mm/init.c b/arch/m68knommu/mm/init.c index 3bf249c53e4..7befc0c357e 100644 --- a/arch/m68knommu/mm/init.c +++ b/arch/m68knommu/mm/init.c @@ -111,11 +111,7 @@ void __init paging_init(void) { unsigned long zones_size[MAX_NR_ZONES] = {0, }; - zones_size[ZONE_DMA] = 0 >> PAGE_SHIFT; - zones_size[ZONE_NORMAL] = (end_mem - PAGE_OFFSET) >> PAGE_SHIFT; -#ifdef CONFIG_HIGHMEM - zones_size[ZONE_HIGHMEM] = 0; -#endif + zones_size[ZONE_DMA] = (end_mem - PAGE_OFFSET) >> PAGE_SHIFT; free_area_init(zones_size); } } -- cgit v1.2.3 From bf5fe9ed73c2e696d3256ff18f926b103097abd2 Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Wed, 28 Jan 2009 17:29:35 +1000 Subject: m68knommu: add a local dma_sync_single_for_cpu() function The onboard ethernet of many ColdFire parts uses DMA. The driver is being cleaned up to use the correct DMA handling functions, and m68knommuy currently does not implement dma_sync_single_for_cpu(). Signed-off-by: Greg Ungerer --- arch/m68knommu/kernel/dma.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'arch/m68knommu') diff --git a/arch/m68knommu/kernel/dma.c b/arch/m68knommu/kernel/dma.c index e10eafc5278..93612580663 100644 --- a/arch/m68knommu/kernel/dma.c +++ b/arch/m68knommu/kernel/dma.c @@ -9,10 +9,11 @@ #include #include #include +#include #include void *dma_alloc_coherent(struct device *dev, size_t size, - dma_addr_t *dma_handle, int gfp) + dma_addr_t *dma_handle, gfp_t gfp) { void *ret; /* ignore region specifiers */ @@ -34,3 +35,8 @@ void dma_free_coherent(struct device *dev, size_t size, { free_pages((unsigned long)vaddr, get_order(size)); } + +void dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir) +{ +} + -- cgit v1.2.3 From facdf0ed4f594485fb2a1d2d024a150924c6b01c Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Wed, 4 Mar 2009 10:43:06 +1000 Subject: m68knommu: introduce basic clk infrastructure Create basic support for clk API. Recent changes to the FEC driver (used by many ColdFire family parts) need this. Initially only supports getting the master clock frequency. Signed-off-by: Greg Ungerer --- arch/m68knommu/platform/coldfire/Makefile | 2 +- arch/m68knommu/platform/coldfire/clk.c | 40 +++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 arch/m68knommu/platform/coldfire/clk.c (limited to 'arch/m68knommu') diff --git a/arch/m68knommu/platform/coldfire/Makefile b/arch/m68knommu/platform/coldfire/Makefile index 4f416a91a82..1bcb9372353 100644 --- a/arch/m68knommu/platform/coldfire/Makefile +++ b/arch/m68knommu/platform/coldfire/Makefile @@ -14,7 +14,7 @@ asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 -obj-$(CONFIG_COLDFIRE) += dma.o entry.o vectors.o +obj-$(CONFIG_COLDFIRE) += clk.o dma.o entry.o vectors.o obj-$(CONFIG_M5206) += timers.o obj-$(CONFIG_M5206e) += timers.o obj-$(CONFIG_M520x) += pit.o diff --git a/arch/m68knommu/platform/coldfire/clk.c b/arch/m68knommu/platform/coldfire/clk.c new file mode 100644 index 00000000000..7cdbf445b28 --- /dev/null +++ b/arch/m68knommu/platform/coldfire/clk.c @@ -0,0 +1,40 @@ +/***************************************************************************/ + +/* + * clk.c -- general ColdFire CPU kernel clk handling + * + * Copyright (C) 2009, Greg Ungerer (gerg@snapgear.com) + */ + +/***************************************************************************/ + +#include +#include +#include + +/***************************************************************************/ + +struct clk *clk_get(struct device *dev, const char *id) +{ + return NULL; +} + +int clk_enable(struct clk *clk) +{ + return 0; +} + +void clk_disable(struct clk *clk) +{ +} + +void clk_put(struct clk *clk) +{ +} + +unsigned long clk_get_rate(struct clk *clk) +{ + return MCF_CLK; +} + +/***************************************************************************/ -- cgit v1.2.3 From 454dc5f8228d08e6e9876c45d7f9bfd8b745e39d Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Fri, 20 Mar 2009 09:53:59 +1000 Subject: m68knommu: switch to using generic_handle_irq() Switch to using generic_handle_irq() instead of the deprecated __do_IRQ(). Signed-off-by: Greg Ungerer --- arch/m68knommu/kernel/irq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/m68knommu') diff --git a/arch/m68knommu/kernel/irq.c b/arch/m68knommu/kernel/irq.c index bba1bb48a21..56e0f4c55a6 100644 --- a/arch/m68knommu/kernel/irq.c +++ b/arch/m68knommu/kernel/irq.c @@ -23,7 +23,7 @@ asmlinkage void do_IRQ(int irq, struct pt_regs *regs) struct pt_regs *oldregs = set_irq_regs(regs); irq_enter(); - __do_IRQ(irq); + generic_handle_irq(irq); irq_exit(); set_irq_regs(oldregs); -- cgit v1.2.3 From 4ce2cba45a46668409606bdb9923164b51986807 Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Tue, 24 Mar 2009 15:15:14 +1000 Subject: m68knommu: fix end of uart table marker The UART platform data structure is missing an empty struct at the end (as the end of structure marker). Signed-off-by: Greg Ungerer --- arch/m68knommu/platform/5249/config.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'arch/m68knommu') diff --git a/arch/m68knommu/platform/5249/config.c b/arch/m68knommu/platform/5249/config.c index d299f7b8768..9c926dedb7c 100644 --- a/arch/m68knommu/platform/5249/config.c +++ b/arch/m68knommu/platform/5249/config.c @@ -32,7 +32,8 @@ static struct mcf_platform_uart m5249_uart_platform[] = { { .mapbase = MCF_MBAR + MCFUART_BASE2, .irq = 74, - } + }, + { }, }; static struct platform_device m5249_uart = { -- cgit v1.2.3 From de1fc5c629f1597ddc996379642f9f3594dcdfbe Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Tue, 24 Mar 2009 16:50:09 +1000 Subject: m68knommu: fix 5249 ColdFire UART setup The ICR registers of the 5249 ColdFire processor are 8bits, not 32bits. Fix the read/write of these register to be the correct size. Signed-off-by: Greg Ungerer --- arch/m68knommu/platform/5249/config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/m68knommu') diff --git a/arch/m68knommu/platform/5249/config.c b/arch/m68knommu/platform/5249/config.c index 9c926dedb7c..3b808c64e67 100644 --- a/arch/m68knommu/platform/5249/config.c +++ b/arch/m68knommu/platform/5249/config.c @@ -51,11 +51,11 @@ static struct platform_device *m5249_devices[] __initdata = { static void __init m5249_uart_init_line(int line, int irq) { if (line == 0) { - writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR); + writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR); writeb(irq, MCFUART_BASE1 + MCFUART_UIVR); mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART1); } else if (line == 1) { - writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR); + writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR); writeb(irq, MCFUART_BASE2 + MCFUART_UIVR); mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART2); } -- cgit v1.2.3 From d62db60659416499b763a00c953f23ed1c9a5c46 Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Tue, 24 Mar 2009 17:14:32 +1000 Subject: m68knommu: fix 5249 ColdFire UART vector setup The address of the IVUR register is not correct, it should be offset into the MBAR region. Without this the vector is not set to the correct number. Signed-off-by: Greg Ungerer --- arch/m68knommu/platform/5249/config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/m68knommu') diff --git a/arch/m68knommu/platform/5249/config.c b/arch/m68knommu/platform/5249/config.c index 3b808c64e67..9eab19d01eb 100644 --- a/arch/m68knommu/platform/5249/config.c +++ b/arch/m68knommu/platform/5249/config.c @@ -52,11 +52,11 @@ static void __init m5249_uart_init_line(int line, int irq) { if (line == 0) { writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR); - writeb(irq, MCFUART_BASE1 + MCFUART_UIVR); + writeb(irq, MCF_MBAR + MCFUART_BASE1 + MCFUART_UIVR); mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART1); } else if (line == 1) { writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR); - writeb(irq, MCFUART_BASE2 + MCFUART_UIVR); + writeb(irq, MCF_MBAR + MCFUART_BASE2 + MCFUART_UIVR); mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART2); } } -- cgit v1.2.3 From 9242ef12f0d174da1739a071fb4a5fc5de27905e Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Tue, 24 Mar 2009 17:22:05 +1000 Subject: m68knommu: fix 5307 ColdFire UART vector setup There is a couple of problems with the UART vector setup for the 5307 ColdFire UART. The ICR register access should be 8bit, not 32bit. The address of the UIVR register is wrong, it needs to be offset into the MBAR register region. Fix these. Signed-off-by: Greg Ungerer --- arch/m68knommu/platform/5307/config.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'arch/m68knommu') diff --git a/arch/m68knommu/platform/5307/config.c b/arch/m68knommu/platform/5307/config.c index 724faf05852..44803bf70a6 100644 --- a/arch/m68knommu/platform/5307/config.c +++ b/arch/m68knommu/platform/5307/config.c @@ -65,12 +65,12 @@ static struct platform_device *m5307_devices[] __initdata = { static void __init m5307_uart_init_line(int line, int irq) { if (line == 0) { - writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR); - writeb(irq, MCFUART_BASE1 + MCFUART_UIVR); + writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR); + writeb(irq, MCF_MBAR + MCFUART_BASE1 + MCFUART_UIVR); mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART1); } else if (line == 1) { - writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR); - writeb(irq, MCFUART_BASE2 + MCFUART_UIVR); + writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR); + writeb(irq, MCF_MBAR + MCFUART_BASE2 + MCFUART_UIVR); mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART2); } } -- cgit v1.2.3 From 522b3d49179a0d2dc4e152b77eb82fbfe97782f4 Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Tue, 24 Mar 2009 17:33:41 +1000 Subject: m68knommu: fix 5407 ColdFire UART vector setup There is a couple of problems with the UART vector setup for the 5307 ColdFire UART. The ICR register access should be 8bit, not 32bit. The address of the UIVR register is wrong, it needs to be offset into the MBAR register region. Fix these. Signed-off-by: Greg Ungerer --- arch/m68knommu/platform/5407/config.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'arch/m68knommu') diff --git a/arch/m68knommu/platform/5407/config.c b/arch/m68knommu/platform/5407/config.c index 648b8b77821..0ee8c1a200c 100644 --- a/arch/m68knommu/platform/5407/config.c +++ b/arch/m68knommu/platform/5407/config.c @@ -56,12 +56,12 @@ static struct platform_device *m5407_devices[] __initdata = { static void __init m5407_uart_init_line(int line, int irq) { if (line == 0) { - writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR); - writeb(irq, MCFUART_BASE1 + MCFUART_UIVR); + writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR); + writeb(irq, MCF_MBAR + MCFUART_BASE1 + MCFUART_UIVR); mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART1); } else if (line == 1) { - writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR); - writeb(irq, MCFUART_BASE2 + MCFUART_UIVR); + writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR); + writeb(irq, MCF_MBAR + MCFUART_BASE2 + MCFUART_UIVR); mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART2); } } -- cgit v1.2.3 From b4d63e8e745b0000ba22f44ff34cd51e8b4d0389 Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Mon, 30 Mar 2009 10:29:45 +1000 Subject: m68knommu: improve compile arch switch settings Modern versions of gcc have a better range of ColdFire optimization switches for the vairous ColdFire family members. Use these when we can. Signed-off-by: Greg Ungerer --- arch/m68knommu/Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'arch/m68knommu') diff --git a/arch/m68knommu/Makefile b/arch/m68knommu/Makefile index fd0fb303d88..ce404bc9ccb 100644 --- a/arch/m68knommu/Makefile +++ b/arch/m68knommu/Makefile @@ -88,18 +88,18 @@ export PLATFORM BOARD MODEL CPUCLASS # # Some CFLAG additions based on specific CPU type. # -cflags-$(CONFIG_M5206) := -m5200 -cflags-$(CONFIG_M5206e) := -m5200 -cflags-$(CONFIG_M520x) := -m5307 +cflags-$(CONFIG_M5206) := $(call cc-option,-mcpu=5206,-m5200) +cflags-$(CONFIG_M5206e) := $(call cc-option,-m5206e,-m5200) +cflags-$(CONFIG_M520x) := $(call cc-option,-mcpu=5208,-m5200) cflags-$(CONFIG_M523x) := $(call cc-option,-mcpu=523x,-m5307) -cflags-$(CONFIG_M5249) := -m5200 +cflags-$(CONFIG_M5249) := $(call cc-option,-mcpu=5249,-m5200) cflags-$(CONFIG_M5271) := $(call cc-option,-mcpu=5271,-m5307) -cflags-$(CONFIG_M5272) := -m5307 +cflags-$(CONFIG_M5272) := $(call cc-option,-mcpu=5271,-m5200) cflags-$(CONFIG_M5275) := $(call cc-option,-mcpu=5275,-m5307) cflags-$(CONFIG_M528x) := $(call cc-option,-m528x,-m5307) -cflags-$(CONFIG_M5307) := -m5307 +cflags-$(CONFIG_M5307) := $(call cc-option,-m5307,-m5200) cflags-$(CONFIG_M532x) := $(call cc-option,-mcpu=532x,-m5307) -cflags-$(CONFIG_M5407) := -m5200 +cflags-$(CONFIG_M5407) := $(call cc-option,-m5407,-m5200) cflags-$(CONFIG_M68328) := -m68000 cflags-$(CONFIG_M68EZ328) := -m68000 cflags-$(CONFIG_M68VZ328) := -m68000 -- cgit v1.2.3