?? kernel-2.6.18-imx21-jk2.patch
字號:
+static void __init+imx21fs3_map_io(void)+{+ imx21_map_io();+ //iotable_init(mx21ads_io_desc, ARRAY_SIZE(mx21ads_io_desc));+}++static void dummy_release(struct device *dev)+{+ /* normally not freed */+}++static struct resource mx21fs3_resources[] = {+#if 0+ [0] = {+ .start = IMX_CS4_VIRT,+ .end = IMX_CS4_VIRT + 16,+ .flags = IORESOURCE_MEM,+ },+ [1] = {+ .start = 13,+ .end = 13,+ .flags = IORESOURCE_IRQ,+ },+#endif+};++static struct resource dm9000_resources[] = {+ [0] = {+ .start = 0xcc000000,+ .end = 0xcc000001,+ .flags = IORESOURCE_MEM,+ },+ [1] = {+ .start = 0xcc000004,+ .end = 0xcc000005,+ .flags = IORESOURCE_MEM,+ },+ [2] = {+ .start = IRQ_GPIOB(15),+ .end = IRQ_GPIOB(15),+ .flags = IORESOURCE_IRQ,+ },+};++/* Put this to board specific because on some boards the ports are used as GPIO */+static struct resource sdhc1_resources[] = {+ [0] = {+ .start = 0x10013000,+ .end = 0x10013FFF,+ .flags = IORESOURCE_MEM,+ },+ [1] = {+ .start = (INT_SDHC1),+ .end = (INT_SDHC1),+ .flags = IORESOURCE_IRQ,+ },+ [2] = {+ .start = (DMA_REQ_SDHC1),+ .end = (DMA_REQ_SDHC1),+ .flags = IORESOURCE_DMA,+ },+ [3] = {+ /* CARD Detect */+ .start = GPIO_PORTF(5),+ .end = GPIO_PORTF(5),+ .flags = IORESOURCE_GPIO,+ },+ [4] = {+ /* Write protect */+ .start = GPIO_PORTF(0),+ .end = GPIO_PORTF(0),+ .flags = IORESOURCE_GPIO,+ },+};++static struct resource sdhc2_resources[] = {+ [0] = {+ .start = 0x10014000,+ .end = 0x10014FFF,+ .flags = IORESOURCE_MEM,+ },+ [1] = {+ .start = (INT_SDHC2),+ .end = (INT_SDHC2),+ .flags = IORESOURCE_IRQ,+ },+ [2] = {+ .start = (DMA_REQ_SDHC2),+ .end = (DMA_REQ_SDHC2),+ .flags = IORESOURCE_DMA,+ },+ [3] = {+ /* CARD Detect */+ .start = GPIO_PORTF(2),+ .end = GPIO_PORTF(2),+ .flags = IORESOURCE_GPIO,+ },+ [4] = {+ /* Write protect */+ .start = GPIO_PORTF(7),+ .end = GPIO_PORTF(7),+ .flags = IORESOURCE_GPIO,+ },+};+static struct resource cspi1_resources[] = {+ [0] = {+ .start = 0x1000E000,+ .end = 0x1000EFFF,+ .flags = IORESOURCE_MEM,+ },+ [1] = {+ .start = (INT_CSPI1),+ .end = (INT_CSPI1),+ .flags = IORESOURCE_IRQ,+ },+};+static struct resource cspi2_resources[] = {+ [0] = {+ .start = 0x1000F000,+ .end = 0x1000FFFF,+ .flags = IORESOURCE_MEM,+ },+ [1] = {+ .start = (INT_CSPI2),+ .end = (INT_CSPI2),+ .flags = IORESOURCE_IRQ,+ },+};++static struct resource cspi3_resources[] = {+ [0] = {+ .start = 0x10017000,+ .end = 0x10017FFF,+ .flags = IORESOURCE_MEM,+ },+ [1] = {+ .start = (INT_CSPI3),+ .end = (INT_CSPI3),+ .flags = IORESOURCE_IRQ,+ },+};++static struct platform_device imx21_cspi1_device = {+ .name = "imx21-cspi",+ .id = 0,+ .num_resources = ARRAY_SIZE(cspi1_resources),+ .resource = cspi1_resources,+ .dev = {+ .release = dummy_release, // not needed+ .coherent_dma_mask = 0xffffffff, + },+};++static struct platform_device imx21_cspi2_device = {+ .name = "imx21-cspi",+ .id = 1,+ .num_resources = ARRAY_SIZE(cspi2_resources),+ .resource = cspi2_resources,+ .dev = {+ .release = dummy_release, // not needed+ .coherent_dma_mask = 0xffffffff, + },+};+static struct platform_device imx21_cspi3_device = {+ .name = "imx21-cspi",+ .id = 2,+ .num_resources = ARRAY_SIZE(cspi3_resources),+ .resource = cspi3_resources,+ .dev = {+ .release = dummy_release, // not needed+ .coherent_dma_mask = 0xffffffff, + },+};++static struct platform_device imx21_sdhc1_device = {+ .name = "imx21-sdhc",+ .id = 0,+ .num_resources = ARRAY_SIZE(sdhc1_resources),+ .resource = sdhc1_resources,+ .dev = {+ .release = dummy_release, // not needed+ .coherent_dma_mask = 0xffffffff, + },+};++static struct platform_device imx21_sdhc2_device = {+ .name = "imx21-sdhc",+ .id = 1,+ .num_resources = ARRAY_SIZE(sdhc2_resources),+ .resource = sdhc2_resources,+ .dev = {+ .release = dummy_release, // not needed+ .coherent_dma_mask = 0xffffffff, + },+};+++static struct platform_device mx21fs3_device = {+ .name = "mx21fs3",+ .num_resources = ARRAY_SIZE(mx21fs3_resources),+ .resource = mx21fs3_resources,+};++static struct platform_device mx21fs3_dm9000_device = {+ .name = "dm9000",+ .id = 0,+ .num_resources = ARRAY_SIZE(dm9000_resources),+ .resource = dm9000_resources,+ .dev = {+ .release = dummy_release, // not needed+ .coherent_dma_mask = 0xffffffff, + },+};++static struct platform_device *devices[] __initdata = {+ &mx21fs3_device,+ &imx21_cspi1_device,+ &imx21_cspi2_device,+ &imx21_cspi3_device,+ &imx21_sdhc1_device,+ &imx21_sdhc2_device,+ &mx21fs3_dm9000_device+};++static u64 mx21_dmamask = 0xffffffffUL;++static void __init+mx21fs3_init(void)+{+ platform_bus.coherent_dma_mask=0xffffffff;+ platform_bus.dma_mask=&mx21_dmamask;+ platform_add_devices(devices, ARRAY_SIZE(devices));+ set_irq_type(IRQ_GPIOB(15), __IRQT_HIGHLVL);+}+++MACHINE_START(MX21FS3, "i.MX21 FS3")+ /* Maintainer: Jochen Karrer */+ .phys_io = 0x10000000,+ .boot_params = 0xC0000100,+ .io_pg_offst = (io_p2v(0x10000000) >> 18) & 0xfffc,+ .map_io = imx21fs3_map_io,+ .init_irq = imx21_init_irq,+ .timer = &imx21_timer,+ .init_machine = mx21fs3_init,+MACHINE_ENDdiff -Nur -X linux/Documentation/dontdiff linux-2.6.18/arch/arm/mach-imx2/mx2ads.c linux-2.6.18-fs3/arch/arm/mach-imx2/mx2ads.c--- linux-2.6.18/arch/arm/mach-imx2/mx2ads.c 1970-01-01 01:00:00.000000000 +0100+++ linux-2.6.18-fs3/arch/arm/mach-imx2/mx2ads.c 2006-10-27 09:28:09.000000000 +0200@@ -0,0 +1,190 @@+#include <linux/device.h>+#include <linux/init.h>+#include <linux/platform_device.h>+#include <asm/system.h>+#include <asm/hardware.h>+#include <asm/irq.h>+#include <asm/pgtable.h>+#include <asm/page.h>++#include <asm/mach/map.h>+#include <asm/mach-types.h>+#include <linux/spi/spi.h>++#include <asm/arch/gpio.h>++#include <asm/mach/arch.h>+#include <linux/interrupt.h>+#include "generic.h"+#include <asm/serial.h>+#include <asm/dma.h>+++static void __init+imx21ads_map_io(void)+{+ imx21_map_io();+ //iotable_init(mx21ads_io_desc, ARRAY_SIZE(mx21ads_io_desc));+}++static void dummy_release(struct device *dev)+{+ /* normally not freed */+}++static struct resource mx2ads_resources[] = {+#if 0+ [0] = {+ .start = IMX_CS4_VIRT,+ .end = IMX_CS4_VIRT + 16,+ .flags = IORESOURCE_MEM,+ },+ [1] = {+ .start = 13,+ .end = 13,+ .flags = IORESOURCE_IRQ,+ },+#endif+};++/* Put this to board specific because on some boards the ports are used as GPIO */+static struct resource sdhc1_resources[] = {+ [0] = {+ .start = 0x10013000,+ .end = 0x10013FFF,+ .flags = IORESOURCE_MEM,+ },+ [1] = {+ .start = (INT_SDHC1),+ .end = (INT_SDHC1),+ .flags = IORESOURCE_IRQ,+ },+ [2] = {+ .start = (DMA_REQ_SDHC1),+ .end = (DMA_REQ_SDHC1),+ .flags = IORESOURCE_DMA,+ },+ [3] = {+ .start = GPIO_PORTD(25),+ .end = GPIO_PORTD(25),+ .flags = IORESOURCE_GPIO,+ },+};++static struct resource cspi1_resources[] = {+ [0] = {+ .start = 0x1000E000,+ .end = 0x1000EFFF,+ .flags = IORESOURCE_MEM,+ },+ [1] = {+ .start = (INT_CSPI1),+ .end = (INT_CSPI1),+ .flags = IORESOURCE_IRQ,+ },+};+static struct resource cspi2_resources[] = {+ [0] = {+ .start = 0x1000F000,+ .end = 0x1000FFFF,+ .flags = IORESOURCE_MEM,+ },+ [1] = {+ .start = (INT_CSPI2),+ .end = (INT_CSPI2),+ .flags = IORESOURCE_IRQ,+ },+};++static struct resource cspi3_resources[] = {+ [0] = {+ .start = 0x10017000,+ .end = 0x10017FFF,+ .flags = IORESOURCE_MEM,+ },+ [1] = {+ .start = (INT_CSPI3),+ .end = (INT_CSPI3),+ .flags = IORESOURCE_IRQ,+ },+};++static struct platform_device imx21_cspi1_device = {+ .name = "imx21-cspi",+ .id = 0,+ .num_resources = ARRAY_SIZE(cspi1_resources),+ .resource = cspi1_resources,+ .dev = {+ .release = dummy_release, // not needed+ .coherent_dma_mask = 0xffffffff, + },+};++static struct platform_device imx21_cspi2_device = {+ .name = "imx21-cspi",+ .id = 1,+ .num_resources = ARRAY_SIZE(cspi2_resources),+ .resource = cspi2_resources,+ .dev = {+ .release = dummy_release, // not needed+ .coherent_dma_mask = 0xffffffff, + },+};+static struct platform_device imx21_cspi3_device = {+ .name = "imx21-cspi",+ .id = 2,+ .num_resources = ARRAY_SIZE(cspi3_resources),+ .resource = cspi3_resources,+ .dev = {+ .release = dummy_release, // not needed+ .coherent_dma_mask = 0xffffffff, + },+};++static struct platform_device imx21_sdhc1_device = {+ .name = "imx21-sdhc",+ .id = 0,+ .num_resources = ARRAY_SIZE(sdhc1_resources),+ .resource = sdhc1_resources,+ .dev = {+ .release = dummy_release, // not needed+ .coherent_dma_mask = 0xffffffff, + },+};+++static struct platform_device mx2ads_device = {+ .name = "mx2ads",+ .num_resources = ARRAY_SIZE(mx2ads_resources),+ .resource = mx2ads_resources,+};++static struct platform_device *devices[] __initdata = {+ &mx2ads_device,+ &imx21_cspi1_device,+ &imx21_cspi2_device,+ &imx21_cspi3_device,+ &imx21_sdhc1_device,+};++static u64 mx21_dmamask = 0xffffffffUL;++static void __init+mx2ads_init(void)+{+ platform_bus.coherent_dma_mask=0xffffffff;+ platform_bus.dma_mask=&mx21_dmamask;+ platform_add_devices(devices, ARRAY_SIZE(devices));+}+++MACHINE_START(MX2ADS, "Freescale i.MX21 ADS")+ /* Maintainer: Jochen Karrer */+ .phys_io = 0x10000000,+ .boot_params = 0xC0000100,+ .io_pg_offst = (io_p2v(0x10000000) >> 18) & 0xfffc,+ .map_io = imx21ads_map_io,+ .init_irq = imx21_init_irq,+ .timer = &imx21_timer,+ .init_machine = mx2ads_init,+MACHINE_ENDdiff -Nur -X linux/Documentation/dontdiff linux-2.6.18/arch/arm/mach-imx2/time.c linux-2.6.18-fs3/arch/arm/mach-imx2/time.c--- linux-2.6.18/arch/arm/mach-imx2/time.c 1970-01-01 01:00:00.000000000 +0100+++ linux-2.6.18-fs3/arch/arm/mach-imx2/time.c 2006-10-16 13:44:07.000000000 +0200@@ -0,0 +1,106 @@+/*+ * linux/arch/arm/mach-imx/time.c+ *+ * Copyright (C) 2000-2001 Deep Blue Solutions+ * Copyright (C) 2002 Shane Nay (shane@minirl.com)+ * Copyright (C) 2006 Jochen Karrer (jk06@jkarrer.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.+ */+#include <linux/config.h>+#include <linux/kernel.h>+#include <linux/sched.h>+#include <linux/init.h>+#include <linux/interrupt.h>+#include <linux/irq.h>+#include <linux/time.h>++#include <asm/hardware.h>+#include <asm/io.h>+#include <asm/leds.h>+#include <asm/irq.h>+#include <asm/mach/time.h>+#include <asm/arch/pll.h>++/* system timer reference clock, in Hz */+#define REFCLK (32768)++/* timer counter value, to get an interrupt every HZ */+#define TIMER_RELOAD (REFCLK/HZ)++/* conversion from timer counter values to microseconds */+#define TICKS2USECS(x) ((x) * 1000000 / REFCLK)++static irqreturn_t+imx21_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)+{+ write_seqlock(&xtime_lock);++ if( GPT_TSTAT(1) & GPT_TSTAT_COMP)+ GPT_TSTAT(1) = GPT_TSTAT_COMP; /* write 1 to clear (does not work with TO11) */++ timer_tick(regs);+ write_sequnlock(&xtime_lock);++ return IRQ_HANDLED;+}++/* Use timer 1 as system timer */++/*+ * Returns number of us since last clock interrupt. Note that interrupts+ * will have been disabled by do_gettimeoffset()+ */+static unsigned long +imx21_gettimeoffset(void)+{+ unsigned long ticks;++ /*+ * Get the current number of ticks. Note that there is a race+ * condition between us reading the timer and checking for+ * an interrupt. We get around this by ensuring that the+ * counter h
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -