summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2010-03-16 18:53:45 -0700
committerJean-Baptiste Queru <jbq@google.com>2010-03-16 19:15:39 -0700
commite5cfc0ec2e7bd38e9514a6e1fecf10f3fcb179e7 (patch)
treec8f97695010614d662fb1f810a7af15327c643b0
parent261ee500e5aa0b34ed0fd4aa378aa5203d578a63 (diff)
downloadsapphire-e5cfc0ec2e7bd38e9514a6e1fecf10f3fcb179e7.tar.gz
share the boot library between dream and sapphire
Change-Id: I289eb95b4e4f2d953dd8264eaa33f8167f36a59c
-rw-r--r--Android.mk2
-rw-r--r--BoardConfig.mk2
-rw-r--r--boot/Android.mk35
-rw-r--r--boot/board.c105
-rw-r--r--boot/keypad.c74
-rw-r--r--boot/panel.c29
-rw-r--r--boot/usb.c38
7 files changed, 2 insertions, 283 deletions
diff --git a/Android.mk b/Android.mk
index 8b003f1..87bad4f 100644
--- a/Android.mk
+++ b/Android.mk
@@ -13,4 +13,4 @@
# limitations under the License.
-include $(call all-named-subdir-makefiles, boot recovery)
+include $(call all-named-subdir-makefiles, recovery)
diff --git a/BoardConfig.mk b/BoardConfig.mk
index e0f4142..9eabe81 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -39,7 +39,7 @@ WIFI_DRIVER_MODULE_NAME := "wlan"
WIFI_FIRMWARE_LOADER := "wlan_loader"
TARGET_BOOTLOADER_LIBS := \
- libboot_board_sapphire \
+ libboot_board_dream_sapphire \
libboot_arch_msm7k \
libboot_arch_armv6
diff --git a/boot/Android.mk b/boot/Android.mk
deleted file mode 100644
index 8be5b9d..0000000
--- a/boot/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# 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.
-
-LOCAL_PATH:= $(call my-dir)
-
-ifneq ($(TARGET_SIMULATOR),true)
-
-include $(CLEAR_VARS)
-
-LOCAL_ARM_MODE := arm
-
-LOCAL_SRC_FILES := board.c panel.c keypad.c usb.c
-
-LOCAL_C_INCLUDES := $(call include-path-for, bootloader)
-
-LOCAL_CFLAGS := -O2 -g -W -Wall
-LOCAL_CFLAGS += -march=armv6
-
-LOCAL_MODULE := libboot_board_sapphire
-
-include $(BUILD_RAW_STATIC_LIBRARY)
-
-endif # !TARGET_SIMULATOR
-
diff --git a/boot/board.c b/boot/board.c
deleted file mode 100644
index f2b4daf..0000000
--- a/boot/board.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * 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.
- */
-
-#include <boot/boot.h>
-#include <boot/flash.h>
-
-ptentry PTABLE[] = {
- {
- .start = 310,
- .length = 40,
- .name = "recovery",
- },
- {
- .start = 350,
- .length = 20,
- .name = "boot",
- },
- {
- .start = 370,
- .length = 540,
- .name = "system",
- },
- {
- .start = 910,
- .length = 1138,
- .name = "userdata",
- },
- {
- .start = 0,
- .length = 0,
- .name = "",
- },
-};
-
-#define MISC2_CHARGER_OFF 0x01 /* DISABLE charge circuitry */
-#define MISC2_ISET 0x02 /* Enable Current Limit */
-
-#define MISC2_H2W_MASK 0xC0
-#define MISC2_H2W_GPIO 0x00
-#define MISC2_H2W_UART1 0x40
-#define MISC2_H2W_UART3 0x80
-#define MISC2_H2W_BT 0xC0
-
-void board_init()
-{
- unsigned n;
-
- /* if we already have partitions from elsewhere,
- ** don't use the hardcoded ones
- */
- if(flash_get_ptn_count() == 0) {
- for(n = 0; PTABLE[n].name[0]; n++) {
- flash_add_ptn(PTABLE + n);
- }
- }
-
- /* UART configuration */
-#if 1
- /* UART3 */
- writeb(MISC2_H2W_UART3, 0x98000000);
- uart_init(2);
-#else
- /* UART1 */
- writeb(MISC2_H2W_UART1, 0x98000000);
- uart_init(0);
-#endif
- mdelay(100);
-}
-
-const char *board_cmdline(void)
-{
- return "mem=112M console=ttyMSM0 androidboot.console=ttyMSM0";
-};
-
-unsigned board_machtype(void)
-{
- return 1440;
-}
-
-void board_reboot(void)
-{
- gpio_set(25, 0);
-}
-
-void board_getvar(const char *name, char *value)
-{
- if(!strcmp(name, "version.amss")) {
- get_version_modem(value);
- } else if(!strcmp(name, "version.amss.sbl")) {
- get_version_modem_sbl(value);
- }
-}
diff --git a/boot/keypad.c b/boot/keypad.c
deleted file mode 100644
index b1de09d..0000000
--- a/boot/keypad.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * 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.
- */
-
-#include <boot/boot.h>
-#include <boot/board.h>
-#include <boot/gpio_keypad.h>
-
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-static unsigned int dream_row_gpios[] = {
-#if 0 // unused?
- 35, /* KP_MKOUT0 */
- 34, /* KP_MKOUT1 */
- 33, /* KP_MKOUT2 */
- 32, /* KP_MKOUT3 */
- 31, /* KP_MKOUT4 */
- 23, /* KP_MKOUT5 */
-#endif
-#if 1
- 30, /* KP_MKOUT6 */
- 78, /* KP_MKOUT7 */
-#endif
-};
-
-static unsigned int dream_col_gpios[] = {
-#if 1 // main buttons
- 42, /* KP_MKIN0 */
- 41, /* KP_MKIN1 */
- 40, /* KP_MKIN2 */
- 39, /* KP_MKIN3 */
-#endif
-#if 1 // side buttons
- 38, /* KP_MKIN4 */
- 37, /* KP_MKIN5 */
- 36, /* KP_MKIN6 */
-#endif
-};
-static gpio_keypad_info dream_keypad = {
- .output_gpios = dream_row_gpios,
- .input_gpios = dream_col_gpios,
- .noutputs = ARRAY_SIZE(dream_row_gpios),
- .ninputs = ARRAY_SIZE(dream_col_gpios),
- .settle_time = 5000,
- .polarity = 0
-};
-
-static void keypad_poll()
-{
- static int skip = 0;
- skip++;
- if(skip > 10) {
- gpio_keypad_scan_keys(&dream_keypad);
- skip = 0;
- }
-}
-
-
-void keypad_init(void)
-{
- gpio_keypad_init(&dream_keypad);
- boot_register_poll_func(keypad_poll);
-}
diff --git a/boot/panel.c b/boot/panel.c
deleted file mode 100644
index e264027..0000000
--- a/boot/panel.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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.
- */
-
-#include <boot/board.h>
-
-void panel_init(struct mddi_client_caps *caps)
-{
-}
-
-void panel_poweron(void)
-{
-}
-
-void panel_backlight(int on)
-{
-}
diff --git a/boot/usb.c b/boot/usb.c
deleted file mode 100644
index d2856c3..0000000
--- a/boot/usb.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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.
- */
-
-#include <boot/boot.h>
-
-void ulpi_write(unsigned val, unsigned reg);
-unsigned ulpi_read(unsigned reg);
-
-void board_usb_init(void)
-{
- writeb(0, 0x98000004);
- mdelay(100);
- writeb((1 << 5), 0x98000004);
- mdelay(100);
-}
-
-void board_ulpi_init(void)
-{
- /* adjust eye diagram */
- ulpi_write(0x40, 0x31);
-
- /* disable VBUS interrupt to avoid stuck PHY issue */
- ulpi_write(0x1D, 0x0D);
- ulpi_write(0x1D, 0x10);
-}