From f9b2a49f57c153c7358f9769234c0cefdf4de8d4 Mon Sep 17 00:00:00 2001 From: Joel Stanley Date: Wed, 13 Jul 2016 16:39:06 +0930 Subject: board/aspeed: Add ast-g5 board This adds a Aspeed fifth generation board with defconfigs for a system with NCSI and with a directly attached PHY configuration. Signed-off-by: Joel Stanley --- arch/arm/Kconfig | 1 + board/aspeed/ast-g5/Kconfig | 22 ++++++++++++++++++++ board/aspeed/ast-g5/Makefile | 1 + board/aspeed/ast-g5/ast-g5.c | 48 +++++++++++++++++++++++++++++++++++++++++++ configs/ast_g5_ncsi_defconfig | 7 +++++++ configs/ast_g5_phy_defconfig | 8 ++++++++ include/configs/ast-g5-ncsi.h | 29 ++++++++++++++++++++++++++ include/configs/ast-g5-phy.h | 31 ++++++++++++++++++++++++++++ 8 files changed, 147 insertions(+) create mode 100644 board/aspeed/ast-g5/Kconfig create mode 100644 board/aspeed/ast-g5/Makefile create mode 100644 board/aspeed/ast-g5/ast-g5.c create mode 100644 configs/ast_g5_ncsi_defconfig create mode 100644 configs/ast_g5_phy_defconfig create mode 100644 include/configs/ast-g5-ncsi.h create mode 100644 include/configs/ast-g5-phy.h diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 801152ae29..22bb3d4067 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -998,6 +998,7 @@ 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/ast-g5/Kconfig b/board/aspeed/ast-g5/Kconfig new file mode 100644 index 0000000000..9bd3e7de49 --- /dev/null +++ b/board/aspeed/ast-g5/Kconfig @@ -0,0 +1,22 @@ +if TARGET_AST_G5 + +config SYS_ARCH + default "arm" + +config SYS_CPU + default "arm1176" + +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 + +endif diff --git a/board/aspeed/ast-g5/Makefile b/board/aspeed/ast-g5/Makefile new file mode 100644 index 0000000000..d1d7f8525e --- /dev/null +++ b/board/aspeed/ast-g5/Makefile @@ -0,0 +1 @@ +obj-y = ast-g5.o diff --git a/board/aspeed/ast-g5/ast-g5.c b/board/aspeed/ast-g5/ast-g5.c new file mode 100644 index 0000000000..da79d7b79a --- /dev/null +++ b/board/aspeed/ast-g5/ast-g5.c @@ -0,0 +1,48 @@ +/* + * Copyright 2016 IBM Corporation + * + * 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. + */ + +#include +#include + +#include +#include +#include + +DECLARE_GLOBAL_DATA_PTR; + +int board_init(void) +{ + gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; + gd->flags = 0; + + return 0; +} + +int dram_init(void) +{ + u32 vga = ast_scu_get_vga_memsize(); + u32 dram = ast_sdmc_get_mem_size(); + gd->ram_size = dram - vga; + + return 0; +} + +#ifdef CONFIG_FTGMAC100 +int board_eth_init(bd_t *bd) +{ + return ftgmac100_initialize(bd); +} +#endif + +#ifdef CONFIG_ASPEEDNIC +int board_eth_init(bd_t *bd) +{ + return aspeednic_initialize(bd); +} +#endif diff --git a/configs/ast_g5_ncsi_defconfig b/configs/ast_g5_ncsi_defconfig new file mode 100644 index 0000000000..6d11afbbc6 --- /dev/null +++ b/configs/ast_g5_ncsi_defconfig @@ -0,0 +1,7 @@ +CONFIG_ARM=y +CONFIG_TARGET_AST_G5=y +CONFIG_SYS_PROMPT="ast# " +CONFIG_CMD_DHCP=y +CONFIG_CMD_PING=y +CONFIG_SPI_FLASH=y +CONFIG_SYS_NS16550=y diff --git a/configs/ast_g5_phy_defconfig b/configs/ast_g5_phy_defconfig new file mode 100644 index 0000000000..20f62e08f5 --- /dev/null +++ b/configs/ast_g5_phy_defconfig @@ -0,0 +1,8 @@ +CONFIG_ARM=y +CONFIG_TARGET_AST_G5=y +CONFIG_ASPEED_NET_PHY=y +CONFIG_SYS_PROMPT="ast# " +CONFIG_CMD_DHCP=y +CONFIG_CMD_PING=y +CONFIG_SPI_FLASH=y +CONFIG_SYS_NS16550=y diff --git a/include/configs/ast-g5-ncsi.h b/include/configs/ast-g5-ncsi.h new file mode 100644 index 0000000000..f73a8f1150 --- /dev/null +++ b/include/configs/ast-g5-ncsi.h @@ -0,0 +1,29 @@ +/* + * Copyright 2016 IBM Corporation + * + * 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. + * + */ + +#ifndef __AST_G5_NCSI_CONFIG_H +#define __AST_G5_NCSI_CONFIG_H + +#define CONFIG_ARCH_AST2500 +#define CONFIG_SYS_LOAD_ADDR 0x83000000 + +#include + +/* 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 + +#endif /* __AST_G5_NCSI_CONFIG_H */ diff --git a/include/configs/ast-g5-phy.h b/include/configs/ast-g5-phy.h new file mode 100644 index 0000000000..9b10d06212 --- /dev/null +++ b/include/configs/ast-g5-phy.h @@ -0,0 +1,31 @@ +/* + * Copyright 2016 IBM Corporation + * + * 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. + * + */ + +#ifndef __AST_G5_PHY_CONFIG_H +#define __AST_G5_PHY_CONFIG_H + +#define CONFIG_ARCH_AST2500 +#define CONFIG_SYS_LOAD_ADDR 0x83000000 + +#include + +/* arm1176/start.S */ +#define CONFIG_SYS_UBOOT_BASE CONFIG_SYS_TEXT_BASE + +/* 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 + +#endif /* __AST_G5_PHY_CONFIG_H */ -- cgit v1.2.1