summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@google.com>2016-03-22 18:32:55 (GMT)
committerchrome-bot <chrome-bot@chromium.org>2016-10-19 21:07:37 (GMT)
commit4c802995b7b6f854d41b7b4d427a0cbd774bac14 (patch)
treee9295aab8e271d79945d51bcd5f2308c74ff9879 /src
parenta91d15b1f1d44c37c9a177726eda2dbd407af5ce (diff)
downloaddepthcharge-4c802995b7b6f854d41b7b4d427a0cbd774bac14.tar.gz
depthcharge-4c802995b7b6f854d41b7b4d427a0cbd774bac14.tar.xz
Drop support for building ro/rw images
We only use unified everywhere. BUG=chromium:595715 BRANCH=none TEST=builds pass just the same because the files, functions and symbols aren't used anywhere. Change-Id: I7a2cf6ef6013a5473fff0ba0621406b0bb7f279b Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/333905 Commit-Ready: Patrick Georgi <pgeorgi@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.inc3
-rw-r--r--src/arch/arm/Makefile.inc2
-rw-r--r--src/arch/arm/enter_trampoline.c39
-rw-r--r--src/arch/mips/Makefile.inc1
-rw-r--r--src/arch/mips/depthcharge.ldscript52
-rw-r--r--src/arch/mips/enter_trampoline.c40
-rw-r--r--src/arch/x86/Makefile.inc1
-rw-r--r--src/arch/x86/enter_trampoline.c35
-rw-r--r--src/image/Kconfig3
-rw-r--r--src/image/Makefile.inc2
-rw-r--r--src/image/depthcharge.ldscript52
-rw-r--r--src/image/enter_trampoline.h26
-rw-r--r--src/image/load_elf.c54
-rw-r--r--src/image/symbols.h4
-rw-r--r--src/vboot/Makefile.inc27
-rw-r--r--src/vboot/util/memory.c4
16 files changed, 2 insertions, 343 deletions
diff --git a/src/Makefile.inc b/src/Makefile.inc
index b450e28..19c54ac 100644
--- a/src/Makefile.inc
+++ b/src/Makefile.inc
@@ -31,9 +31,6 @@ $1.elf: $2
@printf " OBJCOPY $$(subst $$(obj)/,,$$@)\n"
$$(Q)$$(OBJCOPY) --remove-section=".shared_data" \
--remove-section=".cparams" --remove-section=".gbb_copy" \
- --redefine-sym $$(TRAMP_PREFIX)_\$$$$a=\$$$$a \
- --redefine-sym $$(TRAMP_PREFIX)_\$$$$t=\$$$$t \
- --redefine-sym $$(TRAMP_PREFIX)_\$$$$d=\$$$$d \
$$@.tmp $$@
$1.bin: $1.elf
diff --git a/src/arch/arm/Makefile.inc b/src/arch/arm/Makefile.inc
index ac228e7..6dead3b 100644
--- a/src/arch/arm/Makefile.inc
+++ b/src/arch/arm/Makefile.inc
@@ -14,7 +14,7 @@
ifeq ($(CONFIG_ARCH_ARM_V8),y)
depthcharge-y += boot_asm64.S physmem_arm64.c boot64.c smc.S
else
-depthcharge-y += boot_asm.S enter_trampoline.c physmem.c boot.c
+depthcharge-y += boot_asm.S physmem.c boot.c
endif
depthcharge-$(CONFIG_KERNEL_FIT) += fit.c
depthcharge-y += gcc.c
diff --git a/src/arch/arm/enter_trampoline.c b/src/arch/arm/enter_trampoline.c
deleted file mode 100644
index c524782..0000000
--- a/src/arch/arm/enter_trampoline.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright 2013 Google Inc.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * 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.
- */
-
-#include <stdint.h>
-
-#include "base/elf.h"
-#include "image/symbols.h"
-#include "image/enter_trampoline.h"
-
-extern void *cb_header_ptr;
-
-void enter_trampoline(Elf32_Ehdr *ehdr)
-{
- __asm__ __volatile__(
- "mov sp, %[new_stack]\n"
- "mov r0, %[ehdr]\n"
- "mov r1, %[cb_header_ptr]\n"
- // Need register addressing since the call goes too far
- "bx %[load_elf]\n"
- :: [new_stack]"r"(&_tramp_estack - 8), [ehdr]"r"(ehdr),
- [zero]"r"(0), [load_elf]"r"(&tramp_load_elf),
- [cb_header_ptr]"r"(cb_header_ptr)
- : "memory", "r0", "r1", "sp"
- );
-}
diff --git a/src/arch/mips/Makefile.inc b/src/arch/mips/Makefile.inc
index d4cc5e4..c02e732 100644
--- a/src/arch/mips/Makefile.inc
+++ b/src/arch/mips/Makefile.inc
@@ -19,6 +19,5 @@
###############################################################################
depthcharge-y += boot.c
-depthcharge-y += enter_trampoline.c
depthcharge-y += physmem.c
depthcharge-$(CONFIG_KERNEL_FIT) += fit.c
diff --git a/src/arch/mips/depthcharge.ldscript b/src/arch/mips/depthcharge.ldscript
index 1f6fac0..c0dc97b 100644
--- a/src/arch/mips/depthcharge.ldscript
+++ b/src/arch/mips/depthcharge.ldscript
@@ -41,61 +41,9 @@ ENTRY(_entry)
SECTIONS
{
- /*
- * The trampoline to RW firmware. It goes where the kernel will go
- * eventually since that area has to be kept clear anyway, and we'll
- * be done with it by the time we need it for the kernel.
- */
. = KERNEL_START;
_kernel_start = KERNEL_START;
- . = ALIGN(16);
- _tramp_start = .;
- .tramp.text : {
- *trampoline.o(.text)
- *trampoline.o(.text.*)
- *(.tramp.text)
- *(.tramp.text.*)
- }
-
- .tramp.rodata : {
- *trampoline.o(.rodata)
- *trampoline.o(.rodata.*)
- *(.tramp.rodata)
- *(.tramp.rodata.*)
- }
-
- .tramp.data : {
- *trampoline.o(.data)
- *trampoline.o(.data.*)
- *(.tramp.data)
- *(.tramp.data.*)
- }
-
- .tramp.got : {
- *trampoline.o(.got)
- *trampoline.o(.got.*)
- *(.tramp.got)
- *(.tramp.got.*)
- }
-
- .tramp.bss : {
- *trampoline.o(.sbss)
- *trampoline.o(.sbss.*)
- *trampoline.o(.bss)
- *trampoline.o(.bss.*)
- *trampoline.o(COMMON)
- *(.tramp.bss)
- *(.tramp.bss.*)
- }
-
- . = ALIGN(16);
- _tramp_stack = .;
- . += 0x200;
- _tramp_estack = .;
-
- _tramp_end = .;
-
. = KERNEL_START + KERNEL_SIZE;
_kernel_end = .;
diff --git a/src/arch/mips/enter_trampoline.c b/src/arch/mips/enter_trampoline.c
deleted file mode 100644
index 17628ff..0000000
--- a/src/arch/mips/enter_trampoline.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2014 Google Inc.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * 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.
- */
-
-#include <stdint.h>
-
-#include "base/elf.h"
-#include "image/symbols.h"
-#include "image/enter_trampoline.h"
-
-void enter_trampoline(Elf32_Ehdr *ehdr)
-{
- /* put here MIPS equivalent of the below. */
-#if 0
- __asm__ __volatile__(
- "mov sp, %[new_stack]\n"
- "mov r0, %[ehdr]\n"
- "mov r1, %[cb_header_ptr]\n"
- // Need register addressing since the call goes too far
- "bx %[load_elf]\n"
- ::[new_stack]"r"(&_tramp_estack - 8), [ehdr]"r"(ehdr),
- [zero]"r"(0), [load_elf]"r"(&tramp_load_elf),
- [cb_header_ptr]"r"(cb_header_ptr)
- : "memory", "r0", "r1", "sp"
- );
-#endif
-}
diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc
index af8cd2a..0c8398a 100644
--- a/src/arch/x86/Makefile.inc
+++ b/src/arch/x86/Makefile.inc
@@ -12,7 +12,6 @@
##
depthcharge-y += boot.c
-depthcharge-y += enter_trampoline.c
depthcharge-y += gcc.c
depthcharge-y += physmem.c
depthcharge-$(CONFIG_KERNEL_ZIMAGE) += zimage.c
diff --git a/src/arch/x86/enter_trampoline.c b/src/arch/x86/enter_trampoline.c
deleted file mode 100644
index c7eea29..0000000
--- a/src/arch/x86/enter_trampoline.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2012 Google Inc.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * 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.
- */
-
-#include <stdint.h>
-
-#include "base/elf.h"
-#include "image/symbols.h"
-#include "image/enter_trampoline.h"
-
-void enter_trampoline(Elf32_Ehdr *ehdr)
-{
- __asm__ __volatile__(
- "mov %[new_stack], %%esp\n"
- "push %[cb_header_ptr]\n"
- "push %[ehdr]\n"
- "call tramp_load_elf\n"
- :: [new_stack]"r"(&_tramp_estack - 8), [ehdr]"a"(ehdr),
- [cb_header_ptr]"d"(0)
- : "memory"
- );
-}
diff --git a/src/image/Kconfig b/src/image/Kconfig
index 46a2232..42e139c 100644
--- a/src/image/Kconfig
+++ b/src/image/Kconfig
@@ -29,8 +29,7 @@ config KERNEL_START
The start of a region of memory the kernel image is loaded into from
the boot medium (vboot, network, etc.). This image may or may not be
a wrapper around the actual kernel code (e.g. FIT) and may or may not
- require further decompression or relocation. Also, this area is used
- by the old trampoline code in a way nobody cares about anymore.
+ require further decompression or relocation.
config KERNEL_SIZE
hex "The size of the region the kernel image is loaded into"
diff --git a/src/image/Makefile.inc b/src/image/Makefile.inc
index e39507f..d6e32f4 100644
--- a/src/image/Makefile.inc
+++ b/src/image/Makefile.inc
@@ -14,8 +14,6 @@
depthcharge-y += fmap.c
depthcharge-y += index.c
-trampoline-y += load_elf.c
-
# These options are passed from .config to the linker script. When making
# changes, update Kconfig as well.
link_config_options := \
diff --git a/src/image/depthcharge.ldscript b/src/image/depthcharge.ldscript
index ac5078b..80e32dd 100644
--- a/src/image/depthcharge.ldscript
+++ b/src/image/depthcharge.ldscript
@@ -34,61 +34,9 @@ ENTRY(_entry)
SECTIONS
{
- /*
- * The trampoline to RW firmware. It goes where the kernel will go
- * eventually since that area has to be kept clear anyway, and we'll
- * be done with it by the time we need it for the kernel.
- */
. = KERNEL_START;
_kernel_start = KERNEL_START;
- . = ALIGN(16);
- _tramp_start = .;
- .tramp.text : {
- *trampoline.o(.text)
- *trampoline.o(.text.*)
- *(.tramp.text)
- *(.tramp.text.*)
- }
-
- .tramp.rodata : {
- *trampoline.o(.rodata)
- *trampoline.o(.rodata.*)
- *(.tramp.rodata)
- *(.tramp.rodata.*)
- }
-
- .tramp.data : {
- *trampoline.o(.data)
- *trampoline.o(.data.*)
- *(.tramp.data)
- *(.tramp.data.*)
- }
-
- .tramp.got : {
- *trampoline.o(.got)
- *trampoline.o(.got.*)
- *(.tramp.got)
- *(.tramp.got.*)
- }
-
- .tramp.bss : {
- *trampoline.o(.sbss)
- *trampoline.o(.sbss.*)
- *trampoline.o(.bss)
- *trampoline.o(.bss.*)
- *trampoline.o(COMMON)
- *(.tramp.bss)
- *(.tramp.bss.*)
- }
-
- . = ALIGN(16);
- _tramp_stack = .;
- . += 0x200;
- _tramp_estack = .;
-
- _tramp_end = .;
-
. = KERNEL_START + KERNEL_SIZE;
_kernel_end = .;
diff --git a/src/image/enter_trampoline.h b/src/image/enter_trampoline.h
deleted file mode 100644
index 756c6aa..0000000
--- a/src/image/enter_trampoline.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2012 Google Inc.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * 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.
- */
-
-#ifndef __IMAGE_ENTER_TRAMPOLINE_H__
-#define __IMAGE_ENTER_TRAMPOLINE_H__
-
-#include "base/elf.h"
-
-void enter_trampoline(Elf32_Ehdr *ehdr);
-void tramp_load_elf(Elf32_Ehdr *ehdr, void *param);
-
-#endif /* __IMAGE_ENTER_TRAMPOLINE_H__ */
diff --git a/src/image/load_elf.c b/src/image/load_elf.c
deleted file mode 100644
index 552822e..0000000
--- a/src/image/load_elf.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2012 Google Inc.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * 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.
- */
-
-#include <arch/cache.h>
-#include <string.h>
-
-#include "base/elf.h"
-
-void load_elf(Elf32_Ehdr *ehdr, void *param)
-{
- uintptr_t base = (uintptr_t)ehdr;
- uintptr_t addr = (uintptr_t)ehdr + ehdr->e_phoff;
- uintptr_t step = ehdr->e_phentsize;
- int num = ehdr->e_phnum;
-
- // Copy over the ELF segments.
- while (num--) {
- Elf32_Phdr *phdr = (Elf32_Phdr *)addr;
- addr += step;
-
- if (phdr->p_type != ElfPTypeLoad)
- continue;
-
- uint8_t *dest = (uint8_t *)(uintptr_t)phdr->p_paddr;
- uint8_t *src = (uint8_t *)(uintptr_t)(base + phdr->p_offset);
- uint32_t filesz = phdr->p_filesz;
- uint32_t memsz = phdr->p_memsz;
-
- if (filesz)
- memcpy(dest, src, filesz);
- if (memsz > filesz)
- memset(dest + filesz, 0, memsz - filesz);
- }
-
- cache_sync_instructions();
-
- // Go for it!
- typedef void (*entry_func)(void *);
- ((entry_func)ehdr->e_entry)(param);
-}
diff --git a/src/image/symbols.h b/src/image/symbols.h
index 3822975..37c50ab 100644
--- a/src/image/symbols.h
+++ b/src/image/symbols.h
@@ -33,10 +33,6 @@ extern uint8_t _stack;
extern uint8_t _exc_estack;
extern uint8_t _exc_stack;
extern uint8_t _end;
-extern uint8_t _tramp_start;
-extern uint8_t _tramp_end;
-extern uint8_t _tramp_stack;
-extern uint8_t _tramp_estack;
extern uint8_t _kernel_start;
extern uint8_t _kernel_end;
extern uint8_t _init_funcs_start;
diff --git a/src/vboot/Makefile.inc b/src/vboot/Makefile.inc
index 71e746f..65350f6 100644
--- a/src/vboot/Makefile.inc
+++ b/src/vboot/Makefile.inc
@@ -25,11 +25,6 @@ unified-y += main.c
VB_LIB = $(obj)/external/vboot/vboot_fw.a
-TRAMP_LP = $(obj)/trampoline_libpayload.a
-TRAMP_PREFIX = tramp
-TRAMP_ENTRY = load_elf
-TRAMPOLINE = $(obj)/trampoline.o
-
# The vboot library source is external to depthcharge.
$(VB_LIB):
ifndef VB_SOURCE
@@ -49,25 +44,3 @@ else
endif
.PHONY: $(VB_LIB)
-
-# Trampoline to go from RO depthcharge to RW. Make our own libpayload where only
-# a few whitelisted symbols are linkable to avoid accidental binary bloat here.
-$(TRAMP_LP): $(LIBPAYLOAD_DIR)/lib/libpayload.a
- @printf " OBJCOPY $(subst $(obj)/,,$(@))\n"
- $(Q)$(OBJCOPY) --prefix-symbols=$(TRAMP_PREFIX)_ \
- --remove-section=".reginfo" \
- --keep-global-symbol=$(TRAMP_PREFIX)_memcpy \
- --keep-global-symbol=$(TRAMP_PREFIX)_memset \
- --keep-global-symbol=$(TRAMP_PREFIX)_dcache_clean_all \
- --keep-global-symbol=$(TRAMP_PREFIX)_dcache_clean_invalidate_all \
- --keep-global-symbol=$(TRAMP_PREFIX)_cache_sync_instructions \
- --prefix-alloc-sections=.$(TRAMP_PREFIX) $(<) $(@)
-
-# The trampoline is linked with normal gcc to avoid linking the full libpayload.
-$(TRAMPOLINE): $$(trampoline-objs)
- @printf " LD $(subst $(obj)/,,$(@).tmp)\n"
- $(Q)$(CC) $(LINK_FLAGS) -Wl,-relocatable -o $(@).tmp \
- $(trampoline-objs) -nostdinc -nostdlib -static \
- -e $(TRAMP_ENTRY)
- @printf " OBJCOPY $(subst $(obj)/,,$(@))\n"
- $(Q)$(OBJCOPY) --prefix-symbols=$(TRAMP_PREFIX)_ $(@).tmp $(@)
diff --git a/src/vboot/util/memory.c b/src/vboot/util/memory.c
index 20e028b..564555f 100644
--- a/src/vboot/util/memory.c
+++ b/src/vboot/util/memory.c
@@ -37,10 +37,6 @@ static void used_list_initialize(void)
// Add regions depthcharge occupies.
ranges_add(&used, (uintptr_t)&_start, (uintptr_t)&_end);
- // Remove trampoline area if it is non-zero in size.
- if (&_tramp_start != &_tramp_end)
- ranges_add(&used, (uintptr_t)&_tramp_start,
- (uintptr_t)&_tramp_end);
initialized = 1;
}