Skip to contentSkip to conversation

config cleanups and small fixes

PATCH In review Cédric Le Goater 2 participants 32 messages Oct 6, 2016 – Oct 17, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover config cleanups and small fixes

Hello,

Here is a set of cleanups on the configuration. It should ease the port on v2016.11 which is a little more strict on CONFIG_ defines.

I also included a couple of fixes on the timer and ramdisk relocation.

Thanks,

C.

Cédric Le Goater (12):
aspeed: add CONFIG_AST_SPI_NOR
aspeed: rework top level configuration of the Aspeed SoC
aspeed: use CONFIG_TARGET_AST_G{4,5}
aspeed: remove CONFIG_SYS_INIT_RAM_END
aspeed: replace CONFIG_ASPEED_TIMER_CLK with CONFIG_TIMER_CLK_FREQ
aspeed: timer cleanups
aspeed: add configuration for the network devices
aspeed: remove CONFIG_MAC_NUM
aspeed: add CONFIG_DRAM_ECC
aspeed: remove CONFIG_PHY_MAX_ADDR
bootm: fix ramdisk relocation
aspeed: remove hack loading ramdisk in memory

 arch/arm/Kconfig                             | 14 +++----
 arch/arm/include/asm/arch-aspeed/aspeed.h    | 29 --------------
 arch/arm/include/asm/arch-aspeed/ast-ahbc.h  |  2 +-
 arch/arm/include/asm/arch-aspeed/platform.h  | 10 +----
 arch/arm/include/asm/arch-aspeed/regs-ahbc.h |  4 +-
 arch/arm/include/asm/arch-aspeed/regs-scu.h  | 56 ++++++++++++++--------------
 arch/arm/mach-aspeed/Kconfig                 | 50 +++++++++++++++++++++++++
 arch/arm/mach-aspeed/Makefile                |  4 +-
 arch/arm/mach-aspeed/ast-ahbc.c              |  5 +--
 arch/arm/mach-aspeed/ast-scu.c               | 19 ++++++----
 arch/arm/mach-aspeed/cpuinfo.c               |  5 +--
 arch/arm/mach-aspeed/flash.c                 | 21 +----------
 arch/arm/mach-aspeed/timer.c                 | 27 ++++++++++----
 board/aspeed/Kconfig                         | 16 --------
 board/aspeed/ast-g4/Kconfig                  |  6 ---
 board/aspeed/ast-g4/ast-g4.c                 |  1 -
 board/aspeed/ast-g5/Kconfig                  | 15 +++++---
 cmd/bootm.c                                  |  3 ++
 common/image.c                               | 11 ------
 configs/ast_g4_ncsi_defconfig                |  3 ++
 configs/ast_g4_phy_defconfig                 |  4 ++
 configs/ast_g5_ncsi_defconfig                |  3 ++
 configs/ast_g5_phy_defconfig                 |  4 ++
 drivers/net/Kconfig                          | 19 +++++++++-
 drivers/net/ftgmac100.c                      | 15 ++++----
 include/configs/ast-common.h                 | 15 +++-----
 include/configs/ast-g4-ncsi.h                |  6 +--
 include/configs/ast-g4-phy.h                 |  9 ++---
 include/configs/ast-g5-ncsi.h                |  9 ++---
 include/configs/ast-g5-phy.h                 | 11 ++----
 30 files changed, 194 insertions(+), 202 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-aspeed/aspeed.h
 create mode 100644 arch/arm/mach-aspeed/Kconfig
 delete mode 100644 board/aspeed/Kconfig
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/12 aspeed: add CONFIG_AST_SPI_NOR

also remove some useless code related the host SPI PNOR

---
 arch/arm/Kconfig             |  2 ++
 arch/arm/mach-aspeed/flash.c | 18 +-----------------
 board/aspeed/Kconfig         |  6 ++++++
 include/configs/ast-common.h |  4 +---
 4 files changed, 10 insertions(+), 20 deletions(-)
arch/arm/Kconfig +2 -0
index 328dc7fe455a..f155d22b1197 100644
@@ -902,10 +902,12 @@ config TARGET_THUNDERX_88XX
 config TARGET_AST_G5
        bool "Support Apseed fifth generation SoCs"
        select CPU_ARM1176
+       select AST_SPI_NOR
 
 config TARGET_AST_G4
        bool "Support Aspeed fourth generation SoCs"
        select CPU_ARM926EJS
+       select AST_SPI_NOR
 
 endchoice
 
arch/arm/mach-aspeed/flash.c +1 -17
index 9c5ead6fd7ae..01c5354b66d4 100644
@@ -1310,7 +1310,7 @@ unsigned long flash_init (void)
 
 	/* Init: FMC  */
 	/* BANK 0 : FMC CS0 , 1: FMC CS1, */
-	for (i = 0; i < CONFIG_FMC_CS; ++i) {
+	for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; ++i) {
 		flash_info[i].sysspi = 0;
 		flash_info[i].reg_base = AST_FMC_BASE;
 		flash_info[i].flash_id = FLASH_UNKNOWN;
@@ -1332,22 +1332,6 @@ unsigned long flash_init (void)
 		}
 	}
 
-	/* BANK 2:SYSSPI CS0 */
-#ifdef CONFIG_SPI0_CS
-	//pin switch by trap[13:12]	-- [0:1] Enable SPI Master
-	ast_scu_spi_master(1);	/* enable SPI master */
-	*((volatile ulong*) AST_FMC_SPI0_BASE) |= 0x10000;	/* enable Flash Write */
-	flash_info[CONFIG_FMC_CS].sysspi = 1;
-	flash_info[CONFIG_FMC_CS].reg_base = AST_FMC_SPI0_BASE;
-	flash_info[CONFIG_FMC_CS].flash_id = FLASH_UNKNOWN;
-	flash_info[CONFIG_FMC_CS].CE = 0;
-	size += flash_info[CONFIG_FMC_CS].size = flash_get_size(AST_SPI0_CS0_BASE, &flash_info[CONFIG_FMC_CS]);
-	if (flash_info[2].flash_id == FLASH_UNKNOWN) {
-		printf ("## Unknown FLASH on Bank 2 SYS SPI - Size = 0x%08lx = %ld MB\n",
-			flash_info[CONFIG_FMC_CS].size, flash_info[CONFIG_FMC_CS].size << 20);
-	}
-#endif
-
 	/* Monitor protection ON by default */
 #if (CONFIG_MONITOR_BASE >= AST_FMC_CS0_BASE)
 	flash_protect (FLAG_PROTECT_SET,
board/aspeed/Kconfig +6 -0
index 5d356e297a7d..3dcf1a26d50e 100644
@@ -14,3 +14,9 @@ config ASPEED_NET_NCSI
 	bool  "Use a network controller attached via NSCI"
 
 endchoice
+
+config AST_SPI_NOR
+	bool "Enable Aspeed SMC driver"
+	help
+	  Enable Aspeed SMC driver to access the SPI NOR flash of the
+	  BMC
include/configs/ast-common.h +1 -3
index b39ea33ce710..81befc66cd62 100644
@@ -86,9 +86,7 @@
 
 #define CONFIG_BOOTARGS			"console=ttyS4,115200n8 root=/dev/ram rw"
 
-#define CONFIG_AST_SPI_NOR    /* AST SPI NOR Flash */
-#define CONFIG_FMC_CS			1
-#define CONFIG_SYS_MAX_FLASH_BANKS 	(CONFIG_FMC_CS)
+#define CONFIG_SYS_MAX_FLASH_BANKS 	1
 #define CONFIG_SYS_MAX_FLASH_SECT	(8192)		/* max number of sectors on one chip */
 #define CONFIG_ENV_IS_IN_FLASH		1
 #define CONFIG_ENV_ADDR			(AST_FMC_CS0_BASE + 0x60000)
Signature · 1 line
2.7.4
maintainer Reviewed-by on v1 1/12
#2 lore raw

Re: [PATCH u-boot 01/12] aspeed: add CONFIG_AST_SPI_NOR

Quoted 3 lines · Cédric Le Goater

also remove some useless code related the host SPI PNOR

Quoted 6 lines
---
 arch/arm/Kconfig             |  2 ++
 arch/arm/mach-aspeed/flash.c | 18 +-----------------
 board/aspeed/Kconfig         |  6 ++++++
 include/configs/ast-common.h |  4 +---
 4 files changed, 10 insertions(+), 20 deletions(-)
#3 lore raw

PATCH 2/12 aspeed: rework top level configuration of the Aspeed SoC

In reply to Cédric Le Goater

and also add a proper CONFIG_ARCH_ASPEED

---
 arch/arm/Kconfig                               | 16 ++++---------
 {board/aspeed => arch/arm/mach-aspeed}/Kconfig | 32 ++++++++++++++++++++++++--
 board/aspeed/ast-g4/Kconfig                    |  6 -----
 board/aspeed/ast-g5/Kconfig                    |  6 -----
 configs/ast_g4_ncsi_defconfig                  |  1 +
 configs/ast_g4_phy_defconfig                   |  1 +
 configs/ast_g5_ncsi_defconfig                  |  1 +
 configs/ast_g5_phy_defconfig                   |  1 +
 include/configs/ast-common.h                   |  1 -
 9 files changed, 39 insertions(+), 26 deletions(-)
 rename {board/aspeed => arch/arm/mach-aspeed}/Kconfig (52%)
arch/arm/Kconfig +5 -11
index f155d22b1197..b75ff1296cc2 100644
@@ -130,6 +130,9 @@ choice
 	prompt "Target select"
 	default TARGET_HIKEY
 
+config ARCH_ASPEED
+       bool "Support Apseed SoCs"
+
 config ARCH_AT91
 	bool "Atmel AT91"
 
@@ -899,18 +902,10 @@ config TARGET_THUNDERX_88XX
 	select OF_CONTROL
 	select SYS_CACHE_SHIFT_7
 
-config TARGET_AST_G5
-       bool "Support Apseed fifth generation SoCs"
-       select CPU_ARM1176
-       select AST_SPI_NOR
-
-config TARGET_AST_G4
-       bool "Support Aspeed fourth generation SoCs"
-       select CPU_ARM926EJS
-       select AST_SPI_NOR
-
 endchoice
 
+source "arch/arm/mach-aspeed/Kconfig"
+
 source "arch/arm/mach-at91/Kconfig"
 
 source "arch/arm/mach-bcm283x/Kconfig"
@@ -1050,7 +1045,6 @@ source "board/vscom/baltos/Kconfig"
 source "board/woodburn/Kconfig"
 source "board/work-microwave/work_92105/Kconfig"
 source "board/zipitz2/Kconfig"
-source "board/aspeed/Kconfig"
 
 source "arch/arm/Kconfig.debug"
 
arch/arm/mach-aspeed/Kconfig renamed from board/aspeed/Kconfig +30 -2
similarity index 52%
rename from board/aspeed/Kconfig
rename to arch/arm/mach-aspeed/Kconfig
index 3dcf1a26d50e..316f4c5815e0 100644
@@ -1,5 +1,21 @@
-source "board/aspeed/ast-g5/Kconfig"
-source "board/aspeed/ast-g4/Kconfig"
+if ARCH_ASPEED
+
+
+choice
+	prompt "Aspeed SoC select"
+	optional
+
+config TARGET_AST_G5
+       bool "Support Apseed fifth generation SoCs"
+       select CPU_ARM1176
+       select AST_SPI_NOR
+
+config TARGET_AST_G4
+       bool "Support Aspeed fourth generation SoCs"
+       select CPU_ARM926EJS
+       select AST_SPI_NOR
+
+endchoice
 
 choice
 	prompt "Network configuration"
@@ -20,3 +36,15 @@ config AST_SPI_NOR
 	help
 	  Enable Aspeed SMC driver to access the SPI NOR flash of the
 	  BMC
+
+config SYS_VENDOR
+	default "aspeed"
+
+config SYS_SOC
+	default "aspeed"
+
+
+source "board/aspeed/ast-g5/Kconfig"
+source "board/aspeed/ast-g4/Kconfig"
+
+endif
board/aspeed/ast-g4/Kconfig +0 -6
index 2bec9a733a92..e0892afbb3a1 100644
@@ -9,12 +9,6 @@ config SYS_CPU
 config SYS_BOARD
 	default "ast-g4"
 
-config SYS_VENDOR
-	default "aspeed"
-
-config SYS_SOC
-	default "aspeed"
-
 config SYS_CONFIG_NAME
 	default "ast-g4-phy" if ASPEED_NET_PHY
 	default "ast-g4-ncsi" if ASPEED_NET_NCSI
board/aspeed/ast-g5/Kconfig +0 -6
index 9bd3e7de49a4..b809a6b1750f 100644
@@ -9,12 +9,6 @@ config SYS_CPU
 config SYS_BOARD
 	default "ast-g5"
 
-config SYS_VENDOR
-	default "aspeed"
-
-config SYS_SOC
-	default "aspeed"
-
 config SYS_CONFIG_NAME
 	default "ast-g5-phy" if ASPEED_NET_PHY
 	default "ast-g5-ncsi" if ASPEED_NET_NCSI
configs/ast_g4_ncsi_defconfig +1 -0
index 4ee71c5d9a2e..0314af82c37e 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_ARCH_ASPEED=y
 CONFIG_TARGET_AST_G4=y
 CONFIG_SYS_PROMPT="ast# "
 CONFIG_CMD_DHCP=y
configs/ast_g4_phy_defconfig +1 -0
index 61fd69b46897..7e9e5712a9ef 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_ARCH_ASPEED=y
 CONFIG_TARGET_AST_G4=y
 CONFIG_ASPEED_NET_PHY=y
 CONFIG_SYS_PROMPT="ast# "
configs/ast_g5_ncsi_defconfig +1 -0
index 6d11afbbc6c1..b1f4f185a53f 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_ARCH_ASPEED=y
 CONFIG_TARGET_AST_G5=y
 CONFIG_SYS_PROMPT="ast# "
 CONFIG_CMD_DHCP=y
configs/ast_g5_phy_defconfig +1 -0
index 20f62e08f540..63ff21f65f71 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_ARCH_ASPEED=y
 CONFIG_TARGET_AST_G5=y
 CONFIG_ASPEED_NET_PHY=y
 CONFIG_SYS_PROMPT="ast# "
include/configs/ast-common.h +0 -1
index 81befc66cd62..d0638158ab25 100644
@@ -14,7 +14,6 @@
 #ifndef __AST_COMMON_CONFIG_H
 #define __AST_COMMON_CONFIG_H
 
-#define CONFIG_ARCH_ASPEED
 #define CONFIG_EXTRA_ENV_SETTINGS ASPEED_ENV_SETTINGS
 
 #define CONFIG_ARCH_CPU_INIT
Signature · 1 line
2.7.4
maintainer Reviewed-by on v1 2/12
#4 lore raw

Re: [PATCH u-boot 02/12] aspeed: rework top level configuration of the Aspeed SoC

Quoted 3 lines · Cédric Le Goater

and also add a proper CONFIG_ARCH_ASPEED

Quoted 12 lines
---
 arch/arm/Kconfig                               | 16 ++++---------
 {board/aspeed => arch/arm/mach-aspeed}/Kconfig | 32 ++++++++++++++++++++++++--
 board/aspeed/ast-g4/Kconfig                    |  6 -----
 board/aspeed/ast-g5/Kconfig                    |  6 -----
 configs/ast_g4_ncsi_defconfig                  |  1 +
 configs/ast_g4_phy_defconfig                   |  1 +
 configs/ast_g5_ncsi_defconfig                  |  1 +
 configs/ast_g5_phy_defconfig                   |  1 +
 include/configs/ast-common.h                   |  1 -
 9 files changed, 39 insertions(+), 26 deletions(-)
 rename {board/aspeed => arch/arm/mach-aspeed}/Kconfig (52%)
#5 lore raw

PATCH 3/12 aspeed: use CONFIG_TARGET_AST_G{4,5}

In reply to Cédric Le Goater

The generated config with the SoC definitions is included in each file at compile time. So we can remove the AST_SOC_G* define which are redundant.

---
 arch/arm/include/asm/arch-aspeed/aspeed.h    | 29 --------------
 arch/arm/include/asm/arch-aspeed/ast-ahbc.h  |  2 +-
 arch/arm/include/asm/arch-aspeed/platform.h  | 10 +----
 arch/arm/include/asm/arch-aspeed/regs-ahbc.h |  4 +-
 arch/arm/include/asm/arch-aspeed/regs-scu.h  | 56 ++++++++++++++--------------
 arch/arm/mach-aspeed/Makefile                |  4 +-
 arch/arm/mach-aspeed/ast-ahbc.c              |  5 +--
 arch/arm/mach-aspeed/ast-scu.c               | 19 ++++++----
 arch/arm/mach-aspeed/cpuinfo.c               |  5 +--
 arch/arm/mach-aspeed/flash.c                 |  3 +-
 board/aspeed/ast-g4/ast-g4.c                 |  1 -
 drivers/net/ftgmac100.c                      |  1 -
 include/configs/ast-common.h                 |  2 -
 include/configs/ast-g4-ncsi.h                |  2 +-
 include/configs/ast-g4-phy.h                 |  2 +-
 include/configs/ast-g5-ncsi.h                |  2 +-
 include/configs/ast-g5-phy.h                 |  2 +-
 17 files changed, 53 insertions(+), 96 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-aspeed/aspeed.h
arch/arm/include/asm/arch-aspeed/aspeed.h deleted +0 -29
deleted file mode 100644
index 7d2de1cbd43e..000000000000
@@ -1,29 +0,0 @@
-/*
- *  arch/arm/plat-aspeed/include/plat/aspeed.h
- *
- *  Copyright (C) 2012-2020  ASPEED Technology Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#if defined(CONFIG_ARCH_AST3200) || defined(CONFIG_ARCH_AST2500) || defined(CONFIG_ARCH_AST1520)
-#define AST_SOC_G5
-#define SRAM_SIZE 		SZ_32K
-#elif defined(CONFIG_ARCH_AST1400) || defined(CONFIG_ARCH_AST2400) || defined(CONFIG_ARCH_AST3100)
-#define AST_SOC_G4
-#define SRAM_SIZE 		SZ_32K
-#else
-#error "Not define SoC generation"
-#endif
arch/arm/include/asm/arch-aspeed/ast-ahbc.h +1 -1
index c870d11127b7..a0de8cf14d86 100644
@@ -30,7 +30,7 @@
 
 extern void ast_ahbc_boot_remap(void);
 
-#ifdef AST_SOC_G5
+#ifdef CONFIG_TARGET_AST_G5
 extern void ast_ahbc_lpc_plus_mapping(u8 enable);
 extern void ast_ahbc_peie_mapping(u8 enable);
 #endif
arch/arm/include/asm/arch-aspeed/platform.h +2 -8
index 1c02914fcbdf..f5db09d2a417 100644
@@ -17,15 +17,9 @@
 #ifndef _AST_PLATFORM_H
 #define _AST_PLATFORM_H
 
-#include <asm/arch/aspeed.h>
-
-#define AST_PLL_25MHZ			25000000
-#define AST_PLL_24MHZ			24000000
-#define AST_PLL_12MHZ			12000000
-
-#if defined(CONFIG_ARCH_AST2400)
+#if defined(CONFIG_TARGET_AST_G4)
 #include <asm/arch/ast2400_platform.h>
-#elif defined(AST_SOC_G5)
+#elif defined(CONFIG_TARGET_AST_G5)
 #include <asm/arch/ast_g5_platform.h>
 #else
 #err "No define for platform.h"
arch/arm/include/asm/arch-aspeed/regs-ahbc.h +1 -3
index 66e29839e8f1..c867b540dd5e 100644
@@ -13,8 +13,6 @@
 #ifndef __AST_AHBC_H
 #define __AST_AHBC_H
 
-#include <asm/arch/aspeed.h>
-
 /* Registers for AHBC */
 #define AST_AHBC_PROTECT		0x00	/* Protection Key Register */
 #define AST_AHBC_PRIORITY_CTRL		0x80	/* Priority Cortrol Register */
@@ -27,7 +25,7 @@
 #define AHBC_PCI_REMAP1			(1 << 5)
 #define AHBC_PCI_REMAP0			(1 << 4)
 
-#if defined(AST_SOC_G5)
+#if defined(CONFIG_TARGET_AST_G5)
 #define AHBC_PCIE_MAP			(1 << 5)
 #define AHBC_LPC_PLUS_MAP		(1 << 4)
 #else
arch/arm/include/asm/arch-aspeed/regs-scu.h +27 -29

215 lines not on this page · raw message

arch/arm/mach-aspeed/Makefile +2 -2
index 7d8930beb988..069eca939873 100644
@@ -13,5 +13,5 @@
 
 obj-y += timer.o reset.o cpuinfo.o ast-scu.o ast-ahbc.o ast-sdmc.o
 obj-$(CONFIG_AST_SPI_NOR) += flash.o
-obj-$(CONFIG_ARCH_AST2500) += platform_g5.o
-obj-$(CONFIG_ARCH_AST2400) += platform_g4.o
+obj-$(CONFIG_TARGET_AST_G5) += platform_g5.o
+obj-$(CONFIG_TARGET_AST_G4) += platform_g4.o
arch/arm/mach-aspeed/ast-ahbc.c +2 -3
index 9a41482c0f25..800cd2c5fb1f 100644
@@ -29,7 +29,6 @@
 #include <asm/io.h>
 #include <asm/arch/regs-ahbc.h>
 #include <asm/arch/ast-ahbc.h>
-#include <asm/arch/aspeed.h>
 
 static inline u32 ast_ahbc_read(u32 reg)
 {
@@ -58,13 +57,13 @@ static inline void ast_ahbc_write(u32 val, u32 reg)
 
 void ast_ahbc_boot_remap(void)
 {
-#if ! defined(AST_SOC_G5)
+#if ! defined(CONFIG_TARGET_AST_G5)
 	ast_ahbc_write(ast_ahbc_read(AST_AHBC_ADDR_REMAP) |
 		       AHBC_BOOT_REMAP, AST_AHBC_ADDR_REMAP);
 #endif
 }
 
-#ifdef AST_SOC_G5
+#ifdef CONFIG_TARGET_AST_G5
 void ast_ahbc_peie_mapping(u8 enable)
 {
 	if (enable)
arch/arm/mach-aspeed/ast-scu.c +11 -8
index 0cc0d67b5d31..1a005d0c9547 100644
@@ -41,7 +41,6 @@
 #include <asm/arch/regs-scu.h>
 #include <asm/arch/ast_scu.h>
 #include <asm/arch/platform.h>
-#include <asm/arch/aspeed.h>
 
 /* #define ASPEED_SCU_LOCK */
 
@@ -105,7 +104,7 @@ static struct soc_id soc_map_table[] = {
 void ast_scu_init_eth(u8 num)
 {
 /* Set MAC delay Timing */
-#ifndef AST_SOC_G5
+#ifndef CONFIG_TARGET_AST_G5
 	/* AST2300 max clk to 125Mhz, AST2400 max clk to 198Mhz */
 
 	/* RGMII --> H-PLL/6 */
@@ -156,7 +155,7 @@ void ast_scu_init_eth(u8 num)
  */
 void ast_scu_spi_master(u8 mode)
 {
-#ifdef AST_SOC_G5
+#ifdef CONFIG_TARGET_AST_G5
 	switch (mode) {
 	case 0:
 		ast_scu_write(SCU_HW_STRAP_SPI_MODE_MASK, AST_SCU_REVISION_ID);
@@ -199,6 +198,10 @@ void ast_scu_spi_master(u8 mode)
 #endif
 }
 
+#define AST_PLL_25MHZ			25000000
+#define AST_PLL_24MHZ			24000000
+#define AST_PLL_12MHZ			12000000
+
 u32 ast_get_clk_source(void)
 {
 	if (ast_scu_read(AST_SCU_HW_STRAP1) & CLK_25M_IN)
@@ -207,7 +210,7 @@ u32 ast_get_clk_source(void)
 		return AST_PLL_24MHZ;
 }
 
-#if defined(AST_SOC_G5)
+#if defined(CONFIG_TARGET_AST_G5)
 
 u32 ast_get_h_pll_clk(void)
 {
@@ -250,7 +253,7 @@ u32 ast_get_ahbclk(void)
 	return ((hpll / axi_div) / ahb_div);
 }
 
-#else /* ! AST_SOC_G5 */
+#else /* ! CONFIG_TARGET_AST_G5 */
 
 u32 ast_get_h_pll_clk(void)
 {
@@ -316,12 +319,12 @@ u32 ast_get_ahbclk(void)
 	return (hpll / div);
 }
 
-#endif /* AST_SOC_G5 */
+#endif /* CONFIG_TARGET_AST_G5 */
 
 void ast_scu_show_system_info(void)
 {
 
-#ifdef AST_SOC_G5
+#ifdef CONFIG_TARGET_AST_G5
 	unsigned int axi_div, ahb_div, h_pll;
 
 	h_pll = ast_get_h_pll_clk();
@@ -366,7 +369,7 @@ void ast_scu_multi_func_eth(u8 num)
 				      AST_SCU_FUN_PIN_CTRL1);
 		}
 
-#ifdef AST_SOC_G5
+#ifdef CONFIG_TARGET_AST_G5
 		ast_scu_write(ast_scu_read(AST_SCU_FUN_PIN_CTRL1) |
 			      SCU_FUN_PIN_MAC0_PHY_LINK, AST_SCU_FUN_PIN_CTRL1);
 
arch/arm/mach-aspeed/cpuinfo.c +2 -3
index 45f70a81833f..72f198587f41 100644
@@ -8,7 +8,6 @@
 #include <asm/io.h>
 #include <asm/arch/ast_scu.h>
 #include <asm/arch/ast-sdmc.h>
-#include <asm/arch/aspeed.h>
 
 #if defined(CONFIG_DISPLAY_CPUINFO)
 int print_cpuinfo(void)
@@ -20,12 +19,12 @@ int print_cpuinfo(void)
 
 	ast_scu_sys_rest_info();
 
-#ifdef AST_SOC_G5
+#ifdef CONFIG_TARGET_AST_G5
 	ast_scu_security_info();
 #endif
 	printf("PLL :   %4s MHz\n", strmhz(buf, ast_get_clk_source()));
 	printf("CPU :   %4s MHz\n", strmhz(buf, ast_get_h_pll_clk()));
-#ifdef AST_SOC_G5
+#ifdef CONFIG_TARGET_AST_G5
 	printf("MEM :	%4s MHz, EEC: %s, Cache: %s \n",
 	       strmhz(buf, ast_get_m_pll_clk() * 2),
 	       ast_sdmc_get_eec() ? "Enable" : "Disable",
arch/arm/mach-aspeed/flash.c +1 -2
index 01c5354b66d4..327aacb00c8f 100644
@@ -31,7 +31,6 @@
 #include <environment.h>
 
 #include <asm/arch/ast_scu.h>
-#include <asm/arch/aspeed.h>
 
 
 /*
@@ -1277,7 +1276,7 @@ static ulong flash_get_size (ulong base, flash_info_t *info)
 		write_status_register(info, 0x40);	/* enable QE */
 
 	if (info->address32) {
-#ifndef AST_SOC_G5
+#ifndef CONFIG_TARGET_AST_G5
 		reg = *((volatile ulong*) 0x1e6e2070);	/* set H/W Trappings */
 		reg |= 0x10;
 		*((volatile ulong*) 0x1e6e2070) = reg;
board/aspeed/ast-g4/ast-g4.c +0 -1
index cc26a78529bc..84bdd39f2cac 100644
@@ -8,7 +8,6 @@
 #include <common.h>
 #include <netdev.h>
 
-#include <asm/arch/platform.h>
 #include <asm/arch/ast-sdmc.h>
 #include <asm/arch/ast_scu.h>
 #include <asm/arch/regs-ahbc.h>
drivers/net/ftgmac100.c +0 -1
index 9d5ba98243ec..16cfac87cb8e 100644
@@ -20,7 +20,6 @@
 #include <i2c.h>
 
 #include <asm/arch/ast_scu.h>
-#include <asm/arch/aspeed.h>
 
 #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
 #include <miiphy.h>
include/configs/ast-common.h +0 -2
index d0638158ab25..7725c1af173f 100644
@@ -19,8 +19,6 @@
 #define CONFIG_ARCH_CPU_INIT
 #define CONFIG_MACH_TYPE		MACH_TYPE_ASPEED
 
-#include <asm/arch/platform.h>
-
 /* Misc CPU related */
 #define CONFIG_CMDLINE_TAG		/* enable passing of ATAGs */
 #define CONFIG_SETUP_MEMORY_TAGS
include/configs/ast-g4-ncsi.h +1 -1
index 31aa9fe1fec6..9a17a3bd0cd3 100644
@@ -11,11 +11,11 @@
 #ifndef __AST_G4_NCSI_CONFIG_H
 #define __AST_G4_NCSI_CONFIG_H
 
-#define CONFIG_ARCH_AST2400
 #define CONFIG_SYS_LOAD_ADDR		0x43000000
 
 #define CONFIG_MISC_INIT_R
 
+#include <asm/arch/ast2400_platform.h>
 #include <configs/ast-common.h>
 
 /* Ethernet */
include/configs/ast-g4-phy.h +1 -1
index 185553864f3f..250abf5a2f44 100644
@@ -11,11 +11,11 @@
 #ifndef __AST_G4_NCSI_CONFIG_H
 #define __AST_G4_NCSI_CONFIG_H
 
-#define CONFIG_ARCH_AST2400
 #define CONFIG_SYS_LOAD_ADDR		0x43000000
 
 #define CONFIG_MISC_INIT_R
 
+#include <asm/arch/ast2400_platform.h>
 #include <configs/ast-common.h>
 
 /* Ethernet */
include/configs/ast-g5-ncsi.h +1 -1
index f73a8f11507b..907ff9a5bb9d 100644
@@ -11,9 +11,9 @@
 #ifndef __AST_G5_NCSI_CONFIG_H
 #define __AST_G5_NCSI_CONFIG_H
 
-#define CONFIG_ARCH_AST2500
 #define CONFIG_SYS_LOAD_ADDR		0x83000000
 
+#include <asm/arch/ast_g5_platform.h>
 #include <configs/ast-common.h>
 
 /* arm1176/start.S */
include/configs/ast-g5-phy.h +1 -1
index 9b10d06212e7..738fb93419f4 100644
@@ -11,9 +11,9 @@
 #ifndef __AST_G5_PHY_CONFIG_H
 #define __AST_G5_PHY_CONFIG_H
 
-#define CONFIG_ARCH_AST2500
 #define CONFIG_SYS_LOAD_ADDR		0x83000000
 
+#include <asm/arch/ast_g5_platform.h>
 #include <configs/ast-common.h>
 
 /* arm1176/start.S */
Signature · 1 line
2.7.4
maintainer Reviewed-by on v1 3/12
#6 lore raw

Re: [PATCH u-boot 03/12] aspeed: use CONFIG_TARGET_AST_G{4,5}

Quoted 5 lines · Cédric Le Goater

The generated config with the SoC definitions is included in each file at compile time. So we can remove the AST_SOC_G* define which are redundant.

Quoted 20 lines
---
 arch/arm/include/asm/arch-aspeed/aspeed.h    | 29 --------------
 arch/arm/include/asm/arch-aspeed/ast-ahbc.h  |  2 +-
 arch/arm/include/asm/arch-aspeed/platform.h  | 10 +----
 arch/arm/include/asm/arch-aspeed/regs-ahbc.h |  4 +-
 arch/arm/include/asm/arch-aspeed/regs-scu.h  | 56 ++++++++++++++--------------
 arch/arm/mach-aspeed/Makefile                |  4 +-
 arch/arm/mach-aspeed/ast-ahbc.c              |  5 +--
 arch/arm/mach-aspeed/ast-scu.c               | 19 ++++++----
 arch/arm/mach-aspeed/cpuinfo.c               |  5 +--
 arch/arm/mach-aspeed/flash.c                 |  3 +-
 board/aspeed/ast-g4/ast-g4.c                 |  1 -
 drivers/net/ftgmac100.c                      |  1 -
 include/configs/ast-common.h                 |  2 -
 include/configs/ast-g4-ncsi.h                |  2 +-
 include/configs/ast-g4-phy.h                 |  2 +-
 include/configs/ast-g5-ncsi.h                |  2 +-
 include/configs/ast-g5-phy.h                 |  2 +-
 17 files changed, 53 insertions(+), 96 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-aspeed/aspeed.h
#7 lore raw

PATCH 4/12 aspeed: remove CONFIG_SYS_INIT_RAM_END

In reply to Cédric Le Goater
---
 include/configs/ast-common.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
include/configs/ast-common.h +4 -2
index 7725c1af173f..a93dc61f3730 100644
@@ -32,8 +32,10 @@
 #define CONFIG_SYS_SDRAM_BASE		AST_DRAM_BASE
 #define CONFIG_SYS_INIT_RAM_ADDR	CONFIG_SYS_SDRAM_BASE
 #define CONFIG_SYS_INIT_RAM_SIZE	(32*1024)
-#define CONFIG_SYS_INIT_RAM_END		(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE)
-#define CONFIG_SYS_INIT_SP_ADDR 	(CONFIG_SYS_INIT_RAM_END - GENERATED_GBL_DATA_SIZE)
+#define CONFIG_SYS_INIT_SP_OFFSET				\
+	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
+#define CONFIG_SYS_INIT_SP_ADDR					\
+	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
 
 #define CONFIG_NR_DRAM_BANKS		1
 
Signature · 1 line
2.7.4
#9 lore raw

PATCH 5/12 aspeed: replace CONFIG_ASPEED_TIMER_CLK with CONFIG_TIMER_CLK_FREQ

In reply to Cédric Le Goater
---
 arch/arm/mach-aspeed/timer.c | 6 +++---
 include/configs/ast-common.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-aspeed/timer.c +3 -3
index 626f992429b6..3755238f173c 100644
@@ -20,12 +20,12 @@
 
 #include <common.h>
 
-#if CONFIG_ASPEED_TIMER_CLK < CONFIG_SYS_HZ
-#error "CONFIG_ASPEED_TIMER_CLK must be as large as CONFIG_SYS_HZ"
+#if CONFIG_TIMER_CLK_FREQ < CONFIG_SYS_HZ
+#error "CONFIG_TIMER_CLK_FREQ must be as large as CONFIG_SYS_HZ"
 #endif
 
 #define TIMER_LOAD_VAL 0xffffffff
-#define CLK_PER_HZ (CONFIG_ASPEED_TIMER_CLK / CONFIG_SYS_HZ)
+#define CLK_PER_HZ (CONFIG_TIMER_CLK_FREQ / CONFIG_SYS_HZ)
 
 /* macro to read the 32 bit timer */
 #define READ_CLK (*(volatile ulong *)(AST_TIMER_BASE + 0))
include/configs/ast-common.h +1 -1
index a93dc61f3730..a663d76407cb 100644
@@ -43,7 +43,7 @@
 
 #define CONFIG_SYS_MALLOC_LEN   	(0x1000 + 4*1024*1024) /* malloc() len */
 
-#define CONFIG_ASPEED_TIMER_CLK		(1*1000*1000)	/* use external clk (1M) */
+#define CONFIG_TIMER_CLK_FREQ		(1*1000*1000)	/* use external clk (1M) */
 
 /*
  * NS16550 Configuration
Signature · 1 line
2.7.4
#11 lore raw

PATCH 6/12 aspeed: timer cleanups

In reply to Cédric Le Goater

The code should not use static as it is relocated at init time. Also add some definitions on the bits used to configure timer 1.

---
 arch/arm/mach-aspeed/timer.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)
arch/arm/mach-aspeed/timer.c +17 -4
index 3755238f173c..9ab4b3fa125d 100644
@@ -27,17 +27,30 @@
 #define TIMER_LOAD_VAL 0xffffffff
 #define CLK_PER_HZ (CONFIG_TIMER_CLK_FREQ / CONFIG_SYS_HZ)
 
+/* Clock selection for Timer/Counter #1
+ * Counter is base on the selected clock to count down
+ *
+ * 0: APB clock (PCLK)
+ * 1: External clock (1 MHz)
+ */
+#define TIMER_CLK_SELECT	0x2
+/* Timer enable for Timer/Counter #1 */
+#define TIMER_ENABLE		0x1
+
 /* macro to read the 32 bit timer */
 #define READ_CLK (*(volatile ulong *)(AST_TIMER_BASE + 0))
 #define READ_TIMER (READ_CLK / CLK_PER_HZ)
 
-static ulong timestamp;
-static ulong lastdec;
+DECLARE_GLOBAL_DATA_PTR;
+
+#define timestamp	(gd->arch.tbl)
+#define lastdec		(gd->arch.lastinc)
 
 int timer_init (void)
 {
 	*(volatile ulong *)(AST_TIMER_BASE + 4)    = TIMER_LOAD_VAL;
-	*(volatile ulong *)(AST_TIMER_BASE + 0x30) = 0x3; /* enable timer1 */
+	*(volatile ulong *)(AST_TIMER_BASE + 0x30) =
+		TIMER_ENABLE|TIMER_CLK_SELECT;
 
 	/* init the timestamp and lastdec value */
 	reset_timer_masked();
@@ -118,7 +131,7 @@ ulong get_timer_masked (void)
 /* waits specified delay value and resets timestamp */
 void udelay_masked (unsigned long usec)
 {
-  __udelay(usec);
+	__udelay(usec);
 }
 
 /*
Signature · 1 line
2.7.4
maintainer Reviewed-by on v1 6/12
#12 lore raw

Re: [PATCH u-boot 06/12] aspeed: timer cleanups

Quoted 3 lines · Cédric Le Goater

The code should not use static as it is relocated at init time. Also add some definitions on the bits used to configure timer 1.

Unrelated to this patch; would reusing the Linux driver in u-boot be a good idea?

Quoted 1 line
Quoted 3 lines
---
 arch/arm/mach-aspeed/timer.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)
#13 lore raw

Re: [PATCH u-boot 06/12] aspeed: timer cleanups

Quoted 7 lines · Joel Stanley
Quoted 3 lines · Cédric Le Goater

The code should not use static as it is relocated at init time. Also add some definitions on the bits used to configure timer 1.

Unrelated to this patch; would reusing the Linux driver in u-boot be a good idea?

I remember having done a relatively quick copy/paste for what we have in uboot. So yes, It is worth a check.

Thanks

C.

#14 lore raw

PATCH 7/12 aspeed: add configuration for the network devices

In reply to Cédric Le Goater
---
 configs/ast_g4_ncsi_defconfig |  2 ++
 configs/ast_g4_phy_defconfig  |  3 +++
 configs/ast_g5_ncsi_defconfig |  2 ++
 configs/ast_g5_phy_defconfig  |  3 +++
 drivers/net/Kconfig           | 19 ++++++++++++++++++-
 include/configs/ast-g4-ncsi.h |  4 ----
 include/configs/ast-g4-phy.h  |  2 --
 include/configs/ast-g5-ncsi.h |  4 ----
 include/configs/ast-g5-phy.h  |  2 --
 9 files changed, 28 insertions(+), 13 deletions(-)
configs/ast_g4_ncsi_defconfig +2 -0
index 0314af82c37e..fb56224b095c 100644
@@ -6,3 +6,5 @@ CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_SPI_FLASH=y
 CONFIG_SYS_NS16550=y
+CONFIG_NETDEVICES=y
+CONFIG_ASPEEDNIC=y
configs/ast_g4_phy_defconfig +3 -0
index 7e9e5712a9ef..e5e22fa6d9c0 100644
@@ -7,3 +7,6 @@ CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_SPI_FLASH=y
 CONFIG_SYS_NS16550=y
+CONFIG_NETDEVICES=y
+CONFIG_FTGMAC100=y
+CONFIG_FTGMAC100_EGIGA=y
configs/ast_g5_ncsi_defconfig +2 -0
index b1f4f185a53f..094f22526a47 100644
@@ -6,3 +6,5 @@ CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_SPI_FLASH=y
 CONFIG_SYS_NS16550=y
+CONFIG_NETDEVICES=y
+CONFIG_ASPEEDNIC=y
configs/ast_g5_phy_defconfig +3 -0
index 63ff21f65f71..b952b118ef7f 100644
@@ -7,3 +7,6 @@ CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_SPI_FLASH=y
 CONFIG_SYS_NS16550=y
+CONFIG_NETDEVICES=y
+CONFIG_FTGMAC100=y
+CONFIG_FTGMAC100_EGIGA=y
drivers/net/Kconfig +18 -1
index b8ccd92184cf..ed152296ded3 100644
@@ -199,10 +199,27 @@ config PIC32_ETH
 
 config ASPEEDNIC
 	bool "Aspeed ethernet support"
-	depends on MACH_ARM
+	depends on ARCH_ASPEED
 	select PHYLIB
 	help
 	  Network support for the Aspeed ast2400 and ast2500 series network
 	  devices including NC-SI support.
 
+config FTGMAC100
+	bool "Faraday's FTGMAC100 Gigabit SoC Ethernet"
+	select PHYLIB
+	select MII
+	help
+	  Support for Faraday's FTGMAC100 Gigabit SoC Ethernet
+
+config FTGMAC100_EGIGA
+	bool "Define this if FTGMAC100 is connected to gigabit PHY"
+	depends on FTGMAC100
+	help
+	  If your system has 10/100 PHY only, it might not occur wrong
+	  behavior. Because PHY usually return timeout or useless data
+	  when polling gigabit status and gigabit control registers.
+	  This behavior won't affect the correctness of 10/100 link
+	  speed update.
+
 endif # NETDEVICES
include/configs/ast-g4-ncsi.h +0 -4
index 9a17a3bd0cd3..bd7ca818db87 100644
@@ -18,9 +18,5 @@
 #include <asm/arch/ast2400_platform.h>
 #include <configs/ast-common.h>
 
-/* Ethernet */
-#define CONFIG_LIB_RAND
-#define CONFIG_ASPEEDNIC
-
 
 #endif	/* __AST_G4_NCSI_CONFIG_H */
include/configs/ast-g4-phy.h +0 -2
index 250abf5a2f44..c0208625c9ab 100644
@@ -20,9 +20,7 @@
 
 /* Ethernet */
 #define CONFIG_MAC_NUM			2
-#define CONFIG_FTGMAC100
 #define CONFIG_PHY_MAX_ADDR		32
-#define CONFIG_FTGMAC100_EGIGA
 
 
 #endif	/* __AST_G4_NCSI_CONFIG_H */
include/configs/ast-g5-ncsi.h +0 -4
index 907ff9a5bb9d..049d1a5b0be8 100644
@@ -19,10 +19,6 @@
 /* arm1176/start.S */
 #define CONFIG_SYS_UBOOT_BASE		CONFIG_SYS_TEXT_BASE
 
-/* Ethernet */
-#define CONFIG_LIB_RAND
-#define CONFIG_ASPEEDNIC
-
 /* platform.S settings */
 #define	CONFIG_DRAM_ECC_SIZE		0x10000000
 
include/configs/ast-g5-phy.h +0 -2
index 738fb93419f4..1d8aad815d02 100644
@@ -21,9 +21,7 @@
 
 /* Ethernet */
 #define CONFIG_MAC_NUM			2
-#define CONFIG_FTGMAC100
 #define CONFIG_PHY_MAX_ADDR		32
-#define CONFIG_FTGMAC100_EGIGA
 
 /* platform.S */
 #define	CONFIG_DRAM_ECC_SIZE		0x10000000
Signature · 1 line
2.7.4
maintainer Reviewed-by on v1 7/12
#15 lore raw

Re: [PATCH u-boot 07/12] aspeed: add configuration for the network devices

Quoted 1 line · Cédric Le Goater
Quoted 7 lines
drivers/net/Kconfig +7 -0
+config FTGMAC100
+       bool "Faraday's FTGMAC100 Gigabit SoC Ethernet"
+       select PHYLIB
+       select MII
+       help
+         Support for Faraday's FTGMAC100 Gigabit SoC Ethernet
+

drivers/net/Kconfig config PIC32_ETH · line 224

Quoted 10 lines
drivers/net/Kconfig +10 -0
+config FTGMAC100_EGIGA
+       bool "Define this if FTGMAC100 is connected to gigabit PHY"
+       depends on FTGMAC100
+       help
+         If your system has 10/100 PHY only, it might not occur wrong
+         behavior. Because PHY usually return timeout or useless data
+         when polling gigabit status and gigabit control registers.
+         This behavior won't affect the correctness of 10/100 link
+         speed update.
+

Are we able to fix this in the future?

#16 lore raw

PATCH 8/12 aspeed: remove CONFIG_MAC_NUM

In reply to Cédric Le Goater

and use the standard CONFIG_HAS_ETHX instead.

---
 drivers/net/ftgmac100.c       | 11 +++++------
 include/configs/ast-g4-ncsi.h |  4 ++++
 include/configs/ast-g4-phy.h  |  3 ++-
 include/configs/ast-g5-ncsi.h |  4 ++++
 include/configs/ast-g5-phy.h  |  3 ++-
 5 files changed, 17 insertions(+), 8 deletions(-)
drivers/net/ftgmac100.c +5 -6
index 16cfac87cb8e..b690e6c2330c 100644
@@ -747,14 +747,13 @@ int ftgmac100_initialize(bd_t *bd)
 
 #if 1   //Ryan Chen for more mac use
 	int i, card_number = 0, mac_no;
-	unsigned int			iobase[CONFIG_MAC_NUM];
+	unsigned int iobase[2] = { AST_MAC0_BASE, AST_MAC1_BASE };
 
-	mac_no = CONFIG_MAC_NUM;
-	iobase[0] = AST_MAC0_BASE;
-
-#ifdef AST_MAC1_BASE
-	iobase[1] = AST_MAC1_BASE;
+	mac_no = 1;
+#ifdef CONFIG_HAS_ETH1
+	mac_no++;
 #endif
+
 	for (i = 0; i < mac_no; i++)
 	{
 		ast_scu_multi_func_eth(i);
include/configs/ast-g4-ncsi.h +4 -0
index bd7ca818db87..43787f39ac90 100644
@@ -18,5 +18,9 @@
 #include <asm/arch/ast2400_platform.h>
 #include <configs/ast-common.h>
 
+/* Ethernet */
+#define CONFIG_HAS_ETH0
+#define CONFIG_HAS_ETH1
+
 
 #endif	/* __AST_G4_NCSI_CONFIG_H */
include/configs/ast-g4-phy.h +2 -1
index c0208625c9ab..66881f6cb8be 100644
@@ -19,7 +19,8 @@
 #include <configs/ast-common.h>
 
 /* Ethernet */
-#define CONFIG_MAC_NUM			2
+#define CONFIG_HAS_ETH0
+#define CONFIG_HAS_ETH1
 #define CONFIG_PHY_MAX_ADDR		32
 
 
include/configs/ast-g5-ncsi.h +4 -0
index 049d1a5b0be8..486fe28152c2 100644
@@ -19,6 +19,10 @@
 /* arm1176/start.S */
 #define CONFIG_SYS_UBOOT_BASE		CONFIG_SYS_TEXT_BASE
 
+/* Ethernet */
+#define CONFIG_HAS_ETH0
+#define CONFIG_HAS_ETH1
+
 /* platform.S settings */
 #define	CONFIG_DRAM_ECC_SIZE		0x10000000
 
include/configs/ast-g5-phy.h +2 -1
index 1d8aad815d02..1cd0387b0508 100644
@@ -20,7 +20,8 @@
 #define CONFIG_SYS_UBOOT_BASE		CONFIG_SYS_TEXT_BASE
 
 /* Ethernet */
-#define CONFIG_MAC_NUM			2
+#define CONFIG_HAS_ETH0
+#define CONFIG_HAS_ETH1
 #define CONFIG_PHY_MAX_ADDR		32
 
 /* platform.S */
Signature · 1 line
2.7.4
maintainer Reviewed-by on v1 8/12
#17 lore raw

Re: [PATCH u-boot 08/12] aspeed: remove CONFIG_MAC_NUM

Quoted 3 lines · Cédric Le Goater

and use the standard CONFIG_HAS_ETHX instead.

Quoted 7 lines
---
 drivers/net/ftgmac100.c       | 11 +++++------
 include/configs/ast-g4-ncsi.h |  4 ++++
 include/configs/ast-g4-phy.h  |  3 ++-
 include/configs/ast-g5-ncsi.h |  4 ++++
 include/configs/ast-g5-phy.h  |  3 ++-
 5 files changed, 17 insertions(+), 8 deletions(-)
#18 lore raw

PATCH 9/12 aspeed: add CONFIG_DRAM_ECC

In reply to Cédric Le Goater

There is still a warning I need to get rid of :

board/aspeed/ast-g5/Kconfig:22:warning: config symbol defined without type

---
 board/aspeed/ast-g5/Kconfig   | 9 +++++++++
 include/configs/ast-g5-ncsi.h | 3 ---
 include/configs/ast-g5-phy.h  | 3 ---
 3 files changed, 9 insertions(+), 6 deletions(-)
board/aspeed/ast-g5/Kconfig +9 -0
index b809a6b1750f..b8e10686e369 100644
@@ -13,4 +13,13 @@ config SYS_CONFIG_NAME
 	default "ast-g5-phy" if ASPEED_NET_PHY
 	default "ast-g5-ncsi" if ASPEED_NET_NCSI
 
+config DRAM_ECC
+	bool "Enable ECC function"
+	default n
+	help
+	  Enable ECC function on Aspeed SoC AST2500
+
+config DRAM_ECC_SIZE
+	default 0x10000000
+
 endif
include/configs/ast-g5-ncsi.h +0 -3
index 486fe28152c2..06574b5432f0 100644
@@ -23,7 +23,4 @@
 #define CONFIG_HAS_ETH0
 #define CONFIG_HAS_ETH1
 
-/* platform.S settings */
-#define	CONFIG_DRAM_ECC_SIZE		0x10000000
-
 #endif	/* __AST_G5_NCSI_CONFIG_H */
include/configs/ast-g5-phy.h +0 -3
index 1cd0387b0508..469ef01e31f2 100644
@@ -24,7 +24,4 @@
 #define CONFIG_HAS_ETH1
 #define CONFIG_PHY_MAX_ADDR		32
 
-/* platform.S */
-#define	CONFIG_DRAM_ECC_SIZE		0x10000000
-
 #endif	/* __AST_G5_PHY_CONFIG_H */
Signature · 1 line
2.7.4
maintainer Reviewed-by on v1 9/12
#19 lore raw

Re: [PATCH u-boot 09/12] aspeed: add CONFIG_DRAM_ECC

Quoted 5 lines · Cédric Le Goater

There is still a warning I need to get rid of :

board/aspeed/ast-g5/Kconfig:22:warning: config symbol defined without type

Quoted 5 lines
---
 board/aspeed/ast-g5/Kconfig   | 9 +++++++++
 include/configs/ast-g5-ncsi.h | 3 ---
 include/configs/ast-g5-phy.h  | 3 ---
 3 files changed, 9 insertions(+), 6 deletions(-)
#20 lore raw

PATCH 10/12 aspeed: remove CONFIG_PHY_MAX_ADDR

In reply to Cédric Le Goater

PHY_MAX_ADDR has the same value

---
 drivers/net/ftgmac100.c      | 3 ++-
 include/configs/ast-g4-phy.h | 2 --
 include/configs/ast-g5-phy.h | 1 -
 3 files changed, 2 insertions(+), 4 deletions(-)
drivers/net/ftgmac100.c +2 -1
index b690e6c2330c..f82ea5f35e89 100644
@@ -16,6 +16,7 @@
 #include <net.h>
 #include <asm/io.h>
 #include <linux/mii.h>
+#include <phy.h>
 
 #include <i2c.h>
 
@@ -306,7 +307,7 @@ static int ftgmac100_phy_init(struct eth_device *dev)
 	int i;
 
 	/* Check if the PHY is up to snuff... */
-	for (phy_addr = 0; phy_addr < CONFIG_PHY_MAX_ADDR; phy_addr++) {
+	for (phy_addr = 0; phy_addr < PHY_MAX_ADDR; phy_addr++) {
 
 		ftgmac100_phy_read(dev, phy_addr, MII_PHYSID1, &phy_id1);
 		ftgmac100_phy_read(dev, phy_addr, MII_PHYSID2, &phy_id2);
include/configs/ast-g4-phy.h +0 -2
index 66881f6cb8be..8e1ce2bfd10b 100644
@@ -21,7 +21,5 @@
 /* Ethernet */
 #define CONFIG_HAS_ETH0
 #define CONFIG_HAS_ETH1
-#define CONFIG_PHY_MAX_ADDR		32
-
 
 #endif	/* __AST_G4_NCSI_CONFIG_H */
include/configs/ast-g5-phy.h +0 -1
index 469ef01e31f2..c10767467bb9 100644
@@ -22,6 +22,5 @@
 /* Ethernet */
 #define CONFIG_HAS_ETH0
 #define CONFIG_HAS_ETH1
-#define CONFIG_PHY_MAX_ADDR		32
 
 #endif	/* __AST_G5_PHY_CONFIG_H */
Signature · 1 line
2.7.4
maintainer Reviewed-by on v1 10/12
#21 lore raw

Re: [PATCH u-boot 10/12] aspeed: remove CONFIG_PHY_MAX_ADDR

Quoted 3 lines · Cédric Le Goater

PHY_MAX_ADDR has the same value

Quoted 5 lines
---
 drivers/net/ftgmac100.c      | 3 ++-
 include/configs/ast-g4-phy.h | 2 --
 include/configs/ast-g5-phy.h | 1 -
 3 files changed, 2 insertions(+), 4 deletions(-)
#22 lore raw

PATCH 11/12 bootm: fix ramdisk relocation

In reply to Cédric Le Goater

We are working on bringing to mainline a set of changes adding support for the Aspeed SoC and we have a couple of work around we are trying to elimitate first. This is one of them. The ramdisk is not relocated and Linux fails to boot. The current port does not use a device tree (yet) so that might be the most obvious culprit.

Thanks

---
 cmd/bootm.c | 3 +++
 1 file changed, 3 insertions(+)
cmd/bootm.c +3 -0
index e02a1c54b70c..9184fd379f95 100644
@@ -126,6 +126,9 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	return do_bootm_states(cmdtp, flag, argc, argv, BOOTM_STATE_START |
 		BOOTM_STATE_FINDOS | BOOTM_STATE_FINDOTHER |
 		BOOTM_STATE_LOADOS |
+#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
+		BOOTM_STATE_RAMDISK |
+#endif
 #if defined(CONFIG_PPC) || defined(CONFIG_MIPS)
 		BOOTM_STATE_OS_CMDLINE |
 #endif
Signature · 1 line
2.7.4
maintainer
#23 lore raw

Re: [PATCH u-boot 11/12] bootm: fix ramdisk relocation

Quoted 9 lines · Cédric Le Goater

We are working on bringing to mainline a set of changes adding support for the Aspeed SoC and we have a couple of work around we are trying to elimitate first. This is one of them. The ramdisk is not relocated and Linux fails to boot. The current port does not use a device tree (yet) so that might be the most obvious culprit.

Thanks

I see you're chatting with upstream about this one.

Do you want me to include this in our tree for now, or wait for the outcome of those discussions?

Cheers,

Joel

#24 lore raw

Re: [PATCH u-boot 11/12] bootm: fix ramdisk relocation

Quoted 7 lines · Joel Stanley
Quoted 6 lines · Cédric Le Goater

We are working on bringing to mainline a set of changes adding support for the Aspeed SoC and we have a couple of work around we are trying to elimitate first. This is one of them. The ramdisk is not relocated and Linux fails to boot. The current port does not use a device tree (yet) so that might be the most obvious culprit.

Quoted 8 lines
Quoted 3 lines

Thanks

I see you're chatting with upstream about this one.

Do you want me to include this in our tree for now, or wait for the outcome of those discussions?

Let's wait. The current hack does exactly what Linux needs, which is to load the ramdisk at the load address of the ramdisk image.

This patch enables loading but on some occasion, the ramdisk can be loaded in conflicting memblocks for Linux, which then disables INITRD ... So we need to do better than that.

C.

#25 lore raw

PATCH 12/12 aspeed: remove hack loading ramdisk in memory

In reply to Cédric Le Goater
---
 common/image.c | 11 -----------
 1 file changed, 11 deletions(-)
common/image.c +0 -11
index 64e5c668f52a..7ad04ca19b80 100644
@@ -1151,17 +1151,6 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,
 				return 1;
 			}
 		}
-/// TODO ... Check Why ..................
-#if  defined(CONFIG_ARCH_ASPEED)
-		/*
-		 * We need to copy the ramdisk to SRAM to let Linux boot
-		 */
-		if (rd_data) {
-			memmove ((void *)rd_load, (uchar *)rd_data, rd_len);
-			rd_data = rd_load;
-		}
-#endif /* CONFIG_ASPEED */
-
 	} else if (images->legacy_hdr_valid &&
 			image_check_type(&images->legacy_hdr_os_copy,
 						IH_TYPE_MULTI)) {
Signature · 1 line
2.7.4
#27 lore raw
In reply to Cédric Le Goater
Quoted 4 lines · Cédric Le Goater

Hello,

Here is a set of cleanups on the configuration. It should ease the port on v2016.11 which is a little more strict on CONFIG_ defines.

You will need this patch to start with :

	https://github.com/legoater/u-boot/commit/d76a5e74286cd903c4eb96c3b5f762672121b02a

forgot to send it :/

Thanks,

C.

Quoted 56 lines

I also included a couple of fixes on the timer and ramdisk relocation.

Thanks,

C.

Cédric Le Goater (12):
aspeed: add CONFIG_AST_SPI_NOR
aspeed: rework top level configuration of the Aspeed SoC
aspeed: use CONFIG_TARGET_AST_G{4,5}
aspeed: remove CONFIG_SYS_INIT_RAM_END
aspeed: replace CONFIG_ASPEED_TIMER_CLK with CONFIG_TIMER_CLK_FREQ
aspeed: timer cleanups
aspeed: add configuration for the network devices
aspeed: remove CONFIG_MAC_NUM
aspeed: add CONFIG_DRAM_ECC
aspeed: remove CONFIG_PHY_MAX_ADDR
bootm: fix ramdisk relocation
aspeed: remove hack loading ramdisk in memory

 arch/arm/Kconfig                             | 14 +++----
 arch/arm/include/asm/arch-aspeed/aspeed.h    | 29 --------------
 arch/arm/include/asm/arch-aspeed/ast-ahbc.h  |  2 +-
 arch/arm/include/asm/arch-aspeed/platform.h  | 10 +----
 arch/arm/include/asm/arch-aspeed/regs-ahbc.h |  4 +-
 arch/arm/include/asm/arch-aspeed/regs-scu.h  | 56 ++++++++++++++--------------
 arch/arm/mach-aspeed/Kconfig                 | 50 +++++++++++++++++++++++++
 arch/arm/mach-aspeed/Makefile                |  4 +-
 arch/arm/mach-aspeed/ast-ahbc.c              |  5 +--
 arch/arm/mach-aspeed/ast-scu.c               | 19 ++++++----
 arch/arm/mach-aspeed/cpuinfo.c               |  5 +--
 arch/arm/mach-aspeed/flash.c                 | 21 +----------
 arch/arm/mach-aspeed/timer.c                 | 27 ++++++++++----
 board/aspeed/Kconfig                         | 16 --------
 board/aspeed/ast-g4/Kconfig                  |  6 ---
 board/aspeed/ast-g4/ast-g4.c                 |  1 -
 board/aspeed/ast-g5/Kconfig                  | 15 +++++---
 cmd/bootm.c                                  |  3 ++
 common/image.c                               | 11 ------
 configs/ast_g4_ncsi_defconfig                |  3 ++
 configs/ast_g4_phy_defconfig                 |  4 ++
 configs/ast_g5_ncsi_defconfig                |  3 ++
 configs/ast_g5_phy_defconfig                 |  4 ++
 drivers/net/Kconfig                          | 19 +++++++++-
 drivers/net/ftgmac100.c                      | 15 ++++----
 include/configs/ast-common.h                 | 15 +++-----
 include/configs/ast-g4-ncsi.h                |  6 +--
 include/configs/ast-g4-phy.h                 |  9 ++---
 include/configs/ast-g5-ncsi.h                |  9 ++---
 include/configs/ast-g5-phy.h                 | 11 ++----
 30 files changed, 194 insertions(+), 202 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-aspeed/aspeed.h
 create mode 100644 arch/arm/mach-aspeed/Kconfig
 delete mode 100644 board/aspeed/Kconfig
maintainer
#28 lore raw
Quoted 5 lines · Cédric Le Goater
Quoted 4 lines · Cédric Le Goater

Hello,

Here is a set of cleanups on the configuration. It should ease the port on v2016.11 which is a little more strict on CONFIG_ defines.

Nice one! I had a look at all of the patches and they look good. I will hold off on the last two relating to ramdisk until we see what upstream say.

Quoted 6 lines

You will need this patch to start with :

        https://github.com/legoater/u-boot/commit/d76a5e74286cd903c4eb96c3b5f762672121b02a

forgot to send it :/

No worries, I will include it.

Cheers,

Joel

maintainer
#29 lore raw
Quoted 12 lines · Joel Stanley
Quoted 5 lines · Cédric Le Goater
Quoted 4 lines · Cédric Le Goater

Hello,

Here is a set of cleanups on the configuration. It should ease the port on v2016.11 which is a little more strict on CONFIG_ defines.

Nice one! I had a look at all of the patches and they look good. I will hold off on the last two relating to ramdisk until we see what upstream say.

Quoted 1 line
Quoted 7 lines
Quoted 5 lines

You will need this patch to start with :

        https://github.com/legoater/u-boot/commit/d76a5e74286cd903c4eb96c3b5f762672121b02a

forgot to send it :/

No worries, I will include it.

I can't build the defconfig after applying your patches. I get the same result with your trees (05fffe5dc0ec39a11c918d1916d349708cd67cf8, 2d1d53622d3155193832992a11d84775e44190cf).

$ make ast_g4_nsci_defconfig
board/aspeed/ast-g5/Kconfig:22:warning: config symbol defined without type
***
*** Can't find default configuration "arch/../configs/ast_g4_nsci_defconfig"!
***
scripts/kconfig/Makefile:114: recipe for target 'ast_g4_nsci_defconfig' failed

Cheers,

Joel

#30 lore raw
Quoted 19 lines · Joel Stanley
Quoted 18 lines · Joel Stanley
Quoted 5 lines · Cédric Le Goater
Quoted 4 lines · Cédric Le Goater

Hello,

Here is a set of cleanups on the configuration. It should ease the port on v2016.11 which is a little more strict on CONFIG_ defines.

Nice one! I had a look at all of the patches and they look good. I will hold off on the last two relating to ramdisk until we see what upstream say.

Quoted 6 lines

You will need this patch to start with :

        https://github.com/legoater/u-boot/commit/d76a5e74286cd903c4eb96c3b5f762672121b02a

forgot to send it :/

Quoted 8 lines
Quoted 1 line

No worries, I will include it.

I can't build the defconfig after applying your patches. I get the same result with your trees (05fffe5dc0ec39a11c918d1916d349708cd67cf8, 2d1d53622d3155193832992a11d84775e44190cf).

$ make ast_g4_nsci_defconfig
board/aspeed/ast-g5/Kconfig:22:warning: config symbol defined without type

Yes. There is a warning. I tried to add some constants in the config file but I am not sure this is the right way to do it.

Quoted 4 lines

***
*** Can't find default configuration "arch/../configs/ast_g4_nsci_defconfig"!
***
scripts/kconfig/Makefile:114: recipe for target 'ast_g4_nsci_defconfig' failed

hmm curious. I don't have this problem on the four platforms:

	ast2400_ncsi
	ast2400_phy
	ast2500_ncsi
	ast2500_phy

and the two branches,

	v2016.11-aspeed-openbmc
	v2016.09-aspeed-openbmc

I am using a f24 to compile.

Cheers,

C.

#31 lore raw
In reply to Joel Stanley
Quoted 8 lines · Joel Stanley
Quoted 5 lines · Cédric Le Goater
Quoted 4 lines · Cédric Le Goater

Hello,

Here is a set of cleanups on the configuration. It should ease the port on v2016.11 which is a little more strict on CONFIG_ defines.

Nice one! I had a look at all of the patches and they look good.

The goal of the clean up is to reshuffle a bit our patches for upstreaming and have a patchset organized like this:

1 - core enablement G4 + G5 (minimal lowlevel init)
2 - core enablement G4 + G5 (extra lowlevel init)
3 - hacks patch (to fix)
4 - ftgmac100 driver extensions patch
5 - non ncsi platforms patch (should be only defconfigs files) 6 - flash driver patch (needs a rewrite but there are works being done in
that area in mainline)
7 - aspeednic driver patch (should be deprecated one day)
8 - ncsi platforms patch (should be only defconfigs files)

So this is very close to what we have today and the work is mostly on the configuration.

I am not sure about the 1-2 split. This is currently well contained in one routine so it might be better to keep as it is. It would be easier to update also with Aspeed modifications.

Quoted 2 lines

I will hold off on the last two relating to ramdisk until we see what upstream say.

yes. I am not sure where we stand on this.

Uboot code is a bit fuzzy in that area as it seems that legacy images and ATAGS boot are not the most common path. What I found curious is that the load address of the ram disk image is not used at all. I hope the maintainers will clarify a bit what should be done. It should be a "simple".

Quoted 7 lines
Quoted 5 lines

You will need this patch to start with :

        https://github.com/legoater/u-boot/commit/d76a5e74286cd903c4eb96c3b5f762672121b02a

forgot to send it :/

No worries, I will include it.

Thanks,
C.