- added new device to luminary flash driver
[openocd.git] / src / flash / stellaris.c
index 502659e3f21065e1e7269a8cbe610d7718132a43..ecdf686d558efd5ef471cd0374a9bcb73dbb0377 100644 (file)
@@ -74,7 +74,6 @@ flash_driver_t stellaris_flash =
        .info = stellaris_info
 };
 
-
 struct {
        u32 partno;
        char *partname;
@@ -82,6 +81,11 @@ struct {
 {
        {0x01,"LM3S101"},
        {0x02,"LM3S102"},
+       {0x03,"LM3S1625"},
+       {0x04,"LM3S1626"},
+       {0x05,"LM3S1627"},
+       {0x06,"LM3S1607"},
+       {0x10,"LM3S1776"},
        {0x19,"LM3S300"},
        {0x11,"LM3S301"},
        {0x12,"LM3S310"},
@@ -107,10 +111,20 @@ struct {
        {0x39,"LM3S808"},
        {0x32,"LM3S811"},
        {0x33,"LM3S812"},
+       /*{0x33,"LM3S2616"},*/
        {0x34,"LM3S815"},
        {0x36,"LM3S817"},
        {0x37,"LM3S818"},
        {0x35,"LM3S828"},
+       {0x39,"LM3S2276"},
+       {0x3A,"LM3S2776"},
+       {0x43,"LM3S3651"},
+       {0x44,"LM3S3739"},
+       {0x45,"LM3S3749"},
+       {0x46,"LM3S3759"},
+       {0x48,"LM3S3768"},
+       {0x49,"LM3S3748"},
+       {0x50,"LM3S2678"},
        {0x51,"LM3S2110"},
        {0x52,"LM3S2739"},
        {0x53,"LM3S2651"},
@@ -134,6 +148,8 @@ struct {
        {0x76,"LM3S6537"},
        {0x77,"LM3S6753"},
        {0x78,"LM3S6952"},
+       {0x80,"LM3S2671"},
+       {0x81,"LM3S5632"},
        {0x82,"LM3S6422"},
        {0x83,"LM3S6633"},
        {0x84,"LM3S2139"},
@@ -141,17 +157,30 @@ struct {
        {0x86,"LM3S8738"},
        {0x88,"LM3S8938"},
        {0x89,"LM3S6938"},
+       {0x8A,"LM3S5652"},
        {0x8B,"LM3S6637"},
        {0x8C,"LM3S8933"},
        {0x8D,"LM3S8733"},
        {0x8E,"LM3S8538"},
        {0x8F,"LM3S2948"},
+       {0x91,"LM3S5662"},
+       {0x96,"LM3S5732"},
+       {0x97,"LM3S5737"},
+       {0x99,"LM3S5747"},
+       {0x9A,"LM3S5752"},
+       {0x9B,"LM3S5757"},
+       {0x9C,"LM3S5762"},
+       {0x9D,"LM3S5767"},
+       {0xA0,"LM3S5739"},
        {0xA1,"LM3S6100"},
        {0xA2,"LM3S2410"},
        {0xA3,"LM3S6730"},
        {0xA4,"LM3S2730"},
        {0xA5,"LM3S6420"},
        {0xA6,"LM3S8962"},
+       {0xA7,"LM3S5749"},
+       {0xA8,"LM3S5769"},
+       {0xA9,"LM3S5768"},
        {0xB3,"LM3S1635"},
        {0xB4,"LM3S1850"},
        {0xB5,"LM3S1960"},
@@ -201,10 +230,13 @@ struct {
        {0,"Unknown part"}
 };
 
-char * StellarisClassname[2] =
+char * StellarisClassname[5] =
 {
        "Sandstorm",
-       "Fury"
+       "Fury",
+       "Unknown",
+       "DustDevil",
+       "Tempest"
 };
 
 /***************************************************************************
@@ -387,7 +419,6 @@ u32 stellaris_wait_status_busy(flash_bank_t *bank, u32 waitbits, int timeout)
        return status;
 }
 
-
 /* Send one command to the flash controller */
 int stellaris_flash_command(struct flash_bank_s *bank,u8 cmd,u16 pagen) 
 {
@@ -425,7 +456,7 @@ int stellaris_read_part_info(struct flash_bank_s *bank)
        if((ver != 0) && (ver != 1))
        {
                LOG_WARNING("Unknown did0 version, cannot identify target");
-               return ERROR_FLASH_OPERATION_FAILED;    
+               return ERROR_FLASH_OPERATION_FAILED;
        }
 
        if (did1 == 0)
@@ -607,6 +638,8 @@ int stellaris_erase(struct flash_bank_s *bank, int first, int last)
                        target_write_u32(target, FLASH_CRIS, 0);
                        return ERROR_FLASH_OPERATION_FAILED;
                }
+               
+               bank->sectors[banknr].is_erased = 1;
        }
 
        return ERROR_OK;
@@ -642,11 +675,11 @@ int stellaris_protect(struct flash_bank_s *bank, int set, int first, int last)
        }
        
        /* Configure the flash controller timing */
-       stellaris_read_clock_info(bank);        
+       stellaris_read_clock_info(bank);
        stellaris_set_flash_mode(bank,0);
 
-       fmppe = stellaris_info->lockbits;       
-       for (lockregion=first;lockregion<=last;lockregion++) 
+       fmppe = stellaris_info->lockbits;
+       for (lockregion=first;lockregion<=last;lockregion++)
        {
                if (set)
                         fmppe &= ~(1<<lockregion); 
@@ -719,7 +752,8 @@ u8 stellaris_write_code[] =
        0x04,0x36,                      /* adds r6, r6, #4 */
        0x96,0x42,                      /* cmp  r6, r2 */
        0xF4,0xD1,                      /* bne  mainloop */
-       0x00,0xBE,                      /* bkpt #0 */
+                                               /* exit: */
+       0xFE,0xE7,                      /* b exit */
 /* pFLASH_CTRL_BASE: */
        0x00,0xD0,0x0F,0x40,    /* .word        0x400FD000 */
 /* FLASHWRITECMD: */
@@ -768,7 +802,6 @@ int stellaris_write_block(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32
        
        armv7m_info.common_magic = ARMV7M_COMMON_MAGIC;
        armv7m_info.core_mode = ARMV7M_MODE_ANY;
-       armv7m_info.core_state = ARMV7M_STATE_THUMB;
        
        init_reg_param(&reg_params[0], "r0", 32, PARAM_OUT);
        init_reg_param(&reg_params[1], "r1", 32, PARAM_OUT);
@@ -894,9 +927,7 @@ int stellaris_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count
                        count = 0;
                }
        }
-
-
-
+       
        while(count>0)
        {
                if (!(address&0xff)) LOG_DEBUG("0x%x",address);
@@ -925,7 +956,6 @@ int stellaris_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count
        return ERROR_OK;
 }
 
-
 int stellaris_probe(struct flash_bank_s *bank)
 {
        /* we can't probe on an stellaris

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)