diff options
author | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-01-05 09:32:23 +0000 |
---|---|---|
committer | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-01-05 09:32:23 +0000 |
commit | a8e12a95fa65b1582871c3e2a7a8a8f584298843 (patch) | |
tree | afe67e49a363edd09e385357ce2238a2b9954252 /src/flash/pic32mx.h | |
parent | 22421a9657ebdd9c87f516741fe44e6cfeb1beed (diff) |
John McCarthy <jgmcc@magma.ca> pic32mx flash fixups and speedups
git-svn-id: svn://svn.berlios.de/openocd/trunk@1301 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/flash/pic32mx.h')
-rw-r--r-- | src/flash/pic32mx.h | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/flash/pic32mx.h b/src/flash/pic32mx.h index 28921f5e..f799a467 100644 --- a/src/flash/pic32mx.h +++ b/src/flash/pic32mx.h @@ -42,22 +42,31 @@ typedef struct pic32mx_flash_bank_s /* pic32mx memory locations */ #define PIC32MX_KUSEG_PGM_FLASH 0x7D000000 -#define PIC32MX_KUSEG_RAM 0x7F000000 +#define PIC32MX_KUSEG_RAM 0x7F000000 -#define PIC32MX_KSEG0_RAM 0x80000000 +#define PIC32MX_KSEG0_RAM 0x80000000 #define PIC32MX_KSEG0_PGM_FLASH 0x9D000000 #define PIC32MX_KSEG0_BOOT_FLASH 0x9FC00000 -#define PIC32MX_KSEG1_RAM 0xA0000000 +#define PIC32MX_KSEG1_RAM 0xA0000000 #define PIC32MX_KSEG1_PGM_FLASH 0xBD000000 #define PIC32MX_KSEG1_PERIPHERAL 0xBF800000 #define PIC32MX_KSEG1_BOOT_FLASH 0xBFC00000 -#define PIC32MX_PHYS_RAM 0x00000000 +#define PIC32MX_PHYS_RAM 0x00000000 #define PIC32MX_PHYS_PGM_FLASH 0x1D000000 #define PIC32MX_PHYS_PERIPHERALS 0x1F800000 #define PIC32MX_PHYS_BOOT_FLASH 0x1FC00000 +/* + * Translate Virtual and Physical addresses. + * Note: These macros only work for KSEG0/KSEG1 addresses. + */ +#define KS1Virt2Phys(vaddr) ((vaddr)-0xA0000000) +#define Phys2KS1Virt(paddr) ((paddr)+0xA0000000) +#define KS0Virt2Phys(vaddr) ((vaddr)-0x80000000) +#define Phys2KS0Virt(paddr) ((paddr)+0x80000000) + /* pic32mx configuration register locations */ #define PIC32MX_DEVCFG0 0xBFC02FFC @@ -77,11 +86,11 @@ typedef struct pic32mx_flash_bank_s #define NVMCON_NVMERR (1<<13) #define NVMCON_LVDERR (1<<12) #define NVMCON_LVDSTAT (1<<11) -#define NVMCON_OP_PFM_ERASE 0x5 +#define NVMCON_OP_PFM_ERASE 0x5 #define NVMCON_OP_PAGE_ERASE 0x4 -#define NVMCON_OP_ROW_PROG 0x3 -#define NVMCON_OP_WORD_PROG 0x1 -#define NVMCON_OP_NOP 0x0 +#define NVMCON_OP_ROW_PROG 0x3 +#define NVMCON_OP_WORD_PROG 0x1 +#define NVMCON_OP_NOP 0x0 #define PIC32MX_NVMKEY 0xBF80F410 #define PIC32MX_NVMADDR 0xBF80F420 |