aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/usrp3
diff options
context:
space:
mode:
authorAshish Chaudhari <ashish@ettus.com>2015-12-23 17:25:49 -0800
committerAshish Chaudhari <ashish@ettus.com>2016-01-05 17:35:14 -0800
commite5880e648ca28067df5c38b8b905350848c63c27 (patch)
tree2809e92b36dbdb687d647038d5f7e8bfbc2c7034 /firmware/usrp3
parente92913f81a8a44def64dfcb7c0001d9ca7d2d2c4 (diff)
downloaduhd-e5880e648ca28067df5c38b8b905350848c63c27.tar.gz
uhd-e5880e648ca28067df5c38b8b905350848c63c27.tar.bz2
uhd-e5880e648ca28067df5c38b8b905350848c63c27.zip
n230: Increased FW size to 8192
- Updated to X300 bootloader
Diffstat (limited to 'firmware/usrp3')
-rw-r--r--firmware/usrp3/include/wb_soft_reg.h16
-rw-r--r--firmware/usrp3/n230/CMakeLists.txt2
-rwxr-xr-xfirmware/usrp3/n230/n230_debug.py24
3 files changed, 19 insertions, 23 deletions
diff --git a/firmware/usrp3/include/wb_soft_reg.h b/firmware/usrp3/include/wb_soft_reg.h
index df23eed83..cbfc311bb 100644
--- a/firmware/usrp3/include/wb_soft_reg.h
+++ b/firmware/usrp3/include/wb_soft_reg.h
@@ -55,7 +55,7 @@ typedef struct
* - wr_addr: The address used to flush the register to HW
* - rd_addr: The address used to read the register from HW
*/
-inline void initialize_readwrite_soft_reg(soft_reg_t* reg, uint32_t wr_addr, uint32_t rd_addr)
+static inline void initialize_readwrite_soft_reg(soft_reg_t* reg, uint32_t wr_addr, uint32_t rd_addr)
{
reg->wr_addr = wr_addr;
reg->rd_addr = rd_addr;
@@ -68,7 +68,7 @@ inline void initialize_readwrite_soft_reg(soft_reg_t* reg, uint32_t wr_addr, uin
* - reg: Pointer to the soft_reg struct
* - addr: The address used to flush the register to HW
*/
-inline void initialize_writeonly_soft_reg(soft_reg_t* reg, uint32_t addr)
+static inline void initialize_writeonly_soft_reg(soft_reg_t* reg, uint32_t addr)
{
reg->wr_addr = addr;
reg->rd_addr = 0;
@@ -80,7 +80,7 @@ inline void initialize_writeonly_soft_reg(soft_reg_t* reg, uint32_t addr)
* Performs a read-modify-write operation so all other field are preserved.
* NOTE: This does not write the value to hardware.
*/
-inline void soft_reg_set(soft_reg_t* reg, const soft_reg_field_t field, const uint32_t field_value)
+static inline void soft_reg_set(soft_reg_t* reg, const soft_reg_field_t field, const uint32_t field_value)
{
const uint32_t mask = ((1<<field.num_bits)-1)<<field.shift;
reg->soft_copy = (reg->soft_copy & ~mask) | ((field_value << field.shift) & mask);
@@ -89,7 +89,7 @@ inline void soft_reg_set(soft_reg_t* reg, const soft_reg_field_t field, const ui
/*!
* Write the contents of the soft-copy to hardware.
*/
-inline void soft_reg_flush(const soft_reg_t* reg)
+static inline void soft_reg_flush(const soft_reg_t* reg)
{
wb_poke32(reg->wr_addr, reg->soft_copy);
}
@@ -97,7 +97,7 @@ inline void soft_reg_flush(const soft_reg_t* reg)
/*!
* Shortcut for a set and a flush.
*/
-inline void soft_reg_write(soft_reg_t* reg, const soft_reg_field_t field, const uint32_t field_value)
+static inline void soft_reg_write(soft_reg_t* reg, const soft_reg_field_t field, const uint32_t field_value)
{
soft_reg_set(reg, field, field_value);
soft_reg_flush(reg);
@@ -107,7 +107,7 @@ inline void soft_reg_write(soft_reg_t* reg, const soft_reg_field_t field, const
* Get the value of the specified field from the soft-copy.
* NOTE: This does not read anything from hardware.
*/
-inline uint32_t soft_reg_get(const soft_reg_t* reg, const soft_reg_field_t field)
+static inline uint32_t soft_reg_get(const soft_reg_t* reg, const soft_reg_field_t field)
{
const uint32_t mask = ((1<<field.num_bits)-1)<<field.shift;
return (reg->soft_copy & mask) >> field.shift;
@@ -116,7 +116,7 @@ inline uint32_t soft_reg_get(const soft_reg_t* reg, const soft_reg_field_t field
/*!
* Read the contents of the register from hardware and update the soft copy.
*/
-inline void soft_reg_refresh(soft_reg_t* reg)
+static inline void soft_reg_refresh(soft_reg_t* reg)
{
if (reg->rd_addr) {
reg->soft_copy = wb_peek32(reg->rd_addr);
@@ -126,7 +126,7 @@ inline void soft_reg_refresh(soft_reg_t* reg)
/*!
* Shortcut for refresh and get
*/
-inline uint32_t soft_reg_read(soft_reg_t* reg, const soft_reg_field_t field)
+static inline uint32_t soft_reg_read(soft_reg_t* reg, const soft_reg_field_t field)
{
soft_reg_refresh(reg);
return soft_reg_get(reg, field);
diff --git a/firmware/usrp3/n230/CMakeLists.txt b/firmware/usrp3/n230/CMakeLists.txt
index e473b2b6c..327b68910 100644
--- a/firmware/usrp3/n230/CMakeLists.txt
+++ b/firmware/usrp3/n230/CMakeLists.txt
@@ -22,7 +22,7 @@ include_directories(${CMAKE_SOURCE_DIR}/../../host/lib/usrp/n230)
list(APPEND n230_sources n230_eeprom.c n230_eth_handlers.c n230_init.c n230_main.c)
########################################################################
-set(GEN_OUTPUTS_BIN_SIZE 0x3fff)
+set(GEN_OUTPUTS_BIN_SIZE 0x7fff)
add_executable(n230_main.elf ${n230_sources})
target_link_libraries(n230_main.elf usrp3fw)
diff --git a/firmware/usrp3/n230/n230_debug.py b/firmware/usrp3/n230/n230_debug.py
index 41772168b..7b9944672 100755
--- a/firmware/usrp3/n230/n230_debug.py
+++ b/firmware/usrp3/n230/n230_debug.py
@@ -52,8 +52,9 @@ N230_FW_COMMS_ERR_SIZE_ERROR = 0x20000000
N230_FW_COMMS_ID = 0x0001ACE3
-N230_FW_LOADER_BASE_ADDR = 0x4000
-N230_FW_LOADER_CHUNK_SIZE = 16
+N230_FW_LOADER_ADDR = 0xfa00
+N230_FW_LOADER_DATA = 0xfa04
+N230_FW_LOADER_NUM_WORDS = 8192
N230_FW_LOADER_BOOT_DONE_ADDR = 0xA004
N230_FW_LOADER_BOOT_TIMEOUT = 5
@@ -247,18 +248,13 @@ class ctrl_socket(object):
coe_lines = [line.strip(',;\n ') for line in coe_file]
start_index = coe_lines.index("memory_initialization_vector=") + 1
coe_words = coe_lines[start_index:]
- for i in range(0, len(coe_words), N230_FW_LOADER_CHUNK_SIZE):
- data_chunk = coe_words[i:i+(N230_FW_LOADER_CHUNK_SIZE)]
- data = [0] * N230_FW_COMMS_MAX_DATA_WORDS
- for j in range(len(data_chunk)):
- data[j] = int(data_chunk[j], 16)
- out_pkt = pack_fw_command(
- N230_FW_COMMS_CMD_BLOCK_POKE32|N230_FW_COMMS_FLAGS_ACK,
- seq(), len(data_chunk), N230_FW_LOADER_BASE_ADDR+(i*4), data)
- in_pkt = self.send_and_recv(out_pkt)
- (flags, ack_seq, block_size, addr, data) = unpack_fw_command(in_pkt)
- draw_progress_bar(((i+N230_FW_LOADER_CHUNK_SIZE)*100)/len(coe_words))
- print("\nBooting...")
+ if len(coe_words) != N230_FW_LOADER_NUM_WORDS:
+ raise Exception("invalid COE file. Must contain 8192 words!")
+ self.poke(N230_FW_LOADER_ADDR, 0) #Load start address
+ for i in range(0, len(coe_words)):
+ self.poke(N230_FW_LOADER_DATA, int(coe_words[i],16), (i<len(coe_words)-1))
+ draw_progress_bar(((i+1)*100)/len(coe_words))
+ print("\nRebooting...")
out_pkt = pack_fw_command(N230_FW_COMMS_CMD_POKE32, seq(), 1, N230_FW_LOADER_BOOT_DONE_ADDR, [1])
self._sock.send(out_pkt)
self._sock.settimeout(1)