From patchwork Fri Feb 8 13:05:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hung-ying Tyan X-Patchwork-Id: 219166 X-Patchwork-Delegate: promsoft@gmail.com 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 5C69C2C0082 for ; Sat, 9 Feb 2013 01:43:22 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A94CC4A111; Fri, 8 Feb 2013 15:43:17 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 etcGiW87vzbW; Fri, 8 Feb 2013 15:43:17 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 410E44A09F; Fri, 8 Feb 2013 15:42:52 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 09C4D4A029 for ; Fri, 8 Feb 2013 14:13:13 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 qDwEAh2PMmJp for ; Fri, 8 Feb 2013 14:13:12 +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-wg0-f73.google.com (mail-wg0-f73.google.com [74.125.82.73]) by theia.denx.de (Postfix) with ESMTPS id E7E2C4A028 for ; Fri, 8 Feb 2013 14:13:10 +0100 (CET) Received: by mail-wg0-f73.google.com with SMTP id dq12so256125wgb.4 for ; Fri, 08 Feb 2013 05:13:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=zTDrrUUqjXENG/JmRlUKfUgzBMm1LRIshrx/2nrd28w=; b=NZdyVZqk/51dPNphTlpMW9YU4ak1vLJY2fQeE5yaPyQph+Ixl0olUSYO7qYSL5C3nA NEi6ca7/xl30sYmo2MnKLUWjY4judRbpL/WthrmDBKwJmiBZm88Azaq3vBq3pfN+Kiip PznA3S4OW8l2VuVXdEWKafq/4Z2wllpolfCIwO/jCkvDmtsC2JF/HFA/r+H1SLXHc2uJ +MpvKzkw53MZuSpMqntDF+KEoQpCdxHvm9IIeHcj232N5tPMrUQRAGLDLc+Q3j/MPh36 JnUEtBYXLs39bxbDtSLOLKR39GenUihSlHDajC23phjLgffqbAe+zfY7GqY33aq2Tvuo uS2A== X-Received: by 10.14.220.131 with SMTP id o3mr4940628eep.3.1360328814042; Fri, 08 Feb 2013 05:06:54 -0800 (PST) Received: from corp2gmr1-2.eem.corp.google.com (corp2gmr1-2.eem.corp.google.com [172.25.138.117]) by gmr-mx.google.com with ESMTPS id m6si7450413een.1.2013.02.08.05.06.53 (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Fri, 08 Feb 2013 05:06:54 -0800 (PST) Received: from peugeot1.tpe.corp.google.com (peugeot1.tpe.corp.google.com [172.30.210.35]) by corp2gmr1-2.eem.corp.google.com (Postfix) with ESMTP id 4E6D81E4048; Fri, 8 Feb 2013 05:06:53 -0800 (PST) Received: by peugeot1.tpe.corp.google.com (Postfix, from userid 30259) id CF0EEA031E; Fri, 8 Feb 2013 21:06:52 +0800 (CST) From: Hung-ying Tyan To: U-Boot Mailing List Date: Fri, 8 Feb 2013 21:05:41 +0800 Message-Id: <1360328741-6076-8-git-send-email-tyanh@chromium.org> X-Mailer: git-send-email 1.8.1 In-Reply-To: <1360328741-6076-1-git-send-email-tyanh@chromium.org> References: <1360328741-6076-1-git-send-email-tyanh@chromium.org> X-Gm-Message-State: ALoCoQkPV3FfeIOEwuAEOzI3hEcEUPdbOsBRS56YKPmGksJPHl71qVDbbmzlJ1aCEzdGE/EMLouTUs4gYnUopBVdDDkjAoBTxrZurDxEHAUL0Ul8VzVEez3EL7v6Vcve8hJtoWu2t8j4hBhYHyOH+SkWAV8DY5ZRf9Ee45OsIMUBiYBqPsRNb+ACUi79W6j//36vdirCnJ99 X-Mailman-Approved-At: Fri, 08 Feb 2013 15:42:47 +0100 Cc: Hatim Ali , Vincent Palatin , Prathyush K , Vic Yang , Abhilash Kesavan , Sean Paul , Taylor Hutt , Alim Akhtar , Tom Rini , Terry Lambert Subject: [U-Boot] [PATCH 7/7] Enable cros-ec for smdk5250. X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 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 Signed-off-by: Abhilash Kesavan Signed-off-by: Akshay Saraswat Signed-off-by: Alim Akhtar Signed-off-by: Bernie Thompson Signed-off-by: Chander Kashyap Signed-off-by: Che-Liang Chiou Signed-off-by: Doug Anderson Signed-off-by: Gabe Black Signed-off-by: Hatim Ali Signed-off-by: Prathyush K Signed-off-by: Sean Paul Signed-off-by: Simon Glass Signed-off-by: Taylor Hutt Signed-off-by: Terry Lambert Signed-off-by: Tom Wai-Hong Tam Signed-off-by: Vic Yang Signed-off-by: Vincent Palatin Signed-off-by: Hung-ying Tyan --- board/samsung/smdk5250/smdk5250.c | 44 +++++++++++++++++++++++++++++++++++++++ include/configs/smdk5250.h | 14 +++++++++++++ 2 files changed, 58 insertions(+) diff --git a/board/samsung/smdk5250/smdk5250.c b/board/samsung/smdk5250/smdk5250.c index 7a5f132..eec4f53 100644 --- a/board/samsung/smdk5250/smdk5250.c +++ b/board/samsung/smdk5250/smdk5250.c @@ -21,6 +21,7 @@ */ #include +#include #include #include #include @@ -38,6 +39,13 @@ DECLARE_GLOBAL_DATA_PTR; +struct local_info { + struct cros_ec_dev *cros_ec_dev; /* Pointer to cros_ec device */ + int cros_ec_err; /* Error for cros_ec, 0 if ok */ +}; + +static struct local_info local; + #ifdef CONFIG_USB_EHCI_EXYNOS int board_usb_vbus_init(void) { @@ -54,12 +62,30 @@ int board_usb_vbus_init(void) } #endif +struct cros_ec_dev *board_get_cros_ec_dev(void) +{ + return local.cros_ec_dev; +} + +static int board_init_cros_ec_devices(const void *blob) +{ + local.cros_ec_err = cros_ec_init(blob, &local.cros_ec_dev); + if (local.cros_ec_err) + return -1; /* Will report in board_late_init() */ + + return 0; +} + int board_init(void) { gd->bd->bi_boot_params = (PHYS_SDRAM_1 + 0x100UL); #ifdef CONFIG_EXYNOS_SPI spi_init(); #endif + + if (board_init_cros_ec_devices(gd->fdt_blob)) + return -1; + #ifdef CONFIG_USB_EHCI_EXYNOS board_usb_vbus_init(); #endif @@ -376,3 +402,21 @@ void init_panel_info(vidinfo_t *vid) exynos_set_dp_platform_data(&dp_platform_data); } #endif + +#ifdef CONFIG_BOARD_LATE_INIT +int board_late_init(void) +{ + stdio_print_current_devices(); + + if (local.cros_ec_err) { + /* Force console on */ + gd->flags &= ~GD_FLG_SILENT; + + printf("cros-ec communications failure %d\n", local.cros_ec_err); + puts("\nPlease reset with Power+Refresh\n\n"); + panic("Cannot init cros-ec device"); + return -1; + } + return 0; +} +#endif diff --git a/include/configs/smdk5250.h b/include/configs/smdk5250.h index 81f83a8..4c61620 100644 --- a/include/configs/smdk5250.h +++ b/include/configs/smdk5250.h @@ -30,4 +30,18 @@ #undef CONFIG_DEFAULT_DEVICE_TREE #define CONFIG_DEFAULT_DEVICE_TREE exynos5250-smdk5250 +/* Enable keyboard */ +#define CONFIG_CROS_EC /* CROS_EC protocol */ +#define CONFIG_CROS_EC_SPI /* Support CROS_EC over SPI */ +#define CONFIG_CROS_EC_I2C /* Support CROS_EC over I2C */ +#define CONFIG_CROS_EC_KEYB /* CROS_EC keyboard input */ +#define CONFIG_CMD_CROS_EC +#define CONFIG_KEYBOARD + +#undef EXYNOS_DEVICE_SETTINGS +#define EXYNOS_DEVICE_SETTINGS "stdin=serial,cros-ec-keyb\0" \ + "stdout=serial,lcd\0" \ + "stderr=serial,lcd\0" + + #endif /* __CONFIG_SMDK_H */