From patchwork Fri Mar 3 01:20:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Guo Ren X-Patchwork-Id: 734880 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vZBK14tXyz9s7d for ; Fri, 3 Mar 2017 12:23:33 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 7228E8A6DE; Fri, 3 Mar 2017 01:23:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y4lERC+nvfJs; Fri, 3 Mar 2017 01:23:29 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 6BA0E8A6D6; Fri, 3 Mar 2017 01:23:29 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id F09CD1C015C for ; Fri, 3 Mar 2017 01:23:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id E3C812DB59 for ; Fri, 3 Mar 2017 01:23:27 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R5XDYbFhY8Df for ; Fri, 3 Mar 2017 01:23:21 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp2200-217.mail.aliyun.com (smtp2200-217.mail.aliyun.com [121.197.200.217]) by silver.osuosl.org (Postfix) with ESMTP id 2AA09259BB for ; Fri, 3 Mar 2017 01:23:18 +0000 (UTC) X-Alimail-AntiSpam: AC=CONTINUE; BC=0.04445343|-1; FP=14207229954169066219|2|1|3|0|-1|-1|-1; HT=e02c03310; MF=ren_guo@c-sky.com; NM=1; PH=DU; RN=4; RT=4; SR=0; TI=SMTPD_---.7kAA755_1488504163; Received: from localhost.localdomain(mailfrom:ren_guo@c-sky.com ip:223.93.147.148) by smtp.aliyun-inc.com(10.147.41.187); Fri, 03 Mar 2017 09:23:05 +0800 From: Guo Ren To: buildroot@buildroot.org Date: Fri, 3 Mar 2017 09:20:21 +0800 Message-Id: <1488504021-598-2-git-send-email-ren_guo@c-sky.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1488504021-598-1-git-send-email-ren_guo@c-sky.com> References: <1488504021-598-1-git-send-email-ren_guo@c-sky.com> MIME-Version: 1.0 Cc: Thomas Petazzoni , Thomas De Schampheleire , Guo Ren Subject: [Buildroot] [PATCH 2/2] configs: add defconfig for Nationalchip gx6605s dev board. X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" gx6605s is a nice SOC for dvbs2 DVB product, and C-SKY inside. Signed-off-by: Guo Ren --- DEVELOPERS | 2 + board/csky/gx6605s/gdbinit | 25 ++++++++++ board/csky/post-image.sh | 4 ++ board/csky/readme.txt | 106 +++++++++++++++++++++++++++++++++++++++++ configs/csky_gx6605s_defconfig | 19 ++++++++ 5 files changed, 156 insertions(+) create mode 100644 board/csky/gx6605s/gdbinit create mode 100755 board/csky/post-image.sh create mode 100644 board/csky/readme.txt create mode 100644 configs/csky_gx6605s_defconfig diff --git a/DEVELOPERS b/DEVELOPERS index 361f902..3b4dd58 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -595,6 +595,8 @@ F: package/liquid-dsp/ N: Guo Ren F: arch/Config.in.csky +F: board/csky +F: configs/csky_* N: Gustavo Zacarias F: arch/Config.in.powerpc diff --git a/board/csky/gx6605s/gdbinit b/board/csky/gx6605s/gdbinit new file mode 100644 index 0000000..0a6d8ab --- /dev/null +++ b/board/csky/gx6605s/gdbinit @@ -0,0 +1,25 @@ +tar jtag jtag://127.0.0.1:1025 +reset + +# setup CCR (Cache Config Reg) +# 0-1:MP,2:IE,3:DE,4:WB,5:RS,6:Z,7:BE +set $cr18 = 0x7d + +# vendor custom setup, double cache line & preload +set $cr30 = 0xc + +# pin mux for serial8250 +set *(unsigned int *) 0xa030a14c |= (1 << 22) | (1 << 23) + +# pass devicetree blob +# r2 is magic +# r3 is address +set $r2 = 0x20150401 +set $r3 = 0x92000000 +restore gx6605s.dtb binary 0x92000000 + +# flush cache +set $cr17 = 0x33 + +load + diff --git a/board/csky/post-image.sh b/board/csky/post-image.sh new file mode 100755 index 0000000..7bead4f --- /dev/null +++ b/board/csky/post-image.sh @@ -0,0 +1,4 @@ +#!/bin/sh +# copy board/csky/xxx/gdbinit to images/.gdbinit for +BOARD_DIR="$(dirname $0)" +cp -af $BOARD_DIR/${2}/gdbinit $BINARIES_DIR/.gdbinit diff --git a/board/csky/readme.txt b/board/csky/readme.txt new file mode 100644 index 0000000..f670773 --- /dev/null +++ b/board/csky/readme.txt @@ -0,0 +1,106 @@ +C-SKY Development Kit + +Intro +===== + +C-SKY is a CPU Architecture from www.c-sky.com and has it own instruction set. +Just like arm and mips in linux/arch, it named as 'csky'. + +For C-SKY linux kernel it's made up of three components: +1. linux/arch/csky contains the CPU related linux arch implement, eg: mmu, + task-switch, cache control, ... default git repo is here: + + http://github.com/c-sky/csky-linux + +2. linux/addons contains the SOC's drivers which haven't committed in official + linux source code, but we really need them to make the board run. + Here is the default addons git repo: + + http://github.com/c-sky/csky-addons + + Some C-SKY soc vendor has it own addons git repo. And you can specify + the git-repo in buildroot configuration. + +3. Official Linux kernel source from www.kernel.org :) + +Buildroot will download cross compiler tools and make them together building, +finally setup the rootfs with the packages which spicified in buildroot +configuration. + +How to build it +=============== + +Configure Buildroot +------------------- + +The csky_gx6605s_defconfig configuration is a sample configuration with +all that is required to bring the gx6605s Development Board: + + $ make csky_gx6605s_defconfig + +Build everything +---------------- + +Note: you will need to have access to the network, since Buildroot will +download the packages' sources. + + $ make # All will be done, just wait :) + +Result of the build +------------------- + +After building, you should obtain this tree: + + output/images/ + ├── vmlinux + ├── rootfs.tar + ├── .dtb + └── .gdbinit + +How to run it +============= + +1. Download the Jtag-Server here: + + https://pan.baidu.com/s/1o7VEPbO + + install it and run it: + + $ DebugServerConsole -ddc -rstwait 1000 -prereset -port 1025 + +2. Prepare the nfs-server in your linux PC. You can get the step in google, we + don't mention it here. + + Then extract output/images/rootfs.tar to your nfsroot. + +3. Modified the bootargs in board/csky//.dts'. You should + specify the correct nfsroot= and ip=, for example in gx6605s.dts: + + chosen { + bootargs = "console=ttyS0,115200 init=/sbin/init root=/dev/nfs\ +rw nfsroot=192.168.101.230:/opt/nfs/test,v3,tcp,nolock ip=192.168.101.25"; + } + + You need cd to buildroot dir and '$ make' again to update the dts in + output/images + + +4. Setup the Console with the rate 115200/8-N-1. + +5. cd to the output/images and run. + + For gx6605s, you need plug a usb ethernet card: + $csky-linux-gdb vmlinux + +Finish +====== + +Any question contact me here: + +ren_guo@c-sky.com + +----------- +Best Regards + +Guo Ren + diff --git a/configs/csky_gx6605s_defconfig b/configs/csky_gx6605s_defconfig new file mode 100644 index 0000000..ad99b6c --- /dev/null +++ b/configs/csky_gx6605s_defconfig @@ -0,0 +1,19 @@ +BR2_csky=y +BR2_TOOLCHAIN_EXTERNAL=y +BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y +BR2_TOOLCHAIN_EXTERNAL_URL="https://github.com/c-sky/tools/raw/master/csky-linux-tools-x86_64-glibc-linux-4.9.2-20170227.tar.gz" +BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="csky-linux" +BR2_TOOLCHAIN_EXTERNAL_GCC_4_5=y +BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_9=y +BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y +BR2_TOOLCHAIN_EXTERNAL_CXX=y +BR2_TARGET_GENERIC_GETTY_PORT="ttyS0" +BR2_SYSTEM_DHCP="eth0" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/csky/post-image.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="gx6605s" +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_TARBALL=y +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/c-sky/linux-4.9.y/archive/3549ac308d427b0adb98b410d0acd82449fb5c13.tar.gz" +BR2_LINUX_KERNEL_DEFCONFIG="gx66xx" +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="gx6605s"