From patchwork Tue Feb 5 13:05:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1036736 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="TnGsIx17"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="Dze/Mgxk"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43v4gk0CrFz9s4V for ; Wed, 6 Feb 2019 00:10:25 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id B1005C21F5E; Tue, 5 Feb 2019 13:09:19 +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.6 required=5.0 tests=KHOP_BIG_TO_CC, RCVD_IN_SORBS_WEB, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 0D91FC21F51; Tue, 5 Feb 2019 13:09:18 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6E680C21F32; Tue, 5 Feb 2019 13:05:57 +0000 (UTC) Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by lists.denx.de (Postfix) with ESMTPS id 5D6B9C21EBE for ; Tue, 5 Feb 2019 13:05:52 +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=1549371953; x=1580907953; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=7gUybMIIi8xE3XahoPcZEppePSMNLmYnvK9uh+YrWGE=; b=TnGsIx17NS2K+kuoUpQ9i1ovw7ajd41fYDdSrGwMez0mFIEcXDOsxloA peso+VFce0FceLhXfyXXthCtLLPMJeeigtDmesaL7jKGKIAPYUOr+QEpx hYOR86N4U9Zl/HGoEQs/KVgCI8iasN/7cFLrayXoOfWOCv4O4ga99kg44 ZJVgFjQlnqZo7v/0EINkOP/Cnp0W4kIR6jUWoNLdHwVzXnBtLEzuWeGtW jOOb5tCiDxw0XUIRbdl7TxU0Drm0CET3Mtw7ktLIWD8eSMP6vFpWPS5HI 9WFXdAnvh4ERNWOuW7eKKtcvYy/ecSF/K7oXK7/7Sv7wDHznG8NcM+cE5 Q==; X-IronPort-AV: E=Sophos;i="5.56,564,1539619200"; d="scan'208";a="102319802" Received: from mail-by2nam05lp2053.outbound.protection.outlook.com (HELO NAM05-BY2-obe.outbound.protection.outlook.com) ([104.47.50.53]) by ob1.hgst.iphmx.com with ESMTP; 05 Feb 2019 21:05:51 +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=Dze/Mgxk5+u67M27aGVg5NaOO5+xs2+TSiHhevI+KMzt3uN9oW6ky1JLZOtZZcA1BFfi7PMZYS7jPqj3S4Pwr/cgDgi9cEIHQOXfmb071jE7laX3RjgbEcADpOzB/G0EhiywLmV7FqetQqXQ36aIgbXoGkWafGZ/lYpRUVZiK3Y= Received: from BYAPR04MB5303.namprd04.prod.outlook.com (20.178.49.148) by BYAPR04MB4680.namprd04.prod.outlook.com (52.135.240.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1580.17; Tue, 5 Feb 2019 13:05:49 +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.1580.019; Tue, 5 Feb 2019 13:05:49 +0000 From: Anup Patel To: Rick Chen , Bin Meng , Joe Hershberger , Michal Simek , Michal Simek , Lukas Auer , Masahiro Yamada , Simon Glass Thread-Topic: [PATCH v5 14/15] riscv: Add SiFive FU540 board support Thread-Index: AQHUvVOEIqJgMQsMxUaw/rHpvNw8Aw== Date: Tue, 5 Feb 2019 13:05:49 +0000 Message-ID: <20190205130346.77175-15-anup.patel@wdc.com> References: <20190205130346.77175-1-anup.patel@wdc.com> In-Reply-To: <20190205130346.77175-1-anup.patel@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MAXPR0101CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:e::33) 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.104] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BYAPR04MB4680; 6:G1XgMSCoyC5LtXAMgWj2slU7vZWEHGTRKVlshmLB7+nYHjZXpfSHtT3CVZrfFVJ/N6esA95fD291CRIrdVwq83+6/MuTEj2k1+CGmrhK13dynXEUftuLb2o8PlGdvqsDPzrvFlBHsecx7LM2xc2by2ryXxOKU/XA9mdBwdmWQOeJtLOEPv4JCMp/YoYuXnFOg7NETT2nSDLOM3LQ+G3TXlh060u+pfQcLocUs7SQrz8LzPJkZMabEONcuNPTRN6OD4KyRO18V8To2GmxIW8nrBECFEaCsJp6JrPBdZkwlnPmws71CuDjreG9YjWJK4Ca1QW6pLhF63zV5w+Zizx2e5GbjNGziasHbsAbwdE7Gwe/cCm09NdZFBa818LnWxqrMnK1s2D2Cn9jcwWrrJoGdRBv19CYJV3QTcq8PZBHWiLDSV0vM+69iKxuCFNvucAc+BZkkDv9aEsLJ17b/EP7YQ==; 5:/hmfXWemaPAnW7dBHHgmuDC9loW8x4m3vvy8UbPh3UWFSl1a7IMbjS6S3Wl3OJ/OQunrvfMB2+Z9fO0hb8E2+0/U+RvafJ7QI12oU8KqbCG83GBpXDpuqW9XJ6U3xC8oFa4tBm0Ih6PEv8mQQQ9X2PjzrgXnufFD/bnhYDSx17cg5q9YcEhiIbKSZ+PMjTADNwcb8RJr/L/NeGGRatYPgA==; 7:bWsUB0QrQFli27VhZHJLHCWK6Nl0g7SYou2tt3Si1I7O7zgvHDWzcRepn560TvG5jIfTzj6sCV3iwTs76OYUd4KJtoNzoxEwScvNt5h8ZXiKR2Cp3qWf90f8Jpy/v9Fni8ddS6T6OIUAoVznR9pDfw== x-ms-office365-filtering-correlation-id: 7ce4daf6-c719-428e-9f1a-08d68b6aa64e x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(4618075)(2017052603328)(7153060)(7193020); SRVR:BYAPR04MB4680; x-ms-traffictypediagnostic: BYAPR04MB4680: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-forefront-prvs: 0939529DE2 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6029001)(39860400002)(136003)(376002)(366004)(396003)(346002)(189003)(199004)(44832011)(7736002)(66066001)(486006)(6116002)(7416002)(1076003)(50226002)(2906002)(8936002)(8676002)(99286004)(3846002)(76176011)(305945005)(14454004)(316002)(478600001)(72206003)(6512007)(52116002)(54906003)(110136005)(386003)(102836004)(256004)(105586002)(25786009)(97736004)(26005)(106356001)(6506007)(86362001)(4326008)(81156014)(55236004)(81166006)(6486002)(2616005)(446003)(71190400001)(476003)(6436002)(53936002)(36756003)(71200400001)(11346002)(68736007)(186003); DIR:OUT; SFP:1102; SCL:1; SRVR:BYAPR04MB4680; 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: F7d4zosum6XOkhqZLrv8BRhQmL4C2XaM5rsD6L2hcyB+Z4gn/zxzKS52G/WV5AVc0RfquXmIOe9yq9yVJPSR/whz8PPUa0dIIjGB1279GLhQ/It3p7dfDVkNdPDy38it+TqvrOYZ0NZqBzatrp7fZWEIr5rJOQGcOV5RCFz1IqdJc6JovJyEKqYOs/0Uw//3OHiukmrGtb1ZXSKiSx/HsyKZvbZcKSKMXqVmIw9waNeAo4ISAiceT+Oub88b1GyjNrECInIsGWoQe7wDbAceixwShEqmpjUj5oJ2+VOqSGpWaiBnLR1afxnrYvJ8dT2Nl+HZANdTwrL2zCfBc1iXpWjuA1jbkEorRfabpS6UyydpUxxCB7qcoL0CwOYRSxuLJXtVtB0Ew+sPS1eUE9c3KsGrqSLuUUZmrNFh7VLDvn0= MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7ce4daf6-c719-428e-9f1a-08d68b6aa64e X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Feb 2019 13:05:45.5206 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR04MB4680 Cc: Palmer Dabbelt , U-Boot Mailing List , Alexander Graf , Christoph Hellwig Subject: [U-Boot] [PATCH v5 14/15] 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 */