From patchwork Wed Apr 17 17:19:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Padmarao Begari X-Patchwork-Id: 1087116 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=microchip.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44krDD3cVvz9s71 for ; Thu, 18 Apr 2019 04:21:48 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id C4723C21F1A; Wed, 17 Apr 2019 18:20:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id C5482C21EBF; Wed, 17 Apr 2019 18:19:50 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4F1F5C21DFA; Wed, 17 Apr 2019 17:21:20 +0000 (UTC) Received: from esa4.microchip.iphmx.com (esa4.microchip.iphmx.com [68.232.154.123]) by lists.denx.de (Postfix) with ESMTPS id 61336C21DAF for ; Wed, 17 Apr 2019 17:21:19 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.60,362,1549954800"; d="scan'208";a="30133413" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 17 Apr 2019 10:21:16 -0700 Received: from localhost.localdomain (10.10.76.4) by chn-sv-exch02.mchp-main.com (10.10.76.38) with Microsoft SMTP Server id 14.3.352.0; Wed, 17 Apr 2019 10:21:16 -0700 From: Padmarao Begari To: Date: Wed, 17 Apr 2019 22:49:06 +0530 Message-ID: <1555521546-22325-1-git-send-email-padmarao.begari@microchip.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Apr 2019 18:19:48 +0000 Cc: lewis.hanly@microchip.com, cyril.jean@microchip.com, Padmarao Begari Subject: [U-Boot] [PATCH] riscv:Add Microchip MPFS Icicle Board support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This patch adds Microchip MPFS Icicle Board support. For now, NS16550 serial driver is only enabled. The Microchip MPFS Icicle defconfig by default builds U-Boot for M-Mode with SMP support. Signed-off-by: Padmarao Begari --- arch/riscv/Kconfig | 4 ++ board/microchip/mpfs-icicle/Kconfig | 20 ++++++++++ board/microchip/mpfs-icicle/MAINTAINERS | 7 ++++ board/microchip/mpfs-icicle/Makefile | 7 ++++ board/microchip/mpfs-icicle/mpfs-icicle.c | 31 +++++++++++++++ configs/microchip-mpfs-icicle_defconfig | 16 ++++++++ include/configs/microchip-mpfs-icicle.h | 63 +++++++++++++++++++++++++++++++ 7 files changed, 148 insertions(+) create mode 100644 board/microchip/mpfs-icicle/Kconfig create mode 100644 board/microchip/mpfs-icicle/MAINTAINERS create mode 100644 board/microchip/mpfs-icicle/Makefile create mode 100644 board/microchip/mpfs-icicle/mpfs-icicle.c create mode 100644 configs/microchip-mpfs-icicle_defconfig create mode 100644 include/configs/microchip-mpfs-icicle.h diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index ae8ff7b..df9b2ea 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -17,12 +17,16 @@ config TARGET_QEMU_VIRT config TARGET_SIFIVE_FU540 bool "Support SiFive FU540 Board" +config TARGET_MICROCHIP_MPFS + bool "Support Microchip PolarFire-SoC Icicle Board" + endchoice # board-specific options below source "board/AndesTech/ax25-ae350/Kconfig" source "board/emulation/qemu-riscv/Kconfig" source "board/sifive/fu540/Kconfig" +source "board/microchip/mpfs-icicle/Kconfig" # platform-specific options below source "arch/riscv/cpu/ax25/Kconfig" diff --git a/board/microchip/mpfs-icicle/Kconfig b/board/microchip/mpfs-icicle/Kconfig new file mode 100644 index 0000000..e17ba78 --- /dev/null +++ b/board/microchip/mpfs-icicle/Kconfig @@ -0,0 +1,20 @@ +if TARGET_MICROCHIP_MPFS + +config SYS_BOARD + default "mpfs-icicle" + +config SYS_VENDOR + default "microchip" + +config SYS_CPU + default "generic" + +config SYS_CONFIG_NAME + default "microchip-mpfs-icicle" + +config BOARD_SPECIFIC_OPTIONS # dummy + def_bool y + select GENERIC_RISCV + imply SMP + +endif diff --git a/board/microchip/mpfs-icicle/MAINTAINERS b/board/microchip/mpfs-icicle/MAINTAINERS new file mode 100644 index 0000000..9987efe --- /dev/null +++ b/board/microchip/mpfs-icicle/MAINTAINERS @@ -0,0 +1,7 @@ +Microchip MPFS icicle +M: Padmarao Begari +M: Cyril Jean +S: Maintained +F: board/microchip/mpfs-icicle/ +F: include/configs/microchip-mpfs-icicle.h +F: configs/microchip-mpfs-icicle_defconfig diff --git a/board/microchip/mpfs-icicle/Makefile b/board/microchip/mpfs-icicle/Makefile new file mode 100644 index 0000000..4706586 --- /dev/null +++ b/board/microchip/mpfs-icicle/Makefile @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (C) 2019 Microchip Technology Inc. +# Padmarao Begari +# + +obj-y += mpfs-icicle.o diff --git a/board/microchip/mpfs-icicle/mpfs-icicle.c b/board/microchip/mpfs-icicle/mpfs-icicle.c new file mode 100644 index 0000000..5a23a7d --- /dev/null +++ b/board/microchip/mpfs-icicle/mpfs-icicle.c @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019 Microchip Technology Inc. + * Padmarao Begari + */ + +#include +#include +#include + +#define MPFS_SYSREG_SOFT_RESET ((unsigned int *)0x20002088) + +int board_init(void) +{ + /* For now nothing to do here. */ + + return 0; +} + +#ifdef CONFIG_BOARD_EARLY_INIT_F +int board_early_init_f(void) +{ + unsigned int val; + /* Reset uart peripheral */ + val = readl(MPFS_SYSREG_SOFT_RESET); + val = (val & ~(1u << 5u)); + writel(val, MPFS_SYSREG_SOFT_RESET); + + return 0; +} +#endif diff --git a/configs/microchip-mpfs-icicle_defconfig b/configs/microchip-mpfs-icicle_defconfig new file mode 100644 index 0000000..2d1bd4a --- /dev/null +++ b/configs/microchip-mpfs-icicle_defconfig @@ -0,0 +1,16 @@ +CONFIG_RISCV=y +CONFIG_SYS_TEXT_BASE=0x80000000 +CONFIG_ARCH_RV64I=y +CONFIG_NR_CPUS=5 +CONFIG_TARGET_MICROCHIP_MPFS=y +CONFIG_BOOTDELAY=3 +CONFIG_DISTRO_DEFAULTS=y +CONFIG_SYS_PROMPT="RISC-V # " +CONFIG_FIT=y +CONFIG_DM=y +CONFIG_BAUDRATE=57600 +CONFIG_DM_SERIAL=y +CONFIG_SYS_NS16550=y +CONFIG_NR_DRAM_BANKS=1 +CONFIG_OF_PRIOR_STAGE=y +CONFIG_BOARD_EARLY_INIT_F=y diff --git a/include/configs/microchip-mpfs-icicle.h b/include/configs/microchip-mpfs-icicle.h new file mode 100644 index 0000000..82c7fbb --- /dev/null +++ b/include/configs/microchip-mpfs-icicle.h @@ -0,0 +1,63 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) 2019 Microchip Technology Inc. + * Padmarao Begari + */ + +#ifndef __CONFIG_H +#define __CONFIG_H + +/* + * CPU and Board Configuration Options + */ +#define CONFIG_BOOTP_SEND_HOSTNAME + +/* + * Miscellaneous configurable options + */ +#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */ + +/* + * Print Buffer Size + */ +#define CONFIG_SYS_PBSIZE \ + (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) + +/* + * max number of command args + */ +#define CONFIG_SYS_MAXARGS 16 + +/* + * Boot Argument Buffer Size + */ +#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE + +/* + * Size of malloc() pool + * 512kB is suggested, (CONFIG_ENV_SIZE + 128 * 1024) was not enough + */ +#define CONFIG_SYS_MALLOC_LEN (512 << 10) + +/* + * Physical Memory Map + */ +#define PHYS_SDRAM_0 0x80000000 /* SDRAM Bank #1 */ +#define PHYS_SDRAM_0_SIZE 0x40000000 /* 1 GB */ +#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_0 + +/* Init Stack Pointer */ +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + 0x200000) + +#define CONFIG_SYS_LOAD_ADDR 0x80000000 /* SDRAM */ + +/* + * memtest works on DRAM + */ +#define CONFIG_SYS_MEMTEST_START PHYS_SDRAM_0 +#define CONFIG_SYS_MEMTEST_END (PHYS_SDRAM_0 + PHYS_SDRAM_0_SIZE) + +/* When we use RAM as ENV */ +#define CONFIG_ENV_SIZE 0x2000 + +#endif /* __CONFIG_H */