]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
[ARM] 4311/1: ixp4xx: add KIXRP435 platform
authorRuslan V. Sushko <rsushko@ru.mvista.com>
Fri, 6 Apr 2007 14:00:31 +0000 (15:00 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 21 Apr 2007 19:51:55 +0000 (20:51 +0100)
Add Intel KIXRP435 Reference Platform based on IXP43x processor.
Fixed after review : access to cp15 removed in identification functions,
used access to global processor_id instead

Signed-off-by: Vladimir Barinov <vbarinov@ru.mvista.com>
Signed-off-by: Ruslan Sushko <rsushko@ru.mvista.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 files changed:
arch/arm/configs/ixp4xx_defconfig
arch/arm/mach-ixp4xx/Kconfig
arch/arm/mach-ixp4xx/common-pci.c
arch/arm/mach-ixp4xx/common.c
arch/arm/mach-ixp4xx/ixdp425-pci.c
arch/arm/mach-ixp4xx/ixdp425-setup.c
arch/arm/mm/proc-xscale.S
include/asm-arm/arch-ixp4xx/entry-macro.S
include/asm-arm/arch-ixp4xx/hardware.h
include/asm-arm/arch-ixp4xx/io.h
include/asm-arm/arch-ixp4xx/irqs.h
include/asm-arm/arch-ixp4xx/ixp4xx-regs.h

index fabf74c51a88f27bbc44e580a961ba4bab6e2f2a..db850a5689eb52c9438853877175aa26f38365e8 100644 (file)
@@ -117,11 +117,13 @@ CONFIG_ARCH_ADI_COYOTE=y
 CONFIG_ARCH_IXDP425=y
 CONFIG_MACH_IXDPG425=y
 CONFIG_MACH_IXDP465=y
+CONFIG_MACH_KIXRP435=y
 CONFIG_ARCH_IXCDP1100=y
 CONFIG_ARCH_PRPMC1100=y
 CONFIG_MACH_NAS100D=y
 CONFIG_ARCH_IXDP4XX=y
 CONFIG_CPU_IXP46X=y
+CONFIG_CPU_IXP43X=y
 # CONFIG_MACH_GTWX5715 is not set
 
 #
index 8a339cdfe222f807ab32c3a18a0759003a9261b0..dd0fb7239a80674587ce31b5f958e68d3f749382 100644 (file)
@@ -62,6 +62,12 @@ config MACH_IXDP465
          IXDP465 Development Platform (Also known as BMP).
          For more information on this platform, see <file:Documentation/arm/IXP4xx>.
 
+config MACH_KIXRP435
+       bool "KIXRP435"
+       help
+         Say 'Y' here if you want your kernel to support Intel's
+         KIXRP435 Reference Platform.
+         For more information on this platform, see <file:Documentation/arm/IXP4xx>.
 
 #
 # IXCDP1100 is the exact same HW as IXDP425, but with a different machine 
@@ -94,7 +100,7 @@ config MACH_NAS100D
 #
 config ARCH_IXDP4XX
        bool
-       depends on ARCH_IXDP425 || MACH_IXDP465
+       depends on ARCH_IXDP425 || MACH_IXDP465 || MACH_KIXRP435
        default y
 
 #
@@ -105,6 +111,11 @@ config CPU_IXP46X
        depends on MACH_IXDP465
        default y
 
+config CPU_IXP43X
+       bool
+       depends on MACH_KIXRP435
+       default y
+
 config MACH_GTWX5715
        bool "Gemtek WX5715 (Linksys WRV54G)"
        depends on ARCH_IXP4XX
index 9562177b5fe1454c680a2ed0dc151cd25dbbc503..bf04121d1a31748ac99b93f4b2982f5b4675103e 100644 (file)
@@ -374,7 +374,7 @@ void __init ixp4xx_pci_preinit(void)
         * Determine which PCI read method to use.
         * Rev 0 IXP425 requires workaround.
         */
-       if (!(processor_id & 0xf) && !cpu_is_ixp46x()) {
+       if (!(processor_id & 0xf) && cpu_is_ixp42x()) {
                printk("PCI: IXP42x A0 silicon detected - "
                        "PCI Non-Prefetch Workaround Enabled\n");
                ixp4xx_pci_read = ixp4xx_pci_read_errata;
@@ -480,7 +480,7 @@ int ixp4xx_setup(int nr, struct pci_sys_data *sys)
        res[0].flags = IORESOURCE_IO;
 
        res[1].name = "PCI Memory Space";
-       res[1].start = 0x48000000;
+       res[1].start = PCIBIOS_MIN_MEM;
 #ifndef CONFIG_IXP4XX_INDIRECT_PCI
        res[1].end = 0x4bffffff;
 #else
index 39f2eeb219b40ce389096a20b11492a5306a7934..030dd75d053a732612052b6f918209eace68974e 100644 (file)
@@ -192,7 +192,7 @@ static int ixp4xx_set_irq_type(unsigned int irq, unsigned int type)
 
 static void ixp4xx_irq_mask(unsigned int irq)
 {
-       if (cpu_is_ixp46x() && irq >= 32)
+       if ((cpu_is_ixp46x() || cpu_is_ixp43x()) && irq >= 32)
                *IXP4XX_ICMR2 &= ~(1 << (irq - 32));
        else
                *IXP4XX_ICMR &= ~(1 << irq);
@@ -215,7 +215,7 @@ static void ixp4xx_irq_unmask(unsigned int irq)
        if (!(ixp4xx_irq_edge & (1 << irq)))
                ixp4xx_irq_ack(irq);
 
-       if (cpu_is_ixp46x() && irq >= 32)
+       if ((cpu_is_ixp46x() || cpu_is_ixp43x()) && irq >= 32)
                *IXP4XX_ICMR2 |= (1 << (irq - 32));
        else
                *IXP4XX_ICMR |= (1 << irq);
@@ -239,7 +239,7 @@ void __init ixp4xx_init_irq(void)
        /* Disable all interrupt */
        *IXP4XX_ICMR = 0x0; 
 
-       if (cpu_is_ixp46x()) {
+       if (cpu_is_ixp46x() || cpu_is_ixp43x()) {
                /* Route upper 32 sources to IRQ instead of FIQ */
                *IXP4XX_ICLR2 = 0x00;
 
index 99c1dc8033c8e89cef7d8a4f54c2d9f8d615a3d4..4087960048123541411cc472e3413f99f3100398 100644 (file)
@@ -66,7 +66,7 @@ struct hw_pci ixdp425_pci __initdata = {
 int __init ixdp425_pci_init(void)
 {
        if (machine_is_ixdp425() || machine_is_ixcdp1100() ||
-                       machine_is_ixdp465())
+                       machine_is_ixdp465() || machine_is_kixrp435())
                pci_common_init(&ixdp425_pci);
        return 0;
 }
index 04b1d56396a096b357fd3c23e3562aeee34bc96e..ec4f07950ec62745b300ae45e12c965434510048 100644 (file)
@@ -115,6 +115,11 @@ static void __init ixdp425_init(void)
        ixdp425_flash_resource.end =
                IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
 
+       if (cpu_is_ixp43x()) {
+               ixdp425_uart.num_resources = 1;
+               ixdp425_uart_data[1].flags = 0;
+       }
+
        platform_add_devices(ixdp425_devices, ARRAY_SIZE(ixdp425_devices));
 }
 
@@ -156,3 +161,16 @@ MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform")
        .init_machine   = ixdp425_init,
 MACHINE_END
 #endif
+
+#ifdef CONFIG_MACH_KIXRP435
+MACHINE_START(KIXRP435, "Intel KIXRP435 Reference Platform")
+       /* Maintainer: MontaVista Software, Inc. */
+       .phys_io        = IXP4XX_PERIPHERAL_BASE_PHYS,
+       .io_pg_offst    = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
+       .map_io         = ixp4xx_map_io,
+       .init_irq       = ixp4xx_init_irq,
+       .timer          = &ixp4xx_timer,
+       .boot_params    = 0x0100,
+       .init_machine   = ixdp425_init,
+MACHINE_END
+#endif
index d29fe927ee9e019ce60020c9f375957fe9073e76..c156ddab9a2d8814af060b0d8c3295767e8a6945 100644 (file)
@@ -584,6 +584,11 @@ cpu_ixp42x_name:
        .asciz  "XScale-IXP42x Family"
        .size   cpu_ixp42x_name, . - cpu_ixp42x_name
 
+       .type   cpu_ixp43x_name, #object
+cpu_ixp43x_name:
+       .asciz  "XScale-IXP43x Family"
+       .size   cpu_ixp43x_name, . - cpu_ixp43x_name
+
        .type   cpu_ixp46x_name, #object
 cpu_ixp46x_name:
        .asciz  "XScale-IXP46x Family"
@@ -843,6 +848,29 @@ __ixp42x_proc_info:
        .long   xscale_cache_fns
        .size   __ixp42x_proc_info, . - __ixp42x_proc_info                
 
+       .type   __ixp43x_proc_info, #object
+__ixp43x_proc_info:
+       .long   0x69054040
+       .long   0xfffffff0
+       .long   PMD_TYPE_SECT | \
+               PMD_SECT_BUFFERABLE | \
+               PMD_SECT_CACHEABLE | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
+       .long   PMD_TYPE_SECT | \
+               PMD_SECT_AP_WRITE | \
+               PMD_SECT_AP_READ
+       b       __xscale_setup
+       .long   cpu_arch_name
+       .long   cpu_elf_name
+       .long   HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
+       .long   cpu_ixp43x_name
+       .long   xscale_processor_functions
+       .long   v4wbi_tlb_fns
+       .long   xscale_mc_user_fns
+       .long   xscale_cache_fns
+       .size   __ixp43x_proc_info, . - __ixp43x_proc_info
+
        .type   __ixp46x_proc_info, #object
 __ixp46x_proc_info:
        .long   0x69054200
index dadb568b7ef0f07a00c747e61b3f57836bbe7ead..f144a005ed957fbe5e9ccf920bb1bc6ac5a8a5d0 100644 (file)
@@ -31,9 +31,9 @@
 
 1001:
                /*
-                * IXP465 has an upper IRQ status register
+                * IXP465/IXP435 has an upper IRQ status register
                 */
-#if defined(CONFIG_CPU_IXP46X)
+#if defined(CONFIG_CPU_IXP46X) || defined(CONFIG_CPU_IXP43X)
                ldr     \irqstat, =(IXP4XX_INTC_BASE_VIRT+IXP4XX_ICIP2_OFFSET)
                ldr     \irqstat, [\irqstat]            @ get upper interrupts
                mov     \irqnr, #63
index 88fd0877dcc13928ca5808a696dc8ca52f474e9b..24bc5883fa564485d0ed5d0c05f8fcd4ad89d5ef 100644 (file)
@@ -17,8 +17,8 @@
 #ifndef __ASM_ARCH_HARDWARE_H__
 #define __ASM_ARCH_HARDWARE_H__
 
-#define PCIBIOS_MIN_IO                 0x00001000
-#define PCIBIOS_MIN_MEM                        0x48000000
+#define PCIBIOS_MIN_IO         0x00001000
+#define PCIBIOS_MIN_MEM                (cpu_is_ixp43x() ? 0x40000000 : 0x48000000)
 
 /*
  * We override the standard dma-mask routines for bouncing.
index a41ba229c56448a7c69442a83d4a4c1272dda714..b8b3cbcd2d3af0853312e699066f41d2c381174e 100644 (file)
@@ -61,7 +61,7 @@ extern int ixp4xx_pci_write(u32 addr, u32 cmd, u32 data);
 static inline void __iomem *
 __ixp4xx_ioremap(unsigned long addr, size_t size, unsigned long flags)
 {
-       if((addr < 0x48000000) || (addr > 0x4fffffff))
+       if((addr < PCIBIOS_MIN_MEM) || (addr > 0x4fffffff))
                return __ioremap(addr, size, flags);
 
        return (void *)addr;
index e44a563d00ffcf48c569031aac44975540544e05..73a9aa583745079f0d7504120d8b3f02da32afb1 100644 (file)
 /*
  * Only first 32 sources are valid if running on IXP42x systems
  */
-#ifndef        CONFIG_CPU_IXP46X
-#define NR_IRQS                        32
-#else
+#if defined(CONFIG_CPU_IXP46X) || defined(CONFIG_CPU_IXP43X)
 #define NR_IRQS                        64
+#else
+#define NR_IRQS                        32
 #endif
 
 #define        XSCALE_PMU_IRQ          (IRQ_IXP4XX_XSCALE_PMU)
index ed35e5c94f401796579018148417f8c7a180fadd..deb989950c52d6bef5c682680257b164386283dc 100644 (file)
 
 #define DCMD_LENGTH    0x01fff         /* length mask (max = 8K - 1) */
 
+/* Processor id value in CP15 Register 0 */
+#define IXP425_PROCESSOR_ID_VALUE      0x690541c0
+#define IXP435_PROCESSOR_ID_VALUE      0x69054040
+#define IXP465_PROCESSOR_ID_VALUE      0x69054200
+#define IXP4XX_PROCESSOR_ID_MASK       0xfffffff0
+
 #ifndef __ASSEMBLY__
+static inline int cpu_is_ixp42x(void)
+{
+       extern unsigned int processor_id;
+
+       if ((processor_id & IXP4XX_PROCESSOR_ID_MASK) ==
+            IXP425_PROCESSOR_ID_VALUE )
+               return 1;
+
+       return 0;
+}
+
+static inline int cpu_is_ixp43x(void)
+{
+#ifdef CONFIG_CPU_IXP43X
+       extern unsigned int processor_id;
+
+       if ((processor_id & IXP4XX_PROCESSOR_ID_MASK) ==
+            IXP435_PROCESSOR_ID_VALUE )
+               return 1;
+#endif
+       return 0;
+}
+
 static inline int cpu_is_ixp46x(void)
 {
 #ifdef CONFIG_CPU_IXP46X
-       unsigned int processor_id;
-
-       asm("mrc p15, 0, %0, cr0, cr0, 0;" : "=r"(processor_id) :);
+       extern unsigned int processor_id;
 
-       if ((processor_id & 0xffffff00) == 0x69054200)
+       if ((processor_id & IXP4XX_PROCESSOR_ID_MASK) ==
+            IXP465_PROCESSOR_ID_VALUE )
                return 1;
 #endif
        return 0;