📄 2.6.20-at91.patch
字号:
@@ -128,7 +128,7 @@ #if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE) static u64 eth_dmamask = 0xffffffffUL;-static struct eth_platform_data eth_data;+static struct at91_eth_data eth_data; static struct resource eth_resources[] = { [0] = {@@ -155,7 +155,7 @@ .num_resources = ARRAY_SIZE(eth_resources), }; -void __init at91_add_device_eth(struct eth_platform_data *data)+void __init at91_add_device_eth(struct at91_eth_data *data) { if (!data) return;@@ -192,7 +192,7 @@ platform_device_register(&at91sam9260_eth_device); } #else-void __init at91_add_device_eth(struct eth_platform_data *data) {}+void __init at91_add_device_eth(struct at91_eth_data *data) {} #endif @@ -229,7 +229,7 @@ .num_resources = ARRAY_SIZE(mmc_resources), }; -void __init at91_add_device_mmc(struct at91_mmc_data *data)+void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) { if (!data) return;@@ -275,7 +275,7 @@ platform_device_register(&at91sam9260_mmc_device); } #else-void __init at91_add_device_mmc(struct at91_mmc_data *data) {}+void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {} #endif @@ -515,6 +515,10 @@ void __init at91_init_leds(u8 cpu_led, u8 timer_led) {+ /* Enable GPIO to access the LEDs */+ at91_set_gpio_output(cpu_led, 1);+ at91_set_gpio_output(timer_led, 1);+ at91_leds_cpu = cpu_led; at91_leds_timer = timer_led; }@@ -523,6 +527,32 @@ #endif +#if defined(CONFIG_NEW_LEDS)++static struct platform_device at91_leds = {+ .name = "at91_leds",+ .id = -1,+};++void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr)+{+ if (!nr)+ return;++ at91_leds.dev.platform_data = leds;++ for ( ; nr; nr--, leds++) {+ leds->index = nr; /* first record stores number of leds */+ at91_set_gpio_output(leds->gpio, (leds->flags & 1) == 0);+ }++ platform_device_register(&at91_leds);+}+#else+void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr) {}+#endif++ /* -------------------------------------------------------------------- * UART * -------------------------------------------------------------------- */diff -urN -x CVS linux-2.6.20.orig/arch/arm/mach-at91rm9200/at91sam9261.c linux-2.6/arch/arm/mach-at91rm9200/at91sam9261.c--- linux-2.6.20.orig/arch/arm/mach-at91rm9200/at91sam9261.c Fri Feb 9 09:25:58 2007+++ linux-2.6/arch/arm/mach-at91rm9200/at91sam9261.c Tue Feb 6 11:02:36 2007@@ -97,6 +97,21 @@ .pmc_mask = 1 << AT91SAM9261_ID_SPI1, .type = CLK_TYPE_PERIPHERAL, };+static struct clk tc0_clk = {+ .name = "tc0_clk",+ .pmc_mask = 1 << AT91SAM9261_ID_TC0,+ .type = CLK_TYPE_PERIPHERAL,+};+static struct clk tc1_clk = {+ .name = "tc1_clk",+ .pmc_mask = 1 << AT91SAM9261_ID_TC1,+ .type = CLK_TYPE_PERIPHERAL,+};+static struct clk tc2_clk = {+ .name = "tc2_clk",+ .pmc_mask = 1 << AT91SAM9261_ID_TC2,+ .type = CLK_TYPE_PERIPHERAL,+}; static struct clk ohci_clk = { .name = "ohci_clk", .pmc_mask = 1 << AT91SAM9261_ID_UHP,@@ -121,7 +136,9 @@ &spi0_clk, &spi1_clk, // ssc 0 .. ssc2- // tc0 .. tc2+ &tc0_clk,+ &tc1_clk,+ &tc2_clk, &ohci_clk, &lcdc_clk, // irq0 .. irq2@@ -208,7 +225,7 @@ static void at91sam9261_reset(void) {- at91_sys_write(AT91_RSTC_CR, (0xA5 << 24) | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);+ at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); } diff -urN -x CVS linux-2.6.20.orig/arch/arm/mach-at91rm9200/at91sam9261_devices.c linux-2.6/arch/arm/mach-at91rm9200/at91sam9261_devices.c--- linux-2.6.20.orig/arch/arm/mach-at91rm9200/at91sam9261_devices.c Fri Feb 9 09:25:58 2007+++ linux-2.6/arch/arm/mach-at91rm9200/at91sam9261_devices.c Tue Feb 6 12:39:33 2007@@ -159,7 +159,7 @@ .num_resources = ARRAY_SIZE(mmc_resources), }; -void __init at91_add_device_mmc(struct at91_mmc_data *data)+void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) { if (!data) return;@@ -192,7 +192,7 @@ platform_device_register(&at91sam9261_mmc_device); } #else-void __init at91_add_device_mmc(struct at91_mmc_data *data) {}+void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {} #endif @@ -513,6 +513,10 @@ void __init at91_init_leds(u8 cpu_led, u8 timer_led) {+ /* Enable GPIO to access the LEDs */+ at91_set_gpio_output(cpu_led, 1);+ at91_set_gpio_output(timer_led, 1);+ at91_leds_cpu = cpu_led; at91_leds_timer = timer_led; }@@ -521,6 +525,32 @@ #endif +#if defined(CONFIG_NEW_LEDS)++static struct platform_device at91_leds = {+ .name = "at91_leds",+ .id = -1,+};++void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr)+{+ if (!nr)+ return;++ at91_leds.dev.platform_data = leds;++ for ( ; nr; nr--, leds++) {+ leds->index = nr; /* first record stores number of leds */+ at91_set_gpio_output(leds->gpio, (leds->flags & 1) == 0);+ }++ platform_device_register(&at91_leds);+}+#else+void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr) {}+#endif++ /* -------------------------------------------------------------------- * UART * -------------------------------------------------------------------- */diff -urN -x CVS linux-2.6.20.orig/arch/arm/mach-at91rm9200/at91sam9263.c linux-2.6/arch/arm/mach-at91rm9200/at91sam9263.c--- linux-2.6.20.orig/arch/arm/mach-at91rm9200/at91sam9263.c Thu Jan 1 02:00:00 1970+++ linux-2.6/arch/arm/mach-at91rm9200/at91sam9263.c Tue Feb 6 12:35:16 2007@@ -0,0 +1,313 @@+/*+ * arch/arm/mach-at91rm9200/at91sam9263.c+ *+ * Copyright (C) 2007 Atmel Corporation.+ *+ * This program is free software; you can redistribute it and/or modify+ * it under the terms of the GNU General Public License as published by+ * the Free Software Foundation; either version 2 of the License, or+ * (at your option) any later version.+ *+ */++#include <linux/module.h>++#include <asm/mach/arch.h>+#include <asm/mach/map.h>+#include <asm/arch/at91sam9263.h>+#include <asm/arch/at91_pmc.h>+#include <asm/arch/at91_rstc.h>++#include "generic.h"+#include "clock.h"++static struct map_desc at91sam9263_io_desc[] __initdata = {+ {+ .virtual = AT91_VA_BASE_SYS,+ .pfn = __phys_to_pfn(AT91_BASE_SYS),+ .length = SZ_16K,+ .type = MT_DEVICE,+ }, {+ .virtual = AT91_IO_VIRT_BASE - AT91SAM9263_SRAM0_SIZE,+ .pfn = __phys_to_pfn(AT91SAM9263_SRAM0_BASE),+ .length = AT91SAM9263_SRAM0_SIZE,+ .type = MT_DEVICE,+ }, {+ .virtual = AT91_IO_VIRT_BASE - AT91SAM9263_SRAM0_SIZE - AT91SAM9263_SRAM1_SIZE,+ .pfn = __phys_to_pfn(AT91SAM9263_SRAM1_BASE),+ .length = AT91SAM9263_SRAM1_SIZE,+ .type = MT_DEVICE,+ },+};++/* --------------------------------------------------------------------+ * Clocks+ * -------------------------------------------------------------------- */++/*+ * The peripheral clocks.+ */+static struct clk pioA_clk = {+ .name = "pioA_clk",+ .pmc_mask = 1 << AT91SAM9263_ID_PIOA,+ .type = CLK_TYPE_PERIPHERAL,+};+static struct clk pioB_clk = {+ .name = "pioB_clk",+ .pmc_mask = 1 << AT91SAM9263_ID_PIOB,+ .type = CLK_TYPE_PERIPHERAL,+};+static struct clk pioCDE_clk = {+ .name = "pioCDE_clk",+ .pmc_mask = 1 << AT91SAM9263_ID_PIOCDE,+ .type = CLK_TYPE_PERIPHERAL,+};+static struct clk usart0_clk = {+ .name = "usart0_clk",+ .pmc_mask = 1 << AT91SAM9263_ID_US0,+ .type = CLK_TYPE_PERIPHERAL,+};+static struct clk usart1_clk = {+ .name = "usart1_clk",+ .pmc_mask = 1 << AT91SAM9263_ID_US1,+ .type = CLK_TYPE_PERIPHERAL,+};+static struct clk usart2_clk = {+ .name = "usart2_clk",+ .pmc_mask = 1 << AT91SAM9263_ID_US2,+ .type = CLK_TYPE_PERIPHERAL,+};+static struct clk mmc0_clk = {+ .name = "mci0_clk",+ .pmc_mask = 1 << AT91SAM9263_ID_MCI0,+ .type = CLK_TYPE_PERIPHERAL,+};+static struct clk mmc1_clk = {+ .name = "mci1_clk",+ .pmc_mask = 1 << AT91SAM9263_ID_MCI1,+ .type = CLK_TYPE_PERIPHERAL,+};+static struct clk twi_clk = {+ .name = "twi_clk",+ .pmc_mask = 1 << AT91SAM9263_ID_TWI,+ .type = CLK_TYPE_PERIPHERAL,+};+static struct clk spi0_clk = {+ .name = "spi0_clk",+ .pmc_mask = 1 << AT91SAM9263_ID_SPI0,+ .type = CLK_TYPE_PERIPHERAL,+};+static struct clk spi1_clk = {+ .name = "spi1_clk",+ .pmc_mask = 1 << AT91SAM9263_ID_SPI1,+ .type = CLK_TYPE_PERIPHERAL,+};+static struct clk tcb_clk = {+ .name = "tcb_clk",+ .pmc_mask = 1 << AT91SAM9263_ID_TCB,+ .type = CLK_TYPE_PERIPHERAL,+};+static struct clk ether_clk = {+ .name = "ether_clk",+ .pmc_mask = 1 << AT91SAM9263_ID_EMAC,+ .type = CLK_TYPE_PERIPHERAL,+};+static struct clk udc_clk = {+ .name = "udc_clk",+ .pmc_mask = 1 << AT91SAM9263_ID_UDP,+ .type = CLK_TYPE_PERIPHERAL,+};+static struct clk isi_clk = {+ .name = "isi_clk",+ .pmc_mask = 1 << AT91SAM9263_ID_ISI,+ .type = CLK_TYPE_PERIPHERAL,+};+static struct clk lcdc_clk = {+ .name = "lcdc_clk",+ .pmc_mask = 1 << AT91SAM9263_ID_ISI,+ .type = CLK_TYPE_PERIPHERAL,+};+static struct clk ohci_clk = {+ .name = "ohci_clk",+ .pmc_mask = 1 << AT91SAM9263_ID_UHP,+ .type = CLK_TYPE_PERIPHERAL,+};++static struct clk *periph_clocks[] __initdata = {+ &pioA_clk,+ &pioB_clk,+ &pioCDE_clk,+ &usart0_clk,+ &usart1_clk,+ &usart2_clk,+ &mmc0_clk,+ &mmc1_clk,+ // can+ &twi_clk,+ &spi0_clk,+ &spi1_clk,+ // ssc0 .. ssc1+ // ac97+ &tcb_clk,+ // pwmc+ ðer_clk,+ // 2dge+ &udc_clk,+ &isi_clk,+ &lcdc_clk,+ // dma+ &ohci_clk,+ // irq0 .. irq1+};++/*+ * The four programmable clocks.+ * You must configure pin multiplexing to bring these signals out.+ */+static struct clk pck0 = {+ .name = "pck0",+ .pmc_mask = AT91_PMC_PCK0,+ .type = CLK_TYPE_PROGRAMMABLE,+ .id = 0,+};+static struct clk pck1 = {+ .name = "pck1",+ .pmc_mask = AT91_PMC_PCK1,+ .type = CLK_TYPE_PROGRAMMABLE,+ .id = 1,+};+static struct clk pck2 = {+ .name = "pck2",+ .pmc_mask = AT91_PMC_PCK2,+ .type = CLK_TYPE_PROGRAMMABLE,+ .id = 2,+};+static struct clk pck3 = {+ .name = "pck3",+ .pmc_mask = AT91_PMC_PCK3,+ .type = CLK_TYPE_PROGRAMMABLE,+ .id = 3,+};++static void __init at91sam9263_register_clocks(void)+{+ int i;++ for (i = 0; i < ARRAY_SIZE(periph_clocks); i++)+ clk_register(periph_clocks[i]);++ clk_register(&pck0);+ clk_register(&pck1);+ clk_register(&pck2);+ clk_register(&pck3);+}++/* --------------------------------------------------------------------+ * GPIO+ * -------------------------------------------------------------------- */++static struct at91_gpio_bank at91sam9263_gpio[] = {+ {+ .id = AT91SAM9263_ID_PIOA,+ .offset = AT91_PIOA,+ .clock = &pioA_clk,+ }, {+ .id = AT91SAM9263_ID_PIOB,+ .offset = AT91_PIOB,+ .clock = &pioB_clk,+ }, {+ .id = AT91SAM9263_ID_PIOCDE,+ .offset = AT91_PIOC,+ .clock = &pioCDE_clk,+ }, {+ .id = AT91SAM9263_ID_PIOCDE,+ .offset = AT91_PIOD,+ .clock = &pioCDE_clk,+ }, {+ .id = AT91SAM9263_ID_PIOCDE,+ .offset = AT91_PIOE,+ .clock = &pioCDE_clk,+ }+};++static void at91sam9263_reset(void)+{+ at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);+}+++/* --------------------------------------------------------------------+ * AT91SAM9263 processor initialization+ * -------------------------------------------------------------------- */++void __init at91sam9263_initialize(unsigned long main_clock)+{+ /* Map peripherals */+ iotable_init(at91sam9263_io_desc, ARRAY_SIZE(at91sam9263_io_desc));++ at91_arch_reset = at91sam9263_reset;+ at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1);++ /* Init clock subsystem */+ at91_clock_init(main_clock);++ /* Register the processor-specific clocks */+ at91sam9263_register_clocks();++ /* Register GPIO subsystem */+ at91_gpio_init(at91sam9263_gpio, 5);+}++/* --------------------------------------------------------------------+ * Interrupt initialization+ * -------------------------------------------------------------------- */++/*+ * The default interrupt priority levels (0 = lowest, 7 = highest).+ */+static unsigned int at91sam9263_default_irq_priority[NR_AIC_IRQS] __initdata = {+ 7, /* Advanced Interrupt Controller (FIQ) */+ 7, /* System Peripherals */+ 0, /* Parallel IO Controller A */+ 0, /* Parallel IO Controller B */+ 0, /* Parallel IO Controller C, D and E */+ 0,+ 0,+ 6, /* USART 0 */+ 6, /* USART 1 */+ 6, /* USART 2 */+ 0, /* Multimedia Card Interface 0 */+ 0, /* Multimedia Card Interface 1 */+ 4, /* CAN */+ 0, /* Two-Wire Interface */+ 6, /* Serial Peripheral Interface 0 */+ 6, /* Serial Peripheral Interface 1 */+ 5, /* Serial Synchronous Controller 0 */+ 5, /* Serial Synchronous Controller 1 */+ 6, /* AC97 Controller */+ 0, /* Timer Counter 0, 1 and 2 */+ 0, /* Pulse Width Modulation Controller */+ 3, /* Ethernet */+ 0,+ 0, /* 2D Graphic Engine */+ 3, /* USB Device Port */+ 0, /* Image Sensor Interface */+ 3, /* LDC Controller */+ 0, /* DMA Controller */+ 0,+ 3, /* USB Host port */+ 0, /* Advanced Interrupt Controller (IRQ0) */+ 0, /* Advanced Interrupt Controller (IRQ1) */+};++void __init at91sam9263_init_interrupts(unsigned int priority[NR_AIC_IRQS])+{+ if (!priority)+ priority = at91sam9263_default_irq_priority;++ /* Initialize the AIC interrupt controller */+ at91_aic_init(priority);++ /* Enable GPIO interrupts */+ at91_gpio_irq_setup();+}diff -urN -x CVS linux-2.6.20.orig/arch/arm/mach-at91rm9200/at91sam9263_devices.c linux-2.6/arch/arm/mach-at91rm9200/at91sam9263_devices.c--- linux-2.6.20.orig/arch/arm/mach-at91rm9200/at91sam9263_devices.c Thu Jan 1 02:00:00 1970+++ linux-2.6/arch/arm/mach-at91rm9200/at91sam9263_devices.c Wed Feb 7 17:14:27 2007@@ -0,0 +1,844 @@+/*+ * arch/arm/mach-at91rm9200/at91sam9263_devices.c+ *+ * Copyright (C) 2007 Atmel Corporation.+ *+ * This program is free software; you can redistribute it and/or modify+ * it under the terms of the GNU General Public License as published by
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -