Refactor Aspeed SoCs support
Subsystems (4)
Chia-Wei
cover Refactor Aspeed SoCs support
This patch series refactors the existing Aspeed platform code and file/folder structure for better flexibility to extend the support of other Aspeed SoCs. The maintainers for Aspeed SoCs are also added.
Chia-Wei, Wang (6):
MAINTAINERS: Add maintainers for Aspeed SoCs
aspeed: ast2500: Add lowlevel_init assembly
cosmetic: aspeed: ast2500: Rename board file include/configs: aspeed: Remove hardcoded variables
configs: evb-ast2500: Move BOOTCOMMAND from header to defconfig
configs: evb-ast2500: Convert to OF_SEPARATE
MAINTAINERS | 12 ++++++
arch/arm/include/asm/arch-aspeed/platform.h | 20 +++++++++
arch/arm/mach-aspeed/Makefile | 2 +-
arch/arm/mach-aspeed/ast2500/Makefile | 2 +
.../board_common.c} | 25 -----------
arch/arm/mach-aspeed/ast2500/lowlevel_init.S | 41 +++++++++++++++++++
configs/evb-ast2500_defconfig | 5 ++-
include/configs/aspeed-common.h | 18 ++++----
8 files changed, 88 insertions(+), 37 deletions(-)
create mode 100644 arch/arm/include/asm/arch-aspeed/platform.h
rename arch/arm/mach-aspeed/{ast2500-board.c => ast2500/board_common.c} (58%)
create mode 100644 arch/arm/mach-aspeed/ast2500/lowlevel_init.SSignature · 1 line
2.17.1
Chia-Wei
PATCH 1/6 MAINTAINERS: Add maintainers for Aspeed SoCs
Update maintainers for Aspeed SoC platforms.
--- MAINTAINERS | 12 ++++++++++++ 1 file changed, 12 insertions(+)
MAINTAINERS +12 -0
@@ -148,6 +148,18 @@ F: include/configs/meson64_android.h F: doc/board/amlogic/ N: meson +ARM ASPEED +M: Ryan Chen <[email protected]> +M: Chia-Wei Wang <[email protected]> +R: Aspeed BMC SW team <[email protected]> +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 <[email protected]> S: Maintained
Signature · 1 line
2.17.1
PATCH 1/6 MAINTAINERS: Add maintainers for Aspeed SoCs
Quoted 3 lines · Wang
Update maintainers for Aspeed SoC platforms.
Signed-off-by Chia-Wei, Wang <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200814/17351653/attachment.sig>
Chia-Wei
PATCH 2/6 aspeed: ast2500: Add lowlevel_init assembly
In reply to Chia-WeiThe 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.
--- 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
arch/arm/mach-aspeed/ast2500-board.c +0 -25
@@ -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 ;
arch/arm/mach-aspeed/ast2500/Makefile +1 -0
@@ -1 +1,2 @@ +obj-y += lowlevel_init.o obj-y += clk_ast2500.o sdram_ast2500.o
arch/arm/mach-aspeed/ast2500/lowlevel_init.S new file +41 -0
41 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 2/6 aspeed: ast2500: Add lowlevel_init assembly
Quoted 9 lines · Wang
The original
lowlevel_initfunction of AST2500 is written in C. However, the C runtime environment is not ready until_mainexecution.This patch adds the assembly version of the
lowlevel_initfunction. Additional initialization to DRAM configuration and LPC reset source are also added.Signed-off-by Chia-Wei, Wang <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200814/a9c50cb6/attachment.sig>
Chia-Wei
PATCH 3/6 cosmetic: aspeed: ast2500: Rename board file
In reply to Chia-WeiRename the ast2500-board.c to board_common.c and
place the renamed file under the ast2500 folder.
---
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%)arch/arm/mach-aspeed/Makefile +1 -1
@@ -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/
arch/arm/mach-aspeed/ast2500/Makefile +1 -0
@@ -1,2 +1,3 @@ obj-y += lowlevel_init.o +obj-y += board_common.o obj-y += clk_ast2500.o sdram_ast2500.o
arch/arm/mach-aspeed/ast2500/board_common.c renamed from arch/arm/mach-aspeed/ast2500-board.c +0 -0
Signature · 1 line
2.17.1
PATCH 3/6 cosmetic: aspeed: ast2500: Rename board file
Quoted 4 lines · Wang
Rename the
ast2500-board.ctoboard_common.cand
place the renamed file under the ast2500 folder.Signed-off-by Chia-Wei, Wang <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200814/f489c6ee/attachment.sig>
Chia-Wei
PATCH 4/6 include/configs: aspeed: Remove hardcoded variables
In reply to Chia-WeiThe 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.
--- 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
arch/arm/include/asm/arch-aspeed/platform.h new file +20 -0
@@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (C) ASPEED Technology Inc. +* Ryan Chen <[email protected]> +* +*/ + +#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
include/configs/aspeed-common.h +9 -7
@@ -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 <asm/arch/platform.h> /* 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 \
Signature · 1 line
2.17.1
PATCH 4/6 include/configs: aspeed: Remove hardcoded variables
Quoted 6 lines · Wang
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 <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200814/5c8023b9/attachment.sig>
Chia-Wei
PATCH 5/6 configs: evb-ast2500: Move BOOTCOMMAND from header to defconfig
In reply to Chia-WeiMove the BOOTCOMMAND definition from the board inclusion header to the default configuration file.
--- configs/evb-ast2500_defconfig | 4 +++- include/configs/aspeed-common.h | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-)
configs/evb-ast2500_defconfig +3 -1
@@ -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
include/configs/aspeed-common.h +0 -2
@@ -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" \
Signature · 1 line
2.17.1
PATCH 5/6 configs: evb-ast2500: Move BOOTCOMMAND from header to defconfig
Quoted 4 lines · Wang
Move the BOOTCOMMAND definition from the board inclusion header to the default configuration file.
Signed-off-by Chia-Wei, Wang <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200814/976b7817/attachment.sig>
Chia-Wei
PATCH 6/6 configs: evb-ast2500: Convert to OF_SEPARATE
In reply to Chia-WeiSwitch 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.
====================================================
--- configs/evb-ast2500_defconfig | 1 - 1 file changed, 1 deletion(-)
configs/evb-ast2500_defconfig +0 -1
@@ -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
Signature · 1 line
2.17.1
PATCH 6/6 configs: evb-ast2500: Convert to OF_SEPARATE
Quoted 11 lines · Wang
Switch DTB provider form
OF_EMBEDtoOF_SEPARATE
to avoid the compile warning message:==================== WARNING ======================
CONFIG_OF_EMBEDis enabled. This option should only be used for debugging purposes. Please useCONFIG_OF_SEPARATEfor boards in mainline. See doc/README.fdt-control for more info.
====================================================Signed-off-by Chia-Wei, Wang <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200814/289213a8/attachment.sig>