Clean up warnings in lk code
Change-Id: I05b3a6cf07cde7e60586b1816c2f1279f64f5cf4
This commit is contained in:
1 parent
d8b7afc7da
commit
d625055fcc
30 files changed
+167
-134
No files matched your search
+30
-44
@@ -43,6 +43,9 @@
|
||||
#include <dev/keys.h>
|
||||
#include <dev/fbcon.h>
|
||||
#include <baseband.h>
|
||||
#include <target.h>
|
||||
#include <mmc.h>
|
||||
#include <platform.h>
|
||||
|
||||
#include "recovery.h"
|
||||
#include "bootimg.h"
|
||||
@@ -90,27 +93,16 @@ struct atag_ptbl_entry
|
||||
};
|
||||
|
||||
char sn_buf[13];
|
||||
void platform_uninit_timer(void);
|
||||
unsigned* target_atag_mem(unsigned* ptr);
|
||||
unsigned board_machtype(void);
|
||||
unsigned check_reboot_mode(void);
|
||||
void *target_get_scratch_address(void);
|
||||
unsigned target_get_max_flash_size(void);
|
||||
int target_is_emmc_boot(void);
|
||||
void reboot_device(unsigned);
|
||||
void target_battery_charging_enable(unsigned enable, unsigned disconnect);
|
||||
unsigned int mmc_write (unsigned long long data_addr,
|
||||
unsigned int data_len, unsigned int* in);
|
||||
unsigned long long mmc_ptn_offset (unsigned char * name);
|
||||
unsigned long long mmc_ptn_size (unsigned char * name);
|
||||
void display_shutdown(void);
|
||||
|
||||
|
||||
|
||||
static void ptentry_to_tag(unsigned **ptr, struct ptentry *ptn)
|
||||
{
|
||||
struct atag_ptbl_entry atag_ptn;
|
||||
|
||||
if (ptn->type == TYPE_MODEM_PARTITION)
|
||||
if (ptn->type == TYPE_MODEM_PARTITION) {
|
||||
return;
|
||||
}
|
||||
memcpy(atag_ptn.name, ptn->name, 16);
|
||||
atag_ptn.name[15] = '\0';
|
||||
atag_ptn.offset = ptn->start;
|
||||
@@ -305,24 +297,21 @@ int boot_linux_from_mmc(void)
|
||||
hdr = uhdr;
|
||||
goto unified_boot;
|
||||
}
|
||||
if(!boot_into_recovery)
|
||||
{
|
||||
ptn = mmc_ptn_offset("boot");
|
||||
if(ptn == 0) {
|
||||
if (!boot_into_recovery) {
|
||||
ptn = mmc_ptn_offset((unsigned char *) "boot");
|
||||
if (ptn == 0) {
|
||||
dprintf(CRITICAL, "ERROR: No boot partition found\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ptn = mmc_ptn_offset("recovery");
|
||||
if(ptn == 0) {
|
||||
} else {
|
||||
ptn = mmc_ptn_offset((unsigned char *) "recovery");
|
||||
if (ptn == 0) {
|
||||
dprintf(CRITICAL, "ERROR: No recovery partition found\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (mmc_read(ptn + offset, (unsigned int *)buf, page_size)) {
|
||||
if (mmc_read(ptn + offset, (unsigned int *) buf, page_size)) {
|
||||
dprintf(CRITICAL, "ERROR: Cannot read boot image header\n");
|
||||
return -1;
|
||||
}
|
||||
@@ -542,8 +531,8 @@ void cmd_erase_mmc(const char *arg, void *data, unsigned sz)
|
||||
unsigned long long ptn = 0;
|
||||
unsigned int out[512] = {0};
|
||||
|
||||
ptn = mmc_ptn_offset(arg);
|
||||
if(ptn == 0) {
|
||||
ptn = mmc_ptn_offset((unsigned char *) arg);
|
||||
if (ptn == 0) {
|
||||
fastboot_fail("partition table doesn't exist");
|
||||
return;
|
||||
}
|
||||
@@ -564,8 +553,8 @@ void cmd_flash_mmc_img(const char *arg, void *data, unsigned sz)
|
||||
unsigned long long ptn = 0;
|
||||
unsigned long long size = 0;
|
||||
|
||||
ptn = mmc_ptn_offset(arg);
|
||||
if(ptn == 0) {
|
||||
ptn = mmc_ptn_offset((unsigned char *) arg);
|
||||
if (ptn == 0) {
|
||||
fastboot_fail("partition table doesn't exist");
|
||||
return;
|
||||
}
|
||||
@@ -577,13 +566,13 @@ void cmd_flash_mmc_img(const char *arg, void *data, unsigned sz)
|
||||
}
|
||||
}
|
||||
|
||||
size = mmc_ptn_size(arg);
|
||||
if (ROUND_TO_PAGE(sz,511) > size) {
|
||||
size = mmc_ptn_size((unsigned char *) arg);
|
||||
if (ROUND_TO_PAGE(sz, 511) > size) {
|
||||
fastboot_fail("size too large");
|
||||
return;
|
||||
}
|
||||
|
||||
if (mmc_write(ptn , sz, (unsigned int *)data)) {
|
||||
if (mmc_write(ptn , sz, (unsigned int *) data)) {
|
||||
fastboot_fail("flash write failure");
|
||||
return;
|
||||
}
|
||||
@@ -591,19 +580,19 @@ void cmd_flash_mmc_img(const char *arg, void *data, unsigned sz)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void cmd_flash_mmc_sparse_img(const char *arg, void *data, unsigned sz)
|
||||
{
|
||||
unsigned int chunk;
|
||||
unsigned int chunk_data_sz;
|
||||
sparse_header_t *sparse_header;
|
||||
chunk_header_t *chunk_header;
|
||||
uint32_t crc32 = 0;
|
||||
uint32_t total_blocks = 0;
|
||||
unsigned long long ptn = 0;
|
||||
unsigned long long size = 0;
|
||||
|
||||
ptn = mmc_ptn_offset(arg);
|
||||
if(ptn == 0) {
|
||||
ptn = mmc_ptn_offset((unsigned char *) arg);
|
||||
if (ptn == 0) {
|
||||
fastboot_fail("partition table doesn't exist");
|
||||
return;
|
||||
}
|
||||
@@ -714,10 +703,9 @@ void cmd_flash_mmc(const char *arg, void *data, unsigned sz)
|
||||
magic_number[1] == SSD_HEADER_MAGIC_1)
|
||||
{
|
||||
#ifdef SSD_ENABLE
|
||||
ret = decrypt_img_scm(&data, &sz);
|
||||
ret = decrypt_img_scm((uint32 **) &data, &sz);
|
||||
#endif
|
||||
if(ret != 0)
|
||||
{
|
||||
if (ret != 0) {
|
||||
dprintf(CRITICAL, "ERROR: Invalid secure image\n");
|
||||
return;
|
||||
}
|
||||
@@ -814,7 +802,7 @@ void splash_screen ()
|
||||
ptable = flash_get_ptable();
|
||||
if (ptable == NULL) {
|
||||
dprintf(CRITICAL, "ERROR: Partition table not found\n");
|
||||
return -1;
|
||||
return;
|
||||
}
|
||||
|
||||
ptn = ptable_find(ptable, "splash");
|
||||
@@ -836,7 +824,6 @@ void splash_screen ()
|
||||
void aboot_init(const struct app_descriptor *app)
|
||||
{
|
||||
unsigned reboot_mode = 0;
|
||||
unsigned disp_init = 0;
|
||||
unsigned usb_init = 0;
|
||||
unsigned sz = 0;
|
||||
|
||||
@@ -856,11 +843,10 @@ void aboot_init(const struct app_descriptor *app)
|
||||
#if DISPLAY_SPLASH_SCREEN
|
||||
display_init();
|
||||
dprintf(SPEW, "Diplay initialized\n");
|
||||
disp_init = 1;
|
||||
diplay_image_on_screen();
|
||||
display_image_on_screen();
|
||||
#endif
|
||||
|
||||
target_serialno(sn_buf);
|
||||
target_serialno((unsigned char *) sn_buf);
|
||||
dprintf(SPEW,"serial number: %s\n",sn_buf);
|
||||
surf_udc_device.serialno = sn_buf;
|
||||
|
||||
|
||||
@@ -258,7 +258,7 @@ static void cmd_download(const char *arg, void *data, unsigned sz)
|
||||
return;
|
||||
|
||||
r = usb_read(download_base, len);
|
||||
if ((r < 0) || (r != len)) {
|
||||
if ((r < 0) || ((unsigned) r != len)) {
|
||||
fastboot_state = STATE_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
+11
-11
@@ -1,4 +1,4 @@
|
||||
/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
|
||||
/* Copyright (c) 2010-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
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <dev/flash.h>
|
||||
#include <lib/ptable.h>
|
||||
#include <dev/keys.h>
|
||||
#include <platform.h>
|
||||
|
||||
#include "recovery.h"
|
||||
#include "bootimg.h"
|
||||
@@ -50,8 +51,6 @@ static const int MISC_COMMAND_PAGE = 1; // bootloader command is this page
|
||||
static char buf[4096];
|
||||
unsigned boot_into_recovery = 0;
|
||||
|
||||
void reboot_device(unsigned);
|
||||
extern int target_is_emmc_boot(void);
|
||||
|
||||
int get_recovery_message(struct recovery_message *out)
|
||||
{
|
||||
@@ -74,7 +73,7 @@ int get_recovery_message(struct recovery_message *out)
|
||||
}
|
||||
|
||||
offset += (pagesize * MISC_COMMAND_PAGE);
|
||||
if (flash_read(ptn, offset, buf, pagesize)) {
|
||||
if (flash_read(ptn, offset, (void *) buf, pagesize)) {
|
||||
dprintf(CRITICAL, "ERROR: Cannot read recovery_header\n");
|
||||
return -1;
|
||||
}
|
||||
@@ -105,18 +104,19 @@ int set_recovery_message(const struct recovery_message *in)
|
||||
|
||||
n = pagesize * (MISC_COMMAND_PAGE + 1);
|
||||
|
||||
if (flash_read(ptn, offset, SCRATCH_ADDR, n)) {
|
||||
if (flash_read(ptn, offset, (void *) SCRATCH_ADDR, n)) {
|
||||
dprintf(CRITICAL, "ERROR: Cannot read recovery_header\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
offset += (pagesize * MISC_COMMAND_PAGE);
|
||||
offset += SCRATCH_ADDR;
|
||||
memcpy(offset, in, sizeof(*in));
|
||||
memcpy((void *) offset, in, sizeof(*in));
|
||||
if (flash_write(ptn, 0, (void *)SCRATCH_ADDR, n)) {
|
||||
dprintf(CRITICAL, "ERROR: flash write fail!\n");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int read_update_header_for_bootloader(struct update_header *header)
|
||||
@@ -143,7 +143,7 @@ int read_update_header_for_bootloader(struct update_header *header)
|
||||
}
|
||||
memcpy(header, buf, sizeof(*header));
|
||||
|
||||
if(strncmp(header->MAGIC, UPDATE_MAGIC, UPDATE_MAGIC_SIZE))
|
||||
if (strncmp((char *) header->MAGIC, UPDATE_MAGIC, UPDATE_MAGIC_SIZE))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
@@ -174,7 +174,7 @@ int update_firmware_image (struct update_header *header, char *name)
|
||||
offset += header->image_offset;
|
||||
n = (header->image_length + pagemask) & (~pagemask);
|
||||
|
||||
if (flash_read(ptn, offset, SCRATCH_ADDR, n)) {
|
||||
if (flash_read(ptn, offset, (void *) SCRATCH_ADDR, n)) {
|
||||
dprintf(CRITICAL, "ERROR: Cannot read radio image\n");
|
||||
return -1;
|
||||
}
|
||||
@@ -185,7 +185,7 @@ int update_firmware_image (struct update_header *header, char *name)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (flash_write(ptn, 0, SCRATCH_ADDR, n)) {
|
||||
if (flash_write(ptn, 0, (void *) SCRATCH_ADDR, n)) {
|
||||
dprintf(CRITICAL, "ERROR: flash write fail!\n");
|
||||
return -1;
|
||||
}
|
||||
@@ -290,10 +290,10 @@ int recovery_init (void)
|
||||
int update_status = 0;
|
||||
|
||||
// get recovery message
|
||||
if(get_recovery_message(&msg))
|
||||
if (get_recovery_message(&msg))
|
||||
return -1;
|
||||
if (msg.command[0] != 0 && msg.command[0] != 255) {
|
||||
dprintf("Recovery command: %.*s\n", sizeof(msg.command), msg.command);
|
||||
dprintf(INFO, "Recovery command: %.*s\n", sizeof(msg.command), msg.command);
|
||||
}
|
||||
msg.command[sizeof(msg.command)-1] = '\0'; //Ensure termination
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <jtag.h>
|
||||
#include <kernel/thread.h>
|
||||
#include <smem.h>
|
||||
#include <platform.h>
|
||||
#include "bootimg.h"
|
||||
|
||||
#define FLASH_PAGE_SIZE 2048
|
||||
@@ -49,12 +50,11 @@ static unsigned load_addr = 0xffffffff;
|
||||
#define ROUND_TO_PAGE(x,y) (((x) + (y)) & (~(y)))
|
||||
|
||||
void acpu_clock_init(void);
|
||||
void platform_uninit_timer(void);
|
||||
|
||||
int startswith(const char *str, const char *prefix)
|
||||
{
|
||||
while(*prefix){
|
||||
if(*prefix++ != *str++) return 0;
|
||||
if (*prefix++ != *str++) return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
+4
-2
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2008, 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
|
||||
@@ -33,6 +33,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <dev/fbcon.h>
|
||||
#include <splash.h>
|
||||
#include <platform.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "font5x12.h"
|
||||
|
||||
@@ -206,7 +208,7 @@ struct fbcon_config* fbcon_display(void)
|
||||
return config;
|
||||
}
|
||||
|
||||
void diplay_image_on_screen(void)
|
||||
void display_image_on_screen(void)
|
||||
{
|
||||
unsigned i = 0;
|
||||
unsigned total_x = config->width;
|
||||
|
||||
+11
-9
@@ -42,6 +42,8 @@
|
||||
#include <kernel/timer.h>
|
||||
#include <reg.h>
|
||||
#include <platform/iomap.h>
|
||||
#include <platform/timer.h>
|
||||
#include <platform.h>
|
||||
|
||||
#define LINUX_MACHTYPE_8660_QT 3298
|
||||
|
||||
@@ -593,24 +595,24 @@ scan_qt_keypad(struct timer *timer, time_t now, void *arg)
|
||||
static int key_detected=-1;
|
||||
|
||||
/* Row GPIOs 8,9,10 are used for sensing here */
|
||||
for(gpio=8;gpio<=10;gpio++)
|
||||
for (gpio=8;gpio<=10;gpio++)
|
||||
{
|
||||
bool status;
|
||||
status = pm8058_gpio_get(gpio);
|
||||
if(status == 0)
|
||||
if (status == 0)
|
||||
new_state |= (1<<(gpio-8));
|
||||
}
|
||||
|
||||
bits_changed = last_state ^ new_state;
|
||||
|
||||
if(bits_changed)
|
||||
if (bits_changed)
|
||||
{
|
||||
int shift;
|
||||
for(int rows=0;rows<(qwerty_keypad->keypad_info)->rows;rows++)
|
||||
int shift = 0;
|
||||
for (unsigned int rows = 0; rows < (qwerty_keypad->keypad_info)->rows; rows++)
|
||||
{
|
||||
if((bits_changed & (1<<rows)) == 0)
|
||||
if ((bits_changed & (1<<rows)) == 0)
|
||||
continue;
|
||||
shift = rows*8 + 3;
|
||||
shift = rows * 8 + 3;
|
||||
}
|
||||
if ((qwerty_keypad->keypad_info)->keymap[shift])
|
||||
{
|
||||
@@ -665,9 +667,9 @@ void ssbi_keypad_init(struct qwerty_keypad_info *qwerty_kp)
|
||||
void pmic_write(unsigned address, unsigned data)
|
||||
{
|
||||
write_func wr_function = &i2c_ssbi_write_bytes;
|
||||
if(wr_function == NULL)
|
||||
if (wr_function == NULL)
|
||||
return;
|
||||
if ((*wr_function)(&data, 1, address))
|
||||
if ((*wr_function)((unsigned char *) &data, 1, address))
|
||||
dprintf (CRITICAL, "Error in initializing register\n");
|
||||
|
||||
}
|
||||
|
||||
@@ -210,6 +210,8 @@ struct pm8058_gpio {
|
||||
int inv_int_pol; /* invert interrupt polarity */
|
||||
};
|
||||
|
||||
bool pm8058_gpio_get(unsigned int gpio);
|
||||
|
||||
typedef int (*read_func)(unsigned char *, unsigned short, unsigned short);
|
||||
typedef int (*write_func)(unsigned char *, unsigned short, unsigned short);
|
||||
|
||||
|
||||
@@ -35,4 +35,14 @@ void platform_init(void);
|
||||
/* called by the arch init code to get the platform to set up any mmu mappings it may need */
|
||||
void platform_init_mmu_mappings(void);
|
||||
|
||||
void display_init(void);
|
||||
void display_shutdown(void);
|
||||
void display_image_on_screen(void);
|
||||
|
||||
unsigned board_machtype(void);
|
||||
unsigned check_reboot_mode(void);
|
||||
void platform_uninit_timer(void);
|
||||
void reboot_device(unsigned);
|
||||
|
||||
|
||||
#endif
|
||||
@@ -27,5 +27,9 @@ typedef enum handler_return (*platform_timer_callback)(void *arg, time_t now);
|
||||
|
||||
status_t platform_set_periodic_timer(platform_timer_callback callback, void *arg, time_t interval);
|
||||
|
||||
void mdelay(unsigned msecs);
|
||||
void udelay(unsigned usecs);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -38,4 +38,15 @@ unsigned target_get_max_flash_size(void);
|
||||
/* if target is using eMMC bootup */
|
||||
int target_is_emmc_boot(void);
|
||||
|
||||
unsigned* target_atag_mem(unsigned* ptr);
|
||||
void *target_get_scratch_address(void);
|
||||
unsigned target_get_max_flash_size(void);
|
||||
int target_is_emmc_boot(void);
|
||||
void target_battery_charging_enable(unsigned enable, unsigned disconnect);
|
||||
unsigned target_pause_for_battery_charge(void);
|
||||
unsigned target_baseband(void);
|
||||
void target_serialno(unsigned char *buf);
|
||||
void target_fastboot_init(void);
|
||||
|
||||
|
||||
#endif
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
* Copyright (C) 2008 The Android Open Source Project
|
||||
* 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
|
||||
@@ -68,7 +68,7 @@ void ptable_dump(struct ptable *ptable)
|
||||
ptn = &ptable->parts[i];
|
||||
dprintf(INFO, "ptn %d name='%s' start=%08x len=%08x "
|
||||
"flags=%08x type=%s Writable=%s\n", i, ptn->name, ptn->start, ptn->length,
|
||||
ptn->flags, ptype[ptn->type], pperm[ptn->perm]);
|
||||
ptn->flags, ptype[(unsigned short) ptn->type], pperm[(unsigned short) ptn->perm]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ unsigned udc_string_desc_alloc(const char *str)
|
||||
|
||||
__WEAK void hsusb_clock_init(void)
|
||||
{
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
#if 1
|
||||
|
||||
@@ -625,10 +625,20 @@ struct mbr_entry
|
||||
#define MMC_CLK_ENABLE 1
|
||||
#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 long long data_addr,
|
||||
unsigned int data_len,
|
||||
unsigned int* out );
|
||||
unsigned int mmc_write (unsigned long long data_addr,
|
||||
unsigned int data_len, unsigned int* in);
|
||||
unsigned long long mmc_ptn_offset (unsigned char * name);
|
||||
unsigned long long mmc_ptn_size (unsigned char * name);
|
||||
|
||||
unsigned int mmc_read (unsigned long long data_addr, unsigned int* out,
|
||||
unsigned int data_len);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
|
||||
/* Copyright (c) 2010-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
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <mipi_dsi.h>
|
||||
#include <dev/fbcon.h>
|
||||
#include <target/display.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define MIPI_FB_ADDR 0x43E00000
|
||||
|
||||
@@ -68,6 +69,8 @@ static struct fbcon_config mipi_fb_cfg = {
|
||||
#endif
|
||||
|
||||
static int cmd_mode_status = 0;
|
||||
void secure_writel(uint32_t, uint32_t);
|
||||
uint32_t secure_readl(uint32_t);
|
||||
|
||||
void configure_dsicore_dsiclk()
|
||||
{
|
||||
@@ -113,8 +116,6 @@ void configure_dsicore_pclk(void)
|
||||
int mipi_dsi_phy_ctrl_config(struct mipi_dsi_panel_config *pinfo)
|
||||
{
|
||||
|
||||
unsigned char lane_1 = 1;
|
||||
unsigned char lane_2 = 2;
|
||||
unsigned i;
|
||||
unsigned off = 0;
|
||||
struct mipi_dsi_phy_ctrl *pd;
|
||||
@@ -325,8 +326,6 @@ int mipi_dsi_panel_initialize(struct mipi_dsi_panel_config *pinfo)
|
||||
unsigned short WC1 = 0; // for non embedded mode only
|
||||
int status = 0;
|
||||
unsigned char DLNx_EN;
|
||||
unsigned char lane_1 = 1;
|
||||
unsigned char lane_2 = 2;
|
||||
|
||||
switch (pinfo->num_of_lanes) {
|
||||
default:
|
||||
@@ -459,10 +458,8 @@ int config_dsi_cmd_mode(unsigned short disp_width, unsigned short disp_height,
|
||||
unsigned char DLNx_EN;
|
||||
// video mode data ctrl
|
||||
int status = 0;
|
||||
unsigned long low_pwr_stop_mode = 0;
|
||||
unsigned char eof_bllp_pwr = 0x9;
|
||||
unsigned char interleav = 0;
|
||||
unsigned char ystride = 0x03;
|
||||
unsigned char interleav = 0;
|
||||
unsigned char ystride = 0x03;
|
||||
// disable mdp first
|
||||
|
||||
writel(0x00000000, DSI_CLK_CTRL);
|
||||
@@ -647,26 +644,9 @@ int mipi_dsi_cmd_config(unsigned short num_of_lanes)
|
||||
{
|
||||
|
||||
int status = 0;
|
||||
unsigned long ReadValue;
|
||||
unsigned long count = 0;
|
||||
unsigned long input_img_addr = MIPI_FB_ADDR;
|
||||
unsigned long low_pwr_stop_mode = 0; // low power mode 0x1111 start from
|
||||
// bit16, high spd mode 0x0
|
||||
unsigned char eof_bllp_pwr = 0x9; // bit 12, 15, 1:low power stop mode or
|
||||
// let cmd mode eng send packets in hs
|
||||
// or lp mode
|
||||
unsigned short display_wd = mipi_fb_cfg.width;
|
||||
unsigned short display_ht = mipi_fb_cfg.height;
|
||||
unsigned short image_wd = mipi_fb_cfg.width;
|
||||
unsigned short image_ht = mipi_fb_cfg.height;
|
||||
unsigned short hsync_porch_fp = MIPI_HSYNC_FRONT_PORCH_DCLK;
|
||||
unsigned short hsync_porch_bp = MIPI_HSYNC_BACK_PORCH_DCLK;
|
||||
unsigned short vsync_porch_fp = MIPI_VSYNC_FRONT_PORCH_LINES;
|
||||
unsigned short vsync_porch_bp = MIPI_VSYNC_BACK_PORCH_LINES;
|
||||
unsigned short hsync_width = MIPI_HSYNC_PULSE_WIDTH;
|
||||
unsigned short vsync_width = MIPI_VSYNC_PULSE_WIDTH;
|
||||
unsigned short dst_format = 0;
|
||||
unsigned short traffic_mode = 0;
|
||||
unsigned short pack_pattern = 0x12;
|
||||
unsigned char ystride = 3;
|
||||
|
||||
@@ -735,7 +715,6 @@ void mipi_dsi_shutdown(void)
|
||||
struct fbcon_config *mipi_init(void)
|
||||
{
|
||||
int status = 0;
|
||||
unsigned char num_of_lanes = 1;
|
||||
struct mipi_dsi_panel_config *panel_info = get_panel_info();
|
||||
writel(0x00001800, MMSS_SFPB_GPREG);
|
||||
configure_dsicore_dsiclk();
|
||||
|
||||
+34
-27
@@ -33,6 +33,7 @@
|
||||
#include "mmc.h"
|
||||
#include "partition_parser.h"
|
||||
#include <platform/iomap.h>
|
||||
#include <platform/timer.h>
|
||||
|
||||
#if MMC_BOOT_ADM
|
||||
#include "adm.h"
|
||||
@@ -77,8 +78,10 @@ char *vfat_partitions[] = {"modem", "mdm", "NONE"};
|
||||
unsigned int ext3_count = 0;
|
||||
unsigned int vfat_count = 0;
|
||||
|
||||
#if !(defined(PLATFORM_MSM8X60) || defined(PLATFORM_MSM8960))
|
||||
static unsigned mmc_sdc_clk[] = { SDC1_CLK, SDC2_CLK, SDC3_CLK, SDC4_CLK};
|
||||
static unsigned mmc_sdc_pclk[] = { SDC1_PCLK, SDC2_PCLK, SDC3_PCLK, SDC4_PCLK};
|
||||
#endif
|
||||
|
||||
unsigned char mmc_slot = 0;
|
||||
unsigned int mmc_boot_mci_base = 0;
|
||||
@@ -89,7 +92,6 @@ static unsigned char wp_status_buf[8];
|
||||
int mmc_clock_enable_disable(unsigned id, unsigned enable);
|
||||
int mmc_clock_get_rate(unsigned id);
|
||||
int mmc_clock_set_rate(unsigned id, unsigned rate);
|
||||
void mdelay(unsigned msecs);
|
||||
|
||||
struct mmc_boot_host mmc_host;
|
||||
struct mmc_boot_card mmc_card;
|
||||
@@ -97,8 +99,6 @@ struct mbr_entry mbr[MAX_PARTITIONS];
|
||||
unsigned mmc_partition_count = 0;
|
||||
static unsigned gpt_partitions_exist = 0;
|
||||
|
||||
unsigned int mmc_read (unsigned long long data_addr, unsigned int* out,
|
||||
unsigned int data_len);
|
||||
static void mbr_fill_name (struct mbr_entry *mbr_ent, unsigned int type);
|
||||
static unsigned int mmc_wp(unsigned int addr, unsigned int size,
|
||||
unsigned char set_clear_wp);
|
||||
@@ -108,6 +108,7 @@ static unsigned int mmc_boot_read_reg(struct mmc_boot_card *card,
|
||||
unsigned int data_len,
|
||||
unsigned int command, unsigned int addr,
|
||||
unsigned int *out);
|
||||
void clock_set_enable(unsigned slot, unsigned int mclk);
|
||||
|
||||
unsigned int SWAP_ENDIAN(unsigned int val)
|
||||
{
|
||||
@@ -1683,20 +1684,19 @@ unsigned int mmc_boot_read_from_card( struct mmc_boot_host* host,
|
||||
unsigned int mmc_reg = 0;
|
||||
unsigned int xfer_type;
|
||||
unsigned int addr = 0;
|
||||
unsigned int read_error;
|
||||
unsigned char open_ended_read = 1;
|
||||
|
||||
if( ( host == NULL ) || ( card == NULL ) )
|
||||
if ( ( host == NULL ) || ( card == NULL ) )
|
||||
{
|
||||
return MMC_BOOT_E_INVAL;
|
||||
}
|
||||
|
||||
/* Set block length. High Capacity MMC/SD card uses fixed 512 bytes block
|
||||
length. So no need to send CMD16. */
|
||||
if( (card->type != MMC_BOOT_TYPE_MMCHC) && (card->type != MMC_BOOT_TYPE_SDHC) )
|
||||
if ( (card->type != MMC_BOOT_TYPE_MMCHC) && (card->type != MMC_BOOT_TYPE_SDHC) )
|
||||
{
|
||||
mmc_ret = mmc_boot_set_block_len( card, card->rd_block_len );
|
||||
if( mmc_ret != MMC_BOOT_E_SUCCESS )
|
||||
if ( mmc_ret != MMC_BOOT_E_SUCCESS )
|
||||
{
|
||||
dprintf(CRITICAL, "Error No.%d: Failure setting block length for Card (RCA:%s)\n",
|
||||
mmc_ret, (char *)(card->rca) );
|
||||
@@ -2403,7 +2403,29 @@ static unsigned int mmc_boot_read_MBR(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void mmc_display_ext_csd(void)
|
||||
{
|
||||
dprintf(SPEW, "part_config: %x\n", ext_csd_buf[179] );
|
||||
dprintf(SPEW, "erase_group_def: %x\n", ext_csd_buf[175] );
|
||||
dprintf(SPEW, "user_wp: %x\n", ext_csd_buf[171] );
|
||||
}
|
||||
|
||||
|
||||
|
||||
void mmc_display_csd(void)
|
||||
{
|
||||
dprintf(SPEW, "erase_grpsize: %d\n", mmc_card.csd.erase_grp_size );
|
||||
dprintf(SPEW, "erase_grpmult: %d\n", mmc_card.csd.erase_grp_mult );
|
||||
dprintf(SPEW, "wp_grpsize: %d\n", mmc_card.csd.wp_grp_size );
|
||||
dprintf(SPEW, "wp_grpen: %d\n", mmc_card.csd.wp_grp_enable );
|
||||
dprintf(SPEW, "perm_wp: %d\n", mmc_card.csd.perm_wp );
|
||||
dprintf(SPEW, "temp_wp: %d\n", mmc_card.csd.temp_wp );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Entry point to MMC boot process
|
||||
*/
|
||||
@@ -2792,7 +2814,7 @@ static unsigned int mmc_boot_set_clr_power_on_wp_user(struct mmc_boot_card* card
|
||||
cmd.cmd_type = MMC_BOOT_CMD_ADDRESS;
|
||||
cmd.resp_type = MMC_BOOT_RESP_R1B;
|
||||
|
||||
for(int i=0;i<loop_count;i++)
|
||||
for (unsigned int i = 0; i < loop_count; i++)
|
||||
{
|
||||
/* Sending CMD28 for each WP group size
|
||||
address is in sectors already */
|
||||
@@ -2836,9 +2858,10 @@ static unsigned int mmc_boot_get_wp_status (struct mmc_boot_card* card,
|
||||
unsigned int sector)
|
||||
{
|
||||
unsigned int rc = MMC_BOOT_E_SUCCESS;
|
||||
memset(wp_status_buf,0, 8);
|
||||
memset(wp_status_buf, 0, 8);
|
||||
|
||||
rc = mmc_boot_read_reg(card,8,CMD31_SEND_WRITE_PROT_TYPE,sector,wp_status_buf);
|
||||
rc = mmc_boot_read_reg(card, 8, CMD31_SEND_WRITE_PROT_TYPE, sector,
|
||||
(unsigned int *) wp_status_buf);
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -2869,22 +2892,6 @@ void mmc_wp_test(void)
|
||||
mmc_ret = mmc_wp(0xE06000,0x5000,1);
|
||||
}
|
||||
|
||||
void mmc_display_ext_csd(void)
|
||||
{
|
||||
dprintf(SPEW, "part_config: %x\n", ext_csd_buf[179] );
|
||||
dprintf(SPEW, "erase_group_def: %x\n", ext_csd_buf[175] );
|
||||
dprintf(SPEW, "user_wp: %x\n", ext_csd_buf[171] );
|
||||
}
|
||||
|
||||
void mmc_display_csd(void)
|
||||
{
|
||||
dprintf(SPEW, "erase_grpsize: %d\n", mmc_card.csd.erase_grp_size );
|
||||
dprintf(SPEW, "erase_grpmult: %d\n", mmc_card.csd.erase_grp_mult );
|
||||
dprintf(SPEW, "wp_grpsize: %d\n", mmc_card.csd.wp_grp_size );
|
||||
dprintf(SPEW, "wp_grpen: %d\n", mmc_card.csd.wp_grp_enable );
|
||||
dprintf(SPEW, "perm_wp: %d\n", mmc_card.csd.perm_wp );
|
||||
dprintf(SPEW, "temp_wp: %d\n", mmc_card.csd.temp_wp );
|
||||
}
|
||||
|
||||
unsigned mmc_get_psn(void)
|
||||
{
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@ __WEAK unsigned target_baseband()
|
||||
|
||||
__WEAK void target_serialno(unsigned char *buf)
|
||||
{
|
||||
sprintf(buf, "%s",TARGET(BOARD));
|
||||
sprintf((char *) buf, "%s",TARGET(BOARD));
|
||||
}
|
||||
|
||||
__WEAK void target_fastboot_init()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 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
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <lib/ptable.h>
|
||||
#include <dev/flash.h>
|
||||
#include <smem.h>
|
||||
#include <platform.h>
|
||||
|
||||
#define LINUX_MACHTYPE 2704
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 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
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <lib/ptable.h>
|
||||
#include <dev/flash.h>
|
||||
#include <smem.h>
|
||||
#include <platform.h>
|
||||
|
||||
#define LINUX_MACHTYPE 2703
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <lib/ptable.h>
|
||||
#include <dev/flash.h>
|
||||
#include <smem.h>
|
||||
#include <platform.h>
|
||||
|
||||
#define LINUX_MACHTYPE 2706
|
||||
|
||||
|
||||
@@ -36,7 +36,9 @@
|
||||
#include <lib/ptable.h>
|
||||
#include <dev/flash.h>
|
||||
#include <smem.h>
|
||||
#include <mmc.h>
|
||||
#include <platform/iomap.h>
|
||||
#include <platform.h>
|
||||
|
||||
#define LINUX_MACHTYPE_7x27_SURF 2705
|
||||
#define LINUX_MACHTYPE_7x27_FFA 2706
|
||||
|
||||
@@ -36,7 +36,9 @@
|
||||
#include <lib/ptable.h>
|
||||
#include <dev/flash.h>
|
||||
#include <smem.h>
|
||||
#include <mmc.h>
|
||||
#include <platform/iomap.h>
|
||||
#include <platform.h>
|
||||
|
||||
#define MSM7X27A_FFA 3351
|
||||
#define MSM7X27A_SURF 3352
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <dev/flash.h>
|
||||
#include <smem.h>
|
||||
#include <platform/machtype.h>
|
||||
#include <platform.h>
|
||||
|
||||
#define MSM8255_ID 74
|
||||
#define MSM8655_ID 75
|
||||
|
||||
@@ -38,8 +38,10 @@
|
||||
#include <dev/flash.h>
|
||||
#include <smem.h>
|
||||
#include <reg.h>
|
||||
#include <mmc.h>
|
||||
#include <platform/iomap.h>
|
||||
#include <platform/machtype.h>
|
||||
#include <platform.h>
|
||||
|
||||
#define MSM8255_ID 74
|
||||
#define MSM8655_ID 75
|
||||
|
||||
@@ -37,8 +37,10 @@
|
||||
#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
|
||||
|
||||
@@ -36,10 +36,13 @@
|
||||
#include <lib/ptable.h>
|
||||
#include <dev/flash.h>
|
||||
#include <smem.h>
|
||||
#include <mmc.h>
|
||||
#include <platform/timer.h>
|
||||
#include <platform/iomap.h>
|
||||
#include <platform/gpio_hw.h>
|
||||
#include <baseband.h>
|
||||
#include <reg.h>
|
||||
#include <platform.h>
|
||||
|
||||
#define LINUX_MACHTYPE_8660_SURF 2755
|
||||
#define LINUX_MACHTYPE_8660_FFA 3017
|
||||
@@ -56,6 +59,7 @@ int target_is_emmc_boot(void);
|
||||
void debug_led_write(char);
|
||||
char debug_led_read();
|
||||
uint32_t platform_id_read (void);
|
||||
void setup_fpga(void);
|
||||
|
||||
void target_init(void)
|
||||
{
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#include <dev/keys.h>
|
||||
#include <dev/gpio_keypad.h>
|
||||
#include <platform.h>
|
||||
|
||||
#define LINUX_MACHTYPE_8660_QT 3298
|
||||
#define BITS_IN_ELEMENT(x) (sizeof(x)[0] * 8)
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
#include <lib/ptable.h>
|
||||
#include <smem.h>
|
||||
#include <platform/iomap.h>
|
||||
#include <mmc.h>
|
||||
#include <platform/timer.h>
|
||||
#include <reg.h>
|
||||
#include <dev/keys.h>
|
||||
#include <dev/pm8921.h>
|
||||
@@ -46,8 +48,6 @@
|
||||
#define LINUX_MACHTYPE_8960_FLUID 3398
|
||||
#define LINUX_MACHTYPE_8960_APQ 3399
|
||||
|
||||
extern unsigned int mmc_boot_main(unsigned char slot, unsigned int base);
|
||||
extern void mdelay(unsigned msecs);
|
||||
extern void dmb(void);
|
||||
extern void keypad_init(void);
|
||||
|
||||
@@ -177,7 +177,7 @@ void target_serialno(unsigned char *buf)
|
||||
if(target_is_emmc_boot())
|
||||
{
|
||||
serialno = mmc_get_psn();
|
||||
sprintf(buf,"%x",serialno);
|
||||
sprintf((char *) buf,"%x",serialno);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 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
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <lib/ptable.h>
|
||||
#include <dev/flash.h>
|
||||
#include <smem.h>
|
||||
#include <platform.h>
|
||||
|
||||
#define LINUX_MACHTYPE 2708
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 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
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <lib/ptable.h>
|
||||
#include <dev/flash.h>
|
||||
#include <smem.h>
|
||||
#include <platform.h>
|
||||
|
||||
#define LINUX_MACHTYPE 2627
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <dev/gpio_keypad.h>
|
||||
#include <lib/ptable.h>
|
||||
#include <dev/flash.h>
|
||||
#include <platform.h>
|
||||
|
||||
#define BOARD_FLASH_OFFSET 378
|
||||
|
||||
|
||||
Reference in new issue
Block a user