All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH u-boot 00/12] config cleanups and small fixes
@ 2016-10-06 21:26 Cédric Le Goater
  2016-10-06 21:26 ` [PATCH u-boot 01/12] aspeed: add CONFIG_AST_SPI_NOR Cédric Le Goater
                   ` (12 more replies)
  0 siblings, 13 replies; 32+ messages in thread
From: Cédric Le Goater @ 2016-10-06 21:26 UTC (permalink / raw)
  To: openbmc

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

-- 
2.7.4

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH u-boot 01/12] aspeed: add CONFIG_AST_SPI_NOR
  2016-10-06 21:26 [PATCH u-boot 00/12] config cleanups and small fixes Cédric Le Goater
@ 2016-10-06 21:26 ` Cédric Le Goater
  2016-10-10  6:21   ` Joel Stanley
  2016-10-06 21:26 ` [PATCH u-boot 02/12] aspeed: rework top level configuration of the Aspeed SoC Cédric Le Goater
                   ` (11 subsequent siblings)
  12 siblings, 1 reply; 32+ messages in thread
From: Cédric Le Goater @ 2016-10-06 21:26 UTC (permalink / raw)
  To: openbmc

also remove some useless code related the host SPI PNOR

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 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(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 328dc7fe455a..f155d22b1197 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -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
 
diff --git a/arch/arm/mach-aspeed/flash.c b/arch/arm/mach-aspeed/flash.c
index 9c5ead6fd7ae..01c5354b66d4 100644
--- a/arch/arm/mach-aspeed/flash.c
+++ b/arch/arm/mach-aspeed/flash.c
@@ -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,
diff --git a/board/aspeed/Kconfig b/board/aspeed/Kconfig
index 5d356e297a7d..3dcf1a26d50e 100644
--- a/board/aspeed/Kconfig
+++ b/board/aspeed/Kconfig
@@ -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
diff --git a/include/configs/ast-common.h b/include/configs/ast-common.h
index b39ea33ce710..81befc66cd62 100644
--- a/include/configs/ast-common.h
+++ b/include/configs/ast-common.h
@@ -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)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH u-boot 02/12] aspeed: rework top level configuration of the Aspeed SoC
  2016-10-06 21:26 [PATCH u-boot 00/12] config cleanups and small fixes Cédric Le Goater
  2016-10-06 21:26 ` [PATCH u-boot 01/12] aspeed: add CONFIG_AST_SPI_NOR Cédric Le Goater
@ 2016-10-06 21:26 ` Cédric Le Goater
  2016-10-10  6:22   ` Joel Stanley
  2016-10-06 21:26 ` [PATCH u-boot 03/12] aspeed: use CONFIG_TARGET_AST_G{4,5} Cédric Le Goater
                   ` (10 subsequent siblings)
  12 siblings, 1 reply; 32+ messages in thread
From: Cédric Le Goater @ 2016-10-06 21:26 UTC (permalink / raw)
  To: openbmc

and also add a proper CONFIG_ARCH_ASPEED

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 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%)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index f155d22b1197..b75ff1296cc2 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -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"
 
diff --git a/board/aspeed/Kconfig b/arch/arm/mach-aspeed/Kconfig
similarity index 52%
rename from board/aspeed/Kconfig
rename to arch/arm/mach-aspeed/Kconfig
index 3dcf1a26d50e..316f4c5815e0 100644
--- a/board/aspeed/Kconfig
+++ b/arch/arm/mach-aspeed/Kconfig
@@ -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
diff --git a/board/aspeed/ast-g4/Kconfig b/board/aspeed/ast-g4/Kconfig
index 2bec9a733a92..e0892afbb3a1 100644
--- a/board/aspeed/ast-g4/Kconfig
+++ b/board/aspeed/ast-g4/Kconfig
@@ -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
diff --git a/board/aspeed/ast-g5/Kconfig b/board/aspeed/ast-g5/Kconfig
index 9bd3e7de49a4..b809a6b1750f 100644
--- a/board/aspeed/ast-g5/Kconfig
+++ b/board/aspeed/ast-g5/Kconfig
@@ -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
diff --git a/configs/ast_g4_ncsi_defconfig b/configs/ast_g4_ncsi_defconfig
index 4ee71c5d9a2e..0314af82c37e 100644
--- a/configs/ast_g4_ncsi_defconfig
+++ b/configs/ast_g4_ncsi_defconfig
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_ARCH_ASPEED=y
 CONFIG_TARGET_AST_G4=y
 CONFIG_SYS_PROMPT="ast# "
 CONFIG_CMD_DHCP=y
diff --git a/configs/ast_g4_phy_defconfig b/configs/ast_g4_phy_defconfig
index 61fd69b46897..7e9e5712a9ef 100644
--- a/configs/ast_g4_phy_defconfig
+++ b/configs/ast_g4_phy_defconfig
@@ -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# "
diff --git a/configs/ast_g5_ncsi_defconfig b/configs/ast_g5_ncsi_defconfig
index 6d11afbbc6c1..b1f4f185a53f 100644
--- a/configs/ast_g5_ncsi_defconfig
+++ b/configs/ast_g5_ncsi_defconfig
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_ARCH_ASPEED=y
 CONFIG_TARGET_AST_G5=y
 CONFIG_SYS_PROMPT="ast# "
 CONFIG_CMD_DHCP=y
diff --git a/configs/ast_g5_phy_defconfig b/configs/ast_g5_phy_defconfig
index 20f62e08f540..63ff21f65f71 100644
--- a/configs/ast_g5_phy_defconfig
+++ b/configs/ast_g5_phy_defconfig
@@ -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# "
diff --git a/include/configs/ast-common.h b/include/configs/ast-common.h
index 81befc66cd62..d0638158ab25 100644
--- a/include/configs/ast-common.h
+++ b/include/configs/ast-common.h
@@ -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
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH u-boot 03/12] aspeed: use CONFIG_TARGET_AST_G{4,5}
  2016-10-06 21:26 [PATCH u-boot 00/12] config cleanups and small fixes Cédric Le Goater
  2016-10-06 21:26 ` [PATCH u-boot 01/12] aspeed: add CONFIG_AST_SPI_NOR Cédric Le Goater
  2016-10-06 21:26 ` [PATCH u-boot 02/12] aspeed: rework top level configuration of the Aspeed SoC Cédric Le Goater
@ 2016-10-06 21:26 ` Cédric Le Goater
  2016-10-10  6:22   ` Joel Stanley
  2016-10-06 21:26 ` [PATCH u-boot 04/12] aspeed: remove CONFIG_SYS_INIT_RAM_END Cédric Le Goater
                   ` (9 subsequent siblings)
  12 siblings, 1 reply; 32+ messages in thread
From: Cédric Le Goater @ 2016-10-06 21:26 UTC (permalink / raw)
  To: openbmc

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.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 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

diff --git a/arch/arm/include/asm/arch-aspeed/aspeed.h b/arch/arm/include/asm/arch-aspeed/aspeed.h
deleted file mode 100644
index 7d2de1cbd43e..000000000000
--- a/arch/arm/include/asm/arch-aspeed/aspeed.h
+++ /dev/null
@@ -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
diff --git a/arch/arm/include/asm/arch-aspeed/ast-ahbc.h b/arch/arm/include/asm/arch-aspeed/ast-ahbc.h
index c870d11127b7..a0de8cf14d86 100644
--- a/arch/arm/include/asm/arch-aspeed/ast-ahbc.h
+++ b/arch/arm/include/asm/arch-aspeed/ast-ahbc.h
@@ -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
diff --git a/arch/arm/include/asm/arch-aspeed/platform.h b/arch/arm/include/asm/arch-aspeed/platform.h
index 1c02914fcbdf..f5db09d2a417 100644
--- a/arch/arm/include/asm/arch-aspeed/platform.h
+++ b/arch/arm/include/asm/arch-aspeed/platform.h
@@ -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"
diff --git a/arch/arm/include/asm/arch-aspeed/regs-ahbc.h b/arch/arm/include/asm/arch-aspeed/regs-ahbc.h
index 66e29839e8f1..c867b540dd5e 100644
--- a/arch/arm/include/asm/arch-aspeed/regs-ahbc.h
+++ b/arch/arm/include/asm/arch-aspeed/regs-ahbc.h
@@ -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
diff --git a/arch/arm/include/asm/arch-aspeed/regs-scu.h b/arch/arm/include/asm/arch-aspeed/regs-scu.h
index b714fa92341d..ea1c0932ccc6 100644
--- a/arch/arm/include/asm/arch-aspeed/regs-scu.h
+++ b/arch/arm/include/asm/arch-aspeed/regs-scu.h
@@ -13,8 +13,6 @@
 #ifndef __AST_REGS_SCU_H
 #define __AST_REGS_SCU_H                     1
 
-#include <asm/arch/aspeed.h>
-
 /*
  *  Register for SCU
  */
@@ -33,7 +31,7 @@
 #define AST_SCU_M_PLL		0x20	/* M-PLL Parameter register */
 #define AST_SCU_H_PLL		0x24	/* H-PLL Parameter register */
 #define AST_SCU_MH_PLL_EXTEND	0x148	/* Extended Parameter of M/H-PLL register */
-#ifdef AST_SOC_G5
+#ifdef CONFIG_TARGET_AST_G5
 #define AST_SCU_D_PLL		0x28	/* D-PLL Parameter register */
 #define AST_SCU_D_PLL_EXTEND0	0x130	/* D-PLL Extended Parameter register */
 #define AST_SCU_D_PLL_EXTEND1	0x134	/* D-PLL Extended Parameter register */
@@ -117,7 +115,7 @@
 #define SCU_RESET_P2X			(0x1 << 24)
 #define SCU_RESET_ADC			(0x1 << 23)
 #define SCU_RESET_JTAG			(0x1 << 22)
-#ifdef AST_SOC_G5
+#ifdef CONFIG_TARGET_AST_G5
 #define SCU_RESET_PCIE_DIR		(0x1 << 21)
 #define SCU_RESET_PCIE			(0x1 << 19)
 #else
@@ -176,7 +174,7 @@
 #define SCU_CLK_SD_DIV(x)		(x << 12)
 #define SCU_CLK_SD_GET_DIV(x)		((x >> 12) & 0x7)
 #define SCU_CLK_SD_MASK			(0x7 << 12)
-#if defined(AST_SOC_G5)
+#if defined(CONFIG_TARGET_AST_G5)
 #define SCU_CRT_CLK_L_SOURCE		(0x1 << 8)
 #else
 #define SCU_CLK_VIDEO_DELAY(x)		(x << 8)
@@ -222,7 +220,7 @@
 #define SCU_MAC1CLK_STOP_EN		(0x1 << 21)
 #define SCU_MAC0CLK_STOP_EN		(0x1 << 20)
 //bit 19 must keep 1
-#if defined(AST_SOC_G5)
+#if defined(CONFIG_TARGET_AST_G5)
 #define SCU_ESPI_CLK_STOP_EN		(0x1 << 19)
 #endif
 
@@ -259,7 +257,7 @@
 #define SCU_D2CLK_STOP			(0x1)
 
 /* AST_SCU_COUNT_CTRL 			0x10 - frequency counter control register */
-#if defined(AST_SOC_G5)
+#if defined(CONFIG_TARGET_AST_G5)
 #define SCU_OSC_OUT_EN			(0x1 << 8)
 #endif
 #define SCU_FREQ_COMP_RESULT		(0x1 << 7)
@@ -267,7 +265,7 @@
 #define SCU_FREQ_SOURCE_FOR_MEASU(x)	(x << 2)
 #define SCU_FREQ_SOURCE_FOR_MEASU_MASK	(0xf << 2)
 
-#if defined(AST_SOC_G5)
+#if defined(CONFIG_TARGET_AST_G5)
 #define SCU_SOURCE_PCLK			0xf
 #define SCU_SOURCE_VPACLK		0xe
 #define SCU_SOURCE_VPBCLK		0xd
@@ -284,7 +282,7 @@
 #define SCU_SOURCE_DLY16		0x2
 #define SCU_SOURCE_NAND			0x1
 #define SCU_SOURCE_DEL_CELL		0x0
-#else /* ! AST_SOC_G5 */
+#else /* ! CONFIG_TARGET_AST_G5 */
 #define SCU_SOURCE_6M			0xf
 #define SCU_SOURCE_12M			0xe
 #define SCU_SOURCE_I2SM_CLK		0xd
@@ -300,7 +298,7 @@
 #define SCU_SOURCE_D_PLL		0x2
 #define SCU_SOURCE_NAND			0x1
 #define SCU_SOURCE_DEL_CELL		0x0
-#endif /* AST_SOC_G5 */
+#endif /* CONFIG_TARGET_AST_G5 */
 #define SCU_OSC_COUNT_EN		(0x1 << 1)
 #define SCU_RING_OSC_EN			(0x1 << 0)
 
@@ -321,7 +319,7 @@
 #define INTR_VGA_CURSOR_CHANGE_EN	(0x1 << 0)
 
 /* AST_SCU_D2_PLL			0x1C - D2-PLL Parameter register */
-#ifdef AST_SOC_G5
+#ifdef CONFIG_TARGET_AST_G5
 #define SCU_D2_PLL_SET_ODNUM(x)		(x << 19)
 #define SCU_D2_PLL_GET_ODNUM(x)		((x >> 19) & 0x3)
 #define SCU_D2_PLL_OD_MASK		(0x3 << 19)
@@ -342,7 +340,7 @@
 #define SCU_D2_PLL_RESET		(0x1 << 2)
 #define SCU_D2_PLL_BYPASS		(0x1 << 1)
 #define SCU_D2_PLL_OFF			(0x1)
-#else /* ! AST_SOC_G5 */
+#else /* ! CONFIG_TARGET_AST_G5 */
 #define SCU_D2_PLL_SET_PD2(x)		(x << 19)
 #define SCU_D2_PLL_GET_PD2(x)		((x >> 19)&0x7)
 #define SCU_D2_PLL_PD2_MASK		(0x7 << 19)
@@ -360,17 +358,17 @@
 #define SCU_D2_PLL_SET_NUM(x)		(x)
 #define SCU_D2_PLL_GET_NUM(x)		(x & 0xff)
 #define SCU_D2_PLL_NUM_MASK		(0xff)
-#endif /* AST_SOC_G5 */
+#endif /* CONFIG_TARGET_AST_G5 */
 
 /* AST_SCU_M_PLL 			0x20 - M-PLL Parameter register */
-#ifdef AST_SOC_G5
+#ifdef CONFIG_TARGET_AST_G5
 #define SCU_M_PLL_RESET			(0x1 << 21)
 #define SCU_M_PLL_BYPASS		(0x1 << 20)
 #define SCU_M_PLL_OFF			(0x1 << 19)
 #define SCU_M_PLL_GET_PDNUM(x)		((x >> 13) & 0x3f)
 #define SCU_M_PLL_GET_MNUM(x)		((x >> 5) & 0xff)
 #define SCU_M_PLL_GET_NNUM(x)		(x & 0x1f)
-#else /* ! AST_SOC_G5 */
+#else /* ! CONFIG_TARGET_AST_G5 */
 #define SCU_M_PLL_BYPASS		(0x1 << 17)
 #define SCU_M_PLL_OFF			(0x1 << 16)
 #define SCU_M_PLL_NUM(x)		(x << 5)
@@ -380,10 +378,10 @@
 #define SCU_M_PLL_GET_DIV(x)		((x >> 4) & 0x1)
 #define SCU_M_PLL_DENUM(x)		(x)
 #define SCU_M_PLL_GET_DENUM(x)		(x & 0xf)
-#endif /* AST_SOC_G5 */
+#endif /* CONFIG_TARGET_AST_G5 */
 
 /* AST_SCU_H_PLL			0x24 - H-PLL Parameter register */
-#ifdef AST_SOC_G5
+#ifdef CONFIG_TARGET_AST_G5
 #define SCU_H_PLL_PARAMETER0(x)		((x) << 22)
 #define SCU_H_PLL_GET_PARAMETER0(x)	((x >> 22) & 0x3ff)
 #define SCU_H_PLL_PARAMETER0_MASK(x)	(0x3ff << 22)
@@ -400,7 +398,7 @@
 #define SCU_H_PLL_NNUM(x)		(x)
 #define SCU_H_PLL_GET_NNUM(x)		(x & 0xf)
 #define SCU_H_PLL_NNUM_MASK		(0xf)
-#else /* ! AST_SOC_G5 */
+#else /* ! CONFIG_TARGET_AST_G5 */
 #define SCU_H_PLL_PARAMETER		(0x1 << 18)
 #define SCU_H_PLL_BYPASS_EN		(0x1 << 17)
 #define SCU_H_PLL_OFF			(0x1 << 16)
@@ -412,7 +410,7 @@
 #define SCU_H_PLL_DENUM(x)		(x)
 #define SCU_H_PLL_GET_DENUM(x)		(x & 0xf)
 #define SCU_H_PLL_DENUM_MASK		(0xf)
-#endif /* AST_SOC_G5 */
+#endif /* CONFIG_TARGET_AST_G5 */
 
 /* AST_SCU_MH_PLL_EXTEND 		0x148 - Extended Parameter of M/H-PLL register */
 #define SCU_H_PLL_GET_PARAMETER1(x)	((x >> 16) & 0x3f)
@@ -420,7 +418,7 @@
 #define SCU_M_PLL_GET_PARAMETER1(x)	(x & 0x3f)
 #define SCU_M_PLL_PARAMETER1_MASK(x)	(0x3f)
 
-#ifdef AST_SOC_G5
+#ifdef CONFIG_TARGET_AST_G5
 /* AST_SCU_D_PLL 			0x28 - D-PLL Parameter  register */
 #define SCU_D_PLL_GET_SIP(x)		((x >>27) & 0x1f)
 #define SCU_D_PLL_GET_SIC(x)		((x >>22) & 0x1f)
@@ -435,13 +433,13 @@
 #define SCU_D_PLL_BYPASS		(0x1 << 1)
 #define SCU_D_PLL_OFF			(0x1)
 
-#else /* ! AST_SOC_G5 */
+#else /* ! CONFIG_TARGET_AST_G5 */
 /* AST_SCU_FREQ_LIMIT			0x28 - frequency counter comparsion register */
 #define SCU_FREQ_U_LIMIT(x)		(x << 16)
 #define SCU_FREQ_U_LIMIT_MASK		(0x3fff << 16)
 #define SCU_FREQ_L_LIMIT(x)		(x)
 #define SCU_FREQ_L_LIMIT_MASK		(0x3fff)
-#endif /* AST_SOC_G5 */
+#endif /* CONFIG_TARGET_AST_G5 */
 
 /* AST_SCU_MISC1_CTRL			 0x2C - Misc. Control register */
 #define SCU_MISC_JTAG_MASTER_DIS	(0x1 << 26)
@@ -449,7 +447,7 @@
 #define SCU_MISC_SPI_W_P2A_DIS		(0x1 << 24)
 #define SCU_MISC_SOC_W_P2A_DIS		(0x1 << 23)
 #define SCU_MISC_FLASH_W_P2A_DIS	(0x1 << 22)
-#ifdef AST_SOC_G5
+#ifdef CONFIG_TARGET_AST_G5
 #define SCU_MISC_CRT_CLK_H_SOURCE	(0x1 << 21)
 #define SCU_MISC_D_PLL_SOURCE		(0x1 << 20)
 #else
@@ -491,7 +489,7 @@
 #define SCU_PCI_REVISION_ID(x)		(x)
 
 /* AST_SCU_SYS_CTRL			0x3C - System reset contrl/status register*/
-#ifdef AST_SOC_G5
+#ifdef CONFIG_TARGET_AST_G5
 #define SCU_SYS_WDT3_RESET_FLAG		(0x1 << 4)
 #define SCU_SYS_WDT2_RESET_FLAG		(0x1 << 3)
 #define SCU_SYS_WDT_RESET_FLAG		(0x1 << 2)
@@ -529,7 +527,7 @@
 /* AST_SCU_MAC_CLK			0x48 - MAC interface clock delay setting register */
 
 /* AST_SCU_MISC2_CTRL			0x4C - Misc. 2 Control register */
-#ifdef AST_SOC_G5
+#ifdef CONFIG_TARGET_AST_G5
 #define SCU_PCIE_MAPPING_HIGH		(1 << 15)
 #define SCU_MALI_DTY_MODE		(1 << 8)
 #define SCU_MALI_RC_MODE		(1 << 7)
@@ -548,7 +546,7 @@
 /* AST_SCU_VGA_SCRATCH7			0x6c - VGA Scratch register */
 
 /* AST_SCU_HW_STRAP1			0x70 - hardware strapping register */
-#ifdef AST_SOC_G5
+#ifdef CONFIG_TARGET_AST_G5
 
 #define CLK_25M_IN			(0x1 << 23)
 
@@ -577,7 +575,7 @@
 #define     VGA_64M_DRAM		    3
 
 #define SCU_HW_STRAP_DIS_BOOT 		(1)
-#else /* !AST_SOC_G5 */
+#else /* !CONFIG_TARGET_AST_G5 */
 #define SCU_HW_STRAP_SW_DEFINE(x)	(x << 29)
 #define SCU_HW_STRAP_SW_DEFINE_MASK	(0x7 << 29)
 
@@ -654,7 +652,7 @@
 #define     SPI_BOOT			    2
 #define     DIS_BOOT			    3
 
-#endif /* AST_SOC_G5 */
+#endif /* CONFIG_TARGET_AST_G5 */
 
 /* AST_SCU_RAMDOM_GEN			0x74 - random number generator register */
 #define RNG_TYPE_MASK			(0x7 << 1)
@@ -767,7 +765,7 @@
 #define SCU_FUN_PIN_SGPMLD		(0x1 << 9)
 #define SCU_FUN_PIN_SGPMCK		(0x1 << 8)
 
-#if defined(AST_SOC_G5)
+#if defined(CONFIG_TARGET_AST_G5)
 #define SCU_FUN_PIN_I2C4_SALT4		(0x1 << 7)
 #define SCU_FUN_PIN_I2C3_SALT3		(0x1 << 6)
 #define SCU_FUN_PIN_I2C2_SALT2		(0x1 << 5)
diff --git a/arch/arm/mach-aspeed/Makefile b/arch/arm/mach-aspeed/Makefile
index 7d8930beb988..069eca939873 100644
--- a/arch/arm/mach-aspeed/Makefile
+++ b/arch/arm/mach-aspeed/Makefile
@@ -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
diff --git a/arch/arm/mach-aspeed/ast-ahbc.c b/arch/arm/mach-aspeed/ast-ahbc.c
index 9a41482c0f25..800cd2c5fb1f 100644
--- a/arch/arm/mach-aspeed/ast-ahbc.c
+++ b/arch/arm/mach-aspeed/ast-ahbc.c
@@ -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)
diff --git a/arch/arm/mach-aspeed/ast-scu.c b/arch/arm/mach-aspeed/ast-scu.c
index 0cc0d67b5d31..1a005d0c9547 100644
--- a/arch/arm/mach-aspeed/ast-scu.c
+++ b/arch/arm/mach-aspeed/ast-scu.c
@@ -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);
 
diff --git a/arch/arm/mach-aspeed/cpuinfo.c b/arch/arm/mach-aspeed/cpuinfo.c
index 45f70a81833f..72f198587f41 100644
--- a/arch/arm/mach-aspeed/cpuinfo.c
+++ b/arch/arm/mach-aspeed/cpuinfo.c
@@ -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",
diff --git a/arch/arm/mach-aspeed/flash.c b/arch/arm/mach-aspeed/flash.c
index 01c5354b66d4..327aacb00c8f 100644
--- a/arch/arm/mach-aspeed/flash.c
+++ b/arch/arm/mach-aspeed/flash.c
@@ -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;
diff --git a/board/aspeed/ast-g4/ast-g4.c b/board/aspeed/ast-g4/ast-g4.c
index cc26a78529bc..84bdd39f2cac 100644
--- a/board/aspeed/ast-g4/ast-g4.c
+++ b/board/aspeed/ast-g4/ast-g4.c
@@ -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>
diff --git a/drivers/net/ftgmac100.c b/drivers/net/ftgmac100.c
index 9d5ba98243ec..16cfac87cb8e 100644
--- a/drivers/net/ftgmac100.c
+++ b/drivers/net/ftgmac100.c
@@ -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>
diff --git a/include/configs/ast-common.h b/include/configs/ast-common.h
index d0638158ab25..7725c1af173f 100644
--- a/include/configs/ast-common.h
+++ b/include/configs/ast-common.h
@@ -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
diff --git a/include/configs/ast-g4-ncsi.h b/include/configs/ast-g4-ncsi.h
index 31aa9fe1fec6..9a17a3bd0cd3 100644
--- a/include/configs/ast-g4-ncsi.h
+++ b/include/configs/ast-g4-ncsi.h
@@ -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 */
diff --git a/include/configs/ast-g4-phy.h b/include/configs/ast-g4-phy.h
index 185553864f3f..250abf5a2f44 100644
--- a/include/configs/ast-g4-phy.h
+++ b/include/configs/ast-g4-phy.h
@@ -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 */
diff --git a/include/configs/ast-g5-ncsi.h b/include/configs/ast-g5-ncsi.h
index f73a8f11507b..907ff9a5bb9d 100644
--- a/include/configs/ast-g5-ncsi.h
+++ b/include/configs/ast-g5-ncsi.h
@@ -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 */
diff --git a/include/configs/ast-g5-phy.h b/include/configs/ast-g5-phy.h
index 9b10d06212e7..738fb93419f4 100644
--- a/include/configs/ast-g5-phy.h
+++ b/include/configs/ast-g5-phy.h
@@ -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 */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH u-boot 04/12] aspeed: remove CONFIG_SYS_INIT_RAM_END
  2016-10-06 21:26 [PATCH u-boot 00/12] config cleanups and small fixes Cédric Le Goater
                   ` (2 preceding siblings ...)
  2016-10-06 21:26 ` [PATCH u-boot 03/12] aspeed: use CONFIG_TARGET_AST_G{4,5} Cédric Le Goater
@ 2016-10-06 21:26 ` Cédric Le Goater
  2016-10-10  6:22   ` Joel Stanley
  2016-10-06 21:26 ` [PATCH u-boot 05/12] aspeed: replace CONFIG_ASPEED_TIMER_CLK with CONFIG_TIMER_CLK_FREQ Cédric Le Goater
                   ` (8 subsequent siblings)
  12 siblings, 1 reply; 32+ messages in thread
From: Cédric Le Goater @ 2016-10-06 21:26 UTC (permalink / raw)
  To: openbmc

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 include/configs/ast-common.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/configs/ast-common.h b/include/configs/ast-common.h
index 7725c1af173f..a93dc61f3730 100644
--- a/include/configs/ast-common.h
+++ b/include/configs/ast-common.h
@@ -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
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH u-boot 05/12] aspeed: replace CONFIG_ASPEED_TIMER_CLK with CONFIG_TIMER_CLK_FREQ
  2016-10-06 21:26 [PATCH u-boot 00/12] config cleanups and small fixes Cédric Le Goater
                   ` (3 preceding siblings ...)
  2016-10-06 21:26 ` [PATCH u-boot 04/12] aspeed: remove CONFIG_SYS_INIT_RAM_END Cédric Le Goater
@ 2016-10-06 21:26 ` Cédric Le Goater
  2016-10-10  6:22   ` Joel Stanley
  2016-10-06 21:26 ` [PATCH u-boot 06/12] aspeed: timer cleanups Cédric Le Goater
                   ` (7 subsequent siblings)
  12 siblings, 1 reply; 32+ messages in thread
From: Cédric Le Goater @ 2016-10-06 21:26 UTC (permalink / raw)
  To: openbmc

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 arch/arm/mach-aspeed/timer.c | 6 +++---
 include/configs/ast-common.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-aspeed/timer.c b/arch/arm/mach-aspeed/timer.c
index 626f992429b6..3755238f173c 100644
--- a/arch/arm/mach-aspeed/timer.c
+++ b/arch/arm/mach-aspeed/timer.c
@@ -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))
diff --git a/include/configs/ast-common.h b/include/configs/ast-common.h
index a93dc61f3730..a663d76407cb 100644
--- a/include/configs/ast-common.h
+++ b/include/configs/ast-common.h
@@ -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
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH u-boot 06/12] aspeed: timer cleanups
  2016-10-06 21:26 [PATCH u-boot 00/12] config cleanups and small fixes Cédric Le Goater
                   ` (4 preceding siblings ...)
  2016-10-06 21:26 ` [PATCH u-boot 05/12] aspeed: replace CONFIG_ASPEED_TIMER_CLK with CONFIG_TIMER_CLK_FREQ Cédric Le Goater
@ 2016-10-06 21:26 ` Cédric Le Goater
  2016-10-10  6:22   ` Joel Stanley
  2016-10-06 21:26 ` [PATCH u-boot 07/12] aspeed: add configuration for the network devices Cédric Le Goater
                   ` (6 subsequent siblings)
  12 siblings, 1 reply; 32+ messages in thread
From: Cédric Le Goater @ 2016-10-06 21:26 UTC (permalink / raw)
  To: openbmc

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.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 arch/arm/mach-aspeed/timer.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-aspeed/timer.c b/arch/arm/mach-aspeed/timer.c
index 3755238f173c..9ab4b3fa125d 100644
--- a/arch/arm/mach-aspeed/timer.c
+++ b/arch/arm/mach-aspeed/timer.c
@@ -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);
 }
 
 /*
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH u-boot 07/12] aspeed: add configuration for the network devices
  2016-10-06 21:26 [PATCH u-boot 00/12] config cleanups and small fixes Cédric Le Goater
                   ` (5 preceding siblings ...)
  2016-10-06 21:26 ` [PATCH u-boot 06/12] aspeed: timer cleanups Cédric Le Goater
@ 2016-10-06 21:26 ` Cédric Le Goater
  2016-10-10  6:23   ` Joel Stanley
  2016-10-06 21:26 ` [PATCH u-boot 08/12] aspeed: remove CONFIG_MAC_NUM Cédric Le Goater
                   ` (5 subsequent siblings)
  12 siblings, 1 reply; 32+ messages in thread
From: Cédric Le Goater @ 2016-10-06 21:26 UTC (permalink / raw)
  To: openbmc

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 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(-)

diff --git a/configs/ast_g4_ncsi_defconfig b/configs/ast_g4_ncsi_defconfig
index 0314af82c37e..fb56224b095c 100644
--- a/configs/ast_g4_ncsi_defconfig
+++ b/configs/ast_g4_ncsi_defconfig
@@ -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
diff --git a/configs/ast_g4_phy_defconfig b/configs/ast_g4_phy_defconfig
index 7e9e5712a9ef..e5e22fa6d9c0 100644
--- a/configs/ast_g4_phy_defconfig
+++ b/configs/ast_g4_phy_defconfig
@@ -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
diff --git a/configs/ast_g5_ncsi_defconfig b/configs/ast_g5_ncsi_defconfig
index b1f4f185a53f..094f22526a47 100644
--- a/configs/ast_g5_ncsi_defconfig
+++ b/configs/ast_g5_ncsi_defconfig
@@ -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
diff --git a/configs/ast_g5_phy_defconfig b/configs/ast_g5_phy_defconfig
index 63ff21f65f71..b952b118ef7f 100644
--- a/configs/ast_g5_phy_defconfig
+++ b/configs/ast_g5_phy_defconfig
@@ -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
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index b8ccd92184cf..ed152296ded3 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -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
diff --git a/include/configs/ast-g4-ncsi.h b/include/configs/ast-g4-ncsi.h
index 9a17a3bd0cd3..bd7ca818db87 100644
--- a/include/configs/ast-g4-ncsi.h
+++ b/include/configs/ast-g4-ncsi.h
@@ -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 */
diff --git a/include/configs/ast-g4-phy.h b/include/configs/ast-g4-phy.h
index 250abf5a2f44..c0208625c9ab 100644
--- a/include/configs/ast-g4-phy.h
+++ b/include/configs/ast-g4-phy.h
@@ -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 */
diff --git a/include/configs/ast-g5-ncsi.h b/include/configs/ast-g5-ncsi.h
index 907ff9a5bb9d..049d1a5b0be8 100644
--- a/include/configs/ast-g5-ncsi.h
+++ b/include/configs/ast-g5-ncsi.h
@@ -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
 
diff --git a/include/configs/ast-g5-phy.h b/include/configs/ast-g5-phy.h
index 738fb93419f4..1d8aad815d02 100644
--- a/include/configs/ast-g5-phy.h
+++ b/include/configs/ast-g5-phy.h
@@ -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
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH u-boot 08/12] aspeed: remove CONFIG_MAC_NUM
  2016-10-06 21:26 [PATCH u-boot 00/12] config cleanups and small fixes Cédric Le Goater
                   ` (6 preceding siblings ...)
  2016-10-06 21:26 ` [PATCH u-boot 07/12] aspeed: add configuration for the network devices Cédric Le Goater
@ 2016-10-06 21:26 ` Cédric Le Goater
  2016-10-10  6:23   ` Joel Stanley
  2016-10-06 21:26 ` [PATCH u-boot 09/12] aspeed: add CONFIG_DRAM_ECC Cédric Le Goater
                   ` (4 subsequent siblings)
  12 siblings, 1 reply; 32+ messages in thread
From: Cédric Le Goater @ 2016-10-06 21:26 UTC (permalink / raw)
  To: openbmc

and use the standard CONFIG_HAS_ETHX instead.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 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(-)

diff --git a/drivers/net/ftgmac100.c b/drivers/net/ftgmac100.c
index 16cfac87cb8e..b690e6c2330c 100644
--- a/drivers/net/ftgmac100.c
+++ b/drivers/net/ftgmac100.c
@@ -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);
diff --git a/include/configs/ast-g4-ncsi.h b/include/configs/ast-g4-ncsi.h
index bd7ca818db87..43787f39ac90 100644
--- a/include/configs/ast-g4-ncsi.h
+++ b/include/configs/ast-g4-ncsi.h
@@ -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 */
diff --git a/include/configs/ast-g4-phy.h b/include/configs/ast-g4-phy.h
index c0208625c9ab..66881f6cb8be 100644
--- a/include/configs/ast-g4-phy.h
+++ b/include/configs/ast-g4-phy.h
@@ -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
 
 
diff --git a/include/configs/ast-g5-ncsi.h b/include/configs/ast-g5-ncsi.h
index 049d1a5b0be8..486fe28152c2 100644
--- a/include/configs/ast-g5-ncsi.h
+++ b/include/configs/ast-g5-ncsi.h
@@ -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
 
diff --git a/include/configs/ast-g5-phy.h b/include/configs/ast-g5-phy.h
index 1d8aad815d02..1cd0387b0508 100644
--- a/include/configs/ast-g5-phy.h
+++ b/include/configs/ast-g5-phy.h
@@ -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 */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH u-boot 09/12] aspeed: add CONFIG_DRAM_ECC
  2016-10-06 21:26 [PATCH u-boot 00/12] config cleanups and small fixes Cédric Le Goater
                   ` (7 preceding siblings ...)
  2016-10-06 21:26 ` [PATCH u-boot 08/12] aspeed: remove CONFIG_MAC_NUM Cédric Le Goater
@ 2016-10-06 21:26 ` Cédric Le Goater
  2016-10-10  6:23   ` Joel Stanley
  2016-10-06 21:26 ` [PATCH u-boot 10/12] aspeed: remove CONFIG_PHY_MAX_ADDR Cédric Le Goater
                   ` (3 subsequent siblings)
  12 siblings, 1 reply; 32+ messages in thread
From: Cédric Le Goater @ 2016-10-06 21:26 UTC (permalink / raw)
  To: openbmc

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

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

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 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(-)

diff --git a/board/aspeed/ast-g5/Kconfig b/board/aspeed/ast-g5/Kconfig
index b809a6b1750f..b8e10686e369 100644
--- a/board/aspeed/ast-g5/Kconfig
+++ b/board/aspeed/ast-g5/Kconfig
@@ -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
diff --git a/include/configs/ast-g5-ncsi.h b/include/configs/ast-g5-ncsi.h
index 486fe28152c2..06574b5432f0 100644
--- a/include/configs/ast-g5-ncsi.h
+++ b/include/configs/ast-g5-ncsi.h
@@ -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 */
diff --git a/include/configs/ast-g5-phy.h b/include/configs/ast-g5-phy.h
index 1cd0387b0508..469ef01e31f2 100644
--- a/include/configs/ast-g5-phy.h
+++ b/include/configs/ast-g5-phy.h
@@ -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 */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH u-boot 10/12] aspeed: remove CONFIG_PHY_MAX_ADDR
  2016-10-06 21:26 [PATCH u-boot 00/12] config cleanups and small fixes Cédric Le Goater
                   ` (8 preceding siblings ...)
  2016-10-06 21:26 ` [PATCH u-boot 09/12] aspeed: add CONFIG_DRAM_ECC Cédric Le Goater
@ 2016-10-06 21:26 ` Cédric Le Goater
  2016-10-10  6:23   ` Joel Stanley
  2016-10-06 21:26 ` [PATCH u-boot 11/12] bootm: fix ramdisk relocation Cédric Le Goater
                   ` (2 subsequent siblings)
  12 siblings, 1 reply; 32+ messages in thread
From: Cédric Le Goater @ 2016-10-06 21:26 UTC (permalink / raw)
  To: openbmc

PHY_MAX_ADDR has the same value

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 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(-)

diff --git a/drivers/net/ftgmac100.c b/drivers/net/ftgmac100.c
index b690e6c2330c..f82ea5f35e89 100644
--- a/drivers/net/ftgmac100.c
+++ b/drivers/net/ftgmac100.c
@@ -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);
diff --git a/include/configs/ast-g4-phy.h b/include/configs/ast-g4-phy.h
index 66881f6cb8be..8e1ce2bfd10b 100644
--- a/include/configs/ast-g4-phy.h
+++ b/include/configs/ast-g4-phy.h
@@ -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 */
diff --git a/include/configs/ast-g5-phy.h b/include/configs/ast-g5-phy.h
index 469ef01e31f2..c10767467bb9 100644
--- a/include/configs/ast-g5-phy.h
+++ b/include/configs/ast-g5-phy.h
@@ -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 */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH u-boot 11/12] bootm: fix ramdisk relocation
  2016-10-06 21:26 [PATCH u-boot 00/12] config cleanups and small fixes Cédric Le Goater
                   ` (9 preceding siblings ...)
  2016-10-06 21:26 ` [PATCH u-boot 10/12] aspeed: remove CONFIG_PHY_MAX_ADDR Cédric Le Goater
@ 2016-10-06 21:26 ` Cédric Le Goater
  2016-10-10  6:23   ` Joel Stanley
  2016-10-06 21:26 ` [PATCH u-boot 12/12] aspeed: remove hack loading ramdisk in memory Cédric Le Goater
  2016-10-07  7:24 ` [PATCH u-boot 00/12] config cleanups and small fixes Cédric Le Goater
  12 siblings, 1 reply; 32+ messages in thread
From: Cédric Le Goater @ 2016-10-06 21:26 UTC (permalink / raw)
  To: openbmc

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

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 cmd/bootm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/cmd/bootm.c b/cmd/bootm.c
index e02a1c54b70c..9184fd379f95 100644
--- a/cmd/bootm.c
+++ b/cmd/bootm.c
@@ -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
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH u-boot 12/12] aspeed: remove hack loading ramdisk in memory
  2016-10-06 21:26 [PATCH u-boot 00/12] config cleanups and small fixes Cédric Le Goater
                   ` (10 preceding siblings ...)
  2016-10-06 21:26 ` [PATCH u-boot 11/12] bootm: fix ramdisk relocation Cédric Le Goater
@ 2016-10-06 21:26 ` Cédric Le Goater
  2016-10-10  6:24   ` Joel Stanley
  2016-10-07  7:24 ` [PATCH u-boot 00/12] config cleanups and small fixes Cédric Le Goater
  12 siblings, 1 reply; 32+ messages in thread
From: Cédric Le Goater @ 2016-10-06 21:26 UTC (permalink / raw)
  To: openbmc

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 common/image.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/common/image.c b/common/image.c
index 64e5c668f52a..7ad04ca19b80 100644
--- a/common/image.c
+++ b/common/image.c
@@ -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)) {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* Re: [PATCH u-boot 00/12] config cleanups and small fixes
  2016-10-06 21:26 [PATCH u-boot 00/12] config cleanups and small fixes Cédric Le Goater
                   ` (11 preceding siblings ...)
  2016-10-06 21:26 ` [PATCH u-boot 12/12] aspeed: remove hack loading ramdisk in memory Cédric Le Goater
@ 2016-10-07  7:24 ` Cédric Le Goater
  2016-10-10  6:24   ` Joel Stanley
  12 siblings, 1 reply; 32+ messages in thread
From: Cédric Le Goater @ 2016-10-07  7:24 UTC (permalink / raw)
  To: openbmc

On 10/06/2016 11:26 PM, Cédric Le Goater wrote:
> 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.

> 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
> 

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH u-boot 01/12] aspeed: add CONFIG_AST_SPI_NOR
  2016-10-06 21:26 ` [PATCH u-boot 01/12] aspeed: add CONFIG_AST_SPI_NOR Cédric Le Goater
@ 2016-10-10  6:21   ` Joel Stanley
  0 siblings, 0 replies; 32+ messages in thread
From: Joel Stanley @ 2016-10-10  6:21 UTC (permalink / raw)
  To: Cédric Le Goater; +Cc: OpenBMC Maillist

On Fri, Oct 7, 2016 at 8:26 AM, Cédric Le Goater <clg@kaod.org> wrote:
> also remove some useless code related the host SPI PNOR
>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

Reviewed-by: Joel Stanley <joel@jms.id.au>

> ---
>  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(-)

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH u-boot 02/12] aspeed: rework top level configuration of the Aspeed SoC
  2016-10-06 21:26 ` [PATCH u-boot 02/12] aspeed: rework top level configuration of the Aspeed SoC Cédric Le Goater
@ 2016-10-10  6:22   ` Joel Stanley
  0 siblings, 0 replies; 32+ messages in thread
From: Joel Stanley @ 2016-10-10  6:22 UTC (permalink / raw)
  To: Cédric Le Goater; +Cc: OpenBMC Maillist

On Fri, Oct 7, 2016 at 8:26 AM, Cédric Le Goater <clg@kaod.org> wrote:
> and also add a proper CONFIG_ARCH_ASPEED
>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

Reviewed-by: Joel Stanley <joel@jms.id.au>

> ---
>  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%)

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH u-boot 03/12] aspeed: use CONFIG_TARGET_AST_G{4,5}
  2016-10-06 21:26 ` [PATCH u-boot 03/12] aspeed: use CONFIG_TARGET_AST_G{4,5} Cédric Le Goater
@ 2016-10-10  6:22   ` Joel Stanley
  0 siblings, 0 replies; 32+ messages in thread
From: Joel Stanley @ 2016-10-10  6:22 UTC (permalink / raw)
  To: Cédric Le Goater; +Cc: OpenBMC Maillist

On Fri, Oct 7, 2016 at 8:26 AM, Cédric Le Goater <clg@kaod.org> wrote:
> 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.
>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

Reviewed-by: Joel Stanley <joel@jms.id.au>

> ---
>  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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH u-boot 04/12] aspeed: remove CONFIG_SYS_INIT_RAM_END
  2016-10-06 21:26 ` [PATCH u-boot 04/12] aspeed: remove CONFIG_SYS_INIT_RAM_END Cédric Le Goater
@ 2016-10-10  6:22   ` Joel Stanley
  0 siblings, 0 replies; 32+ messages in thread
From: Joel Stanley @ 2016-10-10  6:22 UTC (permalink / raw)
  To: Cédric Le Goater; +Cc: OpenBMC Maillist

On Fri, Oct 7, 2016 at 8:26 AM, Cédric Le Goater <clg@kaod.org> wrote:
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

Reviewed-by: Joel Stanley <joel@jms.id.au>

> ---
>  include/configs/ast-common.h | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH u-boot 05/12] aspeed: replace CONFIG_ASPEED_TIMER_CLK with CONFIG_TIMER_CLK_FREQ
  2016-10-06 21:26 ` [PATCH u-boot 05/12] aspeed: replace CONFIG_ASPEED_TIMER_CLK with CONFIG_TIMER_CLK_FREQ Cédric Le Goater
@ 2016-10-10  6:22   ` Joel Stanley
  0 siblings, 0 replies; 32+ messages in thread
From: Joel Stanley @ 2016-10-10  6:22 UTC (permalink / raw)
  To: Cédric Le Goater; +Cc: OpenBMC Maillist

On Fri, Oct 7, 2016 at 8:26 AM, Cédric Le Goater <clg@kaod.org> wrote:
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

Reviewed-by: Joel Stanley <joel@jms.id.au>

> ---
>  arch/arm/mach-aspeed/timer.c | 6 +++---
>  include/configs/ast-common.h | 2 +-
>  2 files changed, 4 insertions(+), 4 deletions(-)

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH u-boot 06/12] aspeed: timer cleanups
  2016-10-06 21:26 ` [PATCH u-boot 06/12] aspeed: timer cleanups Cédric Le Goater
@ 2016-10-10  6:22   ` Joel Stanley
  2016-10-17  6:52     ` Cédric Le Goater
  0 siblings, 1 reply; 32+ messages in thread
From: Joel Stanley @ 2016-10-10  6:22 UTC (permalink / raw)
  To: Cédric Le Goater; +Cc: OpenBMC Maillist

On Fri, Oct 7, 2016 at 8:26 AM, Cédric Le Goater <clg@kaod.org> wrote:
> 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?

> Signed-off-by: Cédric Le Goater <clg@kaod.org>

Reviewed-by: Joel Stanley <joel@jms.id.au>

> ---
>  arch/arm/mach-aspeed/timer.c | 21 +++++++++++++++++----
>  1 file changed, 17 insertions(+), 4 deletions(-)

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH u-boot 08/12] aspeed: remove CONFIG_MAC_NUM
  2016-10-06 21:26 ` [PATCH u-boot 08/12] aspeed: remove CONFIG_MAC_NUM Cédric Le Goater
@ 2016-10-10  6:23   ` Joel Stanley
  0 siblings, 0 replies; 32+ messages in thread
From: Joel Stanley @ 2016-10-10  6:23 UTC (permalink / raw)
  To: Cédric Le Goater; +Cc: OpenBMC Maillist

On Fri, Oct 7, 2016 at 8:26 AM, Cédric Le Goater <clg@kaod.org> wrote:
> and use the standard CONFIG_HAS_ETHX instead.
>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

Reviewed-by: Joel Stanley <joel@jms.id.au>

> ---
>  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(-)

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH u-boot 07/12] aspeed: add configuration for the network devices
  2016-10-06 21:26 ` [PATCH u-boot 07/12] aspeed: add configuration for the network devices Cédric Le Goater
@ 2016-10-10  6:23   ` Joel Stanley
  0 siblings, 0 replies; 32+ messages in thread
From: Joel Stanley @ 2016-10-10  6:23 UTC (permalink / raw)
  To: Cédric Le Goater; +Cc: OpenBMC Maillist

On Fri, Oct 7, 2016 at 8:26 AM, Cédric Le Goater <clg@kaod.org> wrote:
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

Reviewed-by: Joel Stanley <joel@jms.id.au>

> +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.
> +

Are we able to fix this in the future?

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH u-boot 09/12] aspeed: add CONFIG_DRAM_ECC
  2016-10-06 21:26 ` [PATCH u-boot 09/12] aspeed: add CONFIG_DRAM_ECC Cédric Le Goater
@ 2016-10-10  6:23   ` Joel Stanley
  0 siblings, 0 replies; 32+ messages in thread
From: Joel Stanley @ 2016-10-10  6:23 UTC (permalink / raw)
  To: Cédric Le Goater; +Cc: OpenBMC Maillist

On Fri, Oct 7, 2016 at 8:26 AM, Cédric Le Goater <clg@kaod.org> wrote:
> There is still a warning  I need to get rid of :
>
>       board/aspeed/ast-g5/Kconfig:22:warning: config symbol defined without type
>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

Reviewed-by: Joel Stanley <joel@jms.id.au>

> ---
>  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(-)

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH u-boot 10/12] aspeed: remove CONFIG_PHY_MAX_ADDR
  2016-10-06 21:26 ` [PATCH u-boot 10/12] aspeed: remove CONFIG_PHY_MAX_ADDR Cédric Le Goater
@ 2016-10-10  6:23   ` Joel Stanley
  0 siblings, 0 replies; 32+ messages in thread
From: Joel Stanley @ 2016-10-10  6:23 UTC (permalink / raw)
  To: Cédric Le Goater; +Cc: OpenBMC Maillist

On Fri, Oct 7, 2016 at 8:26 AM, Cédric Le Goater <clg@kaod.org> wrote:
> PHY_MAX_ADDR has the same value
>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

Reviewed-by: Joel Stanley <joel@jms.id.au>

> ---
>  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(-)

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH u-boot 11/12] bootm: fix ramdisk relocation
  2016-10-06 21:26 ` [PATCH u-boot 11/12] bootm: fix ramdisk relocation Cédric Le Goater
@ 2016-10-10  6:23   ` Joel Stanley
  2016-10-10  7:41     ` Cédric Le Goater
  0 siblings, 1 reply; 32+ messages in thread
From: Joel Stanley @ 2016-10-10  6:23 UTC (permalink / raw)
  To: Cédric Le Goater; +Cc: OpenBMC Maillist

On Fri, Oct 7, 2016 at 8:26 AM, Cédric Le Goater <clg@kaod.org> wrote:
> 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
>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH u-boot 12/12] aspeed: remove hack loading ramdisk in memory
  2016-10-06 21:26 ` [PATCH u-boot 12/12] aspeed: remove hack loading ramdisk in memory Cédric Le Goater
@ 2016-10-10  6:24   ` Joel Stanley
  0 siblings, 0 replies; 32+ messages in thread
From: Joel Stanley @ 2016-10-10  6:24 UTC (permalink / raw)
  To: Cédric Le Goater; +Cc: OpenBMC Maillist

On Fri, Oct 7, 2016 at 8:26 AM, Cédric Le Goater <clg@kaod.org> wrote:
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

Reviewed-by: Joel Stanley <joel@jms.id.au>

> ---
>  common/image.c | 11 -----------
>  1 file changed, 11 deletions(-)

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH u-boot 00/12] config cleanups and small fixes
  2016-10-07  7:24 ` [PATCH u-boot 00/12] config cleanups and small fixes Cédric Le Goater
@ 2016-10-10  6:24   ` Joel Stanley
  2016-10-10  6:49     ` Joel Stanley
  2016-10-10  6:57     ` Cédric Le Goater
  0 siblings, 2 replies; 32+ messages in thread
From: Joel Stanley @ 2016-10-10  6:24 UTC (permalink / raw)
  To: Cédric Le Goater; +Cc: OpenBMC Maillist

On Fri, Oct 7, 2016 at 6:24 PM, Cédric Le Goater <clg@kaod.org> wrote:
> On 10/06/2016 11:26 PM, Cédric Le Goater wrote:
>> 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.

>
> 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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH u-boot 00/12] config cleanups and small fixes
  2016-10-10  6:24   ` Joel Stanley
@ 2016-10-10  6:49     ` Joel Stanley
  2016-10-10  7:32       ` Cédric Le Goater
  2016-10-10  6:57     ` Cédric Le Goater
  1 sibling, 1 reply; 32+ messages in thread
From: Joel Stanley @ 2016-10-10  6:49 UTC (permalink / raw)
  To: Cédric Le Goater; +Cc: OpenBMC Maillist

On Mon, Oct 10, 2016 at 5:24 PM, Joel Stanley <joel@jms.id.au> wrote:
> On Fri, Oct 7, 2016 at 6:24 PM, Cédric Le Goater <clg@kaod.org> wrote:
>> On 10/06/2016 11:26 PM, Cédric Le Goater wrote:
>>> 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.
>
>>
>> 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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH u-boot 00/12] config cleanups and small fixes
  2016-10-10  6:24   ` Joel Stanley
  2016-10-10  6:49     ` Joel Stanley
@ 2016-10-10  6:57     ` Cédric Le Goater
  1 sibling, 0 replies; 32+ messages in thread
From: Cédric Le Goater @ 2016-10-10  6:57 UTC (permalink / raw)
  To: Joel Stanley; +Cc: OpenBMC Maillist

On 10/10/2016 08:24 AM, Joel Stanley wrote:
> On Fri, Oct 7, 2016 at 6:24 PM, Cédric Le Goater <clg@kaod.org> wrote:
>> On 10/06/2016 11:26 PM, Cédric Le Goater wrote:
>>> 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.


> 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".

>> 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. 

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH u-boot 00/12] config cleanups and small fixes
  2016-10-10  6:49     ` Joel Stanley
@ 2016-10-10  7:32       ` Cédric Le Goater
  0 siblings, 0 replies; 32+ messages in thread
From: Cédric Le Goater @ 2016-10-10  7:32 UTC (permalink / raw)
  To: Joel Stanley; +Cc: OpenBMC Maillist

On 10/10/2016 08:49 AM, Joel Stanley wrote:
> On Mon, Oct 10, 2016 at 5:24 PM, Joel Stanley <joel@jms.id.au> wrote:
>> On Fri, Oct 7, 2016 at 6:24 PM, Cédric Le Goater <clg@kaod.org> wrote:
>>> On 10/06/2016 11:26 PM, Cédric Le Goater wrote:
>>>> 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.
>>
>>>
>>> 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

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.

> ***
> *** 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.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH u-boot 11/12] bootm: fix ramdisk relocation
  2016-10-10  6:23   ` Joel Stanley
@ 2016-10-10  7:41     ` Cédric Le Goater
  0 siblings, 0 replies; 32+ messages in thread
From: Cédric Le Goater @ 2016-10-10  7:41 UTC (permalink / raw)
  To: Joel Stanley; +Cc: OpenBMC Maillist, Milton D. Miller II

On 10/10/2016 08:23 AM, Joel Stanley wrote:
> On Fri, Oct 7, 2016 at 8:26 AM, Cédric Le Goater <clg@kaod.org> wrote:
>> 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
>>
>> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> 
> 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. 

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH u-boot 06/12] aspeed: timer cleanups
  2016-10-10  6:22   ` Joel Stanley
@ 2016-10-17  6:52     ` Cédric Le Goater
  0 siblings, 0 replies; 32+ messages in thread
From: Cédric Le Goater @ 2016-10-17  6:52 UTC (permalink / raw)
  To: Joel Stanley; +Cc: OpenBMC Maillist

On 10/10/2016 08:22 AM, Joel Stanley wrote:
> On Fri, Oct 7, 2016 at 8:26 AM, Cédric Le Goater <clg@kaod.org> wrote:
>> 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. 

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2016-10-17  6:52 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-06 21:26 [PATCH u-boot 00/12] config cleanups and small fixes Cédric Le Goater
2016-10-06 21:26 ` [PATCH u-boot 01/12] aspeed: add CONFIG_AST_SPI_NOR Cédric Le Goater
2016-10-10  6:21   ` Joel Stanley
2016-10-06 21:26 ` [PATCH u-boot 02/12] aspeed: rework top level configuration of the Aspeed SoC Cédric Le Goater
2016-10-10  6:22   ` Joel Stanley
2016-10-06 21:26 ` [PATCH u-boot 03/12] aspeed: use CONFIG_TARGET_AST_G{4,5} Cédric Le Goater
2016-10-10  6:22   ` Joel Stanley
2016-10-06 21:26 ` [PATCH u-boot 04/12] aspeed: remove CONFIG_SYS_INIT_RAM_END Cédric Le Goater
2016-10-10  6:22   ` Joel Stanley
2016-10-06 21:26 ` [PATCH u-boot 05/12] aspeed: replace CONFIG_ASPEED_TIMER_CLK with CONFIG_TIMER_CLK_FREQ Cédric Le Goater
2016-10-10  6:22   ` Joel Stanley
2016-10-06 21:26 ` [PATCH u-boot 06/12] aspeed: timer cleanups Cédric Le Goater
2016-10-10  6:22   ` Joel Stanley
2016-10-17  6:52     ` Cédric Le Goater
2016-10-06 21:26 ` [PATCH u-boot 07/12] aspeed: add configuration for the network devices Cédric Le Goater
2016-10-10  6:23   ` Joel Stanley
2016-10-06 21:26 ` [PATCH u-boot 08/12] aspeed: remove CONFIG_MAC_NUM Cédric Le Goater
2016-10-10  6:23   ` Joel Stanley
2016-10-06 21:26 ` [PATCH u-boot 09/12] aspeed: add CONFIG_DRAM_ECC Cédric Le Goater
2016-10-10  6:23   ` Joel Stanley
2016-10-06 21:26 ` [PATCH u-boot 10/12] aspeed: remove CONFIG_PHY_MAX_ADDR Cédric Le Goater
2016-10-10  6:23   ` Joel Stanley
2016-10-06 21:26 ` [PATCH u-boot 11/12] bootm: fix ramdisk relocation Cédric Le Goater
2016-10-10  6:23   ` Joel Stanley
2016-10-10  7:41     ` Cédric Le Goater
2016-10-06 21:26 ` [PATCH u-boot 12/12] aspeed: remove hack loading ramdisk in memory Cédric Le Goater
2016-10-10  6:24   ` Joel Stanley
2016-10-07  7:24 ` [PATCH u-boot 00/12] config cleanups and small fixes Cédric Le Goater
2016-10-10  6:24   ` Joel Stanley
2016-10-10  6:49     ` Joel Stanley
2016-10-10  7:32       ` Cédric Le Goater
2016-10-10  6:57     ` Cédric Le Goater

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.