bsps: Add BSP_FDT_BLOB_COPY_TO_READ_ONLY_LOAD_AREA

This commit is contained in:
Sebastian Huber
2017-08-01 08:37:12 +02:00
parent ec25c6ef74
commit d8012bbd65
2 changed files with 5 additions and 2 deletions

View File

@@ -27,6 +27,9 @@ RTEMS_BSPOPTS_HELP([BSP_FDT_BLOB_SIZE_MAX],[maximum size of the FDT blob in byte
RTEMS_BSPOPTS_SET([BSP_FDT_BLOB_READ_ONLY],[*],[1])
RTEMS_BSPOPTS_HELP([BSP_FDT_BLOB_READ_ONLY],[place the FDT blob into the read-only data area])
RTEMS_BSPOPTS_SET([BSP_FDT_BLOB_COPY_TO_READ_ONLY_LOAD_AREA],[*],[1])
RTEMS_BSPOPTS_HELP([BSP_FDT_BLOB_COPY_TO_READ_ONLY_LOAD_AREA],[copy the FDT blob into the read-only load area via bsp_fdt_copy()])
RTEMS_BSPOPTS_SET([IS_DM3730],[beagleboard*],[1])
RTEMS_BSPOPTS_HELP([IS_DM3730],[true if SOC is DM3730])

View File

@@ -38,12 +38,12 @@ bsp_fdt_blob[BSP_FDT_BLOB_SIZE_MAX / sizeof(uint32_t)];
void bsp_fdt_copy(const void *src)
{
const uint32_t *s = (const uint32_t *) src;
#ifdef BSP_FDT_BLOB_READ_ONLY
#ifdef BSP_FDT_BLOB_COPY_TO_READ_ONLY_LOAD_AREA
uint32_t *d = (uint32_t *) ((uintptr_t) &bsp_fdt_blob[0]
- (uintptr_t) bsp_section_rodata_begin
+ (uintptr_t) bsp_section_rodata_load_begin);
#else
uint32_t *d = &bsp_fdt_blob[0];
uint32_t *d = RTEMS_DECONST(uint32_t *, &bsp_fdt_blob[0]);
#endif
if (s != d) {