diff mbox

ARM: Set proper TEXT_OFFSET for IPQ806x

Message ID 20150820121541.GA14664@codeaurora.org (mailing list archive)
State New, archived
Headers show

Commit Message

Varadarajan Narayanan Aug. 20, 2015, 12:15 p.m. UTC
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.

Signed-off-by: Varadarajan Narayanan <varada@codeaurora.org>

Comments

Russell King - ARM Linux Aug. 20, 2015, 1 p.m. UTC | #1
On Thu, Aug 20, 2015 at 05:45:41PM +0530, Varadarajan Narayanan wrote:
> 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.
Andy Gross Aug. 20, 2015, 5:20 p.m. UTC | #2
On Thu, Aug 20, 2015 at 02:00:06PM +0100, Russell King - ARM Linux wrote:
> On Thu, Aug 20, 2015 at 05:45:41PM +0530, Varadarajan Narayanan wrote:
> > 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.
Russell King - ARM Linux Aug. 20, 2015, 7:54 p.m. UTC | #3
On Thu, Aug 20, 2015 at 12:20:10PM -0500, Andy Gross wrote:
> On Thu, Aug 20, 2015 at 02:00:06PM +0100, Russell King - ARM Linux wrote:
> > On Thu, Aug 20, 2015 at 05:45:41PM +0530, Varadarajan Narayanan wrote:
> > > 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.

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.
Varadarajan Narayanan Aug. 21, 2015, 4:59 a.m. UTC | #4
On Thu, Aug 20, 2015 at 08:54:55PM +0100, Russell King - ARM Linux wrote:
> On Thu, Aug 20, 2015 at 12:20:10PM -0500, Andy Gross wrote:
> > On Thu, Aug 20, 2015 at 02:00:06PM +0100, Russell King - ARM Linux wrote:
> > > On Thu, Aug 20, 2015 at 05:45:41PM +0530, Varadarajan Narayanan wrote:
> > > > 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.
>
> 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.

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

> 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

> 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@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
diff mbox

Patch

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 07ab3d2..cce8ea6 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -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
diff --git a/arch/arm/configs/ipq_defconfig b/arch/arm/configs/ipq_defconfig
new file mode 100644
index 0000000..8562a2f
--- /dev/null
+++ b/arch/arm/configs/ipq_defconfig
@@ -0,0 +1,175 @@ 
+CONFIG_SYSVIPC=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS_ALL=y
+CONFIG_EMBEDDED=y
+# CONFIG_SLUB_DEBUG is not set
+# CONFIG_COMPAT_BRK is not set
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=y
+CONFIG_KPROBES=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_ARCH_QCOM=y
+CONFIG_ARCH_MSM8X60=y
+CONFIG_ARCH_MSM8960=y
+CONFIG_ARCH_MSM8974=y
+CONFIG_ARCH_IPQ8064=y
+CONFIG_SMP=y
+CONFIG_PREEMPT=y
+CONFIG_AEABI=y
+CONFIG_HIGHMEM=y
+CONFIG_HIGHPTE=y
+CONFIG_CLEANCACHE=y
+CONFIG_ARM_APPENDED_DTB=y
+CONFIG_ARM_ATAG_DTB_COMPAT=y
+CONFIG_CPU_IDLE=y
+CONFIG_ARM_CPUIDLE=y
+CONFIG_VFP=y
+CONFIG_NEON=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_VERBOSE=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+# CONFIG_IPV6 is not set
+CONFIG_CFG80211=y
+CONFIG_RFKILL=y
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_MTD=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_M25P80=y
+CONFIG_MTD_SPI_NOR=y
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_RAM=y
+CONFIG_SCSI=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_CHR_DEV_SG=y
+CONFIG_CHR_DEV_SCH=y
+CONFIG_SCSI_CONSTANTS=y
+CONFIG_SCSI_LOGGING=y
+CONFIG_SCSI_SCAN_ASYNC=y
+CONFIG_NETDEVICES=y
+CONFIG_DUMMY=y
+CONFIG_MDIO_BITBANG=y
+CONFIG_MDIO_GPIO=y
+CONFIG_SLIP=y
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_SLIP_MODE_SLIP6=y
+CONFIG_USB_USBNET=y
+# CONFIG_USB_NET_AX8817X is not set
+# CONFIG_USB_NET_ZAURUS is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_KEYBOARD_ATKBD is not set
+# CONFIG_MOUSE_PS2 is not set
+CONFIG_INPUT_JOYSTICK=y
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_UINPUT=y
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_SERIAL_MSM=y
+CONFIG_SERIAL_MSM_CONSOLE=y
+CONFIG_HW_RANDOM=y
+CONFIG_I2C=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_QUP=y
+CONFIG_SPI=y
+CONFIG_SPI_QUP=y
+CONFIG_SPMI=y
+CONFIG_PINCTRL_APQ8064=y
+CONFIG_PINCTRL_APQ8084=y
+CONFIG_PINCTRL_IPQ8064=y
+CONFIG_PINCTRL_MSM8960=y
+CONFIG_PINCTRL_MSM8X74=y
+CONFIG_GPIOLIB=y
+CONFIG_DEBUG_GPIO=y
+CONFIG_GPIO_SYSFS=y
+CONFIG_POWER_RESET=y
+CONFIG_POWER_RESET_MSM=y
+CONFIG_THERMAL=y
+CONFIG_REGULATOR=y
+CONFIG_REGULATOR_FIXED_VOLTAGE=y
+CONFIG_MEDIA_SUPPORT=y
+CONFIG_FB=y
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_DYNAMIC_MINORS=y
+# CONFIG_SND_ARM is not set
+# CONFIG_SND_SPI is not set
+# CONFIG_SND_USB is not set
+CONFIG_SND_SOC=y
+CONFIG_HID_BATTERY_STRENGTH=y
+CONFIG_USB=y
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
+CONFIG_USB_MON=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_ACM=y
+CONFIG_USB_SERIAL=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DEBUG_FILES=y
+CONFIG_USB_GADGET_VBUS_DRAW=500
+CONFIG_MMC=y
+CONFIG_MMC_BLOCK_MINORS=32
+CONFIG_MMC_ARMMMCI=y
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_PLTFM=y
+CONFIG_MMC_SDHCI_MSM=y
+CONFIG_RTC_CLASS=y
+CONFIG_DMADEVICES=y
+CONFIG_QCOM_BAM_DMA=y
+CONFIG_STAGING=y
+CONFIG_COMMON_CLK_QCOM=y
+CONFIG_APQ_MMCC_8084=y
+CONFIG_IPQ_LCC_806X=y
+CONFIG_MSM_GCC_8660=y
+CONFIG_MSM_LCC_8960=y
+CONFIG_MSM_MMCC_8960=y
+CONFIG_MSM_MMCC_8974=y
+CONFIG_MSM_IOMMU=y
+CONFIG_QCOM_GSBI=y
+CONFIG_QCOM_PM=y
+CONFIG_PHY_QCOM_APQ8064_SATA=y
+CONFIG_PHY_QCOM_IPQ806X_SATA=y
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT3_FS=y
+# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+CONFIG_EXT4_FS=y
+CONFIG_FUSE_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_TMPFS=y
+CONFIG_JFFS2_FS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+CONFIG_CIFS=y
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_ASCII=y
+CONFIG_NLS_ISO8859_1=y
+CONFIG_NLS_UTF8=y
+CONFIG_PRINTK_TIME=y
+CONFIG_DYNAMIC_DEBUG=y
+CONFIG_DEBUG_INFO=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_LOCKUP_DETECTOR=y
+# CONFIG_DETECT_HUNG_TASK is not set
+# CONFIG_SCHED_DEBUG is not set
+CONFIG_TIMER_STATS=y
diff --git a/arch/arm/mach-qcom/Kconfig b/arch/arm/mach-qcom/Kconfig
index 2256cd1..fab49a2 100644
--- a/arch/arm/mach-qcom/Kconfig
+++ b/arch/arm/mach-qcom/Kconfig
@@ -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