From cc2de4cf2672e81cc18e79c46b82d9850637181b Mon Sep 17 00:00:00 2001 From: Sergey Gridassov Date: Sat, 4 Dec 2010 10:56:51 +0300 Subject: [PATCH] Implemented ingenic_sdram_size --- fw.bin | Bin ingenic.c | 12 +++++++----- ingenic.h | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) mode change 100755 => 100644 fw.bin diff --git a/fw.bin b/fw.bin old mode 100755 new mode 100644 diff --git a/ingenic.c b/ingenic.c index 2b96e75..8c6db8d 100644 --- a/ingenic.c +++ b/ingenic.c @@ -97,12 +97,8 @@ static void hexdump(const void *data, size_t size) { static uint32_t ingenic_probe(void *usb_hndl) { char magic[9]; - if(usbdev_vendor(usb_hndl, USBDEV_FROMDEV, VR_GET_CPU_INFO, 0, 0, magic, 8) == -1) { - if(errno == EFAULT) { - debug(LEVEL_DEBUG, "Stage detected\n"); - } else + if(usbdev_vendor(usb_hndl, USBDEV_FROMDEV, VR_GET_CPU_INFO, 0, 0, magic, 8) == -1) return 0; - } magic[8] = 0; @@ -212,6 +208,12 @@ int ingenic_rebuild(void *hndl) { return 0; } +uint32_t ingenic_sdram_size(void *hndl) { + HANDLE; + + return handle->total_sdram_size; +} + static int ingenic_address(void *usb, uint32_t base) { debug(LEVEL_DEBUG, "Ingenic: address 0x%08X\n", base); diff --git a/ingenic.h b/ingenic.h index 44e12ff..0588501 100644 --- a/ingenic.h +++ b/ingenic.h @@ -28,6 +28,7 @@ void ingenic_set_callbacks(void *hndl, const ingenic_callbacks_t *callbacks, voi int ingenic_redetect(void *hndl); int ingenic_cmdset(void *hndl); int ingenic_type(void *hndl); +uint32_t ingenic_sdram_size(void *hndl); int ingenic_rebuild(void *hndl); int ingenic_loadstage(void *hndl, int id, const char *filename);