[U-Boot] RFC Pin Configuration Device Tree Bindings for Altera Arria10 SOCFPGA

2014-11-30 Thread Matthew Gerlach
Altera Arria10 SOCFPGA Pin Configuration Bindings

This document describes device tree bindings required to perform configuration
of the pins for an Altera Arria10 SOCFPGA .  The bindings are intended to
be compact and easy to be consumed only by a SPL running in a small on-chip
ram before external memory is available.  The Arria10 SOCFPGA does not support
dynamic modification of the pin configuration.

Each set of pins is represented by its own subnode. For each subnode, the
altr,pinmux-regs data will be written to sequential 32 bit addresses starting
at the address in the reg property.

Required properties:
 - compatible : Must be altr,arria10-pinmux for Arria10 SOCFPGA
 - one subnode for each set of pins to be configured

Required subnode properties:
 - reg : The start address to write pinmux-data as 32 bit quantities and the
number of bytes of registers to be written.
 - altr,pinmux-regs : Pin configuration data to be written to registers

Example:

pinmux@0xffd07000 {
#address-cells = 1;
#size-cells = 0;
compatible = altr,arria10-pinmux;
shared {
reg = 0xffd07000 0x00c0;
altr,pinmux-regs = 0xF 0xF 0xF 0xF 0xF 0xF 0xF 0xF 0xF 0xF
   0xF 0xF 0xF 0xF 0xF 0xF 0xF 0xF 0xF 0xF
   0xD 0xD 0xD 0xD 0xD 0xD 0xD 0xD 0xF 0xF
   0xF 0xF 0xF 0xF 0xF 0xF 0xF 0xF 0xF 0xF
   0xF 0xF 0xF 0xF 0xF 0xF 0xF 0xF;
};
dedicated {
reg = 0xffd07200 0x0044;
altr,pinmux-regs = 0x0 0x0 0x0 0x8 0x8 0x8 0x8 0x8 0x8 0x8
   0xF 0xF 0xF 0xF 0xF 0xD 0xD;
};
dedicated_cfg {
reg = 0xffd07300 0x0048;
altr,pinmux-regs = 0x0 0x51010 0x51010 0x51010 0x40605
   0x40605 0x00605 0x40605 0x40605 0x40605
   0x10605 0x51010 0x51010 0x51010 0x51010
   0x51010 0x03030 0x23030;
};
fpga {
reg = 0xffd07400 0x0044;
altr,pinmux-regs = 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
   0x0 0x0 0x0 0x0 0x0 0x0 0x0;
};
};
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V2 04/12] lcd: remove LCD_MONOCHROME

2014-11-30 Thread Nikita Kiryanov
No one is using LCD_MONOCHROME; remove related code.

Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
Cc: Wolfgang Denk w...@denx.de
Cc: Anatolij Gustschin ag...@denx.de
Acked-by: Simon Glass s...@chromium.org
---
Changes in V2:
- No changes.

 common/lcd.c   | 30 ++
 drivers/video/mpc8xx_lcd.c | 17 -
 drivers/video/pxa_lcd.c| 15 ---
 include/lcd.h  | 10 +-
 4 files changed, 3 insertions(+), 69 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index 22bb488..ed451a9 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -97,10 +97,7 @@
 #define CONSOLE_SIZE   (CONSOLE_ROW_SIZE * CONSOLE_ROWS)
 #define CONSOLE_SCROLL_SIZE(CONSOLE_SIZE - CONSOLE_ROW_SIZE)
 
-#if LCD_BPP == LCD_MONOCHROME
-# define COLOR_MASK(c) ((c)  | (c)  1 | (c)  2 | (c)  3 | \
-(c)  4 | (c)  5 | (c)  6 | (c)  7)
-#elif (LCD_BPP == LCD_COLOR8) || (LCD_BPP == LCD_COLOR16) || \
+#if (LCD_BPP == LCD_COLOR8) || (LCD_BPP == LCD_COLOR16) || \
(LCD_BPP == LCD_COLOR32)
 # define COLOR_MASK(c) (c)
 #else
@@ -313,10 +310,6 @@ static void lcd_drawchars(ushort x, ushort y, uchar *str, 
int count)
y += BMP_LOGO_HEIGHT;
 #endif
 
-#if LCD_BPP == LCD_MONOCHROME
-   ushort off  = x * (1  LCD_BPP) % 8;
-#endif
-
dest = (uchar *)(lcd_base + y * lcd_line_length + x * NBITS(LCD_BPP)/8);
 
for (row = 0; row  VIDEO_FONT_HEIGHT; ++row, dest += lcd_line_length) {
@@ -330,33 +323,18 @@ static void lcd_drawchars(ushort x, ushort y, uchar *str, 
int count)
uchar *d = dest;
 #endif
 
-#if LCD_BPP == LCD_MONOCHROME
-   uchar rest = *d  -(1  (8 - off));
-   uchar sym;
-#endif
for (i = 0; i  count; ++i) {
uchar c, bits;
 
c = *s++;
bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row];
 
-#if LCD_BPP == LCD_MONOCHROME
-   sym  = (COLOR_MASK(lcd_color_fg)  bits) |
-   (COLOR_MASK(lcd_color_bg)  ~bits);
-
-   *d++ = rest | (sym  off);
-   rest = sym  (8-off);
-#else /* LCD_BPP == LCD_COLOR8 or LCD_COLOR16 or LCD_COLOR32 */
for (c = 0; c  8; ++c) {
*d++ = (bits  0x80) ?
lcd_color_fg : lcd_color_bg;
bits = 1;
}
-#endif
}
-#if LCD_BPP == LCD_MONOCHROME
-   *d  = rest | (*d  ((1  (8 - off)) - 1));
-#endif
}
 }
 
@@ -443,11 +421,7 @@ int drv_lcd_init(void)
 /*--*/
 void lcd_clear(void)
 {
-#if LCD_BPP == LCD_MONOCHROME
-   /* Setting the palette */
-   lcd_initcolregs();
-
-#elif LCD_BPP == LCD_COLOR8
+#if LCD_BPP == LCD_COLOR8
/* Setting the palette */
lcd_setcolreg(CONSOLE_COLOR_BLACK, 0, 0, 0);
lcd_setcolreg(CONSOLE_COLOR_RED, 0xFF, 0, 0);
diff --git a/drivers/video/mpc8xx_lcd.c b/drivers/video/mpc8xx_lcd.c
index 3ea240d..3c16bf6 100644
--- a/drivers/video/mpc8xx_lcd.c
+++ b/drivers/video/mpc8xx_lcd.c
@@ -357,23 +357,6 @@ lcd_setcolreg (ushort regno, ushort red, ushort green, 
ushort blue)
 
 /*--*/
 
-#if LCD_BPP == LCD_MONOCHROME
-static
-void lcd_initcolregs (void)
-{
-   volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
-   volatile cpm8xx_t *cp = (immr-im_cpm);
-   ushort regno;
-
-   for (regno = 0; regno  16; regno++) {
-   cp-lcd_cmap[regno * 2] = 0;
-   cp-lcd_cmap[(regno * 2) + 1] = regno  0x0f;
-   }
-}
-#endif
-
-/*--*/
-
 void lcd_enable (void)
 {
volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
diff --git a/drivers/video/pxa_lcd.c b/drivers/video/pxa_lcd.c
index e19f6ac..f66f615 100644
--- a/drivers/video/pxa_lcd.c
+++ b/drivers/video/pxa_lcd.c
@@ -379,21 +379,6 @@ lcd_setcolreg (ushort regno, ushort red, ushort green, 
ushort blue)
 #endif /* LCD_COLOR8 */
 
 /*--*/
-#if LCD_BPP == LCD_MONOCHROME
-void lcd_initcolregs (void)
-{
-   struct pxafb_info *fbi = panel_info.pxa;
-   cmap = (ushort *)fbi-palette;
-   ushort regno;
-
-   for (regno = 0; regno  16; regno++) {
-   cmap[regno * 2] = 0;
-   cmap[(regno * 2) + 1] = regno  0x0f;
-   }
-}
-#endif /* LCD_MONOCHROME */
-
-/*--*/
 __weak void lcd_enable(void)
 {
 }
diff --git a/include/lcd.h b/include/lcd.h
index 020d880..01609ac 100644
--- a/include/lcd.h
+++ b/include/lcd.h
@@ -359,15 +359,7 @@ void lcd_sync(void);
 

[U-Boot] [PATCH V2 05/12] lcd: rename console_(row|col)

2014-11-30 Thread Nikita Kiryanov
Rename console_(row|col) to console_curr_(row|col) to make their meaning clearer
and distinguish them from CONSOLE_(COLS|ROWS).

This is a preparatory step for extracting lcd console code into its own file.

Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
Cc: Simon Glass s...@chromium.org
Cc: Anatolij Gustschin ag...@denx.de
---
Changes in V2:
- New patch.

 common/lcd.c | 54 +++---
 1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index ed451a9..371f4a2 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -122,8 +122,8 @@ int lcd_line_length;
 
 char lcd_is_enabled = 0;
 
-static short console_col;
-static short console_row;
+static short console_curr_col;
+static short console_curr_row;
 
 static void *lcd_console_address;
 static void *lcd_base; /* Start of framebuffer memory  */
@@ -188,31 +188,31 @@ static void console_scrollup(void)
}
 #endif
lcd_sync();
-   console_row -= rows;
+   console_curr_row -= rows;
 }
 
 /*--*/
 
 static inline void console_back(void)
 {
-   if (--console_col  0) {
-   console_col = CONSOLE_COLS-1 ;
-   if (--console_row  0)
-   console_row = 0;
+   if (--console_curr_col  0) {
+   console_curr_col = CONSOLE_COLS-1;
+   if (--console_curr_row  0)
+   console_curr_row = 0;
}
 
-   lcd_putc_xy(console_col * VIDEO_FONT_WIDTH,
-   console_row * VIDEO_FONT_HEIGHT, ' ');
+   lcd_putc_xy(console_curr_col * VIDEO_FONT_WIDTH,
+   console_curr_row * VIDEO_FONT_HEIGHT, ' ');
 }
 
 /*--*/
 
 static inline void console_newline(void)
 {
-   console_col = 0;
+   console_curr_col = 0;
 
/* Check if we need to scroll the terminal */
-   if (++console_row = CONSOLE_ROWS)
+   if (++console_curr_row = CONSOLE_ROWS)
console_scrollup();
else
lcd_sync();
@@ -235,7 +235,7 @@ void lcd_putc(const char c)
 
switch (c) {
case '\r':
-   console_col = 0;
+   console_curr_col = 0;
 
return;
case '\n':
@@ -243,10 +243,10 @@ void lcd_putc(const char c)
 
return;
case '\t':  /* Tab (8 chars alignment) */
-   console_col +=  8;
-   console_col = ~7;
+   console_curr_col +=  8;
+   console_curr_col = ~7;
 
-   if (console_col = CONSOLE_COLS)
+   if (console_curr_col = CONSOLE_COLS)
console_newline();
 
return;
@@ -255,9 +255,9 @@ void lcd_putc(const char c)
 
return;
default:
-   lcd_putc_xy(console_col * VIDEO_FONT_WIDTH,
-   console_row * VIDEO_FONT_HEIGHT, c);
-   if (++console_col = CONSOLE_COLS)
+   lcd_putc_xy(console_curr_col * VIDEO_FONT_WIDTH,
+   console_curr_row * VIDEO_FONT_HEIGHT, c);
+   if (++console_curr_col = CONSOLE_COLS)
console_newline();
}
 }
@@ -464,8 +464,8 @@ void lcd_clear(void)
debug([LCD] Drawing the logo...\n);
lcd_console_address = lcd_logo();
 
-   console_col = 0;
-   console_row = 0;
+   console_curr_col = 0;
+   console_curr_row = 0;
lcd_sync();
 }
 
@@ -508,11 +508,11 @@ static int lcd_init(void *lcdbase)
lcd_enable();
 
/* Initialize the console */
-   console_col = 0;
+   console_curr_col = 0;
 #ifdef CONFIG_LCD_INFO_BELOW_LOGO
-   console_row = 7 + BMP_LOGO_HEIGHT / VIDEO_FONT_HEIGHT;
+   console_curr_row = 7 + BMP_LOGO_HEIGHT / VIDEO_FONT_HEIGHT;
 #else
-   console_row = 1;/* leave 1 blank line below logo */
+   console_curr_row = 1;   /* leave 1 blank line below logo */
 #endif
 
return 0;
@@ -1062,8 +1062,8 @@ static void *lcd_logo(void)
bitmap_plot(0, 0);
 
 #ifdef CONFIG_LCD_INFO
-   console_col = LCD_INFO_X / VIDEO_FONT_WIDTH;
-   console_row = LCD_INFO_Y / VIDEO_FONT_HEIGHT;
+   console_curr_col = LCD_INFO_X / VIDEO_FONT_WIDTH;
+   console_curr_row = LCD_INFO_Y / VIDEO_FONT_HEIGHT;
lcd_show_board_info();
 #endif /* CONFIG_LCD_INFO */
 
@@ -1100,8 +1100,8 @@ U_BOOT_ENV_CALLBACK(splashimage, on_splashimage);
 
 void lcd_position_cursor(unsigned col, unsigned row)
 {
-   console_col = min_t(short, col, CONSOLE_COLS - 1);
-   console_row = min_t(short, row, CONSOLE_ROWS - 1);
+   console_curr_col = min_t(short, col, CONSOLE_COLS - 1);
+   console_curr_row = min_t(short, row, CONSOLE_ROWS - 1);
 }
 
 int lcd_get_pixel_width(void)
-- 
1.9.1

___
U-Boot mailing list

[U-Boot] [PATCH V2 01/12] lcd: remove CONFIG_SYS_INVERT_COLORS

2014-11-30 Thread Nikita Kiryanov
No one is using CONFIG_SYS_INVERT_COLORS; remove related code.

Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
Cc: Simon Glass s...@chromium.org
Cc: Anatolij Gustschin ag...@denx.de
Acked-by: Simon Glass s...@chromium.org
---
Changes in V2:
- No changes.

 common/lcd.c   | 8 
 drivers/video/mpc8xx_lcd.c | 4 +---
 2 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index 28b3fe7..c7d597e 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -685,11 +685,7 @@ void bitmap_plot(int x, int y)
*(cmap + BMP_LOGO_OFFSET) = lut_entry;
cmap++;
 #else /* !CONFIG_ATMEL_LCD */
-#ifdef  CONFIG_SYS_INVERT_COLORS
-   *cmap++ = 0x - colreg;
-#else
*cmap++ = colreg;
-#endif
 #endif /* CONFIG_ATMEL_LCD */
}
 
@@ -967,11 +963,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
( ((cte.red)8)  0xf800) |
( ((cte.green)  3)  0x07e0) |
( ((cte.blue)   3)  0x001f) ;
-#ifdef CONFIG_SYS_INVERT_COLORS
-   *cmap = 0x - colreg;
-#else
*cmap = colreg;
-#endif
 #if defined(CONFIG_MPC823)
cmap--;
 #else
diff --git a/drivers/video/mpc8xx_lcd.c b/drivers/video/mpc8xx_lcd.c
index 2bc3ceb..98b9f5e 100644
--- a/drivers/video/mpc8xx_lcd.c
+++ b/drivers/video/mpc8xx_lcd.c
@@ -373,9 +373,7 @@ lcd_setcolreg (ushort regno, ushort red, ushort green, 
ushort blue)
colreg = ((red0x0F)  8) |
 ((green  0x0F)  4) |
  (blue   0x0F) ;
-#ifdef CONFIG_SYS_INVERT_COLORS
-   colreg ^= 0x0FFF;
-#endif
+
*cmap_ptr = colreg;
 
debug (setcolreg: reg %2d @ %p: R=%02X G=%02X B=%02X = %02X%02X\n,
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V2 03/12] mpc8xx_lcd: get rid of CONFIG_EDT32F10

2014-11-30 Thread Nikita Kiryanov
No one is using CONFIG_EDT32F10; remove related code.

Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
Cc: Wolfgang Denk w...@denx.de
Cc: Anatolij Gustschin ag...@denx.de
Acked-by: Simon Glass s...@chromium.org
---
Changes in V2:
- No changes.

 drivers/video/mpc8xx_lcd.c | 28 
 include/configs/R360MPI.h  |  1 -
 2 files changed, 29 deletions(-)

diff --git a/drivers/video/mpc8xx_lcd.c b/drivers/video/mpc8xx_lcd.c
index 98b9f5e..3ea240d 100644
--- a/drivers/video/mpc8xx_lcd.c
+++ b/drivers/video/mpc8xx_lcd.c
@@ -34,11 +34,6 @@
 #define CONFIG_LCD_INFO/* Display Logo, (C) and system info
*/
 #endif
 
-#if defined(CONFIG_EDT32F10)
-#undef CONFIG_LCD_LOGO
-#undef CONFIG_LCD_INFO
-#endif
-
 /*--*/
 #ifdef CONFIG_KYOCERA_KCS057QV1AJ
 /*
@@ -224,20 +219,6 @@ vidinfo_t panel_info = {
 };
 #endif /* CONFIG_OPTREX_BW */
 
-/*-*/
-#ifdef CONFIG_EDT32F10
-/*
- * Emerging Display Technologies 320x240. Passive, monochrome, single scan.
- */
-#define LCD_BPPLCD_MONOCHROME
-#define LCD_DF 10
-
-vidinfo_t panel_info = {
-320, 240, 0, 0, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, CONFIG_SYS_HIGH, 
CONFIG_SYS_HIGH, CONFIG_SYS_LOW,
-LCD_BPP,  0, 0, 0, 0, 33, 0, 0, 0
-};
-#endif
-
 //
 /* - chipset specific functions --- */
 //
@@ -305,7 +286,6 @@ void lcd_ctrl_init (void *lcdbase)
immr-im_clkrst.car_sccr = ~0x1F;
immr-im_clkrst.car_sccr |= LCD_DF; /* was 8 */
 
-#if !defined(CONFIG_EDT32F10)
/* Enable LCD on port D.
 */
immr-im_ioport.iop_pdpar |= 0x1FFF;
@@ -315,14 +295,6 @@ void lcd_ctrl_init (void *lcdbase)
 */
immr-im_cpm.cp_pbpar |= 0x5001;
immr-im_cpm.cp_pbdir |= 0x5001;
-#else
-   /* Enable LCD on port D.
-*/
-   immr-im_ioport.iop_pdpar |= 0x1DFF;
-   immr-im_ioport.iop_pdpar = ~0x0200;
-   immr-im_ioport.iop_pddir |= 0x1FFF;
-   immr-im_ioport.iop_pddat |= 0x0200;
-#endif
 
/* Load the physical address of the linear frame buffer
 * into the LCD controller.
diff --git a/include/configs/R360MPI.h b/include/configs/R360MPI.h
index 009d1cf..fbaf6a5 100644
--- a/include/configs/R360MPI.h
+++ b/include/configs/R360MPI.h
@@ -24,7 +24,6 @@
 
 #define CONFIG_LCD
 #define CONFIG_MPC8XX_LCD
-#undef  CONFIG_EDT32F10
 #define CONFIG_SHARP_LQ057Q3DC02
 
 #defineCONFIG_SPLASH_SCREEN
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V2 02/12] lcd: cleanup lcd_drawchars

2014-11-30 Thread Nikita Kiryanov
Remove code duplication from lcd_drawchars().

Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
Cc: Anatolij Gustschin ag...@denx.de
Cc: Simon Glass s...@chromium.org
Acked-by: Simon Glass s...@chromium.org
---
Changes in V2:
- No changes.

 common/lcd.c | 14 +-
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index c7d597e..22bb488 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -346,19 +346,7 @@ static void lcd_drawchars(ushort x, ushort y, uchar *str, 
int count)
 
*d++ = rest | (sym  off);
rest = sym  (8-off);
-#elif LCD_BPP == LCD_COLOR8
-   for (c = 0; c  8; ++c) {
-   *d++ = (bits  0x80) ?
-   lcd_color_fg : lcd_color_bg;
-   bits = 1;
-   }
-#elif LCD_BPP == LCD_COLOR16
-   for (c = 0; c  8; ++c) {
-   *d++ = (bits  0x80) ?
-   lcd_color_fg : lcd_color_bg;
-   bits = 1;
-   }
-#elif LCD_BPP == LCD_COLOR32
+#else /* LCD_BPP == LCD_COLOR8 or LCD_COLOR16 or LCD_COLOR32 */
for (c = 0; c  8; ++c) {
*d++ = (bits  0x80) ?
lcd_color_fg : lcd_color_bg;
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V2 06/12] lcd: replace CONSOLE_(ROWS|COLS) with variables

2014-11-30 Thread Nikita Kiryanov
Replace CONSOLE_(ROWS|COLS) macros with variables, and assign the
original macro values.

This is a preparatory step for extracting lcd console code into its own
file.

Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
Cc: Anatolij Gustschin ag...@denx.de
Cc: Simon Glass s...@chromium.org
---
Changes in V2:
- New patch.

 common/lcd.c | 35 ++-
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index 371f4a2..f8fff90 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -81,20 +81,12 @@
 //
 /* ** CONSOLE DEFINITIONS  FUNCTIONS  */
 //
-#if defined(CONFIG_LCD_LOGO)  !defined(CONFIG_LCD_INFO_BELOW_LOGO)
-# define CONSOLE_ROWS  ((panel_info.vl_row-BMP_LOGO_HEIGHT) \
-   / VIDEO_FONT_HEIGHT)
-#else
-# define CONSOLE_ROWS  (panel_info.vl_row / VIDEO_FONT_HEIGHT)
-#endif
-
-#define CONSOLE_COLS   (panel_info.vl_col / VIDEO_FONT_WIDTH)
 #define CONSOLE_ROW_SIZE   (VIDEO_FONT_HEIGHT * lcd_line_length)
 #define CONSOLE_ROW_FIRST  lcd_console_address
 #define CONSOLE_ROW_SECOND (lcd_console_address + CONSOLE_ROW_SIZE)
 #define CONSOLE_ROW_LAST   (lcd_console_address + CONSOLE_SIZE \
- CONSOLE_ROW_SIZE)
-#define CONSOLE_SIZE   (CONSOLE_ROW_SIZE * CONSOLE_ROWS)
+#define CONSOLE_SIZE   (CONSOLE_ROW_SIZE * console_rows)
 #define CONSOLE_SCROLL_SIZE(CONSOLE_SIZE - CONSOLE_ROW_SIZE)
 
 #if (LCD_BPP == LCD_COLOR8) || (LCD_BPP == LCD_COLOR16) || \
@@ -124,6 +116,8 @@ char lcd_is_enabled = 0;
 
 static short console_curr_col;
 static short console_curr_row;
+static short console_cols;
+static short console_rows;
 
 static void *lcd_console_address;
 static void *lcd_base; /* Start of framebuffer memory  */
@@ -196,7 +190,7 @@ static void console_scrollup(void)
 static inline void console_back(void)
 {
if (--console_curr_col  0) {
-   console_curr_col = CONSOLE_COLS-1;
+   console_curr_col = console_cols - 1;
if (--console_curr_row  0)
console_curr_row = 0;
}
@@ -212,7 +206,7 @@ static inline void console_newline(void)
console_curr_col = 0;
 
/* Check if we need to scroll the terminal */
-   if (++console_curr_row = CONSOLE_ROWS)
+   if (++console_curr_row = console_rows)
console_scrollup();
else
lcd_sync();
@@ -246,7 +240,7 @@ void lcd_putc(const char c)
console_curr_col +=  8;
console_curr_col = ~7;
 
-   if (console_curr_col = CONSOLE_COLS)
+   if (console_curr_col = console_cols)
console_newline();
 
return;
@@ -257,7 +251,7 @@ void lcd_putc(const char c)
default:
lcd_putc_xy(console_curr_col * VIDEO_FONT_WIDTH,
console_curr_row * VIDEO_FONT_HEIGHT, c);
-   if (++console_curr_col = CONSOLE_COLS)
+   if (++console_curr_col = console_cols)
console_newline();
}
 }
@@ -464,6 +458,13 @@ void lcd_clear(void)
debug([LCD] Drawing the logo...\n);
lcd_console_address = lcd_logo();
 
+#if defined(CONFIG_LCD_LOGO)  !defined(CONFIG_LCD_INFO_BELOW_LOGO)
+   console_rows = (panel_info.vl_row - BMP_LOGO_HEIGHT);
+   console_rows /= VIDEO_FONT_HEIGHT;
+#else
+   console_rows = panel_info.vl_row / VIDEO_FONT_HEIGHT;
+#endif
+   console_cols = panel_info.vl_col / VIDEO_FONT_WIDTH;
console_curr_col = 0;
console_curr_row = 0;
lcd_sync();
@@ -1100,8 +1101,8 @@ U_BOOT_ENV_CALLBACK(splashimage, on_splashimage);
 
 void lcd_position_cursor(unsigned col, unsigned row)
 {
-   console_curr_col = min_t(short, col, CONSOLE_COLS - 1);
-   console_curr_row = min_t(short, row, CONSOLE_ROWS - 1);
+   console_curr_col = min_t(short, col, console_cols - 1);
+   console_curr_row = min_t(short, row, console_rows - 1);
 }
 
 int lcd_get_pixel_width(void)
@@ -1116,12 +1117,12 @@ int lcd_get_pixel_height(void)
 
 int lcd_get_screen_rows(void)
 {
-   return CONSOLE_ROWS;
+   return console_rows;
 }
 
 int lcd_get_screen_columns(void)
 {
-   return CONSOLE_COLS;
+   return console_cols;
 }
 
 #if defined(CONFIG_LCD_DT_SIMPLEFB)
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V2 09/12] lcd: introduce getters for bg/fg color

2014-11-30 Thread Nikita Kiryanov
Introduce lcd_getbgcolor() and lcd_getfgcolor(), and use them where
applicable.

This is a preparatory step for extracting lcd console code into its own
file.

Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
c: Anatolij Gustschin ag...@denx.de
Cc: Simon Glass s...@chromium.org
---
Changes in V2:
- New patch.

 common/lcd.c  | 20 +++-
 include/lcd.h | 14 ++
 2 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index f98aaaf..a75c616 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -186,7 +186,7 @@ static void console_scrollup(void)
/* Clear the last rows */
 #if (LCD_BPP != LCD_COLOR32)
memset(lcd_console_address + CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows,
-   lcd_color_bg,
+   lcd_getbgcolor(),
CONSOLE_ROW_SIZE * rows);
 #else
u32 *ppix = lcd_console_address +
@@ -195,7 +195,7 @@ static void console_scrollup(void)
for (i = 0;
i  (CONSOLE_ROW_SIZE * rows) / NBYTES(panel_info.vl_bpix);
i++) {
-   *ppix++ = lcd_color_bg;
+   *ppix++ = lcd_getbgcolor();
}
 #endif
lcd_sync();
@@ -342,7 +342,7 @@ static void lcd_drawchars(ushort x, ushort y, uchar *str, 
int count)
 
for (c = 0; c  8; ++c) {
*d++ = (bits  0x80) ?
-   lcd_color_fg : lcd_color_bg;
+   lcd_getfgcolor() : lcd_getbgcolor();
bits = 1;
}
}
@@ -460,7 +460,7 @@ void lcd_clear(void)
/* set framebuffer to background color */
 #if (LCD_BPP != LCD_COLOR32)
memset((char *)lcd_base,
-   lcd_color_bg,
+   lcd_getbgcolor(),
lcd_line_length * panel_info.vl_row);
 #else
u32 *ppix = lcd_base;
@@ -468,7 +468,7 @@ void lcd_clear(void)
for (i = 0;
   i  (lcd_line_length * panel_info.vl_row)/NBYTES(panel_info.vl_bpix);
   i++) {
-   *ppix++ = lcd_color_bg;
+   *ppix++ = lcd_getbgcolor();
}
 #endif
 #endif
@@ -575,6 +575,11 @@ static void lcd_setfgcolor(int color)
lcd_color_fg = color;
 }
 
+int lcd_getfgcolor(void)
+{
+   return lcd_color_fg;
+}
+
 /*--*/
 
 static void lcd_setbgcolor(int color)
@@ -582,6 +587,11 @@ static void lcd_setbgcolor(int color)
lcd_color_bg = color;
 }
 
+int lcd_getbgcolor(void)
+{
+   return lcd_color_bg;
+}
+
 //
 /* ** Chipset depending Bitmap / Logo stuff...  */
 //
diff --git a/include/lcd.h b/include/lcd.h
index 01609ac..2235b9b 100644
--- a/include/lcd.h
+++ b/include/lcd.h
@@ -291,6 +291,20 @@ int lcd_get_screen_rows(void);
 int lcd_get_screen_columns(void);
 
 /**
+ * Get the background color of the LCD
+ *
+ * @return background color value
+ */
+int lcd_getbgcolor(void);
+
+/**
+ * Get the foreground color of the LCD
+ *
+ * @return foreground color value
+ */
+int lcd_getfgcolor(void);
+
+/**
  * Set the position of the text cursor
  *
  * @param col  Column to place cursor (0 = left side)
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V2 07/12] lcd: expand console api

2014-11-30 Thread Nikita Kiryanov
Introduce set_console_row(), set_console_col(), and lcd_init_console().
Use these functions in lcd functions: lcd_init(), lcd_clear(), lcd_logo().

This is a preparatory step for extracting lcd console code into its own
file.

Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
Cc: Anatolij Gustschin ag...@denx.de
Cc: Simon Glass s...@chromium.org
---
Changes in V2:
- New patch.

 common/lcd.c | 35 ++-
 1 file changed, 26 insertions(+), 9 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index f8fff90..bc15c78 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -155,6 +155,25 @@ void lcd_set_flush_dcache(int flush)
lcd_flush_dcache = (flush != 0);
 }
 
+void lcd_init_console(void *address, int rows, int cols)
+{
+   console_curr_col = 0;
+   console_curr_row = 0;
+   console_cols = cols;
+   console_rows = rows;
+   lcd_console_address = address;
+}
+
+void lcd_set_col(short col)
+{
+   console_curr_col = col;
+}
+
+void lcd_set_row(short row)
+{
+   console_curr_row = row;
+}
+
 /*--*/
 
 static void console_scrollup(void)
@@ -415,6 +434,7 @@ int drv_lcd_init(void)
 /*--*/
 void lcd_clear(void)
 {
+   short console_rows, console_cols;
 #if LCD_BPP == LCD_COLOR8
/* Setting the palette */
lcd_setcolreg(CONSOLE_COLOR_BLACK, 0, 0, 0);
@@ -456,8 +476,6 @@ void lcd_clear(void)
 #endif
/* Paint the logo and retrieve LCD base address */
debug([LCD] Drawing the logo...\n);
-   lcd_console_address = lcd_logo();
-
 #if defined(CONFIG_LCD_LOGO)  !defined(CONFIG_LCD_INFO_BELOW_LOGO)
console_rows = (panel_info.vl_row - BMP_LOGO_HEIGHT);
console_rows /= VIDEO_FONT_HEIGHT;
@@ -465,8 +483,7 @@ void lcd_clear(void)
console_rows = panel_info.vl_row / VIDEO_FONT_HEIGHT;
 #endif
console_cols = panel_info.vl_col / VIDEO_FONT_WIDTH;
-   console_curr_col = 0;
-   console_curr_row = 0;
+   lcd_init_console(lcd_logo(), console_rows, console_cols);
lcd_sync();
 }
 
@@ -509,11 +526,11 @@ static int lcd_init(void *lcdbase)
lcd_enable();
 
/* Initialize the console */
-   console_curr_col = 0;
+   lcd_set_col(0);
 #ifdef CONFIG_LCD_INFO_BELOW_LOGO
-   console_curr_row = 7 + BMP_LOGO_HEIGHT / VIDEO_FONT_HEIGHT;
+   lcd_set_row(7 + BMP_LOGO_HEIGHT / VIDEO_FONT_HEIGHT);
 #else
-   console_curr_row = 1;   /* leave 1 blank line below logo */
+   lcd_set_row(1); /* leave 1 blank line below logo */
 #endif
 
return 0;
@@ -1063,8 +1080,8 @@ static void *lcd_logo(void)
bitmap_plot(0, 0);
 
 #ifdef CONFIG_LCD_INFO
-   console_curr_col = LCD_INFO_X / VIDEO_FONT_WIDTH;
-   console_curr_row = LCD_INFO_Y / VIDEO_FONT_HEIGHT;
+   lcd_set_col(LCD_INFO_X / VIDEO_FONT_WIDTH);
+   lcd_set_row(LCD_INFO_Y / VIDEO_FONT_HEIGHT);
lcd_show_board_info();
 #endif /* CONFIG_LCD_INFO */
 
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V2 12/12] lcd_console: remove unused defines

2014-11-30 Thread Nikita Kiryanov
CONSOLE_ROW_SECOND, CONSOLE_ROW_LAST, and
CONSOLE_SCROLL_SIZE are unused. Remove them.

Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
Cc: Anatolij Gustschin ag...@denx.de
Cc: Simon Glass s...@chromium.org
---
Changes in V2:
- New patch.

 common/lcd_console.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/common/lcd_console.c b/common/lcd_console.c
index 223c9e8..03b4b6a 100644
--- a/common/lcd_console.c
+++ b/common/lcd_console.c
@@ -12,11 +12,7 @@
 
 #define CONSOLE_ROW_SIZE   (VIDEO_FONT_HEIGHT * lcd_line_length)
 #define CONSOLE_ROW_FIRST  lcd_console_address
-#define CONSOLE_ROW_SECOND (lcd_console_address + CONSOLE_ROW_SIZE)
-#define CONSOLE_ROW_LAST   (lcd_console_address + CONSOLE_SIZE \
-   - CONSOLE_ROW_SIZE)
 #define CONSOLE_SIZE   (CONSOLE_ROW_SIZE * console_rows)
-#define CONSOLE_SCROLL_SIZE(CONSOLE_SIZE - CONSOLE_ROW_SIZE)
 
 static short console_curr_col;
 static short console_curr_row;
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V2 08/12] lcd: get rid of COLOR_MASK

2014-11-30 Thread Nikita Kiryanov
COLOR_MASK macro doesn't do anything; Remove it to reduce visual
complexity.

This is a preparatory step for extracting lcd console code into its own
file.

Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
Cc: Anatolij Gustschin ag...@denx.de
Cc: Simon Glass s...@chromium.org
---
Changes in V2:
- New patch.

 common/lcd.c | 14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index bc15c78..f98aaaf 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -89,10 +89,8 @@
 #define CONSOLE_SIZE   (CONSOLE_ROW_SIZE * console_rows)
 #define CONSOLE_SCROLL_SIZE(CONSOLE_SIZE - CONSOLE_ROW_SIZE)
 
-#if (LCD_BPP == LCD_COLOR8) || (LCD_BPP == LCD_COLOR16) || \
-   (LCD_BPP == LCD_COLOR32)
-# define COLOR_MASK(c) (c)
-#else
+#if (LCD_BPP != LCD_COLOR8)  (LCD_BPP != LCD_COLOR16)  \
+   (LCD_BPP != LCD_COLOR32)
 # error Unsupported LCD BPP.
 #endif
 
@@ -188,7 +186,7 @@ static void console_scrollup(void)
/* Clear the last rows */
 #if (LCD_BPP != LCD_COLOR32)
memset(lcd_console_address + CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows,
-   COLOR_MASK(lcd_color_bg),
+   lcd_color_bg,
CONSOLE_ROW_SIZE * rows);
 #else
u32 *ppix = lcd_console_address +
@@ -197,7 +195,7 @@ static void console_scrollup(void)
for (i = 0;
i  (CONSOLE_ROW_SIZE * rows) / NBYTES(panel_info.vl_bpix);
i++) {
-   *ppix++ = COLOR_MASK(lcd_color_bg);
+   *ppix++ = lcd_color_bg;
}
 #endif
lcd_sync();
@@ -462,7 +460,7 @@ void lcd_clear(void)
/* set framebuffer to background color */
 #if (LCD_BPP != LCD_COLOR32)
memset((char *)lcd_base,
-   COLOR_MASK(lcd_color_bg),
+   lcd_color_bg,
lcd_line_length * panel_info.vl_row);
 #else
u32 *ppix = lcd_base;
@@ -470,7 +468,7 @@ void lcd_clear(void)
for (i = 0;
   i  (lcd_line_length * panel_info.vl_row)/NBYTES(panel_info.vl_bpix);
   i++) {
-   *ppix++ = COLOR_MASK(lcd_color_bg);
+   *ppix++ = lcd_color_bg;
}
 #endif
 #endif
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V2 10/12] lcd: make lcd_drawchars() independant of lcd_base

2014-11-30 Thread Nikita Kiryanov
lcd_logo() has the following return value:

 #if defined(CONFIG_LCD_LOGO)  !defined(CONFIG_LCD_INFO_BELOW_LOGO)
return (void *)((ulong)lcd_base + BMP_LOGO_HEIGHT * lcd_line_length);
 #else
return (void *)lcd_base;
 #endif

This return value gets assigned to lcd_console_address.
lcd_console_address is not assigned or modified anywhere else.
Thus:

 #if defined(CONFIG_LCD_LOGO)  !defined(CONFIG_LCD_INFO_BELOW_LOGO):
y' = BMP_LOGO_HEIGHT + y;
lcd_base + y' * lcd_line_length ==
lcd_base + (BMP_LOGO_HEIGHT + y) * lcd_line_length ==
lcd_base + BMP_LOGO_HEIGHT * lcd_line_length + y * lcd_line_length ==
lcd_console_address + y * lcd_line_length
 #else
lcd_base + y * lcd_line_length == lcd_console_address + y * 
lcd_line_length
 #endif

This is a preparatory step for extracting lcd console code into its own
file.

Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
Cc: Anatolij Gustschin ag...@denx.de
Cc: Simon Glass s...@chromium.org
---
Changes in V2:
- New patch.

 common/lcd.c | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index a75c616..b55dd4c 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -317,11 +317,8 @@ static void lcd_drawchars(ushort x, ushort y, uchar *str, 
int count)
uchar *dest;
ushort row;
 
-#if defined(CONFIG_LCD_LOGO)  !defined(CONFIG_LCD_INFO_BELOW_LOGO)
-   y += BMP_LOGO_HEIGHT;
-#endif
-
-   dest = (uchar *)(lcd_base + y * lcd_line_length + x * NBITS(LCD_BPP)/8);
+   dest = (uchar *)(lcd_console_address +
+   y * lcd_line_length + x * NBITS(LCD_BPP) / 8);
 
for (row = 0; row  VIDEO_FONT_HEIGHT; ++row, dest += lcd_line_length) {
uchar *s = str;
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V2 00/12] cleanup and refactor lcd.c

2014-11-30 Thread Nikita Kiryanov
NOTE: I'm resending this cover letter with a shorter Cc list because the
original mail got held up. Sorry for the double post.

This series is a first step towards an end goal of merging all CONFIG_LCD
related functionality into CONFIG_VIDEO code. My plan is to start by refactoring
lcd.c into something cleaner (less ifdefs) and more modular (split code into
multiple files), then possibly refactor CONFIG_VIDEO code if needed, and then
finally: move CONFIG_LCD related functionality over to CONFIG_VIDEO code,
replacing as much CONFIG_LCD related code with CONFIG_VIDEO related code as
possible.

This specific step eliminates some unused code and refactors lcd console stuff
into its own file.

In V2 I broke the last patch of the original series (lcd: refactor lcd console
stuff into its own file) into multiple patches to make it clear what changes
had to be done in order to refactor the lcd console code into its own file.
These preparatory patches (lcd: rename console_(row|col) to
lcd: make lcd_drawchars() independant of lcd_base) are meant to illustrate
exactly what changed and where in the transition from lcd.c to lcd_console.c,
and are not necesserily code improvements when viewed out of context.

Additional changes in V2:
- Added documentation for the new functions.

The whole series was rebased over current mainline, and compile tested for arm
and powerpc.

Cc: Anatolij Gustschin ag...@denx.de
Cc: Wolfgang Denk w...@denx.de
Cc: Simon Glass s...@chromium.org

Nikita Kiryanov (12):
  lcd: remove CONFIG_SYS_INVERT_COLORS
  lcd: cleanup lcd_drawchars
  mpc8xx_lcd: get rid of CONFIG_EDT32F10
  lcd: remove LCD_MONOCHROME
  lcd: rename console_(row|col)
  lcd: replace CONSOLE_(ROWS|COLS) with variables
  lcd: expand console api
  lcd: get rid of COLOR_MASK
  lcd: introduce getters for bg/fg color
  lcd: make lcd_drawchars() independant of lcd_base
  lcd: refactor lcd console stuff into its own file
  lcd_console: remove unused defines

 common/Makefile|   2 +-
 common/lcd.c   | 308 +
 common/lcd_console.c   | 208 ++
 drivers/video/mpc8xx_lcd.c |  49 +---
 drivers/video/pxa_lcd.c|  15 ---
 include/configs/R360MPI.h  |   1 -
 include/lcd.h  |  25 ++--
 include/lcd_console.h  |  85 +
 8 files changed, 340 insertions(+), 353 deletions(-)
 create mode 100644 common/lcd_console.c
 create mode 100644 include/lcd_console.h

-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V2 11/12] lcd: refactor lcd console stuff into its own file

2014-11-30 Thread Nikita Kiryanov
common/lcd.c is a mix of code portions that do different but related
things. To improve modularity, the various code portions should be split
into their own modules. Separate lcd console code into its own file.

Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
Cc: Anatolij Gustschin ag...@denx.de
Cc: Wolfgang Denk w...@denx.de
Cc: Simon Glass s...@chromium.org
---
NOTE: I'm resending this cover letter with a shorter Cc list because the
original mail got held up. Sorry for the double post.

Changes in V2:
- New patch.

 common/Makefile   |   2 +-
 common/lcd.c  | 227 --
 common/lcd_console.c  | 212 ++
 include/lcd.h |   1 +
 include/lcd_console.h |  85 +++
 5 files changed, 299 insertions(+), 228 deletions(-)
 create mode 100644 common/lcd_console.c
 create mode 100644 include/lcd_console.h

diff --git a/common/Makefile b/common/Makefile
index 9c47e20..66584fc 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -206,7 +206,7 @@ obj-$(CONFIG_CMD_KGDB) += kgdb.o kgdb_stubs.o
 obj-$(CONFIG_I2C_EDID) += edid.o
 obj-$(CONFIG_KALLSYMS) += kallsyms.o
 obj-y += splash.o
-obj-$(CONFIG_LCD) += lcd.o
+obj-$(CONFIG_LCD) += lcd.o lcd_console.o
 obj-$(CONFIG_LYNXKDI) += lynxkdi.o
 obj-$(CONFIG_MENU) += menu.o
 obj-$(CONFIG_MODEM_SUPPORT) += modem.o
diff --git a/common/lcd.c b/common/lcd.c
index b55dd4c..2d0380d 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -73,22 +73,6 @@
 #define CONFIG_LCD_ALIGNMENT PAGE_SIZE
 #endif
 
-/* By default we scroll by a single line */
-#ifndef CONFIG_CONSOLE_SCROLL_LINES
-#define CONFIG_CONSOLE_SCROLL_LINES 1
-#endif
-
-//
-/* ** CONSOLE DEFINITIONS  FUNCTIONS  */
-//
-#define CONSOLE_ROW_SIZE   (VIDEO_FONT_HEIGHT * lcd_line_length)
-#define CONSOLE_ROW_FIRST  lcd_console_address
-#define CONSOLE_ROW_SECOND (lcd_console_address + CONSOLE_ROW_SIZE)
-#define CONSOLE_ROW_LAST   (lcd_console_address + CONSOLE_SIZE \
-   - CONSOLE_ROW_SIZE)
-#define CONSOLE_SIZE   (CONSOLE_ROW_SIZE * console_rows)
-#define CONSOLE_SCROLL_SIZE(CONSOLE_SIZE - CONSOLE_ROW_SIZE)
-
 #if (LCD_BPP != LCD_COLOR8)  (LCD_BPP != LCD_COLOR16)  \
(LCD_BPP != LCD_COLOR32)
 # error Unsupported LCD BPP.
@@ -96,9 +80,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static void lcd_drawchars(ushort x, ushort y, uchar *str, int count);
-static inline void lcd_putc_xy(ushort x, ushort y, uchar  c);
-
 static int lcd_init(void *lcdbase);
 
 static void *lcd_logo(void);
@@ -112,12 +93,6 @@ int lcd_line_length;
 
 char lcd_is_enabled = 0;
 
-static short console_curr_col;
-static short console_curr_row;
-static short console_cols;
-static short console_rows;
-
-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 */
@@ -153,82 +128,6 @@ void lcd_set_flush_dcache(int flush)
lcd_flush_dcache = (flush != 0);
 }
 
-void lcd_init_console(void *address, int rows, int cols)
-{
-   console_curr_col = 0;
-   console_curr_row = 0;
-   console_cols = cols;
-   console_rows = rows;
-   lcd_console_address = address;
-}
-
-void lcd_set_col(short col)
-{
-   console_curr_col = col;
-}
-
-void lcd_set_row(short row)
-{
-   console_curr_row = row;
-}
-
-/*--*/
-
-static void console_scrollup(void)
-{
-   const int rows = CONFIG_CONSOLE_SCROLL_LINES;
-
-   /* Copy up rows ignoring those that will be overwritten */
-   memcpy(CONSOLE_ROW_FIRST,
-  lcd_console_address + CONSOLE_ROW_SIZE * rows,
-  CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows);
-
-   /* Clear the last rows */
-#if (LCD_BPP != LCD_COLOR32)
-   memset(lcd_console_address + CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows,
-   lcd_getbgcolor(),
-   CONSOLE_ROW_SIZE * rows);
-#else
-   u32 *ppix = lcd_console_address +
-   CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows;
-   u32 i;
-   for (i = 0;
-   i  (CONSOLE_ROW_SIZE * rows) / NBYTES(panel_info.vl_bpix);
-   i++) {
-   *ppix++ = lcd_getbgcolor();
-   }
-#endif
-   lcd_sync();
-   console_curr_row -= rows;
-}
-
-/*--*/
-
-static inline void console_back(void)
-{
-   if (--console_curr_col  0) {
-   console_curr_col = console_cols - 1;
-   if (--console_curr_row  0)
-   console_curr_row = 0;
-   }
-
-   lcd_putc_xy(console_curr_col * VIDEO_FONT_WIDTH,
-   console_curr_row * 

[U-Boot] [PATCH V2 00/12] cleanup and refactor lcd.c

2014-11-30 Thread Nikita Kiryanov
This series is a first step towards an end goal of merging all CONFIG_LCD
related functionality into CONFIG_VIDEO code. My plan is to start by refactoring
lcd.c into something cleaner (less ifdefs) and more modular (split code into
multiple files), then possibly refactor CONFIG_VIDEO code if needed, and then
finally: move CONFIG_LCD related functionality over to CONFIG_VIDEO code,
replacing as much CONFIG_LCD related code with CONFIG_VIDEO related code as
possible.

This specific step eliminates some unused code and refactors lcd console stuff
into its own file.

In V2 I broke the last patch of the original series (lcd: refactor lcd console
stuff into its own file) into multiple patches to make it clear what changes
had to be done in order to refactor the lcd console code into its own file.
These preparatory patches (lcd: rename console_(row|col) to
lcd: make lcd_drawchars() independant of lcd_base) are meant to illustrate
exactly what changed and where in the transition from lcd.c to lcd_console.c,
and are not necesserily code improvements when viewed out of context.

Additional changes in V2:
- Added documentation for the new functions.

The whole series was rebased over current mainline, and compile tested for arm
and powerpc.

Cc: Anatolij Gustschin ag...@denx.de
Cc: Wolfgang Denk w...@denx.de
Cc: Lukasz Majewski l.majew...@samsung.com
Cc: Marek Vasut marek.va...@gmail.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Josh Wu josh...@atmel.com
Cc: Alban Bedel alban.be...@avionic-design.de
Cc: Bo Shen voice.s...@atmel.com
Cc: Tom Warren twar...@nvidia.com
Cc: Alban Bedel alban.be...@avionic-design.de
Cc: Jens Scharsig e...@bus-elektronik.de
Cc: TsiChung Liew tsi-chung.l...@freescale.com
Cc: Przemyslaw Marczak p.marc...@samsung.com
Cc: Cliff Brake cliff.br...@gmail.com
Cc: Sergey Yanovich ynv...@gmail.com
Cc: Akshay Saraswat aksha...@samsung.com
Cc: Stephen Warren swar...@nvidia.com
Cc: Daniel Gorsulowski daniel.gorsulow...@esd.eu
Cc: Stelian Pop stel...@popies.net

Nikita Kiryanov (12):
  lcd: remove CONFIG_SYS_INVERT_COLORS
  lcd: cleanup lcd_drawchars
  mpc8xx_lcd: get rid of CONFIG_EDT32F10
  lcd: remove LCD_MONOCHROME
  lcd: rename console_(row|col)
  lcd: replace CONSOLE_(ROWS|COLS) with variables
  lcd: expand console api
  lcd: get rid of COLOR_MASK
  lcd: introduce getters for bg/fg color
  lcd: make lcd_drawchars() independant of lcd_base
  lcd: refactor lcd console stuff into its own file
  lcd_console: remove unused defines

 common/Makefile|   2 +-
 common/lcd.c   | 308 +
 common/lcd_console.c   | 208 ++
 drivers/video/mpc8xx_lcd.c |  49 +---
 drivers/video/pxa_lcd.c|  15 ---
 include/configs/R360MPI.h  |   1 -
 include/lcd.h  |  25 ++--
 include/lcd_console.h  |  85 +
 8 files changed, 340 insertions(+), 353 deletions(-)
 create mode 100644 common/lcd_console.c
 create mode 100644 include/lcd_console.h

-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V2 11/12] lcd: refactor lcd console stuff into its own file

2014-11-30 Thread Nikita Kiryanov
common/lcd.c is a mix of code portions that do different but related
things. To improve modularity, the various code portions should be split
into their own modules. Separate lcd console code into its own file.

Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
Cc: Anatolij Gustschin ag...@denx.de
Cc: Wolfgang Denk w...@denx.de
Cc: Lukasz Majewski l.majew...@samsung.com
Cc: Marek Vasut marek.va...@gmail.com
Cc: Stephen Warren swar...@wwwdotorg.org
Cc: Josh Wu josh...@atmel.com
Cc: Alban Bedel alban.be...@avionic-design.de
Cc: Bo Shen voice.s...@atmel.com
Cc: Tom Warren twar...@nvidia.com
Cc: Alban Bedel alban.be...@avionic-design.de
Cc: Jens Scharsig e...@bus-elektronik.de
Cc: TsiChung Liew tsi-chung.l...@freescale.com
Cc: Przemyslaw Marczak p.marc...@samsung.com
Cc: Cliff Brake cliff.br...@gmail.com
Cc: Sergey Yanovich ynv...@gmail.com
Cc: Akshay Saraswat aksha...@samsung.com
Cc: Stephen Warren swar...@nvidia.com
Cc: Daniel Gorsulowski daniel.gorsulow...@esd.eu
Cc: Stelian Pop stel...@popies.net
---
Changes in V2:
- New patch.

 common/Makefile   |   2 +-
 common/lcd.c  | 227 --
 common/lcd_console.c  | 212 ++
 include/lcd.h |   1 +
 include/lcd_console.h |  85 +++
 5 files changed, 299 insertions(+), 228 deletions(-)
 create mode 100644 common/lcd_console.c
 create mode 100644 include/lcd_console.h

diff --git a/common/Makefile b/common/Makefile
index 9c47e20..66584fc 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -206,7 +206,7 @@ obj-$(CONFIG_CMD_KGDB) += kgdb.o kgdb_stubs.o
 obj-$(CONFIG_I2C_EDID) += edid.o
 obj-$(CONFIG_KALLSYMS) += kallsyms.o
 obj-y += splash.o
-obj-$(CONFIG_LCD) += lcd.o
+obj-$(CONFIG_LCD) += lcd.o lcd_console.o
 obj-$(CONFIG_LYNXKDI) += lynxkdi.o
 obj-$(CONFIG_MENU) += menu.o
 obj-$(CONFIG_MODEM_SUPPORT) += modem.o
diff --git a/common/lcd.c b/common/lcd.c
index b55dd4c..2d0380d 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -73,22 +73,6 @@
 #define CONFIG_LCD_ALIGNMENT PAGE_SIZE
 #endif
 
-/* By default we scroll by a single line */
-#ifndef CONFIG_CONSOLE_SCROLL_LINES
-#define CONFIG_CONSOLE_SCROLL_LINES 1
-#endif
-
-//
-/* ** CONSOLE DEFINITIONS  FUNCTIONS  */
-//
-#define CONSOLE_ROW_SIZE   (VIDEO_FONT_HEIGHT * lcd_line_length)
-#define CONSOLE_ROW_FIRST  lcd_console_address
-#define CONSOLE_ROW_SECOND (lcd_console_address + CONSOLE_ROW_SIZE)
-#define CONSOLE_ROW_LAST   (lcd_console_address + CONSOLE_SIZE \
-   - CONSOLE_ROW_SIZE)
-#define CONSOLE_SIZE   (CONSOLE_ROW_SIZE * console_rows)
-#define CONSOLE_SCROLL_SIZE(CONSOLE_SIZE - CONSOLE_ROW_SIZE)
-
 #if (LCD_BPP != LCD_COLOR8)  (LCD_BPP != LCD_COLOR16)  \
(LCD_BPP != LCD_COLOR32)
 # error Unsupported LCD BPP.
@@ -96,9 +80,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static void lcd_drawchars(ushort x, ushort y, uchar *str, int count);
-static inline void lcd_putc_xy(ushort x, ushort y, uchar  c);
-
 static int lcd_init(void *lcdbase);
 
 static void *lcd_logo(void);
@@ -112,12 +93,6 @@ int lcd_line_length;
 
 char lcd_is_enabled = 0;
 
-static short console_curr_col;
-static short console_curr_row;
-static short console_cols;
-static short console_rows;
-
-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 */
@@ -153,82 +128,6 @@ void lcd_set_flush_dcache(int flush)
lcd_flush_dcache = (flush != 0);
 }
 
-void lcd_init_console(void *address, int rows, int cols)
-{
-   console_curr_col = 0;
-   console_curr_row = 0;
-   console_cols = cols;
-   console_rows = rows;
-   lcd_console_address = address;
-}
-
-void lcd_set_col(short col)
-{
-   console_curr_col = col;
-}
-
-void lcd_set_row(short row)
-{
-   console_curr_row = row;
-}
-
-/*--*/
-
-static void console_scrollup(void)
-{
-   const int rows = CONFIG_CONSOLE_SCROLL_LINES;
-
-   /* Copy up rows ignoring those that will be overwritten */
-   memcpy(CONSOLE_ROW_FIRST,
-  lcd_console_address + CONSOLE_ROW_SIZE * rows,
-  CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows);
-
-   /* Clear the last rows */
-#if (LCD_BPP != LCD_COLOR32)
-   memset(lcd_console_address + CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows,
-   lcd_getbgcolor(),
-   CONSOLE_ROW_SIZE * rows);
-#else
-   u32 *ppix = lcd_console_address +
-   CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows;
-   u32 i;
-   for (i = 0;
-   i  (CONSOLE_ROW_SIZE * rows) / NBYTES(panel_info.vl_bpix);
-   i++) {
-   

Re: [U-Boot] [PATCH 1/2 v2] Exynos5800: The Peach-Pi board does not have a Parade video bridge

2014-11-30 Thread Simon Glass
On 27 November 2014 at 08:08, Sjoerd Simons
sjoerd.sim...@collabora.co.uk wrote:
 Unlike the Peach-Pit board, there is no parade edp to lvds bridge on the
 Pi. So drop it from  device-tree

 Signed-off-by: Sjoerd Simons sjoerd.sim...@collabora.co.uk
 ---
  Changes since v1: Only modify the DTB

  arch/arm/dts/exynos5800-peach-pi.dts | 5 -
  1 file changed, 5 deletions(-)

Acked-by: Simon Glass s...@chromium.org

Tested on snow, pit, pi (display does not yet work on Pi).

Tested-by: Simon Glass s...@chromium.org


 diff --git a/arch/arm/dts/exynos5800-peach-pi.dts 
 b/arch/arm/dts/exynos5800-peach-pi.dts
 index 8aedf8e..2f9d2db 100644
 --- a/arch/arm/dts/exynos5800-peach-pi.dts
 +++ b/arch/arm/dts/exynos5800-peach-pi.dts
 @@ -63,11 +63,6 @@
   reg = 0x20;
   compatible = maxim,max98090-codec;
};
 -
 -   edp-lvds-bridge@48 {
 -   compatible = parade,ps8625;
 -   reg = 0x48;
 -   };
 };

  sound@383 {
 --
 2.1.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2 v2] exynos5420: fix compilation without parade video

2014-11-30 Thread Simon Glass
On 27 November 2014 at 08:08, Sjoerd Simons
sjoerd.sim...@collabora.co.uk wrote:
 Not all exynos 5420 based devices with an LCD also have a parade LVDS
 bridge. So make sure compilation doesn't break if CONFIG_LCD is enabled
 and CONFIG_VIDEO_PARADE is not.

 Signed-off-by: Sjoerd Simons sjoerd.sim...@collabora.co.uk
 ---
  Changes since V1: New patch

  arch/arm/include/asm/arch-exynos/system.h | 4 
  1 file changed, 4 insertions(+)

Acked-by: Simon Glass s...@chromium.org

Tested on snow, pit, pi (display does not yet work on Pi):

Tested-by: Simon Glass s...@chromium.org
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] cros-ec-keyboard: Synchronize DT binding from linux

2014-11-30 Thread Simon Glass
On 27 November 2014 at 08:34, Sjoerd Simons
sjoerd.sim...@collabora.co.uk wrote:
 The ChromeOS EC keyboard is used by various different chromebooks. Peach
 pi being the third board in the u-boot tree to use it (snow and peach
 pit the other two). Rather then embedding the same big DT node in the
 peach-pi DT again, copy the dtsi snippit  bindings documentation from
 linux and include it in all 3 boards.

 This slightly changes the dt bindings in u-boot:
   * google,key-rows becomes keypad,num-rows
   * google,key-colums becomes keypad,num-colums
   * google,repeat-delay-ms and google,repeat-rate-ms are no longer used
 and replaced by hardcoded values (similar to tegra kbc)

 Signed-off-by: Sjoerd Simons sjoerd.sim...@collabora.co.uk
 ---
  arch/arm/dts/cros-ec-keyboard.dtsi  | 105 
 
  arch/arm/dts/exynos5250-snow.dts|  59 +
  arch/arm/dts/exynos5420-peach-pit.dts   |  59 +
  arch/arm/dts/exynos5800-peach-pi.dts|   4 +-
  doc/device-tree-bindings/input/cros-ec-keyb.txt |  53 ++--
  drivers/input/cros_ec_keyb.c|  16 ++--
  6 files changed, 143 insertions(+), 153 deletions(-)
  create mode 100644 arch/arm/dts/cros-ec-keyboard.dtsi

Thanks for doing this.

Acked-by: Simon Glass s...@chromium.org

Tested Chrome OS EC and keyboard on snow, pit, pi.

Tested-by: Simon Glass s...@chromium.org
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2 05/12] lcd: rename console_(row|col)

2014-11-30 Thread Simon Glass
On 30 November 2014 at 05:29, Nikita Kiryanov nik...@compulab.co.il wrote:
 Rename console_(row|col) to console_curr_(row|col) to make their meaning 
 clearer
 and distinguish them from CONSOLE_(COLS|ROWS).

 This is a preparatory step for extracting lcd console code into its own file.

 Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
 Cc: Simon Glass s...@chromium.org
 Cc: Anatolij Gustschin ag...@denx.de
 ---
 Changes in V2:
 - New patch.

Acked-by: Simon Glass s...@chromium.org

Tested on pit, LCD works fine.

Tested-by: Simon Glass s...@chromium.org
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2 07/12] lcd: expand console api

2014-11-30 Thread Simon Glass
On 30 November 2014 at 05:29, Nikita Kiryanov nik...@compulab.co.il wrote:
 Introduce set_console_row(), set_console_col(), and lcd_init_console().
 Use these functions in lcd functions: lcd_init(), lcd_clear(), lcd_logo().

 This is a preparatory step for extracting lcd console code into its own
 file.

 Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
 Cc: Anatolij Gustschin ag...@denx.de
 Cc: Simon Glass s...@chromium.org
 ---
 Changes in V2:
 - New patch.

Acked-by: Simon Glass s...@chromium.org

Tested on pit, LCD works fine.

Tested-by: Simon Glass s...@chromium.org
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2 08/12] lcd: get rid of COLOR_MASK

2014-11-30 Thread Simon Glass
On 30 November 2014 at 05:29, Nikita Kiryanov nik...@compulab.co.il wrote:
 COLOR_MASK macro doesn't do anything; Remove it to reduce visual
 complexity.

 This is a preparatory step for extracting lcd console code into its own
 file.

 Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
 Cc: Anatolij Gustschin ag...@denx.de
 Cc: Simon Glass s...@chromium.org
 ---
 Changes in V2:
 - New patch.

Acked-by: Simon Glass s...@chromium.org

Tested on pit, LCD works fine.

Tested-by: Simon Glass s...@chromium.org
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2 09/12] lcd: introduce getters for bg/fg color

2014-11-30 Thread Simon Glass
Hi Nikita,

On 30 November 2014 at 05:29, Nikita Kiryanov nik...@compulab.co.il wrote:
 Introduce lcd_getbgcolor() and lcd_getfgcolor(), and use them where
 applicable.

 This is a preparatory step for extracting lcd console code into its own
 file.

 Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
 c: Anatolij Gustschin ag...@denx.de
 Cc: Simon Glass s...@chromium.org
 ---
 Changes in V2:
 - New patch.

  common/lcd.c  | 20 +++-
  include/lcd.h | 14 ++
  2 files changed, 29 insertions(+), 5 deletions(-)

 diff --git a/common/lcd.c b/common/lcd.c
 index f98aaaf..a75c616 100644
 --- a/common/lcd.c
 +++ b/common/lcd.c
 @@ -186,7 +186,7 @@ static void console_scrollup(void)
 /* Clear the last rows */
  #if (LCD_BPP != LCD_COLOR32)
 memset(lcd_console_address + CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows,
 -   lcd_color_bg,
 +   lcd_getbgcolor(),
 CONSOLE_ROW_SIZE * rows);
  #else
 u32 *ppix = lcd_console_address +
 @@ -195,7 +195,7 @@ static void console_scrollup(void)
 for (i = 0;
 i  (CONSOLE_ROW_SIZE * rows) / NBYTES(panel_info.vl_bpix);
 i++) {
 -   *ppix++ = lcd_color_bg;
 +   *ppix++ = lcd_getbgcolor();
 }
  #endif
 lcd_sync();
 @@ -342,7 +342,7 @@ static void lcd_drawchars(ushort x, ushort y, uchar *str, 
 int count)

 for (c = 0; c  8; ++c) {
 *d++ = (bits  0x80) ?
 -   lcd_color_fg : lcd_color_bg;
 +   lcd_getfgcolor() : lcd_getbgcolor();

Won't this slow things down slightly? Should you cache the values at the top?

 bits = 1;
 }
 }
 @@ -460,7 +460,7 @@ void lcd_clear(void)
 /* set framebuffer to background color */
  #if (LCD_BPP != LCD_COLOR32)
 memset((char *)lcd_base,
 -   lcd_color_bg,
 +   lcd_getbgcolor(),
 lcd_line_length * panel_info.vl_row);
  #else
 u32 *ppix = lcd_base;
 @@ -468,7 +468,7 @@ void lcd_clear(void)
 for (i = 0;
i  (lcd_line_length * 
 panel_info.vl_row)/NBYTES(panel_info.vl_bpix);
i++) {
 -   *ppix++ = lcd_color_bg;
 +   *ppix++ = lcd_getbgcolor();
 }
  #endif
  #endif
 @@ -575,6 +575,11 @@ static void lcd_setfgcolor(int color)
 lcd_color_fg = color;
  }

 +int lcd_getfgcolor(void)
 +{
 +   return lcd_color_fg;
 +}
 +
  /*--*/

  static void lcd_setbgcolor(int color)
 @@ -582,6 +587,11 @@ static void lcd_setbgcolor(int color)
 lcd_color_bg = color;
  }

 +int lcd_getbgcolor(void)
 +{
 +   return lcd_color_bg;
 +}
 +
  //
  /* ** Chipset depending Bitmap / Logo stuff...  */
  //
 diff --git a/include/lcd.h b/include/lcd.h
 index 01609ac..2235b9b 100644
 --- a/include/lcd.h
 +++ b/include/lcd.h
 @@ -291,6 +291,20 @@ int lcd_get_screen_rows(void);
  int lcd_get_screen_columns(void);

  /**
 + * Get the background color of the LCD
 + *
 + * @return background color value

This is just the raw value of the pixel in the display I think.

 + */
 +int lcd_getbgcolor(void);
 +
 +/**
 + * Get the foreground color of the LCD
 + *
 + * @return foreground color value
 + */
 +int lcd_getfgcolor(void);
 +
 +/**
   * Set the position of the text cursor
   *
   * @param col  Column to place cursor (0 = left side)
 --
 1.9.1


Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2 11/12] lcd: refactor lcd console stuff into its own file

2014-11-30 Thread Simon Glass
Hi Nikita,

On 30 November 2014 at 06:22, Nikita Kiryanov nik...@compulab.co.il wrote:
 common/lcd.c is a mix of code portions that do different but related
 things. To improve modularity, the various code portions should be split
 into their own modules. Separate lcd console code into its own file.

 Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
 Cc: Anatolij Gustschin ag...@denx.de
 Cc: Wolfgang Denk w...@denx.de
 Cc: Simon Glass s...@chromium.org
 ---
 NOTE: I'm resending this cover letter with a shorter Cc list because the
 original mail got held up. Sorry for the double post.

One nit below, but otherwise:

Acked-by: Simon Glass s...@chromium.org

Tested on pit, LCD works fine.

Tested-by: Simon Glass s...@chromium.org


 Changes in V2:
 - New patch.

  common/Makefile   |   2 +-
  common/lcd.c  | 227 
 --
  common/lcd_console.c  | 212 ++
  include/lcd.h |   1 +
  include/lcd_console.h |  85 +++
  5 files changed, 299 insertions(+), 228 deletions(-)
  create mode 100644 common/lcd_console.c
  create mode 100644 include/lcd_console.h

 diff --git a/common/Makefile b/common/Makefile
 index 9c47e20..66584fc 100644
 --- a/common/Makefile
 +++ b/common/Makefile
 @@ -206,7 +206,7 @@ obj-$(CONFIG_CMD_KGDB) += kgdb.o kgdb_stubs.o
  obj-$(CONFIG_I2C_EDID) += edid.o
  obj-$(CONFIG_KALLSYMS) += kallsyms.o
  obj-y += splash.o
 -obj-$(CONFIG_LCD) += lcd.o
 +obj-$(CONFIG_LCD) += lcd.o lcd_console.o
  obj-$(CONFIG_LYNXKDI) += lynxkdi.o
  obj-$(CONFIG_MENU) += menu.o
  obj-$(CONFIG_MODEM_SUPPORT) += modem.o
 diff --git a/common/lcd.c b/common/lcd.c
 index b55dd4c..2d0380d 100644
 --- a/common/lcd.c
 +++ b/common/lcd.c
 @@ -73,22 +73,6 @@
  #define CONFIG_LCD_ALIGNMENT PAGE_SIZE
  #endif

 -/* By default we scroll by a single line */
 -#ifndef CONFIG_CONSOLE_SCROLL_LINES
 -#define CONFIG_CONSOLE_SCROLL_LINES 1
 -#endif
 -
 -//
 -/* ** CONSOLE DEFINITIONS  FUNCTIONS  */
 -//
 -#define CONSOLE_ROW_SIZE   (VIDEO_FONT_HEIGHT * lcd_line_length)
 -#define CONSOLE_ROW_FIRST  lcd_console_address
 -#define CONSOLE_ROW_SECOND (lcd_console_address + CONSOLE_ROW_SIZE)
 -#define CONSOLE_ROW_LAST   (lcd_console_address + CONSOLE_SIZE \
 -   - CONSOLE_ROW_SIZE)
 -#define CONSOLE_SIZE   (CONSOLE_ROW_SIZE * console_rows)
 -#define CONSOLE_SCROLL_SIZE(CONSOLE_SIZE - CONSOLE_ROW_SIZE)
 -
  #if (LCD_BPP != LCD_COLOR8)  (LCD_BPP != LCD_COLOR16)  \
 (LCD_BPP != LCD_COLOR32)
  # error Unsupported LCD BPP.
 @@ -96,9 +80,6 @@

  DECLARE_GLOBAL_DATA_PTR;

 -static void lcd_drawchars(ushort x, ushort y, uchar *str, int count);
 -static inline void lcd_putc_xy(ushort x, ushort y, uchar  c);
 -
  static int lcd_init(void *lcdbase);

  static void *lcd_logo(void);
 @@ -112,12 +93,6 @@ int lcd_line_length;

  char lcd_is_enabled = 0;

 -static short console_curr_col;
 -static short console_curr_row;
 -static short console_cols;
 -static short console_rows;
 -
 -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 */
 @@ -153,82 +128,6 @@ void lcd_set_flush_dcache(int flush)
 lcd_flush_dcache = (flush != 0);
  }

 -void lcd_init_console(void *address, int rows, int cols)
 -{
 -   console_curr_col = 0;
 -   console_curr_row = 0;
 -   console_cols = cols;
 -   console_rows = rows;
 -   lcd_console_address = address;
 -}
 -
 -void lcd_set_col(short col)
 -{
 -   console_curr_col = col;
 -}
 -
 -void lcd_set_row(short row)
 -{
 -   console_curr_row = row;
 -}
 -
 -/*--*/
 -
 -static void console_scrollup(void)
 -{
 -   const int rows = CONFIG_CONSOLE_SCROLL_LINES;
 -
 -   /* Copy up rows ignoring those that will be overwritten */
 -   memcpy(CONSOLE_ROW_FIRST,
 -  lcd_console_address + CONSOLE_ROW_SIZE * rows,
 -  CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows);
 -
 -   /* Clear the last rows */
 -#if (LCD_BPP != LCD_COLOR32)
 -   memset(lcd_console_address + CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows,
 -   lcd_getbgcolor(),
 -   CONSOLE_ROW_SIZE * rows);
 -#else
 -   u32 *ppix = lcd_console_address +
 -   CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows;
 -   u32 i;
 -   for (i = 0;
 -   i  (CONSOLE_ROW_SIZE * rows) / NBYTES(panel_info.vl_bpix);
 -   i++) {
 -   *ppix++ = lcd_getbgcolor();
 -   }
 -#endif
 -   lcd_sync();
 -   console_curr_row -= rows;
 -}
 -
 

Re: [U-Boot] [PATCH V2 12/12] lcd_console: remove unused defines

2014-11-30 Thread Simon Glass
On 30 November 2014 at 05:29, Nikita Kiryanov nik...@compulab.co.il wrote:
 CONSOLE_ROW_SECOND, CONSOLE_ROW_LAST, and
 CONSOLE_SCROLL_SIZE are unused. Remove them.

 Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
 Cc: Anatolij Gustschin ag...@denx.de
 Cc: Simon Glass s...@chromium.org
 ---
 Changes in V2:
 - New patch.

Acked-by: Simon Glass s...@chromium.org

Tested on pit, LCD works fine.

Tested-by: Simon Glass s...@chromium.org
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] arm: build arch memset/memcpy in Thumb2 mode

2014-11-30 Thread Simon Glass
Hi Stefan,

On 21 November 2014 at 08:34, Stefan Agner ste...@agner.ch wrote:
 Resynchronize memcpy/memset with kernel and build them explicitly
 in Thumb2 mode (unified syntax). Those assembler files can be
 built and linked in ARM mode too, however when calling them from
 Thumb2 built code, the stack got corrupted and the copy did not
 succeed (the exact details have not been traced back). Hoever,
 the Linux kernel builds those files in Thumb2 mode. Hence U-Boot
 should build them in Thumb2 mode too when CONFIG_SYS_THUMB_BUILD
 is set.

 To build the files without warning, some assembler instructions
 had to be replaced with their UAL compliant variant (thanks
 Jeroen for this input).

 To build the file in Thumb2 mode the implicit-it=always option need
 to be set to generate Thumb2 compliant IT instructions where needed.
 We add this option to the general AFLAGS when building for Thumb2.

 Signed-off-by: Stefan Agner ste...@agner.ch
 ---
 Changes since v1:
 - Don't set auto-it in AFLAGS
 - Removed no-warn-deprecated warning suppression
 - Converted non-UAL assembler instructions to their UAL compliant variants

Reviewed-by: Simon Glass s...@chromium.org

Tested on pit and found that it fixed the problem with Thumb mode.
Still works fine in ARM mode.

Tested-by: Simon Glass s...@chromium.org

A few nits:
- typo 'Hoever' in commit message
- you could mention the Linux commit/release you synced to


 Tested in ARM and Thumb2 mode on Vybrid SoC. Disassembled the memset/
 memcpy object files before and after converting the instructions to UAL,
 the output was identical.

  arch/arm/config.mk   |   4 +-
  arch/arm/include/asm/assembler.h |  33 ++--
  arch/arm/lib/memcpy.S|  80 +++-
  arch/arm/lib/memset.S| 112 
 ---
  4 files changed, 142 insertions(+), 87 deletions(-)


Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] arm: build arch memset/memcpy in Thumb2 mode

2014-11-30 Thread Stefan Agner
On 2014-11-30 20:33, Simon Glass wrote:
 Hi Stefan,
 
 On 21 November 2014 at 08:34, Stefan Agner ste...@agner.ch wrote:
 Resynchronize memcpy/memset with kernel and build them explicitly
 in Thumb2 mode (unified syntax). Those assembler files can be
 built and linked in ARM mode too, however when calling them from
 Thumb2 built code, the stack got corrupted and the copy did not
 succeed (the exact details have not been traced back). Hoever,
 the Linux kernel builds those files in Thumb2 mode. Hence U-Boot
 should build them in Thumb2 mode too when CONFIG_SYS_THUMB_BUILD
 is set.

 To build the files without warning, some assembler instructions
 had to be replaced with their UAL compliant variant (thanks
 Jeroen for this input).

 To build the file in Thumb2 mode the implicit-it=always option need
 to be set to generate Thumb2 compliant IT instructions where needed.
 We add this option to the general AFLAGS when building for Thumb2.

 Signed-off-by: Stefan Agner ste...@agner.ch
 ---
 Changes since v1:
 - Don't set auto-it in AFLAGS
 - Removed no-warn-deprecated warning suppression
 - Converted non-UAL assembler instructions to their UAL compliant variants
 
 Reviewed-by: Simon Glass s...@chromium.org
 
 Tested on pit and found that it fixed the problem with Thumb mode.
 Still works fine in ARM mode.
 
 Tested-by: Simon Glass s...@chromium.org
 
 A few nits:
 - typo 'Hoever' in commit message
 - you could mention the Linux commit/release you synced to
 

Thanks for testing Simon.

The Linux commit/release I synced to was some 3.18-rcX. However, the
relevant files did not change since 3.17, so we can add that as the
synced version.

--
Stefan


 Tested in ARM and Thumb2 mode on Vybrid SoC. Disassembled the memset/
 memcpy object files before and after converting the instructions to UAL,
 the output was identical.

  arch/arm/config.mk   |   4 +-
  arch/arm/include/asm/assembler.h |  33 ++--
  arch/arm/lib/memcpy.S|  80 +++-
  arch/arm/lib/memset.S| 112 
 ---
  4 files changed, 142 insertions(+), 87 deletions(-)

 
 Regards,
 Simon

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] Export redesign

2014-11-30 Thread Simon Glass
Hi Martin,

On 27 November 2014 at 01:42, Martin Dorwig dor...@tetronik.com wrote:
 this is an atempt to make the export of functions typesafe.
 I replaced the jumptable void ** by a struct (jt_funcs) with function 
 pointers.
 The EXPORT_FUNC macro now has 3 fixed parameters and one
 variadic parameter
 The first is the name of the exported function,
 the rest of the parameters are used to format a functionpointer

function pointer

 in the jumptable,

 the EXPORT_FUNC macros are expanded three times,
 1. to declare the members of the struct
 2. to initialize the structmember pointers
 3. to call the functions in stubs.c

 Signed-off-by: Martin Dorwig dor...@tetronik.com

Good to get rid of the XF macros.

I tested this on x86 and it still works fine.

Tested-by: Simon Glass s...@chromium.org

I have a few minor things comments below too. Please make sure to
rebase to latest mainline before sending as I think there are a few
changes in common/console.c.

 ---

 Changes in v2:
 - redesign the way functions are exported to standalone applications

  arch/blackfin/cpu/cpu.c   |  2 +-
  board/BuS/eb_cpux9k2/cpux9k2.c|  2 +-
  common/cmd_load.c |  2 +-
  common/console.c  | 20 -
  common/exports.c  | 26 ++-
  doc/README.standalone | 41 -
  examples/standalone/stubs.c   | 64 ++-
  include/_exports.h| 93 
 +++
  include/asm-generic/global_data.h |  2 +-
  include/exports.h | 15 +++
  10 files changed, 151 insertions(+), 116 deletions(-)

 diff --git a/arch/blackfin/cpu/cpu.c b/arch/blackfin/cpu/cpu.c
 index b7f1188..59c470f 100644
 --- a/arch/blackfin/cpu/cpu.c
 +++ b/arch/blackfin/cpu/cpu.c
 @@ -121,7 +121,7 @@ static void display_global_data(void)
 printf( |-ram_size: %lx\n, gd-ram_size);
 printf( |-env_addr: %lx\n, gd-env_addr);
 printf( |-env_valid: %lx\n, gd-env_valid);
 -   printf( |-jt(%p): %p\n, gd-jt, *(gd-jt));
 +   printf( |-jt(%p): %p\n, gd-jt, gd-jt-get_version);
 printf( \\-bd: %p\n, gd-bd);
 printf(   |-bi_boot_params: %lx\n, bd-bi_boot_params);
 printf(   |-bi_memstart: %lx\n, bd-bi_memstart);
 diff --git a/board/BuS/eb_cpux9k2/cpux9k2.c b/board/BuS/eb_cpux9k2/cpux9k2.c
 index 5e4778e..76ad7c4 100644
 --- a/board/BuS/eb_cpux9k2/cpux9k2.c
 +++ b/board/BuS/eb_cpux9k2/cpux9k2.c
 @@ -98,7 +98,7 @@ int misc_init_r(void)
 puts(Error: invalid MAC at EEPROM\n);
 }
 }
 -   gd-jt[XF_do_reset] = (void *) do_reset;
 +   gd-jt-do_reset = do_reset;

  #ifdef CONFIG_STATUS_LED
 status_led_set(STATUS_LED_BOOT, STATUS_LED_BLINKING);
 diff --git a/common/cmd_load.c b/common/cmd_load.c
 index f6e522c..d043e6d 100644
 --- a/common/cmd_load.c
 +++ b/common/cmd_load.c
 @@ -222,7 +222,7 @@ static int read_record(char *buf, ulong len)
 }

 /* Check for the console hangup (if any different from serial) */
 -   if (gd-jt[XF_getc] != getc) {
 +   if (gd-jt-getc != getc) {
 if (ctrlc()) {
 return (-1);
 }
 diff --git a/common/console.c b/common/console.c
 index 5a2f411..08cf188 100644
 --- a/common/console.c
 +++ b/common/console.c
 @@ -124,13 +124,13 @@ static int console_setfile(int file, struct stdio_dev * 
 dev)
  */
 switch (file) {
 case stdin:
 -   gd-jt[XF_getc] = dev-getc;
 -   gd-jt[XF_tstc] = dev-tstc;
 +   gd-jt-getc = getc;
 +   gd-jt-tstc = tstc;
 break;
 case stdout:
 -   gd-jt[XF_putc] = dev-putc;
 -   gd-jt[XF_puts] = dev-puts;
 -   gd-jt[XF_printf] = printf;
 +   gd-jt-putc  = putc;
 +   gd-jt-puts  = puts;
 +   gd-jt-printf = printf;
 break;
 }
 break;
 @@ -722,11 +722,11 @@ int console_init_r(void)
  #endif

 /* set default handlers at first */
 -   gd-jt[XF_getc] = serial_getc;
 -   gd-jt[XF_tstc] = serial_tstc;
 -   gd-jt[XF_putc] = serial_putc;
 -   gd-jt[XF_puts] = serial_puts;
 -   gd-jt[XF_printf] = serial_printf;
 +   gd-jt-getc  = serial_getc;
 +   gd-jt-tstc  = serial_tstc;
 +   gd-jt-putc  = serial_putc;
 +   gd-jt-puts  = serial_puts;
 +   gd-jt-printf = serial_printf;

 /* stdin stdout and stderr are in environment */
 /* scan for it */
 diff --git a/common/exports.c b/common/exports.c
 index b97ca48..333107c 100644
 --- a/common/exports.c
 +++ b/common/exports.c
 @@ -1,6 +1,7 @@
  #include common.h
  #include exports.h
  #include spi.h
 +#include i2c.h

  

Re: [U-Boot] [PATCH 2/2 v2] exynos5420: fix compilation without parade video

2014-11-30 Thread Minkyu Kang
Dear Sjoerd Simons,

On 28/11/14 00:08, Sjoerd Simons wrote:
 Not all exynos 5420 based devices with an LCD also have a parade LVDS
 bridge. So make sure compilation doesn't break if CONFIG_LCD is enabled
 and CONFIG_VIDEO_PARADE is not.
 
 Signed-off-by: Sjoerd Simons sjoerd.sim...@collabora.co.uk
 ---
  Changes since V1: New patch
 
  arch/arm/include/asm/arch-exynos/system.h | 4 
  1 file changed, 4 insertions(+)
 
 diff --git a/arch/arm/include/asm/arch-exynos/system.h 
 b/arch/arm/include/asm/arch-exynos/system.h
 index 320763f..dd68290 100644
 --- a/arch/arm/include/asm/arch-exynos/system.h
 +++ b/arch/arm/include/asm/arch-exynos/system.h
 @@ -42,6 +42,10 @@ void set_system_display_ctrl(void);
  int exynos_lcd_early_init(const void *blob);
  
  /* Initialize the Parade dP-LVDS bridge if present */
 +#ifdef CONFIG_VIDEO_PARADE
  int parade_init(const void *blob);
 +#else
 +static inline int parade_init(const void *blob) { return -1; }
 +#endif

Actually, it does not related with this patch..
and I know that you are not an author.
But.. I'd like ask you, why parade_init function is in exynos header file?
If you are agreed, could you please make new header file? (e.g: 
include/parade.h)

And I think you missed removing the CONFIG_VIDEO_PARADE at peach-pi.h

Thanks,
Minkyu Kang.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 3/7] arm: rmobile: Add mstp_setclrbits and mstp_setclrbits_le32

2014-11-30 Thread Nobuhiro Iwamatsu
This addes macro for set and clear bit control for module control register.
This is used when user want to disable the function of the devices
corresponding to register.

Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com
---
 arch/arm/include/asm/arch-rmobile/rcar-mstp.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/include/asm/arch-rmobile/rcar-mstp.h 
b/arch/arm/include/asm/arch-rmobile/rcar-mstp.h
index bf9a2cf..f94e92c 100644
--- a/arch/arm/include/asm/arch-rmobile/rcar-mstp.h
+++ b/arch/arm/include/asm/arch-rmobile/rcar-mstp.h
@@ -14,9 +14,13 @@
out_##type((saddr), in_##type(addr) | (set))
 #define mstp_clrbits(type, addr, saddr, clear) \
out_##type((saddr), in_##type(addr)  ~(clear))
+#define mstp_setclrbits(type, addr, saddr, set, clear) \
+   out_##type((saddr), (in_##type(addr) | (set))  ~(clear))
 #define mstp_setbits_le32(addr, saddr, set) \
mstp_setbits(le32, addr, saddr, set)
 #define mstp_clrbits_le32(addr, saddr, clear) \
mstp_clrbits(le32, addr, saddr, clear)
+#define mstp_setclrbits_le32(addr, saddr, set, clear) \
+   mstp_setclrbits(le32, addr, saddr, set, clear)
 
 #endif /* __ASM_ARCH_RCAR_MSTP_H */
-- 
2.1.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 4/7] arm: rmobile: lager: Halt clock prior to booting kernel

2014-11-30 Thread Nobuhiro Iwamatsu
Before a kernel boots, GPIO, SYS-DMAC, QSPI and MSIOF clock
is halted.

Signed-off-by: Hisashi Nakamura hisashi.nakamura...@renesas.com
Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com
---
 board/renesas/lager/lager.c | 43 +--
 1 file changed, 41 insertions(+), 2 deletions(-)

diff --git a/board/renesas/lager/lager.c b/board/renesas/lager/lager.c
index 47cf51b..077a78f 100644
--- a/board/renesas/lager/lager.c
+++ b/board/renesas/lager/lager.c
@@ -67,10 +67,49 @@ int board_early_init_f(void)
return 0;
 }
 
+static struct mstp_ctl {
+   u32 s_addr;
+   u32 s_dis;
+   u32 s_ena;
+   u32 r_addr;
+   u32 r_dis;
+   u32 r_ena;
+} mstptbl[] = {
+   [0] = { SMSTPCR0,  0x00640801, 0x0041,
+   RMSTPCR0,  0x00640801, 0x },
+   [1] = { SMSTPCR1,  0xDB6E9BDF, 0x,
+   RMSTPCR1,  0xDB6E9BDF, 0x },
+   [2] = { SMSTPCR2,  0x300DA1FC, 0x000CA120,
+   RMSTPCR2,  0x300DA1FC, 0x },
+   [3] = { SMSTPCR3,  0xF08CF831, 0x,
+   RMSTPCR3,  0xF08CF831, 0x },
+   [4] = { SMSTPCR4,  0x8184, 0x0180,
+   RMSTPCR4,  0x8184, 0x },
+   [5] = { SMSTPCR5,  0x44C00046, 0x,
+   RMSTPCR5,  0x44C00046, 0x },
+   [7] = { SMSTPCR7,  0x07F30718, 0x0020,
+   RMSTPCR7,  0x07F30718, 0x },
+   [8] = { SMSTPCR8,  0x01F0FF84, 0x,
+   RMSTPCR8,  0x01F0FF84, 0x },
+   [9] = { SMSTPCR9,  0xF5979FCF, 0x00021F80,
+   RMSTPCR9,  0xF5979FCF, 0x1F80 },
+   [10] = { SMSTPCR10, 0xFFFEFFE0, 0x,
+RMSTPCR10, 0xFFFEFFE0, 0x },
+   [11] = { SMSTPCR11, 0x, 0x,
+RMSTPCR11, 0x, 0x },
+};
+
 void arch_preboot_os(void)
 {
-   /* Disable TMU0 */
-   mstp_setbits_le32(MSTPSR1, SMSTPCR1, TMU0_MSTP125);
+   int i;
+
+   /* Stop all module clock */
+   for (i = 0; i  ARRAY_SIZE(mstptbl); i++) {
+   mstp_setclrbits_le32(mstptbl[i].s_addr, mstptbl[i].s_addr,
+mstptbl[i].s_dis, mstptbl[i].s_ena);
+   mstp_setclrbits_le32(mstptbl[i].r_addr, mstptbl[i].r_addr,
+mstptbl[i].r_dis, mstptbl[i].r_ena);
+   }
 }
 
 DECLARE_GLOBAL_DATA_PTR;
-- 
2.1.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/7] arm: rmobile: Move module control register to header file of SoC

2014-11-30 Thread Nobuhiro Iwamatsu
Module control registers of R-Car ARM SoC (r8a7790, r8a7791, r8a7793 and
r8a7794) are same address. This moves these to header file of SoC.

Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com
---
 arch/arm/include/asm/arch-rmobile/rcar-base.h | 39 +++
 board/renesas/alt/alt.c   | 11 
 board/renesas/gose/gose.c |  8 --
 board/renesas/koelsch/koelsch.c   |  8 --
 board/renesas/lager/lager.c   |  8 --
 5 files changed, 39 insertions(+), 35 deletions(-)

diff --git a/arch/arm/include/asm/arch-rmobile/rcar-base.h 
b/arch/arm/include/asm/arch-rmobile/rcar-base.h
index dbbebcf..23c4bba 100644
--- a/arch/arm/include/asm/arch-rmobile/rcar-base.h
+++ b/arch/arm/include/asm/arch-rmobile/rcar-base.h
@@ -29,6 +29,45 @@
 #define SCIF4_BASE 0xE6EE
 #define SCIF5_BASE 0xE6EE8000
 
+/* Module stop status register */
+#define MSTPSR00xE6150030
+#define MSTPSR10xE6150038
+#define MSTPSR20xE6150040
+#define MSTPSR30xE6150048
+#define MSTPSR40xE615004C
+#define MSTPSR50xE615003C
+#define MSTPSR70xE61501C4
+#define MSTPSR80xE61509A0
+#define MSTPSR90xE61509A4
+#define MSTPSR10   0xE61509A8
+#define MSTPSR11   0xE61509AC
+
+/* Realtime module stop control register */
+#define RMSTPCR0   0xE6150110
+#define RMSTPCR1   0xE6150114
+#define RMSTPCR2   0xE6150118
+#define RMSTPCR3   0xE615011C
+#define RMSTPCR4   0xE6150120
+#define RMSTPCR5   0xE6150124
+#define RMSTPCR7   0xE615012C
+#define RMSTPCR8   0xE6150980
+#define RMSTPCR9   0xE6150984
+#define RMSTPCR10  0xE6150988
+#define RMSTPCR11  0xE615098C
+
+/* System module stop control register */
+#define SMSTPCR0   0xE6150130
+#define SMSTPCR1   0xE6150134
+#define SMSTPCR2   0xE6150138
+#define SMSTPCR3   0xE615013C
+#define SMSTPCR4   0xE6150140
+#define SMSTPCR5   0xE6150144
+#define SMSTPCR7   0xE615014C
+#define SMSTPCR8   0xE6150990
+#define SMSTPCR9   0xE6150994
+#define SMSTPCR10  0xE6150998
+#define SMSTPCR11  0xE615099C
+
 /*
  * SH-I2C
  * Ch2 and ch3 are different address. These are defined
diff --git a/board/renesas/alt/alt.c b/board/renesas/alt/alt.c
index 523c5f1..bf90f2e 100644
--- a/board/renesas/alt/alt.c
+++ b/board/renesas/alt/alt.c
@@ -37,20 +37,9 @@ void s_init(void)
qos_init();
 }
 
-#define MSTPSR10xE6150038
-#define SMSTPCR1   0xE6150134
 #define TMU0_MSTP125   (1  25)
-
-#define MSTPSR70xE61501C4
-#define SMSTPCR7   0xE615014C
 #define SCIF2_MSTP719  (1  19)
-
-#define MSTPSR80xE61509A0
-#define SMSTPCR8   0xE6150990
 #define ETHER_MSTP813  (1  13)
-
-#define MSTPSR30xE6150048
-#define SMSTPCR3   0xE615013C
 #define IIC1_MSTP323   (1  23)
 
 #define mstp_setbits(type, addr, saddr, set) \
diff --git a/board/renesas/gose/gose.c b/board/renesas/gose/gose.c
index 715fba0..bb6849e 100644
--- a/board/renesas/gose/gose.c
+++ b/board/renesas/gose/gose.c
@@ -41,16 +41,8 @@ void s_init(void)
qos_init();
 }
 
-#define MSTPSR10xE6150038
-#define SMSTPCR1   0xE6150134
 #define TMU0_MSTP125   (1  25)
-
-#define MSTPSR70xE61501C4
-#define SMSTPCR7   0xE615014C
 #define SCIF0_MSTP721  (1  21)
-
-#define MSTPSR80xE61509A0
-#define SMSTPCR8   0xE6150990
 #define ETHER_MSTP813  (1  13)
 
 #define mstp_setbits(type, addr, saddr, set) \
diff --git a/board/renesas/koelsch/koelsch.c b/board/renesas/koelsch/koelsch.c
index 244bc58..14d1770 100644
--- a/board/renesas/koelsch/koelsch.c
+++ b/board/renesas/koelsch/koelsch.c
@@ -43,16 +43,8 @@ void s_init(void)
qos_init();
 }
 
-#define MSTPSR10xE6150038
-#define SMSTPCR1   0xE6150134
 #define TMU0_MSTP125   (1  25)
-
-#define MSTPSR70xE61501C4
-#define SMSTPCR7   0xE615014C
 #define SCIF0_MSTP721  (1  21)
-
-#define MSTPSR80xE61509A0
-#define SMSTPCR8   0xE6150990
 #define ETHER_MSTP813  (1  13)
 
 #define mstp_setbits(type, addr, saddr, set) \
diff --git a/board/renesas/lager/lager.c b/board/renesas/lager/lager.c
index 93273b2..23ef194 100644
--- a/board/renesas/lager/lager.c
+++ b/board/renesas/lager/lager.c
@@ -50,16 +50,8 @@ void s_init(void)
qos_init();
 }
 
-#define MSTPSR10xE6150038
-#define SMSTPCR1   0xE6150134
 #define TMU0_MSTP125   (1  25)
-
-#define MSTPSR70xE61501C4
-#define SMSTPCR7   0xE615014C
 #define 

[U-Boot] [PATCH 2/7] arm: rmobile: Move control macro of mstp to arch-rmobile/rcar-mstp.h

2014-11-30 Thread Nobuhiro Iwamatsu
Control macro of mstp is common in R-Car ARM SoC (r8a7790, r8a7791,
r8a7793 and r8a7794). This moves these to arch-rmobile/rcar-mstp.h

Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com
---
 arch/arm/include/asm/arch-rmobile/rcar-mstp.h | 22 ++
 board/renesas/alt/alt.c   | 10 +-
 board/renesas/gose/gose.c | 10 +-
 board/renesas/koelsch/koelsch.c   | 10 +-
 board/renesas/lager/lager.c   | 10 +-
 5 files changed, 26 insertions(+), 36 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-rmobile/rcar-mstp.h

diff --git a/arch/arm/include/asm/arch-rmobile/rcar-mstp.h 
b/arch/arm/include/asm/arch-rmobile/rcar-mstp.h
new file mode 100644
index 000..bf9a2cf
--- /dev/null
+++ b/arch/arm/include/asm/arch-rmobile/rcar-mstp.h
@@ -0,0 +1,22 @@
+/*
+ * arch/arm/include/asm/arch-rmobile/rcar-mstp.h
+ *
+ * Copyright (C) 2013, 2014 Nobuhiro Iwamatsu 
nobuhiro.iwamatsu...@renesas.com
+ * Copyright (C) 2013, 2014 Renesas Electronics Corporation
+ *
+ * SPDX-License-Identifier:GPL-2.0
+ */
+
+#ifndef __ASM_ARCH_RCAR_MSTP_H
+#define __ASM_ARCH_RCAR_MSTP_H
+
+#define mstp_setbits(type, addr, saddr, set) \
+   out_##type((saddr), in_##type(addr) | (set))
+#define mstp_clrbits(type, addr, saddr, clear) \
+   out_##type((saddr), in_##type(addr)  ~(clear))
+#define mstp_setbits_le32(addr, saddr, set) \
+   mstp_setbits(le32, addr, saddr, set)
+#define mstp_clrbits_le32(addr, saddr, clear) \
+   mstp_clrbits(le32, addr, saddr, clear)
+
+#endif /* __ASM_ARCH_RCAR_MSTP_H */
diff --git a/board/renesas/alt/alt.c b/board/renesas/alt/alt.c
index bf90f2e..e3cfe54 100644
--- a/board/renesas/alt/alt.c
+++ b/board/renesas/alt/alt.c
@@ -15,6 +15,7 @@
 #include asm/arch/sys_proto.h
 #include asm/gpio.h
 #include asm/arch/rmobile.h
+#include asm/arch/rcar-mstp.h
 #include netdev.h
 #include miiphy.h
 #include i2c.h
@@ -42,15 +43,6 @@ void s_init(void)
 #define ETHER_MSTP813  (1  13)
 #define IIC1_MSTP323   (1  23)
 
-#define mstp_setbits(type, addr, saddr, set) \
-   out_##type((saddr), in_##type(addr) | (set))
-#define mstp_clrbits(type, addr, saddr, clear) \
-   out_##type((saddr), in_##type(addr)  ~(clear))
-#define mstp_setbits_le32(addr, saddr, set) \
-   mstp_setbits(le32, addr, saddr, set)
-#define mstp_clrbits_le32(addr, saddr, clear)   \
-   mstp_clrbits(le32, addr, saddr, clear)
-
 int board_early_init_f(void)
 {
/* TMU */
diff --git a/board/renesas/gose/gose.c b/board/renesas/gose/gose.c
index bb6849e..0b2d904 100644
--- a/board/renesas/gose/gose.c
+++ b/board/renesas/gose/gose.c
@@ -15,6 +15,7 @@
 #include asm/arch/sys_proto.h
 #include asm/gpio.h
 #include asm/arch/rmobile.h
+#include asm/arch/rcar-mstp.h
 #include netdev.h
 #include miiphy.h
 #include i2c.h
@@ -45,15 +46,6 @@ void s_init(void)
 #define SCIF0_MSTP721  (1  21)
 #define ETHER_MSTP813  (1  13)
 
-#define mstp_setbits(type, addr, saddr, set) \
-   out_##type((saddr), in_##type(addr) | (set))
-#define mstp_clrbits(type, addr, saddr, clear) \
-   out_##type((saddr), in_##type(addr)  ~(clear))
-#define mstp_setbits_le32(addr, saddr, set) \
-   mstp_setbits(le32, addr, saddr, set)
-#define mstp_clrbits_le32(addr, saddr, clear) \
-   mstp_clrbits(le32, addr, saddr, clear)
-
 int board_early_init_f(void)
 {
/* TMU0 */
diff --git a/board/renesas/koelsch/koelsch.c b/board/renesas/koelsch/koelsch.c
index 14d1770..5ebbfcf 100644
--- a/board/renesas/koelsch/koelsch.c
+++ b/board/renesas/koelsch/koelsch.c
@@ -16,6 +16,7 @@
 #include asm/arch/sys_proto.h
 #include asm/gpio.h
 #include asm/arch/rmobile.h
+#include asm/arch/rcar-mstp.h
 #include netdev.h
 #include miiphy.h
 #include i2c.h
@@ -47,15 +48,6 @@ void s_init(void)
 #define SCIF0_MSTP721  (1  21)
 #define ETHER_MSTP813  (1  13)
 
-#define mstp_setbits(type, addr, saddr, set) \
-   out_##type((saddr), in_##type(addr) | (set))
-#define mstp_clrbits(type, addr, saddr, clear) \
-   out_##type((saddr), in_##type(addr)  ~(clear))
-#define mstp_setbits_le32(addr, saddr, set) \
-   mstp_setbits(le32, addr, saddr, set)
-#define mstp_clrbits_le32(addr, saddr, clear)   \
-   mstp_clrbits(le32, addr, saddr, clear)
-
 int board_early_init_f(void)
 {
mstp_clrbits_le32(MSTPSR1, SMSTPCR1, TMU0_MSTP125);
diff --git a/board/renesas/lager/lager.c b/board/renesas/lager/lager.c
index 23ef194..47cf51b 100644
--- a/board/renesas/lager/lager.c
+++ b/board/renesas/lager/lager.c
@@ -18,6 +18,7 @@
 #include asm/arch/sys_proto.h
 #include asm/gpio.h
 #include asm/arch/rmobile.h
+#include asm/arch/rcar-mstp.h
 #include miiphy.h
 #include i2c.h
 #include qos.h
@@ -54,15 +55,6 @@ void s_init(void)
 #define SCIF0_MSTP721  (1  21)
 #define ETHER_MSTP813  (1  13)
 
-#define mstp_setbits(type, addr, saddr, set) \
-   out_##type((saddr), in_##type(addr) | (set))
-#define mstp_clrbits(type, 

[U-Boot] [PATCH 6/7] arm: rmobile: alt: Halt clock prior to booting kernel

2014-11-30 Thread Nobuhiro Iwamatsu
Before a kernel boots, GPIO, SYS-DMAC, QSPI, MSIOF and IPMMU-GP
clock is halted.

Signed-off-by: Hisashi Nakamura hisashi.nakamura...@renesas.com
Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com
---
 board/renesas/alt/alt.c | 43 +--
 1 file changed, 41 insertions(+), 2 deletions(-)

diff --git a/board/renesas/alt/alt.c b/board/renesas/alt/alt.c
index e3cfe54..f8f54ef 100644
--- a/board/renesas/alt/alt.c
+++ b/board/renesas/alt/alt.c
@@ -60,10 +60,49 @@ int board_early_init_f(void)
return 0;
 }
 
+static struct mstp_ctl {
+   u32 s_addr;
+   u32 s_dis;
+   u32 s_ena;
+   u32 r_addr;
+   u32 r_dis;
+   u32 r_ena;
+} mstptbl[] = {
+   [0] = { SMSTPCR0,  0x00440801, 0x0040,
+RMSTPCR0,  0x00440801, 0x },
+   [1] = { SMSTPCR1,  0x936899DA, 0x,
+RMSTPCR1,  0x936899DA, 0x },
+   [2] = { SMSTPCR2,  0x100D21FC, 0x2000,
+RMSTPCR2,  0x100D21FC, 0x },
+   [3] = { SMSTPCR3,  0xE084D810, 0x,
+RMSTPCR3,  0xE084D810, 0x },
+   [4] = { SMSTPCR4,  0x81C4, 0x0180,
+RMSTPCR4,  0x81C4, 0x },
+   [5] = { SMSTPCR5,  0x40C00044, 0x,
+RMSTPCR5,  0x40C00044, 0x },
+   [7] = { SMSTPCR7,  0x013FE618, 0x0008,
+RMSTPCR7,  0x013FE618, 0x },
+   [8] = { SMSTPCR8,  0x40803C05, 0x,
+RMSTPCR8,  0x40803C05, 0x },
+   [9] = { SMSTPCR9,  0xFB879FEE, 0x,
+RMSTPCR9,  0xFB879FEE, 0x },
+   [10] = { SMSTPCR10, 0xFFFEFFE0, 0x,
+RMSTPCR10, 0xFFFEFFE0, 0x },
+   [11] = { SMSTPCR11, 0x01C0, 0x,
+RMSTPCR11, 0x01C0, 0x },
+};
+
 void arch_preboot_os(void)
 {
-   /* Disable TMU0 */
-   mstp_setbits_le32(MSTPSR1, SMSTPCR1, TMU0_MSTP125);
+   int i;
+
+   /* Stop all module clock */
+   for (i = 0; i  ARRAY_SIZE(mstptbl); i++) {
+   mstp_setclrbits_le32(mstptbl[i].s_addr, mstptbl[i].s_addr,
+mstptbl[i].s_dis, mstptbl[i].s_ena);
+   mstp_setclrbits_le32(mstptbl[i].r_addr, mstptbl[i].r_addr,
+mstptbl[i].r_dis, mstptbl[i].r_ena);
+   }
 }
 
 int board_init(void)
-- 
2.1.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 5/7] arm: rmobile: koelsch: Halt clock prior to booting kernel

2014-11-30 Thread Nobuhiro Iwamatsu
Before a kernel boots, GPIO, SYS-DMAC, QSPI, MSIOF and IPMMU-GP
clock is halted.

Signed-off-by: Hisashi Nakamura hisashi.nakamura...@renesas.com
Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com
---
 board/renesas/koelsch/koelsch.c | 43 +++--
 1 file changed, 41 insertions(+), 2 deletions(-)

diff --git a/board/renesas/koelsch/koelsch.c b/board/renesas/koelsch/koelsch.c
index 5ebbfcf..8d43f36 100644
--- a/board/renesas/koelsch/koelsch.c
+++ b/board/renesas/koelsch/koelsch.c
@@ -61,10 +61,49 @@ int board_early_init_f(void)
return 0;
 }
 
+static struct mstp_ctl {
+   u32 s_addr;
+   u32 s_dis;
+   u32 s_ena;
+   u32 r_addr;
+   u32 r_dis;
+   u32 r_ena;
+} mstptbl[] = {
+   [0] = { SMSTPCR0,  0x00640801, 0x0040,
+   RMSTPCR0,  0x00640801, 0x },
+   [1] = { SMSTPCR1,  0x9B6C9B5A, 0x,
+   RMSTPCR1,  0x9B6C9B5A, 0x },
+   [2] = { SMSTPCR2,  0x100D21FC, 0x2000,
+   RMSTPCR2,  0x100D21FC, 0x },
+   [3] = { SMSTPCR3,  0xF08CD810, 0x,
+   RMSTPCR3,  0xF08CD810, 0x },
+   [4] = { SMSTPCR4,  0x81C4, 0x0180,
+   RMSTPCR4,  0x81C4, 0x },
+   [5] = { SMSTPCR5,  0x44C00046, 0x,
+   RMSTPCR5,  0x44C00046, 0x },
+   [7] = { SMSTPCR7,  0x05BFE618, 0x0020,
+   RMSTPCR7,  0x05BFE618, 0x },
+   [8] = { SMSTPCR8,  0x40C0FE85, 0x,
+   RMSTPCR8,  0x40C0FE85, 0x },
+   [9] = { SMSTPCR9,  0xFF979FFF, 0x,
+   RMSTPCR9,  0xFF979FFF, 0x },
+   [10] = { SMSTPCR10, 0xFFFEFFE0, 0x,
+RMSTPCR10, 0xFFFEFFE0, 0x },
+   [11] = { SMSTPCR11, 0x01C0, 0x,
+RMSTPCR11, 0x01C0, 0x },
+};
+
 void arch_preboot_os(void)
 {
-   /* Disable TMU0 */
-   mstp_setbits_le32(MSTPSR1, SMSTPCR1, TMU0_MSTP125);
+   int i;
+
+   /* Stop all module clock */
+   for (i = 0; i  ARRAY_SIZE(mstptbl); i++) {
+   mstp_setclrbits_le32(mstptbl[i].s_addr, mstptbl[i].s_addr,
+mstptbl[i].s_dis, mstptbl[i].s_ena);
+   mstp_setclrbits_le32(mstptbl[i].r_addr, mstptbl[i].r_addr,
+mstptbl[i].r_dis, mstptbl[i].r_ena);
+   }
 }
 
 /* LSI pin pull-up control */
-- 
2.1.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 7/7] arm: rmobile: gose: Halt clock prior to booting kernel

2014-11-30 Thread Nobuhiro Iwamatsu
Before a kernel boots, GPIO, SYS-DMAC, QSPI, MSIOF and IPMMU-GP
clock is halted.

Signed-off-by: Hisashi Nakamura hisashi.nakamura...@renesas.com
Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com
---
 board/renesas/gose/gose.c | 44 ++--
 1 file changed, 42 insertions(+), 2 deletions(-)

diff --git a/board/renesas/gose/gose.c b/board/renesas/gose/gose.c
index 0b2d904..5ee5a06 100644
--- a/board/renesas/gose/gose.c
+++ b/board/renesas/gose/gose.c
@@ -60,14 +60,54 @@ int board_early_init_f(void)
return 0;
 }
 
+static struct mstp_ctl {
+   u32 s_addr;
+   u32 s_dis;
+   u32 s_ena;
+   u32 r_addr;
+   u32 r_dis;
+   u32 r_ena;
+} mstptbl[] = {
+   [0] = { SMSTPCR0,  0x00640801, 0x0040,
+   RMSTPCR0,  0x00640801, 0x },
+   [1] = { SMSTPCR1,  0x9B6C9B5A, 0x,
+   RMSTPCR1,  0x9B6C9B5A, 0x },
+   [2] = { SMSTPCR2,  0x100D21FC, 0x2000,
+   RMSTPCR2,  0x100D21FC, 0x },
+   [3] = { SMSTPCR3,  0xF08CD810, 0x,
+   RMSTPCR3,  0xF08CD810, 0x },
+   [4] = { SMSTPCR4,  0x81C4, 0x0180,
+   RMSTPCR4,  0x81C4, 0x },
+   [5] = { SMSTPCR5,  0x44C00046, 0x,
+   RMSTPCR5,  0x44C00046, 0x },
+   [7] = { SMSTPCR7,  0x05BFE618, 0x0020,
+   RMSTPCR7,  0x05BFE618, 0x },
+   [8] = { SMSTPCR8,  0x40C0FE85, 0x,
+   RMSTPCR8,  0x40C0FE85, 0x },
+   [9] = { SMSTPCR9,  0xFF979FFF, 0x,
+   RMSTPCR9,  0xFF979FFF, 0x },
+   [10] = { SMSTPCR10, 0xFFFEFFE0, 0x,
+RMSTPCR10, 0xFFFEFFE0, 0x },
+   [11] = { SMSTPCR11, 0x01C0, 0x,
+RMSTPCR11, 0x01C0, 0x },
+};
+
 #define TSTR0  0x04
 #define TSTR0_STR0 0x01
 void arch_preboot_os(void)
 {
+   int i;
+
/* stop TMU0 */
mstp_clrbits_le32(TMU_BASE + TSTR0, TMU_BASE + TSTR0, TSTR0_STR0);
-   /* Disable TMU0 */
-   mstp_setbits_le32(MSTPSR1, SMSTPCR1, TMU0_MSTP125);
+
+   /* Stop all module clock */
+   for (i = 0; i  ARRAY_SIZE(mstptbl); i++) {
+   mstp_setclrbits_le32(mstptbl[i].s_addr, mstptbl[i].s_addr,
+mstptbl[i].s_dis, mstptbl[i].s_ena);
+   mstp_setclrbits_le32(mstptbl[i].r_addr, mstptbl[i].r_addr,
+mstptbl[i].r_dis, mstptbl[i].r_ena);
+   }
 }
 
 #define PUPR5  0xE6060114
-- 
2.1.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3] Export redesign

2014-11-30 Thread Martin Dorwig
this is an atempt to make the export of functions typesafe.
I replaced the jumptable void ** by a struct (jt_funcs) with function pointers.
The EXPORT_FUNC macro now has 3 fixed parameters and one
variadic parameter
The first is the name of the exported function,
the rest of the parameters are used to format a functionpointer
in the jumptable,

the EXPORT_FUNC macros are expanded three times,
1. to declare the members of the struct
2. to initialize the structmember pointers
3. to call the functions in stubs.c

Signed-off-by: Martin Dorwig dor...@tetronik.com
---

Changes in v3:
- install_hdlr/free_hdlr must be dummy, since they do not exist
- blackfin cpu.c must include exports.h
- rebased to master
- take CONFIG_DM_SPI into account

Changes in v2:
- redesign the way functions are exported to standalone applications

 arch/blackfin/cpu/cpu.c   |  3 +-
 board/BuS/eb_cpux9k2/cpux9k2.c|  2 +-
 common/cmd_load.c |  2 +-
 common/console.c  | 20 
 common/exports.c  | 28 ++-
 doc/README.standalone | 41 +++-
 examples/standalone/stubs.c   | 64 -
 include/_exports.h| 98 +++
 include/asm-generic/global_data.h |  2 +-
 include/exports.h | 15 +++---
 10 files changed, 157 insertions(+), 118 deletions(-)

diff --git a/arch/blackfin/cpu/cpu.c b/arch/blackfin/cpu/cpu.c
index b7f1188..91aa5cc 100644
--- a/arch/blackfin/cpu/cpu.c
+++ b/arch/blackfin/cpu/cpu.c
@@ -24,6 +24,7 @@
 
 #include cpu.h
 #include initcode.h
+#include exports.h
 
 ulong bfin_poweron_retx;
 DECLARE_GLOBAL_DATA_PTR;
@@ -121,7 +122,7 @@ static void display_global_data(void)
printf( |-ram_size: %lx\n, gd-ram_size);
printf( |-env_addr: %lx\n, gd-env_addr);
printf( |-env_valid: %lx\n, gd-env_valid);
-   printf( |-jt(%p): %p\n, gd-jt, *(gd-jt));
+   printf( |-jt(%p): %p\n, gd-jt, gd-jt-get_version);
printf( \\-bd: %p\n, gd-bd);
printf(   |-bi_boot_params: %lx\n, bd-bi_boot_params);
printf(   |-bi_memstart: %lx\n, bd-bi_memstart);
diff --git a/board/BuS/eb_cpux9k2/cpux9k2.c b/board/BuS/eb_cpux9k2/cpux9k2.c
index 5e4778e..76ad7c4 100644
--- a/board/BuS/eb_cpux9k2/cpux9k2.c
+++ b/board/BuS/eb_cpux9k2/cpux9k2.c
@@ -98,7 +98,7 @@ int misc_init_r(void)
puts(Error: invalid MAC at EEPROM\n);
}
}
-   gd-jt[XF_do_reset] = (void *) do_reset;
+   gd-jt-do_reset = do_reset;
 
 #ifdef CONFIG_STATUS_LED
status_led_set(STATUS_LED_BOOT, STATUS_LED_BLINKING);
diff --git a/common/cmd_load.c b/common/cmd_load.c
index f6e522c..d043e6d 100644
--- a/common/cmd_load.c
+++ b/common/cmd_load.c
@@ -222,7 +222,7 @@ static int read_record(char *buf, ulong len)
}
 
/* Check for the console hangup (if any different from serial) */
-   if (gd-jt[XF_getc] != getc) {
+   if (gd-jt-getc != getc) {
if (ctrlc()) {
return (-1);
}
diff --git a/common/console.c b/common/console.c
index 4695386..1ccb750 100644
--- a/common/console.c
+++ b/common/console.c
@@ -125,13 +125,13 @@ static int console_setfile(int file, struct stdio_dev * 
dev)
 */
switch (file) {
case stdin:
-   gd-jt[XF_getc] = dev-getc;
-   gd-jt[XF_tstc] = dev-tstc;
+   gd-jt-getc = getc;
+   gd-jt-tstc = tstc;
break;
case stdout:
-   gd-jt[XF_putc] = dev-putc;
-   gd-jt[XF_puts] = dev-puts;
-   gd-jt[XF_printf] = printf;
+   gd-jt-putc  = putc;
+   gd-jt-puts  = puts;
+   gd-jt-printf = printf;
break;
}
break;
@@ -723,11 +723,11 @@ int console_init_r(void)
 #endif
 
/* set default handlers at first */
-   gd-jt[XF_getc] = serial_getc;
-   gd-jt[XF_tstc] = serial_tstc;
-   gd-jt[XF_putc] = serial_putc;
-   gd-jt[XF_puts] = serial_puts;
-   gd-jt[XF_printf] = serial_printf;
+   gd-jt-getc  = serial_getc;
+   gd-jt-tstc  = serial_tstc;
+   gd-jt-putc  = serial_putc;
+   gd-jt-puts  = serial_puts;
+   gd-jt-printf = serial_printf;
 
/* stdin stdout and stderr are in environment */
/* scan for it */
diff --git a/common/exports.c b/common/exports.c
index 88fcfc8..333107c 100644
--- a/common/exports.c
+++ b/common/exports.c
@@ -1,6 +1,7 @@
 #include common.h
 #include exports.h
 #include spi.h
+#include i2c.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -13,33 +14,10 @@ unsigned long get_version(void)
return XF_VERSION;
 }
 
-/* Reuse _exports.h with a little trickery to avoid bitrot */
-#define EXPORT_FUNC(sym) gd-jt[XF_##sym] = 

Re: [U-Boot] [PATCH 4/7] arm: rmobile: lager: Halt clock prior to booting kernel

2014-11-30 Thread Wolfgang Denk
Dear Nobuhiro,

In message 1417417556-23946-4-git-send-email-nobuhiro.iwamatsu...@renesas.com 
you wrote:
 Before a kernel boots, GPIO, SYS-DMAC, QSPI and MSIOF clock
 is halted.
 
 Signed-off-by: Hisashi Nakamura hisashi.nakamura...@renesas.com
 Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com

The data structures and the code are all repeated for this patch and
the following patches:

[PATCH 4/7] arm: rmobile: lager: Halt clock prior to booting kernel
[PATCH 5/7] arm: rmobile: koelsch: Halt clock prior to booting kernel
[U-Boot] [PATCH 6/7] arm: rmobile: alt: Halt clock prior to booting 
kernel
[PATCH 7/7] arm: rmobile: gose: Halt clock prior to booting kernel

Can you please move the code to a common place so we have it only
once?

 +} mstptbl[] = {
 + [0] = { SMSTPCR0,  0x00640801, 0x0041,
 + RMSTPCR0,  0x00640801, 0x },
 + [1] = { SMSTPCR1,  0xDB6E9BDF, 0x,
 + RMSTPCR1,  0xDB6E9BDF, 0x },
 + [2] = { SMSTPCR2,  0x300DA1FC, 0x000CA120,
 + RMSTPCR2,  0x300DA1FC, 0x },
 + [3] = { SMSTPCR3,  0xF08CF831, 0x,
 + RMSTPCR3,  0xF08CF831, 0x },
 + [4] = { SMSTPCR4,  0x8184, 0x0180,
 + RMSTPCR4,  0x8184, 0x },
 + [5] = { SMSTPCR5,  0x44C00046, 0x,
 + RMSTPCR5,  0x44C00046, 0x },
 + [7] = { SMSTPCR7,  0x07F30718, 0x0020,
 + RMSTPCR7,  0x07F30718, 0x },
 + [8] = { SMSTPCR8,  0x01F0FF84, 0x,
 + RMSTPCR8,  0x01F0FF84, 0x },
 + [9] = { SMSTPCR9,  0xF5979FCF, 0x00021F80,
 + RMSTPCR9,  0xF5979FCF, 0x1F80 },
 + [10] = { SMSTPCR10, 0xFFFEFFE0, 0x,
 +  RMSTPCR10, 0xFFFEFFE0, 0x },
 + [11] = { SMSTPCR11, 0x, 0x,
 +  RMSTPCR11, 0x, 0x },
 +};

Also, these data look pretty much the same to me, with only minor
differences in some bits.  If we use some defines instead of the
magic numbers this could probably help to see the common part and the
differences in the data. We probably don't need board-specific data in
the code, and can move this to the configuration files?

Thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Obviously, a major malfunction has occurred.
  -- Steve Nesbitt, voice of Mission Control, January 28,
 1986, as the shuttle Challenger exploded within view
 of the grandstands.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/6] kirkwood: ib62x0: add CONFIG_SYS_GENERIC_BOARD define

2014-11-30 Thread Stefan Roese

On 30.11.2014 05:00, Luka Perkov wrote:

Signed-off-by: Luka Perkov l...@openwrt.org
CC: Prafulla Wadaskar prafu...@marvell.com
CC: Stefan Roese s...@denx.de


Acked-by: Stefan Roese s...@denx.de

Thanks,
Stefan

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 5/6] kirkwood: pogo_e02: add CONFIG_SYS_GENERIC_BOARD define

2014-11-30 Thread Stefan Roese

On 30.11.2014 05:02, Luka Perkov wrote:

Signed-off-by: Luka Perkov l...@openwrt.org
CC: Prafulla Wadaskar prafu...@marvell.com
CC: Stefan Roese s...@denx.de


Acked-by: Stefan Roese s...@denx.de

Thanks,
Stefan

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/6] kirkwood: dockstar: add CONFIG_SYS_GENERIC_BOARD define

2014-11-30 Thread Stefan Roese

On 30.11.2014 05:01, Luka Perkov wrote:

Signed-off-by: Luka Perkov l...@openwrt.org
CC: Prafulla Wadaskar prafu...@marvell.com
CC: Stefan Roese s...@denx.de


Acked-by: Stefan Roese s...@denx.de

Thanks,
Stefan

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 6/6] kirkwood: sheevaplug: add CONFIG_SYS_GENERIC_BOARD define

2014-11-30 Thread Stefan Roese

On 30.11.2014 05:02, Luka Perkov wrote:

Signed-off-by: Luka Perkov l...@openwrt.org
CC: Prafulla Wadaskar prafu...@marvell.com
CC: Stefan Roese s...@denx.de


Acked-by: Stefan Roese s...@denx.de

Thanks,
Stefan

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/6] kirkwood: iconnect: add CONFIG_SYS_GENERIC_BOARD define

2014-11-30 Thread Stefan Roese

On 30.11.2014 05:01, Luka Perkov wrote:

Signed-off-by: Luka Perkov l...@openwrt.org
CC: Prafulla Wadaskar prafu...@marvell.com
CC: Stefan Roese s...@denx.de


Acked-by: Stefan Roese s...@denx.de

Thanks,
Stefan

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/6] kirkwood: goflexhome: add CONFIG_SYS_GENERIC_BOARD define

2014-11-30 Thread Stefan Roese

On 30.11.2014 05:01, Luka Perkov wrote:

Signed-off-by: Luka Perkov l...@openwrt.org
CC: Prafulla Wadaskar prafu...@marvell.com
CC: Stefan Roese s...@denx.de


Acked-by: Stefan Roese s...@denx.de

Thanks,
Stefan

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] powerpc/p2041rdb: enable generic board configs

2014-11-30 Thread shh.xie
From: Shaohui Xie shaohui@freescale.com

Add following configs in header file:
CONFIG_SYS_GENERIC_BOARD
CONFIG_DISPLAY_BOARDINFO

Signed-off-by: Shaohui Xie shaohui@freescale.com
---
 include/configs/P2041RDB.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/configs/P2041RDB.h b/include/configs/P2041RDB.h
index 16f7525..ef06227 100644
--- a/include/configs/P2041RDB.h
+++ b/include/configs/P2041RDB.h
@@ -13,6 +13,8 @@
 
 #define CONFIG_P2041RDB
 #define CONFIG_PHYS_64BIT
+#define CONFIG_SYS_GENERIC_BOARD
+#define CONFIG_DISPLAY_BOARDINFO
 #define CONFIG_PPC_P2041
 
 #ifdef CONFIG_RAMBOOT_PBL
-- 
2.1.0.27.g96db324

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot