Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LKYxY-0008CH-AL for qemu-devel@nongnu.org; Wed, 07 Jan 2009 09:00:36 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LKYxX-0008C3-T9 for qemu-devel@nongnu.org; Wed, 07 Jan 2009 09:00:36 -0500 Received: from [199.232.76.173] (port=57868 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LKYxX-0008C0-M3 for qemu-devel@nongnu.org; Wed, 07 Jan 2009 09:00:35 -0500 Received: from savannah.gnu.org ([199.232.41.3]:56815 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 1LKYxX-00085I-9a for qemu-devel@nongnu.org; Wed, 07 Jan 2009 09:00:35 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LKYxW-0002HV-Im for qemu-devel@nongnu.org; Wed, 07 Jan 2009 14:00:34 +0000 Received: from edgar_igl by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LKYxW-0002HG-15 for qemu-devel@nongnu.org; Wed, 07 Jan 2009 14:00:34 +0000 MIME-Version: 1.0 Errors-To: edgar_igl Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: "Edgar E. Iglesias" Message-Id: Date: Wed, 07 Jan 2009 14:00:34 +0000 Subject: [Qemu-devel] [6209] ETRAX: Correct size of control-register area. 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: 6209 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6209 Author: edgar_igl Date: 2009-01-07 14:00:33 +0000 (Wed, 07 Jan 2009) Log Message: ----------- ETRAX: Correct size of control-register area. Signed-off-by: Edgar E. Iglesias Modified Paths: -------------- trunk/hw/etraxfs_eth.c Modified: trunk/hw/etraxfs_eth.c =================================================================== --- trunk/hw/etraxfs_eth.c 2009-01-07 13:46:31 UTC (rev 6208) +++ trunk/hw/etraxfs_eth.c 2009-01-07 14:00:33 UTC (rev 6209) @@ -297,18 +297,18 @@ /* ETRAX-FS Ethernet MAC block starts here. */ #define RW_MA0_LO 0x00 -#define RW_MA0_HI 0x04 -#define RW_MA1_LO 0x08 -#define RW_MA1_HI 0x0c -#define RW_GA_LO 0x10 -#define RW_GA_HI 0x14 -#define RW_GEN_CTRL 0x18 -#define RW_REC_CTRL 0x1c -#define RW_TR_CTRL 0x20 -#define RW_CLR_ERR 0x24 -#define RW_MGM_CTRL 0x28 -#define R_STAT 0x2c -#define FS_ETH_MAX_REGS 0x5c +#define RW_MA0_HI 0x01 +#define RW_MA1_LO 0x02 +#define RW_MA1_HI 0x03 +#define RW_GA_LO 0x04 +#define RW_GA_HI 0x05 +#define RW_GEN_CTRL 0x06 +#define RW_REC_CTRL 0x07 +#define RW_TR_CTRL 0x08 +#define RW_CLR_ERR 0x09 +#define RW_MGM_CTRL 0x0a +#define R_STAT 0x0b +#define FS_ETH_MAX_REGS 0x17 struct fs_eth { @@ -360,42 +360,25 @@ } } -static uint32_t eth_rinvalid (void *opaque, target_phys_addr_t addr) -{ - struct fs_eth *eth = opaque; - CPUState *env = eth->env; - cpu_abort(env, "Unsupported short access. reg=" TARGET_FMT_plx "\n", - addr); - return 0; -} - static uint32_t eth_readl (void *opaque, target_phys_addr_t addr) { struct fs_eth *eth = opaque; uint32_t r = 0; + addr >>= 2; + switch (addr) { case R_STAT: - /* Attach an MDIO/PHY abstraction. */ r = eth->mdio_bus.mdio & 1; break; default: r = eth->regs[addr]; - D(printf ("%s %x\n", __func__, addr)); + D(printf ("%s %x\n", __func__, addr * 4)); break; } return r; } -static void -eth_winvalid (void *opaque, target_phys_addr_t addr, uint32_t value) -{ - struct fs_eth *eth = opaque; - CPUState *env = eth->env; - cpu_abort(env, "Unsupported short access. reg=" TARGET_FMT_plx "\n", - addr); -} - static void eth_update_ma(struct fs_eth *eth, int ma) { int reg; @@ -425,20 +408,15 @@ { struct fs_eth *eth = opaque; + addr >>= 2; switch (addr) { case RW_MA0_LO: - eth->regs[addr] = value; - eth_update_ma(eth, 0); - break; case RW_MA0_HI: eth->regs[addr] = value; eth_update_ma(eth, 0); break; case RW_MA1_LO: - eth->regs[addr] = value; - eth_update_ma(eth, 1); - break; case RW_MA1_HI: eth->regs[addr] = value; eth_update_ma(eth, 1); @@ -553,14 +531,12 @@ } static CPUReadMemoryFunc *eth_read[] = { - ð_rinvalid, - ð_rinvalid, + NULL, NULL, ð_readl, }; static CPUWriteMemoryFunc *eth_write[] = { - ð_winvalid, - ð_winvalid, + NULL, NULL, ð_writel, };