From patchwork Thu Jan 23 17:01:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suniel Mahesh X-Patchwork-Id: 1047 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ot1-f70.google.com (mail-ot1-f70.google.com [209.85.210.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 0EBEB3F042 for ; Thu, 23 Jan 2020 18:01:42 +0100 (CET) Received: by mail-ot1-f70.google.com with SMTP id m6sf1824530otl.14 for ; Thu, 23 Jan 2020 09:01:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1579798900; cv=pass; d=google.com; s=arc-20160816; b=bOtTovuW6Q+dMQXAIY05NbvoAtgi9ebNGqCZieT8QdvjO9rOVbQzb0vZ663W6jf+CK 5EGNYVsnhMQo219iT+iCiReJ3lRgeC7w+5bVaxDTZ5NbZ1/6EAFQijwCLzDufoOa/CGr Ke3SPGN7dWVhqmTs9b8PsfqmR8ElQEzykxiAxdojvOK+0tW6nB3qEQ8JClOHGxvrkLeZ O0SP4VYJq530SWvXu/hzlm7IFHy5jV6Kn+lyQXU25+F83O3F3tsA6QarqEaBXkpokHSj QAhLs1WI0wpBeT3bW+MFumO9zzZ93QQLtbMNKnxUi+ndyklSIupTPVeuoJ/TQeS61k/z sA0w== 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:message-id:date:subject:cc:to:from :mime-version:dkim-signature; bh=QRkoY8pl87rpQ0b80VQMaE/P/nSHZxw6cCgZJHzDINE=; b=fNdXZzEYTKDzG+Em5lEBhx63S7BIGKOBUYWIenSMZkW6p0lCUN4V+KdzSU3LdoM1iH r9wgj9LNEUvS9UJq64X2SMK34VBlrvfqk/EhfrlKx3mgemewT5kNcO4G8BRoeBSFNXrR JQ1QRKJvMg/dvuwbojBaLBr0/njS3ULD9V5D785Hco+H/ZY94j5llN/3ZNq2T2HHXnlV OW65U2n7SVJwoGfCMPZc1OU6cNKoqgnM03GjKfiS7Nwwq1o0C9OKW/paxqJHP4cxr4Mj 7+tE8XEp6DKCGPUER/i89pvn9NxspLe+51MyBg1kipj0DIwsHZWMibqn+zWSh1kIvpir +CFw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="UF/GD2Wn"; spf=pass (google.com: domain of sunil@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=sunil@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=mime-version:from:to:cc:subject:date:message-id:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=QRkoY8pl87rpQ0b80VQMaE/P/nSHZxw6cCgZJHzDINE=; b=SeXGnZ6ouHuLkcGz5RiYL5Fnd9CZhdtC/cjMsBQbrNERAg2ho89RzbXDxIURSyS6Uq ANKuKpbwTDpMW0pQx7tX6aJo6tN+YXDAwqdCEHzZfp8BUwGeA6BqI/llAViDkJf1xM3K HgaAVY6RFEt2rnd9RSH2rzmDmQ+b2n+1OtZQw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:to:cc:subject:date:message-id :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=QRkoY8pl87rpQ0b80VQMaE/P/nSHZxw6cCgZJHzDINE=; b=SQrpgGrF3mziO/cokgXWmDVs58qYXVMHKnRqlBHYy76J47cxk5ZXPv8XBF5J3d0uWy 7ogSVAeY/Ydazg2q6ZuzRgDcb2va644W4MJPdnKmUyxGaaUUa1+keRVpTm5jAPnmDTMl oZ6GYyVnFulNrIrGb91ZKkTJhVktaTTvFKa9kAcTJgGvyPm6B0v07rtDl+u9FelacZqJ jeKdWUYKpDGuZFr4snkMjxJtmwQhTfSSBCTasZ3i+HPE3YxjOj4KX/o0vQruIz/r61HJ dp1q/c4d+O3Y7sq4JiCrJOKBnU2EpSeflOQ9lEIP3hGYJxRBFSikoghyvi+8IkLh4aIS UTaw== X-Gm-Message-State: APjAAAUlzh6e/rhpL+azdhITWc9v10byel8o5nNbzRx1vkoB8qoiO0Kf FrOJyoowD7j3EVV/W0F9eXYJQptm X-Google-Smtp-Source: APXvYqyqjzb5lK+q98R9Tj8qpiOkPwqWa7o63cz97NMax/fsk3KKR+GYDE76iAJ+UwOMiFVp7lBaAQ== X-Received: by 2002:a05:6830:9a:: with SMTP id a26mr12329205oto.131.1579798899715; Thu, 23 Jan 2020 09:01:39 -0800 (PST) MIME-Version: 1.0 X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a9d:60d0:: with SMTP id b16ls8071868otk.0.gmail; Thu, 23 Jan 2020 09:01:39 -0800 (PST) X-Received: by 2002:a05:6830:160c:: with SMTP id g12mr11720427otr.82.1579798898982; Thu, 23 Jan 2020 09:01:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579798898; cv=none; d=google.com; s=arc-20160816; b=ivHMpd4c3jUWPHrk18nBzCZ4rveaRURhckkmw8NpMPthn0Hsni05PuMAwV7w0GEjJ9 bSIBJ9Z6H+vPfVXi6LIfNYf5CZF7zZM8/8ABtR9VjLArnivrCCKQv/6rXVnMxGqO4SBY Lj0Mu6iyAvZUh3j7bPAw4k1h0O87aA2/Gz2lKxCTov4HayLTc9boyt4AVzPCRhJstON2 Yd/HzDIW4N0YEZ1XnR4Lk/z+NkHNOlEsjeOdWa9FpR0+SqHDTzFPhQexdpO/fzBZ4FEs +ZpK/ArgGnNXyQcNDOFDH2k06o4OXVrAkwOnh5nXzGf+yh/JRlpD0sFdk2IoTeNBxPV7 FZbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature; bh=x6ujpbEI9GO660B95ayyw0GAcAKdcdNFQBdTtZgLNts=; b=v1UZaAZvTJsXmKkvk9mMS3vdu/UC3K0yXY5gn/pGgvt/1qmrz7951LpY8okYW0X/lM 7glym/1Ko4Mojr4APXJ3oxvN0IGUIuN+in1AW1zsccItSBHsePaHAp7iIeBiNSIUDK3q 7sqOoG0ukq+9IBduZJrDeMCdoS2ZtKyANRj1HL7M4tWwHuyCEc3K5sHEiHjNs6pfO0nh 5E8PjQ8LjkSAzR/oCOaGaGO14OtyxnBYPZm1kI66Xu3LCUjLWpyCJGuUiucRBZu7vg1d +/KvS2EoDPgbD3sKpq8+XH5kr/pAx3qwbOQSm8hWTqwTg1bjNcuPInC43V9AEcUKZNsp yVGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="UF/GD2Wn"; spf=pass (google.com: domain of sunil@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=sunil@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 c2sor1316357otl.141.2020.01.23.09.01.38 for (Google Transport Security); Thu, 23 Jan 2020 09:01:38 -0800 (PST) Received-SPF: pass (google.com: domain of sunil@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:902:b948:: with SMTP id h8mr13073078pls.266.1579798898091; Thu, 23 Jan 2020 09:01:38 -0800 (PST) Received: from localhost.localdomain ([49.206.202.109]) by smtp.gmail.com with ESMTPSA id d4sm3446555pjz.12.2020.01.23.09.01.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 23 Jan 2020 09:01:37 -0800 (PST) From: sunil@amarulasolutions.com To: jagan@amarulasolutions.com Cc: linux-amarula@amarulasolutions.com, Suniel Mahesh Subject: [PATCH] rockchip: rk3399: split roc-rk3399-pc out of evb_rk3399 Date: Thu, 23 Jan 2020 22:31:22 +0530 Message-Id: <1579798882-8325-1-git-send-email-sunil@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 X-Original-Sender: sunil@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="UF/GD2Wn"; spf=pass (google.com: domain of sunil@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=sunil@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: , From: Suniel Mahesh roc-rk3399-pc board has one user button & three user LED's (red, green, yellow). At present there is no code to use them in full effect(for instance yellow led can be used to indicate low power mode and red led can be used to indicate full power mode with the help of push button). This adds that required support by splitting into its own board file and configuring them there. Signed-off-by: Suniel Mahesh --- arch/arm/mach-rockchip/rk3399/Kconfig | 20 ++++++++++++++++++++ board/firefly/roc-rk3399-pc/Kconfig | 16 ++++++++++++++++ board/firefly/roc-rk3399-pc/MAINTAINERS | 6 ++++++ board/firefly/roc-rk3399-pc/Makefile | 7 +++++++ board/firefly/roc-rk3399-pc/roc-rk3399-pc.c | 29 +++++++++++++++++++++++++++++ configs/roc-pc-rk3399_defconfig | 1 + include/configs/roc-rk3399-pc.h | 15 +++++++++++++++ 7 files changed, 94 insertions(+) create mode 100644 board/firefly/roc-rk3399-pc/Kconfig create mode 100644 board/firefly/roc-rk3399-pc/MAINTAINERS create mode 100644 board/firefly/roc-rk3399-pc/Makefile create mode 100644 board/firefly/roc-rk3399-pc/roc-rk3399-pc.c create mode 100644 include/configs/roc-rk3399-pc.h diff --git a/arch/arm/mach-rockchip/rk3399/Kconfig b/arch/arm/mach-rockchip/rk3399/Kconfig index 868e85f..0252c36 100644 --- a/arch/arm/mach-rockchip/rk3399/Kconfig +++ b/arch/arm/mach-rockchip/rk3399/Kconfig @@ -81,6 +81,25 @@ config TARGET_ROCKPRO64_RK3399 * GPIO expansion ports * DC 12V/2A +config TARGET_ROC_RK3399_PC + bool "Firefly ROC-RK3399-PC board" + help + ROC-RK3399-PC is SBC produced by Firefly. Key features: + + * Rockchip RK3399 + * 4GB Dual-Channel LPDDR4 64-bit + * SD card slot + * eMMC socket + * 16MB SPI Flash + * Gigabit ethernet + * PCIe + * HDMI In/Out, DP, MIPI DSI/CSI, eDP + * USB 3.0, 2.0 + * USB Type C power and data + * GPIO expansion ports + * wide voltage input(5V-15V), dual cell battery + * Wifi/BT accessible via expansion board M.2 + endchoice config ROCKCHIP_BOOT_MODE_REG @@ -118,5 +137,6 @@ source "board/theobroma-systems/puma_rk3399/Kconfig" source "board/vamrs/rock960_rk3399/Kconfig" source "board/google/gru/Kconfig" source "board/pine64/rockpro64_rk3399/Kconfig" +source "board/firefly/roc-rk3399-pc/Kconfig" endif diff --git a/board/firefly/roc-rk3399-pc/Kconfig b/board/firefly/roc-rk3399-pc/Kconfig new file mode 100644 index 0000000..26dce89 --- /dev/null +++ b/board/firefly/roc-rk3399-pc/Kconfig @@ -0,0 +1,16 @@ +if TARGET_ROC_RK3399_PC + +config SYS_BOARD + default "roc-rk3399-pc" + +config SYS_VENDOR + default "firefly" + +config SYS_CONFIG_NAME + default "roc-rk3399-pc" + +config BOARD_SPECIFIC_OPTIONS # dummy + def_bool y + +endif + diff --git a/board/firefly/roc-rk3399-pc/MAINTAINERS b/board/firefly/roc-rk3399-pc/MAINTAINERS new file mode 100644 index 0000000..ba6bec9 --- /dev/null +++ b/board/firefly/roc-rk3399-pc/MAINTAINERS @@ -0,0 +1,6 @@ +ROC-RK3399-PC +M: Kever Yang +S: Maintained +F: board/firefly/roc-rk3399-pc/roc-rk3399-pc +F: include/configs/roc-rk3399-pc.h +F: configs/roc-pc-rk3399_defconfig diff --git a/board/firefly/roc-rk3399-pc/Makefile b/board/firefly/roc-rk3399-pc/Makefile new file mode 100644 index 0000000..200dab0 --- /dev/null +++ b/board/firefly/roc-rk3399-pc/Makefile @@ -0,0 +1,7 @@ +# +# (C) Copyright 2016 Rockchip Electronics Co., Ltd +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += roc-rk3399-pc.o diff --git a/board/firefly/roc-rk3399-pc/roc-rk3399-pc.c b/board/firefly/roc-rk3399-pc/roc-rk3399-pc.c new file mode 100644 index 0000000..d47dba8 --- /dev/null +++ b/board/firefly/roc-rk3399-pc/roc-rk3399-pc.c @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * (C) Copyright 2016 Rockchip Electronics Co., Ltd + */ + +#include +#include +#include +#include + +#ifndef CONFIG_SPL_BUILD +int board_early_init_f(void) +{ + struct udevice *regulator; + int ret; + + ret = regulator_get_by_platname("vcc5v0_host", ®ulator); + if (ret) { + debug("%s vcc5v0_host init fail! ret %d\n", __func__, ret); + goto out; + } + + ret = regulator_set_enable(regulator, true); + if (ret) + debug("%s vcc5v0-host-en set fail! ret %d\n", __func__, ret); +out: + return 0; +} +#endif diff --git a/configs/roc-pc-rk3399_defconfig b/configs/roc-pc-rk3399_defconfig index 39c3e18..7da80e0 100644 --- a/configs/roc-pc-rk3399_defconfig +++ b/configs/roc-pc-rk3399_defconfig @@ -3,6 +3,7 @@ CONFIG_ARCH_ROCKCHIP=y CONFIG_SYS_TEXT_BASE=0x00200000 CONFIG_ENV_OFFSET=0x3F8000 CONFIG_ROCKCHIP_RK3399=y +CONFIG_TARGET_ROC_RK3399_PC=y CONFIG_NR_DRAM_BANKS=1 CONFIG_DEBUG_UART_BASE=0xFF1A0000 CONFIG_DEBUG_UART_CLOCK=24000000 diff --git a/include/configs/roc-rk3399-pc.h b/include/configs/roc-rk3399-pc.h new file mode 100644 index 0000000..b9c4d68 --- /dev/null +++ b/include/configs/roc-rk3399-pc.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * (C) Copyright 2016 Rockchip Electronics Co., Ltd + */ + +#ifndef __EVB_RK3399_H +#define __EVB_RK3399_H + +#include + +#define CONFIG_SYS_MMC_ENV_DEV 0 + +#define SDRAM_BANK_SIZE (2UL << 30) + +#endif