summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/armv7/tegra2
diff options
context:
space:
mode:
authorVarun Wadekar <vwadekar@nvidia.com>2012-01-23 12:38:31 +0530
committerGerrit <chrome-bot@google.com>2012-02-08 22:08:37 -0800
commite7efcd3803a1359c9955a57f4f831c346b052c01 (patch)
tree4d79a3acf0b2a0266ff50dfc038752742d7201d9 /arch/arm/cpu/armv7/tegra2
parent929e867d143b66d96e6c4a8e1f69d3e8c6ca14fd (diff)
arm: tegra2: add .lds to calculate warm boot code size
move away from the current method, where we add wb_end() immediately after wb_start() and then use the function addresses to calculate the WB code size. Add a .lds script to expose __wb_end after wb_start() in the .text section and then reference this variable in the WB size calculation code. BUG=chromium-os:23496 TEST=build on Seaboard. Verified that uboot.map has the correct address assigned to __wb_end and that LP0 works reliably. Change-Id: I170277f00b450d38063018453faf44d5a38abaaa Signed-off-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-on: https://gerrit.chromium.org/gerrit/14682
Diffstat (limited to 'arch/arm/cpu/armv7/tegra2')
-rw-r--r--arch/arm/cpu/armv7/tegra2/Makefile8
-rw-r--r--arch/arm/cpu/armv7/tegra2/warmboot_avp.c8
-rw-r--r--arch/arm/cpu/armv7/tegra2/warmboot_avp.lds37
3 files changed, 44 insertions, 9 deletions
diff --git a/arch/arm/cpu/armv7/tegra2/Makefile b/arch/arm/cpu/armv7/tegra2/Makefile
index cb5c261107..b42a6b31b2 100644
--- a/arch/arm/cpu/armv7/tegra2/Makefile
+++ b/arch/arm/cpu/armv7/tegra2/Makefile
@@ -37,11 +37,17 @@ COBJS-y := board.o pinmux.o sys_info.o
COBJS-$(CONFIG_VIDEO_TEGRA) += display.o
COBJS-$(CONFIG_TEGRA2_WARMBOOT) += warmboot.o warmboot_avp.o
+ifeq ($(CONFIG_TEGRA2_WARMBOOT),y)
+ LDSCRIPT= warmboot_avp.lds
+else
+ LDSCRIPT=
+endif
+
SOBJS := $(SOBJS-y)
COBJS := $(COBJS-y)
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS))
+OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS) $(LDSCRIPT))
all: $(obj).depend $(LIB)
diff --git a/arch/arm/cpu/armv7/tegra2/warmboot_avp.c b/arch/arm/cpu/armv7/tegra2/warmboot_avp.c
index bb1872fe12..121425ba23 100644
--- a/arch/arm/cpu/armv7/tegra2/warmboot_avp.c
+++ b/arch/arm/cpu/armv7/tegra2/warmboot_avp.c
@@ -303,11 +303,3 @@ do_reset:
goto do_reset;
}
-/*
- * wb_end() is a dummy function, and must be directly following wb_start(),
- * and is used to calculate the size of wb_start().
- */
-void wb_end(void)
-{
-}
-
diff --git a/arch/arm/cpu/armv7/tegra2/warmboot_avp.lds b/arch/arm/cpu/armv7/tegra2/warmboot_avp.lds
new file mode 100644
index 0000000000..8fc377292b
--- /dev/null
+++ b/arch/arm/cpu/armv7/tegra2/warmboot_avp.lds
@@ -0,0 +1,37 @@
+/*
+ * (C) Copyright 2010 - 2011
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * 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.
+ *
+ * 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
+ */
+
+OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
+OUTPUT_ARCH(arm)
+
+SECTIONS
+{
+ . = 0x00000000;
+ . = ALIGN(4);
+
+ .text :
+ {
+ warmboot_avp.o (.text)
+ __wb_end = .;
+ }
+}