Skip to content

Commit

Permalink
[feat] merge link ld to one file and add arch
Browse files Browse the repository at this point in the history
  • Loading branch information
YuzukiTsuru committed Dec 22, 2023
1 parent d1102d1 commit 227f61a
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 67 deletions.
22 changes: 19 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,8 @@ set(CMAKE_SIZE "${CROSS_COMPILE}size")

set(CMAKE_MKSUNXI "${PROJECT_SOURCE_DIR}/tools/mksunxi")

set(LINK_SCRIPT_FEL ${CMAKE_SOURCE_DIR}/link/link_elf.ld)
set(LINK_SCRIPT_BIN ${CMAKE_SOURCE_DIR}/link/link_bin.ld)

set(LINK_SCRIPT_FEL ${PROJECT_BINARY_DIR}/link_elf.ld)
set(LINK_SCRIPT_BIN ${PROJECT_BINARY_DIR}/link_bin.ld)

set(CONFIG_ARCH_ARM32 True)
set(CONFIG_CHIP_SUN8IW21 True)
Expand All @@ -95,6 +94,23 @@ add_definitions(-DCONFIG_CHIP_SUN8IW21)

if (CONFIG_ARCH_ARM32)
set(ARCH_INCLUDE include/arch/arm32)

set(ARCH_START_ADDRESS "0x00020000")
set(ARCH_SRAM_LENGTH "128K")

configure_file(
"${PROJECT_SOURCE_DIR}/link/arm32/link.ld"
"${PROJECT_BINARY_DIR}/link_bin.ld"
)

set(ARCH_START_ADDRESS "0x00028000")
set(ARCH_SRAM_LENGTH "100K")

configure_file(
"${PROJECT_SOURCE_DIR}/link/arm32/link.ld"
"${PROJECT_BINARY_DIR}/link_elf.ld"
)

endif()

include_directories(
Expand Down
2 changes: 1 addition & 1 deletion link/link_bin.ld → link/arm32/link.ld
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SEARCH_DIR(.)
/* Memory Spaces Definitions */
MEMORY
{
ram (rwx) : ORIGIN = 0x00020000, LENGTH = 128K /* SRAMC. 132K on boot mode, 100K on FEL mode */
ram (rwx) : ORIGIN = @ARCH_START_ADDRESS@, LENGTH = @ARCH_SRAM_LENGTH@ /* SRAMC. 132K on boot mode, 100K on FEL mode */
}

/* The stack size used by the application. NOTE: you need to adjust according to your application. */
Expand Down
62 changes: 0 additions & 62 deletions link/link_elf.ld

This file was deleted.

4 changes: 3 additions & 1 deletion src/drivers/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
if (CONFIG_CHIP_SUN8IW21)
add_subdirectory(sun8iw21)
add_subdirectory(sun8iw21)
elseif(CONFIG_CHIP_SUN8IW20)
add_subdirectory(sun8iw20)
endif()

add_library(drivers-obj OBJECT
Expand Down
2 changes: 2 additions & 0 deletions src/drivers/sun8iw20/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
add_library(chip_drivers-obj OBJECT
)

0 comments on commit 227f61a

Please sign in to comment.