return mach_is_aquila() && (board_rev & LIMO_REAL_BOARD);
}
+static int board_is_bamboo(void)
+{
+ return mach_is_aquila() && (board_rev & BAMBOO_BOARD);
+}
+
static int board_is_media(void)
{
return mach_is_aquila() && (board_rev & MEDIA_BOARD);
return mach_is_kessler() && (board_rev & NEPTUNE_BOARD);
}
+static int board_is_s1(void)
+{
+ return mach_is_kessler() && (board_rev & S1_BOARD);
+}
+
/* DLNA Dongle */
static int mach_is_wmg160(void)
{
}
static void check_battery(int mode);
+static void check_micro_usb(int intr);
void i2c_init_board(void)
{
i2c_gpio_init(i2c_gpio, num_bus, I2C_PMIC);
+ /* Reset on fsa9480 early */
+ check_micro_usb(1);
/* Reset on max17040 early */
if (battery_soc == 0)
check_battery(1);
"P1P2", /* Don't remove it */
"Geminus",
"Cypress",
- "Neptune",
+ "Limo SDK",
};
enum {
name = "Bamboo";
} else if (board == MACH_KESSLER) {
if (board_rev & NEPTUNE_BOARD)
- name = "Neptune";
+ name = "Limo SDK";
if (board_rev & S1_BOARD)
name = "S1";
}
if ((board_rev & 0xf) < 8)
s5pc1xx_set_cpu_rev(0);
}
+ else if (board_is_bamboo())
+ s5pc1xx_set_cpu_rev(0);
} else if (mach_is_kessler()) {
- s5pc1xx_set_cpu_rev(1);
+ if (board_is_neptune() && hwrevision(2))
+ s5pc1xx_set_cpu_rev(2); /* EVT1-Fused */
+ else
+ s5pc1xx_set_cpu_rev(1);
} else if (mach_is_geminus()) {
if ((board_rev & 0xf) < 1)
s5pc1xx_set_cpu_rev(0);
s5pc1xx_set_cpu_rev(0);
}
+ if (cpu_is_s5pc110())
+ writel(0xc1100000 | (0xffff & (s5pc1xx_get_cpu_rev() ? 1 : 0)),
+ S5PC110_INFORM3);
+
empty_device_info_buffer();
dprintf("HW Revision:\t%x (%s%s) %s\n",
board_rev, get_board_name(board),
char buf[64];
if (readl(magic_base) == 0x426f6f74) { /* ASICC: Boot */
- printf("Auto burning bootloader\n");
+ puts("Auto burning bootloader\n");
count += sprintf(buf + count, "run updateb; ");
}
if (readl(magic_base + 0x04) == 0x4b65726e) { /* ASICC: Kern */
- printf("Auto burning kernel\n");
+ puts("Auto burning kernel\n");
count += sprintf(buf + count, "run updatek; ");
}
/* volume down */
if (row_state[1] & 0x2)
display_info = 1;
- if (board_is_neptune()) {
+ if (board_is_neptune() && hwrevision(0)) {
/* home & volume down */
if ((row_state[1] & 0x1) && (row_state[1] & 0x2))
auto_download = 1;
+ } else if (board_is_neptune() && hwrevision(2)) {
+ /* cam full shot & volume down */
+ if ((row_state[1] & 0x6) && (row_state[2] & 0x4))
+ auto_download = 1;
} else {
/* cam full shot & volume down */
if ((row_state[0] & 0x1) && (row_state[1] & 0x2))
return;
if (i2c_probe(addr)) {
- printf("Can't found max17040 fuel gauge\n");
+ puts("Can't found max17040 fuel gauge\n");
return;
}
/* set usb path */
if (i2c_probe(addr)) {
- printf("Can't found MHL Chip\n");
+ puts("Can't found MHL Chip\n");
return;
}
i2c_set_bus_num(I2C_PMIC);
if (i2c_probe(addr)) {
- printf("Can't found max8998\n");
+ puts("Can't found max8998\n");
return 1;
}
do {
udelay(1);
reg = readl(&adc->adccon);
- } while (!reg & (1 << 15) && loop++ < 1000);
+ } while (!(reg & (1 << 15)) && (loop++ < 1000));
ret = readl(&adc->adcdat0) & 0xFFF;
sprintf(buf, "pmic ldo %d off", ldonum);
return;
if (!enable) {
- printf("Disable the charger.\n");
+ puts("Disable the charger.\n");
i2c_read(addr, 0x0D, 1, val, 1);
val[0] &= ~(0x1);
val[0] |= 0x1;
max8998_clear_interrupt();
- printf("Charge Mode\n");
+ puts("Charge Mode\n");
charger_en(charger_speed);
#ifdef CONFIG_S5PC1XXFB
}
}
exit_font();
-#endif
+
/* Disable the display to prevent flickering */
/* TODO: how to reenable the display later? */
lcd_power_on(0);
+#endif
do {
struct s5pc110_rtc *rtc = (struct s5pc110_rtc *)S5PC110_RTC_BASE;
wakeup_stat = do_sleep(&ctt, 0, 1, argv);
}
} else {
- printf("\n\n\nERROR: this is not S5PC110.\n\n\n");
+ puts("\n\n\nERROR: this is not S5PC110.\n\n\n");
return;
}
} while (wakeup_stat == 0x04); /* RTC TICK */
+#ifdef CONFIG_S5PC1XXFB
restore_screen:
/* TODO: Reenable logo display (not working yet) */
lcd_power_on(1);
drv_lcd_init_resume();
+#endif
+}
+
+#define S5PC110_RST_STAT 0xE010A000
+
+#define SWRESET (1 << 3)
+#define WDTRESET (1 << 2)
+#define WARMRESET (1 << 1)
+#define EXTRESET (1 << 0)
+
+static int get_reset_status(void)
+{
+ return readl(S5PC110_RST_STAT) & 0xf;
}
static int fsa9480_probe(void)
}
if (i2c_probe(addr)) {
- printf("Can't found fsa9480\n");
+ puts("Can't found fsa9480\n");
return 1;
}
/* Clear Interrupt */
if (intr) {
i2c_read(addr, 0x03, 1, val, 2);
- udelay(500 * 1000);
+ return;
}
/* Read Device Type 1 */
charger_en(0);
}
- /* If Factory Mode is Boot ON-USB, go to download mode */
- i2c_read(addr, 0x07, 1, val, 1);
+ /* If reset status is watchdog reset then skip it */
+ if (!(get_reset_status() & WDTRESET)) {
+ /* If Factory Mode is Boot ON-USB, go to download mode */
+ i2c_read(addr, 0x07, 1, val, 1);
#define FSA_ADC_FAC_USB_OFF 0x18
#define FSA_ADC_FAC_USB_ON 0x19
#define FSA_ADC_FAC_UART 0x1d
- if (val[0] == FSA_ADC_FAC_USB_ON || val[0] == FSA_ADC_FAC_USB_OFF)
- setenv("bootcmd", "usbdown");
+ if (val[0] == FSA_ADC_FAC_USB_ON ||
+ val[0] == FSA_ADC_FAC_USB_OFF)
+ setenv("bootcmd", "usbdown");
+ }
path = getenv("usb");
/* LCD_BACKLIGHT_EN */
if (mach_is_geminus())
gpio_cfg_pin(&gpio_base->gpio_mp0_5, 0, GPIO_OUTPUT);
- if (board_is_neptune()) {
+ if (board_is_neptune() && hwrevision(0)) {
gpio_cfg_pin(&gpio_base->gpio_mp0_4, 4, GPIO_OUTPUT);
gpio_direction_output(&gpio_base->gpio_mp0_4, 4, 0);
}
spi_pd.so_bank = &gpio_base->gpio_mp0_4;
spi_pd.so_num = 2;
- if (board_is_neptune())
+ if (board_is_neptune() && hwrevision(0))
s6d16a0x_set_platform_data(&spi_pd);
else {
s6e63m0_set_platform_data(&spi_pd);
gpio_set_value(&gpio->gpio_mp0_5, 0, 0);
}
- if (mach_is_kessler() && board_is_neptune()) {
+ if (mach_is_kessler() && board_is_neptune() && hwrevision(0)) {
gpio_set_value(&gpio->gpio_mp0_4, 4, 1);
udelay(6);
addr = 0x76;
if (i2c_probe(addr)) {
if (i2c_probe(addr)) {
- printf("Can't found s6d16a0x backlight i2c\n");
+ puts("Can't found s6d16a0x backlight i2c\n");
return;
}
}
vid->reset_delay = 120000;
}
- if (board_is_neptune()) {
+ if (board_is_neptune() && hwrevision(0)) {
vid->vl_freq = 100;
vid->vl_col = 320;
vid->vl_row = 480;
lcd_is_enabled = 0;
if (mach_is_aquila() || mach_is_kessler()) {
- if (board_is_neptune())
+ if (board_is_neptune() && hwrevision(0))
setenv("lcdinfo", "lcd=s6d16a0x");
else if (board_is_media())
setenv("lcdinfo", "lcd=s6e63m0");
check_battery(0);
/* check fsa9480 */
- check_micro_usb(1);
+ check_micro_usb(0);
return 0;
}
gd->bd->bi_arch_number = MACH_TYPE_AQUILA;
gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
+#ifdef CONFIG_LCD
+ /*
+ * set reserved memory region for framebuffer.
+ *
+ * this region wouldn't be rewrited by kernel so
+ * could avoid nosie screen filled by garbages
+ * after hibernation resume has been completed.
+ */
+ gd->fb_base = CONFIG_FB_RESERVED_MEM;
+#endif
+
/* Check H/W Revision */
check_hw_revision();
* Aquila Rev0.5 4G3G1G
* Aquila Rev0.8 4G3G1G
* Aquila Rev0.9 4G3G1G
+ * Neptune Rev 0.2 4G3G1G
*/
- if (mach_is_aquila() || mach_is_kessler())
- if (hwrevision(5) || hwrevision(8) || hwrevision(9)) {
+ if (mach_is_aquila() || mach_is_kessler()) {
+ if ((!board_is_neptune() && (hwrevision(5) ||
+ hwrevision(8) || hwrevision(9))) ||
+ (board_is_neptune() && hwrevision(2))) {
memconfig1 = readl(base + MEMCONFIG1_OFFSET);
sz = (memconfig1 >> 16) & 0xFF;
sz = ((unsigned char) ~sz) + 1;
sz = sz << 4;
}
-
+ if (mach_is_kessler() && board_is_s1())
+ sz = 0;
+ }
}
/*
* bi_dram[1].size contains all DMC1 memory size
/* Set ONOFF4 */
i2c_write(addr, MAX8998_REG_ONOFF3+1, 1, saved_val[3], 1);
i2c_read(addr, MAX8998_REG_ONOFF3+1, 1, val, 1);
- printf("Waked up.\n");
+ puts("Waked up.\n");
/* check max17040 */
check_battery(0);
/* check fsa9480 */
- check_micro_usb(1);
+ check_micro_usb(0);
}
#if defined(CONFIG_USB_GADGET_S3C_UDC_OTG)
/* PMIC */
if (i2c_read(0x66, 0, 1, val, 2)) {
- printf("i2c_read error\n");
+ puts("i2c_read error\n");
return 1;
}
val[1] |= (1 << 5);
if (i2c_write(0x66, 0, 1, val, 2)) {
- printf("i2c_write error\n");
+ puts("i2c_write error\n");
return 1;
}
i2c_read(0x66, 0, 1, val, 2);