summaryrefslogtreecommitdiffstats
path: root/firmware/zpu
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-01-10 13:36:36 -0800
committerJosh Blum <josh@joshknows.com>2011-01-10 13:36:36 -0800
commitd52cf5e16d6d3769071da4ae23408ddac300beeb (patch)
tree2c467535099e1e5f5e9861eb062abb00d37dce8b /firmware/zpu
parent901bfcbd2bbfe537dead32d08cdf06b7319d9ec6 (diff)
downloaduhd-d52cf5e16d6d3769071da4ae23408ddac300beeb.tar.gz
uhd-d52cf5e16d6d3769071da4ae23408ddac300beeb.tar.bz2
uhd-d52cf5e16d6d3769071da4ae23408ddac300beeb.zip
usrp2: replaced pad argument to gen bins macro with a setting variable, simplifies code
Diffstat (limited to 'firmware/zpu')
-rw-r--r--firmware/zpu/CMakeLists.txt9
-rwxr-xr-x[-rw-r--r--]firmware/zpu/bin/bin_to_ram_macro_init.py0
-rwxr-xr-x[-rw-r--r--]firmware/zpu/bin/sbf.py0
-rw-r--r--firmware/zpu/usrp2/CMakeLists.txt6
-rw-r--r--firmware/zpu/usrp2p/CMakeLists.txt8
-rw-r--r--firmware/zpu/usrp2p/bootloader/CMakeLists.txt3
6 files changed, 17 insertions, 9 deletions
diff --git a/firmware/zpu/CMakeLists.txt b/firmware/zpu/CMakeLists.txt
index 9a32d1834..2df0a6140 100644
--- a/firmware/zpu/CMakeLists.txt
+++ b/firmware/zpu/CMakeLists.txt
@@ -79,7 +79,8 @@ FIND_PROGRAM(HEXDUMP hexdump)
########################################################################
# helper functions to build output formats
########################################################################
-MACRO(GEN_OUTPUTS target pad)
+SET(GEN_OUTPUTS_BIN_SIZE "bin_size_not_set") #set before calling
+MACRO(GEN_OUTPUTS target)
GET_FILENAME_COMPONENT(name ${target} NAME_WE)
#command to create a map from elf
ADD_CUSTOM_COMMAND(
@@ -89,12 +90,14 @@ MACRO(GEN_OUTPUTS target pad)
#command to create a bin from elf
ADD_CUSTOM_COMMAND(
OUTPUT ${name}.bin DEPENDS ${target}
- COMMAND ${OBJCOPY} --pad-to ${pad} -O binary ${target} ${name}.bin
+ COMMAND ${OBJCOPY} -O binary ${target} ${name}.bin
+ --pad-to ${GEN_OUTPUTS_BIN_SIZE}
)
#command to create a ihx from elf
ADD_CUSTOM_COMMAND(
OUTPUT ${name}.ihx DEPENDS ${target}
- COMMAND ${OBJCOPY} --pad-to ${pad} -O ihex ${target} ${name}.ihx
+ COMMAND ${OBJCOPY} -O ihex ${target} ${name}.ihx
+ --pad-to ${GEN_OUTPUTS_BIN_SIZE}
)
#command to create a dump from elf
ADD_CUSTOM_COMMAND(
diff --git a/firmware/zpu/bin/bin_to_ram_macro_init.py b/firmware/zpu/bin/bin_to_ram_macro_init.py
index 085045290..085045290 100644..100755
--- a/firmware/zpu/bin/bin_to_ram_macro_init.py
+++ b/firmware/zpu/bin/bin_to_ram_macro_init.py
diff --git a/firmware/zpu/bin/sbf.py b/firmware/zpu/bin/sbf.py
index 8e2c868a5..8e2c868a5 100644..100755
--- a/firmware/zpu/bin/sbf.py
+++ b/firmware/zpu/bin/sbf.py
diff --git a/firmware/zpu/usrp2/CMakeLists.txt b/firmware/zpu/usrp2/CMakeLists.txt
index db434567d..d126c921c 100644
--- a/firmware/zpu/usrp2/CMakeLists.txt
+++ b/firmware/zpu/usrp2/CMakeLists.txt
@@ -26,10 +26,12 @@ ADD_LIBRARY(libusrp2fw STATIC
)
########################################################################
+SET(GEN_OUTPUTS_BIN_SIZE 0x3fff)
+
ADD_EXECUTABLE(usrp2_txrx_uhd.elf ${CMAKE_SOURCE_DIR}/apps/txrx_uhd.c)
TARGET_LINK_LIBRARIES(usrp2_txrx_uhd.elf libusrp2fw)
-GEN_OUTPUTS(usrp2_txrx_uhd.elf 0x3fff)
+GEN_OUTPUTS(usrp2_txrx_uhd.elf)
ADD_EXECUTABLE(usrp2_blinkenlights.elf ${CMAKE_SOURCE_DIR}/apps/blinkenlights.c)
TARGET_LINK_LIBRARIES(usrp2_blinkenlights.elf libusrp2fw)
-GEN_OUTPUTS(usrp2_blinkenlights.elf 0x3fff)
+GEN_OUTPUTS(usrp2_blinkenlights.elf)
diff --git a/firmware/zpu/usrp2p/CMakeLists.txt b/firmware/zpu/usrp2p/CMakeLists.txt
index f93924bc0..93ccf82c3 100644
--- a/firmware/zpu/usrp2p/CMakeLists.txt
+++ b/firmware/zpu/usrp2p/CMakeLists.txt
@@ -36,14 +36,16 @@ ADD_LIBRARY(libusrp2pfw STATIC
ADD_SUBDIRECTORY(bootloader)
########################################################################
+SET(GEN_OUTPUTS_BIN_SIZE 0x3fff)
+
ADD_EXECUTABLE(usrp2p_txrx_uhd.elf ${CMAKE_SOURCE_DIR}/apps/txrx_uhd.c)
TARGET_LINK_LIBRARIES(usrp2p_txrx_uhd.elf libusrp2pfw)
-GEN_OUTPUTS(usrp2p_txrx_uhd.elf 0x3fff)
+GEN_OUTPUTS(usrp2p_txrx_uhd.elf)
ADD_EXECUTABLE(usrp2p_blinkenlights.elf ${CMAKE_SOURCE_DIR}/apps/blinkenlights.c)
TARGET_LINK_LIBRARIES(usrp2p_blinkenlights.elf libusrp2pfw)
-GEN_OUTPUTS(usrp2p_blinkenlights.elf 0x3fff)
+GEN_OUTPUTS(usrp2p_blinkenlights.elf)
ADD_EXECUTABLE(usrp2p_uart_flash_loader.elf ${CMAKE_SOURCE_DIR}/apps/uart_flash_loader.c)
TARGET_LINK_LIBRARIES(usrp2p_uart_flash_loader.elf libusrp2pfw)
-GEN_OUTPUTS(usrp2p_uart_flash_loader.elf 0x3fff)
+GEN_OUTPUTS(usrp2p_uart_flash_loader.elf)
diff --git a/firmware/zpu/usrp2p/bootloader/CMakeLists.txt b/firmware/zpu/usrp2p/bootloader/CMakeLists.txt
index 26836726d..155915011 100644
--- a/firmware/zpu/usrp2p/bootloader/CMakeLists.txt
+++ b/firmware/zpu/usrp2p/bootloader/CMakeLists.txt
@@ -35,5 +35,6 @@ ENDMACRO(GEN_RMI)
########################################################################
ADD_EXECUTABLE(init_bootloader.elf init_bootloader.c)
TARGET_LINK_LIBRARIES(init_bootloader.elf libusrp2pfw)
-GEN_OUTPUTS(init_bootloader.elf 0x1fff)
+SET(GEN_OUTPUTS_BIN_SIZE 0x1fff)
+GEN_OUTPUTS(init_bootloader.elf)
GEN_RMI(init_bootloader.bin)