You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(75) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(70) |
Feb
(20) |
Mar
(52) |
Apr
(149) |
May
(387) |
Jun
(466) |
Jul
(133) |
Aug
(87) |
Sep
(122) |
Oct
(140) |
Nov
(185) |
Dec
(105) |
2010 |
Jan
(85) |
Feb
(45) |
Mar
(75) |
Apr
(17) |
May
(41) |
Jun
(52) |
Jul
(33) |
Aug
(29) |
Sep
(36) |
Oct
(15) |
Nov
(26) |
Dec
(34) |
2011 |
Jan
(26) |
Feb
(25) |
Mar
(26) |
Apr
(29) |
May
(20) |
Jun
(27) |
Jul
(15) |
Aug
(32) |
Sep
(13) |
Oct
(64) |
Nov
(60) |
Dec
(10) |
2012 |
Jan
(64) |
Feb
(63) |
Mar
(39) |
Apr
(43) |
May
(54) |
Jun
(11) |
Jul
(30) |
Aug
(45) |
Sep
(11) |
Oct
(70) |
Nov
(24) |
Dec
(23) |
2013 |
Jan
(17) |
Feb
(8) |
Mar
(35) |
Apr
(40) |
May
(20) |
Jun
(24) |
Jul
(36) |
Aug
(25) |
Sep
(42) |
Oct
(40) |
Nov
(9) |
Dec
(21) |
2014 |
Jan
(29) |
Feb
(24) |
Mar
(60) |
Apr
(22) |
May
(22) |
Jun
(46) |
Jul
(11) |
Aug
(23) |
Sep
(26) |
Oct
(10) |
Nov
(14) |
Dec
(2) |
2015 |
Jan
(28) |
Feb
(47) |
Mar
(33) |
Apr
(58) |
May
(5) |
Jun
(1) |
Jul
|
Aug
(8) |
Sep
(12) |
Oct
(25) |
Nov
(58) |
Dec
(21) |
2016 |
Jan
(12) |
Feb
(40) |
Mar
(2) |
Apr
(1) |
May
(67) |
Jun
(2) |
Jul
(5) |
Aug
(36) |
Sep
|
Oct
(24) |
Nov
(17) |
Dec
(50) |
2017 |
Jan
(14) |
Feb
(16) |
Mar
(2) |
Apr
(35) |
May
(14) |
Jun
(16) |
Jul
(3) |
Aug
(3) |
Sep
|
Oct
(19) |
Nov
|
Dec
(16) |
2018 |
Jan
(55) |
Feb
(11) |
Mar
(34) |
Apr
(14) |
May
(4) |
Jun
(20) |
Jul
(39) |
Aug
(16) |
Sep
(17) |
Oct
(16) |
Nov
(20) |
Dec
(30) |
2019 |
Jan
(29) |
Feb
(24) |
Mar
(37) |
Apr
(26) |
May
(19) |
Jun
(21) |
Jul
(2) |
Aug
(3) |
Sep
(9) |
Oct
(12) |
Nov
(12) |
Dec
(12) |
2020 |
Jan
(47) |
Feb
(36) |
Mar
(54) |
Apr
(44) |
May
(37) |
Jun
(19) |
Jul
(32) |
Aug
(13) |
Sep
(16) |
Oct
(24) |
Nov
(32) |
Dec
(11) |
2021 |
Jan
(14) |
Feb
(5) |
Mar
(40) |
Apr
(32) |
May
(42) |
Jun
(31) |
Jul
(29) |
Aug
(47) |
Sep
(38) |
Oct
(17) |
Nov
(74) |
Dec
(33) |
2022 |
Jan
(11) |
Feb
(15) |
Mar
(40) |
Apr
(21) |
May
(39) |
Jun
(44) |
Jul
(19) |
Aug
(46) |
Sep
(79) |
Oct
(35) |
Nov
(21) |
Dec
(15) |
2023 |
Jan
(56) |
Feb
(13) |
Mar
(43) |
Apr
(28) |
May
(60) |
Jun
(15) |
Jul
(29) |
Aug
(28) |
Sep
(32) |
Oct
(21) |
Nov
(42) |
Dec
(39) |
2024 |
Jan
(35) |
Feb
(17) |
Mar
(28) |
Apr
(7) |
May
(14) |
Jun
(35) |
Jul
(30) |
Aug
(35) |
Sep
(30) |
Oct
(28) |
Nov
(38) |
Dec
(18) |
2025 |
Jan
(21) |
Feb
(28) |
Mar
(36) |
Apr
(35) |
May
(34) |
Jun
(58) |
Jul
(9) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <oh...@ma...> - 2009-04-19 10:18:48
|
Author: oharboe Date: 2009-04-19 10:18:46 +0200 (Sun, 19 Apr 2009) New Revision: 1468 Modified: trunk/src/flash/nand.c Log: Zach Welch <zw...@su...> add missing initializers in nand.c Modified: trunk/src/flash/nand.c =================================================================== --- trunk/src/flash/nand.c 2009-04-19 08:18:01 UTC (rev 1467) +++ trunk/src/flash/nand.c 2009-04-19 08:18:46 UTC (rev 1468) @@ -165,7 +165,7 @@ {"NAND 2GiB 1,8V 16-bit", 0xB5, 0, 2048, 0, LP_OPTIONS16}, {"NAND 2GiB 3,3V 16-bit", 0xC5, 0, 2048, 0, LP_OPTIONS16}, - {NULL, 0,} + {NULL, 0, 0, 0, 0, 0 } }; /* Manufacturer ID list |
From: <oh...@ma...> - 2009-04-19 10:18:02
|
Author: oharboe Date: 2009-04-19 10:18:01 +0200 (Sun, 19 Apr 2009) New Revision: 1467 Modified: trunk/src/flash/tms470.c Log: Zach Welch <zw...@su...> trim logic in tms470.c Modified: trunk/src/flash/tms470.c =================================================================== --- trunk/src/flash/tms470.c 2009-04-19 08:16:58 UTC (rev 1466) +++ trunk/src/flash/tms470.c 2009-04-19 08:18:01 UTC (rev 1467) @@ -196,7 +196,7 @@ case 0x2b: part_name = "TMS470R1A288"; - if ((bank->base >= 0x00000000) && (bank->base < 0x00008000)) + if (bank->base < 0x00008000) { tms470_info->ordinal = 0; bank->base = 0x00000000; @@ -232,7 +232,7 @@ case 0x2d: part_name = "TMS470R1A384"; - if ((bank->base >= 0x00000000) && (bank->base < 0x00020000)) + if (bank->base < 0x00020000) { tms470_info->ordinal = 0; bank->base = 0x00000000; |
From: <oh...@ma...> - 2009-04-19 10:17:06
|
Author: oharboe Date: 2009-04-19 10:16:58 +0200 (Sun, 19 Apr 2009) New Revision: 1466 Modified: trunk/src/flash/aduc702x.c trunk/src/flash/at91sam7.c trunk/src/flash/cfi.c trunk/src/flash/ecos.c trunk/src/flash/flash.c trunk/src/flash/lpc2000.c trunk/src/flash/lpc2000.h trunk/src/flash/lpc288x.c trunk/src/flash/lpc3180_nand_controller.c trunk/src/flash/nand.c trunk/src/flash/ocl.c trunk/src/flash/pic32mx.c trunk/src/flash/stellaris.c trunk/src/flash/stm32x.c trunk/src/flash/str7x.c trunk/src/flash/str9x.c trunk/src/flash/str9xpec.c trunk/src/flash/tms470.c Log: Zach Welch <zw...@su...> fix signed/unsigned comparisons Modified: trunk/src/flash/aduc702x.c =================================================================== --- trunk/src/flash/aduc702x.c 2009-04-19 08:15:32 UTC (rev 1465) +++ trunk/src/flash/aduc702x.c 2009-04-19 08:16:58 UTC (rev 1466) @@ -331,7 +331,7 @@ * working area available. */ static int aduc702x_write_single(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) { - int x; + u32 x; u8 b; target_t *target = bank->target; Modified: trunk/src/flash/at91sam7.c =================================================================== --- trunk/src/flash/at91sam7.c 2009-04-19 08:15:32 UTC (rev 1465) +++ trunk/src/flash/at91sam7.c 2009-04-19 08:16:58 UTC (rev 1466) @@ -937,7 +937,8 @@ static int at91sam7_protect(struct flash_bank_s *bank, int set, int first, int last) { u32 cmd; - u32 sector, pagen; + int sector; + u32 pagen; at91sam7_flash_bank_t *at91sam7_info = bank->driver_priv; Modified: trunk/src/flash/cfi.c =================================================================== --- trunk/src/flash/cfi.c 2009-04-19 08:15:32 UTC (rev 1465) +++ trunk/src/flash/cfi.c 2009-04-19 08:16:58 UTC (rev 1466) @@ -1113,7 +1113,7 @@ }; u8 target_code[4*CFI_MAX_INTEL_CODESIZE]; const u32 *target_code_src; - int target_code_size; + u32 target_code_size; int retval = ERROR_OK; @@ -1969,7 +1969,7 @@ bufferwsize/=(bank->bus_width / bank->chip_width); /* fall back to memory writes */ - while (count >= bank->bus_width) + while (count >= (u32)bank->bus_width) { int fallback; if ((write_p & 0xff) == 0) @@ -2268,7 +2268,7 @@ LOG_DEBUG("size: 0x%x, interface desc: %i, max buffer write size: %x", 1 << cfi_info->dev_size, cfi_info->interface_desc, (1 << cfi_info->max_buf_write_size)); - if (((1 << cfi_info->dev_size) * bank->bus_width / bank->chip_width) != bank->size) + if ((u32)((1 << cfi_info->dev_size) * bank->bus_width / bank->chip_width) != bank->size) { LOG_WARNING("configuration specifies 0x%x size, but a 0x%x size flash was found", bank->size, 1 << cfi_info->dev_size); } @@ -2361,7 +2361,7 @@ for (i = 0; i < cfi_info->num_erase_regions; i++) { - int j; + u32 j; for (j = 0; j < (cfi_info->erase_region_info[i] & 0xffff) + 1; j++) { bank->sectors[sector].offset = offset; Modified: trunk/src/flash/ecos.c =================================================================== --- trunk/src/flash/ecos.c 2009-04-19 08:15:32 UTC (rev 1465) +++ trunk/src/flash/ecos.c 2009-04-19 08:16:58 UTC (rev 1466) @@ -328,7 +328,7 @@ return retval; - int i; + u32 i; for (i=0; i<len; i+=chunk) { int t=len-i; Modified: trunk/src/flash/flash.c =================================================================== --- trunk/src/flash/flash.c 2009-04-19 08:15:32 UTC (rev 1465) +++ trunk/src/flash/flash.c 2009-04-19 08:16:58 UTC (rev 1466) @@ -346,7 +346,7 @@ static int handle_flash_info_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { flash_bank_t *p; - int i = 0; + u32 i = 0; int j = 0; int retval; @@ -726,12 +726,12 @@ u8 chunk[1024]; u32 wrote = 0; u32 cur_size = 0; - int chunk_count; + u32 chunk_count; char *duration_text; duration_t duration; target_t *target = get_current_target(cmd_ctx); u32 i; - int wordsize; + u32 wordsize; if (argc != 3) { @@ -1129,7 +1129,7 @@ u8 buffer[1024]; int buffer_size = sizeof(buffer); int i; - int nBytes; + u32 nBytes; if (bank->target->state != TARGET_HALTED) { @@ -1139,12 +1139,12 @@ for (i = 0; i < bank->num_sectors; i++) { - int j; + u32 j; bank->sectors[i].is_erased = 1; for (j = 0; j < bank->sectors[i].size; j += buffer_size) { - int chunk; + u32 chunk; int retval; chunk = buffer_size; if (chunk > (j - bank->sectors[i].size)) Modified: trunk/src/flash/lpc2000.c =================================================================== --- trunk/src/flash/lpc2000.c 2009-04-19 08:15:32 UTC (rev 1465) +++ trunk/src/flash/lpc2000.c 2009-04-19 08:16:58 UTC (rev 1466) @@ -587,7 +587,7 @@ else { u8 *last_buffer = malloc(thisrun_bytes); - int i; + u32 i; memcpy(last_buffer, buffer + bytes_written, bytes_remaining); for (i = bytes_remaining; i < thisrun_bytes; i++) last_buffer[i] = 0xff; Modified: trunk/src/flash/lpc2000.h =================================================================== --- trunk/src/flash/lpc2000.h 2009-04-19 08:15:32 UTC (rev 1465) +++ trunk/src/flash/lpc2000.h 2009-04-19 08:16:58 UTC (rev 1466) @@ -32,7 +32,7 @@ int cmd51_can_256b; int cmd51_can_8192b; int calc_checksum; - int cmd51_max_buffer; + u32 cmd51_max_buffer; } lpc2000_flash_bank_t; enum lpc2000_status_codes Modified: trunk/src/flash/lpc288x.c =================================================================== --- trunk/src/flash/lpc288x.c 2009-04-19 08:15:32 UTC (rev 1465) +++ trunk/src/flash/lpc288x.c 2009-04-19 08:16:58 UTC (rev 1466) @@ -328,10 +328,11 @@ static int lpc288x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) { u8 page_buffer[FLASH_PAGE_SIZE]; - u32 i, status, source_offset,dest_offset; + u32 status, source_offset,dest_offset; target_t *target = bank->target; u32 bytes_remaining = count; u32 first_sector, last_sector, sector, page; + int i; /* probed? halted? */ status = lpc288x_system_ready(bank); Modified: trunk/src/flash/lpc3180_nand_controller.c =================================================================== --- trunk/src/flash/lpc3180_nand_controller.c 2009-04-19 08:15:32 UTC (rev 1465) +++ trunk/src/flash/lpc3180_nand_controller.c 2009-04-19 08:16:58 UTC (rev 1466) @@ -546,7 +546,7 @@ return ERROR_NAND_OPERATION_NOT_SUPPORTED; } - if (data_size > device->page_size) + if (data_size > (u32)device->page_size) { LOG_ERROR("data size exceeds page size"); return ERROR_NAND_OPERATION_NOT_SUPPORTED; @@ -681,7 +681,7 @@ } #endif - if (data_size > device->page_size) + if (data_size > (u32)device->page_size) { LOG_ERROR("data size exceeds page size"); return ERROR_NAND_OPERATION_NOT_SUPPORTED; @@ -741,7 +741,7 @@ target_write_u32(target, 0x200b8000, NAND_CMD_READSTART); } - while (page_bytes_done < device->page_size) + while (page_bytes_done < (u32)device->page_size) { /* MLC_ECC_AUTO_DEC_REG = dummy */ target_write_u32(target, 0x200b8014, 0xaa55aa55); Modified: trunk/src/flash/nand.c =================================================================== --- trunk/src/flash/nand.c 2009-04-19 08:15:32 UTC (rev 1465) +++ trunk/src/flash/nand.c 2009-04-19 08:16:58 UTC (rev 1466) @@ -834,7 +834,7 @@ int nand_read_page_raw(struct nand_device_s *device, u32 page, u8 *data, u32 data_size, u8 *oob, u32 oob_size) { - int i; + u32 i; if (!device->device) return ERROR_NAND_DEVICE_NOT_PROBED; @@ -948,7 +948,7 @@ int nand_write_page_raw(struct nand_device_s *device, u32 page, u8 *data, u32 data_size, u8 *oob, u32 oob_size) { - int i; + u32 i; int retval; u8 status; @@ -1400,7 +1400,7 @@ if (oob_format & NAND_OOB_SW_ECC) { - int i, j; + u32 i, j; u8 ecc[3]; memset(oob, 0xff, oob_size); for (i = 0, j = 0; i < page_size; i += 256) { Modified: trunk/src/flash/ocl.c =================================================================== --- trunk/src/flash/ocl.c 2009-04-19 08:15:32 UTC (rev 1465) +++ trunk/src/flash/ocl.c 2009-04-19 08:16:58 UTC (rev 1466) @@ -66,8 +66,8 @@ typedef struct ocl_priv_s { arm_jtag_t *jtag_info; - int buflen; - int bufalign; + unsigned int buflen; + unsigned int bufalign; } ocl_priv_t; static int ocl_register_commands(struct command_context_s *cmd_ctx) Modified: trunk/src/flash/pic32mx.c =================================================================== --- trunk/src/flash/pic32mx.c 2009-04-19 08:15:32 UTC (rev 1465) +++ trunk/src/flash/pic32mx.c 2009-04-19 08:16:58 UTC (rev 1466) @@ -526,7 +526,7 @@ u32 address = bank->base + offset; u32 bytes_written = 0; u32 status; - u32 retval; + int retval; if (bank->target->state != TARGET_HALTED) { Modified: trunk/src/flash/stellaris.c =================================================================== --- trunk/src/flash/stellaris.c 2009-04-19 08:15:32 UTC (rev 1465) +++ trunk/src/flash/stellaris.c 2009-04-19 08:16:58 UTC (rev 1466) @@ -570,12 +570,12 @@ return ERROR_FLASH_OPERATION_FAILED; } - if ((first < 0) || (last < first) || (last >= stellaris_info->num_pages)) + if ((first < 0) || (last < first) || (last >= (int)stellaris_info->num_pages)) { return ERROR_FLASH_SECTOR_INVALID; } - if ((first == 0) && (last == (stellaris_info->num_pages-1))) + if ((first == 0) && (last == ((int)stellaris_info->num_pages-1))) { return stellaris_mass_erase(bank); } @@ -821,7 +821,7 @@ u32 words_remaining = (count / 4); u32 bytes_remaining = (count & 0x00000003); u32 bytes_written = 0; - u32 retval; + int retval; if (bank->target->state != TARGET_HALTED) { Modified: trunk/src/flash/stm32x.c =================================================================== --- trunk/src/flash/stm32x.c 2009-04-19 08:15:32 UTC (rev 1465) +++ trunk/src/flash/stm32x.c 2009-04-19 08:16:58 UTC (rev 1466) @@ -603,7 +603,7 @@ u32 address = bank->base + offset; u32 bytes_written = 0; u8 status; - u32 retval; + int retval; if (bank->target->state != TARGET_HALTED) { Modified: trunk/src/flash/str7x.c =================================================================== --- trunk/src/flash/str7x.c 2009-04-19 08:15:32 UTC (rev 1465) +++ trunk/src/flash/str7x.c 2009-04-19 08:16:58 UTC (rev 1466) @@ -478,7 +478,7 @@ u32 address = bank->base + offset; u32 bytes_written = 0; u32 cmd; - u32 retval; + int retval; u32 check_address = offset; int i; Modified: trunk/src/flash/str9x.c =================================================================== --- trunk/src/flash/str9x.c 2009-04-19 08:15:32 UTC (rev 1465) +++ trunk/src/flash/str9x.c 2009-04-19 08:16:58 UTC (rev 1466) @@ -509,7 +509,7 @@ u32 address = bank->base + offset; u32 bytes_written = 0; u8 status; - u32 retval; + int retval; u32 check_address = offset; u32 bank_adr; int i; Modified: trunk/src/flash/str9xpec.c =================================================================== --- trunk/src/flash/str9xpec.c 2009-04-19 08:15:32 UTC (rev 1465) +++ trunk/src/flash/str9xpec.c 2009-04-19 08:16:58 UTC (rev 1466) @@ -687,8 +687,8 @@ scan_field_t field; u8 *scanbuf; int i; - u32 first_sector = 0; - u32 last_sector = 0; + int first_sector = 0; + int last_sector = 0; tap = str9xpec_info->tap; Modified: trunk/src/flash/tms470.c =================================================================== --- trunk/src/flash/tms470.c 2009-04-19 08:15:32 UTC (rev 1465) +++ trunk/src/flash/tms470.c 2009-04-19 08:16:58 UTC (rev 1466) @@ -955,7 +955,8 @@ { target_t *target = bank->target; u32 glbctrl, fmbac2, orig_fmregopt, fmbsea, fmbseb, fmmaxpp, fmmstat; - int i, result = ERROR_OK; + int result = ERROR_OK; + u32 i; if (target->state != TARGET_HALTED) { |
From: <oh...@ma...> - 2009-04-19 10:15:33
|
Author: oharboe Date: 2009-04-19 10:15:32 +0200 (Sun, 19 Apr 2009) New Revision: 1465 Modified: trunk/src/jtag/usbprog.c Log: Zach Welch <zw...@su...> fix warnings in usbprog Modified: trunk/src/jtag/usbprog.c =================================================================== --- trunk/src/jtag/usbprog.c 2009-04-19 08:05:54 UTC (rev 1464) +++ trunk/src/jtag/usbprog.c 2009-04-19 08:15:32 UTC (rev 1465) @@ -347,18 +347,16 @@ usbprog_jtag_tms_send(usbprog_jtag_handle); - if (type == SCAN_OUT) - { - usbprog_jtag_write_tdi(usbprog_jtag_handle,buffer, scan_size); + void (*f)(struct usbprog_jtag *usbprog_jtag, char * buffer, int size); + switch (type) { + case SCAN_OUT: f = &usbprog_jtag_write_tdi; break; + case SCAN_IN: f = &usbprog_jtag_read_tdo; break; + case SCAN_IO: f = &usbprog_jtag_write_and_read; break; + default: + LOG_ERROR("unknown scan type: %i", type); + exit(-1); } - if (type == SCAN_IN) - { - usbprog_jtag_read_tdo(usbprog_jtag_handle,buffer, scan_size); - } - if (type == SCAN_IO) - { - usbprog_jtag_write_and_read(usbprog_jtag_handle,buffer, scan_size); - } + f(usbprog_jtag_handle, (char *)buffer, scan_size); if (ir_scan) tap_set_state(TAP_IRPAUSE); |
From: <oh...@ma...> - 2009-04-19 10:05:58
|
Author: oharboe Date: 2009-04-19 10:05:54 +0200 (Sun, 19 Apr 2009) New Revision: 1464 Modified: trunk/src/jtag/amt_jtagaccel.c trunk/src/jtag/dummy.c trunk/src/jtag/gw16012.c trunk/src/jtag/jtag.c Log: Zach Welch <zw...@su...> use tap_state_t Modified: trunk/src/jtag/amt_jtagaccel.c =================================================================== --- trunk/src/jtag/amt_jtagaccel.c 2009-04-19 08:04:23 UTC (rev 1463) +++ trunk/src/jtag/amt_jtagaccel.c 2009-04-19 08:05:54 UTC (rev 1464) @@ -156,7 +156,7 @@ return ERROR_OK; } -void amt_jtagaccel_end_state(int state) +void amt_jtagaccel_end_state(tap_state_t state) { if (tap_is_state_stable(state)) tap_set_end_state(state); Modified: trunk/src/jtag/dummy.c =================================================================== --- trunk/src/jtag/dummy.c 2009-04-19 08:04:23 UTC (rev 1463) +++ trunk/src/jtag/dummy.c 2009-04-19 08:05:54 UTC (rev 1464) @@ -91,7 +91,7 @@ { if( tck ) { - int old_state = dummy_state; + tap_state_t old_state = dummy_state; dummy_state = tap_state_transition( old_state, tms ); if( old_state != dummy_state ) Modified: trunk/src/jtag/gw16012.c =================================================================== --- trunk/src/jtag/gw16012.c 2009-04-19 08:04:23 UTC (rev 1463) +++ trunk/src/jtag/gw16012.c 2009-04-19 08:05:54 UTC (rev 1464) @@ -194,7 +194,7 @@ return ERROR_OK; } -void gw16012_end_state(int state) +void gw16012_end_state(tap_state_t state) { if (tap_is_state_stable(state)) tap_set_end_state(state); Modified: trunk/src/jtag/jtag.c =================================================================== --- trunk/src/jtag/jtag.c 2009-04-19 08:04:23 UTC (rev 1463) +++ trunk/src/jtag/jtag.c 2009-04-19 08:05:54 UTC (rev 1464) @@ -219,7 +219,7 @@ void jtag_add_end_state(tap_state_t endstate); void jtag_add_sleep(u32 us); int jtag_execute_queue(void); -int tap_state_by_name(const char *name); +tap_state_t tap_state_by_name(const char *name); /* jtag commands */ int handle_interface_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); @@ -2652,7 +2652,7 @@ int handle_endstate_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { - int state; + tap_state_t state; if (argc < 1) { @@ -2665,7 +2665,7 @@ command_print( cmd_ctx, "Invalid state name: %s\n", args[0] ); return ERROR_COMMAND_SYNTAX_ERROR; } - jtag_add_end_state( (tap_state_t)(state)); + jtag_add_end_state(state); jtag_execute_queue(); } command_print(cmd_ctx, "current endstate: %s", tap_state_name(cmd_queue_end_state)); @@ -2729,7 +2729,7 @@ int i; scan_field_t *fields; jtag_tap_t *tap; - int endstate; + tap_state_t endstate; if ((argc < 2) || (argc % 2)) { @@ -2807,7 +2807,7 @@ int field_count = 0; int i, e; jtag_tap_t *tap; - int endstate; + tap_state_t endstate; /* args[1] = device * args[2] = num_bits @@ -3269,9 +3269,9 @@ return ret; } -int tap_state_by_name( const char *name ) +tap_state_t tap_state_by_name( const char *name ) { - int x; + tap_state_t x; for( x = 0 ; x < TAP_NUM_STATES ; x++ ){ /* be nice to the human */ |
From: <oh...@ma...> - 2009-04-19 10:04:25
|
Author: oharboe Date: 2009-04-19 10:04:23 +0200 (Sun, 19 Apr 2009) New Revision: 1463 Modified: trunk/configure.in Log: Zach Welch <zw...@su...> automake maintainer mode Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2009-04-18 10:08:13 UTC (rev 1462) +++ trunk/configure.in 2009-04-19 08:04:23 UTC (rev 1463) @@ -649,6 +649,7 @@ AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(openocd, 1.0) +AM_MAINTAINER_MODE AM_CONDITIONAL(RELEASE, test $build_release = yes) AM_CONDITIONAL(PARPORT, test $build_parport = yes) |
From: <mi...@ma...> - 2009-04-18 12:08:45
|
Author: mifi Date: 2009-04-18 12:08:13 +0200 (Sat, 18 Apr 2009) New Revision: 1462 Modified: trunk/src/flash/aduc702x.c trunk/src/flash/at91sam7.c trunk/src/flash/at91sam7_old.c trunk/src/flash/cfi.c trunk/src/flash/ecos.c trunk/src/flash/flash.c trunk/src/flash/lpc2000.c trunk/src/flash/lpc288x.c trunk/src/flash/lpc3180_nand_controller.c trunk/src/flash/nand.c trunk/src/flash/ocl.c trunk/src/flash/orion_nand.c trunk/src/flash/pic32mx.c trunk/src/flash/s3c2410_nand.c trunk/src/flash/s3c2412_nand.c trunk/src/flash/s3c2440_nand.c trunk/src/flash/s3c2443_nand.c trunk/src/flash/stellaris.c trunk/src/flash/stm32x.c trunk/src/flash/str7x.c trunk/src/flash/str9x.c trunk/src/flash/str9xpec.c trunk/src/flash/tms470.c trunk/src/helper/tclapi.c trunk/src/jtag/amt_jtagaccel.c trunk/src/jtag/arm-jtag-ew.c trunk/src/jtag/bitbang.c trunk/src/jtag/bitq.c trunk/src/jtag/ft2232.c trunk/src/jtag/gw16012.c trunk/src/jtag/jlink.c trunk/src/jtag/jtag.c trunk/src/jtag/jtag.h trunk/src/jtag/usbprog.c trunk/src/jtag/vsllink.c trunk/src/target/arm11.c trunk/src/target/arm11_dbgtap.c trunk/src/target/arm720t.c trunk/src/target/arm7tdmi.c trunk/src/target/arm920t.c trunk/src/target/arm926ejs.c trunk/src/target/arm966e.c trunk/src/target/arm9tdmi.c trunk/src/target/arm_jtag.c trunk/src/target/cortex_swjdp.c trunk/src/target/embeddedice.c trunk/src/target/embeddedice.h trunk/src/target/etb.c trunk/src/target/etm.c trunk/src/target/feroceon.c trunk/src/target/mips_ejtag.c trunk/src/target/xscale.c Log: The following patches was applied: - openocd-flash-static-keyword-v3.patch - openocd-lpc2000-fix-erase-obo.patch - openocd-jlink-fix-sign-ptr-warn.patch - openocd-wextra-etm.patch - openocd-wextra-jtag.patch - openocd-add-new-tap-symbols-v6.patch Many thanks to Zach Welch <zw(at)superlucidity.net> Modified: trunk/src/flash/aduc702x.c =================================================================== --- trunk/src/flash/aduc702x.c 2009-04-15 15:44:26 UTC (rev 1461) +++ trunk/src/flash/aduc702x.c 2009-04-18 10:08:13 UTC (rev 1462) @@ -36,19 +36,19 @@ #include <string.h> #include <unistd.h> -int aduc702x_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank); -int aduc702x_register_commands(struct command_context_s *cmd_ctx); -int aduc702x_erase(struct flash_bank_s *bank, int first, int last); -int aduc702x_protect(struct flash_bank_s *bank, int set, int first, int last); -int aduc702x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count); -int aduc702x_write_single(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count); -int aduc702x_write_block(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count); -int aduc702x_probe(struct flash_bank_s *bank); -int aduc702x_info(struct flash_bank_s *bank, char *buf, int buf_size); -int aduc702x_protect_check(struct flash_bank_s *bank); -int aduc702x_build_sector_list(struct flash_bank_s *bank); -int aduc702x_check_flash_completion(target_t* target, unsigned int timeout_ms); -int aduc702x_set_write_enable(target_t *target, int enable); +static int aduc702x_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank); +static int aduc702x_register_commands(struct command_context_s *cmd_ctx); +static int aduc702x_erase(struct flash_bank_s *bank, int first, int last); +static int aduc702x_protect(struct flash_bank_s *bank, int set, int first, int last); +static int aduc702x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count); +static int aduc702x_write_single(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count); +static int aduc702x_write_block(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count); +static int aduc702x_probe(struct flash_bank_s *bank); +static int aduc702x_info(struct flash_bank_s *bank, char *buf, int buf_size); +static int aduc702x_protect_check(struct flash_bank_s *bank); +static int aduc702x_build_sector_list(struct flash_bank_s *bank); +static int aduc702x_check_flash_completion(target_t* target, unsigned int timeout_ms); +static int aduc702x_set_write_enable(target_t *target, int enable); #define ADUC702x_FLASH 0xfffff800 #define ADUC702x_FLASH_FEESTA (0*4) @@ -91,14 +91,14 @@ .info = aduc702x_info }; -int aduc702x_register_commands(struct command_context_s *cmd_ctx) +static int aduc702x_register_commands(struct command_context_s *cmd_ctx) { return ERROR_OK; } /* flash bank aduc702x 0 0 0 0 <target#> * The ADC7019-28 devices all have the same flash layout */ -int aduc702x_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank) +static int aduc702x_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank) { aduc702x_flash_bank_t *nbank; @@ -113,7 +113,7 @@ return ERROR_OK; } -int aduc702x_build_sector_list(struct flash_bank_s *bank) +static int aduc702x_build_sector_list(struct flash_bank_s *bank) { //aduc7026_flash_bank_t *aduc7026_info = bank->driver_priv; @@ -135,13 +135,13 @@ return ERROR_OK; } -int aduc702x_protect_check(struct flash_bank_s *bank) +static int aduc702x_protect_check(struct flash_bank_s *bank) { printf("aduc702x_protect_check not implemented yet.\n"); return ERROR_OK; } -int aduc702x_erase(struct flash_bank_s *bank, int first, int last) +static int aduc702x_erase(struct flash_bank_s *bank, int first, int last) { //int res; int x; @@ -194,13 +194,13 @@ return ERROR_OK; } -int aduc702x_protect(struct flash_bank_s *bank, int set, int first, int last) +static int aduc702x_protect(struct flash_bank_s *bank, int set, int first, int last) { printf("aduc702x_protect not implemented yet.\n"); return ERROR_FLASH_OPERATION_FAILED; } -int aduc702x_write_block(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) +static int aduc702x_write_block(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) { aduc702x_flash_bank_t *aduc702x_info = bank->driver_priv; target_t *target = bank->target; @@ -329,7 +329,7 @@ /* All-JTAG, single-access method. Very slow. Used only if there is no * working area available. */ -int aduc702x_write_single(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) +static int aduc702x_write_single(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) { int x; u8 b; @@ -399,12 +399,12 @@ return ERROR_OK; } -int aduc702x_probe(struct flash_bank_s *bank) +static int aduc702x_probe(struct flash_bank_s *bank) { return ERROR_OK; } -int aduc702x_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int aduc702x_info(struct flash_bank_s *bank, char *buf, int buf_size) { snprintf(buf, buf_size, "aduc702x flash driver info" ); return ERROR_OK; @@ -412,7 +412,7 @@ /* sets FEEMOD bit 3 * enable = 1 enables writes & erases, 0 disables them */ -int aduc702x_set_write_enable(target_t *target, int enable) +static int aduc702x_set_write_enable(target_t *target, int enable) { // don't bother to preserve int enable bit here target_write_u16(target, ADUC702x_FLASH + ADUC702x_FLASH_FEEMOD, enable ? 8 : 0); @@ -425,7 +425,7 @@ * * this function sleeps 1ms between checks (after the first one), * so in some cases may slow things down without a usleep after the first read */ -int aduc702x_check_flash_completion(target_t* target, unsigned int timeout_ms) +static int aduc702x_check_flash_completion(target_t* target, unsigned int timeout_ms) { u8 v = 4; Modified: trunk/src/flash/at91sam7.c =================================================================== --- trunk/src/flash/at91sam7.c 2009-04-15 15:44:26 UTC (rev 1461) +++ trunk/src/flash/at91sam7.c 2009-04-18 10:08:13 UTC (rev 1462) @@ -53,22 +53,22 @@ #include <string.h> #include <unistd.h> -int at91sam7_register_commands(struct command_context_s *cmd_ctx); -int at91sam7_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank); -int at91sam7_erase(struct flash_bank_s *bank, int first, int last); -int at91sam7_protect(struct flash_bank_s *bank, int set, int first, int last); -int at91sam7_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count); -int at91sam7_probe(struct flash_bank_s *bank); -int at91sam7_auto_probe(struct flash_bank_s *bank); -int at91sam7_erase_check(struct flash_bank_s *bank); -int at91sam7_protect_check(struct flash_bank_s *bank); -int at91sam7_info(struct flash_bank_s *bank, char *buf, int buf_size); +static int at91sam7_register_commands(struct command_context_s *cmd_ctx); +static int at91sam7_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank); +static int at91sam7_erase(struct flash_bank_s *bank, int first, int last); +static int at91sam7_protect(struct flash_bank_s *bank, int set, int first, int last); +static int at91sam7_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count); +static int at91sam7_probe(struct flash_bank_s *bank); +//static int at91sam7_auto_probe(struct flash_bank_s *bank); +static int at91sam7_erase_check(struct flash_bank_s *bank); +static int at91sam7_protect_check(struct flash_bank_s *bank); +static int at91sam7_info(struct flash_bank_s *bank, char *buf, int buf_size); -u32 at91sam7_get_flash_status(target_t *target, int bank_number); -void at91sam7_set_flash_mode(flash_bank_t *bank, int mode); -u32 at91sam7_wait_status_busy(flash_bank_t *bank, u32 waitbits, int timeout); -int at91sam7_flash_command(struct flash_bank_s *bank, u8 cmd, u16 pagen); -int at91sam7_handle_gpnvm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); +static u32 at91sam7_get_flash_status(target_t *target, int bank_number); +static void at91sam7_set_flash_mode(flash_bank_t *bank, int mode); +static u32 at91sam7_wait_status_busy(flash_bank_t *bank, u32 waitbits, int timeout); +static int at91sam7_flash_command(struct flash_bank_s *bank, u8 cmd, u16 pagen); +static int at91sam7_handle_gpnvm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); flash_driver_t at91sam7_flash = { @@ -85,13 +85,14 @@ .info = at91sam7_info }; -u32 MC_FMR[4] = { 0xFFFFFF60, 0xFFFFFF70, 0xFFFFFF80, 0xFFFFFF90 }; -u32 MC_FCR[4] = { 0xFFFFFF64, 0xFFFFFF74, 0xFFFFFF84, 0xFFFFFF94 }; -u32 MC_FSR[4] = { 0xFFFFFF68, 0xFFFFFF78, 0xFFFFFF88, 0xFFFFFF98 }; +static u32 MC_FMR[4] = { 0xFFFFFF60, 0xFFFFFF70, 0xFFFFFF80, 0xFFFFFF90 }; +static u32 MC_FCR[4] = { 0xFFFFFF64, 0xFFFFFF74, 0xFFFFFF84, 0xFFFFFF94 }; +static u32 MC_FSR[4] = { 0xFFFFFF68, 0xFFFFFF78, 0xFFFFFF88, 0xFFFFFF98 }; -char * EPROC[8]= {"Unknown","ARM946-E","ARM7TDMI","Unknown","ARM920T","ARM926EJ-S","Unknown","Unknown"}; +static char * EPROC[8]= {"Unknown","ARM946-E","ARM7TDMI","Unknown","ARM920T","ARM926EJ-S","Unknown","Unknown"}; -long SRAMSIZ[16] = { +#if 0 +static long SRAMSIZ[16] = { -1, 0x0400, /* 1K */ 0x0800, /* 2K */ @@ -109,8 +110,9 @@ 0x18000, /* 96K */ 0x80000, /* 512K */ }; +#endif -int at91sam7_register_commands(struct command_context_s *cmd_ctx) +static int at91sam7_register_commands(struct command_context_s *cmd_ctx) { command_t *at91sam7_cmd = register_command(cmd_ctx, NULL, "at91sam7_new", NULL, COMMAND_ANY, NULL); @@ -119,7 +121,7 @@ return ERROR_OK; } -u32 at91sam7_get_flash_status(target_t *target, int bank_number) +static u32 at91sam7_get_flash_status(target_t *target, int bank_number) { u32 fsr; target_read_u32(target, MC_FSR[bank_number], &fsr); @@ -128,7 +130,7 @@ } /* Read clock configuration and set at91sam7_info->mck_freq */ -void at91sam7_read_clock_info(flash_bank_t *bank) +static void at91sam7_read_clock_info(flash_bank_t *bank) { at91sam7_flash_bank_t *at91sam7_info = bank->driver_priv; target_t *target = bank->target; @@ -207,7 +209,7 @@ } /* Setup the timimg registers for nvbits or normal flash */ -void at91sam7_set_flash_mode(flash_bank_t *bank, int mode) +static void at91sam7_set_flash_mode(flash_bank_t *bank, int mode) { u32 fmr, fmcn = 0, fws = 0; at91sam7_flash_bank_t *at91sam7_info = bank->driver_priv; @@ -255,7 +257,7 @@ at91sam7_info->flashmode = mode; } -u32 at91sam7_wait_status_busy(flash_bank_t *bank, u32 waitbits, int timeout) +static u32 at91sam7_wait_status_busy(flash_bank_t *bank, u32 waitbits, int timeout) { u32 status; @@ -282,7 +284,7 @@ } /* Send one command to the AT91SAM flash controller */ -int at91sam7_flash_command(struct flash_bank_s *bank, u8 cmd, u16 pagen) +static int at91sam7_flash_command(struct flash_bank_s *bank, u8 cmd, u16 pagen) { u32 fcr; at91sam7_flash_bank_t *at91sam7_info = bank->driver_priv; @@ -311,7 +313,7 @@ } /* Read device id register, main clock frequency register and fill in driver info structure */ -int at91sam7_read_part_info(struct flash_bank_s *bank) +static int at91sam7_read_part_info(struct flash_bank_s *bank) { flash_bank_t *t_bank = bank; at91sam7_flash_bank_t *at91sam7_info; @@ -626,7 +628,7 @@ return ERROR_OK; } -int at91sam7_erase_check(struct flash_bank_s *bank) +static int at91sam7_erase_check(struct flash_bank_s *bank) { target_t *target = bank->target; u16 retval; @@ -692,7 +694,7 @@ return ERROR_OK; } -int at91sam7_protect_check(struct flash_bank_s *bank) +static int at91sam7_protect_check(struct flash_bank_s *bank) { u8 lock_pos, gpnvm_pos; u32 status; @@ -752,7 +754,7 @@ # flash bank at91sam7 0x00100000 0 0 4 0 0 AT91SAM7XC256 1 16 64 256 3 0 ==== NOT RECOMENDED !!! ==== # flash bank at91sam7 0 0 0 0 0 (old style, full auto-detection) ==== NOT RECOMENDED !!! ==== ****************************************************************************************************************************************************************************************/ -int at91sam7_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank) +static int at91sam7_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank) { flash_bank_t *t_bank = bank; at91sam7_flash_bank_t *at91sam7_info; @@ -864,7 +866,7 @@ return ERROR_OK; } -int at91sam7_erase(struct flash_bank_s *bank, int first, int last) +static int at91sam7_erase(struct flash_bank_s *bank, int first, int last) { at91sam7_flash_bank_t *at91sam7_info = bank->driver_priv; int sec; @@ -932,7 +934,7 @@ return ERROR_OK; } -int at91sam7_protect(struct flash_bank_s *bank, int set, int first, int last) +static int at91sam7_protect(struct flash_bank_s *bank, int set, int first, int last) { u32 cmd; u32 sector, pagen; @@ -981,7 +983,7 @@ return ERROR_OK; } -int at91sam7_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) +static int at91sam7_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) { int retval; at91sam7_flash_bank_t *at91sam7_info = bank->driver_priv; @@ -1050,7 +1052,7 @@ return ERROR_OK; } -int at91sam7_probe(struct flash_bank_s *bank) +static int at91sam7_probe(struct flash_bank_s *bank) { /* we can't probe on an at91sam7 * if this is an at91sam7, it has the configured flash */ @@ -1069,7 +1071,7 @@ return ERROR_OK; } -int at91sam7_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int at91sam7_info(struct flash_bank_s *bank, char *buf, int buf_size) { int printed; at91sam7_flash_bank_t *at91sam7_info = bank->driver_priv; @@ -1130,7 +1132,7 @@ * The maximum number of write/erase cycles for Non volatile Memory bits is 100. this includes * Lock Bits (LOCKx), General Purpose NVM bits (GPNVMx) and the Security Bit. */ -int at91sam7_handle_gpnvm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +static int at91sam7_handle_gpnvm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { flash_bank_t *bank; int bit; Modified: trunk/src/flash/at91sam7_old.c =================================================================== --- trunk/src/flash/at91sam7_old.c 2009-04-15 15:44:26 UTC (rev 1461) +++ trunk/src/flash/at91sam7_old.c 2009-04-18 10:08:13 UTC (rev 1462) @@ -51,22 +51,22 @@ #include <string.h> #include <unistd.h> -int at91sam7_old_register_commands(struct command_context_s *cmd_ctx); -int at91sam7_old_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank); -int at91sam7_old_erase(struct flash_bank_s *bank, int first, int last); -int at91sam7_old_protect(struct flash_bank_s *bank, int set, int first, int last); -int at91sam7_old_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count); -int at91sam7_old_probe(struct flash_bank_s *bank); -int at91sam7_old_auto_probe(struct flash_bank_s *bank); -int at91sam7_old_erase_check(struct flash_bank_s *bank); -int at91sam7_old_protect_check(struct flash_bank_s *bank); -int at91sam7_old_info(struct flash_bank_s *bank, char *buf, int buf_size); +static int at91sam7_old_register_commands(struct command_context_s *cmd_ctx); +static int at91sam7_old_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank); +static int at91sam7_old_erase(struct flash_bank_s *bank, int first, int last); +static int at91sam7_old_protect(struct flash_bank_s *bank, int set, int first, int last); +static int at91sam7_old_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count); +static int at91sam7_old_probe(struct flash_bank_s *bank); +//static int at91sam7_old_auto_probe(struct flash_bank_s *bank); +static int at91sam7_old_erase_check(struct flash_bank_s *bank); +static int at91sam7_old_protect_check(struct flash_bank_s *bank); +static int at91sam7_old_info(struct flash_bank_s *bank, char *buf, int buf_size); -u32 at91sam7_old_get_flash_status(flash_bank_t *bank, u8 flashplane); -void at91sam7_old_set_flash_mode(flash_bank_t *bank, u8 flashplane, int mode); -u32 at91sam7_old_wait_status_busy(flash_bank_t *bank, u8 flashplane, u32 waitbits, int timeout); -int at91sam7_old_flash_command(struct flash_bank_s *bank, u8 flashplane, u8 cmd, u16 pagen); -int at91sam7_old_handle_gpnvm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); +static u32 at91sam7_old_get_flash_status(flash_bank_t *bank, u8 flashplane); +static void at91sam7_old_set_flash_mode(flash_bank_t *bank, u8 flashplane, int mode); +static u32 at91sam7_old_wait_status_busy(flash_bank_t *bank, u8 flashplane, u32 waitbits, int timeout); +static int at91sam7_old_flash_command(struct flash_bank_s *bank, u8 flashplane, u8 cmd, u16 pagen); +static int at91sam7_old_handle_gpnvm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); flash_driver_t at91sam7_old_flash = { @@ -83,12 +83,12 @@ .info = at91sam7_old_info }; -u32 MC_FMR_old[4] = { 0xFFFFFF60, 0xFFFFFF70, 0xFFFFFF80, 0xFFFFFF90 }; -u32 MC_FCR_old[4] = { 0xFFFFFF64, 0xFFFFFF74, 0xFFFFFF84, 0xFFFFFF94 }; -u32 MC_FSR_old[4] = { 0xFFFFFF68, 0xFFFFFF78, 0xFFFFFF88, 0xFFFFFF98 }; +static u32 MC_FMR_old[4] = { 0xFFFFFF60, 0xFFFFFF70, 0xFFFFFF80, 0xFFFFFF90 }; +static u32 MC_FCR_old[4] = { 0xFFFFFF64, 0xFFFFFF74, 0xFFFFFF84, 0xFFFFFF94 }; +static u32 MC_FSR_old[4] = { 0xFFFFFF68, 0xFFFFFF78, 0xFFFFFF88, 0xFFFFFF98 }; -char * EPROC_old[8]= {"Unknown","ARM946-E","ARM7TDMI","Unknown","ARM920T","ARM926EJ-S","Unknown","Unknown"}; -long NVPSIZ_old[16] = { +static char * EPROC_old[8]= {"Unknown","ARM946-E","ARM7TDMI","Unknown","ARM920T","ARM926EJ-S","Unknown","Unknown"}; +static long NVPSIZ_old[16] = { 0, 0x2000, /* 8K */ 0x4000, /* 16K */ @@ -107,7 +107,8 @@ -1 }; -long SRAMSIZ_old[16] = { +#if 0 +static long SRAMSIZ_old[16] = { -1, 0x0400, /* 1K */ 0x0800, /* 2K */ @@ -125,8 +126,9 @@ 0x18000, /* 96K */ 0x80000, /* 512K */ }; +#endif -int at91sam7_old_register_commands(struct command_context_s *cmd_ctx) +static int at91sam7_old_register_commands(struct command_context_s *cmd_ctx) { command_t *at91sam7_old_cmd = register_command(cmd_ctx, NULL, "at91sam7", NULL, COMMAND_ANY, NULL); register_command(cmd_ctx, at91sam7_old_cmd, "gpnvm", at91sam7_old_handle_gpnvm_command, COMMAND_EXEC, @@ -135,7 +137,7 @@ return ERROR_OK; } -u32 at91sam7_old_get_flash_status(flash_bank_t *bank, u8 flashplane) +static u32 at91sam7_old_get_flash_status(flash_bank_t *bank, u8 flashplane) { target_t *target = bank->target; u32 fsr; @@ -146,7 +148,7 @@ } /* Read clock configuration and set at91sam7_old_info->usec_clocks*/ -void at91sam7_old_read_clock_info(flash_bank_t *bank) +static void at91sam7_old_read_clock_info(flash_bank_t *bank) { at91sam7_old_flash_bank_t *at91sam7_old_info = bank->driver_priv; target_t *target = bank->target; @@ -210,7 +212,7 @@ } /* Setup the timimg registers for nvbits or normal flash */ -void at91sam7_old_set_flash_mode(flash_bank_t *bank, u8 flashplane, int mode) +static void at91sam7_old_set_flash_mode(flash_bank_t *bank, u8 flashplane, int mode) { u32 fmr, fmcn = 0, fws = 0; at91sam7_old_flash_bank_t *at91sam7_old_info = bank->driver_priv; @@ -251,7 +253,7 @@ at91sam7_old_info->flashmode[flashplane] = mode; } -u32 at91sam7_old_wait_status_busy(flash_bank_t *bank, u8 flashplane, u32 waitbits, int timeout) +static u32 at91sam7_old_wait_status_busy(flash_bank_t *bank, u8 flashplane, u32 waitbits, int timeout) { u32 status; @@ -279,7 +281,7 @@ /* Send one command to the AT91SAM flash controller */ -int at91sam7_old_flash_command(struct flash_bank_s *bank, u8 flashplane, u8 cmd, u16 pagen) +static int at91sam7_old_flash_command(struct flash_bank_s *bank, u8 flashplane, u8 cmd, u16 pagen) { u32 fcr; at91sam7_old_flash_bank_t *at91sam7_old_info = bank->driver_priv; @@ -307,7 +309,7 @@ } /* Read device id register, main clock frequency register and fill in driver info structure */ -int at91sam7_old_read_part_info(struct flash_bank_s *bank) +static int at91sam7_old_read_part_info(struct flash_bank_s *bank) { at91sam7_old_flash_bank_t *at91sam7_old_info = bank->driver_priv; target_t *target = bank->target; @@ -574,7 +576,7 @@ return ERROR_OK; } -int at91sam7_old_protect_check(struct flash_bank_s *bank) +static int at91sam7_old_protect_check(struct flash_bank_s *bank) { u32 status; int flashplane; @@ -625,7 +627,7 @@ return ERROR_OK; } -int at91sam7_old_erase(struct flash_bank_s *bank, int first, int last) +static int at91sam7_old_erase(struct flash_bank_s *bank, int first, int last) { at91sam7_old_flash_bank_t *at91sam7_old_info = bank->driver_priv; u8 flashplane; @@ -716,7 +718,7 @@ } -int at91sam7_old_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) +static int at91sam7_old_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) { at91sam7_old_flash_bank_t *at91sam7_old_info = bank->driver_priv; target_t *target = bank->target; @@ -784,7 +786,7 @@ } -int at91sam7_old_probe(struct flash_bank_s *bank) +static int at91sam7_old_probe(struct flash_bank_s *bank) { /* we can't probe on an at91sam7_old * if this is an at91sam7_old, it has the configured flash @@ -811,7 +813,7 @@ } -int at91sam7_old_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int at91sam7_old_info(struct flash_bank_s *bank, char *buf, int buf_size) { int printed, flashplane; at91sam7_old_flash_bank_t *at91sam7_old_info = bank->driver_priv; @@ -871,7 +873,7 @@ * The maximum number of write/erase cycles for Non Volatile Memory bits is 100. This includes * Lock Bits (LOCKx), General Purpose NVM bits (GPNVMx) and the Security Bit. */ -int at91sam7_old_handle_gpnvm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +static int at91sam7_old_handle_gpnvm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { flash_bank_t *bank; int bit; Modified: trunk/src/flash/cfi.c =================================================================== --- trunk/src/flash/cfi.c 2009-04-15 15:44:26 UTC (rev 1461) +++ trunk/src/flash/cfi.c 2009-04-18 10:08:13 UTC (rev 1462) @@ -38,17 +38,17 @@ #include <string.h> #include <unistd.h> -int cfi_register_commands(struct command_context_s *cmd_ctx); -int cfi_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank); -int cfi_erase(struct flash_bank_s *bank, int first, int last); -int cfi_protect(struct flash_bank_s *bank, int set, int first, int last); -int cfi_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count); -int cfi_probe(struct flash_bank_s *bank); -int cfi_auto_probe(struct flash_bank_s *bank); -int cfi_protect_check(struct flash_bank_s *bank); -int cfi_info(struct flash_bank_s *bank, char *buf, int buf_size); +static int cfi_register_commands(struct command_context_s *cmd_ctx); +static int cfi_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank); +static int cfi_erase(struct flash_bank_s *bank, int first, int last); +static int cfi_protect(struct flash_bank_s *bank, int set, int first, int last); +static int cfi_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count); +static int cfi_probe(struct flash_bank_s *bank); +static int cfi_auto_probe(struct flash_bank_s *bank); +static int cfi_protect_check(struct flash_bank_s *bank); +static int cfi_info(struct flash_bank_s *bank, char *buf, int buf_size); -int cfi_handle_part_id_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); +//static int cfi_handle_part_id_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); #define CFI_MAX_BUS_WIDTH 4 #define CFI_MAX_CHIP_WIDTH 4 @@ -71,19 +71,19 @@ .info = cfi_info }; -cfi_unlock_addresses_t cfi_unlock_addresses[] = +static cfi_unlock_addresses_t cfi_unlock_addresses[] = { [CFI_UNLOCK_555_2AA] = { .unlock1 = 0x555, .unlock2 = 0x2aa }, [CFI_UNLOCK_5555_2AAA] = { .unlock1 = 0x5555, .unlock2 = 0x2aaa }, }; /* CFI fixups foward declarations */ -void cfi_fixup_0002_erase_regions(flash_bank_t *flash, void *param); -void cfi_fixup_0002_unlock_addresses(flash_bank_t *flash, void *param); -void cfi_fixup_atmel_reversed_erase_regions(flash_bank_t *flash, void *param); +static void cfi_fixup_0002_erase_regions(flash_bank_t *flash, void *param); +static void cfi_fixup_0002_unlock_addresses(flash_bank_t *flash, void *param); +static void cfi_fixup_atmel_reversed_erase_regions(flash_bank_t *flash, void *param); /* fixup after identifying JEDEC manufactuer and ID */ -cfi_fixup_t cfi_jedec_fixups[] = { +static cfi_fixup_t cfi_jedec_fixups[] = { {CFI_MFR_SST, 0x00D4, cfi_fixup_non_cfi, NULL}, {CFI_MFR_SST, 0x00D5, cfi_fixup_non_cfi, NULL}, {CFI_MFR_SST, 0x00D6, cfi_fixup_non_cfi, NULL}, @@ -101,7 +101,7 @@ }; /* fixup after reading cmdset 0002 primary query table */ -cfi_fixup_t cfi_0002_fixups[] = { +static cfi_fixup_t cfi_0002_fixups[] = { {CFI_MFR_SST, 0x00D4, cfi_fixup_0002_unlock_addresses, &cfi_unlock_addresses[CFI_UNLOCK_5555_2AAA]}, {CFI_MFR_SST, 0x00D5, cfi_fixup_0002_unlock_addresses, &cfi_unlock_addresses[CFI_UNLOCK_5555_2AAA]}, {CFI_MFR_SST, 0x00D6, cfi_fixup_0002_unlock_addresses, &cfi_unlock_addresses[CFI_UNLOCK_5555_2AAA]}, @@ -117,11 +117,11 @@ }; /* fixup after reading cmdset 0001 primary query table */ -cfi_fixup_t cfi_0001_fixups[] = { +static cfi_fixup_t cfi_0001_fixups[] = { {0, 0, NULL, NULL} }; -void cfi_fixup(flash_bank_t *bank, cfi_fixup_t *fixups) +static void cfi_fixup(flash_bank_t *bank, cfi_fixup_t *fixups) { cfi_flash_bank_t *cfi_info = bank->driver_priv; cfi_fixup_t *f; @@ -154,7 +154,7 @@ } -void cfi_command(flash_bank_t *bank, u8 cmd, u8 *cmd_buf) +static void cfi_command(flash_bank_t *bank, u8 cmd, u8 *cmd_buf) { int i; @@ -184,7 +184,7 @@ * flash banks are expected to be made of similar chips * the query result should be the same for all */ -u8 cfi_query_u8(flash_bank_t *bank, int sector, u32 offset) +static u8 cfi_query_u8(flash_bank_t *bank, int sector, u32 offset) { target_t *target = bank->target; u8 data[CFI_MAX_BUS_WIDTH]; @@ -201,7 +201,7 @@ * in case of a bank made of multiple chips, * the individual values are ORed */ -u8 cfi_get_u8(flash_bank_t *bank, int sector, u32 offset) +static u8 cfi_get_u8(flash_bank_t *bank, int sector, u32 offset) { target_t *target = bank->target; u8 data[CFI_MAX_BUS_WIDTH]; @@ -226,7 +226,7 @@ } } -u16 cfi_query_u16(flash_bank_t *bank, int sector, u32 offset) +static u16 cfi_query_u16(flash_bank_t *bank, int sector, u32 offset) { target_t *target = bank->target; u8 data[CFI_MAX_BUS_WIDTH * 2]; @@ -239,7 +239,7 @@ return data[bank->bus_width - 1] | data[(2 * bank->bus_width) - 1] << 8; } -u32 cfi_query_u32(flash_bank_t *bank, int sector, u32 offset) +static u32 cfi_query_u32(flash_bank_t *bank, int sector, u32 offset) { target_t *target = bank->target; u8 data[CFI_MAX_BUS_WIDTH * 4]; @@ -253,7 +253,7 @@ data[(3 * bank->bus_width) - 1] << 16 | data[(4 * bank->bus_width) - 1] << 24; } -void cfi_intel_clear_status_register(flash_bank_t *bank) +static void cfi_intel_clear_status_register(flash_bank_t *bank) { target_t *target = bank->target; u8 command[8]; @@ -343,7 +343,7 @@ return(ERROR_FLASH_BUSY); } -int cfi_read_intel_pri_ext(flash_bank_t *bank) +static int cfi_read_intel_pri_ext(flash_bank_t *bank) { int retval; cfi_flash_bank_t *cfi_info = bank->driver_priv; @@ -406,7 +406,7 @@ return ERROR_OK; } -int cfi_read_spansion_pri_ext(flash_bank_t *bank) +static int cfi_read_spansion_pri_ext(flash_bank_t *bank) { int retval; cfi_flash_bank_t *cfi_info = bank->driver_priv; @@ -471,7 +471,7 @@ return ERROR_OK; } -int cfi_read_atmel_pri_ext(flash_bank_t *bank) +static int cfi_read_atmel_pri_ext(flash_bank_t *bank) { int retval; cfi_atmel_pri_ext_t atmel_pri_ext; @@ -538,7 +538,7 @@ return ERROR_OK; } -int cfi_read_0002_pri_ext(flash_bank_t *bank) +static int cfi_read_0002_pri_ext(flash_bank_t *bank) { cfi_flash_bank_t *cfi_info = bank->driver_priv; @@ -552,7 +552,7 @@ } } -int cfi_spansion_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int cfi_spansion_info(struct flash_bank_s *bank, char *buf, int buf_size) { int printed; cfi_flash_bank_t *cfi_info = bank->driver_priv; @@ -587,7 +587,7 @@ return ERROR_OK; } -int cfi_intel_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int cfi_intel_info(struct flash_bank_s *bank, char *buf, int buf_size) { int printed; cfi_flash_bank_t *cfi_info = bank->driver_priv; @@ -616,7 +616,7 @@ return ERROR_OK; } -int cfi_register_commands(struct command_context_s *cmd_ctx) +static int cfi_register_commands(struct command_context_s *cmd_ctx) { /*command_t *cfi_cmd = */ register_command(cmd_ctx, NULL, "cfi", NULL, COMMAND_ANY, "flash bank cfi <base> <size> <chip_width> <bus_width> <targetNum> [jedec_probe/x16_as_x8]"); @@ -629,7 +629,7 @@ /* flash_bank cfi <base> <size> <chip_width> <bus_width> <target#> [options] */ -int cfi_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank) +static int cfi_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank) { cfi_flash_bank_t *cfi_info; int i; @@ -677,7 +677,7 @@ return ERROR_OK; } -int cfi_intel_erase(struct flash_bank_s *bank, int first, int last) +static int cfi_intel_erase(struct flash_bank_s *bank, int first, int last) { int retval; cfi_flash_bank_t *cfi_info = bank->driver_priv; @@ -721,7 +721,7 @@ } -int cfi_spansion_erase(struct flash_bank_s *bank, int first, int last) +static int cfi_spansion_erase(struct flash_bank_s *bank, int first, int last) { int retval; cfi_flash_bank_t *cfi_info = bank->driver_priv; @@ -787,7 +787,7 @@ return target->type->write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command); } -int cfi_erase(struct flash_bank_s *bank, int first, int last) +static int cfi_erase(struct flash_bank_s *bank, int first, int last) { cfi_flash_bank_t *cfi_info = bank->driver_priv; @@ -822,7 +822,7 @@ return ERROR_OK; } -int cfi_intel_protect(struct flash_bank_s *bank, int set, int first, int last) +static int cfi_intel_protect(struct flash_bank_s *bank, int set, int first, int last) { int retval; cfi_flash_bank_t *cfi_info = bank->driver_priv; @@ -939,7 +939,7 @@ return target->type->write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command); } -int cfi_protect(struct flash_bank_s *bank, int set, int first, int last) +static int cfi_protect(struct flash_bank_s *bank, int set, int first, int last) { cfi_flash_bank_t *cfi_info = bank->driver_priv; @@ -1018,7 +1018,7 @@ } } -u32 cfi_command_val(flash_bank_t *bank, u8 cmd) +static u32 cfi_command_val(flash_bank_t *bank, u8 cmd) { target_t *target = bank->target; @@ -1041,7 +1041,7 @@ } } -int cfi_intel_write_block(struct flash_bank_s *bank, u8 *buffer, u32 address, u32 count) +static int cfi_intel_write_block(struct flash_bank_s *bank, u8 *buffer, u32 address, u32 count) { cfi_flash_bank_t *cfi_info = bank->driver_priv; target_t *target = bank->target; @@ -1285,7 +1285,7 @@ return retval; } -int cfi_spansion_write_block(struct flash_bank_s *bank, u8 *buffer, u32 address, u32 count) +static int cfi_spansion_write_block(struct flash_bank_s *bank, u8 *buffer, u32 address, u32 count) { cfi_flash_bank_t *cfi_info = bank->driver_priv; cfi_spansion_pri_ext_t *pri_ext = cfi_info->pri_ext; @@ -1547,7 +1547,7 @@ return exit_code; } -int cfi_intel_write_word(struct flash_bank_s *bank, u8 *word, u32 address) +static int cfi_intel_write_word(struct flash_bank_s *bank, u8 *word, u32 address) { int retval; cfi_flash_bank_t *cfi_info = bank->driver_priv; @@ -1581,7 +1581,7 @@ return ERROR_OK; } -int cfi_intel_write_words(struct flash_bank_s *bank, u8 *word, u32 wordcount, u32 address) +static int cfi_intel_write_words(struct flash_bank_s *bank, u8 *word, u32 wordcount, u32 address) { int retval; cfi_flash_bank_t *cfi_info = bank->driver_priv; @@ -1673,7 +1673,7 @@ return ERROR_OK; } -int cfi_spansion_write_word(struct flash_bank_s *bank, u8 *word, u32 address) +static int cfi_spansion_write_word(struct flash_bank_s *bank, u8 *word, u32 address) { int retval; cfi_flash_bank_t *cfi_info = bank->driver_priv; @@ -1719,7 +1719,7 @@ return ERROR_OK; } -int cfi_spansion_write_words(struct flash_bank_s *bank, u8 *word, u32 wordcount, u32 address) +static int cfi_spansion_write_words(struct flash_bank_s *bank, u8 *word, u32 wordcount, u32 address) { int retval; cfi_flash_bank_t *cfi_info = bank->driver_priv; @@ -1811,7 +1811,7 @@ return ERROR_OK; } -int cfi_write_word(struct flash_bank_s *bank, u8 *word, u32 address) +static int cfi_write_word(struct flash_bank_s *bank, u8 *word, u32 address) { cfi_flash_bank_t *cfi_info = bank->driver_priv; @@ -1832,7 +1832,7 @@ return ERROR_FLASH_OPERATION_FAILED; } -int cfi_write_words(struct flash_bank_s *bank, u8 *word, u32 wordcount, u32 address) +static int cfi_write_words(struct flash_bank_s *bank, u8 *word, u32 wordcount, u32 address) { cfi_flash_bank_t *cfi_info = bank->driver_priv; @@ -2062,7 +2062,7 @@ return target->type->write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, current_word); } -void cfi_fixup_atmel_reversed_erase_regions(flash_bank_t *bank, void *param) +static void cfi_fixup_atmel_reversed_erase_regions(flash_bank_t *bank, void *param) { cfi_flash_bank_t *cfi_info = bank->driver_priv; cfi_spansion_pri_ext_t *pri_ext = cfi_info->pri_ext; @@ -2070,7 +2070,7 @@ pri_ext->_reversed_geometry = 1; } -void cfi_fixup_0002_erase_regions(flash_bank_t *bank, void *param) +static void cfi_fixup_0002_erase_regions(flash_bank_t *bank, void *param) { int i; cfi_flash_bank_t *cfi_info = bank->driver_priv; @@ -2092,7 +2092,7 @@ } } -void cfi_fixup_0002_unlock_addresses(flash_bank_t *bank, void *param) +static void cfi_fixup_0002_unlock_addresses(flash_bank_t *bank, void *param) { cfi_flash_bank_t *cfi_info = bank->driver_priv; cfi_spansion_pri_ext_t *pri_ext = cfi_info->pri_ext; @@ -2102,7 +2102,7 @@ pri_ext->_unlock2 = unlock_addresses->unlock2; } -int cfi_probe(struct flash_bank_s *bank) +static int cfi_probe(struct flash_bank_s *bank) { cfi_flash_bank_t *cfi_info = bank->driver_priv; target_t *target = bank->target; @@ -2379,7 +2379,7 @@ return ERROR_OK; } -int cfi_auto_probe(struct flash_bank_s *bank) +static int cfi_auto_probe(struct flash_bank_s *bank) { cfi_flash_bank_t *cfi_info = bank->driver_priv; if (cfi_info->probed) @@ -2388,7 +2388,7 @@ } -int cfi_intel_protect_check(struct flash_bank_s *bank) +static int cfi_intel_protect_check(struct flash_bank_s *bank) { int retval; cfi_flash_bank_t *cfi_info = bank->driver_priv; @@ -2421,7 +2421,7 @@ return target->type->write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command); } -int cfi_spansion_protect_check(struct flash_bank_s *bank) +static int cfi_spansion_protect_check(struct flash_bank_s *bank) { int retval; cfi_flash_bank_t *cfi_info = bank->driver_priv; @@ -2462,7 +2462,7 @@ return target->type->write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command); } -int cfi_protect_check(struct flash_bank_s *bank) +static int cfi_protect_check(struct flash_bank_s *bank) { cfi_flash_bank_t *cfi_info = bank->driver_priv; @@ -2492,7 +2492,7 @@ return ERROR_OK; } -int cfi_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int cfi_info(struct flash_bank_s *bank, char *buf, int buf_size) { int printed; cfi_flash_bank_t *cfi_info = bank->driver_priv; Modified: trunk/src/flash/ecos.c =================================================================== --- trunk/src/flash/ecos.c 2009-04-15 15:44:26 UTC (rev 1461) +++ trunk/src/flash/ecos.c 2009-04-18 10:08:13 UTC (rev 1462) @@ -36,19 +36,21 @@ #include "../target/embeddedice.h" #include "types.h" -int ecosflash_register_commands(struct command_context_s *cmd_ctx); -int ecosflash_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank); -int ecosflash_erase(struct flash_bank_s *bank, int first, int last); -int ecosflash_protect(struct flash_bank_s *bank, int set, int first, int last); -int ecosflash_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count); -int ecosflash_probe(struct flash_bank_s *bank); -int ecosflash_protect_check(struct flash_bank_s *bank); -int ecosflash_info(struct flash_bank_s *bank, char *buf, int buf_size); +static int ecosflash_register_commands(struct command_context_s *cmd_ctx); +static int ecosflash_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank); +static int ecosflash_erase(struct flash_bank_s *bank, int first, int last); +static int ecosflash_protect(struct flash_bank_s *bank, int set, int first, int last); +static int ecosflash_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count); +static int ecosflash_probe(struct flash_bank_s *bank); +static int ecosflash_protect_check(struct flash_bank_s *bank); +static int ecosflash_info(struct flash_bank_s *bank, char *buf, int buf_size); -u32 ecosflash_get_flash_status(flash_bank_t *bank); -void ecosflash_set_flash_mode(flash_bank_t *bank,int mode); -u32 ecosflash_wait_status_busy(flash_bank_t *bank, u32 waitbits, int timeout); -int ecosflash_handle_gpnvm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); +#if 0 +static u32 ecosflash_get_flash_status(flash_bank_t *bank); +static void ecosflash_set_flash_mode(flash_bank_t *bank,int mode); +static u32 ecosflash_wait_status_busy(flash_bank_t *bank, u32 waitbits, int timeout); +static int ecosflash_handle_gpnvm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); +#endif flash_driver_t ecosflash_flash = { @@ -136,7 +138,7 @@ /* flash bank ecosflash <base> <size> <chip_width> <bus_width> <target#> <driverPath> */ -int ecosflash_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank) +static int ecosflash_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank) { ecosflash_flash_bank_t *info; @@ -181,7 +183,7 @@ return ERROR_OK; } -int loadDriver(ecosflash_flash_bank_t *info) +static int loadDriver(ecosflash_flash_bank_t *info) { u32 buf_cnt; u32 image_size; @@ -230,7 +232,7 @@ static int const OFFSET_GET_WORKAREA=0x18; static int const OFFSET_GET_WORKAREA_SIZE=0x4; -int runCode(ecosflash_flash_bank_t *info, +static int runCode(ecosflash_flash_bank_t *info, u32 codeStart, u32 codeStop, u32 r0, u32 r1, u32 r2, u32 *result, /* timeout in ms */ @@ -271,7 +273,7 @@ return ERROR_OK; } -int eCosBoard_erase(ecosflash_flash_bank_t *info, u32 address, u32 len) +static int eCosBoard_erase(ecosflash_flash_bank_t *info, u32 address, u32 len) { int retval; int timeout = (len / 20480 + 1) * 1000; /*asume 20 KB/s*/ @@ -302,7 +304,7 @@ return ERROR_OK; } -int eCosBoard_flash(ecosflash_flash_bank_t *info, void *data, u32 address, u32 len) +static int eCosBoard_flash(ecosflash_flash_bank_t *info, void *data, u32 address, u32 len) { target_t *target=info->target; const int chunk=8192; @@ -361,12 +363,12 @@ return ERROR_OK; } -int ecosflash_probe(struct flash_bank_s *bank) +static int ecosflash_probe(struct flash_bank_s *bank) { return ERROR_OK; } -int ecosflash_register_commands(struct command_context_s *cmd_ctx) +static int ecosflash_register_commands(struct command_context_s *cmd_ctx) { register_command(cmd_ctx, NULL, "ecosflash", NULL, COMMAND_ANY, NULL); @@ -396,7 +398,8 @@ } #endif -u32 ecosflash_address(struct flash_bank_s *bank, u32 address) +#if 0 +static u32 ecosflash_address(struct flash_bank_s *bank, u32 address) { u32 retval = 0; switch(bank->bus_width) @@ -411,54 +414,57 @@ return retval + bank->base; } +#endif -int ecosflash_erase(struct flash_bank_s *bank, int first, int last) +static int ecosflash_erase(struct flash_bank_s *bank, int first, int last) { struct flash_bank_s *c=bank; ecosflash_flash_bank_t *info = bank->driver_priv; return eCosBoard_erase(info, c->base+first*sectorSize, sectorSize*(last-first+1)); } -int ecosflash_protect(struct flash_bank_s *bank, int set, int first, int last) +static int ecosflash_protect(struct flash_bank_s *bank, int set, int first, int last) { return ERROR_OK; } -int ecosflash_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) +static int ecosflash_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) { ecosflash_flash_bank_t *info = bank->driver_priv; struct flash_bank_s *c=bank; return eCosBoard_flash(info, buffer, c->base+offset, count); } -int ecosflash_protect_check(struct flash_bank_s *bank) +static int ecosflash_protect_check(struct flash_bank_s *bank) { return ERROR_OK; } -int ecosflash_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int ecosflash_info(struct flash_bank_s *bank, char *buf, int buf_size) { ecosflash_flash_bank_t *info = bank->driver_priv; snprintf(buf, buf_size, "eCos flash driver: %s", info->driverPath); return ERROR_OK; } -u32 ecosflash_get_flash_status(flash_bank_t *bank) +#if 0 +static u32 ecosflash_get_flash_status(flash_bank_t *bank) { return ERROR_OK; } -void ecosflash_set_flash_mode(flash_bank_t *bank,int mode) +static void ecosflash_set_flash_mode(flash_bank_t *bank,int mode) { } -u32 ecosflash_wait_status_busy(flash_bank_t *bank, u32 waitbits, int timeout) +static u32 ecosflash_wait_status_busy(flash_bank_t *bank, u32 waitbits, int timeout) { return ERROR_OK; } -int ecosflash_handle_gpnvm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +static int ecosflash_handle_gpnvm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { return ERROR_OK; } +#endif Modified: trunk/src/flash/flash.c =================================================================== --- trunk/src/flash/flash.c 2009-04-15 15:44:26 UTC (rev 1461) +++ trunk/src/flash/flash.c 2009-04-18 10:08:13 UTC (rev 1462) @@ -48,19 +48,17 @@ #include <inttypes.h> /* command handlers */ -int handle_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); -int handle_flash_info_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); -int handle_flash_probe_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); -int handle_flash_erase_check_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); -int handle_flash_erase_address_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); -int handle_flash_protect_check_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); -int handle_flash_erase_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); -int handle_flash_write_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); -int handle_flash_write_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); -int handle_flash_write_image_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); -int handle_flash_fill_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); -int handle_flash_protect_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); -flash_bank_t *get_flash_bank_by_addr(target_t *target, u32 addr); +static int handle_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); +static int handle_flash_info_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); +static int handle_flash_probe_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); +static int handle_flash_erase_check_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); +static int handle_flash_erase_address_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); +static int handle_flash_protect_check_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); +static int handle_flash_erase_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); +static int handle_flash_write_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); +static int handle_flash_write_image_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); +static int handle_flash_fill_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); +static int handle_flash_protect_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); /* flash drivers */ @@ -265,7 +263,7 @@ return p; } -int handle_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +static int handle_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { int retval; int i; @@ -345,7 +343,7 @@ return ERROR_OK; } -int handle_flash_info_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +static int handle_flash_info_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { flash_bank_t *p; int i = 0; @@ -396,7 +394,7 @@ return ERROR_OK; } -int handle_flash_probe_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +static int handle_flash_probe_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { flash_bank_t *p; int retval; @@ -432,7 +430,7 @@ return ERROR_OK; } -int handle_flash_erase_check_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +static int handle_flash_erase_check_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { flash_bank_t *p; int retval; @@ -476,7 +474,7 @@ return ERROR_OK; } -int handle_flash_erase_address_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +static int handle_flash_erase_address_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { flash_bank_t *p; int retval; @@ -524,7 +522,7 @@ return retval; } -int handle_flash_protect_check_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +static int handle_flash_protect_check_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { flash_bank_t *p; int retval; @@ -558,7 +556,7 @@ return ERROR_OK; } -int handle_flash_erase_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +static int handle_flash_erase_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { if (argc > 2) { @@ -595,7 +593,7 @@ return ERROR_OK; } -int handle_flash_protect_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +static int handle_flash_protect_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { if (argc > 3) { @@ -634,7 +632,7 @@ return ERROR_OK; } -int handle_flash_write_image_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +static int handle_flash_write_image_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { target_t *target = get_current_target(cmd_ctx); @@ -719,7 +717,7 @@ return retval; } -int handle_flash_fill_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +static int handle_flash_fill_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { int err = ERROR_OK, retval; u32 address; @@ -819,7 +817,7 @@ return ERROR_OK; } -int handle_flash_write_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +static int handle_flash_write_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { u32 offset; u8 *buffer; Modified: trunk/src/flash/lpc2000.c =================================================================== --- trunk/src/flash/lpc2000.c 2009-04-15 15:44:26 UTC (rev 1461) +++ trunk/src/flash/lpc2000.c 2009-04-18 10:08:13 UTC (rev 1462) @@ -51,17 +51,17 @@ * - 2378 */ -int lpc2000_register_commands(struct command_context_s *cmd_ctx); -int lpc2000_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank); -int lpc2000_erase(struct flash_bank_s *bank, int first, int last); -int lpc2000_protect(struct flash_bank_s *bank, int set, int first, int last); -int lpc2000_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count); -int lpc2000_probe(struct flash_bank_s *bank); -int lpc2000_erase_check(struct flash_bank_s *bank); -int lpc2000_protect_check(struct flash_bank_s *bank); -int lpc2000_info(struct flash_bank_s *bank, char *buf, int buf_size); +static int lpc2000_register_commands(struct command_context_s *cmd_ctx); +static int lpc2000_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank); +static int lpc2000_erase(struct flash_bank_s *bank, int first, int last); +static int lpc2000_protect(struct flash_bank_s *bank, int set, int first, int last); +static int lpc2000_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count); +static int lpc2000_probe(struct flash_bank_s *bank); +static int lpc2000_erase_check(struct flash_bank_s *bank); +static int lpc2000_protect_check(struct flash_bank_s *bank); +static int lpc2000_info(struct flash_bank_s *bank, char *buf, int buf_size); -int lpc2000_handle_part_id_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); +static int lpc2000_handle_part_id_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); flash_driver_t lpc2000_flash = { @@ -78,7 +78,7 @@ .info = lpc2000_info }; -int lpc2000_register_commands(struct command_context_s *cmd_ctx) +static int lpc2000_register_commands(struct command_context_s *cmd_ctx) { command_t *lpc2000_cmd = register_command(cmd_ctx, NULL, "lpc2000", NULL, COMMAND_ANY, NULL); @@ -88,7 +88,7 @@ return ERROR_OK; } -int lpc2000_build_sector_list(struct flash_bank_s *bank) +static int lpc2000_build_sector_list(struct flash_bank_s *bank) { lpc2000_flash_bank_t *lpc2000_info = bank->driver_priv; @@ -239,7 +239,7 @@ * 0x20 to 0x2b: command result table * 0x2c to 0xac: stack (only 128b needed) */ -int lpc2000_iap_call(flash_bank_t *bank, int code, u32 param_table[5], u32 result_table[2]) +static int lpc2000_iap_call(flash_bank_t *bank, int code, u32 param_table[5], u32 result_table[2]) { int retval; lpc2000_flash_bank_t *lpc2000_info = bank->driver_priv; @@ -322,14 +322,14 @@ return status_code; } -int lpc2000_iap_blank_check(struct flash_bank_s *bank, int first, int last) +static int lpc2000_iap_blank_check(struct flash_bank_s *bank, int first, int last) { u32 param_table[5]; u32 result_table[2]; int status_code; int i; - if ((first < 0) || (last > bank->num_sectors)) + if ((first < 0) || (last >= bank->num_sectors)) return ERROR_FLASH_SECTOR_INVALID; for (i = first; i <= last; i++) @@ -365,7 +365,7 @@ /* flash bank lpc2000 <base> <size> 0 0 <target#> <lpc_variant> <cclk> [calc_checksum] */ -int lpc2000_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank) +static int lpc2000_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank) { lpc2000_flash_bank_t *lpc2000_info; @@ -413,7 +413,7 @@ return ERROR_OK; } -int lpc2000_erase(struct flash_bank_s *bank, int first, int last) +static int lpc2000_erase(struct flash_bank_s *bank, int first, int last) { lpc2000_flash_bank_t *lpc2000_info = bank->driver_priv; u32 param_table[5]; @@ -465,13 +465,13 @@ return ERROR_OK; } -int lpc2000_protect(struct flash_bank_s *bank, int set, int first, int last) +static int lpc2000_protect(struct flash_bank_s *bank, int set, int first, int last) { /* can't protect/unprotect on the lpc2000 */ return ERROR_OK; } -int lpc2000_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) +static int lpc2000_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) { lpc2000_flash_bank_t *lpc2000_info = bank->driver_priv; target_t *target = bank->target; @@ -635,7 +635,7 @@ return retval; } -int lpc2000_probe(struct flash_bank_s *bank) +static int lpc2000_probe(struct flash_bank_s *bank) { /* we can't probe on an lpc2000 * if this is an lpc2xxx, it has the configured flash @@ -643,7 +643,7 @@ return ERROR_OK; } -int lpc2000_erase_check(struct flash_bank_s *bank) +static int lpc2000_erase_check(struct flash_bank_s *bank) { if (bank->target->state != TARGET_HALTED) { @@ -654,13 +654,13 @@ return lpc2000_iap_blank_check(bank, 0, bank->num_sectors - 1); } -int lpc2000_protect_check(struct flash_bank_s *bank) +static int lpc2000_protect_check(struct flash_bank_s *bank) { /* sectors are always protected */ return ERROR_OK; } -int lpc2000_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int lpc2000_info(struct flash_bank_s *bank, char *buf, int buf_size) { lpc2000_flash_bank_t *lpc2000_info = bank->driver_priv; @@ -669,7 +669,7 @@ return ERROR_OK; } -int lpc2000_handle_part_id_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +static int lpc2000_handle_part_id_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { flash_bank_t *bank; u32 param_table[5]; Modified: trunk/src/flash/lpc288x.c =================================================================== --- trunk/src/flash/lpc288x.c 2009-04-15 15:44:26 UTC (rev 1461) +++ trunk/src/flash/lpc288x.c 2009-04-18 10:08:13 UTC (rev 1462) @@ -94,22 +94,19 @@ /* F_CLK_TIME */ #define FCT_CLK_DIV_MASK 0x0FFF -int lpc288x_register_commands(struct command_context_s *cmd_ctx); -int lpc288x_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank); -int lpc288x_erase(struct flash_bank_s *bank, int first, int last); -int lpc288x_protect(struct flash_bank_s *bank, int set, int first, int last); -int lpc288x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count); -int lpc288x_probe(struct flash_bank_s *bank); -int lpc288x_auto_probe(struct flash_bank_s *bank); -int lpc288x_erase_check(struct flash_bank_s *bank); -int lpc288x_protect_check(struct flash_bank_s *bank); -int lpc288x_info(struct flash_bank_s *bank, char *buf, int buf_size); -void lpc288x_set_flash_mode(flash_bank_t *bank, u8 flashplane, int mode); -u32 lpc288x_wait_status_busy(flash_bank_t *bank, int timeout); -void lpc288x_load_timer(int erase, struct target_s *target); -void lpc288x_set_flash_clk(struct flash_bank_s *bank); -u32 lpc288x_system_ready(struct flash_bank_s *bank); -int lpc288x_handle_part_id_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); +static int lpc288x_register_commands(struct command_context_s *cmd_ctx); +static int lpc288x_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank); +static int lpc288x_erase(struct flash_bank_s *bank, int first, int last); +static int lpc288x_protect(struct flash_bank_s *bank, int set, int first, int last); +static int lpc288x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count); +static int lpc288x_probe(struct flash_bank_s *bank); +static int lpc288x_erase_check(struct flash_bank_s *bank); +static int lpc288x_protect_check(struct flash_bank_s *bank); +static int lpc288x_info(struct flash_bank_s *bank, char *buf, int buf_size); +static u32 lpc288x_wait_status_busy(flash_bank_t *bank, int timeout); +static void lpc288x_load_timer(int erase, struct target_s *target); +static void lpc288x_set_flash_clk(struct flash_bank_s *bank); +static u32 lpc288x_system_ready(struct flash_bank_s *bank); flash_driver_t lpc288x_flash = { @@ -126,12 +123,12 @@ .info = lpc288x_info }; -int lpc288x_register_commands(struct command_context_s *cmd_ctx) +static int lpc288x_register_commands(struct command_context_s *cmd_ctx) { return ERROR_OK; } -u32 lpc288x_wait_status_busy(flash_bank_t *bank, int timeout) +static u32 lpc288x_wait_status_busy(flash_bank_t *bank, int timeout) { u32 status; target_t *target = bank->target; @@ -151,7 +148,7 @@ } /* Read device id register and fill in driver info structure */ -int lpc288x_read_part_info(struct flash_bank_s *bank) +static int lpc288x_read_part_info(struct flash_bank_s *bank) { lpc288x_flash_bank_t *lpc288x_info = bank->driver_priv; target_t *target = bank->target; @@ -201,13 +198,13 @@ return ERROR_OK; } -int lpc288x_protect_check(struct flash_bank_s *bank) +static int lpc288x_protect_check(struct flash_bank_s *bank) { return ERROR_OK; } /* flash_bank LPC288x 0 0 0 0 <target#> <cclk> */ -int lpc288x_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank) +static int lpc288x_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank) { lpc288x_flash_bank_t *lpc288x_info; @@ -232,7 +229,7 @@ * AHB = 12 MHz ? * 12000000/66000 = 182 * CLK_DIV = 60 ? */ -void lpc288x_set_flash_clk(struct flash_bank_s *bank) +static void lpc288x_set_flash_clk(struct flash_bank_s *bank) { u32 clk_time; lpc288x_flash_bank_t *lpc288x_info = bank->driver_priv; @@ -247,7 +244,7 @@ * LOAD_TIMER_WRITE FPT_TIME = ((1,000,000 / AHB tcyc (in ns)) - 2) / 512 * = 23 (75) (AN10548 72 - is this wrong?) * TODO: Sort out timing calcs ... [truncated message content] |
From: <oh...@ma...> - 2009-04-15 17:44:29
|
Author: oharboe Date: 2009-04-15 17:44:26 +0200 (Wed, 15 Apr 2009) New Revision: 1461 Added: trunk/src/target/target/lpc2124.cfg Log: Jesus Sanchez-Palencia <jes...@op...> Added: trunk/src/target/target/lpc2124.cfg =================================================================== --- trunk/src/target/target/lpc2124.cfg 2009-04-15 15:19:35 UTC (rev 1460) +++ trunk/src/target/target/lpc2124.cfg 2009-04-15 15:44:26 UTC (rev 1461) @@ -0,0 +1,38 @@ +#LPC-2124 CPU + +if { [info exists CHIPNAME] } { + set _CHIPNAME $CHIPNAME +} else { + set _CHIPNAME lpc2124 +} + +if { [info exists ENDIAN] } { + set _ENDIAN $ENDIAN +} else { + set _ENDIAN little +} + +if { [info exists CPUTAPID ] } { + set _CPUTAPID $CPUTAPID +} else { + # force an error till we get a good number + set _CPUTAPID 0x4f1f0f0f +} + + +#use combined on interfaces or targets that can't set TRST/SRST separately +reset_config trst_and_srst srst_pulls_trst +jtag_nsrst_delay 10 +jtag_khz 1000 + +#jtag scan chain +jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID + +set _TARGETNAME [format "%s.cpu" $_CHIPNAME] +target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm7tdmi-s_r4 + +$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x40000000 -work-area-size 0x4000 -work-area-backup 0 + + +#flash bank <driver> <base> <size> <chip_width> <bus_width> +flash bank lpc2000 0x0 0x40000 0 0 0 lpc2000_v1 14745 calc_checksum |
From: <oh...@ma...> - 2009-04-15 17:19:37
|
Author: oharboe Date: 2009-04-15 17:19:35 +0200 (Wed, 15 Apr 2009) New Revision: 1460 Modified: trunk/src/target/board/olimex_stm32_h103.cfg Log: Piotr Esden-Tempski <pi...@es...> Corrected olimex_stm32_h103 board config Modified: trunk/src/target/board/olimex_stm32_h103.cfg =================================================================== --- trunk/src/target/board/olimex_stm32_h103.cfg 2009-04-15 15:17:44 UTC (rev 1459) +++ trunk/src/target/board/olimex_stm32_h103.cfg 2009-04-15 15:19:35 UTC (rev 1460) @@ -4,6 +4,7 @@ # http://olimex.com/dev/stm32-h103.html # +set BSTAPID 0x16410041 + source [find target/stm32.cfg] -set _BSTAPID 0x16410041 |
From: <oh...@ma...> - 2009-04-15 17:17:47
|
Author: oharboe Date: 2009-04-15 17:17:44 +0200 (Wed, 15 Apr 2009) New Revision: 1459 Modified: trunk/src/flash/cfi.c Log: Nico Coesel <nc...@de...> Chip width / bus width bug in cfi driver Modified: trunk/src/flash/cfi.c =================================================================== --- trunk/src/flash/cfi.c 2009-04-15 15:13:36 UTC (rev 1458) +++ trunk/src/flash/cfi.c 2009-04-15 15:17:44 UTC (rev 1459) @@ -1589,7 +1589,7 @@ u8 command[8]; /* Calculate buffer size and boundary mask */ - u32 buffersize = 1UL << cfi_info->max_buf_write_size; + u32 buffersize = (1UL << cfi_info->max_buf_write_size) * (bank->bus_width / bank->chip_width); u32 buffermask = buffersize-1; u32 bufferwsize; @@ -1609,6 +1609,9 @@ return ERROR_FLASH_OPERATION_FAILED; } + bufferwsize/=(bank->bus_width / bank->chip_width); + + /* Check for valid size */ if (wordcount > bufferwsize) { @@ -1725,7 +1728,7 @@ cfi_spansion_pri_ext_t *pri_ext = cfi_info->pri_ext; /* Calculate buffer size and boundary mask */ - u32 buffersize = 1UL << cfi_info->max_buf_write_size; + u32 buffersize = (1UL << cfi_info->max_buf_write_size) * (bank->bus_width / bank->chip_width); u32 buffermask = buffersize-1; u32 bufferwsize; @@ -1745,6 +1748,8 @@ return ERROR_FLASH_OPERATION_FAILED; } + bufferwsize/=(bank->bus_width / bank->chip_width); + /* Check for valid size */ if (wordcount > bufferwsize) { @@ -1946,7 +1951,8 @@ { if (retval == ERROR_TARGET_RESOURCE_NOT_AVAILABLE) { - u32 buffersize = 1UL << cfi_info->max_buf_write_size; + //adjust buffersize for chip width + u32 buffersize = (1UL << cfi_info->max_buf_write_size) * (bank->bus_width / bank->chip_width); u32 buffermask = buffersize-1; u32 bufferwsize; @@ -1959,6 +1965,8 @@ LOG_ERROR("Unsupported chip width %d", bank->chip_width); return ERROR_FLASH_OPERATION_FAILED; } + + bufferwsize/=(bank->bus_width / bank->chip_width); /* fall back to memory writes */ while (count >= bank->bus_width) |
From: <oh...@ma...> - 2009-04-15 17:13:39
|
Author: oharboe Date: 2009-04-15 17:13:36 +0200 (Wed, 15 Apr 2009) New Revision: 1458 Added: trunk/src/target/target/lpc2378.cfg Log: Freddie Chopin <fre...@op...> LPC2378 config file Added: trunk/src/target/target/lpc2378.cfg =================================================================== --- trunk/src/target/target/lpc2378.cfg 2009-04-14 19:17:17 UTC (rev 1457) +++ trunk/src/target/target/lpc2378.cfg 2009-04-15 15:13:36 UTC (rev 1458) @@ -0,0 +1,49 @@ +# NXP LPC2378 ARM7TDMI-S with 512kB Flash and 32kB Local On-Chip SRAM (58kB total), clocked with 4MHz internal RC oscillator + +if { [info exists CHIPNAME] } { + set _CHIPNAME $CHIPNAME +} else { + set _CHIPNAME lpc2378 +} + +if { [info exists ENDIAN] } { + set _ENDIAN $ENDIAN +} else { + set _ENDIAN little +} + +if { [info exists CPUTAPID ] } { + set _CPUTAPID $CPUTAPID +} else { + set _CPUTAPID 0x4f1f0f0f +} + +#delays on reset lines +jtag_nsrst_delay 200 +jtag_ntrst_delay 200 + +# LPC2000 -> SRST causes TRST +reset_config trst_and_srst srst_pulls_trst + +jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID + +set _TARGETNAME [format "%s.cpu" $_CHIPNAME] +target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm7tdmi-s_r4 + +# LPC2378 has 32kB of SRAM on its main system bus (so-called Local On-Chip SRAM) +$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x40000000 -work-area-size 0x8000 -work-area-backup 0 + +$_TARGETNAME configure -event reset-init { + # Force target into ARM state + soft_reset_halt + #do not remap 0x0000-0x0020 to anything but the flash + mwb 0xE01FC040 0x01 +} + +# LPC2378 has 512kB of FLASH, but upper 8kB are occupied by bootloader. +# After reset the chip uses its internal 4MHz RC oscillator +#flash bank lpc2000 <base> <size> 0 0 <target#> <variant> +flash bank lpc2000 0x0 0x0007D000 0 0 0 lpc2000_v2 4000 calc_checksum + +# 4MHz / 6 = 666kHz, so use 500 +jtag_khz 500 |
From: <oh...@ma...> - 2009-04-14 21:17:20
|
Author: oharboe Date: 2009-04-14 21:17:17 +0200 (Tue, 14 Apr 2009) New Revision: 1457 Modified: trunk/src/xsvf/xsvf.c Log: Dick Hollenbeck <di...@so...> work in progress Modified: trunk/src/xsvf/xsvf.c =================================================================== --- trunk/src/xsvf/xsvf.c 2009-04-14 17:17:38 UTC (rev 1456) +++ trunk/src/xsvf/xsvf.c 2009-04-14 19:17:17 UTC (rev 1457) @@ -9,7 +9,7 @@ * pet...@ht... * * * * Copyright (C) 2009 SoftPLC Corporation. http://softplc.com * - * di...@so... * + * Dick Hollenbeck <di...@so...> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -352,659 +352,652 @@ switch (opcode) { - case XCOMPLETE: - LOG_DEBUG("XCOMPLETE"); + case XCOMPLETE: + LOG_DEBUG("XCOMPLETE"); - result = jtag_execute_queue(); - if (result != ERROR_OK) - { - tdo_mismatch = 1; - break; - } + result = jtag_execute_queue(); + if (result != ERROR_OK) + { + tdo_mismatch = 1; break; + } + break; - case XTDOMASK: - LOG_DEBUG("XTDOMASK"); - if (dr_in_mask && (xsvf_read_buffer(xsdrsize, xsvf_fd, dr_in_mask) != ERROR_OK)) - do_abort = 1; - break; + case XTDOMASK: + LOG_DEBUG("XTDOMASK"); + if (dr_in_mask && (xsvf_read_buffer(xsdrsize, xsvf_fd, dr_in_mask) != ERROR_OK)) + do_abort = 1; + break; - case XRUNTEST: + case XRUNTEST: + { + u8 xruntest_buf[4]; + + if (read(xsvf_fd, xruntest_buf, 4) < 0) { - u8 xruntest_buf[4]; + do_abort = 1; + break; + } - if (read(xsvf_fd, xruntest_buf, 4) < 0) - { - do_abort = 1; - break; - } + xruntest = be_to_h_u32(xruntest_buf); + LOG_DEBUG("XRUNTEST %d 0x%08X", xruntest, xruntest); + } + break; - xruntest = be_to_h_u32(xruntest_buf); - LOG_DEBUG("XRUNTEST %d 0x%08X", xruntest, xruntest); - } - break; + case XREPEAT: + { + u8 myrepeat; - case XREPEAT: + if (read(xsvf_fd, &myrepeat, 1) < 0) + do_abort = 1; + else { - u8 myrepeat; - - if (read(xsvf_fd, &myrepeat, 1) < 0) - do_abort = 1; - else - { - xrepeat = myrepeat; - LOG_DEBUG("XREPEAT %d", xrepeat ); - } + xrepeat = myrepeat; + LOG_DEBUG("XREPEAT %d", xrepeat ); } - break; + } + break; - case XSDRSIZE: + case XSDRSIZE: + { + u8 xsdrsize_buf[4]; + + if (read(xsvf_fd, xsdrsize_buf, 4) < 0) { - u8 xsdrsize_buf[4]; + do_abort = 1; + break; + } - if (read(xsvf_fd, xsdrsize_buf, 4) < 0) - { - do_abort = 1; - break; - } + xsdrsize = be_to_h_u32(xsdrsize_buf); + LOG_DEBUG("XSDRSIZE %d", xsdrsize); - xsdrsize = be_to_h_u32(xsdrsize_buf); - LOG_DEBUG("XSDRSIZE %d", xsdrsize); + if( dr_out_buf ) free(dr_out_buf); + if( dr_in_buf) free(dr_in_buf); + if( dr_in_mask) free(dr_in_mask); - if( dr_out_buf ) free(dr_out_buf); - if( dr_in_buf) free(dr_in_buf); - if( dr_in_mask) free(dr_in_mask); + dr_out_buf = malloc((xsdrsize + 7) / 8); + dr_in_buf = malloc((xsdrsize + 7) / 8); + dr_in_mask = malloc((xsdrsize + 7) / 8); + } + break; - dr_out_buf = malloc((xsdrsize + 7) / 8); - dr_in_buf = malloc((xsdrsize + 7) / 8); - dr_in_mask = malloc((xsdrsize + 7) / 8); - } - break; + case XSDR: /* these two are identical except for the dr_in_buf */ + case XSDRTDO: + { + int limit = xrepeat; + int matched = 0; + int attempt; - case XSDR: /* these two are identical except for the dr_in_buf */ - case XSDRTDO: + const char* op_name = (opcode == XSDR ? "XSDR" : "XSDRTDO"); + + if (xsvf_read_buffer(xsdrsize, xsvf_fd, dr_out_buf) != ERROR_OK) { - int limit = xrepeat; - int matched = 0; - int attempt; + do_abort = 1; + break; + } - const char* op_name = (opcode == XSDR ? "XSDR" : "XSDRTDO"); - - if (xsvf_read_buffer(xsdrsize, xsvf_fd, dr_out_buf) != ERROR_OK) + if (opcode == XSDRTDO) + { + if(xsvf_read_buffer(xsdrsize, xsvf_fd, dr_in_buf) != ERROR_OK ) { do_abort = 1; break; } + } - if (opcode == XSDRTDO) - { - if(xsvf_read_buffer(xsdrsize, xsvf_fd, dr_in_buf) != ERROR_OK ) - { - do_abort = 1; - break; - } - } + if (limit < 1) + limit = 1; - if (limit < 1) - limit = 1; + LOG_DEBUG("%s %d", op_name, xsdrsize); - LOG_DEBUG("%s %d", op_name, xsdrsize); + for( attempt=0; attempt<limit; ++attempt ) + { + scan_field_t field; - for( attempt=0; attempt<limit; ++attempt ) + if( attempt>0 ) { - scan_field_t field; + /* perform the XC9500 exception handling sequence shown in xapp067.pdf and + illustrated in psuedo code at end of this file. We start from state + DRPAUSE: + go to Exit2-DR + go to Shift-DR + go to Exit1-DR + go to Update-DR + go to Run-Test/Idle - if( attempt>0 ) - { - /* perform the XC9500 exception handling sequence shown in xapp067.pdf and - illustrated in psuedo code at end of this file. We start from state - DRPAUSE: - go to Exit2-DR - go to Shift-DR - go to Exit1-DR - go to Update-DR - go to Run-Test/Idle + This sequence should be harmless for other devices, and it + will be skipped entirely if xrepeat is set to zero. + */ - This sequence should be harmless for other devices, and it - will be skipped entirely if xrepeat is set to zero. - */ + static tap_state_t exception_path[] = { + TAP_DREXIT2, + TAP_DRSHIFT, + TAP_DREXIT1, + TAP_DRUPDATE, + TAP_IDLE, + }; - static tap_state_t exception_path[] = { - TAP_DREXIT2, - TAP_DRSHIFT, - TAP_DREXIT1, - TAP_DRUPDATE, - TAP_IDLE, - }; + jtag_add_pathmove( sizeof(exception_path)/sizeof(exception_path[0]), exception_path); - jtag_add_pathmove( sizeof(exception_path)/sizeof(exception_path[0]), exception_path); + if (verbose) + LOG_USER("%s mismatch, xsdrsize=%d retry=%d", op_name, xsdrsize, attempt); + } - if (verbose) - LOG_USER("%s %d retry %d", op_name, xsdrsize, attempt); - } + field.tap = tap; + field.num_bits = xsdrsize; + field.out_value = dr_out_buf; + field.out_mask = NULL; + field.in_value = NULL; - field.tap = tap; - field.num_bits = xsdrsize; - field.out_value = dr_out_buf; - field.out_mask = NULL; - field.in_value = NULL; + jtag_set_check_value(&field, dr_in_buf, dr_in_mask, NULL); - jtag_set_check_value(&field, dr_in_buf, dr_in_mask, NULL); + if (tap == NULL) + jtag_add_plain_dr_scan(1, &field, TAP_DRPAUSE); + else + jtag_add_dr_scan(1, &field, TAP_DRPAUSE); - if (tap == NULL) - jtag_add_plain_dr_scan(1, &field, TAP_DRPAUSE); - else - jtag_add_dr_scan(1, &field, TAP_DRPAUSE); - - /* LOG_DEBUG("FLUSHING QUEUE"); */ - result = jtag_execute_queue(); - if (result == ERROR_OK) - { - matched = 1; - break; - } - } - - if (!matched) + /* LOG_DEBUG("FLUSHING QUEUE"); */ + result = jtag_execute_queue(); + if (result == ERROR_OK) { - LOG_USER( "%s mismatch", op_name); - tdo_mismatch = 1; + matched = 1; break; } + } - /* See page 19 of XSVF spec regarding opcode "XSDR" */ - if (xruntest) - { - xsvf_add_statemove(TAP_IDLE); + if (!matched) + { + LOG_USER( "%s mismatch", op_name); + tdo_mismatch = 1; + break; + } - if (runtest_requires_tck) - jtag_add_clocks(xruntest); - else - jtag_add_sleep(xruntest); - } - else if (xendir != TAP_DRPAUSE) /* we are already in TAP_DRPAUSE */ - xsvf_add_statemove(xenddr); + /* See page 19 of XSVF spec regarding opcode "XSDR" */ + if (xruntest) + { + xsvf_add_statemove(TAP_IDLE); + + if (runtest_requires_tck) + jtag_add_clocks(xruntest); + else + jtag_add_sleep(xruntest); } - break; + else if (xendir != TAP_DRPAUSE) /* we are already in TAP_DRPAUSE */ + xsvf_add_statemove(xenddr); + } + break; - case XSETSDRMASKS: - LOG_ERROR("unsupported XSETSDRMASKS\n"); - unsupported = 1; - break; + case XSETSDRMASKS: + LOG_ERROR("unsupported XSETSDRMASKS\n"); + unsupported = 1; + break; - case XSDRINC: - LOG_ERROR("unsupported XSDRINC\n"); - unsupported = 1; - break; + case XSDRINC: + LOG_ERROR("unsupported XSDRINC\n"); + unsupported = 1; + break; - case XSDRB: - LOG_ERROR("unsupported XSDRB\n"); - unsupported = 1; - break; + case XSDRB: + LOG_ERROR("unsupported XSDRB\n"); + unsupported = 1; + break; - case XSDRC: - LOG_ERROR("unsupported XSDRC\n"); - unsupported = 1; - break; + case XSDRC: + LOG_ERROR("unsupported XSDRC\n"); + unsupported = 1; + break; - case XSDRE: - LOG_ERROR("unsupported XSDRE\n"); - unsupported = 1; - break; + case XSDRE: + LOG_ERROR("unsupported XSDRE\n"); + unsupported = 1; + break; - case XSDRTDOB: - LOG_ERROR("unsupported XSDRTDOB\n"); - unsupported = 1; - break; + case XSDRTDOB: + LOG_ERROR("unsupported XSDRTDOB\n"); + unsupported = 1; + break; - case XSDRTDOC: - LOG_ERROR("unsupported XSDRTDOC\n"); - unsupported = 1; - break; + case XSDRTDOC: + LOG_ERROR("unsupported XSDRTDOC\n"); + unsupported = 1; + break; - case XSDRTDOE: - LOG_ERROR("unsupported XSDRTDOE\n"); - unsupported = 1; - break; + case XSDRTDOE: + LOG_ERROR("unsupported XSDRTDOE\n"); + unsupported = 1; + break; - case XSTATE: + case XSTATE: + { + tap_state_t mystate; + tap_state_t* path; + int path_len; + + if (read(xsvf_fd, &uc, 1) < 0) { - tap_state_t mystate; - tap_state_t *path; - int path_len; + do_abort = 1; + break; + } - if (read(xsvf_fd, &uc, 1) < 0) - { - do_abort = 1; - break; - } + mystate = xsvf_to_tap(uc); - mystate = xsvf_to_tap(uc); + LOG_DEBUG("XSTATE 0x%02X %s", uc, tap_state_name(mystate) ); - LOG_DEBUG("XSTATE 0x%02X %s", uc, tap_state_name(mystate) ); + path = calloc(XSTATE_MAX_PATH, 4); + path_len = 1; - path = calloc(XSTATE_MAX_PATH, 4); - path_len = 1; + path[0] = mystate; + if (xsvf_read_xstates(xsvf_fd, path, XSTATE_MAX_PATH, &path_len) != ERROR_OK) + do_abort = 1; + else + { + int i,lasti; - path[0] = mystate; - if (xsvf_read_xstates(xsvf_fd, path, XSTATE_MAX_PATH, &path_len) != ERROR_OK) - do_abort = 1; - else + /* here the trick is that jtag_add_pathmove() must end in a stable + * state, so we must only invoke jtag_add_tlr() when we absolutely + * have to + */ + for(i=0,lasti=0; i<path_len; i++) { - int i,lasti; - - /* here the trick is that jtag_add_pathmove() must end in a stable - * state, so we must only invoke jtag_add_tlr() when we absolutely - * have to - */ - for(i=0,lasti=0; i<path_len; i++) + if(path[i]==TAP_RESET) { - if(path[i]==TAP_RESET) + if(i>lasti) { - if(i>lasti) - { - jtag_add_pathmove(i-lasti,path+lasti); - } - lasti=i+1; - jtag_add_tlr(); + jtag_add_pathmove(i-lasti,path+lasti); } + lasti=i+1; + jtag_add_tlr(); } - if(i>=lasti) - { - jtag_add_pathmove(i-lasti, path+lasti); - } } - free(path); + if(i>=lasti) + { + jtag_add_pathmove(i-lasti, path+lasti); + } } + free(path); + } + break; + + case XENDIR: + + if (read(xsvf_fd, &uc, 1) < 0) + { + do_abort = 1; break; + } - case XENDIR: - { - tap_state_t mystate; + /* see page 22 of XSVF spec */ + if( uc == 0 ) + xendir = TAP_IDLE; + else if( uc == 1 ) + xendir = TAP_IRPAUSE; + else + { + LOG_ERROR("illegial XENDIR argument: 0x%02X", uc); + unsupported = 1; + break; + } - if (read(xsvf_fd, &uc, 1) < 0) - { - do_abort = 1; - break; - } + LOG_DEBUG("XENDIR 0x%02X %s", uc, tap_state_name(xendir)); + break; - /* see page 22 of XSVF spec */ - mystate = uc == 1 ? TAP_IRPAUSE : TAP_IDLE; + case XENDDR: - LOG_DEBUG("XENDIR 0x%02X %s", uc, tap_state_name(mystate)); + if (read(xsvf_fd, &uc, 1) < 0) + { + do_abort = 1; + break; + } - /* assuming that the XRUNTEST comes from SVF RUNTEST, then only these states - * should come here because the SVF spec only allows these with a RUNTEST - */ - if (mystate != TAP_IRPAUSE && mystate != TAP_DRPAUSE && mystate != TAP_RESET && mystate != TAP_IDLE ) - { - LOG_ERROR("illegal XENDIR endstate: \"%s\"", tap_state_name(mystate)); - unsupported = 1; - break; - } - xendir = mystate; - } + /* see page 22 of XSVF spec */ + if( uc == 0 ) + xenddr = TAP_IDLE; + else if( uc == 1 ) + xenddr = TAP_DRPAUSE; + else + { + LOG_ERROR("illegial XENDDR argument: 0x%02X", uc); + unsupported = 1; break; + } - case XENDDR: - { - tap_state_t mystate; + LOG_DEBUG("XENDDR %02X %s", uc, tap_state_name(xenddr)); + break; - if (read(xsvf_fd, &uc, 1) < 0) + case XSIR: + case XSIR2: + { + u8 short_buf[2]; + u8* ir_buf; + int bitcount; + tap_state_t my_end_state = xruntest ? TAP_IDLE : xendir; + + if( opcode == XSIR ) + { + /* one byte bitcount */ + if (read(xsvf_fd, short_buf, 1) < 0) { do_abort = 1; break; } - - /* see page 22 of XSVF spec */ - mystate = uc == 1 ? TAP_DRPAUSE : TAP_IDLE; - - LOG_DEBUG("XENDDR %02X %s", uc, tap_state_name(mystate)); - - if (mystate != TAP_IRPAUSE && mystate != TAP_DRPAUSE && mystate != TAP_RESET && mystate != TAP_IDLE ) + bitcount = short_buf[0]; + LOG_DEBUG("XSIR %d", bitcount); + } + else + { + if (read(xsvf_fd, short_buf, 2) < 0) { - LOG_ERROR("illegal XENDDR endstate: \"%s\"", tap_state_name( mystate )); - unsupported = 1; + do_abort = 1; break; } - xenddr = mystate; + bitcount = be_to_h_u16(short_buf); + LOG_DEBUG("XSIR2 %d", bitcount); } - break; - case XSIR: - case XSIR2: + ir_buf = malloc((bitcount+7) / 8); + + if (xsvf_read_buffer(bitcount, xsvf_fd, ir_buf) != ERROR_OK) + do_abort = 1; + else { - u8 short_buf[2]; - u8* ir_buf; - int bitcount; - tap_state_t my_end_state = xruntest ? TAP_IDLE : xendir; + scan_field_t field; - if( opcode == XSIR ) - { - /* one byte bitcount */ - if (read(xsvf_fd, short_buf, 1) < 0) - { - do_abort = 1; - break; - } - bitcount = short_buf[0]; - LOG_DEBUG("XSIR %d", bitcount); - } - else - { - if (read(xsvf_fd, short_buf, 2) < 0) - { - do_abort = 1; - break; - } - bitcount = be_to_h_u16(short_buf); - LOG_DEBUG("XSIR2 %d", bitcount); - } + field.tap = tap; + field.num_bits = bitcount; + field.out_value = ir_buf; + field.out_mask = NULL; + field.in_value = NULL; + field.in_check_value = NULL; + field.in_check_mask = NULL; + field.in_handler = NULL; + field.in_handler_priv = NULL; - ir_buf = malloc((bitcount+7) / 8); - - if (xsvf_read_buffer(bitcount, xsvf_fd, ir_buf) != ERROR_OK) - do_abort = 1; + if (tap == NULL) + jtag_add_plain_ir_scan(1, &field, my_end_state); else - { - scan_field_t field; + jtag_add_ir_scan(1, &field, my_end_state); - field.tap = tap; - field.num_bits = bitcount; - field.out_value = ir_buf; - field.out_mask = NULL; - field.in_value = NULL; - field.in_check_value = NULL; - field.in_check_mask = NULL; - field.in_handler = NULL; - field.in_handler_priv = NULL; - - if (tap == NULL) - jtag_add_plain_ir_scan(1, &field, my_end_state); + if (xruntest) + { + if (runtest_requires_tck) + jtag_add_clocks(xruntest); else - jtag_add_ir_scan(1, &field, my_end_state); + jtag_add_sleep(xruntest); + } - if (xruntest) - { - if (runtest_requires_tck) - jtag_add_clocks(xruntest); - else - jtag_add_sleep(xruntest); - } + /* Note that an -irmask of non-zero in your config file + * can cause this to fail. Setting -irmask to zero cand work + * around the problem. + */ - /* Note that an -irmask of non-zero in your config file - * can cause this to fail. Setting -irmask to zero cand work - * around the problem. - */ - - /* LOG_DEBUG("FLUSHING QUEUE"); */ - result = jtag_execute_queue(); - if(result != ERROR_OK) - { - tdo_mismatch = 1; - } + /* LOG_DEBUG("FLUSHING QUEUE"); */ + result = jtag_execute_queue(); + if(result != ERROR_OK) + { + tdo_mismatch = 1; } - free(ir_buf); } - break; + free(ir_buf); + } + break; - case XCOMMENT: - { - int ndx = 0; - char comment[128]; + case XCOMMENT: + { + int ndx = 0; + char comment[128]; - do + do + { + if (read(xsvf_fd, &uc, 1) < 0) { - if (read(xsvf_fd, &uc, 1) < 0) - { - do_abort = 1; - break; - } + do_abort = 1; + break; + } - if ( ndx < sizeof(comment)-1 ) - comment[ndx++] = uc; + if ( ndx < sizeof(comment)-1 ) + comment[ndx++] = uc; - } while (uc != 0); + } while (uc != 0); - comment[sizeof(comment)-1] = 0; /* regardless, terminate */ - if (verbose) - LOG_USER(comment); - } - break; + comment[sizeof(comment)-1] = 0; /* regardless, terminate */ + if (verbose) + LOG_USER(comment); + } + break; - case XWAIT: - { - /* expected in stream: - XWAIT <u8 wait_state> <u8 end_state> <u32 usecs> - */ + case XWAIT: + { + /* expected in stream: + XWAIT <u8 wait_state> <u8 end_state> <u32 usecs> + */ - u8 wait; - u8 end; - u8 delay_buf[4]; + u8 wait; + u8 end; + u8 delay_buf[4]; - tap_state_t wait_state; - tap_state_t end_state; - int delay; + tap_state_t wait_state; + tap_state_t end_state; + int delay; - if ( read(xsvf_fd, &wait, 1) < 0 - || read(xsvf_fd, &end, 1) < 0 - || read(xsvf_fd, delay_buf, 4) < 0) - { - do_abort = 1; - break; - } + if ( read(xsvf_fd, &wait, 1) < 0 + || read(xsvf_fd, &end, 1) < 0 + || read(xsvf_fd, delay_buf, 4) < 0) + { + do_abort = 1; + break; + } - wait_state = xsvf_to_tap(wait); - end_state = xsvf_to_tap(end); - delay = be_to_h_u32(delay_buf); + wait_state = xsvf_to_tap(wait); + end_state = xsvf_to_tap(end); + delay = be_to_h_u32(delay_buf); - LOG_DEBUG("XWAIT %s %s usecs:%d", tap_state_name(wait_state), tap_state_name(end_state), delay); + LOG_DEBUG("XWAIT %s %s usecs:%d", tap_state_name(wait_state), tap_state_name(end_state), delay); - if (runtest_requires_tck && wait_state == TAP_IDLE ) - { - jtag_add_runtest(delay, end_state); - } - else - { - xsvf_add_statemove( wait_state ); - jtag_add_sleep(delay); - xsvf_add_statemove( end_state ); - } + if (runtest_requires_tck && wait_state == TAP_IDLE ) + { + jtag_add_runtest(delay, end_state); } - break; - - case XWAITSTATE: + else { - /* expected in stream: - XWAITSTATE <u8 wait_state> <u8 end_state> <u32 clock_count> <u32 usecs> - */ + xsvf_add_statemove( wait_state ); + jtag_add_sleep(delay); + xsvf_add_statemove( end_state ); + } + } + break; - u8 clock_buf[4]; - u8 usecs_buf[4]; - u8 wait; - u8 end; - tap_state_t wait_state; - tap_state_t end_state; - int clock_count; - int usecs; + case XWAITSTATE: + { + /* expected in stream: + XWAITSTATE <u8 wait_state> <u8 end_state> <u32 clock_count> <u32 usecs> + */ - if ( read(xsvf_fd, &wait, 1) < 0 - || read(xsvf_fd, &end, 1) < 0 - || read(xsvf_fd, clock_buf, 4) < 0 - || read(xsvf_fd, usecs_buf, 4) < 0 ) - { - do_abort = 1; - break; - } + u8 clock_buf[4]; + u8 usecs_buf[4]; + u8 wait; + u8 end; + tap_state_t wait_state; + tap_state_t end_state; + int clock_count; + int usecs; - wait_state = xsvf_to_tap( wait ); - end_state = xsvf_to_tap( end ); + if ( read(xsvf_fd, &wait, 1) < 0 + || read(xsvf_fd, &end, 1) < 0 + || read(xsvf_fd, clock_buf, 4) < 0 + || read(xsvf_fd, usecs_buf, 4) < 0 ) + { + do_abort = 1; + break; + } - clock_count = be_to_h_u32(clock_buf); - usecs = be_to_h_u32(usecs_buf); + wait_state = xsvf_to_tap( wait ); + end_state = xsvf_to_tap( end ); - LOG_DEBUG("XWAITSTATE %s %s clocks:%i usecs:%i", - tap_state_name(wait_state), - tap_state_name(end_state), - clock_count, usecs); + clock_count = be_to_h_u32(clock_buf); + usecs = be_to_h_u32(usecs_buf); - /* the following states are 'stable', meaning that they have a transition - * in the state diagram back to themselves. This is necessary because we will - * be issuing a number of clocks in this state. This set of allowed states is also - * determined by the SVF RUNTEST command's allowed states. - */ - if (wait_state != TAP_IRPAUSE && wait_state != TAP_DRPAUSE && wait_state != TAP_RESET && wait_state != TAP_IDLE) - { - LOG_ERROR("illegal XWAITSTATE wait_state: \"%s\"", tap_state_name( wait_state )); - unsupported = 1; - } + LOG_DEBUG("XWAITSTATE %s %s clocks:%i usecs:%i", + tap_state_name(wait_state), + tap_state_name(end_state), + clock_count, usecs); - xsvf_add_statemove( wait_state ); + /* the following states are 'stable', meaning that they have a transition + * in the state diagram back to themselves. This is necessary because we will + * be issuing a number of clocks in this state. This set of allowed states is also + * determined by the SVF RUNTEST command's allowed states. + */ + if (wait_state != TAP_IRPAUSE && wait_state != TAP_DRPAUSE && wait_state != TAP_RESET && wait_state != TAP_IDLE) + { + LOG_ERROR("illegal XWAITSTATE wait_state: \"%s\"", tap_state_name( wait_state )); + unsupported = 1; + } - jtag_add_clocks( clock_count ); + xsvf_add_statemove( wait_state ); - jtag_add_sleep( usecs ); + jtag_add_clocks( clock_count ); - xsvf_add_statemove( end_state ); - } - break; + jtag_add_sleep( usecs ); - case LCOUNT: - { - /* expected in stream: - LCOUNT <u32 loop_count> - */ - u8 count_buf[4]; + xsvf_add_statemove( end_state ); + } + break; - if ( read(xsvf_fd, count_buf, 4) < 0 ) - { - do_abort = 1; - break; - } + case LCOUNT: + { + /* expected in stream: + LCOUNT <u32 loop_count> + */ + u8 count_buf[4]; - loop_count = be_to_h_u32(count_buf); - LOG_DEBUG("LCOUNT %d", loop_count); + if ( read(xsvf_fd, count_buf, 4) < 0 ) + { + do_abort = 1; + break; } - break; - case LDELAY: - { - /* expected in stream: - LDELAY <u8 wait_state> <u32 clock_count> <u32 usecs_to_sleep> - */ - u8 state; - u8 clock_buf[4]; - u8 usecs_buf[4]; + loop_count = be_to_h_u32(count_buf); + LOG_DEBUG("LCOUNT %d", loop_count); + } + break; - if ( read(xsvf_fd, &state, 1) < 0 - || read(xsvf_fd, clock_buf, 4) < 0 - || read(xsvf_fd, usecs_buf, 4) < 0 ) - { - do_abort = 1; - break; - } + case LDELAY: + { + /* expected in stream: + LDELAY <u8 wait_state> <u32 clock_count> <u32 usecs_to_sleep> + */ + u8 state; + u8 clock_buf[4]; + u8 usecs_buf[4]; - loop_state = xsvf_to_tap(state); - loop_clocks = be_to_h_u32(clock_buf); - loop_usecs = be_to_h_u32(usecs_buf); - - LOG_DEBUG("LDELAY %s clocks:%d usecs:%d", tap_state_name(loop_state), loop_clocks, loop_usecs); + if ( read(xsvf_fd, &state, 1) < 0 + || read(xsvf_fd, clock_buf, 4) < 0 + || read(xsvf_fd, usecs_buf, 4) < 0 ) + { + do_abort = 1; + break; } - break; - /* LSDR is more like XSDRTDO than it is like XSDR. It uses LDELAY which - * comes with clocks !AND! sleep requirements. - */ - case LSDR: - { - int limit = loop_count; - int matched = 0; - int attempt; + loop_state = xsvf_to_tap(state); + loop_clocks = be_to_h_u32(clock_buf); + loop_usecs = be_to_h_u32(usecs_buf); - LOG_DEBUG("LSDR"); + LOG_DEBUG("LDELAY %s clocks:%d usecs:%d", tap_state_name(loop_state), loop_clocks, loop_usecs); + } + break; - if ( xsvf_read_buffer(xsdrsize, xsvf_fd, dr_out_buf) != ERROR_OK - || xsvf_read_buffer(xsdrsize, xsvf_fd, dr_in_buf) != ERROR_OK ) - { - do_abort = 1; - break; - } + /* LSDR is more like XSDRTDO than it is like XSDR. It uses LDELAY which + * comes with clocks !AND! sleep requirements. + */ + case LSDR: + { + int limit = loop_count; + int matched = 0; + int attempt; - if (limit < 1) - limit = 1; + LOG_DEBUG("LSDR"); - for( attempt=0; attempt<limit; ++attempt ) - { - scan_field_t field; + if ( xsvf_read_buffer(xsdrsize, xsvf_fd, dr_out_buf) != ERROR_OK + || xsvf_read_buffer(xsdrsize, xsvf_fd, dr_in_buf) != ERROR_OK ) + { + do_abort = 1; + break; + } - xsvf_add_statemove( loop_state ); - jtag_add_clocks(loop_clocks); - jtag_add_sleep(loop_usecs); + if (limit < 1) + limit = 1; - field.tap = tap; - field.num_bits = xsdrsize; - field.out_value = dr_out_buf; - field.out_mask = NULL; - field.in_value = NULL; + for( attempt=0; attempt<limit; ++attempt ) + { + scan_field_t field; - if (attempt > 0 && verbose) - LOG_USER("LSDR retry %d", attempt); + xsvf_add_statemove( loop_state ); + jtag_add_clocks(loop_clocks); + jtag_add_sleep(loop_usecs); - jtag_set_check_value(&field, dr_in_buf, dr_in_mask, NULL); - if (tap == NULL) - jtag_add_plain_dr_scan(1, &field, TAP_DRPAUSE); - else - jtag_add_dr_scan(1, &field, TAP_DRPAUSE); + field.tap = tap; + field.num_bits = xsdrsize; + field.out_value = dr_out_buf; + field.out_mask = NULL; + field.in_value = NULL; - /* LOG_DEBUG("FLUSHING QUEUE"); */ - result = jtag_execute_queue(); - if(result == ERROR_OK) - { - matched = 1; - break; - } - } + if (attempt > 0 && verbose) + LOG_USER("LSDR retry %d", attempt); - if (!matched ) + jtag_set_check_value(&field, dr_in_buf, dr_in_mask, NULL); + if (tap == NULL) + jtag_add_plain_dr_scan(1, &field, TAP_DRPAUSE); + else + jtag_add_dr_scan(1, &field, TAP_DRPAUSE); + + /* LOG_DEBUG("FLUSHING QUEUE"); */ + result = jtag_execute_queue(); + if(result == ERROR_OK) { - LOG_USER( "LSDR mismatch" ); - tdo_mismatch = 1; + matched = 1; break; } } - break; - case XTRST: + if (!matched ) { - u8 trst_mode; + LOG_USER( "LSDR mismatch" ); + tdo_mismatch = 1; + break; + } + } + break; - if (read(xsvf_fd, &trst_mode, 1) < 0) - { - do_abort = 1; - break; - } + case XTRST: + { + u8 trst_mode; - switch( trst_mode ) - { - case XTRST_ON: - jtag_add_reset(1, 0); - break; - case XTRST_OFF: - case XTRST_Z: - jtag_add_reset(0, 0); - break; - case XTRST_ABSENT: - break; - default: - LOG_ERROR( "XTRST mode argument (0x%02X) out of range", trst_mode ); - do_abort = 1; - } + if (read(xsvf_fd, &trst_mode, 1) < 0) + { + do_abort = 1; + break; } - break; - default: - LOG_ERROR("unknown xsvf command (0x%02X)\n", uc); - unsupported = 1; + switch( trst_mode ) + { + case XTRST_ON: + jtag_add_reset(1, 0); + break; + case XTRST_OFF: + case XTRST_Z: + jtag_add_reset(0, 0); + break; + case XTRST_ABSENT: + break; + default: + LOG_ERROR( "XTRST mode argument (0x%02X) out of range", trst_mode ); + do_abort = 1; + } + } + break; + + default: + LOG_ERROR("unknown xsvf command (0x%02X)\n", uc); + unsupported = 1; } if (do_abort || unsupported || tdo_mismatch) @@ -1058,8 +1051,10 @@ } -/* PSUEDO-Code from Xilinx Appnote XAPP067.pdf: +#if 0 /* this comment style used to try and keep uncrustify from adding * at begin of line */ +PSUEDO-Code from Xilinx Appnote XAPP067.pdf: + the following pseudo code clarifies the intent of the xrepeat support. The flow given is for the entire processing of an SVF file, not an XSVF file. No idea if this is just for the XC9500/XL/XV devices or all Xilinx parts. @@ -1106,4 +1101,4 @@ store <TCK value> as <current pause time> end if -*/ +#endif |
From: <ml...@ma...> - 2009-04-14 19:17:41
|
Author: mlu Date: 2009-04-14 19:17:38 +0200 (Tue, 14 Apr 2009) New Revision: 1456 Modified: trunk/src/flash/stm32x.c Log: Improved (for humans) error reporting for flash programming errors. Modified: trunk/src/flash/stm32x.c =================================================================== --- trunk/src/flash/stm32x.c 2009-04-14 16:33:52 UTC (rev 1455) +++ trunk/src/flash/stm32x.c 2009-04-14 17:17:38 UTC (rev 1456) @@ -565,12 +565,20 @@ break; } - if (buf_get_u32(reg_params[3].value, 0, 32) & 0x14) + if (buf_get_u32(reg_params[3].value, 0, 32) & FLASH_PGERR) { + LOG_ERROR("flash memory not erased before writing"); retval = ERROR_FLASH_OPERATION_FAILED; break; } + if (buf_get_u32(reg_params[3].value, 0, 32) & FLASH_WRPRTERR) + { + LOG_ERROR("flash memory write protected"); + retval = ERROR_FLASH_OPERATION_FAILED; + break; + } + buffer += thisrun_count * 2; address += thisrun_count * 2; count -= thisrun_count; @@ -647,9 +655,15 @@ status = stm32x_wait_status_busy(bank, 5); if( status & FLASH_WRPRTERR ) + { + LOG_ERROR("flash memory not erased before writing"); return ERROR_FLASH_OPERATION_FAILED; + } if( status & FLASH_PGERR ) + { + LOG_ERROR("flash memory write protected"); return ERROR_FLASH_OPERATION_FAILED; + } bytes_written += 2; words_remaining--; @@ -674,9 +688,15 @@ status = stm32x_wait_status_busy(bank, 5); if( status & FLASH_WRPRTERR ) + { + LOG_ERROR("flash memory not erased before writing"); return ERROR_FLASH_OPERATION_FAILED; + } if( status & FLASH_PGERR ) + { + LOG_ERROR("flash memory write protected"); return ERROR_FLASH_OPERATION_FAILED; + } } target_write_u32(target, STM32_FLASH_CR, FLASH_LOCK); |
From: <ml...@ma...> - 2009-04-14 18:34:23
|
Author: mlu Date: 2009-04-14 18:33:52 +0200 (Tue, 14 Apr 2009) New Revision: 1455 Modified: trunk/src/target/arm_simulator.c Log: Solve problem with single stepping. Modified: trunk/src/target/arm_simulator.c =================================================================== --- trunk/src/target/arm_simulator.c 2009-04-03 12:55:25 UTC (rev 1454) +++ trunk/src/target/arm_simulator.c 2009-04-14 16:33:52 UTC (rev 1455) @@ -415,7 +415,12 @@ u8 carry_out; Rd = 0x0; - Rn = buf_get_u32(ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, armv4_5->core_mode, instruction.info.data_proc.Rn).value, 0, 32); + /* ARM_MOV and ARM_MVN does not use Rn */ + if ((instruction.type != ARM_MOV) && (instruction.type != ARM_MVN)) + Rn = buf_get_u32(ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, armv4_5->core_mode, instruction.info.data_proc.Rn).value, 0, 32); + else + Rn = 0; + shifter_operand = arm_shifter_operand(armv4_5, instruction.info.data_proc.variant, instruction.info.data_proc.shifter_operand, &carry_out); /* adjust Rn in case the PC is being read */ @@ -446,6 +451,8 @@ Rd = shifter_operand; else if (instruction.type == ARM_MVN) Rd = ~shifter_operand; + else + LOG_WARNING("unhandled instruction type"); if (dry_run_pc) { |
From: ntfreak at B. <nt...@ma...> - 2009-04-03 14:55:27
|
Author: ntfreak Date: 2009-04-03 14:55:25 +0200 (Fri, 03 Apr 2009) New Revision: 1454 Modified: trunk/doc/openocd.texi Log: - add openocd coding style to texi Modified: trunk/doc/openocd.texi =================================================================== --- trunk/doc/openocd.texi 2009-04-03 10:10:12 UTC (rev 1453) +++ trunk/doc/openocd.texi 2009-04-03 12:55:25 UTC (rev 1454) @@ -123,6 +123,41 @@ The main OpenOCD web site is available at @uref{http://openocd.berlios.de/web/}. +@section Coding Style +@cindex Coding Style + +The following rules try to describe formatting and naming conventions that should be +followed to make the whole OpenOCD code look more consistent. The ultimate goal of +coding style should be readability, and these rules may be ignored for a particular +(small) piece of code if that makes it more readable. + +@subsection Formatting rules: +@itemize @bullet +@item remove any trailing white space +@item use TAB characters for indentation, not spaces +@item displayed TAB width is 4 characters +@item make sure NOT to use DOS '\r\n' line feeds +@item do not add more than 2 empty lines to source files +@item do not add trailing empty lines to source files +@item do not use C++ style comments (//) +@item lines may be reasonably wide - there's no anachronistic 80 characters limit +@end itemize + +@subsection Naming rules: +@itemize @bullet +@item identifiers use lower-case letters only +@item identifiers consisting of multiple words use underline characters between consecutive words +@item macros use upper-case letters only +@item structure names shall be appended with '_s' +@item typedefs shall be appended with '_t' +@end itemize + +@subsection Function calls: +@itemize @bullet +@item function calls have no space between the functions name and the parameter +list: my_func(param1, param2, ...) +@end itemize + @node Building @chapter Building @cindex building OpenOCD |
From: <ml...@ma...> - 2009-04-03 12:10:27
|
Author: mlu Date: 2009-04-03 12:10:12 +0200 (Fri, 03 Apr 2009) New Revision: 1453 Modified: trunk/src/target/armv4_5.c trunk/src/target/armv7m.c trunk/src/target/cortex_swjdp.c Log: Slight improvement in run_algorithm register restore. More debug info for cortex swjdp errors. Modified: trunk/src/target/armv4_5.c =================================================================== --- trunk/src/target/armv4_5.c 2009-04-03 08:16:47 UTC (rev 1452) +++ trunk/src/target/armv4_5.c 2009-04-03 10:10:12 UTC (rev 1453) @@ -661,10 +661,15 @@ for (i = 0; i <= 16; i++) { - LOG_DEBUG("restoring register %s with value 0x%8.8x", ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, armv4_5_algorithm_info->core_mode, i).name, context[i]); - buf_set_u32(ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, armv4_5_algorithm_info->core_mode, i).value, 0, 32, context[i]); - ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, armv4_5_algorithm_info->core_mode, i).valid = 1; - ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, armv4_5_algorithm_info->core_mode, i).dirty = 1; + u32 regvalue; + regvalue = buf_get_u32(ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, armv4_5_algorithm_info->core_mode, i).value, 0, 32); + if (regvalue != context[i]) + { + LOG_DEBUG("restoring register %s with value 0x%8.8x", ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, armv4_5_algorithm_info->core_mode, i).name, context[i]); + buf_set_u32(ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, armv4_5_algorithm_info->core_mode, i).value, 0, 32, context[i]); + ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, armv4_5_algorithm_info->core_mode, i).valid = 1; + ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, armv4_5_algorithm_info->core_mode, i).dirty = 1; + } } buf_set_u32(armv4_5->core_cache->reg_list[ARMV4_5_CPSR].value, 0, 32, cpsr); armv4_5->core_cache->reg_list[ARMV4_5_CPSR].valid = 1; Modified: trunk/src/target/armv7m.c =================================================================== --- trunk/src/target/armv7m.c 2009-04-03 08:16:47 UTC (rev 1452) +++ trunk/src/target/armv7m.c 2009-04-03 10:10:12 UTC (rev 1453) @@ -449,10 +449,15 @@ for (i = ARMV7NUMCOREREGS-1; i >= 0; i--) { - LOG_DEBUG("restoring register %s with value 0x%8.8x", armv7m->core_cache->reg_list[i].name, context[i]); - buf_set_u32(armv7m->core_cache->reg_list[i].value, 0, 32, context[i]); - armv7m->core_cache->reg_list[i].valid = 1; - armv7m->core_cache->reg_list[i].dirty = 1; + u32 regvalue; + regvalue = buf_get_u32(armv7m->core_cache->reg_list[i].value, 0, 32); + if (regvalue != context[i]) + { + LOG_DEBUG("restoring register %s with value 0x%8.8x", armv7m->core_cache->reg_list[i].name, context[i]); + buf_set_u32(armv7m->core_cache->reg_list[i].value, 0, 32, context[i]); + armv7m->core_cache->reg_list[i].valid = 1; + armv7m->core_cache->reg_list[i].dirty = 1; + } } armv7m->core_mode = core_mode; Modified: trunk/src/target/cortex_swjdp.c =================================================================== --- trunk/src/target/cortex_swjdp.c 2009-04-03 08:16:47 UTC (rev 1452) +++ trunk/src/target/cortex_swjdp.c 2009-04-03 10:10:12 UTC (rev 1453) @@ -247,6 +247,8 @@ { u32 dcb_dhcsr,nvic_shcsr, nvic_bfar, nvic_cfsr; + /* Print information about last AHBAP access */ + LOG_ERROR("AHBAP: dp_select 0x%x, ap_csw 0x%x, ap_tar 0x%x", swjdp->dp_select_value, swjdp->ap_csw_value, swjdp->ap_tar_value); if (ctrlstat & SSTICKYORUN) LOG_ERROR("SWJ-DP OVERRUN - check clock or reduce jtag speed"); |
From: ntfreak at B. <nt...@ma...> - 2009-04-03 10:16:53
|
Author: ntfreak Date: 2009-04-03 10:16:47 +0200 (Fri, 03 Apr 2009) New Revision: 1452 Modified: trunk/src/flash/nand_ecc.c trunk/src/target/board/olimex_stm32_h103.cfg trunk/src/target/interface/oocdlink.cfg trunk/src/target/target/lpc2103.cfg Log: - add svn props from previous commit Modified: trunk/src/flash/nand_ecc.c =================================================================== --- trunk/src/flash/nand_ecc.c 2009-04-03 05:36:54 UTC (rev 1451) +++ trunk/src/flash/nand_ecc.c 2009-04-03 08:16:47 UTC (rev 1452) @@ -1,126 +1,126 @@ -/* - * This file contains an ECC algorithm from Toshiba that allows for detection - * and correction of 1-bit errors in a 256 byte block of data. - * - * [ Extracted from the initial code found in some early Linux versions. - * The current Linux code is bigger while being faster, but this is of - * no real benefit when the bottleneck largely remains the JTAG link. ] - * - * Copyright (C) 2000-2004 Steven J. Hill (sjhill at realitydiluted.com) - * Toshiba America Electronics Components, Inc. - * - * Copyright (C) 2006 Thomas Gleixner <tglx at linutronix.de> - * - * This file is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 or (at your option) any - * later version. - * - * This file is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this file; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - * - * As a special exception, if other files instantiate templates or use - * macros or inline functions from these files, or you compile these - * files and link them with other works to produce a work based on these - * files, these files do not by themselves cause the resulting work to be - * covered by the GNU General Public License. However the source code for - * these files must still be made available in accordance with section (3) - * of the GNU General Public License. - * - * This exception does not invalidate any other reasons why a work based on - * this file might be covered by the GNU General Public License. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "replacements.h" - -#include <inttypes.h> - -#include "nand.h" - -/* - * Pre-calculated 256-way 1 byte column parity - */ -static const u8 nand_ecc_precalc_table[] = { - 0x00, 0x55, 0x56, 0x03, 0x59, 0x0c, 0x0f, 0x5a, 0x5a, 0x0f, 0x0c, 0x59, 0x03, 0x56, 0x55, 0x00, - 0x65, 0x30, 0x33, 0x66, 0x3c, 0x69, 0x6a, 0x3f, 0x3f, 0x6a, 0x69, 0x3c, 0x66, 0x33, 0x30, 0x65, - 0x66, 0x33, 0x30, 0x65, 0x3f, 0x6a, 0x69, 0x3c, 0x3c, 0x69, 0x6a, 0x3f, 0x65, 0x30, 0x33, 0x66, - 0x03, 0x56, 0x55, 0x00, 0x5a, 0x0f, 0x0c, 0x59, 0x59, 0x0c, 0x0f, 0x5a, 0x00, 0x55, 0x56, 0x03, - 0x69, 0x3c, 0x3f, 0x6a, 0x30, 0x65, 0x66, 0x33, 0x33, 0x66, 0x65, 0x30, 0x6a, 0x3f, 0x3c, 0x69, - 0x0c, 0x59, 0x5a, 0x0f, 0x55, 0x00, 0x03, 0x56, 0x56, 0x03, 0x00, 0x55, 0x0f, 0x5a, 0x59, 0x0c, - 0x0f, 0x5a, 0x59, 0x0c, 0x56, 0x03, 0x00, 0x55, 0x55, 0x00, 0x03, 0x56, 0x0c, 0x59, 0x5a, 0x0f, - 0x6a, 0x3f, 0x3c, 0x69, 0x33, 0x66, 0x65, 0x30, 0x30, 0x65, 0x66, 0x33, 0x69, 0x3c, 0x3f, 0x6a, - 0x6a, 0x3f, 0x3c, 0x69, 0x33, 0x66, 0x65, 0x30, 0x30, 0x65, 0x66, 0x33, 0x69, 0x3c, 0x3f, 0x6a, - 0x0f, 0x5a, 0x59, 0x0c, 0x56, 0x03, 0x00, 0x55, 0x55, 0x00, 0x03, 0x56, 0x0c, 0x59, 0x5a, 0x0f, - 0x0c, 0x59, 0x5a, 0x0f, 0x55, 0x00, 0x03, 0x56, 0x56, 0x03, 0x00, 0x55, 0x0f, 0x5a, 0x59, 0x0c, - 0x69, 0x3c, 0x3f, 0x6a, 0x30, 0x65, 0x66, 0x33, 0x33, 0x66, 0x65, 0x30, 0x6a, 0x3f, 0x3c, 0x69, - 0x03, 0x56, 0x55, 0x00, 0x5a, 0x0f, 0x0c, 0x59, 0x59, 0x0c, 0x0f, 0x5a, 0x00, 0x55, 0x56, 0x03, - 0x66, 0x33, 0x30, 0x65, 0x3f, 0x6a, 0x69, 0x3c, 0x3c, 0x69, 0x6a, 0x3f, 0x65, 0x30, 0x33, 0x66, - 0x65, 0x30, 0x33, 0x66, 0x3c, 0x69, 0x6a, 0x3f, 0x3f, 0x6a, 0x69, 0x3c, 0x66, 0x33, 0x30, 0x65, - 0x00, 0x55, 0x56, 0x03, 0x59, 0x0c, 0x0f, 0x5a, 0x5a, 0x0f, 0x0c, 0x59, 0x03, 0x56, 0x55, 0x00 -}; - -/* - * nand_calculate_ecc - Calculate 3-byte ECC for 256-byte block - */ -int nand_calculate_ecc(struct nand_device_s *device, const u8 *dat, u8 *ecc_code) -{ - u8 idx, reg1, reg2, reg3, tmp1, tmp2; - int i; - - /* Initialize variables */ - reg1 = reg2 = reg3 = 0; - - /* Build up column parity */ - for(i = 0; i < 256; i++) { - /* Get CP0 - CP5 from table */ - idx = nand_ecc_precalc_table[*dat++]; - reg1 ^= (idx & 0x3f); - - /* All bit XOR = 1 ? */ - if (idx & 0x40) { - reg3 ^= (u8) i; - reg2 ^= ~((u8) i); - } - } - - /* Create non-inverted ECC code from line parity */ - tmp1 = (reg3 & 0x80) >> 0; /* B7 -> B7 */ - tmp1 |= (reg2 & 0x80) >> 1; /* B7 -> B6 */ - tmp1 |= (reg3 & 0x40) >> 1; /* B6 -> B5 */ - tmp1 |= (reg2 & 0x40) >> 2; /* B6 -> B4 */ - tmp1 |= (reg3 & 0x20) >> 2; /* B5 -> B3 */ - tmp1 |= (reg2 & 0x20) >> 3; /* B5 -> B2 */ - tmp1 |= (reg3 & 0x10) >> 3; /* B4 -> B1 */ - tmp1 |= (reg2 & 0x10) >> 4; /* B4 -> B0 */ - - tmp2 = (reg3 & 0x08) << 4; /* B3 -> B7 */ - tmp2 |= (reg2 & 0x08) << 3; /* B3 -> B6 */ - tmp2 |= (reg3 & 0x04) << 3; /* B2 -> B5 */ - tmp2 |= (reg2 & 0x04) << 2; /* B2 -> B4 */ - tmp2 |= (reg3 & 0x02) << 2; /* B1 -> B3 */ - tmp2 |= (reg2 & 0x02) << 1; /* B1 -> B2 */ - tmp2 |= (reg3 & 0x01) << 1; /* B0 -> B1 */ - tmp2 |= (reg2 & 0x01) << 0; /* B7 -> B0 */ - - /* Calculate final ECC code */ -#ifdef NAND_ECC_SMC - ecc_code[0] = ~tmp2; - ecc_code[1] = ~tmp1; -#else - ecc_code[0] = ~tmp1; - ecc_code[1] = ~tmp2; -#endif - ecc_code[2] = ((~reg1) << 2) | 0x03; - - return 0; -} +/* + * This file contains an ECC algorithm from Toshiba that allows for detection + * and correction of 1-bit errors in a 256 byte block of data. + * + * [ Extracted from the initial code found in some early Linux versions. + * The current Linux code is bigger while being faster, but this is of + * no real benefit when the bottleneck largely remains the JTAG link. ] + * + * Copyright (C) 2000-2004 Steven J. Hill (sjhill at realitydiluted.com) + * Toshiba America Electronics Components, Inc. + * + * Copyright (C) 2006 Thomas Gleixner <tglx at linutronix.de> + * + * This file is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this file; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * As a special exception, if other files instantiate templates or use + * macros or inline functions from these files, or you compile these + * files and link them with other works to produce a work based on these + * files, these files do not by themselves cause the resulting work to be + * covered by the GNU General Public License. However the source code for + * these files must still be made available in accordance with section (3) + * of the GNU General Public License. + * + * This exception does not invalidate any other reasons why a work based on + * this file might be covered by the GNU General Public License. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "replacements.h" + +#include <inttypes.h> + +#include "nand.h" + +/* + * Pre-calculated 256-way 1 byte column parity + */ +static const u8 nand_ecc_precalc_table[] = { + 0x00, 0x55, 0x56, 0x03, 0x59, 0x0c, 0x0f, 0x5a, 0x5a, 0x0f, 0x0c, 0x59, 0x03, 0x56, 0x55, 0x00, + 0x65, 0x30, 0x33, 0x66, 0x3c, 0x69, 0x6a, 0x3f, 0x3f, 0x6a, 0x69, 0x3c, 0x66, 0x33, 0x30, 0x65, + 0x66, 0x33, 0x30, 0x65, 0x3f, 0x6a, 0x69, 0x3c, 0x3c, 0x69, 0x6a, 0x3f, 0x65, 0x30, 0x33, 0x66, + 0x03, 0x56, 0x55, 0x00, 0x5a, 0x0f, 0x0c, 0x59, 0x59, 0x0c, 0x0f, 0x5a, 0x00, 0x55, 0x56, 0x03, + 0x69, 0x3c, 0x3f, 0x6a, 0x30, 0x65, 0x66, 0x33, 0x33, 0x66, 0x65, 0x30, 0x6a, 0x3f, 0x3c, 0x69, + 0x0c, 0x59, 0x5a, 0x0f, 0x55, 0x00, 0x03, 0x56, 0x56, 0x03, 0x00, 0x55, 0x0f, 0x5a, 0x59, 0x0c, + 0x0f, 0x5a, 0x59, 0x0c, 0x56, 0x03, 0x00, 0x55, 0x55, 0x00, 0x03, 0x56, 0x0c, 0x59, 0x5a, 0x0f, + 0x6a, 0x3f, 0x3c, 0x69, 0x33, 0x66, 0x65, 0x30, 0x30, 0x65, 0x66, 0x33, 0x69, 0x3c, 0x3f, 0x6a, + 0x6a, 0x3f, 0x3c, 0x69, 0x33, 0x66, 0x65, 0x30, 0x30, 0x65, 0x66, 0x33, 0x69, 0x3c, 0x3f, 0x6a, + 0x0f, 0x5a, 0x59, 0x0c, 0x56, 0x03, 0x00, 0x55, 0x55, 0x00, 0x03, 0x56, 0x0c, 0x59, 0x5a, 0x0f, + 0x0c, 0x59, 0x5a, 0x0f, 0x55, 0x00, 0x03, 0x56, 0x56, 0x03, 0x00, 0x55, 0x0f, 0x5a, 0x59, 0x0c, + 0x69, 0x3c, 0x3f, 0x6a, 0x30, 0x65, 0x66, 0x33, 0x33, 0x66, 0x65, 0x30, 0x6a, 0x3f, 0x3c, 0x69, + 0x03, 0x56, 0x55, 0x00, 0x5a, 0x0f, 0x0c, 0x59, 0x59, 0x0c, 0x0f, 0x5a, 0x00, 0x55, 0x56, 0x03, + 0x66, 0x33, 0x30, 0x65, 0x3f, 0x6a, 0x69, 0x3c, 0x3c, 0x69, 0x6a, 0x3f, 0x65, 0x30, 0x33, 0x66, + 0x65, 0x30, 0x33, 0x66, 0x3c, 0x69, 0x6a, 0x3f, 0x3f, 0x6a, 0x69, 0x3c, 0x66, 0x33, 0x30, 0x65, + 0x00, 0x55, 0x56, 0x03, 0x59, 0x0c, 0x0f, 0x5a, 0x5a, 0x0f, 0x0c, 0x59, 0x03, 0x56, 0x55, 0x00 +}; + +/* + * nand_calculate_ecc - Calculate 3-byte ECC for 256-byte block + */ +int nand_calculate_ecc(struct nand_device_s *device, const u8 *dat, u8 *ecc_code) +{ + u8 idx, reg1, reg2, reg3, tmp1, tmp2; + int i; + + /* Initialize variables */ + reg1 = reg2 = reg3 = 0; + + /* Build up column parity */ + for(i = 0; i < 256; i++) { + /* Get CP0 - CP5 from table */ + idx = nand_ecc_precalc_table[*dat++]; + reg1 ^= (idx & 0x3f); + + /* All bit XOR = 1 ? */ + if (idx & 0x40) { + reg3 ^= (u8) i; + reg2 ^= ~((u8) i); + } + } + + /* Create non-inverted ECC code from line parity */ + tmp1 = (reg3 & 0x80) >> 0; /* B7 -> B7 */ + tmp1 |= (reg2 & 0x80) >> 1; /* B7 -> B6 */ + tmp1 |= (reg3 & 0x40) >> 1; /* B6 -> B5 */ + tmp1 |= (reg2 & 0x40) >> 2; /* B6 -> B4 */ + tmp1 |= (reg3 & 0x20) >> 2; /* B5 -> B3 */ + tmp1 |= (reg2 & 0x20) >> 3; /* B5 -> B2 */ + tmp1 |= (reg3 & 0x10) >> 3; /* B4 -> B1 */ + tmp1 |= (reg2 & 0x10) >> 4; /* B4 -> B0 */ + + tmp2 = (reg3 & 0x08) << 4; /* B3 -> B7 */ + tmp2 |= (reg2 & 0x08) << 3; /* B3 -> B6 */ + tmp2 |= (reg3 & 0x04) << 3; /* B2 -> B5 */ + tmp2 |= (reg2 & 0x04) << 2; /* B2 -> B4 */ + tmp2 |= (reg3 & 0x02) << 2; /* B1 -> B3 */ + tmp2 |= (reg2 & 0x02) << 1; /* B1 -> B2 */ + tmp2 |= (reg3 & 0x01) << 1; /* B0 -> B1 */ + tmp2 |= (reg2 & 0x01) << 0; /* B7 -> B0 */ + + /* Calculate final ECC code */ +#ifdef NAND_ECC_SMC + ecc_code[0] = ~tmp2; + ecc_code[1] = ~tmp1; +#else + ecc_code[0] = ~tmp1; + ecc_code[1] = ~tmp2; +#endif + ecc_code[2] = ((~reg1) << 2) | 0x03; + + return 0; +} Property changes on: trunk/src/flash/nand_ecc.c ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/src/target/board/olimex_stm32_h103.cfg =================================================================== --- trunk/src/target/board/olimex_stm32_h103.cfg 2009-04-03 05:36:54 UTC (rev 1451) +++ trunk/src/target/board/olimex_stm32_h103.cfg 2009-04-03 08:16:47 UTC (rev 1452) @@ -1,9 +1,9 @@ -# -# Olimex STM32-H103 eval board -# -# http://olimex.com/dev/stm32-h103.html -# - -source [find target/stm32.cfg] - -set _BSTAPID 0x16410041 +# +# Olimex STM32-H103 eval board +# +# http://olimex.com/dev/stm32-h103.html +# + +source [find target/stm32.cfg] + +set _BSTAPID 0x16410041 Property changes on: trunk/src/target/board/olimex_stm32_h103.cfg ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/src/target/interface/oocdlink.cfg =================================================================== --- trunk/src/target/interface/oocdlink.cfg 2009-04-03 05:36:54 UTC (rev 1451) +++ trunk/src/target/interface/oocdlink.cfg 2009-04-03 08:16:47 UTC (rev 1452) @@ -1,12 +1,12 @@ -# -# Joern Kaipf's OOCDLink -# -# http://www.joernonline.de/contrexx2/cms/index.php?page=126 -# - -interface ft2232 -ft2232_device_desc "OOCDLink A" -ft2232_layout oocdlink -ft2232_vid_pid 0x0403 0xbaf8 -jtag_khz 5 - +# +# Joern Kaipf's OOCDLink +# +# http://www.joernonline.de/contrexx2/cms/index.php?page=126 +# + +interface ft2232 +ft2232_device_desc "OOCDLink A" +ft2232_layout oocdlink +ft2232_vid_pid 0x0403 0xbaf8 +jtag_khz 5 + Property changes on: trunk/src/target/interface/oocdlink.cfg ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/src/target/target/lpc2103.cfg =================================================================== --- trunk/src/target/target/lpc2103.cfg 2009-04-03 05:36:54 UTC (rev 1451) +++ trunk/src/target/target/lpc2103.cfg 2009-04-03 08:16:47 UTC (rev 1452) @@ -1,35 +1,35 @@ -# NXP LPC2103 ARM7TDMI-S with 32kB Flash and 8kB SRAM, clocked with 12MHz crystal - -if { [info exists CHIPNAME] } { - set _CHIPNAME $CHIPNAME -} else { - set _CHIPNAME lpc2103 -} - -if { [info exists ENDIAN] } { - set _ENDIAN $ENDIAN -} else { - set _ENDIAN little -} - -if { [info exists CPUTAPID ] } { - set _CPUTAPID $CPUTAPID -} else { - set _CPUTAPID 0x4f1f0f0f -} - -# LPC2000 -> SRST causes TRST -reset_config trst_and_srst srst_pulls_trst - -jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID - -set _TARGETNAME [format "%s.cpu" $_CHIPNAME] - -target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm7tdmi-s_r4 - -# 8kB of internal SRAM -$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x40000000 -work-area-size 0x2000 -work-area-backup 0 - -# 32kB of internal Flash, core clocked with 12MHz crystal -# flash bank lpc2000 <base> <size> 0 0 <target#> <variant> <clock> [calc_checksum] -flash bank lpc2000 0x0 0x8000 0 0 0 lpc2000_v2 12000 calc_checksum +# NXP LPC2103 ARM7TDMI-S with 32kB Flash and 8kB SRAM, clocked with 12MHz crystal + +if { [info exists CHIPNAME] } { + set _CHIPNAME $CHIPNAME +} else { + set _CHIPNAME lpc2103 +} + +if { [info exists ENDIAN] } { + set _ENDIAN $ENDIAN +} else { + set _ENDIAN little +} + +if { [info exists CPUTAPID ] } { + set _CPUTAPID $CPUTAPID +} else { + set _CPUTAPID 0x4f1f0f0f +} + +# LPC2000 -> SRST causes TRST +reset_config trst_and_srst srst_pulls_trst + +jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID + +set _TARGETNAME [format "%s.cpu" $_CHIPNAME] + +target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm7tdmi-s_r4 + +# 8kB of internal SRAM +$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x40000000 -work-area-size 0x2000 -work-area-backup 0 + +# 32kB of internal Flash, core clocked with 12MHz crystal +# flash bank lpc2000 <base> <size> 0 0 <target#> <variant> <clock> [calc_checksum] +flash bank lpc2000 0x0 0x8000 0 0 0 lpc2000_v2 12000 calc_checksum Property changes on: trunk/src/target/target/lpc2103.cfg ___________________________________________________________________ Name: svn:eol-style + native |
From: <oh...@ma...> - 2009-04-03 07:36:57
|
Author: oharboe Date: 2009-04-03 07:36:54 +0200 (Fri, 03 Apr 2009) New Revision: 1451 Added: trunk/src/target/interface/oocdlink.cfg Log: Uwe Hermann <uw...@he...> oocdlink file Added: trunk/src/target/interface/oocdlink.cfg =================================================================== --- trunk/src/target/interface/oocdlink.cfg 2009-04-03 05:36:00 UTC (rev 1450) +++ trunk/src/target/interface/oocdlink.cfg 2009-04-03 05:36:54 UTC (rev 1451) @@ -0,0 +1,12 @@ +# +# Joern Kaipf's OOCDLink +# +# http://www.joernonline.de/contrexx2/cms/index.php?page=126 +# + +interface ft2232 +ft2232_device_desc "OOCDLink A" +ft2232_layout oocdlink +ft2232_vid_pid 0x0403 0xbaf8 +jtag_khz 5 + |
From: <oh...@ma...> - 2009-04-03 07:36:03
|
Author: oharboe Date: 2009-04-03 07:36:00 +0200 (Fri, 03 Apr 2009) New Revision: 1450 Added: trunk/src/target/board/olimex_stm32_h103.cfg Log: Piotr Esden-Tempski <pi...@es...> added a board file for the Olimex STM32-H103 eval board. Added: trunk/src/target/board/olimex_stm32_h103.cfg =================================================================== --- trunk/src/target/board/olimex_stm32_h103.cfg 2009-04-03 05:33:42 UTC (rev 1449) +++ trunk/src/target/board/olimex_stm32_h103.cfg 2009-04-03 05:36:00 UTC (rev 1450) @@ -0,0 +1,9 @@ +# +# Olimex STM32-H103 eval board +# +# http://olimex.com/dev/stm32-h103.html +# + +source [find target/stm32.cfg] + +set _BSTAPID 0x16410041 |
From: <oh...@ma...> - 2009-04-03 07:33:51
|
Author: oharboe Date: 2009-04-03 07:33:42 +0200 (Fri, 03 Apr 2009) New Revision: 1449 Added: trunk/src/target/target/lpc2103.cfg Log: Freddie Chopin <fre...@op...> I attach a config file for LPC2103 Added: trunk/src/target/target/lpc2103.cfg =================================================================== --- trunk/src/target/target/lpc2103.cfg 2009-04-03 05:32:28 UTC (rev 1448) +++ trunk/src/target/target/lpc2103.cfg 2009-04-03 05:33:42 UTC (rev 1449) @@ -0,0 +1,35 @@ +# NXP LPC2103 ARM7TDMI-S with 32kB Flash and 8kB SRAM, clocked with 12MHz crystal + +if { [info exists CHIPNAME] } { + set _CHIPNAME $CHIPNAME +} else { + set _CHIPNAME lpc2103 +} + +if { [info exists ENDIAN] } { + set _ENDIAN $ENDIAN +} else { + set _ENDIAN little +} + +if { [info exists CPUTAPID ] } { + set _CPUTAPID $CPUTAPID +} else { + set _CPUTAPID 0x4f1f0f0f +} + +# LPC2000 -> SRST causes TRST +reset_config trst_and_srst srst_pulls_trst + +jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID + +set _TARGETNAME [format "%s.cpu" $_CHIPNAME] + +target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm7tdmi-s_r4 + +# 8kB of internal SRAM +$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x40000000 -work-area-size 0x2000 -work-area-backup 0 + +# 32kB of internal Flash, core clocked with 12MHz crystal +# flash bank lpc2000 <base> <size> 0 0 <target#> <variant> <clock> [calc_checksum] +flash bank lpc2000 0x0 0x8000 0 0 0 lpc2000_v2 12000 calc_checksum |
From: <oh...@ma...> - 2009-04-03 07:32:44
|
Author: oharboe Date: 2009-04-03 07:32:28 +0200 (Fri, 03 Apr 2009) New Revision: 1448 Modified: trunk/src/flash/nand.c Log: Nicolas Pitre nico at cam.org list the new flag in the "nand write" help line. Modified: trunk/src/flash/nand.c =================================================================== --- trunk/src/flash/nand.c 2009-04-02 21:24:56 UTC (rev 1447) +++ trunk/src/flash/nand.c 2009-04-03 05:32:28 UTC (rev 1448) @@ -322,7 +322,7 @@ register_command(cmd_ctx, nand_cmd, "dump", handle_nand_dump_command, COMMAND_EXEC, "dump from NAND flash device <num> <filename> <offset> <size> [options]"); register_command(cmd_ctx, nand_cmd, "write", handle_nand_write_command, COMMAND_EXEC, - "write to NAND flash device <num> <filename> <offset> [oob_raw|oob_only]"); + "write to NAND flash device <num> <filename> <offset> [oob_raw|oob_only|oob_softecc]"); register_command(cmd_ctx, nand_cmd, "raw_access", handle_nand_raw_access_command, COMMAND_EXEC, "raw access to NAND flash device <num> ['enable'|'disable']"); } |
From: <oh...@ma...> - 2009-04-02 23:24:57
|
Author: oharboe Date: 2009-04-02 23:24:56 +0200 (Thu, 02 Apr 2009) New Revision: 1447 Modified: trunk/src/target/board/sheevaplug.cfg Log: Nicolas Pitre nico at cam.org write ECC data when reflashing u-Boot on the SheevaPlug Modified: trunk/src/target/board/sheevaplug.cfg =================================================================== --- trunk/src/target/board/sheevaplug.cfg 2009-04-02 21:24:08 UTC (rev 1446) +++ trunk/src/target/board/sheevaplug.cfg 2009-04-02 21:24:56 UTC (rev 1447) @@ -99,8 +99,8 @@ sheevaplug_init nand probe 0 nand erase 0 0 4 - nand write 0 uboot.bin 0 - reset run + nand write 0 uboot.bin 0 oob_softecc + resume } |
From: <oh...@ma...> - 2009-04-02 23:24:09
|
Author: oharboe Date: 2009-04-02 23:24:08 +0200 (Thu, 02 Apr 2009) New Revision: 1446 Modified: trunk/src/flash/nand.c trunk/src/flash/nand.h Log: Nicolas Pitre nico at cam.org The ECC data is automatically computed and written to the OOB area when the oob_softecc option is passed to the "nand write" command. Modified: trunk/src/flash/nand.c =================================================================== --- trunk/src/flash/nand.c 2009-04-02 21:23:16 UTC (rev 1445) +++ trunk/src/flash/nand.c 2009-04-02 21:24:08 UTC (rev 1446) @@ -186,6 +186,39 @@ {0x0, NULL}, }; +/* + * Define default oob placement schemes for large and small page devices + */ + +nand_ecclayout_t nand_oob_8 = { + .eccbytes = 3, + .eccpos = {0, 1, 2}, + .oobfree = { + {.offset = 3, + .length = 2}, + {.offset = 6, + .length = 2}} +}; + +nand_ecclayout_t nand_oob_16 = { + .eccbytes = 6, + .eccpos = {0, 1, 2, 3, 6, 7}, + .oobfree = { + {.offset = 8, + . length = 8}} +}; + +nand_ecclayout_t nand_oob_64 = { + .eccbytes = 24, + .eccpos = { + 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63}, + .oobfree = { + {.offset = 2, + .length = 38}} +}; + /* nand device <nand_controller> [controller options] */ int handle_nand_device_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) @@ -1291,6 +1324,7 @@ u32 page_size = 0; u8 *oob = NULL; u32 oob_size = 0; + const int *eccpos = NULL; offset = strtoul(args[2], NULL, 0); @@ -1303,6 +1337,8 @@ oob_format |= NAND_OOB_RAW; else if (!strcmp(args[i], "oob_only")) oob_format |= NAND_OOB_RAW | NAND_OOB_ONLY; + else if (!strcmp(args[i], "oob_softecc")) + oob_format |= NAND_OOB_SW_ECC; else { command_print(cmd_ctx, "unknown option: %s", args[i]); @@ -1326,12 +1362,15 @@ page = malloc(p->page_size); } - if (oob_format & NAND_OOB_RAW) + if (oob_format & (NAND_OOB_RAW | NAND_OOB_SW_ECC)) { - if (p->page_size == 512) + if (p->page_size == 512) { oob_size = 16; - else if (p->page_size == 2048) + eccpos = nand_oob_16.eccpos; + } else if (p->page_size == 2048) { oob_size = 64; + eccpos = nand_oob_64.eccpos; + } oob = malloc(oob_size); } @@ -1357,9 +1396,21 @@ memset(page + size_read, 0xff, page_size - size_read); } } - - if (NULL != oob) + + if (oob_format & NAND_OOB_SW_ECC) { + int i, j; + u8 ecc[3]; + memset(oob, 0xff, oob_size); + for (i = 0, j = 0; i < page_size; i += 256) { + nand_calculate_ecc(p, page+i, ecc); + oob[eccpos[j++]] = ecc[0]; + oob[eccpos[j++]] = ecc[1]; + oob[eccpos[j++]] = ecc[2]; + } + } + else if (NULL != oob) + { fileio_read(&fileio, oob_size, oob, &size_read); buf_cnt -= size_read; if (size_read < oob_size) Modified: trunk/src/flash/nand.h =================================================================== --- trunk/src/flash/nand.h 2009-04-02 21:23:16 UTC (rev 1445) +++ trunk/src/flash/nand.h 2009-04-02 21:24:08 UTC (rev 1446) @@ -56,6 +56,18 @@ int is_bad; } nand_block_t; +struct nand_oobfree { + int offset; + int length; +}; + +typedef struct nand_ecclayout_s { + int eccbytes; + int eccpos[64]; + int oobavail; + struct nand_oobfree oobfree[2]; +} nand_ecclayout_t; + typedef struct nand_device_s { nand_flash_controller_t *controller; |
From: <oh...@ma...> - 2009-04-02 23:23:18
|
Author: oharboe Date: 2009-04-02 23:23:16 +0200 (Thu, 02 Apr 2009) New Revision: 1445 Added: trunk/src/flash/nand_ecc.c Log: Nicolas Pitre nico at cam.org software ECC computation for NAND flash Added: trunk/src/flash/nand_ecc.c =================================================================== --- trunk/src/flash/nand_ecc.c 2009-04-02 21:23:05 UTC (rev 1444) +++ trunk/src/flash/nand_ecc.c 2009-04-02 21:23:16 UTC (rev 1445) @@ -0,0 +1,126 @@ +/* + * This file contains an ECC algorithm from Toshiba that allows for detection + * and correction of 1-bit errors in a 256 byte block of data. + * + * [ Extracted from the initial code found in some early Linux versions. + * The current Linux code is bigger while being faster, but this is of + * no real benefit when the bottleneck largely remains the JTAG link. ] + * + * Copyright (C) 2000-2004 Steven J. Hill (sjhill at realitydiluted.com) + * Toshiba America Electronics Components, Inc. + * + * Copyright (C) 2006 Thomas Gleixner <tglx at linutronix.de> + * + * This file is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 or (at your option) any + * later version. + * + * This file is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this file; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * As a special exception, if other files instantiate templates or use + * macros or inline functions from these files, or you compile these + * files and link them with other works to produce a work based on these + * files, these files do not by themselves cause the resulting work to be + * covered by the GNU General Public License. However the source code for + * these files must still be made available in accordance with section (3) + * of the GNU General Public License. + * + * This exception does not invalidate any other reasons why a work based on + * this file might be covered by the GNU General Public License. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "replacements.h" + +#include <inttypes.h> + +#include "nand.h" + +/* + * Pre-calculated 256-way 1 byte column parity + */ +static const u8 nand_ecc_precalc_table[] = { + 0x00, 0x55, 0x56, 0x03, 0x59, 0x0c, 0x0f, 0x5a, 0x5a, 0x0f, 0x0c, 0x59, 0x03, 0x56, 0x55, 0x00, + 0x65, 0x30, 0x33, 0x66, 0x3c, 0x69, 0x6a, 0x3f, 0x3f, 0x6a, 0x69, 0x3c, 0x66, 0x33, 0x30, 0x65, + 0x66, 0x33, 0x30, 0x65, 0x3f, 0x6a, 0x69, 0x3c, 0x3c, 0x69, 0x6a, 0x3f, 0x65, 0x30, 0x33, 0x66, + 0x03, 0x56, 0x55, 0x00, 0x5a, 0x0f, 0x0c, 0x59, 0x59, 0x0c, 0x0f, 0x5a, 0x00, 0x55, 0x56, 0x03, + 0x69, 0x3c, 0x3f, 0x6a, 0x30, 0x65, 0x66, 0x33, 0x33, 0x66, 0x65, 0x30, 0x6a, 0x3f, 0x3c, 0x69, + 0x0c, 0x59, 0x5a, 0x0f, 0x55, 0x00, 0x03, 0x56, 0x56, 0x03, 0x00, 0x55, 0x0f, 0x5a, 0x59, 0x0c, + 0x0f, 0x5a, 0x59, 0x0c, 0x56, 0x03, 0x00, 0x55, 0x55, 0x00, 0x03, 0x56, 0x0c, 0x59, 0x5a, 0x0f, + 0x6a, 0x3f, 0x3c, 0x69, 0x33, 0x66, 0x65, 0x30, 0x30, 0x65, 0x66, 0x33, 0x69, 0x3c, 0x3f, 0x6a, + 0x6a, 0x3f, 0x3c, 0x69, 0x33, 0x66, 0x65, 0x30, 0x30, 0x65, 0x66, 0x33, 0x69, 0x3c, 0x3f, 0x6a, + 0x0f, 0x5a, 0x59, 0x0c, 0x56, 0x03, 0x00, 0x55, 0x55, 0x00, 0x03, 0x56, 0x0c, 0x59, 0x5a, 0x0f, + 0x0c, 0x59, 0x5a, 0x0f, 0x55, 0x00, 0x03, 0x56, 0x56, 0x03, 0x00, 0x55, 0x0f, 0x5a, 0x59, 0x0c, + 0x69, 0x3c, 0x3f, 0x6a, 0x30, 0x65, 0x66, 0x33, 0x33, 0x66, 0x65, 0x30, 0x6a, 0x3f, 0x3c, 0x69, + 0x03, 0x56, 0x55, 0x00, 0x5a, 0x0f, 0x0c, 0x59, 0x59, 0x0c, 0x0f, 0x5a, 0x00, 0x55, 0x56, 0x03, + 0x66, 0x33, 0x30, 0x65, 0x3f, 0x6a, 0x69, 0x3c, 0x3c, 0x69, 0x6a, 0x3f, 0x65, 0x30, 0x33, 0x66, + 0x65, 0x30, 0x33, 0x66, 0x3c, 0x69, 0x6a, 0x3f, 0x3f, 0x6a, 0x69, 0x3c, 0x66, 0x33, 0x30, 0x65, + 0x00, 0x55, 0x56, 0x03, 0x59, 0x0c, 0x0f, 0x5a, 0x5a, 0x0f, 0x0c, 0x59, 0x03, 0x56, 0x55, 0x00 +}; + +/* + * nand_calculate_ecc - Calculate 3-byte ECC for 256-byte block + */ +int nand_calculate_ecc(struct nand_device_s *device, const u8 *dat, u8 *ecc_code) +{ + u8 idx, reg1, reg2, reg3, tmp1, tmp2; + int i; + + /* Initialize variables */ + reg1 = reg2 = reg3 = 0; + + /* Build up column parity */ + for(i = 0; i < 256; i++) { + /* Get CP0 - CP5 from table */ + idx = nand_ecc_precalc_table[*dat++]; + reg1 ^= (idx & 0x3f); + + /* All bit XOR = 1 ? */ + if (idx & 0x40) { + reg3 ^= (u8) i; + reg2 ^= ~((u8) i); + } + } + + /* Create non-inverted ECC code from line parity */ + tmp1 = (reg3 & 0x80) >> 0; /* B7 -> B7 */ + tmp1 |= (reg2 & 0x80) >> 1; /* B7 -> B6 */ + tmp1 |= (reg3 & 0x40) >> 1; /* B6 -> B5 */ + tmp1 |= (reg2 & 0x40) >> 2; /* B6 -> B4 */ + tmp1 |= (reg3 & 0x20) >> 2; /* B5 -> B3 */ + tmp1 |= (reg2 & 0x20) >> 3; /* B5 -> B2 */ + tmp1 |= (reg3 & 0x10) >> 3; /* B4 -> B1 */ + tmp1 |= (reg2 & 0x10) >> 4; /* B4 -> B0 */ + + tmp2 = (reg3 & 0x08) << 4; /* B3 -> B7 */ + tmp2 |= (reg2 & 0x08) << 3; /* B3 -> B6 */ + tmp2 |= (reg3 & 0x04) << 3; /* B2 -> B5 */ + tmp2 |= (reg2 & 0x04) << 2; /* B2 -> B4 */ + tmp2 |= (reg3 & 0x02) << 2; /* B1 -> B3 */ + tmp2 |= (reg2 & 0x02) << 1; /* B1 -> B2 */ + tmp2 |= (reg3 & 0x01) << 1; /* B0 -> B1 */ + tmp2 |= (reg2 & 0x01) << 0; /* B7 -> B0 */ + + /* Calculate final ECC code */ +#ifdef NAND_ECC_SMC + ecc_code[0] = ~tmp2; + ecc_code[1] = ~tmp1; +#else + ecc_code[0] = ~tmp1; + ecc_code[1] = ~tmp2; +#endif + ecc_code[2] = ((~reg1) << 2) | 0x03; + + return 0; +} |
From: <oh...@ma...> - 2009-04-02 23:23:06
|
Author: oharboe Date: 2009-04-02 23:23:05 +0200 (Thu, 02 Apr 2009) New Revision: 1444 Modified: trunk/src/flash/Makefile.am trunk/src/flash/nand.h Log: Nicolas Pitre nico at cam.org software ECC computation for NAND flash Modified: trunk/src/flash/Makefile.am =================================================================== --- trunk/src/flash/Makefile.am 2009-04-02 21:22:14 UTC (rev 1443) +++ trunk/src/flash/Makefile.am 2009-04-02 21:23:05 UTC (rev 1444) @@ -2,11 +2,15 @@ AM_CPPFLAGS = -DPKGLIBDIR=\"$(pkglibdir)\" @CPPFLAGS@ METASOURCES = AUTO noinst_LIBRARIES = libflash.a -libflash_a_SOURCES = flash.c lpc2000.c cfi.c non_cfi.c at91sam7.c at91sam7_old.c str7x.c str9x.c aduc702x.c nand.c lpc3180_nand_controller.c \ - stellaris.c str9xpec.c stm32x.c tms470.c ecos.c orion_nand.c \ - s3c24xx_nand.c s3c2410_nand.c s3c2412_nand.c s3c2440_nand.c s3c2443_nand.c lpc288x.c ocl.c mflash.c pic32mx.c -noinst_HEADERS = flash.h lpc2000.h cfi.h non_cfi.h at91sam7.h at91sam7_old.h str7x.h str9x.h nand.h lpc3180_nand_controller.h \ - stellaris.h str9xpec.h stm32x.h tms470.h s3c24xx_nand.h s3c24xx_regs_nand.h lpc288x.h mflash.h \ - ocl.h pic32mx.h - +libflash_a_SOURCES = \ + flash.c lpc2000.c cfi.c non_cfi.c at91sam7.c at91sam7_old.c \ + str7x.c str9x.c aduc702x.c nand.c nand_ecc.c \ + lpc3180_nand_controller.c stellaris.c str9xpec.c stm32x.c tms470.c \ + ecos.c orion_nand.c s3c24xx_nand.c s3c2410_nand.c s3c2412_nand.c \ + s3c2440_nand.c s3c2443_nand.c lpc288x.c ocl.c mflash.c pic32mx.c +noinst_HEADERS = \ + flash.h lpc2000.h cfi.h non_cfi.h at91sam7.h at91sam7_old.h str7x.h \ + str9x.h nand.h lpc3180_nand_controller.h stellaris.h str9xpec.h \ + stm32x.h tms470.h s3c24xx_nand.h s3c24xx_regs_nand.h lpc288x.h \ + mflash.h ocl.h pic32mx.h MAINTAINERCLEANFILES = Makefile.in Modified: trunk/src/flash/nand.h =================================================================== --- trunk/src/flash/nand.h 2009-04-02 21:22:14 UTC (rev 1443) +++ trunk/src/flash/nand.h 2009-04-02 21:23:05 UTC (rev 1444) @@ -197,6 +197,7 @@ extern int nand_read_page_raw(struct nand_device_s *device, u32 page, u8 *data, u32 data_size, u8 *oob, u32 oob_size); extern int nand_write_page_raw(struct nand_device_s *device, u32 page, u8 *data, u32 data_size, u8 *oob, u32 oob_size); extern int nand_read_status(struct nand_device_s *device, u8 *status); +extern int nand_calculate_ecc(struct nand_device_s *device, const u8 *dat, u8 *ecc_code); extern int nand_register_commands(struct command_context_s *cmd_ctx); extern int nand_init(struct command_context_s *cmd_ctx); |