summaryrefslogtreecommitdiff
path: root/board/vamrs
diff options
context:
space:
mode:
authorManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>2018-09-28 00:32:59 +0530
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>2018-12-06 16:04:49 +0100
commit1bad5e14922c63abb3808c6b09af40b30a4171d2 (patch)
tree37adcef33023f85830df323ec9e2e70e022ea2c9 /board/vamrs
parent2c9050cd3d183eb31c035edfd0c3f08b54246ea3 (diff)
downloadu-boot-1bad5e14922c63abb3808c6b09af40b30a4171d2.tar.gz
u-boot-1bad5e14922c63abb3808c6b09af40b30a4171d2.tar.bz2
u-boot-1bad5e14922c63abb3808c6b09af40b30a4171d2.zip
rockchip: rk3399: Add common Rock960 family from Vamrs
Rock960 is a family of boards based on Rockchip RK3399 SoC from Vamrs. It consists of Rock960 (Consumer Edition) and Ficus (Enterprise Edition) 96Boards. Below are some of the key differences between both Rock960 and Ficus boards: 1. Different host enable GPIO for USB 2. Different power and reset GPIO for PCI-E 3. No Ethernet port on Rock960 The common board support will be utilized by both boards. The device tree has been organized in such a way that only the properties which differ between both boards are placed in the board specific dts and the reset of the nodes are placed in common dtsi file. Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> [Added instructions for SD card boot] Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Peter Robinson <pbrobinson@gmail.com>
Diffstat (limited to 'board/vamrs')
-rw-r--r--board/vamrs/rock960_rk3399/Kconfig15
-rw-r--r--board/vamrs/rock960_rk3399/MAINTAINERS6
-rw-r--r--board/vamrs/rock960_rk3399/Makefile6
-rw-r--r--board/vamrs/rock960_rk3399/README152
-rw-r--r--board/vamrs/rock960_rk3399/rock960-rk3399.c50
5 files changed, 229 insertions, 0 deletions
diff --git a/board/vamrs/rock960_rk3399/Kconfig b/board/vamrs/rock960_rk3399/Kconfig
new file mode 100644
index 0000000000..cacc53f378
--- /dev/null
+++ b/board/vamrs/rock960_rk3399/Kconfig
@@ -0,0 +1,15 @@
+if TARGET_ROCK960_RK3399
+
+config SYS_BOARD
+ default "rock960_rk3399"
+
+config SYS_VENDOR
+ default "vamrs"
+
+config SYS_CONFIG_NAME
+ default "rock960_rk3399"
+
+config BOARD_SPECIFIC_OPTIONS # dummy
+ def_bool y
+
+endif
diff --git a/board/vamrs/rock960_rk3399/MAINTAINERS b/board/vamrs/rock960_rk3399/MAINTAINERS
new file mode 100644
index 0000000000..9f3fe75f4f
--- /dev/null
+++ b/board/vamrs/rock960_rk3399/MAINTAINERS
@@ -0,0 +1,6 @@
+ROCK960-RK3399
+M: Manivannan Sadhasivam manivannan.sadhasivam@linaro.org
+S: Maintained
+F: board/rockchip/rock960_rk3399
+F: include/configs/rock960_rk3399.h
+F: configs/rock960-rk3399_defconfig
diff --git a/board/vamrs/rock960_rk3399/Makefile b/board/vamrs/rock960_rk3399/Makefile
new file mode 100644
index 0000000000..6c3e475b3a
--- /dev/null
+++ b/board/vamrs/rock960_rk3399/Makefile
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
+#
+
+obj-y += rock960-rk3399.o
diff --git a/board/vamrs/rock960_rk3399/README b/board/vamrs/rock960_rk3399/README
new file mode 100644
index 0000000000..d14399090e
--- /dev/null
+++ b/board/vamrs/rock960_rk3399/README
@@ -0,0 +1,152 @@
+Contents
+========
+
+1. Introduction
+2. Get the Source and prebuild binary
+3. Compile the U-Boot
+4. Compile the rkdeveloptool
+5. Package the image
+ 5.1. Package the image for U-Boot SPL(option 1)
+ 5.2. Package the image for Rockchip miniloader(option 2)
+6. Bootloader storage options
+7. Flash the image to eMMC
+ 7.1. Flash the image with U-Boot SPL(option 1)
+ 7.2. Flash the image with Rockchip miniloader(option 2)
+8. Create a bootable SD/MMC
+9. And that is it
+
+Introduction
+============
+
+Rock960 board family consists of Rock960 (Consumer Edition) and
+Ficus (Enterprise Edition) 96Boards featuring Rockchip RK3399 SoC.
+
+Common features implemented on both boards:
+ * CPU: ARMv8 64bit Big-Little architecture,
+ * Big: dual-core Cortex-A72
+ * Little: quad-core Cortex-A53
+ * IRAM: 200KB
+ * eMMC: 16/32GB eMMC 5.1
+ * PMU: RK808
+ * SD/MMC
+ * Display: HDMI/DP/MIPI
+ * Low Speed Expansion Connector
+ * High Speed Expansion Connector
+
+Additional features of Rock960:
+ * DRAM: 2GB/4GB LPDDR3 @ 1866MHz
+ * 1x USB 3.0 type A, 1x USB 2.0 type A (host mode only),
+ 1x USB 3.0 type C OTG
+
+Additional features of Ficus:
+ * DRAM: 2GB/4GB DDR3 @ 1600MHz
+ * Ethernet
+ * 2x USB 3.0 type A, 2x USB 2.0 type A (host mode only),
+ 1x USB 3.0 type C OTG
+
+Here is the step-by-step to boot to U-Boot on Rock960 boards.
+
+Get the Source and prebuild binary
+==================================
+
+ > git clone https://github.com/96rocks/rkbin.git
+ > git clone https://github.com/rockchip-linux/rkdeveloptool.git
+
+Compile the U-Boot
+==================
+
+ > cd ../u-boot
+ > cp ../rkbin/rk33/rk3399_bl31_v1.00.elf ./bl31.elf
+ > export ARCH=arm64
+ > export CROSS_COMPILE=aarch64-linux-gnu-
+ > make rock960-rk3399_defconfig
+ > make
+ > make u-boot.itb
+
+Compile the rkdeveloptool
+=========================
+
+Follow instructions in latest README
+ > cd ../rkdeveloptool
+ > autoreconf -i
+ > ./configure
+ > make
+ > sudo make install
+
+Package the image
+=================
+
+Package the image for U-Boot SPL(option 1)
+--------------------------------
+ > cd ..
+ > tools/mkimage -n rk3399 -T rksd -d spl/u-boot-spl.bin idbspl.img
+
+ Get idbspl.img in this step.
+
+Package the image for Rockchip miniloader(option 2)
+------------------------------------------
+ > cd ../rkbin
+ > ./tools/loaderimage --pack --uboot u-boot/u-boot-dtb.bin uboot.img 0x200000
+
+ > ../u-boot/tools/mkimage -n rk3399 -T rksd -d rk3399_ddr_933MHz_v1.08.bin idbloader.img
+ > cat ./rk33/rk3399_miniloader_v1.06.bin >> idbloader.img
+
+ Get uboot.img and idbloader.img in this step.
+
+Bootloader storage options
+==========================
+
+There are a few different storage options for the bootloader.
+This document explores two of these: eMMC and removable SD/MMC.
+
+Flash the image to eMMC
+=======================
+
+Flash the image with U-Boot SPL(option 1)
+-------------------------------
+Power on(or reset with RESET KEY) with MASKROM KEY preesed, and then:
+ > rkdeveloptool db rkbin/rk33/rk3399_loader_v1.08.106.bin
+ > rkdeveloptool wl 64 u-boot/idbspl.img
+ > rkdeveloptool wl 0x4000 u-boot/u-boot.itb
+ > rkdeveloptool rd
+
+Flash the image with Rockchip miniloader(option 2)
+----------------------------------------
+Power on(or reset with RESET KEY) with MASKROM KEY preesed, and then:
+ > rkdeveloptool db rkbin/rk33/rk3399_loader_v1.08.106.bin
+ > rkdeveloptool wl 0x40 idbloader.img
+ > rkdeveloptool wl 0x4000 uboot.img
+ > rkdeveloptool wl 0x6000 ./img/rk3399/trust.img
+ > rkdeveloptool rd
+
+Create a bootable SD/MMC
+========================
+
+The idbspl.img contains the first stage, and the u-boot.img the second stage.
+As explained in the Rockchip partition table reference [1], the first stage
+(aka loader1) start sector is 64, and the second stage start sector is 16384.
+
+Each sector is 512 bytes, which means the first stage offset is 32 KiB,
+and the second stage offset is 8 MiB.
+
+Note: the second stage location is actually not as per the spec,
+but defined by the SPL. Mainline SPL defines an 8 MiB offset for the second
+stage.
+
+Assuming the SD card is exposed by device /dev/mmcblk0, the commands
+to write the two stages are:
+
+ > dd if=idbspl.img of=/dev/mmcblk0 bs=1k seek=32
+ > dd if=u-boot.itb of=/dev/mmcblk0 bs=1k seek=8192
+
+Setting up the kernel and rootfs is beyond the scope of this document.
+
+And that is it
+==============
+
+You should be able to get U-Boot log in console/UART2(baurdrate 1500000)
+
+For more detail, please reference [2].
+
+[1] http://opensource.rock-chips.com/wiki_Partitions
+[2] http://opensource.rock-chips.com/wiki_Boot_option
diff --git a/board/vamrs/rock960_rk3399/rock960-rk3399.c b/board/vamrs/rock960_rk3399/rock960-rk3399.c
new file mode 100644
index 0000000000..d3775b2219
--- /dev/null
+++ b/board/vamrs/rock960_rk3399/rock960-rk3399.c
@@ -0,0 +1,50 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <dm/pinctrl.h>
+#include <dm/uclass-internal.h>
+#include <asm/arch/periph.h>
+#include <power/regulator.h>
+#include <spl.h>
+
+int board_init(void)
+{
+ int ret;
+
+ ret = regulators_enable_boot_on(false);
+ if (ret)
+ debug("%s: Cannot enable boot on regulator\n", __func__);
+
+ return 0;
+}
+
+void spl_board_init(void)
+{
+ struct udevice *pinctrl;
+ int ret;
+
+ ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
+ if (ret) {
+ debug("%s: Cannot find pinctrl device\n", __func__);
+ goto err;
+ }
+
+ /* Enable debug UART */
+ ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_UART_DBG);
+ if (ret) {
+ debug("%s: Failed to set up console UART\n", __func__);
+ goto err;
+ }
+
+ preloader_console_init();
+ return;
+err:
+ printf("%s: Error %d\n", __func__, ret);
+
+ /* No way to report error here */
+ hang();
+}