From patchwork Sat May 9 16:56:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1164 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 34B523F08E for ; Sat, 9 May 2020 18:57:03 +0200 (CEST) Received: by mail-pj1-f70.google.com with SMTP id k10sf12615539pjj.4 for ; Sat, 09 May 2020 09:57:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1589043422; cv=pass; d=google.com; s=arc-20160816; b=P4e9PXqAM+3/zAbkxx0fhu+URkxDUY96G3okfCeJ7XnY78YFTgqoJ3LLgRjuEXYXfc PP4CFDrjBELcTr1/yOoTH+xJtqfweP7MQFjDOsEv+jf9dKg79figaea6hruYIYaqQaIh 1TvsOKpaSG36uuwfOsiSrGHWL+bboVkroHE4VXiD5WbfZVmIIOp4BQ+GVyCDjvvr+OPK lXwU1BI7R3Der1eMzA/sCfwfU37TzzXJPAoFktHgqHkD63AJj+efwWUs/jjMV+/ZJjCc AlvF3AftsskybDbp1HeJ6GhopuNvRX1ltyD5o4iPhaP8Dj64Fzf7/5XY1BI44CZnes0Z V7kA== 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:references:in-reply-to:message-id:date :subject:cc:to:from:mime-version:dkim-signature; bh=PLNLRR2sqZsjX6Qf7Lxs8MU003fu+KYp5Y8ywijp8WE=; b=mcLhERzxT3zGWOo+G0bjK1QVyk1NiWQmS5LhOAJjyYhHBEhOqLd01yaO4pEt/VNJVX ZHzD3EZXKPf4jZKXoIZQFIlbrUslB0ppsy6pN5wsQ+KJFDHkO0LbdNHl+HmoeqrVlCW3 GDwv/4o2/2N55XnZgSZiJxJlXmHRR6lEs6xwzd6csCau4q41hYrZxjdy1AMdlhfAQmOy LhrgrYxp7ME0JaKDSKNp2EdtR2ewMDQTzRPVyeo+Abhy3pF4KscLChLIi3I9o/Rnd1yI WBA9bkWs3s98s6vCmR8h3e+GqWtrK1oLj/vLf/Pbrxws/A52lLUiiFBYELNoHzoeREp/ qj3w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ZqH+XTOL; 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=mime-version:from:to:cc:subject:date:message-id:in-reply-to :references:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=PLNLRR2sqZsjX6Qf7Lxs8MU003fu+KYp5Y8ywijp8WE=; b=nHoaL72xtnPdJY2WvzpV+oVvOTlshXpIMoVg2c/dRhCb9VTm5TzW+54//KkkjCe2h7 b8SRFH5PftsTPPptyY/zkrP6mt2FxlZmWt5CtOLMtHc7o9h1fQMdT/bCnJP7T0qGhbSH V/7bHMDpHzwc8KgB8mxCWipIL4K5aSFBe1KZc= 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 :in-reply-to:references: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=PLNLRR2sqZsjX6Qf7Lxs8MU003fu+KYp5Y8ywijp8WE=; b=ivQY0Kl1apqKJDSDoXModPRym/yUwFdMUTqUzIg3ajOcEHYq68LJFWqA/JkEMF6jFr z0d5gpWRcbNzstkIL6YyEGnStaIbGaJDjxb4z8N49MB2lCtenprTElpSxflg7Ic3jyHK 1J0GhO3tSafPQXBK5Tx6VDyy3dSGSCSR0ZmRNHBrqpgJWoJCIFX5TSAMhxly8AQR0orA zXuJNIgSWCCuIvRlJRfw5qpAmiJv818WIr+k7flgQ+6AJVQ3VF/i87Lsw7MsrQ12ab3E X7XAViZpqyb2cUoEPRNaCpw5AHwL3fpu/kCw2a6MmfY80uJpNRaBzEd2fvlZ4bW9Gd5E gR3g== X-Gm-Message-State: AGi0PuY7m5HBE7gDo9B5hWy59cQ9RR8pmtIFE3Zn5gbIHPwQgZbBVBv2 4V6Q2YxOazGBG/sJ8hSi6gYXaCDb X-Google-Smtp-Source: APiQypIq0teR1dqbI017hMAPArLX1YQcSJL582+k6ndZbsm5yk1fNXn7hqZtHHwT4Fzm15VxTjIr9Q== X-Received: by 2002:aa7:8091:: with SMTP id v17mr8804803pff.93.1589043422005; Sat, 09 May 2020 09:57:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:370c:: with SMTP id u12ls14082780pjb.2.gmail; Sat, 09 May 2020 09:57:01 -0700 (PDT) X-Received: by 2002:a17:90a:df88:: with SMTP id p8mr12706465pjv.119.1589043421490; Sat, 09 May 2020 09:57:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589043421; cv=none; d=google.com; s=arc-20160816; b=qgoNa3TQpYKDN5EXvd+T7Pj2Rw5RtRcA/AFlYV5dD+gZu4FE7P7f+ar53ge7bwiOw2 wajFvUvu7S48mw8j+XP6Q9JRSWfRA0e/iewo24L5VueyRQos0eO4Le//2subWiAaO4F4 Fs5rReZkyQalWr9ueU2MyYg14xkAVEQargDOfY+O4cu+ihb0drbPbti6q7t8z1qRjROc yJ4+TnJ6lVb/Puy5IPYyrZcenUHtGsQzukBs34tT2ZWjHpuhyiVgtBFLXenGkrSMTloc eZx+4mylqD8em9mvYLPINPIrLH3ovJSrg10itIwieK6uF06a8ZXEd0CYTqTR9SFXsq1w rJJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=w1+4+CJrzNg5N4mpMXT03HS2s/9IoOPydovCrS5cuzQ=; b=JaqELorOGBhHzwPk0bPg6wkGrXz8ZJuK6TdgzAa3HutvkwQFlca1Xb94vBGNUBSa0f AAzbjepkk32ACIUUocR0ELp0ApbjCk+baBDN7opfIRZ79Y8gr2NYVLjT9jOHRqSppmeW 0a7msLiuX6RQd3o0kOyY27cHclxw04L/dofd7amrqpd9LgyEh1OskcAvyFAnhbf1eEMG j2ANjrv9V6zEqqYl01y+1y22Lf7QWtuabvtRw0I9xOxHJyq9WD9bQ7Mbp0bzqaVeGU7f wYg+YVqTrZVfxf5SrVVH54Vg4P3URLmZzou1BqhO/qVKyk1bPzG6a6zDoXGMajs/Ac2r c1bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ZqH+XTOL; 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 s1sor9244354pjo.29.2020.05.09.09.57.01 for (Google Transport Security); Sat, 09 May 2020 09:57:01 -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:90b:4d09:: with SMTP id mw9mr13052220pjb.55.1589043421225; Sat, 09 May 2020 09:57:01 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:21f6:1c8f:ae94:fb04]) by smtp.gmail.com with ESMTPSA id x195sm4977098pfc.0.2020.05.09.09.56.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 May 2020 09:57:00 -0700 (PDT) From: Jagan Teki To: Kever Yang , Simon Glass , Philipp Tomsich Cc: shawn.lin@rock-chips.com, patrick@blueri.se, sunil@amarulasolutions.com, u-boot@lists.denx.de, linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki , Tom Cubie Subject: [PATCH v3 6/6] rockchip: Enable PCIe/M.2 on rock960 board Date: Sat, 9 May 2020 22:26:24 +0530 Message-Id: <20200509165624.20791-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200509165624.20791-1-jagan@amarulasolutions.com> References: <20200509165624.20791-1-jagan@amarulasolutions.com> X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ZqH+XTOL; 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: , Due to board limitation some SSD's would work on rock960 PCIe M.2 only with 1.8V IO domain. So, this patch enables grf io_sel explicitly to make PCIe/M.2 to work. Cc: Tom Cubie Signed-off-by: Jagan Teki Acked-by: Manivannan Sadhasivam Reviewed-by: Kever Yang --- Changes for v3: - collect mani a-b - add comments board/vamrs/rock960_rk3399/rock960-rk3399.c | 23 +++++++++++++++++++++ configs/rock960-rk3399_defconfig | 5 +++++ 2 files changed, 28 insertions(+) diff --git a/board/vamrs/rock960_rk3399/rock960-rk3399.c b/board/vamrs/rock960_rk3399/rock960-rk3399.c index 68a127b9ac..ef1eb2d0b7 100644 --- a/board/vamrs/rock960_rk3399/rock960-rk3399.c +++ b/board/vamrs/rock960_rk3399/rock960-rk3399.c @@ -2,3 +2,26 @@ /* * Copyright (C) 2018 Manivannan Sadhasivam */ + +#include +#include +#include +#include +#include +#include + +#ifdef CONFIG_MISC_INIT_R +int misc_init_r(void) +{ + struct rk3399_grf_regs *grf = + syscon_get_first_range(ROCKCHIP_SYSCON_GRF); + + /** + * Some SSD's to work on rock960 would require explicit + * domain voltage change, so BT565 is in 1.8v domain + */ + rk_setreg(&grf->io_vsel, BIT(0)); + + return 0; +} +#endif diff --git a/configs/rock960-rk3399_defconfig b/configs/rock960-rk3399_defconfig index 045d989a19..64517f9623 100644 --- a/configs/rock960-rk3399_defconfig +++ b/configs/rock960-rk3399_defconfig @@ -9,6 +9,7 @@ CONFIG_DEBUG_UART_BASE=0xFF1A0000 CONFIG_DEBUG_UART_CLOCK=24000000 CONFIG_DEBUG_UART=y CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-rock960.dtb" +CONFIG_MISC_INIT_R=y CONFIG_DISPLAY_BOARDINFO_LATE=y # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_SPL_STACK_R=y @@ -19,6 +20,7 @@ CONFIG_CMD_BOOTZ=y CONFIG_CMD_GPT=y CONFIG_CMD_MMC=y CONFIG_CMD_USB=y +CONFIG_CMD_PCI=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_TIME=y CONFIG_CMD_PMIC=y @@ -36,10 +38,13 @@ CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_SDMA=y CONFIG_MMC_SDHCI_ROCKCHIP=y CONFIG_DM_ETH=y +CONFIG_NVME=y +CONFIG_PCI=y CONFIG_PMIC_RK8XX=y CONFIG_REGULATOR_PWM=y CONFIG_REGULATOR_RK8XX=y CONFIG_PWM_ROCKCHIP=y +CONFIG_DM_RESET=y CONFIG_BAUDRATE=1500000 CONFIG_DEBUG_UART_SHIFT=2 CONFIG_SYSRESET=y