From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LVAji-00039I-Bl for qemu-devel@nongnu.org; Thu, 05 Feb 2009 15:22:10 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LVAjh-00038B-IB for qemu-devel@nongnu.org; Thu, 05 Feb 2009 15:22:09 -0500 Received: from [199.232.76.173] (port=41839 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LVAjh-00037m-Au for qemu-devel@nongnu.org; Thu, 05 Feb 2009 15:22:09 -0500 Received: from savannah.gnu.org ([199.232.41.3]:54071 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LVAjh-0005Qk-1p for qemu-devel@nongnu.org; Thu, 05 Feb 2009 15:22:09 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LVAjg-0002h9-1f for qemu-devel@nongnu.org; Thu, 05 Feb 2009 20:22:08 +0000 Received: from blueswir1 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LVAjf-0002h3-NB for qemu-devel@nongnu.org; Thu, 05 Feb 2009 20:22:07 +0000 MIME-Version: 1.0 Errors-To: blueswir1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Blue Swirl Message-Id: Date: Thu, 05 Feb 2009 20:22:07 +0000 Subject: [Qemu-devel] [6521] Add debug, savevm and reset support for UniNorth Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6521 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6521 Author: blueswir1 Date: 2009-02-05 20:22:07 +0000 (Thu, 05 Feb 2009) Log Message: ----------- Add debug, savevm and reset support for UniNorth Modified Paths: -------------- trunk/hw/ppc_chrp.c trunk/hw/unin_pci.c Modified: trunk/hw/ppc_chrp.c =================================================================== --- trunk/hw/ppc_chrp.c 2009-02-05 20:20:29 UTC (rev 6520) +++ trunk/hw/ppc_chrp.c 2009-02-05 20:22:07 UTC (rev 6521) @@ -37,14 +37,30 @@ #define MAX_IDE_BUS 2 #define VGA_BIOS_SIZE 65536 +/* debug UniNorth */ +//#define DEBUG_UNIN + +#ifdef DEBUG_UNIN +#define UNIN_DPRINTF(fmt, args...) \ +do { printf("UNIN: " fmt , ##args); } while (0) +#else +#define UNIN_DPRINTF(fmt, args...) +#endif + /* UniN device */ static void unin_writel (void *opaque, target_phys_addr_t addr, uint32_t value) { + UNIN_DPRINTF("writel addr " TARGET_FMT_plx " val %x\n", addr, value); } static uint32_t unin_readl (void *opaque, target_phys_addr_t addr) { - return 0; + uint32_t value; + + value = 0; + UNIN_DPRINTF("readl addr " TARGET_FMT_plx " val %x\n", addr, value); + + return value; } static CPUWriteMemoryFunc *unin_write[] = { Modified: trunk/hw/unin_pci.c =================================================================== --- trunk/hw/unin_pci.c 2009-02-05 20:20:29 UTC (rev 6520) +++ trunk/hw/unin_pci.c 2009-02-05 20:22:07 UTC (rev 6521) @@ -25,6 +25,16 @@ #include "ppc_mac.h" #include "pci.h" +/* debug UniNorth */ +//#define DEBUG_UNIN + +#ifdef DEBUG_UNIN +#define UNIN_DPRINTF(fmt, args...) \ +do { printf("UNIN: " fmt , ##args); } while (0) +#else +#define UNIN_DPRINTF(fmt, args...) +#endif + typedef target_phys_addr_t pci_addr_t; #include "pci_host.h" @@ -36,6 +46,7 @@ UNINState *s = opaque; int i; + UNIN_DPRINTF("config_writel addr " TARGET_FMT_plx " val %x\n", addr, val); #ifdef TARGET_WORDS_BIGENDIAN val = bswap32(val); #endif @@ -63,6 +74,7 @@ #ifdef TARGET_WORDS_BIGENDIAN val = bswap32(val); #endif + UNIN_DPRINTF("config_readl addr " TARGET_FMT_plx " val %x\n", addr, val); return val; } @@ -154,6 +166,27 @@ qemu_set_irq(pic[irq_num + 8], level); } +static void pci_unin_save(QEMUFile* f, void *opaque) +{ + PCIDevice *d = opaque; + + pci_device_save(d, f); +} + +static int pci_unin_load(QEMUFile* f, void *opaque, int version_id) +{ + PCIDevice *d = opaque; + + if (version_id != 1) + return -EINVAL; + + return pci_device_load(d, f); +} + +static void pci_unin_reset(void *opaque) +{ +} + PCIBus *pci_pmac_init(qemu_irq *pic) { UNINState *s; @@ -254,5 +287,9 @@ d->config[0x0E] = 0x00; // header_type d->config[0x34] = 0x00; // capabilities_pointer #endif + register_savevm("uninorth", 0, 1, pci_unin_save, pci_unin_load, d); + qemu_register_reset(pci_unin_reset, d); + pci_unin_reset(d); + return s->bus; }