arm: tegra: loki: More support for board revision
Jun Yan [Tue, 31 Dec 2013 03:48:33 +0000 (19:48 -0800)]
Here comes the rescue for board fragmentation:

"ro.revision" property stands for the board revision:
0-Loki FFF/FFD(5 inch display)
1-Loki NFF on E2548
2-Loki NFF on E2549
3-Foster
4-Loki FFF/FFD(5.6 inch display)

Bug 1432777

Change-Id: I5228202bd634f1ec3febe132839d0fbae0b6f166
Signed-off-by: Jun Yan <juyan@nvidia.com>
Reviewed-on: http://git-master/r/350836
Reviewed-by: Raymond Poudrier <rapoudrier@nvidia.com>
Tested-by: Raymond Poudrier <rapoudrier@nvidia.com>

arch/arm/mach-tegra/board-loki.c
arch/arm/mach-tegra/board-loki.h

index d39ead5..570e001 100644 (file)
@@ -737,13 +737,23 @@ static int __init loki_touch_init(void)
 
 static void __init loki_revision_init(struct board_info *binf)
 {
-       system_rev = P2530;
+
+       struct board_info disp_board_info;
+
+       system_rev = P2530_LOKI;
+       tegra_get_display_board_info(&disp_board_info);
        if (!binf)
                return;
-       if (binf->board_id == BOARD_E2548)
+       if (binf->board_id == BOARD_E2548) {
                system_rev = E2548;
-       else if (binf->board_id == BOARD_E2549)
+       } else if (binf->board_id == BOARD_E2549) {
                system_rev = E2549;
+       } else if (binf->board_id == BOARD_P2530) {
+               if (binf->sku == BOARD_SKU_FOSTER)
+                       system_rev = P2530_FOSTER;
+               else if (disp_board_info.fab == 0x1)
+                       system_rev = P2530_LOKI_PREM;
+       }
 }
 
 static void __init tegra_loki_early_init(void)
index 37351c5..3e9dcf5 100644 (file)
@@ -161,9 +161,11 @@ int tn8_regulator_init(void);
 int loki_fan_init(void);
 
 enum {
-       P2530 = 0,
+       P2530_LOKI = 0,
        E2549 = 1,
        E2548 = 2,
+       P2530_FOSTER = 3,
+       P2530_LOKI_PREM = 4,
 };
 
 #endif