bsp/altera-cyclone-v: Make FDT support optional

This commit is contained in:
Sebastian Huber
2019-02-15 12:07:23 +01:00
parent 3d65f457ea
commit 43fbb50ff0
4 changed files with 20 additions and 3 deletions

View File

@@ -27,8 +27,6 @@
#define BSP_FEATURE_IRQ_EXTENSION
#define BSP_FDT_IS_SUPPORTED
#ifndef ASM
#include <rtems.h>

View File

@@ -15,6 +15,8 @@
#include <libfdt.h>
#ifdef BSP_FDT_IS_SUPPORTED
#define AREA_COUNT_MAX 16
static const char memory_path[] = "/memory";
@@ -147,17 +149,26 @@ static size_t remove_reserved_memory(
return area_count;
}
#else /* !BSP_FDT_IS_SUPPORTED */
#define AREA_COUNT_MAX 1
#endif /* BSP_FDT_IS_SUPPORTED */
void bsp_work_area_initialize(void)
{
const void *fdt;
Heap_Area areas[AREA_COUNT_MAX];
size_t area_count;
#ifdef BSP_FDT_IS_SUPPORTED
const void *fdt;
size_t i;
#endif
areas[0].begin = bsp_section_work_begin;
areas[0].size = (uintptr_t) bsp_section_work_size;
area_count = 1;
#ifdef BSP_FDT_IS_SUPPORTED
fdt = bsp_fdt_get();
adjust_memory_size(fdt, &areas[0]);
@@ -170,6 +181,7 @@ void bsp_work_area_initialize(void)
ARMV7_MMU_READ_WRITE_CACHED
);
}
#endif
bsp_work_area_initialize_with_table(areas, area_count);
}

View File

@@ -21,6 +21,7 @@
#include <libfdt.h>
#ifdef BSP_FDT_IS_SUPPORTED
uint32_t bsp_fdt_map_intr(const uint32_t *intr, size_t icells)
{
return intr[1] + 32;
@@ -90,10 +91,13 @@ static void update_clocks(void)
set_clock_by_output_name(fdt, ALT_CLK_F2H_PERIPH_REF, "hps_0_f2s_periph_ref_clk-clk");
set_clock_by_output_name(fdt, ALT_CLK_F2H_SDRAM_REF, "hps_0_f2s_sdram_ref_clk-clk");
}
#endif
void bsp_start(void)
{
#ifdef BSP_FDT_IS_SUPPORTED
update_clocks();
#endif
bsp_interrupt_initialize();
rtems_cache_coherent_add_area(
bsp_section_nocacheheap_begin,

View File

@@ -27,6 +27,9 @@ RTEMS_BSPOPTS_HELP([BSP_DATA_CACHE_ENABLED],[enable data cache])
RTEMS_BSPOPTS_SET([BSP_INSTRUCTION_CACHE_ENABLED],[*],[1])
RTEMS_BSPOPTS_HELP([BSP_INSTRUCTION_CACHE_ENABLED],[enable instruction cache])
RTEMS_BSPOPTS_SET([BSP_FDT_IS_SUPPORTED],[*],[1])
RTEMS_BSPOPTS_HELP([BSP_FDT_IS_SUPPORTED],[define if FDT is supported])
RTEMS_BSPOPTS_SET([BSP_START_COPY_FDT_FROM_U_BOOT],[*],[1])
RTEMS_BSPOPTS_HELP([BSP_START_COPY_FDT_FROM_U_BOOT],[copy the U-Boot provided FDT to an internal storage])