--- linux-2.6.20.orig/arch/arm/mach-at91rm9200/board-ecbat91.c 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.6.20/arch/arm/mach-at91rm9200/board-ecbat91.c 2007-02-22 01:33:44.000000000 -0500 @@ -0,0 +1,118 @@ +/* + * linux/arch/arm/mach-at91rm9200/board-ecbat91.c + * Copyright (C) 2007 emQbit.com. + * + * We started from board-dk.c, which is Copyright (C) 2005 SAN People. + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include "generic.h" + +/* + * Serial port configuration. + * 0 .. 3 = USART0 .. USART3 + * 4 = DBGU + */ +static struct at91_uart_config __initdata ecb_at91uart_config = { + .console_tty = 0, /* ttyS0 */ + .nr_tty = 2, + .tty_map = { 4, 0, -1, -1, -1 } /* ttyS0, ..., ttyS4 */ +}; + +static void __init ecb_at91map_io(void) +{ + /* Initialize processor: 18.432 MHz crystal */ + at91rm9200_initialize(18432000, AT91RM9200_PQFP); + + /* Setup the LEDs */ + at91_init_leds(AT91_PIN_PC7, AT91_PIN_PC7); + + /* Setup the serial ports and console */ + at91_init_serial(&ecb_at91uart_config); +} + +static void __init ecb_at91init_irq(void) +{ + at91rm9200_init_interrupts(NULL); +} + +static struct at91_eth_data __initdata ecb_at91eth_data = { + .phy_irq_pin = AT91_PIN_PC4, + .is_rmii = 0, +}; + +static struct at91_usbh_data __initdata ecb_at91usbh_data = { + .ports = 1, +}; + +static struct at91_mmc_data __initdata ecb_at91mmc_data = { + .slot_b = 0, + .wire4 = 1, +}; + +static struct spi_board_info ecb_at91spi_devices[] = { +}; + + +static void __init ecb_at91board_init(void) +{ + /* Serial */ + at91_add_device_serial(); + + /* Ethernet */ + at91_add_device_eth(&ecb_at91eth_data); + + /* USB Host */ + at91_add_device_usbh(&ecb_at91usbh_data); + + /* SPI */ + at91_add_device_spi(ecb_at91spi_devices, ARRAY_SIZE(ecb_at91spi_devices)); + + /* MMC */ + at91_set_gpio_output(AT91_PIN_PB7, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */ + at91_add_device_mmc(&ecb_at91mmc_data); +} + +MACHINE_START(ECBAT91, "emQbit's ECB_AT91 V1") + /* Maintainer: Emqbit.com */ + .phys_io = AT91_BASE_SYS, + .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc, + .boot_params = AT91_SDRAM_BASE + 0x100, + .timer = &at91rm9200_timer, + .map_io = ecb_at91map_io, + .init_irq = ecb_at91init_irq, + .init_machine = ecb_at91board_init, +MACHINE_END --- linux-2.6.20.orig/arch/arm/mach-at91rm9200/Kconfig 2007-02-04 13:44:54.000000000 -0500 +++ linux-2.6.20/arch/arm/mach-at91rm9200/Kconfig 2007-02-22 01:29:45.000000000 -0500 @@ -43,6 +43,14 @@ Select this if you are using Atmel's AT91RM9200-EK Evaluation Kit. +config MACH_ECBAT91 + bool "emQbit ECB_AT91-V1 Single Board Computer" + depends on ARCH_AT91RM9200 + help + Select this if you are using emQbit's ECB_AT91 (V1) Single Board Computer. + The ECB_AT91 (V1) is Open Hardware. + + config MACH_CSB337 bool "Cogent CSB337" depends on ARCH_AT91RM9200 @@ -122,7 +130,7 @@ config MTD_AT91_DATAFLASH_CARD bool "Enable DataFlash Card support" - depends on (ARCH_AT91RM9200DK || MACH_AT91RM9200EK || MACH_AT91SAM9260EK || MACH_AT91SAM9261EK) + depends on (ARCH_AT91RM9200DK || MACH_AT91RM9200EK || MACH_AT91SAM9260EK || MACH_AT91SAM9261EK || MACH_ECBAT91) help Enable support for the DataFlash card. --- linux-2.6.20.orig/arch/arm/mach-at91rm9200/Makefile 2007-02-04 13:44:54.000000000 -0500 +++ linux-2.6.20/arch/arm/mach-at91rm9200/Makefile 2007-02-22 01:29:45.000000000 -0500 @@ -24,6 +24,8 @@ obj-$(CONFIG_MACH_KB9200) += board-kb9202.o obj-$(CONFIG_MACH_ATEB9200) += board-eb9200.o obj-$(CONFIG_MACH_KAFA) += board-kafa.o +obj-$(CONFIG_MACH_ECBAT91) += board-ecbat91.o + # AT91SAM9260 board-specific support obj-$(CONFIG_MACH_AT91SAM9260EK) += board-sam9260ek.o @@ -38,6 +40,7 @@ led-$(CONFIG_MACH_CSB637) += leds.o led-$(CONFIG_MACH_KB9200) += leds.o led-$(CONFIG_MACH_KAFA) += leds.o +led-$(CONFIG_MACH_ECBAT91) += leds.o obj-$(CONFIG_LEDS) += $(led-y) # VGA support --- linux-2.6.20.orig/drivers/net/arm/at91_ether.c 2007-02-04 13:44:54.000000000 -0500 +++ linux-2.6.20/drivers/net/arm/at91_ether.c 2007-02-22 01:29:45.000000000 -0500 @@ -1005,9 +1005,9 @@ read_phy(phy_address, MII_DSCR_REG, &val); if ((val & (1 << 10)) == 0) /* DSCR bit 10 is 0 -- fiber mode */ lp->phy_media = PORT_FIBRE; - } else if (machine_is_csb337()) { + } else if (machine_is_csb337()||machine_is_ecbat91()) { /* mix link activity status into LED2 link state */ - write_phy(phy_address, MII_LEDCTRL_REG, 0x0d22); + write_phy(phy_address, MII_LEDCTRL_REG, 0x156A); } disable_mdi(); spin_unlock_irq(&lp->lock); --- linux-2.6.20.orig/drivers/mmc/mmc.c 2007-02-04 13:44:54.000000000 -0500 +++ linux-2.6.20/drivers/mmc/mmc.c 2007-02-22 01:39:29.000000000 -0500 @@ -25,6 +25,8 @@ #include #include +#include + #include "mmc.h" #define CMD_RETRIES 3 @@ -1401,11 +1403,14 @@ mmc_read_csds(host); - if (host->mode == MMC_MODE_SD) { - mmc_read_scrs(host); - mmc_read_switch_caps(host); - } else - mmc_process_ext_csds(host); + if (!machine_is_ecbat91()) + { + if (host->mode == MMC_MODE_SD) { + mmc_read_scrs(host); + mmc_read_switch_caps(host); + } else + mmc_process_ext_csds(host); + } } --- linux-2.6.20.orig/drivers/mmc/mmc_block.c 2007-02-04 13:44:54.000000000 -0500 +++ linux-2.6.20/drivers/mmc/mmc_block.c 2007-02-22 01:36:54.000000000 -0500 @@ -40,6 +40,8 @@ #include "mmc_queue.h" +#include + /* * max 8 partitions per card */ @@ -253,7 +255,12 @@ * this rule as they support querying the number of * successfully written sectors. */ - if (rq_data_dir(req) != READ && + if (machine_is_ecbat91()) + { + if (rq_data_dir(req) != READ) + brq.data.blocks = 1; + } + else if (rq_data_dir(req) != READ && !(card->host->caps & MMC_CAP_MULTIWRITE) && !mmc_card_sd(card)) brq.data.blocks = 1; --- linux-2.6.20.orig/drivers/mmc/at91_mci.c 2007-02-04 13:44:54.000000000 -0500 +++ linux-2.6.20/drivers/mmc/at91_mci.c 2007-02-22 01:38:52.000000000 -0500 @@ -76,6 +76,7 @@ #include #include #include +#include #define DRIVER_NAME "at91_mci" @@ -421,7 +422,7 @@ if (cmd->opcode == MMC_STOP_TRANSMISSION) cmdr |= AT91_MCI_TRCMD_STOP; - if (host->bus_mode == MMC_BUSMODE_OPENDRAIN) + if (!machine_is_ecbat91() && host->bus_mode == MMC_BUSMODE_OPENDRAIN) cmdr |= AT91_MCI_OPDCMD; /* @@ -741,7 +742,12 @@ at91_mci_write(host, AT91_MCI_IDR, 0xffffffff); at91mci_completed_command(host); } else - at91_mci_write(host, AT91_MCI_IDR, int_status); + { + if (machine_is_ecbat91()) + at91_mci_write(host, AT91_MCI_IDR, (int_status & ~AT91_MCI_TXRDY) ); + else + at91_mci_write(host, AT91_MCI_IDR, int_status); + } return IRQ_HANDLED; }