s5pc110: universal: change board name from "Neptune" to "Limo SDK"
[kernel/u-boot.git] / board / samsung / universal / universal.c
index 9359000..b1c23b2 100644 (file)
@@ -239,6 +239,11 @@ static int board_is_limo_real(void)
        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);
@@ -260,6 +265,11 @@ static int board_is_neptune(void)
        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)
 {
@@ -364,7 +374,7 @@ static const char *board_name[] = {
        "P1P2",         /* Don't remove it */
        "Geminus",
        "Cypress",
-       "Neptune",
+       "Limo SDK",
 };
 
 enum {
@@ -398,7 +408,7 @@ static char *display_features(int board, int board_rev)
                        name = "Bamboo";
        } else if (board == MACH_KESSLER) {
                if (board_rev & NEPTUNE_BOARD)
-                       name = "Neptune";
+                       name = "Limo SDK";
                if (board_rev & S1_BOARD)
                        name = "S1";
        }
@@ -680,8 +690,13 @@ static void show_hw_revision(void)
                        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);
@@ -692,7 +707,7 @@ static void show_hw_revision(void)
        }
 
        if (cpu_is_s5pc110())
-               writel(0xc1100000 | (0xffff & s5pc1xx_get_cpu_rev()),
+               writel(0xc1100000 | (0xffff & (s5pc1xx_get_cpu_rev() ? 1 : 0)),
                                S5PC110_INFORM3);
 
        empty_device_info_buffer();
@@ -709,11 +724,11 @@ static void check_auto_burn(void)
        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; ");
        }
 
@@ -892,10 +907,14 @@ static void check_keypad(void)
                /* 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))
@@ -931,7 +950,7 @@ static void check_battery(int mode)
                return;
 
        if (i2c_probe(addr)) {
-               printf("Can't found max17040 fuel gauge\n");
+               puts("Can't found max17040 fuel gauge\n");
                return;
        }
 
@@ -969,7 +988,7 @@ static void check_mhl(void)
 
        /* set usb path */
        if (i2c_probe(addr)) {
-               printf("Can't found MHL Chip\n");
+               puts("Can't found MHL Chip\n");
                return;
        }
 
@@ -999,7 +1018,7 @@ static int max8998_probe(void)
        i2c_set_bus_num(I2C_PMIC);
 
        if (i2c_probe(addr)) {
-               printf("Can't found max8998\n");
+               puts("Can't found max8998\n");
                return 1;
        }
 
@@ -1243,7 +1262,7 @@ static void charger_en(int enable)
                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;
@@ -1285,7 +1304,7 @@ static void into_charge_mode(void)
 
        max8998_clear_interrupt();
 
-       printf("Charge Mode\n");
+       puts("Charge Mode\n");
        charger_en(charger_speed);
 
 #ifdef CONFIG_S5PC1XXFB
@@ -1380,7 +1399,7 @@ static void into_charge_mode(void)
                                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;
                }
 
@@ -1467,7 +1486,7 @@ static int fsa9480_probe(void)
        }
 
        if (i2c_probe(addr)) {
-               printf("Can't found fsa9480\n");
+               puts("Can't found fsa9480\n");
                return 1;
        }
 
@@ -1797,7 +1816,7 @@ void lcd_cfg_gpio(void)
        /* 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);
        }
@@ -1821,7 +1840,7 @@ void lcd_cfg_gpio(void)
                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);
@@ -1889,7 +1908,7 @@ void backlight_on(unsigned int onoff)
                        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);
 
@@ -1898,7 +1917,7 @@ void backlight_on(unsigned int onoff)
                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;
                        }
                }
@@ -2066,7 +2085,7 @@ void init_panel_info(vidinfo_t *vid)
                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;
@@ -2204,7 +2223,7 @@ int misc_init_r(void)
        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");
@@ -2319,16 +2338,21 @@ int dram_init(void)
                 * 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
@@ -2469,7 +2493,7 @@ void board_sleep_resume(void)
        /* 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);
@@ -2548,7 +2572,7 @@ int usb_board_init(void)
 
                /* PMIC */
                if (i2c_read(0x66, 0, 1, val, 2)) {
-                       printf("i2c_read error\n");
+                       puts("i2c_read error\n");
                        return 1;
                }
 
@@ -2556,7 +2580,7 @@ int usb_board_init(void)
                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);