1
The following changes since commit de39a045bd8d2b49e4f3d07976622c29d58e0bac:
1
The following changes since commit d9a4282c4b690e45d25c2b933f318bb41eeb271d:
2
2
3
Merge remote-tracking branch 'remotes/kraxel/tags/vga-20200915-pull-request' into staging (2020-09-15 14:25:05 +0100)
3
Merge tag 'pull-tcg-20250308' of https://gitlab.com/rth7680/qemu into staging (2025-03-09 11:45:00 +0800)
4
4
5
are available in the Git repository at:
5
are available in the Git repository at:
6
6
7
https://github.com/legoater/qemu/ tags/pull-aspeed-20200918
7
https://github.com/legoater/qemu/ tags/pull-aspeed-20250309
8
8
9
for you to fetch changes up to 204dab83fe00a3e0781d93ad7899192a9409e987:
9
for you to fetch changes up to 5ab179db11ca297c9e89a6d57f954d31965cbd7b:
10
10
11
misc: aspeed_scu: Update AST2600 silicon id register (2020-09-18 09:04:36 +0200)
11
docs/specs: Add aspeed-intc (2025-03-09 14:36:53 +0100)
12
12
13
----------------------------------------------------------------
13
----------------------------------------------------------------
14
Aspeed patches :
14
aspeed queue:
15
15
16
* Couple of cleanups
16
* Updated Aspeed OpenBMC functional test images
17
* New machine properties to define the flash models
17
* Introduced functional tests for witherspoon and bletchley machines
18
* Added support for Non-maskable Interrupt on AST2700 SoC
19
* Fixed HW strapping on AST2700 SoC
20
* Added AST2700 HACE support
21
* Added AST2700 A1 SoC support
22
* Intoduced new ast2700a1-evb machine
18
23
19
----------------------------------------------------------------
24
----------------------------------------------------------------
20
Cédric Le Goater (1):
25
Cédric Le Goater (6):
21
hw/arm/aspeed: Add machine properties to define the flash models
26
tests/functional: Introduce a new test routine for OpenBMC images
27
tests/functional: Update OpenBMC image of palmetto machine
28
tests/functional: Update OpenBMC image of romulus machine
29
tests/functional: Introduce a witherspoon machine test
30
tests/functional: Introduce a bletchley machine test
31
aspeed: Remove duplicate typename in AspeedSoCClass
22
32
23
Joel Stanley (1):
33
Jamin Lin (40):
24
misc: aspeed_scu: Update AST2600 silicon id register
34
aspeed/soc: Support Non-maskable Interrupt for AST2700
35
hw/misc/aspeed_hace: Fix coding style
36
hw/misc/aspeed_hace: Add AST2700 support
37
hw/arm/aspeed_ast27x0: Add HACE support for AST2700
38
hw/misc/aspeed_hace: Fix boot issue in the Crypto Manager Self Test
39
hw/misc/aspeed_scu: Skipping dram_init in u-boot
40
hw/misc/aspeed_scu: Fix the revision ID cannot be set in the SOC layer for AST2700
41
hw/arm/aspeed Update HW Strap Default Values for AST2700
42
hw/misc/aspeed_scu: Fix the hw-strap1 cannot be set in the SOC layer for AST2700
43
hw/arm/aspeed_ast27x0.c Separate HW Strap Registers for SCU and SCUIO
44
hw/arm/aspeed_ast27x0.c Fix boot issue for AST2700
45
hw/intc/aspeed: Support setting different memory size
46
hw/intc/aspeed: Rename status_addr and addr to status_reg and reg for clarity
47
hw/intc/aspeed: Introduce dynamic allocation for regs array
48
hw/intc/aspeed: Support setting different register size
49
hw/intc/aspeed: Reduce regs array size by adding a register sub-region
50
hw/intc/aspeed: Introduce helper functions for enable and status registers
51
hw/intc/aspeed: Add object type name to trace events for better debugging
52
hw/arm/aspeed: Rename IRQ table and machine name for AST2700 A0
53
hw/arm/aspeed_ast27x0: Sort the IRQ table by IRQ number
54
hw/intc/aspeed: Support different memory region ops
55
hw/intc/aspeed: Rename num_ints to num_inpins for clarity
56
hw/intc/aspeed: Add support for multiple output pins in INTC
57
hw/intc/aspeed: Refactor INTC to support separate input and output pin indices
58
hw/intc/aspeed: Introduce AspeedINTCIRQ structure to save the irq index and register address
59
hw/intc/aspeed: Introduce IRQ handler function to reduce code duplication
60
hw/intc/aspeed: Add Support for Multi-Output IRQ Handling
61
hw/intc/aspeed: Add Support for AST2700 INTCIO Controller
62
hw/misc/aspeed_scu: Add Support for AST2700/AST2750 A1 Silicon Revisions
63
hw/arm/aspeed_ast27x0.c Support AST2700 A1 GIC Interrupt Mapping
64
hw/arm/aspeed_ast27x0: Define an Array of AspeedINTCState with Two Instances
65
hw/arm/aspeed_ast27x0: Support two levels of INTC controllers for AST2700 A1
66
hw/arm/aspeed_ast27x0: Add SoC Support for AST2700 A1
67
hw/arm/aspeed: Add Machine Support for AST2700 A1
68
hw/arm/aspeed_ast27x0: Sort the memmap table by mapping address
69
tests/functional/aspeed: Introduce start_ast2700_test API
70
tests/functional/aspeed: Update temperature hwmon path
71
tests/functional/aspeed: Update test ASPEED SDK v09.05
72
tests/functional/aspeed: Add test case for AST2700 A1
73
docs/specs: Add aspeed-intc
25
74
26
Philippe Mathieu-Daudé (1):
75
docs/specs/aspeed-intc.rst | 136 +++++
27
hw/arm/aspeed: Map the UART5 device unconditionally
76
docs/specs/index.rst | 1 +
77
include/hw/arm/aspeed_soc.h | 4 +-
78
include/hw/intc/aspeed_intc.h | 36 +-
79
include/hw/misc/aspeed_hace.h | 2 +
80
include/hw/misc/aspeed_scu.h | 2 +
81
hw/arm/aspeed.c | 39 +-
82
hw/arm/aspeed_ast10x0.c | 3 +-
83
hw/arm/aspeed_ast2400.c | 4 +-
84
hw/arm/aspeed_ast2600.c | 3 +-
85
hw/arm/aspeed_ast27x0.c | 359 +++++++++----
86
hw/intc/aspeed_intc.c | 667 ++++++++++++++++++------
87
hw/misc/aspeed_hace.c | 55 +-
88
hw/misc/aspeed_scu.c | 10 +-
89
hw/intc/trace-events | 25 +-
90
tests/functional/aspeed.py | 24 +-
91
tests/functional/meson.build | 4 +
92
tests/functional/test_aarch64_aspeed.py | 47 +-
93
tests/functional/test_arm_aspeed_bletchley.py | 25 +
94
tests/functional/test_arm_aspeed_palmetto.py | 13 +-
95
tests/functional/test_arm_aspeed_romulus.py | 13 +-
96
tests/functional/test_arm_aspeed_witherspoon.py | 25 +
97
22 files changed, 1150 insertions(+), 347 deletions(-)
98
create mode 100644 docs/specs/aspeed-intc.rst
99
create mode 100644 tests/functional/test_arm_aspeed_bletchley.py
100
create mode 100644 tests/functional/test_arm_aspeed_witherspoon.py
28
101
29
docs/system/arm/aspeed.rst | 18 ++++++++++++++++++
30
hw/arm/aspeed.c | 45 +++++++++++++++++++++++++++++++++++++++++++--
31
hw/arm/aspeed_ast2600.c | 8 +++-----
32
hw/arm/aspeed_soc.c | 8 +++-----
33
hw/misc/aspeed_scu.c | 7 ++++++-
34
5 files changed, 73 insertions(+), 13 deletions(-)
35
102
diff view generated by jsdifflib
New patch
1
The OpenBMC images currently used by QEMU to test the Aspeed machines
2
are rather old. To prepare an update to the latest builds, we need to
3
adjust the console patterns. Introduce a new routine to preserve the
4
current tests.
1
5
6
Reviewed-by: Thomas Huth <thuth@redhat.com>
7
Link: https://lore.kernel.org/qemu-devel/20250129071820.1258133-2-clg@redhat.com
8
Signed-off-by: Cédric Le Goater <clg@redhat.com>
9
---
10
tests/functional/aspeed.py | 18 ++++++++++++++++++
11
1 file changed, 18 insertions(+)
12
13
diff --git a/tests/functional/aspeed.py b/tests/functional/aspeed.py
14
index XXXXXXX..XXXXXXX 100644
15
--- a/tests/functional/aspeed.py
16
+++ b/tests/functional/aspeed.py
17
@@ -XXX,XX +XXX,XX @@ def do_test_arm_aspeed(self, machine, image):
18
self.wait_for_console_pattern("ftgmac100 1e660000.ethernet eth0: irq ")
19
self.wait_for_console_pattern("systemd[1]: Set hostname to")
20
21
+ def do_test_arm_aspeed_openbmc(self, machine, image, uboot='2019.04',
22
+ cpu_id='0x0', soc='AST2500 rev A1'):
23
+ hostname = machine.removesuffix('-bmc')
24
+
25
+ self.set_machine(machine)
26
+ self.vm.set_console()
27
+ self.vm.add_args('-drive', f'file={image},if=mtd,format=raw',
28
+ '-snapshot')
29
+ self.vm.launch()
30
+
31
+ self.wait_for_console_pattern(f'U-Boot {uboot}')
32
+ self.wait_for_console_pattern('## Loading kernel from FIT Image')
33
+ self.wait_for_console_pattern('Starting kernel ...')
34
+ self.wait_for_console_pattern(f'Booting Linux on physical CPU {cpu_id}')
35
+ self.wait_for_console_pattern(f'ASPEED {soc}')
36
+ self.wait_for_console_pattern('/init as init process')
37
+ self.wait_for_console_pattern(f'systemd[1]: Hostname set to <{hostname}>.')
38
+
39
def do_test_arm_aspeed_buildroot_start(self, image, cpu_id, pattern='Aspeed EVB'):
40
self.require_netdev('user')
41
self.vm.set_console()
42
--
43
2.48.1
44
45
diff view generated by jsdifflib
New patch
1
Use the new do_test_arm_aspeed_openbmc() routine to run the latest
2
OpenBMC firmware build of the palmetto BMC.
1
3
4
Reviewed-by: Thomas Huth <thuth@redhat.com>
5
Link: https://lore.kernel.org/qemu-devel/20250129071820.1258133-3-clg@redhat.com
6
Signed-off-by: Cédric Le Goater <clg@redhat.com>
7
---
8
tests/functional/test_arm_aspeed_palmetto.py | 13 +++++++------
9
1 file changed, 7 insertions(+), 6 deletions(-)
10
11
diff --git a/tests/functional/test_arm_aspeed_palmetto.py b/tests/functional/test_arm_aspeed_palmetto.py
12
index XXXXXXX..XXXXXXX 100755
13
--- a/tests/functional/test_arm_aspeed_palmetto.py
14
+++ b/tests/functional/test_arm_aspeed_palmetto.py
15
@@ -XXX,XX +XXX,XX @@
16
from qemu_test import Asset
17
from aspeed import AspeedTest
18
19
+
20
class PalmettoMachine(AspeedTest):
21
22
ASSET_PALMETTO_FLASH = Asset(
23
- ('https://github.com/openbmc/openbmc/releases/download/2.9.0/'
24
- 'obmc-phosphor-image-palmetto.static.mtd'),
25
- '3e13bbbc28e424865dc42f35ad672b10f2e82cdb11846bb28fa625b48beafd0d');
26
+ 'https://github.com/legoater/qemu-aspeed-boot/raw/master/images/palmetto-bmc/openbmc-20250128071432/obmc-phosphor-image-palmetto-20250128071432.static.mtd',
27
+ 'bce7c392eec75c707a91cfc8fad7ca9a69d7e4f10df936930d65c1cb9897ac81');
28
29
- def test_arm_ast2400_palmetto_openbmc_v2_9_0(self):
30
+ def test_arm_ast2400_palmetto_openbmc(self):
31
image_path = self.ASSET_PALMETTO_FLASH.fetch()
32
33
- self.do_test_arm_aspeed('palmetto-bmc', image_path)
34
-
35
+ self.do_test_arm_aspeed_openbmc('palmetto-bmc', image=image_path,
36
+ uboot='2019.04', cpu_id='0x0',
37
+ soc='AST2400 rev A1');
38
39
if __name__ == '__main__':
40
AspeedTest.main()
41
--
42
2.48.1
43
44
diff view generated by jsdifflib
New patch
1
Use the new do_test_arm_aspeed_openbmc() routine to run the latest
2
OpenBMC firmware build of the romulus BMC. Remove the older routine
3
which is now unused.
1
4
5
Reviewed-by: Thomas Huth <thuth@redhat.com>
6
Link: https://lore.kernel.org/qemu-devel/20250129071820.1258133-4-clg@redhat.com
7
Signed-off-by: Cédric Le Goater <clg@redhat.com>
8
---
9
tests/functional/aspeed.py | 16 ----------------
10
tests/functional/test_arm_aspeed_romulus.py | 13 +++++++------
11
2 files changed, 7 insertions(+), 22 deletions(-)
12
13
diff --git a/tests/functional/aspeed.py b/tests/functional/aspeed.py
14
index XXXXXXX..XXXXXXX 100644
15
--- a/tests/functional/aspeed.py
16
+++ b/tests/functional/aspeed.py
17
@@ -XXX,XX +XXX,XX @@
18
19
class AspeedTest(LinuxKernelTest):
20
21
- def do_test_arm_aspeed(self, machine, image):
22
- self.set_machine(machine)
23
- self.vm.set_console()
24
- self.vm.add_args('-drive', 'file=' + image + ',if=mtd,format=raw',
25
- '-net', 'nic', '-snapshot')
26
- self.vm.launch()
27
-
28
- self.wait_for_console_pattern("U-Boot 2016.07")
29
- self.wait_for_console_pattern("## Loading kernel from FIT Image at 20080000")
30
- self.wait_for_console_pattern("Starting kernel ...")
31
- self.wait_for_console_pattern("Booting Linux on physical CPU 0x0")
32
- self.wait_for_console_pattern(
33
- "aspeed-smc 1e620000.spi: read control register: 203b0641")
34
- self.wait_for_console_pattern("ftgmac100 1e660000.ethernet eth0: irq ")
35
- self.wait_for_console_pattern("systemd[1]: Set hostname to")
36
-
37
def do_test_arm_aspeed_openbmc(self, machine, image, uboot='2019.04',
38
cpu_id='0x0', soc='AST2500 rev A1'):
39
hostname = machine.removesuffix('-bmc')
40
diff --git a/tests/functional/test_arm_aspeed_romulus.py b/tests/functional/test_arm_aspeed_romulus.py
41
index XXXXXXX..XXXXXXX 100755
42
--- a/tests/functional/test_arm_aspeed_romulus.py
43
+++ b/tests/functional/test_arm_aspeed_romulus.py
44
@@ -XXX,XX +XXX,XX @@
45
from qemu_test import Asset
46
from aspeed import AspeedTest
47
48
+
49
class RomulusMachine(AspeedTest):
50
51
ASSET_ROMULUS_FLASH = Asset(
52
- ('https://github.com/openbmc/openbmc/releases/download/2.9.0/'
53
- 'obmc-phosphor-image-romulus.static.mtd'),
54
- '820341076803f1955bc31e647a512c79f9add4f5233d0697678bab4604c7bb25')
55
+ 'https://github.com/legoater/qemu-aspeed-boot/raw/master/images/romulus-bmc/openbmc-20250128071340/obmc-phosphor-image-romulus-20250128071340.static.mtd',
56
+ '6d031376440c82ed9d087d25e9fa76aea75b42f80daa252ec402c0bc3cf6cf5b');
57
58
- def test_arm_ast2500_romulus_openbmc_v2_9_0(self):
59
+ def test_arm_ast2500_romulus_openbmc(self):
60
image_path = self.ASSET_ROMULUS_FLASH.fetch()
61
62
- self.do_test_arm_aspeed('romulus-bmc', image_path)
63
-
64
+ self.do_test_arm_aspeed_openbmc('romulus-bmc', image=image_path,
65
+ uboot='2019.04', cpu_id='0x0',
66
+ soc='AST2500 rev A1');
67
68
if __name__ == '__main__':
69
AspeedTest.main()
70
--
71
2.48.1
72
73
diff view generated by jsdifflib
New patch
1
Use do_test_arm_aspeed_openbmc() routine to run the latest OpenBMC
2
firmware build of the witherspoon BMC.
1
3
4
Reviewed-by: Thomas Huth <thuth@redhat.com>
5
Link: https://lore.kernel.org/qemu-devel/20250129071820.1258133-5-clg@redhat.com
6
Signed-off-by: Cédric Le Goater <clg@redhat.com>
7
---
8
tests/functional/meson.build | 2 ++
9
.../functional/test_arm_aspeed_witherspoon.py | 25 +++++++++++++++++++
10
2 files changed, 27 insertions(+)
11
create mode 100644 tests/functional/test_arm_aspeed_witherspoon.py
12
13
diff --git a/tests/functional/meson.build b/tests/functional/meson.build
14
index XXXXXXX..XXXXXXX 100644
15
--- a/tests/functional/meson.build
16
+++ b/tests/functional/meson.build
17
@@ -XXX,XX +XXX,XX @@ test_timeouts = {
18
'acpi_bits' : 420,
19
'arm_aspeed_palmetto' : 120,
20
'arm_aspeed_romulus' : 120,
21
+ 'arm_aspeed_witherspoon' : 120,
22
'arm_aspeed_ast2500' : 720,
23
'arm_aspeed_ast2600' : 1200,
24
'arm_aspeed_rainier' : 480,
25
@@ -XXX,XX +XXX,XX @@ tests_arm_system_thorough = [
26
'arm_aspeed_ast1030',
27
'arm_aspeed_palmetto',
28
'arm_aspeed_romulus',
29
+ 'arm_aspeed_witherspoon',
30
'arm_aspeed_ast2500',
31
'arm_aspeed_ast2600',
32
'arm_aspeed_rainier',
33
diff --git a/tests/functional/test_arm_aspeed_witherspoon.py b/tests/functional/test_arm_aspeed_witherspoon.py
34
new file mode 100644
35
index XXXXXXX..XXXXXXX
36
--- /dev/null
37
+++ b/tests/functional/test_arm_aspeed_witherspoon.py
38
@@ -XXX,XX +XXX,XX @@
39
+#!/usr/bin/env python3
40
+#
41
+# Functional test that boots the ASPEED machines
42
+#
43
+# SPDX-License-Identifier: GPL-2.0-or-later
44
+
45
+from qemu_test import Asset
46
+from aspeed import AspeedTest
47
+
48
+
49
+class WitherspoonMachine(AspeedTest):
50
+
51
+ ASSET_WITHERSPOON_FLASH = Asset(
52
+ 'https://github.com/legoater/qemu-aspeed-boot/raw/master/images/witherspoon-bmc/openbmc-20240618035022/obmc-phosphor-image-witherspoon-20240618035022.ubi.mtd',
53
+ '937d9ed449ea6c6cbed983519088a42d0cafe276bcfe4fce07772ca6673f9213');
54
+
55
+ def test_arm_ast2500_witherspoon_openbmc(self):
56
+ image_path = self.ASSET_WITHERSPOON_FLASH.fetch()
57
+
58
+ self.do_test_arm_aspeed_openbmc('witherspoon-bmc', image=image_path,
59
+ uboot='2016.07', cpu_id='0x0',
60
+ soc='AST2500 rev A1');
61
+
62
+if __name__ == '__main__':
63
+ AspeedTest.main()
64
--
65
2.48.1
66
67
diff view generated by jsdifflib
New patch
1
Use do_test_arm_aspeed_openbmc() to run the latest OpenBMC firmware
2
build of the bletchley BMC.
1
3
4
Reviewed-by: Patrick Williams <patrick@stwcx.xyz>
5
Reviewed-by: Thomas Huth <thuth@redhat.com>
6
Link: https://lore.kernel.org/qemu-devel/20250129071820.1258133-6-clg@redhat.com
7
Signed-off-by: Cédric Le Goater <clg@redhat.com>
8
---
9
tests/functional/meson.build | 2 ++
10
tests/functional/test_arm_aspeed_bletchley.py | 25 +++++++++++++++++++
11
2 files changed, 27 insertions(+)
12
create mode 100644 tests/functional/test_arm_aspeed_bletchley.py
13
14
diff --git a/tests/functional/meson.build b/tests/functional/meson.build
15
index XXXXXXX..XXXXXXX 100644
16
--- a/tests/functional/meson.build
17
+++ b/tests/functional/meson.build
18
@@ -XXX,XX +XXX,XX @@ test_timeouts = {
19
'arm_aspeed_witherspoon' : 120,
20
'arm_aspeed_ast2500' : 720,
21
'arm_aspeed_ast2600' : 1200,
22
+ 'arm_aspeed_bletchley' : 120,
23
'arm_aspeed_rainier' : 480,
24
'arm_bpim2u' : 500,
25
'arm_collie' : 180,
26
@@ -XXX,XX +XXX,XX @@ tests_arm_system_thorough = [
27
'arm_aspeed_witherspoon',
28
'arm_aspeed_ast2500',
29
'arm_aspeed_ast2600',
30
+ 'arm_aspeed_bletchley',
31
'arm_aspeed_rainier',
32
'arm_bpim2u',
33
'arm_canona1100',
34
diff --git a/tests/functional/test_arm_aspeed_bletchley.py b/tests/functional/test_arm_aspeed_bletchley.py
35
new file mode 100644
36
index XXXXXXX..XXXXXXX
37
--- /dev/null
38
+++ b/tests/functional/test_arm_aspeed_bletchley.py
39
@@ -XXX,XX +XXX,XX @@
40
+#!/usr/bin/env python3
41
+#
42
+# Functional test that boots the ASPEED machines
43
+#
44
+# SPDX-License-Identifier: GPL-2.0-or-later
45
+
46
+from qemu_test import Asset
47
+from aspeed import AspeedTest
48
+
49
+
50
+class BletchleyMachine(AspeedTest):
51
+
52
+ ASSET_BLETCHLEY_FLASH = Asset(
53
+ 'https://github.com/legoater/qemu-aspeed-boot/raw/master/images/bletchley-bmc/openbmc-20250128071329/obmc-phosphor-image-bletchley-20250128071329.static.mtd.xz',
54
+ 'db21d04d47d7bb2a276f59d308614b4dfb70b9c7c81facbbca40a3977a2d8844');
55
+
56
+ def test_arm_ast2600_bletchley_openbmc(self):
57
+ image_path = self.uncompress(self.ASSET_BLETCHLEY_FLASH)
58
+
59
+ self.do_test_arm_aspeed_openbmc('bletchley-bmc', image=image_path,
60
+ uboot='2019.04', cpu_id='0xf00',
61
+ soc='AST2600 rev A3');
62
+
63
+if __name__ == '__main__':
64
+ AspeedTest.main()
65
--
66
2.48.1
67
68
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
QEMU supports GICv3 Non-maskable Interrupt, adds to support Non-maskable
4
Interrupt for AST2700.
5
6
Reference:
7
https://github.com/qemu/qemu/commit/b36a32ead
8
9
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
10
Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
11
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
12
Link: https://lore.kernel.org/qemu-devel/20250204060955.3546022-1-jamin_lin@aspeedtech.com
13
---
14
hw/arm/aspeed_ast27x0.c | 4 ++++
15
1 file changed, 4 insertions(+)
16
17
diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c
18
index XXXXXXX..XXXXXXX 100644
19
--- a/hw/arm/aspeed_ast27x0.c
20
+++ b/hw/arm/aspeed_ast27x0.c
21
@@ -XXX,XX +XXX,XX @@ static bool aspeed_soc_ast2700_gic_realize(DeviceState *dev, Error **errp)
22
qdev_get_gpio_in(cpudev, ARM_CPU_VIRQ));
23
sysbus_connect_irq(gicbusdev, i + 3 * sc->num_cpus,
24
qdev_get_gpio_in(cpudev, ARM_CPU_VFIQ));
25
+ sysbus_connect_irq(gicbusdev, i + 4 * sc->num_cpus,
26
+ qdev_get_gpio_in(cpudev, ARM_CPU_NMI));
27
+ sysbus_connect_irq(gicbusdev, i + 5 * sc->num_cpus,
28
+ qdev_get_gpio_in(cpudev, ARM_CPU_VINMI));
29
}
30
31
return true;
32
--
33
2.48.1
34
35
diff view generated by jsdifflib
1
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
1
The SoC type name is stored under AspeedSoCClass which is
2
redundant. Use object_get_typename() instead where needed.
2
3
3
The UART5 is present on the machine regardless there is a
4
Reviewed-by: Andrew Jeffery <andrew@codeconstruct.com.au>
4
character device connected to it. Map it unconditionally.
5
Link: https://lore.kernel.org/qemu-devel/20250218073534.585066-1-clg@redhat.com
6
Signed-off-by: Cédric Le Goater <clg@redhat.com>
7
---
8
include/hw/arm/aspeed_soc.h | 1 -
9
hw/arm/aspeed_ast10x0.c | 3 +--
10
hw/arm/aspeed_ast2400.c | 4 +---
11
hw/arm/aspeed_ast2600.c | 3 +--
12
hw/arm/aspeed_ast27x0.c | 3 +--
13
5 files changed, 4 insertions(+), 10 deletions(-)
5
14
6
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
15
diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h
7
Reviewed-by: Cédric Le Goater <clg@kaod.org>
16
index XXXXXXX..XXXXXXX 100644
8
Message-Id: <20200905212415.760452-1-f4bug@amsat.org>
17
--- a/include/hw/arm/aspeed_soc.h
9
Signed-off-by: Cédric Le Goater <clg@kaod.org>
18
+++ b/include/hw/arm/aspeed_soc.h
10
---
19
@@ -XXX,XX +XXX,XX @@ OBJECT_DECLARE_SIMPLE_TYPE(Aspeed10x0SoCState, ASPEED10X0_SOC)
11
hw/arm/aspeed_ast2600.c | 8 +++-----
20
struct AspeedSoCClass {
12
hw/arm/aspeed_soc.c | 8 +++-----
21
DeviceClass parent_class;
13
2 files changed, 6 insertions(+), 10 deletions(-)
22
14
23
- const char *name;
24
/** valid_cpu_types: NULL terminated array of a single CPU type. */
25
const char * const *valid_cpu_types;
26
uint32_t silicon_rev;
27
diff --git a/hw/arm/aspeed_ast10x0.c b/hw/arm/aspeed_ast10x0.c
28
index XXXXXXX..XXXXXXX 100644
29
--- a/hw/arm/aspeed_ast10x0.c
30
+++ b/hw/arm/aspeed_ast10x0.c
31
@@ -XXX,XX +XXX,XX @@ static void aspeed_soc_ast1030_init(Object *obj)
32
char typename[64];
33
int i;
34
35
- if (sscanf(sc->name, "%7s", socname) != 1) {
36
+ if (sscanf(object_get_typename(obj), "%7s", socname) != 1) {
37
g_assert_not_reached();
38
}
39
40
@@ -XXX,XX +XXX,XX @@ static void aspeed_soc_ast1030_class_init(ObjectClass *klass, void *data)
41
dc->user_creatable = false;
42
dc->realize = aspeed_soc_ast1030_realize;
43
44
- sc->name = "ast1030-a1";
45
sc->valid_cpu_types = valid_cpu_types;
46
sc->silicon_rev = AST1030_A1_SILICON_REV;
47
sc->sram_size = 0xc0000;
48
diff --git a/hw/arm/aspeed_ast2400.c b/hw/arm/aspeed_ast2400.c
49
index XXXXXXX..XXXXXXX 100644
50
--- a/hw/arm/aspeed_ast2400.c
51
+++ b/hw/arm/aspeed_ast2400.c
52
@@ -XXX,XX +XXX,XX @@ static void aspeed_ast2400_soc_init(Object *obj)
53
char socname[8];
54
char typename[64];
55
56
- if (sscanf(sc->name, "%7s", socname) != 1) {
57
+ if (sscanf(object_get_typename(obj), "%7s", socname) != 1) {
58
g_assert_not_reached();
59
}
60
61
@@ -XXX,XX +XXX,XX @@ static void aspeed_soc_ast2400_class_init(ObjectClass *oc, void *data)
62
/* Reason: Uses serial_hds and nd_table in realize() directly */
63
dc->user_creatable = false;
64
65
- sc->name = "ast2400-a1";
66
sc->valid_cpu_types = valid_cpu_types;
67
sc->silicon_rev = AST2400_A1_SILICON_REV;
68
sc->sram_size = 0x8000;
69
@@ -XXX,XX +XXX,XX @@ static void aspeed_soc_ast2500_class_init(ObjectClass *oc, void *data)
70
/* Reason: Uses serial_hds and nd_table in realize() directly */
71
dc->user_creatable = false;
72
73
- sc->name = "ast2500-a1";
74
sc->valid_cpu_types = valid_cpu_types;
75
sc->silicon_rev = AST2500_A1_SILICON_REV;
76
sc->sram_size = 0x9000;
15
diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c
77
diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c
16
index XXXXXXX..XXXXXXX 100644
78
index XXXXXXX..XXXXXXX 100644
17
--- a/hw/arm/aspeed_ast2600.c
79
--- a/hw/arm/aspeed_ast2600.c
18
+++ b/hw/arm/aspeed_ast2600.c
80
+++ b/hw/arm/aspeed_ast2600.c
19
@@ -XXX,XX +XXX,XX @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)
81
@@ -XXX,XX +XXX,XX @@ static void aspeed_soc_ast2600_init(Object *obj)
82
char socname[8];
83
char typename[64];
84
85
- if (sscanf(sc->name, "%7s", socname) != 1) {
86
+ if (sscanf(object_get_typename(obj), "%7s", socname) != 1) {
87
g_assert_not_reached();
20
}
88
}
21
89
22
/* UART - attach an 8250 to the IO space as our UART5 */
90
@@ -XXX,XX +XXX,XX @@ static void aspeed_soc_ast2600_class_init(ObjectClass *oc, void *data)
23
- if (serial_hd(0)) {
91
/* Reason: The Aspeed SoC can only be instantiated from a board */
24
- qemu_irq uart5 = aspeed_soc_get_irq(s, ASPEED_DEV_UART5);
92
dc->user_creatable = false;
25
- serial_mm_init(get_system_memory(), sc->memmap[ASPEED_DEV_UART5], 2,
93
26
- uart5, 38400, serial_hd(0), DEVICE_LITTLE_ENDIAN);
94
- sc->name = "ast2600-a3";
27
- }
95
sc->valid_cpu_types = valid_cpu_types;
28
+ serial_mm_init(get_system_memory(), sc->memmap[ASPEED_DEV_UART5], 2,
96
sc->silicon_rev = AST2600_A3_SILICON_REV;
29
+ aspeed_soc_get_irq(s, ASPEED_DEV_UART5),
97
sc->sram_size = 0x16400;
30
+ 38400, serial_hd(0), DEVICE_LITTLE_ENDIAN);
98
diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c
31
32
/* I2C */
33
object_property_set_link(OBJECT(&s->i2c), "dram", OBJECT(s->dram_mr),
34
diff --git a/hw/arm/aspeed_soc.c b/hw/arm/aspeed_soc.c
35
index XXXXXXX..XXXXXXX 100644
99
index XXXXXXX..XXXXXXX 100644
36
--- a/hw/arm/aspeed_soc.c
100
--- a/hw/arm/aspeed_ast27x0.c
37
+++ b/hw/arm/aspeed_soc.c
101
+++ b/hw/arm/aspeed_ast27x0.c
38
@@ -XXX,XX +XXX,XX @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
102
@@ -XXX,XX +XXX,XX @@ static void aspeed_soc_ast2700_init(Object *obj)
103
char socname[8];
104
char typename[64];
105
106
- if (sscanf(sc->name, "%7s", socname) != 1) {
107
+ if (sscanf(object_get_typename(obj), "%7s", socname) != 1) {
108
g_assert_not_reached();
39
}
109
}
40
110
41
/* UART - attach an 8250 to the IO space as our UART5 */
111
@@ -XXX,XX +XXX,XX @@ static void aspeed_soc_ast2700_class_init(ObjectClass *oc, void *data)
42
- if (serial_hd(0)) {
112
dc->user_creatable = false;
43
- qemu_irq uart5 = aspeed_soc_get_irq(s, ASPEED_DEV_UART5);
113
dc->realize = aspeed_soc_ast2700_realize;
44
- serial_mm_init(get_system_memory(), sc->memmap[ASPEED_DEV_UART5], 2,
114
45
- uart5, 38400, serial_hd(0), DEVICE_LITTLE_ENDIAN);
115
- sc->name = "ast2700-a0";
46
- }
116
sc->valid_cpu_types = valid_cpu_types;
47
+ serial_mm_init(get_system_memory(), sc->memmap[ASPEED_DEV_UART5], 2,
117
sc->silicon_rev = AST2700_A0_SILICON_REV;
48
+ aspeed_soc_get_irq(s, ASPEED_DEV_UART5), 38400,
118
sc->sram_size = 0x20000;
49
+ serial_hd(0), DEVICE_LITTLE_ENDIAN);
50
51
/* I2C */
52
object_property_set_link(OBJECT(&s->i2c), "dram", OBJECT(s->dram_mr),
53
--
119
--
54
2.25.4
120
2.48.1
55
121
56
122
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
Fix coding style issues from checkpatch.pl.
4
5
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
6
Reviewed-by: Cédric Le Goater <clg@redhat.com>
7
Link: https://lore.kernel.org/qemu-devel/20250225075622.305515-2-jamin_lin@aspeedtech.com
8
Signed-off-by: Cédric Le Goater <clg@redhat.com>
9
---
10
hw/misc/aspeed_hace.c | 12 ++++++++----
11
1 file changed, 8 insertions(+), 4 deletions(-)
12
13
diff --git a/hw/misc/aspeed_hace.c b/hw/misc/aspeed_hace.c
14
index XXXXXXX..XXXXXXX 100644
15
--- a/hw/misc/aspeed_hace.c
16
+++ b/hw/misc/aspeed_hace.c
17
@@ -XXX,XX +XXX,XX @@ static const struct {
18
{ HASH_ALGO_SHA1, QCRYPTO_HASH_ALGO_SHA1 },
19
{ HASH_ALGO_SHA224, QCRYPTO_HASH_ALGO_SHA224 },
20
{ HASH_ALGO_SHA256, QCRYPTO_HASH_ALGO_SHA256 },
21
- { HASH_ALGO_SHA512_SERIES | HASH_ALGO_SHA512_SHA512, QCRYPTO_HASH_ALGO_SHA512 },
22
- { HASH_ALGO_SHA512_SERIES | HASH_ALGO_SHA512_SHA384, QCRYPTO_HASH_ALGO_SHA384 },
23
- { HASH_ALGO_SHA512_SERIES | HASH_ALGO_SHA512_SHA256, QCRYPTO_HASH_ALGO_SHA256 },
24
+ { HASH_ALGO_SHA512_SERIES | HASH_ALGO_SHA512_SHA512,
25
+ QCRYPTO_HASH_ALGO_SHA512 },
26
+ { HASH_ALGO_SHA512_SERIES | HASH_ALGO_SHA512_SHA384,
27
+ QCRYPTO_HASH_ALGO_SHA384 },
28
+ { HASH_ALGO_SHA512_SERIES | HASH_ALGO_SHA512_SHA256,
29
+ QCRYPTO_HASH_ALGO_SHA256 },
30
};
31
32
static int hash_algo_lookup(uint32_t reg)
33
@@ -XXX,XX +XXX,XX @@ static void do_hash_operation(AspeedHACEState *s, int algo, bool sg_mode,
34
haddr = address_space_map(&s->dram_as, addr, &plen, false,
35
MEMTXATTRS_UNSPECIFIED);
36
if (haddr == NULL) {
37
- qemu_log_mask(LOG_GUEST_ERROR, "%s: qcrypto failed\n", __func__);
38
+ qemu_log_mask(LOG_GUEST_ERROR,
39
+ "%s: qcrypto failed\n", __func__);
40
return;
41
}
42
iov[i].iov_base = haddr;
43
--
44
2.48.1
45
46
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
Introduce a new ast2700 class to support AST2700.
4
5
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
6
Reviewed-by: Andrew Jeffery <andrew@codeconstruct.com.au>
7
Link: https://lore.kernel.org/qemu-devel/20250225075622.305515-3-jamin_lin@aspeedtech.com
8
Signed-off-by: Cédric Le Goater <clg@redhat.com>
9
---
10
include/hw/misc/aspeed_hace.h | 1 +
11
hw/misc/aspeed_hace.c | 20 ++++++++++++++++++++
12
2 files changed, 21 insertions(+)
13
14
diff --git a/include/hw/misc/aspeed_hace.h b/include/hw/misc/aspeed_hace.h
15
index XXXXXXX..XXXXXXX 100644
16
--- a/include/hw/misc/aspeed_hace.h
17
+++ b/include/hw/misc/aspeed_hace.h
18
@@ -XXX,XX +XXX,XX @@
19
#define TYPE_ASPEED_AST2500_HACE TYPE_ASPEED_HACE "-ast2500"
20
#define TYPE_ASPEED_AST2600_HACE TYPE_ASPEED_HACE "-ast2600"
21
#define TYPE_ASPEED_AST1030_HACE TYPE_ASPEED_HACE "-ast1030"
22
+#define TYPE_ASPEED_AST2700_HACE TYPE_ASPEED_HACE "-ast2700"
23
24
OBJECT_DECLARE_TYPE(AspeedHACEState, AspeedHACEClass, ASPEED_HACE)
25
26
diff --git a/hw/misc/aspeed_hace.c b/hw/misc/aspeed_hace.c
27
index XXXXXXX..XXXXXXX 100644
28
--- a/hw/misc/aspeed_hace.c
29
+++ b/hw/misc/aspeed_hace.c
30
@@ -XXX,XX +XXX,XX @@ static const TypeInfo aspeed_ast1030_hace_info = {
31
.class_init = aspeed_ast1030_hace_class_init,
32
};
33
34
+static void aspeed_ast2700_hace_class_init(ObjectClass *klass, void *data)
35
+{
36
+ DeviceClass *dc = DEVICE_CLASS(klass);
37
+ AspeedHACEClass *ahc = ASPEED_HACE_CLASS(klass);
38
+
39
+ dc->desc = "AST2700 Hash and Crypto Engine";
40
+
41
+ ahc->src_mask = 0x7FFFFFFF;
42
+ ahc->dest_mask = 0x7FFFFFF8;
43
+ ahc->key_mask = 0x7FFFFFF8;
44
+ ahc->hash_mask = 0x00147FFF;
45
+}
46
+
47
+static const TypeInfo aspeed_ast2700_hace_info = {
48
+ .name = TYPE_ASPEED_AST2700_HACE,
49
+ .parent = TYPE_ASPEED_HACE,
50
+ .class_init = aspeed_ast2700_hace_class_init,
51
+};
52
+
53
static void aspeed_hace_register_types(void)
54
{
55
type_register_static(&aspeed_ast2400_hace_info);
56
type_register_static(&aspeed_ast2500_hace_info);
57
type_register_static(&aspeed_ast2600_hace_info);
58
type_register_static(&aspeed_ast1030_hace_info);
59
+ type_register_static(&aspeed_ast2700_hace_info);
60
type_register_static(&aspeed_hace_info);
61
}
62
63
--
64
2.48.1
65
66
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
The HACE controller between AST2600 and AST2700 are almost identical.
4
The HACE controller registers base address starts at 0x1207_0000 and
5
its alarm interrupt is connected to GICINT4.
6
7
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
8
Reviewed-by: Andrew Jeffery <andrew@codeconstruct.com.au>
9
Link: https://lore.kernel.org/qemu-devel/20250225075622.305515-4-jamin_lin@aspeedtech.com
10
Signed-off-by: Cédric Le Goater <clg@redhat.com>
11
---
12
hw/arm/aspeed_ast27x0.c | 15 +++++++++++++++
13
1 file changed, 15 insertions(+)
14
15
diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c
16
index XXXXXXX..XXXXXXX 100644
17
--- a/hw/arm/aspeed_ast27x0.c
18
+++ b/hw/arm/aspeed_ast27x0.c
19
@@ -XXX,XX +XXX,XX @@ static const hwaddr aspeed_soc_ast2700_memmap[] = {
20
[ASPEED_DEV_RTC] = 0x12C0F000,
21
[ASPEED_DEV_SDHCI] = 0x14080000,
22
[ASPEED_DEV_TIMER1] = 0x12C10000,
23
+ [ASPEED_DEV_HACE] = 0x12070000,
24
};
25
26
#define AST2700_MAX_IRQ 256
27
@@ -XXX,XX +XXX,XX @@ static void aspeed_soc_ast2700_init(Object *obj)
28
29
snprintf(typename, sizeof(typename), "aspeed.timer-%s", socname);
30
object_initialize_child(obj, "timerctrl", &s->timerctrl, typename);
31
+
32
+ snprintf(typename, sizeof(typename), "aspeed.hace-%s", socname);
33
+ object_initialize_child(obj, "hace", &s->hace, typename);
34
}
35
36
/*
37
@@ -XXX,XX +XXX,XX @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp)
38
sysbus_connect_irq(SYS_BUS_DEVICE(&s->timerctrl), i, irq);
39
}
40
41
+ /* HACE */
42
+ object_property_set_link(OBJECT(&s->hace), "dram", OBJECT(s->dram_mr),
43
+ &error_abort);
44
+ if (!sysbus_realize(SYS_BUS_DEVICE(&s->hace), errp)) {
45
+ return;
46
+ }
47
+ aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->hace), 0,
48
+ sc->memmap[ASPEED_DEV_HACE]);
49
+ sysbus_connect_irq(SYS_BUS_DEVICE(&s->hace), 0,
50
+ aspeed_soc_get_irq(s, ASPEED_DEV_HACE));
51
+
52
create_unimplemented_device("ast2700.dpmcu", 0x11000000, 0x40000);
53
create_unimplemented_device("ast2700.iomem0", 0x12000000, 0x01000000);
54
create_unimplemented_device("ast2700.iomem1", 0x14000000, 0x01000000);
55
--
56
2.48.1
57
58
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
Currently, it does not support the CRYPT command. Instead, it only sends an
4
interrupt to notify the firmware that the crypt command has completed.
5
It is a temporary workaround to resolve the boot issue in the Crypto Manager
6
Self Test.
7
8
Introduce a new "use_crypt_workaround" class attribute and set it to true in
9
the AST2700 HACE model to enable this workaround by default for AST2700.
10
11
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
12
Reviewed-by: Cédric Le Goater <clg@redhat.com>
13
Link: https://lore.kernel.org/qemu-devel/20250225075622.305515-5-jamin_lin@aspeedtech.com
14
Signed-off-by: Cédric Le Goater <clg@redhat.com>
15
---
16
include/hw/misc/aspeed_hace.h | 1 +
17
hw/misc/aspeed_hace.c | 23 +++++++++++++++++++++++
18
2 files changed, 24 insertions(+)
19
20
diff --git a/include/hw/misc/aspeed_hace.h b/include/hw/misc/aspeed_hace.h
21
index XXXXXXX..XXXXXXX 100644
22
--- a/include/hw/misc/aspeed_hace.h
23
+++ b/include/hw/misc/aspeed_hace.h
24
@@ -XXX,XX +XXX,XX @@ struct AspeedHACEClass {
25
uint32_t dest_mask;
26
uint32_t key_mask;
27
uint32_t hash_mask;
28
+ bool raise_crypt_interrupt_workaround;
29
};
30
31
#endif /* ASPEED_HACE_H */
32
diff --git a/hw/misc/aspeed_hace.c b/hw/misc/aspeed_hace.c
33
index XXXXXXX..XXXXXXX 100644
34
--- a/hw/misc/aspeed_hace.c
35
+++ b/hw/misc/aspeed_hace.c
36
@@ -XXX,XX +XXX,XX @@
37
/* Other cmd bits */
38
#define HASH_IRQ_EN BIT(9)
39
#define HASH_SG_EN BIT(18)
40
+#define CRYPT_IRQ_EN BIT(12)
41
/* Scatter-gather data list */
42
#define SG_LIST_LEN_SIZE 4
43
#define SG_LIST_LEN_MASK 0x0FFFFFFF
44
@@ -XXX,XX +XXX,XX @@ static void aspeed_hace_write(void *opaque, hwaddr addr, uint64_t data,
45
qemu_irq_lower(s->irq);
46
}
47
}
48
+ if (ahc->raise_crypt_interrupt_workaround) {
49
+ if (data & CRYPT_IRQ) {
50
+ data &= ~CRYPT_IRQ;
51
+
52
+ if (s->regs[addr] & CRYPT_IRQ) {
53
+ qemu_irq_lower(s->irq);
54
+ }
55
+ }
56
+ }
57
break;
58
case R_HASH_SRC:
59
data &= ahc->src_mask;
60
@@ -XXX,XX +XXX,XX @@ static void aspeed_hace_write(void *opaque, hwaddr addr, uint64_t data,
61
case R_CRYPT_CMD:
62
qemu_log_mask(LOG_UNIMP, "%s: Crypt commands not implemented\n",
63
__func__);
64
+ if (ahc->raise_crypt_interrupt_workaround) {
65
+ s->regs[R_STATUS] |= CRYPT_IRQ;
66
+ if (data & CRYPT_IRQ_EN) {
67
+ qemu_irq_raise(s->irq);
68
+ }
69
+ }
70
break;
71
default:
72
break;
73
@@ -XXX,XX +XXX,XX @@ static void aspeed_ast2700_hace_class_init(ObjectClass *klass, void *data)
74
ahc->dest_mask = 0x7FFFFFF8;
75
ahc->key_mask = 0x7FFFFFF8;
76
ahc->hash_mask = 0x00147FFF;
77
+
78
+ /*
79
+ * Currently, it does not support the CRYPT command. Instead, it only
80
+ * sends an interrupt to notify the firmware that the crypt command
81
+ * has completed. It is a temporary workaround.
82
+ */
83
+ ahc->raise_crypt_interrupt_workaround = true;
84
}
85
86
static const TypeInfo aspeed_ast2700_hace_info = {
87
--
88
2.48.1
89
90
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
Setting BIT6 in VGA0 SCRATCH register will indicate that the ddr traning
4
is done, therefore skipping the u-boot-spl dram_init() process.
5
6
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
7
Signed-off-by: Troy Lee <troy_lee@aspeedtech.com>
8
Reviewed-by: Cédric Le Goater <clg@redhat.com>
9
Tested-by: Nabih Estefan <nabihestefan@google.com>
10
Link: https://lore.kernel.org/qemu-devel/20250304064710.2128993-2-jamin_lin@aspeedtech.com
11
Signed-off-by: Cédric Le Goater <clg@redhat.com>
12
---
13
hw/misc/aspeed_scu.c | 2 ++
14
1 file changed, 2 insertions(+)
15
16
diff --git a/hw/misc/aspeed_scu.c b/hw/misc/aspeed_scu.c
17
index XXXXXXX..XXXXXXX 100644
18
--- a/hw/misc/aspeed_scu.c
19
+++ b/hw/misc/aspeed_scu.c
20
@@ -XXX,XX +XXX,XX @@
21
#define AST2700_SCU_FREQ_CNTR TO_REG(0x3b0)
22
#define AST2700_SCU_CPU_SCRATCH_0 TO_REG(0x780)
23
#define AST2700_SCU_CPU_SCRATCH_1 TO_REG(0x784)
24
+#define AST2700_SCU_VGA_SCRATCH_0 TO_REG(0x900)
25
26
#define AST2700_SCUIO_CLK_STOP_CTL_1 TO_REG(0x240)
27
#define AST2700_SCUIO_CLK_STOP_CLR_1 TO_REG(0x244)
28
@@ -XXX,XX +XXX,XX @@ static const uint32_t ast2700_a0_resets[ASPEED_AST2700_SCU_NR_REGS] = {
29
[AST2700_SCU_FREQ_CNTR] = 0x000375eb,
30
[AST2700_SCU_CPU_SCRATCH_0] = 0x00000000,
31
[AST2700_SCU_CPU_SCRATCH_1] = 0x00000004,
32
+ [AST2700_SCU_VGA_SCRATCH_0] = 0x00000040,
33
};
34
35
static void aspeed_ast2700_scu_reset(DeviceState *dev)
36
--
37
2.48.1
38
39
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
According to the design of the AST2600, it has a Silicon Revision ID Register,
4
specifically SCU004 and SCU014, to set the Revision ID for the AST2600.
5
For the AST2600 A3, SCU004 is set to 0x05030303 and SCU014 is set to 0x05030303.
6
In the "aspeed_ast2600_scu_reset" function, the hardcoded value
7
"AST2600_A3_SILICON_REV" is set in SCU004, and "s->silicon_rev" is set in
8
SCU014. The value of "s->silicon_rev" is set by the SOC layer via the
9
"silicon-rev" property.
10
11
However, the design of the AST2700 is different. There are two SCU controllers:
12
SCU0 (CPU Die) and SCU1 (IO Die). In the AST2700, the firmware reads the SCU
13
Silicon Revision ID register (SCU0_000) and the SCUIO Silicon Revision ID
14
register (SCU1_000), combining them into a single 64-bit value.
15
16
The upper 32 bits represent the SCUIO, while the lower 32 bits correspond to the
17
SCU. For example, the AST2700-A1 revision is represented as 0x0601010306010103.
18
SCUIO_000 occupies bits [63:32] with a value of 0x06010103 and SCU_000 occupies
19
bits [31:0] with a value of 0x06010103.
20
21
Reference:
22
https://github.com/AspeedTech-BMC/u-boot/blob/aspeed-master-v2023.10/arch/arm/mach-aspeed/ast2700/cpu-info.c
23
24
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
25
Tested-by: Nabih Estefan <nabihestefan@google.com>
26
Reviewed-by: Cédric Le Goater <clg@redhat.com>
27
Link: https://lore.kernel.org/qemu-devel/20250304064710.2128993-3-jamin_lin@aspeedtech.com
28
Signed-off-by: Cédric Le Goater <clg@redhat.com>
29
---
30
hw/misc/aspeed_scu.c | 3 +--
31
1 file changed, 1 insertion(+), 2 deletions(-)
32
33
diff --git a/hw/misc/aspeed_scu.c b/hw/misc/aspeed_scu.c
34
index XXXXXXX..XXXXXXX 100644
35
--- a/hw/misc/aspeed_scu.c
36
+++ b/hw/misc/aspeed_scu.c
37
@@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps aspeed_ast2700_scu_ops = {
38
};
39
40
static const uint32_t ast2700_a0_resets[ASPEED_AST2700_SCU_NR_REGS] = {
41
- [AST2700_SILICON_REV] = AST2700_A0_SILICON_REV,
42
[AST2700_HW_STRAP1] = 0x00000800,
43
[AST2700_HW_STRAP1_CLR] = 0xFFF0FFF0,
44
[AST2700_HW_STRAP1_LOCK] = 0x00000FFF,
45
@@ -XXX,XX +XXX,XX @@ static void aspeed_ast2700_scu_reset(DeviceState *dev)
46
AspeedSCUClass *asc = ASPEED_SCU_GET_CLASS(dev);
47
48
memcpy(s->regs, asc->resets, asc->nr_regs * 4);
49
+ s->regs[AST2700_SILICON_REV] = s->silicon_rev;
50
}
51
52
static void aspeed_2700_scu_class_init(ObjectClass *klass, void *data)
53
@@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps aspeed_ast2700_scuio_ops = {
54
};
55
56
static const uint32_t ast2700_a0_resets_io[ASPEED_AST2700_SCU_NR_REGS] = {
57
- [AST2700_SILICON_REV] = 0x06000003,
58
[AST2700_HW_STRAP1] = 0x00000504,
59
[AST2700_HW_STRAP1_CLR] = 0xFFF0FFF0,
60
[AST2700_HW_STRAP1_LOCK] = 0x00000FFF,
61
--
62
2.48.1
63
64
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
Separate HW Strap Registers for SCU and SCUIO.
4
AST2700_EVB_HW_STRAP1 is used for the SCU (CPU Die) hw-strap1.
5
AST2700_EVB_HW_STRAP2 is used for the SCUIO (IO Die) hw-strap1.
6
7
Additionally, both default values are updated based on the dump from the EVB.
8
9
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
10
Reviewed-by: Cédric Le Goater <clg@redhat.com>
11
Tested-by: Nabih Estefan <nabihestefan@google.com>
12
Link: https://lore.kernel.org/qemu-devel/20250304064710.2128993-4-jamin_lin@aspeedtech.com
13
Signed-off-by: Cédric Le Goater <clg@redhat.com>
14
---
15
hw/arm/aspeed.c | 6 ++++--
16
1 file changed, 4 insertions(+), 2 deletions(-)
17
18
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
19
index XXXXXXX..XXXXXXX 100644
20
--- a/hw/arm/aspeed.c
21
+++ b/hw/arm/aspeed.c
22
@@ -XXX,XX +XXX,XX @@ struct AspeedMachineState {
23
24
#ifdef TARGET_AARCH64
25
/* AST2700 evb hardware value */
26
-#define AST2700_EVB_HW_STRAP1 0x000000C0
27
-#define AST2700_EVB_HW_STRAP2 0x00000003
28
+/* SCU HW Strap1 */
29
+#define AST2700_EVB_HW_STRAP1 0x00000800
30
+/* SCUIO HW Strap1 */
31
+#define AST2700_EVB_HW_STRAP2 0x00000700
32
#endif
33
34
/* Rainier hardware value: (QEMU prototype) */
35
--
36
2.48.1
37
38
diff view generated by jsdifflib
1
From: Joel Stanley <joel@jms.id.au>
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
2
2
3
Aspeed have released an updated datasheet (v7) containing the silicon id
3
There is one hw_strap1 register in the SCU (CPU DIE) and another hw_strap1
4
for the AST2600 A2. It looks like this:
4
register in the SCUIO (IO DIE).
5
5
6
SCU004 SCU014
6
In the "ast2700_a0_resets" function, the hardcoded value "0x00000800" is set in
7
AST2600-A0 0x05000303 0x05000303
7
SCU hw-strap1 (CPU DIE), and in "ast2700_a0_resets_io" the hardcoded value
8
AST2600-A1 0x05010303 0x05010303
8
"0x00000504" is set in SCUIO hw-strap1 (IO DIE). Both values cannot be set via
9
AST2600-A2 0x05010303 0x05020303
9
the SOC layer.
10
AST2620-A1 0x05010203 0x05010203
11
AST2620-A2 0x05010203 0x05020203
12
10
13
The SCU004 (silicon id 1) value matches SCU014 for A0, but for
11
The value of "s->hw_strap1" is set by the SOC layer via the "hw-strap1" property.
14
subsequent revisions it is hard coded to the A1 value.
12
Update the "aspeed_ast2700_scu_reset" function to set the value of "s->hw_strap1"
13
in both the SCU and SCUIO hw-strap1 registers.
15
14
16
Qemu effectively dropped support for the A0 in 7582591ae745 ("aspeed:
15
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
17
Support AST2600A1 silicon revision") as the A0 reset table was removed,
16
Reviewed-by: Cédric Le Goater <clg@redhat.com>
18
so it makes sense to only support the behaviour of A1 and onwards.
17
Tested-by: Nabih Estefan <nabihestefan@google.com>
19
18
Link: https://lore.kernel.org/qemu-devel/20250304064710.2128993-5-jamin_lin@aspeedtech.com
20
Signed-off-by: Joel Stanley <joel@jms.id.au>
19
Signed-off-by: Cédric Le Goater <clg@redhat.com>
21
Reviewed-by: Cédric Le Goater <clg@kaod.org>
22
Message-Id: <20200916082012.776628-1-joel@jms.id.au>
23
Signed-off-by: Cédric Le Goater <clg@kaod.org>
24
---
20
---
25
hw/misc/aspeed_scu.c | 7 ++++++-
21
hw/misc/aspeed_scu.c | 3 +--
26
1 file changed, 6 insertions(+), 1 deletion(-)
22
1 file changed, 1 insertion(+), 2 deletions(-)
27
23
28
diff --git a/hw/misc/aspeed_scu.c b/hw/misc/aspeed_scu.c
24
diff --git a/hw/misc/aspeed_scu.c b/hw/misc/aspeed_scu.c
29
index XXXXXXX..XXXXXXX 100644
25
index XXXXXXX..XXXXXXX 100644
30
--- a/hw/misc/aspeed_scu.c
26
--- a/hw/misc/aspeed_scu.c
31
+++ b/hw/misc/aspeed_scu.c
27
+++ b/hw/misc/aspeed_scu.c
32
@@ -XXX,XX +XXX,XX @@ static void aspeed_ast2600_scu_reset(DeviceState *dev)
28
@@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps aspeed_ast2700_scu_ops = {
29
};
30
31
static const uint32_t ast2700_a0_resets[ASPEED_AST2700_SCU_NR_REGS] = {
32
- [AST2700_HW_STRAP1] = 0x00000800,
33
[AST2700_HW_STRAP1_CLR] = 0xFFF0FFF0,
34
[AST2700_HW_STRAP1_LOCK] = 0x00000FFF,
35
[AST2700_HW_STRAP1_SEC1] = 0x000000FF,
36
@@ -XXX,XX +XXX,XX @@ static void aspeed_ast2700_scu_reset(DeviceState *dev)
33
37
34
memcpy(s->regs, asc->resets, asc->nr_regs * 4);
38
memcpy(s->regs, asc->resets, asc->nr_regs * 4);
35
39
s->regs[AST2700_SILICON_REV] = s->silicon_rev;
36
- s->regs[AST2600_SILICON_REV] = s->silicon_rev;
40
+ s->regs[AST2700_HW_STRAP1] = s->hw_strap1;
37
+ /*
41
}
38
+ * A0 reports A0 in _REV, but subsequent revisions report A1 regardless
42
39
+ * of actual revision. QEMU and Linux only support A1 onwards so this is
43
static void aspeed_2700_scu_class_init(ObjectClass *klass, void *data)
40
+ * sufficient.
44
@@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps aspeed_ast2700_scuio_ops = {
41
+ */
45
};
42
+ s->regs[AST2600_SILICON_REV] = AST2600_A1_SILICON_REV;
46
43
s->regs[AST2600_SILICON_REV2] = s->silicon_rev;
47
static const uint32_t ast2700_a0_resets_io[ASPEED_AST2700_SCU_NR_REGS] = {
44
s->regs[AST2600_HW_STRAP1] = s->hw_strap1;
48
- [AST2700_HW_STRAP1] = 0x00000504,
45
s->regs[AST2600_HW_STRAP2] = s->hw_strap2;
49
[AST2700_HW_STRAP1_CLR] = 0xFFF0FFF0,
50
[AST2700_HW_STRAP1_LOCK] = 0x00000FFF,
51
[AST2700_HW_STRAP1_SEC1] = 0x000000FF,
46
--
52
--
47
2.25.4
53
2.48.1
48
54
49
55
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
There is one hw-strap1 register in the SCU (CPU DIE) and another hw-strap1
4
register in the SCUIO (IO DIE). The values of these two registers should not be
5
the same. To reuse the current design of hw-strap, hw-strap1 is assigned to the
6
SCU and sets the value in the SCU hw-strap1 register, while hw-strap2 is
7
assigned to the SCUIO and sets the value in the SCUIO hw-strap1 register.
8
9
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
10
Tested-by: Nabih Estefan <nabihestefan@google.com>
11
Reviewed-by: Cédric Le Goater <clg@redhat.com>
12
Link: https://lore.kernel.org/qemu-devel/20250304064710.2128993-6-jamin_lin@aspeedtech.com
13
Signed-off-by: Cédric Le Goater <clg@redhat.com>
14
---
15
hw/arm/aspeed_ast27x0.c | 11 +++++++++--
16
1 file changed, 9 insertions(+), 2 deletions(-)
17
18
diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c
19
index XXXXXXX..XXXXXXX 100644
20
--- a/hw/arm/aspeed_ast27x0.c
21
+++ b/hw/arm/aspeed_ast27x0.c
22
@@ -XXX,XX +XXX,XX @@ static void aspeed_soc_ast2700_init(Object *obj)
23
sc->silicon_rev);
24
object_property_add_alias(obj, "hw-strap1", OBJECT(&s->scu),
25
"hw-strap1");
26
- object_property_add_alias(obj, "hw-strap2", OBJECT(&s->scu),
27
- "hw-strap2");
28
object_property_add_alias(obj, "hw-prot-key", OBJECT(&s->scu),
29
"hw-prot-key");
30
31
object_initialize_child(obj, "scuio", &s->scuio, TYPE_ASPEED_2700_SCUIO);
32
qdev_prop_set_uint32(DEVICE(&s->scuio), "silicon-rev",
33
sc->silicon_rev);
34
+ /*
35
+ * There is one hw-strap1 register in the SCU (CPU DIE) and another
36
+ * hw-strap1 register in the SCUIO (IO DIE). To reuse the current design
37
+ * of hw-strap, hw-strap1 is assigned to the SCU and sets the value in the
38
+ * SCU hw-strap1 register, while hw-strap2 is assigned to the SCUIO and
39
+ * sets the value in the SCUIO hw-strap1 register.
40
+ */
41
+ object_property_add_alias(obj, "hw-strap2", OBJECT(&s->scuio),
42
+ "hw-strap1");
43
44
snprintf(typename, sizeof(typename), "aspeed.fmc-%s", socname);
45
object_initialize_child(obj, "fmc", &s->fmc, typename);
46
--
47
2.48.1
48
49
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
Currently, ASPEED_DEV_SPI_BOOT is set to "0x400000000", which is the DRAM start
4
address, and the QEMU loader is used to load the U-Boot binary into this address.
5
6
However, if users want to install FMC flash contents as a boot ROM, the DRAM
7
address 0x400000000 would be overwritten with Boot ROM data. This causes the
8
AST2700 to fail to boot because the U-Boot data becomes incorrect.
9
10
To fix this, change the ASPEED_DEV_SPI_BOOT address to "0x100000000", which is
11
the FMC0 memory-mapped start address in the AST2700.
12
13
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
14
Reviewed-by: Cédric Le Goater <clg@redhat.com>
15
Tested-by: Nabih Estefan <nabihestefan@google.com>
16
Link: https://lore.kernel.org/qemu-devel/20250304064710.2128993-7-jamin_lin@aspeedtech.com
17
Signed-off-by: Cédric Le Goater <clg@redhat.com>
18
---
19
hw/arm/aspeed_ast27x0.c | 2 +-
20
1 file changed, 1 insertion(+), 1 deletion(-)
21
22
diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c
23
index XXXXXXX..XXXXXXX 100644
24
--- a/hw/arm/aspeed_ast27x0.c
25
+++ b/hw/arm/aspeed_ast27x0.c
26
@@ -XXX,XX +XXX,XX @@
27
#include "qemu/log.h"
28
29
static const hwaddr aspeed_soc_ast2700_memmap[] = {
30
- [ASPEED_DEV_SPI_BOOT] = 0x400000000,
31
+ [ASPEED_DEV_SPI_BOOT] = 0x100000000,
32
[ASPEED_DEV_SRAM] = 0x10000000,
33
[ASPEED_DEV_SDMC] = 0x12C00000,
34
[ASPEED_DEV_SCU] = 0x12C02000,
35
--
36
2.48.1
37
38
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
According to the AST2700 datasheet, the INTC(CPU DIE) controller has 16KB
4
(0x4000) of register space, and the INTCIO (I/O DIE) controller has 1KB (0x400)
5
of register space.
6
7
Introduced a new class attribute "mem_size" to set different memory sizes for
8
the INTC models in AST2700.
9
10
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
11
Reviewed-by: Cédric Le Goater <clg@redhat.com>
12
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-2-jamin_lin@aspeedtech.com
13
Signed-off-by: Cédric Le Goater <clg@redhat.com>
14
---
15
include/hw/intc/aspeed_intc.h | 3 +++
16
hw/intc/aspeed_intc.c | 9 ++++++++-
17
2 files changed, 11 insertions(+), 1 deletion(-)
18
19
diff --git a/include/hw/intc/aspeed_intc.h b/include/hw/intc/aspeed_intc.h
20
index XXXXXXX..XXXXXXX 100644
21
--- a/include/hw/intc/aspeed_intc.h
22
+++ b/include/hw/intc/aspeed_intc.h
23
@@ -XXX,XX +XXX,XX @@ struct AspeedINTCState {
24
25
/*< public >*/
26
MemoryRegion iomem;
27
+ MemoryRegion iomem_container;
28
+
29
uint32_t regs[ASPEED_INTC_NR_REGS];
30
OrIRQState orgates[ASPEED_INTC_NR_INTS];
31
qemu_irq output_pins[ASPEED_INTC_NR_INTS];
32
@@ -XXX,XX +XXX,XX @@ struct AspeedINTCClass {
33
34
uint32_t num_lines;
35
uint32_t num_ints;
36
+ uint64_t mem_size;
37
};
38
39
#endif /* ASPEED_INTC_H */
40
diff --git a/hw/intc/aspeed_intc.c b/hw/intc/aspeed_intc.c
41
index XXXXXXX..XXXXXXX 100644
42
--- a/hw/intc/aspeed_intc.c
43
+++ b/hw/intc/aspeed_intc.c
44
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_realize(DeviceState *dev, Error **errp)
45
AspeedINTCClass *aic = ASPEED_INTC_GET_CLASS(s);
46
int i;
47
48
+ memory_region_init(&s->iomem_container, OBJECT(s),
49
+ TYPE_ASPEED_INTC ".container", aic->mem_size);
50
+
51
+ sysbus_init_mmio(sbd, &s->iomem_container);
52
+
53
memory_region_init_io(&s->iomem, OBJECT(s), &aspeed_intc_ops, s,
54
TYPE_ASPEED_INTC ".regs", ASPEED_INTC_NR_REGS << 2);
55
56
- sysbus_init_mmio(sbd, &s->iomem);
57
+ memory_region_add_subregion(&s->iomem_container, 0x0, &s->iomem);
58
+
59
qdev_init_gpio_in(dev, aspeed_intc_set_irq, aic->num_ints);
60
61
for (i = 0; i < aic->num_ints; i++) {
62
@@ -XXX,XX +XXX,XX @@ static void aspeed_2700_intc_class_init(ObjectClass *klass, void *data)
63
dc->desc = "ASPEED 2700 INTC Controller";
64
aic->num_lines = 32;
65
aic->num_ints = 9;
66
+ aic->mem_size = 0x4000;
67
}
68
69
static const TypeInfo aspeed_2700_intc_info = {
70
--
71
2.48.1
72
73
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
Rename the variables "status_addr" to "status_reg" and "addr" to "reg" because
4
they are used as register index. This change makes the code more appropriate
5
and improves readability.
6
7
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
8
Reviewed-by: Cédric Le Goater <clg@redhat.com>
9
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-3-jamin_lin@aspeedtech.com
10
Signed-off-by: Cédric Le Goater <clg@redhat.com>
11
---
12
hw/intc/aspeed_intc.c | 38 +++++++++++++++++++-------------------
13
1 file changed, 19 insertions(+), 19 deletions(-)
14
15
diff --git a/hw/intc/aspeed_intc.c b/hw/intc/aspeed_intc.c
16
index XXXXXXX..XXXXXXX 100644
17
--- a/hw/intc/aspeed_intc.c
18
+++ b/hw/intc/aspeed_intc.c
19
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_set_irq(void *opaque, int irq, int level)
20
{
21
AspeedINTCState *s = (AspeedINTCState *)opaque;
22
AspeedINTCClass *aic = ASPEED_INTC_GET_CLASS(s);
23
- uint32_t status_addr = GICINT_STATUS_BASE + ((0x100 * irq) >> 2);
24
+ uint32_t status_reg = GICINT_STATUS_BASE + ((0x100 * irq) >> 2);
25
uint32_t select = 0;
26
uint32_t enable;
27
int i;
28
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_set_irq(void *opaque, int irq, int level)
29
30
trace_aspeed_intc_select(select);
31
32
- if (s->mask[irq] || s->regs[status_addr]) {
33
+ if (s->mask[irq] || s->regs[status_reg]) {
34
/*
35
* a. mask is not 0 means in ISR mode
36
* sources interrupt routine are executing.
37
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_set_irq(void *opaque, int irq, int level)
38
* notify firmware which source interrupt are coming
39
* by setting status register
40
*/
41
- s->regs[status_addr] = select;
42
- trace_aspeed_intc_trigger_irq(irq, s->regs[status_addr]);
43
+ s->regs[status_reg] = select;
44
+ trace_aspeed_intc_trigger_irq(irq, s->regs[status_reg]);
45
aspeed_intc_update(s, irq, 1);
46
}
47
}
48
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_set_irq(void *opaque, int irq, int level)
49
static uint64_t aspeed_intc_read(void *opaque, hwaddr offset, unsigned int size)
50
{
51
AspeedINTCState *s = ASPEED_INTC(opaque);
52
- uint32_t addr = offset >> 2;
53
+ uint32_t reg = offset >> 2;
54
uint32_t value = 0;
55
56
- if (addr >= ASPEED_INTC_NR_REGS) {
57
+ if (reg >= ASPEED_INTC_NR_REGS) {
58
qemu_log_mask(LOG_GUEST_ERROR,
59
"%s: Out-of-bounds read at offset 0x%" HWADDR_PRIx "\n",
60
__func__, offset);
61
return 0;
62
}
63
64
- value = s->regs[addr];
65
+ value = s->regs[reg];
66
trace_aspeed_intc_read(offset, size, value);
67
68
return value;
69
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_write(void *opaque, hwaddr offset, uint64_t data,
70
{
71
AspeedINTCState *s = ASPEED_INTC(opaque);
72
AspeedINTCClass *aic = ASPEED_INTC_GET_CLASS(s);
73
- uint32_t addr = offset >> 2;
74
+ uint32_t reg = offset >> 2;
75
uint32_t old_enable;
76
uint32_t change;
77
uint32_t irq;
78
79
- if (addr >= ASPEED_INTC_NR_REGS) {
80
+ if (reg >= ASPEED_INTC_NR_REGS) {
81
qemu_log_mask(LOG_GUEST_ERROR,
82
"%s: Out-of-bounds write at offset 0x%" HWADDR_PRIx "\n",
83
__func__, offset);
84
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_write(void *opaque, hwaddr offset, uint64_t data,
85
86
trace_aspeed_intc_write(offset, size, data);
87
88
- switch (addr) {
89
+ switch (reg) {
90
case R_GICINT128_EN:
91
case R_GICINT129_EN:
92
case R_GICINT130_EN:
93
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_write(void *opaque, hwaddr offset, uint64_t data,
94
95
/* disable all source interrupt */
96
if (!data && !s->enable[irq]) {
97
- s->regs[addr] = data;
98
+ s->regs[reg] = data;
99
return;
100
}
101
102
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_write(void *opaque, hwaddr offset, uint64_t data,
103
/* enable new source interrupt */
104
if (old_enable != s->enable[irq]) {
105
trace_aspeed_intc_enable(s->enable[irq]);
106
- s->regs[addr] = data;
107
+ s->regs[reg] = data;
108
return;
109
}
110
111
/* mask and unmask source interrupt */
112
- change = s->regs[addr] ^ data;
113
+ change = s->regs[reg] ^ data;
114
if (change & data) {
115
s->mask[irq] &= ~change;
116
trace_aspeed_intc_unmask(change, s->mask[irq]);
117
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_write(void *opaque, hwaddr offset, uint64_t data,
118
s->mask[irq] |= change;
119
trace_aspeed_intc_mask(change, s->mask[irq]);
120
}
121
- s->regs[addr] = data;
122
+ s->regs[reg] = data;
123
break;
124
case R_GICINT128_STATUS:
125
case R_GICINT129_STATUS:
126
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_write(void *opaque, hwaddr offset, uint64_t data,
127
}
128
129
/* clear status */
130
- s->regs[addr] &= ~data;
131
+ s->regs[reg] &= ~data;
132
133
/*
134
* These status registers are used for notify sources ISR are executed.
135
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_write(void *opaque, hwaddr offset, uint64_t data,
136
}
137
138
/* All source ISR execution are done */
139
- if (!s->regs[addr]) {
140
+ if (!s->regs[reg]) {
141
trace_aspeed_intc_all_isr_done(irq);
142
if (s->pending[irq]) {
143
/*
144
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_write(void *opaque, hwaddr offset, uint64_t data,
145
* notify firmware which source interrupt are pending
146
* by setting status register
147
*/
148
- s->regs[addr] = s->pending[irq];
149
+ s->regs[reg] = s->pending[irq];
150
s->pending[irq] = 0;
151
- trace_aspeed_intc_trigger_irq(irq, s->regs[addr]);
152
+ trace_aspeed_intc_trigger_irq(irq, s->regs[reg]);
153
aspeed_intc_update(s, irq, 1);
154
} else {
155
/* clear irq */
156
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_write(void *opaque, hwaddr offset, uint64_t data,
157
}
158
break;
159
default:
160
- s->regs[addr] = data;
161
+ s->regs[reg] = data;
162
break;
163
}
164
165
--
166
2.48.1
167
168
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
Currently, the size of the "regs" array is 0x2000, which is too large. To save
4
code size and avoid mapping large unused gaps, will update it to only map the
5
useful set of registers. This update will support multiple sub-regions with
6
different sizes.
7
8
To address the redundant size issue, replace the static "regs" array with a
9
dynamically allocated "regs" memory.
10
11
Introduce a new "aspeed_intc_unrealize" function to free the allocated "regs"
12
memory.
13
14
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
15
Reviewed-by: Cédric Le Goater <clg@redhat.com>
16
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-4-jamin_lin@aspeedtech.com
17
Signed-off-by: Cédric Le Goater <clg@redhat.com>
18
---
19
include/hw/intc/aspeed_intc.h | 2 +-
20
hw/intc/aspeed_intc.c | 12 +++++++++++-
21
2 files changed, 12 insertions(+), 2 deletions(-)
22
23
diff --git a/include/hw/intc/aspeed_intc.h b/include/hw/intc/aspeed_intc.h
24
index XXXXXXX..XXXXXXX 100644
25
--- a/include/hw/intc/aspeed_intc.h
26
+++ b/include/hw/intc/aspeed_intc.h
27
@@ -XXX,XX +XXX,XX @@ struct AspeedINTCState {
28
MemoryRegion iomem;
29
MemoryRegion iomem_container;
30
31
- uint32_t regs[ASPEED_INTC_NR_REGS];
32
+ uint32_t *regs;
33
OrIRQState orgates[ASPEED_INTC_NR_INTS];
34
qemu_irq output_pins[ASPEED_INTC_NR_INTS];
35
36
diff --git a/hw/intc/aspeed_intc.c b/hw/intc/aspeed_intc.c
37
index XXXXXXX..XXXXXXX 100644
38
--- a/hw/intc/aspeed_intc.c
39
+++ b/hw/intc/aspeed_intc.c
40
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_reset(DeviceState *dev)
41
{
42
AspeedINTCState *s = ASPEED_INTC(dev);
43
44
- memset(s->regs, 0, sizeof(s->regs));
45
+ memset(s->regs, 0, ASPEED_INTC_NR_REGS << 2);
46
memset(s->enable, 0, sizeof(s->enable));
47
memset(s->mask, 0, sizeof(s->mask));
48
memset(s->pending, 0, sizeof(s->pending));
49
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_realize(DeviceState *dev, Error **errp)
50
51
sysbus_init_mmio(sbd, &s->iomem_container);
52
53
+ s->regs = g_new(uint32_t, ASPEED_INTC_NR_REGS);
54
memory_region_init_io(&s->iomem, OBJECT(s), &aspeed_intc_ops, s,
55
TYPE_ASPEED_INTC ".regs", ASPEED_INTC_NR_REGS << 2);
56
57
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_realize(DeviceState *dev, Error **errp)
58
}
59
}
60
61
+static void aspeed_intc_unrealize(DeviceState *dev)
62
+{
63
+ AspeedINTCState *s = ASPEED_INTC(dev);
64
+
65
+ g_free(s->regs);
66
+ s->regs = NULL;
67
+}
68
+
69
static void aspeed_intc_class_init(ObjectClass *klass, void *data)
70
{
71
DeviceClass *dc = DEVICE_CLASS(klass);
72
73
dc->desc = "ASPEED INTC Controller";
74
dc->realize = aspeed_intc_realize;
75
+ dc->unrealize = aspeed_intc_unrealize;
76
device_class_set_legacy_reset(dc, aspeed_intc_reset);
77
dc->vmsd = NULL;
78
}
79
--
80
2.48.1
81
82
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
Currently, the size of the regs array is 0x2000, which is too large. So far,
4
it only use GICINT128 - GICINT134, and the offsets from 0 to 0x1000 are unused.
5
To save code size, introduce a new class attribute "reg_size" to set the
6
different register sizes for the INTC models in AST2700 and add a regs
7
sub-region in the memory container.
8
9
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
10
Reviewed-by: Cédric Le Goater <clg@redhat.com>
11
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-5-jamin_lin@aspeedtech.com
12
Signed-off-by: Cédric Le Goater <clg@redhat.com>
13
---
14
include/hw/intc/aspeed_intc.h | 2 +-
15
hw/intc/aspeed_intc.c | 22 +++++-----------------
16
2 files changed, 6 insertions(+), 18 deletions(-)
17
18
diff --git a/include/hw/intc/aspeed_intc.h b/include/hw/intc/aspeed_intc.h
19
index XXXXXXX..XXXXXXX 100644
20
--- a/include/hw/intc/aspeed_intc.h
21
+++ b/include/hw/intc/aspeed_intc.h
22
@@ -XXX,XX +XXX,XX @@
23
#define TYPE_ASPEED_2700_INTC TYPE_ASPEED_INTC "-ast2700"
24
OBJECT_DECLARE_TYPE(AspeedINTCState, AspeedINTCClass, ASPEED_INTC)
25
26
-#define ASPEED_INTC_NR_REGS (0x2000 >> 2)
27
#define ASPEED_INTC_NR_INTS 9
28
29
struct AspeedINTCState {
30
@@ -XXX,XX +XXX,XX @@ struct AspeedINTCClass {
31
uint32_t num_lines;
32
uint32_t num_ints;
33
uint64_t mem_size;
34
+ uint64_t nr_regs;
35
};
36
37
#endif /* ASPEED_INTC_H */
38
diff --git a/hw/intc/aspeed_intc.c b/hw/intc/aspeed_intc.c
39
index XXXXXXX..XXXXXXX 100644
40
--- a/hw/intc/aspeed_intc.c
41
+++ b/hw/intc/aspeed_intc.c
42
@@ -XXX,XX +XXX,XX @@ static uint64_t aspeed_intc_read(void *opaque, hwaddr offset, unsigned int size)
43
uint32_t reg = offset >> 2;
44
uint32_t value = 0;
45
46
- if (reg >= ASPEED_INTC_NR_REGS) {
47
- qemu_log_mask(LOG_GUEST_ERROR,
48
- "%s: Out-of-bounds read at offset 0x%" HWADDR_PRIx "\n",
49
- __func__, offset);
50
- return 0;
51
- }
52
-
53
value = s->regs[reg];
54
trace_aspeed_intc_read(offset, size, value);
55
56
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_write(void *opaque, hwaddr offset, uint64_t data,
57
uint32_t change;
58
uint32_t irq;
59
60
- if (reg >= ASPEED_INTC_NR_REGS) {
61
- qemu_log_mask(LOG_GUEST_ERROR,
62
- "%s: Out-of-bounds write at offset 0x%" HWADDR_PRIx "\n",
63
- __func__, offset);
64
- return;
65
- }
66
-
67
trace_aspeed_intc_write(offset, size, data);
68
69
switch (reg) {
70
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_instance_init(Object *obj)
71
static void aspeed_intc_reset(DeviceState *dev)
72
{
73
AspeedINTCState *s = ASPEED_INTC(dev);
74
+ AspeedINTCClass *aic = ASPEED_INTC_GET_CLASS(s);
75
76
- memset(s->regs, 0, ASPEED_INTC_NR_REGS << 2);
77
+ memset(s->regs, 0, aic->nr_regs << 2);
78
memset(s->enable, 0, sizeof(s->enable));
79
memset(s->mask, 0, sizeof(s->mask));
80
memset(s->pending, 0, sizeof(s->pending));
81
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_realize(DeviceState *dev, Error **errp)
82
83
sysbus_init_mmio(sbd, &s->iomem_container);
84
85
- s->regs = g_new(uint32_t, ASPEED_INTC_NR_REGS);
86
+ s->regs = g_new(uint32_t, aic->nr_regs);
87
memory_region_init_io(&s->iomem, OBJECT(s), &aspeed_intc_ops, s,
88
- TYPE_ASPEED_INTC ".regs", ASPEED_INTC_NR_REGS << 2);
89
+ TYPE_ASPEED_INTC ".regs", aic->nr_regs << 2);
90
91
memory_region_add_subregion(&s->iomem_container, 0x0, &s->iomem);
92
93
@@ -XXX,XX +XXX,XX @@ static void aspeed_2700_intc_class_init(ObjectClass *klass, void *data)
94
aic->num_lines = 32;
95
aic->num_ints = 9;
96
aic->mem_size = 0x4000;
97
+ aic->nr_regs = 0x2000 >> 2;
98
}
99
100
static const TypeInfo aspeed_2700_intc_info = {
101
--
102
2.48.1
103
104
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
Currently, the size of the "regs" array is 0x2000, which is too large. So far,
4
it only uses "GICINT128 to `GICINT134", and the offsets from 0 to 0x1000 are
5
unused. To save code size and avoid mapping large unused gaps, update to only
6
map the useful set of registers:
7
8
INTC register [0x1000 – 0x1804]
9
10
Update "reg_size" to 0x808. Introduce a new class attribute "reg_offset" to set
11
the start offset of a "INTC" sub-region. Set the "reg_offset" to 0x1000 for INTC
12
registers.
13
14
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
15
Reviewed-by: Cédric Le Goater <clg@redhat.com>
16
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-6-jamin_lin@aspeedtech.com
17
Signed-off-by: Cédric Le Goater <clg@redhat.com>
18
---
19
include/hw/intc/aspeed_intc.h | 1 +
20
hw/intc/aspeed_intc.c | 50 ++++++++++++++++++++---------------
21
2 files changed, 30 insertions(+), 21 deletions(-)
22
23
diff --git a/include/hw/intc/aspeed_intc.h b/include/hw/intc/aspeed_intc.h
24
index XXXXXXX..XXXXXXX 100644
25
--- a/include/hw/intc/aspeed_intc.h
26
+++ b/include/hw/intc/aspeed_intc.h
27
@@ -XXX,XX +XXX,XX @@ struct AspeedINTCClass {
28
uint32_t num_ints;
29
uint64_t mem_size;
30
uint64_t nr_regs;
31
+ uint64_t reg_offset;
32
};
33
34
#endif /* ASPEED_INTC_H */
35
diff --git a/hw/intc/aspeed_intc.c b/hw/intc/aspeed_intc.c
36
index XXXXXXX..XXXXXXX 100644
37
--- a/hw/intc/aspeed_intc.c
38
+++ b/hw/intc/aspeed_intc.c
39
@@ -XXX,XX +XXX,XX @@
40
#include "hw/registerfields.h"
41
#include "qapi/error.h"
42
43
-/* INTC Registers */
44
-REG32(GICINT128_EN, 0x1000)
45
-REG32(GICINT128_STATUS, 0x1004)
46
-REG32(GICINT129_EN, 0x1100)
47
-REG32(GICINT129_STATUS, 0x1104)
48
-REG32(GICINT130_EN, 0x1200)
49
-REG32(GICINT130_STATUS, 0x1204)
50
-REG32(GICINT131_EN, 0x1300)
51
-REG32(GICINT131_STATUS, 0x1304)
52
-REG32(GICINT132_EN, 0x1400)
53
-REG32(GICINT132_STATUS, 0x1404)
54
-REG32(GICINT133_EN, 0x1500)
55
-REG32(GICINT133_STATUS, 0x1504)
56
-REG32(GICINT134_EN, 0x1600)
57
-REG32(GICINT134_STATUS, 0x1604)
58
-REG32(GICINT135_EN, 0x1700)
59
-REG32(GICINT135_STATUS, 0x1704)
60
-REG32(GICINT136_EN, 0x1800)
61
-REG32(GICINT136_STATUS, 0x1804)
62
+/*
63
+ * INTC Registers
64
+ *
65
+ * values below are offset by - 0x1000 from datasheet
66
+ * because its memory region is start at 0x1000
67
+ *
68
+ */
69
+REG32(GICINT128_EN, 0x000)
70
+REG32(GICINT128_STATUS, 0x004)
71
+REG32(GICINT129_EN, 0x100)
72
+REG32(GICINT129_STATUS, 0x104)
73
+REG32(GICINT130_EN, 0x200)
74
+REG32(GICINT130_STATUS, 0x204)
75
+REG32(GICINT131_EN, 0x300)
76
+REG32(GICINT131_STATUS, 0x304)
77
+REG32(GICINT132_EN, 0x400)
78
+REG32(GICINT132_STATUS, 0x404)
79
+REG32(GICINT133_EN, 0x500)
80
+REG32(GICINT133_STATUS, 0x504)
81
+REG32(GICINT134_EN, 0x600)
82
+REG32(GICINT134_STATUS, 0x604)
83
+REG32(GICINT135_EN, 0x700)
84
+REG32(GICINT135_STATUS, 0x704)
85
+REG32(GICINT136_EN, 0x800)
86
+REG32(GICINT136_STATUS, 0x804)
87
88
#define GICINT_STATUS_BASE R_GICINT128_STATUS
89
90
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_realize(DeviceState *dev, Error **errp)
91
memory_region_init_io(&s->iomem, OBJECT(s), &aspeed_intc_ops, s,
92
TYPE_ASPEED_INTC ".regs", aic->nr_regs << 2);
93
94
- memory_region_add_subregion(&s->iomem_container, 0x0, &s->iomem);
95
+ memory_region_add_subregion(&s->iomem_container, aic->reg_offset,
96
+ &s->iomem);
97
98
qdev_init_gpio_in(dev, aspeed_intc_set_irq, aic->num_ints);
99
100
@@ -XXX,XX +XXX,XX @@ static void aspeed_2700_intc_class_init(ObjectClass *klass, void *data)
101
aic->num_lines = 32;
102
aic->num_ints = 9;
103
aic->mem_size = 0x4000;
104
- aic->nr_regs = 0x2000 >> 2;
105
+ aic->nr_regs = 0x808 >> 2;
106
+ aic->reg_offset = 0x1000;
107
}
108
109
static const TypeInfo aspeed_2700_intc_info = {
110
--
111
2.48.1
112
113
diff view generated by jsdifflib
New patch
1
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
2
3
The behavior of the enable and status registers is almost identical between
4
INTC(CPU Die) and INTCIO(IO Die). To reduce duplicated code, adds
5
"aspeed_intc_enable_handler" functions to handle enable register write
6
behavior and "aspeed_intc_status_handler" functions to handle status
7
register write behavior. No functional change.
8
9
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
10
Reviewed-by: Cédric Le Goater <clg@redhat.com>
11
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-7-jamin_lin@aspeedtech.com
12
Signed-off-by: Cédric Le Goater <clg@redhat.com>
13
---
14
hw/intc/aspeed_intc.c | 191 ++++++++++++++++++++++++------------------
15
1 file changed, 108 insertions(+), 83 deletions(-)
16
17
diff --git a/hw/intc/aspeed_intc.c b/hw/intc/aspeed_intc.c
18
index XXXXXXX..XXXXXXX 100644
19
--- a/hw/intc/aspeed_intc.c
20
+++ b/hw/intc/aspeed_intc.c
21
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_set_irq(void *opaque, int irq, int level)
22
}
23
}
24
25
+static void aspeed_intc_enable_handler(AspeedINTCState *s, hwaddr offset,
26
+ uint64_t data)
27
+{
28
+ AspeedINTCClass *aic = ASPEED_INTC_GET_CLASS(s);
29
+ uint32_t reg = offset >> 2;
30
+ uint32_t old_enable;
31
+ uint32_t change;
32
+ uint32_t irq;
33
+
34
+ irq = (offset & 0x0f00) >> 8;
35
+
36
+ if (irq >= aic->num_ints) {
37
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: Invalid interrupt number: %d\n",
38
+ __func__, irq);
39
+ return;
40
+ }
41
+
42
+ /*
43
+ * The enable registers are used to enable source interrupts.
44
+ * They also handle masking and unmasking of source interrupts
45
+ * during the execution of the source ISR.
46
+ */
47
+
48
+ /* disable all source interrupt */
49
+ if (!data && !s->enable[irq]) {
50
+ s->regs[reg] = data;
51
+ return;
52
+ }
53
+
54
+ old_enable = s->enable[irq];
55
+ s->enable[irq] |= data;
56
+
57
+ /* enable new source interrupt */
58
+ if (old_enable != s->enable[irq]) {
59
+ trace_aspeed_intc_enable(s->enable[irq]);
60
+ s->regs[reg] = data;
61
+ return;
62
+ }
63
+
64
+ /* mask and unmask source interrupt */
65
+ change = s->regs[reg] ^ data;
66
+ if (change & data) {
67
+ s->mask[irq] &= ~change;
68
+ trace_aspeed_intc_unmask(change, s->mask[irq]);
69
+ } else {
70
+ s->mask[irq] |= change;
71
+ trace_aspeed_intc_mask(change, s->mask[irq]);
72
+ }
73
+
74
+ s->regs[reg] = data;
75
+}
76
+
77
+static void aspeed_intc_status_handler(AspeedINTCState *s, hwaddr offset,
78
+ uint64_t data)
79
+{
80
+ AspeedINTCClass *aic = ASPEED_INTC_GET_CLASS(s);
81
+ uint32_t reg = offset >> 2;
82
+ uint32_t irq;
83
+
84
+ if (!data) {
85
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: Invalid data 0\n", __func__);
86
+ return;
87
+ }
88
+
89
+ irq = (offset & 0x0f00) >> 8;
90
+
91
+ if (irq >= aic->num_ints) {
92
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: Invalid interrupt number: %d\n",
93
+ __func__, irq);
94
+ return;
95
+ }
96
+
97
+ /* clear status */
98
+ s->regs[reg] &= ~data;
99
+
100
+ /*
101
+ * These status registers are used for notify sources ISR are executed.
102
+ * If one source ISR is executed, it will clear one bit.
103
+ * If it clear all bits, it means to initialize this register status
104
+ * rather than sources ISR are executed.
105
+ */
106
+ if (data == 0xffffffff) {
107
+ return;
108
+ }
109
+
110
+ /* All source ISR execution are done */
111
+ if (!s->regs[reg]) {
112
+ trace_aspeed_intc_all_isr_done(irq);
113
+ if (s->pending[irq]) {
114
+ /*
115
+ * handle pending source interrupt
116
+ * notify firmware which source interrupt are pending
117
+ * by setting status register
118
+ */
119
+ s->regs[reg] = s->pending[irq];
120
+ s->pending[irq] = 0;
121
+ trace_aspeed_intc_trigger_irq(irq, s->regs[reg]);
122
+ aspeed_intc_update(s, irq, 1);
123
+ } else {
124
+ /* clear irq */
125
+ trace_aspeed_intc_clear_irq(irq, 0);
126
+ aspeed_intc_update(s, irq, 0);
127
+ }
128
+ }
129
+}
130
+
131
static uint64_t aspeed_intc_read(void *opaque, hwaddr offset, unsigned int size)
132
{
133
AspeedINTCState *s = ASPEED_INTC(opaque);
134
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_write(void *opaque, hwaddr offset, uint64_t data,
135
unsigned size)
136
{
137
AspeedINTCState *s = ASPEED_INTC(opaque);
138
- AspeedINTCClass *aic = ASPEED_INTC_GET_CLASS(s);
139
uint32_t reg = offset >> 2;
140
- uint32_t old_enable;
141
- uint32_t change;
142
- uint32_t irq;
143
144
trace_aspeed_intc_write(offset, size, data);
145
146
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_write(void *opaque, hwaddr offset, uint64_t data,
147
case R_GICINT134_EN:
148
case R_GICINT135_EN:
149
case R_GICINT136_EN:
150
- irq = (offset & 0x0f00) >> 8;
151
-
152
- if (irq >= aic->num_ints) {
153
- qemu_log_mask(LOG_GUEST_ERROR, "%s: Invalid interrupt number: %d\n",
154
- __func__, irq);
155
- return;
156
- }
157
-
158
- /*
159
- * These registers are used for enable sources interrupt and
160
- * mask and unmask source interrupt while executing source ISR.
161
- */
162
-
163
- /* disable all source interrupt */
164
- if (!data && !s->enable[irq]) {
165
- s->regs[reg] = data;
166
- return;
167
- }
168
-
169
- old_enable = s->enable[irq];
170
- s->enable[irq] |= data;
171
-
172
- /* enable new source interrupt */
173
- if (old_enable != s->enable[irq]) {
174
- trace_aspeed_intc_enable(s->enable[irq]);
175
- s->regs[reg] = data;
176
- return;
177
- }
178
-
179
- /* mask and unmask source interrupt */
180
- change = s->regs[reg] ^ data;
181
- if (change & data) {
182
- s->mask[irq] &= ~change;
183
- trace_aspeed_intc_unmask(change, s->mask[irq]);
184
- } else {
185
- s->mask[irq] |= change;
186
- trace_aspeed_intc_mask(change, s->mask[irq]);
187
- }
188
- s->regs[reg] = data;
189
+ aspeed_intc_enable_handler(s, offset, data);
190
break;
191
case R_GICINT128_STATUS:
192
case R_GICINT129_STATUS:
193
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_write(void *opaque, hwaddr offset, uint64_t data,
194
case R_GICINT134_STATUS:
195
case R_GICINT135_STATUS:
196
case R_GICINT136_STATUS:
197
- irq = (offset & 0x0f00) >> 8;
198
-
199
- if (irq >= aic->num_ints) {
200
- qemu_log_mask(LOG_GUEST_ERROR, "%s: Invalid interrupt number: %d\n",
201
- __func__, irq);
202
- return;
203
- }
204
-
205
- /* clear status */
206
- s->regs[reg] &= ~data;
207
-
208
- /*
209
- * These status registers are used for notify sources ISR are executed.
210
- * If one source ISR is executed, it will clear one bit.
211
- * If it clear all bits, it means to initialize this register status
212
- * rather than sources ISR are executed.
213
- */
214
- if (data == 0xffffffff) {
215
- return;
216
- }
217
-
218
- /* All source ISR execution are done */
219
- if (!s->regs[reg]) {
220
- trace_aspeed_intc_all_isr_done(irq);
221
- if (s->pending[irq]) {
222
- /*
223
- * handle pending source interrupt
224
- * notify firmware which source interrupt are pending
225
- * by setting status register
226
- */
227
- s->regs[reg] = s->pending[irq];
228
- s->pending[irq] = 0;
229
- trace_aspeed_intc_trigger_irq(irq, s->regs[reg]);
230
- aspeed_intc_update(s, irq, 1);
231
- } else {
232
- /* clear irq */
233
- trace_aspeed_intc_clear_irq(irq, 0);
234
- aspeed_intc_update(s, irq, 0);
235
- }
236
- }
237
+ aspeed_intc_status_handler(s, offset, data);
238
break;
239
default:
240
s->regs[reg] = data;
241
--
242
2.48.1
243
244
diff view generated by jsdifflib
New patch
1
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
2
3
Currently, these trace events only refer to INTC. To simplify the INTC model,
4
both INTC(CPU Die) and INTCIO(IO Die) will share the same helper functions.
5
6
However, it is difficult to recognize whether these trace events are comes from
7
INTC or INTCIO. To make these trace events more readable, adds object type name
8
to the INTC trace events.
9
Update trace events to include the "name" field for better identification.
10
11
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
12
Reviewed-by: Cédric Le Goater <clg@redhat.com>
13
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-8-jamin_lin@aspeedtech.com
14
Signed-off-by: Cédric Le Goater <clg@redhat.com>
15
---
16
hw/intc/aspeed_intc.c | 32 +++++++++++++++++++-------------
17
hw/intc/trace-events | 24 ++++++++++++------------
18
2 files changed, 31 insertions(+), 25 deletions(-)
19
20
diff --git a/hw/intc/aspeed_intc.c b/hw/intc/aspeed_intc.c
21
index XXXXXXX..XXXXXXX 100644
22
--- a/hw/intc/aspeed_intc.c
23
+++ b/hw/intc/aspeed_intc.c
24
@@ -XXX,XX +XXX,XX @@ REG32(GICINT136_STATUS, 0x804)
25
static void aspeed_intc_update(AspeedINTCState *s, int irq, int level)
26
{
27
AspeedINTCClass *aic = ASPEED_INTC_GET_CLASS(s);
28
+ const char *name = object_get_typename(OBJECT(s));
29
30
if (irq >= aic->num_ints) {
31
qemu_log_mask(LOG_GUEST_ERROR, "%s: Invalid interrupt number: %d\n",
32
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_update(AspeedINTCState *s, int irq, int level)
33
return;
34
}
35
36
- trace_aspeed_intc_update_irq(irq, level);
37
+ trace_aspeed_intc_update_irq(name, irq, level);
38
qemu_set_irq(s->output_pins[irq], level);
39
}
40
41
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_set_irq(void *opaque, int irq, int level)
42
{
43
AspeedINTCState *s = (AspeedINTCState *)opaque;
44
AspeedINTCClass *aic = ASPEED_INTC_GET_CLASS(s);
45
+ const char *name = object_get_typename(OBJECT(s));
46
uint32_t status_reg = GICINT_STATUS_BASE + ((0x100 * irq) >> 2);
47
uint32_t select = 0;
48
uint32_t enable;
49
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_set_irq(void *opaque, int irq, int level)
50
return;
51
}
52
53
- trace_aspeed_intc_set_irq(irq, level);
54
+ trace_aspeed_intc_set_irq(name, irq, level);
55
enable = s->enable[irq];
56
57
if (!level) {
58
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_set_irq(void *opaque, int irq, int level)
59
return;
60
}
61
62
- trace_aspeed_intc_select(select);
63
+ trace_aspeed_intc_select(name, select);
64
65
if (s->mask[irq] || s->regs[status_reg]) {
66
/*
67
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_set_irq(void *opaque, int irq, int level)
68
* save source interrupt to pending variable.
69
*/
70
s->pending[irq] |= select;
71
- trace_aspeed_intc_pending_irq(irq, s->pending[irq]);
72
+ trace_aspeed_intc_pending_irq(name, irq, s->pending[irq]);
73
} else {
74
/*
75
* notify firmware which source interrupt are coming
76
* by setting status register
77
*/
78
s->regs[status_reg] = select;
79
- trace_aspeed_intc_trigger_irq(irq, s->regs[status_reg]);
80
+ trace_aspeed_intc_trigger_irq(name, irq, s->regs[status_reg]);
81
aspeed_intc_update(s, irq, 1);
82
}
83
}
84
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_enable_handler(AspeedINTCState *s, hwaddr offset,
85
uint64_t data)
86
{
87
AspeedINTCClass *aic = ASPEED_INTC_GET_CLASS(s);
88
+ const char *name = object_get_typename(OBJECT(s));
89
uint32_t reg = offset >> 2;
90
uint32_t old_enable;
91
uint32_t change;
92
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_enable_handler(AspeedINTCState *s, hwaddr offset,
93
94
/* enable new source interrupt */
95
if (old_enable != s->enable[irq]) {
96
- trace_aspeed_intc_enable(s->enable[irq]);
97
+ trace_aspeed_intc_enable(name, s->enable[irq]);
98
s->regs[reg] = data;
99
return;
100
}
101
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_enable_handler(AspeedINTCState *s, hwaddr offset,
102
change = s->regs[reg] ^ data;
103
if (change & data) {
104
s->mask[irq] &= ~change;
105
- trace_aspeed_intc_unmask(change, s->mask[irq]);
106
+ trace_aspeed_intc_unmask(name, change, s->mask[irq]);
107
} else {
108
s->mask[irq] |= change;
109
- trace_aspeed_intc_mask(change, s->mask[irq]);
110
+ trace_aspeed_intc_mask(name, change, s->mask[irq]);
111
}
112
113
s->regs[reg] = data;
114
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_status_handler(AspeedINTCState *s, hwaddr offset,
115
uint64_t data)
116
{
117
AspeedINTCClass *aic = ASPEED_INTC_GET_CLASS(s);
118
+ const char *name = object_get_typename(OBJECT(s));
119
uint32_t reg = offset >> 2;
120
uint32_t irq;
121
122
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_status_handler(AspeedINTCState *s, hwaddr offset,
123
124
/* All source ISR execution are done */
125
if (!s->regs[reg]) {
126
- trace_aspeed_intc_all_isr_done(irq);
127
+ trace_aspeed_intc_all_isr_done(name, irq);
128
if (s->pending[irq]) {
129
/*
130
* handle pending source interrupt
131
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_status_handler(AspeedINTCState *s, hwaddr offset,
132
*/
133
s->regs[reg] = s->pending[irq];
134
s->pending[irq] = 0;
135
- trace_aspeed_intc_trigger_irq(irq, s->regs[reg]);
136
+ trace_aspeed_intc_trigger_irq(name, irq, s->regs[reg]);
137
aspeed_intc_update(s, irq, 1);
138
} else {
139
/* clear irq */
140
- trace_aspeed_intc_clear_irq(irq, 0);
141
+ trace_aspeed_intc_clear_irq(name, irq, 0);
142
aspeed_intc_update(s, irq, 0);
143
}
144
}
145
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_status_handler(AspeedINTCState *s, hwaddr offset,
146
static uint64_t aspeed_intc_read(void *opaque, hwaddr offset, unsigned int size)
147
{
148
AspeedINTCState *s = ASPEED_INTC(opaque);
149
+ const char *name = object_get_typename(OBJECT(s));
150
uint32_t reg = offset >> 2;
151
uint32_t value = 0;
152
153
value = s->regs[reg];
154
- trace_aspeed_intc_read(offset, size, value);
155
+ trace_aspeed_intc_read(name, offset, size, value);
156
157
return value;
158
}
159
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_write(void *opaque, hwaddr offset, uint64_t data,
160
unsigned size)
161
{
162
AspeedINTCState *s = ASPEED_INTC(opaque);
163
+ const char *name = object_get_typename(OBJECT(s));
164
uint32_t reg = offset >> 2;
165
166
- trace_aspeed_intc_write(offset, size, data);
167
+ trace_aspeed_intc_write(name, offset, size, data);
168
169
switch (reg) {
170
case R_GICINT128_EN:
171
diff --git a/hw/intc/trace-events b/hw/intc/trace-events
172
index XXXXXXX..XXXXXXX 100644
173
--- a/hw/intc/trace-events
174
+++ b/hw/intc/trace-events
175
@@ -XXX,XX +XXX,XX @@ aspeed_vic_update_irq(int flags) "Raising IRQ: %d"
176
aspeed_vic_read(uint64_t offset, unsigned size, uint32_t value) "From 0x%" PRIx64 " of size %u: 0x%" PRIx32
177
aspeed_vic_write(uint64_t offset, unsigned size, uint32_t data) "To 0x%" PRIx64 " of size %u: 0x%" PRIx32
178
# aspeed_intc.c
179
-aspeed_intc_read(uint64_t offset, unsigned size, uint32_t value) "From 0x%" PRIx64 " of size %u: 0x%" PRIx32
180
-aspeed_intc_write(uint64_t offset, unsigned size, uint32_t data) "To 0x%" PRIx64 " of size %u: 0x%" PRIx32
181
-aspeed_intc_set_irq(int irq, int level) "Set IRQ %d: %d"
182
-aspeed_intc_clear_irq(int irq, int level) "Clear IRQ %d: %d"
183
-aspeed_intc_update_irq(int irq, int level) "Update IRQ: %d: %d"
184
-aspeed_intc_pending_irq(int irq, uint32_t value) "Pending IRQ: %d: 0x%x"
185
-aspeed_intc_trigger_irq(int irq, uint32_t value) "Trigger IRQ: %d: 0x%x"
186
-aspeed_intc_all_isr_done(int irq) "All source ISR execution are done: %d"
187
-aspeed_intc_enable(uint32_t value) "Enable: 0x%x"
188
-aspeed_intc_select(uint32_t value) "Select: 0x%x"
189
-aspeed_intc_mask(uint32_t change, uint32_t value) "Mask: 0x%x: 0x%x"
190
-aspeed_intc_unmask(uint32_t change, uint32_t value) "UnMask: 0x%x: 0x%x"
191
+aspeed_intc_read(const char *s, uint64_t offset, unsigned size, uint32_t value) "%s: From 0x%" PRIx64 " of size %u: 0x%" PRIx32
192
+aspeed_intc_write(const char *s, uint64_t offset, unsigned size, uint32_t data) "%s: To 0x%" PRIx64 " of size %u: 0x%" PRIx32
193
+aspeed_intc_set_irq(const char *s, int irq, int level) "%s: Set IRQ %d: %d"
194
+aspeed_intc_clear_irq(const char *s, int irq, int level) "%s: Clear IRQ %d: %d"
195
+aspeed_intc_update_irq(const char *s, int irq, int level) "%s: Update IRQ: %d: %d"
196
+aspeed_intc_pending_irq(const char *s, int irq, uint32_t value) "%s: Pending IRQ: %d: 0x%x"
197
+aspeed_intc_trigger_irq(const char *s, int irq, uint32_t value) "%s: Trigger IRQ: %d: 0x%x"
198
+aspeed_intc_all_isr_done(const char *s, int irq) "%s: All source ISR execution are done: %d"
199
+aspeed_intc_enable(const char *s, uint32_t value) "%s: Enable: 0x%x"
200
+aspeed_intc_select(const char *s, uint32_t value) "%s: Select: 0x%x"
201
+aspeed_intc_mask(const char *s, uint32_t change, uint32_t value) "%s: Mask: 0x%x: 0x%x"
202
+aspeed_intc_unmask(const char *s, uint32_t change, uint32_t value) "%s: UnMask: 0x%x: 0x%x"
203
204
# arm_gic.c
205
gic_enable_irq(int irq) "irq %d enabled"
206
--
207
2.48.1
208
209
diff view generated by jsdifflib
1
Some machines don't have much differences a part from the flash model
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
2
being used. Introduce new machine properties to change them from the
3
command line.
4
2
5
For instance, to start the ast2500-evb machine with a different FMC
3
Currently, AST2700 SoC only supports A0. To support AST2700 A1, rename its IRQ
6
chip and a 64M SPI chip, use :
4
table and machine name.
7
5
8
-M ast2500-evb,fmc-model=mx25l25635e,spi-model=mx66u51235f
6
To follow the machine deprecation rule, the initial machine "ast2700-evb" is
7
aliased to "ast2700a0-evb." In the future, we will alias "ast2700-evb" to new
8
SoCs, such as "ast2700a1-evb."
9
9
10
Cc: 郁雷 <yulei.sh@bytedance.com>
10
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
11
Reviewed-by: Joel Stanley <joel@jms.id.au>
11
Reviewed-by: Cédric Le Goater <clg@redhat.com>
12
Tested-by: Lei YU <yulei.sh@bytedance.com>
12
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-9-jamin_lin@aspeedtech.com
13
Message-Id: <20200915054859.2338477-1-clg@kaod.org>
13
Signed-off-by: Cédric Le Goater <clg@redhat.com>
14
Signed-off-by: Cédric Le Goater <clg@kaod.org>
15
---
14
---
16
docs/system/arm/aspeed.rst | 18 +++++++++++++++
15
hw/arm/aspeed.c | 9 +++++----
17
hw/arm/aspeed.c | 45 ++++++++++++++++++++++++++++++++++++--
16
hw/arm/aspeed_ast27x0.c | 8 ++++----
18
2 files changed, 61 insertions(+), 2 deletions(-)
17
2 files changed, 9 insertions(+), 8 deletions(-)
19
18
20
diff --git a/docs/system/arm/aspeed.rst b/docs/system/arm/aspeed.rst
21
index XXXXXXX..XXXXXXX 100644
22
--- a/docs/system/arm/aspeed.rst
23
+++ b/docs/system/arm/aspeed.rst
24
@@ -XXX,XX +XXX,XX @@ The image should be attached as an MTD drive. Run :
25
26
$ qemu-system-arm -M romulus-bmc -nic user \
27
    -drive file=flash-romulus,format=raw,if=mtd -nographic
28
+
29
+Options specific to Aspeed machines are :
30
+
31
+ * ``execute-in-place`` which emulates the boot from the CE0 flash
32
+ device by using the FMC controller to load the instructions, and
33
+ not simply from RAM. This takes a little longer.
34
+
35
+ * ``fmc-model`` to change the FMC Flash model. FW needs support for
36
+ the chip model to boot.
37
+
38
+ * ``spi-model`` to change the SPI Flash model.
39
+
40
+For instance, to start the ``ast2500-evb`` machine with a different
41
+FMC chip and a bigger (64M) SPI chip, use :
42
+
43
+.. code-block:: bash
44
+
45
+ -M ast2500-evb,fmc-model=mx25l25635e,spi-model=mx66u51235f
46
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
19
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
47
index XXXXXXX..XXXXXXX 100644
20
index XXXXXXX..XXXXXXX 100644
48
--- a/hw/arm/aspeed.c
21
--- a/hw/arm/aspeed.c
49
+++ b/hw/arm/aspeed.c
22
+++ b/hw/arm/aspeed.c
50
@@ -XXX,XX +XXX,XX @@ struct AspeedMachineState {
23
@@ -XXX,XX +XXX,XX @@ static void ast2700_evb_i2c_init(AspeedMachineState *bmc)
51
MemoryRegion ram_container;
24
TYPE_TMP105, 0x4d);
52
MemoryRegion max_ram;
25
}
53
bool mmio_exec;
26
54
+ char *fmc_model;
27
-static void aspeed_machine_ast2700_evb_class_init(ObjectClass *oc, void *data)
55
+ char *spi_model;
28
+static void aspeed_machine_ast2700a0_evb_class_init(ObjectClass *oc, void *data)
29
{
30
MachineClass *mc = MACHINE_CLASS(oc);
31
AspeedMachineClass *amc = ASPEED_MACHINE_CLASS(oc);
32
33
- mc->desc = "Aspeed AST2700 EVB (Cortex-A35)";
34
+ mc->alias = "ast2700-evb";
35
+ mc->desc = "Aspeed AST2700 A0 EVB (Cortex-A35)";
36
amc->soc_name = "ast2700-a0";
37
amc->hw_strap1 = AST2700_EVB_HW_STRAP1;
38
amc->hw_strap2 = AST2700_EVB_HW_STRAP2;
39
@@ -XXX,XX +XXX,XX @@ static const TypeInfo aspeed_machine_types[] = {
40
.class_init = aspeed_minibmc_machine_ast1030_evb_class_init,
41
#ifdef TARGET_AARCH64
42
}, {
43
- .name = MACHINE_TYPE_NAME("ast2700-evb"),
44
+ .name = MACHINE_TYPE_NAME("ast2700a0-evb"),
45
.parent = TYPE_ASPEED_MACHINE,
46
- .class_init = aspeed_machine_ast2700_evb_class_init,
47
+ .class_init = aspeed_machine_ast2700a0_evb_class_init,
48
#endif
49
}, {
50
.name = TYPE_ASPEED_MACHINE,
51
diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c
52
index XXXXXXX..XXXXXXX 100644
53
--- a/hw/arm/aspeed_ast27x0.c
54
+++ b/hw/arm/aspeed_ast27x0.c
55
@@ -XXX,XX +XXX,XX @@ static const hwaddr aspeed_soc_ast2700_memmap[] = {
56
#define AST2700_MAX_IRQ 256
57
58
/* Shared Peripheral Interrupt values below are offset by -32 from datasheet */
59
-static const int aspeed_soc_ast2700_irqmap[] = {
60
+static const int aspeed_soc_ast2700a0_irqmap[] = {
61
[ASPEED_DEV_UART0] = 132,
62
[ASPEED_DEV_UART1] = 132,
63
[ASPEED_DEV_UART2] = 132,
64
@@ -XXX,XX +XXX,XX @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp)
65
create_unimplemented_device("ast2700.io", 0x0, 0x4000000);
66
}
67
68
-static void aspeed_soc_ast2700_class_init(ObjectClass *oc, void *data)
69
+static void aspeed_soc_ast2700a0_class_init(ObjectClass *oc, void *data)
70
{
71
static const char * const valid_cpu_types[] = {
72
ARM_CPU_TYPE_NAME("cortex-a35"),
73
@@ -XXX,XX +XXX,XX @@ static void aspeed_soc_ast2700_class_init(ObjectClass *oc, void *data)
74
sc->uarts_num = 13;
75
sc->num_cpus = 4;
76
sc->uarts_base = ASPEED_DEV_UART0;
77
- sc->irqmap = aspeed_soc_ast2700_irqmap;
78
+ sc->irqmap = aspeed_soc_ast2700a0_irqmap;
79
sc->memmap = aspeed_soc_ast2700_memmap;
80
sc->get_irq = aspeed_soc_ast2700_get_irq;
81
}
82
@@ -XXX,XX +XXX,XX @@ static const TypeInfo aspeed_soc_ast27x0_types[] = {
83
.name = "ast2700-a0",
84
.parent = TYPE_ASPEED27X0_SOC,
85
.instance_init = aspeed_soc_ast2700_init,
86
- .class_init = aspeed_soc_ast2700_class_init,
87
+ .class_init = aspeed_soc_ast2700a0_class_init,
88
},
56
};
89
};
57
90
58
/* Palmetto hardware value: 0x120CE416 */
59
@@ -XXX,XX +XXX,XX @@ static void aspeed_machine_init(MachineState *machine)
60
"max_ram", max_ram_size - ram_size);
61
memory_region_add_subregion(&bmc->ram_container, ram_size, &bmc->max_ram);
62
63
- aspeed_board_init_flashes(&bmc->soc.fmc, amc->fmc_model);
64
- aspeed_board_init_flashes(&bmc->soc.spi[0], amc->spi_model);
65
+ aspeed_board_init_flashes(&bmc->soc.fmc, bmc->fmc_model ?
66
+ bmc->fmc_model : amc->fmc_model);
67
+ aspeed_board_init_flashes(&bmc->soc.spi[0], bmc->spi_model ?
68
+ bmc->spi_model : amc->spi_model);
69
70
/* Install first FMC flash content as a boot rom. */
71
if (drive0) {
72
@@ -XXX,XX +XXX,XX @@ static void aspeed_machine_instance_init(Object *obj)
73
ASPEED_MACHINE(obj)->mmio_exec = false;
74
}
75
76
+static char *aspeed_get_fmc_model(Object *obj, Error **errp)
77
+{
78
+ AspeedMachineState *bmc = ASPEED_MACHINE(obj);
79
+ return g_strdup(bmc->fmc_model);
80
+}
81
+
82
+static void aspeed_set_fmc_model(Object *obj, const char *value, Error **errp)
83
+{
84
+ AspeedMachineState *bmc = ASPEED_MACHINE(obj);
85
+
86
+ g_free(bmc->fmc_model);
87
+ bmc->fmc_model = g_strdup(value);
88
+}
89
+
90
+static char *aspeed_get_spi_model(Object *obj, Error **errp)
91
+{
92
+ AspeedMachineState *bmc = ASPEED_MACHINE(obj);
93
+ return g_strdup(bmc->spi_model);
94
+}
95
+
96
+static void aspeed_set_spi_model(Object *obj, const char *value, Error **errp)
97
+{
98
+ AspeedMachineState *bmc = ASPEED_MACHINE(obj);
99
+
100
+ g_free(bmc->spi_model);
101
+ bmc->spi_model = g_strdup(value);
102
+}
103
+
104
static void aspeed_machine_class_props_init(ObjectClass *oc)
105
{
106
object_class_property_add_bool(oc, "execute-in-place",
107
@@ -XXX,XX +XXX,XX @@ static void aspeed_machine_class_props_init(ObjectClass *oc)
108
aspeed_set_mmio_exec);
109
object_class_property_set_description(oc, "execute-in-place",
110
"boot directly from CE0 flash device");
111
+
112
+ object_class_property_add_str(oc, "fmc-model", aspeed_get_fmc_model,
113
+ aspeed_set_fmc_model);
114
+ object_class_property_set_description(oc, "fmc-model",
115
+ "Change the FMC Flash model");
116
+ object_class_property_add_str(oc, "spi-model", aspeed_get_spi_model,
117
+ aspeed_set_spi_model);
118
+ object_class_property_set_description(oc, "spi-model",
119
+ "Change the SPI Flash model");
120
}
121
122
static int aspeed_soc_num_cpus(const char *soc_name)
123
--
91
--
124
2.25.4
92
2.48.1
125
93
126
94
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
To improve readability, sort the IRQ table by IRQ number.
4
5
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
6
Reviewed-by: Cédric Le Goater <clg@redhat.com>
7
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-10-jamin_lin@aspeedtech.com
8
Signed-off-by: Cédric Le Goater <clg@redhat.com>
9
---
10
hw/arm/aspeed_ast27x0.c | 50 ++++++++++++++++++++---------------------
11
1 file changed, 25 insertions(+), 25 deletions(-)
12
13
diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c
14
index XXXXXXX..XXXXXXX 100644
15
--- a/hw/arm/aspeed_ast27x0.c
16
+++ b/hw/arm/aspeed_ast27x0.c
17
@@ -XXX,XX +XXX,XX @@ static const hwaddr aspeed_soc_ast2700_memmap[] = {
18
19
/* Shared Peripheral Interrupt values below are offset by -32 from datasheet */
20
static const int aspeed_soc_ast2700a0_irqmap[] = {
21
- [ASPEED_DEV_UART0] = 132,
22
- [ASPEED_DEV_UART1] = 132,
23
- [ASPEED_DEV_UART2] = 132,
24
- [ASPEED_DEV_UART3] = 132,
25
- [ASPEED_DEV_UART4] = 8,
26
- [ASPEED_DEV_UART5] = 132,
27
- [ASPEED_DEV_UART6] = 132,
28
- [ASPEED_DEV_UART7] = 132,
29
- [ASPEED_DEV_UART8] = 132,
30
- [ASPEED_DEV_UART9] = 132,
31
- [ASPEED_DEV_UART10] = 132,
32
- [ASPEED_DEV_UART11] = 132,
33
- [ASPEED_DEV_UART12] = 132,
34
- [ASPEED_DEV_FMC] = 131,
35
[ASPEED_DEV_SDMC] = 0,
36
- [ASPEED_DEV_SCU] = 12,
37
- [ASPEED_DEV_ADC] = 130,
38
+ [ASPEED_DEV_HACE] = 4,
39
[ASPEED_DEV_XDMA] = 5,
40
- [ASPEED_DEV_EMMC] = 15,
41
- [ASPEED_DEV_GPIO] = 130,
42
+ [ASPEED_DEV_UART4] = 8,
43
+ [ASPEED_DEV_SCU] = 12,
44
[ASPEED_DEV_RTC] = 13,
45
+ [ASPEED_DEV_EMMC] = 15,
46
[ASPEED_DEV_TIMER1] = 16,
47
[ASPEED_DEV_TIMER2] = 17,
48
[ASPEED_DEV_TIMER3] = 18,
49
@@ -XXX,XX +XXX,XX @@ static const int aspeed_soc_ast2700a0_irqmap[] = {
50
[ASPEED_DEV_TIMER6] = 21,
51
[ASPEED_DEV_TIMER7] = 22,
52
[ASPEED_DEV_TIMER8] = 23,
53
- [ASPEED_DEV_WDT] = 131,
54
- [ASPEED_DEV_PWM] = 131,
55
+ [ASPEED_DEV_DP] = 28,
56
[ASPEED_DEV_LPC] = 128,
57
[ASPEED_DEV_IBT] = 128,
58
+ [ASPEED_DEV_KCS] = 128,
59
+ [ASPEED_DEV_ADC] = 130,
60
+ [ASPEED_DEV_GPIO] = 130,
61
[ASPEED_DEV_I2C] = 130,
62
- [ASPEED_DEV_PECI] = 133,
63
+ [ASPEED_DEV_FMC] = 131,
64
+ [ASPEED_DEV_WDT] = 131,
65
+ [ASPEED_DEV_PWM] = 131,
66
+ [ASPEED_DEV_I3C] = 131,
67
+ [ASPEED_DEV_UART0] = 132,
68
+ [ASPEED_DEV_UART1] = 132,
69
+ [ASPEED_DEV_UART2] = 132,
70
+ [ASPEED_DEV_UART3] = 132,
71
+ [ASPEED_DEV_UART5] = 132,
72
+ [ASPEED_DEV_UART6] = 132,
73
+ [ASPEED_DEV_UART7] = 132,
74
+ [ASPEED_DEV_UART8] = 132,
75
+ [ASPEED_DEV_UART9] = 132,
76
+ [ASPEED_DEV_UART10] = 132,
77
+ [ASPEED_DEV_UART11] = 132,
78
+ [ASPEED_DEV_UART12] = 132,
79
[ASPEED_DEV_ETH1] = 132,
80
[ASPEED_DEV_ETH2] = 132,
81
[ASPEED_DEV_ETH3] = 132,
82
- [ASPEED_DEV_HACE] = 4,
83
- [ASPEED_DEV_KCS] = 128,
84
- [ASPEED_DEV_DP] = 28,
85
- [ASPEED_DEV_I3C] = 131,
86
+ [ASPEED_DEV_PECI] = 133,
87
[ASPEED_DEV_SDHCI] = 133,
88
};
89
90
--
91
2.48.1
92
93
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
The previous implementation set the "aspeed_intc_ops" struct, containing read
4
and write callbacks, to be used when I/O is performed on the INTC region.
5
Both "aspeed_intc_read" and "aspeed_intc_write" callback functions were used
6
for INTC (CPU Die).
7
8
To support the INTCIO (IO Die) model, introduces a new "reg_ops" class
9
attribute. This allows setting different memory region operations to support
10
different INTC models.
11
12
Will introduce "aspeed_intcio_read" and "aspeed_intcio_write" callback
13
functions are used for INTCIO.
14
15
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
16
Reviewed-by: Cédric Le Goater <clg@redhat.com>
17
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-11-jamin_lin@aspeedtech.com
18
Signed-off-by: Cédric Le Goater <clg@redhat.com>
19
---
20
include/hw/intc/aspeed_intc.h | 1 +
21
hw/intc/aspeed_intc.c | 5 ++++-
22
2 files changed, 5 insertions(+), 1 deletion(-)
23
24
diff --git a/include/hw/intc/aspeed_intc.h b/include/hw/intc/aspeed_intc.h
25
index XXXXXXX..XXXXXXX 100644
26
--- a/include/hw/intc/aspeed_intc.h
27
+++ b/include/hw/intc/aspeed_intc.h
28
@@ -XXX,XX +XXX,XX @@ struct AspeedINTCClass {
29
uint64_t mem_size;
30
uint64_t nr_regs;
31
uint64_t reg_offset;
32
+ const MemoryRegionOps *reg_ops;
33
};
34
35
#endif /* ASPEED_INTC_H */
36
diff --git a/hw/intc/aspeed_intc.c b/hw/intc/aspeed_intc.c
37
index XXXXXXX..XXXXXXX 100644
38
--- a/hw/intc/aspeed_intc.c
39
+++ b/hw/intc/aspeed_intc.c
40
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_realize(DeviceState *dev, Error **errp)
41
sysbus_init_mmio(sbd, &s->iomem_container);
42
43
s->regs = g_new(uint32_t, aic->nr_regs);
44
- memory_region_init_io(&s->iomem, OBJECT(s), &aspeed_intc_ops, s,
45
+ memory_region_init_io(&s->iomem, OBJECT(s), aic->reg_ops, s,
46
TYPE_ASPEED_INTC ".regs", aic->nr_regs << 2);
47
48
memory_region_add_subregion(&s->iomem_container, aic->reg_offset,
49
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_unrealize(DeviceState *dev)
50
static void aspeed_intc_class_init(ObjectClass *klass, void *data)
51
{
52
DeviceClass *dc = DEVICE_CLASS(klass);
53
+ AspeedINTCClass *aic = ASPEED_INTC_CLASS(klass);
54
55
dc->desc = "ASPEED INTC Controller";
56
dc->realize = aspeed_intc_realize;
57
dc->unrealize = aspeed_intc_unrealize;
58
device_class_set_legacy_reset(dc, aspeed_intc_reset);
59
dc->vmsd = NULL;
60
+
61
+ aic->reg_ops = &aspeed_intc_ops;
62
}
63
64
static const TypeInfo aspeed_intc_info = {
65
--
66
2.48.1
67
68
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
To support AST2700 A1, some registers of the INTC(CPU Die) support one input
4
pin to multiple output pins. Renamed "num_ints" to "num_inpins" in the INTC
5
controller code for better clarity and consistency in naming conventions.
6
7
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
8
Reviewed-by: Cédric Le Goater <clg@redhat.com>
9
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-12-jamin_lin@aspeedtech.com
10
Signed-off-by: Cédric Le Goater <clg@redhat.com>
11
---
12
include/hw/intc/aspeed_intc.h | 11 ++++++-----
13
hw/arm/aspeed_ast27x0.c | 2 +-
14
hw/intc/aspeed_intc.c | 31 +++++++++++++++++--------------
15
3 files changed, 24 insertions(+), 20 deletions(-)
16
17
diff --git a/include/hw/intc/aspeed_intc.h b/include/hw/intc/aspeed_intc.h
18
index XXXXXXX..XXXXXXX 100644
19
--- a/include/hw/intc/aspeed_intc.h
20
+++ b/include/hw/intc/aspeed_intc.h
21
@@ -XXX,XX +XXX,XX @@
22
OBJECT_DECLARE_TYPE(AspeedINTCState, AspeedINTCClass, ASPEED_INTC)
23
24
#define ASPEED_INTC_NR_INTS 9
25
+#define ASPEED_INTC_MAX_INPINS 9
26
27
struct AspeedINTCState {
28
/*< private >*/
29
@@ -XXX,XX +XXX,XX @@ struct AspeedINTCState {
30
MemoryRegion iomem_container;
31
32
uint32_t *regs;
33
- OrIRQState orgates[ASPEED_INTC_NR_INTS];
34
+ OrIRQState orgates[ASPEED_INTC_MAX_INPINS];
35
qemu_irq output_pins[ASPEED_INTC_NR_INTS];
36
37
- uint32_t enable[ASPEED_INTC_NR_INTS];
38
- uint32_t mask[ASPEED_INTC_NR_INTS];
39
- uint32_t pending[ASPEED_INTC_NR_INTS];
40
+ uint32_t enable[ASPEED_INTC_MAX_INPINS];
41
+ uint32_t mask[ASPEED_INTC_MAX_INPINS];
42
+ uint32_t pending[ASPEED_INTC_MAX_INPINS];
43
};
44
45
struct AspeedINTCClass {
46
SysBusDeviceClass parent_class;
47
48
uint32_t num_lines;
49
- uint32_t num_ints;
50
+ uint32_t num_inpins;
51
uint64_t mem_size;
52
uint64_t nr_regs;
53
uint64_t reg_offset;
54
diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c
55
index XXXXXXX..XXXXXXX 100644
56
--- a/hw/arm/aspeed_ast27x0.c
57
+++ b/hw/arm/aspeed_ast27x0.c
58
@@ -XXX,XX +XXX,XX @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp)
59
sc->memmap[ASPEED_DEV_INTC]);
60
61
/* GICINT orgates -> INTC -> GIC */
62
- for (i = 0; i < ic->num_ints; i++) {
63
+ for (i = 0; i < ic->num_inpins; i++) {
64
qdev_connect_gpio_out(DEVICE(&a->intc.orgates[i]), 0,
65
qdev_get_gpio_in(DEVICE(&a->intc), i));
66
sysbus_connect_irq(SYS_BUS_DEVICE(&a->intc), i,
67
diff --git a/hw/intc/aspeed_intc.c b/hw/intc/aspeed_intc.c
68
index XXXXXXX..XXXXXXX 100644
69
--- a/hw/intc/aspeed_intc.c
70
+++ b/hw/intc/aspeed_intc.c
71
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_update(AspeedINTCState *s, int irq, int level)
72
AspeedINTCClass *aic = ASPEED_INTC_GET_CLASS(s);
73
const char *name = object_get_typename(OBJECT(s));
74
75
- if (irq >= aic->num_ints) {
76
- qemu_log_mask(LOG_GUEST_ERROR, "%s: Invalid interrupt number: %d\n",
77
+ if (irq >= aic->num_inpins) {
78
+ qemu_log_mask(LOG_GUEST_ERROR,
79
+ "%s: Invalid input pin index: %d\n",
80
__func__, irq);
81
return;
82
}
83
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_update(AspeedINTCState *s, int irq, int level)
84
/*
85
* The address of GICINT128 to GICINT136 are from 0x1000 to 0x1804.
86
* Utilize "address & 0x0f00" to get the irq and irq output pin index
87
- * The value of irq should be 0 to num_ints.
88
+ * The value of irq should be 0 to num_inpins.
89
* The irq 0 indicates GICINT128, irq 1 indicates GICINT129 and so on.
90
*/
91
static void aspeed_intc_set_irq(void *opaque, int irq, int level)
92
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_set_irq(void *opaque, int irq, int level)
93
uint32_t enable;
94
int i;
95
96
- if (irq >= aic->num_ints) {
97
- qemu_log_mask(LOG_GUEST_ERROR, "%s: Invalid interrupt number: %d\n",
98
+ if (irq >= aic->num_inpins) {
99
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: Invalid input pin index: %d\n",
100
__func__, irq);
101
return;
102
}
103
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_enable_handler(AspeedINTCState *s, hwaddr offset,
104
105
irq = (offset & 0x0f00) >> 8;
106
107
- if (irq >= aic->num_ints) {
108
- qemu_log_mask(LOG_GUEST_ERROR, "%s: Invalid interrupt number: %d\n",
109
+ if (irq >= aic->num_inpins) {
110
+ qemu_log_mask(LOG_GUEST_ERROR,
111
+ "%s: Invalid input pin index: %d\n",
112
__func__, irq);
113
return;
114
}
115
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_status_handler(AspeedINTCState *s, hwaddr offset,
116
117
irq = (offset & 0x0f00) >> 8;
118
119
- if (irq >= aic->num_ints) {
120
- qemu_log_mask(LOG_GUEST_ERROR, "%s: Invalid interrupt number: %d\n",
121
+ if (irq >= aic->num_inpins) {
122
+ qemu_log_mask(LOG_GUEST_ERROR,
123
+ "%s: Invalid input pin index: %d\n",
124
__func__, irq);
125
return;
126
}
127
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_instance_init(Object *obj)
128
AspeedINTCClass *aic = ASPEED_INTC_GET_CLASS(s);
129
int i;
130
131
- assert(aic->num_ints <= ASPEED_INTC_NR_INTS);
132
- for (i = 0; i < aic->num_ints; i++) {
133
+ assert(aic->num_inpins <= ASPEED_INTC_MAX_INPINS);
134
+ for (i = 0; i < aic->num_inpins; i++) {
135
object_initialize_child(obj, "intc-orgates[*]", &s->orgates[i],
136
TYPE_OR_IRQ);
137
object_property_set_int(OBJECT(&s->orgates[i]), "num-lines",
138
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_realize(DeviceState *dev, Error **errp)
139
memory_region_add_subregion(&s->iomem_container, aic->reg_offset,
140
&s->iomem);
141
142
- qdev_init_gpio_in(dev, aspeed_intc_set_irq, aic->num_ints);
143
+ qdev_init_gpio_in(dev, aspeed_intc_set_irq, aic->num_inpins);
144
145
- for (i = 0; i < aic->num_ints; i++) {
146
+ for (i = 0; i < aic->num_inpins; i++) {
147
if (!qdev_realize(DEVICE(&s->orgates[i]), NULL, errp)) {
148
return;
149
}
150
@@ -XXX,XX +XXX,XX @@ static void aspeed_2700_intc_class_init(ObjectClass *klass, void *data)
151
152
dc->desc = "ASPEED 2700 INTC Controller";
153
aic->num_lines = 32;
154
- aic->num_ints = 9;
155
+ aic->num_inpins = 9;
156
aic->mem_size = 0x4000;
157
aic->nr_regs = 0x808 >> 2;
158
aic->reg_offset = 0x1000;
159
--
160
2.48.1
161
162
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
Added support for multiple output pins in the INTC controller to
4
accommodate the AST2700 A1.
5
6
Introduced "num_outpins" to represent the number of output pins. Updated the
7
IRQ handling logic to initialize and connect output pins separately from input
8
pins. Modified the "aspeed_soc_ast2700_realize" function to connect source
9
orgates to INTC and INTC to GIC128 - GIC136. Updated the "aspeed_intc_realize"
10
function to initialize output pins.
11
12
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
13
Reviewed-by: Cédric Le Goater <clg@redhat.com>
14
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-13-jamin_lin@aspeedtech.com
15
Signed-off-by: Cédric Le Goater <clg@redhat.com>
16
---
17
include/hw/intc/aspeed_intc.h | 5 +++--
18
hw/arm/aspeed_ast27x0.c | 6 +++++-
19
hw/intc/aspeed_intc.c | 4 ++++
20
3 files changed, 12 insertions(+), 3 deletions(-)
21
22
diff --git a/include/hw/intc/aspeed_intc.h b/include/hw/intc/aspeed_intc.h
23
index XXXXXXX..XXXXXXX 100644
24
--- a/include/hw/intc/aspeed_intc.h
25
+++ b/include/hw/intc/aspeed_intc.h
26
@@ -XXX,XX +XXX,XX @@
27
#define TYPE_ASPEED_2700_INTC TYPE_ASPEED_INTC "-ast2700"
28
OBJECT_DECLARE_TYPE(AspeedINTCState, AspeedINTCClass, ASPEED_INTC)
29
30
-#define ASPEED_INTC_NR_INTS 9
31
#define ASPEED_INTC_MAX_INPINS 9
32
+#define ASPEED_INTC_MAX_OUTPINS 9
33
34
struct AspeedINTCState {
35
/*< private >*/
36
@@ -XXX,XX +XXX,XX @@ struct AspeedINTCState {
37
38
uint32_t *regs;
39
OrIRQState orgates[ASPEED_INTC_MAX_INPINS];
40
- qemu_irq output_pins[ASPEED_INTC_NR_INTS];
41
+ qemu_irq output_pins[ASPEED_INTC_MAX_OUTPINS];
42
43
uint32_t enable[ASPEED_INTC_MAX_INPINS];
44
uint32_t mask[ASPEED_INTC_MAX_INPINS];
45
@@ -XXX,XX +XXX,XX @@ struct AspeedINTCClass {
46
47
uint32_t num_lines;
48
uint32_t num_inpins;
49
+ uint32_t num_outpins;
50
uint64_t mem_size;
51
uint64_t nr_regs;
52
uint64_t reg_offset;
53
diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c
54
index XXXXXXX..XXXXXXX 100644
55
--- a/hw/arm/aspeed_ast27x0.c
56
+++ b/hw/arm/aspeed_ast27x0.c
57
@@ -XXX,XX +XXX,XX @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp)
58
aspeed_mmio_map(s, SYS_BUS_DEVICE(&a->intc), 0,
59
sc->memmap[ASPEED_DEV_INTC]);
60
61
- /* GICINT orgates -> INTC -> GIC */
62
+ /* source orgates -> INTC */
63
for (i = 0; i < ic->num_inpins; i++) {
64
qdev_connect_gpio_out(DEVICE(&a->intc.orgates[i]), 0,
65
qdev_get_gpio_in(DEVICE(&a->intc), i));
66
+ }
67
+
68
+ /* INTC -> GIC128 - GIC136 */
69
+ for (i = 0; i < ic->num_outpins; i++) {
70
sysbus_connect_irq(SYS_BUS_DEVICE(&a->intc), i,
71
qdev_get_gpio_in(DEVICE(&a->gic),
72
aspeed_soc_ast2700_gic_intcmap[i].irq));
73
diff --git a/hw/intc/aspeed_intc.c b/hw/intc/aspeed_intc.c
74
index XXXXXXX..XXXXXXX 100644
75
--- a/hw/intc/aspeed_intc.c
76
+++ b/hw/intc/aspeed_intc.c
77
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_realize(DeviceState *dev, Error **errp)
78
if (!qdev_realize(DEVICE(&s->orgates[i]), NULL, errp)) {
79
return;
80
}
81
+ }
82
+
83
+ for (i = 0; i < aic->num_outpins; i++) {
84
sysbus_init_irq(sbd, &s->output_pins[i]);
85
}
86
}
87
@@ -XXX,XX +XXX,XX @@ static void aspeed_2700_intc_class_init(ObjectClass *klass, void *data)
88
dc->desc = "ASPEED 2700 INTC Controller";
89
aic->num_lines = 32;
90
aic->num_inpins = 9;
91
+ aic->num_outpins = 9;
92
aic->mem_size = 0x4000;
93
aic->nr_regs = 0x808 >> 2;
94
aic->reg_offset = 0x1000;
95
--
96
2.48.1
97
98
diff view generated by jsdifflib
New patch
1
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
2
3
Refactors the INTC to distinguish between input and output pin indices,
4
improving interrupt handling clarity and accuracy.
5
6
Updated the functions to handle both input and output pin indices.
7
Added detailed logging for input and output pin indices in trace events.
8
9
These changes ensure that the INTC controller can handle multiple input and
10
output pins, improving support for the AST2700 A1.
11
12
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
13
Reviewed-by: Cédric Le Goater <clg@redhat.com>
14
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-14-jamin_lin@aspeedtech.com
15
Signed-off-by: Cédric Le Goater <clg@redhat.com>
16
---
17
hw/intc/aspeed_intc.c | 97 +++++++++++++++++++++++++++----------------
18
hw/intc/trace-events | 12 +++---
19
2 files changed, 67 insertions(+), 42 deletions(-)
20
21
diff --git a/hw/intc/aspeed_intc.c b/hw/intc/aspeed_intc.c
22
index XXXXXXX..XXXXXXX 100644
23
--- a/hw/intc/aspeed_intc.c
24
+++ b/hw/intc/aspeed_intc.c
25
@@ -XXX,XX +XXX,XX @@ REG32(GICINT136_STATUS, 0x804)
26
27
#define GICINT_STATUS_BASE R_GICINT128_STATUS
28
29
-static void aspeed_intc_update(AspeedINTCState *s, int irq, int level)
30
+/*
31
+ * Update the state of an interrupt controller pin by setting
32
+ * the specified output pin to the given level.
33
+ * The input pin index should be between 0 and the number of input pins.
34
+ * The output pin index should be between 0 and the number of output pins.
35
+ */
36
+static void aspeed_intc_update(AspeedINTCState *s, int inpin_idx,
37
+ int outpin_idx, int level)
38
{
39
AspeedINTCClass *aic = ASPEED_INTC_GET_CLASS(s);
40
const char *name = object_get_typename(OBJECT(s));
41
42
- if (irq >= aic->num_inpins) {
43
- qemu_log_mask(LOG_GUEST_ERROR,
44
- "%s: Invalid input pin index: %d\n",
45
- __func__, irq);
46
+ if (inpin_idx >= aic->num_inpins) {
47
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: Invalid input pin index: %d\n",
48
+ __func__, inpin_idx);
49
return;
50
}
51
52
- trace_aspeed_intc_update_irq(name, irq, level);
53
- qemu_set_irq(s->output_pins[irq], level);
54
+ if (outpin_idx >= aic->num_outpins) {
55
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: Invalid output pin index: %d\n",
56
+ __func__, outpin_idx);
57
+ return;
58
+ }
59
+
60
+ trace_aspeed_intc_update_irq(name, inpin_idx, outpin_idx, level);
61
+ qemu_set_irq(s->output_pins[outpin_idx], level);
62
}
63
64
/*
65
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_set_irq(void *opaque, int irq, int level)
66
uint32_t status_reg = GICINT_STATUS_BASE + ((0x100 * irq) >> 2);
67
uint32_t select = 0;
68
uint32_t enable;
69
+ int outpin_idx;
70
+ int inpin_idx;
71
int i;
72
73
+ outpin_idx = irq;
74
+ inpin_idx = irq;
75
+
76
if (irq >= aic->num_inpins) {
77
qemu_log_mask(LOG_GUEST_ERROR, "%s: Invalid input pin index: %d\n",
78
__func__, irq);
79
return;
80
}
81
82
- trace_aspeed_intc_set_irq(name, irq, level);
83
- enable = s->enable[irq];
84
+ trace_aspeed_intc_set_irq(name, inpin_idx, level);
85
+ enable = s->enable[inpin_idx];
86
87
if (!level) {
88
return;
89
}
90
91
for (i = 0; i < aic->num_lines; i++) {
92
- if (s->orgates[irq].levels[i]) {
93
+ if (s->orgates[inpin_idx].levels[i]) {
94
if (enable & BIT(i)) {
95
select |= BIT(i);
96
}
97
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_set_irq(void *opaque, int irq, int level)
98
99
trace_aspeed_intc_select(name, select);
100
101
- if (s->mask[irq] || s->regs[status_reg]) {
102
+ if (s->mask[inpin_idx] || s->regs[status_reg]) {
103
/*
104
* a. mask is not 0 means in ISR mode
105
* sources interrupt routine are executing.
106
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_set_irq(void *opaque, int irq, int level)
107
*
108
* save source interrupt to pending variable.
109
*/
110
- s->pending[irq] |= select;
111
- trace_aspeed_intc_pending_irq(name, irq, s->pending[irq]);
112
+ s->pending[inpin_idx] |= select;
113
+ trace_aspeed_intc_pending_irq(name, inpin_idx, s->pending[inpin_idx]);
114
} else {
115
/*
116
* notify firmware which source interrupt are coming
117
* by setting status register
118
*/
119
s->regs[status_reg] = select;
120
- trace_aspeed_intc_trigger_irq(name, irq, s->regs[status_reg]);
121
- aspeed_intc_update(s, irq, 1);
122
+ trace_aspeed_intc_trigger_irq(name, inpin_idx, outpin_idx,
123
+ s->regs[status_reg]);
124
+ aspeed_intc_update(s, inpin_idx, outpin_idx, 1);
125
}
126
}
127
128
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_enable_handler(AspeedINTCState *s, hwaddr offset,
129
uint32_t reg = offset >> 2;
130
uint32_t old_enable;
131
uint32_t change;
132
+ int inpin_idx;
133
uint32_t irq;
134
135
irq = (offset & 0x0f00) >> 8;
136
+ inpin_idx = irq;
137
138
- if (irq >= aic->num_inpins) {
139
+ if (inpin_idx >= aic->num_inpins) {
140
qemu_log_mask(LOG_GUEST_ERROR,
141
"%s: Invalid input pin index: %d\n",
142
- __func__, irq);
143
+ __func__, inpin_idx);
144
return;
145
}
146
147
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_enable_handler(AspeedINTCState *s, hwaddr offset,
148
*/
149
150
/* disable all source interrupt */
151
- if (!data && !s->enable[irq]) {
152
+ if (!data && !s->enable[inpin_idx]) {
153
s->regs[reg] = data;
154
return;
155
}
156
157
- old_enable = s->enable[irq];
158
- s->enable[irq] |= data;
159
+ old_enable = s->enable[inpin_idx];
160
+ s->enable[inpin_idx] |= data;
161
162
/* enable new source interrupt */
163
- if (old_enable != s->enable[irq]) {
164
- trace_aspeed_intc_enable(name, s->enable[irq]);
165
+ if (old_enable != s->enable[inpin_idx]) {
166
+ trace_aspeed_intc_enable(name, s->enable[inpin_idx]);
167
s->regs[reg] = data;
168
return;
169
}
170
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_enable_handler(AspeedINTCState *s, hwaddr offset,
171
/* mask and unmask source interrupt */
172
change = s->regs[reg] ^ data;
173
if (change & data) {
174
- s->mask[irq] &= ~change;
175
- trace_aspeed_intc_unmask(name, change, s->mask[irq]);
176
+ s->mask[inpin_idx] &= ~change;
177
+ trace_aspeed_intc_unmask(name, change, s->mask[inpin_idx]);
178
} else {
179
- s->mask[irq] |= change;
180
- trace_aspeed_intc_mask(name, change, s->mask[irq]);
181
+ s->mask[inpin_idx] |= change;
182
+ trace_aspeed_intc_mask(name, change, s->mask[inpin_idx]);
183
}
184
185
s->regs[reg] = data;
186
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_status_handler(AspeedINTCState *s, hwaddr offset,
187
AspeedINTCClass *aic = ASPEED_INTC_GET_CLASS(s);
188
const char *name = object_get_typename(OBJECT(s));
189
uint32_t reg = offset >> 2;
190
+ int outpin_idx;
191
+ int inpin_idx;
192
uint32_t irq;
193
194
if (!data) {
195
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_status_handler(AspeedINTCState *s, hwaddr offset,
196
}
197
198
irq = (offset & 0x0f00) >> 8;
199
+ outpin_idx = irq;
200
+ inpin_idx = irq;
201
202
- if (irq >= aic->num_inpins) {
203
+ if (inpin_idx >= aic->num_inpins) {
204
qemu_log_mask(LOG_GUEST_ERROR,
205
"%s: Invalid input pin index: %d\n",
206
- __func__, irq);
207
+ __func__, inpin_idx);
208
return;
209
}
210
211
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_status_handler(AspeedINTCState *s, hwaddr offset,
212
213
/* All source ISR execution are done */
214
if (!s->regs[reg]) {
215
- trace_aspeed_intc_all_isr_done(name, irq);
216
- if (s->pending[irq]) {
217
+ trace_aspeed_intc_all_isr_done(name, inpin_idx);
218
+ if (s->pending[inpin_idx]) {
219
/*
220
* handle pending source interrupt
221
* notify firmware which source interrupt are pending
222
* by setting status register
223
*/
224
- s->regs[reg] = s->pending[irq];
225
- s->pending[irq] = 0;
226
- trace_aspeed_intc_trigger_irq(name, irq, s->regs[reg]);
227
- aspeed_intc_update(s, irq, 1);
228
+ s->regs[reg] = s->pending[inpin_idx];
229
+ s->pending[inpin_idx] = 0;
230
+ trace_aspeed_intc_trigger_irq(name, inpin_idx, outpin_idx,
231
+ s->regs[reg]);
232
+ aspeed_intc_update(s, inpin_idx, outpin_idx, 1);
233
} else {
234
/* clear irq */
235
- trace_aspeed_intc_clear_irq(name, irq, 0);
236
- aspeed_intc_update(s, irq, 0);
237
+ trace_aspeed_intc_clear_irq(name, inpin_idx, outpin_idx, 0);
238
+ aspeed_intc_update(s, inpin_idx, outpin_idx, 0);
239
}
240
}
241
}
242
diff --git a/hw/intc/trace-events b/hw/intc/trace-events
243
index XXXXXXX..XXXXXXX 100644
244
--- a/hw/intc/trace-events
245
+++ b/hw/intc/trace-events
246
@@ -XXX,XX +XXX,XX @@ aspeed_vic_write(uint64_t offset, unsigned size, uint32_t data) "To 0x%" PRIx64
247
# aspeed_intc.c
248
aspeed_intc_read(const char *s, uint64_t offset, unsigned size, uint32_t value) "%s: From 0x%" PRIx64 " of size %u: 0x%" PRIx32
249
aspeed_intc_write(const char *s, uint64_t offset, unsigned size, uint32_t data) "%s: To 0x%" PRIx64 " of size %u: 0x%" PRIx32
250
-aspeed_intc_set_irq(const char *s, int irq, int level) "%s: Set IRQ %d: %d"
251
-aspeed_intc_clear_irq(const char *s, int irq, int level) "%s: Clear IRQ %d: %d"
252
-aspeed_intc_update_irq(const char *s, int irq, int level) "%s: Update IRQ: %d: %d"
253
-aspeed_intc_pending_irq(const char *s, int irq, uint32_t value) "%s: Pending IRQ: %d: 0x%x"
254
-aspeed_intc_trigger_irq(const char *s, int irq, uint32_t value) "%s: Trigger IRQ: %d: 0x%x"
255
-aspeed_intc_all_isr_done(const char *s, int irq) "%s: All source ISR execution are done: %d"
256
+aspeed_intc_set_irq(const char *s, int inpin_idx, int level) "%s: Set IRQ %d: %d"
257
+aspeed_intc_clear_irq(const char *s, int inpin_idx, int outpin_idx, int level) "%s: Clear IRQ %d-%d: %d"
258
+aspeed_intc_update_irq(const char *s, int inpin_idx, int outpin_idx, int level) "%s: Update IRQ: %d-%d: %d"
259
+aspeed_intc_pending_irq(const char *s, int inpin_idx, uint32_t value) "%s: Pending IRQ: %d: 0x%x"
260
+aspeed_intc_trigger_irq(const char *s, int inpin_idx, int outpin_idx, uint32_t value) "%s: Trigger IRQ: %d-%d: 0x%x"
261
+aspeed_intc_all_isr_done(const char *s, int inpin_idx) "%s: All source ISR execution are done: %d"
262
aspeed_intc_enable(const char *s, uint32_t value) "%s: Enable: 0x%x"
263
aspeed_intc_select(const char *s, uint32_t value) "%s: Select: 0x%x"
264
aspeed_intc_mask(const char *s, uint32_t change, uint32_t value) "%s: Mask: 0x%x: 0x%x"
265
--
266
2.48.1
267
268
diff view generated by jsdifflib
New patch
1
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
2
3
The INTC controller supports GICINT128 to GICINT136, mapping 1:1 to input and
4
output IRQs 0 to 8. Previously, the formula "address & 0x0f00" was used to
5
derive the IRQ index numbers.
6
7
However, the INTC controller also supports GICINT192_201, mapping 1 input IRQ
8
pin to 10 output IRQ pins. The pin numbers for input and output are different.
9
It is difficult to use a formula to determine the index number of INTC model
10
supported input and output IRQs.
11
12
To simplify and improve readability, introduces the AspeedINTCIRQ structure to
13
save the input/output IRQ index and its enable/status register address.
14
15
Introduce the "aspeed_2700_intc_irqs" table to store IRQ information for INTC.
16
Introduce the "aspeed_intc_get_irq" function to retrieve the input/output IRQ
17
pin index from the provided status/enable register address.
18
19
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
20
Reviewed-by: Cédric Le Goater <clg@redhat.com>
21
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-15-jamin_lin@aspeedtech.com
22
Signed-off-by: Cédric Le Goater <clg@redhat.com>
23
---
24
include/hw/intc/aspeed_intc.h | 10 ++++
25
hw/intc/aspeed_intc.c | 87 +++++++++++++++++++----------------
26
2 files changed, 58 insertions(+), 39 deletions(-)
27
28
diff --git a/include/hw/intc/aspeed_intc.h b/include/hw/intc/aspeed_intc.h
29
index XXXXXXX..XXXXXXX 100644
30
--- a/include/hw/intc/aspeed_intc.h
31
+++ b/include/hw/intc/aspeed_intc.h
32
@@ -XXX,XX +XXX,XX @@ OBJECT_DECLARE_TYPE(AspeedINTCState, AspeedINTCClass, ASPEED_INTC)
33
#define ASPEED_INTC_MAX_INPINS 9
34
#define ASPEED_INTC_MAX_OUTPINS 9
35
36
+typedef struct AspeedINTCIRQ {
37
+ int inpin_idx;
38
+ int outpin_idx;
39
+ int num_outpins;
40
+ uint32_t enable_reg;
41
+ uint32_t status_reg;
42
+} AspeedINTCIRQ;
43
+
44
struct AspeedINTCState {
45
/*< private >*/
46
SysBusDevice parent_obj;
47
@@ -XXX,XX +XXX,XX @@ struct AspeedINTCClass {
48
uint64_t nr_regs;
49
uint64_t reg_offset;
50
const MemoryRegionOps *reg_ops;
51
+ const AspeedINTCIRQ *irq_table;
52
+ int irq_table_count;
53
};
54
55
#endif /* ASPEED_INTC_H */
56
diff --git a/hw/intc/aspeed_intc.c b/hw/intc/aspeed_intc.c
57
index XXXXXXX..XXXXXXX 100644
58
--- a/hw/intc/aspeed_intc.c
59
+++ b/hw/intc/aspeed_intc.c
60
@@ -XXX,XX +XXX,XX @@ REG32(GICINT135_STATUS, 0x704)
61
REG32(GICINT136_EN, 0x800)
62
REG32(GICINT136_STATUS, 0x804)
63
64
-#define GICINT_STATUS_BASE R_GICINT128_STATUS
65
+static const AspeedINTCIRQ *aspeed_intc_get_irq(AspeedINTCClass *aic,
66
+ uint32_t reg)
67
+{
68
+ int i;
69
+
70
+ for (i = 0; i < aic->irq_table_count; i++) {
71
+ if (aic->irq_table[i].enable_reg == reg ||
72
+ aic->irq_table[i].status_reg == reg) {
73
+ return &aic->irq_table[i];
74
+ }
75
+ }
76
+
77
+ /*
78
+ * Invalid reg.
79
+ */
80
+ g_assert_not_reached();
81
+}
82
83
/*
84
* Update the state of an interrupt controller pin by setting
85
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_update(AspeedINTCState *s, int inpin_idx,
86
AspeedINTCClass *aic = ASPEED_INTC_GET_CLASS(s);
87
const char *name = object_get_typename(OBJECT(s));
88
89
- if (inpin_idx >= aic->num_inpins) {
90
- qemu_log_mask(LOG_GUEST_ERROR, "%s: Invalid input pin index: %d\n",
91
- __func__, inpin_idx);
92
- return;
93
- }
94
-
95
- if (outpin_idx >= aic->num_outpins) {
96
- qemu_log_mask(LOG_GUEST_ERROR, "%s: Invalid output pin index: %d\n",
97
- __func__, outpin_idx);
98
- return;
99
- }
100
+ assert((outpin_idx < aic->num_outpins) && (inpin_idx < aic->num_inpins));
101
102
trace_aspeed_intc_update_irq(name, inpin_idx, outpin_idx, level);
103
qemu_set_irq(s->output_pins[outpin_idx], level);
104
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_set_irq(void *opaque, int irq, int level)
105
AspeedINTCState *s = (AspeedINTCState *)opaque;
106
AspeedINTCClass *aic = ASPEED_INTC_GET_CLASS(s);
107
const char *name = object_get_typename(OBJECT(s));
108
- uint32_t status_reg = GICINT_STATUS_BASE + ((0x100 * irq) >> 2);
109
+ const AspeedINTCIRQ *intc_irq;
110
+ uint32_t status_reg;
111
uint32_t select = 0;
112
uint32_t enable;
113
int outpin_idx;
114
int inpin_idx;
115
int i;
116
117
- outpin_idx = irq;
118
- inpin_idx = irq;
119
+ assert(irq < aic->num_inpins);
120
121
- if (irq >= aic->num_inpins) {
122
- qemu_log_mask(LOG_GUEST_ERROR, "%s: Invalid input pin index: %d\n",
123
- __func__, irq);
124
- return;
125
- }
126
+ intc_irq = &aic->irq_table[irq];
127
+ status_reg = intc_irq->status_reg;
128
+ outpin_idx = intc_irq->outpin_idx;
129
+ inpin_idx = intc_irq->inpin_idx;
130
131
trace_aspeed_intc_set_irq(name, inpin_idx, level);
132
enable = s->enable[inpin_idx];
133
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_enable_handler(AspeedINTCState *s, hwaddr offset,
134
{
135
AspeedINTCClass *aic = ASPEED_INTC_GET_CLASS(s);
136
const char *name = object_get_typename(OBJECT(s));
137
+ const AspeedINTCIRQ *intc_irq;
138
uint32_t reg = offset >> 2;
139
uint32_t old_enable;
140
uint32_t change;
141
int inpin_idx;
142
- uint32_t irq;
143
144
- irq = (offset & 0x0f00) >> 8;
145
- inpin_idx = irq;
146
+ intc_irq = aspeed_intc_get_irq(aic, reg);
147
+ inpin_idx = intc_irq->inpin_idx;
148
149
- if (inpin_idx >= aic->num_inpins) {
150
- qemu_log_mask(LOG_GUEST_ERROR,
151
- "%s: Invalid input pin index: %d\n",
152
- __func__, inpin_idx);
153
- return;
154
- }
155
+ assert(inpin_idx < aic->num_inpins);
156
157
/*
158
* The enable registers are used to enable source interrupts.
159
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_status_handler(AspeedINTCState *s, hwaddr offset,
160
{
161
AspeedINTCClass *aic = ASPEED_INTC_GET_CLASS(s);
162
const char *name = object_get_typename(OBJECT(s));
163
+ const AspeedINTCIRQ *intc_irq;
164
uint32_t reg = offset >> 2;
165
int outpin_idx;
166
int inpin_idx;
167
- uint32_t irq;
168
169
if (!data) {
170
qemu_log_mask(LOG_GUEST_ERROR, "%s: Invalid data 0\n", __func__);
171
return;
172
}
173
174
- irq = (offset & 0x0f00) >> 8;
175
- outpin_idx = irq;
176
- inpin_idx = irq;
177
+ intc_irq = aspeed_intc_get_irq(aic, reg);
178
+ outpin_idx = intc_irq->outpin_idx;
179
+ inpin_idx = intc_irq->inpin_idx;
180
181
- if (inpin_idx >= aic->num_inpins) {
182
- qemu_log_mask(LOG_GUEST_ERROR,
183
- "%s: Invalid input pin index: %d\n",
184
- __func__, inpin_idx);
185
- return;
186
- }
187
+ assert(inpin_idx < aic->num_inpins);
188
189
/* clear status */
190
s->regs[reg] &= ~data;
191
@@ -XXX,XX +XXX,XX @@ static const TypeInfo aspeed_intc_info = {
192
.abstract = true,
193
};
194
195
+static AspeedINTCIRQ aspeed_2700_intc_irqs[ASPEED_INTC_MAX_INPINS] = {
196
+ {0, 0, 1, R_GICINT128_EN, R_GICINT128_STATUS},
197
+ {1, 1, 1, R_GICINT129_EN, R_GICINT129_STATUS},
198
+ {2, 2, 1, R_GICINT130_EN, R_GICINT130_STATUS},
199
+ {3, 3, 1, R_GICINT131_EN, R_GICINT131_STATUS},
200
+ {4, 4, 1, R_GICINT132_EN, R_GICINT132_STATUS},
201
+ {5, 5, 1, R_GICINT133_EN, R_GICINT133_STATUS},
202
+ {6, 6, 1, R_GICINT134_EN, R_GICINT134_STATUS},
203
+ {7, 7, 1, R_GICINT135_EN, R_GICINT135_STATUS},
204
+ {8, 8, 1, R_GICINT136_EN, R_GICINT136_STATUS},
205
+};
206
+
207
static void aspeed_2700_intc_class_init(ObjectClass *klass, void *data)
208
{
209
DeviceClass *dc = DEVICE_CLASS(klass);
210
@@ -XXX,XX +XXX,XX @@ static void aspeed_2700_intc_class_init(ObjectClass *klass, void *data)
211
aic->mem_size = 0x4000;
212
aic->nr_regs = 0x808 >> 2;
213
aic->reg_offset = 0x1000;
214
+ aic->irq_table = aspeed_2700_intc_irqs;
215
+ aic->irq_table_count = ARRAY_SIZE(aspeed_2700_intc_irqs);
216
}
217
218
static const TypeInfo aspeed_2700_intc_info = {
219
--
220
2.48.1
221
222
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
The behavior of the INTC set IRQ is almost identical between INTC and INTCIO.
4
To reduce duplicated code, introduce the "aspeed_intc_set_irq_handler" function
5
to handle both INTC and INTCIO IRQ behavior. No functional change.
6
7
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
8
Reviewed-by: Cédric Le Goater <clg@redhat.com>
9
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-16-jamin_lin@aspeedtech.com
10
Signed-off-by: Cédric Le Goater <clg@redhat.com>
11
---
12
hw/intc/aspeed_intc.c | 70 ++++++++++++++++++++++++-------------------
13
1 file changed, 39 insertions(+), 31 deletions(-)
14
15
diff --git a/hw/intc/aspeed_intc.c b/hw/intc/aspeed_intc.c
16
index XXXXXXX..XXXXXXX 100644
17
--- a/hw/intc/aspeed_intc.c
18
+++ b/hw/intc/aspeed_intc.c
19
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_update(AspeedINTCState *s, int inpin_idx,
20
qemu_set_irq(s->output_pins[outpin_idx], level);
21
}
22
23
+static void aspeed_intc_set_irq_handler(AspeedINTCState *s,
24
+ const AspeedINTCIRQ *intc_irq,
25
+ uint32_t select)
26
+{
27
+ const char *name = object_get_typename(OBJECT(s));
28
+ uint32_t status_reg;
29
+ int outpin_idx;
30
+ int inpin_idx;
31
+
32
+ status_reg = intc_irq->status_reg;
33
+ outpin_idx = intc_irq->outpin_idx;
34
+ inpin_idx = intc_irq->inpin_idx;
35
+
36
+ if (s->mask[inpin_idx] || s->regs[status_reg]) {
37
+ /*
38
+ * a. mask is not 0 means in ISR mode
39
+ * sources interrupt routine are executing.
40
+ * b. status register value is not 0 means previous
41
+ * source interrupt does not be executed, yet.
42
+ *
43
+ * save source interrupt to pending variable.
44
+ */
45
+ s->pending[inpin_idx] |= select;
46
+ trace_aspeed_intc_pending_irq(name, inpin_idx, s->pending[inpin_idx]);
47
+ } else {
48
+ /*
49
+ * notify firmware which source interrupt are coming
50
+ * by setting status register
51
+ */
52
+ s->regs[status_reg] = select;
53
+ trace_aspeed_intc_trigger_irq(name, inpin_idx, outpin_idx,
54
+ s->regs[status_reg]);
55
+ aspeed_intc_update(s, inpin_idx, outpin_idx, 1);
56
+ }
57
+}
58
+
59
/*
60
- * The address of GICINT128 to GICINT136 are from 0x1000 to 0x1804.
61
- * Utilize "address & 0x0f00" to get the irq and irq output pin index
62
- * The value of irq should be 0 to num_inpins.
63
- * The irq 0 indicates GICINT128, irq 1 indicates GICINT129 and so on.
64
+ * GICINT128 to GICINT136 map 1:1 to input and output IRQs 0 to 8.
65
+ * The value of input IRQ should be between 0 and the number of inputs.
66
*/
67
static void aspeed_intc_set_irq(void *opaque, int irq, int level)
68
{
69
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_set_irq(void *opaque, int irq, int level)
70
AspeedINTCClass *aic = ASPEED_INTC_GET_CLASS(s);
71
const char *name = object_get_typename(OBJECT(s));
72
const AspeedINTCIRQ *intc_irq;
73
- uint32_t status_reg;
74
uint32_t select = 0;
75
uint32_t enable;
76
- int outpin_idx;
77
int inpin_idx;
78
int i;
79
80
assert(irq < aic->num_inpins);
81
82
intc_irq = &aic->irq_table[irq];
83
- status_reg = intc_irq->status_reg;
84
- outpin_idx = intc_irq->outpin_idx;
85
inpin_idx = intc_irq->inpin_idx;
86
-
87
trace_aspeed_intc_set_irq(name, inpin_idx, level);
88
enable = s->enable[inpin_idx];
89
90
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_set_irq(void *opaque, int irq, int level)
91
}
92
93
trace_aspeed_intc_select(name, select);
94
-
95
- if (s->mask[inpin_idx] || s->regs[status_reg]) {
96
- /*
97
- * a. mask is not 0 means in ISR mode
98
- * sources interrupt routine are executing.
99
- * b. status register value is not 0 means previous
100
- * source interrupt does not be executed, yet.
101
- *
102
- * save source interrupt to pending variable.
103
- */
104
- s->pending[inpin_idx] |= select;
105
- trace_aspeed_intc_pending_irq(name, inpin_idx, s->pending[inpin_idx]);
106
- } else {
107
- /*
108
- * notify firmware which source interrupt are coming
109
- * by setting status register
110
- */
111
- s->regs[status_reg] = select;
112
- trace_aspeed_intc_trigger_irq(name, inpin_idx, outpin_idx,
113
- s->regs[status_reg]);
114
- aspeed_intc_update(s, inpin_idx, outpin_idx, 1);
115
- }
116
+ aspeed_intc_set_irq_handler(s, intc_irq, select);
117
}
118
119
static void aspeed_intc_enable_handler(AspeedINTCState *s, hwaddr offset,
120
--
121
2.48.1
122
123
diff view generated by jsdifflib
New patch
1
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
2
3
This update introduces support for handling multi-output IRQs in the AST2700
4
interrupt controller (INTC), specifically for GICINT192_201. GICINT192_201 maps
5
1:10 to input IRQ 0 and output IRQs 0 to 9. Each status bit corresponds to a
6
specific IRQ.
7
8
Implemented "aspeed_intc_set_irq_handler_multi_outpins" to handle IRQs with
9
multiple output pins. Introduced "aspeed_intc_status_handler_multi_outpins"
10
for managing status registers associated with multi-output IRQs.
11
12
Added new IRQ definitions for GICINT192_201 in INTC.
13
Adjusted the IRQ array to accommodate 10 input pins and 19 output pins,
14
aligning with the new GICINT192_201 mappings.
15
16
|------------------------------|
17
| INTC |
18
|inpin[0:0]--------->outpin[0] |
19
|inpin[0:1]--------->outpin[1] |
20
|inpin[0:2]--------->outpin[2] |
21
|inpin[0:3]--------->outpin[3] |
22
orgates[0]-------> |inpin[0:4]--------->outpin[4] |
23
|inpin[0:5]--------->outpin[5] |
24
|inpin[0:6]--------->outpin[6] |
25
|inpin[0:7]--------->outpin[7] |
26
|inpin[0:8]--------->outpin[8] |
27
|inpin[0:9]--------->outpin[9] |
28
| |
29
orgates[1]------> |inpin[1]----------->outpin[10]|
30
orgates[2]------> |inpin[2]----------->outpin[11]|
31
orgates[3]------> |inpin[3]----------->outpin[12]|
32
orgates[4]------> |inpin[4]----------->outpin[13]|
33
orgates[5]------> |inpin[5]----------->outpin[14]|
34
orgates[6]------> |inpin[6]----------->outpin[15]|
35
orgates[7]------> |inpin[7]----------->outpin[16]|
36
orgates[8]------> |inpin[8]----------->outpin[17]|
37
orgates[9]------> |inpin[9]----------->outpin[18]|
38
|------------------------------|
39
40
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
41
Reviewed-by: Cédric Le Goater <clg@redhat.com>
42
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-17-jamin_lin@aspeedtech.com
43
Signed-off-by: Cédric Le Goater <clg@redhat.com>
44
---
45
include/hw/intc/aspeed_intc.h | 4 +-
46
hw/intc/aspeed_intc.c | 149 ++++++++++++++++++++++++++++++----
47
hw/intc/trace-events | 1 +
48
3 files changed, 137 insertions(+), 17 deletions(-)
49
50
diff --git a/include/hw/intc/aspeed_intc.h b/include/hw/intc/aspeed_intc.h
51
index XXXXXXX..XXXXXXX 100644
52
--- a/include/hw/intc/aspeed_intc.h
53
+++ b/include/hw/intc/aspeed_intc.h
54
@@ -XXX,XX +XXX,XX @@
55
#define TYPE_ASPEED_2700_INTC TYPE_ASPEED_INTC "-ast2700"
56
OBJECT_DECLARE_TYPE(AspeedINTCState, AspeedINTCClass, ASPEED_INTC)
57
58
-#define ASPEED_INTC_MAX_INPINS 9
59
-#define ASPEED_INTC_MAX_OUTPINS 9
60
+#define ASPEED_INTC_MAX_INPINS 10
61
+#define ASPEED_INTC_MAX_OUTPINS 19
62
63
typedef struct AspeedINTCIRQ {
64
int inpin_idx;
65
diff --git a/hw/intc/aspeed_intc.c b/hw/intc/aspeed_intc.c
66
index XXXXXXX..XXXXXXX 100644
67
--- a/hw/intc/aspeed_intc.c
68
+++ b/hw/intc/aspeed_intc.c
69
@@ -XXX,XX +XXX,XX @@ REG32(GICINT135_EN, 0x700)
70
REG32(GICINT135_STATUS, 0x704)
71
REG32(GICINT136_EN, 0x800)
72
REG32(GICINT136_STATUS, 0x804)
73
+REG32(GICINT192_201_EN, 0xB00)
74
+REG32(GICINT192_201_STATUS, 0xB04)
75
76
static const AspeedINTCIRQ *aspeed_intc_get_irq(AspeedINTCClass *aic,
77
uint32_t reg)
78
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_set_irq_handler(AspeedINTCState *s,
79
}
80
}
81
82
+static void aspeed_intc_set_irq_handler_multi_outpins(AspeedINTCState *s,
83
+ const AspeedINTCIRQ *intc_irq, uint32_t select)
84
+{
85
+ const char *name = object_get_typename(OBJECT(s));
86
+ uint32_t status_reg;
87
+ int num_outpins;
88
+ int outpin_idx;
89
+ int inpin_idx;
90
+ int i;
91
+
92
+ num_outpins = intc_irq->num_outpins;
93
+ status_reg = intc_irq->status_reg;
94
+ outpin_idx = intc_irq->outpin_idx;
95
+ inpin_idx = intc_irq->inpin_idx;
96
+
97
+ for (i = 0; i < num_outpins; i++) {
98
+ if (select & BIT(i)) {
99
+ if (s->mask[inpin_idx] & BIT(i) ||
100
+ s->regs[status_reg] & BIT(i)) {
101
+ /*
102
+ * a. mask bit is not 0 means in ISR mode sources interrupt
103
+ * routine are executing.
104
+ * b. status bit is not 0 means previous source interrupt
105
+ * does not be executed, yet.
106
+ *
107
+ * save source interrupt to pending bit.
108
+ */
109
+ s->pending[inpin_idx] |= BIT(i);
110
+ trace_aspeed_intc_pending_irq(name, inpin_idx,
111
+ s->pending[inpin_idx]);
112
+ } else {
113
+ /*
114
+ * notify firmware which source interrupt are coming
115
+ * by setting status bit
116
+ */
117
+ s->regs[status_reg] |= BIT(i);
118
+ trace_aspeed_intc_trigger_irq(name, inpin_idx, outpin_idx + i,
119
+ s->regs[status_reg]);
120
+ aspeed_intc_update(s, inpin_idx, outpin_idx + i, 1);
121
+ }
122
+ }
123
+ }
124
+}
125
+
126
/*
127
- * GICINT128 to GICINT136 map 1:1 to input and output IRQs 0 to 8.
128
- * The value of input IRQ should be between 0 and the number of inputs.
129
+ * GICINT192_201 maps 1:10 to input IRQ 0 and output IRQs 0 to 9.
130
+ * GICINT128 to GICINT136 map 1:1 to input IRQs 1 to 9 and output
131
+ * IRQs 10 to 18. The value of input IRQ should be between 0 and
132
+ * the number of input pins.
133
*/
134
static void aspeed_intc_set_irq(void *opaque, int irq, int level)
135
{
136
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_set_irq(void *opaque, int irq, int level)
137
const AspeedINTCIRQ *intc_irq;
138
uint32_t select = 0;
139
uint32_t enable;
140
+ int num_outpins;
141
int inpin_idx;
142
int i;
143
144
assert(irq < aic->num_inpins);
145
146
intc_irq = &aic->irq_table[irq];
147
+ num_outpins = intc_irq->num_outpins;
148
inpin_idx = intc_irq->inpin_idx;
149
trace_aspeed_intc_set_irq(name, inpin_idx, level);
150
enable = s->enable[inpin_idx];
151
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_set_irq(void *opaque, int irq, int level)
152
}
153
154
trace_aspeed_intc_select(name, select);
155
- aspeed_intc_set_irq_handler(s, intc_irq, select);
156
+ if (num_outpins > 1) {
157
+ aspeed_intc_set_irq_handler_multi_outpins(s, intc_irq, select);
158
+ } else {
159
+ aspeed_intc_set_irq_handler(s, intc_irq, select);
160
+ }
161
}
162
163
static void aspeed_intc_enable_handler(AspeedINTCState *s, hwaddr offset,
164
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_status_handler(AspeedINTCState *s, hwaddr offset,
165
}
166
}
167
168
+static void aspeed_intc_status_handler_multi_outpins(AspeedINTCState *s,
169
+ hwaddr offset, uint64_t data)
170
+{
171
+ const char *name = object_get_typename(OBJECT(s));
172
+ AspeedINTCClass *aic = ASPEED_INTC_GET_CLASS(s);
173
+ const AspeedINTCIRQ *intc_irq;
174
+ uint32_t reg = offset >> 2;
175
+ int num_outpins;
176
+ int outpin_idx;
177
+ int inpin_idx;
178
+ int i;
179
+
180
+ if (!data) {
181
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: Invalid data 0\n", __func__);
182
+ return;
183
+ }
184
+
185
+ intc_irq = aspeed_intc_get_irq(aic, reg);
186
+ num_outpins = intc_irq->num_outpins;
187
+ outpin_idx = intc_irq->outpin_idx;
188
+ inpin_idx = intc_irq->inpin_idx;
189
+ assert(inpin_idx < aic->num_inpins);
190
+
191
+ /* clear status */
192
+ s->regs[reg] &= ~data;
193
+
194
+ /*
195
+ * The status registers are used for notify sources ISR are executed.
196
+ * If one source ISR is executed, it will clear one bit.
197
+ * If it clear all bits, it means to initialize this register status
198
+ * rather than sources ISR are executed.
199
+ */
200
+ if (data == 0xffffffff) {
201
+ return;
202
+ }
203
+
204
+ for (i = 0; i < num_outpins; i++) {
205
+ /* All source ISR executions are done from a specific bit */
206
+ if (data & BIT(i)) {
207
+ trace_aspeed_intc_all_isr_done_bit(name, inpin_idx, i);
208
+ if (s->pending[inpin_idx] & BIT(i)) {
209
+ /*
210
+ * Handle pending source interrupt.
211
+ * Notify firmware which source interrupt is pending
212
+ * by setting the status bit.
213
+ */
214
+ s->regs[reg] |= BIT(i);
215
+ s->pending[inpin_idx] &= ~BIT(i);
216
+ trace_aspeed_intc_trigger_irq(name, inpin_idx, outpin_idx + i,
217
+ s->regs[reg]);
218
+ aspeed_intc_update(s, inpin_idx, outpin_idx + i, 1);
219
+ } else {
220
+ /* clear irq for the specific bit */
221
+ trace_aspeed_intc_clear_irq(name, inpin_idx, outpin_idx + i, 0);
222
+ aspeed_intc_update(s, inpin_idx, outpin_idx + i, 0);
223
+ }
224
+ }
225
+ }
226
+}
227
+
228
static uint64_t aspeed_intc_read(void *opaque, hwaddr offset, unsigned int size)
229
{
230
AspeedINTCState *s = ASPEED_INTC(opaque);
231
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_write(void *opaque, hwaddr offset, uint64_t data,
232
case R_GICINT134_EN:
233
case R_GICINT135_EN:
234
case R_GICINT136_EN:
235
+ case R_GICINT192_201_EN:
236
aspeed_intc_enable_handler(s, offset, data);
237
break;
238
case R_GICINT128_STATUS:
239
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_write(void *opaque, hwaddr offset, uint64_t data,
240
case R_GICINT136_STATUS:
241
aspeed_intc_status_handler(s, offset, data);
242
break;
243
+ case R_GICINT192_201_STATUS:
244
+ aspeed_intc_status_handler_multi_outpins(s, offset, data);
245
+ break;
246
default:
247
s->regs[reg] = data;
248
break;
249
@@ -XXX,XX +XXX,XX @@ static const TypeInfo aspeed_intc_info = {
250
};
251
252
static AspeedINTCIRQ aspeed_2700_intc_irqs[ASPEED_INTC_MAX_INPINS] = {
253
- {0, 0, 1, R_GICINT128_EN, R_GICINT128_STATUS},
254
- {1, 1, 1, R_GICINT129_EN, R_GICINT129_STATUS},
255
- {2, 2, 1, R_GICINT130_EN, R_GICINT130_STATUS},
256
- {3, 3, 1, R_GICINT131_EN, R_GICINT131_STATUS},
257
- {4, 4, 1, R_GICINT132_EN, R_GICINT132_STATUS},
258
- {5, 5, 1, R_GICINT133_EN, R_GICINT133_STATUS},
259
- {6, 6, 1, R_GICINT134_EN, R_GICINT134_STATUS},
260
- {7, 7, 1, R_GICINT135_EN, R_GICINT135_STATUS},
261
- {8, 8, 1, R_GICINT136_EN, R_GICINT136_STATUS},
262
+ {0, 0, 10, R_GICINT192_201_EN, R_GICINT192_201_STATUS},
263
+ {1, 10, 1, R_GICINT128_EN, R_GICINT128_STATUS},
264
+ {2, 11, 1, R_GICINT129_EN, R_GICINT129_STATUS},
265
+ {3, 12, 1, R_GICINT130_EN, R_GICINT130_STATUS},
266
+ {4, 13, 1, R_GICINT131_EN, R_GICINT131_STATUS},
267
+ {5, 14, 1, R_GICINT132_EN, R_GICINT132_STATUS},
268
+ {6, 15, 1, R_GICINT133_EN, R_GICINT133_STATUS},
269
+ {7, 16, 1, R_GICINT134_EN, R_GICINT134_STATUS},
270
+ {8, 17, 1, R_GICINT135_EN, R_GICINT135_STATUS},
271
+ {9, 18, 1, R_GICINT136_EN, R_GICINT136_STATUS},
272
};
273
274
static void aspeed_2700_intc_class_init(ObjectClass *klass, void *data)
275
@@ -XXX,XX +XXX,XX @@ static void aspeed_2700_intc_class_init(ObjectClass *klass, void *data)
276
277
dc->desc = "ASPEED 2700 INTC Controller";
278
aic->num_lines = 32;
279
- aic->num_inpins = 9;
280
- aic->num_outpins = 9;
281
+ aic->num_inpins = 10;
282
+ aic->num_outpins = 19;
283
aic->mem_size = 0x4000;
284
- aic->nr_regs = 0x808 >> 2;
285
+ aic->nr_regs = 0xB08 >> 2;
286
aic->reg_offset = 0x1000;
287
aic->irq_table = aspeed_2700_intc_irqs;
288
aic->irq_table_count = ARRAY_SIZE(aspeed_2700_intc_irqs);
289
diff --git a/hw/intc/trace-events b/hw/intc/trace-events
290
index XXXXXXX..XXXXXXX 100644
291
--- a/hw/intc/trace-events
292
+++ b/hw/intc/trace-events
293
@@ -XXX,XX +XXX,XX @@ aspeed_intc_enable(const char *s, uint32_t value) "%s: Enable: 0x%x"
294
aspeed_intc_select(const char *s, uint32_t value) "%s: Select: 0x%x"
295
aspeed_intc_mask(const char *s, uint32_t change, uint32_t value) "%s: Mask: 0x%x: 0x%x"
296
aspeed_intc_unmask(const char *s, uint32_t change, uint32_t value) "%s: UnMask: 0x%x: 0x%x"
297
+aspeed_intc_all_isr_done_bit(const char *s, int inpin_idx, int bit) "%s: All source ISR execution are done from specific bit: %d-%d"
298
299
# arm_gic.c
300
gic_enable_irq(int irq) "irq %d enabled"
301
--
302
2.48.1
303
304
diff view generated by jsdifflib
New patch
1
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
2
3
Introduce a new ast2700 INTCIO class to support AST2700 INTCIO.
4
Added new register definitions for INTCIO, including enable and status
5
registers for IRQs GICINT192 through GICINT197.
6
Created a dedicated IRQ array for INTCIO, supporting six input pins and six
7
output pins, aligning with the newly defined registers.
8
Implemented "aspeed_intcio_read" and "aspeed_intcio_write" to handle
9
INTCIO-specific register access.
10
11
To GICINT196 |
12
13
ETH1 |-----------| |--------------------------|
14
-------->|0 | | INTCIO |
15
ETH2 | 4| orgates[0]------>|inpin[0]-------->outpin[0]|
16
-------->|1 5| orgates[1]------>|inpin[1]-------->outpin[1]|
17
ETH3 | 6| orgates[2]------>|inpin[2]-------->outpin[2]|
18
-------->|2 19| orgates[3]------>|inpin[3]-------->outpin[3]|
19
UART0 | 20|-->orgates[4]------>|inpin[4]-------->outpin[4]|
20
-------->|7 21| orgates[5]------>|inpin[5]-------->outpin[5]|
21
UART1 | 22| |--------------------------|
22
-------->|8 23|
23
UART2 | 24|
24
-------->|9 25|
25
UART3 | 26|
26
---------|10 27|
27
UART5 | 28|
28
-------->|11 29|
29
UART6 | |
30
-------->|12 30|
31
UART7 | 31|
32
-------->|13 |
33
UART8 | OR[0:31] |
34
-------->|14 |
35
UART9 | |
36
-------->|15 |
37
UART10 | |
38
-------->|16 |
39
UART11 | |
40
-------->|17 |
41
UART12 | |
42
-------->|18 |
43
|-----------|
44
45
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
46
Reviewed-by: Cédric Le Goater <clg@redhat.com>
47
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-18-jamin_lin@aspeedtech.com
48
Signed-off-by: Cédric Le Goater <clg@redhat.com>
49
---
50
include/hw/intc/aspeed_intc.h | 1 +
51
hw/intc/aspeed_intc.c | 112 ++++++++++++++++++++++++++++++++++
52
2 files changed, 113 insertions(+)
53
54
diff --git a/include/hw/intc/aspeed_intc.h b/include/hw/intc/aspeed_intc.h
55
index XXXXXXX..XXXXXXX 100644
56
--- a/include/hw/intc/aspeed_intc.h
57
+++ b/include/hw/intc/aspeed_intc.h
58
@@ -XXX,XX +XXX,XX @@
59
60
#define TYPE_ASPEED_INTC "aspeed.intc"
61
#define TYPE_ASPEED_2700_INTC TYPE_ASPEED_INTC "-ast2700"
62
+#define TYPE_ASPEED_2700_INTCIO TYPE_ASPEED_INTC "io-ast2700"
63
OBJECT_DECLARE_TYPE(AspeedINTCState, AspeedINTCClass, ASPEED_INTC)
64
65
#define ASPEED_INTC_MAX_INPINS 10
66
diff --git a/hw/intc/aspeed_intc.c b/hw/intc/aspeed_intc.c
67
index XXXXXXX..XXXXXXX 100644
68
--- a/hw/intc/aspeed_intc.c
69
+++ b/hw/intc/aspeed_intc.c
70
@@ -XXX,XX +XXX,XX @@ REG32(GICINT136_STATUS, 0x804)
71
REG32(GICINT192_201_EN, 0xB00)
72
REG32(GICINT192_201_STATUS, 0xB04)
73
74
+/*
75
+ * INTCIO Registers
76
+ *
77
+ * values below are offset by - 0x100 from datasheet
78
+ * because its memory region is start at 0x100
79
+ *
80
+ */
81
+REG32(GICINT192_EN, 0x00)
82
+REG32(GICINT192_STATUS, 0x04)
83
+REG32(GICINT193_EN, 0x10)
84
+REG32(GICINT193_STATUS, 0x14)
85
+REG32(GICINT194_EN, 0x20)
86
+REG32(GICINT194_STATUS, 0x24)
87
+REG32(GICINT195_EN, 0x30)
88
+REG32(GICINT195_STATUS, 0x34)
89
+REG32(GICINT196_EN, 0x40)
90
+REG32(GICINT196_STATUS, 0x44)
91
+REG32(GICINT197_EN, 0x50)
92
+REG32(GICINT197_STATUS, 0x54)
93
+
94
static const AspeedINTCIRQ *aspeed_intc_get_irq(AspeedINTCClass *aic,
95
uint32_t reg)
96
{
97
@@ -XXX,XX +XXX,XX @@ static void aspeed_intc_write(void *opaque, hwaddr offset, uint64_t data,
98
return;
99
}
100
101
+static uint64_t aspeed_intcio_read(void *opaque, hwaddr offset,
102
+ unsigned int size)
103
+{
104
+ AspeedINTCState *s = ASPEED_INTC(opaque);
105
+ const char *name = object_get_typename(OBJECT(s));
106
+ uint32_t reg = offset >> 2;
107
+ uint32_t value = 0;
108
+
109
+ value = s->regs[reg];
110
+ trace_aspeed_intc_read(name, offset, size, value);
111
+
112
+ return value;
113
+}
114
+
115
+static void aspeed_intcio_write(void *opaque, hwaddr offset, uint64_t data,
116
+ unsigned size)
117
+{
118
+ AspeedINTCState *s = ASPEED_INTC(opaque);
119
+ const char *name = object_get_typename(OBJECT(s));
120
+ uint32_t reg = offset >> 2;
121
+
122
+ trace_aspeed_intc_write(name, offset, size, data);
123
+
124
+ switch (reg) {
125
+ case R_GICINT192_EN:
126
+ case R_GICINT193_EN:
127
+ case R_GICINT194_EN:
128
+ case R_GICINT195_EN:
129
+ case R_GICINT196_EN:
130
+ case R_GICINT197_EN:
131
+ aspeed_intc_enable_handler(s, offset, data);
132
+ break;
133
+ case R_GICINT192_STATUS:
134
+ case R_GICINT193_STATUS:
135
+ case R_GICINT194_STATUS:
136
+ case R_GICINT195_STATUS:
137
+ case R_GICINT196_STATUS:
138
+ case R_GICINT197_STATUS:
139
+ aspeed_intc_status_handler(s, offset, data);
140
+ break;
141
+ default:
142
+ s->regs[reg] = data;
143
+ break;
144
+ }
145
+
146
+ return;
147
+}
148
+
149
+
150
static const MemoryRegionOps aspeed_intc_ops = {
151
.read = aspeed_intc_read,
152
.write = aspeed_intc_write,
153
@@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps aspeed_intc_ops = {
154
}
155
};
156
157
+static const MemoryRegionOps aspeed_intcio_ops = {
158
+ .read = aspeed_intcio_read,
159
+ .write = aspeed_intcio_write,
160
+ .endianness = DEVICE_LITTLE_ENDIAN,
161
+ .valid = {
162
+ .min_access_size = 4,
163
+ .max_access_size = 4,
164
+ }
165
+};
166
+
167
static void aspeed_intc_instance_init(Object *obj)
168
{
169
AspeedINTCState *s = ASPEED_INTC(obj);
170
@@ -XXX,XX +XXX,XX @@ static const TypeInfo aspeed_2700_intc_info = {
171
.class_init = aspeed_2700_intc_class_init,
172
};
173
174
+static AspeedINTCIRQ aspeed_2700_intcio_irqs[ASPEED_INTC_MAX_INPINS] = {
175
+ {0, 0, 1, R_GICINT192_EN, R_GICINT192_STATUS},
176
+ {1, 1, 1, R_GICINT193_EN, R_GICINT193_STATUS},
177
+ {2, 2, 1, R_GICINT194_EN, R_GICINT194_STATUS},
178
+ {3, 3, 1, R_GICINT195_EN, R_GICINT195_STATUS},
179
+ {4, 4, 1, R_GICINT196_EN, R_GICINT196_STATUS},
180
+ {5, 5, 1, R_GICINT197_EN, R_GICINT197_STATUS},
181
+};
182
+
183
+static void aspeed_2700_intcio_class_init(ObjectClass *klass, void *data)
184
+{
185
+ DeviceClass *dc = DEVICE_CLASS(klass);
186
+ AspeedINTCClass *aic = ASPEED_INTC_CLASS(klass);
187
+
188
+ dc->desc = "ASPEED 2700 INTC IO Controller";
189
+ aic->num_lines = 32;
190
+ aic->num_inpins = 6;
191
+ aic->num_outpins = 6;
192
+ aic->mem_size = 0x400;
193
+ aic->nr_regs = 0x58 >> 2;
194
+ aic->reg_offset = 0x100;
195
+ aic->reg_ops = &aspeed_intcio_ops;
196
+ aic->irq_table = aspeed_2700_intcio_irqs;
197
+ aic->irq_table_count = ARRAY_SIZE(aspeed_2700_intcio_irqs);
198
+}
199
+
200
+static const TypeInfo aspeed_2700_intcio_info = {
201
+ .name = TYPE_ASPEED_2700_INTCIO,
202
+ .parent = TYPE_ASPEED_INTC,
203
+ .class_init = aspeed_2700_intcio_class_init,
204
+};
205
+
206
static void aspeed_intc_register_types(void)
207
{
208
type_register_static(&aspeed_intc_info);
209
type_register_static(&aspeed_2700_intc_info);
210
+ type_register_static(&aspeed_2700_intcio_info);
211
}
212
213
type_init(aspeed_intc_register_types);
214
--
215
2.48.1
216
217
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
Added new definitions for AST2700_A1_SILICON_REV and AST2750_A1_SILICON_REV to
4
identify the A1 silicon revisions.
5
6
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
7
Reviewed-by: Cédric Le Goater <clg@redhat.com>
8
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-19-jamin_lin@aspeedtech.com
9
Signed-off-by: Cédric Le Goater <clg@redhat.com>
10
---
11
include/hw/misc/aspeed_scu.h | 2 ++
12
hw/misc/aspeed_scu.c | 2 ++
13
2 files changed, 4 insertions(+)
14
15
diff --git a/include/hw/misc/aspeed_scu.h b/include/hw/misc/aspeed_scu.h
16
index XXXXXXX..XXXXXXX 100644
17
--- a/include/hw/misc/aspeed_scu.h
18
+++ b/include/hw/misc/aspeed_scu.h
19
@@ -XXX,XX +XXX,XX @@ struct AspeedSCUState {
20
#define AST2700_A0_SILICON_REV 0x06000103U
21
#define AST2720_A0_SILICON_REV 0x06000203U
22
#define AST2750_A0_SILICON_REV 0x06000003U
23
+#define AST2700_A1_SILICON_REV 0x06010103U
24
+#define AST2750_A1_SILICON_REV 0x06010003U
25
26
#define ASPEED_IS_AST2500(si_rev) ((((si_rev) >> 24) & 0xff) == 0x04)
27
28
diff --git a/hw/misc/aspeed_scu.c b/hw/misc/aspeed_scu.c
29
index XXXXXXX..XXXXXXX 100644
30
--- a/hw/misc/aspeed_scu.c
31
+++ b/hw/misc/aspeed_scu.c
32
@@ -XXX,XX +XXX,XX @@ static uint32_t aspeed_silicon_revs[] = {
33
AST2700_A0_SILICON_REV,
34
AST2720_A0_SILICON_REV,
35
AST2750_A0_SILICON_REV,
36
+ AST2700_A1_SILICON_REV,
37
+ AST2750_A1_SILICON_REV,
38
};
39
40
bool is_supported_silicon_rev(uint32_t silicon_rev)
41
--
42
2.48.1
43
44
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
Currently, these IRQ tables support from GIC 128 - 136 for AST2700 A0.
4
These IRQ tables can be reused for AST2700 A1 from GIC 192 - 197.
5
Updates the interrupt mapping to include support for AST2700 A1 by extending
6
the existing mappings to the new GIC range.
7
8
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
9
Reviewed-by: Cédric Le Goater <clg@redhat.com>
10
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-20-jamin_lin@aspeedtech.com
11
Signed-off-by: Cédric Le Goater <clg@redhat.com>
12
---
13
hw/arm/aspeed_ast27x0.c | 77 ++++++++++++++++++++++++++---------------
14
1 file changed, 50 insertions(+), 27 deletions(-)
15
16
diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c
17
index XXXXXXX..XXXXXXX 100644
18
--- a/hw/arm/aspeed_ast27x0.c
19
+++ b/hw/arm/aspeed_ast27x0.c
20
@@ -XXX,XX +XXX,XX @@ static const int aspeed_soc_ast2700a0_irqmap[] = {
21
};
22
23
/* GICINT 128 */
24
-static const int aspeed_soc_ast2700_gic128_intcmap[] = {
25
+/* GICINT 192 */
26
+static const int ast2700_gic128_gic192_intcmap[] = {
27
[ASPEED_DEV_LPC] = 0,
28
[ASPEED_DEV_IBT] = 2,
29
[ASPEED_DEV_KCS] = 4,
30
};
31
32
+/* GICINT 129 */
33
+/* GICINT 193 */
34
+
35
/* GICINT 130 */
36
-static const int aspeed_soc_ast2700_gic130_intcmap[] = {
37
+/* GICINT 194 */
38
+static const int ast2700_gic130_gic194_intcmap[] = {
39
[ASPEED_DEV_I2C] = 0,
40
[ASPEED_DEV_ADC] = 16,
41
[ASPEED_DEV_GPIO] = 18,
42
};
43
44
/* GICINT 131 */
45
-static const int aspeed_soc_ast2700_gic131_intcmap[] = {
46
+/* GICINT 195 */
47
+static const int ast2700_gic131_gic195_intcmap[] = {
48
[ASPEED_DEV_I3C] = 0,
49
[ASPEED_DEV_WDT] = 16,
50
[ASPEED_DEV_FMC] = 25,
51
@@ -XXX,XX +XXX,XX @@ static const int aspeed_soc_ast2700_gic131_intcmap[] = {
52
};
53
54
/* GICINT 132 */
55
-static const int aspeed_soc_ast2700_gic132_intcmap[] = {
56
+/* GICINT 196 */
57
+static const int ast2700_gic132_gic196_intcmap[] = {
58
[ASPEED_DEV_ETH1] = 0,
59
[ASPEED_DEV_ETH2] = 1,
60
[ASPEED_DEV_ETH3] = 2,
61
@@ -XXX,XX +XXX,XX @@ static const int aspeed_soc_ast2700_gic132_intcmap[] = {
62
};
63
64
/* GICINT 133 */
65
-static const int aspeed_soc_ast2700_gic133_intcmap[] = {
66
+/* GICINT 197 */
67
+static const int ast2700_gic133_gic197_intcmap[] = {
68
[ASPEED_DEV_SDHCI] = 1,
69
[ASPEED_DEV_PECI] = 4,
70
};
71
72
/* GICINT 128 ~ 136 */
73
+/* GICINT 192 ~ 201 */
74
struct gic_intc_irq_info {
75
int irq;
76
const int *ptr;
77
};
78
79
-static const struct gic_intc_irq_info aspeed_soc_ast2700_gic_intcmap[] = {
80
- {128, aspeed_soc_ast2700_gic128_intcmap},
81
+static const struct gic_intc_irq_info ast2700_gic_intcmap[] = {
82
+ {128, ast2700_gic128_gic192_intcmap},
83
{129, NULL},
84
- {130, aspeed_soc_ast2700_gic130_intcmap},
85
- {131, aspeed_soc_ast2700_gic131_intcmap},
86
- {132, aspeed_soc_ast2700_gic132_intcmap},
87
- {133, aspeed_soc_ast2700_gic133_intcmap},
88
+ {130, ast2700_gic130_gic194_intcmap},
89
+ {131, ast2700_gic131_gic195_intcmap},
90
+ {132, ast2700_gic132_gic196_intcmap},
91
+ {133, ast2700_gic133_gic197_intcmap},
92
{134, NULL},
93
{135, NULL},
94
{136, NULL},
95
@@ -XXX,XX +XXX,XX @@ static qemu_irq aspeed_soc_ast2700_get_irq(AspeedSoCState *s, int dev)
96
AspeedSoCClass *sc = ASPEED_SOC_GET_CLASS(s);
97
int i;
98
99
- for (i = 0; i < ARRAY_SIZE(aspeed_soc_ast2700_gic_intcmap); i++) {
100
- if (sc->irqmap[dev] == aspeed_soc_ast2700_gic_intcmap[i].irq) {
101
- assert(aspeed_soc_ast2700_gic_intcmap[i].ptr);
102
+ for (i = 0; i < ARRAY_SIZE(ast2700_gic_intcmap); i++) {
103
+ if (sc->irqmap[dev] == ast2700_gic_intcmap[i].irq) {
104
+ assert(ast2700_gic_intcmap[i].ptr);
105
return qdev_get_gpio_in(DEVICE(&a->intc.orgates[i]),
106
- aspeed_soc_ast2700_gic_intcmap[i].ptr[dev]);
107
+ ast2700_gic_intcmap[i].ptr[dev]);
108
}
109
}
110
111
@@ -XXX,XX +XXX,XX @@ static qemu_irq aspeed_soc_ast2700_get_irq_index(AspeedSoCState *s, int dev,
112
AspeedSoCClass *sc = ASPEED_SOC_GET_CLASS(s);
113
int i;
114
115
- for (i = 0; i < ARRAY_SIZE(aspeed_soc_ast2700_gic_intcmap); i++) {
116
- if (sc->irqmap[dev] == aspeed_soc_ast2700_gic_intcmap[i].irq) {
117
- assert(aspeed_soc_ast2700_gic_intcmap[i].ptr);
118
+ for (i = 0; i < ARRAY_SIZE(ast2700_gic_intcmap); i++) {
119
+ if (sc->irqmap[dev] == ast2700_gic_intcmap[i].irq) {
120
+ assert(ast2700_gic_intcmap[i].ptr);
121
return qdev_get_gpio_in(DEVICE(&a->intc.orgates[i]),
122
- aspeed_soc_ast2700_gic_intcmap[i].ptr[dev] + index);
123
+ ast2700_gic_intcmap[i].ptr[dev] + index);
124
}
125
}
126
127
/*
128
- * Invalid orgate index, device irq should be 128 to 136.
129
+ * Invalid OR gate index, device IRQ should be between 128 to 136
130
+ * and 192 to 201.
131
*/
132
g_assert_not_reached();
133
}
134
@@ -XXX,XX +XXX,XX @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp)
135
aspeed_mmio_map(s, SYS_BUS_DEVICE(&a->intc), 0,
136
sc->memmap[ASPEED_DEV_INTC]);
137
138
- /* source orgates -> INTC */
139
+ /* irq sources -> orgates -> INTC */
140
for (i = 0; i < ic->num_inpins; i++) {
141
qdev_connect_gpio_out(DEVICE(&a->intc.orgates[i]), 0,
142
- qdev_get_gpio_in(DEVICE(&a->intc), i));
143
+ qdev_get_gpio_in(DEVICE(&a->intc), i));
144
}
145
146
+ /* INTC -> GIC192 - GIC201 */
147
/* INTC -> GIC128 - GIC136 */
148
for (i = 0; i < ic->num_outpins; i++) {
149
sysbus_connect_irq(SYS_BUS_DEVICE(&a->intc), i,
150
qdev_get_gpio_in(DEVICE(&a->gic),
151
- aspeed_soc_ast2700_gic_intcmap[i].irq));
152
+ ast2700_gic_intcmap[i].irq));
153
}
154
155
/* SRAM */
156
@@ -XXX,XX +XXX,XX @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp)
157
for (i = 0; i < ASPEED_I2C_GET_CLASS(&s->i2c)->num_busses; i++) {
158
/*
159
* The AST2700 I2C controller has one source INTC per bus.
160
- * I2C buses interrupt are connected to GICINT130_INTC
161
- * from bit 0 to bit 15.
162
- * I2C bus 0 is connected to GICINT130_INTC at bit 0.
163
- * I2C bus 15 is connected to GICINT130_INTC at bit 15.
164
+ *
165
+ * For AST2700 A0:
166
+ * I2C bus interrupts are connected to the OR gate from bit 0 to bit
167
+ * 15, and the OR gate output pin is connected to the input pin of
168
+ * GICINT130 of INTC (CPU Die). Then, the output pin is connected to
169
+ * the GIC.
170
+ *
171
+ * For AST2700 A1:
172
+ * I2C bus interrupts are connected to the OR gate from bit 0 to bit
173
+ * 15, and the OR gate output pin is connected to the input pin of
174
+ * GICINT194 of INTCIO (IO Die). Then, the output pin is connected
175
+ * to the INTC (CPU Die) input pin, and its output pin is connected
176
+ * to the GIC.
177
+ *
178
+ * I2C bus 0 is connected to the OR gate at bit 0.
179
+ * I2C bus 15 is connected to the OR gate at bit 15.
180
*/
181
irq = aspeed_soc_ast2700_get_irq_index(s, ASPEED_DEV_I2C, i);
182
sysbus_connect_irq(SYS_BUS_DEVICE(&s->i2c.busses[i]), 0, irq);
183
--
184
2.48.1
185
186
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
Updated Aspeed27x0SoCState to include an intc[2] array instead of a single
4
AspeedINTCState instance. Modified aspeed_soc_ast2700_get_irq and
5
aspeed_soc_ast2700_get_irq_index to correctly reference the corresponding
6
interrupt controller instance and OR gate index.
7
8
Currently, only GIC 192 to 201 are supported, and their source interrupts are
9
from INTCIO and connected to INTC at input pin 0 and output pins 0 to 9 for
10
GIC 192-201.
11
12
To support both AST2700 A1 and A0, INTC input pins 1 to 9 and output pins
13
10 to 18 remain to support GIC 128-136, which source interrupts from INTC.
14
15
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
16
Reviewed-by: Cédric Le Goater <clg@redhat.com>
17
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-21-jamin_lin@aspeedtech.com
18
Signed-off-by: Cédric Le Goater <clg@redhat.com>
19
---
20
include/hw/arm/aspeed_soc.h | 2 +-
21
hw/arm/aspeed_ast27x0.c | 58 +++++++++++++++++++++++++------------
22
2 files changed, 40 insertions(+), 20 deletions(-)
23
24
diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h
25
index XXXXXXX..XXXXXXX 100644
26
--- a/include/hw/arm/aspeed_soc.h
27
+++ b/include/hw/arm/aspeed_soc.h
28
@@ -XXX,XX +XXX,XX @@ struct Aspeed27x0SoCState {
29
AspeedSoCState parent;
30
31
ARMCPU cpu[ASPEED_CPUS_NUM];
32
- AspeedINTCState intc;
33
+ AspeedINTCState intc[2];
34
GICv3State gic;
35
MemoryRegion dram_empty;
36
};
37
diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c
38
index XXXXXXX..XXXXXXX 100644
39
--- a/hw/arm/aspeed_ast27x0.c
40
+++ b/hw/arm/aspeed_ast27x0.c
41
@@ -XXX,XX +XXX,XX @@ static const int ast2700_gic133_gic197_intcmap[] = {
42
/* GICINT 192 ~ 201 */
43
struct gic_intc_irq_info {
44
int irq;
45
+ int intc_idx;
46
+ int orgate_idx;
47
const int *ptr;
48
};
49
50
static const struct gic_intc_irq_info ast2700_gic_intcmap[] = {
51
- {128, ast2700_gic128_gic192_intcmap},
52
- {129, NULL},
53
- {130, ast2700_gic130_gic194_intcmap},
54
- {131, ast2700_gic131_gic195_intcmap},
55
- {132, ast2700_gic132_gic196_intcmap},
56
- {133, ast2700_gic133_gic197_intcmap},
57
- {134, NULL},
58
- {135, NULL},
59
- {136, NULL},
60
+ {192, 1, 0, ast2700_gic128_gic192_intcmap},
61
+ {193, 1, 1, NULL},
62
+ {194, 1, 2, ast2700_gic130_gic194_intcmap},
63
+ {195, 1, 3, ast2700_gic131_gic195_intcmap},
64
+ {196, 1, 4, ast2700_gic132_gic196_intcmap},
65
+ {197, 1, 5, ast2700_gic133_gic197_intcmap},
66
+ {198, 1, 6, NULL},
67
+ {199, 1, 7, NULL},
68
+ {200, 1, 8, NULL},
69
+ {201, 1, 9, NULL},
70
+ {128, 0, 1, ast2700_gic128_gic192_intcmap},
71
+ {129, 0, 2, NULL},
72
+ {130, 0, 3, ast2700_gic130_gic194_intcmap},
73
+ {131, 0, 4, ast2700_gic131_gic195_intcmap},
74
+ {132, 0, 5, ast2700_gic132_gic196_intcmap},
75
+ {133, 0, 6, ast2700_gic133_gic197_intcmap},
76
+ {134, 0, 7, NULL},
77
+ {135, 0, 8, NULL},
78
+ {136, 0, 9, NULL},
79
};
80
81
static qemu_irq aspeed_soc_ast2700_get_irq(AspeedSoCState *s, int dev)
82
{
83
Aspeed27x0SoCState *a = ASPEED27X0_SOC(s);
84
AspeedSoCClass *sc = ASPEED_SOC_GET_CLASS(s);
85
+ int or_idx;
86
+ int idx;
87
int i;
88
89
for (i = 0; i < ARRAY_SIZE(ast2700_gic_intcmap); i++) {
90
if (sc->irqmap[dev] == ast2700_gic_intcmap[i].irq) {
91
assert(ast2700_gic_intcmap[i].ptr);
92
- return qdev_get_gpio_in(DEVICE(&a->intc.orgates[i]),
93
- ast2700_gic_intcmap[i].ptr[dev]);
94
+ or_idx = ast2700_gic_intcmap[i].orgate_idx;
95
+ idx = ast2700_gic_intcmap[i].intc_idx;
96
+ return qdev_get_gpio_in(DEVICE(&a->intc[idx].orgates[or_idx]),
97
+ ast2700_gic_intcmap[i].ptr[dev]);
98
}
99
}
100
101
@@ -XXX,XX +XXX,XX @@ static qemu_irq aspeed_soc_ast2700_get_irq_index(AspeedSoCState *s, int dev,
102
{
103
Aspeed27x0SoCState *a = ASPEED27X0_SOC(s);
104
AspeedSoCClass *sc = ASPEED_SOC_GET_CLASS(s);
105
+ int or_idx;
106
+ int idx;
107
int i;
108
109
for (i = 0; i < ARRAY_SIZE(ast2700_gic_intcmap); i++) {
110
if (sc->irqmap[dev] == ast2700_gic_intcmap[i].irq) {
111
assert(ast2700_gic_intcmap[i].ptr);
112
- return qdev_get_gpio_in(DEVICE(&a->intc.orgates[i]),
113
+ or_idx = ast2700_gic_intcmap[i].orgate_idx;
114
+ idx = ast2700_gic_intcmap[i].intc_idx;
115
+ return qdev_get_gpio_in(DEVICE(&a->intc[idx].orgates[or_idx]),
116
ast2700_gic_intcmap[i].ptr[dev] + index);
117
}
118
}
119
@@ -XXX,XX +XXX,XX @@ static void aspeed_soc_ast2700_init(Object *obj)
120
121
object_initialize_child(obj, "sli", &s->sli, TYPE_ASPEED_2700_SLI);
122
object_initialize_child(obj, "sliio", &s->sliio, TYPE_ASPEED_2700_SLIIO);
123
- object_initialize_child(obj, "intc", &a->intc, TYPE_ASPEED_2700_INTC);
124
+ object_initialize_child(obj, "intc", &a->intc[0], TYPE_ASPEED_2700_INTC);
125
126
snprintf(typename, sizeof(typename), "aspeed.adc-%s", socname);
127
object_initialize_child(obj, "adc", &s->adc, typename);
128
@@ -XXX,XX +XXX,XX @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp)
129
Aspeed27x0SoCState *a = ASPEED27X0_SOC(dev);
130
AspeedSoCState *s = ASPEED_SOC(dev);
131
AspeedSoCClass *sc = ASPEED_SOC_GET_CLASS(s);
132
- AspeedINTCClass *ic = ASPEED_INTC_GET_CLASS(&a->intc);
133
+ AspeedINTCClass *ic = ASPEED_INTC_GET_CLASS(&a->intc[0]);
134
g_autofree char *sram_name = NULL;
135
qemu_irq irq;
136
137
@@ -XXX,XX +XXX,XX @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp)
138
}
139
140
/* INTC */
141
- if (!sysbus_realize(SYS_BUS_DEVICE(&a->intc), errp)) {
142
+ if (!sysbus_realize(SYS_BUS_DEVICE(&a->intc[0]), errp)) {
143
return;
144
}
145
146
- aspeed_mmio_map(s, SYS_BUS_DEVICE(&a->intc), 0,
147
+ aspeed_mmio_map(s, SYS_BUS_DEVICE(&a->intc[0]), 0,
148
sc->memmap[ASPEED_DEV_INTC]);
149
150
/* irq sources -> orgates -> INTC */
151
for (i = 0; i < ic->num_inpins; i++) {
152
- qdev_connect_gpio_out(DEVICE(&a->intc.orgates[i]), 0,
153
- qdev_get_gpio_in(DEVICE(&a->intc), i));
154
+ qdev_connect_gpio_out(DEVICE(&a->intc[0].orgates[i]), 0,
155
+ qdev_get_gpio_in(DEVICE(&a->intc[0]), i));
156
}
157
158
/* INTC -> GIC192 - GIC201 */
159
/* INTC -> GIC128 - GIC136 */
160
for (i = 0; i < ic->num_outpins; i++) {
161
- sysbus_connect_irq(SYS_BUS_DEVICE(&a->intc), i,
162
+ sysbus_connect_irq(SYS_BUS_DEVICE(&a->intc[0]), i,
163
qdev_get_gpio_in(DEVICE(&a->gic),
164
ast2700_gic_intcmap[i].irq));
165
}
166
--
167
2.48.1
168
169
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
The design of INTC controllers has significantly changed in AST2700 A1.
4
5
There are a total of 480 interrupt sources in AST2700 A1. For interrupt numbers
6
from 0 to 127, they can route directly to PSP, SSP, and TSP. Due to the
7
limitation of interrupt numbers of processors, the interrupts are merged every
8
32 sources for interrupt numbers greater than 127.
9
10
There are two levels of interrupt controllers, INTC(CPUD Die) and INTCIO
11
(IO Die). The interrupt sources of INTC are the interrupt numbers from INTC_0 to
12
INTC_127 and interrupts from INTCIO. The interrupt sources of INTCIO are the
13
interrupt numbers greater than INTC_127. INTC_IO controls the interrupts
14
INTC_128 to INTC_319 only.
15
16
Currently, only GIC 192 to 201 are supported, and their source interrupts are
17
from INTCIO and connected to INTC at input pin 0 and output pins 0 to 9 for
18
GIC 192-201.
19
20
The design of the orgates for GICINT 196 is as follows:
21
It has interrupt sources ranging from 0 to 31, with its output pin connected to
22
INTCIO "T0 GICINT_196". The output pin is then connected to INTC "GIC_192_201"
23
at bit 4, and its bit 4 output should be connected to GIC 196.
24
The design of INTC GIC_192_201 have 10 output pins, mapped as following:
25
Bit 0 -> GIC 192
26
Bit 1 -> GIC 193
27
Bit 2 -> GIC 194
28
Bit 3 -> GIC 195
29
Bit 4 -> GIC 196
30
31
To support both AST2700 A1 and A0, INTC input pins 1 to 9 and output pins
32
10 to 18 remain to support GIC 128-136, which source interrupts from INTC.
33
These will be removed if we decide not to support AST2700 A0 in the future.
34
35
|-------------------------------------------------------------------------------------------------------|
36
| AST2700 A1 Design |
37
| To GICINT196 |
38
| |
39
| ETH1 |-----------| |--------------------------| |--------------| |
40
| -------->|0 | | INTCIO | | orgates[0] | |
41
| ETH2 | 4| orgates[0]------>|inpin[0]-------->outpin[0]|------->| 0 | |
42
| -------->|1 5| orgates[1]------>|inpin[1]-------->outpin[1]|------->| 1 | |
43
| ETH3 | 6| orgates[2]------>|inpin[2]-------->outpin[2]|------->| 2 | |
44
| -------->|2 19| orgates[3]------>|inpin[3]-------->outpin[3]|------->| 3 OR[0:9] |-----| |
45
| UART0 | 20|-->orgates[4]------>|inpin[4]-------->outpin[4]|------->| 4 | | |
46
| -------->|7 21| orgates[5]------>|inpin[5]-------->outpin[5]|------->| 5 | | |
47
| UART1 | 22| orgates[6]------>|inpin[6]-------->outpin[6]|------->| 6 | | |
48
| -------->|8 23| orgates[7]------>|inpin[7]-------->outpin[7]|------->| 7 | | |
49
| UART2 | 24| orgates[8]------>|inpin[8]-------->outpin[8]|------->| 8 | | |
50
| -------->|9 25| orgates[9]------>|inpin[9]-------->outpin[9]|------->| 9 | | |
51
| UART3 | 26| |--------------------------| |--------------| | |
52
| ---------|10 27| | |
53
| UART5 | 28| | |
54
| -------->|11 29| | |
55
| UART6 | | | |
56
| -------->|12 30| |-----------------------------------------------------------------------| |
57
| UART7 | 31| | |
58
| -------->|13 | | |
59
| UART8 | OR[0:31] | | |------------------------------| |----------| |
60
| -------->|14 | | | INTC | | GIC | |
61
| UART9 | | | |inpin[0:0]--------->outpin[0] |---------->|192 | |
62
| -------->|15 | | |inpin[0:1]--------->outpin[1] |---------->|193 | |
63
| UART10 | | | |inpin[0:2]--------->outpin[2] |---------->|194 | |
64
| -------->|16 | | |inpin[0:3]--------->outpin[3] |---------->|195 | |
65
| UART11 | | |--------------> |inpin[0:4]--------->outpin[4] |---------->|196 | |
66
| -------->|17 | |inpin[0:5]--------->outpin[5] |---------->|197 | |
67
| UART12 | | |inpin[0:6]--------->outpin[6] |---------->|198 | |
68
| -------->|18 | |inpin[0:7]--------->outpin[7] |---------->|199 | |
69
| |-----------| |inpin[0:8]--------->outpin[8] |---------->|200 | |
70
| |inpin[0:9]--------->outpin[9] |---------->|201 | |
71
|-------------------------------------------------------------------------------------------------------|
72
|-------------------------------------------------------------------------------------------------------|
73
| ETH1 |-----------| orgates[1]------->|inpin[1]----------->outpin[10]|---------->|128 | |
74
| -------->|0 | orgates[2]------->|inpin[2]----------->outpin[11]|---------->|129 | |
75
| ETH2 | 4| orgates[3]------->|inpin[3]----------->outpin[12]|---------->|130 | |
76
| -------->|1 5| orgates[4]------->|inpin[4]----------->outpin[13]|---------->|131 | |
77
| ETH3 | 6|---->orgates[5]------->|inpin[5]----------->outpin[14]|---------->|132 | |
78
| -------->|2 19| orgates[6]------->|inpin[6]----------->outpin[15]|---------->|133 | |
79
| UART0 | 20| orgates[7]------->|inpin[7]----------->outpin[16]|---------->|134 | |
80
| -------->|7 21| orgates[8]------->|inpin[8]----------->outpin[17]|---------->|135 | |
81
| UART1 | 22| orgates[9]------->|inpin[9]----------->outpin[18]|---------->|136 | |
82
| -------->|8 23| |------------------------------| |----------| |
83
| UART2 | 24| |
84
| -------->|9 25| AST2700 A0 Design |
85
| UART3 | 26| |
86
| -------->|10 27| |
87
| UART5 | 28| |
88
| -------->|11 29| GICINT132 |
89
| UART6 | | |
90
| -------->|12 30| |
91
| UART7 | 31| |
92
| -------->|13 | |
93
| UART8 | OR[0:31] | |
94
| -------->|14 | |
95
| UART9 | | |
96
| -------->|15 | |
97
| UART10 | | |
98
| -------->|16 | |
99
| UART11 | | |
100
| -------->|17 | |
101
| UART12 | | |
102
| -------->|18 | |
103
| |-----------| |
104
| |
105
|-------------------------------------------------------------------------------------------------------|
106
107
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
108
Reviewed-by: Cédric Le Goater <clg@redhat.com>
109
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-22-jamin_lin@aspeedtech.com
110
Signed-off-by: Cédric Le Goater <clg@redhat.com>
111
---
112
include/hw/arm/aspeed_soc.h | 1 +
113
hw/arm/aspeed_ast27x0.c | 24 ++++++++++++++++++++++++
114
2 files changed, 25 insertions(+)
115
116
diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h
117
index XXXXXXX..XXXXXXX 100644
118
--- a/include/hw/arm/aspeed_soc.h
119
+++ b/include/hw/arm/aspeed_soc.h
120
@@ -XXX,XX +XXX,XX @@ enum {
121
ASPEED_DEV_EHCI2,
122
ASPEED_DEV_VIC,
123
ASPEED_DEV_INTC,
124
+ ASPEED_DEV_INTCIO,
125
ASPEED_DEV_SDMC,
126
ASPEED_DEV_SCU,
127
ASPEED_DEV_ADC,
128
diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c
129
index XXXXXXX..XXXXXXX 100644
130
--- a/hw/arm/aspeed_ast27x0.c
131
+++ b/hw/arm/aspeed_ast27x0.c
132
@@ -XXX,XX +XXX,XX @@ static const hwaddr aspeed_soc_ast2700_memmap[] = {
133
[ASPEED_DEV_ETH3] = 0x14070000,
134
[ASPEED_DEV_EMMC] = 0x12090000,
135
[ASPEED_DEV_INTC] = 0x12100000,
136
+ [ASPEED_DEV_INTCIO] = 0x14C18000,
137
[ASPEED_DEV_SLI] = 0x12C17000,
138
[ASPEED_DEV_SLIIO] = 0x14C1E000,
139
[ASPEED_GIC_DIST] = 0x12200000,
140
@@ -XXX,XX +XXX,XX @@ static void aspeed_soc_ast2700_init(Object *obj)
141
object_initialize_child(obj, "sli", &s->sli, TYPE_ASPEED_2700_SLI);
142
object_initialize_child(obj, "sliio", &s->sliio, TYPE_ASPEED_2700_SLIIO);
143
object_initialize_child(obj, "intc", &a->intc[0], TYPE_ASPEED_2700_INTC);
144
+ object_initialize_child(obj, "intcio", &a->intc[1],
145
+ TYPE_ASPEED_2700_INTCIO);
146
147
snprintf(typename, sizeof(typename), "aspeed.adc-%s", socname);
148
object_initialize_child(obj, "adc", &s->adc, typename);
149
@@ -XXX,XX +XXX,XX @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp)
150
AspeedSoCState *s = ASPEED_SOC(dev);
151
AspeedSoCClass *sc = ASPEED_SOC_GET_CLASS(s);
152
AspeedINTCClass *ic = ASPEED_INTC_GET_CLASS(&a->intc[0]);
153
+ AspeedINTCClass *icio = ASPEED_INTC_GET_CLASS(&a->intc[1]);
154
g_autofree char *sram_name = NULL;
155
qemu_irq irq;
156
157
@@ -XXX,XX +XXX,XX @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp)
158
aspeed_mmio_map(s, SYS_BUS_DEVICE(&a->intc[0]), 0,
159
sc->memmap[ASPEED_DEV_INTC]);
160
161
+ /* INTCIO */
162
+ if (!sysbus_realize(SYS_BUS_DEVICE(&a->intc[1]), errp)) {
163
+ return;
164
+ }
165
+
166
+ aspeed_mmio_map(s, SYS_BUS_DEVICE(&a->intc[1]), 0,
167
+ sc->memmap[ASPEED_DEV_INTCIO]);
168
+
169
/* irq sources -> orgates -> INTC */
170
for (i = 0; i < ic->num_inpins; i++) {
171
qdev_connect_gpio_out(DEVICE(&a->intc[0].orgates[i]), 0,
172
@@ -XXX,XX +XXX,XX @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp)
173
ast2700_gic_intcmap[i].irq));
174
}
175
176
+ /* irq source -> orgates -> INTCIO */
177
+ for (i = 0; i < icio->num_inpins; i++) {
178
+ qdev_connect_gpio_out(DEVICE(&a->intc[1].orgates[i]), 0,
179
+ qdev_get_gpio_in(DEVICE(&a->intc[1]), i));
180
+ }
181
+
182
+ /* INTCIO -> INTC */
183
+ for (i = 0; i < icio->num_outpins; i++) {
184
+ sysbus_connect_irq(SYS_BUS_DEVICE(&a->intc[1]), i,
185
+ qdev_get_gpio_in(DEVICE(&a->intc[0].orgates[0]), i));
186
+ }
187
+
188
/* SRAM */
189
sram_name = g_strdup_printf("aspeed.sram.%d", CPU(&a->cpu[0])->cpu_index);
190
if (!memory_region_init_ram(&s->sram, OBJECT(s), sram_name, sc->sram_size,
191
--
192
2.48.1
193
194
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
The memory map for AST2700 A1 remains compatible with AST2700 A0. However, the
4
IRQ mapping has been updated for AST2700 A1, with GIC interrupts now ranging
5
from 192 to 201. Add a new IRQ map table for AST2700 A1.
6
Add "aspeed_soc_ast2700a1_class_init" to initialize the AST2700 A1 SoC.
7
8
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
9
Reviewed-by: Cédric Le Goater <clg@redhat.com>
10
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-23-jamin_lin@aspeedtech.com
11
[ clg: Removed sc->name ]
12
Signed-off-by: Cédric Le Goater <clg@redhat.com>
13
---
14
hw/arm/aspeed_ast27x0.c | 79 +++++++++++++++++++++++++++++++++++++++++
15
1 file changed, 79 insertions(+)
16
17
diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c
18
index XXXXXXX..XXXXXXX 100644
19
--- a/hw/arm/aspeed_ast27x0.c
20
+++ b/hw/arm/aspeed_ast27x0.c
21
@@ -XXX,XX +XXX,XX @@ static const int aspeed_soc_ast2700a0_irqmap[] = {
22
[ASPEED_DEV_SDHCI] = 133,
23
};
24
25
+static const int aspeed_soc_ast2700a1_irqmap[] = {
26
+ [ASPEED_DEV_SDMC] = 0,
27
+ [ASPEED_DEV_HACE] = 4,
28
+ [ASPEED_DEV_XDMA] = 5,
29
+ [ASPEED_DEV_UART4] = 8,
30
+ [ASPEED_DEV_SCU] = 12,
31
+ [ASPEED_DEV_RTC] = 13,
32
+ [ASPEED_DEV_EMMC] = 15,
33
+ [ASPEED_DEV_TIMER1] = 16,
34
+ [ASPEED_DEV_TIMER2] = 17,
35
+ [ASPEED_DEV_TIMER3] = 18,
36
+ [ASPEED_DEV_TIMER4] = 19,
37
+ [ASPEED_DEV_TIMER5] = 20,
38
+ [ASPEED_DEV_TIMER6] = 21,
39
+ [ASPEED_DEV_TIMER7] = 22,
40
+ [ASPEED_DEV_TIMER8] = 23,
41
+ [ASPEED_DEV_DP] = 28,
42
+ [ASPEED_DEV_LPC] = 192,
43
+ [ASPEED_DEV_IBT] = 192,
44
+ [ASPEED_DEV_KCS] = 192,
45
+ [ASPEED_DEV_I2C] = 194,
46
+ [ASPEED_DEV_ADC] = 194,
47
+ [ASPEED_DEV_GPIO] = 194,
48
+ [ASPEED_DEV_FMC] = 195,
49
+ [ASPEED_DEV_WDT] = 195,
50
+ [ASPEED_DEV_PWM] = 195,
51
+ [ASPEED_DEV_I3C] = 195,
52
+ [ASPEED_DEV_UART0] = 196,
53
+ [ASPEED_DEV_UART1] = 196,
54
+ [ASPEED_DEV_UART2] = 196,
55
+ [ASPEED_DEV_UART3] = 196,
56
+ [ASPEED_DEV_UART5] = 196,
57
+ [ASPEED_DEV_UART6] = 196,
58
+ [ASPEED_DEV_UART7] = 196,
59
+ [ASPEED_DEV_UART8] = 196,
60
+ [ASPEED_DEV_UART9] = 196,
61
+ [ASPEED_DEV_UART10] = 196,
62
+ [ASPEED_DEV_UART11] = 196,
63
+ [ASPEED_DEV_UART12] = 196,
64
+ [ASPEED_DEV_ETH1] = 196,
65
+ [ASPEED_DEV_ETH2] = 196,
66
+ [ASPEED_DEV_ETH3] = 196,
67
+ [ASPEED_DEV_PECI] = 197,
68
+ [ASPEED_DEV_SDHCI] = 197,
69
+};
70
+
71
/* GICINT 128 */
72
/* GICINT 192 */
73
static const int ast2700_gic128_gic192_intcmap[] = {
74
@@ -XXX,XX +XXX,XX @@ static void aspeed_soc_ast2700a0_class_init(ObjectClass *oc, void *data)
75
sc->get_irq = aspeed_soc_ast2700_get_irq;
76
}
77
78
+static void aspeed_soc_ast2700a1_class_init(ObjectClass *oc, void *data)
79
+{
80
+ static const char * const valid_cpu_types[] = {
81
+ ARM_CPU_TYPE_NAME("cortex-a35"),
82
+ NULL
83
+ };
84
+ DeviceClass *dc = DEVICE_CLASS(oc);
85
+ AspeedSoCClass *sc = ASPEED_SOC_CLASS(oc);
86
+
87
+ /* Reason: The Aspeed SoC can only be instantiated from a board */
88
+ dc->user_creatable = false;
89
+ dc->realize = aspeed_soc_ast2700_realize;
90
+
91
+ sc->valid_cpu_types = valid_cpu_types;
92
+ sc->silicon_rev = AST2700_A1_SILICON_REV;
93
+ sc->sram_size = 0x20000;
94
+ sc->spis_num = 3;
95
+ sc->wdts_num = 8;
96
+ sc->macs_num = 3;
97
+ sc->uarts_num = 13;
98
+ sc->num_cpus = 4;
99
+ sc->uarts_base = ASPEED_DEV_UART0;
100
+ sc->irqmap = aspeed_soc_ast2700a1_irqmap;
101
+ sc->memmap = aspeed_soc_ast2700_memmap;
102
+ sc->get_irq = aspeed_soc_ast2700_get_irq;
103
+}
104
+
105
static const TypeInfo aspeed_soc_ast27x0_types[] = {
106
{
107
.name = TYPE_ASPEED27X0_SOC,
108
@@ -XXX,XX +XXX,XX @@ static const TypeInfo aspeed_soc_ast27x0_types[] = {
109
.instance_init = aspeed_soc_ast2700_init,
110
.class_init = aspeed_soc_ast2700a0_class_init,
111
},
112
+ {
113
+ .name = "ast2700-a1",
114
+ .parent = TYPE_ASPEED27X0_SOC,
115
+ .instance_init = aspeed_soc_ast2700_init,
116
+ .class_init = aspeed_soc_ast2700a1_class_init,
117
+ },
118
};
119
120
DEFINE_TYPES(aspeed_soc_ast27x0_types)
121
--
122
2.48.1
123
124
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
Introduce "aspeed_machine_ast2700a1_evb_class_init" to initialize the
4
AST2700 A1 EVB.
5
6
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
7
Reviewed-by: Cédric Le Goater <clg@redhat.com>
8
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-24-jamin_lin@aspeedtech.com
9
Signed-off-by: Cédric Le Goater <clg@redhat.com>
10
---
11
hw/arm/aspeed.c | 24 ++++++++++++++++++++++++
12
1 file changed, 24 insertions(+)
13
14
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
15
index XXXXXXX..XXXXXXX 100644
16
--- a/hw/arm/aspeed.c
17
+++ b/hw/arm/aspeed.c
18
@@ -XXX,XX +XXX,XX @@ static void aspeed_machine_ast2700a0_evb_class_init(ObjectClass *oc, void *data)
19
mc->default_ram_size = 1 * GiB;
20
aspeed_machine_class_init_cpus_defaults(mc);
21
}
22
+
23
+static void aspeed_machine_ast2700a1_evb_class_init(ObjectClass *oc, void *data)
24
+{
25
+ MachineClass *mc = MACHINE_CLASS(oc);
26
+ AspeedMachineClass *amc = ASPEED_MACHINE_CLASS(oc);
27
+
28
+ mc->desc = "Aspeed AST2700 A1 EVB (Cortex-A35)";
29
+ amc->soc_name = "ast2700-a1";
30
+ amc->hw_strap1 = AST2700_EVB_HW_STRAP1;
31
+ amc->hw_strap2 = AST2700_EVB_HW_STRAP2;
32
+ amc->fmc_model = "w25q01jvq";
33
+ amc->spi_model = "w25q512jv";
34
+ amc->num_cs = 2;
35
+ amc->macs_mask = ASPEED_MAC0_ON | ASPEED_MAC1_ON | ASPEED_MAC2_ON;
36
+ amc->uart_default = ASPEED_DEV_UART12;
37
+ amc->i2c_init = ast2700_evb_i2c_init;
38
+ mc->auto_create_sdcard = true;
39
+ mc->default_ram_size = 1 * GiB;
40
+ aspeed_machine_class_init_cpus_defaults(mc);
41
+}
42
#endif
43
44
static void aspeed_machine_qcom_dc_scm_v1_class_init(ObjectClass *oc,
45
@@ -XXX,XX +XXX,XX @@ static const TypeInfo aspeed_machine_types[] = {
46
.name = MACHINE_TYPE_NAME("ast2700a0-evb"),
47
.parent = TYPE_ASPEED_MACHINE,
48
.class_init = aspeed_machine_ast2700a0_evb_class_init,
49
+ }, {
50
+ .name = MACHINE_TYPE_NAME("ast2700a1-evb"),
51
+ .parent = TYPE_ASPEED_MACHINE,
52
+ .class_init = aspeed_machine_ast2700a1_evb_class_init,
53
#endif
54
}, {
55
.name = TYPE_ASPEED_MACHINE,
56
--
57
2.48.1
58
59
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
To improve readability, sort the memmap table by mapping address
4
5
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
6
Reviewed-by: Cédric Le Goater <clg@redhat.com>
7
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-25-jamin_lin@aspeedtech.com
8
Signed-off-by: Cédric Le Goater <clg@redhat.com>
9
---
10
hw/arm/aspeed_ast27x0.c | 54 ++++++++++++++++++++---------------------
11
1 file changed, 27 insertions(+), 27 deletions(-)
12
13
diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c
14
index XXXXXXX..XXXXXXX 100644
15
--- a/hw/arm/aspeed_ast27x0.c
16
+++ b/hw/arm/aspeed_ast27x0.c
17
@@ -XXX,XX +XXX,XX @@
18
#include "qemu/log.h"
19
20
static const hwaddr aspeed_soc_ast2700_memmap[] = {
21
- [ASPEED_DEV_SPI_BOOT] = 0x100000000,
22
[ASPEED_DEV_SRAM] = 0x10000000,
23
+ [ASPEED_DEV_HACE] = 0x12070000,
24
+ [ASPEED_DEV_EMMC] = 0x12090000,
25
+ [ASPEED_DEV_INTC] = 0x12100000,
26
+ [ASPEED_GIC_DIST] = 0x12200000,
27
+ [ASPEED_GIC_REDIST] = 0x12280000,
28
[ASPEED_DEV_SDMC] = 0x12C00000,
29
[ASPEED_DEV_SCU] = 0x12C02000,
30
+ [ASPEED_DEV_RTC] = 0x12C0F000,
31
+ [ASPEED_DEV_TIMER1] = 0x12C10000,
32
+ [ASPEED_DEV_SLI] = 0x12C17000,
33
+ [ASPEED_DEV_UART4] = 0X12C1A000,
34
+ [ASPEED_DEV_FMC] = 0x14000000,
35
+ [ASPEED_DEV_SPI0] = 0x14010000,
36
+ [ASPEED_DEV_SPI1] = 0x14020000,
37
+ [ASPEED_DEV_SPI2] = 0x14030000,
38
+ [ASPEED_DEV_MII1] = 0x14040000,
39
+ [ASPEED_DEV_MII2] = 0x14040008,
40
+ [ASPEED_DEV_MII3] = 0x14040010,
41
+ [ASPEED_DEV_ETH1] = 0x14050000,
42
+ [ASPEED_DEV_ETH2] = 0x14060000,
43
+ [ASPEED_DEV_ETH3] = 0x14070000,
44
+ [ASPEED_DEV_SDHCI] = 0x14080000,
45
+ [ASPEED_DEV_ADC] = 0x14C00000,
46
[ASPEED_DEV_SCUIO] = 0x14C02000,
47
+ [ASPEED_DEV_GPIO] = 0x14C0B000,
48
+ [ASPEED_DEV_I2C] = 0x14C0F000,
49
+ [ASPEED_DEV_INTCIO] = 0x14C18000,
50
+ [ASPEED_DEV_SLIIO] = 0x14C1E000,
51
+ [ASPEED_DEV_VUART] = 0X14C30000,
52
[ASPEED_DEV_UART0] = 0X14C33000,
53
[ASPEED_DEV_UART1] = 0X14C33100,
54
[ASPEED_DEV_UART2] = 0X14C33200,
55
[ASPEED_DEV_UART3] = 0X14C33300,
56
- [ASPEED_DEV_UART4] = 0X12C1A000,
57
[ASPEED_DEV_UART5] = 0X14C33400,
58
[ASPEED_DEV_UART6] = 0X14C33500,
59
[ASPEED_DEV_UART7] = 0X14C33600,
60
@@ -XXX,XX +XXX,XX @@ static const hwaddr aspeed_soc_ast2700_memmap[] = {
61
[ASPEED_DEV_UART11] = 0X14C33A00,
62
[ASPEED_DEV_UART12] = 0X14C33B00,
63
[ASPEED_DEV_WDT] = 0x14C37000,
64
- [ASPEED_DEV_VUART] = 0X14C30000,
65
- [ASPEED_DEV_FMC] = 0x14000000,
66
- [ASPEED_DEV_SPI0] = 0x14010000,
67
- [ASPEED_DEV_SPI1] = 0x14020000,
68
- [ASPEED_DEV_SPI2] = 0x14030000,
69
+ [ASPEED_DEV_SPI_BOOT] = 0x100000000,
70
[ASPEED_DEV_SDRAM] = 0x400000000,
71
- [ASPEED_DEV_MII1] = 0x14040000,
72
- [ASPEED_DEV_MII2] = 0x14040008,
73
- [ASPEED_DEV_MII3] = 0x14040010,
74
- [ASPEED_DEV_ETH1] = 0x14050000,
75
- [ASPEED_DEV_ETH2] = 0x14060000,
76
- [ASPEED_DEV_ETH3] = 0x14070000,
77
- [ASPEED_DEV_EMMC] = 0x12090000,
78
- [ASPEED_DEV_INTC] = 0x12100000,
79
- [ASPEED_DEV_INTCIO] = 0x14C18000,
80
- [ASPEED_DEV_SLI] = 0x12C17000,
81
- [ASPEED_DEV_SLIIO] = 0x14C1E000,
82
- [ASPEED_GIC_DIST] = 0x12200000,
83
- [ASPEED_GIC_REDIST] = 0x12280000,
84
- [ASPEED_DEV_ADC] = 0x14C00000,
85
- [ASPEED_DEV_I2C] = 0x14C0F000,
86
- [ASPEED_DEV_GPIO] = 0x14C0B000,
87
- [ASPEED_DEV_RTC] = 0x12C0F000,
88
- [ASPEED_DEV_SDHCI] = 0x14080000,
89
- [ASPEED_DEV_TIMER1] = 0x12C10000,
90
- [ASPEED_DEV_HACE] = 0x12070000,
91
};
92
93
#define AST2700_MAX_IRQ 256
94
--
95
2.48.1
96
97
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
Added a new method "start_ast2700_test" to the "AST2x00MachineSDK" class and
4
this method centralizes the logic for starting the AST2700 test, making it
5
reusable for different test cases.
6
7
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
8
Reviewed-by: Cédric Le Goater <clg@redhat.com>
9
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-26-jamin_lin@aspeedtech.com
10
Signed-off-by: Cédric Le Goater <clg@redhat.com>
11
---
12
tests/functional/test_aarch64_aspeed.py | 29 +++++++++++++------------
13
1 file changed, 15 insertions(+), 14 deletions(-)
14
15
diff --git a/tests/functional/test_aarch64_aspeed.py b/tests/functional/test_aarch64_aspeed.py
16
index XXXXXXX..XXXXXXX 100755
17
--- a/tests/functional/test_aarch64_aspeed.py
18
+++ b/tests/functional/test_aarch64_aspeed.py
19
@@ -XXX,XX +XXX,XX @@ def do_test_aarch64_aspeed_sdk_start(self, image):
20
'https://github.com/AspeedTech-BMC/openbmc/releases/download/v09.03/ast2700-default-obmc.tar.gz',
21
'91225f50d255e2905ba8d8e0c80b71b9d157c3609770c7a740cd786370d85a77')
22
23
- def test_aarch64_ast2700_evb_sdk_v09_03(self):
24
- self.set_machine('ast2700-evb')
25
-
26
- self.archive_extract(self.ASSET_SDK_V903_AST2700)
27
-
28
+ def start_ast2700_test(self, name):
29
num_cpu = 4
30
- uboot_size = os.path.getsize(self.scratch_file('ast2700-default',
31
+ uboot_size = os.path.getsize(self.scratch_file(name,
32
'u-boot-nodtb.bin'))
33
uboot_dtb_load_addr = hex(0x400000000 + uboot_size)
34
35
load_images_list = [
36
{
37
'addr': '0x400000000',
38
- 'file': self.scratch_file('ast2700-default',
39
+ 'file': self.scratch_file(name,
40
'u-boot-nodtb.bin')
41
},
42
{
43
'addr': str(uboot_dtb_load_addr),
44
- 'file': self.scratch_file('ast2700-default', 'u-boot.dtb')
45
+ 'file': self.scratch_file(name, 'u-boot.dtb')
46
},
47
{
48
'addr': '0x430000000',
49
- 'file': self.scratch_file('ast2700-default', 'bl31.bin')
50
+ 'file': self.scratch_file(name, 'bl31.bin')
51
},
52
{
53
'addr': '0x430080000',
54
- 'file': self.scratch_file('ast2700-default', 'optee',
55
+ 'file': self.scratch_file(name, 'optee',
56
'tee-raw.bin')
57
}
58
]
59
@@ -XXX,XX +XXX,XX @@ def test_aarch64_ast2700_evb_sdk_v09_03(self):
60
self.vm.add_args('-device',
61
'tmp105,bus=aspeed.i2c.bus.1,address=0x4d,id=tmp-test')
62
self.do_test_aarch64_aspeed_sdk_start(
63
- self.scratch_file('ast2700-default', 'image-bmc'))
64
+ self.scratch_file(name, 'image-bmc'))
65
66
- wait_for_console_pattern(self, 'ast2700-default login:')
67
+ wait_for_console_pattern(self, f'{name} login:')
68
69
exec_command_and_wait_for_pattern(self, 'root', 'Password:')
70
- exec_command_and_wait_for_pattern(self,
71
- '0penBmc', 'root@ast2700-default:~#')
72
+ exec_command_and_wait_for_pattern(self, '0penBmc', f'root@{name}:~#')
73
74
exec_command_and_wait_for_pattern(self,
75
'echo lm75 0x4d > /sys/class/i2c-dev/i2c-1/device/new_device ',
76
@@ -XXX,XX +XXX,XX @@ def test_aarch64_ast2700_evb_sdk_v09_03(self):
77
exec_command_and_wait_for_pattern(self,
78
'cat /sys/class/hwmon/hwmon20/temp1_input', '18000')
79
80
+ def test_aarch64_ast2700_evb_sdk_v09_03(self):
81
+ self.set_machine('ast2700-evb')
82
+
83
+ self.archive_extract(self.ASSET_SDK_V903_AST2700)
84
+ self.start_ast2700_test('ast2700-default')
85
+
86
87
if __name__ == '__main__':
88
QemuSystemTest.main()
89
--
90
2.48.1
91
92
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
Modified the temperature hwmon path to use a wildcard to handle different SDK
4
versions: "cat /sys/bus/i2c/devices/1-004d/hwmon/hwmon*/temp1_input".
5
6
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
7
Reviewed-by: Cédric Le Goater <clg@redhat.com>
8
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-27-jamin_lin@aspeedtech.com
9
Signed-off-by: Cédric Le Goater <clg@redhat.com>
10
---
11
tests/functional/test_aarch64_aspeed.py | 4 ++--
12
1 file changed, 2 insertions(+), 2 deletions(-)
13
14
diff --git a/tests/functional/test_aarch64_aspeed.py b/tests/functional/test_aarch64_aspeed.py
15
index XXXXXXX..XXXXXXX 100755
16
--- a/tests/functional/test_aarch64_aspeed.py
17
+++ b/tests/functional/test_aarch64_aspeed.py
18
@@ -XXX,XX +XXX,XX @@ def start_ast2700_test(self, name):
19
'echo lm75 0x4d > /sys/class/i2c-dev/i2c-1/device/new_device ',
20
'i2c i2c-1: new_device: Instantiated device lm75 at 0x4d');
21
exec_command_and_wait_for_pattern(self,
22
- 'cat /sys/class/hwmon/hwmon20/temp1_input', '0')
23
+ 'cat /sys/bus/i2c/devices/1-004d/hwmon/hwmon*/temp1_input', '0')
24
self.vm.cmd('qom-set', path='/machine/peripheral/tmp-test',
25
property='temperature', value=18000)
26
exec_command_and_wait_for_pattern(self,
27
- 'cat /sys/class/hwmon/hwmon20/temp1_input', '18000')
28
+ 'cat /sys/bus/i2c/devices/1-004d/hwmon/hwmon*/temp1_input', '18000')
29
30
def test_aarch64_ast2700_evb_sdk_v09_03(self):
31
self.set_machine('ast2700-evb')
32
--
33
2.48.1
34
35
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
In ASPEED SDK v09.05, the naming convention for pre-built images has been
4
updated. The pre-built image for AST2700 A0 has been renamed to
5
ast2700-a0-default, while ast2700-default is now used for AST2700 A1.
6
7
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
8
Reviewed-by: Cédric Le Goater <clg@redhat.com>
9
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-28-jamin_lin@aspeedtech.com
10
Signed-off-by: Cédric Le Goater <clg@redhat.com>
11
---
12
tests/functional/test_aarch64_aspeed.py | 12 ++++++------
13
1 file changed, 6 insertions(+), 6 deletions(-)
14
15
diff --git a/tests/functional/test_aarch64_aspeed.py b/tests/functional/test_aarch64_aspeed.py
16
index XXXXXXX..XXXXXXX 100755
17
--- a/tests/functional/test_aarch64_aspeed.py
18
+++ b/tests/functional/test_aarch64_aspeed.py
19
@@ -XXX,XX +XXX,XX @@ def do_test_aarch64_aspeed_sdk_start(self, image):
20
wait_for_console_pattern(self, '## Loading kernel from FIT Image')
21
wait_for_console_pattern(self, 'Starting kernel ...')
22
23
- ASSET_SDK_V903_AST2700 = Asset(
24
- 'https://github.com/AspeedTech-BMC/openbmc/releases/download/v09.03/ast2700-default-obmc.tar.gz',
25
- '91225f50d255e2905ba8d8e0c80b71b9d157c3609770c7a740cd786370d85a77')
26
+ ASSET_SDK_V905_AST2700 = Asset(
27
+ 'https://github.com/AspeedTech-BMC/openbmc/releases/download/v09.05/ast2700-a0-default-obmc.tar.gz',
28
+ 'cfbbd1cce72f2a3b73b9080c41eecdadebb7077fba4f7806d72ac99f3e84b74a')
29
30
def start_ast2700_test(self, name):
31
num_cpu = 4
32
@@ -XXX,XX +XXX,XX @@ def start_ast2700_test(self, name):
33
exec_command_and_wait_for_pattern(self,
34
'cat /sys/bus/i2c/devices/1-004d/hwmon/hwmon*/temp1_input', '18000')
35
36
- def test_aarch64_ast2700_evb_sdk_v09_03(self):
37
+ def test_aarch64_ast2700_evb_sdk_v09_05(self):
38
self.set_machine('ast2700-evb')
39
40
- self.archive_extract(self.ASSET_SDK_V903_AST2700)
41
- self.start_ast2700_test('ast2700-default')
42
+ self.archive_extract(self.ASSET_SDK_V905_AST2700)
43
+ self.start_ast2700_test('ast2700-a0-default')
44
45
46
if __name__ == '__main__':
47
--
48
2.48.1
49
50
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
4
Reviewed-by: Cédric Le Goater <clg@redhat.com>
5
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-29-jamin_lin@aspeedtech.com
6
Signed-off-by: Cédric Le Goater <clg@redhat.com>
7
---
8
tests/functional/test_aarch64_aspeed.py | 10 ++++++++++
9
1 file changed, 10 insertions(+)
10
11
diff --git a/tests/functional/test_aarch64_aspeed.py b/tests/functional/test_aarch64_aspeed.py
12
index XXXXXXX..XXXXXXX 100755
13
--- a/tests/functional/test_aarch64_aspeed.py
14
+++ b/tests/functional/test_aarch64_aspeed.py
15
@@ -XXX,XX +XXX,XX @@ def do_test_aarch64_aspeed_sdk_start(self, image):
16
'https://github.com/AspeedTech-BMC/openbmc/releases/download/v09.05/ast2700-a0-default-obmc.tar.gz',
17
'cfbbd1cce72f2a3b73b9080c41eecdadebb7077fba4f7806d72ac99f3e84b74a')
18
19
+ ASSET_SDK_V905_AST2700A1 = Asset(
20
+ 'https://github.com/AspeedTech-BMC/openbmc/releases/download/v09.05/ast2700-default-obmc.tar.gz',
21
+ 'c1f4496aec06743c812a6e9a1a18d032f34d62f3ddb6956e924fef62aa2046a5')
22
+
23
def start_ast2700_test(self, name):
24
num_cpu = 4
25
uboot_size = os.path.getsize(self.scratch_file(name,
26
@@ -XXX,XX +XXX,XX @@ def test_aarch64_ast2700_evb_sdk_v09_05(self):
27
self.archive_extract(self.ASSET_SDK_V905_AST2700)
28
self.start_ast2700_test('ast2700-a0-default')
29
30
+ def test_aarch64_ast2700a1_evb_sdk_v09_05(self):
31
+ self.set_machine('ast2700a1-evb')
32
+
33
+ self.archive_extract(self.ASSET_SDK_V905_AST2700A1)
34
+ self.start_ast2700_test('ast2700-default')
35
+
36
37
if __name__ == '__main__':
38
QemuSystemTest.main()
39
--
40
2.48.1
41
42
diff view generated by jsdifflib
New patch
1
From: Jamin Lin <jamin_lin@aspeedtech.com>
1
2
3
Add AST2700 INTC design guidance and its block diagram.
4
5
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
6
Reviewed-by: Cédric Le Goater <clg@redhat.com>
7
Link: https://lore.kernel.org/qemu-devel/20250307035945.3698802-30-jamin_lin@aspeedtech.com
8
Signed-off-by: Cédric Le Goater <clg@redhat.com>
9
---
10
docs/specs/aspeed-intc.rst | 136 +++++++++++++++++++++++++++++++++++++
11
docs/specs/index.rst | 1 +
12
2 files changed, 137 insertions(+)
13
create mode 100644 docs/specs/aspeed-intc.rst
14
15
diff --git a/docs/specs/aspeed-intc.rst b/docs/specs/aspeed-intc.rst
16
new file mode 100644
17
index XXXXXXX..XXXXXXX
18
--- /dev/null
19
+++ b/docs/specs/aspeed-intc.rst
20
@@ -XXX,XX +XXX,XX @@
21
+===========================
22
+ASPEED Interrupt Controller
23
+===========================
24
+
25
+AST2700
26
+-------
27
+There are a total of 480 interrupt sources in AST2700. Due to the limitation of
28
+interrupt numbers of processors, the interrupts are merged every 32 sources for
29
+interrupt numbers greater than 127.
30
+
31
+There are two levels of interrupt controllers, INTC (CPU Die) and INTCIO
32
+(I/O Die).
33
+
34
+Interrupt Mapping
35
+-----------------
36
+- INTC: Handles interrupt sources 0 - 127 and integrates signals from INTCIO.
37
+- INTCIO: Handles interrupt sources 128 - 319 independently.
38
+
39
+QEMU Support
40
+------------
41
+Currently, only GIC 192 to 201 are supported, and their source interrupts are
42
+from INTCIO and connected to INTC at input pin 0 and output pins 0 to 9 for
43
+GIC 192-201.
44
+
45
+Design for GICINT 196
46
+---------------------
47
+The orgate has interrupt sources ranging from 0 to 31, with its output pin
48
+connected to INTCIO "T0 GICINT_196". The output pin is then connected to INTC
49
+"GIC_192_201" at bit 4, and its bit 4 output pin is connected to GIC 196.
50
+
51
+INTC GIC_192_201 Output Pin Mapping
52
+-----------------------------------
53
+The design of INTC GIC_192_201 have 10 output pins, mapped as following:
54
+
55
+==== ====
56
+Bit GIC
57
+==== ====
58
+0 192
59
+1 193
60
+2 194
61
+3 195
62
+4 196
63
+5 197
64
+6 198
65
+7 199
66
+8 200
67
+9 201
68
+==== ====
69
+
70
+AST2700 A0
71
+----------
72
+It has only one INTC controller, and currently, only GIC 128-136 is supported.
73
+To support both AST2700 A1 and AST2700 A0, there are 10 OR gates in the INTC,
74
+with gates 1 to 9 supporting GIC 128-136.
75
+
76
+Design for GICINT 132
77
+---------------------
78
+The orgate has interrupt sources ranging from 0 to 31, with its output pin
79
+connected to INTC. The output pin is then connected to GIC 132.
80
+
81
+Block Diagram of GICINT 196 for AST2700 A1 and GICINT 132 for AST2700 A0
82
+------------------------------------------------------------------------
83
+
84
+.. code-block::
85
+
86
+ |-------------------------------------------------------------------------------------------------------|
87
+ | AST2700 A1 Design |
88
+ | To GICINT196 |
89
+ | |
90
+ | ETH1 |-----------| |--------------------------| |--------------| |
91
+ | -------->|0 | | INTCIO | | orgates[0] | |
92
+ | ETH2 | 4| orgates[0]------>|inpin[0]-------->outpin[0]|------->| 0 | |
93
+ | -------->|1 5| orgates[1]------>|inpin[1]-------->outpin[1]|------->| 1 | |
94
+ | ETH3 | 6| orgates[2]------>|inpin[2]-------->outpin[2]|------->| 2 | |
95
+ | -------->|2 19| orgates[3]------>|inpin[3]-------->outpin[3]|------->| 3 OR[0:9] |-----| |
96
+ | UART0 | 20|-->orgates[4]------>|inpin[4]-------->outpin[4]|------->| 4 | | |
97
+ | -------->|7 21| orgates[5]------>|inpin[5]-------->outpin[5]|------->| 5 | | |
98
+ | UART1 | 22| orgates[6]------>|inpin[6]-------->outpin[6]|------->| 6 | | |
99
+ | -------->|8 23| orgates[7]------>|inpin[7]-------->outpin[7]|------->| 7 | | |
100
+ | UART2 | 24| orgates[8]------>|inpin[8]-------->outpin[8]|------->| 8 | | |
101
+ | -------->|9 25| orgates[9]------>|inpin[9]-------->outpin[9]|------->| 9 | | |
102
+ | UART3 | 26| |--------------------------| |--------------| | |
103
+ | ---------|10 27| | |
104
+ | UART5 | 28| | |
105
+ | -------->|11 29| | |
106
+ | UART6 | | | |
107
+ | -------->|12 30| |-----------------------------------------------------------------------| |
108
+ | UART7 | 31| | |
109
+ | -------->|13 | | |
110
+ | UART8 | OR[0:31] | | |------------------------------| |----------| |
111
+ | -------->|14 | | | INTC | | GIC | |
112
+ | UART9 | | | |inpin[0:0]--------->outpin[0] |---------->|192 | |
113
+ | -------->|15 | | |inpin[0:1]--------->outpin[1] |---------->|193 | |
114
+ | UART10 | | | |inpin[0:2]--------->outpin[2] |---------->|194 | |
115
+ | -------->|16 | | |inpin[0:3]--------->outpin[3] |---------->|195 | |
116
+ | UART11 | | |--------------> |inpin[0:4]--------->outpin[4] |---------->|196 | |
117
+ | -------->|17 | |inpin[0:5]--------->outpin[5] |---------->|197 | |
118
+ | UART12 | | |inpin[0:6]--------->outpin[6] |---------->|198 | |
119
+ | -------->|18 | |inpin[0:7]--------->outpin[7] |---------->|199 | |
120
+ | |-----------| |inpin[0:8]--------->outpin[8] |---------->|200 | |
121
+ | |inpin[0:9]--------->outpin[9] |---------->|201 | |
122
+ |-------------------------------------------------------------------------------------------------------|
123
+ |-------------------------------------------------------------------------------------------------------|
124
+ | ETH1 |-----------| orgates[1]------->|inpin[1]----------->outpin[10]|---------->|128 | |
125
+ | -------->|0 | orgates[2]------->|inpin[2]----------->outpin[11]|---------->|129 | |
126
+ | ETH2 | 4| orgates[3]------->|inpin[3]----------->outpin[12]|---------->|130 | |
127
+ | -------->|1 5| orgates[4]------->|inpin[4]----------->outpin[13]|---------->|131 | |
128
+ | ETH3 | 6|---->orgates[5]------->|inpin[5]----------->outpin[14]|---------->|132 | |
129
+ | -------->|2 19| orgates[6]------->|inpin[6]----------->outpin[15]|---------->|133 | |
130
+ | UART0 | 20| orgates[7]------->|inpin[7]----------->outpin[16]|---------->|134 | |
131
+ | -------->|7 21| orgates[8]------->|inpin[8]----------->outpin[17]|---------->|135 | |
132
+ | UART1 | 22| orgates[9]------->|inpin[9]----------->outpin[18]|---------->|136 | |
133
+ | -------->|8 23| |------------------------------| |----------| |
134
+ | UART2 | 24| |
135
+ | -------->|9 25| AST2700 A0 Design |
136
+ | UART3 | 26| |
137
+ | -------->|10 27| |
138
+ | UART5 | 28| |
139
+ | -------->|11 29| GICINT132 |
140
+ | UART6 | | |
141
+ | -------->|12 30| |
142
+ | UART7 | 31| |
143
+ | -------->|13 | |
144
+ | UART8 | OR[0:31] | |
145
+ | -------->|14 | |
146
+ | UART9 | | |
147
+ | -------->|15 | |
148
+ | UART10 | | |
149
+ | -------->|16 | |
150
+ | UART11 | | |
151
+ | -------->|17 | |
152
+ | UART12 | | |
153
+ | -------->|18 | |
154
+ | |-----------| |
155
+ | |
156
+ |-------------------------------------------------------------------------------------------------------|
157
diff --git a/docs/specs/index.rst b/docs/specs/index.rst
158
index XXXXXXX..XXXXXXX 100644
159
--- a/docs/specs/index.rst
160
+++ b/docs/specs/index.rst
161
@@ -XXX,XX +XXX,XX @@ guest hardware that is specific to QEMU.
162
rocker
163
riscv-iommu
164
riscv-aia
165
+ aspeed-intc
166
--
167
2.48.1
168
169
diff view generated by jsdifflib