OLD | NEW |
---|---|
1 /* | 1 /* |
2 * This file is part of the flashrom project. | 2 * This file is part of the flashrom project. |
3 * | 3 * |
4 * Copyright (C) 2009 Carl-Daniel Hailfinger | 4 * Copyright (C) 2009 Carl-Daniel Hailfinger |
5 * | 5 * |
6 * This program is free software; you can redistribute it and/or modify | 6 * This program is free software; you can redistribute it and/or modify |
7 * it under the terms of the GNU General Public License as published by | 7 * it under the terms of the GNU General Public License as published by |
8 * the Free Software Foundation; either version 2 of the License, or | 8 * the Free Software Foundation; either version 2 of the License, or |
9 * (at your option) any later version. | 9 * (at your option) any later version. |
10 * | 10 * |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
231 free(arg); | 231 free(arg); |
232 return 1; | 232 return 1; |
233 } | 233 } |
234 | 234 |
235 free(arg); | 235 free(arg); |
236 } else { | 236 } else { |
237 /* The pacc must be initialized before access pci devices. */ | 237 /* The pacc must be initialized before access pci devices. */ |
238 probe_target_bus_later = 1; | 238 probe_target_bus_later = 1; |
239 } | 239 } |
240 | 240 |
241 register_shutdown(internal_shutdown, NULL); | |
Louis
2011/04/26 10:06:06
remove this if we restore the shutdown function in
dhendrix
2011/04/27 02:08:06
The idea is to no longer rely on programmer_table[
| |
241 get_io_perms(); | 242 get_io_perms(); |
242 | 243 |
243 #if defined(__i386__) || defined(__x86_64__) | 244 #if defined(__i386__) || defined(__x86_64__) |
244 /* Initialize PCI access for flash enables */ | 245 /* Initialize PCI access for flash enables */ |
245 pacc = pci_alloc(); /* Get the pci_access structure */ | 246 pacc = pci_alloc(); /* Get the pci_access structure */ |
246 pacc->error = pci_error; | 247 pacc->error = pci_error; |
247 pacc->warning = pci_warning; | 248 pacc->warning = pci_warning; |
248 pacc->debug = pci_debug; | 249 pacc->debug = pci_debug; |
249 | 250 |
250 /* Set all options you want -- here we stick with the defaults */ | 251 /* Set all options you want -- here we stick with the defaults */ |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
364 */ | 365 */ |
365 msg_perr("Your platform is not supported yet for the internal " | 366 msg_perr("Your platform is not supported yet for the internal " |
366 "programmer because it has\n" | 367 "programmer because it has\n" |
367 "not been converted from native endian to little endian " | 368 "not been converted from native endian to little endian " |
368 "access yet.\n" | 369 "access yet.\n" |
369 "Aborting.\n"); | 370 "Aborting.\n"); |
370 return 1; | 371 return 1; |
371 #endif | 372 #endif |
372 } | 373 } |
373 | 374 |
374 int internal_shutdown(void) | 375 void internal_shutdown(void *data) |
375 { | 376 { |
376 release_io_perms(); | 377 release_io_perms(); |
377 | |
378 #if defined(__i386__) || defined(__x86_64__) | |
379 if (target_bus == CHIP_BUSTYPE_LPC || | |
380 target_bus == CHIP_BUSTYPE_FWH) { | |
381 it85xx_shutdown(); | |
382 wpce775x_shutdown(); | |
383 mec1308_shutdown(); | |
384 } | |
385 #endif | |
386 | |
387 return 0; | |
388 } | 378 } |
389 #endif | 379 #endif |
390 | 380 |
391 void internal_chip_writeb(uint8_t val, chipaddr addr) | 381 void internal_chip_writeb(uint8_t val, chipaddr addr) |
392 { | 382 { |
393 mmio_writeb(val, (void *) addr); | 383 mmio_writeb(val, (void *) addr); |
394 } | 384 } |
395 | 385 |
396 void internal_chip_writew(uint16_t val, chipaddr addr) | 386 void internal_chip_writew(uint16_t val, chipaddr addr) |
397 { | 387 { |
(...skipping 18 matching lines...) Expand all Loading... | |
416 uint32_t internal_chip_readl(const chipaddr addr) | 406 uint32_t internal_chip_readl(const chipaddr addr) |
417 { | 407 { |
418 return mmio_readl((void *) addr); | 408 return mmio_readl((void *) addr); |
419 } | 409 } |
420 | 410 |
421 void internal_chip_readn(uint8_t *buf, const chipaddr addr, size_t len) | 411 void internal_chip_readn(uint8_t *buf, const chipaddr addr, size_t len) |
422 { | 412 { |
423 memcpy(buf, (void *)addr, len); | 413 memcpy(buf, (void *)addr, len); |
424 return; | 414 return; |
425 } | 415 } |
OLD | NEW |