Merge branch '2022-02-14-assorted-fixes'
- Fix for pstore already being in the DT, "setlocalversion" script bugfix and pdu001 platform bugfix
This commit is contained in:
@@ -5,17 +5,25 @@
|
|||||||
|
|
||||||
#include "am33xx-u-boot.dtsi"
|
#include "am33xx-u-boot.dtsi"
|
||||||
|
|
||||||
/ {
|
&l4_wkup {
|
||||||
ocp {
|
u-boot,dm-pre-reloc;
|
||||||
u-boot,dm-pre-reloc;
|
segment@200000 {
|
||||||
|
|
||||||
|
target-module@10000 {
|
||||||
|
u-boot,dm-pre-reloc;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
&l4_wkup {
|
|
||||||
u-boot,dm-pre-reloc;
|
|
||||||
};
|
|
||||||
|
|
||||||
&l4_per {
|
&l4_per {
|
||||||
|
u-boot,dm-pre-reloc;
|
||||||
|
segment@100000 {
|
||||||
|
u-boot,dm-pre-reloc;
|
||||||
|
|
||||||
|
target-module@a6000 {
|
||||||
|
u-boot,dm-pre-reloc;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
segment@300000 {
|
segment@300000 {
|
||||||
|
|
||||||
|
|||||||
39
cmd/pstore.c
39
cmd/pstore.c
@@ -11,6 +11,7 @@
|
|||||||
#include <mapmem.h>
|
#include <mapmem.h>
|
||||||
#include <memalign.h>
|
#include <memalign.h>
|
||||||
#include <part.h>
|
#include <part.h>
|
||||||
|
#include <fdt_support.h>
|
||||||
|
|
||||||
struct persistent_ram_buffer {
|
struct persistent_ram_buffer {
|
||||||
u32 sig;
|
u32 sig;
|
||||||
@@ -485,6 +486,8 @@ void fdt_fixup_pstore(void *blob)
|
|||||||
{
|
{
|
||||||
char node[32];
|
char node[32];
|
||||||
int nodeoffset; /* node offset from libfdt */
|
int nodeoffset; /* node offset from libfdt */
|
||||||
|
u32 addr_cells;
|
||||||
|
u32 size_cells;
|
||||||
|
|
||||||
nodeoffset = fdt_path_offset(blob, "/");
|
nodeoffset = fdt_path_offset(blob, "/");
|
||||||
if (nodeoffset < 0) {
|
if (nodeoffset < 0) {
|
||||||
@@ -493,14 +496,18 @@ void fdt_fixup_pstore(void *blob)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
nodeoffset = fdt_add_subnode(blob, nodeoffset, "reserved-memory");
|
nodeoffset = fdt_find_or_add_subnode(blob, nodeoffset, "reserved-memory");
|
||||||
if (nodeoffset < 0) {
|
if (nodeoffset < 0) {
|
||||||
log_err("Add 'reserved-memory' node failed: %s\n",
|
log_err("Add 'reserved-memory' node failed: %s\n",
|
||||||
fdt_strerror(nodeoffset));
|
fdt_strerror(nodeoffset));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fdt_setprop_u32(blob, nodeoffset, "#address-cells", 2);
|
|
||||||
fdt_setprop_u32(blob, nodeoffset, "#size-cells", 2);
|
addr_cells = fdt_getprop_u32_default_node(blob, nodeoffset, 0, "#address-cells", 2);
|
||||||
|
size_cells = fdt_getprop_u32_default_node(blob, nodeoffset, 0, "#size-cells", 2);
|
||||||
|
fdt_setprop_u32(blob, nodeoffset, "#address-cells", addr_cells);
|
||||||
|
fdt_setprop_u32(blob, nodeoffset, "#size-cells", size_cells);
|
||||||
|
|
||||||
fdt_setprop_empty(blob, nodeoffset, "ranges");
|
fdt_setprop_empty(blob, nodeoffset, "ranges");
|
||||||
|
|
||||||
sprintf(node, "ramoops@%llx", (unsigned long long)pstore_addr);
|
sprintf(node, "ramoops@%llx", (unsigned long long)pstore_addr);
|
||||||
@@ -509,14 +516,36 @@ void fdt_fixup_pstore(void *blob)
|
|||||||
log_err("Add '%s' node failed: %s\n", node, fdt_strerror(nodeoffset));
|
log_err("Add '%s' node failed: %s\n", node, fdt_strerror(nodeoffset));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fdt_setprop_string(blob, nodeoffset, "compatible", "ramoops");
|
fdt_setprop_string(blob, nodeoffset, "compatible", "ramoops");
|
||||||
fdt_setprop_u64(blob, nodeoffset, "reg", pstore_addr);
|
|
||||||
fdt_appendprop_u64(blob, nodeoffset, "reg", pstore_length);
|
if (addr_cells == 1) {
|
||||||
|
fdt_setprop_u32(blob, nodeoffset, "reg", pstore_addr);
|
||||||
|
} else if (addr_cells == 2) {
|
||||||
|
fdt_setprop_u64(blob, nodeoffset, "reg", pstore_addr);
|
||||||
|
} else {
|
||||||
|
log_err("Unsupported #address-cells: %u\n", addr_cells);
|
||||||
|
goto clean_ramoops;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (size_cells == 1) {
|
||||||
|
// Let's consider that the pstore_length fits in a 32 bits value
|
||||||
|
fdt_appendprop_u32(blob, nodeoffset, "reg", pstore_length);
|
||||||
|
} else if (size_cells == 2) {
|
||||||
|
fdt_appendprop_u64(blob, nodeoffset, "reg", pstore_length);
|
||||||
|
} else {
|
||||||
|
log_err("Unsupported #size-cells: %u\n", addr_cells);
|
||||||
|
goto clean_ramoops;
|
||||||
|
}
|
||||||
|
|
||||||
fdt_setprop_u32(blob, nodeoffset, "record-size", pstore_record_size);
|
fdt_setprop_u32(blob, nodeoffset, "record-size", pstore_record_size);
|
||||||
fdt_setprop_u32(blob, nodeoffset, "console-size", pstore_console_size);
|
fdt_setprop_u32(blob, nodeoffset, "console-size", pstore_console_size);
|
||||||
fdt_setprop_u32(blob, nodeoffset, "ftrace-size", pstore_ftrace_size);
|
fdt_setprop_u32(blob, nodeoffset, "ftrace-size", pstore_ftrace_size);
|
||||||
fdt_setprop_u32(blob, nodeoffset, "pmsg-size", pstore_pmsg_size);
|
fdt_setprop_u32(blob, nodeoffset, "pmsg-size", pstore_pmsg_size);
|
||||||
fdt_setprop_u32(blob, nodeoffset, "ecc-size", pstore_ecc_size);
|
fdt_setprop_u32(blob, nodeoffset, "ecc-size", pstore_ecc_size);
|
||||||
|
|
||||||
|
clean_ramoops:
|
||||||
|
fdt_del_node_and_alias(blob, node);
|
||||||
}
|
}
|
||||||
|
|
||||||
U_BOOT_CMD(pstore, 10, 0, do_pstore,
|
U_BOOT_CMD(pstore, 10, 0, do_pstore,
|
||||||
|
|||||||
@@ -35,8 +35,10 @@ CONFIG_CMD_PMIC=y
|
|||||||
CONFIG_CMD_REGULATOR=y
|
CONFIG_CMD_REGULATOR=y
|
||||||
CONFIG_OF_CONTROL=y
|
CONFIG_OF_CONTROL=y
|
||||||
CONFIG_SPL_OF_CONTROL=y
|
CONFIG_SPL_OF_CONTROL=y
|
||||||
|
CONFIG_SPL_OF_TRANSLATE=y
|
||||||
CONFIG_ENV_OVERWRITE=y
|
CONFIG_ENV_OVERWRITE=y
|
||||||
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
||||||
|
CONFIG_SYS_MALLOC_F_LEN=0x1200
|
||||||
# CONFIG_NET is not set
|
# CONFIG_NET is not set
|
||||||
CONFIG_SPL_DM=y
|
CONFIG_SPL_DM=y
|
||||||
CONFIG_SPL_DM_SEQ_ALIAS=y
|
CONFIG_SPL_DM_SEQ_ALIAS=y
|
||||||
@@ -45,6 +47,8 @@ CONFIG_MMC_OMAP_HS=y
|
|||||||
CONFIG_MMC_SDHCI=y
|
CONFIG_MMC_SDHCI=y
|
||||||
CONFIG_PINCTRL=y
|
CONFIG_PINCTRL=y
|
||||||
CONFIG_PINCTRL_SINGLE=y
|
CONFIG_PINCTRL_SINGLE=y
|
||||||
|
CONFIG_CLK=y
|
||||||
|
CONFIG_CLK_TI_CTRL=y
|
||||||
CONFIG_DM_PMIC=y
|
CONFIG_DM_PMIC=y
|
||||||
CONFIG_DM_PMIC_TPS65910=y
|
CONFIG_DM_PMIC_TPS65910=y
|
||||||
CONFIG_DM_REGULATOR=y
|
CONFIG_DM_REGULATOR=y
|
||||||
|
|||||||
@@ -153,8 +153,9 @@ if test -e include/config/auto.conf; then
|
|||||||
# We are interested only in CONFIG_LOCALVERSION and
|
# We are interested only in CONFIG_LOCALVERSION and
|
||||||
# CONFIG_LOCALVERSION_AUTO, so extract these in a safe
|
# CONFIG_LOCALVERSION_AUTO, so extract these in a safe
|
||||||
# way (i.e. w/o sourcing auto.conf)
|
# way (i.e. w/o sourcing auto.conf)
|
||||||
CONFIG_LOCALVERSION=`cat include/config/auto.conf | awk -F '=' '/^CONFIG_LOCALVERSION=/ {print $2}'`
|
# xargs echo removes quotes
|
||||||
CONFIG_LOCALVERSION_AUTO=`cat include/config/auto.conf | awk -F '=' '/^CONFIG_LOCALVERSION_AUTO=/ {print $2}'`
|
CONFIG_LOCALVERSION=`cat include/config/auto.conf | awk -F '=' '/^CONFIG_LOCALVERSION=/ {print $2}' | xargs echo`
|
||||||
|
CONFIG_LOCALVERSION_AUTO=`cat include/config/auto.conf | awk -F '=' '/^CONFIG_LOCALVERSION_AUTO=/ {print $2}' | xargs echo`
|
||||||
else
|
else
|
||||||
echo "Error: kernelrelease not valid - run 'make prepare' to update it" >&2
|
echo "Error: kernelrelease not valid - run 'make prepare' to update it" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user