Re: [PATCH v8 3/9] machine: Improve is_cpu_type_supported()

2023-12-03 Thread Gavin Shan
Hi Phil On 12/1/23 20:57, Philippe Mathieu-Daudé wrote: On 29/11/23 05:20, Gavin Shan wrote: It's no sense to check the CPU type when mc->valid_cpu_types[0] is NULL. This case is a programming error, right? We should simply:  assert(!mc->valid_cpu_types || *mc->valid_cpu_types); Yes, ass

Re: [PATCH v8 3/9] machine: Improve is_cpu_type_supported()

2023-12-03 Thread Gavin Shan
Hi Phil, On 12/4/23 09:20, Gavin Shan wrote: On 12/1/23 20:57, Philippe Mathieu-Daudé wrote: On 29/11/23 05:20, Gavin Shan wrote: It's no sense to check the CPU type when mc->valid_cpu_types[0] is NULL. This case is a programming error, right? We should simply:   assert(!mc->valid_cpu_types

[PATCH v3 01/45] Split out common part of BCM283X classes

2023-12-03 Thread Sergey Kambalin
Pre setup for BCM2838 introduction Signed-off-by: Sergey Kambalin --- hw/arm/bcm2836.c | 102 ++- hw/arm/raspi.c | 2 +- include/hw/arm/bcm2836.h | 26 +- 3 files changed, 83 insertions(+), 47 deletions(-) diff --git a/hw/arm/bcm2

[PATCH v3 21/45] Add clock_isp stub

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2838_peripherals.c | 6 ++ include/hw/arm/bcm2838_peripherals.h | 1 + 2 files changed, 7 insertions(+) diff --git a/hw/arm/bcm2838_peripherals.c b/hw/arm/bcm2838_peripherals.c index e9c6d47ba6..65a659c15c 100644 --- a/hw/arm/bcm2838_perip

[PATCH v3 12/45] Temporarily disable unimplemented rpi4b devices

2023-12-03 Thread Sergey Kambalin
This commit adds RPi4B device tree modifications: - disable pcie, rng200, thermal sensor and genet devices (they're going to be re-enabled in the following commits) - create additional memory region in device tree if RAM amount exceeds VC base address. Signed-off-by: Sergey Kambalin --- hw/a

[PATCH v3 43/45] Add missed BCM2835 properties

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/misc/bcm2835_property.c | 47 include/hw/arm/raspberrypi-fw-defs.h | 12 ++- 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/hw/misc/bcm2835_property.c b/hw/misc/bcm2835_property.c index ff55a4e2cd..df

[PATCH v3 33/45] Connect RNG200, PCIE and GENET to GIC

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2838.c | 19 +++ include/hw/arm/bcm2838_peripherals.h | 2 ++ 2 files changed, 21 insertions(+) diff --git a/hw/arm/bcm2838.c b/hw/arm/bcm2838.c index 89cd9d5d8c..83f84b22ad 100644 --- a/hw/arm/bcm2838.c +++ b/hw/a

[PATCH v3 28/45] Implement GENET register ops

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/net/bcm2838_genet.c | 189 +++-- include/hw/net/bcm2838_genet.h | 2 + 2 files changed, 182 insertions(+), 9 deletions(-) diff --git a/hw/net/bcm2838_genet.c b/hw/net/bcm2838_genet.c index be899b68f8..56ff6a6f39 100644 -

[PATCH v3 26/45] Add GENET register structs. Part 4

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- include/hw/net/bcm2838_genet.h | 37 ++ 1 file changed, 37 insertions(+) diff --git a/include/hw/net/bcm2838_genet.h b/include/hw/net/bcm2838_genet.h index 1bd004785a..94c2f3ebca 100644 --- a/include/hw/net/bcm2838_genet.h +++ b/

[PATCH v3 23/45] Add GENET register structs. Part 1

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/net/bcm2838_genet.c | 37 include/hw/net/bcm2838_genet.h | 77 +- 2 files changed, 113 insertions(+), 1 deletion(-) diff --git a/hw/net/bcm2838_genet.c b/hw/net/bcm2838_genet.c index 4420486e00..0d98d1

[PATCH v3 19/45] Get rid of RNG200 timer

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2838_peripherals.c | 14 + hw/arm/raspi4b.c | 1 - hw/misc/bcm2838_rng200.c | 78 include/hw/arm/bcm2838_peripherals.h | 2 + include/hw/misc/bcm2838_rng200.h | 4 +- 5 fil

[PATCH v3 17/45] Add RNG200 skeleton

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/misc/bcm2838_rng200.c | 152 +++ hw/misc/meson.build | 1 + hw/misc/trace-events | 9 ++ include/hw/misc/bcm2838_rng200.h | 51 +++ 4 files changed, 213 insertions(+) create mode 10064

[PATCH v3 36/45] Add mailbox test constants

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- tests/qtest/bcm2838-mailbox.h | 139 ++ 1 file changed, 139 insertions(+) diff --git a/tests/qtest/bcm2838-mailbox.h b/tests/qtest/bcm2838-mailbox.h index 1d02ca9c2c..8acc4bd2ff 100644 --- a/tests/qtest/bcm2838-mailbox.h +++ b/te

[PATCH v3 13/45] Add memory region for BCM2837 RPiVid ASB

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2838_peripherals.c | 3 +++ include/hw/arm/bcm2838_peripherals.h | 3 ++- include/hw/arm/raspi_platform.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/arm/bcm2838_peripherals.c b/hw/arm/bcm2838_peripherals.c inde

[PATCH v3 31/45] Implement GENET RX path

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/net/bcm2838_genet.c | 265 - include/hw/net/bcm2838_genet.h | 1 + 2 files changed, 265 insertions(+), 1 deletion(-) diff --git a/hw/net/bcm2838_genet.c b/hw/net/bcm2838_genet.c index 4c9b39a3ca..61c1981e10 100644 --

[PATCH v3 10/45] Add BCM2838 checkpoint support

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2838_peripherals.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/bcm2838_peripherals.c b/hw/arm/bcm2838_peripherals.c index c147b6e453..196fb890a2 100644 --- a/hw/arm/bcm2838_peripherals.c +++ b/hw/arm/bcm2838_peripherals.c

[PATCH v3 11/45] Introduce Raspberry PI 4 machine

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2835_peripherals.c| 20 +++-- hw/arm/bcm2836.c| 2 + hw/arm/bcm2838.c| 2 + hw/arm/meson.build | 2 +- hw/arm/raspi.c | 28 - hw/arm/raspi4b.c| 72

[PATCH v3 40/45] Add mailbox property tests. Part 1

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- tests/qtest/bcm2838-mailbox.c| 34 ++-- tests/qtest/bcm2838-mailbox.h| 18 +- tests/qtest/bcm2838-mbox-property-test.c | 206 +++ tests/qtest/meson.build | 2 +- 4 files changed, 220 insertions(+),

[PATCH v3 18/45] Add RNG200 RNG and RBG

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/misc/bcm2838_rng200.c | 292 +-- include/hw/misc/bcm2838_rng200.h | 10 +- 2 files changed, 275 insertions(+), 27 deletions(-) diff --git a/hw/misc/bcm2838_rng200.c b/hw/misc/bcm2838_rng200.c index 8f64e6a20f..f91ea0754c

[PATCH v3 24/45] Add GENET register structs. Part 2

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/net/bcm2838_genet.c | 89 ++ include/hw/net/bcm2838_genet.h | 89 ++ 2 files changed, 178 insertions(+) diff --git a/hw/net/bcm2838_genet.c b/hw/net/bcm2838_genet.c index 0d98d1b30e..9a9

[PATCH v3 30/45] Implement GENET TX path

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/net/bcm2838_genet.c | 221 - include/hw/net/bcm2838_genet.h | 17 +++ 2 files changed, 237 insertions(+), 1 deletion(-) diff --git a/hw/net/bcm2838_genet.c b/hw/net/bcm2838_genet.c index 1fae3ecbc2..4c9b39a3ca 100644

[PATCH v3 42/45] Add mailbox property tests. Part 3

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- tests/qtest/bcm2838-mbox-property-test.c | 213 ++- 1 file changed, 212 insertions(+), 1 deletion(-) diff --git a/tests/qtest/bcm2838-mbox-property-test.c b/tests/qtest/bcm2838-mbox-property-test.c index 5322c563a0..1b4a2ed9cb 100644 --- a/

[PATCH v3 20/45] Implement BCM2838 thermal sensor

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2838_peripherals.c | 27 ++-- hw/arm/raspi4b.c | 1 - hw/misc/bcm2838_thermal.c| 98 hw/misc/meson.build | 3 +- include/hw/arm/bcm2838_peripherals.h | 2 + in

[PATCH v3 07/45] Implement BCM2838 GPIO functionality

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/gpio/bcm2838_gpio.c | 192 - 1 file changed, 189 insertions(+), 3 deletions(-) diff --git a/hw/gpio/bcm2838_gpio.c b/hw/gpio/bcm2838_gpio.c index 15b66cb559..51eb55b00a 100644 --- a/hw/gpio/bcm2838_gpio.c +++ b/hw/gpio

[PATCH v3 22/45] Add GENET stub

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/misc/bcm2838_thermal.c | 2 +- hw/net/bcm2838_genet.c | 99 ++ hw/net/meson.build | 2 + hw/net/trace-events| 16 ++ include/hw/net/bcm2838_genet.h | 40 ++ 5 files changed

[PATCH v3 37/45] Add mailbox tests tags. Part 1

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- tests/qtest/bcm2838-mailbox.h | 195 +- 1 file changed, 190 insertions(+), 5 deletions(-) diff --git a/tests/qtest/bcm2838-mailbox.h b/tests/qtest/bcm2838-mailbox.h index 8acc4bd2ff..04472fe23d 100644 --- a/tests/qtest/bcm2838-ma

[PATCH v3 08/45] Connect SD controller to BCM2838 GPIO

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/gpio/bcm2838_gpio.c | 59 +++--- include/hw/gpio/bcm2838_gpio.h | 5 +++ 2 files changed, 60 insertions(+), 4 deletions(-) diff --git a/hw/gpio/bcm2838_gpio.c b/hw/gpio/bcm2838_gpio.c index 51eb55b00a..f166ce7959 100644 -

[PATCH v3 27/45] Add GENET register access macros

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- include/hw/net/bcm2838_genet.h | 76 ++ 1 file changed, 76 insertions(+) diff --git a/include/hw/net/bcm2838_genet.h b/include/hw/net/bcm2838_genet.h index 94c2f3ebca..e7a76cda81 100644 --- a/include/hw/net/bcm2838_genet.h +++ b/

[PATCH v3 25/45] Add GENET register structs. Part 3

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/net/bcm2838_genet.c | 88 ++ include/hw/net/bcm2838_genet.h | 88 ++ 2 files changed, 176 insertions(+) diff --git a/hw/net/bcm2838_genet.c b/hw/net/bcm2838_genet.c index 9a99f34c4a..be8

[PATCH v3 41/45] Add mailbox property tests. Part 2

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- tests/qtest/bcm2838-mbox-property-test.c | 196 ++- 1 file changed, 195 insertions(+), 1 deletion(-) diff --git a/tests/qtest/bcm2838-mbox-property-test.c b/tests/qtest/bcm2838-mbox-property-test.c index 80746dbb95..5322c563a0 100644 --- a/

[PATCH v3 14/45] Add BCM2838 PCIE Root Complex

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2838_pcie.c | 74 +++ hw/arm/meson.build| 5 ++- hw/arm/trace-events | 4 ++ include/hw/arm/bcm2838_pcie.h | 53 + 4 files changed, 135 insertions(+), 1 deletion(-)

[PATCH v3 34/45] Add Rpi4b boot tests

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- tests/avocado/boot_linux_console.py | 92 + 1 file changed, 92 insertions(+) diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py index 6eab515718..62aac02bbb 100644 --- a/tests/avocado/boot_linux_c

[PATCH v3 05/45] Add GIC-400 to BCM2838 SoC

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2838.c | 167 +++ hw/arm/trace-events | 2 + include/hw/arm/bcm2838.h | 2 + include/hw/arm/bcm2838_peripherals.h | 39 +++ 4 files changed, 210 insertions(+) diff --git

[PATCH v3 15/45] Add BCM2838 PCIE host

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2838_pcie.c | 216 +- include/hw/arm/bcm2838_pcie.h | 22 2 files changed, 236 insertions(+), 2 deletions(-) diff --git a/hw/arm/bcm2838_pcie.c b/hw/arm/bcm2838_pcie.c index 3b4373c6a6..75146d6c2e 100644 -

[PATCH v3 06/45] Add BCM2838 GPIO stub

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2838.c | 4 +- hw/gpio/bcm2838_gpio.c | 152 +++ hw/gpio/meson.build | 5 +- include/hw/arm/bcm2838_peripherals.h | 2 - include/hw/gpio/bcm2838_gpio.h | 40 +++

[PATCH v3 00/45] Raspberry Pi 4B machine

2023-12-03 Thread Sergey Kambalin
Introducing Raspberry Pi 4B model. It contains new BCM2838 SoC, PCIE subsystem, RNG200, Thermal sensor and Genet network controller. It can work with recent linux kernels 6.x.x. Two avocado tests was added to check that. Unit tests has been made as read/write operations via mailbox properties. G

[PATCH v3 09/45] Add GPIO and SD to BCM2838 periph

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2838_peripherals.c | 140 +++ include/hw/arm/bcm2838_peripherals.h | 9 ++ 2 files changed, 149 insertions(+) diff --git a/hw/arm/bcm2838_peripherals.c b/hw/arm/bcm2838_peripherals.c index 06110c724f..c147b6e453 10064

[PATCH v3 04/45] Introduce BCM2838 SoC

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2838.c | 100 +++ hw/arm/bcm2838_peripherals.c | 72 +++ hw/arm/meson.build | 2 + include/hw/arm/bcm2838.h | 29 include/hw/arm/bcm2838_peri

[PATCH v3 39/45] Add mailbox tests tags. Part 3

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- tests/qtest/bcm2838-mailbox.h | 78 +++ 1 file changed, 78 insertions(+) diff --git a/tests/qtest/bcm2838-mailbox.h b/tests/qtest/bcm2838-mailbox.h index 49668668da..2b140a5d32 100644 --- a/tests/qtest/bcm2838-mailbox.h +++ b/tes

[PATCH v3 38/45] Add mailbox tests tags. Part 2

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- tests/qtest/bcm2838-mailbox.h | 152 ++ 1 file changed, 152 insertions(+) diff --git a/tests/qtest/bcm2838-mailbox.h b/tests/qtest/bcm2838-mailbox.h index 04472fe23d..49668668da 100644 --- a/tests/qtest/bcm2838-mailbox.h +++ b/te

[PATCH v3 35/45] Add mailbox test stub

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- include/hw/arm/bcm2838_peripherals.h | 2 + tests/qtest/bcm2838-mailbox.c| 71 tests/qtest/bcm2838-mailbox.h| 46 ++ tests/qtest/meson.build | 1 + 4 files changed, 120 insertions(+) cr

[PATCH v3 44/45] Append added properties to mailbox test

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- tests/qtest/bcm2838-mbox-property-test.c | 22 -- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/tests/qtest/bcm2838-mbox-property-test.c b/tests/qtest/bcm2838-mbox-property-test.c index 1b4a2ed9cb..3a2e7f9194 100644 --- a/te

[PATCH v3 03/45] Split out raspi machine common part

2023-12-03 Thread Sergey Kambalin
Pre-setup for raspberry pi 4 introduction Signed-off-by: Sergey Kambalin --- hw/arm/raspi.c | 112 ++-- include/hw/arm/raspi_platform.h | 21 ++ 2 files changed, 85 insertions(+), 48 deletions(-) diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c inde

[PATCH v3 02/45] Split out common part of peripherals

2023-12-03 Thread Sergey Kambalin
Pre-setup for BCM2838 introduction Signed-off-by: Sergey Kambalin --- hw/arm/bcm2835_peripherals.c | 198 +++ hw/arm/bcm2836.c | 24 ++-- include/hw/arm/bcm2835_peripherals.h | 29 +++- include/hw/arm/bcm2836.h | 3 +- 4 files c

[PATCH v3 29/45] Implement GENET MDIO

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/net/bcm2838_genet.c | 126 - include/hw/net/bcm2838_genet.h | 3 +- 2 files changed, 126 insertions(+), 3 deletions(-) diff --git a/hw/net/bcm2838_genet.c b/hw/net/bcm2838_genet.c index 56ff6a6f39..1fae3ecbc2 100644

[PATCH v3 32/45] Enable BCM2838 GENET controller

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2838_peripherals.c | 16 hw/arm/raspi4b.c | 17 - include/hw/arm/bcm2838_peripherals.h | 2 ++ 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/hw/arm/bcm2838_peripherals.c b

[PATCH v3 16/45] Enable BCM2838 PCIE

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2838_pcie.c| 3 +++ hw/arm/bcm2838_peripherals.c | 26 ++ hw/arm/meson.build | 7 --- hw/arm/raspi4b.c | 1 - include/hw/arm/bcm2838_peripherals.h | 3 +++ 5

[PATCH v3 11/45] Introduce Raspberry PI 4 machine

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2835_peripherals.c| 20 +++-- hw/arm/bcm2836.c| 2 + hw/arm/bcm2838.c| 2 + hw/arm/meson.build | 2 +- hw/arm/raspi.c | 28 - hw/arm/raspi4b.c| 72

[PATCH v3 05/45] Add GIC-400 to BCM2838 SoC

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2838.c | 167 +++ hw/arm/trace-events | 2 + include/hw/arm/bcm2838.h | 2 + include/hw/arm/bcm2838_peripherals.h | 39 +++ 4 files changed, 210 insertions(+) diff --git

[PATCH v3 16/45] Enable BCM2838 PCIE

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2838_pcie.c| 3 +++ hw/arm/bcm2838_peripherals.c | 26 ++ hw/arm/meson.build | 7 --- hw/arm/raspi4b.c | 1 - include/hw/arm/bcm2838_peripherals.h | 3 +++ 5

[PATCH v3 24/45] Add GENET register structs. Part 2

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/net/bcm2838_genet.c | 89 ++ include/hw/net/bcm2838_genet.h | 89 ++ 2 files changed, 178 insertions(+) diff --git a/hw/net/bcm2838_genet.c b/hw/net/bcm2838_genet.c index 0d98d1b30e..9a9

[PATCH v3 43/45] Add missed BCM2835 properties

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/misc/bcm2835_property.c | 47 include/hw/arm/raspberrypi-fw-defs.h | 12 ++- 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/hw/misc/bcm2835_property.c b/hw/misc/bcm2835_property.c index ff55a4e2cd..df

[PATCH v3 31/45] Implement GENET RX path

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/net/bcm2838_genet.c | 265 - include/hw/net/bcm2838_genet.h | 1 + 2 files changed, 265 insertions(+), 1 deletion(-) diff --git a/hw/net/bcm2838_genet.c b/hw/net/bcm2838_genet.c index 4c9b39a3ca..61c1981e10 100644 --

[PATCH v3 33/45] Connect RNG200, PCIE and GENET to GIC

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2838.c | 19 +++ include/hw/arm/bcm2838_peripherals.h | 2 ++ 2 files changed, 21 insertions(+) diff --git a/hw/arm/bcm2838.c b/hw/arm/bcm2838.c index 89cd9d5d8c..83f84b22ad 100644 --- a/hw/arm/bcm2838.c +++ b/hw/a

[PATCH v3 25/45] Add GENET register structs. Part 3

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/net/bcm2838_genet.c | 88 ++ include/hw/net/bcm2838_genet.h | 88 ++ 2 files changed, 176 insertions(+) diff --git a/hw/net/bcm2838_genet.c b/hw/net/bcm2838_genet.c index 9a99f34c4a..be8

[PATCH v3 07/45] Implement BCM2838 GPIO functionality

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/gpio/bcm2838_gpio.c | 192 - 1 file changed, 189 insertions(+), 3 deletions(-) diff --git a/hw/gpio/bcm2838_gpio.c b/hw/gpio/bcm2838_gpio.c index 15b66cb559..51eb55b00a 100644 --- a/hw/gpio/bcm2838_gpio.c +++ b/hw/gpio

[PATCH v3 22/45] Add GENET stub

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/misc/bcm2838_thermal.c | 2 +- hw/net/bcm2838_genet.c | 99 ++ hw/net/meson.build | 2 + hw/net/trace-events| 16 ++ include/hw/net/bcm2838_genet.h | 40 ++ 5 files changed

[PATCH v3 08/45] Connect SD controller to BCM2838 GPIO

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/gpio/bcm2838_gpio.c | 59 +++--- include/hw/gpio/bcm2838_gpio.h | 5 +++ 2 files changed, 60 insertions(+), 4 deletions(-) diff --git a/hw/gpio/bcm2838_gpio.c b/hw/gpio/bcm2838_gpio.c index 51eb55b00a..f166ce7959 100644 -

[PATCH v3 15/45] Add BCM2838 PCIE host

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2838_pcie.c | 216 +- include/hw/arm/bcm2838_pcie.h | 22 2 files changed, 236 insertions(+), 2 deletions(-) diff --git a/hw/arm/bcm2838_pcie.c b/hw/arm/bcm2838_pcie.c index 3b4373c6a6..75146d6c2e 100644 -

[PATCH v3 37/45] Add mailbox tests tags. Part 1

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- tests/qtest/bcm2838-mailbox.h | 195 +- 1 file changed, 190 insertions(+), 5 deletions(-) diff --git a/tests/qtest/bcm2838-mailbox.h b/tests/qtest/bcm2838-mailbox.h index 8acc4bd2ff..04472fe23d 100644 --- a/tests/qtest/bcm2838-ma

[PATCH v3 14/45] Add BCM2838 PCIE Root Complex

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2838_pcie.c | 74 +++ hw/arm/meson.build| 5 ++- hw/arm/trace-events | 4 ++ include/hw/arm/bcm2838_pcie.h | 53 + 4 files changed, 135 insertions(+), 1 deletion(-)

[PATCH v3 13/45] Add memory region for BCM2837 RPiVid ASB

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2838_peripherals.c | 3 +++ include/hw/arm/bcm2838_peripherals.h | 3 ++- include/hw/arm/raspi_platform.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/arm/bcm2838_peripherals.c b/hw/arm/bcm2838_peripherals.c inde

[PATCH v3 03/45] Split out raspi machine common part

2023-12-03 Thread Sergey Kambalin
Pre-setup for raspberry pi 4 introduction Signed-off-by: Sergey Kambalin --- hw/arm/raspi.c | 112 ++-- include/hw/arm/raspi_platform.h | 21 ++ 2 files changed, 85 insertions(+), 48 deletions(-) diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c inde

[PATCH v3 02/45] Split out common part of peripherals

2023-12-03 Thread Sergey Kambalin
Pre-setup for BCM2838 introduction Signed-off-by: Sergey Kambalin --- hw/arm/bcm2835_peripherals.c | 198 +++ hw/arm/bcm2836.c | 24 ++-- include/hw/arm/bcm2835_peripherals.h | 29 +++- include/hw/arm/bcm2836.h | 3 +- 4 files c

[PATCH v3 34/45] Add Rpi4b boot tests

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- tests/avocado/boot_linux_console.py | 92 + 1 file changed, 92 insertions(+) diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py index 6eab515718..62aac02bbb 100644 --- a/tests/avocado/boot_linux_c

[PATCH v3 12/45] Temporarily disable unimplemented rpi4b devices

2023-12-03 Thread Sergey Kambalin
This commit adds RPi4B device tree modifications: - disable pcie, rng200, thermal sensor and genet devices (they're going to be re-enabled in the following commits) - create additional memory region in device tree if RAM amount exceeds VC base address. Signed-off-by: Sergey Kambalin --- hw/a

[PATCH v3 19/45] Get rid of RNG200 timer

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2838_peripherals.c | 14 + hw/arm/raspi4b.c | 1 - hw/misc/bcm2838_rng200.c | 78 include/hw/arm/bcm2838_peripherals.h | 2 + include/hw/misc/bcm2838_rng200.h | 4 +- 5 fil

[PATCH v3 45/45] Add RPi4B to paspi4.rst

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- docs/system/arm/raspi.rst | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/system/arm/raspi.rst b/docs/system/arm/raspi.rst index 922fe375a6..db9e0949ef 100644 --- a/docs/system/arm/raspi.rst +++ b/docs/system/arm/raspi.rst @@

[PATCH v3 40/45] Add mailbox property tests. Part 1

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- tests/qtest/bcm2838-mailbox.c| 34 ++-- tests/qtest/bcm2838-mailbox.h| 18 +- tests/qtest/bcm2838-mbox-property-test.c | 206 +++ tests/qtest/meson.build | 2 +- 4 files changed, 220 insertions(+),

[PATCH v3 44/45] Append added properties to mailbox test

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- tests/qtest/bcm2838-mbox-property-test.c | 22 -- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/tests/qtest/bcm2838-mbox-property-test.c b/tests/qtest/bcm2838-mbox-property-test.c index 1b4a2ed9cb..3a2e7f9194 100644 --- a/te

[PATCH v3 00/45] Raspberry Pi 4B machine

2023-12-03 Thread Sergey Kambalin
Introducing Raspberry Pi 4B model. It contains new BCM2838 SoC, PCIE subsystem, RNG200, Thermal sensor and Genet network controller. It can work with recent linux kernels 6.x.x. Two avocado tests was added to check that. Unit tests has been made as read/write operations via mailbox properties. G

[PATCH v3 30/45] Implement GENET TX path

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/net/bcm2838_genet.c | 221 - include/hw/net/bcm2838_genet.h | 17 +++ 2 files changed, 237 insertions(+), 1 deletion(-) diff --git a/hw/net/bcm2838_genet.c b/hw/net/bcm2838_genet.c index 1fae3ecbc2..4c9b39a3ca 100644

[PATCH v3 17/45] Add RNG200 skeleton

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/misc/bcm2838_rng200.c | 152 +++ hw/misc/meson.build | 1 + hw/misc/trace-events | 9 ++ include/hw/misc/bcm2838_rng200.h | 51 +++ 4 files changed, 213 insertions(+) create mode 10064

[PATCH v3 04/45] Introduce BCM2838 SoC

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2838.c | 100 +++ hw/arm/bcm2838_peripherals.c | 72 +++ hw/arm/meson.build | 2 + include/hw/arm/bcm2838.h | 29 include/hw/arm/bcm2838_peri

[PATCH v3 38/45] Add mailbox tests tags. Part 2

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- tests/qtest/bcm2838-mailbox.h | 152 ++ 1 file changed, 152 insertions(+) diff --git a/tests/qtest/bcm2838-mailbox.h b/tests/qtest/bcm2838-mailbox.h index 04472fe23d..49668668da 100644 --- a/tests/qtest/bcm2838-mailbox.h +++ b/te

[PATCH v3 01/45] Split out common part of BCM283X classes

2023-12-03 Thread Sergey Kambalin
Pre setup for BCM2838 introduction Signed-off-by: Sergey Kambalin --- hw/arm/bcm2836.c | 102 ++- hw/arm/raspi.c | 2 +- include/hw/arm/bcm2836.h | 26 +- 3 files changed, 83 insertions(+), 47 deletions(-) diff --git a/hw/arm/bcm2

[PATCH v3 41/45] Add mailbox property tests. Part 2

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- tests/qtest/bcm2838-mbox-property-test.c | 196 ++- 1 file changed, 195 insertions(+), 1 deletion(-) diff --git a/tests/qtest/bcm2838-mbox-property-test.c b/tests/qtest/bcm2838-mbox-property-test.c index 80746dbb95..5322c563a0 100644 --- a/

[PATCH v3 36/45] Add mailbox test constants

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- tests/qtest/bcm2838-mailbox.h | 139 ++ 1 file changed, 139 insertions(+) diff --git a/tests/qtest/bcm2838-mailbox.h b/tests/qtest/bcm2838-mailbox.h index 1d02ca9c2c..8acc4bd2ff 100644 --- a/tests/qtest/bcm2838-mailbox.h +++ b/te

[PATCH v3 10/45] Add BCM2838 checkpoint support

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2838_peripherals.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/bcm2838_peripherals.c b/hw/arm/bcm2838_peripherals.c index c147b6e453..196fb890a2 100644 --- a/hw/arm/bcm2838_peripherals.c +++ b/hw/arm/bcm2838_peripherals.c

[PATCH v3 28/45] Implement GENET register ops

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/net/bcm2838_genet.c | 189 +++-- include/hw/net/bcm2838_genet.h | 2 + 2 files changed, 182 insertions(+), 9 deletions(-) diff --git a/hw/net/bcm2838_genet.c b/hw/net/bcm2838_genet.c index be899b68f8..56ff6a6f39 100644 -

[PATCH v3 29/45] Implement GENET MDIO

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/net/bcm2838_genet.c | 126 - include/hw/net/bcm2838_genet.h | 3 +- 2 files changed, 126 insertions(+), 3 deletions(-) diff --git a/hw/net/bcm2838_genet.c b/hw/net/bcm2838_genet.c index 56ff6a6f39..1fae3ecbc2 100644

[PATCH v3 18/45] Add RNG200 RNG and RBG

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/misc/bcm2838_rng200.c | 292 +-- include/hw/misc/bcm2838_rng200.h | 10 +- 2 files changed, 275 insertions(+), 27 deletions(-) diff --git a/hw/misc/bcm2838_rng200.c b/hw/misc/bcm2838_rng200.c index 8f64e6a20f..f91ea0754c

[PATCH v3 27/45] Add GENET register access macros

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- include/hw/net/bcm2838_genet.h | 76 ++ 1 file changed, 76 insertions(+) diff --git a/include/hw/net/bcm2838_genet.h b/include/hw/net/bcm2838_genet.h index 94c2f3ebca..e7a76cda81 100644 --- a/include/hw/net/bcm2838_genet.h +++ b/

[PATCH v3 39/45] Add mailbox tests tags. Part 3

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- tests/qtest/bcm2838-mailbox.h | 78 +++ 1 file changed, 78 insertions(+) diff --git a/tests/qtest/bcm2838-mailbox.h b/tests/qtest/bcm2838-mailbox.h index 49668668da..2b140a5d32 100644 --- a/tests/qtest/bcm2838-mailbox.h +++ b/tes

[PATCH v3 42/45] Add mailbox property tests. Part 3

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- tests/qtest/bcm2838-mbox-property-test.c | 213 ++- 1 file changed, 212 insertions(+), 1 deletion(-) diff --git a/tests/qtest/bcm2838-mbox-property-test.c b/tests/qtest/bcm2838-mbox-property-test.c index 5322c563a0..1b4a2ed9cb 100644 --- a/

[PATCH v3 35/45] Add mailbox test stub

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- include/hw/arm/bcm2838_peripherals.h | 2 + tests/qtest/bcm2838-mailbox.c| 71 tests/qtest/bcm2838-mailbox.h| 46 ++ tests/qtest/meson.build | 1 + 4 files changed, 120 insertions(+) cr

[PATCH v3 32/45] Enable BCM2838 GENET controller

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2838_peripherals.c | 16 hw/arm/raspi4b.c | 17 - include/hw/arm/bcm2838_peripherals.h | 2 ++ 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/hw/arm/bcm2838_peripherals.c b

[PATCH v3 23/45] Add GENET register structs. Part 1

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/net/bcm2838_genet.c | 37 include/hw/net/bcm2838_genet.h | 77 +- 2 files changed, 113 insertions(+), 1 deletion(-) diff --git a/hw/net/bcm2838_genet.c b/hw/net/bcm2838_genet.c index 4420486e00..0d98d1

[PATCH v3 09/45] Add GPIO and SD to BCM2838 periph

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2838_peripherals.c | 140 +++ include/hw/arm/bcm2838_peripherals.h | 9 ++ 2 files changed, 149 insertions(+) diff --git a/hw/arm/bcm2838_peripherals.c b/hw/arm/bcm2838_peripherals.c index 06110c724f..c147b6e453 10064

[PATCH v3 21/45] Add clock_isp stub

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2838_peripherals.c | 6 ++ include/hw/arm/bcm2838_peripherals.h | 1 + 2 files changed, 7 insertions(+) diff --git a/hw/arm/bcm2838_peripherals.c b/hw/arm/bcm2838_peripherals.c index e9c6d47ba6..65a659c15c 100644 --- a/hw/arm/bcm2838_perip

[PATCH v3 06/45] Add BCM2838 GPIO stub

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2838.c | 4 +- hw/gpio/bcm2838_gpio.c | 152 +++ hw/gpio/meson.build | 5 +- include/hw/arm/bcm2838_peripherals.h | 2 - include/hw/gpio/bcm2838_gpio.h | 40 +++

[PATCH v3 26/45] Add GENET register structs. Part 4

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- include/hw/net/bcm2838_genet.h | 37 ++ 1 file changed, 37 insertions(+) diff --git a/include/hw/net/bcm2838_genet.h b/include/hw/net/bcm2838_genet.h index 1bd004785a..94c2f3ebca 100644 --- a/include/hw/net/bcm2838_genet.h +++ b/

[PATCH v3 20/45] Implement BCM2838 thermal sensor

2023-12-03 Thread Sergey Kambalin
Signed-off-by: Sergey Kambalin --- hw/arm/bcm2838_peripherals.c | 27 ++-- hw/arm/raspi4b.c | 1 - hw/misc/bcm2838_thermal.c| 98 hw/misc/meson.build | 3 +- include/hw/arm/bcm2838_peripherals.h | 2 + in

[PATCH v9 1/9] machine: Use error handling when CPU type is checked

2023-12-03 Thread Gavin Shan
Functions that use an Error **errp parameter to return errors should not also report them to the user, because reporting is the caller's job. The principle is violated by machine_run_board_init() because it calls error_report(), error_printf(), and exit(1) when the machine doesn't support the reque

[PATCH v9 0/9] Unified CPU type check

2023-12-03 Thread Gavin Shan
This series bases on Phil's repository because the prepatory commits have been queued to the branch. https://gitlab.com/philmd/qemu.git (branch: cpus-next) There are two places where the user specified CPU type is checked to see if it's supported or allowed by the board: machine_run_board_init(

[PATCH v9 5/9] hw/arm/virt: Hide host CPU model for tcg

2023-12-03 Thread Gavin Shan
The 'host' CPU model isn't available until KVM or HVF is enabled. For example, the following error messages are seen when the guest is started with option '-cpu cortex-a8' on tcg after the next commit is applied to check the CPU type in machine_run_board_init(). ERROR:../hw/core/machine.c:1423:i

[PATCH v9 8/9] hw/arm: Check CPU type in machine_run_board_init()

2023-12-03 Thread Gavin Shan
Set mc->valid_cpu_types so that the user specified CPU type can be validated in machine_run_board_init(). We needn't to do it by ourselves. Signed-off-by: Gavin Shan Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- hw/arm/bananapi_m2u.c | 12 ++-- hw/arm/cubiebo

[PATCH v9 2/9] machine: Introduce helper is_cpu_type_supported()

2023-12-03 Thread Gavin Shan
The logic, to check if the specified CPU type is supported in machine_run_board_init(), is independent enough. Factor it out into helper is_cpu_type_supported(). machine_run_board_init() looks a bit clean with this. Since we're here, @machine_class is renamed to @mc to avoid multiple line spanning

[PATCH v9 9/9] hw/riscv/shakti_c: Check CPU type in machine_run_board_init()

2023-12-03 Thread Gavin Shan
Set mc->valid_cpu_types so that the user specified CPU type can be validated in machine_run_board_init(). We needn't to do it by ourselves. Signed-off-by: Gavin Shan Reviewed-by: Philippe Mathieu-Daudé --- hw/riscv/shakti_c.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-)

[PATCH v9 7/9] hw/arm/sbsa-ref: Check CPU type in machine_run_board_init()

2023-12-03 Thread Gavin Shan
Set mc->valid_cpu_types so that the user specified CPU type can be validated in machine_run_board_init(). We needn't to do it by ourselves. Signed-off-by: Gavin Shan Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Leif Lindholm Reviewed-by: Richard Henderson --- hw/arm/sbsa-ref.c | 36 ++

<    1   2   3   >