aboutsummaryrefslogtreecommitdiff
path: root/hw/net
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-10-27 16:17:55 +0000
committerPeter Maydell <peter.maydell@linaro.org>2015-10-27 16:17:55 +0000
commitc012e1b7ad066f462ba1c3322fcb43cd8295eaff (patch)
tree0ba1b8617611f9c4ac60dfc946cf5e24a3fab2ed /hw/net
parent7e038b94e74e1c2d1b3598e2e4b0b5c8b79a7278 (diff)
parent9b539263faa5c1b7fce2551092b5c7b6eea92081 (diff)
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20151027-1' into staging
target-arm queue: * more EL2 preparation: handling for stage 2 translations * standardize debug macros in i.MX devices * improve error message in a corner case for virt board * disable live migration of KVM GIC if the kernel can't handle it * add SPSR_(ABT|UND|IRQ|FIQ) registers * handle non-executable page-straddling Thumb instructions * fix a "no 64-bit EL2" assumption in arm_excp_unmasked() # gpg: Signature made Tue 27 Oct 2015 16:03:31 GMT using RSA key ID 14360CDE # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" # gpg: aka "Peter Maydell <pmaydell@gmail.com>" # gpg: aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" * remotes/pmaydell/tags/pull-target-arm-20151027-1: (27 commits) target-arm: Add support for S1 + S2 MMU translations target-arm: Route S2 MMU faults to EL2 target-arm: Add S2 translation to 32bit S1 PTWs target-arm: Add S2 translation to 64bit S1 PTWs target-arm: Add ARMMMUFaultInfo target-arm: Avoid inline for get_phys_addr target-arm: Add support for S2 page-table protection bits target-arm: Add computation of starting level for S2 PTW target-arm: lpae: Rename granule_sz to stride target-arm: lpae: Replace tsz with computed inputsize target-arm: Add support for AArch32 S2 negative t0sz target-arm: lpae: Move declaration of t0sz and t1sz target-arm: lpae: Make t0sz and t1sz signed integers target-arm: Add HPFAR_EL2 i.MX: Standardize i.MX GPT debug i.MX: Standardize i.MX EPIT debug i.MX: Standardize i.MX FEC debug i.MX: Standardize i.MX CCM debug i.MX: Standardize i.MX AVIC debug i.MX: Standardize i.MX I2C debug ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/net')
-rw-r--r--hw/net/imx_fec.c64
1 files changed, 32 insertions, 32 deletions
diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c
index 725f3fa335..c50bf7ff34 100644
--- a/hw/net/imx_fec.c
+++ b/hw/net/imx_fec.c
@@ -27,31 +27,29 @@
/* For crc32 */
#include <zlib.h>
-#ifndef IMX_FEC_DEBUG
-#define IMX_FEC_DEBUG 0
+#ifndef DEBUG_IMX_FEC
+#define DEBUG_IMX_FEC 0
#endif
-#ifndef IMX_PHY_DEBUG
-#define IMX_PHY_DEBUG 0
-#endif
-
-#if IMX_FEC_DEBUG
-#define FEC_PRINTF(fmt, ...) \
- do { fprintf(stderr, "%s[%s]: " fmt , TYPE_IMX_FEC, __func__, \
- ## __VA_ARGS__); \
+#define FEC_PRINTF(fmt, args...) \
+ do { \
+ if (DEBUG_IMX_FEC) { \
+ fprintf(stderr, "[%s]%s: " fmt , TYPE_IMX_FEC, \
+ __func__, ##args); \
+ } \
} while (0)
-#else
-#define FEC_PRINTF(fmt, ...) do {} while (0)
+
+#ifndef DEBUG_IMX_PHY
+#define DEBUG_IMX_PHY 0
#endif
-#if IMX_PHY_DEBUG
-#define PHY_PRINTF(fmt, ...) \
- do { fprintf(stderr, "%s.phy[%s]: " fmt , TYPE_IMX_FEC, __func__, \
- ## __VA_ARGS__); \
+#define PHY_PRINTF(fmt, args...) \
+ do { \
+ if (DEBUG_IMX_PHY) { \
+ fprintf(stderr, "[%s.phy]%s: " fmt , TYPE_IMX_FEC, \
+ __func__, ##args); \
+ } \
} while (0)
-#else
-#define PHY_PRINTF(fmt, ...) do {} while (0)
-#endif
static const VMStateDescription vmstate_imx_fec = {
.name = TYPE_IMX_FEC,
@@ -182,12 +180,12 @@ static uint32_t do_phy_read(IMXFECState *s, int reg)
case 18:
case 27:
case 31:
- qemu_log_mask(LOG_UNIMP, "%s.phy[%s]: reg %d not implemented\n",
+ qemu_log_mask(LOG_UNIMP, "[%s.phy]%s: reg %d not implemented\n",
TYPE_IMX_FEC, __func__, reg);
val = 0;
break;
default:
- qemu_log_mask(LOG_GUEST_ERROR, "%s[%s]: Bad address at offset %d\n",
+ qemu_log_mask(LOG_GUEST_ERROR, "[%s.phy]%s: Bad address at offset %d\n",
TYPE_IMX_FEC, __func__, reg);
val = 0;
break;
@@ -230,11 +228,11 @@ static void do_phy_write(IMXFECState *s, int reg, uint32_t val)
case 18:
case 27:
case 31:
- qemu_log_mask(LOG_UNIMP, "%s.phy[%s]: reg %d not implemented\n",
+ qemu_log_mask(LOG_UNIMP, "[%s.phy)%s: reg %d not implemented\n",
TYPE_IMX_FEC, __func__, reg);
break;
default:
- qemu_log_mask(LOG_GUEST_ERROR, "%s.phy[%s]: Bad address at offset %d\n",
+ qemu_log_mask(LOG_GUEST_ERROR, "[%s.phy]%s: Bad address at offset %d\n",
TYPE_IMX_FEC, __func__, reg);
break;
}
@@ -357,7 +355,7 @@ static uint64_t imx_fec_read(void *opaque, hwaddr addr, unsigned size)
{
IMXFECState *s = IMX_FEC(opaque);
- FEC_PRINTF("reading from @ 0x%03x\n", (int)addr);
+ FEC_PRINTF("reading from @ 0x%" HWADDR_PRIx "\n", addr);
switch (addr & 0x3ff) {
case 0x004:
@@ -417,8 +415,8 @@ static uint64_t imx_fec_read(void *opaque, hwaddr addr, unsigned size)
case 0x308:
return s->miigsk_enr;
default:
- qemu_log_mask(LOG_GUEST_ERROR, "%s[%s]: Bad address at offset %d\n",
- TYPE_IMX_FEC, __func__, (int)addr);
+ qemu_log_mask(LOG_GUEST_ERROR, "[%s]%s: Bad address at offset 0x%"
+ HWADDR_PRIx "\n", TYPE_IMX_FEC, __func__, addr);
return 0;
}
}
@@ -428,7 +426,7 @@ static void imx_fec_write(void *opaque, hwaddr addr,
{
IMXFECState *s = IMX_FEC(opaque);
- FEC_PRINTF("writing 0x%08x @ 0x%03x\n", (int)value, (int)addr);
+ FEC_PRINTF("writing 0x%08x @ 0x%" HWADDR_PRIx "\n", (int)value, addr);
switch (addr & 0x3ff) {
case 0x004: /* EIR */
@@ -530,8 +528,8 @@ static void imx_fec_write(void *opaque, hwaddr addr,
s->miigsk_enr = (value & 0x2) ? 0x6 : 0;
break;
default:
- qemu_log_mask(LOG_GUEST_ERROR, "%s[%s]: Bad address at offset %d\n",
- TYPE_IMX_FEC, __func__, (int)addr);
+ qemu_log_mask(LOG_GUEST_ERROR, "[%s]%s: Bad address at offset 0x%"
+ HWADDR_PRIx "\n", TYPE_IMX_FEC, __func__, addr);
break;
}
@@ -561,7 +559,7 @@ static ssize_t imx_fec_receive(NetClientState *nc, const uint8_t *buf,
FEC_PRINTF("len %d\n", (int)size);
if (!s->rx_enabled) {
- qemu_log_mask(LOG_GUEST_ERROR, "%s[%s]: Unexpected packet\n",
+ qemu_log_mask(LOG_GUEST_ERROR, "[%s]%s: Unexpected packet\n",
TYPE_IMX_FEC, __func__);
return 0;
}
@@ -592,14 +590,16 @@ static ssize_t imx_fec_receive(NetClientState *nc, const uint8_t *buf,
* save the remainder for when more RX buffers are
* available, or flag an error.
*/
- qemu_log_mask(LOG_GUEST_ERROR, "%s[%s]: Lost end of frame\n",
+ qemu_log_mask(LOG_GUEST_ERROR, "[%s]%s: Lost end of frame\n",
TYPE_IMX_FEC, __func__);
break;
}
buf_len = (size <= s->emrbr) ? size : s->emrbr;
bd.length = buf_len;
size -= buf_len;
- FEC_PRINTF("rx_bd %x length %d\n", addr, bd.length);
+
+ FEC_PRINTF("rx_bd 0x%x length %d\n", addr, bd.length);
+
/* The last 4 bytes are the CRC. */
if (size < 4) {
buf_len += size - 4;