Merge "target: msm8974: Enable continuous splash screen for 8974 V2"
diff --git a/include/reg.h b/include/reg.h
index b5dd528..c642947 100644
--- a/include/reg.h
+++ b/include/reg.h
@@ -41,4 +41,7 @@
#define writeb(v, a) (*REG8(a) = (v))
#define readb(a) (*REG8(a))
+
+#define writehw(v, a) (*REG16(a) = (v))
+#define readhw(a) (*REG16(a))
#endif
diff --git a/platform/msm_shared/include/mmc.h b/platform/msm_shared/include/mmc.h
index 43ae057..39b1786 100644
--- a/platform/msm_shared/include/mmc.h
+++ b/platform/msm_shared/include/mmc.h
@@ -426,7 +426,7 @@
/* CSD Register.
* Note: not all the fields have been defined here
*/
-struct mmc_boot_csd {
+struct mmc_csd {
unsigned int cmmc_structure;
unsigned int spec_vers;
unsigned int card_cmd_class;
@@ -453,7 +453,7 @@
};
/* CID Register */
-struct mmc_boot_cid {
+struct mmc_cid {
unsigned int mid; /* 8 bit manufacturer id */
unsigned int oid; /* 16 bits 2 character ASCII - OEM ID */
unsigned char pnm[7]; /* 6 character ASCII - product name */
@@ -481,7 +481,7 @@
#define MMC_BOOT_SCR_BUS_WIDTH_4_BIT (1<<2)
};
-struct mmc_boot_card {
+struct mmc_card {
unsigned int rca;
unsigned int ocr;
unsigned long long capacity;
@@ -499,15 +499,15 @@
unsigned int rd_block_len;
unsigned int wr_block_len;
//unsigned int data_xfer_len;
- struct mmc_boot_cid cid;
- struct mmc_boot_csd csd;
+ struct mmc_cid cid;
+ struct mmc_csd csd;
struct mmc_boot_scr scr;
};
#define MMC_BOOT_XFER_MULTI_BLOCK 0
#define MMC_BOOT_XFER_SINGLE_BLOCK 1
-struct mmc_boot_host {
+struct mmc_host {
unsigned int mclk_rate;
unsigned int ocr;
unsigned int cmd_retry;
@@ -582,8 +582,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,
- struct mmc_boot_card *card,
+unsigned int mmc_boot_read_from_card(struct mmc_host *host,
+ struct mmc_card *card,
unsigned long long data_addr,
unsigned int data_len, unsigned int *out);
unsigned int mmc_write(unsigned long long data_addr,
@@ -593,16 +593,16 @@
unsigned int data_len);
unsigned mmc_get_psn(void);
-unsigned int mmc_boot_write_to_card(struct mmc_boot_host *host,
- struct mmc_boot_card *card,
+unsigned int mmc_boot_write_to_card(struct mmc_host *host,
+ struct mmc_card *card,
unsigned long long data_addr,
unsigned int data_len, unsigned int *in);
unsigned int mmc_erase_card(unsigned long long data_addr,
unsigned long long data_len);
-struct mmc_boot_host *get_mmc_host(void);
-struct mmc_boot_card *get_mmc_card(void);
+struct mmc_host *get_mmc_host(void);
+struct mmc_card *get_mmc_card(void);
void mmc_mclk_reg_wr_delay();
void mmc_boot_mci_clk_enable();
void mmc_boot_mci_clk_disable();
diff --git a/platform/msm_shared/include/partition_parser.h b/platform/msm_shared/include/partition_parser.h
index 57a92df..e5c1ff8 100644
--- a/platform/msm_shared/include/partition_parser.h
+++ b/platform/msm_shared/include/partition_parser.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -149,10 +149,10 @@
static void mbr_fill_name(struct partition_entry *partition_ent,
unsigned int type);
-unsigned int mmc_boot_read_gpt(struct mmc_boot_host *mmc_host,
- struct mmc_boot_card *mmc_card);
-unsigned int mmc_boot_read_mbr(struct mmc_boot_host *mmc_host,
- struct mmc_boot_card *mmc_card);
+unsigned int mmc_boot_read_gpt(struct mmc_host *mmc_host,
+ struct mmc_card *mmc_card);
+unsigned int mmc_boot_read_mbr(struct mmc_host *mmc_host,
+ struct mmc_card *mmc_card);
unsigned partition_get_index(const char *name);
unsigned long long partition_get_size(int index);
unsigned long long partition_get_offset(int index);
@@ -162,8 +162,8 @@
unsigned int *partition_type);
unsigned int partition_get_type(unsigned size, unsigned char *partition,
unsigned int *partition_type);
-unsigned int partition_read_table(struct mmc_boot_host *mmc_host,
- struct mmc_boot_card *mmc_card);
+unsigned int partition_read_table(struct mmc_host *mmc_host,
+ struct mmc_card *mmc_card);
unsigned int partition_parse_gpt_header(unsigned char *buffer,
unsigned long long *first_usable_lba,
unsigned int *partition_entry_size,
@@ -171,11 +171,11 @@
unsigned int *max_partition_count);
unsigned int write_mbr(unsigned size, unsigned char *mbrImage,
- struct mmc_boot_host *mmc_host,
- struct mmc_boot_card *mmc_card);
+ struct mmc_host *mmc_host,
+ struct mmc_card *mmc_card);
unsigned int write_gpt(unsigned size, unsigned char *gptImage,
- struct mmc_boot_host *mmc_host,
- struct mmc_boot_card *mmc_card);
+ struct mmc_host *mmc_host,
+ struct mmc_card *mmc_card);
unsigned int write_partition(unsigned size, unsigned char *partition);
/* For Debugging */
diff --git a/platform/msm_shared/mmc.c b/platform/msm_shared/mmc.c
index 8db6c11..5fb0b40 100644
--- a/platform/msm_shared/mmc.c
+++ b/platform/msm_shared/mmc.c
@@ -139,14 +139,14 @@
int mmc_clock_get_rate(unsigned id);
int mmc_clock_set_rate(unsigned id, unsigned rate);
-struct mmc_boot_host mmc_host;
-struct mmc_boot_card mmc_card;
+struct mmc_host mmc_host;
+struct mmc_card mmc_card;
static unsigned int mmc_wp(unsigned int addr, unsigned int size,
unsigned char set_clear_wp);
-static unsigned int mmc_boot_send_ext_cmd(struct mmc_boot_card *card,
+static unsigned int mmc_boot_send_ext_cmd(struct mmc_card *card,
unsigned char *buf);
-static unsigned int mmc_boot_read_reg(struct mmc_boot_card *card,
+static unsigned int mmc_boot_read_reg(struct mmc_card *card,
unsigned int data_len,
unsigned int command,
unsigned int addr, unsigned int *out);
@@ -172,8 +172,8 @@
/* Sets a timeout for read operation.
*/
static unsigned int
-mmc_boot_set_read_timeout(struct mmc_boot_host *host,
- struct mmc_boot_card *card)
+mmc_boot_set_read_timeout(struct mmc_host *host,
+ struct mmc_card *card)
{
unsigned int timeout_ns = 0;
@@ -202,8 +202,8 @@
/* Sets a timeout for write operation.
*/
static unsigned int
-mmc_boot_set_write_timeout(struct mmc_boot_host *host,
- struct mmc_boot_card *card)
+mmc_boot_set_write_timeout(struct mmc_host *host,
+ struct mmc_card *card)
{
unsigned int timeout_ns = 0;
@@ -235,14 +235,14 @@
* few of the CSD elements in csd structure. We'll only decode those values.
*/
static unsigned int
-mmc_boot_decode_and_save_csd(struct mmc_boot_card *card, unsigned int *raw_csd)
+mmc_boot_decode_and_save_csd(struct mmc_card *card, unsigned int *raw_csd)
{
unsigned int mmc_sizeof = 0;
unsigned int mmc_unit = 0;
unsigned int mmc_value = 0;
unsigned int mmc_temp = 0;
- struct mmc_boot_csd mmc_csd;
+ struct mmc_csd mmc_csd;
if ((card == NULL) || (raw_csd == NULL)) {
return MMC_BOOT_E_INVAL;
@@ -427,8 +427,8 @@
}
/* save the information in card structure */
- memcpy((struct mmc_boot_csd *)&card->csd,
- (struct mmc_boot_csd *)&mmc_csd, sizeof(struct mmc_boot_csd));
+ memcpy((struct mmc_csd *)&card->csd,
+ (struct mmc_csd *)&mmc_csd, sizeof(struct mmc_csd));
dprintf(SPEW, "Decoded CSD fields:\n");
dprintf(SPEW, "cmmc_structure: %d\n", mmc_csd.cmmc_structure);
@@ -456,9 +456,9 @@
* Decode CID sent by the card.
*/
static unsigned int
-mmc_boot_decode_and_save_cid(struct mmc_boot_card *card, unsigned int *raw_cid)
+mmc_boot_decode_and_save_cid(struct mmc_card *card, unsigned int *raw_cid)
{
- struct mmc_boot_cid mmc_cid;
+ struct mmc_cid mmc_cid;
unsigned int mmc_sizeof = 0;
int i = 0;
@@ -511,8 +511,8 @@
}
/* save it in card database */
- memcpy((struct mmc_boot_cid *)&card->cid,
- (struct mmc_boot_cid *)&mmc_cid, sizeof(struct mmc_boot_cid));
+ memcpy((struct mmc_cid *)&card->cid,
+ (struct mmc_cid *)&mmc_cid, sizeof(struct mmc_cid));
dprintf(SPEW, "Decoded CID fields:\n");
dprintf(SPEW, "Manufacturer ID: %x\n", mmc_cid.mid);
@@ -704,7 +704,7 @@
* Send CMD1 to know whether the card supports host VDD profile or not.
*/
static unsigned int
-mmc_boot_send_op_cond(struct mmc_boot_host *host, struct mmc_boot_card *card)
+mmc_boot_send_op_cond(struct mmc_host *host, struct mmc_card *card)
{
struct mmc_boot_command cmd;
unsigned int mmc_resp = 0;
@@ -760,7 +760,7 @@
/*
* Request any card to send its uniquie card identification (CID) number (CMD2).
*/
-static unsigned int mmc_boot_all_send_cid(struct mmc_boot_card *card)
+static unsigned int mmc_boot_all_send_cid(struct mmc_card *card)
{
struct mmc_boot_command cmd;
unsigned int mmc_ret = MMC_BOOT_E_SUCCESS;
@@ -799,7 +799,7 @@
* Ask any card to send it's relative card address (RCA).This RCA number is
* shorter than CID and is used by the host to address the card in future (CMD3)
*/
-static unsigned int mmc_boot_send_relative_address(struct mmc_boot_card *card)
+static unsigned int mmc_boot_send_relative_address(struct mmc_card *card)
{
struct mmc_boot_command cmd;
unsigned int mmc_ret = MMC_BOOT_E_SUCCESS;
@@ -850,7 +850,7 @@
* Requests card to send it's CSD register's contents. (CMD9)
*/
static unsigned int
-mmc_boot_send_csd(struct mmc_boot_card *card, unsigned int *raw_csd)
+mmc_boot_send_csd(struct mmc_card *card, unsigned int *raw_csd)
{
struct mmc_boot_command cmd;
unsigned int mmc_arg = 0;
@@ -893,7 +893,7 @@
* the card will be de-selected. (CMD7)
*/
static unsigned int
-mmc_boot_select_card(struct mmc_boot_card *card, unsigned int rca)
+mmc_boot_select_card(struct mmc_card *card, unsigned int rca)
{
struct mmc_boot_command cmd;
unsigned int mmc_arg = 0;
@@ -943,7 +943,7 @@
* Send command to set block length.
*/
static unsigned int
-mmc_boot_set_block_len(struct mmc_boot_card *card, unsigned int block_len)
+mmc_boot_set_block_len(struct mmc_card *card, unsigned int block_len)
{
struct mmc_boot_command cmd;
unsigned int mmc_ret = MMC_BOOT_E_SUCCESS;
@@ -983,7 +983,7 @@
* Requests the card to stop transmission of data.
*/
static unsigned int
-mmc_boot_send_stop_transmission(struct mmc_boot_card *card,
+mmc_boot_send_stop_transmission(struct mmc_card *card,
unsigned int prg_enabled)
{
struct mmc_boot_command cmd;
@@ -1020,7 +1020,7 @@
* Get the card's current status
*/
static unsigned int
-mmc_boot_get_card_status(struct mmc_boot_card *card,
+mmc_boot_get_card_status(struct mmc_card *card,
unsigned int prg_enabled, unsigned int *status)
{
struct mmc_boot_command cmd;
@@ -1098,7 +1098,7 @@
* Send ext csd command.
*/
static unsigned int
-mmc_boot_send_ext_cmd(struct mmc_boot_card *card, unsigned char *buf)
+mmc_boot_send_ext_cmd(struct mmc_card *card, unsigned char *buf)
{
struct mmc_boot_command cmd;
unsigned int mmc_ret = MMC_BOOT_E_SUCCESS;
@@ -1188,7 +1188,7 @@
* Switch command
*/
static unsigned int
-mmc_boot_switch_cmd(struct mmc_boot_card *card,
+mmc_boot_switch_cmd(struct mmc_card *card,
unsigned access, unsigned index, unsigned value)
{
@@ -1264,7 +1264,7 @@
* A command to set the data bus width for card. Set width to either
*/
static unsigned int
-mmc_boot_set_bus_width(struct mmc_boot_card *card, unsigned int width)
+mmc_boot_set_bus_width(struct mmc_card *card, unsigned int width)
{
unsigned int mmc_ret = MMC_BOOT_E_SUCCESS;
unsigned int mmc_reg = 0;
@@ -1307,7 +1307,7 @@
* CMD12 - STOP_TRANSMISSION.
*/
static unsigned int
-mmc_boot_send_read_command(struct mmc_boot_card *card,
+mmc_boot_send_read_command(struct mmc_card *card,
unsigned int xfer_type, unsigned int data_addr)
{
struct mmc_boot_command cmd;
@@ -1360,7 +1360,7 @@
* CMD12 - STOP_TRANSMISSION.
*/
static unsigned int
-mmc_boot_send_write_command(struct mmc_boot_card *card,
+mmc_boot_send_write_command(struct mmc_card *card,
unsigned int xfer_type, unsigned int data_addr)
{
struct mmc_boot_command cmd;
@@ -1411,8 +1411,8 @@
* multiple of blocks for block data transfer.
*/
unsigned int
-mmc_boot_write_to_card(struct mmc_boot_host *host,
- struct mmc_boot_card *card,
+mmc_boot_write_to_card(struct mmc_host *host,
+ struct mmc_card *card,
unsigned long long data_addr,
unsigned int data_len, unsigned int *in)
{
@@ -1573,8 +1573,8 @@
* Adjust the interface speed to optimal speed
*/
static unsigned int
-mmc_boot_adjust_interface_speed(struct mmc_boot_host *host,
- struct mmc_boot_card *card)
+mmc_boot_adjust_interface_speed(struct mmc_host *host,
+ struct mmc_card *card)
{
unsigned int mmc_ret = MMC_BOOT_E_SUCCESS;
@@ -1595,7 +1595,7 @@
}
static unsigned int
-mmc_boot_set_block_count(struct mmc_boot_card *card, unsigned int block_count)
+mmc_boot_set_block_count(struct mmc_card *card, unsigned int block_count)
{
struct mmc_boot_command cmd;
unsigned int mmc_ret = MMC_BOOT_E_SUCCESS;
@@ -1635,8 +1635,8 @@
* should be multiple of block size for block data transfer.
*/
unsigned int
-mmc_boot_read_from_card(struct mmc_boot_host *host,
- struct mmc_boot_card *card,
+mmc_boot_read_from_card(struct mmc_host *host,
+ struct mmc_card *card,
unsigned long long data_addr,
unsigned int data_len, unsigned int *out)
{
@@ -1790,7 +1790,7 @@
/*
* Initialize host structure, set and enable clock-rate and power mode.
*/
-unsigned int mmc_boot_init(struct mmc_boot_host *host)
+unsigned int mmc_boot_init(struct mmc_host *host)
{
unsigned int mmc_ret = MMC_BOOT_E_SUCCESS;
unsigned int mmc_pwr = 0;
@@ -1832,7 +1832,7 @@
* - get Extended CSD (for mmc)
*/
static unsigned int
-mmc_boot_identify_card(struct mmc_boot_host *host, struct mmc_boot_card *card)
+mmc_boot_identify_card(struct mmc_host *host, struct mmc_card *card)
{
unsigned int mmc_return = MMC_BOOT_E_SUCCESS;
unsigned int raw_csd[4];
@@ -1946,7 +1946,7 @@
return MMC_BOOT_E_SUCCESS;
}
-static unsigned int mmc_boot_sd_init_card(struct mmc_boot_card *card)
+static unsigned int mmc_boot_sd_init_card(struct mmc_card *card)
{
unsigned int i, mmc_ret;
unsigned int ocr_cmd_arg;
@@ -2008,7 +2008,7 @@
* voltage and set the card inready state.
*/
static unsigned int
-mmc_boot_init_card(struct mmc_boot_host *host, struct mmc_boot_card *card)
+mmc_boot_init_card(struct mmc_host *host, struct mmc_card *card)
{
unsigned int mmc_retry = 0;
unsigned int mmc_return = MMC_BOOT_E_SUCCESS;
@@ -2065,7 +2065,7 @@
}
static unsigned int
-mmc_boot_set_sd_bus_width(struct mmc_boot_card *card, unsigned int width)
+mmc_boot_set_sd_bus_width(struct mmc_card *card, unsigned int width)
{
struct mmc_boot_command cmd;
unsigned int mmc_ret = MMC_BOOT_E_SUCCESS;
@@ -2116,7 +2116,7 @@
}
static unsigned int
-mmc_boot_set_sd_hs(struct mmc_boot_host *host, struct mmc_boot_card *card)
+mmc_boot_set_sd_hs(struct mmc_host *host, struct mmc_card *card)
{
unsigned char sw_buf[64];
unsigned int mmc_ret;
@@ -2144,8 +2144,8 @@
*/
static unsigned int
-mmc_boot_init_and_identify_cards(struct mmc_boot_host *host,
- struct mmc_boot_card *card)
+mmc_boot_init_and_identify_cards(struct mmc_host *host,
+ struct mmc_card *card)
{
unsigned int mmc_return = MMC_BOOT_E_SUCCESS;
unsigned int status;
@@ -2255,10 +2255,10 @@
{
unsigned int mmc_ret = MMC_BOOT_E_SUCCESS;
- memset((struct mmc_boot_host *)&mmc_host, 0,
- sizeof(struct mmc_boot_host));
- memset((struct mmc_boot_card *)&mmc_card, 0,
- sizeof(struct mmc_boot_card));
+ memset((struct mmc_host *)&mmc_host, 0,
+ sizeof(struct mmc_host));
+ memset((struct mmc_card *)&mmc_card, 0,
+ sizeof(struct mmc_card));
mmc_slot = slot;
mmc_boot_mci_base = base;
@@ -2344,7 +2344,7 @@
* Function to read registers from MMC or SD card
*/
static unsigned int
-mmc_boot_read_reg(struct mmc_boot_card *card,
+mmc_boot_read_reg(struct mmc_card *card,
unsigned int data_len,
unsigned int command, unsigned int addr, unsigned int *out)
{
@@ -2413,7 +2413,7 @@
* Function to set/clear power-on write protection for the user area partitions
*/
static unsigned int
-mmc_boot_set_clr_power_on_wp_user(struct mmc_boot_card *card,
+mmc_boot_set_clr_power_on_wp_user(struct mmc_card *card,
unsigned int addr,
unsigned int size, unsigned char set_clear_wp)
{
@@ -2538,7 +2538,7 @@
* Function to get Write Protect status of the given sector
*/
static unsigned int
-mmc_boot_get_wp_status(struct mmc_boot_card *card, unsigned int sector)
+mmc_boot_get_wp_status(struct mmc_card *card, unsigned int sector)
{
unsigned int rc = MMC_BOOT_E_SUCCESS;
memset(wp_status_buf, 0, 8);
@@ -2735,7 +2735,7 @@
*/
static unsigned int
-mmc_boot_send_erase_group_start(struct mmc_boot_card *card,
+mmc_boot_send_erase_group_start(struct mmc_card *card,
unsigned long long data_addr)
{
struct mmc_boot_command cmd;
@@ -2770,7 +2770,7 @@
* CMD36 ERASE GROUP END
*/
static unsigned int
-mmc_boot_send_erase_group_end(struct mmc_boot_card *card,
+mmc_boot_send_erase_group_end(struct mmc_card *card,
unsigned long long data_addr)
{
struct mmc_boot_command cmd;
@@ -2803,7 +2803,7 @@
/*
* CMD38 ERASE
*/
-static unsigned int mmc_boot_send_erase(struct mmc_boot_card *card)
+static unsigned int mmc_boot_send_erase(struct mmc_card *card)
{
struct mmc_boot_command cmd;
@@ -2943,12 +2943,12 @@
return MMC_BOOT_E_SUCCESS;
}
-struct mmc_boot_host *get_mmc_host(void)
+struct mmc_host *get_mmc_host(void)
{
return &mmc_host;
}
-struct mmc_boot_card *get_mmc_card(void)
+struct mmc_card *get_mmc_card(void)
{
return &mmc_card;
}
diff --git a/platform/msm_shared/partition_parser.c b/platform/msm_shared/partition_parser.c
index 7172425..dc985db 100644
--- a/platform/msm_shared/partition_parser.c
+++ b/platform/msm_shared/partition_parser.c
@@ -44,8 +44,8 @@
//TODO: Remove the dependency of mmc in these functions
unsigned int
-partition_read_table(struct mmc_boot_host *mmc_host,
- struct mmc_boot_card *mmc_card)
+partition_read_table(struct mmc_host *mmc_host,
+ struct mmc_card *mmc_card)
{
unsigned int ret;
@@ -71,8 +71,8 @@
* Read MBR from MMC card and fill partition table.
*/
unsigned int
-mmc_boot_read_mbr(struct mmc_boot_host *mmc_host,
- struct mmc_boot_card *mmc_card)
+mmc_boot_read_mbr(struct mmc_host *mmc_host,
+ struct mmc_card *mmc_card)
{
unsigned char buffer[BLOCK_SIZE];
unsigned int dtype;
@@ -191,8 +191,8 @@
* Read GPT from MMC and fill partition table
*/
unsigned int
-mmc_boot_read_gpt(struct mmc_boot_host *mmc_host,
- struct mmc_boot_card *mmc_card)
+mmc_boot_read_gpt(struct mmc_host *mmc_host,
+ struct mmc_card *mmc_card)
{
int ret = MMC_BOOT_E_SUCCESS;
@@ -386,7 +386,7 @@
/* Write the MBR/EBR to the MMC. */
unsigned int
write_mbr(unsigned size, unsigned char *mbrImage,
- struct mmc_boot_host *mmc_host, struct mmc_boot_card *mmc_card)
+ struct mmc_host *mmc_host, struct mmc_card *mmc_card)
{
unsigned int ret;
@@ -494,7 +494,7 @@
static void
patch_gpt(unsigned char *gptImage,
- struct mmc_boot_card *mmc_card,
+ struct mmc_card *mmc_card,
unsigned int array_size,
unsigned int max_part_count, unsigned int part_entry_size)
{
@@ -571,7 +571,7 @@
*/
unsigned int
write_gpt(unsigned size, unsigned char *gptImage,
- struct mmc_boot_host *mmc_host, struct mmc_boot_card *mmc_card)
+ struct mmc_host *mmc_host, struct mmc_card *mmc_card)
{
unsigned int ret = MMC_BOOT_E_INVAL;
unsigned int header_size;
@@ -695,8 +695,8 @@
{
unsigned int ret = MMC_BOOT_E_INVAL;
unsigned int partition_type;
- struct mmc_boot_host *mmc_host;
- struct mmc_boot_card *mmc_card;
+ struct mmc_host *mmc_host;
+ struct mmc_card *mmc_card;
if (partition == 0) {
dprintf(CRITICAL, "NULL partition\n");