mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2025-12-10 07:44:53 +01:00
Merge "Merge remote-tracking branch origin/win.coretech.1.0 into HEAD"
This commit is contained in:
commit
f9f29c9989
6 changed files with 88 additions and 3 deletions
|
|
@ -157,4 +157,9 @@
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
sdx-gpio {
|
||||||
|
ap2mdm = <25>;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,10 @@
|
||||||
aquantia_port = <5>;
|
aquantia_port = <5>;
|
||||||
aquantia_gpio = <44>;
|
aquantia_gpio = <44>;
|
||||||
};
|
};
|
||||||
|
sdx-gpio {
|
||||||
|
x55-ap2mdm = <26>;
|
||||||
|
x65-ap2mdm = <45>;
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -160,6 +160,40 @@ void uart1_set_rate_mnd(unsigned int m,
|
||||||
writel(two_d, GCC_BLSP1_UART1_APPS_D);
|
writel(two_d, GCC_BLSP1_UART1_APPS_D);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int get_ap2mdm_gpio(void)
|
||||||
|
{
|
||||||
|
int ap2mdm_gpio = -1, node;
|
||||||
|
|
||||||
|
node = fdt_path_offset(gd->fdt_blob, "/sdx-gpio");
|
||||||
|
if (node >= 0) {
|
||||||
|
ap2mdm_gpio = fdtdec_get_uint(gd->fdt_blob, node, "ap2mdm", -1);
|
||||||
|
} else
|
||||||
|
return node;
|
||||||
|
|
||||||
|
return ap2mdm_gpio;
|
||||||
|
}
|
||||||
|
|
||||||
|
void indicate_sdx_device(void)
|
||||||
|
{
|
||||||
|
int ap2mdm_gpio;
|
||||||
|
unsigned int *ap2mdm_gpio_base;
|
||||||
|
|
||||||
|
unsigned int machid = gd->bd->bi_arch_number;
|
||||||
|
if (machid != 0x8040003)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ap2mdm_gpio = get_ap2mdm_gpio();
|
||||||
|
if(ap2mdm_gpio >= 0) {
|
||||||
|
/* Enabling OE in gpio cfg reg */
|
||||||
|
ap2mdm_gpio_base = (unsigned int *)GPIO_CONFIG_ADDR(ap2mdm_gpio);
|
||||||
|
writel(0x2c0, ap2mdm_gpio_base);
|
||||||
|
/* Indicate SDx by writing low to ap2mdm */
|
||||||
|
gpio_set_value(ap2mdm_gpio, 0x1);
|
||||||
|
gpio_set_value(ap2mdm_gpio, 0x0);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void reset_board(void)
|
void reset_board(void)
|
||||||
{
|
{
|
||||||
run_command("reset", 0);
|
run_command("reset", 0);
|
||||||
|
|
|
||||||
|
|
@ -430,6 +430,45 @@ void reset_cpu(unsigned long a)
|
||||||
while(1);
|
while(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int sdx65_attached(void);
|
||||||
|
|
||||||
|
int get_ap2mdm_gpio(void)
|
||||||
|
{
|
||||||
|
int ap2mdm_gpio = -1, node;
|
||||||
|
|
||||||
|
node = fdt_path_offset(gd->fdt_blob, "/sdx-gpio");
|
||||||
|
if (node >= 0) {
|
||||||
|
if(sdx65_attached())
|
||||||
|
ap2mdm_gpio = fdtdec_get_uint(gd->fdt_blob, node, "x65-ap2mdm", -1);
|
||||||
|
else
|
||||||
|
ap2mdm_gpio = fdtdec_get_uint(gd->fdt_blob, node, "x55-ap2mdm", -1);
|
||||||
|
} else
|
||||||
|
return node;
|
||||||
|
|
||||||
|
return ap2mdm_gpio;
|
||||||
|
}
|
||||||
|
|
||||||
|
void indicate_sdx_device(void)
|
||||||
|
{
|
||||||
|
int ap2mdm_gpio;
|
||||||
|
unsigned int *ap2mdm_gpio_base;
|
||||||
|
|
||||||
|
unsigned int machid = gd->bd->bi_arch_number;
|
||||||
|
if (machid != 0x08010400)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ap2mdm_gpio = get_ap2mdm_gpio();
|
||||||
|
if(ap2mdm_gpio >= 0) {
|
||||||
|
/* Enabling OE in gpio cfg reg */
|
||||||
|
ap2mdm_gpio_base = (unsigned int *)GPIO_CONFIG_ADDR(ap2mdm_gpio);
|
||||||
|
writel(0x2c0, ap2mdm_gpio_base);
|
||||||
|
/* Indicate SDx by writing low to ap2mdm */
|
||||||
|
gpio_set_value(ap2mdm_gpio, 0x0);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void reset_board(void)
|
void reset_board(void)
|
||||||
{
|
{
|
||||||
run_command("reset", 0);
|
run_command("reset", 0);
|
||||||
|
|
|
||||||
|
|
@ -366,6 +366,8 @@ __weak int apps_iscrashed_crashdump_disabled(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__weak void indicate_sdx_device(void) {}
|
||||||
|
|
||||||
void autoboot_command(const char *s)
|
void autoboot_command(const char *s)
|
||||||
{
|
{
|
||||||
debug("### main_loop: bootcmd=\"%s\"\n", s ? s : "<UNDEFINED>");
|
debug("### main_loop: bootcmd=\"%s\"\n", s ? s : "<UNDEFINED>");
|
||||||
|
|
@ -377,6 +379,7 @@ void autoboot_command(const char *s)
|
||||||
*/
|
*/
|
||||||
if (apps_iscrashed()) {
|
if (apps_iscrashed()) {
|
||||||
printf("Crashdump magic found, initializing dump activity..\n");
|
printf("Crashdump magic found, initializing dump activity..\n");
|
||||||
|
indicate_sdx_device();
|
||||||
s = getenv("dump_to_flash");
|
s = getenv("dump_to_flash");
|
||||||
if (!s) {
|
if (!s) {
|
||||||
s = getenv("dump_minimal");
|
s = getenv("dump_minimal");
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
#include "libfdt_internal.h"
|
#include "libfdt_internal.h"
|
||||||
|
|
||||||
#define UINT_MAX (~0U)
|
#define ULONG_MAX (~0UL)
|
||||||
|
|
||||||
int fdt_check_header(const void *fdt)
|
int fdt_check_header(const void *fdt)
|
||||||
{
|
{
|
||||||
|
|
@ -41,13 +41,13 @@ int fdt_check_header(const void *fdt)
|
||||||
}
|
}
|
||||||
fdt_end = fdt_start + fdt_totalsize(fdt);
|
fdt_end = fdt_start + fdt_totalsize(fdt);
|
||||||
|
|
||||||
if (((uint64_t)fdt_start + (uint64_t)fdt_off_dt_struct(fdt) + (uint64_t)fdt_size_dt_struct(fdt)) > UINT_MAX)
|
if (((uint64_t)fdt_start + (uint64_t)fdt_off_dt_struct(fdt) + (uint64_t)fdt_size_dt_struct(fdt)) > ULONG_MAX)
|
||||||
return FDT_ERR_BADOFFSET;
|
return FDT_ERR_BADOFFSET;
|
||||||
|
|
||||||
if ((fdt_start + fdt_off_dt_struct(fdt) + fdt_size_dt_struct(fdt)) > fdt_end)
|
if ((fdt_start + fdt_off_dt_struct(fdt) + fdt_size_dt_struct(fdt)) > fdt_end)
|
||||||
return FDT_ERR_BADOFFSET;
|
return FDT_ERR_BADOFFSET;
|
||||||
|
|
||||||
if (((uint64_t)fdt_start + (uint64_t)fdt_off_dt_strings(fdt) + (uint64_t)fdt_size_dt_strings(fdt)) > UINT_MAX)
|
if (((uint64_t)fdt_start + (uint64_t)fdt_off_dt_strings(fdt) + (uint64_t)fdt_size_dt_strings(fdt)) > ULONG_MAX)
|
||||||
return FDT_ERR_BADOFFSET;
|
return FDT_ERR_BADOFFSET;
|
||||||
|
|
||||||
if ((fdt_start + fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt)) > fdt_end)
|
if ((fdt_start + fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt)) > fdt_end)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue