Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://www.jni.nu/cris
Browse files Browse the repository at this point in the history
* 'for-linus' of git://www.jni.nu/cris:
  [CRISv10] Clean up compressed/misc.c
  [CRISv10] Correct whitespace damage.
  [CRIS] Correct definition of subdirs for install_headers.
  [CRIS] Correct image makefiles to allow using a separate OBJ-directory.
  [CRIS] Build fixes for compressed and rescue images for v10 and v32:
  It looks at least odd to apply spin_unlock to a mutex.
  cris: compile fixes for 2.6.26-rc5
  • Loading branch information
Linus Torvalds committed Jul 21, 2008
2 parents fb6624e + d17ffb4 commit 3a53337
Show file tree
Hide file tree
Showing 13 changed files with 154 additions and 154 deletions.
1 change: 0 additions & 1 deletion arch/cris/arch-v10/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# arch/cris/arch-v10/boot/Makefile
#

OBJCOPY = objcopy-cris
OBJCOPYFLAGS = -O binary --remove-section=.bss

subdir- := compressed rescue
Expand Down
14 changes: 3 additions & 11 deletions arch/cris/arch-v10/boot/compressed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
# arch/cris/arch-v10/boot/compressed/Makefile
#

CC = gcc-cris -melf $(LINUXINCLUDE)
ccflags-y += -O2
LD = ld-cris
ldflags-y += -T $(obj)/decompress.ld
asflags-y += $(LINUXINCLUDE)
ccflags-y += -O2 $(LINUXINCLUDE)
ldflags-y += -T $(srctree)/$(obj)/decompress.ld
OBJECTS = $(obj)/head.o $(obj)/misc.o
OBJCOPY = objcopy-cris
OBJCOPYFLAGS = -O binary --remove-section=.bss

quiet_cmd_image = BUILD $@
Expand All @@ -21,12 +19,6 @@ $(obj)/decompress.o: $(OBJECTS) FORCE
$(obj)/decompress.bin: $(obj)/decompress.o FORCE
$(call if_changed,objcopy)

$(obj)/head.o: $(obj)/head.S .config
@$(CC) -D__ASSEMBLY__ -traditional -c $< -o $@

$(obj)/misc.o: $(obj)/misc.c .config
@$(CC) -D__KERNEL__ -c $< -o $@

$(obj)/vmlinux: $(obj)/piggy.gz $(obj)/decompress.bin FORCE
$(call if_changed,image)

Expand Down
3 changes: 2 additions & 1 deletion arch/cris/arch-v10/boot/compressed/decompress.ld
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
OUTPUT_FORMAT(elf32-us-cris)
/* OUTPUT_FORMAT(elf32-us-cris) */
OUTPUT_FORMAT(elf32-cris)

MEMORY
{
Expand Down
98 changes: 49 additions & 49 deletions arch/cris/arch-v10/boot/compressed/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -15,77 +15,77 @@
#define COMMAND_LINE_MAGIC 0x87109563

;; Exported symbols

.globl _input_data


.globl input_data


.text

nop
di

;; We need to initialze DRAM registers before we start using the DRAM
cmp.d RAM_INIT_MAGIC, r8 ; Already initialized?

cmp.d RAM_INIT_MAGIC, $r8 ; Already initialized?
beq dram_init_finished
nop

#include "../../lib/dram_init.S"
dram_init_finished:

dram_init_finished:

;; Initiate the PA and PB ports

move.b CONFIG_ETRAX_DEF_R_PORT_PA_DATA, r0
move.b r0, [R_PORT_PA_DATA]
move.b CONFIG_ETRAX_DEF_R_PORT_PA_DATA, $r0
move.b $r0, [R_PORT_PA_DATA]

move.b CONFIG_ETRAX_DEF_R_PORT_PA_DIR, r0
move.b r0, [R_PORT_PA_DIR]
move.b CONFIG_ETRAX_DEF_R_PORT_PA_DIR, $r0
move.b $r0, [R_PORT_PA_DIR]

move.b CONFIG_ETRAX_DEF_R_PORT_PB_DATA, r0
move.b r0, [R_PORT_PB_DATA]
move.b CONFIG_ETRAX_DEF_R_PORT_PB_DATA, $r0
move.b $r0, [R_PORT_PB_DATA]

move.b CONFIG_ETRAX_DEF_R_PORT_PB_DIR, r0
move.b r0, [R_PORT_PB_DIR]
move.b CONFIG_ETRAX_DEF_R_PORT_PB_DIR, $r0
move.b $r0, [R_PORT_PB_DIR]

;; Setup the stack to a suitably high address.
;; We assume 8 MB is the minimum DRAM in an eLinux
;; product and put the sp at the top for now.

move.d 0x40800000, sp
move.d 0x40800000, $sp

;; Figure out where the compressed piggyback image is
;; in the flash (since we wont try to copy it to DRAM
;; before unpacking). It is at _edata, but in flash.
;; Use (_edata - basse) as offset to the current PC.
basse: move.d pc, r5
and.d 0x7fffffff, r5 ; strip any non-cache bit
subq 2, r5 ; compensate for the move.d pc instr
move.d r5, r0 ; save for later - flash address of 'basse'
add.d _edata, r5
sub.d basse, r5 ; r5 = flash address of '_edata'

basse: move.d $pc, $r5
and.d 0x7fffffff, $r5 ; strip any non-cache bit
subq 2, $r5 ; compensate for the move.d $pc instr
move.d $r5, $r0 ; save for later - flash address of 'basse'
add.d _edata, $r5
sub.d basse, $r5 ; $r5 = flash address of '_edata'

;; Copy text+data to DRAM
move.d basse, r1 ; destination
move.d _edata, r2 ; end destination
1: move.w [r0+], r3
move.w r3, [r1+]
cmp.d r2, r1

move.d basse, $r1 ; destination
move.d _edata, $r2 ; end destination
1: move.w [$r0+], $r3
move.w $r3, [$r1+]
cmp.d $r2, $r1
bcs 1b
nop

move.d r5, [_input_data] ; for the decompressor
move.d $r5, [input_data] ; for the decompressor


;; Clear the decompressors BSS (between _edata and _end)
moveq 0, r0
move.d _edata, r1
move.d _end, r2
1: move.w r0, [r1+]
cmp.d r2, r1

moveq 0, $r0
move.d _edata, $r1
move.d _end, $r2
1: move.w $r0, [$r1+]
cmp.d $r2, $r1
bcs 1b
nop

Expand All @@ -94,16 +94,16 @@ basse: move.d pc, r5
move.d $r10, [$r12]
move.d _cmd_line_addr, $r12
move.d $r11, [$r12]

;; Do the decompression and save compressed size in _inptr

jsr _decompress_kernel

;; Put start address of root partition in r9 so the kernel can use it
;; Do the decompression and save compressed size in inptr

jsr decompress_kernel

;; Put start address of root partition in $r9 so the kernel can use it
;; when mounting from flash

move.d [_input_data], r9 ; flash address of compressed kernel
add.d [_inptr], r9 ; size of compressed kernel
move.d [input_data], $r9 ; flash address of compressed kernel
add.d [inptr], $r9 ; size of compressed kernel

;; Restore command line magic and address.
move.d _cmd_line_magic, $r10
Expand All @@ -112,12 +112,12 @@ basse: move.d pc, r5
move.d [$r11], $r11

;; Enter the decompressed kernel
move.d RAM_INIT_MAGIC, r8 ; Tell kernel that DRAM is initialized
move.d RAM_INIT_MAGIC, $r8 ; Tell kernel that DRAM is initialized
jump 0x40004000 ; kernel is linked to this address

.data

_input_data:
input_data:
.dword 0 ; used by the decompressor
_cmd_line_magic:
.dword 0
Expand Down
Loading

0 comments on commit 3a53337

Please sign in to comment.