Skip to content

Commit

Permalink
Add NRF9160 support
Browse files Browse the repository at this point in the history
  • Loading branch information
tothero committed Jun 28, 2019
1 parent 6ea4372 commit b5dd41a
Show file tree
Hide file tree
Showing 9 changed files with 1,975 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[submodule "tools/git2cl"]
path = tools/git2cl
url = http:https://repo.or.cz/r/git2cl.git
url = https:https://github.com/lobaro/git2cl.git
[submodule "jimtcl"]
path = jimtcl
url = http:https://repo.or.cz/r/jimtcl.git
url = https:https://github.com/msteveb/jimtcl.git
[submodule "src/jtag/drivers/libjaylink"]
path = src/jtag/drivers/libjaylink
url = http:https://repo.or.cz/r/libjaylink.git
url = https:https://github.com/lobaro/libjaylink.git
2 changes: 1 addition & 1 deletion src/flash/nor/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ NOR_DRIVERS = \
%D%/mrvlqspi.c \
%D%/niietcm4.c \
%D%/non_cfi.c \
%D%/nrf5.c \
%D%/nrfx.c \
%D%/numicro.c \
%D%/ocl.c \
%D%/pic32mx.c \
Expand Down
4 changes: 4 additions & 0 deletions src/flash/nor/drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ extern const struct flash_driver msp432_flash;
extern const struct flash_driver niietcm4_flash;
extern const struct flash_driver nrf5_flash;
extern const struct flash_driver nrf51_flash;
extern const struct flash_driver nrf52_flash;
extern const struct flash_driver nrf91_flash;
extern const struct flash_driver numicro_flash;
extern const struct flash_driver ocl_flash;
extern const struct flash_driver pic32mx_flash;
Expand Down Expand Up @@ -127,6 +129,8 @@ static const struct flash_driver * const flash_drivers[] = {
&niietcm4_flash,
&nrf5_flash,
&nrf51_flash,
&nrf52_flash,
&nrf91_flash,
&numicro_flash,
&ocl_flash,
&pic32mx_flash,
Expand Down
8 changes: 4 additions & 4 deletions src/flash/nor/esirisc_flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
#endif

#define CONTROL_TIMEOUT 5000 /* 5s */
#define PAGE_SIZE 4096
#define ESIRISC_PAGE_SIZE 4096
#define PB_MAX 32

#define NUM_NS_PER_S 1000000000ULL
Expand Down Expand Up @@ -264,7 +264,7 @@ static int esirisc_flash_erase(struct flash_bank *bank, int first, int last)
(void)esirisc_flash_disable_protect(bank);

for (int page = first; page < last; ++page) {
uint32_t address = page * PAGE_SIZE;
uint32_t address = page * ESIRISC_PAGE_SIZE;

target_write_u32(target, esirisc_info->cfg + ADDRESS, address);

Expand Down Expand Up @@ -464,8 +464,8 @@ static int esirisc_flash_probe(struct flash_bank *bank)
if (target->state != TARGET_HALTED)
return ERROR_TARGET_NOT_HALTED;

bank->num_sectors = bank->size / PAGE_SIZE;
bank->sectors = alloc_block_array(0, PAGE_SIZE, bank->num_sectors);
bank->num_sectors = bank->size / ESIRISC_PAGE_SIZE;
bank->sectors = alloc_block_array(0, ESIRISC_PAGE_SIZE, bank->num_sectors);

retval = esirisc_flash_init(bank);
if (retval != ERROR_OK) {
Expand Down
Loading

0 comments on commit b5dd41a

Please sign in to comment.