[oe-commits] org.oe.dev linux: added Sarge-AT91 support (based on original submission kernel)
hrw commit
openembedded-commits at lists.openembedded.org
Tue Jul 3 17:05:52 UTC 2007
linux: added Sarge-AT91 support (based on original submission kernel)
Author: hrw at openembedded.org
Branch: org.openembedded.dev
Revision: a7fa35e327df09fbfeb966e56cbf8cb41045d32a
ViewMTN: http://monotone.openembedded.org/revision.psp?id=a7fa35e327df09fbfeb966e56cbf8cb41045d32a
Files:
1
packages/linux/linux/sarge-at91
packages/linux/linux/sarge-at91/2.6.21-sarge-kernel.patch
packages/linux/linux/sarge-at91/2.6.21-sarge-mmc.patch
packages/linux/linux/sarge-at91/2.6.21-sarge-phy.patch
packages/linux/linux/sarge-at91/defconfig
packages/linux/linux.inc
packages/linux/linux_2.6.21.bb
Diffs:
#
# mt diff -r0b32061e628e98ff33f00d7c506ec4c525ecc616 -ra7fa35e327df09fbfeb966e56cbf8cb41045d32a
#
#
#
# add_dir "packages/linux/linux/sarge-at91"
#
# add_file "packages/linux/linux/sarge-at91/2.6.21-sarge-kernel.patch"
# content [214f7346ed9238c8e7169504a486dd0d9b8e8f6d]
#
# add_file "packages/linux/linux/sarge-at91/2.6.21-sarge-mmc.patch"
# content [bf050035be44127be85f7e032a598eedf4633167]
#
# add_file "packages/linux/linux/sarge-at91/2.6.21-sarge-phy.patch"
# content [9260941cf7e54b07a87e8ffda492d2ff9a25a460]
#
# add_file "packages/linux/linux/sarge-at91/defconfig"
# content [887a1501d7a72435df8b09c025425ef867d22132]
#
# patch "packages/linux/linux.inc"
# from [571ad2731ad0b3d6172a72c2f807cbcc9bb6c840]
# to [8f12fd2369efd20b4d92e7d66a7ee05da953bd98]
#
# patch "packages/linux/linux_2.6.21.bb"
# from [53a97580492f0de948ef1e7ef160f429dc8a1408]
# to [b173c031d2b38c69861aac233b95eb1254d0c9ed]
#
============================================================
--- packages/linux/linux/sarge-at91/2.6.21-sarge-kernel.patch 214f7346ed9238c8e7169504a486dd0d9b8e8f6d
+++ packages/linux/linux/sarge-at91/2.6.21-sarge-kernel.patch 214f7346ed9238c8e7169504a486dd0d9b8e8f6d
@@ -0,0 +1,238 @@
+diff -Nurp ../linux-2.6.21.4/arch/arm/boot/compressed/head-at91rm9200.S ./arch/arm/boot/compressed/head-at91rm9200.S
+--- ../linux-2.6.21.4/arch/arm/boot/compressed/head-at91rm9200.S 2007-06-12 22:29:12.000000000 +0200
++++ ./arch/arm/boot/compressed/head-at91rm9200.S 2007-06-12 02:57:07.000000000 +0200
+@@ -73,6 +73,12 @@
+ cmp r7, r3
+ beq 99f
+
++ @ AT91RM9200
++ mov r3, #(MACH_TYPE_AT91RM9200 & 0xff)
++ orr r3, r3, #(MACH_TYPE_AT91RM9200 & 0xff00)
++ cmp r7, r3
++ beq 99f
++
+ @ Unknown board, use the AT91RM9200DK board
+ @ mov r7, #MACH_TYPE_AT91RM9200
+ mov r7, #(MACH_TYPE_AT91RM9200DK & 0xff)
+diff -Nurp ../linux-2.6.21.4/arch/arm/mach-at91/board-sarge.c ./arch/arm/mach-at91/board-sarge.c
+--- ../linux-2.6.21.4/arch/arm/mach-at91/board-sarge.c 1970-01-01 01:00:00.000000000 +0100
++++ ./arch/arm/mach-at91/board-sarge.c 2007-06-12 02:57:07.000000000 +0200
+@@ -0,0 +1,190 @@
++/*
++ * linux/arch/arm/mach-at91/board-sarge.c
++ *
++ * Copyright (C) 2007 BlackMesaEast staff
++ *
++ * mcgregor at blackmesaeast.com.pl
++ *
++ * 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 <linux/types.h>
++#include <linux/init.h>
++#include <linux/mm.h>
++#include <linux/module.h>
++#include <linux/platform_device.h>
++#include <linux/spi/spi.h>
++#include <linux/mtd/physmap.h>
++
++#include <asm/hardware.h>
++#include <asm/setup.h>
++#include <asm/mach-types.h>
++#include <asm/irq.h>
++
++#include <asm/mach/arch.h>
++#include <asm/mach/map.h>
++#include <asm/mach/irq.h>
++
++#include <asm/arch/board.h>
++#include <asm/arch/gpio.h>
++#include <asm/arch/at91rm9200_mc.h>
++
++#include "generic.h"
++
++
++/*
++ * Serial port configuration.
++ * 0 .. 3 = USART0 .. USART3
++ * 4 = DBGU
++ */
++static struct at91_uart_config __initdata sarge_uart_config = {
++ .console_tty = 0, /* ttyS0 */
++ .nr_tty = 5,
++ .tty_map = { 4, 1, 0, 2, 3 } /* ttyS0, ..., ttyS4 */
++};
++
++static void __init sarge_map_io(void)
++{
++ /* Initialize processor: 18.432 MHz crystal */
++ at91rm9200_initialize(18432000, AT91RM9200_PQFP);
++
++ /* Setup the serial ports and console */
++ at91_init_serial(&sarge_uart_config);
++}
++
++static void __init sarge_init_irq(void)
++{
++ at91rm9200_init_interrupts(NULL);
++}
++
++static struct at91_eth_data __initdata sarge_eth_data = {
++ .phy_irq_pin = AT91_PIN_PB1,
++ .is_rmii = 0,
++};
++
++static struct at91_usbh_data __initdata sarge_usbh_data = {
++ .ports = 1,
++};
++
++static struct at91_udc_data __initdata sarge_udc_data = {
++ .vbus_pin = AT91_PIN_PA20,
++ .pullup_pin = AT91_PIN_PA21,
++};
++
++static struct at91_cf_data __initdata sarge_cf_data = {
++ .det_pin = AT91_PIN_PB24,
++ .rst_pin = AT91_PIN_PB23,
++ // .irq_pin = ... not connected
++ // .vcc_pin = ... always powered
++};
++
++static struct at91_mmc_data __initdata sarge_mmc_data = {
++ .det_pin = AT91_PIN_PB0,
++ .slot_b = 0,
++ .wire4 = 1,
++ .wp_pin = AT91_PIN_PB2,
++};
++
++
++
++static struct spi_board_info sarge_spi_devices[] = {
++ { /* DataFlash chip */
++ .modalias = "mtd_dataflash",
++ .chip_select = 0,
++ .max_speed_hz = 15 * 1000 * 1000,
++ }
++};
++
++static struct mtd_partition __initdata sarge_nand_partition[] = {
++ {
++ .name = "NAND Partition 1",
++ .offset = 0,
++ .size = MTDPART_SIZ_FULL,
++ },
++};
++
++static struct mtd_partition *nand_partitions(int size, int *num_partitions)
++{
++ *num_partitions = ARRAY_SIZE(sarge_nand_partition);
++ return sarge_nand_partition;
++}
++
++static struct at91_nand_data __initdata sarge_nand_data = {
++ .ale = 22,
++ .cle = 21,
++ .det_pin = AT91_PIN_PB22,
++ .rdy_pin = AT91_PIN_PB22,
++ // .enable_pin = ... not there
++ .partition_info = nand_partitions,
++};
++
++#define SARGE_FLASH_BASE AT91_CHIPSELECT_0
++#define SARGE_FLASH_SIZE 0x200000
++
++static struct physmap_flash_data sarge_flash_data = {
++ .width = 2,
++};
++
++static struct resource sarge_flash_resource = {
++ .start = SARGE_FLASH_BASE,
++ .end = SARGE_FLASH_BASE + SARGE_FLASH_SIZE - 1,
++ .flags = IORESOURCE_MEM,
++};
++
++static struct platform_device sarge_flash = {
++ .name = "physmap-flash",
++ .id = 0,
++ .dev = {
++ .platform_data = &sarge_flash_data,
++ },
++ .resource = &sarge_flash_resource,
++ .num_resources = 1,
++};
++
++static void __init sarge_board_init(void)
++{
++ /* Serial */
++ at91_add_device_serial();
++ /* Ethernet */
++ at91_add_device_eth(&sarge_eth_data);
++ /* USB Host */
++ at91_add_device_usbh(&sarge_usbh_data);
++ /* USB Device */
++ at91_add_device_udc(&sarge_udc_data);
++ at91_set_multi_drive(sarge_udc_data.pullup_pin, 1); /* pullup_pin is connected to reset */
++ /* Compact Flash */
++ at91_add_device_cf(&sarge_cf_data);
++ /* I2C */
++ at91_add_device_i2c();
++ /* SPI */
++ at91_add_device_spi(sarge_spi_devices, ARRAY_SIZE(sarge_spi_devices));
++
++ /* MMC */
++ at91_add_device_mmc(0, &sarge_mmc_data);
++ /* NAND */
++ at91_add_device_nand(&sarge_nand_data);
++ /* NOR Flash */
++ platform_device_register(&sarge_flash);
++}
++MACHINE_START(AT91RM9200, "Sarge AT91RM9200 SBC")
++ /* Maintainer: mcgregor at blackmesaeast.com.pl */
++ .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 = sarge_map_io,
++ .init_irq = sarge_init_irq,
++ .init_machine = sarge_board_init,
++MACHINE_END
+diff -Nurp ../linux-2.6.21.4/arch/arm/mach-at91/Kconfig ./arch/arm/mach-at91/Kconfig
+--- ../linux-2.6.21.4/arch/arm/mach-at91/Kconfig 2007-06-12 22:29:12.000000000 +0200
++++ ./arch/arm/mach-at91/Kconfig 2007-06-12 03:00:28.000000000 +0200
+@@ -90,6 +90,13 @@ config MACH_KAFA
+ help
+ Select this if you are using Sperry-Sun's KAFA board.
+
++config MACH_SARGE
++ bool "Black Mesa East Sarge SBC"
++ depends on ARCH_AT91RM9200
++ help
++ Select this if you are using BlackMesaEast Sarge PCB
++ <http://blackmesaeast.com.pl>
++
+ config MACH_CHUB
+ bool "Promwad Chub board"
+ depends on ARCH_AT91RM9200
+diff -Nurp ../linux-2.6.21.4/arch/arm/mach-at91/Makefile ./arch/arm/mach-at91/Makefile
+--- ../linux-2.6.21.4/arch/arm/mach-at91/Makefile 2007-06-12 22:29:12.000000000 +0200
++++ ./arch/arm/mach-at91/Makefile 2007-06-12 03:00:47.000000000 +0200
+@@ -29,6 +29,7 @@ obj-$(CONFIG_MACH_KB9200) += board-kb920
+ obj-$(CONFIG_MACH_ATEB9200) += board-eb9200.o
+ obj-$(CONFIG_MACH_KAFA) += board-kafa.o
+ obj-$(CONFIG_MACH_CHUB) += board-chub.o
++obj-$(CONFIG_MACH_SARGE) += board-sarge.o
+
+ # AT91SAM9260 board-specific support
+ obj-$(CONFIG_MACH_AT91SAM9260EK) += board-sam9260ek.o
============================================================
--- packages/linux/linux/sarge-at91/2.6.21-sarge-mmc.patch bf050035be44127be85f7e032a598eedf4633167
+++ packages/linux/linux/sarge-at91/2.6.21-sarge-mmc.patch bf050035be44127be85f7e032a598eedf4633167
@@ -0,0 +1,87 @@
+diff -Nurp ../linux-2.6.21.4/drivers/mmc/at91_mci.c ./drivers/mmc/at91_mci.c
+--- ../linux-2.6.21.4/drivers/mmc/at91_mci.c 2007-06-12 22:29:12.000000000 +0200
++++ ./drivers/mmc/at91_mci.c 2007-06-12 03:52:55.000000000 +0200
+@@ -421,8 +421,11 @@ static unsigned int at91_mci_send_comman
+ if (cmd->opcode == MMC_STOP_TRANSMISSION)
+ cmdr |= AT91_MCI_TRCMD_STOP;
+
+- if (host->bus_mode == MMC_BUSMODE_OPENDRAIN)
+- cmdr |= AT91_MCI_OPDCMD;
++ //if (host->bus_mode == MMC_BUSMODE_OPENDRAIN)
++ // cmdr |= AT91_MCI_OPDCMD;
++
++ if (!(1/**machine_is_sarge*/) && host->bus_mode == MMC_BUSMODE_OPENDRAIN)
++ cmdr |= AT91_MCI_OPDCMD;
+
+ /*
+ * Set the arguments and send the command
+@@ -739,7 +742,13 @@ static irqreturn_t at91_mci_irq(int irq,
+ at91_mci_write(host, AT91_MCI_IDR, 0xffffffff);
+ at91mci_completed_command(host);
+ } else
++// at91_mci_write(host, AT91_MCI_IDR, int_status);
++ {
++ if (1 /*machine_is_sarge()*/)
++ 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;
+ }
+diff -Nurp ../linux-2.6.21.4/drivers/mmc/mmc_block.c ./drivers/mmc/mmc_block.c
+--- ../linux-2.6.21.4/drivers/mmc/mmc_block.c 2007-06-07 23:27:31.000000000 +0200
++++ ./drivers/mmc/mmc_block.c 2007-06-12 04:19:36.000000000 +0200
+@@ -256,10 +256,24 @@ static int mmc_blk_issue_rq(struct mmc_q
+ * this rule as they support querying the number of
+ * successfully written sectors.
+ */
+- if (rq_data_dir(req) != READ &&
++// if (rq_data_dir(req) != READ &&
++ if ((1/**machine_is_sarge*/))
++ {
++ 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;
++
++
++
++
++
++
++
+
+ if (brq.data.blocks > 1) {
+ brq.data.flags |= MMC_DATA_MULTI;
+diff -Nurp ../linux-2.6.21.4/drivers/mmc/mmc.c ./drivers/mmc/mmc.c
+--- ../linux-2.6.21.4/drivers/mmc/mmc.c 2007-06-07 23:27:31.000000000 +0200
++++ ./drivers/mmc/mmc.c 2007-06-12 04:10:05.000000000 +0200
+@@ -1500,12 +1500,22 @@ static void mmc_setup(struct mmc_host *h
+ mmc_set_ios(host);
+
+ 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 (!(1/*machine_is_sarge*/))
++ {
++ if (host->mode == MMC_MODE_SD) {
++ mmc_read_scrs(host);
++ mmc_read_switch_caps(host);
++ } else
++ mmc_process_ext_csds(host);
++ }
+ }
+
+
============================================================
--- packages/linux/linux/sarge-at91/2.6.21-sarge-phy.patch 9260941cf7e54b07a87e8ffda492d2ff9a25a460
+++ packages/linux/linux/sarge-at91/2.6.21-sarge-phy.patch 9260941cf7e54b07a87e8ffda492d2ff9a25a460
@@ -0,0 +1,400 @@
+diff -Nurp ../linux-2.6.21.4/drivers/net/arm/at91_ether.c ./drivers/net/arm/at91_ether.c
+--- ../linux-2.6.21.4/drivers/net/arm/at91_ether.c 2007-06-12 22:29:12.000000000 +0200
++++ ./drivers/net/arm/at91_ether.c 2007-06-12 03:11:16.000000000 +0200
+@@ -235,6 +235,11 @@ static irqreturn_t at91ether_phy_interru
+ if (!(phy & (1 << 7)))
+ goto done;
+ }
++ else if (lp->phy_type == MII_STE100P_ID) {
++ read_phy(lp->phy_address, MII_STE100P_XCSIIS_REG, &phy); /* ack interrupt in STE100P PHY */
++ if (!(phy & 0x007F))
++ goto done;
++ }
+
+ update_linkspeed(dev, 0);
+
+@@ -303,6 +308,11 @@ static void enable_phyirq(struct net_dev
+ dsintr = dsintr | 0x3; /* set bits 0,1 */
+ write_phy(lp->phy_address, MII_DPMICR_REG, dsintr);
+ }
++ else if (lp->phy_type == MII_STE100P_ID) { /* for STE100P PHY */
++ read_phy(lp->phy_address, MII_STE100P_XIE_REG, &dsintr);
++
++ dsintr |= 0x007F;
++ }
+
+ disable_mdi();
+ spin_unlock_irq(&lp->lock);
+@@ -359,6 +369,11 @@ static void disable_phyirq(struct net_de
+ dsintr = dsintr & ~0x3c; /* clear bits 2..5 */
+ write_phy(lp->phy_address, MII_DPMISR_REG, dsintr);
+ }
++ else if (lp->phy_type == MII_STE100P_ID) { /* for STE100P PHY */
++ read_phy(lp->phy_address, MII_STE100P_XIE_REG, &dsintr);
++ dsintr &= 0xFF80;
++ write_phy(lp->phy_address, MII_STE100P_XIE_REG, dsintr);
++ }
+
+ disable_mdi();
+ spin_unlock_irq(&lp->lock);
+@@ -1117,6 +1132,8 @@ static int __init at91ether_setup(unsign
+ printk(KERN_INFO "%s: Teridian 78Q21x3 PHY\n", dev->name);
+ else if (phy_type == MII_LAN83C185_ID)
+ printk(KERN_INFO "%s: SMSC LAN83C185 PHY\n", dev->name);
++ else if (phy_type == MII_STE100P_ID)
++ printk(KERN_INFO "%s: STE100P PHY\n", dev->name);
+
+ return 0;
+ }
+@@ -1159,6 +1176,7 @@ static int __init at91ether_probe(struct
+ case MII_KS8721_ID: /* Micrel KS8721: PHY_ID1 = 0x22, PHY_ID2 = 0x1610 */
+ case MII_T78Q21x3_ID: /* Teridian 78Q21x3: PHY_ID1 = 0x0E, PHY_ID2 = 7237 */
+ case MII_LAN83C185_ID: /* SMSC LAN83C185: PHY_ID1 = 0x0007, PHY_ID2 = 0xC0A1 */
++ case MII_STE100P_ID: /* STE100P: PHY_ID1 = 0x1C04, PHY_ID2 = 0x0000 */
+ detected = at91ether_setup(phy_id, phy_address, pdev, ether_clk);
+ break;
+ }
+diff -Nurp ../linux-2.6.21.4/drivers/net/arm/at91_ether.h ./drivers/net/arm/at91_ether.h
+--- ../linux-2.6.21.4/drivers/net/arm/at91_ether.h 2007-06-12 22:29:12.000000000 +0200
++++ ./drivers/net/arm/at91_ether.h 2007-06-12 03:07:54.000000000 +0200
+@@ -29,6 +29,15 @@
+ #define MII_ISINTS_REG 19
+ #define MII_LEDCTRL_REG 20
+
++/* STE100P specific registers */
++#define MII_STE100P_XCSIIS_REG 0x11
++#define MII_STE100P_XIE_REG 0x12
++#define MII_XCR_REG 0x00
++#define MII_XCR_ISOLATE 0x0400
++
++/* STE100P PHY */
++#define MII_STE100P_ID 0x1c040010
++
+ /* Realtek RTL8201 PHY */
+ #define MII_RTL8201_ID 0x00008200
+
+diff -Nurp ../linux-2.6.21.4/drivers/net/phy/Kconfig ./drivers/net/phy/Kconfig
+--- ../linux-2.6.21.4/drivers/net/phy/Kconfig 2007-06-07 23:27:31.000000000 +0200
++++ ./drivers/net/phy/Kconfig 2007-06-12 03:12:16.000000000 +0200
+@@ -62,6 +62,12 @@ config BROADCOM_PHY
+ ---help---
+ Currently supports the BCM5411, BCM5421 and BCM5461 PHYs.
+
++config STE100P_PHY
++ tristate "Drivers for the STE100P PHY"
++ depends on PHYLIB
++ ---help---
++ Currently supports the ste100p
++
+ config FIXED_PHY
+ tristate "Drivers for PHY emulation on fixed speed/link"
+ depends on PHYLIB
+diff -Nurp ../linux-2.6.21.4/drivers/net/phy/Makefile ./drivers/net/phy/Makefile
+--- ../linux-2.6.21.4/drivers/net/phy/Makefile 2007-06-07 23:27:31.000000000 +0200
++++ ./drivers/net/phy/Makefile 2007-06-12 03:12:29.000000000 +0200
+@@ -12,3 +12,4 @@ obj-$(CONFIG_SMSC_PHY) += smsc.o
+ obj-$(CONFIG_VITESSE_PHY) += vitesse.o
+ obj-$(CONFIG_BROADCOM_PHY) += broadcom.o
+ obj-$(CONFIG_FIXED_PHY) += fixed.o
++obj-$(CONFIG_STE100P_PHY) += ste100p.o
+diff -Nurp ../linux-2.6.21.4/drivers/net/phy/ste100p.c ./drivers/net/phy/ste100p.c
+--- ../linux-2.6.21.4/drivers/net/phy/ste100p.c 1970-01-01 01:00:00.000000000 +0100
++++ ./drivers/net/phy/ste100p.c 2007-06-12 02:52:31.000000000 +0200
+@@ -0,0 +1,297 @@
++/*
++ * drivers/net/phy/ste100p.c
++ *
++ * Driver for STE100P PHYs
++ *
++ * Author: Grzegorz Rajtar mcgregor at blackmesaeast.com.pl
++ *
++ * Copyright (c) 2007 Black Mesa East
++ *
++ * 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%s
>>> DIFF TRUNCATED @ 16K
More information about the Openembedded-commits
mailing list