Skip to content

Commit

Permalink
Update boards/ssrc/icicle after re-base
Browse files Browse the repository at this point in the history
Keep this target building still

Signed-off-by: Jukka Laitinen <[email protected]>
  • Loading branch information
jlaitine committed Oct 27, 2023
1 parent 81ecbfc commit e87cbdd
Show file tree
Hide file tree
Showing 13 changed files with 124 additions and 65 deletions.
8 changes: 3 additions & 5 deletions boards/ssrc/icicle/default.px4board
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ CONFIG_DRIVERS_SAFETY_BUTTON=y
CONFIG_DRIVERS_SMART_BATTERY_BATMON=y
CONFIG_COMMON_TELEMETRY=y
CONFIG_DRIVERS_TONE_ALARM=y

CONFIG_MODULES_AIRSPEED_SELECTOR=y
CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y
CONFIG_MODULES_BATTERY_STATUS=y
CONFIG_MODULES_COMMANDER=y
CONFIG_MODULES_CONTROL_ALLOCATOR=y
Expand All @@ -43,10 +41,10 @@ CONFIG_MODULES_EVENTS=y
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
CONFIG_MODULES_FW_ATT_CONTROL=y
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y
CONFIG_MODULES_FW_POS_CONTROL_L1=y
CONFIG_MODULES_FW_POS_CONTROL=y
CONFIG_MODULES_FW_RATE_CONTROL=y
CONFIG_MODULES_GIMBAL=y
CONFIG_MODULES_GYRO_CALIBRATION=y
CONFIG_MODULES_GYRO_FFT=y
CONFIG_MODULES_LAND_DETECTOR=y
CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y
CONFIG_MODULES_LOAD_MON=y
Expand All @@ -60,12 +58,12 @@ CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y
CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y
CONFIG_MODULES_MC_POS_CONTROL=y
CONFIG_MODULES_MC_RATE_CONTROL=y
CONFIG_MODULES_MICRODDS_CLIENT=y
CONFIG_MODULES_NAVIGATOR=y
CONFIG_MODULES_RC_UPDATE=y
CONFIG_MODULES_SENSORS=y
CONFIG_MODULES_SIMULATION_PWM_OUT_SIM=y
CONFIG_MODULES_TEMPERATURE_COMPENSATION=y
CONFIG_MODULES_UXRCE_DDS_CLIENT=y
CONFIG_MODULES_VTOL_ATT_CONTROL=y
CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y
CONFIG_SYSTEMCMDS_I2CDETECT=y
Expand Down
1 change: 1 addition & 0 deletions boards/ssrc/icicle/include/board_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
#define TOC_VERIFICATION_KEY 0
#define BOOT_VERIFICATION_KEY 0

#define ARB_COUNT 0
#endif
15 changes: 5 additions & 10 deletions boards/ssrc/icicle/nuttx-config/bootloader/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,30 +33,26 @@ CONFIG_COMPOSITE_VENDORID=0x16c0
CONFIG_COMPOSITE_VENDORSTR="SSRC"
CONFIG_DEBUG_FEATURES=y
CONFIG_DEFAULT_SMALL=y
CONFIG_FAT_DIRECT_RETRY=y
CONFIG_FAT_LCNAMES=y
CONFIG_FAT_LFN=y
CONFIG_FS_FAT=y
CONFIG_FS_LARGEFILE=y
CONFIG_GPT_PARTITION=y
CONFIG_IDLETHREAD_STACKSIZE=2048
CONFIG_INIT_ENTRYPOINT="bootloader_main"
CONFIG_INIT_STACKSIZE=8096
CONFIG_INTELHEX_BINARY=y
CONFIG_MBR_PARTITION=y
CONFIG_MMCSD=y
CONFIG_MMCSD_SDIO=y
CONFIG_MPFS_BOOTLOADER=y
CONFIG_MPFS_DDR_INIT=y
#CONFIG_MPFS_DDR_TYPE_LPDDR4=y
CONFIG_MPFS_EMMCSD=y
CONFIG_MPFS_EMMCSD_MUX_EMMC=y
CONFIG_MPFS_HART1_ENTRYPOINT=0x80200000
CONFIG_MPFS_HART1_ENTRYPOINT=0x80000000
CONFIG_MPFS_HART1_SBI=y
CONFIG_MPFS_HART2_ENTRYPOINT=0xACA00000
CONFIG_MPFS_HART3_ENTRYPOINT=0x80200000
CONFIG_MPFS_HART2_ENTRYPOINT=0xA0000000
CONFIG_MPFS_HART2_SBI=y
CONFIG_MPFS_HART3_ENTRYPOINT=0x80000000
CONFIG_MPFS_HART3_SBI=y
CONFIG_MPFS_HART4_ENTRYPOINT=0x80200000
CONFIG_MPFS_HART4_ENTRYPOINT=0x80000000
CONFIG_MPFS_HART4_SBI=y
CONFIG_MPFS_IHC_NUTTX_ON_HART1=0
CONFIG_MPFS_IHC_NUTTX_ON_HART2=1
Expand All @@ -71,7 +67,6 @@ CONFIG_MPFS_OPENSBI=y
CONFIG_MPFS_UART0=y
CONFIG_OPENSBI=y
CONFIG_OPENSBI_DOMAINS=y
CONFIG_PTABLE_PARTITION=y
CONFIG_RAM_SIZE=1048576
CONFIG_RAM_START=0x08000000
CONFIG_RAW_BINARY=y
Expand Down
4 changes: 2 additions & 2 deletions boards/ssrc/icicle/nuttx-config/include/board_liberodefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
#define LIBERO_SETTING_MSS_FMETER_DATAW 0x00000000
#define LIBERO_SETTING_MSS_FMETER_DATAR 0x00000000
#define LIBERO_SETTING_MSS_PLL_REF_FB 0x00000500
#define LIBERO_SETTING_MSS_PLL_CTRL 0x01000037
#define LIBERO_SETTING_MSS_PLL_DIV_0_1 0x01000200
#define LIBERO_SETTING_MSS_PLL_CTRL 0x0100003f
#define LIBERO_SETTING_MSS_PLL_DIV_0_1 0x06000200
#define LIBERO_SETTING_MSS_PLL_DIV_2_3 0x0f000600
#define LIBERO_SETTING_MSS_SSCG_REG_0 0x00000000
#define LIBERO_SETTING_MSS_SSCG_REG_1 0x00000000
Expand Down
10 changes: 4 additions & 6 deletions boards/ssrc/icicle/nuttx-config/nsh/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ CONFIG_DISABLE_MQUEUE=y
CONFIG_DISABLE_POSIX_TIMERS=y
CONFIG_EE24XX_FREQUENCY=400000
CONFIG_EEPROM=y
CONFIG_FAT_DIRECT_RETRY=y
CONFIG_FAT_LCNAMES=y
CONFIG_FAT_LFN=y
CONFIG_FDCLONE_STDIO=y
Expand Down Expand Up @@ -74,10 +73,8 @@ CONFIG_MEMSET_OPTSPEED=y
CONFIG_MMCSD=y
CONFIG_MMCSD_SDIO=y
CONFIG_MPFS_COREPWM0=y
CONFIG_MPFS_COREPWM0_PWMCLK=62500000
CONFIG_MPFS_COREPWM1=y
CONFIG_MPFS_COREPWM1_NCHANNELS=1
CONFIG_MPFS_COREPWM1_PWMCLK=62500000
CONFIG_MPFS_EMMCSD=y
CONFIG_MPFS_ENABLE_DPFPU=y
CONFIG_MPFS_ETHMAC_0=y
Expand All @@ -98,7 +95,7 @@ CONFIG_MTD=y
CONFIG_MTD_BYTE_WRITE=y
CONFIG_MTD_M25P=y
CONFIG_MTD_PARTITION=y
CONFIG_NAME_MAX=40
CONFIG_NAME_MAX=48
CONFIG_NET=y
CONFIG_NETDEV_IFINDEX=y
CONFIG_NETDEV_PHY_IOCTL=y
Expand Down Expand Up @@ -137,9 +134,9 @@ CONFIG_PRIORITY_INHERITANCE=y
CONFIG_PTABLE_PARTITION=y
CONFIG_PTHREAD_STACK_MIN=1024
CONFIG_PWM=y
CONFIG_PWM_NCHANNELS=8
CONFIG_PWM_NCHANNELS=10
CONFIG_RAM_SIZE=2097152
CONFIG_RAM_START=0xAD000000
CONFIG_RAM_START=0xA0600000
CONFIG_RAW_BINARY=y
CONFIG_READLINE_CMD_HISTORY=y
CONFIG_READLINE_TABCOMPLETION=y
Expand All @@ -151,6 +148,7 @@ CONFIG_SCHED_INSTRUMENTATION_SWITCH=y
CONFIG_SCHED_LPWORK=y
CONFIG_SCHED_LPWORKPRIORITY=50
CONFIG_SCHED_LPWORKSTACKSIZE=4096
CONFIG_SCHED_LPNTHREADS=2
CONFIG_SCHED_WAITPID=y
CONFIG_SEM_PREALLOCHOLDERS=32
CONFIG_SERIAL_NPOLLWAITERS=2
Expand Down
67 changes: 50 additions & 17 deletions boards/ssrc/icicle/nuttx-config/scripts/bootloader_script.ld
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,16 @@

MEMORY
{
envm (rx) : ORIGIN = 0x20220100, LENGTH = 128K - 256 /* 256 reserved for hss headers */
l2lim (rwx) : ORIGIN = 0x08000000, LENGTH = 1024k
l2zerodevice (rwx) : ORIGIN = 0x0A000000, LENGTH = 512k
envm (rx) : ORIGIN = 0x20220100, LENGTH = 110K - 256 /* 256 reserved for hss headers */
envm_sbi (rx) : ORIGIN = 0x2023B800, LENGTH = 18K
l2lim (rwx) : ORIGIN = 0x08000000, LENGTH = 128k
l2lim_sec (rw) : ORIGIN = 0x08020000, LENGTH = 32k
l2lim_info(rw) : ORIGIN = 0x08028000, LENGTH = 4k
l2lim_free (!rwx) : ORIGIN = 0x08029000, LENGTH = 348k
l2lim_rsvd (!rwx) : ORIGIN = 0x08080000, LENGTH = 512K /* Cache ways for L2 ZeroDevice */
l2_cache (!rwx) : ORIGIN = 0x08100000, LENGTH = 1024K
l2zerodevice (!rwx) : ORIGIN = 0x0A000000, LENGTH = 24k
opensbi (rwx) : ORIGIN = 0x0A006000, LENGTH = 488k
}

OUTPUT_ARCH("riscv")
Expand All @@ -87,6 +94,9 @@ EXTERN(__start)

SECTIONS
{
PROVIDE(__l2lim_start = ORIGIN(l2lim));
PROVIDE(__l2lim_end = ORIGIN(l2lim) + LENGTH(l2lim) + LENGTH(l2lim_sec) + LENGTH(l2lim_rsvd));

.l2_scratchpad : ALIGN(0x10)
{
__l2_scratchpad_load = LOADADDR(.l2_scratchpad);
Expand All @@ -101,6 +111,41 @@ SECTIONS

PROVIDE(__mpfs_nuttx_start = ORIGIN(l2lim));

/* Stabs debugging sections. */

.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_info 0 : { *(.debug_info) }
.debug_line 0 : { *(.debug_line) }
.debug_pubnames 0 : { *(.debug_pubnames) }
.debug_aranges 0 : { *(.debug_aranges) }
.debug_loc 0 : { *(.debug_loc) }
.debug_ranges 0 : { *(.debug_ranges) }
.debug_str 0 : { *(.debug_str) }
.debug_frame 0 : { *(.debug_frame) }

.text.sbi : ALIGN(4) {
_ssbi_zerodev = ABSOLUTE(.);
_sbi_zerodev_loadaddr = LOADADDR(.text.sbi);
sbi*(.text* .rodata*)
riscv_atomic* /* In purpose everything */
riscv_locks*(.text.* .rodata*)
riscv_asm*(.text.*)
mpfs_opensbi_trap* /* In purpose everything */
mpfs_opensbi*(.text.* .rodata*)
mpfs_ihc_sbi*(.text.* .rodata*)
aclint_mtimer*(.text.* .rodata*)
aclint_mswi*(.text.* .rodata*)
plic.*(.text.* .rodata*)
_esbi_zerodev = ABSOLUTE(.);
} > opensbi AT > envm_sbi

.text : {
_stext = ABSOLUTE(.);
*(.start .start.*)
Expand Down Expand Up @@ -151,18 +196,6 @@ SECTIONS

PROVIDE(__mpfs_nuttx_end = .);

/* Stabs debugging sections. */

.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_info 0 : { *(.debug_info) }
.debug_line 0 : { *(.debug_line) }
.debug_pubnames 0 : { *(.debug_pubnames) }
.debug_aranges 0 : { *(.debug_aranges) }
.secmem (NOLOAD) : ALIGN(4) {
} > l2lim_sec
}
12 changes: 10 additions & 2 deletions boards/ssrc/icicle/nuttx-config/scripts/script.ld
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@

MEMORY
{
progmem (rx) : ORIGIN = 0xACA00000, LENGTH = 6M /* w/ cache */
sram (rwx) : ORIGIN = 0xAD000000, LENGTH = 4M /* w/ cache */
l2lim_sec (rw) : ORIGIN = 0x08020000, LENGTH = 32k
l2lim_info (r) : ORIGIN = 0x08028000, LENGTH = 4k
progmem (rx) : ORIGIN = 0xA0000000, LENGTH = 6M /* w/ cache */
sram (rwx) : ORIGIN = 0xA0600000, LENGTH = 4M /* w/ cache */
}

OUTPUT_ARCH("riscv")
Expand Down Expand Up @@ -108,6 +110,12 @@ SECTIONS
_ebss = ABSOLUTE(.);
} > sram

.secmem (NOLOAD) : ALIGN(4) {
} > l2lim_sec

.deviceinfo (NOLOAD) : ALIGN(4) {
} > l2lim_info

/* Stabs debugging sections. */

.stab 0 : { *(.stab) }
Expand Down
3 changes: 2 additions & 1 deletion boards/ssrc/icicle/nuttx-config/scripts/toc.ld
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@

MEMORY
{
progmem (r) : ORIGIN = 0xACA00000, LENGTH = 6M - 64
/* -64 <- Leave room for the signature */
progmem (r) : ORIGIN = 0xA0000000, LENGTH = 128M - 64
}

OUTPUT_ARCH("riscv")
Expand Down
36 changes: 18 additions & 18 deletions boards/ssrc/icicle/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ if("${PX4_BOARD_LABEL}" STREQUAL "bootloader")
target_link_libraries(drivers_board
PRIVATE
nuttx_arch
nuttx_apps
nuttx_drivers
bootloader
)
Expand Down Expand Up @@ -70,32 +71,31 @@ else()
spi_drv.cpp
)
add_dependencies(drivers_board nuttx_context)

target_link_libraries(drivers_board
PRIVATE
drivers__led # drv_led_start
nuttx_arch
nuttx_drivers
)

if (CONFIG_OPENAMP)
target_link_libraries(drivers_board
PRIVATE
drivers__led # drv_led_start
nuttx_arch
nuttx_drivers
nuttx_openamp)
else()
target_link_libraries(drivers_board
PRIVATE
drivers__led # drv_led_start
nuttx_arch
nuttx_drivers)
target_link_libraries(drivers_board PRIVATE nuttx_openamp)
endif()

if (NOT DEFINED CONFIG_BUILD_FLAT)
target_link_libraries(drivers_board PRIVATE px4_kernel_layer)
target_link_libraries(drivers_board PRIVATE px4_kernel_layer board_bus_info)
target_compile_options(drivers_board PRIVATE -D__KERNEL__)
else()
target_link_libraries(drivers_board PRIVATE px4_layer board_bus_info)
endif()

add_library(drivers_userspace
init_entrypt.c
mpfs_userspace.c
)
add_dependencies(drivers_userspace nuttx_context)
if (CONFIG_BUILD_PROTECTED)
add_library(drivers_userspace
init_entrypt.c
mpfs_userspace.c
)
add_dependencies(drivers_userspace nuttx_context)
endif()

endif()
12 changes: 12 additions & 0 deletions boards/ssrc/icicle/src/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ __BEGIN_DECLS
extern void board_peripheral_reset(int ms);
extern int mpfs_board_emmcsd_init(void);
extern int mpfs_board_register_partition(unsigned partition);
extern int mpfs_board_ihc_init(void);
extern int mpfs_board_spinor_init(struct spi_dev_s *spinor);
extern int mpfs_pwm_setup(void);
extern void board_spidev_initialize(void);
Expand All @@ -153,8 +154,19 @@ extern int board_domains_init(void);
extern void mpfs_usbinitialize(void);
#endif

#ifdef CONFIG_NET_RPMSG_DRV
extern int net_rpmsg_drv_init(const char *cpuname, const char *devname, enum net_lltype_e lltype);
#endif

#if defined(CONFIG_FAT_DMAMEMORY) && defined(CONFIG_GRAN)
int mpfs_dma_alloc_init(void);
#endif

#include <px4_platform_common/board_common.h>

const char *board_bl_version_string(void);
#define PX4_BL_VERSION board_bl_version_string()

#endif /* __ASSEMBLY__ */

__END_DECLS
10 changes: 10 additions & 0 deletions boards/ssrc/icicle/src/bootloader_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#include <debug.h>
#include "riscv_internal.h"

extern int mpfs_dma_alloc_init(void);
extern int sercon_main(int c, char **argv);
__EXPORT void board_on_reset(int status) {}

Expand Down Expand Up @@ -129,6 +130,15 @@ __EXPORT void mpfs_boardinitialize(void)

void board_late_initialize(void)
{

#if defined(CONFIG_FAT_DMAMEMORY) && defined(CONFIG_GRAN)
/* configure the DMA allocator */

if (mpfs_dma_alloc_init() < 0) {
syslog(LOG_ERR, "[boot] DMA alloc FAILED\n");
}

#endif
}

int board_app_initialize(uintptr_t arg)
Expand Down
Loading

0 comments on commit e87cbdd

Please sign in to comment.