Skip to content

Commit

Permalink
ARM: msm: GCC Version change.
Browse files Browse the repository at this point in the history
- This reverts commit 1e3bae2.
- Changing gcc toolchain to 4.9 version.
- Fix linker error of unknown CPU architecture by
  adding CONFIG_MSM_CORTEX_A7 in the arch options
  for the GCC. The issue is seen after bump up to
  gcc-4.9.
- Fix section mismatch errors after upgrading gcc to 4.9
  version. To fix these errors variables are moved to
  appropriate sections.

Change-Id: I7b5c9212e63826a0cb5b7e4ab161737ae87a2157
Signed-off-by: Samir Mehta <samirn@codeaurora.org>
  • Loading branch information
Samir Mehta authored and Gerrit - the friendly Code Review server committed Sep 18, 2015
1 parent 8638eea commit 1ec0b65
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 37 deletions.
17 changes: 8 additions & 9 deletions AndroidKernel.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ KERNEL_HEADERS_INSTALL := $(KERNEL_OUT)/usr
KERNEL_MODULES_INSTALL := system
KERNEL_MODULES_OUT := $(TARGET_OUT)/lib/modules
KERNEL_IMG=$(KERNEL_OUT)/arch/arm/boot/Image
CROSS_COMPILE_PATH=$(ANDROID_BUILD_TOP)/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin/

DTS_NAMES ?= $(shell $(PERL) -e 'while (<>) {$$a = $$1 if /CONFIG_ARCH_((?:MSM|QSD|MPQ)[a-zA-Z0-9]+)=y/; $$r = $$1 if /CONFIG_MSM_SOC_REV_(?!NONE)(\w+)=y/; $$arch = $$arch.lc("$$a$$r ") if /CONFIG_ARCH_((?:MSM|QSD|MPQ)[a-zA-Z0-9]+)=y/} print $$arch;' $(KERNEL_CONFIG))
KERNEL_USE_OF ?= $(shell $(PERL) -e '$$of = "n"; while (<>) { if (/CONFIG_USE_OF=y/) { $$of = "y"; break; } } print $$of;' kernel/arch/arm/configs/$(KERNEL_DEFCONFIG))
Expand Down Expand Up @@ -72,30 +71,30 @@ $(KERNEL_OUT):
mkdir -p $(KERNEL_OUT)

$(KERNEL_CONFIG): $(KERNEL_OUT)
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE_PATH)arm-eabi- $(KERNEL_DEFCONFIG)
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-linux-androideabi- $(KERNEL_DEFCONFIG)

$(KERNEL_OUT)/piggy : $(TARGET_PREBUILT_INT_KERNEL)
$(hide) gunzip -c $(KERNEL_OUT)/arch/arm/boot/compressed/piggy.gzip > $(KERNEL_OUT)/piggy

$(TARGET_PREBUILT_INT_KERNEL): $(KERNEL_OUT) $(KERNEL_CONFIG) $(KERNEL_HEADERS_INSTALL)
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE_PATH)arm-eabi-
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE_PATH)arm-eabi- modules
$(MAKE) -C kernel O=../$(KERNEL_OUT) INSTALL_MOD_PATH=../../$(KERNEL_MODULES_INSTALL) INSTALL_MOD_STRIP=1 ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE_PATH)arm-eabi- modules_install
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-linux-androideabi-
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-linux-androideabi- modules
$(MAKE) -C kernel O=../$(KERNEL_OUT) INSTALL_MOD_PATH=../../$(KERNEL_MODULES_INSTALL) INSTALL_MOD_STRIP=1 ARCH=arm CROSS_COMPILE=arm-linux-androideabi- modules_install
$(mv-modules)
$(clean-module-folder)
$(append-dtb)

$(KERNEL_HEADERS_INSTALL): $(KERNEL_OUT) $(KERNEL_CONFIG)
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE_PATH)arm-eabi- headers_install
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-linux-androideabi- headers_install

kerneltags: $(KERNEL_OUT) $(KERNEL_CONFIG)
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE_PATH)arm-eabi- tags
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-linux-androideabi- tags

kernelconfig: $(KERNEL_OUT) $(KERNEL_CONFIG)
env KCONFIG_NOTIMESTAMP=true \
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE_PATH)arm-eabi- menuconfig
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-linux-androideabi- menuconfig
env KCONFIG_NOTIMESTAMP=true \
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE_PATH)arm-eabi- savedefconfig
$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-linux-androideabi- savedefconfig
cp $(KERNEL_OUT)/defconfig kernel/arch/arm/configs/$(KERNEL_DEFCONFIG)

endif
1 change: 1 addition & 0 deletions arch/arm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ arch-$(CONFIG_CPU_32v3) :=-D__LINUX_ARM_ARCH__=3 -march=armv3
# doesn't even support -march=armv7-a, since in that situation we would have
# bigger problems.
arch-$(CONFIG_ARCH_MSM_KRAIT) :=-D__LINUX_ARM_ARCH__=7 $(call cc-option,-mcpu=cortex-a15,-march=armv7-a)
arch-$(CONFIG_MSM_CORTEX_A7) :=-D__LINUX_ARM_ARCH__=7 $(call cc-option,-mcpu=cortex-a15,-march=armv7-a)

# This selects how we optimise for the processor.
tune-$(CONFIG_CPU_ARM610) :=-mtune=arm610
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-msm/board-8974-gpiomux.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ static struct msm_gpiomux_config mdm_configs[] __initdata = {
},
};

static struct gpiomux_setting gpio_uart_config = {
static struct gpiomux_setting gpio_uart_config __initdata = {
.func = GPIOMUX_FUNC_2,
.drv = GPIOMUX_DRV_16MA,
.pull = GPIOMUX_PULL_NONE,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-msm/ext-buck-control.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ static int msm_ext_buck_probe(struct platform_device *pdev)
return ret;
}

static struct of_device_id msm_ext_buck_table[] = {
static struct of_device_id msm_ext_buck_table[] __initdata = {
{.compatible = "qcom,ext-buck-control"},
{},
};
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-msm/gdsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static struct regulator_ops gdsc_ops = {

static int __devinit gdsc_probe(struct platform_device *pdev)
{
static atomic_t gdsc_count = ATOMIC_INIT(-1);
static atomic_t gdsc_count __initdata = ATOMIC_INIT(-1);
struct regulator_init_data *init_data;
struct resource *res;
struct gdsc *sc;
Expand Down Expand Up @@ -274,7 +274,7 @@ static int __devexit gdsc_remove(struct platform_device *pdev)
return 0;
}

static struct of_device_id gdsc_match_table[] = {
static struct of_device_id gdsc_match_table[] __initdata = {
{ .compatible = "qcom,gdsc" },
{}
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-msm/krait-regulator-pmic.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ struct krait_vreg_pmic_chip {

static struct krait_vreg_pmic_chip *the_chip;

static struct of_device_id krait_vreg_pmic_match_table[] = {
static struct of_device_id krait_vreg_pmic_match_table[] __initdata = {
{ .compatible = KRAIT_REG_PMIC_DEV_NAME },
{}
};
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-msm/krait-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -1400,7 +1400,7 @@ static int __devexit krait_power_remove(struct platform_device *pdev)
return 0;
}

static struct of_device_id krait_power_match_table[] = {
static struct of_device_id krait_power_match_table[] __initdata = {
{ .compatible = "qcom,krait-regulator", },
{}
};
Expand All @@ -1415,7 +1415,7 @@ static struct platform_driver krait_power_driver = {
},
};

static struct of_device_id krait_pdn_match_table[] = {
static struct of_device_id krait_pdn_match_table[] __initdata = {
{ .compatible = "qcom,krait-pdn", },
{}
};
Expand Down
8 changes: 4 additions & 4 deletions arch/arm/mach-msm/lpm_levels.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static struct notifier_block __refdata lpm_cpu_nblk = {
};

static uint32_t allowed_l2_mode;
static uint32_t sysfs_dbg_l2_mode = MSM_SPM_L2_MODE_POWER_COLLAPSE;
static uint32_t sysfs_dbg_l2_mode __refdata = MSM_SPM_L2_MODE_POWER_COLLAPSE;
static uint32_t default_l2_mode;


Expand Down Expand Up @@ -1100,7 +1100,7 @@ static int lpm_probe(struct platform_device *pdev)
return -EFAULT;
}

static struct of_device_id cpu_modes_mtch_tbl[] = {
static struct of_device_id cpu_modes_mtch_tbl[] __initdata = {
{.compatible = "qcom,cpu-modes"},
{},
};
Expand All @@ -1114,7 +1114,7 @@ static struct platform_driver cpu_modes_driver = {
},
};

static struct of_device_id system_modes_mtch_tbl[] = {
static struct of_device_id system_modes_mtch_tbl[] __initdata = {
{.compatible = "qcom,system-modes"},
{},
};
Expand All @@ -1128,7 +1128,7 @@ static struct platform_driver system_modes_driver = {
},
};

static struct of_device_id lpm_levels_match_table[] = {
static struct of_device_id lpm_levels_match_table[] __initdata = {
{.compatible = "qcom,lpm-levels"},
{},
};
Expand Down
8 changes: 4 additions & 4 deletions arch/arm/mach-msm/mpm-of.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ enum mpm_reg_offsets {
MSM_MPM_REG_STATUS,
};

static DEFINE_SPINLOCK(msm_mpm_lock);
static __refdata DEFINE_SPINLOCK(msm_mpm_lock);

static uint32_t msm_mpm_enabled_irq[MSM_MPM_REG_WIDTH];
static uint32_t msm_mpm_wake_irq[MSM_MPM_REG_WIDTH];
Expand All @@ -113,7 +113,7 @@ enum {
MSM_MPM_DEBUG_NON_DETECTABLE_IRQ_IDLE = BIT(3),
};

static int msm_mpm_debug_mask = 1;
static int msm_mpm_debug_mask __refdata = 1;
module_param_named(
debug_mask, msm_mpm_debug_mask, int, S_IRUGO | S_IWUSR | S_IWGRP
);
Expand Down Expand Up @@ -721,12 +721,12 @@ static int __devinit msm_mpm_dev_probe(struct platform_device *pdev)
return 0;
}

static inline int __init mpm_irq_domain_linear_size(struct irq_domain *d)
static inline int mpm_irq_domain_linear_size(struct irq_domain *d)
{
return d->revmap_data.linear.size;
}

static inline int __init mpm_irq_domain_legacy_size(struct irq_domain *d)
static inline int mpm_irq_domain_legacy_size(struct irq_domain *d)
{
return d->revmap_data.legacy.size;
}
Expand Down
16 changes: 8 additions & 8 deletions arch/arm/mach-msm/msm-pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

#define MAX_BUF_SIZE 512

static int msm_pm_debug_mask = 1;
static int msm_pm_debug_mask __refdata = 1;
module_param_named(
debug_mask, msm_pm_debug_mask, int, S_IRUGO | S_IWUSR | S_IWGRP
);
Expand Down Expand Up @@ -113,14 +113,14 @@ static char *msm_pm_sleep_mode_labels[MSM_PM_SLEEP_MODE_NR] = {
"standalone_power_collapse",
};

static bool msm_pm_ldo_retention_enabled = true;
static bool msm_pm_ldo_retention_enabled __refdata = true;
static bool msm_no_ramp_down_pc;
static struct msm_pm_sleep_status_data *msm_pm_slp_sts;
DEFINE_PER_CPU(struct clk *, cpu_clks);
static struct clk *l2_clk;

static int cpu_count;
static DEFINE_SPINLOCK(cpu_cnt_lock);
static __refdata DEFINE_SPINLOCK(cpu_cnt_lock);
#define SCM_HANDOFF_LOCK_ID "S:7"
static bool need_scm_handoff_lock;
static remote_spinlock_t scm_handoff_lock;
Expand All @@ -134,7 +134,7 @@ static void __iomem *msm_pc_debug_counters;
* Default the l2 flush flag to OFF so the caches are flushed during power
* collapse unless the explicitly voted by lpm driver.
*/
static enum msm_pm_l2_scm_flag msm_pm_flush_l2_flag = MSM_SCM_L2_OFF;
static enum msm_pm_l2_scm_flag msm_pm_flush_l2_flag __refdata = MSM_SCM_L2_OFF;

void msm_pm_set_l2_flush_flag(enum msm_pm_l2_scm_flag flag)
{
Expand All @@ -148,7 +148,7 @@ static enum msm_pm_l2_scm_flag msm_pm_get_l2_flush_flag(void)
}

static cpumask_t retention_cpus;
static DEFINE_SPINLOCK(retention_lock);
static __refdata DEFINE_SPINLOCK(retention_lock);

static int msm_pm_get_pc_mode(struct device_node *node,
const char *key, uint32_t *pc_mode_val)
Expand Down Expand Up @@ -991,7 +991,7 @@ static int msm_cpu_status_probe(struct platform_device *pdev)
return 0;
};

static struct of_device_id msm_slp_sts_match_tbl[] = {
static struct of_device_id msm_slp_sts_match_tbl[] __initdata= {
{.compatible = "qcom,cpu-sleep-status"},
{},
};
Expand All @@ -1005,7 +1005,7 @@ static struct platform_driver msm_cpu_status_driver = {
},
};

static struct of_device_id msm_snoc_clnt_match_tbl[] = {
static struct of_device_id msm_snoc_clnt_match_tbl[] __initdata = {
{.compatible = "qcom,pm-snoc-client"},
{},
};
Expand Down Expand Up @@ -1272,7 +1272,7 @@ static int msm_cpu_pm_probe(struct platform_device *pdev)
return ret;
}

static struct of_device_id msm_cpu_pm_table[] = {
static struct of_device_id msm_cpu_pm_table[] __initdata = {
{.compatible = "qcom,pm-8x60"},
{},
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-msm/pm-data.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#include "pm.h"

struct msm_pm_platform_data msm_pm_sleep_modes[] = {
struct msm_pm_platform_data msm_pm_sleep_modes[] __refdata = {
[MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
.idle_supported = 1,
.suspend_supported = 1,
Expand Down
8 changes: 4 additions & 4 deletions arch/arm/mach-msm/rpm-smd.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ struct msm_rpm_driver_data {
#define MAX_ERR_BUFFER_SIZE 128
#define INIT_ERROR 1

static ATOMIC_NOTIFIER_HEAD(msm_rpm_sleep_notifier);
static __refdata ATOMIC_NOTIFIER_HEAD(msm_rpm_sleep_notifier);
static bool standalone;

int msm_rpm_register_notifier(struct notifier_block *nb)
Expand Down Expand Up @@ -314,7 +314,7 @@ static void tr_update(struct slp_buf *s, char *buf)
int msm_rpm_smd_buffer_request(char *buf, uint32_t size, gfp_t flag)
{
struct slp_buf *slp;
static DEFINE_SPINLOCK(slp_buffer_lock);
static __refdata DEFINE_SPINLOCK(slp_buffer_lock);
unsigned long flags;

if (size > MAX_SLEEP_BUFFER)
Expand Down Expand Up @@ -452,7 +452,7 @@ struct msm_rpm_wait_data {
int errno;
struct completion ack;
};
DEFINE_SPINLOCK(msm_rpm_list_lock);
__refdata DEFINE_SPINLOCK(msm_rpm_list_lock);

struct msm_rpm_ack_msg {
uint32_t req;
Expand Down Expand Up @@ -1403,7 +1403,7 @@ static int __devinit msm_rpm_dev_probe(struct platform_device *pdev)
return -EINVAL;
}

static struct of_device_id msm_rpm_match_table[] = {
static struct of_device_id msm_rpm_match_table[] __initdata = {
{.compatible = "qcom,rpm-smd"},
{},
};
Expand Down
3 changes: 3 additions & 0 deletions scripts/gcc-wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
allowed_warnings = set([
"return_address.c:62",
"hci_conn.c:407",
"cpufreq_interactive.c:804",
"cpufreq_interactive.c:847",
"ene_ub6250.c:2118",
])

# Capture the name of the object file, can find it.
Expand Down

0 comments on commit 1ec0b65

Please sign in to comment.