Example #1
0
// LCD configuration
//
static void lcd_config(void)
{
	u32 ident_lcd 	= 0;

	ident_lcd |= 1;
	printf("LCD panel %x: %s\n", ident_lcd,
								 (ident_lcd == 0)?"WINTEK 4.3 controlled via 3-wire":
								 (ident_lcd == 1)?"S070WV95 7\"":
								 (ident_lcd == 2)?"Dastek 4.3":"unknown");

	ident_lcd	+= 'A';
	set_lcd_env(ident_lcd);

	omap_request_gpio(164); // power on display buffer
	omap_request_gpio(104); // enable display buffer

	omap_set_gpio_dataout(164, 1);
	omap_set_gpio_direction(164, 0);
	omap_set_gpio_dataout(104, 0);
	omap_set_gpio_direction(104, 0);

	omap_free_gpio(104);
	omap_free_gpio(164);

	drv_lcd_init(); // initialize LCD interface
	printf("%s: done\n", __func__);
}
Example #2
0
int devices_init (void)
{
#ifndef CONFIG_ARM     /* already relocated for current ARM implementation */
	ulong relocation_offset = gd->reloc_off;
	int i;

	/* relocate device name pointers */
	for (i = 0; i < (sizeof (stdio_names) / sizeof (char *)); ++i) {
		stdio_names[i] = (char *) (((ulong) stdio_names[i]) +
						relocation_offset);
	}
#endif

	/* Initialize the list */
	devlist = ListCreate (sizeof (device_t));

	if (devlist == NULL) {
		eputs ("Cannot initialize the list of devices!\n");
		return -1;
	}
#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
	i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE);
#endif
#if defined(CONFIG_DRV_BOARD_INIT)
    drv_board_init();
#endif
#ifdef CONFIG_LCD
	drv_lcd_init ();
#endif
#if defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE)
	drv_video_init ();
#endif
#ifdef CONFIG_KEYBOARD
	drv_keyboard_init ();
#endif
#ifdef CONFIG_LOGBUFFER
	drv_logbuff_init ();
#endif
	drv_system_init ();
#ifdef CONFIG_SERIAL_MULTI
	serial_devices_init ();
#endif
#ifdef CONFIG_USB_TTY
	drv_usbtty_init ();
#endif
#ifdef CONFIG_NETCONSOLE
	drv_nc_init ();
#endif

	return (0);
}
int main (void)
{
  char lcd_string[20];

  drv_lcd_open();
  drv_lcd_init();
 
  drv_lcd_cursor(LCD_TOGGLE_OFF);
  drv_lcd_cursor_blink(LCD_TOGGLE_OFF);

/*
  strcpy (lcd_string, "tEsTe aBcDeFg");
  drv_lcd_write(2, 1, lcd_string, strlen(lcd_string));
 
  printf ("LCD TEST APPLICATION - message printed on LCD module:''%s'' \n", lcd_string);
*/

  strcpy (lcd_string, "A VIDA EH SURF...");
  drv_lcd_write(2, 3, lcd_string, strlen(lcd_string));
  strcpy (lcd_string, "O RESTO EH ONDA!  ");
  drv_lcd_write(3, 3, lcd_string, strlen(lcd_string));

  drv_lcd_close();
}
/*
 * USB boot routine
 *
 * Desc: usb boot.
 * Retn: 0 for success, -1 for error.
 */
int usb_boot(unsigned zero, unsigned type, unsigned tags)
{
#ifdef DEBUG
	serial_puts_info("Usb_boot:  In function of usb_boot ...\n");
#endif
	/* see all of files in android-1.5r2/bootable/bootloader/legacy/usbloader */
	unsigned long ram_size;
	unsigned long addr;

	 USB_STATUS status = {NULL, {0, 0}, 0, 0, 0};
         int usb_last_stat;

	/* must do this before board_init() so that we
        ** use the partition table in the tags if it 
        ** already exists 
        */
	linux_type = board_machtype();
	linux_tags = 0;
#ifdef DEBUG	
	serial_puts_info("Usb_boot:  Board init ...\n");
#endif
	board_init();
	ram_size = initdram(0);
/*test*/
    if (ram_size > EMC_LOW_SDRAM_SPACE_SIZE)
                ram_size = EMC_LOW_SDRAM_SPACE_SIZE;
/*test*/
	addr = CFG_SDRAM_BASE + ram_size;

	/* We can reserve some RAM "on top" here. */
	/* round down to next 4 kB limit. */
	addr &= ~(4096 - 1);
#ifdef DEBUG
	serial_puts_info("Usb_boot:  Lcd_setmem ...\n");
#endif
	addr = lcd_setmem(addr);
	fb_base = addr;
#ifdef DEBUG
	serial_puts_info("Usb_boot:  Drv_lcd_init ...\n");
#endif
	drv_lcd_init();
	lcd_console_init();
	
#if 0
	memset(print_buf, 0, PRINT_BUF_MAX);
	strcpy(print_buf, "123456:USB FastBoot:bbb");
	lcd_puts(print_buf);
	memset(print_buf, 0, PRINT_BUF_MAX);
	cprintf(print_buf, ":ABC%dEFG:a\rabc",3);
	lcd_puts(print_buf);
#endif

#if 1
	memset(print_buf, '\0', PRINT_BUF_MAX);
	cprintf(print_buf, "USB FastBoot:  V %s\n", FAST_BOOT_VERSION);
	lcd_puts(print_buf);

	memset(print_buf, '\0', PRINT_BUF_MAX);
	cprintf(print_buf, "Machine ID:    %d v %d\n", linux_type, revision);
	lcd_puts(print_buf);
	
	memset(print_buf, '\0', PRINT_BUF_MAX);
	cprintf(print_buf, "Build Date:    "__DATE__", "__TIME__"\n");
	lcd_puts(print_buf);

	/* memset(print_buf, '\0', PRINT_BUF_MAX); */
	/* cprintf(print_buf, "Serial Number: %s\n", "UNKNOWN"); */
	/* lcd_puts(print_buf); */
#endif

#if 1
	serial_puts_msg("\nUSB FastBoot: V ");
	serial_puts_msg(FAST_BOOT_VERSION);
	serial_puts_msg(" \n");

	serial_puts_msg("Machine ID: ");
	dump_uint(linux_type);
	serial_puts_msg("  v ");
	dump_uint(revision);
	serial_puts_msg(" \n");

	serial_puts_msg("Build Date: ");
	serial_puts_msg(__DATE__);
	serial_puts_msg("  ");
	serial_puts_msg(__TIME__);
	serial_puts_msg("\n");
	
	serial_puts_msg("Serial Number: ");
	if (serialno[0])
		serial_puts_msg(serialno);
	else
		serial_puts_msg("UNKNOWN\n");
#endif
	flash_dump_ptn();
	jz4780_usbloader_init();
        usb_last_stat = 1;

	for(;;) {
            /* if(__usb_detected()) { */
            /*     if(usb_last_stat == 0) { */
            /*         serial_puts("USB status:   ONLINE\n"); */
            /*         memset(print_buf, 0, PRINT_BUF_MAX); */
            /*         cprintf(print_buf, "\rUSB status:   ONLINE"); */
            /*         lcd_puts(print_buf); */
            /*     } */
            /*     usb_last_stat = 1; */
            /* } else { */
            /*     if(usb_last_stat == 1) { */
            /*         serial_puts("USB status:   OFFLINE\n"); */
            /*         memset(print_buf, 0, PRINT_BUF_MAX); */
            /*         cprintf(print_buf, "\rUSB status:  OFFLINE"); */
            /*         lcd_puts(print_buf); */
            /*     } */
            /*     usb_last_stat = 0; */
            /* } */
            jz4780_usb_poll(&status);
	}
	
	return 0;
}