From: Zach W. <zw...@us...> - 2009-11-13 21:25:24
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via d16968e24f5d9e436ae4e136cd27652c4c948203 (commit) via 96b62996d2d81b09a48bf253bc9e60e637f687bd (commit) via 2f6e56e38320350bb300b363d0b3737fa8d1f3ea (commit) via 0f1163e823c6ca3c2a81fa296157f5dde0635fea (commit) via d0dee7ccafcf87259fadf6c5de43df8583b0e885 (commit) via ac927559c3ce5406adac34b9d4ca4ecb37a48181 (commit) via d64a873db44258470b50f370f2c8af71157952d0 (commit) via dfecfd5fd471708ac15af08b52964e8f8da9f4be (commit) via af949b2531d2a8863d077025db40cbb170d13a63 (commit) via d0c19e0a9d51211953a363026c662d290542fe85 (commit) via 6421c2075c733d18b7fc9daed847c135b98230b7 (commit) via 4952eadd8f04ca3755c30013abc3ea85e35d8654 (commit) via d90063ffc54ea042c0ff37e6cec1e95848bf1e26 (commit) via 2ec440588fa455e4609bae3d7fc146bf53f1bbab (commit) via cdd2d9c2d0dee319ba5d2f419ac78aa6490bb74b (commit) via d727f978897105ceacfed06da0152b4b4dfffc3d (commit) via 42fb6b88764fb39fd07726d7bb447a79c3951aa4 (commit) via 53c05c8b1d5718b2acf5dbe0eb517dd427340041 (commit) via 1e51cf049cfed3bc42a748d848210f8e4b472282 (commit) via e76d085603c36efddd9b38cc7383f86ee399177c (commit) via abd7b404086d3c63b163a5ffa786f3538714b7d9 (commit) via 55edfdf2ab6c5d1d6cd4c1c97a79cbb1d39b1f22 (commit) via 22f6a4cef5b4bf6696a7ea0fa41fafc3da06c9fa (commit) via 18475360b253e52eae7d070421523d5d7636383d (commit) via 1f87cf4e804812c81279cc7bcb0fcb86aa2bf48f (commit) via ea34dc988f63ffa1a9ba9e592a65f2f46e78f82a (commit) via 73ad5cbb1a6d60ee2209ad9faadd19df0295942a (commit) via 151347585a48ef746d8ffbfed7ba9bd621737b0c (commit) via 93459582fd340e4f63efed0fab9abd49a2cb6373 (commit) via 2d5767201b8b748b85d6aceb7dd93965e25bd00b (commit) via 46fc1d57ac9462fd788277609707a379c7a406cb (commit) via c2b5d8a6fa72ce6b0fed1e612d4fe5e4b54ba45a (commit) via 74d09617b927ed7011098d5a65087dee1ef1e87a (commit) via de3fb2f3bce2de5be44223204ce368216ed85b0f (commit) via f4e03e3b902104f5cf8aab1ea3cd5db2bb36890e (commit) via b87f07110a42981aa53bb6f824d29216658dafc4 (commit) via a8141cafdef162d52e128cd2ab51702b9800fda2 (commit) via ccde06a08fbf9c4f57b321dbec0509f73239c2de (commit) via 3b7aee21b50f4bd0014878f29129ac33812faea3 (commit) via 1bd7a78d92e06fcd403c915f0e9d3ecdbcc8305d (commit) via ef36a7fb3b87bddc14ad9c5d98fde1d041a0de2d (commit) via b154972bdbcbda1ae8e05271c0db556fade8dbef (commit) via 1a4ff43a7ce4463e7b37f893ca185b055ec6fa9d (commit) via a87faf5b66fabb03cdf15a54185f15b91da779c2 (commit) via 24df46d0676630c90f04ee49b96533f5fddca6cd (commit) via 99614219ad111c124ea5d5f997bb388cbcf00e32 (commit) via e2001ba2116fe5c0c75f7953b5fbe35da65fa29d (commit) via 63242c6d45570ca32fd569a71b5ecea522f839ea (commit) via 01f9dc18fcce8d5a0e02e56822d580da81570fdc (commit) via 2f7fc2921d5769799f1bd527b49a7a877b4c8fa0 (commit) via 26a99ed740f4071c9eebba10f7f597844812fc13 (commit) via a1971ecacf6450aa57192680fc201928deb46b7d (commit) via 72b421418f315cb54a01ba4d249082f989d5154a (commit) via e7f65c5a116802c4e510fe212b26e9a020de0b3e (commit) via 4bc80e5a65dde09ca795e50e77bcfe77b8dd444f (commit) via 94f5ed90f1832e81803713f4364de586a69247d4 (commit) via 5e43565ab543b1ceff4cc8030434a54ac28dd875 (commit) via e8a6e3b2f4e1b0f3cccfa01c486fbdd952842801 (commit) via 2744a031cb333f4d1c2cd81171cbdafd6c780e1d (commit) via 5415d07139faeb2541127d5a7bcedef833b79de3 (commit) via 248448ee3a5f4f97307f1d5af4ef940529478a34 (commit) via f6dae0cf84de26846a18f3fcaea842ccd898a5c1 (commit) via 405a5df7860bf9c0465fce4ac517083a1f9c4a4b (commit) via e976786d55c367ec5b867baffb055b06bbda6ea0 (commit) via 2dd9c5e1da3a7e9152e7ca45fefc73363b509d5a (commit) via 15e8e4530866454c18c5d91ad9e867f339c2e82b (commit) via 056fcdb540f0ab9a404f3b5de72fd707eb146603 (commit) via c25e00b52810822108b54ac40dffadba62ef48d9 (commit) via 7de3c44320af79e5d666e5a4cb4a669f5ecb8eb5 (commit) via f9e091a2d3841d4b5e2f49f3b4337261974b2f2c (commit) via 67f2f8393742bd88017b54ae0cfd833265bb1517 (commit) via f96d6054e65708e7abdceac673f1a18fec3204b6 (commit) via 6ba48a1b44d34e445af17ae66efb7e168f911a0f (commit) via 785115a6a0a850f24f01fb385757a331eea9f093 (commit) via 1ad4ee2deb5a888cb9f9b825a0e4fbfa68aa1218 (commit) via 5f68f45186c1fe73e1c83bd5847edd6bfaf06b34 (commit) via 16487e70856a72f9cbe174c7d7d2fb6a1f258100 (commit) via b174a0d75ec81fbcd075c8c8d7f915e4a3d76bc3 (commit) via 8e77975b92a75d392727339eccd6cc7898628ebb (commit) via 8012b3963fc49c7edf87f31a93bc0039095f5b59 (commit) via bcb18b2044e9a9b812f8e0d390ed903f74524586 (commit) via f3b3752a9eebae273da6580c182e9d1486e41ed9 (commit) via 3bcd9ad9d017649038be26fad5440e507db2118d (commit) via 55926f576f99a0c67b2836fedf0dc1bfc1260428 (commit) via 0eae94879d85a7a402c890bda66efdeffde6f1c7 (commit) via b1de5eb9a074b362e953e857c42cac9a9b18b2a3 (commit) via 6c965a3da9cd6f5b2cf1b177d38723356c83d923 (commit) via 996613522df32870b23e68d8d63e523908694598 (commit) via 52bc6cad87c2ae0558ec5b3539fecad15b75b008 (commit) via ea49f2e3ff55268faeff6e1603d86025873320ed (commit) via 95bf461c0af385fc6b3abfff610e5510534ef571 (commit) via db08ab8a792a09399d2ffe362f580683ff102707 (commit) via cd4c0598060dc6539604c9cad8cb645aa14b4ab1 (commit) via db2086897a581111bb86a0fb49d72b776a9801a9 (commit) via 38d826cec18902f719439903838ebb612575d05d (commit) via f7cd2aa0ef2939f7d3df5f4a86f5e777a27dbd37 (commit) via f2cbaba3cc4af99db7b4f2682c2e0dd4467655e3 (commit) via 8775a0f6638d966b6ef135b488da6efb954e2573 (commit) via e01a0be57655683c58e9dd5e66ee30fe3049e8d9 (commit) via 45a165a432eae2eb74b97ec5196736a352923a12 (commit) via 53bfd73591037044b391dd9a849e77284a7932d1 (commit) via 43483e5054c78e0fdfaebed5e14c14246af07c97 (commit) via a03c9a8dce92d0df0e995e348edfa1b3ea952f45 (commit) via 6a374afe71ad947970b5d5bb14fa4b4c856ebfc8 (commit) via 3c9afaa6454879a48d684338041250f2a1165c93 (commit) via 54be77bc79ce05cd1ce4320958d8ce9d131aea09 (commit) via d0dfec33b6d6844c3c1b817a464b9f040ce40087 (commit) via 92fc7a6fdecac39ebc890ee3c2ae91f3fd50fdc5 (commit) via 6aa82891b60dc4a332ac548c13fc8d207bf171b0 (commit) via 774d71f2cf7bce27a01424fad360cbadebf20459 (commit) via 3b09560ae8db9685f03b358709fc63d1bb545628 (commit) via 01b10d65bfcc6eb9a3994b20b1342389edda2df0 (commit) via c7b2cad52dbc59b53d6f1734a443d3ad5e826a42 (commit) via 40273967bf535aefb3eaec9367c50e7799b079bb (commit) via 9059f9f28e4d88c9608ef92723bbd493e106ba67 (commit) via ed9c4ef3c41ac21d0a08cb7e07ab68d0c7930138 (commit) via eba5608b5227696e00437543c0226ed04cae12d5 (commit) via 5948e66ee8f2331606c2adce439c5d7ebc77d51f (commit) via c7b96a4dc106fc28808f9503d15803e942b941a0 (commit) via 958ff04b086d60e901bfd9c05cf7b4e3e5af641a (commit) via f7ca04721300da7ddd4031885e98f3138825ccd1 (commit) via 8f4860d13f03c40b28bb32e9cb0f1d650e200ce9 (commit) via 86053523875d18151f3dd0b53bf30e07eec2acf2 (commit) via 4bc46d61cade59a43d158862dfbe738255f00a81 (commit) via 79338ec6c208fc34d2c16d109dea6bf5ae20f860 (commit) via bb6b9988cbd32f5f87e228340172aa1004775df2 (commit) via fc01dd6a13167c33491b9ccc1543d34b2e485c32 (commit) via a043632a529c0b98bb8771c8815e7681e4ed0f12 (commit) via ed1aed8dd9f282fe7a948676453054c15d8ebd4e (commit) via b712a4e8b85f3b351f2af93d0988d9983e57d6fe (commit) via 12f83f0429a84168f8761a575a12c703025dd598 (commit) via a15d4cc75eb7bae55db5f6a156cd15918d574688 (commit) via 632fd663a821047df9a9b965ec1c35d6b034ebba (commit) via fb59ec739a3ae79937020dc2fe5413be0e73e8d3 (commit) via 98d7ed8523f4324b21963d6b15391df91680a658 (commit) via de1781b7fa5aa73ba4c74dcc14e449acb44182ec (commit) via 453a103f48242b2b48031c7d268782df0347f81f (commit) via 4c28cc68edfb6a3ced1e31fae8a91fbbbc2f02cf (commit) via 0139e7d51abfba861ff9d3c8c1bc1b12e79c696a (commit) via 2ded74115d2b1dcea5a1c1a327a0da159cf1b962 (commit) via 1f328f2885f370aa9f79d2ed08515821bc8d856a (commit) via 3be0edbc5e5b121caee3ebdf987f5e9c47d4257e (commit) via a7a8a1c9e2e86902a3a5864cd257e01e0b3f6da6 (commit) via 6ca63ee756ea0772a60760da37867ca982b0b049 (commit) via 3877201581c96a02d0e49b74050272ae77753cf1 (commit) via 246068fd8985b293d7109058f83c57f6c22a4336 (commit) via 1053c32d9ecc95ce946bbbf49cccfe800881f9aa (commit) via 22b220ad7f42ea288b1762692d079ecbde10ba24 (commit) via cf2e402d71fa39dc8138985027b7ab8f4d510e81 (commit) via 8cc8c0544f3f24772d6644df16d5a70d4ffe8b4a (commit) via 2fecae46f62ca98657d650de9fc73d44247971e8 (commit) via 5f6d8ecf8c2cf1427a8677155843081d07ff57c4 (commit) via c07f0600ff3c77a00efaf4bdcd4dc3691f0421f6 (commit) via af3f4a0bbefd796bd40602ae28f66dd373272e6a (commit) via e11c5a3b42a2a39c5b24c9a19ba03f7b16caf3d7 (commit) via 2ddeec9db5a8771c948294b7194778a95295b7a0 (commit) via 4a29f8e21d4932ddf6523ccf23463d8636ad05a9 (commit) via 7c0ba75eae7162147e7cb6e55fa709f014f2abf4 (commit) via ffc77b61ddb4407f6c6dcd6188a07d5c630a2780 (commit) via a3f1c87eb72a8c91c54999e04349253159c1bdfd (commit) via 4bc155398e88c9cc4393e4113496d088b7ff7ab0 (commit) via 9036fdd589b20f7a5f2757a1ad01ca7e47a68fab (commit) via e1c26950c03b09efe42b8a25dd83f1e50e22a507 (commit) via 8bbb279c2820e8d0b3c95e0de0289be933ccea92 (commit) via 5874d5f2ea2ef9bd7d759d47ed868269ba99ab65 (commit) via 363d72a48457e03d2ffdbf9154b8ba3fdb9197d0 (commit) via 9f535f9af7c6b7e8843033049a6da0f6d76d513b (commit) via bee796b5b07a0f83ed0ad2360bad70d8409e1109 (commit) via c20b779b891f9d0fd031880841b269fbe8582579 (commit) via ff3150922b676223ad1acc4bcd127aa9fe03fa31 (commit) via d0809ac060b35a04e7f0bceb96e1868663bd18df (commit) via 42ef503d37b18d907da16d26e99167566d5aabd1 (commit) via 9f212b01be20da43ba534ad33b20419779c89335 (commit) via f59ec2043b840a4534fdd61502de59e2571988d5 (commit) from 99b57b6dccec1059f746121b9b9ddb11313f708b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d16968e24f5d9e436ae4e136cd27652c4c948203 Author: Zachary T Welch <zw...@su...> Date: Fri Nov 13 12:19:39 2009 -0800 remove rlink structure typedefs Remove useless typedefs from the rlink driver. Improve whitespace. diff --git a/src/jtag/rlink/rlink.c b/src/jtag/rlink/rlink.c index bc35457..9dd8b88 100644 --- a/src/jtag/rlink/rlink.c +++ b/src/jtag/rlink/rlink.c @@ -576,8 +576,7 @@ dtc_run_download( * The dtc reply queue is a singly linked list that describes what to do with the reply packet that comes from the DTC. Only SCAN_IN and SCAN_IO generate these entries. */ -typedef -struct dtc_reply_queue_entry_s { +struct dtc_reply_queue_entry { struct dtc_reply_queue_entry_s *next; jtag_command_t *cmd; /* the command that resulted in this entry */ @@ -588,7 +587,7 @@ struct dtc_reply_queue_entry_s { int length; /* how many bits are processed in this operation? */ enum scan_type type; /* SCAN_IN/SCAN_OUT/SCAN_IO */ } scan; -} dtc_reply_queue_entry_t; +}; /* @@ -598,8 +597,8 @@ struct dtc_reply_queue_entry_s { static struct { - dtc_reply_queue_entry_t *rq_head; - dtc_reply_queue_entry_t *rq_tail; + struct dtc_reply_queue_entry *rq_head; + struct dtc_reply_queue_entry *rq_tail; uint32_t cmd_index; uint32_t reply_index; uint8_t cmd_buffer[USB_EP2BANK_SIZE]; @@ -631,7 +630,7 @@ dtc_queue_init(void) { static inline -dtc_reply_queue_entry_t * +struct dtc_reply_queue_entry * dtc_queue_enqueue_reply( enum scan_type type, uint8_t *buffer, @@ -640,9 +639,9 @@ dtc_queue_enqueue_reply( int length, jtag_command_t *cmd ) { - dtc_reply_queue_entry_t *rq_entry; + struct dtc_reply_queue_entry *rq_entry; - rq_entry = malloc(sizeof(dtc_reply_queue_entry_t)); + rq_entry = malloc(sizeof(struct dtc_reply_queue_entry)); if (rq_entry != NULL) { rq_entry->scan.type = type; rq_entry->scan.buffer = buffer; @@ -672,7 +671,7 @@ dtc_queue_enqueue_reply( static int dtc_queue_run(void) { - dtc_reply_queue_entry_t *rq_p, *rq_next; + struct dtc_reply_queue_entry *rq_p, *rq_next; int retval; int usb_err; int bit_cnt; diff --git a/src/jtag/rlink/rlink.h b/src/jtag/rlink/rlink.h index 6bab26e..b53be5c 100644 --- a/src/jtag/rlink/rlink.h +++ b/src/jtag/rlink/rlink.h @@ -20,13 +20,12 @@ #include "types.h" -typedef -struct rlink_speed_table_s { - uint8_t const *dtc; - uint16_t dtc_size; - uint16_t khz; - uint8_t prescaler; -} rlink_speed_table_t; +struct rlink_speed_table { + uint8_t const *dtc; + uint16_t dtc_size; + uint16_t khz; + uint8_t prescaler; +}; -extern const rlink_speed_table_t rlink_speed_table[]; -extern const size_t rlink_speed_table_size; +extern const struct rlink_speed_table rlink_speed_table[]; +extern const size_t rlink_speed_table_size; diff --git a/src/jtag/rlink/rlink_speed_table.c b/src/jtag/rlink/rlink_speed_table.c index 1f3e973..5c40ab4 100644 --- a/src/jtag/rlink/rlink_speed_table.c +++ b/src/jtag/rlink/rlink_speed_table.c @@ -87,7 +87,7 @@ static const uint8_t dtc_2[] = { 36, 139, 112, 193, 151, 96 }; -const rlink_speed_table_t rlink_speed_table[] = {{ +const struct rlink_speed_table rlink_speed_table[] = {{ dtc_64, sizeof(dtc_64), (ST7_FOSC * 2) / (1000 * 64), 64 }, { dtc_11, sizeof(dtc_11), (ST7_FOSC * 2) / (1000 * 11), 11 commit 96b62996d2d81b09a48bf253bc9e60e637f687bd Author: Zachary T Welch <zw...@su...> Date: Fri Nov 13 11:32:28 2009 -0800 flash_bank_t -> struct flash_bank Remove misleading typedef and redundant suffix from struct flash_bank. diff --git a/src/flash/aduc702x.c b/src/flash/aduc702x.c index 76f38b5..c2a1884 100644 --- a/src/flash/aduc702x.c +++ b/src/flash/aduc702x.c @@ -29,7 +29,7 @@ #include "time_support.h" -static int aduc702x_build_sector_list(struct flash_bank_s *bank); +static int aduc702x_build_sector_list(struct flash_bank *bank); static int aduc702x_check_flash_completion(struct target* target, unsigned int timeout_ms); static int aduc702x_set_write_enable(struct target *target, int enable); @@ -64,9 +64,9 @@ FLASH_BANK_COMMAND_HANDLER(aduc702x_flash_bank_command) return ERROR_OK; } -static int aduc702x_build_sector_list(struct flash_bank_s *bank) +static int aduc702x_build_sector_list(struct flash_bank *bank) { - //aduc7026_flash_bank_t *aduc7026_info = bank->driver_priv; + //aduc7026_struct flash_bank *aduc7026_info = bank->driver_priv; int i = 0; uint32_t offset = 0; @@ -86,13 +86,13 @@ static int aduc702x_build_sector_list(struct flash_bank_s *bank) return ERROR_OK; } -static int aduc702x_protect_check(struct flash_bank_s *bank) +static int aduc702x_protect_check(struct flash_bank *bank) { printf("aduc702x_protect_check not implemented yet.\n"); return ERROR_OK; } -static int aduc702x_erase(struct flash_bank_s *bank, int first, int last) +static int aduc702x_erase(struct flash_bank *bank, int first, int last) { //int res; int x; @@ -145,7 +145,7 @@ static int aduc702x_erase(struct flash_bank_s *bank, int first, int last) return ERROR_OK; } -static int aduc702x_protect(struct flash_bank_s *bank, int set, int first, int last) +static int aduc702x_protect(struct flash_bank *bank, int set, int first, int last) { printf("aduc702x_protect not implemented yet.\n"); return ERROR_FLASH_OPERATION_FAILED; @@ -156,7 +156,7 @@ static int aduc702x_protect(struct flash_bank_s *bank, int set, int first, int l * * Caller should not check for other return values specifically */ -static int aduc702x_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count) +static int aduc702x_write_block(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { struct aduc702x_flash_bank *aduc702x_info = bank->driver_priv; struct target *target = bank->target; @@ -301,7 +301,7 @@ static int aduc702x_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint /* All-JTAG, single-access method. Very slow. Used only if there is no * working area available. */ -static int aduc702x_write_single(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count) +static int aduc702x_write_single(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { uint32_t x; uint8_t b; @@ -342,7 +342,7 @@ static int aduc702x_write_single(struct flash_bank_s *bank, uint8_t *buffer, uin return ERROR_OK; } -int aduc702x_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count) +int aduc702x_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { int retval; @@ -366,12 +366,12 @@ int aduc702x_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, return retval; } -static int aduc702x_probe(struct flash_bank_s *bank) +static int aduc702x_probe(struct flash_bank *bank) { return ERROR_OK; } -static int aduc702x_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int aduc702x_info(struct flash_bank *bank, char *buf, int buf_size) { snprintf(buf, buf_size, "aduc702x flash driver info"); return ERROR_OK; diff --git a/src/flash/at91sam3.c b/src/flash/at91sam3.c index 3caf96c..b756e48 100644 --- a/src/flash/at91sam3.c +++ b/src/flash/at91sam3.c @@ -175,7 +175,7 @@ struct sam3_bank_private { // so we can find the chip we belong to struct sam3_chip *pChip; // so we can find the orginal bank pointer - flash_bank_t *pBank; + struct flash_bank *pBank; unsigned bank_number; uint32_t controller_address; uint32_t base_address; @@ -1456,7 +1456,7 @@ static const struct sam3_reg_list sam3_all_regs[] = { static struct sam3_bank_private * -get_sam3_bank_private(flash_bank_t *bank) +get_sam3_bank_private(struct flash_bank *bank) { return (struct sam3_bank_private *)(bank->driver_priv); } @@ -1582,7 +1582,7 @@ sam3_GetInfo(struct sam3_chip *pChip) static int -sam3_erase_check(struct flash_bank_s *bank) +sam3_erase_check(struct flash_bank *bank) { int x; @@ -1606,7 +1606,7 @@ sam3_erase_check(struct flash_bank_s *bank) } static int -sam3_protect_check(struct flash_bank_s *bank) +sam3_protect_check(struct flash_bank *bank) { int r; uint32_t v=0; @@ -1709,7 +1709,7 @@ sam3_GetDetails(struct sam3_bank_private *pPrivate) const struct sam3_chip_details *pDetails; struct sam3_chip *pChip; void *vp; - flash_bank_t *saved_banks[SAM3_MAX_FLASH_BANKS]; + struct flash_bank *saved_banks[SAM3_MAX_FLASH_BANKS]; unsigned x; const char *cp; @@ -1777,7 +1777,7 @@ sam3_GetDetails(struct sam3_bank_private *pPrivate) static int -_sam3_probe(struct flash_bank_s *bank, int noise) +_sam3_probe(struct flash_bank *bank, int noise) { unsigned x; int r; @@ -1861,13 +1861,13 @@ _sam3_probe(struct flash_bank_s *bank, int noise) } static int -sam3_probe(struct flash_bank_s *bank) +sam3_probe(struct flash_bank *bank) { return _sam3_probe(bank, 1); } static int -sam3_auto_probe(struct flash_bank_s *bank) +sam3_auto_probe(struct flash_bank *bank) { return _sam3_probe(bank, 0); } @@ -1875,7 +1875,7 @@ sam3_auto_probe(struct flash_bank_s *bank) static int -sam3_erase(struct flash_bank_s *bank, int first, int last) +sam3_erase(struct flash_bank *bank, int first, int last) { struct sam3_bank_private *pPrivate; int r; @@ -1907,7 +1907,7 @@ sam3_erase(struct flash_bank_s *bank, int first, int last) } static int -sam3_protect(struct flash_bank_s *bank, int set, int first, int last) +sam3_protect(struct flash_bank *bank, int set, int first, int last) { struct sam3_bank_private *pPrivate; int r; @@ -1936,7 +1936,7 @@ sam3_protect(struct flash_bank_s *bank, int set, int first, int last) static int -sam3_info(flash_bank_t *bank, char *buf, int buf_size) +sam3_info(struct flash_bank *bank, char *buf, int buf_size) { if (bank->target->state != TARGET_HALTED) { LOG_ERROR("Target not halted"); @@ -2104,7 +2104,7 @@ sam3_page_write(struct sam3_bank_private *pPrivate, unsigned pagenum, uint8_t *b static int -sam3_write(struct flash_bank_s *bank, +sam3_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) diff --git a/src/flash/at91sam7.c b/src/flash/at91sam7.c index 6c98953..8f870bc 100644 --- a/src/flash/at91sam7.c +++ b/src/flash/at91sam7.c @@ -52,13 +52,13 @@ #include "at91sam7.h" #include "binarybuffer.h" -static int at91sam7_protect_check(struct flash_bank_s *bank); -static int at91sam7_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count); +static int at91sam7_protect_check(struct flash_bank *bank); +static int at91sam7_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count); static uint32_t at91sam7_get_flash_status(struct target *target, int bank_number); -static void at91sam7_set_flash_mode(struct flash_bank_s *bank, int mode); -static uint32_t at91sam7_wait_status_busy(struct flash_bank_s *bank, uint32_t waitbits, int timeout); -static int at91sam7_flash_command(struct flash_bank_s *bank, uint8_t cmd, uint16_t pagen); +static void at91sam7_set_flash_mode(struct flash_bank *bank, int mode); +static uint32_t at91sam7_wait_status_busy(struct flash_bank *bank, uint32_t waitbits, int timeout); +static int at91sam7_flash_command(struct flash_bank *bank, uint8_t cmd, uint16_t pagen); static uint32_t MC_FMR[4] = { 0xFFFFFF60, 0xFFFFFF70, 0xFFFFFF80, 0xFFFFFF90 }; static uint32_t MC_FCR[4] = { 0xFFFFFF64, 0xFFFFFF74, 0xFFFFFF84, 0xFFFFFF94 }; @@ -97,7 +97,7 @@ static uint32_t at91sam7_get_flash_status(struct target *target, int bank_number } /* Read clock configuration and set at91sam7_info->mck_freq */ -static void at91sam7_read_clock_info(flash_bank_t *bank) +static void at91sam7_read_clock_info(struct flash_bank *bank) { struct at91sam7_flash_bank *at91sam7_info = bank->driver_priv; struct target *target = bank->target; @@ -176,7 +176,7 @@ static void at91sam7_read_clock_info(flash_bank_t *bank) } /* Setup the timimg registers for nvbits or normal flash */ -static void at91sam7_set_flash_mode(flash_bank_t *bank, int mode) +static void at91sam7_set_flash_mode(struct flash_bank *bank, int mode) { uint32_t fmr, fmcn = 0, fws = 0; struct at91sam7_flash_bank *at91sam7_info = bank->driver_priv; @@ -224,7 +224,7 @@ static void at91sam7_set_flash_mode(flash_bank_t *bank, int mode) at91sam7_info->flashmode = mode; } -static uint32_t at91sam7_wait_status_busy(flash_bank_t *bank, uint32_t waitbits, int timeout) +static uint32_t at91sam7_wait_status_busy(struct flash_bank *bank, uint32_t waitbits, int timeout) { uint32_t status; @@ -251,7 +251,7 @@ static uint32_t at91sam7_wait_status_busy(flash_bank_t *bank, uint32_t waitbits, } /* Send one command to the AT91SAM flash controller */ -static int at91sam7_flash_command(struct flash_bank_s *bank, uint8_t cmd, uint16_t pagen) +static int at91sam7_flash_command(struct flash_bank *bank, uint8_t cmd, uint16_t pagen) { uint32_t fcr; struct at91sam7_flash_bank *at91sam7_info = bank->driver_priv; @@ -280,9 +280,9 @@ static int at91sam7_flash_command(struct flash_bank_s *bank, uint8_t cmd, uint16 } /* Read device id register, main clock frequency register and fill in driver info structure */ -static int at91sam7_read_part_info(struct flash_bank_s *bank) +static int at91sam7_read_part_info(struct flash_bank *bank) { - flash_bank_t *t_bank = bank; + struct flash_bank *t_bank = bank; struct at91sam7_flash_bank *at91sam7_info; struct target *target = t_bank->target; @@ -304,7 +304,7 @@ static int at91sam7_read_part_info(struct flash_bank_s *bank) if (at91sam7_info->cidr != 0) { /* flash already configured, update clock and check for protected sectors */ - flash_bank_t *fb = bank; + struct flash_bank *fb = bank; t_bank = fb; while (t_bank) @@ -336,7 +336,7 @@ static int at91sam7_read_part_info(struct flash_bank_s *bank) if (at91sam7_info->flash_autodetection == 0) { /* banks and sectors are already created, based on data from input file */ - flash_bank_t *fb = bank; + struct flash_bank *fb = bank; t_bank = fb; while (t_bank) { @@ -532,7 +532,7 @@ static int at91sam7_read_part_info(struct flash_bank_s *bank) if (bnk > 0) { /* create a new flash bank element */ - flash_bank_t *fb = malloc(sizeof(flash_bank_t)); + struct flash_bank *fb = malloc(sizeof(struct flash_bank)); fb->target = target; fb->driver = bank->driver; fb->driver_priv = malloc(sizeof(struct at91sam7_flash_bank)); @@ -595,7 +595,7 @@ static int at91sam7_read_part_info(struct flash_bank_s *bank) return ERROR_OK; } -static int at91sam7_erase_check(struct flash_bank_s *bank) +static int at91sam7_erase_check(struct flash_bank *bank) { struct target *target = bank->target; uint16_t retval; @@ -661,7 +661,7 @@ static int at91sam7_erase_check(struct flash_bank_s *bank) return ERROR_OK; } -static int at91sam7_protect_check(struct flash_bank_s *bank) +static int at91sam7_protect_check(struct flash_bank *bank) { uint8_t lock_pos, gpnvm_pos; uint32_t status; @@ -713,7 +713,7 @@ static int at91sam7_protect_check(struct flash_bank_s *bank) FLASH_BANK_COMMAND_HANDLER(at91sam7_flash_bank_command) { - flash_bank_t *t_bank = bank; + struct flash_bank *t_bank = bank; struct at91sam7_flash_bank *at91sam7_info; struct target *target = t_bank->target; @@ -785,7 +785,7 @@ FLASH_BANK_COMMAND_HANDLER(at91sam7_flash_bank_command) if (bnk > 0) { /* create a new bank element */ - flash_bank_t *fb = malloc(sizeof(flash_bank_t)); + struct flash_bank *fb = malloc(sizeof(struct flash_bank)); fb->target = target; fb->driver = bank->driver; fb->driver_priv = malloc(sizeof(struct at91sam7_flash_bank)); @@ -827,7 +827,7 @@ FLASH_BANK_COMMAND_HANDLER(at91sam7_flash_bank_command) return ERROR_OK; } -static int at91sam7_erase(struct flash_bank_s *bank, int first, int last) +static int at91sam7_erase(struct flash_bank *bank, int first, int last) { struct at91sam7_flash_bank *at91sam7_info = bank->driver_priv; int sec; @@ -895,7 +895,7 @@ static int at91sam7_erase(struct flash_bank_s *bank, int first, int last) return ERROR_OK; } -static int at91sam7_protect(struct flash_bank_s *bank, int set, int first, int last) +static int at91sam7_protect(struct flash_bank *bank, int set, int first, int last) { uint32_t cmd; int sector; @@ -945,7 +945,7 @@ static int at91sam7_protect(struct flash_bank_s *bank, int set, int first, int l return ERROR_OK; } -static int at91sam7_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count) +static int at91sam7_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { int retval; struct at91sam7_flash_bank *at91sam7_info = bank->driver_priv; @@ -1014,7 +1014,7 @@ static int at91sam7_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t o return ERROR_OK; } -static int at91sam7_probe(struct flash_bank_s *bank) +static int at91sam7_probe(struct flash_bank *bank) { /* we can't probe on an at91sam7 * if this is an at91sam7, it has the configured flash */ @@ -1033,7 +1033,7 @@ static int at91sam7_probe(struct flash_bank_s *bank) return ERROR_OK; } -static int at91sam7_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int at91sam7_info(struct flash_bank *bank, char *buf, int buf_size) { int printed; struct at91sam7_flash_bank *at91sam7_info = bank->driver_priv; @@ -1100,7 +1100,7 @@ static int at91sam7_info(struct flash_bank_s *bank, char *buf, int buf_size) */ COMMAND_HANDLER(at91sam7_handle_gpnvm_command) { - flash_bank_t *bank; + struct flash_bank *bank; int bit; uint8_t flashcmd; uint32_t status; diff --git a/src/flash/avrf.c b/src/flash/avrf.c index f4a7d72..9df254e 100644 --- a/src/flash/avrf.c +++ b/src/flash/avrf.c @@ -198,19 +198,19 @@ FLASH_BANK_COMMAND_HANDLER(avrf_flash_bank_command) return ERROR_OK; } -static int avrf_erase(struct flash_bank_s *bank, int first, int last) +static int avrf_erase(struct flash_bank *bank, int first, int last) { LOG_INFO("%s", __FUNCTION__); return ERROR_OK; } -static int avrf_protect(struct flash_bank_s *bank, int set, int first, int last) +static int avrf_protect(struct flash_bank *bank, int set, int first, int last) { LOG_INFO("%s", __FUNCTION__); return ERROR_OK; } -static int avrf_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count) +static int avrf_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { struct target *target = bank->target; struct avr_common *avr = target->arch_info; @@ -261,7 +261,7 @@ static int avrf_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offse #define EXTRACT_MFG(X) (((X) & 0xffe) >> 1) #define EXTRACT_PART(X) (((X) & 0xffff000) >> 12) #define EXTRACT_VER(X) (((X) & 0xf0000000) >> 28) -static int avrf_probe(struct flash_bank_s *bank) +static int avrf_probe(struct flash_bank *bank) { struct target *target = bank->target; struct avrf_flash_bank *avrf_info = bank->driver_priv; @@ -329,7 +329,7 @@ static int avrf_probe(struct flash_bank_s *bank) } } -static int avrf_auto_probe(struct flash_bank_s *bank) +static int avrf_auto_probe(struct flash_bank *bank) { struct avrf_flash_bank *avrf_info = bank->driver_priv; if (avrf_info->probed) @@ -337,13 +337,13 @@ static int avrf_auto_probe(struct flash_bank_s *bank) return avrf_probe(bank); } -static int avrf_protect_check(struct flash_bank_s *bank) +static int avrf_protect_check(struct flash_bank *bank) { LOG_INFO("%s", __FUNCTION__); return ERROR_OK; } -static int avrf_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int avrf_info(struct flash_bank *bank, char *buf, int buf_size) { struct target *target = bank->target; struct avr_common *avr = target->arch_info; @@ -394,7 +394,7 @@ static int avrf_info(struct flash_bank_s *bank, char *buf, int buf_size) } } -static int avrf_mass_erase(struct flash_bank_s *bank) +static int avrf_mass_erase(struct flash_bank *bank) { struct target *target = bank->target; struct avr_common *avr = target->arch_info; @@ -425,7 +425,7 @@ COMMAND_HANDLER(avrf_handle_mass_erase_command) return ERROR_OK; } - flash_bank_t *bank; + struct flash_bank *bank; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &bank); if (ERROR_OK != retval) return retval; diff --git a/src/flash/cfi.c b/src/flash/cfi.c index 6ab84f1..dd393de 100644 --- a/src/flash/cfi.c +++ b/src/flash/cfi.c @@ -42,9 +42,9 @@ static struct cfi_unlock_addresses cfi_unlock_addresses[] = }; /* CFI fixups foward declarations */ -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); +static void cfi_fixup_0002_erase_regions(struct flash_bank *flash, void *param); +static void cfi_fixup_0002_unlock_addresses(struct flash_bank *flash, void *param); +static void cfi_fixup_atmel_reversed_erase_regions(struct flash_bank *flash, void *param); /* fixup after reading cmdset 0002 primary query table */ static const struct cfi_fixup cfi_0002_fixups[] = { @@ -67,7 +67,7 @@ static const struct cfi_fixup cfi_0001_fixups[] = { {0, 0, NULL, NULL} }; -static void cfi_fixup(flash_bank_t *bank, const struct cfi_fixup *fixups) +static void cfi_fixup(struct flash_bank *bank, const struct cfi_fixup *fixups) { struct cfi_flash_bank *cfi_info = bank->driver_priv; const struct cfi_fixup *f; @@ -82,8 +82,8 @@ static void cfi_fixup(flash_bank_t *bank, const struct cfi_fixup *fixups) } } -/* inline uint32_t flash_address(flash_bank_t *bank, int sector, uint32_t offset) */ -static __inline__ uint32_t flash_address(flash_bank_t *bank, int sector, uint32_t offset) +/* inline uint32_t flash_address(struct flash_bank *bank, int sector, uint32_t offset) */ +static __inline__ uint32_t flash_address(struct flash_bank *bank, int sector, uint32_t offset) { struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -104,7 +104,7 @@ static __inline__ uint32_t flash_address(flash_bank_t *bank, int sector, uint32_ } -static void cfi_command(flash_bank_t *bank, uint8_t cmd, uint8_t *cmd_buf) +static void cfi_command(struct flash_bank *bank, uint8_t cmd, uint8_t *cmd_buf) { int i; @@ -134,7 +134,7 @@ static void cfi_command(flash_bank_t *bank, uint8_t cmd, uint8_t *cmd_buf) * flash banks are expected to be made of similar chips * the query result should be the same for all */ -static uint8_t cfi_query_u8(flash_bank_t *bank, int sector, uint32_t offset) +static uint8_t cfi_query_u8(struct flash_bank *bank, int sector, uint32_t offset) { struct target *target = bank->target; uint8_t data[CFI_MAX_BUS_WIDTH]; @@ -151,7 +151,7 @@ static uint8_t cfi_query_u8(flash_bank_t *bank, int sector, uint32_t offset) * in case of a bank made of multiple chips, * the individual values are ORed */ -static uint8_t cfi_get_u8(flash_bank_t *bank, int sector, uint32_t offset) +static uint8_t cfi_get_u8(struct flash_bank *bank, int sector, uint32_t offset) { struct target *target = bank->target; uint8_t data[CFI_MAX_BUS_WIDTH]; @@ -176,7 +176,7 @@ static uint8_t cfi_get_u8(flash_bank_t *bank, int sector, uint32_t offset) } } -static uint16_t cfi_query_u16(flash_bank_t *bank, int sector, uint32_t offset) +static uint16_t cfi_query_u16(struct flash_bank *bank, int sector, uint32_t offset) { struct target *target = bank->target; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -198,7 +198,7 @@ static uint16_t cfi_query_u16(flash_bank_t *bank, int sector, uint32_t offset) return data[bank->bus_width - 1] | data[(2 * bank->bus_width) - 1] << 8; } -static uint32_t cfi_query_u32(flash_bank_t *bank, int sector, uint32_t offset) +static uint32_t cfi_query_u32(struct flash_bank *bank, int sector, uint32_t offset) { struct target *target = bank->target; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -221,7 +221,7 @@ static uint32_t cfi_query_u32(flash_bank_t *bank, int sector, uint32_t offset) data[(3 * bank->bus_width) - 1] << 16 | data[(4 * bank->bus_width) - 1] << 24; } -static void cfi_intel_clear_status_register(flash_bank_t *bank) +static void cfi_intel_clear_status_register(struct flash_bank *bank) { struct target *target = bank->target; uint8_t command[8]; @@ -236,7 +236,7 @@ static void cfi_intel_clear_status_register(flash_bank_t *bank) target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command); } -uint8_t cfi_intel_wait_status_busy(flash_bank_t *bank, int timeout) +uint8_t cfi_intel_wait_status_busy(struct flash_bank *bank, int timeout) { uint8_t status; @@ -277,7 +277,7 @@ uint8_t cfi_intel_wait_status_busy(flash_bank_t *bank, int timeout) return status; } -int cfi_spansion_wait_status_busy(flash_bank_t *bank, int timeout) +int cfi_spansion_wait_status_busy(struct flash_bank *bank, int timeout) { uint8_t status, oldstatus; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -312,7 +312,7 @@ int cfi_spansion_wait_status_busy(flash_bank_t *bank, int timeout) return(ERROR_FLASH_BUSY); } -static int cfi_read_intel_pri_ext(flash_bank_t *bank) +static int cfi_read_intel_pri_ext(struct flash_bank *bank) { int retval; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -378,7 +378,7 @@ static int cfi_read_intel_pri_ext(flash_bank_t *bank) return ERROR_OK; } -static int cfi_read_spansion_pri_ext(flash_bank_t *bank) +static int cfi_read_spansion_pri_ext(struct flash_bank *bank) { int retval; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -443,7 +443,7 @@ static int cfi_read_spansion_pri_ext(flash_bank_t *bank) return ERROR_OK; } -static int cfi_read_atmel_pri_ext(flash_bank_t *bank) +static int cfi_read_atmel_pri_ext(struct flash_bank *bank) { int retval; struct cfi_atmel_pri_ext atmel_pri_ext; @@ -510,7 +510,7 @@ static int cfi_read_atmel_pri_ext(flash_bank_t *bank) return ERROR_OK; } -static int cfi_read_0002_pri_ext(flash_bank_t *bank) +static int cfi_read_0002_pri_ext(struct flash_bank *bank) { struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -524,7 +524,7 @@ static int cfi_read_0002_pri_ext(flash_bank_t *bank) } } -static int cfi_spansion_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int cfi_spansion_info(struct flash_bank *bank, char *buf, int buf_size) { int printed; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -559,7 +559,7 @@ static int cfi_spansion_info(struct flash_bank_s *bank, char *buf, int buf_size) return ERROR_OK; } -static int cfi_intel_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int cfi_intel_info(struct flash_bank *bank, char *buf, int buf_size) { int printed; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -652,7 +652,7 @@ FLASH_BANK_COMMAND_HANDLER(cfi_flash_bank_command) return ERROR_OK; } -static int cfi_intel_erase(struct flash_bank_s *bank, int first, int last) +static int cfi_intel_erase(struct flash_bank *bank, int first, int last) { int retval; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -696,7 +696,7 @@ static int cfi_intel_erase(struct flash_bank_s *bank, int first, int last) } -static int cfi_spansion_erase(struct flash_bank_s *bank, int first, int last) +static int cfi_spansion_erase(struct flash_bank *bank, int first, int last) { int retval; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -762,7 +762,7 @@ static int cfi_spansion_erase(struct flash_bank_s *bank, int first, int last) return target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command); } -static int cfi_erase(struct flash_bank_s *bank, int first, int last) +static int cfi_erase(struct flash_bank *bank, int first, int last) { struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -797,7 +797,7 @@ static int cfi_erase(struct flash_bank_s *bank, int first, int last) return ERROR_OK; } -static int cfi_intel_protect(struct flash_bank_s *bank, int set, int first, int last) +static int cfi_intel_protect(struct flash_bank *bank, int set, int first, int last) { int retval; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -914,7 +914,7 @@ static int cfi_intel_protect(struct flash_bank_s *bank, int set, int first, int return target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command); } -static int cfi_protect(struct flash_bank_s *bank, int set, int first, int last) +static int cfi_protect(struct flash_bank *bank, int set, int first, int last) { struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -947,7 +947,7 @@ static int cfi_protect(struct flash_bank_s *bank, int set, int first, int last) } /* FIXME Replace this by a simple memcpy() - still unsure about sideeffects */ -static void cfi_add_byte(struct flash_bank_s *bank, uint8_t *word, uint8_t byte) +static void cfi_add_byte(struct flash_bank *bank, uint8_t *word, uint8_t byte) { /* struct target *target = bank->target; */ @@ -993,7 +993,7 @@ static void cfi_fix_code_endian(struct target *target, uint8_t *dest, const uint } } -static uint32_t cfi_command_val(flash_bank_t *bank, uint8_t cmd) +static uint32_t cfi_command_val(struct flash_bank *bank, uint8_t cmd) { struct target *target = bank->target; @@ -1016,7 +1016,7 @@ static uint32_t cfi_command_val(flash_bank_t *bank, uint8_t cmd) } } -static int cfi_intel_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint32_t address, uint32_t count) +static int cfi_intel_write_block(struct flash_bank *bank, uint8_t *buffer, uint32_t address, uint32_t count) { struct cfi_flash_bank *cfi_info = bank->driver_priv; struct target *target = bank->target; @@ -1260,7 +1260,7 @@ cleanup: return retval; } -static int cfi_spansion_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint32_t address, uint32_t count) +static int cfi_spansion_write_block(struct flash_bank *bank, uint8_t *buffer, uint32_t address, uint32_t count) { struct cfi_flash_bank *cfi_info = bank->driver_priv; struct cfi_spansion_pri_ext *pri_ext = cfi_info->pri_ext; @@ -1559,7 +1559,7 @@ static int cfi_spansion_write_block(struct flash_bank_s *bank, uint8_t *buffer, return exit_code; } -static int cfi_intel_write_word(struct flash_bank_s *bank, uint8_t *word, uint32_t address) +static int cfi_intel_write_word(struct flash_bank *bank, uint8_t *word, uint32_t address) { int retval; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -1593,7 +1593,7 @@ static int cfi_intel_write_word(struct flash_bank_s *bank, uint8_t *word, uint32 return ERROR_OK; } -static int cfi_intel_write_words(struct flash_bank_s *bank, uint8_t *word, uint32_t wordcount, uint32_t address) +static int cfi_intel_write_words(struct flash_bank *bank, uint8_t *word, uint32_t wordcount, uint32_t address) { int retval; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -1686,7 +1686,7 @@ static int cfi_intel_write_words(struct flash_bank_s *bank, uint8_t *word, uint3 return ERROR_OK; } -static int cfi_spansion_write_word(struct flash_bank_s *bank, uint8_t *word, uint32_t address) +static int cfi_spansion_write_word(struct flash_bank *bank, uint8_t *word, uint32_t address) { int retval; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -1732,7 +1732,7 @@ static int cfi_spansion_write_word(struct flash_bank_s *bank, uint8_t *word, uin return ERROR_OK; } -static int cfi_spansion_write_words(struct flash_bank_s *bank, uint8_t *word, uint32_t wordcount, uint32_t address) +static int cfi_spansion_write_words(struct flash_bank *bank, uint8_t *word, uint32_t wordcount, uint32_t address) { int retval; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -1824,7 +1824,7 @@ static int cfi_spansion_write_words(struct flash_bank_s *bank, uint8_t *word, ui return ERROR_OK; } -static int cfi_write_word(struct flash_bank_s *bank, uint8_t *word, uint32_t address) +static int cfi_write_word(struct flash_bank *bank, uint8_t *word, uint32_t address) { struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -1845,7 +1845,7 @@ static int cfi_write_word(struct flash_bank_s *bank, uint8_t *word, uint32_t add return ERROR_FLASH_OPERATION_FAILED; } -static int cfi_write_words(struct flash_bank_s *bank, uint8_t *word, uint32_t wordcount, uint32_t address) +static int cfi_write_words(struct flash_bank *bank, uint8_t *word, uint32_t wordcount, uint32_t address) { struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -1866,7 +1866,7 @@ static int cfi_write_words(struct flash_bank_s *bank, uint8_t *word, uint32_t wo return ERROR_FLASH_OPERATION_FAILED; } -int cfi_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count) +int cfi_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { struct cfi_flash_bank *cfi_info = bank->driver_priv; struct target *target = bank->target; @@ -2075,7 +2075,7 @@ int cfi_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint3 return target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, current_word); } -static void cfi_fixup_atmel_reversed_erase_regions(flash_bank_t *bank, void *param) +static void cfi_fixup_atmel_reversed_erase_regions(struct flash_bank *bank, void *param) { (void) param; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -2084,7 +2084,7 @@ static void cfi_fixup_atmel_reversed_erase_regions(flash_bank_t *bank, void *par pri_ext->_reversed_geometry = 1; } -static void cfi_fixup_0002_erase_regions(flash_bank_t *bank, void *param) +static void cfi_fixup_0002_erase_regions(struct flash_bank *bank, void *param) { int i; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -2107,7 +2107,7 @@ static void cfi_fixup_0002_erase_regions(flash_bank_t *bank, void *param) } } -static void cfi_fixup_0002_unlock_addresses(flash_bank_t *bank, void *param) +static void cfi_fixup_0002_unlock_addresses(struct flash_bank *bank, void *param) { struct cfi_flash_bank *cfi_info = bank->driver_priv; struct cfi_spansion_pri_ext *pri_ext = cfi_info->pri_ext; @@ -2118,7 +2118,7 @@ static void cfi_fixup_0002_unlock_addresses(flash_bank_t *bank, void *param) } -static int cfi_query_string(struct flash_bank_s *bank, int address) +static int cfi_query_string(struct flash_bank *bank, int address) { struct cfi_flash_bank *cfi_info = bank->driver_priv; struct target *target = bank->target; @@ -2156,7 +2156,7 @@ static int cfi_query_string(struct flash_bank_s *bank, int address) return ERROR_OK; } -static int cfi_probe(struct flash_bank_s *bank) +static int cfi_probe(struct flash_bank *bank) { struct cfi_flash_bank *cfi_info = bank->driver_priv; struct target *target = bank->target; @@ -2435,7 +2435,7 @@ static int cfi_probe(struct flash_bank_s *bank) return ERROR_OK; } -static int cfi_auto_probe(struct flash_bank_s *bank) +static int cfi_auto_probe(struct flash_bank *bank) { struct cfi_flash_bank *cfi_info = bank->driver_priv; if (cfi_info->probed) @@ -2444,7 +2444,7 @@ static int cfi_auto_probe(struct flash_bank_s *bank) } -static int cfi_intel_protect_check(struct flash_bank_s *bank) +static int cfi_intel_protect_check(struct flash_bank *bank) { int retval; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -2477,7 +2477,7 @@ static int cfi_intel_protect_check(struct flash_bank_s *bank) return target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command); } -static int cfi_spansion_protect_check(struct flash_bank_s *bank) +static int cfi_spansion_protect_check(struct flash_bank *bank) { int retval; struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -2518,7 +2518,7 @@ static int cfi_spansion_protect_check(struct flash_bank_s *bank) return target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command); } -static int cfi_protect_check(struct flash_bank_s *bank) +static int cfi_protect_check(struct flash_bank *bank) { struct cfi_flash_bank *cfi_info = bank->driver_priv; @@ -2548,7 +2548,7 @@ static int cfi_protect_check(struct flash_bank_s *bank) return ERROR_OK; } -static int cfi_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int cfi_info(struct flash_bank *bank, char *buf, int buf_size) { int printed; struct cfi_flash_bank *cfi_info = bank->driver_priv; diff --git a/src/flash/cfi.h b/src/flash/cfi.h index deca916..d55fd34 100644 --- a/src/flash/cfi.h +++ b/src/flash/cfi.h @@ -146,7 +146,7 @@ struct cfi_fixup { uint16_t mfr; uint16_t id; - void (*fixup)(flash_bank_t *flash, void *param); + void (*fixup)(struct flash_bank *flash, void *param); void *param; }; diff --git a/src/flash/ecos.c b/src/flash/ecos.c index ad27a45..da35407 100644 --- a/src/flash/ecos.c +++ b/src/flash/ecos.c @@ -27,9 +27,9 @@ #if 0 -static uint32_t ecosflash_get_flash_status(flash_bank_t *bank); -static void ecosflash_set_flash_mode(flash_bank_t *bank,int mode); -static uint32_t ecosflash_wait_status_busy(flash_bank_t *bank, uint32_t waitbits, int timeout); +static uint32_t ecosflash_get_flash_status(struct flash_bank *bank); +static void ecosflash_set_flash_mode(struct flash_bank *bank,int mode); +static uint32_t ecosflash_wait_status_busy(struct flash_bank *bank, uint32_t waitbits, int timeout); static int ecosflash_handle_gpnvm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); #endif @@ -329,7 +329,7 @@ static int eCosBoard_flash(struct ecosflash_flash_bank *info, void *data, uint32 return ERROR_OK; } -static int ecosflash_probe(struct flash_bank_s *bank) +static int ecosflash_probe(struct flash_bank *bank) { return ERROR_OK; } @@ -342,7 +342,7 @@ static int ecosflash_register_commands(struct command_context_s *cmd_ctx) } #if 0 -static void command(flash_bank_t *bank, uint8_t cmd, uint8_t *cmd_buf) +static void command(struct flash_bank *bank, uint8_t cmd, uint8_t *cmd_buf) { struct ecosflash_flash_bank *info = bank->driver_priv; int i; @@ -365,7 +365,7 @@ static void command(flash_bank_t *bank, uint8_t cmd, uint8_t *cmd_buf) #endif #if 0 -static uint32_t ecosflash_address(struct flash_bank_s *bank, uint32_t address) +static uint32_t ecosflash_address(struct flash_bank *bank, uint32_t address) { uint32_t retval = 0; switch (bank->bus_width) @@ -382,31 +382,31 @@ static uint32_t ecosflash_address(struct flash_bank_s *bank, uint32_t address) } #endif -static int ecosflash_erase(struct flash_bank_s *bank, int first, int last) +static int ecosflash_erase(struct flash_bank *bank, int first, int last) { - struct flash_bank_s *c = bank; + struct flash_bank *c = bank; struct ecosflash_flash_bank *info = bank->driver_priv; return eCosBoard_erase(info, c->base + first*sectorSize, sectorSize*(last-first + 1)); } -static int ecosflash_protect(struct flash_bank_s *bank, int set, int first, int last) +static int ecosflash_protect(struct flash_bank *bank, int set, int first, int last) { return ERROR_OK; } -static int ecosflash_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count) +static int ecosflash_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { struct ecosflash_flash_bank *info = bank->driver_priv; - struct flash_bank_s *c = bank; + struct flash_bank *c = bank; return eCosBoard_flash(info, buffer, c->base + offset, count); } -static int ecosflash_protect_check(struct flash_bank_s *bank) +static int ecosflash_protect_check(struct flash_bank *bank) { return ERROR_OK; } -static int ecosflash_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int ecosflash_info(struct flash_bank *bank, char *buf, int buf_size) { struct ecosflash_flash_bank *info = bank->driver_priv; snprintf(buf, buf_size, "eCos flash driver: %s", info->driverPath); @@ -414,17 +414,17 @@ static int ecosflash_info(struct flash_bank_s *bank, char *buf, int buf_size) } #if 0 -static uint32_t ecosflash_get_flash_status(flash_bank_t *bank) +static uint32_t ecosflash_get_flash_status(struct flash_bank *bank) { return ERROR_OK; } -static void ecosflash_set_flash_mode(flash_bank_t *bank,int mode) +static void ecosflash_set_flash_mode(struct flash_bank *bank,int mode) { } -static uint32_t ecosflash_wait_status_busy(flash_bank_t *bank, uint32_t waitbits, int timeout) +static uint32_t ecosflash_wait_status_busy(struct flash_bank *bank, uint32_t waitbits, int timeout) { return ERROR_OK; } diff --git a/src/flash/faux.c b/src/flash/faux.c index 0a52f5f..55e9892 100644 --- a/src/flash/faux.c +++ b/src/flash/faux.c @@ -92,38 +92,38 @@ static int faux_register_commands(struct command_context_s *cmd_ctx) return ERROR_OK; } -static int faux_erase(struct flash_bank_s *bank, int first, int last) +static int faux_erase(struct flash_bank *bank, int first, int last) { struct faux_flash_bank *info = bank->driver_priv; memset(info->memory + first*sectorSize, 0xff, sectorSize*(last-first + 1)); return ERROR_OK; } -static int faux_protect(struct flash_bank_s *bank, int set, int first, int last) +static int faux_protect(struct flash_bank *bank, int set, int first, int last) { LOG_USER("set protection sector %d to %d to %s", first, last, set?"on":"off"); return ERROR_OK; } -static int faux_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count) +static int faux_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { struct faux_flash_bank *info = bank->driver_priv; memcpy(info->memory + offset, buffer, count); return ERROR_OK; } -static int faux_protect_check(struct flash_bank_s *bank) +static int faux_protect_check(struct flash_bank *bank) { return ERROR_OK; } -static int faux_info(struct flash_bank_s *bank, char *buf, int buf_size) +static int faux_info(struct flash_bank *bank, char *buf, int buf_size) { snprintf(buf, buf_size, "faux flash driver"); return ERROR_OK; } -static int faux_probe(struct flash_bank_s *bank) +static int faux_probe(struct flash_bank *bank) { return ERROR_OK; } diff --git a/src/flash/flash.c b/src/flash/flash.c index 5374532..96c63d5 100644 --- a/src/flash/flash.c +++ b/src/flash/flash.c @@ -76,11 +76,11 @@ struct flash_driver *flash_drivers[] = { NULL, }; -flash_bank_t *flash_banks; +struct flash_bank *flash_banks; static command_t *flash_cmd; /* wafer thin wrapper for invoking the flash driver */ -static int flash_driver_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count) +static int flash_driver_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) { int retval; @@ -94,7 +94,7 @@ static int flash_driver_write(struct flash_bank_s *bank, uint8_t *buffer, uint32 return retval; } -static int flash_driver_erase(struct flash_bank_s *bank, int first, int last) +static int flash_driver_erase(struct flash_bank *bank, int first, int last) { int retval; @@ -107,7 +107,7 @@ static int flash_driver_erase(struct flash_bank_s *bank, int first, int last) return retval; } -int flash_driver_protect(struct flash_bank_s *bank, int set, int first, int last) +int flash_driver_protect(struct flash_bank *bank, int set, int first, int last) { int retval; @@ -122,7 +122,7 @@ int flash_driver_protect(struct flash_bank_s *bank, int set, int first, int last static int jim_flash_banks(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { - flash_bank_t *p; + struct flash_bank *p; if (argc != 1) { Jim_WrongNumArgs(interp, 1, argv, "no arguments to flash_banks command"); @@ -153,9 +153,9 @@ static int jim_flash_banks(Jim_Interp *interp, int argc, Jim_Obj *const *argv) return JIM_OK; } -flash_bank_t *get_flash_bank_by_num_noprobe(int num) +struct flash_bank *get_flash_bank_by_num_noprobe(int num) { - flash_bank_t *p; + struct flash_bank *p; int i = 0; for (p = flash_banks; p; p = p->next) @@ -171,7 +171,7 @@ flash_bank_t *get_flash_bank_by_num_noprobe(int num) int flash_get_bank_count(void) { - flash_bank_t *p; + struct flash_bank *p; int i = 0; for (p = flash_banks; p; p = p->next) { @@ -180,9 +180,9 @@ int flash_get_bank_count(void) return i; } -flash_bank_t *get_flash_bank_by_num(int num) +struct flash_bank *get_flash_bank_by_num(int num) { - flash_bank_t *p = get_flash_bank_by_num_noprobe(num); + struct flash_bank *p = get_flash_bank_by_num_noprobe(num); int retval; if (p == NULL) @@ -199,7 +199,7 @@ flash_bank_t *get_flash_bank_by_num(int num) } int flash_command_get_bank_by_num( - struct command_context_s *cmd_ctx, const char *str, flash_bank_t **bank) + struct command_context_s *cmd_ctx, const char *str, struct flash_bank **bank) { unsigned bank_num; COMMAND_PARSE_NUMBER(uint, str, bank_num); @@ -238,7 +238,7 @@ COMMAND_HANDLER(handle_flash_bank_command) if (strcmp(args[0], flash_drivers[i]->name) != 0) continue; - flash_bank_t *p, *c; + struct flash_bank *p, *c; /* register flash specific commands */ if (flash_drivers[i]->register_commands(cmd_ctx) != ERROR_OK) @@ -247,7 +247,7 @@ COMMAND_HANDLER(handle_flash_bank_command) return ERROR_FAIL; } - c = malloc(sizeof(flash_bank_t)); + c = malloc(sizeof(struct flash_bank)); c->target = target; c->driver = flash_drivers[i]; c->driver_priv = NULL; @@ -298,7 +298,7 @@ COMMAND_HANDLER(handle_flash_bank_command) COMMAND_HANDLER(handle_flash_info_command) { - flash_bank_t *p; + struct flash_bank *p; uint32_t i = 0; int j = 0; int retval; @@ -369,7 +369,7 @@ COMMAND_HANDLER(handle_flash_probe_command) unsigned bank_nr; COMMAND_PARSE_NUMBER(uint, args[0], bank_nr); - flash_bank_t *p = get_flash_bank_by_num_noprobe(bank_nr); + struct flash_bank *p = get_flash_bank_by_num_noprobe(bank_nr); if (p) { if ((retval = p->driver->probe(p)) == ERROR_OK) @@ -402,7 +402,7 @@ COMMAND_HANDLER(handle_flash_erase_check_command) return ERROR_COMMAND_SYNTAX_ERROR; } - flash_bank_t *p; + struct flash_bank *p; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &p); if (ERROR_OK != retval) return retval; @@ -443,7 +443,7 @@ COMMAND_HANDLER(handle_flash_erase_check_command) COMMAND_HANDLER(handle_flash_erase_address_command) { - flash_bank_t *p; + struct flash_bank *p; int retval; int address; int length; @@ -490,7 +490,7 @@ COMMAND_HANDLER(handle_flash_protect_check_command) if (argc != 1) return ERROR_COMMAND_SYNTAX_ERROR; - flash_bank_t *p; + struct flash_bank *p; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &p); if (ERROR_OK != retval) return retval; @@ -539,7 +539,7 @@ COMMAND_HANDLER(handle_flash_erase_command) uint32_t last; COMMAND_PARSE_NUMBER(u32, args[0], bank_nr); - flash_bank_t *p = get_flash_bank_by_num(bank_nr); + struct flash_bank *p = get_flash_bank_by_num(bank_nr); if (!p) return ERROR_OK; @@ -580,7 +580,7 @@ COMMAND_HANDLER(handle_flash_protect_command) int set; COMMAND_PARSE_NUMBER(u32, args[0], bank_nr); - flash_bank_t *p = get_flash_bank_by_num(bank_nr); + struct flash_bank *p = get_flash_bank_by_num(bank_nr); if (!p) return ERROR_OK; @@ -772,7 +772,7 @@ COMMAND_HANDLER(handle_flash_fill_command) for (wrote = 0; wrote < (count*wordsize); wrote += cur_size) { cur_size = MIN((count*wordsize - wrote), sizeof(chunk)); - flash_bank_t *bank; + struct flash_bank *bank; bank = get_flash_bank_by_addr(target, address); if (bank == NULL) { @@ -820,7 +820,7 @@ COMMAND_HANDLER(handle_flash_write_bank_command) struct duration bench; duration_start(&bench); - flash_bank_t *p; + struct flash_bank *p; int retval = flash_command_get_bank_by_num(cmd_ctx, args[0], &p); if (ERROR_OK != retval) return retval; @@ -860,7 +860,7 @@ COMMAND_HANDLER(handle_flash_write_bank_command) void flash_set_dirty(void) { - flash_bank_t *c; + struct flash_bank *c; int i; /* set all flash to require erasing */ @@ -874,9 +874,9 @@ void flash_set_dirty(void) } /* lookup flash bank by address */ -struct flash_bank_s *get_flash_bank_by_addr(struct target *target, uint32_t addr) +struct flash_bank *get_flash_bank_by_addr(struct target *target, uint32_t addr) { - flash_bank_t *c; + struct flash_bank *c; /* cycle through bank list */ for (c = flash_banks; c; c = c->next) @@ -899,9 +899,9 @@ struct flash_bank_s *get_flash_bank_by_addr(struct target *target, uint32_t addr /* erase given flash region, selects proper bank according to target and address */ static int flash_iterate_address_range(struct target *target, uint32_t addr, uint32_t length, - int (*callback)(struct flash_bank_s *bank, int first, int last)) + int (*callback)(struct flash_bank *bank, int first, int last)) { - flash_bank_t *c; + struct flash_bank *c; int first = -1; int last = -1; int i; @@ -954,7 +954,7 @@ int flash_erase_address_range(struct target *target, uint32_t addr, uint32_t len return flash_iterate_address_range(target, addr, length, &flash_driver_erase); } -static int flash_drive... [truncated message content] |