From patchwork Fri Apr 1 03:46:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jamin Lin X-Patchwork-Id: 1612037 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KV5jr3dvhz9sVB for ; Fri, 1 Apr 2022 14:48:14 +1100 (AEDT) Received: from localhost ([::1]:54754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1na8Gh-0001Hu-1p for incoming@patchwork.ozlabs.org; Thu, 31 Mar 2022 23:48:11 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35636) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1na8GE-0001HK-84; Thu, 31 Mar 2022 23:47:42 -0400 Received: from twspam01.aspeedtech.com ([211.20.114.71]:22609) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1na8GA-0000nR-Hc; Thu, 31 Mar 2022 23:47:41 -0400 Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 2313Zp6U095942; Fri, 1 Apr 2022 11:35:51 +0800 (GMT-8) (envelope-from jamin_lin@aspeedtech.com) Received: from localhost.localdomain (192.168.70.87) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 1 Apr 2022 11:46:52 +0800 From: Jamin Lin To: Alistair Francis , Peter Maydell , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Andrew Jeffery , Joel Stanley , Cleber Rosa , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Wainer dos Santos Moschetta" , Beraldo Leal , "open list:STM32F205" , "open list:All patches CC here" Subject: [PATCH v4 0/9] Add support for AST1030 SoC Date: Fri, 1 Apr 2022 11:46:42 +0800 Message-ID: <20220401034651.9066-1-jamin_lin@aspeedtech.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [192.168.70.87] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 2313Zp6U095942 Received-SPF: pass client-ip=211.20.114.71; envelope-from=jamin_lin@aspeedtech.com; helo=twspam01.aspeedtech.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jamin_lin@aspeedtech.com, troy_lee@aspeedtech.com, steven_lee@aspeedtech.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Changes from v4: - drop the ASPEED_SMC_FEATURE_WDT_CONTROL flag in hw/ssi/aspeed_smc.c Changes from v3: - remove AspeedMiniBmcMachineState state structure and AspeedMiniBmcMachineClass class - remove redundant new line in hw/arm/aspeed_ast10xx.c - drop the ASPEED_SMC_FEATURE_WDT_CONTROL flag in hw/ssi/aspeed_smc.c Changes from v2: - replace aspeed_ast1030.c with aspeed_ast10xx.c for minibmc SOCs family support - Add "ast1030-evb" machine in aspeed.c and removes aspeed_minibmc.c Changes from v1: The patch series supports ADC, SCU, SMC, TIMER, and WDT for AST1030 SoC. Add avocado test case for "ast1030-evb" machine. Test steps: 1. Download image from https://github.com/AspeedTech-BMC/zephyr/releases/download/v00.01.04/ast1030-evb-demo.zip 2. Extract the zip file to obtain zephyr.elf 3. Run ./qemu-system-arm -M ast1030-evb -kernel $PATH/zephyr.elf -nographic 4. Test IO by Zephyr command line, commands are refer to Aspeed Zephyr SDK User Guide below https://github.com/AspeedTech-BMC/zephyr/releases/download/v00.01.04/Aspeed_Zephy_SDK_User_Guide_v00.01.04.pdf - ADC(channel 0): uart:~$ adc ADC0 resolution 10 uart:~$ adc ADC0 calibrate 1 uart:~$ adc ADC0 read_format 1 uart:~$ adc ADC0 read 0 [Result] read: 1416mv - SCU uart:~$ md 7e6e2040 uart:~$ md 7e6e2080 uart:~$ md 7e6e20d0 uart:~$ md 7e6e2200 uart:~$ md 7e6e2300 uart:~$ md 7e6e25b0 [Result] The register value should match the value of ast1030_a1_resets in aspeed_scu.c - Flash(fmc_cs0): uart:~$ flash write fmc_cs0 0 0x12345678 0x87654321 0x34127856 0x78563412 uart:~$ flash read fmc_cs0 0 10 [Result] 00000000: 78 56 34 12 21 43 65 87 56 78 12 34 12 34 56 78 |xV4.!Ce. Vx.4.4Vx| uart:~$ flash erase fmc_cs0 0 uart:~$ flash read fmc_cs0 0 10 [Result] 00000000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |........ ........| - Timer(TIMER0): uart:~$ timer start TIMER0 -p 2000 -t 0 TIMER0: period 20000 ms, type 0 [Result] timer expired after 2 seconds - Watchdog(WDT1): uart:~$ mw 7e785008 4755 uart:~$ mw 7e78500c 1 [Result] soc reset after 22 seconds Based-on: 20220315075753.8591-3-steven_lee@aspeedtech.com ([v2,2/2] hw: aspeed_scu: Introduce clkin_25Mhz attribute) Jamin Lin (2): aspeed: Add an AST1030 eval board test/avocado/machine_aspeed.py: Add ast1030 test case Steven Lee (7): aspeed/adc: Add AST1030 support aspeed/smc: Add AST1030 support aspeed/wdt: Fix ast2500/ast2600 default reload value. aspeed/wdt: Add AST1030 support aspeed/timer: Add AST1030 support aspeed/scu: Add AST1030 support aspeed/soc : Add AST1030 support hw/adc/aspeed_adc.c | 16 ++ hw/arm/aspeed.c | 97 ++++++++++ hw/arm/aspeed_ast10xx.c | 299 +++++++++++++++++++++++++++++++ hw/arm/meson.build | 6 +- hw/misc/aspeed_scu.c | 63 +++++++ hw/ssi/aspeed_smc.c | 157 ++++++++++++++++ hw/timer/aspeed_timer.c | 17 ++ hw/watchdog/wdt_aspeed.c | 34 +++- include/hw/adc/aspeed_adc.h | 1 + include/hw/arm/aspeed.h | 6 +- include/hw/arm/aspeed_soc.h | 3 + include/hw/misc/aspeed_scu.h | 25 +++ include/hw/timer/aspeed_timer.h | 1 + include/hw/watchdog/wdt_aspeed.h | 3 + tests/avocado/machine_aspeed.py | 36 ++++ 15 files changed, 758 insertions(+), 6 deletions(-) create mode 100644 hw/arm/aspeed_ast10xx.c create mode 100644 tests/avocado/machine_aspeed.py