ARM11: remove unused state and exports
authorDavid Brownell <dbrownell@users.sourceforge.net>
Sun, 22 Nov 2009 23:51:16 +0000 (15:51 -0800)
committerDavid Brownell <dbrownell@users.sourceforge.net>
Sun, 22 Nov 2009 23:51:16 +0000 (15:51 -0800)
For now there's no point in saving this stuff after examine()
checks it out as OK.  Ditto exporting symbols that aren't
used outside of the module which defines them.  In fact, those
two things needlessly complicate the code...

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
src/target/arm11.c
src/target/arm11.h
src/target/arm11_dbgtap.c
src/target/arm11_dbgtap.h

index 0a54c522071b03bb900da5d8cfef811fc0e75141..cb1af7bf1fb42ba99de8b0369f0bff643db5d1e9 100644 (file)
@@ -385,7 +385,7 @@ static int arm11_on_enter_debug_state(struct arm11_common *arm11)
        return ERROR_OK;
 }
 
-void arm11_dump_reg_changes(struct arm11_common * arm11)
+static void arm11_dump_reg_changes(struct arm11_common * arm11)
 {
 
        if (!(debug_level >= LOG_LVL_DEBUG))
@@ -1680,6 +1680,8 @@ static int arm11_examine(struct target *target)
        int retval;
        char *type;
        struct arm11_common *arm11 = target_to_arm11(target);
+       uint32_t didr, device_id;
+       uint8_t implementor;
 
        /* check IDCODE */
 
@@ -1687,7 +1689,7 @@ static int arm11_examine(struct target *target)
 
        struct scan_field               idcode_field;
 
-       arm11_setup_field(arm11, 32, NULL, &arm11->device_id, &idcode_field);
+       arm11_setup_field(arm11, 32, NULL, &device_id, &idcode_field);
 
        arm11_add_dr_scan_vc(1, &idcode_field, TAP_DRPAUSE);
 
@@ -1699,14 +1701,14 @@ static int arm11_examine(struct target *target)
 
        struct scan_field               chain0_fields[2];
 
-       arm11_setup_field(arm11, 32, NULL,      &arm11->didr,           chain0_fields + 0);
-       arm11_setup_field(arm11,  8, NULL,      &arm11->implementor,    chain0_fields + 1);
+       arm11_setup_field(arm11, 32, NULL, &didr, chain0_fields + 0);
+       arm11_setup_field(arm11,  8, NULL, &implementor, chain0_fields + 1);
 
        arm11_add_dr_scan_vc(ARRAY_SIZE(chain0_fields), chain0_fields, TAP_IDLE);
 
        CHECK_RETVAL(jtag_execute_queue());
 
-       switch (arm11->device_id & 0x0FFFF000)
+       switch (device_id & 0x0FFFF000)
        {
        case 0x07B36000:
                type = "ARM1136";
@@ -1724,26 +1726,25 @@ static int arm11_examine(struct target *target)
        }
        LOG_INFO("found %s", type);
 
-       arm11->debug_version = (arm11->didr >> 16) & 0x0F;
-
-       if (arm11->debug_version != ARM11_DEBUG_V6 &&
-               arm11->debug_version != ARM11_DEBUG_V61)
-       {
-               LOG_ERROR("Only ARMv6 v6 and v6.1 architectures supported.");
+       /* unlikely this could ever fail, but ... */
+       switch ((didr >> 16) & 0x0F) {
+       case ARM11_DEBUG_V6:
+       case ARM11_DEBUG_V61:           /* supports security extensions */
+               break;
+       default:
+               LOG_ERROR("Only ARM v6 and v6.1 debug supported.");
                return ERROR_FAIL;
        }
 
-       arm11->brp      = ((arm11->didr >> 24) & 0x0F) + 1;
-       arm11->wrp      = ((arm11->didr >> 28) & 0x0F) + 1;
+       arm11->brp = ((didr >> 24) & 0x0F) + 1;
+       arm11->wrp = ((didr >> 28) & 0x0F) + 1;
 
        /** \todo TODO: reserve one brp slot if we allow breakpoints during step */
        arm11->free_brps = arm11->brp;
        arm11->free_wrps = arm11->wrp;
 
-       LOG_DEBUG("IDCODE %08" PRIx32 " IMPLEMENTOR %02x DIDR %08" PRIx32 "",
-               arm11->device_id,
-               (int)(arm11->implementor),
-               arm11->didr);
+       LOG_DEBUG("IDCODE %08" PRIx32 " IMPLEMENTOR %02x DIDR %08" PRIx32,
+                       device_id, implementor, didr);
 
        /* as a side-effect this reads DSCR and thus
         * clears the ARM11_DSCR_STICKY_PRECISE_DATA_ABORT / Sticky Precise Data Abort Flag
index 3d7841d5b39b56a27ed0c40d0a6511ec608e7998..d40faa4faa68dd1cedc97fc0fa7b38a0af2a1577 100644 (file)
@@ -62,15 +62,9 @@ struct arm11_common
        /** \name Processor type detection */
        /*@{*/
 
-       uint32_t                device_id;              /**< IDCODE readout                             */
-       uint32_t                didr;                   /**< DIDR readout (debug capabilities)  */
-       uint8_t         implementor;    /**< DIDR Implementor readout           */
-
        size_t  brp;                    /**< Number of Breakpoint Register Pairs from DIDR      */
        size_t  wrp;                    /**< Number of Watchpoint Register Pairs from DIDR      */
 
-       enum arm11_debug_version
-               debug_version;          /**< ARM debug architecture from DIDR   */
        /*@}*/
 
        uint32_t                last_dscr;              /**< Last retrieved DSCR value;
index 26de4ceb2f8bdd7da36d664f2cfb74667697a296..c8d5902fbcdf448fb2704623157de77145f928b5 100644 (file)
@@ -48,7 +48,8 @@ static const tap_state_t arm11_move_pi_to_si_via_ci[] =
 };
 
 
-int arm11_add_ir_scan_vc(int num_fields, struct scan_field *fields, tap_state_t state)
+static int arm11_add_ir_scan_vc(int num_fields, struct scan_field *fields,
+               tap_state_t state)
 {
        if (cmd_queue_cur_state == TAP_IRPAUSE)
                jtag_add_pathmove(ARRAY_SIZE(arm11_move_pi_to_si_via_ci), arm11_move_pi_to_si_via_ci);
@@ -201,7 +202,8 @@ int arm11_add_debug_SCAN_N(struct arm11_common * arm11, uint8_t chain, tap_state
  *
  * \remarks                    This adds to the JTAG command queue but does \em not execute it.
  */
-void arm11_add_debug_INST(struct arm11_common * arm11, uint32_t inst, uint8_t * flag, tap_state_t state)
+static void arm11_add_debug_INST(struct arm11_common * arm11,
+               uint32_t inst, uint8_t * flag, tap_state_t state)
 {
        JTAG_DEBUG("INST <= 0x%08x", inst);
 
@@ -377,7 +379,9 @@ int arm11_run_instr_data_finish(struct arm11_common * arm11)
  * \param count                Number of opcodes to execute
  *
  */
-int arm11_run_instr_no_data(struct arm11_common * arm11, uint32_t * opcode, size_t count)
+static
+int arm11_run_instr_no_data(struct arm11_common * arm11,
+               uint32_t * opcode, size_t count)
 {
        arm11_add_IR(arm11, ARM11_ITRSEL, ARM11_TAP_DEFAULT);
 
index 87b66a5065b6d06780073f2d6d3c16c613daee26..b85a138cfa220837692a800b2cbe792a77bb7300 100644 (file)
@@ -11,8 +11,6 @@ void arm11_add_IR(struct arm11_common *arm11,
                uint8_t instr, tap_state_t state);
 int arm11_add_debug_SCAN_N(struct arm11_common *arm11,
                uint8_t chain, tap_state_t state);
-void arm11_add_debug_INST(struct arm11_common *arm11,
-               uint32_t inst, uint8_t *flag, tap_state_t state);
 int arm11_read_DSCR(struct arm11_common *arm11, uint32_t *dscr);
 int arm11_write_DSCR(struct arm11_common *arm11, uint32_t dscr);
 
@@ -20,8 +18,6 @@ enum target_debug_reason arm11_get_DSCR_debug_reason(uint32_t dscr);
 
 int arm11_run_instr_data_prepare(struct arm11_common *arm11);
 int arm11_run_instr_data_finish(struct arm11_common *arm11);
-int arm11_run_instr_no_data(struct arm11_common *arm11,
-               uint32_t *opcode, size_t count);
 int arm11_run_instr_no_data1(struct arm11_common *arm11, uint32_t opcode);
 int arm11_run_instr_data_to_core(struct arm11_common *arm11,
                uint32_t opcode, uint32_t *data, size_t count);
@@ -38,8 +34,6 @@ int arm11_run_instr_data_to_core_via_r0(struct arm11_common *arm11,
 
 int arm11_add_dr_scan_vc(int num_fields, struct scan_field *fields,
                tap_state_t state);
-int arm11_add_ir_scan_vc(int num_fields, struct scan_field *fields,
-               tap_state_t state);
 
 /**
  * Used with arm11_sc7_run to make a list of read/write commands for

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)