diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 445399efe5..18d88cdfd8 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -153,6 +153,10 @@ config TARGET_FBWEDGE100 bool "Support Facebook's OpenBMC Wedge100 TOR" select CPU_ARM926EJS +config TARGET_BFMAVERICKS + bool "Support Barefoot's OpenBMC MAVERICKS TOR" + select CPU_ARM926EJS + config TARGET_FBMINIPACK bool "Support Facebook's OpenBMC Minipack" select CPU_ARM1176 @@ -988,6 +992,7 @@ source "arch/arm/imx-common/Kconfig" source "board/aspeed/Kconfig" source "board/fb-obmc/Kconfig" +source "board/bf-obmc/Kconfig" source "board/bosch/shc/Kconfig" source "board/BuR/brxre1/Kconfig" diff --git a/board/bf-obmc/Kconfig b/board/bf-obmc/Kconfig new file mode 100644 index 0000000000..f4c6d31d62 --- /dev/null +++ b/board/bf-obmc/Kconfig @@ -0,0 +1,12 @@ +if TARGET_BFMAVERICKS +config SYS_CPU + default "arm926ejs" +config SYS_BOARD + default "ast-g4" +config SYS_VENDOR + default "aspeed" +config SYS_SOC + default "aspeed" +config SYS_CONFIG_NAME + default "bfmavericks" +endif diff --git a/board/bf-obmc/MAINTAINER b/board/bf-obmc/MAINTAINER new file mode 100644 index 0000000000..873f9a7b1e --- /dev/null +++ b/board/bf-obmc/MAINTAINER @@ -0,0 +1,6 @@ +BAREFOOT OPENBMC BOARDS +M: Simon Fan +S: Maintained +F: board/bf-obmc/ +F: include/configs/bfmavericks.h +F: configs/bfmavericks_defconfig diff --git a/configs/bfmavericks_defconfig b/configs/bfmavericks_defconfig new file mode 100644 index 0000000000..35c3620b7f --- /dev/null +++ b/configs/bfmavericks_defconfig @@ -0,0 +1,26 @@ +CONFIG_ARM=y +CONFIG_TARGET_BFMAVERICKS=y +CONFIG_SPI_BOOT=y +CONFIG_HUSH_PARSER=y +# CONFIG_CMD_IMLS is not set +# CONFIG_CMD_FLASH is not set +# CONFIG_CMD_FPGA is not set +# CONFIG_CMD_SETEXPR is not set +# CONFIG_OF_LIBFDT=y +# CONFIG_FIT=y +# CONFIG_FIT_VERBOSE=y +# CONFIG_FIT_SIGNATURE=y +# CONFIG_DM=y +# CONFIG_OF_CONTROL=y +# CONFIG_OF_EMBED=y +CONFIG_NETCONSOLE=y +CONFIG_PHYLIB=y +CONFIG_NETDEVICES=y +CONFIG_DEBUG_UART=y +CONFIG_DEBUG_UART_BASE=0x1E783000 +CONFIG_DEBUG_UART_CLOCK=24000000 +CONFIG_SYS_NS16550=y +CONFIG_SPI_FLASH=y +CONFIG_SPI_FLASH_MACRONIX=y +CONFIG_SPI_FLASH_MTD=y +CONFIG_SYS_PROMPT="Mavericks-boot=> " diff --git a/include/configs/bfmavericks.h b/include/configs/bfmavericks.h new file mode 100644 index 0000000000..92d3371756 --- /dev/null +++ b/include/configs/bfmavericks.h @@ -0,0 +1,315 @@ +/* + * (C) Copyright 2004-Present + * Teddy Reed , Facebook, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef __BFMAVERICKS_CONFIG_H +#define __BFMAVERICKS_CONFIG_H + +#define CONFIG_BFMAVERICKS 1 + +#define CONFIG_SYS_LONGHELP + +#define CONFIG_BOOTARGS "debug console=ttyS2,9600n8 root=/dev/ram rw" +#define CONFIG_BOOTFILE "flash-mavericks" + +/* + * Serial configuration + */ +#define CONFIG_SYS_NS16550_COM1 AST_UART3_BASE +#define CONFIG_CONS_INDEX 1 +#define CONFIG_ASPEED_COM AST_UART3_BASE +#define CONFIG_BAUDRATE 9600 + +/* + * UART configurtion + */ +#define CONFIG_ASPEED_UART1_ENABLE +#define CONFIG_ASPEED_UART1_BMC // by default, src is LPC for UART1 +#define CONFIG_ASPEED_UART2_ENABLE +#define CONFIG_ASPEED_UART2_BMC // by default, src is LPC for UART2 +#define CONFIG_ASPEED_UART3_ENABLE +#define CONFIG_ASPEED_UART4_ENABLE + +/* + * NIC configuration + */ +#define CONFIG_MAC2_ENABLE +#define CONFIG_MAC1_PHY_SETTING 0 +#define CONFIG_MAC2_PHY_SETTING 0 +#define CONFIG_MAC2_PHY_LINK_INTERRUPT +#define CONFIG_ASPEED_MAC_NUMBER 2 +#define CONFIG_ASPEED_MAC_CONFIG 2 + +/* + * Watchdog configuration + */ +#define CONFIG_ASPEED_ENABLE_WATCHDOG +#define CONFIG_ASPEED_ENABLE_DUAL_BOOT_WATCHDOG +#define CONFIG_ASPEED_WATCHDOG_DUAL_BOOT_TIMEOUT \ + (CONFIG_ASPEED_WATCHDOG_TIMEOUT - 5) + +#define CONFIG_MII_ +#define CONFIG_CMD_MII + +/* + * SPI flash configuration + */ +#define CONFIG_2SPIFLASH +/* + * (C) Copyright 2004-Present + * Teddy Reed , Facebook, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef __BAREFOOT_CONFIG_H +#define __BAREFOOT_CONFIG_H + +/* + * Verified boot options. + * + * These are general feature flags related to verified boot. + * CONFIG_SPL: Use a dual SPI for booting U-Boot. + * CONFIG_SPL_FIT_SIGNATURE: Enforce verified boot code in ROM. + * CONFIG_SPL_BUILD: Defined when the compilation is for the SPL + * + * CONFIG_SYS_REMAP_BASE: Location U-Boot expects to execute from. + * CONFIG_SYS_UBOOT_START: Similar to CONFIG_SYS_REMAP_BASE + * CONFIG_SYS_ENV_BASE: Flash base address for RW environment data. + * + * Custom build options: + * CONFIG_SYS_SPL_FIT_BASE: The known location of FIT containing U-Boot. + * CONFIG_SYS_RECOVERY_BASE: The known location of the Recovery U-Boot. + * CONFIG_ASPEED_RECOVERY_BUILD: Defined when the compilation is for the Recovery. + */ +#define CONFIG_CS0_SPL_KERNEL_LOAD "200E0000" +#define CONFIG_CS1_SPL_KERNEL_LOAD "280E0000" + +#ifdef CONFIG_SPL +#ifdef CONFIG_ASPEED_RECOVERY_BUILD +#define CONFIG_SYS_REMAP_BASE 0x20015000 +#define CONFIG_SYS_UBOOT_START 0x20015000 /* Must be defined as-is */ +#define CONFIG_KERNEL_LOAD CONFIG_CS0_SPL_KERNEL_LOAD +#else +#define CONFIG_SYS_REMAP_BASE 0x28084000 +#define CONFIG_SYS_UBOOT_START 0x28084000 /* Must be defined as-is */ +#define CONFIG_KERNEL_LOAD CONFIG_CS1_SPL_KERNEL_LOAD +#endif +#define CONFIG_SYS_SPL_FIT_BASE 0x28080000 +#define CONFIG_SYS_RECOVERY_BASE 0x20015000 +#define CONFIG_SYS_ENV_BASE 0x28000000 +#else +/* Legacy non-Verified boot configuration. */ +#define CONFIG_SYS_REMAP_BASE 0x00000000 +#define CONFIG_SYS_UBOOT_START 0x00000000 +#define CONFIG_SYS_ENV_BASE 0x20000000 +#ifdef CONFIG_FIT +#define CONFIG_KERNEL_LOAD "20080000" +#else +#define CONFIG_KERNEL_LOAD "20080000 20480000" +#endif +#endif + +/* + * Requirements: + * Before including this common configuration, the board must include + * the CPU/arch platform configuration. + */ + +/* + * Environment configuration + * This used to have: + * CONFIG_ENV_IS_IN_FLASH + * CONFIG_ENV_IS_IN_SPI_FLASH + * CONFIG_ENV_IS_NOWHERE + */ +#ifndef CONFIG_DEBUG_QEMU +#define CONFIG_ASPEED_WRITE_DEFAULT_ENV +#endif +#if defined(CONFIG_ASPEED_RECOVERY_BUILD) || defined(CONFIG_SPL_BUILD) +/* Prevent the Recovery build from using the RW environment. */ +#define CONFIG_ENV_IS_NOWHERE +#else +#define CONFIG_ENV_IS_IN_FLASH +#define CONFIG_ENV_OVERWRITE +#endif +#define CONFIG_ENV_OFFSET 0x60000 /* environment starts here */ +#define CONFIG_ENV_ADDR (CONFIG_SYS_ENV_BASE + CONFIG_ENV_OFFSET) +#define CONFIG_ENV_SIZE 0x20000 /* # of bytes of env, 128k */ +#ifdef CONFIG_FIT +#define ENV_INITRD_HIGH "" +#else +#define ENV_INITRD_HIGH "initrd_high=a0000000\0" +#endif +#define CONFIG_EXTRA_ENV_SETTINGS \ + "verify=no\0" \ + "spi_dma=no\0" \ + "updatefile=" CONFIG_BOOTFILE ".fit\0" \ + ENV_INITRD_HIGH \ + "" + +/* + * Flash configuration + * It is possible to run using the SMC and not enable flash + * CONFIG_CMD_FLASH + * CONFIG_SYS_NO_FLASH + */ + +/* + * Watchdog timer configuration + */ +#define CONFIG_ASPEED_ENABLE_WATCHDOG +#define CONFIG_ASPEED_WATCHDOG_TIMEOUT (5*60) /* 5 minutes */ +/* #define CONFIG_ASPEED_WATCHDOG_TRIGGER_GPIO */ + +/* + * Miscellaneous configurable options + */ +#define CONFIG_SYS_HZ 1000 +#define CONFIG_SYS_TIMERBASE AST_TIMER_BASE /* use timer 1 */ + +/* + * NIC configuration + */ +#define CONFIG_NET_RANDOM_ETHADDR +#define CONFIG_LIB_RAND + +/* + * Memory Test configuration + */ +#define CONFIG_SYS_MEMTEST_ITERATION 10 + +/* + * Command configuration + */ +#define CONFIG_CMD_PING +#define CONFIG_CMD_DHCP +#define CONFIG_CMD_MEMINFO +#define CONFIG_CMD_MEMTEST +#define CONFIG_CMD_MEMTEST2 +#define CONFIG_CMD_TFTPPUT +#define CONFIG_CMD_FLASH +#define CONFIG_CMD_VBS + +/* + * Additional command configuration + * CONFIG_CMD_I2C + * CONFIG_CMD_EEPROM + */ + +/* + * Additional features configuration + */ +#define CONFIG_SHA256 + +/* Configure the rare, boot-fail aftermath. */ +#ifdef CONFIG_CMD_VBS +/* If this runs then verified-boot failed */ +#define CONFIG_POSTBOOT "vbs 6 60; bootm " CONFIG_CS0_SPL_KERNEL_LOAD "; " +#else +#define CONFIG_POSTBOOT " " +#endif + +/* + * Recovery boot flow + */ +#ifdef CONFIG_ASPEED_RECOVERY_BUILD +#define CONFIG_PREBOOT "setenv verify no; " +#else +#ifdef CONFIG_CMD_VBS +#define CONFIG_PREBOOT "vbs oscheck; " +#else +#define CONFIG_PREBOOT " " +#endif +#endif + +/* + * Basic boot command configuration based on flash + */ +#define CONFIG_BOOTCOMMAND \ + "bootm " CONFIG_KERNEL_LOAD "; " /* Location of FIT */ \ + CONFIG_POSTBOOT + +/* + * Command to run in if CLI is used. + */ +#if defined(CONFIG_CMD_VBS) && defined(CONFIG_SPL) +#define CONFIG_PRECLICOMMAND "vbs interrupt; " +#endif + +/* + * Lock the BMC TPM during provisioning (perform 1-time operations) + */ +#define CONFIG_ASPEED_TPM_LOCK + +#ifdef CONFIG_SPL +#ifdef CONFIG_SPL_BUILD +/* This is an SPL build */ + +#ifndef DEBUG +/* The SPL has size constraints, the debug build may overflow. */ +/* The Tiny-printf works in theory, but has side effects in the SPL. */ +/* #define CONFIG_USE_TINY_PRINTF */ +#else +#define CONFIG_SPL_DISPLAY_PRINT +#endif + +#define CONFIG_SPL_FRAMEWORK +#define CONFIG_SPL_MAX_FOOTPRINT 0x15000 + +/* During an SPL build the base is 0x0. */ +#define CONFIG_SYS_TEXT_BASE 0x00000000 +#define CONFIG_SPL_TEXT_BASE CONFIG_SYS_TEXT_BASE + +/* Grow the stack down from 0x6000 to an expected max of 12kB. */ +#define CONFIG_SPL_STACK (CONFIG_SYS_SRAM_BASE + 0x6000) +#define CONFIG_SYS_INIT_SP_ADDR CONFIG_SPL_STACK + +/* Establish an 'arena' for heap from 0x1000 - 0x3000, 8k */ +#define CONFIG_SYS_SPL_MALLOC_START (CONFIG_SYS_SRAM_BASE + 0x1000) +#define CONFIG_SYS_SPL_MALLOC_SIZE 0x2000 + +/* General SPL build feature includes. */ +#define CONFIG_SPL_LIBGENERIC_SUPPORT +#define CONFIG_SPL_LIBCOMMON_SUPPORT +#define CONFIG_SPL_SERIAL_SUPPORT +#define CONFIG_SPL_I2C_SUPPORT + +/* Verified boot required features. */ +#define CONFIG_SPL_CRYPTO_SUPPORT +#define CONFIG_SPL_HASH_SUPPORT +#define CONFIG_SPL_SHA256_SUPPORT +#define CONFIG_SPL_SHA256 +#define CONFIG_SPL_SHA1 +#define CONFIG_SPL_TPM + +#else +/* This is a U-Boot build */ + +/* During the U-Boot build the base address is the SPL FIT start address. */ +#define CONFIG_SYS_TEXT_BASE CONFIG_SYS_UBOOT_START +#endif +#endif + +/* + * Console UART configuration + */ +#ifndef CONFIG_ASPEED_COM +#define CONFIG_ASPEED_COM AST_UART0_BASE // UART5 +#endif + +/* + * Autoboot configuration + */ +#define CONFIG_AUTOBOOT_PROMPT "autoboot in %d seconds (stop with 'Delete' key)...\n" +#define CONFIG_AUTOBOOT_STOP_STR "\x1b\x5b\x33\x7e" /* 'Delete', ESC[3~ */ +#define CONFIG_AUTOBOOT_KEYED + +#endif /* __BAREFOOT_CONFIG_H */ + +#include "ast2400_common.h" + +#endif /* __BFMAVERICKS_CONFIG_H */