From patchwork Sat Feb 9 06:33:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1039138 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="AC6kDRFB"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="nmNSLSHb"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43xMpT74rBz9s3l for ; Sat, 9 Feb 2019 17:39:13 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 9D9F7C21EA8; Sat, 9 Feb 2019 06:37:27 +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 42619C21EDC; Sat, 9 Feb 2019 06:34:54 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 599F9C22047; Sat, 9 Feb 2019 06:33:43 +0000 (UTC) Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by lists.denx.de (Postfix) with ESMTPS id 5370CC21F8E for ; Sat, 9 Feb 2019 06:33:42 +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=1549694023; x=1581230023; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=7gUybMIIi8xE3XahoPcZEppePSMNLmYnvK9uh+YrWGE=; b=AC6kDRFByVB9MD/qsZzgFvFOmTSxtsHQqr5LhfhHOXhG8YuO19Pn8p89 ZLhh9jIx+B2m42MsWERTxGpSdmW10vvLqWjt3sqO2bZee2I4W/U+PZm4K wa6zQOCJ79vmjh5rtdj4hMvJeCjhRK6k9BeoygUk9V5mWDX+uBEaqmzjv GYmtmd9ddqF0h9N0dXR9SVlai/bqSwpHya40EwDaeSaLtKIy/1WrrNUei tIk6T2EvgX2xt5EbOotByjbgEz656Jt/Iot1Sn8og7m/EDD60eWPKRWJJ S2CHUW1TLkleykpU5/3JXfy4PoBaI35UyzbOW53TcWMhh7EcWgGg+GB1N g==; X-IronPort-AV: E=Sophos;i="5.58,350,1544457600"; d="scan'208";a="102612020" Received: from mail-bn3nam04lp2050.outbound.protection.outlook.com (HELO NAM04-BN3-obe.outbound.protection.outlook.com) ([104.47.46.50]) by ob1.hgst.iphmx.com with ESMTP; 09 Feb 2019 14:33:40 +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=nmNSLSHbuJXlX0LaqP0n8lmRquGI0OBO7FajLy24QbQaauVdkBYh/dgZb+jjnFAwzrMIRcAiluj/pILIIB18MA/tte0YpRKv+PGPCPie2FF7lPEuYDa8i/aCDeFLs7mCbGsVb/SwVODFD0dTx6i6iJOcQgYFBWwZpXEpXT4aGFc= Received: from MN2PR04MB6061.namprd04.prod.outlook.com (20.178.247.148) by MN2SPR01MB0008.namprd04.prod.outlook.com (20.179.144.77) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.17; Sat, 9 Feb 2019 06:33:28 +0000 Received: from MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::2cdb:c465:af57:8be1]) by MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::2cdb:c465:af57:8be1%7]) with mapi id 15.20.1601.016; Sat, 9 Feb 2019 06:33:28 +0000 From: Anup Patel To: Rick Chen , Bin Meng , Joe Hershberger , Michal Simek , Michal Simek , Lukas Auer , Masahiro Yamada , Simon Glass Thread-Topic: [PATCH v6 14/16] riscv: Add SiFive FU540 board support Thread-Index: AQHUwEFehaoz+IN+zE25yAJ3TY/Mdg== Date: Sat, 9 Feb 2019 06:33:28 +0000 Message-ID: <20190209063052.29092-15-anup.patel@wdc.com> References: <20190209063052.29092-1-anup.patel@wdc.com> In-Reply-To: <20190209063052.29092-1-anup.patel@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MA1PR0101CA0047.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::33) To MN2PR04MB6061.namprd04.prod.outlook.com (2603:10b6:208:de::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.49.10] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; MN2SPR01MB0008; 6:yOZy7TPZBc7/vtuzeZ3oNLdzeCFwf8rTL5DWeEjq+U/fUekMpV8LqDSWJ9fTK4fRBa59zkB5CUIUrih1PvKG5kdtN8AEALEbyXK0peZ2kavj1Rdm3ojZ7GEK/yUY2aO1V4Yvw2n3rYUYwMaNSl4g9vjjEyPmMP4pK2PIn+HHRymJAsa8IQo81cHGfezUY0GpoJbK4Bbsqt58ELh+L9sThJbOYsLWLA/PKb0c95icILAav8o/TXOYt79m3Fob5HWn/ugF8nKT2VKtn6JMEc/YCnNTFJ89l/SpSKvEmuzIrGlIdbnGBwkUS7JXsSsUOZJatI0V0DvD6Pn5kVGkqjO9E8UA0ckjd6oGewCEKYAic2DZAi+TJaY3jwimftOpbl0qqsq/x3PNu6/eAVg+32YxXZwQw+W8i20g6G5NBodgaDMnE6aHHCJo+WF/uzXh5uE3/UHaKzqxfUt5s1q6PmuMvw==; 5:PpCcpkySSqsO4e0f0tQxwq3EuHjWuDBVKWgCT0Vg32tZtlqktJWYNNa3OPwKE0AXma+qL2P3gfPcMa5NQPC6aqwCMdrPxalufJAZKjMYpuD+hiy64G7OKzq5xt1dM8JA72PT9wUf3Jlj7rTxH9Vz4dgPDbIdrKMkYbsKmgu4rVw6YYuhq5ta6hLmFdXVbOcT8hryjEJ9LCyEN4MwCMha3Q==; 7:hfc74qKdDyW4ux1UejdiqzgHl5Ok7M2AXUalj9FQpS+QxwGCdD1aS91M7vm8//DQlslGqx1ZDaFSRnosGDgp434jruoJBpyXqpuKVjmtfDhLplbVENu69oFRMPrszWnVjxploUbxeoCjbU5Jq32QoQ== x-ms-office365-filtering-correlation-id: ff460fa2-bbe0-48ec-185e-08d68e588072 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:MN2SPR01MB0008; x-ms-traffictypediagnostic: MN2SPR01MB0008: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-forefront-prvs: 09435FCA72 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6029001)(376002)(366004)(396003)(346002)(39860400002)(136003)(189003)(199004)(99286004)(1076003)(76176011)(55236004)(186003)(102836004)(52116002)(6436002)(72206003)(6506007)(71190400001)(71200400001)(478600001)(26005)(6512007)(68736007)(53936002)(386003)(97736004)(256004)(6116002)(3846002)(105586002)(305945005)(86362001)(2616005)(81156014)(8676002)(50226002)(25786009)(446003)(7736002)(106356001)(476003)(11346002)(2906002)(66066001)(14454004)(6486002)(44832011)(486006)(7416002)(36756003)(316002)(54906003)(4326008)(110136005)(8936002)(81166006); DIR:OUT; SFP:1102; SCL:1; SRVR:MN2SPR01MB0008; H:MN2PR04MB6061.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: eSvEm442rgMcXDp5ZcIfJmlHOj009CVN55x1fUsVaVfZGH2j+COx7oydTWiF26FQT++saP9/qRWsNqW0Ekh6nglhte8H5q2+YC4RSk2sCQG522Rr8WO1i3kStdy7Z0LMBqcA3JX014TpSiEkgwEQSzik5QYzd1PyJim1Z3uXHacIbzMBRNgJa1Rp89QQuvGsGkWaRDyGjz6LcS80TxpC1ejSNkh4eP7LGZxzKbiq01Zv4tmnep23M+kZmPTIKnnvwSidU42A9mG5EpooqQKKh0kKjzrxmHMUJBEUd8mplx1R9Th+0ziEMAySW/jbUUCDglU2xBK1BWyUBd8U37/xurUyoPND0qZjxKU3ZhRQJotcfeaQhAlDm1dQrbWBeRMDmmct2sh8kSL7HJdZCMDpGpIgPDJC7yILAmhefBC0/6c= MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: ff460fa2-bbe0-48ec-185e-08d68e588072 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Feb 2019 06:33:23.9970 (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: MN2SPR01MB0008 Cc: Palmer Dabbelt , Alexander Graf , U-Boot Mailing List Subject: [U-Boot] [PATCH v6 14/16] 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 */