diff --git a/Makefile b/Makefile index 5c3c142..83d674b 100644 --- a/Makefile +++ b/Makefile @@ -103,6 +103,7 @@ export srctree objtree VPATH CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%) KERNEL_PATH ?= $(CONFIG_KERNEL_PATH:"%"=%) DT_PATH ?= $(CONFIG_DT_PATH:"%"=%) +TEXT_BASE ?= $(CONFIG_TEXT_BASE:"%"=%) KCONFIG_CONFIG ?= .config export KCONFIG_CONFIG @@ -360,7 +361,7 @@ quiet_cmd_uniLoader = LD $@.o cmd_uniLoader = $(LD) $(main-y) $(uniLoader-libs) -o $@.o --script=arch/$(ARCH)/linker.lds arch/$(ARCH)/linker.lds: arch/$(ARCH)/linker.lds.S $(KERNEL_PATH) - $(CPP) $< -DKERNEL_PATH=$(KERNEL_PATH) -DDTB_PATH=$(DT_PATH) -P -o $@ + $(CPP) $< -DTEXT_BASE=$(TEXT_BASE) -DKERNEL_PATH=$(KERNEL_PATH) -DDTB_PATH=$(DT_PATH) -P -o $@ uniLoader: $(uniLoader-all) $(call if_changed,uniLoader) diff --git a/arch/arm/Start.S b/arch/arm/Start.S index 3891e1e..4c66634 100644 --- a/arch/arm/Start.S +++ b/arch/arm/Start.S @@ -2,7 +2,9 @@ /* * Copyright (c) 2022, Ivaylo Ivanov */ +.global _start +_start: ldr r0, =dtb ldr r1, =kernel b main diff --git a/arch/arm/linker.lds.S b/arch/arm/linker.lds.S index f7a8574..90d2b76 100644 --- a/arch/arm/linker.lds.S +++ b/arch/arm/linker.lds.S @@ -9,7 +9,9 @@ INPUT(DTB_PATH) SECTIONS { - . = 0x80008000; + /* The default TEXT_BASE address is 0x0 if not specified otherwise, so compare it to 0x1 */ + __start_address = (TEXT_BASE > 0x1) ? TEXT_BASE : 0x80008000; + . = __start_address; .boot : { arch/arm/Start.o diff --git a/board/Kconfig b/board/Kconfig index f32ea3b..5bfec4f 100644 --- a/board/Kconfig +++ b/board/Kconfig @@ -55,23 +55,27 @@ menu "Device Support" help Say Y if you want to include support for Samsung Galaxy S20 - config SAMSUNG_J5LTE - bool "Support for Samsung Galaxy J5 2015" - default n - depends on QC32_8916 - help - Say Y if you want to include arm32 support for Samsung Galaxy J5 2015 - config SAMSUNG_J4LTE bool "Support for Samsung Galaxy J4 2018" default n depends on EXYNOS_7570 help Say Y if you want to include arm64 support for Samsung Galaxy J4 2018 + + config SAMSUNG_J5LTE + bool "Support for Samsung Galaxy J5 2015" + default n + depends on QC32_8916 + help + Say Y if you want to include arm32 support for Samsung Galaxy J5 2015 endmenu menu "Device Specific Addresses" + config TEXT_BASE + hex "UniLoader Text Base" + default 0x0 + config PAYLOAD_ENTRY hex "Payload Entry Address" default 0x830000000 if APPLE_N61AP @@ -82,9 +86,8 @@ menu "Device Specific Addresses" default 0x090000000 if SAMSUNG_DREAMLTE default 0x090000000 if SAMSUNG_STARLTE default 0x090000000 if SAMSUNG_X1S - default 0x090000000 if SAMSUNG_J5LTE default 0x050000000 if SAMSUNG_J4LTE - + default 0x090000000 if SAMSUNG_J5LTE config FRAMEBUFFER_BASE hex "Framebuffer Base Address (for SimpleFB)" @@ -97,8 +100,8 @@ menu "Device Specific Addresses" default 0x0cc000000 if SAMSUNG_DREAMLTE default 0x0cc000000 if SAMSUNG_STARLTE default 0x0F1000000 if SAMSUNG_X1S - default 0x08e000000 if SAMSUNG_J5LTE default 0x067000000 if SAMSUNG_J4LTE + default 0x08e000000 if SAMSUNG_J5LTE config FRAMEBUFFER_WIDTH int "Framebuffer Width (for SimpleFB)" @@ -111,8 +114,8 @@ menu "Device Specific Addresses" default 1440 if SAMSUNG_DREAMLTE default 1440 if SAMSUNG_STARLTE default 1440 if SAMSUNG_X1S - default 720 if SAMSUNG_J5LTE default 720 if SAMSUNG_J4LTE + default 720 if SAMSUNG_J5LTE config FRAMEBUFFER_HEIGHT int "Framebuffer Height (for SimpleFB)" @@ -125,8 +128,8 @@ menu "Device Specific Addresses" default 2960 if SAMSUNG_DREAMLTE default 2960 if SAMSUNG_STARLTE default 3200 if SAMSUNG_X1S - default 1280 if SAMSUNG_J5LTE default 1280 if SAMSUNG_J4LTE + default 1280 if SAMSUNG_J5LTE config FRAMEBUFFER_STRIDE int "Framebuffer Stride (for SimpleFB)" @@ -139,8 +142,8 @@ menu "Device Specific Addresses" default 4 if SAMSUNG_DREAMLTE default 4 if SAMSUNG_STARLTE default 4 if SAMSUNG_X1S - default 3 if SAMSUNG_J5LTE default 4 if SAMSUNG_J4LTE + default 3 if SAMSUNG_J5LTE config FRAMEBUFFER_BGRA bool "Framebuffer BGRA (for SimpleFB)" diff --git a/configs/j5lte_defconfig b/configs/j5lte_defconfig index 4f2c01b..4e05c30 100644 --- a/configs/j5lte_defconfig +++ b/configs/j5lte_defconfig @@ -1,3 +1,4 @@ CONFIG_CROSS_COMPILE="arm-none-eabi-" +CONFIG_TEXT_BASE=0x80008000 CONFIG_SAMSUNG_J5LTE=y CONFIG_QC32_8916=y