auto import from //depot/cupcake/@135843
diff --git a/target/board/Android.mk b/target/board/Android.mk
new file mode 100644
index 0000000..64e3a74
--- /dev/null
+++ b/target/board/Android.mk
@@ -0,0 +1,54 @@
+#
+# Set up product-global definitions and include product-specific rules.
+#
+
+ifneq ($(strip $(TARGET_NO_BOOTLOADER)),true)
+  INSTALLED_BOOTLOADER_MODULE := $(PRODUCT_OUT)/bootloader
+  ifeq ($(strip $(TARGET_BOOTLOADER_IS_2ND)),true)
+    INSTALLED_2NDBOOTLOADER_TARGET := $(PRODUCT_OUT)/2ndbootloader
+  else
+    INSTALLED_2NDBOOTLOADER_TARGET :=
+  endif
+else
+  INSTALLED_BOOTLOADER_MODULE :=
+  INSTALLED_2NDBOOTLOADER_TARGET :=
+endif	# TARGET_NO_BOOTLOADER
+
+ifneq ($(strip $(TARGET_NO_KERNEL)),true)
+  INSTALLED_KERNEL_TARGET := $(PRODUCT_OUT)/kernel
+else
+  INSTALLED_KERNEL_TARGET :=
+endif
+
+ifneq ($(strip $(TARGET_NO_RADIOIMAGE)),true)
+  INSTALLED_RADIOIMAGE_TARGET := $(PRODUCT_OUT)/radio.img
+else
+  INSTALLED_RADIOIMAGE_TARGET :=
+endif
+
+ifeq (,$(wildcard $(TARGET_DEVICE_DIR)/AndroidBoard.mk))
+  ifeq (,$(wildcard $(TARGET_DEVICE_DIR)/Android.mk))
+    $(error Missing "$(TARGET_DEVICE_DIR)/AndroidBoard.mk")
+  else
+    # TODO: Remove this check after people have had a chance to switch,
+    # after April 2009.
+    $(error Please rename "$(TARGET_DEVICE_DIR)/Android.mk" to "$(TARGET_DEVICE_DIR)/AndroidBoard.mk")
+  endif
+endif
+include $(TARGET_DEVICE_DIR)/AndroidBoard.mk
+
+# Generate a file that contains various information about the
+# device we're building for.  This file is typically packaged up
+# with everything else.
+#
+# If the file "board-info.txt" appears in $(TARGET_DEVICE_DIR),
+# it will be appended to the output file.
+#
+INSTALLED_ANDROID_INFO_TXT_TARGET := $(PRODUCT_OUT)/android-info.txt
+board_info_txt := $(wildcard $(TARGET_DEVICE_DIR)/board-info.txt)
+$(INSTALLED_ANDROID_INFO_TXT_TARGET): $(board_info_txt)
+	$(call pretty,"Generated: ($@)")
+	$(hide) echo "board=$(TARGET_BOOTLOADER_BOARD_NAME)" > $@
+ifdef board_info_txt
+	$(hide) cat $< >> $@
+endif
diff --git a/target/board/emulator/AndroidBoard.mk b/target/board/emulator/AndroidBoard.mk
new file mode 100644
index 0000000..09badee
--- /dev/null
+++ b/target/board/emulator/AndroidBoard.mk
@@ -0,0 +1,10 @@
+LOCAL_PATH := $(call my-dir)
+
+file := $(TARGET_OUT_KEYLAYOUT)/tuttle2.kl
+ALL_PREBUILT += $(file)
+$(file) : $(LOCAL_PATH)/tuttle2.kl | $(ACP)
+	$(transform-prebuilt-to-target)
+
+include $(CLEAR_VARS)
+LOCAL_SRC_FILES := tuttle2.kcm
+include $(BUILD_KEY_CHAR_MAP)
diff --git a/target/board/emulator/BoardConfig.mk b/target/board/emulator/BoardConfig.mk
new file mode 100644
index 0000000..784118a
--- /dev/null
+++ b/target/board/emulator/BoardConfig.mk
@@ -0,0 +1,9 @@
+# config.mk
+# 
+# Product-specific compile-time definitions.
+#
+
+# The generic product target doesn't have any hardware-specific pieces.
+TARGET_NO_BOOTLOADER := true
+TARGET_NO_KERNEL := true
+HAVE_HTC_AUDIO_DRIVER := true
diff --git a/target/board/emulator/README.txt b/target/board/emulator/README.txt
new file mode 100644
index 0000000..6a1ec89
--- /dev/null
+++ b/target/board/emulator/README.txt
@@ -0,0 +1,10 @@
+The "emulator" product defines an almost non-hardware-specific target
+without a kernel or bootloader, except that it defines the
+HAVE_HTC_AUDIO_DRIVER constant, since that is what the emulator
+emulates currently.
+
+It can be used to build the entire user-level system, and
+will work with the emulator.
+
+It is not a product "base class"; no other products inherit
+from it or use it in any way.
diff --git a/target/board/emulator/tuttle2.kcm b/target/board/emulator/tuttle2.kcm
new file mode 100644
index 0000000..0a2dd8c
--- /dev/null
+++ b/target/board/emulator/tuttle2.kcm
@@ -0,0 +1,66 @@
+[type=QWERTY]                                           
+                                                        
+# keycode       display number  base    caps    fn      caps_fn
+                                                        
+A               'A'     '%'     'a'     'A'     '%'     0x00
+B               'B'     '='     'b'     'B'     '='     0x00
+C               'C'     '8'     'c'     'C'     '8'     0x00E7
+D               'D'     '5'     'd'     'D'     '5'     0x00
+E               'E'     '2'     'e'     'E'     '2'     0x0301
+F               'F'     '6'     'f'     'F'     '6'     0x00A5
+G               'G'     '-'     'g'     'G'     '-'     '_'
+H               'H'     '['     'h'     'H'     '['     '{'
+I               'I'     '$'     'i'     'I'     '$'     0x0302
+J               'J'     ']'     'j'     'J'     ']'     '}'
+K               'K'     '"'     'k'     'K'     '"'     '~'
+L               'L'     '''     'l'     'L'     '''     '`'
+M               'M'     '>'     'm'     'M'     '>'     0x00
+N               'N'     '<'     'n'     'N'     '<'     0x0303
+O               'O'     '('     'o'     'O'     '('     0x00
+P               'P'     ')'     'p'     'P'     ')'     0x00
+Q               'Q'     '*'     'q'     'Q'     '*'     0x0300
+R               'R'     '3'     'r'     'R'     '3'     0x20AC
+S               'S'     '4'     's'     'S'     '4'     0x00DF
+T               'T'     '+'     't'     'T'     '+'     0x00A3
+U               'U'     '&'     'u'     'U'     '&'     0x0308
+V               'V'     '9'     'v'     'V'     '9'     '^'
+W               'W'     '1'     'w'     'W'     '1'     0x00
+X               'X'     '7'     'x'     'X'     '7'     0xEF00
+Y               'Y'     '!'     'y'     'Y'     '!'     0x00A1
+Z               'Z'     '#'     'z'     'Z'     '#'     0x00
+                                                        
+COMMA           ','     ','     ','     ';'     ';'     '|'
+PERIOD          '.'     '.'     '.'     ':'     ':'     0x2026
+AT              '@'     '0'     '@'     '0'     '0'     0x2022
+SLASH           '/'     '/'     '/'     '?'     '?'     '\'
+                                                        
+SPACE           0x20    0x20    0x20    0x20    0xEF01  0xEF01
+ENTER         0xa     0xa     0xa     0xa     0xa     0xa
+                                                        
+# on pc keyboards
+TAB             0x9     0x9     0x9     0x9     0x9     0x9
+0               '0'     '0'     '0'     ')'     ')'     ')'
+1               '1'     '1'     '1'     '!'     '!'     '!'
+2               '2'     '2'     '2'     '@'     '@'     '@'
+3               '3'     '3'     '3'     '#'     '#'     '#'
+4               '4'     '4'     '4'     '$'     '$'     '$'
+5               '5'     '5'     '5'     '%'     '%'     '%'
+6               '6'     '6'     '6'     '^'     '^'     '^'
+7               '7'     '7'     '7'     '&'     '&'     '&'
+8               '8'     '8'     '8'     '*'     '*'     '*'
+9               '9'     '9'     '9'     '('     '('     '('
+                                                        
+GRAVE           '`'     '`'     '`'     '~'     '`'     '~'
+MINUS           '-'     '-'     '-'     '_'     '-'     '_'
+EQUALS          '='     '='     '='     '+'     '='     '+'
+LEFT_BRACKET    '['     '['     '['     '{'     '['     '{'
+RIGHT_BRACKET   ']'     ']'     ']'     '}'     ']'     '}'
+BACKSLASH       '\'     '\'     '\'     '|'     '\'     '|'
+SEMICOLON       ';'     ';'     ';'     ':'     ';'     ':'
+APOSTROPHE      '''     '''     '''     '"'     '''     '"'
+STAR            '*'     '*'     '*'     '*'     '*'     '*'
+POUND           '#'     '#'     '#'     '#'     '#'     '#'
+PLUS            '+'     '+'     '+'     '+'     '+'     '+'
+                                                        
+                                                        
+                                                        
diff --git a/target/board/emulator/tuttle2.kl b/target/board/emulator/tuttle2.kl
new file mode 100644
index 0000000..a48a5ab
--- /dev/null
+++ b/target/board/emulator/tuttle2.kl
@@ -0,0 +1,74 @@
+key 2     1
+key 3     2
+key 4     3
+key 5     4
+key 6     5
+key 7     6
+key 8     7
+key 9     8
+key 10    9
+key 11    0
+key 158   BACK              WAKE_DROPPED
+key 230   SOFT_RIGHT        WAKE
+key 60    SOFT_RIGHT        WAKE
+key 107   ENDCALL           WAKE_DROPPED
+key 62    ENDCALL           WAKE_DROPPED
+key 229   MENU         WAKE_DROPPED
+key 59    MENU         WAKE_DROPPED
+key 228   POUND
+key 227   STAR
+key 231   CALL              WAKE_DROPPED
+key 61    CALL              WAKE_DROPPED
+key 232   DPAD_CENTER       WAKE_DROPPED
+key 108   DPAD_DOWN         WAKE_DROPPED
+key 103   DPAD_UP           WAKE_DROPPED
+key 102   HOME              WAKE
+key 105   DPAD_LEFT         WAKE_DROPPED
+key 106   DPAD_RIGHT        WAKE_DROPPED
+key 115   VOLUME_UP
+key 114   VOLUME_DOWN
+key 116   POWER             WAKE
+key 212   SLASH
+
+key 16    Q
+key 17    W
+key 18    E
+key 19    R
+key 20    T
+key 21    Y
+key 22    U
+key 23    I
+key 24    O
+key 25    P
+
+key 30    A
+key 31    S
+key 32    D
+key 33    F
+key 34    G
+key 35    H
+key 36    J
+key 37    K
+key 38    L
+key 14    DEL
+        
+key 44    Z
+key 45    X
+key 46    C
+key 47    V
+key 48    B
+key 49    N
+key 50    M
+key 51    COMMA
+key 52    PERIOD
+key 28    ENTER
+        
+key 56    ALT_LEFT
+key 42    SHIFT_LEFT
+key 215   AT
+key 57    SPACE
+key 53    SLASH
+key 127   SYM
+key 100   ALT_RIGHT
+
+key 399   GRAVE
diff --git a/target/board/generic/AndroidBoard.mk b/target/board/generic/AndroidBoard.mk
new file mode 100644
index 0000000..09badee
--- /dev/null
+++ b/target/board/generic/AndroidBoard.mk
@@ -0,0 +1,10 @@
+LOCAL_PATH := $(call my-dir)
+
+file := $(TARGET_OUT_KEYLAYOUT)/tuttle2.kl
+ALL_PREBUILT += $(file)
+$(file) : $(LOCAL_PATH)/tuttle2.kl | $(ACP)
+	$(transform-prebuilt-to-target)
+
+include $(CLEAR_VARS)
+LOCAL_SRC_FILES := tuttle2.kcm
+include $(BUILD_KEY_CHAR_MAP)
diff --git a/target/board/generic/BoardConfig.mk b/target/board/generic/BoardConfig.mk
new file mode 100644
index 0000000..a874742
--- /dev/null
+++ b/target/board/generic/BoardConfig.mk
@@ -0,0 +1,11 @@
+# config.mk
+# 
+# Product-specific compile-time definitions.
+#
+
+# The generic product target doesn't have any hardware-specific pieces.
+TARGET_NO_BOOTLOADER := true
+TARGET_NO_KERNEL := true
+TARGET_NO_RADIOIMAGE := true
+HAVE_HTC_AUDIO_DRIVER := true
+BOARD_USES_GENERIC_AUDIO := true
diff --git a/target/board/generic/README.txt b/target/board/generic/README.txt
new file mode 100644
index 0000000..ddac68e
--- /dev/null
+++ b/target/board/generic/README.txt
@@ -0,0 +1,9 @@
+The "generic" product defines a non-hardware-specific target
+without a kernel or bootloader.
+
+It can be used to build the entire user-level system, and
+will work with the emulator, though sound will not work
+(see the "emulator" product for that).
+
+It is not a product "base class"; no other products inherit
+from it or use it in any way.
diff --git a/target/board/generic/system.prop b/target/board/generic/system.prop
new file mode 100644
index 0000000..f2424c9
--- /dev/null
+++ b/target/board/generic/system.prop
@@ -0,0 +1,6 @@
+#
+# system.prop for generic sdk 
+#
+
+rild.libpath=/system/lib/libreference-ril.so
+rild.libargs=-d /dev/ttyS0
diff --git a/target/board/generic/tuttle2.kcm b/target/board/generic/tuttle2.kcm
new file mode 100644
index 0000000..0a2dd8c
--- /dev/null
+++ b/target/board/generic/tuttle2.kcm
@@ -0,0 +1,66 @@
+[type=QWERTY]                                           
+                                                        
+# keycode       display number  base    caps    fn      caps_fn
+                                                        
+A               'A'     '%'     'a'     'A'     '%'     0x00
+B               'B'     '='     'b'     'B'     '='     0x00
+C               'C'     '8'     'c'     'C'     '8'     0x00E7
+D               'D'     '5'     'd'     'D'     '5'     0x00
+E               'E'     '2'     'e'     'E'     '2'     0x0301
+F               'F'     '6'     'f'     'F'     '6'     0x00A5
+G               'G'     '-'     'g'     'G'     '-'     '_'
+H               'H'     '['     'h'     'H'     '['     '{'
+I               'I'     '$'     'i'     'I'     '$'     0x0302
+J               'J'     ']'     'j'     'J'     ']'     '}'
+K               'K'     '"'     'k'     'K'     '"'     '~'
+L               'L'     '''     'l'     'L'     '''     '`'
+M               'M'     '>'     'm'     'M'     '>'     0x00
+N               'N'     '<'     'n'     'N'     '<'     0x0303
+O               'O'     '('     'o'     'O'     '('     0x00
+P               'P'     ')'     'p'     'P'     ')'     0x00
+Q               'Q'     '*'     'q'     'Q'     '*'     0x0300
+R               'R'     '3'     'r'     'R'     '3'     0x20AC
+S               'S'     '4'     's'     'S'     '4'     0x00DF
+T               'T'     '+'     't'     'T'     '+'     0x00A3
+U               'U'     '&'     'u'     'U'     '&'     0x0308
+V               'V'     '9'     'v'     'V'     '9'     '^'
+W               'W'     '1'     'w'     'W'     '1'     0x00
+X               'X'     '7'     'x'     'X'     '7'     0xEF00
+Y               'Y'     '!'     'y'     'Y'     '!'     0x00A1
+Z               'Z'     '#'     'z'     'Z'     '#'     0x00
+                                                        
+COMMA           ','     ','     ','     ';'     ';'     '|'
+PERIOD          '.'     '.'     '.'     ':'     ':'     0x2026
+AT              '@'     '0'     '@'     '0'     '0'     0x2022
+SLASH           '/'     '/'     '/'     '?'     '?'     '\'
+                                                        
+SPACE           0x20    0x20    0x20    0x20    0xEF01  0xEF01
+ENTER         0xa     0xa     0xa     0xa     0xa     0xa
+                                                        
+# on pc keyboards
+TAB             0x9     0x9     0x9     0x9     0x9     0x9
+0               '0'     '0'     '0'     ')'     ')'     ')'
+1               '1'     '1'     '1'     '!'     '!'     '!'
+2               '2'     '2'     '2'     '@'     '@'     '@'
+3               '3'     '3'     '3'     '#'     '#'     '#'
+4               '4'     '4'     '4'     '$'     '$'     '$'
+5               '5'     '5'     '5'     '%'     '%'     '%'
+6               '6'     '6'     '6'     '^'     '^'     '^'
+7               '7'     '7'     '7'     '&'     '&'     '&'
+8               '8'     '8'     '8'     '*'     '*'     '*'
+9               '9'     '9'     '9'     '('     '('     '('
+                                                        
+GRAVE           '`'     '`'     '`'     '~'     '`'     '~'
+MINUS           '-'     '-'     '-'     '_'     '-'     '_'
+EQUALS          '='     '='     '='     '+'     '='     '+'
+LEFT_BRACKET    '['     '['     '['     '{'     '['     '{'
+RIGHT_BRACKET   ']'     ']'     ']'     '}'     ']'     '}'
+BACKSLASH       '\'     '\'     '\'     '|'     '\'     '|'
+SEMICOLON       ';'     ';'     ';'     ':'     ';'     ':'
+APOSTROPHE      '''     '''     '''     '"'     '''     '"'
+STAR            '*'     '*'     '*'     '*'     '*'     '*'
+POUND           '#'     '#'     '#'     '#'     '#'     '#'
+PLUS            '+'     '+'     '+'     '+'     '+'     '+'
+                                                        
+                                                        
+                                                        
diff --git a/target/board/generic/tuttle2.kl b/target/board/generic/tuttle2.kl
new file mode 100644
index 0000000..a78a6eb
--- /dev/null
+++ b/target/board/generic/tuttle2.kl
@@ -0,0 +1,74 @@
+key 2     1
+key 3     2
+key 4     3
+key 5     4
+key 6     5
+key 7     6
+key 8     7
+key 9     8
+key 10    9
+key 11    0
+key 158   BACK              WAKE_DROPPED
+key 230   SOFT_RIGHT        WAKE
+key 60    SOFT_RIGHT        WAKE
+key 107   ENDCALL           WAKE_DROPPED
+key 62    ENDCALL           WAKE_DROPPED
+key 229   MENU         WAKE_DROPPED
+key 59    MENU         WAKE_DROPPED
+key 228   POUND
+key 227   STAR
+key 231   CALL              WAKE_DROPPED
+key 61    CALL              WAKE_DROPPED
+key 232   DPAD_CENTER       WAKE_DROPPED
+key 108   DPAD_DOWN         WAKE_DROPPED
+key 103   DPAD_UP           WAKE_DROPPED
+key 102   HOME              WAKE
+key 105   DPAD_LEFT         WAKE_DROPPED
+key 106   DPAD_RIGHT        WAKE_DROPPED
+key 115   VOLUME_UP
+key 114   VOLUME_DOWN
+key 116   POWER             WAKE
+key 212   SLASH
+
+key 16    Q
+key 17    W
+key 18    E
+key 19    R
+key 20    T
+key 21    Y
+key 22    U
+key 23    I
+key 24    O
+key 25    P
+
+key 30    A
+key 31    S
+key 32    D
+key 33    F
+key 34    G
+key 35    H
+key 36    J
+key 37    K
+key 38    L
+key 14    DEL
+        
+key 44    Z
+key 45    X
+key 46    C
+key 47    V
+key 48    B
+key 49    N
+key 50    M
+key 51    COMMA
+key 52    PERIOD
+key 28    ENTER
+        
+key 56    ALT_LEFT
+key 42    SHIFT_LEFT
+key 215   AT
+key 57    SPACE
+key 53    SLASH
+key 127   SYM
+key 100   ALT_LEFT
+
+key 399   GRAVE
diff --git a/target/board/sim/AndroidBoard.mk b/target/board/sim/AndroidBoard.mk
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/target/board/sim/AndroidBoard.mk
diff --git a/target/board/sim/BoardConfig.mk b/target/board/sim/BoardConfig.mk
new file mode 100644
index 0000000..92679d9
--- /dev/null
+++ b/target/board/sim/BoardConfig.mk
@@ -0,0 +1,22 @@
+# config.mk
+# 
+# Product-specific compile-time definitions.
+#
+
+# Don't try prelinking or compressing the shared libraries
+# used by the simulator.  The host OS won't know what to do
+# with them, and they may not even be ELF files.
+#
+# These definitions override the defaults in config/config.make.
+TARGET_COMPRESS_MODULE_SYMBOLS := false
+TARGET_PRELINK_MODULE := false
+
+# Don't try to build a bootloader.
+TARGET_NO_BOOTLOADER := true
+
+# Don't bother with a kernel
+TARGET_NO_KERNEL := true
+
+#the simulator partially emulates the original HTC /dev/eac audio interface
+HAVE_HTC_AUDIO_DRIVER := true
+BOARD_USES_GENERIC_AUDIO := true