Skip to content

Commit

Permalink
Merge pull request #116 from YuzukiHD/dev
Browse files Browse the repository at this point in the history
fix r818 board new neon support with new driver
  • Loading branch information
SamulKyull committed Jul 5, 2024
2 parents 5c1e215 + 8c3e06c commit 4b38d9e
Show file tree
Hide file tree
Showing 7 changed files with 1,278 additions and 1,257 deletions.
14 changes: 14 additions & 0 deletions board/100ask-ros/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,20 @@ const uint32_t dram_para[32] = {
0x2023211f,
};

void neon_enable(void) {
/* set NSACR, both Secure and Non-secure access are allowed to NEON */
asm volatile("MRC p15, 0, r0, c1, c1, 2");
asm volatile("ORR r0, r0, #(0x3<<10) @ enable fpu/neon");
asm volatile("MCR p15, 0, r0, c1, c1, 2");
/* Set the CPACR for access to CP10 and CP11*/
asm volatile("LDR r0, =0xF00000");
asm volatile("MCR p15, 0, r0, c1, c0, 2");
/* Set the FPEXC EN bit to enable the FPU */
asm volatile("MOV r3, #0x40000000");
/*@VMSR FPEXC, r3*/
asm volatile("MCR p10, 7, r3, c8, c0, 0");
}

#define RTC_DATA_COLD_START (7)
#define CPUS_CODE_LENGTH (0x1000)
#define CPUS_VECTOR_LENGTH (0x4000)
Expand Down
2,509 changes: 1,255 additions & 1,254 deletions board/100ask-ros/payloads/init_dram_bin.c

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions board/100ask-ros/start.S
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ reset:

bl set_timer_count

bl neon_enable

bl main

clear_bss:
Expand Down
2 changes: 2 additions & 0 deletions board/100ask-ros/syter_boot/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ const msh_command_entry commands[] = {
int main(void) {
sunxi_serial_init(&uart_dbg);

printk_info("Checking SoC Version...\n");

ar100s_gpu_fix();

show_banner();
Expand Down
4 changes: 2 additions & 2 deletions cmake/board/100ask-ros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set(CONFIG_BOARD_100ASK_ROS True)
add_definitions(-DCONFIG_CHIP_SUN50IW10 -DCONFIG_CHIP_GPIO_V1)

set(CONFIG_USE_DRAM_PAYLOAD True)
set(CONFIG_USE_PREBUILT_DRAM_PAYLOAD True)
set(CONFIG_USE_PREBUILT_DRAM_PAYLOAD False)
set(CONFIG_USE_DRAM_PAYLOAD_SOURCE_PATH "${CMAKE_SOURCE_DIR}/payloads/sun50iw10_libdram")
set(CONFIG_USE_DRAM_PAYLOAD_BIN_PATH "${CONFIG_USE_DRAM_PAYLOAD_SOURCE_PATH}/output/ddr.bin")
set(CONFIG_USE_DRAM_PAYLOAD_FILE_PATH "${CMAKE_SOURCE_DIR}/board/100ask-ros/payloads/init_dram_bin.c")
Expand All @@ -26,7 +26,7 @@ set(CROSS_COMPILE ${CROSS_COMPILE} CACHE STRING "CROSS_COMPILE Toolchain")
set(CMAKE_C_COMPILER "${CROSS_COMPILE}gcc")
set(CMAKE_CXX_COMPILER "${CROSS_COMPILE}g++")

set(CMAKE_COMMON_FLAGS "-nostdlib -nostdinc -Os -mthumb-interwork -mthumb -mcpu=cortex-a53 -mno-unaligned-access")
set(CMAKE_COMMON_FLAGS "-nostdinc -nostdlib -Os -mthumb-interwork -mthumb -march=armv8-a -Wno-builtin-declaration-mismatch -fno-short-enums -mfpu=neon -mfloat-abi=softfp -pipe")

# Disable specific warning flags for C and C++ compilers
set(CMAKE_C_DISABLE_WARN_FLAGS "-Wno-int-to-pointer-cast -Wno-discarded-qualifiers -Wno-implicit-function-declaration")
Expand Down
2 changes: 1 addition & 1 deletion payloads
2 changes: 2 additions & 0 deletions src/arch/arm32/exception.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

#include <log.h>

extern void abort();

static void show_regs(struct arm_regs_t *regs) {
int i = 0;

Expand Down

0 comments on commit 4b38d9e

Please sign in to comment.