summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dechesne <nicolas.dechesne@linaro.org>2015-05-05 18:40:46 +0100
committerNicolas Dechesne <nicolas.dechesne@linaro.org>2015-05-05 18:40:46 +0100
commitd9cabbbb10f6cd56225d0bb7bfe62f0753b4cde0 (patch)
treecbcda450ffce90f24ce3352c5fc0270d4777a3ca
parent24dcedf7f252a51cbb3a68e5021ab62023cc343f (diff)
downloadlk-d9cabbbb10f6cd56225d0bb7bfe62f0753b4cde0.tar.gz
TMP: add debug traces
Change-Id: I309126be9af738ae3a5815d64763ab86bdeb57b6 Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
-rw-r--r--app/aboot/aboot.c7
-rw-r--r--makefile2
-rw-r--r--platform/msm_shared/mmc.c3
-rw-r--r--platform/msm_shared/mmc_sdhci.c2
-rw-r--r--project/msm8916.mk3
-rw-r--r--target/init.c1
-rw-r--r--target/msm8916/init.c4
7 files changed, 19 insertions, 3 deletions
diff --git a/app/aboot/aboot.c b/app/aboot/aboot.c
index 7661680c3..f4c36ad00 100644
--- a/app/aboot/aboot.c
+++ b/app/aboot/aboot.c
@@ -865,7 +865,9 @@ int boot_linux_from_mmc(void)
}
if (!boot_into_recovery) {
index = partition_get_index("boot");
+ dprintf(ALWAYS, "Looking for boot index: %d\n", index);
ptn = partition_get_offset(index);
+ dprintf(ALWAYS, "Looking for boot partition: %d\n", ptn);
if(ptn == 0) {
dprintf(CRITICAL, "ERROR: No boot partition found\n");
return -1;
@@ -874,19 +876,22 @@ int boot_linux_from_mmc(void)
else {
index = partition_get_index("recovery");
ptn = partition_get_offset(index);
+ dprintf(ALWAYS, "Looking for recovery partition: %ld\n", ptn);
if(ptn == 0) {
dprintf(CRITICAL, "ERROR: No recovery partition found\n");
return -1;
}
}
+ dprintf(ALWAYS, "Reading boot headern, offset\n");
+
if (mmc_read(ptn + offset, (unsigned int *) buf, page_size)) {
dprintf(CRITICAL, "ERROR: Cannot read boot image header\n");
return -1;
}
if (memcmp(hdr->magic, BOOT_MAGIC, BOOT_MAGIC_SIZE)) {
- dprintf(CRITICAL, "ERROR: Invalid boot image header\n");
+ dprintf(CRITICAL, "ERROR: NICO: Invalid boot image header\n");
return -1;
}
diff --git a/makefile b/makefile
index 1056726dc..bfc6c37f4 100644
--- a/makefile
+++ b/makefile
@@ -27,7 +27,7 @@ ifeq ($(PROJECT),)
$(error No project specified. Use "make projectname" or put "PROJECT := projectname" in local.mk)
endif
-DEBUG ?= 0
+DEBUG ?= 2
ifndef $(BOOTLOADER_OUT)
BOOTLOADER_OUT := .
diff --git a/platform/msm_shared/mmc.c b/platform/msm_shared/mmc.c
index fd775833f..aecb77c3c 100644
--- a/platform/msm_shared/mmc.c
+++ b/platform/msm_shared/mmc.c
@@ -2402,6 +2402,8 @@ unsigned int mmc_boot_main(unsigned char slot, unsigned int base)
memset((struct mmc_card *)&mmc_card, 0,
sizeof(struct mmc_card));
+ dprintf(CRITICAL, "NDEC: mmc_boot_main: %d\n", base);
+
mmc_slot = slot;
mmc_boot_mci_base = base;
@@ -2481,6 +2483,7 @@ mmc_read(unsigned long long data_addr, unsigned int *out, unsigned int data_len)
int val = 0;
unsigned int data_limit = mmc_card.rd_block_len * 0xffff;
unsigned int this_len;
+ dprintf(CRITICAL, "NDEC: mmc_read \n");
do {
this_len = (data_len > data_limit) ? data_limit : data_len;
diff --git a/platform/msm_shared/mmc_sdhci.c b/platform/msm_shared/mmc_sdhci.c
index a64df7056..e1b89ff32 100644
--- a/platform/msm_shared/mmc_sdhci.c
+++ b/platform/msm_shared/mmc_sdhci.c
@@ -1478,6 +1478,7 @@ static uint32_t mmc_card_init(struct mmc_device *dev)
struct sdhci_host *host;
struct mmc_card *card;
struct mmc_config_data *cfg;
+ dprintf(CRITICAL, "NDEC: mmc_card_init: %p\n", dev);
host = &dev->host;
card = &dev->card;
@@ -1501,6 +1502,7 @@ static uint32_t mmc_card_init(struct mmc_device *dev)
dprintf(CRITICAL, "Failed to initialize SD card\n");
return mmc_return;
}
+ dprintf(CRITICAL, "NDEC: SD card ok\n");
}
/* Identify (CMD2, CMD3 & CMD9) and select the card (CMD7) */
diff --git a/project/msm8916.mk b/project/msm8916.mk
index 5f51f80c1..f8a130c93 100644
--- a/project/msm8916.mk
+++ b/project/msm8916.mk
@@ -9,8 +9,9 @@ MODULES += app/aboot
ifeq ($(TARGET_BUILD_VARIANT),user)
DEBUG := 0
else
-DEBUG := 1
+DEBUG := 2
endif
+DEBUG := 2
EMMC_BOOT := 1
diff --git a/target/init.c b/target/init.c
index 79e046672..36bec705c 100644
--- a/target/init.c
+++ b/target/init.c
@@ -40,6 +40,7 @@ __WEAK void target_early_init(void)
__WEAK void target_init(void)
{
+ dprintf(CRITICAL, "HELLO from WEAK target_init\n");
}
__WEAK void *target_get_scratch_address(void)
diff --git a/target/msm8916/init.c b/target/msm8916/init.c
index 691ef6a6c..91b2b3589 100644
--- a/target/msm8916/init.c
+++ b/target/msm8916/init.c
@@ -107,6 +107,7 @@ void target_sdc_init()
config.max_clk_rate = MMC_CLK_177MHZ;
/* Try slot 1*/
+ _dprintf("NDEC: target_sdc_init: slot 1\n");
config.slot = 1;
config.sdhc_base = mmc_sdhci_base[config.slot - 1];
config.pwrctl_base = mmc_pwrctl_base[config.slot - 1];
@@ -130,6 +131,7 @@ void target_sdc_init()
void *target_mmc_device()
{
+ dprintf(ALWAYS, "NDEC: target_mmc_device\n");
return (void *) dev;
}
@@ -194,8 +196,10 @@ void target_init(void)
spmi_init(PMIC_ARB_CHANNEL_NUM, PMIC_ARB_OWNER_ID);
+ dprintf(INFO, "target_init(): before keystatus\n");
target_keystatus();
+ dprintf(INFO, "target_init(): before sdc_init\n");
target_sdc_init();
if (partition_read_table())
{