1
Last handful of arm patches before softfreeze...
1
A last small test of bug fixes before rc1.
2
2
3
The following changes since commit a98135f727595382e200d04c2996e868b7925a01:
3
thanks
4
-- PMM
4
5
5
Merge remote-tracking branch 'remotes/kraxel/tags/vga-20200316-pull-request' into staging (2020-03-16 14:55:59 +0000)
6
The following changes since commit ed8ad9728a9c0eec34db9dff61dfa2f1dd625637:
7
8
Merge tag 'pull-tpm-2023-07-14-1' of https://github.com/stefanberger/qemu-tpm into staging (2023-07-15 14:54:04 +0100)
6
9
7
are available in the Git repository at:
10
are available in the Git repository at:
8
11
9
https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20200317
12
https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20230717
10
13
11
for you to fetch changes up to e88d3671e3bbd59d385838a4101ea19cdcf47309:
14
for you to fetch changes up to c2c1c4a35c7c2b1a4140b0942b9797c857e476a4:
12
15
13
hw/arm/pxa2xx: Do not wire up OHCI for PXA255 (2020-03-17 11:36:48 +0000)
16
hw/nvram: Avoid unnecessary Xilinx eFuse backstore write (2023-07-17 11:05:52 +0100)
14
17
15
----------------------------------------------------------------
18
----------------------------------------------------------------
16
target-arm:
19
target-arm queue:
17
* hw/arm/pxa2xx: Do not wire up OHCI for PXA255
20
* hw/arm/sbsa-ref: set 'slots' property of xhci
18
* aspeed/smc: Fix number of dummy cycles for FAST_READ_4 command
21
* linux-user: Remove pointless NULL check in clock_adjtime handling
19
* m25p80: Improve command handling for Jedec and unsupported commands
22
* ptw: Fix S1_ptw_translate() debug path
20
* hw/net/imx_fec: write TGSR and TCSR3 in imx_enet_write()
23
* ptw: Account for FEAT_RME when applying {N}SW, SA bits
21
* hw/arm/fsl-imx6, imx6ul: Wire up USB controllers
24
* accel/tcg: Zero-pad PC in TCG CPU exec trace lines
22
* hw/arm/fsl-imx6ul: Instantiate unimplemented pwm and can devices
25
* hw/nvram: Avoid unnecessary Xilinx eFuse backstore write
23
26
24
----------------------------------------------------------------
27
----------------------------------------------------------------
25
Chen Qun (1):
28
Peter Maydell (5):
26
hw/net/imx_fec: write TGSR and TCSR3 in imx_enet_write()
29
linux-user: Remove pointless NULL check in clock_adjtime handling
30
target/arm/ptw.c: Add comments to S1Translate struct fields
31
target/arm: Fix S1_ptw_translate() debug path
32
target/arm/ptw.c: Account for FEAT_RME when applying {N}SW, SA bits
33
accel/tcg: Zero-pad PC in TCG CPU exec trace lines
27
34
28
Guenter Roeck (10):
35
Tong Ho (1):
29
hw/usb: Add basic i.MX USB Phy support
36
hw/nvram: Avoid unnecessary Xilinx eFuse backstore write
30
hw/arm/fsl-imx6ul: Fix USB interrupt numbers
31
hw/arm/fsl-imx6ul: Instantiate unimplemented pwm and can devices
32
hw/arm/fsl-imx6ul: Wire up USB controllers
33
hw/arm/fsl-imx6: Wire up USB controllers
34
m25p80: Convert to support tracing
35
m25p80: Improve command handling for Jedec commands
36
m25p80: Improve command handling for unsupported commands
37
aspeed/smc: Fix number of dummy cycles for FAST_READ_4 command
38
hw/arm/pxa2xx: Do not wire up OHCI for PXA255
39
37
40
hw/usb/Makefile.objs | 2 +
38
Yuquan Wang (1):
41
include/hw/arm/fsl-imx6.h | 6 ++
39
hw/arm/sbsa-ref: set 'slots' property of xhci
42
include/hw/arm/fsl-imx6ul.h | 16 ++-
43
include/hw/usb/imx-usb-phy.h | 53 ++++++++++
44
hw/arm/fsl-imx6.c | 36 +++++++
45
hw/arm/fsl-imx6ul.c | 49 ++++++++++
46
hw/arm/pxa2xx.c | 3 -
47
hw/block/m25p80.c | 58 +++++------
48
hw/net/imx_fec.c | 6 +-
49
hw/ssi/aspeed_smc.c | 2 +-
50
hw/usb/imx-usb-phy.c | 225 +++++++++++++++++++++++++++++++++++++++++++
51
MAINTAINERS | 2 +
52
hw/arm/Kconfig | 1 +
53
hw/block/trace-events | 16 +++
54
hw/usb/Kconfig | 5 +
55
15 files changed, 444 insertions(+), 36 deletions(-)
56
create mode 100644 include/hw/usb/imx-usb-phy.h
57
create mode 100644 hw/usb/imx-usb-phy.c
58
40
41
accel/tcg/cpu-exec.c | 4 +--
42
accel/tcg/translate-all.c | 2 +-
43
hw/arm/sbsa-ref.c | 1 +
44
hw/nvram/xlnx-efuse.c | 11 ++++--
45
linux-user/syscall.c | 12 +++----
46
target/arm/ptw.c | 90 +++++++++++++++++++++++++++++++++++++++++------
47
6 files changed, 98 insertions(+), 22 deletions(-)
diff view generated by jsdifflib
1
From: Guenter Roeck <linux@roeck-us.net>
1
From: Yuquan Wang <wangyuquan1236@phytium.com.cn>
2
2
3
PXA255 does not support a USB OHCI controller, so don't wire it up.
3
This extends the slots of xhci to 64, since the default xhci_sysbus
4
just supports one slot.
4
5
5
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
6
Signed-off-by: Wang Yuquan <wangyuquan1236@phytium.com.cn>
6
Message-id: 20200313160215.28155-1-linux@roeck-us.net
7
Signed-off-by: Chen Baozi <chenbaozi@phytium.com.cn>
7
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
8
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
9
Reviewed-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
10
Tested-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
11
Message-id: 20230710063750.473510-2-wangyuquan1236@phytium.com.cn
8
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9
---
13
---
10
hw/arm/pxa2xx.c | 3 ---
14
hw/arm/sbsa-ref.c | 1 +
11
1 file changed, 3 deletions(-)
15
1 file changed, 1 insertion(+)
12
16
13
diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c
17
diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c
14
index XXXXXXX..XXXXXXX 100644
18
index XXXXXXX..XXXXXXX 100644
15
--- a/hw/arm/pxa2xx.c
19
--- a/hw/arm/sbsa-ref.c
16
+++ b/hw/arm/pxa2xx.c
20
+++ b/hw/arm/sbsa-ref.c
17
@@ -XXX,XX +XXX,XX @@ PXA2xxState *pxa255_init(MemoryRegion *address_space, unsigned int sdram_size)
21
@@ -XXX,XX +XXX,XX @@ static void create_xhci(const SBSAMachineState *sms)
18
s->ssp[i] = (SSIBus *)qdev_get_child_bus(dev, "ssi");
22
hwaddr base = sbsa_ref_memmap[SBSA_XHCI].base;
19
}
23
int irq = sbsa_ref_irqmap[SBSA_XHCI];
20
24
DeviceState *dev = qdev_new(TYPE_XHCI_SYSBUS);
21
- sysbus_create_simple("sysbus-ohci", 0x4c000000,
25
+ qdev_prop_set_uint32(dev, "slots", XHCI_MAXSLOTS);
22
- qdev_get_gpio_in(s->pic, PXA2XX_PIC_USBH1));
26
23
-
27
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
24
s->pcmcia[0] = pxa2xx_pcmcia_init(address_space, 0x20000000);
28
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
25
s->pcmcia[1] = pxa2xx_pcmcia_init(address_space, 0x30000000);
26
27
--
29
--
28
2.20.1
30
2.34.1
29
30
diff view generated by jsdifflib
1
From: Guenter Roeck <linux@roeck-us.net>
1
In the code for TARGET_NR_clock_adjtime, we set the pointer phtx to
2
the address of the local variable htx. This means it can never be
3
NULL, but later in the code we check it for NULL anyway. Coverity
4
complains about this (CID 1507683) because the NULL check comes after
5
a call to clock_adjtime() that assumes it is non-NULL.
2
6
3
The Linux kernel recently started using FAST_READ_4 commands.
7
Since phtx is always &htx, and is used only in three places, it's not
4
This results in flash read failures. At the same time, the m25p80
8
really necessary. Remove it, bringing the code structure in to line
5
emulation is seen to read 8 more bytes than expected. Adjusting the
9
with that for TARGET_NR_clock_adjtime64, which already uses a simple
6
expected number of dummy cycles to match FAST_READ fixes the problem.
10
'&htx' when it wants a pointer to 'htx'.
7
11
8
Fixes: f95c4bffdc4c ("aspeed/smc: snoop SPI transfers to fake dummy cycles")
9
Reviewed-by: Cédric Le Goater <clg@kaod.org>
10
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
11
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
12
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
14
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
15
Message-id: 20230623144410.1837261-1-peter.maydell@linaro.org
13
---
16
---
14
hw/ssi/aspeed_smc.c | 2 +-
17
linux-user/syscall.c | 12 +++++-------
15
1 file changed, 1 insertion(+), 1 deletion(-)
18
1 file changed, 5 insertions(+), 7 deletions(-)
16
19
17
diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c
20
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
18
index XXXXXXX..XXXXXXX 100644
21
index XXXXXXX..XXXXXXX 100644
19
--- a/hw/ssi/aspeed_smc.c
22
--- a/linux-user/syscall.c
20
+++ b/hw/ssi/aspeed_smc.c
23
+++ b/linux-user/syscall.c
21
@@ -XXX,XX +XXX,XX @@ static int aspeed_smc_num_dummies(uint8_t command)
24
@@ -XXX,XX +XXX,XX @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
22
case FAST_READ:
25
#if defined(TARGET_NR_clock_adjtime) && defined(CONFIG_CLOCK_ADJTIME)
23
case DOR:
26
case TARGET_NR_clock_adjtime:
24
case QOR:
27
{
25
+ case FAST_READ_4:
28
- struct timex htx, *phtx = &htx;
26
case DOR_4:
29
+ struct timex htx;
27
case QOR_4:
30
28
return 1;
31
- if (target_to_host_timex(phtx, arg2) != 0) {
29
case DIOR:
32
+ if (target_to_host_timex(&htx, arg2) != 0) {
30
- case FAST_READ_4:
33
return -TARGET_EFAULT;
31
case DIOR_4:
34
}
32
return 2;
35
- ret = get_errno(clock_adjtime(arg1, phtx));
33
case QIOR:
36
- if (!is_error(ret) && phtx) {
37
- if (host_to_target_timex(arg2, phtx) != 0) {
38
- return -TARGET_EFAULT;
39
- }
40
+ ret = get_errno(clock_adjtime(arg1, &htx));
41
+ if (!is_error(ret) && host_to_target_timex(arg2, &htx)) {
42
+ return -TARGET_EFAULT;
43
}
44
}
45
return ret;
34
--
46
--
35
2.20.1
47
2.34.1
36
48
37
49
diff view generated by jsdifflib
1
From: Guenter Roeck <linux@roeck-us.net>
1
Add comments to the in_* fields in the S1Translate struct
2
that explain what they're doing.
2
3
3
When requesting JEDEC data using the JEDEC_READ command, the Linux kernel
4
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4
always requests 6 bytes. The current implementation only returns three
5
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
5
bytes, and interprets the remaining three bytes as new commands.
6
Message-id: 20230710152130.3928330-2-peter.maydell@linaro.org
6
While this does not matter most of the time, it is at the very least
7
---
7
confusing. To avoid the problem, always report up to 6 bytes of JEDEC
8
target/arm/ptw.c | 40 ++++++++++++++++++++++++++++++++++++++++
8
data. Fill remaining data with 0.
9
1 file changed, 40 insertions(+)
9
10
10
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
11
diff --git a/target/arm/ptw.c b/target/arm/ptw.c
11
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
12
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
13
Reviewed-by: Cédric Le Goater <clg@kaod.org>
14
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
15
---
16
hw/block/m25p80.c | 5 ++++-
17
1 file changed, 4 insertions(+), 1 deletion(-)
18
19
diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
20
index XXXXXXX..XXXXXXX 100644
12
index XXXXXXX..XXXXXXX 100644
21
--- a/hw/block/m25p80.c
13
--- a/target/arm/ptw.c
22
+++ b/hw/block/m25p80.c
14
+++ b/target/arm/ptw.c
23
@@ -XXX,XX +XXX,XX @@ static void decode_new_cmd(Flash *s, uint32_t value)
15
@@ -XXX,XX +XXX,XX @@
24
for (i = 0; i < s->pi->id_len; i++) {
16
#endif
25
s->data[i] = s->pi->id[i];
17
26
}
18
typedef struct S1Translate {
27
+ for (; i < SPI_NOR_MAX_ID_LEN; i++) {
19
+ /*
28
+ s->data[i] = 0;
20
+ * in_mmu_idx : specifies which TTBR, TCR, etc to use for the walk.
29
+ }
21
+ * Together with in_space, specifies the architectural translation regime.
30
22
+ */
31
- s->len = s->pi->id_len;
23
ARMMMUIdx in_mmu_idx;
32
+ s->len = SPI_NOR_MAX_ID_LEN;
24
+ /*
33
s->pos = 0;
25
+ * in_ptw_idx: specifies which mmuidx to use for the actual
34
s->state = STATE_READING_DATA;
26
+ * page table descriptor load operations. This will be one of the
35
break;
27
+ * ARMMMUIdx_Stage2* or one of the ARMMMUIdx_Phys_* indexes.
28
+ * If a Secure ptw is "downgraded" to NonSecure by an NSTable bit,
29
+ * this field is updated accordingly.
30
+ */
31
ARMMMUIdx in_ptw_idx;
32
+ /*
33
+ * in_space: the security space for this walk. This plus
34
+ * the in_mmu_idx specify the architectural translation regime.
35
+ * If a Secure ptw is "downgraded" to NonSecure by an NSTable bit,
36
+ * this field is updated accordingly.
37
+ *
38
+ * Note that the security space for the in_ptw_idx may be different
39
+ * from that for the in_mmu_idx. We do not need to explicitly track
40
+ * the in_ptw_idx security space because:
41
+ * - if the in_ptw_idx is an ARMMMUIdx_Phys_* then the mmuidx
42
+ * itself specifies the security space
43
+ * - if the in_ptw_idx is an ARMMMUIdx_Stage2* then the security
44
+ * space used for ptw reads is the same as that of the security
45
+ * space of the stage 1 translation for all cases except where
46
+ * stage 1 is Secure; in that case the only possibilities for
47
+ * the ptw read are Secure and NonSecure, and the in_ptw_idx
48
+ * value being Stage2 vs Stage2_S distinguishes those.
49
+ */
50
ARMSecuritySpace in_space;
51
+ /*
52
+ * in_secure: whether the translation regime is a Secure one.
53
+ * This is always equal to arm_space_is_secure(in_space).
54
+ * If a Secure ptw is "downgraded" to NonSecure by an NSTable bit,
55
+ * this field is updated accordingly.
56
+ */
57
bool in_secure;
58
+ /*
59
+ * in_debug: is this a QEMU debug access (gdbstub, etc)? Debug
60
+ * accesses will not update the guest page table access flags
61
+ * and will not change the state of the softmmu TLBs.
62
+ */
63
bool in_debug;
64
/*
65
* If this is stage 2 of a stage 1+2 page table walk, then this must
36
--
66
--
37
2.20.1
67
2.34.1
38
39
diff view generated by jsdifflib
1
From: Guenter Roeck <linux@roeck-us.net>
1
In commit fe4a5472ccd6 we rearranged the logic in S1_ptw_translate()
2
so that the debug-access "call get_phys_addr_*" codepath is used both
3
when S1 is doing ptw reads from stage 2 and when it is doing ptw
4
reads from physical memory. However, we didn't update the
5
calculation of s2ptw->in_space and s2ptw->in_secure to account for
6
the "ptw reads from physical memory" case. This meant that debug
7
accesses when in Secure state broke.
2
8
3
Add basic USB PHY support as implemented in i.MX23, i.MX28, i.MX6,
9
Create a new function S2_security_space() which returns the
4
and i.MX7 SoCs.
10
correct security space to use for the ptw load, and use it to
11
determine the correct .in_secure and .in_space fields for the
12
stage 2 lookup for the ptw load.
5
13
6
The only support really needed - at least to boot Linux - is support
14
Reported-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
7
for soft reset, which needs to reset various registers to their initial
15
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
8
value. Otherwise, just record register values.
16
Tested-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
9
17
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
10
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
18
Message-id: 20230710152130.3928330-3-peter.maydell@linaro.org
11
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
19
Fixes: fe4a5472ccd6 ("target/arm: Use get_phys_addr_with_struct in S1_ptw_translate")
12
Message-id: 20200313014551.12554-2-linux@roeck-us.net
13
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
20
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
14
---
21
---
15
hw/usb/Makefile.objs | 2 +
22
target/arm/ptw.c | 37 ++++++++++++++++++++++++++++++++-----
16
include/hw/usb/imx-usb-phy.h | 53 +++++++++
23
1 file changed, 32 insertions(+), 5 deletions(-)
17
hw/usb/imx-usb-phy.c | 225 +++++++++++++++++++++++++++++++++++
18
MAINTAINERS | 2 +
19
hw/arm/Kconfig | 1 +
20
hw/usb/Kconfig | 5 +
21
6 files changed, 288 insertions(+)
22
create mode 100644 include/hw/usb/imx-usb-phy.h
23
create mode 100644 hw/usb/imx-usb-phy.c
24
24
25
diff --git a/hw/usb/Makefile.objs b/hw/usb/Makefile.objs
25
diff --git a/target/arm/ptw.c b/target/arm/ptw.c
26
index XXXXXXX..XXXXXXX 100644
26
index XXXXXXX..XXXXXXX 100644
27
--- a/hw/usb/Makefile.objs
27
--- a/target/arm/ptw.c
28
+++ b/hw/usb/Makefile.objs
28
+++ b/target/arm/ptw.c
29
@@ -XXX,XX +XXX,XX @@ common-obj-$(CONFIG_XEN) += xen-usb.o
29
@@ -XXX,XX +XXX,XX @@ static bool S2_attrs_are_device(uint64_t hcr, uint8_t attrs)
30
xen-usb.o-cflags := $(LIBUSB_CFLAGS)
30
}
31
xen-usb.o-libs := $(LIBUSB_LIBS)
31
}
32
endif
32
33
+
33
+static ARMSecuritySpace S2_security_space(ARMSecuritySpace s1_space,
34
+common-obj-$(CONFIG_IMX_USBPHY) += imx-usb-phy.o
34
+ ARMMMUIdx s2_mmu_idx)
35
diff --git a/include/hw/usb/imx-usb-phy.h b/include/hw/usb/imx-usb-phy.h
36
new file mode 100644
37
index XXXXXXX..XXXXXXX
38
--- /dev/null
39
+++ b/include/hw/usb/imx-usb-phy.h
40
@@ -XXX,XX +XXX,XX @@
41
+#ifndef IMX_USB_PHY_H
42
+#define IMX_USB_PHY_H
43
+
44
+#include "hw/sysbus.h"
45
+#include "qemu/bitops.h"
46
+
47
+enum IMXUsbPhyRegisters {
48
+ USBPHY_PWD,
49
+ USBPHY_PWD_SET,
50
+ USBPHY_PWD_CLR,
51
+ USBPHY_PWD_TOG,
52
+ USBPHY_TX,
53
+ USBPHY_TX_SET,
54
+ USBPHY_TX_CLR,
55
+ USBPHY_TX_TOG,
56
+ USBPHY_RX,
57
+ USBPHY_RX_SET,
58
+ USBPHY_RX_CLR,
59
+ USBPHY_RX_TOG,
60
+ USBPHY_CTRL,
61
+ USBPHY_CTRL_SET,
62
+ USBPHY_CTRL_CLR,
63
+ USBPHY_CTRL_TOG,
64
+ USBPHY_STATUS,
65
+ USBPHY_DEBUG = 0x14,
66
+ USBPHY_DEBUG_SET,
67
+ USBPHY_DEBUG_CLR,
68
+ USBPHY_DEBUG_TOG,
69
+ USBPHY_DEBUG0_STATUS,
70
+ USBPHY_DEBUG1 = 0x1c,
71
+ USBPHY_DEBUG1_SET,
72
+ USBPHY_DEBUG1_CLR,
73
+ USBPHY_DEBUG1_TOG,
74
+ USBPHY_VERSION,
75
+ USBPHY_MAX
76
+};
77
+
78
+#define USBPHY_CTRL_SFTRST BIT(31)
79
+
80
+#define TYPE_IMX_USBPHY "imx.usbphy"
81
+#define IMX_USBPHY(obj) OBJECT_CHECK(IMXUSBPHYState, (obj), TYPE_IMX_USBPHY)
82
+
83
+typedef struct IMXUSBPHYState {
84
+ /* <private> */
85
+ SysBusDevice parent_obj;
86
+
87
+ /* <public> */
88
+ MemoryRegion iomem;
89
+
90
+ uint32_t usbphy[USBPHY_MAX];
91
+} IMXUSBPHYState;
92
+
93
+#endif /* IMX_USB_PHY_H */
94
diff --git a/hw/usb/imx-usb-phy.c b/hw/usb/imx-usb-phy.c
95
new file mode 100644
96
index XXXXXXX..XXXXXXX
97
--- /dev/null
98
+++ b/hw/usb/imx-usb-phy.c
99
@@ -XXX,XX +XXX,XX @@
100
+/*
101
+ * i.MX USB PHY
102
+ *
103
+ * Copyright (c) 2020 Guenter Roeck <linux@roeck-us.net>
104
+ *
105
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
106
+ * See the COPYING file in the top-level directory.
107
+ *
108
+ * We need to implement basic reset control in the PHY control register.
109
+ * For everything else, it is sufficient to set whatever is written.
110
+ */
111
+
112
+#include "qemu/osdep.h"
113
+#include "hw/usb/imx-usb-phy.h"
114
+#include "migration/vmstate.h"
115
+#include "qemu/log.h"
116
+#include "qemu/module.h"
117
+
118
+static const VMStateDescription vmstate_imx_usbphy = {
119
+ .name = TYPE_IMX_USBPHY,
120
+ .version_id = 1,
121
+ .minimum_version_id = 1,
122
+ .fields = (VMStateField[]) {
123
+ VMSTATE_UINT32_ARRAY(usbphy, IMXUSBPHYState, USBPHY_MAX),
124
+ VMSTATE_END_OF_LIST()
125
+ },
126
+};
127
+
128
+static void imx_usbphy_softreset(IMXUSBPHYState *s)
129
+{
35
+{
130
+ s->usbphy[USBPHY_PWD] = 0x001e1c00;
36
+ /*
131
+ s->usbphy[USBPHY_TX] = 0x10060607;
37
+ * Return the security space to use for stage 2 when doing
132
+ s->usbphy[USBPHY_RX] = 0x00000000;
38
+ * the S1 page table descriptor load.
133
+ s->usbphy[USBPHY_CTRL] = 0xc0200000;
39
+ */
134
+}
40
+ if (regime_is_stage2(s2_mmu_idx)) {
135
+
136
+static void imx_usbphy_reset(DeviceState *dev)
137
+{
138
+ IMXUSBPHYState *s = IMX_USBPHY(dev);
139
+
140
+ s->usbphy[USBPHY_STATUS] = 0x00000000;
141
+ s->usbphy[USBPHY_DEBUG] = 0x7f180000;
142
+ s->usbphy[USBPHY_DEBUG0_STATUS] = 0x00000000;
143
+ s->usbphy[USBPHY_DEBUG1] = 0x00001000;
144
+ s->usbphy[USBPHY_VERSION] = 0x04020000;
145
+
146
+ imx_usbphy_softreset(s);
147
+}
148
+
149
+static uint64_t imx_usbphy_read(void *opaque, hwaddr offset, unsigned size)
150
+{
151
+ IMXUSBPHYState *s = (IMXUSBPHYState *)opaque;
152
+ uint32_t index = offset >> 2;
153
+ uint32_t value;
154
+
155
+ switch (index) {
156
+ case USBPHY_PWD_SET:
157
+ case USBPHY_TX_SET:
158
+ case USBPHY_RX_SET:
159
+ case USBPHY_CTRL_SET:
160
+ case USBPHY_DEBUG_SET:
161
+ case USBPHY_DEBUG1_SET:
162
+ /*
41
+ /*
163
+ * All REG_NAME_SET register access are in fact targeting the
42
+ * The security space for ptw reads is almost always the same
164
+ * REG_NAME register.
43
+ * as that of the security space of the stage 1 translation.
44
+ * The only exception is when stage 1 is Secure; in that case
45
+ * the ptw read might be to the Secure or the NonSecure space
46
+ * (but never Realm or Root), and the s2_mmu_idx tells us which.
47
+ * Root translations are always single-stage.
165
+ */
48
+ */
166
+ value = s->usbphy[index - 1];
49
+ if (s1_space == ARMSS_Secure) {
167
+ break;
50
+ return arm_secure_to_space(s2_mmu_idx == ARMMMUIdx_Stage2_S);
168
+ case USBPHY_PWD_CLR:
51
+ } else {
169
+ case USBPHY_TX_CLR:
52
+ assert(s2_mmu_idx != ARMMMUIdx_Stage2_S);
170
+ case USBPHY_RX_CLR:
53
+ assert(s1_space != ARMSS_Root);
171
+ case USBPHY_CTRL_CLR:
54
+ return s1_space;
172
+ case USBPHY_DEBUG_CLR:
173
+ case USBPHY_DEBUG1_CLR:
174
+ /*
175
+ * All REG_NAME_CLR register access are in fact targeting the
176
+ * REG_NAME register.
177
+ */
178
+ value = s->usbphy[index - 2];
179
+ break;
180
+ case USBPHY_PWD_TOG:
181
+ case USBPHY_TX_TOG:
182
+ case USBPHY_RX_TOG:
183
+ case USBPHY_CTRL_TOG:
184
+ case USBPHY_DEBUG_TOG:
185
+ case USBPHY_DEBUG1_TOG:
186
+ /*
187
+ * All REG_NAME_TOG register access are in fact targeting the
188
+ * REG_NAME register.
189
+ */
190
+ value = s->usbphy[index - 3];
191
+ break;
192
+ default:
193
+ value = s->usbphy[index];
194
+ break;
195
+ }
196
+ return (uint64_t)value;
197
+}
198
+
199
+static void imx_usbphy_write(void *opaque, hwaddr offset, uint64_t value,
200
+ unsigned size)
201
+{
202
+ IMXUSBPHYState *s = (IMXUSBPHYState *)opaque;
203
+ uint32_t index = offset >> 2;
204
+
205
+ switch (index) {
206
+ case USBPHY_CTRL:
207
+ s->usbphy[index] = value;
208
+ if (value & USBPHY_CTRL_SFTRST) {
209
+ imx_usbphy_softreset(s);
210
+ }
55
+ }
211
+ break;
56
+ } else {
212
+ case USBPHY_PWD:
57
+ /* ptw loads are from phys: the mmu idx itself says which space */
213
+ case USBPHY_TX:
58
+ return arm_phys_to_space(s2_mmu_idx);
214
+ case USBPHY_RX:
215
+ case USBPHY_STATUS:
216
+ case USBPHY_DEBUG:
217
+ case USBPHY_DEBUG1:
218
+ s->usbphy[index] = value;
219
+ break;
220
+ case USBPHY_CTRL_SET:
221
+ s->usbphy[index - 1] |= value;
222
+ if (value & USBPHY_CTRL_SFTRST) {
223
+ imx_usbphy_softreset(s);
224
+ }
225
+ break;
226
+ case USBPHY_PWD_SET:
227
+ case USBPHY_TX_SET:
228
+ case USBPHY_RX_SET:
229
+ case USBPHY_DEBUG_SET:
230
+ case USBPHY_DEBUG1_SET:
231
+ /*
232
+ * All REG_NAME_SET register access are in fact targeting the
233
+ * REG_NAME register. So we change the value of the REG_NAME
234
+ * register, setting bits passed in the value.
235
+ */
236
+ s->usbphy[index - 1] |= value;
237
+ break;
238
+ case USBPHY_PWD_CLR:
239
+ case USBPHY_TX_CLR:
240
+ case USBPHY_RX_CLR:
241
+ case USBPHY_CTRL_CLR:
242
+ case USBPHY_DEBUG_CLR:
243
+ case USBPHY_DEBUG1_CLR:
244
+ /*
245
+ * All REG_NAME_CLR register access are in fact targeting the
246
+ * REG_NAME register. So we change the value of the REG_NAME
247
+ * register, unsetting bits passed in the value.
248
+ */
249
+ s->usbphy[index - 2] &= ~value;
250
+ break;
251
+ case USBPHY_CTRL_TOG:
252
+ s->usbphy[index - 3] ^= value;
253
+ if ((value & USBPHY_CTRL_SFTRST) &&
254
+ (s->usbphy[index - 3] & USBPHY_CTRL_SFTRST)) {
255
+ imx_usbphy_softreset(s);
256
+ }
257
+ break;
258
+ case USBPHY_PWD_TOG:
259
+ case USBPHY_TX_TOG:
260
+ case USBPHY_RX_TOG:
261
+ case USBPHY_DEBUG_TOG:
262
+ case USBPHY_DEBUG1_TOG:
263
+ /*
264
+ * All REG_NAME_TOG register access are in fact targeting the
265
+ * REG_NAME register. So we change the value of the REG_NAME
266
+ * register, toggling bits passed in the value.
267
+ */
268
+ s->usbphy[index - 3] ^= value;
269
+ break;
270
+ default:
271
+ /* Other registers are read-only */
272
+ break;
273
+ }
59
+ }
274
+}
60
+}
275
+
61
+
276
+static const struct MemoryRegionOps imx_usbphy_ops = {
62
/* Translate a S1 pagetable walk through S2 if needed. */
277
+ .read = imx_usbphy_read,
63
static bool S1_ptw_translate(CPUARMState *env, S1Translate *ptw,
278
+ .write = imx_usbphy_write,
64
hwaddr addr, ARMMMUFaultInfo *fi)
279
+ .endianness = DEVICE_NATIVE_ENDIAN,
65
{
280
+ .valid = {
66
- ARMSecuritySpace space = ptw->in_space;
281
+ /*
67
bool is_secure = ptw->in_secure;
282
+ * Our device would not work correctly if the guest was doing
68
ARMMMUIdx mmu_idx = ptw->in_mmu_idx;
283
+ * unaligned access. This might not be a limitation on the real
69
ARMMMUIdx s2_mmu_idx = ptw->in_ptw_idx;
284
+ * device but in practice there is no reason for a guest to access
70
@@ -XXX,XX +XXX,XX @@ static bool S1_ptw_translate(CPUARMState *env, S1Translate *ptw,
285
+ * this device unaligned.
71
* From gdbstub, do not use softmmu so that we don't modify the
286
+ */
72
* state of the cpu at all, including softmmu tlb contents.
287
+ .min_access_size = 4,
73
*/
288
+ .max_access_size = 4,
74
+ ARMSecuritySpace s2_space = S2_security_space(ptw->in_space, s2_mmu_idx);
289
+ .unaligned = false,
75
S1Translate s2ptw = {
290
+ },
76
.in_mmu_idx = s2_mmu_idx,
291
+};
77
.in_ptw_idx = ptw_idx_for_stage_2(env, s2_mmu_idx),
292
+
78
- .in_secure = s2_mmu_idx == ARMMMUIdx_Stage2_S,
293
+static void imx_usbphy_realize(DeviceState *dev, Error **errp)
79
- .in_space = (s2_mmu_idx == ARMMMUIdx_Stage2_S ? ARMSS_Secure
294
+{
80
- : space == ARMSS_Realm ? ARMSS_Realm
295
+ IMXUSBPHYState *s = IMX_USBPHY(dev);
81
- : ARMSS_NonSecure),
296
+
82
+ .in_secure = arm_space_is_secure(s2_space),
297
+ memory_region_init_io(&s->iomem, OBJECT(s), &imx_usbphy_ops, s,
83
+ .in_space = s2_space,
298
+ "imx-usbphy", 0x1000);
84
.in_debug = true,
299
+ sysbus_init_mmio(SYS_BUS_DEVICE(s), &s->iomem);
85
};
300
+}
86
GetPhysAddrResult s2 = { };
301
+
302
+static void imx_usbphy_class_init(ObjectClass *klass, void *data)
303
+{
304
+ DeviceClass *dc = DEVICE_CLASS(klass);
305
+
306
+ dc->reset = imx_usbphy_reset;
307
+ dc->vmsd = &vmstate_imx_usbphy;
308
+ dc->desc = "i.MX USB PHY Module";
309
+ dc->realize = imx_usbphy_realize;
310
+}
311
+
312
+static const TypeInfo imx_usbphy_info = {
313
+ .name = TYPE_IMX_USBPHY,
314
+ .parent = TYPE_SYS_BUS_DEVICE,
315
+ .instance_size = sizeof(IMXUSBPHYState),
316
+ .class_init = imx_usbphy_class_init,
317
+};
318
+
319
+static void imx_usbphy_register_types(void)
320
+{
321
+ type_register_static(&imx_usbphy_info);
322
+}
323
+
324
+type_init(imx_usbphy_register_types)
325
diff --git a/MAINTAINERS b/MAINTAINERS
326
index XXXXXXX..XXXXXXX 100644
327
--- a/MAINTAINERS
328
+++ b/MAINTAINERS
329
@@ -XXX,XX +XXX,XX @@ F: hw/arm/sabrelite.c
330
F: hw/arm/fsl-imx6.c
331
F: hw/misc/imx6_*.c
332
F: hw/ssi/imx_spi.c
333
+F: hw/usb/imx-usb-phy.c
334
+F: include/hw/usb/imx-usb-phy.h
335
F: include/hw/arm/fsl-imx6.h
336
F: include/hw/misc/imx6_*.h
337
F: include/hw/ssi/imx_spi.h
338
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
339
index XXXXXXX..XXXXXXX 100644
340
--- a/hw/arm/Kconfig
341
+++ b/hw/arm/Kconfig
342
@@ -XXX,XX +XXX,XX @@ config FSL_IMX6
343
select IMX
344
select IMX_FEC
345
select IMX_I2C
346
+ select IMX_USBPHY
347
select SDHCI
348
349
config ASPEED_SOC
350
diff --git a/hw/usb/Kconfig b/hw/usb/Kconfig
351
index XXXXXXX..XXXXXXX 100644
352
--- a/hw/usb/Kconfig
353
+++ b/hw/usb/Kconfig
354
@@ -XXX,XX +XXX,XX @@ config USB_STORAGE_MTP
355
bool
356
default y
357
depends on USB
358
+
359
+config IMX_USBPHY
360
+ bool
361
+ default y
362
+ depends on USB
363
--
87
--
364
2.20.1
88
2.34.1
365
366
diff view generated by jsdifflib
Deleted patch
1
From: Guenter Roeck <linux@roeck-us.net>
2
1
3
USB1 and USB2 interrupt numbers were swapped. USB_PHY2 interrupt number
4
is 45. That didn't really matter up to now since the interrupts were not
5
used, but it needs to be fixed to be able to wire up the USB controllers.
6
7
Fixes: 31cbf933f0e ("i.MX6UL: Add i.MX6UL SOC")
8
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
9
Message-id: 20200313014551.12554-3-linux@roeck-us.net
10
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
11
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12
---
13
include/hw/arm/fsl-imx6ul.h | 6 +++---
14
1 file changed, 3 insertions(+), 3 deletions(-)
15
16
diff --git a/include/hw/arm/fsl-imx6ul.h b/include/hw/arm/fsl-imx6ul.h
17
index XXXXXXX..XXXXXXX 100644
18
--- a/include/hw/arm/fsl-imx6ul.h
19
+++ b/include/hw/arm/fsl-imx6ul.h
20
@@ -XXX,XX +XXX,XX @@ enum FslIMX6ULIRQs {
21
FSL_IMX6UL_UART7_IRQ = 39,
22
FSL_IMX6UL_UART8_IRQ = 40,
23
24
- FSL_IMX6UL_USB1_IRQ = 42,
25
- FSL_IMX6UL_USB2_IRQ = 43,
26
+ FSL_IMX6UL_USB1_IRQ = 43,
27
+ FSL_IMX6UL_USB2_IRQ = 42,
28
FSL_IMX6UL_USB_PHY1_IRQ = 44,
29
- FSL_IMX6UL_USB_PHY2_IRQ = 44,
30
+ FSL_IMX6UL_USB_PHY2_IRQ = 45,
31
32
FSL_IMX6UL_CAAM_JQ2_IRQ = 46,
33
FSL_IMX6UL_CAAM_ERR_IRQ = 47,
34
--
35
2.20.1
36
37
diff view generated by jsdifflib
Deleted patch
1
From: Guenter Roeck <linux@roeck-us.net>
2
1
3
Recent Linux kernels (post v4.20) crash due to accesses to flexcan
4
and pwm controllers. Instantiate as unimplemented devices to work
5
around the problem.
6
7
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8
Message-id: 20200313014551.12554-4-linux@roeck-us.net
9
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11
---
12
hw/arm/fsl-imx6ul.c | 14 ++++++++++++++
13
1 file changed, 14 insertions(+)
14
15
diff --git a/hw/arm/fsl-imx6ul.c b/hw/arm/fsl-imx6ul.c
16
index XXXXXXX..XXXXXXX 100644
17
--- a/hw/arm/fsl-imx6ul.c
18
+++ b/hw/arm/fsl-imx6ul.c
19
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
20
*/
21
create_unimplemented_device("sdma", FSL_IMX6UL_SDMA_ADDR, 0x4000);
22
23
+ /*
24
+ * PWM
25
+ */
26
+ create_unimplemented_device("pwm1", FSL_IMX6UL_PWM1_ADDR, 0x4000);
27
+ create_unimplemented_device("pwm2", FSL_IMX6UL_PWM2_ADDR, 0x4000);
28
+ create_unimplemented_device("pwm3", FSL_IMX6UL_PWM3_ADDR, 0x4000);
29
+ create_unimplemented_device("pwm4", FSL_IMX6UL_PWM4_ADDR, 0x4000);
30
+
31
+ /*
32
+ * CAN
33
+ */
34
+ create_unimplemented_device("can1", FSL_IMX6UL_CAN1_ADDR, 0x4000);
35
+ create_unimplemented_device("can2", FSL_IMX6UL_CAN2_ADDR, 0x4000);
36
+
37
/*
38
* APHB_DMA
39
*/
40
--
41
2.20.1
42
43
diff view generated by jsdifflib
Deleted patch
1
From: Guenter Roeck <linux@roeck-us.net>
2
1
3
IMX6UL USB controllers are quite similar to IMX7 USB controllers.
4
Wire them up the same way.
5
6
The only real difference is that wiring up phy devices is necessary
7
to avoid phy reset timeouts in the Linux kernel.
8
9
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
10
Message-id: 20200313014551.12554-5-linux@roeck-us.net
11
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
12
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13
---
14
include/hw/arm/fsl-imx6ul.h | 10 ++++++++++
15
hw/arm/fsl-imx6ul.c | 35 +++++++++++++++++++++++++++++++++++
16
2 files changed, 45 insertions(+)
17
18
diff --git a/include/hw/arm/fsl-imx6ul.h b/include/hw/arm/fsl-imx6ul.h
19
index XXXXXXX..XXXXXXX 100644
20
--- a/include/hw/arm/fsl-imx6ul.h
21
+++ b/include/hw/arm/fsl-imx6ul.h
22
@@ -XXX,XX +XXX,XX @@
23
#include "hw/sd/sdhci.h"
24
#include "hw/ssi/imx_spi.h"
25
#include "hw/net/imx_fec.h"
26
+#include "hw/usb/chipidea.h"
27
+#include "hw/usb/imx-usb-phy.h"
28
#include "exec/memory.h"
29
#include "cpu.h"
30
31
@@ -XXX,XX +XXX,XX @@ enum FslIMX6ULConfiguration {
32
FSL_IMX6UL_NUM_I2CS = 4,
33
FSL_IMX6UL_NUM_ECSPIS = 4,
34
FSL_IMX6UL_NUM_ADCS = 2,
35
+ FSL_IMX6UL_NUM_USB_PHYS = 2,
36
+ FSL_IMX6UL_NUM_USBS = 2,
37
};
38
39
typedef struct FslIMX6ULState {
40
@@ -XXX,XX +XXX,XX @@ typedef struct FslIMX6ULState {
41
IMXFECState eth[FSL_IMX6UL_NUM_ETHS];
42
SDHCIState usdhc[FSL_IMX6UL_NUM_USDHCS];
43
IMX2WdtState wdt[FSL_IMX6UL_NUM_WDTS];
44
+ IMXUSBPHYState usbphy[FSL_IMX6UL_NUM_USB_PHYS];
45
+ ChipideaState usb[FSL_IMX6UL_NUM_USBS];
46
MemoryRegion rom;
47
MemoryRegion caam;
48
MemoryRegion ocram;
49
@@ -XXX,XX +XXX,XX @@ enum FslIMX6ULMemoryMap {
50
FSL_IMX6UL_EPIT2_ADDR = 0x020D4000,
51
FSL_IMX6UL_EPIT1_ADDR = 0x020D0000,
52
FSL_IMX6UL_SNVS_HP_ADDR = 0x020CC000,
53
+ FSL_IMX6UL_USBPHY2_ADDR = 0x020CA000,
54
+ FSL_IMX6UL_USBPHY2_SIZE = (4 * 1024),
55
+ FSL_IMX6UL_USBPHY1_ADDR = 0x020C9000,
56
+ FSL_IMX6UL_USBPHY1_SIZE = (4 * 1024),
57
FSL_IMX6UL_ANALOG_ADDR = 0x020C8000,
58
FSL_IMX6UL_CCM_ADDR = 0x020C4000,
59
FSL_IMX6UL_WDOG2_ADDR = 0x020C0000,
60
diff --git a/hw/arm/fsl-imx6ul.c b/hw/arm/fsl-imx6ul.c
61
index XXXXXXX..XXXXXXX 100644
62
--- a/hw/arm/fsl-imx6ul.c
63
+++ b/hw/arm/fsl-imx6ul.c
64
@@ -XXX,XX +XXX,XX @@
65
#include "qapi/error.h"
66
#include "hw/arm/fsl-imx6ul.h"
67
#include "hw/misc/unimp.h"
68
+#include "hw/usb/imx-usb-phy.h"
69
#include "hw/boards.h"
70
#include "sysemu/sysemu.h"
71
#include "qemu/error-report.h"
72
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_init(Object *obj)
73
TYPE_IMX_ENET);
74
}
75
76
+ /* USB */
77
+ for (i = 0; i < FSL_IMX6UL_NUM_USB_PHYS; i++) {
78
+ snprintf(name, NAME_SIZE, "usbphy%d", i);
79
+ sysbus_init_child_obj(obj, name, &s->usbphy[i], sizeof(s->usbphy[i]),
80
+ TYPE_IMX_USBPHY);
81
+ }
82
+ for (i = 0; i < FSL_IMX6UL_NUM_USBS; i++) {
83
+ snprintf(name, NAME_SIZE, "usb%d", i);
84
+ sysbus_init_child_obj(obj, name, &s->usb[i], sizeof(s->usb[i]),
85
+ TYPE_CHIPIDEA);
86
+ }
87
+
88
/*
89
* SDHCI
90
*/
91
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
92
FSL_IMX6UL_ENETn_TIMER_IRQ[i]));
93
}
94
95
+ /* USB */
96
+ for (i = 0; i < FSL_IMX6UL_NUM_USB_PHYS; i++) {
97
+ object_property_set_bool(OBJECT(&s->usbphy[i]), true, "realized",
98
+ &error_abort);
99
+ sysbus_mmio_map(SYS_BUS_DEVICE(&s->usbphy[i]), 0,
100
+ FSL_IMX6UL_USBPHY1_ADDR + i * 0x1000);
101
+ }
102
+
103
+ for (i = 0; i < FSL_IMX6UL_NUM_USBS; i++) {
104
+ static const int FSL_IMX6UL_USBn_IRQ[] = {
105
+ FSL_IMX6UL_USB1_IRQ,
106
+ FSL_IMX6UL_USB2_IRQ,
107
+ };
108
+ object_property_set_bool(OBJECT(&s->usb[i]), true, "realized",
109
+ &error_abort);
110
+ sysbus_mmio_map(SYS_BUS_DEVICE(&s->usb[i]), 0,
111
+ FSL_IMX6UL_USBO2_USB_ADDR + i * 0x200);
112
+ sysbus_connect_irq(SYS_BUS_DEVICE(&s->usb[i]), 0,
113
+ qdev_get_gpio_in(DEVICE(&s->a7mpcore),
114
+ FSL_IMX6UL_USBn_IRQ[i]));
115
+ }
116
+
117
/*
118
* USDHC
119
*/
120
--
121
2.20.1
122
123
diff view generated by jsdifflib
Deleted patch
1
From: Guenter Roeck <linux@roeck-us.net>
2
1
3
With this patch, the USB controllers on 'sabrelite' are detected
4
and can be used to boot the system.
5
6
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7
Message-id: 20200313014551.12554-6-linux@roeck-us.net
8
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
9
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
---
11
include/hw/arm/fsl-imx6.h | 6 ++++++
12
hw/arm/fsl-imx6.c | 36 ++++++++++++++++++++++++++++++++++++
13
2 files changed, 42 insertions(+)
14
15
diff --git a/include/hw/arm/fsl-imx6.h b/include/hw/arm/fsl-imx6.h
16
index XXXXXXX..XXXXXXX 100644
17
--- a/include/hw/arm/fsl-imx6.h
18
+++ b/include/hw/arm/fsl-imx6.h
19
@@ -XXX,XX +XXX,XX @@
20
#include "hw/sd/sdhci.h"
21
#include "hw/ssi/imx_spi.h"
22
#include "hw/net/imx_fec.h"
23
+#include "hw/usb/chipidea.h"
24
+#include "hw/usb/imx-usb-phy.h"
25
#include "exec/memory.h"
26
#include "cpu.h"
27
28
@@ -XXX,XX +XXX,XX @@
29
#define FSL_IMX6_NUM_ESDHCS 4
30
#define FSL_IMX6_NUM_ECSPIS 5
31
#define FSL_IMX6_NUM_WDTS 2
32
+#define FSL_IMX6_NUM_USB_PHYS 2
33
+#define FSL_IMX6_NUM_USBS 4
34
35
typedef struct FslIMX6State {
36
/*< private >*/
37
@@ -XXX,XX +XXX,XX @@ typedef struct FslIMX6State {
38
SDHCIState esdhc[FSL_IMX6_NUM_ESDHCS];
39
IMXSPIState spi[FSL_IMX6_NUM_ECSPIS];
40
IMX2WdtState wdt[FSL_IMX6_NUM_WDTS];
41
+ IMXUSBPHYState usbphy[FSL_IMX6_NUM_USB_PHYS];
42
+ ChipideaState usb[FSL_IMX6_NUM_USBS];
43
IMXFECState eth;
44
MemoryRegion rom;
45
MemoryRegion caam;
46
diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c
47
index XXXXXXX..XXXXXXX 100644
48
--- a/hw/arm/fsl-imx6.c
49
+++ b/hw/arm/fsl-imx6.c
50
@@ -XXX,XX +XXX,XX @@
51
#include "qemu/osdep.h"
52
#include "qapi/error.h"
53
#include "hw/arm/fsl-imx6.h"
54
+#include "hw/usb/imx-usb-phy.h"
55
#include "hw/boards.h"
56
#include "hw/qdev-properties.h"
57
#include "sysemu/sysemu.h"
58
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6_init(Object *obj)
59
TYPE_IMX_USDHC);
60
}
61
62
+ for (i = 0; i < FSL_IMX6_NUM_USB_PHYS; i++) {
63
+ snprintf(name, NAME_SIZE, "usbphy%d", i);
64
+ sysbus_init_child_obj(obj, name, &s->usbphy[i], sizeof(s->usbphy[i]),
65
+ TYPE_IMX_USBPHY);
66
+ }
67
+ for (i = 0; i < FSL_IMX6_NUM_USBS; i++) {
68
+ snprintf(name, NAME_SIZE, "usb%d", i);
69
+ sysbus_init_child_obj(obj, name, &s->usb[i], sizeof(s->usb[i]),
70
+ TYPE_CHIPIDEA);
71
+ }
72
+
73
for (i = 0; i < FSL_IMX6_NUM_ECSPIS; i++) {
74
snprintf(name, NAME_SIZE, "spi%d", i + 1);
75
sysbus_init_child_obj(obj, name, &s->spi[i], sizeof(s->spi[i]),
76
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
77
esdhc_table[i].irq));
78
}
79
80
+ /* USB */
81
+ for (i = 0; i < FSL_IMX6_NUM_USB_PHYS; i++) {
82
+ object_property_set_bool(OBJECT(&s->usbphy[i]), true, "realized",
83
+ &error_abort);
84
+ sysbus_mmio_map(SYS_BUS_DEVICE(&s->usbphy[i]), 0,
85
+ FSL_IMX6_USBPHY1_ADDR + i * 0x1000);
86
+ }
87
+ for (i = 0; i < FSL_IMX6_NUM_USBS; i++) {
88
+ static const int FSL_IMX6_USBn_IRQ[] = {
89
+ FSL_IMX6_USB_OTG_IRQ,
90
+ FSL_IMX6_USB_HOST1_IRQ,
91
+ FSL_IMX6_USB_HOST2_IRQ,
92
+ FSL_IMX6_USB_HOST3_IRQ,
93
+ };
94
+
95
+ object_property_set_bool(OBJECT(&s->usb[i]), true, "realized",
96
+ &error_abort);
97
+ sysbus_mmio_map(SYS_BUS_DEVICE(&s->usb[i]), 0,
98
+ FSL_IMX6_USBOH3_USB_ADDR + i * 0x200);
99
+ sysbus_connect_irq(SYS_BUS_DEVICE(&s->usb[i]), 0,
100
+ qdev_get_gpio_in(DEVICE(&s->a9mpcore),
101
+ FSL_IMX6_USBn_IRQ[i]));
102
+ }
103
+
104
/* Initialize all ECSPI */
105
for (i = 0; i < FSL_IMX6_NUM_ECSPIS; i++) {
106
static const struct {
107
--
108
2.20.1
109
110
diff view generated by jsdifflib
1
From: Chen Qun <kuhn.chenqun@huawei.com>
1
In get_phys_addr_twostage() the code that applies the effects of
2
VSTCR.{SA,SW} and VTCR.{NSA,NSW} only updates result->f.attrs.secure.
3
Now we also have f.attrs.space for FEAT_RME, we need to keep the two
4
in sync.
2
5
3
The current code causes clang static code analyzer generate warning:
6
These bits only have an effect for Secure space translations, not
4
hw/net/imx_fec.c:858:9: warning: Value stored to 'value' is never read
7
for Root, so use the input in_space field to determine whether to
5
value = value & 0x0000000f;
8
apply them rather than the input is_secure. This doesn't actually
6
^ ~~~~~~~~~~~~~~~~~~
9
make a difference because Root translations are never two-stage,
7
hw/net/imx_fec.c:864:9: warning: Value stored to 'value' is never read
10
but it's a little clearer.
8
value = value & 0x000000fd;
9
^ ~~~~~~~~~~~~~~~~~~
10
11
11
According to the definition of the function, the two “value” assignments
12
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12
should be written to registers.
13
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
14
Message-id: 20230710152130.3928330-4-peter.maydell@linaro.org
15
---
16
target/arm/ptw.c | 13 ++++++++-----
17
1 file changed, 8 insertions(+), 5 deletions(-)
13
18
14
Reported-by: Euler Robot <euler.robot@huawei.com>
19
diff --git a/target/arm/ptw.c b/target/arm/ptw.c
15
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
16
Message-id: 20200313123242.13236-1-kuhn.chenqun@huawei.com
17
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
18
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
19
---
20
hw/net/imx_fec.c | 6 ++++--
21
1 file changed, 4 insertions(+), 2 deletions(-)
22
23
diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c
24
index XXXXXXX..XXXXXXX 100644
20
index XXXXXXX..XXXXXXX 100644
25
--- a/hw/net/imx_fec.c
21
--- a/target/arm/ptw.c
26
+++ b/hw/net/imx_fec.c
22
+++ b/target/arm/ptw.c
27
@@ -XXX,XX +XXX,XX @@ static void imx_enet_write(IMXFECState *s, uint32_t index, uint32_t value)
23
@@ -XXX,XX +XXX,XX @@ static bool get_phys_addr_twostage(CPUARMState *env, S1Translate *ptw,
28
break;
24
hwaddr ipa;
29
case ENET_TGSR:
25
int s1_prot, s1_lgpgsz;
30
/* implement clear timer flag */
26
bool is_secure = ptw->in_secure;
31
- value = value & 0x0000000f;
27
+ ARMSecuritySpace in_space = ptw->in_space;
32
+ s->regs[index] &= ~(value & 0x0000000f); /* all bits W1C */
28
bool ret, ipa_secure;
33
break;
29
ARMCacheAttrs cacheattrs1;
34
case ENET_TCSR0:
30
ARMSecuritySpace ipa_space;
35
case ENET_TCSR1:
31
@@ -XXX,XX +XXX,XX @@ static bool get_phys_addr_twostage(CPUARMState *env, S1Translate *ptw,
36
case ENET_TCSR2:
32
* Check if IPA translates to secure or non-secure PA space.
37
case ENET_TCSR3:
33
* Note that VSTCR overrides VTCR and {N}SW overrides {N}SA.
38
- value = value & 0x000000fd;
34
*/
39
+ s->regs[index] &= ~(value & 0x00000080); /* W1C bits */
35
- result->f.attrs.secure =
40
+ s->regs[index] &= ~0x0000007d; /* writable fields */
36
- (is_secure
41
+ s->regs[index] |= (value & 0x0000007d);
37
- && !(env->cp15.vstcr_el2 & (VSTCR_SA | VSTCR_SW))
42
break;
38
- && (ipa_secure
43
case ENET_TCCR0:
39
- || !(env->cp15.vtcr_el2 & (VTCR_NSA | VTCR_NSW))));
44
case ENET_TCCR1:
40
+ if (in_space == ARMSS_Secure) {
41
+ result->f.attrs.secure =
42
+ !(env->cp15.vstcr_el2 & (VSTCR_SA | VSTCR_SW))
43
+ && (ipa_secure
44
+ || !(env->cp15.vtcr_el2 & (VTCR_NSA | VTCR_NSW)));
45
+ result->f.attrs.space = arm_secure_to_space(result->f.attrs.secure);
46
+ }
47
48
return false;
49
}
45
--
50
--
46
2.20.1
51
2.34.1
47
48
diff view generated by jsdifflib
1
From: Guenter Roeck <linux@roeck-us.net>
1
In commit f0a08b0913befbd we changed the type of the PC from
2
target_ulong to vaddr. In doing so we inadvertently dropped the
3
zero-padding on the PC in trace lines (the second item inside the []
4
in these lines). They used to look like this on AArch64, for
5
instance:
2
6
3
Whenever an unsupported command is encountered, the current code
7
Trace 0: 0x7f2260000100 [00000000/0000000040000000/00000061/ff200000]
4
interprets each transferred byte as new command. Most of the time, those
5
'commands' are interpreted as new unknown commands. However, in rare
6
cases, it may be that for example address or length information
7
passed with the original command is by itself a valid command.
8
If that happens, the state machine may get completely confused and,
9
worst case, start writing data into the flash or even erase it.
10
8
11
To avoid the problem, transition into STATE_READING_DATA and keep
9
and now they look like this:
12
sending a value of 0 until the chip is deselected after encountering
10
Trace 0: 0x7f4f50000100 [00000000/40000000/00000061/ff200000]
13
an unsupported command.
14
11
15
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12
and if the PC happens to be somewhere low like 0x5000
16
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
13
then the field is shown as /5000/.
17
Reviewed-by: Cédric Le Goater <clg@kaod.org>
14
15
This is because TARGET_FMT_lx is a "%08x" or "%016x" specifier,
16
depending on TARGET_LONG_SIZE, whereas VADDR_PRIx is just PRIx64
17
with no width specifier.
18
19
Restore the zero-padding by adding an 016 width specifier to
20
this tracing and a couple of others that were similarly recently
21
changed to use VADDR_PRIx without a width specifier.
22
23
We can't unfortunately restore the "32-bit guests are padded to
24
8 hex digits and 64-bit guests to 16 hex digits" behaviour so
25
easily.
26
27
Fixes: f0a08b0913befbd ("accel/tcg/cpu-exec.c: Widen pc to vaddr")
18
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
28
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
29
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
30
Reviewed-by: Anton Johansson <anjo@rev.ng>
31
Message-id: 20230711165434.4123674-1-peter.maydell@linaro.org
19
---
32
---
20
hw/block/m25p80.c | 5 +++++
33
accel/tcg/cpu-exec.c | 4 ++--
21
1 file changed, 5 insertions(+)
34
accel/tcg/translate-all.c | 2 +-
35
2 files changed, 3 insertions(+), 3 deletions(-)
22
36
23
diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
37
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
24
index XXXXXXX..XXXXXXX 100644
38
index XXXXXXX..XXXXXXX 100644
25
--- a/hw/block/m25p80.c
39
--- a/accel/tcg/cpu-exec.c
26
+++ b/hw/block/m25p80.c
40
+++ b/accel/tcg/cpu-exec.c
27
@@ -XXX,XX +XXX,XX @@ static void decode_new_cmd(Flash *s, uint32_t value)
41
@@ -XXX,XX +XXX,XX @@ static void log_cpu_exec(vaddr pc, CPUState *cpu,
28
s->quad_enable = false;
42
if (qemu_log_in_addr_range(pc)) {
29
break;
43
qemu_log_mask(CPU_LOG_EXEC,
30
default:
44
"Trace %d: %p [%08" PRIx64
31
+ s->pos = 0;
45
- "/%" VADDR_PRIx "/%08x/%08x] %s\n",
32
+ s->len = 1;
46
+ "/%016" VADDR_PRIx "/%08x/%08x] %s\n",
33
+ s->state = STATE_READING_DATA;
47
cpu->cpu_index, tb->tc.ptr, tb->cs_base, pc,
34
+ s->data_read_loop = true;
48
tb->flags, tb->cflags, lookup_symbol(pc));
35
+ s->data[0] = 0;
49
36
qemu_log_mask(LOG_GUEST_ERROR, "M25P80: Unknown cmd %x\n", value);
50
@@ -XXX,XX +XXX,XX @@ cpu_tb_exec(CPUState *cpu, TranslationBlock *itb, int *tb_exit)
37
break;
51
if (qemu_loglevel_mask(CPU_LOG_EXEC)) {
52
vaddr pc = log_pc(cpu, last_tb);
53
if (qemu_log_in_addr_range(pc)) {
54
- qemu_log("Stopped execution of TB chain before %p [%"
55
+ qemu_log("Stopped execution of TB chain before %p [%016"
56
VADDR_PRIx "] %s\n",
57
last_tb->tc.ptr, pc, lookup_symbol(pc));
58
}
59
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
60
index XXXXXXX..XXXXXXX 100644
61
--- a/accel/tcg/translate-all.c
62
+++ b/accel/tcg/translate-all.c
63
@@ -XXX,XX +XXX,XX @@ void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr)
64
if (qemu_loglevel_mask(CPU_LOG_EXEC)) {
65
vaddr pc = log_pc(cpu, tb);
66
if (qemu_log_in_addr_range(pc)) {
67
- qemu_log("cpu_io_recompile: rewound execution of TB to %"
68
+ qemu_log("cpu_io_recompile: rewound execution of TB to %016"
69
VADDR_PRIx "\n", pc);
70
}
38
}
71
}
39
--
72
--
40
2.20.1
73
2.34.1
41
74
42
75
diff view generated by jsdifflib
1
From: Guenter Roeck <linux@roeck-us.net>
1
From: Tong Ho <tong.ho@amd.com>
2
2
3
While at it, add some trace messages to help debug problems
3
Add a check in the bit-set operation to write the backstore
4
seen when running the latest Linux kernel.
4
only if the affected bit is 0 before.
5
5
6
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
6
With this in place, there will be no need for callers to
7
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
7
do the checking in order to avoid unnecessary writes.
8
9
Signed-off-by: Tong Ho <tong.ho@amd.com>
8
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
10
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
9
Reviewed-by: Cédric Le Goater <clg@kaod.org>
11
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
12
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11
---
14
---
12
hw/block/m25p80.c | 48 ++++++++++++++++++++-----------------------
15
hw/nvram/xlnx-efuse.c | 11 +++++++++--
13
hw/block/trace-events | 16 +++++++++++++++
16
1 file changed, 9 insertions(+), 2 deletions(-)
14
2 files changed, 38 insertions(+), 26 deletions(-)
15
17
16
diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
18
diff --git a/hw/nvram/xlnx-efuse.c b/hw/nvram/xlnx-efuse.c
17
index XXXXXXX..XXXXXXX 100644
19
index XXXXXXX..XXXXXXX 100644
18
--- a/hw/block/m25p80.c
20
--- a/hw/nvram/xlnx-efuse.c
19
+++ b/hw/block/m25p80.c
21
+++ b/hw/nvram/xlnx-efuse.c
20
@@ -XXX,XX +XXX,XX @@
22
@@ -XXX,XX +XXX,XX @@ static bool efuse_ro_bits_find(XlnxEFuse *s, uint32_t k)
21
#include "qemu/module.h"
23
22
#include "qemu/error-report.h"
24
bool xlnx_efuse_set_bit(XlnxEFuse *s, unsigned int bit)
23
#include "qapi/error.h"
25
{
24
-
26
+ uint32_t set, *row;
25
-#ifndef M25P80_ERR_DEBUG
27
+
26
-#define M25P80_ERR_DEBUG 0
28
if (efuse_ro_bits_find(s, bit)) {
27
-#endif
29
g_autofree char *path = object_get_canonical_path(OBJECT(s));
28
-
30
29
-#define DB_PRINT_L(level, ...) do { \
31
@@ -XXX,XX +XXX,XX @@ bool xlnx_efuse_set_bit(XlnxEFuse *s, unsigned int bit)
30
- if (M25P80_ERR_DEBUG > (level)) { \
32
return false;
31
- fprintf(stderr, ": %s: ", __func__); \
32
- fprintf(stderr, ## __VA_ARGS__); \
33
- } \
34
-} while (0)
35
+#include "trace.h"
36
37
/* Fields for FlashPartInfo->flags */
38
39
@@ -XXX,XX +XXX,XX @@ static void flash_erase(Flash *s, int offset, FlashCMD cmd)
40
abort();
41
}
33
}
42
34
43
- DB_PRINT_L(0, "offset = %#x, len = %d\n", offset, len);
35
- s->fuse32[bit / 32] |= 1 << (bit % 32);
44
+ trace_m25p80_flash_erase(s, offset, len);
36
- efuse_bdrv_sync(s, bit);
45
+
37
+ /* Avoid back-end write unless there is a real update */
46
if ((s->pi->flags & capa_to_assert) != capa_to_assert) {
38
+ row = &s->fuse32[bit / 32];
47
qemu_log_mask(LOG_GUEST_ERROR, "M25P80: %d erase size not supported by"
39
+ set = 1 << (bit % 32);
48
" device\n", len);
40
+ if (!(set & *row)) {
49
@@ -XXX,XX +XXX,XX @@ void flash_write8(Flash *s, uint32_t addr, uint8_t data)
41
+ *row |= set;
50
}
42
+ efuse_bdrv_sync(s, bit);
51
43
+ }
52
if ((prev ^ data) & data) {
44
return true;
53
- DB_PRINT_L(1, "programming zero to one! addr=%" PRIx32 " %" PRIx8
54
- " -> %" PRIx8 "\n", addr, prev, data);
55
+ trace_m25p80_programming_zero_to_one(s, addr, prev, data);
56
}
57
58
if (s->pi->flags & EEPROM) {
59
@@ -XXX,XX +XXX,XX @@ static void complete_collecting_data(Flash *s)
60
61
s->state = STATE_IDLE;
62
63
+ trace_m25p80_complete_collecting(s, s->cmd_in_progress, n, s->ear,
64
+ s->cur_addr);
65
+
66
switch (s->cmd_in_progress) {
67
case DPP:
68
case QPP:
69
@@ -XXX,XX +XXX,XX @@ static void reset_memory(Flash *s)
70
break;
71
}
72
73
- DB_PRINT_L(0, "Reset done.\n");
74
+ trace_m25p80_reset_done(s);
75
}
45
}
76
46
77
static void decode_fast_read_cmd(Flash *s)
78
@@ -XXX,XX +XXX,XX @@ static void decode_qio_read_cmd(Flash *s)
79
80
static void decode_new_cmd(Flash *s, uint32_t value)
81
{
82
- s->cmd_in_progress = value;
83
int i;
84
- DB_PRINT_L(0, "decoded new command:%x\n", value);
85
+
86
+ s->cmd_in_progress = value;
87
+ trace_m25p80_command_decoded(s, value);
88
89
if (value != RESET_MEMORY) {
90
s->reset_enable = false;
91
@@ -XXX,XX +XXX,XX @@ static void decode_new_cmd(Flash *s, uint32_t value)
92
break;
93
94
case JEDEC_READ:
95
- DB_PRINT_L(0, "populated jedec code\n");
96
+ trace_m25p80_populated_jedec(s);
97
for (i = 0; i < s->pi->id_len; i++) {
98
s->data[i] = s->pi->id[i];
99
}
100
@@ -XXX,XX +XXX,XX @@ static void decode_new_cmd(Flash *s, uint32_t value)
101
case BULK_ERASE_60:
102
case BULK_ERASE:
103
if (s->write_enable) {
104
- DB_PRINT_L(0, "chip erase\n");
105
+ trace_m25p80_chip_erase(s);
106
flash_erase(s, 0, BULK_ERASE);
107
} else {
108
qemu_log_mask(LOG_GUEST_ERROR, "M25P80: chip erase with write "
109
@@ -XXX,XX +XXX,XX @@ static int m25p80_cs(SSISlave *ss, bool select)
110
s->data_read_loop = false;
111
}
112
113
- DB_PRINT_L(0, "%sselect\n", select ? "de" : "");
114
+ trace_m25p80_select(s, select ? "de" : "");
115
116
return 0;
117
}
118
@@ -XXX,XX +XXX,XX @@ static uint32_t m25p80_transfer8(SSISlave *ss, uint32_t tx)
119
Flash *s = M25P80(ss);
120
uint32_t r = 0;
121
122
+ trace_m25p80_transfer(s, s->state, s->len, s->needed_bytes, s->pos,
123
+ s->cur_addr, (uint8_t)tx);
124
+
125
switch (s->state) {
126
127
case STATE_PAGE_PROGRAM:
128
- DB_PRINT_L(1, "page program cur_addr=%#" PRIx32 " data=%" PRIx8 "\n",
129
- s->cur_addr, (uint8_t)tx);
130
+ trace_m25p80_page_program(s, s->cur_addr, (uint8_t)tx);
131
flash_write8(s, s->cur_addr, (uint8_t)tx);
132
s->cur_addr = (s->cur_addr + 1) & (s->size - 1);
133
break;
134
135
case STATE_READ:
136
r = s->storage[s->cur_addr];
137
- DB_PRINT_L(1, "READ 0x%" PRIx32 "=%" PRIx8 "\n", s->cur_addr,
138
- (uint8_t)r);
139
+ trace_m25p80_read_byte(s, s->cur_addr, (uint8_t)r);
140
s->cur_addr = (s->cur_addr + 1) & (s->size - 1);
141
break;
142
143
@@ -XXX,XX +XXX,XX @@ static uint32_t m25p80_transfer8(SSISlave *ss, uint32_t tx)
144
}
145
146
r = s->data[s->pos];
147
+ trace_m25p80_read_data(s, s->pos, (uint8_t)r);
148
s->pos++;
149
if (s->pos == s->len) {
150
s->pos = 0;
151
@@ -XXX,XX +XXX,XX @@ static void m25p80_realize(SSISlave *ss, Error **errp)
152
return;
153
}
154
155
- DB_PRINT_L(0, "Binding to IF_MTD drive\n");
156
+ trace_m25p80_binding(s);
157
s->storage = blk_blockalign(s->blk, s->size);
158
159
if (blk_pread(s->blk, 0, s->storage, s->size) != s->size) {
160
@@ -XXX,XX +XXX,XX @@ static void m25p80_realize(SSISlave *ss, Error **errp)
161
return;
162
}
163
} else {
164
- DB_PRINT_L(0, "No BDRV - binding to RAM\n");
165
+ trace_m25p80_binding_no_bdrv(s);
166
s->storage = blk_blockalign(NULL, s->size);
167
memset(s->storage, 0xFF, s->size);
168
}
169
diff --git a/hw/block/trace-events b/hw/block/trace-events
170
index XXXXXXX..XXXXXXX 100644
171
--- a/hw/block/trace-events
172
+++ b/hw/block/trace-events
173
@@ -XXX,XX +XXX,XX @@ xen_block_blockdev_add(char *str) "%s"
174
xen_block_blockdev_del(const char *node_name) "%s"
175
xen_block_device_create(unsigned int number) "%u"
176
xen_block_device_destroy(unsigned int number) "%u"
177
+
178
+# m25p80.c
179
+m25p80_flash_erase(void *s, int offset, uint32_t len) "[%p] offset = 0x%"PRIx32", len = %u"
180
+m25p80_programming_zero_to_one(void *s, uint32_t addr, uint8_t prev, uint8_t data) "[%p] programming zero to one! addr=0x%"PRIx32" 0x%"PRIx8" -> 0x%"PRIx8
181
+m25p80_reset_done(void *s) "[%p] Reset done."
182
+m25p80_command_decoded(void *s, uint32_t cmd) "[%p] new command:0x%"PRIx32
183
+m25p80_complete_collecting(void *s, uint32_t cmd, int n, uint8_t ear, uint32_t cur_addr) "[%p] decode cmd: 0x%"PRIx32" len %d ear 0x%"PRIx8" addr 0x%"PRIx32
184
+m25p80_populated_jedec(void *s) "[%p] populated jedec code"
185
+m25p80_chip_erase(void *s) "[%p] chip erase"
186
+m25p80_select(void *s, const char *what) "[%p] %sselect"
187
+m25p80_page_program(void *s, uint32_t addr, uint8_t tx) "[%p] page program cur_addr=0x%"PRIx32" data=0x%"PRIx8
188
+m25p80_transfer(void *s, uint8_t state, uint32_t len, uint8_t needed, uint32_t pos, uint32_t cur_addr, uint8_t t) "[%p] Transfer state 0x%"PRIx8" len 0x%"PRIx32" needed 0x%"PRIx8" pos 0x%"PRIx32" addr 0x%"PRIx32" tx 0x%"PRIx8
189
+m25p80_read_byte(void *s, uint32_t addr, uint8_t v) "[%p] Read byte 0x%"PRIx32"=0x%"PRIx8
190
+m25p80_read_data(void *s, uint32_t pos, uint8_t v) "[%p] Read data 0x%"PRIx32"=0x%"PRIx8
191
+m25p80_binding(void *s) "[%p] Binding to IF_MTD drive"
192
+m25p80_binding_no_bdrv(void *s) "[%p] No BDRV - binding to RAM"
193
--
47
--
194
2.20.1
48
2.34.1
195
49
196
50
diff view generated by jsdifflib