]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/sbl.git/commitdiff
Linker and update makefile for the QSPI writer. Create signed and loadable app from...
authorThanh Tran <thanh-tran@ti.com>
Wed, 15 Feb 2017 11:22:15 +0000 (06:22 -0500)
committerThanh Tran <thanh-tran@ti.com>
Wed, 15 Feb 2017 11:22:15 +0000 (06:22 -0500)
soc/k2g/writer_linker.cmd [new file with mode: 0644]
tools/flashWriter/qspi/src/makefile

diff --git a/soc/k2g/writer_linker.cmd b/soc/k2g/writer_linker.cmd
new file mode 100644 (file)
index 0000000..bf710bc
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2016 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+MEMORY
+{
+    SBL_MEM (RWX)     : o = 0x0C080000, l = 0x30000 /* MSMC Shared Memeory */
+}
+
+OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
+OUTPUT_ARCH(arm)
+
+SECTIONS
+{
+        .startcode :
+        {
+            . = ALIGN(4);
+            *(.public.*)
+            *sbl_init.ao (.text)
+        } >SBL_MEM
+
+
+        .text :
+        {
+            . = ALIGN(4);
+            *(.text*)
+            *(.rodata*)
+        } >SBL_MEM
+
+        .data :
+        {
+            . = ALIGN(4);
+            *(.data*)
+        } >SBL_MEM
+
+        .bss :
+        {
+            . = ALIGN(4);
+            _bss_start = .;
+            *(.bss*)
+            *(COMMON)
+            _bss_end = .;
+        } >SBL_MEM
+
+        .heap :
+        {
+            . = ALIGN(4);
+            __end__ = .;
+            end = __end__;
+            __HeapBase = __end__;
+            *(.heap*)
+            . = . + 0x400;
+            __HeapLimit = .;
+        } >SBL_MEM
+
+        .stack :
+        {
+            . = ALIGN(4);
+            __StackLimit = . ;
+            *(.stack*)
+            . = . + 0x2000;
+            __StackTop = .;
+        } >SBL_MEM
+        _stack = __StackTop;
+}
+
index daef95b1cf04f36eacff24e30e7d62ce08427afb..f5c91113467c4ceb3ff0e8741e95fa6a10863b1d 100644 (file)
@@ -135,14 +135,26 @@ SRC_CFLAGS = -I. $(CFLAGS) -g -gdwarf-3 -gstrict-dwarf -Wall
 
 ifeq ($(SECUREMODE), yes)
   SRC_CFLAGS += -DSECURE_BOOT
+  SIGNED_WRITER = $(QSPI_WRTR_BINDIR)/flash_writer_signed.bin
+else
+  SIGNED_WRITER =
 endif
 
+out2rprc=$(PDK_INSTALL_PATH)/ti/boot/sbl/tools/out2rprc/bin/out2rprc.exe
+multigen=$(PDK_INSTALL_PATH)/ti/boot/sbl/tools/multicoreImageGen/bin/MulticoreImageGen
+
 # Make Rule for the SRC Files
 SRC_OBJS = $(patsubst %.c, $(QSPI_WRTR_OBJDIR)/%.$(OBJEXT), $(SRC_C))
 ENTRY_OBJ = $(patsubst %.S, $(QSPI_WRTR_OBJDIR)/%.$(ASMOBJEXT), $(ENTRY_SRC))
 SRC_DRV_OBJS = $(patsubst %.c, $(QSPI_WRTR_OBJDIR)/%.$(OBJEXT), $(SRC_DRV))
 
-flashwriter:$(QSPI_WRTR_BINDIR)/$(EXE)
+flashwriter:$(SIGNED_WRITER) $(QSPI_WRTR_BINDIR)/$(EXE) 
+
+$(SIGNED_WRITER): $(QSPI_WRTR_BINDIR)/$(EXE)
+       mono $(out2rprc) $< $(QSPI_WRTR_BINDIR)/tmp.rprc
+       $(multigen) LE 55 $(QSPI_WRTR_BINDIR)/writer.bin 0 $(QSPI_WRTR_BINDIR)/tmp.rprc
+       $(SECBIN) -i  $(QSPI_WRTR_BINDIR)/writer.bin -r $(KEYPATH)/privkey.pem -d $(SOC) -o  $@
+
 
 $(QSPI_WRTR_BINDIR)/$(EXE): $(SRC_OBJS) $(SRC_DRV_OBJS) $(ENTRY_OBJ) $(QSPI_WRTR_BINDIR)/.created $(QSPI_WRTR_OBJDIR)/.created
        @echo linking $(SRC_OBJS) $(SRC_DRV_OBJS) $(ENTRY_OBJ) into $@ ...