From patchwork Fri Mar 26 19:02:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 48715 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B154FB7CBB for ; Sat, 27 Mar 2010 07:08:54 +1100 (EST) Received: from localhost ([127.0.0.1]:43056 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvFdd-0005fE-Sy for incoming@patchwork.ozlabs.org; Fri, 26 Mar 2010 15:56:13 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NvEnu-0001jx-Qv for qemu-devel@nongnu.org; Fri, 26 Mar 2010 15:02:46 -0400 Received: from [140.186.70.92] (port=60924 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvEns-0001iM-ED for qemu-devel@nongnu.org; Fri, 26 Mar 2010 15:02:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NvEno-0007QG-5m for qemu-devel@nongnu.org; Fri, 26 Mar 2010 15:02:42 -0400 Received: from mail-pw0-f45.google.com ([209.85.160.45]:48744) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NvEno-0007OU-0s for qemu-devel@nongnu.org; Fri, 26 Mar 2010 15:02:40 -0400 Received: by mail-pw0-f45.google.com with SMTP id 9so6226558pwi.4 for ; Fri, 26 Mar 2010 12:02:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:received:message-id :subject:from:to:content-type; bh=/kZIyfLMAE+gnBQ94pxmT+i6tlhtnadFowVBEUO9uTs=; b=cLIhrtgDU1z/Y7+ExzGz/a6I4IqnwEChED0auEBMNZR81BNyzSEhAqdx4exdqYlVxy 30QufoWXkggcFoZaaGPGeeDas0nSIO8q/ekz2sWt3fZWaA/xHE6TGxgO8v8xpLhzmtDo HKOTQsK5JwfR25Kf1mQyq30mC8U5JinKzCjSA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=NpNfxixxtZJcCkWN9jG0PkGYUAQwHFZ5TZSMrrF3rd22DLoQ7KVtodccXzfd8OG0WD 8H34Lb2DWb1zjckGFMDcXXX6xdQZatzoFu4KdsU00yATBUdSCChzDLAqx0lYYSR28RWh XyR+gZo9GtYOK+XfsFVjnCTeKt8X4eRngTdQg= MIME-Version: 1.0 Received: by 10.141.51.13 with HTTP; Fri, 26 Mar 2010 12:02:39 -0700 (PDT) Date: Fri, 26 Mar 2010 21:02:39 +0200 Received: by 10.140.57.7 with SMTP id f7mr1388839rva.201.1269630159564; Fri, 26 Mar 2010 12:02:39 -0700 (PDT) Message-ID: From: Blue Swirl To: qemu-devel X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH 01/10] pflash_cfi02: fix incorrect TARGET_FMT_lx/d use X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Also use target_phys_addr_t for addresses. Signed-off-by: Blue Swirl --- hw/pflash_cfi02.c | 30 +++++++++++++++--------------- 1 files changed, 15 insertions(+), 15 deletions(-) /* Lazy reset of to ROMD mode */ @@ -184,7 +184,7 @@ static uint32_t pflash_read (pflash_t *pfl, uint32_t offset, int width) default: goto flash_read; } - DPRINTF("%s: ID " TARGET_FMT_ld " %x\n", __func__, boff, ret); + DPRINTF("%s: ID " TARGET_FMT_pld " %x\n", __func__, boff, ret); break; case 0xA0: case 0x10: @@ -222,10 +222,10 @@ static void pflash_update(pflash_t *pfl, int offset, } } -static void pflash_write (pflash_t *pfl, uint32_t offset, uint32_t value, - int width) +static void pflash_write (pflash_t *pfl, target_phys_addr_t offset, + uint32_t value, int width) { - uint32_t boff; + target_phys_addr_t boff; uint8_t *p; uint8_t cmd; @@ -237,11 +237,11 @@ static void pflash_write (pflash_t *pfl, uint32_t offset, uint32_t value, #endif goto reset_flash; } - DPRINTF("%s: offset " TARGET_FMT_lx " %08x %d %d\n", __func__, + DPRINTF("%s: offset " TARGET_FMT_plx " %08x %d %d\n", __func__, offset, value, width, pfl->wcycle); offset &= pfl->chip_len - 1; - DPRINTF("%s: offset " TARGET_FMT_lx " %08x %d\n", __func__, + DPRINTF("%s: offset " TARGET_FMT_plx " %08x %d\n", __func__, offset, value, width); boff = offset & (pfl->sector_len - 1); if (pfl->width == 2) @@ -263,7 +263,7 @@ static void pflash_write (pflash_t *pfl, uint32_t offset, uint32_t value, return; } if (boff != pfl->unlock_addr[0] || cmd != 0xAA) { - DPRINTF("%s: unlock0 failed " TARGET_FMT_lx " %02x %04x\n", + DPRINTF("%s: unlock0 failed " TARGET_FMT_plx " %02x %04x\n", __func__, boff, cmd, pfl->unlock_addr[0]); goto reset_flash; } @@ -273,7 +273,7 @@ static void pflash_write (pflash_t *pfl, uint32_t offset, uint32_t value, /* We started an unlock sequence */ check_unlock1: if (boff != pfl->unlock_addr[1] || cmd != 0x55) { - DPRINTF("%s: unlock1 failed " TARGET_FMT_lx " %02x\n", __func__, + DPRINTF("%s: unlock1 failed " TARGET_FMT_plx " %02x\n", __func__, boff, cmd); goto reset_flash; } @@ -282,7 +282,7 @@ static void pflash_write (pflash_t *pfl, uint32_t offset, uint32_t value, case 2: /* We finished an unlock sequence */ if (!pfl->bypass && boff != pfl->unlock_addr[0]) { - DPRINTF("%s: command failed " TARGET_FMT_lx " %02x\n", __func__, + DPRINTF("%s: command failed " TARGET_FMT_plx " %02x\n", __func__, boff, cmd); goto reset_flash; } @@ -307,7 +307,7 @@ static void pflash_write (pflash_t *pfl, uint32_t offset, uint32_t value, /* We need another unlock sequence */ goto check_unlock0; case 0xA0: - DPRINTF("%s: write data offset " TARGET_FMT_lx " %08x %d\n", + DPRINTF("%s: write data offset " TARGET_FMT_plx " %08x %d\n", __func__, offset, value, width); p = pfl->storage; switch (width) { @@ -378,7 +378,7 @@ static void pflash_write (pflash_t *pfl, uint32_t offset, uint32_t value, switch (cmd) { case 0x10: if (boff != pfl->unlock_addr[0]) { - DPRINTF("%s: chip erase: invalid address " TARGET_FMT_lx "\n", + DPRINTF("%s: chip erase: invalid address " TARGET_FMT_plx "\n", __func__, offset); goto reset_flash; } @@ -395,7 +395,7 @@ static void pflash_write (pflash_t *pfl, uint32_t offset, uint32_t value, /* Sector erase */ p = pfl->storage; offset &= ~(pfl->sector_len - 1); - DPRINTF("%s: start sector erase at " TARGET_FMT_lx "\n", __func__, + DPRINTF("%s: start sector erase at " TARGET_FMT_plx "\n", __func__, offset); memset(p + offset, 0xFF, pfl->sector_len); pflash_update(pfl, offset, pfl->sector_len); diff --git a/hw/pflash_cfi02.c b/hw/pflash_cfi02.c index 135c850..50b4c6c 100644 --- a/hw/pflash_cfi02.c +++ b/hw/pflash_cfi02.c @@ -103,13 +103,13 @@ static void pflash_timer (void *opaque) pfl->cmd = 0; } -static uint32_t pflash_read (pflash_t *pfl, uint32_t offset, int width) +static uint32_t pflash_read (pflash_t *pfl, target_phys_addr_t offset, int width) { - uint32_t boff; + target_phys_addr_t boff; uint32_t ret; uint8_t *p; - DPRINTF("%s: offset " TARGET_FMT_lx "\n", __func__, offset); + DPRINTF("%s: offset " TARGET_FMT_plx "\n", __func__, offset); ret = -1; if (pfl->rom_mode) {