From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Burton Date: Mon, 11 Nov 2013 10:36:45 +0000 Subject: [U-Boot] [PATCH v3 10/18] malta: display "U-boot" on the LCD screen In-Reply-To: <201311102108.17360.marex@denx.de> References: <1383909539-29929-1-git-send-email-paul.burton@imgtec.com> <1383909539-29929-11-git-send-email-paul.burton@imgtec.com> <201311102108.17360.marex@denx.de> Message-ID: <5280B33D.2010708@imgtec.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 10/11/13 20:08, Marek Vasut wrote: > Dear Paul Burton, > >> Displaying a message on the LCD screen is a simple yet effective way to >> show the user that the board has booted successfully. >> >> Signed-off-by: Paul Burton >> --- >> Changes in v3: >> - rebase atop master >> >> Changes in v2: >> - rebased after malta moved to board/imgtec/malta >> --- >> arch/mips/include/asm/malta.h | 10 ++++++++++ >> board/imgtec/malta/malta.c | 19 +++++++++++++++++++ >> 2 files changed, 29 insertions(+) >> >> diff --git a/arch/mips/include/asm/malta.h b/arch/mips/include/asm/malta.h >> index 0b50a66..d8ec57c 100644 >> --- a/arch/mips/include/asm/malta.h >> +++ b/arch/mips/include/asm/malta.h >> @@ -32,6 +32,16 @@ >> #define MALTA_MSC01_PCIIO_MAP 0x00000000 >> #define MALTA_MSC01_UART0_BASE (MALTA_MSC01_PCIIO_BASE + 0x3f8) >> >> +#define MALTA_ASCIIWORD 0x1f000410 >> +#define MALTA_ASCIIPOS0 0x1f000418 >> +#define MALTA_ASCIIPOS1 0x1f000420 >> +#define MALTA_ASCIIPOS2 0x1f000428 >> +#define MALTA_ASCIIPOS3 0x1f000430 >> +#define MALTA_ASCIIPOS4 0x1f000438 >> +#define MALTA_ASCIIPOS5 0x1f000440 >> +#define MALTA_ASCIIPOS6 0x1f000448 >> +#define MALTA_ASCIIPOS7 0x1f000450 >> + >> #define MALTA_RESET_BASE 0x1f000500 >> #define GORESET 0x42 >> >> diff --git a/board/imgtec/malta/malta.c b/board/imgtec/malta/malta.c >> index 2af0067..119546a 100644 >> --- a/board/imgtec/malta/malta.c >> +++ b/board/imgtec/malta/malta.c >> @@ -29,6 +29,24 @@ enum sys_con { >> SYSCON_MSC01, >> }; >> >> +static void malta_lcd_puts(const char *str) >> +{ >> + int i; >> + void *reg = (void *)CKSEG1ADDR(MALTA_ASCIIPOS0); >> + >> + /* print up to 8 characters of the string */ >> + for (i = 0; i < min(strlen(str), 8); i++) { >> + __raw_writel(str[i], reg); >> + reg += MALTA_ASCIIPOS1 - MALTA_ASCIIPOS0; >> + } >> + >> + /* fill the rest of the display with spaces */ >> + for (; i < 8; i++) { >> + __raw_writel(' ', reg); >> + reg += MALTA_ASCIIPOS1 - MALTA_ASCIIPOS0; >> + } >> +} >> + >> static enum core_card malta_core_card(void) >> { >> u32 corid, rev; >> @@ -71,6 +89,7 @@ int checkboard(void) >> { >> enum core_card core; >> >> + malta_lcd_puts("U-boot"); >> puts("Board: MIPS Malta"); >> >> core = malta_core_card(); > > Can this not be implemented as a regular framebuffer console maybe? > > Best regards, > Marek Vasut > We're talking about an 8 character segmented LCD display here - it's not something you can draw (non-ASCII) graphics on, nor something you want to be interacting with even if you hooked up some input. Thanks, Paul