Merge "MIPS generic target support"
diff --git a/target/board/generic/BoardConfig.mk b/target/board/generic/BoardConfig.mk
index 57e60d3..b25abb0 100644
--- a/target/board/generic/BoardConfig.mk
+++ b/target/board/generic/BoardConfig.mk
@@ -34,7 +34,9 @@
 # Enable dex-preoptimization to speed up the first boot sequence
 # of an SDK AVD. Note that this operation only works on Linux for now
 ifeq ($(HOST_OS),linux)
-WITH_DEXPREOPT := true
+  ifeq ($(WITH_DEXPREOPT),)
+    WITH_DEXPREOPT := true
+  endif
 endif
 
 # Build OpenGLES emulation guest and host libraries
diff --git a/target/board/generic_mips/Android.mk b/target/board/generic_mips/Android.mk
new file mode 100644
index 0000000..abf8d57
--- /dev/null
+++ b/target/board/generic_mips/Android.mk
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2011 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH := $(call my-dir)
diff --git a/target/board/generic_mips/BoardConfig.mk b/target/board/generic_mips/BoardConfig.mk
new file mode 100644
index 0000000..722e112
--- /dev/null
+++ b/target/board/generic_mips/BoardConfig.mk
@@ -0,0 +1,53 @@
+#
+# Copyright (C) 2011 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# BoardConfig.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_ARCH := mips
+ifeq (,$(TARGET_ARCH_VARIANT))
+TARGET_ARCH_VARIANT := mips32r2-fp
+endif
+GET_CPU_ABI  := mips
+
+HAVE_HTC_AUDIO_DRIVER := true
+BOARD_USES_GENERIC_AUDIO := true
+
+# no hardware camera
+USE_CAMERA_STUB := true
+
+# Set /system/bin/sh to ash, not mksh, to make sure we can switch back.
+TARGET_SHELL := ash
+
+# Enable dex-preoptimization to speed up the first boot sequence
+# of an SDK AVD. Note that this operation only works on Linux for now
+ifeq ($(HOST_OS),linux)
+  ifeq ($(WITH_DEXPREOPT),)
+    WITH_DEXPREOPT := true
+  endif
+endif
+
+# Build OpenGLES emulation guest and host libraries
+BUILD_EMULATOR_OPENGL := true
+
+# Build and enable the OpenGL ES View renderer. When running on the emulator,
+# the GLES renderer disables itself if host GL acceleration isn't available.
+USE_OPENGL_RENDERER := true
diff --git a/target/board/generic_mips/README.txt b/target/board/generic_mips/README.txt
new file mode 100644
index 0000000..b31a857
--- /dev/null
+++ b/target/board/generic_mips/README.txt
@@ -0,0 +1,9 @@
+The "generic_mips" product defines a MIPS based 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_mips/device.mk b/target/board/generic_mips/device.mk
new file mode 100644
index 0000000..bd08fde
--- /dev/null
+++ b/target/board/generic_mips/device.mk
@@ -0,0 +1,30 @@
+#
+# Copyright (C) 2009 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# This is a build configuration for the product aspects that
+# are specific to the emulator.
+
+PRODUCT_PROPERTY_OVERRIDES := \
+    ro.ril.hsxpa=1 \
+    ro.ril.gprsclass=10
+
+PRODUCT_COPY_FILES := \
+    development/data/etc/apns-conf.xml:system/etc/apns-conf.xml \
+    development/data/etc/vold.conf:system/etc/vold.conf \
+    development/tools/emulator/system/camera/media_profiles.xml:system/etc/media_profiles.xml
+
+PRODUCT_PACKAGES := \
+    audio.primary.goldfish
diff --git a/target/board/generic_mips/system.prop b/target/board/generic_mips/system.prop
new file mode 100644
index 0000000..137a0f9
--- /dev/null
+++ b/target/board/generic_mips/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/product/AndroidProducts.mk b/target/product/AndroidProducts.mk
index e77c783..220e39a 100644
--- a/target/product/AndroidProducts.mk
+++ b/target/product/AndroidProducts.mk
@@ -37,10 +37,13 @@
     $(LOCAL_DIR)/generic.mk \
     $(LOCAL_DIR)/generic_armv5.mk \
     $(LOCAL_DIR)/generic_x86.mk \
+    $(LOCAL_DIR)/generic_mips.mk \
     $(LOCAL_DIR)/full.mk \
     $(LOCAL_DIR)/full_x86.mk \
+    $(LOCAL_DIR)/full_mips.mk \
     $(LOCAL_DIR)/vbox_x86.mk \
     $(LOCAL_DIR)/sdk.mk \
     $(LOCAL_DIR)/sdk_x86.mk \
+    $(LOCAL_DIR)/sdk_mips.mk \
     $(LOCAL_DIR)/large_emu_hw.mk
 endif
diff --git a/target/product/full_mips.mk b/target/product/full_mips.mk
new file mode 100644
index 0000000..886cf31
--- /dev/null
+++ b/target/product/full_mips.mk
@@ -0,0 +1,32 @@
+#
+# Copyright (C) 2009 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# This is a build configuration for a full-featured build of the
+# Open-Source part of the tree. It's geared toward a US-centric
+# mips build quite specifically for the emulator, and might not be
+# entirely appropriate to inherit from for on-device configurations.
+
+PRODUCT_PACKAGES := \
+    Camera
+
+$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/board/generic_mips/device.mk)
+
+# Overrides
+PRODUCT_NAME := full_mips
+PRODUCT_DEVICE := generic_mips
+PRODUCT_BRAND := Android
+PRODUCT_MODEL := Full MIPS Android on Emulator
diff --git a/target/product/generic_mips.mk b/target/product/generic_mips.mk
new file mode 100644
index 0000000..7b53d04
--- /dev/null
+++ b/target/product/generic_mips.mk
@@ -0,0 +1,26 @@
+#
+# Copyright (C) 2007 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# This is a generic phone product that isn't specialized for a specific device.
+# It includes the base Android platform.
+
+$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_no_telephony.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony.mk)
+
+# Overrides
+PRODUCT_BRAND := generic_mips
+PRODUCT_DEVICE := generic_mips
+PRODUCT_NAME := generic_mips
diff --git a/target/product/sdk_mips.mk b/target/product/sdk_mips.mk
new file mode 100644
index 0000000..2072400
--- /dev/null
+++ b/target/product/sdk_mips.mk
@@ -0,0 +1,28 @@
+#
+# Copyright (C) 2012 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# This is a build configuration for a full-featured build of the
+# Open-Source part of the tree. It's geared toward a US-centric
+# build quite specifically for the emulator, and might not be
+# entirely appropriate to inherit from for on-device configurations.
+
+$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk.mk)
+
+# Overrides
+PRODUCT_BRAND := generic_mips
+PRODUCT_NAME := sdk_mips
+PRODUCT_DEVICE := generic_mips
+PRODUCT_MODEL := Android SDK for Mips