Skip to content
This repository was archived by the owner on Jan 8, 2025. It is now read-only.

Commit

Permalink
LK: Add support for splash screen on MSM7627_SURF
Browse files Browse the repository at this point in the history
Moving lcdc.c file from qsd8k and msm7x30 to msm_shared under platform
directory.
  • Loading branch information
Shashank Mittal committed Feb 2, 2010
1 parent 535fa09 commit 4f99a88
Show file tree
Hide file tree
Showing 12 changed files with 66 additions and 156 deletions.
35 changes: 31 additions & 4 deletions app/aboot/aboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2009, Google Inc.
* All rights reserved.
*
* Copyright (c) 2009, Code Aurora Forum. All rights reserved.
* Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
Expand Down Expand Up @@ -41,6 +41,7 @@
#include <dev/flash.h>
#include <lib/ptable.h>
#include <dev/keys.h>
#include <dev/fbcon.h>

#include "bootimg.h"
#include "fastboot.h"
Expand Down Expand Up @@ -187,7 +188,7 @@ int boot_linux_from_flash(void)
struct ptable *ptable;
unsigned offset = 0;
const char *cmdline;

struct fbcon_config *fb_display = NULL;

if (target_is_emmc_boot()) {
hdr = (struct boot_img_hdr *)EMMC_BOOT_IMG_HEADER_ADDR;
Expand All @@ -204,6 +205,22 @@ int boot_linux_from_flash(void)
return -1;
}

#if DISPLAY_SPLASH_SCREEN
ptn = ptable_find(ptable, "splash");
if (ptn == NULL) {
dprintf(CRITICAL, "ERROR: No splash partition found\n");
} else {
fb_display = fbcon_display();
if (fb_display) {
if (flash_read(ptn, 0, fb_display->base,
(fb_display->width * fb_display->height * fb_display->bpp/8))) {
fbcon_clear();
dprintf(CRITICAL, "ERROR: Cannot read splash image\n");
}
}
}
#endif

if(!boot_into_recovery)
{
ptn = ptable_find(ptable, "boot");
Expand Down Expand Up @@ -397,7 +414,13 @@ void cmd_reboot_bootloader(const char *arg, void *data, unsigned sz)

void aboot_init(const struct app_descriptor *app)
{
unsigned reboot_mode = 0;
unsigned reboot_mode = 0;
unsigned disp_init = 0;
#if DISPLAY_SPLASH_SCREEN
display_init();
dprintf(INFO, "Diplay initialized\n");
disp_init = 1;
#endif
page_size = flash_page_size();
page_mask = page_size - 1;
if (keys_get_state(KEY_HOME) != 0)
Expand All @@ -419,7 +442,11 @@ void aboot_init(const struct app_descriptor *app)
"to fastboot mode.\n");

fastboot:
display_init();
if(!disp_init) {
display_init();
} else {
fbcon_clear();
}
dprintf(INFO, "Diplay initialized\n");
udc_init(&surf_udc_device);

Expand Down
9 changes: 8 additions & 1 deletion dev/fbcon/fbcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Copyright (c) 2008, Google Inc.
* All rights reserved.
*
* Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
Expand Down Expand Up @@ -109,7 +111,7 @@ static void fbcon_scroll_up(void)
}

/* TODO: take stride into account */
static void fbcon_clear(void)
void fbcon_clear(void)
{
uint16_t *dst = config->base;
unsigned count = config->width * config->height;
Expand Down Expand Up @@ -197,3 +199,8 @@ void fbcon_setup(struct fbcon_config *_config)
max_pos.x = config->width / (FONT_WIDTH+1);
max_pos.y = (config->height - 1) / FONT_HEIGHT;
}

struct fbcon_config* fbcon_display(void)
{
return config;
}
4 changes: 4 additions & 0 deletions include/dev/fbcon.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Copyright (c) 2008, Google Inc.
* All rights reserved.
*
* Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
Expand Down Expand Up @@ -45,5 +47,7 @@ struct fbcon_config {

void fbcon_setup(struct fbcon_config *cfg);
void fbcon_putc(char c);
void fbcon_clear(void);
struct fbcon_config* fbcon_display(void);

#endif /* __DEV_FBCON_H */
7 changes: 7 additions & 0 deletions platform/msm7k/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Copyright (c) 2008, Google Inc.
* All rights reserved.
*
* Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
Expand Down Expand Up @@ -71,4 +73,9 @@ void display_init(void)
ASSERT(fb_config);
fbcon_setup(fb_config);
#endif
#if DISPLAY_TYPE_LCDC
fb_config = lcdc_init();
ASSERT(fb_config);
fbcon_setup(fb_config);
#endif
}
3 changes: 1 addition & 2 deletions platform/msm7x30/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ OBJS += \
$(LOCAL_DIR)/platform.o \
$(LOCAL_DIR)/interrupts.o \
$(LOCAL_DIR)/gpio.o \
$(LOCAL_DIR)/acpuclock.o \
$(LOCAL_DIR)/lcdc.o
$(LOCAL_DIR)/acpuclock.o

LINKER_SCRIPT += $(BUILDDIR)/system-onesegment.ld

Expand Down
1 change: 1 addition & 0 deletions platform/msm7x30/lcdc.c → platform/msm_shared/lcdc.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,4 @@ struct fbcon_config *lcdc_init(void)

return &fb_cfg;
}

3 changes: 2 additions & 1 deletion platform/msm_shared/rules.mk
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ OBJS += \
$(LOCAL_DIR)/hsusb.o \
$(LOCAL_DIR)/jtag_hook.o \
$(LOCAL_DIR)/jtag.o \
$(LOCAL_DIR)/nand.o
$(LOCAL_DIR)/nand.o \
$(LOCAL_DIR)/lcdc.o

142 changes: 0 additions & 142 deletions platform/qsd8k/lcdc.c

This file was deleted.

3 changes: 1 addition & 2 deletions platform/qsd8k/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ OBJS += \
$(LOCAL_DIR)/platform.o \
$(LOCAL_DIR)/interrupts.o \
$(LOCAL_DIR)/gpio.o \
$(LOCAL_DIR)/acpuclock.o \
$(LOCAL_DIR)/lcdc.o
$(LOCAL_DIR)/acpuclock.o

LINKER_SCRIPT += $(BUILDDIR)/system-onesegment.ld

Expand Down
2 changes: 1 addition & 1 deletion project/msm7627_surf.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ MODULES += app/aboot

#DEFINES += WITH_DEBUG_DCC=1
#DEFINES += WITH_DEBUG_UART=1
#DEFINES += WITH_DEBUG_FBCON=1
DEFINES += WITH_DEBUG_FBCON=1
11 changes: 8 additions & 3 deletions target/msm7627_surf/init.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2009, Google Inc.
* All rights reserved.
* Copyright (c) 2009, Code Aurora Forum. All rights reserved.
* Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -65,12 +65,17 @@ static struct ptentry board_part_list[] = {
.name = "system",
},
{
.start = 720,
.start = 720,
.length = 8,
.name = "splash",
},
{
.start = 728,
.length = 40 /* 5MB */,
.name = "cache",
},
{
.start = 760,
.start = 768,
.length = VARIABLE_LENGTH,
.name = "userdata",
},
Expand Down
2 changes: 2 additions & 0 deletions target/msm7627_surf/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ SCRATCH_ADDR := BASE_ADDR+0x02008000
KEYS_USE_GPIO_KEYPAD := 1

DEFINES += DISPLAY_TYPE_MDDI=0
DEFINES += DISPLAY_TYPE_LCDC=1
DEFINES += DISPLAY_SPLASH_SCREEN=0

MODULES += \
dev/keys \
Expand Down

0 comments on commit 4f99a88

Please sign in to comment.