History

remoteproc: Use u64 type for boot_addr

elf64 entry is defined as a u64. Since boot_addr is used to store the elf entry point, change boot_addr type to u64 to support both elf32 and elf64. In the same time, fix users that were using this variable.

Clement Leger committed 6 years ago

Commit e4ae4b71 parent 096ee784 files · +6 −6Browse files

Unified · Split

4 files
  1. drivers/remoteproc/remoteproc_elf_loader.c +1 −1
  2. drivers/remoteproc/remoteproc_internal.h +2 −2
  3. drivers/remoteproc/st_remoteproc.c +1 −1
  4. include/linux/remoteproc.h +2 −2
drivers/remoteproc/remoteproc_elf_loader.c+1−1
@@ -102,7 +102,7 @@ EXPORT_SYMBOL(rproc_elf_sanity_check); · 101 unmodified lines
102 * Note that the boot address is not a configurable property of all remote102 * Note that the boot address is not a configurable property of all remote
103 * processors. Some will always boot at a specific hard-coded address.103 * processors. Some will always boot at a specific hard-coded address.
104 */104 */
105u32 rproc_elf_get_boot_addr(struct rproc *rproc, const struct firmware *fw)105u64 rproc_elf_get_boot_addr(struct rproc *rproc, const struct firmware *fw)
106{106{
107 struct elf32_hdr *ehdr = (struct elf32_hdr *)fw->data;107 struct elf32_hdr *ehdr = (struct elf32_hdr *)fw->data;
108 108
drivers/remoteproc/remoteproc_internal.h+2−2
@@ -55,7 +55,7 @@ phys_addr_t rproc_va_to_pa(void *cpu_addr); · 54 unmodified lines
55int rproc_trigger_recovery(struct rproc *rproc);55int rproc_trigger_recovery(struct rproc *rproc);
56 56
57int rproc_elf_sanity_check(struct rproc *rproc, const struct firmware *fw);57int rproc_elf_sanity_check(struct rproc *rproc, const struct firmware *fw);
58u32 rproc_elf_get_boot_addr(struct rproc *rproc, const struct firmware *fw);58u64 rproc_elf_get_boot_addr(struct rproc *rproc, const struct firmware *fw);
59int rproc_elf_load_segments(struct rproc *rproc, const struct firmware *fw);59int rproc_elf_load_segments(struct rproc *rproc, const struct firmware *fw);
60int rproc_elf_load_rsc_table(struct rproc *rproc, const struct firmware *fw);60int rproc_elf_load_rsc_table(struct rproc *rproc, const struct firmware *fw);
61struct resource_table *rproc_elf_find_loaded_rsc_table(struct rproc *rproc,61struct resource_table *rproc_elf_find_loaded_rsc_table(struct rproc *rproc,
@@ -73,7 +73,7 @@ int rproc_fw_sanity_check(struct rproc *rproc, const struct firmware *fw) · 11 unmodified lines
73}73}
74 74
75static inline75static inline
76u32 rproc_get_boot_addr(struct rproc *rproc, const struct firmware *fw)76u64 rproc_get_boot_addr(struct rproc *rproc, const struct firmware *fw)
77{77{
78 if (rproc->ops->get_boot_addr)78 if (rproc->ops->get_boot_addr)
79 return rproc->ops->get_boot_addr(rproc, fw);79 return rproc->ops->get_boot_addr(rproc, fw);
drivers/remoteproc/st_remoteproc.c+1−1
@@ -190,7 +190,7 @@ static int st_rproc_start(struct rproc *rproc) · 189 unmodified lines
190 }190 }
191 }191 }
192 192
193 dev_info(&rproc->dev, "Started from 0x%x\n", rproc->bootaddr);193 dev_info(&rproc->dev, "Started from 0x%llx\n", rproc->bootaddr);
194 194
195 return 0;195 return 0;
196 196
include/linux/remoteproc.h+2−2
@@ -382,7 +382,7 @@ struct rproc_ops { · 381 unmodified lines
382 struct rproc *rproc, const struct firmware *fw);382 struct rproc *rproc, const struct firmware *fw);
383 int (*load)(struct rproc *rproc, const struct firmware *fw);383 int (*load)(struct rproc *rproc, const struct firmware *fw);
384 int (*sanity_check)(struct rproc *rproc, const struct firmware *fw);384 int (*sanity_check)(struct rproc *rproc, const struct firmware *fw);
385 u32 (*get_boot_addr)(struct rproc *rproc, const struct firmware *fw);385 u64 (*get_boot_addr)(struct rproc *rproc, const struct firmware *fw);
386};386};
387 387
388/**388/**
@@ -498,7 +498,7 @@ struct rproc { · 109 unmodified lines
498 int num_traces;498 int num_traces;
499 struct list_head carveouts;499 struct list_head carveouts;
500 struct list_head mappings;500 struct list_head mappings;
501 u32 bootaddr;501 u64 bootaddr;
502 struct list_head rvdevs;502 struct list_head rvdevs;
503 struct list_head subdevs;503 struct list_head subdevs;
504 struct idr notifyids;504 struct idr notifyids;