Merge "Build:use is-android-codename instead of is-flavor"
diff --git a/app/aboot/aboot.c b/app/aboot/aboot.c
index ec03792..ac68409 100644
--- a/app/aboot/aboot.c
+++ b/app/aboot/aboot.c
@@ -51,6 +51,7 @@
#include "bootimg.h"
#include "fastboot.h"
#include "sparse_format.h"
+#include "mmc.h"
#include "scm_decrypt.h"
@@ -94,8 +95,6 @@
char sn_buf[13];
-
-
static void ptentry_to_tag(unsigned **ptr, struct ptentry *ptn)
{
struct atag_ptbl_entry atag_ptn;
@@ -490,10 +489,9 @@
memmove((void*) hdr.ramdisk_addr, ptr + page_size + kernel_actual, hdr.ramdisk_size);
fastboot_okay("");
- target_battery_charging_enable(0, 1);
udc_stop();
- boot_linux((void*) hdr.kernel_addr, (void*) TAGS_ADDR,
+ boot_linux((void*) hdr.kernel_addr, (void*) hdr.tags_addr,
(const char*) hdr.cmdline, board_machtype(),
(void*) hdr.ramdisk_addr, hdr.ramdisk_size);
}
@@ -550,28 +548,38 @@
unsigned long long ptn = 0;
unsigned long long size = 0;
- ptn = mmc_ptn_offset((unsigned char *) arg);
- if (ptn == 0) {
- fastboot_fail("partition table doesn't exist");
- return;
- }
-
- if (!strcmp(arg, "boot") || !strcmp(arg, "recovery")) {
- if (memcmp((void *)data, BOOT_MAGIC, BOOT_MAGIC_SIZE)) {
- fastboot_fail("image is not a boot image");
+ if (!strcmp(arg, "partition"))
+ {
+ dprintf(INFO, "Attempt to write partition image.\n");
+ if (mmc_write_partition(sz, (unsigned char *) data)) {
+ fastboot_fail("failed to write partition");
return;
}
}
+ else
+ {
+ ptn = mmc_ptn_offset((unsigned char *) arg);
+ if(ptn == 0) {
+ fastboot_fail("partition table doesn't exist");
+ return;
+ }
- size = mmc_ptn_size((unsigned char *) arg);
- if (ROUND_TO_PAGE(sz, 511) > size) {
- fastboot_fail("size too large");
- return;
- }
+ if (!strcmp(arg, "boot") || !strcmp(arg, "recovery")) {
+ if (memcmp((void *)data, BOOT_MAGIC, BOOT_MAGIC_SIZE)) {
+ fastboot_fail("image is not a boot image");
+ return;
+ }
+ }
- if (mmc_write(ptn , sz, (unsigned int *) data)) {
- fastboot_fail("flash write failure");
- return;
+ size = mmc_ptn_size((unsigned char *) arg);
+ if (ROUND_TO_PAGE(sz,511) > size) {
+ fastboot_fail("size too large");
+ return;
+ }
+ else if (mmc_write(ptn , sz, (unsigned int *)data)) {
+ fastboot_fail("flash write failure");
+ return;
+ }
}
fastboot_okay("");
return;
@@ -762,7 +770,6 @@
void cmd_continue(const char *arg, void *data, unsigned sz)
{
fastboot_okay("");
- target_battery_charging_enable(0, 1);
udc_stop();
if (target_is_emmc_boot())
{
@@ -836,13 +843,6 @@
page_mask = page_size - 1;
}
- /* Display splash screen if enabled */
- #if DISPLAY_SPLASH_SCREEN
- display_init();
- dprintf(SPEW, "Diplay initialized\n");
- display_image_on_screen();
- #endif
-
target_serialno((unsigned char *) sn_buf);
dprintf(SPEW,"serial number: %s\n",sn_buf);
surf_udc_device.serialno = sn_buf;
@@ -915,10 +915,10 @@
fastboot_register("reboot-bootloader", cmd_reboot_bootloader);
fastboot_publish("product", TARGET(BOARD));
fastboot_publish("kernel", "lk");
+ mmc_dump_partition_info();
sz = target_get_max_flash_size();
fastboot_init(target_get_scratch_address(), sz);
udc_start();
- target_battery_charging_enable(1, 0);
}
APP_START(aboot)
diff --git a/dev/pmic/pm8921/include/dev/pm8921.h b/dev/pmic/pm8921/include/dev/pm8921.h
index 71f0f37..8b14c02 100644
--- a/dev/pmic/pm8921/include/dev/pm8921.h
+++ b/dev/pmic/pm8921/include/dev/pm8921.h
@@ -98,5 +98,6 @@
int pm8921_gpio_config(int gpio, struct pm8921_gpio *param);
void pm8921_boot_done(void);
int pm8921_ldo_set_voltage(uint32_t ldo_id, uint32_t voltage);
+int pm8921_config_reset_pwr_off(unsigned reset);
#endif
diff --git a/dev/pmic/pm8921/pm8921.c b/dev/pmic/pm8921/pm8921.c
index 35b6ac3..c660ec8 100644
--- a/dev/pmic/pm8921/pm8921.c
+++ b/dev/pmic/pm8921/pm8921.c
@@ -58,6 +58,25 @@
dev->initialized = 1;
}
+static int pm8921_masked_write(uint16_t addr,
+ uint8_t mask, uint8_t val)
+{
+ int rc;
+ uint8_t reg;
+
+ rc = dev->read(®, 1, addr);
+ if (rc)
+ {
+ return rc;
+ }
+
+ reg &= ~mask;
+ reg |= val & mask;
+ rc = dev->write(®, 1, addr);
+
+ return rc;
+}
+
/* Set the BOOT_DONE flag */
void pm8921_boot_done(void)
{
@@ -203,3 +222,41 @@
return 0;
}
+
+/*
+ * Configure PMIC for reset and power off.
+ * reset = 1: Configure reset.
+ * reset = 0: Configure power off.
+ */
+int pm8921_config_reset_pwr_off(unsigned reset)
+{
+ int rc;
+
+ /* Enable SMPL(Short Momentary Power Loss) if resetting is desired. */
+ rc = pm8921_masked_write(PM8921_SLEEP_CTRL_REG,
+ SLEEP_CTRL_SMPL_EN_MASK,
+ (reset ? SLEEP_CTRL_SMPL_EN_RESET : SLEEP_CTRL_SMPL_EN_PWR_OFF));
+ if (rc)
+ {
+ goto read_write_err;
+ }
+
+ /*
+ * Select action to perform (reset or shutdown) when PS_HOLD goes low.
+ * Also ensure that KPD, CBL0, and CBL1 pull ups are enabled and that
+ * USB charging is enabled.
+ */
+ rc = pm8921_masked_write(PM8921_PON_CTRL_1_REG,
+ PON_CTRL_1_PULL_UP_MASK | PON_CTRL_1_USB_PWR_EN
+ | PON_CTRL_1_WD_EN_MASK,
+ PON_CTRL_1_PULL_UP_MASK | PON_CTRL_1_USB_PWR_EN
+ | (reset ? PON_CTRL_1_WD_EN_RESET : PON_CTRL_1_WD_EN_PWR_OFF));
+ if (rc)
+ {
+ goto read_write_err;
+ }
+
+read_write_err:
+ return rc;
+}
+
diff --git a/dev/pmic/pm8921/pm8921_hw.h b/dev/pmic/pm8921/pm8921_hw.h
index 83ea194..9bc54df 100644
--- a/dev/pmic/pm8921/pm8921_hw.h
+++ b/dev/pmic/pm8921/pm8921_hw.h
@@ -92,3 +92,20 @@
/* Bank 5 */
#define PM_GPIO_NON_INT_POL_INV 0x08
+/* PON CTRL 1 register */
+#define PM8921_PON_CTRL_1_REG 0x01C
+
+#define PON_CTRL_1_PULL_UP_MASK 0xE0
+#define PON_CTRL_1_USB_PWR_EN 0x10
+
+#define PON_CTRL_1_WD_EN_MASK 0x08
+#define PON_CTRL_1_WD_EN_RESET 0x08
+#define PON_CTRL_1_WD_EN_PWR_OFF 0x00
+
+/* SLEEP CTRL register */
+#define PM8921_SLEEP_CTRL_REG 0x10A
+
+#define SLEEP_CTRL_SMPL_EN_MASK 0x04
+#define SLEEP_CTRL_SMPL_EN_RESET 0x04
+#define SLEEP_CTRL_SMPL_EN_PWR_OFF 0x00
+
diff --git a/platform/apq8064/clock.c b/platform/apq8064/clock.c
new file mode 100644
index 0000000..76e50f5
--- /dev/null
+++ b/platform/apq8064/clock.c
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Code Aurora nor
+ * the names of its contributors may be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <reg.h>
+#include <debug.h>
+#include <platform/iomap.h>
+#include <platform/clock.h>
+#include <gsbi.h>
+#include <mmc.h>
+#include <uart_dm.h>
+
+/* Set rate and enable the clock */
+void clock_config(uint32_t ns, uint32_t md, uint32_t ns_addr, uint32_t md_addr)
+{
+ unsigned int val = 0;
+
+ /* Activate the reset for the M/N Counter */
+ val = 1 << 7;
+ writel(val, ns_addr);
+
+ /* Write the MD value into the MD register */
+ writel(md, md_addr);
+
+ /* Write the ns value, and active reset for M/N Counter, again */
+ val = 1 << 7;
+ val |= ns;
+ writel(val, ns_addr);
+
+ /* De-activate the reset for M/N Counter */
+ val = 1 << 7;
+ val = ~val;
+ val = val & readl(ns_addr);
+ writel(val, ns_addr);
+
+ /* Enable the Clock Root */
+ val = 1 << 11;
+ val = val | readl(ns_addr);
+ writel(val, ns_addr);
+
+ /* Enable the Clock Branch */
+ val = 1 << 9;
+ val = val | readl(ns_addr);
+ writel(val, ns_addr);
+
+ /* Enable the M/N Counter */
+ val = 1 << 8;
+ val = val | readl(ns_addr);
+ writel(val, ns_addr);
+}
+
+void hsusb_clock_init(void)
+{
+ /* Setup XCVR clock */
+ clock_config(USB_XCVR_CLK_NS_VAL,
+ USB_XCVR_CLK_MD_VAL,
+ USB_HS1_XCVR_FS_CLK_NS,
+ USB_HS1_XCVR_FS_CLK_MD);
+}
+
+/* Configure UART clock - based on the gsbi id */
+void clock_config_uart_dm(uint8_t id)
+{
+ /* Enable gsbi_uart_clk */
+ clock_config(UART_DM_CLK_NS_115200,
+ UART_DM_CLK_MD_115200,
+ GSBIn_QUP_APPS_NS(id),
+ GSBIn_QUP_APPS_MD(id));
+
+ /* Configure clock selection register for tx and rx rates.
+ * Selecting 115.2k for both RX and TX.
+ */
+ writel(UART_DM_CLK_RX_TX_BIT_RATE, MSM_BOOT_UART_DM_CSR(id));
+
+ /* Enable gsbi_pclk */
+ writel(GSBI_HCLK_CTL_CLK_ENA << GSBI_HCLK_CTL_S, GSBIn_HCLK_CTL(id));
+}
+
+
+/* Intialize MMC clock */
+void clock_init_mmc(uint32_t interface)
+{
+ /* Nothing to be done. */
+}
+
+/* Configure MMC clock */
+void clock_config_mmc(uint32_t interface, uint32_t freq)
+{
+ uint32_t reg = 0;
+
+ switch(freq)
+ {
+ case MMC_CLK_400KHZ:
+ clock_config(SDC_CLK_NS_400KHZ,
+ SDC_CLK_MD_400KHZ,
+ SDC_NS(interface),
+ SDC_MD(interface));
+ break;
+ case MMC_CLK_48MHZ:
+ case MMC_CLK_50MHZ: /* Max supported is 48MHZ */
+ clock_config(SDC_CLK_NS_48MHZ,
+ SDC_CLK_MD_48MHZ,
+ SDC_NS(interface),
+ SDC_MD(interface));
+ break;
+ default:
+ ASSERT(0);
+
+ }
+
+ reg |= MMC_BOOT_MCI_CLK_ENABLE;
+ reg |= MMC_BOOT_MCI_CLK_ENA_FLOW;
+ reg |= MMC_BOOT_MCI_CLK_IN_FEEDBACK;
+ writel( reg, MMC_BOOT_MCI_CLK );
+}
+
diff --git a/platform/apq8064/gpio.c b/platform/apq8064/gpio.c
new file mode 100644
index 0000000..2a10c8d
--- /dev/null
+++ b/platform/apq8064/gpio.c
@@ -0,0 +1,77 @@
+/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of Code Aurora Forum, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <reg.h>
+#include <debug.h>
+#include <gsbi.h>
+#include <platform/iomap.h>
+#include <platform/gpio.h>
+
+void gpio_tlmm_config(uint32_t gpio,
+ uint8_t func,
+ uint8_t dir,
+ uint8_t pull,
+ uint8_t drvstr,
+ uint32_t enable)
+{
+ uint32_t val = 0;
+
+ val |= pull;
+ val |= func << 2;
+ val |= drvstr << 6;
+ val |= enable << 9;
+
+ writel(val, GPIO_CONFIG_ADDR(gpio));
+}
+
+void gpio_set(uint32_t gpio, uint32_t dir)
+{
+ writel(dir, GPIO_IN_OUT_ADDR(gpio));
+}
+
+/* Configure gpio for uart - based on gsbi id */
+void gpio_config_uart_dm(uint8_t id)
+{
+ switch (id)
+ {
+ case GSBI_ID_3:
+
+ /* configure rx gpio */
+ gpio_tlmm_config(15, 1, GPIO_INPUT, GPIO_NO_PULL,
+ GPIO_8MA, GPIO_DISABLE);
+
+ /* configure tx gpio */
+ gpio_tlmm_config(14, 1, GPIO_OUTPUT, GPIO_NO_PULL,
+ GPIO_8MA, GPIO_DISABLE);
+ break;
+
+ default:
+ ASSERT(0);
+ }
+}
+
diff --git a/platform/apq8064/include/platform/clock.h b/platform/apq8064/include/platform/clock.h
new file mode 100644
index 0000000..6267940
--- /dev/null
+++ b/platform/apq8064/include/platform/clock.h
@@ -0,0 +1,49 @@
+/*
+ * * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of Code Aurora Forum, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef __PLATFORM_APQ8064_CLOCK_H
+#define __PLATFORM_APQ8064_CLOCK_H
+
+/* NS/MD value for USB XCVR */
+#define USB_XCVR_CLK_NS_VAL 0x00E400C3
+#define USB_XCVR_CLK_MD_VAL 0x000500DF
+
+/* NS/MD value for UART */
+#define UART_DM_CLK_NS_115200 0xFFE40040
+#define UART_DM_CLK_MD_115200 0x0002FFE2
+
+#define UART_DM_CLK_RX_TX_BIT_RATE 0xFF
+
+/* NS/MD value for MMC */
+#define SDC_CLK_NS_400KHZ 0x00440040
+#define SDC_CLK_MD_400KHZ 0x00010043
+
+#define SDC_CLK_NS_48MHZ 0x00FE005B
+#define SDC_CLK_MD_48MHZ 0x000100FD
+
+#endif
diff --git a/platform/apq8064/include/platform/gpio.h b/platform/apq8064/include/platform/gpio.h
new file mode 100644
index 0000000..93d81de
--- /dev/null
+++ b/platform/apq8064/include/platform/gpio.h
@@ -0,0 +1,60 @@
+/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of Code Aurora Forum, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __PLATFORM_APQ8064_GPIO_H
+#define __PLATFORM_APQ8064_GPIO_H
+
+
+/* GPIO TLMM: Direction */
+#define GPIO_INPUT 0
+#define GPIO_OUTPUT 1
+
+/* GPIO TLMM: Pullup/Pulldown */
+#define GPIO_NO_PULL 0
+#define GPIO_PULL_DOWN 1
+#define GPIO_KEEPER 2
+#define GPIO_PULL_UP 3
+
+/* GPIO TLMM: Drive Strength */
+#define GPIO_2MA 0
+#define GPIO_4MA 1
+#define GPIO_6MA 2
+#define GPIO_8MA 3
+#define GPIO_10MA 4
+#define GPIO_12MA 5
+#define GPIO_14MA 6
+#define GPIO_16MA 7
+
+/* GPIO TLMM: Status */
+#define GPIO_ENABLE 0
+#define GPIO_DISABLE 1
+
+
+void gpio_config_uart_dm(uint8_t id);
+
+#endif
diff --git a/platform/apq8064/include/platform/iomap.h b/platform/apq8064/include/platform/iomap.h
new file mode 100644
index 0000000..b86b7ac
--- /dev/null
+++ b/platform/apq8064/include/platform/iomap.h
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google, Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _PLATFORM_APQ8064_IOMAP_H_
+#define _PLATFORM_APQ8064_IOMAP_H_
+
+#define MSM_IOMAP_BASE 0x00100000
+#define MSM_IOMAP_END 0x28000000
+
+/* Shared memory */
+#define MSM_SHARED_BASE 0x80000000
+#define MSM_SHARED_IMEM_BASE 0x2A03F000
+#define RESTART_REASON_ADDR (MSM_SHARED_IMEM_BASE + 0x65C)
+
+/* Peripherals */
+#define TLMM_BASE_ADDR 0x00800000
+
+/* GPIO */
+#define GPIO_CONFIG_ADDR(x) (TLMM_BASE_ADDR + 0x1000 + (x)*0x10)
+#define GPIO_IN_OUT_ADDR(x) (TLMM_BASE_ADDR + 0x1004 + (x)*0x10)
+
+/* CLK CTL */
+#define CLK_CTL_BASE 0x00900000
+#define SDC_MD(n) (CLK_CTL_BASE + 0x2828 + (32 * ((n) - 1)))
+#define SDC_NS(n) (CLK_CTL_BASE + 0x282C + (32 * ((n) - 1)))
+#define USB_HS1_HCLK_CTL (CLK_CTL_BASE + 0x2900)
+#define USB_HS1_XCVR_FS_CLK_MD (CLK_CTL_BASE + 0x2908)
+#define USB_HS1_XCVR_FS_CLK_NS (CLK_CTL_BASE + 0x290C)
+#define GSBIn_HCLK_CTL(n) (CLK_CTL_BASE + 0x29C0 + (32 * ((n) - 1)))
+#define GSBIn_HCLK_FS(n) (CLK_CTL_BASE + 0x29C4 + (32 * ((n) - 1)))
+#define GSBIn_QUP_APPS_MD(n) (CLK_CTL_BASE + 0x29C8 + (32 * ((n) - 1)))
+#define GSBIn_QUP_APPS_NS(n) (CLK_CTL_BASE + 0x29CC + (32 * ((n) - 1)))
+#define GSBIn_UART_APPS_MD(n) (CLK_CTL_BASE + 0x29D0 + (32 * ((n) - 1)))
+#define GSBIn_UART_APPS_NS(n) (CLK_CTL_BASE + 0x29D4 + (32 * ((n) - 1)))
+#define MSM_BOOT_PLL8_STATUS (CLK_CTL_BASE + 0x3158)
+#define MSM_BOOT_PLL_ENABLE_SC0 (CLK_CTL_BASE + 0x34C0)
+
+/* GIC */
+#define MSM_GIC_DIST_BASE 0x02000000
+#define MSM_GIC_CPU_BASE 0x02002000
+
+/* TMR */
+#define MSM_TMR_BASE 0x0200A000
+#define MSM_GPT_BASE (MSM_TMR_BASE + 0x04)
+#define MSM_DGT_BASE (MSM_TMR_BASE + 0x24)
+#define MSM_WDT0_RST (MSM_TMR_BASE + 0x38)
+#define MSM_WDT0_EN (MSM_TMR_BASE + 0x40)
+#define MSM_WDT0_BT (MSM_TMR_BASE + 0x4C)
+#define SPSS_TIMER_STATUS (MSM_TMR_BASE + 0x88)
+
+#define GPT_REG(off) (MSM_GPT_BASE + (off))
+#define DGT_REG(off) (MSM_DGT_BASE + (off))
+
+#define GPT_MATCH_VAL GPT_REG(0x0000)
+#define GPT_COUNT_VAL GPT_REG(0x0004)
+#define GPT_ENABLE GPT_REG(0x0008)
+#define GPT_CLEAR GPT_REG(0x000C)
+
+#define DGT_MATCH_VAL DGT_REG(0x0000)
+#define DGT_COUNT_VAL DGT_REG(0x0004)
+#define DGT_ENABLE DGT_REG(0x0008)
+#define DGT_CLEAR DGT_REG(0x000C)
+#define DGT_CLK_CTL DGT_REG(0x0010)
+
+#define MSM_USB_BASE 0x12500000
+#define MSM_TCSR_BASE 0x1A400000
+#define MSM_TCSR_WDOG_CFG (MSM_TCSR_BASE + 0x30)
+
+/* SDCC */
+#define MSM_SDC1_BASE 0x12400000
+#define MSM_SDC2_BASE 0x12140000
+#define MSM_SDC3_BASE 0x12180000
+#define MSM_SDC4_BASE 0x121C0000
+
+
+/* GSBI/QUP/UART_DM */
+#define GSBI_BASE(id) ((id) <= 7 ? (0x16000000 + (((id)-1) << 20)) : \
+ (0x1A000000 + (((id)-8) << 20)))
+#define GSBI_UART_DM_BASE(id) (GSBI_BASE(id) + 0x40000)
+#define QUP_BASE(id) (GSBI_BASE(id) + 0x80000)
+
+#endif
diff --git a/platform/apq8064/include/platform/irqs.h b/platform/apq8064/include/platform/irqs.h
new file mode 100644
index 0000000..48a8a96
--- /dev/null
+++ b/platform/apq8064/include/platform/irqs.h
@@ -0,0 +1,62 @@
+/* Copyright (c) 2009-2011, Code Aurora Forum. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Code Aurora nor
+ * the names of its contributors may be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef __IRQS_APQ8064_H
+#define __IRQS_APQ8064_H
+
+/* MSM ACPU Interrupt Numbers */
+
+/* 0-15: STI/SGI (software triggered/generated interrupts)
+ * 16-31: PPI (private peripheral interrupts)
+ * 32+: SPI (shared peripheral interrupts)
+ */
+
+#define GIC_PPI_START 16
+#define GIC_SPI_START 32
+
+#define INT_DEBUG_TIMER_EXP (GIC_PPI_START + 1)
+
+#define USB1_HS_BAM_IRQ (GIC_SPI_START + 94)
+#define USB1_HS_IRQ (GIC_SPI_START + 100)
+#define USB2_IRQ (GIC_SPI_START + 141)
+#define USB1_IRQ (GIC_SPI_START + 142)
+
+#define GSBI_QUP_IRQ(id) ((id) <= 8 ? (GIC_SPI_START + 145 + 2*(id)) : \
+ (GIC_SPI_START + 187 + 2*((id)-8)))
+
+
+/* Retrofit universal macro names */
+#define INT_USB_HS USB1_HS_IRQ
+
+#define NR_MSM_IRQS 256
+#define NR_GPIO_IRQS 173
+#define NR_BOARD_IRQS 0
+
+#define NR_IRQS (NR_MSM_IRQS + NR_GPIO_IRQS + NR_BOARD_IRQS)
+
+#endif
diff --git a/platform/apq8064/platform.c b/platform/apq8064/platform.c
new file mode 100644
index 0000000..af1e2f4
--- /dev/null
+++ b/platform/apq8064/platform.c
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google, Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <reg.h>
+#include <debug.h>
+#include <uart_dm.h>
+#include <qgic.h>
+#include <platform/iomap.h>
+#include <mmu.h>
+#include <qgic.h>
+#include <arch/arm/mmu.h>
+
+extern void platform_init_timer(void);
+extern uint8_t target_uart_gsbi(void);
+
+static uint32_t ticks_per_sec = 0;
+
+#define MB (1024*1024)
+#define MSM_IOMAP_SIZE ((MSM_IOMAP_END - MSM_IOMAP_BASE)/MB)
+
+/* Scratch region - cacheable, write through */
+#define CACHEABLE_MEMORY (MMU_MEMORY_TYPE_NORMAL_WRITE_THROUGH | \
+ MMU_MEMORY_AP_READ_WRITE)
+
+/* Peripherals - non-shared device */
+#define IOMAP_MEMORY (MMU_MEMORY_TYPE_DEVICE_NON_SHARED | \
+ MMU_MEMORY_AP_READ_WRITE)
+
+mmu_section_t mmu_section_table[] = {
+/* Physical addr, Virtual addr, Size (in MB), Flags */
+ {MEMBASE, MEMBASE, (MEMSIZE/MB), CACHEABLE_MEMORY},
+ {SCRATCH_ADDR, SCRATCH_ADDR, SCRATCH_SIZE, CACHEABLE_MEMORY},
+ {MSM_IOMAP_BASE, MSM_IOMAP_BASE, MSM_IOMAP_SIZE, IOMAP_MEMORY},
+};
+
+void platform_early_init(void)
+{
+ uart_init(target_uart_gsbi());
+ qgic_init();
+ platform_init_timer();
+}
+
+void platform_init(void)
+{
+ dprintf(INFO, "platform_init()\n");
+}
+
+/* Setup memory for this platform */
+void platform_init_mmu_mappings(void)
+{
+ uint32_t i;
+ uint32_t sections;
+ uint32_t table_size = ARRAY_SIZE(mmu_section_table);
+
+ for (i = 0; i < table_size; i++)
+ {
+ sections = mmu_section_table[i].num_of_sections;
+
+ while (sections--)
+ {
+ arm_mmu_map_section(mmu_section_table[i].paddress + sections*MB,
+ mmu_section_table[i].vaddress + sections*MB,
+ mmu_section_table[i].flags);
+ }
+ }
+}
+
+/* Initialize DGT timer */
+void platform_init_timer(void)
+{
+ /* disable timer */
+ writel(0, DGT_ENABLE);
+
+ /* DGT uses LPXO source which is 27MHz.
+ * Set clock divider to 4.
+ */
+ writel(3, DGT_CLK_CTL);
+
+ ticks_per_sec = 6750000; /* (27 MHz / 4) */
+}
+
+/* Returns timer ticks per sec */
+uint32_t platform_tick_rate(void)
+{
+ return ticks_per_sec;
+}
diff --git a/platform/apq8064/rules.mk b/platform/apq8064/rules.mk
new file mode 100644
index 0000000..9447f04
--- /dev/null
+++ b/platform/apq8064/rules.mk
@@ -0,0 +1,22 @@
+LOCAL_DIR := $(GET_LOCAL_DIR)
+
+ARCH := arm
+ARM_CPU := cortex-a8
+CPU := generic
+
+DEFINES += ARM_CPU_CORE_KRAIT
+
+INCLUDES += -I$(LOCAL_DIR)/include -I$(LK_TOP_DIR)/platform/msm_shared/include
+
+DEVS += fbcon
+MODULES += dev/fbcon
+
+OBJS += \
+ $(LOCAL_DIR)/platform.o \
+ $(LOCAL_DIR)/clock.o \
+ $(LOCAL_DIR)/gpio.o \
+
+LINKER_SCRIPT += $(BUILDDIR)/system-onesegment.ld
+
+include platform/msm_shared/rules.mk
+
diff --git a/platform/msm7k/include/platform/iomap.h b/platform/msm7k/include/platform/iomap.h
index 1294542..28347a9 100644
--- a/platform/msm7k/include/platform/iomap.h
+++ b/platform/msm7k/include/platform/iomap.h
@@ -41,6 +41,20 @@
#define MSM_VIC_BASE 0xC0000000
#define MSM_GPT_BASE 0xC0100000
+
+#define GPT_REG(off) (MSM_GPT_BASE + (off))
+
+#define GPT_MATCH_VAL GPT_REG(0x0000)
+#define GPT_COUNT_VAL GPT_REG(0x0004)
+#define GPT_ENABLE GPT_REG(0x0008)
+#define GPT_CLEAR GPT_REG(0x000C)
+#define DGT_MATCH_VAL GPT_REG(0x0010)
+#define DGT_COUNT_VAL GPT_REG(0x0014)
+#define DGT_ENABLE GPT_REG(0x0018)
+#define DGT_CLEAR GPT_REG(0x001C)
+#define SPSS_TIMER_STATUS GPT_REG(0x0034)
+
+
#define MSM_CSR_BASE 0xC0100000
#define MSM_CLK_CTL_BASE 0xA8600000
diff --git a/platform/msm7k/platform.c b/platform/msm7k/platform.c
index a96a1e4..dfbb4db 100644
--- a/platform/msm7k/platform.c
+++ b/platform/msm7k/platform.c
@@ -31,9 +31,11 @@
* SUCH DAMAGE.
*/
+#include <reg.h>
#include <debug.h>
#include <kernel/thread.h>
#include <platform/debug.h>
+#include <platform/iomap.h>
#include <mddi.h>
#include <dev/fbcon.h>
#include <arch/arm/mmu.h>
@@ -42,6 +44,8 @@
static struct fbcon_config *fb_config;
+static uint32_t ticks_per_sec = 0;
+
void platform_init_interrupts(void);
void platform_init_timer();
@@ -54,9 +58,6 @@
void platform_early_init(void)
{
- //uart3_clock_init();
- //uart_init();
-
platform_init_interrupts();
platform_init_timer();
}
@@ -97,3 +98,18 @@
MMU_MEMORY_AP_READ_WRITE));
}
}
+
+/* Initialize DGT timer */
+void platform_init_timer(void)
+{
+ /* disable timer */
+ writel(0, DGT_ENABLE);
+
+ ticks_per_sec = 19200000; /* Uses TCXO (19.2 MHz) */
+}
+
+/* Returns timer ticks per sec */
+uint32_t platform_tick_rate(void)
+{
+ return ticks_per_sec;
+}
diff --git a/platform/msm7x27a/include/platform/iomap.h b/platform/msm7x27a/include/platform/iomap.h
index 6b3b441..ce0da18 100644
--- a/platform/msm7x27a/include/platform/iomap.h
+++ b/platform/msm7x27a/include/platform/iomap.h
@@ -41,6 +41,19 @@
#define MSM_VIC_BASE 0xC0000000
#define MSM_GPT_BASE 0xC0100000
+
+#define GPT_REG(off) (MSM_GPT_BASE + (off))
+
+#define GPT_MATCH_VAL GPT_REG(0x0000)
+#define GPT_COUNT_VAL GPT_REG(0x0004)
+#define GPT_ENABLE GPT_REG(0x0008)
+#define GPT_CLEAR GPT_REG(0x000C)
+#define DGT_MATCH_VAL GPT_REG(0x0010)
+#define DGT_COUNT_VAL GPT_REG(0x0014)
+#define DGT_ENABLE GPT_REG(0x0018)
+#define DGT_CLEAR GPT_REG(0x001C)
+#define SPSS_TIMER_STATUS GPT_REG(0x0034)
+
#define MSM_CSR_BASE 0xC0100000
#define MSM_CLK_CTL_BASE 0xA8600000
diff --git a/platform/msm7x27a/platform.c b/platform/msm7x27a/platform.c
index bda2652..056d8d0 100644
--- a/platform/msm7x27a/platform.c
+++ b/platform/msm7x27a/platform.c
@@ -31,14 +31,18 @@
* SUCH DAMAGE.
*/
+#include <reg.h>
#include <debug.h>
#include <kernel/thread.h>
#include <platform/debug.h>
+#include <platform/iomap.h>
#include <mddi.h>
#include <dev/fbcon.h>
static struct fbcon_config *fb_config;
+static uint32_t ticks_per_sec = 0;
+
void platform_init_interrupts(void);
void platform_init_timer();
@@ -86,3 +90,18 @@
display_shutdown();
#endif
}
+
+/* Initialize DGT timer */
+void platform_init_timer(void)
+{
+ /* disable timer */
+ writel(0, DGT_ENABLE);
+
+ ticks_per_sec = 19200000; /* Uses TCXO (19.2 MHz) */
+}
+
+/* Returns timer ticks per sec */
+uint32_t platform_tick_rate(void)
+{
+ return ticks_per_sec;
+}
diff --git a/platform/msm7x30/include/platform/iomap.h b/platform/msm7x30/include/platform/iomap.h
index 68a990c..e05f618 100644
--- a/platform/msm7x30/include/platform/iomap.h
+++ b/platform/msm7x30/include/platform/iomap.h
@@ -39,7 +39,27 @@
#define MSM_VIC_BASE 0xC0080000
#define MSM_TMR_BASE 0xC0100000
-#define MSM_GPT_BASE (MSM_TMR_BASE + 0x04)
+
+#define MSM_GPT_BASE (MSM_TMR_BASE + 0x04)
+#define MSM_DGT_BASE (MSM_TMR_BASE + 0x24)
+#define SPSS_TIMER_STATUS (MSM_TMR_BASE + 0x88)
+
+#define GPT_REG(off) (MSM_GPT_BASE + (off))
+#define DGT_REG(off) (MSM_DGT_BASE + (off))
+
+#define GPT_MATCH_VAL GPT_REG(0x0000)
+#define GPT_COUNT_VAL GPT_REG(0x0004)
+#define GPT_ENABLE GPT_REG(0x0008)
+#define GPT_CLEAR GPT_REG(0x000C)
+
+#define DGT_MATCH_VAL DGT_REG(0x0000)
+#define DGT_COUNT_VAL DGT_REG(0x0004)
+#define DGT_ENABLE DGT_REG(0x0008)
+#define DGT_CLEAR DGT_REG(0x000C)
+#define DGT_CLK_CTL DGT_REG(0x0010)
+
+#define HW_REVISION_NUMBER 0xABC00270
+
#define MSM_CSR_BASE 0xC0100000
#define MSM_GCC_BASE 0xC0182000
diff --git a/platform/msm7x30/platform.c b/platform/msm7x30/platform.c
index 5dcaa63..79c6a1d 100644
--- a/platform/msm7x30/platform.c
+++ b/platform/msm7x30/platform.c
@@ -36,6 +36,7 @@
#include <dev/fbcon.h>
#include <kernel/thread.h>
#include <platform/debug.h>
+#include <platform/iomap.h>
#include <mddi_hw.h>
#include "gpio_hw.h"
#include <dev/lcdc.h>
@@ -47,6 +48,7 @@
void uart_init(void);
struct fbcon_config *lcdc_init(void);
+static uint32_t ticks_per_sec = 0;
#define ARRAY_SIZE(a) (sizeof(a)/(sizeof((a)[0])))
@@ -156,3 +158,30 @@
display_shutdown();
#endif
}
+
+/* Initialize DGT timer */
+void platform_init_timer(void)
+{
+ uint32_t val = 0;
+
+ /* Disable timer */
+ writel(0, DGT_ENABLE);
+
+ /* Check for the hardware revision */
+ val = readl(HW_REVISION_NUMBER);
+ val = (val >> 28) & 0x0F;
+ if(val >= 1)
+ writel(1, DGT_CLK_CTL);
+
+#if _EMMC_BOOT
+ ticks_per_sec = 19200000; /* Uses TCXO (19.2 MHz) */
+#else
+ ticks_per_sec = 6144000; /* Uses LPXO/4 (24.576 MHz / 4) */
+#endif
+}
+
+/* Returns platform specific ticks per sec */
+uint32_t platform_tick_rate(void)
+{
+ return ticks_per_sec;
+}
diff --git a/platform/msm8960/include/platform/clock.h b/platform/msm8960/include/platform/clock.h
index f254f36..ae95601 100644
--- a/platform/msm8960/include/platform/clock.h
+++ b/platform/msm8960/include/platform/clock.h
@@ -71,6 +71,7 @@
#define DSI_NS_REG REG_MM(0x54)
#define DSI_MD_REG REG_MM(0x50)
#define DSI_CC_REG REG_MM(0x4C)
+#define MISC_CC2_REG REG_MM(0x5C)
#define MDP_LUT_CC_REG REG_MM(0x016C)
#define MM_PLL1_MODE_REG REG_MM(0x031C)
diff --git a/platform/msm8960/include/platform/iomap.h b/platform/msm8960/include/platform/iomap.h
index 78d2ca9..e72efd6 100644
--- a/platform/msm8960/include/platform/iomap.h
+++ b/platform/msm8960/include/platform/iomap.h
@@ -46,6 +46,22 @@
#define MSM_GIC_DIST_BASE 0x02000000
#define MSM_TMR_BASE 0x0200A000
#define MSM_GPT_BASE (MSM_TMR_BASE + 0x04)
+#define MSM_DGT_BASE (MSM_TMR_BASE + 0x24)
+#define SPSS_TIMER_STATUS (MSM_TMR_BASE + 0x88)
+
+#define GPT_REG(off) (MSM_GPT_BASE + (off))
+#define DGT_REG(off) (MSM_DGT_BASE + (off))
+
+#define GPT_MATCH_VAL GPT_REG(0x0000)
+#define GPT_COUNT_VAL GPT_REG(0x0004)
+#define GPT_ENABLE GPT_REG(0x0008)
+#define GPT_CLEAR GPT_REG(0x000C)
+
+#define DGT_MATCH_VAL DGT_REG(0x0000)
+#define DGT_COUNT_VAL DGT_REG(0x0004)
+#define DGT_ENABLE DGT_REG(0x0008)
+#define DGT_CLEAR DGT_REG(0x000C)
+#define DGT_CLK_CTL DGT_REG(0x0010)
#define MSM_GIC_CPU_BASE 0x02002000
#define MSM_VIC_BASE 0x02080000
@@ -92,4 +108,33 @@
#define MSM_MMSS_CLK_CTL_BASE 0x04000000
+#define MIPI_DSI_BASE (0x04700000)
+#define REG_DSI(off) (MIPI_DSI_BASE + (off))
+
+#define DSIPHY_REGULATOR_BASE (0x500)
+#define DSIPHY_TIMING_BASE (0x440)
+#define DSIPHY_CTRL_BASE (0x470)
+#define DSIPHY_PLL_BASE (0x200)
+#define DSIPHY_STRENGTH_BASE (0x480)
+
+/* Range 0 - 4 */
+#define DSIPHY_REGULATOR_CTRL(x) REG_DSI(DSIPHY_REGULATOR_BASE + (x) * 4)
+/* Range 0 - 11 */
+#define DSIPHY_TIMING_CTRL(x) REG_DSI(DSIPHY_TIMING_BASE + (x) * 4)
+/* Range 0 - 3 */
+#define DSIPHY_CTRL(x) REG_DSI(DSIPHY_CTRL_BASE + (x) * 4)
+/* Range 0 - 2 */
+#define DSIPHY_STRENGTH_CTRL(x) REG_DSI(DSIPHY_STRENGTH_BASE + (x) * 4)
+/* Range 0 - 19 */
+#define DSIPHY_PLL_CTRL(x) REG_DSI(DSIPHY_PLL_BASE + (x) * 4)
+
+//TODO: Use mem on the stack
+#define DSI_CMD_DMA_MEM_START_ADDR_PANEL (0x90000000)
+
+#define MDP_BASE (0x05100000)
+#define REG_MDP(off) (MDP_BASE + (off))
+
+//TODO: Where does this go?
+#define MMSS_SFPB_GPREG (0x05700058)
+
#endif
diff --git a/platform/msm8960/platform.c b/platform/msm8960/platform.c
index 4f20bc1..d20af34 100644
--- a/platform/msm8960/platform.c
+++ b/platform/msm8960/platform.c
@@ -45,6 +45,8 @@
extern struct fbcon_config *mipi_init(void);
extern void mipi_dsi_shutdown(void);
+static uint32_t ticks_per_sec = 0;
+
#define MB (1024*1024)
#define MSM_IOMAP_SIZE ((MSM_IOMAP_END - MSM_IOMAP_BASE)/MB)
@@ -89,6 +91,8 @@
void display_init(void){
struct fbcon_config *fb_cfg;
+ panel_backlight_on();
+
mipi_dsi_panel_power_on();
mipi_panel_reset();
@@ -131,3 +135,23 @@
}
}
}
+
+/* Initialize DGT timer */
+void platform_init_timer(void)
+{
+ /* disable timer */
+ writel(0, DGT_ENABLE);
+
+ /* DGT uses LPXO source which is 27MHz.
+ * Set clock divider to 4.
+ */
+ writel(3, DGT_CLK_CTL);
+
+ ticks_per_sec = 6750000; /* (27 MHz / 4) */
+}
+
+/* Returns timer ticks per sec */
+uint32_t platform_tick_rate(void)
+{
+ return ticks_per_sec;
+}
diff --git a/platform/msm8x60/acpuclock.c b/platform/msm8x60/acpuclock.c
index 0577bb8..544fc5a 100644
--- a/platform/msm8x60/acpuclock.c
+++ b/platform/msm8x60/acpuclock.c
@@ -367,3 +367,60 @@
reg |= MMC_BOOT_MCI_CLK_IN_FEEDBACK;
writel( reg, MMC_BOOT_MCI_CLK );
}
+
+void mdp_clock_init(void)
+{
+ /* Turn on the PLL2, to ramp up the MDP clock to max (200MHz) */
+ nt_pll_enable(PLL_2, 1);
+
+ config_mdp_clk(MDP_NS_VAL, MDP_MD_VAL,
+ MDP_CC_VAL, MDP_NS_REG, MDP_MD_REG, MDP_CC_REG);
+}
+
+void mmss_pixel_clock_configure(void)
+{
+ config_pixel_clk(PIXEL_NS_VAL, PIXEL_MD_VAL,
+ PIXEL_CC_VAL, MMSS_PIXEL_NS_REG,
+ MMSS_PIXEL_MD_REG, MMSS_PIXEL_CC_REG);
+}
+
+void configure_dsicore_dsiclk()
+{
+ unsigned char mnd_mode, root_en, clk_en;
+ unsigned long src_sel = 0x3; // dsi_phy_pll0_src
+ unsigned long pre_div_func = 0x00; // predivide by 1
+ unsigned long pmxo_sel;
+
+ secure_writel(pre_div_func << 14 | src_sel, DSI_NS_REG);
+ mnd_mode = 0; // Bypass MND
+ root_en = 1;
+ clk_en = 1;
+ pmxo_sel = 0;
+
+ secure_writel((pmxo_sel << 8) | (mnd_mode << 6), DSI_CC_REG);
+ secure_writel(secure_readl(DSI_CC_REG) | root_en << 2, DSI_CC_REG);
+ secure_writel(secure_readl(DSI_CC_REG) | clk_en, DSI_CC_REG);
+}
+
+void configure_dsicore_byteclk(void)
+{
+ secure_writel(0x00400401, MISC_CC2_REG); // select pxo
+}
+
+void configure_dsicore_pclk(void)
+{
+ unsigned char mnd_mode, root_en, clk_en;
+ unsigned long src_sel = 0x3; // dsi_phy_pll0_src
+ unsigned long pre_div_func = 0x01; // predivide by 2
+
+ secure_writel(pre_div_func << 12 | src_sel, PIXEL_NS_REG);
+
+ mnd_mode = 0; // Bypass MND
+ root_en = 1;
+ clk_en = 1;
+ secure_writel(mnd_mode << 6, PIXEL_CC_REG);
+ secure_writel(secure_readl(PIXEL_CC_REG) | root_en << 2,
+ PIXEL_CC_REG);
+ secure_writel(secure_readl(PIXEL_CC_REG) | clk_en,
+ PIXEL_CC_REG);
+}
diff --git a/platform/msm8x60/include/platform/clock.h b/platform/msm8x60/include/platform/clock.h
index 7f8f818..0783efc 100644
--- a/platform/msm8x60/include/platform/clock.h
+++ b/platform/msm8x60/include/platform/clock.h
@@ -29,8 +29,6 @@
#ifndef __PLATFORM_MSM8X60_CLOCK_H
#define __PLATFORM_MSM8X60_CLOCK_H
-/* MMSS CLK CTR base address */
-#define MSM_MMSS_CLK_CTL_BASE 0x04000000
#define MSM_MMSS_CLK_CTL_SIZE 4096
#define REG_MM(off) (MSM_MMSS_CLK_CTL_BASE + (off))
@@ -56,19 +54,28 @@
#define MM_PLL2_STATUS_REG REG_MM(0x0350)
/* LCD related clock defines */
-#define MMSS_AHB_NS_REG (MSM_MMSS_CLK_CTL_BASE + 0x04)
-#define MMSS_AHB_EN_REG (MSM_MMSS_CLK_CTL_BASE + 0x08)
-#define MMSS_AXI_NS_REG (MSM_MMSS_CLK_CTL_BASE + 0x14)
-#define MMSS_MAXI_EN_REG (MSM_MMSS_CLK_CTL_BASE + 0x18)
-#define MMSS_MAXI_EN2_REG (MSM_MMSS_CLK_CTL_BASE + 0x20)
-#define MMSS_SAXI_EN_REG (MSM_MMSS_CLK_CTL_BASE + 0x30)
+#define MMSS_AHB_NS_REG REG_MM(0x04)
+#define MMSS_AHB_EN_REG REG_MM(0x08)
+#define MMSS_AXI_NS_REG REG_MM(0x14)
+#define MMSS_MAXI_EN_REG REG_MM(0x18)
+#define MMSS_MAXI_EN2_REG REG_MM(0x20)
+#define MMSS_SAXI_EN_REG REG_MM(0x30)
+#define DSI_NS_REG REG_MM(0x54)
+#define DSI_MD_REG REG_MM(0x50)
+#define DSI_CC_REG REG_MM(0x4C)
+#define MISC_CC2_REG REG_MM(0x5C)
-#define MDP_CC_REG (MSM_MMSS_CLK_CTL_BASE + 0xC0)
-#define MDP_MD_REG (MSM_MMSS_CLK_CTL_BASE + 0xC4)
-#define MDP_NS_REG (MSM_MMSS_CLK_CTL_BASE + 0xD0)
-#define LCD_PIXEL_CC_REG (MSM_MMSS_CLK_CTL_BASE + 0xD4)
-#define LCD_PIXEL_NS_REG (MSM_MMSS_CLK_CTL_BASE + 0xDC)
-#define LCD_PIXEL_MD_REG (MSM_MMSS_CLK_CTL_BASE + 0xD8)
+#define MDP_CC_REG REG_MM(0xC0)
+#define MDP_MD_REG REG_MM(0xC4)
+#define MDP_NS_REG REG_MM(0xD0)
+#define MMSS_PIXEL_MD_REG REG_MM(0xD8)
+#define MMSS_PIXEL_NS_REG REG_MM(0xDC)
+#define MMSS_PIXEL_CC_REG REG_MM(0xD4)
+
+/* MMSS DSI Pixel Registers not MMSS Pixel */
+#define PIXEL_MD_REG REG_MM(0x134)
+#define PIXEL_NS_REG REG_MM(0x138)
+#define PIXEL_CC_REG REG_MM(0x130)
/* Configured at 200 MHz */
#define MDP_NS_VAL 0x3F000008
@@ -124,5 +131,7 @@
void hsusb_clock_init(void);
void clock_config_uart_dm(uint8_t id);
void clock_config_i2c(uint8_t id, uint32_t freq);
+void mdp_clock_init(void);
+void mmss_pixel_clock_configure(void);
#endif
diff --git a/platform/msm8x60/include/platform/iomap.h b/platform/msm8x60/include/platform/iomap.h
old mode 100755
new mode 100644
index 714c5c8..d6804b6
--- a/platform/msm8x60/include/platform/iomap.h
+++ b/platform/msm8x60/include/platform/iomap.h
@@ -41,7 +41,25 @@
#define MSM_VIC_BASE 0x02080000
-#define MSM_TMR_BASE 0x02000000
+#define MSM_TMR_BASE 0x02000000
+#define MSM_GPT_BASE (MSM_TMR_BASE + 0x04)
+#define MSM_DGT_BASE (MSM_TMR_BASE + 0x24)
+#define SPSS_TIMER_STATUS (MSM_TMR_BASE + 0x88)
+
+#define GPT_REG(off) (MSM_GPT_BASE + (off))
+#define DGT_REG(off) (MSM_DGT_BASE + (off))
+
+#define GPT_MATCH_VAL GPT_REG(0x0000)
+#define GPT_COUNT_VAL GPT_REG(0x0004)
+#define GPT_ENABLE GPT_REG(0x0008)
+#define GPT_CLEAR GPT_REG(0x000C)
+
+#define DGT_MATCH_VAL DGT_REG(0x0000)
+#define DGT_COUNT_VAL DGT_REG(0x0004)
+#define DGT_ENABLE DGT_REG(0x0008)
+#define DGT_CLEAR DGT_REG(0x000C)
+#define DGT_CLK_CTL DGT_REG(0x0010)
+
#define MSM_TCSR_BASE 0x16B00000
#define MSM_GIC_CPU_BASE 0x02081000
#define MSM_GIC_DIST_BASE 0x02080000
@@ -135,4 +153,36 @@
#define MSM_ADM_BASE 0x18400000
#define MSM_ADM_SD_OFFSET 0x00020800
+/* MMSS CLK CTR base address */
+#define MSM_MMSS_CLK_CTL_BASE 0x04000000
+
+#define MIPI_DSI_BASE (0x04700000)
+#define REG_DSI(off) (MIPI_DSI_BASE + (off))
+
+#define DSIPHY_REGULATOR_BASE (0x2CC)
+#define DSIPHY_TIMING_BASE (0x260)
+#define DSIPHY_CTRL_BASE (0x290)
+#define DSIPHY_PLL_BASE (0x200)
+#define DSIPHY_STRENGTH_BASE (0x2A0)
+
+/* Range 0 - 4 */
+#define DSIPHY_REGULATOR_CTRL(x) REG_DSI(DSIPHY_REGULATOR_BASE + (x) * 4)
+/* Range 0 - 11 */
+#define DSIPHY_TIMING_CTRL(x) REG_DSI(DSIPHY_TIMING_BASE + (x) * 4)
+/* Range 0 - 3 */
+#define DSIPHY_CTRL(x) REG_DSI(DSIPHY_CTRL_BASE + (x) * 4)
+/* Range 0 - 2 */
+#define DSIPHY_STRENGTH_CTRL(x) REG_DSI(DSIPHY_STRENGTH_BASE + (x) * 4)
+/* Range 0 - 19 */
+#define DSIPHY_PLL_CTRL(x) REG_DSI(DSIPHY_PLL_BASE + (x) * 4)
+
+//TODO: Use mem on the stack
+#define DSI_CMD_DMA_MEM_START_ADDR_PANEL (0x46000000)
+
+#define MDP_BASE (0x05100000)
+#define REG_MDP(off) (MDP_BASE + (off))
+
+//TODO: Where does this belong?
+#define MMSS_SFPB_GPREG (0x05700058)
+
#endif
diff --git a/platform/msm8x60/panel.c b/platform/msm8x60/panel.c
index 0e78ed3..47ceabb 100644
--- a/platform/msm8x60/panel.c
+++ b/platform/msm8x60/panel.c
@@ -361,19 +361,6 @@
}
-void mdp_clock_init(void)
-{
- /* Turn on the PLL2, to ramp up the MDP clock to max (200MHz) */
- nt_pll_enable(PLL_2, 1);
-
- config_mdp_clk(MDP_NS_VAL, MDP_MD_VAL,
- MDP_CC_VAL, MDP_NS_REG, MDP_MD_REG, MDP_CC_REG);
-
- config_pixel_clk(PIXEL_NS_VAL, PIXEL_MD_VAL,
- PIXEL_CC_VAL, LCD_PIXEL_NS_REG,
- LCD_PIXEL_MD_REG, LCD_PIXEL_CC_REG);
-}
-
void lcdc_on(void)
{
board_lcd_enable();
diff --git a/platform/msm8x60/platform.c b/platform/msm8x60/platform.c
index 80dae3b..cc17781 100644
--- a/platform/msm8x60/platform.c
+++ b/platform/msm8x60/platform.c
@@ -44,6 +44,8 @@
#include <mmu.h>
#include <arch/arm/mmu.h>
+static uint32_t ticks_per_sec = 0;
+
#define MB (1024*1024)
@@ -123,12 +125,17 @@
struct fbcon_config *fb_cfg;
#if DISPLAY_TYPE_LCDC
mdp_clock_init();
+ mmss_pixel_clock_configure();
fb_cfg = lcdc_init();
panel_poweron();
fbcon_setup(fb_cfg);
#endif
#if DISPLAY_TYPE_MIPI
mdp_clock_init();
+ configure_dsicore_dsiclk();
+ configure_dsicore_byteclk();
+ configure_dsicore_pclk();
+
fb_cfg = mipi_init();
fbcon_setup(fb_cfg);
#endif
@@ -223,3 +230,23 @@
display_shutdown();
#endif
}
+
+/* Initialize DGT timer */
+void platform_init_timer(void)
+{
+ /* disable timer */
+ writel(0, DGT_ENABLE);
+
+ /* DGT uses LPXO source which is 27MHz.
+ * Set clock divider to 4.
+ */
+ writel(3, DGT_CLK_CTL);
+
+ ticks_per_sec = 6750000; /* (27 MHz / 4) */
+}
+
+/* Returns timer ticks per sec */
+uint32_t platform_tick_rate(void)
+{
+ return ticks_per_sec;
+}
diff --git a/platform/msm_shared/hsusb.c b/platform/msm_shared/hsusb.c
index 363e76b..8f23802 100644
--- a/platform/msm_shared/hsusb.c
+++ b/platform/msm_shared/hsusb.c
@@ -41,11 +41,6 @@
#include "hsusb.h"
-int charger_usb_disconnected(void);
-int charger_usb_i(unsigned current);
-int charger_usb_is_pc_connected(void);
-int charger_usb_is_charger_connected(void);
-
/* common code - factor out into a shared file */
struct udc_descriptor {
@@ -445,11 +440,6 @@
endpoint_enable(ept, s.value);
}
usb_config_value = 1;
-#ifdef ENABLE_BATTERY_CHARGING
- if(HOST_CHARGER == TRUE) {
- charger_usb_i(500);
- }
-#endif
the_gadget->notify(the_gadget, UDC_EVENT_ONLINE);
} else {
writel(0, USB_ENDPTCTRL(1));
@@ -649,12 +639,7 @@
usb_status(0, usb_highspeed);
}
if (n & STS_SLI) {
- dprintf(INFO, "-- suspend --\n");
-#ifdef ENABLE_BATTERY_CHARGING
- if(HOST_CHARGER == TRUE){
- charger_usb_i(2);
- }
-#endif
+ DBG("-- suspend --\n");
}
if (n & STS_PCI) {
dprintf(INFO, "-- portchange --\n");
@@ -664,14 +649,6 @@
} else {
usb_highspeed = 0;
}
-#ifdef ENABLE_BATTERY_CHARGING
- if(HOST_CHARGER == TRUE && usb_config_value){
- charger_usb_i(500);
- }
- if(HOST_CHARGER == TRUE && !usb_config_value){
- charger_usb_i(100);
- }
-#endif
}
if (n & STS_UEI) {
DBG("STS_UEI\n");
@@ -835,142 +812,3 @@
return 0;
}
-void usb_stop_charging(unsigned stop_charging)
-{
- ENABLE_CHARGING = !stop_charging;
-}
-
-static inline unsigned is_usb_charging(void)
-{
- return ENABLE_CHARGING;
-}
-
-void usb_charger_reset(void)
-{
- usb_stop_charging(TRUE);
- charger_usb_disconnected();
-}
-
-/* Charger detection code
- * Set global flags WALL_CHARGER and
- * RETURN: type of charger connected
- * CHG_WALL
- * CHG_HOST_PC
- * */
-int usb_chg_detect_type(void)
-{
- int ret = CHG_UNDEFINED;
-
- if ((readl(USB_PORTSC) & PORTSC_LS) == PORTSC_LS)
- {
- if(charger_usb_is_charger_connected() == TRUE) {
- WALL_CHARGER = TRUE;
- HOST_CHARGER = FALSE;
- charger_usb_i(1500);
- ret = CHG_WALL;
- }
- }
- else
- {
- if(charger_usb_is_pc_connected() == TRUE) {
- WALL_CHARGER = FALSE;
- HOST_CHARGER = TRUE;
- ret = CHG_HOST_PC;
- }
- }
- return ret;
-}
-
-/* check if USB cable is connected
- *
- * RETURN: If cable connected return 1
- * If cable disconnected return 0
- */
-int is_usb_cable_connected(void)
-{
- /*Verify B Session Valid Bit to verify vbus status*/
- if (B_SESSION_VALID & readl(USB_OTGSC)) {
- return 1;
- } else {
- return 0;
- }
-}
-
-/* check for USB connection assuming USB is not pulled up.
- * It looks for suspend state bit in PORTSC register.
- *
- * RETURN: If cable connected return 1
- * If cable disconnected return 0
- */
-
-int usb_cable_status(void)
-{
- unsigned ret = 0;
- /*Verify B Session Valid Bit to verify vbus status*/
- writel(0x00080001, USB_USBCMD);
- thread_sleep(100);
-
- /*Check reset value of suspend state bit*/
- if (!((1<<7) & readl(USB_PORTSC))) {
- ret=1;
- }
- udc_stop();
- return ret;
-}
-
-void usb_charger_change_state(void)
-{
- int usb_connected;
-
- //User might have switched from host pc to wall charger. So keep checking
- //every time we are in the loop
-
- if(ENABLE_CHARGING == TRUE)
- {
- usb_connected = is_usb_cable_connected();
-
- if(usb_connected && !charger_connected)
- {
- //mdelay(20);
- thread_sleep(20);
- /* go to RUN mode (D+ pullup enable) */
- writel(0x00080001, USB_USBCMD);
- //mdelay(10);
- thread_sleep(10);
- usb_chg_detect_type();
- charger_connected = TRUE;
- }
- else if(!usb_connected && charger_connected)
- {
- /* disable D+ pull-up */
- writel(0x00080000, USB_USBCMD);
-
- /* Applicable only for 8k target */
- /*USB Spoof Disconnect Failure
- Symptoms:
- In USB peripheral mode, writing '0' to Run/Stop bit of the
- USBCMD register doesn't cause USB disconnection (spoof disconnect).
- The PC host doesn't detect the disconnection and the phone remains
- active on Windows device manager.
-
- Suggested Workaround:
- After writing '0' to Run/Stop bit of USBCMD, also write 0x48 to ULPI
- "Function Control" register. This can be done via the ULPI VIEWPORT
- register (offset 0x170) by writing a value of 0x60040048.
- */
- ulpi_write(0x48, 0x04);
- //usb_charger_reset();
- WALL_CHARGER = FALSE;
- HOST_CHARGER = FALSE;
- charger_usb_i(0);
- charger_usb_disconnected();
- charger_connected = FALSE;
- }
- if(WALL_CHARGER == TRUE || HOST_CHARGER == TRUE){
- //battery_charging_image();
- }
- }
- else if ((readl(USB_USBCMD) & 0x01) == 0){
- writel(0x00080001, USB_USBCMD);
- }
-}
diff --git a/platform/msm_shared/hsusb.h b/platform/msm_shared/hsusb.h
index 23cf7ce..5efa304 100644
--- a/platform/msm_shared/hsusb.h
+++ b/platform/msm_shared/hsusb.h
@@ -169,21 +169,4 @@
#define ULPI_DATA(n) ((n) & 255)
#define ULPI_DATA_READ(n) (((n) >> 8) & 255)
-/* for USB charging */
-#define TRUE 1
-#define FALSE 0
-#define PORTSC_LS (3 << 10) /* Read - Port's Line status */
-#define B_SESSION_VALID (1 << 11)
-
-static unsigned WALL_CHARGER = FALSE;
-static unsigned HOST_CHARGER = FALSE;
-static unsigned ENABLE_CHARGING = TRUE;
-static unsigned charger_connected = FALSE;
-
-enum charger_type {
- CHG_HOST_PC,
- CHG_WALL,
- CHG_UNDEFINED,
-};
-
#endif
diff --git a/platform/msm_shared/include/mdp4.h b/platform/msm_shared/include/mdp4.h
new file mode 100644
index 0000000..703a20f
--- /dev/null
+++ b/platform/msm_shared/include/mdp4.h
@@ -0,0 +1,91 @@
+/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of Code Aurora Forum, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+#include <dev/fbcon.h>
+
+//TODO: Make a global PASS / FAIL define
+#define PASS 0
+#define FAIL 1
+
+#define MDP_OVERLAYPROC0_START REG_MDP(0x00004)
+#define MDP_DMA_P_START REG_MDP(0x0000C)
+#define MDP_DMA_S_START REG_MDP(0x00010)
+#define MDP_AXI_RDMASTER_CONFIG REG_MDP(0x00028)
+#define MDP_AXI_WRMASTER_CONFIG REG_MDP(0x00030)
+#define MDP_DISP_INTF_SEL REG_MDP(0x00038)
+#define MDP_MAX_RD_PENDING_CMD_CONFIG REG_MDP(0x0004C)
+#define MDP_INTR_ENABLE REG_MDP(0x00050)
+#define MDP_DSI_CMD_MODE_ID_MAP REG_MDP(0x000A0)
+#define MDP_DSI_CMD_MODE_TRIGGER_EN REG_MDP(0x000A4)
+#define MDP_OVERLAYPROC0_CFG REG_MDP(0x10004)
+#define MDP_DMA_P_CONFIG REG_MDP(0x90000)
+#define MDP_DMA_P_OUT_XY REG_MDP(0x90010)
+#define MDP_DMA_P_SIZE REG_MDP(0x90004)
+#define MDP_DMA_P_BUF_ADDR REG_MDP(0x90008)
+#define MDP_DMA_P_BUF_Y_STRIDE REG_MDP(0x9000C)
+#define MDP_DMA_P_OP_MODE REG_MDP(0x90070)
+#define MDP_DSI_VIDEO_EN REG_MDP(0xE0000)
+#define MDP_DSI_VIDEO_HSYNC_CTL REG_MDP(0xE0004)
+#define MDP_DSI_VIDEO_VSYNC_PERIOD REG_MDP(0xE0008)
+#define MDP_DSI_VIDEO_VSYNC_PULSE_WIDTH REG_MDP(0xE000C)
+#define MDP_DSI_VIDEO_DISPLAY_HCTL REG_MDP(0xE0010)
+#define MDP_DSI_VIDEO_DISPLAY_V_START REG_MDP(0xE0014)
+#define MDP_DSI_VIDEO_DISPLAY_V_END REG_MDP(0xE0018)
+#define MDP_DSI_VIDEO_ACTIVE_HCTL REG_MDP(0xE001C)
+#define MDP_DSI_VIDEO_BORDER_CLR REG_MDP(0xE0028)
+#define MDP_DSI_VIDEO_HSYNC_SKEW REG_MDP(0xE0030)
+#define MDP_DSI_VIDEO_CTL_POLARITY REG_MDP(0xE0038)
+#define MDP_DSI_VIDEO_TEST_CTL REG_MDP(0xE0034)
+
+#define MDP_TEST_MODE_CLK REG_MDP(0xF0000)
+#define MDP_INTR_STATUS REG_MDP(0x00054)
+
+void mdp_setup_dma_p_video_config(unsigned short pack_pattern,
+ unsigned short img_width,
+ unsigned short img_height,
+ unsigned long input_img_addr,
+ unsigned short img_width_full_size,
+ unsigned char ystride);
+int mdp_setup_dma_p_video_mode(unsigned short disp_width,
+ unsigned short disp_height,
+ unsigned short img_width,
+ unsigned short img_height,
+ unsigned short hsync_porch0_fp,
+ unsigned short hsync_porch0_bp,
+ unsigned short vsync_porch0_fp,
+ unsigned short vsync_porch0_bp,
+ unsigned short hsync_width,
+ unsigned short vsync_width,
+ unsigned long input_img_addr,
+ unsigned short img_width_full_size,
+ unsigned short pack_pattern,
+ unsigned char ystride);
+int mipi_dsi_cmd_config(struct fbcon_config mipi_fb_cfg, unsigned short num_of_lanes);
+void mdp_shutdown(void);
+void mdp_disable(void);
+void mdp_start_dma(void);
diff --git a/platform/msm_shared/include/mipi_dsi.h b/platform/msm_shared/include/mipi_dsi.h
index 2a2b951..abbc0be 100644
--- a/platform/msm_shared/include/mipi_dsi.h
+++ b/platform/msm_shared/include/mipi_dsi.h
@@ -33,143 +33,43 @@
#define PASS 0
#define FAIL 1
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#define DSI_CLKOUT_TIMING_CTRL REG_DSI(0x0C0)
+#define DSI_SOFT_RESET REG_DSI(0x114)
+#define DSI_CAL_CTRL REG_DSI(0x0F4)
-#define MIPI_DSI_BASE (0x04700000)
+#define DSIPHY_SW_RESET REG_DSI(0x128)
+#define DSIPHY_PLL_RDY REG_DSI(0x280)
+#define DSIPHY_REGULATOR_CAL_PWR_CFG REG_DSI(0x518)
-#define DSI_CLKOUT_TIMING_CTRL (0x047000C0)
-#define MMSS_DSI_PIXEL_MD (0x04000134)
-#define MMSS_DSI_PIXEL_NS (0x04000138)
-#define MMSS_DSI_PIXEL_CC (0x04000130)
-#define MMSS_DSI_CC (0x0400004C)
-#define MMSS_DSI_MD (0x04000050)
-#define MMSS_DSI_NS (0x04000054)
-#define MMSS_MISC_CC2 (0x0400005C)
-#define MMSS_MISC_CC (0x04000058)
-#define DSI_PHY_SW_RESET (0x04700128)
-#define DSI_SOFT_RESET (0x04700114)
-#define DSI_CAL_CTRL (0x047000F4)
+#define DSI_CLK_CTRL REG_DSI(0x118)
+#define DSI_TRIG_CTRL REG_DSI(0x080)
+#define DSI_CTRL REG_DSI(0x000)
+#define DSI_COMMAND_MODE_DMA_CTRL REG_DSI(0x038)
+#define DSI_COMMAND_MODE_MDP_CTRL REG_DSI(0x03C)
+#define DSI_COMMAND_MODE_MDP_DCS_CMD_CTRL REG_DSI(0x040)
+#define DSI_DMA_CMD_OFFSET REG_DSI(0x044)
+#define DSI_DMA_CMD_LENGTH REG_DSI(0x048)
+#define DSI_COMMAND_MODE_MDP_STREAM0_CTRL REG_DSI(0x054)
+#define DSI_COMMAND_MODE_MDP_STREAM0_TOTAL REG_DSI(0x058)
+#define DSI_COMMAND_MODE_MDP_STREAM1_CTRL REG_DSI(0x05C)
+#define DSI_COMMAND_MODE_MDP_STREAM1_TOTAL REG_DSI(0x060)
+#define DSI_ERR_INT_MASK0 REG_DSI(0x108)
+#define DSI_INT_CTRL REG_DSI(0x10C)
-#define DSIPHY_REGULATOR_CTRL_0 (0x047002CC)
-#define DSIPHY_REGULATOR_CTRL_1 (0x047002D0)
-#define DSIPHY_REGULATOR_CTRL_2 (0x047002D4)
-#define DSIPHY_REGULATOR_CTRL_3 (0x047002D8)
-#define DSIPHY_REGULATOR_CAL_PWR_CFG (0x04700518)
+#define DSI_VIDEO_MODE_ACTIVE_H REG_DSI(0x020)
+#define DSI_VIDEO_MODE_ACTIVE_V REG_DSI(0x024)
+#define DSI_VIDEO_MODE_TOTAL REG_DSI(0x028)
+#define DSI_VIDEO_MODE_HSYNC REG_DSI(0x02C)
+#define DSI_VIDEO_MODE_VSYNC REG_DSI(0x030)
+#define DSI_VIDEO_MODE_VSYNC_VPOS REG_DSI(0x034)
-#define DSIPHY_TIMING_CTRL_0 (0x04700260)
-#define DSIPHY_TIMING_CTRL_1 (0x04700264)
-#define DSIPHY_TIMING_CTRL_2 (0x04700268)
-#define DSIPHY_TIMING_CTRL_3 (0x0470026C)
-#define DSIPHY_TIMING_CTRL_4 (0x04700270)
-#define DSIPHY_TIMING_CTRL_5 (0x04700274)
-#define DSIPHY_TIMING_CTRL_6 (0x04700278)
-#define DSIPHY_TIMING_CTRL_7 (0x0470027C)
-#define DSIPHY_TIMING_CTRL_8 (0x04700280)
-#define DSIPHY_TIMING_CTRL_9 (0x04700284)
-#define DSIPHY_TIMING_CTRL_10 (0x04700288)
-
-#define DSIPHY_CTRL_0 (0x04700290)
-#define DSIPHY_CTRL_1 (0x04700294)
-#define DSIPHY_CTRL_2 (0x04700298)
-#define DSIPHY_CTRL_3 (0x0470029C)
-
-#define DSIPHY_STRENGTH_CTRL_0 (0x047002A0)
-#define DSIPHY_STRENGTH_CTRL_1 (0x047002A4)
-#define DSIPHY_STRENGTH_CTRL_2 (0x047002A8)
-#define DSIPHY_STRENGTH_CTRL_3 (0x047002AC)
-
-#define DSIPHY_PLL_CTRL_0 (0x04700200)
-#define DSIPHY_PLL_CTRL_1 (0x04700204)
-#define DSIPHY_PLL_CTRL_2 (0x04700208)
-#define DSIPHY_PLL_CTRL_3 (0x0470020C)
-#define DSIPHY_PLL_CTRL_4 (0x04700210)
-#define DSIPHY_PLL_CTRL_5 (0x04700214)
-#define DSIPHY_PLL_CTRL_6 (0x04700218)
-#define DSIPHY_PLL_CTRL_7 (0x0470021C)
-#define DSIPHY_PLL_CTRL_8 (0x04700220)
-#define DSIPHY_PLL_CTRL_9 (0x04700224)
-#define DSIPHY_PLL_CTRL_10 (0x04700228)
-#define DSIPHY_PLL_CTRL_11 (0x0470022C)
-#define DSIPHY_PLL_CTRL_12 (0x04700230)
-#define DSIPHY_PLL_CTRL_13 (0x04700234)
-#define DSIPHY_PLL_CTRL_14 (0x04700238)
-#define DSIPHY_PLL_CTRL_15 (0x0470023C)
-#define DSIPHY_PLL_CTRL_16 (0x04700240)
-#define DSIPHY_PLL_CTRL_17 (0x04700244)
-#define DSIPHY_PLL_CTRL_18 (0x04700248)
-#define DSIPHY_PLL_CTRL_19 (0x0470024C)
-
-#define DSIPHY_PLL_RDY (0x04700280)
-
-#if DISPLAY_MIPI_PANEL_TOSHIBA_MDT61
-#define DSI_CMD_DMA_MEM_START_ADDR_PANEL (0x90000000)
-#else
-#define DSI_CMD_DMA_MEM_START_ADDR_PANEL (0x46000000)
-#endif
-
-#define DSI_CLK_CTRL (0x04700118)
-#define DSI_TRIG_CTRL (0x04700080)
-#define DSI_CTRL (0x04700000)
-#define DSI_COMMAND_MODE_DMA_CTRL (0x04700038)
-#define DSI_COMMAND_MODE_MDP_CTRL (0x0470003C)
-#define DSI_COMMAND_MODE_MDP_DCS_CMD_CTRL (0x04700040)
-#define DSI_DMA_CMD_OFFSET (0x04700044)
-#define DSI_DMA_CMD_LENGTH (0x04700048)
-#define DSI_COMMAND_MODE_MDP_STREAM0_CTRL (0x04700054)
-#define DSI_COMMAND_MODE_MDP_STREAM0_TOTAL (0x04700058)
-#define DSI_COMMAND_MODE_MDP_STREAM1_CTRL (0x0470005C)
-#define DSI_COMMAND_MODE_MDP_STREAM1_TOTAL (0x04700060)
-#define DSI_ERR_INT_MASK0 (0x04700108)
-#define DSI_INT_CTRL (0x0470010C)
-
-#define DSI_VIDEO_MODE_ACTIVE_H (0x04700020)
-#define DSI_VIDEO_MODE_ACTIVE_V (0x04700024)
-#define DSI_VIDEO_MODE_TOTAL (0x04700028)
-#define DSI_VIDEO_MODE_HSYNC (0x0470002C)
-#define DSI_VIDEO_MODE_VSYNC (0x04700030)
-#define DSI_VIDEO_MODE_VSYNC_VPOS (0x04700034)
-
-#define DSI_MISR_CMD_CTRL (0x0470009C)
-#define DSI_MISR_VIDEO_CTRL (0x047000A0)
-#define DSI_EOT_PACKET_CTRL (0x047000C8)
-#define DSI_VIDEO_MODE_CTRL (0x0470000C)
-#define DSI_CAL_STRENGTH_CTRL (0x04700100)
-#define DSI_CMD_MODE_DMA_SW_TRIGGER (0x0470008C)
-#define DSI_CMD_MODE_MDP_SW_TRIGGER (0x04700090)
-
-#define MDP_OVERLAYPROC0_START (0x05100004)
-#define MDP_DMA_P_START (0x0510000C)
-#define MDP_DMA_S_START (0x05100010)
-#define MDP_AXI_RDMASTER_CONFIG (0x05100028)
-#define MDP_AXI_WRMASTER_CONFIG (0x05100030)
-#define MDP_DISP_INTF_SEL (0x05100038)
-#define MDP_MAX_RD_PENDING_CMD_CONFIG (0x0510004C)
-#define MDP_INTR_ENABLE (0x05100050)
-#define MDP_DSI_CMD_MODE_ID_MAP (0x051000A0)
-#define MDP_DSI_CMD_MODE_TRIGGER_EN (0x051000A4)
-#define MDP_OVERLAYPROC0_CFG (0x05110004)
-#define MDP_DMA_P_CONFIG (0x05190000)
-#define MDP_DMA_P_OUT_XY (0x05190010)
-#define MDP_DMA_P_SIZE (0x05190004)
-#define MDP_DMA_P_BUF_ADDR (0x05190008)
-#define MDP_DMA_P_BUF_Y_STRIDE (0x0519000C)
-#define MDP_DMA_P_OP_MODE (0x05190070)
-#define MDP_DSI_VIDEO_EN (0x051E0000)
-#define MDP_DSI_VIDEO_HSYNC_CTL (0x051E0004)
-#define MDP_DSI_VIDEO_VSYNC_PERIOD (0x051E0008)
-#define MDP_DSI_VIDEO_VSYNC_PULSE_WIDTH (0x051E000C)
-#define MDP_DSI_VIDEO_DISPLAY_HCTL (0x051E0010)
-#define MDP_DSI_VIDEO_DISPLAY_V_START (0x051E0014)
-#define MDP_DSI_VIDEO_DISPLAY_V_END (0x051E0018)
-#define MDP_DSI_VIDEO_ACTIVE_HCTL (0x051E001C)
-#define MDP_DSI_VIDEO_BORDER_CLR (0x051E0028)
-#define MDP_DSI_VIDEO_HSYNC_SKEW (0x051E0030)
-#define MDP_DSI_VIDEO_CTL_POLARITY (0x051E0038)
-#define MDP_DSI_VIDEO_TEST_CTL (0x051E0034)
-
-#define MDP_TEST_MODE_CLK (0x051F0000)
-#define MDP_INTR_STATUS (0x05100054)
-#define MMSS_SFPB_GPREG (0x05700058)
+#define DSI_MISR_CMD_CTRL REG_DSI(0x09C)
+#define DSI_MISR_VIDEO_CTRL REG_DSI(0x0A0)
+#define DSI_EOT_PACKET_CTRL REG_DSI(0x0C8)
+#define DSI_VIDEO_MODE_CTRL REG_DSI(0x00C)
+#define DSI_CAL_STRENGTH_CTRL REG_DSI(0x100)
+#define DSI_CMD_MODE_DMA_SW_TRIGGER REG_DSI(0x08C)
+#define DSI_CMD_MODE_MDP_SW_TRIGGER REG_DSI(0x090)
#define MIPI_DSI_MRPS 0x04 /* Maximum Return Packet Size */
#define MIPI_DSI_REG_LEN 16 /* 4 x 4 bytes register */
diff --git a/platform/msm_shared/include/mmc.h b/platform/msm_shared/include/mmc.h
index 305ba9c..1bcb8f0 100644
--- a/platform/msm_shared/include/mmc.h
+++ b/platform/msm_shared/include/mmc.h
@@ -548,6 +548,7 @@
#define BINARY_IN_TABLE_SIZE (16 * 512)
#define MAX_FILE_ENTRIES 20
+#define MMC_EBR_TYPE 0x05
#define MMC_MODEM_TYPE 0x06
#define MMC_MODEM_TYPE2 0x0C
#define MMC_SBL1_TYPE 0x4D
@@ -566,6 +567,8 @@
#define MMC_RECOVERY_TYPE 0x60
#define MMC_MISC_TYPE 0x63
+#define MMC_PROTECTED_TYPE 0xEE
+
#define MMC_RCA 2
struct mbr_entry
@@ -614,8 +617,8 @@
#define MMC_CLK_DISABLE 0
-unsigned int mmc_boot_main(unsigned char slot, unsigned int base);
-unsigned int mmc_boot_read_from_card( struct mmc_boot_host* host,
+unsigned int mmc_boot_main (unsigned char slot, unsigned int base);
+unsigned int mmc_boot_read_from_card (struct mmc_boot_host* host,
struct mmc_boot_card* card,
unsigned long long data_addr,
unsigned int data_len,
@@ -628,5 +631,15 @@
unsigned int mmc_read (unsigned long long data_addr, unsigned int* out,
unsigned int data_len);
+unsigned int mmc_boot_write_to_card (struct mmc_boot_host* host,
+ struct mmc_boot_card* card,
+ unsigned long long data_addr,
+ unsigned int data_len,
+ unsigned int *in );
+
+unsigned int mmc_write_partition (unsigned size, unsigned char *partition);
+
+void mmc_dump_partition_info();
+
#endif
diff --git a/platform/msm_shared/mdp4.c b/platform/msm_shared/mdp4.c
new file mode 100644
index 0000000..3fbf2fc
--- /dev/null
+++ b/platform/msm_shared/mdp4.c
@@ -0,0 +1,187 @@
+/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of Code Aurora Forum, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+#include <mdp4.h>
+#include <debug.h>
+#include <reg.h>
+#include <target/display.h>
+#include <platform/timer.h>
+#include <platform/iomap.h>
+
+void mdp_setup_dma_p_video_config(unsigned short pack_pattern,
+ unsigned short img_width,
+ unsigned short img_height,
+ unsigned long input_img_addr,
+ unsigned short img_width_full_size,
+ unsigned char ystride){
+ dprintf(SPEW, "MDP4.2 Setup for DSI Video Mode\n");
+
+ // ----- programming MDP_AXI_RDMASTER_CONFIG --------
+ /* MDP_AXI_RDMASTER_CONFIG set all master to read from AXI port 0, that's
+ the only port connected */
+ //TODO: Seems to still work without this
+ writel(0x00290000, MDP_AXI_RDMASTER_CONFIG);
+ writel(0x00000004, MDP_AXI_WRMASTER_CONFIG);
+ writel(0x00007777, MDP_MAX_RD_PENDING_CMD_CONFIG);
+
+ /* Set up CMD_INTF_SEL, VIDEO_INTF_SEL, EXT_INTF_SEL, SEC_INTF_SEL, PRIM_INTF_SEL */
+ writel(0x00000049, MDP_DISP_INTF_SEL);
+
+ /* DMA P */
+ writel(0x0000000b, MDP_OVERLAYPROC0_CFG);
+
+ /* RGB 888 */
+ writel(pack_pattern << 8 | 0xbf | (0 << 25), MDP_DMA_P_CONFIG);
+
+ writel(0x0, MDP_DMA_P_OUT_XY);
+
+ writel(img_height << 16 | img_width, MDP_DMA_P_SIZE);
+
+ writel(input_img_addr, MDP_DMA_P_BUF_ADDR);
+
+ writel(img_width_full_size * ystride, MDP_DMA_P_BUF_Y_STRIDE);
+}
+
+int mdp_setup_dma_p_video_mode(unsigned short disp_width,
+ unsigned short disp_height,
+ unsigned short img_width,
+ unsigned short img_height,
+ unsigned short hsync_porch0_fp,
+ unsigned short hsync_porch0_bp,
+ unsigned short vsync_porch0_fp,
+ unsigned short vsync_porch0_bp,
+ unsigned short hsync_width,
+ unsigned short vsync_width,
+ unsigned long input_img_addr,
+ unsigned short img_width_full_size,
+ unsigned short pack_pattern,
+ unsigned char ystride)
+{
+
+ // unsigned long mdp_intr_status;
+ int status = FAIL;
+ unsigned long hsync_period;
+ unsigned long vsync_period;
+ unsigned long vsync_period_intmd;
+
+ dprintf(SPEW, "MDP4.1 for DSI Video Mode\n");
+
+ hsync_period = img_width + hsync_porch0_fp + hsync_porch0_bp + 1;
+ vsync_period_intmd = img_height + vsync_porch0_fp + vsync_porch0_bp + 1;
+ vsync_period = vsync_period_intmd * hsync_period;
+
+ // ----- programming MDP_AXI_RDMASTER_CONFIG --------
+ /* MDP_AXI_RDMASTER_CONFIG set all master to read from AXI port 0, that's
+ the only port connected */
+ writel(0x00290000, MDP_AXI_RDMASTER_CONFIG);
+ writel(0x00000004, MDP_AXI_WRMASTER_CONFIG);
+ writel(0x00007777, MDP_MAX_RD_PENDING_CMD_CONFIG);
+ /* sets PRIM_INTF_SEL to 0x1 and SEC_INTF_SEL to 0x2 and DSI_VIDEO_INTF_SEL*/
+ writel(0x00000049, MDP_DISP_INTF_SEL);
+ writel(0x0000000b, MDP_OVERLAYPROC0_CFG);
+
+ // ------------- programming MDP_DMA_P_CONFIG ---------------------
+ writel(pack_pattern << 8 | 0xbf | (0 << 25), MDP_DMA_P_CONFIG); // rgb888
+
+ writel(0x00000000, MDP_DMA_P_OUT_XY);
+ writel(img_height << 16 | img_width, MDP_DMA_P_SIZE);
+ writel(input_img_addr, MDP_DMA_P_BUF_ADDR);
+ writel(img_width_full_size * ystride, MDP_DMA_P_BUF_Y_STRIDE);
+ writel(0x00ff0000, MDP_DMA_P_OP_MODE);
+ writel(hsync_period << 16 | hsync_width, MDP_DSI_VIDEO_HSYNC_CTL);
+ writel(vsync_period, MDP_DSI_VIDEO_VSYNC_PERIOD);
+ writel(vsync_width * hsync_period, MDP_DSI_VIDEO_VSYNC_PULSE_WIDTH);
+ writel((img_width + hsync_porch0_bp - 1) << 16 | hsync_porch0_bp,
+ MDP_DSI_VIDEO_DISPLAY_HCTL);
+ writel(vsync_porch0_bp * hsync_period, MDP_DSI_VIDEO_DISPLAY_V_START);
+ writel((img_height + vsync_porch0_bp) * hsync_period,
+ MDP_DSI_VIDEO_DISPLAY_V_END);
+ writel(0x00ABCDEF, MDP_DSI_VIDEO_BORDER_CLR);
+ writel(0x00000000, MDP_DSI_VIDEO_HSYNC_SKEW);
+ writel(0x00000000, MDP_DSI_VIDEO_CTL_POLARITY);
+ // end of cmd mdp
+
+ writel(0x00000001, MDP_DSI_VIDEO_EN); // MDP_DSI_EN ENABLE
+
+ status = PASS;
+ return status;
+}
+
+
+int mipi_dsi_cmd_config(struct fbcon_config mipi_fb_cfg, unsigned short num_of_lanes)
+{
+
+ int status = 0;
+ unsigned long input_img_addr = MIPI_FB_ADDR;
+ unsigned short image_wd = mipi_fb_cfg.width;
+ unsigned short image_ht = mipi_fb_cfg.height;
+ unsigned short pack_pattern = 0x12;
+ unsigned char ystride = 3;
+
+ writel(0x03ffffff, MDP_INTR_ENABLE);
+ writel(0x0000000b, MDP_OVERLAYPROC0_CFG);
+
+ // ------------- programming MDP_DMA_P_CONFIG ---------------------
+ writel(pack_pattern << 8 | 0x3f | (0 << 25), MDP_DMA_P_CONFIG); // rgb888
+
+ writel(0x00000000, MDP_DMA_P_OUT_XY);
+ writel(image_ht << 16 | image_wd, MDP_DMA_P_SIZE);
+ writel(input_img_addr, MDP_DMA_P_BUF_ADDR);
+
+ writel(image_wd * ystride, MDP_DMA_P_BUF_Y_STRIDE);
+
+ writel(0x00000000, MDP_DMA_P_OP_MODE);
+
+ writel(0x10, MDP_DSI_CMD_MODE_ID_MAP);
+ writel(0x01, MDP_DSI_CMD_MODE_TRIGGER_EN);
+
+ writel(0x0001a000, MDP_AXI_RDMASTER_CONFIG);
+ writel(0x00000004, MDP_AXI_WRMASTER_CONFIG);
+ writel(0x00007777, MDP_MAX_RD_PENDING_CMD_CONFIG);
+ writel(0x8a, MDP_DISP_INTF_SEL);
+
+ return status;
+}
+
+void mdp_disable(void)
+{
+ writel(0x00000000, MDP_DSI_VIDEO_EN);
+}
+
+void mdp_shutdown(void)
+{
+ mdp_disable();
+ mdelay(60);
+ writel(0x00000000, MDP_INTR_ENABLE);
+ writel(0x00000003, MDP_OVERLAYPROC0_CFG);
+}
+
+void mdp_start_dma(void)
+{
+ writel(0x00000001, MDP_DMA_P_START);
+}
diff --git a/platform/msm_shared/mipi_dsi.c b/platform/msm_shared/mipi_dsi.c
index ee878f9..5c3423f 100644
--- a/platform/msm_shared/mipi_dsi.c
+++ b/platform/msm_shared/mipi_dsi.c
@@ -31,9 +31,16 @@
#include <endian.h>
#include <mipi_dsi.h>
#include <dev/fbcon.h>
-#include <target/display.h>
#include <stdlib.h>
#include <debug.h>
+#include <target/display.h>
+#include <platform/iomap.h>
+#include <platform/clock.h>
+
+extern void mdp_disable(void);
+extern int mipi_dsi_cmd_config(struct fbcon_config mipi_fb_cfg, unsigned short num_of_lanes);
+extern void mdp_shutdown(void);
+extern void mdp_start_dma(void);
#if DISPLAY_MIPI_PANEL_TOSHIBA
static struct fbcon_config mipi_fb_cfg = {
@@ -102,56 +109,14 @@
void secure_writel(uint32_t, uint32_t);
uint32_t secure_readl(uint32_t);
-void configure_dsicore_dsiclk()
-{
- unsigned char mnd_mode, root_en, clk_en;
- unsigned long src_sel = 0x3; // dsi_phy_pll0_src
- unsigned long pre_div_func = 0x00; // predivide by 1
- unsigned long pmxo_sel;
-
- secure_writel(pre_div_func << 14 | src_sel, MMSS_DSI_NS);
- mnd_mode = 0; // Bypass MND
- root_en = 1;
- clk_en = 1;
- pmxo_sel = 0;
-
- secure_writel((pmxo_sel << 8) | (mnd_mode << 6), MMSS_DSI_CC);
- secure_writel(secure_readl(MMSS_DSI_CC) | root_en << 2, MMSS_DSI_CC);
- secure_writel(secure_readl(MMSS_DSI_CC) | clk_en, MMSS_DSI_CC);
-}
-
-void configure_dsicore_byteclk(void)
-{
- secure_writel(0x00400401, MMSS_MISC_CC2); // select pxo
-}
-
-void configure_dsicore_pclk(void)
-{
- unsigned char mnd_mode, root_en, clk_en;
- unsigned long src_sel = 0x3; // dsi_phy_pll0_src
- unsigned long pre_div_func = 0x01; // predivide by 2
-
- secure_writel(pre_div_func << 12 | src_sel, MMSS_DSI_PIXEL_NS);
-
- mnd_mode = 0; // Bypass MND
- root_en = 1;
- clk_en = 1;
- secure_writel(mnd_mode << 6, MMSS_DSI_PIXEL_CC);
- secure_writel(secure_readl(MMSS_DSI_PIXEL_CC) | root_en << 2,
- MMSS_DSI_PIXEL_CC);
- secure_writel(secure_readl(MMSS_DSI_PIXEL_CC) | clk_en,
- MMSS_DSI_PIXEL_CC);
-}
-
int mipi_dsi_phy_ctrl_config(struct mipi_dsi_panel_config *pinfo)
{
unsigned i;
unsigned off = 0;
struct mipi_dsi_phy_ctrl *pd;
- writel(0x00000001, DSI_PHY_SW_RESET);
- mdelay(50);
- writel(0x00000000, DSI_PHY_SW_RESET);
+ writel(0x00000001, DSIPHY_SW_RESET);
+ writel(0x00000000, DSIPHY_SW_RESET);
pd = (pinfo->dsi_phy_config);
@@ -215,7 +180,6 @@
int status = 0;
writel(0x03030303, DSI_INT_CTRL);
- mdelay(10);
writel(0x1, DSI_CMD_MODE_DMA_SW_TRIGGER);
ReadValue = readl(DSI_INT_CTRL) & 0x00000001;
while (ReadValue != 0x00000001) {
@@ -247,7 +211,7 @@
writel(DSI_CMD_DMA_MEM_START_ADDR_PANEL, DSI_DMA_CMD_OFFSET);
writel(cm->size, DSI_DMA_CMD_LENGTH); // reg 0x48 for this build
ret += dsi_cmd_dma_trigger_for_panel();
- mdelay(10);
+ udelay(80);
cm++;
}
return ret;
@@ -411,7 +375,7 @@
unsigned char interleav = 0;
// disable mdp first
- writel(0x00000000, MDP_DSI_VIDEO_EN);
+ mdp_disable();
writel(0x00000000, DSI_CLK_CTRL);
writel(0x00000000, DSI_CLK_CTRL);
@@ -540,7 +504,7 @@
writel(0x00000040, DSI_ERR_INT_MASK0);
writel(0x1, DSI_EOT_PACKET_CTRL);
// writel(0x0, MDP_OVERLAYPROC0_START);
- writel(0x00000001, MDP_DMA_P_START);
+ mdp_start_dma();
mdelay(10);
writel(0x1, DSI_CMD_MODE_MDP_SW_TRIGGER);
@@ -548,105 +512,6 @@
return status;
}
-void mdp_setup_dma_p_video_config(unsigned short pack_pattern,
- unsigned short img_width,
- unsigned short img_height,
- unsigned long input_img_addr,
- unsigned short img_width_full_size,
- unsigned char ystride){
- dprintf(SPEW, "MDP4.2 Setup for DSI Video Mode\n");
-
- // ----- programming MDP_AXI_RDMASTER_CONFIG --------
- /* MDP_AXI_RDMASTER_CONFIG set all master to read from AXI port 0, that's
- the only port connected */
- //TODO: Seems to still work without this
- writel(0x00290000, MDP_AXI_RDMASTER_CONFIG);
- writel(0x00000004, MDP_AXI_WRMASTER_CONFIG);
- writel(0x00007777, MDP_MAX_RD_PENDING_CMD_CONFIG);
-
- /* Set up CMD_INTF_SEL, VIDEO_INTF_SEL, EXT_INTF_SEL, SEC_INTF_SEL, PRIM_INTF_SEL */
- writel(0x00000049, MDP_DISP_INTF_SEL);
-
- /* DMA P */
- writel(0x0000000b, MDP_OVERLAYPROC0_CFG);
-
- /* RGB 888 */
- writel(pack_pattern << 8 | 0xbf | (0 << 25), MDP_DMA_P_CONFIG);
-
- writel(0x0, MDP_DMA_P_OUT_XY);
-
- writel(img_height << 16 | img_width, MDP_DMA_P_SIZE);
-
- writel(input_img_addr, MDP_DMA_P_BUF_ADDR);
-
- writel(img_width_full_size * ystride, MDP_DMA_P_BUF_Y_STRIDE);
-}
-
-int mdp_setup_dma_p_video_mode(unsigned short disp_width,
- unsigned short disp_height,
- unsigned short img_width,
- unsigned short img_height,
- unsigned short hsync_porch0_fp,
- unsigned short hsync_porch0_bp,
- unsigned short vsync_porch0_fp,
- unsigned short vsync_porch0_bp,
- unsigned short hsync_width,
- unsigned short vsync_width,
- unsigned long input_img_addr,
- unsigned short img_width_full_size,
- unsigned short pack_pattern,
- unsigned char ystride)
-{
-
- // unsigned long mdp_intr_status;
- int status = FAIL;
- unsigned long hsync_period;
- unsigned long vsync_period;
- unsigned long vsync_period_intmd;
-
- dprintf(SPEW, "Hi setup MDP4.1 for DSI Video Mode\n");
-
- hsync_period = img_width + hsync_porch0_fp + hsync_porch0_bp + 1;
- vsync_period_intmd = img_height + vsync_porch0_fp + vsync_porch0_bp + 1;
- vsync_period = vsync_period_intmd * hsync_period;
-
- // ----- programming MDP_AXI_RDMASTER_CONFIG --------
- /* MDP_AXI_RDMASTER_CONFIG set all master to read from AXI port 0, that's
- the only port connected */
- writel(0x00290000, MDP_AXI_RDMASTER_CONFIG);
- writel(0x00000004, MDP_AXI_WRMASTER_CONFIG);
- writel(0x00007777, MDP_MAX_RD_PENDING_CMD_CONFIG);
- /* sets PRIM_INTF_SEL to 0x1 and SEC_INTF_SEL to 0x2 and DSI_VIDEO_INTF_SEL*/
- writel(0x00000049, MDP_DISP_INTF_SEL);
- writel(0x0000000b, MDP_OVERLAYPROC0_CFG);
-
- // ------------- programming MDP_DMA_P_CONFIG ---------------------
- writel(pack_pattern << 8 | 0xbf | (0 << 25), MDP_DMA_P_CONFIG); // rgb888
-
- writel(0x00000000, MDP_DMA_P_OUT_XY);
- writel(img_height << 16 | img_width, MDP_DMA_P_SIZE);
- writel(input_img_addr, MDP_DMA_P_BUF_ADDR);
- writel(img_width_full_size * ystride, MDP_DMA_P_BUF_Y_STRIDE);
- writel(0x00ff0000, MDP_DMA_P_OP_MODE);
- writel(hsync_period << 16 | hsync_width, MDP_DSI_VIDEO_HSYNC_CTL);
- writel(vsync_period, MDP_DSI_VIDEO_VSYNC_PERIOD);
- writel(vsync_width * hsync_period, MDP_DSI_VIDEO_VSYNC_PULSE_WIDTH);
- writel((img_width + hsync_porch0_bp - 1) << 16 | hsync_porch0_bp,
- MDP_DSI_VIDEO_DISPLAY_HCTL);
- writel(vsync_porch0_bp * hsync_period, MDP_DSI_VIDEO_DISPLAY_V_START);
- writel((img_height + vsync_porch0_bp) * hsync_period,
- MDP_DSI_VIDEO_DISPLAY_V_END);
- writel(0x00ABCDEF, MDP_DSI_VIDEO_BORDER_CLR);
- writel(0x00000000, MDP_DSI_VIDEO_HSYNC_SKEW);
- writel(0x00000000, MDP_DSI_VIDEO_CTL_POLARITY);
- // end of cmd mdp
-
- writel(0x00000001, MDP_DSI_VIDEO_EN); // MDP_DSI_EN ENABLE
-
- status = PASS;
- return status;
-}
-
int mipi_dsi_video_config(unsigned short num_of_lanes)
{
@@ -716,41 +581,6 @@
return status;
}
-int mipi_dsi_cmd_config(unsigned short num_of_lanes)
-{
-
- int status = 0;
- unsigned long input_img_addr = MIPI_FB_ADDR;
- unsigned short image_wd = mipi_fb_cfg.width;
- unsigned short image_ht = mipi_fb_cfg.height;
- unsigned short pack_pattern = 0x12;
- unsigned char ystride = 3;
-
- writel(0x03ffffff, MDP_INTR_ENABLE);
- writel(0x0000000b, MDP_OVERLAYPROC0_CFG);
-
- // ------------- programming MDP_DMA_P_CONFIG ---------------------
- writel(pack_pattern << 8 | 0x3f | (0 << 25), MDP_DMA_P_CONFIG); // rgb888
-
- writel(0x00000000, MDP_DMA_P_OUT_XY);
- writel(image_ht << 16 | image_wd, MDP_DMA_P_SIZE);
- writel(input_img_addr, MDP_DMA_P_BUF_ADDR);
-
- writel(image_wd * ystride, MDP_DMA_P_BUF_Y_STRIDE);
-
- writel(0x00000000, MDP_DMA_P_OP_MODE);
-
- writel(0x10, MDP_DSI_CMD_MODE_ID_MAP);
- writel(0x01, MDP_DSI_CMD_MODE_TRIGGER_EN);
-
- writel(0x0001a000, MDP_AXI_RDMASTER_CONFIG);
- writel(0x00000004, MDP_AXI_WRMASTER_CONFIG);
- writel(0x00007777, MDP_MAX_RD_PENDING_CMD_CONFIG);
- writel(0x8a, MDP_DISP_INTF_SEL);
-
- return status;
-}
-
int is_cmd_mode_enabled(void)
{
return cmd_mode_status;
@@ -767,7 +597,7 @@
unsigned short dst_format = 0;
unsigned short traffic_mode = 0;
struct mipi_dsi_panel_config *panel_info = &novatek_panel_info;
- status += mipi_dsi_cmd_config(panel_info->num_of_lanes);
+ status += mipi_dsi_cmd_config(mipi_fb_cfg, panel_info->num_of_lanes);
mdelay(50);
config_dsi_cmd_mode(display_wd, display_ht, image_wd, image_ht,
dst_format, traffic_mode,
@@ -777,21 +607,18 @@
void mipi_dsi_shutdown(void)
{
- writel(0x00000000, MDP_DSI_VIDEO_EN);
- mdelay(60);
- writel(0x00000000, MDP_INTR_ENABLE);
- writel(0x00000003, MDP_OVERLAYPROC0_CFG);
+ mdp_shutdown();
writel(0x01010101, DSI_INT_CTRL);
writel(0x13FF3BFF, DSI_ERR_INT_MASK0);
- writel(0, DSIPHY_PLL_CTRL_0);
+ writel(0, DSIPHY_PLL_CTRL(0));
writel(0, DSI_CLK_CTRL);
writel(0, DSI_CTRL);
#if DISPLAY_MIPI_PANEL_TOSHIBA_MDT61
- writel(0x0, MMSS_DSI_CC);
- writel(0x0, MMSS_DSI_PIXEL_CC);
+ writel(0x0, DSI_CC_REG);
+ writel(0x0, PIXEL_CC_REG);
#else
- secure_writel(0x0, MMSS_DSI_CC);
- secure_writel(0x0, MMSS_DSI_PIXEL_CC);
+ secure_writel(0x0, DSI_CC_REG);
+ secure_writel(0x0, PIXEL_CC_REG);
#endif
}
@@ -805,10 +632,6 @@
#if DISPLAY_MIPI_PANEL_TOSHIBA_MDT61
mipi_dsi_phy_init(panel_info);
#else
- configure_dsicore_dsiclk();
- configure_dsicore_byteclk();
- configure_dsicore_pclk();
-
mipi_dsi_phy_ctrl_config(panel_info);
#endif
diff --git a/platform/msm_shared/mmc.c b/platform/msm_shared/mmc.c
index f54e183..608a3c5 100644
--- a/platform/msm_shared/mmc.c
+++ b/platform/msm_shared/mmc.c
@@ -45,6 +45,13 @@
#define MMC_BOOT_DATA_READ 0
#define MMC_BOOT_DATA_WRITE 1
+
+#define MMC_MBR_SIGNATURE_BYTE_0 0x55
+#define MMC_MBR_SIGNATURE_BYTE_1 0xAA
+
+#define PARTITION_TYPE_MBR 0
+#define PARTITION_TYPE_GPT 1
+#define PARTITION_TYPE_GPT_BACKUP 2
static unsigned int mmc_boot_fifo_data_transfer(unsigned int* data_ptr,
@@ -1354,7 +1361,7 @@
* Write data_len data to address specified by data_addr. data_len is
* multiple of blocks for block data transfer.
*/
-static unsigned int mmc_boot_write_to_card( struct mmc_boot_host* host,
+unsigned int mmc_boot_write_to_card( struct mmc_boot_host* host,
struct mmc_boot_card* card,
unsigned long long data_addr,
unsigned int data_len,
@@ -2179,10 +2186,70 @@
return MMC_BOOT_E_SUCCESS;
}
+
+
+unsigned int mmc_verify_mbr_signature(unsigned size, unsigned char* buffer)
+{
+ /* Avoid checking past end of buffer */
+ if ((TABLE_SIGNATURE + 1) > size)
+ {
+ return MMC_BOOT_E_FAILURE;
+ }
+ /* Check to see if signature exists */
+ if ((buffer[TABLE_SIGNATURE] != MMC_MBR_SIGNATURE_BYTE_0) || \
+ (buffer[TABLE_SIGNATURE + 1] != MMC_MBR_SIGNATURE_BYTE_1))
+ {
+ dprintf(CRITICAL, "MBR signature does not match. \n" );
+ return MMC_BOOT_E_FAILURE;
+ }
+ return MMC_BOOT_E_SUCCESS;
+}
+
+
+
+void print_mbr_partition_info(struct mbr_entry* mbrEntry)
+{
+ char buffer[128];
+
+ (void) snprintf(buffer, 128,
+ "{name:%s, status:0x%X, type:0x%X, start:0x%X, size:0x%X}\n",
+ mbrEntry->name,
+ mbrEntry->dstatus,
+ mbrEntry->dtype,
+ mbrEntry->dfirstsec,
+ mbrEntry->dsize
+ );
+ dprintf(INFO, buffer);
+}
+
+
+
+/* Print the contents of the partition table */
+/* NOTE: exporting this function so that aboot can use it in fastboot
+ after display is initialized. */
+void mmc_dump_partition_info()
+{
+ if (gpt_partitions_exist)
+ {
+ /* TODO */
+ }
+ else
+ {
+ unsigned int i;
+ for (i = 0; i < mmc_partition_count; i++)
+ {
+ print_mbr_partition_info(&mbr[i]);
+ }
+ }
+}
+
+
+
+
/*
* Read MBR from MMC card and fill partition table.
*/
-static unsigned int mmc_boot_read_MBR(void)
+static unsigned int mmc_boot_read_mbr(void)
{
unsigned char buffer[MMC_BOOT_RD_BLOCK_LEN];
unsigned int dtype;
@@ -2191,31 +2258,35 @@
unsigned int EBR_current_sec;
int ret = MMC_BOOT_E_SUCCESS;
int idx, i;
-
- /* Print out the MBR first */
+
+ dprintf(INFO, "Reading mbr\n");
+
+ /* Read the MBR block which is 512 bytes */
ret = mmc_boot_read_from_card( &mmc_host, &mmc_card, 0, \
MMC_BOOT_RD_BLOCK_LEN, \
(unsigned int *)buffer);
- if (ret)
- {
+ if (ret)
+ {
+ dprintf(CRITICAL, "Could not read partition from mmc");
return ret;
}
- /* Check to see if signature exists */
- if ((buffer[TABLE_SIGNATURE] != 0x55) || \
- (buffer[TABLE_SIGNATURE + 1] != 0xAA))
- {
- dprintf(CRITICAL, "MBR signature does not match. \n" );
- return MMC_BOOT_E_FAILURE;
- }
-
- /* Print out the first 4 partition */
+ ret = mmc_verify_mbr_signature(MMC_BOOT_RD_BLOCK_LEN, buffer);
+ if (ret)
+ {
+ return ret;
+ }
+
+ /* Process each of the four partitions in the MBR by reading the table
+ information into our mbr table. */
+ mmc_partition_count = 0;
idx = TABLE_ENTRY_0;
- for (i = 0; i < 4; i++)
- {
+ for (i = 0; i < 4; i++)
+ {
dtype = buffer[idx + i * TABLE_ENTRY_SIZE + OFFSET_TYPE];
/* Type 0xEE indicates end of MBR and GPT partitions exist */
- if (dtype == 0xEE){
+ if (dtype == MMC_PROTECTED_TYPE)
+ {
gpt_partitions_exist = 1;
return ret;
}
@@ -2239,14 +2310,15 @@
}
/* See if the last partition is EBR, if not, parsing is done */
- if (dtype != 0x05)
- {
+ if (dtype != MMC_EBR_TYPE)
+ {
return ret;
}
EBR_first_sec = dfirstsec;
EBR_current_sec = dfirstsec;
+ dprintf(INFO, "Reading first EBR block from 0x%X\n", EBR_first_sec);
ret = mmc_boot_read_from_card( &mmc_host, &mmc_card, \
(EBR_first_sec * 512), \
MMC_BOOT_RD_BLOCK_LEN, \
@@ -2258,10 +2330,12 @@
/* Loop to parse the EBR */
for (i = 0;; i++)
{
- if ((buffer[TABLE_SIGNATURE] != 0x55) || (buffer[TABLE_SIGNATURE + 1] != 0xAA))
- {
- break;
- }
+ ret = mmc_verify_mbr_signature(MMC_BOOT_RD_BLOCK_LEN, buffer);
+ if (ret)
+ {
+ ret = MMC_BOOT_E_SUCCESS;
+ break;
+ }
mbr[mmc_partition_count].dstatus = \
buffer[TABLE_ENTRY_0 + OFFSET_STATUS];
mbr[mmc_partition_count].dtype = \
@@ -2286,6 +2360,7 @@
break;
}
/* More EBR to follow - read in the next EBR sector */
+ dprintf(INFO, "Reading EBR block from 0x%X\n", EBR_first_sec + dfirstsec);
ret = mmc_boot_read_from_card( &mmc_host, &mmc_card, \
((EBR_first_sec + dfirstsec) * 512), \
MMC_BOOT_RD_BLOCK_LEN, \
@@ -2335,10 +2410,6 @@
mmc_slot = slot;
mmc_boot_mci_base = base;
-#if !(defined(PLATFORM_MSM8X60) || defined(PLATFORM_MSM8960))
- /* Waiting for modem to come up */
- while (readl(MSM_SHARED_BASE + 0x14) != 1);
-#endif
/* Initialize necessary data structure and enable/set clock and power */
dprintf(SPEW," Initializing MMC host data structure and clock!\n" );
mmc_ret = mmc_boot_init( &mmc_host );
@@ -2360,7 +2431,7 @@
mmc_display_ext_csd();
/* Read MBR of the card */
- mmc_ret = mmc_boot_read_MBR();
+ mmc_ret = mmc_boot_read_mbr();
if( mmc_ret != MMC_BOOT_E_SUCCESS )
{
dprintf(CRITICAL, "MMC Boot: MBR read failed!\n" );
@@ -2389,10 +2460,10 @@
unsigned int write_size = ((unsigned)(0xFFFFFF/512))*512;
unsigned offset = 0;
unsigned int *sptr = in;
-
+
if(data_len % 512)
data_len = ROUND_TO_PAGE(data_len, 511);
-
+
while(data_len > write_size)
{
val = mmc_boot_write_to_card( &mmc_host, &mmc_card, \
@@ -2415,7 +2486,217 @@
}
return val;
}
-
+
+
+
+
+unsigned int mmc_write_mbr_in_blocks(unsigned size, unsigned char *mbrImage)
+{
+ unsigned int dtype;
+ unsigned int dfirstsec;
+ unsigned int ebrSectorOffset;
+ unsigned char *ebrImage;
+ unsigned char *lastAddress;
+ int idx, i;
+ unsigned int ret;
+
+ /* Write the first block */
+ ret = mmc_write(0, MMC_BOOT_RD_BLOCK_LEN, (unsigned int *) mbrImage);
+ if (ret)
+ {
+ dprintf(CRITICAL, "Failed to write mbr partition\n");
+ goto end;
+ }
+ dprintf(SPEW, "write of first MBR block ok\n");
+ /*
+ Loop through the MBR table to see if there is an EBR.
+ If found, then figure out where to write the first EBR
+ */
+ idx = TABLE_ENTRY_0;
+ for (i = 0; i < 4; i++)
+ {
+ dtype = mbrImage[idx + i * TABLE_ENTRY_SIZE + OFFSET_TYPE];
+ if (MMC_EBR_TYPE == dtype)
+ {
+ dprintf(SPEW, "EBR found.\n");
+ break;
+ }
+ }
+ if (MMC_EBR_TYPE != dtype)
+ {
+ dprintf(SPEW, "No EBR in this image\n");
+ goto end;
+ }
+ /* EBR exists. Write each EBR block to mmc */
+ ebrImage = mbrImage + MMC_BOOT_RD_BLOCK_LEN;
+ ebrSectorOffset= GET_LWORD_FROM_BYTE(&mbrImage[idx + i * TABLE_ENTRY_SIZE + OFFSET_FIRST_SEC]);
+ dfirstsec = 0;
+ dprintf(SPEW, "first EBR to be written at sector 0x%X\n", dfirstsec);
+ lastAddress = mbrImage + size;
+ while (ebrImage < lastAddress)
+ {
+ dprintf(SPEW, "writing to 0x%X\n", (ebrSectorOffset + dfirstsec) * MMC_BOOT_RD_BLOCK_LEN);
+ ret = mmc_write((ebrSectorOffset + dfirstsec) * MMC_BOOT_RD_BLOCK_LEN,
+ MMC_BOOT_RD_BLOCK_LEN, (unsigned int *) ebrImage);
+ if (ret)
+ {
+ dprintf(CRITICAL, "Failed to write EBR block to sector 0x%X", dfirstsec);
+ goto end;
+ }
+ dfirstsec = GET_LWORD_FROM_BYTE(&ebrImage[TABLE_ENTRY_1 + OFFSET_FIRST_SEC]);
+ ebrImage += MMC_BOOT_RD_BLOCK_LEN;
+ }
+ dprintf(INFO, "MBR written to mmc successfully");
+end:
+ return ret;
+}
+
+
+
+/* Write the MBR/EBR to the MMC. */
+unsigned int mmc_write_mbr(unsigned size, unsigned char *mbrImage)
+{
+ unsigned int ret;
+
+ /* Don't allow overwrite of gpt with a mbr partition */
+ if (gpt_partitions_exist)
+ {
+ ret = MMC_BOOT_E_INVAL;
+ dprintf(CRITICAL, "Cannot overwrite GPT partition with MBR image.\n");
+ goto end;
+ }
+
+ /* Verify that passed in block is a valid MBR */
+ ret = mmc_verify_mbr_signature(size, mbrImage);
+ if (ret)
+ {
+ goto end;
+ }
+
+ /* Write the MBR/EBR to mmc */
+ ret = mmc_write_mbr_in_blocks(size, mbrImage);
+ if (ret)
+ {
+ dprintf(CRITICAL, "Failed to write MBR block to mmc.\n" );
+ goto end;
+ }
+ /* Re-read the MBR partition into mbr table */
+ ret = mmc_boot_read_mbr();
+ if (ret)
+ {
+ dprintf(CRITICAL, "Failed to re-read mbr partition.\n");
+ goto end;
+ }
+ mmc_dump_partition_info();
+end:
+ return ret;
+}
+
+
+
+unsigned int get_mbr_partition_type(unsigned size, unsigned char* partition,
+ unsigned int *partition_type)
+{
+ unsigned int type_offset = TABLE_ENTRY_0 + OFFSET_TYPE;
+
+ if (size < type_offset)
+ {
+ goto end;
+ }
+
+ *partition_type = partition[type_offset];
+end:
+ return MMC_BOOT_E_SUCCESS;
+}
+
+
+
+unsigned int get_partition_type(unsigned size, unsigned char* partition,
+ unsigned int *partition_type)
+{
+ unsigned int ret = MMC_BOOT_E_SUCCESS;
+
+ /*
+ If the block contains the MBR signature, then it's likely either
+ MBR or MBR with protective type (GPT). If the MBR signature is
+ not there, then it could be the GPT backup.
+ */
+
+ /* First check the MBR signature */
+ ret = mmc_verify_mbr_signature(size, partition);
+ if (ret == MMC_BOOT_E_SUCCESS)
+ {
+ unsigned int mbr_partition_type = PARTITION_TYPE_MBR;
+
+ /* MBR signature verified. This could be MBR, MBR + EBR, or GPT */
+ ret = get_mbr_partition_type(size, partition, &mbr_partition_type);
+ if (ret != MMC_BOOT_E_SUCCESS)
+ {
+ dprintf(CRITICAL, "Cannot get TYPE of partition");
+ }
+ else if (MMC_PROTECTED_TYPE == mbr_partition_type)
+ {
+ *partition_type = PARTITION_TYPE_GPT;
+ }
+ else
+ {
+ *partition_type = PARTITION_TYPE_MBR;
+ }
+ }
+ else
+ {
+ /* This could be the GPT backup. Make that assumption for now.
+ Anybody who treats the block as GPT backup should check the
+ signature. */
+ *partition_type = PARTITION_TYPE_GPT_BACKUP;
+ }
+ return ret;
+}
+
+
+
+unsigned int mmc_write_partition(unsigned size, unsigned char* partition)
+{
+ unsigned int ret = MMC_BOOT_E_INVAL;
+ unsigned int partition_type;
+
+ if (partition == 0)
+ {
+ dprintf(CRITICAL, "NULL partition\n");
+ goto end;
+ }
+ ret = get_partition_type(size, partition, &partition_type);
+ if (ret != MMC_BOOT_E_SUCCESS)
+ {
+ goto end;
+ }
+ switch (partition_type)
+ {
+ case PARTITION_TYPE_MBR:
+ dprintf(INFO, "Writing MBR partition\n");
+ ret = mmc_write_mbr(size, partition);
+ break;
+ case PARTITION_TYPE_GPT:
+ dprintf(INFO, "Writing GPT partition\n");
+ dprintf(CRITICAL, "Flash of GPT not implemented\n");
+ ret = MMC_BOOT_E_INVAL;
+ break;
+ case PARTITION_TYPE_GPT_BACKUP:
+ dprintf(INFO, "Writing GPT backup partition\n");
+ dprintf(CRITICAL, "Flash of GPT backup not implemented\n");
+ ret = MMC_BOOT_E_INVAL;
+ break;
+ default:
+ dprintf(CRITICAL, "Invalid partition\n");
+ ret = MMC_BOOT_E_INVAL;
+ goto end;
+ }
+end:
+ return ret;
+}
+
+
+
/*
* MMC read function
*/
@@ -2756,7 +3037,7 @@
unsigned int rc = MMC_BOOT_E_SUCCESS;
memset(wp_status_buf, 0, 8);
- rc = mmc_boot_read_reg(card, 8, CMD31_SEND_WRITE_PROT_TYPE, sector,
+ rc = mmc_boot_read_reg(card, 8, CMD31_SEND_WRITE_PROT_TYPE, sector,
(unsigned int *) wp_status_buf);
return rc;
diff --git a/platform/msm_shared/proc_comm.c b/platform/msm_shared/proc_comm.c
index fca1358..be220c0 100644
--- a/platform/msm_shared/proc_comm.c
+++ b/platform/msm_shared/proc_comm.c
@@ -122,14 +122,7 @@
PCOM_GPIO_TLMM_UNCONFIG_GROUP,
PCOM_NV_READ_HIGH_BITS,
PCOM_NV_WRITE_HIGH_BITS,
- PCOM_RPC_GPIO_TLMM_CONFIG_EX = 0x25,
- PCOM_RESERVED_101 = 0x65,
- PCOM_MSM_HSUSB_PHY_RESET,
- PCOM_GET_BATT_MV_LEVEL,
- PCOM_CHG_USB_IS_PC_CONNECTED,
- PCOM_CHG_USB_IS_CHARGER_CONNECTED,
- PCOM_CHG_USB_IS_DISCONNECTED,
- PCOM_CHG_USB_I_AVAILABLE,
+ PCOM_RPC_GPIO_TLMM_CONFIG_EX = 0x25,
PCOM_NUM_CMDS,
};
@@ -285,47 +278,6 @@
for (;;) ;
}
-/* Apps processor calls this API to tell modem processor that a PC USB
- * is connected return true if the USB HOST PC charger charging is
- * supported */
-int charger_usb_is_pc_connected(void)
-{
- unsigned charging_supported = 0;
- unsigned m = 0;
- msm_proc_comm(PCOM_CHG_USB_IS_PC_CONNECTED, &charging_supported, &m);
- return charging_supported;
-}
-
-/* Apps processor calls this API to tell modem processor that a USB Wall
- * charger is connected returns true if the USB WALL charger charging is
- * supported */
-int charger_usb_is_charger_connected(void)
-{
- unsigned charging_supported = 0;
- unsigned m = 0;
- msm_proc_comm(PCOM_CHG_USB_IS_CHARGER_CONNECTED, &charging_supported, &m);
- return charging_supported;
-}
-
-/* Apps processor calls this API to tell modem processor that a USB cable is
- * disconnected return true is charging is supported in the system */
-int charger_usb_disconnected(void)
-{
- unsigned charging_supported = 0;
- unsigned m = 0;
- msm_proc_comm(PCOM_CHG_USB_IS_DISCONNECTED, &charging_supported, &m);
- return charging_supported;
-}
-
-/* current parameter passed is the amount of current that the charger needs
- * to draw from USB */
-int charger_usb_i(unsigned current)
-{
- unsigned charging_supported = 0;
- msm_proc_comm(PCOM_CHG_USB_I_AVAILABLE, ¤t, &charging_supported);
- return charging_supported;
-}
-
int mmc_clock_enable_disable (unsigned id, unsigned enable)
{
if(enable)
diff --git a/platform/msm_shared/rules.mk b/platform/msm_shared/rules.mk
index d64947f..a170109 100644
--- a/platform/msm_shared/rules.mk
+++ b/platform/msm_shared/rules.mk
@@ -27,14 +27,21 @@
$(LOCAL_DIR)/scm_decrypt.o \
$(LOCAL_DIR)/lcdc.o \
$(LOCAL_DIR)/mddi.o \
- $(LOCAL_DIR)/qgic.o
+ $(LOCAL_DIR)/qgic.o \
+ $(LOCAL_DIR)/mdp4.o
+endif
+
+ifeq ($(PLATFORM),apq8064)
+ OBJS += $(LOCAL_DIR)/qgic.o \
+ $(LOCAL_DIR)/uart_dm.o
endif
ifeq ($(PLATFORM),msm8960)
OBJS += $(LOCAL_DIR)/mipi_dsi.o \
$(LOCAL_DIR)/i2c_qup.o \
$(LOCAL_DIR)/uart_dm.o \
- $(LOCAL_DIR)/qgic.o
+ $(LOCAL_DIR)/qgic.o \
+ $(LOCAL_DIR)/mdp4.o
endif
ifeq ($(PLATFORM),msm7x27a)
diff --git a/platform/msm_shared/timer.c b/platform/msm_shared/timer.c
index be3ac0f..9eb1e3f 100644
--- a/platform/msm_shared/timer.c
+++ b/platform/msm_shared/timer.c
@@ -41,68 +41,13 @@
#include <platform/interrupts.h>
#include <kernel/thread.h>
-#if PLATFORM_MSM7X30 || PLATFORM_MSM8X60 || PLATFORM_MSM8960
+#define GPT_ENABLE_CLR_ON_MATCH_EN 2
+#define GPT_ENABLE_EN 1
+#define DGT_ENABLE_CLR_ON_MATCH_EN 2
+#define DGT_ENABLE_EN 1
-#define MSM_GPT_BASE (MSM_TMR_BASE + 0x4)
-#define MSM_DGT_BASE (MSM_TMR_BASE + 0x24)
-#define GPT_REG(off) (MSM_GPT_BASE + (off))
-#define DGT_REG(off) (MSM_DGT_BASE + (off))
-#define SPSS_TIMER_STATUS (MSM_TMR_BASE + 0x88)
#define SPSS_TIMER_STATUS_DGT_EN (1 << 0)
-#define GPT_MATCH_VAL GPT_REG(0x0000)
-#define GPT_COUNT_VAL GPT_REG(0x0004)
-#define GPT_ENABLE GPT_REG(0x0008)
-#define GPT_ENABLE_CLR_ON_MATCH_EN 2
-#define GPT_ENABLE_EN 1
-#define GPT_CLEAR GPT_REG(0x000C)
-
-#define DGT_MATCH_VAL DGT_REG(0x0000)
-#define DGT_COUNT_VAL DGT_REG(0x0004)
-#define DGT_ENABLE DGT_REG(0x0008)
-#define DGT_ENABLE_CLR_ON_MATCH_EN 2
-#define DGT_ENABLE_EN 1
-#define DGT_CLEAR DGT_REG(0x000C)
-#define DGT_CLK_CTL DGT_REG(0x0010)
-
-#define HW_REVISION_NUMBER 0xABC00270
-
-
-#else
-#define GPT_REG(off) (MSM_GPT_BASE + (off))
-
-#define GPT_MATCH_VAL GPT_REG(0x0000)
-#define GPT_COUNT_VAL GPT_REG(0x0004)
-#define GPT_ENABLE GPT_REG(0x0008)
-#define GPT_ENABLE_CLR_ON_MATCH_EN 2
-#define GPT_ENABLE_EN 1
-#define GPT_CLEAR GPT_REG(0x000C)
-
-#define DGT_MATCH_VAL GPT_REG(0x0010)
-#define DGT_COUNT_VAL GPT_REG(0x0014)
-#define DGT_ENABLE GPT_REG(0x0018)
-#define DGT_ENABLE_CLR_ON_MATCH_EN 2
-#define DGT_ENABLE_EN 1
-#define DGT_CLEAR GPT_REG(0x001C)
-
-#define SPSS_TIMER_STATUS GPT_REG(0x0034)
-#endif
-
-#if defined PLATFORM_QSD8K
-#define DGT_HZ 4800000 /* Uses TCXO/4 (19.2 MHz / 4) */
-#elif defined PLATFORM_MSM7X30
-#if _EMMC_BOOT
-#define DGT_HZ 19200000 /* Uses TCXO (19.2 MHz) */
-#else
-#define DGT_HZ 6144000 /* Uses LPXO/4 (24.576 MHz / 4) */
-#endif
-#elif (defined(PLATFORM_MSM8X60) || defined(PLATFORM_MSM8960))
-#define DGT_HZ 6750000 /* Uses LPXO/4 (27.0 MHz / 4) */
-#else
-#define DGT_HZ 19200000 /* Uses TCXO (19.2 MHz) */
-#endif
-
-
static platform_timer_callback timer_callback;
static void *timer_arg;
static time_t timer_interval;
@@ -119,27 +64,18 @@
platform_timer_callback callback,
void *arg, time_t interval)
{
-#ifdef PLATFORM_MSM7X30
- unsigned val = 0;
- //Check for the hardware revision
- val = readl(HW_REVISION_NUMBER);
- val = (val >> 28) & 0x0F;
- if(val >= 1)
- writel(1, DGT_CLK_CTL);
-#endif
-#if (defined(PLATFORM_MSM8X60) || defined(PLATFORM_MSM8960))
- writel(3, DGT_CLK_CTL);
-#endif
+ uint32_t tick_count = interval * platform_tick_rate()/1000;
+
enter_critical_section();
timer_callback = callback;
timer_arg = arg;
timer_interval = interval;
- writel(timer_interval * (DGT_HZ / 1000), DGT_MATCH_VAL);
+ writel(tick_count, DGT_MATCH_VAL);
writel(0, DGT_CLEAR);
writel(DGT_ENABLE_EN | DGT_ENABLE_CLR_ON_MATCH_EN, DGT_ENABLE);
-
+
register_int_handler(INT_DEBUG_TIMER_EXP, timer_irq, 0);
unmask_interrupt(INT_DEBUG_TIMER_EXP);
@@ -153,16 +89,9 @@
return ticks;
}
-void platform_init_timer(void)
-{
- writel(0, DGT_ENABLE);
-}
-
static void wait_for_timer_op(void)
{
-#if PLATFORM_QSD8K || PLATFORM_MSM7X30 || PLATFORM_MSM8X60 || PLATFORM_MSM8960
while( readl(SPSS_TIMER_STATUS) & SPSS_TIMER_STATUS_DGT_EN );
-#endif
}
void platform_uninit_timer(void)
diff --git a/project/apq8064.mk b/project/apq8064.mk
new file mode 100644
index 0000000..1c483dd
--- /dev/null
+++ b/project/apq8064.mk
@@ -0,0 +1,13 @@
+# top level project rules for the apq8064 project
+#
+LOCAL_DIR := $(GET_LOCAL_DIR)
+
+TARGET := apq8064
+
+MODULES += app/aboot
+
+DEBUG := 1
+
+#DEFINES += WITH_DEBUG_DCC=1
+DEFINES += WITH_DEBUG_UART=1
+#DEFINES += WITH_DEBUG_FBCON=1
diff --git a/project/msm7625_ffa.mk b/project/msm7625_ffa.mk
deleted file mode 100644
index c3e804c..0000000
--- a/project/msm7625_ffa.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-# top level project rules for the msm7625_ffa project
-#
-LOCAL_DIR := $(GET_LOCAL_DIR)
-
-TARGET := msm7625_ffa
-
-MODULES += app/aboot
-
-#DEFINES += WITH_DEBUG_DCC=1
-#DEFINES += WITH_DEBUG_UART=1
-#DEFINES += WITH_DEBUG_FBCON=1
diff --git a/project/msm7625_ffa_nandwrite.mk b/project/msm7625_ffa_nandwrite.mk
deleted file mode 100644
index b8eebff..0000000
--- a/project/msm7625_ffa_nandwrite.mk
+++ /dev/null
@@ -1,14 +0,0 @@
-# top level project rules for the msm7625_ffa_nandwrite project
-#
-LOCAL_DIR := $(GET_LOCAL_DIR)
-
-TARGET := msm7625_ffa
-
-MODULES += app/nandwrite
-
-DEFINES += WITH_DEBUG_JTAG=1
-DEFINES += ENABLE_NANDWRITE=1
-#DEFINES += WITH_DEBUG_DCC=1
-#DEFINES += WITH_DEBUG_UART=1
-#DEFINES += WITH_DEBUG_FBCON=1
-
diff --git a/project/msm7625_surf.mk b/project/msm7625_surf.mk
deleted file mode 100644
index 5658a0e..0000000
--- a/project/msm7625_surf.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-# top level project rules for the msm7625_surf project
-#
-LOCAL_DIR := $(GET_LOCAL_DIR)
-
-TARGET := msm7625_surf
-
-MODULES += app/aboot
-
-#DEFINES += WITH_DEBUG_DCC=1
-#DEFINES += WITH_DEBUG_UART=1
-#DEFINES += WITH_DEBUG_FBCON=1
\ No newline at end of file
diff --git a/project/msm7625_surf_nandwrite.mk b/project/msm7625_surf_nandwrite.mk
deleted file mode 100644
index 401d2c5..0000000
--- a/project/msm7625_surf_nandwrite.mk
+++ /dev/null
@@ -1,14 +0,0 @@
-# top level project rules for the msm7625_surf_nandwrite project
-#
-LOCAL_DIR := $(GET_LOCAL_DIR)
-
-TARGET := msm7625_surf
-
-MODULES += app/nandwrite
-
-DEFINES += WITH_DEBUG_JTAG=1
-DEFINES += ENABLE_NANDWRITE=1
-#DEFINES += WITH_DEBUG_DCC=1
-#DEFINES += WITH_DEBUG_UART=1
-#DEFINES += WITH_DEBUG_FBCON=1
-
diff --git a/project/msm7627_7x_ffa.mk b/project/msm7627_7x_ffa.mk
deleted file mode 100644
index 5baefed..0000000
--- a/project/msm7627_7x_ffa.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-# top level project rules for the msm7627_ffa project
-#
-LOCAL_DIR := $(GET_LOCAL_DIR)
-
-TARGET := msm7627_ffa
-
-MODULES += app/aboot
-
-#DEFINES += WITH_DEBUG_DCC=1
-#DEFINES += WITH_DEBUG_UART=1
-#DEFINES += WITH_DEBUG_FBCON=1
diff --git a/project/msm7627_7x_ffa_nandwrite.mk b/project/msm7627_7x_ffa_nandwrite.mk
deleted file mode 100644
index db0da10..0000000
--- a/project/msm7627_7x_ffa_nandwrite.mk
+++ /dev/null
@@ -1,14 +0,0 @@
-# top level project rules for the msm7627_ffa_nandwrite project
-#
-LOCAL_DIR := $(GET_LOCAL_DIR)
-
-TARGET := msm7627_ffa
-
-MODULES += app/nandwrite
-
-DEFINES += WITH_DEBUG_JTAG=1
-DEFINES += ENABLE_NANDWRITE=1
-#DEFINES += WITH_DEBUG_DCC=1
-#DEFINES += WITH_DEBUG_UART=1
-#DEFINES += WITH_DEBUG_FBCON=1
-
diff --git a/project/msm7627_7x_surf.mk b/project/msm7627_7x_surf.mk
deleted file mode 100644
index 0b98025..0000000
--- a/project/msm7627_7x_surf.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-# top level project rules for the msm7627_surf project
-#
-LOCAL_DIR := $(GET_LOCAL_DIR)
-
-TARGET := msm7627_surf
-
-MODULES += app/aboot
-
-#DEFINES += WITH_DEBUG_DCC=1
-#DEFINES += WITH_DEBUG_UART=1
-DEFINES += WITH_DEBUG_FBCON=1
diff --git a/project/msm7627_7x_surf_nandwrite.mk b/project/msm7627_7x_surf_nandwrite.mk
deleted file mode 100644
index 7daac2c..0000000
--- a/project/msm7627_7x_surf_nandwrite.mk
+++ /dev/null
@@ -1,14 +0,0 @@
-# top level project rules for the msm7627_surf_nandwrite project
-#
-LOCAL_DIR := $(GET_LOCAL_DIR)
-
-TARGET := msm7627_surf
-
-MODULES += app/nandwrite
-
-DEFINES += WITH_DEBUG_JTAG=1
-DEFINES += ENABLE_NANDWRITE=1
-#DEFINES += WITH_DEBUG_DCC=1
-#DEFINES += WITH_DEBUG_UART=1
-#DEFINES += WITH_DEBUG_FBCON=1
-
diff --git a/project/msm7627_ffa.mk b/project/msm7627_ffa.mk
deleted file mode 100644
index 3943bb2..0000000
--- a/project/msm7627_ffa.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-# top level project rules for the msm7627_ffa project
-#
-LOCAL_DIR := $(GET_LOCAL_DIR)
-
-TARGET := msm7627_ffa
-
-MODULES += app/aboot
-
-#DEFINES += WITH_DEBUG_DCC=1
-#DEFINES += WITH_DEBUG_UART=1
-DEFINES += WITH_DEBUG_FBCON=1
diff --git a/project/msm7627_ffa_nandwrite.mk b/project/msm7627_ffa_nandwrite.mk
deleted file mode 100644
index db0da10..0000000
--- a/project/msm7627_ffa_nandwrite.mk
+++ /dev/null
@@ -1,14 +0,0 @@
-# top level project rules for the msm7627_ffa_nandwrite project
-#
-LOCAL_DIR := $(GET_LOCAL_DIR)
-
-TARGET := msm7627_ffa
-
-MODULES += app/nandwrite
-
-DEFINES += WITH_DEBUG_JTAG=1
-DEFINES += ENABLE_NANDWRITE=1
-#DEFINES += WITH_DEBUG_DCC=1
-#DEFINES += WITH_DEBUG_UART=1
-#DEFINES += WITH_DEBUG_FBCON=1
-
diff --git a/project/msm7630_1x.mk b/project/msm7630_1x.mk
deleted file mode 100644
index 91aa635..0000000
--- a/project/msm7630_1x.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-# top level project rules for the msm7630_surf project
-#
-LOCAL_DIR := $(GET_LOCAL_DIR)
-
-TARGET := msm7630_1x
-
-MODULES += app/aboot
-
-#DEFINES += WITH_DEBUG_DCC=1
-#DEFINES += WITH_DEBUG_UART=1
-#DEFINES += WITH_DEBUG_FBCON=1
diff --git a/project/msm7630_1x_nandwrite.mk b/project/msm7630_1x_nandwrite.mk
deleted file mode 100644
index 2efe688..0000000
--- a/project/msm7630_1x_nandwrite.mk
+++ /dev/null
@@ -1,14 +0,0 @@
-# top level project rules for the msm7630_surf_nandwrite project
-#
-LOCAL_DIR := $(GET_LOCAL_DIR)
-
-TARGET := msm7630_surf
-
-MODULES += app/nandwrite
-
-DEFINES += WITH_DEBUG_JTAG=1
-DEFINES += ENABLE_NANDWRITE=1
-#DEFINES += WITH_DEBUG_DCC=1
-#DEFINES += WITH_DEBUG_UART=1
-#DEFINES += WITH_DEBUG_FBCON=1
-
diff --git a/project/msm8655_surf.mk b/project/msm8655_surf.mk
deleted file mode 100644
index 8a2649f..0000000
--- a/project/msm8655_surf.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-# top level project rules for the msm7630_surf project
-#
-LOCAL_DIR := $(GET_LOCAL_DIR)
-
-TARGET := msm8655_surf
-
-MODULES += app/aboot
-
-#DEFINES += WITH_DEBUG_DCC=1
-#DEFINES += WITH_DEBUG_UART=1
-#DEFINES += WITH_DEBUG_FBCON=1
diff --git a/project/msm8655_surf_nandwrite.mk b/project/msm8655_surf_nandwrite.mk
deleted file mode 100644
index 62ae02a..0000000
--- a/project/msm8655_surf_nandwrite.mk
+++ /dev/null
@@ -1,14 +0,0 @@
-# top level project rules for the msm7630_surf_nandwrite project
-#
-LOCAL_DIR := $(GET_LOCAL_DIR)
-
-TARGET := msm8655_surf
-
-MODULES += app/nandwrite
-
-DEFINES += WITH_DEBUG_JTAG=1
-DEFINES += ENABLE_NANDWRITE=1
-#DEFINES += WITH_DEBUG_DCC=1
-#DEFINES += WITH_DEBUG_UART=1
-#DEFINES += WITH_DEBUG_FBCON=1
-
diff --git a/project/msm8660_csfb.mk b/project/msm8660_csfb.mk
deleted file mode 100644
index 482a048..0000000
--- a/project/msm8660_csfb.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-# top level project rules for the msm8660_csfb project
-#
-LOCAL_DIR := $(GET_LOCAL_DIR)
-
-TARGET := msm8660_surf
-
-MODULES += app/aboot
-
-#DEFINES += WITH_DEBUG_DCC=1
-#DEFINES += WITH_DEBUG_UART=1
-#DEFINES += WITH_DEBUG_FBCON=1
diff --git a/target/msm7625_ffa/atags.c b/target/apq8064/atags.c
similarity index 74%
rename from target/msm7625_ffa/atags.c
rename to target/apq8064/atags.c
index 9029ad2..f686bf6 100644
--- a/target/msm7625_ffa/atags.c
+++ b/target/apq8064/atags.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, Code Aurora Forum. All rights reserved.
+/* Copyright (c) 2009-2011, Code Aurora Forum. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -25,8 +25,30 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
+#include <sys/types.h>
-unsigned* target_atag_mem(unsigned* ptr)
+#define SIZE_1M (1024*1024)
+#define SIZE_141M (141*SIZE_1M)
+
+#define KERNEL_MEM_ADDR_1 0x80200000
+
+uint32_t* target_atag_mem(uint32_t* ptr)
{
- return ptr;
+ /* ATAG_MEM */
+ *ptr++ = 4;
+ *ptr++ = 0x54410002;
+ *ptr++ = SIZE_141M;
+ *ptr++ = KERNEL_MEM_ADDR_1;
+
+ return ptr;
+}
+
+void *target_get_scratch_address(void)
+{
+ return((void *)KERNEL_MEM_ADDR_1);
+}
+
+uint32_t target_get_max_flash_size(void)
+{
+ return (SIZE_141M);
}
diff --git a/target/apq8064/init.c b/target/apq8064/init.c
new file mode 100644
index 0000000..c5f475c
--- /dev/null
+++ b/target/apq8064/init.c
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google, Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <reg.h>
+#include <debug.h>
+#include <smem.h>
+#include <uart_dm.h>
+#include <gsbi.h>
+#include <baseband.h>
+#include <dev/keys.h>
+#include <dev/pm8921.h>
+#include <dev/gpio_keypad.h>
+#include <platform/iomap.h>
+#include <lib/ptable.h>
+
+#define LINUX_MACHTYPE_APQ8064_SIM 3572
+
+extern unsigned int mmc_boot_main(unsigned char slot, unsigned int base);
+extern void mdelay(unsigned msecs);
+extern void keypad_init(void);
+
+static unsigned mmc_sdc_base[] =
+{
+ MSM_SDC1_BASE,
+ MSM_SDC2_BASE,
+ MSM_SDC3_BASE,
+ MSM_SDC4_BASE
+};
+
+static pm8921_dev_t pmic;
+static const uint8_t uart_gsbi_id = GSBI_ID_3;
+
+void target_init(void)
+{
+ uint32_t base_addr;
+ uint8_t slot;
+ dprintf(INFO, "target_init()\n");
+
+ /* Initialize PMIC driver */
+ pmic.read = pa1_ssbi2_read_bytes;
+ pmic.write = pa1_ssbi2_write_bytes;
+
+ pm8921_init(&pmic);
+
+ /* Keypad init */
+ keys_init();
+ keypad_init();
+
+ /* Trying Slot 1 first */
+ slot = 1;
+ base_addr = mmc_sdc_base[slot-1];
+ if(mmc_boot_main(slot, base_addr))
+ {
+ /* Trying Slot 3 next */
+ slot = 3;
+ base_addr = mmc_sdc_base[slot-1];
+ if(mmc_boot_main(slot, base_addr))
+ {
+ dprintf(CRITICAL, "mmc init failed!");
+ ASSERT(0);
+ }
+ }
+}
+
+uint32_t board_machtype(void)
+{
+ struct smem_board_info_v6 board_info_v6;
+ uint32_t board_info_len = 0;
+ uint32_t smem_status = 0;
+ uint32_t format = 0;
+ uint32_t id = HW_PLATFORM_UNKNOWN;
+ uint32_t mach_id;
+
+
+ smem_status = smem_read_alloc_entry_offset(SMEM_BOARD_INFO_LOCATION,
+ &format, sizeof(format), 0);
+ if(!smem_status)
+ {
+ if (format == 6)
+ {
+ board_info_len = sizeof(board_info_v6);
+
+ smem_status = smem_read_alloc_entry(SMEM_BOARD_INFO_LOCATION,
+ &board_info_v6, board_info_len);
+ if(!smem_status)
+ {
+ id = board_info_v6.board_info_v3.hw_platform;
+ }
+ }
+ }
+
+ /* Detect the board we are running on */
+ switch(id)
+ {
+ /* APQ8064 machine id not yet defined for CDP etc.
+ * default to simulator.
+ */
+ case HW_PLATFORM_SURF:
+ case HW_PLATFORM_FFA:
+ case HW_PLATFORM_FLUID:
+ default:
+ mach_id = LINUX_MACHTYPE_APQ8064_SIM;
+ };
+
+ return mach_id;
+}
+
+void reboot_device(uint32_t reboot_reason)
+{
+ /* TODO: Not implemented yet. */
+ ASSERT(0);
+}
+
+uint32_t check_reboot_mode(void)
+{
+ uint32_t restart_reason = 0;
+
+ /* Read reboot reason and scrub it */
+ restart_reason = readl(RESTART_REASON_ADDR);
+ writel(0x00, RESTART_REASON_ADDR);
+
+ return restart_reason;
+}
+
+void target_serialno(unsigned char *buf)
+{
+ uint32_t serialno;
+ if(target_is_emmc_boot())
+ {
+ serialno = mmc_get_psn();
+ sprintf(buf,"%x",serialno);
+ }
+}
+
+/* Do any target specific intialization needed before entering fastboot mode */
+void target_fastboot_init(void)
+{
+ /* Set the BOOT_DONE flag in PM8921 */
+ pm8921_boot_done();
+}
+
+/* GSBI to be used for UART */
+uint8_t target_uart_gsbi(void)
+{
+ return uart_gsbi_id;
+}
+
+/* Returns type of baseband. APQ for APPs only proc. */
+unsigned target_baseband()
+{
+ return BASEBAND_APQ;
+}
diff --git a/target/apq8064/keypad.c b/target/apq8064/keypad.c
new file mode 100644
index 0000000..c2d01fe
--- /dev/null
+++ b/target/apq8064/keypad.c
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Code Aurora nor
+ * the names of its contributors may be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <string.h>
+#include <dev/keys.h>
+#include <dev/gpio_keypad.h>
+
+#define NUM_OF_ROWS 1
+#define NUM_OF_COLS 5
+
+#define BITS_IN_ELEMENT(x) (sizeof(x)[0] * 8)
+
+static unsigned char qwerty_keys_old[NUM_OF_ROWS];
+static unsigned char qwerty_keys_new[NUM_OF_ROWS];
+
+#define KEYMAP_INDEX(row, col) (row)* BITS_IN_ELEMENT(qwerty_keys_new) + (col)
+
+unsigned int qwerty_keymap[] = {
+ [KEYMAP_INDEX(0, 0)] = KEY_VOLUMEUP,
+ [KEYMAP_INDEX(0, 1)] = KEY_VOLUMEDOWN,
+};
+
+
+struct qwerty_keypad_info qwerty_keypad = {
+ .keymap = qwerty_keymap,
+ .old_keys = qwerty_keys_old,
+ .rec_keys = qwerty_keys_new,
+ .rows = NUM_OF_ROWS,
+ .columns = NUM_OF_COLS,
+ .num_of_reads = NUM_OF_ROWS,
+ .rd_func = &pa1_ssbi2_read_bytes,
+ .wr_func = &pa1_ssbi2_write_bytes,
+ .settle_time = 5 /* msec */,
+ .poll_time = 20 /* msec */,
+};
+
+void keypad_init(void)
+{
+ memset(qwerty_keys_old, 0, sizeof(qwerty_keys_old));
+ memset(qwerty_keys_new, 0, sizeof(qwerty_keys_new));
+
+ ssbi_keypad_init(&qwerty_keypad);
+}
diff --git a/target/apq8064/rules.mk b/target/apq8064/rules.mk
new file mode 100644
index 0000000..9e54d77
--- /dev/null
+++ b/target/apq8064/rules.mk
@@ -0,0 +1,29 @@
+LOCAL_DIR := $(GET_LOCAL_DIR)
+
+INCLUDES += -I$(LOCAL_DIR)/include -I$(LK_TOP_DIR)/platform/msm_shared
+
+PLATFORM := apq8064
+
+MEMBASE := 0x88F00000 # SDRAM
+MEMSIZE := 0x00100000 # 1MB
+
+SCRATCH_ADDR := 0x90000000
+SCRATCH_SIZE := 128 #size in MB
+
+KEYS_USE_GPIO_KEYPAD := 1
+
+MODULES += \
+ dev/keys \
+ dev/pmic/pm8921 \
+ lib/ptable
+
+DEFINES += \
+ MEMSIZE=$(MEMSIZE) \
+ MEMBASE=$(MEMBASE) \
+ SCRATCH_ADDR=$(SCRATCH_ADDR) \
+ SCRATCH_SIZE=$(SCRATCH_SIZE)
+
+OBJS += \
+ $(LOCAL_DIR)/init.o \
+ $(LOCAL_DIR)/atags.o \
+ $(LOCAL_DIR)/keypad.o
diff --git a/target/msm8655_surf/tools/makefile b/target/apq8064/tools/makefile
similarity index 86%
rename from target/msm8655_surf/tools/makefile
rename to target/apq8064/tools/makefile
index 5cb1229..7da7c6d 100644
--- a/target/msm8655_surf/tools/makefile
+++ b/target/apq8064/tools/makefile
@@ -39,12 +39,6 @@
emmc_appsboothd.mbn: mkheader $(OUTBIN)
$(SRC_DIR)/mkheader $(OUTBIN) $(APPSBOOTHEADER_DIR)/emmc_appsboothd.mbn
-ifeq ($(ENABLE_TRUSTZONE), 1)
-mkheader: $(SRC_DIR)/mkheader.c
- ${COMPILER} -DMEMBASE=$(LK_START) $(SRC_DIR)/mkheader.c -o $(SRC_DIR)/mkheader
- cp $(SRC_DIR)/mkheader $(APPSBOOTHEADER_DIR)/mkheader
-else
mkheader: $(SRC_DIR)/mkheader.c
${COMPILER} -DMEMBASE=$(MEMBASE) $(SRC_DIR)/mkheader.c -o $(SRC_DIR)/mkheader
cp $(SRC_DIR)/mkheader $(APPSBOOTHEADER_DIR)/mkheader
-endif
diff --git a/target/msm8655_surf/tools/mkheader.c b/target/apq8064/tools/mkheader.c
similarity index 78%
rename from target/msm8655_surf/tools/mkheader.c
rename to target/apq8064/tools/mkheader.c
index fda8b67..cd11810 100644
--- a/target/msm8655_surf/tools/mkheader.c
+++ b/target/apq8064/tools/mkheader.c
@@ -2,7 +2,7 @@
* Copyright (c) 2007, Google Inc.
* All rights reserved.
*
- * Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2009-2011, Code Aurora Forum. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -41,16 +41,23 @@
int print_usage(){
fprintf(stderr,"usage: mkheader <bin> <hdr> <none|unified-boot>\n");
- fprintf(stderr," mkheader <bin> <hdr> <unsecure-boot> <outbin>\n");
- fprintf(stderr," mkheader <bin> <hdr> <secure-boot> <outbin> <maxsize>\n");
- fprintf(stderr," mkheader <bin> <hdr> <secure-boot> <outbin> <maxsize> <certchain> <files...>\n\n");
+ fprintf(stderr," mkheader <bin> <hdr> <unsecure-boot>"
+ " <outbin>\n");
+ fprintf(stderr," mkheader <bin> <hdr> <secure-boot> <outbin>"
+ " <maxsize>\n");
+ fprintf(stderr," mkheader <bin> <hdr> <secure-boot> <outbin>"
+ " <maxsize> <certchain> <files...>\n\n");
fprintf(stderr,"bin: Input raw appsbl binary\n");
fprintf(stderr,"hdr: Output of appsbl header location\n");
- fprintf(stderr,"outbin: Output of the signed or unsigned apps boot location\n");
- fprintf(stderr,"maxsize: Maximum size for certificate chain\n");
+ fprintf(stderr,"outbin: Output of the signed or unsigned"
+ " apps boot location\n");
+ fprintf(stderr,"maxsize: Maximum size for certificate"
+ " chain\n");
fprintf(stderr,"certchain: Output of the certchain location\n");
- fprintf(stderr,"files: Input format <bin signature> <certifcate file(s) for certificate chain>...\n");
- fprintf(stderr,"certificate chain: Files will be concatenated in order to create the certificate chain\n\n");
+ fprintf(stderr,"files: Input format <bin signature>"
+ " <certifcate file(s) for certificate chain>...\n");
+ fprintf(stderr,"certificate chain: Files will be concatenated in order"
+ " to create the certificate chain\n\n");
return -1;
}
@@ -63,7 +70,8 @@
fread(buf, sizeof(char), buff_size, in);
if(!feof(in)){
bytes_left -= fwrite(buf, sizeof(char), buff_size, out);
- }else
+ }
+ else
bytes_left = 0;
}
ret = ferror(in) | ferror(out);
@@ -90,31 +98,38 @@
return print_usage();
}
- if (argc == 4) {
+ if(argc == 4) {
if(!strcmp("unified-boot",argv[3])) {
unified_boot = 1;
- }else if(!strcmp("secure-boot",argv[3])){
+ }
+ else if(!strcmp("secure-boot",argv[3])){
fprintf(stderr,
- "ERROR: Missing arguments: [outbin maxsize] | [outbin, maxsize, certchain, signature + certifcate(s)]\n");
+ "ERROR: Missing arguments: [outbin maxsize] |"
+ " [outbin, maxsize, certchain,"
+ " signature + certifcate(s)]\n");
return print_usage();
}
else if(!strcmp("unsecure-boot",argv[3])){
- fprintf(stderr,"ERROR: Missing arguments: outbin directory\n");
+ fprintf(stderr,"ERROR: Missing arguments:"
+ " outbin directory\n");
return print_usage();
}
}
- if (argc > 4) {
+ if(argc > 4) {
if(!strcmp("secure-boot",argv[3])) {
if(argc < 9 && argc != 6){
fprintf(stderr,
- "ERROR: Missing argument(s): [outbin maxsize] | [outbin, maxsize, certchain, signature + certifcate(s)]\n");
+ "ERROR: Missing argument(s):"
+ " [outbin maxsize] | [outbin, maxsize,"
+ " certchain,"
+ " signature + certifcate(s)]\n");
return print_usage();
- }
- secure_boot = 1;
- signature_size = 256; //Support SHA 256
+ }
+ secure_boot = 1;
+ signature_size = 256; //Support SHA 256
cert_chain_size = atoi(argv[5]);
- }
+ }
}
if(stat(argv[1], &s)) {
@@ -125,7 +140,8 @@
if(unified_boot) {
magic = unified_boot_magic;
magic_len = sizeof(unified_boot_magic);
- } else {
+ }
+ else {
magic = non_unified_boot_magic;
magic_len = sizeof(non_unified_boot_magic);
}
@@ -150,13 +166,13 @@
magic[8] = size + base + signature_size;
magic[9] = cert_chain_size;
- if (unified_boot == 1)
+ if(unified_boot == 1)
{
- magic[10] = 0x33836685; /* cookie magic number */
- magic[11] = 0x00000001; /* cookie version */
- magic[12] = 0x00000002; /* file formats */
+ magic[10] = 0x33836685; /* cookie magic number */
+ magic[11] = 0x00000001; /* cookie version */
+ magic[12] = 0x00000002; /* file formats */
magic[13] = 0x00000000;
- magic[14] = 0x00000000; /* not setting size for boot.img */
+ magic[14] = 0x00000000; /* not setting size for boot.img */
magic[15] = 0x00000000;
magic[16] = 0x00000000;
magic[17] = 0x00000000;
@@ -177,7 +193,7 @@
}
close(fd);
- if (secure_boot && argc > 6){
+ if(secure_boot && argc > 6){
FILE * input_file;
FILE * output_file;
unsigned buff_size = 1;
@@ -193,7 +209,7 @@
}
printf("Certificate Chain Output File: %s\n", argv[6]);
- for (i = 8; i < argc; i++){
+ for(i = 8; i < argc; i++){
if((input_file = fopen(argv[i], "rb"))==NULL){
perror("ERROR: Occured during fopen");
return -1;
@@ -201,7 +217,7 @@
stat(argv[i], &s);
bytes_left = s.st_size;
current_cert_chain_size += bytes_left;
- if (cat(input_file, output_file, bytes_left, buff_size))
+ if(cat(input_file, output_file, bytes_left, buff_size))
return -1;
fclose(input_file);
}
@@ -211,7 +227,9 @@
padding_size = cert_chain_size - current_cert_chain_size;
if(padding_size <0){
- fprintf(stderr, "ERROR: Input certificate chain (Size=%d) is larger than the maximum specified (Size=%d)\n",
+ fprintf(stderr, "ERROR: Input certificate chain"
+ " (Size=%d) is larger than the maximum"
+ " specified (Size=%d)\n",
current_cert_chain_size, cert_chain_size);
return -1;
}
@@ -219,15 +237,21 @@
bytes_left = (padding_size > 0) ? padding_size : 0;
while(bytes_left){
if(!ferror(output_file))
- bytes_left -= fwrite(buf, sizeof(buf), buff_size, output_file);
+ bytes_left -= fwrite(buf,
+ sizeof(buf),
+ buff_size,
+ output_file);
else{
- fprintf(stderr, "ERROR: Occured during certifcate chain padding\n");
+ fprintf(stderr, "ERROR: Occured during"
+ " certifcate chain padding\n");
return -1;
}
}
fclose(output_file);
- //Concat and combine to signed image. Format [HDR][RAW APPSBOOT][PADDED CERT CHAIN]
+ /* Concat and combine to signed image.
+ * Format [HDR][RAW APPSBOOT][PADDED CERT CHAIN]
+ */
if((output_file = fopen(argv[4], "wb"))==NULL){
perror("ERROR: Occured during fopen");
return -1;
@@ -240,7 +264,7 @@
return -1;
}
stat(argv[2], &s);
- if (cat(input_file, output_file, s.st_size, buff_size))
+ if(cat(input_file, output_file, s.st_size, buff_size))
return -1;
fclose(input_file);
@@ -269,19 +293,23 @@
perror("ERROR: Occured during fopen");
return -1;
}
- if(cat(input_file, output_file, (current_cert_chain_size + padding_size), buff_size))
+ if(cat(input_file, output_file,
+ (current_cert_chain_size + padding_size), buff_size))
return -1;
fclose(input_file);
fclose(output_file);
- }else if(argc == 5 || argc == 6){
+ }
+ else if(argc == 5 || argc == 6){
FILE * input_file;
FILE * output_file;
unsigned buff_size = 1;
char buf[buff_size];
- //Concat and combine to unsigned image. Format [HDR][RAW APPSBOOT]
+ /* Concat and combine to unsigned image.
+ * Format [HDR][RAW APPSBOOT]
+ */
if((output_file = fopen(argv[4], "wb"))==NULL){
perror("ERROR: Occured during fopen");
return -1;
@@ -294,7 +322,7 @@
return -1;
}
stat(argv[2], &s);
- if (cat(input_file, output_file, s.st_size, buff_size))
+ if(cat(input_file, output_file, s.st_size, buff_size))
return -1;
fclose(input_file);
diff --git a/target/init.c b/target/init.c
index 2984a96..9dbcc9d 100644
--- a/target/init.c
+++ b/target/init.c
@@ -68,11 +68,6 @@
{
}
-__WEAK void target_battery_charging_enable
- (unsigned enable, unsigned disconnect)
-{
-}
-
__WEAK unsigned target_pause_for_battery_charge(void)
{
return 0;
diff --git a/target/msm7625_ffa/include/target/display.h b/target/msm7625_ffa/include/target/display.h
deleted file mode 100644
index 166dc19..0000000
--- a/target/msm7625_ffa/include/target/display.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of Code Aurora Forum, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef _TARGET_MSM7625_FFA_DISPLAY_H
-#define _TARGET_MSM7625_FFA_DISPLAY_H
-
-#define TARGET_XRES 480
-#define TARGET_YRES 800
-
-#define LCDC_FB_WIDTH 480
-#define LCDC_FB_HEIGHT 640
-
-#define LCDC_HSYNC_PULSE_WIDTH_DCLK 60
-#define LCDC_HSYNC_BACK_PORCH_DCLK 144
-#define LCDC_HSYNC_FRONT_PORCH_DCLK 33
-#define LCDC_HSYNC_SKEW_DCLK 0
-
-#define LCDC_VSYNC_PULSE_WIDTH_LINES 2
-#define LCDC_VSYNC_BACK_PORCH_LINES 2
-#define LCDC_VSYNC_FRONT_PORCH_LINES 2
-
-#endif
diff --git a/target/msm7625_ffa/init.c b/target/msm7625_ffa/init.c
deleted file mode 100755
index 62b1e11..0000000
--- a/target/msm7625_ffa/init.c
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Copyright (c) 2009, Google Inc.
- * All rights reserved.
- * Copyright (c) 2009-2011, Code Aurora Forum. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google, Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <debug.h>
-#include <dev/keys.h>
-#include <dev/gpio_keypad.h>
-#include <lib/ptable.h>
-#include <dev/flash.h>
-#include <smem.h>
-#include <platform.h>
-
-#define LINUX_MACHTYPE 2704
-
-#define VARIABLE_LENGTH 0x10101010
-#define DIFF_START_ADDR 0xF0F0F0F0
-#define NUM_PAGES_PER_BLOCK 0x40
-
-static struct ptable flash_ptable;
-
-/* for these partitions, start will be offset by either what we get from
- * smem, or from the above offset if smem is not useful. Also, we should
- * probably have smem_ptable code populate our flash_ptable.
- *
- * When smem provides us with a full partition table, we can get rid of
- * this altogether.
- *
- */
-static struct ptentry board_part_list[] = {
- {
- .start = 0,
- .length = 5 /* In MB */,
- .name = "boot",
- },
- {
- .start = DIFF_START_ADDR,
- .length = 95 /* In MB */,
- .name = "system",
- },
- {
- .start = DIFF_START_ADDR,
- .length = 1 /* In MB */,
- .name = "cache",
- },
- {
- .start = DIFF_START_ADDR,
- .length = 1 /* In MB */,
- .name = "misc",
- },
- {
- .start = DIFF_START_ADDR,
- .length = VARIABLE_LENGTH,
- .name = "userdata",
- },
- {
- .start = DIFF_START_ADDR,
- .length = 2 /* In MB */,
- .name = "persist",
- },
- {
- .start = DIFF_START_ADDR,
- .length = 5 /* In MB */,
- .name = "recovery",
- },
-};
-static int num_parts = sizeof(board_part_list)/sizeof(struct ptentry);
-
-void smem_ptable_init(void);
-unsigned smem_get_apps_flash_start(void);
-
-void keypad_init(void);
-
-int target_is_emmc_boot(void);
-
-void target_init(void)
-{
- unsigned offset;
- struct flash_info *flash_info;
- unsigned total_num_of_blocks;
- unsigned next_ptr_start_adr = 0;
- unsigned blocks_per_1MB = 8; /* Default value of 2k page size on 256MB flash drive*/
- int i;
-
- dprintf(INFO, "target_init()\n");
-
-#if (!ENABLE_NANDWRITE)
- keys_init();
- keypad_init();
-#endif
-
- if (target_is_emmc_boot())
- return;
-
- ptable_init(&flash_ptable);
- smem_ptable_init();
-
- flash_init();
- flash_info = flash_get_info();
- ASSERT(flash_info);
-
- offset = smem_get_apps_flash_start();
- if (offset == 0xffffffff)
- while(1);
-
- total_num_of_blocks = flash_info->num_blocks;
- blocks_per_1MB = (1 << 20) / (flash_info->block_size);
-
- for (i = 0; i < num_parts; i++) {
- struct ptentry *ptn = &board_part_list[i];
- unsigned len = ((ptn->length) * blocks_per_1MB);
-
- if(ptn->start != 0)
- ASSERT(ptn->start == DIFF_START_ADDR);
-
- ptn->start = next_ptr_start_adr;
-
- if(ptn->length == VARIABLE_LENGTH)
- {
- unsigned length_for_prt = 0;
- unsigned j;
- for (j = i+1; j < num_parts; j++)
- {
- struct ptentry *temp_ptn = &board_part_list[j];
- ASSERT(temp_ptn->length != VARIABLE_LENGTH);
- length_for_prt += ((temp_ptn->length) * blocks_per_1MB);
- }
- len = (total_num_of_blocks - 1) - (offset + ptn->start + length_for_prt);
- ASSERT(len >= 0);
- }
- next_ptr_start_adr = ptn->start + len;
- ptable_add(&flash_ptable, ptn->name, offset + ptn->start,
- len, ptn->flags, TYPE_APPS_PARTITION, PERM_WRITEABLE);
- }
-
- smem_add_modem_partitions(&flash_ptable);
-
- ptable_dump(&flash_ptable);
- flash_set_ptable(&flash_ptable);
-}
-
-unsigned board_machtype(void)
-{
- return LINUX_MACHTYPE;
-}
-
-void reboot_device(unsigned reboot_reason)
-{
- reboot(reboot_reason);
-}
-
-unsigned check_reboot_mode(void)
-{
- unsigned mode[2] = {0, 0};
- unsigned int mode_len = sizeof(mode);
- unsigned smem_status;
-
- smem_status = smem_read_alloc_entry(SMEM_APPS_BOOT_MODE,
- &mode, mode_len );
- if(smem_status)
- {
- dprintf(CRITICAL, "ERROR: unable to read shared memory for reboot mode\n");
- return 0;
- }
- return mode[0];
-}
diff --git a/target/msm7625_ffa/keypad.c b/target/msm7625_ffa/keypad.c
deleted file mode 100644
index 7550ed5..0000000
--- a/target/msm7625_ffa/keypad.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2009, Google Inc.
- * All rights reserved.
- * Copyright (c) 2009, Code Aurora Forum. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google, Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <dev/keys.h>
-#include <dev/gpio_keypad.h>
-
-#define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
-
-/* don't turn this on without updating the ffa support */
-#define SCAN_FUNCTION_KEYS 0
-
-static unsigned int halibut_row_gpios[] = {
- 31, 32, 33, 34, 35, 41
-#if SCAN_FUNCTION_KEYS
- , 42
-#endif
-};
-
-static unsigned int halibut_col_gpios[] = { 36, 37, 38, 39, 40 };
-
-#define KEYMAP_INDEX(row, col) ((row)*ARRAY_SIZE(halibut_col_gpios) + (col))
-
-static const unsigned short halibut_keymap[ARRAY_SIZE(halibut_col_gpios) * ARRAY_SIZE(halibut_row_gpios)] = {
- //[KEYMAP_INDEX(0, 0)] = KEY_5,
- //[KEYMAP_INDEX(0, 1)] = KEY_9,
- [KEYMAP_INDEX(0, 2)] = KEY_1,
- [KEYMAP_INDEX(0, 3)] = KEY_SEND,
- [KEYMAP_INDEX(0, 4)] = KEY_LEFT,
-
- [KEYMAP_INDEX(1, 0)] = KEY_3,
- [KEYMAP_INDEX(1, 1)] = KEY_RIGHT,
- [KEYMAP_INDEX(1, 2)] = KEY_VOLUMEUP,
- //[KEYMAP_INDEX(1, 3)] = KEY_SHARP,
- [KEYMAP_INDEX(1, 4)] = KEY_6,
-
- [KEYMAP_INDEX(2, 0)] = KEY_HOME, /* A */
- [KEYMAP_INDEX(2, 1)] = KEY_BACK, /* B */
- [KEYMAP_INDEX(2, 2)] = KEY_0,
- [KEYMAP_INDEX(2, 3)] = KEY_SHARP,
- [KEYMAP_INDEX(2, 4)] = KEY_9,
-
- [KEYMAP_INDEX(3, 0)] = KEY_UP,
- [KEYMAP_INDEX(3, 1)] = KEY_CENTER,
- [KEYMAP_INDEX(3, 2)] = KEY_4,
- //[KEYMAP_INDEX(3, 3)] = KEY_MUTE, /* SPKR */
- [KEYMAP_INDEX(3, 4)] = KEY_2,
-
- [KEYMAP_INDEX(4, 0)] = KEY_VOLUMEDOWN,
- [KEYMAP_INDEX(4, 1)] = KEY_SOUND,
- [KEYMAP_INDEX(4, 2)] = KEY_DOWN,
- [KEYMAP_INDEX(4, 3)] = KEY_8,
- [KEYMAP_INDEX(4, 4)] = KEY_5,
-
- //[KEYMAP_INDEX(5, 0)] = KEY_VOLUMEDOWN,
- [KEYMAP_INDEX(5, 1)] = KEY_STAR,
- [KEYMAP_INDEX(5, 2)] = KEY_SOFT2,
- [KEYMAP_INDEX(5, 3)] = KEY_MENU,
- [KEYMAP_INDEX(5, 4)] = KEY_7,
-
-#if SCAN_FUNCTION_KEYS
- [KEYMAP_INDEX(6, 0)] = KEY_F5,
- [KEYMAP_INDEX(6, 1)] = KEY_F4,
- [KEYMAP_INDEX(6, 2)] = KEY_F3,
- [KEYMAP_INDEX(6, 3)] = KEY_F2,
- [KEYMAP_INDEX(6, 4)] = KEY_F1
-#endif
-};
-
-static struct gpio_keypad_info halibut_keypad_info = {
- .keymap = halibut_keymap,
- .output_gpios = halibut_row_gpios,
- .input_gpios = halibut_col_gpios,
- .noutputs = ARRAY_SIZE(halibut_row_gpios),
- .ninputs = ARRAY_SIZE(halibut_col_gpios),
- .settle_time = 5 /* msec */,
- .poll_time = 20 /* msec */,
- .flags = GPIOKPF_DRIVE_INACTIVE,
-};
-
-void keypad_init(void)
-{
- gpio_keypad_init(&halibut_keypad_info);
-}
diff --git a/target/msm7625_ffa/rules.mk b/target/msm7625_ffa/rules.mk
deleted file mode 100755
index 372f1f2..0000000
--- a/target/msm7625_ffa/rules.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-LOCAL_DIR := $(GET_LOCAL_DIR)
-
-INCLUDES += -I$(LOCAL_DIR)/include -I$(LK_TOP_DIR)/platform/msm_shared
-
-PLATFORM := msm7k
-
-MEMBASE := 0x00000000 # SMI
-MEMSIZE := 0x00100000 # 1MB
-
-BASE_ADDR := 0x00200000
-
-TAGS_ADDR := BASE_ADDR+0x00000100
-KERNEL_ADDR := BASE_ADDR+0x00008000
-RAMDISK_ADDR := BASE_ADDR+0x01000000
-SCRATCH_ADDR := BASE_ADDR+0x02008000
-
-KEYS_USE_GPIO_KEYPAD := 1
-
-DEFINES += DISPLAY_TYPE_MDDI=0
-DEFINES += ENABLE_PLL3=1
-
-MODULES += \
- dev/keys \
- lib/ptable
-
-DEFINES += \
- SDRAM_SIZE=$(MEMSIZE) \
- MEMBASE=$(MEMBASE) \
- BASE_ADDR=$(BASE_ADDR) \
- TAGS_ADDR=$(TAGS_ADDR) \
- KERNEL_ADDR=$(KERNEL_ADDR) \
- RAMDISK_ADDR=$(RAMDISK_ADDR) \
- SCRATCH_ADDR=$(SCRATCH_ADDR)
-
-
-OBJS += \
- $(LOCAL_DIR)/init.o \
- $(LOCAL_DIR)/keypad.o \
- $(LOCAL_DIR)/atags.o
diff --git a/target/msm7625_ffa/tools/makefile b/target/msm7625_ffa/tools/makefile
deleted file mode 100644
index b6c2ac0..0000000
--- a/target/msm7625_ffa/tools/makefile
+++ /dev/null
@@ -1,38 +0,0 @@
-#Makefile to generate appsboot.mbn
-
-ifeq ($(BOOTLOADER_OUT),.)
-APPSBOOTHEADER_DIR := $(BUILDDIR)
-else
-APPSBOOTHEADER_DIR := $(BOOTLOADER_OUT)/../../
-endif
-
-SRC_DIR := target/$(TARGET)/tools
-COMPILER := gcc
-
-ifeq ($(EMMC_BOOT), 1)
- APPSBOOTHDR_FILES := EMMCBOOT.MBN emmc_appsboothd.mbn
-else
- ifeq ($(BUILD_NANDWRITE), 1)
- APPSBOOTHDR_FILES :=
- else
- APPSBOOTHDR_FILES := appsboot.mbn appsboothd.mbn
- endif
-endif
-
-APPSBOOTHEADER: $(APPSBOOTHDR_FILES)
-
-appsboot.mbn: $(OUTBIN)
- cp -f $(OUTBIN) $(APPSBOOTHEADER_DIR)/appsboot.mbn
-
-appsboothd.mbn: mkheader $(OUTBIN)
- $(SRC_DIR)/mkheader $(OUTBIN) $(APPSBOOTHEADER_DIR)/appsboothd.mbn
-
-EMMCBOOT.MBN: $(OUTBIN)
- cp -f $(OUTBIN) $(APPSBOOTHEADER_DIR)/EMMCBOOT.MBN
-
-emmc_appsboothd.mbn: mkheader $(OUTBIN)
- $(SRC_DIR)/mkheader $(OUTBIN) $(APPSBOOTHEADER_DIR)/emmc_appsboothd.mbn unified-boot
-
-mkheader: $(SRC_DIR)/mkheader.c
- ${COMPILER} $(SRC_DIR)/mkheader.c -o $(SRC_DIR)/mkheader
-
diff --git a/target/msm7625_ffa/tools/mkheader.c b/target/msm7625_ffa/tools/mkheader.c
deleted file mode 100644
index 9b03907..0000000
--- a/target/msm7625_ffa/tools/mkheader.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/* Copyright 2007, Google Inc. */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-#include <sys/stat.h>
-
-int main(int argc, char *argv[])
-{
- struct stat s;
- unsigned size, base;
- int unified_boot = 0;
- unsigned unified_boot_magic[20];
- unsigned non_unified_boot_magic[10];
- unsigned magic_len = 0;
- unsigned *magic;
- int fd;
-
- if(argc < 3) {
- fprintf(stderr,"usage: mkheader <bin> <hdr>\n");
- return -1;
- }
-
- if (argc == 4) {
- if(!strcmp("unified-boot",argv[3])) {
- unified_boot = 1;
- }
- }
-
- if(stat(argv[1], &s)) {
- perror("cannot stat binary");
- return -1;
- }
-
- if(unified_boot) {
- magic = unified_boot_magic;
- magic_len = sizeof(unified_boot_magic);
- } else {
- magic = non_unified_boot_magic;
- magic_len = sizeof(non_unified_boot_magic);
- }
-
- size = s.st_size;
- base = 0;
-
- magic[0] = 0x00000005; /* appsbl */
- magic[1] = 0x00000002; /* nand */
- magic[2] = 0x00000000;
- magic[3] = base;
- magic[4] = size;
- magic[5] = size;
- magic[6] = size + base;
- magic[7] = 0x00000000;
- magic[8] = size + base;
- magic[9] = 0x00000000;
-
- if (unified_boot == 1)
- {
- magic[10] = 0x33836685; /* cookie magic number */
- magic[11] = 0x00000001; /* cookie version */
- magic[12] = 0x00000002; /* file formats */
- magic[13] = 0x00000000;
- magic[14] = 0x00500000; /* 5M for boot.img */
- magic[15] = 0x00000000;
- magic[16] = 0x00000000;
- magic[17] = 0x00000000;
- magic[18] = 0x00000000;
- magic[19] = 0x00000000;
- }
-
- fd = open(argv[2], O_WRONLY | O_CREAT | O_TRUNC, 0644);
- if(fd < 0) {
- perror("cannot open header for writing");
- return -1;
- }
- if(write(fd, magic, magic_len) != magic_len) {
- perror("cannot write header");
- close(fd);
- unlink(argv[2]);
- return -1;
- }
- close(fd);
-
- return 0;
-}
diff --git a/target/msm7625_surf/atags.c b/target/msm7625_surf/atags.c
deleted file mode 100644
index 9029ad2..0000000
--- a/target/msm7625_surf/atags.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright (c) 2009, Code Aurora Forum. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Code Aurora nor
- * the names of its contributors may be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-unsigned* target_atag_mem(unsigned* ptr)
-{
- return ptr;
-}
diff --git a/target/msm7625_surf/include/target/display.h b/target/msm7625_surf/include/target/display.h
deleted file mode 100644
index 51e7558..0000000
--- a/target/msm7625_surf/include/target/display.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of Code Aurora Forum, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef _TARGET_MSM7625_SURF_DISPLAY_H
-#define _TARGET_MSM7625_SURF_DISPLAY_H
-
-#define TARGET_XRES 800
-#define TARGET_YRES 480
-
-#define LCDC_FB_WIDTH 800
-#define LCDC_FB_HEIGHT 480
-
-#define LCDC_HSYNC_PULSE_WIDTH_DCLK 60
-#define LCDC_HSYNC_BACK_PORCH_DCLK 81
-#define LCDC_HSYNC_FRONT_PORCH_DCLK 81
-#define LCDC_HSYNC_SKEW_DCLK 0
-
-#define LCDC_VSYNC_PULSE_WIDTH_LINES 2
-#define LCDC_VSYNC_BACK_PORCH_LINES 20
-#define LCDC_VSYNC_FRONT_PORCH_LINES 27
-
-#endif
diff --git a/target/msm7625_surf/init.c b/target/msm7625_surf/init.c
deleted file mode 100755
index 69b5a6d..0000000
--- a/target/msm7625_surf/init.c
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Copyright (c) 2009, Google Inc.
- * All rights reserved.
- * Copyright (c) 2009-2011, Code Aurora Forum. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google, Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <debug.h>
-#include <dev/keys.h>
-#include <dev/gpio_keypad.h>
-#include <lib/ptable.h>
-#include <dev/flash.h>
-#include <smem.h>
-#include <platform.h>
-
-#define LINUX_MACHTYPE 2703
-
-#define VARIABLE_LENGTH 0x10101010
-#define DIFF_START_ADDR 0xF0F0F0F0
-#define NUM_PAGES_PER_BLOCK 0x40
-
-static struct ptable flash_ptable;
-
-/* for these partitions, start will be offset by either what we get from
- * smem, or from the above offset if smem is not useful. Also, we should
- * probably have smem_ptable code populate our flash_ptable.
- *
- * When smem provides us with a full partition table, we can get rid of
- * this altogether.
- *
- */
-static struct ptentry board_part_list[] = {
- {
- .start = 0,
- .length = 5 /* In MB */,
- .name = "boot",
- },
- {
- .start = DIFF_START_ADDR,
- .length = 95 /* In MB */,
- .name = "system",
- },
- {
- .start = DIFF_START_ADDR,
- .length = 1 /* In MB */,
- .name = "cache",
- },
- {
- .start = DIFF_START_ADDR,
- .length = 1 /* In MB */,
- .name = "misc",
- },
- {
- .start = DIFF_START_ADDR,
- .length = VARIABLE_LENGTH,
- .name = "userdata",
- },
- {
- .start = DIFF_START_ADDR,
- .length = 2 /* In MB */,
- .name = "persist",
- },
- {
- .start = DIFF_START_ADDR,
- .length = 5 /* In MB */,
- .name = "recovery",
- },
-};
-static int num_parts = sizeof(board_part_list)/sizeof(struct ptentry);
-
-void smem_ptable_init(void);
-unsigned smem_get_apps_flash_start(void);
-
-void keypad_init(void);
-
-int target_is_emmc_boot(void);
-
-void target_init(void)
-{
- unsigned offset;
- struct flash_info *flash_info;
- unsigned total_num_of_blocks;
- unsigned next_ptr_start_adr = 0;
- unsigned blocks_per_1MB = 8; /* Default value of 2k page size on 256MB flash drive*/
- int i;
-
- dprintf(INFO, "target_init()\n");
-
-#if (!ENABLE_NANDWRITE)
- keys_init();
- keypad_init();
-#endif
-
- if (target_is_emmc_boot())
- return;
-
- ptable_init(&flash_ptable);
- smem_ptable_init();
-
- flash_init();
- flash_info = flash_get_info();
- ASSERT(flash_info);
-
- offset = smem_get_apps_flash_start();
- if (offset == 0xffffffff)
- while(1);
-
- total_num_of_blocks = flash_info->num_blocks;
- blocks_per_1MB = (1 << 20) / (flash_info->block_size);
-
- for (i = 0; i < num_parts; i++) {
- struct ptentry *ptn = &board_part_list[i];
- unsigned len = ((ptn->length) * blocks_per_1MB);
-
- if(ptn->start != 0)
- ASSERT(ptn->start == DIFF_START_ADDR);
-
- ptn->start = next_ptr_start_adr;
-
- if(ptn->length == VARIABLE_LENGTH)
- {
- unsigned length_for_prt = 0;
- unsigned j;
- for (j = i+1; j < num_parts; j++)
- {
- struct ptentry *temp_ptn = &board_part_list[j];
- ASSERT(temp_ptn->length != VARIABLE_LENGTH);
- length_for_prt += ((temp_ptn->length) * blocks_per_1MB);
- }
- len = (total_num_of_blocks - 1) - (offset + ptn->start + length_for_prt);
- ASSERT(len >= 0);
- }
- next_ptr_start_adr = ptn->start + len;
- ptable_add(&flash_ptable, ptn->name, offset + ptn->start,
- len, ptn->flags, TYPE_APPS_PARTITION, PERM_WRITEABLE);
- }
-
- smem_add_modem_partitions(&flash_ptable);
-
- ptable_dump(&flash_ptable);
- flash_set_ptable(&flash_ptable);
-}
-
-unsigned board_machtype(void)
-{
- return LINUX_MACHTYPE;
-}
-
-void reboot_device(unsigned reboot_reason)
-{
- reboot(reboot_reason);
-}
-
-unsigned check_reboot_mode(void)
-{
- unsigned mode[2] = {0, 0};
- unsigned int mode_len = sizeof(mode);
- unsigned smem_status;
-
- smem_status = smem_read_alloc_entry(SMEM_APPS_BOOT_MODE,
- &mode, mode_len );
- if(smem_status)
- {
- dprintf(CRITICAL, "ERROR: unable to read shared memory for reboot mode\n");
- return 0;
- }
- return mode[0];
-}
diff --git a/target/msm7625_surf/keypad.c b/target/msm7625_surf/keypad.c
deleted file mode 100644
index c44b06d..0000000
--- a/target/msm7625_surf/keypad.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2009, Google Inc.
- * All rights reserved.
- * Copyright (c) 2009, Code Aurora Forum. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google, Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <dev/keys.h>
-#include <dev/gpio_keypad.h>
-
-#define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
-
-/* don't turn this on without updating the ffa support */
-#define SCAN_FUNCTION_KEYS 0
-
-static unsigned int halibut_row_gpios[] = {
- 31, 32, 33, 34, 35, 41
-#if SCAN_FUNCTION_KEYS
- , 42
-#endif
-};
-
-static unsigned int halibut_col_gpios[] = { 36, 37, 38, 39, 40 };
-
-#define KEYMAP_INDEX(row, col) ((row)*ARRAY_SIZE(halibut_col_gpios) + (col))
-
-static const unsigned short halibut_keymap[ARRAY_SIZE(halibut_col_gpios) * ARRAY_SIZE(halibut_row_gpios)] = {
- [KEYMAP_INDEX(0, 0)] = KEY_5,
- [KEYMAP_INDEX(0, 1)] = KEY_9,
- [KEYMAP_INDEX(0, 2)] = KEY_SOFT1,
- [KEYMAP_INDEX(0, 3)] = KEY_6,
- [KEYMAP_INDEX(0, 4)] = KEY_LEFT,
-
- [KEYMAP_INDEX(1, 0)] = KEY_0,
- [KEYMAP_INDEX(1, 1)] = KEY_RIGHT,
- [KEYMAP_INDEX(1, 2)] = KEY_1,
- [KEYMAP_INDEX(1, 3)] = KEY_SHARP,
- [KEYMAP_INDEX(1, 4)] = KEY_SEND,
-
- [KEYMAP_INDEX(2, 0)] = KEY_VOLUMEUP,
- [KEYMAP_INDEX(2, 1)] = KEY_HOME, /* FA */
- [KEYMAP_INDEX(2, 2)] = KEY_F8, /* QCHT */
- [KEYMAP_INDEX(2, 3)] = KEY_F6, /* R+ */
- [KEYMAP_INDEX(2, 4)] = KEY_F7, /* R- */
-
- [KEYMAP_INDEX(3, 0)] = KEY_UP,
- [KEYMAP_INDEX(3, 1)] = KEY_CLEAR,
- [KEYMAP_INDEX(3, 2)] = KEY_4,
- [KEYMAP_INDEX(3, 3)] = KEY_MUTE, /* SPKR */
- [KEYMAP_INDEX(3, 4)] = KEY_2,
-
- [KEYMAP_INDEX(4, 0)] = KEY_SOFT2, /* SOFT2 */
- [KEYMAP_INDEX(4, 1)] = KEY_CENTER, /* KEY_CENTER */
- [KEYMAP_INDEX(4, 2)] = KEY_DOWN,
- [KEYMAP_INDEX(4, 3)] = KEY_BACK, /* FB */
- [KEYMAP_INDEX(4, 4)] = KEY_8,
-
- [KEYMAP_INDEX(5, 0)] = KEY_VOLUMEDOWN,
- [KEYMAP_INDEX(5, 1)] = KEY_STAR, /* KEY_STAR */
- [KEYMAP_INDEX(5, 2)] = KEY_MAIL, /* MESG */
- [KEYMAP_INDEX(5, 3)] = KEY_3,
- [KEYMAP_INDEX(5, 4)] = KEY_7,
-
-#if SCAN_FUNCTION_KEYS
- [KEYMAP_INDEX(6, 0)] = KEY_F5,
- [KEYMAP_INDEX(6, 1)] = KEY_F4,
- [KEYMAP_INDEX(6, 2)] = KEY_F3,
- [KEYMAP_INDEX(6, 3)] = KEY_F2,
- [KEYMAP_INDEX(6, 4)] = KEY_F1
-#endif
-};
-
-static struct gpio_keypad_info halibut_keypad_info = {
- .keymap = halibut_keymap,
- .output_gpios = halibut_row_gpios,
- .input_gpios = halibut_col_gpios,
- .noutputs = ARRAY_SIZE(halibut_row_gpios),
- .ninputs = ARRAY_SIZE(halibut_col_gpios),
- .settle_time = 5 /* msec */,
- .poll_time = 20 /* msec */,
- .flags = GPIOKPF_DRIVE_INACTIVE,
-};
-
-void keypad_init(void)
-{
- gpio_keypad_init(&halibut_keypad_info);
-}
diff --git a/target/msm7625_surf/rules.mk b/target/msm7625_surf/rules.mk
deleted file mode 100644
index 372f1f2..0000000
--- a/target/msm7625_surf/rules.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-LOCAL_DIR := $(GET_LOCAL_DIR)
-
-INCLUDES += -I$(LOCAL_DIR)/include -I$(LK_TOP_DIR)/platform/msm_shared
-
-PLATFORM := msm7k
-
-MEMBASE := 0x00000000 # SMI
-MEMSIZE := 0x00100000 # 1MB
-
-BASE_ADDR := 0x00200000
-
-TAGS_ADDR := BASE_ADDR+0x00000100
-KERNEL_ADDR := BASE_ADDR+0x00008000
-RAMDISK_ADDR := BASE_ADDR+0x01000000
-SCRATCH_ADDR := BASE_ADDR+0x02008000
-
-KEYS_USE_GPIO_KEYPAD := 1
-
-DEFINES += DISPLAY_TYPE_MDDI=0
-DEFINES += ENABLE_PLL3=1
-
-MODULES += \
- dev/keys \
- lib/ptable
-
-DEFINES += \
- SDRAM_SIZE=$(MEMSIZE) \
- MEMBASE=$(MEMBASE) \
- BASE_ADDR=$(BASE_ADDR) \
- TAGS_ADDR=$(TAGS_ADDR) \
- KERNEL_ADDR=$(KERNEL_ADDR) \
- RAMDISK_ADDR=$(RAMDISK_ADDR) \
- SCRATCH_ADDR=$(SCRATCH_ADDR)
-
-
-OBJS += \
- $(LOCAL_DIR)/init.o \
- $(LOCAL_DIR)/keypad.o \
- $(LOCAL_DIR)/atags.o
diff --git a/target/msm7625_surf/tools/makefile b/target/msm7625_surf/tools/makefile
deleted file mode 100644
index 2b36900..0000000
--- a/target/msm7625_surf/tools/makefile
+++ /dev/null
@@ -1,37 +0,0 @@
-#Makefile to generate appsboot.mbn
-
-ifeq ($(BOOTLOADER_OUT),.)
-APPSBOOTHEADER_DIR := $(BUILDDIR)
-else
-APPSBOOTHEADER_DIR := $(BOOTLOADER_OUT)/../../
-endif
-
-SRC_DIR := target/$(TARGET)/tools
-COMPILER := gcc
-
-ifeq ($(EMMC_BOOT), 1)
- APPSBOOTHDR_FILES := EMMCBOOT.MBN emmc_appsboothd.mbn
-else
- ifeq ($(BUILD_NANDWRITE), 1)
- APPSBOOTHDR_FILES :=
- else
- APPSBOOTHDR_FILES := appsboot.mbn appsboothd.mbn
- endif
-endif
-
-APPSBOOTHEADER: $(APPSBOOTHDR_FILES)
-
-appsboot.mbn: $(OUTBIN)
- cp -f $(OUTBIN) $(APPSBOOTHEADER_DIR)/appsboot.mbn
-
-appsboothd.mbn: mkheader $(OUTBIN)
- $(SRC_DIR)/mkheader $(OUTBIN) $(APPSBOOTHEADER_DIR)/appsboothd.mbn
-
-EMMCBOOT.MBN: $(OUTBIN)
- cp -f $(OUTBIN) $(APPSBOOTHEADER_DIR)/EMMCBOOT.MBN
-
-emmc_appsboothd.mbn: mkheader $(OUTBIN)
- $(SRC_DIR)/mkheader $(OUTBIN) $(APPSBOOTHEADER_DIR)/emmc_appsboothd.mbn unified-boot
-
-mkheader: $(SRC_DIR)/mkheader.c
- ${COMPILER} $(SRC_DIR)/mkheader.c -o $(SRC_DIR)/mkheader
diff --git a/target/msm7625_surf/tools/mkheader.c b/target/msm7625_surf/tools/mkheader.c
deleted file mode 100644
index 9b03907..0000000
--- a/target/msm7625_surf/tools/mkheader.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/* Copyright 2007, Google Inc. */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-#include <sys/stat.h>
-
-int main(int argc, char *argv[])
-{
- struct stat s;
- unsigned size, base;
- int unified_boot = 0;
- unsigned unified_boot_magic[20];
- unsigned non_unified_boot_magic[10];
- unsigned magic_len = 0;
- unsigned *magic;
- int fd;
-
- if(argc < 3) {
- fprintf(stderr,"usage: mkheader <bin> <hdr>\n");
- return -1;
- }
-
- if (argc == 4) {
- if(!strcmp("unified-boot",argv[3])) {
- unified_boot = 1;
- }
- }
-
- if(stat(argv[1], &s)) {
- perror("cannot stat binary");
- return -1;
- }
-
- if(unified_boot) {
- magic = unified_boot_magic;
- magic_len = sizeof(unified_boot_magic);
- } else {
- magic = non_unified_boot_magic;
- magic_len = sizeof(non_unified_boot_magic);
- }
-
- size = s.st_size;
- base = 0;
-
- magic[0] = 0x00000005; /* appsbl */
- magic[1] = 0x00000002; /* nand */
- magic[2] = 0x00000000;
- magic[3] = base;
- magic[4] = size;
- magic[5] = size;
- magic[6] = size + base;
- magic[7] = 0x00000000;
- magic[8] = size + base;
- magic[9] = 0x00000000;
-
- if (unified_boot == 1)
- {
- magic[10] = 0x33836685; /* cookie magic number */
- magic[11] = 0x00000001; /* cookie version */
- magic[12] = 0x00000002; /* file formats */
- magic[13] = 0x00000000;
- magic[14] = 0x00500000; /* 5M for boot.img */
- magic[15] = 0x00000000;
- magic[16] = 0x00000000;
- magic[17] = 0x00000000;
- magic[18] = 0x00000000;
- magic[19] = 0x00000000;
- }
-
- fd = open(argv[2], O_WRONLY | O_CREAT | O_TRUNC, 0644);
- if(fd < 0) {
- perror("cannot open header for writing");
- return -1;
- }
- if(write(fd, magic, magic_len) != magic_len) {
- perror("cannot write header");
- close(fd);
- unlink(argv[2]);
- return -1;
- }
- close(fd);
-
- return 0;
-}
diff --git a/target/msm7627_ffa/atags.c b/target/msm7627_ffa/atags.c
deleted file mode 100644
index 8c3ff6c..0000000
--- a/target/msm7627_ffa/atags.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Code Aurora nor
- * the names of its contributors may be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include <reg.h>
-#include <debug.h>
-#include <smem.h>
-
-#define SIZE_1M 0x00100000
-
-unsigned* target_atag_mem(unsigned* ptr)
-{
- struct smem_ram_ptable ram_ptable;
- unsigned i = 0;
-
- if (smem_ram_ptable_init(&ram_ptable))
- {
- for (i = 0; i < ram_ptable.len; i++)
- {
- if ((ram_ptable.parts[i].attr == READWRITE)
- && (ram_ptable.parts[i].domain == APPS_DOMAIN)
- && (ram_ptable.parts[i].start != 0x0)
- && (!(ram_ptable.parts[i].size < SIZE_1M)))
- {
- /* ATAG_MEM */
- *ptr++ = 4;
- *ptr++ = 0x54410002;
- /* FIXME: RAM partition table currently reports 2M extra
- Fix this by subracting 2M, until modem ram partition table
- starts reporting the right values */
- *ptr++ = ram_ptable.parts[i].size - (2*SIZE_1M);
- *ptr++ = ram_ptable.parts[i].start;
- }
- }
- }
- else
- {
- dprintf(CRITICAL, "ERROR: Unable to read RAM partition\n");
- ASSERT(0);
- }
- return ptr;
-}
-
diff --git a/target/msm7627_ffa/include/target/display.h b/target/msm7627_ffa/include/target/display.h
deleted file mode 100644
index af30276..0000000
--- a/target/msm7627_ffa/include/target/display.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of Code Aurora Forum, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef _TARGET_MSM7627_FFA_DISPLAY_H
-#define _TARGET_MSM7627_FFA_DISPLAY_H
-
-#define TARGET_XRES 480
-#define TARGET_YRES 640
-
-#define LCDC_FB_WIDTH 480
-#define LCDC_FB_HEIGHT 640
-
-#define LCDC_HSYNC_PULSE_WIDTH_DCLK 60
-#define LCDC_HSYNC_BACK_PORCH_DCLK 144
-#define LCDC_HSYNC_FRONT_PORCH_DCLK 33
-#define LCDC_HSYNC_SKEW_DCLK 0
-
-#define LCDC_VSYNC_PULSE_WIDTH_LINES 2
-#define LCDC_VSYNC_BACK_PORCH_LINES 2
-#define LCDC_VSYNC_FRONT_PORCH_LINES 2
-
-#endif
diff --git a/target/msm7627_ffa/init.c b/target/msm7627_ffa/init.c
deleted file mode 100644
index 36a9d2b..0000000
--- a/target/msm7627_ffa/init.c
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Copyright (c) 2009, Google Inc.
- * All rights reserved.
- * Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google, Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <debug.h>
-#include <dev/keys.h>
-#include <dev/gpio_keypad.h>
-#include <lib/ptable.h>
-#include <dev/flash.h>
-#include <smem.h>
-#include <platform.h>
-
-#define LINUX_MACHTYPE 2706
-
-#define VARIABLE_LENGTH 0x10101010
-#define DIFF_START_ADDR 0xF0F0F0F0
-#define NUM_PAGES_PER_BLOCK 0x40
-
-static struct ptable flash_ptable;
-
-/* for these partitions, start will be offset by either what we get from
- * smem, or from the above offset if smem is not useful. Also, we should
- * probably have smem_ptable code populate our flash_ptable.
- *
- * When smem provides us with a full partition table, we can get rid of
- * this altogether.
- *
- */
-static struct ptentry board_part_list[] = {
- {
- .start = 0,
- .length = 5 /* In MB */,
- .name = "boot",
- },
- {
- .start = DIFF_START_ADDR,
- .length = 105 /* In MB */,
- .name = "system",
- },
- {
- .start = DIFF_START_ADDR,
- .length = 4 /* In MB */,
- .name = "cache",
- },
- {
- .start = DIFF_START_ADDR,
- .length = 1 /* In MB */,
- .name = "misc",
- },
- {
- .start = DIFF_START_ADDR,
- .length = VARIABLE_LENGTH,
- .name = "userdata",
- },
- {
- .start = DIFF_START_ADDR,
- .length = 2 /* In MB */,
- .name = "persist",
- },
- {
- .start = DIFF_START_ADDR,
- .length = 5 /* In MB */,
- .name = "recovery",
- },
-};
-static int num_parts = sizeof(board_part_list)/sizeof(struct ptentry);
-
-void smem_ptable_init(void);
-unsigned smem_get_apps_flash_start(void);
-
-void keypad_init(void);
-
-int target_is_emmc_boot(void);
-
-void target_init(void)
-{
- unsigned offset;
- struct flash_info *flash_info;
- unsigned total_num_of_blocks;
- unsigned next_ptr_start_adr = 0;
- unsigned blocks_per_1MB = 8; /* Default value of 2k page size on 256MB flash drive*/
- int i;
-
- dprintf(INFO, "target_init()\n");
-
-#if (!ENABLE_NANDWRITE)
- keys_init();
- keypad_init();
-#endif
-
- if (target_is_emmc_boot())
- return;
-
- ptable_init(&flash_ptable);
- smem_ptable_init();
-
- flash_init();
- flash_info = flash_get_info();
- ASSERT(flash_info);
-
- offset = smem_get_apps_flash_start();
- if (offset == 0xffffffff)
- while(1);
-
- total_num_of_blocks = flash_info->num_blocks;
- blocks_per_1MB = (1 << 20) / (flash_info->block_size);
-
- for (i = 0; i < num_parts; i++) {
- struct ptentry *ptn = &board_part_list[i];
- unsigned len = ((ptn->length) * blocks_per_1MB);
-
- if(ptn->start != 0)
- ASSERT(ptn->start == DIFF_START_ADDR);
-
- ptn->start = next_ptr_start_adr;
-
- if(ptn->length == VARIABLE_LENGTH)
- {
- unsigned length_for_prt = 0;
- unsigned j;
- for (j = i+1; j < num_parts; j++)
- {
- struct ptentry *temp_ptn = &board_part_list[j];
- ASSERT(temp_ptn->length != VARIABLE_LENGTH);
- length_for_prt += ((temp_ptn->length) * blocks_per_1MB);
- }
- len = total_num_of_blocks - (offset + ptn->start + length_for_prt);
- ASSERT(len >= 0);
- }
- next_ptr_start_adr = ptn->start + len;
- ptable_add(&flash_ptable, ptn->name, offset + ptn->start,
- len, ptn->flags, TYPE_APPS_PARTITION, PERM_WRITEABLE);
- }
-
- smem_add_modem_partitions(&flash_ptable);
-
- ptable_dump(&flash_ptable);
- flash_set_ptable(&flash_ptable);
-}
-
-unsigned board_machtype(void)
-{
- return LINUX_MACHTYPE;
-}
-
-void reboot_device(unsigned reboot_reason)
-{
- reboot(reboot_reason);
-}
-
-unsigned check_reboot_mode(void)
-{
- unsigned mode[2] = {0, 0};
- unsigned int mode_len = sizeof(mode);
- unsigned smem_status;
-
- smem_status = smem_read_alloc_entry(SMEM_APPS_BOOT_MODE,
- &mode, mode_len );
- if(smem_status)
- {
- dprintf(CRITICAL, "ERROR: unable to read shared memory for reboot mode\n");
- return 0;
- }
- return mode[0];
-}
-
-static unsigned target_check_power_on_reason(void)
-{
- unsigned power_on_status = 0;
- unsigned int status_len = sizeof(power_on_status);
- unsigned smem_status;
-
- smem_status = smem_read_alloc_entry(SMEM_POWER_ON_STATUS_INFO,
- &power_on_status, status_len);
- if (smem_status)
- {
- dprintf(CRITICAL, "ERROR: unable to read shared memory for power on reason\n");
- }
-
- return power_on_status;
-}
-
-unsigned target_pause_for_battery_charge(void)
-{
- if (target_check_power_on_reason() == PWR_ON_EVENT_USB_CHG)
- return 1;
- return 0;
-}
-
-void target_battery_charging_enable(unsigned enable, unsigned disconnect)
-{
-}
diff --git a/target/msm7627_ffa/keypad.c b/target/msm7627_ffa/keypad.c
deleted file mode 100644
index 7550ed5..0000000
--- a/target/msm7627_ffa/keypad.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2009, Google Inc.
- * All rights reserved.
- * Copyright (c) 2009, Code Aurora Forum. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google, Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <dev/keys.h>
-#include <dev/gpio_keypad.h>
-
-#define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
-
-/* don't turn this on without updating the ffa support */
-#define SCAN_FUNCTION_KEYS 0
-
-static unsigned int halibut_row_gpios[] = {
- 31, 32, 33, 34, 35, 41
-#if SCAN_FUNCTION_KEYS
- , 42
-#endif
-};
-
-static unsigned int halibut_col_gpios[] = { 36, 37, 38, 39, 40 };
-
-#define KEYMAP_INDEX(row, col) ((row)*ARRAY_SIZE(halibut_col_gpios) + (col))
-
-static const unsigned short halibut_keymap[ARRAY_SIZE(halibut_col_gpios) * ARRAY_SIZE(halibut_row_gpios)] = {
- //[KEYMAP_INDEX(0, 0)] = KEY_5,
- //[KEYMAP_INDEX(0, 1)] = KEY_9,
- [KEYMAP_INDEX(0, 2)] = KEY_1,
- [KEYMAP_INDEX(0, 3)] = KEY_SEND,
- [KEYMAP_INDEX(0, 4)] = KEY_LEFT,
-
- [KEYMAP_INDEX(1, 0)] = KEY_3,
- [KEYMAP_INDEX(1, 1)] = KEY_RIGHT,
- [KEYMAP_INDEX(1, 2)] = KEY_VOLUMEUP,
- //[KEYMAP_INDEX(1, 3)] = KEY_SHARP,
- [KEYMAP_INDEX(1, 4)] = KEY_6,
-
- [KEYMAP_INDEX(2, 0)] = KEY_HOME, /* A */
- [KEYMAP_INDEX(2, 1)] = KEY_BACK, /* B */
- [KEYMAP_INDEX(2, 2)] = KEY_0,
- [KEYMAP_INDEX(2, 3)] = KEY_SHARP,
- [KEYMAP_INDEX(2, 4)] = KEY_9,
-
- [KEYMAP_INDEX(3, 0)] = KEY_UP,
- [KEYMAP_INDEX(3, 1)] = KEY_CENTER,
- [KEYMAP_INDEX(3, 2)] = KEY_4,
- //[KEYMAP_INDEX(3, 3)] = KEY_MUTE, /* SPKR */
- [KEYMAP_INDEX(3, 4)] = KEY_2,
-
- [KEYMAP_INDEX(4, 0)] = KEY_VOLUMEDOWN,
- [KEYMAP_INDEX(4, 1)] = KEY_SOUND,
- [KEYMAP_INDEX(4, 2)] = KEY_DOWN,
- [KEYMAP_INDEX(4, 3)] = KEY_8,
- [KEYMAP_INDEX(4, 4)] = KEY_5,
-
- //[KEYMAP_INDEX(5, 0)] = KEY_VOLUMEDOWN,
- [KEYMAP_INDEX(5, 1)] = KEY_STAR,
- [KEYMAP_INDEX(5, 2)] = KEY_SOFT2,
- [KEYMAP_INDEX(5, 3)] = KEY_MENU,
- [KEYMAP_INDEX(5, 4)] = KEY_7,
-
-#if SCAN_FUNCTION_KEYS
- [KEYMAP_INDEX(6, 0)] = KEY_F5,
- [KEYMAP_INDEX(6, 1)] = KEY_F4,
- [KEYMAP_INDEX(6, 2)] = KEY_F3,
- [KEYMAP_INDEX(6, 3)] = KEY_F2,
- [KEYMAP_INDEX(6, 4)] = KEY_F1
-#endif
-};
-
-static struct gpio_keypad_info halibut_keypad_info = {
- .keymap = halibut_keymap,
- .output_gpios = halibut_row_gpios,
- .input_gpios = halibut_col_gpios,
- .noutputs = ARRAY_SIZE(halibut_row_gpios),
- .ninputs = ARRAY_SIZE(halibut_col_gpios),
- .settle_time = 5 /* msec */,
- .poll_time = 20 /* msec */,
- .flags = GPIOKPF_DRIVE_INACTIVE,
-};
-
-void keypad_init(void)
-{
- gpio_keypad_init(&halibut_keypad_info);
-}
diff --git a/target/msm7627_ffa/rules.mk b/target/msm7627_ffa/rules.mk
deleted file mode 100755
index 92299f9..0000000
--- a/target/msm7627_ffa/rules.mk
+++ /dev/null
@@ -1,41 +0,0 @@
-LOCAL_DIR := $(GET_LOCAL_DIR)
-
-INCLUDES += -I$(LOCAL_DIR)/include -I$(LK_TOP_DIR)/platform/msm_shared
-
-PLATFORM := msm7k
-
-MEMBASE := 0x00000000 # SMI
-MEMSIZE := 0x00100000 # 1MB
-
-BASE_ADDR := 0x00200000
-
-TAGS_ADDR := BASE_ADDR+0x00000100
-KERNEL_ADDR := BASE_ADDR+0x00008000
-RAMDISK_ADDR := BASE_ADDR+0x01000000
-SCRATCH_ADDR := BASE_ADDR+0x04000000
-
-KEYS_USE_GPIO_KEYPAD := 1
-
-DEFINES += DISPLAY_TYPE_MDDI=0
-DEFINES += DISPLAY_TYPE_LCDC=1
-
-DEFINES += DISPLAY_SPLASH_SCREEN=1
-
-MODULES += \
- dev/keys \
- lib/ptable
-
-DEFINES += \
- SDRAM_SIZE=$(MEMSIZE) \
- MEMBASE=$(MEMBASE) \
- BASE_ADDR=$(BASE_ADDR) \
- TAGS_ADDR=$(TAGS_ADDR) \
- KERNEL_ADDR=$(KERNEL_ADDR) \
- RAMDISK_ADDR=$(RAMDISK_ADDR) \
- SCRATCH_ADDR=$(SCRATCH_ADDR)
-
-
-OBJS += \
- $(LOCAL_DIR)/init.o \
- $(LOCAL_DIR)/keypad.o \
- $(LOCAL_DIR)/atags.o
diff --git a/target/msm7627_ffa/tools/makefile b/target/msm7627_ffa/tools/makefile
deleted file mode 100644
index f01f7ad..0000000
--- a/target/msm7627_ffa/tools/makefile
+++ /dev/null
@@ -1,39 +0,0 @@
-#Makefile to generate appsboot.mbn
-
-ifeq ($(BOOTLOADER_OUT),.)
-APPSBOOTHEADER_DIR := $(BUILDDIR)
-else
-APPSBOOTHEADER_DIR := $(BOOTLOADER_OUT)/../../
-endif
-
-SRC_DIR := target/$(TARGET)/tools
-COMPILER := gcc
-
-ifeq ($(EMMC_BOOT), 1)
- APPSBOOTHDR_FILES := EMMCBOOT.MBN emmc_appsboothd.mbn
-else
- ifeq ($(BUILD_NANDWRITE), 1)
- APPSBOOTHDR_FILES :=
- else
- APPSBOOTHDR_FILES := appsboot.mbn appsboothd.mbn
- endif
-endif
-
-APPSBOOTHEADER: $(APPSBOOTHDR_FILES)
-
-appsboot.mbn: $(OUTBIN)
- cp -f $(OUTBIN) $(APPSBOOTHEADER_DIR)/appsboot.mbn
-
-appsboothd.mbn: mkheader $(OUTBIN)
- $(SRC_DIR)/mkheader $(OUTBIN) $(APPSBOOTHEADER_DIR)/appsboothd.mbn
-
-EMMCBOOT.MBN: $(OUTBIN)
- cp -f $(OUTBIN) $(APPSBOOTHEADER_DIR)/EMMCBOOT.MBN
- cp -f $(OUTBIN) $(APPSBOOTHEADER_DIR)/emmc_appsboot.mbn
-
-emmc_appsboothd.mbn: mkheader $(OUTBIN)
- $(SRC_DIR)/mkheader $(OUTBIN) $(APPSBOOTHEADER_DIR)/emmc_appsboothd.mbn unified-boot
-
-mkheader: $(SRC_DIR)/mkheader.c
- ${COMPILER} $(SRC_DIR)/mkheader.c -o $(SRC_DIR)/mkheader
-
diff --git a/target/msm7627_ffa/tools/mkheader.c b/target/msm7627_ffa/tools/mkheader.c
deleted file mode 100644
index 2bd3479..0000000
--- a/target/msm7627_ffa/tools/mkheader.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/* Copyright 2007, Google Inc. */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-#include <sys/stat.h>
-
-int main(int argc, char *argv[])
-{
- struct stat s;
- unsigned size, base;
- int unified_boot = 0;
- unsigned unified_boot_magic[20];
- unsigned non_unified_boot_magic[10];
- unsigned magic_len = 0;
- unsigned *magic;
- int fd;
-
- if(argc < 3) {
- fprintf(stderr,"usage: mkheader <bin> <hdr>\n");
- return -1;
- }
-
- if (argc == 4) {
- if(!strcmp("unified-boot",argv[3])) {
- unified_boot = 1;
- }
- }
-
- if(stat(argv[1], &s)) {
- perror("cannot stat binary");
- return -1;
- }
-
- if(unified_boot) {
- magic = unified_boot_magic;
- magic_len = sizeof(unified_boot_magic);
- } else {
- magic = non_unified_boot_magic;
- magic_len = sizeof(non_unified_boot_magic);
- }
-
- size = s.st_size;
- base = 0;
-
- magic[0] = 0x00000005; /* appsbl */
- magic[1] = 0x00000002; /* nand */
- magic[2] = 0x00000000;
- magic[3] = base;
- magic[4] = size;
- magic[5] = size;
- magic[6] = size + base;
- magic[7] = 0x00000000;
- magic[8] = size + base;
- magic[9] = 0x00000000;
-
- if (unified_boot == 1)
- {
- magic[10] = 0x33836685; /* cookie magic number */
- magic[11] = 0x00000001; /* cookie version */
- magic[12] = 0x00000002; /* file formats */
- magic[13] = 0x00000000;
- magic[14] = 0x00000000; /* not setting size for boot.img */
- magic[15] = 0x00000000;
- magic[16] = 0x00000000;
- magic[17] = 0x00000000;
- magic[18] = 0x00000000;
- magic[19] = 0x00000000;
- }
-
- fd = open(argv[2], O_WRONLY | O_CREAT | O_TRUNC, 0644);
- if(fd < 0) {
- perror("cannot open header for writing");
- return -1;
- }
- if(write(fd, magic, magic_len) != magic_len) {
- perror("cannot write header");
- close(fd);
- unlink(argv[2]);
- return -1;
- }
- close(fd);
-
- return 0;
-}
diff --git a/target/msm7627_surf/init.c b/target/msm7627_surf/init.c
index 4b7f1ef..0a2f3ad 100644
--- a/target/msm7627_surf/init.c
+++ b/target/msm7627_surf/init.c
@@ -30,6 +30,7 @@
* SUCH DAMAGE.
*/
+#include <reg.h>
#include <debug.h>
#include <dev/keys.h>
#include <dev/gpio_keypad.h>
@@ -120,6 +121,13 @@
dprintf(INFO, "target_init()\n");
+ /* Display splash screen if enabled */
+#if DISPLAY_SPLASH_SCREEN
+ display_init();
+ dprintf(SPEW, "Diplay initialized\n");
+ display_image_on_screen();
+#endif
+
#if (!ENABLE_NANDWRITE)
keys_init();
keypad_init();
@@ -127,6 +135,10 @@
if (target_is_emmc_boot())
{
+ /* Must wait for modem-up before we can intialize MMC.
+ */
+ while (readl(MSM_SHARED_BASE + 0x14) != 1);
+
/* Trying SDC3 first */
slot = 3;
base_addr = mmc_sdc_base[slot - 1];
@@ -261,6 +273,7 @@
smem_status = smem_read_alloc_entry(SMEM_POWER_ON_STATUS_INFO,
&power_on_status, status_len);
+
if (smem_status)
{
dprintf(CRITICAL, "ERROR: unable to read shared memory for power on reason\n");
@@ -269,17 +282,6 @@
return power_on_status;
}
-unsigned target_pause_for_battery_charge(void)
-{
- if (target_check_power_on_reason() == PWR_ON_EVENT_USB_CHG)
- return 1;
- return 0;
-}
-
-void target_battery_charging_enable(unsigned enable, unsigned disconnect)
-{
-}
-
#if _EMMC_BOOT
void target_serialno(unsigned char *buf)
{
diff --git a/target/msm7627a/init.c b/target/msm7627a/init.c
index dcd732a..35efcf7 100644
--- a/target/msm7627a/init.c
+++ b/target/msm7627a/init.c
@@ -30,6 +30,7 @@
* SUCH DAMAGE.
*/
+#include <reg.h>
#include <debug.h>
#include <dev/keys.h>
#include <dev/gpio_keypad.h>
@@ -61,7 +62,7 @@
* this altogether.
*
*/
-static struct ptentry board_part_list[] = {
+static struct ptentry board_part_list_default[] = {
{
.start = 0,
.length = 10 /* In MB */,
@@ -98,8 +99,49 @@
.name = "recovery",
},
};
-static int num_parts = sizeof(board_part_list)/sizeof(struct ptentry);
+static int num_parts = sizeof(board_part_list_default)/sizeof(struct ptentry);
+/*
+ * Define partition table for Bch ecc NAND and increase the cache partition size
+ * to 8MB
+ */
+static struct ptentry board_part_list_bchecc[] = {
+ {
+ .start = 0,
+ .length = 10 /* In MB */,
+ .name = "boot",
+ },
+ {
+ .start = DIFF_START_ADDR,
+ .length = 120 /* In MB */,
+ .name = "system",
+ },
+ {
+ .start = DIFF_START_ADDR,
+ .length = 8 /* In MB */,
+ .name = "cache",
+ },
+ {
+ .start = DIFF_START_ADDR,
+ .length = 4 /* In MB */,
+ .name = "misc",
+ },
+ {
+ .start = DIFF_START_ADDR,
+ .length = VARIABLE_LENGTH,
+ .name = "userdata",
+ },
+ {
+ .start = DIFF_START_ADDR,
+ .length = 4 /* In MB */,
+ .name = "persist",
+ },
+ {
+ .start = DIFF_START_ADDR,
+ .length = 10 /* In MB */,
+ .name = "recovery",
+ },
+};
void smem_ptable_init(void);
unsigned smem_get_apps_flash_start(void);
@@ -111,6 +153,7 @@
{
unsigned offset;
struct flash_info *flash_info;
+ struct ptentry *board_part_list;
unsigned total_num_of_blocks;
unsigned next_ptr_start_adr = 0;
unsigned blocks_per_1MB = 8; /* Default value of 2k page size on 256MB flash drive*/
@@ -123,8 +166,19 @@
keypad_init();
#endif
+ /* Display splash screen if enabled */
+#if DISPLAY_SPLASH_SCREEN
+ display_init();
+ dprintf(SPEW, "Diplay initialized\n");
+ display_image_on_screen();
+#endif
+
if (target_is_emmc_boot())
{
+ /* Must wait for modem-up before we can intialize MMC.
+ */
+ while (readl(MSM_SHARED_BASE + 0x14) != 1);
+
if(mmc_boot_main(MMC_SLOT, MSM_SDC3_BASE))
{
dprintf(CRITICAL, "mmc init failed!");
@@ -147,6 +201,11 @@
total_num_of_blocks = flash_info->num_blocks;
blocks_per_1MB = (1 << 20) / (flash_info->block_size);
+ if (flash_ecc_bch_enabled())
+ board_part_list = board_part_list_bchecc;
+ else
+ board_part_list = board_part_list_default;
+
for (i = 0; i < num_parts; i++) {
struct ptentry *ptn = &board_part_list[i];
unsigned len = ((ptn->length) * blocks_per_1MB);
diff --git a/target/msm7630_1x/atags.c b/target/msm7630_1x/atags.c
deleted file mode 100644
index e24dafd..0000000
--- a/target/msm7630_1x/atags.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/* Copyright (c) 2009, Code Aurora Forum. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Code Aurora nor
- * the names of its contributors may be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include <reg.h>
-#include <debug.h>
-#include <smem.h>
-
-#define EBI1_ADDR_128M 0x08000000
-#define SIZE_256M 0x10000000
-#define SIZE_128M 0x08000000
-#define SIZE_1M 0x00100000
-
-static int scratch_addr = -1;
-int smem_ram_ptable_init(struct smem_ram_ptable *);
-
-unsigned* target_atag_mem(unsigned* ptr)
-{
- struct smem_ram_ptable ram_ptable;
- unsigned i = 0;
-
- if (smem_ram_ptable_init(&ram_ptable))
- {
- for (i = 0; i < ram_ptable.len; i++)
- {
- if ((ram_ptable.parts[i].attr == READWRITE)
- && (ram_ptable.parts[i].domain == APPS_DOMAIN)
- && (ram_ptable.parts[i].start != 0x0)
- && (!(ram_ptable.parts[i].size < SIZE_1M)))
- {
- /* ATAG_MEM */
- *ptr++ = 4;
- // Tag EBI-1 memory as unstable.
- if(ram_ptable.parts[i].category == EBI1_CS0) {
- // if EBI-1 CS-0 is 256Mb then this is a 2x256 target and
- // the kernel can reserve this mem region as unstable.
- // This memory region can be activated when the kernel
- // receives a request from Android init scripts.
- if(ram_ptable.parts[i].size == SIZE_256M)
- *ptr++ = 0x5441000A; //Deep-Power-Down Tag.
-
- //if EBI-1 CS-0 s 128Mb then this is a 2x128 target.
- //Android + Kernel + PMEM regions account for more than
- //128Mb and the target will not be able to boot with just
- //one memory bank active and the second memory bank is reserved.
- //In the case of 2x128 the tag is set to SelfRefresh Only.
- else if(ram_ptable.parts[i].size == SIZE_128M)
- *ptr++ = 0x5441000B; //Self-Refresh Tag.
- }
- else
- *ptr++ = 0x54410002;
-
- *ptr++ = ram_ptable.parts[i].size;
- *ptr++ = ram_ptable.parts[i].start;
- }
- }
- }
- else
- {
- dprintf(CRITICAL, "ERROR: Unable to read RAM partition\n");
- ASSERT(0);
- }
-
- return ptr;
-}
-
-void *target_get_scratch_address(void)
-{
- struct smem_ram_ptable ram_ptable;
- unsigned i = 0;
-
- if (smem_ram_ptable_init(&ram_ptable))
- {
- for (i = 0; i < ram_ptable.len; i++)
- {
- if ((ram_ptable.parts[i].attr == READWRITE)
- && (ram_ptable.parts[i].domain == APPS_DOMAIN)
- && (ram_ptable.parts[i].start != 0x0))
- {
- if (ram_ptable.parts[i].size >= FASTBOOT_BUF_SIZE)
- {
- scratch_addr = ram_ptable.parts[i].start;
- break;
- }
- }
- }
- }
- else
- {
- dprintf(CRITICAL, "ERROR: Unable to read RAM partition\n");
- ASSERT(0);
- }
-
- return (void *)((scratch_addr == -1) ? EBI1_ADDR_128M : scratch_addr);
-}
diff --git a/target/msm7630_1x/include/target/display.h b/target/msm7630_1x/include/target/display.h
deleted file mode 100644
index 69cd4ac..0000000
--- a/target/msm7630_1x/include/target/display.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of Code Aurora Forum, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef _TARGET_MSM7630_SURF_DISPLAY_H
-#define _TARGET_MSM7630_SURF_DISPLAY_H
-
-#define TARGET_XRES 480
-#define TARGET_YRES 800
-
-#define LCDC_FB_WIDTH 480
-#define LCDC_FB_HEIGHT 800
-
-#define LCDC_HSYNC_PULSE_WIDTH_DCLK 8
-#define LCDC_HSYNC_BACK_PORCH_DCLK 184
-#define LCDC_HSYNC_FRONT_PORCH_DCLK 4
-#define LCDC_HSYNC_SKEW_DCLK 0
-
-#define LCDC_VSYNC_PULSE_WIDTH_LINES 1
-#define LCDC_VSYNC_BACK_PORCH_LINES 2
-#define LCDC_VSYNC_FRONT_PORCH_LINES 3
-
-#endif
diff --git a/target/msm7630_1x/init.c b/target/msm7630_1x/init.c
deleted file mode 100644
index fe98772..0000000
--- a/target/msm7630_1x/init.c
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * Copyright (c) 2009, Google Inc.
- * All rights reserved.
- * Copyright (c) 2009-2011, Code Aurora Forum. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google, Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <debug.h>
-#include <dev/keys.h>
-#include <dev/gpio_keypad.h>
-#include <lib/ptable.h>
-#include <dev/flash.h>
-#include <smem.h>
-#include <platform/machtype.h>
-#include <platform.h>
-
-#define MSM8255_ID 74
-#define MSM8655_ID 75
-#define APQ8055_ID 85
-
-#define VARIABLE_LENGTH 0x10101010
-#define DIFF_START_ADDR 0xF0F0F0F0
-#define NUM_PAGES_PER_BLOCK 0x40
-
-static struct ptable flash_ptable;
-static int hw_platform_type = -1;
-
-/* for these partitions, start will be offset by either what we get from
- * smem, or from the above offset if smem is not useful. Also, we should
- * probably have smem_ptable code populate our flash_ptable.
- *
- * When smem provides us with a full partition table, we can get rid of
- * this altogether.
- *
- */
-static struct ptentry board_part_list[] = {
- {
- .start = 0,
- .length = 20 /* 5MB */,
- .name = "boot",
- },
- {
- .start = 20,
- .length = 480 /* 120MB */,
- .name = "system",
- },
- {
- .start = 500,
- .length = 120 /* 30MB */,
- .name = "cache",
- },
- {
- .start = 620,
- .length = 4, /* 1MB */
- .name = "misc",
- },
- {
- .start = 624,
- .length = VARIABLE_LENGTH,
- .name = "userdata",
- },
- {
- .start = DIFF_START_ADDR,
- .length = 12 /* 3MB */,
- .name = "persist",
- },
- {
- .start = DIFF_START_ADDR,
- .length = 20 /* 5MB */,
- .name = "recovery",
- },
-};
-static int num_parts = sizeof(board_part_list)/sizeof(struct ptentry);
-
-void smem_ptable_init(void);
-unsigned smem_get_apps_flash_start(void);
-
-void keypad_init(void);
-
-static int emmc_boot = -1; /* set to uninitialized */
-int target_is_emmc_boot(void);
-static int platform_version = -1;
-static int target_msm_id = -1;
-
-void target_init(void)
-{
- unsigned offset;
- struct flash_info *flash_info;
- unsigned total_num_of_blocks;
- bool start_addr_changed = false;
- unsigned next_ptr_start_adr = 0;
- int i;
-
- dprintf(INFO, "target_init()\n");
-
-#if (!ENABLE_NANDWRITE)
- keys_init();
- keypad_init();
-#endif
-
- if (target_is_emmc_boot())
- return;
-
- ptable_init(&flash_ptable);
- smem_ptable_init();
-
- flash_init();
- flash_info = flash_get_info();
- ASSERT(flash_info);
-
- offset = smem_get_apps_flash_start();
- if (offset == 0xffffffff)
- while(1);
-
- total_num_of_blocks = flash_info->num_blocks;
-
- for (i = 0; i < num_parts; i++) {
- struct ptentry *ptn = &board_part_list[i];
- unsigned len = ptn->length;
-
- if(len == VARIABLE_LENGTH)
- {
- start_addr_changed = true;
- unsigned length_for_prt = 0;
- unsigned j;
- for (j = i+1; j < num_parts; j++)
- {
- struct ptentry *temp_ptn = &board_part_list[j];
- ASSERT(temp_ptn->length != VARIABLE_LENGTH);
- length_for_prt += temp_ptn->length;
- }
- len = (total_num_of_blocks - 1) - (offset + ptn->start + length_for_prt);
- ASSERT(len >= 0);
- next_ptr_start_adr = ptn->start + len;
- }
- if((ptn->start == DIFF_START_ADDR) && (start_addr_changed))
- {
- ASSERT(next_ptr_start_adr);
- ptn->start = next_ptr_start_adr;
- next_ptr_start_adr = ptn->start + ptn->length;
- }
- ptable_add(&flash_ptable, ptn->name, offset + ptn->start,
- len, ptn->flags, TYPE_APPS_PARTITION, PERM_WRITEABLE);
- }
-
- smem_add_modem_partitions(&flash_ptable);
-
- ptable_dump(&flash_ptable);
- flash_set_ptable(&flash_ptable);
-}
-
-int target_platform_version(void)
-{
- return platform_version;
-}
-
-int target_is_msm8x55(void)
-{
- if ((target_msm_id == MSM8255_ID) ||
- (target_msm_id == MSM8655_ID) ||
- (target_msm_id == APQ8055_ID))
- return 1;
- else
- return 0;
-}
-
-unsigned board_machtype(void)
-{
- struct smem_board_info_v4 board_info_v4;
- unsigned int board_info_len = 0;
- enum platform platform_type = 0;
- unsigned smem_status;
- unsigned format = 0;
- if(hw_platform_type != -1)
- return hw_platform_type;
-
- smem_status = smem_read_alloc_entry_offset(SMEM_BOARD_INFO_LOCATION,
- &format, sizeof(format), 0);
- if(!smem_status)
- {
- if ((format == 3) || (format == 4))
- {
- if (format == 4)
- board_info_len = sizeof(board_info_v4);
- else
- board_info_len = sizeof(board_info_v4.board_info_v3);
-
- smem_status = smem_read_alloc_entry(SMEM_BOARD_INFO_LOCATION,
- &board_info_v4, board_info_len);
- if(!smem_status)
- {
- if(format == 4)
- platform_version = board_info_v4.platform_version;
-
- platform_type = board_info_v4.board_info_v3.hw_platform;
- target_msm_id = board_info_v4.board_info_v3.msm_id;
- switch (platform_type)
- {
- case HW_PLATFORM_SURF:
- hw_platform_type = ((target_is_msm8x55()) ?
- LINUX_MACHTYPE_8x55_SURF : LINUX_MACHTYPE_7x30_SURF); break;
- case HW_PLATFORM_FFA:
- hw_platform_type = ((target_is_msm8x55()) ?
- LINUX_MACHTYPE_8x55_FFA : LINUX_MACHTYPE_7x30_FFA); break;
- case HW_PLATFORM_FLUID:
- hw_platform_type = LINUX_MACHTYPE_7x30_FLUID; break;
- default:
- hw_platform_type = ((target_is_msm8x55()) ?
- LINUX_MACHTYPE_8x55_SURF : LINUX_MACHTYPE_7x30_SURF); break;
- }
- return hw_platform_type;
- }
- }
- }
- hw_platform_type = LINUX_MACHTYPE_7x30_SURF;
- return hw_platform_type;
-}
-
-void reboot_device(unsigned reboot_reason)
-{
- reboot(reboot_reason);
-}
-
-unsigned check_reboot_mode(void)
-{
- unsigned mode[2] = {0, 0};
- unsigned int mode_len = sizeof(mode);
- unsigned smem_status;
-
- smem_status = smem_read_alloc_entry(SMEM_APPS_BOOT_MODE,
- &mode, mode_len );
- if(smem_status)
- {
- dprintf(CRITICAL, "ERROR: unable to read shared memory for reboot mode\n");
- return 0;
- }
- return mode[0];
-}
-
-void target_battery_charging_enable(unsigned enable, unsigned disconnect)
-{
-}
diff --git a/target/msm7630_1x/keypad.c b/target/msm7630_1x/keypad.c
deleted file mode 100644
index 46c51c8..0000000
--- a/target/msm7630_1x/keypad.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2009, Google Inc.
- * All rights reserved.
- * Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google, Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <dev/keys.h>
-#include <dev/gpio_keypad.h>
-
-#define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
-#define BITS_IN_ELEMENT(x) (sizeof(x)[0] * 8)
-
-static unsigned char qwerty_keys_old[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-static unsigned char qwerty_keys_new[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-
-#define KEYMAP_INDEX(row, col) (row)* BITS_IN_ELEMENT(qwerty_keys_new) + (col)
-
-static unsigned int qwerty_keymap[] = {
- [KEYMAP_INDEX(4, 2)] = KEY_BACK, /* -L on SURF & FFA */
- [KEYMAP_INDEX(3, 4)] = KEY_HOME, /* +R on SURF & FFA */
- [KEYMAP_INDEX(1, 3)] = KEY_VOLUMEUP, /* '+' of left side switch on FLUID */
- [KEYMAP_INDEX(1, 4)] = KEY_VOLUMEDOWN, /* '-' of left side switch on FLUID */
-};
-
-static struct qwerty_keypad_info qwerty_keypad = {
- .keymap = qwerty_keymap,
- .old_keys = qwerty_keys_old,
- .rec_keys = qwerty_keys_new,
- .rows = 5,
- .columns = 5,
- .num_of_reads = 6,
- .rd_func = &i2c_ssbi_read_bytes,
- .wr_func = &i2c_ssbi_write_bytes,
- .settle_time = 5 /* msec */,
- .poll_time = 20 /* msec */,
-};
-
-void keypad_init(void)
-{
- ssbi_keypad_init(&qwerty_keypad);
-}
diff --git a/target/msm7630_1x/panel.c b/target/msm7630_1x/panel.c
deleted file mode 100644
index c2b56a1..0000000
--- a/target/msm7630_1x/panel.c
+++ /dev/null
@@ -1,471 +0,0 @@
-/* Copyright 2007, Google Inc. */
-
-#include <debug.h>
-#include <dev/gpio.h>
-#include <kernel/thread.h>
-#include <platform/mddi.h>
-
-#define MDDI_CLIENT_CORE_BASE 0x108000
-#define LCD_CONTROL_BLOCK_BASE 0x110000
-#define SPI_BLOCK_BASE 0x120000
-#define I2C_BLOCK_BASE 0x130000
-#define PWM_BLOCK_BASE 0x140000
-#define GPIO_BLOCK_BASE 0x150000
-#define SYSTEM_BLOCK1_BASE 0x160000
-#define SYSTEM_BLOCK2_BASE 0x170000
-
-
-#define MDDICAP0 (MDDI_CLIENT_CORE_BASE|0x00)
-#define MDDICAP1 (MDDI_CLIENT_CORE_BASE|0x04)
-#define MDDICAP2 (MDDI_CLIENT_CORE_BASE|0x08)
-#define MDDICAP3 (MDDI_CLIENT_CORE_BASE|0x0C)
-#define MDCAPCHG (MDDI_CLIENT_CORE_BASE|0x10)
-#define MDCRCERC (MDDI_CLIENT_CORE_BASE|0x14)
-#define TTBUSSEL (MDDI_CLIENT_CORE_BASE|0x18)
-#define DPSET0 (MDDI_CLIENT_CORE_BASE|0x1C)
-#define DPSET1 (MDDI_CLIENT_CORE_BASE|0x20)
-#define DPSUS (MDDI_CLIENT_CORE_BASE|0x24)
-#define DPRUN (MDDI_CLIENT_CORE_BASE|0x28)
-#define SYSCKENA (MDDI_CLIENT_CORE_BASE|0x2C)
-#define TESTMODE (MDDI_CLIENT_CORE_BASE|0x30)
-#define FIFOMONI (MDDI_CLIENT_CORE_BASE|0x34)
-#define INTMONI (MDDI_CLIENT_CORE_BASE|0x38)
-#define MDIOBIST (MDDI_CLIENT_CORE_BASE|0x3C)
-#define MDIOPSET (MDDI_CLIENT_CORE_BASE|0x40)
-#define BITMAP0 (MDDI_CLIENT_CORE_BASE|0x44)
-#define BITMAP1 (MDDI_CLIENT_CORE_BASE|0x48)
-#define BITMAP2 (MDDI_CLIENT_CORE_BASE|0x4C)
-#define BITMAP3 (MDDI_CLIENT_CORE_BASE|0x50)
-#define BITMAP4 (MDDI_CLIENT_CORE_BASE|0x54)
-
-
-#define SRST (LCD_CONTROL_BLOCK_BASE|0x00)
-#define PORT_ENB (LCD_CONTROL_BLOCK_BASE|0x04)
-#define START (LCD_CONTROL_BLOCK_BASE|0x08)
-#define PORT (LCD_CONTROL_BLOCK_BASE|0x0C)
-#define CMN (LCD_CONTROL_BLOCK_BASE|0x10)
-#define GAMMA (LCD_CONTROL_BLOCK_BASE|0x14)
-#define INTFLG (LCD_CONTROL_BLOCK_BASE|0x18)
-#define INTMSK (LCD_CONTROL_BLOCK_BASE|0x1C)
-#define MPLFBUF (LCD_CONTROL_BLOCK_BASE|0x20)
-#define HDE_LEFT (LCD_CONTROL_BLOCK_BASE|0x24)
-#define VDE_TOP (LCD_CONTROL_BLOCK_BASE|0x28)
-
-#define PXL (LCD_CONTROL_BLOCK_BASE|0x30)
-#define HCYCLE (LCD_CONTROL_BLOCK_BASE|0x34)
-#define HSW (LCD_CONTROL_BLOCK_BASE|0x38)
-#define HDE_START (LCD_CONTROL_BLOCK_BASE|0x3C)
-#define HDE_SIZE (LCD_CONTROL_BLOCK_BASE|0x40)
-#define VCYCLE (LCD_CONTROL_BLOCK_BASE|0x44)
-#define VSW (LCD_CONTROL_BLOCK_BASE|0x48)
-#define VDE_START (LCD_CONTROL_BLOCK_BASE|0x4C)
-#define VDE_SIZE (LCD_CONTROL_BLOCK_BASE|0x50)
-#define WAKEUP (LCD_CONTROL_BLOCK_BASE|0x54)
-#define WSYN_DLY (LCD_CONTROL_BLOCK_BASE|0x58)
-#define REGENB (LCD_CONTROL_BLOCK_BASE|0x5C)
-#define VSYNIF (LCD_CONTROL_BLOCK_BASE|0x60)
-#define WRSTB (LCD_CONTROL_BLOCK_BASE|0x64)
-#define RDSTB (LCD_CONTROL_BLOCK_BASE|0x68)
-#define ASY_DATA (LCD_CONTROL_BLOCK_BASE|0x6C)
-#define ASY_DATB (LCD_CONTROL_BLOCK_BASE|0x70)
-#define ASY_DATC (LCD_CONTROL_BLOCK_BASE|0x74)
-#define ASY_DATD (LCD_CONTROL_BLOCK_BASE|0x78)
-#define ASY_DATE (LCD_CONTROL_BLOCK_BASE|0x7C)
-#define ASY_DATF (LCD_CONTROL_BLOCK_BASE|0x80)
-#define ASY_DATG (LCD_CONTROL_BLOCK_BASE|0x84)
-#define ASY_DATH (LCD_CONTROL_BLOCK_BASE|0x88)
-#define ASY_CMDSET (LCD_CONTROL_BLOCK_BASE|0x8C)
-
-#define MONI (LCD_CONTROL_BLOCK_BASE|0xB0)
-
-#define Current (LCD_CONTROL_BLOCK_BASE|0xC0)
-#define LCD (LCD_CONTROL_BLOCK_BASE|0xC4)
-#define COMMAND (LCD_CONTROL_BLOCK_BASE|0xC8)
-
-
-#define SSICTL (SPI_BLOCK_BASE|0x00)
-#define SSITIME (SPI_BLOCK_BASE|0x04)
-#define SSITX (SPI_BLOCK_BASE|0x08)
-#define SSIRX (SPI_BLOCK_BASE|0x0C)
-#define SSIINTC (SPI_BLOCK_BASE|0x10)
-#define SSIINTS (SPI_BLOCK_BASE|0x14)
-#define SSIDBG1 (SPI_BLOCK_BASE|0x18)
-#define SSIDBG2 (SPI_BLOCK_BASE|0x1C)
-#define SSIID (SPI_BLOCK_BASE|0x20)
-
-
-#define I2CSETUP (I2C_BLOCK_BASE|0x00)
-#define I2CCTRL (I2C_BLOCK_BASE|0x04)
-
-
-#define TIMER0LOAD (PWM_BLOCK_BASE|0x00)
-#define TIMER0VALUE (PWM_BLOCK_BASE|0x04)
-#define TIMER0CONTROL (PWM_BLOCK_BASE|0x08)
-#define TIMER0INTCLR (PWM_BLOCK_BASE|0x0C)
-#define TIMER0RIS (PWM_BLOCK_BASE|0x10)
-#define TIMER0MIS (PWM_BLOCK_BASE|0x14)
-#define TIMER0BGLOAD (PWM_BLOCK_BASE|0x18)
-#define PWM0OFF (PWM_BLOCK_BASE|0x1C)
-#define TIMER1LOAD (PWM_BLOCK_BASE|0x20)
-#define TIMER1VALUE (PWM_BLOCK_BASE|0x24)
-#define TIMER1CONTROL (PWM_BLOCK_BASE|0x28)
-#define TIMER1INTCLR (PWM_BLOCK_BASE|0x2C)
-#define TIMER1RIS (PWM_BLOCK_BASE|0x30)
-#define TIMER1MIS (PWM_BLOCK_BASE|0x34)
-#define TIMER1BGLOAD (PWM_BLOCK_BASE|0x38)
-#define PWM1OFF (PWM_BLOCK_BASE|0x3C)
-#define TIMERITCR (PWM_BLOCK_BASE|0x60)
-#define TIMERITOP (PWM_BLOCK_BASE|0x64)
-#define PWMCR (PWM_BLOCK_BASE|0x68)
-#define PWMID (PWM_BLOCK_BASE|0x6C)
-#define PWMMON (PWM_BLOCK_BASE|0x70)
-
-
-#define GPIODATA (GPIO_BLOCK_BASE|0x00)
-#define GPIODIR (GPIO_BLOCK_BASE|0x04)
-#define GPIOIS (GPIO_BLOCK_BASE|0x08)
-#define GPIOIBE (GPIO_BLOCK_BASE|0x0C)
-#define GPIOIEV (GPIO_BLOCK_BASE|0x10)
-#define GPIOIE (GPIO_BLOCK_BASE|0x14)
-#define GPIORIS (GPIO_BLOCK_BASE|0x18)
-#define GPIOMIS (GPIO_BLOCK_BASE|0x1C)
-#define GPIOIC (GPIO_BLOCK_BASE|0x20)
-#define GPIOOMS (GPIO_BLOCK_BASE|0x24)
-#define GPIOPC (GPIO_BLOCK_BASE|0x28)
-
-#define GPIOID (GPIO_BLOCK_BASE|0x30)
-
-
-#define WKREQ (SYSTEM_BLOCK1_BASE|0x00)
-#define CLKENB (SYSTEM_BLOCK1_BASE|0x04)
-#define DRAMPWR (SYSTEM_BLOCK1_BASE|0x08)
-#define INTMASK (SYSTEM_BLOCK1_BASE|0x0C)
-#define GPIOSEL (SYSTEM_BLOCK2_BASE|0x00)
-
-struct init_table {
- unsigned int reg;
- unsigned int val;
-};
-
-static struct init_table toshiba_480x640_init_table[] = {
- { DPSET0, 0x4BEC0066 }, // # MDC.DPSET0 # Setup DPLL parameters
- { DPSET1, 0x00000113 }, // # MDC.DPSET1
- { DPSUS, 0x00000000 }, // # MDC.DPSUS # Set DPLL oscillation enable
- { DPRUN, 0x00000001 }, // # MDC.DPRUN # Release reset signal for DPLL
- { 0, 14 }, // wait_ms(14);
- { SYSCKENA, 0x00000001 }, // # MDC.SYSCKENA # Enable system clock output
- { CLKENB, 0x000000EF }, // # SYS.CLKENB # Enable clocks for each module (without DCLK , i2cCLK)
- { GPIO_BLOCK_BASE, 0x03FF0000 }, // # GPI .GPIODATA # GPIO2(RESET_LCD_N) set to 0 , GPIO3(eDRAM_Power) set to 0
- { GPIODIR, 0x0000024D }, // # GPI .GPIODIR # Select direction of GPIO port (0,2,3,6,9 output)
- { SYSTEM_BLOCK2_BASE, 0x00000173 }, // # SYS.GPIOSEL # GPIO port multiplexing control
- { GPIOPC, 0x03C300C0 }, // # GPI .GPIOPC # GPIO2,3 PD cut
- { SYSTEM_BLOCK1_BASE, 0x00000000 }, // # SYS.WKREQ # Wake-up request event is VSYNC alignment
- { GPIOIS, 0x00000000 }, // # GPI .GPIOIS # Set interrupt sense of GPIO
- { GPIOIEV, 0x00000001 }, // # GPI .GPIOIEV # Set interrupt event of GPIO
- { GPIOIC, 0x000003FF }, // # GPI .GPIOIC # GPIO interrupt clear
- { GPIO_BLOCK_BASE, 0x00060006 }, // # GPI .GPIODATA # Release LCDD reset
- { GPIO_BLOCK_BASE, 0x00080008 }, // # GPI .GPIODATA # eDRAM VD supply
- { GPIO_BLOCK_BASE, 0x02000200 }, // # GPI .GPIODATA # TEST LED ON
- { DRAMPWR, 0x00000001 }, // # SYS.DRAMPWR # eDRAM power up
- { TIMER0CONTROL, 0x00000060 }, // # PWM.Timer0Control # PWM0 output stop
- { PWM_BLOCK_BASE, 0x00001388 }, // # PWM.Timer0Load # PWM0 10kHz , Duty 99 (BackLight OFF)
- //{PWM0OFF, 0x00000001 }, // # PWM.PWM0OFF
-#if 0
- { PWM0OFF, 0x00001387 }, // SURF 100% backlight
- { PWM0OFF, 0x00000000 }, // FFA 100% backlight
-#endif
- { PWM0OFF, 0x000009C3 }, // 50% BL
- { TIMER1CONTROL, 0x00000060 }, // # PWM.Timer1Control # PWM1 output stop
- { TIMER1LOAD, 0x00001388 }, // # PWM.Timer1Load # PWM1 10kHz , Duty 99 (BackLight OFF)
- //{PWM1OFF, 0x00000001 }, // # PWM.PWM1OFF
- { PWM1OFF, 0x00001387 },
- { TIMER0CONTROL, 0x000000E0 }, // # PWM.Timer0Control # PWM0 output start
- { TIMER1CONTROL, 0x000000E0 }, // # PWM.Timer1Control # PWM1 output start
- { PWMCR, 0x00000003 }, // # PWM.PWMCR # PWM output enable
- { 0, 1 }, // wait_ms(1);
- { SPI_BLOCK_BASE, 0x00000799 }, // # SPI .SSICTL # SPI operation mode setting
- { SSITIME, 0x00000100 }, // # SPI .SSITIME # SPI serial interface timing setting
- { SPI_BLOCK_BASE, 0x0000079b }, // # SPI .SSICTL # Set SPI active mode
-
- { SSITX, 0x00000000 }, // # SPI.SSITX # Release from Deep Stanby mode
- { 0, 1 }, // wait_ms(1);
- { SSITX, 0x00000000 }, // # SPI.SSITX
- { 0, 1 }, // wait_ms(1);
- { SSITX, 0x00000000 }, // # SPI.SSITX
- { 0, 1 }, // wait_ms(1);
- { SSITX, 0x000800BA }, // # SPI.SSITX *NOTE 1 # Command setting of SPI block
- { SSITX, 0x00000111 }, // # Display mode setup(1) : Normaly Black
- { SSITX, 0x00080036 }, // # Command setting of SPI block
- { SSITX, 0x00000100 }, // # Memory access control
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800BB }, // # Command setting of SPI block
- { SSITX, 0x00000100 }, // # Display mode setup(2)
- { SSITX, 0x0008003A }, // # Command setting of SPI block
- { SSITX, 0x00000160 }, // # RGB Interface data format
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800BF }, // # Command setting of SPI block
- { SSITX, 0x00000100 }, // # Drivnig method
- { SSITX, 0x000800B1 }, // # Command setting of SPI block
- { SSITX, 0x0000015D }, // # Booster operation setup
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800B2 }, // # Command setting of SPI block
- { SSITX, 0x00000133 }, // # Booster mode setup
- { SSITX, 0x000800B3 }, // # Command setting of SPI block
- { SSITX, 0x00000122 }, // # Booster frequencies setup
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800B4 }, // # Command setting of SPI block
- { SSITX, 0x00000102 }, // # OP-amp capability/System clock freq. division setup
- { SSITX, 0x000800B5 }, // # Command setting of SPI block
- { SSITX, 0x0000011F }, // # VCS Voltage adjustment (1C->1F for Rev 2)
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800B6 }, // # Command setting of SPI block
- { SSITX, 0x00000128 }, // # VCOM Voltage adjustment
- { SSITX, 0x000800B7 }, // # Command setting of SPI block
- { SSITX, 0x00000103 }, // # Configure an external display signal
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800B9 }, // # Command setting of SPI block
- { SSITX, 0x00000120 }, // # DCCK/DCEV timing setup
- { SSITX, 0x000800BD }, // # Command setting of SPI block
- { SSITX, 0x00000102 }, // # ASW signal control
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800BE }, // # Command setting of SPI block
- { SSITX, 0x00000100 }, // # Dummy display (white/black) count setup for QUAD Data operation
- { SSITX, 0x000800C0 }, // # Command setting of SPI block
- { SSITX, 0x00000111 }, // # wait_ms(-out FR count setup (A)
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800C1 }, // # Command setting of SPI block
- { SSITX, 0x00000111 }, // # wait_ms(-out FR count setup (B)
- { SSITX, 0x000800C2 }, // # Command setting of SPI block
- { SSITX, 0x00000111 }, // # wait_ms(-out FR count setup (C)
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800C3 }, // # Command setting of SPI block
- { SSITX, 0x0008010A }, // # wait_ms(-in line clock count setup (D)
- { SSITX, 0x0000010A }, //
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800C4 }, // # Command setting of SPI block
- { SSITX, 0x00080160 }, // # Seep-in line clock count setup (E)
- { SSITX, 0x00000160 }, //
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800C5 }, // # Command setting of SPI block
- { SSITX, 0x00080160 }, // # wait_ms(-in line clock count setup (F)
- { SSITX, 0x00000160 }, //
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800C6 }, // # Command setting of SPI block
- { SSITX, 0x00080160 }, // # wait_ms(-in line clock setup (G)
- { SSITX, 0x00000160 }, //
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800C7 }, // # Command setting of SPI block
- { SSITX, 0x00080133 }, // # Gamma 1 fine tuning (1)
- { SSITX, 0x00000143 }, //
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800C8 }, // # Command setting of SPI block
- { SSITX, 0x00000144 }, // # Gamma 1 fine tuning (2)
- { SSITX, 0x000800C9 }, // # Command setting of SPI block
- { SSITX, 0x00000133 }, // # Gamma 1 inclination adjustment
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800CA }, // # Command setting of SPI block
- { SSITX, 0x00000100 }, // # Gamma 1 blue offset adjustment
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800EC }, // # Command setting of SPI block
- { SSITX, 0x00080102 }, // # Total number of horizontal clock cycles (1) [PCLK Sync. VGA setting]
- { SSITX, 0x00000118 }, //
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800CF }, // # Command setting of SPI block
- { SSITX, 0x00000101 }, // # Blanking period control (1) [PCLK Sync. Table1 for VGA]
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800D0 }, // # Command setting of SPI block
- { SSITX, 0x00080110 }, // # Blanking period control (2) [PCLK Sync. Table1 for VGA]
- { SSITX, 0x00000104 }, //
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800D1 }, // # Command setting of SPI block
- { SSITX, 0x00000101 }, // # CKV timing control on/off [PCLK Sync. Table1 for VGA]
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800D2 }, // # Command setting of SPI block
- { SSITX, 0x00080100 }, // # CKV1,2 timing control [PCLK Sync. Table1 for VGA]
- { SSITX, 0x0000013A }, //
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800D3 }, // # Command setting of SPI block
- { SSITX, 0x00080100 }, // # OEV timing control [PCLK Sync. Table1 for VGA]
- { SSITX, 0x0000013A }, //
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800D4 }, // # Command setting of SPI block
- { SSITX, 0x00080124 }, // # ASW timing control (1) [PCLK Sync. Table1 for VGA]
- { SSITX, 0x0000016E }, //
- { 0, 1 }, // wait_ms(1); // # Wait SPI fifo empty
- { SSITX, 0x000800D5 }, // # Command setting of SPI block
- { SSITX, 0x00000124 }, // # ASW timing control (2) [PCLK Sync. Table1 for VGA]
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800ED }, // # Command setting of SPI block
- { SSITX, 0x00080101 }, // # Total number of horizontal clock cycles (2) [PCLK Sync. Table1 for QVGA ]
- { SSITX, 0x0000010A }, //
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800D6 }, // # Command setting of SPI block
- { SSITX, 0x00000101 }, // # Blanking period control (1) [PCLK Sync. Table2 for QVGA]
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800D7 }, // # Command setting of SPI block
- { SSITX, 0x00080110 }, // # Blanking period control (2) [PCLK Sync. Table2 for QVGA]
- { SSITX, 0x0000010A }, //
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800D8 }, // # Command setting of SPI block
- { SSITX, 0x00000101 }, // # CKV timing control on/off [PCLK Sync. Table2 for QVGA]
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800D9 }, // # Command setting of SPI block
- { SSITX, 0x00080100 }, // # CKV1,2 timing control [PCLK Sync. Table2 for QVGA]
- { SSITX, 0x00000114 }, //
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800DE }, // # Command setting of SPI block
- { SSITX, 0x00080100 }, // # OEV timing control [PCLK Sync. Table2 for QVGA]
- { SSITX, 0x00000114 }, //
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800DF }, // # Command setting of SPI block
- { SSITX, 0x00080112 }, // # ASW timing control (1) [PCLK Sync. Table2 for QVGA]
- { SSITX, 0x0000013F }, //
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800E0 }, // # Command setting of SPI block
- { SSITX, 0x0000010B }, // # ASW timing control (2) [PCLK Sync. Table2 for QVGA]
- { SSITX, 0x000800E2 }, // # Command setting of SPI block
- { SSITX, 0x00000101 }, // # Built-in oscillator frequency division setup [Frequency division ratio : 2 (60Hq)
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800E3 }, // # Command setting of SPI block
- { SSITX, 0x00000136 }, // # Built-in oscillator clock count setup
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800E4 }, // # Command setting of SPI block
- { SSITX, 0x00080100 }, // # CKV timing control for using build-in osc
- { SSITX, 0x00000103 }, //
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800E5 }, // # Command setting of SPI block
- { SSITX, 0x00080102 }, // # OEV timing control for using build-in osc
- { SSITX, 0x00000104 }, //
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800E6 }, // # Command setting of SPI block
- { SSITX, 0x00000103 }, // # DCEV timing control for using build-in osc
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800E7 }, // # Command setting of SPI block
- { SSITX, 0x00080104 }, // # ASW timing setup for using build-in osc(1)
- { SSITX, 0x0000010A }, //
- { 0, 2 }, // wait_ms(2); // # Wait SPI fifo empty
- { SSITX, 0x000800E8 }, // # Command setting of SPI block
- { SSITX, 0x00000104 }, // # ASW timing setup for using build-in osc(2)
-
-
- { CLKENB, 0x000001EF }, // # SYS.CLKENB # DCLK enable
- { START, 0x00000000 }, // # LCD.START # LCDC wait_ms( mode
- { WRSTB, 0x0000003F }, // # LCD.WRSTB # write_client_reg( strobe
- { RDSTB, 0x00000432 }, // # LCD.RDSTB # Read strobe
- { PORT_ENB, 0x00000002 }, // # LCD.PORT_ENB # Asynchronous port enable
- { VSYNIF, 0x00000000 }, // # LCD.VSYNCIF # VSYNC I/F mode set
- { ASY_DATA, 0x80000000 }, // # LCD.ASY_DATx # Index setting of SUB LCDD
- { ASY_DATB, 0x00000001 }, // # Oscillator start
- { ASY_CMDSET, 0x00000005 }, // # LCD.ASY_CMDSET # Direct command transfer enable
- { ASY_CMDSET, 0x00000004 }, // # LCD.ASY_CMDSET # Direct command transfer disable
- { 0, 10 }, // wait_ms(10);
- { ASY_DATA, 0x80000000 }, // # LCD.ASY_DATx # DUMMY write_client_reg(@*NOTE2
- { ASY_DATB, 0x80000000 }, //
- { ASY_DATC, 0x80000000 }, //
- { ASY_DATD, 0x80000000 }, //
- { ASY_CMDSET, 0x00000009 }, // # LCD.ASY_CMDSET
- { ASY_CMDSET, 0x00000008 }, // # LCD.ASY_CMDSET
- { ASY_DATA, 0x80000007 }, // # LCD.ASY_DATx # Index setting of SUB LCDD
- { ASY_DATB, 0x00004005 }, // # LCD driver control
- { ASY_CMDSET, 0x00000005 }, // # LCD.ASY_CMDSET # Direct command transfer enable
- { ASY_CMDSET, 0x00000004 }, // # LCD.ASY_CMDSET # Direct command transfer disable
- { 0, 20 }, // wait_ms(20);
- { ASY_DATA, 0x80000059 }, // # LCD.ASY_DATx # Index setting of SUB LCDD
- { ASY_DATB, 0x00000000 }, // # LTPS I/F control
- { ASY_CMDSET, 0x00000005 }, // # LCD.ASY_CMDSET # Direct command transfer enable
- { ASY_CMDSET, 0x00000004 }, // # LCD.ASY_CMDSET # Direct command transfer disable
-
- { VSYNIF, 0x00000001 }, // # LCD.VSYNCIF # VSYNC I/F mode OFF
- { PORT_ENB, 0x00000001 }, // # LCD.PORT_ENB # SYNC I/F output select
-
- /******************************/
-
- { VSYNIF, 0x00000001 }, // VSYNC I/F mode OFF
- { PORT_ENB, 0x00000001 }, // SYNC I/F mode ON
-
- { BITMAP1, 0x01E000F0 }, // MDC.BITMAP2 ); // Setup of PITCH size to Frame buffer1
- { BITMAP2, 0x01E000F0 }, // MDC.BITMAP3 ); // Setup of PITCH size to Frame buffer2
- { BITMAP3, 0x01E000F0 }, // MDC.BITMAP4 ); // Setup of PITCH size to Frame buffer3
- { BITMAP4, 0x00DC00B0 }, // MDC.BITMAP5 ); // Setup of PITCH size to Frame buffer4
- { CLKENB, 0x000001EF }, // SYS.CLKENB ); // DCLK supply
- { PORT_ENB, 0x00000001 }, // LCD.PORT_ENB ); // Synchronous port enable
- { PORT, 0x00000004 }, // LCD.PORT ); // Polarity of DE is set to high active
- { PXL, 0x00000002 }, // LCD.PXL ); // ACTMODE 2 set (1st frame black data output)
- { MPLFBUF, 0x00000000 }, // LCD.MPLFBUF ); // Select the reading buffer
- { HCYCLE, 0x0000010b }, // LCD.HCYCLE ); // Setup to VGA size
- { HSW, 0x00000003 }, // LCD.HSW
- { HDE_START, 0x00000007 }, // LCD.HDE_START
- { HDE_SIZE, 0x000000EF }, // LCD.HDE_SIZE
- { VCYCLE, 0x00000285 }, // LCD.VCYCLE
- { VSW, 0x00000001 }, // LCD.VSW
- { VDE_START, 0x00000003 }, // LCD.VDE_START
- { VDE_SIZE, 0x0000027F }, // LCD.VDE_SIZE
-
- { START, 0x00000001 }, // LCD.START ); // LCDC - Pixel data transfer start
-
- { 0, 10 }, // wait_ms( 10 );
- { SSITX, 0x000800BC }, // SPI.SSITX ); // Command setting of SPI block
- { SSITX, 0x00000180 }, // Display data setup
- { SSITX, 0x0008003B }, // Command setting of SPI block
- { SSITX, 0x00000100 }, // Quad Data configuration - VGA
- { 0, 1 }, // wait_ms( 1 ); // Wait SPI fifo empty
- { SSITX, 0x000800B0 }, // Command setting of SPI block
- { SSITX, 0x00000116 }, // Power supply ON/OFF control
- { 0, 1 }, // wait_ms( 1 ); // Wait SPI fifo empty
- { SSITX, 0x000800B8 }, // Command setting of SPI block
- { SSITX, 0x000801FF }, // Output control
- { SSITX, 0x000001F5 },
- { 0, 1 }, // wait_ms( 1); // Wait SPI fifo empty
- { SSITX, 0x00000011 }, // wait_ms(-out (Command only)
- { SSITX, 0x00000029 }, // Display on (Command only)
-
- { SYSTEM_BLOCK1_BASE, 0x00000002 }, // # wakeREQ -> GPIO
-
- { 0, 0 }
-};
-
-static void _panel_init(struct init_table *init_table)
-{
- unsigned n;
-
- dprintf(INFO, "panel_init()\n");
-
- n = 0;
- while (init_table[n].reg != 0 || init_table[n].val != 0) {
- if (init_table[n].reg != 0)
- mddi_remote_write(init_table[n].val, init_table[n].reg);
- else
- thread_sleep(init_table[n].val);//mdelay(init_table[n].val);
- n++;
- }
-
- dprintf(INFO, "panel_init() done\n");
-}
-
-void panel_init(struct mddi_client_caps *client_caps)
-{
- switch(client_caps->manufacturer_name) {
- case 0xd263: // Toshiba
- dprintf(INFO, "Found Toshiba panel\n");
- _panel_init(toshiba_480x640_init_table);
- break;
- case 0x4474: //??
- if (client_caps->product_code == 0xc065)
- dprintf(INFO, "Found WVGA panel\n");
- break;
- }
-}
-
-void panel_poweron(void)
-{
- gpio_set(88, 0);
- gpio_config(88, GPIO_OUTPUT);
- thread_sleep(1); //udelay(10);
- gpio_set(88, 1);
- thread_sleep(10); //mdelay(10);
-
- //mdelay(1000); // uncomment for second stage boot
-}
-
-void panel_backlight(int on)
-{}
diff --git a/target/msm7630_1x/rules.mk b/target/msm7630_1x/rules.mk
deleted file mode 100644
index a5647aa..0000000
--- a/target/msm7630_1x/rules.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-LOCAL_DIR := $(GET_LOCAL_DIR)
-
-INCLUDES += -I$(LOCAL_DIR)/include -I$(LK_TOP_DIR)/platform/msm_shared
-
-PLATFORM := msm7x30
-
-MEMBASE := 0x00000000 # EBI
-MEMSIZE := 0x00100000 # 1MB
-
-BASE_ADDR := 0x00200000
-
-TAGS_ADDR := BASE_ADDR+0x00000100
-KERNEL_ADDR := BASE_ADDR+0x00008000
-RAMDISK_ADDR := BASE_ADDR+0x01000000
-SCRATCH_ADDR := 0x08008000
-FASTBOOT_BUF_SIZE := 0x07800000
-
-KEYS_USE_GPIO_KEYPAD := 1
-
-DEFINES += DISPLAY_TYPE_MDDI=1
-
-MODULES += \
- dev/keys \
- lib/ptable
-
-DEFINES += \
- SDRAM_SIZE=$(MEMSIZE) \
- MEMBASE=$(MEMBASE) \
- BASE_ADDR=$(BASE_ADDR) \
- TAGS_ADDR=$(TAGS_ADDR) \
- KERNEL_ADDR=$(KERNEL_ADDR) \
- RAMDISK_ADDR=$(RAMDISK_ADDR) \
- SCRATCH_ADDR=$(SCRATCH_ADDR) \
- FASTBOOT_BUF_SIZE=$(FASTBOOT_BUF_SIZE)
-
-
-OBJS += \
- $(LOCAL_DIR)/init.o \
- $(LOCAL_DIR)/atags.o \
- $(LOCAL_DIR)/keypad.o
diff --git a/target/msm7630_1x/tools/makefile b/target/msm7630_1x/tools/makefile
deleted file mode 100644
index 3c0a451..0000000
--- a/target/msm7630_1x/tools/makefile
+++ /dev/null
@@ -1,41 +0,0 @@
-#Makefile to generate appsboot.mbn
-
-ifeq ($(BOOTLOADER_OUT),.)
-APPSBOOTHEADER_DIR := $(BUILDDIR)
-else
-APPSBOOTHEADER_DIR := $(BOOTLOADER_OUT)/../../
-endif
-
-SRC_DIR := target/$(TARGET)/tools
-COMPILER := gcc
-
-ifeq ($(EMMC_BOOT), 1)
- APPSBOOTHDR_FILES := EMMCBOOT.MBN
-else
- ifeq ($(BUILD_NANDWRITE), 1)
- APPSBOOTHDR_FILES :=
- else
- APPSBOOTHDR_FILES := appsboot.mbn
- endif
-endif
-
-APPSBOOTHEADER: $(APPSBOOTHDR_FILES)
-
-
-appsboot.mbn: appsboothd.mbn $(OUTBIN)
- cat $(APPSBOOTHEADER_DIR)/appsboothd.mbn $(OUTBIN) > $(APPSBOOTHEADER_DIR)/appsboot.mbn
- rm -f $(APPSBOOTHEADER_DIR)/appsboothd.mbn
-
-appsboothd.mbn: mkheader $(OUTBIN)
- $(SRC_DIR)/mkheader $(OUTBIN) $(APPSBOOTHEADER_DIR)/appsboothd.mbn
-
-EMMCBOOT.MBN: emmc_appsboothd.mbn $(OUTBIN)
- cat $(APPSBOOTHEADER_DIR)/emmc_appsboothd.mbn $(OUTBIN) > $(APPSBOOTHEADER_DIR)/EMMCBOOT.MBN
- rm -f $(APPSBOOTHEADER_DIR)/emmc_appsboothd.mbn
-
-emmc_appsboothd.mbn: mkheader $(OUTBIN)
- $(SRC_DIR)/mkheader $(OUTBIN) $(APPSBOOTHEADER_DIR)/emmc_appsboothd.mbn unified-boot
-
-mkheader: $(SRC_DIR)/mkheader.c
- ${COMPILER} -DMEMBASE=$(MEMBASE) $(SRC_DIR)/mkheader.c -o $(SRC_DIR)/mkheader
-
diff --git a/target/msm7630_1x/tools/mkheader.c b/target/msm7630_1x/tools/mkheader.c
deleted file mode 100644
index 8701007..0000000
--- a/target/msm7630_1x/tools/mkheader.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* Copyright 2007, Google Inc. */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-#include <sys/stat.h>
-
-int main(int argc, char *argv[])
-{
- struct stat s;
- unsigned size, base;
- int unified_boot = 0;
- unsigned unified_boot_magic[20];
- unsigned non_unified_boot_magic[10];
- unsigned magic_len = 0;
- unsigned *magic;
- int fd;
-
- if(argc < 3) {
- fprintf(stderr,"usage: mkheader <bin> <hdr>\n");
- return -1;
- }
-
- if (argc == 4) {
- if(!strcmp("unified-boot",argv[3])) {
- unified_boot = 1;
- }
- }
-
- if(stat(argv[1], &s)) {
- perror("cannot stat binary");
- return -1;
- }
-
- if(unified_boot) {
- magic = unified_boot_magic;
- magic_len = sizeof(unified_boot_magic);
- } else {
- magic = non_unified_boot_magic;
- magic_len = sizeof(non_unified_boot_magic);
- }
-
- size = s.st_size;
-#if MEMBASE
- base = MEMBASE;
-#else
- base = 0;
-#endif
-
- magic[0] = 0x00000005; /* appsbl */
- magic[1] = 0x00000002; /* nand */
- magic[2] = 0x00000000;
- magic[3] = base;
- magic[4] = size;
- magic[5] = size;
- magic[6] = size + base;
- magic[7] = 0x00000000;
- magic[8] = size + base;
- magic[9] = 0x00000000;
-
- if (unified_boot == 1)
- {
- magic[10] = 0x33836685; /* cookie magic number */
- magic[11] = 0x00000001; /* cookie version */
- magic[12] = 0x00000002; /* file formats */
- magic[13] = 0x00000000;
- magic[14] = 0x00500000; /* 5M for boot.img */
- magic[15] = 0x00000000;
- magic[16] = 0x00000000;
- magic[17] = 0x00000000;
- magic[18] = 0x00000000;
- magic[19] = 0x00000000;
- }
-
- fd = open(argv[2], O_WRONLY | O_CREAT | O_TRUNC, 0644);
- if(fd < 0) {
- perror("cannot open header for writing");
- return -1;
- }
- if(write(fd, magic, magic_len) != magic_len) {
- perror("cannot write header");
- close(fd);
- unlink(argv[2]);
- return -1;
- }
- close(fd);
-
- return 0;
-}
diff --git a/target/msm7630_surf/init.c b/target/msm7630_surf/init.c
index 1aae5a2..b9c186b 100644
--- a/target/msm7630_surf/init.c
+++ b/target/msm7630_surf/init.c
@@ -177,8 +177,19 @@
keypad_init();
#endif
+ /* Display splash screen if enabled */
+#if DISPLAY_SPLASH_SCREEN
+ display_init();
+ dprintf(SPEW, "Diplay initialized\n");
+ display_image_on_screen();
+#endif
+
if (target_is_emmc_boot())
{
+ /* Must wait for modem-up before we can intialize MMC.
+ */
+ while (readl(MSM_SHARED_BASE + 0x14) != 1);
+
/* Trying Slot 2 first */
slot = 2;
base_addr = mmc_sdc_base[slot-1];
@@ -357,21 +368,6 @@
return power_on_status;
}
-unsigned target_pause_for_battery_charge(void)
-{
- //check power on reason only for fluid devices
- if( hw_platform_type != LINUX_MACHTYPE_7x30_FLUID)
- return 0;
-
- if (target_check_power_on_reason() == PWR_ON_EVENT_USB_CHG)
- return 1;
- return 0;
-}
-
-void target_battery_charging_enable(unsigned enable, unsigned disconnect)
-{
-}
-
#if _EMMC_BOOT
void target_serialno(unsigned char *buf)
{
diff --git a/target/msm8655_surf/atags.c b/target/msm8655_surf/atags.c
deleted file mode 100644
index 4d79e76..0000000
--- a/target/msm8655_surf/atags.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/* Copyright (c) 2009, Code Aurora Forum. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Code Aurora nor
- * the names of its contributors may be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include <reg.h>
-#include <debug.h>
-#include <smem.h>
-
-#define EBI1_ADDR_128M 0x08000000
-#define SIZE_256M 0x10000000
-#define SIZE_128M 0x08000000
-#define SIZE_1M 0x00100000
-
-static int scratch_addr = -1;
-int smem_ram_ptable_init(struct smem_ram_ptable *);
-
-unsigned* target_atag_mem(unsigned* ptr)
-{
- struct smem_ram_ptable ram_ptable;
- unsigned i = 0;
-
- if (smem_ram_ptable_init(&ram_ptable))
- {
- for (i = 0; i < ram_ptable.len; i++)
- {
- if ((ram_ptable.parts[i].attr == READWRITE)
- && (ram_ptable.parts[i].domain == APPS_DOMAIN)
- && (ram_ptable.parts[i].type == APPS_MEMORY)
- && (ram_ptable.parts[i].category != IMEM))
- {
- /* ATAG_MEM */
- *ptr++ = 4;
- // Tag EBI-1 memory as unstable.
- if(ram_ptable.parts[i].category == EBI1_CS0) {
- // if EBI-1 CS-0 is 256Mb then this is a 2x256 target and
- // the kernel can reserve this mem region as unstable.
- // This memory region can be activated when the kernel
- // receives a request from Android init scripts.
- if(ram_ptable.parts[i].size == SIZE_256M)
- *ptr++ = 0x5441000A; //Deep-Power-Down Tag.
-
- //if EBI-1 CS-0 s 128Mb then this is a 2x128 target.
- //Android + Kernel + PMEM regions account for more than
- //128Mb and the target will not be able to boot with just
- //one memory bank active and the second memory bank is reserved.
- //In the case of 2x128 the tag is set to SelfRefresh Only.
- else if(ram_ptable.parts[i].size == SIZE_128M)
- *ptr++ = 0x5441000B; //Self-Refresh Tag.
- }
- else
- *ptr++ = 0x54410002;
-
- *ptr++ = ram_ptable.parts[i].size;
- *ptr++ = ram_ptable.parts[i].start;
- }
-
- /* Check for modem bootloader memory that can be reclaimed */
- if ((ram_ptable.parts[i].attr == READWRITE)
- && (ram_ptable.parts[i].domain == APPS_DOMAIN)
- && (ram_ptable.parts[i].type == BOOT_REGION_MEMORY1))
- {
- /* ATAG_MEM_OSBL */
- *ptr++ = 4;
- *ptr++ = 0x5441000C;
- *ptr++ = ram_ptable.parts[i].size;
- *ptr++ = ram_ptable.parts[i].start;
- }
- }
- }
- else
- {
- dprintf(CRITICAL, "ERROR: Unable to read RAM partition\n");
- ASSERT(0);
- }
-
- return ptr;
-}
-
-void *target_get_scratch_address(void)
-{
- struct smem_ram_ptable ram_ptable;
- unsigned i = 0;
-
- if (smem_ram_ptable_init(&ram_ptable))
- {
- for (i = 0; i < ram_ptable.len; i++)
- {
- if ((ram_ptable.parts[i].attr == READWRITE)
- && (ram_ptable.parts[i].domain == APPS_DOMAIN)
- && (ram_ptable.parts[i].start != 0x0))
- {
- if (ram_ptable.parts[i].size >= FASTBOOT_BUF_SIZE)
- {
- scratch_addr = ram_ptable.parts[i].start;
- break;
- }
- }
- }
- }
- else
- {
- dprintf(CRITICAL, "ERROR: Unable to read RAM partition\n");
- ASSERT(0);
- }
-
- return (void *)((scratch_addr == -1) ? EBI1_ADDR_128M : scratch_addr);
-}
diff --git a/target/msm8655_surf/include/target/display.h b/target/msm8655_surf/include/target/display.h
deleted file mode 100644
index 69cd4ac..0000000
--- a/target/msm8655_surf/include/target/display.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of Code Aurora Forum, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef _TARGET_MSM7630_SURF_DISPLAY_H
-#define _TARGET_MSM7630_SURF_DISPLAY_H
-
-#define TARGET_XRES 480
-#define TARGET_YRES 800
-
-#define LCDC_FB_WIDTH 480
-#define LCDC_FB_HEIGHT 800
-
-#define LCDC_HSYNC_PULSE_WIDTH_DCLK 8
-#define LCDC_HSYNC_BACK_PORCH_DCLK 184
-#define LCDC_HSYNC_FRONT_PORCH_DCLK 4
-#define LCDC_HSYNC_SKEW_DCLK 0
-
-#define LCDC_VSYNC_PULSE_WIDTH_LINES 1
-#define LCDC_VSYNC_BACK_PORCH_LINES 2
-#define LCDC_VSYNC_FRONT_PORCH_LINES 3
-
-#endif
diff --git a/target/msm8655_surf/init.c b/target/msm8655_surf/init.c
deleted file mode 100644
index 00e3627..0000000
--- a/target/msm8655_surf/init.c
+++ /dev/null
@@ -1,380 +0,0 @@
-/*
- * Copyright (c) 2009, Google Inc.
- * All rights reserved.
- * Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google, Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <debug.h>
-#include <dev/keys.h>
-#include <dev/gpio.h>
-#include <dev/gpio_keypad.h>
-#include <lib/ptable.h>
-#include <dev/flash.h>
-#include <smem.h>
-#include <mmc.h>
-#include <reg.h>
-#include <platform/iomap.h>
-#include <platform.h>
-
-#define LINUX_MACHTYPE_7x30_SURF 2679
-#define LINUX_MACHTYPE_7x30_FFA 2707
-#define LINUX_MACHTYPE_7x30_FLUID 2741
-#define LINUX_MACHTYPE_8x55_SURF 2768
-#define LINUX_MACHTYPE_8x55_FFA 2769
-#define LINUX_MACHTYPE_8x55_SVLTE_FFA 2863
-#define LINUX_MACHTYPE_8x55_SVLTE_SURF 2864
-
-#define MSM8255_ID 74
-#define MSM8655_ID 75
-#define APQ8055_ID 85
-
-#define VARIABLE_LENGTH 0x10101010
-#define DIFF_START_ADDR 0xF0F0F0F0
-#define NUM_PAGES_PER_BLOCK 0x40
-
-static unsigned mmc_sdc_base[] = { MSM_SDC1_BASE, MSM_SDC2_BASE, MSM_SDC3_BASE, MSM_SDC4_BASE};
-
-static struct ptable flash_ptable;
-static int hw_platform_type = -1;
-
-/* for these partitions, start will be offset by either what we get from
- * smem, or from the above offset if smem is not useful. Also, we should
- * probably have smem_ptable code populate our flash_ptable.
- *
- * When smem provides us with a full partition table, we can get rid of
- * this altogether.
- *
- */
-static struct ptentry board_part_list[] = {
- {
- .start = 0,
- .length = 5 /* In MB */,
- .name = "boot",
- },
- {
- .start = DIFF_START_ADDR,
- .length = 120 /* In MB */,
- .name = "system",
- },
- {
- .start = DIFF_START_ADDR,
- .length = 30 /* In MB */,
- .name = "cache",
- },
- {
- .start = DIFF_START_ADDR,
- .length = 1 /* In MB */,
- .name = "misc",
- },
- {
- .start = DIFF_START_ADDR,
- .length = VARIABLE_LENGTH,
- .name = "userdata",
- },
- {
- .start = DIFF_START_ADDR,
- .length = 3 /* In MB */,
- .name = "persist",
- },
- {
- .start = DIFF_START_ADDR,
- .length = 5 /* In MB */,
- .name = "recovery",
- },
-};
-static int num_parts = sizeof(board_part_list)/sizeof(struct ptentry);
-
-void smem_ptable_init(void);
-unsigned smem_get_apps_flash_start(void);
-unsigned smem_read_alloc_entry_offset(smem_mem_type_t, void *, int, int);
-
-void keypad_init(void);
-
-static int emmc_boot = -1; /* set to uninitialized */
-int target_is_emmc_boot(void);
-static int platform_version = -1;
-static int target_msm_id = -1;
-static int interleaved_mode_enabled = -1;
-void enable_interleave_mode(int);
-
-int target_is_interleaved_mode(void)
-{
- struct smem_board_info_v4 board_info_v4;
- unsigned int board_info_len = 0;
- unsigned smem_status;
- char *build_type;
- unsigned format = 0;
-
- if (interleaved_mode_enabled != -1)
- {
- return interleaved_mode_enabled;
- }
-
- smem_status = smem_read_alloc_entry_offset(SMEM_BOARD_INFO_LOCATION,
- &format, sizeof(format), 0);
- if(!smem_status)
- {
- if ((format == 3) || (format == 4))
- {
- if (format == 4)
- board_info_len = sizeof(board_info_v4);
- else
- board_info_len = sizeof(board_info_v4.board_info_v3);
-
- smem_status = smem_read_alloc_entry(SMEM_BOARD_INFO_LOCATION,
- &board_info_v4, board_info_len);
- if(!smem_status)
- {
- build_type = (char *)(board_info_v4.board_info_v3.build_id) + 9;
-
- interleaved_mode_enabled = 0;
-
- if (*build_type == 'C')
- {
- interleaved_mode_enabled = 1;
- }
- }
- }
- }
-
- return interleaved_mode_enabled;
-}
-
-void target_init(void)
-{
- unsigned offset;
- struct flash_info *flash_info;
- unsigned total_num_of_blocks;
- unsigned next_ptr_start_adr = 0;
- unsigned blocks_per_1MB = 8; /* Default value of 2k page size on 256MB flash drive*/
- unsigned base_addr;
- unsigned char slot;
- int i;
-
- dprintf(INFO, "target_init()\n");
-
-#if (!ENABLE_NANDWRITE)
- keys_init();
- keypad_init();
-#endif
-
- if (target_is_emmc_boot())
- {
- /* Trying Slot 2 first */
- slot = 2;
- base_addr = mmc_sdc_base[slot-1];
- if(mmc_boot_main(slot, base_addr))
- {
- /* Trying Slot 4 next */
- slot = 4;
- base_addr = mmc_sdc_base[slot-1];
- if(mmc_boot_main(slot, base_addr))
- {
- dprintf(CRITICAL, "mmc init failed!");
- ASSERT(0);
- }
- }
- return;
- }
-
- ptable_init(&flash_ptable);
- smem_ptable_init();
-
- flash_init();
- flash_info = flash_get_info();
- ASSERT(flash_info);
- enable_interleave_mode(target_is_interleaved_mode());
-
- offset = smem_get_apps_flash_start();
- if (offset == 0xffffffff)
- while(1);
-
- total_num_of_blocks = flash_info->num_blocks;
- blocks_per_1MB = (1 << 20) / (flash_info->block_size);
-
- for (i = 0; i < num_parts; i++) {
- struct ptentry *ptn = &board_part_list[i];
- unsigned len = ((ptn->length) * blocks_per_1MB);
-
- if(ptn->start != 0)
- ASSERT(ptn->start == DIFF_START_ADDR);
-
- ptn->start = next_ptr_start_adr;
-
- if(ptn->length == VARIABLE_LENGTH)
- {
- unsigned length_for_prt = 0;
- unsigned j;
- for (j = i+1; j < num_parts; j++)
- {
- struct ptentry *temp_ptn = &board_part_list[j];
- ASSERT(temp_ptn->length != VARIABLE_LENGTH);
- length_for_prt += ((temp_ptn->length) * blocks_per_1MB);
- }
- len = (total_num_of_blocks - 1) - (offset + ptn->start + length_for_prt);
- ASSERT(len >= 0);
- }
- next_ptr_start_adr = ptn->start + len;
- if(target_is_interleaved_mode()) {
- ptable_add(&flash_ptable, ptn->name, offset + (ptn->start / 2),
- (len / 2), ptn->flags, TYPE_APPS_PARTITION, PERM_WRITEABLE);
- }
- else {
- ptable_add(&flash_ptable, ptn->name, offset + ptn->start,
- len, ptn->flags, TYPE_APPS_PARTITION, PERM_WRITEABLE);
- }
- }
-
- smem_add_modem_partitions(&flash_ptable);
-
- ptable_dump(&flash_ptable);
- flash_set_ptable(&flash_ptable);
-}
-
-int target_platform_version(void)
-{
- return platform_version;
-}
-
-int target_is_msm8x55(void)
-{
- if ((target_msm_id == MSM8255_ID) ||
- (target_msm_id == MSM8655_ID) ||
- (target_msm_id == APQ8055_ID))
- return 1;
- else
- return 0;
-}
-
-unsigned board_machtype(void)
-{
- struct smem_board_info_v4 board_info_v4;
- unsigned int board_info_len = 0;
- enum platform platform_type = 0;
- unsigned smem_status;
- unsigned format = 0;
- if(hw_platform_type != -1)
- return hw_platform_type;
-
- smem_status = smem_read_alloc_entry_offset(SMEM_BOARD_INFO_LOCATION,
- &format, sizeof(format), 0);
- if(!smem_status)
- {
- if ((format == 3) || (format == 4))
- {
- if (format == 4)
- board_info_len = sizeof(board_info_v4);
- else
- board_info_len = sizeof(board_info_v4.board_info_v3);
-
- smem_status = smem_read_alloc_entry(SMEM_BOARD_INFO_LOCATION,
- &board_info_v4, board_info_len);
- if(!smem_status)
- {
- if(format == 4)
- platform_version = board_info_v4.platform_version;
-
- platform_type = board_info_v4.board_info_v3.hw_platform;
- target_msm_id = board_info_v4.board_info_v3.msm_id;
- switch (platform_type)
- {
- case HW_PLATFORM_SURF:
- hw_platform_type = ((target_is_msm8x55()) ?
- LINUX_MACHTYPE_8x55_SURF : LINUX_MACHTYPE_7x30_SURF); break;
- case HW_PLATFORM_FFA:
- hw_platform_type = ((target_is_msm8x55()) ?
- LINUX_MACHTYPE_8x55_FFA : LINUX_MACHTYPE_7x30_FFA); break;
- case HW_PLATFORM_FLUID:
- hw_platform_type = LINUX_MACHTYPE_7x30_FLUID; break;
- case HW_PLATFORM_SVLTE:
- hw_platform_type = LINUX_MACHTYPE_8x55_SVLTE_FFA; break;
- default:
- hw_platform_type = ((target_is_msm8x55()) ?
- LINUX_MACHTYPE_8x55_SURF : LINUX_MACHTYPE_7x30_SURF); break;
- }
- return hw_platform_type;
- }
- }
- }
- hw_platform_type = LINUX_MACHTYPE_7x30_SURF;
- return hw_platform_type;
-}
-
-void reboot_device(unsigned reboot_reason)
-{
- reboot(reboot_reason);
-}
-
-unsigned check_reboot_mode(void)
-{
- unsigned mode[2] = {0, 0};
- unsigned int mode_len = sizeof(mode);
- unsigned smem_status;
-
- smem_status = smem_read_alloc_entry(SMEM_APPS_BOOT_MODE,
- &mode, mode_len );
- if(smem_status)
- {
- dprintf(CRITICAL, "ERROR: unable to read shared memory for reboot mode\n");
- return 0;
- }
- return mode[0];
-}
-
-static unsigned target_check_power_on_reason(void)
-{
- unsigned power_on_status = 0;
- unsigned int status_len = sizeof(power_on_status);
- unsigned smem_status;
-
- smem_status = smem_read_alloc_entry(SMEM_POWER_ON_STATUS_INFO,
- &power_on_status, status_len);
-
- if (smem_status)
- {
- dprintf(CRITICAL, "ERROR: unable to read shared memory for power on reason\n");
- }
-
- return power_on_status;
-}
-
-unsigned target_pause_for_battery_charge(void)
-{
- //check power on reason only for fluid devices
- if( hw_platform_type != LINUX_MACHTYPE_7x30_FLUID)
- return 0;
-
- if (target_check_power_on_reason() == PWR_ON_EVENT_USB_CHG)
- return 1;
- return 0;
-}
-
-void target_battery_charging_enable(unsigned enable, unsigned disconnect)
-{
-}
diff --git a/target/msm8655_surf/keypad.c b/target/msm8655_surf/keypad.c
deleted file mode 100644
index 46c51c8..0000000
--- a/target/msm8655_surf/keypad.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2009, Google Inc.
- * All rights reserved.
- * Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google, Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <dev/keys.h>
-#include <dev/gpio_keypad.h>
-
-#define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
-#define BITS_IN_ELEMENT(x) (sizeof(x)[0] * 8)
-
-static unsigned char qwerty_keys_old[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-static unsigned char qwerty_keys_new[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-
-#define KEYMAP_INDEX(row, col) (row)* BITS_IN_ELEMENT(qwerty_keys_new) + (col)
-
-static unsigned int qwerty_keymap[] = {
- [KEYMAP_INDEX(4, 2)] = KEY_BACK, /* -L on SURF & FFA */
- [KEYMAP_INDEX(3, 4)] = KEY_HOME, /* +R on SURF & FFA */
- [KEYMAP_INDEX(1, 3)] = KEY_VOLUMEUP, /* '+' of left side switch on FLUID */
- [KEYMAP_INDEX(1, 4)] = KEY_VOLUMEDOWN, /* '-' of left side switch on FLUID */
-};
-
-static struct qwerty_keypad_info qwerty_keypad = {
- .keymap = qwerty_keymap,
- .old_keys = qwerty_keys_old,
- .rec_keys = qwerty_keys_new,
- .rows = 5,
- .columns = 5,
- .num_of_reads = 6,
- .rd_func = &i2c_ssbi_read_bytes,
- .wr_func = &i2c_ssbi_write_bytes,
- .settle_time = 5 /* msec */,
- .poll_time = 20 /* msec */,
-};
-
-void keypad_init(void)
-{
- ssbi_keypad_init(&qwerty_keypad);
-}
diff --git a/target/msm8655_surf/rules.mk b/target/msm8655_surf/rules.mk
deleted file mode 100644
index d24b4e0..0000000
--- a/target/msm8655_surf/rules.mk
+++ /dev/null
@@ -1,49 +0,0 @@
-LOCAL_DIR := $(GET_LOCAL_DIR)
-
-INCLUDES += -I$(LOCAL_DIR)/include -I$(LK_TOP_DIR)/platform/msm_shared -I$(LK_TOP_DIR)/platform/msm7x30
-
-PLATFORM := msm7x30
-
-ifeq ($(ENABLE_TRUSTZONE),1)
- LK_START := 0x0 #Start of LK image
- MEMBASE := 0x00080000 # EBI Lies at 512K, after TrustZone
- MEMSIZE := 0x00080000 # 512K Size reduced to 512K from 1MB
- ROMLITE_PREFLASHED_DATA := 0xBF000 # Only used for local testing. Romlite binary will be flashed to this location
-else
- MEMBASE := 0x00000000 # EBI
- MEMSIZE := 0x00100000 # 1MB
-endif
-
-BASE_ADDR := 0x00200000
-
-TAGS_ADDR := BASE_ADDR+0x00000100
-KERNEL_ADDR := BASE_ADDR+0x00008000
-RAMDISK_ADDR := BASE_ADDR+0x01000000
-SCRATCH_ADDR := 0x08008000
-FASTBOOT_BUF_SIZE := 0x07800000
-
-KEYS_USE_GPIO_KEYPAD := 1
-
-DEFINES += DISPLAY_SPLASH_SCREEN=0
-DEFINES += DISPLAY_TYPE_MDDI=0
-DEFINES += DISPLAY_TYPE_LCDC=0
-
-MODULES += \
- dev/keys \
- lib/ptable
-
-DEFINES += \
- SDRAM_SIZE=$(MEMSIZE) \
- MEMBASE=$(MEMBASE) \
- BASE_ADDR=$(BASE_ADDR) \
- TAGS_ADDR=$(TAGS_ADDR) \
- KERNEL_ADDR=$(KERNEL_ADDR) \
- RAMDISK_ADDR=$(RAMDISK_ADDR) \
- SCRATCH_ADDR=$(SCRATCH_ADDR) \
- FASTBOOT_BUF_SIZE=$(FASTBOOT_BUF_SIZE)
-
-
-OBJS += \
- $(LOCAL_DIR)/init.o \
- $(LOCAL_DIR)/atags.o \
- $(LOCAL_DIR)/keypad.o \
diff --git a/target/msm8660_surf/atags.c b/target/msm8660_surf/atags.c
index dc112f4..7f91a71 100644
--- a/target/msm8660_surf/atags.c
+++ b/target/msm8660_surf/atags.c
@@ -88,5 +88,5 @@
unsigned target_get_max_flash_size(void)
{
- return (140 * 1024 * 1024);
+ return (192 * 1024 * 1024);
}
diff --git a/target/msm8660_surf/init.c b/target/msm8660_surf/init.c
index e918c9b..811b69f 100644
--- a/target/msm8660_surf/init.c
+++ b/target/msm8660_surf/init.c
@@ -80,6 +80,14 @@
keys_init();
keypad_init();
#endif
+
+ /* Display splash screen if enabled */
+#if DISPLAY_SPLASH_SCREEN
+ display_init();
+ dprintf(SPEW, "Diplay initialized\n");
+ display_image_on_screen();
+#endif
+
if(mmc_boot_main(MMC_SLOT,MSM_SDC1_BASE))
{
dprintf(CRITICAL, "mmc init failed!");
diff --git a/target/msm8960/init.c b/target/msm8960/init.c
index fb218b6..e916f3c 100644
--- a/target/msm8960/init.c
+++ b/target/msm8960/init.c
@@ -58,6 +58,18 @@
static const uint8_t uart_gsbi_id = GSBI_ID_5;
+void shutdown_device(void)
+{
+ dprintf(CRITICAL, "Shutdown system.\n");
+ pm8921_config_reset_pwr_off(0);
+
+ /* Actually reset the chip */
+ writel(0, MSM_PSHOLD_CTL_SU);
+ mdelay(5000);
+
+ dprintf (CRITICAL, "Shutdown failed.\n");
+}
+
void target_init(void)
{
unsigned base_addr;
@@ -69,13 +81,17 @@
pmic.write = pa1_ssbi2_write_bytes;
pm8921_init(&pmic);
-
/* Keypad init */
keys_init();
keypad_init();
- /* Turn on Backlight */
+ /* Display splash screen if enabled */
+#if DISPLAY_SPLASH_SCREEN
panel_backlight_on();
+ display_init();
+ dprintf(SPEW, "Diplay initialized\n");
+ display_image_on_screen();
+#endif
/* Trying Slot 1 first */
slot = 1;
@@ -141,24 +157,11 @@
void reboot_device(unsigned reboot_reason)
{
- /* Disable WDG0 */
- writel(0,MSM_WDT0_EN);
-
/* Actually reset the chip */
+ pm8921_config_reset_pwr_off(1);
writel(0, MSM_PSHOLD_CTL_SU);
- mdelay(5000);
-
- /* Fall back to watchdog */
- /* Reset WDG0 counter */
- writel(1,MSM_WDT0_RST);
- /* Set WDG0 bark time */
- writel(0x31F3,MSM_WDT0_BT);
- /* Enable WDG0 */
- writel(3,MSM_WDT0_EN);
- dmb();
- /* Enable WDG output */
- writel(3,MSM_TCSR_BASE + TCSR_WDOG_CFG);
mdelay(10000);
+
dprintf (CRITICAL, "Rebooting failed\n");
return;
}
diff --git a/target/msm8960/panel.c b/target/msm8960/panel.c
index 59f534b..328dcce 100644
--- a/target/msm8960/panel.c
+++ b/target/msm8960/panel.c
@@ -29,6 +29,7 @@
#include <debug.h>
#include <reg.h>
#include <mipi_dsi.h>
+#include <mdp4.h>
#include <dev/pm8921.h>
#include <platform/iomap.h>
#include <platform/clock.h>
@@ -105,7 +106,7 @@
/* DSI1_DSIPHY_CAL_HW_TRIGGER */
writel(0x01, MIPI_DSI_BASE + 0x0528);
- mdelay(50);
+
/* DSI1_DSIPHY_CAL_HW_TRIGGER */
writel(0x00, MIPI_DSI_BASE + 0x0528);
@@ -125,8 +126,7 @@
struct mipi_dsi_phy_ctrl *pd;
uint32_t i, off = 0;
- writel(0x0001, MIPI_DSI_BASE + 0x128);/* start phy sw reset */
- mdelay(100);
+ writel(0x0001, MIPI_DSI_BASE + 0x128);/* start phy sw reset */
writel(0x0000, MIPI_DSI_BASE + 0x128);/* end phy w reset */
writel(0x0003, MIPI_DSI_BASE + 0x500);/* regulator_ctrl_0 */
writel(0x0001, MIPI_DSI_BASE + 0x504);/* regulator_ctrl_1 */
diff --git a/target/qsd8250_ffa/init.c b/target/qsd8250_ffa/init.c
index 2481043..5f31a1a 100644
--- a/target/qsd8250_ffa/init.c
+++ b/target/qsd8250_ffa/init.c
@@ -89,9 +89,7 @@
void smem_ptable_init(void);
unsigned smem_get_apps_flash_start(void);
-void usb_charger_change_state(void);
-void usb_charger_reset(void);
-void usb_stop_charging(unsigned);
+
void keypad_init(void);
void target_init(void)
@@ -182,19 +180,3 @@
}
return mode[0];
}
-
-void target_battery_charging_enable(unsigned enable, unsigned disconnect)
-{
- if(disconnect){
- usb_charger_reset();
- return;
- }
- else
- usb_stop_charging(!enable);
-
- for(;;)
- {
- thread_sleep(10);
- usb_charger_change_state();
- }
-}
diff --git a/target/qsd8250_ffa/rules.mk b/target/qsd8250_ffa/rules.mk
index 1a639fc..4f869f1 100644
--- a/target/qsd8250_ffa/rules.mk
+++ b/target/qsd8250_ffa/rules.mk
@@ -16,7 +16,6 @@
KEYS_USE_GPIO_KEYPAD := 1
-DEFINES += ENABLE_BATTERY_CHARGING=1
DEFINES += DISPLAY_SPLASH_SCREEN=1
DEFINES += DISPLAY_TYPE_MDDI=1
diff --git a/target/qsd8250_surf/init.c b/target/qsd8250_surf/init.c
index 80c7193..3b7e03e 100644
--- a/target/qsd8250_surf/init.c
+++ b/target/qsd8250_surf/init.c
@@ -90,9 +90,7 @@
void smem_ptable_init(void);
unsigned smem_get_apps_flash_start(void);
-void usb_charger_change_state(void);
-void usb_charger_reset(void);
-void usb_stop_charging(unsigned);
+
void keypad_init(void);
void target_init(void)
@@ -183,19 +181,3 @@
}
return mode[0];
}
-
-void target_battery_charging_enable(unsigned enable, unsigned disconnect)
-{
- if(disconnect){
- usb_charger_reset();
- return;
- }
- else
- usb_stop_charging(!enable);
-
- for(;;)
- {
- thread_sleep(10);
- usb_charger_change_state();
- }
-}
diff --git a/target/qsd8250_surf/rules.mk b/target/qsd8250_surf/rules.mk
index 49ff8dd..62ceeea 100644
--- a/target/qsd8250_surf/rules.mk
+++ b/target/qsd8250_surf/rules.mk
@@ -16,11 +16,9 @@
KEYS_USE_GPIO_KEYPAD := 1
-DEFINES += ENABLE_BATTERY_CHARGING=1
DEFINES += DISPLAY_SPLASH_SCREEN=1
DEFINES += DISPLAY_TYPE_LCDC=1
-
MODULES += \
dev/keys \
lib/ptable