diff --git a/Kconfig b/Kconfig index c71394b1acd..77c73411dc9 100644 --- a/Kconfig +++ b/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 diff --git a/configs/spresense/lcd/defconfig b/configs/spresense/lcd/defconfig index 200848042ac..085629160a7 100644 --- a/configs/spresense/lcd/defconfig +++ b/configs/spresense/lcd/defconfig @@ -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 diff --git a/configs/spresense/mpy/defconfig b/configs/spresense/mpy/defconfig index 74dc689357c..3b43d453568 100644 --- a/configs/spresense/mpy/defconfig +++ b/configs/spresense/mpy/defconfig @@ -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 diff --git a/configs/spresense/nsh/defconfig b/configs/spresense/nsh/defconfig index f3264bf4cf7..00d1a5fa3da 100644 --- a/configs/spresense/nsh/defconfig +++ b/configs/spresense/nsh/defconfig @@ -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 diff --git a/configs/spresense/rndis/defconfig b/configs/spresense/rndis/defconfig index 2ebedc41744..0d30d533283 100644 --- a/configs/spresense/rndis/defconfig +++ b/configs/spresense/rndis/defconfig @@ -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 diff --git a/configs/spresense/src/Makefile b/configs/spresense/src/Makefile index a602db996a2..55ea240f8f6 100644 --- a/configs/spresense/src/Makefile +++ b/configs/spresense/src/Makefile @@ -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 diff --git a/configs/spresense/src/cxd56_main.c b/configs/spresense/src/cxd56_main.c new file mode 100644 index 00000000000..0424e1edc9e --- /dev/null +++ b/configs/spresense/src/cxd56_main.c @@ -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 +#include + +/**************************************************************************** + * 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); +} diff --git a/configs/spresense/usbmsc/defconfig b/configs/spresense/usbmsc/defconfig index 0cfeff733bc..0d97b6c680c 100644 --- a/configs/spresense/usbmsc/defconfig +++ b/configs/spresense/usbmsc/defconfig @@ -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 diff --git a/configs/spresense/usbnsh/defconfig b/configs/spresense/usbnsh/defconfig index ef9926e7034..ddb4b5ac214 100644 --- a/configs/spresense/usbnsh/defconfig +++ b/configs/spresense/usbnsh/defconfig @@ -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 diff --git a/configs/spresense/wifi/defconfig b/configs/spresense/wifi/defconfig index 07e4caf7829..b3bfef0baa6 100644 --- a/configs/spresense/wifi/defconfig +++ b/configs/spresense/wifi/defconfig @@ -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 diff --git a/tools/.gitignore b/tools/.gitignore index 5c7facb0dba..a72cda1cfa9 100644 --- a/tools/.gitignore +++ b/tools/.gitignore @@ -20,3 +20,4 @@ /*.dSYM /.k2h-body.dat /.k2h-apndx.dat +/cxd56 \ No newline at end of file diff --git a/tools/Makefile.unix b/tools/Makefile.unix index 32442dae220..eb889627e9a 100644 --- a/tools/Makefile.unix +++ b/tools/Makefile.unix @@ -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) \ diff --git a/tools/Makefile.win b/tools/Makefile.win index 155e096e104..d6a5bce57e9 100644 --- a/tools/Makefile.win +++ b/tools/Makefile.win @@ -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) #