From patchwork Wed Jan 23 04:26:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1029652 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=fail (p=none dis=none) header.from=wdc.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.b="YS99dVe2"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="c3JZM0YI"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43ksqh0Qsbz9s3l for ; Wed, 23 Jan 2019 15:33:52 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id C6739C21C3F; Wed, 23 Jan 2019 04:32:03 +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=KHOP_BIG_TO_CC, T_DKIM_INVALID 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 1F5FFC21CB6; Wed, 23 Jan 2019 04:28:03 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C52C9C21D72; Wed, 23 Jan 2019 04:28:00 +0000 (UTC) Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by lists.denx.de (Postfix) with ESMTPS id C260FC21E1B for ; Wed, 23 Jan 2019 04:26:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1548217593; x=1579753593; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=7gUybMIIi8xE3XahoPcZEppePSMNLmYnvK9uh+YrWGE=; b=YS99dVe2WKFm4+hWRtQTAwS+gKBGSb7+DTsNK7gfB3qQPuROeKtGpjWu nQcZbxEf/SH640yFBjF0bwIRcIneiDi8GHojdvmPslzxm4emqWcYy5ese 89OUyBDZgQVhdgtGIF6DZaf6FRp0Zwnur2MSmr/pmN2U3w36v/3/kM1gO pCMHo+zovkxYfQ0+aaLj7FjV+Kz/IJl+rRCJ/Idf8Cf6R7C4S2NyjIF2I 7wPGQW/73fpAQnGmU82h0K5fm/PYjK+vOz7W/jqEwGSg+c7So9qWUHiWP pInnzwWss2irObr1zV8hSOzuP7AR9U6F6uLutKcievHu3VVmRzUqDZOHo Q==; X-IronPort-AV: E=Sophos;i="5.56,509,1539619200"; d="scan'208";a="197614650" Received: from mail-co1nam05lp2059.outbound.protection.outlook.com (HELO NAM05-CO1-obe.outbound.protection.outlook.com) ([104.47.48.59]) by ob1.hgst.iphmx.com with ESMTP; 23 Jan 2019 12:26:29 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8YYyD6Dw2mJSOvth8WFUujj1bvrUsN7YleCCeljZoc8=; b=c3JZM0YIfy28bXWKuO3visBLVhS0uqYYPyKN9NL07IsryhkBmRTHb380UPJitN0B+eVrZXL7BtU1Fz4qXrY71+mDaWW/hLOdrRpskNRO1R6AGJrT4F6mqsYN8l2imFJ9sQpzdX6Nm7YN+lNeEzNUAEH1mg+V/G2jwT4ypWE6yhI= Received: from BYAPR04MB5303.namprd04.prod.outlook.com (20.178.49.148) by BYAPR04MB5320.namprd04.prod.outlook.com (20.178.49.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1537.29; Wed, 23 Jan 2019 04:26:18 +0000 Received: from BYAPR04MB5303.namprd04.prod.outlook.com ([fe80::add1:92cc:65d7:5d94]) by BYAPR04MB5303.namprd04.prod.outlook.com ([fe80::add1:92cc:65d7:5d94%2]) with mapi id 15.20.1537.031; Wed, 23 Jan 2019 04:26:18 +0000 From: Anup Patel To: Rick Chen , Bin Meng , Joe Hershberger , Michal Simek , Michal Simek , Lukas Auer , Masahiro Yamada , Simon Glass Thread-Topic: [PATCH v3 11/12] riscv: Add SiFive FU540 board support Thread-Index: AQHUstPJkHlcoZmLk0yB+Boyup44Fg== Date: Wed, 23 Jan 2019 04:26:18 +0000 Message-ID: <20190123042442.106038-12-anup.patel@wdc.com> References: <20190123042442.106038-1-anup.patel@wdc.com> In-Reply-To: <20190123042442.106038-1-anup.patel@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MAXPR0101CA0055.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:e::17) To BYAPR04MB5303.namprd04.prod.outlook.com (2603:10b6:a03:c8::20) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Anup.Patel@wdc.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [49.207.55.146] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BYAPR04MB5320; 6:M7C3MEOGqyiyedpsxwVpdwpj5EFOOiH6Lm808jAuemjjgM6VxROBYglf5M7NgaOxwmcJlTTB5PrkiRzJ7fpCgWoKAoNE0GZ3lxWeXGobVqifu+rXsmY/SJx46IT9cklx5bdMzGqQknXflcKOO50fuYcTtCzvUjOq4E5SvQjqw0GKcMf2hEiF2tGAQDUxYokiXaYhxC50t0IseDn6dCPMLlnmoGpC19jsKG2w9J/b3VMOHP1olLwYv+2+Q/hpmASmeOHrrU/u8m4JbOmQqtFWwfXAtvYzWnHIlWt2JJ2+u3BiV4KlGL+iZ8zKlsyytDQfPLHPFB/93cyLkVoEV9Ea5XPgJqYeSNeFHXPRBuurfg2ehmjnDshu2trZON/tj1w7wFFinSN0powoQYEyjkCV1zy+la5brLoI4v+5pKmTr7zS3B5jnr7pSm6GeLaPqKqKxtQ/SYxeSP91s8vdH+r0Fw==; 5:pM0vdMP6adasHXPOZ3AKOvnY8f7UqwuRDQcS7Upju+7B6V+aSOsrnn/T9vTcUHICFogdn1YUsjiq+wqGanKD1t9fV6om+zsN+A7+N/CHBVmylUnt0MaDkZzXSCs2IMrbS9p1pEfwfKfZFTucK+WRuLk7IN62R3nGtCNcwNangp9xMUqEpkakbs/LW9AgzQRT89xwpQs0l0GsxxZlaHUyeQ==; 7:Y9GHJOPrat6+W8Cuhae7iE0oNUB68jX6mUl8AZvmpsBtgJjmnWdJNeHQ3g1p/MValdbdliaqRzbnDNA61DDwbDfL2KsPHVt9sT9P0I6MyWZ0TnLUTwl8K+ReYBUXPksbRq3sGZ1cjIuFOZmUTvDGcw== x-ms-office365-filtering-correlation-id: 9db58ccc-7e17-4198-9d29-08d680eaeb8d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:BYAPR04MB5320; x-ms-traffictypediagnostic: BYAPR04MB5320: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-forefront-prvs: 0926B0E013 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6029001)(39860400002)(396003)(366004)(136003)(346002)(376002)(189003)(199004)(7416002)(54906003)(6506007)(102836004)(106356001)(110136005)(316002)(386003)(99286004)(14454004)(8676002)(76176011)(6512007)(68736007)(55236004)(305945005)(7736002)(478600001)(105586002)(66066001)(97736004)(52116002)(72206003)(2906002)(6116002)(6436002)(6486002)(3846002)(86362001)(486006)(256004)(36756003)(53936002)(186003)(476003)(44832011)(1076003)(8936002)(25786009)(71190400001)(71200400001)(50226002)(4326008)(39060400002)(2616005)(81166006)(11346002)(81156014)(26005)(446003); DIR:OUT; SFP:1102; SCL:1; SRVR:BYAPR04MB5320; H:BYAPR04MB5303.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: LeAL+GKceYG8SO3utIMFI0UPMF3eKLeX2v4Eb+CZSTc0kx+jxp4VMXGWYwUZNDY2rXkosOG8t3dA/jPcH5+SeXIbmCKpotu7OKgCiDOfy9DbTrK/AzaozmNUxQxLnk/M9dP63I6OqbseVU8JBIQv6ut2M0GBkKhpoTZI30bFu8XMyY20I4ol5AVibZw9ELngx1IXA6GFohY5VBjGB3gnxvIXZGtPJzo0IauqJZm2rol9MyIb9jqHUN/RsmmglR5wTOLf27Ko+VC6B2+MT8MkAyS0sSrW5caa8rM8Fi59i15SwYCXsnYcn+aJtAPOM9fX8Kk1iSQXTjEKLSR1VCFuc2BIz5WEsp2jiG+kWpyfKmxZbRR1BqYYWcjGWH3PN/zja1chacERBNoZiw92JvASyTkZiKvnAPuTC6Y4cnwX6Lo= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9db58ccc-7e17-4198-9d29-08d680eaeb8d X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jan 2019 04:26:14.5257 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR04MB5320 Cc: Palmer Dabbelt , U-Boot Mailing List , Alexander Graf , Christoph Hellwig , Paul Walmsley Subject: [U-Boot] [PATCH v3 11/12] riscv: Add SiFive FU540 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 SiFive FU540 board support. For now, only SiFive serial, SiFive PRCI, and Cadance MACB drivers are only enabled. The SiFive FU540 defconfig by default builds U-Boot for S-Mode because U-Boot on SiFive FU540 will run in S-Mode as payload of BBL or OpenSBI. Signed-off-by: Atish Patra Signed-off-by: Anup Patel Reviewed-by: Alexander Graf Reviewed-by: Lukas Auer Reviewed-by: Bin Meng --- arch/riscv/Kconfig | 4 ++++ board/sifive/fu540/Kconfig | 42 +++++++++++++++++++++++++++++++++ board/sifive/fu540/MAINTAINERS | 9 +++++++ board/sifive/fu540/Makefile | 5 ++++ board/sifive/fu540/fu540.c | 17 ++++++++++++++ configs/sifive_fu540_defconfig | 11 +++++++++ include/configs/sifive-fu540.h | 43 ++++++++++++++++++++++++++++++++++ 7 files changed, 131 insertions(+) create mode 100644 board/sifive/fu540/Kconfig create mode 100644 board/sifive/fu540/MAINTAINERS create mode 100644 board/sifive/fu540/Makefile create mode 100644 board/sifive/fu540/fu540.c create mode 100644 configs/sifive_fu540_defconfig create mode 100644 include/configs/sifive-fu540.h diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 6879047ff7..36512a8995 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -14,11 +14,15 @@ config TARGET_AX25_AE350 config TARGET_QEMU_VIRT bool "Support QEMU Virt Board" +config TARGET_SIFIVE_FU540 + bool "Support SiFive FU540 Board" + endchoice # board-specific options below source "board/AndesTech/ax25-ae350/Kconfig" source "board/emulation/qemu-riscv/Kconfig" +source "board/sifive/fu540/Kconfig" # platform-specific options below source "arch/riscv/cpu/ax25/Kconfig" diff --git a/board/sifive/fu540/Kconfig b/board/sifive/fu540/Kconfig new file mode 100644 index 0000000000..6be3d88144 --- /dev/null +++ b/board/sifive/fu540/Kconfig @@ -0,0 +1,42 @@ +if TARGET_SIFIVE_FU540 + +config SYS_BOARD + default "fu540" + +config SYS_VENDOR + default "sifive" + +config SYS_CPU + default "generic" + +config SYS_CONFIG_NAME + default "sifive-fu540" + +config SYS_TEXT_BASE + default 0x80000000 if !RISCV_SMODE + default 0x80200000 if RISCV_SMODE + +config BOARD_SPECIFIC_OPTIONS # dummy + def_bool y + select GENERIC_RISCV + imply CMD_DHCP + imply CMD_EXT2 + imply CMD_EXT4 + imply CMD_FAT + imply CMD_FS_GENERIC + imply CMD_NET + imply CMD_PING + imply CLK_SIFIVE + imply CLK_SIFIVE_FU540_PRCI + imply DOS_PARTITION + imply EFI_PARTITION + imply IP_DYN + imply ISO_PARTITION + imply MACB + imply MII + imply NET_RANDOM_ETHADDR + imply PHY_LIB + imply PHY_MSCC + imply SIFIVE_SERIAL + +endif diff --git a/board/sifive/fu540/MAINTAINERS b/board/sifive/fu540/MAINTAINERS new file mode 100644 index 0000000000..702d803ad8 --- /dev/null +++ b/board/sifive/fu540/MAINTAINERS @@ -0,0 +1,9 @@ +SiFive FU540 BOARD +M: Paul Walmsley +M: Palmer Dabbelt +M: Anup Patel +M: Atish Patra +S: Maintained +F: board/sifive/fu540/ +F: include/configs/sifive-fu540.h +F: configs/sifive_fu540_defconfig diff --git a/board/sifive/fu540/Makefile b/board/sifive/fu540/Makefile new file mode 100644 index 0000000000..6e1862c475 --- /dev/null +++ b/board/sifive/fu540/Makefile @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (c) 2019 Western Digital Corporation or its affiliates. + +obj-y += fu540.o diff --git a/board/sifive/fu540/fu540.c b/board/sifive/fu540/fu540.c new file mode 100644 index 0000000000..5adc4a3d4a --- /dev/null +++ b/board/sifive/fu540/fu540.c @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) 2019 Western Digital Corporation or its affiliates. + * + * Authors: + * Anup Patel + */ + +#include +#include + +int board_init(void) +{ + /* For now nothing to do here. */ + + return 0; +} diff --git a/configs/sifive_fu540_defconfig b/configs/sifive_fu540_defconfig new file mode 100644 index 0000000000..2f8cca9de0 --- /dev/null +++ b/configs/sifive_fu540_defconfig @@ -0,0 +1,11 @@ +CONFIG_RISCV=y +CONFIG_TARGET_SIFIVE_FU540=y +CONFIG_RISCV_SMODE=y +CONFIG_ARCH_RV64I=y +CONFIG_DISTRO_DEFAULTS=y +CONFIG_NR_DRAM_BANKS=1 +CONFIG_FIT=y +CONFIG_DISPLAY_CPUINFO=y +CONFIG_DISPLAY_BOARDINFO=y +CONFIG_CMD_MII=y +CONFIG_OF_PRIOR_STAGE=y diff --git a/include/configs/sifive-fu540.h b/include/configs/sifive-fu540.h new file mode 100644 index 0000000000..7007b5f6af --- /dev/null +++ b/include/configs/sifive-fu540.h @@ -0,0 +1,43 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (c) 2019 Western Digital Corporation or its affiliates. + * + * Authors: + * Anup Patel + */ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#include + +#define CONFIG_SYS_SDRAM_BASE 0x80000000 +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + SZ_2M) + +#define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + SZ_2M) + +#define CONFIG_SYS_MALLOC_LEN SZ_8M + +#define CONFIG_SYS_BOOTM_LEN SZ_16M + +#define CONFIG_STANDALONE_LOAD_ADDR 0x80200000 + +/* Environment options */ +#define CONFIG_ENV_SIZE SZ_4K + +#define BOOT_TARGET_DEVICES(func) \ + func(DHCP, dhcp, na) + +#include + +#define CONFIG_EXTRA_ENV_SETTINGS \ + "fdt_high=0xffffffffffffffff\0" \ + "initrd_high=0xffffffffffffffff\0" \ + "kernel_addr_r=0x80600000\0" \ + "fdt_addr_r=0x82200000\0" \ + "scriptaddr=0x82300000\0" \ + "pxefile_addr_r=0x82400000\0" \ + "ramdisk_addr_r=0x82500000\0" \ + BOOTENV + +#endif /* __CONFIG_H */