📄 board-init.c
字号:
/***************************************** Copyright (c) 2002-2007 Sigma Designs, Inc. All Rights Reserved Proprietary and Confidential *****************************************/#include "../config.h"#include "../uart.h"#include "../util.h"#include "../vsprintf.h"#include "../io.h"#include "../em86xxapi.h"#include "hardware.h" /* PMP_8628 definition *//* Board specific initialization routine */int board_init(void){ uart_puts("Configuring RCLKOUT\n"); __raw_writel(0x01070014, REG_BASE_SYSTEM + SYS_clkgen2_pll); __raw_writel(0x00000202, REG_BASE_SYSTEM + SYS_clkgen2_div); __raw_writel(0x0C000000, REG_BASE_SYSTEM + SYS_avclk_mux);#if defined(CONFIG_ENABLE_IRQHANDLER) && defined(CONFIG_ENABLE_BITMAPS) && defined (CONFIG_ENABLE_VSYNCPARAM) /* leave display on, we show splashscreen right away anyway */#else /* don't display garbage, so disable lcd interface till gui comes up */ uart_puts("Disabling LCD\n"); #ifdef PMP_8628 em86xx_gpio_write(32, 0); /* LED_SET */ em86xx_usleep(500); /* follow power on/off sequence described on page 19 of lcd datasheet LTP400WQ-F01 */ em86xx_msleep(160/4); em86xx_gpio_write(30, 0); /* LCD_DISP */ em86xx_msleep(50/2); em86xx_gpio_write(25, 0); /* LCD5V_ON */ em86xx_msleep(50/2); __raw_writel(0x7F6E, 0x6c138); /* uart0: change dtr, rts, dcd, dsr, cts to gpio */ __raw_writel(0x0800, 0x6c134); /* put uart0 dcd/gpio3 low */ __raw_writel(0x0808, 0x6c130); /* uart0 dcd output */ em86xx_msleep(50/2); em86xx_gpio_write(29, 0); /* LCD2V6_ON */ #else /* turn off backlight (LED_PWM) */ __raw_writel(0x107FFFF, 0x10510); /* just turn off lcd interface, everything else is hardware logic */ __raw_writel(0x7F6E, 0x6c138); /* uart0: change dtr, rts, dcd, dsr, cts to gpio */ __raw_writel(0x0800, 0x6c134); /* put uart0 dcd/gpio3 low */ __raw_writel(0x0808, 0x6c130); /* uart0 dcd output */ #endif#endif#ifdef PMP_8628 /* do PCI reset */ uart_puts("Resetting PCI\n"); em86xx_msleep(100); em86xx_gpio_write(26, 1); /* make sure bit is initialized to output in config file */#endif /* add delay for PCI reset */ uart_puts("Waiting for PCI reset\n"); em86xx_msleep(10); /* do hdd hardware reset */ uart_puts("Resetting HDD\n"); em86xx_gpio_write(14, 1); em86xx_msleep(1); em86xx_gpio_write(14, 0); em86xx_msleep(1); em86xx_gpio_write(14, 1);#ifndef PMP_8620 /* power down samsung wlan module by default to save power */ uart_puts("Powering down WLAN module\n"); em86xx_gpio_write(7, 0); /* make sure bit is initialized to output in config file */#endif return(0);}#if defined(CONFIG_ENABLE_IRQHANDLER) && defined(CONFIG_ENABLE_BITMAPS) && defined (CONFIG_ENABLE_VSYNCPARAM)/* Board specific initialization routine for screen */int board_splashscreen_init(void){#ifndef CONFIG_BOOT_2NDBOOT /* enable lcd interface */ uart_puts("Enabling LCD for splashscreen\n"); #ifdef PMP_8628 /* follow power on/off sequence described on page 19 of lcd datasheet LTP400WQ-F01 */ em86xx_gpio_write(29, 1); /* LCD2V6_ON */ em86xx_msleep(50/2); __raw_writel(0x7F6E, 0x6c138); /* uart0: change dtr, rts, dcd, dsr, cts to gpio */ __raw_writel(0x0808, 0x6c134); /* put uart0 dcd/gpio3 high */ __raw_writel(0x0808, 0x6c130); /* uart0 dcd output */ em86xx_msleep(50/2); em86xx_gpio_write(25, 1); /* LCD5V_ON */ em86xx_msleep(50/2); em86xx_gpio_write(30, 1); /* LCD_DISP */ em86xx_msleep(240); /* 160 is not enough */ /* turn on backlight to normal */ em86xx_gpio_write(31, 1); /* LED_SEL */ { int i = 5; /* we could also do 15 and LED_SET to 0 for 0.4 volt */ while(i--) { /* output level_new rising edges */ em86xx_gpio_write(32, 1); /* LED_SET */ em86xx_usleep(50); em86xx_gpio_write(32, 0); /* LED_SET */ em86xx_usleep(50); } em86xx_gpio_write(32, 1); /* LED_SET, wait latch time */ em86xx_usleep(500); } #else /* just turn on lcd interface, everything else is hardware logic */ __raw_writel(0x7F6E, 0x6c138); /* uart0: change dtr, rts, dcd, dsr, cts to gpio */ __raw_writel(0x0808, 0x6c134); /* put uart0 dcd/gpio3 high */ __raw_writel(0x0808, 0x6c130); /* uart0 dcd output */ /* turn on backlight to normal */ __raw_writel(0x1073000, 0x10510); #endif#endif return(0);}#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -