Skip to contentSkip to conversation

ARM: Set proper TEXT_OFFSET for IPQ806x

PATCH In review Varadarajan Narayanan 3 participants 5 messages Aug 20, 2015 – Aug 21, 2015

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: Set proper TEXT_OFFSET for IPQ806x

RAM starts at 0x40000000 for IPQ. The lower 21MB of RAM is used for Shared Memory and the kernel can start from 0x41500000. However, this cannot be accomodated within the current AUTO_ZRELADDR framework. If textofs-y is set to 0x01508000, compilation breaks with

	arch/arm/kernel/head.S:181:
		Error: invalid constant (1508000) after fixup

Hence, cannot use Linux's self extractor. Instead, create a compressed image that will be de-compressed from U-Boot.

arch/arm/Makefile +2 -0
index 07ab3d2..cce8ea6 100644
@@ -142,6 +142,8 @@ textofs-$(CONFIG_SA1111) := 0x00208000
 endif
 textofs-$(CONFIG_ARCH_MSM8X60) := 0x00208000
 textofs-$(CONFIG_ARCH_MSM8960) := 0x00208000
+textofs-$(CONFIG_ARCH_IPQ8064) := 0x00008000
+
 textofs-$(CONFIG_ARCH_AXXIA) := 0x00308000
 
 # Machine directory name.  This list is sorted alphanumerically
arch/arm/configs/ipq_defconfig new file +175 -0

175 lines not on this page · raw message

arch/arm/mach-qcom/Kconfig +4 -0
index 2256cd1..fab49a2 100644
@@ -22,4 +22,8 @@ config ARCH_MSM8974
 	bool "Enable support for MSM8974"
 	select HAVE_ARM_ARCH_TIMER
 
+config ARCH_IPQ8064
+	bool "Enable support for IPQ806x"
+	select CLKSRC_QCOM
+
 endif
#1 lore raw
Quoted 2 lines · Varadarajan Narayanan

RAM starts at 0x40000000 for IPQ. The lower 21MB of RAM is used for Shared Memory and the kernel can start from 0x41500000.

Why do people keep creating crap like this? Each time something like this is created, it means that you _need_ to have a special kernel for your platform and you can't be part of the single zImage.

Please, rather than creating crap like this, find a better way.

Signature · 2 lines
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
#2 lore raw
Quoted 9 lines · Russell King - ARM Linux
Quoted 2 lines · Varadarajan Narayanan

RAM starts at 0x40000000 for IPQ. The lower 21MB of RAM is used for Shared Memory and the kernel can start from 0x41500000.

Why do people keep creating crap like this? Each time something like this is created, it means that you _need_ to have a special kernel for your platform and you can't be part of the single zImage.

Please, rather than creating crap like this, find a better way.

In the case of the IPQ, we don't use the zImage because the decompress requires a larger jump than we can do on that platform. Having this change at least gets us back 2MB of memory.

Signature · 3 lines
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#3 lore raw
Quoted 9 lines · Andy Gross
Quoted 8 lines · Russell King - ARM Linux
Quoted 2 lines · Varadarajan Narayanan

RAM starts at 0x40000000 for IPQ. The lower 21MB of RAM is used for Shared Memory and the kernel can start from 0x41500000.

Why do people keep creating crap like this? Each time something like this is created, it means that you _need_ to have a special kernel for your platform and you can't be part of the single zImage.

Quoted 5 lines
Quoted 1 line

Please, rather than creating crap like this, find a better way.

In the case of the IPQ, we don't use the zImage because the decompress requires a larger jump than we can do on that platform. Having this change at least gets us back 2MB of memory.

Your argument about "a larger jump" makes no sense what so ever. The branches between the decompressor and the main kernel are all done using a mov, which can jump to any 32-bit address.

Even if you load the compressed kernel image at 0x41500000, the decompressor will mask that with 0xf8000000, and decide that RAM starts at 0x40000000. It will then want to place the decompressed kernel image at 0x40008000. Nothing there has anything to do with jump ranges.

The only restriction that the ARM has as far as jump ranges are concerned is the 'b' or 'bl' instruction, which in ARM mode is limited to +/- 32MB. That doesn't apply here since we don't use that to jump between the decompressor and the decompressed kernel image.

So...

Why is it necessary to have this 21MB block of shared memory at the start of RAM? Why can't it be reserved by other means higher up in system memory?

It's up to the submitter to justify why any change is required, and in this case, part of that justification is why the shared memory is placed at the start of RAM, and why you need to be different from almost everyone else, and why you need to be a special case. The justification also must make sense.

Signature · 2 lines
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
#4 lore raw
Quoted 20 lines · Russell King - ARM Linux
Quoted 9 lines · Andy Gross
Quoted 8 lines · Russell King - ARM Linux
Quoted 2 lines · Varadarajan Narayanan

RAM starts at 0x40000000 for IPQ. The lower 21MB of RAM is used for Shared Memory and the kernel can start from 0x41500000.

Why do people keep creating crap like this? Each time something like this is created, it means that you _need_ to have a special kernel for your platform and you can't be part of the single zImage.

Quoted 5 lines
Quoted 1 line

Please, rather than creating crap like this, find a better way.

In the case of the IPQ, we don't use the zImage because the decompress requires a larger jump than we can do on that platform. Having this change at least gets us back 2MB of memory.

Your argument about "a larger jump" makes no sense what so ever. The branches between the decompressor and the main kernel are all done using a mov, which can jump to any 32-bit address.

Quoted 5 lines

Even if you load the compressed kernel image at 0x41500000, the decompressor will mask that with 0xf8000000, and decide that RAM starts at 0x40000000. It will then want to place the decompressed kernel image at 0x40008000. Nothing there has anything to do with jump ranges.

With the qcom_defconfig, the kernel gets loaded at 0x40008000. This region is reserved for NSS.

Quoted 11 lines

The only restriction that the ARM has as far as jump ranges are concerned is the 'b' or 'bl' instruction, which in ARM mode is limited to +/- 32MB. That doesn't apply here since we don't use that to jump between the decompressor and the decompressed kernel image.

So...

Why is it necessary to have this 21MB block of shared memory at the start of RAM? Why can't it be reserved by other means higher up in system memory?

The NSS subsystem needs memory to be reserved at 0x40000000. The Ubi32 cores (part of NSS) need low address memory close to the Ubi32 address space to do short calls from what is called Ubi32 On Chip Memory to DDR and back again. Since there isn't a way to circumvent this restriction had to reserve at 0x40000000.

-Varada

Quoted 14 lines

It's up to the submitter to justify why any change is required, and in this case, part of that justification is why the shared memory is placed at the start of RAM, and why you need to be different from almost everyone else, and why you need to be a special case. The justification also must make sense.

--
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up according to speedtest.net.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel