diff --git a/board/qca/common/fdt_fixup.c b/board/qca/common/fdt_fixup.c index cac69185d1..1754b1c2b9 100644 --- a/board/qca/common/fdt_fixup.c +++ b/board/qca/common/fdt_fixup.c @@ -79,12 +79,14 @@ int ipq_fdt_fixup_spi_nor_params(void *blob) return -1; } - val = cpu_to_fdt32(sfi.flash_density); - ret = fdt_setprop(blob, nodeoff, "density", - &val, sizeof(uint32_t)); - if (ret) { - printf("fdt-fixup: unable to set density(%d)\n", ret); - return -1; + if (sfi.flash_density != 0) { + val = cpu_to_fdt32(sfi.flash_density); + ret = fdt_setprop(blob, nodeoff, "density", + &val, sizeof(uint32_t)); + if (ret) { + printf("fdt-fixup: unable to set density(%d)\n", ret); + return -1; + } } return 0; @@ -258,6 +260,7 @@ int ft_board_setup(void *blob, bd_t *bd) debug("MTDIDS: %s\n", getenv("mtdids")); ipq_fdt_fixup_mtdparts(blob, nodes); } + ipq_fdt_fixup_socinfo(blob); dcache_disable(); fdt_fixup_ethernet(blob); diff --git a/board/qca/ipq40xx/ipq40xx.c b/board/qca/ipq40xx/ipq40xx.c index 73c32a8a66..dc9e1118ae 100644 --- a/board/qca/ipq40xx/ipq40xx.c +++ b/board/qca/ipq40xx/ipq40xx.c @@ -344,3 +344,8 @@ void board_pci_deinit(void) pcie_clock_disable(GCC_PCIE_AXI_S_CBCR); pcie_clock_disable(GCC_PCIE_AHB_CBCR); } + +int ipq_fdt_fixup_socinfo(void *blob) +{ + return 0; +} diff --git a/board/qca/ipq40xx/ipq40xx.h b/board/qca/ipq40xx/ipq40xx.h index e1e9a3d78c..6fc9edcf42 100644 --- a/board/qca/ipq40xx/ipq40xx.h +++ b/board/qca/ipq40xx/ipq40xx.h @@ -127,4 +127,5 @@ extern const add_node_t add_node[]; unsigned int get_board_index(unsigned int machid); void reset_crashdump(void); +int ipq_fdt_fixup_socinfo(void *blob); #endif diff --git a/board/qca/ipq806x/ipq806x.c b/board/qca/ipq806x/ipq806x.c index cb5caaa320..784219a859 100644 --- a/board/qca/ipq806x/ipq806x.c +++ b/board/qca/ipq806x/ipq806x.c @@ -18,6 +18,7 @@ #include #include #include +#include #include "ipq806x.h" #include "qca_common.h" @@ -25,6 +26,11 @@ DECLARE_GLOBAL_DATA_PTR; qca_mmc mmc_host; +int nand_env_device = 0; +const char *rsvd_node = "/reserved-memory"; +const char *del_node[] = {NULL}; +const add_node_t add_node[] = {}; + unsigned long timer_read_counter(void) { return 0; @@ -74,9 +80,32 @@ void qca_serial_init(struct ipq_serial_platdata *plat) GSBI_CTRL_REG_PROTOCOL_CODE_S, GSBI_CTRL_REG(GSBI4_BASE)); - if(!(plat->m_value == -1) || ( plat->n_value == -1) || (plat->d_value == -1)) + if (!(plat->m_value == -1) || ( plat->n_value == -1) || (plat->d_value == -1)) uart_clock_config(plat->port_id, plat->m_value, plat->n_value, plat->d_value); } + +int ipq_fdt_fixup_socinfo(void *blob) +{ + uint32_t cpu_type; + int nodeoff, ret; + + ret = ipq_smem_get_socinfo_cpu_type(&cpu_type); + if (ret) { + printf("ipq: fdt fixup cannot get socinfo\n"); + return ret; + } + nodeoff = fdt_node_offset_by_compatible(blob, -1, "qcom,ipq8064"); + + if (nodeoff < 0) { + printf("ipq: fdt fixup cannot find compatible node\n"); + return nodeoff; + } + ret = fdt_setprop(blob, nodeoff, "cpu_type", + &cpu_type, sizeof(cpu_type)); + if (ret) + printf("%s: cannot set cpu type %d\n", __func__, ret); + return ret; +} diff --git a/board/qca/ipq806x/ipq806x.h b/board/qca/ipq806x/ipq806x.h index 167658e6f3..a528cb0bcf 100644 --- a/board/qca/ipq806x/ipq806x.h +++ b/board/qca/ipq806x/ipq806x.h @@ -16,6 +16,7 @@ #include #include +#include #define GSBI4_BASE 0x16300000 @@ -44,5 +45,10 @@ typedef enum { SMEM_MAX_SIZE = SMEM_PARTITION_TABLE_OFFSET + 1, } smem_mem_type_t; +/* Reserved-memory node names*/ +extern const char *rsvd_node; +extern const char *del_node[]; +extern const add_node_t add_node[]; void reset_crashdump(void); +int ipq_fdt_fixup_socinfo(void *blob); #endif /* _IPQ806X_H_ */ diff --git a/board/qca/ipq807x/ipq807x.c b/board/qca/ipq807x/ipq807x.c index 8cbb676fb2..4a95fe3c23 100644 --- a/board/qca/ipq807x/ipq807x.c +++ b/board/qca/ipq807x/ipq807x.c @@ -162,3 +162,8 @@ void board_pci_init(int id) return ; } + +int ipq_fdt_fixup_socinfo(void *blob) +{ + return 0; +} diff --git a/board/qca/ipq807x/ipq807x.h b/board/qca/ipq807x/ipq807x.h index 3e95225f0c..d29f74c74c 100644 --- a/board/qca/ipq807x/ipq807x.h +++ b/board/qca/ipq807x/ipq807x.h @@ -59,5 +59,6 @@ extern const add_node_t add_node[]; void reset_crashdump(void); void board_pci_init(int id); +int ipq_fdt_fixup_socinfo(void *blob); #endif /* _IPQ807X_H_ */