From 897378bc292fc1ff5bbcd3ba616e2cafb8cd5f90 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 9 Dec 2019 11:29:12 -0600 Subject: [PATCH] Remove support for generation of RRLOAD binary files. The RRLOAD binary format was used with Linux BSPs from www.ridgerun.com circa 2000-2001. It is still need by the the c5471 board if that bootloader is used. Removes the CONFIG_RRLOAD_BINARY option and tools/mkimage.sh This change was motivated by the presence of the mkimage.sh file under tools. That is the tool that created the RRLOAD binary format. That bash script has a GPL license and, hence, may not be included in an Apache-licensed project. --- Documentation/NuttxPortingGuide.html | 1 - Kconfig | 7 - .../c5471/c5471evm/configs/httpd/defconfig | 1 - .../c5471/c5471evm/configs/nettest/defconfig | 1 - .../arm/c5471/c5471evm/configs/nsh/defconfig | 1 - boards/arm/stm32/nucleo-f446re/README.txt | 1 - boards/arm/stm32/nucleo-f4x1re/README.txt | 1 - boards/arm/stm32l4/nucleo-l432kc/README.txt | 1 - boards/arm/stm32l4/nucleo-l476rg/README.txt | 1 - tools/Makefile.unix | 7 - tools/Makefile.win | 4 - tools/README.txt | 5 - tools/mkimage.sh | 289 ------------------ 13 files changed, 320 deletions(-) delete mode 100755 tools/mkimage.sh diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html index 334e6c720b..5e5b932bbd 100644 --- a/Documentation/NuttxPortingGuide.html +++ b/Documentation/NuttxPortingGuide.html @@ -1505,7 +1505,6 @@ tools/ |-- mkdeps.c |-- mkexport.sh |-- mkfsdata.pl -|-- mkimage.sh |-- mknulldeps.sh |-- mkromfsimg.sh |-- mksymtab.c diff --git a/Kconfig b/Kconfig index a44ef1f3c7..9642923ff7 100644 --- a/Kconfig +++ b/Kconfig @@ -273,13 +273,6 @@ endmenu # Build Setup menu "Binary Output Formats" -config RRLOAD_BINARY - bool "rrload binary format" - default n - ---help--- - Create nuttx.rr in the rrload binary format used with - BSPs from www.ridgerun.com using the tools/mkimage.sh script. - config CXD56_BINARY bool "spk binary format" default n diff --git a/boards/arm/c5471/c5471evm/configs/httpd/defconfig b/boards/arm/c5471/c5471evm/configs/httpd/defconfig index 9f7412170f..56a85aad12 100644 --- a/boards/arm/c5471/c5471evm/configs/httpd/defconfig +++ b/boards/arm/c5471/c5471evm/configs/httpd/defconfig @@ -35,7 +35,6 @@ CONFIG_PREALLOC_WDOGS=8 CONFIG_PTHREAD_STACK_DEFAULT=4096 CONFIG_RAM_SIZE=285212672 CONFIG_RAM_START=0 -CONFIG_RRLOAD_BINARY=y CONFIG_RR_INTERVAL=200 CONFIG_SCHED_HPWORK=y CONFIG_SDCLONE_DISABLE=y diff --git a/boards/arm/c5471/c5471evm/configs/nettest/defconfig b/boards/arm/c5471/c5471evm/configs/nettest/defconfig index d2700c0c21..d3ba386bb4 100644 --- a/boards/arm/c5471/c5471evm/configs/nettest/defconfig +++ b/boards/arm/c5471/c5471evm/configs/nettest/defconfig @@ -34,7 +34,6 @@ CONFIG_PREALLOC_WDOGS=8 CONFIG_PTHREAD_STACK_DEFAULT=4096 CONFIG_RAM_SIZE=285212672 CONFIG_RAM_START=0 -CONFIG_RRLOAD_BINARY=y CONFIG_RR_INTERVAL=200 CONFIG_SCHED_HPWORK=y CONFIG_SDCLONE_DISABLE=y diff --git a/boards/arm/c5471/c5471evm/configs/nsh/defconfig b/boards/arm/c5471/c5471evm/configs/nsh/defconfig index 7d75390bc0..dc07ded95a 100644 --- a/boards/arm/c5471/c5471evm/configs/nsh/defconfig +++ b/boards/arm/c5471/c5471evm/configs/nsh/defconfig @@ -44,7 +44,6 @@ CONFIG_PREALLOC_WDOGS=8 CONFIG_PTHREAD_STACK_DEFAULT=4096 CONFIG_RAM_SIZE=285212672 CONFIG_RAM_START=0 -CONFIG_RRLOAD_BINARY=y CONFIG_RR_INTERVAL=200 CONFIG_SCHED_HPWORK=y CONFIG_SDCLONE_DISABLE=y diff --git a/boards/arm/stm32/nucleo-f446re/README.txt b/boards/arm/stm32/nucleo-f446re/README.txt index 555f68a188..ef8857f833 100644 --- a/boards/arm/stm32/nucleo-f446re/README.txt +++ b/boards/arm/stm32/nucleo-f446re/README.txt @@ -170,7 +170,6 @@ GNU Toolchain Options the default system x86 tool versions and these seem to work okay. Disable all of the following to avoid using objcopy: - CONFIG_RRLOAD_BINARY=n CONFIG_INTELHEX_BINARY=n CONFIG_MOTOROLA_SREC=n CONFIG_RAW_BINARY=n diff --git a/boards/arm/stm32/nucleo-f4x1re/README.txt b/boards/arm/stm32/nucleo-f4x1re/README.txt index b3fd01f945..22b8947659 100644 --- a/boards/arm/stm32/nucleo-f4x1re/README.txt +++ b/boards/arm/stm32/nucleo-f4x1re/README.txt @@ -193,7 +193,6 @@ GNU Toolchain Options the default system x86 tool versions and these seem to work okay. Disable all of the following to avoid using objcopy: - CONFIG_RRLOAD_BINARY=n CONFIG_INTELHEX_BINARY=n CONFIG_MOTOROLA_SREC=n CONFIG_RAW_BINARY=n diff --git a/boards/arm/stm32l4/nucleo-l432kc/README.txt b/boards/arm/stm32l4/nucleo-l432kc/README.txt index 40b273701a..5f19b4e166 100644 --- a/boards/arm/stm32l4/nucleo-l432kc/README.txt +++ b/boards/arm/stm32l4/nucleo-l432kc/README.txt @@ -163,7 +163,6 @@ GNU Toolchain Options the default system x86 tool versions and these seem to work okay. Disable all of the following to avoid using objcopy: - CONFIG_RRLOAD_BINARY=n CONFIG_INTELHEX_BINARY=n CONFIG_MOTOROLA_SREC=n CONFIG_RAW_BINARY=n diff --git a/boards/arm/stm32l4/nucleo-l476rg/README.txt b/boards/arm/stm32l4/nucleo-l476rg/README.txt index 77e313d118..2ed59074b2 100644 --- a/boards/arm/stm32l4/nucleo-l476rg/README.txt +++ b/boards/arm/stm32l4/nucleo-l476rg/README.txt @@ -176,7 +176,6 @@ GNU Toolchain Options the default system x86 tool versions and these seem to work okay. Disable all of the following to avoid using objcopy: - CONFIG_RRLOAD_BINARY=n CONFIG_INTELHEX_BINARY=n CONFIG_MOTOROLA_SREC=n CONFIG_RAW_BINARY=n diff --git a/tools/Makefile.unix b/tools/Makefile.unix index 67294aa16b..d8acdabbe3 100644 --- a/tools/Makefile.unix +++ b/tools/Makefile.unix @@ -471,13 +471,6 @@ pass2: pass2deps $(Q) if [ -w /tftpboot ] ; then \ cp -f $(BIN) /tftpboot/$(BIN).${CONFIG_ARCH}; \ fi -ifeq ($(CONFIG_RRLOAD_BINARY),y) - @echo "MK: $(NUTTXNAME).rr" - $(Q) $(TOPDIR)/tools/mkimage.sh --Prefix $(CROSSDEV) $(BIN) $(NUTTXNAME).rr - $(Q) if [ -w /tftpboot ] ; then \ - cp -f $(NUTTXNAME).rr /tftpboot/$(NUTTXNAME).rr.$(CONFIG_ARCH); \ - fi -endif ifeq ($(CONFIG_INTELHEX_BINARY),y) @echo "CP: $(NUTTXNAME).hex" $(Q) $(OBJCOPY) $(OBJCOPYARGS) -O ihex $(BIN) $(NUTTXNAME).hex diff --git a/tools/Makefile.win b/tools/Makefile.win index 7c2738a3ee..cca58957d0 100644 --- a/tools/Makefile.win +++ b/tools/Makefile.win @@ -475,10 +475,6 @@ pass2deps: pass2dep $(NUTTXLIBS) pass2: pass2deps $(Q) $(MAKE) -C $(ARCH_SRC) TOPDIR="$(TOPDIR)" EXTRA_OBJS="$(EXTRA_OBJS)" LINKLIBS="$(LINKLIBS)" EXTRADEFINES=$(KDEFINE) $(BIN) -ifeq ($(CONFIG_RRLOAD_BINARY),y) - @echo "MK: $(NUTTXNAME).rr" - $(Q) $(TOPDIR)\tools\mkimage.sh --Prefix $(CROSSDEV) $(BIN) $(NUTTXNAME).rr -endif ifeq ($(CONFIG_INTELHEX_BINARY),y) @echo "CP: $(NUTTXNAME).hex" $(Q) $(OBJCOPY) $(OBJCOPYARGS) -O ihex $(BIN) $(NUTTXNAME).hex diff --git a/tools/README.txt b/tools/README.txt index 230beac369..66cac1fb52 100644 --- a/tools/README.txt +++ b/tools/README.txt @@ -719,11 +719,6 @@ logparser.c logparser _git_log.tmp >_changelog.txt rm -f _git_log.tmp -mkimage.sh ----------- - - The creates a downloadable image as needed with the rrload bootloader. - indent.sh --------- diff --git a/tools/mkimage.sh b/tools/mkimage.sh deleted file mode 100755 index 2338b257a0..0000000000 --- a/tools/mkimage.sh +++ /dev/null @@ -1,289 +0,0 @@ -#!/usr/bin/env bash -# -# File: mkimage.sh -# -# Copyright (C) 2002 RidgeRun, Inc. -# Author: RidgeRun, Inc -# - Adapted for the Cadenux environment, 9-6-02, Gregory Nutt -# - Added --EAddr option, 6-18-03, Gregory Nutt -# -# 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 SOFTWARE IS PROVIDED ``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 AUTHOR 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. -# -# 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., -# 675 Mass Ave, Cambridge, MA 02139, USA. -# -######################################################## -# Description: -# ----------- -# Scenario #1 -# ----------- -# This utility was developed by RidgeRun for the -# purpose of converting a standard binary executable -# image (such as ELF) into a special format (RR -# format) suitable for quick downloads to the target -# TI925 RidgeRun Bootloader (rrload). The image is -# produced by constructing a special header which is -# then tacked onto the front of the supplied binary -# image. The resulting binary image is smaller than -# what would normally be encountered with traditional -# download formats (such as SREC or uuencoded; both -# ascii based). The special header at the front of the -# image is used to guide the target's rrload (a -# booloader developed by RidgeRun Inc). The header -# data contains a field representing the total byte -# count of the binary data following the header as -# well as a field that indicates the load address of -# run image. Additionally, a field exists in the -# header which indicates the image's entry point which -# could be called by the bootloader to invoked the -# just downloaded program. -# ----------- -# Scenario #2 -# ----------- -# If the supplied image is not a standard binary -# executagle image then that is ok too, a header is -# constructed and tacked onto the front of the supplied -# binary data forming the new binary image (in rr format). -# In this case the EntryAddr is set to 0xFFFFFFFF by -# default and the LoadAddr is set to 0x00000000 by -# default unless otherwise indicated by command line -# arguments -LEntry and -LAddr which if used are assumed -# to be in hexidecimal units. -# -# ----------- -# Scenario #3 -# ----------- -# -# Read/Write file system (like JFFS) that will not -# work if rrload stores a 20 byte header at the beginning -# of the flashed component image -# -# mkimage [--NoHeader ] -# -# Usage: -# mkimage [--LAddr h] [--EAddr h] [--NoHeader] -# -# Examples: -# $ mkimage linux linux.rr -# ..or.. -# $ mkimage -LAddr 10008000 -EAddr 10008000 vmlinux vmlinux.rr -# ..or.. -# $ mkimage --NoHeader fileSys.gz fileSys.gz.rr -# ..or.. -# $ mkimage --LAddr A00 fileSys.gz fileSys.gz.rr -# ..or.. -# $ mkimage --LAddr A00 fileSys.gz fileSys.gz.rr -# ^ -# | -# Assumed hex units. -# Please omit the -# leading "0x". -######################################################## - -if [ $# -lt 2 ] ; then - echo "Error: missing argument" - echo "Usage: mkimage [--Prefix prefix] [--LAddr n] [--EAddr n] [--NoHeader] " - exit 1 -fi - -# Pleae Note the following formatting inconsistency. -# (Sorry, for now this is necessary) -LoadAddr="00000000" # Note: hex val *without* proceeding "0x" -EntryAddr="0xFFFFFFFF" # Note: hex val *with* procedding "0x" - -unset prefix -Header="y" -LAddrSupplied="n" -EAddrSupplied="n" -compress="n" - -while [ $# -gt 0 ] ; do - case "$1" in - --Prefix) - shift; - prefix="$1" - shift - ;; - --LAddr ) - shift - LoadAddr="$1" - # Next, make the supplied LAddr exactly 8 hex chars long. - LoadAddr="0000000${LoadAddr}" - LoadAddr=$(echo $LoadAddr | sed -e "s/^.*\(........\)$/\1/g") - LAddrSupplied="y" - shift - ;; - --EAddr ) - shift - EntryAddr="$1" - # Next, make the supplied LEntry exactly 8 hex chars long. - EntryAddr="0000000${EntryAddr}" - EntryAddr=$(echo $EntryAddr | sed -e "s/^.*\(........\)$/\1/g") - EntryAddr=0x$EntryAddr - EAddrSupplied="y" - shift - ;; - --NoHeader ) - Header="n" - shift - ;; - --compress ) - compress="y" - shift - ;; - *) - break - ;; - esac -done - -if [ ! $# -eq 2 ] ; then - echo "Error: invalid argument set." - echo "Usage: mkimage [--LAddr h] " - exit 1 -fi - -binary=$1.stripped -outbin=$2 - -cp $1 $binary -FileTypeExec=$(${prefix}objdump -f $binary 2>/dev/null | egrep "EXEC_P") - -if [ ! -z "$FileTypeExec" ] ; then - - # ----------- - # Scenario #1 - # ----------- - # We have an executable style binary (like ELF, etc). - # So... - # --------------------------------- - # Next | Create the binary image data. - # --------------------------------- - ${prefix}strip ${binary} - ${prefix}objcopy -S -O binary $binary ${binary}.binary - # --------------------------------- - # Next | Create compress image if requested - # --------------------------------- - image_file=${binary}.binary - if [ "$compress" = "y" ] ; then - gzip -f -9 -c ${binary}.binary > ${binary}.binary.gz - image_file=${binary}.binary.gz - fi - # --------------------------------- - # Next | Create the header information (ascii) needed - # | by the TI925 bootloader. This includes the - # | load address, entry address and byte count of - # | the binary executable data which will follow it. - # --------------------------------- - if [ "$LAddrSupplied" = "n" ] ; then - # Next, Since LoadAddr not already supplied by user we'll - # derive it by consulting the binary executable file. - LoadAddr=$(${prefix}objdump -h ${binary} | grep " 0 \.") - LoadAddr=$(echo $LoadAddr | cut -d' ' -f4) # eight hex chars - fi - if [ "$EAddrSupplied" = "n" ] ; then - # Next, Since EntryAddr not already supplied by user we'll - # derive it by consulting the binary executable file. - EntryAddr=$(${prefix}objdump -f ${binary} | grep -i "start") - EntryAddr=$(echo $EntryAddr | cut -d' ' -f3) # eight hex chars - fi - # Next, Compute byte length of binary portion. - numBytes=$(wc --bytes $image_file) - numBytes=$(echo $numBytes | cut -d' ' -f1) - numBytes=$(echo 16o $numBytes p | dc) # converts to hex. - # Next, make the numBytes string exactly 8 hex chars long. - numBytes="0000000${numBytes}" - numBytes=$(echo $numBytes | sed -e "s/^.*\(........\)$/\1/g") - # --------------------------------- - # Next | Combine the ascii header information - # | with the binary image to make the - # | final downloadable *mostly* binary - # | image. - # --------------------------------- - rm -f ${outbin} - echo ">LoadAddr :0x${LoadAddr}" >> ${outbin} - if [ "${Header}" = "y" ]; then - echo ">EntryAddr:${EntryAddr}" >> ${outbin} - else - echo ">NoHeader" >> ${outbin} - fi - echo ">NumBytes :0x${numBytes}" >> ${outbin} - cat $image_file >> ${outbin} - # --------------------------------- - # Cleanup and exit - # --------------------------------- - rm -f ${binary}.binary $image_file - exit 0 - -else - - # ----------- - # Scenario #2 - # ----------- - # Just a binary image but not a standard executable - # style binary (like ELF, etc). Might be a compressed - # filesystem image, etc. - # So... - # --------------------------------- - # Next | Create the header information (ascii) needed - # | by the TI925 bootloader. This includes the - # | load address, entry address and byte count of - # | the binary file which will follow it. - # --------------------------------- - # | Create compress image if requested - # --------------------------------- - # - image_file=${binary} - if [ "$compress" = "y" ] ; then - gzip -f -9 -c ${image_file} > ${image_file}.gz - image_file=${image_file}.gz - fi - # - # Note: The LoadAddr and EntryAddr are already established - # for us at this point, but we will need to compute the - # byte length of binary portion next. - # - numBytes=$(wc --bytes ${image_file}) - numBytes=$(echo $numBytes | cut -d' ' -f1) - numBytes=$(echo 16o $numBytes p | dc) # converts to hex. - # Next, make the numBytes string exactly 8 hex chars long. - numBytes="0000000${numBytes}" - numBytes=$(echo $numBytes | sed -e "s/^.*\(........\)$/\1/g") - # - # --------------------------------- - # Next | Combine the ascii header information - # | with the binary image to make the - # | final downloadable *mostly* binary - # | image. - # --------------------------------- - # - rm -f ${outbin} - echo ">LoadAddr :0x${LoadAddr}" >> ${outbin} - if [ ${Header} = "y" ]; then - echo ">EntryAddr:${EntryAddr}" >> ${outbin} - else - echo ">NoHeader" >> ${outbin} - fi - echo ">NumBytes :0x${numBytes}" >> ${outbin} - cat ${image_file} >> ${outbin} - # --------------------------------- - # Cleanup and exit - # --------------------------------- - rm -f ${image_file}.gz - exit 0 -fi