Binary files linux-2.4.6-rmk1/Image.gz and linux/Image.gz differ diff -urN linux-2.4.6-rmk1/Makefile linux/Makefile --- linux-2.4.6-rmk1/Makefile Mon Jul 9 20:02:53 2001 +++ linux/Makefile Mon Jul 9 14:37:03 2001 @@ -1,11 +1,11 @@ VERSION = 2 PATCHLEVEL = 4 SUBLEVEL = 6 -EXTRAVERSION =-rmk1 +EXTRAVERSION =-rmk1-rayl1 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) -ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) +ARCH := arm CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ else if [ -x /bin/bash ]; then echo /bin/bash; \ @@ -18,7 +18,7 @@ HOSTCC = gcc HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -CROSS_COMPILE = +CROSS_COMPILE = arm-linux- # # Include the make variables (CC, etc...) Binary files linux-2.4.6-rmk1/Ramdisk.gz and linux/Ramdisk.gz differ diff -urN linux-2.4.6-rmk1/arch/arm/Makefile linux/arch/arm/Makefile --- linux-2.4.6-rmk1/arch/arm/Makefile Mon Jul 9 20:02:53 2001 +++ linux/arch/arm/Makefile Tue Jul 10 17:38:39 2001 @@ -127,6 +127,11 @@ MACHINE = clps711x endif +ifeq ($(CONFIG_ARCH_CDB89712),y) +TEXTADDR = 0xc0028000 +MACHINE = clps711x +endif + ifeq ($(CONFIG_ARCH_ANAKIN),y) MACHINE = anakin endif @@ -237,6 +242,9 @@ i:; @$(MAKEBOOT) install zi:; @$(MAKEBOOT) zinstall bp:; @$(MAKEBOOT) bootpImage + +r: vmlinux + @$(MAKEBOOT) r # # Configuration targets. Use these to select a Binary files linux-2.4.6-rmk1/arch/arm/boot/Image.gz and linux/arch/arm/boot/Image.gz differ diff -urN linux-2.4.6-rmk1/arch/arm/boot/Makefile linux/arch/arm/boot/Makefile --- linux-2.4.6-rmk1/arch/arm/boot/Makefile Mon Jul 9 20:02:25 2001 +++ linux/arch/arm/boot/Makefile Tue Jul 10 16:48:55 2001 @@ -76,6 +76,13 @@ INITRD_VIRT = 0xc0400000 endif +ifeq ($(CONFIG_ARCH_CDB89712),y) +ZTEXTADDR = 0xc0028000 +PARAMS_PHYS = 0xc0000100 +INITRD_PHYS = 0x00700000 +INITRD_VIRT = 0xc0300000 +endif + ifeq ($(CONFIG_ARCH_SA1100),y) ZTEXTADDR = 0xc0008000 ZRELADDR = 0xc0008000 @@ -112,6 +119,11 @@ endif export SYSTEM ZTEXTADDR ZBSSADDR ZRELADDR INITRD_PHYS INITRD_VIRT PARAMS_PHYS + +r: Image + rm -f Image.gz + gzip -9 Image + cp -f Image.gz $(TOPDIR) Image: $(CONFIGURE) $(SYSTEM) $(OBJCOPY) -O binary -R .note -R .comment -S $(SYSTEM) $@ diff -urN linux-2.4.6-rmk1/arch/arm/config.in linux/arch/arm/config.in --- linux-2.4.6-rmk1/arch/arm/config.in Mon Jul 9 20:02:53 2001 +++ linux/arch/arm/config.in Mon Jul 9 15:50:13 2001 @@ -42,7 +42,7 @@ RiscPC CONFIG_ARCH_RPC \ SA1100-based CONFIG_ARCH_SA1100 \ CLPS711x/EP721x-based CONFIG_ARCH_CLPS711X \ - Anakin CONFIG_ARCH_ANAKIN" RiscPC + Anakin CONFIG_ARCH_ANAKIN" CLPS711x/EP721x-based mainmenu_option next_comment comment 'Archimedes/A5000 Implementations' @@ -107,6 +107,7 @@ mainmenu_option next_comment comment 'CLPS711X/EP721X Implementations' dep_bool ' P720T' CONFIG_ARCH_P720T $CONFIG_ARCH_CLPS711X +dep_bool ' CDB89712' CONFIG_ARCH_CDB89712 $CONFIG_ARCH_CLPS711X endmenu # Definitions to make life easier @@ -194,7 +195,9 @@ fi # ARM720T -if [ "$CONFIG_ARCH_CLPS711X" = "y" -o "$CONFIG_ARCH_L7200" = "y" ]; then +if [ "$CONFIG_ARCH_CLPS711X" = "y" -o \ + "$CONFIG_ARCH_L7200" = "y" -o \ + "$CONFIG_ARCH_CDB89712" = "y" ]; then define_bool CONFIG_CPU_ARM720T y else if [ "$CONFIG_ARCH_INTEGRATOR" = "y" ]; then @@ -286,6 +289,7 @@ if [ "$CONFIG_FOOTBRIDGE_HOST" = "y" -o \ "$CONFIG_ARCH_SHARK" = "y" -o \ "$CONFIG_ARCH_CLPS7500" = "y" -o \ + "$CONFIG_ARCH_CDB89712" = "y" -o \ "$CONFIG_ARCH_EBSA110" = "y" ]; then define_bool CONFIG_ISA y else @@ -332,6 +336,7 @@ "$CONFIG_ARCH_PERSONAL_SERVER" = "y" -o \ "$CONFIG_ARCH_CATS" = "y" -o \ "$CONFIG_ARCH_P720T" = "y" -o \ + "$CONFIG_ARCH_CDB89712" = "y" -o \ "$CONFIG_ARCH_ANAKIN" = "y" ]; then string 'Default kernel command string' CONFIG_CMDLINE "" fi @@ -343,6 +348,7 @@ "$CONFIG_ARCH_CO285" = "y" -o \ "$CONFIG_ARCH_SA1100" = "y" -o \ "$CONFIG_ARCH_INTEGRATOR" = "y" -o \ + "$CONFIG_ARCH_CDB89712" = "y" -o \ "$CONFIG_ARCH_P720T" = "y" ]; then bool 'Timer and CPU usage LEDs' CONFIG_LEDS if [ "$CONFIG_LEDS" = "y" ]; then diff -urN linux-2.4.6-rmk1/arch/arm/kernel/setup.c linux/arch/arm/kernel/setup.c --- linux-2.4.6-rmk1/arch/arm/kernel/setup.c Mon Jul 9 20:02:53 2001 +++ linux/arch/arm/kernel/setup.c Tue Jul 10 23:12:16 2001 @@ -113,6 +113,10 @@ * locate processor in the list of supported processor * types. The linker builds this table for us from the * entries in arch/arm/mm/proc-*.S + * + * __arm720_proc_info + * __arm720_setup + * arm720_processor_functions */ for (list = &__proc_info_begin; list < &__proc_info_end ; list++) if ((processor_id & list->cpu_mask) == list->cpu_val) @@ -152,6 +156,8 @@ /* * locate architecture in the list of supported architectures. + * + * cdb89712_hw_init */ for (list = &__arch_info_begin; list < &__arch_info_end; list++) if (list->nr == nr) diff -urN linux-2.4.6-rmk1/arch/arm/mach-clps711x/Makefile linux/arch/arm/mach-clps711x/Makefile --- linux-2.4.6-rmk1/arch/arm/mach-clps711x/Makefile Mon Jul 9 20:02:53 2001 +++ linux/arch/arm/mach-clps711x/Makefile Mon Jul 9 14:37:03 2001 @@ -20,6 +20,7 @@ leds-$(CONFIG_ARCH_P720T) += p720t-leds.o obj-$(CONFIG_ARCH_P720T) += p720t.o +obj-$(CONFIG_ARCH_CDB89712) += cdb89712.o obj-$(CONFIG_LEDS) += $(leds-y) include $(TOPDIR)/Rules.make diff -urN linux-2.4.6-rmk1/arch/arm/mach-clps711x/cdb89712.c linux/arch/arm/mach-clps711x/cdb89712.c --- linux-2.4.6-rmk1/arch/arm/mach-clps711x/cdb89712.c Wed Dec 31 17:00:00 1969 +++ linux/arch/arm/mach-clps711x/cdb89712.c Tue Jul 10 16:40:45 2001 @@ -0,0 +1,103 @@ +/* + * linux/arch/arm/mach-clps711x/cdb89712.c + * + * Copyright (C) 2000-2001 Deep Blue Solutions Ltd + * + * 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 + +extern void clps711x_init_irq(void); +extern void cdb89712_map_io(void); + +static void __init +fixup_cdb89712(struct machine_desc *desc, struct param_struct *params, + char **cmdline, struct meminfo *mi) +{ +#if 0 + struct tag *tag = (struct tag *)params; + char cmd[COMMAND_LINE_SIZE]; + + strncpy (cmd, params->commandline, COMMAND_LINE_SIZE); + + tag->hdr.tag = ATAG_CORE; + tag->hdr.size = tag_size(tag_core); + tag->u.core.flags = 0; + tag->u.core.pagesize = PAGE_SIZE; + tag->u.core.rootdev = 0x0100; + + /* 16 MB of SDRAM at 0xc0000000 */ + tag = tag_next(tag); + tag->hdr.tag = ATAG_MEM; + tag->hdr.size = tag_size(tag_mem32); + tag->u.mem.size = 4096; + tag->u.mem.start = PHYS_OFFSET; + + /* an initial ramdisk image in flash at 0x00700000 */ + tag = tag_next(tag); + tag->hdr.tag = ATAG_INITRD; + tag->hdr.size = tag_size(tag_initrd); + tag->u.initrd.start = 0xc0300000; + tag->u.initrd.size = 0x00200000; + + /* the command line arguments */ + tag = tag_next(tag); + tag->hdr.tag = ATAG_CMDLINE; + tag->hdr.size = (COMMAND_LINE_SIZE + 3 + + sizeof(struct tag_header)) >> 2; + strncpy(tag->u.cmdline.cmdline, cmd, COMMAND_LINE_SIZE); + + tag = tag_next(tag); + tag->hdr.tag = 0; + tag->hdr.size = 0; +#endif +} + +MACHINE_START(CDB89712, "Cirrus-CDB89712") + MAINTAINER("Ray Lehtiniemi") + BOOT_MEM(0xc0000000, 0x80000000, 0xff000000) + BOOT_PARAMS(0xc0000100) + FIXUP(fixup_cdb89712) + MAPIO(cdb89712_map_io) + INITIRQ(clps711x_init_irq) +MACHINE_END + +static int cdb89712_hw_init(void) +{ + /* + * Power down as much as possible in case we don't + * have the drivers loaded. + */ + +#ifndef CONFIG_DEBUG_LL + PLD_COM2 = 0; + PLD_COM1 = 0; +#endif + + return 0; +} + +__initcall(cdb89712_hw_init); + diff -urN linux-2.4.6-rmk1/arch/arm/mach-clps711x/mm.c linux/arch/arm/mach-clps711x/mm.c --- linux-2.4.6-rmk1/arch/arm/mach-clps711x/mm.c Mon Jul 9 20:02:53 2001 +++ linux/arch/arm/mach-clps711x/mm.c Wed Jul 11 17:18:11 2001 @@ -35,7 +35,8 @@ /* * Logical Physical */ - + +#ifdef CONFIG_ARCH_P720T static struct map_desc p720t_io_desc[] __initdata = { { SYSPLD_VIRT_BASE, SYSPLD_PHYS_BASE, 1048576, DOMAIN_IO, 0, 1}, { 0xfe400000, 0x10400000, 1048576, DOMAIN_IO, 0, 1}, @@ -47,3 +48,24 @@ { iotable_init(p720t_io_desc); } + +#endif + + + +#ifdef CONFIG_ARCH_CDB89712 +static struct map_desc cdb89712_io_desc[] __initdata = { + { REGISTER_BASE, REGISTER_START, REGISTER_SIZE, DOMAIN_IO, 0, 1, 0, 0 }, + { ETHER_BASE, ETHER_START, ETHER_SIZE, DOMAIN_IO, 0, 1, 0, 0 }, + LAST_DESC +}; + +void __init cdb89712_map_io(void) +{ + iotable_init(cdb89712_io_desc); +} + +#endif + + + diff -urN linux-2.4.6-rmk1/arch/arm/mm/proc-arm720.S linux/arch/arm/mm/proc-arm720.S --- linux-2.4.6-rmk1/arch/arm/mm/proc-arm720.S Mon Jul 9 20:02:53 2001 +++ linux/arch/arm/mm/proc-arm720.S Tue Jul 10 23:14:38 2001 @@ -379,7 +379,7 @@ mrc p15, 0, r0, c1, c0 @ get control register bic r0, r0, #0x0e00 @ ..V. ..RS BLDP WCAM orr r0, r0, #0x2100 @ .... .... .111 .... (old) - orr r0, r0, #0x003d @ ..1. ..01 ..11 1101 (new) + orr r0, r0, #0x003f @ ..1. ..01 ..11 1111 (new) mov pc, lr @ __ret (head-armv.S) /* diff -urN linux-2.4.6-rmk1/arch/arm/tools/mach-types linux/arch/arm/tools/mach-types --- linux-2.4.6-rmk1/arch/arm/tools/mach-types Mon Jul 9 20:02:53 2001 +++ linux/arch/arm/tools/mach-types Mon Jul 9 14:37:03 2001 @@ -105,3 +105,4 @@ possio_px SA1100_POSSIO_PX POSSIO_PX 94 # The following are unallocated +cdb89712 ARCH_CDB89712 CDB89712 123 diff -urN linux-2.4.6-rmk1/drivers/mtd/ftl.c linux/drivers/mtd/ftl.c --- linux-2.4.6-rmk1/drivers/mtd/ftl.c Mon Jul 9 20:02:33 2001 +++ linux/drivers/mtd/ftl.c Tue Jul 10 21:07:25 2001 @@ -258,7 +258,7 @@ max_offset = (0x100000mtd->size)?0x100000:part->mtd->size; /* Search first megabyte for a valid FTL header */ for (offset = 0; - offset < max_offset; + (offset + sizeof(header)) < max_offset; offset += part->mtd->erasesize ? : 0x2000) { ret = part->mtd->read(part->mtd, offset, sizeof(header), &ret, diff -urN linux-2.4.6-rmk1/drivers/mtd/maps/Config.in linux/drivers/mtd/maps/Config.in --- linux-2.4.6-rmk1/drivers/mtd/maps/Config.in Mon Jul 9 20:02:55 2001 +++ linux/drivers/mtd/maps/Config.in Tue Jul 10 19:51:05 2001 @@ -13,6 +13,7 @@ int ' Bus width in octets' CONFIG_MTD_PHYSMAP_BUSWIDTH 2 fi +dep_tristate ' Cirrus CDB89712 evaluation board mappings' CONFIG_MTD_CDB89712 $CONFIG_MTD_CFI $CONFIG_ARCH_CDB89712 dep_tristate ' Sun Microsystems userflash support' CONFIG_MTD_SUN_UFLASH $CONFIG_SPARC64 dep_tristate ' CFI Flash device mapped on Nora' CONFIG_MTD_NORA $CONFIG_MTD_CFI dep_tristate ' CFI Flash device mapped on Photron PNC-2000' CONFIG_MTD_PNC2000 $CONFIG_MTD_CFI $CONFIG_MTD_PARTITIONS diff -urN linux-2.4.6-rmk1/drivers/mtd/maps/Makefile linux/drivers/mtd/maps/Makefile --- linux-2.4.6-rmk1/drivers/mtd/maps/Makefile Mon Jul 9 20:02:55 2001 +++ linux/drivers/mtd/maps/Makefile Tue Jul 10 19:52:14 2001 @@ -6,6 +6,7 @@ O_TARGET := mapslink.o # Chip mappings +obj-$(CONFIG_MTD_CDB89712) += cdb89712.o obj-$(CONFIG_MTD_ARM_INTEGRATOR)+= integrator-flash.o obj-$(CONFIG_MTD_CFI_FLAGADM) += cfi_flagadm.o obj-$(CONFIG_MTD_CSTM_MIPS_IXX) += cstm_mips_ixx.o diff -urN linux-2.4.6-rmk1/drivers/mtd/maps/cdb89712.c linux/drivers/mtd/maps/cdb89712.c --- linux-2.4.6-rmk1/drivers/mtd/maps/cdb89712.c Wed Dec 31 17:00:00 1969 +++ linux/drivers/mtd/maps/cdb89712.c Wed Jul 11 14:47:33 2001 @@ -0,0 +1,328 @@ +/* + * Flash on Cirrus CDB89712 + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +__u8 cdb89712_read8(struct map_info *map, unsigned long ofs) +{ + return __raw_readb(map->map_priv_1 + ofs); +} + +__u16 cdb89712_read16(struct map_info *map, unsigned long ofs) +{ + return __raw_readw(map->map_priv_1 + ofs); +} + +__u32 cdb89712_read32(struct map_info *map, unsigned long ofs) +{ + return __raw_readl(map->map_priv_1 + ofs); +} + +void cdb89712_write8(struct map_info *map, __u8 d, unsigned long adr) +{ + __raw_writeb(d, map->map_priv_1 + adr); + mb(); +} + +void cdb89712_write16(struct map_info *map, __u16 d, unsigned long adr) +{ + __raw_writew(d, map->map_priv_1 + adr); + mb(); +} + +void cdb89712_write32(struct map_info *map, __u32 d, unsigned long adr) +{ + __raw_writel(d, map->map_priv_1 + adr); + mb(); +} + +void cdb89712_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len) +{ + // printk ("cdb89712_copy_from: 0x%x@0x%x -> 0x%x\n", len, from, to); + memcpy_fromio(to, map->map_priv_1 + from, len); +} + +void cdb89712_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len) +{ + while(len) { + __raw_writeb(*(unsigned char *) from, map->map_priv_1 + to); + from++; + to++; + len--; + } +} + + +static struct mtd_info *flash_mtd; + +struct map_info cdb89712_flash_map = { + name: "flash", + size: FLASH_SIZE, + buswidth: FLASH_WIDTH, + read8: cdb89712_read8, + read16: cdb89712_read16, + read32: cdb89712_read32, + copy_from: cdb89712_copy_from, + write8: cdb89712_write8, + write16: cdb89712_write16, + write32: cdb89712_write32, + copy_to: cdb89712_copy_to +}; + +struct resource cdb89712_flash_resource = { + name: "Flash", + start: FLASH_START, + end: FLASH_START + FLASH_SIZE - 1, + flags: IORESOURCE_IO | IORESOURCE_BUSY, +}; + +static int __init init_cdb89712_flash (void) +{ + int err; + + if (request_resource (&ioport_resource, &cdb89712_flash_resource)) { + printk(KERN_NOTICE "Failed to reserve Cdb89712 FLASH space\n"); + err = -EBUSY; + goto out; + } + + cdb89712_flash_map.map_priv_1 = (unsigned long)ioremap(FLASH_START, FLASH_SIZE); + if (!cdb89712_flash_map.map_priv_1) { + printk(KERN_NOTICE "Failed to ioremap Cdb89712 FLASH space\n"); + err = -EIO; + goto out_resource; + } + + flash_mtd = do_map_probe("cfi", &cdb89712_flash_map); + if (!flash_mtd) { + flash_mtd = do_map_probe("rom", &cdb89712_flash_map); + if (flash_mtd) + flash_mtd->erasesize = 0x10000; + } + if (!flash_mtd) { + printk("FLASH probe failed\n"); + err = -ENXIO; + goto out_ioremap; + } + + flash_mtd->module = THIS_MODULE; + + if (add_mtd_device(flash_mtd)) { + printk("FLASH device addition failed\n"); + err = -ENOMEM; + goto out_probe; + } + + return 0; + +out_probe: + map_destroy(flash_mtd); + flash_mtd = 0; +out_ioremap: + iounmap((void *)cdb89712_flash_map.map_priv_1); +out_resource: + release_resource (&cdb89712_flash_resource); +out: + return err; +} + + + + + +static struct mtd_info *sram_mtd; + +struct map_info cdb89712_sram_map = { + name: "SRAM", + size: SRAM_SIZE, + buswidth: SRAM_WIDTH, + read8: cdb89712_read8, + read16: cdb89712_read16, + read32: cdb89712_read32, + copy_from: cdb89712_copy_from, + write8: cdb89712_write8, + write16: cdb89712_write16, + write32: cdb89712_write32, + copy_to: cdb89712_copy_to +}; + +struct resource cdb89712_sram_resource = { + name: "SRAM", + start: SRAM_START, + end: SRAM_START + SRAM_SIZE - 1, + flags: IORESOURCE_IO | IORESOURCE_BUSY, +}; + +static int __init init_cdb89712_sram (void) +{ + int err; + + if (request_resource (&ioport_resource, &cdb89712_sram_resource)) { + printk(KERN_NOTICE "Failed to reserve Cdb89712 SRAM space\n"); + err = -EBUSY; + goto out; + } + + cdb89712_sram_map.map_priv_1 = (unsigned long)ioremap(SRAM_START, SRAM_SIZE); + if (!cdb89712_sram_map.map_priv_1) { + printk(KERN_NOTICE "Failed to ioremap Cdb89712 SRAM space\n"); + err = -EIO; + goto out_resource; + } + + sram_mtd = do_map_probe("ram", &cdb89712_sram_map); + if (!sram_mtd) { + printk("SRAM probe failed\n"); + err = -ENXIO; + goto out_ioremap; + } + + sram_mtd->module = THIS_MODULE; + sram_mtd->erasesize = 16; + + if (add_mtd_device(sram_mtd)) { + printk("SRAM device addition failed\n"); + err = -ENOMEM; + goto out_probe; + } + + return 0; + +out_probe: + map_destroy(sram_mtd); + sram_mtd = 0; +out_ioremap: + iounmap((void *)cdb89712_sram_map.map_priv_1); +out_resource: + release_resource (&cdb89712_sram_resource); +out: + return err; +} + + + + + + + +static struct mtd_info *bootrom_mtd; + +struct map_info cdb89712_bootrom_map = { + name: "BootROM", + size: BOOTROM_SIZE, + buswidth: BOOTROM_WIDTH, + read8: cdb89712_read8, + read16: cdb89712_read16, + read32: cdb89712_read32, + copy_from: cdb89712_copy_from, +}; + +struct resource cdb89712_bootrom_resource = { + name: "BootROM", + start: BOOTROM_START, + end: BOOTROM_START + BOOTROM_SIZE - 1, + flags: IORESOURCE_IO | IORESOURCE_BUSY, +}; + +static int __init init_cdb89712_bootrom (void) +{ + int err; + + if (request_resource (&ioport_resource, &cdb89712_bootrom_resource)) { + printk(KERN_NOTICE "Failed to reserve Cdb89712 BOOTROM space\n"); + err = -EBUSY; + goto out; + } + + cdb89712_bootrom_map.map_priv_1 = (unsigned long)ioremap(BOOTROM_START, BOOTROM_SIZE); + if (!cdb89712_bootrom_map.map_priv_1) { + printk(KERN_NOTICE "Failed to ioremap Cdb89712 BootROM space\n"); + err = -EIO; + goto out_resource; + } + + bootrom_mtd = do_map_probe("rom", &cdb89712_bootrom_map); + if (!bootrom_mtd) { + printk("BootROM probe failed\n"); + err = -ENXIO; + goto out_ioremap; + } + + bootrom_mtd->module = THIS_MODULE; + bootrom_mtd->erasesize = 0x10000; + + if (add_mtd_device(bootrom_mtd)) { + printk("BootROM device addition failed\n"); + err = -ENOMEM; + goto out_probe; + } + + return 0; + +out_probe: + map_destroy(bootrom_mtd); + bootrom_mtd = 0; +out_ioremap: + iounmap((void *)cdb89712_bootrom_map.map_priv_1); +out_resource: + release_resource (&cdb89712_bootrom_resource); +out: + return err; +} + + + + + +static int __init init_cdb89712_maps(void) +{ + + printk(KERN_INFO "Cirrus CDB89712 MTD mappings:\n Flash 0x%x at 0x%x\n SRAM 0x%x at 0x%x\n BootROM 0x%x at 0x%x\n", + FLASH_SIZE, FLASH_START, SRAM_SIZE, SRAM_START, BOOTROM_SIZE, BOOTROM_START); + + init_cdb89712_flash(); + init_cdb89712_sram(); + init_cdb89712_bootrom(); + + return 0; +} + + +static void __exit cleanup_cdb89712_maps(void) +{ + if (sram_mtd) { + del_mtd_device(sram_mtd); + map_destroy(sram_mtd); + iounmap((void *)cdb89712_sram_map.map_priv_1); + release_resource (&cdb89712_sram_resource); + } + + if (flash_mtd) { + del_mtd_device(flash_mtd); + map_destroy(flash_mtd); + iounmap((void *)cdb89712_flash_map.map_priv_1); + release_resource (&cdb89712_flash_resource); + } + + if (bootrom_mtd) { + del_mtd_device(bootrom_mtd); + map_destroy(bootrom_mtd); + iounmap((void *)cdb89712_bootrom_map.map_priv_1); + release_resource (&cdb89712_bootrom_resource); + } +} + +module_init(init_cdb89712_maps); +module_exit(cleanup_cdb89712_maps); + diff -urN linux-2.4.6-rmk1/drivers/net/cs89x0.c linux/drivers/net/cs89x0.c --- linux-2.4.6-rmk1/drivers/net/cs89x0.c Mon Jul 9 20:02:55 2001 +++ linux/drivers/net/cs89x0.c Wed Jul 11 17:19:09 2001 @@ -95,7 +95,7 @@ * Note that even if DMA is turned off we still support the 'dma' and 'use_dma' * module options so we don't break any startup scripts. */ -#define ALLOW_DMA 1 +#define ALLOW_DMA 0 /* * Set this to zero to remove all the debug statements via @@ -112,7 +112,6 @@ */ -#include #include #include #include @@ -157,6 +156,10 @@ static unsigned int netcard_portlist[] __initdata = { 0x80090303, 0x300, 0x320, 0x340, 0x360, 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0, 0}; static unsigned int cs8900_irq_map[] = {12,0,0,0}; +#elif defined (CONFIG_ARCH_CDB89712) +static unsigned int netcard_portlist[] __initdata = + { 0xfe000300, 0}; +static unsigned int cs8900_irq_map[] = {7,0,0,0}; #else static unsigned int netcard_portlist[] __initdata = { 0x300, 0x320, 0x340, 0x360, 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0, 0}; @@ -394,7 +397,7 @@ retval = -EBUSY; goto out1; } - + /* if they give us an odd I/O address, then do ONE write to the address port, to get it back to address zero, where we expect to find the EISA signature word. An IO with a base of 0x3 @@ -414,16 +417,18 @@ } printk("PP_addr=0x%x\n", inw(ioaddr + ADD_PORT)); +#ifndef CONFIG_ARCH_CDB89712 if (inw(ioaddr + DATA_PORT) != CHIP_EISA_ID_SIG) { printk(KERN_ERR "%s: incorrect signature 0x%x\n", dev->name, inw(ioaddr + DATA_PORT)); retval = ENODEV; goto out2; } - +#endif + /* Fill in the 'dev' fields. */ dev->base_addr = ioaddr; - + /* get the chip type */ rev_type = readreg(dev, PRODUCT_ID_ADD); lp->chip_type = rev_type &~ REVISON_BITS; diff -urN linux-2.4.6-rmk1/drivers/net/cs89x0.h linux/drivers/net/cs89x0.h --- linux-2.4.6-rmk1/drivers/net/cs89x0.h Fri Mar 3 13:56:13 2000 +++ linux/drivers/net/cs89x0.h Tue Jul 10 18:08:59 2001 @@ -437,7 +437,11 @@ #define IRQ_MAP_EEPROM_DATA 0x0046 /* Offset into eeprom for the IRQ map */ #define IRQ_MAP_LEN 0x0004 /* No of bytes to read for the IRQ map */ #define PNP_IRQ_FRMT 0x0022 /* PNP small item IRQ format */ +#if defined (CONFIG_ARCH_CDB89712) +#define CS8900_IRQ_MAP 0xffff /* This IRQ map is fixed */ +#else #define CS8900_IRQ_MAP 0x1c20 /* This IRQ map is fixed */ +#endif #define CS8920_NO_INTS 0x0F /* Max CS8920 interrupt select # */ diff -urN linux-2.4.6-rmk1/include/asm-arm/arch-clps711x/hardware.h linux/include/asm-arm/arch-clps711x/hardware.h --- linux-2.4.6-rmk1/include/asm-arm/arch-clps711x/hardware.h Mon Jul 9 20:02:55 2001 +++ linux/include/asm-arm/arch-clps711x/hardware.h Wed Jul 11 17:18:01 2001 @@ -28,12 +28,40 @@ #define EP7212_VIRT_BASE CLPS7111_VIRT_BASE #define EP7212_BASE CLPS7111_VIRT_BASE + #define SYSPLD_VIRT_BASE 0xfe000000 #define SYSPLD_BASE SYSPLD_VIRT_BASE #ifndef __ASSEMBLER__ #define PCIO_BASE IO_BASE + +#endif + +#if defined (CONFIG_ARCH_CDB89712) + +/* dynamic ioremap() areas */ +#define FLASH_START 0x00000000 +#define FLASH_SIZE 0x800000 +#define FLASH_WIDTH 4 + +#define SRAM_START 0x60000000 +#define SRAM_SIZE 0xc000 +#define SRAM_WIDTH 4 + +#define BOOTROM_START 0x70000000 +#define BOOTROM_SIZE 0x80 +#define BOOTROM_WIDTH 4 + + +/* static cdb89712_map_io() areas */ +#define REGISTER_START 0x80000000 +#define REGISTER_SIZE 0x4000 +#define REGISTER_BASE 0xff000000 + +#define ETHER_START 0x20000000 +#define ETHER_SIZE 0x1000 +#define ETHER_BASE 0xfe000000 #endif diff -urN linux-2.4.6-rmk1/include/asm-arm/arch-clps711x/io.h linux/include/asm-arm/arch-clps711x/io.h --- linux-2.4.6-rmk1/include/asm-arm/arch-clps711x/io.h Mon Jul 9 20:02:55 2001 +++ linux/include/asm-arm/arch-clps711x/io.h Mon Jul 9 21:07:27 2001 @@ -20,7 +20,7 @@ #ifndef __ASM_ARM_ARCH_IO_H #define __ASM_ARM_ARCH_IO_H -#define IO_SPACE_LIMIT 0xffff +#define IO_SPACE_LIMIT 0xffffffff #define __io(a) ((a)) #define __mem_pci(a) ((unsigned long)(a)) diff -urN linux-2.4.6-rmk1/include/asm-arm/arch-clps711x/memory.h linux/include/asm-arm/arch-clps711x/memory.h --- linux-2.4.6-rmk1/include/asm-arm/arch-clps711x/memory.h Mon Jul 9 20:02:55 2001 +++ linux/include/asm-arm/arch-clps711x/memory.h Tue Jul 10 18:08:15 2001 @@ -53,9 +53,21 @@ * bus_to_virt: Used to convert an address for DMA operations * to an address that the kernel can use. */ + +#if defined(CONFIG_ARCH_CDB89712) + +#define __virt_to_bus__is_a_macro +#define __virt_to_bus(x) (x) +#define __bus_to_virt__is_a_macro +#define __bus_to_virt(x) (x) + +#else + #define __virt_to_bus__is_a_macro #define __virt_to_bus(x) ((x) - PAGE_OFFSET) #define __bus_to_virt__is_a_macro #define __bus_to_virt(x) ((x) + PAGE_OFFSET) + +#endif #endif diff -urN linux-2.4.6-rmk1/include/asm-arm/hardware/cs89712.h linux/include/asm-arm/hardware/cs89712.h --- linux-2.4.6-rmk1/include/asm-arm/hardware/cs89712.h Wed Dec 31 17:00:00 1969 +++ linux/include/asm-arm/hardware/cs89712.h Mon Jul 9 14:37:03 2001 @@ -0,0 +1,99 @@ +/* + * linux/include/asm-arm/hardware/cs89712.h + * + * This file contains the hardware definitions of the cs89712 internal + * registers. + * + * Copyright (C) 2000 Deep Blue Solutions Ltd. + * + * 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 + */ +#ifndef __ASM_HARDWARE_CS89712_H +#define __ASM_HARDWARE_CS89712_H + +/* + * define CS89712_BASE to be the base address of the region + * you want to access. + */ + +#define CS89712_PHYS_BASE (0x80000000) + +#ifndef __ASSEMBLY__ +#define ep_readl(off) __raw_readl(CS89712_BASE + (off)) +#define ep_writel(val,off) __raw_writel(val, CS89712_BASE + (off)) +#endif + +/* + * These registers are specific to the CS89712 only + */ +#define DAIR 0x2000 +#define DAIR0 0x2040 +#define DAIDR1 0x2080 +#define DAIDR2 0x20c0 +#define DAISR 0x2100 +#define SYSCON3 0x2200 +#define INTSR3 0x2240 +#define INTMR3 0x2280 +#define LEDFLSH 0x22c0 +#define SDCONF 0x2300 +#define SDRFPR 0x2340 + +#define DAIR_DAIEN (1 << 16) +#define DAIR_ECS (1 << 17) +#define DAIR_LCTM (1 << 19) +#define DAIR_LCRM (1 << 20) +#define DAIR_RCTM (1 << 21) +#define DAIR_RCRM (1 << 22) +#define DAIR_LBM (1 << 23) + +#define DAIDR2_FIFOEN (1 << 15) +#define DAIDR2_FIFOLEFT (0x0d << 16) +#define DAIDR2_FIFORIGHT (0x11 << 16) + +#define DAISR_RCTS (1 << 0) +#define DAISR_RCRS (1 << 1) +#define DAISR_LCTS (1 << 2) +#define DAISR_LCRS (1 << 3) +#define DAISR_RCTU (1 << 4) +#define DAISR_RCRO (1 << 5) +#define DAISR_LCTU (1 << 6) +#define DAISR_LCRO (1 << 7) +#define DAISR_RCNF (1 << 8) +#define DAISR_RCNE (1 << 9) +#define DAISR_LCNF (1 << 10) +#define DAISR_LCNE (1 << 11) +#define DAISR_FIFO (1 << 12) + +#define SYSCON3_ADCCON (1 << 0) +#define SYSCON3_DAISEL (1 << 3) +#define SYSCON3_ADCCKNSEN (1 << 4) +#define SYSCON3_FASTWAKE (1 << 8) +#define SYSCON3_DAIEN (1 << 9) + +#define SDCONF_ACTIVE (1 << 10) +#define SDCONF_CLKCTL (1 << 9) +#define SDCONF_WIDTH_4 (0 << 7) +#define SDCONF_WIDTH_8 (1 << 7) +#define SDCONF_WIDTH_16 (2 << 7) +#define SDCONF_WIDTH_32 (3 << 7) +#define SDCONF_SIZE_16 (0 << 5) +#define SDCONF_SIZE_64 (1 << 5) +#define SDCONF_SIZE_128 (2 << 5) +#define SDCONF_SIZE_256 (3 << 5) +#define SDCONF_CASLAT_2 (2) +#define SDCONF_CASLAT_3 (3) + + +#endif /* __ASM_HARDWARE_CS89712_H */