public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Bo Shen <voice.shen@atmel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 06/10] common/lcd.c: remove global lcd_base
Date: Wed, 16 Jan 2013 09:24:23 +0800	[thread overview]
Message-ID: <50F60147.3050403@atmel.com> (raw)
In-Reply-To: <1358028480-4979-7-git-send-email-jeroen@myspectrum.nl>

On 1/13/2013 6:07, Jeroen Hofstee wrote:
> lcd_base is available as gd->fb_base as well, there is no need
> to keep a seperate copy.
>
> Cc: Alessandro Rubini <rubini@unipv.it>
> Cc: Anatolij Gustschin <agust@denx.de>
> Cc: Bo Shen <voice.shen@atmel.com>
> Cc: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
> Cc: Kyungmin Park <kyungmin.park@samsung.com>
> Cc: Marek Vasut <marek.vasut@gmail.com>
> Cc: Minkyu Kang <mk7.kang@samsung.com>
> Cc: Nikita Kiryanov <nikita@compulab.co.il>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Stelian Pop <stelian@popies.net>
> Cc: Tom Warren <twarren@nvidia.com>
> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
> ---
>   board/mcc200/lcd.c           |    8 ++------
>   common/lcd.c                 |    1 +
>   drivers/video/atmel_hlcdfb.c |    2 --
>   drivers/video/atmel_lcdfb.c  |    2 --
>   drivers/video/exynos_fb.c    |    8 +++-----
>   drivers/video/mpc8xx_lcd.c   |   12 ++----------
>   drivers/video/pxa_lcd.c      |    2 --
>   drivers/video/tegra.c        |    6 +-----
>   include/lcd.h                |    5 -----
>   9 files changed, 9 insertions(+), 37 deletions(-)
>
> diff --git a/board/mcc200/lcd.c b/board/mcc200/lcd.c
> index caf8d8b..feded49 100644
> --- a/board/mcc200/lcd.c
> +++ b/board/mcc200/lcd.c
> @@ -68,10 +68,6 @@ vidinfo_t panel_info = {
>   	LCD_WIDTH, LCD_HEIGHT, LCD_BPP
>   };
>
> -/*
> - * Frame buffer memory information
> - */
> -void *lcd_base;			/* Start of framebuffer memory  */
>
>   /*
>    *  The device we use to communicate with PSoC
> @@ -147,12 +143,12 @@ void lcd_enable (void)
>
>   #if !defined(SWAPPED_LCD)
>   	for (i=0; i<fb_size; i++) {
> -		serial_putc_raw_dev (PSOC_PSC, ((char *)lcd_base)[i]);
> +		serial_putc_raw_dev (PSOC_PSC, ((char *)gd->fb_base)[i]);
>   	}
>   #else
>       {
>   	int x, y, pwidth;
> -	char *p = (char *)lcd_base;
> +	char *p = (char *)gd->fb_base;
>
>   	pwidth = ((panel_info.vl_col+7) >> 3);
>   	for (y=0; y<panel_info.vl_row; y++) {
> diff --git a/common/lcd.c b/common/lcd.c
> index d3fd68d..02f4721 100644
> --- a/common/lcd.c
> +++ b/common/lcd.c
> @@ -107,6 +107,7 @@ static short console_col;
>   static short console_row;
>
>   static void *lcd_console_address;
> +static void *lcd_base;			/* Start of framebuffer memory	*/
>
>   static char lcd_flush_dcache;	/* 1 to flush dcache after each lcd update */
>
> diff --git a/drivers/video/atmel_hlcdfb.c b/drivers/video/atmel_hlcdfb.c
> index 32626cf..fc95897 100644
> --- a/drivers/video/atmel_hlcdfb.c
> +++ b/drivers/video/atmel_hlcdfb.c
> @@ -29,8 +29,6 @@
>   #include <lcd.h>
>   #include <atmel_hlcdc.h>
>
> -void *lcd_base;				/* Start of framebuffer memory	*/
> -
>   /* configurable parameters */
>   #define ATMEL_LCDC_CVAL_DEFAULT		0xc8
>   #define ATMEL_LCDC_DMA_BURST_LEN	8
> diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
> index 370d9ca..2afeab2 100644
> --- a/drivers/video/atmel_lcdfb.c
> +++ b/drivers/video/atmel_lcdfb.c
> @@ -29,8 +29,6 @@
>   #include <lcd.h>
>   #include <atmel_lcdc.h>
>
> -void *lcd_base;				/* Start of framebuffer memory	*/
> -
>   /* configurable parameters */
>   #define ATMEL_LCDC_CVAL_DEFAULT		0xc8
>   #define ATMEL_LCDC_DMA_BURST_LEN	8

For Atmel part, it is ok for me.

Acked-by: Bo Shen <voice.shen@atmel.com>

Best Regards,
Bo Shen

> diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
> index 3e5f868..6f3c85d 100644
> --- a/drivers/video/exynos_fb.c
> +++ b/drivers/video/exynos_fb.c
> @@ -33,7 +33,7 @@
>
>   #include "exynos_fb.h"
>
> -void *lcd_base;
> +DECLARE_GLOBAL_DATA_PTR;
>
>   static unsigned int panel_width, panel_height;
>
> @@ -44,11 +44,9 @@ static void exynos_lcd_init_mem(void *lcdbase, vidinfo_t *vid)
>
>   	fb_size = vid->vl_row * vid->vl_col * (NBITS(vid->vl_bpix) >> 3);
>
> -	lcd_base = lcdbase;
> -
>   	palette_size = NBITS(vid->vl_bpix) == 8 ? 256 : 16;
>
> -	exynos_fimd_lcd_init_mem((unsigned long)lcd_base,
> +	exynos_fimd_lcd_init_mem((unsigned long)lcdbase,
>   			(unsigned long)fb_size, palette_size);
>   }
>
> @@ -135,7 +133,7 @@ void lcd_ctrl_init(void *lcdbase)
>   void lcd_enable(void)
>   {
>   	if (panel_info.logo_on) {
> -		memset(lcd_base, 0, panel_width * panel_height *
> +		memset((void *) gd->fb_base, 0, panel_width * panel_height *
>   				(NBITS(panel_info.vl_bpix) >> 3));
>   		draw_logo();
>   	}
> diff --git a/drivers/video/mpc8xx_lcd.c b/drivers/video/mpc8xx_lcd.c
> index 26ad432..1aa1967 100644
> --- a/drivers/video/mpc8xx_lcd.c
> +++ b/drivers/video/mpc8xx_lcd.c
> @@ -255,14 +255,6 @@ vidinfo_t panel_info = {
>   #endif
>   /*----------------------------------------------------------------------*/
>
> -
> -/*
> - * Frame buffer memory information
> - */
> -void *lcd_base;			/* Start of framebuffer memory	*/
> -
> -/************************************************************************/
> -
>   void lcd_ctrl_init (void *lcdbase);
>   void lcd_enable (void);
>   #if LCD_BPP == LCD_COLOR8
> @@ -392,8 +384,8 @@ void lcd_ctrl_init (void *lcdbase)
>   	 * BIG NOTE:  This has to be modified to load A and B depending
>   	 * upon the split mode of the LCD.
>   	 */
> -	lcdp->lcd_lcfaa = (ulong)lcd_base;
> -	lcdp->lcd_lcfba = (ulong)lcd_base;
> +	lcdp->lcd_lcfaa = (ulong)lcdbase;
> +	lcdp->lcd_lcfba = (ulong)lcdbase;
>
>   	/* MORE HACKS...This must be updated according to 823 manual
>   	 * for different panels.
> diff --git a/drivers/video/pxa_lcd.c b/drivers/video/pxa_lcd.c
> index 57243ce..fef49c1 100644
> --- a/drivers/video/pxa_lcd.c
> +++ b/drivers/video/pxa_lcd.c
> @@ -332,8 +332,6 @@ void lcd_getcolreg (ushort regno, ushort *red, ushort *green, ushort *blue);
>   void lcd_ctrl_init	(void *lcdbase);
>   void lcd_enable	(void);
>
> -void *lcd_base;			/* Start of framebuffer memory	*/
> -
>   static int pxafb_init_mem (void *lcdbase, vidinfo_t *vid);
>   static void pxafb_setup_gpio (vidinfo_t *vid);
>   static void pxafb_enable_controller (vidinfo_t *vid);
> diff --git a/drivers/video/tegra.c b/drivers/video/tegra.c
> index 0d1cfa9..941551c 100644
> --- a/drivers/video/tegra.c
> +++ b/drivers/video/tegra.c
> @@ -60,8 +60,6 @@ enum {
>   	LCD_MAX_LOG2_BPP	= 4,		/* 2^4 = 16 bpp */
>   };
>
> -void *lcd_base;			/* Start of framebuffer memory	*/
> -
>   vidinfo_t panel_info = {
>   	/* Insert a value here so that we don't end up in the BSS */
>   	.vl_col = -1,
> @@ -90,8 +88,6 @@ void lcd_ctrl_init(void *lcdbase)
>
>   	assert(disp_config);
>
> -	lcd_base = (void *)disp_config->frame_buffer;
> -
>   	/* Make sure that we can acommodate the selected LCD */
>   	assert(disp_config->width <= LCD_MAX_WIDTH);
>   	assert(disp_config->height <= LCD_MAX_HEIGHT);
> @@ -112,7 +108,7 @@ void lcd_ctrl_init(void *lcdbase)
>   	/* Enable flushing after LCD writes if requested */
>   	lcd_set_flush_dcache(config.cache_type & FDT_LCD_CACHE_FLUSH);
>
> -	debug("LCD frame buffer at %p\n", lcd_base);
> +	debug("LCD frame buffer at %08X\n", disp_config->frame_buffer);
>   }
>
>   ulong calc_fbsize(void)
> diff --git a/include/lcd.h b/include/lcd.h
> index b8eea9c..d54a304 100644
> --- a/include/lcd.h
> +++ b/include/lcd.h
> @@ -31,11 +31,6 @@
>
>   extern char lcd_is_enabled;
>
> -/*
> - * Frame buffer memory information
> - */
> -extern void *lcd_base;			/* Start of framebuffer memory	*/
> -
>   extern struct vidinfo panel_info;
>
>   extern void lcd_ctrl_init (void *lcdbase);
>

  reply	other threads:[~2013-01-16  1:24 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-12 22:07 [U-Boot] [PATCH 00/10] common.lcd: remove globals and cleanup Jeroen Hofstee
2013-01-12 22:07 ` [U-Boot] [PATCH 01/10] lcd, amba: remove this frame buffer driver since it is not used Jeroen Hofstee
2013-01-13 16:15   ` Alessandro Rubini
2013-01-12 22:07 ` [U-Boot] [PATCH 02/10] lcd, tegra: remove unused cursor functions Jeroen Hofstee
2013-01-12 22:17   ` Jeroen Hofstee
2013-01-25 20:38   ` Simon Glass
2013-01-25 21:18     ` Tom Warren
2013-01-26 16:20       ` Jeroen Hofstee
2013-01-28 16:19         ` Tom Warren
2013-01-12 22:07 ` [U-Boot] [PATCH 03/10] lcd, mpc8xx: move the mpc8xx frame buffer driver to drivers/video Jeroen Hofstee
2013-01-12 22:07 ` [U-Boot] [PATCH 04/10] lcd, pxafb: move the pxafb " Jeroen Hofstee
2013-01-13  0:37   ` Marek Vasut
2013-01-12 22:07 ` [U-Boot] [PATCH 05/10] common/lcd.c: cleanup use of global variables Jeroen Hofstee
2013-01-16  1:23   ` Bo Shen
2013-01-12 22:07 ` [U-Boot] [PATCH 06/10] common/lcd.c: remove global lcd_base Jeroen Hofstee
2013-01-16  1:24   ` Bo Shen [this message]
2013-01-12 22:07 ` [U-Boot] [PATCH 07/10] common/lcd: cosmetic: clean up a bit Jeroen Hofstee
2013-03-29 11:04   ` Anatolij Gustschin
2013-01-12 22:07 ` [U-Boot] [PATCH 08/10] lcd, fb: cleanup, remove prototypes already in lcd.h and unused code Jeroen Hofstee
2013-01-12 22:07 ` [U-Boot] [PATCH 09/10] api/api_display: use the getters for console size info Jeroen Hofstee
2013-01-15 18:14   ` Che-liang Chiou
2013-01-12 22:07 ` [U-Boot] [PATCH 10/10] common/lcd.c: move the macro's to the c file Jeroen Hofstee
2013-03-29 11:05   ` Anatolij Gustschin
2013-01-22 20:44 ` [U-Boot] [PATCH v2 00/10] common.lcd: remove globals and cleanup Jeroen Hofstee
2013-01-22 20:44   ` [U-Boot] [PATCH v2 01/10] lcd, amba: remove this driver since it is not used Jeroen Hofstee
2013-01-22 20:44   ` [U-Boot] [PATCH v2 02/10] lcd, tegra: remove unused cursor functions Jeroen Hofstee
2013-01-22 20:44   ` [U-Boot] [PATCH v2 03/10] lcd, mpc8xx: move the mpc8xx driver to drivers/video Jeroen Hofstee
2013-01-22 20:44   ` [U-Boot] [PATCH v2 04/10] lcd, pxafb: move the pxafb " Jeroen Hofstee
2013-01-22 20:44   ` [U-Boot] [PATCH v2 05/10] common/lcd.c: cleanup use of global variables Jeroen Hofstee
2013-01-22 20:44   ` [U-Boot] [PATCH v2 06/10] common/lcd.c: remove global lcd_base Jeroen Hofstee
2013-01-22 20:44   ` [U-Boot] [PATCH v2 08/10] lcd, fb: remove duplicated prototypes and unused code Jeroen Hofstee
2013-01-22 20:44   ` [U-Boot] [PATCH v2 09/10] api/api_display: use the getters for console size info Jeroen Hofstee
2013-03-29 11:03   ` [U-Boot] [PATCH v2 00/10] common.lcd: remove globals and cleanup Anatolij Gustschin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50F60147.3050403@atmel.com \
    --to=voice.shen@atmel.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox