Merge changes from topic "st_nvmem_layout" into integration
* changes: refactor(stm32mp1-fdts): remove nvmem_layout node refactor(stm32mp1): drop the "st,stm32-nvmem-layout" node refactor(st): remove useless includes
This commit is contained in:
commit
dfc59a7b82
|
@ -26,26 +26,6 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
nvmem_layout: nvmem_layout@0 {
|
|
||||||
compatible = "st,stm32-nvmem-layout";
|
|
||||||
|
|
||||||
nvmem-cells = <&cfg0_otp>,
|
|
||||||
<&part_number_otp>,
|
|
||||||
<&monotonic_otp>,
|
|
||||||
<&nand_otp>,
|
|
||||||
<&nand2_otp>,
|
|
||||||
<&uid_otp>,
|
|
||||||
<&hw2_otp>;
|
|
||||||
|
|
||||||
nvmem-cell-names = "cfg0_otp",
|
|
||||||
"part_number_otp",
|
|
||||||
"monotonic_otp",
|
|
||||||
"nand_otp",
|
|
||||||
"nand2_otp",
|
|
||||||
"uid_otp",
|
|
||||||
"hw2_otp";
|
|
||||||
};
|
|
||||||
|
|
||||||
clocks {
|
clocks {
|
||||||
clk_csi: clk-csi {
|
clk_csi: clk-csi {
|
||||||
#clock-cells = <0>;
|
#clock-cells = <0>;
|
||||||
|
|
|
@ -175,28 +175,6 @@
|
||||||
status = "okay";
|
status = "okay";
|
||||||
};
|
};
|
||||||
|
|
||||||
&nvmem_layout {
|
|
||||||
nvmem-cells = <&cfg0_otp>,
|
|
||||||
<&part_number_otp>,
|
|
||||||
<&monotonic_otp>,
|
|
||||||
<&nand_otp>,
|
|
||||||
<&nand2_otp>,
|
|
||||||
<&uid_otp>,
|
|
||||||
<&hw2_otp>,
|
|
||||||
<&pkh_otp>,
|
|
||||||
<&board_id>;
|
|
||||||
|
|
||||||
nvmem-cell-names = "cfg0_otp",
|
|
||||||
"part_number_otp",
|
|
||||||
"monotonic_otp",
|
|
||||||
"nand_otp",
|
|
||||||
"nand2_otp",
|
|
||||||
"uid_otp",
|
|
||||||
"hw2_otp",
|
|
||||||
"pkh_otp",
|
|
||||||
"board_id";
|
|
||||||
};
|
|
||||||
|
|
||||||
&pka {
|
&pka {
|
||||||
secure-status = "okay";
|
secure-status = "okay";
|
||||||
};
|
};
|
||||||
|
|
|
@ -24,26 +24,6 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
nvmem_layout: nvmem_layout@0 {
|
|
||||||
compatible = "st,stm32-nvmem-layout";
|
|
||||||
|
|
||||||
nvmem-cells = <&cfg0_otp>,
|
|
||||||
<&part_number_otp>,
|
|
||||||
<&monotonic_otp>,
|
|
||||||
<&nand_otp>,
|
|
||||||
<&uid_otp>,
|
|
||||||
<&package_otp>,
|
|
||||||
<&hw2_otp>;
|
|
||||||
|
|
||||||
nvmem-cell-names = "cfg0_otp",
|
|
||||||
"part_number_otp",
|
|
||||||
"monotonic_otp",
|
|
||||||
"nand_otp",
|
|
||||||
"uid_otp",
|
|
||||||
"package_otp",
|
|
||||||
"hw2_otp";
|
|
||||||
};
|
|
||||||
|
|
||||||
psci {
|
psci {
|
||||||
compatible = "arm,psci-1.0";
|
compatible = "arm,psci-1.0";
|
||||||
method = "smc";
|
method = "smc";
|
||||||
|
|
|
@ -195,26 +195,6 @@
|
||||||
status = "okay";
|
status = "okay";
|
||||||
};
|
};
|
||||||
|
|
||||||
&nvmem_layout {
|
|
||||||
nvmem-cells = <&cfg0_otp>,
|
|
||||||
<&part_number_otp>,
|
|
||||||
<&monotonic_otp>,
|
|
||||||
<&nand_otp>,
|
|
||||||
<&uid_otp>,
|
|
||||||
<&package_otp>,
|
|
||||||
<&hw2_otp>,
|
|
||||||
<&board_id>;
|
|
||||||
|
|
||||||
nvmem-cell-names = "cfg0_otp",
|
|
||||||
"part_number_otp",
|
|
||||||
"monotonic_otp",
|
|
||||||
"nand_otp",
|
|
||||||
"uid_otp",
|
|
||||||
"package_otp",
|
|
||||||
"hw2_otp",
|
|
||||||
"board_id";
|
|
||||||
};
|
|
||||||
|
|
||||||
&pwr_regulators {
|
&pwr_regulators {
|
||||||
vdd-supply = <&vdd>;
|
vdd-supply = <&vdd>;
|
||||||
vdd_3v3_usbfs-supply = <&vdd_usb>;
|
vdd_3v3_usbfs-supply = <&vdd_usb>;
|
||||||
|
|
|
@ -183,26 +183,6 @@
|
||||||
secure-status = "okay";
|
secure-status = "okay";
|
||||||
};
|
};
|
||||||
|
|
||||||
&nvmem_layout {
|
|
||||||
nvmem-cells = <&cfg0_otp>,
|
|
||||||
<&part_number_otp>,
|
|
||||||
<&monotonic_otp>,
|
|
||||||
<&nand_otp>,
|
|
||||||
<&uid_otp>,
|
|
||||||
<&package_otp>,
|
|
||||||
<&hw2_otp>,
|
|
||||||
<&board_id>;
|
|
||||||
|
|
||||||
nvmem-cell-names = "cfg0_otp",
|
|
||||||
"part_number_otp",
|
|
||||||
"monotonic_otp",
|
|
||||||
"nand_otp",
|
|
||||||
"uid_otp",
|
|
||||||
"package_otp",
|
|
||||||
"hw2_otp",
|
|
||||||
"board_id";
|
|
||||||
};
|
|
||||||
|
|
||||||
&pwr_regulators {
|
&pwr_regulators {
|
||||||
vdd-supply = <&vdd>;
|
vdd-supply = <&vdd>;
|
||||||
vdd_3v3_usbfs-supply = <&vdd_usb>;
|
vdd_3v3_usbfs-supply = <&vdd_usb>;
|
||||||
|
|
|
@ -11,8 +11,6 @@
|
||||||
#include <common/fdt_wrappers.h>
|
#include <common/fdt_wrappers.h>
|
||||||
#include <drivers/st/regulator.h>
|
#include <drivers/st/regulator.h>
|
||||||
#include <drivers/st/stm32_gpio.h>
|
#include <drivers/st/stm32_gpio.h>
|
||||||
#include <drivers/st/stm32mp1_ddr.h>
|
|
||||||
#include <drivers/st/stm32mp1_ram.h>
|
|
||||||
#include <libfdt.h>
|
#include <libfdt.h>
|
||||||
|
|
||||||
#include <platform_def.h>
|
#include <platform_def.h>
|
||||||
|
@ -328,48 +326,32 @@ const char *dt_get_board_model(void)
|
||||||
int dt_find_otp_name(const char *name, uint32_t *otp, uint32_t *otp_len)
|
int dt_find_otp_name(const char *name, uint32_t *otp, uint32_t *otp_len)
|
||||||
{
|
{
|
||||||
int node;
|
int node;
|
||||||
int index, len;
|
int len;
|
||||||
const fdt32_t *cuint;
|
const fdt32_t *cuint;
|
||||||
|
|
||||||
if ((name == NULL) || (otp == NULL)) {
|
if ((name == NULL) || (otp == NULL)) {
|
||||||
return -FDT_ERR_BADVALUE;
|
return -FDT_ERR_BADVALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
node = fdt_node_offset_by_compatible(fdt, -1, DT_NVMEM_LAYOUT_COMPAT);
|
node = fdt_node_offset_by_compatible(fdt, -1, DT_BSEC_COMPAT);
|
||||||
if (node < 0) {
|
if (node < 0) {
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
index = fdt_stringlist_search(fdt, node, "nvmem-cell-names", name);
|
node = fdt_subnode_offset(fdt, node, name);
|
||||||
if (index < 0) {
|
|
||||||
return index;
|
|
||||||
}
|
|
||||||
|
|
||||||
cuint = fdt_getprop(fdt, node, "nvmem-cells", &len);
|
|
||||||
if (cuint == NULL) {
|
|
||||||
return -FDT_ERR_NOTFOUND;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((index * (int)sizeof(uint32_t)) > len) {
|
|
||||||
return -FDT_ERR_BADVALUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
cuint += index;
|
|
||||||
|
|
||||||
node = fdt_node_offset_by_phandle(fdt, fdt32_to_cpu(*cuint));
|
|
||||||
if (node < 0) {
|
if (node < 0) {
|
||||||
ERROR("Malformed nvmem_layout node: ignored\n");
|
ERROR("nvmem node %s not found\n", name);
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
cuint = fdt_getprop(fdt, node, "reg", &len);
|
cuint = fdt_getprop(fdt, node, "reg", &len);
|
||||||
if ((cuint == NULL) || (len != (2 * (int)sizeof(uint32_t)))) {
|
if ((cuint == NULL) || (len != (2 * (int)sizeof(uint32_t)))) {
|
||||||
ERROR("Malformed nvmem_layout node: ignored\n");
|
ERROR("Malformed nvmem node %s: ignored\n", name);
|
||||||
return -FDT_ERR_BADVALUE;
|
return -FDT_ERR_BADVALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fdt32_to_cpu(*cuint) % sizeof(uint32_t)) {
|
if (fdt32_to_cpu(*cuint) % sizeof(uint32_t)) {
|
||||||
ERROR("Misaligned nvmem_layout element: ignored\n");
|
ERROR("Misaligned nvmem %s element: ignored\n", name);
|
||||||
return -FDT_ERR_BADVALUE;
|
return -FDT_ERR_BADVALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -621,7 +621,6 @@ static inline uintptr_t tamp_bkpr(uint32_t idx)
|
||||||
#define DT_DDR_COMPAT "st,stm32mp1-ddr"
|
#define DT_DDR_COMPAT "st,stm32mp1-ddr"
|
||||||
#endif
|
#endif
|
||||||
#define DT_IWDG_COMPAT "st,stm32mp1-iwdg"
|
#define DT_IWDG_COMPAT "st,stm32mp1-iwdg"
|
||||||
#define DT_NVMEM_LAYOUT_COMPAT "st,stm32-nvmem-layout"
|
|
||||||
#define DT_PWR_COMPAT "st,stm32mp1,pwr-reg"
|
#define DT_PWR_COMPAT "st,stm32mp1,pwr-reg"
|
||||||
#if STM32MP13
|
#if STM32MP13
|
||||||
#define DT_RCC_CLK_COMPAT "st,stm32mp13-rcc"
|
#define DT_RCC_CLK_COMPAT "st,stm32mp13-rcc"
|
||||||
|
|
Loading…
Reference in New Issue