Skip to contentSkip to conversation

ARM: driver for the character LCD found in ARM refdesigns

PATCH New Linus Walleij 6 participants 9 messages Jul 6, 2010 – Jul 16, 2010 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 ARM: driver for the character LCD found in ARM refdesigns

This adds a driver for the character LCD found on the ARM Versatile and RealView Platform Baseboards. It doesn't do very much more than display the text "ARM Linux" on the first line and the linux banner on the second line, but that's still useful.

---
Submission notes:

This hardware does not have PrimeCell IDs so it has to be a platform driver.

The 4bit mode is the only one that seems to work. I tried putting the display into 8bit mode and failed miserably.

The IRQ is stated in the reference manual as "don't use" because it is "reserved for future use" but I implemented it anyway. I interpret future use as "future reference boards" and the driver is written in such a way that it will fall back on polling if no IRQ is supplied, so just don't supply the IRQ for platforms that don't have it and the driver will poll instead.

---
 arch/arm/common/Kconfig    |    3 +
 arch/arm/common/Makefile   |    1 +
 arch/arm/common/char-lcd.c |  396 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 400 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/common/char-lcd.c
arch/arm/common/Kconfig +3 -0
index 0a34c81..f6b4837 100644
@@ -12,6 +12,9 @@ config ARM_VIC_NR
 	  The maximum number of VICs available in the system, for
 	  power management.
 
+config ARM_CHAR_LCD
+	bool
+
 config ICST
 	bool
 
arch/arm/common/Makefile +1 -0
index e6e8664..89ff2ee 100644
@@ -4,6 +4,7 @@
 
 obj-$(CONFIG_ARM_GIC)		+= gic.o
 obj-$(CONFIG_ARM_VIC)		+= vic.o
+obj-$(CONFIG_ARM_CHAR_LCD)	+= char-lcd.o
 obj-$(CONFIG_ICST)		+= icst.o
 obj-$(CONFIG_PL330)		+= pl330.o
 obj-$(CONFIG_SA1111)		+= sa1111.o
arch/arm/common/char-lcd.c new file +396 -0

396 lines not on this page · raw message

Signature · 1 line
1.7.0.1
#1 lore raw

PATCH 1/3 ARM: driver for the character LCD found in ARM refdesigns

Quoted 10 lines

-----Original Message-----
kernel-bounces at lists.infradead.org] On Behalf Of Linus Walleij

This adds a driver for the character LCD found on the ARM Versatile and RealView Platform Baseboards. It doesn't do very much more than display the text "ARM Linux" on the first line and the linux banner on the second line, but that's still useful.

The 4bit mode is the only one that seems to work. I tried putting the display into 8bit mode and failed miserably.

I've had a check with the hardware guys. Our self-test software uses the 4-bit mode, the 8-bit mode is untested.

Quoted 2 lines

The IRQ is stated in the reference manual as "don't use" because it is "reserved for future use" but I implemented it anyway.

The answer seems to be that "future use" means "for an OS".

Colin

--
Colin Tuckley - ARM Ltd.
110 Fulbourn Rd
Cambridge, CB1 9NJ
Tel: +44 1223 400536

-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

#2 lore raw

PATCH 1/3 ARM: driver for the character LCD found in ARM refdesigns

2010/7/7 Colin Tuckley <[email protected]>:

Quoted 5 lines
Quoted 2 lines

The 4bit mode is the only one that seems to work. I tried putting the display into 8bit mode and failed miserably.

I've had a check with the hardware guys. Our self-test software uses the 4-bit mode, the 8-bit mode is untested.

OK I can make another round. I modeled the 4bit mode after the ROM selftest actually.

The phenomenon is like commands go through in 8bit but not characters, so whatever you write into CHAR_DAT only the 4 higher bits go through, often with the effect of letters like "@@@@@" in the display (if you write something with big letters).

Quoted 4 lines
Quoted 2 lines

The IRQ is stated in the reference manual as "don't use" because it is "reserved for future use" but I implemented it anyway.

The answer seems to be that "future use" means "for an OS".

Aha OK, then it's all mine! :-)

Yours,
Linus Walleij

#3 lore raw

PATCH 1/3 ARM: driver for the character LCD found in ARM refdesigns

In reply to Linus Walleij
Quoted 4 lines · Linus Walleij

This adds a driver for the character LCD found on the ARM Versatile and RealView Platform Baseboards. It doesn't do very much more than display the text "ARM Linux" on the first line and the linux banner on the second line, but that's still useful.

I think the only questionable thing on this is the location of the driver. As we now have plat-versatile for the shared stuff between integrator, verastile, realview and versatile express, maybe it'd make more sense to be in plat-versatile?

Or maybe drivers/platform/arm/ (to avoid Linus' complaint about drivers under arch/ ?)

#4 lore raw

PATCH 1/3 ARM: driver for the character LCD found in ARM refdesigns

2010/7/15 Russell King - ARM Linux <[email protected]>:

Quoted 11 lines · Linus Walleij
Quoted 5 lines

This adds a driver for the character LCD found on the ARM Versatile and RealView Platform Baseboards. It doesn't do very much more than display the text "ARM Linux" on the first line and the linux banner on the second line, but that's still useful.

I think the only questionable thing on this is the location of the driver. ?As we now have plat-versatile for the shared stuff between integrator, verastile, realview and versatile express, maybe it'd make more sense to be in plat-versatile?

OK I can move it there.

Quoted 2 lines

Or maybe drivers/platform/arm/ (to avoid Linus' complaint about drivers under arch/ ?)

Creating that for a single driver seems weird, I could just as well create drivers/lcd for all LCDs in that case. But there is another LCD-like driver for a USB-connected LCD under drivers/misc IIRC, maybe I can make a patch for that as well and let the misc maintainer decide if he wants it.

Yours,
Linus Walleij

#5 lore raw

PATCH 1/3 ARM: driver for the character LCD found in ARM refdesigns

Quoted 8 lines · Linus Walleij

2010/7/15 Russell King - ARM Linux <[email protected]>:

Quoted 4 lines

I think the only questionable thing on this is the location of the driver. ?As we now have plat-versatile for the shared stuff between integrator, verastile, realview and versatile express, maybe it'd make more sense to be in plat-versatile?

OK I can move it there.

Quoted 8 lines
Quoted 2 lines

Or maybe drivers/platform/arm/ (to avoid Linus' complaint about drivers under arch/ ?)

Creating that for a single driver seems weird, I could just as well create drivers/lcd for all LCDs in that case. But there is another LCD-like driver for a USB-connected LCD under drivers/misc IIRC, maybe I can make a patch for that as well and let the misc maintainer decide if he wants it.

My first preference would be somewhere under drivers/, if not then plat-versatile. So if you think drivers/misc would be suitable, please try the misc maintainer.

#6 lore raw

PATCH 1/3 ARM: driver for the character LCD found in ARM refdesigns

Quoted 18 lines · Russell King
Quoted 8 lines · Linus Walleij

2010/7/15 Russell King - ARM Linux <[email protected]>:

Quoted 4 lines

I think the only questionable thing on this is the location of the driver. ?As we now have plat-versatile for the shared stuff between integrator, verastile, realview and versatile express, maybe it'd make more sense to be in plat-versatile?

OK I can move it there.

Quoted 8 lines
Quoted 2 lines

Or maybe drivers/platform/arm/ (to avoid Linus' complaint about drivers under arch/ ?)

Creating that for a single driver seems weird, I could just as well create drivers/lcd for all LCDs in that case. But there is another LCD-like driver for a USB-connected LCD under drivers/misc IIRC, maybe I can make a patch for that as well and let the misc maintainer decide if he wants it.

Quoted 3 lines

My first preference would be somewhere under drivers/, if not then plat-versatile. So if you think drivers/misc would be suitable, please try the misc maintainer.

drivers/auxdisplay ?

Regards,
Hartley

#7 lore raw

PATCH 1/3 ARM: driver for the character LCD found in ARM refdesigns

In reply to Linus Walleij
Quoted 8 lines · Linus Walleij
Quoted 2 lines

Or maybe drivers/platform/arm/ (to avoid Linus' complaint about drivers under arch/ ?)

Creating that for a single driver seems weird, I could just as well create drivers/lcd for all LCDs in that case. But there is another LCD-like driver for a USB-connected LCD under drivers/misc IIRC, maybe I can make a patch for that as well and let the misc maintainer decide if he wants it.

Most drivers are in directories based on the software interface, but as you explained, the driver does not interface with anything so far.

Other display drivers are under drivers/video. If it makes sense to use the display as the console, you could put it in drivers/video/console/. Another option would be to make it a tty and move it to driver/char.

Arnd

#8 lore raw

PATCH 1/3 ARM: driver for the character LCD found in ARM refdesigns

Quoted 10 lines · Arnd Bergmann
Quoted 8 lines · Linus Walleij
Quoted 2 lines

Or maybe drivers/platform/arm/ (to avoid Linus' complaint about drivers under arch/ ?)

Creating that for a single driver seems weird, I could just as well create drivers/lcd for all LCDs in that case. But there is another LCD-like driver for a USB-connected LCD under drivers/misc IIRC, maybe I can make a patch for that as well and let the misc maintainer decide if he wants it.

Quoted 7 lines

Most drivers are in directories based on the software interface, but as you explained, the driver does not interface with anything so far.

Other display drivers are under drivers/video. If it makes sense to use the display as the console, you could put it in drivers/video/console/. Another option would be to make it a tty and move it to driver/char.

It's a 2 line by 8 character LCD. I don't think it makes sense for it to be a console or even a tty driver.