Skip to contentSkip to conversation

ARM Nomadik: video and keypad for nhk8815 (and RFC inside)

PATCH New Alessandro Rubini 2 participants 17 messages Oct 9, 2009 – Nov 25, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover ARM Nomadik: video and keypad for nhk8815 (and RFC inside)

This adds support for display and keypad on the Nomadik evaluation kit.

I tried to split the changes as best as I can. First the amba-lcd is added as a generic driver, although it receives pre-computed register values, as it misses the code to assemble register bits from higher-level parameters. I think it acceptable for a boot loader, although it could be better.

Then, I add the "STMicro Port Extender 2401" as a separete driver. It's an i2c-driven port extender found on the evaluation kit; I coded it in order for other boards to use the code if needed.

common/lcd.c is a ifdef hell, and I had a hard time adding 32bpp support. Howerver, it was not something I could submit, because it was even worse with ifdef than now, so I turned to 16bpp. 16bpp wasn't working either, so I tried to fix it. This is definitely suboptimal, and I need help in making it right. Fortunately only the mimc200 uses 16bpp so any issues should be easy to fix. The mimc200 uses CONFIG_ATMEL_LCD, actually, so it falls on different ifdefs than me.

May I tell that I'd better remove ATMEL_LCD from common/lcd.c and push specifics in a separate file? Is that task worth endorsing? I think once atmel is out of the way, the other specific clases (pxa and little ore) should be easy, so lcd.c can finally be made more maintainable. Will we do that?

BTW: I know the name "make 16bpp work" is not suitable for upstream, but since I expect at least a V2 series to be needed, I'd better avoid renaming it at this point. Similarly, there are no comments within each patch, I'll split this explanation in proper places for V2.

Alessandro Rubini (8):
video: add amba-clcd prime-cell
include/nomadik.h: add physical address for cldc drivers/misc: add stmpe2401 port extender and keypad controller nhk8815.h: define we need stmpe
lcd: make 16bpp work
nhk8815: added keypad
nhk8815: start lower in RAM, so the 800x480 frame buffer fits
nhk8815: added lcd support

 board/st/nhk8815/Makefile  |    6 +-
 board/st/nhk8815/config.mk |    7 +-
 board/st/nhk8815/keypad.c  |  100 +++++++++++++++++++++++++
 board/st/nhk8815/lcd.c     |   89 ++++++++++++++++++++++
 board/st/nhk8815/nhk8815.c |    9 ++
 common/lcd.c               |   26 +++++--
 drivers/misc/Makefile      |    1 +
 drivers/misc/stmpe2401.c   |  176 ++++++++++++++++++++++++++++++++++++++++++++
 drivers/video/Makefile     |    1 +
 drivers/video/amba.c       |   86 +++++++++++++++++++++
 include/amba_clcd.h        |   85 +++++++++++++++++++++
 include/configs/nhk8815.h  |   20 +++++-
 include/nomadik.h          |    1 +
 include/stmpe2401.h        |   66 ++++++++++++++++
 14 files changed, 660 insertions(+), 13 deletions(-)
 create mode 100644 board/st/nhk8815/keypad.c
 create mode 100644 board/st/nhk8815/lcd.c
 create mode 100644 drivers/misc/stmpe2401.c
 create mode 100644 drivers/video/amba.c
 create mode 100644 include/amba_clcd.h
 create mode 100644 include/stmpe2401.h
#1 lore raw

PATCH 1/8 video: add amba-clcd prime-cell

From: Alessandro Rubini <[email protected]>

---
 drivers/video/Makefile |    1 +
 drivers/video/amba.c   |   86 ++++++++++++++++++++++++++++++++++++++++++++++++
 include/amba_clcd.h    |   85 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 172 insertions(+), 0 deletions(-)
 create mode 100644 drivers/video/amba.c
 create mode 100644 include/amba_clcd.h
drivers/video/Makefile +1 -0
index bb6b5a0..a5e339a 100644
@@ -29,6 +29,7 @@ COBJS-$(CONFIG_ATI_RADEON_FB) += ati_radeon_fb.o
 COBJS-$(CONFIG_ATMEL_LCD) += atmel_lcdfb.o
 COBJS-$(CONFIG_CFB_CONSOLE) += cfb_console.o
 COBJS-$(CONFIG_S6E63D6) += s6e63d6.o
+COBJS-$(CONFIG_VIDEO_AMBA) += amba.o
 COBJS-$(CONFIG_VIDEO_CT69000) += ct69000.o
 COBJS-$(CONFIG_VIDEO_MB862xx) += mb862xx.o
 COBJS-$(CONFIG_VIDEO_MX3) += mx3fb.o
drivers/video/amba.c new file +86 -0

86 lines not on this page · raw message

include/amba_clcd.h new file +85 -0

85 lines not on this page · raw message

Signature · 1 line
1.6.0.2
#3 lore raw

PATCH 2/8 include/nomadik.h: add physical address for cldc

In reply to Alessandro Rubini

From: Alessandro Rubini <[email protected]>

---
 include/nomadik.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
include/nomadik.h +1 -0
index d9405fd..ea65b2d 100644
@@ -4,6 +4,7 @@
 #define __NOMADIK_H__
 
 /* Base addresses of our peripherals */
+#define NOMADIK_CLCDC_BASE	0x10120000	/* CLCD Controller */
 #define NOMADIK_SRC_BASE	0x101E0000	/* System and Reset Cnt */
 #define NOMADIK_PMU_BASE	0x101E9000	/* Power Management Unit */
 #define NOMADIK_MPMC_BASE	0x10110000	/* SDRAM Controller */
Signature · 1 line
1.6.0.2
#4 lore raw

PATCH 3/8 drivers/misc: add stmpe2401 port extender and keypad controller

In reply to Alessandro Rubini

From: Alessandro Rubini <[email protected]>

---
 drivers/misc/Makefile    |    1 +
 drivers/misc/stmpe2401.c |  176 ++++++++++++++++++++++++++++++++++++++++++++++
 include/stmpe2401.h      |   66 +++++++++++++++++
 3 files changed, 243 insertions(+), 0 deletions(-)
 create mode 100644 drivers/misc/stmpe2401.c
 create mode 100644 include/stmpe2401.h
drivers/misc/Makefile +1 -0
index f6df60f..76c009a 100644
@@ -30,6 +30,7 @@ COBJS-$(CONFIG_DS4510)  += ds4510.o
 COBJS-$(CONFIG_FSL_LAW) += fsl_law.o
 COBJS-$(CONFIG_NS87308) += ns87308.o
 COBJS-$(CONFIG_STATUS_LED) += status_led.o
+COBJS-$(CONFIG_STMPE2401) += stmpe2401.o
 COBJS-$(CONFIG_TWL4030_LED) += twl4030_led.o
 
 COBJS	:= $(COBJS-y)
drivers/misc/stmpe2401.c new file +176 -0

176 lines not on this page · raw message

include/stmpe2401.h new file +66 -0

66 lines not on this page · raw message

Signature · 1 line
1.6.0.2
#6 lore raw

PATCH 4/8 nhk8815.h: define we need stmpe

In reply to Alessandro Rubini

From: Alessandro Rubini <[email protected]>

---
 include/configs/nhk8815.h |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
include/configs/nhk8815.h +6 -1
index a00c2fb..e1be45b 100644
@@ -110,7 +110,7 @@
 #define CONFIG_PL01x_PORTS	{ (void *)CFG_SERIAL0, (void *)CFG_SERIAL1 }
 #define CONFIG_PL011_CLOCK	48000000
 
-/* i2c, for the port extenders (uses gpio.c in board directory) */
+/* i2c, for the stmpe2401 port extenders (uses gpio.c in board directory) */
 #ifndef __ASSEMBLY__
 #include <asm/arch/gpio.h>
 #define CONFIG_CMD_I2C
@@ -126,6 +126,11 @@
 #define I2C_DELAY     (udelay(2))
 #endif /* __ASSEMBLY__ */
 
+/* Activate port extenders and define their i2c address */
+#define CONFIG_STMPE2401
+#define STMPE0  0x43
+#define STMPE1  0x44
+
 /* Ethernet */
 #define PCI_MEMORY_VADDR	0xe8000000
 #define PCI_IO_VADDR		0xee000000
Signature · 1 line
1.6.0.2
#7 lore raw

PATCH 5/8 lcd: make 16bpp work

In reply to Alessandro Rubini

From: Alessandro Rubini <[email protected]>

---
 common/lcd.c |   26 ++++++++++++++++++++------
 1 files changed, 20 insertions(+), 6 deletions(-)
common/lcd.c +20 -6
index 4e31618..d05c025 100644
@@ -63,7 +63,7 @@
 /************************************************************************/
 #ifdef CONFIG_LCD_LOGO
 # include <bmp_logo.h>		/* Get logo data, width and height	*/
-# if (CONSOLE_COLOR_WHITE >= BMP_LOGO_OFFSET)
+# if (CONSOLE_COLOR_WHITE >= BMP_LOGO_OFFSET) && (LCD_BPP != LCD_COLOR16)
 #  error Default Color Map overlaps with Logo Color Map
 # endif
 #endif
@@ -244,10 +244,12 @@ static void lcd_drawchars (ushort x, ushort y, uchar *str, int count)
 				bits <<= 1;
 			}
 #elif LCD_BPP == LCD_COLOR16
-			for (c=0; c<16; ++c) {
-				*d++ = (bits & 0x80) ?
-						lcd_color_fg : lcd_color_bg;
-				bits <<= 1;
+			{
+				u16 *d = (u16 *)dest;
+				for (c=0; c<8; ++c) {
+					*d++ = (bits & 0x80) ? 0xffff : 0;
+					bits <<= 1;
+				}
 			}
 #endif
 		}
@@ -529,6 +531,13 @@ void bitmap_plot (int x, int y)
 		cmap = (ushort *)&(cp->lcd_cmap[BMP_LOGO_OFFSET*sizeof(ushort)]);
 #elif defined(CONFIG_ATMEL_LCD)
 		cmap = (uint *) (panel_info.mmio + ATMEL_LCDC_LUT(0));
+#else
+		/*
+		 * default case: generic system with no cmap (most likely 16bpp)
+		 * We set cmap to the source palette, so no change is done.
+		 * This avoids even more ifdef in the next stanza
+		 */
+		cmap = bmp_logo_palette;
 #endif
 
 		WATCHDOG_RESET();
@@ -567,10 +576,15 @@ void bitmap_plot (int x, int y)
 		}
 	}
 	else { /* true color mode */
+		u16 col16;
 		fb16 = (ushort *)(lcd_base + y * lcd_line_length + x);
 		for (i=0; i<BMP_LOGO_HEIGHT; ++i) {
 			for (j=0; j<BMP_LOGO_WIDTH; j++) {
-				fb16[j] = bmp_logo_palette[(bmap[j])];
+				col16 = bmp_logo_palette[(bmap[j]-16)];
+				fb16[j] =
+					((col16 & 0x000F) << 1) |
+					((col16 & 0x00F0) << 3) |
+					((col16 & 0x0F00) << 4);
 				}
 			bmap += BMP_LOGO_WIDTH;
 			fb16 += panel_info.vl_col;
Signature · 1 line
1.6.0.2
#9 lore raw

PATCH 6/8 nhk8815: added keypad

In reply to Alessandro Rubini

From: Alessandro Rubini <[email protected]>

---
 board/st/nhk8815/Makefile  |    5 ++-
 board/st/nhk8815/keypad.c  |  100 ++++++++++++++++++++++++++++++++++++++++++++
 board/st/nhk8815/nhk8815.c |    5 ++
 include/configs/nhk8815.h  |    3 +
 4 files changed, 112 insertions(+), 1 deletions(-)
 create mode 100644 board/st/nhk8815/keypad.c
board/st/nhk8815/Makefile +4 -1
index b37fe53..1bb1d2c 100644
@@ -29,7 +29,10 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(BOARD).a
 
-COBJS	:= nhk8815.o
+COBJS-y	:= nhk8815.o
+COBJS-$(CONFIG_NHK8815_KEYPAD) += keypad.o
+
+COBJS	:= $(COBJS-y)
 SOBJS	:= platform.o
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
board/st/nhk8815/keypad.c new file +100 -0

100 lines not on this page · raw message

board/st/nhk8815/nhk8815.c +5 -0
index eadce40..efeb0d2 100644
@@ -106,9 +106,14 @@ int board_eth_init(bd_t *bis)
 }
 #endif
 
+extern int nhk8815_keypad_init(void);		/* ./keypad.c */
+
 /* Initialization callback, from lib_arm/board.c */
 int board_late_init(void)
 {
+#ifdef CONFIG_NHK8815_KEYPAD
+	nhk8815_keypad_init();
+#endif
 	return 0;
 }
 
include/configs/nhk8815.h +3 -0
index e1be45b..f9dbd7a 100644
@@ -131,6 +131,9 @@
 #define STMPE0  0x43
 #define STMPE1  0x44
 
+/* Keypad using stmpe2401 */
+#define CONFIG_NHK8815_KEYPAD
+
 /* Ethernet */
 #define PCI_MEMORY_VADDR	0xe8000000
 #define PCI_IO_VADDR		0xee000000
Signature · 1 line
1.6.0.2
#12 lore raw

PATCH 7/8 nhk8815: start lower in RAM, so the 800x480 frame buffer fits

In reply to Alessandro Rubini

From: Alessandro Rubini <[email protected]>

---
 board/st/nhk8815/config.mk |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
board/st/nhk8815/config.mk +2 -5
index 590393b..faf1d53 100644
@@ -18,9 +18,6 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA 02111-1307 USA
-#
-#
-# image should be loaded at 0x01000000
-#
 
-TEXT_BASE = 0x03F80000
+# A display of 800x480x4 takes almost 2MB, so we must be lower than that.
+TEXT_BASE = 0x03c00000
Signature · 1 line
1.6.0.2
#14 lore raw

PATCH 8/8 nhk8815: added lcd support

In reply to Alessandro Rubini

From: Alessandro Rubini <[email protected]>

---
 board/st/nhk8815/Makefile  |    1 +
 board/st/nhk8815/lcd.c     |   89 ++++++++++++++++++++++++++++++++++++++++++++
 board/st/nhk8815/nhk8815.c |    4 ++
 include/configs/nhk8815.h  |   10 +++++
 4 files changed, 104 insertions(+), 0 deletions(-)
 create mode 100644 board/st/nhk8815/lcd.c
board/st/nhk8815/Makefile +1 -0
index 1bb1d2c..7155f12 100644
@@ -31,6 +31,7 @@ LIB	= $(obj)lib$(BOARD).a
 
 COBJS-y	:= nhk8815.o
 COBJS-$(CONFIG_NHK8815_KEYPAD) += keypad.o
+COBJS-$(CONFIG_LCD) += lcd.o
 
 COBJS	:= $(COBJS-y)
 SOBJS	:= platform.o
board/st/nhk8815/lcd.c new file +89 -0

89 lines not on this page · raw message

board/st/nhk8815/nhk8815.c +4 -0
index efeb0d2..ded7681 100644
@@ -107,6 +107,7 @@ int board_eth_init(bd_t *bis)
 #endif
 
 extern int nhk8815_keypad_init(void);		/* ./keypad.c */
+extern int nhk8815_backlight_on(void);		/* in ./lcd.c */
 
 /* Initialization callback, from lib_arm/board.c */
 int board_late_init(void)
@@ -114,6 +115,9 @@ int board_late_init(void)
 #ifdef CONFIG_NHK8815_KEYPAD
 	nhk8815_keypad_init();
 #endif
+#ifdef CONFIG_LCD
+	nhk8815_backlight_on();
+#endif
 	return 0;
 }
 
include/configs/nhk8815.h +10 -0
index f9dbd7a..ad098d9 100644
@@ -134,6 +134,16 @@
 /* Keypad using stmpe2401 */
 #define CONFIG_NHK8815_KEYPAD
 
+/* Display support */
+#define CONFIG_LCD
+#define CONFIG_LCD_LOGO
+#define CONFIG_LCD_INFO_BELOW_LOGO
+#define CONFIG_SYS_WHITE_ON_BLACK
+#define LCD_BPP				LCD_COLOR16
+#define CONFIG_VIDEO_AMBA
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV	1
+#define CONFIG_CONSOLE_MUX
+
 /* Ethernet */
 #define PCI_MEMORY_VADDR	0xe8000000
 #define PCI_IO_VADDR		0xee000000
Signature · 1 line
1.6.0.2
#2 lore raw

PATCH 1/8 video: add amba-clcd prime-cell

In reply to Alessandro Rubini

Dear Anatolij,

Quoted 11 lines · In message <a8b2fcf3420377ff5349893f18d69df46780d250.1255086085.git.rubini@…

From: Alessandro Rubini <[email protected]>

---
 drivers/video/Makefile |    1 +
 drivers/video/amba.c   |   86 ++++++++++++++++++++++++++++++++++++++++++++++++
 include/amba_clcd.h    |   85 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 172 insertions(+), 0 deletions(-)
 create mode 100644 drivers/video/amba.c
 create mode 100644 include/amba_clcd.h

Could you please check the status of this patch? Thanks.

Alessandro, can you please try to fix your mailer so it does not insert spaces / new lines into the message ID's, as this seems to prevent gmane from archiving these postings?

Best regards,

Wolfgang Denk

Signature · 4 lines
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: wd at denx.de
I haven't lost my mind -- it's backed up on tape somewhere.
#8 lore raw

PATCH 5/8 lcd: make 16bpp work

In reply to Alessandro Rubini

Dear Alessandro Rubini,

Quoted 22 lines · In message <5d6b28b1993d090ee26fa192c1784739eb12db3f.1255086085.git.rubini@…

From: Alessandro Rubini <[email protected]>

---
 common/lcd.c |   26 ++++++++++++++++++++------
 1 files changed, 20 insertions(+), 6 deletions(-)
common/lcd.c +1 -1
index 4e31618..d05c025 100644
@@ -63,7 +63,7 @@
 /************************************************************************/
 #ifdef CONFIG_LCD_LOGO
 # include <bmp_logo.h>		/* Get logo data, width and height	*/
-# if (CONSOLE_COLOR_WHITE >= BMP_LOGO_OFFSET)
+# if (CONSOLE_COLOR_WHITE >= BMP_LOGO_OFFSET) && (LCD_BPP != LCD_COLOR16)
 #  error Default Color Map overlaps with Logo Color Map
 # endif
 #endif

common/lcd.c static void lcd_drawchars (ushort x, ushort y, uchar *str, int count) · line 248

Quoted 9 lines
common/lcd.c +2 -4
@@ -244,10 +244,12 @@ static void lcd_drawchars (ushort x, ushort y, uchar *str, int count)
 				bits <<= 1;
 			}
 #elif LCD_BPP == LCD_COLOR16
-			for (c=0; c<16; ++c) {
-				*d++ = (bits & 0x80) ?
-						lcd_color_fg : lcd_color_bg;
-				bits <<= 1;
+			{
+				u16 *d = (u16 *)dest;

Please do not declare variables in the middle of the code; move declaration to start of function and avoid the {...} block.

Anatolij, will you pick up this (cleaned up) patch, then?

Best regards,

Wolfgang Denk

Signature · 5 lines
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: wd at denx.de
You got to learn three things. What's  real,  what's  not  real,  and
what's the difference."           - Terry Pratchett, _Witches Abroad_
#5 lore raw

PATCH 3/8 drivers/misc: add stmpe2401 port extender and keypad controller

In reply to Alessandro Rubini

Dear Alessandro Rubini,

Quoted 4 lines · In message <ed1819daf7e13ba4ae675c5ba4c96bb97350ea94.1255086085.git.rubini@…

From: Alessandro Rubini <[email protected]>

...

drivers/misc/stmpe2401.c line 37

Quoted 7 lines
drivers/misc/stmpe2401.c new file +7 -0
+int pe_getreg(int addr, int reg)
+{
+	unsigned char val8 = reg;
+	int ret;
+
+	ret = i2c_read(addr, reg, 1 /* len */, &val8, 1);
+	if (ret < 0) return ret;

Please split:

	if (ret < 0)
		return ret;

Please fix globally in whole patch set.

...

drivers/misc/stmpe2401.c line 70

Quoted 9 lines
drivers/misc/stmpe2401.c new file +9 -0
+int pe_gpio_dir(int addr, int pin, int dir)
+{
+	int regval;
+
+	/* 0 == input, 1 == output */
+	regval = pe_getreg(addr, PE_GPIO_GPDR(pin));
+	if (regval < 0) return regval;
+	regval &= ~PE_GPIO_MASK(pin);
+	if (dir) regval |= PE_GPIO_MASK(pin);

ditto in cases like here.

Please check if you want to run the whole code through lindent or similar.

drivers/misc/stmpe2401.c line 102

Quoted 6 lines
drivers/misc/stmpe2401.c new file +6 -0
+int pe_gpio_set(int addr, int pin, int val)
+{
+	int reg;
+
+	if (val) reg = PE_GPIO_GPSR(pin);
+	else reg = PE_GPIO_GPCR(pin);

Another of the countless cases of inacceptable indentation.

...

Quoted 5 lines
include/stmpe2401.h new file +0 -0
new file mode 100644
index 0000000..fe7691e

...

include/stmpe2401.h line 20

Quoted 6 lines
include/stmpe2401.h new file +6 -0
+#define PE_GPIO_GPMR(gpio)	(0xa4 + PE_GPIO_OFFSET(gpio)) /* monitor */
+#define PE_GPIO_GPCR(gpio)	(0x88 + PE_GPIO_OFFSET(gpio)) /* clear */
+#define PE_GPIO_GPSR(gpio)	(0x85 + PE_GPIO_OFFSET(gpio)) /* set */
+#define PE_GPIO_GPDR(gpio)	(0x8b + PE_GPIO_OFFSET(gpio)) /* direction */
+#define PE_GPIO_GPPUR(gpio)	(0x97 + PE_GPIO_OFFSET(gpio)) /* pull-up */
+#define PE_GPIO_GPPDR(gpio)	(0x9a + PE_GPIO_OFFSET(gpio)) /* pull-down */

Looks as if you want to turn this into a C struct?

include/stmpe2401.h line 43

Quoted 9 lines
include/stmpe2401.h new file +9 -0
+/* keypad controller registers */
+#define PE_KPC_COL		0x60
+#define PE_KPC_ROW_MSB		0x61
+#define PE_KPC_ROW_LSB		0x62
+#define PE_KPC_CTRL_MSB		0x63
+#define PE_KPC_CTRL_LSB		0x64
+#define PE_KPC_DATA0		0x68
+#define PE_KPC_DATA1		0x69
+#define PE_KPC_DATA2		0x6a

Please make this a C struct.

Best regards,

Wolfgang Denk

Signature · 6 lines
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: wd at denx.de
What is wanted is not the will to believe,  but the will to find out,
which is the exact opposite.
		        -- Bertrand Russell, "Skeptical Essays", 1928
#10 lore raw

PATCH 6/8 nhk8815: added keypad

In reply to Alessandro Rubini

Dear Alessandro Rubini,

Quoted 4 lines · In message <5a9bb8fb15cdb47d2ccd77af62f759ed493de944.1255086085.git.rubini@…

From: Alessandro Rubini <[email protected]>

Please see previous comments about coding style.

Additionally:

board/st/nhk8815/keypad.c line 82

Quoted 3 lines
board/st/nhk8815/keypad.c new file +3 -0
+int nhk8815_keypad_init(void)
+{
+        struct stdio_dev dev;

Indentation by TAB only, please.

board/st/nhk8815/keypad.c line 84

Quoted 1 line
board/st/nhk8815/keypad.c new file +1 -0
+	printf("%s:%s\n", __FILE__, __func__);

Guess this should be debug() instead?

Best regards,

Wolfgang Denk

Signature · 5 lines
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: wd at denx.de
As long as we're going to reinvent the wheel again, we might as  well
try making it round this time.                        - Mike Dennison
#13 lore raw

PATCH 7/8 nhk8815: start lower in RAM, so the 800x480 frame buffer fits

In reply to Alessandro Rubini

Dear Alessandro Rubini,

Quoted 1 line · In message <13e66c1b362688fc77332fc0c9519567214ca6a2.1255086085.git.rubini@…

From: Alessandro Rubini <[email protected]>

...

board/st/nhk8815/config.mk line 22

Quoted 2 lines
board/st/nhk8815/config.mk +1 -1
-TEXT_BASE = 0x03F80000
+# A display of 800x480x4 takes almost 2MB, so we must be lower than that.

x4 ? 4bpp or what?

I cannot parse this. And even at 32bpp (= 4 byte per pixel) this gives only 1.5 MiB ?

Best regards,

Wolfgang Denk

Signature · 5 lines
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: wd at denx.de
Applying computer technology is simply finding the  right  wrench  to
pound in the correct screw.
#15 lore raw

PATCH 8/8 nhk8815: added lcd support

In reply to Alessandro Rubini

Dear Alessandro Rubini,

Quoted 1 line · In message <109a8c9f77c98641a8a02c4346cd2c7d2cc6794f.1255086085.git.rubini@…

From: Alessandro Rubini <[email protected]>

...

board/st/nhk8815/lcd.c line 62

Quoted 4 lines
board/st/nhk8815/lcd.c new file +4 -0
+void lcd_enable(void)
+{
+	printf("%s:%s\n", __FILE__, __func__);
+	int i;

Please no declarations in the middle of code.

And probably this should be debug() instead of printf() ?

board/st/nhk8815/lcd.c line 78

Quoted 4 lines
board/st/nhk8815/lcd.c new file +4 -0
+int nhk8815_backlight_on(void)
+{
+	printf("%s:%s\n", __FILE__, __func__);
+	int i;

Ditto, 2x.

board/st/nhk8815/nhk8815.c int board_eth_init(bd_t *bis) · line 110

Quoted 9 lines
board/st/nhk8815/nhk8815.c +1 -0
index efeb0d2..ded7681 100644
@@ -107,6 +107,7 @@ int board_eth_init(bd_t *bis)
 #endif
 
 extern int nhk8815_keypad_init(void);		/* ./keypad.c */
+extern int nhk8815_backlight_on(void);		/* in ./lcd.c */

Please move prototype decl;arations to some header file.

Best regards,

Wolfgang Denk

Signature · 6 lines
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: wd at denx.de
"There's only one kind of woman ..." "Or man, for  that  matter.  You
either believe in yourself or you don't."
	-- Kirk and Harry Mudd, "Mudd's Women", stardate 1330.1
#11 lore raw

PATCH 6/8 nhk8815: added keypad

In reply to Wolfgang Denk

Hello Wolfgang.

Thanks for looking at my patch-set.

Quoted 3 lines

board/st/nhk8815/keypad.c line 84

Quoted 1 line
board/st/nhk8815/keypad.c new file +1 -0
+	printf("%s:%s\n", __FILE__, __func__);

Guess this should be debug() instead?

Actually, this was meant to be removed in final code. As explained in the 0/8 message, this patch set was mainly and RFC, as some of the stuff looked questionable to me. So I chose to post my current status to get some comments on the approach, not on the details which I know were just work in progress, though working on real hardware.

So, unless there are serious issues, I'll clean up my current tree, add comments to each patch and repost as V2.

thanks
/alessandro

#16 lore raw

PATCH 8/8 nhk8815: added lcd support

In reply to Wolfgang Denk

I'm almost done with the requested changes on this patch set, will post V2 this evening after re-running ./makeall as needed.

I've a question, though:

Quoted 3 lines
Quoted 1 line

+extern int nhk8815_backlight_on(void); /* in ./lcd.c */

Please move prototype decl;arations to some header file.

Unfortunately, there is no suitable file. It's just that I split code related to different drivers in different files, for better housekeeping. These two are called nhk8815-something as they are board-specific anyways.

Should I create a local header file in this same board directory, with just the two prototypes? Or "ifndef __ASSEMBLY__ in the board config file is better? I'd better ask first to avoid a V3 just for this detail.

Thanks
/alessandro