From f3b84a3032dd989a029320d9512846f48276db95 Mon Sep 17 00:00:00 2001 From: Andrew Bradford Date: Fri, 7 Aug 2015 08:36:35 -0400 Subject: x86: baytrail: Configure FSP UPD from device tree Allow for configuration of FSP UPD from the device tree which will override any settings which the FSP was built with itself. Modify the MinnowMax and BayleyBay boards to transfer sensible UPD settings from the Intel FSPv4 Gold release to the respective dts files, with the condition that the memory-down parameters for MinnowMax are also used. Signed-off-by: Andrew Bradford Reviewed-by: Bin Meng Tested-by: Bin Meng Removed fsp,mrc-debug-msg and fsp,enable-xhci for minnowmax, bayleybay Fixed lines >80col Signed-off-by: Simon Glass --- lib/fdtdec.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib') diff --git a/lib/fdtdec.c b/lib/fdtdec.c index b2017872fae..cdfc844a20b 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -76,6 +76,8 @@ static const char * const compat_names[COMPAT_COUNT] = { COMPAT(COMPAT_INTEL_PCH, "intel,bd82x6x"), COMPAT(COMPAT_INTEL_IRQ_ROUTER, "intel,irq-router"), COMPAT(ALTERA_SOCFPGA_DWMAC, "altr,socfpga-stmmac"), + COMPAT(COMPAT_INTEL_BAYTRAIL_FSP, "intel,baytrail-fsp"), + COMPAT(COMPAT_INTEL_BAYTRAIL_FSP_MDP, "intel,baytrail-fsp-mdp"), }; const char *fdtdec_get_compatible(enum fdt_compat_id id) -- cgit v1.3.1 From 236efe36be6d1c544f9477f10fdf38a17cd7a869 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 2 Aug 2015 18:13:50 -0600 Subject: Revert "fdt: Fix fdtdec_get_addr_size() for 64-bit" This reverts commit 5b34436035fc862b5e8d0d2c3eab74ba36f1a7f4. This function has a few problems. It calls fdt_parent_offset() which as mentioned in code review is very slow. https://patchwork.ozlabs.org/patch/499482/ https://patchwork.ozlabs.org/patch/452604/ It also happens to break SPI flash on Minnowboard max which is how I noticed that this was applied. I can send a patch to tidy that up, but in any case I think we should consider a revert until the function is better implemented. Signed-off-by: Simon Glass --- lib/fdtdec.c | 56 ++++++++++++++++++++------------------------------------ 1 file changed, 20 insertions(+), 36 deletions(-) (limited to 'lib') diff --git a/lib/fdtdec.c b/lib/fdtdec.c index cdfc844a20b..d21fb74c22d 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -90,45 +90,29 @@ const char *fdtdec_get_compatible(enum fdt_compat_id id) fdt_addr_t fdtdec_get_addr_size(const void *blob, int node, const char *prop_name, fdt_size_t *sizep) { - const fdt32_t *ptr, *end; - int parent, na, ns, len; - fdt_addr_t addr; + const fdt_addr_t *cell; + int len; debug("%s: %s: ", __func__, prop_name); - - parent = fdt_parent_offset(blob, node); - if (parent < 0) { - debug("(no parent found)\n"); - return FDT_ADDR_T_NONE; - } - - na = fdt_address_cells(blob, parent); - ns = fdt_size_cells(blob, parent); - - ptr = fdt_getprop(blob, node, prop_name, &len); - if (!ptr) { - debug("(not found)\n"); - return FDT_ADDR_T_NONE; - } - - end = ptr + len / sizeof(*ptr); - - if (ptr + na + ns > end) { - debug("(not enough data: expected %d bytes, got %d bytes)\n", - (na + ns) * 4, len); - return FDT_ADDR_T_NONE; - } - - addr = fdtdec_get_number(ptr, na); - - if (sizep) { - *sizep = fdtdec_get_number(ptr + na, ns); - debug("addr=%pa, size=%pa\n", &addr, sizep); - } else { - debug("%pa\n", &addr); + cell = fdt_getprop(blob, node, prop_name, &len); + if (cell && ((!sizep && len == sizeof(fdt_addr_t)) || + len == sizeof(fdt_addr_t) * 2)) { + fdt_addr_t addr = fdt_addr_to_cpu(*cell); + if (sizep) { + const fdt_size_t *size; + + size = (fdt_size_t *)((char *)cell + + sizeof(fdt_addr_t)); + *sizep = fdt_size_to_cpu(*size); + debug("addr=%08lx, size=%llx\n", + (ulong)addr, (u64)*sizep); + } else { + debug("%08lx\n", (ulong)addr); + } + return addr; } - - return addr; + debug("(not found)\n"); + return FDT_ADDR_T_NONE; } fdt_addr_t fdtdec_get_addr(const void *blob, int node, -- cgit v1.3.1