From patchwork Mon Oct 19 06:06:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Chou X-Patchwork-Id: 532167 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 93D95140273 for ; Mon, 19 Oct 2015 17:06:41 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 389994B74E; Mon, 19 Oct 2015 08:06:40 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nJIXjwPWOj7V; Mon, 19 Oct 2015 08:06:39 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 764A94B6E8; Mon, 19 Oct 2015 08:06:39 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4429B4B6E8 for ; Mon, 19 Oct 2015 08:06:36 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5mtb6gMsD7JT for ; Mon, 19 Oct 2015 08:06:36 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from www.wytron.com.tw (220-134-43-68.HINET-IP.hinet.net [220.134.43.68]) by theia.denx.de (Postfix) with ESMTP id 712094B6DC for ; Mon, 19 Oct 2015 08:06:31 +0200 (CEST) Received: from localhost.localdomain (unknown [192.168.1.250]) by www.wytron.com.tw (Postfix) with ESMTP id E92D6D00307; Mon, 19 Oct 2015 14:06:28 +0800 (CST) From: Thomas Chou To: u-boot@lists.denx.de Date: Mon, 19 Oct 2015 14:06:16 +0800 Message-Id: <1445234776-18489-1-git-send-email-thomas@wytron.com.tw> X-Mailer: git-send-email 2.1.4 Cc: Marek Vasut , clsee@altera.com, lftan@altera.com Subject: [U-Boot] [PATCH] nios2: add README.nios2 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add README.nios2 about how to add nios2 boards to u-boot. Signed-off-by: Thomas Chou --- doc/README.nios2 | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 doc/README.nios2 diff --git a/doc/README.nios2 b/doc/README.nios2 new file mode 100644 index 0000000..9f248ac --- /dev/null +++ b/doc/README.nios2 @@ -0,0 +1,86 @@ +Nios II is a 32-bit embedded-processor architecture designed +specifically for the Altera family of FPGAs. + +Please refer to the link for more information on Nios II, +https://www.altera.com/products/processors/overview.html + +Please refer to the link for Linux port and toolchains, +http://rocketboards.org/foswiki/view/Documentation/NiosIILinuxUserManual + +The Nios II port of u-boot is controlled by device tree. To add a new +board/configuration (eg, mysystem) to u-boot, you will need three files. + +1. The device tree source which descibe the hardware, dts file. + arch/nios2/dts/mysystem.dts + +2. Default configuration of Kconfig, defconfig file. + configs/mysystem_defconfig + +3. The legacy board header file. + include/configs/mysystem.h + +The device tree source must be generated from your qsys/sopc design file +using the sopc2dts tool. Then modified to fit your configuration. Please +find the sopc2dts download and usage at the wiki, +http://www.alterawiki.com/wiki/Sopc2dts + +java -jar sopc2dts.jar --force-altr -i mysystem.sopcinfo -o mysystem.dts + +You will need to add additional properties to the dts. Please find an +example at, arch/nios2/dts/3c120_devboard.dts. + +1. Add "u-boot,dm-pre-reloc" property to the cpu and the serial node +which you will use for console. + +2. Add "stdout-path=..." property with your serial path to the chosen +node. + +Next, you will need a default config file. You may start with +nios2-generic_defconfig, modify the options and save it. + +make nios2-generic_defconfig +make menuconfig +make savedefconfig +cp defconfig configs/mysystem_defconfig + +You will need to change the names of board header file and device tree, +and select the drivers. + +Nios II architecture ---> + (mysystem) Board header file +Device Tree Control ---> + (mysystem) Default Device Tree for DT control + +There is a selection of "Provider of DTB for DT control" in the Device +Tree Control menu. + +( ) Separate DTB for DT control, will cat the dtb to end of u-boot +binary, output u-boot-dtb.bin. This should be used for production. +If you use boot copier, like epcs boot copier, make sure the copier +copies all the u-boot-dtb.bin, not just u-boot.bin. + +( ) Embedded DTB for DT control, will include the dtb inside the u-boot +binary. This is handy for development, eg, using gdb or nios2-download. + +The last thing, legacy board header file describes those config options +not covered in Kconfig yet. You may copy it from nios2-generic.h. + +cp include/configs/nios2-generic.h include/configs/mysystem.h + +Please change the sdram base and size to your board. The base should be +cached virtual address, for nios2 with mmu it is 0xCxxx-xxxx to +0xDxxx-xxxx. + +#define CONFIG_SYS_SDRAM_BASE 0xD0000000 +#define CONFIG_SYS_SDRAM_SIZE 0x08000000 + +You will need to change the environment variables location and setting, +too. You may change other configs to fit your board. + +After all these changes, you may build and test. + +export CROSS_COMPILE=nios2-elf- (or nios2-linux-gnu-) +make mysystem_defconfig +make + +Enjoy!