From patchwork Mon Mar 11 08:20:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 149 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 48B113F03C for ; Mon, 11 Mar 2019 09:20:26 +0100 (CET) Received: by mail-pf1-f199.google.com with SMTP id a72sf5319908pfj.19 for ; Mon, 11 Mar 2019 01:20:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1552292425; cv=pass; d=google.com; s=arc-20160816; b=SXR8HVuIunfu5Ac/k8M2vRIiupAlLTZJVOJ333vSumxeuUNFHnDhjecgTbeN/45IIX aRZtfoSZnFA4O8mmGzck0uinXiwlBAFPd3o44o1HekgW7N6RaAI1UvRuvHskAZXfWe0n 1S0rv0RuDsC6iOphOFSq5hQtJKAuO3YIpYyMgt7ig0094QTUSKnDOkxPfl2bUfIPUnnu Ds/p4Re/bIrSpVSiyxWHVyM+fFlZ1jTBPUQbqkMQSSL6dQ2D67Gr43ZxQCXfX9zdrr6G yETw3oSlNjgzVtb1tJUNtbAwcH5WyUEVFfy/9hgzFYumbXxM6jlfvlmAM92PnBwKnhbJ zorQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=9aa4gZtlqG7A4/KkrGSyuH9hy+KtgHQTXS0erVEh4Xg=; b=dkHqQwF2Y01yvP6t98ZyZP2aunCgy4ZcAIovp+7zuXd1akORAXMk/7HV0LhFYJ9KBV krrI6H929yvkimpe5ko64KMuruueTO0wKgbM++OGxUlavUFZBDJ25we+h99Jgi6s1v2/ XBP/SmQSQ0avHzpGtx7qZtp0SBMH+coXi+SdWlkKko5BbtDCQEB/A5h5D7H9nPbTHHpl O3frc2uDp2Wf/+DHcHxEq+y/UYPKT+4qwxQ+u0ih+JEZNlViFNJC7HaG1+xSc2eZyDO2 eG7NNIJSIuxoIaQI4d0u5s7ijw9AuJTZMxs6LI1XcemCVSwe2asqC/0qn4l3acawDmxs aJQw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=qd46G2mv; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=9aa4gZtlqG7A4/KkrGSyuH9hy+KtgHQTXS0erVEh4Xg=; b=f1u1SVojgBBGqI/G+Ba59gn6RtGGWIQniZNjaNflQQAwx9iMW/Dfp9aQJ5wQw+nTJK K7O6ypTsSzfW9KWy4xxfvm8FCFAWwnPqmB/0gg83z2cWBgXY2ourkf66Un7pTPbxuKJD bSuSrORKldNsCN7I65/cKbjvdTWxoo6df3DR0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=9aa4gZtlqG7A4/KkrGSyuH9hy+KtgHQTXS0erVEh4Xg=; b=ktb1WE3845y7ms2JCUSsgod6vn7NKTlKKsEruyVpW+iROriKk9Nbhh12s0hRzwrAOX moNKSuzrOHM9Y/CNNg/8hNDgrL53rqlQUwMM6tI366KNUFpJMZ/f4BmKTX2HSisoS+Ty JOOP/ZHYUyWBcRSq4kD9ucuiwwB8rPcwzLnphPMtAHVFZpyhYRTDw0YRetd7bbfFfpAj 2y1R+7euDN+Syltk8vI6Q4kEGEonHR6313/UXDRAx1T10Sq8v6qc7D7Es1SPmcgYA5u9 kUVbq2zjXuO7NaSPBtiu5w+Qd0oXYZAEDd4aUZo3LVxkhIk0eamKjuusUIfJLlCDiVJ8 AchQ== X-Gm-Message-State: APjAAAVpa0x+OFBFyRt+BI1FfZw0QcwJXxMoCg0olY0YxUyQPbbkmQM2 xbzr5sZZ9XLSZDabeeF9cw5T9Xs4 X-Google-Smtp-Source: APXvYqz9eDBrGCq9iUmvxUiCZqIrytwlflKeaoz8mXDt9faQB299iCqR/w3m8S63HCvcfHFnkhmOBQ== X-Received: by 2002:a63:5142:: with SMTP id r2mr11770291pgl.144.1552292425040; Mon, 11 Mar 2019 01:20:25 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:f51b:: with SMTP id n27ls7389830pfh.8.gmail; Mon, 11 Mar 2019 01:20:24 -0700 (PDT) X-Received: by 2002:a62:1851:: with SMTP id 78mr32486675pfy.206.1552292424631; Mon, 11 Mar 2019 01:20:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552292424; cv=none; d=google.com; s=arc-20160816; b=YOLkhX91ML79NpVjAQCddd4ujg4uc2A8uE24Hk7sCvSZTD9vKZM41zUu4mrQaf9VH3 ep8wgleOh4UOBJR+wbEJQ5ywoDykhsq8q3+OTpzoGmrMALS4VSQpZIpwT9SuH2WDriwo paYmjYJmGzOCBV4LKFJKTjWikuq39erh22khGsuZXH9TY9zCX9uemLR2Gp454eyfEpeF sydzJ+zjrcQFb4qbyFEtW8gvTzq/sWAjfSkEsVJlEfEl5CTWQx8Pdi+YgoS//phzjzHo N+s02dMKJfHM9TfeaYIuwork7uHhZnTZFSHGvtJ7Oj2eCPPgUY12MFYudJHfwyp2P6ky I0gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=nEh3zL+L2OAYpRnKSEWRWv/I8F76inl9g2PWmf2i70g=; b=Kp1LopZqwSiTkG0QiCXU59MQ7Ftg7w8au9DHVTv8Mof88tW59POsRqs5W89K4cguRE uM1BmZcoTRQFgyJIxqBoc6NeORh4xMddwE8OfDvJ4/3ukpPifb0hjtj2/aPPw/mJniLQ P9Xwuu1OTieoh29kNZB/jrqnrvX3liDrTH0xF+hwB+PQPXNoQr207v0oR0Q1jx/K/3vP bE3JAzVHP7lEoMGLJb6rOFq6okmZYV1D1EFGJF45cQGcd5LblEqyhLjckT+qmqHtlQKL Ygts2arA6lZApIEzERlPUq8dC9jQZarmAARF2hVc351cxFyHpQ8bmHpvfCZd7V8YCDFn xATQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=qd46G2mv; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id g67sor7188329plb.5.2019.03.11.01.20.24 for (Google Transport Security); Mon, 11 Mar 2019 01:20:24 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:902:2a48:: with SMTP id i66mr31748093plb.14.1552292424268; Mon, 11 Mar 2019 01:20:24 -0700 (PDT) Received: from localhost.localdomain ([115.97.184.151]) by smtp.gmail.com with ESMTPSA id l5sm8262196pfi.97.2019.03.11.01.20.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 01:20:23 -0700 (PDT) From: Jagan Teki To: Simon Glass , Philipp Tomsich Cc: Kever Yang , zhaoyifan , Akash Gajjar , u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH 4/4] doc: rockchip: Add global doc for rk3399 build/run Date: Mon, 11 Mar 2019 13:50:05 +0530 Message-Id: <20190311082005.18550-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190311082005.18550-1-jagan@amarulasolutions.com> References: <20190311082005.18550-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=qd46G2mv; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Since rockchip have an individual doc/README.rockchip, it would be better to update the same instead of maintaining it separately in board files. So, add the documentation for rk3399 - procedure to build - procedure to boot from SD Signed-off-by: Jagan Teki Reviewed-by: Philipp Tomsich --- doc/README.rockchip | 69 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/doc/README.rockchip b/doc/README.rockchip index ec10ebbc26..b8d693bbc9 100644 --- a/doc/README.rockchip +++ b/doc/README.rockchip @@ -88,8 +88,36 @@ One RV3188 baord is supported: For example: +1. To build RK3288 board: + CROSS_COMPILE=arm-linux-gnueabi- make O=firefly firefly-rk3288_defconfig all +2. To build RK3399 board: + + (export cross compiler path for aarch64) + + 2.1 Compile ATF + + $ git clone https://github.com/ARM-software/arm-trusted-firmware.git + $ cd arm-trusted-firmware + + (export cross compiler path for Cortex-M0 MCU likely arm-none-eabi-) + $ make realclean + $ make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399 + + (copy bl31.elf U-Boot root dir) + $ cp build/rk3399/release/bl31/bl31.elf /path/to/u-boot + + 2.2 Compile U-Boot + + $ cd /path/to/u-boot + $ make orangepi-rk3399_defconfig + $ make + $ make u-boot.itb + + (Get spl/u-boot-spl-dtb.bin, u-boot.itb images and some boards would get + spl/u-boot-spl.bin since it doesn't enable CONFIG_SPL_OF_CONTROL) + (or you can use another cross compiler if you prefer) @@ -225,6 +253,45 @@ tools/mkimage -n rk3188 -T rksd -d spl/u-boot-spl.bin out truncate -s %2048 u-boot.bin cat u-boot.bin | split -b 512 --filter='openssl rc4 -K 7C4E0304550509072D2C7B38170D1711' >> out +Booting from an SD card on RK3399 +================================= + +To write an image that boots from an SD card (assumed to be /dev/sdc): + +1. Prefix rk3399 header to SPL image + + $ cd /path/to/u-boot + $ ./tools/mkimage -n rk3399 -T rksd -d spl/u-boot-spl-dtb.bin out + +2. Write prefixed SPL at 64th sector + + $ sudo dd if=out of=/dev/sdc seek=64 + +3. Write U-Boot proper at 16384 sector + + $ sudo dd if=u-boot.itb of=/dev/sdc seek=16384 + $ sync + +Put this SD (or micro-SD) card into your board and reset it. You should see +something like: + +U-Boot SPL board init +Trying to boot from MMC1 + + +U-Boot 2019.01-00004-g14db5ee998 (Mar 11 2019 - 13:18:41 +0530) + +Model: Orange Pi RK3399 Board +DRAM: 2 GiB +MMC: dwmmc@fe310000: 2, dwmmc@fe320000: 1, sdhci@fe330000: 0 +Loading Environment from MMC... OK +In: serial@ff1a0000 +Out: serial@ff1a0000 +Err: serial@ff1a0000 +Model: Orange Pi RK3399 Board +Net: eth0: ethernet@fe300000 +Hit any key to stop autoboot: 0 +=> Using fastboot on rk3288 ======================== @@ -385,5 +452,7 @@ There are some documents about partitions in the links below. http://rockchip.wikidot.com/partitions -- +Jagan Teki +11 Mar 2019 Simon Glass 24 June 2015