diff -Naur linux-2.4.4-uClinux/Documentation/armnommu/swarm/README linux-2.4.4-uClinux-hankvc/Documentation/armnommu/swarm/README --- linux-2.4.4-uClinux/Documentation/armnommu/swarm/README Thu Jan 1 05:30:00 1970 +++ linux-2.4.4-uClinux-hankvc/Documentation/armnommu/swarm/README Tue Sep 25 01:53:20 2001 @@ -0,0 +1,27 @@ +# +# uClinux-arm for swarm +# By C Hanish Menon [www.hanishkvc.com] +# 25 Sep 2001 +# + +SWARM - is a software arm emulator by Michael Dales. It emulates a +Arm7v3 core. And also includes a Timer controller, Cache logic, +Interrupt controller and Uart for now. You can get SWARM from + + http://www.dcs.gla.ac.uk/~michael/phd/swarm.html + +Has actual boards cost a lot, and also has I wanted to get a idea of +the effort involved in porting Linux, I thought of using SWARM to port +linux or rather uClinux (because SWARM doesn't support mmu). + +In the process I learnt to lot about linux and also to some extent how +SWARM works and added some features to it. + +This port is based on uClinux-arm v2.4.4. So currently it doesn't use the +newer uClinux-arm v2.4.6 available in the cvs, but has its own head-armv +and other modifications for NON_MMU. However you will notice that its +similar to the code in v2.4.6. I will update this to use uClinux-arm v2.4.6 +shortly, it shouldn't take much time. + +Currently the UART based console driver is not yet up, rather temporarily +I have fixed printk to print messages on the Uart. + +I would also like to thank Federal Technologies ltd (www.fedtec.com), +Bangalore, India for providing me a oppurtunity to work on my hobbies. + diff -Naur linux-2.4.4-uClinux/HANISHKVC-swarm-arm7v3.config linux-2.4.4-uClinux-hankvc/HANISHKVC-swarm-arm7v3.config --- linux-2.4.4-uClinux/HANISHKVC-swarm-arm7v3.config Thu Jan 1 05:30:00 1970 +++ linux-2.4.4-uClinux-hankvc/HANISHKVC-swarm-arm7v3.config Mon Sep 10 12:51:42 2001 @@ -0,0 +1,222 @@ +# +# Automatically generated by make menuconfig: don't edit +# +CONFIG_ARM=y +# CONFIG_SBUS is not set +CONFIG_UID16=y +CONFIG_UCLINUX=y +MAGIC_ROM_PTR=y + +# +# Code maturity level options +# +# CONFIG_EXPERIMENTAL is not set +# CONFIG_OBSOLETE is not set + +# +# Loadable module support +# +# CONFIG_MODULES is not set + +# +# System Type +# +# CONFIG_ARCH_DSC21 is not set +CONFIG_ARCH_SWARM=y +CONFIG_CPU_32=y +# CONFIG_CPU_26 is not set +CONFIG_CPU_32v3=y +CONFIG_CPU_ARM7V3=y +CONFIG_NO_PGT_CACHE=y +FLASH_MEM_BASE=0x00000000 +FLASH_SIZE=0x00000000 + +# +# General setup +# +# CONFIG_HOTPLUG is not set +# CONFIG_PCMCIA is not set +# CONFIG_NET is not set +# CONFIG_SYSVIPC is not set +# CONFIG_REDUCED_MEMORY is not set +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_SYSCTL is not set +CONFIG_NWFPE=y +CONFIG_KCORE_ELF=y +# CONFIG_KCORE_AOUT is not set +CONFIG_BINFMT_FLAT=y +CONFIG_KERNEL_ELF=y +# CONFIG_ARTHUR is not set +# CONFIG_ALIGNMENT_TRAP is not set + +# +# ATA/IDE/MFM/RLL support +# +# CONFIG_IDE is not set +# CONFIG_BLK_DEV_IDE_MODES is not set +# CONFIG_BLK_DEV_HD is not set + +# +# SCSI support +# +# CONFIG_SCSI is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Plug and Play configuration +# +# CONFIG_PNP is not set +# CONFIG_ISAPNP is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_LOOP is not set +# CONFIG_BLK_DEV_NBD is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_SIZE=8192 +CONFIG_BLK_DEV_INITRD=y +# CONFIG_BLK_DEV_BLKMEM is not set + +# +# File systems +# +# CONFIG_QUOTA is not set +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_CHECK is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_UMSDOS_FS is not set +# CONFIG_VFAT_FS is not set +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_CRAMFS is not set +# CONFIG_TMPFS is not set +# CONFIG_RAMFS is not set +# CONFIG_ISO9660_FS is not set +# CONFIG_JOLIET is not set +# CONFIG_MINIX_FS is not set +# CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +# CONFIG_PROC_FS is not set +# CONFIG_DEVFS_FS is not set +# CONFIG_DEVFS_MOUNT is not set +# CONFIG_DEVFS_DEBUG is not set +# CONFIG_DEVPTS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +# CONFIG_SYSV_FS_WRITE is not set +# CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_SMB_FS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_SMB_NLS is not set +# CONFIG_NLS is not set + +# +# Character devices +# +# CONFIG_LEDMAN is not set +# CONFIG_VT is not set +CONFIG_SERIAL=y +CONFIG_SERIAL_CONSOLE=y +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +# CONFIG_UNIX98_PTYS is not set + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_MOUSE is not set + +# +# Joysticks +# +# CONFIG_JOYSTICK is not set +# CONFIG_QIC02_TAPE is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_INTEL_RNG is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set +# CONFIG_DRM is not set + +# +# USB support +# +# CONFIG_USB is not set + +# +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# +# Kernel hacking +# +CONFIG_FRAME_POINTER=y +# CONFIG_REVISIT is not set +CONFIG_DEBUG_ERRORS=y +CONFIG_DEBUG_USER=y +# CONFIG_DEBUG_INFO is not set +# CONFIG_MAGIC_SYSRQ is not set diff -Naur linux-2.4.4-uClinux/Makefile.swarm linux-2.4.4-uClinux-hankvc/Makefile.swarm --- linux-2.4.4-uClinux/Makefile.swarm Thu Jan 1 05:30:00 1970 +++ linux-2.4.4-uClinux-hankvc/Makefile.swarm Mon Sep 24 21:39:56 2001 @@ -0,0 +1,20 @@ +all: srec initrd + cp linux.srec all.srec + cat uClinux-arm.img.srec >> all.srec + +srec: linux + arm-linux-objcopy -O srec linux linux.srec + +initrd: /tmp/uClinux-arm.img + arm-linux-objcopy --adjust-vma 0x800000 -I binary -O srec /tmp/uClinux-arm.img uClinux-arm.img.srec + +create-initrd: + dd if=/dev/zero of=/tmp/uClinux-arm.img bs=1024 count=1024 + /sbin/mkfs.ext2 /tmp/uClinux-arm.img + mount + umount /mnt/loop0 || /bin/true + mount -o rw,loop /tmp/uClinux-arm.img /mnt/loop0/ + mkdir /mnt/loop0/dev + mknod /mnt/loop0/dev/console c 5 1 + umount /mnt/loop0 + chown hanishkvc.users /tmp/uClinux-arm.img diff -Naur linux-2.4.4-uClinux/arch/armnommu/Makefile linux-2.4.4-uClinux-hankvc/arch/armnommu/Makefile --- linux-2.4.4-uClinux/arch/armnommu/Makefile Sat Sep 8 19:54:07 2001 +++ linux-2.4.4-uClinux-hankvc/arch/armnommu/Makefile Wed Sep 12 01:43:31 2001 @@ -36,6 +36,7 @@ proc-$(CONFIG_CPU_32v4) :=-marmv4 proc-$(CONFIG_CPU_32v5) :=-marmv5 +tune-$(CONFIG_CPU_ARM7V3) :=-mtune=arm610 tune-$(CONFIG_CPU_ARM610) :=-mtune=arm610 #tune-$(CONFIG_CPU_ARM710) :=-mtune=arm710 tune-$(CONFIG_CPU_ARM710) :=-mtune=arm7tdmi @@ -124,6 +125,10 @@ #LINKFLAGS = -X -T arch/armnommu/vmlinux.lds endif +ifeq ($(CONFIG_ARCH_SWARM),y) +MACHINE = swarm +TEXTADDR = 0x00008000 +endif export LIBGCC MACHINE PROCESSOR TEXTADDR GZFLAGS diff -Naur linux-2.4.4-uClinux/arch/armnommu/config.in linux-2.4.4-uClinux-hankvc/arch/armnommu/config.in --- linux-2.4.4-uClinux/arch/armnommu/config.in Sat Sep 8 19:54:07 2001 +++ linux-2.4.4-uClinux-hankvc/arch/armnommu/config.in Mon Sep 10 12:46:19 2001 @@ -39,8 +39,10 @@ mainmenu_option next_comment comment 'System Type' choice 'ARM system type' \ - "TI-DSC21 CONFIG_ARCH_DSC21" + "TI-DSC21 CONFIG_ARCH_DSC21 \ + SWARM CONFIG_ARCH_SWARM " endmenu + if [ "$CONFIG_ARCH_DSC21" = "y" ]; then define_bool CONFIG_CPU_ARM710 y define_bool CONFIG_CPU_32 y @@ -52,6 +54,17 @@ define_hex FLASH_SIZE 0x00200000 define_bool CONFIG_ARCH_ATMEL n define_bool CONFIG_DUMMY_CONSOLE y +fi + +if [ "$CONFIG_ARCH_SWARM" = "y" ]; then +# define_bool CONFIG_CPU_ARM610 y + define_bool CONFIG_CPU_32 y + define_bool CONFIG_CPU_26 n + define_bool CONFIG_CPU_32v3 y + define_bool CONFIG_CPU_ARM7V3 y + define_bool CONFIG_NO_PGT_CACHE y + define_hex FLASH_MEM_BASE 0x00000000 + define_hex FLASH_SIZE 0x00000000 fi #------------------------------------------------------------------------------ # G e n e r a l diff -Naur linux-2.4.4-uClinux/arch/armnommu/defconfig linux-2.4.4-uClinux-hankvc/arch/armnommu/defconfig --- linux-2.4.4-uClinux/arch/armnommu/defconfig Thu Jan 1 05:30:00 1970 +++ linux-2.4.4-uClinux-hankvc/arch/armnommu/defconfig Mon Sep 10 12:53:06 2001 @@ -0,0 +1,222 @@ +# +# Automatically generated by make menuconfig: don't edit +# +CONFIG_ARM=y +# CONFIG_SBUS is not set +CONFIG_UID16=y +CONFIG_UCLINUX=y +MAGIC_ROM_PTR=y + +# +# Code maturity level options +# +# CONFIG_EXPERIMENTAL is not set +# CONFIG_OBSOLETE is not set + +# +# Loadable module support +# +# CONFIG_MODULES is not set + +# +# System Type +# +# CONFIG_ARCH_DSC21 is not set +CONFIG_ARCH_SWARM=y +CONFIG_CPU_32=y +# CONFIG_CPU_26 is not set +CONFIG_CPU_32v3=y +CONFIG_CPU_ARM7V3=y +CONFIG_NO_PGT_CACHE=y +FLASH_MEM_BASE=0x00000000 +FLASH_SIZE=0x00000000 + +# +# General setup +# +# CONFIG_HOTPLUG is not set +# CONFIG_PCMCIA is not set +# CONFIG_NET is not set +# CONFIG_SYSVIPC is not set +# CONFIG_REDUCED_MEMORY is not set +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_SYSCTL is not set +CONFIG_NWFPE=y +CONFIG_KCORE_ELF=y +# CONFIG_KCORE_AOUT is not set +CONFIG_BINFMT_FLAT=y +CONFIG_KERNEL_ELF=y +# CONFIG_ARTHUR is not set +# CONFIG_ALIGNMENT_TRAP is not set + +# +# ATA/IDE/MFM/RLL support +# +# CONFIG_IDE is not set +# CONFIG_BLK_DEV_IDE_MODES is not set +# CONFIG_BLK_DEV_HD is not set + +# +# SCSI support +# +# CONFIG_SCSI is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Plug and Play configuration +# +# CONFIG_PNP is not set +# CONFIG_ISAPNP is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_LOOP is not set +# CONFIG_BLK_DEV_NBD is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_SIZE=8192 +CONFIG_BLK_DEV_INITRD=y +# CONFIG_BLK_DEV_BLKMEM is not set + +# +# File systems +# +# CONFIG_QUOTA is not set +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_CHECK is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_UMSDOS_FS is not set +# CONFIG_VFAT_FS is not set +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_CRAMFS is not set +# CONFIG_TMPFS is not set +# CONFIG_RAMFS is not set +# CONFIG_ISO9660_FS is not set +# CONFIG_JOLIET is not set +# CONFIG_MINIX_FS is not set +# CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +# CONFIG_PROC_FS is not set +# CONFIG_DEVFS_FS is not set +# CONFIG_DEVFS_MOUNT is not set +# CONFIG_DEVFS_DEBUG is not set +# CONFIG_DEVPTS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +# CONFIG_SYSV_FS_WRITE is not set +# CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_SMB_FS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_SMB_NLS is not set +# CONFIG_NLS is not set + +# +# Character devices +# +# CONFIG_LEDMAN is not set +# CONFIG_VT is not set +CONFIG_SERIAL=y +CONFIG_SERIAL_CONSOLE=y +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +# CONFIG_UNIX98_PTYS is not set + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_MOUSE is not set + +# +# Joysticks +# +# CONFIG_JOYSTICK is not set +# CONFIG_QIC02_TAPE is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_INTEL_RNG is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set +# CONFIG_DRM is not set + +# +# USB support +# +# CONFIG_USB is not set + +# +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# +# Kernel hacking +# +CONFIG_FRAME_POINTER=y +# CONFIG_REVISIT is not set +CONFIG_DEBUG_ERRORS=y +CONFIG_DEBUG_USER=y +# CONFIG_DEBUG_INFO is not set +# CONFIG_MAGIC_SYSRQ is not set diff -Naur linux-2.4.4-uClinux/arch/armnommu/kernel/arch.c linux-2.4.4-uClinux-hankvc/arch/armnommu/kernel/arch.c --- linux-2.4.4-uClinux/arch/armnommu/kernel/arch.c Sat Sep 8 19:54:07 2001 +++ linux-2.4.4-uClinux-hankvc/arch/armnommu/kernel/arch.c Tue Sep 25 01:29:46 2001 @@ -191,3 +191,36 @@ INITIRQ(genarch_init_irq) MACHINE_END #endif + +#ifdef CONFIG_ARCH_SWARM + +static void __init +fixup_swarm(struct machine_desc *desc, struct param_struct *params, + char **cmdline, struct meminfo *mi) +{ + + printk("ARM for SWARM by C Hanish Menon [www.hanishkvc.com] - 9 Sep 2001 \n"); + mi->nr_banks = 1; + /* Note: PHYS_OFFSET set to start after the kernel code and data */ + mi->bank[0].start = PHYS_OFFSET; + mi->bank[0].size = (10*1024*1024); + mi->bank[0].node = 0; + + ROOT_DEV = MKDEV(RAMDISK_MAJOR,0); + setup_ramdisk( 1, 0, 0, CONFIG_BLK_DEV_RAM_SIZE); + /* Initial ramdisk in the last 2 MB of Memory */ + setup_initrd( __phys_to_virt(0x00800000), 0x00200000); + + /* Serial Console COM2 and LCD */ + strcpy( *cmdline, "console=tty0"); + +} + +MACHINE_START(SWARM, "SWARM") + MAINTAINER("C Hanish Menon [www.hanishkvc.com]") + BOOT_MEM(0x00000000, 0x90000000, 0x90000000) + FIXUP(fixup_swarm) + INITIRQ(genarch_init_irq) +MACHINE_END +#endif + diff -Naur linux-2.4.4-uClinux/arch/armnommu/kernel/entry-armv.S linux-2.4.4-uClinux-hankvc/arch/armnommu/kernel/entry-armv.S --- linux-2.4.4-uClinux/arch/armnommu/kernel/entry-armv.S Sat Sep 8 19:54:07 2001 +++ linux-2.4.4-uClinux-hankvc/arch/armnommu/kernel/entry-armv.S Mon Sep 24 17:51:34 2001 @@ -542,6 +542,84 @@ strb r12, [r12] .endm +#elif defined(CONFIG_ARCH_SWARM) + + @ Print binary number in rdata + .macro debug_uart_asm_nommu_binary, label, rdata, rbase, rcur, rnibble, rtemp + mov \rbase, #0x90000000 + add \rbase, \rbase, #0x81000 + mov \rcur, #0x80000000 + mov \rnibble, #0x88000000 + add \rnibble, \rnibble, #0x880000 + add \rnibble, \rnibble, #0x8800 + add \rnibble, \rnibble, #0x88 + mov \rtemp, #'\n' + str \rtemp, [\rbase] + + more_bits\label: + ands \rtemp, \rcur, \rnibble + beq skiped_dot\label + mov \rtemp, #'.' + str \rtemp, [\rbase] + + skiped_dot\label: + ands \rtemp, \rdata, \rcur + beq skiped_one\label + mov \rtemp, #0x31 + str \rtemp, [\rbase] + b check_next\label + + skiped_one\label: + mov \rtemp, #0x30 + str \rtemp, [\rbase] + + check_next\label: + movs \rcur, \rcur, lsr #1 + bne more_bits\label + mov \rtemp, #'\n' + str \rtemp, [\rbase] + .endm + + .macro debug_uart_asm_nommu, data, rbase, rtemp + mov \rbase, #0x90000000 + add \rbase, \rbase, #0x81000 + mov \rtemp, #\data + str \rtemp, [\rbase] + .endm + + .macro debug_uart_asm_nommu_reg_alphanum, rdata, rbase, rtemp + mov \rbase, #0x90000000 + add \rbase, \rbase, #0x81000 + add \rtemp, \rdata, #0x30 + str \rtemp, [\rbase] + .endm + + .macro disable_fiq + .endm + + .macro get_irqnr_and_base, label, irqnr, irqstat, base, tmp + debug_uart_asm_nommu 'I', \irqstat, \irqnr + ldr \irqstat, =SWARM_INT_IRQ_STATUS + ldr \irqstat, [\irqstat] @ get interrupts + @debug_uart_asm_nommu_binary \label, \irqstat, \base, \irqnr, \tmp, r8 + + mov \irqnr, #0 +1001: + @debug_uart_asm_nommu_reg_alphanum \irqnr, \base, \tmp + tst \irqstat, #1 + bne 1002f + add \irqnr, \irqnr, #1 + mov \irqstat, \irqstat, lsr #1 + cmp \irqnr, #32 + bcc 1001b +1002: /* EQ will be set if we reach 32 */ + .endm + + .macro irq_prio_table +irq_prio_swarm: + .byte 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 + .endm + #else #error Unknown architecture #endif @@ -732,7 +810,7 @@ add r4, sp, #S_SP mov r6, lr stmia r4, {r5, r6, r7, r8, r9} @ save sp_SVC, lr_SVC, pc, cpsr, old_ro -1: get_irqnr_and_base r0, r6, r5, lr +1: get_irqnr_and_base entry_mm0, r0, r6, r5, lr movne r1, sp @ @ routine called with r0 = irq number, r1 = struct pt_regs * @@ -741,6 +819,7 @@ bne do_IRQ ldr r0, [sp, #S_PSR] @ irqs are already disabled msr spsr, r0 + @debug_uart_asm_nommu_binary entry_mm1, r0, r1, r2, r3, r8 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr .align 5 @@ -838,7 +917,7 @@ stmdb r8, {sp, lr}^ alignment_trap r4, r7, __temp_irq zero_fp -1: get_irqnr_and_base r0, r6, r5, lr +1: get_irqnr_and_base entry_mm1, r0, r6, r5, lr movne r1, sp adrsvc ne, lr, 1b @ @@ -961,6 +1040,8 @@ ldr r13, .LCsirq sub lr, lr, #4 str lr, [r13] @ save lr_IRQ + debug_uart_asm_nommu 'i', r13, lr + ldr r13, .LCsirq mrs lr, spsr str lr, [r13, #4] @ save spsr_IRQ @ @@ -1085,6 +1166,8 @@ @ ldr r13, .LCsund str lr, [r13] @ save lr_UND + debug_uart_asm_nommu 'u', r13, lr + ldr r13, .LCsund mrs lr, spsr str lr, [r13, #4] @ save spsr_UND @ diff -Naur linux-2.4.4-uClinux/arch/armnommu/kernel/head-armv.S linux-2.4.4-uClinux-hankvc/arch/armnommu/kernel/head-armv.S --- linux-2.4.4-uClinux/arch/armnommu/kernel/head-armv.S Sat Sep 8 19:54:07 2001 +++ linux-2.4.4-uClinux-hankvc/arch/armnommu/kernel/head-armv.S Wed Sep 19 00:54:43 2001 @@ -30,12 +30,15 @@ * * swapper_pg_dir, pgtbl and krnladr are all closely related. */ + +#ifndef NO_MM #if (TEXTADDR & 0xffff) != 0x8000 #error TEXTADDR must start at 0xXXXX8000 #endif .globl SYMBOL_NAME(swapper_pg_dir) .equ SYMBOL_NAME(swapper_pg_dir), TEXTADDR - 0x4000 +#endif .macro pgtbl, reg, rambase adr \reg, stext @@ -51,6 +54,58 @@ bic \rd, \pgtable, #0x000ff000 .endm + .macro debug_uart_asm_nommu, data, rbase, rtemp + mov \rbase, #0x90000000 + add \rbase, \rbase, #0x81000 + mov \rtemp, #\data + str \rtemp, [\rbase] + .endm + + .macro debug_uart_asm_nommu_reg, rdata, rbase + mov \rbase, #0x90000000 + add \rbase, \rbase, #0x81000 + str \rdata, [\rbase] + .endm + + @ Print binary number in r0 + .macro debug_uart_asm_nommu_binary, label, rdata, rbase, rcur, rnibble, rtemp + mov \rbase, #0x90000000 + add \rbase, \rbase, #0x81000 + mov \rcur, #0x80000000 + mov \rnibble, #0x88000000 + add \rnibble, \rnibble, #0x880000 + add \rnibble, \rnibble, #0x8800 + add \rnibble, \rnibble, #0x88 + mov \rtemp, #'\n' + str \rtemp, [\rbase] + + more_bits\label: + ands \rtemp, \rcur, \rnibble + beq skiped_dot\label + mov \rtemp, #'.' + str \rtemp, [\rbase] + + skiped_dot\label: + ands \rtemp, \rdata, \rcur + beq skiped_one\label + mov \rtemp, #0x31 + str \rtemp, [\rbase] + b check_next\label + + skiped_one\label: + mov \rtemp, #0x30 + str \rtemp, [\rbase] + + check_next\label: + movs \rcur, \rcur, lsr #1 + bne more_bits\label + mov \rtemp, #'\n' + str \rtemp, [\rbase] + @ Give time to verify + @ldr \rtemp, [\rbase] + @str \rtemp, [\rbase] + .endm + /* * Kernel startup entry point. * @@ -67,6 +122,10 @@ .section ".text.init",#alloc,#execinstr .type stext, #function ENTRY(stext) +#if defined(CONFIG_ARCH_SWARM) + mov r0, #0 + mov r1, #60 @ Temporarly forced in tools/mach-types have to update it with RMK +#endif mov r12, r0 /* * NOTE! Any code which is placed here should be done for one of @@ -134,11 +193,16 @@ teq r10, #0 @ invalid processor? moveq r0, #'p' @ yes, error 'p' beq __error + debug_uart_asm_nommu 'P', r5, r6 bl __lookup_architecture_type teq r7, #0 @ invalid architecture? moveq r0, #'a' @ yes, error 'a' beq __error + debug_uart_asm_nommu 'A', r2, r3 +#ifndef NO_MM bl __create_page_tables + debug_uart_asm_nommu 'T', r2, r3 +#endif adr lr, __ret @ return address add pc, r10, #12 @ initialise processor @ (return control reg) @@ -153,10 +217,13 @@ .long SYMBOL_NAME(init_task_union)+8192 __ret: ldr lr, __switch_data +#ifndef NO_MM mcr p15, 0, r0, c1, c0 +#endif mov r0, r0 mov r0, r0 mov r0, r0 + @ debug_uart_asm_nommu_binary L5,lr,r2,r3,r4,r5 mov pc, lr /* @@ -169,9 +236,13 @@ */ .align 5 __mmap_switched: + debug_uart_asm_nommu 'M', r2, r3 adr r3, __switch_data + 4 ldmia r3, {r2, r4, r5, r6, r7, r8, sp}@ r2 = compat @ sp = stack pointer + @ r12 does not seem to be defined for all arm targets. + @ Also what is getting stored into compat(i.e[r2]) + @ gets overwritten when BSS is cleared. str r12, [r2] mov fp, #0 @ Clear BSS (and zero fp) @@ -186,6 +257,8 @@ #endif bic r2, r0, #2 @ Clear 'A' bit stmia r8, {r0, r2} @ Save control register values + debug_uart_asm_nommu 'C', r2, r3 + debug_uart_asm_nommu '\n', r2, r3 b SYMBOL_NAME(start_kernel) @@ -319,6 +392,8 @@ * Generally, only serious errors cause this. */ __error: + debug_uart_asm_nommu 'E', r1, r2 + debug_uart_asm_nommu_reg r0, r1 #ifdef CONFIG_DEBUG_LL mov r8, r0 @ preserve r0 adr r0, err_str @@ -367,8 +442,12 @@ add r7, r7, r5 @ to our address space add r10, r9, r5 mrc p15, 0, r9, c0, c0 @ get processor id + @ Note debug_uart_asm_nommu_binary s below are corrupting r1 register + @debug_uart_asm_nommu_binary L2, r9, r0, r1, r2, r3 1: ldmia r10, {r5, r6, r8} @ value, mask, mmuflags and r6, r6, r9 @ mask wanted bits + @debug_uart_asm_nommu_binary L3, r5, r0, r1, r2, r3 + @debug_uart_asm_nommu_binary L4, r6, r0, r1, r2, r3 teq r5, r6 moveq pc, lr add r10, r10, #36 @ sizeof(proc_info_list) @@ -381,7 +460,7 @@ * Look in include/asm-arm/procinfo.h and arch/arm/kernel/arch.[ch] for * more information about the __proc_info and __arch_info structures. */ -2: .long __proc_info_end +2: .long __proc_info_end .long __proc_info_begin .long 2b .long __arch_info_begin diff -Naur linux-2.4.4-uClinux/arch/armnommu/kernel/setup.c linux-2.4.4-uClinux-hankvc/arch/armnommu/kernel/setup.c --- linux-2.4.4-uClinux/arch/armnommu/kernel/setup.c Sat Sep 8 19:54:07 2001 +++ linux-2.4.4-uClinux-hankvc/arch/armnommu/kernel/setup.c Sun Sep 9 15:44:35 2001 @@ -39,7 +39,7 @@ extern void paging_init(struct meminfo *, struct machine_desc *desc); extern void bootmem_init(struct meminfo *); extern void reboot_setup(char *str); -extern unsigned long memparse(char *ptr, char **retptr); +extern unsigned long long memparse(char *ptr, char **retptr); extern int root_mountflags; extern int _stext, _text, _etext, _edata, _end; diff -Naur linux-2.4.4-uClinux/arch/armnommu/kernel/signal.c linux-2.4.4-uClinux-hankvc/arch/armnommu/kernel/signal.c --- linux-2.4.4-uClinux/arch/armnommu/kernel/signal.c Sat Sep 8 19:54:07 2001 +++ linux-2.4.4-uClinux-hankvc/arch/armnommu/kernel/signal.c Sun Sep 9 15:44:35 2001 @@ -36,8 +36,8 @@ #define SWI_THUMB_SIGRETURN (0xdf00) #define SWI_THUMB_RT_SIGRETURN (0xdf00) -asmlinkage int sys_wait4(pid_t pid, unsigned long * stat_addr, - int options, unsigned long *ru); +asmlinkage long sys_wait4(pid_t pid,unsigned int * stat_addr, + int options, struct rusage * ru); asmlinkage int do_signal(sigset_t *oldset, struct pt_regs * regs, int syscall); int copy_siginfo_to_user(siginfo_t *to, siginfo_t *from) diff -Naur linux-2.4.4-uClinux/arch/armnommu/mm/Makefile linux-2.4.4-uClinux-hankvc/arch/armnommu/mm/Makefile --- linux-2.4.4-uClinux/arch/armnommu/mm/Makefile Sat Sep 8 19:54:08 2001 +++ linux-2.4.4-uClinux-hankvc/arch/armnommu/mm/Makefile Mon Sep 10 12:49:33 2001 @@ -21,6 +21,7 @@ export-objs := proc-syms.o p-$(CONFIG_CPU_26) += proc-arm2,3.o +p-$(CONFIG_CPU_ARM7V3) += proc-arm6,7.o p-$(CONFIG_CPU_ARM610) += proc-arm6,7.o p-$(CONFIG_CPU_ARM710) += proc-arm6,7.o p-$(CONFIG_CPU_ARM720T) += proc-arm720.o diff -Naur linux-2.4.4-uClinux/arch/armnommu/nwfpe/ARM-gcc.h linux-2.4.4-uClinux-hankvc/arch/armnommu/nwfpe/ARM-gcc.h --- linux-2.4.4-uClinux/arch/armnommu/nwfpe/ARM-gcc.h Thu Jan 1 05:30:00 1970 +++ linux-2.4.4-uClinux-hankvc/arch/armnommu/nwfpe/ARM-gcc.h Sun Sep 9 15:44:35 2001 @@ -0,0 +1,128 @@ + +/* +------------------------------------------------------------------------------- +One of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined. +------------------------------------------------------------------------------- +*/ +#define LITTLEENDIAN + +/* +------------------------------------------------------------------------------- +The macro `BITS64' can be defined to indicate that 64-bit integer types are +supported by the compiler. +------------------------------------------------------------------------------- +*/ +#define BITS64 + +/* +------------------------------------------------------------------------------- +Each of the following `typedef's defines the most convenient type that holds +integers of at least as many bits as specified. For example, `uint8' should +be the most convenient type that can hold unsigned integers of as many as +8 bits. The `flag' type must be able to hold either a 0 or 1. For most +implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed +to the same as `int'. +------------------------------------------------------------------------------- +*/ +typedef char flag; +typedef unsigned char uint8; +typedef signed char int8; +typedef int uint16; +typedef int int16; +typedef unsigned int uint32; +typedef signed int int32; +#ifdef BITS64 +typedef unsigned long long int bits64; +typedef signed long long int sbits64; +#endif + +/* +------------------------------------------------------------------------------- +Each of the following `typedef's defines a type that holds integers +of _exactly_ the number of bits specified. For instance, for most +implementation of C, `bits16' and `sbits16' should be `typedef'ed to +`unsigned short int' and `signed short int' (or `short int'), respectively. +------------------------------------------------------------------------------- +*/ +typedef unsigned char bits8; +typedef signed char sbits8; +typedef unsigned short int bits16; +typedef signed short int sbits16; +typedef unsigned int bits32; +typedef signed int sbits32; +#ifdef BITS64 +typedef unsigned long long int uint64; +typedef signed long long int int64; +#endif + +#ifdef BITS64 +/* +------------------------------------------------------------------------------- +The `LIT64' macro takes as its argument a textual integer literal and if +necessary ``marks'' the literal as having a 64-bit integer type. For +example, the Gnu C Compiler (`gcc') requires that 64-bit literals be +appended with the letters `LL' standing for `long long', which is `gcc's +name for the 64-bit integer type. Some compilers may allow `LIT64' to be +defined as the identity macro: `#define LIT64( a ) a'. +------------------------------------------------------------------------------- +*/ +#define LIT64( a ) a##LL +#endif + +/* +------------------------------------------------------------------------------- +The macro `INLINE' can be used before functions that should be inlined. If +a compiler does not support explicit inlining, this macro should be defined +to be `static'. +------------------------------------------------------------------------------- +*/ +#define INLINE extern __inline__ + + +/* For use as a GCC soft-float library we need some special function names. */ + +#ifdef __LIBFLOAT__ + +/* Some 32-bit ops can be mapped straight across by just changing the name. */ +#define float32_add __addsf3 +#define float32_sub __subsf3 +#define float32_mul __mulsf3 +#define float32_div __divsf3 +#define int32_to_float32 __floatsisf +#define float32_to_int32_round_to_zero __fixsfsi +#define float32_to_uint32_round_to_zero __fixunssfsi + +/* These ones go through the glue code. To avoid namespace pollution + we rename the internal functions too. */ +#define float32_eq ___float32_eq +#define float32_le ___float32_le +#define float32_lt ___float32_lt + +/* All the 64-bit ops have to go through the glue, so we pull the same + trick. */ +#define float64_add ___float64_add +#define float64_sub ___float64_sub +#define float64_mul ___float64_mul +#define float64_div ___float64_div +#define int32_to_float64 ___int32_to_float64 +#define float64_to_int32_round_to_zero ___float64_to_int32_round_to_zero +#define float64_to_uint32_round_to_zero ___float64_to_uint32_round_to_zero +#define float64_to_float32 ___float64_to_float32 +#define float32_to_float64 ___float32_to_float64 +#define float64_eq ___float64_eq +#define float64_le ___float64_le +#define float64_lt ___float64_lt + +#if 0 +#define float64_add __adddf3 +#define float64_sub __subdf3 +#define float64_mul __muldf3 +#define float64_div __divdf3 +#define int32_to_float64 __floatsidf +#define float64_to_int32_round_to_zero __fixdfsi +#define float64_to_uint32_round_to_zero __fixunsdfsi +#define float64_to_float32 __truncdfsf2 +#define float32_to_float64 __extendsfdf2 +#endif + +#endif diff -Naur linux-2.4.4-uClinux/arch/armnommu/tools/mach-types linux-2.4.4-uClinux-hankvc/arch/armnommu/tools/mach-types --- linux-2.4.4-uClinux/arch/armnommu/tools/mach-types Sat Sep 8 19:54:08 2001 +++ linux-2.4.4-uClinux-hankvc/arch/armnommu/tools/mach-types Mon Sep 10 13:21:40 2001 @@ -63,7 +63,9 @@ spot SA1100_SPOT SPOT 53 flexanet ARCH_FLEXANET FLEXANET 54 webpal ARCH_WEBPAL WEBPAL 55 -dsc21 ARCH_DSC21 DSC21 56 +dsc21 ARCH_DSC21 DSC21 56 +swarm ARCH_SWARM SWARM 60 # The following are unallocated empeg SA1100_EMPEG EMPEG + diff -Naur linux-2.4.4-uClinux/arch/armnommu/vmlinux-armv.lds.in linux-2.4.4-uClinux-hankvc/arch/armnommu/vmlinux-armv.lds.in --- linux-2.4.4-uClinux/arch/armnommu/vmlinux-armv.lds.in Sat Sep 8 19:54:07 2001 +++ linux-2.4.4-uClinux-hankvc/arch/armnommu/vmlinux-armv.lds.in Mon Sep 10 01:07:34 2001 @@ -7,32 +7,6 @@ SECTIONS { . = TEXTADDR; - .text : { /* Real text segment */ - _text = .; /* Text and read-only data */ - *(.text) - *(.fixup) - *(.gnu.warning) - *(.text.lock) /* out-of-line lock text */ - *(.rodata) - *(.glue_7) - *(.glue_7t) - *(.kstrtab) - . = ALIGN(16); - __start___ex_table = .; /* Exception table */ - *(__ex_table) - __stop___ex_table = .; - - __start___ksymtab = .; /* Kernel symbol table */ - *(__ksymtab) - __stop___ksymtab = .; - - *(.got) /* Global offset table */ - - _etext = .; /* End of text section */ - } - - . = ALIGN(4096); - .init : { /* Init code and data */ _stext = .; __init_begin = .; @@ -54,15 +28,38 @@ . = ALIGN(4096); __init_end = .; } - + /DISCARD/ : { /* Exit code and data */ *(.text.exit) *(.data.exit) *(.exitcall.exit) } - . = DATAADDR; + .text : { /* Real text segment */ + _text = .; /* Text and read-only data */ + *(.text) + *(.fixup) + *(.gnu.warning) + *(.text.lock) /* out-of-line lock text */ + *(.rodata) + *(.glue_7) + *(.glue_7t) + *(.kstrtab) + . = ALIGN(16); + __start___ex_table = .; /* Exception table */ + *(__ex_table) + __stop___ex_table = .; + + __start___ksymtab = .; /* Kernel symbol table */ + *(__ksymtab) + __stop___ksymtab = .; + + *(.got) /* Global offset table */ + + _etext = .; /* End of text section */ + } + /* . = DATAADDR; - Removed by HanishKVC */ . = ALIGN(8192); /* Do I need this? --gmcnutt */ diff -Naur linux-2.4.4-uClinux/include/asm-armnommu/arch-dsc21/memory.h linux-2.4.4-uClinux-hankvc/include/asm-armnommu/arch-dsc21/memory.h --- linux-2.4.4-uClinux/include/asm-armnommu/arch-dsc21/memory.h Sat Sep 8 19:54:10 2001 +++ linux-2.4.4-uClinux-hankvc/include/asm-armnommu/arch-dsc21/memory.h Sun Sep 9 16:49:18 2001 @@ -48,4 +48,27 @@ */ #define PAGE_OFFSET PHYS_OFFSET +/* Moved the __macros below from asm/memory.h to asm/arch/memory.h + * -- HanishKVC + */ + +/* + * For some reason other asm/.h files refer to these instead of the more + * public macros above. + * --gmcnutt + */ +#define __virt_to_bus(x) x +#define __bus_to_virt(x) x +#define __virt_to_phys(x) x +#define __phys_to_virt(x) x + +/* + * arch/armnommu/kernel/armksyms.c needs these. + * --gmcnutt + */ +#define __virt_to_phys__is_a_macro +#define __phys_to_virt__is_a_macro +#define __virt_to_bus__is_a_macro +#define __bus_to_virt__is_a_macro + #endif diff -Naur linux-2.4.4-uClinux/include/asm-armnommu/arch-dsc21/serial.h linux-2.4.4-uClinux-hankvc/include/asm-armnommu/arch-dsc21/serial.h --- linux-2.4.4-uClinux/include/asm-armnommu/arch-dsc21/serial.h Sat Sep 8 19:54:10 2001 +++ linux-2.4.4-uClinux-hankvc/include/asm-armnommu/arch-dsc21/serial.h Sun Sep 9 19:31:30 2001 @@ -11,6 +11,7 @@ * 15-10-1996 RMK Created * 04-04-1998 PJB Merged `arc' and `a5k' architectures * 02-28-2001 GJM Modified for dsc21 + * */ #ifndef __ASM_ARCH_SERIAL_H #define __ASM_ARCH_SERIAL_H diff -Naur linux-2.4.4-uClinux/include/asm-armnommu/arch-swarm/dma.h linux-2.4.4-uClinux-hankvc/include/asm-armnommu/arch-swarm/dma.h --- linux-2.4.4-uClinux/include/asm-armnommu/arch-swarm/dma.h Thu Jan 1 05:30:00 1970 +++ linux-2.4.4-uClinux-hankvc/include/asm-armnommu/arch-swarm/dma.h Mon Sep 10 21:27:37 2001 @@ -0,0 +1,63 @@ +/* + * asm/arch-armnommu/arch-swarm/dma.h: + * swarm-specific macros for DMA support. + * 09 Sep 2001 - C Hanish Menon [www.hanishkvc.com] + * - Copied the file from dsc21 to swarm + * - Have to verify and update has required later + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +#ifndef __ASM_ARCH_DMA_H +#define __ASM_ARCH_DMA_H + +/* + * MAX_DMA_ADDRESS -- max address we can program into the DMA address registers? + * Not sure. Various drivers use this value as a test before setting up a DMA. + * Also, the macros in linux/bootmem.h use this value as a goal for many of the + * bootmem allocations. + * Open questions: + * a) the DMA address register is only 26 bits -- does this limit us to this + * section of memory, or can we only DMA in certain size chunks? + * b) can the ARM processor even directly program the DMA? + * I'm going to go out on a limb and assume that the DMA range is the first + * addresseable 26 bits. + * --gmcnutt + */ +#define MAX_DMA_ADDRESS 0x02000000 + +/* + * MAX_DMA_CHANNELS -- # of DMA control register sets we possess. For the dsc21 + * we have one that can run in either direction and between two different + * destinations. + * --gmcnutt + */ +#define MAX_DMA_CHANNELS 1 + +/* + * arch_dma_init -- called by arch/armnommu/kernel/dma.c init_dma. + * Don't know what's needed here (if anything). + * --gmcnutt + */ +#define arch_dma_init(dma_chan) + +#endif /* _ASM_ARCH_DMA_H */ diff -Naur linux-2.4.4-uClinux/include/asm-armnommu/arch-swarm/hardware.h linux-2.4.4-uClinux-hankvc/include/asm-armnommu/arch-swarm/hardware.h --- linux-2.4.4-uClinux/include/asm-armnommu/arch-swarm/hardware.h Thu Jan 1 05:30:00 1970 +++ linux-2.4.4-uClinux-hankvc/include/asm-armnommu/arch-swarm/hardware.h Tue Sep 25 01:12:23 2001 @@ -0,0 +1,54 @@ +/* + * linux/include/asm-armnommu/arch-swarm/hardware.h + * + * Copyright (C) 1996 Russell King. + * 09 Sep 2001 - C Hanish Menon [www.hanishkvc.com] + * - Copied for armnommu/swarm and updated has required + * + * This file contains the hardware definitions of the SWARM Emulator + */ + +#ifndef __ASM_ARCH_HARDWARE_H +#define __ASM_ARCH_HARDWARE_H + +/* ARM clock rate (MHz) */ +#define SWARM_CLOCK_RATE 00010000 + +/* uarts (note that the register fields aren't needed by the standard linux + serial driver -- we only use them for our initial debugging console) */ +#define SWARM_UART0_BASE 0x90081000 +#define SWARM_UART0_TXBASE 0x90081000 +#define SWARM_UART0_RXBASE 0x90081004 +#define SWARM_UART0_CR 0x90081008 +#define SWARM_UART0_SR 0x9008100c + +/* timers */ +#define SWARM_TIMER_BASE 0x90000000 +#define SWARM_TIMER_MATCH0 0x90000000 +#define SWARM_TIMER_MATCH1 0x90000004 +#define SWARM_TIMER_MATCH2 0x90000008 +#define SWARM_TIMER_MATCH3 0x9000000c +#define SWARM_TIMER_CNT 0x90000010 +#define SWARM_TIMER_STATUS 0x90000014 +#define SWARM_TIMER_WDOG 0x90000018 +#define SWARM_TIMER_INTEN 0x9000001C + +#define SWARM_TIMER_SYS_COUNT 400000 + +/* interrupt */ +#define SWARM_INT_BASE 0x90050000 +#define SWARM_INT_IRQ_STATUS 0x90050000 +#define SWARM_INT_MASK 0x90050004 +#define SWARM_INT_LEVEL 0x90050008 +#define SWARM_INT_FIQ_STATUS 0x9005000c + +/* + * HARD_RESET_NOW -- used in blkmem.c. Should call arch_hard_reset(), but I + * don't appear to have one ;). + * --gmcnutt + */ +#define HARD_RESET_NOW() + + +#endif /* _ASM_ARCH_HARDWARE_H */ + diff -Naur linux-2.4.4-uClinux/include/asm-armnommu/arch-swarm/io.h linux-2.4.4-uClinux-hankvc/include/asm-armnommu/arch-swarm/io.h --- linux-2.4.4-uClinux/include/asm-armnommu/arch-swarm/io.h Thu Jan 1 05:30:00 1970 +++ linux-2.4.4-uClinux-hankvc/include/asm-armnommu/arch-swarm/io.h Tue Sep 25 01:07:18 2001 @@ -0,0 +1,41 @@ +/* + * linux/include/asm-armnommu/arch-swarm/io.h + * + * Copyright (C) 1997-1999 Russell King + * + * Modifications: + * 06-12-1997 RMK Created. + * 07-04-1999 RMK Major cleanup + * 02-19-2001 gjm Leveraged for armnommu/dsc21 + * 09 Sep 2001 - C Hanish Menon [www.hanishkvc.com] + * - Leveraged for armnommu/swarm + */ +#ifndef __ASM_ARM_ARCH_IO_H +#define __ASM_ARM_ARCH_IO_H + +/* + * kernel/resource.c uses this to initialize the global ioport_resource struct + * which is used in all calls to request_resource(), allocate_resource(), etc. + * --gmcnutt + */ +#define IO_SPACE_LIMIT 0xffffffff + +/* + * If we define __io then asm/io.h will take care of most of the inb & friends + * macros. It still leaves us some 16bit macros to deal with ourselves, though. + * We don't have PCI or ISA on the dsc21 so I dropped __mem_pci & __mem_isa. + * --gmcnutt + */ +#define PCIO_BASE 0 +#define __io(a) (PCIO_BASE + (a)) +#define __arch_getw(a) (*(volatile unsigned short *)(a)) +#define __arch_putw(v,a) (*(volatile unsigned short *)(a) = (v)) + +/* + * Defining these two gives us ioremap for free. See asm/io.h. + * --gmcnutt + */ +#define iomem_valid_addr(iomem,sz) (1) +#define iomem_to_phys(iomem) (iomem) + +#endif diff -Naur linux-2.4.4-uClinux/include/asm-armnommu/arch-swarm/irq.h linux-2.4.4-uClinux-hankvc/include/asm-armnommu/arch-swarm/irq.h --- linux-2.4.4-uClinux/include/asm-armnommu/arch-swarm/irq.h Thu Jan 1 05:30:00 1970 +++ linux-2.4.4-uClinux-hankvc/include/asm-armnommu/arch-swarm/irq.h Tue Sep 25 01:26:54 2001 @@ -0,0 +1,25 @@ +/* + * linux/include/asm-armnommu/arch-swarm/irq.h + * + * 18 Sep 2001 - C Hanish Menon [www.hanishkvc.com] + * + */ + +#ifndef __ASM_ARCH_IRQ_H__ +#define __ASM_ARCH_IRQ_H__ + +#include +#include + +#define fixup_irq(x) (x) + +static __inline__ void irq_init_irq(void) +{ + outl(0x0, SWARM_INT_MASK); /* Disable all interrupts */ + outl(0x0, SWARM_INT_LEVEL); /* no FIQs only IRQs */ + //printk("DebugKVC: In irq_init_irq \n"); + return; +} + +#endif + diff -Naur linux-2.4.4-uClinux/include/asm-armnommu/arch-swarm/irqs.h linux-2.4.4-uClinux-hankvc/include/asm-armnommu/arch-swarm/irqs.h --- linux-2.4.4-uClinux/include/asm-armnommu/arch-swarm/irqs.h Thu Jan 1 05:30:00 1970 +++ linux-2.4.4-uClinux-hankvc/include/asm-armnommu/arch-swarm/irqs.h Tue Sep 25 01:09:08 2001 @@ -0,0 +1,56 @@ +/* + * irqs.h: + * IRQ numbers for the dsc21. + * copyright: + * (C) 2001 RidgeRun, Inc. (http://www.ridgerun.com) + * Gordon McNutt + * + * 09 Sep 2001 - C Hanish Menon [www.hanishkvc.com] + * - Copied and updated to suite armnommu/swarm + * + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ +#ifndef __ASM_ARCH_IRQS_H__ +#define __ASM_ARCH_IRQS_H__ + +/* irq #s */ +#define SWARM_IRQ_TIMER0 26 +#define SWARM_IRQ_TIMER1 27 +#define SWARM_IRQ_TIMER2 28 +#define SWARM_IRQ_TIMER3 29 +#define SWARM_IRQ_UART0 24 +#define SWARM_IRQ_MAX 29 + +#define NR_IRQS (SWARM_IRQ_MAX + 1) + +/* alias */ +#define IRQ_TIMER SWARM_IRQ_TIMER0 + +/* flags for request_irq() */ +#define IRQ_FLG_LOCK (0x0001) /* handler is not replaceable */ +#define IRQ_FLG_REPLACE (0x0002) /* replace existing handler */ +#define IRQ_FLG_FAST (0x0004) +#define IRQ_FLG_SLOW (0x0008) +#define IRQ_FLG_STD (0x8000) /* internally used */ + +#endif /* __ASM_ARCH_IRQS_H__ */ diff -Naur linux-2.4.4-uClinux/include/asm-armnommu/arch-swarm/memory.h linux-2.4.4-uClinux-hankvc/include/asm-armnommu/arch-swarm/memory.h --- linux-2.4.4-uClinux/include/asm-armnommu/arch-swarm/memory.h Thu Jan 1 05:30:00 1970 +++ linux-2.4.4-uClinux-hankvc/include/asm-armnommu/arch-swarm/memory.h Tue Sep 25 01:11:15 2001 @@ -0,0 +1,74 @@ +/* + * linux/include/asm-armnommu/arch-swarm/memory.h + * + * Copyright (c) 1999 Nicolas Pitre + * Copyright (c) 2001 RidgeRun + * + * 02/19/2001 Gordon McNutt Leveraged for the dsc21. + * 09 Sep 2001 C Hanish Menon [www.hanishkvc.com] + * - Added for SWARM + * - Also put back the macros which McNutt had moved to asm/memory.h + * + */ + +#ifndef __ASM_ARCH_MEMORY_H +#define __ASM_ARCH_MEMORY_H + + +/* + * These are used in the fault handling code (even for nommu) and various other + * macros. The current value comes from Steve Johnson's 2.0.38 uClinux port for + * the dsc21. + * --gmcnutt + */ +#define TASK_SIZE (0x01a00000UL) +#define TASK_SIZE_26 TASK_SIZE + + +/* + * The start of physical memory. For the dsc21 this is the first SDRAM address. + * This value is used in the arch-specific bootup code like setup_arch & + * bootmem_init. By default we assume that we have one block of contiguous + * memory (a node) that starts here and runs MEM_SIZE long (see below). By + * default the ARM bootup code sets MEM_SIZE to be 16MB which is just right for + * us (see arch/armnommu/kernel/setup.c). + * + * NOTE: I don't really use the start of SDRAM. Instead I reserve some pages + * of SDRAM for some of the kernel sections (like .data & .bss). The + * linker script has been modified to mark the first unreservered page + * as _end_kernel (see arch/armnommu/vmlinux-armv.lds.in). + * + * --gmcnutt + */ +extern int _end_kernel; +#define PHYS_OFFSET ((unsigned long) &_end_kernel) + +/* + * PAGE_OFFSET -- the first address of the first page of memory. For archs with + * no MMU this corresponds to the first free page in physical memory (aligned + * on a page boundary). + * --gmcnutt + */ +#define PAGE_OFFSET PHYS_OFFSET + +/* + * Moved the __xtoy and _xtoy_is_a_macro macros below + * from asm/memory.h to asm/arch/memory.h + * -- HanishKVC + */ + +#define __virt_to_bus(x) x +#define __bus_to_virt(x) x +#define __virt_to_phys(x) x +#define __phys_to_virt(x) x + +/* + * arch/armnommu/kernel/armksyms.c needs these. + * --gmcnutt + */ +#define __virt_to_phys__is_a_macro +#define __phys_to_virt__is_a_macro +#define __virt_to_bus__is_a_macro +#define __bus_to_virt__is_a_macro + +#endif diff -Naur linux-2.4.4-uClinux/include/asm-armnommu/arch-swarm/param.h linux-2.4.4-uClinux-hankvc/include/asm-armnommu/arch-swarm/param.h --- linux-2.4.4-uClinux/include/asm-armnommu/arch-swarm/param.h Thu Jan 1 05:30:00 1970 +++ linux-2.4.4-uClinux-hankvc/include/asm-armnommu/arch-swarm/param.h Sun Sep 9 18:58:11 2001 @@ -0,0 +1,6 @@ +#ifndef __ARCH_ASM_PARAM_H__ +#define __ARCH_ASM_PARAM_H__ + +/* nothing for now */ + +#endif /* __ARCH_ASM_PARAM_H__ */ diff -Naur linux-2.4.4-uClinux/include/asm-armnommu/arch-swarm/serial.h linux-2.4.4-uClinux-hankvc/include/asm-armnommu/arch-swarm/serial.h --- linux-2.4.4-uClinux/include/asm-armnommu/arch-swarm/serial.h Thu Jan 1 05:30:00 1970 +++ linux-2.4.4-uClinux-hankvc/include/asm-armnommu/arch-swarm/serial.h Tue Sep 25 01:25:56 2001 @@ -0,0 +1,126 @@ +/* + * linux/include/asm-arm/arch-arc/serial.h + * + * Copyright (C) 1996 Russell King. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Changelog: + * 15-10-1996 RMK Created + * 04-04-1998 PJB Merged `arc' and `a5k' architectures + * 02-28-2001 GJM Modified for dsc21 + * 09 Sep 2001 C Hanish Menon [www.hanishkvc.com] + * - Updated for armnommu/swarm + * + */ +#ifndef __ASM_ARCH_SERIAL_H +#define __ASM_ARCH_SERIAL_H + +#include +#include + +/* setup */ +#define BASE_BAUD (SWARM_CLOCK_RATE / 16) +#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST) +#define RS_TABLE_SIZE 1 +#define STD_SERIAL_PORT_DEFNS \ + { \ + magic: 0, \ + baud_base: BASE_BAUD, \ + port: 0, \ + irq: SWARM_IRQ_UART0, \ + flags: STD_COM_FLAGS, \ + type: PORT_UNKNOWN, \ + iomem_base: (u8*)SWARM_UART0_BASE, \ + iomem_reg_shift: 1, \ + io_type: SERIAL_IO_MEM \ + } /* ttyS0 */ +#define EXTRA_SERIAL_PORT_DEFNS + + +/* registers */ +#define UART_DTRR 0 /* Data Transmission/Reception Register */ +#define UART_BRSR 1 /* Bit Rate Set Register */ +#define UART_MSR 2 /* Mode Set Register */ +#define UART_RFCR 3 /* Reception FIFO Control Register */ +#define UART_TFCR 4 /* Transmission FIFO Control Register */ +#define UART_LCR 5 /* Line Control Register */ +#define UART_SR 6 /* Status Register */ + +/* bitmasks */ +#define UART_MSR_CLS 0x0001 // Character length select (1=7bit, 0=8bit) +#define UART_MSR_RSVD0 0x0002 // Reserved +#define UART_MSR_SBLD 0x0004 // Stop bit length select (1=2bits, 0=1bit) +#define UART_MSR_PSB 0x0008 // Parity select bit (1=odd, 0=even) +#define UART_MSR_PEB 0x0010 // Parity enable bit (1=enable, 0=disable) +#define UART_MSR_TFTIE 0x4000 // Transmission FIFO trigger interrupt enable +#define UART_MSR_RFTIE 0x8000 // Reception FIFO trigger interrupt enable +#define UART_MSR_INTS 0xfc00 // All interrupt bits +#define UART_MSR_MODE_BITS 0x001f // data length, stop & parity + +#define UART_SR_TREF 0x0001 // Transmission register empty flag +#define UART_SR_TFEF 0x0002 // Transmission FIFO empty flag +#define UART_SR_RFNEF 0x0004 // Reception FIFO not empty flag +#define UART_SR_RSVD0 0x00f8 // Reserved +#define UART_SR_TOIF 0x0100 // Time out interrupt flag +#define UART_SR_RFER 0x0200 // Reception FIFO error flag +#define UART_SR_TFTI 0x0400 // Transmission FIFO trigger indicator +#define UART_SR_RFTI 0x0800 // Reception FIFO trigger indicator +#define UART_SR_RSVD1 0xf000 // Reserved + +#define UART_LCR_BOC 0x0100 // Break output control (1=send break) + +#define UART_FCR_FTL1 0x0000 /* FIFO trigger level 1 byte */ +#define UART_FCR_FTL4 0x0100 /* FIFO trigger level 4 bytes */ +#define UART_FCR_FTL8 0x0200 /* FIFO trigger level 8 bytes */ +#define UART_FCR_FTL16 0x0300 /* FIFO trigger level 16 bytes */ +#define UART_FCR_FTL24 0x0400 /* FIFO trigger level 24 bytes */ +#define UART_FCR_FTL32 0x0500 /* FIFO trigger level 32 bytes */ + +struct swarm_async_struct { + int magic; + unsigned long port; + int flags; + int xmit_fifo_size; + struct serial_state *state; + struct tty_struct *tty; + int timeout; + int quot; + int x_char; /* xon/xoff character */ + int close_delay; + unsigned short closing_wait; + unsigned short closing_wait2; + u16 MSR; /* Interrupt Enable Register */ + u16 LCR; /* Line control register */ + u16 RFCR; + u16 TFCR; + unsigned long event; + unsigned long last_active; + int line; + int blocked_open; /* # of blocked opens */ + long session; /* Session of opening process */ + long pgrp; /* pgrp of opening process */ + struct circ_buf xmit; + spinlock_t xmit_lock; + u8 *iomem_base; + u16 iomem_reg_shift; + int io_type; + struct tq_struct tqueue; +#ifdef DECLARE_WAITQUEUE + wait_queue_head_t open_wait; + wait_queue_head_t close_wait; + wait_queue_head_t delta_msr_wait; +#else + struct wait_queue *open_wait; + struct wait_queue *close_wait; + struct wait_queue *delta_msr_wait; +#endif + struct dsc21_async_struct *next_port; + struct dsc21_async_struct *prev_port; + +}; + + +#endif diff -Naur linux-2.4.4-uClinux/include/asm-armnommu/arch-swarm/system.h linux-2.4.4-uClinux-hankvc/include/asm-armnommu/arch-swarm/system.h --- linux-2.4.4-uClinux/include/asm-armnommu/arch-swarm/system.h Thu Jan 1 05:30:00 1970 +++ linux-2.4.4-uClinux-hankvc/include/asm-armnommu/arch-swarm/system.h Tue Sep 25 01:19:09 2001 @@ -0,0 +1,16 @@ +/* + * system.h + * + * 9 Sep 2001 - C Hanish Menon [www.hanishkvc.com] + * + */ + +static inline void arch_idle(void) +{ + while (!current->need_resched && !hlt_counter); +} + +extern __inline__ void arch_reset(char mode) +{ + return; +} diff -Naur linux-2.4.4-uClinux/include/asm-armnommu/arch-swarm/time.h linux-2.4.4-uClinux-hankvc/include/asm-armnommu/arch-swarm/time.h --- linux-2.4.4-uClinux/include/asm-armnommu/arch-swarm/time.h Thu Jan 1 05:30:00 1970 +++ linux-2.4.4-uClinux-hankvc/include/asm-armnommu/arch-swarm/time.h Tue Sep 25 01:26:59 2001 @@ -0,0 +1,59 @@ +/* + * linux/include/asm-arm/arch-swarm/time.h + * + * Copyright (C) 1998 Deborah Wallach. + * Twiddles (C) 1999 Hugo Fiennes + * + * 2000/03/29 (C) Nicolas Pitre + * Rewritten: big cleanup, much simpler, better HZ acuracy. + * + * 2001/02/20 (C) RidgeRun, Inc (http://www.ridgerun.com) + * Leveraged for the dsc21 + * 09 Sep 2001 - C Hanish Menon [www.hanishkvc.com] + * - Leveraged for SWARM + * + */ +#ifndef __ASM_ARCH_TIME_H__ +#define __ASM_ARCH_TIME_H__ + +#include +#include +#include + +static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +{ + int TimerCnt, IntPending; + + //printk("DebugKVC: In timer_interrupt \n"); + do_timer(regs); + do_set_rtc(); + do_profile(regs); + + TimerCnt = inl(SWARM_TIMER_CNT); + TimerCnt += SWARM_TIMER_SYS_COUNT; + outl(TimerCnt, SWARM_TIMER_MATCH0); + IntPending = inl(SWARM_INT_IRQ_STATUS); + outl(IntPending & ~(0x1 << SWARM_IRQ_TIMER0), SWARM_INT_IRQ_STATUS); /* clear System timer interrupt */ + //printk("DebugKVC: Leaving timer_interrupt \n"); +} + +/* + * Set up timer interrupt. + */ +extern __inline__ void setup_timer(void) +{ + int TimerCnt, IntMask; + + //printk("DebugKVC: In setup_timer \n"); + timer_irq.handler = timer_interrupt; + setup_arm_irq(IRQ_TIMER, &timer_irq); + TimerCnt = inl(SWARM_TIMER_CNT); + TimerCnt += SWARM_TIMER_SYS_COUNT; + outl(TimerCnt, SWARM_TIMER_MATCH0); + outl(0x1, SWARM_TIMER_INTEN); /* enable interrupt mode */ + IntMask = inl(SWARM_INT_MASK); + outl(IntMask | (0x1 << SWARM_IRQ_TIMER0), SWARM_INT_MASK); /* enable System timer interrupt */ +} + + +#endif /* __ASM_ARCH_TIME_H__ */ diff -Naur linux-2.4.4-uClinux/include/asm-armnommu/arch-swarm/timex.h linux-2.4.4-uClinux-hankvc/include/asm-armnommu/arch-swarm/timex.h --- linux-2.4.4-uClinux/include/asm-armnommu/arch-swarm/timex.h Thu Jan 1 05:30:00 1970 +++ linux-2.4.4-uClinux-hankvc/include/asm-armnommu/arch-swarm/timex.h Tue Sep 25 01:20:24 2001 @@ -0,0 +1,39 @@ +/* + * timex.h: + * System clock frequency. + * 09 Sep 2001 - C Hanish Menon [www.hanishkvc.com] + * - Copied and Updated to support armnommu/swarm + * + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ +#ifndef __ASM_ARCH_TIMEX_H__ +#define __ASM_ARCH_TIMEX_H__ + +/* + * CLOCK_TICK_RATE -- frequency fed to the timer. In our case, 27MHz. Used to + * compute LATCH. LATCH is the number of clock ticks per timer interrupt. + * (See linux/timex.h, armnommu/mach-dsc21/time.c). + */ +#define CLOCK_TICK_RATE 20 + +#endif /* __ASM_ARCH_TIMEX_H__ */ diff -Naur linux-2.4.4-uClinux/include/asm-armnommu/arch-swarm/vmalloc.h linux-2.4.4-uClinux-hankvc/include/asm-armnommu/arch-swarm/vmalloc.h --- linux-2.4.4-uClinux/include/asm-armnommu/arch-swarm/vmalloc.h Thu Jan 1 05:30:00 1970 +++ linux-2.4.4-uClinux-hankvc/include/asm-armnommu/arch-swarm/vmalloc.h Tue Sep 25 01:22:28 2001 @@ -0,0 +1,35 @@ +/* + * linux/include/asm-arm/arch-swarm/vmalloc.h + * + * Copyright (C) 2000 Russell King. + * 09 Sep 2001 - C Hanish Menon [www.hanishkvc.com] + * - Just copied in for armnommu/swarm + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* + * Just any arbitrary offset to the start of the vmalloc VM area: the + * current 8MB value just means that there will be a 8MB "hole" after the + * physical memory until the kernel virtual memory starts. That means that + * any out-of-bounds memory accesses will hopefully be caught. + * The vmalloc() routines leaves a hole of 4kB between each vmalloced + * area for the same reason. ;) + */ +#define VMALLOC_OFFSET (10*1024*1024) +#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) +#define VMALLOC_VMADDR(x) ((unsigned long)(x)) +#define VMALLOC_END (PAGE_OFFSET + 0x10000000) + diff -Naur linux-2.4.4-uClinux/include/asm-armnommu/memory.h linux-2.4.4-uClinux-hankvc/include/asm-armnommu/memory.h --- linux-2.4.4-uClinux/include/asm-armnommu/memory.h Sat Sep 8 19:54:10 2001 +++ linux-2.4.4-uClinux-hankvc/include/asm-armnommu/memory.h Tue Sep 25 01:25:24 2001 @@ -27,24 +27,6 @@ #define virt_to_phys(x) x #define phys_to_virt(x) x -/* - * For some reason other asm/.h files refer to these instead of the more - * public macros above. - * --gmcnutt - */ -#define __virt_to_bus(x) x -#define __bus_to_virt(x) x -#define __virt_to_phys(x) x -#define __phys_to_virt(x) x - - -/* - * arch/armnommu/kernel/armksyms.c needs these. - * --gmcnutt - */ -#define __virt_to_phys__is_a_macro -#define __phys_to_virt__is_a_macro -#define __virt_to_bus__is_a_macro -#define __bus_to_virt__is_a_macro +/* Moved the __macros to asm/arch/memory.h -- HanishKVC */ #endif diff -Naur linux-2.4.4-uClinux/include/asm-armnommu/proc-fns.h linux-2.4.4-uClinux-hankvc/include/asm-armnommu/proc-fns.h --- linux-2.4.4-uClinux/include/asm-armnommu/proc-fns.h Sat Sep 8 19:54:10 2001 +++ linux-2.4.4-uClinux-hankvc/include/asm-armnommu/proc-fns.h Tue Sep 25 01:25:24 2001 @@ -36,6 +36,14 @@ # define CPU_NAME arm6 # endif # endif +# ifdef CONFIG_CPU_ARM7V3 +# ifdef CPU_NAME +# undef MULTI_CPU +# define MULTI_CPU +# else +# define CPU_NAME arm7 +# endif +# endif # ifdef CONFIG_CPU_ARM710 # ifdef CPU_NAME # undef MULTI_CPU diff -Naur linux-2.4.4-uClinux/include/asm-armnommu/semaphore.h linux-2.4.4-uClinux-hankvc/include/asm-armnommu/semaphore.h --- linux-2.4.4-uClinux/include/asm-armnommu/semaphore.h Sat Sep 8 19:54:10 2001 +++ linux-2.4.4-uClinux-hankvc/include/asm-armnommu/semaphore.h Tue Sep 25 01:25:24 2001 @@ -142,6 +142,21 @@ */ struct rw_semaphore { atomic_t count; +/* HanishKVC - 5 Sep 2001 +* Picked up from i386 rwsem implementation. +* Haven't verified properly, but should be ok +* has in generic parts of Linux kernel when RWSEM is +* initialized with out a Count specified, its set +* to RWSEM_UNLOCKED_VALUE. +* A new RWSEM_INITIALIZER has been defined to provide +* support for Count specification +* */ +#define RWSEM_UNLOCKED_VALUE 0x00000000 +#define RWSEM_ACTIVE_BIAS 0x00000001 +#define RWSEM_ACTIVE_MASK 0x0000ffff +#define RWSEM_WAITING_BIAS (-0x00010000) +#define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS +#define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) volatile unsigned char write_bias_granted; volatile unsigned char read_bias_granted; volatile unsigned char pad1; @@ -161,13 +176,18 @@ #define __RWSEM_DEBUG_INIT /* */ #endif -#define __RWSEM_INITIALIZER(name,count) \ -{ ATOMIC_INIT(count), 0, 0, 0, 0, __WAIT_QUEUE_HEAD_INITIALIZER((name).wait), \ +#define __RWSEM_INITIALIZER(name) \ +{ ATOMIC_INIT(RWSEM_UNLOCKED_VALUE), 0, 0, 0, 0, __WAIT_QUEUE_HEAD_INITIALIZER((name).wait), \ __WAIT_QUEUE_HEAD_INITIALIZER((name).write_bias_wait) \ __SEM_DEBUG_INIT(name) __RWSEM_DEBUG_INIT } +#define __RWSEM_INITIALIZER_WITH_COUNT(name,count) \ +{ ATOMIC_INIT(count), 0, 0, 0, 0, __WAIT_QUEUE_HEAD_INITIALIZER((name).wait), \ + __WAIT_QUEUE_HEAD_INITIALIZER((name).write_bias_wait) \ + __SEM_DEBUG_INIT(name) __RWSEM_DEBUG_INIT } + #define __DECLARE_RWSEM_GENERIC(name,count) \ - struct rw_semaphore name = __RWSEM_INITIALIZER(name,count) + struct rw_semaphore name = __RWSEM_INITIALIZER_WITH_COUNT(name,count) #define DECLARE_RWSEM(name) __DECLARE_RWSEM_GENERIC(name,RW_LOCK_BIAS) #define DECLARE_RWSEM_READ_LOCKED(name) __DECLARE_RWSEM_GENERIC(name,RW_LOCK_BIAS-1) diff -Naur linux-2.4.4-uClinux/include/asm-armnommu/socket.h linux-2.4.4-uClinux-hankvc/include/asm-armnommu/socket.h --- linux-2.4.4-uClinux/include/asm-armnommu/socket.h Sat Sep 8 19:54:10 2001 +++ linux-2.4.4-uClinux-hankvc/include/asm-armnommu/socket.h Sun Sep 9 15:44:35 2001 @@ -43,6 +43,8 @@ #define SO_TIMESTAMP 29 #define SCM_TIMESTAMP SO_TIMESTAMP +#define SO_ACCEPTCONN 30 + /* Nast libc5 fixup - bletch */ #if defined(__KERNEL__) /* Socket types. */ diff -Naur linux-2.4.4-uClinux/include/asm-armnommu/unistd.h linux-2.4.4-uClinux-hankvc/include/asm-armnommu/unistd.h --- linux-2.4.4-uClinux/include/asm-armnommu/unistd.h Sat Sep 8 19:54:10 2001 +++ linux-2.4.4-uClinux-hankvc/include/asm-armnommu/unistd.h Mon Sep 24 19:59:51 2001 @@ -1,6 +1,11 @@ #ifndef __ASM_ARM_UNISTD_H #define __ASM_ARM_UNISTD_H +/* + * #ifdef CONFIG_ARCH_SWARM + * #define __NR_SYSCALL_BASE 0x700000 + * #else + */ #define __NR_SYSCALL_BASE 0x900000 /* @@ -400,7 +405,7 @@ static inline pid_t waitpid(pid_t pid, int *wait_stat, int options) { - extern long sys_wait4(int, int *, int, struct rusage *); + extern long sys_wait4(pid_t, unsigned int *, int, struct rusage *); return sys_wait4((int)pid, wait_stat, options, NULL); } @@ -412,7 +417,7 @@ static inline pid_t wait(int * wait_stat) { - extern long sys_wait4(int, int *, int, struct rusage *); + extern long sys_wait4(pid_t, unsigned int *, int, struct rusage *); return sys_wait4(-1, wait_stat, 0, NULL); } diff -Naur linux-2.4.4-uClinux/include/linux/mm.h linux-2.4.4-uClinux-hankvc/include/linux/mm.h --- linux-2.4.4-uClinux/include/linux/mm.h Sat Sep 8 19:54:11 2001 +++ linux-2.4.4-uClinux-hankvc/include/linux/mm.h Tue Sep 25 01:25:29 2001 @@ -416,7 +416,9 @@ extern void vmtruncate(struct inode * inode, loff_t offset); extern pmd_t *FASTCALL(__pmd_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address)); +#ifndef CONFIG_UCLINUX extern pte_t *FASTCALL(pte_alloc(struct mm_struct *mm, pmd_t *pmd, unsigned long address)); +#endif extern int handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma, unsigned long address, int write_access); extern int make_pages_present(unsigned long addr, unsigned long end); extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); diff -Naur linux-2.4.4-uClinux/init/main.c linux-2.4.4-uClinux-hankvc/init/main.c --- linux-2.4.4-uClinux/init/main.c Sat Sep 8 19:40:52 2001 +++ linux-2.4.4-uClinux-hankvc/init/main.c Mon Sep 24 17:31:15 2001 @@ -523,6 +523,7 @@ setup_arch(&command_line); printk("Kernel command line: %s\n", saved_command_line); parse_options(command_line); + printk("Cmdline parsed\n"); trap_init(); init_IRQ(); sched_init(); @@ -567,8 +568,11 @@ mempages = num_physpages; fork_init(mempages); + printk("fork_init just finished\n"); proc_caches_init(); + printk("proc_caches_init just finished\n"); vfs_caches_init(mempages); + printk("vfs_caches_init just finished\n"); buffer_init(mempages); page_cache_init(mempages); #if defined(CONFIG_ARCH_S390) diff -Naur linux-2.4.4-uClinux/ipc/shm.c linux-2.4.4-uClinux-hankvc/ipc/shm.c --- linux-2.4.4-uClinux/ipc/shm.c Sat Sep 8 19:40:10 2001 +++ linux-2.4.4-uClinux-hankvc/ipc/shm.c Sun Sep 9 17:18:08 2001 @@ -13,6 +13,8 @@ * Shared /dev/zero support, Kanoj Sarcar * Move the mm functionality over to mm/shmem.c, Christoph Rohland * + * 9 Sep 2001 - HanishKVC - temporary removal of certain part of code + * */ #include @@ -109,7 +111,9 @@ /* This is called by fork, once for every shm attach. */ static void shm_open (struct vm_area_struct *shmd) { +#ifndef NO_MM shm_inc (shmd->vm_file->f_dentry->d_inode->i_ino); +#endif } /* @@ -136,6 +140,7 @@ */ static void shm_close (struct vm_area_struct *shmd) { +#ifndef NO_MM struct file * file = shmd->vm_file; int id = file->f_dentry->d_inode->i_ino; struct shmid_kernel *shp; @@ -153,6 +158,7 @@ shm_unlock(id); up (&shm_ids.sem); +#endif } static int shm_mmap(struct file * file, struct vm_area_struct * vma) diff -Naur linux-2.4.4-uClinux/kernel/printk.c linux-2.4.4-uClinux-hankvc/kernel/printk.c --- linux-2.4.4-uClinux/kernel/printk.c Sat Sep 8 19:54:11 2001 +++ linux-2.4.4-uClinux-hankvc/kernel/printk.c Mon Sep 10 19:39:36 2001 @@ -326,6 +326,7 @@ if (line_feed) msg_level = -1; } + debug_uart_c_nommu_string(buf); spin_unlock_irqrestore(&console_lock, flags); wake_up_interruptible(&log_wait); return i; diff -Naur linux-2.4.4-uClinux/lib/Makefile linux-2.4.4-uClinux-hankvc/lib/Makefile --- linux-2.4.4-uClinux/lib/Makefile Sat Sep 8 19:40:53 2001 +++ linux-2.4.4-uClinux-hankvc/lib/Makefile Mon Sep 10 19:26:47 2001 @@ -10,7 +10,7 @@ export-objs := cmdline.o rwsem-spinlock.o rwsem.o -obj-y := errno.o ctype.o string.o vsprintf.o brlock.o cmdline.o +obj-y := errno.o ctype.o string.o vsprintf.o brlock.o cmdline.o debug_uart.o obj-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o obj-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o diff -Naur linux-2.4.4-uClinux/lib/debug_uart.c linux-2.4.4-uClinux-hankvc/lib/debug_uart.c --- linux-2.4.4-uClinux/lib/debug_uart.c Thu Jan 1 05:30:00 1970 +++ linux-2.4.4-uClinux-hankvc/lib/debug_uart.c Sun Sep 23 19:59:42 2001 @@ -0,0 +1,26 @@ +/* + * debug_uart.c - the debug print routines to be used from C files + * 10 Sep 2001, C Hanish Menon [www.hanishkvc.com] + */ + +#include + +void debug_uart_c_nommu(char ch) +{ + char* UartBase = SWARM_UART0_BASE; + + *UartBase = ch; + return; +} + +void debug_uart_c_nommu_string(char *str) +{ + char* UartBase = SWARM_UART0_BASE; + + while(*str) + { + *UartBase = *str++; + if(*str == '\n') + *UartBase = '\r'; + } +}