From: Andy P. <at...@us...> - 2002-04-10 18:40:06
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/arm/boot/compressed In directory usw-pr-cvs1:/tmp/cvs-serv24336/arm/boot/compressed Modified Files: Makefile head-sa1100.S head-shark.S head.S ll_char_wr.S misc.c ofw-shark.c vmlinux.lds.in Added Files: head-clps7500.S head-integrator.S Removed Files: setup-sa1100.S Log Message: synch 2.4.15 commit 32 --- NEW FILE --- /* * linux/arch/arm/boot/compressed/head.S * * Copyright (C) 1999, 2000, 2001 Nexus Electronics Ltd */ #include <linux/config.h> /* There are three different ways the kernel can be booted on a 7500 system: from Angel (loaded in RAM), from 16-bit ROM or from 32-bit Flash. Luckily, a single kernel image does for them all. */ /* This branch is taken if the CPU memory width matches the actual device in use. The default at power on is 16 bits so we must be prepared for a mismatch. */ .section ".start", #alloc, #execinstr 2: b 1f .word 0xffff .word 0xb632 @ mov r11, #0x03200000 .word 0xe3a0 .word 0x0000 @ mov r0, #0 .word 0xe3a0 .word 0x0080 @ strb r0, [r11, #0x80] .word 0xe5cb .word 0xf000 @ mov pc, #0 .word 0xe3a0 1: adr r1, 2b teq r1, #0 bne .Langel /* This is a direct-from-ROM boot. Copy the kernel into RAM and run it there. */ mov r0, #0x30 mcr p15, 0, r0, c1, c0, 0 mov r0, #0x13 msr cpsr, r0 mov r12, #0x03000000 @ point to LEDs orr r12, r12, #0x00020000 orr r12, r12, #0xba00 mov r0, #0x5500 str r0, [r12] mov r0, #0x10000000 orr r0, r0, #0x8000 mov r4, r0 ldr r2, =_end 2: ldr r3, [r1], #4 str r3, [r0], #4 teq r0, r2 bne 2b mov r0, #0xff00 str r0, [r12] 1: mov r12, #0x03000000 @ point to LEDs orr r12, r12, #0x00020000 orr r12, r12, #0xba00 mov r0, #0xfe00 str r0, [r12] adr lr, 1f mov r0, #0 mov r1, #14 /* MACH_TYPE_CLPS7500 */ mov pc, lr .Langel: #ifdef CONFIG_ANGELBOOT /* Call Angel to switch into SVC mode. */ mov r0, #0x17 swi 0x123456 #endif /* Ensure all interrupts are off and MMU disabled */ mrs r0, cpsr orr r0, r0, #0xc0 msr cpsr, r0 adr lr, 1b orr lr, lr, #0x10000000 mov r0, #0x30 @ MMU off mcr p15, 0, r0, c1, c0, 0 mov r0, r0 mov pc, lr .ltorg 1: /* And the rest */ #include "head.S" --- NEW FILE --- #include <asm/mach-types.h> .section ".start", #alloc, #execinstr mov r7, #MACH_TYPE_INTEGRATOR Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/boot/compressed/Makefile,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- Makefile 25 Feb 2001 23:15:20 -0000 1.1.1.2 +++ Makefile 10 Apr 2002 13:51:20 -0000 1.2 @@ -9,7 +9,7 @@ HEAD = head.o OBJS = misc.o -CFLAGS = $(CPPFLAGS) -O2 -DSTDC_HEADERS $(CFLAGS_PROC) +CFLAGS = $(CPPFLAGS) -O2 -DSTDC_HEADERS $(CFLAGS_PROC) -msoft-float FONTC = $(TOPDIR)/drivers/video/font_acorn_8x8.c ZLDFLAGS = -p -X -T vmlinux.lds @@ -25,25 +25,33 @@ OBJS += head-netwinder.o endif +ifeq ($(CONFIG_ARCH_SHARK),y) +OBJS += head-shark.o ofw-shark.o +endif + ifeq ($(CONFIG_ARCH_INTEGRATOR),y) -OBJS += head-netwinder.o +OBJS += head-integrator.o endif -ifeq ($(CONFIG_ARCH_NEXUSPCI),y) -HEAD = head-nexuspci.o +ifeq ($(CONFIG_ARCH_FTVPCI),y) +OBJS += head-ftvpci.o endif ifeq ($(CONFIG_ARCH_L7200),y) OBJS += head-l7200.o endif +ifeq ($(CONFIG_ARCH_CLPS7500),y) +HEAD = head-clps7500.o +endif + ifeq ($(CONFIG_ARCH_P720T),y) # Borrow this code from SA1100 OBJS += head-sa1100.o endif ifeq ($(CONFIG_ARCH_SA1100),y) -OBJS += head-sa1100.o setup-sa1100.o +OBJS += head-sa1100.o ifeq ($(CONFIG_SA1100_NANOENGINE),y) OBJS += hw-bse.o endif @@ -56,6 +64,8 @@ else SEDFLAGS += s/BSS_START/ALIGN(4)/ endif + +LIBGCC := $(shell $(CC) $(CFLAGS) --print-libgcc-file-name) all: vmlinux Index: head-sa1100.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/boot/compressed/head-sa1100.S,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- head-sa1100.S 25 Feb 2001 23:15:20 -0000 1.1.1.2 +++ head-sa1100.S 10 Apr 2002 13:51:20 -0000 1.2 @@ -17,6 +17,24 @@ @ Preserve r8/r7 i.e. kernel entry values +#if defined(CONFIG_SA1100_GRAPHICSCLIENT) && !defined(CONFIG_ANGELBOOT) + mov r7, #MACH_TYPE_GRAPHICSCLIENT + mov r8, #0 +#endif +#if defined(CONFIG_SA1100_GRAPHICSMASTER) && !defined(CONFIG_ANGELBOOT) + mov r7, #MACH_TYPE_GRAPHICSMASTER + mov r8, #0 +#endif +#if defined(CONFIG_SA1100_ADSBITSY) && !defined(CONFIG_ANGELBOOT) + mov r7, #MACH_TYPE_ADSBITSY + mov r8, #0 +#endif + +#ifdef CONFIG_SA1100_PFS168 + @ REVISIT_PFS168: Temporary until firmware updated to use assigned machine number + mov r7, #MACH_TYPE_PFS168 +#endif + #ifdef CONFIG_SA1100_VICTOR teq r7, #MACH_TYPE_VICTOR bne 10f @@ -51,7 +69,6 @@ bic r0, r0, #0x1000 @ clear Icache mcr p15, 0, r0, c1, c0, 0 -#ifdef CONFIG_ANGELBOOT /* * Pause for a short time so that we give enough time * for the host to start a terminal up. @@ -59,5 +76,4 @@ mov r0, #0x00200000 1: subs r0, r0, #1 bne 1b -#endif Index: head-shark.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/boot/compressed/head-shark.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- head-shark.S 25 Feb 2001 23:15:20 -0000 1.1.1.1 +++ head-shark.S 10 Apr 2002 13:51:20 -0000 1.2 @@ -1,5 +1,5 @@ /* The head-file for the Shark - * by Ale...@st... + * by Alexander Schulz <as...@ne...> * * Does the following: * - get the memory layout from firmware. This can only be done as long as the mmu @@ -20,8 +20,6 @@ b __beginning -__serial_addr: .long 0xf7eff3f8 - .long 0 @ space __ofw_data: .long 0 @ the number of memory blocks .space 128 @ (startaddr,size) ... .space 128 @ bootargs @@ -31,14 +29,10 @@ mov r0, #0xC0 @ disable irq and fiq mov r1, r0 - mrs r3, cpsr_all + mrs r3, cpsr bic r2, r3, r0 eor r2, r2, r1 - msr cpsr_all, r2 - - ldr r0, __serial_addr @ disable serial interrupt - mov r1, #0 @ hangs the machine, I don t know why. - strb r1, [r0, #0x01] + msr cpsr_c, r2 mov r0, r4 @ get the Memory layout from firmware adr r1, __ofw_data Index: head.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/boot/compressed/head.S,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- head.S 25 Feb 2001 23:15:20 -0000 1.1.1.2 +++ head.S 10 Apr 2002 13:51:20 -0000 1.2 @@ -12,7 +12,39 @@ /* * Debugging stuff + * + * Note that these macros must not contain any code which is not + * 100% relocatable. Any attempt to do so will result in a crash. + * Please select one of the following when turning on debugging. */ +#ifdef DEBUG +#if 0 /* DC21285-type */ + .macro loadsp, rb + mov \rb, #0x7c000000 + .endm + .macro writeb, rb + strb \rb, [r3, #0x3f8] + .endm +#elif 0 /* RiscPC-type */ + .macro loadsp, rb + mov \rb, #0x03000000 + orr \rb, \rb, #0x00010000 + .endm + .macro writeb, rb + strb \rb, [r3, #0x3f8 << 2] + .endm +#elif 0 /* integrator-type */ + .macro loadsp, rb + mov \rb, #0x16000000 + .endm + .macro writeb, rb + strb \rb, [r3, #0] + .endm +#else +#error no serial architecture defined +#endif +#endif + .macro kputc,val mov r0, \val bl putc @@ -27,53 +59,31 @@ .macro debug_reloc_start #ifdef DEBUG kputc #'\n' - kphex r6, 8 + kphex r6, 8 /* processor id */ kputc #':' - kphex r5, 8 + kphex r7, 8 /* architecture id */ + kputc #':' + mrc p15, 0, r0, c1, c0 + kphex r0, 8 /* control reg + kputc #'\n' + kphex r5, 8 /* decompressed kernel start */ kputc #'-' - kphex r8, 8 + kphex r8, 8 /* decompressed kernel end */ kputc #'>' - kphex r4, 8 + kphex r4, 8 /* kernel execution address */ kputc #'\n' #endif .endm .macro debug_reloc_end #ifdef DEBUG - mov r8, r0 - kphex r5, 8 - kputc #'-' - kphex r8, 8 + kphex r5, 8 /* end of kernel */ kputc #'\n' mov r0, r4 - bl memdump + bl memdump /* dump 256 bytes at start of kernel */ #endif .endm -/* - * Note that these macros must not contain any code which is not - * 100% relocatable. Any attempt to do so will result in a crash. - */ -#if 0 - .macro loadsp, rb - mov \rb, #0x7c000000 - .endm - - .macro writeb, rb - strb \rb, [r3, #0x3f8] - .endm -#else - .macro loadsp, rb - mov \rb, #0x03000000 - orr \rb, \rb, #0x00010000 - .endm - - .macro writeb, rb - strb \rb, [r3, #0x3f8 << 2] - .endm -#endif - - .section ".start", #alloc, #execinstr /* * sort out different calling conventions @@ -87,25 +97,35 @@ b 1f .word 0x016f2818 @ Magic numbers to help the loader - .word start + .word start @ absolute load/run zImage address + .word _edata @ zImage end address 1: mov r7, r1 @ save architecture ID mov r8, #0 @ save r0 -#ifdef CONFIG_ANGELBOOT + +#ifndef __ARM_ARCH_2__ /* * Booting from Angel - need to enter SVC mode and disable - * FIQs/IRQs (numeric definitions from angel arm.h source) + * FIQs/IRQs (numeric definitions from angel arm.h source). + * We only do this if we were in user mode on entry. */ + mrs r2, cpsr @ get current mode + tst r2, #3 @ not user? + bne not_angel mov r0, #0x17 @ angel_SWIreason_EnterSVC swi 0x123456 @ angel_SWI_ARM - mrs r0, cpsr @ turn off interrupts to - orr r0, r0, #0xc0 @ prevent angel from running - msr cpsr_c, r0 +not_angel: + mrs r2, cpsr @ turn off interrupts to + orr r2, r2, #0xc0 @ prevent angel from running + msr cpsr_c, r2 +#else + teqp pc, #0x0c000003 @ turn off interrupts +#endif /* * Note that some cache flushing and other stuff may * be needed here - is there an Angel SWI call for this? */ -#endif + /* * some architecture specific code can be inserted * by the linker here, but it should preserve r7 and r8. @@ -210,7 +230,7 @@ mov r0, r3 mov r8, r0, lsr #18 mov r8, r8, lsl #18 @ start of RAM - add r9, r8, #0x20000000 @ the maximum RAM size + add r9, r8, #0x10000000 @ a reasonable RAM size mov r1, #0x12 orr r1, r1, #3 << 10 add r2, r3, #16384 @@ -299,30 +319,46 @@ .size proc_sa1110_type, . - proc_sa1110_type /* - * Turn off StrongARM cache and MMU. It is safe to - * leave the I-cache on. + * Turn off the Cache and MMU. ARMv3 does not support + * reading the control register, but ARMv4 does. * - * On entry, - * r6 = processor ID - * On exit, - * r0, r1 corrupted - * This routine must preserve: - * r4, r6, r7 + * On entry, r6 = processor ID + * On exit, r0, r1 corrupted + * This routine must preserve: r4, r6, r7 */ .align 5 -cache_off: ldr r1, proc_sa110_type - eor r1, r1, r6 - movs r1, r1, lsr #5 @ catch SA110 and SA1100 - beq 1f - ldr r1, proc_sa1110_type - eor r1, r1, r6 - movs r1, r1, lsr #4 - movne pc, lr -1: +cache_off: +#ifdef CONFIG_CPU_ARM610 + eor r1, r6, #0x41000000 + eor r1, r1, #0x00560000 + bic r1, r1, #0x0000001f + teq r1, #0x00000600 + mov r0, #0x00000060 @ ARM6 control reg. + beq __armv3_cache_off +#endif +#ifdef CONFIG_CPU_ARM710 + eor r1, r6, #0x41000000 + bic r1, r1, #0x00070000 + bic r1, r1, #0x000000ff + teq r1, #0x00007000 @ ARM7 + teqne r1, #0x00007100 @ ARM710 + mov r0, #0x00000070 @ ARM7 control reg. + beq __armv3_cache_off +#endif mrc p15, 0, r0, c1, c0 bic r0, r0, #0x000d - mcr p15, 0, r0, c1, c0 - mov pc, lr + mcr p15, 0, r0, c1, c0 @ turn MMU and cache off + mov r0, #0 + mcr p15, 0, r0, c7, c7 @ invalidate whole cache v4 + mcr p15, 0, r0, c8, c7 @ invalidate whole TLB v4 + mov pc, lr + +__armv3_cache_off: + mcr p15, 0, r0, c1, c0 @ turn MMU and cache off + mov r0, #0 + mcr p15, 0, r0, c7, c0 @ invalidate whole cache v3 + mcr p15, 0, r0, c5, c0 @ invalidate whole TLB v3 + mov pc, lr /* * Clean and flush the cache to maintain consistency. @@ -400,13 +436,10 @@ memdump: mov r12, r0 mov r10, lr - mov r1, #8 - bl phex - mov r0, #'\n' - bl putc mov r11, #0 2: mov r0, r11, lsl #2 - mov r1, #4 + add r0, r0, r12 + mov r1, #8 bl phex mov r0, #':' bl putc Index: ll_char_wr.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/boot/compressed/ll_char_wr.S,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ll_char_wr.S 14 Jan 2001 19:45:53 -0000 1.1.1.1 +++ ll_char_wr.S 10 Apr 2002 13:51:20 -0000 1.2 @@ -16,7 +16,7 @@ @ Regs: [] = corruptible @ {} = used @ () = do not use -#define __ASSEMBLY__ + #include <linux/linkage.h> #include <asm/assembler.h> .text Index: misc.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/boot/compressed/misc.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- misc.c 14 Jan 2001 19:45:53 -0000 1.1.1.1 +++ misc.c 10 Apr 2002 13:51:20 -0000 1.2 @@ -73,7 +73,7 @@ *u.ucp++ = 0; } -extern __inline__ __ptr_t memcpy(__ptr_t __dest, __const __ptr_t __src, +static inline __ptr_t memcpy(__ptr_t __dest, __const __ptr_t __src, size_t __n) { int i = 0; Index: ofw-shark.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/boot/compressed/ofw-shark.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ofw-shark.c 25 Feb 2001 23:15:20 -0000 1.1.1.1 +++ ofw-shark.c 10 Apr 2002 13:51:20 -0000 1.2 @@ -1,7 +1,7 @@ /* * linux/arch/arm/boot/compressed/ofw-shark.c * - * by Ale...@st... + * by Alexander Schulz <as...@ne...> * * This file is used to get some basic information * about the memory layout of the shark we are running @@ -11,6 +11,7 @@ #include <linux/kernel.h> +#include <linux/types.h> #include <asm/setup.h> #include <asm/page.h> @@ -18,15 +19,21 @@ asmlinkage void create_params (unsigned long *buffer) { - /* Is there a better address? Also change in kernel/arch.c */ - struct param_struct *params = (struct param_struct *) 0x08003000; + /* Is there a better address? Also change in mach-shark/arch.c */ + struct tag *tag = (struct tag *) 0x08003000; int j,i,m,k,nr_banks,size; + unsigned char *c; - for (j=0;j<256;j++) params->u1.unused[j]=0; + /* Head of the taglist */ + tag->hdr.tag = ATAG_CORE; + tag->hdr.size = tag_size(tag_core); + tag->u.core.flags = FLAG_READONLY; + tag->u.core.pagesize = PAGE_SIZE; + tag->u.core.rootdev = 0; + /* Build up one tagged block for each memory region */ size=0; nr_banks=(unsigned int) buffer[0]; - if (nr_banks > NR_BANKS) nr_banks = NR_BANKS; for (j=0;j<nr_banks;j++){ /* search the lowest address and put it into the next entry */ /* not a fast sort algorithm, but there are at most 8 entries */ @@ -39,23 +46,38 @@ } } - /* using pages_in_bank for startaddress and size */ - /* start is in bytes, size in pages and not bigger than 0x2000 */ - /* This is decoded in fixup_shark in arch/arm/kernel/arch.c */ - params->u1.s.pages_in_bank[j]=buffer[2*k+1]|(buffer[2*k+2]/PAGE_SIZE); + tag = tag_next(tag); + tag->hdr.tag = ATAG_MEM; + tag->hdr.size = tag_size(tag_mem32); + tag->u.mem.size = buffer[2*k+2]; + tag->u.mem.start = buffer[2*k+1]; + size += buffer[2*k+2]; - buffer[2*k+1]=0xffffffff; /* mark as copied */ + buffer[2*k+1]=0xffffffff; /* mark as copied */ } - params->u1.s.page_size = PAGE_SIZE; - params->u1.s.nr_pages = size/PAGE_SIZE; - params->u1.s.flags = FLAG_READONLY; + /* The command line */ + tag = tag_next(tag); + tag->hdr.tag = ATAG_CMDLINE; - /* Copy over the bootargs */ - for (j=0;j<128/4;j++) { - ((unsigned long *) params->commandline)[j]=buffer[33+j]; - } + c=(unsigned char *)(&buffer[34]); + j=0; + while (*c) tag->u.cmdline.cmdline[j++]=*c++; + + tag->u.cmdline.cmdline[j]=0; + tag->hdr.size = (j + 7 + sizeof(struct tag_header)) >> 2; + + /* Hardware revision */ + tag = tag_next(tag); + tag->hdr.tag = ATAG_REVISION; + tag->hdr.size = tag_size(tag_revision); + tag->u.revision.rev = ((unsigned char) buffer[33])-'0'; + + /* End of the taglist */ + tag = tag_next(tag); + tag->hdr.tag = 0; + tag->hdr.size = 0; } @@ -164,7 +186,7 @@ asmlinkage void ofw_init(ofw_handle_t o, int *nomr, int *pointer) { int phandle,i,mem_len,buffer[32]; - char temp[12]; + char temp[15]; temp[0]='/'; temp[1]='m'; @@ -211,6 +233,26 @@ mem_len = OF_getproplen(o,phandle, temp); OF_getprop(o,phandle, temp, buffer, mem_len); - for (i=0; i<=mem_len/4; i++) pointer[i+32]=buffer[i]; - + if (mem_len > 128) mem_len=128; + for (i=0; i<=mem_len/4; i++) pointer[i+33]=buffer[i]; + pointer[i+33]=0; + + temp[0]='/'; + temp[1]='\0'; + phandle=OF_finddevice(o,temp); + temp[0]='b'; + temp[1]='a'; + temp[2]='n'; + temp[3]='n'; + temp[4]='e'; + temp[5]='r'; + temp[6]='-'; + temp[7]='n'; + temp[8]='a'; + temp[9]='m'; + temp[10]='e'; + temp[11]='\0'; + mem_len = OF_getproplen(o,phandle, temp); + OF_getprop(o,phandle, temp, buffer, mem_len); + (unsigned char) pointer[32] = ((unsigned char *) buffer)[mem_len-2]; } Index: vmlinux.lds.in =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/arm/boot/compressed/vmlinux.lds.in,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- vmlinux.lds.in 25 Feb 2001 23:15:20 -0000 1.1.1.2 +++ vmlinux.lds.in 10 Apr 2002 13:51:20 -0000 1.2 @@ -24,6 +24,7 @@ *(.fixup) *(.gnu.warning) *(.rodata) + *(.rodata.*) *(.glue_7) *(.glue_7t) input_data = .; --- setup-sa1100.S DELETED --- |