mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 08:38:38 +08:00
Merged in alinjerpelea/nuttx (pull request #941)
Mastertools: add spk binary format and entry point for mpy * tools: add spk binary format The .spk binary format is used on spresense and other boards based on the cxd56 arch. to enable this binary format please set in your config CONFIG_CXD56_BINARY=y Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * configs: spresense: buils nuttx.spk images Enable nuttx.spk binary image that can be flashed on spresense board. Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * configs: spresense: add entry point for mpy The entry point is needed for the downstream projects based on spresense. Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
parent
b022435a97
commit
a9be5eb6e7
13 changed files with 96 additions and 0 deletions
7
Kconfig
7
Kconfig
|
@ -281,6 +281,13 @@ config RRLOAD_BINARY
|
|||
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
|
||||
---help---
|
||||
Create nuttx.spk binary format used on spresense board and boards
|
||||
based on cxd56xx arch.
|
||||
|
||||
config INTELHEX_BINARY
|
||||
bool "Intel HEX binary format"
|
||||
default n
|
||||
|
|
|
@ -26,6 +26,7 @@ CONFIG_COMPOSITE_MSFT_OS_DESCRIPTORS=y
|
|||
CONFIG_COMPOSITE_PRODUCTID=0x0bc2
|
||||
CONFIG_COMPOSITE_VENDORID=0x054c
|
||||
CONFIG_COMPOSITE_VENDORSTR="Sony"
|
||||
CONFIG_CXD56_BINARY=y
|
||||
CONFIG_CXD56_DMAC_SPI4_RX=y
|
||||
CONFIG_CXD56_DMAC_SPI4_TX=y
|
||||
CONFIG_CXD56_I2C0=y
|
||||
|
|
|
@ -19,6 +19,7 @@ CONFIG_BOARD_LOOPSPERMSEC=5434
|
|||
CONFIG_BOOT_RUNFROMISRAM=y
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_CLOCK_MONOTONIC=y
|
||||
CONFIG_CXD56_BINARY=y
|
||||
CONFIG_CXD56_ADC=y
|
||||
CONFIG_CXD56_CISIF=y
|
||||
CONFIG_CXD56_HPADC0=y
|
||||
|
|
|
@ -17,6 +17,7 @@ CONFIG_BOARD_LOOPSPERMSEC=5434
|
|||
CONFIG_BOOT_RUNFROMISRAM=y
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_CLOCK_MONOTONIC=y
|
||||
CONFIG_CXD56_BINARY=y
|
||||
CONFIG_CXD56_I2C0=y
|
||||
CONFIG_CXD56_I2C=y
|
||||
CONFIG_CXD56_SPI4=y
|
||||
|
|
|
@ -21,6 +21,7 @@ CONFIG_BOOT_RUNFROMISRAM=y
|
|||
CONFIG_BUILTIN=y
|
||||
CONFIG_CLOCK_MONOTONIC=y
|
||||
CONFIG_CODECS_HASH_MD5=y
|
||||
CONFIG_CXD56_BINARY=y
|
||||
CONFIG_CXD56_SDIO=y
|
||||
CONFIG_CXD56_USBDEV=y
|
||||
CONFIG_DEBUG_FULLOPT=y
|
||||
|
|
|
@ -39,6 +39,7 @@ DEPPATH = --dep-path .
|
|||
ASRCS =
|
||||
CSRCS =
|
||||
|
||||
CSRCS += cxd56_main.c
|
||||
CSRCS += cxd56_boot.c
|
||||
CSRCS += cxd56_clock.c
|
||||
CSRCS += cxd56_bringup.c
|
||||
|
|
56
configs/spresense/src/cxd56_main.c
Normal file
56
configs/spresense/src/cxd56_main.c
Normal file
|
@ -0,0 +1,56 @@
|
|||
/****************************************************************************
|
||||
* bsp/board/spresense/src/spresense_main.c
|
||||
*
|
||||
* Copyright 2018 Sony Semiconductor Solutions Corporation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. 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.
|
||||
* 3. Neither the name of Sony Semiconductor Solutions Corporation 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/compiler.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/* This function is provided outside exported SDK, therefore here is defined
|
||||
* as weak symbol to avoid link error.
|
||||
*/
|
||||
|
||||
int nsh_main(int argc, char *argv[]);
|
||||
|
||||
int weak_function spresense_main(int argc, char *argv[])
|
||||
{
|
||||
return nsh_main(argc, argv);
|
||||
}
|
|
@ -26,6 +26,7 @@ CONFIG_COMPOSITE_MSFT_OS_DESCRIPTORS=y
|
|||
CONFIG_COMPOSITE_PRODUCTID=0x0bc2
|
||||
CONFIG_COMPOSITE_VENDORID=0x054c
|
||||
CONFIG_COMPOSITE_VENDORSTR="Sony"
|
||||
CONFIG_CXD56_BINARY=y
|
||||
CONFIG_CXD56_I2C0=y
|
||||
CONFIG_CXD56_I2C=y
|
||||
CONFIG_CXD56_SDIO=y
|
||||
|
|
|
@ -19,6 +19,7 @@ CONFIG_BOARD_LOOPSPERMSEC=5434
|
|||
CONFIG_BOOT_RUNFROMISRAM=y
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_CLOCK_MONOTONIC=y
|
||||
CONFIG_CXD56_BINARY=y
|
||||
CONFIG_CXD56_I2C0=y
|
||||
CONFIG_CXD56_I2C=y
|
||||
CONFIG_CXD56_SDIO=y
|
||||
|
|
|
@ -20,6 +20,7 @@ CONFIG_BOOT_RUNFROMISRAM=y
|
|||
CONFIG_BUILTIN=y
|
||||
CONFIG_CLOCK_MONOTONIC=y
|
||||
CONFIG_CODECS_HASH_MD5=y
|
||||
CONFIG_CXD56_BINARY=y
|
||||
CONFIG_CXD56_DMAC_SPI5_RX=y
|
||||
CONFIG_CXD56_DMAC_SPI5_TX=y
|
||||
CONFIG_CXD56_SDIO=y
|
||||
|
|
1
tools/.gitignore
vendored
1
tools/.gitignore
vendored
|
@ -20,3 +20,4 @@
|
|||
/*.dSYM
|
||||
/.k2h-body.dat
|
||||
/.k2h-apndx.dat
|
||||
/cxd56
|
|
@ -442,6 +442,18 @@ ifeq ($(CONFIG_RAW_BINARY),y)
|
|||
@echo "CP: $(NUTTXNAME).bin"
|
||||
$(Q) $(OBJCOPY) $(OBJCOPYARGS) -O binary $(BIN) $(NUTTXNAME).bin
|
||||
endif
|
||||
ifeq ($(CONFIG_CXD56_BINARY),y)
|
||||
$(Q) if [ ! -f "tools/cxd56/mkspk" ] ; then \
|
||||
echo ""; \
|
||||
echo "Please run the following command to clone the needed tools"; \
|
||||
echo "git clone https://github.com/sonydevworld/cxd56/ tools/cxd56"; \
|
||||
echo ""; \
|
||||
echo "run make again to create the nuttx.spk image."; \
|
||||
else \
|
||||
echo "Generating: $(NUTTXNAME).spk"; \
|
||||
tools/cxd56/mkspk -c2 nuttx nuttx nuttx.spk; \
|
||||
fi
|
||||
endif
|
||||
ifeq ($(CONFIG_UBOOT_UIMAGE),y)
|
||||
@echo "MKIMAGE: uImage"
|
||||
$(Q) mkimage -A $(CONFIG_ARCH) -O linux -C none -T kernel -a $(CONFIG_UIMAGE_LOAD_ADDRESS) \
|
||||
|
|
|
@ -451,6 +451,18 @@ ifeq ($(CONFIG_RAW_BINARY),y)
|
|||
@echo "CP: $(NUTTXNAME).bin"
|
||||
$(Q) $(OBJCOPY) $(OBJCOPYARGS) -O binary $(BIN) $(NUTTXNAME).bin
|
||||
endif
|
||||
ifeq ($(CONFIG_CXD56_BINARY),y)
|
||||
$(Q) if [ ! -f "tools/cxd56/mkspk.exe" ] ; then \
|
||||
echo ""; \
|
||||
echo "Please run the following command to clone the needed tools"; \
|
||||
echo "git clone https://github.com/sonydevworld/cxd56/ tools\cxd56"; \
|
||||
echo ""; \
|
||||
echo "run make again to create the nuttx.spk image."; \
|
||||
else \
|
||||
echo "Generating: $(NUTTXNAME).spk"; \
|
||||
tools\cxd56\mkspk.exe -c2 nuttx nuttx nuttx.spk; \
|
||||
fi
|
||||
endif
|
||||
|
||||
# $(BIN)
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue