aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/boot
diff options
context:
space:
mode:
authorcodeworkx <daniel.hillenbrand@codeworkx.de>2012-06-02 13:09:29 +0200
committercodeworkx <daniel.hillenbrand@codeworkx.de>2012-06-02 13:09:29 +0200
commitc6da2cfeb05178a11c6d062a06f8078150ee492f (patch)
treef3b4021d252c52d6463a9b3c1bb7245e399b009c /arch/arm/boot
parentc6d7c4dbff353eac7919342ae6b3299a378160a6 (diff)
downloadkernel_samsung_smdk4412-c6da2cfeb05178a11c6d062a06f8078150ee492f.zip
kernel_samsung_smdk4412-c6da2cfeb05178a11c6d062a06f8078150ee492f.tar.gz
kernel_samsung_smdk4412-c6da2cfeb05178a11c6d062a06f8078150ee492f.tar.bz2
samsung update 1
Diffstat (limited to 'arch/arm/boot')
-rw-r--r--arch/arm/boot/.gitignore5
-rw-r--r--arch/arm/boot/Makefile4
-rw-r--r--arch/arm/boot/compressed/.gitignore7
-rw-r--r--arch/arm/boot/compressed/Makefile5
-rw-r--r--arch/arm/boot/compressed/head.S43
5 files changed, 51 insertions, 13 deletions
diff --git a/arch/arm/boot/.gitignore b/arch/arm/boot/.gitignore
deleted file mode 100644
index ce1c5ff..0000000
--- a/arch/arm/boot/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-Image
-zImage
-xipImage
-bootpImage
-uImage
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
index 9128fdd..9ec1a8d 100644
--- a/arch/arm/boot/Makefile
+++ b/arch/arm/boot/Makefile
@@ -12,6 +12,7 @@
#
MKIMAGE := $(srctree)/scripts/mkuboot.sh
+MKFIPS := $(srctree)/scripts/mk_fipsbinary.sh
ifneq ($(MACHINE),)
include $(srctree)/$(MACHINE)/Makefile.boot
@@ -55,6 +56,9 @@ $(obj)/compressed/vmlinux: $(obj)/Image FORCE
$(obj)/zImage: $(obj)/compressed/vmlinux FORCE
$(call if_changed,objcopy)
+ifeq ($(CONFIG_CRYPTO_FIPS),y)
+ $(MKFIPS) $(obj)/zImage
+endif
@echo ' Kernel: $@ is ready'
endif
diff --git a/arch/arm/boot/compressed/.gitignore b/arch/arm/boot/compressed/.gitignore
deleted file mode 100644
index c602896..0000000
--- a/arch/arm/boot/compressed/.gitignore
+++ /dev/null
@@ -1,7 +0,0 @@
-font.c
-lib1funcs.S
-piggy.gzip
-piggy.lzo
-piggy.lzma
-vmlinux
-vmlinux.lds
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index 23aad07..54c9428 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -16,6 +16,11 @@ endif
endif
AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET)
+# change@wtl.rsengott
+# FIPS_KERNEL_RAM_BASE is start of kernel text in RAM
+ifeq ($(CONFIG_CRYPTO_FIPS),y)
+AFLAGS_head.o += -DFIPS_KERNEL_RAM_BASE=0x40008000
+endif
HEAD = head.o
OBJS += misc.o decompress.o
FONTC = $(srctree)/drivers/video/console/font_acorn_8x8.c
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index 940b201..3a959994 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -186,7 +186,7 @@ restart: adr r0, LC0
* We might be running at a different address. We need
* to fix up various pointers.
*/
- sub r0, r0, r1 @ calculate the delta offset
+ sub r0, r0, r1 @ calculate the delta offset
add r6, r6, r0 @ _edata
add r10, r10, r0 @ inflated kernel size location
@@ -292,7 +292,13 @@ wont_overwrite:
* sp = stack pointer
*/
teq r0, #0
+#ifndef CONFIG_CRYPTO_FIPS
beq not_relocated
+#else
+ movw r5, #:lower16:zimage_ram_base_addr
+ movt r5, #:upper16:zimage_ram_base_addr
+ beq not_relocated_copy
+#endif
add r11, r11, r0
add r12, r12, r0
@@ -305,6 +311,11 @@ wont_overwrite:
add r2, r2, r0
add r3, r3, r0
+#ifdef CONFIG_CRYPTO_FIPS
+ movw r5, #:lower16:zimage_ram_base_addr
+ movt r5, #:upper16:zimage_ram_base_addr
+ bl copy_compressed
+#endif
/*
* Relocate all entries in the GOT table.
*/
@@ -367,6 +378,10 @@ LC0: .word LC0 @ r1
.word .L_user_stack_end @ sp
.size LC0, . - LC0
+#ifdef CONFIG_CRYPTO_FIPS
+ .equ zimage_ram_base_addr, FIPS_KERNEL_RAM_BASE
+#endif
+
#ifdef CONFIG_ARCH_RPC
.globl params
params: ldr r0, =0x10000100 @ params_phys for RPC
@@ -375,6 +390,29 @@ params: ldr r0, =0x10000100 @ params_phys for RPC
.align
#endif
+
+#ifdef CONFIG_CRYPTO_FIPS
+not_relocated_copy:
+ bl copy_compressed
+ b not_relocated
+
+copy_compressed:
+ mov r1, r5
+ add r9, r4, #CONFIG_CRYPTO_FIPS_INTEG_OFFSET
+
+1:
+ ldmia r1!, {r5}
+ stmia r9!, {r5}
+ cmp r1, r2
+ blo 1b
+
+ .rept 8
+ ldmia r1!, {r5}
+ stmia r9!, {r5}
+ .endr
+ mov pc, lr
+#endif
+
/*
* Turn on the cache. We need to setup some page tables so that we
* can have both the I and D caches on.
@@ -656,6 +694,8 @@ proc_types:
@ b __arm6_mmu_cache_off
@ b __armv3_mmu_cache_flush
+#if !defined(CONFIG_CPU_V7)
+ /* This collides with some V7 IDs, preventing correct detection */
.word 0x00000000 @ old ARM ID
.word 0x0000f000
mov pc, lr
@@ -664,6 +704,7 @@ proc_types:
THUMB( nop )
mov pc, lr
THUMB( nop )
+#endif
.word 0x41007000 @ ARM7/710
.word 0xfff8fe00