FreeCalypso > hg > freecalypso-tools
comparison loadtools/flashid.c @ 523:9a478d33b3ca
fc-loadtool: added Samsung K5L33xx_A flash support for GTM900
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 09 Jun 2019 21:51:27 +0000 |
parents | 0212edcec4d2 |
children | 3886a8a40809 |
comparison
equal
deleted
inserted
replaced
522:26bb2c069427 | 523:9a478d33b3ca |
---|---|
15 extern struct flash_device flashdev_28F640W30T; | 15 extern struct flash_device flashdev_28F640W30T; |
16 extern struct flash_device flashdev_28F640W30B; | 16 extern struct flash_device flashdev_28F640W30B; |
17 extern struct flash_device flashdev_PL129J; | 17 extern struct flash_device flashdev_PL129J; |
18 extern struct flash_device flashdev_PL129N; | 18 extern struct flash_device flashdev_PL129N; |
19 extern struct flash_device flashdev_K5A32xx_T; | 19 extern struct flash_device flashdev_K5A32xx_T; |
20 extern struct flash_device flashdev_K5L33xx_A; | |
20 | 21 |
21 extern int flash_global_config; | 22 extern int flash_global_config; |
22 extern struct flash_bank_info flash_bank_info[2]; | 23 extern struct flash_bank_info flash_bank_info[2]; |
23 | 24 |
24 static | 25 static |
108 if (do_r16(bi->base_addr + 0x1E, &ext2) < 0) | 109 if (do_r16(bi->base_addr + 0x1E, &ext2) < 0) |
109 return(-1); | 110 return(-1); |
110 printf("Extended ID: %04X %04X\n", ext1, ext2); | 111 printf("Extended ID: %04X %04X\n", ext1, ext2); |
111 if (ext1 == 0x2221 && ext2 == 0x2200) | 112 if (ext1 == 0x2221 && ext2 == 0x2200) |
112 return spansion_pl129j_or_n(bi); | 113 return spansion_pl129j_or_n(bi); |
114 fprintf(stderr, "Error: unknown device ID\n"); | |
115 return(-1); | |
116 } | |
117 | |
118 static | |
119 samsung_extended_id(bi) | |
120 struct flash_bank_info *bi; | |
121 { | |
122 uint16_t ext1, ext2; | |
123 | |
124 printf("Samsung extended ID device, reading extended ID\n"); | |
125 if (do_r16(bi->base_addr + 0x1C, &ext1) < 0) | |
126 return(-1); | |
127 if (do_r16(bi->base_addr + 0x1E, &ext2) < 0) | |
128 return(-1); | |
129 printf("Extended ID: %04X %04X\n", ext1, ext2); | |
130 if (ext1 == 0x2503 && ext2 == 0x2501) | |
131 return try_device(bi, &flashdev_K5L33xx_A); | |
113 fprintf(stderr, "Error: unknown device ID\n"); | 132 fprintf(stderr, "Error: unknown device ID\n"); |
114 return(-1); | 133 return(-1); |
115 } | 134 } |
116 | 135 |
117 static struct idmap { | 136 static struct idmap { |
133 {0x0089, 0x88C4, try_device, &flashdev_28F320C3T}, | 152 {0x0089, 0x88C4, try_device, &flashdev_28F320C3T}, |
134 {0x0089, 0x88CC, try_device, &flashdev_28F640C3T}, | 153 {0x0089, 0x88CC, try_device, &flashdev_28F640C3T}, |
135 {0x0089, 0x88CD, try_device, &flashdev_28F640C3B}, | 154 {0x0089, 0x88CD, try_device, &flashdev_28F640C3B}, |
136 /* Samsung flash */ | 155 /* Samsung flash */ |
137 {0x00EC, 0x22A0, try_device, &flashdev_K5A32xx_T}, | 156 {0x00EC, 0x22A0, try_device, &flashdev_K5A32xx_T}, |
157 {0x00EC, 0x257E, samsung_extended_id, 0}, | |
138 /* table search terminator */ | 158 /* table search terminator */ |
139 {0, 0, 0, 0} | 159 {0, 0, 0, 0} |
140 }; | 160 }; |
141 | 161 |
142 flash_detect(bank, repeat) | 162 flash_detect(bank, repeat) |