From patchwork Wed Oct 9 05:11:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Schocher X-Patchwork-Id: 1173587 X-Patchwork-Delegate: priyanka.jain@nxp.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46p2Rw0qGdz9sN1 for ; Wed, 9 Oct 2019 16:13:32 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id B0862C21DEC; Wed, 9 Oct 2019 05:12:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 56663C21EE0; Wed, 9 Oct 2019 05:12:54 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id EDFABC21F84; Wed, 9 Oct 2019 05:11:35 +0000 (UTC) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) by lists.denx.de (Postfix) with ESMTPS id 48FB2C21EE4 for ; Wed, 9 Oct 2019 05:11:33 +0000 (UTC) Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 46p2Pd0sFZz1rrW2; Wed, 9 Oct 2019 07:11:33 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 46p2Pd0lFqz1qqkL; Wed, 9 Oct 2019 07:11:33 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id GtzwYAXNouqH; Wed, 9 Oct 2019 07:11:32 +0200 (CEST) X-Auth-Info: PSYEbjA8VQ0RN3INShsuVwljWnIDJlWKqKpiI7yz+Vw= Received: from mail-internal.denx.de (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Wed, 9 Oct 2019 07:11:32 +0200 (CEST) Received: from pollux.denx.de (pollux [192.168.1.1]) by mail-internal.denx.de (Postfix) with ESMTP id 10839185322; Wed, 9 Oct 2019 07:11:13 +0200 (CEST) Received: by pollux.denx.de (Postfix, from userid 515) id 0F2671A006D; Wed, 9 Oct 2019 07:11:13 +0200 (CEST) From: Heiko Schocher To: U-Boot Mailing List Date: Wed, 9 Oct 2019 07:11:07 +0200 Message-Id: <20191009051110.3418517-7-hs@denx.de> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191009051110.3418517-1-hs@denx.de> References: <20191009051110.3418517-1-hs@denx.de> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 6/9] mpc85xx, socrates: disable VIDEO X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" disable video, as not really needed longer. Signed-off-by: Heiko Schocher --- board/socrates/socrates.c | 180 +------------------------------------ configs/socrates_defconfig | 3 - include/configs/socrates.h | 15 ---- 3 files changed, 2 insertions(+), 196 deletions(-) diff --git a/board/socrates/socrates.c b/board/socrates/socrates.c index 8f9583360b..f51b0203f7 100644 --- a/board/socrates/socrates.c +++ b/board/socrates/socrates.c @@ -231,6 +231,7 @@ int ft_board_setup(void *blob, bd_t *bd) val[i++] = gd->bd->bi_flashstart; val[i++] = gd->bd->bi_flashsize; +#if defined(CONFIG_VIDEO_MB862xx) if (mb862xx.frameAdrs == CONFIG_SYS_LIME_BASE) { /* Fixup LIME mapping */ val[i++] = 2; /* chip select number */ @@ -238,6 +239,7 @@ int ft_board_setup(void *blob, bd_t *bd) val[i++] = CONFIG_SYS_LIME_BASE; val[i++] = CONFIG_SYS_LIME_SIZE; } +#endif /* Fixup FPGA mapping */ val[i++] = 3; /* chip select number */ @@ -255,184 +257,6 @@ int ft_board_setup(void *blob, bd_t *bd) } #endif /* CONFIG_OF_BOARD_SETUP */ -#define DEFAULT_BRIGHTNESS 25 -#define BACKLIGHT_ENABLE (1 << 31) - -static const gdc_regs init_regs [] = -{ - {0x0100, 0x00010f00}, - {0x0020, 0x801901df}, - {0x0024, 0x00000000}, - {0x0028, 0x00000000}, - {0x002c, 0x00000000}, - {0x0110, 0x00000000}, - {0x0114, 0x00000000}, - {0x0118, 0x01df0320}, - {0x0004, 0x041f0000}, - {0x0008, 0x031f031f}, - {0x000c, 0x017f0349}, - {0x0010, 0x020c0000}, - {0x0014, 0x01df01e9}, - {0x0018, 0x00000000}, - {0x001c, 0x01e00320}, - {0x0100, 0x80010f00}, - {0x0, 0x0} -}; - -const gdc_regs *board_get_regs (void) -{ - return init_regs; -} - -int lime_probe(void) -{ - uint cfg_br2; - uint cfg_or2; - int type; - - cfg_br2 = get_lbc_br(2); - cfg_or2 = get_lbc_or(2); - - /* Configure GPCM for CS2 */ - set_lbc_br(2, 0); - set_lbc_or(2, 0xfc000410); - set_lbc_br(2, (CONFIG_SYS_LIME_BASE) | 0x00001901); - - /* Get controller type */ - type = mb862xx_probe(CONFIG_SYS_LIME_BASE); - - /* Restore previous CS2 configuration */ - set_lbc_br(2, 0); - set_lbc_or(2, cfg_or2); - set_lbc_br(2, cfg_br2); - - return (type == MB862XX_TYPE_LIME) ? 1 : 0; -} - -/* Returns Lime base address */ -unsigned int board_video_init (void) -{ - if (!lime_probe()) - return 0; - - mb862xx.winSizeX = 800; - mb862xx.winSizeY = 480; - mb862xx.gdfIndex = GDF_15BIT_555RGB; - mb862xx.gdfBytesPP = 2; - - return CONFIG_SYS_LIME_BASE; -} - -#define W83782D_REG_CFG 0x40 -#define W83782D_REG_BANK_SEL 0x4e -#define W83782D_REG_ADCCLK 0x4b -#define W83782D_REG_BEEP_CTRL 0x4d -#define W83782D_REG_BEEP_CTRL2 0x57 -#define W83782D_REG_PWMOUT1 0x5b -#define W83782D_REG_VBAT 0x5d - -static int w83782d_hwmon_init(void) -{ - u8 buf; - - if (i2c_read(CONFIG_SYS_I2C_W83782G_ADDR, W83782D_REG_CFG, 1, &buf, 1)) - return -1; - - i2c_reg_write(CONFIG_SYS_I2C_W83782G_ADDR, W83782D_REG_CFG, 0x80); - i2c_reg_write(CONFIG_SYS_I2C_W83782G_ADDR, W83782D_REG_BANK_SEL, 0); - i2c_reg_write(CONFIG_SYS_I2C_W83782G_ADDR, W83782D_REG_ADCCLK, 0x40); - - buf = i2c_reg_read(CONFIG_SYS_I2C_W83782G_ADDR, W83782D_REG_BEEP_CTRL); - i2c_reg_write(CONFIG_SYS_I2C_W83782G_ADDR, W83782D_REG_BEEP_CTRL, - buf | 0x80); - i2c_reg_write(CONFIG_SYS_I2C_W83782G_ADDR, W83782D_REG_BEEP_CTRL2, 0); - i2c_reg_write(CONFIG_SYS_I2C_W83782G_ADDR, W83782D_REG_PWMOUT1, 0x47); - i2c_reg_write(CONFIG_SYS_I2C_W83782G_ADDR, W83782D_REG_VBAT, 0x01); - - buf = i2c_reg_read(CONFIG_SYS_I2C_W83782G_ADDR, W83782D_REG_CFG); - i2c_reg_write(CONFIG_SYS_I2C_W83782G_ADDR, W83782D_REG_CFG, - (buf & 0xf4) | 0x01); - return 0; -} - -static void board_backlight_brightness(int br) -{ - u32 reg; - u8 buf; - u8 old_buf; - - /* Select bank 0 */ - if (i2c_read(CONFIG_SYS_I2C_W83782G_ADDR, 0x4e, 1, &old_buf, 1)) - goto err; - else - buf = old_buf & 0xf8; - - if (i2c_write(CONFIG_SYS_I2C_W83782G_ADDR, 0x4e, 1, &buf, 1)) - goto err; - - if (br > 0) { - /* PWMOUT1 duty cycle ctrl */ - buf = 255 / (100 / br); - if (i2c_write(CONFIG_SYS_I2C_W83782G_ADDR, 0x5b, 1, &buf, 1)) - goto err; - - /* LEDs on */ - reg = in_be32((void *)(CONFIG_SYS_FPGA_BASE + 0x0c)); - if (!(reg & BACKLIGHT_ENABLE)) - out_be32((void *)(CONFIG_SYS_FPGA_BASE + 0x0c), - reg | BACKLIGHT_ENABLE); - } else { - buf = 0; - if (i2c_write(CONFIG_SYS_I2C_W83782G_ADDR, 0x5b, 1, &buf, 1)) - goto err; - - /* LEDs off */ - reg = in_be32((void *)(CONFIG_SYS_FPGA_BASE + 0x0c)); - reg &= ~BACKLIGHT_ENABLE; - out_be32((void *)(CONFIG_SYS_FPGA_BASE + 0x0c), reg); - } - /* Restore previous bank setting */ - if (i2c_write(CONFIG_SYS_I2C_W83782G_ADDR, 0x4e, 1, &old_buf, 1)) - goto err; - - return; -err: - printf("W83782G I2C access failed\n"); -} - -void board_backlight_switch (int flag) -{ - char * param; - int rc; - - if (w83782d_hwmon_init()) - printf ("hwmon IC init failed\n"); - - if (flag) { - param = env_get("brightness"); - rc = param ? simple_strtol(param, NULL, 10) : -1; - if (rc < 0) - rc = DEFAULT_BRIGHTNESS; - } else { - rc = 0; - } - board_backlight_brightness(rc); -} - -#if defined(CONFIG_CONSOLE_EXTRA_INFO) -/* - * Return text to be printed besides the logo. - */ -void video_get_info_str (int line_number, char *info) -{ - if (line_number == 1) { - strcpy (info, " Board: Socrates"); - } else { - info [0] = '\0'; - } -} -#endif - #if defined(CONFIG_OF_SEPARATE) void *board_fdt_blob_setup(void) { diff --git a/configs/socrates_defconfig b/configs/socrates_defconfig index 2c87ec5134..be88cefe3e 100644 --- a/configs/socrates_defconfig +++ b/configs/socrates_defconfig @@ -27,7 +27,6 @@ CONFIG_CMD_DHCP=y CONFIG_CMD_MII=y CONFIG_CMD_PING=y CONFIG_CMD_SNTP=y -CONFIG_CMD_BMP=y CONFIG_CMD_DATE=y # CONFIG_CMD_HASH is not set CONFIG_CMD_EXT2=y @@ -50,5 +49,3 @@ CONFIG_USB=y CONFIG_DM_USB=y # CONFIG_USB_EHCI_HCD is not set CONFIG_USB_STORAGE=y -CONFIG_VIDEO=y -CONFIG_CONSOLE_EXTRA_INFO=y diff --git a/include/configs/socrates.h b/include/configs/socrates.h index 4e10786ed8..c35e8aed77 100644 --- a/include/configs/socrates.h +++ b/include/configs/socrates.h @@ -148,21 +148,6 @@ #define CONFIG_SYS_BR2_PRELIM 0xc80018a1 /* UPMB, 32-bit */ #define CONFIG_SYS_OR2_PRELIM 0xfc000000 /* 64 MB */ -#define CONFIG_VIDEO_MB862xx -#define CONFIG_VIDEO_MB862xx_ACCEL -#define CONFIG_VIDEO_LOGO -#define CONFIG_VIDEO_BMP_LOGO -#define VIDEO_FB_16BPP_PIXEL_SWAP -#define VIDEO_FB_16BPP_WORD_SWAP -#define CONFIG_SPLASH_SCREEN -#define CONFIG_VIDEO_BMP_GZIP -#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (2 << 20) /* decompressed img */ - -/* SDRAM Clock frequency, 100MHz (0x0000) or 133MHz (0x10000) */ -#define CONFIG_SYS_MB862xx_CCF 0x10000 -/* SDRAM parameter */ -#define CONFIG_SYS_MB862xx_MMR 0x4157BA63 - /* Serial Port */ #define CONFIG_SYS_NS16550_SERIAL