diff -urN linux-2.6.36_orig//arch/mips/configs/multicore_defconfig linux-2.6.36//arch/mips/configs/multicore_defconfig --- linux-2.6.36_orig//arch/mips/configs/multicore_defconfig 1970-01-01 03:00:00.000000000 +0300 +++ linux-2.6.36//arch/mips/configs/multicore_defconfig 2011-02-27 05:19:59.000000000 +0300 @@ -0,0 +1,622 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.36 +# Sun Feb 27 00:53:15 2011 +# +CONFIG_MIPS=y + +# +# Machine selection +# +# CONFIG_MIPS_ALCHEMY is not set +# CONFIG_AR7 is not set +# CONFIG_BCM47XX is not set +# CONFIG_BCM63XX is not set +# CONFIG_MIPS_COBALT is not set +# CONFIG_MACH_DECSTATION is not set +# CONFIG_MACH_JAZZ is not set +# CONFIG_MACH_JZ4740 is not set +# CONFIG_LASAT is not set +# CONFIG_MACH_LOONGSON is not set +# CONFIG_MIPS_MALTA is not set +CONFIG_MULTICORE=y +# CONFIG_MIPS_SIM is not set +# CONFIG_NEC_MARKEINS is not set +# CONFIG_MACH_VR41XX is not set +# CONFIG_NXP_STB220 is not set +# CONFIG_NXP_STB225 is not set +# CONFIG_PNX8550_JBS is not set +# CONFIG_PNX8550_STB810 is not set +# CONFIG_PMC_MSP is not set +# CONFIG_PMC_YOSEMITE is not set +# CONFIG_POWERTV is not set +# CONFIG_SGI_IP22 is not set +# CONFIG_SGI_IP27 is not set +# CONFIG_SGI_IP28 is not set +# CONFIG_SGI_IP32 is not set +# CONFIG_SIBYTE_CRHINE is not set +# CONFIG_SIBYTE_CARMEL is not set +# CONFIG_SIBYTE_CRHONE is not set +# CONFIG_SIBYTE_RHONE is not set +# CONFIG_SIBYTE_SWARM is not set +# CONFIG_SIBYTE_LITTLESUR is not set +# CONFIG_SIBYTE_SENTOSA is not set +# CONFIG_SIBYTE_BIGSUR is not set +# CONFIG_SNI_RM is not set +# CONFIG_MACH_TX39XX is not set +# CONFIG_MACH_TX49XX is not set +# CONFIG_MIKROTIK_RB532 is not set +# CONFIG_WR_PPMC is not set +# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set +# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set +# CONFIG_ALCHEMY_GPIO_INDIRECT is not set +CONFIG_LOONGSON_UART_BASE=y +# CONFIG_LOONGSON_MC146818 is not set + +# +# Elvees Multicore platform options +# +CONFIG_MULTICORE_LPORT=y +# CONFIG_MULTICORE_SWIC is not set +CONFIG_MULTICORE_MEMORY=64 +CONFIG_MULTICORE_CLOCKFREQ=5 +CONFIG_MULTICORE_NO_FM_CACHE=y +CONFIG_MULTICORE_NO_TLB_CACHE=y +CONFIG_NVCOM01=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_ARCH_SUPPORTS_OPROFILE=y +CONFIG_GENERIC_FIND_NEXT_BIT=y +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_SCHED_OMIT_FRAME_POINTER=y +CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y +CONFIG_CEVT_R4K_LIB=y +CONFIG_CEVT_R4K=y +CONFIG_CSRC_R4K_LIB=y +CONFIG_CSRC_R4K=y +CONFIG_DMA_COHERENT=y +# CONFIG_NO_IOPORT is not set +# CONFIG_INDEXED_R4K_TLB is not set +CONFIG_CPU_LITTLE_ENDIAN=y +CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y +CONFIG_IRQ_CPU=y +CONFIG_BOOT_ELF32=y +CONFIG_MIPS_L1_CACHE_SHIFT=5 + +# +# CPU selection +# +CONFIG_CPU_MIPS32_R1=y +CONFIG_SYS_HAS_CPU_MIPS32_R1=y +CONFIG_CPU_MIPS32=y +CONFIG_CPU_MIPSR1=y +CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y +CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y +CONFIG_HARDWARE_WATCHPOINTS=y + +# +# Kernel type +# +CONFIG_32BIT=y +# CONFIG_PAGE_SIZE_4KB is not set +CONFIG_PAGE_SIZE_16KB=y +# CONFIG_PAGE_SIZE_64KB is not set +CONFIG_MIPS_MT_DISABLED=y +# CONFIG_MIPS_MT_SMP is not set +CONFIG_SYS_SUPPORTS_MULTITHREADING=y +# CONFIG_MIPS_VPE_LOADER is not set +# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set +CONFIG_CPU_HAS_SYNC=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_CPU_SUPPORTS_HIGHMEM=y +CONFIG_ARCH_FLATMEM_ENABLE=y +CONFIG_ARCH_POPULATES_NODE_MAP=y +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_FLATMEM_MANUAL=y +CONFIG_FLATMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +CONFIG_PAGEFLAGS_EXTENDED=y +CONFIG_SPLIT_PTLOCK_CPUS=4 +# CONFIG_PHYS_ADDR_T_64BIT is not set +CONFIG_ZONE_DMA_FLAG=0 +CONFIG_VIRT_TO_BUS=y +# CONFIG_KSM is not set +CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 +# CONFIG_NO_HZ is not set +# CONFIG_HIGH_RES_TIMERS is not set +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +# CONFIG_HZ_48 is not set +# CONFIG_HZ_100 is not set +# CONFIG_HZ_128 is not set +CONFIG_HZ_250=y +# CONFIG_HZ_256 is not set +# CONFIG_HZ_1000 is not set +# CONFIG_HZ_1024 is not set +CONFIG_SYS_SUPPORTS_ARBIT_HZ=y +CONFIG_HZ=250 +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_VOLUNTARY is not set +# CONFIG_PREEMPT is not set +# CONFIG_KEXEC is not set +# CONFIG_SECCOMP is not set +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_STACKTRACE_SUPPORT=y +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" +CONFIG_CONSTRUCTORS=y + +# +# General setup +# +CONFIG_EXPERIMENTAL=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_CROSS_COMPILE="mipsel-unknown-linux-uclibc-" +CONFIG_LOCALVERSION="-multicore" +CONFIG_LOCALVERSION_AUTO=y +# CONFIG_SWAP is not set +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +# CONFIG_BSD_PROCESS_ACCT is not set + +# +# RCU Subsystem +# +# CONFIG_TREE_RCU is not set +CONFIG_TINY_RCU=y +# CONFIG_TREE_RCU_TRACE is not set +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_LOG_BUF_SHIFT=17 +# CONFIG_CGROUPS is not set +# CONFIG_SYSFS_DEPRECATED_V2 is not set +# CONFIG_RELAY is not set +# CONFIG_NAMESPACES is not set +CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="../../target" +CONFIG_INITRAMFS_ROOT_UID=0 +CONFIG_INITRAMFS_ROOT_GID=0 +CONFIG_RD_GZIP=y +# CONFIG_RD_BZIP2 is not set +CONFIG_RD_LZMA=y +CONFIG_RD_LZO=y +CONFIG_INITRAMFS_COMPRESSION_NONE=y +# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set +# CONFIG_INITRAMFS_COMPRESSION_LZMA is not set +# CONFIG_INITRAMFS_COMPRESSION_LZO is not set +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_SYSCTL=y +CONFIG_ANON_INODES=y +CONFIG_EMBEDDED=y +# CONFIG_SYSCTL_SYSCALL is not set +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +# CONFIG_KALLSYMS_EXTRA_PASS is not set +# CONFIG_HOTPLUG is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +# CONFIG_ELF_CORE is not set +# CONFIG_PCSPKR_PLATFORM is not set +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +CONFIG_SIGNALFD=y +CONFIG_TIMERFD=y +CONFIG_EVENTFD=y +CONFIG_SHMEM=y +CONFIG_AIO=y + +# +# Kernel Performance Events And Counters +# +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_COMPAT_BRK=y +# CONFIG_SLAB is not set +# CONFIG_SLUB is not set +CONFIG_SLOB=y +# CONFIG_PROFILING is not set +CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_KPROBES=y +CONFIG_HAVE_KRETPROBES=y + +# +# GCOV-based kernel profiling +# +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_RT_MUTEXES=y +CONFIG_BASE_SMALL=0 +# CONFIG_MODULES is not set +CONFIG_BLOCK=y +# CONFIG_LBDAF is not set +# CONFIG_BLK_DEV_BSG is not set +# CONFIG_BLK_DEV_INTEGRITY is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_DEADLINE=y +# CONFIG_IOSCHED_CFQ is not set +CONFIG_DEFAULT_DEADLINE=y +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_IOSCHED="deadline" +# CONFIG_INLINE_SPIN_TRYLOCK is not set +# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set +# CONFIG_INLINE_SPIN_LOCK is not set +# CONFIG_INLINE_SPIN_LOCK_BH is not set +# CONFIG_INLINE_SPIN_LOCK_IRQ is not set +# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set +CONFIG_INLINE_SPIN_UNLOCK=y +# CONFIG_INLINE_SPIN_UNLOCK_BH is not set +CONFIG_INLINE_SPIN_UNLOCK_IRQ=y +# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set +# CONFIG_INLINE_READ_TRYLOCK is not set +# CONFIG_INLINE_READ_LOCK is not set +# CONFIG_INLINE_READ_LOCK_BH is not set +# CONFIG_INLINE_READ_LOCK_IRQ is not set +# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set +CONFIG_INLINE_READ_UNLOCK=y +# CONFIG_INLINE_READ_UNLOCK_BH is not set +CONFIG_INLINE_READ_UNLOCK_IRQ=y +# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set +# CONFIG_INLINE_WRITE_TRYLOCK is not set +# CONFIG_INLINE_WRITE_LOCK is not set +# CONFIG_INLINE_WRITE_LOCK_BH is not set +# CONFIG_INLINE_WRITE_LOCK_IRQ is not set +# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set +CONFIG_INLINE_WRITE_UNLOCK=y +# CONFIG_INLINE_WRITE_UNLOCK_BH is not set +CONFIG_INLINE_WRITE_UNLOCK_IRQ=y +# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set +# CONFIG_MUTEX_SPIN_ON_OWNER is not set +# CONFIG_FREEZER is not set + +# +# Bus options (PCI, PCMCIA, EISA, ISA, TC) +# +# CONFIG_ARCH_SUPPORTS_MSI is not set +CONFIG_MMU=y + +# +# Executable file formats +# +CONFIG_BINFMT_ELF=y +# CONFIG_HAVE_AOUT is not set +# CONFIG_BINFMT_MISC is not set +CONFIG_TRAD_SIGNALS=y + +# +# Power management options +# +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +# CONFIG_PM is not set +# CONFIG_NET is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_DEBUG_DRIVER is not set +# CONFIG_DEBUG_DEVRES is not set +# CONFIG_SYS_HYPERVISOR is not set +# CONFIG_MTD is not set +# CONFIG_PARPORT is not set +CONFIG_BLK_DEV=y +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_CRYPTOLOOP is not set + +# +# DRBD disabled because PROC_FS, INET or CONNECTOR not selected +# +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=4096 +CONFIG_BLK_DEV_XIP=y +# CONFIG_CDROM_PKTCDVD is not set +# CONFIG_BLK_DEV_HD is not set +# CONFIG_MISC_DEVICES is not set +CONFIG_HAVE_IDE=y +# CONFIG_IDE is not set + +# +# SCSI device support +# +CONFIG_SCSI_MOD=y +# CONFIG_RAID_ATTRS is not set +# CONFIG_SCSI is not set +# CONFIG_SCSI_DMA is not set +# CONFIG_SCSI_NETLINK is not set +# CONFIG_ATA is not set +# CONFIG_MD is not set +# CONFIG_PHONE is not set + +# +# Input device support +# +CONFIG_INPUT=y +# CONFIG_INPUT_FF_MEMLESS is not set +# CONFIG_INPUT_POLLDEV is not set +# CONFIG_INPUT_SPARSEKMAP is not set + +# +# Userland interfaces +# +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set +# CONFIG_INPUT_EVBUG is not set + +# +# Input Device Drivers +# +# CONFIG_INPUT_KEYBOARD is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TABLET is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_MISC is not set + +# +# Hardware I/O ports +# +# CONFIG_SERIO is not set +# CONFIG_GAMEPORT is not set + +# +# Character devices +# +# CONFIG_VT is not set +# CONFIG_DEVKMEM is not set +# CONFIG_SERIAL_NONSTANDARD is not set + +# +# Serial drivers +# +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +# CONFIG_SERIAL_8250_EXTENDED is not set + +# +# Non-8250 serial port support +# +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_CONSOLE_POLL=y +# CONFIG_SERIAL_TIMBERDALE is not set +# CONFIG_SERIAL_ALTERA_JTAGUART is not set +# CONFIG_SERIAL_ALTERA_UART is not set +CONFIG_UNIX98_PTYS=y +# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 +# CONFIG_IPMI_HANDLER is not set +# CONFIG_HW_RANDOM is not set +# CONFIG_R3964 is not set +# CONFIG_RAW_DRIVER is not set +# CONFIG_TCG_TPM is not set +# CONFIG_RAMOOPS is not set +# CONFIG_I2C is not set +# CONFIG_SPI is not set + +# +# PPS support +# +# CONFIG_PPS is not set +# CONFIG_W1 is not set +# CONFIG_POWER_SUPPLY is not set +# CONFIG_HWMON is not set +# CONFIG_THERMAL is not set +# CONFIG_WATCHDOG is not set +CONFIG_SSB_POSSIBLE=y + +# +# Sonics Silicon Backplane +# +# CONFIG_SSB is not set +# CONFIG_MFD_SUPPORT is not set +# CONFIG_REGULATOR is not set +# CONFIG_MEDIA_SUPPORT is not set + +# +# Graphics support +# +# CONFIG_DRM is not set +# CONFIG_VGASTATE is not set +# CONFIG_VIDEO_OUTPUT_CONTROL is not set +# CONFIG_FB is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set + +# +# Display device support +# +# CONFIG_DISPLAY_SUPPORT is not set +# CONFIG_SOUND is not set +# CONFIG_HID_SUPPORT is not set +# CONFIG_USB_SUPPORT is not set +# CONFIG_MMC is not set +# CONFIG_MEMSTICK is not set +# CONFIG_NEW_LEDS is not set +# CONFIG_ACCESSIBILITY is not set +CONFIG_RTC_LIB=y +# CONFIG_RTC_CLASS is not set +# CONFIG_DMADEVICES is not set +# CONFIG_AUXDISPLAY is not set +# CONFIG_UIO is not set +# CONFIG_STAGING is not set + +# +# File systems +# +# CONFIG_EXT2_FS is not set +# CONFIG_EXT3_FS is not set +# CONFIG_EXT4_FS is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +# CONFIG_FS_POSIX_ACL is not set +# CONFIG_XFS_FS is not set +# CONFIG_BTRFS_FS is not set +# CONFIG_NILFS2_FS is not set +# CONFIG_FILE_LOCKING is not set +CONFIG_FSNOTIFY=y +# CONFIG_DNOTIFY is not set +CONFIG_INOTIFY_USER=y +# CONFIG_QUOTA is not set +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_FUSE_FS is not set + +# +# Caches +# +# CONFIG_FSCACHE is not set + +# +# CD-ROM/DVD Filesystems +# +# CONFIG_ISO9660_FS is not set +# CONFIG_UDF_FS is not set + +# +# DOS/FAT/NT Filesystems +# +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_PROC_SYSCTL=y +CONFIG_PROC_PAGE_MONITOR=y +CONFIG_SYSFS=y +# CONFIG_TMPFS is not set +# CONFIG_HUGETLB_PAGE is not set +CONFIG_CONFIGFS_FS=y +# CONFIG_MISC_FILESYSTEMS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_NLS is not set + +# +# Kernel hacking +# +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +CONFIG_PRINTK_TIME=y +CONFIG_ENABLE_WARN_DEPRECATED=y +CONFIG_ENABLE_MUST_CHECK=y +CONFIG_FRAME_WARN=1024 +CONFIG_MAGIC_SYSRQ=y +# CONFIG_STRIP_ASM_SYMS is not set +# CONFIG_UNUSED_SYMBOLS is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_HEADERS_CHECK is not set +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_SHIRQ is not set +# CONFIG_LOCKUP_DETECTOR is not set +# CONFIG_HARDLOCKUP_DETECTOR is not set +CONFIG_DETECT_HUNG_TASK=y +# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set +CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0 +# CONFIG_SCHED_DEBUG is not set +# CONFIG_SCHEDSTATS is not set +# CONFIG_TIMER_STATS is not set +# CONFIG_DEBUG_OBJECTS is not set +# CONFIG_DEBUG_RT_MUTEXES is not set +# CONFIG_RT_MUTEX_TESTER is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_MUTEXES is not set +# CONFIG_DEBUG_LOCK_ALLOC is not set +# CONFIG_PROVE_LOCKING is not set +# CONFIG_LOCK_STAT is not set +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_DEBUG_KOBJECT is not set +CONFIG_DEBUG_INFO=y +# CONFIG_DEBUG_INFO_REDUCED is not set +# CONFIG_DEBUG_VM is not set +# CONFIG_DEBUG_WRITECOUNT is not set +# CONFIG_DEBUG_MEMORY_INIT is not set +# CONFIG_DEBUG_LIST is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_DEBUG_NOTIFIERS is not set +# CONFIG_DEBUG_CREDENTIALS is not set +# CONFIG_BOOT_PRINTK_DELAY is not set +# CONFIG_RCU_TORTURE_TEST is not set +# CONFIG_BACKTRACE_SELF_TEST is not set +# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set +# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set +# CONFIG_FAULT_INJECTION is not set +# CONFIG_SYSCTL_SYSCALL_CHECK is not set +# CONFIG_PAGE_POISONING is not set +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_TRACING_SUPPORT=y +# CONFIG_FTRACE is not set +# CONFIG_ATOMIC64_SELFTEST is not set +# CONFIG_SAMPLES is not set +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_KGDB=y +CONFIG_KGDB_SERIAL_CONSOLE=y +# CONFIG_KGDB_TESTS is not set +# CONFIG_KGDB_LOW_LEVEL_TRAP is not set +# CONFIG_KGDB_KDB is not set +CONFIG_CMDLINE_BOOL=y +CONFIG_CMDLINE="root=/dev/ram0 console=ttyS0,115200N8" +# CONFIG_CMDLINE_OVERRIDE is not set +# CONFIG_DEBUG_STACK_USAGE is not set +# CONFIG_RUNTIME_DEBUG is not set + +# +# Security options +# +# CONFIG_KEYS is not set +# CONFIG_SECURITY is not set +# CONFIG_SECURITYFS is not set +CONFIG_DEFAULT_SECURITY_DAC=y +CONFIG_DEFAULT_SECURITY="" +# CONFIG_CRYPTO is not set +# CONFIG_BINARY_PRINTF is not set + +# +# Library routines +# +CONFIG_BITREVERSE=y +CONFIG_GENERIC_FIND_LAST_BIT=y +# CONFIG_CRC_CCITT is not set +CONFIG_CRC16=y +# CONFIG_CRC_T10DIF is not set +# CONFIG_CRC_ITU_T is not set +CONFIG_CRC32=y +# CONFIG_CRC7 is not set +# CONFIG_LIBCRC32C is not set +CONFIG_ZLIB_INFLATE=y +CONFIG_LZO_DECOMPRESS=y +CONFIG_DECOMPRESS_GZIP=y +CONFIG_DECOMPRESS_LZMA=y +CONFIG_DECOMPRESS_LZO=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAS_DMA=y +CONFIG_GENERIC_ATOMIC64=y diff -urN linux-2.6.36_orig//arch/mips/include/asm/bootinfo.h linux-2.6.36//arch/mips/include/asm/bootinfo.h --- linux-2.6.36_orig//arch/mips/include/asm/bootinfo.h 2010-10-21 00:30:22.000000000 +0400 +++ linux-2.6.36//arch/mips/include/asm/bootinfo.h 2011-02-27 05:19:59.000000000 +0300 @@ -72,6 +72,12 @@ #define MACH_LOONGSON_END 8 /* + * Valid machtype for Multicore family + */ +#define MACH_MULTICORE 0 /* Multicore */ + + +/* * Valid machtype for group INGENIC */ #define MACH_INGENIC_JZ4730 0 /* JZ4730 SOC */ diff -urN linux-2.6.36_orig//arch/mips/include/asm/cpu-features.h linux-2.6.36//arch/mips/include/asm/cpu-features.h --- linux-2.6.36_orig//arch/mips/include/asm/cpu-features.h 2010-10-21 00:30:22.000000000 +0400 +++ linux-2.6.36//arch/mips/include/asm/cpu-features.h 2011-02-27 05:19:59.000000000 +0300 @@ -41,6 +41,9 @@ #ifndef cpu_has_octeon_cache #define cpu_has_octeon_cache 0 #endif +#ifndef cpu_has_multicore_cache +#define cpu_has_multicore_cache 0 +#endif #ifndef cpu_has_fpu #define cpu_has_fpu (current_cpu_data.options & MIPS_CPU_FPU) #define raw_cpu_has_fpu (raw_current_cpu_data.options & MIPS_CPU_FPU) diff -urN linux-2.6.36_orig//arch/mips/include/asm/cpu.h linux-2.6.36//arch/mips/include/asm/cpu.h --- linux-2.6.36_orig//arch/mips/include/asm/cpu.h 2010-10-21 00:30:22.000000000 +0400 +++ linux-2.6.36//arch/mips/include/asm/cpu.h 2011-02-27 05:19:59.000000000 +0300 @@ -32,6 +32,7 @@ #define PRID_COMP_NXP 0x060000 #define PRID_COMP_TOSHIBA 0x070000 #define PRID_COMP_LSI 0x080000 +#define PRID_COMP_ELVEES 0x0a0000 #define PRID_COMP_LEXRA 0x0b0000 #define PRID_COMP_CAVIUM 0x0d0000 #define PRID_COMP_INGENIC 0xd00000 @@ -139,6 +140,14 @@ #define PRID_IMP_JZRISC 0x0200 /* + * These are the PRID's for when 23:16 == PRID_COMP_ELVEES + * + */ +#define PRID_IMP_MC12 0x1200 /* Multicore 12 */ +#define PRID_IMP_MC12_REV1 0x1201 /* Multicore 12r1 */ +#define PRID_IMP_MC24R 0x2000 /* Multicore 24R */ + +/* * Definitions for 7:0 on legacy processors */ @@ -224,7 +233,7 @@ */ CPU_4KC, CPU_4KEC, CPU_4KSC, CPU_24K, CPU_34K, CPU_1004K, CPU_74K, CPU_ALCHEMY, CPU_PR4450, CPU_BCM3302, CPU_BCM4710, - CPU_BCM6338, CPU_BCM6345, CPU_BCM6348, CPU_BCM6358, + CPU_BCM6338, CPU_BCM6345, CPU_BCM6348, CPU_BCM6358, CPU_MULTICORE, CPU_JZRISC, /* diff -urN linux-2.6.36_orig//arch/mips/include/asm/mach-multicore/cpu-feature-overrides.h linux-2.6.36//arch/mips/include/asm/mach-multicore/cpu-feature-overrides.h --- linux-2.6.36_orig//arch/mips/include/asm/mach-multicore/cpu-feature-overrides.h 1970-01-01 03:00:00.000000000 +0300 +++ linux-2.6.36//arch/mips/include/asm/mach-multicore/cpu-feature-overrides.h 2011-02-27 05:19:59.000000000 +0300 @@ -0,0 +1,47 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2010 Samium Gromoff (_deepfire@feelingofgreen.ru) + */ +#ifndef __ASM_MACH_MULTICORE_CPU_FEATURE_OVERRIDES_H +#define __ASM_MACH_MULTICORE_CPU_FEATURE_OVERRIDES_H + +#define cpu_has_watch 1 +#define cpu_has_mips16 0 +#define cpu_has_divec 0 +#define cpu_has_vce 0 +#define cpu_has_cache_cdex_p 0 +#define cpu_has_cache_cdex_s 0 +#define cpu_has_prefetch 0 +#define cpu_has_mcheck 1 +#define cpu_has_ejtag 0 +#define cpu_has_counter 1 + +#define cpu_has_multicore_cache 1 + +#define cpu_has_llsc 1 +#define cpu_has_vtag_icache 0 +#define cpu_has_dc_aliases 0 +#define cpu_has_ic_fills_f_dc 0 +#define cpu_has_dsp 0 +#define cpu_has_mipsmt 0 +#define cpu_has_userlocal 0 +#define cpu_icache_snoops_remote_store 0 + +#define cpu_has_nofpuex 0 +#define cpu_has_64bits 0 + +#define cpu_has_mips32r1 1 +#define cpu_has_mips32r2 0 +#define cpu_has_mips64r1 0 +#define cpu_has_mips64r2 0 + +#define cpu_has_inclusive_pcaches 0 + +#define cpu_dcache_line_size() 0 +#define cpu_icache_line_size() 0 +#define cpu_scache_line_size() 0 + +#endif /* __ASM_MACH_MULTICORE_CPU_FEATURE_OVERRIDES_H */ diff -urN linux-2.6.36_orig//arch/mips/include/asm/mach-multicore/io-elvees.h linux-2.6.36//arch/mips/include/asm/mach-multicore/io-elvees.h --- linux-2.6.36_orig//arch/mips/include/asm/mach-multicore/io-elvees.h 1970-01-01 03:00:00.000000000 +0300 +++ linux-2.6.36//arch/mips/include/asm/mach-multicore/io-elvees.h 2011-02-27 05:19:59.000000000 +0300 @@ -0,0 +1,774 @@ +/* + * Hardware register defines for all Elvees MIPS microcontrollers. + * + * Copyright (C) 2008-2010 Serge Vakulenko, + * + * This file 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. + * + * You can redistribute this file and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software Foundation; + * either version 2 of the License, or (at your discretion) any later version. + * See the accompanying file "COPYING.txt" for more details. + * + * As a special exception to the GPL, permission is granted for additional + * uses of the text contained in this file. See the accompanying file + * "COPY-UOS.txt" for details. + */ +#ifndef _IO_ELVEES_H +#define _IO_ELVEES_H + +/*-------------------------------------- + * Coprocessor 0 registers. + */ +#define C0_INDEX 0 /* индекс доступа к TLB */ +#define C0_RANDOM 1 /* индекс TLB для команды Write Random */ +#define C0_ENTRYLO0 2 /* строки для чётных страниц TLB */ +#define C0_ENTRYLO1 3 /* строки для нечётных страниц TLB */ +#define C0_CONTEXT 4 /* указатель на таблицу PTE */ +#define C0_PAGEMASK 5 /* маска размера страниц TLB */ +#define C0_WIRED 6 /* граница привязанных строк TLB */ +#define C0_BADVADDR 8 /* виртуальный адрес последнего исключения */ +#define C0_COUNT 9 /* таймер */ +#define C0_ENTRYHI 10 /* информация соответствия виртуального адреса */ +#define C0_COMPARE 11 /* предельное значение для прерывания по таймеру */ +#define C0_STATUS 12 /* режимы функционирования процессора */ +#define C0_CAUSE 13 /* причина последнего исключения */ +#define C0_EPC 14 /* адрес возврата из исключения */ +#define C0_PRID 15 /* идентификатор процессора */ +#define C0_CONFIG 16 /* информация о возможностях процессора */ +#define C0_LLADDR 17 /* физический адрес последней команды LL */ +#define C0_ERROREPC 30 /* адрес возврата из исключения ошибки */ + +/* + * Status register. + */ +#define ST_IE 0x00000001 /* разрешение прерываний */ +#define ST_EXL 0x00000002 /* уровень исключения */ +#define ST_ERL 0x00000004 /* уровень ошибки */ +#define ST_UM 0x00000010 /* режим пользователя */ +#define ST_IM_SW0 0x00000100 /* программное прерывание 0 */ +#define ST_IM_SW1 0x00000200 /* программное прерывание 1 */ + +#define ST_NMI 0x00080000 /* причина сброса - NMI */ +#define ST_TS 0x00200000 /* TLB-закрытие системы */ +#define ST_BEV 0x00400000 /* размещение векторов: начальная загрузка */ + +#define ST_CU0 0x10000000 /* разрешение сопроцессора 0 */ +#define ST_CU1 0x20000000 /* разрешение сопроцессора 1 (FPU) */ + +#ifdef ELVEES_MC24 +#define ST_IM_IRQ0 0x00000400 /* внешнее прерывание 0 */ +#define ST_IM_IRQ1 0x00000800 /* внешнее прерывание 1 */ +#define ST_IM_IRQ2 0x00001000 /* внешнее прерывание 2 */ +#define ST_IM_IRQ3 0x00002000 /* внешнее прерывание 3 */ +#define ST_IM_MCU 0x00008000 /* от внутренних устройств микроконтроллера */ +#endif + +#ifdef ELVEES_NVCOM01 +#define ST_IM_QSTR0 0x00000400 /* от внутренних устройств микроконтроллера */ +#define ST_IM_QSTR1 0x00000800 /* от DMA MEM */ +#define ST_IM_QSTR2 0x00001000 /* от MFBSP */ +#define ST_IM_DSP 0x00004000 /* от DSP */ +#define ST_IM_COMPARE 0x00008000 /* от таймера 0 */ +#endif + +#ifdef ELVEES_NVCOM02 +/* TODO */ +#define ST_IM_QSTR0 0x00000400 /* от внутренних устройств микроконтроллера */ +#define ST_IM_QSTR1 0x00000800 /* от DMA MEM */ +#define ST_IM_QSTR2 0x00001000 /* от MFBSP */ +#define ST_IM_DSP 0x00004000 /* от DSP */ +#define ST_IM_COMPARE 0x00008000 /* от таймера 0 */ +#endif + +/* + * Сause register. + */ +#define CA_EXC_CODE 0x0000007c /* код исключения */ +#define CA_Int 0 /* прерывание */ +#define CA_Mod (1 << 2) /* TLB-исключение модификации */ +#define CA_TLBL (2 << 2) /* TLB-исключение, загрузка или вызов команды */ +#define CA_TLBS (3 << 2) /* TLB-исключение, сохранение */ +#define CA_AdEL (4 << 2) /* ошибка адресации, загрузка или вызов команды */ +#define CA_AdES (5 << 2) /* ошибка адресации, сохранение */ +#define CA_Sys (8 << 2) /* системное исключение */ +#define CA_Bp (9 << 2) /* breakpoint */ +#define CA_RI (10 << 2) /* зарезервированная команда */ +#define CA_CpU (11 << 2) /* недоступность сопроцессора */ +#define CA_Ov (12 << 2) /* целочисленное переполнение */ +#define CA_Tr (13 << 2) /* trap */ +#define CA_MCheck (24 << 2) /* аппаратный контроль */ + +#define CA_ID 0x00000080 /* прерывание от блока отладки OnCD */ +#define CA_IP_SW0 0x00000100 /* программное прерывание 0 */ +#define CA_IP_SW1 0x00000200 /* программное прерывание 1 */ +#define CA_IP_IRQ0 0x00000400 /* внешнее прерывание 0 */ +#define CA_IP_IRQ1 0x00000800 /* внешнее прерывание 1 */ +#define CA_IP_IRQ2 0x00001000 /* внешнее прерывание 2 */ +#define CA_IP_IRQ3 0x00002000 /* внешнее прерывание 3 */ +#define CA_IP_MCU 0x00008000 /* от внутренних устройств микроконтроллера */ +#define CA_IV 0x00800000 /* 1 - используется спец.вектор 0x200 */ +#define CA_BD 0x80000000 /* исключение в слоте задержки перехода */ + + +/* + * Регистры интерфейсов Space Wire, размещенных в контроллере (SWIC0, SWIC1) + */ +#ifdef MC_HAVE_SWIC + +/* + * Маски для установки отдельных полей регистров + */ + +/* STATUS */ +#define MC_SWIC_DC_ERR 0x00000001 /* Признак ошибки рассоединения */ +#define MC_SWIC_P_ERR 0x00000002 /* Признак ошибки четности */ +#define MC_SWIC_ESC_ERR 0x00000004 /* Признак ошибки в ESC-последовательности */ +#define MC_SWIC_CREDIT_ERR 0x00000008 /* Признак ошибки кредитования */ +#define MC_SWIC_DS_STATE 0x000000E0 /* Состояние DS-макроячейки */ +#define MC_SWIC_RX_BUF_FULL 0x00000100 /* Буфер приема полон */ +#define MC_SWIC_RX_BUF_EMPTY 0x00000200 /* Буфер приема пуст */ +#define MC_SWIC_TX_BUF_FULL 0x00000400 /* Буфер передачи полон */ +#define MC_SWIC_TX_BUF_EMPTY 0x00000800 /* Буфер передачи пуст */ +#define MC_SWIC_CONNECTED 0x00001000 /* Признак установленного соединения */ +#define MC_SWIC_GOT_TIME 0x00004000 /* Принят маркер времени из сети */ +#define MC_SWIC_GOT_INT 0x00008000 /* Принят код распределенного прерывания из сети */ +#define MC_SWIC_GOT_POLL 0x00010000 /* Принят poll-код из сети */ +#define MC_SWIC_FL_CONTROL 0x00020000 /* Признак занятости передачей управляющего кода */ +#define MC_SWIC_IRQ_LINK 0x00040000 /* Состояние запроса прерырывания LINK */ +#define MC_SWIC_IRQ_TIM 0x00080000 /* Состояние запроса прерырывания TIM */ +#define MC_SWIC_IRQ_ERR 0x00100000 /* Состояние запроса прерырывания ERR */ + +/* Значения поля DS_STATE регистра STATUS */ +#define MC_SWIC_DS_ERROR_RESET 0 +#define MC_SWIC_DS_ERROR_WAIT 1 +#define MC_SWIC_DS_READY 2 +#define MC_SWIC_DS_STARTED 3 +#define MC_SWIC_DS_CONNECTING 4 +#define MC_SWIC_DS_RUN 5 + +/* RX_CODE */ +#define MC_SWIC_TIME_CODE 0x000000FF /* Значение маркера времени, принятого из сети последним */ +#define MC_SWIC_INT_CODE 0x0000FF00 /* Значение кода распределенного прерывания, принятого из сети последним */ +#define MC_SWIC_POLE_CODE 0x00FF0000 /* Значение poll-кода, принятого из сети последним */ + +/* MODE_CR */ +#define MC_SWIC_LinkDisabled 0x00000001 /* Установка LinkDisabled для блока DS-кодирования */ +#define MC_SWIC_AutoStart 0x00000002 /* Установка AutoStart для блока DS-кодирования */ +#define MC_SWIC_LinkStart 0x00000004 /* Установка LinkStart для блока DS-кодирования */ +#define MC_SWIC_RX_RST 0x00000008 /* Установка блока приема в начальное состояние */ +#define MC_SWIC_TX_RST 0x00000010 /* Установка блока передачи в начальное состояние */ +#define MC_SWIC_DS_RST 0x00000020 /* Установка DS-макроячейки в начальное состояние */ +#define MC_SWIC_SWCORE_RST 0x00000040 /* Установка контроллера в начальное состояние */ +#define MC_SWIC_WORK_TYPE 0x00000100 /* Тип режима работы */ +#define MC_SWIC_LINK_MASK 0x00040000 /* Маска прерывания LINK */ +#define MC_SWIC_TIM_MASK 0x00080000 /* Маска прерывания TIM */ +#define MC_SWIC_ERR_MASK 0x00100000 /* Маска прерывания ERR */ + +/* TX_SPEED */ +#define MC_SWIC_TXSPEED 0x000000FF /* Установка коэффициента умножения TX_PLL */ +#define MC_SWIC_PLL_CTR 0x00000300 /* Разрешение работы TX_PLL */ + +/* TX_CODE */ +#define MC_SWIC_TXCODE 0x0000001F /* Управляющий код (содержимое) */ +#define MC_SWIC_CODETYPE 0x000000E0 /* Признак кода управления */ + +/* Значение поля CODETYPE регистра TX_CODE */ +#define MC_SWIC_CODETYPE_TIME 2 +#define MC_SWIC_CODETYPE_INT 3 +#define MC_SWIC_CODETYPE_POLL 5 + +/* Прерывания для SWIC */ +#define MC_SWIC0_IRQ 5 +#define MC_SWIC0_TX_DESC_IRQ 0 +#define MC_SWIC0_TX_DATA_IRQ 1 +#define MC_SWIC0_RX_DESC_IRQ 2 +#define MC_SWIC0_RX_DATA_IRQ 3 +#define MC_SWIC1_IRQ 6 +#define MC_SWIC1_TX_DESC_IRQ 15 +#define MC_SWIC1_TX_DATA_IRQ 16 +#define MC_SWIC1_RX_DESC_IRQ 17 +#define MC_SWIC1_RX_DATA_IRQ 18 + +#define MC_SWIC_STATUS_BITS "\20"\ +"\1DC_ERR\2P_ERR\3ESC_ERR\4CREDIT_ERR\6DS_STATE0\7DS_STATE1\10DS_STATE2"\ +"\11RX_BUF_FULL\12RX_BUF_EMPTY\13TX_BUF_FULL\14TX_BUF_EMPTY\15CONNECTED"\ +"\17GOT_TIME\20GOT_INT\21GOT_POLL\22FL_CONTROL\23IRQ_LINK\24IRQ_TIM\25IRQ_ERR" + +#define MC_SWIC_MODE_CR_BITS "\20"\ +"\1LinkDisabled\2AutoStart\3LinkStart\4RX_RST\5TX_RST\6DS_RST\7SWCORE_RST"\ +"\11WORK_TYPE\12TX_single\13RX_single\14LVDS_Loopback\15CODEC_Loopback"\ +"\16DS_Loopback\21LINK_MASK\24TIM_MASK\25ERR_MASK" + +#endif /* MC_HAVE_SWIC */ + +/* + * Регистры DMA + */ + +/* Регистр CSR для каналов DMA */ +#define MC_DMA_CSR_RUN 0x00000001 /* Состояние работы канала DMA */ +#define MC_DMA_CSR_2D 0x00000200 /* Режим модификации адреса памяти */ +#define MC_DMA_CSR_CHEN 0x00001000 /* Признак разрешения самоинициализации */ +#define MC_DMA_CSR_IM 0x00002000 /* Маска прерывания при окончании передачи блока */ +#define MC_DMA_CSR_END 0x00004000 /* Признак завершения передачи блока данных */ +#define MC_DMA_CSR_DONE 0x00008000 /* Признак завершения передачи цепочки блоков данных */ +#define MC_DMA_CSR_WCX_MASK 0xffff0000 /* Маска счетчика слов */ +#define MC_DMA_CSR_WCX(n) ((n) << 16) /* Установка счетчика слов */ +#define MC_DMA_CSR_WN(n) ((n) << 2) /* Установка длины пачки */ + +/* Псевдорегистр управления RUN */ +#define MC_DMA_RUN 0x00000001 /* Управление битом RUN */ + +/*-------------------------------------- + * Системный регистр CSR + */ +#define MC_CSR_FM 0x00000001 /* Fixed mapping */ +#define MC_CSR_TST_CACHE 0x00000800 /* random access to cache */ +#define MC_CSR_FLUSH_I 0x00001000 /* instruction cache invalidate */ +#define MC_CSR_FLUSH_D 0x00004000 /* data cache invalidate */ + +#ifdef ELVEES_MC24 +#define MC_CSR_CLK(n) ((n) << 4) /* PLL clock multiply, 1..31, 0=1/16 */ +#define MC_CSR_CLKEN 0x00010000 /* PLL clock enable */ +#endif + +/* + * Системный регистр MASKR + */ +#ifdef ELVEES_MC24 +#define MC_MASKR_SRX0 0x00000001 /* SPORT0 receive */ +#define MC_MASKR_STX0 0x00000002 /* SPORT0 transmit */ +#define MC_MASKR_SRX1 0x00000004 /* SPORT0 receive */ +#define MC_MASKR_STX1 0x00000008 /* SPORT0 transmit */ +#define MC_MASKR_UART 0x00000010 /* UART */ +#define MC_MASKR_LTRX0 0x00000080 /* LPORT0 data */ +#define MC_MASKR_LSRQ0 0x00000100 /* LPORT0 service */ +#define MC_MASKR_LTRX1 0x00000200 /* LPORT1 data */ +#define MC_MASKR_LSRQ1 0x00000400 /* LPORT1 service */ +#define MC_MASKR_LTRX2 0x00000800 /* LPORT2 data */ +#define MC_MASKR_LSRQ2 0x00001000 /* LPORT2 service */ +#define MC_MASKR_LTRX3 0x00002000 /* LPORT3 data */ +#define MC_MASKR_LSRQ3 0x00004000 /* LPORT3 service */ +#define MC_MASKR_COMPARE 0x00080000 /* CPU timer */ +#define MC_MASKR_MEMCH0 0x00200000 /* DMA MemCh0 */ +#define MC_MASKR_MEMCH1 0x00400000 /* DMA MemCh0 */ +#define MC_MASKR_MEMCH2 0x00800000 /* DMA MemCh0 */ +#define MC_MASKR_MEMCH3 0x01000000 /* DMA MemCh0 */ +#define MC_MASKR_TIMER 0x20000000 /* timers IT, WDT, RTT */ +#define MC_MASKR_PI 0x40000000 /* DSP software interrupt */ +#define MC_MASKR_SBS 0x80000000 /* DSP status */ + +/* For MC24RT3 */ +#define MC_MASKR_TxDesCh0 0x00000001 /* TX DESC DMA for SWIC0 */ +#define MC_MASKR_TxDatCh0 0x00000002 /* TX DATA DMA for SWIC0 */ +#define MC_MASKR_RxDesCh0 0x00000004 /* RX DESC DMA for SWIC0 */ +#define MC_MASKR_RxDatCh0 0x00000008 /* RX DATA DMA for SWIC0 */ +#define MC_MASKR_SWIC0 0x00000020 /* SWIC0 */ +#define MC_MASKR_SWIC1 0x00000040 /* SWIC1 */ +#define MC_MASKR_TxDesCh1 0x00008000 /* TX DESC DMA for SWIC1 */ +#define MC_MASKR_TxDatCh1 0x00010000 /* TX DATA DMA for SWIC1 */ +#define MC_MASKR_RxDesCh1 0x00020000 /* RX DESC DMA for SWIC1 */ +#define MC_MASKR_RxDatCh1 0x00040000 /* RX DATA DMA for SWIC1 */ +#endif + +#ifdef ELVEES_NVCOM01 +#define MC_MASKR0_MCC (1 << 31) /* Прерывание от МСС */ +#define MC_MASKR0_I2C (1 << 23) /* Прерывание от I2C */ +#define MC_MASKR0_IT (1 << 22) /* от таймера IT */ +#define MC_MASKR0_RTT (1 << 21) /* от таймера RTT */ +#define MC_MASKR0_WDT (1 << 20) /* от таймера WDT */ +#define MC_MASKR0_VPOUT_TX (1 << 19) /* от канала DMA VPOUT */ +#define MC_MASKR0_VPOUT (1 << 18) /* от контроллера VPOUT */ +#define MC_MASKR0_VPIN_RX (1 << 17) /* от канала DMA VPIN */ +#define MC_MASKR0_VPIN (1 << 16) /* от контроллера VPIN */ +#define MC_MASKR0_ETH_DMA_TX (1 << 15) /* от DMA передачи Ethernet */ +#define MC_MASKR0_ETH_DMA_RX (1 << 14) /* от DMA приёма Ethernet */ +#define MC_MASKR0_ETH_TX_FRAME (1 << 13) /* от передатчика Ethernet */ +#define MC_MASKR0_ETH_RX_FRAME (1 << 12) /* от приёмника Ethernet */ +#define MC_MASKR0_USB_EP4 (1 << 11) /* от передатчика USB end point 4 */ +#define MC_MASKR0_USB_EP3 (1 << 10) /* от приёмника USB end point 3 */ +#define MC_MASKR0_USB_EP2 (1 << 9) /* от передатчика USB end point 2 */ +#define MC_MASKR0_USB_EP1 (1 << 8) /* от приёмника USB end point 1 */ +#define MC_MASKR0_USB (1 << 7) /* Прерывание от USB */ +#define MC_MASKR0_UART1 (1 << 5) /* Прерывание от UART1 */ +#define MC_MASKR0_UART0 (1 << 4) /* Прерывание от UART0 */ +#define MC_MASKR0_IRQ3 (1 << 3) /* Внешнее прерывание nIRQ3 */ +#define MC_MASKR0_IRQ2 (1 << 2) /* Внешнее прерывание nIRQ2 */ +#define MC_MASKR0_IRQ1 (1 << 1) /* Внешнее прерывание nIRQ1 */ +#define MC_MASKR0_IRQ0 (1 << 0) /* Внешнее прерывание nIRQ0 */ + +#define MC_MASKR1_DMAMEM_CH3 (1 << 3) /* от канала DMA MEM_CH3 */ +#define MC_MASKR1_DMAMEM_CH2 (1 << 2) /* от канала DMA MEM_CH2 */ +#define MC_MASKR1_DMAMEM_CH1 (1 << 1) /* от канала DMA MEM_CH1 */ +#define MC_MASKR1_DMAMEM_CH0 (1 << 0) /* от канала DMA MEM_CH0 */ + +#define MC_MASKR2_DMA_MFBSP3 (1 << 15) /* от канала DMA порта MFBSP3 */ +#define MC_MASKR2_MFBSP_TX3 (1 << 14) /* готовность MFBSP3 к приёму по DMA */ +#define MC_MASKR2_MFBSP_RX3 (1 << 13) /* готовность MFBSP3 к выдаче по DMA */ +#define MC_MASKR2_SRQ3 (1 << 12) /* Запрос обслуживания от порта MFBSP3 */ +#define MC_MASKR2_DMA_MFBSP2 (1 << 11) /* от канала DMA порта MFBSP2 */ +#define MC_MASKR2_MFBSP_TX2 (1 << 10) /* готовность MFBSP2 к приёму по DMA */ +#define MC_MASKR2_MFBSP_RX2 (1 << 9) /* готовность MFBSP2 к выдаче по DMA */ +#define MC_MASKR2_SRQ2 (1 << 8) /* Запрос обслуживания от порта MFBSP2 */ +#define MC_MASKR2_DMA_MFBSP1 (1 << 7) /* от канала DMA порта MFBSP1 */ +#define MC_MASKR2_MFBSP_TX1 (1 << 6) /* готовность MFBSP1 к приёму по DMA */ +#define MC_MASKR2_MFBSP_RX1 (1 << 5) /* готовность MFBSP1 к выдаче по DMA */ +#define MC_MASKR2_SRQ1 (1 << 4) /* Запрос обслуживания от порта MFBSP1 */ +#define MC_MASKR2_DMA_MFBSP0 (1 << 3) /* от канала DMA порта MFBSP0 */ +#define MC_MASKR2_MFBSP_TX0 (1 << 2) /* готовность MFBSP0 к приёму по DMA */ +#define MC_MASKR2_MFBSP_RX0 (1 << 1) /* готовность MFBSP0 к выдаче по DMA */ +#define MC_MASKR2_SRQ0 (1 << 0) /* Запрос обслуживания от порта MFBSP0 */ +#endif + +#ifdef ELVEES_NVCOM02 +/* TODO */ +#define MC_MASKR0_MCC (1 << 31) /* Прерывание от МСС */ +#define MC_MASKR0_I2C (1 << 23) /* Прерывание от I2C */ +#define MC_MASKR0_IT (1 << 22) /* от таймера IT */ +#define MC_MASKR0_RTT (1 << 21) /* от таймера RTT */ +#define MC_MASKR0_WDT (1 << 20) /* от таймера WDT */ +#define MC_MASKR0_VPOUT_TX (1 << 19) /* от канала DMA VPOUT */ +#define MC_MASKR0_VPOUT (1 << 18) /* от контроллера VPOUT */ +#define MC_MASKR0_VPIN_RX (1 << 17) /* от канала DMA VPIN */ +#define MC_MASKR0_VPIN (1 << 16) /* от контроллера VPIN */ +#define MC_MASKR0_ETH_DMA_TX (1 << 15) /* от DMA передачи Ethernet */ +#define MC_MASKR0_ETH_DMA_RX (1 << 14) /* от DMA приёма Ethernet */ +#define MC_MASKR0_ETH_TX_FRAME (1 << 13) /* от передатчика Ethernet */ +#define MC_MASKR0_ETH_RX_FRAME (1 << 12) /* от приёмника Ethernet */ +#define MC_MASKR0_USB_EP4 (1 << 11) /* от передатчика USB end point 4 */ +#define MC_MASKR0_USB_EP3 (1 << 10) /* от приёмника USB end point 3 */ +#define MC_MASKR0_USB_EP2 (1 << 9) /* от передатчика USB end point 2 */ +#define MC_MASKR0_USB_EP1 (1 << 8) /* от приёмника USB end point 1 */ +#define MC_MASKR0_USB (1 << 7) /* Прерывание от USB */ +#define MC_MASKR0_UART1 (1 << 5) /* Прерывание от UART1 */ +#define MC_MASKR0_UART0 (1 << 4) /* Прерывание от UART0 */ +#define MC_MASKR0_IRQ3 (1 << 3) /* Внешнее прерывание nIRQ3 */ +#define MC_MASKR0_IRQ2 (1 << 2) /* Внешнее прерывание nIRQ2 */ +#define MC_MASKR0_IRQ1 (1 << 1) /* Внешнее прерывание nIRQ1 */ +#define MC_MASKR0_IRQ0 (1 << 0) /* Внешнее прерывание nIRQ0 */ + +#define MC_MASKR1_DMAMEM_CH3 (1 << 3) /* от канала DMA MEM_CH3 */ +#define MC_MASKR1_DMAMEM_CH2 (1 << 2) /* от канала DMA MEM_CH2 */ +#define MC_MASKR1_DMAMEM_CH1 (1 << 1) /* от канала DMA MEM_CH1 */ +#define MC_MASKR1_DMAMEM_CH0 (1 << 0) /* от канала DMA MEM_CH0 */ + +#define MC_MASKR2_DMA_MFBSP3 (1 << 15) /* от канала DMA порта MFBSP3 */ +#define MC_MASKR2_MFBSP_TX3 (1 << 14) /* готовность MFBSP3 к приёму по DMA */ +#define MC_MASKR2_MFBSP_RX3 (1 << 13) /* готовность MFBSP3 к выдаче по DMA */ +#define MC_MASKR2_SRQ3 (1 << 12) /* Запрос обслуживания от порта MFBSP3 */ +#define MC_MASKR2_DMA_MFBSP2 (1 << 11) /* от канала DMA порта MFBSP2 */ +#define MC_MASKR2_MFBSP_TX2 (1 << 10) /* готовность MFBSP2 к приёму по DMA */ +#define MC_MASKR2_MFBSP_RX2 (1 << 9) /* готовность MFBSP2 к выдаче по DMA */ +#define MC_MASKR2_SRQ2 (1 << 8) /* Запрос обслуживания от порта MFBSP2 */ +#define MC_MASKR2_DMA_MFBSP1 (1 << 7) /* от канала DMA порта MFBSP1 */ +#define MC_MASKR2_MFBSP_TX1 (1 << 6) /* готовность MFBSP1 к приёму по DMA */ +#define MC_MASKR2_MFBSP_RX1 (1 << 5) /* готовность MFBSP1 к выдаче по DMA */ +#define MC_MASKR2_SRQ1 (1 << 4) /* Запрос обслуживания от порта MFBSP1 */ +#define MC_MASKR2_DMA_MFBSP0 (1 << 3) /* от канала DMA порта MFBSP0 */ +#define MC_MASKR2_MFBSP_TX0 (1 << 2) /* готовность MFBSP0 к приёму по DMA */ +#define MC_MASKR2_MFBSP_RX0 (1 << 1) /* готовность MFBSP0 к выдаче по DMA */ +#define MC_MASKR2_SRQ0 (1 << 0) /* Запрос обслуживания от порта MFBSP0 */ +#endif + +/* + * Системный регистр CLKEN + */ +#define MC_CLKEN_MCC (1 << 31) /* Включение тактовой частоты MCC */ +#define MC_CLKEN_USB (1 << 22) /* Включение тактовой частоты USB */ +#define MC_CLKEN_EMAC (1 << 20) /* Включение тактовой частоты EMAC */ +#define MC_CLKEN_VPOUT (1 << 19) /* Включение тактовой частоты VPOUT */ +#define MC_CLKEN_VPIN (1 << 18) /* Включение тактовой частоты VPIN */ +#define MC_CLKEN_DMA_MEM (1 << 12) /* Включение тактовой частоты DMA_MEM */ +#define MC_CLKEN_MFBSP (1 << 8) /* Включение тактовой частоты MFBSP 1-3 */ +#define MC_CLKEN_DSP1 (1 << 5) /* Включение тактовой частоты DSP1 */ +#define MC_CLKEN_DSP0 (1 << 4) /* Включение тактовой частоты DSP0 */ +#define MC_CLKEN_CORE (1 << 0) /* Включение тактовой частоты ядра + (CPU, MPORT, TIMER, UART, I2C, MFBSP0) */ + +/* + * Системный регистр CR_PLL + */ +#define MC_CRPLL_DSP (1 << 23) /* Выбор тактовой частоты PLL_DSP */ +#define MC_CRPLL_CLKSEL_DSP(n) ((n) << 16) /* Коэффициент частоты PLL_DSP */ +#define MC_CRPLL_CLKSEL_MPORT(n) ((n) << 8) /* Коэффициент частоты PLL_MPORT */ +#define MC_CRPLL_CLKSEL_CORE(n) (n) /* Коэффициент частоты PLL_CORE */ + +/* + * Регистры порта внешней памяти CSCONi + */ +#define MC_CSCON_CSMASK(addr) ((addr) >> 24 & 0xff) + /* Address mask bits 31:24 */ +#define MC_CSCON_CSBA(addr) ((addr) >> 16 & 0xff00) + /* Base address bits 31:24 */ +#define MC_CSCON_WS(n) ((n) << 16) /* Wait states for async memory */ +#define MC_CSCON_E (1 << 20) /* Enable for nCS0, nCS1, nCS2 */ +#define MC_CSCON_T (1 << 21) /* Sync memory flag (only nCS0, nCS1) */ +#define MC_CSCON_AE (1 << 22) /* Wait for nACK */ +#define MC_CSCON_W64 (1 << 23) /* 64-bit data width */ +#define MC_CSCON3_BYTE (1 << 23) /* 8-bit data width for nCS3 */ +#define MC_CSCON3_OVER (1 << 24) /* Status: no nACK for 256 CLK periods */ +#define MC_CSCON3_ADDR(addr) (((addr) & 3) << 20) + /* Address bits 1:0 for 8-bit memory access */ + +/* + * Регистр конфигурации синхронной динамической памяти SDRCON + */ +#define MC_SDRCON_PS_512 (0 << 0) /* Page size 512 */ +#define MC_SDRCON_PS_1024 (1 << 0) /* Page size 1024 */ +#define MC_SDRCON_PS_2048 (2 << 0) /* Page size 2048 */ +#define MC_SDRCON_PS_4096 (3 << 0) /* Page size 4096 */ + +#ifdef ELVEES_MC24 +#define MC_SDRCON_RFR(nsec,khz) ((((nsec)*(khz)+999999)/1000000) << 4) + /* Refresh period */ +#define MC_SDRCON_BL_1 (0 << 16) /* Bursh length 1 */ +#define MC_SDRCON_BL_2 (1 << 16) /* Bursh length 2 */ +#define MC_SDRCON_BL_4 (2 << 16) /* Bursh length 4 */ +#define MC_SDRCON_BL_8 (3 << 16) /* Bursh length 8 */ +#define MC_SDRCON_BL_PAGE (7 << 16) /* Bursh full page */ + +#define MC_SDRCON_WBM (1 << 19) /* Write burst mode - single write */ +#define MC_SDRCON_CL (1 << 20) /* CAS latency: 0 - 2, 1 - 3 cycles */ +#define MC_SDRCON_INIT (1 << 31) /* Initialize SDRAM, 2 usec */ +#endif + +#ifdef ELVEES_NVCOM01 +#define MC_SDRCON_RFR(nsec,khz) (((nsec*khz+999999)/1000000) << 16) + /* Refresh period */ +#define MC_SDRCON_CL_2 (2 << 4) /* CAS latency 2 cycles */ +#define MC_SDRCON_CL_3 (3 << 4) /* CAS latency 3 cycles */ +#endif + +#ifdef ELVEES_NVCOM02 +/* TODO */ +#define MC_SDRCON_RFR(nsec,khz) (((nsec*khz+999999)/1000000) << 16) + /* Refresh period */ +#define MC_SDRCON_CL_2 (2 << 4) /* CAS latency 2 cycles */ +#define MC_SDRCON_CL_3 (3 << 4) /* CAS latency 3 cycles */ +#endif + +/* + * Регистр параметров синхронной динамической памяти SDRTMR + */ +#define MC_SDRTMR_TWR(n) ((n) << 0) /* Write recovery delay */ +#define MC_SDRTMR_TRP(n) ((n) << 4) /* Минимальный период Precharge */ +#define MC_SDRTMR_TRCD(n) ((n) << 8) /* Минимальная задержка между + * Active и Read/Write */ +#define MC_SDRTMR_TRAS(n) ((n) << 16) /* Минимальная задержка между + * Active и Precharge */ +#define MC_SDRTMR_TRFC(n) ((n) << 20) /* Минимальный интервал между Refresh */ + +/*-------------------------------------- + * Интервальный таймер, регистр управления ITCSR + */ +#define MC_ITCSR_EN 0x00000001 /* разрешение работы таймера */ +#define MC_ITCSR_INT 0x00000002 /* признак срабатывания таймера */ + +/*-------------------------------------- + * Сторожевой таймер, регистр управления WTCSR + */ +#define MC_WTCSR_KEY1 0x000000A0 /* первый ключ */ +#define MC_WTCSR_KEY2 0x000000F5 /* второй ключ */ +#define MC_WTCSR_EN 0x00000100 /* разрешение работы таймера */ +#define MC_WTCSR_INT 0x00000200 /* признак срабатывания таймера */ +#define MC_WTCSR_MODE_ITM 0x00000400 /* режим обычного таймера */ +#define MC_WTCSR_RLD 0x00000800 /* периодическая перезагрузка */ + +#define MC_WTCSR_INT_CTR 0x00003000 /* управление типом прерывания */ +#define MC_WTCSR_INT_DISABLE 0x00000000 /* прерывание не формируется */ +#define MC_WTCSR_INT_TIMER 0x00001000 /* обычное прерывание QSTR[29] */ +#define MC_WTCSR_INT_NMI 0x00002000 /* немаскируемое прерывание */ +#define MC_WTCSR_INT_EXTSIG 0x00003000 /* внешний сигнал WDT */ + +/*-------------------------------------- + * UART. + */ +/* + * Line control register + */ +#define MC_LCR_5BITS 0x00 /* character length: 5 bits */ +#define MC_LCR_6BITS 0x01 /* character length: 6 bits */ +#define MC_LCR_7BITS 0x02 /* character length: 7 bits */ +#define MC_LCR_8BITS 0x03 /* character length: 8 bits */ + +#define MC_LCR_STOPB 0x04 /* use 2 stop bits */ +#define MC_LCR_PENAB 0x08 /* parity enable */ +#define MC_LCR_PEVEN 0x10 /* even parity */ +#define MC_LCR_PFORCE 0x20 /* force parity */ +#define MC_LCR_SBREAK 0x40 /* break control */ +#define MC_LCR_DLAB 0x80 /* divisor latch access bit */ + +/* + * FIFO control register + */ +#define MC_FCR_ENABLE 0x01 /* enable FIFO */ +#define MC_FCR_RCV_RST 0x02 /* clear receive FIFO */ +#define MC_FCR_XMT_RST 0x04 /* clear transmit FIFO */ + +#define MC_FCR_TRIGGER_1 0x00 /* receive FIFO level: 1/4 byte */ +#define MC_FCR_TRIGGER_4 0x40 /* receive FIFO level: 4/16 bytes */ +#define MC_FCR_TRIGGER_8 0x80 /* receive FIFO level: 8/56 bytes */ +#define MC_FCR_TRIGGER_14 0xc0 /* receive FIFO level: 14/60 bytes */ + +/* + * Line status register + */ +#define MC_LSR_RXRDY 0x01 /* receiver ready */ +#define MC_LSR_OE 0x02 /* overrun error */ +#define MC_LSR_PE 0x04 /* parity error */ +#define MC_LSR_FE 0x08 /* framing error */ +#define MC_LSR_BI 0x10 /* break interrupt */ +#define MC_LSR_TXRDY 0x20 /* transmitter holding register empty */ +#define MC_LSR_TEMT 0x40 /* transmitter empty */ +#define MC_LSR_FIFOE 0x80 /* error in receive FIFO */ + +/* + * Interrupt enable register + */ +#define MC_IER_ERXRDY 0x01 /* enable receive data/timeout intr */ +#define MC_IER_ETXRDY 0x02 /* enable transmitter interrupts */ +#define MC_IER_ERLS 0x04 /* enable receive line status intr */ +#define MC_IER_EMSC 0x08 /* enable modem status interrupts */ + +/* + * Interrupt identification register + */ +#define MC_IIR_NOPEND 0x01 /* no interrupt pending */ +#define MC_IIR_IMASK 0x0e /* interrupt type mask */ +#define MC_IIR_FENAB 0xc0 /* set if FIFOs are enabled */ + +#define MC_IIR_RLS 0x06 /* receiver line status */ +#define MC_IIR_RXRDY 0x04 /* receiver data available */ +#define MC_IIR_RXTOUT 0x0c /* character timeout indication */ +#define MC_IIR_TXRDY 0x02 /* transmitter holding reg empty */ +#define MC_IIR_MLSC 0x00 /* modem status */ + +/* + * Modem control register + */ +#define MC_MCR_DTR 0x01 /* control DTR output */ +#define MC_MCR_RTS 0x02 /* control RTS output */ +#define MC_MCR_OUT1 0x04 /* control OUT1 output */ +#define MC_MCR_OUT2 0x08 /* control OUT2 output, used as + * global interrupt enable in PCs */ +#define MC_MCR_LOOPBACK 0x10 /* set local loopback mode */ + +/* + * Modem status register + */ +#define MC_MSR_DCTS 0x01 /* CTS changed */ +#define MC_MSR_DDSR 0x02 /* DSR changed */ +#define MC_MSR_TERI 0x04 /* RI changed from 0 to 1 */ +#define MC_MSR_DDCD 0x08 /* DCD changed */ +#define MC_MSR_CTS 0x10 /* CTS input */ +#define MC_MSR_DSR 0x20 /* DSR input */ +#define MC_MSR_RI 0x40 /* RI input */ +#define MC_MSR_DCD 0x80 /* DCD input */ + +/* + * Compute the 16-bit baud rate divisor, given + * the oscillator frequency and baud rate. + * Round to the nearest integer. + */ +#define MC_DL_BAUD(fr,bd) (((fr)/8 + (bd)) / (bd) / 2) + +/*-------------------------------------- + * Coprocessor 1 (FPU) registers. + */ +#define C1_FIR 0 /* implementation and revision */ +#define C1_FCCR 25 /* condition codes */ +#define C1_FEXR 26 /* exceptions */ +#define C1_FENR 28 /* enables */ +#define C1_FCSR 31 /* control/status */ + +/* + * FPU control/status register + */ +#define FCSR_ROUND 0x00000003 /* round mode */ +#define FCSR_ROUND_N 0x00000000 /* round to nearest */ +#define FCSR_ROUND_Z 0x00000001 /* round toward zero */ +#define FCSR_ROUND_P 0x00000002 /* round toward positive infinity */ +#define FCSR_ROUND_M 0x00000003 /* round toward negative infinity */ +#define FCSR_FLAG_I 0x00000004 /* flag: inexact result */ +#define FCSR_FLAG_U 0x00000008 /* flag: underflow */ +#define FCSR_FLAG_O 0x00000010 /* flag: overflow */ +#define FCSR_FLAG_Z 0x00000020 /* flag: divide by zero */ +#define FCSR_FLAG_V 0x00000040 /* flag: invalid operation */ +#define FCSR_ENABLES 0x00000f80 /* enables */ +#define FCSR_ENABLE_I 0x00000080 /* enables: inexact result */ +#define FCSR_ENABLE_U 0x00000100 /* enables: underflow */ +#define FCSR_ENABLE_O 0x00000200 /* enables: overflow */ +#define FCSR_ENABLE_Z 0x00000400 /* enables: divide by zero */ +#define FCSR_ENABLE_V 0x00000800 /* enables: invalid operation */ +#define FCSR_CAUSE_I 0x00001000 /* cause: inexact result */ +#define FCSR_CAUSE_U 0x00002000 /* cause: underflow */ +#define FCSR_CAUSE_O 0x00004000 /* cause: overflow */ +#define FCSR_CAUSE_Z 0x00008000 /* cause: divide by zero */ +#define FCSR_CAUSE_V 0x00010000 /* cause: invalid operation */ +#define FCSR_CAUSE_E 0x00020000 /* cause: unimplemented */ +#define FCSR_FS 0x01000000 /* flush to zero */ +#define FCSR_COND_0 0x00800000 /* condition code 0 */ +#define FCSR_COND_1 0x02000000 /* condition code 1 */ +#define FCSR_COND_2 0x04000000 /* condition code 2 */ +#define FCSR_COND_3 0x08000000 /* condition code 3 */ +#define FCSR_COND_4 0x10000000 /* condition code 4 */ +#define FCSR_COND_5 0x20000000 /* condition code 5 */ +#define FCSR_COND_6 0x40000000 /* condition code 6 */ +#define FCSR_COND_7 0x80000000 /* condition code 7 */ + +/* + * MFBSP_CSR - регистр управления MFBSP + */ +#define MC_MFBSP_CSR_LEN (1 << 0) +#define MC_MFBSP_CSR_LTRAN (1 << 1) +#define MC_MFBSP_CSR_LCLK_RATE(n) ((((n) & 1) << 2) | (((n) & 0x1C) << 10)) +#define MC_MFBSP_CSR_LSTAT(n) ((n) << 3) +#define MC_MFBSP_CSR_LRERR (1 << 5) +#define MC_MFBSP_CSR_LDW (1 << 6) +#define MC_MFBSP_CSR_SRQ_TX (1 << 7) +#define MC_MFBSP_CSR_SRQ_RX (1 << 8) +#define MC_MFBSP_CSR_SPI_I2S_EN (1 << 9) + +/* + * MFBSP_GPIO_DR и MFBSP_DIR + */ +#define MC_MFBSP_GPIO_LACK (1 << 0) +#define MC_MFBSP_GPIO_LCLK (1 << 1) +#define MC_MFBSP_GPIO_LDAT(n) (1 << ((n) + 2)) + +/*-------------------------------------- + * Регистры контроллера Ethernet + */ +/* + * MAC_CONTROL - управление MAC + */ +#define MAC_CONTROL_FULLD (1 << 0) /* дуплексный режим */ +#define MAC_CONTROL_EN_TX_DMA (1 << 1) /* разрешение передающего TX DMА */ +#define MAC_CONTROL_EN_TX (1 << 2) /* разрешение передачи */ +#define MAC_CONTROL_IRQ_TX_DONE (1 << 3) /* прерывание от передачи */ +#define MAC_CONTROL_EN_RX (1 << 4) /* разрешение приема */ +#define MAC_CONTROL_LOOPBACK (1 << 5) /* режим зацикливания */ +#define MAC_CONTROL_FULLD_RX (1 << 6) /* тестовый режим приема */ +#define MAC_CONTROL_IRQ_RX_DONE (1 << 7) /* прерывание по приёму */ +#define MAC_CONTROL_IRQ_RX_OVF (1 << 8) /* прерывание по переполнению */ +#define MAC_CONTROL_CP_TX (1 << 9) /* сброс передающего TX_FIFO */ +#define MAC_CONTROL_RST_TX (1 << 10) /* сброс блока передачи */ +#define MAC_CONTROL_CP_RX (1 << 11) /* сброс принимающего RX_FIFO */ +#define MAC_CONTROL_RST_RX (1 << 12) /* сброс блока приема */ + +/* + * IFS_COLL_MODE - режим обработки коллизии + */ +#define IFS_COLL_MODE_ATTEMPT_NUM(n) ((n) & 15) /* Количество попыток повторных передач */ +#define IFS_COLL_MODE_EN_CW (1 << 4) /* Разрешение отслеживания окна коллизии */ +#define IFS_COLL_MODE_TM_BACKOFF (1 << 7) /* Тестовый режим */ +#define IFS_COLL_MODE_COLL_WIN(n) ((n) << 8) /* Размер окна коллизии */ +#define IFS_COLL_MODE_JAMB(n) ((n) << 16) /* Байт jam-сообщения */ +#define IFS_COLL_MODE_IFS(n) ((n) << 24) /* Межкадровый интервал */ + +/* + * TX_FRAME_CONTROL - управление передачей кадра + */ +#define TX_FRAME_CONTROL_LENGTH(n) ((n) & 0xfff) /* Число байт данных */ +#define TX_FRAME_CONTROL_TYPE_EN (1 << 12) /* Поле длины задаёт тип */ +#define TX_FRAME_CONTROL_FCS_CLT_EN (1 << 13) /* Контрольная сумма из регистра */ +#define TX_FRAME_CONTROL_DISENCAPFR (1 << 14) /* Запрет формирования кадра в блоке передачи */ +#define TX_FRAME_CONTROL_DISPAD (1 << 15) /* Запрет заполнителей */ +#define TX_FRAME_CONTROL_TX_REQ (1 << 16) /* Передача кадра */ + +/* + * STATUS_TX - статус передачи кадра + */ +#define STATUS_TX_ONTX_REQ (1 << 0) /* Выполняется запрос передачи */ +#define STATUS_TX_ONTRANSMIT (1 << 1) /* Выполняется передача кадра */ +#define STATUS_TX_BUSY (1 << 2) /* Среда передачи занята */ +#define STATUS_TX_DONE (1 << 3) /* Передача завершена */ +#define STATUS_TX_TRANSMIT_DISABLED (1 << 4) /* Передача не разрешена */ +#define STATUS_TX_NOT_ENOUGH_DATA (1 << 5) /* Мало данных в TX FIFO */ +#define STATUS_TX_TRANSMIT_OK (1 << 6) /* Передача кадра успешно выполнена */ +#define STATUS_TX_EXCESSIVE_COLL (1 << 7) /* Повторная передача не удалась */ +#define STATUS_TX_LATE_COLL (1 << 8) /* Поздняя коллизия */ +#define STATUS_TX_ONCOL (1 << 11) /* Коллизия в среде передачи */ +#define STATUS_TX_COLL_NUM(s) ((s) >> 12 & 15) /* Счетчик попыток повторных передач */ +#define STATUS_TX_TXW(s) ((s) >> 16 & 0x3ff) /* Число слов в TX FIFO */ +#define STATUS_TX_BITS "\20"\ +"\1ONTX_REQ\2ONTRANSMIT\3BUSY\4DONE\5DISABLED\6NDATA\7TXOK\10EXCCOLL"\ +"\11LATECOLL\14ONCOL" + +/* + * RX_FRAME_CONTROL - управление приемом кадра + */ +#define RX_FRAME_CONTROL_DIS_RCV_FCS (1 << 0) /* Отключение сохранения контрольной суммы */ +#define RX_FRAME_CONTROL_DIS_PAD_DEL (1 << 1) /* Отключение удаления заполнителей */ +#define RX_FRAME_CONTROL_ACC_TOOSHORT (1 << 2) /* Прием коротких кадров */ +#define RX_FRAME_CONTROL_DIS_TOOLONG (1 << 3) /* Отбрасывание слишком длинных кадров */ +#define RX_FRAME_CONTROL_DIS_FCSCHERR (1 << 4) /* Отбрасывание кадров с ошибкой контрольной суммы */ +#define RX_FRAME_CONTROL_DIS_LENGTHERR (1 << 5) /* Отбрасывание кадров с ошибкой длины */ +#define RX_FRAME_CONTROL_DIS_BC (1 << 6) /* Запрещение приема кадров с широковещательным адресом */ +#define RX_FRAME_CONTROL_EN_MCM (1 << 7) /* Разрешение приема кадров с групповым адресом по маске */ +#define RX_FRAME_CONTROL_EN_MCHT (1 << 8) /* Разрешение приема кадров с групповым адресом по хеш-таблице */ +#define RX_FRAME_CONTROL_EN_ALL (1 << 9) /* Разрешение приема кадров с любым адресом */ + +/* + * STATUS_RX - статус приема кадра + */ +#define STATUS_RX_RCV_DISABLED (1 << 0) /* Приём не разрешён */ +#define STATUS_RX_ONRECEIVE (1 << 1) /* Выполняется приём кадра */ +#define STATUS_RX_DONE (1 << 3) /* Есть кадры в RX FIFO */ +#define STATUS_RX_NUM_FR(s) ((s) >> 4 & 0x7f) /* Число принятых кадров */ +#define STATUS_RX_STATUS_OVF (1 << 11) /* Переполнение FIFO статусов */ +#define STATUS_RX_RXW(s) ((s) >> 12 & 0x3ff) /* Число слов в RX FIFO */ +#define STATUS_RX_FIFO_OVF (1 << 23) /* Переполнение FIFO данных */ +#define STATUS_RX_NUM_MISSED(s) ((s) >> 24 & 0x3f) /* Число пропущенных кадров */ +#define STATUS_RX_BITS "\30"\ +"\1DISABLED\2ONRECEIVE\4DONE\14STATUS_OVF\30FIFO_OVF" + +/* + * RX_FRAME_STATUS_FIFO - FIFO статусов принятых кадров + */ +#define RX_FRAME_STATUS_LEN(s) ((s) & 0xfff) /* Число байт в принятом кадре */ +#define RX_FRAME_STATUS_OK (1 << 12) /* Кадр принят без ошибок */ +#define RX_FRAME_STATUS_LENGTH_ERROR (1 << 13) /* Ошибка длины данных */ +#define RX_FRAME_STATUS_ALIGN_ERROR (1 << 14) /* Ошибка выравнивания */ +#define RX_FRAME_STATUS_FRAME_ERROR (1 << 15) /* Ошибка формата кадра */ +#define RX_FRAME_STATUS_TOO_LONG (1 << 16) /* Слишком длинный кадр */ +#define RX_FRAME_STATUS_TOO_SHORT (1 << 17) /* Слишком короткий кадр */ +#define RX_FRAME_STATUS_DRIBBLE_NIBBLE (1 << 18) /* Нечётное число полубайт */ +#define RX_FRAME_STATUS_LEN_FIELD (1 << 19) /* Распознавание поля LENGTH */ +#define RX_FRAME_STATUS_FCS_DEL (1 << 20) /* Удаление поля FCS */ +#define RX_FRAME_STATUS_PAD_DEL (1 << 21) /* Удаление поля PAD */ +#define RX_FRAME_STATUS_UC (1 << 22) /* Распознавание адреса MAC */ +#define RX_FRAME_STATUS_MCM (1 << 23) /* Групповой адрес по маске */ +#define RX_FRAME_STATUS_MCHT (1 << 24) /* Групповой адрес по хэш-таблице */ +#define RX_FRAME_STATUS_BC (1 << 25) /* Широковещательный адрес */ +#define RX_FRAME_STATUS_ALL (1 << 26) /* Приём кадров с любым адресом */ + +/* + * MD_MODE - режим работы порта MD + */ +#define MD_MODE_DIVIDER(n) ((n) & 0xff) /* делитель для частоты MDC */ +#define MD_MODE_RST (1 << 8) /* сброс порта PHY */ + +/* + * MD_CONTROL - управление порта MD + */ +#define MD_CONTROL_DATA(n) ((n) & 0xffff) /* данные для записи */ +#define MD_CONTROL_REG(n) (((n) & 0x1f) << 16) /* адрес регистра PHY */ +#define MD_CONTROL_PHY(n) (((n) & 0x1f) << 24) /* адрес PHY */ +#define MD_CONTROL_IRQ(n) (1 << 29) /* нужно прерывание */ +#define MD_CONTROL_OP_READ (1 << 30) /* операция чтения */ +#define MD_CONTROL_OP_WRITE (2 << 30) /* операция записи */ + +/* + * MD_STATUS - статус порта MD + */ +#define MD_STATUS_DATA 0xffff /* прочитанные данные */ +#define MD_STATUS_BUSY (1 << 29) /* порт занят */ +#define MD_STATUS_END_READ (1 << 30) /* завершилась операция чтения */ +#define MD_STATUS_END_WRITE (1 << 31) /* завершилась операция записи */ + + +#endif /* _IO_ELVEES_H */ diff -urN linux-2.6.36_orig//arch/mips/include/asm/mach-multicore/io-mc24.h linux-2.6.36//arch/mips/include/asm/mach-multicore/io-mc24.h --- linux-2.6.36_orig//arch/mips/include/asm/mach-multicore/io-mc24.h 1970-01-01 03:00:00.000000000 +0300 +++ linux-2.6.36//arch/mips/include/asm/mach-multicore/io-mc24.h 2011-02-27 05:19:59.000000000 +0300 @@ -0,0 +1,200 @@ +/* + * Hardware register defines for Elvees MC-24 microcontroller. + * + * Copyright (C) 2008-2010 Serge Vakulenko, + * + * This file 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. + * + * You can redistribute this file and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software Foundation; + * either version 2 of the License, or (at your discretion) any later version. + * See the accompanying file "COPYING.txt" for more details. + * + * As a special exception to the GPL, permission is granted for additional + * uses of the text contained in this file. See the accompanying file + * "COPY-UOS.txt" for details. + */ +#ifndef _IO_MC24_H +#define _IO_MC24_H + +#define MC_HAVE_SPORT +#define MC_HAVE_LPORT +#define MC_HAVE_SWIC + +#define MC_R(a) *(volatile unsigned*)(0xB82F0000 + (a)) + +/* + * Системные регистры + */ +#define MC_MASKR MC_R (0x4000) /* Регистр маски */ +#define MC_QSTR MC_R (0x4004) /* Регистр заявок */ +#define MC_CSR MC_R (0x4008) /* Регистр управления */ +#define MC_MASKR_DSP MC_R (0x4010) /* Регистр маски DSP */ +#define MC_QSTR_DSP MC_R (0x4014) /* Регистр заявок DSP */ +#define MC_MASKR_HM MC_R (0x4018) /* Регистр маски кода Хемминга */ +#define MC_QSTR_HM MC_R (0x401C) /* Регистр заявок кода Хемминга */ +#define MC_CSR_CRAM MC_R (0x4410) /* Регистр управления CRAM */ +#define MC_AERROR_CRAM MC_R (0x4414) /* FIFO ошибочных адресов CRAM */ +#define MC_CSR_ICACHE MC_R (0x4800) /* Регистр управления CRAM */ +#define MC_AERROR_ICACHE MC_R (0x4814) /* FIFO ошибочных адресов CRAM */ + +/* + * Регистры порта внешней памяти + */ +#define MC_CSCON0 MC_R (0x1000) /* Регистр конфигурации 0 */ +#define MC_CSCON1 MC_R (0x1004) /* Регистр конфигурации 1 */ +#define MC_CSCON2 MC_R (0x1008) /* Регистр конфигурации 2 */ +#define MC_CSCON3 MC_R (0x100C) /* Регистр конфигурации 3 */ +#define MC_CSCON4 MC_R (0x1010) /* Регистр конфигурации 4 */ +#define MC_SDRCON MC_R (0x1014) /* Регистр конфигурации памяти SDRAM */ +#define MC_CKE_CTR MC_R (0x1018) /* Регистр управления состоянием вывода CKE микросхемы */ +#define MC_CSR_EXT MC_R (0x101C) /* Регистр управления и состояния внешней памяти */ +#define MC_AER_ROR_EXT MC_R (0x1020) /* FIFO ошибочных адресов внешней памяти */ + +/* + * Регистры UART + */ +#define MC_RBR MC_R (0x3000) /* Приемный буферный регистр */ +#define MC_THR MC_R (0x3000) /* Передающий буферный регистр */ +#define MC_IER MC_R (0x3004) /* Регистр разрешения прерываний */ +#define MC_IIR MC_R (0x3008) /* Регистр идентификации прерывания */ +#define MC_FCR MC_R (0x3008) /* Регистр управления FIFO */ +#define MC_LCR MC_R (0x300C) /* Регистр управления линией */ +#define MC_MCR MC_R (0x3010) /* Регистр управления модемом */ +#define MC_LSR MC_R (0x3014) /* Регистр состояния линии */ +#define MC_MSR MC_R (0x3018) /* Регистр состояния модемом */ +#define MC_SPR MC_R (0x301C) /* Регистр Scratch Pad */ +#define MC_DLL MC_R (0x3000) /* Регистр делителя младший */ +#define MC_DLM MC_R (0x3004) /* Регистр делителя старший */ +#define MC_SCLR MC_R (0x3014) /* Регистр предделителя (scaler) */ + +/* + * Регистры интервального таймера (IT) + */ +#define MC_ITCSR MC_R (0xD000) /* Регистр управления */ +#define MC_ITPERIOD MC_R (0xD004) /* Регистр периода работы таймера */ +#define MC_ITCOUNT MC_R (0xD008) /* Регистр счетчика */ +#define MC_ITSCALE MC_R (0xD00C) /* Регистр предделителя */ + +/* + * Регистры WDT + */ +#define MC_WTCSR MC_R (0xD010) /* Регистр управления */ +#define MC_WTPERIOD MC_R (0xD014) /* Регистр периода работы таймера */ +#define MC_WTCOUNT MC_R (0xD018) /* Регистр счетчика */ +#define MC_WTSCALE MC_R (0xD01C) /* Регистр предделителя */ + +/* + * Регистры RTT + */ +#define MC_RTCSR MC_R (0xD020) /* Регистр управления */ +#define MC_RTPERIOD MC_R (0xD024) /* Регистр периода работы таймера */ +#define MC_RTCOUNT MC_R (0xD028) /* Регистр счетчика */ + +/* + * Регистры линковых портов LPORT0...LPORT3 + */ +#ifdef MC_HAVE_LPORT +#define MC_LTX(n) MC_R (0x7000+(n<<12)) /* Буфер передачи */ +#define MC_LRX(n) MC_R (0x7000+(n<<12)) /* Буфер приема */ +#define MC_LCSR(n) MC_R (0x7004+(n<<12)) /* Регистр управления и состояния */ +#define MC_LDIR(n) MC_R (0x7008+(n<<12)) /* Регистр управления */ +#define MC_LDR(n) MC_R (0x700C+(n<<12)) /* Регистр данных */ +#endif + +/* + * Регистры портов обмена последовательным кодом SPORT0, SPORT1 + */ +#ifdef MC_HAVE_SPORT +#define MC_STX(n) MC_R (0x5000+(n<<12)) /* Буфер передачи данных */ +#define MC_RX(n) MC_R (0x5000+(n<<12)) /* Буфер приема данных */ +#define MC_STCTL(n) MC_R (0x5004+(n<<12)) /* Регистр управления передачей данных */ +#define MC_SRCTL(n) MC_R (0x5008+(n<<12)) /* Регистр управления приемом данных */ +#define MC_TDIV(n) MC_R (0x500C+(n<<12)) /* Регистр коэффициентов деления при передаче */ +#define MC_RDIV(n) MC_R (0x5010+(n<<12)) /* Регистр коэффициентов деления при приеме */ +#define MC_MTCS(n) MC_R (0x5014+(n<<12)) /* Выбор канала передачи в многоканальном режиме */ +#define MC_MRCS(n) MC_R (0x5018+(n<<12)) /* Выбор канала приема в многоканальном режиме */ +#define MC_KEYWD(n) MC_R (0x501C+(n<<12)) /* Регистр кода сравнения */ +#define MC_KEYMASK(n) MC_R (0x5020+(n<<12)) /* Регистр маски сравнения */ +#define MC_MRCE(n) MC_R (0x5024+(n<<12)) /* Выбор канала для сравнения принимаемых данных */ +#endif /* MC_HAVE_SPORT */ + +/* + * Регистры интерфейсов Space Wire, размещенных в контроллере (SWIC0, SWIC1) + */ +#ifdef MC_HAVE_SWIC + +#define MC_SWIC_HW_VER(n) MC_R (0x5000 + (n<<12)) /* Регистр аппаратной версии контроллера */ +#define MC_SWIC_STATUS(n) MC_R (0x5004 + (n<<12)) /* Регистр состояния */ +#define MC_SWIC_RX_CODE(n) MC_R (0x5008 + (n<<12)) /* Регистр принятого управляющего символа */ +#define MC_SWIC_MODE_CR(n) MC_R (0x500C + (n<<12)) /* Регистр управления режимом работы */ +#define MC_SWIC_TX_SPEED(n) MC_R (0x5010 + (n<<12)) /* Регистр управления скоростью передачи */ +#define MC_SWIC_TX_CODE(n) MC_R (0x5014 + (n<<12)) /* Регистр передаваемого управляющего символа */ +#define MC_SWIC_RX_SPEED(n) MC_R (0x5018 + (n<<12)) /* Регистр измерителя скорости приема */ +#define MC_SWIC_CNT_RX_PACK(n) MC_R (0x501C + (n<<12)) /* Регистр счетчика принятых пакетов ненулевой длины */ +#define MC_SWIC_CNT_RX0_PACK(n) MC_R (0x5020 + (n<<12)) /* Регистр счетчика принятых пакетов нулевой длины */ +#define MC_SWIC_ISR_L(n) MC_R (0x5024 + (n<<12)) /* Регистр кодов распределенных прерываний (младшая часть) */ +#define MC_SWIC_ISR_H(n) MC_R (0x5028 + (n<<12)) /* Регистр кодов распределенных прерываний (старшая часть) */ + +/* Каналы записи в память дескрипторов принимаемых пакетов SpaceWire */ +#define MC_SWIC_RX_DESC_CSR(n) MC_R (0x0200 + (n<<8)) /* Регистр управления и состояния */ +#define MC_SWIC_RX_DESC_CP(n) MC_R (0x0208 + (n<<8)) /* Регистр указателя цепочки */ +#define MC_SWIC_RX_DESC_IR(n) MC_R (0x020C + (n<<8)) /* Индексный регистр памяти */ +#define MC_SWIC_RX_DESC_OR(n) MC_R (0x0210 + (n<<8)) /* Регистр смещения памяти */ +#define MC_SWIC_RX_DESC_Y(n) MC_R (0x0214 + (n<<8)) /* Регистр параметров направления Y при + * двухмерной адресации памяти */ +#define MC_SWIC_RX_DESC_RUN(n) MC_R (0x0218 + (n<<8)) /* Псевдорегистр управления состоянием бита RUN */ + +/* Каналы записи в память принимаемых слов данных SpaceWire */ +#define MC_SWIC_RX_DATA_CSR(n) MC_R (0x0240 + (n<<8)) /* Регистр управления и состояния */ +#define MC_SWIC_RX_DATA_CP(n) MC_R (0x0248 + (n<<8)) /* Регистр указателя цепочки */ +#define MC_SWIC_RX_DATA_IR(n) MC_R (0x024C + (n<<8)) /* Индексный регистр памяти */ +#define MC_SWIC_RX_DATA_OR(n) MC_R (0x0250 + (n<<8)) /* Регистр смещения памяти */ +#define MC_SWIC_RX_DATA_Y(n) MC_R (0x0254 + (n<<8)) /* Регистр параметров направления Y при + * двухмерной адресации памяти */ +#define MC_SWIC_RX_DATA_RUN(n) MC_R (0x0258 + (n<<8)) /* Псевдорегистр управления состоянием бита RUN */ + +/* Каналы чтения из памяти дескрипторов передаваемых пакетов SpaceWire */ +#define MC_SWIC_TX_DESC_CSR(n) MC_R (0x0280 + (n<<8)) /* Регистр управления и состояния */ +#define MC_SWIC_TX_DESC_CP(n) MC_R (0x0288 + (n<<8)) /* Регистр указателя цепочки */ +#define MC_SWIC_TX_DESC_IR(n) MC_R (0x028C + (n<<8)) /* Индексный регистр памяти */ +#define MC_SWIC_TX_DESC_OR(n) MC_R (0x0290 + (n<<8)) /* Регистр смещения памяти */ +#define MC_SWIC_TX_DESC_Y(n) MC_R (0x0294 + (n<<8)) /* Регистр параметров направления Y при + * двухмерной адресации памяти */ +#define MC_SWIC_TX_DESC_RUN(n) MC_R (0x0298 + (n<<8)) /* Псевдорегистр управления состоянием бита RUN */ + +/* Каналы чтения из памяти передаваемых слов данных SpaceWire */ +#define MC_SWIC_TX_DATA_CSR(n) MC_R (0x02C0 + (n<<8)) /* Регистр управления и состояния */ +#define MC_SWIC_TX_DATA_CP(n) MC_R (0x02C8 + (n<<8)) /* Регистр указателя цепочки */ +#define MC_SWIC_TX_DATA_IR(n) MC_R (0x02CC + (n<<8)) /* Индексный регистр памяти */ +#define MC_SWIC_TX_DATA_OR(n) MC_R (0x02D0 + (n<<8)) /* Регистр смещения памяти */ +#define MC_SWIC_TX_DATA_Y(n) MC_R (0x02D4 + (n<<8)) /* Регистр параметров направления Y при + * двухмерной адресации памяти */ +#define MC_SWIC_TX_DATA_RUN(n) MC_R (0x02D8 + (n<<8)) /* Псевдорегистр управления состоянием бита RUN */ + +#endif /* MC_HAVE_SWIC */ + +/* + * Регистры DMA + */ + +/* Каналы LpCh0...LpCh3 */ +#define MC_CSR_LPCH(n) MC_R (0x0400+(n<<8)) /* Регистр управления и состояния */ +#define MC_CP_LPCH(n) MC_R (0x0408+(n<<8)) /* Регистр указателя цепочки */ +#define MC_IR_LPCH(n) MC_R (0x040C+(n<<8)) /* Индексный регистр памяти */ +#define MC_OR_LPCH(n) MC_R (0x0410+(n<<8)) /* Регистр смещения памяти */ +#define MC_Y_LPCH(n) MC_R (0x0414+(n<<8)) /* Регистр параметров направления Y при + * двухмерной адресации памяти */ +/* Каналы MemCh0...MemCh3 */ +#define MC_CSR_MEMCH(n) MC_R (0x0800+(n<<8)) /* Регистр управления и состояния */ +#define MC_IOR_MEMCH(n) MC_R (0x0804+(n<<8)) /* Регистр индекса и смещения внутренней памяти */ +#define MC_CP_MEMCH(n) MC_R (0x0808+(n<<8)) /* Регистр указателя цепочки */ +#define MC_IR_MEMCH(n) MC_R (0x080C+(n<<8)) /* Индексный регистр внешней памяти */ +#define MC_OR_MEMCH(n) MC_R (0x0810+(n<<8)) /* Регистр смещения внешней памяти */ +#define MC_Y_MEMCH(n) MC_R (0x0814+(n<<8)) /* Регистр параметров направления Y при + * двухмерной адресации внешней памяти */ +#define MC_RUN(n) MC_R (0x0818+(n<<8)) /* Псевдорегистр управления состоянием бита RUN */ + +#endif /* _IO_MC24_H */ diff -urN linux-2.6.36_orig//arch/mips/include/asm/mach-multicore/io-nvcom01.h linux-2.6.36//arch/mips/include/asm/mach-multicore/io-nvcom01.h --- linux-2.6.36_orig//arch/mips/include/asm/mach-multicore/io-nvcom01.h 1970-01-01 03:00:00.000000000 +0300 +++ linux-2.6.36//arch/mips/include/asm/mach-multicore/io-nvcom01.h 2011-02-27 05:19:59.000000000 +0300 @@ -0,0 +1,264 @@ +/* + * Hardware register defines for Elvees NVCom-01 microcontroller. + * + * Copyright (C) 2010 Serge Vakulenko, + * + * This file 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. + * + * You can redistribute this file and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software Foundation; + * either version 2 of the License, or (at your discretion) any later version. + * See the accompanying file "COPYING.txt" for more details. + * + * As a special exception to the GPL, permission is granted for additional + * uses of the text contained in this file. See the accompanying file + * "COPY-UOS.txt" for details. + */ +#ifndef _IO_NVCOM01_H +#define _IO_NVCOM01_H + +#define MC_R(a) *(volatile unsigned*)(0xB82F0000 + (a)) + +/* + * Регистры DMA MEM(0-3) + */ +#define MC_CSR_MEM(n) MC_R (0x0000+(n<<7)) /* Управление и состояние */ +#define MC_CP_MEM(n) MC_R (0x0004+(n<<7)) /* Указатель цепочки */ +#define MC_IR0_MEM(n) MC_R (0x0008+(n<<7)) /* Индекс "0" внешней памяти */ +#define MC_IR1_MEM(n) MC_R (0x000C+(n<<7)) /* Индекс "1" внешней памяти */ +#define MC_OR_MEM(n) MC_R (0x0010+(n<<7)) /* Смещение внешней памяти */ +#define MC_Y_MEM(n) MC_R (0x0014+(n<<7)) /* Параметры направления Y при + * двухмерной адресации */ +#define MC_RUN_MEM(n) MC_R (0x0018+(n<<7)) /* Управление состоянием бита RUN */ + +/* + * Регистры DMA VPIN + */ +#define MC_DMACSR_VPIN MC_R (0x8800) /* Управление и состояние */ +#define MC_CP_VPIN MC_R (0x8804) /* Указатель цепочки */ +#define MC_IR_VPIN MC_R (0x8808) /* Индекс */ +#define MC_OR_VPIN MC_R (0x880C) /* Смещение */ +#define MC_Y_VPIN MC_R (0x8810) /* Параметры направления Y при двухмерной адресации */ +#define MC_RUN_VPIN MC_R (0x8814) /* Управления состоянием бита RUN */ + +/* + * Регистры DMA VPOUT + */ +#define MC_DMACSR_VPOUT MC_R (0x9800) /* Управление и состояние */ +#define MC_CP_VPOUT MC_R (0x9804) /* Указатель цепочки */ +#define MC_IR_VPOUT MC_R (0x9808) /* Индекс */ +#define MC_OR_VPOUT MC_R (0x980C) /* Смещение */ +#define MC_Y_VPOUT MC_R (0x9810) /* Параметры направления Y при двухмерной адресации */ +#define MC_RUN_VPOUT MC_R (0x9814) /* Управление состоянием бита RUN */ + +/* + * Регистры DMA EMAC(0-1) + */ +#define MC_CSR_EMAC(n) MC_R (0xE800+(n<<6)) /* Управление и состояние */ +#define MC_CP_EMAC(n) MC_R (0xE804+(n<<6)) /* Указатель цепочки */ +#define MC_IR_EMAC(n) MC_R (0xE808+(n<<6)) /* Индекс */ +#define MC_RUN_EMAC(n) MC_R (0xE80C+(n<<6)) /* Управление состоянием бита RUN */ + +/* + * Регистры DMA USB(0-3) + */ +#define MC_CSR_USB(n) MC_R (0xC800+(n<<6)) /* Управление и состояние */ +#define MC_CP_USB(n) MC_R (0xC804+(n<<6)) /* Указатель цепочки */ +#define MC_IR_USB(n) MC_R (0xC808+(n<<6)) /* Индекс */ +#define MC_OR_USB(n) MC_R (0xC80C+(n<<6)) /* Смещение */ +#define MC_Y_USB(n) MC_R (0xC810+(n<<6)) /* Параметры направления Y при двухмерной адресации */ +#define MC_RUN_USB(n) MC_R (0xC814+(n<<6)) /* Управление состоянием бита RUN */ + +/* + * Регистры DMA MFBSP(0-3) + */ +#define MC_CSR_MFBSP(n) MC_R (0x7800+(n<<6)) /* Управление и состояние */ +#define MC_CP_MFBSP(n) MC_R (0x7804+(n<<6)) /* Указатель цепочки */ +#define MC_IR_MFBSP(n) MC_R (0x7808+(n<<6)) /* Индекс */ +#define MC_RUN_MFBSP(n) MC_R (0x780C+(n<<6)) /* Управления состоянием бита RUN */ + +/* + * Регистры I2C + */ +#define MC_I2C_PRER MC_R (0x2000) /* Предделитель частоты */ +#define MC_I2C_CTR MC_R (0x2004) /* Управление */ +#define MC_I2C_TXR MC_R (0x2008) /* Передача данных */ +#define MC_I2C_RXR MC_R (0x200C) /* Прием данных */ +#define MC_I2C_CR MC_R (0x2010) /* Команды */ +#define MC_I2C_SR MC_R (0x2014) /* Состояние */ +#define MC_I2C_PR_CNT MC_R (0x2018) /* Счетчик предделителя частоты */ + +/* + * Регистры UART0, UART1 + */ +#define MC_RBR MC_R (0x3000) /* Приемный буферный регистр */ +#define MC_THR MC_R (0x3000) /* Передающий буферный регистр */ +#define MC_IER MC_R (0x3004) /* Регистр разрешения прерываний */ +#define MC_IIR MC_R (0x3008) /* Регистр идентификации прерывания */ +#define MC_FCR MC_R (0x3008) /* Регистр управления FIFO */ +#define MC_LCR MC_R (0x300C) /* Регистр управления линией */ +#define MC_MCR MC_R (0x3010) /* Регистр управления модемом */ +#define MC_LSR MC_R (0x3014) /* Регистр состояния линии */ +#define MC_MSR MC_R (0x3018) /* Регистр состояния модемом */ +#define MC_SPR MC_R (0x301C) /* Регистр Scratch Pad */ +#define MC_DLL MC_R (0x3000) /* Регистр делителя младший */ +#define MC_DLM MC_R (0x3004) /* Регистр делителя старший */ +#define MC_SCLR MC_R (0x3014) /* Регистр предделителя (scaler) */ + +#define MC_RBR1 MC_R (0x3800) /* Приемный буферный регистр */ +#define MC_THR1 MC_R (0x3800) /* Передающий буферный регистр */ +#define MC_IER1 MC_R (0x3804) /* Регистр разрешения прерываний */ +#define MC_IIR1 MC_R (0x3808) /* Регистр идентификации прерывания */ +#define MC_FCR1 MC_R (0x3808) /* Регистр управления FIFO */ +#define MC_LCR1 MC_R (0x380C) /* Регистр управления линией */ +#define MC_MCR1 MC_R (0x3810) /* Регистр управления модемом */ +#define MC_LSR1 MC_R (0x3814) /* Регистр состояния линии */ +#define MC_MSR1 MC_R (0x3818) /* Регистр состояния модемом */ +#define MC_SPR1 MC_R (0x381C) /* Регистр Scratch Pad */ +#define MC_DLL1 MC_R (0x3800) /* Регистр делителя младший */ +#define MC_DLM1 MC_R (0x3804) /* Регистр делителя старший */ +#define MC_SCLR1 MC_R (0x3814) /* Регистр предделителя (scaler) */ + +/* + * Регистры интервального таймера IT0, IT1 + */ +#define MC_ITCSR MC_R (0xD000) /* Управление */ +#define MC_ITPERIOD MC_R (0xD004) /* Период работы таймера */ +#define MC_ITCOUNT MC_R (0xD008) /* Счетчик */ +#define MC_ITSCALE MC_R (0xD00C) /* Предделитель */ + +#define MC_ITCSR1 MC_R (0xD020) /* Управление */ +#define MC_ITPERIOD1 MC_R (0xD024) /* Период работы таймера */ +#define MC_ITCOUNT1 MC_R (0xD028) /* Счетчик */ +#define MC_ITSCALE1 MC_R (0xD02C) /* Предделитель */ + +/* + * Регистры WDT + */ +#define MC_WTCSR MC_R (0xD010) /* Управление */ +#define MC_WTPERIOD MC_R (0xD014) /* Период работы таймера */ +#define MC_WTCOUNT MC_R (0xD018) /* Счетчик */ +#define MC_WTSCALE MC_R (0xD01C) /* Предделитель */ + +/* + * Регистры MFBSP(0-3) + */ +#define MC_MFBSP_TX(n) MC_R (0x7000+(n<<8)) /* Буфер передачи данных */ +#define MC_MFBSP_RX(n) MC_R (0x7000+(n<<8)) /* Буфер приема данных */ +#define MC_MFBSP_CSR(n) MC_R (0x7004+(n<<8)) /* Управление и состояние */ +#define MC_MFBSP_DIR(n) MC_R (0x7008+(n<<8)) /* Управление направлением + * порта ввода-вывода */ +#define MC_MFBSP_GPIO_DR(n) MC_R (0x700C+(n<<8)) /* Данные порта ввода-вывода */ +#define MC_MFBSP_TCTR(n) MC_R (0x7010+(n<<8)) /* Управление передатчиком */ +#define MC_MFBSP_RCTR(n) MC_R (0x7014+(n<<8)) /* Управление приёмником */ +#define MC_MFBSP_TSR(n) MC_R (0x7018+(n<<8)) /* Состояние передатчика */ +#define MC_MFBSP_RSR(n) MC_R (0x701C+(n<<8)) /* Состояние приёмника */ +#define MC_MFBSP_TCTR_RATE(n) MC_R (0x7020+(n<<8)) /* Управление темпом передачи данных */ +#define MC_MFBSP_RCTR_RATE(n) MC_R (0x7024+(n<<8)) /* Управление темпом приёма данных */ + +/* + * Регистры VPIN + */ +#define MC_CSR_VPIN MC_R (0x8000) /* Управление и состояние */ +#define MC_CNT_VPIN MC_R (0x8004) /* Счетчик строк / счетчик пикселов */ +#define MC_FRAME_CNT_VPIN MC_R (0x8008) /* Счетчик кадров */ +#define MC_FIFO_VPIN MC_R (0x800C) /* Выход FIFO */ + +/* + * Регистры VPOUT + */ +#define MC_CSR_VPOUT MC_R (0x9000) /* Управление и состояние */ +#define MC_DIV MC_R (0x9004) /* Период сигнала VCLKO_out */ +#define MC_HSTART_HEND MC_R (0x9008) /* Начало/конец активной части строки */ +#define MC_VSTART_VEND MC_R (0x900C) /* Начало/конец активной части кадра */ +#define MC_CNT_VPOUT MC_R (0x9010) /* Счетчик строк / счетчик пикселов */ +#define MC_FRAME_CNT_VPOUT MC_R (0x9014) /* Счетчик кадров */ +#define MC_FIFO_VPOUT MC_R (0x901C) /* Вход FIFO */ + +/* + * Регистры USB + */ +#define MC_USB_CSR MC_R (0xC000) /* Управление и статус контроллера */ +#define MC_USB_INT_CSR MC_R (0xC004) /* Управление и статус прерываний */ +#define MC_USB_VENDOR_DATA MC_R (0xC008) /* Данные для передачи по Vendor-каналу */ +#define MC_USB_VENDOR_INDEX MC_R (0xC00C) /* Указатель на данные по Vendor-каналу */ +#define MC_USB_VENDOR_VALUE MC_R (0xC010) /* Принятые данные по Vendor-каналу */ +#define MC_USB_CFG_ADDR MC_R (0xC014) /* Адрес массива конфигурации */ +#define MC_USB_CFG_DATA MC_R (0xC018) /* Данные массива конфигурации */ +#define MC_USB_REVISION MC_R (0xC01C) /* Номер ревизии */ +#define MC_USB_CSR_EP1 MC_R (0xC020) /* Управление и статус ЕР1 */ +#define MC_USB_CSR_EP2 MC_R (0xC024) /* Управление и статус ЕР2 */ +#define MC_USB_CSR_EP3 MC_R (0xC028) /* Управление и статус ЕР3 */ +#define MC_USB_CSR_EP4 MC_R (0xC02C) /* Управление и статус ЕР4 */ + +/* + * Регистры Ethernet MAC + */ +#define MC_MAC_CONTROL MC_R (0xE000) /* Управление MAC */ +#define MC_MAC_ADDR_L MC_R (0xE004) /* Младшая часть исходного адреса MAC */ +#define MC_MAC_ADDR_H MC_R (0xE008) /* Старшая часть исходного адреса MAC */ +#define MC_MAC_DADDR_L MC_R (0xE00C) /* Младшая часть адреса назначения */ +#define MC_MAC_DADDR_H MC_R (0xE010) /* Старшая часть адреса назначения */ +#define MC_MAC_FCS_CLIENT MC_R (0xE014) /* Контрольная сумма кадра */ +#define MC_MAC_TYPE MC_R (0xE018) /* Тип кадра */ +#define MC_MAC_IFS_COLL_MODE MC_R (0xE01C) /* IFS и режим обработки коллизии */ +#define MC_MAC_TX_FRAME_CONTROL MC_R (0xE020) /* Управление передачей кадра */ +#define MC_MAC_STATUS_TX MC_R (0xE024) /* Статус передачи кадра */ +#define MC_MAC_UCADDR_L MC_R (0xE028) /* Младшая часть уникального адреса MAC */ +#define MC_MAC_UCADDR_H MC_R (0xE02C) /* Старшая часть уникального адреса MAC */ +#define MC_MAC_MCADDR_L MC_R (0xE030) /* Младшая часть группового адреса */ +#define MC_MAC_MCADDR_H MC_R (0xE034) /* Старшая часть группового адреса */ +#define MC_MAC_MCADDR_MASK_L MC_R (0xE038) /* Младшая часть маски группового адреса */ +#define MC_MAC_MCADDR_MASK_H MC_R (0xE03C) /* Старшая часть маски группового адреса */ +#define MC_MAC_HASHT_L MC_R (0xE040) /* Младшая часть хэш-таблицы */ +#define MC_MAC_HASHT_H MC_R (0xE044) /* Старшая часть хэш-таблицы */ +#define MC_MAC_RX_FRAME_CONTROL MC_R (0xE048) /* Управление приемом кадра */ +#define MC_MAC_RX_FR_MAXSIZE MC_R (0xE04C) /* Максимальный размер принимаемого кадра */ +#define MC_MAC_STATUS_RX MC_R (0xE050) /* Статус приема кадра */ +#define MC_MAC_RX_FRAME_STATUS_FIFO MC_R (0xE054) /* FIFO статусов принятых кадров */ +#define MC_MAC_MD_CONTROL MC_R (0xE058) /* Управление порта MD */ +#define MC_MAC_MD_STATUS MC_R (0xE05C) /* Статус порта MD */ +#define MC_MAC_MD_MODE MC_R (0xE060) /* Режим работы порта MD */ +#define MC_MAC_TX_TEST_CSR MC_R (0xE064) /* Управление и состояние режима тестирования TX_FIFO */ +#define MC_MAC_TX_FIFO MC_R (0xE068) /* Передающее TX_FIFO */ +#define MC_MAC_RX_TEST_CSR MC_R (0xE06C) /* Управление и состояние режима тестирования RX_FIFO */ +#define MC_MAC_RX_FIFO MC_R (0xE070) /* Принимающее RX_FIFO */ + +/* + * Регистры порта внешней памяти MPORT + */ +#define MC_CSCON0 MC_R (0x1000) /* Регистр конфигурации 0 */ +#define MC_CSCON1 MC_R (0x1004) /* Регистр конфигурации 1 */ +#define MC_CSCON2 MC_R (0x1008) /* Регистр конфигурации 2 */ +#define MC_CSCON3 MC_R (0x100C) /* Регистр конфигурации 3 */ +#define MC_CSCON4 MC_R (0x1010) /* Регистр конфигурации 4 */ +#define MC_SDRCON MC_R (0x1014) /* Регистр конфигурации памяти SDRAM */ +#define MC_SDRTMR MC_R (0x1018) /* Временные параметры памяти SDRAM */ +#define MC_SDRCSR MC_R (0x101C) /* Управление режимами памяти SDRAM */ + +/* + * Системные регистры + */ +#define MC_CRPLL MC_R (0x4000) /* Управление PLL */ +#define MC_CLKEN MC_R (0x4004) /* Управление отключением частоты от устройств */ +#define MC_CSR MC_R (0x4008) /* Управление и состояние */ +#define MC_MASKR0 MC_R (0x4010) /* Маска прерываний */ +#define MC_QSTR0 MC_R (0x4014) /* Запросы прерываний от IT, RTT, WDT, + * VPOUT, VPIN, ETHERNET MAC, USB, + * PMSC, UART, nIRQ[3:0] */ +#define MC_MASKR1 MC_R (0x4018) /* Маска прерываний от DMA MEM */ +#define MC_QSTR1 MC_R (0x401C) /* Запросы прерываний от DMA MEM */ +#define MC_MASKR2 MC_R (0x4020) /* Маска прерываний от MFBSP */ +#define MC_QSTR2 MC_R (0x4024) /* Запросы прерываний от MFBSP */ +#define MC_IRQM MC_R (0x4030) /* Режимы внешних прерываний nIRQ[3:0] */ + +/* + * Регистры многоканального коррелятора + */ +#define MC_BASE_MCC MC_R (0xF000) /* Базовый адрес регистров МСС */ +#define MC_INT_EN_MCC MC_R (0xFFF4) /* Разрешение прерывания от MCC */ +#define MC_INT_RST_MCC MC_R (0xFFF8) /* Сброс прерывания от MCC */ + +#endif /* _IO_NVCOM01_H */ diff -urN linux-2.6.36_orig//arch/mips/include/asm/mach-multicore/irq.h linux-2.6.36//arch/mips/include/asm/mach-multicore/irq.h --- linux-2.6.36_orig//arch/mips/include/asm/mach-multicore/irq.h 1970-01-01 03:00:00.000000000 +0300 +++ linux-2.6.36//arch/mips/include/asm/mach-multicore/irq.h 2011-02-27 05:19:59.000000000 +0300 @@ -0,0 +1,145 @@ +/* + * This file is subject to the terms and conditions of the + * Open Software License. + * See http://www.opensource.org/licenses/osl-2.0.php for more details. + * + * Copyright (C) 2003 gluk + * Copyright (C) 2003-2011 Elvees, Inc. + */ + +#ifndef _MCIRQ_H +#define _MCIRQ_H + +/* The grand IRQ mapping scheme is as follows: + * - first is the IRQ_ONCD, + * - then 9 MIPS IRQs, + * - then the 32 QSTR ones + * - NVCOM has also QSTR1 and QSTR2 + */ + +#define IRQMASK_BASE 7 /* This signifies the first interrupt */ + +#define MIPS_CPU_IRQ_BASE 1 +#define MIPS_IRQMASK_BASE (IRQMASK_BASE + 1) +#define MIPS_NR_IRQS 8 +#define mips_irq(x) (MIPS_CPU_IRQ_BASE + (x)) /* map MIPS IRQ numbers to global */ +#define mips_irqmask(x) (1 << (IRQMASK_BASE + (x))) + +#define QSTR_IRQ_BASE (MIPS_CPU_IRQ_BASE + MIPS_NR_IRQS) +#define QSTR_IRQMASK_BASE (MIPS_IRQMASK_BASE + MIPS_NR_IRQS) + +#define IRQ_ONCD 0 +#define IRQ_SW0 mips_irq(0) +#define IRQ_SW1 mips_irq(1) +#define IRQ_QSTR mips_irq(2) +#define IRQ_MEMCH_DMA mips_irq(3) +#define IRQ_MFBSP mips_irq(4) +#define IRQ_DSP mips_irq(6) +#define IRQ_COMPARE mips_irq(7) + +#define STATUS_MASK_ONCD mips_irqmask(IRQ_ONCD) +#define STATUS_MASK_SW0 mips_irqmask(IRQ_SW0) +#define STATUS_MASK_SW1 mips_irqmask(IRQ_SW1) +#define STATUS_MASK_QSTR mips_irqmask(IRQ_QSTR) +#define STATUS_MASK_MEMCH_DMA mips_irqmask(IRQ_MEMCH_DMA) +#define STATUS_MASK_MFBSP mips_irqmask(IRQ_MFBSP) +#define STATUS_MASK_DSP mips_irqmask(IRQ_DSP) +#define STATUS_MASK_COMPARE mips_irqmask(IRQ_COMPARE) + +#define QSTR_IRQNO(qstr_irq) (QSTR_IRQ_BASE + qstr_irq) + +#if defined(CONFIG_NVCOM01) || defined(CONFIG_NVCOM02) +# define QSTR_NR_IRQS 3 * 32 +# define QSTR1_IRQNO(qstr_irq) (QSTR_IRQ_BASE + 32 + qstr_irq) +# define QSTR2_IRQNO(qstr_irq) (QSTR_IRQ_BASE + 64 + qstr_irq) + +/* QSTR0 */ +# define IRQ_nIRQ0 QSTR_IRQNO(0) +# define IRQ_nIRQ1 QSTR_IRQNO(1) +# define IRQ_nIRQ2 QSTR_IRQNO(2) +# define IRQ_nIRQ3 QSTR_IRQNO(3) +# define IRQ_UART0 QSTR_IRQNO(4) +# define IRQ_UART1 QSTR_IRQNO(5) +# define IRQ_USB QSTR_IRQNO(7) +# define IRQ_USB_EP4 QSTR_IRQNO(8) +# define IRQ_USB_EP3 QSTR_IRQNO(9) +# define IRQ_USB_EP2 QSTR_IRQNO(10) +# define IRQ_USB_EP1 QSTR_IRQNO(11) +# define IRQ_ETH_RXFRAME QSTR_IRQNO(12) +# define IRQ_ETH_TXFRAME QSTR_IRQNO(13) +# define IRQ_ETH_DMA_RX QSTR_IRQNO(14) +# define IRQ_ETH_DMA_TX QSTR_IRQNO(15) +# define IRQ_VPIN QSTR_IRQNO(16) +# define IRQ_VPIN_RX QSTR_IRQNO(17) +# define IRQ_VPOUT QSTR_IRQNO(18) +# define IRQ_VPOUT_TX QSTR_IRQNO(19) +# define IRQ_WDT QSTR_IRQNO(20) +# define IRQ_RTT QSTR_IRQNO(21) +# define IRQ_IT QSTR_IRQNO(22) +# define IRQ_I2C QSTR_IRQNO(23) +# define IRQ_MCC QSTR_IRQNO(31) + +/* QSTR1 */ +# define IRQ_DMA_MEM_CH0 QSTR1_IRQNO(0) +# define IRQ_DMA_MEM_CH1 QSTR1_IRQNO(1) +# define IRQ_DMA_MEM_CH2 QSTR1_IRQNO(2) +# define IRQ_DMA_MEM_CH3 QSTR1_IRQNO(3) + +/* QSTR2 */ +# define IRQ_SRQ0 QSTR2_IRQNO(0) +# define IRQ_MFBSP_RX0 QSTR2_IRQNO(1) +# define IRQ_MFBSP_TX0 QSTR2_IRQNO(2) +# define IRQ_DMA_MFBSP0 QSTR2_IRQNO(3) +# define IRQ_SRQ1 QSTR2_IRQNO(4) +# define IRQ_MFBSP_RX1 QSTR2_IRQNO(5) +# define IRQ_MFBSP_TX1 QSTR2_IRQNO(6) +# define IRQ_DMA_MFBSP1 QSTR2_IRQNO(7) +# define IRQ_SRQ2 QSTR2_IRQNO(8) +# define IRQ_MFBSP_RX2 QSTR2_IRQNO(9) +# define IRQ_MFBSP_TX2 QSTR2_IRQNO(10) +# define IRQ_DMA_MFBSP2 QSTR2_IRQNO(11) +# define IRQ_SRQ3 QSTR2_IRQNO(12) +# define IRQ_MFBSP_RX3 QSTR2_IRQNO(13) +# define IRQ_MFBSP_TX3 QSTR2_IRQNO(14) +# define IRQ_DMA_MFBSP3 QSTR2_IRQNO(15) + +#else +# define QSTR_NR_IRQS 32 +/* Only QSTR */ +# define IRQ_SRx0 QSTR_IRQNO(0) /* SPORT0 */ +# define IRQ_STx0 QSTR_IRQNO(1) /* SPORT0 */ +# define IRQ_SRx1 QSTR_IRQNO(2) /* SPORT1 */ +# define IRQ_STx1 QSTR_IRQNO(3) /* SPORT1 */ +# define IRQ_UTRx QSTR_IRQNO(4) /* UART Rx/Tx */ +# define IRQ_UERROR QSTR_IRQNO(5) /* UART Rx error */ +# define IRQ_UIO QSTR_IRQNO(6) /* UART IO ports */ +# define IRQ_LTRx0 QSTR_IRQNO(7) /* LPORT0 */ +# define IRQ_LSrq0 QSTR_IRQNO(8) /* Service request from LPORT0 */ +# define IRQ_LTRx1 QSTR_IRQNO(9) /* LPORT1 */ +# define IRQ_LSrq1 QSTR_IRQNO(10) /* Service request from LPORT1 */ +# define IRQ_LTRx2 QSTR_IRQNO(11) /* LPORT2 */ +# define IRQ_LSrq2 QSTR_IRQNO(12) /* Service request from LPORT2 */ +# define IRQ_LTRx3 QSTR_IRQNO(13) /* LPORT3 */ +# define IRQ_LSrq3 QSTR_IRQNO(14) /* Service request from LPORT3 */ +# define IRQ_LTRx4 QSTR_IRQNO(15) /* LPORT4 */ +# define IRQ_LSrq4 QSTR_IRQNO(16) /* Service request from LPORT4 */ +# define IRQ_LTRx5 QSTR_IRQNO(17) /* LPORT5 */ +# define IRQ_LSrq5 QSTR_IRQNO(18) /* Service request from LPORT5 */ +# define IRQ_COMPARE QSTR_IRQNO(19) /* MIPS cp0 compare irq */ +# define IRQ_SysCh QSTR_IRQNO(20) /* DMA SysCh */ +# define IRQ_MemCh0 QSTR_IRQNO(21) /* DMA MemCh0 */ +# define IRQ_MemCh1 QSTR_IRQNO(22) /* DMA MemCh1 */ +# define IRQ_MemCh2 QSTR_IRQNO(23) /* DMA MemCh2 */ +# define IRQ_MemCh3 QSTR_IRQNO(24) /* DMA MemCh3 */ +# define IRQ_MemCh4 QSTR_IRQNO(25) /* DMA MemCh4 */ +# define IRQ_MemCh5 QSTR_IRQNO(26) /* DMA MemCh5 */ +# define IRQ_MemCh6 QSTR_IRQNO(27) /* DMA MemCh6 */ +# define IRQ_MemCh7 QSTR_IRQNO(28) /* DMA MemCh7 */ +# define IRQ_TIMER QSTR_IRQNO(29) /* Timer */ +# define IRQ_PI QSTR_IRQNO(30) /* Software DSP irq */ +# define IRQ_SBS QSTR_IRQNO(31) /* Hardware DSP irq */ +#endif // CONFIG_NVCOM01 + +# define NR_IRQS (MIPS_CPU_IRQ_BASE + MIPS_NR_IRQS + QSTR_NR_IRQS) + +#endif diff -urN linux-2.6.36_orig//arch/mips/include/asm/mach-multicore/multicore.h linux-2.6.36//arch/mips/include/asm/mach-multicore/multicore.h --- linux-2.6.36_orig//arch/mips/include/asm/mach-multicore/multicore.h 1970-01-01 03:00:00.000000000 +0300 +++ linux-2.6.36//arch/mips/include/asm/mach-multicore/multicore.h 2011-02-27 05:19:59.000000000 +0300 @@ -0,0 +1,54 @@ +/* + * This file is subject to the terms and conditions of the + * Open Software License. + * See http://www.opensource.org/licenses/osl-2.0.php for more details. + * + * Copyright (C) 2011 Elvees, Inc. + */ + +#ifndef _MULTICORE_H +#define _MULTICORE_H + +#include + +#define MC_QUARTZ_CLOCK_FREQ (CONFIG_MULTICORE_CLOCKFREQ * 1000000) +#define MC_MEMSIZE (1048576 * CONFIG_MULTICORE_MEMORY) + +#include + +#ifdef CONFIG_NVCOM01 +/* This file was taken from uOS */ +# define ELVEES_NVCOM01 +# include "io-nvcom01.h" +#endif + +#ifdef CONFIG_NVCOM02 +/* This file was taken from uOS */ +# define ELVEES_NVCOM02 +# include "io-nvcom02.h" +#endif + +#ifdef CONFIG_MC24 +/* This file was taken from uOS */ +# define ELVEES_MC24 +# include "io-mc24.h" +#endif + +/* This file was taken from uOS */ +#include "io-elvees.h" + +#if defined(CONFIG_NVCOM01) || defined(CONFIG_NVCOM02) +# define CR_PLL_CLKMASK 0x7f0000 +# define CR_PLL_CLKSHIFT 16 +# define mc_frequency_multiplier() ((MC_CRPLL & CR_PLL_CLKMASK) >> CR_PLL_CLKSHIFT) +#else +# define CSR_CLKMASK 0x1f0 +# define CSR_CLKSHIFT 4 +# define mc_frequency_multiplier() ((MC_CRPLL & CSR_CLKMASK) >> CSR_CLKSHIFT) +#endif + +extern struct bus_type mcbus; +extern u64 mcbus_dma_mask; + + +#endif /* _MULTICORE_H */ diff -urN linux-2.6.36_orig//arch/mips/include/asm/mach-multicore/war.h linux-2.6.36//arch/mips/include/asm/mach-multicore/war.h --- linux-2.6.36_orig//arch/mips/include/asm/mach-multicore/war.h 1970-01-01 03:00:00.000000000 +0300 +++ linux-2.6.36//arch/mips/include/asm/mach-multicore/war.h 2011-02-27 05:19:59.000000000 +0300 @@ -0,0 +1,25 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2002, 2004, 2007 by Ralf Baechle + */ +#ifndef __ASM_MIPS_MACH_MULTICORE_WAR_H +#define __ASM_MIPS_MACH_MULTICORE_WAR_H + +#define R4600_V1_INDEX_ICACHEOP_WAR 0 +#define R4600_V1_HIT_CACHEOP_WAR 0 +#define R4600_V2_HIT_CACHEOP_WAR 0 +#define R5432_CP0_INTERRUPT_WAR 0 +#define BCM1250_M3_WAR 0 +#define SIBYTE_1956_WAR 0 +#define MIPS4K_ICACHE_REFILL_WAR 0 +#define MIPS_CACHE_SYNC_WAR 0 +#define TX49XX_ICACHE_INDEX_INV_WAR 0 +#define RM9000_CDEX_SMP_WAR 0 +#define ICACHE_REFILLS_WORKAROUND_WAR 0 +#define R10000_LLSC_WAR 0 +#define MIPS34K_MISSED_ITLB_WAR 0 + +#endif /* __ASM_MIPS_MACH_MULTICORE_WAR_H */ diff -urN linux-2.6.36_orig//arch/mips/Kbuild linux-2.6.36//arch/mips/Kbuild --- linux-2.6.36_orig//arch/mips/Kbuild 2010-10-21 00:30:22.000000000 +0400 +++ linux-2.6.36//arch/mips/Kbuild 2011-02-27 05:19:59.000000000 +0300 @@ -1,7 +1,7 @@ # Fail on warnings - also for files referenced in subdirs # -Werror can be disabled for specific files using: # CFLAGS_ := -Wno-error -subdir-ccflags-y := -Werror +#subdir-ccflags-y := -Werror # platform specific definitions include arch/mips/Kbuild.platforms diff -urN linux-2.6.36_orig//arch/mips/Kbuild.platforms linux-2.6.36//arch/mips/Kbuild.platforms --- linux-2.6.36_orig//arch/mips/Kbuild.platforms 2010-10-21 00:30:22.000000000 +0400 +++ linux-2.6.36//arch/mips/Kbuild.platforms 2011-02-27 05:19:59.000000000 +0300 @@ -14,6 +14,7 @@ platforms += loongson platforms += mipssim platforms += mti-malta +platforms += multicore platforms += pmc-sierra platforms += pnx833x platforms += pnx8550 diff -urN linux-2.6.36_orig//arch/mips/Kconfig linux-2.6.36//arch/mips/Kconfig --- linux-2.6.36_orig//arch/mips/Kconfig 2010-10-21 00:30:22.000000000 +0400 +++ linux-2.6.36//arch/mips/Kconfig 2011-02-27 05:19:59.000000000 +0300 @@ -252,6 +252,19 @@ This enables support for the MIPS Technologies Malta evaluation board. +config MULTICORE + bool "Elvees Multicore platforms" + select BOOT_ELF32 + select CEVT_R4K + select CSRC_R4K + select DMA_COHERENT + select IRQ_CPU + select CPU_MIPS32 + select SYS_HAS_CPU_MIPS32_R1 + select SYS_SUPPORTS_32BIT_KERNEL + select SYS_SUPPORTS_LITTLE_ENDIAN + select SYS_SUPPORTS_MULTITHREADING + config MIPS_SIM bool 'MIPS simulator (MIPSsim)' select CEVT_R4K @@ -721,6 +734,7 @@ source "arch/mips/vr41xx/Kconfig" source "arch/mips/cavium-octeon/Kconfig" source "arch/mips/loongson/Kconfig" +source "arch/mips/multicore/Kconfig" endmenu @@ -878,6 +892,10 @@ config NO_IOPORT def_bool n +config INDEXED_R4K_TLB + bool + default n + config GENERIC_ISA_DMA bool select ZONE_DMA if GENERIC_ISA_DMA_SUPPORT_BROKEN=n @@ -1117,7 +1135,7 @@ config CPU_MIPS32_R1 bool "MIPS32 Release 1" depends on SYS_HAS_CPU_MIPS32_R1 - select CPU_HAS_PREFETCH +# select CPU_HAS_PREFETCH select CPU_SUPPORTS_32BIT_KERNEL select CPU_SUPPORTS_HIGHMEM help diff -urN linux-2.6.36_orig//arch/mips/kernel/cpu-probe.c linux-2.6.36//arch/mips/kernel/cpu-probe.c --- linux-2.6.36_orig//arch/mips/kernel/cpu-probe.c 2010-10-21 00:30:22.000000000 +0400 +++ linux-2.6.36//arch/mips/kernel/cpu-probe.c 2011-02-27 05:19:59.000000000 +0300 @@ -188,6 +188,7 @@ case CPU_CAVIUM_OCTEON: case CPU_CAVIUM_OCTEON_PLUS: case CPU_JZRISC: + case CPU_MULTICORE: cpu_wait = r4k_wait; break; @@ -886,6 +887,34 @@ } } +static inline void cpu_probe_multicore(struct cpuinfo_mips *c, unsigned int cpu) +{ + switch (c->processor_id & 0xff00) { + case PRID_IMP_MC12: + case PRID_IMP_MC24R: + __cpu_name[cpu] = "Elvees Multicore"; + c->cputype = CPU_MULTICORE; + c->options = MIPS_CPU_TLB | MIPS_CPU_4KEX | + MIPS_CPU_COUNTER | MIPS_CPU_LLSC; + c->isa_level = MIPS_CPU_ISA_M32R1; + c->tlbsize = 16; +#ifdef CONFIG_MULTICORE_NO_TLB_CACHE + c->icache.flags = MIPS_CACHE_NOT_PRESENT; +#else + c->icache.flags = MIPS_CACHE_ALIASES; + c->icache.linesz = 16; + c->icache.ways = 1; + c->icache.sets = 1024; + c->icache.waysize = 16384; + c->icache.waybit = 10; +#endif + c->dcache.flags = MIPS_CACHE_NOT_PRESENT; + c->scache.flags = MIPS_CACHE_NOT_PRESENT; + c->tcache.flags = MIPS_CACHE_NOT_PRESENT; + break; + } +} + static inline void cpu_probe_nxp(struct cpuinfo_mips *c, unsigned int cpu) { decode_configs(c); @@ -1008,6 +1037,9 @@ case PRID_COMP_SANDCRAFT: cpu_probe_sandcraft(c, cpu); break; + case PRID_COMP_ELVEES: + cpu_probe_multicore(c, cpu); + break; case PRID_COMP_NXP: cpu_probe_nxp(c, cpu); break; diff -urN linux-2.6.36_orig//arch/mips/kernel/head.S linux-2.6.36//arch/mips/kernel/head.S --- linux-2.6.36_orig//arch/mips/kernel/head.S 2010-10-21 00:30:22.000000000 +0400 +++ linux-2.6.36//arch/mips/kernel/head.S 2011-02-27 05:19:59.000000000 +0300 @@ -195,6 +195,20 @@ set_saved_sp sp, t0, t1 PTR_SUBU sp, 4 * SZREG # init stack pointer + mfc0 k0,CP0_CONFIG + li k1,~CONF_CM_CMASK + and k0,k0,k1 +#ifdef CONFIG_MULTICORE_NO_FM_CACHE + ori k0,k0,CONF_CM_UNCACHED +#else + ori k0,k0,CONF_CM_CACHABLE_NONCOHERENT //CONF_CM_UNCACHED +#endif + mtc0 k0,CP0_CONFIG + /* Give it a few cycles to sink in... */ + nop + nop + nop + j start_kernel END(kernel_entry) diff -urN linux-2.6.36_orig//arch/mips/mm/cache.c linux-2.6.36//arch/mips/mm/cache.c --- linux-2.6.36_orig//arch/mips/mm/cache.c 2010-10-21 00:30:22.000000000 +0400 +++ linux-2.6.36//arch/mips/mm/cache.c 2011-02-27 05:19:59.000000000 +0300 @@ -210,6 +210,12 @@ octeon_cache_init(); } + if (cpu_has_multicore_cache) { + extern void __weak mc_cache_init(void); + + mc_cache_init(); + } + setup_protection_map(); } diff -urN linux-2.6.36_orig//arch/mips/mm/c-mc.c linux-2.6.36//arch/mips/mm/c-mc.c --- linux-2.6.36_orig//arch/mips/mm/c-mc.c 1970-01-01 03:00:00.000000000 +0300 +++ linux-2.6.36//arch/mips/mm/c-mc.c 2011-02-27 05:19:59.000000000 +0300 @@ -0,0 +1,153 @@ +/* + * This file is subject to the terms and conditions of the + * Open Software License. + * See http://www.opensource.org/licenses/osl-2.0.php for more details. + * + * Elvis CPU variant specific MMU/Cache routines. + * + * Copyright (C) 2003 gluk + * Copyright (C) 2003-2009 Elvees, Inc. + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/* CP0 hazard avoidance. */ +#define BARRIER __asm__ __volatile__(".set noreorder\n\t" \ + "nop; nop; nop; nop; nop; nop;\n\t" \ + ".set reorder\n\t") + +static void mc_flush_cache_sigtramp(unsigned long addr); +static void mc_flush_cache_all(void); +static void mc_flush_cache_mm(struct mm_struct *mm); +static void mc_flush_cache_range(unsigned long start, unsigned long end); +static void mc_flush_cache_addr(unsigned long addr); +static void mc_flush_cache_page(struct vm_area_struct *vma, unsigned long page, unsigned long pfn); + +#if 0 +static void nothing(void) {} +/* should be enabled after CONFIG_CPU_MC option realization */ +/* + * Dummy cache handling routines for machines without boardcaches + */ + +static struct bcache_ops no_sc_ops = { + (void *)nothing, (void *)nothing, + (void *)nothing, (void *)nothing +}; + +struct bcache_ops *bcops = &no_sc_ops; +#endif + +static void mc_flush_cache_sigtramp(unsigned long addr) +{ + /* + * This makes sense !!! + * When uncommented, kernel traps at exit from shell. + */ + mc_flush_cache_all(); +} + +static void mc_flush_cache_all(void) +{ + MC_CSR |= MC_CSR_FLUSH_I; +#ifdef CONFIG_NVCOM01 + MC_CSR |= MC_CSR_FLUSH_D; +#endif + BARRIER; + BARRIER; +} + +static void mc_flush_cache_mm(struct mm_struct *mm) +{ + mc_flush_cache_all(); +} + +static void mc_flush_cache_vma_range(struct vm_area_struct *vma, unsigned long start, unsigned long end) +{ + /* don't make sense */ + mc_flush_cache_all(); +} + +static void mc_flush_cache_range(unsigned long start, unsigned long end) +{ + /* don't make sense */ + mc_flush_cache_all(); +} + +static void mc_flush_cache_addr(unsigned long addr) +{ + mc_flush_cache_all(); +} + +static void mc_flush_cache_page(struct vm_area_struct *vma, unsigned long page, unsigned long pfn) +{ + mc_flush_cache_all(); +} + +#if 0 +/* XXX: merge with c-r4k.c */ +static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size) +{ + bc_wback_inv(addr, size); +} + +/* XXX: merge with c-r4k.c */ +static void r4k_dma_cache_inv(unsigned long addr, unsigned long size) +{ + bc_inv(addr, size); +} +#endif + +void __cpuinit mc_cache_init(void) +{ + extern void build_clear_page(void); + extern void build_copy_page(void); + int c0_config; + + c0_config = read_c0_config(); + write_c0_config((c0_config & (~((u_int32_t)CONF_CM_CMASK))) | CONF_CM_UNCACHED); + + MC_CSR |= MC_CSR_FLUSH_I; +#ifdef CONFIG_NVCOM01 + MC_CSR |= MC_CSR_FLUSH_D; +#endif + + __flush_cache_all = mc_flush_cache_all; +/* __flush_dcache_page = mc_flush_cache_page; */ + flush_data_cache_page = mc_flush_cache_addr; + + flush_cache_all = mc_flush_cache_all; + flush_cache_mm = mc_flush_cache_mm; + flush_cache_range = mc_flush_cache_vma_range; + flush_cache_page = mc_flush_cache_page; + + flush_icache_all = mc_flush_cache_all; + flush_icache_range = mc_flush_cache_range; + local_flush_icache_range = mc_flush_cache_range; + + flush_cache_sigtramp = mc_flush_cache_sigtramp; + +#ifdef CONFIG_DMA_NONCOHERENT + _dma_cache_wback_inv = r4k_dma_cache_wback_inv; + _dma_cache_wback = r4k_dma_cache_wback_inv; + _dma_cache_inv = r4k_dma_cache_inv; +#endif /* CONFIG_NONCOHERENT_IO */ + + + build_clear_page(); + build_copy_page(); +} diff -urN linux-2.6.36_orig//arch/mips/mm/init.c linux-2.6.36//arch/mips/mm/init.c --- linux-2.6.36_orig//arch/mips/mm/init.c 2010-10-21 00:30:22.000000000 +0400 +++ linux-2.6.36//arch/mips/mm/init.c 2011-02-27 05:19:59.000000000 +0300 @@ -150,8 +150,13 @@ ENTER_CRITICAL(flags); old_ctx = read_c0_entryhi(); write_c0_entryhi(vaddr & (PAGE_MASK << 1)); - write_c0_entrylo0(entrylo); - write_c0_entrylo1(entrylo); +#ifdef CONFIG_MULTICORE_NO_TLB_CACHE + write_c0_entrylo0(0x10); + write_c0_entrylo1(0x10); +#else + write_c0_entrylo0(0); + write_c0_entrylo1(0); +#endif #ifdef CONFIG_MIPS_MT_SMTC set_pte(kmap_coherent_pte - (FIX_CMAP_END - idx), pte); /* preload TLB instead of local_flush_tlb_one() */ diff -urN linux-2.6.36_orig//arch/mips/mm/Makefile linux-2.6.36//arch/mips/mm/Makefile --- linux-2.6.36_orig//arch/mips/mm/Makefile 2010-10-21 00:30:22.000000000 +0400 +++ linux-2.6.36//arch/mips/mm/Makefile 2011-02-27 05:19:59.000000000 +0300 @@ -11,6 +11,7 @@ obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o obj-$(CONFIG_CPU_LOONGSON2) += c-r4k.o cex-gen.o tlb-r4k.o +obj-$(CONFIG_MULTICORE) += c-mc.o cex-gen.o tlb-r4k.o obj-$(CONFIG_CPU_MIPS32) += c-r4k.o cex-gen.o tlb-r4k.o obj-$(CONFIG_CPU_MIPS64) += c-r4k.o cex-gen.o tlb-r4k.o obj-$(CONFIG_CPU_NEVADA) += c-r4k.o cex-gen.o tlb-r4k.o diff -urN linux-2.6.36_orig//arch/mips/mm/tlbex.c linux-2.6.36//arch/mips/mm/tlbex.c --- linux-2.6.36_orig//arch/mips/mm/tlbex.c 2010-10-21 00:30:22.000000000 +0400 +++ linux-2.6.36//arch/mips/mm/tlbex.c 2011-02-27 05:19:59.000000000 +0300 @@ -315,6 +315,7 @@ case CPU_R4700: case CPU_R5000: case CPU_R5000A: + case CPU_MULTICORE: uasm_i_nop(p); tlbw(p); uasm_i_nop(p); @@ -816,12 +817,18 @@ UASM_i_SRL(p, tmp, tmp, ilog2(_PAGE_NO_EXEC)); UASM_i_SRL(p, ptep, ptep, ilog2(_PAGE_NO_EXEC)); UASM_i_ROTR(p, tmp, tmp, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC)); +#ifdef CONFIG_MULTICORE_NO_TLB_CACHE + uasm_i_ori(p, tmp, tmp, 0x10); +#endif if (r4k_250MHZhwbug()) UASM_i_MTC0(p, 0, C0_ENTRYLO0); UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */ UASM_i_ROTR(p, ptep, ptep, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC)); } else { UASM_i_SRL(p, tmp, tmp, ilog2(_PAGE_GLOBAL)); /* convert to entrylo0 */ +#ifdef CONFIG_MULTICORE_NO_TLB_CACHE + uasm_i_ori(p, tmp, tmp, 0x10); +#endif if (r4k_250MHZhwbug()) UASM_i_MTC0(p, 0, C0_ENTRYLO0); UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */ @@ -829,6 +836,9 @@ if (r45k_bvahwbug()) uasm_i_mfc0(p, tmp, C0_INDEX); } +#ifdef CONFIG_MULTICORE_NO_TLB_CACHE + uasm_i_ori(p, ptep, ptep, 0x10); +#endif if (r4k_250MHZhwbug()) UASM_i_MTC0(p, 0, C0_ENTRYLO1); UASM_i_MTC0(p, ptep, C0_ENTRYLO1); /* load it */ diff -urN linux-2.6.36_orig//arch/mips/mm/tlb-r4k.c linux-2.6.36//arch/mips/mm/tlb-r4k.c --- linux-2.6.36_orig//arch/mips/mm/tlb-r4k.c 2010-10-21 00:30:22.000000000 +0400 +++ linux-2.6.36//arch/mips/mm/tlb-r4k.c 2011-02-27 05:19:59.000000000 +0300 @@ -75,8 +75,13 @@ ENTER_CRITICAL(flags); /* Save old context and create impossible VPN2 value */ old_ctx = read_c0_entryhi(); - write_c0_entrylo0(0); - write_c0_entrylo1(0); +#ifdef CONFIG_MULTICORE_NO_TLB_CACHE + write_c0_entrylo0(0x10); + write_c0_entrylo1(0x10); +#else + write_c0_entrylo0(0); + write_c0_entrylo1(0); +#endif entry = read_c0_wired(); @@ -140,8 +145,13 @@ tlb_probe(); tlb_probe_hazard(); idx = read_c0_index(); - write_c0_entrylo0(0); - write_c0_entrylo1(0); +#ifdef CONFIG_MULTICORE_NO_TLB_CACHE + write_c0_entrylo0(0x10); + write_c0_entrylo1(0x10); +#else + write_c0_entrylo0(0); + write_c0_entrylo1(0); +#endif if (idx < 0) continue; /* Make sure all entries differ. */ @@ -182,8 +192,13 @@ tlb_probe(); tlb_probe_hazard(); idx = read_c0_index(); - write_c0_entrylo0(0); - write_c0_entrylo1(0); +#ifdef CONFIG_MULTICORE_NO_TLB_CACHE + write_c0_entrylo0(0x10); + write_c0_entrylo1(0x10); +#else + write_c0_entrylo0(0); + write_c0_entrylo1(0); +#endif if (idx < 0) continue; /* Make sure all entries differ. */ @@ -217,8 +232,13 @@ tlb_probe(); tlb_probe_hazard(); idx = read_c0_index(); - write_c0_entrylo0(0); - write_c0_entrylo1(0); +#ifdef CONFIG_MULTICORE_NO_TLB_CACHE + write_c0_entrylo0(0x10); + write_c0_entrylo1(0x10); +#else + write_c0_entrylo0(0); + write_c0_entrylo1(0); +#endif if (idx < 0) goto finish; /* Make sure all entries differ. */ @@ -251,8 +271,13 @@ tlb_probe(); tlb_probe_hazard(); idx = read_c0_index(); - write_c0_entrylo0(0); - write_c0_entrylo1(0); +#ifdef CONFIG_MULTICORE_NO_TLB_CACHE + write_c0_entrylo0(0x10); + write_c0_entrylo1(0x10); +#else + write_c0_entrylo0(0); + write_c0_entrylo1(0); +#endif if (idx >= 0) { /* Make sure all entries differ. */ write_c0_entryhi(UNIQUE_ENTRYHI(idx)); @@ -318,14 +343,25 @@ { ptep = pte_offset_map(pmdp, address); -#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) + #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) + #ifdef CONFIG_MULTICORE_NO_TLB_CACHE + write_c0_entrylo0((ptep->pte_high) & ~0x34) | 0x10); + ptep++; + write_c0_entrylo1((ptep->pte_high) & ~0x34) | 0x10); + #else write_c0_entrylo0(ptep->pte_high); ptep++; write_c0_entrylo1(ptep->pte_high); -#else - write_c0_entrylo0(pte_to_entrylo(pte_val(*ptep++))); - write_c0_entrylo1(pte_to_entrylo(pte_val(*ptep))); -#endif + #endif + #else + #ifdef CONFIG_MULTICORE_NO_TLB_CACHE + write_c0_entrylo0(((pte_val(*ptep++) >> 6) & ~0x34) | 0x10); + write_c0_entrylo1(((pte_val(*ptep) >> 6) & ~0x34) | 0x10); + #else + write_c0_entrylo0(pte_val(*ptep++) >> 6); + write_c0_entrylo1(pte_val(*ptep) >> 6); + #endif + #endif mtc0_tlbw_hazard(); if (idx < 0) tlb_write_random(); @@ -355,8 +391,13 @@ tlbw_use_hazard(); /* What is the hazard here? */ write_c0_pagemask(pagemask); write_c0_entryhi(entryhi); - write_c0_entrylo0(entrylo0); - write_c0_entrylo1(entrylo1); +#ifdef CONFIG_MULTICORE_NO_TLB_CACHE + write_c0_entrylo0((entrylo0 & ~0x34) | 0x10); + write_c0_entrylo1((entrylo1 & ~0x34) | 0x10); +#else + write_c0_entrylo0(entrylo0); + write_c0_entrylo1(entrylo1); +#endif mtc0_tlbw_hazard(); tlb_write_indexed(); tlbw_use_hazard(); @@ -400,8 +441,13 @@ write_c0_index(temp_tlb_entry); write_c0_pagemask(pagemask); write_c0_entryhi(entryhi); - write_c0_entrylo0(entrylo0); - write_c0_entrylo1(entrylo1); +#ifdef CONFIG_MULTICORE_NO_TLB_CACHE + write_c0_entrylo0((entrylo0 & ~0x34) | 0x10); + write_c0_entrylo1((entrylo1 & ~0x34) | 0x10); +#else + write_c0_entrylo0(entrylo0); + write_c0_entrylo1(entrylo1); +#endif mtc0_tlbw_hazard(); tlb_write_indexed(); tlbw_use_hazard(); diff -urN linux-2.6.36_orig//arch/mips/multicore/irq.c linux-2.6.36//arch/mips/multicore/irq.c --- linux-2.6.36_orig//arch/mips/multicore/irq.c 1970-01-01 03:00:00.000000000 +0300 +++ linux-2.6.36//arch/mips/multicore/irq.c 2011-02-27 05:19:59.000000000 +0300 @@ -0,0 +1,163 @@ +/* + * This file is subject to the terms and conditions of the + * Open Software License. + * See http://www.opensource.org/licenses/osl-2.0.php for more details. + * + * Copyright (C) 2003 gluk + * Copyright (C) 2004-2010 Samium Gromoff <_deepfire@feelingofgreen.ru> + * Copyright (C) 2003-2011 Elvees, Inc. + */ + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + + +static void multicore_ack_irq(unsigned int irq) {} + +static void multicore_mask_irq(unsigned int irq) +{ + unsigned qstr_irq = irq - QSTR_IRQ_BASE; + +#if defined(CONFIG_NVCOM01) || defined(CONFIG_NVCOM02) + unsigned qstr_reg = 0; + while (qstr_irq > 32) { + qstr_reg++; + qstr_irq -= 32; + } + + switch (qstr_reg) { + case 0: + MC_MASKR0 &= ~(1 << qstr_irq); + break; + case 1: + MC_MASKR1 &= ~(1 << qstr_irq); + break; + case 2: + MC_MASKR2 &= ~(1 << qstr_irq); + break; + default: + BUG(); + } +#elif defined(CONFIG_MC24) + MC_MASKR &= ~(1 << qstr_irq); +#endif +} + +static void multicore_unmask_irq(unsigned int irq) +{ + unsigned qstr_irq = irq - QSTR_IRQ_BASE; + +#if defined(CONFIG_NVCOM01) || defined(CONFIG_NVCOM02) + unsigned qstr_reg = 0; + while (qstr_irq > 32) { + qstr_reg++; + qstr_irq -= 32; + } + + switch (qstr_reg) { + case 0: + MC_MASKR0 |= (1 << qstr_irq); + break; + case 1: + MC_MASKR1 |= (1 << qstr_irq); + break; + case 2: + MC_MASKR2 |= (1 << qstr_irq); + break; + default: + BUG(); + } +#elif defined(CONFIG_MC24) + MC_MASKR |= (1 << qstr_irq); +#endif +} + +static struct irq_chip multicore_irq_type = { + .name = "Multicore", + .unmask = multicore_unmask_irq, + .mask = multicore_mask_irq, + .ack = multicore_ack_irq +}; + +static struct irqaction multicore_cascade_action = { + .handler = no_action, + .name = "Multicore QSTR cascade interrupt" +}; + +static void __init multicore_irq_init(int base) +{ + int i; + +#if defined(CONFIG_NVCOM01) || defined(CONFIG_NVCOM02) + MC_MASKR0 = 0; + MC_MASKR1 = 0; + MC_MASKR2 = 0; +#else + MC_MASKR = 0; +#endif + + for (i = 0; i < QSTR_NR_IRQS; i++) + set_irq_chip_and_handler(base + i, &multicore_irq_type, + handle_level_irq); + + for (i = IRQ_QSTR; i < IRQ_COMPARE; ++i) { + setup_irq(i, &multicore_cascade_action); + set_c0_status(mips_irqmask(i)); + } +} + +void __init arch_init_irq(void) +{ + mips_cpu_irq_init(); + multicore_irq_init(QSTR_IRQ_BASE); +} + +static void multicore_cascade(void) +{ +#if defined(CONFIG_NVCOM01) || defined(CONFIG_NVCOM02) + unsigned qstr = MC_QSTR0 & MC_MASKR0; + if (qstr) { + do_IRQ(QSTR_IRQ_BASE + ilog2(qstr)); + } else { + qstr = MC_QSTR1 & MC_MASKR1; + if (qstr) { + do_IRQ(QSTR_IRQ_BASE + 32 + ilog2(qstr)); + } else { + qstr = MC_QSTR2 & MC_MASKR2; + if (qstr) { + do_IRQ(QSTR_IRQ_BASE + 64 + ilog2(qstr)); + } else { + spurious_interrupt(); + } + } + } +#else + unsigned qstr = MC_QSTR & MC_MASKR; + if (qstr) { + do_IRQ(QSTR_IRQ_BASE + ilog2(qstr)); + } else { + spurious_interrupt(); + } +#endif +} + +asmlinkage void plat_irq_dispatch(void) +{ + unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM; + if (pending & STATUS_MASK_COMPARE) /* cpu timer */ + do_IRQ(IRQ_COMPARE); + else + multicore_cascade(); +} diff -urN linux-2.6.36_orig//arch/mips/multicore/Kconfig linux-2.6.36//arch/mips/multicore/Kconfig --- linux-2.6.36_orig//arch/mips/multicore/Kconfig 1970-01-01 03:00:00.000000000 +0300 +++ linux-2.6.36//arch/mips/multicore/Kconfig 2011-02-27 05:19:59.000000000 +0300 @@ -0,0 +1,37 @@ +menu "Elvees Multicore platform options" + depends on MULTICORE + +config MULTICORE_LPORT + bool "On-chip AD SHARC-compatible link port" + default n + +config MULTICORE_SWIC + bool "On-chip SpaceWire controller" + default n + +config MULTICORE_MEMORY + int "Amount of onboard memory to configure, in megabytes" + default 64 + +config MULTICORE_CLOCKFREQ + int "Base clock frequency, pre-multiplier, in MHz" +# range 5 5 if NVCOM01 + default 5 + +config MULTICORE_NO_FM_CACHE + bool "Disable both instruction and data caches in FM mode (during startup)" + default y + +config MULTICORE_NO_TLB_CACHE + bool "Disable both instruction and data caches in TLB mode" + default y + +choice + prompt "Subplatform" + default NVCOM01 + + config NVCOM01 + bool "NVCom" +endchoice + +endmenu diff -urN linux-2.6.36_orig//arch/mips/multicore/lport.c linux-2.6.36//arch/mips/multicore/lport.c --- linux-2.6.36_orig//arch/mips/multicore/lport.c 1970-01-01 03:00:00.000000000 +0300 +++ linux-2.6.36//arch/mips/multicore/lport.c 2011-02-27 05:19:59.000000000 +0300 @@ -0,0 +1,401 @@ +/* + * This file is subject to the terms and conditions of the + * Open Software License. + * See http://www.opensource.org/licenses/osl-2.0.php for more details. + * + * Copyright (C) 2011 Elvees, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define MAX_PORTS 4 +#define DEVNAME "lport" +#define LPORT_MAJOR 248 +#define DMA_BUFFER_SIZE 131072 + +#define LPORT_BUF_DEGREE 10 +#define LPORT_BUF_SIZE (1 << LPORT_BUF_DEGREE) +#define LPORT_BUF_MASK (LPORT_BUF_SIZE - 1) + +#define mfbsp_rx_irq_num(port_id) (IRQ_MFBSP_RX0 + ((port_id) << 2)) +#define mfbsp_tx_irq_num(port_id) (IRQ_MFBSP_TX0 + ((port_id) << 2)) +#define mfbsp_srq_num(port_id) (IRQ_SRQ0 + ((port_id) << 2)) + +typedef enum { + MC_DIR_READ = 0, + MC_DIR_WRITE = 1 +} mc_direction_t; + +struct lport { + struct device dev; + struct semaphore open_sem, io_sem; + int id; + mc_direction_t direction; /* for read only */ + ssize_t io_infly; /* for read only */ + ssize_t io_left; + ssize_t io_completed; + uint32_t rx_stat, tx_stat; + unsigned io_buf[LPORT_BUF_SIZE]; + ssize_t io_tail, io_head; + uint32_t rx_discarded; +}; + + +struct lport_set { + struct char_device *bdev; + + struct lport lport[MAX_PORTS]; + struct class *lport_class; +}; + +struct lport_set *lport_set; + +char dev_names[4][8] = { + "lport0", + "lport1", + "lport2", + "lport3" +}; + + +#define lport_by_id(n) (&(lport_set->lport[n])) + + +static ssize_t lport_read(struct file *file, char *buf, + size_t count, loff_t *ppos); +static ssize_t lport_write(struct file *file, const char *buf, + size_t count, loff_t *ppos); +static int lport_open(struct inode *inode, struct file *file); +static int lport_release(struct inode *inode, struct file *file); + +static struct file_operations lport_fops = { + .owner = THIS_MODULE, + .llseek = no_llseek, + .read = lport_read, + .write = lport_write, + .open = lport_open, + .release = lport_release, +}; + + +static inline void buf_add(struct lport * port, unsigned new_val) +{ + port->io_buf[port->io_tail] = new_val; + /* возврат индекса к нулю при достижении верхней границы массива */ + port->io_tail = (port->io_tail + 1) & LPORT_BUF_MASK; +} + +static inline unsigned buf_get(struct lport * port) +{ + unsigned val = port->io_buf[port->io_head]; + /* возврат индекса к нулю при достижении верхней границы массива */ + port->io_head = (port->io_head + 1) & LPORT_BUF_MASK; + return val; +} + +static inline int buf_empty(struct lport * port) +{ + return (port->io_tail == port->io_head); +} + +static inline int buf_full(struct lport * port) +{ + return (((port->io_tail + 1) & LPORT_BUF_MASK) == port->io_head); +} + +static inline void buf_clear(struct lport * port) +{ + port->io_head = port->io_tail; +} + +static irqreturn_t lport_rx_interrupt(int cpl, void *dev_id) +{ + struct lport *port = (struct lport *) dev_id; + int was_empty = 0; + +//printk ("rx_interrupt!\n"); + + switch (port->direction) { + case MC_DIR_READ: + if (!buf_full(port)) { + if (buf_empty(port)) + was_empty = 1; + buf_add(port, MC_MFBSP_RX(port->id)); + port->rx_stat += 4; +//printk("rx_stat = %d\n", port->rx_stat); + if (was_empty) + up(&port->io_sem); + } else { + was_empty = MC_MFBSP_RX(port->id); /* discard */ + port->rx_discarded += 4; +//printk("rx_discarded = %d\n", port->rx_discarded); + } + break; + default: + BUG_ON(1); + } + + return IRQ_HANDLED; +} + +static irqreturn_t lport_tx_interrupt(int cpl, void *dev_id) +{ + struct lport *port = (struct lport *) dev_id; + +//printk ("tx_interrupt!\n"); + + switch (port->direction) { + case MC_DIR_WRITE: + if (port->io_infly) { + /* Sending packets of 4 bytes */ + MC_MFBSP_TX(port->id) = port->io_buf[port->io_tail++]; + port->io_infly -= 4; + port->tx_stat += 4; +//printk("tx_stat = %d, io_infly = %d\n", port->tx_stat, port->io_infly); + } + if (port->io_infly == 0) { + port->io_tail = 0; + disable_irq_nosync(mfbsp_tx_irq_num(port->id)); + up(&port->io_sem); + } + break; + default: + BUG_ON(1); + } + + return IRQ_HANDLED; +} + +static ssize_t lport_read(struct file *file, char *buf, + size_t count, loff_t *ppos) +{ + unsigned int minor = iminor(file->f_dentry->d_inode); + struct lport *port = lport_by_id(minor); + size_t completed = 0; + unsigned *pu = (unsigned *)buf; + +//printk("===lport_read enter, port_num = %d\n", minor); + if (down_interruptible(&port->io_sem)) + return -EFAULT; + + if (count & 0x3) + return -EINVAL; + + do { + if (buf_empty(port)) { +//printk ("buf_empty!\n"); + return completed; + } + *pu++ = buf_get(port); + completed += 4; +//printk ("completed = %d!\n", completed); + } while (completed != count); + +//printk("===lport_read exit, port_num = %d\n", minor); + + return completed; +} + +static ssize_t lport_write(struct file *file, const char __user *buf, + size_t count, loff_t *ppos) +{ + unsigned int minor = iminor(file->f_dentry->d_inode); + struct lport *port = lport_by_id(minor); + +//printk("===lport_write enter, port_num = %d\n", minor); + + if (count & 0x3) + return -EINVAL; + + port->io_left = count; + port->io_completed = 0; + + do { + if (down_interruptible(&port->io_sem)) + return -EFAULT; + port->io_infly = port->io_left > sizeof (port->io_buf) ? + sizeof (port->io_buf) : port->io_left; + if (copy_from_user(port->io_buf, buf, port->io_infly)) { + up(&port->io_sem); + return -EFAULT; + } + + /* enables the writer interrupt */ + port->io_completed += port->io_infly; + port->io_left -= port->io_infly; + + enable_irq(mfbsp_tx_irq_num(minor)); + + if (port->io_left == 0) + break; + } while (1); + + /* wait for the intr handler to succeed */ + down(&port->io_sem); + + /* enable the possible following writer to proceed */ + up(&port->io_sem); + +//printk("===lport_write exit, port_num = %d\n", minor); + + return count; +} + +static int lport_open(struct inode *inode, struct file *file) +{ + unsigned int port_num = iminor(inode); + struct lport *port = lport_by_id(port_num); + +//printk("===lport_open, port_num = %d\n", port_num); + + if (port_num >= MAX_PORTS) + return -ENXIO; + + /* Check multiple device opens */ + if (down_trylock(&port->open_sem)) + return -EBUSY; + + if (file->f_flags & O_NONBLOCK) + return -EINVAL; + + /* Check open mode: only read-only or write-only are possible */ + switch (file->f_flags & 0x3) { + case 0: + port->direction = MC_DIR_READ; + MC_MFBSP_CSR(port_num) &= ~MC_MFBSP_CSR_LTRAN; + MC_MFBSP_CSR(port_num) |= MC_MFBSP_CSR_LEN; + down(&port->io_sem); + enable_irq(mfbsp_rx_irq_num(port_num)); + break; + case 1: + port->direction = MC_DIR_WRITE; + MC_MFBSP_CSR(port_num) |= MC_MFBSP_CSR_LTRAN; + MC_MFBSP_CSR(port_num) |= MC_MFBSP_CSR_LEN; + break; + default: + return -EINVAL; + } + return 0; +} + +static int lport_release(struct inode *inode, struct file *file) +{ + unsigned int port_num = iminor(inode); + struct lport *port = lport_by_id(port_num); + + disable_irq(mfbsp_rx_irq_num(port_num)); + disable_irq(mfbsp_tx_irq_num(port_num)); + MC_MFBSP_CSR(port_num) &= ~MC_MFBSP_CSR_LEN; + buf_clear(port); + up(&port->open_sem); + + return 0; +} + +static int __init lport_init_port(struct lport *port, int port_num) +{ + int port_rx_irq = mfbsp_rx_irq_num(port_num); + int port_tx_irq = mfbsp_tx_irq_num(port_num); + int ret; + + port->rx_discarded = port->rx_stat = port->tx_stat = 0; + port->id = port_num; + + port->dev.parent = NULL; + port->dev.bus = &mcbus; + port->dev.init_name = dev_names[port_num]; + + if (device_register(&port->dev) < 0) { + printk(DEVNAME ": Unable to register device!\n"); + return -ENODEV; + } + + /* guards against multiple device opens */ + init_MUTEX(&port->open_sem); + + init_MUTEX(&port->io_sem); + + ret = request_irq(port_rx_irq, + lport_rx_interrupt, IRQF_DISABLED, "lport_rx", port); + ret = request_irq(port_tx_irq, + lport_tx_interrupt, IRQF_DISABLED, "lport_tx", port); + if (ret == 0) + printk("lport%d: rx irq %d, tx irq %d\n", + port_num, port_rx_irq, port_tx_irq); + + /* switch port into service mode */ + MC_MFBSP_CSR(port_num) = MC_MFBSP_CSR_LCLK_RATE(3) | MC_MFBSP_CSR_LDW; /* 20 MHz, 8 bit */ + + disable_irq(port_rx_irq); + disable_irq(port_tx_irq); + return ret; +} + +static int __init lport_init(void) +{ + int err, i; + unsigned clk_en; + + printk(DEVNAME ": init started!\n"); + + if ((lport_set = kmalloc(sizeof(struct lport_set), GFP_KERNEL)) == NULL) { + printk(DEVNAME ": kmalloc failed\n"); + err = -ENOMEM; + goto out; + } + memset(lport_set, 0, sizeof(struct lport_set)); + if (register_chrdev(LPORT_MAJOR, DEVNAME, &lport_fops)) { + printk(DEVNAME ": Unable to get char major %d\n", LPORT_MAJOR); + err = -ENODEV; + goto out; + } + /* devfs_mk_dir("ports");*/ + lport_set->lport_class = class_create(THIS_MODULE, "lport"); + if (IS_ERR(lport_set->lport_class)) { + printk(DEVNAME ": IS_ERR!\n"); + err = PTR_ERR(lport_set->lport_class); + goto out_dev; + } + + MC_CLKEN |= MC_CLKEN_MFBSP; + /* ensure that clock for MFBSP is enabled (as recommended in NVCOM documentation) */ + clk_en = MC_CLKEN; + clk_en |= clk_en; + + for (i = 0; i < MAX_PORTS; i++) + lport_init_port(lport_by_id(i), i); + + printk(DEVNAME ": init successful!\n"); + + //MFBSP(0)->rsr |= 0x10; + + return 0; + + class_destroy(lport_set->lport_class); + out_dev: + /* devfs_remove("ports"); */ + unregister_chrdev(LPORT_MAJOR, DEVNAME); + out: + return err; +} + +static void __exit lport_cleanup(void) +{ +} + + +module_init(lport_init); +module_exit(lport_cleanup); + +MODULE_LICENSE("OSL 2.0"); diff -urN linux-2.6.36_orig//arch/mips/multicore/Makefile linux-2.6.36//arch/mips/multicore/Makefile --- linux-2.6.36_orig//arch/mips/multicore/Makefile 1970-01-01 03:00:00.000000000 +0300 +++ linux-2.6.36//arch/mips/multicore/Makefile 2011-02-27 05:19:59.000000000 +0300 @@ -0,0 +1,12 @@ +# +# Makefile for the Elvis Centaurus board. +# +# Note! Dependencies are done automagically by 'make dep', which also +# removes any old dependencies. DON'T put your own dependencies here +# unless it's something special (ie not a .c file). +# + +obj-y := prom.o setup.o irq.o + +obj-$(CONFIG_MULTICORE_LPORT) += lport.o + diff -urN linux-2.6.36_orig//arch/mips/multicore/Platform linux-2.6.36//arch/mips/multicore/Platform --- linux-2.6.36_orig//arch/mips/multicore/Platform 1970-01-01 03:00:00.000000000 +0300 +++ linux-2.6.36//arch/mips/multicore/Platform 2011-02-27 05:19:59.000000000 +0300 @@ -0,0 +1,7 @@ +# +# MIPS Elvees Multicore board +# +platform-$(CONFIG_MULTICORE) += multicore/ +cflags-$(CONFIG_MULTICORE) += -I$(srctree)/arch/mips/include/asm/mach-multicore +load-$(CONFIG_MULTICORE) += 0x80000000 +all-$(CONFIG_MULTICORE) := $(COMPRESSION_FNAME).bin diff -urN linux-2.6.36_orig//arch/mips/multicore/prom.c linux-2.6.36//arch/mips/multicore/prom.c --- linux-2.6.36_orig//arch/mips/multicore/prom.c 1970-01-01 03:00:00.000000000 +0300 +++ linux-2.6.36//arch/mips/multicore/prom.c 2011-02-27 05:19:59.000000000 +0300 @@ -0,0 +1,42 @@ +/* + * This file is subject to the terms and conditions of the + * Open Software License. + * See http://www.opensource.org/licenses/osl-2.0.php for more details. + * + * Copyright (C) 2003 gluk + * Copyright (C) 2003-2011 Elvees, Inc. + */ + +#include +#include +#include +#include + +#include +#include +#include + +const char *get_system_type(void) +{ + return "Elvis MultiCore"; +} + +void __init prom_free_prom_memory(void) +{ + return; +} + +void __init prom_init(void) +{ + mips_machtype = MACH_MULTICORE; + + add_memory_region(0x0, MC_MEMSIZE, BOOT_MEM_RAM); + + /* flush CPU caches */ + MC_CSR |= MC_CSR_FLUSH_I; +#if defined(CONFIG_NVCOM01) || defined(CONFIG_NVCOM02) + MC_CSR |= MC_CSR_FLUSH_D; +#endif + MC_CSR &= ~MC_CSR_FM; /* enable TLB mode */ +} + diff -urN linux-2.6.36_orig//arch/mips/multicore/setup.c linux-2.6.36//arch/mips/multicore/setup.c --- linux-2.6.36_orig//arch/mips/multicore/setup.c 1970-01-01 03:00:00.000000000 +0300 +++ linux-2.6.36//arch/mips/multicore/setup.c 2011-02-27 05:19:59.000000000 +0300 @@ -0,0 +1,95 @@ +/* + * This file is subject to the terms and conditions of the + * Open Software License. + * See http://www.opensource.org/licenses/osl-2.0.php for more details. + * + * Copyright (C) 2003 gluk + * Copyright (C) 2003-2011 Elvees, Inc. + */ + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define MC_UART0_BASE 0xb82f3000 + +u64 mcbus_dma_mask = 0xffffffffULL; +struct bus_type mcbus = { + .name = "mcbus" +}; + +void __init plat_time_init(void) +{ +} + +int __init init_serial(void) +{ + struct uart_port s; + + memset(&s, 0, sizeof(s)); + + s.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST; + s.iotype = UPIO_MEM32; + s.uartclk = mips_hpt_frequency; + s.regshift = 2; + s.membase = (char *)MC_UART0_BASE; + s.mapbase = MC_UART0_BASE; +#if defined(CONFIG_NVCOM01) || defined(CONFIG_NVCOM02) + s.irq = IRQ_UART0; +#else + s.irq = IRQ_UTRx; +#endif + + if (early_serial_setup(&s) != 0) + printk(KERN_ERR "Serial setup failed!\n"); + + return 0; +} + +void __init plat_mem_setup(void) +{ + u_int32_t freq_mult; + + freq_mult = mc_frequency_multiplier(); + mips_hpt_frequency = MC_QUARTZ_CLOCK_FREQ * freq_mult; + + printk("MIPS counter frequency: %d Hz, frequency multiplier: %d\n", + mips_hpt_frequency, freq_mult); + + _machine_restart = NULL; + _machine_halt = NULL; + pm_power_off = NULL; + + init_serial(); + + printk(KERN_INFO "Multicore specific initialisation complete\n"); +} + +static int __init mc_late_setup(void) +{ + int ret; + + ret = bus_register(&mcbus); + if (ret) + return ret; + + printk(KERN_INFO "Multicore AMBA bus registered\n"); + + return 0; +} +postcore_initcall(mc_late_setup); diff -urN linux-2.6.36_orig//drivers/serial/8250.c linux-2.6.36//drivers/serial/8250.c --- linux-2.6.36_orig//drivers/serial/8250.c 2010-10-21 00:30:22.000000000 +0400 +++ linux-2.6.36//drivers/serial/8250.c 2011-02-27 05:19:59.000000000 +0300 @@ -1195,6 +1195,10 @@ serial_outp(up, UART_FCR, UART_FCR_ENABLE_FIFO); scratch = serial_in(up, UART_IIR) >> 6; +#ifdef CONFIG_MULTICORE + scratch = 2; +#endif + DEBUG_AUTOCONF("iir=%d ", scratch); switch (scratch) { diff -urN linux-2.6.36_orig//drivers/serial/8250_early.c linux-2.6.36//drivers/serial/8250_early.c --- linux-2.6.36_orig//drivers/serial/8250_early.c 2010-10-21 00:30:22.000000000 +0400 +++ linux-2.6.36//drivers/serial/8250_early.c 2011-02-27 05:19:59.000000000 +0300 @@ -157,7 +157,12 @@ if (!options) return -ENODEV; +#ifndef CONFIG_MULTICORE port->uartclk = BASE_BAUD * 16; +#else + extern u_int32_t mips_hpt_frequency; + port->uartclk = mips_hpt_frequency; +#endif mmio = !strncmp(options, "mmio,", 5); mmio32 = !strncmp(options, "mmio32,", 7); diff -urN linux-2.6.36_orig//include/linux/prefetch.h linux-2.6.36//include/linux/prefetch.h --- linux-2.6.36_orig//include/linux/prefetch.h 2010-10-21 00:30:22.000000000 +0400 +++ linux-2.6.36//include/linux/prefetch.h 2011-02-27 05:19:59.000000000 +0300 @@ -35,11 +35,19 @@ */ #ifndef ARCH_HAS_PREFETCH -#define prefetch(x) __builtin_prefetch(x) +# ifdef CONFIG_MULTICORE + static inline void prefetch(const void *x) {;} +# else +# define prefetch(x) __builtin_prefetch(x) +# endif #endif #ifndef ARCH_HAS_PREFETCHW -#define prefetchw(x) __builtin_prefetch(x,1) +# ifdef CONFIG_MULTICORE + static inline void prefetchw(const void *x) {;} +# else +# define prefetchw(x) __builtin_prefetch(x,1) +# endif #endif #ifndef ARCH_HAS_SPINLOCK_PREFETCH diff -urN linux-2.6.36_orig//include/linux/version.h linux-2.6.36//include/linux/version.h --- linux-2.6.36_orig//include/linux/version.h 1970-01-01 03:00:00.000000000 +0300 +++ linux-2.6.36//include/linux/version.h 2011-02-27 05:19:59.000000000 +0300 @@ -0,0 +1,2 @@ +#define LINUX_VERSION_CODE 132644 +#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) diff -urN linux-2.6.36_orig//Makefile linux-2.6.36//Makefile --- linux-2.6.36_orig//Makefile 2010-10-21 00:30:22.000000000 +0400 +++ linux-2.6.36//Makefile 2011-02-27 05:19:59.000000000 +0300 @@ -351,10 +351,11 @@ -fno-strict-aliasing -fno-common \ -Werror-implicit-function-declaration \ -Wno-format-security \ - -fno-delete-null-pointer-checks + -fno-delete-null-pointer-checks \ + -fno-delayed-branch -Wa,-O0 KBUILD_AFLAGS_KERNEL := KBUILD_CFLAGS_KERNEL := -KBUILD_AFLAGS := -D__ASSEMBLY__ +KBUILD_AFLAGS := -D__ASSEMBLY__ -O0 KBUILD_AFLAGS_MODULE := -DMODULE KBUILD_CFLAGS_MODULE := -DMODULE KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds