aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSimon Glass2018-10-01 13:22:25 -0500
committerSimon Glass2018-10-09 05:40:27 -0500
commit25a3845d2b0f4808b5fb75f5e059f94b732b7ada (patch)
treeba2366f4f2c2de5f5d5a8a767b732ef6d2b2e453 /lib
parent5e24a2ef8bf4f09b18cf4e943c73bfdd169a7581 (diff)
downloadu-boot-25a3845d2b0f4808b5fb75f5e059f94b732b7ada.tar.gz
u-boot-25a3845d2b0f4808b5fb75f5e059f94b732b7ada.tar.xz
u-boot-25a3845d2b0f4808b5fb75f5e059f94b732b7ada.zip
fdt: Remove fdtdec_decode_region() function
This function is not used in U-Boot now. Remove it along with its 'memory' version. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/fdtdec.c83
1 files changed, 0 insertions, 83 deletions
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 74196ce7f9..b1b39254bf 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -922,28 +922,6 @@ char *fdtdec_get_config_string(const void *blob, const char *prop_name)
922 return (char *)nodep; 922 return (char *)nodep;
923} 923}
924 924
925int fdtdec_decode_region(const void *blob, int node, const char *prop_name,
926 fdt_addr_t *basep, fdt_size_t *sizep)
927{
928 const fdt_addr_t *cell;
929 int len;
930
931 debug("%s: %s: %s\n", __func__, fdt_get_name(blob, node, NULL),
932 prop_name);
933 cell = fdt_getprop(blob, node, prop_name, &len);
934 if (!cell || (len < sizeof(fdt_addr_t) * 2)) {
935 debug("cell=%p, len=%d\n", cell, len);
936 return -1;
937 }
938
939 *basep = fdt_addr_to_cpu(*cell);
940 *sizep = fdt_size_to_cpu(cell[1]);
941 debug("%s: base=%08lx, size=%lx\n", __func__, (ulong)*basep,
942 (ulong)*sizep);
943
944 return 0;
945}
946
947u64 fdtdec_get_number(const fdt32_t *ptr, unsigned int cells) 925u64 fdtdec_get_number(const fdt32_t *ptr, unsigned int cells)
948{ 926{
949 u64 number = 0; 927 u64 number = 0;
@@ -1002,67 +980,6 @@ int fdt_get_named_resource(const void *fdt, int node, const char *property,
1002 return fdt_get_resource(fdt, node, property, index, res); 980 return fdt_get_resource(fdt, node, property, index, res);
1003} 981}
1004 982
1005int fdtdec_decode_memory_region(const void *blob, int config_node,
1006 const char *mem_type, const char *suffix,
1007 fdt_addr_t *basep, fdt_size_t *sizep)
1008{
1009 char prop_name[50];
1010 const char *mem;
1011 fdt_size_t size, offset_size;
1012 fdt_addr_t base, offset;
1013 int node;
1014
1015 if (config_node == -1) {
1016 config_node = fdt_path_offset(blob, "/config");
1017 if (config_node < 0) {
1018 debug("%s: Cannot find /config node\n", __func__);
1019 return -ENOENT;
1020 }
1021 }
1022 if (!suffix)
1023 suffix = "";
1024
1025 snprintf(prop_name, sizeof(prop_name), "%s-memory%s", mem_type,
1026 suffix);
1027 mem = fdt_getprop(blob, config_node, prop_name, NULL);
1028 if (!mem) {
1029 debug("%s: No memory type for '%s', using /memory\n", __func__,
1030 prop_name);
1031 mem = "/memory";
1032 }
1033
1034 node = fdt_path_offset(blob, mem);
1035 if (node < 0) {
1036 debug("%s: Failed to find node '%s': %s\n", __func__, mem,
1037 fdt_strerror(node));
1038 return -ENOENT;
1039 }
1040
1041 /*
1042 * Not strictly correct - the memory may have multiple banks. We just
1043 * use the first
1044 */
1045 if (fdtdec_decode_region(blob, node, "reg", &base, &size)) {
1046 debug("%s: Failed to decode memory region %s\n", __func__,
1047 mem);
1048 return -EINVAL;
1049 }
1050
1051 snprintf(prop_name, sizeof(prop_name), "%s-offset%s", mem_type,
1052 suffix);
1053 if (fdtdec_decode_region(blob, config_node, prop_name, &offset,
1054 &offset_size)) {
1055 debug("%s: Failed to decode memory region '%s'\n", __func__,
1056 prop_name);
1057 return -EINVAL;
1058 }
1059
1060 *basep = base + offset;
1061 *sizep = offset_size;
1062
1063 return 0;
1064}
1065
1066static int decode_timing_property(const void *blob, int node, const char *name, 983static int decode_timing_property(const void *blob, int node, const char *name,
1067 struct timing_entry *result) 984 struct timing_entry *result)
1068{ 985{