From patchwork Tue Dec 2 00:48:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 416663 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 60C2C140100 for ; Tue, 2 Dec 2014 11:51:26 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 17F204B8FD; Tue, 2 Dec 2014 01:50:24 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9-+bkzpGyjrX; Tue, 2 Dec 2014 01:50:23 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8D4D54B83D; Tue, 2 Dec 2014 01:49:49 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0B2AA4B755 for ; Tue, 2 Dec 2014 01:49:24 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0xZ+GRZYESmg for ; Tue, 2 Dec 2014 01:49:23 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pa0-f74.google.com (mail-pa0-f74.google.com [209.85.220.74]) by theia.denx.de (Postfix) with ESMTPS id DB7A44B766 for ; Tue, 2 Dec 2014 01:49:19 +0100 (CET) Received: by mail-pa0-f74.google.com with SMTP id kq14so1525203pab.5 for ; Mon, 01 Dec 2014 16:49:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YD0M1Zh0PGjMVv0coulrfAdf2Gz3kI+s59eKZlS656E=; b=V1ANBvqj56d/gQp/GXz+7Ko7Ctk7Uo3zQ7ozdhk9Rqh09IYP0W58S5WIEf/rtGOrsD ES30BD4ewCdEA1HnBWtlzKcDBvECEsMxYrJAdG47P1555po/ZpiJYj5uFqXO5sz/laBW AMseYfDraJDCGjEo8tXxDIyDsu9aqMl5SSBWjKPT6nkMUPKGDpHBiFVXMTPpmPDP0bbt xxjRsctEss3Oi7tP/uaZRrr5shJ0FfEUZQ+Pjaz00doAZlSGKT7gG4YTPpTlS2mqtQWa q0x5lLdLxq2hHPUpJCIi+oe/zVc54KbAv0IYfVZ+BFx4Wwsh2Qgan2zjTHojdCrdZvN/ wz7g== X-Gm-Message-State: ALoCoQkpONvVGXkjmMTPOrjng56aYvsSpVw+fSWrn1sxPPVb4FLmtzkxgUEJ0Endo6RBNWpC5CCk X-Received: by 10.66.139.169 with SMTP id qz9mr59547066pab.3.1417481358147; Mon, 01 Dec 2014 16:49:18 -0800 (PST) Received: from corpmail-nozzle1-1.hot.corp.google.com ([100.108.1.104]) by gmr-mx.google.com with ESMTPS id e24si773125yhe.3.2014.12.01.16.49.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Dec 2014 16:49:18 -0800 (PST) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by corpmail-nozzle1-1.hot.corp.google.com with ESMTP id ZMhgr4mK.1; Mon, 01 Dec 2014 16:49:18 -0800 Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 23BBA220E95; Mon, 1 Dec 2014 17:49:17 -0700 (MST) From: Simon Glass To: U-Boot Mailing List Date: Mon, 1 Dec 2014 17:48:38 -0700 Message-Id: <1417481333-30526-11-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c In-Reply-To: <1417481333-30526-1-git-send-email-sjg@chromium.org> References: <1417481333-30526-1-git-send-email-sjg@chromium.org> Cc: Stephen Warren , Tom Warren Subject: [U-Boot] [PATCH 10/25] tegra: nyan-big: Add LCD PMIC init and board ID X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Add required setup for the LCD display, and a function to provide the board ID. This requires GPIOs to be available prior to relocation. Signed-off-by: Simon Glass --- arch/arm/dts/tegra124-nyan-big.dts | 4 ++++ board/nvidia/nyan-big/nyan-big.c | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/arch/arm/dts/tegra124-nyan-big.dts b/arch/arm/dts/tegra124-nyan-big.dts index c1f35a0..10e1914 100644 --- a/arch/arm/dts/tegra124-nyan-big.dts +++ b/arch/arm/dts/tegra124-nyan-big.dts @@ -308,6 +308,10 @@ }; }; + gpio@6000d000 { + u-boot,dm-pre-reloc; + }; + gpio-keys { compatible = "gpio-keys"; diff --git a/board/nvidia/nyan-big/nyan-big.c b/board/nvidia/nyan-big/nyan-big.c index 6b1c8d4..2a4794b 100644 --- a/board/nvidia/nyan-big/nyan-big.c +++ b/board/nvidia/nyan-big/nyan-big.c @@ -6,8 +6,11 @@ */ #include -#include +#include +#include #include +#include +#include #include "pinmux-config-nyan-big.h" /* @@ -27,3 +30,32 @@ void pinmux_init(void) pinmux_config_drvgrp_table(nyan_big_drvgrps, ARRAY_SIZE(nyan_big_drvgrps)); } + +int tegra_board_id(void) +{ + static const int vector[] = {GPIO_PQ3, GPIO_PT1, GPIO_PX1, + GPIO_PX4, -1}; + + gpio_claim_vector(vector, "board_id%d"); + return gpio_get_values_as_int(vector); +} + +int tegra_lcd_pmic_init(int board_id) +{ + struct udevice *pmic; + int ret; + + ret = as3722_get(&pmic); + if (ret) + return -ENOENT; + + if (board_id == 0) + as3722_write(pmic, 0x00, 0x3c); + else + as3722_write(pmic, 0x00, 0x50); + as3722_write(pmic, 0x12, 0x10); + as3722_write(pmic, 0x0c, 0x07); + as3722_write(pmic, 0x20, 0x10); + + return 0; +}