From patchwork Mon Aug 3 09:36:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ChiaWei Wang X-Patchwork-Id: 1340279 X-Patchwork-Delegate: trini@ti.com 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=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aspeedtech.com Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BKwyx5wFhz9sTd for ; Mon, 3 Aug 2020 21:44:25 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 555E58216F; Mon, 3 Aug 2020 13:44:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=aspeedtech.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 9CB3D81E3C; Mon, 3 Aug 2020 11:36:32 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E651F81D71 for ; Mon, 3 Aug 2020 11:36:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=aspeedtech.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=chiawei_wang@aspeedtech.com Received: from mail.aspeedtech.com (twmbx02.aspeed.com [192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 0739KT4r029424; Mon, 3 Aug 2020 17:20:29 +0800 (GMT-8) (envelope-from chiawei_wang@aspeedtech.com) Received: from ChiaWeiWang-PC.aspeed.com (192.168.100.253) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.620.29; Mon, 3 Aug 2020 17:36:17 +0800 From: "Chia-Wei, Wang" To: , CC: , Subject: [PATCH 1/6] MAINTAINERS: Add maintainers for Aspeed SoCs Date: Mon, 3 Aug 2020 17:36:05 +0800 Message-ID: <20200803093610.3222-2-chiawei_wang@aspeedtech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200803093610.3222-1-chiawei_wang@aspeedtech.com> References: <20200803093610.3222-1-chiawei_wang@aspeedtech.com> MIME-Version: 1.0 X-Originating-IP: [192.168.100.253] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 0739KT4r029424 X-Mailman-Approved-At: Mon, 03 Aug 2020 13:43:53 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Update maintainers for Aspeed SoC platforms. Signed-off-by: Chia-Wei, Wang --- MAINTAINERS | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 889a73f15f..163f571f65 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -148,6 +148,18 @@ F: include/configs/meson64_android.h F: doc/board/amlogic/ N: meson +ARM ASPEED +M: Ryan Chen +M: Chia-Wei Wang +R: Aspeed BMC SW team +S: Maintained +F: arch/arm/mach-aspeed/ +F: arch/arm/include/asm/arch-aspeed/ +F: board/aspeed/ +F: drivers/clk/aspeed/ +F: drivers/pinctrl/aspeed/ +N: aspeed + ARM BROADCOM BCM283X M: Matthias Brugger S: Maintained From patchwork Mon Aug 3 09:36:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ChiaWei Wang X-Patchwork-Id: 1340280 X-Patchwork-Delegate: trini@ti.com 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=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aspeedtech.com Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BKwz86pdKz9sTd for ; Mon, 3 Aug 2020 21:44:36 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 174BE82190; Mon, 3 Aug 2020 13:44:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=aspeedtech.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 44E6381E3C; Mon, 3 Aug 2020 11:36:37 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B122681BD7 for ; Mon, 3 Aug 2020 11:36:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=aspeedtech.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=chiawei_wang@aspeedtech.com Received: from mail.aspeedtech.com (twmbx02.aspeed.com [192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 0739KU1I029425; Mon, 3 Aug 2020 17:20:30 +0800 (GMT-8) (envelope-from chiawei_wang@aspeedtech.com) Received: from ChiaWeiWang-PC.aspeed.com (192.168.100.253) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.620.29; Mon, 3 Aug 2020 17:36:17 +0800 From: "Chia-Wei, Wang" To: , CC: , Subject: [PATCH 2/6] aspeed: ast2500: Add lowlevel_init assembly Date: Mon, 3 Aug 2020 17:36:06 +0800 Message-ID: <20200803093610.3222-3-chiawei_wang@aspeedtech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200803093610.3222-1-chiawei_wang@aspeedtech.com> References: <20200803093610.3222-1-chiawei_wang@aspeedtech.com> MIME-Version: 1.0 X-Originating-IP: [192.168.100.253] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 0739KU1I029425 X-Mailman-Approved-At: Mon, 03 Aug 2020 13:43:53 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean The original lowlevel_init function of AST2500 is written in C. However, the C runtime environment is not ready until _main execution. This patch adds the assembly version of the lowlevel_init function. Additional initialization to DRAM configuration and LPC reset source are also added. Signed-off-by: Chia-Wei, Wang --- arch/arm/mach-aspeed/ast2500-board.c | 25 ------------ arch/arm/mach-aspeed/ast2500/Makefile | 1 + arch/arm/mach-aspeed/ast2500/lowlevel_init.S | 41 ++++++++++++++++++++ 3 files changed, 42 insertions(+), 25 deletions(-) create mode 100644 arch/arm/mach-aspeed/ast2500/lowlevel_init.S diff --git a/arch/arm/mach-aspeed/ast2500-board.c b/arch/arm/mach-aspeed/ast2500-board.c index f74dcbbb62..3482ee91ef 100644 --- a/arch/arm/mach-aspeed/ast2500-board.c +++ b/arch/arm/mach-aspeed/ast2500-board.c @@ -28,31 +28,6 @@ DECLARE_GLOBAL_DATA_PTR; -void lowlevel_init(void) -{ - /* - * These two watchdogs need to be stopped as soon as possible, - * otherwise the board might hang. By default they are set to - * a very short timeout and even simple debug write to serial - * console early in the init process might cause them to fire. - */ - struct ast_wdt *flash_addr_wdt = - (struct ast_wdt *)(WDT_BASE + - sizeof(struct ast_wdt) * - AST_FLASH_ADDR_DETECT_WDT); - - clrbits_le32(&flash_addr_wdt->ctrl, WDT_CTRL_EN); - -#ifndef CONFIG_FIRMWARE_2ND_BOOT - struct ast_wdt *sec_boot_wdt = - (struct ast_wdt *)(WDT_BASE + - sizeof(struct ast_wdt) * - AST_2ND_BOOT_WDT); - - clrbits_le32(&sec_boot_wdt->ctrl, WDT_CTRL_EN); -#endif -} - int board_init(void) { gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; diff --git a/arch/arm/mach-aspeed/ast2500/Makefile b/arch/arm/mach-aspeed/ast2500/Makefile index a35b239ef3..2e9e15d831 100644 --- a/arch/arm/mach-aspeed/ast2500/Makefile +++ b/arch/arm/mach-aspeed/ast2500/Makefile @@ -1 +1,2 @@ +obj-y += lowlevel_init.o obj-y += clk_ast2500.o sdram_ast2500.o diff --git a/arch/arm/mach-aspeed/ast2500/lowlevel_init.S b/arch/arm/mach-aspeed/ast2500/lowlevel_init.S new file mode 100644 index 0000000000..9ec3dd46b7 --- /dev/null +++ b/arch/arm/mach-aspeed/ast2500/lowlevel_init.S @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) ASPEED Technology Inc. + */ +#include + +/* registers for low level init */ +#define SCU_PROT_KEY 0x1e6e2000 +#define SCU_VGA_HANDSHAKE 0x1e6e2040 +#define SCU_HW_STRAP 0x1e6e2070 +#define SCU_HW_STRAP_CLR 0x1e6e207c +#define WDT3_CTRL 0x1e78504c + +.global lowlevel_init +lowlevel_init: + + /* unlock SCU */ + ldr r0, =SCU_PROT_KEY + ldr r1, =SCU_UNLOCK_VALUE + str r1, [r0] + + /* set BMC FW as DRAM initializer */ + ldr r0, =SCU_VGA_HANDSHAKE + ldr r1, [r0] + orr r1, #0x80 + str r1, [r0] + + /* set PERST# as LPC reset source if eSPI mode is enabled*/ + ldr r0, =SCU_HW_STRAP + ldr r1, [r0] + tst r1, #(0x1 << 25) + ldrne r0, =SCU_HW_STRAP_CLR + movne r1, #(0x1 << 14) + strne r1, [r0] + + /* disable WDT3 for SPI 3/4 bytes auto-detection */ + ldr r0, =WDT3_CTRL + mov r1, #0x0 + str r1, [r0] + + mov pc, lr From patchwork Mon Aug 3 09:36:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ChiaWei Wang X-Patchwork-Id: 1340281 X-Patchwork-Delegate: trini@ti.com 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=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aspeedtech.com Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BKwzP2Z0Jz9sTd for ; Mon, 3 Aug 2020 21:44:49 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 20A888217F; Mon, 3 Aug 2020 13:44:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=aspeedtech.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id A7F8881D9E; Mon, 3 Aug 2020 11:36:37 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2D7C781D71 for ; Mon, 3 Aug 2020 11:36:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=aspeedtech.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=chiawei_wang@aspeedtech.com Received: from mail.aspeedtech.com (twmbx02.aspeed.com [192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 0739KU1J029425; Mon, 3 Aug 2020 17:20:31 +0800 (GMT-8) (envelope-from chiawei_wang@aspeedtech.com) Received: from ChiaWeiWang-PC.aspeed.com (192.168.100.253) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.620.29; Mon, 3 Aug 2020 17:36:18 +0800 From: "Chia-Wei, Wang" To: , CC: , Subject: [PATCH 3/6] cosmetic: aspeed: ast2500: Rename board file Date: Mon, 3 Aug 2020 17:36:07 +0800 Message-ID: <20200803093610.3222-4-chiawei_wang@aspeedtech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200803093610.3222-1-chiawei_wang@aspeedtech.com> References: <20200803093610.3222-1-chiawei_wang@aspeedtech.com> MIME-Version: 1.0 X-Originating-IP: [192.168.100.253] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 0739KU1J029425 X-Mailman-Approved-At: Mon, 03 Aug 2020 13:43:53 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Rename the ast2500-board.c to board_common.c and place the renamed file under the ast2500 folder. Signed-off-by: Chia-Wei, Wang --- arch/arm/mach-aspeed/Makefile | 2 +- arch/arm/mach-aspeed/ast2500/Makefile | 1 + .../arm/mach-aspeed/{ast2500-board.c => ast2500/board_common.c} | 0 3 files changed, 2 insertions(+), 1 deletion(-) rename arch/arm/mach-aspeed/{ast2500-board.c => ast2500/board_common.c} (100%) diff --git a/arch/arm/mach-aspeed/Makefile b/arch/arm/mach-aspeed/Makefile index 1557dcae66..33f65b50b2 100644 --- a/arch/arm/mach-aspeed/Makefile +++ b/arch/arm/mach-aspeed/Makefile @@ -3,4 +3,4 @@ # Copyright (c) 2016 Google, Inc obj-$(CONFIG_ARCH_ASPEED) += ast_wdt.o -obj-$(CONFIG_ASPEED_AST2500) += ast2500/ ast2500-board.o +obj-$(CONFIG_ASPEED_AST2500) += ast2500/ diff --git a/arch/arm/mach-aspeed/ast2500/Makefile b/arch/arm/mach-aspeed/ast2500/Makefile index 2e9e15d831..4c27c8fc46 100644 --- a/arch/arm/mach-aspeed/ast2500/Makefile +++ b/arch/arm/mach-aspeed/ast2500/Makefile @@ -1,2 +1,3 @@ obj-y += lowlevel_init.o +obj-y += board_common.o obj-y += clk_ast2500.o sdram_ast2500.o diff --git a/arch/arm/mach-aspeed/ast2500-board.c b/arch/arm/mach-aspeed/ast2500/board_common.c similarity index 100% rename from arch/arm/mach-aspeed/ast2500-board.c rename to arch/arm/mach-aspeed/ast2500/board_common.c From patchwork Mon Aug 3 09:36:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ChiaWei Wang X-Patchwork-Id: 1340283 X-Patchwork-Delegate: trini@ti.com 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=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aspeedtech.com Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BKwzs0Xxsz9sTX for ; Mon, 3 Aug 2020 21:45:12 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C6786821CA; Mon, 3 Aug 2020 13:44:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=aspeedtech.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 297B781D9E; Mon, 3 Aug 2020 11:36:42 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 90C7781BD7 for ; Mon, 3 Aug 2020 11:36:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=aspeedtech.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=chiawei_wang@aspeedtech.com Received: from mail.aspeedtech.com (twmbx02.aspeed.com [192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 0739KVVc029427; Mon, 3 Aug 2020 17:20:31 +0800 (GMT-8) (envelope-from chiawei_wang@aspeedtech.com) Received: from ChiaWeiWang-PC.aspeed.com (192.168.100.253) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.620.29; Mon, 3 Aug 2020 17:36:19 +0800 From: "Chia-Wei, Wang" To: , CC: , Subject: [PATCH 4/6] include/configs: aspeed: Remove hardcoded variables Date: Mon, 3 Aug 2020 17:36:08 +0800 Message-ID: <20200803093610.3222-5-chiawei_wang@aspeedtech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200803093610.3222-1-chiawei_wang@aspeedtech.com> References: <20200803093610.3222-1-chiawei_wang@aspeedtech.com> MIME-Version: 1.0 X-Originating-IP: [192.168.100.253] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 0739KVVc029427 X-Mailman-Approved-At: Mon, 03 Aug 2020 13:43:53 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean The hardcoded platform variables such as DRAM base address are not common to Aspeed SoCs AST24xx/AST25xx/AST26xx. This patch replaces those hardcoded with macros defined in a newly added header, where the basic SoC HW information are assigned accordingly. Signed-off-by: Chia-Wei, Wang --- arch/arm/include/asm/arch-aspeed/platform.h | 20 ++++++++++++++++++++ include/configs/aspeed-common.h | 16 +++++++++------- 2 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 arch/arm/include/asm/arch-aspeed/platform.h diff --git a/arch/arm/include/asm/arch-aspeed/platform.h b/arch/arm/include/asm/arch-aspeed/platform.h new file mode 100644 index 0000000000..6cee036f54 --- /dev/null +++ b/arch/arm/include/asm/arch-aspeed/platform.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) ASPEED Technology Inc. + * Ryan Chen + * + */ + +#ifndef _ASM_ARCH_PLATFORM_H +#define _ASM_ARCH_PLATFORM_H + +#if defined(CONFIG_ASPEED_AST2500) +#define ASPEED_MAC_COUNT 2 +#define ASPEED_DRAM_BASE 0x80000000 +#define ASPEED_SRAM_BASE 0x1e720000 +#define ASPEED_SRAM_SIZE 0x9000 +#else +#err "Unrecognized Aspeed platform." +#endif + +#endif diff --git a/include/configs/aspeed-common.h b/include/configs/aspeed-common.h index 1295a6cd19..14dd5c795d 100644 --- a/include/configs/aspeed-common.h +++ b/include/configs/aspeed-common.h @@ -7,22 +7,24 @@ * (C) Copyright 2016 Google, Inc */ -#ifndef __AST_COMMON_CONFIG_H -#define __AST_COMMON_CONFIG_H +#ifndef _ASPEED_COMMON_CONFIG_H +#define _ASPEED_COMMON_CONFIG_H + +#include /* Misc CPU related */ #define CONFIG_CMDLINE_TAG #define CONFIG_SETUP_MEMORY_TAGS #define CONFIG_INITRD_TAG -#define CONFIG_SYS_SDRAM_BASE 0x80000000 +#define CONFIG_SYS_SDRAM_BASE ASPEED_DRAM_BASE #ifdef CONFIG_PRE_CON_BUF_SZ -#define CONFIG_SYS_INIT_RAM_ADDR (0x1e720000 + CONFIG_PRE_CON_BUF_SZ) -#define CONFIG_SYS_INIT_RAM_SIZE (36*1024 - CONFIG_PRE_CON_BUF_SZ) +#define CONFIG_SYS_INIT_RAM_ADDR (ASPEED_SRAM_BASE + CONFIG_PRE_CON_BUF_SZ) +#define CONFIG_SYS_INIT_RAM_SIZE (ASPEED_SRAM_SIZE - CONFIG_PRE_CON_BUF_SZ) #else -#define CONFIG_SYS_INIT_RAM_ADDR (0x1e720000) -#define CONFIG_SYS_INIT_RAM_SIZE (36*1024) +#define CONFIG_SYS_INIT_RAM_ADDR (ASPEED_SRAM_BASE) +#define CONFIG_SYS_INIT_RAM_SIZE (ASPEED_SRAM_SIZE) #endif #define SYS_INIT_RAM_END (CONFIG_SYS_INIT_RAM_ADDR \ From patchwork Mon Aug 3 09:36:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ChiaWei Wang X-Patchwork-Id: 1340282 X-Patchwork-Delegate: trini@ti.com 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=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aspeedtech.com Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BKwzd2pv3z9sTX for ; Mon, 3 Aug 2020 21:45:01 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7F30E821AF; Mon, 3 Aug 2020 13:44:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=aspeedtech.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id E4ECF81E3C; Mon, 3 Aug 2020 11:36:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E4DD181D71 for ; Mon, 3 Aug 2020 11:36:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=aspeedtech.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=chiawei_wang@aspeedtech.com Received: from mail.aspeedtech.com (twmbx02.aspeed.com [192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 0739KWM5029436; Mon, 3 Aug 2020 17:20:32 +0800 (GMT-8) (envelope-from chiawei_wang@aspeedtech.com) Received: from ChiaWeiWang-PC.aspeed.com (192.168.100.253) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.620.29; Mon, 3 Aug 2020 17:36:19 +0800 From: "Chia-Wei, Wang" To: , CC: , Subject: [PATCH 5/6] configs: evb-ast2500: Move BOOTCOMMAND from header to defconfig Date: Mon, 3 Aug 2020 17:36:09 +0800 Message-ID: <20200803093610.3222-6-chiawei_wang@aspeedtech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200803093610.3222-1-chiawei_wang@aspeedtech.com> References: <20200803093610.3222-1-chiawei_wang@aspeedtech.com> MIME-Version: 1.0 X-Originating-IP: [192.168.100.253] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 0739KWM5029436 X-Mailman-Approved-At: Mon, 03 Aug 2020 13:43:53 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Move the BOOTCOMMAND definition from the board inclusion header to the default configuration file. Signed-off-by: Chia-Wei, Wang --- configs/evb-ast2500_defconfig | 4 +++- include/configs/aspeed-common.h | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configs/evb-ast2500_defconfig b/configs/evb-ast2500_defconfig index 5de42679ca..ce38b38183 100644 --- a/configs/evb-ast2500_defconfig +++ b/configs/evb-ast2500_defconfig @@ -5,12 +5,14 @@ CONFIG_SYS_TEXT_BASE=0x0 CONFIG_ASPEED_AST2500=y CONFIG_TARGET_EVB_AST2500=y CONFIG_SYS_MALLOC_F_LEN=0x2000 -CONFIG_ENV_SIZE=0x20000 CONFIG_NR_DRAM_BANKS=1 +CONFIG_ENV_SIZE=0x20000 CONFIG_PRE_CON_BUF_ADDR=0x1e720000 CONFIG_DEFAULT_DEVICE_TREE="ast2500-evb" CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="console=ttyS4,115200n8 root=/dev/ram rw" +CONFIG_USE_BOOTCOMMAND=y +CONFIG_BOOTCOMMAND="bootm 20080000 20300000" CONFIG_PRE_CONSOLE_BUFFER=y # CONFIG_DISPLAY_CPUINFO is not set CONFIG_HUSH_PARSER=y diff --git a/include/configs/aspeed-common.h b/include/configs/aspeed-common.h index 14dd5c795d..df0f5d2e76 100644 --- a/include/configs/aspeed-common.h +++ b/include/configs/aspeed-common.h @@ -47,8 +47,6 @@ * Miscellaneous configurable options */ -#define CONFIG_BOOTCOMMAND "bootm 20080000 20300000" - #define CONFIG_EXTRA_ENV_SETTINGS \ "verify=yes\0" \ "spi_dma=yes\0" \ From patchwork Mon Aug 3 09:36:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ChiaWei Wang X-Patchwork-Id: 1340285 X-Patchwork-Delegate: trini@ti.com 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=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aspeedtech.com Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BKx0303khz9sTX for ; Mon, 3 Aug 2020 21:45:22 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2EDFC821C6; Mon, 3 Aug 2020 13:44:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=aspeedtech.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 5D2E881F2D; Mon, 3 Aug 2020 11:36:45 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3A19D81BD7 for ; Mon, 3 Aug 2020 11:36:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=aspeedtech.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=chiawei_wang@aspeedtech.com Received: from mail.aspeedtech.com (twmbx02.aspeed.com [192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 0739KW4K029440; Mon, 3 Aug 2020 17:20:32 +0800 (GMT-8) (envelope-from chiawei_wang@aspeedtech.com) Received: from ChiaWeiWang-PC.aspeed.com (192.168.100.253) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.620.29; Mon, 3 Aug 2020 17:36:20 +0800 From: "Chia-Wei, Wang" To: , CC: , Subject: [PATCH 6/6] configs: evb-ast2500: Convert to OF_SEPARATE Date: Mon, 3 Aug 2020 17:36:10 +0800 Message-ID: <20200803093610.3222-7-chiawei_wang@aspeedtech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200803093610.3222-1-chiawei_wang@aspeedtech.com> References: <20200803093610.3222-1-chiawei_wang@aspeedtech.com> MIME-Version: 1.0 X-Originating-IP: [192.168.100.253] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 0739KW4K029440 X-Mailman-Approved-At: Mon, 03 Aug 2020 13:43:53 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Switch DTB provider form OF_EMBED to OF_SEPARATE to avoid the compile warning message: ==================== WARNING ====================== CONFIG_OF_EMBED is enabled. This option should only be used for debugging purposes. Please use CONFIG_OF_SEPARATE for boards in mainline. See doc/README.fdt-control for more info. ==================================================== Signed-off-by: Chia-Wei, Wang --- configs/evb-ast2500_defconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/configs/evb-ast2500_defconfig b/configs/evb-ast2500_defconfig index ce38b38183..105975c9e6 100644 --- a/configs/evb-ast2500_defconfig +++ b/configs/evb-ast2500_defconfig @@ -22,7 +22,6 @@ CONFIG_CMD_MMC=y CONFIG_CMD_DHCP=y CONFIG_CMD_MII=y CONFIG_CMD_PING=y -CONFIG_OF_EMBED=y CONFIG_ENV_OVERWRITE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_NET_RANDOM_ETHADDR=y